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

属性表格展示的类型新增自定义名称功能

上级 5e21f5c1
...@@ -65,7 +65,7 @@ layui.config({ ...@@ -65,7 +65,7 @@ layui.config({
}, },
cols: [[ cols: [[
{ type: 'checkbox', align: 'center' }, { type: 'checkbox', align: 'center' },
{ field: 'attrKey', title: '属性', align: 'left', width: 150, templet: function (d) { { 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>`; var _html = `<select lay-filter="tableSelect" lay-search="" id="attrKey${d.id}" cus-id="${d.id}" win-verify="required"><option value="">全部</option>`;
$.each(childAttr, function (i, item) { $.each(childAttr, function (i, item) {
if (item.attrKey == d.attrKey) { if (item.attrKey == d.attrKey) {
...@@ -77,7 +77,11 @@ layui.config({ ...@@ -77,7 +77,11 @@ layui.config({
_html += `</select>`; _html += `</select>`;
return _html; return _html;
}}, }},
{ field: 'align', title: '对齐方式', align: 'left', width: 120, templet: function (d) { { 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>`; 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) { $.each(alignmentData.rows, function (i, item) {
if (item.id == d.align) { if (item.id == d.align) {
...@@ -89,11 +93,11 @@ layui.config({ ...@@ -89,11 +93,11 @@ layui.config({
_html += `</select>`; _html += `</select>`;
return _html; return _html;
}}, }},
{ field: 'width', title: '宽度', align: 'left', width: 120, templet: function (d) { { 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" ` + 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) + `"/>`; `value="` + (isNull(d.width) ? "" : d.width) + `"/>`;
}}, }},
{ field: 'templet', title: '脚本', align: 'left', width: 240, templet: function (d) { { 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" ` + return `<input type="text" id="templet${d.id}" placeholder="请填写脚本" cus-id="${d.id}" class="layui-input tableInput" ` +
`value="` + (isNull(d.templet) ? "" : d.templet) + `"/>`; `value="` + (isNull(d.templet) ? "" : d.templet) + `"/>`;
}}, }},
...@@ -138,17 +142,18 @@ layui.config({ ...@@ -138,17 +142,18 @@ layui.config({
form.on('submit(formAddBean)', function (data) { form.on('submit(formAddBean)', function (data) {
if (winui.verifyForm(data.elem)) { if (winui.verifyForm(data.elem)) {
if ($("#showType").val() == 5) { if ($("#showType").val() == 5) {
if (tableDataList.length == 0) { if (table.cache.messageTable.length == 0) {
winui.window.msg('请选择表格属性.', {icon: 2, time: 2000}); winui.window.msg('请选择表格属性.', {icon: 2, time: 2000});
return false; return false;
} }
$.each(tableDataList, function (i, item) { $.each(table.cache.messageTable, function (i, item) {
item.id = null; item.id = null;
item.className = childServiceClassName; item.className = childServiceClassName;
item.parentAttrKey = $("#attrKey").val(); item.parentAttrKey = $("#attrKey").val();
item.orderBy = i + 1; item.orderBy = i + 1;
item.actFlowId = parent.$("#actFlowId").val(); item.actFlowId = parent.$("#actFlowId").val();
}); });
tableDataList = [].concat(table.cache.messageTable);
} else { } else {
tableDataList = new Array(); tableDataList = new Array();
} }
......
...@@ -44,17 +44,18 @@ layui.config({ ...@@ -44,17 +44,18 @@ layui.config({
form.on('submit(formEditBean)', function (data) { form.on('submit(formEditBean)', function (data) {
if (winui.verifyForm(data.elem)) { if (winui.verifyForm(data.elem)) {
if ($("#showType").val() == 5) { if ($("#showType").val() == 5) {
if (tableDataList.length == 0) { if (table.cache.messageTable.length == 0) {
winui.window.msg('请选择表格属性.', {icon: 2, time: 2000}); winui.window.msg('请选择表格属性.', {icon: 2, time: 2000});
return false; return false;
} }
$.each(tableDataList, function (i, item) { $.each(table.cache.messageTable, function (i, item) {
item.id = null; item.id = null;
item.className = childServiceClassName; item.className = childServiceClassName;
item.parentAttrKey = $("#attrKey").val(); item.parentAttrKey = $("#attrKey").val();
item.orderBy = i + 1; item.orderBy = i + 1;
item.actFlowId = parent.$("#actFlowId").val(); item.actFlowId = parent.$("#actFlowId").val();
}); });
tableDataList = [].concat(table.cache.messageTable);
} else { } else {
tableDataList = new Array(); tableDataList = new Array();
} }
...@@ -119,7 +120,7 @@ layui.config({ ...@@ -119,7 +120,7 @@ layui.config({
}, },
cols: [[ cols: [[
{ type: 'checkbox', align: 'center' }, { type: 'checkbox', align: 'center' },
{ field: 'attrKey', title: '属性', align: 'left', width: 150, templet: function (d) { { 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>`; var _html = `<select lay-filter="tableSelect" lay-search="" id="attrKey${d.id}" cus-id="${d.id}" win-verify="required"><option value="">全部</option>`;
$.each(childAttr, function (i, item) { $.each(childAttr, function (i, item) {
if (item.attrKey == d.attrKey) { if (item.attrKey == d.attrKey) {
...@@ -131,7 +132,11 @@ layui.config({ ...@@ -131,7 +132,11 @@ layui.config({
_html += `</select>`; _html += `</select>`;
return _html; return _html;
}}, }},
{ field: 'align', title: '对齐方式', align: 'left', width: 120, templet: function (d) { { 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>`; 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) { $.each(alignmentData.rows, function (i, item) {
if (item.id == d.align) { if (item.id == d.align) {
...@@ -143,11 +148,11 @@ layui.config({ ...@@ -143,11 +148,11 @@ layui.config({
_html += `</select>`; _html += `</select>`;
return _html; return _html;
}}, }},
{ field: 'width', title: '宽度', align: 'left', width: 120, templet: function (d) { { 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" ` + 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) + `"/>`; `value="` + (isNull(d.width) ? "" : d.width) + `"/>`;
}}, }},
{ field: 'templet', title: '脚本', align: 'left', width: 240, templet: function (d) { { 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" ` + return `<input type="text" id="templet${d.id}" placeholder="请填写脚本" cus-id="${d.id}" class="layui-input tableInput" ` +
`value='` + (isNull(d.templet) ? "" : d.templet) + `'/>`; `value='` + (isNull(d.templet) ? "" : d.templet) + `'/>`;
}}, }},
......
...@@ -474,7 +474,6 @@ body .layer-ext-winconfirm .layui-layer-content { ...@@ -474,7 +474,6 @@ body .layer-ext-winconfirm .layui-layer-content {
.red{ .red{
color: #fb5553; color: #fb5553;
font-size: 16px; font-size: 16px;
font-family: fangsong;
} }
.yl{ .yl{
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册