优化UI&修正菜单禁用选择问题

This commit is contained in:
Anyon 2020-07-10 14:38:13 +08:00
parent b22072a785
commit 670809cfe5
5 changed files with 42 additions and 25 deletions

View File

@ -99,15 +99,15 @@ class Menu extends Controller
if ($this->request->isGet()) {
// 清理权限节点
AdminService::instance()->clearCache();
// 选择自己的上级菜单
$vo['pid'] = $vo['pid'] ?? input('pid', '0');
// 读取系统功能节点
$this->nodes = MenuService::instance()->getList();
// 选择自己的上级菜单
if (empty($vo['pid']) && $this->request->get('pid', '0')) $vo['pid'] = $this->request->get('pid', '0');
// 列出可选上级菜单
$menus = $this->app->db->name($this->table)->where(['status' => '1'])->order('sort desc,id asc')->column('id,pid,icon,url,title,params', 'id');
$menus = $this->app->db->name($this->table)->order('sort desc,id asc')->column('id,pid,icon,url,title,params', 'id');
$this->menus = DataExtend::arr2table(array_merge($menus, [['id' => '0', 'pid' => '-1', 'url' => '#', 'title' => '顶部菜单']]));
if (isset($vo['id'])) foreach ($this->menus as $key => $menu) if ($menu['id'] === $vo['id']) $vo = $menu;
foreach ($this->menus as $key => &$menu) {
foreach ($this->menus as $key => $menu) {
if ($menu['spt'] >= 3 || $menu['url'] !== '#') unset($this->menus[$key]);
if (isset($vo['spt']) && $vo['spt'] <= $menu['spt']) unset($this->menus[$key]);
}

View File

@ -22,11 +22,11 @@
<div class="layui-card-body nowrap">
<div class="layui-btn-group">
{if $app->isDebug()}
<a class="layui-btn layui-btn-sm" data-tips-text="当前以开发模式运行中...">以开发模式运行</a>
<a class="layui-btn layui-btn-sm layui-btn-primary" data-tips-text="立即切换到生产模式运行" data-load="{:url('admin/api.plugs/debug')}?state=1">以生产模式运行</a>
<a class="layui-btn layui-btn-sm border-right-0" data-tips-text="当前以开发模式运行中...">以开发模式运行</a>
<a class="layui-btn layui-btn-sm layui-btn-primary border-left-0" data-tips-text="立即切换到生产模式运行" data-load="{:url('admin/api.plugs/debug')}?state=1">以生产模式运行</a>
{else}
<a class="layui-btn layui-btn-sm layui-btn-primary" data-tips-text="立即切换到开发模式运行" data-load="{:url('admin/api.plugs/debug')}?state=0">以开发模式运行</a>
<a class="layui-btn layui-btn-sm" data-tips-text="当前以生产模式运行中...">以生产模式运行</a>
<a class="layui-btn layui-btn-sm layui-btn-primary border-right-0" data-tips-text="立即切换到开发模式运行" data-load="{:url('admin/api.plugs/debug')}?state=0">以开发模式运行</a>
<a class="layui-btn layui-btn-sm border-left-0" data-tips-text="当前以生产模式运行中...">以生产模式运行</a>
{/if}
</div>
</div>
@ -40,9 +40,9 @@
<div class="layui-card-body nowrap">
<div class="layui-btn-group">
{foreach ['local'=>'本地服务器存储','qiniu'=>'七牛云对象存储','alioss'=>'阿里云OSS存储'] as $k => $v} {if sysconf('storage.type') eq $k}
{if auth('storage')}<a data-title="配置{$v}" data-tips-text="切换并配置以{$v}文件" data-modal="{:url('storage')}?type={$k}" class="layui-btn layui-btn-sm">{$v}</a>{else}<a class="layui-btn layui-btn-sm layui-btn-sm">{$v}</a>{/if}
{if auth('storage')}<a data-title="配置{$v}" data-tips-text="切换并配置以{$v}文件" data-modal="{:url('storage')}?type={$k}" class="layui-btn layui-btn-sm border-right-0">{$v}</a>{else}<a class="layui-btn layui-btn-sm border-right-0">{$v}</a>{/if}
{else}
{if auth('storage')}<a data-title="配置{$v}" data-tips-text="切换并配置以{$v}文件" data-modal="{:url('storage')}?type={$k}" class="layui-btn layui-btn-sm layui-btn-primary">{$v}</a>{else}<a class="layui-btn layui-btn-sm">{$v}</a>{/if}
{if auth('storage')}<a data-title="配置{$v}" data-tips-text="切换并配置以{$v}文件" data-modal="{:url('storage')}?type={$k}" class="layui-btn layui-btn-sm layui-btn-primary">{$v}</a>{else}<a class="layui-btn layui-btn-sm layui-btn-primary">{$v}</a>{/if}
{/if}{/foreach}
</div>
</div>

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

View File

@ -189,26 +189,43 @@
}
}
/* 文字大小 */
.border-0 {
border: 0 !important
}
.border-radius {
border-radius: 50% !important;
.border {
&-0 {
border-radius: 0 !important
border: 0 !important
}
&-top-0 {
border-top: 0 !important;
}
&-left-0 {
border-top-left-radius: 0 !important;
border-bottom-left-radius: 0 !important
border-left: 0 !important;
}
&-right-0 {
border-top-right-radius: 0 !important;
border-bottom-right-radius: 0 !important
border-right: 0 !important;
}
&-bottom-0 {
border-bottom: 0 !important;
}
&-radius {
border-radius: 50% !important;
&-0 {
border-radius: 0 !important
}
&-left-0 {
border-top-left-radius: 0 !important;
border-bottom-left-radius: 0 !important
}
&-right-0 {
border-top-right-radius: 0 !important;
border-bottom-right-radius: 0 !important
}
}
}