Commit fb3dc96f authored by 皮倩雯's avatar 皮倩雯
parents 298c3429 adb873ad
Pipeline #49521 passed with stages
in 4 minutes 46 seconds
...@@ -203,25 +203,21 @@ const BookConfig = props => { ...@@ -203,25 +203,21 @@ const BookConfig = props => {
return; return;
} }
// 添加外部字段 // 添加外部字段
if (type === 'edit') { let fil = { ...filed };
let fil = { ...filed }; fil['外部字段'] = [];
fil['外部字段'] = []; let isExternal;
let isExternal; let list = form.getFieldValue(fileds) ? form.getFieldValue(fileds).split(',') : [];
form list.forEach(item => {
.getFieldValue(fileds) isExternal = allFileds.some(val => val === item);
.split(',') if (!isExternal && item !== '') {
.forEach(item => { fil['外部字段'].push(item);
isExternal = allFileds.some(val => val === item);
if (!isExternal && item !== '') {
fil['外部字段'].push(item);
}
});
if (fil['外部字段'].length === 0) {
delete fil['外部字段'];
} }
setFiled(fil); });
setCheckedList(form.getFieldValue(fileds).split(',')); if (fil['外部字段'].length === 0) {
delete fil['外部字段'];
} }
setFiled(fil);
setCheckedList(list);
setPickItem(fileds); setPickItem(fileds);
setIsVisible(true); setIsVisible(true);
}; };
...@@ -482,7 +478,10 @@ const BookConfig = props => { ...@@ -482,7 +478,10 @@ const BookConfig = props => {
</Form> </Form>
<ChangeAdd <ChangeAdd
visible={isVisible} visible={isVisible}
onCancel={() => setIsVisible(false)} onCancel={() => {
setIsVisible(false);
setCheckedList([]);
}}
callBackSubmit={onOK} callBackSubmit={onOK}
newCheckedList={checkedList} newCheckedList={checkedList}
filed={filed} filed={filed}
......
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