mirror of
https://github.com/pure-admin/vue-pure-admin.git
synced 2025-06-08 01:17:23 +08:00
commit
e787f46414
@ -12,6 +12,10 @@
|
|||||||
"Grey": false,
|
"Grey": false,
|
||||||
"Weak": false,
|
"Weak": false,
|
||||||
"HideTabs": false,
|
"HideTabs": false,
|
||||||
|
"SidebarStatus": true,
|
||||||
|
"EpThemeColor": "#409EFF",
|
||||||
|
"ShowLogo": true,
|
||||||
|
"ShowModel": "smart",
|
||||||
"MapConfigure": {
|
"MapConfigure": {
|
||||||
"amapKey": "97b3248d1553172e81f168cf94ea667e",
|
"amapKey": "97b3248d1553172e81f168cf94ea667e",
|
||||||
"options": {
|
"options": {
|
||||||
|
@ -27,7 +27,7 @@ const transitions = computed(() => {
|
|||||||
});
|
});
|
||||||
|
|
||||||
const hideTabs = computed(() => {
|
const hideTabs = computed(() => {
|
||||||
return instance?.sets.hideTabs;
|
return instance?.configure.hideTabs;
|
||||||
});
|
});
|
||||||
|
|
||||||
const layout = computed(() => {
|
const layout = computed(() => {
|
||||||
|
@ -79,17 +79,19 @@ if (unref(layoutTheme)) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// 默认灵动模式
|
// 默认灵动模式
|
||||||
const markValue = ref(storageLocal.getItem("showModel") || "smart");
|
const markValue = ref(instance.configure?.showModel ?? "smart");
|
||||||
|
|
||||||
const logoVal = ref(storageLocal.getItem("logoVal") || "1");
|
const logoVal = ref(instance.configure?.showLogo ?? true);
|
||||||
|
|
||||||
const epThemeColor = ref(useEpThemeStoreHook().getEpThemeColor);
|
const epThemeColor = ref(useEpThemeStoreHook().getEpThemeColor);
|
||||||
|
|
||||||
const settings = reactive({
|
const settings = reactive({
|
||||||
greyVal: instance.sets.grey,
|
greyVal: instance.configure.grey,
|
||||||
weakVal: instance.sets.weak,
|
weakVal: instance.configure.weak,
|
||||||
tabsVal: instance.sets.hideTabs,
|
tabsVal: instance.configure.hideTabs,
|
||||||
multiTagsCache: instance.sets.multiTagsCache
|
showLogo: instance.configure.showLogo,
|
||||||
|
showModel: instance.configure.showModel,
|
||||||
|
multiTagsCache: instance.configure.multiTagsCache
|
||||||
});
|
});
|
||||||
|
|
||||||
const getThemeColorStyle = computed(() => {
|
const getThemeColorStyle = computed(() => {
|
||||||
@ -98,6 +100,12 @@ const getThemeColorStyle = computed(() => {
|
|||||||
};
|
};
|
||||||
});
|
});
|
||||||
|
|
||||||
|
function changeStorageConfigure(key, val) {
|
||||||
|
const storageConfigure = instance.configure;
|
||||||
|
storageConfigure[key] = val;
|
||||||
|
instance.configure = storageConfigure;
|
||||||
|
}
|
||||||
|
|
||||||
function toggleClass(flag: boolean, clsName: string, target?: HTMLElement) {
|
function toggleClass(flag: boolean, clsName: string, target?: HTMLElement) {
|
||||||
const targetEl = target || document.body;
|
const targetEl = target || document.body;
|
||||||
let { className } = targetEl;
|
let { className } = targetEl;
|
||||||
@ -108,12 +116,7 @@ function toggleClass(flag: boolean, clsName: string, target?: HTMLElement) {
|
|||||||
// 灰色模式设置
|
// 灰色模式设置
|
||||||
const greyChange = (value): void => {
|
const greyChange = (value): void => {
|
||||||
toggleClass(settings.greyVal, "html-grey", document.querySelector("html"));
|
toggleClass(settings.greyVal, "html-grey", document.querySelector("html"));
|
||||||
instance.sets = {
|
changeStorageConfigure("grey", value);
|
||||||
grey: value,
|
|
||||||
weak: instance.sets.weak,
|
|
||||||
hideTabs: instance.sets.hideTabs,
|
|
||||||
multiTagsCache: instance.sets.multiTagsCache
|
|
||||||
};
|
|
||||||
};
|
};
|
||||||
|
|
||||||
// 色弱模式设置
|
// 色弱模式设置
|
||||||
@ -123,33 +126,18 @@ const weekChange = (value): void => {
|
|||||||
"html-weakness",
|
"html-weakness",
|
||||||
document.querySelector("html")
|
document.querySelector("html")
|
||||||
);
|
);
|
||||||
instance.sets = {
|
changeStorageConfigure("weak", value);
|
||||||
grey: instance.sets.grey,
|
|
||||||
weak: value,
|
|
||||||
hideTabs: instance.sets.hideTabs,
|
|
||||||
multiTagsCache: instance.sets.multiTagsCache
|
|
||||||
};
|
|
||||||
};
|
};
|
||||||
|
|
||||||
const tagsChange = () => {
|
const tagsChange = () => {
|
||||||
let showVal = settings.tabsVal;
|
let showVal = settings.tabsVal;
|
||||||
instance.sets = {
|
changeStorageConfigure("hideTabs", showVal);
|
||||||
grey: instance.sets.grey,
|
|
||||||
weak: instance.sets.weak,
|
|
||||||
hideTabs: showVal,
|
|
||||||
multiTagsCache: instance.sets.multiTagsCache
|
|
||||||
};
|
|
||||||
emitter.emit("tagViewsChange", showVal);
|
emitter.emit("tagViewsChange", showVal);
|
||||||
};
|
};
|
||||||
|
|
||||||
const multiTagsCacheChange = () => {
|
const multiTagsCacheChange = () => {
|
||||||
let multiTagsCache = settings.multiTagsCache;
|
let multiTagsCache = settings.multiTagsCache;
|
||||||
instance.sets = {
|
changeStorageConfigure("multiTagsCache", multiTagsCache);
|
||||||
grey: instance.sets.grey,
|
|
||||||
weak: instance.sets.weak,
|
|
||||||
hideTabs: instance.sets.hideTabs,
|
|
||||||
multiTagsCache: multiTagsCache
|
|
||||||
};
|
|
||||||
useMultiTagsStoreHook().multiTagsCacheChange(multiTagsCache);
|
useMultiTagsStoreHook().multiTagsCacheChange(multiTagsCache);
|
||||||
};
|
};
|
||||||
|
|
||||||
@ -174,22 +162,22 @@ function onReset() {
|
|||||||
}
|
}
|
||||||
]);
|
]);
|
||||||
useMultiTagsStoreHook().multiTagsCacheChange(getConfig().MultiTagsCache);
|
useMultiTagsStoreHook().multiTagsCacheChange(getConfig().MultiTagsCache);
|
||||||
useEpThemeStoreHook().setEpThemeColor("#409EFF");
|
useEpThemeStoreHook().setEpThemeColor(getConfig().EpThemeColor);
|
||||||
storageLocal.clear();
|
storageLocal.clear();
|
||||||
storageSession.clear();
|
storageSession.clear();
|
||||||
router.push("/login");
|
router.push("/login");
|
||||||
}
|
}
|
||||||
|
|
||||||
function onChange(label) {
|
function onChange(label) {
|
||||||
storageLocal.setItem("showModel", label);
|
changeStorageConfigure("showModel", label);
|
||||||
emitter.emit("tagViewsShowModel", label);
|
emitter.emit("tagViewsShowModel", label);
|
||||||
}
|
}
|
||||||
|
|
||||||
// 侧边栏Logo
|
// 侧边栏Logo
|
||||||
function logoChange() {
|
function logoChange() {
|
||||||
unref(logoVal) === "1"
|
unref(logoVal)
|
||||||
? storageLocal.setItem("logoVal", "1")
|
? changeStorageConfigure("showLogo", true)
|
||||||
: storageLocal.setItem("logoVal", "-1");
|
: changeStorageConfigure("showLogo", false);
|
||||||
emitter.emit("logoChange", unref(logoVal));
|
emitter.emit("logoChange", unref(logoVal));
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -238,13 +226,19 @@ function setLayoutModel(layout: string) {
|
|||||||
instance.layout = {
|
instance.layout = {
|
||||||
layout,
|
layout,
|
||||||
theme: layoutTheme.value.theme,
|
theme: layoutTheme.value.theme,
|
||||||
darkMode: instance.layout.darkMode
|
darkMode: instance.layout.darkMode,
|
||||||
|
sidebarStatus: instance.layout.sidebarStatus,
|
||||||
|
epThemeColor: instance.layout.epThemeColor
|
||||||
};
|
};
|
||||||
useAppStoreHook().setLayout(layout);
|
useAppStoreHook().setLayout(layout);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// 存放夜间主题切换前的导航主题色
|
||||||
|
let tempLayoutThemeColor;
|
||||||
|
|
||||||
// 设置导航主题色
|
// 设置导航主题色
|
||||||
function setLayoutThemeColor(theme: string) {
|
function setLayoutThemeColor(theme: string) {
|
||||||
|
tempLayoutThemeColor = instance.layout.theme;
|
||||||
layoutTheme.value.theme = theme;
|
layoutTheme.value.theme = theme;
|
||||||
toggleTheme({
|
toggleTheme({
|
||||||
scopeName: `layout-theme-${theme}`
|
scopeName: `layout-theme-${theme}`
|
||||||
@ -252,11 +246,13 @@ function setLayoutThemeColor(theme: string) {
|
|||||||
instance.layout = {
|
instance.layout = {
|
||||||
layout: useAppStoreHook().layout,
|
layout: useAppStoreHook().layout,
|
||||||
theme,
|
theme,
|
||||||
darkMode: dataTheme.value
|
darkMode: dataTheme.value,
|
||||||
|
sidebarStatus: instance.layout.sidebarStatus,
|
||||||
|
epThemeColor: instance.layout.epThemeColor
|
||||||
};
|
};
|
||||||
|
|
||||||
if (theme === "default" || theme === "light") {
|
if (theme === "default" || theme === "light") {
|
||||||
setEpThemeColor("#409EFF");
|
setEpThemeColor(getConfig().EpThemeColor);
|
||||||
} else {
|
} else {
|
||||||
const colors = find(themeColors.value, { themeColor: theme });
|
const colors = find(themeColors.value, { themeColor: theme });
|
||||||
const color = "#" + rgbHex(colors.rgb);
|
const color = "#" + rgbHex(colors.rgb);
|
||||||
@ -280,10 +276,13 @@ function dataThemeChange() {
|
|||||||
setLayoutThemeColor("light");
|
setLayoutThemeColor("light");
|
||||||
} else {
|
} else {
|
||||||
body.setAttribute("data-theme", "");
|
body.setAttribute("data-theme", "");
|
||||||
|
tempLayoutThemeColor && setLayoutThemeColor(tempLayoutThemeColor);
|
||||||
instance.layout = {
|
instance.layout = {
|
||||||
layout: useAppStoreHook().layout,
|
layout: useAppStoreHook().layout,
|
||||||
theme: instance.layout.theme,
|
theme: instance.layout.theme,
|
||||||
darkMode: dataTheme.value
|
darkMode: dataTheme.value,
|
||||||
|
sidebarStatus: instance.layout.sidebarStatus,
|
||||||
|
epThemeColor: instance.layout.epThemeColor
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -400,8 +399,8 @@ nextTick(() => {
|
|||||||
<el-switch
|
<el-switch
|
||||||
v-model="logoVal"
|
v-model="logoVal"
|
||||||
inline-prompt
|
inline-prompt
|
||||||
active-value="1"
|
:active-value="true"
|
||||||
inactive-value="-1"
|
:inactive-value="false"
|
||||||
inactive-color="#a6a6a6"
|
inactive-color="#a6a6a6"
|
||||||
active-text="开"
|
active-text="开"
|
||||||
inactive-text="关"
|
inactive-text="关"
|
||||||
|
@ -12,7 +12,9 @@ import { usePermissionStoreHook } from "/@/store/modules/permission";
|
|||||||
const route = useRoute();
|
const route = useRoute();
|
||||||
const pureApp = useAppStoreHook();
|
const pureApp = useAppStoreHook();
|
||||||
const router = useRouter().options.routes;
|
const router = useRouter().options.routes;
|
||||||
const showLogo = ref(storageLocal.getItem("logoVal") || "1");
|
const showLogo = ref(
|
||||||
|
storageLocal.getItem("responsive-configure")?.showLogo ?? true
|
||||||
|
);
|
||||||
const isCollapse = computed(() => {
|
const isCollapse = computed(() => {
|
||||||
return !pureApp.getSidebarStatus;
|
return !pureApp.getSidebarStatus;
|
||||||
});
|
});
|
||||||
@ -58,7 +60,7 @@ onBeforeMount(() => {
|
|||||||
|
|
||||||
<template>
|
<template>
|
||||||
<div :class="['sidebar-container', showLogo ? 'has-logo' : '']">
|
<div :class="['sidebar-container', showLogo ? 'has-logo' : '']">
|
||||||
<Logo v-if="showLogo === '1'" :collapse="isCollapse" />
|
<Logo v-if="showLogo" :collapse="isCollapse" />
|
||||||
<el-scrollbar wrap-class="scrollbar-wrapper">
|
<el-scrollbar wrap-class="scrollbar-wrapper">
|
||||||
<el-menu
|
<el-menu
|
||||||
:default-active="activeMenu"
|
:default-active="activeMenu"
|
||||||
|
@ -232,9 +232,13 @@ const tagsViews = ref<Array<tagsViewsType>>([
|
|||||||
]);
|
]);
|
||||||
|
|
||||||
// 显示模式,默认灵动模式显示
|
// 显示模式,默认灵动模式显示
|
||||||
const showModel = ref(storageLocal.getItem("showModel") || "smart");
|
const showModel = ref(
|
||||||
|
storageLocal.getItem("responsive-configure")?.showModel || "smart"
|
||||||
|
);
|
||||||
if (!showModel.value) {
|
if (!showModel.value) {
|
||||||
storageLocal.setItem("showModel", "card");
|
const configure = storageLocal.getItem("responsive-configure");
|
||||||
|
configure.showModel = "card";
|
||||||
|
storageLocal.setItem("responsive-configure", configure);
|
||||||
}
|
}
|
||||||
|
|
||||||
let visible = ref(false);
|
let visible = ref(false);
|
||||||
|
@ -16,8 +16,8 @@ import { useAppStoreHook } from "/@/store/modules/app";
|
|||||||
import fullScreen from "/@/assets/svg/full_screen.svg";
|
import fullScreen from "/@/assets/svg/full_screen.svg";
|
||||||
import exitScreen from "/@/assets/svg/exit_screen.svg";
|
import exitScreen from "/@/assets/svg/exit_screen.svg";
|
||||||
import { deviceDetection } from "/@/utils/deviceDetection";
|
import { deviceDetection } from "/@/utils/deviceDetection";
|
||||||
import { useSettingStoreHook } from "/@/store/modules/settings";
|
|
||||||
import { useMultiTagsStore } from "/@/store/modules/multiTags";
|
import { useMultiTagsStore } from "/@/store/modules/multiTags";
|
||||||
|
import { useSettingStoreHook } from "/@/store/modules/settings";
|
||||||
|
|
||||||
import navbar from "./components/navbar.vue";
|
import navbar from "./components/navbar.vue";
|
||||||
import tag from "./components/tag/index.vue";
|
import tag from "./components/tag/index.vue";
|
||||||
@ -52,16 +52,20 @@ const layout = computed(() => {
|
|||||||
instance.$storage.layout = {
|
instance.$storage.layout = {
|
||||||
layout: instance.$config?.Layout ?? "vertical",
|
layout: instance.$config?.Layout ?? "vertical",
|
||||||
theme: instance.$config?.Theme ?? "default",
|
theme: instance.$config?.Theme ?? "default",
|
||||||
darkMode: instance.$config?.DarkMode ?? false
|
darkMode: instance.$config?.DarkMode ?? false,
|
||||||
|
sidebarStatus: instance.$config?.SidebarStatus ?? true,
|
||||||
|
epThemeColor: instance.$config?.EpThemeColor ?? "#409EFF"
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
// 灰色模式、色弱模式、隐藏标签页
|
// 灰色模式、色弱模式、隐藏标签页
|
||||||
if (!instance.$storage.sets) {
|
if (!instance.$storage.configure) {
|
||||||
// eslint-disable-next-line
|
// eslint-disable-next-line
|
||||||
instance.$storage.sets = {
|
instance.$storage.configure = {
|
||||||
grey: instance.$config?.Grey ?? false,
|
grey: instance.$config?.Grey ?? false,
|
||||||
weak: instance.$config?.Weak ?? false,
|
weak: instance.$config?.Weak ?? false,
|
||||||
hideTabs: instance.$config?.HideTabs ?? false,
|
hideTabs: instance.$config?.HideTabs ?? false,
|
||||||
|
showLogo: instance.$config?.ShowLogo ?? true,
|
||||||
|
showModel: instance.$config?.ShowModel ?? "smart",
|
||||||
multiTagsCache: instance.$config?.MultiTagsCache ?? false
|
multiTagsCache: instance.$config?.MultiTagsCache ?? false
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
@ -91,7 +95,7 @@ const set: setType = reactive({
|
|||||||
}),
|
}),
|
||||||
|
|
||||||
hideTabs: computed(() => {
|
hideTabs: computed(() => {
|
||||||
return instance.$storage?.sets.hideTabs;
|
return instance.$storage?.configure.hideTabs;
|
||||||
})
|
})
|
||||||
});
|
});
|
||||||
|
|
||||||
@ -100,7 +104,9 @@ function setTheme(layoutModel: string) {
|
|||||||
instance.$storage.layout = {
|
instance.$storage.layout = {
|
||||||
layout: `${layoutModel}`,
|
layout: `${layoutModel}`,
|
||||||
theme: instance.$storage.layout?.theme,
|
theme: instance.$storage.layout?.theme,
|
||||||
darkMode: instance.$storage.layout?.darkMode
|
darkMode: instance.$storage.layout?.darkMode,
|
||||||
|
sidebarStatus: instance.$storage.layout?.sidebarStatus,
|
||||||
|
epThemeColor: instance.$storage.layout?.epThemeColor
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1,6 +1,7 @@
|
|||||||
// 静态路由
|
// 静态路由
|
||||||
import homeRouter from "./home";
|
import homeRouter from "./home";
|
||||||
import errorRouter from "./error";
|
import errorRouter from "./error";
|
||||||
|
import guideRouter from "./guide";
|
||||||
import editorRouter from "./editor";
|
import editorRouter from "./editor";
|
||||||
import nestedRouter from "./nested";
|
import nestedRouter from "./nested";
|
||||||
import menuTreeRouter from "./menuTree";
|
import menuTreeRouter from "./menuTree";
|
||||||
@ -8,7 +9,6 @@ import externalLink from "./externalLink";
|
|||||||
import flowChartRouter from "./flowchart";
|
import flowChartRouter from "./flowchart";
|
||||||
import remainingRouter from "./remaining";
|
import remainingRouter from "./remaining";
|
||||||
import componentsRouter from "./components";
|
import componentsRouter from "./components";
|
||||||
import guideRouter from "./guide";
|
|
||||||
import { RouteRecordRaw, RouteComponent } from "vue-router";
|
import { RouteRecordRaw, RouteComponent } from "vue-router";
|
||||||
|
|
||||||
import {
|
import {
|
||||||
@ -21,13 +21,13 @@ import {
|
|||||||
const routes = [
|
const routes = [
|
||||||
homeRouter,
|
homeRouter,
|
||||||
errorRouter,
|
errorRouter,
|
||||||
|
guideRouter,
|
||||||
nestedRouter,
|
nestedRouter,
|
||||||
externalLink,
|
externalLink,
|
||||||
editorRouter,
|
editorRouter,
|
||||||
menuTreeRouter,
|
menuTreeRouter,
|
||||||
flowChartRouter,
|
flowChartRouter,
|
||||||
componentsRouter,
|
componentsRouter
|
||||||
guideRouter
|
|
||||||
];
|
];
|
||||||
|
|
||||||
// 导出处理后的静态路由(三级及以上的路由全部拍成二级)
|
// 导出处理后的静态路由(三级及以上的路由全部拍成二级)
|
||||||
|
@ -1,17 +1,17 @@
|
|||||||
import { storageLocal } from "/@/utils/storage";
|
|
||||||
import { deviceDetection } from "/@/utils/deviceDetection";
|
|
||||||
import { store } from "/@/store";
|
import { store } from "/@/store";
|
||||||
import { appType } from "./types";
|
import { appType } from "./types";
|
||||||
import { defineStore } from "pinia";
|
import { defineStore } from "pinia";
|
||||||
import { getConfig } from "/@/config";
|
import { getConfig } from "/@/config";
|
||||||
|
import { storageLocal } from "/@/utils/storage";
|
||||||
|
import { deviceDetection } from "/@/utils/deviceDetection";
|
||||||
|
|
||||||
export const useAppStore = defineStore({
|
export const useAppStore = defineStore({
|
||||||
id: "pure-app",
|
id: "pure-app",
|
||||||
state: (): appType => ({
|
state: (): appType => ({
|
||||||
sidebar: {
|
sidebar: {
|
||||||
opened: storageLocal.getItem("sidebarStatus")
|
opened:
|
||||||
? !!+storageLocal.getItem("sidebarStatus")
|
storageLocal.getItem("responsive-layout")?.sidebarStatus ??
|
||||||
: true,
|
getConfig().SidebarStatus,
|
||||||
withoutAnimation: false,
|
withoutAnimation: false,
|
||||||
isClickHamburger: false
|
isClickHamburger: false
|
||||||
},
|
},
|
||||||
@ -30,20 +30,22 @@ export const useAppStore = defineStore({
|
|||||||
},
|
},
|
||||||
actions: {
|
actions: {
|
||||||
TOGGLE_SIDEBAR(opened?: boolean, resize?: string) {
|
TOGGLE_SIDEBAR(opened?: boolean, resize?: string) {
|
||||||
|
const layout = storageLocal.getItem("responsive-layout");
|
||||||
if (opened && resize) {
|
if (opened && resize) {
|
||||||
this.sidebar.withoutAnimation = true;
|
this.sidebar.withoutAnimation = true;
|
||||||
this.sidebar.opened = true;
|
this.sidebar.opened = true;
|
||||||
storageLocal.setItem("sidebarStatus", true);
|
layout.sidebarStatus = true;
|
||||||
} else if (!opened && resize) {
|
} else if (!opened && resize) {
|
||||||
this.sidebar.withoutAnimation = true;
|
this.sidebar.withoutAnimation = true;
|
||||||
this.sidebar.opened = false;
|
this.sidebar.opened = false;
|
||||||
storageLocal.setItem("sidebarStatus", false);
|
layout.sidebarStatus = false;
|
||||||
} else if (!opened && !resize) {
|
} else if (!opened && !resize) {
|
||||||
this.sidebar.withoutAnimation = false;
|
this.sidebar.withoutAnimation = false;
|
||||||
this.sidebar.opened = !this.sidebar.opened;
|
this.sidebar.opened = !this.sidebar.opened;
|
||||||
this.sidebar.isClickHamburger = !this.sidebar.opened;
|
this.sidebar.isClickHamburger = !this.sidebar.opened;
|
||||||
storageLocal.setItem("sidebarStatus", this.sidebar.opened);
|
layout.sidebarStatus = this.sidebar.opened;
|
||||||
}
|
}
|
||||||
|
storageLocal.setItem("responsive-layout", layout);
|
||||||
},
|
},
|
||||||
TOGGLE_DEVICE(device: string) {
|
TOGGLE_DEVICE(device: string) {
|
||||||
this.device = device;
|
this.device = device;
|
||||||
|
@ -1,11 +1,14 @@
|
|||||||
import { store } from "/@/store";
|
import { store } from "/@/store";
|
||||||
import { defineStore } from "pinia";
|
import { defineStore } from "pinia";
|
||||||
|
import { getConfig } from "/@/config";
|
||||||
import { storageLocal } from "/@/utils/storage";
|
import { storageLocal } from "/@/utils/storage";
|
||||||
|
|
||||||
export const useEpThemeStore = defineStore({
|
export const useEpThemeStore = defineStore({
|
||||||
id: "pure-epTheme",
|
id: "pure-epTheme",
|
||||||
state: () => ({
|
state: () => ({
|
||||||
epThemeColor: storageLocal.getItem("epThemeColor") || "#409EFF"
|
epThemeColor:
|
||||||
|
storageLocal.getItem("responsive-layout")?.epThemeColor ??
|
||||||
|
getConfig().EpThemeColor
|
||||||
}),
|
}),
|
||||||
getters: {
|
getters: {
|
||||||
getEpThemeColor() {
|
getEpThemeColor() {
|
||||||
@ -14,8 +17,10 @@ export const useEpThemeStore = defineStore({
|
|||||||
},
|
},
|
||||||
actions: {
|
actions: {
|
||||||
setEpThemeColor(newColor) {
|
setEpThemeColor(newColor) {
|
||||||
|
const layout = storageLocal.getItem("responsive-layout");
|
||||||
this.epThemeColor = newColor;
|
this.epThemeColor = newColor;
|
||||||
storageLocal.setItem("epThemeColor", newColor);
|
layout.epThemeColor = newColor;
|
||||||
|
storageLocal.setItem("responsive-layout", layout);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
@ -8,7 +8,7 @@ export const useMultiTagsStore = defineStore({
|
|||||||
id: "pure-multiTags",
|
id: "pure-multiTags",
|
||||||
state: () => ({
|
state: () => ({
|
||||||
// 存储标签页信息(路由信息)
|
// 存储标签页信息(路由信息)
|
||||||
multiTags: storageLocal.getItem("responsive-sets").multiTagsCache
|
multiTags: storageLocal.getItem("responsive-configure").multiTagsCache
|
||||||
? storageLocal.getItem("responsive-tags")
|
? storageLocal.getItem("responsive-tags")
|
||||||
: [
|
: [
|
||||||
{
|
{
|
||||||
@ -22,7 +22,7 @@ export const useMultiTagsStore = defineStore({
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
multiTagsCache: storageLocal.getItem("responsive-sets").multiTagsCache
|
multiTagsCache: storageLocal.getItem("responsive-configure").multiTagsCache
|
||||||
}),
|
}),
|
||||||
getters: {
|
getters: {
|
||||||
getMultiTagsCache() {
|
getMultiTagsCache() {
|
||||||
|
@ -18,15 +18,19 @@ export const injectResponsiveStorage = (app: App, config: ServerConfigs) => {
|
|||||||
default: Storage.getData(undefined, "layout") ?? {
|
default: Storage.getData(undefined, "layout") ?? {
|
||||||
layout: config.Layout ?? "vertical",
|
layout: config.Layout ?? "vertical",
|
||||||
theme: config.Theme ?? "default",
|
theme: config.Theme ?? "default",
|
||||||
darkMode: config.DarkMode ?? false
|
darkMode: config.DarkMode ?? false,
|
||||||
|
sidebarStatus: config.SidebarStatus ?? true,
|
||||||
|
epThemeColor: config.EpThemeColor ?? "409EFF"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
sets: {
|
configure: {
|
||||||
type: Object,
|
type: Object,
|
||||||
default: Storage.getData(undefined, "sets") ?? {
|
default: Storage.getData(undefined, "configure") ?? {
|
||||||
grey: config.Grey ?? false,
|
grey: config.Grey ?? false,
|
||||||
weak: config.Weak ?? false,
|
weak: config.Weak ?? false,
|
||||||
hideTabs: config.HideTabs ?? false,
|
hideTabs: config.HideTabs ?? false,
|
||||||
|
showLogo: config.ShowLogo ?? true,
|
||||||
|
showModel: config.ShowModel ?? "smart",
|
||||||
multiTagsCache: config.MultiTagsCache ?? false
|
multiTagsCache: config.MultiTagsCache ?? false
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
4
types/global.d.ts
vendored
4
types/global.d.ts
vendored
@ -86,6 +86,10 @@ declare global {
|
|||||||
Grey?: boolean;
|
Grey?: boolean;
|
||||||
Weak?: boolean;
|
Weak?: boolean;
|
||||||
HideTabs?: boolean;
|
HideTabs?: boolean;
|
||||||
|
SidebarStatus?: boolean;
|
||||||
|
EpThemeColor?: string;
|
||||||
|
ShowLogo?: boolean;
|
||||||
|
ShowModel?: string;
|
||||||
MapConfigure?: {
|
MapConfigure?: {
|
||||||
amapKey?: string;
|
amapKey?: string;
|
||||||
options: {
|
options: {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user