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
5aa8f5e1
Commit
5aa8f5e1
authored
Oct 28, 2025
by
放生的三文鱼
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
增加导入导出
parent
b61721b7
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
66 additions
and
13 deletions
+66
-13
assetmanage.js
src/model/assetmanage.js
+10
-0
dataassetmanager.js
src/service/dataassetmanager.js
+11
-0
AssetDraft.jsx
src/view/Manage/AssetDraft/component/AssetDraft.jsx
+37
-5
ImportModal.jsx
src/view/Manage/AssetDraft/component/ImportModal.jsx
+8
-8
No files found.
src/model/assetmanage.js
View file @
5aa8f5e1
...
...
@@ -152,6 +152,11 @@ export function* assetImport(payload) {
return
yield
call
(
service
.
assetImport
,
payload
);
}
// draftImport
export
function
*
draftImport
(
payload
)
{
return
yield
call
(
service
.
draftImport
,
payload
);
}
export
function
*
getDirectoryById
(
payload
)
{
return
yield
call
(
service
.
getDirectoryById
,
payload
);
}
...
...
@@ -204,6 +209,11 @@ export function* importLogs(payload) {
return
yield
call
(
service
.
importLogs
,
payload
);
}
// importDraftLogs
export
function
*
importDraftLogs
(
payload
)
{
return
yield
call
(
service
.
importDraftLogs
,
payload
);
}
export
function
*
recoveryFromRecycleBin
(
payload
)
{
return
yield
call
(
service
.
recoveryFromRecycleBin
,
payload
);
}
...
...
src/service/dataassetmanager.js
View file @
5aa8f5e1
...
...
@@ -112,6 +112,12 @@ export function importLogs(payload) {
return
GetJSON
(
"/dataassetmanager/dataAssetApi/listDataAssetImportLogsByPage"
,
payload
);
}
// 导入草稿日志 /draftApi/listDraftImportLogsByPage
export
function
importDraftLogs
(
payload
)
{
return
GetJSON
(
"/dataassetmanager/draftApi/listDraftImportLogsByPage"
,
payload
);
}
export
function
recoveryFromRecycleBin
(
payload
)
{
return
PostJSON
(
"/dataassetmanager/dataAssetApi/recoveryFromRecycleBin"
,
payload
);
}
...
...
@@ -184,6 +190,11 @@ export function assetImport(payload) {
return
PostFile
(
"/dataassetmanager/dataAssetApi/import"
,
payload
);
}
// /draftApi/batchUpdateByImport
export
function
draftImport
(
payload
)
{
return
PostFile
(
"/dataassetmanager/draftApi/batchUpdateByImport"
,
payload
);
}
export
function
getDirectoryById
(
payload
)
{
return
GetJSON
(
"/dataassetmanager/directoryApi/getDirectoryById"
,
payload
);
}
...
...
src/view/Manage/AssetDraft/component/AssetDraft.jsx
View file @
5aa8f5e1
import
React
,
{
useCallback
,
createContext
,
useMemo
}
from
"react"
;
import
React
,
{
useCallback
,
useState
,
useMemo
}
from
"react"
;
import
{
Table
,
Button
,
...
...
@@ -12,17 +12,21 @@ import {
import
{
ExclamationCircleFilled
}
from
"@ant-design/icons"
;
import
{
useGetAssetDraft
}
from
"../hooks/assetData"
;
import
{
debounce
}
from
"lodash"
;
import
{
appId
}
from
"../../../../App"
;
import
AssetDetailDrawer
from
"../../AssetManage/Component/AssetDetailDrawer"
;
import
ImportModal
from
"./ImportModal"
;
import
LocalStorage
from
"local-storage"
;
import
"./index.less"
;
// 主组件
const
AssetManagementTable
=
()
=>
{
const
[
draftParams
,
setDraftParams
]
=
React
.
useState
({
const
[
draftParams
,
setDraftParams
]
=
useState
({
visible
:
false
,
dirId
:
""
,
draftId
:
""
,
templateType
:
""
,
});
const
[
importModalVisible
,
setImportModalVisible
]
=
useState
(
false
);
const
{
loading
,
templates
,
...
...
@@ -42,6 +46,7 @@ const AssetManagementTable = () => {
}
=
useGetAssetDraft
({
setDraftParams
});
const
[
modal
,
contextHolder
]
=
Modal
.
useModal
();
const
changeTemplate
=
(
value
)
=>
{
LocalStorage
.
set
(
`templateType-
${
appId
}
`
,
value
);
setCurrentTemplate
(
value
);
};
...
...
@@ -81,7 +86,7 @@ const AssetManagementTable = () => {
onOk
:
()
=>
{
if
(
type
===
"删除"
)
{
batchDelete
();
}
else
if
(
type
===
"送审"
)
{
}
else
if
(
type
===
"送审"
)
{
batchPublish
();
}
confirmed
.
destroy
();
...
...
@@ -89,6 +94,14 @@ const AssetManagementTable = () => {
});
};
const
handleExportDraft
=
()
=>
{
window
.
open
(
`/api/dataassetmanager/draftApi/exportByDraftIds?dataAssetIds=
${
selectedRowKeys
.
join
(
","
)}
&templateType=
${
currentTemplate
}
`
);
};
const
hasItems
=
useMemo
(()
=>
{
return
selectedRowKeys
.
length
===
0
;
},
[
selectedRowKeys
]);
...
...
@@ -113,8 +126,16 @@ const AssetManagementTable = () => {
value=
{
currentTemplate
}
onChange=
{
changeTemplate
}
/>
<
Button
disabled=
{
hasItems
}
>
批量修改
</
Button
>
<
Button
disabled=
{
hasItems
}
>
导出
</
Button
>
<
Button
onClick=
{
()
=>
{
setImportModalVisible
(
true
);
}
}
>
批量修改
</
Button
>
<
Button
disabled=
{
hasItems
}
onClick=
{
handleExportDraft
}
>
导出
</
Button
>
<
Button
disabled=
{
hasItems
}
type=
"primary"
...
...
@@ -202,6 +223,17 @@ const AssetManagementTable = () => {
});
}
}
/>
<
ImportModal
visible=
{
importModalVisible
}
onCancel=
{
()
=>
{
setImportModalVisible
(
false
);
}
}
onSuccess=
{
()
=>
{
getDraftData
();
setImportModalVisible
(
false
);
}
}
/>
{
contextHolder
}
</
div
>
);
...
...
src/view/Manage/AssetDraft/component/ImportModal.jsx
View file @
5aa8f5e1
import
React
,
{
useState
,
useEffect
,
useContext
}
from
'react'
;
import
{
Button
,
Upload
,
Drawer
,
Table
,
Pagination
,
Divider
,
Form
,
Typography
}
from
'antd'
;
import
{
UploadOutlined
,
DownloadOutlined
}
from
'@ant-design/icons'
;
import
{
dispatch
}
from
'../../../model'
;
import
{
showMessage
,
formatDate
}
from
'../../../util'
;
import
{
AppContext
}
from
'../../../App'
;
import
{
getTemplateType
}
from
'../../../util/axios'
;
import
{
dispatch
}
from
'../../../
../
model'
;
import
{
showMessage
,
formatDate
}
from
'../../../
../
util'
;
import
{
AppContext
}
from
'../../../
../
App'
;
import
{
getTemplateType
}
from
'../../../
../
util/axios'
;
const
FC
=
(
props
)
=>
{
const
{
onCancel
,
onSuccess
,
visible
,
}
=
props
;
const
{
onCancel
,
onSuccess
,
visible
}
=
props
;
const
[
fileList
,
setFileList
]
=
useState
([]);
const
[
confirmLoading
,
setConfirmLoading
]
=
useState
(
false
);
...
...
@@ -154,8 +154,8 @@ const FC = (props) => {
setConfirmLoading
(
true
);
dispatch
({
type
:
'assetmanage.draft
Asset
Import'
,
payload
:
{
fileList
:
fileList
,
params
:
{
env
:
`
${
app
?.
env
?.
domainId
}
`
, saveAsDraft: false
} },
type
:
'assetmanage.draftImport'
,
payload
:
{
fileList
:
fileList
,
params
:
{
env
:
`
${
app
?.
env
?.
domainId
}
`} },
callback: data => {
setConfirmLoading(false);
setFileList([]);
...
...
@@ -178,7 +178,7 @@ const FC = (props) => {
<Drawer
forceRender
visible={ visible }
title='资产
目录
草稿批量修改'
title='资产草稿批量修改'
width={900}
placement="right"
closable={ 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