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
7f796881
Commit
7f796881
authored
Oct 12, 2023
by
zhaochengxiang
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
资源目录同步schema
parent
3c598fe3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
30 additions
and
23 deletions
+30
-23
dataassetmanager.js
src/service/dataassetmanager.js
+1
-1
tree.jsx
src/view/Manage/AssetResourceManage/tree.jsx
+9
-7
update-node.jsx
src/view/Manage/AssetResourceManage/update-node.jsx
+20
-15
No files found.
src/service/dataassetmanager.js
View file @
7f796881
...
@@ -249,7 +249,7 @@ export function getPreviewRangeByDirId(payload) {
...
@@ -249,7 +249,7 @@ export function getPreviewRangeByDirId(payload) {
}
}
export
function
resourceTestSyncStrategy
(
payload
)
{
export
function
resourceTestSyncStrategy
(
payload
)
{
return
Post
JSON
(
"/dataassetmanager/resourceApi/testSyncStrategy"
,
payload
)
return
Post
(
"/dataassetmanager/resourceApi/testSyncStrategy"
,
payload
)
}
}
export
function
getDirectoryWithSyncStrategy
(
payload
)
{
export
function
getDirectoryWithSyncStrategy
(
payload
)
{
...
...
src/view/Manage/AssetResourceManage/tree.jsx
View file @
7f796881
...
@@ -315,20 +315,22 @@ const FC = (props) => {
...
@@ -315,20 +315,22 @@ const FC = (props) => {
}
}
const
onUpdateNodeCancel
=
(
refresh
=
false
,
nodeId
=
undefined
)
=>
{
const
onUpdateNodeCancel
=
(
refresh
=
false
,
nodeId
=
undefined
)
=>
{
setUpdateNodeParam
({
setUpdateNodeParam
(
prevParam
=>
{
visible
:
false
,
action
:
undefined
,
id
:
undefined
})
if
(
refresh
)
{
if
(
refresh
)
{
if
(
nodeId
)
{
if
(
prevParam
.
action
!==
'add'
&&
nodeId
)
{
setSelectedKey
(
nodeId
)
setSelectedKey
(
nodeId
)
getTreeData
()
getTreeData
()
}
else
{
}
else
{
getTreeData
(
false
)
getTreeData
(
false
)
}
}
}
}
return
{
visible
:
false
,
action
:
undefined
,
id
:
undefined
}
})
}
}
const
onImportNodeCancel
=
(
refresh
=
false
,
resetSelectedNode
=
false
)
=>
{
const
onImportNodeCancel
=
(
refresh
=
false
,
resetSelectedNode
=
false
)
=>
{
...
...
src/view/Manage/AssetResourceManage/update-node.jsx
View file @
7f796881
...
@@ -57,6 +57,7 @@ const FC = (props) => {
...
@@ -57,6 +57,7 @@ const FC = (props) => {
if
(
action
===
'add'
)
{
if
(
action
===
'add'
)
{
if
(
basicRef
.
current
?.
getType
===
'child'
)
{
if
(
basicRef
.
current
?.
getType
===
'child'
)
{
parentPath
=
node
?.
directory
?.
path
parentPath
=
node
?.
directory
?.
path
rows
.
resourceType
=
node
?.
directory
?.
resourceType
}
}
}
else
{
}
else
{
parentPath
=
node
?.
directory
?.
path
.
substring
(
0
,
node
?.
directory
?.
path
.
lastIndexOf
(
"/"
))
parentPath
=
node
?.
directory
?.
path
.
substring
(
0
,
node
?.
directory
?.
path
.
lastIndexOf
(
"/"
))
...
@@ -172,7 +173,7 @@ export const Basic = React.forwardRef(function ({ node, action }, ref) {
...
@@ -172,7 +173,7 @@ export const Basic = React.forwardRef(function ({ node, action }, ref) {
<
Form
.
Item
<
Form
.
Item
label=
"资源类型"
label=
"资源类型"
name=
"resourceType"
name=
"resourceType"
rules=
{
[{
required
:
tru
e
,
message
:
'请选择资源类型!'
}]
}
rules=
{
[{
required
:
(
action
===
'add'
&&
type
===
'root'
)?
true
:
fals
e
,
message
:
'请选择资源类型!'
}]
}
>
>
{
{
(
action
===
'add'
&&
type
===
'root'
)
?
<
Select
allowClear
>
(
action
===
'add'
&&
type
===
'root'
)
?
<
Select
allowClear
>
...
@@ -232,13 +233,7 @@ export const SyncBasic = React.forwardRef(function ({ node, action }, ref) {
...
@@ -232,13 +233,7 @@ export const SyncBasic = React.forwardRef(function ({ node, action }, ref) {
React
.
useImperativeHandle
(
ref
,
()
=>
({
React
.
useImperativeHandle
(
ref
,
()
=>
({
validate
:
async
()
=>
{
validate
:
async
()
=>
{
const
rows
=
await
form
.
validateFields
()
const
rows
=
await
form
.
validateFields
()
if
(
!
rows
.
blacklist
)
{
convertRows
(
rows
)
rows
.
blacklist
=
''
}
if
(
!
rows
.
whitelist
)
{
rows
.
whitelist
=
''
}
return
rows
return
rows
},
},
}),
[
form
])
}),
[
form
])
...
@@ -251,19 +246,29 @@ export const SyncBasic = React.forwardRef(function ({ node, action }, ref) {
...
@@ -251,19 +246,29 @@ export const SyncBasic = React.forwardRef(function ({ node, action }, ref) {
}
}
},
[
action
,
node
])
},
[
action
,
node
])
const
onTestClick
=
()
=>
{
const
convertRows
=
(
rows
)
=>
{
if
(
!
testData
)
{
if
(
!
rows
.
schemas
)
{
showMessage
(
'warn'
,
'请先输入测试数据'
)
rows
.
schemas
=
[]
return
}
if
(
!
rows
.
autoSyncStatus
)
{
rows
.
autoSyncStatus
=
0
}
}
const
rows
=
form
?.
getFieldsValue
()
if
(
!
rows
.
blacklist
)
{
if
(
!
rows
.
blacklist
)
{
rows
.
blacklist
=
''
rows
.
blacklist
=
''
}
}
if
(
!
rows
.
whitelist
)
{
if
(
!
rows
.
whitelist
)
{
rows
.
whitelist
=
''
rows
.
whitelist
=
''
}
}
}
const
onTestClick
=
()
=>
{
if
(
!
testData
)
{
showMessage
(
'warn'
,
'请先输入测试数据'
)
return
}
const
rows
=
form
?.
getFieldsValue
()
convertRows
(
rows
)
dispatch
({
dispatch
({
type
:
'assetmanage.resourceTestSyncStrategy'
,
type
:
'assetmanage.resourceTestSyncStrategy'
,
...
@@ -274,7 +279,7 @@ export const SyncBasic = React.forwardRef(function ({ node, action }, ref) {
...
@@ -274,7 +279,7 @@ export const SyncBasic = React.forwardRef(function ({ node, action }, ref) {
data
:
rows
,
data
:
rows
,
},
},
callback
:
data
=>
{
callback
:
data
=>
{
setTestResultData
(
data
)
},
},
error
:
()
=>
{
error
:
()
=>
{
...
...
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