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
acd0736c
Commit
acd0736c
authored
Nov 14, 2023
by
zhaochengxiang
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
资产详情去掉关联标准
parent
3bedb9f0
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
37 additions
and
126 deletions
+37
-126
AssetAction.jsx
src/view/Manage/AssetManage/Component/AssetAction.jsx
+37
-126
No files found.
src/view/Manage/AssetManage/Component/AssetAction.jsx
View file @
acd0736c
...
@@ -57,7 +57,6 @@ const AssetAction = (props) => {
...
@@ -57,7 +57,6 @@ const AssetAction = (props) => {
const
[
loadingMetadataColumnList
,
setLoadingMetadataColumnList
]
=
useState
(
false
);
const
[
loadingMetadataColumnList
,
setLoadingMetadataColumnList
]
=
useState
(
false
);
const
[
metadataColumnList
,
setMetadataColumnList
]
=
useState
(
undefined
);
const
[
metadataColumnList
,
setMetadataColumnList
]
=
useState
(
undefined
);
const
[
selectStandardParam
,
setSelectStandardParam
]
=
useState
({
visible
:
false
,
id
:
undefined
});
const
[
selectStandardParam
,
setSelectStandardParam
]
=
useState
({
visible
:
false
,
id
:
undefined
});
const
[
standardList
,
setStandardList
]
=
useState
(
undefined
);
const
[
attributeMaintainParam
,
setAttributeMaintainParam
]
=
useState
({
const
[
attributeMaintainParam
,
setAttributeMaintainParam
]
=
useState
({
visible
:
false
,
visible
:
false
,
metadataId
:
undefined
metadataId
:
undefined
...
@@ -142,69 +141,25 @@ const AssetAction = (props) => {
...
@@ -142,69 +141,25 @@ const AssetAction = (props) => {
width
:
60
,
width
:
60
,
ellipsis
:
true
,
ellipsis
:
true
,
},
},
{
// {
title
:
'引用标准'
,
// title: '引用标准',
dataIndex
:
'standard'
,
// dataIndex: 'standard',
ellipsis
:
true
,
// ellipsis: true,
render
:
(
_
,
record
)
=>
{
// render: (_, record) => {
return
<
AppContext
.
Consumer
>
// return <AppContext.Consumer>
{
// {
appValue
=>
<
a
onClick=
{
()
=>
{
// appValue => <a onClick={() => {
appValue
?.
setGlobalState
&&
appValue
?.
setGlobalState
({
// appValue?.setGlobalState && appValue?.setGlobalState({
message
:
'data-govern-show-index-detail-message'
,
// message: 'data-govern-show-index-detail-message',
data
:
{
id
:
record
.
standard
?.
standardId
}
// data: { id: record.standard?.standardId }
})
// })
}
}
>
// }}>
<
span
>
{
record
.
standard
?.
standardName
}
</
span
>
// <span>{record.standard?.standardName}</span>
</
a
>
// </a>
}
// }
</
AppContext
.
Consumer
>
// </AppContext.Consumer>
}
// }
},
// },
{
title
:
'操作'
,
dataIndex
:
'action'
,
width
:
170
,
fixed
:
'right'
,
render
:
(
_
,
record
)
=>
{
return
(
reference
===
AssetManageReference
||
canEdit
)
?
<
Space
>
<
Button
size=
'small'
onClick=
{
()
=>
{
setSelectStandardParam
({
visible
:
true
,
id
:
record
.
_id
});
}
}
>
关联标准
</
Button
>
{
record
.
standard
?.
standardId
&&
<
Button
size=
'small'
onClick=
{
()
=>
{
modal
.
confirm
({
title
:
'您确定要取消关联标准吗?'
,
onOk
:
()
=>
{
dispatch
({
type
:
'assetmanage.deleteStandardBatchMetadata'
,
payload
:
{
params
:
{
ids
:
record
.
standard
?.
id
}
},
callback
:
()
=>
{
showMessage
(
"success"
,
"取消成功"
);
getMetadataStandardList
();
}
})
}
})
}
}
>
取消关联
</
Button
>
}
</
Space
>:
null
;
}
}
];
];
useEffect
(()
=>
{
useEffect
(()
=>
{
...
@@ -262,7 +217,7 @@ const AssetAction = (props) => {
...
@@ -262,7 +217,7 @@ const AssetAction = (props) => {
},
[
currentDomainGroup
,
currentBussinessDomain
,
treeDataMap
])
},
[
currentDomainGroup
,
currentBussinessDomain
,
treeDataMap
])
const
tableData
=
useMemo
(()
=>
{
const
tableData
=
useMemo
(()
=>
{
if
(
metadataColumnList
&&
standardList
)
{
if
(
metadataColumnList
)
{
const
newMetadataColumnList
=
[];
const
newMetadataColumnList
=
[];
metadataColumnList
.
filter
(
item
=>
{
metadataColumnList
.
filter
(
item
=>
{
...
@@ -272,21 +227,13 @@ const AssetAction = (props) => {
...
@@ -272,21 +227,13 @@ const AssetAction = (props) => {
||
(
item
.
cnName
??
''
).
indexOf
(
keyword
)
!==-
1
||
(
item
.
cnName
??
''
).
indexOf
(
keyword
)
!==-
1
||
(
item
.
businessRules
??
''
).
indexOf
(
keyword
)
!==-
1
||
(
item
.
businessRules
??
''
).
indexOf
(
keyword
)
!==-
1
)
)
}).
forEach
(
item
=>
{
})
const
index
=
standardList
?.
findIndex
(
_item
=>
_item
.
metadataId
===
item
.
_id
);
let
newItem
=
{...
item
};
if
(
index
!==
-
1
)
{
newItem
.
standard
=
standardList
[
index
];
}
newMetadataColumnList
.
push
(
newItem
);
});
return
paginate
(
newMetadataColumnList
,
pageNum
,
pageSize
);
return
paginate
(
newMetadataColumnList
,
pageNum
,
pageSize
);
}
}
return
[];
return
[];
},
[
metadataColumnList
,
standardList
,
pagination
,
keyword
])
},
[
metadataColumnList
,
pagination
,
keyword
])
const
getPermission
=
()
=>
{
const
getPermission
=
()
=>
{
dispatch
({
dispatch
({
...
@@ -446,7 +393,6 @@ const AssetAction = (props) => {
...
@@ -446,7 +393,6 @@ const AssetAction = (props) => {
try
{
try
{
setMetadata
(
JSON
.
parse
(
metadataValue
));
setMetadata
(
JSON
.
parse
(
metadataValue
));
getMetadataAttributes
();
getMetadataAttributes
();
getMetadataStandardList
();
}
catch
(
error
)
{
}
catch
(
error
)
{
}
}
...
@@ -543,30 +489,6 @@ const AssetAction = (props) => {
...
@@ -543,30 +489,6 @@ const AssetAction = (props) => {
})
})
}
}
const
getMetadataStandardList
=
()
=>
{
setMetadata
(
prevMetadata
=>
{
if
(
prevMetadata
.
metadataTableId
)
{
dispatch
({
type
:
'assetmanage.getMetadataStandardList'
,
payload
:
{
data
:
{
parentMetadataId
:
prevMetadata
.
metadataTableId
},
params
:
{
page
:
1
,
size
:
999999
}
},
callback
:
data
=>
{
setStandardList
(
data
?.
content
);
},
});
}
return
prevMetadata
;
})
}
const
onCancelButtonClick
=
()
=>
{
const
onCancelButtonClick
=
()
=>
{
setCurrentAction
(
'detail'
);
setCurrentAction
(
'detail'
);
getAsset
();
getAsset
();
...
@@ -883,23 +805,18 @@ const AssetAction = (props) => {
...
@@ -883,23 +805,18 @@ const AssetAction = (props) => {
})
})
}
}
const onSelectStandardCancel = (refresh = false) => {
// const onAttributeMaintainCancel = () => {
setSelectStandardParam({ visible: false, id: undefined });
// setAttributeMaintainParam({visible: false, metadataId: undefined});
refresh && getMetadataStandardList();
// }
}
const onAttributeMaintainCancel = () => {
setAttributeMaintainParam({visible: false, metadataId: undefined});
}
const onAttributeMaintainChange = (catalogId) => {
//
const onAttributeMaintainChange = (catalogId) => {
if (catalogId === '1') {
//
if (catalogId === '1') {
setPagination({...pagination, pageNum: 1});
//
setPagination({...pagination, pageNum: 1});
getMetadataAttributes();
//
getMetadataAttributes();
} else {
//
} else {
getMetadataStandardList();
//
getMetadataStandardList();
}
//
}
}
//
}
const onValuesChange = (changedValues, allValues) => {
const onValuesChange = (changedValues, allValues) => {
if (changedValues.hasOwnProperty('主题域分组')) {
if (changedValues.hasOwnProperty('主题域分组')) {
...
@@ -1094,7 +1011,7 @@ const AssetAction = (props) => {
...
@@ -1094,7 +1011,7 @@ const AssetAction = (props) => {
</div>
</div>
<Space style={{ marginLeft: 'auto' }}>
<Space style={{ marginLeft: 'auto' }}>
{
{
/* {
(reference===AssetManageReference||canEdit) && <Button
(reference===AssetManageReference||canEdit) && <Button
type='primary'
type='primary'
onClick={() => {
onClick={() => {
...
@@ -1110,7 +1027,7 @@ const AssetAction = (props) => {
...
@@ -1110,7 +1027,7 @@ const AssetAction = (props) => {
>
>
字段级维护
字段级维护
</Button>
</Button>
}
}
*/}
{/* <Dropdown overlay={
{/* <Dropdown overlay={
<Menu onClick={({ key })=>{
<Menu onClick={({ key })=>{
if (key === 'lineage') {
if (key === 'lineage') {
...
@@ -1204,19 +1121,13 @@ const AssetAction = (props) => {
...
@@ -1204,19 +1121,13 @@ const AssetAction = (props) => {
}
}
})
})
}} /> */}
}} /> */}
<SelectStandard
visible={selectStandardParam.visible}
id={selectStandardParam.id}
onCancel={onSelectStandardCancel}
/>
<AttributeMaintain
{/*
<AttributeMaintain
visible={attributeMaintainParam.visible}
visible={attributeMaintainParam.visible}
metadataId={attributeMaintainParam.metadataId}
metadataId={attributeMaintainParam.metadataId}
onCancel={onAttributeMaintainCancel}
onCancel={onAttributeMaintainCancel}
onChange={onAttributeMaintainChange}
onChange={onAttributeMaintainChange}
/>
/>
*/}
<AppContext.Consumer>
<AppContext.Consumer>
{
{
value => {
value => {
...
...
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