diff --git a/crmeb/app/adminapi/controller/v1/setting/SystemMenus.php b/crmeb/app/adminapi/controller/v1/setting/SystemMenus.php index 166607f07..de9dc1dad 100644 --- a/crmeb/app/adminapi/controller/v1/setting/SystemMenus.php +++ b/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)); } diff --git a/crmeb/app/model/system/SystemMenus.php b/crmeb/app/model/system/SystemMenus.php index d6b50175d..0a73b5d00 100644 --- a/crmeb/app/model/system/SystemMenus.php +++ b/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); + } } } diff --git a/crmeb/app/services/system/SystemMenusServices.php b/crmeb/app/services/system/SystemMenusServices.php index 13f175ec0..27ca95b78 100644 --- a/crmeb/app/services/system/SystemMenusServices.php +++ b/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; diff --git a/crmeb/crmeb/utils/Arr.php b/crmeb/crmeb/utils/Arr.php index a54bb9247..f70e932af 100644 --- a/crmeb/crmeb/utils/Arr.php +++ b/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']; }