调整组合表头示例,新增合并行

This commit is contained in:
mnisummer 2022-03-30 15:10:57 +08:00
parent 41bf76a49f
commit cad0d0d2f6
1 changed files with 28 additions and 49 deletions

View File

@ -17,53 +17,25 @@
var datas = [[${@dict.getType('sys_normal_disable')}]]; var datas = [[${@dict.getType('sys_normal_disable')}]];
$(function() { $(function() {
var options = { //合并行 & 合并列
url: prefix + "/list", let columns = [
showSearch: false, [
showRefresh: false, { checkbox : true, rowspan : 2 },
showToggle: false, { title : '基本信息', align : 'center', colspan : 5 },
showColumns: false, { title : '其他信息', align : 'center', colspan : 3 }
columns : [
[{
title : '基本信息',
align : 'center',
colspan : 6
}, {
title : '其他信息',
align : 'center',
colspan : 3
}
], ],
[{ [
checkbox : true { field : 'userId', title : '用户ID' },
}, { { field : 'userCode', title : '用户编号' },
field : 'userId', { field : 'userName', title : '用户姓名' },
title : '用户ID' { field : 'userPhone', title : '用户手机' },
}, { { field : 'userEmail', title : '用户邮箱' },
field : 'userCode', { field : 'userBalance', title : '用户余额' },
title : '用户编号' { field : 'status', title : '用户状态', formatter : function (value, row, index) {
}, {
field : 'userName',
title : '用户姓名'
}, {
field : 'userPhone',
title : '用户手机'
}, {
field : 'userEmail',
title : '用户邮箱'
}, {
field : 'userBalance',
title : '用户余额'
}, {
field : 'status',
title : '用户状态',
formatter : function (value, row, index) {
return $.table.selectDictLabel(datas, value); return $.table.selectDictLabel(datas, value);
} }
}, { },
title : '操作', { title : '操作', align : 'center', formatter : function (value, row, index) {
align : 'center',
formatter : function (value, row, index) {
var actions = []; var actions = [];
actions.push('<a class="btn btn-success btn-xs" href="#"><i class="fa fa-edit"></i>编辑</a> '); actions.push('<a class="btn btn-success btn-xs" href="#"><i class="fa fa-edit"></i>编辑</a> ');
actions.push('<a class="btn btn-danger btn-xs" href="#"><i class="fa fa-remove"></i>删除</a>'); actions.push('<a class="btn btn-danger btn-xs" href="#"><i class="fa fa-remove"></i>删除</a>');
@ -71,7 +43,14 @@
} }
} }
] ]
] ];
var options = {
url: prefix + "/list",
showSearch: false,
showRefresh: false,
showToggle: false,
showColumns: false,
columns : columns
}; };
$.table.init(options); $.table.init(options);
}); });