Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
Skyeye云
Skyeye
提交
365c450d
S
Skyeye
项目概览
Skyeye云
/
Skyeye
通知
1433
Star
162
Fork
130
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
DevOps
流水线
流水线任务
计划
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
S
Skyeye
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
DevOps
DevOps
流水线
流水线任务
计划
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
流水线任务
提交
Issue看板
提交
365c450d
编写于
1月 03, 2023
作者:
Skyeye云
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
表单布局新增提交完成
上级
fbd02af4
变更
10
隐藏空白更改
内联
并排
Showing
10 changed file
with
178 addition
and
86 deletion
+178
-86
dsform/src/main/resources/template/js/dsFormComponent/dsFormComponentAdd.js
...sources/template/js/dsFormComponent/dsFormComponentAdd.js
+2
-0
dsform/src/main/resources/template/js/dsFormComponent/dsFormComponentEdit.js
...ources/template/js/dsFormComponent/dsFormComponentEdit.js
+2
-0
dsform/src/main/resources/template/js/dsFormComponent/dsFormComponentList.js
...ources/template/js/dsFormComponent/dsFormComponentList.js
+3
-0
dsform/src/main/resources/template/js/dsFormObjectRelation/dsFormObjectRelationEdit.js
...plate/js/dsFormObjectRelation/dsFormObjectRelationEdit.js
+2
-2
dsform/src/main/resources/template/js/dsFormPage/dsFormPageDesign.js
...main/resources/template/js/dsFormPage/dsFormPageDesign.js
+2
-2
dsform/src/main/resources/template/tpl/dsFormComponent/dsFormComponentAdd.html
...rces/template/tpl/dsFormComponent/dsFormComponentAdd.html
+8
-0
dsform/src/main/resources/template/tpl/dsFormComponent/dsFormComponentEdit.html
...ces/template/tpl/dsFormComponent/dsFormComponentEdit.html
+8
-0
dsform/src/main/resources/template/tpl/dsFormObjectRelation/dsFormObjectRelationEdit.html
...te/tpl/dsFormObjectRelation/dsFormObjectRelationEdit.html
+1
-1
erp/src/main/resources/template/js/purchaseOrder/purchaseOrderEdit.js
.../resources/template/js/purchaseOrder/purchaseOrderEdit.js
+3
-3
web/src/main/resources/template/assets/lib/layui/customer/skyeye/dsFormUtil.js
...s/template/assets/lib/layui/customer/skyeye/dsFormUtil.js
+147
-78
未找到文件。
dsform/src/main/resources/template/js/dsFormComponent/dsFormComponentAdd.js
浏览文件 @
365c450d
...
...
@@ -19,6 +19,7 @@ layui.config({
// 组件分类
sysDictDataUtil
.
showDictDataListByDictTypeCode
(
sysDictData
[
"
dsFormContentType
"
][
"
key
"
],
'
select
'
,
"
dsFormContentType
"
,
''
,
form
);
skyeyeClassEnumUtil
.
showEnumDataListByClassName
(
"
dsFormShowType
"
,
'
select
'
,
"
showType
"
,
''
,
form
);
// 根据类型获取部分功能的使用说明
systemCommonUtil
.
queryExplainMationByType
(
2
,
function
(
json
)
{
...
...
@@ -101,6 +102,7 @@ layui.config({
jsDisplayValue
:
encodeURIComponent
(
jsDisplayValue
.
getValue
()),
jsFitValue
:
encodeURIComponent
(
jsFitValue
.
getValue
()),
typeId
:
$
(
"
#dsFormContentType
"
).
val
(),
showType
:
$
(
"
#showType
"
).
val
(),
linkedData
:
'
2
'
,
displayTemplateId
:
''
,
defaultData
:
''
,
...
...
dsform/src/main/resources/template/js/dsFormComponent/dsFormComponentEdit.js
浏览文件 @
365c450d
...
...
@@ -47,6 +47,7 @@ layui.config({
// 组件分类
sysDictDataUtil
.
showDictDataListByDictTypeCode
(
sysDictData
[
"
dsFormContentType
"
][
"
key
"
],
'
select
'
,
"
dsFormContentType
"
,
json
.
bean
.
typeId
,
form
);
skyeyeClassEnumUtil
.
showEnumDataListByClassName
(
"
dsFormShowType
"
,
'
select
'
,
"
showType
"
,
json
.
bean
.
showType
,
form
);
// 根据类型获取部分功能的使用说明
systemCommonUtil
.
queryExplainMationByType
(
2
,
function
(
json
)
{
...
...
@@ -140,6 +141,7 @@ layui.config({
jsDisplayValue
:
encodeURIComponent
(
jsDisplayValue
.
getValue
()),
jsFitValue
:
encodeURIComponent
(
jsFitValue
.
getValue
()),
typeId
:
$
(
"
#dsFormContentType
"
).
val
(),
showType
:
$
(
"
#showType
"
).
val
(),
linkedData
:
'
2
'
,
displayTemplateId
:
''
,
defaultData
:
''
,
...
...
dsform/src/main/resources/template/js/dsFormComponent/dsFormComponentList.js
浏览文件 @
365c450d
...
...
@@ -29,6 +29,9 @@ layui.config({
{
field
:
'
numCode
'
,
title
:
'
编码
'
,
width
:
120
},
{
field
:
'
name
'
,
title
:
'
名称
'
,
width
:
120
},
{
field
:
'
typeName
'
,
title
:
'
分类
'
,
width
:
120
},
{
field
:
'
showType
'
,
title
:
'
显示类型
'
,
width
:
120
,
templet
:
function
(
d
)
{
return
skyeyeClassEnumUtil
.
getEnumDataNameByCodeAndKey
(
"
dsFormShowType
"
,
'
id
'
,
d
.
showType
,
'
name
'
);
}},
{
field
:
'
id
'
,
title
:
'
图标
'
,
align
:
'
center
'
,
width
:
60
,
templet
:
function
(
d
)
{
return
systemCommonUtil
.
initIconShow
(
d
);
}},
...
...
dsform/src/main/resources/template/js/dsFormObjectRelation/dsFormObjectRelationEdit.js
浏览文件 @
365c450d
...
...
@@ -25,7 +25,7 @@ layui.config({
if
(
!
isNull
(
json
.
bean
.
dsFormPageMations
))
{
$
.
each
(
json
.
bean
.
dsFormPageMations
,
function
(
i
,
item
)
{
addRow
();
$
(
"
#dsFormChooseList
"
+
(
rowNum
-
1
)).
val
(
item
.
pageNum
);
$
(
"
#dsFormChooseList
"
+
(
rowNum
-
1
)).
val
(
item
.
numCode
);
$
(
"
#dsFormChooseList
"
+
(
rowNum
-
1
)).
attr
(
"
dataId
"
,
item
.
id
);
$
(
"
#name
"
+
(
rowNum
-
1
)).
html
(
item
.
name
);
})
...
...
@@ -85,7 +85,7 @@ layui.config({
var
btnId
=
par
.
dsFormChooseList
+
"
Btn
"
;
$
(
"
body
"
).
on
(
"
click
"
,
"
#
"
+
btnId
,
function
(
e
)
{
dsFormUtil
.
chooseType
=
false
;
// 单选
dsFormUtil
.
openDsFormPageChoosePage
(
function
(){
dsFormUtil
.
openDsFormPageChoosePage
(
function
()
{
$
(
"
#
"
+
par
.
dsFormChooseList
).
val
(
dsFormUtil
.
dsFormChooseMation
.
numCode
);
$
(
"
#
"
+
par
.
dsFormChooseList
).
attr
(
"
dataId
"
,
dsFormUtil
.
dsFormChooseMation
.
id
);
$
(
"
#
"
+
par
.
name
).
html
(
dsFormUtil
.
dsFormChooseMation
.
name
);
...
...
dsform/src/main/resources/template/js/dsFormPage/dsFormPageDesign.js
浏览文件 @
365c450d
...
...
@@ -30,13 +30,13 @@ layui.config({
// 加载新增加的控件信息
function
loadNewControl
(
item
)
{
if
(
item
.
associatedDataTypes
==
1
)
{
//json串
if
(
item
.
associatedDataTypes
==
1
)
{
//json串
var
obj
=
item
.
aData
;
if
(
typeof
item
.
aData
==
'
string
'
){
obj
=
JSON
.
parse
(
item
.
aData
);
}
item
.
context
=
getDataUseHandlebars
(
item
.
dsFormComponent
.
templateContent
,
obj
);
}
else
if
(
item
.
associatedDataTypes
==
2
){
//接口
}
else
if
(
item
.
associatedDataTypes
==
2
)
{
//接口
AjaxPostUtil
.
request
({
url
:
flowableBasePath
+
"
dsformpage011
"
,
params
:
{
interfa
:
item
.
aData
},
type
:
'
json
'
,
callback
:
function
(
j
){
var
obj
=
JSON
.
parse
(
j
.
bean
.
aData
);
item
.
context
=
getDataUseHandlebars
(
item
.
dsFormComponent
.
templateContent
,
obj
);
...
...
dsform/src/main/resources/template/tpl/dsFormComponent/dsFormComponentAdd.html
浏览文件 @
365c450d
...
...
@@ -41,6 +41,14 @@
</select>
</div>
</div>
<div
class=
"layui-form-item layui-col-xs6"
>
<label
class=
"layui-form-label"
>
显示类型
<i
class=
"red"
>
*
</i></label>
<div
class=
"layui-input-block"
>
<select
lay-filter=
"showType"
lay-search=
""
id=
"showType"
win-verify=
"required"
>
</select>
</div>
</div>
<div
class=
"layui-form-item layui-col-xs12"
>
<label
class=
"layui-form-label"
>
HTML脚本
<i
class=
"red"
>
*
</i></label>
<div
class=
"layui-input-block"
>
...
...
dsform/src/main/resources/template/tpl/dsFormComponent/dsFormComponentEdit.html
浏览文件 @
365c450d
...
...
@@ -47,6 +47,14 @@
<
/select
>
<
/div
>
<
/div
>
<
div
class
=
"
layui-form-item layui-col-xs6
"
>
<
label
class
=
"
layui-form-label
"
>
显示类型
<
i
class
=
"
red
"
>*<
/i></
label
>
<
div
class
=
"
layui-input-block
"
>
<
select
lay
-
filter
=
"
showType
"
lay
-
search
=
""
id
=
"
showType
"
win
-
verify
=
"
required
"
>
<
/select
>
<
/div
>
<
/div
>
<
div
class
=
"
layui-form-item layui-col-xs12
"
>
<
label
class
=
"
layui-form-label
"
>
HTML脚本
<
i
class
=
"
red
"
>*<
/i></
label
>
<
div
class
=
"
layui-input-block
"
>
...
...
dsform/src/main/resources/template/tpl/dsFormObjectRelation/dsFormObjectRelationEdit.html
浏览文件 @
365c450d
...
...
@@ -87,7 +87,7 @@
<
input
type
=
"
text
"
id
=
"
{{dsFormChooseList}}
"
name
=
"
{{dsFormChooseList}}
"
placeholder
=
"
请选择表单
"
class
=
"
layui-input
"
win
-
verify
=
"
required
"
readonly
=
"
readonly
"
/>
<
i
class
=
"
fa fa-plus-circle input-icon
"
id
=
"
{{dsFormChooseList}}Btn
"
style
=
"
top: 12px;
"
><
/i
>
<
/td
>
<
td
id
=
"
{{
pageN
ame}}
"
><
/td
>
<
td
id
=
"
{{
n
ame}}
"
><
/td
>
<
/tr
>
</script>
...
...
erp/src/main/resources/template/js/purchaseOrder/purchaseOrderEdit.js
浏览文件 @
365c450d
...
...
@@ -78,9 +78,9 @@ layui.config({
initTableChooseUtil
.
deleteAllRow
(
'
productList
'
);
$
.
each
(
json
.
bean
.
norms
,
function
(
i
,
item
)
{
var
params
=
{
"
materialId
"
:
item
.
product
.
materialName
+
"
(
"
+
item
.
product
.
materialModel
+
"
)
"
,
"
materialId
"
:
item
.
materialName
+
"
(
"
+
item
.
materialModel
+
"
)
"
,
"
mUnitId
"
:
{
"
html
"
:
getDataUseHandlebars
(
selOption
,
{
rows
:
item
.
product
.
unitList
}),
"
html
"
:
getDataUseHandlebars
(
selOption
,
{
rows
:
item
.
unitList
}),
"
value
"
:
item
.
mUnitId
},
"
allStock
"
:
item
.
allStock
,
...
...
@@ -95,7 +95,7 @@ layui.config({
};
var
trcusid
=
initTableChooseUtil
.
resetData
(
'
productList
'
,
params
);
// 将规格所属的商品信息加入到对象中存储
allChooseProduct
[
trcusid
]
=
item
.
product
;
allChooseProduct
[
trcusid
]
=
item
;
});
textool
.
init
({
eleId
:
'
remark
'
,
maxlength
:
200
});
...
...
web/src/main/resources/template/assets/lib/layui/customer/skyeye/dsFormUtil.js
浏览文件 @
365c450d
...
...
@@ -9,6 +9,7 @@ var dsFormUtil = {
dsFormDataKey
:
"
initData
"
,
dsFormBtnTemplate
:
'
<button type="button" class="layui-btn layui-btn-primary layui-btn-xs" id="{{btnId}}">表单选择</button>
'
,
customDsFormBox
:
'
<div class="layui-form-item layui-col-xs12"><span class="hr-title">{{dsFormPage.name}}</span><hr></div><div id="{{dsFormPage.id}}" class="ds-form-page layui-col-xs12"></div>
'
,
customWriteDsFormBox
:
'
<div class="layui-form-item layui-col-xs12"><span class="hr-title">{{name}}</span><hr></div><div id="{{id}}" class="ds-form-page layui-col-xs12"></div>
'
,
// 必须包含的包
mastHaveImport
:
[
'
laydate
'
,
'
layedit
'
,
'
colorpicker
'
,
'
slider
'
,
'
fileUpload
'
,
'
codemirror
'
,
'
xml
'
,
'
clike
'
,
'
css
'
,
'
htmlmixed
'
,
'
javascript
'
,
'
nginx
'
,
'
solr
'
,
'
sql
'
,
'
vue
'
,
'
matchbrackets
'
,
'
closebrackets
'
,
'
showHint
'
,
'
anywordHint
'
,
'
lint
'
,
'
jsonLint
'
,
'
foldcode
'
,
'
foldgutter
'
,
'
braceFold
'
,
'
commentFold
'
,
'
form
'
],
...
...
@@ -97,90 +98,116 @@ var dsFormUtil = {
dsFormObjectRelationId
:
isNull
(
dsFormObjectRelationId
)
?
""
:
dsFormObjectRelationId
};
AjaxPostUtil
.
request
({
url
:
reqBasePath
+
"
dsFormObjectRelation006
"
,
params
:
params
,
method
:
"
GET
"
,
type
:
'
json
'
,
callback
:
function
(
json
)
{
dsFormUtil
.
loadDsFormItem
(
showBoxId
,
json
);
dsFormUtil
.
load
Add
DsFormItem
(
showBoxId
,
json
);
},
async
:
false
});
},
loadDsFormItem
:
function
(
showBoxId
,
json
)
{
$
.
each
(
json
.
rows
,
function
(
j
,
bean
){
var
customBoxId
=
bean
.
dsFormPage
.
id
;
$
(
"
#
"
+
showBoxId
).
append
(
getDataUseHandlebars
(
dsFormUtil
.
customDsFormBox
,
bean
));
dsFormUtil
.
loadDsFormItemToEdit
(
customBoxId
,
bean
.
content
);
loadAddDsFormItem
:
function
(
showBoxId
,
json
)
{
$
.
each
(
json
.
rows
,
function
(
j
,
bean
)
{
var
customBoxId
=
bean
.
id
;
$
(
"
#
"
+
showBoxId
).
append
(
getDataUseHandlebars
(
dsFormUtil
.
customWriteDsFormBox
,
bean
));
dsFormUtil
.
loadDsFormItemToAdd
(
customBoxId
,
bean
.
content
);
});
form
.
render
();
},
loadDsFormItemToAdd
:
function
(
customBoxId
,
rows
)
{
$
.
each
(
rows
,
function
(
i
,
item
)
{
item
.
value
=
item
.
defaultValue
;
dsFormUtil
.
setValue
(
customBoxId
,
item
,
i
);
});
},
loadEditDsFormItem
:
function
(
showBoxId
,
json
)
{
$
.
each
(
json
.
rows
,
function
(
j
,
bean
)
{
var
customBoxId
=
bean
.
pageId
;
$
(
"
#
"
+
showBoxId
).
append
(
getDataUseHandlebars
(
dsFormUtil
.
customWriteDsFormBox
,
bean
.
dsFormPage
));
dsFormUtil
.
loadDsFormItemToEdit
(
customBoxId
,
bean
.
dsFormPageDataList
);
});
form
.
render
();
},
loadDsFormItemToEdit
:
function
(
customBoxId
,
rows
)
{
$
.
each
(
rows
,
function
(
i
,
item
)
{
if
(
item
.
associatedDataTypes
==
1
)
{
//json串
var
obj
=
item
.
aData
;
if
(
typeof
item
.
aData
==
'
string
'
){
obj
=
JSON
.
parse
(
item
.
aData
);
}
item
.
context
=
getDataUseHandlebars
(
item
.
templateContent
,
obj
);
}
else
if
(
item
.
associatedDataTypes
==
2
)
{
//接口
AjaxPostUtil
.
request
({
url
:
flowableBasePath
+
"
dsformpage011
"
,
params
:
{
interfa
:
item
.
aData
},
type
:
'
json
'
,
callback
:
function
(
j
)
{
var
obj
=
JSON
.
parse
(
j
.
bean
.
aData
)
;
item
.
context
=
getDataUseHandlebars
(
item
.
templateContent
,
obj
);
},
async
:
false
}
);
var
pageComponent
=
item
.
dsFormPageContent
;
pageComponent
.
value
=
item
.
value
;
dsFormUtil
.
setValue
(
customBoxId
,
pageComponent
,
i
);
}
);
},
setValue
:
function
(
customBoxId
,
item
,
i
)
{
if
(
item
.
associatedDataTypes
==
1
)
{
//json串
var
obj
=
item
.
aData
;
if
(
typeof
item
.
aData
==
'
string
'
){
obj
=
JSON
.
parse
(
item
.
aData
);
}
var
jsonStr
=
{
bean
:
item
};
var
html
=
getDataUseHandlebars
(
'
{{#bean}}
'
+
item
.
htmlContent
+
'
{{/bean}}
'
,
jsonStr
);
var
html_js
=
getDataUseHandlebars
(
'
{{#bean}}
'
+
item
.
jsContent
+
'
{{/bean}}
'
,
jsonStr
);
var
jsCon
=
'
<script>layui.define(["jquery"], function(exports) {var jQuery = layui.jquery;(function($) {
'
+
html_js
+
'
})(jQuery);});</script>
'
;
$
(
"
#
"
+
customBoxId
).
append
(
html
+
jsCon
);
item
.
context
=
getDataUseHandlebars
(
item
.
dsFormComponent
.
templateContent
,
obj
);
}
else
if
(
item
.
associatedDataTypes
==
2
)
{
//接口
AjaxPostUtil
.
request
({
url
:
flowableBasePath
+
"
dsformpage011
"
,
params
:
{
interfa
:
item
.
aData
},
type
:
'
json
'
,
callback
:
function
(
j
)
{
var
obj
=
JSON
.
parse
(
j
.
bean
.
aData
);
item
.
context
=
getDataUseHandlebars
(
item
.
dsFormComponent
.
templateContent
,
obj
);
},
async
:
false
});
}
var
jsonStr
=
{
bean
:
item
};
var
html
=
getDataUseHandlebars
(
'
{{#bean}}
'
+
item
.
dsFormComponent
.
htmlContent
+
'
{{/bean}}
'
,
jsonStr
);
var
html_js
=
getDataUseHandlebars
(
'
{{#bean}}
'
+
item
.
dsFormComponent
.
jsContent
+
'
{{/bean}}
'
,
jsonStr
);
var
jsCon
=
'
<script>layui.define(["jquery"], function(exports) {var jQuery = layui.jquery;(function($) {
'
+
html_js
+
'
})(jQuery);});</script>
'
;
$
(
"
#
"
+
customBoxId
).
append
(
html
+
jsCon
);
// 给能通过id赋值的控件赋值
$
(
"
#
"
+
item
.
id
).
val
(
item
.
value
);
var
_this
=
$
(
"
#
"
+
customBoxId
+
"
.layui-form-item
"
).
eq
(
i
);
//当前控件
if
(
!
isNull
(
item
.
require
)
&&
item
.
require
.
indexOf
(
"
required
"
)
>=
0
){
_this
.
find
(
"
.layui-form-label
"
).
append
(
'
<i class="red">*</i>
'
);
// 给能通过id赋值的控件赋值
$
(
"
#
"
+
item
.
id
).
val
(
item
.
value
);
var
_this
=
$
(
"
#
"
+
customBoxId
+
"
.layui-form-item
"
).
eq
(
i
);
if
(
!
isNull
(
item
.
require
)
&&
item
.
require
.
indexOf
(
"
required
"
)
>=
0
){
_this
.
find
(
"
.layui-form-label
"
).
append
(
'
<i class="red">*</i>
'
);
}
_this
.
attr
(
"
controId
"
,
item
.
id
);
var
vid
=
_this
.
attr
(
"
controlType
"
);
//控件类型
if
(
vid
===
'
color
'
)
{
//类型为颜色选择器
_this
.
find
(
"
input
"
).
val
(
item
.
value
);
_this
.
find
(
'
div[id="
'
+
item
.
id
+
'
"]
'
).
find
(
"
span .layui-colorpicker-trigger-span
"
).
attr
(
"
style
"
,
"
background:
"
+
item
.
value
);
}
else
if
(
vid
===
'
switchedradio
'
)
{
//类型为开关式单选框
_this
.
find
(
"
input
"
).
val
(
item
.
value
);
if
(
item
.
value
===
'
true
'
||
item
.
value
==
true
)
{
_this
.
find
(
"
input
"
).
prop
(
"
checked
"
,
true
);
}
_this
.
attr
(
"
controId
"
,
item
.
id
);
var
vid
=
_this
.
attr
(
"
controlType
"
);
//控件类型
if
(
vid
===
'
color
'
)
{
//类型为颜色选择器
_this
.
find
(
"
input
"
).
val
(
item
.
value
);
_this
.
find
(
'
div[id="
'
+
item
.
id
+
'
"]
'
).
find
(
"
span .layui-colorpicker-trigger-span
"
).
attr
(
"
style
"
,
"
background:
"
+
item
.
value
);
}
else
if
(
vid
===
'
switchedradio
'
)
{
//类型为开关式单选框
_this
.
find
(
"
input
"
).
val
(
item
.
value
);
if
(
item
.
value
===
'
true
'
||
item
.
value
==
true
)
{
_this
.
find
(
"
input
"
).
prop
(
"
checked
"
,
true
);
}
_this
.
find
(
"
input
"
).
attr
(
'
id
'
,
item
.
id
);
_this
.
find
(
"
input
"
).
attr
(
'
name
'
,
item
.
id
);
_this
.
find
(
"
input
"
).
attr
(
'
lay-filter
'
,
item
.
id
);
}
else
if
(
vid
===
'
radio
'
)
{
//类型为单选框
_this
.
find
(
"
input:radio
"
).
attr
(
"
name
"
,
item
.
id
);
if
(
!
isNull
(
item
.
value
))
_this
.
find
(
"
input:radio[value=
"
+
item
.
value
+
"
]
"
).
attr
(
"
checked
"
,
true
);
}
else
if
(
vid
===
'
richtextarea
'
)
{
//类型为富文本框
_this
.
find
(
'
iframe[textarea="
'
+
item
.
id
+
'
"]
'
).
contents
().
find
(
"
body
"
).
html
(
item
.
value
);
}
else
if
(
vid
===
'
checkbox
'
)
{
//类型为多选框
var
checkArray
=
item
.
value
.
split
(
"
,
"
);
var
checkBoxAll
=
_this
.
find
(
"
input:checkbox
"
);
checkBoxAll
.
attr
(
"
name
"
,
item
.
id
);
for
(
var
k
=
0
;
k
<
checkArray
.
length
;
k
++
)
{
$
.
each
(
checkBoxAll
,
function
(
j
,
item
)
{
if
(
checkArray
[
k
]
==
$
(
this
).
val
())
{
$
(
this
).
prop
(
"
checked
"
,
true
);
}
});
}
_this
.
find
(
"
input
"
).
attr
(
'
id
'
,
item
.
id
);
_this
.
find
(
"
input
"
).
attr
(
'
name
'
,
item
.
id
);
_this
.
find
(
"
input
"
).
attr
(
'
lay-filter
'
,
item
.
id
);
}
else
if
(
vid
===
'
radio
'
)
{
//类型为单选框
_this
.
find
(
"
input:radio
"
).
attr
(
"
name
"
,
item
.
id
);
if
(
!
isNull
(
item
.
value
))
_this
.
find
(
"
input:radio[value=
"
+
item
.
value
+
"
]
"
).
attr
(
"
checked
"
,
true
);
}
else
if
(
vid
===
'
richtextarea
'
)
{
//类型为富文本框
_this
.
find
(
'
iframe[textarea="
'
+
item
.
id
+
'
"]
'
).
contents
().
find
(
"
body
"
).
html
(
item
.
value
);
}
else
if
(
vid
===
'
checkbox
'
)
{
//类型为多选框
var
checkArray
=
item
.
value
.
split
(
"
,
"
);
var
checkBoxAll
=
_this
.
find
(
"
input:checkbox
"
);
checkBoxAll
.
attr
(
"
name
"
,
item
.
id
);
for
(
var
k
=
0
;
k
<
checkArray
.
length
;
k
++
)
{
$
.
each
(
checkBoxAll
,
function
(
j
,
item
)
{
if
(
checkArray
[
k
]
==
$
(
this
).
val
())
{
$
(
this
).
prop
(
"
checked
"
,
true
);
}
});
}
}
);
}
},
/**
* 获取保存的数据
*/
savePageData
:
function
(
showBoxId
,
objectId
)
{
var
result
=
{}
;
var
result
=
[]
;
$
.
each
(
$
(
"
#
"
+
showBoxId
+
"
.ds-form-page
"
),
function
(
i
,
item
)
{
var
_item
=
$
(
item
);
result
[
_item
.
attr
(
"
id
"
)]
=
dsFormUtil
.
getPageData
(
_item
);
result
.
push
({
pageId
:
_item
.
attr
(
"
id
"
),
dsFormPageDataList
:
dsFormUtil
.
getPageData
(
_item
)
});
});
var
params
=
{
d
ataJson
:
JSON
.
stringify
(
result
),
d
sFormPageSequenceList
:
JSON
.
stringify
(
result
),
objectId
:
objectId
}
AjaxPostUtil
.
request
({
url
:
flowableBasePath
+
"
dsformpage014
"
,
params
:
params
,
type
:
'
json
'
,
method
:
"
POST
"
,
callback
:
function
(
json
)
{
...
...
@@ -192,18 +219,16 @@ var dsFormUtil = {
for
(
var
i
=
0
;
i
<
_item
.
find
(
"
.layui-form-item
"
).
length
;
i
++
){
var
_this
=
_item
.
find
(
"
.layui-form-item
"
).
eq
(
i
);
var
vid
=
_this
.
attr
(
"
controlType
"
),
//控件类型
showType
=
""
,
text
=
""
,
value
=
""
;
text
=
""
,
value
=
""
;
if
(
isNull
(
vid
))
{
continue
;
}
if
(
vid
===
'
textarea
'
)
{
//类型为文本框
text
=
_this
.
find
(
"
textarea
"
).
val
();
value
=
_this
.
find
(
"
textarea
"
).
val
();
showType
=
"
1
"
;
}
else
if
(
vid
===
'
select
'
)
{
//类型为下拉框
text
=
_this
.
find
(
"
select
"
).
find
(
"
option:selected
"
).
text
();
value
=
_this
.
find
(
"
select
"
).
val
();
showType
=
"
1
"
;
}
else
if
(
vid
===
'
checkbox
'
)
{
//类型为多选框
var
checkName
=
_this
.
find
(
"
input:first
"
).
attr
(
"
name
"
);
var
texts
=
[],
values
=
[];
...
...
@@ -214,11 +239,9 @@ var dsFormUtil = {
});
text
=
texts
.
join
(
"
,
"
);
value
=
values
.
join
(
"
,
"
);
showType
=
"
1
"
;
}
else
if
(
vid
===
'
radio
'
)
{
//类型为单选框
text
=
_this
.
find
(
"
input:radio:checked
"
).
attr
(
"
title
"
);
value
=
_this
.
find
(
"
input:radio:checked
"
).
val
();
showType
=
"
1
"
;
}
else
if
(
vid
===
'
upload
'
)
{
//类型为图片上传
var
uploadId
=
_this
.
find
(
"
.upload
"
).
attr
(
"
id
"
);
text
=
$
(
"
#
"
+
uploadId
).
find
(
"
input[type='hidden'][name='upload']
"
).
attr
(
"
oldurl
"
);
...
...
@@ -227,17 +250,14 @@ var dsFormUtil = {
text
=
""
;
if
(
isNull
(
value
))
value
=
""
;
showType
=
"
4
"
;
}
else
if
(
vid
===
'
range
'
)
{
//类型为滑块
text
=
_this
.
find
(
"
.layui-slider-tips
"
).
html
();
value
=
_this
.
find
(
"
.layui-slider-tips
"
).
html
();
showType
=
"
1
"
;
}
else
if
(
vid
===
'
richtextarea
'
)
{
//类型为富文本框
var
textareaId
=
_this
.
find
(
"
textarea
"
).
attr
(
"
id
"
);
var
content
=
encodeURIComponent
(
_this
.
find
(
'
iframe[textarea="
'
+
textareaId
+
'
"]
'
).
contents
().
find
(
"
body
"
).
html
());
text
=
content
;
value
=
content
;
showType
=
"
3
"
;
}
else
if
(
vid
===
'
switchedradio
'
)
{
//类型为开关式单选框
value
=
_this
.
find
(
"
input
"
).
val
();
var
layText
=
_this
.
find
(
"
input
"
).
attr
(
'
lay-text
'
);
...
...
@@ -246,18 +266,14 @@ var dsFormUtil = {
}
else
{
text
=
layText
.
split
(
'
|
'
)[
1
];
}
showType
=
"
1
"
;
}
else
{
text
=
_this
.
find
(
"
input
"
).
val
();
value
=
_this
.
find
(
"
input
"
).
val
();
showType
=
"
1
"
;
}
list
.
push
({
value
:
value
,
text
:
text
,
showType
:
showType
,
controlType
:
vid
,
rowId
:
_this
.
attr
(
"
controId
"
)
displayValue
:
text
,
contentId
:
_this
.
attr
(
"
controId
"
)
});
}
return
list
;
...
...
@@ -274,11 +290,64 @@ var dsFormUtil = {
$
.
each
(
json
.
rows
,
function
(
j
,
bean
)
{
var
customBoxId
=
bean
.
dsFormPage
.
id
;
$
(
"
#
"
+
showBoxId
).
append
(
getDataUseHandlebars
(
dsFormUtil
.
customDsFormBox
,
bean
));
dsFormUtil
.
initSequence
DataDetails
(
customBoxId
,
bean
.
conten
t
);
dsFormUtil
.
initSequence
PageDataDetails
(
customBoxId
,
bean
.
dsFormPageDataLis
t
);
});
},
async
:
false
});
},
/**
* 表单布局的详情展示
*
* @param customBoxId
* @param rows
*/
initSequencePageDataDetails
:
function
(
customBoxId
,
rows
)
{
$
.
each
(
rows
,
function
(
i
,
item
)
{
item
.
label
=
item
.
dsFormPageContent
.
title
;
item
.
proportion
=
item
.
dsFormPageContent
.
width
;
var
jsonStr
=
{
bean
:
item
};
var
showType
=
item
.
dsFormPageContent
.
dsFormComponent
.
showType
;
if
(
showType
==
4
)
{
// 图片展示
var
photoValue
=
[];
if
(
!
isNull
(
jsonStr
.
bean
.
displayValue
))
{
photoValue
=
item
.
displayValue
.
split
(
"
,
"
);
}
var
rows
=
[];
$
.
each
(
photoValue
,
function
(
j
,
row
){
rows
.
push
({
photoValue
:
row
});
});
jsonStr
.
bean
.
photo
=
rows
;
}
// 加载html
var
str
=
getDataUseHandlebars
(
dsFormUtil
.
showType
[
showType
],
jsonStr
);
$
(
"
#
"
+
customBoxId
).
append
(
str
);
if
(
showType
==
5
)
{
// 表格展示
var
table
=
layui
.
table
;
table
.
render
({
id
:
"
messageTable
"
+
item
.
orderBy
,
elem
:
"
#messageTable
"
+
item
.
orderBy
,
data
:
item
.
displayValue
,
page
:
false
,
cols
:
dsFormUtil
.
getTableHead
(
item
.
attrTransformTableList
)
});
}
else
if
(
showType
==
6
)
{
// 凭证展示
var
boxId
=
"
showVoucher
"
+
item
.
orderBy
;
// 初始化凭证
voucherUtil
.
initDataDetails
(
boxId
,
item
.
value
);
}
});
},
/**
* 目前用于工作流详情展示
*
* @param customBoxId
* @param rows
*/
initSequenceDataDetails
:
function
(
customBoxId
,
rows
)
{
$
.
each
(
rows
,
function
(
i
,
item
)
{
var
jsonStr
=
{
...
...
@@ -286,7 +355,7 @@ var dsFormUtil = {
};
if
(
item
.
showType
==
4
)
{
// 图片展示
var
photoValue
=
[];
if
(
!
isNull
(
jsonStr
.
bean
.
displayValue
)){
if
(
!
isNull
(
jsonStr
.
bean
.
displayValue
))
{
photoValue
=
item
.
displayValue
.
split
(
"
,
"
);
}
var
rows
=
[];
...
...
@@ -343,7 +412,7 @@ var dsFormUtil = {
*/
loadPageToEditByObjectId
:
function
(
showBoxId
,
objectId
)
{
AjaxPostUtil
.
request
({
url
:
flowableBasePath
+
"
dsformpage015
"
,
params
:
{
objectId
:
objectId
},
method
:
"
GET
"
,
type
:
'
json
'
,
callback
:
function
(
json
)
{
dsFormUtil
.
loadDsFormItem
(
showBoxId
,
json
);
dsFormUtil
.
load
Edit
DsFormItem
(
showBoxId
,
json
);
},
async
:
false
});
},
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录