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
1812b954
Commit
1812b954
authored
Dec 26, 2023
by
zhaochengxiang
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
字段编辑
parent
0c6df5cd
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
38 additions
and
6 deletions
+38
-6
AssetAction.jsx
src/view/Manage/AssetManage/Component/AssetAction.jsx
+38
-6
No files found.
src/view/Manage/AssetManage/Component/AssetAction.jsx
View file @
1812b954
...
...
@@ -3,6 +3,7 @@ import { Form, Spin, Input, Descriptions, Space, Button, Tooltip, Select, Cascad
import
{
DownOutlined
,
UpOutlined
,
QuestionCircleOutlined
}
from
'@ant-design/icons'
;
import
LocalStorage
from
'local-storage'
;
import
copy
from
"copy-to-clipboard"
;
import
produce
from
'immer'
;
import
MetadataInfo
from
'./MetadataInfo'
;
import
{
dispatch
}
from
'../../../../model'
;
...
...
@@ -54,6 +55,7 @@ const AssetAction = (props) => {
const
[
metadata
,
setMetadata
]
=
useState
(
undefined
);
const
[
loadingMetadataColumnList
,
setLoadingMetadataColumnList
]
=
useState
(
false
);
const
[
metadataColumnList
,
setMetadataColumnList
]
=
useState
(
undefined
);
const
[
modifyMetadataColumnList
,
setModifyMetadataColumnList
]
=
useState
();
const
[
selectStandardParam
,
setSelectStandardParam
]
=
useState
({
visible
:
false
,
id
:
undefined
});
const
[
standardList
,
setStandardList
]
=
useState
(
undefined
);
const
[
attributeMaintainParam
,
setAttributeMaintainParam
]
=
useState
({
...
...
@@ -66,6 +68,7 @@ const AssetAction = (props) => {
const
[
permissions
,
setPermissions
]
=
useState
(
undefined
);
const
[
keyword
,
setKeyword
]
=
useState
(
''
);
const
[
publishedAsset
,
setPublishedAsset
]
=
useState
();
const
[
isMetadataEdit
,
setMetadataEdit
]
=
useState
(
false
);
const
app
=
useContext
(
AppContext
);
const
uploadRef
=
useRef
(
undefined
);
...
...
@@ -138,7 +141,25 @@ const AssetAction = (props) => {
dataIndex
:
'cnName'
,
// width: 200,
ellipsis
:
true
,
render
:
(
text
,
_
)
=>
highlightSearchContentByTerms
(
text
||
''
,
terms
)
render
:
(
text
,
_
,
index
)
=>
{
if
(
isMetadataEdit
)
{
return
(
<
Input
size=
'small'
allowClear
value=
{
text
}
onChange=
{
(
e
)
=>
{
setModifyMetadataColumnList
(
produce
(
modifyMetadataColumnList
,
(
draft
)
=>
{
if
((
draft
??[]).
length
>
index
)
{
draft
[
index
].
cnName
=
e
.
target
.
value
}
})
)
}
}
/>
)
}
return
highlightSearchContentByTerms
(
text
||
''
,
terms
)
}
},
{
title
:
'是否有权限'
,
...
...
@@ -284,10 +305,12 @@ const AssetAction = (props) => {
},
[
currentDomainGroup
,
currentBussinessDomain
,
treeDataMap
])
const
tableData
=
useMemo
(()
=>
{
if
(
metadataColumnList
&&
standardList
)
{
const
currentMetadataColumnList
=
isMetadataEdit
?
[...
modifyMetadataColumnList
||
[]]
:
[...
metadataColumnList
||
[]]
if
((
currentMetadataColumnList
??[]).
length
>
0
&&
standardList
)
{
const
newMetadataColumnList
=
[];
m
etadataColumnList
.
filter
(
item
=>
{
currentM
etadataColumnList
.
filter
(
item
=>
{
return
(
!
keyword
||
(
item
.
name
??
''
).
indexOf
(
keyword
)
!==-
1
...
...
@@ -308,7 +331,7 @@ const AssetAction = (props) => {
}
return
[];
},
[
metadataColumnList
,
standardList
,
pagination
,
keyword
])
},
[
metadataColumnList
,
modifyMetadataColumnList
,
standardList
,
pagination
,
keyword
,
isMetadataEdit
])
const
getPermission
=
()
=>
{
dispatch
({
...
...
@@ -519,7 +542,8 @@ const AssetAction = (props) => {
payload
:
{
data
:
ids
,
params
:
{
catalog
:
app
?.
env
?.
domainId
||
catalog
||
LocalStorage
.
get
(
'assetsEnv'
),
// catalog: app?.env?.domainId||catalog||LocalStorage.get('assetsEnv'),
catalog
:
'1810295967'
}
},
callback
:
data
=>
{
...
...
@@ -1136,7 +1160,8 @@ const AssetAction = (props) => {
<Space style={{ marginLeft: 'auto' }}>
{
(reference===AssetManageReference||(reference!==AssetDraftReference&&canEdit)) && <Button
(reference===AssetManageReference||(reference!==AssetDraftReference&&canEdit)) && <React.Fragment>
<Button
onClick={() => {
if (metadata?.metadataTableId) {
setAttributeMaintainParam({
...
...
@@ -1150,6 +1175,13 @@ const AssetAction = (props) => {
>
字段级维护
</Button>
<Button onClick={() => {
setModifyMetadataColumnList(metadataColumnList)
setMetadataEdit(true)
}}>
编辑
</Button>
</React.Fragment>
}
<Input size="middle"
placeholder="搜索中英文名称/业务规则"
...
...
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