mirror of
https://github.com/vbenjs/vue-vben-admin.git
synced 2025-08-27 02:19:32 +08:00
chore: 暂时移除主题切换及暗黑模式切换功能
This commit is contained in:
@@ -131,7 +131,6 @@ If these plugins are helpful to you, you can give a star support
|
||||
|
||||
- [vite-plugin-mock](https://github.com/anncwb/vite-plugin-mock) - Used for local and development environment data mock
|
||||
- [vite-plugin-html](https://github.com/anncwb/vite-plugin-html) - Used for html template conversion and compression
|
||||
- [vite-plugin-theme](https://github.com/anncwb/vite-plugin-theme) - Used for online switching of theme colors and other color-related configurations
|
||||
- [vite-plugin-compression](https://github.com/anncwb/vite-plugin-compression) - Used to pack input .gz|.brotil files
|
||||
- [vite-plugin-svg-icons](https://github.com/anncwb/vite-plugin-svg-icons) - Used to quickly generate svg sprite
|
||||
|
||||
|
@@ -141,7 +141,6 @@ pnpm build
|
||||
|
||||
- [vite-plugin-mock](https://github.com/anncwb/vite-plugin-mock) - 用于本地及开发环境数据 mock
|
||||
- [vite-plugin-html](https://github.com/anncwb/vite-plugin-html) - 用于 html 模版转换及压缩
|
||||
- [vite-plugin-theme](https://github.com/anncwb/vite-plugin-theme) - 用于在线切换主题色等颜色相关配置
|
||||
- [vite-plugin-compression](https://github.com/anncwb/vite-plugin-compression) - 用于打包输出.gz|.brotil 文件
|
||||
- [vite-plugin-svg-icons](https://github.com/anncwb/vite-plugin-svg-icons) - 用于快速生成 svg 雪碧图
|
||||
|
||||
|
@@ -8,7 +8,6 @@ import { configHtmlPlugin } from './html';
|
||||
import { configMockPlugin } from './mock';
|
||||
import { configCompressPlugin } from './compress';
|
||||
import { configVisualizerConfig } from './visualizer';
|
||||
import { configThemePlugin } from './theme';
|
||||
import { configSvgIconsPlugin } from './svgSprite';
|
||||
|
||||
export function createVitePlugins(viteEnv: ViteEnv, isBuild: boolean) {
|
||||
@@ -44,9 +43,6 @@ export function createVitePlugins(viteEnv: ViteEnv, isBuild: boolean) {
|
||||
// rollup-plugin-visualizer
|
||||
vitePlugins.push(configVisualizerConfig());
|
||||
|
||||
// vite-plugin-theme
|
||||
vitePlugins.push(configThemePlugin(isBuild));
|
||||
|
||||
// The following plugins only work in the production environment
|
||||
if (isBuild) {
|
||||
// rollup-plugin-gzip
|
||||
|
@@ -1,89 +0,0 @@
|
||||
/**
|
||||
* Vite plugin for website theme color switching
|
||||
* https://github.com/anncwb/vite-plugin-theme
|
||||
*/
|
||||
import type { PluginOption } from 'vite';
|
||||
import path from 'path';
|
||||
import {
|
||||
viteThemePlugin,
|
||||
antdDarkThemePlugin,
|
||||
mixLighten,
|
||||
mixDarken,
|
||||
tinycolor,
|
||||
} from 'vite-plugin-theme';
|
||||
import { getThemeColors, generateColors } from '../../config/themeConfig';
|
||||
import { generateModifyVars } from '../../generate/generateModifyVars';
|
||||
|
||||
export function configThemePlugin(isBuild: boolean): PluginOption[] {
|
||||
const colors = generateColors({
|
||||
mixDarken,
|
||||
mixLighten,
|
||||
tinycolor,
|
||||
});
|
||||
const plugin = [
|
||||
viteThemePlugin({
|
||||
resolveSelector: (s) => {
|
||||
s = s.trim();
|
||||
switch (s) {
|
||||
case '.ant-steps-item-process .ant-steps-item-icon > .ant-steps-icon':
|
||||
return '.ant-steps-item-icon > .ant-steps-icon';
|
||||
case '.ant-radio-button-wrapper-checked:not(.ant-radio-button-wrapper-disabled)':
|
||||
case '.ant-radio-button-wrapper-checked:not(.ant-radio-button-wrapper-disabled):hover':
|
||||
case '.ant-radio-button-wrapper-checked:not(.ant-radio-button-wrapper-disabled):active':
|
||||
return s;
|
||||
case '.ant-steps-item-icon > .ant-steps-icon':
|
||||
return s;
|
||||
case '.ant-select-item-option-selected:not(.ant-select-item-option-disabled)':
|
||||
return s;
|
||||
default:
|
||||
if (s.indexOf('.ant-btn') >= -1) {
|
||||
// 按钮被重新定制过,需要过滤掉class防止覆盖
|
||||
return s;
|
||||
}
|
||||
}
|
||||
return s.startsWith('[data-theme') ? s : `[data-theme] ${s}`;
|
||||
},
|
||||
colorVariables: [...getThemeColors(), ...colors],
|
||||
}),
|
||||
antdDarkThemePlugin({
|
||||
preloadFiles: [
|
||||
path.resolve(process.cwd(), 'node_modules/ant-design-vue/dist/antd.less'),
|
||||
//path.resolve(process.cwd(), 'node_modules/ant-design-vue/dist/antd.dark.less'),
|
||||
path.resolve(process.cwd(), 'src/design/index.less'),
|
||||
],
|
||||
filter: (id) => (isBuild ? !id.endsWith('antd.less') : true),
|
||||
// extractCss: false,
|
||||
darkModifyVars: {
|
||||
...generateModifyVars(true),
|
||||
'text-color': '#c9d1d9',
|
||||
'primary-1': 'rgb(255 255 255 / 8%)',
|
||||
'text-color-base': '#c9d1d9',
|
||||
'component-background': '#151515',
|
||||
'heading-color': 'rgb(255 255 255 / 65%)',
|
||||
// black: '#0e1117',
|
||||
// #8b949e
|
||||
'text-color-secondary': '#8b949e',
|
||||
'border-color-base': '#303030',
|
||||
// 'border-color-split': '#30363d',
|
||||
'item-active-bg': '#111b26',
|
||||
'app-content-background': '#1e1e1e',
|
||||
'tree-node-selected-bg': '#11263c',
|
||||
|
||||
'alert-success-border-color': '#274916',
|
||||
'alert-success-bg-color': '#162312',
|
||||
'alert-success-icon-color': '#49aa19',
|
||||
'alert-info-border-color': '#153450',
|
||||
'alert-info-bg-color': '#111b26',
|
||||
'alert-info-icon-color': '#177ddc',
|
||||
'alert-warning-border-color': '#594214',
|
||||
'alert-warning-bg-color': '#2b2111',
|
||||
'alert-warning-icon-color': '#d89614',
|
||||
'alert-error-border-color': '#58181c',
|
||||
'alert-error-bg-color': '#2a1215',
|
||||
'alert-error-icon-color': '#a61d24',
|
||||
},
|
||||
}),
|
||||
];
|
||||
|
||||
return plugin as unknown as PluginOption[];
|
||||
}
|
@@ -173,14 +173,13 @@
|
||||
"stylelint-order": "^5.0.0",
|
||||
"ts-node": "^10.7.0",
|
||||
"typescript": "^4.6.3",
|
||||
"vite": "^2.9.5",
|
||||
"vite": "^4.3.0-beta.1",
|
||||
"vite-plugin-compression": "^0.5.1",
|
||||
"vite-plugin-html": "^3.2.0",
|
||||
"vite-plugin-mkcert": "^1.6.0",
|
||||
"vite-plugin-mock": "^2.9.6",
|
||||
"vite-plugin-purge-icons": "^0.8.1",
|
||||
"vite-plugin-svg-icons": "^2.0.1",
|
||||
"vite-plugin-theme": "^0.8.6",
|
||||
"vite-plugin-windicss": "^1.8.4",
|
||||
"vue-eslint-parser": "^8.3.0",
|
||||
"vue-tsc": "^1.0.9"
|
||||
|
343
pnpm-lock.yaml
generated
343
pnpm-lock.yaml
generated
@@ -190,7 +190,7 @@ importers:
|
||||
version: 5.20.0(eslint@8.13.0)(typescript@4.6.3)
|
||||
'@vitejs/plugin-vue':
|
||||
specifier: ^2.3.1
|
||||
version: 2.3.1(vite@2.9.5)(vue@3.2.47)
|
||||
version: 2.3.1(vite@4.3.0-beta.1)(vue@3.2.47)
|
||||
'@vitejs/plugin-vue-jsx':
|
||||
specifier: ^1.3.10
|
||||
version: 1.3.10
|
||||
@@ -303,32 +303,29 @@ importers:
|
||||
specifier: ^4.6.3
|
||||
version: 4.6.3
|
||||
vite:
|
||||
specifier: ^2.9.5
|
||||
version: 2.9.5(less@4.1.2)(sass@1.57.1)
|
||||
specifier: ^4.3.0-beta.1
|
||||
version: 4.3.0-beta.1(@types/node@17.0.25)(less@4.1.2)(sass@1.57.1)
|
||||
vite-plugin-compression:
|
||||
specifier: ^0.5.1
|
||||
version: 0.5.1(vite@2.9.5)
|
||||
version: 0.5.1(vite@4.3.0-beta.1)
|
||||
vite-plugin-html:
|
||||
specifier: ^3.2.0
|
||||
version: 3.2.0(vite@2.9.5)
|
||||
version: 3.2.0(vite@4.3.0-beta.1)
|
||||
vite-plugin-mkcert:
|
||||
specifier: ^1.6.0
|
||||
version: 1.6.0
|
||||
vite-plugin-mock:
|
||||
specifier: ^2.9.6
|
||||
version: 2.9.6(mockjs@1.1.0)(rollup@2.70.2)(vite@2.9.5)
|
||||
version: 2.9.6(mockjs@1.1.0)(rollup@2.70.2)(vite@4.3.0-beta.1)
|
||||
vite-plugin-purge-icons:
|
||||
specifier: ^0.8.1
|
||||
version: 0.8.1(vite@2.9.5)
|
||||
version: 0.8.1(vite@4.3.0-beta.1)
|
||||
vite-plugin-svg-icons:
|
||||
specifier: ^2.0.1
|
||||
version: 2.0.1(vite@2.9.5)
|
||||
vite-plugin-theme:
|
||||
specifier: ^0.8.6
|
||||
version: 0.8.6(vite@2.9.5)
|
||||
version: 2.0.1(vite@4.3.0-beta.1)
|
||||
vite-plugin-windicss:
|
||||
specifier: ^1.8.4
|
||||
version: 1.8.4(vite@2.9.5)
|
||||
version: 1.8.4(vite@4.3.0-beta.1)
|
||||
vue-eslint-parser:
|
||||
specifier: ^8.3.0
|
||||
version: 8.3.0(eslint@8.13.0)
|
||||
@@ -951,15 +948,6 @@ packages:
|
||||
dev: true
|
||||
optional: true
|
||||
|
||||
/@esbuild/linux-loong64@0.14.54:
|
||||
resolution: {integrity: sha512-bZBrLAIX1kpWelV0XemxBZllyRmM6vgFQQG2GdNb+r3Fkp0FOh1NJSvekXDs7jq70k4euu1cryLMfU+mTXlEpw==}
|
||||
engines: {node: '>=12'}
|
||||
cpu: [loong64]
|
||||
os: [linux]
|
||||
requiresBuild: true
|
||||
dev: true
|
||||
optional: true
|
||||
|
||||
/@esbuild/linux-loong64@0.17.14:
|
||||
resolution: {integrity: sha512-vp15H+5NR6hubNgMluqqKza85HcGJgq7t6rMH7O3Y6ApiOWPkvW2AJfNojUQimfTp6OUrACUXfR4hmpcENXoMQ==}
|
||||
engines: {node: '>=12'}
|
||||
@@ -1547,6 +1535,7 @@ packages:
|
||||
|
||||
/@types/node@14.18.42:
|
||||
resolution: {integrity: sha512-xefu+RBie4xWlK8hwAzGh3npDz/4VhF6icY/shU+zv/1fNn+ZVG7T7CRwe9LId9sAYRPxI+59QBPuKL3WpyGRg==}
|
||||
dev: false
|
||||
|
||||
/@types/node@17.0.25:
|
||||
resolution: {integrity: sha512-wANk6fBrUwdpY4isjWrKTufkrXdu1D2YHCot2fD/DfWxF5sMrVSA+KN7ydckvaTCh0HiqX9IVl0L5/ZoXg5M7w==}
|
||||
@@ -1606,10 +1595,6 @@ packages:
|
||||
'@types/node': 17.0.25
|
||||
dev: true
|
||||
|
||||
/@types/tinycolor2@1.4.3:
|
||||
resolution: {integrity: sha512-Kf1w9NE5HEgGxCRyIcRXR/ZYtDv0V8FVPtYHwLxl0O+maGX0erE77pQlD0gpP+/KByMZ87mOA79SjifhSB3PjQ==}
|
||||
dev: true
|
||||
|
||||
/@typescript-eslint/eslint-plugin@5.20.0(@typescript-eslint/parser@5.20.0)(eslint@8.13.0)(typescript@4.6.3):
|
||||
resolution: {integrity: sha512-fapGzoxilCn3sBtC6NtXZX6+P/Hef7VDbyfGqTTpzYydwhlkevB+0vE0EnmHPVTVSy68GUncyJ/2PcrFBeCo5Q==}
|
||||
engines: {node: ^12.22.0 || ^14.17.0 || >=16.0.0}
|
||||
@@ -1750,14 +1735,14 @@ packages:
|
||||
- supports-color
|
||||
dev: true
|
||||
|
||||
/@vitejs/plugin-vue@2.3.1(vite@2.9.5)(vue@3.2.47):
|
||||
/@vitejs/plugin-vue@2.3.1(vite@4.3.0-beta.1)(vue@3.2.47):
|
||||
resolution: {integrity: sha512-YNzBt8+jt6bSwpt7LP890U1UcTOIZZxfpE5WOJ638PNxSEKOqAi0+FSKS0nVeukfdZ0Ai/H7AFd6k3hayfGZqQ==}
|
||||
engines: {node: '>=12.0.0'}
|
||||
peerDependencies:
|
||||
vite: ^2.5.10
|
||||
vue: ^3.2.25
|
||||
dependencies:
|
||||
vite: 2.9.5(less@4.1.2)(sass@1.57.1)
|
||||
vite: 4.3.0-beta.1(@types/node@17.0.25)(less@4.1.2)(sass@1.57.1)
|
||||
vue: 3.2.47
|
||||
dev: true
|
||||
|
||||
@@ -3506,160 +3491,12 @@ packages:
|
||||
is-symbol: 1.0.4
|
||||
dev: true
|
||||
|
||||
/esbuild-android-64@0.14.54:
|
||||
resolution: {integrity: sha512-Tz2++Aqqz0rJ7kYBfz+iqyE3QMycD4vk7LBRyWaAVFgFtQ/O8EJOnVmTOiDWYZ/uYzB4kvP+bqejYdVKzE5lAQ==}
|
||||
engines: {node: '>=12'}
|
||||
cpu: [x64]
|
||||
os: [android]
|
||||
requiresBuild: true
|
||||
dev: true
|
||||
optional: true
|
||||
|
||||
/esbuild-android-arm64@0.14.54:
|
||||
resolution: {integrity: sha512-F9E+/QDi9sSkLaClO8SOV6etqPd+5DgJje1F9lOWoNncDdOBL2YF59IhsWATSt0TLZbYCf3pNlTHvVV5VfHdvg==}
|
||||
engines: {node: '>=12'}
|
||||
cpu: [arm64]
|
||||
os: [android]
|
||||
requiresBuild: true
|
||||
dev: true
|
||||
optional: true
|
||||
|
||||
/esbuild-darwin-64@0.14.54:
|
||||
resolution: {integrity: sha512-jtdKWV3nBviOd5v4hOpkVmpxsBy90CGzebpbO9beiqUYVMBtSc0AL9zGftFuBon7PNDcdvNCEuQqw2x0wP9yug==}
|
||||
engines: {node: '>=12'}
|
||||
cpu: [x64]
|
||||
os: [darwin]
|
||||
requiresBuild: true
|
||||
dev: true
|
||||
optional: true
|
||||
|
||||
/esbuild-darwin-arm64@0.14.54:
|
||||
resolution: {integrity: sha512-OPafJHD2oUPyvJMrsCvDGkRrVCar5aVyHfWGQzY1dWnzErjrDuSETxwA2HSsyg2jORLY8yBfzc1MIpUkXlctmw==}
|
||||
engines: {node: '>=12'}
|
||||
cpu: [arm64]
|
||||
os: [darwin]
|
||||
requiresBuild: true
|
||||
dev: true
|
||||
optional: true
|
||||
|
||||
/esbuild-freebsd-64@0.14.54:
|
||||
resolution: {integrity: sha512-OKwd4gmwHqOTp4mOGZKe/XUlbDJ4Q9TjX0hMPIDBUWWu/kwhBAudJdBoxnjNf9ocIB6GN6CPowYpR/hRCbSYAg==}
|
||||
engines: {node: '>=12'}
|
||||
cpu: [x64]
|
||||
os: [freebsd]
|
||||
requiresBuild: true
|
||||
dev: true
|
||||
optional: true
|
||||
|
||||
/esbuild-freebsd-arm64@0.14.54:
|
||||
resolution: {integrity: sha512-sFwueGr7OvIFiQT6WeG0jRLjkjdqWWSrfbVwZp8iMP+8UHEHRBvlaxL6IuKNDwAozNUmbb8nIMXa7oAOARGs1Q==}
|
||||
engines: {node: '>=12'}
|
||||
cpu: [arm64]
|
||||
os: [freebsd]
|
||||
requiresBuild: true
|
||||
dev: true
|
||||
optional: true
|
||||
|
||||
/esbuild-linux-32@0.14.54:
|
||||
resolution: {integrity: sha512-1ZuY+JDI//WmklKlBgJnglpUL1owm2OX+8E1syCD6UAxcMM/XoWd76OHSjl/0MR0LisSAXDqgjT3uJqT67O3qw==}
|
||||
engines: {node: '>=12'}
|
||||
cpu: [ia32]
|
||||
os: [linux]
|
||||
requiresBuild: true
|
||||
dev: true
|
||||
optional: true
|
||||
|
||||
/esbuild-linux-64@0.14.54:
|
||||
resolution: {integrity: sha512-EgjAgH5HwTbtNsTqQOXWApBaPVdDn7XcK+/PtJwZLT1UmpLoznPd8c5CxqsH2dQK3j05YsB3L17T8vE7cp4cCg==}
|
||||
engines: {node: '>=12'}
|
||||
cpu: [x64]
|
||||
os: [linux]
|
||||
requiresBuild: true
|
||||
dev: true
|
||||
optional: true
|
||||
|
||||
/esbuild-linux-arm64@0.14.54:
|
||||
resolution: {integrity: sha512-WL71L+0Rwv+Gv/HTmxTEmpv0UgmxYa5ftZILVi2QmZBgX3q7+tDeOQNqGtdXSdsL8TQi1vIaVFHUPDe0O0kdig==}
|
||||
engines: {node: '>=12'}
|
||||
cpu: [arm64]
|
||||
os: [linux]
|
||||
requiresBuild: true
|
||||
dev: true
|
||||
optional: true
|
||||
|
||||
/esbuild-linux-arm@0.14.54:
|
||||
resolution: {integrity: sha512-qqz/SjemQhVMTnvcLGoLOdFpCYbz4v4fUo+TfsWG+1aOu70/80RV6bgNpR2JCrppV2moUQkww+6bWxXRL9YMGw==}
|
||||
engines: {node: '>=12'}
|
||||
cpu: [arm]
|
||||
os: [linux]
|
||||
requiresBuild: true
|
||||
dev: true
|
||||
optional: true
|
||||
|
||||
/esbuild-linux-mips64le@0.14.54:
|
||||
resolution: {integrity: sha512-qTHGQB8D1etd0u1+sB6p0ikLKRVuCWhYQhAHRPkO+OF3I/iSlTKNNS0Lh2Oc0g0UFGguaFZZiPJdJey3AGpAlw==}
|
||||
engines: {node: '>=12'}
|
||||
cpu: [mips64el]
|
||||
os: [linux]
|
||||
requiresBuild: true
|
||||
dev: true
|
||||
optional: true
|
||||
|
||||
/esbuild-linux-ppc64le@0.14.54:
|
||||
resolution: {integrity: sha512-j3OMlzHiqwZBDPRCDFKcx595XVfOfOnv68Ax3U4UKZ3MTYQB5Yz3X1mn5GnodEVYzhtZgxEBidLWeIs8FDSfrQ==}
|
||||
engines: {node: '>=12'}
|
||||
cpu: [ppc64]
|
||||
os: [linux]
|
||||
requiresBuild: true
|
||||
dev: true
|
||||
optional: true
|
||||
|
||||
/esbuild-linux-riscv64@0.14.54:
|
||||
resolution: {integrity: sha512-y7Vt7Wl9dkOGZjxQZnDAqqn+XOqFD7IMWiewY5SPlNlzMX39ocPQlOaoxvT4FllA5viyV26/QzHtvTjVNOxHZg==}
|
||||
engines: {node: '>=12'}
|
||||
cpu: [riscv64]
|
||||
os: [linux]
|
||||
requiresBuild: true
|
||||
dev: true
|
||||
optional: true
|
||||
|
||||
/esbuild-linux-s390x@0.14.54:
|
||||
resolution: {integrity: sha512-zaHpW9dziAsi7lRcyV4r8dhfG1qBidQWUXweUjnw+lliChJqQr+6XD71K41oEIC3Mx1KStovEmlzm+MkGZHnHA==}
|
||||
engines: {node: '>=12'}
|
||||
cpu: [s390x]
|
||||
os: [linux]
|
||||
requiresBuild: true
|
||||
dev: true
|
||||
optional: true
|
||||
|
||||
/esbuild-netbsd-64@0.14.54:
|
||||
resolution: {integrity: sha512-PR01lmIMnfJTgeU9VJTDY9ZerDWVFIUzAtJuDHwwceppW7cQWjBBqP48NdeRtoP04/AtO9a7w3viI+PIDr6d+w==}
|
||||
engines: {node: '>=12'}
|
||||
cpu: [x64]
|
||||
os: [netbsd]
|
||||
requiresBuild: true
|
||||
dev: true
|
||||
optional: true
|
||||
|
||||
/esbuild-node-loader@0.6.5:
|
||||
resolution: {integrity: sha512-uPP+dllWm38cFvDysdocutN3lfe5pTIbddAHp1ENyLzpHYqE2r+3Wo+pfg9X3p8DFWwzIisft5YkeBIthIcixw==}
|
||||
dependencies:
|
||||
esbuild: 0.17.14
|
||||
dev: true
|
||||
|
||||
/esbuild-openbsd-64@0.14.54:
|
||||
resolution: {integrity: sha512-Qyk7ikT2o7Wu76UsvvDS5q0amJvmRzDyVlL0qf5VLsLchjCa1+IAvd8kTBgUxD7VBUUVgItLkk609ZHUc1oCaw==}
|
||||
engines: {node: '>=12'}
|
||||
cpu: [x64]
|
||||
os: [openbsd]
|
||||
requiresBuild: true
|
||||
dev: true
|
||||
optional: true
|
||||
|
||||
/esbuild-plugin-alias@0.1.2:
|
||||
resolution: {integrity: sha512-WsX0OJy8IGOsGZV+4oHEU5B6XQUpxOsZN1iSoYf9COTDbY7WXcOwd1oCLYNWUIWCExyGXSghIGq2k7sXBldxwQ==}
|
||||
dev: true
|
||||
|
||||
/esbuild-register@3.4.2(esbuild@0.17.14):
|
||||
resolution: {integrity: sha512-kG/XyTDyz6+YDuyfB9ZoSIOOmgyFCH+xPRtsCa8W85HLRV5Csp+o3jWVbOSHgSLfyLc5DmP+KFDNwty4mEjC+Q==}
|
||||
peerDependencies:
|
||||
@@ -3671,83 +3508,12 @@ packages:
|
||||
- supports-color
|
||||
dev: true
|
||||
|
||||
/esbuild-sunos-64@0.14.54:
|
||||
resolution: {integrity: sha512-28GZ24KmMSeKi5ueWzMcco6EBHStL3B6ubM7M51RmPwXQGLe0teBGJocmWhgwccA1GeFXqxzILIxXpHbl9Q/Kw==}
|
||||
engines: {node: '>=12'}
|
||||
cpu: [x64]
|
||||
os: [sunos]
|
||||
requiresBuild: true
|
||||
dev: true
|
||||
optional: true
|
||||
|
||||
/esbuild-windows-32@0.14.54:
|
||||
resolution: {integrity: sha512-T+rdZW19ql9MjS7pixmZYVObd9G7kcaZo+sETqNH4RCkuuYSuv9AGHUVnPoP9hhuE1WM1ZimHz1CIBHBboLU7w==}
|
||||
engines: {node: '>=12'}
|
||||
cpu: [ia32]
|
||||
os: [win32]
|
||||
requiresBuild: true
|
||||
dev: true
|
||||
optional: true
|
||||
|
||||
/esbuild-windows-64@0.14.54:
|
||||
resolution: {integrity: sha512-AoHTRBUuYwXtZhjXZbA1pGfTo8cJo3vZIcWGLiUcTNgHpJJMC1rVA44ZereBHMJtotyN71S8Qw0npiCIkW96cQ==}
|
||||
engines: {node: '>=12'}
|
||||
cpu: [x64]
|
||||
os: [win32]
|
||||
requiresBuild: true
|
||||
dev: true
|
||||
optional: true
|
||||
|
||||
/esbuild-windows-arm64@0.14.54:
|
||||
resolution: {integrity: sha512-M0kuUvXhot1zOISQGXwWn6YtS+Y/1RT9WrVIOywZnJHo3jCDyewAc79aKNQWFCQm+xNHVTq9h8dZKvygoXQQRg==}
|
||||
engines: {node: '>=12'}
|
||||
cpu: [arm64]
|
||||
os: [win32]
|
||||
requiresBuild: true
|
||||
dev: true
|
||||
optional: true
|
||||
|
||||
/esbuild@0.11.23:
|
||||
resolution: {integrity: sha512-iaiZZ9vUF5wJV8ob1tl+5aJTrwDczlvGP0JoMmnpC2B0ppiMCu8n8gmy5ZTGl5bcG081XBVn+U+jP+mPFm5T5Q==}
|
||||
hasBin: true
|
||||
requiresBuild: true
|
||||
dev: true
|
||||
|
||||
/esbuild@0.11.3:
|
||||
resolution: {integrity: sha512-BzVRHcCtFepjS9WcqRjqoIxLqgpK21a8J4Zi4msSGxDxiXVO1IbcqT1KjhdDDnJxKfe7bvzZrvMEX+bVO0Elcw==}
|
||||
hasBin: true
|
||||
requiresBuild: true
|
||||
dev: true
|
||||
|
||||
/esbuild@0.14.54:
|
||||
resolution: {integrity: sha512-Cy9llcy8DvET5uznocPyqL3BFRrFXSVqbgpMJ9Wz8oVjZlh/zUSNbPRbov0VX7VxN2JH1Oa0uNxZ7eLRb62pJA==}
|
||||
engines: {node: '>=12'}
|
||||
hasBin: true
|
||||
requiresBuild: true
|
||||
optionalDependencies:
|
||||
'@esbuild/linux-loong64': 0.14.54
|
||||
esbuild-android-64: 0.14.54
|
||||
esbuild-android-arm64: 0.14.54
|
||||
esbuild-darwin-64: 0.14.54
|
||||
esbuild-darwin-arm64: 0.14.54
|
||||
esbuild-freebsd-64: 0.14.54
|
||||
esbuild-freebsd-arm64: 0.14.54
|
||||
esbuild-linux-32: 0.14.54
|
||||
esbuild-linux-64: 0.14.54
|
||||
esbuild-linux-arm: 0.14.54
|
||||
esbuild-linux-arm64: 0.14.54
|
||||
esbuild-linux-mips64le: 0.14.54
|
||||
esbuild-linux-ppc64le: 0.14.54
|
||||
esbuild-linux-riscv64: 0.14.54
|
||||
esbuild-linux-s390x: 0.14.54
|
||||
esbuild-netbsd-64: 0.14.54
|
||||
esbuild-openbsd-64: 0.14.54
|
||||
esbuild-sunos-64: 0.14.54
|
||||
esbuild-windows-32: 0.14.54
|
||||
esbuild-windows-64: 0.14.54
|
||||
esbuild-windows-arm64: 0.14.54
|
||||
dev: true
|
||||
|
||||
/esbuild@0.17.14:
|
||||
resolution: {integrity: sha512-vOO5XhmVj/1XQR9NQ1UPq6qvMYL7QFJU57J5fKBKBKxp17uDt5PgxFDb4A2nEiXhr1qQs4x0F5+66hVVw4ruNw==}
|
||||
engines: {node: '>=12'}
|
||||
@@ -6249,6 +6015,15 @@ packages:
|
||||
picocolors: 1.0.0
|
||||
source-map-js: 1.0.2
|
||||
|
||||
/postcss@8.4.21:
|
||||
resolution: {integrity: sha512-tP7u/Sn/dVxK2NnruI4H9BG+x+Wxz6oeZ1cJ8P6G/PZY0IKk4k/63TDsQf2kQq3+qoJeLm2kIBUNlZe3zgb4Zg==}
|
||||
engines: {node: ^10 || ^12 || >=14}
|
||||
dependencies:
|
||||
nanoid: 3.3.6
|
||||
picocolors: 1.0.0
|
||||
source-map-js: 1.0.2
|
||||
dev: true
|
||||
|
||||
/posthtml-parser@0.2.1:
|
||||
resolution: {integrity: sha512-nPC53YMqJnc/+1x4fRYFfm81KV2V+G9NZY+hTohpYg64Ay7NemWWcV4UWuy/SgMupqQ3kJ88M/iRfZmSnxT+pw==}
|
||||
dependencies:
|
||||
@@ -6596,6 +6371,14 @@ packages:
|
||||
fsevents: 2.3.2
|
||||
dev: true
|
||||
|
||||
/rollup@3.20.2:
|
||||
resolution: {integrity: sha512-3zwkBQl7Ai7MFYQE0y1MeQ15+9jsi7XxfrqwTb/9EK8D9C9+//EBR4M+CuA1KODRaNbFez/lWxA5vhEGZp4MUg==}
|
||||
engines: {node: '>=14.18.0', npm: '>=8.0.0'}
|
||||
hasBin: true
|
||||
optionalDependencies:
|
||||
fsevents: 2.3.2
|
||||
dev: true
|
||||
|
||||
/run-async@2.4.1:
|
||||
resolution: {integrity: sha512-tvVnVv01b8c1RrA6Ep7JkStj85Guv/YrMcwqYQnwjsAS2cTmmPGBBjAjpCW7RrSodNSoE2/qg9O4bceNvUuDgQ==}
|
||||
engines: {node: '>=0.12.0'}
|
||||
@@ -7328,10 +7111,6 @@ packages:
|
||||
resolution: {integrity: sha512-w89qg7PI8wAdvX60bMDP+bFoD5Dvhm9oLheFp5O4a2QF0cSBGsBX4qZmadPMvVqlLJBBci+WqGGOAPvcDeNSVg==}
|
||||
dev: true
|
||||
|
||||
/tinycolor2@1.6.0:
|
||||
resolution: {integrity: sha512-XPaBkWQJdsf3pLKJV9p4qN/S+fm2Oj8AIPo1BTUhg5oxkvm9+SVEGFdhyOz7tTdUTfvxMiAs4sp6/eZO2Ew+pw==}
|
||||
dev: true
|
||||
|
||||
/tinymce@5.10.7:
|
||||
resolution: {integrity: sha512-9UUjaO0R7FxcFo0oxnd1lMs7H+D0Eh+dDVo5hKbVe1a+VB0nit97vOqlinj+YwgoBDt6/DSCUoWqAYlLI8BLYA==}
|
||||
dev: false
|
||||
@@ -7668,7 +7447,7 @@ packages:
|
||||
diff-match-patch: 1.0.5
|
||||
dev: false
|
||||
|
||||
/vite-plugin-compression@0.5.1(vite@2.9.5):
|
||||
/vite-plugin-compression@0.5.1(vite@4.3.0-beta.1):
|
||||
resolution: {integrity: sha512-5QJKBDc+gNYVqL/skgFAP81Yuzo9R+EAf19d+EtsMF/i8kFUpNi3J/H01QD3Oo8zBQn+NzoCIFkpPLynoOzaJg==}
|
||||
peerDependencies:
|
||||
vite: '>=2.0.0'
|
||||
@@ -7676,12 +7455,12 @@ packages:
|
||||
chalk: 4.1.2
|
||||
debug: 4.3.4(supports-color@9.3.1)
|
||||
fs-extra: 10.1.0
|
||||
vite: 2.9.5(less@4.1.2)(sass@1.57.1)
|
||||
vite: 4.3.0-beta.1(@types/node@17.0.25)(less@4.1.2)(sass@1.57.1)
|
||||
transitivePeerDependencies:
|
||||
- supports-color
|
||||
dev: true
|
||||
|
||||
/vite-plugin-html@3.2.0(vite@2.9.5):
|
||||
/vite-plugin-html@3.2.0(vite@4.3.0-beta.1):
|
||||
resolution: {integrity: sha512-2VLCeDiHmV/BqqNn5h2V+4280KRgQzCFN47cst3WiNK848klESPQnzuC3okH5XHtgwHH/6s1Ho/YV6yIO0pgoQ==}
|
||||
peerDependencies:
|
||||
vite: '>=2.0.0'
|
||||
@@ -7698,7 +7477,7 @@ packages:
|
||||
html-minifier-terser: 6.1.0
|
||||
node-html-parser: 5.4.2
|
||||
pathe: 0.2.0
|
||||
vite: 2.9.5(less@4.1.2)(sass@1.57.1)
|
||||
vite: 4.3.0-beta.1(@types/node@17.0.25)(less@4.1.2)(sass@1.57.1)
|
||||
dev: true
|
||||
|
||||
/vite-plugin-mkcert@1.6.0:
|
||||
@@ -7713,7 +7492,7 @@ packages:
|
||||
- supports-color
|
||||
dev: true
|
||||
|
||||
/vite-plugin-mock@2.9.6(mockjs@1.1.0)(rollup@2.70.2)(vite@2.9.5):
|
||||
/vite-plugin-mock@2.9.6(mockjs@1.1.0)(rollup@2.70.2)(vite@4.3.0-beta.1):
|
||||
resolution: {integrity: sha512-/Rm59oPppe/ncbkSrUuAxIQihlI2YcBmnbR4ST1RA2VzM1C0tEQc1KlbQvnUGhXECAGTaQN2JyasiwXP6EtKgg==}
|
||||
engines: {node: '>=12.0.0'}
|
||||
peerDependencies:
|
||||
@@ -7730,13 +7509,13 @@ packages:
|
||||
fast-glob: 3.2.12
|
||||
mockjs: 1.1.0
|
||||
path-to-regexp: 6.2.0
|
||||
vite: 2.9.5(less@4.1.2)(sass@1.57.1)
|
||||
vite: 4.3.0-beta.1(@types/node@17.0.25)(less@4.1.2)(sass@1.57.1)
|
||||
transitivePeerDependencies:
|
||||
- rollup
|
||||
- supports-color
|
||||
dev: true
|
||||
|
||||
/vite-plugin-purge-icons@0.8.1(vite@2.9.5):
|
||||
/vite-plugin-purge-icons@0.8.1(vite@4.3.0-beta.1):
|
||||
resolution: {integrity: sha512-H77YDvECkdzwsgYTu6LR5Nx0wey5Hporw+3/hTYTZh7D7YcarS+RsOvpUEgd2XG5fChgCmMBtMfnr2JmrNanSg==}
|
||||
engines: {node: '>= 12'}
|
||||
peerDependencies:
|
||||
@@ -7745,13 +7524,13 @@ packages:
|
||||
'@purge-icons/core': 0.8.0
|
||||
'@purge-icons/generated': 0.8.1
|
||||
rollup-plugin-purge-icons: 0.8.1
|
||||
vite: 2.9.5(less@4.1.2)(sass@1.57.1)
|
||||
vite: 4.3.0-beta.1(@types/node@17.0.25)(less@4.1.2)(sass@1.57.1)
|
||||
transitivePeerDependencies:
|
||||
- encoding
|
||||
- supports-color
|
||||
dev: true
|
||||
|
||||
/vite-plugin-svg-icons@2.0.1(vite@2.9.5):
|
||||
/vite-plugin-svg-icons@2.0.1(vite@4.3.0-beta.1):
|
||||
resolution: {integrity: sha512-6ktD+DhV6Rz3VtedYvBKKVA2eXF+sAQVaKkKLDSqGUfnhqXl3bj5PPkVTl3VexfTuZy66PmINi8Q6eFnVfRUmA==}
|
||||
peerDependencies:
|
||||
vite: '>=2.0.0'
|
||||
@@ -7764,30 +7543,12 @@ packages:
|
||||
pathe: 0.2.0
|
||||
svg-baker: 1.7.0
|
||||
svgo: 2.8.0
|
||||
vite: 2.9.5(less@4.1.2)(sass@1.57.1)
|
||||
vite: 4.3.0-beta.1(@types/node@17.0.25)(less@4.1.2)(sass@1.57.1)
|
||||
transitivePeerDependencies:
|
||||
- supports-color
|
||||
dev: true
|
||||
|
||||
/vite-plugin-theme@0.8.6(vite@2.9.5):
|
||||
resolution: {integrity: sha512-GyoP9JjGkF106AawBh1kvw2eQZ/CCPeZKN5p5XhQe1ah1LO7A/6aVGY5gYGWk2qHG9nXpM1IvxjdbMsg94bvYg==}
|
||||
peerDependencies:
|
||||
vite: '>=2.0.0-beta.49'
|
||||
dependencies:
|
||||
'@types/node': 14.18.42
|
||||
'@types/tinycolor2': 1.4.3
|
||||
chalk: 4.1.2
|
||||
clean-css: 5.3.2
|
||||
debug: 4.3.4(supports-color@9.3.1)
|
||||
esbuild: 0.11.23
|
||||
esbuild-plugin-alias: 0.1.2
|
||||
tinycolor2: 1.6.0
|
||||
vite: 2.9.5(less@4.1.2)(sass@1.57.1)
|
||||
transitivePeerDependencies:
|
||||
- supports-color
|
||||
dev: true
|
||||
|
||||
/vite-plugin-windicss@1.8.4(vite@2.9.5):
|
||||
/vite-plugin-windicss@1.8.4(vite@4.3.0-beta.1):
|
||||
resolution: {integrity: sha512-LSZAO8BZn3x406GRbYX5t5ONXXJVdqiQtN1qrznLA/Dy5/NzZVhfcrL6N1qEYYO7HsCDT4pLAjTzObvDnM9Y8A==}
|
||||
peerDependencies:
|
||||
vite: ^2.0.1
|
||||
@@ -7795,33 +7556,43 @@ packages:
|
||||
'@windicss/plugin-utils': 1.8.4
|
||||
debug: 4.3.4(supports-color@9.3.1)
|
||||
kolorist: 1.7.0
|
||||
vite: 2.9.5(less@4.1.2)(sass@1.57.1)
|
||||
vite: 4.3.0-beta.1(@types/node@17.0.25)(less@4.1.2)(sass@1.57.1)
|
||||
windicss: 3.5.6
|
||||
transitivePeerDependencies:
|
||||
- supports-color
|
||||
dev: true
|
||||
|
||||
/vite@2.9.5(less@4.1.2)(sass@1.57.1):
|
||||
resolution: {integrity: sha512-dvMN64X2YEQgSXF1lYabKXw3BbN6e+BL67+P3Vy4MacnY+UzT1AfkHiioFSi9+uiDUiaDy7Ax/LQqivk6orilg==}
|
||||
engines: {node: '>=12.2.0'}
|
||||
/vite@4.3.0-beta.1(@types/node@17.0.25)(less@4.1.2)(sass@1.57.1):
|
||||
resolution: {integrity: sha512-D4j9bail/S/OopyozlmQv7zPxf0xwe0zgZTkOAT61yD0lCUF29GgarhU6Z2hPEXelQyKGYyPFwUmuUX4tze9sA==}
|
||||
engines: {node: ^14.18.0 || >=16.0.0}
|
||||
hasBin: true
|
||||
peerDependencies:
|
||||
'@types/node': '>= 14'
|
||||
less: '*'
|
||||
sass: '*'
|
||||
stylus: '*'
|
||||
sugarss: '*'
|
||||
terser: ^5.4.0
|
||||
peerDependenciesMeta:
|
||||
'@types/node':
|
||||
optional: true
|
||||
less:
|
||||
optional: true
|
||||
sass:
|
||||
optional: true
|
||||
stylus:
|
||||
optional: true
|
||||
sugarss:
|
||||
optional: true
|
||||
terser:
|
||||
optional: true
|
||||
dependencies:
|
||||
esbuild: 0.14.54
|
||||
'@types/node': 17.0.25
|
||||
esbuild: 0.17.14
|
||||
less: 4.1.2
|
||||
postcss: 8.4.12
|
||||
postcss: 8.4.21
|
||||
resolve: 1.22.1
|
||||
rollup: 2.70.2
|
||||
rollup: 3.20.2
|
||||
sass: 1.57.1
|
||||
optionalDependencies:
|
||||
fsevents: 2.3.2
|
||||
|
@@ -4,7 +4,7 @@ import appLogo from './src/AppLogo.vue';
|
||||
import appProvider from './src/AppProvider.vue';
|
||||
import appSearch from './src/search/AppSearch.vue';
|
||||
import appLocalePicker from './src/AppLocalePicker.vue';
|
||||
import appDarkModeToggle from './src/AppDarkModeToggle.vue';
|
||||
// import appDarkModeToggle from './src/AppDarkModeToggle.vue';
|
||||
|
||||
export { useAppProviderContext } from './src/useAppContext';
|
||||
|
||||
@@ -12,4 +12,4 @@ export const AppLogo = withInstall(appLogo);
|
||||
export const AppProvider = withInstall(appProvider);
|
||||
export const AppSearch = withInstall(appSearch);
|
||||
export const AppLocalePicker = withInstall(appLocalePicker);
|
||||
export const AppDarkModeToggle = withInstall(appDarkModeToggle);
|
||||
// export const AppDarkModeToggle = withInstall(appDarkModeToggle);
|
||||
|
@@ -3,14 +3,14 @@ import { BasicDrawer } from '/@/components/Drawer/index';
|
||||
import { Divider } from 'ant-design-vue';
|
||||
import {
|
||||
TypePicker,
|
||||
ThemeColorPicker,
|
||||
// ThemeColorPicker,
|
||||
SettingFooter,
|
||||
SwitchItem,
|
||||
SelectItem,
|
||||
InputNumberItem,
|
||||
} from './components';
|
||||
|
||||
import { AppDarkModeToggle } from '/@/components/Application';
|
||||
// import { AppDarkModeToggle } from '/@/components/Application';
|
||||
|
||||
import { MenuTypeEnum, TriggerEnum } from '/@/enums/menuEnum';
|
||||
|
||||
@@ -33,11 +33,11 @@ import {
|
||||
mixSidebarTriggerOptions,
|
||||
} from './enum';
|
||||
|
||||
import {
|
||||
HEADER_PRESET_BG_COLOR_LIST,
|
||||
SIDE_BAR_BG_COLOR_LIST,
|
||||
APP_PRESET_COLOR_LIST,
|
||||
} from '/@/settings/designSetting';
|
||||
// import {
|
||||
// HEADER_PRESET_BG_COLOR_LIST,
|
||||
// SIDE_BAR_BG_COLOR_LIST,
|
||||
// APP_PRESET_COLOR_LIST,
|
||||
// } from '/@/settings/designSetting';
|
||||
|
||||
const { t } = useI18n();
|
||||
|
||||
@@ -55,7 +55,7 @@ export default defineComponent({
|
||||
getGrayMode,
|
||||
getLockTime,
|
||||
getShowDarkModeToggle,
|
||||
getThemeColor,
|
||||
// getThemeColor,
|
||||
} = useRootSetting();
|
||||
|
||||
const { getOpenPageLoading, getBasicTransition, getEnableTransition, getOpenNProgress } =
|
||||
@@ -73,7 +73,7 @@ export default defineComponent({
|
||||
getTopMenuAlign,
|
||||
getAccordion,
|
||||
getMenuWidth,
|
||||
getMenuBgColor,
|
||||
// getMenuBgColor,
|
||||
getIsTopMenu,
|
||||
getSplit,
|
||||
getIsMixSidebar,
|
||||
@@ -85,7 +85,7 @@ export default defineComponent({
|
||||
const {
|
||||
getShowHeader,
|
||||
getFixed: getHeaderFixed,
|
||||
getHeaderBgColor,
|
||||
// getHeaderBgColor,
|
||||
getShowSearch,
|
||||
} = useHeaderSetting();
|
||||
|
||||
@@ -113,35 +113,35 @@ export default defineComponent({
|
||||
);
|
||||
}
|
||||
|
||||
function renderHeaderTheme() {
|
||||
return (
|
||||
<ThemeColorPicker
|
||||
colorList={HEADER_PRESET_BG_COLOR_LIST}
|
||||
def={unref(getHeaderBgColor)}
|
||||
event={HandlerEnum.HEADER_THEME}
|
||||
/>
|
||||
);
|
||||
}
|
||||
// function renderHeaderTheme() {
|
||||
// return (
|
||||
// <ThemeColorPicker
|
||||
// colorList={HEADER_PRESET_BG_COLOR_LIST}
|
||||
// def={unref(getHeaderBgColor)}
|
||||
// event={HandlerEnum.HEADER_THEME}
|
||||
// />
|
||||
// );
|
||||
// }
|
||||
|
||||
function renderSiderTheme() {
|
||||
return (
|
||||
<ThemeColorPicker
|
||||
colorList={SIDE_BAR_BG_COLOR_LIST}
|
||||
def={unref(getMenuBgColor)}
|
||||
event={HandlerEnum.MENU_THEME}
|
||||
/>
|
||||
);
|
||||
}
|
||||
// function renderSiderTheme() {
|
||||
// return (
|
||||
// <ThemeColorPicker
|
||||
// colorList={SIDE_BAR_BG_COLOR_LIST}
|
||||
// def={unref(getMenuBgColor)}
|
||||
// event={HandlerEnum.MENU_THEME}
|
||||
// />
|
||||
// );
|
||||
// }
|
||||
|
||||
function renderMainTheme() {
|
||||
return (
|
||||
<ThemeColorPicker
|
||||
colorList={APP_PRESET_COLOR_LIST}
|
||||
def={unref(getThemeColor)}
|
||||
event={HandlerEnum.CHANGE_THEME_COLOR}
|
||||
/>
|
||||
);
|
||||
}
|
||||
// function renderMainTheme() {
|
||||
// return (
|
||||
// <ThemeColorPicker
|
||||
// colorList={APP_PRESET_COLOR_LIST}
|
||||
// def={unref(getThemeColor)}
|
||||
// event={HandlerEnum.CHANGE_THEME_COLOR}
|
||||
// />
|
||||
// );
|
||||
// }
|
||||
|
||||
/**
|
||||
* @description:
|
||||
@@ -404,15 +404,15 @@ export default defineComponent({
|
||||
class="setting-drawer"
|
||||
>
|
||||
{unref(getShowDarkModeToggle) && <Divider>{() => t('layout.setting.darkMode')}</Divider>}
|
||||
{unref(getShowDarkModeToggle) && <AppDarkModeToggle class="mx-auto" />}
|
||||
{/* {unref(getShowDarkModeToggle) && <AppDarkModeToggle class="mx-auto" />} */}
|
||||
<Divider>{() => t('layout.setting.navMode')}</Divider>
|
||||
{renderSidebar()}
|
||||
<Divider>{() => t('layout.setting.sysTheme')}</Divider>
|
||||
{/* <Divider>{() => t('layout.setting.sysTheme')}</Divider>
|
||||
{renderMainTheme()}
|
||||
<Divider>{() => t('layout.setting.headerTheme')}</Divider>
|
||||
{renderHeaderTheme()}
|
||||
<Divider>{() => t('layout.setting.sidebarTheme')}</Divider>
|
||||
{renderSiderTheme()}
|
||||
{renderSiderTheme()} */}
|
||||
<Divider>{() => t('layout.setting.interfaceFunction')}</Divider>
|
||||
{renderFeatures()}
|
||||
<Divider>{() => t('layout.setting.interfaceDisplay')}</Divider>
|
||||
|
@@ -34,7 +34,6 @@
|
||||
import { updateColorWeak } from '/@/logics/theme/updateColorWeak';
|
||||
import { updateGrayMode } from '/@/logics/theme/updateGrayMode';
|
||||
import defaultSetting from '/@/settings/projectSetting';
|
||||
import { changeTheme } from '/@/logics/theme';
|
||||
import { updateSidebarBgColor } from '/@/logics/theme/updateBackground';
|
||||
|
||||
export default defineComponent({
|
||||
@@ -62,8 +61,7 @@
|
||||
function handleResetSetting() {
|
||||
try {
|
||||
appStore.setProjectConfig(defaultSetting);
|
||||
const { colorWeak, grayMode, themeColor } = defaultSetting;
|
||||
changeTheme(themeColor);
|
||||
const { colorWeak, grayMode } = defaultSetting;
|
||||
updateSidebarBgColor();
|
||||
updateColorWeak(colorWeak);
|
||||
updateGrayMode(grayMode);
|
||||
|
@@ -5,7 +5,6 @@ import { updateGrayMode } from '/@/logics/theme/updateGrayMode';
|
||||
|
||||
import { useAppStore } from '/@/store/modules/app';
|
||||
import { ProjectConfig } from '/#/config';
|
||||
import { changeTheme } from '/@/logics/theme';
|
||||
import { updateDarkTheme } from '/@/logics/theme/dark';
|
||||
import { useRootSetting } from '/@/hooks/setting/useRootSetting';
|
||||
|
||||
@@ -43,7 +42,6 @@ export function handler(event: HandlerEnum, value: any): DeepPartial<ProjectConf
|
||||
if (getThemeColor.value === value) {
|
||||
return {};
|
||||
}
|
||||
changeTheme(value);
|
||||
|
||||
return { themeColor: value };
|
||||
|
||||
|
@@ -10,14 +10,12 @@ import { updateHeaderBgColor, updateSidebarBgColor } from '/@/logics/theme/updat
|
||||
import { updateColorWeak } from '/@/logics/theme/updateColorWeak';
|
||||
import { updateGrayMode } from '/@/logics/theme/updateGrayMode';
|
||||
import { updateDarkTheme } from '/@/logics/theme/dark';
|
||||
import { changeTheme } from '/@/logics/theme';
|
||||
|
||||
import { useAppStore } from '/@/store/modules/app';
|
||||
import { useLocaleStore } from '/@/store/modules/locale';
|
||||
|
||||
import { getCommonStoragePrefix, getStorageShortName } from '/@/utils/env';
|
||||
|
||||
import { primaryColor } from '../../build/config/themeConfig';
|
||||
import { Persistent } from '/@/utils/cache/persistent';
|
||||
import { deepMerge } from '/@/utils';
|
||||
import { ThemeEnum } from '/@/enums/appEnum';
|
||||
@@ -32,16 +30,11 @@ export function initAppConfigStore() {
|
||||
const {
|
||||
colorWeak,
|
||||
grayMode,
|
||||
themeColor,
|
||||
|
||||
headerSetting: { bgColor: headerBgColor } = {},
|
||||
menuSetting: { bgColor } = {},
|
||||
} = projCfg;
|
||||
try {
|
||||
if (themeColor && themeColor !== primaryColor) {
|
||||
changeTheme(themeColor);
|
||||
}
|
||||
|
||||
grayMode && updateGrayMode(grayMode);
|
||||
colorWeak && updateColorWeak(colorWeak);
|
||||
} catch (error) {
|
||||
|
@@ -1,4 +1,3 @@
|
||||
import { darkCssIsReady, loadDarkThemeCss } from 'vite-plugin-theme/es/client';
|
||||
import { addClass, hasClass, removeClass } from '/@/utils/domUtils';
|
||||
|
||||
export async function updateDarkTheme(mode: string | null = 'light') {
|
||||
@@ -8,9 +7,6 @@ export async function updateDarkTheme(mode: string | null = 'light') {
|
||||
}
|
||||
const hasDarkClass = hasClass(htmlRoot, 'dark');
|
||||
if (mode === 'dark') {
|
||||
if (import.meta.env.PROD && !darkCssIsReady) {
|
||||
await loadDarkThemeCss();
|
||||
}
|
||||
htmlRoot.setAttribute('data-theme', 'dark');
|
||||
if (!hasDarkClass) {
|
||||
addClass(htmlRoot, 'dark');
|
||||
|
@@ -1,17 +1 @@
|
||||
import { getThemeColors, generateColors } from '../../../build/config/themeConfig';
|
||||
|
||||
import { replaceStyleVariables } from 'vite-plugin-theme/es/client';
|
||||
import { mixLighten, mixDarken, tinycolor } from 'vite-plugin-theme/es/colorUtils';
|
||||
|
||||
export async function changeTheme(color: string) {
|
||||
const colors = generateColors({
|
||||
mixDarken,
|
||||
mixLighten,
|
||||
tinycolor,
|
||||
color,
|
||||
});
|
||||
|
||||
return await replaceStyleVariables({
|
||||
colorVariables: [...getThemeColors(color), ...colors],
|
||||
});
|
||||
}
|
||||
export async function changeTheme(_color: string) {}
|
||||
|
@@ -1,7 +1,7 @@
|
||||
<template>
|
||||
<div :class="prefixCls" class="relative w-full h-full px-4">
|
||||
<div class="flex items-center absolute right-4 top-4">
|
||||
<AppDarkModeToggle class="enter-x mr-2" v-if="!sessionTimeout" />
|
||||
<!-- <AppDarkModeToggle class="enter-x mr-2" v-if="!sessionTimeout" /> -->
|
||||
<AppLocalePicker
|
||||
class="text-white enter-x xl:text-gray-600"
|
||||
:show-text="false"
|
||||
@@ -50,7 +50,7 @@
|
||||
<script lang="ts" setup>
|
||||
import { computed } from 'vue';
|
||||
import { AppLogo } from '/@/components/Application';
|
||||
import { AppLocalePicker, AppDarkModeToggle } from '/@/components/Application';
|
||||
import { AppLocalePicker } from '/@/components/Application';
|
||||
import LoginForm from './LoginForm.vue';
|
||||
import ForgetPasswordForm from './ForgetPasswordForm.vue';
|
||||
import RegisterForm from './RegisterForm.vue';
|
||||
|
Reference in New Issue
Block a user