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
9495c2c6
authored
Jan 23, 2025
by
LesanOuO
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
feat: BPM-更多设置-标题设置
parent
c435e2c9
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
99 additions
and
2 deletions
+99
-2
src/components/SimpleProcessDesignerV2/src/consts.ts
+9
-1
src/views/bpm/model/form/ExtraSettings.vue
+85
-0
src/views/bpm/model/form/index.vue
+5
-1
No files found.
src/components/SimpleProcessDesignerV2/src/consts.ts
View file @
9495c2c6
...
...
@@ -653,7 +653,15 @@ export enum ProcessVariableEnum {
/**
* 发起用户 ID
*/
START_USER_ID
=
'PROCESS_START_USER_ID'
START_USER_ID
=
'PROCESS_START_USER_ID'
,
/**
* 发起时间
*/
START_TIME
=
'PROCESS_START_TIME'
,
/**
* 流程定义名称
*/
PROCESS_DEFINITION_NAME
=
'PROCESS_DEFINITION_NAME'
}
/**
...
...
src/views/bpm/model/form/ExtraSettings.vue
View file @
9495c2c6
...
...
@@ -75,12 +75,48 @@
</el-radio-group>
</div>
</el-form-item>
<el-form-item
v-if=
"modelData.customTitleSetting"
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.customTitleSetting.enable"
>
<div
class=
"flex flex-col"
>
<el-radio
:value=
"false"
>
系统默认
<el-text
type=
"info"
>
展示流程名称
</el-text></el-radio
>
<el-radio
:value=
"true"
>
自定义标题
<el-text>
<el-tooltip
content=
"输入字符 '{' 即可插入表单字段"
effect=
"light"
placement=
"top"
>
<Icon
icon=
"ep:question-filled"
class=
"ml-5px"
/>
</el-tooltip>
</el-text>
</el-radio>
</div>
</el-radio-group>
<el-mention
v-if=
"modelData.customTitleSetting.enable"
v-model=
"modelData.customTitleSetting.title"
type=
"textarea"
prefix=
"{"
split=
"}"
whole
:options=
"formFieldOptions"
placeholder=
"请插入表单字段或输入文本"
class=
"w-600px!"
/>
</div>
</el-form-item>
</el-form>
</template>
<
script
setup
lang=
"ts"
>
import
dayjs
from
'dayjs'
import
{
BpmAutoApproveType
}
from
'@/utils/constants'
import
*
as
FormApi
from
'@/api/bpm/form'
import
{
parseFormFields
}
from
'@/components/FormCreate/src/utils/index'
import
{
ProcessVariableEnum
}
from
"@/components/SimpleProcessDesignerV2/src/consts"
;
const
modelData
=
defineModel
<
any
>
()
...
...
@@ -137,6 +173,29 @@ const numberExample = computed(() => {
}
})
const
formField
=
ref
([])
const
formFieldOptions
=
computed
(()
=>
{
// 固定添加发起人 ID 字段
formField
.
value
.
unshift
({
field
:
ProcessVariableEnum
.
PROCESS_DEFINITION_NAME
,
title
:
'流程名称'
,
})
formField
.
value
.
unshift
({
field
:
ProcessVariableEnum
.
START_TIME
,
title
:
'发起时间'
,
})
formField
.
value
.
unshift
({
field
:
ProcessVariableEnum
.
START_USER_ID
,
title
:
'发起人'
,
})
return
formField
.
value
.
map
((
item
)
=>
{
return
{
label
:
item
.
title
,
value
:
item
.
field
}
})
})
/** 兼容以前未配置更多设置的流程 */
const
initData
=
()
=>
{
if
(
!
modelData
.
value
.
processIdRule
)
{
...
...
@@ -151,6 +210,32 @@ const initData = () => {
if
(
!
modelData
.
value
.
autoApprovalType
)
{
modelData
.
value
.
autoApprovalType
=
BpmAutoApproveType
.
NONE
}
if
(
!
modelData
.
value
.
customTitleSetting
)
{
modelData
.
value
.
customTitleSetting
=
{
enable
:
false
,
title
:
''
}
}
}
defineExpose
({
initData
})
// 监听表单ID变化,加载表单数据
watch
(
()
=>
modelData
.
value
.
formId
,
async
(
newFormId
)
=>
{
if
(
newFormId
&&
modelData
.
value
.
formType
===
10
)
{
const
data
=
await
FormApi
.
getForm
(
newFormId
)
const
result
:
Array
<
Record
<
string
,
any
>>
=
[]
if
(
data
.
fields
)
{
data
.
fields
.
forEach
((
fieldStr
:
string
)
=>
{
parseFormFields
(
JSON
.
parse
(
fieldStr
),
result
)
})
}
formField
.
value
=
result
}
else
{
formField
.
value
=
[]
}
},
{
immediate
:
true
}
)
</
script
>
src/views/bpm/model/form/index.vue
View file @
9495c2c6
...
...
@@ -154,7 +154,11 @@ const formData: any = ref({
postfix
:
''
,
length
:
5
},
autoApprovalType
:
BpmAutoApproveType
.
NONE
autoApprovalType
:
BpmAutoApproveType
.
NONE
,
customTitleSetting
:
{
enable
:
false
,
title
:
''
}
})
//流程数据
...
...
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