Pre Merge pull request !149 from 伤感的风铃草/dev_sys_menu
This commit is contained in:
commit
2e89490c94
@ -30,3 +30,6 @@ VITE_APP_CLIENT_ID = 'e5cd7e4891bf95d1d19206ce24a7b32e'
|
|||||||
|
|
||||||
# websocket 开关 默认使用sse推送
|
# websocket 开关 默认使用sse推送
|
||||||
VITE_APP_WEBSOCKET = false
|
VITE_APP_WEBSOCKET = false
|
||||||
|
|
||||||
|
# 系统编码
|
||||||
|
VITE_APP_SYSTEM_CODE = 'master'
|
||||||
|
@ -33,3 +33,6 @@ VITE_APP_CLIENT_ID = 'e5cd7e4891bf95d1d19206ce24a7b32e'
|
|||||||
|
|
||||||
# websocket 开关 默认使用sse推送
|
# websocket 开关 默认使用sse推送
|
||||||
VITE_APP_WEBSOCKET = false
|
VITE_APP_WEBSOCKET = false
|
||||||
|
|
||||||
|
# 系统编码
|
||||||
|
VITE_APP_SYSTEM_CODE = 'master'
|
||||||
|
@ -1,11 +1,13 @@
|
|||||||
import request from '@/utils/request';
|
import request from '@/utils/request';
|
||||||
import { AxiosPromise } from 'axios';
|
import { AxiosPromise } from 'axios';
|
||||||
import { RouteRecordRaw } from 'vue-router';
|
import { RouteRecordRaw } from 'vue-router';
|
||||||
|
import { MenuQuery } from '@/api/system/menu/types';
|
||||||
|
|
||||||
// 获取路由
|
// 获取路由
|
||||||
export function getRouters(): AxiosPromise<RouteRecordRaw[]> {
|
export function getRouters(query?: MenuQuery): AxiosPromise<RouteRecordRaw[]> {
|
||||||
return request({
|
return request({
|
||||||
url: '/system/menu/getRouters',
|
url: '/system/menu/getRoutersMenu',
|
||||||
method: 'get'
|
method: 'get',
|
||||||
|
params: query
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
@ -23,6 +23,7 @@ export interface MenuQuery {
|
|||||||
keywords?: string;
|
keywords?: string;
|
||||||
menuName?: string;
|
menuName?: string;
|
||||||
status?: string;
|
status?: string;
|
||||||
|
systemCode?: string;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -45,6 +46,7 @@ export interface MenuVO extends BaseEntity {
|
|||||||
status: string;
|
status: string;
|
||||||
icon: string;
|
icon: string;
|
||||||
remark: string;
|
remark: string;
|
||||||
|
systemCode: string;
|
||||||
}
|
}
|
||||||
|
|
||||||
export interface MenuForm {
|
export interface MenuForm {
|
||||||
@ -64,6 +66,7 @@ export interface MenuForm {
|
|||||||
status?: string;
|
status?: string;
|
||||||
icon?: string;
|
icon?: string;
|
||||||
remark?: string;
|
remark?: string;
|
||||||
|
systemCode?: string;
|
||||||
query?: string;
|
query?: string;
|
||||||
perms?: string;
|
perms?: string;
|
||||||
}
|
}
|
||||||
|
@ -44,7 +44,7 @@ export const usePermissionStore = defineStore('permission', () => {
|
|||||||
sidebarRouters.value = routes;
|
sidebarRouters.value = routes;
|
||||||
};
|
};
|
||||||
const generateRoutes = async (): Promise<RouteRecordRaw[]> => {
|
const generateRoutes = async (): Promise<RouteRecordRaw[]> => {
|
||||||
const res = await getRouters();
|
const res = await getRouters({ 'systemCode': import.meta.env.VITE_APP_SYSTEM_CODE });
|
||||||
const { data } = res;
|
const { data } = res;
|
||||||
const sdata = JSON.parse(JSON.stringify(data));
|
const sdata = JSON.parse(JSON.stringify(data));
|
||||||
const rdata = JSON.parse(JSON.stringify(data));
|
const rdata = JSON.parse(JSON.stringify(data));
|
||||||
|
2
src/types/element.d.ts
vendored
2
src/types/element.d.ts
vendored
@ -1,6 +1,6 @@
|
|||||||
import type * as ep from 'element-plus';
|
import type * as ep from 'element-plus';
|
||||||
declare global {
|
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 ElFormInstance = ep.FormInstance;
|
||||||
declare type ElTableInstance = ep.TableInstance;
|
declare type ElTableInstance = ep.TableInstance;
|
||||||
declare type ElUploadInstance = ep.UploadInstance;
|
declare type ElUploadInstance = ep.UploadInstance;
|
||||||
|
1
src/types/env.d.ts
vendored
1
src/types/env.d.ts
vendored
@ -19,6 +19,7 @@ interface ImportMetaEnv {
|
|||||||
VITE_APP_RSA_PRIVATE_KEY: string;
|
VITE_APP_RSA_PRIVATE_KEY: string;
|
||||||
VITE_APP_CLIENT_ID: string;
|
VITE_APP_CLIENT_ID: string;
|
||||||
VITE_APP_WEBSOCKET: string;
|
VITE_APP_WEBSOCKET: string;
|
||||||
|
VITE_APP_SYSTEM_CODE: string;
|
||||||
}
|
}
|
||||||
interface ImportMeta {
|
interface ImportMeta {
|
||||||
readonly env: ImportMetaEnv;
|
readonly env: ImportMetaEnv;
|
||||||
|
@ -169,7 +169,7 @@ const initFormData: DictDataForm = {
|
|||||||
dictLabel: '',
|
dictLabel: '',
|
||||||
dictValue: '',
|
dictValue: '',
|
||||||
cssClass: '',
|
cssClass: '',
|
||||||
listClass: 'primary',
|
listClass: 'default',
|
||||||
dictSort: 0,
|
dictSort: 0,
|
||||||
remark: ''
|
remark: ''
|
||||||
};
|
};
|
||||||
|
@ -12,6 +12,11 @@
|
|||||||
<el-option v-for="dict in sys_normal_disable" :key="dict.value" :label="dict.label" :value="dict.value" />
|
<el-option v-for="dict in sys_normal_disable" :key="dict.value" :label="dict.label" :value="dict.value" />
|
||||||
</el-select>
|
</el-select>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
|
<el-form-item label="系统编码" prop="systemCode">
|
||||||
|
<el-select v-model="queryParams.systemCode" placeholder="系统编码" clearable>
|
||||||
|
<el-option v-for="dict in sys_code" :key="dict.value" :label="dict.label" :value="dict.value" />
|
||||||
|
</el-select>
|
||||||
|
</el-form-item>
|
||||||
<el-form-item>
|
<el-form-item>
|
||||||
<el-button type="primary" icon="Search" @click="handleQuery">搜索</el-button>
|
<el-button type="primary" icon="Search" @click="handleQuery">搜索</el-button>
|
||||||
<el-button icon="Refresh" @click="resetQuery">重置</el-button>
|
<el-button icon="Refresh" @click="resetQuery">重置</el-button>
|
||||||
@ -80,7 +85,14 @@
|
|||||||
<el-dialog v-model="dialog.visible" :title="dialog.title" destroy-on-close append-to-bod width="750px">
|
<el-dialog v-model="dialog.visible" :title="dialog.title" destroy-on-close append-to-bod width="750px">
|
||||||
<el-form ref="menuFormRef" :model="form" :rules="rules" label-width="100px">
|
<el-form ref="menuFormRef" :model="form" :rules="rules" label-width="100px">
|
||||||
<el-row>
|
<el-row>
|
||||||
<el-col :span="24">
|
<el-col :span="12">
|
||||||
|
<el-form-item label="系统编码" prop="systemCode">
|
||||||
|
<el-select v-model="form.systemCode" placeholder="系统编码" clearable>
|
||||||
|
<el-option v-for="dict in sys_code" :key="dict.value" :label="dict.label" :value="dict.value" />
|
||||||
|
</el-select>
|
||||||
|
</el-form-item>
|
||||||
|
</el-col>
|
||||||
|
<el-col :span="12">
|
||||||
<el-form-item label="上级菜单">
|
<el-form-item label="上级菜单">
|
||||||
<el-tree-select
|
<el-tree-select
|
||||||
v-model="form.parentId"
|
v-model="form.parentId"
|
||||||
@ -272,7 +284,7 @@ interface MenuOptionsType {
|
|||||||
}
|
}
|
||||||
|
|
||||||
const { proxy } = getCurrentInstance() as ComponentInternalInstance;
|
const { proxy } = getCurrentInstance() as ComponentInternalInstance;
|
||||||
const { sys_show_hide, sys_normal_disable } = toRefs<any>(proxy?.useDict('sys_show_hide', 'sys_normal_disable'));
|
const { sys_show_hide, sys_normal_disable, sys_code } = toRefs<any>(proxy?.useDict('sys_show_hide', 'sys_normal_disable', 'sys_code'));
|
||||||
|
|
||||||
const menuList = ref<MenuVO[]>([]);
|
const menuList = ref<MenuVO[]>([]);
|
||||||
const loading = ref(true);
|
const loading = ref(true);
|
||||||
@ -298,7 +310,8 @@ const initFormData = {
|
|||||||
isFrame: '1',
|
isFrame: '1',
|
||||||
isCache: '0',
|
isCache: '0',
|
||||||
visible: '0',
|
visible: '0',
|
||||||
status: '0'
|
status: '0',
|
||||||
|
systemCode: 'master'
|
||||||
};
|
};
|
||||||
const data = reactive<PageData<MenuForm, MenuQuery>>({
|
const data = reactive<PageData<MenuForm, MenuQuery>>({
|
||||||
form: { ...initFormData },
|
form: { ...initFormData },
|
||||||
|
Loading…
x
Reference in New Issue
Block a user