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
e3db7d30
authored
Jan 24, 2025
by
jason
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'feature/bpm' of
https://gitee.com/yudaocode/yudao-ui-admin-vue3
into feature/bpm
parents
b7329b0c
a61a4053
Show whitespace changes
Inline
Side-by-side
Showing
10 changed files
with
210 additions
and
69 deletions
+210
-69
src/components/SimpleProcessDesignerV2/src/node.ts
+5
-4
src/components/SimpleProcessDesignerV2/src/nodes/DelayTimerNode.vue
+0
-1
src/components/bpmnProcessDesigner/package/penal/multi-instance/ElementMultiInstance.vue
+10
-1
src/views/bpm/model/CategoryDraggableModel.vue
+94
-41
src/views/bpm/model/form/ExtraSettings.vue
+68
-21
src/views/bpm/model/form/index.vue
+5
-1
src/views/bpm/processInstance/index.vue
+9
-0
src/views/bpm/task/copy/index.vue
+1
-0
src/views/bpm/task/done/index.vue
+9
-0
src/views/bpm/task/todo/index.vue
+9
-0
No files found.
src/components/SimpleProcessDesignerV2/src/node.ts
View file @
e3db7d30
...
@@ -16,7 +16,8 @@ import {
...
@@ -16,7 +16,8 @@ import {
FieldPermissionType
,
FieldPermissionType
,
ListenerParam
ListenerParam
}
from
'./consts'
}
from
'./consts'
import
{
parseFormFields
}
from
'@/components/FormCreate/src/utils/index'
import
{
parseFormFields
}
from
'@/components/FormCreate/src/utils'
export
function
useWatchNode
(
props
:
{
flowNode
:
SimpleFlowNode
}):
Ref
<
SimpleFlowNode
>
{
export
function
useWatchNode
(
props
:
{
flowNode
:
SimpleFlowNode
}):
Ref
<
SimpleFlowNode
>
{
const
node
=
ref
<
SimpleFlowNode
>
(
props
.
flowNode
)
const
node
=
ref
<
SimpleFlowNode
>
(
props
.
flowNode
)
watch
(
watch
(
...
@@ -46,7 +47,7 @@ export function useFormFieldsPermission(defaultPermission: FieldPermissionType)
...
@@ -46,7 +47,7 @@ export function useFormFieldsPermission(defaultPermission: FieldPermissionType)
// 字段权限配置. 需要有 field, title, permissioin 属性
// 字段权限配置. 需要有 field, title, permissioin 属性
const
fieldsPermissionConfig
=
ref
<
Array
<
Record
<
string
,
any
>>>
([])
const
fieldsPermissionConfig
=
ref
<
Array
<
Record
<
string
,
any
>>>
([])
const
formType
=
inject
<
Ref
<
number
|
undefined
>>
(
'formType'
,
ref
())
// 表单类型
const
formType
=
inject
<
Ref
<
number
|
undefined
>>
(
'formType'
,
ref
())
// 表单类型
const
formFields
=
inject
<
Ref
<
string
[]
>>
(
'formFields'
,
ref
([]))
// 流程表单字段
const
formFields
=
inject
<
Ref
<
string
[]
>>
(
'formFields'
,
ref
([]))
// 流程表单字段
...
@@ -108,7 +109,7 @@ export function useFormFieldsPermission(defaultPermission: FieldPermissionType)
...
@@ -108,7 +109,7 @@ export function useFormFieldsPermission(defaultPermission: FieldPermissionType)
* @description 获取表单的字段
* @description 获取表单的字段
*/
*/
export
function
useFormFields
()
{
export
function
useFormFields
()
{
const
formFields
=
inject
<
Ref
<
string
[]
>>
(
'formFields'
,
ref
([]))
// 流程表单字段
const
formFields
=
inject
<
Ref
<
string
[]
>>
(
'formFields'
,
ref
([]))
// 流程表单字段
return
parseFormCreateFields
(
unref
(
formFields
))
return
parseFormCreateFields
(
unref
(
formFields
))
}
}
...
@@ -178,7 +179,7 @@ export function useNodeForm(nodeType: NodeType) {
...
@@ -178,7 +179,7 @@ export function useNodeForm(nodeType: NodeType) {
const
postOptions
=
inject
<
Ref
<
PostApi
.
PostVO
[]
>>
(
'postList'
,
ref
([]))
// 岗位列表
const
postOptions
=
inject
<
Ref
<
PostApi
.
PostVO
[]
>>
(
'postList'
,
ref
([]))
// 岗位列表
const
userOptions
=
inject
<
Ref
<
UserApi
.
UserVO
[]
>>
(
'userList'
,
ref
([]))
// 用户列表
const
userOptions
=
inject
<
Ref
<
UserApi
.
UserVO
[]
>>
(
'userList'
,
ref
([]))
// 用户列表
const
deptOptions
=
inject
<
Ref
<
DeptApi
.
DeptVO
[]
>>
(
'deptList'
,
ref
([]))
// 部门列表
const
deptOptions
=
inject
<
Ref
<
DeptApi
.
DeptVO
[]
>>
(
'deptList'
,
ref
([]))
// 部门列表
const
userGroupOptions
=
inject
<
Ref
<
UserGroupApi
.
UserGroupVO
[]
>>
(
'userGroupList'
,
ref
([]))
// 用户组列表
const
userGroupOptions
=
inject
<
Ref
<
UserGroupApi
.
UserGroupVO
[]
>>
(
'userGroupList'
,
ref
([]))
// 用户组列表
const
deptTreeOptions
=
inject
(
'deptTree'
,
ref
())
// 部门树
const
deptTreeOptions
=
inject
(
'deptTree'
,
ref
())
// 部门树
const
formFields
=
inject
<
Ref
<
string
[]
>>
(
'formFields'
,
ref
([]))
// 流程表单字段
const
formFields
=
inject
<
Ref
<
string
[]
>>
(
'formFields'
,
ref
([]))
// 流程表单字段
const
configForm
=
ref
<
UserTaskFormType
|
CopyTaskFormType
>
()
const
configForm
=
ref
<
UserTaskFormType
|
CopyTaskFormType
>
()
...
...
src/components/SimpleProcessDesignerV2/src/nodes/DelayTimerNode.vue
View file @
e3db7d30
...
@@ -9,7 +9,6 @@
...
@@ -9,7 +9,6 @@
]"
]"
>
>
<div
class=
"node-title-container"
>
<div
class=
"node-title-container"
>
<!-- TODO @芋艿 需要更换图标 -->
<div
class=
"node-title-icon delay-node"
><span
class=
"iconfont icon-delay"
></span></div>
<div
class=
"node-title-icon delay-node"
><span
class=
"iconfont icon-delay"
></span></div>
<input
<input
v-if=
"!readonly && showInput"
v-if=
"!readonly && showInput"
...
...
src/components/bpmnProcessDesigner/package/penal/multi-instance/ElementMultiInstance.vue
View file @
e3db7d30
<
template
>
<
template
>
<div
class=
"panel-tab__content"
>
<div
class=
"panel-tab__content"
>
<el-radio-group
v-model=
"approveMethod"
@
change=
"onApproveMethodChange"
>
<el-radio-group
v-if=
"type === 'UserTask'"
v-model=
"approveMethod"
@
change=
"onApproveMethodChange"
>
<div
class=
"flex-col"
>
<div
class=
"flex-col"
>
<div
v-for=
"(item, index) in APPROVE_METHODS"
:key=
"index"
>
<div
v-for=
"(item, index) in APPROVE_METHODS"
:key=
"index"
>
<el-radio
:value=
"item.value"
:label=
"item.value"
>
<el-radio
:value=
"item.value"
:label=
"item.value"
>
...
@@ -23,6 +27,9 @@
...
@@ -23,6 +27,9 @@
</div>
</div>
</div>
</div>
</el-radio-group>
</el-radio-group>
<div
v-else
>
除了UserTask以外节点的多实例待实现
</div>
<!-- 与Simple设计器配置合并,保留以前的代码 -->
<!-- 与Simple设计器配置合并,保留以前的代码 -->
<el-form
label-width=
"90px"
style=
"display: none"
>
<el-form
label-width=
"90px"
style=
"display: none"
>
<el-form-item
label=
"快捷配置"
>
<el-form-item
label=
"快捷配置"
>
...
@@ -301,6 +308,7 @@ const approveMethod = ref()
...
@@ -301,6 +308,7 @@ const approveMethod = ref()
const
approveRatio
=
ref
(
100
)
const
approveRatio
=
ref
(
100
)
const
otherExtensions
=
ref
()
const
otherExtensions
=
ref
()
const
getElementLoopNew
=
()
=>
{
const
getElementLoopNew
=
()
=>
{
if
(
props
.
type
===
'UserTask'
)
{
const
extensionElements
=
const
extensionElements
=
bpmnElement
.
value
.
businessObject
?.
extensionElements
??
bpmnElement
.
value
.
businessObject
?.
extensionElements
??
bpmnInstances
().
moddle
.
create
(
'bpmn:ExtensionElements'
,
{
values
:
[]
})
bpmnInstances
().
moddle
.
create
(
'bpmn:ExtensionElements'
,
{
values
:
[]
})
...
@@ -315,6 +323,7 @@ const getElementLoopNew = () => {
...
@@ -315,6 +323,7 @@ const getElementLoopNew = () => {
approveMethod
.
value
=
ApproveMethodType
.
SEQUENTIAL_APPROVE
approveMethod
.
value
=
ApproveMethodType
.
SEQUENTIAL_APPROVE
updateLoopCharacteristics
()
updateLoopCharacteristics
()
}
}
}
}
}
const
onApproveMethodChange
=
()
=>
{
const
onApproveMethodChange
=
()
=>
{
approveRatio
.
value
=
100
approveRatio
.
value
=
100
...
...
src/views/bpm/model/CategoryDraggableModel.vue
View file @
e3db7d30
<
template
>
<
template
>
<div
class=
"flex items-center h-50px"
>
<div
class=
"flex items-center h-50px"
v-memo=
"[categoryInfo.name, isCategorySorting]"
>
<!-- 头部:分类名 -->
<!-- 头部:分类名 -->
<div
class=
"flex items-center"
>
<div
class=
"flex items-center"
>
<el-tooltip
content=
"拖动排序"
v-if=
"isCategorySorting"
>
<el-tooltip
content=
"拖动排序"
v-if=
"isCategorySorting"
>
...
@@ -13,7 +13,7 @@
...
@@ -13,7 +13,7 @@
<div
class=
"color-gray-600 text-16px"
>
(
{{
categoryInfo
.
modelList
?.
length
||
0
}}
)
</div>
<div
class=
"color-gray-600 text-16px"
>
(
{{
categoryInfo
.
modelList
?.
length
||
0
}}
)
</div>
</div>
</div>
<!-- 头部:操作 -->
<!-- 头部:操作 -->
<div
class=
"flex-1 flex"
v-
if
=
"!isCategorySorting"
>
<div
class=
"flex-1 flex"
v-
show
=
"!isCategorySorting"
>
<div
<div
v-if=
"categoryInfo.modelList.length > 0"
v-if=
"categoryInfo.modelList.length > 0"
class=
"ml-20px flex items-center"
class=
"ml-20px flex items-center"
...
@@ -69,16 +69,17 @@
...
@@ -69,16 +69,17 @@
<el-collapse-transition>
<el-collapse-transition>
<div
v-show=
"isExpand"
>
<div
v-show=
"isExpand"
>
<el-table
<el-table
v-if=
"modelList && modelList.length > 0"
:class=
"categoryInfo.name"
:class=
"categoryInfo.name"
ref=
"tableRef"
ref=
"tableRef"
:header-cell-style=
"{ backgroundColor: isDark ? '' : '#edeff0', paddingLeft: '10px' }"
:cell-style=
"{ paddingLeft: '10px' }"
:row-style=
"{ height: '68px' }"
:data=
"modelList"
:data=
"modelList"
row-key=
"id"
row-key=
"id"
:header-cell-style=
"tableHeaderStyle"
:cell-style=
"tableCellStyle"
:row-style=
"{ height: '68px' }"
>
>
<el-table-column
label=
"流程名"
prop=
"name"
min-width=
"150"
>
<el-table-column
label=
"流程名"
prop=
"name"
min-width=
"150"
>
<
template
#
default=
"
scope
"
>
<
template
#
default=
"
{ row }
"
>
<div
class=
"flex items-center"
>
<div
class=
"flex items-center"
>
<el-tooltip
content=
"拖动排序"
v-if=
"isModelSorting"
>
<el-tooltip
content=
"拖动排序"
v-if=
"isModelSorting"
>
<Icon
<Icon
...
@@ -86,27 +87,25 @@
...
@@ -86,27 +87,25 @@
class=
"drag-icon cursor-move text-#8a909c mr-10px"
class=
"drag-icon cursor-move text-#8a909c mr-10px"
/>
/>
</el-tooltip>
</el-tooltip>
<el-image
:src=
"scope.
row.icon"
class=
"h-38px w-38px mr-10px rounded"
/>
<el-image
v-if=
"row.icon"
:src=
"
row.icon"
class=
"h-38px w-38px mr-10px rounded"
/>
{{
scope
.
row
.
name
}}
{{
row
.
name
}}
</div>
</div>
</
template
>
</
template
>
</el-table-column>
</el-table-column>
<el-table-column
label=
"可见范围"
prop=
"startUserIds"
min-width=
"150"
>
<el-table-column
label=
"可见范围"
prop=
"startUserIds"
min-width=
"150"
>
<
template
#
default=
"scope"
>
<
template
#
default=
"{ row }"
>
<el-text
v-if=
"!scope.row.startUsers || scope.row.startUsers.length === 0"
>
<el-text
v-if=
"!row.startUsers?.length"
>
全部可见
</el-text>
全部可见
<el-text
v-else-if=
"row.startUsers.length === 1"
>
</el-text>
{{
row
.
startUsers
[
0
].
nickname
}}
<el-text
v-else-if=
"scope.row.startUsers.length == 1"
>
{{
scope
.
row
.
startUsers
[
0
].
nickname
}}
</el-text>
</el-text>
<el-text
v-else
>
<el-text
v-else
>
<el-tooltip
<el-tooltip
class=
"box-item"
class=
"box-item"
effect=
"dark"
effect=
"dark"
placement=
"top"
placement=
"top"
:content=
"
scope.
row.startUsers.map((user: any) => user.nickname).join('、')"
:content=
"row.startUsers.map((user: any) => user.nickname).join('、')"
>
>
{{
scope
.
row
.
startUsers
[
0
].
nickname
}}
等
{{
scope
.
row
.
startUsers
.
length
}}
人可见
{{
row
.
startUsers
[
0
].
nickname
}}
等
{{
row
.
startUsers
.
length
}}
人可见
</el-tooltip>
</el-tooltip>
</el-text>
</el-text>
</
template
>
</
template
>
...
@@ -245,7 +244,6 @@
...
@@ -245,7 +244,6 @@
<
script
lang=
"ts"
setup
>
<
script
lang=
"ts"
setup
>
import
{
CategoryApi
,
CategoryVO
}
from
'@/api/bpm/category'
import
{
CategoryApi
,
CategoryVO
}
from
'@/api/bpm/category'
import
Sortable
from
'sortablejs'
import
Sortable
from
'sortablejs'
import
{
propTypes
}
from
'@/utils/propTypes'
import
{
formatDate
}
from
'@/utils/formatTime'
import
{
formatDate
}
from
'@/utils/formatTime'
import
*
as
ModelApi
from
'@/api/bpm/model'
import
*
as
ModelApi
from
'@/api/bpm/model'
import
*
as
FormApi
from
'@/api/bpm/form'
import
*
as
FormApi
from
'@/api/bpm/form'
...
@@ -254,15 +252,49 @@ import { BpmModelFormType } from '@/utils/constants'
...
@@ -254,15 +252,49 @@ import { BpmModelFormType } from '@/utils/constants'
import
{
checkPermi
}
from
'@/utils/permission'
import
{
checkPermi
}
from
'@/utils/permission'
import
{
useUserStoreWithOut
}
from
'@/store/modules/user'
import
{
useUserStoreWithOut
}
from
'@/store/modules/user'
import
{
useAppStore
}
from
'@/store/modules/app'
import
{
useAppStore
}
from
'@/store/modules/app'
import
{
cloneDeep
}
from
'lodash-es'
import
{
cloneDeep
,
isEqual
}
from
'lodash-es'
import
{
useTagsView
}
from
'@/hooks/web/useTagsView'
import
{
useTagsView
}
from
'@/hooks/web/useTagsView'
import
{
useDebounceFn
}
from
'@vueuse/core'
defineOptions
({
name
:
'BpmModel'
})
defineOptions
({
name
:
'BpmModel'
})
const
props
=
defineProps
({
// 优化 Props 类型定义
categoryInfo
:
propTypes
.
object
.
def
([]),
// 分类后的数据
interface
UserInfo
{
isCategorySorting
:
propTypes
.
bool
.
def
(
false
)
// 是否分类在排序
nickname
:
string
})
[
key
:
string
]:
any
}
interface
ProcessDefinition
{
deploymentTime
:
string
version
:
number
suspensionState
:
number
}
interface
ModelInfo
{
id
:
number
name
:
string
icon
?:
string
startUsers
?:
UserInfo
[]
processDefinition
?:
ProcessDefinition
formType
?:
number
formId
?:
number
formName
?:
string
formCustomCreatePath
?:
string
managerUserIds
?:
number
[]
[
key
:
string
]:
any
}
interface
CategoryInfoProps
{
id
:
number
name
:
string
modelList
:
ModelInfo
[]
}
const
props
=
defineProps
<
{
categoryInfo
:
CategoryInfoProps
isCategorySorting
:
boolean
}
>
()
const
emit
=
defineEmits
([
'success'
])
const
emit
=
defineEmits
([
'success'
])
const
message
=
useMessage
()
// 消息弹窗
const
message
=
useMessage
()
// 消息弹窗
const
{
t
}
=
useI18n
()
// 国际化
const
{
t
}
=
useI18n
()
// 国际化
...
@@ -271,10 +303,20 @@ const userStore = useUserStoreWithOut() // 用户信息缓存
...
@@ -271,10 +303,20 @@ const userStore = useUserStoreWithOut() // 用户信息缓存
const
isDark
=
computed
(()
=>
useAppStore
().
getIsDark
)
// 是否黑暗模式
const
isDark
=
computed
(()
=>
useAppStore
().
getIsDark
)
// 是否黑暗模式
const
isModelSorting
=
ref
(
false
)
// 是否正处于排序状态
const
isModelSorting
=
ref
(
false
)
// 是否正处于排序状态
const
originalData
:
any
=
ref
([])
// 原始数据
const
originalData
=
ref
<
ModelInfo
[]
>
([])
// 原始数据
const
modelList
:
any
=
ref
([])
// 模型列表
const
modelList
=
ref
<
ModelInfo
[]
>
([])
// 模型列表
const
isExpand
=
ref
(
false
)
// 是否处于展开状态
const
isExpand
=
ref
(
false
)
// 是否处于展开状态
// 使用 computed 优化表格样式计算
const
tableHeaderStyle
=
computed
(()
=>
({
backgroundColor
:
isDark
.
value
?
''
:
'#edeff0'
,
paddingLeft
:
'10px'
}))
const
tableCellStyle
=
computed
(()
=>
({
paddingLeft
:
'10px'
}))
/** 权限校验:通过 computed 解决列表的卡顿问题 */
/** 权限校验:通过 computed 解决列表的卡顿问题 */
const
hasPermiUpdate
=
computed
(()
=>
{
const
hasPermiUpdate
=
computed
(()
=>
{
return
checkPermi
([
'bpm:model:update'
])
return
checkPermi
([
'bpm:model:update'
])
...
@@ -449,14 +491,15 @@ const handleModelSortCancel = () => {
...
@@ -449,14 +491,15 @@ const handleModelSortCancel = () => {
/** 创建拖拽实例 */
/** 创建拖拽实例 */
const
tableRef
=
ref
()
const
tableRef
=
ref
()
const
initSort
=
()
=>
{
const
initSort
=
useDebounceFn
(
()
=>
{
const
table
=
document
.
querySelector
(
`.
${
props
.
categoryInfo
.
name
}
.el-table__body-wrapper tbody`
)
const
table
=
document
.
querySelector
(
`.
${
props
.
categoryInfo
.
name
}
.el-table__body-wrapper tbody`
)
if
(
!
table
)
return
Sortable
.
create
(
table
,
{
Sortable
.
create
(
table
,
{
group
:
'shared'
,
group
:
'shared'
,
animation
:
150
,
animation
:
150
,
draggable
:
'.el-table__row'
,
draggable
:
'.el-table__row'
,
handle
:
'.drag-icon'
,
handle
:
'.drag-icon'
,
// 结束拖动事件
onEnd
:
({
newDraggableIndex
,
oldDraggableIndex
})
=>
{
onEnd
:
({
newDraggableIndex
,
oldDraggableIndex
})
=>
{
if
(
oldDraggableIndex
!==
newDraggableIndex
)
{
if
(
oldDraggableIndex
!==
newDraggableIndex
)
{
modelList
.
value
.
splice
(
modelList
.
value
.
splice
(
...
@@ -467,15 +510,18 @@ const initSort = () => {
...
@@ -467,15 +510,18 @@ const initSort = () => {
}
}
}
}
})
})
}
}
,
200
)
/** 更新 modelList 模型列表 */
/** 更新 modelList 模型列表 */
const
updateModeList
=
()
=>
{
const
updateModeList
=
useDebounceFn
(()
=>
{
modelList
.
value
=
cloneDeep
(
props
.
categoryInfo
.
modelList
)
const
newModelList
=
props
.
categoryInfo
.
modelList
if
(
props
.
categoryInfo
.
modelList
.
length
>
0
)
{
if
(
!
isEqual
(
modelList
.
value
,
newModelList
))
{
modelList
.
value
=
cloneDeep
(
newModelList
)
if
(
newModelList
?.
length
>
0
)
{
isExpand
.
value
=
true
isExpand
.
value
=
true
}
}
}
}
},
100
)
/** 重命名弹窗确定 */
/** 重命名弹窗确定 */
const
renameCategoryVisible
=
ref
(
false
)
const
renameCategoryVisible
=
ref
(
false
)
...
@@ -526,14 +572,15 @@ const openModelForm = async (type: string, id?: number) => {
...
@@ -526,14 +572,15 @@ const openModelForm = async (type: string, id?: number) => {
}
}
}
}
watch
(()
=>
props
.
categoryInfo
.
modelList
,
updateModeList
,
{
immediate
:
true
})
watchEffect
(()
=>
{
watch
(
if
(
props
.
categoryInfo
?.
modelList
)
{
()
=>
props
.
isCategorySorting
,
updateModeList
()
(
val
)
=>
{
}
if
(
val
)
isExpand
.
value
=
false
},
if
(
props
.
isCategorySorting
)
{
{
immediate
:
true
}
isExpand
.
value
=
false
)
}
})
</
script
>
</
script
>
<
style
lang=
"scss"
>
<
style
lang=
"scss"
>
...
@@ -550,10 +597,16 @@ watch(
...
@@ -550,10 +597,16 @@ watch(
}
}
</
style
>
</
style
>
<
style
lang=
"scss"
scoped
>
<
style
lang=
"scss"
scoped
>
:deep
()
{
.category-draggable-model
{
.el-table__cell
{
:deep(.el-table__cell)
{
overflow
:
hidden
;
overflow
:
hidden
;
border-bottom
:
none
!important
;
border-bottom
:
none
!important
;
}
}
//
优化表格渲染性能
:deep
(
.el-table__body
)
{
will-change
:
transform
;
transform
:
translateZ
(
0
);
}
}
}
</
style
>
</
style
>
src/views/bpm/model/form/ExtraSettings.vue
View file @
e3db7d30
...
@@ -75,12 +75,12 @@
...
@@ -75,12 +75,12 @@
</el-radio-group>
</el-radio-group>
</div>
</div>
</el-form-item>
</el-form-item>
<el-form-item
v-if=
"modelData.
customT
itleSetting"
class=
"mb-20px"
>
<el-form-item
v-if=
"modelData.
t
itleSetting"
class=
"mb-20px"
>
<
template
#
label
>
<
template
#
label
>
<el-text
size=
"large"
tag=
"b"
>
标题设置
</el-text>
<el-text
size=
"large"
tag=
"b"
>
标题设置
</el-text>
</
template
>
</
template
>
<div
class=
"flex flex-col"
>
<div
class=
"flex flex-col"
>
<el-radio-group
v-model=
"modelData.
customT
itleSetting.enable"
>
<el-radio-group
v-model=
"modelData.
t
itleSetting.enable"
>
<div
class=
"flex flex-col"
>
<div
class=
"flex flex-col"
>
<el-radio
:value=
"false"
<el-radio
:value=
"false"
>
系统默认
<el-text
type=
"info"
>
展示流程名称
</el-text></el-radio
>
系统默认
<el-text
type=
"info"
>
展示流程名称
</el-text></el-radio
...
@@ -96,18 +96,50 @@
...
@@ -96,18 +96,50 @@
</div>
</div>
</el-radio-group>
</el-radio-group>
<el-mention
<el-mention
v-if=
"modelData.
customT
itleSetting.enable"
v-if=
"modelData.
t
itleSetting.enable"
v-model=
"modelData.
customT
itleSetting.title"
v-model=
"modelData.
t
itleSetting.title"
type=
"textarea"
type=
"textarea"
prefix=
"{"
prefix=
"{"
split=
"}"
split=
"}"
whole
whole
:options=
"formFieldOptions"
:options=
"formFieldOptions
4Title
"
placeholder=
"请插入表单字段或输入文本"
placeholder=
"请插入表单字段
(输入 '{' 可以选择表单字段)
或输入文本"
class=
"w-600px!"
class=
"w-600px!"
/>
/>
</div>
</div>
</el-form-item>
</el-form-item>
<el-form-item
v-if=
"modelData.summarySetting && modelData.formType === BpmModelFormType.NORMAL"
class=
"mb-20px"
>
<
template
#
label
>
<el-text
size=
"large"
tag=
"b"
>
摘要设置
</el-text>
</
template
>
<div
class=
"flex flex-col"
>
<el-radio-group
v-model=
"modelData.summarySetting.enable"
>
<div
class=
"flex flex-col"
>
<el-radio
:value=
"false"
>
系统默认
<el-text
type=
"info"
>
展示表单前 3 个字段
</el-text>
</el-radio>
<el-radio
:value=
"true"
>
自定义摘要
</el-radio>
</div>
</el-radio-group>
<el-select
class=
"w-500px!"
v-if=
"modelData.summarySetting.enable"
v-model=
"modelData.summarySetting.summary"
multiple
placeholder=
"请选择要展示的表单字段"
>
<el-option
v-for=
"item in formFieldOptions4Summary"
:key=
"item.value"
:label=
"item.label"
:value=
"item.value"
/>
</el-select>
</div>
</el-form-item>
</el-form>
</el-form>
</template>
</template>
...
@@ -174,21 +206,30 @@ const numberExample = computed(() => {
...
@@ -174,21 +206,30 @@ const numberExample = computed(() => {
})
})
/** 表单选项 */
/** 表单选项 */
const
formField
=
ref
<
Array
<
{
field
:
ProcessVariableEnum
;
title
:
string
}
>>
([])
const
formField
=
ref
<
Array
<
{
field
:
string
;
title
:
string
}
>>
([])
const
formFieldOptions
=
computed
(()
=>
{
const
formFieldOptions4Title
=
computed
(()
=>
{
let
cloneFormField
=
formField
.
value
.
map
((
item
)
=>
{
return
{
label
:
item
.
title
,
value
:
item
.
field
}
})
// 固定添加发起人 ID 字段
// 固定添加发起人 ID 字段
formField
.
value
.
unshift
({
cloneFormField
.
unshift
({
field
:
ProcessVariableEnum
.
PROCESS_DEFINITION_NAME
,
label
:
ProcessVariableEnum
.
PROCESS_DEFINITION_NAME
,
titl
e
:
'流程名称'
valu
e
:
'流程名称'
})
})
formField
.
value
.
unshift
({
cloneFormField
.
unshift
({
field
:
ProcessVariableEnum
.
START_TIME
,
label
:
ProcessVariableEnum
.
START_TIME
,
titl
e
:
'发起时间'
valu
e
:
'发起时间'
})
})
formField
.
value
.
unshift
({
cloneFormField
.
unshift
({
field
:
ProcessVariableEnum
.
START_USER_ID
,
label
:
ProcessVariableEnum
.
START_USER_ID
,
titl
e
:
'发起人'
valu
e
:
'发起人'
})
})
return
cloneFormField
})
const
formFieldOptions4Summary
=
computed
(()
=>
{
return
formField
.
value
.
map
((
item
)
=>
{
return
formField
.
value
.
map
((
item
)
=>
{
return
{
return
{
label
:
item
.
title
,
label
:
item
.
title
,
...
@@ -211,12 +252,18 @@ const initData = () => {
...
@@ -211,12 +252,18 @@ const initData = () => {
if
(
!
modelData
.
value
.
autoApprovalType
)
{
if
(
!
modelData
.
value
.
autoApprovalType
)
{
modelData
.
value
.
autoApprovalType
=
BpmAutoApproveType
.
NONE
modelData
.
value
.
autoApprovalType
=
BpmAutoApproveType
.
NONE
}
}
if
(
!
modelData
.
value
.
customT
itleSetting
)
{
if
(
!
modelData
.
value
.
t
itleSetting
)
{
modelData
.
value
.
customT
itleSetting
=
{
modelData
.
value
.
t
itleSetting
=
{
enable
:
false
,
enable
:
false
,
title
:
''
title
:
''
}
}
}
}
if
(
!
modelData
.
value
.
summarySetting
)
{
modelData
.
value
.
summarySetting
=
{
enable
:
false
,
summary
:
[]
}
}
}
}
defineExpose
({
initData
})
defineExpose
({
initData
})
...
@@ -224,9 +271,9 @@ defineExpose({ initData })
...
@@ -224,9 +271,9 @@ defineExpose({ initData })
watch
(
watch
(
()
=>
modelData
.
value
.
formId
,
()
=>
modelData
.
value
.
formId
,
async
(
newFormId
)
=>
{
async
(
newFormId
)
=>
{
if
(
newFormId
&&
modelData
.
value
.
formType
===
BpmModelFormType
.
CUSTOM
)
{
if
(
newFormId
&&
modelData
.
value
.
formType
===
BpmModelFormType
.
NORMAL
)
{
const
data
=
await
FormApi
.
getForm
(
newFormId
)
const
data
=
await
FormApi
.
getForm
(
newFormId
)
const
result
:
Array
<
{
field
:
ProcessVariableEnum
;
title
:
string
}
>
=
[]
const
result
:
Array
<
{
field
:
string
;
title
:
string
}
>
=
[]
if
(
data
.
fields
)
{
if
(
data
.
fields
)
{
data
.
fields
.
forEach
((
fieldStr
:
string
)
=>
{
data
.
fields
.
forEach
((
fieldStr
:
string
)
=>
{
parseFormFields
(
JSON
.
parse
(
fieldStr
),
result
)
parseFormFields
(
JSON
.
parse
(
fieldStr
),
result
)
...
...
src/views/bpm/model/form/index.vue
View file @
e3db7d30
...
@@ -155,9 +155,13 @@ const formData: any = ref({
...
@@ -155,9 +155,13 @@ const formData: any = ref({
length
:
5
length
:
5
},
},
autoApprovalType
:
BpmAutoApproveType
.
NONE
,
autoApprovalType
:
BpmAutoApproveType
.
NONE
,
customT
itleSetting
:
{
t
itleSetting
:
{
enable
:
false
,
enable
:
false
,
title
:
''
title
:
''
},
summarySetting
:
{
enable
:
false
,
summary
:
[]
}
}
})
})
...
...
src/views/bpm/processInstance/index.vue
View file @
e3db7d30
...
@@ -130,6 +130,15 @@
...
@@ -130,6 +130,15 @@
<ContentWrap>
<ContentWrap>
<el-table
v-loading=
"loading"
:data=
"list"
>
<el-table
v-loading=
"loading"
:data=
"list"
>
<el-table-column
label=
"流程名称"
align=
"center"
prop=
"name"
min-width=
"200px"
fixed=
"left"
/>
<el-table-column
label=
"流程名称"
align=
"center"
prop=
"name"
min-width=
"200px"
fixed=
"left"
/>
<el-table-column
label=
"摘要"
prop=
"summary"
min-width=
"180"
fixed=
"left"
>
<
template
#
default=
"scope"
>
<div
class=
"flex flex-col"
v-if=
"scope.row.summary && scope.row.summary.length > 0"
>
<div
v-for=
"(item, index) in scope.row.summary"
:key=
"index"
>
<el-text
type=
"info"
>
{{
item
.
key
}}
:
{{
item
.
value
}}
</el-text>
</div>
</div>
</
template
>
</el-table-column>
<el-table-column
<el-table-column
label=
"流程分类"
label=
"流程分类"
align=
"center"
align=
"center"
...
...
src/views/bpm/task/copy/index.vue
View file @
e3db7d30
...
@@ -44,6 +44,7 @@
...
@@ -44,6 +44,7 @@
<!-- 列表 -->
<!-- 列表 -->
<ContentWrap>
<ContentWrap>
<el-table
v-loading=
"loading"
:data=
"list"
>
<el-table
v-loading=
"loading"
:data=
"list"
>
<!-- TODO 芋艿:增加摘要 -->
<el-table-column
align=
"center"
label=
"流程名"
prop=
"processInstanceName"
min-width=
"180"
/>
<el-table-column
align=
"center"
label=
"流程名"
prop=
"processInstanceName"
min-width=
"180"
/>
<el-table-column
<el-table-column
align=
"center"
align=
"center"
...
...
src/views/bpm/task/done/index.vue
View file @
e3db7d30
...
@@ -122,6 +122,15 @@
...
@@ -122,6 +122,15 @@
<ContentWrap>
<ContentWrap>
<el-table
v-loading=
"loading"
:data=
"list"
>
<el-table
v-loading=
"loading"
:data=
"list"
>
<el-table-column
align=
"center"
label=
"流程"
prop=
"processInstance.name"
width=
"180"
/>
<el-table-column
align=
"center"
label=
"流程"
prop=
"processInstance.name"
width=
"180"
/>
<el-table-column
label=
"摘要"
prop=
"summary"
min-width=
"180"
>
<
template
#
default=
"scope"
>
<div
class=
"flex flex-col"
v-if=
"scope.row.summary && scope.row.summary.length > 0"
>
<div
v-for=
"(item, index) in scope.row.summary"
:key=
"index"
>
<el-text
type=
"info"
>
{{
item
.
key
}}
:
{{
item
.
value
}}
</el-text>
</div>
</div>
</
template
>
</el-table-column>
<el-table-column
<el-table-column
align=
"center"
align=
"center"
label=
"发起人"
label=
"发起人"
...
...
src/views/bpm/task/todo/index.vue
View file @
e3db7d30
...
@@ -105,6 +105,15 @@
...
@@ -105,6 +105,15 @@
<ContentWrap>
<ContentWrap>
<el-table
v-loading=
"loading"
:data=
"list"
>
<el-table
v-loading=
"loading"
:data=
"list"
>
<el-table-column
align=
"center"
label=
"流程"
prop=
"processInstance.name"
width=
"180"
/>
<el-table-column
align=
"center"
label=
"流程"
prop=
"processInstance.name"
width=
"180"
/>
<el-table-column
label=
"摘要"
prop=
"summary"
min-width=
"180"
>
<
template
#
default=
"scope"
>
<div
class=
"flex flex-col"
v-if=
"scope.row.summary && scope.row.summary.length > 0"
>
<div
v-for=
"(item, index) in scope.row.summary"
:key=
"index"
>
<el-text
type=
"info"
>
{{
item
.
key
}}
:
{{
item
.
value
}}
</el-text>
</div>
</div>
</
template
>
</el-table-column>
<el-table-column
<el-table-column
align=
"center"
align=
"center"
label=
"发起人"
label=
"发起人"
...
...
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