Commit 4490350d by zhaochengxiang

bug fix

parent af16a2df
...@@ -7,7 +7,7 @@ import LocalStorage from 'local-storage' ...@@ -7,7 +7,7 @@ import LocalStorage from 'local-storage'
import { dispatch } from '../../../model' import { dispatch } from '../../../model'
import { usePage } from '../../../util/hooks/page' import { usePage } from '../../../util/hooks/page'
import Table from '../../../util/Component/Table' import Table from '../../../util/Component/Table'
import { getAssetType, getQueryParam, isSzseEnv } from '../../../util' import { getAssetType, getAssetTypeName, getQueryParam, isSzseEnv } from '../../../util'
import '../Model/Component/EditModel.less' import '../Model/Component/EditModel.less'
import { ElementItem, MultipleItem } from '../AssetManage/Component/AssetAction' import { ElementItem, MultipleItem } from '../AssetManage/Component/AssetAction'
...@@ -37,6 +37,15 @@ const FC = (props) => { ...@@ -37,6 +37,15 @@ const FC = (props) => {
} }
}, []) }, [])
const title = React.useMemo(() => {
let newTitle = ''
if (type) {
newTitle = getAssetTypeName(type)
}
return (elementIds??[]).length===0?`${newTitle}批量转资产`:`${newTitle}批量编辑`
}, [type, elementIds])
const heartbeat = () => { const heartbeat = () => {
dispatch({ dispatch({
type: 'datamodel.heartbeat' type: 'datamodel.heartbeat'
...@@ -85,7 +94,7 @@ const FC = (props) => { ...@@ -85,7 +94,7 @@ const FC = (props) => {
<Spin spinning={waiting}> <Spin spinning={waiting}>
<div className='edit-model position-relative'> <div className='edit-model position-relative'>
<div className='edit-header'> <div className='edit-header'>
<span style={{ fontSize: 16, fontWeight: 'bold', color: '#fff' }}>资产批量编辑</span> <span style={{ fontSize: 16, fontWeight: 'bold', color: '#fff' }}>{title}</span>
</div> </div>
<div className='edit-container'> <div className='edit-container'>
<div className='edit-container-card' style={{ padding: '20px 20px 0' }}> <div className='edit-container-card' style={{ padding: '20px 20px 0' }}>
...@@ -196,7 +205,9 @@ export const EditAssets = React.forwardRef(function ({ action, type, ids, elemen ...@@ -196,7 +205,9 @@ export const EditAssets = React.forwardRef(function ({ action, type, ids, elemen
const rows = await colBatchEditForm.validateFields() const rows = await colBatchEditForm.validateFields()
const newModifyData = [...modifyData] const newModifyData = [...modifyData]
if (dataIndex === pathElement.name) { if (dataIndex === pathElement.name) {
item.paths = rows[dataIndex] for (const item of newModifyData) {
item.paths = rows[dataIndex]
}
} else { } else {
const index = (element??[]).findIndex(item => item.name === dataIndex) const index = (element??[]).findIndex(item => item.name === dataIndex)
if (index !== -1) { if (index !== -1) {
...@@ -275,7 +286,7 @@ export const EditAssets = React.forwardRef(function ({ action, type, ids, elemen ...@@ -275,7 +286,7 @@ export const EditAssets = React.forwardRef(function ({ action, type, ids, elemen
loadingTreeData, loadingTreeData,
treeData, treeData,
}) })
if (action === 'edit' && element.name!=='编号' && element.name!=='中文名称' && element.name!=='英文名称') { if (action === 'edit') {
col = { col = {
...col, ...col,
...getColumnBatchEditProps(element, element.name) ...getColumnBatchEditProps(element, element.name)
......
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