fixed:自动导入功能将根据表内字段自动创建created_at和updated_at的时间
This commit is contained in:
@@ -23,7 +23,7 @@ export const useAppStore = defineStore('app', () => {
|
||||
Object.keys(originSetting).forEach(key => {
|
||||
config[key] = originSetting[key]
|
||||
if(key === 'primaryColor'){
|
||||
setBodyPrimaryColor(originSetting[key])
|
||||
setBodyPrimaryColor(originSetting[key],config.darkMode)
|
||||
}
|
||||
})
|
||||
|
||||
@@ -72,7 +72,7 @@ export const useAppStore = defineStore('app', () => {
|
||||
|
||||
const togglePrimaryColor = (e) => {
|
||||
config.primaryColor = e;
|
||||
setBodyPrimaryColor(e)
|
||||
setBodyPrimaryColor(e,config.darkMode)
|
||||
}
|
||||
|
||||
const toggleTabs = (e) => {
|
||||
|
@@ -77,6 +77,13 @@ const generateAllColors = (u,e)=> {
|
||||
return hexToColor(t[0], t[1], t[2])
|
||||
}
|
||||
|
||||
const generateAllLightColors = (u, e) => {
|
||||
let t = colorToHex(u);
|
||||
const target = [240, 248, 255]; // RGB for blue white color
|
||||
for (let a = 0; a < 3; a++)
|
||||
t[a] = Math.floor(t[a] * (1 - e) + target[a] * e);
|
||||
return hexToColor(t[0], t[1], t[2]);
|
||||
}
|
||||
|
||||
|
||||
function addOpacityToColor(u, opacity) {
|
||||
@@ -85,13 +92,19 @@ function addOpacityToColor(u, opacity) {
|
||||
}
|
||||
|
||||
|
||||
export const setBodyPrimaryColor = ( primaryColor ) =>{
|
||||
export const setBodyPrimaryColor = ( primaryColor, darkMode ) =>{
|
||||
|
||||
let fmtColorFunc = generateAllColors
|
||||
if (darkMode === 'light') {
|
||||
fmtColorFunc = generateAllLightColors
|
||||
}
|
||||
|
||||
document.documentElement.style.setProperty('--el-color-primary', primaryColor)
|
||||
for (let times = 1; times <= 2; times++) {
|
||||
document.documentElement.style.setProperty(`--el-color-primary-dark-${times}`, generateAllColors(primaryColor, times / 10))
|
||||
document.documentElement.style.setProperty(`--el-color-primary-dark-${times}`, fmtColorFunc(primaryColor, times / 10))
|
||||
}
|
||||
for (let times = 1; times <= 10; times++) {
|
||||
document.documentElement.style.setProperty(`--el-color-primary-light-${times}`, generateAllColors(primaryColor, times / 10))
|
||||
document.documentElement.style.setProperty(`--el-color-primary-light-${times}`, fmtColorFunc(primaryColor, times / 10))
|
||||
}
|
||||
document.documentElement.style.setProperty(`--el-menu-hover-bg-color`, addOpacityToColor(primaryColor, 0.1))
|
||||
}
|
||||
|
Reference in New Issue
Block a user