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
28964490
Commit
28964490
authored
Aug 20, 2020
by
庄冰
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'gsb-marketplat' of gitlab.gongsibao.com:jiangyong/zhichan into gsb-marketplat
parents
9035c153
fe78564c
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
73 additions
and
2 deletions
+73
-2
gsb-marketplat/app/base/api/impl/action/templateconfig.js
+5
-2
gsb-marketplat/app/base/service/impl/configmag/forminfoSve.js
+67
-0
gsb-marketplat/app/base/service/impl/template/templatelinkSve.js
+1
-0
No files found.
gsb-marketplat/app/base/api/impl/action/templateconfig.js
View file @
28964490
...
...
@@ -58,8 +58,11 @@ class Templateconfig extends APIBase {
case
"getTemplateAndLinkInfo"
:
// 根据链接参数获取模板链接信息
opResult
=
await
this
.
templatelinkSve
.
getTemplateAndLinkInfo2
(
pobj
);
break
;
case
"copyForm"
:
// 复制表单
opResult
=
await
this
.
forminfoSve
.
copyForm
(
pobj
.
actionBody
);
case
"copyFormInfo"
:
// 复制表单
opResult
=
await
this
.
forminfoSve
.
copyFormInfo
(
pobj
.
actionBody
);
break
;
case
"deleteFormInfo"
:
// 删除表单
opResult
=
await
this
.
forminfoSve
.
deleteFormInfo
(
pobj
.
actionBody
);
break
;
default
:
opResult
=
system
.
getResult
(
null
,
"action_type参数错误"
);
...
...
gsb-marketplat/app/base/service/impl/configmag/forminfoSve.js
View file @
28964490
...
...
@@ -221,6 +221,72 @@ class ForminfoService extends ServiceBase {
let
res
=
await
this
.
dao
.
findAndCountAll
(
pobj
);
return
system
.
getResult
(
res
);
}
async
copyFormInfo
(
pobj
)
{
let
form
=
await
this
.
findById
(
pobj
.
id
);
if
(
!
form
)
{
return
system
.
getResultFail
(
-
1
,
"表单不存在"
);
}
// console.log(form.dataValues);
let
formCode
=
await
this
.
getBusUid
(
"fm"
);
let
formCopyObj
=
{
code
:
formCode
,
name
:
form
.
name
+
"_副本"
,
form_items
:
form
.
form_items
,
form_describe
:
form
.
form_describe
,
notes
:
form
.
notes
,
version
:
form
.
version
,
// created_at: form.created_at,
// updated_at: form.updated_at,
uder_id
:
form
.
user_id
,
user_name
:
form
.
user_name
,
company_id
:
form
.
company_id
,
record_num
:
form
.
record_num
,
form_table
:
form
.
form_table
};
// console.log(formCopyObj);
// 创建新的表单信息
let
formCopy
=
await
this
.
create
(
formCopyObj
);
let
formCopyId
=
formCopy
.
id
;
// 获取表单相关的表单项,复制并与新的表单关联
let
formItems
=
await
this
.
formitemDao
.
findAll
({
form_id
:
pobj
.
id
});
if
(
formItems
.
length
>
0
)
{
formItems
.
forEach
(
async
(
item
)
=>
{
let
itemCode
=
await
this
.
getBusUid
(
"it"
);
let
itemNew
=
{
form_id
:
formCopyId
,
code
:
itemCode
,
name
:
item
.
name
,
item_type
:
item
.
item_type
,
item_type_name
:
item
.
item_type_name
,
config_params
:
item
.
config_params
,
id_enabled
:
item
.
is_enabled
,
is_required
:
item
.
is_required
,
sequence
:
item
.
sequence
,
notes
:
item
.
notes
,
version
:
item
.
version
,
// created_at: item.created_at,
// updated_at: item.updated_at
};
await
this
.
formitemDao
.
create
(
itemNew
);
});
}
return
system
.
getResultSuccess
(
formCopy
);
}
async
deleteFormInfo
(
pobj
)
{
let
template
=
await
this
.
templateDao
.
findOne
({
"form_id"
:
pobj
.
id
});
if
(
template
&&
template
.
is_enabled
===
1
)
{
return
system
.
getResultFail
(
-
1
,
"表单使用中,无法删除"
);
}
let
form
=
await
this
.
delete
({
"id"
:
pobj
.
id
});
// let formItems = await this.formitemDao.findAll({"form_id": pobj.id});
// formItems.forEach(async (item) => await item.destory());
await
this
.
formitemDao
.
bulkDeleteByWhere
({
where
:
{
"form_id"
:
pobj
.
id
}});
return
system
.
getResultSuccess
(
form
);
}
}
module
.
exports
=
ForminfoService
;
\ No newline at end of file
gsb-marketplat/app/base/service/impl/template/templatelinkSve.js
View file @
28964490
...
...
@@ -465,6 +465,7 @@ class TemplatelinkService extends ServiceBase {
};
// 将数据保存到redis中
await
this
.
redisClient
.
set
(
shaStr
,
JSON
.
stringify
(
rtnObj
));
// await this.redisClient.setWithEx(shaStr, JSON.stringify(rtnObj), 60); // 保存的同时设置过期时间
}
addObj
=
{
// 需要保存到浏览记录的内容
...
...
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