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
57d2e62e
Commit
57d2e62e
authored
Oct 27, 2025
by
放生的三文鱼
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
增加资产草稿详情
parent
53dd6146
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
109 additions
and
11 deletions
+109
-11
assetmanage.js
src/model/assetmanage.js
+5
-2
dataassetmanager.js
src/service/dataassetmanager.js
+5
-0
AssetDraft.jsx
src/view/Manage/AssetDraft/component/AssetDraft.jsx
+2
-2
assetData.jsx
src/view/Manage/AssetDraft/hooks/assetData.jsx
+7
-1
AssetAction.jsx
src/view/Manage/AssetManage/Component/AssetAction.jsx
+87
-3
AssetDetailDrawer.jsx
src/view/Manage/AssetManage/Component/AssetDetailDrawer.jsx
+3
-3
No files found.
src/model/assetmanage.js
View file @
57d2e62e
...
...
@@ -80,6 +80,10 @@ export function* getDataAssetDetail(payload) {
return
yield
call
(
service
.
getDataAssetDetail
,
payload
);
}
export
function
*
getDraftDataAssetDetail
(
payload
)
{
return
yield
call
(
service
.
getDraftDataAssetDetail
,
payload
)
}
export
function
*
listDataAssetsByPage
(
payload
)
{
return
yield
call
(
service
.
listDataAssetsByPage
,
payload
);
}
...
...
@@ -350,4 +354,4 @@ export function* listDraftDataAssetsByPage(payload) {
export
function
*
checkIsNeedSaveAsDraft
(
payload
)
{
return
yield
call
(
service
.
checkIsNeedSaveAsDraft
,
payload
)
}
\ No newline at end of file
}
src/service/dataassetmanager.js
View file @
57d2e62e
...
...
@@ -346,5 +346,10 @@ export function deleteDraftDataAsset(payload) {
return
PostJSON
(
'/dataassetmanager/draftApi/deleteDrafts'
,
payload
);
}
// /draftApi/getDraftDetail
export
function
getDraftDataAssetDetail
(
payload
)
{
return
PostJSON
(
'/dataassetmanager/draftApi/getDraftDetail'
,
payload
);
}
src/view/Manage/AssetDraft/component/AssetDraft.jsx
View file @
57d2e62e
...
...
@@ -18,7 +18,7 @@ const AssetManagementTable = () => {
const
[
draftParams
,
setDraftParams
]
=
React
.
useState
({
visible
:
false
,
dirId
:
""
,
i
d
:
''
,
draftI
d
:
''
,
templateType
:
""
,
});
const
{
...
...
@@ -146,7 +146,7 @@ const AssetManagementTable = () => {
setDraftParams
({
visible
:
false
,
dirId
:
""
,
i
d
:
''
,
draftI
d
:
''
,
templateType
:
""
,
});
}
}
...
...
src/view/Manage/AssetDraft/hooks/assetData.jsx
View file @
57d2e62e
...
...
@@ -8,6 +8,8 @@ import {
}
from
"../../../../service/dataassetmanager"
;
import
{
AssetItem
}
from
"../../AssetManage/Component/AssetTable"
;
import
{
showMessage
}
from
"../../../../util"
;
import
LocalStorage
from
'local-storage'
;
import
{
appId
}
from
"../../../../App"
;
const
{
Text
}
=
Typography
;
// ../standardmanage/hooks/sourceMap
...
...
@@ -32,6 +34,10 @@ export function useGetAssetDraft({ setDraftParams }) {
const
res
=
await
getTemplates
();
setTemplates
(
res
);
setCurrentTemplate
(
res
?.[
0
]?.
type
);
LocalStorage
.
set
(
`templateType-
${
appId
}
`
,
res
?.[
0
]?.
type
);
let
event
=
new
Event
(
"storage"
);
event
.
key
=
"assetTemplateChange"
;
window
?.
dispatchEvent
(
event
);
setLoading
(
false
);
}
catch
(
error
)
{
setLoading
(
false
);
...
...
@@ -187,7 +193,7 @@ export function useGetAssetDraft({ setDraftParams }) {
setDraftParams
({
visible
:
true
,
dirId
:
record
?.
dirId
,
i
d
:
record
?.
id
,
draftI
d
:
record
?.
id
,
templateType
:
currentTemplate
,
});
};
...
...
src/view/Manage/AssetManage/Component/AssetAction.jsx
View file @
57d2e62e
...
...
@@ -27,7 +27,7 @@ import AttributeMaintain from './AttributeMaintain';
import
'./AssetAction.less'
;
const
AssetAction
=
(
props
)
=>
{
const
{
id
,
dirId
,
action
,
terms
,
onChange
,
reference
,
form
,
onMetadataChange
,
onElementsChange
,
readonly
=
false
,
permissionId
,
templateType
}
=
props
;
const
{
id
,
dirId
,
draftId
,
action
,
terms
,
onChange
,
reference
,
form
,
onMetadataChange
,
onElementsChange
,
readonly
=
false
,
permissionId
,
templateType
}
=
props
;
const
[
currentAction
,
setCurrentAction
]
=
useState
(
action
);
const
[
assetParams
,
setAssetParams
]
=
useState
({
assets
:
{},
attributes
:
[],
attributesFoldMap
:
{}
});
...
...
@@ -167,7 +167,12 @@ const AssetAction = (props) => {
// getElements();
}
else
{
setCurrentAction
(
'detail'
);
if
((
id
||
''
)
!==
''
)
{
if
(
draftId
){
setPagination
({...
pagination
,
pageNum
:
1
});
getElements
();
getDraftData
()
}
else
if
((
id
||
''
)
!==
''
)
{
setPagination
({...
pagination
,
pageNum
:
1
});
getElements
();
getAssetPaths
();
...
...
@@ -336,7 +341,6 @@ const AssetAction = (props) => {
}
const
getElements
=
(
cb
=
null
)
=>
{
console
.
log
(
'data'
,
templateType
)
dispatch
({
type
:
(
currentAction
===
'add'
)?
'assetmanage.listElementsAndFillValue'
:
'assetmanage.listElements'
,
payload
:
(
currentAction
===
'add'
)?{
...
...
@@ -462,6 +466,86 @@ const AssetAction = (props) => {
})
}
// 获取草稿数据
const
getDraftData
=
(
userElements
=
null
)
=>
{
setLoading
(
true
);
dispatch
({
type
:
'assetmanage.getDraftDataAssetDetail'
,
payload
:
{
params
:
{
draftId
}
},
callback
:
data
=>
{
setLoading
(
false
);
const
metadataIndex
=
data
?.
elements
?.
findIndex
(
item
=>
item
.
name
===
'资产项'
);
if
(
metadataIndex
!==
-
1
)
{
let
metadataValue
=
data
?.
elements
[
metadataIndex
].
value
;
try
{
setMetadata
(
JSON
.
parse
(
metadataValue
));
getMetadataAttributes
();
getMetadataStandardList
();
}
catch
(
error
)
{
}
}
if
(
userElements
)
{
const
userElementIds
=
[];
(
userElements
||
[]).
forEach
(
element
=>
{
userElementIds
.
push
(
element
?.
id
);
});
const
filterElements
=
(
data
?.
elements
||
[]).
filter
(
element
=>
userElementIds
.
indexOf
(
element
?.
id
)
!==
-
1
);
data
=
{
...
data
,
elements
:
filterElements
};
}
setElements
(
data
?.
elements
||
[]);
onElementsChange
&&
onElementsChange
(
data
?.
elements
||
[]);
setMetadataId
(
data
?.
metadataId
||
''
);
onMetadataChange
&&
onMetadataChange
(
data
?.
metadataId
||
''
);
const
_attributes
=
[];
(
data
?.
elements
||
[]).
forEach
(
element
=>
{
if
(
_attributes
.
indexOf
(
element
.
type
)
===
-
1
)
{
_attributes
.
push
(
element
.
type
||
''
);
}
})
let
newAttributesFoldMap
=
{...
attributesFoldMap
};
(
_attributes
||
[]).
forEach
(
attribute
=>
{
if
(
newAttributesFoldMap
[
attribute
]
===
undefined
||
newAttributesFoldMap
[
attribute
]
===
null
)
{
newAttributesFoldMap
[
attribute
]
=
true
;
}
})
setAssetParams
({
assets
:
data
,
attributes
:
_attributes
,
attributesFoldMap
:
newAttributesFoldMap
});
if
((
_attributes
??[]).
length
>
0
)
{
setCurrentAttribute
(
_attributes
[
0
])
}
let
_fieldsValue
=
{};
(
data
.
elements
||
[]).
forEach
(
element
=>
{
_fieldsValue
[
element
.
name
]
=
element
.
value
||
''
;
if
(
element
.
name
===
'主题域分组'
)
{
setCurrentDomainGroup
(
element
.
value
);
}
else
if
(
element
.
name
===
'主题域'
)
{
setCurrentBussinessDomain
(
element
.
value
);
}
})
form
?.
setFieldsValue
(
_fieldsValue
);
},
error
:
()
=>
{
setLoading
(
false
);
}
})
}
const
getMetadataAttributes
=
()
=>
{
setMetadata
(
prevMetadata
=>
{
const
ids
=
prevMetadata
?.
columnItems
.
map
(
item
=>
item
.
metadataColumnId
);
...
...
src/view/Manage/AssetManage/Component/AssetDetailDrawer.jsx
View file @
57d2e62e
import
React
from
'react'
;
import
{
Drawer
,
Form
}
from
'antd'
;
import
{
getTemplateType
}
from
'../../../../util/axios'
;
import
AssetAction
from
'./AssetAction'
;
const
AssetDetailDrawer
=
(
props
)
=>
{
const
{
onCancel
,
visible
,
id
,
dirId
,
reference
,
templateType
=
''
,
draftId
=
''
}
=
props
;
const
[
form
]
=
Form
.
useForm
();
const
currentTemplateType
=
templateType
||
getTemplateType
();
return
(
<
Drawer
visible=
{
visible
}
...
...
@@ -20,7 +20,7 @@ const AssetDetailDrawer = (props) => {
}
}
>
{
visible
&&
<
AssetAction
templateType=
{
t
emplateType
}
reference=
{
reference
}
form=
{
form
}
id=
{
id
}
dirId=
{
dirId
}
draftId=
{
draftId
}
action=
'detail'
onChange=
{
()
=>
{
visible
&&
<
AssetAction
templateType=
{
currentT
emplateType
}
reference=
{
reference
}
form=
{
form
}
id=
{
id
}
dirId=
{
dirId
}
draftId=
{
draftId
}
action=
'detail'
onChange=
{
()
=>
{
onCancel
?.(
true
);
}
}
/>
}
...
...
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