Commit 03620b16 authored by 涂伟's avatar 涂伟

fix: '表单设计器全屏弹窗交互添加'

parent 4184aa98
Pipeline #69015 waiting for manual action with stages
...@@ -122,7 +122,7 @@ ...@@ -122,7 +122,7 @@
"js-calendar-converter": "0.0.4", "js-calendar-converter": "0.0.4",
"lodash": "4.17.11", "lodash": "4.17.11",
"minimist": "1.2.0", "minimist": "1.2.0",
"panda-xform": "^2.6.0", "panda-xform": "^2.5.8",
"parseForm": "^2.2.4", "parseForm": "^2.2.4",
"prop-types": "15.7.2", "prop-types": "15.7.2",
"quill": "^1.3.7", "quill": "^1.3.7",
......
...@@ -115,9 +115,9 @@ const AddModal = props => { ...@@ -115,9 +115,9 @@ const AddModal = props => {
}, []); }, []);
useEffect(() => { useEffect(() => {
if (props.location.state.id) { if (props.tableInfo.id) {
setSelectTreeData(props.location.state.keepData); setSelectTreeData(props.tableInfo.keepData);
setSelectDataFirst(props.location.state.keepTreeFirst); setSelectDataFirst(props.tableInfo.keepTreeFirst);
if (treeSelectValue) { if (treeSelectValue) {
let ss = treeSelectValue.substring(0, treeSelectValue.lastIndexOf('@')); let ss = treeSelectValue.substring(0, treeSelectValue.lastIndexOf('@'));
setFormObj(treeSelectValue.substring(0, treeSelectValue.lastIndexOf('@'))); setFormObj(treeSelectValue.substring(0, treeSelectValue.lastIndexOf('@')));
...@@ -158,7 +158,7 @@ const AddModal = props => { ...@@ -158,7 +158,7 @@ const AddModal = props => {
i.fieldName = i.name; i.fieldName = i.name;
i.configInfo = i.config; i.configInfo = i.config;
i.presetValue = i.preset == '(无)' ? '' : i.preset; i.presetValue = i.preset == '(无)' ? '' : i.preset;
i.showCss = props.location.state.template.tableStyle; i.showCss = props.tableInfo.template.tableStyle;
i.tableName = ss; i.tableName = ss;
i.uiGroup = item; i.uiGroup = item;
i.readOnly = i.readOnly == '是' ? 1 : 0; i.readOnly = i.readOnly == '是' ? 1 : 0;
...@@ -172,7 +172,7 @@ const AddModal = props => { ...@@ -172,7 +172,7 @@ const AddModal = props => {
}); });
flowNodeMeta.groups = arrdata; flowNodeMeta.groups = arrdata;
list.flowNodeMeta = flowNodeMeta; list.flowNodeMeta = flowNodeMeta;
list.showCss = props.location.state.template.tableStyle; list.showCss = props.tableInfo.template.tableStyle;
console.log(list); console.log(list);
let tablesSchema = { let tablesSchema = {
...@@ -194,11 +194,11 @@ const AddModal = props => { ...@@ -194,11 +194,11 @@ const AddModal = props => {
} }
}); });
} else { } else {
let ss = props.location.state.id; let ss = props.tableInfo.id;
setFormObj(props.location.state.id); setFormObj(props.tableInfo.id);
setFormName(props.location.state.name); setFormName(props.tableInfo.name);
reloadTableFields({ reloadTableFields({
tableName: props.location.state.id, tableName: props.tableInfo.id,
}).then(res => { }).then(res => {
setTreeLoading(false); setTreeLoading(false);
if (res.msg === 'Ok') { if (res.msg === 'Ok') {
...@@ -214,7 +214,7 @@ const AddModal = props => { ...@@ -214,7 +214,7 @@ const AddModal = props => {
console.log(arrlist); console.log(arrlist);
setKeepTree(arrlist); setKeepTree(arrlist);
data.TableFieldNames = arrlist; data.TableFieldNames = arrlist;
data.TableName = props.location.state.id; data.TableName = props.tableInfo.id;
listArr.push(data); listArr.push(data);
setKeepTreeData(listArr); setKeepTreeData(listArr);
let arr = formateArrDataA(res.data.root, 'group'); let arr = formateArrDataA(res.data.root, 'group');
...@@ -234,7 +234,7 @@ const AddModal = props => { ...@@ -234,7 +234,7 @@ const AddModal = props => {
i.fieldName = i.name; i.fieldName = i.name;
i.configInfo = i.config; i.configInfo = i.config;
i.presetValue = i.preset == '(无)' ? '' : i.preset; i.presetValue = i.preset == '(无)' ? '' : i.preset;
i.showCss = props.location.state.template.tableStyle; i.showCss = props.tableInfo.template.tableStyle;
i.tableName = ss; i.tableName = ss;
i.uiGroup = item; i.uiGroup = item;
i.readOnly = i.readOnly == '是' ? 1 : 0; i.readOnly = i.readOnly == '是' ? 1 : 0;
...@@ -248,7 +248,7 @@ const AddModal = props => { ...@@ -248,7 +248,7 @@ const AddModal = props => {
}); });
flowNodeMeta.groups = arrdata; flowNodeMeta.groups = arrdata;
list.flowNodeMeta = flowNodeMeta; list.flowNodeMeta = flowNodeMeta;
list.showCss = props.location.state.template.tableStyle; list.showCss = props.tableInfo.template.tableStyle;
console.log(list); console.log(list);
let tablesSchema = { let tablesSchema = {
...@@ -316,7 +316,7 @@ const AddModal = props => { ...@@ -316,7 +316,7 @@ const AddModal = props => {
// 返回上一级 // 返回上一级
const back = () => { const back = () => {
console.log(props.location.state); console.log(props.tableInfo);
let { let {
template, template,
tableScroll, tableScroll,
...@@ -325,7 +325,7 @@ const AddModal = props => { ...@@ -325,7 +325,7 @@ const AddModal = props => {
groupArr, groupArr,
searchValue, searchValue,
select, select,
} = props.location.state; } = props.tableInfo;
console.log(keepValue); console.log(keepValue);
console.log(pickIndex, groupArr, 'back'); console.log(pickIndex, groupArr, 'back');
history.push({ history.push({
...@@ -389,7 +389,7 @@ const AddModal = props => { ...@@ -389,7 +389,7 @@ const AddModal = props => {
i.fieldName = i.name; i.fieldName = i.name;
i.configInfo = i.config; i.configInfo = i.config;
i.presetValue = i.preset == '(无)' ? '' : i.preset; i.presetValue = i.preset == '(无)' ? '' : i.preset;
i.showCss = props.location.state.template.tableStyle; i.showCss = props.tableInfo.template.tableStyle;
i.tableName = ss; i.tableName = ss;
i.uiGroup = item; i.uiGroup = item;
i.readOnly = i.readOnly == '是' ? 1 : 0; i.readOnly = i.readOnly == '是' ? 1 : 0;
...@@ -403,7 +403,7 @@ const AddModal = props => { ...@@ -403,7 +403,7 @@ const AddModal = props => {
}); });
flowNodeMeta.groups = arrdata; flowNodeMeta.groups = arrdata;
list.flowNodeMeta = flowNodeMeta; list.flowNodeMeta = flowNodeMeta;
list.showCss = props.location.state.template.tableStyle; list.showCss = props.tableInfo.template.tableStyle;
console.log(list); console.log(list);
let tablesSchema = { let tablesSchema = {
...@@ -449,7 +449,7 @@ const AddModal = props => { ...@@ -449,7 +449,7 @@ const AddModal = props => {
}); });
}); });
} else { } else {
setPramFormObj(props.location.state.template); setPramFormObj(props.tableInfo.template);
} }
setType('affiliateAdd'); setType('affiliateAdd');
setVisible(true); setVisible(true);
......
...@@ -217,24 +217,24 @@ const TableManager = props => { ...@@ -217,24 +217,24 @@ const TableManager = props => {
const fieldsConfig = (record, e) => { const fieldsConfig = (record, e) => {
e.stopPropagation(); e.stopPropagation();
setFormObj(record); setFormObj(record);
// pushFieldConfig(record); pushFieldConfig(record);
history.push({ // history.push({
pathname: `/biz/account/fieldConfig`, // pathname: `/biz/account/fieldConfig`,
state: { // state: {
name: record.tableAlias || record.tableName, // name: record.tableAlias || record.tableName,
id: record.tableName, // id: record.tableName,
template: record, // template: record,
tableScroll: document.querySelector('.ant-table-body').scrollTop, // tableScroll: document.querySelector('.ant-table-body').scrollTop,
groupArr: groupArr, // groupArr: groupArr,
pickIndex: pickIndex, // pickIndex: pickIndex,
searchValue: searchValue, // searchValue: searchValue,
select: select, // select: select,
keepValue: keepValue, // keepValue: keepValue,
keepTreeSelect: keepTreeSelect, // keepTreeSelect: keepTreeSelect,
keepTreeFirst: keepTreeFirst, // keepTreeFirst: keepTreeFirst,
keepData: keepData, // keepData: keepData,
}, // },
}); // });
// setType('config'); // setType('config');
// setVisible(true); // setVisible(true);
}; };
...@@ -379,38 +379,38 @@ const TableManager = props => { ...@@ -379,38 +379,38 @@ const TableManager = props => {
}; };
const pushFieldConfig = record => { const pushFieldConfig = record => {
history.push({ // history.push({
pathname: `/biz/account/fieldConfig`, // pathname: `/biz/account/fieldConfig`,
state: { // state: {
name: record.tableAlias || record.tableName, // name: record.tableAlias || record.tableName,
id: record.tableName, // id: record.tableName,
template: record, // template: record,
tableScroll: document.querySelector('.ant-table-body').scrollTop, // tableScroll: document.querySelector('.ant-table-body').scrollTop,
groupArr: groupArr, // groupArr: groupArr,
pickIndex: pickIndex, // pickIndex: pickIndex,
searchValue: searchValue, // searchValue: searchValue,
select: select, // select: select,
keepValue: keepValue, // keepValue: keepValue,
keepTreeSelect: keepTreeSelect, // keepTreeSelect: keepTreeSelect,
keepTreeFirst: keepTreeFirst, // keepTreeFirst: keepTreeFirst,
keepData: keepData, // keepData: keepData,
}, // },
});
// setTableInfo({
// name: record.tableAlias || record.tableName,
// id: record.tableName,
// template: record,
// tableScroll: document.querySelector('.ant-table-body').scrollTop,
// groupArr: groupArr,
// pickIndex: pickIndex,
// searchValue: searchValue,
// select: select,
// keepValue: keepValue,
// keepTreeSelect: keepTreeSelect,
// keepTreeFirst: keepTreeFirst,
// keepData: keepData,
// }); // });
// setFieldConfigShow(true); setTableInfo({
name: record.tableAlias || record.tableName,
id: record.tableName,
template: record,
tableScroll: document.querySelector('.ant-table-body').scrollTop,
groupArr: groupArr,
pickIndex: pickIndex,
searchValue: searchValue,
select: select,
keepValue: keepValue,
keepTreeSelect: keepTreeSelect,
keepTreeFirst: keepTreeFirst,
keepData: keepData,
});
setFieldConfigShow(true);
}; };
const columns = [ const columns = [
...@@ -907,7 +907,7 @@ const TableManager = props => { ...@@ -907,7 +907,7 @@ const TableManager = props => {
}} }}
getContainer={false} getContainer={false}
> >
<AddModal tableInfo={tableInfo} show={fieldConfigShow} /> {fieldConfigShow ? <AddModal tableInfo={tableInfo} show={fieldConfigShow} /> : null}
</Modal> </Modal>
</PageContainer> </PageContainer>
</Spin> </Spin>
......
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