Commit adb873ad authored by 邓超's avatar 邓超

fix: 修改台账管理选择字段回显问题

parent 1a15e10e
Pipeline #49520 skipped with stages
......@@ -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