diff --git a/.env.development b/.env.development index 05d67782d62fb6104cbf15025f633a036a5de8be..fbd7edcf2ec68e1db50b155d06f81e9c9c0efafc 100644 --- a/.env.development +++ b/.env.development @@ -30,3 +30,6 @@ VITE_APP_CLIENT_ID = 'e5cd7e4891bf95d1d19206ce24a7b32e' # websocket 开关 默认使用sse推送 VITE_APP_WEBSOCKET = false + +# 系统编码 +VITE_APP_SYSTEM_CODE = 'master' diff --git a/.env.production b/.env.production index c6b1f8539f2ba232ace93657d1be69d6df674871..725cb3c4437e4fae8131f023c46e540f3dff5d22 100644 --- a/.env.production +++ b/.env.production @@ -33,3 +33,6 @@ VITE_APP_CLIENT_ID = 'e5cd7e4891bf95d1d19206ce24a7b32e' # websocket 开关 默认使用sse推送 VITE_APP_WEBSOCKET = false + +# 系统编码 +VITE_APP_SYSTEM_CODE = 'master' diff --git a/src/api/menu.ts b/src/api/menu.ts index a3ae80e1120fbd5032d16686105602d9c124b5f1..bb436f8219ec59502356aa0f6a467b1e189000af 100644 --- a/src/api/menu.ts +++ b/src/api/menu.ts @@ -1,11 +1,13 @@ import request from '@/utils/request'; import { AxiosPromise } from 'axios'; import { RouteRecordRaw } from 'vue-router'; +import { MenuQuery } from '@/api/system/menu/types'; // 获取路由 -export function getRouters(): AxiosPromise { +export function getRouters(query?: MenuQuery): AxiosPromise { return request({ - url: '/system/menu/getRouters', - method: 'get' + url: '/system/menu/getRoutersMenu', + method: 'get', + params: query }); } diff --git a/src/api/system/menu/types.ts b/src/api/system/menu/types.ts index ca19840debd2cab57e3f509b1a1207459d7644d7..fd8800f47a7b3d798f0db948682ad6663b9a55a2 100644 --- a/src/api/system/menu/types.ts +++ b/src/api/system/menu/types.ts @@ -23,6 +23,7 @@ export interface MenuQuery { keywords?: string; menuName?: string; status?: string; + systemCode?: string; } /** @@ -45,6 +46,7 @@ export interface MenuVO extends BaseEntity { status: string; icon: string; remark: string; + systemCode: string; } export interface MenuForm { @@ -64,6 +66,7 @@ export interface MenuForm { status?: string; icon?: string; remark?: string; + systemCode?: string; query?: string; perms?: string; } diff --git a/src/store/modules/permission.ts b/src/store/modules/permission.ts index e90df4c344ebfdfdc4724247a05d12ab7f3f991b..e618e1f3e5a7ecd5f8a617a308e2285ffece1007 100644 --- a/src/store/modules/permission.ts +++ b/src/store/modules/permission.ts @@ -44,7 +44,7 @@ export const usePermissionStore = defineStore('permission', () => { sidebarRouters.value = routes; }; const generateRoutes = async (): Promise => { - const res = await getRouters(); + const res = await getRouters({ 'systemCode': import.meta.env.VITE_APP_SYSTEM_CODE }); const { data } = res; const sdata = JSON.parse(JSON.stringify(data)); const rdata = JSON.parse(JSON.stringify(data)); diff --git a/src/types/element.d.ts b/src/types/element.d.ts index ae6ecfcde7e7a8d60dc01a3bdd854fe014026745..f9bf64afd87efa023e221a56521437a498869678 100644 --- a/src/types/element.d.ts +++ b/src/types/element.d.ts @@ -1,6 +1,6 @@ import type * as ep from 'element-plus'; declare global { - declare type ElTagType = 'primary' | 'success' | 'info' | 'warning' | 'danger'; + declare type ElTagType = 'default' | 'primary' | 'success' | 'info' | 'warning' | 'danger'; declare type ElFormInstance = ep.FormInstance; declare type ElTableInstance = ep.TableInstance; declare type ElUploadInstance = ep.UploadInstance; diff --git a/src/types/env.d.ts b/src/types/env.d.ts index 777c85849156247e6025f39e9e8698024f6d470d..444b20cba1fd5789996a71ad2de5e60e2bbca915 100644 --- a/src/types/env.d.ts +++ b/src/types/env.d.ts @@ -19,6 +19,7 @@ interface ImportMetaEnv { VITE_APP_RSA_PRIVATE_KEY: string; VITE_APP_CLIENT_ID: string; VITE_APP_WEBSOCKET: string; + VITE_APP_SYSTEM_CODE: string; } interface ImportMeta { readonly env: ImportMetaEnv; diff --git a/src/views/system/dict/data.vue b/src/views/system/dict/data.vue index 33c7fc8cb9878d6b5e540f5e4cd15ed9069bd649..1fcc10e61c2e9dfa474340936c89f869ba4a214d 100644 --- a/src/views/system/dict/data.vue +++ b/src/views/system/dict/data.vue @@ -169,7 +169,7 @@ const initFormData: DictDataForm = { dictLabel: '', dictValue: '', cssClass: '', - listClass: 'primary', + listClass: 'default', dictSort: 0, remark: '' }; diff --git a/src/views/system/menu/index.vue b/src/views/system/menu/index.vue index cf5f0fcafb3d01179d7a011abefb81413acf755c..602eb1f29cbfd68dfabe7dbc8265293e824be877 100644 --- a/src/views/system/menu/index.vue +++ b/src/views/system/menu/index.vue @@ -12,6 +12,11 @@ + + + + + 搜索 重置 @@ -80,7 +85,14 @@ - + + + + + + + + (proxy?.useDict('sys_show_hide', 'sys_normal_disable')); +const { sys_show_hide, sys_normal_disable, sys_code } = toRefs(proxy?.useDict('sys_show_hide', 'sys_normal_disable', 'sys_code')); const menuList = ref([]); const loading = ref(true); @@ -298,7 +310,8 @@ const initFormData = { isFrame: '1', isCache: '0', visible: '0', - status: '0' + status: '0', + systemCode: 'master' }; const data = reactive>({ form: { ...initFormData },