修改模板文件

This commit is contained in:
Anyon 2022-03-07 13:08:41 +08:00
parent 3a916029d0
commit 124236ba52
3 changed files with 11 additions and 9 deletions

View File

@ -37,9 +37,10 @@
// 数据状态切换操作
layui.form.on('switch(StatusSwitchRoleTable)', function (obj) {
$.form.load("{:url('state')}", {id: obj.value, status: obj.elem.checked > 0 ? 1 : 0}, 'post', function (ret) {
var data = {id: obj.value, status: obj.elem.checked > 0 ? 1 : 0};
$.form.load("{:url('state')}", data, 'post', function (ret) {
if (ret.code < 1) $.msg.error(ret.info, 3, function () {
$('#RoleTable').trigger('reload'); // 操作异常时重载数据
$('#RoleTable').trigger('reload');
});
return false;
}, false);

View File

@ -48,9 +48,10 @@
// 数据状态切换操作
layui.form.on('switch(StatusSwitch)', function (obj) {
$.form.load("{:url('state')}", {id: obj.value, status: obj.elem.checked > 0 ? 1 : 0}, 'post', function (ret) {
var data = {id: obj.value, status: obj.elem.checked > 0 ? 1 : 0};
$.form.load("{:url('state')}", data, 'post', function (ret) {
if (ret.code < 1) $.msg.error(ret.info, 3, function () {
$('#BaseTable').trigger('reload'); // 操作异常时重载数据
$('#BaseTable').trigger('reload');
});
return false;
}, false);

View File

@ -44,11 +44,11 @@
{
field: 'headimg', title: '头像', width: 60, align: 'center', templet: function (d) {
if (!d.headimg) return '';
return layui.laytpl('<div data-tips-image data-tips-hover class="headimg headimg-xs margin-0" data-lazy-src="{{d.headimg}}" style="background-image:url({{d.headimg}})"></div>').render(d);
return layui.laytpl('<div class="headimg headimg-xs margin-0" data-tips-image data-tips-hover data-lazy-src="{{d.headimg}}"></div>').render(d);
}
},
{field: 'username', title: '登录账号', minWidth: 110, templet: '<div>{{d.username||"-"}}</div>'},
{field: 'nickname', title: '用户名称', minWidth: 110, templet: '<div>{{d.nickname||"-"}}</div>'},
{field: 'username', title: '登录账号', minWidth: 100, templet: '<div>{{d.username||"-"}}</div>'},
{field: 'nickname', title: '用户名称', minWidth: 100, templet: '<div>{{d.nickname||"-"}}</div>'},
/* {notempty name='bases'} */
{
field: 'usertype', title: '角色身份', minWidth: 140, sort: true, templet: function (d) {
@ -60,7 +60,7 @@
// {field: 'contact_mail', title: '联系邮箱', minWidth: 80, templet: '<div>{{d.contact_mail||"-"}}</div>'},
// {field: 'contact_phone', title: '联系电话', minWidth: 80, templet: '<div>{{d.contact_phone||"-"}}</div>'},
{field: 'status', title: '账号状态', align: 'center', minWidth: 110, templet: '#StatusSwitchTpl'},
{field: 'login_num', title: '登录次数', align: 'center', minWidth: 80, sort: true},
{field: 'login_num', title: '登录次数', align: 'center', minWidth: 100, sort: true},
{field: 'login_at', title: '最后登录', align: 'center', minWidth: 170, sort: true},
{field: 'create_at', title: '创建时间', align: 'center', minWidth: 170, sort: true},
{toolbar: '#toolbar', title: '操作面板', align: 'center', minWidth: 160, fixed: 'right'}
@ -91,7 +91,7 @@
<!-- 列表排序权重模板 -->
<script type="text/html" id="SortInputTpl">
<input type="number min=" 0"" data-blur-number="0" data-action-blur="{:sysuri()}" data-value="id#{{d.id}};action#sort;sort#{value}" data-loading="false" value="{{d.sort}}" class="layui-input text-center">
<input type="number" min="0" data-blur-number="0" data-action-blur="{:sysuri()}" data-value="id#{{d.id}};action#sort;sort#{value}" data-loading="false" value="{{d.sort}}" class="layui-input text-center">
</script>
<script type="text/html" id="toolbar">