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
922fb667
Commit
922fb667
authored
Feb 24, 2022
by
zhaochengxiang
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
资产关联元数据
parent
a1cef66a
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
49 additions
and
12 deletions
+49
-12
AssetAction.jsx
src/view/Manage/AssetManage/Component/AssetAction.jsx
+49
-12
No files found.
src/view/Manage/AssetManage/Component/AssetAction.jsx
View file @
922fb667
...
...
@@ -6,6 +6,7 @@ import MetadataInfo from './MetadataInfo';
import
{
dispatch
}
from
'../../../../model'
;
import
{
highlightSearchContentByTerms
,
showMessage
}
from
'../../../../util'
;
import
{
unfoldedElements
}
from
'../util'
;
import
{
AppContext
}
from
'../../../../App'
;
const
AssetAction
=
(
props
)
=>
{
...
...
@@ -174,6 +175,26 @@ const AssetAction = (props) => {
setFullScreen
(
!
fullScreen
);
}
//选中元数据后 内容回填.
const
fillElementValueBeforeCreate
=
(
mid
=
metadataId
)
=>
{
dispatch
({
type
:
'assetmanage.fillElementValueBeforeCreate'
,
payload
:
{
params
:
{
metadataIds
:
mid
}
},
callback
:
data
=>
{
let
_fieldsValue
=
{};
(
data
||
[]).
forEach
(
element
=>
{
_fieldsValue
[
element
.
name
]
=
element
.
value
;
})
form
.
setFieldsValue
(
_fieldsValue
);
}
})
}
const
formItemLayout
=
{
labelCol
:
{
xs
:
{
span
:
24
},
...
...
@@ -261,20 +282,36 @@ const AssetAction = (props) => {
<
div
style=
{
{
padding
:
10
}
}
>
{
(
currentAction
===
'add'
||
currentAction
===
'edit'
)
?
<
Form
{
...
formItemLayout
}
form=
{
form
}
>
{
(
sameAttributeElements
||
[]).
map
((
element
,
_index
)
=>
{
<
AppContext
.
Consumer
>
{
value
=>
{
value
?.
onGlobalStateChange
&&
value
?.
onGlobalStateChange
((
state
,
prev
)
=>
{
if
(
state
.
message
===
'data-govern-show-metadata-list-callback-message'
)
{
setMetadataId
(
state
.
data
?.
metadataId
||
''
);
form
?.
setFieldsValue
({
'资产项'
:
state
.
data
?.
metadataInfoJson
||
''
});
if
((
state
.
data
?.
metadataId
||
''
)
!==
''
)
{
fillElementValueBeforeCreate
(
state
.
data
?.
metadataId
||
''
);
}
}
});
return
(
<
Form
.
Item
label=
{
element
.
name
}
name=
{
element
.
name
}
key=
{
_index
}
style=
{
{
marginBottom
:
(
_index
===
sameAttributeElements
.
length
-
1
)?
0
:
10
}
}
>
{
(
element
.
name
===
'资产项'
)
?
<
MetadataInfo
/>
:
<
Input
disabled=
{
element
.
manualMaintain
===
'否'
}
/>
}
</
Form
.
Item
>
(
sameAttributeElements
||
[]).
map
((
element
,
_index
)
=>
{
return
(
<
Form
.
Item
label=
{
element
.
name
}
name=
{
element
.
name
}
key=
{
_index
}
style=
{
{
marginBottom
:
(
_index
===
sameAttributeElements
.
length
-
1
)?
0
:
10
}
}
>
{
(
element
.
name
===
'资产项'
)
?
<
MetadataInfo
/>
:
<
Input
disabled=
{
element
.
manualMaintain
===
'否'
}
/>
}
</
Form
.
Item
>
);
})
);
}
)
}
}
}
</
AppContext
.
Consumer
>
</
Form
>
:
<
Descriptions
column=
{
1
}
>
{
(
sameAttributeElements
||
[]).
map
((
item
,
index
)
=>
{
...
...
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