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