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