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
f92ab64f
authored
Feb 26, 2025
by
Roan
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
feat: bpm流程表单复制功能
parent
ead7fa26
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
26 additions
and
7 deletions
+26
-7
src/views/bpm/form/editor/index.vue
+10
-0
src/views/bpm/form/index.vue
+16
-7
No files found.
src/views/bpm/form/editor/index.vue
View file @
f92ab64f
...
@@ -50,11 +50,13 @@ import FcDesigner from '@form-create/designer'
...
@@ -50,11 +50,13 @@ import FcDesigner from '@form-create/designer'
import
{
encodeConf
,
encodeFields
,
setConfAndFields
}
from
'@/utils/formCreate'
import
{
encodeConf
,
encodeFields
,
setConfAndFields
}
from
'@/utils/formCreate'
import
{
useTagsViewStore
}
from
'@/store/modules/tagsView'
import
{
useTagsViewStore
}
from
'@/store/modules/tagsView'
import
{
useFormCreateDesigner
}
from
'@/components/FormCreate'
import
{
useFormCreateDesigner
}
from
'@/components/FormCreate'
import
{
useRoute
}
from
'vue-router'
defineOptions
({
name
:
'BpmFormEditor'
})
defineOptions
({
name
:
'BpmFormEditor'
})
const
{
t
}
=
useI18n
()
// 国际化
const
{
t
}
=
useI18n
()
// 国际化
const
message
=
useMessage
()
// 消息
const
message
=
useMessage
()
// 消息
const
route
=
useRoute
()
// 路由
const
{
push
,
currentRoute
}
=
useRouter
()
// 路由
const
{
push
,
currentRoute
}
=
useRouter
()
// 路由
const
{
query
}
=
useRoute
()
// 路由信息
const
{
query
}
=
useRoute
()
// 路由信息
const
{
delView
}
=
useTagsViewStore
()
// 视图操作
const
{
delView
}
=
useTagsViewStore
()
// 视图操作
...
@@ -150,6 +152,14 @@ onMounted(async () => {
...
@@ -150,6 +152,14 @@ onMounted(async () => {
const
data
=
await
FormApi
.
getForm
(
id
)
const
data
=
await
FormApi
.
getForm
(
id
)
formData
.
value
=
data
formData
.
value
=
data
setConfAndFields
(
designer
,
data
.
conf
,
data
.
fields
)
setConfAndFields
(
designer
,
data
.
conf
,
data
.
fields
)
if
(
route
.
query
.
type
!==
'copy'
)
{
return
}
// 场景三: 复制表单
const
{
id
:
foo
,
...
copied
}
=
data
formData
.
value
=
copied
formData
.
value
.
name
+=
'_copy'
})
})
</
script
>
</
script
>
...
...
src/views/bpm/form/index.vue
View file @
f92ab64f
...
@@ -59,7 +59,15 @@
...
@@ -59,7 +59,15 @@
v-hasPermi=
"['bpm:form:update']"
v-hasPermi=
"['bpm:form:update']"
link
link
type=
"primary"
type=
"primary"
@
click=
"openForm(scope.row.id)"
@
click=
"openForm('copy', scope.row.id)"
>
复制
</el-button>
<el-button
v-hasPermi=
"['bpm:form:update']"
link
type=
"primary"
@
click=
"openForm('update', scope.row.id)"
>
>
编辑
编辑
</el-button>
</el-button>
...
@@ -139,16 +147,17 @@ const resetQuery = () => {
...
@@ -139,16 +147,17 @@ const resetQuery = () => {
}
}
/** 添加/修改操作 */
/** 添加/修改操作 */
const
openForm
=
(
id
?:
number
)
=>
{
const
openForm
=
(
type
:
string
,
id
?:
number
)
=>
{
const
toRouter
:
{
name
:
string
;
query
?:
{
id
:
number
}
}
=
{
const
toRouter
:
{
name
:
string
;
query
:
{
type
:
string
;
id
?:
number
}
}
=
{
name
:
'BpmFormEditor'
name
:
'BpmFormEditor'
,
query
:
{
type
}
}
}
console
.
log
(
typeof
id
)
console
.
log
(
typeof
id
)
// 表单新建的时候id传的是event需要排除
// 表单新建的时候id传的是event需要排除
if
(
typeof
id
===
'number'
||
typeof
id
===
'string'
)
{
if
(
typeof
id
===
'number'
||
typeof
id
===
'string'
)
{
toRouter
.
query
=
{
toRouter
.
query
.
id
=
id
id
}
}
}
push
(
toRouter
)
push
(
toRouter
)
}
}
...
...
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