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
ca6f37cf
Commit
ca6f37cf
authored
Nov 30, 2023
by
zhaochengxiang
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
bug fix
parent
c1d6e9f3
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
74 additions
and
42 deletions
+74
-42
AssetManageTree.jsx
src/view/Manage/AssetManage/Component/AssetManageTree.jsx
+11
-1
AssetTable.jsx
src/view/Manage/AssetManage/Component/AssetTable.jsx
+1
-1
AssetTree.jsx
src/view/Manage/AssetManage/Component/AssetTree.jsx
+23
-16
UpdateDirectoryModal.jsx
...iew/Manage/AssetManage/Component/UpdateDirectoryModal.jsx
+39
-24
No files found.
src/view/Manage/AssetManage/Component/AssetManageTree.jsx
View file @
ca6f37cf
...
@@ -443,6 +443,11 @@ const AssetManageTree = (props) => {
...
@@ -443,6 +443,11 @@ const AssetManageTree = (props) => {
setUpdateDirectoryModalVisible
(
true
);
setUpdateDirectoryModalVisible
(
true
);
}
}
const
onDetailClick
=
()
=>
{
setUpdateDirectoryAction
(
'detail'
);
setUpdateDirectoryModalVisible
(
true
);
}
const
editDir
=
()
=>
{
const
editDir
=
()
=>
{
if
((
currentDirType
||
''
)
===
''
)
{
if
((
currentDirType
||
''
)
===
''
)
{
...
@@ -793,7 +798,7 @@ const AssetManageTree = (props) => {
...
@@ -793,7 +798,7 @@ const AssetManageTree = (props) => {
getAllDirectoryAsTree
(
false
)
getAllDirectoryAsTree
(
false
)
},
100
)
},
100
)
}
}
}
}
style=
{
{
width
:
65
}
}
style=
{
{
width
:
80
}
}
>
>
{
{
(
templates
??[]).
map
((
item
,
index
)
=>
<
Select
.
Option
key=
{
index
}
value=
{
item
.
type
}
>
{
item
.
name
}
</
Select
.
Option
>)
(
templates
??[]).
map
((
item
,
index
)
=>
<
Select
.
Option
key=
{
index
}
value=
{
item
.
type
}
>
{
item
.
name
}
</
Select
.
Option
>)
...
@@ -892,6 +897,11 @@ const AssetManageTree = (props) => {
...
@@ -892,6 +897,11 @@ const AssetManageTree = (props) => {
{
{
(
reference
!==
AssetMountReference
)
&&
<
RcMenu
id=
{
MENU_ID
}
>
(
reference
!==
AssetMountReference
)
&&
<
RcMenu
id=
{
MENU_ID
}
>
{
{
currentRightClickDir
&&
(
currentRightClickDir
.
type
!==
'custom'
)
&&
<
RcItem
id=
"detail"
onClick=
{
onDetailClick
}
>
{
(
currentRightClickDir
.
level
===
1
)?
'栏目详情'
:
'目录详情'
}
</
RcItem
>
}
{
currentRightClickDir
&&
(
currentRightClickDir
.
type
!==
'custom'
)
&&
<
RcItem
id=
"edit"
onClick=
{
editDir
}
>
currentRightClickDir
&&
(
currentRightClickDir
.
type
!==
'custom'
)
&&
<
RcItem
id=
"edit"
onClick=
{
editDir
}
>
{
(
currentRightClickDir
.
level
===
1
)?
'修改栏目'
:
'修改目录'
}
{
(
currentRightClickDir
.
level
===
1
)?
'修改栏目'
:
'修改目录'
}
</
RcItem
>
</
RcItem
>
...
...
src/view/Manage/AssetManage/Component/AssetTable.jsx
View file @
ca6f37cf
...
@@ -1056,7 +1056,7 @@ const AssetTable = (props) => {
...
@@ -1056,7 +1056,7 @@ const AssetTable = (props) => {
LocalStorage
.
set
(
`templateType-${appId}`
,
val
);
LocalStorage
.
set
(
`templateType-${appId}`
,
val
);
setPagination
({
...
pagination
,
pageNum
:
1
});
setPagination
({
...
pagination
,
pageNum
:
1
});
}
}
}
}
style=
{
{
width
:
8
0
}
}
style=
{
{
width
:
8
5
}
}
>
>
{
{
(
templates
??[]).
map
((
item
,
index
)
=>
<
Select
.
Option
key=
{
index
}
value=
{
item
.
type
}
>
{
item
.
name
}
</
Select
.
Option
>)
(
templates
??[]).
map
((
item
,
index
)
=>
<
Select
.
Option
key=
{
index
}
value=
{
item
.
type
}
>
{
item
.
name
}
</
Select
.
Option
>)
...
...
src/view/Manage/AssetManage/Component/AssetTree.jsx
View file @
ca6f37cf
...
@@ -9,6 +9,7 @@ import CustomDirectoryModal from './CustomDirectoryModal';
...
@@ -9,6 +9,7 @@ import CustomDirectoryModal from './CustomDirectoryModal';
import
{
showMessage
,
getQueryParam
}
from
'../../../../util'
;
import
{
showMessage
,
getQueryParam
}
from
'../../../../util'
;
import
{
AnchorTimestamp
,
AnchorId
,
AssetBrowseReference
,
ResourceBrowseReference
,
AnchorDirId
}
from
'../../../../util/constant'
;
import
{
AnchorTimestamp
,
AnchorId
,
AssetBrowseReference
,
ResourceBrowseReference
,
AnchorDirId
}
from
'../../../../util/constant'
;
import
{
highlightSearchContentByTerms
}
from
'../../../../util'
;
import
{
highlightSearchContentByTerms
}
from
'../../../../util'
;
import
UpdateDirectoryModal
from
'./UpdateDirectoryModal'
;
import
'./AssetTree.less'
;
import
'./AssetTree.less'
;
import
'react-contexify/dist/ReactContexify.css'
;
import
'react-contexify/dist/ReactContexify.css'
;
...
@@ -58,6 +59,8 @@ const AssetTree = (props) => {
...
@@ -58,6 +59,8 @@ const AssetTree = (props) => {
const
[
loadingTemplates
,
setLoadingTemplates
]
=
useState
(
false
)
const
[
loadingTemplates
,
setLoadingTemplates
]
=
useState
(
false
)
const
[
templates
,
setTemplates
]
=
useState
()
const
[
templates
,
setTemplates
]
=
useState
()
const
[
currentTemplateType
,
setTemplateType
]
=
useState
()
const
[
currentTemplateType
,
setTemplateType
]
=
useState
()
const
[
updateDirectoryAction
,
setUpdateDirectoryAction
]
=
useState
(
''
);
const
[
updateDirectoryModalVisible
,
setUpdateDirectoryModalVisible
]
=
useState
(
false
);
const
[
modal
,
contextHolder
]
=
Modal
.
useModal
();
const
[
modal
,
contextHolder
]
=
Modal
.
useModal
();
...
@@ -482,8 +485,14 @@ const AssetTree = (props) => {
...
@@ -482,8 +485,14 @@ const AssetTree = (props) => {
}
}
}
}
const
onDetailClick
=
()
=>
{
setUpdateDirectoryAction
(
'detail'
);
setUpdateDirectoryModalVisible
(
true
);
}
const
displayMenu
=
(
e
)
=>
{
const
displayMenu
=
(
e
)
=>
{
show
(
e
,
{
show
({
event
:
e
,
position
:
{
position
:
{
x
:
e
.
clientX
+
30
,
x
:
e
.
clientX
+
30
,
y
:
e
.
clientY
-
10
y
:
e
.
clientY
-
10
...
@@ -591,7 +600,7 @@ const AssetTree = (props) => {
...
@@ -591,7 +600,7 @@ const AssetTree = (props) => {
getAllDirectoryAsTree
(
false
)
getAllDirectoryAsTree
(
false
)
},
100
)
},
100
)
}
}
}
}
style=
{
{
width
:
65
}
}
style=
{
{
width
:
80
}
}
>
>
{
{
(
templates
??[]).
map
((
item
,
index
)
=>
<
Select
.
Option
key=
{
index
}
value=
{
item
.
type
}
>
{
item
.
name
}
</
Select
.
Option
>)
(
templates
??[]).
map
((
item
,
index
)
=>
<
Select
.
Option
key=
{
index
}
value=
{
item
.
type
}
>
{
item
.
name
}
</
Select
.
Option
>)
...
@@ -647,14 +656,22 @@ const AssetTree = (props) => {
...
@@ -647,14 +656,22 @@ const AssetTree = (props) => {
onSelect=
{
onTreeSelect
}
onSelect=
{
onTreeSelect
}
checkStrictly
checkStrictly
onRightClick=
{
({
event
,
node
})
=>
{
onRightClick=
{
({
event
,
node
})
=>
{
if
(
node
.
level
>
1
&&
node
.
type
===
'custom'
)
{
setCurrentRightClickDir
(
node
);
setCurrentRightClickDir
(
node
);
displayMenu
(
event
);
displayMenu
(
event
);
}
}
}
}
}
/>
/>
</
Spin
>
</
Spin
>
<
UpdateDirectoryModal
visible=
{
updateDirectoryModalVisible
}
onCancel=
{
()
=>
{
setUpdateDirectoryAction
()
setUpdateDirectoryModalVisible
(
false
)
}
}
action=
{
updateDirectoryAction
}
dirId=
{
currentRightClickDir
?.
nodeId
}
/>
<
CustomDirectoryModal
<
CustomDirectoryModal
visible=
{
customDirectoryModalVisible
}
visible=
{
customDirectoryModalVisible
}
onCancel=
{
onCustomDirectoryCancel
}
onCancel=
{
onCustomDirectoryCancel
}
...
@@ -665,18 +682,8 @@ const AssetTree = (props) => {
...
@@ -665,18 +682,8 @@ const AssetTree = (props) => {
{
{
<
RcMenu
id=
{
MENU_ID
}
>
<
RcMenu
id=
{
MENU_ID
}
>
{
{
currentRightClickDir
&&
currentRightClickDir
.
level
>
1
&&
currentRightClickDir
.
type
===
'custom'
&&
<
RcItem
id=
"up"
onClick=
{
()
=>
{
moveNode
(
1
);
}
}
>
currentRightClickDir
&&
(
currentRightClickDir
.
type
!==
'custom'
)
&&
<
RcItem
id=
"detail"
onClick=
{
onDetailClick
}
>
上移目录
{
(
currentRightClickDir
.
level
===
1
)?
'栏目详情'
:
'目录详情'
}
</
RcItem
>
}
{
currentRightClickDir
&&
currentRightClickDir
.
level
>
1
&&
currentRightClickDir
.
type
===
'custom'
&&
<
RcItem
id=
"up"
onClick=
{
()
=>
{
moveNode
(
-
1
);
}
}
>
下移目录
</
RcItem
>
}
{
currentRightClickDir
&&
currentRightClickDir
.
level
===
2
&&
currentRightClickDir
.
type
===
'custom'
&&
!
currentRightClickDir
.
adminCreate
&&
<
RcItem
id=
"up"
onClick=
{
deleteDir
}
>
删除目录
</
RcItem
>
</
RcItem
>
}
}
</
RcMenu
>
</
RcMenu
>
...
...
src/view/Manage/AssetManage/Component/UpdateDirectoryModal.jsx
View file @
ca6f37cf
import
React
,
{
useEffect
,
useState
,
useMemo
}
from
'react'
;
import
React
,
{
useEffect
,
useState
,
useMemo
}
from
'react'
;
import
{
Modal
,
Form
,
Input
,
Space
,
Button
,
Radio
,
Select
}
from
'antd'
;
import
{
Modal
,
Form
,
Input
,
Space
,
Button
,
Radio
,
Select
,
Spin
}
from
'antd'
;
import
{
dispatch
}
from
'../../../../model'
;
import
{
dispatch
}
from
'../../../../model'
;
import
{
showMessage
}
from
'../../../../util'
;
import
{
showMessage
}
from
'../../../../util'
;
...
@@ -34,26 +34,16 @@ const UpdateDirectoryModal = (props) => {
...
@@ -34,26 +34,16 @@ const UpdateDirectoryModal = (props) => {
const
{
visible
,
onCancel
,
dirId
,
action
}
=
props
;
const
{
visible
,
onCancel
,
dirId
,
action
}
=
props
;
const
[
loading
,
setLoading
]
=
useState
(
false
);
const
[
form
]
=
Form
.
useForm
();
const
[
form
]
=
Form
.
useForm
();
const
[
dir
,
setDir
]
=
useState
(
null
);
const
[
dir
,
setDir
]
=
useState
(
null
);
const
[
confirmLoading
,
setConfirmLoading
]
=
useState
(
false
);
const
[
confirmLoading
,
setConfirmLoading
]
=
useState
(
false
);
const
[
isThemeAdd
,
setIsThemeAdd
]
=
useState
(
false
);
const
[
isThemeAdd
,
setIsThemeAdd
]
=
useState
(
false
);
useEffect
(()
=>
{
useEffect
(()
=>
{
if
(
visible
&&
dirId
)
{
if
(
visible
)
{
setDir
(
null
);
form
.
resetFields
();
if
(
action
===
'add'
)
{
form
.
setFieldsValue
({
resourceType
:
'dataAsset'
});
}
if
((
dirId
||
''
)
!==
''
)
{
getDirectory
();
getDirectory
();
}
}
}
//eslint-disable-next-line react-hooks/exhaustive-deps
//eslint-disable-next-line react-hooks/exhaustive-deps
},
[
visible
])
},
[
visible
])
...
@@ -69,19 +59,27 @@ const UpdateDirectoryModal = (props) => {
...
@@ -69,19 +59,27 @@ const UpdateDirectoryModal = (props) => {
return
false
;
return
false
;
},
[
action
,
dir
,
isThemeAdd
])
},
[
action
,
dir
,
isThemeAdd
])
const
marginBottom
=
useMemo
(()
=>
{
return
(
action
===
'detail'
)
?
5
:
15
},
[
action
])
const
getDirectory
=
()
=>
{
const
getDirectory
=
()
=>
{
set
Dir
(
null
);
set
Loading
(
true
);
dispatch
({
dispatch
({
type
:
'assetmanage.getDirectoryById'
,
type
:
'assetmanage.getDirectoryById'
,
payload
:
{
payload
:
{
dirId
dirId
},
},
callback
:
data
=>
{
callback
:
data
=>
{
setLoading
(
false
);
setDir
(
data
);
setDir
(
data
);
if
(
action
!==
'add'
)
{
if
(
action
!==
'add'
)
{
form
.
setFieldsValue
({
code
:
data
?.
code
,
name
:
data
?.
name
||
''
,
desc
:
data
?.
desc
||
''
,
remarks
:
data
?.
remarks
||
''
});
form
.
setFieldsValue
({
code
:
data
?.
code
,
name
:
data
?.
name
||
''
,
desc
:
data
?.
desc
||
''
,
remarks
:
data
?.
remarks
||
''
});
}
}
},
error
:
()
=>
{
setLoading
(
false
);
}
}
})
})
}
}
...
@@ -154,8 +152,9 @@ const UpdateDirectoryModal = (props) => {
...
@@ -154,8 +152,9 @@ const UpdateDirectoryModal = (props) => {
const
reset
=
()
=>
{
const
reset
=
()
=>
{
setIsThemeAdd
(
false
);
setIsThemeAdd
(
false
);
setDir
(
undefined
);
setLoading
(
false
);
form
.
resetFields
();
setConfirmLoading
(
false
);
setDir
();
}
}
const
onReset
=
()
=>
{
const
onReset
=
()
=>
{
...
@@ -198,8 +197,8 @@ const UpdateDirectoryModal = (props) => {
...
@@ -198,8 +197,8 @@ const UpdateDirectoryModal = (props) => {
return
(
return
(
<
Modal
<
Modal
forceRender
destroyOnClose
title=
{
'资产目录的目录信息'
}
title=
'资产目录的目录信息'
visible=
{
visible
}
visible=
{
visible
}
width=
{
600
}
width=
{
600
}
onCancel=
{
()
=>
{
onCancel=
{
()
=>
{
...
@@ -207,7 +206,7 @@ const UpdateDirectoryModal = (props) => {
...
@@ -207,7 +206,7 @@ const UpdateDirectoryModal = (props) => {
onCancel
&&
onCancel
();
onCancel
&&
onCancel
();
}
}
}
}
footer=
{
footer=
{
<
Space
>
(
action
===
'detail'
)
?
null
:
<
Space
>
<
Button
type=
"primary"
onClick=
{
onOk
}
loading=
{
confirmLoading
}
>
提交
</
Button
>
<
Button
type=
"primary"
onClick=
{
onOk
}
loading=
{
confirmLoading
}
>
提交
</
Button
>
<
Button
onClick=
{
onReset
}
>
重置
</
Button
>
<
Button
onClick=
{
onReset
}
>
重置
</
Button
>
<
Button
onClick=
{
()
=>
{
<
Button
onClick=
{
()
=>
{
...
@@ -217,12 +216,14 @@ const UpdateDirectoryModal = (props) => {
...
@@ -217,12 +216,14 @@ const UpdateDirectoryModal = (props) => {
</
Space
>
</
Space
>
}
}
>
>
<
Spin
spinning=
{
loading
}
>
<
Form
{
...
formItemLayout
}
form=
{
form
}
onValuesChange=
{
onValuesChange
}
>
<
Form
{
...
formItemLayout
}
form=
{
form
}
onValuesChange=
{
onValuesChange
}
>
{
{
action
===
'add'
&&
<
Form
.
Item
action
===
'add'
&&
<
Form
.
Item
label=
"类型"
label=
"类型"
name=
"type"
name=
"type"
rules=
{
[{
required
:
true
,
message
:
'必填项'
}]
}
rules=
{
[{
required
:
true
,
message
:
'必填项'
}]
}
style=
{
{
marginBottom
}
}
>
>
<
Radio
.
Group
>
<
Radio
.
Group
>
<
Radio
value=
'theme'
>
栏目
</
Radio
>
<
Radio
value=
'theme'
>
栏目
</
Radio
>
...
@@ -235,40 +236,54 @@ const UpdateDirectoryModal = (props) => {
...
@@ -235,40 +236,54 @@ const UpdateDirectoryModal = (props) => {
label=
"编号"
label=
"编号"
name=
"code"
name=
"code"
rules=
{
[{
required
:
true
,
message
:
'必填项'
}]
}
rules=
{
[{
required
:
true
,
message
:
'必填项'
}]
}
style=
{
{
marginBottom
}
}
>
>
<
CodeInput
restrict=
{
codeRestrict
}
action=
{
action
}
/>
{
(
action
===
'detail'
)
?
<
span
>
{
dir
?.
code
}
</
span
>
:
<
CodeInput
restrict=
{
codeRestrict
}
action=
{
action
}
/>
}
</
Form
.
Item
>
</
Form
.
Item
>
}
}
<
Form
.
Item
<
Form
.
Item
label=
"名称"
label=
"名称"
name=
"name"
name=
"name"
rules=
{
[{
required
:
true
,
message
:
'必填项'
}]
}
rules=
{
[{
required
:
true
,
message
:
'必填项'
}]
}
style=
{
{
marginBottom
}
}
>
>
<
Input
placeholder=
"请输入名称"
/>
{
(
action
===
'detail'
)
?
<
span
>
{
dir
?.
name
}
</
span
>
:
<
Input
placeholder=
"请输入名称"
/>
}
</
Form
.
Item
>
</
Form
.
Item
>
{
{
action
!==
'add'
&&
(
action
!==
'add'
&&
(
<
Form
.
Item
<
Form
.
Item
label=
"路径"
label=
"路径"
name=
"path"
name=
"path"
style=
{
{
marginBottom
}
}
>
>
<
span
>
{
dir
?
(
dir
.
path
||
''
):
''
}
</
span
>
<
span
>
{
dir
?.
path
}
</
span
>
</
Form
.
Item
>
</
Form
.
Item
>
)
)
}
}
<
Form
.
Item
<
Form
.
Item
label=
"描述"
label=
"描述"
name=
"desc"
name=
"desc"
style=
{
{
marginBottom
}
}
>
>
<
Input
.
TextArea
placeholder=
"请输入描述"
autoSize=
{
{
minRows
:
4
,
maxRows
:
4
}
}
/>
{
(
action
===
'detail'
)
?
<
span
>
{
dir
?.
desc
}
</
span
>
:
<
Input
.
TextArea
placeholder=
"请输入描述"
autoSize=
{
{
minRows
:
4
,
maxRows
:
4
}
}
/>
}
</
Form
.
Item
>
</
Form
.
Item
>
<
Form
.
Item
<
Form
.
Item
label=
"备注"
label=
"备注"
name=
"remarks"
name=
"remarks"
style=
{
{
marginBottom
}
}
>
>
<
Input
.
TextArea
placeholder=
"请输入备注"
autoSize=
{
{
minRows
:
4
,
maxRows
:
4
}
}
/>
{
(
action
===
'detail'
)
?
<
span
>
{
dir
?.
remarks
}
</
span
>
:
<
Input
.
TextArea
placeholder=
"请输入备注"
autoSize=
{
{
minRows
:
4
,
maxRows
:
4
}
}
/>
}
</
Form
.
Item
>
</
Form
.
Item
>
</
Form
>
</
Form
>
</
Spin
>
</
Modal
>
</
Modal
>
);
);
}
}
...
...
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