main
黄海 1 year ago
parent 7102f73fb1
commit 4f133eec70

@ -4366,6 +4366,7 @@ layui.config({base: './ayq/modules/'}).define(["layer", 'flow', "laytpl", "eleme
case 'checkbox-value':
//找到 id=key 下的 option值
var _index = parseInt($(this).parent().parent().attr("data-index"));
alert(_index);
if (_key === 'select-text' || _key === 'radio-text' || _key === 'checkbox-text') {
_json.options[_index].text = $(this).val();
} else {
@ -4406,8 +4407,15 @@ layui.config({base: './ayq/modules/'}).define(["layer", 'flow', "laytpl", "eleme
});
form.on('radio', function (data) {
var thisName = $(this).attr("name");
options.data.forEach(function (item, index) {
if (item.id === thisName) {
options.selectItem = item;
}
});
var _json = options.selectItem;
console.log(_json);
switch (_json.tag) {
case 'radio':
var _index = parseInt($("#" + _json.id + " .layui-input-block div.layui-form-radio").index(data.othis[0]));
@ -4439,7 +4447,10 @@ layui.config({base: './ayq/modules/'}).define(["layer", 'flow', "laytpl", "eleme
default:
break;
}
})
});
form.on('checkbox', function (data) {
var _json = options.selectItem;
switch (_json.tag) {
@ -4460,6 +4471,7 @@ layui.config({base: './ayq/modules/'}).define(["layer", 'flow', "laytpl", "eleme
break;
}
});
}
/*--------------------------------------------------以下属于非修改内容---------------------------------------------------------*/
@ -4513,7 +4525,6 @@ layui.config({base: './ayq/modules/'}).define(["layer", 'flow', "laytpl", "eleme
var that = this
, options = that.config;
//增加于2024-02-02 黄海
options.data.forEach(function (item, index) {
if (index === 0) {
options.selectItem = item;
@ -4827,7 +4838,6 @@ layui.config({base: './ayq/modules/'}).define(["layer", 'flow', "laytpl", "eleme
});
});
that.renderForm();
}
@ -4984,6 +4994,7 @@ layui.config({base: './ayq/modules/'}).define(["layer", 'flow', "laytpl", "eleme
var json = form.val();
for (let key in iceEditorObjects) {
json[key] = iceEditorObjects[key].getHTML();
}
@ -5054,7 +5065,8 @@ layui.config({base: './ayq/modules/'}).define(["layer", 'flow', "laytpl", "eleme
/* 重新渲染设计区*/
Class.prototype.renderForm = function () {
var that = this, options = that.config;
var that = this
, options = that.config;
if (options.viewOrDesign) {
var that = this
, options = that.config;
@ -5173,8 +5185,7 @@ layui.config({base: './ayq/modules/'}).define(["layer", 'flow', "laytpl", "eleme
//显示当前的属性
that.components[tag].property(options.selectItem, that);
that.bindPropertyEvent(options.selectItem);
that.bindPropertyEvent();
//移除 #formDesignerForm .layui-form-item 下所有的 active
$('#formDesignerForm .layui-form-item').removeClass('active');
//给当前元素增加class
@ -5230,6 +5241,7 @@ layui.config({base: './ayq/modules/'}).define(["layer", 'flow', "laytpl", "eleme
return undefined;
}
/* 复制json中的节点并返回上一个节点*/
Class.prototype.copyJsonAfterItem = function (json, id) {
var that = this,
@ -5350,5 +5362,6 @@ layui.config({base: './ayq/modules/'}).define(["layer", 'flow', "laytpl", "eleme
return result;
}
exports('formDesigner', formDesigner);
exports('formDesigner'
, formDesigner);
});
Loading…
Cancel
Save