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
5dba9f5a
Commit
5dba9f5a
authored
Mar 27, 2025
by
fanyj
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
tijiao
parent
b7c2833e
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
74 additions
and
13 deletions
+74
-13
assetsActionManageService.ts
src/services/assetsActionManageService.ts
+27
-0
AssetManageTree.jsx
src/view/Manage/AssetManage/Component/AssetManageTree.jsx
+22
-12
AssetTable.jsx
src/view/Manage/AssetManage/Component/AssetTable.jsx
+25
-1
No files found.
src/services/assetsActionManageService.ts
View file @
5dba9f5a
...
@@ -20,6 +20,33 @@ class AssetsActionManageService{
...
@@ -20,6 +20,33 @@ class AssetsActionManageService{
return
result
;
return
result
;
}
}
async
exportAssetsColumns
(
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
)
})
}
}
}
export
default
new
AssetsActionManageService
()
export
default
new
AssetsActionManageService
()
src/view/Manage/AssetManage/Component/AssetManageTree.jsx
View file @
5dba9f5a
...
@@ -843,6 +843,8 @@ const AssetManageTree = (props) => {
...
@@ -843,6 +843,8 @@ const AssetManageTree = (props) => {
'asset-manage-tree-asset-mount-reference'
:
reference
===
AssetMountReference
,
'asset-manage-tree-asset-mount-reference'
:
reference
===
AssetMountReference
,
});
});
console
.
log
(
currentRightClickDir
)
return
(
return
(
<
Card
<
Card
className=
{
classes
}
className=
{
classes
}
...
@@ -1020,7 +1022,9 @@ const AssetManageTree = (props) => {
...
@@ -1020,7 +1022,9 @@ const AssetManageTree = (props) => {
if
(
reference
===
AssetManageReference
&&
(
havePermission
||
addDir
))
{
if
(
reference
===
AssetManageReference
&&
(
havePermission
||
addDir
))
{
setCurrentRightClickDir
(
node
);
setCurrentRightClickDir
(
node
);
setCurrentDirType
(
node
.
type
||
''
);
setCurrentDirType
(
node
.
type
||
''
);
displayMenu
(
event
);
setTimeout
(()
=>
{
displayMenu
(
event
);
},
100
)
}
}
}
}
}
}
/>
/>
...
@@ -1044,23 +1048,29 @@ const AssetManageTree = (props) => {
...
@@ -1044,23 +1048,29 @@ const AssetManageTree = (props) => {
dirId=
{
currentDirId
}
dirId=
{
currentDirId
}
/>
/>
{
{
(
reference
!==
AssetMountReference
&&
havePermission
)
&&
<
RcMenu
id=
{
MENU_ID
}
>
(
reference
!==
AssetMountReference
&&
(
havePermission
||
currentRightClickDir
?.
allowUpdateDir
||
currentRightClickDir
?.
allowDeleteDir
)
)
&&
<
RcMenu
id=
{
MENU_ID
}
>
{
{
viewSelectedKeyRef
.
current
===
'dir'
&&
<
React
.
Fragment
>
viewSelectedKeyRef
.
current
===
'dir'
&&
<
React
.
Fragment
>
<
RcItem
id=
"edit"
onClick=
{
editDir
}
>
{
(
havePermission
||
currentRightClickDir
?.
allowUpdateDir
)
&&
<
RcItem
id=
"edit"
onClick=
{
editDir
}
>
修改目录
修改目录
</
RcItem
>
</
RcItem
>
}
<
RcItem
id=
"up"
onClick=
{
()
=>
{
moveNode
(
1
);
}
}
>
{
上移目录
havePermission
&&
(
</
RcItem
>
<>
<
RcItem
id=
"down"
onClick=
{
()
=>
{
moveNode
(
-
1
);
}
}
>
<
RcItem
id=
"up"
onClick=
{
()
=>
{
moveNode
(
1
);
}
}
>
下移目录
上移目录
</
RcItem
>
</
RcItem
>
<
RcItem
id=
"down"
onClick=
{
()
=>
{
moveNode
(
-
1
);
}
}
>
下移目录
</
RcItem
>
</>
)
}
</
React
.
Fragment
>
</
React
.
Fragment
>
}
}
<
RcItem
id=
"delete"
onClick=
{
deleteDir
}
>
{
(
havePermission
||
currentRightClickDir
?.
allowDeleteDir
)
&&
<
RcItem
id=
"delete"
onClick=
{
deleteDir
}
>
删除目录
删除目录
</
RcItem
>
</
RcItem
>
}
</
RcMenu
>
</
RcMenu
>
}
}
{
contextHolder
}
{
contextHolder
}
...
...
src/view/Manage/AssetManage/Component/AssetTable.jsx
View file @
5dba9f5a
import
React
,{
useState
,
useEffect
,
useRef
,
useContext
,
useMemo
}
from
"react"
;
import
React
,{
useState
,
useEffect
,
useRef
,
useContext
,
useMemo
}
from
"react"
;
import
{
Button
,
Pagination
,
Space
,
Modal
,
Input
,
Tooltip
,
Checkbox
,
Typography
,
Dropdown
,
Menu
,
Divider
,
Select
}
from
"antd"
;
import
{
Button
,
Pagination
,
Space
,
Modal
,
Input
,
Tooltip
,
Checkbox
,
Typography
,
Dropdown
,
Menu
,
Divider
,
Select
,
message
}
from
"antd"
;
import
classNames
from
'classnames'
;
import
classNames
from
'classnames'
;
import
{
Resizable
}
from
'react-resizable'
;
import
{
Resizable
}
from
'react-resizable'
;
import
ResizeObserver
from
'rc-resize-observer'
;
import
ResizeObserver
from
'rc-resize-observer'
;
...
@@ -33,6 +33,7 @@ import PermissionMenuItem from '../../../../util/Component/PermissionMenuItem'
...
@@ -33,6 +33,7 @@ import PermissionMenuItem from '../../../../util/Component/PermissionMenuItem'
import
"./AssetTable.less"
;
import
"./AssetTable.less"
;
import
'react-contexify/dist/ReactContexify.css'
;
import
'react-contexify/dist/ReactContexify.css'
;
import
{
getTemplateType
}
from
"../../../../util/axios"
;
import
{
getTemplateType
}
from
"../../../../util/axios"
;
import
{
assetsActionManageService
}
from
"@/services"
;
const
{
Text
}
=
Typography
;
const
{
Text
}
=
Typography
;
const
{
Column
}
=
Table
;
const
{
Column
}
=
Table
;
...
@@ -830,6 +831,21 @@ const AssetTable = (props) => {
...
@@ -830,6 +831,21 @@ const AssetTable = (props) => {
}
}
}
}
const exportAssetColumns = () => {
if ((checkedKeys||[]).length) {
modal.confirm({
title: '提示',
content: '是否导出所选资源目录的字段?',
async onOk(){
await assetsActionManageService.exportAssetsColumns({templateType:getTemplateType(),dataAssetIds:checkedKeys.join(',')})
//window.open(`
/
api
/
dataassetmanager
/
dataAssetApi
/
exportByDataAssetIds
?
exportAll
=
true
&
templateType
=
$
{
getTemplateType
()}
&
queryElementId
=
$
{
currentElementId
??
''
}
&
keyword
=
$
{
encodeURIComponent
(
keyword
??
''
)}
`);
}
})
} else {
message.info("请选择导出资源")
}
}
const subscriptAsset = () => {
const subscriptAsset = () => {
if ((checkedKeys||[]).length === 0) return;
if ((checkedKeys||[]).length === 0) return;
...
@@ -1235,6 +1251,14 @@ const AssetTable = (props) => {
...
@@ -1235,6 +1251,14 @@ const AssetTable = (props) => {
导出
导出
</PermissionButton>
</PermissionButton>
}
}
{
(reference===AssetManageReference) && <PermissionButton
defaultPermission={exportAble}
onClick={exportAssetColumns}
>
导出字段
</PermissionButton>
}
<PermissionButton
<PermissionButton
defaultPermission={subscribeAble}
defaultPermission={subscribeAble}
onClick={subscriptAsset}
onClick={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