diff --git a/common/src/main/resources/template/js/codeRule/codeRuleAdd.js b/common/src/main/resources/template/js/codeRule/codeRuleAdd.js deleted file mode 100644 index 0b1dcfac2321996842c2f37f5668dea5e1ec123c..0000000000000000000000000000000000000000 --- a/common/src/main/resources/template/js/codeRule/codeRuleAdd.js +++ /dev/null @@ -1,45 +0,0 @@ - -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 diff --git a/common/src/main/resources/template/js/codeRule/codeRuleEdit.js b/common/src/main/resources/template/js/codeRule/codeRuleEdit.js deleted file mode 100644 index f7d1c4cd3ca9f35e2877700145e0fce568b917cb..0000000000000000000000000000000000000000 --- a/common/src/main/resources/template/js/codeRule/codeRuleEdit.js +++ /dev/null @@ -1,62 +0,0 @@ - -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 diff --git a/common/src/main/resources/template/js/codeRule/codeRuleList.js b/common/src/main/resources/template/js/codeRule/codeRuleList.js deleted file mode 100644 index cc453dddb100498b522aeefc0ba471a877326846..0000000000000000000000000000000000000000 --- a/common/src/main/resources/template/js/codeRule/codeRuleList.js +++ /dev/null @@ -1,115 +0,0 @@ - -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', {}); -}); diff --git a/common/src/main/resources/template/js/dsFormComponent/dsFormComponentAdd.js b/common/src/main/resources/template/js/dsFormComponent/dsFormComponentAdd.js index 80b74e2b55d9a45060c21303076852e91676da93..5e72d1b95937185e7a93fd1e5725be391a8b6472 100644 --- a/common/src/main/resources/template/js/dsFormComponent/dsFormComponentAdd.js +++ b/common/src/main/resources/template/js/dsFormComponent/dsFormComponentAdd.js @@ -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') { diff --git a/common/src/main/resources/template/js/dsFormComponent/dsFormComponentEdit.js b/common/src/main/resources/template/js/dsFormComponent/dsFormComponentEdit.js index 20377aa17011459b9b64d4907737d60ca420f77c..5b0668aef55e9cb1b8c70b51bd05118e5ccbc501 100644 --- a/common/src/main/resources/template/js/dsFormComponent/dsFormComponentEdit.js +++ b/common/src/main/resources/template/js/dsFormComponent/dsFormComponentEdit.js @@ -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') { diff --git a/common/src/main/resources/template/js/dsFormPage/dsFormPageDesign.js b/common/src/main/resources/template/js/dsFormPage/dsFormPageDesign.js index 9b13f9d3d3f3752cc72f032d06919aab7806da62..0c3611d7347415d941852a9feabc053881f28fae 100644 --- a/common/src/main/resources/template/js/dsFormPage/dsFormPageDesign.js +++ b/common/src/main/resources/template/js/dsFormPage/dsFormPageDesign.js @@ -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}); diff --git a/common/src/main/resources/template/tpl/codeRule/codeRuleAdd.html b/common/src/main/resources/template/tpl/codeRule/codeRuleAdd.html deleted file mode 100644 index 2a1b77dca87e6832d9159779d716be2f7a5d11ed..0000000000000000000000000000000000000000 --- a/common/src/main/resources/template/tpl/codeRule/codeRuleAdd.html +++ /dev/null @@ -1,59 +0,0 @@ - - - - - - - - - -
-
-
- -
- -
名称不能重复。
-
-
-
- -
- -
编码不能重复。
-
-
-
- -
- - -
-
-
- -
- -
-
-
- -
- -
-
-
-
- - -
-
-
-
- - - - - \ No newline at end of file diff --git a/common/src/main/resources/template/tpl/codeRule/codeRuleEdit.html b/common/src/main/resources/template/tpl/codeRule/codeRuleEdit.html deleted file mode 100644 index 456eb5f5a6aaadeac941eedf7028e3219febb055..0000000000000000000000000000000000000000 --- a/common/src/main/resources/template/tpl/codeRule/codeRuleEdit.html +++ /dev/null @@ -1,66 +0,0 @@ - - - - - - - - - -
-
- -
-
- - - - - - - - \ No newline at end of file diff --git a/common/src/main/resources/template/tpl/codeRule/codeRuleList.html b/common/src/main/resources/template/tpl/codeRule/codeRuleList.html deleted file mode 100644 index 20bff47c38b138442fd4f0411bba540c47ccad74..0000000000000000000000000000000000000000 --- a/common/src/main/resources/template/tpl/codeRule/codeRuleList.html +++ /dev/null @@ -1,33 +0,0 @@ - - - - - - - - - -
-
- - -
-
-
-
- -
- - - - - \ No newline at end of file diff --git a/common/src/main/resources/template/tpl/dsFormComponent/dsFormComponentAdd.html b/common/src/main/resources/template/tpl/dsFormComponent/dsFormComponentAdd.html index df31ade85fc98e4e6390f234c8c885690e7a661f..0b42da4e37e6708a60fbe84759a747abfef82102 100644 --- a/common/src/main/resources/template/tpl/dsFormComponent/dsFormComponentAdd.html +++ b/common/src/main/resources/template/tpl/dsFormComponent/dsFormComponentAdd.html @@ -56,8 +56,8 @@
- -
+ +
diff --git a/common/src/main/resources/template/tpl/dsFormComponent/dsFormComponentEdit.html b/common/src/main/resources/template/tpl/dsFormComponent/dsFormComponentEdit.html index c699944856381472e0204436782557e9b7a8b5fe..7054d37ba9053fd932612b065df6bf7e92f1a0bf 100644 --- a/common/src/main/resources/template/tpl/dsFormComponent/dsFormComponentEdit.html +++ b/common/src/main/resources/template/tpl/dsFormComponent/dsFormComponentEdit.html @@ -62,8 +62,8 @@
- -
+ +
diff --git a/web/src/main/resources/template/assets/lib/layui/customer/skyeye/dsFormUtil.js b/web/src/main/resources/template/assets/lib/layui/customer/skyeye/dsFormUtil.js index 82364c76f27f6267e08a29e67e76b1725ff0a7cb..668ecd20b47c2ef24c5877914653ffca988ddc95 100644 --- a/web/src/main/resources/template/assets/lib/layui/customer/skyeye/dsFormUtil.js +++ b/web/src/main/resources/template/assets/lib/layui/customer/skyeye/dsFormUtil.js @@ -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') { diff --git a/web/src/main/resources/template/json/skyeyeClassEnum.json b/web/src/main/resources/template/json/skyeyeClassEnum.json index 17aac80452d49b8ace2236f960194acfa101e700..8f288faa055562cfe28975f929cb5e93320f12ff 100644 --- a/web/src/main/resources/template/json/skyeyeClassEnum.json +++ b/web/src/main/resources/template/json/skyeyeClassEnum.json @@ -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"}