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
8e575f35
authored
Mar 04, 2023
by
gexinzhineng/gxzn27
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
生成json和options
parent
fcb9afd3
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
44 additions
and
2 deletions
+44
-2
src/views/bpm/form/formEditor.vue
+44
-2
No files found.
src/views/bpm/form/formEditor.vue
View file @
8e575f35
...
@@ -3,9 +3,21 @@
...
@@ -3,9 +3,21 @@
<!-- 表单设计器 -->
<!-- 表单设计器 -->
<fc-designer
ref=
"designer"
height=
"780px"
>
<fc-designer
ref=
"designer"
height=
"780px"
>
<template
#
handle
>
<template
#
handle
>
<XButton
type=
"primary"
title=
"生成JSON"
@
click=
"showJson"
/>
<XButton
type=
"primary"
title=
"生成Options"
@
click=
"showOption"
/>
<XButton
type=
"primary"
:title=
"t('action.save')"
@
click=
"handleSave"
/>
<XButton
type=
"primary"
:title=
"t('action.save')"
@
click=
"handleSave"
/>
</
template
>
</
template
>
</fc-designer>
</fc-designer>
<Dialog
:title=
"dialogTitle"
v-model=
"dialogVisible1"
maxHeight=
"600"
>
<div
ref=
"editor"
v-if=
"dialogVisible1"
>
<XTextButton
style=
"float: right"
:title=
"t('common.copy')"
@
click=
"copy(formValue)"
/>
<el-scrollbar
height=
"580"
>
<pre>
{{ formValue }}
</pre>
</el-scrollbar>
</div>
</Dialog>
<!-- 表单保存的弹窗 -->
<!-- 表单保存的弹窗 -->
<XModal
v-model=
"dialogVisible"
title=
"保存表单"
>
<XModal
v-model=
"dialogVisible"
title=
"保存表单"
>
<el-form
ref=
"formRef"
:model=
"formValues"
:rules=
"formRules"
label-width=
"80px"
>
<el-form
ref=
"formRef"
:model=
"formValues"
:rules=
"formRules"
label-width=
"80px"
>
...
@@ -48,13 +60,18 @@ import { DICT_TYPE, getIntDictOptions } from '@/utils/dict'
...
@@ -48,13 +60,18 @@ import { DICT_TYPE, getIntDictOptions } from '@/utils/dict'
import
{
CommonStatusEnum
}
from
'@/utils/constants'
import
{
CommonStatusEnum
}
from
'@/utils/constants'
import
*
as
FormApi
from
'@/api/bpm/form'
import
*
as
FormApi
from
'@/api/bpm/form'
import
{
encodeConf
,
encodeFields
,
setConfAndFields
}
from
'@/utils/formCreate'
import
{
encodeConf
,
encodeFields
,
setConfAndFields
}
from
'@/utils/formCreate'
import
{
useClipboard
}
from
'@vueuse/core'
const
{
t
}
=
useI18n
()
// 国际化
const
{
t
}
=
useI18n
()
// 国际化
const
message
=
useMessage
()
// 消息
const
message
=
useMessage
()
// 消息
const
{
query
}
=
useRoute
()
// 路由
const
{
query
}
=
useRoute
()
// 路由
const
designer
=
ref
()
// 表单设计器
const
designer
=
ref
()
// 表单设计器
const
type
=
ref
(
-
1
)
const
formValue
=
ref
(
''
)
const
dialogTitle
=
ref
(
''
)
const
dialogVisible
=
ref
(
false
)
// 弹窗是否展示
const
dialogVisible
=
ref
(
false
)
// 弹窗是否展示
const
dialogVisible1
=
ref
(
false
)
// 弹窗是否展示
const
dialogLoading
=
ref
(
false
)
// 弹窗的加载中
const
dialogLoading
=
ref
(
false
)
// 弹窗的加载中
const
formRef
=
ref
<
FormInstance
>
()
const
formRef
=
ref
<
FormInstance
>
()
const
formRules
=
reactive
({
const
formRules
=
reactive
({
...
@@ -98,7 +115,32 @@ const submitForm = async () => {
...
@@ -98,7 +115,32 @@ const submitForm = async () => {
dialogLoading
.
value
=
false
dialogLoading
.
value
=
false
}
}
}
}
const
showJson
=
()
=>
{
openModel
(
'生成JSON'
)
type
.
value
=
0
formValue
.
value
=
designer
.
value
.
getRule
()
}
const
showOption
=
()
=>
{
openModel
(
'生成Options'
)
type
.
value
=
1
formValue
.
value
=
designer
.
value
.
getOption
()
}
const
openModel
=
(
title
:
string
)
=>
{
dialogVisible1
.
value
=
true
dialogTitle
.
value
=
title
}
/** 复制 **/
const
copy
=
async
(
text
:
string
)
=>
{
const
{
copy
,
copied
,
isSupported
}
=
useClipboard
({
source
:
text
})
if
(
!
isSupported
)
{
message
.
error
(
t
(
'common.copyError'
))
}
else
{
await
copy
()
if
(
unref
(
copied
))
{
message
.
success
(
t
(
'common.copySuccess'
))
}
}
}
// ========== 初始化 ==========
// ========== 初始化 ==========
onMounted
(()
=>
{
onMounted
(()
=>
{
// 场景一:新增表单
// 场景一:新增表单
...
...
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