Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
S
szse
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
zhaochengxiang
szse
Commits
49238dcc
Commit
49238dcc
authored
Apr 12, 2024
by
zhaochengxiang
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
结构化字段
parent
721aa3d5
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
116 additions
and
67 deletions
+116
-67
AssetAction.jsx
src/view/Manage/AssetManage/Component/AssetAction.jsx
+116
-67
No files found.
src/view/Manage/AssetManage/Component/AssetAction.jsx
View file @
49238dcc
...
@@ -74,7 +74,53 @@ const AssetAction = (props) => {
...
@@ -74,7 +74,53 @@ const AssetAction = (props) => {
const
[
columnForm
]
=
Form
.
useForm
()
const
[
columnForm
]
=
Form
.
useForm
()
const
relationAssetsRef
=
useRef
();
const
relationAssetsRef
=
useRef
();
const
businessCols
=
[
const
columns
=
[
{
title
:
'技术ID(英文名称)'
,
dataIndex
:
'name'
,
width
:
160
,
ellipsis
:
true
,
render
:
(
text
,
record
,
_
)
=>
{
return
(
<
Tooltip
title=
{
text
||
''
}
>
<
a
onClick=
{
()
=>
{
window
.
open
(
`/center-home/metadetail?mid=${record.metadataColumnId}&action=metadetail&type=detail&manager=true&activekey=1`
)
}
}
>
{
highlightSearchContentByTerms
(
text
||
''
,
terms
)
}
</
a
>
</
Tooltip
>
);
}
},
{
title
:
'名称'
,
dataIndex
:
'cnName'
,
// width: 200,
ellipsis
:
true
,
render
:
(
text
,
_
)
=>
highlightSearchContentByTerms
(
text
||
''
,
terms
)
},
{
title
:
'备注信息'
,
dataIndex
:
'remarks'
,
ellipsis
:
true
,
render
:
(
text
,
_
)
=>
highlightSearchContentByTerms
(
text
||
''
,
terms
)
},
{
title
:
'类型'
,
dataIndex
:
'typeName'
,
width
:
100
,
ellipsis
:
true
,
render
:
(
text
,
_
)
=>
highlightSearchContentByTerms
(
text
||
''
,
terms
)
},
{
title
:
'长度'
,
dataIndex
:
'size'
,
width
:
60
,
ellipsis
:
true
,
},
];
const
businessColumns
=
[
{
{
title
:
<
span
>
title
:
<
span
>
<
span
style=
{
{
<
span
style=
{
{
...
@@ -221,13 +267,16 @@ const AssetAction = (props) => {
...
@@ -221,13 +267,16 @@ const AssetAction = (props) => {
},
[
currentDomainGroup
,
currentBussinessDomain
,
treeDataMap
])
},
[
currentDomainGroup
,
currentBussinessDomain
,
treeDataMap
])
const
cols
=
useMemo
(()
=>
{
const
cols
=
useMemo
(()
=>
{
let
newCols
=
[...
businessCols
]
let
newCols
=
[]
if
(
isMetadataEdit
)
{
if
(
assets
)
{
newCols
.
push
(
businessActionCol
)
newCols
=
assets
.
structured
?[...
columns
]:[...
businessColumns
]
if
(
!
assets
.
structured
&&
isMetadataEdit
)
{
newCols
.
push
(
businessActionCol
)
}
}
}
return
newCols
return
newCols
},
[
isMetadataEdit
,
modifyMetadataColumnList
])
},
[
isMetadataEdit
,
assets
,
columns
,
businessColumns
,
businessActionCol
])
const
[
tableData
,
total
]
=
useMemo
(()
=>
{
const
[
tableData
,
total
]
=
useMemo
(()
=>
{
let
currentMetadataColumnList
=
isMetadataEdit
?
[...
modifyMetadataColumnList
||
[]]
:
[...
metadataColumnList
||
[]]
let
currentMetadataColumnList
=
isMetadataEdit
?
[...
modifyMetadataColumnList
||
[]]
:
[...
metadataColumnList
||
[]]
...
@@ -923,6 +972,68 @@ const AssetAction = (props) => {
...
@@ -923,6 +972,68 @@ const AssetAction = (props) => {
},
},
}}
}}
/> : <React.Fragment>
/> : <React.Fragment>
<Space style={{ marginLeft: 'auto' }}>
{
!readonly && (reference===AssetManageReference||canEdit) && <React.Fragment>
{
isMetadataEdit ? <React.Fragment>
<Button onClick={() => {
setMetadataEdit(false)
}}>
取消
</Button>
<Button onClick={ async () => {
try {
await columnForm?.validateFields()
setModifyMetadataColumnList(prev => {
return [{
}, ...prev]
})
} catch (errInfo) {
}
}}>
新增
</Button>
<Button onClick={async () => {
try {
await columnForm?.validateFields()
setLoadingMetadataColumnList(true)
dispatch({
type: 'assetmanage.saveBusinessColumns',
payload: {
params: {
dataAssetId: assets?.id,
},
data: modifyMetadataColumnList,
},
callback: () => {
setLoadingMetadataColumnList(false)
setMetadataEdit(false)
getMetadataAttributes()
},
error: () => {
setLoadingMetadataColumnList(false)
}
})
} catch (errInfo) {
}
}}>
保存
</Button>
</React.Fragment> : <Button onClick={() => {
setModifyMetadataColumnList(metadataColumnList)
setMetadataEdit(true)
}}>
编辑
</Button>
}
</React.Fragment>
}
</Space>
<Form form={columnForm}>
<Form form={columnForm}>
<Table
<Table
className='mt-3'
className='mt-3'
...
@@ -958,68 +1069,6 @@ const AssetAction = (props) => {
...
@@ -958,68 +1069,6 @@ const AssetAction = (props) => {
</React.Fragment>
</React.Fragment>
}
}
</div>
</div>
<Space style={{ marginLeft: 'auto' }}>
{
!readonly && (reference===AssetManageReference||canEdit) && <React.Fragment>
{
isMetadataEdit ? <React.Fragment>
<Button onClick={() => {
setMetadataEdit(false)
}}>
取消
</Button>
<Button onClick={ async () => {
try {
await columnForm?.validateFields()
setModifyMetadataColumnList(prev => {
return [{
}, ...prev]
})
} catch (errInfo) {
}
}}>
新增
</Button>
<Button onClick={async () => {
try {
await columnForm?.validateFields()
setLoadingMetadataColumnList(true)
dispatch({
type: 'assetmanage.saveBusinessColumns',
payload: {
params: {
dataAssetId: assets?.id,
},
data: modifyMetadataColumnList,
},
callback: () => {
setLoadingMetadataColumnList(false)
setMetadataEdit(false)
getMetadataAttributes()
},
error: () => {
setLoadingMetadataColumnList(false)
}
})
} catch (errInfo) {
}
}}>
保存
</Button>
</React.Fragment> : <Button onClick={() => {
setModifyMetadataColumnList(metadataColumnList)
setMetadataEdit(true)
}}>
编辑
</Button>
}
</React.Fragment>
}
</Space>
{contextHolder}
{contextHolder}
</div>
</div>
)
)
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment