Просмотр исходного кода

Merge branch 'v5.0.0dev' of https://gitee.com/ZhongBangKeJi/CRMEB into v5.0.0dev

From-wh 2 лет назад
Родитель
Сommit
5196dde140

+ 7 - 0
crmeb/app/adminapi/controller/v1/setting/SystemMenus.php

@@ -40,12 +40,19 @@ class SystemMenus extends AuthController
     /**
      * 菜单展示列表
      * @return \think\Response
+     * @throws \think\db\exception\DataNotFoundException
+     * @throws \think\db\exception\DbException
+     * @throws \think\db\exception\ModelNotFoundException
+     * @author 吴汐
+     * @email 442384644@qq.com
+     * @date 2023/05/06
      */
     public function index()
     {
         $where = $this->request->getMore([
             ['is_show', ''],
             ['keyword', ''],
+            ['auth_type', ''],
         ]);
         return app('json')->success($this->services->getList($where));
     }

+ 3 - 1
crmeb/app/model/system/SystemMenus.php

@@ -231,6 +231,8 @@ class SystemMenus extends BaseModel
      */
     public function searchAuthTypeAttr($query, $value)
     {
-        $query->where('auth_type', $value);
+        if ($value !== '') {
+            $query->where('auth_type', $value);
+        }
     }
 }

+ 2 - 2
crmeb/app/services/system/SystemMenusServices.php

@@ -152,8 +152,8 @@ class SystemMenusServices extends BaseServices
         $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' => 2, 'label' => '接口'], ['value' => 1, 'label' => '菜单(包含页面按钮)']]);
-        $field[] = Form::radio('is_show', '状态', $formData['is_show'] ?? 1)->options([['value' => 0, 'label' => '关闭'], ['value' => 1, 'label' => '开启']]);
-        $field[] = Form::radio('is_show_path', '是否为前端隐藏菜单', $formData['is_show_path'] ?? 0)->options([['value' => 1, 'label' => '是'], ['value' => 0, '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));
         $field[] = Form::cascader('menu_list', '父级id', $data)->data($menuList)->filterable(true);
         return $field;

+ 1 - 2
crmeb/crmeb/utils/Arr.php

@@ -66,8 +66,7 @@ class Arr
             $temp['icon'] = $v['icon'];
             $temp['header'] = $v['header'];
             $temp['is_header'] = $v['is_header'];
-            $temp['is_show'] = $v['is_show'];
-            $temp['is_show_path'] = $v['is_show_path'];
+            $temp['is_show'] = $v['is_show_path'];
             if ($v['is_show_path']) {
                 $temp['auth'] = ['hidden'];
             }