From 9bcfcb28776095f194a410e7e102e9c381eda977 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E9=BB=84=E6=B5=B7?= <10402852@qq.com> Date: Mon, 26 Dec 2022 15:18:56 +0800 Subject: [PATCH] 'commit' --- Doc/设计思路.txt | 7 + .../formDesign/ayq/modules/formDesigner.js | 1162 +++++++++-------- .../formDesign/ayq/modules/staticField.js | 4 +- WebRoot/html/formDesign/index.html | 5 + WebRoot/js/jquery-3.6.0.min.js | 2 +- WebRoot/js/jquery_Extend.js | 8 + .../java/com/dsideal/FengHuang/Start.java | 3 + .../Zjb/Controller/ZjbController.java | 19 + .../dsideal/FengHuang/Zjb/Model/ZjbModel.java | 36 + 9 files changed, 666 insertions(+), 580 deletions(-) create mode 100644 Doc/设计思路.txt create mode 100644 WebRoot/js/jquery_Extend.js create mode 100644 src/main/java/com/dsideal/FengHuang/Zjb/Controller/ZjbController.java create mode 100644 src/main/java/com/dsideal/FengHuang/Zjb/Model/ZjbModel.java diff --git a/Doc/设计思路.txt b/Doc/设计思路.txt new file mode 100644 index 0000000..8d39c8e --- /dev/null +++ b/Doc/设计思路.txt @@ -0,0 +1,7 @@ +3个阶段 +每个阶段有不同的任务 + +每个任务有多个模板, + + +http://10.10.11.124:9000/FengHuang/html/formDesign/index.html \ No newline at end of file diff --git a/WebRoot/html/formDesign/ayq/modules/formDesigner.js b/WebRoot/html/formDesign/ayq/modules/formDesigner.js index faab033..d68af03 100644 --- a/WebRoot/html/formDesign/ayq/modules/formDesigner.js +++ b/WebRoot/html/formDesign/ayq/modules/formDesigner.js @@ -17,7 +17,7 @@ + 4.表单数据的获取与回显,禁用全表单 +------------------------------------------------------------------------------------+ */ -layui.config({base: './ayq/modules/'}).define(["layer",'flow', "laytpl", "element", "form", "slider", "laydate", "rate", "colorpicker", "layedit", "carousel", "upload", "formField","staticField", "numberInput", "iconPicker", "cron", "labelGeneration"] +layui.config({base: './ayq/modules/'}).define(["layer", 'flow', "laytpl", "element", "form", "slider", "laydate", "rate", "colorpicker", "layedit", "carousel", "upload", "formField", "staticField", "numberInput", "iconPicker", "cron", "labelGeneration"] , function (exports) { var $ = layui.jquery , layer = layui.layer @@ -60,7 +60,7 @@ layui.config({base: './ayq/modules/'}).define(["layer",'flow', "laytpl", "elemen } //事件监听 , on: function (events - , callback) { + , callback) { return layui.onevent.call(this , MOD_NAME , events @@ -80,17 +80,17 @@ layui.config({base: './ayq/modules/'}).define(["layer",'flow', "laytpl", "elemen return options.data || null; }, geticeEditorObjects: function () { return iceEditorObjects || null; - },getImages:function () { + }, getImages: function () { return images || null; - },getFiles:function () { + }, getFiles: function () { return files || null; - },getFormData:function () { + }, getFormData: function () { return that.getFormData() || null; - },setFormData:function (json) { + }, setFormData: function (json) { return that.setFormData(json) || null; - },globalDisable:function () { + }, globalDisable: function () { return that.globalDisable() || null; - },globalNoDisable:function () { + }, globalNoDisable: function () { return that.globalNoDisable() || null; }, } @@ -123,7 +123,7 @@ layui.config({base: './ayq/modules/'}).define(["layer",'flow', "laytpl", "elemen * @param {object} elem 表单面板jquery对象 * @param {object} that 实例对象 * */ - render: function (json,selected,elem,that) { + render: function (json, selected, elem, that) { if (selected === undefined) { selected = false; } @@ -133,13 +133,13 @@ layui.config({base: './ayq/modules/'}).define(["layer",'flow', "laytpl", "elemen var _readonly = json.readonly ? 'readonly=""' : ''; var _required = json.required ? 'required' : ''; var _hideLabel = json.hideLabel ? 'display: none;' : ''; - if (json.expression !== null && json.expression !== undefined ) { + if (json.expression !== null && json.expression !== undefined) { if (json.expression !== '') { _required = _required + '|' + json.expression; } } var _html = '
'.format(json.id, json.tag, _selected, json.index); - _html += ''.format(json.required ? 'layui-form-required' : '', json.label,json.required ? '*' : '',json.labelWidth,_hideLabel); + _html += ''.format(json.required ? 'layui-form-required' : '', json.label, json.required ? '*' : '', json.labelWidth, _hideLabel); if (json.hideLabel) { _html += '
'; } else { @@ -156,12 +156,12 @@ layui.config({base: './ayq/modules/'}).define(["layer",'flow', "laytpl", "elemen * @param {object} json 变更后的json属性 * @param {object} that 实例对象 * */ - update: function (json,that) { + update: function (json, that) { var _disabled = json.disabled ? 'disabled=""' : ''; var _readonly = json.readonly ? 'readonly=""' : ''; var _required = json.required ? 'required' : ''; var _disabledClass = json.disabled ? ' layui-disabled' : ''; - if (json.expression !== null && json.expression !== undefined ) { + if (json.expression !== null && json.expression !== undefined) { if (json.expression !== '') { _required = 'required' + '|' + json.expression; } @@ -170,17 +170,17 @@ layui.config({base: './ayq/modules/'}).define(["layer",'flow', "laytpl", "elemen var $label = $('#' + json.id + ' .layui-form-label'); $block.empty(); $label.empty(); - $label.css("width",json.labelWidth); + $label.css("width", json.labelWidth); if (json.required) { $label.append('*'); } $label.append(json.label + ":"); if (json.hideLabel) { - $label.css("display","none"); - $block.css("margin-left","0px"); + $label.css("display", "none"); + $block.css("margin-left", "0px"); } else { - $label.css("display","block"); - $block.css("margin-left",json.labelWidth); + $label.css("display", "block"); + $block.css("margin-left", json.labelWidth); } var _html = ''; //重绘设计区改id下的所有元素 @@ -194,7 +194,7 @@ layui.config({base: './ayq/modules/'}).define(["layer",'flow', "laytpl", "elemen * @param {object} index 所属对象组件索引 * @param {object} that 实例对象 * */ - jsonData: function (id, index,that) { + jsonData: function (id, index, that) { var _json = JSON.parse(JSON.stringify(formField.components.input)); _json.id = id; _json.index = index; @@ -205,7 +205,7 @@ layui.config({base: './ayq/modules/'}).define(["layer",'flow', "laytpl", "elemen * @param {object} json 当前组件的json属性 * @param {object} that 实例对象 * */ - property: function (json,that) { + property: function (json, that) { that.renderCommonProperty(json); //根据 json 对象获取对应的属性的html that.initCommonProperty(json); //初始化 json 对象获取对应的属性 }, @@ -215,7 +215,7 @@ layui.config({base: './ayq/modules/'}).define(["layer",'flow', "laytpl", "elemen * @param {boolean} selected 是否被选中 * @param {object} that 实例对象 * */ - generateHtml: function (json,selected,that) { + generateHtml: function (json, selected, that) { if (selected === undefined) { selected = false; } @@ -225,13 +225,13 @@ layui.config({base: './ayq/modules/'}).define(["layer",'flow', "laytpl", "elemen var _readonly = json.readonly ? 'readonly=""' : ''; var _required = json.required ? 'required' : ''; var _hideLabel = json.hideLabel ? 'display: none;' : ''; - if (json.expression !== null && json.expression !== undefined ) { + if (json.expression !== null && json.expression !== undefined) { if (json.expression !== '') { _required = _required + '|' + json.expression; } } - var _html = '
'.format(json.id, json.tag, _selected,json.index); - _html += ''.format(json.required ? 'layui-form-required' : '', json.label,json.required ? '*' : '',json.labelWidth,_hideLabel); + var _html = '
'.format(json.id, json.tag, _selected, json.index); + _html += ''.format(json.required ? 'layui-form-required' : '', json.label, json.required ? '*' : '', json.labelWidth, _hideLabel); if (json.hideLabel) { _html += '
'; } else { @@ -248,7 +248,7 @@ layui.config({base: './ayq/modules/'}).define(["layer",'flow', "laytpl", "elemen * @param {object} json 变更后的json属性 * @param {object} that 实例对象 * */ - generateScript:function (json,that) { + generateScript: function (json, that) { return ''; } }, @@ -260,14 +260,14 @@ layui.config({base: './ayq/modules/'}).define(["layer",'flow', "laytpl", "elemen * @param {object} elem 表单面板jquery对象 * @param {object} that 实例对象 * */ - render: function (json,selected,elem,that) { + render: function (json, selected, elem, that) { if (selected === undefined) { selected = false; } var _selected = selected ? 'active' : ''; var _html = '
'.format(json.id, json.tag, _selected, json.index); _html += '
{1}
' - .format(json.id +json.tag, json.defaultValue ? json.defaultValue : '', json.width,json.colorSelection); + .format(json.id + json.tag, json.defaultValue ? json.defaultValue : '', json.width, json.colorSelection); _html += '
'; elem.append(_html); }, @@ -276,10 +276,10 @@ layui.config({base: './ayq/modules/'}).define(["layer",'flow', "laytpl", "elemen * @param {object} json 变更后的json属性 * @param {object} that 实例对象 * */ - update: function (json,that) { - var $block = $('#' + json.id +json.tag); - $block.css("width","calc({0} - 35px)".format(json.width)); - $block.css("border-left","5px solid {0}".format(json.colorSelection)); + update: function (json, that) { + var $block = $('#' + json.id + json.tag); + $block.css("width", "calc({0} - 35px)".format(json.width)); + $block.css("border-left", "5px solid {0}".format(json.colorSelection)); $block.html(json.defaultValue); }, /** @@ -288,7 +288,7 @@ layui.config({base: './ayq/modules/'}).define(["layer",'flow', "laytpl", "elemen * @param {object} index 所属对象组件索引 * @param {object} that 实例对象 * */ - jsonData: function (id, index,that) { + jsonData: function (id, index, that) { var _json = JSON.parse(JSON.stringify(formField.components.blockquote)); _json.id = id; _json.index = index; @@ -299,7 +299,7 @@ layui.config({base: './ayq/modules/'}).define(["layer",'flow', "laytpl", "elemen * @param {object} json 当前组件的json属性 * @param {object} that 实例对象 * */ - property: function (json,that) { + property: function (json, that) { that.renderCommonProperty(json); //根据 json 对象获取对应的属性的html that.initCommonProperty(json); //初始化 json 对象获取对应的属性 }, @@ -309,14 +309,14 @@ layui.config({base: './ayq/modules/'}).define(["layer",'flow', "laytpl", "elemen * @param {boolean} selected 是否被选中 * @param {object} that 实例对象 * */ - generateHtml: function (json,selected,that) { + generateHtml: function (json, selected, that) { if (selected === undefined) { selected = false; } var _selected = selected ? 'active' : ''; var _html = '
'.format(json.id, json.tag, _selected, json.index); _html += '
{1}
' - .format(json.id +json.tag, json.defaultValue ? json.defaultValue : '', json.width,json.colorSelection); + .format(json.id + json.tag, json.defaultValue ? json.defaultValue : '', json.width, json.colorSelection); _html += '
'; return _html; }, @@ -325,7 +325,7 @@ layui.config({base: './ayq/modules/'}).define(["layer",'flow', "laytpl", "elemen * @param {object} json 变更后的json属性 * @param {object} that 实例对象 * */ - generateScript:function (json,that) { + generateScript: function (json, that) { return ''; } }, @@ -337,14 +337,14 @@ layui.config({base: './ayq/modules/'}).define(["layer",'flow', "laytpl", "elemen * @param {object} elem 表单面板jquery对象 * @param {object} that 实例对象 * */ - render: function (json,selected,elem,that) { + render: function (json, selected, elem, that) { if (selected === undefined) { selected = false; } var _selected = selected ? 'active' : ''; var _html = '
'.format(json.id, json.tag, _selected, json.index); _html += '
' - .format(json.id +json.tag,json.whiteSpace); + .format(json.id + json.tag, json.whiteSpace); _html += '
'; elem.append(_html); }, @@ -353,9 +353,9 @@ layui.config({base: './ayq/modules/'}).define(["layer",'flow', "laytpl", "elemen * @param {object} json 变更后的json属性 * @param {object} that 实例对象 * */ - update: function (json,that) { - var $block = $('#' + json.id +json.tag); - $block.css("height","{0}px".format(json.whiteSpace)); + update: function (json, that) { + var $block = $('#' + json.id + json.tag); + $block.css("height", "{0}px".format(json.whiteSpace)); }, /** * 根据components组件对象获取组件属性 @@ -363,7 +363,7 @@ layui.config({base: './ayq/modules/'}).define(["layer",'flow', "laytpl", "elemen * @param {object} index 所属对象组件索引 * @param {object} that 实例对象 * */ - jsonData: function (id, index,that) { + jsonData: function (id, index, that) { var _json = JSON.parse(JSON.stringify(formField.components.spacing)); _json.id = id; _json.index = index; @@ -374,7 +374,7 @@ layui.config({base: './ayq/modules/'}).define(["layer",'flow', "laytpl", "elemen * @param {object} json 当前组件的json属性 * @param {object} that 实例对象 * */ - property: function (json,that) { + property: function (json, that) { that.renderCommonProperty(json); //根据 json 对象获取对应的属性的html that.initCommonProperty(json); //初始化 json 对象获取对应的属性 }, @@ -384,14 +384,14 @@ layui.config({base: './ayq/modules/'}).define(["layer",'flow', "laytpl", "elemen * @param {boolean} selected 是否被选中 * @param {object} that 实例对象 * */ - generateHtml: function (json,selected,that) { + generateHtml: function (json, selected, that) { if (selected === undefined) { selected = false; } var _selected = selected ? 'active' : ''; var _html = '
'.format(json.id, json.tag, _selected, json.index); _html += '
' - .format(json.id +json.tag,json.whiteSpace); + .format(json.id + json.tag, json.whiteSpace); _html += '
'; return _html; }, @@ -400,7 +400,7 @@ layui.config({base: './ayq/modules/'}).define(["layer",'flow', "laytpl", "elemen * @param {object} json 变更后的json属性 * @param {object} that 实例对象 * */ - generateScript:function (json,that) { + generateScript: function (json, that) { return ''; } }, @@ -412,13 +412,13 @@ layui.config({base: './ayq/modules/'}).define(["layer",'flow', "laytpl", "elemen * @param {object} elem 表单面板jquery对象 * @param {object} that 实例对象 * */ - render: function (json,selected,elem,that) { + render: function (json, selected, elem, that) { if (selected === undefined) { selected = false; } var _selected = selected ? 'active' : ''; var _html = '
'.format(json.id, json.tag, _selected, json.index); - _html += '
'.format(json.id +json.tag,json.colorSelection,json.width); + _html += '
'.format(json.id + json.tag, json.colorSelection, json.width); if (json.defaultValue) { _html += '{0}'.format(json.defaultValue); } @@ -430,10 +430,10 @@ layui.config({base: './ayq/modules/'}).define(["layer",'flow', "laytpl", "elemen * @param {object} json 变更后的json属性 * @param {object} that 实例对象 * */ - update: function (json,that) { - var $block = $('#' + json.id +json.tag); - $block.css("width",json.width); - $block.css("border-color",json.colorSelection); + update: function (json, that) { + var $block = $('#' + json.id + json.tag); + $block.css("width", json.width); + $block.css("border-color", json.colorSelection); $block.empty(); if (json.defaultValue) { $block.append('{0}'.format(json.defaultValue)); @@ -445,7 +445,7 @@ layui.config({base: './ayq/modules/'}).define(["layer",'flow', "laytpl", "elemen * @param {object} index 所属对象组件索引 * @param {object} that 实例对象 * */ - jsonData: function (id, index,that) { + jsonData: function (id, index, that) { var _json = JSON.parse(JSON.stringify(formField.components.line)); _json.id = id; _json.index = index; @@ -456,7 +456,7 @@ layui.config({base: './ayq/modules/'}).define(["layer",'flow', "laytpl", "elemen * @param {object} json 当前组件的json属性 * @param {object} that 实例对象 * */ - property: function (json,that) { + property: function (json, that) { that.renderCommonProperty(json); //根据 json 对象获取对应的属性的html that.initCommonProperty(json); //初始化 json 对象获取对应的属性 }, @@ -466,13 +466,13 @@ layui.config({base: './ayq/modules/'}).define(["layer",'flow', "laytpl", "elemen * @param {boolean} selected 是否被选中 * @param {object} that 实例对象 * */ - generateHtml: function (json,selected,that) { + generateHtml: function (json, selected, that) { if (selected === undefined) { selected = false; } var _selected = selected ? 'active' : ''; var _html = '
'.format(json.id, json.tag, _selected, json.index); - _html += '
'.format(json.id +json.tag,json.colorSelection,json.width); + _html += '
'.format(json.id + json.tag, json.colorSelection, json.width); if (json.defaultValue) { _html += '{0}'.format(json.defaultValue); } @@ -484,7 +484,7 @@ layui.config({base: './ayq/modules/'}).define(["layer",'flow', "laytpl", "elemen * @param {object} json 变更后的json属性 * @param {object} that 实例对象 * */ - generateScript:function (json,that) { + generateScript: function (json, that) { return ''; } }, @@ -496,7 +496,7 @@ layui.config({base: './ayq/modules/'}).define(["layer",'flow', "laytpl", "elemen * @param {object} elem 表单面板jquery对象 * @param {object} that 实例对象 * */ - render: function (json,selected,elem,that) { + render: function (json, selected, elem, that) { if (selected === undefined) { selected = false; } @@ -506,7 +506,7 @@ layui.config({base: './ayq/modules/'}).define(["layer",'flow', "laytpl", "elemen var _disabledClass = json.disabled ? ' layui-disabled' : ''; var _hideLabel = json.hideLabel ? 'display: none;' : ''; var _html = '
'.format(json.id, json.tag, selected ? 'active' : '', json.index); - _html += ''.format(json.required ? 'layui-form-required' : '', json.label,json.required ? '*' : '',json.labelWidth,_hideLabel); + _html += ''.format(json.required ? 'layui-form-required' : '', json.label, json.required ? '*' : '', json.labelWidth, _hideLabel); if (json.hideLabel) { _html += '
'; } else { @@ -523,7 +523,7 @@ layui.config({base: './ayq/modules/'}).define(["layer",'flow', "laytpl", "elemen * @param {object} json 变更后的json属性 * @param {object} that 实例对象 * */ - update: function (json,that) { + update: function (json, that) { var _disabled = json.disabled ? 'disabled=""' : ''; var _readonly = json.readonly ? 'readonly=""' : ''; var _required = json.required ? 'lay-verify="required"' : ''; @@ -532,17 +532,17 @@ layui.config({base: './ayq/modules/'}).define(["layer",'flow', "laytpl", "elemen var $label = $('#' + json.id + ' .layui-form-label'); $block.empty(); $label.empty(); - $label.css("width",json.labelWidth); + $label.css("width", json.labelWidth); if (json.required) { $label.append('*'); } $label.append(json.label + ":"); if (json.hideLabel) { - $label.css("display","none"); - $block.css("margin-left","0px"); + $label.css("display", "none"); + $block.css("margin-left", "0px"); } else { - $label.css("display","block"); - $block.css("margin-left",json.labelWidth); + $label.css("display", "block"); + $block.css("margin-left", json.labelWidth); } var _html = ''; //重绘设计区改id下的所有元素 @@ -569,7 +569,7 @@ layui.config({base: './ayq/modules/'}).define(["layer",'flow', "laytpl", "elemen * @param {object} json 当前组件的json属性 * @param {object} that 实例对象 * */ - property: function (json,that) { + property: function (json, that) { that.renderCommonProperty(json); //根据 json 对象获取对应的属性的html that.initCommonProperty(json); //初始化 json 对象获取对应的属性 }, @@ -579,7 +579,7 @@ layui.config({base: './ayq/modules/'}).define(["layer",'flow', "laytpl", "elemen * @param {boolean} selected 是否被选中 * @param {object} that 实例对象 * */ - generateHtml: function (json,selected,that) { + generateHtml: function (json, selected, that) { if (selected === undefined) { selected = false; } @@ -589,7 +589,7 @@ layui.config({base: './ayq/modules/'}).define(["layer",'flow', "laytpl", "elemen var _disabledClass = json.disabled ? ' layui-disabled' : ''; var _hideLabel = json.hideLabel ? 'display: none;' : ''; var _html = '
'.format(json.id, json.tag, selected ? 'active' : '', json.index); - _html += ''.format(json.required ? 'layui-form-required' : '', json.label,json.required ? '*' : '',json.labelWidth,_hideLabel); + _html += ''.format(json.required ? 'layui-form-required' : '', json.label, json.required ? '*' : '', json.labelWidth, _hideLabel); if (json.hideLabel) { _html += '
'; } else { @@ -606,7 +606,7 @@ layui.config({base: './ayq/modules/'}).define(["layer",'flow', "laytpl", "elemen * @param {object} json 变更后的json属性 * @param {object} that 实例对象 * */ - generateScript:function (json,that) { + generateScript: function (json, that) { return ''; } }, @@ -618,7 +618,7 @@ layui.config({base: './ayq/modules/'}).define(["layer",'flow', "laytpl", "elemen * @param {object} elem 表单面板jquery对象 * @param {object} that 实例对象 * */ - render: function (json,selected,elem,that) { + render: function (json, selected, elem, that) { if (selected === undefined) { selected = false; } @@ -628,7 +628,7 @@ layui.config({base: './ayq/modules/'}).define(["layer",'flow', "laytpl", "elemen var _disabledClass = json.disabled ? ' layui-disabled' : ''; var _hideLabel = json.hideLabel ? 'display: none;' : ''; var _html = '
'.format(json.id, json.tag, selected ? 'active' : '', json.index); - _html += ''.format(json.required ? 'layui-form-required' : '', json.label,json.required ? '*' : '',json.width,_hideLabel); + _html += ''.format(json.required ? 'layui-form-required' : '', json.label, json.required ? '*' : '', json.width, _hideLabel); _html += '
'.format(json.width); _html += '' .format(json.id, json.defaultValue ? json.defaultValue : '', json.width, json.placeholder, _disabled, _required, _disabledClass, _readonly); @@ -641,7 +641,7 @@ layui.config({base: './ayq/modules/'}).define(["layer",'flow', "laytpl", "elemen * @param {object} json 变更后的json属性 * @param {object} that 实例对象 * */ - update: function (json,that) { + update: function (json, that) { var _disabled = json.disabled ? 'disabled=""' : ''; var _required = json.required ? 'lay-verify="required"' : ''; var _disabledClass = json.disabled ? ' layui-disabled' : ''; @@ -651,9 +651,9 @@ layui.config({base: './ayq/modules/'}).define(["layer",'flow', "laytpl", "elemen $block.empty(); $label.empty(); if (json.hideLabel) { - $label.css("display","none"); + $label.css("display", "none"); } else { - $label.css("display","block"); + $label.css("display", "block"); } var _html = ''; _html += '' @@ -685,7 +685,7 @@ layui.config({base: './ayq/modules/'}).define(["layer",'flow', "laytpl", "elemen * @param {object} json 当前组件的json属性 * @param {object} that 实例对象 * */ - property: function (json,that) { + property: function (json, that) { that.renderCommonProperty(json); //根据 json 对象获取对应的属性的html that.initCommonProperty(json); //初始化 json 对象获取对应的属性 }, @@ -695,7 +695,7 @@ layui.config({base: './ayq/modules/'}).define(["layer",'flow', "laytpl", "elemen * @param {boolean} selected 是否被选中 * @param {object} that 实例对象 * */ - generateHtml: function (json,selected,that) { + generateHtml: function (json, selected, that) { if (selected === undefined) { selected = false; } @@ -705,7 +705,7 @@ layui.config({base: './ayq/modules/'}).define(["layer",'flow', "laytpl", "elemen var _disabledClass = json.disabled ? ' layui-disabled' : ''; var _hideLabel = json.hideLabel ? 'display: none;' : ''; var _html = '
'.format(json.id, json.tag, selected ? 'active' : '', json.index); - _html += ''.format(json.required ? 'layui-form-required' : '', json.label,json.required ? '*' : '',json.width,_hideLabel); + _html += ''.format(json.required ? 'layui-form-required' : '', json.label, json.required ? '*' : '', json.width, _hideLabel); _html += '
'.format(json.width); _html += '' .format(json.id, json.defaultValue ? json.defaultValue : '', json.width, json.placeholder, _disabled, _required, _disabledClass, _readonly); @@ -718,7 +718,7 @@ layui.config({base: './ayq/modules/'}).define(["layer",'flow', "laytpl", "elemen * @param {object} json 变更后的json属性 * @param {object} that 实例对象 * */ - generateScript:function (json,that) { + generateScript: function (json, that) { return ''; } }, @@ -730,7 +730,7 @@ layui.config({base: './ayq/modules/'}).define(["layer",'flow', "laytpl", "elemen * @param {object} elem 表单面板jquery对象 * @param {object} that 实例对象 * */ - render: function (json, selected,elem,that) { + render: function (json, selected, elem, that) { if (selected === undefined) { selected = false; } @@ -738,13 +738,13 @@ layui.config({base: './ayq/modules/'}).define(["layer",'flow', "laytpl", "elemen var _required = json.required ? 'required' : ''; var _hideLabel = json.hideLabel ? 'display: none;' : ''; var _html = '
'.format(json.id, json.tag, selected ? 'active' : '', json.index); - _html += ''.format(json.required ? 'layui-form-required' : '', json.label,json.required ? '*' : '',json.labelWidth,_hideLabel); + _html += ''.format(json.required ? 'layui-form-required' : '', json.label, json.required ? '*' : '', json.labelWidth, _hideLabel); if (json.hideLabel) { _html += '
'.format(json.id); } else { - _html += '
'.format(json.id,json.labelWidth); + _html += '
'.format(json.id, json.labelWidth); } - _html += ''.format(json.id, _disabled, _required); /*if (json.defaultValue === undefined) { _html += ''.format('', '请选择'); }*/ @@ -765,7 +765,7 @@ layui.config({base: './ayq/modules/'}).define(["layer",'flow', "laytpl", "elemen * @param {object} json 变更后的json属性 * @param {object} that 实例对象 * */ - update: function (json,that) { + update: function (json, that) { var _disabled = json.disabled ? 'disabled=""' : ''; var _required = json.required ? 'required' : ''; var $block = $('#' + json.id + ' .layui-input-block'); @@ -773,7 +773,7 @@ layui.config({base: './ayq/modules/'}).define(["layer",'flow', "laytpl", "elemen $block.empty(); $label.empty(); var _html = ''; - _html += ''.format(json.id, _disabled, _required); //重绘设计区改id下的所有元素 /* if (json.defaultValue === undefined) { _html += ''.format('', '请选择'); @@ -787,21 +787,21 @@ layui.config({base: './ayq/modules/'}).define(["layer",'flow', "laytpl", "elemen } _html += '' $('#' + json.id + ' .layui-input-block').append(_html); - $label.css("width",json.labelWidth); + $label.css("width", json.labelWidth); if (json.required) { $label.append('*'); } $label.append(json.label + ":"); - form.render('select',json.id); + form.render('select', json.id); $('#' + json.id + ' .layui-input-block div.layui-unselect.layui-form-select').css({width: '{0}'.format(json.width)}); if (json.hideLabel) { - $label.css("display","none"); - $block.css("margin-left","0px"); + $label.css("display", "none"); + $block.css("margin-left", "0px"); $block.css({width: 'calc({0})'.format(json.width)}); } else { - $label.css("display","block"); - $block.css("margin-left",json.labelWidth); - $block.css({width: 'calc({0} - {1}px)'.format(json.width,json.labelWidth)}); + $label.css("display", "block"); + $block.css("margin-left", json.labelWidth); + $block.css({width: 'calc({0} - {1}px)'.format(json.width, json.labelWidth)}); } }, /** @@ -822,7 +822,7 @@ layui.config({base: './ayq/modules/'}).define(["layer",'flow', "laytpl", "elemen * @param {object} json 当前组件的json属性 * @param {object} that 实例对象 * */ - property: function (json,that) { + property: function (json, that) { that.renderCommonProperty(json); //根据 json 对象获取对应的属性的html that.initCommonProperty(json); //初始化 json 对象获取对应的属性 }, @@ -832,7 +832,7 @@ layui.config({base: './ayq/modules/'}).define(["layer",'flow', "laytpl", "elemen * @param {boolean} selected 是否被选中 * @param {object} that 实例对象 * */ - generateHtml: function (json,selected,that) { + generateHtml: function (json, selected, that) { if (selected === undefined) { selected = false; } @@ -840,13 +840,13 @@ layui.config({base: './ayq/modules/'}).define(["layer",'flow', "laytpl", "elemen var _required = json.required ? 'required' : ''; var _hideLabel = json.hideLabel ? 'display: none;' : ''; var _html = '
'.format(json.id, json.tag, selected ? 'active' : '', json.index); - _html += ''.format(json.required ? 'layui-form-required' : '', json.label,json.required ? '*' : '',json.labelWidth,_hideLabel); + _html += ''.format(json.required ? 'layui-form-required' : '', json.label, json.required ? '*' : '', json.labelWidth, _hideLabel); if (json.hideLabel) { _html += '
'.format(json.id); } else { - _html += '
'.format(json.id,json.labelWidth); + _html += '
'.format(json.id, json.labelWidth); } - _html += ''.format(json.id, _disabled, _required); /*if (json.defaultValue === undefined) { _html += ''.format('', '请选择'); }*/ @@ -867,7 +867,7 @@ layui.config({base: './ayq/modules/'}).define(["layer",'flow', "laytpl", "elemen * @param {object} json 变更后的json属性 * @param {object} that 实例对象 * */ - generateScript:function (json,that) { + generateScript: function (json, that) { return ''; } }, @@ -879,14 +879,14 @@ layui.config({base: './ayq/modules/'}).define(["layer",'flow', "laytpl", "elemen * @param {object} elem 表单面板jquery对象 * @param {object} that 实例对象 * */ - render: function (json, selected,elem,that) { + render: function (json, selected, elem, that) { if (selected === undefined) { selected = false; } var _disabled = json.disabled ? 'disabled=""' : ''; var _hideLabel = json.hideLabel ? 'display: none;' : ''; var _html = '
'.format(json.id, json.tag, selected ? 'active' : '', json.index); - _html += ''.format(json.label,json.labelWidth,_hideLabel); + _html += ''.format(json.label, json.labelWidth, _hideLabel); if (json.hideLabel) { _html += '
'; } else { @@ -908,22 +908,22 @@ layui.config({base: './ayq/modules/'}).define(["layer",'flow', "laytpl", "elemen * @param {object} json 变更后的json属性 * @param {object} that 实例对象 * */ - update: function (json,that) { + update: function (json, that) { var _disabled = json.disabled ? 'disabled=""' : ''; var $block = $('#' + json.id + ' .layui-input-block'); var $label = $('#' + json.id + ' .layui-form-label'); $block.empty(); $label.empty(); - $label.css("width",json.labelWidth); + $label.css("width", json.labelWidth); $label.append(json.label + ":"); if (json.hideLabel) { - $label.css("display","none"); - $block.css("margin-left","0px"); - $block.css({width: 'calc({0} - {1}px)'.format(json.width,json.labelWidth)}); + $label.css("display", "none"); + $block.css("margin-left", "0px"); + $block.css({width: 'calc({0} - {1}px)'.format(json.width, json.labelWidth)}); } else { - $label.css("display","block"); - $block.css("margin-left",json.labelWidth); - $block.css({width: 'calc({0} - {1}px)'.format(json.width,json.labelWidth)}); + $label.css("display", "block"); + $block.css("margin-left", json.labelWidth); + $block.css({width: 'calc({0} - {1}px)'.format(json.width, json.labelWidth)}); } var _html = ''; //重绘设计区改id下的所有元素 @@ -956,7 +956,7 @@ layui.config({base: './ayq/modules/'}).define(["layer",'flow', "laytpl", "elemen * @param {object} json 当前组件的json属性 * @param {object} that 实例对象 * */ - property: function (json,that) { + property: function (json, that) { that.renderCommonProperty(json); //根据 json 对象获取对应的属性的html that.initCommonProperty(json); //初始化 json 对象获取对应的属性 }, @@ -966,14 +966,14 @@ layui.config({base: './ayq/modules/'}).define(["layer",'flow', "laytpl", "elemen * @param {boolean} selected 是否被选中 * @param {object} that 实例对象 * */ - generateHtml: function (json,selected,that) { + generateHtml: function (json, selected, that) { if (selected === undefined) { selected = false; } var _disabled = json.disabled ? 'disabled=""' : ''; var _hideLabel = json.hideLabel ? 'display: none;' : ''; var _html = '
'.format(json.id, json.tag, selected ? 'active' : '', json.index); - _html += ''.format(json.label,json.labelWidth,_hideLabel); + _html += ''.format(json.label, json.labelWidth, _hideLabel); if (json.hideLabel) { _html += '
'; } else { @@ -995,7 +995,7 @@ layui.config({base: './ayq/modules/'}).define(["layer",'flow', "laytpl", "elemen * @param {object} json 变更后的json属性 * @param {object} that 实例对象 * */ - generateScript:function (json,that) { + generateScript: function (json, that) { return ''; } }, @@ -1007,7 +1007,7 @@ layui.config({base: './ayq/modules/'}).define(["layer",'flow', "laytpl", "elemen * @param {object} elem 表单面板jquery对象 * @param {object} that 实例对象 * */ - render: function (json, selected,elem,that) { + render: function (json, selected, elem, that) { if (selected === undefined) { selected = false; } @@ -1015,7 +1015,7 @@ layui.config({base: './ayq/modules/'}).define(["layer",'flow', "laytpl", "elemen var _required = json.required ? 'lay-verify="otherReq"' : ''; var _hideLabel = json.hideLabel ? 'display: none;' : ''; var _html = '
'.format(json.id, json.tag, selected ? 'active' : '', json.index); - _html += ''.format(json.required ? 'layui-form-required' : '', json.label,json.required ? '*' : '',json.labelWidth,_hideLabel); + _html += ''.format(json.required ? 'layui-form-required' : '', json.label, json.required ? '*' : '', json.labelWidth, _hideLabel); if (json.hideLabel) { _html += '
'; } else { @@ -1023,9 +1023,9 @@ layui.config({base: './ayq/modules/'}).define(["layer",'flow', "laytpl", "elemen } for (var i = 0; i < json.options.length; i++) { if (json.options[i].checked) { - _html += ''.format(json.id, json.options[i].value, json.options[i].text, _disabled,_required); + _html += ''.format(json.id, json.options[i].value, json.options[i].text, _disabled, _required); } else { - _html += ''.format(json.id, json.options[i].value, json.options[i].text, _disabled,_required); + _html += ''.format(json.id, json.options[i].value, json.options[i].text, _disabled, _required); } } _html += '
'; @@ -1037,7 +1037,7 @@ layui.config({base: './ayq/modules/'}).define(["layer",'flow', "laytpl", "elemen * @param {object} json 变更后的json属性 * @param {object} that 实例对象 * */ - update: function (json,that) { + update: function (json, that) { var _disabled = json.disabled ? 'disabled=""' : ''; var _required = json.required ? 'lay-verify="otherReq"' : ''; var $block = $('#' + json.id + ' .layui-input-block'); @@ -1048,19 +1048,19 @@ layui.config({base: './ayq/modules/'}).define(["layer",'flow', "laytpl", "elemen //重绘设计区改id下的所有元素 for (var i = 0; i < json.options.length; i++) { if (json.options[i].checked) { - _html += ''.format(json.id, json.options[i].value, json.options[i].text, _disabled,_required); + _html += ''.format(json.id, json.options[i].value, json.options[i].text, _disabled, _required); } else { - _html += ''.format(json.id, json.options[i].value, json.options[i].text, _disabled,_required); + _html += ''.format(json.id, json.options[i].value, json.options[i].text, _disabled, _required); } } $block.append(_html); - $label.css("width",json.labelWidth); + $label.css("width", json.labelWidth); if (json.hideLabel) { - $label.css("display","none"); - $block.css("margin-left","0px"); + $label.css("display", "none"); + $block.css("margin-left", "0px"); } else { - $label.css("display","block"); - $block.css("margin-left",json.labelWidth); + $label.css("display", "block"); + $block.css("margin-left", json.labelWidth); } if (json.required) { $label.append('*'); @@ -1087,7 +1087,7 @@ layui.config({base: './ayq/modules/'}).define(["layer",'flow', "laytpl", "elemen * @param {object} json 当前组件的json属性 * @param {object} that 实例对象 * */ - property: function (json,that) { + property: function (json, that) { that.renderCommonProperty(json); //根据 json 对象获取对应的属性的html that.initCommonProperty(json); //初始化 json 对象获取对应的属性 }, @@ -1097,7 +1097,7 @@ layui.config({base: './ayq/modules/'}).define(["layer",'flow', "laytpl", "elemen * @param {boolean} selected 是否被选中 * @param {object} that 实例对象 * */ - generateHtml: function (json,selected,that) { + generateHtml: function (json, selected, that) { if (selected === undefined) { selected = false; } @@ -1105,7 +1105,7 @@ layui.config({base: './ayq/modules/'}).define(["layer",'flow', "laytpl", "elemen var _required = json.required ? 'lay-verify="otherReq"' : ''; var _hideLabel = json.hideLabel ? 'display: none;' : ''; var _html = '
'.format(json.id, json.tag, selected ? 'active' : '', json.index); - _html += ''.format(json.required ? 'layui-form-required' : '', json.label,json.required ? '*' : '',json.labelWidth,_hideLabel); + _html += ''.format(json.required ? 'layui-form-required' : '', json.label, json.required ? '*' : '', json.labelWidth, _hideLabel); if (json.hideLabel) { _html += '
'; } else { @@ -1113,9 +1113,9 @@ layui.config({base: './ayq/modules/'}).define(["layer",'flow', "laytpl", "elemen } for (var i = 0; i < json.options.length; i++) { if (json.options[i].checked) { - _html += ''.format(json.id, json.options[i].value, json.options[i].text, _disabled,_required); + _html += ''.format(json.id, json.options[i].value, json.options[i].text, _disabled, _required); } else { - _html += ''.format(json.id, json.options[i].value, json.options[i].text, _disabled,_required); + _html += ''.format(json.id, json.options[i].value, json.options[i].text, _disabled, _required); } } _html += '
'; @@ -1127,7 +1127,7 @@ layui.config({base: './ayq/modules/'}).define(["layer",'flow', "laytpl", "elemen * @param {object} json 变更后的json属性 * @param {object} that 实例对象 * */ - generateScript:function (json,that) { + generateScript: function (json, that) { return ''; } }, @@ -1139,7 +1139,7 @@ layui.config({base: './ayq/modules/'}).define(["layer",'flow', "laytpl", "elemen * @param {object} elem 表单面板jquery对象 * @param {object} that 实例对象 * */ - render: function (json, selected,elem,that) { + render: function (json, selected, elem, that) { if (selected === undefined) { selected = false; } @@ -1147,11 +1147,11 @@ layui.config({base: './ayq/modules/'}).define(["layer",'flow', "laytpl", "elemen var _disabledClass = json.disabled ? ' layui-disabled' : ''; var _hideLabel = json.hideLabel ? 'display: none;' : ''; var _html = '
'.format(json.id, json.tag, selected ? 'active' : '', json.index); - _html += ''.format(json.label,json.labelWidth,_hideLabel); + _html += ''.format(json.label, json.labelWidth, _hideLabel); if (json.hideLabel) { - _html += '
'.format(json.width,json.labelWidth); + _html += '
'.format(json.width, json.labelWidth); } else { - _html += '
'.format(json.width,json.labelWidth); + _html += '
'.format(json.width, json.labelWidth); } _html += ''.format(json.id, _disabled, _disabledClass, json.switchValue ? 'checked' : ''); _html += '
'; @@ -1163,7 +1163,7 @@ layui.config({base: './ayq/modules/'}).define(["layer",'flow', "laytpl", "elemen * @param {object} json 变更后的json属性 * @param {object} that 实例对象 * */ - update: function (json,that) { + update: function (json, that) { var _disabled = json.disabled ? 'disabled=""' : ''; var _disabledClass = json.disabled ? ' layui-disabled' : ''; var $block = $('#' + json.id + ' .layui-input-block'); @@ -1175,16 +1175,16 @@ layui.config({base: './ayq/modules/'}).define(["layer",'flow', "laytpl", "elemen $block.append(_html); $label.append(json.label + ":"); if (json.hideLabel) { - $label.css("display","none"); - $block.css("margin-left","0px"); - $block.css("border","0px"); + $label.css("display", "none"); + $block.css("margin-left", "0px"); + $block.css("border", "0px"); $block.css({width: 'calc({0})'.format(json.width)}); } else { - $label.css("display","block"); - $block.css("margin-left",json.labelWidth); - $block.css({width: 'calc({0} - {1}px)'.format(json.width,json.labelWidth)}); + $label.css("display", "block"); + $block.css("margin-left", json.labelWidth); + $block.css({width: 'calc({0} - {1}px)'.format(json.width, json.labelWidth)}); } - $label.css("width",json.labelWidth); + $label.css("width", json.labelWidth); form.render('checkbox'); }, /** @@ -1205,7 +1205,7 @@ layui.config({base: './ayq/modules/'}).define(["layer",'flow', "laytpl", "elemen * @param {object} json 当前组件的json属性 * @param {object} that 实例对象 * */ - property: function (json,that) { + property: function (json, that) { that.renderCommonProperty(json); //根据 json 对象获取对应的属性的html that.initCommonProperty(json); //初始化 json 对象获取对应的属性 }, @@ -1215,7 +1215,7 @@ layui.config({base: './ayq/modules/'}).define(["layer",'flow', "laytpl", "elemen * @param {boolean} selected 是否被选中 * @param {object} that 实例对象 * */ - generateHtml: function (json,selected,that) { + generateHtml: function (json, selected, that) { if (selected === undefined) { selected = false; } @@ -1223,11 +1223,11 @@ layui.config({base: './ayq/modules/'}).define(["layer",'flow', "laytpl", "elemen var _disabledClass = json.disabled ? ' layui-disabled' : ''; var _hideLabel = json.hideLabel ? 'display: none;' : ''; var _html = '
'.format(json.id, json.tag, selected ? 'active' : '', json.index); - _html += ''.format(json.label,json.labelWidth,_hideLabel); + _html += ''.format(json.label, json.labelWidth, _hideLabel); if (json.hideLabel) { - _html += '
'.format(json.width,json.labelWidth); + _html += '
'.format(json.width, json.labelWidth); } else { - _html += '
'.format(json.width,json.labelWidth); + _html += '
'.format(json.width, json.labelWidth); } _html += ''.format(json.id, _disabled, _disabledClass, json.switchValue ? 'checked' : ''); _html += '
'; @@ -1239,7 +1239,7 @@ layui.config({base: './ayq/modules/'}).define(["layer",'flow', "laytpl", "elemen * @param {object} json 变更后的json属性 * @param {object} that 实例对象 * */ - generateScript:function (json,that) { + generateScript: function (json, that) { return ''; } }, @@ -1251,21 +1251,21 @@ layui.config({base: './ayq/modules/'}).define(["layer",'flow', "laytpl", "elemen * @param {object} elem 表单面板jquery对象 * @param {object} that 实例对象 * */ - render: function (json, selected,elem,that) { + render: function (json, selected, elem, that) { if (selected === undefined) { selected = false; } var _disabled = json.disabled ? 'disabled=""' : ''; var _hideLabel = json.hideLabel ? 'display: none;' : ''; var _html = '
'.format(json.id, json.tag, selected ? 'active' : '', json.index); - _html += ''.format(json.label,json.labelWidth,_hideLabel); + _html += ''.format(json.label, json.labelWidth, _hideLabel); if (json.hideLabel) { _html += '
'.format(json.width); } else { - _html += '
'.format(json.width,json.labelWidth); + _html += '
'.format(json.width, json.labelWidth); } _html += '
'.format(json.tag + json.id); - _html += ''.format(json.id,json.defaultValue); + _html += ''.format(json.id, json.defaultValue); _html += '
'; _html += '
'; elem.append(_html); @@ -1276,7 +1276,7 @@ layui.config({base: './ayq/modules/'}).define(["layer",'flow', "laytpl", "elemen max: json.maxValue, step: json.stepValue, disabled: json.disabled, - input:json.isInput, + input: json.isInput, }); }, /** @@ -1284,20 +1284,20 @@ layui.config({base: './ayq/modules/'}).define(["layer",'flow', "laytpl", "elemen * @param {object} json 变更后的json属性 * @param {object} that 实例对象 * */ - update: function (json,that) { + update: function (json, that) { var $block = $('#' + json.id + ' .layui-input-block'); var $label = $('#' + json.id + ' .layui-form-label'); $label.empty(); - $label.css("width",json.labelWidth); + $label.css("width", json.labelWidth); $label.append(json.label + ":"); if (json.hideLabel) { - $label.css("display","none"); - $block.css("margin-left","0px"); + $label.css("display", "none"); + $block.css("margin-left", "0px"); $block.css({width: 'calc({0})'.format(json.width)}); } else { - $label.css("display","block"); - $block.css("margin-left",json.labelWidth); - $block.css({width: 'calc({0} - {1}px)'.format(json.width,json.labelWidth)}); + $label.css("display", "block"); + $block.css("margin-left", json.labelWidth); + $block.css({width: 'calc({0} - {1}px)'.format(json.width, json.labelWidth)}); } slider.render({ elem: '#' + json.tag + json.id, @@ -1306,7 +1306,7 @@ layui.config({base: './ayq/modules/'}).define(["layer",'flow', "laytpl", "elemen max: json.maxValue, step: json.stepValue, disabled: json.disabled, - input:json.isInput, + input: json.isInput, }); }, /** @@ -1328,7 +1328,7 @@ layui.config({base: './ayq/modules/'}).define(["layer",'flow', "laytpl", "elemen * @param {object} json 当前组件的json属性 * @param {object} that 实例对象 * */ - property: function (json,that) { + property: function (json, that) { that.renderCommonProperty(json); //根据 json 对象获取对应的属性的html that.initCommonProperty(json); //初始化 json 对象获取对应的属性 }, @@ -1338,21 +1338,21 @@ layui.config({base: './ayq/modules/'}).define(["layer",'flow', "laytpl", "elemen * @param {boolean} selected 是否被选中 * @param {object} that 实例对象 * */ - generateHtml: function (json,selected,that) { + generateHtml: function (json, selected, that) { if (selected === undefined) { selected = false; } var _disabled = json.disabled ? 'disabled=""' : ''; var _hideLabel = json.hideLabel ? 'display: none;' : ''; var _html = '
'.format(json.id, json.tag, selected ? 'active' : '', json.index); - _html += ''.format(json.label,json.labelWidth,_hideLabel); + _html += ''.format(json.label, json.labelWidth, _hideLabel); if (json.hideLabel) { _html += '
'.format(json.width); } else { - _html += '
'.format(json.width,json.labelWidth); + _html += '
'.format(json.width, json.labelWidth); } _html += '
'.format(json.tag + json.id); - _html += ''.format(json.id,json.defaultValue); + _html += ''.format(json.id, json.defaultValue); _html += '
'; _html += '
'; return _html; @@ -1362,7 +1362,7 @@ layui.config({base: './ayq/modules/'}).define(["layer",'flow', "laytpl", "elemen * @param {object} json 变更后的json属性 * @param {object} that 实例对象 * */ - generateScript:function (json,that) { + generateScript: function (json, that) { var scriptHtmlCode = ''; scriptHtmlCode += ['slider.render({', , 'elem: "#' + json.tag + json.id + '" ,' @@ -1386,7 +1386,7 @@ layui.config({base: './ayq/modules/'}).define(["layer",'flow', "laytpl", "elemen * @param {object} elem 表单面板jquery对象 * @param {object} that 实例对象 * */ - render: function (json, selected,elem,that) { + render: function (json, selected, elem, that) { if (selected === undefined) { selected = false; } @@ -1395,13 +1395,13 @@ layui.config({base: './ayq/modules/'}).define(["layer",'flow', "laytpl", "elemen var _required = json.required ? 'required' : ''; var _hideLabel = json.hideLabel ? 'display: none;' : ''; var _html = '
'.format(json.id, json.tag, selected ? 'active' : '', json.index); - _html += ''.format(json.required ? 'layui-form-required' : '', json.label,json.required ? '*' : '',json.labelWidth,_hideLabel); + _html += ''.format(json.required ? 'layui-form-required' : '', json.label, json.required ? '*' : '', json.labelWidth, _hideLabel); if (json.hideLabel) { _html += '
'.format(json.width); } else { - _html += '
'.format(json.width,json.labelWidth); + _html += '
'.format(json.width, json.labelWidth); } - _html += ''.format(json.tag + json.id,_disabledClass,_disabledStyle,_required); + _html += ''.format(json.tag + json.id, _disabledClass, _disabledStyle, _required); _html += '
'; _html += '
'; elem.append(_html); @@ -1420,7 +1420,7 @@ layui.config({base: './ayq/modules/'}).define(["layer",'flow', "laytpl", "elemen * @param {object} json 变更后的json属性 * @param {object} that 实例对象 * */ - update: function (json,that) { + update: function (json, that) { var _disabledClass = json.disabled ? ' layui-disabled' : ''; var _disabledStyle = json.disabled ? ' pointer-events: none;' : ''; var _required = json.required ? 'required' : ''; @@ -1429,20 +1429,20 @@ layui.config({base: './ayq/modules/'}).define(["layer",'flow', "laytpl", "elemen $block.empty(); $label.empty(); if (json.hideLabel) { - $label.css("display","none"); - $block.css("margin-left","0px"); + $label.css("display", "none"); + $block.css("margin-left", "0px"); $block.css({width: 'calc({0})'.format(json.width)}); } else { - $label.css("display","block"); - $block.css("margin-left",json.labelWidth); - $block.css({width: 'calc({0} - {1}px)'.format(json.width,json.labelWidth)}); + $label.css("display", "block"); + $block.css("margin-left", json.labelWidth); + $block.css({width: 'calc({0} - {1}px)'.format(json.width, json.labelWidth)}); } - $label.css("width",json.labelWidth); + $label.css("width", json.labelWidth); if (json.required) { $label.append('*'); } $label.append(json.label + ":"); - var _html = ''.format(json.tag + json.id,_disabledClass,_disabledStyle,_required); + var _html = ''.format(json.tag + json.id, _disabledClass, _disabledStyle, _required); $block.append(_html); laydate.render({ elem: '#' + json.tag + json.id, @@ -1473,7 +1473,7 @@ layui.config({base: './ayq/modules/'}).define(["layer",'flow', "laytpl", "elemen * @param {object} json 当前组件的json属性 * @param {object} that 实例对象 * */ - property: function (json,that) { + property: function (json, that) { that.renderCommonProperty(json); //根据 json 对象获取对应的属性的html that.initCommonProperty(json); //初始化 json 对象获取对应的属性 }, @@ -1483,7 +1483,7 @@ layui.config({base: './ayq/modules/'}).define(["layer",'flow', "laytpl", "elemen * @param {boolean} selected 是否被选中 * @param {object} that 实例对象 * */ - generateHtml: function (json,selected,that) { + generateHtml: function (json, selected, that) { if (selected === undefined) { selected = false; } @@ -1492,13 +1492,13 @@ layui.config({base: './ayq/modules/'}).define(["layer",'flow', "laytpl", "elemen var _required = json.required ? 'required' : ''; var _hideLabel = json.hideLabel ? 'display: none;' : ''; var _html = '
'.format(json.id, json.tag, selected ? 'active' : '', json.index); - _html += ''.format(json.required ? 'layui-form-required' : '', json.label,json.required ? '*' : '',json.labelWidth,_hideLabel); + _html += ''.format(json.required ? 'layui-form-required' : '', json.label, json.required ? '*' : '', json.labelWidth, _hideLabel); if (json.hideLabel) { _html += '
'.format(json.width); } else { - _html += '
'.format(json.width,json.labelWidth); + _html += '
'.format(json.width, json.labelWidth); } - _html += ''.format(json.tag + json.id,_disabledClass,_disabledStyle,_required); + _html += ''.format(json.tag + json.id, _disabledClass, _disabledStyle, _required); _html += '
'; _html += '
'; return _html; @@ -1508,7 +1508,7 @@ layui.config({base: './ayq/modules/'}).define(["layer",'flow', "laytpl", "elemen * @param {object} json 变更后的json属性 * @param {object} that 实例对象 * */ - generateScript:function (json,that) { + generateScript: function (json, that) { var scriptHtmlCode = ''; scriptHtmlCode += ['laydate.render({' , 'elem: "#' + json.tag + json.id + '" ,' @@ -1528,7 +1528,7 @@ layui.config({base: './ayq/modules/'}).define(["layer",'flow', "laytpl", "elemen * @param {object} elem 表单面板jquery对象 * @param {object} that 实例对象 * */ - render: function (json, selected,elem,that) { + render: function (json, selected, elem, that) { if (selected === undefined) { selected = false; } @@ -1536,14 +1536,14 @@ layui.config({base: './ayq/modules/'}).define(["layer",'flow', "laytpl", "elemen var _required = json.required ? 'required=""' : ''; var _hideLabel = json.hideLabel ? 'display: none;' : ''; var _html = '
'.format(json.id, json.tag, selected ? 'active' : '', json.index); - _html += ''.format(json.required ? 'layui-form-required' : '', json.label,json.labelWidth,_hideLabel); + _html += ''.format(json.required ? 'layui-form-required' : '', json.label, json.labelWidth, _hideLabel); if (json.hideLabel) { _html += '
'; } else { _html += '
'.format(json.labelWidth + 30); } _html += '
'.format(json.tag + json.id); - _html += ''.format(json.id,json.defaultValue); + _html += ''.format(json.id, json.defaultValue); _html += '
'; _html += '
'; elem.append(_html); @@ -1555,7 +1555,7 @@ layui.config({base: './ayq/modules/'}).define(["layer",'flow', "laytpl", "elemen half: json.half, readonly: json.readonly, theme: json.colorSelection, - choose: function(value){ + choose: function (value) { $("#" + json.id).find("input[name=" + json.id + "]").val(value); } }); @@ -1565,16 +1565,16 @@ layui.config({base: './ayq/modules/'}).define(["layer",'flow', "laytpl", "elemen * @param {object} json 变更后的json属性 * @param {object} that 实例对象 * */ - update: function (json,that) { + update: function (json, that) { var $block = $('#' + json.id + ' .layui-input-block'); var $label = $('#' + json.id + ' .layui-form-label'); $label.empty(); if (json.hideLabel) { - $label.css("display","none"); - $block.css("margin-left","0px"); + $label.css("display", "none"); + $block.css("margin-left", "0px"); } else { - $label.css("display","block"); - $block.css("margin-left",json.labelWidth + 30); + $label.css("display", "block"); + $block.css("margin-left", json.labelWidth + 30); } $label.append(json.label + ":"); rate.render({ @@ -1585,7 +1585,7 @@ layui.config({base: './ayq/modules/'}).define(["layer",'flow', "laytpl", "elemen half: json.half, readonly: json.readonly, theme: json.colorSelection, - choose: function(value){ + choose: function (value) { $("#" + json.id).find("input[name=" + json.id + "]").val(value); } }); @@ -1609,7 +1609,7 @@ layui.config({base: './ayq/modules/'}).define(["layer",'flow', "laytpl", "elemen * @param {object} json 当前组件的json属性 * @param {object} that 实例对象 * */ - property: function (json,that) { + property: function (json, that) { that.renderCommonProperty(json); //根据 json 对象获取对应的属性的html that.initCommonProperty(json); //初始化 json 对象获取对应的属性 }, @@ -1619,7 +1619,7 @@ layui.config({base: './ayq/modules/'}).define(["layer",'flow', "laytpl", "elemen * @param {boolean} selected 是否被选中 * @param {object} that 实例对象 * */ - generateHtml: function (json,selected,that) { + generateHtml: function (json, selected, that) { if (selected === undefined) { selected = false; } @@ -1628,13 +1628,13 @@ layui.config({base: './ayq/modules/'}).define(["layer",'flow', "laytpl", "elemen var _required = json.required ? 'required' : ''; var _hideLabel = json.hideLabel ? 'display: none;' : ''; var _html = '
'.format(json.id, json.tag, selected ? 'active' : '', json.index); - _html += ''.format(json.required ? 'layui-form-required' : '', json.label,json.required ? '*' : '',json.labelWidth,_hideLabel); + _html += ''.format(json.required ? 'layui-form-required' : '', json.label, json.required ? '*' : '', json.labelWidth, _hideLabel); if (json.hideLabel) { _html += '
'; } else { _html += '
'.format(json.labelWidth + 30); } - _html += ''.format(json.tag + json.id,_disabledClass,_disabledStyle,_required); + _html += ''.format(json.tag + json.id, _disabledClass, _disabledStyle, _required); _html += '
'; _html += '
'; return _html; @@ -1644,7 +1644,7 @@ layui.config({base: './ayq/modules/'}).define(["layer",'flow', "laytpl", "elemen * @param {object} json 变更后的json属性 * @param {object} that 实例对象 * */ - generateScript:function (json,that) { + generateScript: function (json, that) { var scriptHtmlCode = ''; scriptHtmlCode += ['rate.render({' , 'elem: "#' + json.tag + json.id + '" ,' @@ -1669,7 +1669,7 @@ layui.config({base: './ayq/modules/'}).define(["layer",'flow', "laytpl", "elemen * @param {object} elem 表单面板jquery对象 * @param {object} that 实例对象 * */ - render: function (json, selected,elem,that) { + render: function (json, selected, elem, that) { if (selected === undefined) { selected = false; } @@ -1699,7 +1699,7 @@ layui.config({base: './ayq/modules/'}).define(["layer",'flow', "laytpl", "elemen * @param {object} json 变更后的json属性 * @param {object} that 实例对象 * */ - update: function (json,that) { + update: function (json, that) { $('#' + json.tag + json.id).remove(); var _html = ''; _html += ''; elem.append(_html); if (that.config.viewOrDesign) { - var data = {"select":json.tag + json.id,"uploadUrl": json.uploadUrl}; + var data = {"select": json.tag + json.id, "uploadUrl": json.uploadUrl}; images.push(data); } }, @@ -1961,7 +1962,7 @@ layui.config({base: './ayq/modules/'}).define(["layer",'flow', "laytpl", "elemen * @param {object} json 变更后的json属性 * @param {object} that 实例对象 * */ - update: function (json,that) { + update: function (json, that) { }, /** @@ -1986,7 +1987,7 @@ layui.config({base: './ayq/modules/'}).define(["layer",'flow', "laytpl", "elemen * @param {object} json 当前组件的json属性 * @param {object} that 实例对象 * */ - property: function (json,that) { + property: function (json, that) { that.renderCommonProperty(json); //根据 json 对象获取对应的属性的html that.initCommonProperty(json); //初始化 json 对象获取对应的属性 }, @@ -1996,7 +1997,7 @@ layui.config({base: './ayq/modules/'}).define(["layer",'flow', "laytpl", "elemen * @param {boolean} selected 是否被选中 * @param {object} that 实例对象 * */ - generateHtml: function (json,selected,that) { + generateHtml: function (json, selected, that) { if (selected === undefined) { selected = false; } @@ -2019,7 +2020,7 @@ layui.config({base: './ayq/modules/'}).define(["layer",'flow', "laytpl", "elemen * @param {object} json 变更后的json属性 * @param {object} that 实例对象 * */ - generateScript:function (json,that) { + generateScript: function (json, that) { var scriptHtmlCode = ''; scriptHtmlCode += ['upload.render({' , 'elem: "#' + json.tag + json.id + '" ' @@ -2052,7 +2053,7 @@ layui.config({base: './ayq/modules/'}).define(["layer",'flow', "laytpl", "elemen * @param {object} elem 表单面板jquery对象 * @param {object} that 实例对象 * */ - render: function (json, selected,elem,that) { + render: function (json, selected, elem, that) { if (selected === undefined) { selected = false; } @@ -2073,7 +2074,7 @@ layui.config({base: './ayq/modules/'}).define(["layer",'flow', "laytpl", "elemen _html += '
'; elem.append(_html); if (that.config.viewOrDesign) { - var data = {"select":json.tag + json.id,"uploadUrl": json.uploadUrl}; + var data = {"select": json.tag + json.id, "uploadUrl": json.uploadUrl}; files.push(data); } }, @@ -2082,7 +2083,7 @@ layui.config({base: './ayq/modules/'}).define(["layer",'flow', "laytpl", "elemen * @param {object} json 变更后的json属性 * @param {object} that 实例对象 * */ - update: function (json,that) { + update: function (json, that) { }, /** @@ -2107,7 +2108,7 @@ layui.config({base: './ayq/modules/'}).define(["layer",'flow', "laytpl", "elemen * @param {object} json 当前组件的json属性 * @param {object} that 实例对象 * */ - property: function (json,that) { + property: function (json, that) { that.renderCommonProperty(json); //根据 json 对象获取对应的属性的html that.initCommonProperty(json); //初始化 json 对象获取对应的属性 }, @@ -2117,7 +2118,7 @@ layui.config({base: './ayq/modules/'}).define(["layer",'flow', "laytpl", "elemen * @param {boolean} selected 是否被选中 * @param {object} that 实例对象 * */ - generateHtml: function (json,selected,that) { + generateHtml: function (json, selected, that) { if (selected === undefined) { selected = false; } @@ -2143,7 +2144,7 @@ layui.config({base: './ayq/modules/'}).define(["layer",'flow', "laytpl", "elemen * @param {object} json 变更后的json属性 * @param {object} that 实例对象 * */ - generateScript:function (json,that) { + generateScript: function (json, that) { var scriptHtmlCode = ''; scriptHtmlCode += ['upload.render({' , 'elem: "#' + json.tag + json.id + '" ' @@ -2186,7 +2187,7 @@ layui.config({base: './ayq/modules/'}).define(["layer",'flow', "laytpl", "elemen * @param {object} elem 表单面板jquery对象 * @param {object} that 实例对象 * */ - render: function (json, selected,elem,that) { + render: function (json, selected, elem, that) { if (selected === undefined) { selected = false; } @@ -2196,14 +2197,14 @@ layui.config({base: './ayq/modules/'}).define(["layer",'flow', "laytpl", "elemen var _hideLabel = json.hideLabel ? 'display: none;' : ''; var _html = '
'.format(json.id, json.tag, selected ? 'active' : '', json.index); _html += '
'; - _html += ''.format(json.required ? 'layui-form-required' : '', json.label,json.required ? '*' : '',json.labelWidth,_hideLabel); - _html += '
'.format(json.tag + json.id,_disabledStyle); + _html += ''.format(json.required ? 'layui-form-required' : '', json.label, json.required ? '*' : '', json.labelWidth, _hideLabel); + _html += '
'.format(json.tag + json.id, _disabledStyle); _html += '
'; - _html += ''.format(json.tag + json.id,_disabledClass,json.id,_required); + _html += ''.format(json.tag + json.id, _disabledClass, json.id, _required); _html += '
'; _html += '
-
'; _html += '
'; - _html += ''.format(json.tag + json.id,_disabledClass,json.id,_required); + _html += ''.format(json.tag + json.id, _disabledClass, json.id, _required); _html += '
'; _html += '
'; _html += '
'; @@ -2229,20 +2230,20 @@ layui.config({base: './ayq/modules/'}).define(["layer",'flow', "laytpl", "elemen * @param {object} json 变更后的json属性 * @param {object} that 实例对象 * */ - update: function (json,that) { + update: function (json, that) { var _disabledClass = json.disabled ? ' layui-disabled' : ''; var _disabledStyle = json.disabled ? ' pointer-events: none;' : ''; var _required = json.required ? 'required' : ''; var _hideLabel = json.hideLabel ? 'display: none;' : ''; var _html = '
'; - _html += ''.format(json.required ? 'layui-form-required' : '', json.label,json.required ? '*' : '',json.labelWidth,_hideLabel); - _html += '
'.format(json.tag + json.id,_disabledStyle); + _html += ''.format(json.required ? 'layui-form-required' : '', json.label, json.required ? '*' : '', json.labelWidth, _hideLabel); + _html += '
'.format(json.tag + json.id, _disabledStyle); _html += '
'; - _html += ''.format(json.tag + json.id,_disabledClass,json.id,_required); + _html += ''.format(json.tag + json.id, _disabledClass, json.id, _required); _html += '
'; _html += '
-
'; _html += '
'; - _html += ''.format(json.tag + json.id,_disabledClass,json.id,_required); + _html += ''.format(json.tag + json.id, _disabledClass, json.id, _required); _html += '
'; _html += '
'; _html += '
'; @@ -2282,7 +2283,7 @@ layui.config({base: './ayq/modules/'}).define(["layer",'flow', "laytpl", "elemen * @param {object} json 当前组件的json属性 * @param {object} that 实例对象 * */ - property: function (json,that) { + property: function (json, that) { that.renderCommonProperty(json); //根据 json 对象获取对应的属性的html that.initCommonProperty(json); //初始化 json 对象获取对应的属性 }, @@ -2292,7 +2293,7 @@ layui.config({base: './ayq/modules/'}).define(["layer",'flow', "laytpl", "elemen * @param {boolean} selected 是否被选中 * @param {object} that 实例对象 * */ - generateHtml: function (json,selected,that) { + generateHtml: function (json, selected, that) { if (selected === undefined) { selected = false; } @@ -2302,14 +2303,14 @@ layui.config({base: './ayq/modules/'}).define(["layer",'flow', "laytpl", "elemen var _hideLabel = json.hideLabel ? 'display: none;' : ''; var _html = '
'.format(json.id, json.tag, selected ? 'active' : '', json.index); _html += '
'; - _html += ''.format(json.required ? 'layui-form-required' : '', json.label,json.required ? '*' : '',json.labelWidth,_hideLabel); - _html += '
'.format(json.tag + json.id,_disabledStyle); + _html += ''.format(json.required ? 'layui-form-required' : '', json.label, json.required ? '*' : '', json.labelWidth, _hideLabel); + _html += '
'.format(json.tag + json.id, _disabledStyle); _html += '
'; - _html += ''.format(json.tag + json.id,_disabledClass,json.id,_required); + _html += ''.format(json.tag + json.id, _disabledClass, json.id, _required); _html += '
'; _html += '
-
'; _html += '
'; - _html += ''.format(json.tag + json.id,_disabledClass,json.id,_required); + _html += ''.format(json.tag + json.id, _disabledClass, json.id, _required); _html += '
'; _html += '
'; _html += '
'; @@ -2321,16 +2322,16 @@ layui.config({base: './ayq/modules/'}).define(["layer",'flow', "laytpl", "elemen * @param {object} json 变更后的json属性 * @param {object} that 实例对象 * */ - generateScript:function (json,that) { + generateScript: function (json, that) { var scriptHtmlCode = ''; scriptHtmlCode += ['laydate.render({' - ,'elem:"#' + json.tag + json.id + '",' - ,'type:' + json.datetype + ',' - ,'format:' + json.dateformat + '' - ,'min:' + json.dataMinValue + '' - ,'max:' + json.dataMaxValue + '' - ,'range:["#start-' + json.tag + json.id + '", "#end-' + json.tag + json.id + '"]' - ,'});'].join(''); + , 'elem:"#' + json.tag + json.id + '",' + , 'type:' + json.datetype + ',' + , 'format:' + json.dateformat + '' + , 'min:' + json.dataMinValue + '' + , 'max:' + json.dataMaxValue + '' + , 'range:["#start-' + json.tag + json.id + '", "#end-' + json.tag + json.id + '"]' + , '});'].join(''); return scriptHtmlCode; } }, @@ -2342,7 +2343,7 @@ layui.config({base: './ayq/modules/'}).define(["layer",'flow', "laytpl", "elemen * @param {object} elem 表单面板jquery对象 * @param {object} that 实例对象 * */ - render: function (json, selected,elem,that) { + render: function (json, selected, elem, that) { if (selected === undefined) { selected = false; } @@ -2361,13 +2362,13 @@ layui.config({base: './ayq/modules/'}).define(["layer",'flow', "laytpl", "elemen } var _html = '
'.format(json.id, json.tag, selected ? 'active' : '', json.index); if (!json.hideLabel) { - _html += ''.format(json.label,json.labelWidth); + _html += ''.format(json.label, json.labelWidth); } _html += '
'; if (json.disabled) { - _html += ''.format(json.id + json.tag, json.buttonSize,_coustomCss ,json.buttonIcon,json.buttonVlaue); - }else { - _html += ''.format(json.id + json.tag, json.buttonSize, json.buttonType,_coustomCss ,json.buttonIcon,json.buttonVlaue); + _html += ''.format(json.id + json.tag, json.buttonSize, _coustomCss, json.buttonIcon, json.buttonVlaue); + } else { + _html += ''.format(json.id + json.tag, json.buttonSize, json.buttonType, _coustomCss, json.buttonIcon, json.buttonVlaue); } _html += '
'; _html += '
'; @@ -2378,17 +2379,17 @@ layui.config({base: './ayq/modules/'}).define(["layer",'flow', "laytpl", "elemen * @param {object} json 变更后的json属性 * @param {object} that 实例对象 * */ - update: function (json,that) { + update: function (json, that) { var $block = $('#' + json.id + ' .layui-input-block'); var $label = $('#' + json.id + ' .layui-form-label'); if (json.hideLabel) { $label.remove(); - $block.css("margin-left","0px"); - }else { + $block.css("margin-left", "0px"); + } else { if ($('#' + json.id).find("label").length === 0) { - $('#' + json.id).prepend(''.format(json.label,json.labelWidth)); - }else { - $label.css("width",json.labelWidth + "px"); + $('#' + json.id).prepend(''.format(json.label, json.labelWidth)); + } else { + $label.css("width", json.labelWidth + "px"); } $label.empty(); $label.append(json.label + ":"); @@ -2410,9 +2411,9 @@ layui.config({base: './ayq/modules/'}).define(["layer",'flow', "laytpl", "elemen } //重绘设计区改id下的所有元素 if (json.disabled) { - _html += ''.format(json.id + json.tag, json.buttonSize,_coustomCss ,json.buttonIcon,json.buttonVlaue); - }else { - _html += ''.format(json.id + json.tag, json.buttonSize, json.buttonType,_coustomCss ,json.buttonIcon,json.buttonVlaue); + _html += ''.format(json.id + json.tag, json.buttonSize, _coustomCss, json.buttonIcon, json.buttonVlaue); + } else { + _html += ''.format(json.id + json.tag, json.buttonSize, json.buttonType, _coustomCss, json.buttonIcon, json.buttonVlaue); } $block.append(_html); }, @@ -2434,7 +2435,7 @@ layui.config({base: './ayq/modules/'}).define(["layer",'flow', "laytpl", "elemen * @param {object} json 当前组件的json属性 * @param {object} that 实例对象 * */ - property: function (json,that) { + property: function (json, that) { that.renderCommonProperty(json); //根据 json 对象获取对应的属性的html that.initCommonProperty(json); //初始化 json 对象获取对应的属性 }, @@ -2444,7 +2445,7 @@ layui.config({base: './ayq/modules/'}).define(["layer",'flow', "laytpl", "elemen * @param {boolean} selected 是否被选中 * @param {object} that 实例对象 * */ - generateHtml: function (json,selected,that) { + generateHtml: function (json, selected, that) { if (selected === undefined) { selected = false; } @@ -2463,13 +2464,13 @@ layui.config({base: './ayq/modules/'}).define(["layer",'flow', "laytpl", "elemen } var _html = '
'.format(json.id, json.tag, selected ? 'active' : '', json.index); if (!json.hideLabel) { - _html += ''.format(json.label,json.labelWidth); + _html += ''.format(json.label, json.labelWidth); } _html += '
'; if (json.disabled) { - _html += ''.format(json.id + json.tag, json.buttonSize,_coustomCss ,json.buttonIcon,json.buttonVlaue); - }else { - _html += ''.format(json.id + json.tag, json.buttonSize, json.buttonType,_coustomCss ,json.buttonIcon,json.buttonVlaue); + _html += ''.format(json.id + json.tag, json.buttonSize, _coustomCss, json.buttonIcon, json.buttonVlaue); + } else { + _html += ''.format(json.id + json.tag, json.buttonSize, json.buttonType, _coustomCss, json.buttonIcon, json.buttonVlaue); } _html += '
'; _html += '
'; @@ -2480,7 +2481,7 @@ layui.config({base: './ayq/modules/'}).define(["layer",'flow', "laytpl", "elemen * @param {object} json 变更后的json属性 * @param {object} that 实例对象 * */ - generateScript:function (json,that) { + generateScript: function (json, that) { return ''; } }, @@ -2492,7 +2493,7 @@ layui.config({base: './ayq/modules/'}).define(["layer",'flow', "laytpl", "elemen * @param {object} elem 表单面板jquery对象 * @param {object} that 实例对象 * */ - render: function (json, selected,elem,that) { + render: function (json, selected, elem, that) { if (selected === undefined) { selected = false; } @@ -2501,28 +2502,28 @@ layui.config({base: './ayq/modules/'}).define(["layer",'flow', "laytpl", "elemen var _required = json.required ? 'required' : ''; var _hideLabel = json.hideLabel ? 'display: none;' : ''; var _html = '
'.format(json.id, json.tag, selected ? 'active' : '', json.index); - _html += ''.format( json.label,json.labelWidth,_hideLabel); + _html += ''.format(json.label, json.labelWidth, _hideLabel); if (json.hideLabel) { _html += '
'.format(json.width); } else { - _html += '
'.format(json.width,json.labelWidth); + _html += '
'.format(json.width, json.labelWidth); } _html += '' - .format(json.id, json.defaultValue ? json.defaultValue : '0', json.width, json.placeholder, _disabled , _disabledClass,json.minValue,json.maxValue,json.stepValue,json.tag + json.id); + .format(json.id, json.defaultValue ? json.defaultValue : '0', json.width, json.placeholder, _disabled, _disabledClass, json.minValue, json.maxValue, json.stepValue, json.tag + json.id); _html += '
'; _html += '
'; elem.append(_html); //定义初始值 numberInput.render({ - elem:'#' + json.tag + json.id + elem: '#' + json.tag + json.id }); - var _width = json.width.replace(/[^\d]/g,''); - if(''!=_width){ + var _width = json.width.replace(/[^\d]/g, ''); + if ('' != _width) { _width = 100 - parseInt(_width); } - $('#' + json.id + ' .layui-input-block .layui-number-input-btn').css("right",_width + "%"); + $('#' + json.id + ' .layui-input-block .layui-number-input-btn').css("right", _width + "%"); if (json.disabled) { - $('#' + json.id + ' .layui-input-block .layui-number-input-btn').css("z-index","-1"); + $('#' + json.id + ' .layui-input-block .layui-number-input-btn').css("z-index", "-1"); } }, /** @@ -2530,7 +2531,7 @@ layui.config({base: './ayq/modules/'}).define(["layer",'flow', "laytpl", "elemen * @param {object} json 变更后的json属性 * @param {object} that 实例对象 * */ - update: function (json,that) { + update: function (json, that) { var _disabled = json.disabled ? 'disabled=""' : ''; var _disabledClass = json.disabled ? ' layui-disabled' : ''; var $block = $('#' + json.id + ' .layui-input-block'); @@ -2538,31 +2539,31 @@ layui.config({base: './ayq/modules/'}).define(["layer",'flow', "laytpl", "elemen $block.empty(); $label.empty(); if (json.hideLabel) { - $label.css("display","none"); - $block.css("margin-left","0px"); + $label.css("display", "none"); + $block.css("margin-left", "0px"); $block.css({width: 'calc({0})'.format(json.width)}); } else { - $label.css("display","block"); - $block.css("margin-left",json.labelWidth); - $block.css({width: 'calc({0} - {1}px)'.format(json.width,json.labelWidth)}); + $label.css("display", "block"); + $block.css("margin-left", json.labelWidth); + $block.css({width: 'calc({0} - {1}px)'.format(json.width, json.labelWidth)}); } - $label.css("width",json.labelWidth); + $label.css("width", json.labelWidth); $label.append(json.label + ":"); var _html = ''; //重绘设计区改id下的所有元素 _html += '' - .format(json.id, json.defaultValue ? json.defaultValue : '0', json.width, json.placeholder, _disabled , _disabledClass,json.minValue,json.maxValue,json.stepValue,json.tag + json.id); + .format(json.id, json.defaultValue ? json.defaultValue : '0', json.width, json.placeholder, _disabled, _disabledClass, json.minValue, json.maxValue, json.stepValue, json.tag + json.id); $block.append(_html); numberInput.render({ - elem:'#' + json.tag + json.id + elem: '#' + json.tag + json.id }); - var _width = json.width.replace(/[^\d]/g,''); - if(''!=_width){ + var _width = json.width.replace(/[^\d]/g, ''); + if ('' != _width) { _width = 100 - parseInt(_width); } - $('#' + json.id + ' .layui-input-block .layui-number-input-btn').css("right",_width + "%"); + $('#' + json.id + ' .layui-input-block .layui-number-input-btn').css("right", _width + "%"); if (json.disabled) { - $('#' + json.id + ' .layui-input-block .layui-number-input-btn').css("z-index","-1"); + $('#' + json.id + ' .layui-input-block .layui-number-input-btn').css("z-index", "-1"); } }, /** @@ -2582,7 +2583,7 @@ layui.config({base: './ayq/modules/'}).define(["layer",'flow', "laytpl", "elemen * @param {object} json 当前组件的json属性 * @param {object} that 实例对象 * */ - property: function (json,that) { + property: function (json, that) { that.renderCommonProperty(json); //根据 json 对象获取对应的属性的html that.initCommonProperty(json); //初始化 json 对象获取对应的属性 }, @@ -2592,7 +2593,7 @@ layui.config({base: './ayq/modules/'}).define(["layer",'flow', "laytpl", "elemen * @param {boolean} selected 是否被选中 * @param {object} that 实例对象 * */ - generateHtml: function (json,selected,that) { + generateHtml: function (json, selected, that) { if (selected === undefined) { selected = false; } @@ -2601,14 +2602,14 @@ layui.config({base: './ayq/modules/'}).define(["layer",'flow', "laytpl", "elemen var _required = json.required ? 'required' : ''; var _hideLabel = json.hideLabel ? 'display: none;' : ''; var _html = '
'.format(json.id, json.tag, selected ? 'active' : '', json.index); - _html += ''.format( json.label,json.labelWidth,_hideLabel); + _html += ''.format(json.label, json.labelWidth, _hideLabel); if (json.hideLabel) { _html += '
'.format(json.width); } else { - _html += '
'.format(json.width,json.labelWidth); + _html += '
'.format(json.width, json.labelWidth); } _html += '' - .format(json.id, json.defaultValue ? json.defaultValue : '0', json.width, json.placeholder, _disabled , _disabledClass,json.minValue,json.maxValue,json.stepValue,json.tag + json.id); + .format(json.id, json.defaultValue ? json.defaultValue : '0', json.width, json.placeholder, _disabled, _disabledClass, json.minValue, json.maxValue, json.stepValue, json.tag + json.id); _html += '
'; _html += '
'; return _html; @@ -2618,14 +2619,14 @@ layui.config({base: './ayq/modules/'}).define(["layer",'flow', "laytpl", "elemen * @param {object} json 变更后的json属性 * @param {object} that 实例对象 * */ - generateScript:function (json,that) { + generateScript: function (json, that) { var scriptHtmlCode = ''; scriptHtmlCode += [' numberInput.render({' - ,'elem:"#' + json.tag + json.id + '"' - ,'});var _width = ' + json.width.replace(/[^\d]/g,'') + ';' - ,'if(""!=_width){_width = 100 - parseInt(_width);}' - ,'$("#' + json.id + ' .layui-input-block .layui-number-input-btn").css("right",_width + "%");' - ,'if (item.disabled) { $("#' + json.id + ' .layui-input-block .layui-number-input-btn").css("z-index","-1");}'].join(''); + , 'elem:"#' + json.tag + json.id + '"' + , '});var _width = ' + json.width.replace(/[^\d]/g, '') + ';' + , 'if(""!=_width){_width = 100 - parseInt(_width);}' + , '$("#' + json.id + ' .layui-input-block .layui-number-input-btn").css("right",_width + "%");' + , 'if (item.disabled) { $("#' + json.id + ' .layui-input-block .layui-number-input-btn").css("z-index","-1");}'].join(''); return scriptHtmlCode; } }, @@ -2637,7 +2638,7 @@ layui.config({base: './ayq/modules/'}).define(["layer",'flow', "laytpl", "elemen * @param {object} elem 表单面板jquery对象 * @param {object} that 实例对象 * */ - render: function (json, selected,elem,that) { + render: function (json, selected, elem, that) { if (selected === undefined) { selected = false; } @@ -2645,7 +2646,7 @@ layui.config({base: './ayq/modules/'}).define(["layer",'flow', "laytpl", "elemen var _disabledClass = json.disabled ? ' layui-disabled' : ''; var _hideLabel = json.hideLabel ? 'display: none;' : ''; var _html = '
'.format(json.id, json.tag, selected ? 'active' : '', json.index); - _html += ''.format( json.label,json.labelWidth,_hideLabel); + _html += ''.format(json.label, json.labelWidth, _hideLabel); if (json.hideLabel) { _html += '
'; } else { @@ -2655,7 +2656,7 @@ layui.config({base: './ayq/modules/'}).define(["layer",'flow', "laytpl", "elemen _html += '
'; } _html += '' - .format(json.id, json.defaultValue ? json.defaultValue : '', json.width, json.placeholder, _disabled, _disabledClass,json.tag + json.id); + .format(json.id, json.defaultValue ? json.defaultValue : '', json.width, json.placeholder, _disabled, _disabledClass, json.tag + json.id); _html += '
'; _html += '
'; elem.append(_html); @@ -2677,7 +2678,7 @@ layui.config({base: './ayq/modules/'}).define(["layer",'flow', "laytpl", "elemen //console.log(data); }, // 渲染成功后的回调 - success: function(d) { + success: function (d) { //console.log(d); } }); @@ -2688,7 +2689,7 @@ layui.config({base: './ayq/modules/'}).define(["layer",'flow', "laytpl", "elemen * @param {object} json 变更后的json属性 * @param {object} that 实例对象 * */ - update: function (json,that) { + update: function (json, that) { var _disabled = json.disabled ? 'disabled=""' : ''; var _disabledClass = json.disabled ? ' layui-disabled' : ''; var $block = $('#' + json.id + ' .layui-input-block'); @@ -2696,18 +2697,18 @@ layui.config({base: './ayq/modules/'}).define(["layer",'flow', "laytpl", "elemen $label.empty(); $block.empty(); if (json.hideLabel) { - $label.css("display","none"); - $block.css("margin-left","0px"); + $label.css("display", "none"); + $block.css("margin-left", "0px"); } else { - $label.css("display","block"); - $block.css("margin-left",json.labelWidth); + $label.css("display", "block"); + $block.css("margin-left", json.labelWidth); } - $label.css("width",json.labelWidth); + $label.css("width", json.labelWidth); $label.append(json.label + ":"); var _html = ''; //重绘设计区改id下的所有元素 _html += '' - .format(json.id, json.defaultValue ? json.defaultValue : '', json.width, json.placeholder, _disabled, _disabledClass,json.tag + json.id); + .format(json.id, json.defaultValue ? json.defaultValue : '', json.width, json.placeholder, _disabled, _disabledClass, json.tag + json.id); $('#' + json.id + ' .layui-input-block').append(_html); iconPicker.render({ // 选择器,推荐使用input @@ -2727,7 +2728,7 @@ layui.config({base: './ayq/modules/'}).define(["layer",'flow', "laytpl", "elemen //console.log(data); }, // 渲染成功后的回调 - success: function(d) { + success: function (d) { //console.log(d); } }); @@ -2756,7 +2757,7 @@ layui.config({base: './ayq/modules/'}).define(["layer",'flow', "laytpl", "elemen * @param {object} json 当前组件的json属性 * @param {object} that 实例对象 * */ - property: function (json,that) { + property: function (json, that) { that.renderCommonProperty(json); //根据 json 对象获取对应的属性的html that.initCommonProperty(json); //初始化 json 对象获取对应的属性 }, @@ -2766,7 +2767,7 @@ layui.config({base: './ayq/modules/'}).define(["layer",'flow', "laytpl", "elemen * @param {boolean} selected 是否被选中 * @param {object} that 实例对象 * */ - generateHtml: function (json,selected,that) { + generateHtml: function (json, selected, that) { if (selected === undefined) { selected = false; } @@ -2774,7 +2775,7 @@ layui.config({base: './ayq/modules/'}).define(["layer",'flow', "laytpl", "elemen var _disabledClass = json.disabled ? ' layui-disabled' : ''; var _hideLabel = json.hideLabel ? 'display: none;' : ''; var _html = '
'.format(json.id, json.tag, selected ? 'active' : '', json.index); - _html += ''.format( json.label,json.labelWidth,_hideLabel); + _html += ''.format(json.label, json.labelWidth, _hideLabel); if (json.hideLabel) { _html += '
'; } else { @@ -2784,7 +2785,7 @@ layui.config({base: './ayq/modules/'}).define(["layer",'flow', "laytpl", "elemen _html += '
'; } _html += '' - .format(json.id, json.defaultValue ? json.defaultValue : '', json.width, json.placeholder, _disabled, _disabledClass,json.tag + json.id); + .format(json.id, json.defaultValue ? json.defaultValue : '', json.width, json.placeholder, _disabled, _disabledClass, json.tag + json.id); _html += '
'; _html += '
'; return _html; @@ -2794,19 +2795,19 @@ layui.config({base: './ayq/modules/'}).define(["layer",'flow', "laytpl", "elemen * @param {object} json 变更后的json属性 * @param {object} that 实例对象 * */ - generateScript:function (json,that) { + generateScript: function (json, that) { var scriptHtmlCode = ''; scriptHtmlCode += ['iconPicker.render({' - ,'elem:"#' + json.tag + json.id + '",' - ,'type:"fontClass",' - ,'search:' + json.iconPickerSearch + '' - ,'page:' + json.iconPickerPage + '' - ,'limit:' + json.iconPickerLimit + '' - ,'cellWidth:' + json.iconPickerCellWidth + '' - ,' click: function (data) {},' - ,'success: function(d) {}' - ,'});' - ,'iconPicker.checkIcon(' + json.tag + json.id + ',"");'].join(''); + , 'elem:"#' + json.tag + json.id + '",' + , 'type:"fontClass",' + , 'search:' + json.iconPickerSearch + '' + , 'page:' + json.iconPickerPage + '' + , 'limit:' + json.iconPickerLimit + '' + , 'cellWidth:' + json.iconPickerCellWidth + '' + , ' click: function (data) {},' + , 'success: function(d) {}' + , '});' + , 'iconPicker.checkIcon(' + json.tag + json.id + ',"");'].join(''); return scriptHtmlCode; } }, @@ -2818,7 +2819,7 @@ layui.config({base: './ayq/modules/'}).define(["layer",'flow', "laytpl", "elemen * @param {object} elem 表单面板jquery对象 * @param {object} that 实例对象 * */ - render: function (json, selected,elem,that) { + render: function (json, selected, elem, that) { if (selected === undefined) { selected = false; } @@ -2826,19 +2827,19 @@ layui.config({base: './ayq/modules/'}).define(["layer",'flow', "laytpl", "elemen var _disabledClass = json.disabled ? ' layui-disabled' : ''; var _required = json.required ? 'required' : ''; var _hideLabel = json.hideLabel ? 'display: none;' : ''; - var _width = json.width.replace(/[^\d]/g,''); - if(''!=_width){ + var _width = json.width.replace(/[^\d]/g, ''); + if ('' != _width) { _width = 100 - parseInt(_width); } var _html = '
'.format(json.id, json.tag, selected ? 'active' : '', json.index); - _html += ''.format(json.required ? 'layui-form-required' : '', json.label,json.required ? '*' : '',json.labelWidth,_hideLabel); + _html += ''.format(json.required ? 'layui-form-required' : '', json.label, json.required ? '*' : '', json.labelWidth, _hideLabel); if (json.hideLabel) { _html += '
'.format(json.width); } else { - _html += '
'.format(json.width,json.labelWidth); + _html += '
'.format(json.width, json.labelWidth); } _html += '' - .format(json.id, json.defaultValue ? json.defaultValue : '', json.placeholder, _disabled, _disabledClass,json.tag + json.id,_required); + .format(json.id, json.defaultValue ? json.defaultValue : '', json.placeholder, _disabled, _disabledClass, json.tag + json.id, _required); if (!json.disabled) { _html += ''.format(json.tag + json.id); } @@ -2858,7 +2859,7 @@ layui.config({base: './ayq/modules/'}).define(["layer",'flow', "laytpl", "elemen * @param {object} json 变更后的json属性 * @param {object} that 实例对象 * */ - update: function (json,that) { + update: function (json, that) { var _disabled = json.disabled ? 'disabled=""' : ''; var _disabledClass = json.disabled ? ' layui-disabled' : ''; var _required = json.required ? 'required' : ''; @@ -2867,15 +2868,15 @@ layui.config({base: './ayq/modules/'}).define(["layer",'flow', "laytpl", "elemen $block.empty(); $label.empty(); if (json.hideLabel) { - $label.css("display","none"); - $block.css("margin-left","0px"); + $label.css("display", "none"); + $block.css("margin-left", "0px"); $block.css({width: 'calc({0})'.format(json.width)}); } else { - $label.css("display","block"); - $block.css("margin-left",json.labelWidth); - $block.css({width: 'calc({0} - {1}px)'.format(json.width,json.labelWidth)}); + $label.css("display", "block"); + $block.css("margin-left", json.labelWidth); + $block.css({width: 'calc({0} - {1}px)'.format(json.width, json.labelWidth)}); } - $label.css("width",json.labelWidth); + $label.css("width", json.labelWidth); if (json.required) { $label.append('*'); } @@ -2883,10 +2884,10 @@ layui.config({base: './ayq/modules/'}).define(["layer",'flow', "laytpl", "elemen var _html = ''; //重绘设计区改id下的所有元素 _html += '' - .format(json.id, json.defaultValue ? json.defaultValue : '', json.placeholder, _disabled, _disabledClass,json.tag + json.id,_required); + .format(json.id, json.defaultValue ? json.defaultValue : '', json.placeholder, _disabled, _disabledClass, json.tag + json.id, _required); if (!json.disabled) { - var _width = json.width.replace(/[^\d]/g,''); - if(''!=_width){ + var _width = json.width.replace(/[^\d]/g, ''); + if ('' != _width) { _width = 100 - parseInt(_width); } _html += ''.format(json.tag + json.id); @@ -2919,7 +2920,7 @@ layui.config({base: './ayq/modules/'}).define(["layer",'flow', "laytpl", "elemen * @param {object} json 当前组件的json属性 * @param {object} that 实例对象 * */ - property: function (json,that) { + property: function (json, that) { that.renderCommonProperty(json); //根据 json 对象获取对应的属性的html that.initCommonProperty(json); //初始化 json 对象获取对应的属性 }, @@ -2929,7 +2930,7 @@ layui.config({base: './ayq/modules/'}).define(["layer",'flow', "laytpl", "elemen * @param {boolean} selected 是否被选中 * @param {object} that 实例对象 * */ - generateHtml: function (json,selected,that) { + generateHtml: function (json, selected, that) { if (selected === undefined) { selected = false; } @@ -2937,19 +2938,19 @@ layui.config({base: './ayq/modules/'}).define(["layer",'flow', "laytpl", "elemen var _disabledClass = json.disabled ? ' layui-disabled' : ''; var _required = json.required ? 'required' : ''; var _hideLabel = json.hideLabel ? 'display: none;' : ''; - var _width = json.width.replace(/[^\d]/g,''); - if(''!=_width){ + var _width = json.width.replace(/[^\d]/g, ''); + if ('' != _width) { _width = 100 - parseInt(_width); } var _html = '
'.format(json.id, json.tag, selected ? 'active' : '', json.index); - _html += ''.format(json.required ? 'layui-form-required' : '', json.label,json.required ? '*' : '',json.labelWidth,_hideLabel); + _html += ''.format(json.required ? 'layui-form-required' : '', json.label, json.required ? '*' : '', json.labelWidth, _hideLabel); if (json.hideLabel) { _html += '
'.format(json.width); } else { - _html += '
'.format(json.width,json.labelWidth); + _html += '
'.format(json.width, json.labelWidth); } _html += '' - .format(json.id, json.defaultValue ? json.defaultValue : '', json.placeholder, _disabled, _disabledClass,json.tag + json.id,_required); + .format(json.id, json.defaultValue ? json.defaultValue : '', json.placeholder, _disabled, _disabledClass, json.tag + json.id, _required); if (!json.disabled) { _html += ''.format(json.tag + json.id); } @@ -2962,15 +2963,15 @@ layui.config({base: './ayq/modules/'}).define(["layer",'flow', "laytpl", "elemen * @param {object} json 变更后的json属性 * @param {object} that 实例对象 * */ - generateScript:function (json,that) { + generateScript: function (json, that) { var scriptHtmlCode = ''; scriptHtmlCode += ['cron.render({' - ,'elem:"#' + json.tag + json.id + '-button",' - ,'url:' + json.cronUrl + ',' - ,'done: function (cronStr) {' - ,'$("#' + json.tag + json.id + '").val(cronStr);' - ,'},' - ,'});'].join(''); + , 'elem:"#' + json.tag + json.id + '-button",' + , 'url:' + json.cronUrl + ',' + , 'done: function (cronStr) {' + , '$("#' + json.tag + json.id + '").val(cronStr);' + , '},' + , '});'].join(''); return scriptHtmlCode; } }, @@ -2982,22 +2983,22 @@ layui.config({base: './ayq/modules/'}).define(["layer",'flow', "laytpl", "elemen * @param {object} elem 表单面板jquery对象 * @param {object} that 实例对象 * */ - render: function (json, selected,elem,that) { + render: function (json, selected, elem, that) { if (selected === undefined) { selected = false; } var _hideLabel = json.hideLabel ? 'display: none;' : ''; var _html = '
'.format(json.id, json.tag, selected ? 'active' : '', json.index); - _html += ''.format(json.label,json.labelWidth,_hideLabel); + _html += ''.format(json.label, json.labelWidth, _hideLabel); if (json.hideLabel) { _html += '
'; } else { _html += '
'.format(json.labelWidth); } if (json.disabled) { - _html += ''.format(json.id + json.tag ,json.buttonIcon,json.buttonVlaue); - }else { - _html += ''.format(json.id + json.tag ,json.buttonIcon,json.buttonVlaue); + _html += ''.format(json.id + json.tag, json.buttonIcon, json.buttonVlaue); + } else { + _html += ''.format(json.id + json.tag, json.buttonIcon, json.buttonVlaue); } if (json.data !== "") { _html += '
'.format(json.data); @@ -3009,13 +3010,13 @@ layui.config({base: './ayq/modules/'}).define(["layer",'flow', "laytpl", "elemen layer.open({ type: 2, title: '手写签名', - btn: ['保存','关闭'], //可以无限个按钮 - yes: function(index, layero){ + btn: ['保存', '关闭'], //可以无限个按钮 + yes: function (index, layero) { //do something var iframe = window['layui-layer-iframe' + index]; var data = iframe.getCanvasData(); json.data = data; - that.components[json.tag].update(json,that); + that.components[json.tag].update(json, that); layer.close(index); //如果设定了yes回调,需进行手工关闭 }, btn2: function (index, layero) { @@ -3027,7 +3028,7 @@ layui.config({base: './ayq/modules/'}).define(["layer",'flow', "laytpl", "elemen offset: 'auto', //右下角弹出 anim: 2, content: ['./handwrittenSignature.html', 'yes'], //iframe的url,no代表不显示滚动条 - success:function (layero,index) { + success: function (layero, index) { } }); }); @@ -3037,28 +3038,28 @@ layui.config({base: './ayq/modules/'}).define(["layer",'flow', "laytpl", "elemen * @param {object} json 变更后的json属性 * @param {object} that 实例对象 * */ - update: function (json,that) { + update: function (json, that) { var $block = $('#' + json.id + ' .layui-input-block'); var $label = $('#' + json.id + ' .layui-form-label'); $block.empty(); $label.empty(); if (json.hideLabel) { - $label.css("display","none"); - $block.css("margin-left","0px"); + $label.css("display", "none"); + $block.css("margin-left", "0px"); $block.css({width: 'calc({0})'.format(json.width)}); } else { - $label.css("display","block"); - $block.css("margin-left",json.labelWidth); - $block.css({width: 'calc({0} - {1}px)'.format(json.width,json.labelWidth)}); + $label.css("display", "block"); + $block.css("margin-left", json.labelWidth); + $block.css({width: 'calc({0} - {1}px)'.format(json.width, json.labelWidth)}); } - $label.css("width",json.labelWidth); + $label.css("width", json.labelWidth); $label.append(json.label + ":"); var _html = ''; //重绘设计区改id下的所有元素 if (json.disabled) { - _html += ''.format(json.id + json.tag ,json.buttonIcon,json.buttonVlaue); - }else { - _html += ''.format(json.id + json.tag ,json.buttonIcon,json.buttonVlaue); + _html += ''.format(json.id + json.tag, json.buttonIcon, json.buttonVlaue); + } else { + _html += ''.format(json.id + json.tag, json.buttonIcon, json.buttonVlaue); } if (json.data !== "") { _html += '
'.format(json.data); @@ -3083,7 +3084,7 @@ layui.config({base: './ayq/modules/'}).define(["layer",'flow', "laytpl", "elemen * @param {object} json 当前组件的json属性 * @param {object} that 实例对象 * */ - property: function (json,that) { + property: function (json, that) { that.renderCommonProperty(json); //根据 json 对象获取对应的属性的html that.initCommonProperty(json); //初始化 json 对象获取对应的属性 }, @@ -3093,22 +3094,22 @@ layui.config({base: './ayq/modules/'}).define(["layer",'flow', "laytpl", "elemen * @param {boolean} selected 是否被选中 * @param {object} that 实例对象 * */ - generateHtml: function (json,selected,that) { + generateHtml: function (json, selected, that) { if (selected === undefined) { selected = false; } var _hideLabel = json.hideLabel ? 'display: none;' : ''; var _html = '
'.format(json.id, json.tag, selected ? 'active' : '', json.index); - _html += ''.format(json.label,json.labelWidth,_hideLabel); + _html += ''.format(json.label, json.labelWidth, _hideLabel); if (json.hideLabel) { _html += '
'; } else { _html += '
'.format(json.labelWidth); } if (json.disabled) { - _html += ''.format(json.id + json.tag ,json.buttonIcon,json.buttonVlaue); - }else { - _html += ''.format(json.id + json.tag ,json.buttonIcon,json.buttonVlaue); + _html += ''.format(json.id + json.tag, json.buttonIcon, json.buttonVlaue); + } else { + _html += ''.format(json.id + json.tag, json.buttonIcon, json.buttonVlaue); } if (json.data !== "") { _html += '
'.format(json.data); @@ -3122,7 +3123,7 @@ layui.config({base: './ayq/modules/'}).define(["layer",'flow', "laytpl", "elemen * @param {object} json 变更后的json属性 * @param {object} that 实例对象 * */ - generateScript:function (json,that) { + generateScript: function (json, that) { var scriptHtmlCode = ''; return scriptHtmlCode; } @@ -3135,23 +3136,23 @@ layui.config({base: './ayq/modules/'}).define(["layer",'flow', "laytpl", "elemen * @param {object} elem 表单面板jquery对象 * @param {object} that 实例对象 * */ - render: function (json, selected,elem,that) { + render: function (json, selected, elem, that) { if (selected === undefined) { selected = false; } var _hideLabel = json.hideLabel ? 'display: none;' : ''; - var _html = '
'.format(json.id, json.tag, selected ? 'active' : '', json.index,json.width); - _html += ''.format(json.label,json.width,_hideLabel); + var _html = '
'.format(json.id, json.tag, selected ? 'active' : '', json.index, json.width); + _html += ''.format(json.label, json.width, _hideLabel); _html += '
'; _html += '
'.format(json.tag + json.id); _html += '
'; _html += '
'; elem.append(_html); var e = new ice.editor(json.tag + json.id); - e.width=json.width; //宽度 - e.height=json.height; //高度 - e.uploadUrl=json.uploadUrl; //上传文件路径 - e.disabled=json.disabled; + e.width = json.width; //宽度 + e.height = json.height; //高度 + e.uploadUrl = json.uploadUrl; //上传文件路径 + e.disabled = json.disabled; e.menu = json.menu; e.create(); e.setValue(json.defaultValue); @@ -3164,15 +3165,15 @@ layui.config({base: './ayq/modules/'}).define(["layer",'flow', "laytpl", "elemen * @param {object} json 变更后的json属性 * @param {object} that 实例对象 * */ - update: function (json,that) { + update: function (json, that) { var $label = $('#' + json.id + ' .layui-form-label'); $label.empty(); - $label.css("width",json.width); + $label.css("width", json.width); $label.append(json.label + ":"); if (json.hideLabel) { - $label.css("display","none"); + $label.css("display", "none"); } else { - $label.css("display","block"); + $label.css("display", "block"); } if (that.config.viewOrDesign) { var e = iceEditorObjects[json.id]; @@ -3183,10 +3184,10 @@ layui.config({base: './ayq/modules/'}).define(["layer",'flow', "laytpl", "elemen var _html = '
'.format(json.tag + json.id); $block.append(_html); var e = new ice.editor(json.tag + json.id); - e.width=json.width; //宽度 - e.height=json.height; //高度 - e.uploadUrl=json.uploadUrl; //上传文件路径 - e.disabled=json.disabled; + e.width = json.width; //宽度 + e.height = json.height; //高度 + e.uploadUrl = json.uploadUrl; //上传文件路径 + e.disabled = json.disabled; e.menu = json.menu; e.create(); e.setValue(json.defaultValue); @@ -3211,7 +3212,7 @@ layui.config({base: './ayq/modules/'}).define(["layer",'flow', "laytpl", "elemen * @param {object} json 当前组件的json属性 * @param {object} that 实例对象 * */ - property: function (json,that) { + property: function (json, that) { that.renderCommonProperty(json); //根据 json 对象获取对应的属性的html that.initCommonProperty(json); //初始化 json 对象获取对应的属性 }, @@ -3221,13 +3222,13 @@ layui.config({base: './ayq/modules/'}).define(["layer",'flow', "laytpl", "elemen * @param {boolean} selected 是否被选中 * @param {object} that 实例对象 * */ - generateHtml: function (json,selected,that) { + generateHtml: function (json, selected, that) { if (selected === undefined) { selected = false; } var _hideLabel = json.hideLabel ? 'display: none;' : ''; - var _html = '
'.format(json.id, json.tag, selected ? 'active' : '', json.index,json.width); - _html += ''.format(json.label,json.width,_hideLabel); + var _html = '
'.format(json.id, json.tag, selected ? 'active' : '', json.index, json.width); + _html += ''.format(json.label, json.width, _hideLabel); _html += '
'; _html += '
'.format(json.tag + json.id); _html += '
'; @@ -3239,15 +3240,15 @@ layui.config({base: './ayq/modules/'}).define(["layer",'flow', "laytpl", "elemen * @param {object} json 变更后的json属性 * @param {object} that 实例对象 * */ - generateScript:function (json,that) { + generateScript: function (json, that) { var scriptHtmlCode = ''; - scriptHtmlCode += ['var e = new ice.editor('+ json.tag + json.id +');' - ,'e.width=' + json.width + '; //宽度' - ,'e.height=' + json.height + '; //高度' - ,'e.uploadUrl=' + json.uploadUrl + '; //上传文件路径' - ,'e.disabled=' + json.disabled + ';' - ,'e.menu = ' + json.menu + ';' - ,'e.create();'].join(''); + scriptHtmlCode += ['var e = new ice.editor(' + json.tag + json.id + ');' + , 'e.width=' + json.width + '; //宽度' + , 'e.height=' + json.height + '; //高度' + , 'e.uploadUrl=' + json.uploadUrl + '; //上传文件路径' + , 'e.disabled=' + json.disabled + ';' + , 'e.menu = ' + json.menu + ';' + , 'e.create();'].join(''); return scriptHtmlCode; } }, @@ -3259,7 +3260,7 @@ layui.config({base: './ayq/modules/'}).define(["layer",'flow', "laytpl", "elemen * @param {object} elem 表单面板jquery对象 * @param {object} that 当前实例模块对象 * */ - render: function (json, selected,elem,that) { + render: function (json, selected, elem, that) { if (selected === undefined) { selected = false; } @@ -3272,7 +3273,7 @@ layui.config({base: './ayq/modules/'}).define(["layer",'flow', "laytpl", "elemen colClass = 'layui-col-md3'; } for (var i = 0; i < json.columns.length; i++) { - _html += '
'.format(i, json.index, colClass,json.id); + _html += '
'.format(i, json.index, colClass, json.id); //some html _html += '
'; } @@ -3286,7 +3287,7 @@ layui.config({base: './ayq/modules/'}).define(["layer",'flow', "laytpl", "elemen * @param {object} json 变更后的json属性 * @param {object} that 实例对象 * */ - update: function (json,that) { + update: function (json, that) { var $block = $('#' + json.id); $block.empty(); var colClass = 'layui-col-md6'; @@ -3297,7 +3298,7 @@ layui.config({base: './ayq/modules/'}).define(["layer",'flow', "laytpl", "elemen } var _html = ''; for (var i = 0; i < json.columns.length; i++) { - _html += '
'.format(i, json.index, colClass,json.id); + _html += '
'.format(i, json.index, colClass, json.id); //some html _html += '
'; } @@ -3310,7 +3311,7 @@ layui.config({base: './ayq/modules/'}).define(["layer",'flow', "laytpl", "elemen * @param {object} index 所属对象组件索引 * @param {object} that 实例对象 * */ - jsonData: function (id, index,that) { + jsonData: function (id, index, that) { //分配一个新的ID 默认是一个一行两列的布局对象 var _json = JSON.parse(JSON.stringify(formField.components.grid)); _json.id = id; @@ -3323,7 +3324,7 @@ layui.config({base: './ayq/modules/'}).define(["layer",'flow', "laytpl", "elemen * @param {object} json 当前组件的json属性 * @param {object} that 实例对象 * */ - property: function (json,that) { + property: function (json, that) { that.renderCommonProperty(json); //根据 json 对象获取对应的属性的html that.initCommonProperty(json); //初始化 json 对象获取对应的属性 }, @@ -3333,7 +3334,7 @@ layui.config({base: './ayq/modules/'}).define(["layer",'flow', "laytpl", "elemen * @param {boolean} selected 是否被选中 * @param {object} that 实例对象 * */ - generateHtml: function (json,selected,that) { + generateHtml: function (json, selected, that) { if (selected === undefined) { selected = false; } @@ -3346,7 +3347,7 @@ layui.config({base: './ayq/modules/'}).define(["layer",'flow', "laytpl", "elemen colClass = 'layui-col-md3'; } for (var i = 0; i < json.columns.length; i++) { - _html += '
'.format(i, json.index, colClass,json.id); + _html += '
'.format(i, json.index, colClass, json.id); //some html _html += '
'; } @@ -3358,7 +3359,7 @@ layui.config({base: './ayq/modules/'}).define(["layer",'flow', "laytpl", "elemen * @param {object} json 变更后的json属性 * @param {object} that 实例对象 * */ - generateScript:function (json,that) { + generateScript: function (json, that) { return ''; } }, @@ -3380,7 +3381,7 @@ layui.config({base: './ayq/modules/'}).define(["layer",'flow', "laytpl", "elemen formType: 0, value: options.selectItem.id, title: '请输入更新后的ID', - }, function(value, index, elem){ + }, function (value, index, elem) { var _checkid = that.findJsonItem(options.data, value); if (_checkid === undefined) { var findJsonItem = that.findJsonItem(options.data, options.selectItem.id); @@ -3393,7 +3394,7 @@ layui.config({base: './ayq/modules/'}).define(["layer",'flow', "laytpl", "elemen layer.close(index); }); }); - $('#id').mouseover(function(){ + $('#id').mouseover(function () { layer.tips('请点击修改id', '#id',); }); break; @@ -3405,10 +3406,10 @@ layui.config({base: './ayq/modules/'}).define(["layer",'flow', "laytpl", "elemen min: 80, max: 300, step: 1, - input:true, - change: function(value){ + input: true, + change: function (value) { json.labelWidth = value; - that.components[json.tag].update(json,that); + that.components[json.tag].update(json, that); } }); break; @@ -3416,14 +3417,14 @@ layui.config({base: './ayq/modules/'}).define(["layer",'flow', "laytpl", "elemen //定义初始值 slider.render({ elem: '#width', - value: json.width.replace("%",""), //初始值 + value: json.width.replace("%", ""), //初始值 min: 20, max: 100, step: 1, - input:true, - change: function(value){ + input: true, + change: function (value) { json.width = value + "%"; - that.components[json.tag].update(json,that); + that.components[json.tag].update(json, that); } }); break; @@ -3448,8 +3449,8 @@ layui.config({base: './ayq/modules/'}).define(["layer",'flow', "laytpl", "elemen options.selectItem.options = newJson; var $select = $('#' + options.selectItem.tag); $select.empty(); - that.components[options.selectItem.tag].update(options.selectItem,that); - that.components[options.selectItem.tag].property(options.selectItem,that); + that.components[options.selectItem.tag].update(options.selectItem, that); + that.components[options.selectItem.tag].property(options.selectItem, that); form.render('select'); form.render('radio'); form.render('checkbox'); @@ -3461,11 +3462,11 @@ layui.config({base: './ayq/modules/'}).define(["layer",'flow', "laytpl", "elemen laydate.render({ elem: '#dataMaxValue' + json.tag + json.id, format: 'yyyy-MM-dd', - btns: ['now','confirm'], + btns: ['now', 'confirm'], value: json.dataMaxValue, - done: function(value, date, endDate){ + done: function (value, date, endDate) { json.dataMaxValue = value; - that.components[json.tag].update(json,that); + that.components[json.tag].update(json, that); } }); break; @@ -3473,11 +3474,11 @@ layui.config({base: './ayq/modules/'}).define(["layer",'flow', "laytpl", "elemen laydate.render({ elem: '#dataMinValue' + json.tag + json.id, format: 'yyyy-MM-dd', - btns: ['now','confirm'], + btns: ['now', 'confirm'], value: json.dataMinValue, - done: function(value, date, endDate){ + done: function (value, date, endDate) { json.dataMinValue = value; - that.components[json.tag].update(json,that); + that.components[json.tag].update(json, that); } }); break; @@ -3487,9 +3488,9 @@ layui.config({base: './ayq/modules/'}).define(["layer",'flow', "laytpl", "elemen type: json.dateType, format: json.dateFormat, value: json.dateDefaultValue, - done: function(value, date, endDate){ + done: function (value, date, endDate) { json.dateDefaultValue = value; - that.components[json.tag].update(json,that); + that.components[json.tag].update(json, that); } }); break; @@ -3499,10 +3500,10 @@ layui.config({base: './ayq/modules/'}).define(["layer",'flow', "laytpl", "elemen type: json.dateType, format: json.dateFormat, value: json.dateRangeDefaultValue, - range:"-", - done: function(value, date, endDate){ + range: "-", + done: function (value, date, endDate) { json.dateRangeDefaultValue = value; - that.components[json.tag].update(json,that); + that.components[json.tag].update(json, that); } }); break; @@ -3523,38 +3524,38 @@ layui.config({base: './ayq/modules/'}).define(["layer",'flow', "laytpl", "elemen // 点击回调 click: function (data) { json.buttonIcon = data.icon; - that.components[json.tag].update(json,that); + that.components[json.tag].update(json, that); }, // 渲染成功后的回调 - success: function(d) { + success: function (d) { //console.log(d); } }); break; case 'whiteSpace': slider.render({ - elem:'#' + json.tag + json.id + "property", + elem: '#' + json.tag + json.id + "property", value: json.whiteSpace, //初始值 min: 30, max: 500, step: 1, - input:true, - change: function(value){ + input: true, + change: function (value) { json.whiteSpace = value; - that.components[json.tag].update(json,that); + that.components[json.tag].update(json, that); } }); break; case 'colorSelection': colorpicker.render({ elem: '#' + json.tag + json.id + "property" - ,color: json.colorSelection - ,format: 'rgb' - ,predefine: true - ,alpha: true - ,done: function (color) { + , color: json.colorSelection + , format: 'rgb' + , predefine: true + , alpha: true + , done: function (color) { json.colorSelection = color; - that.components[json.tag].update(json,that); + that.components[json.tag].update(json, that); } }); break; @@ -3563,13 +3564,13 @@ layui.config({base: './ayq/modules/'}).define(["layer",'flow', "laytpl", "elemen layer.open({ type: 2, title: '头部菜单', - btn: ['保存','关闭'], //可以无限个按钮 - yes: function(index, layero){ + btn: ['保存', '关闭'], //可以无限个按钮 + yes: function (index, layero) { //do something var iframe = window['layui-layer-iframe' + index]; var checkData = iframe.getCheckData(); json.menu = checkData; - that.components[json.tag].update(json,that); + that.components[json.tag].update(json, that); layer.close(index); //如果设定了yes回调,需进行手工关闭 }, btn2: function (index, layero) { @@ -3581,7 +3582,7 @@ layui.config({base: './ayq/modules/'}).define(["layer",'flow', "laytpl", "elemen offset: 'auto', //右下角弹出 anim: 2, content: ['./editorMenu.html', 'yes'], //iframe的url,no代表不显示滚动条 - success:function (layero,index) { + success: function (layero, index) { var iframe = window['layui-layer-iframe' + index]; iframe.child(staticField.iceEditMenus) } @@ -3623,7 +3624,7 @@ layui.config({base: './ayq/modules/'}).define(["layer",'flow', "laytpl", "elemen _htmloption += '
'; $('#columnProperty .select-options').last().after(_htmloption); //更新设计区节点 - that.components[json.tag].update(json,that); + that.components[json.tag].update(json, that); if (json.tag === 'checkbox') { form.render('checkbox'); } else if (json.tag === 'radio' || json.tag == 'carousel') { @@ -3688,7 +3689,7 @@ layui.config({base: './ayq/modules/'}).define(["layer",'flow', "laytpl", "elemen } $('#' + json.tag).append(_html); //更新设计区节点 - that.components[json.tag].update(json,that); + that.components[json.tag].update(json, that); if (json.tag === 'checkbox') { form.render('checkbox'); } else if (json.tag === 'radio') { @@ -3852,9 +3853,9 @@ layui.config({base: './ayq/modules/'}).define(["layer",'flow', "laytpl", "elemen _html += '' @@ -3973,7 +3974,7 @@ layui.config({base: './ayq/modules/'}).define(["layer",'flow', "laytpl", "elemen for (var i = 0; i < staticField.arrows.length; i++) { if (staticField.arrows[i].value === json.arrow) { _html += ' '.format(staticField.arrows[i].text, staticField.arrows[i].value); - }else { + } else { _html += ' '.format(staticField.arrows[i].text, staticField.arrows[i].value); } } @@ -3991,10 +3992,10 @@ layui.config({base: './ayq/modules/'}).define(["layer",'flow', "laytpl", "elemen if (staticField.buttonTypes[i].value === json.buttonType) { if (staticField.buttonTypes[i].value === "") { _html += ' '.format(staticField.buttonTypes[i].text); - }else { + } else { _html += ' '.format(staticField.buttonTypes[i].text, staticField.buttonTypes[i].value); } - }else { + } else { _html += ' '.format(staticField.buttonTypes[i].text, staticField.buttonTypes[i].value); } } @@ -4012,10 +4013,10 @@ layui.config({base: './ayq/modules/'}).define(["layer",'flow', "laytpl", "elemen if (staticField.buttonSizes[i].value === json.buttonSize) { if (staticField.buttonSizes[i].value === "") { _html += ' '.format(staticField.buttonSizes[i].text); - }else { + } else { _html += ' '.format(staticField.buttonSizes[i].text, staticField.buttonSizes[i].value); } - }else { + } else { _html += ' '.format(staticField.buttonSizes[i].text, staticField.buttonSizes[i].value); } } @@ -4100,7 +4101,6 @@ layui.config({base: './ayq/modules/'}).define(["layer",'flow', "laytpl", "elemen } - /* 给字段属性绑定事件 实现双向绑定*/ Class.prototype.bindPropertyEvent = function (_json) { var that = this @@ -4134,7 +4134,7 @@ layui.config({base: './ayq/modules/'}).define(["layer",'flow', "laytpl", "elemen } else { _json[_key].splice(_value, columnCount); } - that.components[_json.tag].update(_json,that); + that.components[_json.tag].update(_json, that); break; case 'dateFormat': if (_json.tag === 'date') { @@ -4147,13 +4147,13 @@ layui.config({base: './ayq/modules/'}).define(["layer",'flow', "laytpl", "elemen type: _json.datetype, format: _json.dateFormat, value: new Date(), - done: function(value, date, endDate){ + done: function (value, date, endDate) { _json.dateDefaultValue = value; - that.components[_json.tag].update(_json,that); + that.components[_json.tag].update(_json, that); } }); _json.dateDefaultValue = dateClass.config.elem[0].innerText; - that.components[_json.tag].update(_json,that); + that.components[_json.tag].update(_json, that); } if (_json.tag === 'dateRange') { var _html = '
'.format('dateDefaultValue' + _json.tag + _json.id); @@ -4165,15 +4165,15 @@ layui.config({base: './ayq/modules/'}).define(["layer",'flow', "laytpl", "elemen elem: '#dateRangeDefaultValue' + _json.tag + _json.id, type: _json.dateType, format: _json.dateFormat, - value: _v, - range:"-", - done: function(value, date, endDate){ + value: _v, + range: "-", + done: function (value, date, endDate) { _json.dateRangeDefaultValue = value; - that.components[_json.tag].update(_json,that); + that.components[_json.tag].update(_json, that); } }); _json.dateRangeDefaultValue = _v; - that.components[_json.tag].update(_json,that); + that.components[_json.tag].update(_json, that); } break; case 'dateType': @@ -4187,13 +4187,13 @@ layui.config({base: './ayq/modules/'}).define(["layer",'flow', "laytpl", "elemen type: _json.dateType, format: _json.dateFormat, value: new Date(), - done: function(value, date, endDate){ + done: function (value, date, endDate) { _json.dateDefaultValue = value; - that.components[_json.tag].update(_json,that); + that.components[_json.tag].update(_json, that); } }); _json.dateDefaultValue = dateClass.config.elem[0].innerText; - that.components[_json.tag].update(_json,that); + that.components[_json.tag].update(_json, that); } if (_json.tag === 'dateRange') { var _html = '
'.format('dateDefaultValue' + _json.tag + _json.id); @@ -4205,13 +4205,13 @@ layui.config({base: './ayq/modules/'}).define(["layer",'flow', "laytpl", "elemen type: _json.dateType, format: _json.dateFormat, value: _json.dateRangeDefaultValue, - range:"-", - done: function(value, date, endDate){ + range: "-", + done: function (value, date, endDate) { _json.dateRangeDefaultValue = value; - that.components[_json.tag].update(_json,that); + that.components[_json.tag].update(_json, that); } }); - that.components[_json.tag].update(_json,that); + that.components[_json.tag].update(_json, that); } break; case 'anim': @@ -4219,7 +4219,7 @@ layui.config({base: './ayq/modules/'}).define(["layer",'flow', "laytpl", "elemen case 'buttonType': case 'buttonSize': _json[data.elem.name] = data.value; - that.components[_json.tag].update(_json,that); + that.components[_json.tag].update(_json, that); break; default: break; @@ -4242,7 +4242,7 @@ layui.config({base: './ayq/modules/'}).define(["layer",'flow', "laytpl", "elemen case 'height': case 'iconPickerLimit': _json[_key] = _value; - that.components[_json.tag].update(_json,that); + that.components[_json.tag].update(_json, that); break; case 'defaultValue': if (_json.tag === 'slider') { @@ -4261,10 +4261,10 @@ layui.config({base: './ayq/modules/'}).define(["layer",'flow', "laytpl", "elemen var resultNumber = that.replaceNumber(_value); _json[_key] = resultNumber; $(this).val(resultNumber); - that.components[_json.tag].update(_json,that);//局部更新 + that.components[_json.tag].update(_json, that);//局部更新 } else { _json[_key] = _value; - that.components[_json.tag].update(_json,that); + that.components[_json.tag].update(_json, that); } break; case 'minValue': @@ -4282,8 +4282,8 @@ layui.config({base: './ayq/modules/'}).define(["layer",'flow', "laytpl", "elemen step: _json.stepValue, disabled: _json.disabled }); - }else if (_json.tag == 'numberInput') { - that.components[_json.tag].update(_json,that);//局部更新 + } else if (_json.tag == 'numberInput') { + that.components[_json.tag].update(_json, that);//局部更新 } break; case 'carousel-text': @@ -4297,7 +4297,7 @@ layui.config({base: './ayq/modules/'}).define(["layer",'flow', "laytpl", "elemen }); }); _json.options = JSON.parse(JSON.stringify(_options)); - that.components[_json.tag].update(_json,that);//局部更新 + that.components[_json.tag].update(_json, that);//局部更新 break; case 'select-text': case 'select-value': @@ -4312,7 +4312,7 @@ layui.config({base: './ayq/modules/'}).define(["layer",'flow', "laytpl", "elemen } else { _json.options[_index].value = $(this).val(); } - that.components[_json.tag].update(_json,that);//局部更新 + that.components[_json.tag].update(_json, that);//局部更新 break; default: break; @@ -4338,7 +4338,7 @@ layui.config({base: './ayq/modules/'}).define(["layer",'flow', "laytpl", "elemen case 'autoplay': case 'hideLabel': _json[_key] = _value; - that.components[_json.tag].update(_json,that); + that.components[_json.tag].update(_json, that); break; default: break; @@ -4360,7 +4360,7 @@ layui.config({base: './ayq/modules/'}).define(["layer",'flow', "laytpl", "elemen } _json.options[i].checked = false; } - that.components[_json.tag].update(_json,that); + that.components[_json.tag].update(_json, that); break; case 'select': case 'carousel': @@ -4373,7 +4373,7 @@ layui.config({base: './ayq/modules/'}).define(["layer",'flow', "laytpl", "elemen } _json.options[i].checked = false; } - that.components[_json.tag].update(_json,that); + that.components[_json.tag].update(_json, that); break; default: break; @@ -4394,7 +4394,7 @@ layui.config({base: './ayq/modules/'}).define(["layer",'flow', "laytpl", "elemen break; } } - that.components[_json.tag].update(_json,that); + that.components[_json.tag].update(_json, that); break; default: break; @@ -4433,10 +4433,10 @@ layui.config({base: './ayq/modules/'}).define(["layer",'flow', "laytpl", "elemen , generateId: 0 , data: [] , dataSource: {} - , formData:{} - , globalDisable:false - , viewOrDesign:false - , formDefaultButton:true + , formData: {} + , globalDisable: false + , viewOrDesign: false + , formDefaultButton: true , formProperty: {} , selectItem: undefined }; @@ -4488,8 +4488,8 @@ layui.config({base: './ayq/modules/'}).define(["layer",'flow', "laytpl", "elemen , item) { if (index < 5) { templateFormListHtml += '
'; - templateFormListHtml += '
'.format(item.imageUrl,index); - templateFormListHtml += '
{1}
'.format(index,item.text); + templateFormListHtml += '
'.format(item.imageUrl, index); + templateFormListHtml += '
{1}
'.format(index, item.text); templateFormListHtml += '
'; $('#template-form-list').append(templateFormListHtml); } @@ -4508,10 +4508,10 @@ layui.config({base: './ayq/modules/'}).define(["layer",'flow', "laytpl", "elemen //加载更多模板 flow.load({ elem: '#template-form-list' - ,done: function(page, next){ + , done: function (page, next) { console.log(page); //模拟插入 - setTimeout(function(){ + setTimeout(function () { var list = []; next(list.join(''), page < 2); //假设总页数为 6 }, 500); @@ -4567,7 +4567,7 @@ layui.config({base: './ayq/modules/'}).define(["layer",'flow', "laytpl", "elemen } else { var _id = that.autoId(evt.item.dataset.tag); /* 向现有的表单数据中增加新的数组元素 splice */ - var _newitem = that.components[evt.item.dataset.tag].jsonData(_id, evt.newIndex,that); + var _newitem = that.components[evt.item.dataset.tag].jsonData(_id, evt.newIndex, that); //如果是 grid 呢,需要知道几列 options.selectItem = _newitem; options.data.splice(evt.newIndex, 0, _newitem); @@ -4589,8 +4589,8 @@ layui.config({base: './ayq/modules/'}).define(["layer",'flow', "laytpl", "elemen $('.previewForm').on('click', function () { window.localStorage.setItem('layui_form_json', JSON.stringify(options.data)); layer.confirm('请选择你要预览页面的方式?', { - btn: ['弹窗','新页面'] //按钮 - }, function(){ + btn: ['弹窗', '新页面'] //按钮 + }, function () { //iframe窗 layer.open({ type: 2, @@ -4609,7 +4609,7 @@ layui.config({base: './ayq/modules/'}).define(["layer",'flow', "laytpl", "elemen //加载结束 } }); - }, function(){ + }, function () { window.open("./preview.html"); }); @@ -4630,7 +4630,7 @@ layui.config({base: './ayq/modules/'}).define(["layer",'flow', "laytpl", "elemen , success: function (layero, index) { } , end: function () { - $('.importjsoncodeview').css("display","none") + $('.importjsoncodeview').css("display", "none") } }); }); @@ -4649,30 +4649,38 @@ layui.config({base: './ayq/modules/'}).define(["layer",'flow', "laytpl", "elemen }); //注册导出数据 $('.exportJson').on('click', function () { - document.getElementById('generate-code-view').value = JSON.stringify(options.data, null, 4); - - layer.open({ - type: 1 - , title: 'JSON 数据导出' - , id: 'Lay_layer_htmlcodeview' - , content: $('.htmlcodeview') - , area: ['800px', '640px'] - , shade: false - , resize: false - , success: function (layero, index) { + //需要获取当前的url中参数module_id和page + let module_id = $.getUrlParam('module_id'); + let page = $.getUrlParam('page'); - } - , end: function () { - $('.htmlcodeview').css("display","none") + let content = JSON.stringify(options.data, null, 4); + if (content.length == 2) { + layer.alert('内容不能为空', {icon: 0, title: '保存失败'}) + return; + } + $.ajax({ + type: "POST", + dataType: "json", + url: "/FengHuang/zjb/saveModulePage", + data: { + "module_id": module_id, + "page": page, + "json": content + }, + async: false, + success: function (result) { + layer.alert('保存成功!', {icon: 1, title: '成功'}) + return; } }); }); $('.generateCode').on('click', function () { var _html = $('
'); - var _script = $('
');; - that.generateHtml(options.data, _html,_script); - var _htmlCode = staticField.htmlCode.format(_html.html(),_script.html()); + var _script = $('
'); + ; + that.generateHtml(options.data, _html, _script); + var _htmlCode = staticField.htmlCode.format(_html.html(), _script.html()); document.getElementById('generate-code-view').value = style_html(_htmlCode, 4, ' ', 400); layer.open({ type: 1 @@ -4688,7 +4696,7 @@ layui.config({base: './ayq/modules/'}).define(["layer",'flow', "laytpl", "elemen }); } , end: function () { - $('.htmlcodeview').css("display","none") + $('.htmlcodeview').css("display", "none") } }); @@ -4698,8 +4706,8 @@ layui.config({base: './ayq/modules/'}).define(["layer",'flow', "laytpl", "elemen //递归赋值 Class.prototype.replaceNumber = function (value) { - value = value.replace(/[^\d]/g,''); - if(''!=value){ + value = value.replace(/[^\d]/g, ''); + if ('' != value) { value = parseInt(value); } return value; @@ -4731,16 +4739,16 @@ layui.config({base: './ayq/modules/'}).define(["layer",'flow', "laytpl", "elemen _fromItem.id = that.autoId(_fromItem.tag); _fromItem.index = index; parentItem.columns[colIndex].list.splice(index + 1, 0, _fromItem); - that.findAndCopyJson(options.data,parentItem,evt.item.parentElement.parentElement.dataset.id); + that.findAndCopyJson(options.data, parentItem, evt.item.parentElement.parentElement.dataset.id); that.deleteJsonItem(options.data, _oldid); } else { /* 向指定目标放入数据 splice */ var tag = evt.item.dataset.tag; _id = that.autoId(tag); - var _newitem = that.components[tag].jsonData(_id, evt.newIndex,that); + var _newitem = that.components[tag].jsonData(_id, evt.newIndex, that); _newitem.index = index; parentItem.columns[colIndex].list.splice(index + 1, 0, _newitem); - that.findAndCopyJson(options.data,parentItem,evt.item.parentElement.parentElement.dataset.id); + that.findAndCopyJson(options.data, parentItem, evt.item.parentElement.parentElement.dataset.id); options.selectItem = _newitem; } that.renderForm(); @@ -4748,8 +4756,9 @@ layui.config({base: './ayq/modules/'}).define(["layer",'flow', "laytpl", "elemen //拖动结束 onEnd: function (evt) { //console.log(evt); - }}; - var gridSortable = Sortable.create(el,ops); + } + }; + var gridSortable = Sortable.create(el, ops); } }; @@ -4779,7 +4788,7 @@ layui.config({base: './ayq/modules/'}).define(["layer",'flow', "laytpl", "elemen //获取当前的 DOM 对象 if (item2.list.length > 0) { var elem2 = elem.find('#' + item.id + ' .widget-col-list.column' + item.id + index2); - that.generateHtml(item2.list, elem2,scriptHtml); + that.generateHtml(item2.list, elem2, scriptHtml); } }); } else { @@ -4793,17 +4802,17 @@ layui.config({base: './ayq/modules/'}).define(["layer",'flow', "laytpl", "elemen var that = this, options = that.config; //获取表单区域所有值 - for(let key in json){ - if (key.indexOf("[")!= -1 && key.indexOf("]")!= -1) { - var check = key.substring(0,key.indexOf("[")); - var item = that.findJsonItem(options.data,check); + for (let key in json) { + if (key.indexOf("[") != -1 && key.indexOf("]") != -1) { + var check = key.substring(0, key.indexOf("[")); + var item = that.findJsonItem(options.data, check); if (item === undefined) { continue; } - that.components[item.tag].update(item,that); + that.components[item.tag].update(item, that); continue; } - var item = that.findJsonItem(options.data,key); + var item = that.findJsonItem(options.data, key); if (item === undefined) { continue; } @@ -4816,20 +4825,20 @@ layui.config({base: './ayq/modules/'}).define(["layer",'flow', "laytpl", "elemen case 'cron': case 'colorpicker': item.defaultValue = json[key]; - that.components[item.tag].update(item,that); + that.components[item.tag].update(item, that); break; case 'sign': item.data = json[key]; - that.components[item.tag].update(item,that); + that.components[item.tag].update(item, that); break; default: break; } } if (options.viewOrDesign) { - form.val(options.formId,json); + form.val(options.formId, json); } else { - form.val("formPreviewForm",json); + form.val("formPreviewForm", json); } options.formData = json; return json; @@ -4841,13 +4850,13 @@ layui.config({base: './ayq/modules/'}).define(["layer",'flow', "laytpl", "elemen options = that.config; //获取表单区域所有值 var json = form.val(that.config.formId); - for(let key in iceEditorObjects){ + for (let key in iceEditorObjects) { json[key] = iceEditorObjects[key].getHTML(); } - for(let key in labelGenerationObjects){ + for (let key in labelGenerationObjects) { json[key] = labelGenerationObjects[key].getData(); } - for(let key in signObjects){ + for (let key in signObjects) { json[key] = signObjects[key]; } return json; @@ -4952,15 +4961,15 @@ layui.config({base: './ayq/modules/'}).define(["layer",'flow', "laytpl", "elemen $.each(jsondata, function (index, item) { item.index = index;//设置index 仅仅为了传递给render对象,如果存在下级子节点那么 子节点的也要变动 if (options.selectItem === undefined) { - that.components[item.tag].render(item, false,elem,that); + that.components[item.tag].render(item, false, elem, that); } else { if (options.selectItem.id === item.id) { - that.components[item.tag].render(item, true,elem,that); + that.components[item.tag].render(item, true, elem, that); //显示当前的属性 - that.components[item.tag].property(item,that); + that.components[item.tag].property(item, that); that.bindPropertyEvent(item); } else { - that.components[item.tag].render(item, false,elem,that); + that.components[item.tag].render(item, false, elem, that); } } if (item.tag === 'grid') { @@ -5027,7 +5036,7 @@ layui.config({base: './ayq/modules/'}).define(["layer",'flow', "laytpl", "elemen var tag = $(this)[0].dataset.tag; //显示当前的属性 - that.components[tag].property(options.selectItem,that); + that.components[tag].property(options.selectItem, that); that.bindPropertyEvent(); //移除 #formDesignerForm .layui-form-item 下所有的 active $('#formDesignerForm .layui-form-item').removeClass('active'); @@ -5052,7 +5061,7 @@ layui.config({base: './ayq/modules/'}).define(["layer",'flow', "laytpl", "elemen }; //移动视图 - Class.prototype.moveItem = function (oldIndex,newIndex) { + Class.prototype.moveItem = function (oldIndex, newIndex) { var that = this , options = that.config; var newData = options.data[newIndex]; @@ -5085,7 +5094,6 @@ layui.config({base: './ayq/modules/'}).define(["layer",'flow', "laytpl", "elemen } - /* 复制json中的节点并返回上一个节点*/ Class.prototype.copyJsonAfterItem = function (json, id) { var that = this, @@ -5124,7 +5132,7 @@ layui.config({base: './ayq/modules/'}).define(["layer",'flow', "laytpl", "elemen return json[i - 1]; } break; - }else { + } else { if (json[i].tag === 'grid') { for (var j = 0; j < json[i].columns.length; j++) { if (json[i].columns[j].list.length > 0) { @@ -5144,7 +5152,7 @@ layui.config({base: './ayq/modules/'}).define(["layer",'flow', "laytpl", "elemen var that = this, options = that.config; options.generateId = options.generateId + 1; - var findJsonItem = that.findJsonItem(options.data,tag + '_' + options.generateId); + var findJsonItem = that.findJsonItem(options.data, tag + '_' + options.generateId); if (findJsonItem != undefined) { return that.autoId(tag); } else { @@ -5153,7 +5161,7 @@ layui.config({base: './ayq/modules/'}).define(["layer",'flow', "laytpl", "elemen } //递归赋值 - Class.prototype.findAndCopyJson = function (json,parentItem,id) { + Class.prototype.findAndCopyJson = function (json, parentItem, id) { var that = this; for (var i = 0; i < json.length; i++) { if (json[i].id === id) { @@ -5162,7 +5170,7 @@ layui.config({base: './ayq/modules/'}).define(["layer",'flow', "laytpl", "elemen if (json[i].tag === 'grid') { for (var j = 0; j < json[i].columns.length; j++) { if (json[i].columns[j].list.length > 0) { - that.findAndCopyJson(json[i].columns[j].list,parentItem,id); + that.findAndCopyJson(json[i].columns[j].list, parentItem, id); } } } diff --git a/WebRoot/html/formDesign/ayq/modules/staticField.js b/WebRoot/html/formDesign/ayq/modules/staticField.js index b6c6292..34aa74b 100644 --- a/WebRoot/html/formDesign/ayq/modules/staticField.js +++ b/WebRoot/html/formDesign/ayq/modules/staticField.js @@ -173,10 +173,10 @@ layui.define(['layer'], function (exports) { // ' 导入数据\n' + // ' \n' + '
  • \n' + - ' 保存模板\n' + + ' 保存\n' + '
  • \n' + '
  • \n' + - ' 生成表单页\n' + + ' 查看测试页\n' + '
  • \n' + // '
  • \n' + // ' 生成代码\n' + diff --git a/WebRoot/html/formDesign/index.html b/WebRoot/html/formDesign/index.html index 813667d..2d9e2be 100644 --- a/WebRoot/html/formDesign/index.html +++ b/WebRoot/html/formDesign/index.html @@ -23,6 +23,11 @@ + + + + +