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
adba7530
Commit
adba7530
authored
Nov 24, 2022
by
zhaochengxiang
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
来源模型名称调用接口
parent
304bfc55
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
35 additions
and
2 deletions
+35
-2
assetmanage.js
src/model/assetmanage.js
+4
-0
dataassetmanager.js
src/service/dataassetmanager.js
+4
-0
AttributeRelationModal.jsx
...w/Manage/AssetManage/Component/AttributeRelationModal.jsx
+27
-2
No files found.
src/model/assetmanage.js
View file @
adba7530
...
...
@@ -17,6 +17,10 @@ export function* listElementsAndFillValue(payload) {
return
yield
call
(
service
.
listElementsAndFillValue
,
payload
)
}
export
function
*
listSupportSourceModels
()
{
return
yield
call
(
service
.
listSupportSourceModels
)
}
export
function
*
listUserElements
()
{
return
yield
call
(
service
.
listUserElements
);
}
...
...
src/service/dataassetmanager.js
View file @
adba7530
...
...
@@ -240,6 +240,10 @@ export function fillElementValueBeforeCreate(payload) {
return
PostJSON
(
"/dataassetmanager/eleAndAttrApi/fillElementValueBeforeCreate"
,
payload
);
}
export
function
listSupportSourceModels
()
{
return
GetJSON
(
"/dataassetmanager/eleAndAttrApi/listSupportSourceModels"
);
}
export
function
countResourceState
(
payload
)
{
return
GetJSON
(
"/dataassetmanager/countApi/countResourceState"
,
payload
);
}
...
...
src/view/Manage/AssetManage/Component/AttributeRelationModal.jsx
View file @
adba7530
...
...
@@ -102,7 +102,7 @@ const MetaModelSelect = ({ value = {}, metaModelTreeData = [], onChange, ...rest
}
const
AttributeRelationWithSourceModel
=
(
props
)
=>
{
const
{
elements
,
sourceModel
,
metadataModelTreeData
,
activeKey
,
onChange
}
=
props
;
const
{
elements
,
sourceModel
,
supportSourceModelsName
,
metadataModelTreeData
,
activeKey
,
onChange
}
=
props
;
const
[
loading
,
setLoading
]
=
useState
(
false
)
const
[
confirmLoading
,
setConfirmLoading
]
=
useState
(
false
);
...
...
@@ -238,7 +238,19 @@ const AttributeRelationWithSourceModel = (props) => {
name=
'sourceModel'
rules=
{
[{
required
:
true
,
message
:
'请输入来源名称'
}]
}
>
<
Input
placeholder=
'请输入来源模型名称'
disabled=
{
sourceModel
}
/>
<
Select
allowClear
placeholder=
'请选择来源模型名称'
disabled=
{
sourceModel
}
>
{
supportSourceModelsName
?.
map
((
name
,
index
)
=>
{
return
<
Select
.
Option
key=
{
index
}
value=
{
name
}
>
{
name
}
</
Select
.
Option
>
})
}
</
Select
>
</
Form
.
Item
>
{
(
elements
||
[]).
map
((
element
,
index
)
=>
{
...
...
@@ -263,6 +275,7 @@ const AttributeRelationWithSourceModel = (props) => {
const
AttributeRelationModal
=
(
props
)
=>
{
const
{
visible
,
onCancel
}
=
props
;
const
[
supportSourceModelsName
,
setSupportSourceModelsName
]
=
useState
()
const
[
loadingSourceModels
,
setLoadingSourceModels
]
=
useState
(
false
)
const
[
sourceModels
,
setSourceModels
]
=
useState
()
const
[
metadataModelTreeData
,
setMetadataModelTreeData
]
=
useState
([]);
...
...
@@ -273,6 +286,7 @@ const AttributeRelationModal = (props) => {
useEffect
(()
=>
{
if
(
visible
)
{
getSupportSourceModelsName
();
getSourceModels
();
loadElementWithoutCustom
();
getMetadataModelTree
();
...
...
@@ -284,6 +298,16 @@ const AttributeRelationModal = (props) => {
return
[...
sourceModels
||
[],
AddSourceModelName
]
},
[
sourceModels
])
const
getSupportSourceModelsName
=
()
=>
{
dispatch
({
type
:
'assetmanage.listSupportSourceModels'
,
callback
:
(
data
)
=>
{
console
.
log
(
'data'
,
data
)
setSupportSourceModelsName
(
data
||
[])
},
})
}
const
getSourceModels
=
()
=>
{
setLoadingSourceModels
(
true
)
dispatch
({
...
...
@@ -381,6 +405,7 @@ const AttributeRelationModal = (props) => {
return
<
Tabs
.
TabPane
tab=
{
item
}
key=
{
item
}
>
<
AttributeRelationWithSourceModel
elements=
{
elements
}
supportSourceModelsName=
{
supportSourceModelsName
}
metadataModelTreeData=
{
metadataModelTreeData
}
sourceModel=
{
item
===
AddSourceModelName
?
undefined
:
item
}
activeKey=
{
activeKey
}
...
...
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