修改后台样式文件

This commit is contained in:
Anyon 2022-03-03 10:52:20 +08:00
parent 3adcada735
commit 468c489121
17 changed files with 61 additions and 59 deletions

View File

@ -18,6 +18,7 @@ namespace app\admin\controller;
use think\admin\Controller;
use think\admin\extend\DataExtend;
use think\admin\helper\QueryHelper;
use think\admin\model\SystemMenu;
use think\admin\service\AdminService;
use think\admin\service\MenuService;
@ -40,9 +41,12 @@ class Menu extends Controller
*/
public function index()
{
$this->title = '系统菜单管理';
$this->type = input('get.type', 'index');
SystemMenu::mQuery()->order('sort desc,id asc')->layTable();//->page(false, true);
SystemMenu::mQuery()->layTable(function () {
$this->title = '系统菜单管理';
}, function (QueryHelper $query) {
$query->order('sort desc,id asc');
});
}
/**
@ -68,7 +72,7 @@ class Menu extends Controller
if ($vo['url'] !== '#' && !preg_match('/^(https?:)?(\/\/|\\\\)/i', $vo['url'])) {
$vo['url'] = trim(url($vo['url']) . ($vo['params'] ? "?{$vo['params']}" : ''), '\\/');
}
$vo['ids'] = join(',', DataExtend::getArrSubIds($data, $vo['id']));
$vo['ids'] = arr2str(DataExtend::getArrSubIds($data, $vo['id']));
}
}

View File

@ -58,5 +58,4 @@ invoke(function (App $app) {
return json(['code' => 0, 'info' => '演示环境禁止修改用户密码!']);
});
}
});

View File

@ -1,4 +1,4 @@
<form class="layui-form layui-card" data-table-id="RoleData" action="{:sysuri()}" data-auto="true" method="post">
<form class="layui-form layui-card" data-table-id="RoleTable" action="{:sysuri()}" data-auto="true" method="post">
<div class="layui-card-body padding-left-40">

View File

@ -2,18 +2,18 @@
{block name="button"}
<!--{if auth("add")}-->
<button data-modal='{:url("add")}' data-table-id="RoleData" class='layui-btn layui-btn-sm layui-btn-primary'>添加权限</button>
<button data-modal='{:url("add")}' data-table-id="RoleTable" class='layui-btn layui-btn-sm layui-btn-primary'>添加权限</button>
<!--{/if}-->
<!--{if auth("remove")}-->
<button data-action='{:url("remove")}' data-table-id="RoleData" data-rule="id#{id}" data-confirm="确定要批量删除权限吗?" class='layui-btn layui-btn-sm layui-btn-primary'>批量删除</button>
<button data-action='{:url("remove")}' data-table-id="RoleTable" data-rule="id#{id}" data-confirm="确定要批量删除权限吗?" class='layui-btn layui-btn-sm layui-btn-primary'>批量删除</button>
<!--{/if}-->
{/block}
{block name="content"}
<div class="think-box-shadow">
{include file='auth/index_search'}
<table id="RoleData" data-url="{:sysuri()}" data-target-search="form.form-search"></table>
<table id="RoleTable" data-url="{:sysuri()}" data-target-search="form.form-search"></table>
</div>
{/block}
@ -21,25 +21,25 @@
<script>
$(function () {
// 初始化表格组件
$('#RoleData').layTable({
$('#RoleTable').layTable({
even: true, height: 'full',
sort: {field: 'sort desc,id', type: 'desc'},
cols: [[
{checkbox: true, fixed: true},
{field: 'sort', title: '排序权重', align: 'center', width: 100, sort: true, templet: '#SortInputRoleDataTpl'},
{field: 'sort', title: '排序权重', align: 'center', width: 100, sort: true, templet: '#SortInputRoleTableTpl'},
{field: 'title', title: '权限名称', align: 'center', minWidth: 140},
{field: 'desc', title: '权限描述', align: 'center', minWidth: 110, templet: '<div>{{d.desc||"-"}}</div>'},
{field: 'status', title: '权限状态', align: 'center', minWidth: 110, templet: '#StatusSwitchRoleDataTpl'},
{field: 'status', title: '权限状态', align: 'center', minWidth: 110, templet: '#StatusSwitchRoleTableTpl'},
{field: 'create_at', title: '创建时间', align: 'center', minWidth: 170, sort: true},
{toolbar: '#ToolbarRoleDataTpl', title: '操作面板', align: 'center', minWidth: 210, fixed: 'right'},
{toolbar: '#ToolbarRoleTableTpl', title: '操作面板', align: 'center', minWidth: 210, fixed: 'right'},
]]
});
// 数据状态切换操作
layui.form.on('switch(StatusSwitchRoleData)', function (obj) {
layui.form.on('switch(StatusSwitchRoleTable)', function (obj) {
$.form.load("{:url('state')}", {id: obj.value, status: obj.elem.checked > 0 ? 1 : 0}, 'post', function (ret) {
if (ret.code < 1) $.msg.error(ret.info, 3, function () {
$('#RoleData').trigger('reload'); // 操作异常时重载数据
$('#RoleTable').trigger('reload'); // 操作异常时重载数据
});
return false;
}, false);
@ -49,21 +49,21 @@
</script>
<!-- 列表排序权重模板 -->
<script type="text/html" id="SortInputRoleDataTpl">
<script type="text/html" id="SortInputRoleTableTpl">
<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="StatusSwitchRoleDataTpl">
<script type="text/html" id="StatusSwitchRoleTableTpl">
<!--{if auth("state")}-->
<input type="checkbox" value="{{d.id}}" lay-skin="switch" lay-text="已激活|已禁用" lay-filter="StatusSwitchRoleData" {{d.status>0?'checked':''}}>
<input type="checkbox" value="{{d.id}}" lay-skin="switch" lay-text="已激活|已禁用" lay-filter="StatusSwitchRoleTable" {{d.status>0?'checked':''}}>
<!--{else}-->
{{d.status ? '<b class="color-green">已启用</b>' : '<b class="color-red">已禁用</b>'}}
<!--{/if}-->
</script>
<!-- 数据操作工具条模板 -->
<script type="text/html" id="ToolbarRoleDataTpl">
<script type="text/html" id="ToolbarRoleTableTpl">
<!--{if auth('edit')}-->
<a class="layui-btn layui-btn-primary layui-btn-sm" data-title="编辑权限" data-modal='{:url("edit")}?id={{d.id}}'> </a>
<!--{/if}-->

View File

@ -1,4 +1,4 @@
<form class="layui-form layui-card" data-table-id="BaseData" action="{:sysuri()}" data-auto="true" method="post">
<form class="layui-form layui-card" data-table-id="BaseTable" action="{:sysuri()}" data-auto="true" method="post">
<div class="layui-card-body padding-left-40">

View File

@ -2,11 +2,11 @@
{block name="button"}
<!--{if auth("add")}-->
<button data-modal='{:url("add")}?type={$type|default=""}' data-table-id="BaseData" data-title="添加数据" class='layui-btn layui-btn-sm layui-btn-primary'>添加数据</button>
<button data-table-id="BaseTable" data-modal='{:url("add")}?type={$type|default=""}' class='layui-btn layui-btn-sm layui-btn-primary'>添加数据</button>
<!--{/if}-->
<!--{if auth("remove")}-->
<button data-action='{:url("remove")}' data-table-id="BaseData" data-rule="id#{id}" data-confirm="确定要批量删除数据吗?" class='layui-btn layui-btn-sm layui-btn-primary'>批量删除</button>
<button data-table-id="BaseTable" data-action='{:url("remove")}' data-rule="id#{id}" data-confirm="确定要批量删除数据吗?" class='layui-btn layui-btn-sm layui-btn-primary'>批量删除</button>
<!--{/if}-->
{/block}
@ -21,7 +21,7 @@
</ul>
<div class="layui-tab-content">
{include file='base/index_search'}
<table id="BaseData" data-url="{:sysuri()}" data-target-search="form.form-search"></table>
<table id="BaseTable" data-url="{:sysuri()}" data-target-search="form.form-search"></table>
</div>
</div>
{/block}
@ -30,7 +30,7 @@
<script>
$(function () {
// 初始化表格组件
$('#BaseData').layTable({
$('#BaseTable').layTable({
even: true, height: 'full',
sort: {field: 'sort desc,id', type: 'asc'},
where: {type: '{$type|default=""}'},
@ -50,7 +50,7 @@
layui.form.on('switch(StatusSwitch)', function (obj) {
$.form.load("{:url('state')}", {id: obj.value, status: obj.elem.checked > 0 ? 1 : 0}, 'post', function (ret) {
if (ret.code < 1) $.msg.error(ret.info, 3, function () {
$('#BaseData').trigger('reload'); // 操作异常时重载数据
$('#BaseTable').trigger('reload'); // 操作异常时重载数据
});
return false;
}, false);
@ -60,7 +60,7 @@
<!-- 列表排序权重模板 -->
<script type="text/html" id="SortInputTpl">
<input min="0" type="number" 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>
<!-- 数据状态切换模板 -->

View File

@ -1,4 +1,4 @@
<form data-auto="true" action="{:sysuri()}" method="post" id="theme" class='layui-form layui-card' autocomplete="off">
<form id="theme" action="{:sysuri()}" method="post" data-auto="true" class='layui-form layui-card'>
<div class="layui-card-body padding-left-40">
<div class="layui-form-item margin-bottom-5 label-required-prev">

View File

@ -3,7 +3,7 @@
{block name='header'}
{notempty name='title'}
<div class="layui-card-header notselect">
<span class="layui-icon layui-icon-next font-s10 color-desc margin-right-5"></span>{$title|default=''}
<span class="layui-icon font-s10 color-desc margin-right-5">&#xe65b;</span>{$title|default=''}
<div class="pull-right">{block name='button'}{/block}</div>
</div>
{/notempty}

View File

@ -1,4 +1,4 @@
<form class="layui-form layui-card" action="{:sysuri()}" data-auto="true" method="post" autocomplete="off">
<form class="layui-form layui-card" data-table-id="MenuData" action="{:sysuri()}" data-auto="true" method="post">
<div class="layui-card-body">

View File

@ -6,11 +6,11 @@
<!--{/if}-->
<!--{if $type eq 'index' and auth("state")}-->
<button data-action='{:url("state")}' data-csrf="{:systoken('state')}" data-rule="id#{key};status#0" class='layui-btn layui-btn-sm layui-btn-primary'>禁用菜单</button>
<button data-action='{:url("state")}' data-rule="id#{key};status#0" class='layui-btn layui-btn-sm layui-btn-primary'>禁用菜单</button>
<!--{/if}-->
<!--{if $type eq 'recycle' and auth("state")}-->
<button data-action='{:url("state")}' data-csrf="{:systoken('state')}" data-rule="id#{key};status#1" class='layui-btn layui-btn-sm layui-btn-primary'>激活菜单</button>
<button data-action='{:url("state")}' data-rule="id#{key};status#1" class='layui-btn layui-btn-sm layui-btn-primary'>激活菜单</button>
<!--{/if}-->
{/block}
@ -66,7 +66,7 @@
var data = {id: obj.value, status: obj.elem.checked > 0 ? 1 : 0};
if (data.status > 0) data.id += obj.elem.dataset.path.replace(/-/g, ',');
$.form.load("{:url('state')}", data, 'post', function (ret) {
if (obj.value.indexOf(',') > -1) {
if (obj.value.split(',').length > 2) {
$('#MenuData').trigger('reload');
} else if (ret.code < 1) $.msg.error(ret.info, 3, function () {
$('#MenuData').trigger('reload');

View File

@ -2,24 +2,25 @@
{block name="button"}
<!--{if auth("remove")}-->
<button data-action='{:url("remove")}' data-rule="id#{id}" data-table-id="OplogData" data-confirm="确定要删除选中的日志吗?" class='layui-btn layui-btn-sm layui-btn-primary'>批量删除</button>
<button data-table-id="OplogTable" data-action='{:url("remove")}' data-rule="id#{id}" data-confirm="确定要删除选中的日志吗?" class='layui-btn layui-btn-sm layui-btn-primary'>批量删除</button>
<!--{/if}-->
<!--{if auth("clear")}-->
<button data-load='{:url("clear")}' data-table-id="OplogData" data-confirm="确定要清空所有日志吗?" class='layui-btn layui-btn-sm layui-btn-primary'>清空日志</button>
<button data-table-id="OplogTable" data-load='{:url("clear")}' data-confirm="确定要清空所有日志吗?" class='layui-btn layui-btn-sm layui-btn-primary'>清空日志</button>
<!--{/if}-->
{/block}
{block name="content"}
<div class="think-box-shadow">
{include file='oplog/index_search'}
<table id="OplogData" data-url="{:sysuri()}" data-target-search="form.form-search"></table>
<table id="OplogTable" data-url="{:sysuri()}" data-target-search="form.form-search"></table>
</div>
{/block}
{block name='script'}
<script>
$(function () {
$('#OplogData').layTable({
$('#OplogTable').layTable({
even: true, height: 'full',
sort: {field: 'id', type: 'desc'},
cols: [[

View File

@ -15,7 +15,7 @@
<!--{/if}-->
<!--{if auth("remove")}-->
<button data-action='{:url("remove")}' data-rule="id#{id}" data-table-id="QueueData" data-confirm="确定批量删除记录吗?" class='layui-btn layui-btn-sm layui-btn-primary'>批量删除</button>
<button data-action='{:url("remove")}' data-rule="id#{id}" data-confirm="确定批量删除记录吗?" class='layui-btn layui-btn-sm layui-btn-primary'>批量删除</button>
<!--{/if}-->
{/block}
@ -30,29 +30,29 @@
</div>
<div class="think-box-shadow">
{include file='queue/index_search'}
<table id="QueueData" data-url="{:sysuri()}" data-target-search="form.form-search"></table>
<table id="QueueTable" data-url="{:sysuri()}" data-target-search="form.form-search"></table>
</div>
{/block}
{block name='script'}
<style>
#QueueData + div tbody .layui-table-cell {
#QueueTable + div tbody .layui-table-cell {
height: 44px;
line-height: 22px;
line-height: 24px;
}
#QueueData + div tbody .layui-table-cell .layui-btn {
#QueueTable + div tbody .layui-table-cell .layui-btn {
margin-top: 8px;
}
#QueueData + div tbody .layui-table-cell.laytable-cell-checkbox {
#QueueTable + div tbody .layui-table-cell.laytable-cell-checkbox {
line-height: 44px;
}
</style>
<script>
$(function () {
$('#QueueData').layTable({
$('#QueueTable').layTable({
height: 'full',
even: true, sort: {field: 'loops_time desc,id', type: 'desc'},
cols: [[
@ -95,7 +95,7 @@
d.enter_time = d.enter_time || '', d.outer_time = d.outer_time || '0.0000';
if (d.enter_time.length > 12) {
d.html += d.enter_time.substring(12) + '<span class="color-desc"> ( 耗时 ' + d.outer_time + ' )</span>';
d.html += ',已执行 <b>' + (d.attempts || 0) + '</b> 次';
d.html += ' 已执行 <b class="color-blue">' + (d.attempts || 0) + '</b> 次';
} else {
d.html += '<span class="color-desc">任务未执行</span>'
}

View File

@ -2,7 +2,7 @@
{block name='style'}{/block}
{block name='header'}{notempty name='title'}
<div class="layui-card-header notselect">
<span class="layui-icon layui-icon-next font-s10 color-desc margin-right-5"></span>{$title|default=''}
<span class="layui-icon font-s10 color-desc margin-right-5">&#xe65b;</span>{$title|default=''}
<div class="pull-right">{block name='button'}{/block}</div>
</div>
{/notempty}{/block}

View File

@ -1,4 +1,4 @@
<form class="layui-form layui-card" action="{:sysuri()}" data-table-id="UserData" data-auto="true" method="post">
<form class="layui-form layui-card" action="{:sysuri()}" data-table-id="UserTable" data-auto="true" method="post">
<div class="layui-card-body padding-left-40">
<fieldset>

View File

@ -6,14 +6,14 @@
<button data-modal='{:url("add")}' data-title="添加用户" class='layui-btn layui-btn-sm layui-btn-primary'>添加用户</button>
<!--{/if}-->
<!--{if auth("state")}-->
<a data-confirm="确定要启用该用户吗?" data-table-id="UserData" data-action="{:url('state')}" data-rule="id#{id};status#0" class='layui-btn layui-btn-sm layui-btn-primary'>批量禁用</a>
<a data-confirm="确定要启用该用户吗?" data-table-id="UserTable" data-action="{:url('state')}" data-rule="id#{id};status#0" class='layui-btn layui-btn-sm layui-btn-primary'>批量禁用</a>
<!--{/if}-->
{else}
<!--{if auth("state")}-->
<a data-confirm="确定要恢复这些账号吗?" data-table-id="UserData" data-action="{:url('state')}" data-rule="id#{id};status#1" class='layui-btn layui-btn-sm layui-btn-primary'>批量恢复</a>
<a data-confirm="确定要恢复这些账号吗?" data-table-id="UserTable" data-action="{:url('state')}" data-rule="id#{id};status#1" class='layui-btn layui-btn-sm layui-btn-primary'>批量恢复</a>
<!--{/if}-->
<!--{if auth("remove")}-->
<a data-confirm="确定永久删除这些账号吗?" data-table-id="UserData" data-action='{:url("remove")}' data-rule="id#{id}" class='layui-btn layui-btn-sm layui-btn-primary'>批量删除</a>
<a data-confirm="确定永久删除这些账号吗?" data-table-id="UserTable" data-action='{:url("remove")}' data-rule="id#{id}" class='layui-btn layui-btn-sm layui-btn-primary'>批量删除</a>
<!--{/if}-->
{/if}
{/block}
@ -29,12 +29,12 @@
</ul>
<div class="layui-tab-content">
{include file='user/index_search'}
<table id="UserData" data-url="{:sysuri('index')}" data-target-search="form.form-search"></table>
<table id="UserTable" data-url="{:sysuri('index')}" data-target-search="form.form-search"></table>
</div>
</div>
<script>
$(function () {
$('#UserData').layTable({
$('#UserTable').layTable({
even: true, height: 'full',
sort: {field: 'sort desc,id', type: 'desc'},
where: {type: '{$type|default="index"}'},
@ -72,7 +72,7 @@
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 () {
$('#UserData').trigger('reload');
$('#UserTable').trigger('reload');
});
return false;
}, false);
@ -91,7 +91,7 @@
<!-- 列表排序权重模板 -->
<script type="text/html" id="SortInputTpl">
<input min="0" type="number" 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">

View File

@ -1,4 +1,4 @@
<form class="layui-form layui-card" action="{:sysuri()}" data-auto="true" method="post" autocomplete="off">
<form class="layui-form layui-card" data-table-id="UserTable" action="{:sysuri()}" data-auto="true" method="post">
<div class="layui-card-body padding-left-40">
<div class="layui-form-item">
<label class="relative block">

View File

@ -693,8 +693,7 @@ $(function () {
option.done = function () {
layui.sessionData('pages', {key: table.id, value: this.page.curr || 1}), (table.loading = true);
$table.next().find('[data-load],[data-queue],[data-action],[data-iframe]').not('[data-table-id]').attr('data-table-id', table.id);
};
option.parseData = function (res) {
}, option.parseData = function (res) {
if (typeof params.filter === 'function') res.data = params.filter(res.data);
var maxp = Math.ceil(res.count / table.limit), curp = layui.sessionData('pages')[option.id] || 1;
if (curp > maxp && curp > 1) table.elem.trigger('reload', {page: {curr: maxp}});
@ -703,14 +702,13 @@ $(function () {
// 实例并绑定的对象
$table.data('this', layui.table.render(bindData(option)));
// 绑定实例重载事件
$table.bind('reload render', function (evt, opts) {
$table.bind('reload render reloadData', function (evt, opts) {
opts = opts || {}, opts.loading = true;
data = $.extend({}, data, opts.where || {});
if (evt.type === 'render') {
layui.table.reload(table.id, bindData(opts || {}));
if (evt.type === 'render1' || evt.type === 'reloadData') {
layui.table.reloadData(table.id, bindData(opts || {}));
} else {
layui.table.reload(table.id, bindData(opts || {}));
// layui.table.reloadData(table.id, bindData(opts || {}));
}
}).bind('row sort tool edit radio toolbar checkbox rowDouble', function (evt, call) {
layui.table.on(evt.type + '(' + table.dataset.id + ')', call)