Commit daba7b45 by zhaochengxiang

anchor

parent 96998ab5
...@@ -6,24 +6,21 @@ ...@@ -6,24 +6,21 @@
padding: 0 15px; padding: 0 15px;
background-color: #464d6e; background-color: #464d6e;
align-items: center; align-items: center;
position: fixed; // position: fixed;
justify-content: space-between; justify-content: space-between;
border-bottom: 1px solid #EFEFEF; border-bottom: 1px solid #EFEFEF;
z-index: 100; // z-index: 100;
} }
.edit-container { .edit-container {
top: 44px;
width: 100%;
height: calc(100vh - 44px - 64px);
overflow: auto;
background: #EDF0F5; background: #EDF0F5;
padding: 10px 20px; height: calc(100vh - 44px - 64px);
position: absolute; overflow: hidden;
} }
.edit-container-card { .edit-container-card {
padding: 20px; margin: 10px 20px;
height: calc(100vh - 44px - 64px - 20px);
background: #fff; background: #fff;
} }
......
import React, { useState, useEffect, useRef, useImperativeHandle } from 'react'; import React, { useState, useEffect, useRef, useImperativeHandle } from 'react';
import { Spin } from 'antd'; import { Spin, Tabs, Anchor, Affix, Button } from 'antd';
import LocalStorage from 'local-storage'; import LocalStorage from 'local-storage';
import ImportActionHeader from './ImportActionHeader'; import ImportActionHeader from './ImportActionHeader';
...@@ -538,46 +538,57 @@ const ImportAction = React.forwardRef((props, ref) => { ...@@ -538,46 +538,57 @@ const ImportAction = React.forwardRef((props, ref) => {
return ( return (
<Spin spinning={loading}> <Spin spinning={loading}>
{ {
(action==='detail' && ((modelerData||{}).optionList||[]).findIndex(item => item.enabled && item.name==='查看') === -1) ? <span> (action==='detail' && ((modelerData||{}).optionList||[]).findIndex(item => item.enabled && item.name==='查看') === -1) ? <div style={{ padding: '10px 20px' }}>
{loading?'':'暂无权限'} {loading?'':'暂无权限'}
</span> : <React.Fragment> </div> : <div>
<ImportActionHeader <div style={{ position: 'sticky', top: 0 }}>
form={form} <Tabs centered onChange={(val) => {
editable={action!=='detail'&&action!=='flow'&&action!=='detail-version'&&action!=='edit-inherited'} var targetElement = document.getElementById(val); // 找到目标元素
modelerData={modelerData||{}} targetElement?.scrollIntoView()
constraints={constraints} }} style={{ margin: 0 }}>
templates={templates} <Tabs.TabPane tab='基本信息' key="1" />
validateReports={validateReports} <Tabs.TabPane tab='数据表结构' key="model-import-action-table" />
onTemplateChange={onTemplateChange} </Tabs>
onConstraintChange={onConstraintChange} </div>
onChange={onHeaderChange} <div style={{ height: 'calc(100vh - 44px - 64px - 82px)', overflow: 'auto', padding: '0 20px' }}>
terms={terms} <ImportActionHeader
supportedPartitionTypes={supportedPartitionTypes} form={form}
/> editable={action!=='detail'&&action!=='flow'&&action!=='detail-version'&&action!=='edit-inherited'}
<ImportActionInherited modelerData={modelerData} action={action} /> modelerData={modelerData||{}}
<ImportActionTable constraints={constraints}
modelerData={modelerData||{}} templates={templates}
constraint={constraint} validateReports={validateReports}
template={template} onTemplateChange={onTemplateChange}
validateReports={validateReports} onConstraintChange={onConstraintChange}
supportedDatatypes={supportedDatatypes} onChange={onHeaderChange}
onChange={onTableChange} terms={terms}
editable={action!=='detail'&&action!=='flow'&&action!=='detail-version'&&action!=='edit-inherited'} supportedPartitionTypes={supportedPartitionTypes}
action={action} />
originAction={getQueryParam(Action, props?.location?.search)} <ImportActionInherited modelerData={modelerData} action={action} />
terms={terms} <ImportActionTable
/> modelerData={modelerData||{}}
<ImportActionIndex constraint={constraint}
modelerData={modelerData||{}} template={template}
constraint={constraint} validateReports={validateReports}
template={template} supportedDatatypes={supportedDatatypes}
types={supportedIndextypes} onChange={onTableChange}
validateReports={validateReports} editable={action!=='detail'&&action!=='flow'&&action!=='detail-version'&&action!=='edit-inherited'}
onChange={onIndexChange} action={action}
editable={action!=='detail'&&action!=='flow'&&action!=='detail-version'&&action!=='edit-inherited'} originAction={getQueryParam(Action, props?.location?.search)}
terms={terms} terms={terms}
/> />
</React.Fragment> <ImportActionIndex
modelerData={modelerData||{}}
constraint={constraint}
template={template}
types={supportedIndextypes}
validateReports={validateReports}
onChange={onIndexChange}
editable={action!=='detail'&&action!=='flow'&&action!=='detail-version'&&action!=='edit-inherited'}
terms={terms}
/>
</div>
</div>
} }
</Spin> </Spin>
); );
......
...@@ -1177,7 +1177,7 @@ export const ImportActionTable = (props) => { ...@@ -1177,7 +1177,7 @@ export const ImportActionTable = (props) => {
} }
return ( return (
<div className='model-import-action-table'> <div className='model-import-action-table' id='model-import-action-table'>
<div className='d-flex mb-3' style={{ justifyContent: 'space-between', alignItems: 'center' }}> <div className='d-flex mb-3' style={{ justifyContent: 'space-between', alignItems: 'center' }}>
<Space> <Space>
<h2 style={{ marginBottom: 0 }}>数据表结构</h2> <h2 style={{ marginBottom: 0 }}>数据表结构</h2>
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment