提交 137d1db8 编写于 作者: doc_wei's avatar doc_wei

删除编码管理前端代码

上级 d1581258
layui.config({
base: basePath,
version: skyeyeVersion
}).extend({
window: 'js/winui.window'
}).define(['window', 'jquery', 'winui', 'textool', 'ruleCode'], function (exports) {
winui.renderColor();
layui.use(['form'], function (form) {
var index = parent.layer.getFrameIndex(window.name);
var $ = layui.$,
textool = layui.textool;
textool.init({eleId: 'remark', maxlength: 200});
winui.ruleCode.init({
id: "ruleBox"
}, null);
matchingLanguage();
form.render();
form.on('submit(formAddBean)', function (data) {
if (winui.verifyForm(data.elem) && winui.ruleCode.checkDataById("ruleBox")) {
var params = {
name: $("#name").val(),
codeNum: $("#codeNum").val(),
dictSort: $("#dictSort").val(),
alarm: $("input[name='alarm']:checked").val(),
remark: $("#remark").val(),
};
var rule = winui.ruleCode.getDataById("ruleBox");
params = $.extend(true, params, rule);
AjaxPostUtil.request({url: reqBasePath + "writeCodeRuleMation", params: params, type: 'json', method: "POST", callback: function (json) {
parent.layer.close(index);
parent.refreshCode = '0';
}});
}
return false;
});
$("body").on("click", "#cancle", function() {
parent.layer.close(index);
});
});
});
\ No newline at end of file
layui.config({
base: basePath,
version: skyeyeVersion
}).extend({
window: 'js/winui.window'
}).define(['window', 'jquery', 'winui', 'textool', 'ruleCode'], function (exports) {
winui.renderColor();
layui.use(['form'], function (form) {
var index = parent.layer.getFrameIndex(window.name);
var $ = layui.$,
textool = layui.textool;
showGrid({
id: "showForm",
url: reqBasePath + "queryCodeRuleMationById",
params: {id: parent.rowId},
pagination: false,
method: "GET",
template: $("#showTemplate").html(),
ajaxSendLoadBefore: function(hdb, json){
json.bean.remark = stringManipulation.textAreaShow(json.bean.remark);
},
ajaxSendAfter: function (json) {
winui.ruleCode.init({
id: "ruleBox"
}, json.bean);
$("input:radio[name=alarm][value=" + json.bean.alarm + "]").attr("checked", true);
textool.init({eleId: 'remark', maxlength: 200});
matchingLanguage();
form.render();
form.on('submit(formEditBean)', function (data) {
if (winui.verifyForm(data.elem)) {
var params = {
id: parent.rowId,
name: $("#name").val(),
codeNum: $("#codeNum").val(),
dictSort: $("#dictSort").val(),
alarm: $("input[name='alarm']:checked").val(),
remark: $("#remark").val(),
};
var rule = winui.ruleCode.getDataById("ruleBox");
params = $.extend(true, params, rule);
AjaxPostUtil.request({url: reqBasePath + "writeCodeRuleMation", params: params, type: 'json', method: "POST", callback: function (json) {
parent.layer.close(index);
parent.refreshCode = '0';
}});
}
return false;
});
}
});
$("body").on("click", "#cancle", function() {
parent.layer.close(index);
});
});
});
\ No newline at end of file
var rowId = "";
layui.config({
base: basePath,
version: skyeyeVersion
}).extend({
window: 'js/winui.window'
}).define(['window', 'table', 'jquery', 'winui', 'form'], function (exports) {
winui.renderColor();
var $ = layui.$,
form = layui.form,
table = layui.table;
authBtn('1663473377361');
table.render({
id: 'messageTable',
elem: '#messageTable',
method: 'post',
url: reqBasePath + 'queryCodeRuleList',
where: getTableParams(),
even: true,
page: true,
limits: getLimits(),
limit: getLimit(),
cols: [[
{ title: systemLanguage["com.skyeye.serialNumber"][languageType], type: 'numbers' },
{ field: 'name', title: '名称', width: 200 },
{ field: 'codeNum', title: '编码', width: 150 },
{ field: 'pattern', title: '命名模式', width: 300 },
{ field: 'alarm', title: '是否告警', align: 'center', width: 80, templet: function (d) {
if (d.alarm == 0) {
return "";
} else if (d.alarm == 1) {
return "";
}
}},
{ field: 'remark', title: '备注', width: 200 },
{ 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: 180, toolbar: '#tableBar' }
]],
done: function(json) {
matchingLanguage();
initTableSearchUtil.initAdvancedSearch(this, json.searchFilter, form, "请输入名称,编码", function () {
table.reloadData("messageTable", {page: {curr: 1}, where: getTableParams()});
});
}
});
table.on('tool(messageTable)', function (obj) {
var data = obj.data;
var layEvent = obj.event;
if (layEvent === 'del') { // 删除
del(data, obj);
} else if (layEvent === 'edit') { // 编辑
edit(data);
}
});
// 删除
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: reqBasePath + "deleteCodeRuleMationById", params: {id: data.id}, type: 'json', method: "DELETE", callback: function (json) {
winui.window.msg(systemLanguage["com.skyeye.deleteOperationSuccessMsg"][languageType], {icon: 1, time: 2000});
loadTable();
}});
});
}
// 编辑
function edit(data) {
rowId = data.id;
_openNewWindows({
url: "../../tpl/codeRule/codeRuleEdit.html",
title: systemLanguage["com.skyeye.editPageTitle"][languageType],
pageId: "codeRuleEdit",
area: ['90vw', '90vh'],
callBack: function (refreshCode) {
winui.window.msg(systemLanguage["com.skyeye.successfulOperation"][languageType], {icon: 1, time: 2000});
loadTable();
}});
}
// 新增
$("body").on("click", "#addBean", function() {
_openNewWindows({
url: "../../tpl/codeRule/codeRuleAdd.html",
title: systemLanguage["com.skyeye.addPageTitle"][languageType],
pageId: "codeRuleAdd",
area: ['90vw', '90vh'],
callBack: function (refreshCode) {
winui.window.msg(systemLanguage["com.skyeye.successfulOperation"][languageType], {icon: 1, time: 2000});
loadTable();
}});
});
form.render();
$("body").on("click", "#reloadTable", function() {
loadTable();
});
function loadTable() {
table.reloadData("messageTable", {where: getTableParams()});
}
function getTableParams() {
return $.extend(true, {}, initTableSearchUtil.getSearchValue("messageTable"));
}
exports('codeRuleList', {});
});
......@@ -23,8 +23,8 @@ layui.config({
skyeyeClassEnumUtil.showEnumDataListByClassName("componentAttr", 'verificationSelect', "attrKeys", '', form);
// 组件适用范围
skyeyeClassEnumUtil.showEnumDataListByClassName("componentApplyRange", 'radio', "applyRange", '', form);
// 适用表单布局
skyeyeClassEnumUtil.showEnumDataListByClassName("dsFormPageType", 'verificationSelect', "applyFormType", '', form);
// 组件获取的值的合入接口入参的方式
skyeyeClassEnumUtil.showEnumDataListByClassName("componentValueMergType", 'radio', "valueMergType", '', form);
// 根据类型获取部分功能的使用说明
systemCommonUtil.queryExplainMationByType(2, function(json) {
......@@ -84,7 +84,7 @@ layui.config({
attrKeys: $('#attrKeys').attr('value'),
applyRange: $("#applyRange input:radio:checked").val(),
applyObject: isNull($("#applyObject").attr("chooseId")) ? JSON.stringify([]) : $("#applyObject").attr("chooseId"),
applyFormType: $('#applyFormType').attr('value'),
valueMergType: dataShowType.getData('valueMergType'),
linkedData: '2'
};
if ($("#linkedData").val() == 'true') {
......
......@@ -51,9 +51,8 @@ layui.config({
skyeyeClassEnumUtil.showEnumDataListByClassName("componentAttr", 'verificationSelect', "attrKeys", attrKeys, form);
// 组件适用范围
skyeyeClassEnumUtil.showEnumDataListByClassName("componentApplyRange", 'radio', "applyRange", json.bean.applyRange, form);
// 适用表单布局
var applyFormType = isNull(json.bean.applyFormType) ? '' : json.bean.applyFormType.toString();
skyeyeClassEnumUtil.showEnumDataListByClassName("dsFormPageType", 'verificationSelect', "applyFormType", applyFormType, form);
// 组件获取的值的合入接口入参的方式
skyeyeClassEnumUtil.showEnumDataListByClassName("componentValueMergType", 'radio', "valueMergType", json.bean.valueMergType, form);
// 根据类型获取部分功能的使用说明
systemCommonUtil.queryExplainMationByType(2, function (json) {
......@@ -101,7 +100,7 @@ layui.config({
attrKeys: $('#attrKeys').attr('value'),
applyRange: $("#applyRange input:radio:checked").val(),
applyObject: isNull($("#applyObject").attr("chooseId")) ? JSON.stringify([]) : $("#applyObject").attr("chooseId"),
applyFormType: $('#applyFormType').attr('value'),
valueMergType: dataShowType.getData('valueMergType'),
id: parent.rowId
};
if ($("#linkedData").val() == 'true') {
......
......@@ -28,7 +28,6 @@ layui.config({
var componentList = [];
var className = GetUrlParam("className");
var pageType = GetUrlParam("pageType");
if (isNull(className)) {
winui.window.msg("请传入适用对象信息", {icon: 2, time: 2000});
return false;
......@@ -90,7 +89,7 @@ layui.config({
showGrid({
id: "btnBox",
url: reqBasePath + "queryAllDsFormComponentList",
params: {serviceClassName: className, dsFormPageType: pageType},
params: {serviceClassName: className},
pagination: false,
method: 'GET',
template: $("#leftBoxItem").html(),
......@@ -242,7 +241,7 @@ layui.config({
sortDataIn();
var params = {
pageId: pageId,
dsFormPageContentList: JSON.stringify(contentList)
dsFormPageContentList: encodeURIComponent(JSON.stringify(contentList))
}
AjaxPostUtil.request({url: reqBasePath + "writeDsFormPageContent", params: params, type: 'json', method: 'POST', callback: function (json) {
winui.window.msg("保存成功", {icon: 1, time: 2000});
......
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8" />
<title></title>
<link href="../../assets/lib/layui/css/layui.css" rel="stylesheet" />
<link href="../../assets/lib/winui/css/winui.css" rel="stylesheet" />
</head>
<body>
<div style="margin:0 auto;padding:20px;">
<form class="layui-form" action="" id="showForm" autocomplete="off">
<div class="layui-form-item layui-col-xs6">
<label class="layui-form-label">名称<i class="red">*</i></label>
<div class="layui-input-block">
<input type="text" id="name" name="name" win-verify="required" placeholder="请输入名称" class="layui-input"/>
<div class="layui-form-mid layui-word-aux">名称不能重复。</div>
</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">
<input type="text" id="codeNum" name="codeNum" win-verify="required" placeholder="请输入编码" class="layui-input"/>
<div class="layui-form-mid layui-word-aux">编码不能重复。</div>
</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 winui-radio">
<input type="radio" name="alarm" value="0" title="否" checked="checked"/>
<input type="radio" name="alarm" value="1" title="是" />
</div>
</div>
<div class="layui-form-item layui-col-xs12">
<label class="layui-form-label">编码规则<i class="red">*</i></label>
<div class="layui-input-block winui-radio" id="ruleBox">
</div>
</div>
<div class="layui-form-item layui-col-xs12">
<label class="layui-form-label">备注</label>
<div class="layui-input-block">
<textarea id="remark" name="remark" placeholder="请输入备注" class="layui-textarea" style="height: 100px;" maxlength="200"></textarea>
</div>
</div>
<div class="layui-form-item layui-col-xs12">
<div class="layui-input-block">
<button class="winui-btn" id="cancle"><language showName="com.skyeye.cancel"></language></button>
<button class="winui-btn" lay-submit lay-filter="formAddBean"><language showName="com.skyeye.save"></language></button>
</div>
</div>
</form>
</div>
<script src="../../assets/lib/layui/layui.js"></script>
<script src="../../assets/lib/layui/custom.js"></script>
<script type="text/javascript">
layui.config({base: '../../js/codeRule/'}).use('codeRuleAdd');
</script>
</body>
</html>
\ No newline at end of file
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8" />
<title></title>
<link href="../../assets/lib/layui/css/layui.css" rel="stylesheet" />
<link href="../../assets/lib/winui/css/winui.css" rel="stylesheet" />
</head>
<body>
<div style="padding:20px; margin:0 auto;">
<form class="layui-form" action="" id="showForm" autocomplete="off">
</form>
</div>
<script type="text/x-handlebars-template" id="showTemplate">
{{#bean}}
<div class="layui-form-item layui-col-xs6">
<label class="layui-form-label">名称<i class="red">*</i></label>
<div class="layui-input-block">
<input type="text" id="name" name="name" win-verify="required" placeholder="请输入名称" class="layui-input" value="{{name}}"/>
<div class="layui-form-mid layui-word-aux">名称不能重复</div>
</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">
<input type="text" id="codeNum" name="codeNum" win-verify="required" placeholder="请输入编码" class="layui-input" value="{{codeNum}}"/>
<div class="layui-form-mid layui-word-aux">编码不能重复</div>
</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 winui-radio">
<input type="radio" name="alarm" value="0" title="" />
<input type="radio" name="alarm" value="1" title="" />
</div>
</div>
<div class="layui-form-item layui-col-xs12">
<label class="layui-form-label">编码规则<i class="red">*</i></label>
<div class="layui-input-block winui-radio" id="ruleBox">
</div>
</div>
<div class="layui-form-item layui-col-xs12">
<label class="layui-form-label">备注</label>
<div class="layui-input-block">
<textarea id="remark" name="remark" placeholder="请输入备注" class="layui-textarea" style="height: 100px;" maxlength="200">{{remark}}</textarea>
</div>
</div>
<div class="layui-form-item layui-col-xs12">
<div class="layui-input-block">
<button class="winui-btn" id="cancle"><language showName="com.skyeye.cancel"></language></button>
<button class="winui-btn" lay-submit lay-filter="formEditBean"><language showName="com.skyeye.save"></language></button>
</div>
</div>
{{/bean}}
</script>
<script src="../../assets/lib/layui/layui.js"></script>
<script src="../../assets/lib/layui/custom.js"></script>
<script type="text/javascript">
layui.config({base: '../../js/codeRule/'}).use('codeRuleEdit');
</script>
</body>
</html>
\ No newline at end of file
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8" />
<title></title>
<link href="../../assets/lib/layui/css/layui.css" rel="stylesheet" />
<link href="../../assets/lib/winui/css/winui.css" rel="stylesheet" />
</head>
<body>
<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="1663473377361"><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('1663473377361')){ }}
<a class="layui-btn layui-btn-xs" lay-event="edit"><language showName="com.skyeye.editBtn"></language></a>
{{# } }}
{{# if(auth('1663473394181')){ }}
<a class="layui-btn layui-btn-xs layui-btn-danger" lay-event="del"><language showName="com.skyeye.deleteBtn"></language></a>
{{# } }}
</script>
</div>
<script src="../../assets/lib/layui/layui.js"></script>
<script src="../../assets/lib/layui/custom.js"></script>
<script type="text/javascript">
layui.config({base: '../../js/codeRule/'}).use('codeRuleList');
</script>
</body>
</html>
\ No newline at end of file
......@@ -56,8 +56,8 @@
</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" id="applyFormType">
<label class="layui-form-label">值合入方式<i class="red">*</i></label>
<div class="layui-input-block" id="valueMergType">
</div>
</div>
......
......@@ -62,8 +62,8 @@
</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" id="applyFormType">
<label class="layui-form-label">值合入方式<i class="red">*</i></label>
<div class="layui-input-block" id="valueMergType">
</div>
</div>
......
......@@ -61,7 +61,11 @@ var dsFormUtil = {
// 获取组件中设置值的脚本
var dsFormComponent = content.dsFormComponent;
var value = data[attrDefinition.attrKey];
if (dsFormComponent.valueMergType == 'extend') {
value = data;
}
content["value"] = value;
content["pageType"] = 'edit';
var jsFitValue = dsFormComponent.jsFitValue;
if (!isNull(jsFitValue) && jsFitValue.startsWith('layui.define')) {
var setValueScript = getDataUseHandlebars('{{#this}}' + dsFormComponent.jsFitValue + '{{/this}}', content);
......@@ -87,6 +91,7 @@ var dsFormUtil = {
layui.define(["jquery", 'form'], function(exports) {
var form = layui.form;
$.each(pageMation.dsFormPageContents, function(j, dsFormContent) {
dsFormContent["pageType"] = pageMation.type;
dsFormUtil.loadComponent(showBoxId, dsFormContent);
});
matchingLanguage();
......@@ -112,7 +117,11 @@ var dsFormUtil = {
var getValueScript = getDataUseHandlebars('{{#this}}' + dsFormComponent.jsValue + '{{/this}}', content);
var value = "";
eval('value = ' + getValueScript);
params[content.attrDefinition.attrKey] = value;
if (dsFormComponent.valueMergType == 'extend') {
params = $.extend(true, params, value);
} else {
params[content.attrDefinition.attrKey] = value;
}
}
});
if (dsFormUtil.pageMation.type == 'edit') {
......
......@@ -41,6 +41,7 @@
"attrKeyDataType": {"name": "表单布局里面的组件关联的数据类型", "className": "skyeye-pro#com.skyeye.attr.classenum.AttrKeyDataType"},
"componentAttr": {"name": "组件关联的属性", "className": "skyeye-pro#com.skyeye.dsform.classenum.ComponentAttr"},
"componentApplyRange": {"name": "组件适用范围类型", "className": "skyeye-pro#com.skyeye.dsform.classenum.ComponentApplyRange"},
"componentValueMergType": {"name": "组件关联的属性", "className": "skyeye-pro#com.skyeye.dsform.classenum.ComponentValueMergType"},
"buttonColorType": {"name": "操作按钮颜色", "className": "skyeye-pro#com.skyeye.attr.classenum.ButtonColorType"},
"eventType": {"name": "操作按钮事件类型", "className": "skyeye-pro#com.skyeye.operate.classenum.EventType"},
"operatePosition": {"name": "操作按钮展示位置", "className": "skyeye-pro#com.skyeye.operate.classenum.OperatePosition"}
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册