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
5253d360
Commit
5253d360
authored
Dec 07, 2023
by
zhaochengxiang
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
bug fix
parent
38de0949
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
20 additions
and
10 deletions
+20
-10
tree.jsx
src/view/Manage/AssetResourceManage/tree.jsx
+1
-3
update-node.jsx
src/view/Manage/AssetResourceManage/update-node.jsx
+19
-7
No files found.
src/view/Manage/AssetResourceManage/tree.jsx
View file @
5253d360
...
@@ -148,9 +148,7 @@ const FC = (props) => {
...
@@ -148,9 +148,7 @@ const FC = (props) => {
{
id
:
'down'
,
title
:
'下移栏目'
},
{
id
:
'down'
,
title
:
'下移栏目'
},
{
id
:
'delete'
,
title
:
'删除栏目'
}
{
id
:
'delete'
,
title
:
'删除栏目'
}
]
]
if
(
rightSelectedNode
.
resourceType
!==
'custom'
&&
rightSelectedNode
.
type
!==
'custom'
)
{
newMenuData
=
[...
newMenuData
,
{
id
:
'sync'
,
title
:
'同步Schema'
},]
}
return
newMenuData
return
newMenuData
}
else
if
(
rightSelectedNode
.
resourceType
===
'custom'
||
rightSelectedNode
.
type
===
'custom'
)
{
}
else
if
(
rightSelectedNode
.
resourceType
===
'custom'
||
rightSelectedNode
.
type
===
'custom'
)
{
return
[
return
[
...
...
src/view/Manage/AssetResourceManage/update-node.jsx
View file @
5253d360
...
@@ -17,6 +17,7 @@ const FC = (props) => {
...
@@ -17,6 +17,7 @@ const FC = (props) => {
const
[
loading
,
setLoading
]
=
React
.
useState
(
false
)
const
[
loading
,
setLoading
]
=
React
.
useState
(
false
)
const
[
waiting
,
setWaiting
]
=
React
.
useState
(
false
)
const
[
waiting
,
setWaiting
]
=
React
.
useState
(
false
)
const
[
node
,
setNode
]
=
React
.
useState
()
const
[
node
,
setNode
]
=
React
.
useState
()
const
[
type
,
setType
]
=
React
.
useState
(
'root'
)
const
[
isCustomType
,
setIsCustomType
]
=
React
.
useState
(
false
)
const
[
isCustomType
,
setIsCustomType
]
=
React
.
useState
(
false
)
const
basicRef
=
React
.
useRef
()
const
basicRef
=
React
.
useRef
()
...
@@ -28,6 +29,13 @@ const FC = (props) => {
...
@@ -28,6 +29,13 @@ const FC = (props) => {
}
}
},
[
visible
,
id
])
},
[
visible
,
id
])
const
showSync
=
React
.
useMemo
(()
=>
{
if
(
action
===
'add'
&&
type
===
'root'
)
return
false
if
(
action
===
'edit'
&&
(
node
?.
directory
?.
level
===
1
||
isCustomType
))
return
false
return
true
},
[
type
,
isCustomType
,
action
,
node
])
const
getDetail
=
()
=>
{
const
getDetail
=
()
=>
{
dispatch
({
dispatch
({
type
:
'assetmanage.getDirectoryWithSyncStrategy'
,
type
:
'assetmanage.getDirectoryWithSyncStrategy'
,
...
@@ -47,6 +55,8 @@ const FC = (props) => {
...
@@ -47,6 +55,8 @@ const FC = (props) => {
setLoading
(
false
)
setLoading
(
false
)
setWaiting
(
false
)
setWaiting
(
false
)
setNode
()
setNode
()
setType
(
'root'
)
setIsCustomType
(
false
)
onCancel
?.(
refresh
)
onCancel
?.(
refresh
)
}
}
...
@@ -59,7 +69,7 @@ const FC = (props) => {
...
@@ -59,7 +69,7 @@ const FC = (props) => {
let
parentPath
=
''
let
parentPath
=
''
if
(
action
===
'add'
)
{
if
(
action
===
'add'
)
{
if
(
basicRef
.
current
?.
getT
ype
===
'child'
)
{
if
(
t
ype
===
'child'
)
{
parentPath
=
node
?.
directory
?.
path
parentPath
=
node
?.
directory
?.
path
rows
.
resourceType
=
node
?.
directory
?.
resourceType
rows
.
resourceType
=
node
?.
directory
?.
resourceType
}
}
...
@@ -116,14 +126,18 @@ const FC = (props) => {
...
@@ -116,14 +126,18 @@ const FC = (props) => {
<
Spin
spinning=
{
loading
||
waiting
}
>
<
Spin
spinning=
{
loading
||
waiting
}
>
<
Basic
<
Basic
ref=
{
basicRef
}
ref=
{
basicRef
}
type=
{
type
}
node=
{
node
?.
directory
}
node=
{
node
?.
directory
}
action=
{
action
}
action=
{
action
}
onTypeChange=
{
(
val
)
=>
{
setType
(
val
)
}
}
onResourceTypeChange=
{
(
val
)
=>
{
onResourceTypeChange=
{
(
val
)
=>
{
setIsCustomType
(
val
===
'custom'
)
setIsCustomType
(
val
===
'custom'
)
}
}
}
}
/>
/>
{
{
!
isCustomType
&&
<
SyncBasic
ref=
{
syncBasicRef
}
node=
{
node
?.
resourceDirectorySyncStrategy
}
action=
{
action
}
/>
showSync
&&
<
SyncBasic
ref=
{
syncBasicRef
}
node=
{
node
?.
resourceDirectorySyncStrategy
}
action=
{
action
}
/>
}
}
</
Spin
>
</
Spin
>
</
Modal
>
</
Modal
>
...
@@ -132,18 +146,16 @@ const FC = (props) => {
...
@@ -132,18 +146,16 @@ const FC = (props) => {
export
default
FC
export
default
FC
export
const
Basic
=
React
.
forwardRef
(
function
({
node
,
action
,
onResourceTypeChange
},
ref
)
{
export
const
Basic
=
React
.
forwardRef
(
function
({
node
,
action
,
type
,
onTypeChange
,
onResourceTypeChange
},
ref
)
{
const
[
type
,
setType
]
=
React
.
useState
(
'root'
)
const
[
currentResourceType
,
setCurrentResourceType
]
=
React
.
useState
()
const
[
currentResourceType
,
setCurrentResourceType
]
=
React
.
useState
()
const
[
form
]
=
Form
.
useForm
()
const
[
form
]
=
Form
.
useForm
()
React
.
useImperativeHandle
(
ref
,
()
=>
({
React
.
useImperativeHandle
(
ref
,
()
=>
({
getType
:
type
,
validate
:
async
()
=>
{
validate
:
async
()
=>
{
return
await
form
.
validateFields
()
return
await
form
.
validateFields
()
},
},
}),
[
type
,
form
])
}),
[
form
])
React
.
useEffect
(()
=>
{
React
.
useEffect
(()
=>
{
if
(
node
)
{
if
(
node
)
{
...
@@ -182,7 +194,7 @@ export const Basic = React.forwardRef(function ({ node, action, onResourceTypeCh
...
@@ -182,7 +194,7 @@ export const Basic = React.forwardRef(function ({ node, action, onResourceTypeCh
rules=
{
[{
required
:
true
,
message
:
'请选择类型!'
}]
}
rules=
{
[{
required
:
true
,
message
:
'请选择类型!'
}]
}
>
>
<
Radio
.
Group
value=
{
type
}
onChange=
{
(
e
)
=>
{
<
Radio
.
Group
value=
{
type
}
onChange=
{
(
e
)
=>
{
setType
(
e
.
target
.
value
)
onTypeChange
?.
(
e
.
target
.
value
)
}
}
>
}
}
>
<
Radio
value=
'root'
>
栏目
</
Radio
>
<
Radio
value=
'root'
>
栏目
</
Radio
>
<
Radio
value=
'child'
disabled=
{
!
node
?.
id
}
>
目录
</
Radio
>
<
Radio
value=
'child'
disabled=
{
!
node
?.
id
}
>
目录
</
Radio
>
...
...
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