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
d65216e0
Commit
d65216e0
authored
Oct 12, 2023
by
zhaochengxiang
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
资源目录
parent
7f796881
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
55 additions
and
5 deletions
+55
-5
assetmanage.js
src/model/assetmanage.js
+5
-0
dataassetmanager.js
src/service/dataassetmanager.js
+5
-0
tree.jsx
src/view/Manage/AssetResourceManage/tree.jsx
+26
-1
update-node.jsx
src/view/Manage/AssetResourceManage/update-node.jsx
+19
-4
No files found.
src/model/assetmanage.js
View file @
d65216e0
...
...
@@ -264,4 +264,8 @@ export function* resourceTestSyncStrategy(payload) {
export
function
*
getDirectoryWithSyncStrategy
(
payload
)
{
return
yield
call
(
service
.
getDirectoryWithSyncStrategy
,
payload
)
}
export
function
*
resourceSyncSchema
(
payload
)
{
return
yield
call
(
service
.
resourceSyncSchema
,
payload
)
}
\ No newline at end of file
src/service/dataassetmanager.js
View file @
d65216e0
...
...
@@ -254,4 +254,8 @@ export function getPreviewRangeByDirId(payload) {
export
function
getDirectoryWithSyncStrategy
(
payload
)
{
return
GetJSON
(
"/dataassetmanager/resourceApi/getDirectoryWithSyncStrategy"
,
payload
)
}
export
function
resourceSyncSchema
(
payload
)
{
return
Post
(
"/dataassetmanager/resourceApi/syncSchema"
,
payload
);
}
\ No newline at end of file
src/view/Manage/AssetResourceManage/tree.jsx
View file @
d65216e0
...
...
@@ -4,7 +4,7 @@ import { PlusOutlined, ReloadOutlined, ImportOutlined, ExportOutlined, SettingOu
import
produce
from
'immer'
import
{
dispatch
}
from
'../../../model'
import
{
showMessage
,
highlightSearchContentByTerms
}
from
'../../../util'
import
{
showMessage
,
highlightSearchContentByTerms
,
showNotifaction
}
from
'../../../util'
import
Tree
from
'../../../util/Component/Tree'
import
PermissionButton
from
'../../../util/Component/PermissionButton'
import
UpdateNode
from
'./update-node'
...
...
@@ -143,6 +143,7 @@ const FC = (props) => {
{
id
:
'up'
,
title
:
'上移栏目'
},
{
id
:
'down'
,
title
:
'下移栏目'
},
{
id
:
'delete'
,
title
:
'删除栏目'
},
{
id
:
'sync'
,
title
:
'同步Schema'
},
]
}
else
if
(
rightSelectedNode
.
resourceType
===
'custom'
||
rightSelectedNode
.
type
===
'custom'
)
{
return
[
...
...
@@ -156,6 +157,7 @@ const FC = (props) => {
{
id
:
'up'
,
title
:
'上移目录'
},
{
id
:
'down'
,
title
:
'下移目录'
},
{
id
:
'delete'
,
title
:
'删除目录'
},
{
id
:
'sync'
,
title
:
'同步Schema'
},
]
}
}
...
...
@@ -300,6 +302,26 @@ const FC = (props) => {
getTreeData
(
false
)
}
const
onSyncNodeClick
=
()
=>
{
modal
.
confirm
({
title
:
'提示'
,
content
:
'确定同步schema吗?'
,
onOk
:
()
=>
{
dispatch
({
type
:
'assetmanage.resourceSyncSchema'
,
payload
:
{
params
:
{
dirId
:
rightSelectedNode
?.
nodeId
}
},
callback
:
(
data
)
=>
{
showNotifaction
(
'同步提示'
,
data
,
5
)
}
})
}
})
}
const
onTreeExpand
=
(
expandedKeys
)
=>
{
setExpandedKeys
(
expandedKeys
)
setAutoExpandParent
(
false
)
...
...
@@ -352,6 +374,7 @@ const FC = (props) => {
}
const
onMenuItemClick
=
(
key
,
node
)
=>
{
console
.
log
(
'key'
,
key
)
if
(
key
===
'delete'
)
{
onDeleteNodeClick
(
node
)
}
else
if
(
key
===
'edit'
)
{
...
...
@@ -364,6 +387,8 @@ const FC = (props) => {
onMoveNodeClick
(
1
)
}
else
if
(
key
===
'down'
)
{
onMoveNodeClick
(
-
1
)
}
else
if
(
key
===
'sync'
)
{
onSyncNodeClick
()
}
}
...
...
src/view/Manage/AssetResourceManage/update-node.jsx
View file @
d65216e0
...
...
@@ -17,6 +17,7 @@ const FC = (props) => {
const
[
loading
,
setLoading
]
=
React
.
useState
(
false
)
const
[
waiting
,
setWaiting
]
=
React
.
useState
(
false
)
const
[
node
,
setNode
]
=
React
.
useState
()
const
[
isCustomType
,
setIsCustomType
]
=
React
.
useState
(
false
)
const
basicRef
=
React
.
useRef
()
const
syncBasicRef
=
React
.
useRef
()
...
...
@@ -35,6 +36,9 @@ const FC = (props) => {
},
callback
:
data
=>
{
setNode
(
data
)
if
(
action
!==
'add'
)
{
setIsCustomType
(
data
?.
directory
?.
resourceType
===
'custom'
||
data
?.
directory
?.
type
===
'custom'
)
}
}
})
}
...
...
@@ -110,8 +114,17 @@ const FC = (props) => {
onCancel=
{
()
=>
{
close
()
}
}
>
<
Spin
spinning=
{
loading
||
waiting
}
>
<
Basic
ref=
{
basicRef
}
node=
{
node
?.
directory
}
action=
{
action
}
/>
<
SyncBasic
ref=
{
syncBasicRef
}
node=
{
node
?.
resourceDirectorySyncStrategy
}
action=
{
action
}
/>
<
Basic
ref=
{
basicRef
}
node=
{
node
?.
directory
}
action=
{
action
}
onResourceTypeChange=
{
(
val
)
=>
{
setIsCustomType
(
val
===
'custom'
)
}
}
/>
{
!
isCustomType
&&
<
SyncBasic
ref=
{
syncBasicRef
}
node=
{
node
?.
resourceDirectorySyncStrategy
}
action=
{
action
}
/>
}
</
Spin
>
</
Modal
>
)
...
...
@@ -119,7 +132,7 @@ const FC = (props) => {
export
default
FC
export
const
Basic
=
React
.
forwardRef
(
function
({
node
,
action
},
ref
)
{
export
const
Basic
=
React
.
forwardRef
(
function
({
node
,
action
,
onResourceTypeChange
},
ref
)
{
const
[
type
,
setType
]
=
React
.
useState
(
'root'
)
const
[
currentResourceType
,
setCurrentResourceType
]
=
React
.
useState
()
...
...
@@ -146,7 +159,9 @@ export const Basic = React.forwardRef(function ({ node, action }, ref) {
},
[
action
,
node
])
const
onValuesChange
=
(
changedValues
,
allValues
)
=>
{
if
(
changedValues
.
hasOwnProperty
(
'resourceType'
))
{
onResourceTypeChange
(
changedValues
.
resourceType
)
}
}
return
(
...
...
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