Commit 398a36c6 by zhaochengxiang

bug fix

parent e89c1310
...@@ -17,6 +17,7 @@ import produce from 'immer' ...@@ -17,6 +17,7 @@ import produce from 'immer'
const pathElement = { const pathElement = {
name: '资产目录', name: '资产目录',
supportBatchEdit: '是', supportBatchEdit: '是',
require: true,
} }
//elementIds为空时,表示资源批量转资产. //elementIds为空时,表示资源批量转资产.
...@@ -190,7 +191,6 @@ export const EditAssets = React.forwardRef(function ({ action, type, ids, elemen ...@@ -190,7 +191,6 @@ export const EditAssets = React.forwardRef(function ({ action, type, ids, elemen
<Form.Item <Form.Item
name={dataIndex} name={dataIndex}
label={element?.name} label={element?.name}
rules={[{ required: true, message: `请输入${element?.name}!` }]}
style={{ marginBottom: 15 }} style={{ marginBottom: 15 }}
> >
{ {
...@@ -212,9 +212,14 @@ export const EditAssets = React.forwardRef(function ({ action, type, ids, elemen ...@@ -212,9 +212,14 @@ export const EditAssets = React.forwardRef(function ({ action, type, ids, elemen
size='small' size='small'
type="primary" type="primary"
onClick={ async () => { onClick={ async () => {
const rows = colBatchEditForm.getFieldsValue()
if (!rows[element.name]) {
confirm?.()
return
}
try { try {
await save() await save()
const rows = await colBatchEditForm.validateFields()
const newModifyData = [...modifyData] const newModifyData = [...modifyData]
if (dataIndex === pathElement.name) { if (dataIndex === pathElement.name) {
for (const item of newModifyData) { for (const item of newModifyData) {
...@@ -295,6 +300,7 @@ export const EditAssets = React.forwardRef(function ({ action, type, ids, elemen ...@@ -295,6 +300,7 @@ export const EditAssets = React.forwardRef(function ({ action, type, ids, elemen
dataIndex: col.dataIndex, dataIndex: col.dataIndex,
colTitle: col.title, colTitle: col.title,
editing: isEditing(record), editing: isEditing(record),
require: element.require,
loadingTreeData, loadingTreeData,
treeData, treeData,
}) })
......
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