提交 cc497145 编写于 作者: Skyeye云's avatar Skyeye云

代码修改

上级 273ab8e0
...@@ -11,14 +11,74 @@ layui.config({ ...@@ -11,14 +11,74 @@ layui.config({
form = layui.form, form = layui.form,
table = layui.table, table = layui.table,
soulTable = layui.soulTable; soulTable = layui.soulTable;
var tableDataList = new Array();
var selOption = getFileContent('tpl/template/select-option.tpl'); var selOption = getFileContent('tpl/template/select-option.tpl');
// 获取属性 // 获取属性
var attrList = [];
AjaxPostUtil.request({url: reqBasePath + "queryAttrDefinitionList", params: {className: parent.objectId}, type: 'json', method: "POST", callback: function (data) { AjaxPostUtil.request({url: reqBasePath + "queryAttrDefinitionList", params: {className: parent.objectId}, type: 'json', method: "POST", callback: function (data) {
$("#attrKey").html(getDataUseHandlebars(`<option value="">全部</option>{{#each rows}}<option value="{{attrKey}}">{{name}}</option>{{/each}}`, data)); attrList = [].concat(data.rows);
$("#attrKey").val(json.bean.attrKey);
}, async: false}); }, async: false});
table.render({
id: 'messageTable',
elem: '#messageTable',
method: 'get',
data: tableDataList,
even: true,
page: false,
rowDrag: {
trigger: 'row',
done: function(obj) {}
},
cols: [[
{ type: 'checkbox', align: 'center' },
{ field: 'attrKey', title: '属性<i class="red">*</i>', align: 'left', width: 150, templet: function (d) {
var _html = `<select lay-filter="tableSelect" lay-search="" id="attrKey${d.id}" cus-id="${d.id}" win-verify="required"><option value="">全部</option>`;
$.each(attrList, function (i, item) {
if (item.attrKey == d.attrKey) {
_html += `<option value="${item.attrKey}" selected="selected">${item.name}</option>`;
} else {
_html += `<option value="${item.attrKey}">${item.name}</option>`;
}
});
_html += `</select>`;
return _html;
}},
{ field: 'name', title: '名称', align: 'left', width: 120, templet: function (d) {
return `<input type="text" id="name${d.id}" placeholder="请填写名称" cus-id="${d.id}" class="layui-input tableInput" ` +
`value="` + (isNull(d.name) ? "" : d.name) + `"/>`;
}},
{ field: 'align', title: '对齐方式<i class="red">*</i>', align: 'left', width: 120, templet: function (d) {
var _html = `<select lay-filter="tableSelect" lay-search="" id="align${d.id}" cus-id="${d.id}" win-verify="required"><option value="">全部</option>`;
$.each(alignmentData.rows, function (i, item) {
if (item.id == d.align) {
_html += `<option value="${item.id}" selected="selected">${item.name}</option>`;
} else {
_html += `<option value="${item.id}">${item.name}</option>`;
}
});
_html += `</select>`;
return _html;
}},
{ field: 'width', title: '宽度<i class="red">*</i>', align: 'left', width: 120, templet: function (d) {
return `<input type="text" id="width${d.id}" placeholder="请填写宽度" cus-id="${d.id}" class="layui-input tableInput" win-verify="required|number" ` +
`value="` + (isNull(d.width) ? "" : d.width) + `"/>`;
}},
{ field: 'templet', title: '脚本', align: 'left', width: 300, templet: function (d) {
return `<input type="text" id="templet${d.id}" placeholder="请填写脚本" cus-id="${d.id}" class="layui-input tableInput" ` +
`value='` + (isNull(d.templet) ? "" : d.templet) + `'/>`;
}},
]],
done: function(json) {
matchingLanguage();
if ($(`div[lay-id='messageTable']`).find('.place-holder').length == 0) {
$(`div[lay-id='messageTable']`).find('.layui-table-body').append('<div class="place-holder"></div>');
}
soulTable.render(this);
}
});
matchingLanguage(); matchingLanguage();
form.render(); form.render();
form.on('submit(formWriteBean)', function (data) { form.on('submit(formWriteBean)', function (data) {
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册