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
286628d1
authored
Mar 23, 2025
by
YunaiV
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
【代码优化】BPM:流程模型->基本信息->谁可以发起,支持指定多个部门
parent
c3ad1ec3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
24 additions
and
14 deletions
+24
-14
src/components/DeptSelectForm/index.vue
+5
-4
src/components/SimpleProcessDesignerV2/src/nodes-config/StartUserNodeConfig.vue
+13
-5
src/views/bpm/model/form/index.vue
+6
-5
No files found.
src/components/DeptSelectForm/index.vue
View file @
286628d1
...
@@ -59,7 +59,7 @@ const props = defineProps({
...
@@ -59,7 +59,7 @@ const props = defineProps({
const
treeRef
=
ref
()
const
treeRef
=
ref
()
const
deptTree
=
ref
<
Tree
[]
>
([])
// 部门树形结构
const
deptTree
=
ref
<
Tree
[]
>
([])
// 部门树形结构
const
selectedDeptIds
=
ref
<
number
[]
>
([])
// 选中的部门
ID
列表
const
selectedDeptIds
=
ref
<
number
[]
>
([])
// 选中的部门
ID
列表
const
dialogVisible
=
ref
(
false
)
// 弹窗的是否展示
const
dialogVisible
=
ref
(
false
)
// 弹窗的是否展示
const
formLoading
=
ref
(
false
)
// 表单的加载中
const
formLoading
=
ref
(
false
)
// 表单的加载中
...
@@ -78,7 +78,9 @@ const open = async (selectedList?: DeptApi.DeptVO[]) => {
...
@@ -78,7 +78,9 @@ const open = async (selectedList?: DeptApi.DeptVO[]) => {
// 设置已选择的部门
// 设置已选择的部门
if
(
selectedList
?.
length
)
{
if
(
selectedList
?.
length
)
{
await
nextTick
()
await
nextTick
()
const
selectedIds
=
selectedList
.
map
(
dept
=>
dept
.
id
).
filter
((
id
):
id
is
number
=>
id
!==
undefined
)
const
selectedIds
=
selectedList
.
map
((
dept
)
=>
dept
.
id
)
.
filter
((
id
):
id
is
number
=>
id
!==
undefined
)
selectedDeptIds
.
value
=
selectedIds
selectedDeptIds
.
value
=
selectedIds
treeRef
.
value
?.
setCheckedKeys
(
selectedIds
)
treeRef
.
value
?.
setCheckedKeys
(
selectedIds
)
}
}
...
@@ -117,4 +119,4 @@ const resetForm = () => {
...
@@ -117,4 +119,4 @@ const resetForm = () => {
}
}
defineExpose
({
open
})
// 提供 open 方法,用于打开弹窗
defineExpose
({
open
})
// 提供 open 方法,用于打开弹窗
</
script
>
</
script
>
\ No newline at end of file
src/components/SimpleProcessDesignerV2/src/nodes-config/StartUserNodeConfig.vue
View file @
286628d1
...
@@ -25,7 +25,14 @@
...
@@ -25,7 +25,14 @@
</
template
>
</
template
>
<el-tabs
type=
"border-card"
v-model=
"activeTabName"
>
<el-tabs
type=
"border-card"
v-model=
"activeTabName"
>
<el-tab-pane
label=
"权限"
name=
"user"
>
<el-tab-pane
label=
"权限"
name=
"user"
>
<el-text
v-if=
"(!startUserIds || startUserIds.length === 0) && (!startDeptIds || startDeptIds.length === 0)"
>
全部成员可以发起流程
</el-text>
<el-text
v-if=
"
(!startUserIds || startUserIds.length === 0) &&
(!startDeptIds || startDeptIds.length === 0)
"
>
全部成员可以发起流程
</el-text>
<div
v-else-if=
"startUserIds && startUserIds.length > 0"
>
<div
v-else-if=
"startUserIds && startUserIds.length > 0"
>
<el-text
v-if=
"startUserIds.length == 1"
>
<el-text
v-if=
"startUserIds.length == 1"
>
{{ getUserNicknames(startUserIds) }} 可发起流程
{{ getUserNicknames(startUserIds) }} 可发起流程
...
@@ -37,7 +44,8 @@
...
@@ -37,7 +44,8 @@
placement=
"top"
placement=
"top"
:content=
"getUserNicknames(startUserIds)"
:content=
"getUserNicknames(startUserIds)"
>
>
{{ getUserNicknames(startUserIds.slice(0,2)) }} 等 {{ startUserIds.length }} 人可发起流程
{{ getUserNicknames(startUserIds.slice(0, 2)) }} 等
{{ startUserIds.length }} 人可发起流程
</el-tooltip>
</el-tooltip>
</el-text>
</el-text>
</div>
</div>
...
@@ -52,11 +60,11 @@
...
@@ -52,11 +60,11 @@
placement=
"top"
placement=
"top"
:content=
"getDeptNames(startDeptIds)"
:content=
"getDeptNames(startDeptIds)"
>
>
{{ getDeptNames(startDeptIds.slice(0,2)) }} 等 {{ startDeptIds.length }} 个部门的人可发起流程
{{ getDeptNames(startDeptIds.slice(0, 2)) }} 等
{{ startDeptIds.length }} 个部门可发起流程
</el-tooltip>
</el-tooltip>
</el-text>
</el-text>
</div>
</div>
</el-tab-pane>
</el-tab-pane>
<el-tab-pane
label=
"表单字段权限"
name=
"fields"
v-if=
"formType === 10"
>
<el-tab-pane
label=
"表单字段权限"
name=
"fields"
v-if=
"formType === 10"
>
<div
class=
"field-setting-pane"
>
<div
class=
"field-setting-pane"
>
...
@@ -170,7 +178,7 @@ const getUserNicknames = (userIds: number[]): string => {
...
@@ -170,7 +178,7 @@ const getUserNicknames = (userIds: number[]): string => {
const
getDeptNames
=
(
deptIds
:
number
[]):
string
=>
{
const
getDeptNames
=
(
deptIds
:
number
[]):
string
=>
{
if
(
!
deptIds
||
deptIds
.
length
===
0
)
{
if
(
!
deptIds
||
deptIds
.
length
===
0
)
{
return
''
return
''
}
}
const
deptNames
:
string
[]
=
[]
const
deptNames
:
string
[]
=
[]
deptIds
.
forEach
((
deptId
)
=>
{
deptIds
.
forEach
((
deptId
)
=>
{
const
found
=
deptOptions
?.
value
.
find
((
item
)
=>
item
.
id
===
deptId
)
const
found
=
deptOptions
?.
value
.
find
((
item
)
=>
item
.
id
===
deptId
)
...
...
src/views/bpm/model/form/index.vue
View file @
286628d1
...
@@ -94,7 +94,6 @@ import * as FormApi from '@/api/bpm/form'
...
@@ -94,7 +94,6 @@ import * as FormApi from '@/api/bpm/form'
import
{
CategoryApi
,
CategoryVO
}
from
'@/api/bpm/category'
import
{
CategoryApi
,
CategoryVO
}
from
'@/api/bpm/category'
import
*
as
UserApi
from
'@/api/system/user'
import
*
as
UserApi
from
'@/api/system/user'
import
*
as
DeptApi
from
'@/api/system/dept'
import
*
as
DeptApi
from
'@/api/system/dept'
import
{
useUserStoreWithOut
}
from
'@/store/modules/user'
import
*
as
DefinitionApi
from
'@/api/bpm/definition'
import
*
as
DefinitionApi
from
'@/api/bpm/definition'
import
{
BpmModelFormType
,
BpmModelType
,
BpmAutoApproveType
}
from
'@/utils/constants'
import
{
BpmModelFormType
,
BpmModelType
,
BpmAutoApproveType
}
from
'@/utils/constants'
import
BasicInfo
from
'./BasicInfo.vue'
import
BasicInfo
from
'./BasicInfo.vue'
...
@@ -205,14 +204,16 @@ const initData = async () => {
...
@@ -205,14 +204,16 @@ const initData = async () => {
data
.
simpleModel
=
JSON
.
parse
(
data
.
simpleModel
)
data
.
simpleModel
=
JSON
.
parse
(
data
.
simpleModel
)
}
}
formData
.
value
=
data
formData
.
value
=
data
formData
.
value
.
startUserType
=
formData
.
value
.
startUserIds
?.
length
>
0
?
1
:
formData
.
value
?.
startDeptIds
?.
length
>
0
?
2
:
0
formData
.
value
.
startUserType
=
formData
.
value
.
startUserIds
?.
length
>
0
?
1
:
formData
.
value
?.
startDeptIds
?.
length
>
0
?
2
:
0
}
else
if
([
'update'
,
'copy'
].
includes
(
actionType
))
{
}
else
if
([
'update'
,
'copy'
].
includes
(
actionType
))
{
// 情况二:修改场景/复制场景
// 情况二:修改场景/复制场景
const
modelId
=
route
.
params
.
id
as
string
const
modelId
=
route
.
params
.
id
as
string
formData
.
value
=
await
ModelApi
.
getModel
(
modelId
)
formData
.
value
=
await
ModelApi
.
getModel
(
modelId
)
formData
.
value
.
startUserType
=
formData
.
value
.
startUserIds
?.
length
>
0
?
1
:
formData
.
value
?.
startDeptIds
?.
length
>
0
?
2
:
0
formData
.
value
.
startUserType
=
formData
.
value
.
startUserIds
?.
length
>
0
?
1
:
formData
.
value
?.
startDeptIds
?.
length
>
0
?
2
:
0
// 复制场景
//
特殊:
复制场景
if
(
route
.
params
.
type
===
'copy'
)
{
if
(
route
.
params
.
type
===
'copy'
)
{
delete
formData
.
value
.
id
delete
formData
.
value
.
id
formData
.
value
.
name
+=
'副本'
formData
.
value
.
name
+=
'副本'
...
@@ -233,7 +234,7 @@ const initData = async () => {
...
@@ -233,7 +234,7 @@ const initData = async () => {
userList
.
value
=
await
UserApi
.
getSimpleUserList
()
userList
.
value
=
await
UserApi
.
getSimpleUserList
()
// 获取部门列表
// 获取部门列表
deptList
.
value
=
await
DeptApi
.
getSimpleDeptList
()
deptList
.
value
=
await
DeptApi
.
getSimpleDeptList
()
// 最终,设置 currentStep 切换到第一步
// 最终,设置 currentStep 切换到第一步
currentStep
.
value
=
0
currentStep
.
value
=
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