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 @@
- + @@ -58,7 +59,6 @@ :false-value="0" @on-change="onchangeIsShow(row)" size="large" - v-if="row.auth_type == 1" > 显示 隐藏 @@ -177,7 +177,7 @@ export default { roleData: { is_show: 1, keyword: '', - auth_type: 3, + // auth_type: 3, }, defaultProps: { children: 'children', diff --git a/template/admin/src/pages/system/systemMenus/components/menusFrom.vue b/template/admin/src/pages/system/systemMenus/components/menusFrom.vue index 6376573fd..5a2a2b88c 100644 --- a/template/admin/src/pages/system/systemMenus/components/menusFrom.vue +++ b/template/admin/src/pages/system/systemMenus/components/menusFrom.vue @@ -2,21 +2,33 @@
- + + + + + {{ item.label }} + + + + + +
- +
@@ -26,21 +38,30 @@
- - - + + + + + + + + + + - + - - - + + - - - - - {{ item.label }} - - + + @@ -157,11 +172,11 @@ export default { searchRule: '', iconVal: '', grid: { - xl: 12, - lg: 12, - md: 12, - sm: 24, - xs: 24, + xl: 22, + lg: 22, + md: 22, + sm: 22, + xs: 22, }, modals: false, modal12: false, @@ -172,12 +187,19 @@ export default { search: icon, ruleModal: false, ruleList: [], + authType: 1 }; }, watch: { 'formValidate.header': function (n) { this.formValidate.is_header = n ? 1 : 0; }, + 'formValidate.auth_type': function (n) { + if (n === undefined) { + n = 1; + } + this.authType = n; + }, 'formValidate.data': function (n) {}, }, computed: { @@ -275,6 +297,9 @@ export default { if (value.slice(0, 1) === '/') value = value.replace('/', ''); this.formValidate.unique_auth = value.replaceAll('/', '-'); }, + changeAuthType(val) { + this.authType = val; + }, selectRule(data) { this.$emit('selectRule', data); this.$nextTick((e) => { diff --git a/template/admin/src/pages/system/systemMenus/index.vue b/template/admin/src/pages/system/systemMenus/index.vue index 9883234ea..305fb8fb1 100644 --- a/template/admin/src/pages/system/systemMenus/index.vue +++ b/template/admin/src/pages/system/systemMenus/index.vue @@ -69,9 +69,9 @@