'.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 += '