diff --git a/src/components/Application/src/AppLogo.vue b/src/components/Application/src/AppLogo.vue index b06e4d08..1b4f70f9 100644 --- a/src/components/Application/src/AppLogo.vue +++ b/src/components/Application/src/AppLogo.vue @@ -6,7 +6,7 @@
- {{ title }} + {{ subjectLogoTitle ? subjectLogoTitle : title }}
@@ -19,6 +19,8 @@ import { PageEnum } from '@/enums/pageEnum'; import { useUserStore } from '@/store/modules/user'; import { getAppEnvConfig } from '@/utils/env'; + import { SUBJECT_LOGO_TITLE } from '@/enums/cacheEnum'; + import { getAuthCache } from '@/utils/auth'; const { VITE_GLOB_APP_LOGO } = getAppEnvConfig(); @@ -41,6 +43,8 @@ const { getCollapsedShowTitle } = useMenuSetting(); const userStore = useUserStore(); const { title } = useGlobSetting(); + const subjectLogoTitle = getAuthCache(SUBJECT_LOGO_TITLE); + const go = useGo(); const getAppLogoClass = computed(() => [ diff --git a/src/enums/cacheEnum.ts b/src/enums/cacheEnum.ts index 63d794cd..f4186d84 100644 --- a/src/enums/cacheEnum.ts +++ b/src/enums/cacheEnum.ts @@ -31,6 +31,7 @@ export const TABLE_SETTING_KEY = 'TABLE__SETTING__KEY__'; // 专题设置 export const SUBJECT_KEY = 'SUBJECT__'; +export const SUBJECT_LOGO_TITLE = 'SUBJECT_LOGO_TITLE__'; export enum CacheTypeEnum { SESSION, diff --git a/src/store/modules/user.ts b/src/store/modules/user.ts index 2ef153bb..aad03655 100644 --- a/src/store/modules/user.ts +++ b/src/store/modules/user.ts @@ -4,7 +4,7 @@ import { defineStore } from 'pinia'; import { store } from '@/store'; import { RoleEnum } from '@/enums/roleEnum'; import { PageEnum } from '@/enums/pageEnum'; -import { ROLES_KEY, TOKEN_KEY, USER_INFO_KEY, SUBJECT_KEY } from '@/enums/cacheEnum'; +import { ROLES_KEY, TOKEN_KEY, USER_INFO_KEY, SUBJECT_KEY, SUBJECT_LOGO_TITLE } from '@/enums/cacheEnum'; import { getAuthCache, setAuthCache } from '@/utils/auth'; import { GetUserInfoModel, LoginParams } from '@/api/sys/model/userModel'; import { doLogout, getUserInfo, loginApi } from '@/api/sys/user'; @@ -25,6 +25,7 @@ interface UserState { sessionTimeout?: boolean; lastUpdateTime: number; subject?: string; + subjectLogoTitle?: string; } export const useUserStore = defineStore({ @@ -41,6 +42,7 @@ export const useUserStore = defineStore({ // Last fetch time lastUpdateTime: 0, subject: '', + subjectLogoTitle: '', }), getters: { getUserInfo(state): UserInfo { @@ -61,11 +63,15 @@ export const useUserStore = defineStore({ getSubject(state): string { return state.subject || getAuthCache(SUBJECT_KEY); }, + getSubjectLogoTitle(state): string { + return state.subjectLogoTitle || getAuthCache(SUBJECT_LOGO_TITLE); + }, }, actions: { - async setSubject(subject: string | undefined, link: string) { + async setSubject(subject: string | undefined, logoTitle: string | undefined, link: string) { this.subject = subject; setAuthCache(SUBJECT_KEY, subject); + setAuthCache(SUBJECT_LOGO_TITLE, logoTitle); if (subject != undefined) { const permissionStore = usePermissionStore(); await permissionStore.buildRoutesAction(); diff --git a/src/utils/cache/persistent.ts b/src/utils/cache/persistent.ts index f12b5337..a08d5b5a 100644 --- a/src/utils/cache/persistent.ts +++ b/src/utils/cache/persistent.ts @@ -6,6 +6,7 @@ import { createLocalStorage, createSessionStorage } from '@/utils/cache'; import { Memory } from './memory'; import { SUBJECT_KEY, + SUBJECT_LOGO_TITLE, TOKEN_KEY, USER_INFO_KEY, ROLES_KEY, @@ -22,6 +23,7 @@ import { pick, omit } from 'lodash-es'; interface BasicStore { [SUBJECT_KEY]: string | number | null | undefined; + [SUBJECT_LOGO_TITLE]: string | number | null | undefined; [TOKEN_KEY]: string | number | null | undefined; [USER_INFO_KEY]: UserInfo; [ROLES_KEY]: string[]; diff --git a/src/views/demo/system/specialcolumn/Modal/index.vue b/src/views/demo/system/specialcolumn/Modal/index.vue index 32f4e7ae..c3c2fca1 100644 --- a/src/views/demo/system/specialcolumn/Modal/index.vue +++ b/src/views/demo/system/specialcolumn/Modal/index.vue @@ -17,13 +17,23 @@ - + + + + 启用 停用 + + + - + - + @@ -95,7 +105,9 @@ const modalData = ref({ id: '' as string, title: '' as string, + logoTitle: '' as string, isShow: true as boolean, + isDevelop: false as boolean, isExternal: false as boolean, linkOrApi: '' as string, sort: 0 as number, @@ -119,6 +131,7 @@ getCategory(); }); + // 流程分类 async function getCategory() { categoryOptions.value = await getLoad({ code: 'FlowSort' }); } diff --git a/src/views/demo/system/specialcolumn/index.data.ts b/src/views/demo/system/specialcolumn/index.data.ts index 76bd30ba..b444ee93 100644 --- a/src/views/demo/system/specialcolumn/index.data.ts +++ b/src/views/demo/system/specialcolumn/index.data.ts @@ -17,6 +17,11 @@ export const columns: BasicColumn[] = [ dataIndex: 'title', width: 200, }, + { + title: 'LOGO名称', + dataIndex: 'logoTitle', + width: 200, + }, { title: '类型', dataIndex: 'isExternal', @@ -32,6 +37,11 @@ export const columns: BasicColumn[] = [ dataIndex: 'isShow', width: 200, }, + { + title: '是否开放', + dataIndex: 'isDevelop', + width: 200, + }, { title: '排序', dataIndex: 'sort', diff --git a/src/views/demo/system/specialcolumn/index.vue b/src/views/demo/system/specialcolumn/index.vue index 3991cba1..2f278591 100644 --- a/src/views/demo/system/specialcolumn/index.vue +++ b/src/views/demo/system/specialcolumn/index.vue @@ -1,5 +1,5 @@