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
Unverified
Commit
a96873ef
authored
Jan 23, 2025
by
芋道源码
Committed by
Gitee
Jan 23, 2025
Browse files
Options
Browse Files
Download
Plain Diff
!677 feat: BPM-更多设置-标题设置
Merge pull request !677 from Lesan/feature/bpm-标题设置
parents
c435e2c9
9495c2c6
Show 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 @
a96873ef
...
@@ -653,7 +653,15 @@ export enum ProcessVariableEnum {
...
@@ -653,7 +653,15 @@ export enum ProcessVariableEnum {
/**
/**
* 发起用户 ID
* 发起用户 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 @
a96873ef
...
@@ -75,12 +75,48 @@
...
@@ -75,12 +75,48 @@
</el-radio-group>
</el-radio-group>
</div>
</div>
</el-form-item>
</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>
</el-form>
</template>
</template>
<
script
setup
lang=
"ts"
>
<
script
setup
lang=
"ts"
>
import
dayjs
from
'dayjs'
import
dayjs
from
'dayjs'
import
{
BpmAutoApproveType
}
from
'@/utils/constants'
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
>
()
const
modelData
=
defineModel
<
any
>
()
...
@@ -137,6 +173,29 @@ const numberExample = computed(() => {
...
@@ -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
=
()
=>
{
const
initData
=
()
=>
{
if
(
!
modelData
.
value
.
processIdRule
)
{
if
(
!
modelData
.
value
.
processIdRule
)
{
...
@@ -151,6 +210,32 @@ const initData = () => {
...
@@ -151,6 +210,32 @@ const initData = () => {
if
(
!
modelData
.
value
.
autoApprovalType
)
{
if
(
!
modelData
.
value
.
autoApprovalType
)
{
modelData
.
value
.
autoApprovalType
=
BpmAutoApproveType
.
NONE
modelData
.
value
.
autoApprovalType
=
BpmAutoApproveType
.
NONE
}
}
if
(
!
modelData
.
value
.
customTitleSetting
)
{
modelData
.
value
.
customTitleSetting
=
{
enable
:
false
,
title
:
''
}
}
}
}
defineExpose
({
initData
})
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
>
</
script
>
src/views/bpm/model/form/index.vue
View file @
a96873ef
...
@@ -154,7 +154,11 @@ const formData: any = ref({
...
@@ -154,7 +154,11 @@ const formData: any = ref({
postfix
:
''
,
postfix
:
''
,
length
:
5
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