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
643f0aee
Commit
643f0aee
authored
May 11, 2023
by
zhaochengxiang
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
资产关联标准
parent
eccd7dcd
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
55 additions
and
12 deletions
+55
-12
AssetAction.jsx
src/view/Manage/AssetManage/Component/AssetAction.jsx
+41
-6
AssetDetailPage.jsx
src/view/Manage/AssetManage/Component/AssetDetailPage.jsx
+2
-3
SelectStandard.jsx
src/view/Manage/AssetManage/Component/SelectStandard.jsx
+12
-3
No files found.
src/view/Manage/AssetManage/Component/AssetAction.jsx
View file @
643f0aee
...
...
@@ -51,6 +51,7 @@ const AssetAction = (props) => {
const
[
loadingMetadataColumnList
,
setLoadingMetadataColumnList
]
=
useState
(
false
);
const
[
metadataColumnList
,
setMetadataColumnList
]
=
useState
(
undefined
);
const
[
selectStandardParam
,
setSelectStandardParam
]
=
useState
({
visible
:
false
,
id
:
undefined
});
const
[
standardList
,
setStandardList
]
=
useState
(
undefined
);
const
app
=
useContext
(
AppContext
);
const
uploadRef
=
useRef
(
undefined
);
...
...
@@ -110,22 +111,36 @@ const AssetAction = (props) => {
title
:
'引用标准'
,
dataIndex
:
'standard'
,
ellipsis
:
true
,
render
:
(
_
,
record
)
=>
{
return
<
AppContext
.
Consumer
>
{
appValue
=>
<
a
onClick=
{
()
=>
{
appValue
?.
setGlobalState
&&
appValue
?.
setGlobalState
({
message
:
'data-govern-show-index-detail-message'
,
data
:
{
id
:
record
.
standard
?.
standardId
}
})
}
}
>
<
span
>
{
record
.
standard
?.
standardName
}
</
span
>
</
a
>
}
</
AppContext
.
Consumer
>
}
},
{
title
:
'操作'
,
dataIndex
:
'action'
,
width
:
80
,
render
:
(
_
,
record
)
=>
{
return
<
Button
return
(
reference
===
AssetManageReference
||
canEdit
)
?
<
Button
type=
'link'
size=
'small'
onClick=
{
()
=>
{
//
setSelectStandardParam(
{
visible
:
true
,
id
:
record
.
_id
});
setSelectStandardParam
({
visible
:
true
,
id
:
record
.
_id
});
}
}
style=
{
{
padding
:
0
}
}
>
关联标准
</
Button
>
</
Button
>
:
null
;
}
}
];
...
...
@@ -162,6 +177,22 @@ const AssetAction = (props) => {
return
[];
},
[
currentDomainGroup
,
treeDataMap
])
const
tableData
=
useMemo
(()
=>
{
if
(
metadataColumnList
&&
standardList
)
{
const
newMetadataColumnList
=
[...
metadataColumnList
];
newMetadataColumnList
.
forEach
(
item
=>
{
const
index
=
standardList
?.
findIndex
(
_item
=>
_item
.
metadataId
===
item
.
_id
);
if
(
index
!==
-
1
)
{
item
.
standard
=
standardList
[
index
];
}
});
return
newMetadataColumnList
;
}
return
[];
},
[
metadataColumnList
,
standardList
])
const
getAssetPaths
=
()
=>
{
dispatch
({
type
:
'assetmanage.getAssetPaths'
,
...
...
@@ -378,7 +409,7 @@ const AssetAction = (props) => {
try
{
setMetadata
(
JSON
.
parse
(
metadataValue
));
getMetadataAttributes
();
//
getMetadataStandardList();
getMetadataStandardList
();
}
catch
(
error
)
{
}
...
...
@@ -470,9 +501,13 @@ const AssetAction = (props) => {
data
:
{
parentMetadataId
:
prevMetadata
.
metadataTableId
},
params
:
{
page
:
1
,
size
:
999999
}
},
callback
:
data
=>
{
setStandardList
(
data
?.
content
);
},
});
}
...
...
@@ -933,7 +968,7 @@ const AssetAction = (props) => {
loading={loadingMetadataColumnList}
columns={columns}
rowKey='_id'
dataSource={
metadataColumnList
||[]}
dataSource={
tableData
||[]}
pagination={{
position: ['bottomLeft'],
size: 'small',
...
...
src/view/Manage/AssetManage/Component/AssetDetailPage.jsx
View file @
643f0aee
import
React
,
{
useEffect
,
useState
}
from
"react"
;
import
Asset
Action
from
'./AssetAction
'
;
import
Asset
Detail
from
'./AssetDetail
'
;
import
{
getQueryParam
}
from
'../../../../util'
;
import
'./AssetDetailPage.less'
;
import
{
AssetBrowseReference
}
from
"../../../../util/constant"
;
const
AssetDetailPage
=
(
props
)
=>
{
...
...
@@ -28,7 +27,7 @@ const AssetDetailPage = (props)=>{
</
div
>
<
div
className=
'detail-container'
>
<
div
className=
'detail-container-card'
>
<
Asset
Action
reference=
{
AssetBrowseReference
}
id=
{
id
}
action=
'detail'
dirId=
{
dirId
}
readonly=
{
true
}
/>
<
Asset
Detail
id=
{
id
}
dirId=
{
dirId
}
/>
</
div
>
</
div
>
</
div
>
...
...
src/view/Manage/AssetManage/Component/SelectStandard.jsx
View file @
643f0aee
...
...
@@ -72,7 +72,12 @@ const FC = (props) => {
parentClass
:
'Catalog'
},
callback
:
data
=>
{
setTreeData
(
data
);
const
filterData
=
data
?.
filter
(
item
=>
item
.
name
!==
'草稿'
);
if
(
filterData
&&
filterData
.
length
>
0
)
{
setCurrentTreeId
(
filterData
[
0
].
_id
);
}
setTreeData
(
filterData
);
}
});
}
...
...
@@ -146,15 +151,19 @@ const FC = (props) => {
bodyStyle=
{
{
padding
:
'24px'
,
height
:
'70vh'
,
overflow
:
'auto'
}
}
>
<
Row
>
<
Col
span=
{
8
}
>
<
Col
span=
{
6
}
>
<
Tree
showLine=
{
true
}
showIcon=
{
false
}
treeData=
{
loop
(
treeData
)
}
onSelect=
{
onTreeSelect
}
selectedKeys=
{
currentTreeId
?
[
currentTreeId
]:
undefined
}
/>
</
Col
>
<
Col
span=
{
16
}
>
<
Col
span=
{
1
}
>
<
div
style=
{
{
width
:
1
,
height
:
'calc(70vh - 48px)'
,
backgroundColor
:
'#f0f0f0'
}
}
></
div
>
</
Col
>
<
Col
span=
{
17
}
>
<
Table
columns=
{
columns
}
dataSource=
{
tableData
||
[]
}
...
...
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