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
0867498b
Commit
0867498b
authored
Oct 23, 2023
by
zhaochengxiang
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
资源权限
parent
7b5fd0d3
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
25 additions
and
13 deletions
+25
-13
table.jsx
src/view/Manage/AssetResourceManage/table.jsx
+25
-13
No files found.
src/view/Manage/AssetResourceManage/table.jsx
View file @
0867498b
...
...
@@ -35,6 +35,8 @@ const operationMap = {
addAsAsset
:
'新增为资产'
,
distribute
:
'分配'
,
reDistribute
:
'转分配'
,
autoDistribute
:
'自动分配'
,
batchEdit
:
'批量编辑'
,
check
:
'复核'
,
changeToNotAsset
:
'转为非资产'
,
changeToUncombed
:
'转为未梳理'
,
...
...
@@ -223,8 +225,8 @@ const FC = (props) => {
}
},
[
data
])
const
[
addAble
,
addAsAssetAble
,
distributeAble
,
checkAble
,
importAble
,
exportAble
,
changeDirectoryAble
,
deleteAble
]
=
React
.
useMemo
(()
=>
{
let
[
_addAble
,
_addAsAssetAble
,
_distributeAble
,
_
checkAble
,
_importAble
,
_exportAble
,
_changeDiretoryAble
,
_deleteAble
]
=
[
false
,
false
,
false
,
false
,
false
,
false
,
false
,
false
]
const
[
addAble
,
addAsAssetAble
,
distributeAble
,
autoDistributeAble
,
batchEditAble
,
checkAble
,
importAble
,
exportAble
,
changeDirectoryAble
,
deleteAble
]
=
React
.
useMemo
(()
=>
{
let
[
_addAble
,
_addAsAssetAble
,
_distributeAble
,
_
autoDistributeAble
,
_batchEditAble
,
_checkAble
,
_importAble
,
_exportAble
,
_changeDiretoryAble
,
_deleteAble
]
=
[
false
,
false
,
false
,
false
,
false
,
false
,
false
,
false
,
false
,
false
]
_addAble
=
(
permissions
??[]).
findIndex
(
item
=>
item
===
'add'
)
!==
-
1
...
...
@@ -248,10 +250,12 @@ const FC = (props) => {
_exportAble
=
allowExport
}
let
[
allowAddAsAsset
,
allowDistribute
,
allow
Check
,
allowChangeDirectory
,
allowDelete
]
=
[
true
,
true
,
true
,
true
,
true
]
let
[
allowAddAsAsset
,
allowDistribute
,
allow
AutoDistribute
,
allowBatchEdit
,
allowCheck
,
allowChangeDirectory
,
allowDelete
]
=
[
true
,
true
,
true
,
true
,
true
,
true
,
true
]
for
(
const
row
of
selectedRows
)
{
const
addAsAssetIndex
=
(
row
.
allowButtons
??[]).
findIndex
(
item
=>
item
===
'addAsAsset'
)
const
distributeIndex
=
(
row
.
allowButtons
??[]).
findIndex
(
item
=>
item
===
'distribute'
)
const
autoDistributeIndex
=
(
row
.
allowButtons
??[]).
findIndex
(
item
=>
item
===
'autoDistribute'
)
const
batchEditIndex
=
(
row
.
allowButtons
??[]).
findIndex
(
item
=>
item
===
'batchEdit'
)
const
checkIndex
=
(
row
.
allowButtons
??[]).
findIndex
(
item
=>
item
===
'check'
)
const
changeDirecotoryIndex
=
(
row
.
allowButtons
??[]).
findIndex
(
item
=>
item
===
'changeDir'
)
const
deleteIndex
=
(
row
.
allowButtons
??[]).
findIndex
(
item
=>
item
===
'delete'
)
...
...
@@ -261,6 +265,12 @@ const FC = (props) => {
if
(
distributeIndex
===
-
1
)
{
allowDistribute
=
false
}
if
(
autoDistributeIndex
===
-
1
)
{
allowAutoDistribute
=
false
}
if
(
batchEditIndex
===
-
1
)
{
allowBatchEdit
=
false
}
if
(
checkIndex
===
-
1
)
{
allowCheck
=
false
}
...
...
@@ -274,11 +284,13 @@ const FC = (props) => {
_addAsAssetAble
=
allowAddAsAsset
_distributeAble
=
allowDistribute
_autoDistributeAble
=
allowAutoDistribute
_batchEditAble
=
allowBatchEdit
_checkAble
=
allowCheck
_changeDiretoryAble
=
allowChangeDirectory
_deleteAble
=
allowDelete
return
[
_addAble
,
_addAsAssetAble
,
_distributeAble
,
_checkAble
,
_importAble
,
_exportAble
,
_changeDiretoryAble
,
_deleteAble
]
return
[
_addAble
,
_addAsAssetAble
,
_distributeAble
,
_
autoDistributeAble
,
_batchEditAble
,
_
checkAble
,
_importAble
,
_exportAble
,
_changeDiretoryAble
,
_deleteAble
]
},
[
permissions
,
selectedRows
])
const
menuData
=
React
.
useMemo
(()
=>
{
...
...
@@ -619,7 +631,7 @@ const FC = (props) => {
})
}
const
on
TaskAutoAllocation
Click
=
()
=>
{
const
on
AutoDistributeTask
Click
=
()
=>
{
}
...
...
@@ -859,8 +871,8 @@ const FC = (props) => {
onAddToAssetClick()
} else if (key === 'distribute') {
onDistributeTaskClick()
} else if (key === '
taskAutoAllocation
') {
on
TaskAutoAllocation
Click()
} else if (key === '
autoDistribute
') {
on
AutoDistributeTask
Click()
} else if (key === 'batchEdit') {
onBatchEditClick()
}else if (key === 'check') {
...
...
@@ -923,8 +935,8 @@ const FC = (props) => {
</div>
</PermissionMenuItem>
<PermissionMenuItem
key='
taskAutoAllocation
'
defaultPermission={
tru
e}
key='
autoDistribute
'
defaultPermission={
autoDistributeAbl
e}
disabled={(selectedRows??[]).length===0}
tip={(selectedRows??[]).length===0?'请先选择资源':''}
>
...
...
@@ -934,7 +946,7 @@ const FC = (props) => {
</PermissionMenuItem>
<PermissionMenuItem
key='batchEdit'
defaultPermission={
tru
e}
defaultPermission={
batchEditAbl
e}
disabled={(selectedRows??[]).length===0}
tip={(selectedRows??[]).length===0?'请先选择资源':''}
>
...
...
@@ -1038,15 +1050,15 @@ const FC = (props) => {
任务分配
</PermissionButton>
<PermissionButton
defaultPermission={
tru
e}
onClick={on
TaskAutoAllocation
Click}
defaultPermission={
autoDistributeAbl
e}
onClick={on
AutoDistributeTask
Click}
disabled={(selectedRows??[]).length===0}
tip={(selectedRows??[]).length===0?'请先选择资源':''}
>
自动分配
</PermissionButton>
<PermissionButton
defaultPermission={
tru
e}
defaultPermission={
batchEditAbl
e}
onClick={onBatchEditClick}
disabled={(selectedRows??[]).length===0}
tip={(selectedRows??[]).length===0?'请先选择资源':''}
...
...
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