Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
Z
zhichan
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
蒋勇
zhichan
Commits
00be74bf
Commit
00be74bf
authored
Aug 13, 2020
by
庄冰
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'gsb-marketplat' of gitlab.gongsibao.com:jiangyong/zhichan into gsb-marketplat
parents
7146d594
25300e3c
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
34 additions
and
8 deletions
+34
-8
gsb-marketplat/app/base/controller/impl/configmag/forminfoCtl.js
+9
-0
gsb-marketplat/app/base/service/impl/configmag/forminfoSve.js
+25
-2
gsb-marketplat/app/base/service/impl/configmag/formitemSve.js
+0
-6
No files found.
gsb-marketplat/app/base/controller/impl/configmag/forminfoCtl.js
View file @
00be74bf
...
...
@@ -28,6 +28,15 @@ class FormInfoCtl extends CtlBase {
return
result
;
}
/**
* 复制表单
* @returns {Promise<void>}
*/
async
copy
(
pobj
){
let
result
=
await
this
.
service
.
copy
(
pobj
);
return
result
;
}
}
module
.
exports
=
FormInfoCtl
;
gsb-marketplat/app/base/service/impl/configmag/forminfoSve.js
View file @
00be74bf
...
...
@@ -55,6 +55,30 @@ class ForminfoService extends ServiceBase {
return
system
.
getResult
(
result
);
}
/**
* 表单复制
* @param pobj
* @returns {Promise<void>}
*/
async
copy
(
pobj
){
let
items
=
await
this
.
formitemSve
.
findAll
({
form_id
:
pobj
.
id
},[]);
delete
pobj
.
id
;
delete
pobj
.
created_at
;
let
code
=
await
this
.
getBusUid
(
'fm'
);
pobj
.
code
=
code
;
pobj
.
name
+=
"_副本"
;
let
saveRt
=
await
this
.
create
(
pobj
);
items
.
forEach
(
async
(
item
)
=>
{
delete
item
.
dataValues
.
id
;
delete
item
.
dataValues
.
created_at
;
let
iCode
=
await
this
.
getBusUid
(
'it'
);
item
.
code
=
iCode
;
item
.
form_id
=
saveRt
.
id
this
.
formitemSve
.
create
(
item
.
dataValues
);
})
return
system
.
getResult
(
saveRt
);
}
//组装form
async
packageForm
(
items
)
{
let
data
=
{
...
...
@@ -64,7 +88,6 @@ class ForminfoService extends ServiceBase {
"downOptions"
:
"dic-select"
,
"singleText"
:
"input"
,
"multipleText"
:
"textarea"
,
"dateTime"
:
"datetime"
,
"area"
:
"tree-sel"
//忽略 4
}
...
...
@@ -83,7 +106,7 @@ class ForminfoService extends ServiceBase {
//校验
let
rules
=
[{
"required"
:
true
,
"message"
:
' '
,
"trigger"
:
'blur'
}];
//单行文本 多行文本 增加校验项 有最小和最大值
if
([
'singleText'
,
'multipleText'
].
includes
(
item
.
item_type
)){
if
([
'singleText'
,
'multipleText'
].
includes
(
item
.
item_type
)
&&
item
.
config_params
){
let
rule
=
{
"validator"
:
"validatex"
,
"trigger"
:
"blur"
,
"minchars"
:
item
.
config_params
.
input_length
[
0
],
"maxchars"
:
item
.
config_params
.
input_length
[
1
]}
rules
.
push
(
rule
)
}
...
...
gsb-marketplat/app/base/service/impl/configmag/formitemSve.js
View file @
00be74bf
...
...
@@ -69,12 +69,6 @@ class FormitemService extends ServiceBase {
length
.
push
(
pobj
.
input_lar
);
config_params
[
"input_length"
]
=
length
;
break
;
case
"dateTime"
:
config_params
[
"date_type"
]
=
pobj
.
date_type
==
"specific"
?
1
:
2
;
config_params
[
"date_accuracy"
]
=
pobj
.
date_type
==
"day"
?
1
:
2
;
config_params
[
"date_shield_type"
]
=
pobj
.
date_shield_type
==
"default"
?
1
:
2
;
config_params
[
"shield_date"
]
=
pobj
.
shield_date
;
break
;
case
"area"
:
config_params
[
"is_show_county"
]
=
pobj
.
is_show_county
;
break
;
...
...
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