Skip to content
Toggle navigation
P
Projects
G
Groups
S
Snippets
Help
phsl
/
admin
This project
Loading...
Sign in
Toggle navigation
Go to a project
Project
Repository
Issues
0
Merge Requests
0
Pipelines
Wiki
Snippets
Members
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Commit
c9c03bed
authored
Jan 21, 2025
by
zws
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
perf: 模型列表 权限检查用computed 替代vue指令 减少检查次数
parent
d710c9d2
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
24 additions
and
7 deletions
+24
-7
src/views/bpm/model/CategoryDraggableModel.vue
+24
-7
No files found.
src/views/bpm/model/CategoryDraggableModel.vue
View file @
c9c03bed
...
@@ -158,7 +158,7 @@
...
@@ -158,7 +158,7 @@
link
link
type=
"primary"
type=
"primary"
@
click=
"openModelForm('update', scope.row.id)"
@
click=
"openModelForm('update', scope.row.id)"
v-
hasPermi=
"['bpm:model:update']
"
v-
if=
"hasPermiUpdate
"
:disabled=
"!isManagerUser(scope.row)"
:disabled=
"!isManagerUser(scope.row)"
>
>
修改
修改
...
@@ -167,7 +167,7 @@
...
@@ -167,7 +167,7 @@
link
link
type=
"primary"
type=
"primary"
@
click=
"openModelForm('copy', scope.row.id)"
@
click=
"openModelForm('copy', scope.row.id)"
v-
hasPermi=
"['bpm:model:update']
"
v-
if=
"hasPermiUpdate
"
:disabled=
"!isManagerUser(scope.row)"
:disabled=
"!isManagerUser(scope.row)"
>
>
复制
复制
...
@@ -177,7 +177,7 @@
...
@@ -177,7 +177,7 @@
class=
"!ml-5px"
class=
"!ml-5px"
type=
"primary"
type=
"primary"
@
click=
"handleDeploy(scope.row)"
@
click=
"handleDeploy(scope.row)"
v-
hasPermi=
"['bpm:model:deploy']
"
v-
if=
"hasPermiDeploy
"
:disabled=
"!isManagerUser(scope.row)"
:disabled=
"!isManagerUser(scope.row)"
>
>
发布
发布
...
@@ -185,20 +185,20 @@
...
@@ -185,20 +185,20 @@
<el-dropdown
<el-dropdown
class=
"!align-middle ml-5px"
class=
"!align-middle ml-5px"
@
command=
"(command) => handleModelCommand(command, scope.row)"
@
command=
"(command) => handleModelCommand(command, scope.row)"
v-
hasPermi=
"['bpm:process-definition:query', 'bpm:model:update', 'bpm:model:delete']
"
v-
if=
"hasPermiMore
"
>
>
<el-button
type=
"primary"
link
>
更多
</el-button>
<el-button
type=
"primary"
link
>
更多
</el-button>
<template
#
dropdown
>
<template
#
dropdown
>
<el-dropdown-menu>
<el-dropdown-menu>
<el-dropdown-item
<el-dropdown-item
command=
"handleDefinitionList"
command=
"handleDefinitionList"
v-if=
"
checkPermi(['bpm:process-definition:query'])
"
v-if=
"
hasPermiPdQuery
"
>
>
历史
历史
</el-dropdown-item>
</el-dropdown-item>
<el-dropdown-item
<el-dropdown-item
command=
"handleChangeState"
command=
"handleChangeState"
v-if=
"
checkPermi(['bpm:model:update'])
&& scope.row.processDefinition"
v-if=
"
hasPermiUpdate
&& scope.row.processDefinition"
:disabled=
"!isManagerUser(scope.row)"
:disabled=
"!isManagerUser(scope.row)"
>
>
{{
scope
.
row
.
processDefinition
.
suspensionState
===
1
?
'停用'
:
'启用'
}}
{{
scope
.
row
.
processDefinition
.
suspensionState
===
1
?
'停用'
:
'启用'
}}
...
@@ -206,7 +206,7 @@
...
@@ -206,7 +206,7 @@
<el-dropdown-item
<el-dropdown-item
type=
"danger"
type=
"danger"
command=
"handleDelete"
command=
"handleDelete"
v-if=
"
checkPermi(['bpm:model:delete'])
"
v-if=
"
hasPermiDelete
"
:disabled=
"!isManagerUser(scope.row)"
:disabled=
"!isManagerUser(scope.row)"
>
>
删除
删除
...
@@ -274,6 +274,23 @@ const originalData: any = ref([]) // 原始数据
...
@@ -274,6 +274,23 @@ const originalData: any = ref([]) // 原始数据
const
modelList
:
any
=
ref
([])
// 模型列表
const
modelList
:
any
=
ref
([])
// 模型列表
const
isExpand
=
ref
(
false
)
// 是否处于展开状态
const
isExpand
=
ref
(
false
)
// 是否处于展开状态
const
hasPermiUpdate
=
computed
(()
=>
{
return
checkPermi
([
'bpm:model:update'
])
})
const
hasPermiDelete
=
computed
(()
=>
{
return
checkPermi
([
'bpm:model:delete'
])
})
const
hasPermiDeploy
=
computed
(()
=>
{
return
checkPermi
([
'bpm:model:deploy'
])
})
const
hasPermiMore
=
computed
(()
=>
{
return
checkPermi
([
'bpm:process-definition:query'
,
'bpm:model:update'
,
'bpm:model:delete'
])
})
const
hasPermiPdQuery
=
computed
(()
=>
{
return
checkPermi
([
'bpm:process-definition:query'
])
})
/** '更多'操作按钮 */
/** '更多'操作按钮 */
const
handleModelCommand
=
(
command
:
string
,
row
:
any
)
=>
{
const
handleModelCommand
=
(
command
:
string
,
row
:
any
)
=>
{
switch
(
command
)
{
switch
(
command
)
{
...
...
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