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
fd13eb7f
authored
Aug 11, 2024
by
YunaiV
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
【代码评审】工作流:快搭部分的 code review
parent
5376eb40
Show whitespace changes
Inline
Side-by-side
Showing
8 changed files
with
45 additions
and
39 deletions
+45
-39
src/components/SimpleProcessDesigner/src/addNode.vue
+8
-8
src/components/SimpleProcessDesigner/src/drawer/approverDrawer.vue
+6
-6
src/components/SimpleProcessDesigner/src/drawer/copyerDrawer.vue
+14
-10
src/components/SimpleProcessDesignerV2/src/SimpleProcessDesigner.vue
+1
-1
src/components/SimpleProcessDesignerV2/src/consts.ts
+1
-1
src/main.ts
+2
-2
src/views/bpm/processInstance/detail/index.vue
+2
-0
src/views/bpm/simpleWorkflow/index.vue
+11
-11
No files found.
src/components/SimpleProcessDesigner/src/addNode.vue
View file @
fd13eb7f
...
@@ -67,10 +67,10 @@ let props = defineProps({
...
@@ -67,10 +67,10 @@ let props = defineProps({
type
:
Object
,
type
:
Object
,
default
:
()
=>
({})
default
:
()
=>
({})
},
},
showAddButton
:{
showAddButton
:
{
type
:
Boolean
,
type
:
Boolean
,
default
:
true
default
:
true
}
,
}
})
})
let
emits
=
defineEmits
([
'update:childNodeP'
])
let
emits
=
defineEmits
([
'update:childNodeP'
])
let
visible
=
ref
(
false
)
let
visible
=
ref
(
false
)
...
@@ -89,7 +89,7 @@ const addType = (type: number) => {
...
@@ -89,7 +89,7 @@ const addType = (type: number) => {
approveMethod
:
undefined
,
approveMethod
:
undefined
,
candidateStrategy
:
undefined
,
candidateStrategy
:
undefined
,
candidateParam
:
undefined
,
candidateParam
:
undefined
,
fieldsPermission
:
defaultFieldsPermission
,
fieldsPermission
:
defaultFieldsPermission
},
},
childNode
:
props
.
childNodeP
childNode
:
props
.
childNodeP
}
}
...
@@ -99,7 +99,7 @@ const addType = (type: number) => {
...
@@ -99,7 +99,7 @@ const addType = (type: number) => {
if
(
type
===
NodeType
.
CC_USER_NODE
)
{
if
(
type
===
NodeType
.
CC_USER_NODE
)
{
const
data
=
{
const
data
=
{
name
:
'抄送人'
,
name
:
'抄送人'
,
type
:
2
,
type
:
2
,
// TODO @jason:这个要不要搞成枚举?NodeType 里貌似有枚举
error
:
true
,
error
:
true
,
// 抄送节点配置
// 抄送节点配置
attributes
:
{
attributes
:
{
...
@@ -161,7 +161,7 @@ const addType = (type: number) => {
...
@@ -161,7 +161,7 @@ const addType = (type: number) => {
name
:
'并行分支_JOIN'
,
name
:
'并行分支_JOIN'
,
type
:
6
,
type
:
6
,
error
:
true
,
error
:
true
,
childNode
:
props
.
childNodeP
,
childNode
:
props
.
childNodeP
}
}
}
}
emits
(
'update:childNodeP'
,
data
)
emits
(
'update:childNodeP'
,
data
)
...
@@ -190,7 +190,7 @@ const addType = (type: number) => {
...
@@ -190,7 +190,7 @@ const addType = (type: number) => {
name
:
'包容分支_JOIN'
,
name
:
'包容分支_JOIN'
,
type
:
8
,
type
:
8
,
error
:
true
,
error
:
true
,
childNode
:
props
.
childNodeP
,
childNode
:
props
.
childNodeP
}
}
}
}
emits
(
'update:childNodeP'
,
data
)
emits
(
'update:childNodeP'
,
data
)
...
...
src/components/SimpleProcessDesigner/src/drawer/approverDrawer.vue
View file @
fd13eb7f
...
@@ -162,7 +162,7 @@
...
@@ -162,7 +162,7 @@
</el-form>
</el-form>
</div>
</div>
</el-tab-pane>
</el-tab-pane>
<el-tab-pane
label=
"设置字段权限"
v-if
=
"formType === 10"
>
<el-tab-pane
label=
"设置字段权限"
v-if=
"formType === 10"
>
<div
class=
"field-setting-pane h-full w-full flex flex-col"
>
<div
class=
"field-setting-pane h-full w-full flex flex-col"
>
<div
class=
"field-setting-content mr-2 overflow-auto py-4 pr-2"
>
<div
class=
"field-setting-content mr-2 overflow-auto py-4 pr-2"
>
<div
class=
"field-container flex flex-col flex-items-start"
>
<div
class=
"field-container flex flex-col flex-items-start"
>
...
@@ -324,12 +324,12 @@ const changecandidateStrategy = () => {
...
@@ -324,12 +324,12 @@ const changecandidateStrategy = () => {
candidateConfig
.
value
.
candidateParam
=
[]
candidateConfig
.
value
.
candidateParam
=
[]
}
}
const
handleAllCheck
=
(
event
,
type
)
=>
{
const
handleAllCheck
=
(
event
,
type
)
=>
{
console
.
log
(
'event'
,
event
)
;
console
.
log
(
'event'
,
event
)
console
.
log
(
'type'
,
type
)
;
console
.
log
(
'type'
,
type
)
event
.
target
.
checked
=
true
;
event
.
target
.
checked
=
true
let
permission
=
'1'
let
permission
=
'1'
if
(
type
===
'edit'
&&
editAllChecked
.
value
)
{
if
(
type
===
'edit'
&&
editAllChecked
.
value
)
{
permission
=
'1'
permission
=
'1'
// TODO @jaosn:这个要不要用枚举里的哈
}
}
if
(
type
===
'read'
&&
readAllChecked
.
value
)
{
if
(
type
===
'read'
&&
readAllChecked
.
value
)
{
permission
=
'2'
permission
=
'2'
...
@@ -344,7 +344,7 @@ const handleAllCheck = (event, type) => {
...
@@ -344,7 +344,7 @@ const handleAllCheck = (event, type) => {
onMounted
(
async
()
=>
{
onMounted
(
async
()
=>
{
// 获得角色列表
// 获得角色列表
roleOptions
.
value
=
await
RoleApi
.
getSimpleRoleList
()
roleOptions
.
value
=
await
RoleApi
.
getSimpleRoleList
()
// 获得岗位列表
postOptions
.
value
=
await
PostApi
.
getSimplePostList
()
postOptions
.
value
=
await
PostApi
.
getSimplePostList
()
// 获得用户列表
// 获得用户列表
userOptions
.
value
=
await
UserApi
.
getSimpleUserList
()
userOptions
.
value
=
await
UserApi
.
getSimpleUserList
()
...
...
src/components/SimpleProcessDesigner/src/drawer/copyerDrawer.vue
View file @
fd13eb7f
...
@@ -12,7 +12,12 @@
...
@@ -12,7 +12,12 @@
<div>
<div>
<el-form
label-position=
"top"
label-width=
"100px"
>
<el-form
label-position=
"top"
label-width=
"100px"
>
<el-form-item
label=
"选择抄送人"
prop=
"candidateStrategy"
>
<el-form-item
label=
"选择抄送人"
prop=
"candidateStrategy"
>
<el-select
v-model=
"candidateConfig.candidateStrategy"
style=
"width: 100%"
clearable
@
change=
"changecandidateStrategy"
>
<el-select
v-model=
"candidateConfig.candidateStrategy"
style=
"width: 100%"
clearable
@
change=
"changecandidateStrategy"
>
<el-option
<el-option
v-for=
"dict in getIntDictOptions(DICT_TYPE.BPM_TASK_CANDIDATE_STRATEGY)"
v-for=
"dict in getIntDictOptions(DICT_TYPE.BPM_TASK_CANDIDATE_STRATEGY)"
:key=
"dict.value"
:key=
"dict.value"
...
@@ -160,7 +165,7 @@ const deptTreeOptions = ref() // 部门树
...
@@ -160,7 +165,7 @@ const deptTreeOptions = ref() // 部门树
const
userGroupOptions
=
ref
<
UserGroupApi
.
UserGroupVO
[]
>
([])
// 用户组列表
const
userGroupOptions
=
ref
<
UserGroupApi
.
UserGroupVO
[]
>
([])
// 用户组列表
const
candidateConfig
=
ref
({
const
candidateConfig
=
ref
({
candidateStrategy
:
undefined
,
candidateStrategy
:
undefined
,
candidateParam
:
[]
,
candidateParam
:
[]
})
})
const
store
=
useWorkFlowStoreWithOut
()
const
store
=
useWorkFlowStoreWithOut
()
const
{
setCopyerDrawer
,
setCopyerConfig
}
=
store
const
{
setCopyerDrawer
,
setCopyerConfig
}
=
store
...
@@ -178,13 +183,13 @@ const visible = computed({
...
@@ -178,13 +183,13 @@ const visible = computed({
})
})
watch
(
copyerConfig
,
(
val
)
=>
{
watch
(
copyerConfig
,
(
val
)
=>
{
if
(
val
.
value
.
attributes
)
{
if
(
val
.
value
.
attributes
)
{
console
.
log
(
'val.value.attributes'
,
val
.
value
.
attributes
)
;
console
.
log
(
'val.value.attributes'
,
val
.
value
.
attributes
)
candidateConfig
.
value
.
candidateStrategy
=
val
.
value
.
attributes
.
candidateStrategy
candidateConfig
.
value
.
candidateStrategy
=
val
.
value
.
attributes
.
candidateStrategy
const
candidateParamStr
=
val
.
value
.
attributes
.
candidateParam
;
const
candidateParamStr
=
val
.
value
.
attributes
.
candidateParam
if
(
val
.
value
.
attributes
.
candidateStrategy
===
60
)
{
if
(
val
.
value
.
attributes
.
candidateStrategy
===
60
)
{
candidateConfig
.
value
.
candidateParam
=
[
candidateParamStr
]
candidateConfig
.
value
.
candidateParam
=
[
candidateParamStr
]
}
else
{
}
else
{
if
(
candidateParamStr
)
{
if
(
candidateParamStr
)
{
candidateConfig
.
value
.
candidateParam
=
candidateParamStr
.
split
(
','
).
map
((
item
)
=>
+
item
)
candidateConfig
.
value
.
candidateParam
=
candidateParamStr
.
split
(
','
).
map
((
item
)
=>
+
item
)
}
}
}
}
...
@@ -193,10 +198,9 @@ watch(copyerConfig, (val) => {
...
@@ -193,10 +198,9 @@ watch(copyerConfig, (val) => {
}
}
})
})
const
saveConfig
=
()
=>
{
const
saveConfig
=
()
=>
{
const
rawConfig
=
toRaw
(
copyerConfig
.
value
)
const
rawConfig
=
toRaw
(
copyerConfig
.
value
)
const
{
candidateStrategy
,
candidateParam
}
=
toRaw
(
candidateConfig
.
value
);
const
{
candidateStrategy
,
candidateParam
}
=
toRaw
(
candidateConfig
.
value
)
const
candidateParamStr
=
candidateParam
.
join
(
','
)
const
candidateParamStr
=
candidateParam
.
join
(
','
)
rawConfig
.
value
.
attributes
=
{
rawConfig
.
value
.
attributes
=
{
candidateStrategy
,
candidateStrategy
,
...
@@ -213,7 +217,7 @@ const saveConfig = () => {
...
@@ -213,7 +217,7 @@ const saveConfig = () => {
setCopyerConfig
({
setCopyerConfig
({
value
:
rawConfig
.
value
,
value
:
rawConfig
.
value
,
flag
:
true
,
flag
:
true
,
id
:
copyerConfig
.
value
.
id
,
id
:
copyerConfig
.
value
.
id
})
})
console
.
log
(
'after is copyerConfig'
,
copyerConfig
.
value
)
console
.
log
(
'after is copyerConfig'
,
copyerConfig
.
value
)
closeDrawer
()
closeDrawer
()
...
@@ -228,7 +232,7 @@ const changecandidateStrategy = () => {
...
@@ -228,7 +232,7 @@ const changecandidateStrategy = () => {
onMounted
(
async
()
=>
{
onMounted
(
async
()
=>
{
// 获得角色列表
// 获得角色列表
roleOptions
.
value
=
await
RoleApi
.
getSimpleRoleList
()
roleOptions
.
value
=
await
RoleApi
.
getSimpleRoleList
()
// 获得岗位列表
postOptions
.
value
=
await
PostApi
.
getSimplePostList
()
postOptions
.
value
=
await
PostApi
.
getSimplePostList
()
// 获得用户列表
// 获得用户列表
userOptions
.
value
=
await
UserApi
.
getSimpleUserList
()
userOptions
.
value
=
await
UserApi
.
getSimpleUserList
()
...
...
src/components/SimpleProcessDesignerV2/src/SimpleProcessDesigner.vue
View file @
fd13eb7f
...
@@ -146,7 +146,7 @@ onMounted(async () => {
...
@@ -146,7 +146,7 @@ onMounted(async () => {
processNodeTree
.
value
=
{
processNodeTree
.
value
=
{
name
:
'开始'
,
name
:
'开始'
,
type
:
NodeType
.
START_EVENT_NODE
,
type
:
NodeType
.
START_EVENT_NODE
,
id
:
'StartEvent_1'
,
id
:
'StartEvent_1'
,
// TODO @jason:这个我们要不要 StartEvent 哈?
childNode
:
{
childNode
:
{
id
:
'EndEvent_1'
,
id
:
'EndEvent_1'
,
name
:
'结束'
,
name
:
'结束'
,
...
...
src/components/SimpleProcessDesignerV2/src/consts.ts
View file @
fd13eb7f
...
@@ -213,7 +213,7 @@ export type ButtonSetting = {
...
@@ -213,7 +213,7 @@ export type ButtonSetting = {
enable
:
boolean
enable
:
boolean
}
}
// 操作按钮类型枚举 (用于审批节点)
// 操作按钮类型枚举 (用于审批节点)
// TODO @jason:建议不缩写哈
export
enum
OpsButtonType
{
export
enum
OpsButtonType
{
/**
/**
* 通过
* 通过
...
...
src/main.ts
View file @
fd13eb7f
...
@@ -28,7 +28,7 @@ import '@/plugins/animate.css'
...
@@ -28,7 +28,7 @@ import '@/plugins/animate.css'
// 路由
// 路由
import
router
,
{
setupRouter
}
from
'@/router'
import
router
,
{
setupRouter
}
from
'@/router'
//
其它指令
//
指令
import
{
setupAuth
,
setupMountedFocus
}
from
'@/directives'
import
{
setupAuth
,
setupMountedFocus
}
from
'@/directives'
import
{
createApp
}
from
'vue'
import
{
createApp
}
from
'vue'
...
@@ -58,8 +58,8 @@ const setupAll = async () => {
...
@@ -58,8 +58,8 @@ const setupAll = async () => {
setupRouter
(
app
)
setupRouter
(
app
)
// directives 指令
setupAuth
(
app
)
setupAuth
(
app
)
setupMountedFocus
(
app
)
setupMountedFocus
(
app
)
await
router
.
isReady
()
await
router
.
isReady
()
...
...
src/views/bpm/processInstance/detail/index.vue
View file @
fd13eb7f
...
@@ -56,12 +56,14 @@
...
@@ -56,12 +56,14 @@
</el-form-item>
</el-form-item>
</el-form>
</el-form>
<div
style=
"margin-bottom: 20px; margin-left: 10%; font-size: 14px"
>
<div
style=
"margin-bottom: 20px; margin-left: 10%; font-size: 14px"
>
<!-- TODO @jason:建议搞个 if 来判断,替代现有的 !item.buttonsSetting || item.buttonsSetting[OpsButtonType.APPROVE]?.enable -->
<el-button
<el-button
type=
"success"
type=
"success"
v-if=
"!item.buttonsSetting || item.buttonsSetting[OpsButtonType.APPROVE]?.enable"
v-if=
"!item.buttonsSetting || item.buttonsSetting[OpsButtonType.APPROVE]?.enable"
@
click=
"handleAudit(item, true)"
@
click=
"handleAudit(item, true)"
>
>
<Icon
icon=
"ep:select"
/>
<Icon
icon=
"ep:select"
/>
<!-- TODO @jason:这个也是类似哈,搞个方法来生成名字 -->
{{
{{
item.buttonsSetting?.[OpsButtonType.APPROVE]?.displayName ||
item.buttonsSetting?.[OpsButtonType.APPROVE]?.displayName ||
OPERATION_BUTTON_NAME.get(OpsButtonType.APPROVE)
OPERATION_BUTTON_NAME.get(OpsButtonType.APPROVE)
...
...
src/views/bpm/simpleWorkflow/index.vue
View file @
fd13eb7f
<
template
>
<
template
>
<SimpleProcessDesigner
:model-id=
"modelId"
/>
<SimpleProcessDesigner
:model-id=
"modelId"
/>
</
template
>
</
template
>
<
script
setup
lang=
'ts'
>
<
script
setup
lang=
"ts"
>
import
{
SimpleProcessDesigner
}
from
'@/components/SimpleProcessDesignerV2/src/'
;
import
{
SimpleProcessDesigner
}
from
'@/components/SimpleProcessDesignerV2/src/'
import
{
getModel
}
from
'@/api/bpm/model'
import
{
getModel
}
from
'@/api/bpm/model'
import
{
getForm
,
FormVO
}
from
'@/api/bpm/form'
import
{
getForm
,
FormVO
}
from
'@/api/bpm/form'
import
{
handleTree
}
from
'@/utils/tree'
import
{
handleTree
}
from
'@/utils/tree'
...
@@ -15,9 +15,9 @@ defineOptions({
...
@@ -15,9 +15,9 @@ defineOptions({
name
:
'SimpleWorkflowDesignEditor'
name
:
'SimpleWorkflowDesignEditor'
})
})
const
{
query
}
=
useRoute
()
// 路由的查询
const
{
query
}
=
useRoute
()
// 路由的查询
const
modelId
:
string
|
undefined
=
query
.
modelId
as
string
;
const
modelId
:
string
|
undefined
=
query
.
modelId
as
string
const
formFields
=
ref
<
string
[]
>
([])
const
formFields
=
ref
<
string
[]
>
([])
const
formType
=
ref
(
20
)
;
const
formType
=
ref
(
20
)
const
roleOptions
=
ref
<
RoleApi
.
RoleVO
[]
>
([])
// 角色列表
const
roleOptions
=
ref
<
RoleApi
.
RoleVO
[]
>
([])
// 角色列表
const
postOptions
=
ref
<
PostApi
.
PostVO
[]
>
([])
// 岗位列表
const
postOptions
=
ref
<
PostApi
.
PostVO
[]
>
([])
// 岗位列表
const
userOptions
=
ref
<
UserApi
.
UserVO
[]
>
([])
// 用户列表
const
userOptions
=
ref
<
UserApi
.
UserVO
[]
>
([])
// 用户列表
...
@@ -32,28 +32,28 @@ provide('userList', userOptions)
...
@@ -32,28 +32,28 @@ provide('userList', userOptions)
provide
(
'deptList'
,
deptOptions
)
provide
(
'deptList'
,
deptOptions
)
provide
(
'userGroupList'
,
userGroupOptions
)
provide
(
'userGroupList'
,
userGroupOptions
)
provide
(
'deptTree'
,
deptTreeOptions
)
provide
(
'deptTree'
,
deptTreeOptions
)
onMounted
(
async
()
=>
{
onMounted
(
async
()
=>
{
const
bpmnModel
=
await
getModel
(
modelId
)
;
const
bpmnModel
=
await
getModel
(
modelId
)
if
(
bpmnModel
)
{
if
(
bpmnModel
)
{
formType
.
value
=
bpmnModel
.
formType
formType
.
value
=
bpmnModel
.
formType
if
(
formType
.
value
===
10
)
{
if
(
formType
.
value
===
10
)
{
const
bpmnForm
=
await
getForm
(
bpmnModel
.
formId
)
as
unknown
as
FormVO
const
bpmnForm
=
(
await
getForm
(
bpmnModel
.
formId
)
)
as
unknown
as
FormVO
formFields
.
value
=
bpmnForm
?.
fields
formFields
.
value
=
bpmnForm
?.
fields
}
}
}
}
// 获得角色列表
// 获得角色列表
roleOptions
.
value
=
await
RoleApi
.
getSimpleRoleList
()
roleOptions
.
value
=
await
RoleApi
.
getSimpleRoleList
()
// 获得岗位列表
postOptions
.
value
=
await
PostApi
.
getSimplePostList
()
postOptions
.
value
=
await
PostApi
.
getSimplePostList
()
// 获得用户列表
// 获得用户列表
userOptions
.
value
=
await
UserApi
.
getSimpleUserList
()
userOptions
.
value
=
await
UserApi
.
getSimpleUserList
()
// 获得部门列表
// 获得部门列表
deptOptions
.
value
=
await
DeptApi
.
getSimpleDeptList
()
deptOptions
.
value
=
await
DeptApi
.
getSimpleDeptList
()
deptTreeOptions
.
value
=
handleTree
(
deptOptions
.
value
as
DeptApi
.
DeptVO
[],
'id'
);
deptTreeOptions
.
value
=
handleTree
(
deptOptions
.
value
as
DeptApi
.
DeptVO
[],
'id'
)
// 用户组列表
// 用户组列表
userGroupOptions
.
value
=
await
UserGroupApi
.
getUserGroupSimpleList
()
userGroupOptions
.
value
=
await
UserGroupApi
.
getUserGroupSimpleList
()
})
})
</
script
>
</
script
>
<
style
lang=
'scss'
scoped
>
<
style
lang=
"scss"
scoped
></
style
>
</
style
>
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