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 => {
return;
}
// 添加外部字段
if (type === 'edit') {
let fil = { ...filed };
fil['外部字段'] = [];
let isExternal;
form
.getFieldValue(fileds)
.split(',')
.forEach(item => {
isExternal = allFileds.some(val => val === item);
if (!isExternal && item !== '') {
fil['外部字段'].push(item);
}
});
if (fil['外部字段'].length === 0) {
delete fil['外部字段'];
let fil = { ...filed };
fil['外部字段'] = [];
let isExternal;
let list = form.getFieldValue(fileds) ? form.getFieldValue(fileds).split(',') : [];
list.forEach(item => {
isExternal = allFileds.some(val => val === item);
if (!isExternal && item !== '') {
fil['外部字段'].push(item);
}
setFiled(fil);
setCheckedList(form.getFieldValue(fileds).split(','));
});
if (fil['外部字段'].length === 0) {
delete fil['外部字段'];
}
setFiled(fil);
setCheckedList(list);
setPickItem(fileds);
setIsVisible(true);
};
......@@ -482,7 +478,10 @@ const BookConfig = props => {
</Form>
<ChangeAdd
visible={isVisible}
onCancel={() => setIsVisible(false)}
onCancel={() => {
setIsVisible(false);
setCheckedList([]);
}}
callBackSubmit={onOK}
newCheckedList={checkedList}
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