Commit 5710f7bf authored by 涂伟's avatar 涂伟

fix: '表单设计器bug调试'

parent ecaeae7f
Pipeline #69057 passed with stages
......@@ -115,9 +115,9 @@ const AddModal = props => {
}, []);
useEffect(() => {
if (props.tableInfo.id) {
setSelectTreeData(props.tableInfo.keepData);
setSelectDataFirst(props.tableInfo.keepTreeFirst);
if (props.location.state.id) {
setSelectTreeData(props.location.state.keepData);
setSelectDataFirst(props.location.state.keepTreeFirst);
if (treeSelectValue) {
let ss = treeSelectValue.substring(0, treeSelectValue.lastIndexOf('@'));
setFormObj(treeSelectValue.substring(0, treeSelectValue.lastIndexOf('@')));
......@@ -158,7 +158,7 @@ const AddModal = props => {
i.fieldName = i.name;
i.configInfo = i.config;
i.presetValue = i.preset == '(无)' ? '' : i.preset;
i.showCss = props.tableInfo.template.tableStyle;
i.showCss = props.location.state.template.tableStyle;
i.tableName = ss;
i.uiGroup = item;
i.readOnly = i.readOnly == '是' ? 1 : 0;
......@@ -172,7 +172,7 @@ const AddModal = props => {
});
flowNodeMeta.groups = arrdata;
list.flowNodeMeta = flowNodeMeta;
list.showCss = props.tableInfo.template.tableStyle;
list.showCss = props.location.state.template.tableStyle;
console.log(list);
let tablesSchema = {
......@@ -194,11 +194,11 @@ const AddModal = props => {
}
});
} else {
let ss = props.tableInfo.id;
setFormObj(props.tableInfo.id);
setFormName(props.tableInfo.name);
let ss = props.location.state.id;
setFormObj(props.location.state.id);
setFormName(props.location.state.name);
reloadTableFields({
tableName: props.tableInfo.id,
tableName: props.location.state.id,
}).then(res => {
setTreeLoading(false);
if (res.msg === 'Ok') {
......@@ -214,7 +214,7 @@ const AddModal = props => {
console.log(arrlist);
setKeepTree(arrlist);
data.TableFieldNames = arrlist;
data.TableName = props.tableInfo.id;
data.TableName = props.location.state.id;
listArr.push(data);
setKeepTreeData(listArr);
let arr = formateArrDataA(res.data.root, 'group');
......@@ -234,7 +234,7 @@ const AddModal = props => {
i.fieldName = i.name;
i.configInfo = i.config;
i.presetValue = i.preset == '(无)' ? '' : i.preset;
i.showCss = props.tableInfo.template.tableStyle;
i.showCss = props.location.state.template.tableStyle;
i.tableName = ss;
i.uiGroup = item;
i.readOnly = i.readOnly == '是' ? 1 : 0;
......@@ -248,7 +248,7 @@ const AddModal = props => {
});
flowNodeMeta.groups = arrdata;
list.flowNodeMeta = flowNodeMeta;
list.showCss = props.tableInfo.template.tableStyle;
list.showCss = props.location.state.template.tableStyle;
console.log(list);
let tablesSchema = {
......@@ -316,7 +316,7 @@ const AddModal = props => {
// 返回上一级
const back = () => {
console.log(props.tableInfo);
console.log(props.location.state);
let {
template,
tableScroll,
......@@ -325,7 +325,7 @@ const AddModal = props => {
groupArr,
searchValue,
select,
} = props.tableInfo;
} = props.location.state;
console.log(keepValue);
console.log(pickIndex, groupArr, 'back');
history.push({
......@@ -389,7 +389,7 @@ const AddModal = props => {
i.fieldName = i.name;
i.configInfo = i.config;
i.presetValue = i.preset == '(无)' ? '' : i.preset;
i.showCss = props.tableInfo.template.tableStyle;
i.showCss = props.location.state.template.tableStyle;
i.tableName = ss;
i.uiGroup = item;
i.readOnly = i.readOnly == '是' ? 1 : 0;
......@@ -403,7 +403,7 @@ const AddModal = props => {
});
flowNodeMeta.groups = arrdata;
list.flowNodeMeta = flowNodeMeta;
list.showCss = props.tableInfo.template.tableStyle;
list.showCss = props.location.state.template.tableStyle;
console.log(list);
let tablesSchema = {
......@@ -449,7 +449,7 @@ const AddModal = props => {
});
});
} else {
setPramFormObj(props.tableInfo.template);
setPramFormObj(props.location.state.template);
}
setType('affiliateAdd');
setVisible(true);
......@@ -464,7 +464,7 @@ const AddModal = props => {
{/* <Spin tip="loading..." spinning={treeLoading}> */}
<div className={styles.containerBox}>
<div className={styles.config}>
{/* <ArrowLeftOutlined onClick={back} className={styles.goBack} /> */}
<ArrowLeftOutlined onClick={back} className={styles.goBack} />
<div className={styles.title}> 展示名称 【{formName}</div>
<div style={{ display: 'flex', justifyContent: 'flex-end' }}>
{/* <div style={{ lineHeight: '32px', marginRight: '5px' }}>快速切换表:</div>
......@@ -529,7 +529,7 @@ const AddModal = props => {
</div>
</div>
<div style={{ width: '100%', height: 'calc(100% - 63px)', padding: '10px' }}>
{formObj && <FormDesigner ref={formRef} tableName={formObj} />}
{formObj && <FormDesigner ref={formRef} tableName={formObj} extra={true} />}
</div>
</div>
{/* </Spin> */}
......
......@@ -217,24 +217,24 @@ const TableManager = props => {
const fieldsConfig = (record, e) => {
e.stopPropagation();
setFormObj(record);
pushFieldConfig(record);
// history.push({
// pathname: `/biz/account/fieldConfig`,
// state: {
// 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,
// },
// });
// pushFieldConfig(record);
history.push({
pathname: `/biz/account/fieldConfig`,
state: {
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,
},
});
// setType('config');
// setVisible(true);
};
......@@ -379,38 +379,38 @@ const TableManager = props => {
};
const pushFieldConfig = record => {
// history.push({
// pathname: `/biz/account/fieldConfig`,
// state: {
// 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,
// },
// });
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,
history.push({
pathname: `/biz/account/fieldConfig`,
state: {
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 = [
......
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