diff --git a/.eslintrc.js b/.eslintrc.js
index 5487446c..d642a972 100644
--- a/.eslintrc.js
+++ b/.eslintrc.js
@@ -23,7 +23,7 @@ module.exports = {
'@typescript-eslint/no-empty-function': 'off',
'vue/custom-event-name-casing': 'off',
'no-use-before-define': 'off',
- // 'no-use-before-define': [
+ // 'no-setting-before-define': [
// 'error',
// {
// functions: false,
@@ -31,7 +31,7 @@ module.exports = {
// },
// ],
'@typescript-eslint/no-use-before-define': 'off',
- // '@typescript-eslint/no-use-before-define': [
+ // '@typescript-eslint/no-setting-before-define': [
// 'error',
// {
// functions: false,
diff --git a/src/components/Application/index.ts b/src/components/Application/index.ts
index b48b927e..ee01d071 100644
--- a/src/components/Application/index.ts
+++ b/src/components/Application/index.ts
@@ -1,7 +1,8 @@
import AppLocalPicker from './src/AppLocalPicker.vue';
-import AppFooterToolbar from './src/AppFooterToolbar.vue';
+import AppPageFooter from './src/AppPageFooter.vue';
+import AppLogo from './src/AppLogo.vue';
import { withInstall } from '../util';
-export { AppLocalPicker, AppFooterToolbar };
+export { AppLocalPicker, AppPageFooter, AppLogo };
-export default withInstall(AppLocalPicker, AppFooterToolbar);
+export default withInstall(AppLocalPicker, AppPageFooter, AppLogo);
diff --git a/src/components/Application/src/AppFooterToolbar.vue b/src/components/Application/src/AppFooterToolbar.vue
deleted file mode 100644
index b0550bab..00000000
--- a/src/components/Application/src/AppFooterToolbar.vue
+++ /dev/null
@@ -1,60 +0,0 @@
-
-
-
-
-
diff --git a/src/components/Application/src/AppLocalPicker.vue b/src/components/Application/src/AppLocalPicker.vue
index 544e8884..b30472ef 100644
--- a/src/components/Application/src/AppLocalPicker.vue
+++ b/src/components/Application/src/AppLocalPicker.vue
@@ -5,29 +5,44 @@
:selectedKeys="selectedKeys"
@menuEvent="handleMenuEvent"
>
-
+
+
+ {{ getLangText }}
+
diff --git a/src/components/Application/src/AppLogo.vue b/src/components/Application/src/AppLogo.vue
new file mode 100644
index 00000000..990b683b
--- /dev/null
+++ b/src/components/Application/src/AppLogo.vue
@@ -0,0 +1,72 @@
+
+
+
+
{{ globSetting.title }}
+
+
+
+
diff --git a/src/components/Application/src/AppPageFooter.vue b/src/components/Application/src/AppPageFooter.vue
new file mode 100644
index 00000000..4c741536
--- /dev/null
+++ b/src/components/Application/src/AppPageFooter.vue
@@ -0,0 +1,46 @@
+
+
+
+
+
diff --git a/src/components/Authority/src/index.vue b/src/components/Authority/src/index.vue
index f394f997..7410db59 100644
--- a/src/components/Authority/src/index.vue
+++ b/src/components/Authority/src/index.vue
@@ -1,16 +1,15 @@
diff --git a/src/layouts/page/index.tsx b/src/layouts/page/index.tsx
index c6471b97..232c4ed4 100644
--- a/src/layouts/page/index.tsx
+++ b/src/layouts/page/index.tsx
@@ -1,75 +1,78 @@
-import { computed, defineComponent, unref, Transition, KeepAlive, toRaw } from 'vue';
+import type { FunctionalComponent } from 'vue';
+
+import { computed, defineComponent, unref, Transition, KeepAlive } from 'vue';
import { RouterView, RouteLocation } from 'vue-router';
import FrameLayout from '/@/layouts/iframe/index.vue';
import { useTransition } from './useTransition';
-import { useProjectSetting } from '/@/settings/use';
+import { useMenuSetting } from '/@/hooks/setting/useMenuSetting';
+import { useRootSetting } from '/@/hooks/setting/useRootSetting';
+import { useMultipleTabSetting } from '/@/hooks/setting/useMultipleTabSetting';
import { tabStore } from '/@/store/modules/tab';
-import { appStore } from '/@/store/modules/app';
+
+interface DefaultContext {
+ Component: FunctionalComponent;
+ route: RouteLocation;
+}
export default defineComponent({
name: 'PageLayout',
setup() {
- const getProjectConfigRef = computed(() => appStore.getProjectConfig);
- const openCacheRef = computed(() => {
- const {
- openKeepAlive,
- multiTabsSetting: { show },
- } = unref(getProjectConfigRef);
- return openKeepAlive && show;
- });
- const getCacheTabsRef = computed(() => toRaw(tabStore.getKeepAliveTabsState) as string[]);
+ const { getShow } = useMenuSetting();
+ const {
+ getOpenKeepAlive,
+ getRouterTransition,
+ getOpenRouterTransition,
+ getCanEmbedIFramePage,
+ } = useRootSetting();
- const { openPageLoading } = unref(getProjectConfigRef);
+ const { getMax } = useMultipleTabSetting();
+
+ const transitionEvent = useTransition();
+
+ const openCacheRef = computed(() => unref(getOpenKeepAlive) && unref(getShow));
+
+ const getCacheTabsRef = computed(() => tabStore.getKeepAliveTabsState as string[]);
- let on = {};
- if (openPageLoading) {
- const { on: transitionOn } = useTransition();
- on = transitionOn;
- }
- const projectSetting = useProjectSetting();
return () => {
- const {
- routerTransition,
- openRouterTransition,
- multiTabsSetting: { max },
- } = unref(getProjectConfigRef);
-
return (
{{
- default: ({ Component, route }: { Component: any; route: RouteLocation }) => {
+ default: ({ Component, route }: DefaultContext) => {
// No longer show animations that are already in the tab
const cacheTabs = unref(getCacheTabsRef);
const isInCache = cacheTabs.includes(route.name as string);
const name = isInCache && route.meta.inTab ? 'fade' : null;
- const Content = unref(openCacheRef) ? (
-
-
+ const renderComp = () => ;
+
+ const PageContent = unref(openCacheRef) ? (
+
+ {renderComp()}
) : (
-
+ renderComp()
);
- return openRouterTransition ? (
+
+ return unref(getOpenRouterTransition) ? (
- {() => Content}
+ {() => PageContent}
) : (
- Content
+ PageContent
);
},
}}
- {projectSetting.canEmbedIFramePage && }
+ {unref(getCanEmbedIFramePage) && }
);
};
diff --git a/src/layouts/page/useTransition.ts b/src/layouts/page/useTransition.ts
index 2c1a5945..6a2e6226 100644
--- a/src/layouts/page/useTransition.ts
+++ b/src/layouts/page/useTransition.ts
@@ -1,10 +1,11 @@
+import { useRootSetting } from '/@/hooks/setting/useRootSetting';
import { appStore } from '/@/store/modules/app';
import { tryOnUnmounted } from '/@/utils/helper/vueHelper';
+
export function useTransition() {
function handleAfterEnter() {
- const { openRouterTransition, openPageLoading } = appStore.getProjectConfig;
-
- if (!openRouterTransition || !openPageLoading) return;
+ const { getOpenPageLoading, getOpenRouterTransition } = useRootSetting();
+ if (!getOpenPageLoading.value || !getOpenRouterTransition.value) return;
// Close loading after the route switching animation ends
appStore.setPageLoadingAction(false);
}
@@ -15,9 +16,6 @@ export function useTransition() {
});
return {
- handleAfterEnter,
- on: {
- onAfterEnter: handleAfterEnter,
- },
+ onAfterEnter: handleAfterEnter,
};
}
diff --git a/src/main.ts b/src/main.ts
index 60de292a..d7747a75 100644
--- a/src/main.ts
+++ b/src/main.ts
@@ -49,7 +49,7 @@ if (isDevMode()) {
window.__APP__ = app;
}
-// If you do not need to use the mock service in the production environment, you can comment the code
+// If you do not need to setting the mock service in the production environment, you can comment the code
if (isProdMode() && isUseMock()) {
setupProdMockServer();
}
diff --git a/src/router/guard/index.ts b/src/router/guard/index.ts
index c3b1a260..efd5bf5f 100644
--- a/src/router/guard/index.ts
+++ b/src/router/guard/index.ts
@@ -6,7 +6,7 @@ import { createProgressGuard } from './progressGuard';
import { createPermissionGuard } from './permissionGuard';
import { createPageLoadingGuard } from './pageLoadingGuard';
-import { useGlobSetting, useProjectSetting } from '/@/settings/use';
+import { useGlobSetting, useProjectSetting } from '/@/hooks/setting';
import { getIsOpenTab, setCurrentTo } from '/@/utils/helper/routeHelper';
import { setTitle } from '/@/utils/browser';
diff --git a/src/router/menus/index.ts b/src/router/menus/index.ts
index 55b942b6..4f3fd19c 100644
--- a/src/router/menus/index.ts
+++ b/src/router/menus/index.ts
@@ -7,6 +7,7 @@ import { filter } from '/@/utils/helper/treeHelper';
import router from '/@/router';
import { PermissionModeEnum } from '/@/enums/appEnum';
import { pathToRegexp } from 'path-to-regexp';
+
import modules from 'globby!/@/router/menus/modules/**/*.@(ts)';
const menuModules: MenuModule[] = [];
@@ -44,7 +45,6 @@ async function getAsyncMenus() {
// 获取深层扁平化菜单
export const getFlatMenus = async () => {
const menus = await getAsyncMenus();
-
return flatMenus(menus);
};
diff --git a/src/settings/projectSetting.ts b/src/settings/projectSetting.ts
index c3fa1332..307ac8a8 100644
--- a/src/settings/projectSetting.ts
+++ b/src/settings/projectSetting.ts
@@ -9,7 +9,7 @@ import { isProdMode } from '/@/utils/env';
const setting: ProjectConfig = {
// locale setting
locale: {
- // Locales
+ // Locale
lang: 'zh_CN',
// Default locale
fallback: 'zh_CN',
@@ -29,17 +29,22 @@ const setting: ProjectConfig = {
// Whether to show the configuration button
showSettingButton: true,
+
// 权限模式
permissionMode: PermissionModeEnum.ROLE,
+
// 网站灰色模式,用于可能悼念的日期开启
grayMode: false,
+
// 色弱模式
colorWeak: false,
// 是否取消菜单,顶部,多标签页显示, 用于可能内嵌在别的系统内
fullContent: false,
+
// content mode
contentMode: ContentEnum.FULL,
+
// 是否显示logo
showLogo: true,
@@ -58,11 +63,10 @@ const setting: ProjectConfig = {
showFullScreen: true,
// 显示文档按钮
showDoc: true,
- // 是否显示github
- showGithub: true,
// 显示消息中心按钮
showNotice: true,
},
+
// 菜单配置
menuSetting: {
// 菜单折叠
@@ -108,13 +112,16 @@ const setting: ProjectConfig = {
// 标签页缓存最大数量
max: 12,
},
+
// 是否开启KeepAlive缓存 开发时候最好关闭,不然每次都需要清除缓存
openKeepAlive: true,
// 自动锁屏时间,为0不锁屏。 单位分钟 默认0
lockTime: 0,
+
// 显示面包屑
showBreadCrumb: true,
+
// 显示面包屑图标
showBreadCrumbIcon: false,
diff --git a/src/setup/error-handle/index.ts b/src/setup/error-handle/index.ts
index 0040de7b..7b8bae6e 100644
--- a/src/setup/error-handle/index.ts
+++ b/src/setup/error-handle/index.ts
@@ -3,7 +3,7 @@
*/
import { errorStore, ErrorInfo } from '/@/store/modules/error';
-import { useProjectSetting } from '/@/settings/use';
+import { useProjectSetting } from '/@/hooks/setting';
import { ErrorTypeEnum } from '/@/enums/exceptionEnum';
import { App } from 'vue';
diff --git a/src/setup/i18n/index.ts b/src/setup/i18n/index.ts
index 01e4bf33..c3e03b75 100644
--- a/src/setup/i18n/index.ts
+++ b/src/setup/i18n/index.ts
@@ -4,7 +4,7 @@ import type { I18n, I18nOptions } from 'vue-i18n';
import { createI18n } from 'vue-i18n';
import localeMessages from '/@/locales';
import { useLocale } from '/@/hooks/web/useLocale';
-import { useLocaleSetting } from '/@/settings/use/useLocaleSetting';
+import { useLocaleSetting } from '/@/hooks/setting/useLocaleSetting';
const { setupLocale } = useLocale();
diff --git a/src/store/modules/error.ts b/src/store/modules/error.ts
index cd49760a..64252c64 100644
--- a/src/store/modules/error.ts
+++ b/src/store/modules/error.ts
@@ -4,7 +4,7 @@ import { VuexModule, getModule, Module, Mutation, Action } from 'vuex-module-dec
import { formatToDateTime } from '/@/utils/dateUtil';
import { ErrorTypeEnum } from '/@/enums/exceptionEnum';
-import { useProjectSetting } from '/@/settings/use';
+import { useProjectSetting } from '/@/hooks/setting';
export interface ErrorInfo {
type: ErrorTypeEnum;
diff --git a/src/store/modules/menu.ts b/src/store/modules/menu.ts
deleted file mode 100644
index 5d3f01bd..00000000
--- a/src/store/modules/menu.ts
+++ /dev/null
@@ -1,67 +0,0 @@
-import store from '/@/store';
-import { hotModuleUnregisterModule } from '/@/utils/helper/vuexHelper';
-import { VuexModule, Module, getModule, Mutation } from 'vuex-module-decorators';
-
-import { appStore } from '/@/store/modules/app';
-
-const NAME = 'menu';
-hotModuleUnregisterModule(NAME);
-@Module({ namespaced: true, name: NAME, dynamic: true, store })
-class Menu extends VuexModule {
- // 是否开始拖拽
- private dragStartState = false;
-
- private currentTopSplitMenuPathState = '';
-
- /**
- * @description: 获取窗口名称
- */
- get getCollapsedState() {
- return appStore.getProjectConfig.menuSetting.collapsed;
- }
-
- get getCurrentTopSplitMenuPathState() {
- return this.currentTopSplitMenuPathState;
- }
-
- get getDragStartState() {
- return this.dragStartState;
- }
-
- get getMenuWidthState() {
- return appStore.getProjectConfig.menuSetting.menuWidth;
- }
-
- @Mutation
- commitDragStartState(dragStart: boolean): void {
- this.dragStartState = dragStart;
- }
-
- @Mutation
- commitCurrentTopSplitMenuPathState(path: string): void {
- this.currentTopSplitMenuPathState = path;
- }
-
- // 改变菜单展开状态
- @Mutation
- commitCollapsedState(collapsed: boolean): void {
- // this.collapsedState = collapsed;
- appStore.commitProjectConfigState({
- menuSetting: {
- collapsed: collapsed,
- },
- });
- }
-
- @Mutation
- commitMenuWidthState(menuWidth: number): void {
- // this.menuWidthState = menuWidth;
- appStore.commitProjectConfigState({
- menuSetting: {
- menuWidth: menuWidth,
- },
- });
- }
-}
-
-export const menuStore = getModule