提交 9a065cee 编写于 作者: doc_wei's avatar doc_wei

动态表单数据展示模板功能整改完成

上级 d94b21bd
......@@ -3,18 +3,20 @@ layui.config({
version: skyeyeVersion
}).extend({
window: 'js/winui.window'
}).define(['window', 'jquery', 'winui'], function (exports) {
}).define(['window', 'jquery', 'winui', 'element'], function (exports) {
winui.renderColor();
layui.use(['form', 'codemirror', 'xml', 'clike', 'css', 'htmlmixed', 'javascript', 'nginx', 'solr', 'sql', 'vue'], function (form) {
var index = parent.layer.getFrameIndex(window.name);
var $ = layui.$,
element = layui.element,
form = layui.form;
// 根据类型获取部分功能的使用说明
systemCommonUtil.queryExplainMationByType(3, function (json) {
$("#exexplaintodsformdisplaytemplateTitle").html(json.bean.title);
$("#exexplaintodsformdisplaytemplateContent").html(json.bean.content);
$(".layui-colla-title").html(json.bean.title);
$(".layui-colla-content").html(json.bean.content);
});
element.init();
var templateContent = CodeMirror.fromTextArea(document.getElementById("templateContent"), {
mode : "xml", // 模式
......@@ -35,9 +37,9 @@ layui.config({
if (winui.verifyForm(data.elem)) {
var params = {
templateName: $("#templateName").val(),
templateContent: encodeURI(templateContent.getValue().replace(/\+/g, "%2B").replace(/\&/g, "%26"))
templateContent: encodeURIComponent(templateContent.getValue())
};
AjaxPostUtil.request({url: flowableBasePath + "dsformdisplaytemplate002", params: params, type: 'json', callback: function (json) {
AjaxPostUtil.request({url: flowableBasePath + "writeDsFormDisplayTemplate", params: params, type: 'json', method: 'POST', callback: function (json) {
parent.layer.close(index);
parent.refreshCode = '0';
}});
......
......@@ -3,19 +3,21 @@ layui.config({
version: skyeyeVersion
}).extend({
window: 'js/winui.window'
}).define(['window', 'jquery', 'winui'], function (exports) {
}).define(['window', 'jquery', 'winui', 'element'], function (exports) {
winui.renderColor();
layui.use(['form', 'codemirror', 'xml', 'clike', 'css', 'htmlmixed', 'javascript', 'nginx', 'solr', 'sql', 'vue'], function (form) {
var index = parent.layer.getFrameIndex(window.name);
var $ = layui.$,
element = layui.element,
form = layui.form;
showGrid({
id: "showForm",
url: flowableBasePath + "dsformdisplaytemplate004",
params: {rowId: parent.rowId},
params: {id: parent.rowId},
pagination: false,
template: getFileContent('tpl/dsformdisplaytemplate/dsformdisplaytemplateeditTemplate.tpl'),
method: 'GET',
template: getFileContent('tpl/dsFormDisplayTemplate/dsFormDisplayTemplateEditTemplate.tpl'),
ajaxSendLoadBefore: function(hdb) {
},
ajaxSendAfter:function (json) {
......@@ -35,20 +37,22 @@ layui.config({
matchingLanguage();
form.render();
// 根据类型获取部分功能的使用说明
systemCommonUtil.queryExplainMationByType(3, function (json) {
$("#exexplaintodsformdisplaytemplateTitle").html(json.bean.title);
$("#exexplaintodsformdisplaytemplateContent").html(json.bean.content);
$(".layui-colla-title").html(json.bean.title);
$(".layui-colla-content").html(json.bean.content);
});
element.init();
form.on('submit(formEditBean)', function (data) {
if (winui.verifyForm(data.elem)) {
var params = {
templateName: $("#templateName").val(),
templateContent: encodeURI(templateContent.getValue().replace(/\+/g, "%2B").replace(/\&/g, "%26")),
rowId:parent.rowId
templateContent: encodeURIComponent(templateContent.getValue()),
id: parent.rowId
};
AjaxPostUtil.request({url: flowableBasePath + "dsformdisplaytemplate005", params: params, type: 'json', callback: function (json) {
AjaxPostUtil.request({url: flowableBasePath + "writeDsFormDisplayTemplate", params: params, type: 'json', method: 'POST', callback: function (json) {
parent.layer.close(index);
parent.refreshCode = '0';
}});
......
......@@ -39,20 +39,23 @@ layui.config({
limit: getLimit(),
cols: [[
{ title: systemLanguage["com.skyeye.serialNumber"][languageType], type: 'numbers' },
{ field: 'templateName', title: '模板标题', width: 180 },
{ field: 'id', title: '模板内容', align: 'center', width: 80, templet: function (d) {
{ field: 'templateName', title: '标题', width: 180 },
{ field: 'id', title: '脚本', align: 'center', width: 80, templet: function (d) {
if (!isNull(d.templateContent)) {
return '<i class="fa fa-fw fa-html5 cursor" lay-event="templateContent"></i>';
} else {
return '';
}
}},
{ field: 'createTime', title: systemLanguage["com.skyeye.createTime"][languageType], align: 'center', width: 150 },
{ title: systemLanguage["com.skyeye.operation"][languageType], fixed: 'right', align: 'center', width: 240, toolbar: '#tableBar'}
{ field: 'createName', title: systemLanguage["com.skyeye.createName"][languageType], width: 120 },
{ field: 'createTime', title: systemLanguage["com.skyeye.createTime"][languageType], align: 'center', width: 150 },
{ field: 'lastUpdateName', title: systemLanguage["com.skyeye.lastUpdateName"][languageType], align: 'left', width: 120 },
{ field: 'lastUpdateTime', title: systemLanguage["com.skyeye.lastUpdateTime"][languageType], align: 'center', width: 150 },
{ title: systemLanguage["com.skyeye.operation"][languageType], fixed: 'right', align: 'center', width: 120, toolbar: '#tableBar'}
]],
done: function(json) {
matchingLanguage();
initTableSearchUtil.initAdvancedSearch(this, json.searchFilter, form, "请输入模板标题", function () {
initTableSearchUtil.initAdvancedSearch(this, json.searchFilter, form, "请输入标题", function () {
table.reloadData("messageTable", {page: {curr: 1}, where: getTableParams()});
});
}
......@@ -65,12 +68,12 @@ layui.config({
del(data, obj);
} else if (layEvent === 'edit') { //编辑
edit(data);
} else if (layEvent === 'templateContent') { //模板内容
} else if (layEvent === 'templateContent') { // 模板内容
editor.setValue(data.templateContent);
layer.open({
id: '模板内容',
type: 1,
title: '模板内容',
title: '脚本内容',
shade: 0.3,
area: ['90vw', '90vh'],
content: $("#modelContentDiv").html(),
......@@ -82,7 +85,7 @@ layui.config({
function del(data, obj) {
layer.confirm(systemLanguage["com.skyeye.deleteOperationMsg"][languageType], {icon: 3, title: systemLanguage["com.skyeye.deleteOperation"][languageType]}, function (index) {
layer.close(index);
AjaxPostUtil.request({url: flowableBasePath + "dsformdisplaytemplate003", params: {rowId: data.id}, type: 'json', callback: function (json) {
AjaxPostUtil.request({url: flowableBasePath + "dsformdisplaytemplate003", params: {id: data.id}, type: 'json', method: 'DELETE', callback: function (json) {
winui.window.msg(systemLanguage["com.skyeye.deleteOperationSuccessMsg"][languageType], {icon: 1, time: 2000});
loadTable();
}});
......@@ -93,9 +96,9 @@ layui.config({
function edit(data) {
rowId = data.id;
_openNewWindows({
url: "../../tpl/dsformdisplaytemplate/dsformdisplaytemplateedit.html",
title: "编辑",
pageId: "dsformdisplaytemplateedit",
url: "../../tpl/dsFormDisplayTemplate/dsFormDisplayTemplateEdit.html",
title: systemLanguage["com.skyeye.editPageTitle"][languageType],
pageId: "dsFormDisplayTemplateEdit",
area: ['90vw', '90vh'],
callBack: function (refreshCode) {
winui.window.msg(systemLanguage["com.skyeye.successfulOperation"][languageType], {icon: 1, time: 2000});
......@@ -106,9 +109,9 @@ layui.config({
// 新增
$("body").on("click", "#addBean", function() {
_openNewWindows({
url: "../../tpl/dsformdisplaytemplate/dsformdisplaytemplateadd.html",
title: "新增",
pageId: "dsformdisplaytemplateadd",
url: "../../tpl/dsFormDisplayTemplate/dsFormDisplayTemplateAdd.html",
title: systemLanguage["com.skyeye.addPageTitle"][languageType],
pageId: "dsFormDisplayTemplateAdd",
area: ['90vw', '90vh'],
callBack: function (refreshCode) {
winui.window.msg(systemLanguage["com.skyeye.successfulOperation"][languageType], {icon: 1, time: 2000});
......@@ -129,5 +132,5 @@ layui.config({
return $.extend(true, {}, initTableSearchUtil.getSearchValue("messageTable"));
}
exports('dsformdisplaytemplatelist', {});
exports('dsFormDisplayTemplateList', {});
});
......@@ -50,6 +50,7 @@ layui.config({
url: flowableBasePath + "dsformdisplaytemplate006",
params: {},
pagination: false,
method: 'GET',
template: getFileContent('tpl/template/select-option.tpl'),
ajaxSendLoadBefore: function(hdb) {},
ajaxSendAfter:function (json) {
......
......@@ -112,18 +112,19 @@ layui.config({
function initDataShowTpl(id){
initDatatpl = true;
showGrid({
id: "dataShowTpl",
url: flowableBasePath + "dsformdisplaytemplate006",
params: {},
pagination: false,
template: getFileContent('tpl/template/select-option.tpl'),
ajaxSendLoadBefore: function(hdb) {},
ajaxSendAfter:function (json) {
$("#dataShowTpl").val(id);
form.render('select');
jsonStr = json.rows;
}
});
id: "dataShowTpl",
url: flowableBasePath + "dsformdisplaytemplate006",
params: {},
pagination: false,
method: 'GET',
template: getFileContent('tpl/template/select-option.tpl'),
ajaxSendLoadBefore: function(hdb) {},
ajaxSendAfter:function (json) {
$("#dataShowTpl").val(id);
form.render('select');
jsonStr = json.rows;
}
});
}
//数据展示模板监听事件
form.on('select(dataShowTpl)', function(data) {
......
......@@ -10,22 +10,25 @@
<body>
<div style="margin:0 auto;padding:20px;">
<form class="layui-form" action="" id="showForm" autocomplete="off">
<div class="layui-form-item layui-col-xs12">
<span class="hr-title" id="exexplaintodsformdisplaytemplateTitle"></span><hr>
<div class="layui-collapse">
<div class="layui-colla-item">
<h2 class="layui-colla-title"></h2>
<div class="layui-colla-content">
</div>
</div>
</div>
<div class="layui-form-item layui-col-xs12" id="exexplaintodsformdisplaytemplateContent" style="padding: 0px 15px; font-size: 12px; color: grey; display: contents;">
</div>
<div class="layui-form-item layui-col-xs12">
<span class="hr-title">模板内容</span><hr>
<span class="hr-title">数据模板</span><hr>
</div>
<div class="layui-form-item">
<label class="layui-form-label">模板标题<i class="red">*</i></label>
<label class="layui-form-label">标题<i class="red">*</i></label>
<div class="layui-input-block">
<input type="text" id="templateName" name="templateName" win-verify="required" placeholder="请输入模板标题" class="layui-input" maxlength="20"/>
<input type="text" id="templateName" name="templateName" win-verify="required" placeholder="请输入标题" class="layui-input" maxlength="20"/>
</div>
</div>
<div class="layui-form-item">
<label class="layui-form-label">模板内容<i class="red">*</i></label>
<label class="layui-form-label">脚本<i class="red">*</i></label>
<div class="layui-input-block">
<textarea id="templateContent" name="templateContent"></textarea>
</div>
......@@ -41,7 +44,7 @@
<script src="../../assets/lib/layui/layui.js"></script>
<script src="../../assets/lib/layui/custom.js"></script>
<script type="text/javascript">
layui.config({base: '../../js/dsformdisplaytemplate/'}).use('dsformdisplaytemplateadd');
layui.config({base: '../../js/dsFormDisplayTemplate/'}).use('dsFormDisplayTemplateAdd');
</script>
</body>
</html>
\ No newline at end of file
......@@ -16,7 +16,7 @@
<script src="../../assets/lib/layui/layui.js"></script>
<script src="../../assets/lib/layui/custom.js"></script>
<script type="text/javascript">
layui.config({base: '../../js/dsformdisplaytemplate/'}).use('dsformdisplaytemplateedit');
layui.config({base: '../../js/dsFormDisplayTemplate/'}).use('dsFormDisplayTemplateEdit');
</script>
</body>
</html>
\ No newline at end of file
{{#bean}}
<div class="layui-form-item layui-col-xs12">
<span class="hr-title" id="exexplaintodsformdisplaytemplateTitle"></span><hr>
</div>
<div class="layui-form-item layui-col-xs12" id="exexplaintodsformdisplaytemplateContent" style="padding: 0px 15px; font-size: 12px; color: grey; display: contents;">
<div class="layui-collapse">
<div class="layui-colla-item">
<h2 class="layui-colla-title"></h2>
<div class="layui-colla-content">
</div>
</div>
</div>
<div class="layui-form-item layui-col-xs12">
<span class="hr-title">模板内容</span><hr>
<span class="hr-title">数据模板</span><hr>
</div>
<div class="layui-form-item">
<label class="layui-form-label">模板标题<i class="red">*</i></label>
<label class="layui-form-label">标题<i class="red">*</i></label>
<div class="layui-input-block">
<input type="text" id="templateName" name="templateName" win-verify="required" placeholder="请输入模板标题" class="layui-input" maxlength="20" value="{{templateName}}"/>
<input type="text" id="templateName" name="templateName" win-verify="required" placeholder="请输入标题" class="layui-input" maxlength="20" value="{{templateName}}"/>
</div>
</div>
<div class="layui-form-item">
<label class="layui-form-label">模板内容<i class="red">*</i></label>
<label class="layui-form-label">脚本<i class="red">*</i></label>
<div class="layui-input-block">
<textarea id="templateContent" name="templateContent">{{templateContent}}</textarea>
</div>
......
......@@ -11,13 +11,13 @@
<div class="winui-toolbar">
<div class="winui-tool">
<button id="reloadTable" class="winui-toolbtn search-table-btn-right"><i class="fa fa-refresh" aria-hidden="true"></i><language showName="com.skyeye.refreshDataBtn"></language></button>
<button id="addBean" class="winui-toolbtn search-table-btn-right" auth="1560822829559"><i class="fa fa-plus" aria-hidden="true"></i>新增模板</button>
<button id="addBean" class="winui-toolbtn search-table-btn-right" auth="1560822829559"><i class="fa fa-plus" aria-hidden="true"></i><language showName="com.skyeye.addBtn"></language></button>
</div>
</div>
<div style="margin:auto 10px;">
<table id="messageTable" lay-filter="messageTable"></table>
<script type="text/html" id="tableBar">
{{# if(auth('1560822883717')){ }}
{{# if(auth('1560822829559')){ }}
<a class="layui-btn layui-btn-xs" lay-event="edit"><language showName="com.skyeye.editBtn"></language></a>
{{# } }}
{{# if(auth('1560822861808')){ }}
......@@ -33,7 +33,7 @@
<script src="../../assets/lib/layui/layui.js"></script>
<script src="../../assets/lib/layui/custom.js"></script>
<script type="text/javascript">
layui.config({base: '../../js/dsformdisplaytemplate/'}).use('dsformdisplaytemplatelist');
layui.config({base: '../../js/dsFormDisplayTemplate/'}).use('dsFormDisplayTemplateList');
</script>
</body>
</html>
\ No newline at end of file
......@@ -112,6 +112,7 @@ layui.config({
url: flowableBasePath + "dsformdisplaytemplate006",
params: {},
pagination: false,
method: 'GET',
template: getFileContent('tpl/template/select-option.tpl'),
ajaxSendLoadBefore: function(hdb) {
},
......
......@@ -96,6 +96,7 @@ layui.config({
url: flowableBasePath + "dsformdisplaytemplate006",
params: {},
pagination: false,
method: 'GET',
template: getFileContent('tpl/template/select-option.tpl'),
ajaxSendLoadBefore: function(hdb) {
},
......@@ -118,6 +119,7 @@ layui.config({
url: flowableBasePath + "dsformdisplaytemplate006",
params: {},
pagination: false,
method: 'GET',
template: getFileContent('tpl/template/select-option.tpl'),
ajaxSendLoadBefore: function(hdb) {
},
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册