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
07f204fd
Commit
07f204fd
authored
Nov 02, 2023
by
zhaochengxiang
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
未挂载资产多模版
parent
caaf76c8
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
65 additions
and
5 deletions
+65
-5
AssetManageTree.jsx
src/view/Manage/AssetManage/Component/AssetManageTree.jsx
+1
-0
AssetTable.jsx
src/view/Manage/AssetManage/Component/AssetTable.jsx
+63
-5
AssetTree.jsx
src/view/Manage/AssetManage/Component/AssetTree.jsx
+1
-0
No files found.
src/view/Manage/AssetManage/Component/AssetManageTree.jsx
View file @
07f204fd
...
...
@@ -750,6 +750,7 @@ const AssetManageTree = (props) => {
}
}
>
<
Select
loading=
{
loadingTemplates
}
size=
'small'
value=
{
currentTemplateType
}
onChange=
{
(
val
)
=>
{
...
...
src/view/Manage/AssetManage/Component/AssetTable.jsx
View file @
07f204fd
import
React
,{
useState
,
useEffect
,
useRef
,
useContext
,
useMemo
}
from
"react"
;
import
{
Button
,
Pagination
,
Space
,
Modal
,
Input
,
Table
,
Tooltip
,
Checkbox
,
Typography
,
Dropdown
,
Menu
,
Divider
}
from
"antd"
;
import
{
Button
,
Pagination
,
Space
,
Modal
,
Input
,
Table
,
Tooltip
,
Checkbox
,
Typography
,
Dropdown
,
Menu
,
Divider
,
Select
}
from
"antd"
;
import
classNames
from
'classnames'
;
import
{
Resizable
}
from
'react-resizable'
;
import
ResizeObserver
from
'rc-resize-observer'
;
...
...
@@ -16,7 +16,7 @@ import { showMessage, showNotifaction, getQueryParam, inputWidth, isSzseEnv } fr
import
{
AnchorId
,
AnchorDirId
,
AnchorTimestamp
,
AssetBrowseReference
,
AssetManageReference
,
AssetRecycleReference
,
ResourceBrowseReference
}
from
'../../../../util/constant'
;
import
{
FullScreenSvg
,
CancelFullScreenSvg
}
from
'./AssetSvg'
;
import
AssetDeleteModal
from
'./AssetDeleteModal'
;
import
{
AppContext
}
from
"../../../../App"
;
import
{
AppContext
,
appId
}
from
"../../../../App"
;
import
StartFlowModal
from
"./StartFlow"
;
import
"./AssetTable.less"
;
...
...
@@ -154,6 +154,9 @@ const AssetTable = (props) => {
visible
:
false
,
ids
:
undefined
})
const
[
loadingTemplates
,
setLoadingTemplates
]
=
useState
(
false
)
const
[
templates
,
setTemplates
]
=
useState
()
const
[
currentTemplateType
,
setTemplateType
]
=
useState
()
const
[
modal
,
contextHolder
]
=
Modal
.
useModal
();
const
anchorId
=
getQueryParam
(
AnchorId
,
props
?.
location
?.
search
);
...
...
@@ -164,6 +167,8 @@ const AssetTable = (props) => {
const
metadataIndexRef
=
useRef
(
''
);
const
remoteRelationRef
=
useRef
(
null
);
const
mountRef
=
useRef
(
true
)
const
app
=
useContext
(
AppContext
)
const
actionCol
=
{
...
...
@@ -215,6 +220,10 @@ const AssetTable = (props) => {
useEffect
(()
=>
{
getUsers
();
if
(
reference
===
AssetRecycleReference
)
{
getTemplates
()
}
window
?.
addEventListener
(
"storage"
,
storageChange
);
return
()
=>
{
...
...
@@ -225,7 +234,7 @@ const AssetTable = (props) => {
},
[])
useEffect
(()
=>
{
if
(
nodeId
!==
null
)
{
if
(
nodeId
!==
null
&&
nodeId
!==
undefined
)
{
setSelectItem
({});
setCheckedKeys
([]);
...
...
@@ -253,12 +262,25 @@ const AssetTable = (props) => {
},
[
timestamp
])
useEffect
(()
=>
{
if
(
nodeId
!==
null
||
reference
===
AssetRecycleReference
)
{
if
(
reference
!==
AssetRecycleReference
&&
nodeId
!==
null
)
{
getFilterElementsGroupThenGetDataAssets
();
}
}
//eslint-disable-next-line react-hooks/exhaustive-deps
},
[
keyword
,
pagination
,
elementsChanged
,
assetActionChanged
,
recursive
,
fullSearch
])
useEffect
(()
=>
{
if
(
reference
===
AssetRecycleReference
)
{
if
(
!
mountRef
.
current
)
{
getFilterElementsGroupThenGetDataAssets
()
}
if
(
mountRef
.
current
)
{
mountRef
.
current
=
false
}
}
//eslint-disable-next-line react-hooks/exhaustive-deps
},
[
keyword
,
pagination
,
elementsChanged
])
const
realAssets
=
useMemo
(()
=>
{
const
newAssets
=
[...
assets
];
if
(
users
?.
length
>
0
&&
assets
?.
length
>
0
&&
columns
?.
length
>
0
)
{
...
...
@@ -297,6 +319,25 @@ const AssetTable = (props) => {
}
}
const
getTemplates
=
()
=>
{
setLoadingTemplates
(
true
)
dispatch
({
type
:
'assetmanage.getTemplates'
,
callback
:
data
=>
{
setLoadingTemplates
(
false
)
setTemplates
(
data
)
if
((
data
??[]).
length
>
0
)
{
setTemplateType
(
data
[
0
].
type
)
LocalStorage
.
set
(
`templateType-
${
appId
}
`
,
data
[
0
].
type
)
getFilterElementsGroupThenGetDataAssets
();
}
},
error
:
()
=>
{
setLoadingTemplates
(
false
)
}
})
}
const
getUsers
=
()
=>
{
dispatch
({
type
:
'pds.getOwners'
,
...
...
@@ -973,6 +1014,23 @@ const AssetTable = (props) => {
// (reference===AssetManageReference && nodeLevel!==1 && nodeType!=='custom') && <Button onClick=
{
addAsset
}
>
新增
<
/Button>
}
{
reference
===
AssetRecycleReference
&&
<
Select
loading=
{
loadingTemplates
}
value=
{
currentTemplateType
}
onChange=
{
(
val
)
=>
{
setTemplateType
(
val
)
LocalStorage
.
set
(
`templateType-${appId}`
,
val
);
setPagination
({
...
pagination
,
pageNum
:
1
});
}
}
style=
{
{
width
:
80
}
}
>
{
(
templates
??[]).
map
((
item
,
index
)
=>
<
Select
.
Option
key=
{
index
}
value=
{
item
.
type
}
>
{
item
.
name
}
</
Select
.
Option
>)
}
</
Select
>
}
{
(
reference
===
AssetManageReference
&&
nodeType
!==
'custom'
)
&&
<
Button
onClick=
{
importAsset
}
>
导入
</
Button
>
}
...
...
src/view/Manage/AssetManage/Component/AssetTree.jsx
View file @
07f204fd
...
...
@@ -575,6 +575,7 @@ const AssetTree = (props) => {
>
<
Select
size=
'small'
loading=
{
loadingTemplates
}
value=
{
currentTemplateType
}
onChange=
{
(
val
)
=>
{
setTemplateType
(
val
)
...
...
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