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
eccd7dcd
Commit
eccd7dcd
authored
May 10, 2023
by
zhaochengxiang
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
资产关联标准
parent
c9101653
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
298 additions
and
30 deletions
+298
-30
assetmanage.js
src/model/assetmanage.js
+17
-0
dataassetmanager.js
src/service/dataassetmanager.js
+17
-2
AssetAction.jsx
src/view/Manage/AssetManage/Component/AssetAction.jsx
+77
-25
AssetDetailDrawer.jsx
src/view/Manage/AssetManage/Component/AssetDetailDrawer.jsx
+1
-1
AssetDetailPage.jsx
src/view/Manage/AssetManage/Component/AssetDetailPage.jsx
+3
-2
SelectStandard.jsx
src/view/Manage/AssetManage/Component/SelectStandard.jsx
+183
-0
No files found.
src/model/assetmanage.js
View file @
eccd7dcd
...
...
@@ -278,4 +278,20 @@ export function* exportMetadataAttributes(payload) {
export
function
*
importMetadataAttributes
(
payload
)
{
return
yield
call
(
metadataService
.
importAttributes
,
payload
);
}
export
function
*
getStandardTree
(
payload
)
{
return
yield
call
(
service
.
getStandardTree
,
payload
);
}
export
function
*
getStandardList
(
payload
)
{
return
yield
call
(
service
.
getStandardList
,
payload
);
}
export
function
*
standardBatchMetadata
(
payload
)
{
return
yield
call
(
service
.
standardBatchMetadata
,
payload
);
}
export
function
*
getMetadataStandardList
(
payload
)
{
return
yield
call
(
service
.
getMetadataStandardList
,
payload
);
}
\ No newline at end of file
src/service/dataassetmanager.js
View file @
eccd7dcd
...
...
@@ -270,4 +270,20 @@ export function startFlow(payload) {
export
function
getSystems
(
payload
)
{
return
GetJSON
(
`/authservice/domains/
${
payload
.
env
}
/systems`
);
}
\ No newline at end of file
}
export
function
getStandardTree
(
payload
)
{
return
GetJSON
(
'/standard/rest/standard/maintain/tree/list'
,
payload
);
}
export
function
getStandardList
(
payload
)
{
return
PostJSON
(
'/standard/rest/standard/maintain/standard/list'
,
payload
);
}
export
function
standardBatchMetadata
(
payload
)
{
return
PostJSON
(
'/standard/indicator/save/batch'
,
payload
);
}
export
function
getMetadataStandardList
(
payload
)
{
return
PostJSON
(
'/standard/indicator/find'
,
payload
);
}
src/view/Manage/AssetManage/Component/AssetAction.jsx
View file @
eccd7dcd
import
React
,
{
useEffect
,
useState
,
useContext
,
useMemo
,
useRef
}
from
'react'
;
import
{
Form
,
Spin
,
Input
,
Descriptions
,
Space
,
Button
,
Tooltip
,
Select
,
Cascader
,
Table
,
Radio
,
Divider
}
from
'antd'
;
import
{
Form
,
Spin
,
Input
,
Descriptions
,
Space
,
Button
,
Tooltip
,
Select
,
Cascader
,
Table
,
Radio
,
Divider
,
Typography
}
from
'antd'
;
import
{
DownOutlined
,
UpOutlined
}
from
'@ant-design/icons'
;
import
MetadataInfo
from
'./MetadataInfo'
;
...
...
@@ -18,6 +18,7 @@ import SelectUser from '../../Model/Component/SelectUsers';
import
SelectFilter
from
'../../Model/Component/SelectFilter'
;
import
{
checkDataAssetEditable
}
from
'../../../../service/dataassetmanager'
;
import
download
from
'../../../../util/download'
;
import
SelectStandard
from
'./SelectStandard'
;
import
'./AssetAction.less'
;
const
AssetAction
=
(
props
)
=>
{
...
...
@@ -49,6 +50,7 @@ const AssetAction = (props) => {
const
[
metadata
,
setMetadata
]
=
useState
(
undefined
);
const
[
loadingMetadataColumnList
,
setLoadingMetadataColumnList
]
=
useState
(
false
);
const
[
metadataColumnList
,
setMetadataColumnList
]
=
useState
(
undefined
);
const
[
selectStandardParam
,
setSelectStandardParam
]
=
useState
({
visible
:
false
,
id
:
undefined
});
const
app
=
useContext
(
AppContext
);
const
uploadRef
=
useRef
(
undefined
);
...
...
@@ -95,13 +97,37 @@ const AssetAction = (props) => {
{
title
:
'类型'
,
dataIndex
:
'typeName'
,
width
:
100
,
ellipsis
:
true
,
},
{
title
:
'长度'
,
dataIndex
:
'size'
,
width
:
60
,
ellipsis
:
true
,
},
{
title
:
'引用标准'
,
dataIndex
:
'standard'
,
ellipsis
:
true
,
},
{
title
:
'操作'
,
dataIndex
:
'action'
,
width
:
80
,
render
:
(
_
,
record
)
=>
{
return
<
Button
type=
'link'
size=
'small'
onClick=
{
()
=>
{
// setSelectStandardParam(
{
visible
:
true
,
id
:
record
.
_id
});
}
}
style=
{
{
padding
:
0
}
}
>
关联标准
</
Button
>
}
}
];
useEffect
(()
=>
{
...
...
@@ -352,6 +378,7 @@ const AssetAction = (props) => {
try
{
setMetadata
(
JSON
.
parse
(
metadataValue
));
getMetadataAttributes
();
// getMetadataStandardList();
}
catch
(
error
)
{
}
...
...
@@ -409,28 +436,51 @@ const AssetAction = (props) => {
const
getMetadataAttributes
=
()
=>
{
setMetadata
(
prevMetadata
=>
{
setLoadingMetadataColumnList
(
true
);
const
ids
=
prevMetadata
?.
columnItems
.
map
(
item
=>
item
.
metadataColumnId
)
dispatch
({
type
:
'assetmanage.getMetadataAttributes'
,
payload
:
{
data
:
ids
,
params
:
{
catalog
:
app
?.
env
?.
domainId
,
const
ids
=
prevMetadata
?.
columnItems
.
map
(
item
=>
item
.
metadataColumnId
);
if
((
ids
||
[]).
length
>
0
)
{
dispatch
({
type
:
'assetmanage.getMetadataAttributes'
,
payload
:
{
data
:
ids
,
params
:
{
catalog
:
app
?.
env
?.
domainId
,
}
},
callback
:
data
=>
{
setLoadingMetadataColumnList
(
false
);
setMetadataColumnList
(
data
);
},
error
:
()
=>
{
setLoadingMetadataColumnList
(
false
);
}
},
callback
:
data
=>
{
setLoadingMetadataColumnList
(
false
);
setMetadataColumnList
(
data
);
},
error
:
()
=>
{
setLoadingMetadataColumnList
(
false
);
}
});
});
}
return
prevMetadata
})
}
const
getMetadataStandardList
=
()
=>
{
setMetadata
(
prevMetadata
=>
{
if
(
prevMetadata
.
metadataTableId
)
{
dispatch
({
type
:
'assetmanage.getMetadataStandardList'
,
payload
:
{
data
:
{
parentMetadataId
:
prevMetadata
.
metadataTableId
},
},
callback
:
data
=>
{
},
});
}
return
prevMetadata
;
})
}
const
onCancelButtonClick
=
()
=>
{
setCurrentAction
(
'detail'
);
getAsset
();
...
...
@@ -730,6 +780,11 @@ const AssetAction = (props) => {
})
}
const onSelectStandardCancel = (refresh = false) => {
setSelectStandardParam({ visible: false, id: undefined });
refresh && getMetadataStandardList();
}
const onValuesChange = (changedValues, allValues) => {
if (changedValues.hasOwnProperty('主题域分组')) {
setCurrentDomainGroup(changedValues['主题域分组']);
...
...
@@ -743,14 +798,6 @@ const AssetAction = (props) => {
style={{
height: '100%',
flexDirection: 'column',
overflow: 'auto',
// position: fullScreen?'absolute':'relative',
// left: 0,
// right: 0,
// top: 0,
// bottom: 0,
// backgroundColor: '#fff',
// zIndex: fullScreen?100:0,
}}
>
{
...
...
@@ -913,6 +960,11 @@ const AssetAction = (props) => {
})
}} />
<SelectStandard
visible={selectStandardParam.visible}
id={selectStandardParam.id}
onCancel={onSelectStandardCancel}
/>
<AppContext.Consumer>
{
value => {
...
...
src/view/Manage/AssetManage/Component/AssetDetailDrawer.jsx
View file @
eccd7dcd
...
...
@@ -13,7 +13,7 @@ const AssetDetailDrawer = (props) => {
forceRender
visible=
{
visible
}
title=
'资产详情'
width=
{
830
}
width=
'80%'
placement=
"right"
closable=
{
true
}
onClose=
{
()
=>
{
...
...
src/view/Manage/AssetManage/Component/AssetDetailPage.jsx
View file @
eccd7dcd
import
React
,
{
useEffect
,
useState
}
from
"react"
;
import
Asset
Detail
from
'./AssetDetail
'
;
import
Asset
Action
from
'./AssetAction
'
;
import
{
getQueryParam
}
from
'../../../../util'
;
import
'./AssetDetailPage.less'
;
import
{
AssetBrowseReference
}
from
"../../../../util/constant"
;
const
AssetDetailPage
=
(
props
)
=>
{
...
...
@@ -27,7 +28,7 @@ const AssetDetailPage = (props)=>{
</
div
>
<
div
className=
'detail-container'
>
<
div
className=
'detail-container-card'
>
<
Asset
Detail
id=
{
id
}
dirId=
{
dirId
}
/>
<
Asset
Action
reference=
{
AssetBrowseReference
}
id=
{
id
}
action=
'detail'
dirId=
{
dirId
}
readonly=
{
true
}
/>
</
div
>
</
div
>
</
div
>
...
...
src/view/Manage/AssetManage/Component/SelectStandard.jsx
0 → 100644
View file @
eccd7dcd
import
React
,
{
useEffect
,
useState
}
from
"react"
;
import
{
Modal
,
Button
,
Space
,
Tree
,
Row
,
Col
,
Table
,
Pagination
}
from
"antd"
;
import
{
getAttributesByMetadataModel
}
from
"../../../../service/dataassetmanager"
;
import
{
dispatch
}
from
'../../../../model'
;
import
{
showMessage
}
from
"../../../../util"
;
const
FC
=
(
props
)
=>
{
const
{
visible
,
onCancel
,
id
}
=
props
;
const
[
treeData
,
setTreeData
]
=
useState
(
undefined
);
const
[
tableData
,
setTableData
]
=
useState
(
undefined
);
const
[
total
,
setTotal
]
=
useState
(
0
);
const
[
pagination
,
setPagination
]
=
useState
(
{
pageNum
:
1
,
pageSize
:
20
}
);
const
[
confirmLoading
,
setConfirmLoading
]
=
useState
(
false
);
const
[
currentTreeId
,
setCurrentTreeId
]
=
useState
(
undefined
);
const
{
pageNum
,
pageSize
}
=
pagination
;
const
columns
=
[
{
title
:
'序号'
,
dataIndex
:
'key'
,
render
:
(
text
,
record
,
index
)
=>
{
return
(
index
+
1
).
toString
();
},
width
:
60
,
ellipsis
:
true
,
},
{
title
:
'标准中文名'
,
dataIndex
:
'name'
,
ellipsis
:
true
,
render
:
(
text
,
record
)
=>
{
return
<
a
onClick=
{
()
=>
{
onOk
(
record
.
_id
);
}
}
>
{
text
}
</
a
>
}
},
{
title
:
'标准名称'
,
dataIndex
:
'cnName'
,
ellipsis
:
true
,
render
:
(
text
,
record
)
=>
{
return
<
a
onClick=
{
()
=>
{
onOk
(
record
.
_id
);
}
}
>
{
text
}
</
a
>
}
},
];
useEffect
(()
=>
{
if
(
visible
)
{
getTreeData
();
}
},
[
visible
])
useEffect
(()
=>
{
if
(
currentTreeId
)
{
getTableData
();
}
},
[
pagination
,
currentTreeId
])
const
getTreeData
=
()
=>
{
dispatch
({
type
:
'assetmanage.getStandardTree'
,
payload
:
{
namePath
:
0
,
needOrg
:
true
,
parentClass
:
'Catalog'
},
callback
:
data
=>
{
setTreeData
(
data
);
}
});
}
const
getTableData
=
()
=>
{
dispatch
({
type
:
'assetmanage.getStandardList'
,
payload
:
{
params
:
{
page
:
pageNum
,
size
:
pageSize
,
parentId
:
currentTreeId
,
keyword
:
''
},
data
:
[
"Catalog,StandardCatalog,IndicatorStandard"
]
},
callback
:
data
=>
{
setTableData
(
data
.
content
);
setTotal
(
data
.
totalElements
);
}
});
}
const
onOk
=
(
standardId
)
=>
{
dispatch
({
type
:
'assetmanage.standardBatchMetadata'
,
payload
:
{
params
:
{
metadataIds
:
id
,
standardId
},
},
callback
:
data
=>
{
showMessage
(
'warn'
,
'关联成功'
);
onCancel
?.(
true
);
}
});
}
const
onTreeSelect
=
(
keys
,
_
)
=>
{
if
(
keys
.
length
>
0
)
{
setCurrentTreeId
(
keys
[
0
]);
}
}
const
changeCurrent
=
(
page
,
size
)
=>
{
setPagination
({
pageNum
:
page
,
pageSize
:
size
});
}
const
loop
=
(
data
)
=>
data
?.
map
(
item
=>
{
if
(
item
.
children
&&
item
.
children
.
length
>
0
)
{
return
{...
item
,
title
:
item
.
name
,
key
:
item
.
_id
,
children
:
loop
(
item
.
children
)};
}
return
{...
item
,
title
:
item
.
name
,
key
:
item
.
_id
,
children
:
null
};
});
return
(
<
Modal
title=
'选择指标'
visible=
{
visible
}
centered
width=
'90%'
onCancel=
{
()
=>
{
onCancel
?.();
}
}
footer=
{
<
Space
>
<
Button
onClick=
{
()
=>
onCancel
?.()
}
>
取消
</
Button
>
</
Space
>
}
bodyStyle=
{
{
padding
:
'24px'
,
height
:
'70vh'
,
overflow
:
'auto'
}
}
>
<
Row
>
<
Col
span=
{
8
}
>
<
Tree
showLine=
{
true
}
showIcon=
{
false
}
treeData=
{
loop
(
treeData
)
}
onSelect=
{
onTreeSelect
}
/>
</
Col
>
<
Col
span=
{
16
}
>
<
Table
columns=
{
columns
}
dataSource=
{
tableData
||
[]
}
rowKey=
'_id'
pagination=
{
false
}
/>
<
Pagination
className=
"m-3"
size=
'small'
position=
{
[
'bottomLeft'
]
}
onChange=
{
changeCurrent
}
onShowSizeChange=
{
changeCurrent
}
current=
{
pageNum
}
pageSize=
{
pageSize
}
defaultCurrent=
{
1
}
total=
{
total
}
showTotal=
{
total
=>
`共 ${total} 条`
}
/>
</
Col
>
</
Row
>
</
Modal
>
)
}
export
default
FC
;
\ No newline at end of file
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