Commit ac12874d by zhaochengxiang

bug fix

parent c4be8d2e
...@@ -12,12 +12,14 @@ import { getAssetType, getAssetTypeName, getQueryParam, isSzseEnv } from '../../ ...@@ -12,12 +12,14 @@ import { getAssetType, getAssetTypeName, getQueryParam, isSzseEnv } from '../../
import '../Model/Component/EditModel.less' import '../Model/Component/EditModel.less'
import { ElementItem, MultipleItem } from '../AssetManage/Component/AssetAction' import { ElementItem, MultipleItem } from '../AssetManage/Component/AssetAction'
import { AssetDictionaryItem } from './add-to-asset' import { AssetDictionaryItem } from './add-to-asset'
import produce from 'immer'
const pathElement = { const pathElement = {
name: '资产目录', name: '资产目录',
supportBatchEdit: '是', supportBatchEdit: '是',
} }
//elementIds为空时,表示资源批量转资产.
const FC = (props) => { const FC = (props) => {
const ids = getQueryParam('ids', props.location?.search) const ids = getQueryParam('ids', props.location?.search)
const elementIds = getQueryParam('elementIds', props.location?.search) const elementIds = getQueryParam('elementIds', props.location?.search)
...@@ -81,6 +83,9 @@ const FC = (props) => { ...@@ -81,6 +83,9 @@ const FC = (props) => {
setWaiting(false) setWaiting(false)
setAction('detail') setAction('detail')
LocalStorage.set('editAssetsChange', !(LocalStorage.get('editAssetsChange')??false)) LocalStorage.set('editAssetsChange', !(LocalStorage.get('editAssetsChange')??false))
if ((elementIds??[]).length === 0) {
window.close()
}
}, },
error: () => { error: () => {
setWaiting(false) setWaiting(false)
...@@ -154,7 +159,13 @@ export const EditAssets = React.forwardRef(function ({ action, type, ids, elemen ...@@ -154,7 +159,13 @@ export const EditAssets = React.forwardRef(function ({ action, type, ids, elemen
getModifyData: () => { getModifyData: () => {
return { return {
elementList: elements, elementList: elements,
rowDataList: modifyData rowDataList: produce(modifyData, (draft) => {
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])
......
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