Commit 01bba12d by zhaochengxiang

资产添加资源

parent 5d435825
......@@ -540,7 +540,6 @@ const AssetAction = (props) => {
if (state.message === 'data-govern-show-metadata-list-callback-message') {
setMetadataId(state.data?.metadataId||'');
onMetadataChange && onMetadataChange(state.data?.metadataId||'');
// form?.setFieldsValue({ '资产项': state.data?.metadataInfoJson||'' });
if ((state.data?.metadataId||'') !== '') {
fillElementValueBeforeCreate(state.data?.metadataId||'');
......@@ -638,6 +637,7 @@ export const ElementItem = ({ type = 'detail', element, reference = AssetManageR
} else {
if (element?.selectMode === '单选') {
return <Select
allowClear
disabled={element?.manualMaintain==='否'}
dropdownRender={(originNode) => (
<div
......
......@@ -62,7 +62,7 @@ const FC = ({ value, onChange, readonly = true, terms = [] }) => {
}}>添加资源</Button>
}
{
(typeof decodeData === 'string') && <div className='flex' style={{ lineHeight: '32px', alignItems: 'center' }}>
(typeof decodeData === 'string') && <div className='flex' style={{ alignItems: 'center', marginTop: readonly?0:5 }}>
<span style={{ marginRight: 5 }}>
{highlightSearchContentByTerms(decodeData, terms)}
</span>
......@@ -77,7 +77,7 @@ const FC = ({ value, onChange, readonly = true, terms = [] }) => {
IsArr(decodeData) && <div>
{
//资源可能没有资源项
(decodeData??[]).filter(item => item.metadataId).map((item, index) => <div key={index} className='flex' style={{ lineHeight: '32px', alignItems: 'center' }}>
(decodeData??[]).filter(item => item.metadataId).map((item, index) => <div key={index} className='flex' style={{ alignItems: 'center', marginTop: readonly?0:5 }}>
<span>
<Tooltip
overlayClassName='tooltip-common'
......@@ -89,7 +89,7 @@ const FC = ({ value, onChange, readonly = true, terms = [] }) => {
data: item
})
}}
style={{ marginRight: 5, marginTop: readonly?0:5 }}
style={{ marginRight: 5 }}
>
{highlightSearchContentByTerms(item.enName, terms)}
</a>
......
......@@ -625,6 +625,23 @@ const FC = (props) => {
})
}
const onRightAddResourcesClick = () => {
setAddResourcesParams({
visible: true,
item: rightRow
})
}
const onRightPublishClick = () => {
modal.confirm({
title: '提示',
content: '确定发起资产的发布流程吗?',
onOk: () => {
}
})
}
const onMenuClick = ({ key }) => {
if (key === 'batchEdit') {
onBatchEditClick()
......@@ -642,7 +659,11 @@ const FC = (props) => {
}
const onRightMenuItemClick = (key, record) => {
if (key === '添加资源') {
onRightAddResourcesClick()
} else if (key === '发布') {
onRightPublishClick()
}
}
const moreMenu = (
......
......@@ -10,7 +10,7 @@ import Table from '../../../util/Component/Table'
import { getQueryParam, isSzseEnv } from '../../../util'
import '../Model/Component/EditModel.less'
import { MultipleItem } from '../AssetManage/Component/AssetAction'
import { ElementItem, MultipleItem } from '../AssetManage/Component/AssetAction'
const FC = (props) => {
const ids = getQueryParam('ids', props.location?.search)
......@@ -139,27 +139,6 @@ export const EditAssets = React.forwardRef(function ({ action, ids, elementIds }
const getColumnBatchEditProps = (element, dataIndex) => ({
filterDropdown: ({ confirm }) => {
let inputNode = <Input />
if (element?.selectMode === '单选') {
inputNode = <Select
dropdownRender={(originNode) => (
<div
onClick={e => {
e.stopPropagation()
}}
>
{originNode}
</div>
)}
>
{
(typeof(element?.optional) === 'string') && (element?.optional??'').split(',').map((item, index) => <Select.Option key={index} value={item}>{item}</Select.Option>)
}
</Select>
} else if (element?.selectMode === '多选') {
inputNode = <MultipleItem element={element} />
}
return (
<div
style={{
......@@ -181,7 +160,7 @@ export const EditAssets = React.forwardRef(function ({ action, ids, elementIds }
rules={[{ required: true, message: `请输入${element?.name}!` }]}
style={{ marginBottom: 15 }}
>
{ inputNode }
<ElementItem type='edit' element={element} />
</Form.Item>
</Form>
<div className='flex' style={{ justifyContent: 'end' }}>
......@@ -388,28 +367,6 @@ export const EditableCell = ({
}) => {
let editingComponent = null
if (editing) {
let inputNode = <Input />
if (element?.selectMode === '单选') {
inputNode = <Select
dropdownRender={(originNode) => (
<div
onClick={e => {
e.stopPropagation()
}}
>
{originNode}
</div>
)}
>
{
(typeof(element?.optional) === 'string') && (element?.optional??'').split(',').map((item, index) => <Select.Option key={index} value={item}>{item}</Select.Option>)
}
</Select>
} else if (element?.selectMode === '多选') {
inputNode = <MultipleItem element={element} />
}
editingComponent = (
<Form.Item
name={dataIndex}
......@@ -421,7 +378,7 @@ export const EditableCell = ({
},
]}
>
{ inputNode }
<ElementItem type='edit' element={element} />
</Form.Item>
)
}
......
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