Commit 83c55773 by zhaochengxiang

新增为资产

parent c1a1d299
...@@ -232,6 +232,10 @@ export function* getAssetPaths(payload) { ...@@ -232,6 +232,10 @@ export function* getAssetPaths(payload) {
return yield call(service.getAssetPaths, payload); return yield call(service.getAssetPaths, payload);
} }
export function* getMetadataItems(payload) {
return yield call(service.getMetadataItems, payload);
}
export function* getResourceRelations(payload) { export function* getResourceRelations(payload) {
return yield call(service.getResourceRelations, payload); return yield call(service.getResourceRelations, payload);
} }
...@@ -324,6 +328,18 @@ export function* addOrUpdateResource(payload) { ...@@ -324,6 +328,18 @@ export function* addOrUpdateResource(payload) {
return yield call(service.addOrUpdateResource, payload) return yield call(service.addOrUpdateResource, payload)
} }
export function* resourceAddAsAsset(payload) {
return yield call(service.resourceAddAsAsset, payload)
}
export function* resourceFillElementValueBeforeAddAsAsset(payload) {
return yield call(service.resourceFillElementValueBeforeAddAsAsset, payload)
}
export function* resourceCombineDataAsset(payload) {
return yield call(service.resourceCombineDataAsset, payload)
}
export function* getTasks(payload) { export function* getTasks(payload) {
return yield call(service.getTasks, payload) return yield call(service.getTasks, payload)
} }
......
...@@ -120,6 +120,10 @@ export function getAssetPaths(payload) { ...@@ -120,6 +120,10 @@ export function getAssetPaths(payload) {
return GetJSON("/dataassetmanager/dataAssetApi/getMultiPath", payload); return GetJSON("/dataassetmanager/dataAssetApi/getMultiPath", payload);
} }
export function getMetadataItems(payload) {
return PostJSON("/dataassetmanager/dataAssetApi/getMetadataItems", payload);
}
export function addOrUpdateDirectory(payload) { export function addOrUpdateDirectory(payload) {
return PostJSON("/dataassetmanager/directoryApi/addOrUpdateDirectory", payload); return PostJSON("/dataassetmanager/directoryApi/addOrUpdateDirectory", payload);
} }
...@@ -316,6 +320,18 @@ export function getPreviewRangeByDirId(payload) { ...@@ -316,6 +320,18 @@ export function getPreviewRangeByDirId(payload) {
return PostJSON("/dataassetmanager/resourceApi/addResource", payload); return PostJSON("/dataassetmanager/resourceApi/addResource", payload);
} }
export function resourceAddAsAsset(payload) {
return PostJSON("/dataassetmanager/resourceApi/addAsAsset", payload);
}
export function resourceFillElementValueBeforeAddAsAsset(payload) {
return GetJSON("/dataassetmanager/resourceApi/fillElementValueBeforeAddAsAsset", payload);
}
export function resourceCombineDataAsset(payload) {
return PostJSON("/dataassetmanager/resourceApi/combineExistDataAsset", payload);
}
export function getTasks(payload) { export function getTasks(payload) {
return GetJSON("/dataassetmanager/resource/taskApi/listTasksByPage", payload) return GetJSON("/dataassetmanager/resource/taskApi/listTasksByPage", payload)
} }
......
...@@ -72,11 +72,11 @@ const ResourceItem = ({ data, config, terms }) => { ...@@ -72,11 +72,11 @@ const ResourceItem = ({ data, config, terms }) => {
const AssetItem = ({ data, config, terms }) => { const AssetItem = ({ data, config, terms }) => {
const app = React.useContext(AppContext) const app = React.useContext(AppContext)
return ( return (
<div className='flex'> <div className='flex' style={{ alignItems: 'center' }}>
{ {
(typeof data === 'string') ? <span style={{ marginRight: 5 }}> (typeof data === 'string') ? <span style={{ marginRight: 5 }}>
{highlightSearchContentByTerms(data, terms)} {highlightSearchContentByTerms(data, terms)}
</span> : (IsArr(data) ? <div className='flex' style={{ flexDirection: 'column' }}> </span> : (IsArr(data) ? <div className='flex' style={{ flexDirection: 'column', lineHeight: '32px' }}>
{ {
(data??[]).map((item, index) => <span key={index}> (data??[]).map((item, index) => <span key={index}>
<Tooltip <Tooltip
......
...@@ -13,7 +13,7 @@ import { MetadataColumn } from "../AssetResourceManage/table" ...@@ -13,7 +13,7 @@ import { MetadataColumn } from "../AssetResourceManage/table"
import './add-resources.less' import './add-resources.less'
const FC = (props) => { const FC = (props) => {
const { visible, item, onCancel } = props const { visible, item, onCancel, onOk } = props
const [waiting, setWaiting] = React.useState(false) const [waiting, setWaiting] = React.useState(false)
const basicRef = React.useRef() const basicRef = React.useRef()
...@@ -30,23 +30,29 @@ const FC = (props) => { ...@@ -30,23 +30,29 @@ const FC = (props) => {
return return
} }
setWaiting(true) onOk?.(selectedRows)
dispatch({
type: 'assetmanage.dataAssetAddResources', if (item) {
payload: { setWaiting(true)
params: { dispatch({
dataAssetId: item?.id, type: 'assetmanage.dataAssetAddResources',
resourceIds: (selectedRows??[]).map(item => item.id).toString() payload: {
params: {
dataAssetId: item?.id,
resourceIds: (selectedRows??[]).map(item => item.id).toString()
}
},
callback: data => {
setWaiting(false)
close(true)
},
error: () => {
setWaiting(false)
} }
}, })
callback: data => { } else {
setWaiting(false) close()
close(true) }
},
error: () => {
setWaiting(false)
}
})
} }
const footer = React.useMemo(() => { const footer = React.useMemo(() => {
......
import React from 'react'
import { Button, Tooltip } from 'antd'
import { AppContext } from '../../../App'
import { highlightSearchContentByTerms, IsArr } from '../../../util'
import { MetadataColumnTooltipTitle } from '../AssetResourceManage/table'
import AddResources from './add-resources'
import { dispatch } from '../../../model'
const FC = ({ value, onChange, readonly = true, terms = [] }) => {
const [decodeData, setDecodeData] = React.useState()
const [addResourcesParams, setAddResourcesParams] = React.useState({
visible: false,
})
const app = React.useContext(AppContext)
React.useMemo(() => {
if (value) {
try {
setDecodeData(JSON.parse(value))
} catch(error) {
setDecodeData(value)
}
} else {
setDecodeData()
}
}, [value])
const onAddResourcesOk = (resources) => {
dispatch({
type: 'assetmanage.getMetadataItems',
payload: {
params: {
resourceIds: (resources??[]).map(item => item.id).toString()
}
},
callback: data => {
if (typeof decodeData === 'string') {
onChange?.(JSON.stringify(data??[]))
} else {
const newData = [...decodeData??[]]
for (const item of data??[]) {
const _index = (newData??[]).findIndex(_item => item.metadataId ===_item.metadataId)
if (_index === -1) {
newData.push(item)
}
}
onChange?.(JSON.stringify(newData))
}
},
})
}
return (
<div>
{
!readonly && <Button onClick={() => {
setAddResourcesParams({
visible: true
})
}}>添加资源</Button>
}
{
(typeof decodeData === 'string') && <div className='flex' style={{ lineHeight: '32px', alignItems: 'center' }}>
<span style={{ marginRight: 5 }}>
{highlightSearchContentByTerms(decodeData, terms)}
</span>
{
!readonly && <Button size='small' onClick={() => {
onChange?.()
}}>删除</Button>
}
</div>
}
{
IsArr(decodeData) && <div>
{
//资源可能没有资源项
(decodeData??[]).filter(item => item.metadataId).map((item, index) => <div key={index} className='flex' style={{ lineHeight: '32px', alignItems: 'center' }}>
<span>
<Tooltip
overlayClassName='tooltip-common'
title={<MetadataColumnTooltipTitle data={[item]} />}
>
<a onClick={() => {
app?.setGlobalState?.({
message: 'data-govern-show-metadata-message',
data: item
})
}}
style={{ marginRight: 5, marginTop: readonly?0:5 }}
>
{highlightSearchContentByTerms(item.enName, terms)}
</a>
</Tooltip>
</span>
{
!readonly && <Button size='small' onClick={() => {
const newData = [...decodeData]
const _index = (newData??[]).findIndex(_item => item.metadataId ===_item.metadataId)
if (_index !== -1) {
newData.splice(_index, 1)
onChange?.(JSON.stringify(newData))
}
}}>删除</Button>
}
</div>
)
}
</div>
}
<AddResources
{...addResourcesParams}
onCancel={(refresh) => {
setAddResourcesParams({
visible: false
})
}}
onOk={onAddResourcesOk}
/>
</div>
)
}
export default FC
\ No newline at end of file
...@@ -31,7 +31,8 @@ import './Component/AssetTable.less' ...@@ -31,7 +31,8 @@ import './Component/AssetTable.less'
import { MetadataColumn } from '../AssetResourceManage/table' import { MetadataColumn } from '../AssetResourceManage/table'
const operationMap = { const operationMap = {
addResource: '添加资源',
publish: '发布',
} }
const FC = (props) => { const FC = (props) => {
...@@ -210,7 +211,7 @@ const FC = (props) => { ...@@ -210,7 +211,7 @@ const FC = (props) => {
_exportAble = (permissions??[]).findIndex(item => item==='export') !== -1 _exportAble = (permissions??[]).findIndex(item => item==='export') !== -1
} else { } else {
let [allowImport, allowExport] = [true, true] let [allowImport, allowExport] = [true, true]
for (const row of selectedRows) { for (const row of selectedRows??[]) {
const importIndex = (row.allowButtons??[]).findIndex(item => item==='import') const importIndex = (row.allowButtons??[]).findIndex(item => item==='import')
const exportIndex = (row.allowButtons??[]).findIndex(item => item==='export') const exportIndex = (row.allowButtons??[]).findIndex(item => item==='export')
if (importIndex === -1) { if (importIndex === -1) {
...@@ -226,7 +227,7 @@ const FC = (props) => { ...@@ -226,7 +227,7 @@ const FC = (props) => {
} }
let [allowBatchEdit, allowChangeDirectory, allowDelete] = [true, true, true] let [allowBatchEdit, allowChangeDirectory, allowDelete] = [true, true, true]
for (const row of selectedRows) { for (const row of selectedRows??[]) {
const batchEditIndex = (row.allowButtons??[]).findIndex(item => item==='batchEdit') const batchEditIndex = (row.allowButtons??[]).findIndex(item => item==='batchEdit')
const changeDirecotoryIndex = (row.allowButtons??[]).findIndex(item => item==='changeDir') const changeDirecotoryIndex = (row.allowButtons??[]).findIndex(item => item==='changeDir')
const deleteIndex = (row.allowButtons??[]).findIndex(item => item==='delete') const deleteIndex = (row.allowButtons??[]).findIndex(item => item==='delete')
...@@ -259,45 +260,13 @@ const FC = (props) => { ...@@ -259,45 +260,13 @@ const FC = (props) => {
}, [rightRow]) }, [rightRow])
const notElementCol = [ const notElementCol = [
// { {
// title: '梳理状态', title: '资产状态',
// dataIndex: 'sortingStatus', dataIndex: 'publishStatus',
// ellipsis: true, ellipsis: true,
// width: 120, width: 120,
// render: (_, record) => record.resourceExtraAttribute?.sortingStatus render: (_, record) => record.assetExtraAttribute?.publishStatus
// }, },
// {
// title: '当前处理人',
// dataIndex: 'currentProcessor',
// ellipsis: true,
// width: 120,
// render: (_, record) => record.resourceExtraAttribute?.currentProcessor
// },
// {
// title: '任务编号',
// dataIndex: 'taskNO',
// ellipsis: true,
// width: 120,
// render: (_, record) => <a onClick={() => {
// window.open(`/center-home/menu/task-manage?id=${record.resourceExtraAttribute?.taskNO}`)
// }}>
// {record.resourceExtraAttribute?.taskNO}
// </a>
// },
// {
// title: '资产状态',
// dataIndex: 'resourceStatus',
// ellipsis: true,
// width: 120,
// render: (_, record) => record.resourceExtraAttribute?.resourceStatus
// },
// {
// title: '是否资产',
// dataIndex: 'transferDataAsset',
// ellipsis: true,
// width: 120,
// render: (_, record) => record.resourceExtraAttribute?.transferDataAsset
// },
{ {
title: '标签', title: '标签',
dataIndex: 'tag', dataIndex: 'tag',
......
...@@ -10,20 +10,93 @@ import { AppContext } from '../../../App' ...@@ -10,20 +10,93 @@ import { AppContext } from '../../../App'
import MetadataInfo from '../AssetManage/Component/MetadataInfo' import MetadataInfo from '../AssetManage/Component/MetadataInfo'
import { defaultPage, usePage } from '../../../util/hooks/page' import { defaultPage, usePage } from '../../../util/hooks/page'
import Table from '../../../util/Component/Table' import Table from '../../../util/Component/Table'
import AssetItem from '../AssetManage/asset-item'
import './add-to-asset.less' import './add-to-asset.less'
const FC = (props) => { const FC = (props) => {
const { visible, items, onCancel } = props const { visible, items, onCancel } = props
const [loading, setLoading] = React.useState(false)
const [waiting, setWaiting] = React.useState(false) const [waiting, setWaiting] = React.useState(false)
const [autoFillElementValue, setAutoFillElementValue] = React.useState()
const basicRef = React.useRef()
React.useEffect(() => {
if (visible) {
fillElementValueBeforeAddAsAsset()
}
}, [visible])
const fillElementValueBeforeAddAsAsset = () => {
setLoading(true)
dispatch({
type: 'assetmanage.resourceFillElementValueBeforeAddAsAsset',
payload: {
resourceIds: (items??[]).map(item => item.id).toString()
},
callback: data => {
setLoading(false)
setAutoFillElementValue(data)
},
error: () => {
setLoading(false)
}
})
}
const close = (refresh = false) => { const close = (refresh = false) => {
setLoading(false)
setWaiting(false) setWaiting(false)
setAutoFillElementValue()
onCancel?.(refresh) onCancel?.(refresh)
} }
const save = () => { const save = async() => {
try {
const rows = await basicRef.current?.validate()
setWaiting(true)
if (basicRef.current?.type === 'add') {
dispatch({
type: 'assetmanage.resourceAddAsAsset',
payload: {
data: {
elements: rows.asset
},
params: {
dirIds: (rows.dirIds??[]).map(item => item.value).toString()
}
},
callback: data => {
setWaiting(false)
onCancel?.(true)
},
error: () => {
setWaiting(false)
}
})
} else {
dispatch({
type: 'assetmanage.resourceCombineDataAsset',
payload: {
params: {
resourceIds: (items??[]).map(item => item.id).toString(),
dataAssetId: rows.assetId
}
},
callback: data => {
setWaiting(false)
onCancel?.(true)
},
error: () => {
setWaiting(false)
}
})
}
} catch (e) {
}
} }
const footer = React.useMemo(() => { const footer = React.useMemo(() => {
...@@ -48,8 +121,8 @@ const FC = (props) => { ...@@ -48,8 +121,8 @@ const FC = (props) => {
centered destroyOnClose centered destroyOnClose
onCancel={() => { close() }} onCancel={() => { close() }}
> >
<Spin spinning={waiting} > <Spin spinning={loading||waiting} >
<Basic items={items} /> <Basic ref={basicRef} defaultValue={autoFillElementValue} />
</Spin> </Spin>
</Modal> </Modal>
) )
...@@ -57,16 +130,29 @@ const FC = (props) => { ...@@ -57,16 +130,29 @@ const FC = (props) => {
export default FC export default FC
export const Basic = React.forwardRef(function ({ items }, ref) { export const Basic = React.forwardRef(function ({ items, defaultValue }, ref) {
const [type, setType] = React.useState('add') const [type, setType] = React.useState('add')
const [loadingTreeData, setLoadingTreeData] = React.useState(false) const [loadingTreeData, setLoadingTreeData] = React.useState(false)
const [treeData, setTreeData] = React.useState() const [treeData, setTreeData] = React.useState()
const [form] = Form.useForm() const [form] = Form.useForm()
React.useImperativeHandle(ref, () => ({
validate: async () => {
return await form.validateFields()
},
type
}), [form, type])
React.useEffect(() => { React.useEffect(() => {
getTreeData() getTreeData()
}, []) }, [])
React.useEffect(() => {
if (type==='add' && defaultValue) {
form?.setFieldsValue({ asset: defaultValue })
}
}, [type, defaultValue])
const treeData1 = React.useMemo(() => { const treeData1 = React.useMemo(() => {
if (treeData) { if (treeData) {
const newTreeData = produce(treeData, draft => { const newTreeData = produce(treeData, draft => {
...@@ -93,7 +179,7 @@ export const Basic = React.forwardRef(function ({ items }, ref) { ...@@ -93,7 +179,7 @@ export const Basic = React.forwardRef(function ({ items }, ref) {
const getTreeData = () => { const getTreeData = () => {
setLoadingTreeData(true) setLoadingTreeData(true)
dispatch({ dispatch({
type: 'assetmanage.queryAssetDirectoryAsTree', type: 'assetmanage.queryDataAssetManageTree',
callback: data => { callback: data => {
setLoadingTreeData(false) setLoadingTreeData(false)
setTreeData(data) setTreeData(data)
...@@ -134,7 +220,7 @@ export const Basic = React.forwardRef(function ({ items }, ref) { ...@@ -134,7 +220,7 @@ export const Basic = React.forwardRef(function ({ items }, ref) {
{ {
type === 'add' ? <React.Fragment> type === 'add' ? <React.Fragment>
<Form.Item <Form.Item
name='catalogId' name='dirIds'
label='资产目录' label='资产目录'
rules={[{ required: true, message: '请选择资产目录!' }]} rules={[{ required: true, message: '请选择资产目录!' }]}
> >
...@@ -144,6 +230,8 @@ export const Basic = React.forwardRef(function ({ items }, ref) { ...@@ -144,6 +230,8 @@ export const Basic = React.forwardRef(function ({ items }, ref) {
treeData={treeData1} treeData={treeData1}
placeholder="请选择分组" placeholder="请选择分组"
treeDefaultExpandAll treeDefaultExpandAll
treeCheckable
treeCheckStrictly
/> />
</Form.Item> </Form.Item>
<Form.Item <Form.Item
...@@ -159,16 +247,15 @@ export const Basic = React.forwardRef(function ({ items }, ref) { ...@@ -159,16 +247,15 @@ export const Basic = React.forwardRef(function ({ items }, ref) {
label='选择资产' label='选择资产'
rules={[{ required: true, message: '请选择资产!' }]} rules={[{ required: true, message: '请选择资产!' }]}
> >
<SelectAssetItem />
</Form.Item> </Form.Item>
<SelectAssetItem />
</React.Fragment> </React.Fragment>
} }
</Form> </Form>
) )
}) })
const AssetInfoItem = ({ items, onChange }) => { const AssetInfoItem = ({ value, onChange }) => {
const [loading, setLoading] = React.useState(false) const [loading, setLoading] = React.useState(false)
const [elements, setElements] = React.useState() const [elements, setElements] = React.useState()
const [groups, setGroups] = React.useState() const [groups, setGroups] = React.useState()
...@@ -176,6 +263,14 @@ const AssetInfoItem = ({ items, onChange }) => { ...@@ -176,6 +263,14 @@ const AssetInfoItem = ({ items, onChange }) => {
const [form] = Form.useForm() const [form] = Form.useForm()
React.useEffect(() => { React.useEffect(() => {
let fieldsValue = {}
for (const element of value??[]) {
fieldsValue[element.name] = element.value
}
form?.setFieldsValue(fieldsValue)
}, [value])
React.useEffect(() => {
getElements() getElements()
}, []) }, [])
...@@ -200,27 +295,14 @@ const AssetInfoItem = ({ items, onChange }) => { ...@@ -200,27 +295,14 @@ const AssetInfoItem = ({ items, onChange }) => {
}) })
} }
const fillElementValueBeforeCreate = (metadataId) => {
dispatch({
type: 'assetmanage.fillElementValueBeforeCreate',
payload: {
params: {
metadataIds: metadataId
}
},
callback: data => {
let _fieldsValue = {}
for (const item of data??[]) {
_fieldsValue[item.name] = item.value
}
form?.setFieldsValue(_fieldsValue)
onChange?.(_fieldsValue)
}
})
}
const onValuesChange = (changedValues, allValues) => { const onValuesChange = (changedValues, allValues) => {
onChange?.(allValues) const newElements = [...elements]
for (const element of newElements??[]) {
if (allValues.hasOwnProperty(element.name)) {
element.value = allValues[element.name];
}
}
onChange?.(newElements)
} }
const formItemLayout = { const formItemLayout = {
...@@ -238,59 +320,43 @@ const AssetInfoItem = ({ items, onChange }) => { ...@@ -238,59 +320,43 @@ const AssetInfoItem = ({ items, onChange }) => {
<React.Fragment> <React.Fragment>
<div style={{ height: 30 }} /> <div style={{ height: 30 }} />
<Spin spinning={loading}> <Spin spinning={loading}>
{ <Form {...formItemLayout} form={form} onValuesChange={onValuesChange}>
(groups??[]).map((group, index) => { {
const filterElements = (elements??[]).filter(element => element.type===group) (groups??[]).map((group, index) => {
return ( const filterElements = (elements??[]).filter(element => element.type===group)
<div key={index}> return (
<div className='flex pl-common' <div key={index}>
style={{ <div className='flex pl-common'
alignItems: 'center', style={{
backgroundColor: '#fff', alignItems: 'center',
height: 46, backgroundColor: '#fff',
borderBottom: '1px solid #f0f0f0', height: 46,
}} borderBottom: '1px solid #f0f0f0',
> }}
<div className='primary-bg-color' style={{ width: 3, height: 14, marginRight: 5 }} /> >
<div className='title-text' style={{ fontWeight: 'bold' }}>{group}</div> <div className='primary-bg-color' style={{ width: 3, height: 14, marginRight: 5 }} />
</div> <div className='title-text' style={{ fontWeight: 'bold' }}>{group}</div>
<div className='px-common py-compact-common'> </div>
<Form {...formItemLayout} form={form} onValuesChange={onValuesChange} <div className='px-common py-compact-common'>
>
<AppContext.Consumer>
{ {
value => { (filterElements??[]).map((element, _index) => {
value?.onGlobalStateChange&&value?.onGlobalStateChange((state, prev) => { return (
if (state.message === 'data-govern-show-metadata-list-callback-message') { <Form.Item
form?.setFieldsValue({ '资产项': state.data?.metadataInfoJson||'' }); label={<div className='title-color'>{element.name}</div>}
name={element.name}
if ((state.data?.metadataId||'') !== '') { key={_index}
fillElementValueBeforeCreate(state.data?.metadataId||''); >
} { (element.name==='资产项') ? <AssetItem readonly={false} /> : <Input disabled={element.manualMaintain==='否'} /> }
} </Form.Item>
}); )
})
return ( }
(filterElements??[]).map((element, _index) => { </div>
return (
<Form.Item
label={<div className='title-color'>{element.name}</div>}
name={element.name}
key={_index}
>
{ (element.name==='资产项') ? <MetadataInfo config={false} /> : <Input disabled={element.manualMaintain==='否'} /> }
</Form.Item>
)
})
);
}}
</AppContext.Consumer>
</Form>
</div> </div>
</div> )
) })
}) }
} </Form>
</Spin> </Spin>
</React.Fragment> </React.Fragment>
) )
......
...@@ -37,8 +37,6 @@ const operationMap = { ...@@ -37,8 +37,6 @@ const operationMap = {
addAsAsset: '新增为资产', addAsAsset: '新增为资产',
distribute: '分配', distribute: '分配',
reDistribute: '转分配', reDistribute: '转分配',
autoDistribute: '自动分配',
batchEdit: '批量编辑',
check: '复核', check: '复核',
changeToNotAsset: '转为非资产', changeToNotAsset: '转为非资产',
changeToUncombed: '转为未梳理', changeToUncombed: '转为未梳理',
...@@ -249,7 +247,7 @@ const FC = (props) => { ...@@ -249,7 +247,7 @@ const FC = (props) => {
_exportAble = (permissions??[]).findIndex(item => item==='export') !== -1 _exportAble = (permissions??[]).findIndex(item => item==='export') !== -1
} else { } else {
let [allowImport, allowExport] = [true, true] let [allowImport, allowExport] = [true, true]
for (const row of selectedRows) { for (const row of selectedRows??[]) {
const importIndex = (row.allowButtons??[]).findIndex(item => item==='import') const importIndex = (row.allowButtons??[]).findIndex(item => item==='import')
const exportIndex = (row.allowButtons??[]).findIndex(item => item==='export') const exportIndex = (row.allowButtons??[]).findIndex(item => item==='export')
if (importIndex === -1) { if (importIndex === -1) {
...@@ -265,7 +263,7 @@ const FC = (props) => { ...@@ -265,7 +263,7 @@ const FC = (props) => {
} }
let [allowAddAsAsset, allowDistribute, allowBatchEdit, allowCheck, allowChangeDirectory, allowDelete] = [true, true, true, true, true, true] let [allowAddAsAsset, allowDistribute, allowBatchEdit, allowCheck, allowChangeDirectory, allowDelete] = [true, true, true, true, true, true]
for (const row of selectedRows) { for (const row of selectedRows??[]) {
const addAsAssetIndex = (row.allowButtons??[]).findIndex(item => item==='addAsAsset') const addAsAssetIndex = (row.allowButtons??[]).findIndex(item => item==='addAsAsset')
const distributeIndex = (row.allowButtons??[]).findIndex(item => item==='distribute') const distributeIndex = (row.allowButtons??[]).findIndex(item => item==='distribute')
const batchEditIndex = (row.allowButtons??[]).findIndex(item => item==='batchEdit') const batchEditIndex = (row.allowButtons??[]).findIndex(item => item==='batchEdit')
...@@ -898,7 +896,7 @@ const FC = (props) => { ...@@ -898,7 +896,7 @@ const FC = (props) => {
onAutoDistributeTaskClick() onAutoDistributeTaskClick()
} else if (key === 'batchEdit') { } else if (key === 'batchEdit') {
onBatchEditClick() onBatchEditClick()
}else if (key === 'check') { } else if (key === 'check') {
onCheckClick() onCheckClick()
} else if (key === 'import') { } else if (key === 'import') {
onImportClick() onImportClick()
......
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