Commit df585b3e by zhaochengxiang

bug fix

parent 2a617a4c
...@@ -171,15 +171,16 @@ export const EditAssets = React.forwardRef(function ({ action, type, ids, elemen ...@@ -171,15 +171,16 @@ export const EditAssets = React.forwardRef(function ({ action, type, ids, elemen
await save() await save()
}, },
getModifyData: () => { getModifyData: () => {
const newModifyData = [...modifyData]
for (const item of newModifyData??[]) {
if ((item.paths??[]).length > 0) {
item.dirIds = item.paths.map(_item => _item.value)
}
}
return { return {
elementList: elements, elementList: elements,
rowDataList: produce(modifyData, (draft) => { rowDataList: newModifyData
for (const item of draft??[]) {
if ((item.paths??[]).length > 0) {
item.dirIds = item.paths.map(_item => _item.value)
}
}
})
} }
}, },
}), [form, editingKey, modifyData, elements]) }), [form, editingKey, modifyData, elements])
...@@ -226,6 +227,7 @@ export const EditAssets = React.forwardRef(function ({ action, type, ids, elemen ...@@ -226,6 +227,7 @@ export const EditAssets = React.forwardRef(function ({ action, type, ids, elemen
type="primary" type="primary"
onClick={ async () => { onClick={ async () => {
const rows = colBatchEditForm.getFieldsValue() const rows = colBatchEditForm.getFieldsValue()
if (!rows[element.name]) { if (!rows[element.name]) {
confirm?.() confirm?.()
return return
...@@ -250,7 +252,7 @@ export const EditAssets = React.forwardRef(function ({ action, type, ids, elemen ...@@ -250,7 +252,7 @@ export const EditAssets = React.forwardRef(function ({ action, type, ids, elemen
setModifyData(newModifyData) setModifyData(newModifyData)
confirm?.() confirm?.()
} catch (e) { } catch (e) {
console.log('e', e)
} }
}} }}
> >
......
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