Commit 3bae5d7f authored by 皮倩雯's avatar 皮倩雯

fix: '优化parseForm弹窗显示'

parent 2d9e78d4
Pipeline #64413 passed with stages
...@@ -3,24 +3,7 @@ import { Modal, Space, Button } from 'antd'; ...@@ -3,24 +3,7 @@ import { Modal, Space, Button } from 'antd';
import ParseForm from 'parseForm'; import ParseForm from 'parseForm';
import styles from './index.less'; import styles from './index.less';
const PerviewPrase = props => { const PerviewPrase = props => {
const { visible, onCancel, accountData } = props; const { visible, onCancel, tablesSchema } = props;
const [loading, setLoading] = useState(false);
const [data, setData] = useState({});
useEffect(() => {
console.log(accountData);
if (visible) {
let tablesSchema = {
child: {},
groups: accountData.flowNodeMeta.groups,
values: [],
modules: [],
relationForm: {},
};
setData(tablesSchema);
}
}, [visible]);
return ( return (
<div className={styles.PerviewParse}> <div className={styles.PerviewParse}>
...@@ -29,9 +12,8 @@ const PerviewPrase = props => { ...@@ -29,9 +12,8 @@ const PerviewPrase = props => {
bodyStyle={{ bodyStyle={{
width: '100%', width: '100%',
minHeight: '200px', minHeight: '200px',
maxHeight: '780px', height: '780px',
overflow: 'scroll', overflow: 'hidden',
overflowX: 'hidden',
}} }}
width="1800px" width="1800px"
style={{ marginTop: '-80px' }} style={{ marginTop: '-80px' }}
...@@ -45,12 +27,10 @@ const PerviewPrase = props => { ...@@ -45,12 +27,10 @@ const PerviewPrase = props => {
</Space> </Space>
} }
{...props} {...props}
confirmLoading={loading}
forceRender forceRender
getContainer={false} getContainer={false}
> >
{console.log(window.globalConfig.mapsettings)} {visible && <ParseForm tablesSchema={tablesSchema} noButtons />}
{visible && <ParseForm tablesSchema={data} noButtons />}
</Modal> </Modal>
</div> </div>
); );
......
...@@ -70,7 +70,7 @@ const AddModal = props => { ...@@ -70,7 +70,7 @@ const AddModal = props => {
const [keepTreeData, setKeepTreeData] = useState([]); const [keepTreeData, setKeepTreeData] = useState([]);
const [keepTree, setKeepTree] = useState([]); // 保存树字段名称 const [keepTree, setKeepTree] = useState([]); // 保存树字段名称
const [perviewPrase, setPerViewPrase] = useState(false); const [perviewPrase, setPerViewPrase] = useState(false);
const [accountData, setAccountData] = useState({}); const [tablesSchema, setTablesSchema] = useState(null); // 存储parseForm组件需要的数据格式
const editor = record => { const editor = record => {
console.log(record); console.log(record);
...@@ -395,7 +395,15 @@ const AddModal = props => { ...@@ -395,7 +395,15 @@ const AddModal = props => {
list.flowNodeMeta = flowNodeMeta; list.flowNodeMeta = flowNodeMeta;
list.showCss = props.location.state.template.tableStyle; list.showCss = props.location.state.template.tableStyle;
console.log(list); console.log(list);
setAccountData(list);
let tablesSchema = {
child: {},
groups: list.flowNodeMeta.groups,
values: [],
modules: [],
relationForm: {},
};
setTablesSchema(tablesSchema);
console.log(arr); console.log(arr);
console.log(newArr); console.log(newArr);
...@@ -462,7 +470,15 @@ const AddModal = props => { ...@@ -462,7 +470,15 @@ const AddModal = props => {
list.flowNodeMeta = flowNodeMeta; list.flowNodeMeta = flowNodeMeta;
list.showCss = props.location.state.template.tableStyle; list.showCss = props.location.state.template.tableStyle;
console.log(list); console.log(list);
setAccountData(list);
let tablesSchema = {
child: {},
groups: list.flowNodeMeta.groups,
values: [],
modules: [],
relationForm: {},
};
setTablesSchema(tablesSchema);
console.log(aa, 'aaaaaaaaaaaaa'); console.log(aa, 'aaaaaaaaaaaaa');
console.log(arr); console.log(arr);
console.log(newArr); console.log(newArr);
...@@ -705,7 +721,15 @@ const AddModal = props => { ...@@ -705,7 +721,15 @@ const AddModal = props => {
list.flowNodeMeta = flowNodeMeta; list.flowNodeMeta = flowNodeMeta;
list.showCss = props.location.state.template.tableStyle; list.showCss = props.location.state.template.tableStyle;
console.log(list); console.log(list);
setAccountData(list);
let tablesSchema = {
child: {},
groups: list.flowNodeMeta.groups,
values: [],
modules: [],
relationForm: {},
};
setTablesSchema(tablesSchema);
setKeepTreeFirst(bb); setKeepTreeFirst(bb);
setTreeData(aa); setTreeData(aa);
setSelect(newArr); setSelect(newArr);
...@@ -898,7 +922,7 @@ const AddModal = props => { ...@@ -898,7 +922,7 @@ const AddModal = props => {
)} )}
<PerviewPrase <PerviewPrase
visible={perviewPrase} visible={perviewPrase}
accountData={accountData} tablesSchema={tablesSchema}
onCancel={() => setPerViewPrase(false)} onCancel={() => setPerViewPrase(false)}
/> />
</> </>
......
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