From d9779d50120324042178ef5128191eff723668ae Mon Sep 17 00:00:00 2001 From: weizhiqiang <598748873@qq.com> Date: Mon, 20 Feb 2023 22:56:22 +0800 Subject: [PATCH] =?UTF-8?q?=E8=A1=A8=E5=8D=95=E5=8A=A0=E8=BD=BD=E7=BB=84?= =?UTF-8?q?=E4=BB=B6=E4=BF=AE=E6=94=B9=EF=BC=8C=E8=A7=A3=E5=86=B3handlebar?= =?UTF-8?q?=E4=BC=A0=E9=80=92=E5=AF=B9=E8=B1=A1=E7=9A=84=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../resources/template/js/codeRule/codeRuleEdit.js | 3 +-- .../resources/template/assets/lib/layui/custom.js | 2 +- .../assets/lib/layui/customer/skyeye/dsFormUtil.js | 14 ++++++++++++-- .../lib/layui/lay/modules/jQuery.upload.min.js | 2 +- 4 files changed, 15 insertions(+), 6 deletions(-) diff --git a/common/src/main/resources/template/js/codeRule/codeRuleEdit.js b/common/src/main/resources/template/js/codeRule/codeRuleEdit.js index be4d9d5d6..f7d1c4cd3 100644 --- a/common/src/main/resources/template/js/codeRule/codeRuleEdit.js +++ b/common/src/main/resources/template/js/codeRule/codeRuleEdit.js @@ -10,8 +10,7 @@ layui.config({ var index = parent.layer.getFrameIndex(window.name); var $ = layui.$, textool = layui.textool; - var selOption = getFileContent('tpl/template/select-option.tpl'); - + showGrid({ id: "showForm", url: reqBasePath + "queryCodeRuleMationById", diff --git a/web/src/main/resources/template/assets/lib/layui/custom.js b/web/src/main/resources/template/assets/lib/layui/custom.js index 408bf132d..7f3acd317 100644 --- a/web/src/main/resources/template/assets/lib/layui/custom.js +++ b/web/src/main/resources/template/assets/lib/layui/custom.js @@ -121,7 +121,7 @@ function setRequestHeaders(xmlhttp) { // 编辑加载自定义的js文件 layui.each(customerJS, function(key, jsPath){ - if(jsPath.lastIndexOf(".js") >=0){ + if (jsPath.lastIndexOf(".js") >= 0) { document.write(''); } else { document.write(''); 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 558065e79..d0a4f6434 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 @@ -134,6 +134,9 @@ var dsFormUtil = { * @param content */ loadComponent: function (boxId, content) { + if (!dsFormUtil.checkLoadHandlebar) { + dsFormUtil.loadHandlebar(); + } var component = content.dsFormComponent; if (component.linkedData == 1) { // 关联数据 @@ -145,8 +148,6 @@ var dsFormUtil = { } var jsonStr = {bean: content}; - // 对象的传递转换,用于组件使用,组件中需要使用 {{{attrDefinitionJson}}} 接收 - jsonStr.bean.attrDefinitionJson = JSON.stringify(jsonStr.bean.attrDefinition); var html = getDataUseHandlebars('{{#bean}}' + component.htmlContent + '{{/bean}}', jsonStr); var html_js = getDataUseHandlebars('{{#bean}}' + component.jsContent + '{{/bean}}', jsonStr); var jsCon = ``; @@ -159,6 +160,15 @@ var dsFormUtil = { return content; }, + checkLoadHandlebar: false, + loadHandlebar: function () { + dsFormUtil.checkLoadHandlebar = true; + // 加载json对象 + Handlebars.registerHelper('json', function(context) { + return JSON.stringify(context); + }); + }, + getLable: function (content) { var attr = content.attrDefinition; if (!isNull(attr) && !$.isEmptyObject(attr)) { diff --git a/web/src/main/resources/template/assets/lib/layui/lay/modules/jQuery.upload.min.js b/web/src/main/resources/template/assets/lib/layui/lay/modules/jQuery.upload.min.js index 586908c24..dfb595c5b 100644 --- a/web/src/main/resources/template/assets/lib/layui/lay/modules/jQuery.upload.min.js +++ b/web/src/main/resources/template/assets/lib/layui/lay/modules/jQuery.upload.min.js @@ -413,7 +413,7 @@ layui.define(["jquery"], function(exports) { if (["avi", "wmv", "mpeg", "mp4", "mov", "mkv", "flv", "f4v", "m4v", "rmvb", "rm", "3gp", "dat", "ts", "mts", "vob"].indexOf(i) >= 0) { return '' } - if (["gif", "jpg", "jpeg", "png", "bmp"].indexOf(i) >= 0) { + if (imageType.indexOf(i) >= 0) { return '' } return '' -- GitLab