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
c29c4f0a
Commit
c29c4f0a
authored
May 15, 2023
by
zhaochengxiang
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
资产解绑标准
parent
643f0aee
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
52 additions
and
7 deletions
+52
-7
assetmanage.js
src/model/assetmanage.js
+5
-0
dataassetmanager.js
src/service/dataassetmanager.js
+4
-0
AssetAction.jsx
src/view/Manage/AssetManage/Component/AssetAction.jsx
+43
-7
No files found.
src/model/assetmanage.js
View file @
c29c4f0a
...
@@ -295,3 +295,7 @@ export function* standardBatchMetadata(payload) {
...
@@ -295,3 +295,7 @@ export function* standardBatchMetadata(payload) {
export
function
*
getMetadataStandardList
(
payload
)
{
export
function
*
getMetadataStandardList
(
payload
)
{
return
yield
call
(
service
.
getMetadataStandardList
,
payload
);
return
yield
call
(
service
.
getMetadataStandardList
,
payload
);
}
}
export
function
*
deleteStandardBatchMetadata
(
payload
)
{
return
yield
call
(
service
.
deleteStandardBatchMetadata
,
payload
);
}
\ No newline at end of file
src/service/dataassetmanager.js
View file @
c29c4f0a
...
@@ -287,3 +287,7 @@ export function standardBatchMetadata(payload) {
...
@@ -287,3 +287,7 @@ export function standardBatchMetadata(payload) {
export
function
getMetadataStandardList
(
payload
)
{
export
function
getMetadataStandardList
(
payload
)
{
return
PostJSON
(
'/standard/indicator/find'
,
payload
);
return
PostJSON
(
'/standard/indicator/find'
,
payload
);
}
}
export
function
deleteStandardBatchMetadata
(
payload
)
{
return
PostJSON
(
'/standard/indicator/delete'
,
payload
);
}
src/view/Manage/AssetManage/Component/AssetAction.jsx
View file @
c29c4f0a
import
React
,
{
useEffect
,
useState
,
useContext
,
useMemo
,
useRef
}
from
'react'
;
import
React
,
{
useEffect
,
useState
,
useContext
,
useMemo
,
useRef
}
from
'react'
;
import
{
Form
,
Spin
,
Input
,
Descriptions
,
Space
,
Button
,
Tooltip
,
Select
,
Cascader
,
Table
,
Radio
,
Divider
,
Typography
}
from
'antd'
;
import
{
Form
,
Spin
,
Input
,
Descriptions
,
Space
,
Button
,
Tooltip
,
Select
,
Cascader
,
Table
,
Radio
,
Divider
,
Typography
,
Modal
}
from
'antd'
;
import
{
DownOutlined
,
UpOutlined
}
from
'@ant-design/icons'
;
import
{
DownOutlined
,
UpOutlined
}
from
'@ant-design/icons'
;
import
MetadataInfo
from
'./MetadataInfo'
;
import
MetadataInfo
from
'./MetadataInfo'
;
...
@@ -52,6 +52,7 @@ const AssetAction = (props) => {
...
@@ -52,6 +52,7 @@ const AssetAction = (props) => {
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
[
standardList
,
setStandardList
]
=
useState
(
undefined
);
const
[
modal
,
contextHolder
]
=
Modal
.
useModal
();
const
app
=
useContext
(
AppContext
);
const
app
=
useContext
(
AppContext
);
const
uploadRef
=
useRef
(
undefined
);
const
uploadRef
=
useRef
(
undefined
);
...
@@ -129,9 +130,10 @@ const AssetAction = (props) => {
...
@@ -129,9 +130,10 @@ const AssetAction = (props) => {
{
{
title
:
'操作'
,
title
:
'操作'
,
dataIndex
:
'action'
,
dataIndex
:
'action'
,
width
:
8
0
,
width
:
15
0
,
render
:
(
_
,
record
)
=>
{
render
:
(
_
,
record
)
=>
{
return
(
reference
===
AssetManageReference
||
canEdit
)
?
<
Button
return
(
reference
===
AssetManageReference
||
canEdit
)
?
<
Space
>
<
Button
type=
'link'
type=
'link'
size=
'small'
size=
'small'
onClick=
{
()
=>
{
onClick=
{
()
=>
{
...
@@ -140,7 +142,36 @@ const AssetAction = (props) => {
...
@@ -140,7 +142,36 @@ const AssetAction = (props) => {
style=
{
{
padding
:
0
}
}
style=
{
{
padding
:
0
}
}
>
>
关联标准
关联标准
</
Button
>
:
null
;
</
Button
>
{
record
.
standard
?.
standardId
&&
<
Button
type=
'link'
size=
'small'
onClick=
{
()
=>
{
modal
.
confirm
({
title
:
'您确定要取消关联标准吗?'
,
onOk
:
()
=>
{
dispatch
({
type
:
'assetmanage.deleteStandardBatchMetadata'
,
payload
:
{
params
:
{
ids
:
record
.
standard
?.
id
}
},
callback
:
()
=>
{
showMessage
(
"success"
,
"取消成功"
);
getMetadataStandardList
();
}
})
}
})
}
}
style=
{
{
padding
:
0
}
}
>
取消关联
</
Button
>
}
</
Space
>:
null
;
}
}
}
}
];
];
...
@@ -179,12 +210,16 @@ const AssetAction = (props) => {
...
@@ -179,12 +210,16 @@ const AssetAction = (props) => {
const
tableData
=
useMemo
(()
=>
{
const
tableData
=
useMemo
(()
=>
{
if
(
metadataColumnList
&&
standardList
)
{
if
(
metadataColumnList
&&
standardList
)
{
const
newMetadataColumnList
=
[...
metadataColumnList
];
const
newMetadataColumnList
=
[];
newMetadataColumnList
.
forEach
(
item
=>
{
metadataColumnList
.
forEach
(
item
=>
{
const
index
=
standardList
?.
findIndex
(
_item
=>
_item
.
metadataId
===
item
.
_id
);
const
index
=
standardList
?.
findIndex
(
_item
=>
_item
.
metadataId
===
item
.
_id
);
let
newItem
=
{...
item
};
if
(
index
!==
-
1
)
{
if
(
index
!==
-
1
)
{
i
tem
.
standard
=
standardList
[
index
];
newI
tem
.
standard
=
standardList
[
index
];
}
}
newMetadataColumnList
.
push
(
newItem
);
});
});
return
newMetadataColumnList
;
return
newMetadataColumnList
;
...
@@ -1015,6 +1050,7 @@ const AssetAction = (props) => {
...
@@ -1015,6 +1050,7 @@ const AssetAction = (props) => {
}
}
}
}
</AppContext.Consumer>
</AppContext.Consumer>
{contextHolder}
</div>
</div>
)
)
}
}
...
...
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