From ab09ee338efc5ca61dc971efa6e155fd45bbbc6c Mon Sep 17 00:00:00 2001 From: kuanghua <869653722@qq.com> Date: Sun, 17 Jul 2022 21:48:54 +0800 Subject: [PATCH] Add Theme func detail to look v1.8.1 update log --- .env.serve-test | 2 +- .eslintrc-auto-import.json | 12 + .vscode/settings.json | 2 +- auto-imports.d.ts | 12 + components.d.ts | 22 ++ index.html | 2 +- optimize-include.ts | 122 ++++++++ package.json | 47 ++-- src/App.vue | 12 +- src/components/ThemeSelect/index.vue | 57 ++++ src/{directive => directives}/clickoutside.js | 0 src/{directive => directives}/copy.js | 0 src/{directive => directives}/debounce.js | 0 src/{directive => directives}/index.js | 0 src/{directive => directives}/longpress.js | 0 src/{directive => directives}/permission.js | 0 src/{directive => directives}/watermark.js | 0 src/{directive => directives}/waves/waves.css | 0 src/{directive => directives}/waves/waves.js | 0 src/icons/common/404.svg | 1 - src/icons/common/hamburger.svg | 2 + src/icons/common/sidebar-logo.svg | 2 + src/icons/common/zip.svg | 1 - src/icons/nav-bar/theme-icon.svg | 2 + src/lang/zh.js | 9 +- src/layout/Layout.vue | 16 +- src/layout/components/AppMain.vue | 20 +- .../components/Breadcrumb/Breadcrumb.vue | 2 +- src/layout/components/Hamburger/Hamburger.vue | 29 +- src/layout/components/Navbar.vue | 14 +- src/layout/components/Sidebar/ElSvgItem.vue | 5 +- src/layout/components/Sidebar/Logo.vue | 16 +- src/layout/components/Sidebar/Sidebar.vue | 49 ++-- src/layout/components/Sidebar/SidebarItem.vue | 14 - src/layout/components/TagsView/TagsView.vue | 35 +-- src/layout/hook/useResizeHandler.js | 41 --- src/main.js | 17 +- src/router/index.js | 18 +- src/router/modules/codeGenerator.js | 24 ++ src/settings.js | 5 + src/styles/index.scss | 3 +- src/styles/scss-suger.scss | 221 +-------------- src/styles/variables-to-js.scss | 20 +- src/styles/variables.scss | 51 ++-- src/theme/base/css-vars.scss | 41 +++ src/theme/base/index.scss | 82 ++++++ src/theme/base/var.scss | 211 ++++++++++++++ src/theme/dark/css-vars.scss | 41 +++ src/theme/dark/index.scss | 89 ++++++ src/theme/dark/var.scss | 211 ++++++++++++++ src/theme/index.scss | 10 + src/theme/lighting/css-vars.scss | 29 ++ src/theme/lighting/index.scss | 83 ++++++ src/theme/lighting/var.scss | 211 ++++++++++++++ src/theme/utils/dark.ts | 3 + src/theme/utils/index.ts | 1 + src/views/code-generator/CodeGenerator.vue | 4 +- src/views/code-generator/ListTableConfig.vue | 5 +- .../GeneratorConfigSave.vue | 227 +++++++++++++++ .../GeneratorConfigSaveForm.vue | 107 +++++++ .../code-generator-config/index.js | 3 + src/views/code-generator/generatorUtis.js | 40 ++- src/views/login/Login.vue | 264 +----------------- .../login/{Login-alt.vue => login-alt.vue} | 0 src/views/login/login-base.vue | 218 +++++++++++++++ src/views/login/login-lighting.vue | 258 +++++++++++++++++ src/views/use-example/countTo/countTo.vue | 14 +- vite.config.js | 67 ++--- 68 files changed, 2350 insertions(+), 776 deletions(-) create mode 100644 components.d.ts create mode 100644 optimize-include.ts create mode 100644 src/components/ThemeSelect/index.vue rename src/{directive => directives}/clickoutside.js (100%) rename src/{directive => directives}/copy.js (100%) rename src/{directive => directives}/debounce.js (100%) rename src/{directive => directives}/index.js (100%) rename src/{directive => directives}/longpress.js (100%) rename src/{directive => directives}/permission.js (100%) rename src/{directive => directives}/watermark.js (100%) rename src/{directive => directives}/waves/waves.css (100%) rename src/{directive => directives}/waves/waves.js (100%) create mode 100644 src/icons/common/hamburger.svg create mode 100644 src/icons/common/sidebar-logo.svg create mode 100644 src/icons/nav-bar/theme-icon.svg delete mode 100644 src/layout/hook/useResizeHandler.js create mode 100644 src/router/modules/codeGenerator.js create mode 100644 src/theme/base/css-vars.scss create mode 100644 src/theme/base/index.scss create mode 100644 src/theme/base/var.scss create mode 100644 src/theme/dark/css-vars.scss create mode 100644 src/theme/dark/index.scss create mode 100644 src/theme/dark/var.scss create mode 100644 src/theme/index.scss create mode 100644 src/theme/lighting/css-vars.scss create mode 100644 src/theme/lighting/index.scss create mode 100644 src/theme/lighting/var.scss create mode 100644 src/theme/utils/dark.ts create mode 100644 src/theme/utils/index.ts create mode 100644 src/views/code-generator/code-generator-config/GeneratorConfigSave.vue create mode 100644 src/views/code-generator/code-generator-config/GeneratorConfigSaveForm.vue create mode 100644 src/views/code-generator/code-generator-config/index.js rename src/views/login/{Login-alt.vue => login-alt.vue} (100%) create mode 100644 src/views/login/login-base.vue create mode 100644 src/views/login/login-lighting.vue diff --git a/.env.serve-test b/.env.serve-test index 7eb8cd4..b3c3390 100644 --- a/.env.serve-test +++ b/.env.serve-test @@ -1,6 +1,6 @@ #The defined variable must start with VITE_APP_ VITE_APP_ENV = 'test' -VITE_APP_BASE_URL = 'http://localhost:20156/api' +VITE_APP_BASE_URL = 'http://localhost:20156/micro-service-api' #image or oss address VITE_APP_IMAGE_URL = 'https://github.jzfai.top/gofast-image' diff --git a/.eslintrc-auto-import.json b/.eslintrc-auto-import.json index 6335a66..50d385d 100644 --- a/.eslintrc-auto-import.json +++ b/.eslintrc-auto-import.json @@ -1,19 +1,28 @@ { "globals": { + "acceptHMRUpdate": true, "axiosReq": true, "computed": true, "createApp": true, + "createPinia": true, "customRef": true, "defineAsyncComponent": true, "defineComponent": true, + "defineStore": true, "effectScope": true, "EffectScope": true, + "getActivePinia": true, "getCurrentInstance": true, "getCurrentScope": true, "h": true, "inject": true, "isReadonly": true, "isRef": true, + "mapActions": true, + "mapGetters": true, + "mapState": true, + "mapStores": true, + "mapWritableState": true, "markRaw": true, "nextTick": true, "onActivated": true, @@ -34,9 +43,12 @@ "readonly": true, "ref": true, "resolveComponent": true, + "setActivePinia": true, + "setMapStoreSuffix": true, "shallowReactive": true, "shallowReadonly": true, "shallowRef": true, + "storeToRefs": true, "toRaw": true, "toRef": true, "toRefs": true, diff --git a/.vscode/settings.json b/.vscode/settings.json index 4029450..c4c919f 100644 --- a/.vscode/settings.json +++ b/.vscode/settings.json @@ -1,4 +1,4 @@ { "editor.defaultFormatter": "esbenp.prettier-vscode", - "npm.packageManager": "yarn" + "npm.packageManager": "pnpm" } diff --git a/auto-imports.d.ts b/auto-imports.d.ts index 747e34f..203b2cc 100644 --- a/auto-imports.d.ts +++ b/auto-imports.d.ts @@ -1,20 +1,29 @@ // Generated by 'unplugin-auto-import' // We suggest you to commit this file into source control declare global { + const acceptHMRUpdate: typeof import('pinia')['acceptHMRUpdate'] const axiosReq: typeof import('@/utils/axiosReq')['axiosReq'] const computed: typeof import('vue')['computed'] const createApp: typeof import('vue')['createApp'] + const createPinia: typeof import('pinia')['createPinia'] const customRef: typeof import('vue')['customRef'] const defineAsyncComponent: typeof import('vue')['defineAsyncComponent'] const defineComponent: typeof import('vue')['defineComponent'] + const defineStore: typeof import('pinia')['defineStore'] const effectScope: typeof import('vue')['effectScope'] const EffectScope: typeof import('vue')['EffectScope'] + const getActivePinia: typeof import('pinia')['getActivePinia'] const getCurrentInstance: typeof import('vue')['getCurrentInstance'] const getCurrentScope: typeof import('vue')['getCurrentScope'] const h: typeof import('vue')['h'] const inject: typeof import('vue')['inject'] const isReadonly: typeof import('vue')['isReadonly'] const isRef: typeof import('vue')['isRef'] + const mapActions: typeof import('pinia')['mapActions'] + const mapGetters: typeof import('pinia')['mapGetters'] + const mapState: typeof import('pinia')['mapState'] + const mapStores: typeof import('pinia')['mapStores'] + const mapWritableState: typeof import('pinia')['mapWritableState'] const markRaw: typeof import('vue')['markRaw'] const nextTick: typeof import('vue')['nextTick'] const onActivated: typeof import('vue')['onActivated'] @@ -35,9 +44,12 @@ declare global { const readonly: typeof import('vue')['readonly'] const ref: typeof import('vue')['ref'] const resolveComponent: typeof import('vue')['resolveComponent'] + const setActivePinia: typeof import('pinia')['setActivePinia'] + const setMapStoreSuffix: typeof import('pinia')['setMapStoreSuffix'] const shallowReactive: typeof import('vue')['shallowReactive'] const shallowReadonly: typeof import('vue')['shallowReadonly'] const shallowRef: typeof import('vue')['shallowRef'] + const storeToRefs: typeof import('pinia')['storeToRefs'] const toRaw: typeof import('vue')['toRaw'] const toRef: typeof import('vue')['toRef'] const toRefs: typeof import('vue')['toRefs'] diff --git a/components.d.ts b/components.d.ts new file mode 100644 index 0000000..159d708 --- /dev/null +++ b/components.d.ts @@ -0,0 +1,22 @@ +// generated by unplugin-vue-components +// We suggest you to commit this file into source control +// Read more: https://github.com/vuejs/core/pull/3399 +import '@vue/runtime-core' + +declare module '@vue/runtime-core' { + export interface GlobalComponents { + ElSvgIcon: typeof import('./src/components/ElSvgIcon.vue')['default'] + ImportExportComp: typeof import('./src/components/ImportExportComp.vue')['default'] + LangSelect: typeof import('./src/components/LangSelect/index.vue')['default'] + Pagination: typeof import('./src/components/Pagination/index.vue')['default'] + RouterLink: typeof import('vue-router')['RouterLink'] + RouterView: typeof import('vue-router')['RouterView'] + ScreenFull: typeof import('./src/components/ScreenFull/index.vue')['default'] + SizeSelect: typeof import('./src/components/SizeSelect/index.vue')['default'] + TestUnit: typeof import('./src/components/TestUnit.vue')['default'] + ThemeSelect: typeof import('./src/components/ThemeSelect/index.vue')['default'] + Tinymce: typeof import('./src/components/Tinymce/Tinymce.vue')['default'] + } +} + +export {} diff --git a/index.html b/index.html index c6b673c..949063b 100644 --- a/index.html +++ b/index.html @@ -1,5 +1,5 @@ - + diff --git a/optimize-include.ts b/optimize-include.ts new file mode 100644 index 0000000..c763150 --- /dev/null +++ b/optimize-include.ts @@ -0,0 +1,122 @@ +// const fs = require('fs') +// const files = fs.readdirSync( +// 'D:\\github\\vue3-admin-ts\\node_modules\\.pnpm\\element-plus@2.2.9_vue@3.2.37\\node_modules\\element-plus\\es\\components\\' +// ) +// console.log(111, JSON.stringify(files)) +// console.log(console.dir(files)) +// console.log(console.dir(files.slice(20))) + +const elementPlusComponentNameArr = [ + 'affix', + 'alert', + 'aside', + 'autocomplete', + 'avatar', + 'backtop', + 'badge', + 'base', + 'breadcrumb', + 'breadcrumb-item', + 'button', + 'button-group', + 'calendar', + 'card', + 'carousel', + 'carousel-item', + 'cascader', + 'cascader-panel', + 'check-tag', + 'checkbox', + 'checkbox-button', + 'checkbox-group', + 'col', + 'collapse', + 'collapse-item', + 'collapse-transition', + 'color-picker', + 'config-provider', + 'container', + 'date-picker', + 'descriptions', + 'descriptions-item', + 'dialog', + 'divider', + 'drawer', + 'dropdown', + 'dropdown-item', + 'dropdown-menu', + 'empty', + 'footer', + 'form', + 'form-item', + 'header', + 'icon', + 'image', + 'image-viewer', + 'infinite-scroll', + 'input', + 'input-number', + 'link', + 'loading', + 'main', + 'menu', + 'menu-item', + 'menu-item-group', + 'message', + 'message-box', + 'notification', + 'option', + 'option-group', + 'overlay', + 'page-header', + 'pagination', + 'popconfirm', + 'popover', + 'popper', + 'progress', + 'radio', + 'radio-button', + 'radio-group', + 'rate', + 'result', + 'row', + 'scrollbar', + 'select', + 'select-v2', + 'skeleton', + 'skeleton-item', + 'slider', + 'space', + 'step', + 'steps', + 'sub-menu', + 'switch', + 'tab-pane', + 'table', + 'table-column', + 'table-v2', + 'tabs', + 'tag', + 'teleport', + 'time-picker', + 'time-select', + 'timeline', + 'timeline-item', + 'tooltip', + 'transfer', + 'tree', + 'tree-select', + 'tree-v2', + 'upload', + 'virtual-list' +] +export const optimizeDepsArr = () => { + const depsArr = [] as string[] + elementPlusComponentNameArr.forEach((feItem) => { + depsArr.push(`element-plus/es/components/${feItem}/style/index`) + }) + + return depsArr +} + +export default [] diff --git a/package.json b/package.json index b711428..dfd47f9 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "vue3-admin-plus", - "version": "1.6.2", + "version": "1.8.1", "license": "ISC", "author": "kuanghua(869653722@qq.com)", "packageManager": "pnpm@6.32.3", @@ -22,39 +22,38 @@ "vue": "^3.2.26" }, "dependencies": { - "@element-plus/icons-vue": "2.0.4", - "@vueuse/core": "^8.7.5", + "@element-plus/icons-vue": "^2.0.4", "js-error-collection": "^1.0.7", "axios": "0.21.3", - "d3": "7.2.1", - "driver.js": "^0.9.8", "echarts": "4.2.1", - "element-china-area-data": "5.0.2", - "element-plus": "2.2.5", + "element-plus": "^2.2.9", "mitt": "3.0.0", - "moment-mini": "2.24.0", + "moment-mini": "2.22.1", "nprogress": "0.2.0", "path": "0.12.7", - "path-to-regexp": "^6.2.0", - "pinia": "2.0.14", - "screenfull": "4.2.0", + "path-to-regexp": "6.2.0", + "pinia": "^2.0.16", "tinymce": "4.9.11", "vue": "3.2.37", + "vue-router": "4.0.14", + "@vueuse/core": "^8.7.5", + "d3": "7.2.1", + "driver.js": "^0.9.8", + "element-china-area-data": "5.0.2", + "screenfull": "4.2.0", "vue-i18n": "9.1.6", - "vue-router": "4.0.12", "xlsx": "^0.18.5", "sortablejs": "1.15.0", "splitpanes": "^3.1.1" }, "devDependencies": { + "scss": "0.2.4", "@babel/eslint-parser": "7.16.3", "@types/echarts": "4.9.7", - "@types/mockjs": "1.0.3", - "@types/node": "15.0.1", + "@types/mockjs": "1.0.6", "@typescript-eslint/eslint-plugin": "5.5.0", "@typescript-eslint/parser": "5.5.0", "@vitejs/plugin-legacy": "1.6.4", - "@vitejs/plugin-vue": "1.10.2", "@vitejs/plugin-vue-jsx": "1.3.1", "eslint": "7.32.0", "eslint-config-prettier": "8.3.0", @@ -65,19 +64,12 @@ "husky": "7.0.2", "mockjs": "1.1.0", "prettier": "2.2.1", - "sass": "1.32.12", - "scss": "0.2.4", "svg-sprite-loader": "6.0.11", - "typescript": "4.3.2", - "unplugin-auto-import": "^0.5.11", - "unplugin-vue-components": "^0.17.14", - "vite": "2.9.12", "vite-plugin-html": "^3.2.0", "vite-plugin-mock": "^2.9.6", "vite-plugin-style-import": "1.2.1", "vite-plugin-svg-icons": "1.0.5", "vite-plugin-vue-setup-extend-plus": "0.0.2", - "vue-tsc": "0.28.1", "jest": "<27", "ts-jest": "<27", "tslib": "^2.4.0", @@ -92,7 +84,16 @@ "ts-node": "10.7.0", "majestic": "1.8.1", "@vue/cli-plugin-unit-jest": "4.5.17", - "@vue/cli-service": "4.5.17" + "@vue/cli-service": "4.5.17", + "@types/node": "^17.0.35", + "@vitejs/plugin-vue": "^2.3.3", + "sass": "^1.52.1", + "typescript": "^4.7.2", + "unplugin-auto-import": "^0.5.11", + "unplugin-vue-components": "^0.19.5", + "vite": "^3.0.0", + "@vueuse/core": "^8.7.5", + "vue-tsc": "^0.34.16" }, "browserslist": [ "> 1%", diff --git a/src/App.vue b/src/App.vue index 72f5be4..f28d533 100644 --- a/src/App.vue +++ b/src/App.vue @@ -1,14 +1,24 @@ + + diff --git a/src/directive/clickoutside.js b/src/directives/clickoutside.js similarity index 100% rename from src/directive/clickoutside.js rename to src/directives/clickoutside.js diff --git a/src/directive/copy.js b/src/directives/copy.js similarity index 100% rename from src/directive/copy.js rename to src/directives/copy.js diff --git a/src/directive/debounce.js b/src/directives/debounce.js similarity index 100% rename from src/directive/debounce.js rename to src/directives/debounce.js diff --git a/src/directive/index.js b/src/directives/index.js similarity index 100% rename from src/directive/index.js rename to src/directives/index.js diff --git a/src/directive/longpress.js b/src/directives/longpress.js similarity index 100% rename from src/directive/longpress.js rename to src/directives/longpress.js diff --git a/src/directive/permission.js b/src/directives/permission.js similarity index 100% rename from src/directive/permission.js rename to src/directives/permission.js diff --git a/src/directive/watermark.js b/src/directives/watermark.js similarity index 100% rename from src/directive/watermark.js rename to src/directives/watermark.js diff --git a/src/directive/waves/waves.css b/src/directives/waves/waves.css similarity index 100% rename from src/directive/waves/waves.css rename to src/directives/waves/waves.css diff --git a/src/directive/waves/waves.js b/src/directives/waves/waves.js similarity index 100% rename from src/directive/waves/waves.js rename to src/directives/waves/waves.js diff --git a/src/icons/common/404.svg b/src/icons/common/404.svg index 6df5019..e69de29 100644 --- a/src/icons/common/404.svg +++ b/src/icons/common/404.svg @@ -1 +0,0 @@ - \ No newline at end of file diff --git a/src/icons/common/hamburger.svg b/src/icons/common/hamburger.svg new file mode 100644 index 0000000..9766c95 --- /dev/null +++ b/src/icons/common/hamburger.svg @@ -0,0 +1,2 @@ + \ No newline at end of file diff --git a/src/icons/common/sidebar-logo.svg b/src/icons/common/sidebar-logo.svg new file mode 100644 index 0000000..1825fb3 --- /dev/null +++ b/src/icons/common/sidebar-logo.svg @@ -0,0 +1,2 @@ + diff --git a/src/icons/common/zip.svg b/src/icons/common/zip.svg index f806fc4..e69de29 100644 --- a/src/icons/common/zip.svg +++ b/src/icons/common/zip.svg @@ -1 +0,0 @@ - \ No newline at end of file diff --git a/src/icons/nav-bar/theme-icon.svg b/src/icons/nav-bar/theme-icon.svg new file mode 100644 index 0000000..49a3613 --- /dev/null +++ b/src/icons/nav-bar/theme-icon.svg @@ -0,0 +1,2 @@ + diff --git a/src/lang/zh.js b/src/lang/zh.js index effa12d..15ca18a 100644 --- a/src/lang/zh.js +++ b/src/lang/zh.js @@ -2,7 +2,7 @@ export default { route: { Dashboard: '首页', 'Setting Switch': '设置文件测试', - 'Guide': '引导页', + Guide: '引导页', ErrorLog: '错误日志', 'ErrorLog Test': '错误日志测试', @@ -17,6 +17,7 @@ export default { Table: '表格', exportExcel: '导出Excel', importExcel: '导入Excel', + CodeGenerator: '低代码平台', ExternalLink: '外链', Charts: '图表', @@ -39,11 +40,11 @@ export default { 'RouterDemo-F': '路由跳转页面1', 'RouterDemo-S': '路由跳转页面2', 'Use Example': '使用例子', - 'Directive':'自定义指令', + Directive: '自定义指令', Tinymce: 'Tinymce富文本', 'I18n-Demo': 'i18n例子', - 'dragPane': '拖拽面板', - 'countTo' :'数字动画', + dragPane: '拖拽面板', + countTo: '数字动画', Permission: '权限', 'Role Index': '角色权限', 'Page Permission': '角色权限页面', diff --git a/src/layout/Layout.vue b/src/layout/Layout.vue index b496bbe..817ee6b 100644 --- a/src/layout/Layout.vue +++ b/src/layout/Layout.vue @@ -10,15 +10,8 @@ - - - - diff --git a/src/layout/components/Navbar.vue b/src/layout/components/Navbar.vue index 5ec1473..c656859 100644 --- a/src/layout/components/Navbar.vue +++ b/src/layout/components/Navbar.vue @@ -13,14 +13,12 @@
{{ settings.showNavbarTitle }}
+
- +