Commit 01bba12d by zhaochengxiang

资产添加资源

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