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
ae779580
Commit
ae779580
authored
Nov 13, 2023
by
zhaochengxiang
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
bug fix
parent
6eab010a
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
81 additions
and
57 deletions
+81
-57
App.js
src/App.js
+1
-0
AssetAction.jsx
src/view/Manage/AssetManage/Component/AssetAction.jsx
+80
-57
No files found.
src/App.js
View file @
ae779580
...
...
@@ -113,6 +113,7 @@ export class App extends React.Component {
}}
>
<
AssetTree
reference
=
{
AssetMountReference
}
metadataIds
=
{
hostParams
.
data
}
checkable
=
{
true
}
onCheck
=
{(
values
)
=>
{
hostParams
?.
callback
&&
hostParams
?.
callback
(
values
);
...
...
src/view/Manage/AssetManage/Component/AssetAction.jsx
View file @
ae779580
import
React
,
{
useEffect
,
useState
,
useContext
,
useMemo
,
useRef
}
from
'react'
;
import
{
Form
,
Spin
,
Input
,
Descriptions
,
Space
,
Button
,
Tooltip
,
Select
,
Cascader
,
Radio
,
Divider
,
Typography
,
Modal
,
Row
,
Col
,
Pagination
}
from
'antd'
;
import
{
Form
,
Spin
,
Input
,
Descriptions
,
Space
,
Button
,
Tooltip
,
Select
,
Cascader
,
Radio
,
Divider
,
Typography
,
Modal
,
Row
,
Col
,
Pagination
,
Dropdown
,
Menu
,
message
}
from
'antd'
;
import
{
DownOutlined
,
UpOutlined
,
QuestionCircleOutlined
}
from
'@ant-design/icons'
;
import
LocalStorage
from
'local-storage'
;
...
...
@@ -12,14 +12,14 @@ import Separate from './Separate';
import
AssetTagModal
from
'./AssetTagModal'
;
import
{
AnchorId
,
AnchorDirId
,
AssetManageReference
}
from
'../../../../util/constant'
;
import
IndexCode
from
'./IndexCode'
;
//
import Upload from './Upload';
import
Upload
from
'./Upload'
;
import
Table
from
'../../ResizeableTable'
;
import
{
CancelSvg
,
EditSvg
,
SaveSvg
,
FullScreenSvg
,
CancelFullScreenSvg
}
from
'./AssetSvg'
;
//
import SelectUser from '../../Model/Component/SelectUsers';
//
import SelectFilter from '../../Model/Component/SelectFilter';
import
SelectUser
from
'../../Model/Component/SelectUsers'
;
import
SelectFilter
from
'../../Model/Component/SelectFilter'
;
import
{
checkDataAssetEditable
}
from
'../../../../service/dataassetmanager'
;
//
import download from '../../../../util/download';
import
download
from
'../../../../util/download'
;
import
SelectStandard
from
'./SelectStandard'
;
import
AttributeMaintain
from
'./AttributeMaintain'
;
...
...
@@ -32,6 +32,7 @@ const AssetAction = (props) => {
const
[
assetParams
,
setAssetParams
]
=
useState
({
assets
:
{},
attributes
:
[],
attributesFoldMap
:
{}
});
const
[
elements
,
setElements
]
=
useState
([]);
const
[
wholeElements
,
setWholeElements
]
=
useState
([]);
const
[
currentAttribute
,
setCurrentAttribute
]
=
useState
();
const
[
metadataId
,
setMetadataId
]
=
useState
(
''
);
const
[
loading
,
setLoading
]
=
useState
(
false
);
const
[
confirmLoading
,
setConfirmLoading
]
=
useState
(
false
);
...
...
@@ -226,6 +227,7 @@ const AssetAction = (props) => {
}
else
{
setMetadataId
(
''
);
setAssetParams
({...
assetParams
,
...{
assets
:
{},
attributes
:
[]}});
setCurrentAttribute
();
getElements
();
}
}
...
...
@@ -482,6 +484,9 @@ const AssetAction = (props) => {
})
setAssetParams
({
assets
:
data
,
attributes
:
_attributes
,
attributesFoldMap
:
newAttributesFoldMap
});
if
((
_attributes
??[]).
length
>
0
)
{
setCurrentAttribute
(
_attributes
[
0
])
}
let
_fieldsValue
=
{};
(
data
.
elements
||
[]).
forEach
(
element
=>
{
...
...
@@ -668,16 +673,16 @@ const AssetAction = (props) => {
} catch (errInfo) {
console.log('Validate Failed:', errInfo);
s
etConfirmLoading(false);
s
howMessage('warn', '请完成资产必填项')
}
}
const onFoldButtonClick = (attribute, fold) => {
let newAttributesFoldMap = {...attributesFoldMap};
newAttributesFoldMap[attribute] = fold;
//
const onFoldButtonClick = (attribute, fold) => {
//
let newAttributesFoldMap = {...attributesFoldMap};
//
newAttributesFoldMap[attribute] = fold;
setAssetParams({...assetParams, attributesFoldMap: newAttributesFoldMap});
}
//
setAssetParams({...assetParams, attributesFoldMap: newAttributesFoldMap});
//
}
const onFullScreenClick = () => {
setFullScreen(!fullScreen);
...
...
@@ -752,22 +757,22 @@ const AssetAction = (props) => {
)
}
//
if (element.name==='数据关键用户' || element.name?.toLowerCase()==='业务数据owner' || element.name?.toLowerCase()==='it责任人') {
//
return <SelectUser
//
type='edit'
//
loading={loadingUsers}
//
users={users}
//
disabled={element.manualMaintain==='否'}
//
/>
//
}
if (element.name==='数据关键用户' || element.name?.toLowerCase()==='业务数据owner' || element.name?.toLowerCase()==='it责任人') {
return <SelectUser
type='edit'
loading={loadingUsers}
users={users}
disabled={element.manualMaintain==='否'}
/>
}
//
if (element.name==='业务责任部门' || element.name?.toLowerCase()==='it责任部门') {
//
return <SelectFilter
//
loading={loadingDepartments}
//
data={departments}
//
disabled={element.manualMaintain==='否'}
//
/>
//
}
if (element.name==='业务责任部门' || element.name?.toLowerCase()==='it责任部门') {
return <SelectFilter
loading={loadingDepartments}
data={departments}
disabled={element.manualMaintain==='否'}
/>
}
if (element.name === '主题域分组') {
return (
...
...
@@ -851,32 +856,32 @@ const AssetAction = (props) => {
return <IndexCode value={item.value||''} terms={terms} />;
}
//
if (item.name==='数据关键用户' || item.name?.toLowerCase()==='业务数据owner' || item.name?.toLowerCase()==='it责任人' || item.name==='创建人' || item.name==='更新人') {
//
return <SelectUser
//
type='detail'
//
users={users}
//
terms={terms}
//
value={item.value||''}
//
/>
//
}
if (item.name==='数据关键用户' || item.name?.toLowerCase()==='业务数据owner' || item.name?.toLowerCase()==='it责任人' || item.name==='创建人' || item.name==='更新人') {
return <SelectUser
type='detail'
users={users}
terms={terms}
value={item.value||''}
/>
}
return <span className='text-color'>{highlightSearchContentByTerms(item.value||'', terms)}</span>;
}
//
const onExportClick = () => {
//
dispatch({
//
type: 'assetmanage.exportMetadataAttributes',
//
payload: {
//
responseType: 'blob',
//
params: {
//
tableId: metadata?.metadataTableId
//
}
//
},
//
callback: (res) => {
//
download(res);
//
}
//
})
//
}
const onExportClick = () => {
dispatch({
type: 'assetmanage.exportMetadataAttributes',
payload: {
responseType: 'blob',
params: {
tableId: metadata?.metadataTableId
}
},
callback: (res) => {
download(res);
}
})
}
const onSelectStandardCancel = (refresh = false) => {
setSelectStandardParam({ visible: false, id: undefined });
...
...
@@ -999,10 +1004,18 @@ const AssetAction = (props) => {
spinning={loading}
>
<Form form={form} onValuesChange={onValuesChange}>
<Radio.Group className='mb-3' value={currentAttribute} onChange={(e) => {
setCurrentAttribute(e.target.value)
}}>
{
(attributes??[]).map((item,key) => (
<Radio.Button key={key} value={item}>{item}</Radio.Button>
))
}
</Radio.Group>
{
attributes?.map((attribute, index) => {
return <div key={index}>
<Divider orientation='left'>{attribute}</Divider>
return <div key={index} style={{ display: (attribute===currentAttribute)?'':'none' }}>
<Descriptions column={1} bordered>
{
wholeElements?.length>0 && elements?.map((element, index) => {
...
...
@@ -1098,7 +1111,9 @@ const AssetAction = (props) => {
字段级维护
</Button>
}
<Button type='primary' onClick={() => {
<Dropdown overlay={
<Menu onClick={({ key })=>{
if (key === 'lineage') {
if (metadata?.metadataTableId) {
app?.setGlobalState?.({
message: 'data-govern-show-metadata-relation',
...
...
@@ -1107,10 +1122,7 @@ const AssetAction = (props) => {
} else {
showMessage("warn","该资产目录没有关联元数据信息");
}
}}>
血缘关系
</Button>
<Button type='primary' onClick={() => {
} else if (key === 'impact') {
if (metadata?.metadataTableId) {
app?.setGlobalState?.({
message: 'data-govern-show-metadata-relation',
...
...
@@ -1119,13 +1131,24 @@ const AssetAction = (props) => {
} else {
showMessage("warn","该资产目录没有关联元数据信息");
}
}
}}>
影响关系
<Menu.Item key="lineage">血缘分析</Menu.Item>
<Menu.Item key="impact">影响分析</Menu.Item>
</Menu>
}>
<Button>
<Space>
关系分析
<DownOutlined />
</Space>
</Button>
</Dropdown>
<Input size="middle"
placeholder="搜索中英文名称/业务规则"
value={keyword}
bordered={true} allowClear
style={{ width: 200 }}
onChange={(e) => {
setPagination({...paginate, pageNum: 1})
setKeyword(e.target.value)
...
...
@@ -1142,7 +1165,7 @@ const AssetAction = (props) => {
</Space>
<Table
className='mt-
2
'
className='mt-
3
'
loading={loadingMetadataColumnList}
columns={permissionId?columns:columns.filter(item => item.dataIndex !== 'permission')}
rowKey='_id'
...
...
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