From a9fc0953579f0849c4ac5a8e62ca6348128021a9 Mon Sep 17 00:00:00 2001 From: weizhiqiang <598748873@qq.com> Date: Fri, 30 Dec 2022 11:28:27 +0800 Subject: [PATCH] =?UTF-8?q?=E6=96=B0=E5=A2=9E=E8=87=AA=E5=AE=9A=E4=B9=89?= =?UTF-8?q?=E5=B1=9E=E6=80=A7?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../resources/template/js/attr/writeAttr.js | 45 +++++++++++++++ .../template/tpl/attr/writeAttr.html | 55 +++++++++++++++++++ 2 files changed, 100 insertions(+) create mode 100644 base-server/src/main/resources/template/js/attr/writeAttr.js create mode 100644 base-server/src/main/resources/template/tpl/attr/writeAttr.html diff --git a/base-server/src/main/resources/template/js/attr/writeAttr.js b/base-server/src/main/resources/template/js/attr/writeAttr.js new file mode 100644 index 000000000..c66cd4b2a --- /dev/null +++ b/base-server/src/main/resources/template/js/attr/writeAttr.js @@ -0,0 +1,45 @@ + +layui.config({ + base: basePath, + version: skyeyeVersion +}).extend({ + window: 'js/winui.window' +}).define(['window', 'jquery', 'winui', 'form', 'textool'], function (exports) { + winui.renderColor(); + var index = parent.layer.getFrameIndex(window.name); + var $ = layui.$, + form = layui.form, + textool = layui.textool; + + var className = GetUrlParam('className'); + var attrKey = GetUrlParam('attrKey'); + + AjaxPostUtil.request({url: reqBasePath + "queryAttrDefinitionCustom", params: {className: className, attrKey: attrKey}, type: 'json', method: "GET", callback: function (json) { + $("#showForm").html(getDataUseHandlebars($("#beanTemplate").html(), json)); + textool.init({eleId: 'remark', maxlength: 200}); + + var id = isNull(json.bean.id) ? '' : json.bean.id; + matchingLanguage(); + form.render(); + form.on('submit(formEditBean)', function (data) { + if (winui.verifyForm(data.elem)) { + var params = { + className: className, + attrKey: attrKey, + name: $("#name").val(), + remark: $("#remark").val(), + id: id + }; + AjaxPostUtil.request({url: reqBasePath + "saveAttrDefinitionCustom", 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/base-server/src/main/resources/template/tpl/attr/writeAttr.html b/base-server/src/main/resources/template/tpl/attr/writeAttr.html new file mode 100644 index 000000000..04e665efe --- /dev/null +++ b/base-server/src/main/resources/template/tpl/attr/writeAttr.html @@ -0,0 +1,55 @@ + + + + + + + + + +
+
+ +
+
+ + + + + + + + \ No newline at end of file -- GitLab