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
8ff4fcd1
Commit
8ff4fcd1
authored
Mar 17, 2022
by
zhaochengxiang
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
自定义目录下 不允许新增资产
parent
d07efa08
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
20 additions
and
23 deletions
+20
-23
craco.config.js
craco.config.js
+1
-1
AssetTable.jsx
src/view/Manage/AssetManage/Component/AssetTable.jsx
+5
-5
AssetTree.jsx
src/view/Manage/AssetManage/Component/AssetTree.jsx
+14
-17
No files found.
craco.config.js
View file @
8ff4fcd1
...
...
@@ -20,7 +20,7 @@ module.exports = {
'@ant-prefix'
:
'yy'
,
// '@border-color-split': 'hsv(0, 0, 85%)',
'@border-radius-base'
:
'4px'
,
'@primary-color'
:
'#
0069AC
'
,
'@primary-color'
:
'#
196AD2
'
,
'@success-color'
:
'#8FC31F'
,
'@warning-color'
:
'#F7AB00'
,
'@error-color'
:
'#E94848'
,
...
...
src/view/Manage/AssetManage/Component/AssetTable.jsx
View file @
8ff4fcd1
...
...
@@ -509,7 +509,7 @@ const AssetTable = (props) => {
const
moreMenu
=
(
<
Menu
>
{
(
reference
===
AssetManageReference
)
&&
<
Menu
.
Item
>
(
reference
===
AssetManageReference
&&
nodeType
!==
'custom'
)
&&
<
Menu
.
Item
>
<
div
className=
'text-center'
onClick=
{
importAsset
}
>
导入
</
div
>
...
...
@@ -529,7 +529,7 @@ const AssetTable = (props) => {
</
div
>
</
Menu
.
Item
>
{
//自定义目录下的资产不允许删除
//自定义目录下的资产不允许
新增
删除
(
nodeType
!==
'custom'
)
&&
<
Menu
.
Item
disabled=
{
(
checkedKeys
||
[]).
length
===
0
}
>
<
div
className=
'text-center'
onClick=
{
deleteAssets
}
>
删除
...
...
@@ -580,14 +580,14 @@ const AssetTable = (props) => {
>
<
Space
size=
{
15
}
>
{
(
reference
===
AssetManageReference
)
&&
<
Button
onClick=
{
addAsset
}
>
新增
</
Button
>
(
reference
===
AssetManageReference
&&
nodeType
!==
'custom'
)
&&
<
Button
onClick=
{
addAsset
}
>
新增
</
Button
>
}
{
(
compact
&&
reference
===
AssetManageReference
)
?
<
Dropdown
overlay=
{
moreMenu
}
placement=
"bottomCenter"
>
<
Button
>
其他操作
</
Button
>
</
Dropdown
>
:
<
React
.
Fragment
>
{
(
reference
===
AssetManageReference
)
&&
<
Button
onClick=
{
importAsset
}
>
导入
</
Button
>
(
reference
===
AssetManageReference
&&
nodeType
!==
'custom'
)
&&
<
Button
onClick=
{
importAsset
}
>
导入
</
Button
>
}
{
(
reference
===
AssetManageReference
||
reference
===
AssetRecycleReference
)
&&
<
React
.
Fragment
>
...
...
@@ -599,7 +599,7 @@ const AssetTable = (props) => {
</
Tooltip
>
{
//自定义目录下的资产不允许删除
nodeType
!==
'custom'
&&
<
Tooltip
title=
{
(
checkedKeys
||
[]).
length
===
0
?
'请先选择资产'
:
''
}
>
(
nodeType
!==
'custom'
)
&&
<
Tooltip
title=
{
(
checkedKeys
||
[]).
length
===
0
?
'请先选择资产'
:
''
}
>
<
Button
onClick=
{
deleteAssets
}
disabled=
{
(
checkedKeys
||
[]).
length
===
0
}
>
删除
</
Button
>
</
Tooltip
>
}
...
...
src/view/Manage/AssetManage/Component/AssetTree.jsx
View file @
8ff4fcd1
...
...
@@ -305,27 +305,24 @@ const AssetTree = (props) => {
return
parentKey
;
};
const
getCurrentType
=
(
key
,
tree
,
root
=
true
)
=>
{
let
type
;
for
(
let
i
=
0
;
i
<
tree
.
length
;
i
++
)
{
const
node
=
tree
[
i
];
const
getCurrentType
=
(
key
,
tree
)
=>
{
let
type
=
''
;
(
tree
||
[]).
forEach
(
node
=>
{
if
(
node
.
nodeId
===
key
)
{
type
=
node
.
type
||
''
;
if
(
type
===
'custom'
)
{
type
+=
(
root
?
'-root'
:
''
);
}
type
=
node
.
type
||
''
;
}
else
if
(
node
.
children
)
{
if
(
getCurrentType
(
key
,
node
.
children
,
false
))
{
type
=
getCurrentType
(
key
,
node
.
children
,
false
);
if
(
getCurrentType
(
key
,
node
.
children
))
{
type
=
getCurrentType
(
key
,
node
.
children
);
}
}
}
})
return
type
;
}
const
addDir
=
()
=>
{
if
(
currentDirType
===
'custom
-root'
||
currentDirType
===
'custom
'
)
return
;
if
(
currentDirType
===
'custom'
)
return
;
setUpdateDirectoryAction
(
'add'
);
setUpdateDirectoryModalVisible
(
true
);
...
...
@@ -338,7 +335,7 @@ const AssetTree = (props) => {
setUpdateDirectoryAction
(
'edit'
);
setUpdateDirectoryModalVisible
(
true
);
}
else
if
(
currentDirType
===
'custom
-root'
||
currentDirType
===
'custom
'
)
{
}
else
if
(
currentDirType
===
'custom'
)
{
setCustomDirectoryAction
(
'edit'
);
setCustomDirectoryModalVisible
(
true
);
...
...
@@ -351,7 +348,7 @@ const AssetTree = (props) => {
}
const
importDir
=
()
=>
{
if
(
currentDirType
===
'custom
-root'
||
currentDirType
===
'custom
'
)
return
;
if
(
currentDirType
===
'custom'
)
return
;
setImportDirectoryVisible
(
true
);
}
...
...
@@ -595,13 +592,13 @@ const AssetTree = (props) => {
}
}
>
<
Tooltip
title=
"新增目录"
>
<
PlusOutlined
className=
{
(
currentDirType
===
'custom
-root'
||
currentDirType
===
'custom'
)?
'disable'
:
'default'
}
onClick=
{
addDir
}
style=
{
{
fontSize
:
16
,
cursor
:
(
currentDirType
===
'custom-root'
||
currentDirType
===
'custom'
)?
'not-allowed'
:
'pointer'
}
}
/>
<
PlusOutlined
className=
{
(
currentDirType
===
'custom
'
)?
'disable'
:
'default'
}
onClick=
{
addDir
}
style=
{
{
fontSize
:
16
,
cursor
:
(
currentDirType
===
'custom'
)?
'not-allowed'
:
'pointer'
}
}
/>
</
Tooltip
>
<
Tooltip
title=
"刷新目录"
>
<
ReloadOutlined
className=
'default'
onClick=
{
refreshTree
}
style=
{
{
fontSize
:
16
,
cursor
:
'pointer'
}
}
/>
</
Tooltip
>
<
Tooltip
title=
"导入目录"
>
<
ImportOutlined
className=
{
(
currentDirType
===
'custom
-root'
||
currentDirType
===
'custom'
)?
'#disable'
:
'default'
}
onClick=
{
importDir
}
style=
{
{
fontSize
:
16
,
cursor
:(
currentDirType
===
'custom-root'
||
currentDirType
===
'custom'
)?
'not-allowed'
:
'pointer'
}
}
/>
<
ImportOutlined
className=
{
(
currentDirType
===
'custom
'
)?
'disable'
:
'default'
}
onClick=
{
importDir
}
style=
{
{
fontSize
:
16
,
cursor
:(
currentDirType
===
'custom'
)?
'not-allowed'
:
'pointer'
}
}
/>
</
Tooltip
>
<
Dropdown
overlay=
{
exportMenu
}
placement=
"bottomCenter"
>
<
Tooltip
title=
"导出目录"
>
...
...
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