From 4160a119aa34c12789223af1d0145f19c3101834 Mon Sep 17 00:00:00 2001 From: SuperCuteXiaoSi <1531733886@qq.com> Date: Tue, 25 Oct 2022 16:32:15 +0800 Subject: [PATCH] =?UTF-8?q?feat(layouts):=20=E2=9C=A8=20[App]=20=E4=B8=BB?= =?UTF-8?q?=E9=A2=98=E5=88=87=E6=8D=A2=E5=8A=9F=E8=83=BD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- index.html | 10 +- package.json | 1 + pnpm-lock.yaml | 106 ++++++++++++++-- public/serverConfig.json | 1 + src/App.vue | 8 ++ src/components/Application/AppTheme.vue | 3 + src/config/index.ts | 2 + src/hooks/useTransformTheme.ts | 1 + src/hooks/web/useI18n.ts | 1 - .../pageLayouts/components/AppTabs/index.vue | 2 +- .../components/Breadcrumb/index.vue | 3 +- .../components/Seting/ThemeSettings/index.vue | 114 ++++++++++++++++++ .../pageLayouts/components/Seting/index.vue | 73 ++++++----- .../components/SideNavigationBar/index.vue | 13 +- .../components/VerticalSidebar/index.vue | 1 - src/locales/en/modules/layout.ts | 7 ++ src/locales/zh-ch/modules/layout.ts | 7 ++ src/store/modules/app.ts | 4 +- src/store/types.ts | 1 + src/styles/element-style.scss | 3 + src/styles/{ => element}/el-theme.scss | 6 +- src/styles/element/index.scss | 2 +- src/styles/index.scss | 1 + src/styles/theme.scss | 4 +- src/utils/plugin/element.ts | 4 + src/utils/transformTheme.ts | 41 +++++++ 26 files changed, 366 insertions(+), 53 deletions(-) create mode 100644 src/hooks/useTransformTheme.ts create mode 100644 src/layouts/pageLayouts/components/Seting/ThemeSettings/index.vue create mode 100644 src/locales/en/modules/layout.ts create mode 100644 src/locales/zh-ch/modules/layout.ts create mode 100644 src/styles/element-style.scss rename src/styles/{ => element}/el-theme.scss (85%) create mode 100644 src/utils/transformTheme.ts diff --git a/index.html b/index.html index e9079b7a..00a967ae 100644 --- a/index.html +++ b/index.html @@ -156,13 +156,21 @@ } } -
+
+ diff --git a/package.json b/package.json index 69b71cb2..c91f4200 100644 --- a/package.json +++ b/package.json @@ -119,6 +119,7 @@ "vitest": "^0.24.3", "vue-eslint-parser": "^9.1.0", "vue-tsc": "^1.0.8", + "vue3-colorpicker": "^2.0.4", "xlsx": "^0.18.5" }, "license": "MIT", diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index 08cbd66a..8f7775fd 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -84,6 +84,7 @@ specifiers: vue-router: ^4.1.5 vue-tsc: ^1.0.8 vue-types: ^4.2.1 + vue3-colorpicker: ^2.0.4 vuex: ^4.1.0 wangeditor: ^4.7.15 xlsx: ^0.18.5 @@ -176,9 +177,17 @@ devDependencies: vitest: 0.24.3_jsdom@20.0.1+sass@1.55.0 vue-eslint-parser: 9.1.0_eslint@8.25.0 vue-tsc: 1.0.8_typescript@4.8.4 + vue3-colorpicker: 2.0.4_rc4abim5nfyny5co6oqcsppsja xlsx: 0.18.5 packages: + /@aesoper/normal-utils/0.1.5: + resolution: + { + integrity: sha512-LFF/6y6h5mfwhnJaWqqxuC8zzDaHCG62kMRkd8xhDtq62TQj9dM17A9DhE87W7DhiARJsHLgcina/9P4eNCN1w==, + } + dev: true + /@ampproject/remapping/2.2.0: resolution: { @@ -2495,6 +2504,13 @@ packages: } dev: true + /@popperjs/core/2.11.6: + resolution: + { + integrity: sha512-50/17A98tWUfQ176raKiOGXuYpLyyVMkxxG6oylzL3BPOlA6ADGdK7EYunSa4I064xerltq9TGXs8HmOk5E+vw==, + } + dev: true + /@rollup/plugin-babel/5.3.1_vy4anxjpv2s44kyfi2kxqu576u: resolution: { @@ -2920,7 +2936,6 @@ packages: { integrity: sha512-w7hEHXnPMEZ+4nGKl/KDRVpxkwYxYExuHOYXyzIzCDzEZ9ZCGMAewulr9IqJu2LR4N37fcnb1XVeuZ09qgOxhA==, } - dev: false /@typescript-eslint/eslint-plugin/5.40.0_25sstg4uu2sk4pm7xcyzuov7xq: resolution: @@ -3418,14 +3433,12 @@ packages: transitivePeerDependencies: - '@vue/composition-api' - vue - dev: false /@vueuse/metadata/9.3.0: resolution: { integrity: sha512-GnnfjbzIPJIh9ngL9s9oGU1+Hx/h5/KFqTfJykzh/1xjaHkedV9g0MASpdmPZIP+ynNhKAcEfA6g5i8KXwtoMA==, } - dev: false /@vueuse/shared/9.3.0_vue@3.2.41: resolution: @@ -3437,7 +3450,6 @@ packages: transitivePeerDependencies: - '@vue/composition-api' - vue - dev: false /JSONStream/1.3.5: resolution: @@ -7381,6 +7393,14 @@ packages: } dev: true + /gradient-parser/1.0.2: + resolution: + { + integrity: sha512-gR6nY33xC9yJoH4wGLQtZQMXDi6RI3H37ERu7kQCVUzlXjNedpZM7xcA489Opwbq0BSGohtWGsWsntupmxelMg==, + } + engines: { node: '>=0.10.0' } + dev: true + /grapheme-splitter/1.0.4: resolution: { @@ -8858,7 +8878,6 @@ packages: { integrity: sha512-mKnC+QJ9pWVzv+C4/U3rRsHapFfHvQFoFB92e52xeyGMcX6/OlIl78je1u8vePzYZSkkogMPJ2yjxxsb89cxyw==, } - dev: false /lodash-unified/1.0.2_3ib2ivapxullxkx3xftsimdk7u: resolution: @@ -10067,6 +10086,13 @@ packages: } dev: true + /performance-now/2.1.0: + resolution: + { + integrity: sha512-7EAHlyLHI56VEIdK57uwHdHKIaAGbnXPiw0yWbarQZOKaKpvUIgW0jWRVLiatnM+XXlSwsanIBH/hzGMJulMow==, + } + dev: true + /picocolors/1.0.0: resolution: { @@ -10510,6 +10536,15 @@ packages: engines: { node: '>=8' } dev: true + /raf/3.4.1: + resolution: + { + integrity: sha512-Sq4CW4QhwOHE8ucn6J34MqtZCeWFP2aQSmrlroYgqAV1PjStIhJXxYuTgUIfkEk7zTLjmIjLmU5q+fbD1NnOJA==, + } + dependencies: + performance-now: 2.1.0 + dev: true + /randombytes/2.1.0: resolution: { @@ -11958,6 +11993,13 @@ packages: } dev: true + /tinycolor2/1.4.2: + resolution: + { + integrity: sha512-vJhccZPs965sV/L2sU4oRQVAos0pQXwsvTLkWYdqJ+a8Q5kPFzJTuOFwy7UniPli44NKQGAglksjvOcpo95aZA==, + } + dev: true + /tinypool/0.3.0: resolution: { @@ -12899,7 +12941,6 @@ packages: optional: true dependencies: vue: 3.2.41 - dev: false /vue-eslint-parser/9.1.0_eslint@8.25.0: resolution: @@ -12985,7 +13026,6 @@ packages: dependencies: is-plain-object: 5.0.0 vue: 3.2.41 - dev: false /vue/3.2.41: resolution: @@ -12999,6 +13039,58 @@ packages: '@vue/server-renderer': 3.2.41_vue@3.2.41 '@vue/shared': 3.2.41 + /vue3-angle/0.1.6_vue@3.2.41: + resolution: + { + integrity: sha512-XbGG4xWhbbbB4Ujj17wyy5GjfsvTQL8+P00eRj3Y2W239l1CvKGehemrr0f1+IJa+aJpHaPn4hB22ahLy67Iqw==, + } + peerDependencies: + vue: ^3.2.6 + dependencies: + vue: 3.2.41 + dev: true + + /vue3-colorpicker/2.0.4_rc4abim5nfyny5co6oqcsppsja: + resolution: + { + integrity: sha512-xCw/iho6t9irNqGG0VP+W3/awiuC+D4E7MDPS+CeO1qLqoLI7MdbQML0WwC2QEifd1cV7sqTVJ0JqxFjJSDGMg==, + } + peerDependencies: + '@vueuse/core': ^6.5.3 + lodash-es: ^4.17.21 + vue: ^3.2.6 + vue-types: ^4.1.0 + dependencies: + '@aesoper/normal-utils': 0.1.5 + '@popperjs/core': 2.11.6 + '@vueuse/core': 9.3.0_vue@3.2.41 + gradient-parser: 1.0.2 + lodash-es: 4.17.21 + tinycolor2: 1.4.2 + vue: 3.2.41 + vue-types: 4.2.1_vue@3.2.41 + vue3-angle: 0.1.6_vue@3.2.41 + vue3-normal-library: 0.1.6_74iyevwgxgcv26n6rs4wwe3b6y + transitivePeerDependencies: + - '@vue/compiler-sfc' + dev: true + + /vue3-normal-library/0.1.6_74iyevwgxgcv26n6rs4wwe3b6y: + resolution: + { + integrity: sha512-TSqCeD092ETnjqamNKtXencLnG4a+NVWFZgalmyPtFH1FHvpxLP7eptT8krOL2sZVspficic8DghfDakw3tKRQ==, + } + peerDependencies: + '@vue/compiler-sfc': ^3.2.6 + vue: ^3.2.6 + dependencies: + '@vue/compiler-sfc': 3.2.41 + lodash-es: 4.17.21 + raf: 3.4.1 + vue: 3.2.41 + vue-types: 4.2.1_vue@3.2.41 + dev: true + /vuex/4.1.0_vue@3.2.41: resolution: { diff --git a/public/serverConfig.json b/public/serverConfig.json index 7232b813..9cdb7d3e 100644 --- a/public/serverConfig.json +++ b/public/serverConfig.json @@ -4,6 +4,7 @@ "sidebarMode": "vertical", "themeMode": "day", "locale": "zh-ch", + "primaryColor": "#409eff", "StorageConfig":{ "type": "localStorage", "prefix": "xiaosiAdmin", diff --git a/src/App.vue b/src/App.vue index 15f05bc4..f81dbbd1 100644 --- a/src/App.vue +++ b/src/App.vue @@ -1,7 +1,15 @@