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
a67470f6
Commit
a67470f6
authored
May 21, 2025
by
放生的三文鱼
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
导出问题
parent
1f2792f6
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
38 additions
and
9 deletions
+38
-9
assetsActionManageService.ts
src/services/assetsActionManageService.ts
+28
-0
AssetTable.jsx
src/view/Manage/AssetManage/Component/AssetTable.jsx
+10
-9
No files found.
src/services/assetsActionManageService.ts
View file @
a67470f6
...
@@ -46,6 +46,34 @@ class AssetsActionManageService{
...
@@ -46,6 +46,34 @@ class AssetsActionManageService{
console
.
log
(
error
)
console
.
log
(
error
)
})
})
}
}
async
exportBusinessColumnsByDataAssetId
(
payload
:
any
,
autotip
=
false
){
await
request
({
url
:
`
${
asset
}
/dataAssetColumnApi/exportBusinessColumnsByDataAssetId`
,
method
:
"postdownload"
,
data
:
qs
.
stringify
(
payload
),
responseType
:
'blob'
},
autotip
).
then
((
data
:
any
)
=>
{
let
types
=
data
.
data
.
type
var
blob
=
new
Blob
([
data
.
data
],
{
type
:
types
});
let
fileName
=
''
let
contentDisposition
=
data
.
headers
[
'content-disposition'
];
if
(
contentDisposition
)
{
fileName
=
window
.
decodeURI
(
data
.
headers
[
'content-disposition'
].
split
(
'='
)[
1
]);
}
if
(
typeof
window
.
navigator
.
msSaveBlob
!==
'undefined'
)
{
window
.
navigator
.
msSaveBlob
(
blob
,
fileName
);
}
else
{
var
csvURL
=
window
.
URL
.
createObjectURL
(
blob
);
var
tempLink
=
document
.
createElement
(
'a'
);
tempLink
.
href
=
csvURL
;
tempLink
.
setAttribute
(
'download'
,
fileName
);
tempLink
.
setAttribute
(
'target'
,
'_blank'
);
document
.
body
.
appendChild
(
tempLink
);
tempLink
.
click
();
document
.
body
.
removeChild
(
tempLink
);
}
}).
catch
(
error
=>
{
console
.
log
(
error
)
})
}
async
getAssetColumnDetail
(
payload
:
any
,
autotip
=
false
){
async
getAssetColumnDetail
(
payload
:
any
,
autotip
=
false
){
let
result
=
await
request
({
url
:
`
${
asset
}
/dataAssetColumnApi/getDataAssetColumnDetail`
,
method
:
"post"
,
data
:
qs
.
stringify
(
payload
)
},
autotip
).
then
(
data
=>
{
let
result
=
await
request
({
url
:
`
${
asset
}
/dataAssetColumnApi/getDataAssetColumnDetail`
,
method
:
"post"
,
data
:
qs
.
stringify
(
payload
)
},
autotip
).
then
(
data
=>
{
...
...
src/view/Manage/AssetManage/Component/AssetTable.jsx
View file @
a67470f6
...
@@ -106,7 +106,7 @@ export const listSubject = new Subject();
...
@@ -106,7 +106,7 @@ export const listSubject = new Subject();
const
AssetTable
=
(
props
)
=>
{
const
AssetTable
=
(
props
)
=>
{
const
{
className
,
nodeId
,
nodeType
,
setAddDir
,
nodeAllowdLoadDataAsset
,
elementsChanged
,
assetActionChanged
,
onSelect
,
onCountChange
,
reference
=
AssetManageReference
,
onFullScreenChange
,
template
}
=
props
;
const
{
className
,
nodeId
,
nodeType
,
setAddDir
,
nodeAllowdLoadDataAsset
,
elementsChanged
,
assetActionChanged
,
onSelect
,
onCountChange
,
reference
=
AssetManageReference
,
onFullScreenChange
,
template
}
=
props
;
const
MENU_ID
=
'asset-table'
;
const
MENU_ID
=
'asset-table'
;
const
{
show
}
=
useContextMenu
({
const
{
show
}
=
useContextMenu
({
...
@@ -820,9 +820,11 @@ const AssetTable = (props) => {
...
@@ -820,9 +820,11 @@ const AssetTable = (props) => {
if
((
checkedKeys
||
[]).
length
===
0
)
{
if
((
checkedKeys
||
[]).
length
===
0
)
{
modal
.
confirm
({
modal
.
confirm
({
title
:
'提示'
,
title
:
'提示'
,
content
:
'是否导出
所有
资源目录?'
,
content
:
'是否导出资源目录?'
,
onOk
:
()
=>
{
onOk
:
()
=>
{
window
.
open
(
`/api/dataassetmanager/dataAssetApi/exportByDataAssetIds?exportAll=true&templateType=
${
getTemplateType
()}
&queryElementId=
${
currentElementId
??
''
}
&
keyword
=
$
{
encodeURIComponent
(
keyword
??
''
)}
`);
const
exportAll
=
checkedKeys
?.
length
===
0
&&
!
nodeId
?
true
:
false
const
dirId
=
checkedKeys
?.
length
===
0
&&
nodeId
?
nodeId
:
''
window
.
open
(
`/api/dataassetmanager/dataAssetApi/exportByDataAssetIds?exportAll=
${
exportAll
}
&dirId=
${
dirId
}
&templateType=
${
getTemplateType
()}
&queryElementId=
${
currentElementId
??
''
}
&
keyword
=
$
{
encodeURIComponent
(
keyword
??
''
)}
`);
}
}
})
})
} else {
} else {
...
@@ -831,18 +833,17 @@ const AssetTable = (props) => {
...
@@ -831,18 +833,17 @@ const AssetTable = (props) => {
}
}
const exportAssetColumns = () => {
const exportAssetColumns = () => {
if ((checkedKeys||[]).length) {
modal.confirm({
modal.confirm({
title: '提示',
title: '提示',
content: '是否导出
所选资源目录的
字段?',
content: '是否导出
资源目录
字段?',
async onOk(){
async onOk(){
await assetsActionManageService.exportAssetsColumns({templateType:getTemplateType(),dataAssetIds:checkedKeys.join(',')})
//
await assetsActionManageService.exportAssetsColumns({templateType:getTemplateType(),dataAssetIds:checkedKeys.join(',')})
//window.open(`
/
api
/
dataassetmanager
/
dataAssetApi
/
exportByDataAssetIds
?
exportAll
=
true
&
templateType
=
$
{
getTemplateType
()}
&
queryElementId
=
$
{
currentElementId
??
''
}
&
keyword
=
$
{
encodeURIComponent
(
keyword
??
''
)}
`);
//window.open(`
/
api
/
dataassetmanager
/
dataAssetApi
/
exportByDataAssetIds
?
exportAll
=
true
&
templateType
=
$
{
getTemplateType
()}
&
queryElementId
=
$
{
currentElementId
??
''
}
&
keyword
=
$
{
encodeURIComponent
(
keyword
??
''
)}
`);
const exportAll = checkedKeys?.length === 0 && !nodeId ? true : false
const dirId = checkedKeys?.length === 0 && nodeId ? nodeId : ''
await assetsActionManageService.exportBusinessColumnsByDataAssetId({dirId,exportAll,templateType:getTemplateType(),dataAssetIds:checkedKeys.join(',')})
}
}
})
})
} else {
message.info("请选择导出资源")
}
}
}
const subscriptAsset = () => {
const subscriptAsset = () => {
...
...
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