Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
Skyeye云
Skyeye
提交
5a3c8602
S
Skyeye
项目概览
Skyeye云
/
Skyeye
通知
1431
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看板
提交
5a3c8602
编写于
2月 17, 2023
作者:
Skyeye云
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
表单布局编辑布局完成
上级
bcf0b6a6
变更
2
隐藏空白更改
内联
并排
Showing
2 changed file
with
42 addition
and
20 deletion
+42
-20
common/src/main/resources/template/js/dsFormPage/pageShow.js
common/src/main/resources/template/js/dsFormPage/pageShow.js
+16
-2
web/src/main/resources/template/assets/lib/layui/customer/skyeye/dsFormUtil.js
...s/template/assets/lib/layui/customer/skyeye/dsFormUtil.js
+26
-18
未找到文件。
common/src/main/resources/template/js/dsFormPage/pageShow.js
浏览文件 @
5a3c8602
...
...
@@ -26,7 +26,7 @@ layui.config({
}});
var
pageHtml
=
{
'
create
'
:
`<div style="margin:0 auto;padding:20px;">
'
create
OrEdit
'
:
`<div style="margin:0 auto;padding:20px;">
<form class="layui-form" action="" id="showForm" autocomplete="off">
<div id="content"></div>
<div class="layui-form-item layui-col-xs12">
...
...
@@ -55,7 +55,12 @@ layui.config({
// 初始化加载
function
init
()
{
console
.
log
(
pageMation
);
var
html
=
pageHtml
[
pageMation
.
type
];
var
html
;
if
(
pageMation
.
type
==
'
create
'
||
pageMation
.
type
==
'
edit
'
)
{
html
=
pageHtml
[
'
createOrEdit
'
];
}
else
{
html
=
pageHtml
[
pageMation
.
type
];
}
$
(
"
body
"
).
append
(
html
);
// 加载页面
...
...
@@ -66,6 +71,15 @@ layui.config({
if
(
pageMation
.
type
==
'
create
'
)
{
// 创建布局
dsFormUtil
.
initCreatePage
(
'
content
'
,
pageMation
);
}
else
if
(
pageMation
.
type
==
'
edit
'
)
{
// 编辑布局
var
params
=
{
objectId
:
GetUrlParam
(
"
id
"
),
objectKey
:
pageMation
.
className
};
AjaxPostUtil
.
request
({
url
:
reqBasePath
+
"
queryBusinessDataByObject
"
,
params
:
params
,
type
:
'
json
'
,
method
:
'
POST
'
,
callback
:
function
(
json
)
{
dsFormUtil
.
initEditPage
(
'
content
'
,
pageMation
,
json
.
bean
);
}});
}
else
if
(
pageMation
.
type
==
'
simpleTable
'
)
{
// 基本表格
dsFormTableUtil
.
initDynamicTable
(
'
messageTable
'
,
pageMation
);
...
...
web/src/main/resources/template/assets/lib/layui/customer/skyeye/dsFormUtil.js
浏览文件 @
5a3c8602
...
...
@@ -46,6 +46,28 @@ var dsFormUtil = {
// todo 待删除
},
/**
* 加载动态表单(编辑操作)
*
* @param showBoxId
* @param pageMation
* @param data
*/
initEditPage
:
function
(
showBoxId
,
pageMation
,
data
)
{
dsFormUtil
.
initCreatePage
(
showBoxId
,
pageMation
);
$
.
each
(
dsFormUtil
.
pageMation
.
dsFormPageContents
,
function
(
i
,
content
)
{
if
(
!
isNull
(
content
.
attrDefinition
))
{
// 获取组件中设置值的脚本
var
dsFormComponent
=
content
.
dsFormComponent
;
var
setValueScript
=
getDataUseHandlebars
(
'
{{#this}}
'
+
dsFormComponent
.
jsFitValue
+
'
{{/this}}
'
,
content
);
// value参数不能删除,用于组件的赋值脚本使用
var
value
=
data
[
content
.
attrDefinition
.
attrKey
];
eval
(
setValueScript
);
}
});
layui
.
form
.
render
();
},
/**
* 加载动态表单(新增操作)
*
...
...
@@ -85,6 +107,10 @@ var dsFormUtil = {
params
[
content
.
attrDefinition
.
attrKey
]
=
value
;
}
});
if
(
dsFormUtil
.
pageMation
.
type
==
'
edit
'
)
{
// 编辑布局
params
[
"
id
"
]
=
GetUrlParam
(
"
id
"
);
}
// 发送请求
dsFormUtil
.
sendRequest
({
businessApi
:
dsFormUtil
.
pageMation
.
businessApi
,
...
...
@@ -99,24 +125,6 @@ var dsFormUtil = {
}
return
false
;
});
},
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
)
{
var
pageComponent
=
item
.
dsFormPageContent
;
pageComponent
.
value
=
item
.
value
;
dsFormUtil
.
setValue
(
customBoxId
,
pageComponent
,
i
);
});
},
/**
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录