main
黄海 1 year ago
commit a2cb7f99cd

@ -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,25 @@ 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.tag == "grid") {
item.columns.forEach(function (columnsItem, columnsIndex) {
columnsItem.list.forEach(function (listItem, listIndex) {
if (listItem.id === thisName) {
options.selectItem = listItem;
}
});
});
} else {
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 +4457,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 +4481,7 @@ layui.config({base: './ayq/modules/'}).define(["layer", 'flow', "laytpl", "eleme
break;
}
});
}
/*--------------------------------------------------以下属于非修改内容---------------------------------------------------------*/
@ -4513,13 +4535,20 @@ 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;
}
that.bindPropertyEvent(item);
});
// options.data.forEach(function (item, index) {
// if (item.tag == "grid") {
// item.columns.forEach(function (columnsItem, columnsIndex) {
// columnsItem.list.forEach(function (listItem, listIndex) {
// that.bindPropertyEvent(listItem);
// });
// });
// }
// if (index === 0) {
// options.selectItem = item;
// }
// that.bindPropertyEvent(item);
// });
if (options.viewOrDesign) {
var that = this
@ -4827,7 +4856,6 @@ layui.config({base: './ayq/modules/'}).define(["layer", 'flow', "laytpl", "eleme
});
});
that.renderForm();
}
@ -4984,6 +5012,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 +5083,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 +5203,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 +5259,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 +5380,6 @@ layui.config({base: './ayq/modules/'}).define(["layer", 'flow', "laytpl", "eleme
return result;
}
exports('formDesigner', formDesigner);
exports('formDesigner'
, formDesigner);
});

@ -51,6 +51,12 @@
data: data,
elem: '#formdesigner'
});
//阻止body的drag冒泡问题
document.body.ondrop = function (event) {
event.preventDefault();
event.stopPropagation();
};
});
function GetQueryString(name, istop) {
@ -61,6 +67,19 @@
if (r != null) return unescape(r[2]);
return null;
}
<<<<<<< HEAD
if (r != null) return unescape(r[2]);
return null;
}
</script>
=======
</script>
>>>>>>> e9b2d3e86dfe83dea1477c229c7aaad77fb1636a
</body>
</html>

@ -484,7 +484,9 @@
window.createTask = function () {
window.localStorage.setItem('self_or_next', 1);
window.localStorage.setItem('target_type_id', 2);
console.log(123123123);
window.location = "../form/designer.html";
console.log(123123123);
}
window.refresh = function (param) {

Loading…
Cancel
Save