From 7e41b7510301b9c4096e214aae5566368c0f48ce Mon Sep 17 00:00:00 2001 From: evoxwht <442384644@qq.com> Date: Thu, 25 May 2023 09:17:46 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BC=98=E5=8C=96=E6=9D=83=E9=99=90=E8=AE=BE?= =?UTF-8?q?=E7=BD=AE=E3=80=82?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../services/system/SystemMenusServices.php | 9 +-- .../systemMenus/components/menusFrom.vue | 12 ++-- .../src/pages/setting/systemMenus/index.vue | 8 +-- .../systemMenus/components/menusFrom.vue | 71 +++++++++++++------ .../src/pages/system/systemMenus/index.vue | 6 +- 5 files changed, 64 insertions(+), 42 deletions(-) diff --git a/crmeb/app/services/system/SystemMenusServices.php b/crmeb/app/services/system/SystemMenusServices.php index fea86739b..62ae5f5ba 100644 --- a/crmeb/app/services/system/SystemMenusServices.php +++ b/crmeb/app/services/system/SystemMenusServices.php @@ -76,7 +76,7 @@ class SystemMenusServices extends BaseServices $systemRoleServices = app()->make(SystemRoleServices::class); $rules = $systemRoleServices->getRoleArray(['status' => 1, 'id' => $rouleId], 'rules'); $rulesStr = Arr::unique($rules); - $menusList = $this->dao->getMenusRoule(['route' => $level ? $rulesStr : '']); + $menusList = $this->dao->getMenusRoule(['route' => $level ? $rulesStr : '', 'is_show_path' => 1]); $unique = $this->dao->getMenusUnique(['unique' => $level ? $rulesStr : '']); return [Arr::getMenuIviewList($this->getMenusData($menusList)), $unique]; } @@ -123,9 +123,6 @@ class SystemMenusServices extends BaseServices protected function getFormCascaderMenus(int $value = 0, $auth_type = 0) { $where = ['is_del' => 0]; - if ($auth_type == 3) { - $where = ['is_del' => 0, 'auth_type' => 3]; - } $menuList = $this->dao->getMenusRoule($where, ['id as value', 'pid', 'menu_name as label']); $menuList = $this->getMenusData($menuList); if ($value) { @@ -152,7 +149,7 @@ class SystemMenusServices extends BaseServices $field[] = Form::input('unique_auth', '权限标识', $formData['unique_auth'] ?? '')->placeholder('不填写则后台自动生成'); $field[] = Form::frameInput('icon', '图标', $this->url(config('app.admin_prefix', 'admin') . '/widget.widgets/icon', ['fodder' => 'icon']), $formData['icon'] ?? '')->icon('md-add')->height('505px')->modal(['footer-hide' => true]); $field[] = Form::number('sort', '排序', (int)($formData['sort'] ?? 0))->precision(0); - $field[] = Form::radio('auth_type', '类型', $formData['auth_type'] ?? 1)->options([['value' => 1, 'label' => '菜单'], ['value' => 3, 'label' => '按钮']]); + $field[] = Form::radio('auth_type', '类型', $formData['auth_type'] ?? 1)->options([['value' => 1, 'label' => '菜单'], ['value' => 3, 'label' => '按钮'], ['value' => 2, 'label' => '接口']]); $field[] = Form::radio('is_show', '权限状态', $formData['is_show'] ?? 1)->options([['value' => 1, 'label' => '开启'], ['value' => 0, 'label' => '关闭']]); $field[] = Form::radio('is_show_path', '是否显示', $formData['is_show_path'] ?? 0)->options([['value' => 1, 'label' => '显示'], ['value' => 0, 'label' => '隐藏']]); [$menuList, $data] = $this->getFormCascaderMenus((int)($formData['pid'] ?? 0), 3); @@ -249,7 +246,7 @@ class SystemMenusServices extends BaseServices public function getMenus($roles): array { $field = ['menu_name', 'pid', 'id']; - $where = ['is_del' => 0, 'auth_type' => 3]; + $where = ['is_del' => 0, 'is_show_path' => 1]; if (!$roles) { $menus = $this->dao->getMenusRoule($where, $field); } else { diff --git a/template/admin/src/pages/setting/systemMenus/components/menusFrom.vue b/template/admin/src/pages/setting/systemMenus/components/menusFrom.vue index e70528d3f..2ddba3c54 100644 --- a/template/admin/src/pages/setting/systemMenus/components/menusFrom.vue +++ b/template/admin/src/pages/setting/systemMenus/components/menusFrom.vue @@ -2,7 +2,7 @@