diff --git a/.env b/.env index 6307b2d7..3c5303b5 100644 --- a/.env +++ b/.env @@ -13,3 +13,5 @@ VITE_APP_TENANT_ENABLE=true # 验证码的开关 VITE_APP_CAPTCHA_ENABLE=true +# 百度统计 +VITE_APP_BAIDU_CODE = a1ff8825baa73c3a78eb96aa40325abc diff --git a/.env.dev b/.env.dev index 3b85e481..a52eec30 100644 --- a/.env.dev +++ b/.env.dev @@ -16,7 +16,7 @@ VITE_API_BASEPATH=/dev-api VITE_API_URL=/admin-api # 打包路径 -VITE_BASE_PATH=/dist-dev/ +VITE_BASE_PATH=/ # 是否删除debugger VITE_DROP_DEBUGGER=false diff --git a/.env.front b/.env.front index 2641417d..1629ff9f 100644 --- a/.env.front +++ b/.env.front @@ -17,3 +17,18 @@ VITE_API_URL=/admin-api # 打包路径 VITE_BASE_PATH=/ + +# 项目本地运行端口号, 与.vscode/launch.json配合 +VITE_PORT=80 + +# 是否删除debugger +VITE_DROP_DEBUGGER=false + +# 是否删除console.log +VITE_DROP_CONSOLE=false + +# 是否sourcemap +VITE_SOURCEMAP=true + +# 验证码的开关 +VITE_APP_CAPTCHA_ENABLE=false diff --git a/.env.stage b/.env.stage new file mode 100644 index 00000000..d7157fbb --- /dev/null +++ b/.env.stage @@ -0,0 +1,31 @@ +# 生产环境 +NODE_ENV=production + +VITE_DEV=false + +# 请求路径 +VITE_BASE_URL='http://api-dashboard.yudao.iocoder.cn' + +# 上传路径 +VITE_UPLOAD_URL='http://api-dashboard.yudao.iocoder.cn/admin-api/infra/file/upload' + +# 接口前缀 +VITE_API_BASEPATH= + +# 接口地址 +VITE_API_URL=/admin-api + +# 是否删除debugger +VITE_DROP_DEBUGGER=true + +# 是否删除console.log +VITE_DROP_CONSOLE=true + +# 是否sourcemap +VITE_SOURCEMAP=false + +# 打包路径 +VITE_BASE_PATH='http://static-vue3.yudao.iocoder.cn/' + +# 输出路径 +VITE_OUT_DIR=dist-stage diff --git a/.env.test b/.env.test index 85e2cf54..0793af25 100644 --- a/.env.test +++ b/.env.test @@ -25,7 +25,7 @@ VITE_DROP_CONSOLE=false VITE_SOURCEMAP=true # 打包路径 -VITE_BASE_PATH=/dist-test/ +VITE_BASE_PATH=/ # 输出路径 VITE_OUT_DIR=dist-test diff --git a/.gitignore b/.gitignore index ac15926b..39adf4da 100644 --- a/.gitignore +++ b/.gitignore @@ -6,6 +6,9 @@ dist-ssr /dist* *-lock.* pnpm-debug - +auto-*.d.ts .idea .history + +yarn.lock +*.iml diff --git a/.vscode/launch.json b/.vscode/launch.json new file mode 100644 index 00000000..ec531026 --- /dev/null +++ b/.vscode/launch.json @@ -0,0 +1,12 @@ +{ + "version": "0.2.0", + "configurations": [ + { + "name": "Launch debug", + "request": "launch", + "type": "chrome", + "url": "http://localhost", + "webRoot": "${workspaceFolder}/src" + } + ] +} diff --git a/.vscode/settings.json b/.vscode/settings.json index 38cc3052..5b3aa477 100644 --- a/.vscode/settings.json +++ b/.vscode/settings.json @@ -8,7 +8,7 @@ "source.fixAll.eslint": true }, "[vue]": { - "editor.defaultFormatter": "esbenp.prettier-vscode" + "editor.defaultFormatter": "Vue.volar" }, "[javascript]": { "editor.defaultFormatter": "esbenp.prettier-vscode" @@ -40,5 +40,15 @@ "i18n-ally.displayLanguage": "zh-CN", "i18n-ally.enabledFrameworks": ["vue", "react"], "god.tsconfig": "./tsconfig.json", - "vue-i18n.i18nPaths": "src/locales" + "vue-i18n.i18nPaths": "src/locales", + "explorer.fileNesting.enabled": true, + "explorer.fileNesting.expand": false, + "explorer.fileNesting.patterns": { + "*.ts": "$(capture).test.ts, $(capture).test.tsx", + "*.tsx": "$(capture).test.ts, $(capture).test.tsx", + "*.env": "$(capture).env.*", + "CHANGELOG.md": "CHANGELOG*", + "package.json": "pnpm-lock.yaml,pnpm-workspace.yaml,LICENSE,.gitattributes,.gitignore,.gitpod.yml,CNAME,README*,.npmrc,.browserslistrc,vite.config.*,windi.*,tailwind.*,tsconfig.*,postcss*", + ".eslintrc.js": ".eslintignore,.eslintrc-*,.prettierignore,.stylelintignore,.commitlintrc.js,.prettierrc.js,.stylelint*,stylelint*,prettier.*,.editorconfig" + } } diff --git a/README.md b/README.md index b3e9cc78..4a0de6ae 100644 --- a/README.md +++ b/README.md @@ -9,7 +9,10 @@ ## 🐶 新手必读 -* 演示地址: +* nodejs > 16.0.0 && pnpm > 7.30.0 +* 演示地址【Vue3 + element-plus】: +* 演示地址【Vue3 + vben(ant-design-vue)】: +* 演示地址【Vue2 + element-ui】: * 启动文档: * 视频教程: @@ -17,8 +20,8 @@ **芋道**,以开发者为中心,打造中国第一流的快速开发平台,全部开源,个人与企业可 100% 免费使用。 -* 采用 [vue-element-plus-admin](https://gitee.com/kailong110120130/vue-element-plus-admin) -* 改换saas,自动引入等功能 [vue-element-plus-admin](https://gitee.com/yudaocode/vue-element-plus-admin) +* 采用 [vue-element-plus-admin](https://gitee.com/kailong110120130/vue-element-plus-admin) 实现 +* 改换 saas,自动引入等功能 * 使用 Element Plus 免费开源的中后台模版,具备如下特性: ![首页](preview/home.png) @@ -35,15 +38,14 @@ | 框架 | 说明 | 版本 | |----------------------------------------------------------------------|------------------|--------| -| [Vue](https://staging-cn.vuejs.org/) | Vue 框架 | 3.2.47 | -| [Vite](https://cn.vitejs.dev//) | 开发与构建工具 | 4.1.4 | -| [Element Plus](https://element-plus.org/zh-CN/) | Element Plus | 2.2.34 | -| [TypeScript](https://www.typescriptlang.org/docs/) | JavaScript 的超集 | 4.9.5 | -| [pinia](https://pinia.vuejs.org/) | Vue 存储库 替代 vuex5 | 2.0.33 | -| [vueuse](https://vueuse.org/) | 常用工具集 | 9.13.0 | -| [vxe-table](https://vxetable.cn/) | Vue 最强表单 | 4.3.10 | +| [Vue](https://staging-cn.vuejs.org/) | Vue 框架 | 3.3.4 | +| [Vite](https://cn.vitejs.dev//) | 开发与构建工具 | 4.3.8 | +| [Element Plus](https://element-plus.org/zh-CN/) | Element Plus | 2.3.4 | +| [TypeScript](https://www.typescriptlang.org/docs/) | JavaScript 的超集 | 5.0.4 | +| [pinia](https://pinia.vuejs.org/) | Vue 存储库 替代 vuex5 | 2.1.3 | +| [vueuse](https://vueuse.org/) | 常用工具集 | 10.1.2 | | [vue-i18n](https://kazupon.github.io/vue-i18n/zh/introduction.html/) | 国际化 | 9.2.2 | -| [vue-router](https://router.vuejs.org/) | Vue 路由 | 4.1.6 | +| [vue-router](https://router.vuejs.org/) | Vue 路由 | 4.2.1 | | [windicss](https://cn.windicss.org/) | 下一代工具优先的 CSS 框架 | 3.5.6 | | [iconify](https://icon-sets.iconify.design/) | 在线图标库 | 3.1.0 | | [wangeditor](https://www.wangeditor.com/) | 富文本编辑器 | 5.1.23 | diff --git a/build/vite/index.ts b/build/vite/index.ts index dcec1aed..da50d919 100644 --- a/build/vite/index.ts +++ b/build/vite/index.ts @@ -11,7 +11,8 @@ import AutoImport from 'unplugin-auto-import/vite' import Components from 'unplugin-vue-components/vite' import { ElementPlusResolver } from 'unplugin-vue-components/resolvers' import viteCompression from 'vite-plugin-compression' -import vueSetupExtend from 'vite-plugin-vue-setup-extend' +import topLevelAwait from 'vite-plugin-top-level-await' +import vueSetupExtend from 'vite-plugin-vue-setup-extend-plus' import VueI18nPlugin from '@intlify/unplugin-vue-i18n/vite' import { createSvgIconsPlugin } from 'vite-plugin-svg-icons' @@ -95,6 +96,13 @@ export function createVitePlugins() { ext: '.gz', // 生成的压缩包后缀 deleteOriginFile: false //压缩后是否删除源文件 }), - ViteEjsPlugin() + ViteEjsPlugin(), + topLevelAwait({ + // https://juejin.cn/post/7152191742513512485 + // The export name of top-level await promise for each chunk module + promiseExportName: '__tla', + // The function to generate import names of top-level await promise in each chunk module + promiseImportName: (i) => `__tla_${i}` + }) ] } diff --git a/build/vite/optimize.ts b/build/vite/optimize.ts index 3d90dbac..2c73f72b 100644 --- a/build/vite/optimize.ts +++ b/build/vite/optimize.ts @@ -37,37 +37,58 @@ const include = [ 'element-plus/es', 'element-plus/es/locale/lang/zh-cn', 'element-plus/es/locale/lang/en', - 'element-plus/es/components/backtop/style/index', - 'element-plus/es/components/form/style/index', - 'element-plus/es/components/radio-group/style/index', - 'element-plus/es/components/radio/style/index', - 'element-plus/es/components/checkbox/style/index', - 'element-plus/es/components/checkbox-group/style/index', - 'element-plus/es/components/switch/style/index', - 'element-plus/es/components/time-picker/style/index', - 'element-plus/es/components/date-picker/style/index', - 'element-plus/es/components/col/style/index', - 'element-plus/es/components/form-item/style/index', - 'element-plus/es/components/alert/style/index', - 'element-plus/es/components/breadcrumb/style/index', - 'element-plus/es/components/select/style/index', - 'element-plus/es/components/input/style/index', - 'element-plus/es/components/breadcrumb-item/style/index', - 'element-plus/es/components/tag/style/index', - 'element-plus/es/components/pagination/style/index', - 'element-plus/es/components/table/style/index', - 'element-plus/es/components/table-column/style/index', - 'element-plus/es/components/card/style/index', - 'element-plus/es/components/row/style/index', - 'element-plus/es/components/button/style/index', - 'element-plus/es/components/menu/style/index', - 'element-plus/es/components/sub-menu/style/index', - 'element-plus/es/components/menu-item/style/index', - 'element-plus/es/components/option/style/index', - 'element-plus/es/components/dropdown/style/index', - 'element-plus/es/components/dropdown-menu/style/index', - 'element-plus/es/components/dropdown-item/style/index', - 'element-plus/es/components/skeleton/style/index', + 'element-plus/es/components/backtop/style/css', + 'element-plus/es/components/form/style/css', + 'element-plus/es/components/radio-group/style/css', + 'element-plus/es/components/radio/style/css', + 'element-plus/es/components/checkbox/style/css', + 'element-plus/es/components/checkbox-group/style/css', + 'element-plus/es/components/switch/style/css', + 'element-plus/es/components/time-picker/style/css', + 'element-plus/es/components/date-picker/style/css', + 'element-plus/es/components/descriptions/style/css', + 'element-plus/es/components/descriptions-item/style/css', + 'element-plus/es/components/link/style/css', + 'element-plus/es/components/tooltip/style/css', + 'element-plus/es/components/drawer/style/css', + 'element-plus/es/components/dialog/style/css', + 'element-plus/es/components/checkbox-button/style/css', + 'element-plus/es/components/option-group/style/css', + 'element-plus/es/components/radio-button/style/css', + 'element-plus/es/components/cascader/style/css', + 'element-plus/es/components/color-picker/style/css', + 'element-plus/es/components/input-number/style/css', + 'element-plus/es/components/rate/style/css', + 'element-plus/es/components/select-v2/style/css', + 'element-plus/es/components/tree-select/style/css', + 'element-plus/es/components/slider/style/css', + 'element-plus/es/components/time-select/style/css', + 'element-plus/es/components/autocomplete/style/css', + 'element-plus/es/components/image-viewer/style/css', + 'element-plus/es/components/upload/style/css', + 'element-plus/es/components/col/style/css', + 'element-plus/es/components/form-item/style/css', + 'element-plus/es/components/alert/style/css', + 'element-plus/es/components/breadcrumb/style/css', + 'element-plus/es/components/select/style/css', + 'element-plus/es/components/input/style/css', + 'element-plus/es/components/breadcrumb-item/style/css', + 'element-plus/es/components/tag/style/css', + 'element-plus/es/components/pagination/style/css', + 'element-plus/es/components/table/style/css', + 'element-plus/es/components/table-v2/style/css', + 'element-plus/es/components/table-column/style/css', + 'element-plus/es/components/card/style/css', + 'element-plus/es/components/row/style/css', + 'element-plus/es/components/button/style/css', + 'element-plus/es/components/menu/style/css', + 'element-plus/es/components/sub-menu/style/css', + 'element-plus/es/components/menu-item/style/css', + 'element-plus/es/components/option/style/css', + 'element-plus/es/components/dropdown/style/css', + 'element-plus/es/components/dropdown-menu/style/css', + 'element-plus/es/components/dropdown-item/style/css', + 'element-plus/es/components/skeleton/style/css', 'element-plus/es/components/skeleton/style/css', 'element-plus/es/components/backtop/style/css', 'element-plus/es/components/menu/style/css', @@ -79,7 +100,15 @@ const include = [ 'element-plus/es/components/dropdown-item/style/css', 'element-plus/es/components/badge/style/css', 'element-plus/es/components/breadcrumb/style/css', - 'element-plus/es/components/breadcrumb-item/style/css' + 'element-plus/es/components/breadcrumb-item/style/css', + 'element-plus/es/components/image/style/css', + 'element-plus/es/components/collapse-transition/style/css', + 'element-plus/es/components/timeline/style/css', + 'element-plus/es/components/timeline-item/style/css', + 'element-plus/es/components/collapse/style/css', + 'element-plus/es/components/collapse-item/style/css', + 'element-plus/es/components/button-group/style/css', + 'element-plus/es/components/text/style/css' ] const exclude = ['@iconify/json'] diff --git a/package.json b/package.json index 683d09eb..6a87adf3 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "yudao-ui-admin-vue3", - "version": "1.7.1-snapshot.1961", + "version": "1.7.3-snapshot", "description": "基于vue3、vite4、element-plus、typesScript", "author": "xingyu", "private": false, @@ -11,11 +11,14 @@ "ts:check": "vue-tsc --noEmit", "build:pro": "node --max_old_space_size=8000 ./node_modules/vite/bin/vite.js build --mode pro", "build:dev": "node --max_old_space_size=8000 ./node_modules/vite/bin/vite.js build --mode dev", + "build:stage": "node --max_old_space_size=8000 ./node_modules/vite/bin/vite.js build --mode stage", "build:test": "node --max_old_space_size=8000 ./node_modules/vite/bin/vite.js build --mode test", "build:static": "node --max_old_space_size=8000 ./node_modules/vite/bin/vite.js build --mode static", + "build:front": "node --max_old_space_size=8000 ./node_modules/vite/bin/vite.js build --mode front", "serve:pro": "vite preview --mode pro", "serve:dev": "vite preview --mode dev", "serve:test": "vite preview --mode test", + "preview": "pnpm build && vite preview", "npm:check": "npx npm-check-updates", "clean": "npx rimraf node_modules", "clean:cache": "npx rimraf node_modules/.cache", @@ -26,16 +29,17 @@ "lint:pretty": "pretty-quick --staged" }, "dependencies": { - "@form-create/designer": "^3.1.0", - "@form-create/element-ui": "^3.1.17", + "@element-plus/icons-vue": "^2.1.0", + "@form-create/designer": "^3.1.3", + "@form-create/element-ui": "^3.1.18", "@iconify/iconify": "^3.1.0", "@videojs-player/vue": "^1.0.0", - "@vueuse/core": "^9.13.0", + "@vueuse/core": "^10.1.2", "@wangeditor/editor": "^5.1.23", "@wangeditor/editor-for-vue": "^5.1.10", - "@zxcvbn-ts/core": "^2.2.1", + "@zxcvbn-ts/core": "^3.0.1", "animate.css": "^4.1.1", - "axios": "^1.3.4", + "axios": "^1.4.0", "benz-amr-recorder": "^1.1.5", "bpmn-js-token-simulation": "^0.10.0", "camunda-bpmn-moddle": "^7.0.1", @@ -43,27 +47,27 @@ "crypto-js": "^4.1.1", "dayjs": "^1.11.7", "diagram-js": "^11.6.0", - "echarts": "^5.4.1", + "echarts": "^5.4.2", "echarts-wordcloud": "^2.1.0", - "element-plus": "2.3.1", - "fast-xml-parser": "^4.1.3", - "highlight.js": "^11.7.0", - "intro.js": "^6.0.0", + "element-plus": "2.3.4", + "fast-xml-parser": "^4.2.2", + "highlight.js": "^11.8.0", + "intro.js": "^7.0.1", "jsencrypt": "^3.3.2", "lodash-es": "^4.17.21", - "min-dash": "^4.0.0", + "min-dash": "^4.1.1", "mitt": "^3.0.0", "nprogress": "^0.2.0", - "pinia": "^2.0.33", - "qrcode": "^1.5.1", - "qs": "^6.11.1", + "pinia": "^2.1.3", + "qrcode": "^1.5.3", + "qs": "^6.11.2", "steady-xml": "^0.1.0", "url": "^0.11.0", - "video.js": "^8.0.4", - "vue": "3.2.47", + "video.js": "^8.3.0", + "vue": "3.3.4", "vue-i18n": "9.2.2", - "vue-router": "^4.1.6", - "vue-types": "^5.0.2", + "vue-router": "^4.2.1", + "vue-types": "^5.0.3", "vuedraggable": "^4.1.0", "vxe-table": "^4.3.11", "web-storage-cache": "^1.1.1", @@ -71,64 +75,64 @@ "xml-js": "^1.6.11" }, "devDependencies": { - "@commitlint/cli": "^17.5.0", - "@commitlint/config-conventional": "^17.4.4", - "@iconify/json": "^2.2.38", + "@commitlint/cli": "^17.6.3", + "@commitlint/config-conventional": "^17.6.3", + "@iconify/json": "^2.2.67", "@intlify/unplugin-vue-i18n": "^0.10.0", "@purge-icons/generated": "^0.9.0", "@types/intro.js": "^5.1.1", "@types/lodash-es": "^4.17.7", - "@types/node": "^18.15.5", + "@types/node": "^18.16.0", "@types/nprogress": "^0.2.0", "@types/qrcode": "^1.5.0", "@types/qs": "^6.9.7", - "@typescript-eslint/eslint-plugin": "^5.56.0", - "@typescript-eslint/parser": "^5.56.0", - "@vitejs/plugin-legacy": "^4.0.2", - "@vitejs/plugin-vue": "^4.1.0", + "@typescript-eslint/eslint-plugin": "^5.59.6", + "@typescript-eslint/parser": "^5.59.6", + "@vitejs/plugin-legacy": "^4.0.3", + "@vitejs/plugin-vue": "^4.2.3", "@vitejs/plugin-vue-jsx": "^3.0.1", "autoprefixer": "^10.4.14", "bpmn-js": "^8.9.0", "bpmn-js-properties-panel": "^0.46.0", - "consola": "^2.15.3", - "eslint": "^8.36.0", + "consola": "^3.1.0", + "eslint": "^8.40.0", "eslint-config-prettier": "^8.8.0", - "eslint-define-config": "^1.17.0", + "eslint-define-config": "^1.20.0", "eslint-plugin-prettier": "^4.2.1", - "eslint-plugin-vue": "^9.9.0", - "lint-staged": "^13.2.0", - "postcss": "^8.4.21", + "eslint-plugin-vue": "^9.13.0", + "lint-staged": "^13.2.2", + "postcss": "^8.4.23", "postcss-html": "^1.5.0", "postcss-scss": "^4.0.6", - "prettier": "^2.8.6", - "rimraf": "^4.4.1", - "rollup": "^3.20.0", - "sass": "^1.59.3", - "stylelint": "^15.3.0", + "prettier": "^2.8.8", + "rimraf": "^5.0.1", + "rollup": "^3.22.0", + "sass": "^1.62.1", + "stylelint": "^15.6.2", "stylelint-config-html": "^1.1.0", - "stylelint-config-prettier": "^9.0.5", - "stylelint-config-recommended": "^11.0.0", - "stylelint-config-standard": "^31.0.0", + "stylelint-config-recommended": "^12.0.0", + "stylelint-config-standard": "^33.0.0", "stylelint-order": "^6.0.3", - "terser": "^5.16.6", - "typescript": "5.0.2", - "unplugin-auto-import": "^0.15.1", - "unplugin-element-plus": "^0.7.0", + "terser": "^5.17.4", + "typescript": "5.0.4", + "unplugin-auto-import": "^0.16.0", + "unplugin-element-plus": "^0.7.1", "unplugin-vue-components": "^0.24.1", - "vite": "4.2.1", + "vite": "4.3.8", "vite-plugin-compression": "^0.5.1", "vite-plugin-ejs": "^1.6.4", "vite-plugin-eslint": "^1.8.1", - "vite-plugin-progress": "^0.0.6", + "vite-plugin-progress": "^0.0.7", "vite-plugin-purge-icons": "^0.9.2", "vite-plugin-svg-icons": "^2.0.1", - "vite-plugin-vue-setup-extend": "^0.4.0", - "vite-plugin-windicss": "^1.8.10", - "vue-tsc": "^1.2.0", + "vite-plugin-top-level-await": "^1.3.0", + "vite-plugin-vue-setup-extend-plus": "^0.1.0", + "vite-plugin-windicss": "^1.9.0", + "vue-tsc": "^1.6.5", "windicss": "^3.5.6" }, "engines": { - "node": ">=16.18.0" + "node": ">=16.0.0" }, "license": "MIT", "repository": { diff --git a/src/App.vue b/src/App.vue index a7867a1c..f75478cd 100644 --- a/src/App.vue +++ b/src/App.vue @@ -1,8 +1,9 @@ -