Commit a98af3edbcfb29bc58a49d9325f92cd9430d7ef1
1 parent
1f4e3d6b
feat: 升级vue3
Showing
14 changed files
with
213 additions
and
230 deletions
README.md
| ... | ... | @@ -169,29 +169,29 @@ ps:核心功能已经实现,正在对接微信小程序中... |
| 169 | 169 | |
| 170 | 170 | ### 后端 |
| 171 | 171 | |
| 172 | -| 框架 | 说明 | 版本 | 学习指南 | | |
| 173 | -|---------------------------------------------------------------------------------------------|-----------------------|---------|----------------------------------------------------------------| | |
| 174 | -| [Spring Boot](https://spring.io/projects/spring-boot) | 应用开发框架 | 2.6.10 | [文档](https://github.com/YunaiV/SpringBoot-Labs) | | |
| 175 | -| [MySQL](https://www.mysql.com/cn/) | 数据库服务器 | 5.7 | | | |
| 176 | -| [Druid](https://github.com/alibaba/druid) | JDBC 连接池、监控组件 | 1.2.11 | [文档](http://www.iocoder.cn/Spring-Boot/datasource-pool/?yudao) | | |
| 177 | -| [MyBatis Plus](https://mp.baomidou.com/) | MyBatis 增强工具包 | 3.5.2 | [文档](http://www.iocoder.cn/Spring-Boot/MyBatis/?yudao) | | |
| 178 | -| [Dynamic Datasource](https://dynamic-datasource.com/) | 动态数据源 | 3.5.0 | [文档](http://www.iocoder.cn/Spring-Boot/datasource-pool/?yudao) | | |
| 179 | -| [Redis](https://redis.io/) | key-value 数据库 | 5.0 | | | |
| 180 | -| [Redisson](https://github.com/redisson/redisson) | Redis 客户端 | 3.17.4 | [文档](http://www.iocoder.cn/Spring-Boot/Redis/?yudao) | | |
| 181 | -| [Spring MVC](https://github.com/spring-projects/spring-framework/tree/master/spring-webmvc) | MVC 框架 | 5.3.20 | [文档](http://www.iocoder.cn/SpringMVC/MVC/?yudao) | | |
| 182 | -| [Spring Security](https://github.com/spring-projects/spring-security) | Spring 安全框架 | 5.6.5 | [文档](http://www.iocoder.cn/Spring-Boot/Spring-Security/?yudao) | | |
| 183 | -| [Hibernate Validator](https://github.com/hibernate/hibernate-validator) | 参数校验组件 | 6.2.3 | [文档](http://www.iocoder.cn/Spring-Boot/Validation/?yudao) | | |
| 184 | -| [Flowable](https://github.com/flowable/flowable-engine) | 工作流引擎 | 6.7.2 | [文档](https://doc.iocoder.cn/bpm/) | | |
| 185 | -| [Quartz](https://github.com/quartz-scheduler) | 任务调度组件 | 2.3.2 | [文档](http://www.iocoder.cn/Spring-Boot/Job/?yudao) | | |
| 186 | -| [Knife4j](https://gitee.com/xiaoym/knife4j) | Swagger 增强 UI 实现 | 3.0.3 | [文档](http://www.iocoder.cn/Spring-Boot/Swagger/?yudao) | | |
| 187 | -| [Resilience4j](https://github.com/resilience4j/resilience4j) | 服务保障组件 | 1.7.1 | [文档](http://www.iocoder.cn/Spring-Boot/Resilience4j/?yudao) | | |
| 188 | -| [SkyWalking](https://skywalking.apache.org/) | 分布式应用追踪系统 | 8.5.0 | [文档](http://www.iocoder.cn/Spring-Boot/SkyWalking/?yudao) | | |
| 189 | -| [Spring Boot Admin](https://github.com/codecentric/spring-boot-admin) | Spring Boot 监控平台 | 2.6.7 | [文档](http://www.iocoder.cn/Spring-Boot/Admin/?yudao) | | |
| 190 | -| [Jackson](https://github.com/FasterXML/jackson) | JSON 工具库 | 2.13.3 | | | |
| 191 | -| [MapStruct](https://mapstruct.org/) | Java Bean 转换 | 1.4.1 | [文档](http://www.iocoder.cn/Spring-Boot/MapStruct/?yudao) | | |
| 192 | -| [Lombok](https://projectlombok.org/) | 消除冗长的 Java 代码 | 1.16.14 | [文档](http://www.iocoder.cn/Spring-Boot/Lombok/?yudao) | | |
| 193 | -| [JUnit](https://junit.org/junit5/) | Java 单元测试框架 | 5.8.2 | - | | |
| 194 | -| [Mockito](https://github.com/mockito/mockito) | Java Mock 框架 | 4.0.0 | - | | |
| 172 | +| 框架 | 说明 | 版本 | 学习指南 | | |
| 173 | +|---------------------------------------------------------------------------------------------|-----------------------|------------------|----------------------------------------------------------------| | |
| 174 | +| [Spring Boot](https://spring.io/projects/spring-boot) | 应用开发框架 | 2.6.11 | [文档](https://github.com/YunaiV/SpringBoot-Labs) | | |
| 175 | +| [MySQL](https://www.mysql.com/cn/) | 数据库服务器 | 5.7 | | | |
| 176 | +| [Druid](https://github.com/alibaba/druid) | JDBC 连接池、监控组件 | 1.2.13-SNSAPSHOT | [文档](http://www.iocoder.cn/Spring-Boot/datasource-pool/?yudao) | | |
| 177 | +| [MyBatis Plus](https://mp.baomidou.com/) | MyBatis 增强工具包 | 3.5.2 | [文档](http://www.iocoder.cn/Spring-Boot/MyBatis/?yudao) | | |
| 178 | +| [Dynamic Datasource](https://dynamic-datasource.com/) | 动态数据源 | 3.5.2 | [文档](http://www.iocoder.cn/Spring-Boot/datasource-pool/?yudao) | | |
| 179 | +| [Redis](https://redis.io/) | key-value 数据库 | 5.0 | | | |
| 180 | +| [Redisson](https://github.com/redisson/redisson) | Redis 客户端 | 3.17.7 | [文档](http://www.iocoder.cn/Spring-Boot/Redis/?yudao) | | |
| 181 | +| [Spring MVC](https://github.com/spring-projects/spring-framework/tree/master/spring-webmvc) | MVC 框架 | 5.3.20 | [文档](http://www.iocoder.cn/SpringMVC/MVC/?yudao) | | |
| 182 | +| [Spring Security](https://github.com/spring-projects/spring-security) | Spring 安全框架 | 5.6.5 | [文档](http://www.iocoder.cn/Spring-Boot/Spring-Security/?yudao) | | |
| 183 | +| [Hibernate Validator](https://github.com/hibernate/hibernate-validator) | 参数校验组件 | 6.2.3 | [文档](http://www.iocoder.cn/Spring-Boot/Validation/?yudao) | | |
| 184 | +| [Flowable](https://github.com/flowable/flowable-engine) | 工作流引擎 | 6.7.2 | [文档](https://doc.iocoder.cn/bpm/) | | |
| 185 | +| [Quartz](https://github.com/quartz-scheduler) | 任务调度组件 | 2.3.2 | [文档](http://www.iocoder.cn/Spring-Boot/Job/?yudao) | | |
| 186 | +| [Knife4j](https://gitee.com/xiaoym/knife4j) | Swagger 增强 UI 实现 | 3.0.3 | [文档](http://www.iocoder.cn/Spring-Boot/Swagger/?yudao) | | |
| 187 | +| [Resilience4j](https://github.com/resilience4j/resilience4j) | 服务保障组件 | 1.7.1 | [文档](http://www.iocoder.cn/Spring-Boot/Resilience4j/?yudao) | | |
| 188 | +| [SkyWalking](https://skywalking.apache.org/) | 分布式应用追踪系统 | 8.5.0 | [文档](http://www.iocoder.cn/Spring-Boot/SkyWalking/?yudao) | | |
| 189 | +| [Spring Boot Admin](https://github.com/codecentric/spring-boot-admin) | Spring Boot 监控平台 | 2.6.9 | [文档](http://www.iocoder.cn/Spring-Boot/Admin/?yudao) | | |
| 190 | +| [Jackson](https://github.com/FasterXML/jackson) | JSON 工具库 | 2.13.3 | | | |
| 191 | +| [MapStruct](https://mapstruct.org/) | Java Bean 转换 | 1.5.2.Final | [文档](http://www.iocoder.cn/Spring-Boot/MapStruct/?yudao) | | |
| 192 | +| [Lombok](https://projectlombok.org/) | 消除冗长的 Java 代码 | 1.18.24 | [文档](http://www.iocoder.cn/Spring-Boot/Lombok/?yudao) | | |
| 193 | +| [JUnit](https://junit.org/junit5/) | Java 单元测试框架 | 5.8.2 | - | | |
| 194 | +| [Mockito](https://github.com/mockito/mockito) | Java Mock 框架 | 4.8.0 | - | | |
| 195 | 195 | |
| 196 | 196 | ### [管理后台 Vue2 前端](./yudao-ui-admin) |
| 197 | 197 | |
| ... | ... | @@ -204,14 +204,14 @@ ps:核心功能已经实现,正在对接微信小程序中... |
| 204 | 204 | |
| 205 | 205 | | 框架 | 说明 | 版本 | |
| 206 | 206 | |----------------------------------------------------------------------|-----------------|--------| |
| 207 | -| [Vue](https://staging-cn.vuejs.org/) | Vue 框架 | 3.2.37 | | |
| 208 | -| [Vite](https://cn.vitejs.dev//) | 开发与构建工具 | 3.0.4 | | |
| 209 | -| [Element Plus](https://element-plus.org/zh-CN/) | Element Plus | 2.2.12 | | |
| 210 | -| [TypeScript](https://www.typescriptlang.org/docs/) | TypeScript | 4.7.4 | | |
| 211 | -| [pinia](https://pinia.vuejs.org/) | vuex5 | 2.0.17 | | |
| 207 | +| [Vue](https://staging-cn.vuejs.org/) | Vue 框架 | 3.2.40 | | |
| 208 | +| [Vite](https://cn.vitejs.dev//) | 开发与构建工具 | 3.1.6 | | |
| 209 | +| [Element Plus](https://element-plus.org/zh-CN/) | Element Plus | 2.2.17 | | |
| 210 | +| [TypeScript](https://www.typescriptlang.org/docs/) | TypeScript | 4.8.4 | | |
| 211 | +| [pinia](https://pinia.vuejs.org/) | vuex5 | 2.0.22 | | |
| 212 | 212 | | [vue-i18n](https://kazupon.github.io/vue-i18n/zh/introduction.html/) | 国际化 | 9.2.2 | |
| 213 | 213 | | [windicss](https://cn.windicss.org/) | 下一代工具优先的 CSS 框架 | 3.5.6 | |
| 214 | -| [iconify](https://icon-sets.iconify.design/) | 在线图标库 | 2.2.1 | | |
| 214 | +| [iconify](https://icon-sets.iconify.design/) | 在线图标库 | 3.0.0 | | |
| 215 | 215 | |
| 216 | 216 | ### [管理后台 uni-app 跨端](./yudao-ui-admin-uniapp) |
| 217 | 217 | ... | ... |
yudao-dependencies/pom.xml
| ... | ... | @@ -19,14 +19,14 @@ |
| 19 | 19 | <spring.boot.version>2.6.11</spring.boot.version> |
| 20 | 20 | <!-- Web 相关 --> |
| 21 | 21 | <knife4j.version>3.0.3</knife4j.version> |
| 22 | - <swagger-annotations.version>1.6.6</swagger-annotations.version> | |
| 22 | + <swagger-annotations.version>1.6.7</swagger-annotations.version> | |
| 23 | 23 | <servlet.versoin>2.5</servlet.versoin> |
| 24 | 24 | <!-- DB 相关 --> |
| 25 | 25 | <druid.version>1.2.13-SNSAPSHOT</druid.version> |
| 26 | 26 | <mybatis-plus.version>3.5.2</mybatis-plus.version> |
| 27 | 27 | <mybatis-plus-generator.version>3.5.2</mybatis-plus-generator.version> |
| 28 | 28 | <dynamic-datasource.version>3.5.2</dynamic-datasource.version> |
| 29 | - <redisson.version>3.17.6</redisson.version> | |
| 29 | + <redisson.version>3.17.7</redisson.version> | |
| 30 | 30 | <!-- Config 配置中心相关 --> |
| 31 | 31 | <apollo.version>1.9.2</apollo.version> |
| 32 | 32 | <!-- 服务保障相关 --> |
| ... | ... | @@ -34,11 +34,11 @@ |
| 34 | 34 | <resilience4j.version>1.7.1</resilience4j.version> |
| 35 | 35 | <!-- 监控相关 --> |
| 36 | 36 | <skywalking.version>8.12.0</skywalking.version> |
| 37 | - <spring-boot-admin.version>2.6.7</spring-boot-admin.version> | |
| 38 | - <opentracing.version>0.31.0</opentracing.version> | |
| 37 | + <spring-boot-admin.version>2.6.9</spring-boot-admin.version> | |
| 38 | + <opentracing.version>0.33.0</opentracing.version> | |
| 39 | 39 | <!-- Test 测试相关 --> |
| 40 | 40 | <podam.version>7.2.9.RELEASE</podam.version> |
| 41 | - <jedis-mock.version>1.0.3</jedis-mock.version> | |
| 41 | + <jedis-mock.version>1.0.4</jedis-mock.version> | |
| 42 | 42 | <mockito-inline.version>4.8.0</mockito-inline.version> |
| 43 | 43 | <!-- Bpm 工作流相关 --> |
| 44 | 44 | <flowable.version>6.7.2</flowable.version> |
| ... | ... | @@ -56,7 +56,7 @@ |
| 56 | 56 | <transmittable-thread-local.version>2.14.0</transmittable-thread-local.version> |
| 57 | 57 | <commons-net.version>3.8.0</commons-net.version> |
| 58 | 58 | <jsch.version>0.1.55</jsch.version> |
| 59 | - <tika-core.version>2.4.1</tika-core.version> | |
| 59 | + <tika-core.version>2.5.0</tika-core.version> | |
| 60 | 60 | <aj-captcha.version>1.3.0</aj-captcha.version> |
| 61 | 61 | <netty-all.version>4.1.82.Final</netty-all.version> |
| 62 | 62 | <!-- 三方云服务相关 --> |
| ... | ... | @@ -66,7 +66,7 @@ |
| 66 | 66 | <tencentcloud-sdk-java.version>3.1.561</tencentcloud-sdk-java.version> |
| 67 | 67 | <yunpian-java-sdk.version>1.2.7</yunpian-java-sdk.version> |
| 68 | 68 | <justauth.version>1.4.0</justauth.version> |
| 69 | - <jimureport.version>1.5.2</jimureport.version> | |
| 69 | + <jimureport.version>1.5.3</jimureport.version> | |
| 70 | 70 | <xercesImpl.version>2.12.2</xercesImpl.version> |
| 71 | 71 | </properties> |
| 72 | 72 | ... | ... |
yudao-ui-admin-vue3/package.json
| 1 | 1 | { |
| 2 | 2 | "name": "ruoyi-vue-pro-vue3", |
| 3 | - "version": "1.6.4.1641", | |
| 3 | + "version": "1.6.4.1651", | |
| 4 | 4 | "description": "基于vue3、element-plus、typesScript、vite3", |
| 5 | 5 | "author": "xingyu", |
| 6 | 6 | "private": false, |
| ... | ... | @@ -26,15 +26,15 @@ |
| 26 | 26 | }, |
| 27 | 27 | "dependencies": { |
| 28 | 28 | "@iconify/iconify": "^3.0.0", |
| 29 | - "@vueuse/core": "^9.2.0", | |
| 30 | - "@wangeditor/editor": "^5.1.18", | |
| 29 | + "@vueuse/core": "^9.3.0", | |
| 30 | + "@wangeditor/editor": "^5.1.21", | |
| 31 | 31 | "@wangeditor/editor-for-vue": "^5.1.10", |
| 32 | 32 | "@zxcvbn-ts/core": "^2.0.5", |
| 33 | 33 | "animate.css": "^4.1.1", |
| 34 | 34 | "axios": "^0.27.2", |
| 35 | 35 | "crypto-js": "^4.1.1", |
| 36 | 36 | "dayjs": "^1.11.5", |
| 37 | - "echarts": "^5.3.3", | |
| 37 | + "echarts": "^5.4.0", | |
| 38 | 38 | "echarts-wordcloud": "^2.0.0", |
| 39 | 39 | "element-plus": "2.2.17", |
| 40 | 40 | "intro.js": "^6.0.0", |
| ... | ... | @@ -43,11 +43,10 @@ |
| 43 | 43 | "mitt": "^3.0.0", |
| 44 | 44 | "nprogress": "^0.2.0", |
| 45 | 45 | "pinia": "^2.0.22", |
| 46 | - "pinia-plugin-persist": "^1.0.0", | |
| 47 | 46 | "qrcode": "^1.5.1", |
| 48 | 47 | "qs": "^6.11.0", |
| 49 | 48 | "url": "^0.11.0", |
| 50 | - "vue": "3.2.39", | |
| 49 | + "vue": "3.2.40", | |
| 51 | 50 | "vue-cropper": "^1.0.3", |
| 52 | 51 | "vue-i18n": "9.2.2", |
| 53 | 52 | "vue-router": "^4.1.5", |
| ... | ... | @@ -57,52 +56,53 @@ |
| 57 | 56 | "devDependencies": { |
| 58 | 57 | "@commitlint/cli": "^17.1.2", |
| 59 | 58 | "@commitlint/config-conventional": "^17.1.0", |
| 60 | - "@iconify/json": "^2.1.110", | |
| 61 | - "@intlify/vite-plugin-vue-i18n": "^6.0.1", | |
| 59 | + "@iconify/json": "^2.1.119", | |
| 60 | + "@intlify/vite-plugin-vue-i18n": "^6.0.3", | |
| 62 | 61 | "@purge-icons/generated": "^0.9.0", |
| 63 | 62 | "@types/intro.js": "^5.1.0", |
| 64 | 63 | "@types/lodash-es": "^4.17.6", |
| 65 | - "@types/node": "^18.7.18", | |
| 64 | + "@types/node": "^18.8.3", | |
| 66 | 65 | "@types/nprogress": "^0.2.0", |
| 67 | 66 | "@types/qrcode": "^1.5.0", |
| 68 | 67 | "@types/qs": "^6.9.7", |
| 69 | - "@typescript-eslint/eslint-plugin": "^5.38.0", | |
| 70 | - "@typescript-eslint/parser": "^5.38.0", | |
| 71 | - "@vitejs/plugin-vue": "^3.1.0", | |
| 68 | + "@typescript-eslint/eslint-plugin": "^5.39.0", | |
| 69 | + "@typescript-eslint/parser": "^5.39.0", | |
| 70 | + "@vitejs/plugin-vue": "^3.1.2", | |
| 72 | 71 | "@vitejs/plugin-vue-jsx": "^2.0.1", |
| 73 | - "autoprefixer": "^10.4.11", | |
| 74 | - "eslint": "^8.23.1", | |
| 72 | + "autoprefixer": "^10.4.12", | |
| 73 | + "eslint": "^8.25.0", | |
| 75 | 74 | "eslint-config-prettier": "^8.5.0", |
| 76 | 75 | "eslint-define-config": "^1.7.0", |
| 77 | 76 | "eslint-plugin-prettier": "^4.2.1", |
| 78 | - "eslint-plugin-vue": "^9.5.1", | |
| 77 | + "eslint-plugin-vue": "^9.6.0", | |
| 79 | 78 | "less": "^4.1.3", |
| 80 | 79 | "lint-staged": "^13.0.3", |
| 81 | 80 | "plop": "^3.1.1", |
| 82 | - "postcss": "^8.4.16", | |
| 81 | + "postcss": "^8.4.17", | |
| 83 | 82 | "postcss-html": "^1.5.0", |
| 84 | 83 | "postcss-less": "^6.0.0", |
| 85 | 84 | "prettier": "^2.7.1", |
| 86 | 85 | "rimraf": "^3.0.2", |
| 87 | - "rollup": "^2.79.0", | |
| 88 | - "stylelint": "^14.12.0", | |
| 86 | + "rollup": "^2.79.1", | |
| 87 | + "stylelint": "^14.13.0", | |
| 89 | 88 | "stylelint-config-html": "^1.1.0", |
| 90 | 89 | "stylelint-config-prettier": "^9.0.3", |
| 91 | 90 | "stylelint-config-recommended": "^9.0.0", |
| 92 | 91 | "stylelint-config-standard": "^28.0.0", |
| 93 | 92 | "stylelint-order": "^5.0.0", |
| 94 | - "typescript": "4.8.3", | |
| 95 | - "unplugin-vue-define-options": "^0.11.2", | |
| 96 | - "vite": "3.1.3", | |
| 93 | + "typescript": "4.8.4", | |
| 94 | + "unplugin-vue-macros": "^0.12.0", | |
| 95 | + "vite": "3.1.6", | |
| 97 | 96 | "vite-plugin-compression": "^0.5.1", |
| 98 | 97 | "vite-plugin-eslint": "^1.8.1", |
| 99 | 98 | "vite-plugin-html": "^3.2.0", |
| 100 | 99 | "vite-plugin-purge-icons": "^0.9.1", |
| 101 | - "vite-plugin-style-import": "^2.0.0", | |
| 100 | + "vite-plugin-style-import": "2.0.0", | |
| 102 | 101 | "vite-plugin-svg-icons": "^2.0.1", |
| 103 | 102 | "vite-plugin-windicss": "^1.8.8", |
| 104 | 103 | "vue-tsc": "^0.40.13", |
| 105 | - "windicss": "^3.5.6" | |
| 104 | + "windicss": "^3.5.6", | |
| 105 | + "windicss-analysis": "^0.3.5" | |
| 106 | 106 | }, |
| 107 | 107 | "engines": { |
| 108 | 108 | "node": ">= 14.18.0" | ... | ... |
yudao-ui-admin-vue3/src/components/Form/src/components/useRenderSelect.tsx
| ... | ... | @@ -29,8 +29,15 @@ export const useRenderSelect = (slots: Slots) => { |
| 29 | 29 | // 如果有别名,就取别名 |
| 30 | 30 | const labelAlias = item?.componentProps?.optionsAlias?.labelField |
| 31 | 31 | const valueAlias = item?.componentProps?.optionsAlias?.valueField |
| 32 | + | |
| 33 | + const { label, value, ...other } = option | |
| 34 | + | |
| 32 | 35 | return ( |
| 33 | - <ElOption label={option[labelAlias || 'label']} value={option[valueAlias || 'value']}> | |
| 36 | + <ElOption | |
| 37 | + label={labelAlias ? option[labelAlias] : label} | |
| 38 | + value={valueAlias ? option[valueAlias] : value} | |
| 39 | + {...other} | |
| 40 | + > | |
| 34 | 41 | {{ |
| 35 | 42 | default: () => |
| 36 | 43 | // option 插槽名规则,{field}-option | ... | ... |
yudao-ui-admin-vue3/src/config/app.ts deleted
| 1 | -import { useCache } from '@/hooks/web/useCache' | |
| 2 | - | |
| 3 | -const { wsCache } = useCache() | |
| 4 | - | |
| 5 | -export type LayoutType = 'classic' | 'topLeft' | 'top' | 'cutMenu' | |
| 6 | - | |
| 7 | -export type ThemeTypes = { | |
| 8 | - elColorPrimary?: string | |
| 9 | - leftMenuBorderColor?: string | |
| 10 | - leftMenuBgColor?: string | |
| 11 | - leftMenuBgLightColor?: string | |
| 12 | - leftMenuBgActiveColor?: string | |
| 13 | - leftMenuCollapseBgActiveColor?: string | |
| 14 | - leftMenuTextColor?: string | |
| 15 | - leftMenuTextActiveColor?: string | |
| 16 | - logoTitleTextColor?: string | |
| 17 | - logoBorderColor?: string | |
| 18 | - topHeaderBgColor?: string | |
| 19 | - topHeaderTextColor?: string | |
| 20 | - topHeaderHoverColor?: string | |
| 21 | - topToolBorderColor?: string | |
| 22 | -} | |
| 23 | -export interface AppState { | |
| 24 | - breadcrumb: boolean | |
| 25 | - breadcrumbIcon: boolean | |
| 26 | - collapse: boolean | |
| 27 | - uniqueOpened: boolean | |
| 28 | - hamburger: boolean | |
| 29 | - screenfull: boolean | |
| 30 | - size: boolean | |
| 31 | - locale: boolean | |
| 32 | - tagsView: boolean | |
| 33 | - tagsViewIcon: boolean | |
| 34 | - logo: boolean | |
| 35 | - fixedHeader: boolean | |
| 36 | - greyMode: boolean | |
| 37 | - pageLoading: boolean | |
| 38 | - layout: LayoutType | |
| 39 | - title: string | |
| 40 | - userInfo: string | |
| 41 | - isDark: boolean | |
| 42 | - currentSize: ElememtPlusSize | |
| 43 | - sizeMap: ElememtPlusSize[] | |
| 44 | - mobile: boolean | |
| 45 | - footer: boolean | |
| 46 | - theme: ThemeTypes | |
| 47 | -} | |
| 48 | - | |
| 49 | -export const appModules: AppState = { | |
| 50 | - userInfo: 'userInfo', // 登录信息存储字段-建议每个项目换一个字段,避免与其他项目冲突 | |
| 51 | - sizeMap: ['default', 'large', 'small'], | |
| 52 | - mobile: false, // 是否是移动端 | |
| 53 | - title: import.meta.env.VITE_APP_TITLE, // 标题 | |
| 54 | - pageLoading: false, // 路由跳转loading | |
| 55 | - | |
| 56 | - breadcrumb: true, // 面包屑 | |
| 57 | - breadcrumbIcon: false, // 面包屑图标 | |
| 58 | - collapse: false, // 折叠菜单 | |
| 59 | - uniqueOpened: true, // 是否只保持一个子菜单的展开 | |
| 60 | - hamburger: true, // 折叠图标 | |
| 61 | - screenfull: true, // 全屏图标 | |
| 62 | - size: true, // 尺寸图标 | |
| 63 | - locale: true, // 多语言图标 | |
| 64 | - tagsView: true, // 标签页 | |
| 65 | - tagsViewIcon: false, // 是否显示标签图标 | |
| 66 | - logo: true, // logo | |
| 67 | - fixedHeader: true, // 固定toolheader | |
| 68 | - footer: true, // 显示页脚 | |
| 69 | - greyMode: false, // 是否开始灰色模式,用于特殊悼念日 | |
| 70 | - | |
| 71 | - layout: wsCache.get('layout') || 'topLeft', // layout布局 | |
| 72 | - isDark: wsCache.get('isDark') || false, // 是否是暗黑模式 | |
| 73 | - currentSize: wsCache.get('default') || 'default', // 组件尺寸 | |
| 74 | - theme: wsCache.get('theme') || { | |
| 75 | - // 主题色 | |
| 76 | - elColorPrimary: '#409eff', | |
| 77 | - // 左侧菜单边框颜色 | |
| 78 | - leftMenuBorderColor: 'inherit', | |
| 79 | - // 左侧菜单背景颜色 | |
| 80 | - leftMenuBgColor: '#001529', | |
| 81 | - // 左侧菜单浅色背景颜色 | |
| 82 | - leftMenuBgLightColor: '#0f2438', | |
| 83 | - // 左侧菜单选中背景颜色 | |
| 84 | - leftMenuBgActiveColor: 'var(--el-color-primary)', | |
| 85 | - // 左侧菜单收起选中背景颜色 | |
| 86 | - leftMenuCollapseBgActiveColor: 'var(--el-color-primary)', | |
| 87 | - // 左侧菜单字体颜色 | |
| 88 | - leftMenuTextColor: '#bfcbd9', | |
| 89 | - // 左侧菜单选中字体颜色 | |
| 90 | - leftMenuTextActiveColor: '#fff', | |
| 91 | - // logo字体颜色 | |
| 92 | - logoTitleTextColor: '#fff', | |
| 93 | - // logo边框颜色 | |
| 94 | - logoBorderColor: 'inherit', | |
| 95 | - // 头部背景颜色 | |
| 96 | - topHeaderBgColor: '#fff', | |
| 97 | - // 头部字体颜色 | |
| 98 | - topHeaderTextColor: 'inherit', | |
| 99 | - // 头部悬停颜色 | |
| 100 | - topHeaderHoverColor: '#f6f6f6', | |
| 101 | - // 头部边框颜色 | |
| 102 | - topToolBorderColor: '#eee' | |
| 103 | - } | |
| 104 | -} |
yudao-ui-admin-vue3/src/config/axios/index.ts
| 1 | -import axios, { AxiosInstance, AxiosRequestConfig, AxiosResponse, AxiosError } from 'axios' | |
| 1 | +import axios, { | |
| 2 | + AxiosInstance, | |
| 3 | + AxiosRequestConfig, | |
| 4 | + AxiosRequestHeaders, | |
| 5 | + AxiosResponse, | |
| 6 | + AxiosError | |
| 7 | +} from 'axios' | |
| 2 | 8 | import { ElMessage, ElMessageBox, ElNotification } from 'element-plus' |
| 3 | 9 | import qs from 'qs' |
| 4 | 10 | import { config } from '@/config/axios/config' |
| ... | ... | @@ -48,7 +54,8 @@ service.interceptors.request.use( |
| 48 | 54 | const data = config.data || false |
| 49 | 55 | if ( |
| 50 | 56 | config.method?.toUpperCase() === 'POST' && |
| 51 | - config!.headers!['Content-Type'] === 'application/x-www-form-urlencoded' | |
| 57 | + (config.headers as AxiosRequestHeaders)['Content-Type'] === | |
| 58 | + 'application/x-www-form-urlencoded' | |
| 52 | 59 | ) { |
| 53 | 60 | config.data = qs.stringify(data) |
| 54 | 61 | } | ... | ... |
yudao-ui-admin-vue3/src/config/locale.ts deleted
| 1 | -import { useCache } from '@/hooks/web/useCache' | |
| 2 | -import zhCn from 'element-plus/es/locale/lang/zh-cn' | |
| 3 | -import en from 'element-plus/es/locale/lang/en' | |
| 4 | - | |
| 5 | -const { wsCache } = useCache() | |
| 6 | - | |
| 7 | -export const elLocaleMap = { | |
| 8 | - 'zh-CN': zhCn, | |
| 9 | - en: en | |
| 10 | -} | |
| 11 | -export interface LocaleState { | |
| 12 | - currentLocale: LocaleDropdownType | |
| 13 | - localeMap: LocaleDropdownType[] | |
| 14 | -} | |
| 15 | - | |
| 16 | -export const localeModules: LocaleState = { | |
| 17 | - currentLocale: { | |
| 18 | - lang: wsCache.get('lang') || 'zh-CN', | |
| 19 | - elLocale: elLocaleMap[wsCache.get('lang') || 'zh-CN'] | |
| 20 | - }, | |
| 21 | - // 多语言 | |
| 22 | - localeMap: [ | |
| 23 | - { | |
| 24 | - lang: 'zh-CN', | |
| 25 | - name: '简体中文' | |
| 26 | - }, | |
| 27 | - { | |
| 28 | - lang: 'en', | |
| 29 | - name: 'English' | |
| 30 | - } | |
| 31 | - ] | |
| 32 | -} |
yudao-ui-admin-vue3/src/store/index.ts
yudao-ui-admin-vue3/src/store/modules/app.ts
| 1 | 1 | import { defineStore } from 'pinia' |
| 2 | 2 | import { store } from '../index' |
| 3 | -import { useCache } from '@/hooks/web/useCache' | |
| 4 | -import { appModules } from '@/config/app' | |
| 5 | -import type { AppState, LayoutType, ThemeTypes } from '@/config/app' | |
| 6 | 3 | import { setCssVar, humpToUnderline } from '@/utils' |
| 7 | 4 | import { ElMessage } from 'element-plus' |
| 5 | +import { useCache } from '@/hooks/web/useCache' | |
| 8 | 6 | |
| 9 | 7 | const { wsCache } = useCache() |
| 10 | 8 | |
| 11 | -export const useAppStore = defineStore({ | |
| 12 | - id: 'app', | |
| 13 | - state: (): AppState => appModules, | |
| 14 | - persist: { | |
| 15 | - enabled: true | |
| 9 | +type LayoutType = 'classic' | 'topLeft' | 'top' | 'cutMenu' | |
| 10 | + | |
| 11 | +type ThemeTypes = { | |
| 12 | + elColorPrimary?: string | |
| 13 | + leftMenuBorderColor?: string | |
| 14 | + leftMenuBgColor?: string | |
| 15 | + leftMenuBgLightColor?: string | |
| 16 | + leftMenuBgActiveColor?: string | |
| 17 | + leftMenuCollapseBgActiveColor?: string | |
| 18 | + leftMenuTextColor?: string | |
| 19 | + leftMenuTextActiveColor?: string | |
| 20 | + logoTitleTextColor?: string | |
| 21 | + logoBorderColor?: string | |
| 22 | + topHeaderBgColor?: string | |
| 23 | + topHeaderTextColor?: string | |
| 24 | + topHeaderHoverColor?: string | |
| 25 | + topToolBorderColor?: string | |
| 26 | +} | |
| 27 | +interface AppState { | |
| 28 | + breadcrumb: boolean | |
| 29 | + breadcrumbIcon: boolean | |
| 30 | + collapse: boolean | |
| 31 | + uniqueOpened: boolean | |
| 32 | + hamburger: boolean | |
| 33 | + screenfull: boolean | |
| 34 | + size: boolean | |
| 35 | + locale: boolean | |
| 36 | + tagsView: boolean | |
| 37 | + tagsViewIcon: boolean | |
| 38 | + logo: boolean | |
| 39 | + fixedHeader: boolean | |
| 40 | + greyMode: boolean | |
| 41 | + pageLoading: boolean | |
| 42 | + layout: LayoutType | |
| 43 | + title: string | |
| 44 | + userInfo: string | |
| 45 | + isDark: boolean | |
| 46 | + currentSize: ElememtPlusSize | |
| 47 | + sizeMap: ElememtPlusSize[] | |
| 48 | + mobile: boolean | |
| 49 | + footer: boolean | |
| 50 | + theme: ThemeTypes | |
| 51 | +} | |
| 52 | + | |
| 53 | +export const useAppStore = defineStore('app', { | |
| 54 | + state: (): AppState => { | |
| 55 | + return { | |
| 56 | + userInfo: 'userInfo', // 登录信息存储字段-建议每个项目换一个字段,避免与其他项目冲突 | |
| 57 | + sizeMap: ['default', 'large', 'small'], | |
| 58 | + mobile: false, // 是否是移动端 | |
| 59 | + title: import.meta.env.VITE_APP_TITLE, // 标题 | |
| 60 | + pageLoading: false, // 路由跳转loading | |
| 61 | + | |
| 62 | + breadcrumb: true, // 面包屑 | |
| 63 | + breadcrumbIcon: true, // 面包屑图标 | |
| 64 | + collapse: false, // 折叠菜单 | |
| 65 | + uniqueOpened: true, // 是否只保持一个子菜单的展开 | |
| 66 | + hamburger: true, // 折叠图标 | |
| 67 | + screenfull: true, // 全屏图标 | |
| 68 | + size: true, // 尺寸图标 | |
| 69 | + locale: true, // 多语言图标 | |
| 70 | + tagsView: true, // 标签页 | |
| 71 | + tagsViewIcon: true, // 是否显示标签图标 | |
| 72 | + logo: true, // logo | |
| 73 | + fixedHeader: true, // 固定toolheader | |
| 74 | + footer: true, // 显示页脚 | |
| 75 | + greyMode: false, // 是否开始灰色模式,用于特殊悼念日 | |
| 76 | + | |
| 77 | + layout: wsCache.get('layout') || 'classic', // layout布局 | |
| 78 | + isDark: wsCache.get('isDark') || false, // 是否是暗黑模式 | |
| 79 | + currentSize: wsCache.get('default') || 'default', // 组件尺寸 | |
| 80 | + theme: wsCache.get('theme') || { | |
| 81 | + // 主题色 | |
| 82 | + elColorPrimary: '#409eff', | |
| 83 | + // 左侧菜单边框颜色 | |
| 84 | + leftMenuBorderColor: 'inherit', | |
| 85 | + // 左侧菜单背景颜色 | |
| 86 | + leftMenuBgColor: '#001529', | |
| 87 | + // 左侧菜单浅色背景颜色 | |
| 88 | + leftMenuBgLightColor: '#0f2438', | |
| 89 | + // 左侧菜单选中背景颜色 | |
| 90 | + leftMenuBgActiveColor: 'var(--el-color-primary)', | |
| 91 | + // 左侧菜单收起选中背景颜色 | |
| 92 | + leftMenuCollapseBgActiveColor: 'var(--el-color-primary)', | |
| 93 | + // 左侧菜单字体颜色 | |
| 94 | + leftMenuTextColor: '#bfcbd9', | |
| 95 | + // 左侧菜单选中字体颜色 | |
| 96 | + leftMenuTextActiveColor: '#fff', | |
| 97 | + // logo字体颜色 | |
| 98 | + logoTitleTextColor: '#fff', | |
| 99 | + // logo边框颜色 | |
| 100 | + logoBorderColor: 'inherit', | |
| 101 | + // 头部背景颜色 | |
| 102 | + topHeaderBgColor: '#fff', | |
| 103 | + // 头部字体颜色 | |
| 104 | + topHeaderTextColor: 'inherit', | |
| 105 | + // 头部悬停颜色 | |
| 106 | + topHeaderHoverColor: '#f6f6f6', | |
| 107 | + // 头部边框颜色 | |
| 108 | + topToolBorderColor: '#eee' | |
| 109 | + } | |
| 110 | + } | |
| 16 | 111 | }, |
| 17 | 112 | getters: { |
| 18 | 113 | getBreadcrumb(): boolean { | ... | ... |
yudao-ui-admin-vue3/src/store/modules/dict.ts
| ... | ... | @@ -16,14 +16,10 @@ export interface DictState { |
| 16 | 16 | dictMap: Recordable |
| 17 | 17 | } |
| 18 | 18 | |
| 19 | -export const useDictStore = defineStore({ | |
| 20 | - id: 'dict', | |
| 19 | +export const useDictStore = defineStore('dict', { | |
| 21 | 20 | state: (): DictState => ({ |
| 22 | 21 | dictMap: {} |
| 23 | 22 | }), |
| 24 | - persist: { | |
| 25 | - enabled: true | |
| 26 | - }, | |
| 27 | 23 | getters: { |
| 28 | 24 | getDictMap(): Recordable { |
| 29 | 25 | return this.dictMap | ... | ... |
yudao-ui-admin-vue3/src/store/modules/locale.ts
| 1 | 1 | import { defineStore } from 'pinia' |
| 2 | 2 | import { store } from '../index' |
| 3 | +import zhCn from 'element-plus/es/locale/lang/zh-cn' | |
| 4 | +import en from 'element-plus/es/locale/lang/en' | |
| 3 | 5 | import { useCache } from '@/hooks/web/useCache' |
| 4 | -import { localeModules, elLocaleMap } from '@/config/locale' | |
| 5 | -import type { LocaleState } from '@/config/locale' | |
| 6 | 6 | |
| 7 | 7 | const { wsCache } = useCache() |
| 8 | 8 | |
| 9 | -export const useLocaleStore = defineStore({ | |
| 10 | - id: 'locales', | |
| 11 | - state: (): LocaleState => localeModules, | |
| 12 | - persist: { | |
| 13 | - enabled: true | |
| 9 | +const elLocaleMap = { | |
| 10 | + 'zh-CN': zhCn, | |
| 11 | + en: en | |
| 12 | +} | |
| 13 | +interface LocaleState { | |
| 14 | + currentLocale: LocaleDropdownType | |
| 15 | + localeMap: LocaleDropdownType[] | |
| 16 | +} | |
| 17 | + | |
| 18 | +export const useLocaleStore = defineStore('locales', { | |
| 19 | + state: (): LocaleState => { | |
| 20 | + return { | |
| 21 | + currentLocale: { | |
| 22 | + lang: wsCache.get('lang') || 'zh-CN', | |
| 23 | + elLocale: elLocaleMap[wsCache.get('lang') || 'zh-CN'] | |
| 24 | + }, | |
| 25 | + // 多语言 | |
| 26 | + localeMap: [ | |
| 27 | + { | |
| 28 | + lang: 'zh-CN', | |
| 29 | + name: '简体中文' | |
| 30 | + }, | |
| 31 | + { | |
| 32 | + lang: 'en', | |
| 33 | + name: 'English' | |
| 34 | + } | |
| 35 | + ] | |
| 36 | + } | |
| 14 | 37 | }, |
| 15 | 38 | getters: { |
| 16 | 39 | getCurrentLocale(): LocaleDropdownType { | ... | ... |
yudao-ui-admin-vue3/src/store/modules/permission.ts
| ... | ... | @@ -14,16 +14,12 @@ export interface PermissionState { |
| 14 | 14 | menuTabRouters: AppRouteRecordRaw[] |
| 15 | 15 | } |
| 16 | 16 | |
| 17 | -export const usePermissionStore = defineStore({ | |
| 18 | - id: 'permission', | |
| 17 | +export const usePermissionStore = defineStore('permission', { | |
| 19 | 18 | state: (): PermissionState => ({ |
| 20 | 19 | routers: [], |
| 21 | 20 | addRouters: [], |
| 22 | 21 | menuTabRouters: [] |
| 23 | 22 | }), |
| 24 | - persist: { | |
| 25 | - enabled: true | |
| 26 | - }, | |
| 27 | 23 | getters: { |
| 28 | 24 | getRouters(): AppRouteRecordRaw[] { |
| 29 | 25 | return this.routers | ... | ... |
yudao-ui-admin-vue3/src/store/modules/tagsView.ts
| ... | ... | @@ -10,8 +10,7 @@ export interface TagsViewState { |
| 10 | 10 | cachedViews: Set<string> |
| 11 | 11 | } |
| 12 | 12 | |
| 13 | -export const useTagsViewStore = defineStore({ | |
| 14 | - id: 'tagsView', | |
| 13 | +export const useTagsViewStore = defineStore('tagsView', { | |
| 15 | 14 | state: (): TagsViewState => ({ |
| 16 | 15 | visitedViews: [], |
| 17 | 16 | cachedViews: new Set() | ... | ... |
yudao-ui-admin-vue3/src/store/modules/user.ts