|
@@ -2,10 +2,12 @@ import {defineStore} from "pinia";
|
|
|
import titleLogo from '@/assets/images/web/web-home_title.png'
|
|
|
import webBgImg from '@/assets/images/web/web-home_bg.png'
|
|
|
import loginImg from '@/assets/images/global/login-img.png'
|
|
|
+import {extractRgbFromRgba, hexToOpaqueHex, hexToRgb} from "@/utils/util";
|
|
|
|
|
|
export const useThemeStore = defineStore('theme', {
|
|
|
state: () => ({
|
|
|
init: false,
|
|
|
+ mainColor: '#2E81FF',
|
|
|
title: '海南社管智慧搜索平台',
|
|
|
subTitle: 'HAI NAN SHE GUAN ZHI HUI SOU SUO PING TAI',
|
|
|
logo: '',
|
|
@@ -24,12 +26,16 @@ export const useThemeStore = defineStore('theme', {
|
|
|
this[key1] = config[key2]
|
|
|
}
|
|
|
}
|
|
|
+ setValue('mainColor', 'mainColor')
|
|
|
setValue('title', 'title')
|
|
|
setValue('subTitle', 'subTitle')
|
|
|
setValue('logo', 'logo')
|
|
|
setValue('titleLogo', 'titleLogo')
|
|
|
setValue('webBgImg', 'webBgImg')
|
|
|
setValue('loginImg', 'loginImg')
|
|
|
+ document.documentElement.style.setProperty('--cus-main-color', this.mainColor) // 主题色
|
|
|
+ document.documentElement.style.setProperty('--cus-main-color-rgb', extractRgbFromRgba(hexToRgb(this.mainColor)).join(',')) // 主题色rgb
|
|
|
+ document.documentElement.style.setProperty('--cus-main-color-hex-2', (hexToOpaqueHex(this.mainColor, 0.2))) // 表头颜色
|
|
|
}
|
|
|
},
|
|
|
})
|