style: some format adjustments
This commit is contained in:
parent
bdce84537a
commit
e2333642c4
|
|
@ -23,12 +23,14 @@
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
setup(props) {
|
setup(props) {
|
||||||
|
const showRef = ref<boolean>(!!props.showTitle);
|
||||||
const { globSetting } = useSetting();
|
const { globSetting } = useSetting();
|
||||||
const go = useGo();
|
const go = useGo();
|
||||||
|
|
||||||
function handleGoHome() {
|
function handleGoHome() {
|
||||||
go(PageEnum.BASE_HOME);
|
go(PageEnum.BASE_HOME);
|
||||||
}
|
}
|
||||||
const showRef = ref<boolean>(!!props.showTitle);
|
|
||||||
watch(
|
watch(
|
||||||
() => props.showTitle,
|
() => props.showTitle,
|
||||||
(show: boolean) => {
|
(show: boolean) => {
|
||||||
|
|
@ -41,6 +43,7 @@
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
);
|
);
|
||||||
|
|
||||||
return {
|
return {
|
||||||
handleGoHome,
|
handleGoHome,
|
||||||
globSetting,
|
globSetting,
|
||||||
|
|
@ -55,7 +58,6 @@
|
||||||
|
|
||||||
.app-logo {
|
.app-logo {
|
||||||
display: flex;
|
display: flex;
|
||||||
// justify-content: center;
|
|
||||||
align-items: center;
|
align-items: center;
|
||||||
cursor: pointer;
|
cursor: pointer;
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -1,11 +1,12 @@
|
||||||
|
import type { AppRouteRecordRaw } from '/@/router/types';
|
||||||
|
|
||||||
import { computed, toRaw, unref } from 'vue';
|
import { computed, toRaw, unref } from 'vue';
|
||||||
|
import { useRouter } from 'vue-router';
|
||||||
|
import router from '/@/router';
|
||||||
|
|
||||||
import { tabStore } from '/@/store/modules/tab';
|
import { tabStore } from '/@/store/modules/tab';
|
||||||
import { appStore } from '/@/store/modules/app';
|
import { appStore } from '/@/store/modules/app';
|
||||||
|
|
||||||
import { AppRouteRecordRaw } from '/@/router/types';
|
|
||||||
import { useRouter } from 'vue-router';
|
|
||||||
import router from '/@/router';
|
|
||||||
import { unique } from '/@/utils';
|
import { unique } from '/@/utils';
|
||||||
|
|
||||||
export function useFrameKeepAlive() {
|
export function useFrameKeepAlive() {
|
||||||
|
|
|
||||||
|
|
@ -1,19 +1,17 @@
|
||||||
import { computed, defineComponent, unref, Transition, KeepAlive, toRaw } from 'vue';
|
import { computed, defineComponent, unref, Transition, KeepAlive, toRaw } from 'vue';
|
||||||
|
|
||||||
import { appStore } from '/@/store/modules/app';
|
|
||||||
|
|
||||||
import { useTransition } from './useTransition';
|
|
||||||
|
|
||||||
import { RouterView, RouteLocation } from 'vue-router';
|
import { RouterView, RouteLocation } from 'vue-router';
|
||||||
import { tabStore } from '/@/store/modules/tab';
|
|
||||||
import FrameLayout from '/@/layouts/iframe/index.vue';
|
import FrameLayout from '/@/layouts/iframe/index.vue';
|
||||||
|
|
||||||
|
import { useTransition } from './useTransition';
|
||||||
import { useSetting } from '/@/hooks/core/useSetting';
|
import { useSetting } from '/@/hooks/core/useSetting';
|
||||||
// import { useRouter } from 'vue-router';
|
|
||||||
|
import { tabStore } from '/@/store/modules/tab';
|
||||||
|
import { appStore } from '/@/store/modules/app';
|
||||||
|
|
||||||
export default defineComponent({
|
export default defineComponent({
|
||||||
name: 'PageLayout',
|
name: 'PageLayout',
|
||||||
setup() {
|
setup() {
|
||||||
// const { currentRoute } = useRouter();
|
|
||||||
const getProjectConfigRef = computed(() => {
|
const getProjectConfigRef = computed(() => {
|
||||||
return appStore.getProjectConfig;
|
return appStore.getProjectConfig;
|
||||||
});
|
});
|
||||||
|
|
|
||||||
|
|
@ -22,6 +22,7 @@ export const PAGE_NOT_FOUND_ROUTE: AppRouteRecordRaw = {
|
||||||
hideBreadcrumb: true,
|
hideBreadcrumb: true,
|
||||||
},
|
},
|
||||||
};
|
};
|
||||||
|
|
||||||
export const REDIRECT_ROUTE: AppRouteRecordRaw = {
|
export const REDIRECT_ROUTE: AppRouteRecordRaw = {
|
||||||
path: '/redirect/:path(.*)*',
|
path: '/redirect/:path(.*)*',
|
||||||
name: 'Redirect',
|
name: 'Redirect',
|
||||||
|
|
@ -31,16 +32,3 @@ export const REDIRECT_ROUTE: AppRouteRecordRaw = {
|
||||||
hideBreadcrumb: true,
|
hideBreadcrumb: true,
|
||||||
},
|
},
|
||||||
};
|
};
|
||||||
|
|
||||||
// Whole site 404
|
|
||||||
// export const FULL_PAGE_NOT_FOUND_ROUTE: AppRouteRecordRaw = {
|
|
||||||
// path: '/:path(.*)*',
|
|
||||||
// name: 'FullErrorPage',
|
|
||||||
// component: EXCEPTION_COMPONENT,
|
|
||||||
// props: {
|
|
||||||
// full: true,
|
|
||||||
// },
|
|
||||||
// meta: {
|
|
||||||
// title: 'FullErrorPage',
|
|
||||||
// },
|
|
||||||
// };
|
|
||||||
|
|
|
||||||
|
|
@ -1,13 +1,16 @@
|
||||||
import type { Router } from 'vue-router';
|
import type { Router } from 'vue-router';
|
||||||
|
|
||||||
import { Modal, notification } from 'ant-design-vue';
|
import { Modal, notification } from 'ant-design-vue';
|
||||||
import { AxiosCanceler } from '/@/utils/http/axios/axiosCancel';
|
|
||||||
import { createProgressGuard } from './progressGuard';
|
import { createProgressGuard } from './progressGuard';
|
||||||
import { createPermissionGuard } from './permissionGuard';
|
import { createPermissionGuard } from './permissionGuard';
|
||||||
import { createPageLoadingGuard } from './pageLoadingGuard';
|
import { createPageLoadingGuard } from './pageLoadingGuard';
|
||||||
|
|
||||||
import { useSetting } from '/@/hooks/core/useSetting';
|
import { useSetting } from '/@/hooks/core/useSetting';
|
||||||
|
|
||||||
import { getIsOpenTab, setCurrentTo } from '/@/utils/helper/routeHelper';
|
import { getIsOpenTab, setCurrentTo } from '/@/utils/helper/routeHelper';
|
||||||
import { setTitle } from '/@/utils/browser';
|
import { setTitle } from '/@/utils/browser';
|
||||||
|
import { AxiosCanceler } from '/@/utils/http/axios/axiosCancel';
|
||||||
|
|
||||||
const { projectSetting, globSetting } = useSetting();
|
const { projectSetting, globSetting } = useSetting();
|
||||||
export function createGuard(router: Router) {
|
export function createGuard(router: Router) {
|
||||||
|
|
@ -36,10 +39,7 @@ export function createGuard(router: Router) {
|
||||||
|
|
||||||
router.afterEach((to) => {
|
router.afterEach((to) => {
|
||||||
// change html title
|
// change html title
|
||||||
|
setTitle(to.meta.title, globSetting.title);
|
||||||
setTimeout(() => {
|
|
||||||
setTitle(to.meta.title, globSetting.title);
|
|
||||||
}, 0);
|
|
||||||
});
|
});
|
||||||
|
|
||||||
openNProgress && createProgressGuard(router);
|
openNProgress && createProgressGuard(router);
|
||||||
|
|
|
||||||
|
|
@ -2,12 +2,11 @@ import type { Router, RouteRecordRaw } from 'vue-router';
|
||||||
|
|
||||||
import { userStore } from '/@/store/modules/user';
|
import { userStore } from '/@/store/modules/user';
|
||||||
import { permissionStore } from '/@/store/modules/permission';
|
import { permissionStore } from '/@/store/modules/permission';
|
||||||
|
|
||||||
import { PageEnum } from '/@/enums/pageEnum';
|
import { PageEnum } from '/@/enums/pageEnum';
|
||||||
import { getToken } from '/@/utils/auth';
|
import { getToken } from '/@/utils/auth';
|
||||||
import {
|
|
||||||
// FULL_PAGE_NOT_FOUND_ROUTE,
|
import { PAGE_NOT_FOUND_ROUTE } from '/@/router/constant';
|
||||||
PAGE_NOT_FOUND_ROUTE,
|
|
||||||
} from '/@/router/constant';
|
|
||||||
import { RootRoute } from '../routes/index';
|
import { RootRoute } from '../routes/index';
|
||||||
|
|
||||||
const LOGIN_PATH = PageEnum.BASE_LOGIN;
|
const LOGIN_PATH = PageEnum.BASE_LOGIN;
|
||||||
|
|
@ -60,6 +59,7 @@ export function createPermissionGuard(router: Router) {
|
||||||
permissionStore.commitDynamicAddedRouteState(true);
|
permissionStore.commitDynamicAddedRouteState(true);
|
||||||
next(nextData);
|
next(nextData);
|
||||||
});
|
});
|
||||||
|
|
||||||
router.afterEach((to) => {
|
router.afterEach((to) => {
|
||||||
// Just enter the login page and clear the authentication information
|
// Just enter the login page and clear the authentication information
|
||||||
if (to.path === LOGIN_PATH) {
|
if (to.path === LOGIN_PATH) {
|
||||||
|
|
|
||||||
|
|
@ -11,6 +11,7 @@ export function createProgressGuard(router: Router) {
|
||||||
!to.meta.inTab && NProgress.start();
|
!to.meta.inTab && NProgress.start();
|
||||||
return true;
|
return true;
|
||||||
});
|
});
|
||||||
|
|
||||||
router.afterEach(async (to) => {
|
router.afterEach(async (to) => {
|
||||||
!to.meta.inTab && NProgress.done();
|
!to.meta.inTab && NProgress.done();
|
||||||
return true;
|
return true;
|
||||||
|
|
|
||||||
|
|
@ -2,6 +2,7 @@ import type { RouteRecordRaw } from 'vue-router';
|
||||||
import type { App } from 'vue';
|
import type { App } from 'vue';
|
||||||
|
|
||||||
import { createRouter, createWebHashHistory } from 'vue-router';
|
import { createRouter, createWebHashHistory } from 'vue-router';
|
||||||
|
|
||||||
import { scrollWaiter } from '../utils/scrollWaiter';
|
import { scrollWaiter } from '../utils/scrollWaiter';
|
||||||
|
|
||||||
import { createGuard } from './guard/';
|
import { createGuard } from './guard/';
|
||||||
|
|
@ -24,6 +25,7 @@ const router = createRouter({
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
});
|
});
|
||||||
|
|
||||||
// reset router
|
// reset router
|
||||||
export function resetRouter() {
|
export function resetRouter() {
|
||||||
const resetWhiteNameList = [
|
const resetWhiteNameList = [
|
||||||
|
|
@ -45,21 +47,4 @@ export function setupRouter(app: App<Element>) {
|
||||||
createGuard(router);
|
createGuard(router);
|
||||||
}
|
}
|
||||||
|
|
||||||
// // hmr
|
|
||||||
// if (import.meta.hot) {
|
|
||||||
// let removeRoutes: (() => void)[] = [];
|
|
||||||
|
|
||||||
// for (let route of routes) {
|
|
||||||
// removeRoutes.push(router.addRoute(route as RouteRecordRaw));
|
|
||||||
// }
|
|
||||||
|
|
||||||
// import.meta.hot?.acceptDeps('./routes.ts', ({ routes }) => {
|
|
||||||
// for (let removeRoute of removeRoutes) removeRoute();
|
|
||||||
// removeRoutes = [];
|
|
||||||
// for (let route of routes) {
|
|
||||||
// removeRoutes.push(router.addRoute(route));
|
|
||||||
// }
|
|
||||||
// router.replace('');
|
|
||||||
// });
|
|
||||||
// }
|
|
||||||
export default router;
|
export default router;
|
||||||
|
|
|
||||||
|
|
@ -9,33 +9,7 @@ import { PermissionModeEnum } from '/@/enums/appEnum';
|
||||||
import { pathToRegexp } from 'path-to-regexp';
|
import { pathToRegexp } from 'path-to-regexp';
|
||||||
import modules from 'globby!/@/router/menus/modules/**/*.@(ts)';
|
import modules from 'globby!/@/router/menus/modules/**/*.@(ts)';
|
||||||
|
|
||||||
// ===========================
|
const menuModules: MenuModule[] = [];
|
||||||
// ==========module import====
|
|
||||||
// ===========================
|
|
||||||
// import dashboard from './modules/dashboard';
|
|
||||||
|
|
||||||
// import exceptionDemo from './modules/demo/exception';
|
|
||||||
// import iframeDemo from './modules/demo/iframe';
|
|
||||||
// import compDemo from './modules/demo/comp';
|
|
||||||
// import permissionDemo from './modules/demo/permission';
|
|
||||||
// import featDemo from './modules/demo/feat';
|
|
||||||
// import chartsDemo from './modules/demo/charts';
|
|
||||||
// import tableDemo from './modules/demo/table';
|
|
||||||
// import formDemo from './modules/demo/form';
|
|
||||||
// import treeDemo from './modules/demo/tree';
|
|
||||||
|
|
||||||
const menuModules: MenuModule[] = [
|
|
||||||
// dashboard,
|
|
||||||
// featDemo,
|
|
||||||
// exceptionDemo,
|
|
||||||
// iframeDemo,
|
|
||||||
// compDemo,
|
|
||||||
// permissionDemo,
|
|
||||||
// chartsDemo,
|
|
||||||
// tableDemo,
|
|
||||||
// formDemo,
|
|
||||||
// treeDemo,
|
|
||||||
];
|
|
||||||
|
|
||||||
Object.keys(modules).forEach((key) => {
|
Object.keys(modules).forEach((key) => {
|
||||||
menuModules.push(modules[key]);
|
menuModules.push(modules[key]);
|
||||||
|
|
|
||||||
|
|
@ -4,30 +4,7 @@ import { DEFAULT_LAYOUT_COMPONENT, PAGE_NOT_FOUND_ROUTE, REDIRECT_ROUTE } from '
|
||||||
import { genRouteModule } from '/@/utils/helper/routeHelper';
|
import { genRouteModule } from '/@/utils/helper/routeHelper';
|
||||||
import modules from 'globby!/@/router/routes/modules/**/*.@(ts)';
|
import modules from 'globby!/@/router/routes/modules/**/*.@(ts)';
|
||||||
|
|
||||||
// import dashboard from './modules/dashboard';
|
const routeModuleList: AppRouteModule[] = [];
|
||||||
// demo
|
|
||||||
// import exceptionDemo from './modules/demo/exception';
|
|
||||||
// import iframeDemo from './modules/demo/iframe';
|
|
||||||
// import compDemo from './modules/demo/comp';
|
|
||||||
// import permissionDemo from './modules/demo/permission';
|
|
||||||
// import featDemo from './modules/demo/feat';
|
|
||||||
// import chartsDemo from './modules/demo/charts';
|
|
||||||
// import tableDemo from './modules/demo/table';
|
|
||||||
// import formDemo from './modules/demo/form';
|
|
||||||
// import treeDemo from './modules/demo/tree';
|
|
||||||
|
|
||||||
const routeModuleList: AppRouteModule[] = [
|
|
||||||
// exceptionDemo,
|
|
||||||
// dashboard,
|
|
||||||
// iframeDemo,
|
|
||||||
// compDemo,
|
|
||||||
// featDemo,
|
|
||||||
// permissionDemo,
|
|
||||||
// chartsDemo,
|
|
||||||
// tableDemo,
|
|
||||||
// formDemo,
|
|
||||||
// treeDemo,
|
|
||||||
];
|
|
||||||
|
|
||||||
Object.keys(modules).forEach((key) => {
|
Object.keys(modules).forEach((key) => {
|
||||||
routeModuleList.push(modules[key]);
|
routeModuleList.push(modules[key]);
|
||||||
|
|
@ -38,6 +15,7 @@ export const asyncRoutes = [
|
||||||
PAGE_NOT_FOUND_ROUTE,
|
PAGE_NOT_FOUND_ROUTE,
|
||||||
...genRouteModule(routeModuleList),
|
...genRouteModule(routeModuleList),
|
||||||
];
|
];
|
||||||
|
|
||||||
// 主框架根路由
|
// 主框架根路由
|
||||||
export const RootRoute: AppRouteRecordRaw = {
|
export const RootRoute: AppRouteRecordRaw = {
|
||||||
path: '/',
|
path: '/',
|
||||||
|
|
|
||||||
|
|
@ -66,25 +66,23 @@ export function scriptErrorHandler(
|
||||||
if (event === 'Script error.' && !source) {
|
if (event === 'Script error.' && !source) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
setTimeout(function () {
|
const errorInfo: Partial<ErrorInfo> = {};
|
||||||
const errorInfo: Partial<ErrorInfo> = {};
|
colno = colno || (window.event && (window.event as any).errorCharacter) || 0;
|
||||||
colno = colno || (window.event && (window.event as any).errorCharacter) || 0;
|
errorInfo.message = event as string;
|
||||||
errorInfo.message = event as string;
|
if (error && error.stack) {
|
||||||
if (error && error.stack) {
|
errorInfo.stack = error.stack;
|
||||||
errorInfo.stack = error.stack;
|
} else {
|
||||||
} else {
|
errorInfo.stack = '';
|
||||||
errorInfo.stack = '';
|
}
|
||||||
}
|
const name = source ? source.substr(source.lastIndexOf('/') + 1) : 'script';
|
||||||
const name = source ? source.substr(source.lastIndexOf('/') + 1) : 'script';
|
errorStore.commitErrorInfoState({
|
||||||
errorStore.commitErrorInfoState({
|
type: ErrorTypeEnum.SCRIPT,
|
||||||
type: ErrorTypeEnum.SCRIPT,
|
name: name,
|
||||||
name: name,
|
file: source as string,
|
||||||
file: source as string,
|
detail: 'lineno' + lineno,
|
||||||
detail: 'lineno' + lineno,
|
url: window.location.href,
|
||||||
url: window.location.href,
|
...(errorInfo as Pick<ErrorInfo, 'message' | 'stack'>),
|
||||||
...(errorInfo as Pick<ErrorInfo, 'message' | 'stack'>),
|
});
|
||||||
});
|
|
||||||
}, 0);
|
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -15,7 +15,9 @@ const store = createStore({
|
||||||
strict: isDev,
|
strict: isDev,
|
||||||
// plugins,
|
// plugins,
|
||||||
});
|
});
|
||||||
|
|
||||||
export function setupStore(app: App<Element>) {
|
export function setupStore(app: App<Element>) {
|
||||||
app.use(store);
|
app.use(store);
|
||||||
}
|
}
|
||||||
|
|
||||||
export default store;
|
export default store;
|
||||||
|
|
|
||||||
|
|
@ -1,13 +1,14 @@
|
||||||
import store from '/@/store';
|
import type { ProjectConfig } from '/@/types/config';
|
||||||
import { hotModuleUnregisterModule } from '/@/utils/helper/vuexHelper';
|
|
||||||
import { VuexModule, getModule, Module, Mutation, Action } from 'vuex-module-decorators';
|
import { VuexModule, getModule, Module, Mutation, Action } from 'vuex-module-decorators';
|
||||||
|
import store from '/@/store';
|
||||||
|
|
||||||
import { PROJ_CFG_KEY, LOCK_INFO_KEY } from '/@/enums/cacheEnum';
|
import { PROJ_CFG_KEY, LOCK_INFO_KEY } from '/@/enums/cacheEnum';
|
||||||
import { ProjectConfig } from '/@/types/config';
|
|
||||||
|
|
||||||
// import { userStore } from './user';
|
import { hotModuleUnregisterModule } from '/@/utils/helper/vuexHelper';
|
||||||
import { setLocal, getLocal, removeLocal } from '/@/utils/helper/persistent';
|
import { setLocal, getLocal, removeLocal } from '/@/utils/helper/persistent';
|
||||||
import { deepMerge } from '/@/utils';
|
import { deepMerge } from '/@/utils';
|
||||||
|
|
||||||
import { userStore } from './user';
|
import { userStore } from './user';
|
||||||
|
|
||||||
export interface LockInfo {
|
export interface LockInfo {
|
||||||
|
|
@ -20,12 +21,16 @@ const NAME = 'app';
|
||||||
hotModuleUnregisterModule(NAME);
|
hotModuleUnregisterModule(NAME);
|
||||||
@Module({ dynamic: true, namespaced: true, store, name: NAME })
|
@Module({ dynamic: true, namespaced: true, store, name: NAME })
|
||||||
class App extends VuexModule {
|
class App extends VuexModule {
|
||||||
|
// Page loading status
|
||||||
private pageLoadingState = false;
|
private pageLoadingState = false;
|
||||||
|
|
||||||
|
// project config
|
||||||
private projectConfigState: ProjectConfig | null = getLocal(PROJ_CFG_KEY);
|
private projectConfigState: ProjectConfig | null = getLocal(PROJ_CFG_KEY);
|
||||||
|
|
||||||
|
// lock info
|
||||||
private lockInfoState: LockInfo | null = getLocal(LOCK_INFO_KEY);
|
private lockInfoState: LockInfo | null = getLocal(LOCK_INFO_KEY);
|
||||||
|
|
||||||
|
// set main overflow hidden
|
||||||
private lockMainScrollState = false;
|
private lockMainScrollState = false;
|
||||||
|
|
||||||
get getPageLoading() {
|
get getPageLoading() {
|
||||||
|
|
@ -87,7 +92,7 @@ class App extends VuexModule {
|
||||||
}
|
}
|
||||||
|
|
||||||
// /**
|
// /**
|
||||||
// * @description: 解锁
|
// * @description: unlock page
|
||||||
// */
|
// */
|
||||||
@Action
|
@Action
|
||||||
public async unLockAction({ password, valid = true }: { password: string; valid?: boolean }) {
|
public async unLockAction({ password, valid = true }: { password: string; valid?: boolean }) {
|
||||||
|
|
|
||||||
|
|
@ -25,7 +25,10 @@ const NAME = 'error';
|
||||||
hotModuleUnregisterModule(NAME);
|
hotModuleUnregisterModule(NAME);
|
||||||
@Module({ dynamic: true, namespaced: true, store, name: NAME })
|
@Module({ dynamic: true, namespaced: true, store, name: NAME })
|
||||||
class Error extends VuexModule implements ErrorState {
|
class Error extends VuexModule implements ErrorState {
|
||||||
|
// error log list
|
||||||
errorInfoState: ErrorInfo[] = [];
|
errorInfoState: ErrorInfo[] = [];
|
||||||
|
|
||||||
|
// error log count
|
||||||
errorListCountState = 0;
|
errorListCountState = 0;
|
||||||
|
|
||||||
get getErrorInfoState() {
|
get getErrorInfoState() {
|
||||||
|
|
|
||||||
|
|
@ -26,16 +26,16 @@ const NAME = 'permission';
|
||||||
hotModuleUnregisterModule(NAME);
|
hotModuleUnregisterModule(NAME);
|
||||||
@Module({ dynamic: true, namespaced: true, store, name: NAME })
|
@Module({ dynamic: true, namespaced: true, store, name: NAME })
|
||||||
class Permission extends VuexModule {
|
class Permission extends VuexModule {
|
||||||
// private routesState: AppRouteRecordRaw[] = [];
|
// Permission code list
|
||||||
|
|
||||||
// 权限编码列表
|
|
||||||
private permCodeListState: string[] = [];
|
private permCodeListState: string[] = [];
|
||||||
|
|
||||||
// Whether the route has been dynamically added
|
// Whether the route has been dynamically added
|
||||||
private isDynamicAddedRouteState = false;
|
private isDynamicAddedRouteState = false;
|
||||||
|
|
||||||
|
// To trigger a menu update
|
||||||
private lastBuildMenuTimeState = 0;
|
private lastBuildMenuTimeState = 0;
|
||||||
|
|
||||||
|
// Backstage menu list
|
||||||
private backMenuListState: Menu[] = [];
|
private backMenuListState: Menu[] = [];
|
||||||
|
|
||||||
get getPermCodeListState() {
|
get getPermCodeListState() {
|
||||||
|
|
@ -50,10 +50,6 @@ class Permission extends VuexModule {
|
||||||
return this.lastBuildMenuTimeState;
|
return this.lastBuildMenuTimeState;
|
||||||
}
|
}
|
||||||
|
|
||||||
// get getRoutesState() {
|
|
||||||
// return this.routesState;
|
|
||||||
// }
|
|
||||||
|
|
||||||
get getIsDynamicAddedRouteState() {
|
get getIsDynamicAddedRouteState() {
|
||||||
return this.isDynamicAddedRouteState;
|
return this.isDynamicAddedRouteState;
|
||||||
}
|
}
|
||||||
|
|
@ -73,11 +69,6 @@ class Permission extends VuexModule {
|
||||||
this.lastBuildMenuTimeState = new Date().getTime();
|
this.lastBuildMenuTimeState = new Date().getTime();
|
||||||
}
|
}
|
||||||
|
|
||||||
// @Mutation
|
|
||||||
// commitRoutesState(routes: AppRouteRecordRaw[]): void {
|
|
||||||
// this.routesState = routes;
|
|
||||||
// }
|
|
||||||
|
|
||||||
@Mutation
|
@Mutation
|
||||||
commitDynamicAddedRouteState(added: boolean): void {
|
commitDynamicAddedRouteState(added: boolean): void {
|
||||||
this.isDynamicAddedRouteState = added;
|
this.isDynamicAddedRouteState = added;
|
||||||
|
|
|
||||||
|
|
@ -34,18 +34,15 @@ const getOpenKeepAliveRef = computed(() => appStore.getProjectConfig.openKeepAli
|
||||||
|
|
||||||
@Module({ namespaced: true, name: NAME, dynamic: true, store })
|
@Module({ namespaced: true, name: NAME, dynamic: true, store })
|
||||||
class Tab extends VuexModule {
|
class Tab extends VuexModule {
|
||||||
// tab列表
|
// tab list
|
||||||
tabsState: TabItem[] = [];
|
tabsState: TabItem[] = [];
|
||||||
// 缓存列表
|
// tab cache list
|
||||||
keepAliveTabsState: CacheName[] = [];
|
keepAliveTabsState: CacheName[] = [];
|
||||||
|
|
||||||
currentContextMenuIndexState = -1;
|
currentContextMenuIndexState = -1;
|
||||||
|
|
||||||
currentContextMenuState: TabItem | null = null;
|
currentContextMenuState: TabItem | null = null;
|
||||||
|
|
||||||
/**
|
|
||||||
* @description: 获取tabs
|
|
||||||
*/
|
|
||||||
get getTabsState() {
|
get getTabsState() {
|
||||||
return this.tabsState;
|
return this.tabsState;
|
||||||
}
|
}
|
||||||
|
|
@ -58,9 +55,6 @@ class Tab extends VuexModule {
|
||||||
return this.currentContextMenuState;
|
return this.currentContextMenuState;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
* @description: 获取缓存的tab列表
|
|
||||||
*/
|
|
||||||
get getKeepAliveTabsState() {
|
get getKeepAliveTabsState() {
|
||||||
return this.keepAliveTabsState;
|
return this.keepAliveTabsState;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -58,7 +58,6 @@ class User extends VuexModule {
|
||||||
this.userInfoState = null;
|
this.userInfoState = null;
|
||||||
this.tokenState = '';
|
this.tokenState = '';
|
||||||
this.roleListState = [];
|
this.roleListState = [];
|
||||||
// permissionStore.commitReset();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@Mutation
|
@Mutation
|
||||||
|
|
@ -136,7 +135,6 @@ class User extends VuexModule {
|
||||||
resetRouter();
|
resetRouter();
|
||||||
clearSession();
|
clearSession();
|
||||||
clearLocal();
|
clearLocal();
|
||||||
// router.addRoute(FULL_PAGE_NOT_FOUND_ROUTE as RouteRecordRaw);
|
|
||||||
permissionStore.commitResetState();
|
permissionStore.commitResetState();
|
||||||
tabStore.commitResetState();
|
tabStore.commitResetState();
|
||||||
this.resetState();
|
this.resetState();
|
||||||
|
|
|
||||||
|
|
@ -70,7 +70,6 @@ export interface ProjectConfig {
|
||||||
headerSetting: HeaderSetting;
|
headerSetting: HeaderSetting;
|
||||||
// 菜单类型
|
// 菜单类型
|
||||||
// menuType: MenuTypeEnum;
|
// menuType: MenuTypeEnum;
|
||||||
|
|
||||||
menuSetting: MenuSetting;
|
menuSetting: MenuSetting;
|
||||||
|
|
||||||
messageSetting: MessageSetting;
|
messageSetting: MessageSetting;
|
||||||
|
|
@ -88,15 +87,12 @@ export interface ProjectConfig {
|
||||||
showBreadCrumbIcon: boolean;
|
showBreadCrumbIcon: boolean;
|
||||||
// 使用error-handler-plugin
|
// 使用error-handler-plugin
|
||||||
useErrorHandle: boolean;
|
useErrorHandle: boolean;
|
||||||
|
|
||||||
// 开启页面切换动画
|
// 开启页面切换动画
|
||||||
openRouterTransition: boolean;
|
openRouterTransition: boolean;
|
||||||
// 路由切换动画
|
// 路由切换动画
|
||||||
routerTransition: RouterTransitionEnum;
|
routerTransition: RouterTransitionEnum;
|
||||||
|
|
||||||
// 是否开启登录安全校验
|
// 是否开启登录安全校验
|
||||||
openLoginVerify: boolean;
|
openLoginVerify: boolean;
|
||||||
|
|
||||||
// 是否监听网络变化
|
// 是否监听网络变化
|
||||||
listenNetWork: boolean;
|
listenNetWork: boolean;
|
||||||
// 是否开启页面切换loading
|
// 是否开启页面切换loading
|
||||||
|
|
@ -116,23 +112,17 @@ export interface ProjectConfig {
|
||||||
export interface GlobConfig {
|
export interface GlobConfig {
|
||||||
// 网站标题
|
// 网站标题
|
||||||
title: string;
|
title: string;
|
||||||
|
|
||||||
// 项目路径
|
// 项目路径
|
||||||
apiUrl: string;
|
apiUrl: string;
|
||||||
|
|
||||||
urlPrefix?: string;
|
urlPrefix?: string;
|
||||||
|
|
||||||
shortName: string;
|
shortName: string;
|
||||||
}
|
}
|
||||||
export interface GlobEnvConfig {
|
export interface GlobEnvConfig {
|
||||||
// 网站标题
|
// 网站标题
|
||||||
VITE_GLOB_APP_TITLE: string;
|
VITE_GLOB_APP_TITLE: string;
|
||||||
|
|
||||||
// 项目路径
|
// 项目路径
|
||||||
VITE_GLOB_API_URL: string;
|
VITE_GLOB_API_URL: string;
|
||||||
|
|
||||||
VITE_GLOB_API_URL_PREFIX?: string;
|
VITE_GLOB_API_URL_PREFIX?: string;
|
||||||
|
|
||||||
VITE_GLOB_APP_SHORT_NAME: string;
|
VITE_GLOB_APP_SHORT_NAME: string;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -9,6 +9,7 @@ declare interface IObj<T = any> {
|
||||||
}
|
}
|
||||||
|
|
||||||
declare function parseInt(s: string | number, radix?: number): number;
|
declare function parseInt(s: string | number, radix?: number): number;
|
||||||
|
|
||||||
declare function parseFloat(string: string | number): number;
|
declare function parseFloat(string: string | number): number;
|
||||||
|
|
||||||
declare type Dictionary<T> = Record<string, T>;
|
declare type Dictionary<T> = Record<string, T>;
|
||||||
|
|
@ -26,6 +27,7 @@ declare type CustomizedHTMLElement<T> = HTMLElement & T;
|
||||||
declare type Indexable<T = any> = {
|
declare type Indexable<T = any> = {
|
||||||
[key: string]: T;
|
[key: string]: T;
|
||||||
};
|
};
|
||||||
|
|
||||||
declare type Hash<T> = Indexable<T>;
|
declare type Hash<T> = Indexable<T>;
|
||||||
|
|
||||||
declare type DeepPartial<T> = {
|
declare type DeepPartial<T> = {
|
||||||
|
|
|
||||||
|
|
@ -1,4 +1,7 @@
|
||||||
declare module 'ant-design-vue/es/locale/zh_CN';
|
declare module 'ant-design-vue/es/locale/zh_CN';
|
||||||
|
|
||||||
declare module 'globby!/@/router/routes/modules/**/*.@(ts)';
|
declare module 'globby!/@/router/routes/modules/**/*.@(ts)';
|
||||||
|
|
||||||
declare module 'globby!/@/router/menus/modules/**/*.@(ts)';
|
declare module 'globby!/@/router/menus/modules/**/*.@(ts)';
|
||||||
|
|
||||||
declare const React: string;
|
declare const React: string;
|
||||||
|
|
|
||||||
|
|
@ -1,12 +1,8 @@
|
||||||
// 文件: `shim-tsx.d.ts`
|
import type { ComponentRenderProxy, VNode } from 'vue';
|
||||||
import Vue, { VNode } from 'vue';
|
|
||||||
import type { ComponentRenderProxy } from '@vue/composition-api';
|
|
||||||
|
|
||||||
declare module '*.tsx' {
|
declare module '*.tsx' {
|
||||||
import { defineComponent } from 'vue';
|
import { defineComponent } from 'vue';
|
||||||
const component: ReturnType<defineComponent>;
|
const component: ReturnType<defineComponent>;
|
||||||
// import { ComponentOptions } from 'vue';
|
|
||||||
// const component: ReturnType<ComponentOptions>;
|
|
||||||
export default component;
|
export default component;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue