diff --git a/crmeb/app/adminapi/controller/v1/setting/SystemMenus.php b/crmeb/app/adminapi/controller/v1/setting/SystemMenus.php index 1ee024406..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)); } @@ -267,7 +274,7 @@ class SystemMenus extends AuthController } /** - * 显示和隐藏 + * 权限的开启和关闭,显示和隐藏 * @param $id * @return mixed */ @@ -277,9 +284,14 @@ class SystemMenus extends AuthController return app('json')->fail(100100); } - [$show] = $this->request->postMore([['is_show', 0]], true); + [$isShow, $isShowPath] = $this->request->postMore([['is_show', 0], ['is_show_path', 0]], true); + if ($isShow == -1) { + $res = $this->services->update($id, ['is_show_path' => $isShowPath]); + } else { + $res = $this->services->update($id, ['is_show' => $isShow, 'is_show_path' => $isShow]); + } - if ($this->services->update($id, ['is_show' => $show])) { + if ($res) { return app('json')->success(100001); } else { return app('json')->fail(100007); 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']; } diff --git a/template/admin/src/api/systemBackendRouting.js b/template/admin/src/api/systemBackendRouting.js index e747a2c90..f6e805584 100644 --- a/template/admin/src/api/systemBackendRouting.js +++ b/template/admin/src/api/systemBackendRouting.js @@ -31,9 +31,9 @@ export function routeCate(appName) { /** * 路由树 */ -export function routeList() { +export function routeList(apiType) { return request({ - url: `system/route/tree`, + url: `system/route/tree?app_name=${apiType}`, method: 'get', }); } diff --git a/template/admin/src/api/systemMenus.js b/template/admin/src/api/systemMenus.js index 7280f1e96..b84ca66fc 100644 --- a/template/admin/src/api/systemMenus.js +++ b/template/admin/src/api/systemMenus.js @@ -86,13 +86,10 @@ export function menusDetailsApi(id) { * @param {Number} param data.is_show {Number} 状态值 */ export function isShowApi(data) { - let datas = { - is_show: data.is_show, - }; return request({ url: `/setting/menus/show/${data.id}`, method: 'put', - data: datas, + data, }); } diff --git a/template/admin/src/layout/component/transverseAside.vue b/template/admin/src/layout/component/transverseAside.vue index 46807e6b5..5e4cce5db 100644 --- a/template/admin/src/layout/component/transverseAside.vue +++ b/template/admin/src/layout/component/transverseAside.vue @@ -255,10 +255,8 @@ export default { } .columns-round { background: var(--prev-color-primary); - // color: var(--prev-color-text-white); position: absolute; left: 0; - // top: 2px; height: 50px; width: 80px; transform: translatey(0%); diff --git a/template/admin/src/layout/navBars/breadcrumb/setings.vue b/template/admin/src/layout/navBars/breadcrumb/setings.vue index bcd0febb8..7a88e4e88 100644 --- a/template/admin/src/layout/navBars/breadcrumb/setings.vue +++ b/template/admin/src/layout/navBars/breadcrumb/setings.vue @@ -41,7 +41,7 @@
- +
@@ -60,7 +60,7 @@
- +
@@ -140,7 +140,7 @@ - + @@ -197,7 +197,7 @@ -
+ - - - - - - - - - - - - - - - - - - - - {{ item.label }} - - - diff --git a/template/admin/src/pages/setting/systemMenus/index.vue b/template/admin/src/pages/setting/systemMenus/index.vue index ccffbc0d5..ed75b3afc 100644 --- a/template/admin/src/pages/setting/systemMenus/index.vue +++ b/template/admin/src/pages/setting/systemMenus/index.vue @@ -9,25 +9,25 @@ @submit.native.prevent > - + - + - - + - + + - + @@ -183,8 +174,9 @@ export default { xs: 24, }, roleData: { - is_show: '', + is_show: 1, keyword: '', + auth_type: 1, }, defaultProps: { children: 'children', @@ -314,7 +306,8 @@ export default { onchangeIsShow(row) { let data = { id: row.id, - is_show: row.is_show, + is_show_path: row.is_show_path, + is_show: -1, }; isShowApi(data) .then(async (res) => { @@ -436,7 +429,6 @@ export default { // 列表 getData() { this.loading = true; - this.roleData.is_show = this.roleData.is_show || ''; getTable(this.roleData) .then(async (res) => { this.tableData = res.data; diff --git a/template/admin/src/pages/setting/systemOutInterface/request.js b/template/admin/src/pages/setting/systemOutInterface/request.js index 1a19fc8d6..8b0cbc35e 100644 --- a/template/admin/src/pages/setting/systemOutInterface/request.js +++ b/template/admin/src/pages/setting/systemOutInterface/request.js @@ -15,7 +15,7 @@ service.interceptors.request.use( let baseUrl = Setting.apiBaseURL.replace(/adminapi/, 'kefuapi'); config.baseURL = baseUrl; } else { - config.baseURL = 'https://v5.wuht.net/outapi' || Setting.apiBaseURL; + config.baseURL = Setting.apiBaseURL; } if (config.file) { config.headers['Content-Type'] = 'multipart/form-data'; diff --git a/template/admin/src/pages/system/backendRouting/debugging.vue b/template/admin/src/pages/system/backendRouting/debugging.vue index 7c8058b63..7d590f1d1 100644 --- a/template/admin/src/pages/system/backendRouting/debugging.vue +++ b/template/admin/src/pages/system/backendRouting/debugging.vue @@ -279,6 +279,10 @@ export default { return []; }, }, + apiType: { + type: String, + default: 'adminapi', + }, }, data() { return { @@ -321,7 +325,7 @@ export default { }, async requestData() { let url, method, params, body, headers; - url = this.interfaceData.app_name + '/' + this.interfaceData.path; + url = this.apiType + '/' + this.interfaceData.path; method = this.interfaceData.method; params = this.filtersData((await this.$refs.xTable.getTableData().tableData) || []); body = @@ -331,6 +335,7 @@ export default { let h = this.filtersData((await this.$refs.zTable.getTableData().tableData) || []); headers = h; this.codes = ''; + console.log(url); requestMethod(url, method, params, body, headers) .then((res) => { if (!res) return this.$Message.error('接口异常'); @@ -519,7 +524,7 @@ export default { display: flex; justify-content: right; } -/deep/ .monaco-editor{ - min-height: 700px +/deep/ .monaco-editor { + min-height: 700px; } diff --git a/template/admin/src/pages/system/backendRouting/index.vue b/template/admin/src/pages/system/backendRouting/index.vue index 2dd572335..ad6c4bfbb 100644 --- a/template/admin/src/pages/system/backendRouting/index.vue +++ b/template/admin/src/pages/system/backendRouting/index.vue @@ -1,403 +1,409 @@