Commit d1736af6daf9ce446b07cc448f5aef3dc57b1def

Authored by 芋道源码
Committed by Gitee
2 parents 587360a5 922b39c0

!271 升级后端及 vue3部分依赖

Merge pull request !271 from xingyu/dev
Showing 115 changed files with 1247 additions and 900 deletions
README.md
@@ -174,29 +174,29 @@ ps:核心功能已经实现,正在对接微信小程序中... @@ -174,29 +174,29 @@ ps:核心功能已经实现,正在对接微信小程序中...
174 174
175 ### 后端 175 ### 后端
176 176
177 -| 框架 | 说明 | 版本 | 学习指南 |  
178 -|---------------------------------------------------------------------------------------------|-----------------------|---------|----------------------------------------------------------------|  
179 -| [Spring Boot](https://spring.io/projects/spring-boot) | 应用开发框架 | 2.6.10 | [文档](https://github.com/YunaiV/SpringBoot-Labs) |  
180 -| [MySQL](https://www.mysql.com/cn/) | 数据库服务器 | 5.7 | |  
181 -| [Druid](https://github.com/alibaba/druid) | JDBC 连接池、监控组件 | 1.2.11 | [文档](http://www.iocoder.cn/Spring-Boot/datasource-pool/?yudao) |  
182 -| [MyBatis Plus](https://mp.baomidou.com/) | MyBatis 增强工具包 | 3.5.2 | [文档](http://www.iocoder.cn/Spring-Boot/MyBatis/?yudao) |  
183 -| [Dynamic Datasource](https://dynamic-datasource.com/) | 动态数据源 | 3.5.0 | [文档](http://www.iocoder.cn/Spring-Boot/datasource-pool/?yudao) |  
184 -| [Redis](https://redis.io/) | key-value 数据库 | 5.0 | |  
185 -| [Redisson](https://github.com/redisson/redisson) | Redis 客户端 | 3.17.4 | [文档](http://www.iocoder.cn/Spring-Boot/Redis/?yudao) |  
186 -| [Spring MVC](https://github.com/spring-projects/spring-framework/tree/master/spring-webmvc) | MVC 框架 | 5.3.20 | [文档](http://www.iocoder.cn/SpringMVC/MVC/?yudao) |  
187 -| [Spring Security](https://github.com/spring-projects/spring-security) | Spring 安全框架 | 5.6.5 | [文档](http://www.iocoder.cn/Spring-Boot/Spring-Security/?yudao) |  
188 -| [Hibernate Validator](https://github.com/hibernate/hibernate-validator) | 参数校验组件 | 6.2.3 | [文档](http://www.iocoder.cn/Spring-Boot/Validation/?yudao) |  
189 -| [Flowable](https://github.com/flowable/flowable-engine) | 工作流引擎 | 6.7.2 | [文档](https://doc.iocoder.cn/bpm/) |  
190 -| [Quartz](https://github.com/quartz-scheduler) | 任务调度组件 | 2.3.2 | [文档](http://www.iocoder.cn/Spring-Boot/Job/?yudao) |  
191 -| [Knife4j](https://gitee.com/xiaoym/knife4j) | Swagger 增强 UI 实现 | 3.0.3 | [文档](http://www.iocoder.cn/Spring-Boot/Swagger/?yudao) |  
192 -| [Resilience4j](https://github.com/resilience4j/resilience4j) | 服务保障组件 | 1.7.1 | [文档](http://www.iocoder.cn/Spring-Boot/Resilience4j/?yudao) |  
193 -| [SkyWalking](https://skywalking.apache.org/) | 分布式应用追踪系统 | 8.5.0 | [文档](http://www.iocoder.cn/Spring-Boot/SkyWalking/?yudao) |  
194 -| [Spring Boot Admin](https://github.com/codecentric/spring-boot-admin) | Spring Boot 监控平台 | 2.6.7 | [文档](http://www.iocoder.cn/Spring-Boot/Admin/?yudao) |  
195 -| [Jackson](https://github.com/FasterXML/jackson) | JSON 工具库 | 2.13.3 | |  
196 -| [MapStruct](https://mapstruct.org/) | Java Bean 转换 | 1.4.1 | [文档](http://www.iocoder.cn/Spring-Boot/MapStruct/?yudao) |  
197 -| [Lombok](https://projectlombok.org/) | 消除冗长的 Java 代码 | 1.16.14 | [文档](http://www.iocoder.cn/Spring-Boot/Lombok/?yudao) |  
198 -| [JUnit](https://junit.org/junit5/) | Java 单元测试框架 | 5.8.2 | - |  
199 -| [Mockito](https://github.com/mockito/mockito) | Java Mock 框架 | 4.0.0 | - | 177 +| 框架 | 说明 | 版本 | 学习指南 |
  178 +|---------------------------------------------------------------------------------------------|-----------------------|------------------|----------------------------------------------------------------|
  179 +| [Spring Boot](https://spring.io/projects/spring-boot) | 应用开发框架 | 2.6.12 | [文档](https://github.com/YunaiV/SpringBoot-Labs) |
  180 +| [MySQL](https://www.mysql.com/cn/) | 数据库服务器 | 5.7 / 8.0+ | |
  181 +| [Druid](https://github.com/alibaba/druid) | JDBC 连接池、监控组件 | 1.2.13-SNSAPSHOT | [文档](http://www.iocoder.cn/Spring-Boot/datasource-pool/?yudao) |
  182 +| [MyBatis Plus](https://mp.baomidou.com/) | MyBatis 增强工具包 | 3.5.2 | [文档](http://www.iocoder.cn/Spring-Boot/MyBatis/?yudao) |
  183 +| [Dynamic Datasource](https://dynamic-datasource.com/) | 动态数据源 | 3.5.2 | [文档](http://www.iocoder.cn/Spring-Boot/datasource-pool/?yudao) |
  184 +| [Redis](https://redis.io/) | key-value 数据库 | 5.0 | |
  185 +| [Redisson](https://github.com/redisson/redisson) | Redis 客户端 | 3.17.7 | [文档](http://www.iocoder.cn/Spring-Boot/Redis/?yudao) |
  186 +| [Spring MVC](https://github.com/spring-projects/spring-framework/tree/master/spring-webmvc) | MVC 框架 | 5.3.20 | [文档](http://www.iocoder.cn/SpringMVC/MVC/?yudao) |
  187 +| [Spring Security](https://github.com/spring-projects/spring-security) | Spring 安全框架 | 5.6.5 | [文档](http://www.iocoder.cn/Spring-Boot/Spring-Security/?yudao) |
  188 +| [Hibernate Validator](https://github.com/hibernate/hibernate-validator) | 参数校验组件 | 6.2.3 | [文档](http://www.iocoder.cn/Spring-Boot/Validation/?yudao) |
  189 +| [Flowable](https://github.com/flowable/flowable-engine) | 工作流引擎 | 6.7.2 | [文档](https://doc.iocoder.cn/bpm/) |
  190 +| [Quartz](https://github.com/quartz-scheduler) | 任务调度组件 | 2.3.2 | [文档](http://www.iocoder.cn/Spring-Boot/Job/?yudao) |
  191 +| [Knife4j](https://gitee.com/xiaoym/knife4j) | Swagger 增强 UI 实现 | 3.0.3 | [文档](http://www.iocoder.cn/Spring-Boot/Swagger/?yudao) |
  192 +| [Resilience4j](https://github.com/resilience4j/resilience4j) | 服务保障组件 | 1.7.1 | [文档](http://www.iocoder.cn/Spring-Boot/Resilience4j/?yudao) |
  193 +| [SkyWalking](https://skywalking.apache.org/) | 分布式应用追踪系统 | 8.5.0 | [文档](http://www.iocoder.cn/Spring-Boot/SkyWalking/?yudao) |
  194 +| [Spring Boot Admin](https://github.com/codecentric/spring-boot-admin) | Spring Boot 监控平台 | 2.6.9 | [文档](http://www.iocoder.cn/Spring-Boot/Admin/?yudao) |
  195 +| [Jackson](https://github.com/FasterXML/jackson) | JSON 工具库 | 2.13.3 | |
  196 +| [MapStruct](https://mapstruct.org/) | Java Bean 转换 | 1.5.2.Final | [文档](http://www.iocoder.cn/Spring-Boot/MapStruct/?yudao) |
  197 +| [Lombok](https://projectlombok.org/) | 消除冗长的 Java 代码 | 1.18.24 | [文档](http://www.iocoder.cn/Spring-Boot/Lombok/?yudao) |
  198 +| [JUnit](https://junit.org/junit5/) | Java 单元测试框架 | 5.8.2 | - |
  199 +| [Mockito](https://github.com/mockito/mockito) | Java Mock 框架 | 4.8.0 | - |
200 200
201 ### [管理后台 Vue2 前端](./yudao-ui-admin) 201 ### [管理后台 Vue2 前端](./yudao-ui-admin)
202 202
@@ -209,14 +209,14 @@ ps:核心功能已经实现,正在对接微信小程序中... @@ -209,14 +209,14 @@ ps:核心功能已经实现,正在对接微信小程序中...
209 209
210 | 框架 | 说明 | 版本 | 210 | 框架 | 说明 | 版本 |
211 |----------------------------------------------------------------------|-----------------|--------| 211 |----------------------------------------------------------------------|-----------------|--------|
212 -| [Vue](https://staging-cn.vuejs.org/) | Vue 框架 | 3.2.37 |  
213 -| [Vite](https://cn.vitejs.dev//) | 开发与构建工具 | 3.0.4 |  
214 -| [Element Plus](https://element-plus.org/zh-CN/) | Element Plus | 2.2.12 |  
215 -| [TypeScript](https://www.typescriptlang.org/docs/) | TypeScript | 4.7.4 |  
216 -| [pinia](https://pinia.vuejs.org/) | vuex5 | 2.0.17 | 212 +| [Vue](https://staging-cn.vuejs.org/) | Vue 框架 | 3.2.41 |
  213 +| [Vite](https://cn.vitejs.dev//) | 开发与构建工具 | 3.1.8 |
  214 +| [Element Plus](https://element-plus.org/zh-CN/) | Element Plus | 2.2.18 |
  215 +| [TypeScript](https://www.typescriptlang.org/docs/) | TypeScript | 4.8.4 |
  216 +| [pinia](https://pinia.vuejs.org/) | vuex5 | 2.0.23 |
217 | [vue-i18n](https://kazupon.github.io/vue-i18n/zh/introduction.html/) | 国际化 | 9.2.2 | 217 | [vue-i18n](https://kazupon.github.io/vue-i18n/zh/introduction.html/) | 国际化 | 9.2.2 |
218 | [windicss](https://cn.windicss.org/) | 下一代工具优先的 CSS 框架 | 3.5.6 | 218 | [windicss](https://cn.windicss.org/) | 下一代工具优先的 CSS 框架 | 3.5.6 |
219 -| [iconify](https://icon-sets.iconify.design/) | 在线图标库 | 2.2.1 | 219 +| [iconify](https://icon-sets.iconify.design/) | 在线图标库 | 3.0.0 |
220 220
221 ### [管理后台 uni-app 跨端](./yudao-ui-admin-uniapp) 221 ### [管理后台 uni-app 跨端](./yudao-ui-admin-uniapp)
222 222
@@ -37,8 +37,8 @@ @@ -37,8 +37,8 @@
37 <maven-surefire-plugin.version>3.0.0-M5</maven-surefire-plugin.version> 37 <maven-surefire-plugin.version>3.0.0-M5</maven-surefire-plugin.version>
38 <maven-compiler-plugin.version>3.8.0</maven-compiler-plugin.version> 38 <maven-compiler-plugin.version>3.8.0</maven-compiler-plugin.version>
39 <!-- 看看咋放到 bom 里 --> 39 <!-- 看看咋放到 bom 里 -->
40 - <lombok.version>1.18.20</lombok.version>  
41 - <mapstruct.version>1.4.1.Final</mapstruct.version> 40 + <lombok.version>1.18.24</lombok.version>
  41 + <mapstruct.version>1.5.2.Final</mapstruct.version>
42 <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding> 42 <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
43 </properties> 43 </properties>
44 44
yudao-dependencies/pom.xml
@@ -16,58 +16,58 @@ @@ -16,58 +16,58 @@
16 <properties> 16 <properties>
17 <revision>1.6.4-snapshot</revision> 17 <revision>1.6.4-snapshot</revision>
18 <!-- 统一依赖管理 --> 18 <!-- 统一依赖管理 -->
19 - <spring.boot.version>2.6.10</spring.boot.version> 19 + <spring.boot.version>2.6.12</spring.boot.version>
20 <!-- Web 相关 --> 20 <!-- Web 相关 -->
21 <knife4j.version>3.0.3</knife4j.version> 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 <servlet.versoin>2.5</servlet.versoin> 23 <servlet.versoin>2.5</servlet.versoin>
24 <!-- DB 相关 --> 24 <!-- DB 相关 -->
25 - <druid.version>1.2.11</druid.version> 25 + <druid.version>1.2.13-SNSAPSHOT</druid.version>
26 <mybatis-plus.version>3.5.2</mybatis-plus.version> 26 <mybatis-plus.version>3.5.2</mybatis-plus.version>
27 <mybatis-plus-generator.version>3.5.2</mybatis-plus-generator.version> 27 <mybatis-plus-generator.version>3.5.2</mybatis-plus-generator.version>
28 - <dynamic-datasource.version>3.5.0</dynamic-datasource.version>  
29 - <redisson.version>3.17.4</redisson.version> 28 + <dynamic-datasource.version>3.5.2</dynamic-datasource.version>
  29 + <redisson.version>3.17.7</redisson.version>
30 <!-- Config 配置中心相关 --> 30 <!-- Config 配置中心相关 -->
31 - <apollo.version>1.9.2</apollo.version> 31 + <apollo.version>2.0.1</apollo.version>
32 <!-- 服务保障相关 --> 32 <!-- 服务保障相关 -->
33 - <lock4j.version>2.2.0</lock4j.version> 33 + <lock4j.version>2.2.2</lock4j.version>
34 <resilience4j.version>1.7.1</resilience4j.version> 34 <resilience4j.version>1.7.1</resilience4j.version>
35 <!-- 监控相关 --> 35 <!-- 监控相关 -->
36 - <skywalking.version>8.7.0</skywalking.version>  
37 - <spring-boot-admin.version>2.6.7</spring-boot-admin.version>  
38 - <opentracing.version>0.31.0</opentracing.version> 36 + <skywalking.version>8.12.0</skywalking.version>
  37 + <spring-boot-admin.version>2.6.9</spring-boot-admin.version>
  38 + <opentracing.version>0.33.0</opentracing.version>
39 <!-- Test 测试相关 --> 39 <!-- Test 测试相关 -->
40 - <podam.version>7.2.6.RELEASE</podam.version>  
41 - <jedis-mock.version>0.1.16</jedis-mock.version>  
42 - <mockito-inline.version>4.0.0</mockito-inline.version> 40 + <podam.version>7.2.9.RELEASE</podam.version>
  41 + <jedis-mock.version>1.0.4</jedis-mock.version>
  42 + <mockito-inline.version>4.8.0</mockito-inline.version>
43 <!-- Bpm 工作流相关 --> 43 <!-- Bpm 工作流相关 -->
44 <flowable.version>6.7.2</flowable.version> 44 <flowable.version>6.7.2</flowable.version>
45 <!-- 工具类相关 --> 45 <!-- 工具类相关 -->
46 <jasypt-spring-boot-starter.version>3.0.4</jasypt-spring-boot-starter.version> 46 <jasypt-spring-boot-starter.version>3.0.4</jasypt-spring-boot-starter.version>
47 - <lombok.version>1.18.20</lombok.version>  
48 - <mapstruct.version>1.4.1.Final</mapstruct.version>  
49 - <hutool.version>5.8.5</hutool.version> 47 + <lombok.version>1.18.24</lombok.version>
  48 + <mapstruct.version>1.5.2.Final</mapstruct.version>
  49 + <hutool.version>5.8.8</hutool.version>
50 <easyexcel.verion>3.1.1</easyexcel.verion> 50 <easyexcel.verion>3.1.1</easyexcel.verion>
51 <velocity.version>2.3</velocity.version> 51 <velocity.version>2.3</velocity.version>
52 <screw.version>1.0.5</screw.version> 52 <screw.version>1.0.5</screw.version>
53 - <fastjson.version>1.2.83</fastjson.version>  
54 - <guava.version>30.1.1-jre</guava.version> 53 + <fastjson.version>1.2.83</fastjson.version>
  54 + <guava.version>31.1-jre</guava.version>
55 <guice.version>5.1.0</guice.version> 55 <guice.version>5.1.0</guice.version>
56 - <transmittable-thread-local.version>2.12.2</transmittable-thread-local.version> 56 + <transmittable-thread-local.version>2.14.0</transmittable-thread-local.version>
57 <commons-net.version>3.8.0</commons-net.version> 57 <commons-net.version>3.8.0</commons-net.version>
58 <jsch.version>0.1.55</jsch.version> 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 <aj-captcha.version>1.3.0</aj-captcha.version> 60 <aj-captcha.version>1.3.0</aj-captcha.version>
61 <netty-all.version>4.1.82.Final</netty-all.version> 61 <netty-all.version>4.1.82.Final</netty-all.version>
62 <!-- 三方云服务相关 --> 62 <!-- 三方云服务相关 -->
63 <minio.version>8.2.2</minio.version> 63 <minio.version>8.2.2</minio.version>
64 - <aliyun-java-sdk-core.version>4.6.0</aliyun-java-sdk-core.version> 64 + <aliyun-java-sdk-core.version>4.6.2</aliyun-java-sdk-core.version>
65 <aliyun-java-sdk-dysmsapi.version>2.2.1</aliyun-java-sdk-dysmsapi.version> 65 <aliyun-java-sdk-dysmsapi.version>2.2.1</aliyun-java-sdk-dysmsapi.version>
66 <tencentcloud-sdk-java.version>3.1.561</tencentcloud-sdk-java.version> 66 <tencentcloud-sdk-java.version>3.1.561</tencentcloud-sdk-java.version>
67 <yunpian-java-sdk.version>1.2.7</yunpian-java-sdk.version> 67 <yunpian-java-sdk.version>1.2.7</yunpian-java-sdk.version>
68 <justauth.version>1.4.0</justauth.version> 68 <justauth.version>1.4.0</justauth.version>
69 - <jimureport.version>1.5.2</jimureport.version>  
70 - <xercesImpl.version>2.12.0</xercesImpl.version> 69 + <jimureport.version>1.5.3</jimureport.version>
  70 + <xercesImpl.version>2.12.2</xercesImpl.version>
71 </properties> 71 </properties>
72 72
73 <dependencyManagement> 73 <dependencyManagement>
yudao-example/yudao-sso-demo-by-code/pom.xml
@@ -52,7 +52,7 @@ @@ -52,7 +52,7 @@
52 <dependency> 52 <dependency>
53 <groupId>cn.hutool</groupId> 53 <groupId>cn.hutool</groupId>
54 <artifactId>hutool-all</artifactId> 54 <artifactId>hutool-all</artifactId>
55 - <version>5.8.5</version> 55 + <version>5.8.8</version>
56 </dependency> 56 </dependency>
57 57
58 <dependency> 58 <dependency>
yudao-example/yudao-sso-demo-by-password/pom.xml
@@ -52,7 +52,7 @@ @@ -52,7 +52,7 @@
52 <dependency> 52 <dependency>
53 <groupId>cn.hutool</groupId> 53 <groupId>cn.hutool</groupId>
54 <artifactId>hutool-all</artifactId> 54 <artifactId>hutool-all</artifactId>
55 - <version>5.8.5</version> 55 + <version>5.8.8</version>
56 </dependency> 56 </dependency>
57 57
58 <dependency> 58 <dependency>
yudao-framework/yudao-spring-boot-starter-biz-pay/pom.xml
@@ -52,7 +52,7 @@ @@ -52,7 +52,7 @@
52 <dependency> 52 <dependency>
53 <groupId>com.alipay.sdk</groupId> 53 <groupId>com.alipay.sdk</groupId>
54 <artifactId>alipay-sdk-java</artifactId> 54 <artifactId>alipay-sdk-java</artifactId>
55 - <version>4.31.72.ALL</version> 55 + <version>4.33.44.ALL</version>
56 <exclusions> 56 <exclusions>
57 <exclusion> 57 <exclusion>
58 <groupId>org.bouncycastle</groupId> 58 <groupId>org.bouncycastle</groupId>
@@ -63,7 +63,7 @@ @@ -63,7 +63,7 @@
63 <dependency> 63 <dependency>
64 <groupId>com.github.binarywang</groupId> 64 <groupId>com.github.binarywang</groupId>
65 <artifactId>weixin-java-pay</artifactId> 65 <artifactId>weixin-java-pay</artifactId>
66 - <version>4.3.8.B</version> 66 + <version>4.4.0</version>
67 </dependency> 67 </dependency>
68 <!-- TODO 芋艿:清理 --> 68 <!-- TODO 芋艿:清理 -->
69 69
yudao-framework/yudao-spring-boot-starter-biz-weixin/pom.xml
@@ -35,12 +35,12 @@ @@ -35,12 +35,12 @@
35 <dependency> 35 <dependency>
36 <groupId>com.github.binarywang</groupId> 36 <groupId>com.github.binarywang</groupId>
37 <artifactId>wx-java-mp-spring-boot-starter</artifactId> 37 <artifactId>wx-java-mp-spring-boot-starter</artifactId>
38 - <version>4.3.8.B</version> 38 + <version>4.4.0</version>
39 </dependency> 39 </dependency>
40 <dependency> 40 <dependency>
41 <groupId>com.github.binarywang</groupId> 41 <groupId>com.github.binarywang</groupId>
42 <artifactId>wx-java-miniapp-spring-boot-starter</artifactId> 42 <artifactId>wx-java-miniapp-spring-boot-starter</artifactId>
43 - <version>4.3.8.B</version> 43 + <version>4.4.0</version>
44 </dependency> 44 </dependency>
45 <!-- TODO 芋艿:清理 --> 45 <!-- TODO 芋艿:清理 -->
46 </dependencies> 46 </dependencies>
yudao-framework/yudao-spring-boot-starter-protection/src/main/java/cn/iocoder/yudao/framework/lock4j/core/DefaultLockFailureStrategy.java
@@ -5,6 +5,8 @@ import cn.iocoder.yudao.framework.common.exception.enums.GlobalErrorCodeConstant @@ -5,6 +5,8 @@ import cn.iocoder.yudao.framework.common.exception.enums.GlobalErrorCodeConstant
5 import com.baomidou.lock.LockFailureStrategy; 5 import com.baomidou.lock.LockFailureStrategy;
6 import lombok.extern.slf4j.Slf4j; 6 import lombok.extern.slf4j.Slf4j;
7 7
  8 +import java.lang.reflect.Method;
  9 +
8 /** 10 /**
9 * 自定义获取锁失败策略,抛出 {@link ServiceException} 异常 11 * 自定义获取锁失败策略,抛出 {@link ServiceException} 异常
10 */ 12 */
@@ -12,9 +14,8 @@ import lombok.extern.slf4j.Slf4j; @@ -12,9 +14,8 @@ import lombok.extern.slf4j.Slf4j;
12 public class DefaultLockFailureStrategy implements LockFailureStrategy { 14 public class DefaultLockFailureStrategy implements LockFailureStrategy {
13 15
14 @Override 16 @Override
15 - public void onLockFailure(String key, long acquireTimeout, int acquireCount) {  
16 - log.debug("[onLockFailure][线程:{} 获取锁失败,key:{} 获取超时时长:{} ms]", Thread.currentThread().getName(), key, acquireTimeout); 17 + public void onLockFailure(String key, Method method, Object[] arguments) {
  18 + log.debug("[onLockFailure][线程:{} 获取锁失败,key:{} 获取失败:{} ]", Thread.currentThread().getName(), key, arguments);
17 throw new ServiceException(GlobalErrorCodeConstants.LOCKED); 19 throw new ServiceException(GlobalErrorCodeConstants.LOCKED);
18 } 20 }
19 -  
20 } 21 }
yudao-module-bpm/yudao-module-bpm-biz/src/main/java/cn/iocoder/yudao/module/bpm/convert/message/BpmMessageConvert.java
@@ -2,6 +2,7 @@ package cn.iocoder.yudao.module.bpm.convert.message; @@ -2,6 +2,7 @@ package cn.iocoder.yudao.module.bpm.convert.message;
2 2
3 import cn.iocoder.yudao.module.system.api.sms.dto.send.SmsSendSingleToUserReqDTO; 3 import cn.iocoder.yudao.module.system.api.sms.dto.send.SmsSendSingleToUserReqDTO;
4 import org.mapstruct.Mapper; 4 import org.mapstruct.Mapper;
  5 +import org.mapstruct.Mapping;
5 import org.mapstruct.factory.Mappers; 6 import org.mapstruct.factory.Mappers;
6 7
7 import java.util.Map; 8 import java.util.Map;
@@ -11,6 +12,10 @@ public interface BpmMessageConvert { @@ -11,6 +12,10 @@ public interface BpmMessageConvert {
11 12
12 BpmMessageConvert INSTANCE = Mappers.getMapper(BpmMessageConvert.class); 13 BpmMessageConvert INSTANCE = Mappers.getMapper(BpmMessageConvert.class);
13 14
  15 + @Mapping(target = "mobile", ignore = true)
  16 + @Mapping(source = "userId", target = "userId")
  17 + @Mapping(source = "templateCode", target = "templateCode")
  18 + @Mapping(source = "templateParams", target = "templateParams")
14 SmsSendSingleToUserReqDTO convert(Long userId, String templateCode, Map<String, Object> templateParams); 19 SmsSendSingleToUserReqDTO convert(Long userId, String templateCode, Map<String, Object> templateParams);
15 20
16 } 21 }
yudao-module-infra/yudao-module-infra-biz/src/main/resources/codegen/vue3/views/index.vue.vm
@@ -50,23 +50,29 @@ @@ -50,23 +50,29 @@
50 50
51 // 提交按钮 51 // 提交按钮
52 const submitForm = async () => { 52 const submitForm = async () => {
53 - actionLoading.value = true  
54 - // 提交请求  
55 - try {  
56 - const data = unref(formRef)?.formModel as ${simpleClassName}VO  
57 - if (actionType.value === 'create') {  
58 - await ${simpleClassName}Api.create${simpleClassName}Api(data)  
59 - ElMessage.success(t('common.createSuccess'))  
60 - } else {  
61 - await ${simpleClassName}Api.update${simpleClassName}Api(data)  
62 - ElMessage.success(t('common.updateSuccess')) 53 + const elForm = unref(formRef)?.getElFormRef()
  54 + if (!elForm) return
  55 + elForm.validate(async (valid) => {
  56 + if (valid) {
  57 + actionLoading.value = true
  58 + // 提交请求
  59 + try {
  60 + const data = unref(formRef)?.formModel as ${simpleClassName}VO
  61 + if (actionType.value === 'create') {
  62 + await ${simpleClassName}Api.create${simpleClassName}Api(data)
  63 + ElMessage.success(t('common.createSuccess'))
  64 + } else {
  65 + await ${simpleClassName}Api.update${simpleClassName}Api(data)
  66 + ElMessage.success(t('common.updateSuccess'))
  67 + }
  68 + // 操作成功,重新加载列表
  69 + dialogVisible.value = false
  70 + await getList()
  71 + } finally {
  72 + actionLoading.value = false
  73 + }
63 } 74 }
64 - // 操作成功,重新加载列表  
65 - dialogVisible.value = false  
66 - await getList()  
67 - } finally {  
68 - actionLoading.value = false  
69 - } 75 + })
70 } 76 }
71 77
72 // ========== 详情相关 ========== 78 // ========== 详情相关 ==========
yudao-module-mall/yudao-module-market-biz/src/main/java/cn/iocoder/yudao/module/market/controller/app/banner/AppBannerController.java
@@ -7,13 +7,13 @@ import cn.iocoder.yudao.module.market.dal.dataobject.banner.BannerDO; @@ -7,13 +7,13 @@ import cn.iocoder.yudao.module.market.dal.dataobject.banner.BannerDO;
7 import cn.iocoder.yudao.module.market.service.banner.BannerService; 7 import cn.iocoder.yudao.module.market.service.banner.BannerService;
8 import io.swagger.annotations.Api; 8 import io.swagger.annotations.Api;
9 import io.swagger.annotations.ApiOperation; 9 import io.swagger.annotations.ApiOperation;
10 -import org.springframework.beans.factory.annotation.Autowired;  
11 import org.springframework.security.access.prepost.PreAuthorize; 10 import org.springframework.security.access.prepost.PreAuthorize;
12 import org.springframework.validation.annotation.Validated; 11 import org.springframework.validation.annotation.Validated;
13 import org.springframework.web.bind.annotation.GetMapping; 12 import org.springframework.web.bind.annotation.GetMapping;
14 import org.springframework.web.bind.annotation.RequestMapping; 13 import org.springframework.web.bind.annotation.RequestMapping;
15 import org.springframework.web.bind.annotation.RestController; 14 import org.springframework.web.bind.annotation.RestController;
16 15
  16 +import javax.annotation.Resource;
17 import java.util.List; 17 import java.util.List;
18 18
19 import static cn.iocoder.yudao.framework.common.pojo.CommonResult.success; 19 import static cn.iocoder.yudao.framework.common.pojo.CommonResult.success;
@@ -27,8 +27,7 @@ import static cn.iocoder.yudao.framework.common.pojo.CommonResult.success; @@ -27,8 +27,7 @@ import static cn.iocoder.yudao.framework.common.pojo.CommonResult.success;
27 @Validated 27 @Validated
28 public class AppBannerController { 28 public class AppBannerController {
29 29
30 - // TODO @xia:使用 @Resource 哈  
31 - @Autowired 30 + @Resource
32 private BannerService bannerService; 31 private BannerService bannerService;
33 32
34 // TODO @xia:新建一个 AppBannerRespVO,只返回必要的字段。status 要过滤下。然后 sort 下结果 33 // TODO @xia:新建一个 AppBannerRespVO,只返回必要的字段。status 要过滤下。然后 sort 下结果
yudao-module-system/yudao-module-system-api/src/main/java/cn/iocoder/yudao/module/system/api/sms/dto/send/SmsSendSingleToUserReqDTO.java
@@ -4,7 +4,6 @@ import cn.iocoder.yudao.framework.common.validation.Mobile; @@ -4,7 +4,6 @@ import cn.iocoder.yudao.framework.common.validation.Mobile;
4 import lombok.Data; 4 import lombok.Data;
5 5
6 import javax.validation.constraints.NotEmpty; 6 import javax.validation.constraints.NotEmpty;
7 -import javax.validation.constraints.NotNull;  
8 import java.util.Map; 7 import java.util.Map;
9 8
10 /** 9 /**
yudao-ui-admin-vue3/README.md
@@ -27,17 +27,17 @@ @@ -27,17 +27,17 @@
27 27
28 | 框架 | 说明 | 版本 | 28 | 框架 | 说明 | 版本 |
29 | --- | --- |--------| 29 | --- | --- |--------|
30 -| [Vue](https://staging-cn.vuejs.org/) | vue 框架 | 3.2.37 |  
31 -| [Vite](https://cn.vitejs.dev//) | 开发与构建工具 | 3.0.4 |  
32 -| [Element Plus](https://element-plus.org/zh-CN/) | Element Plus | 2.2.12 |  
33 -| [TypeScript](https://www.typescriptlang.org/docs/) | JavaScript 的超集 | 4.7.4 |  
34 -| [pinia](https://pinia.vuejs.org/) | Vue 存储库 替代 vuex5 | 2.0.17 |  
35 -| [vueuse](https://vueuse.org//) | 常用工具集 | 9.0.2 |  
36 -| [vue-i18n](https://kazupon.github.io/vue-i18n/zh/introduction.html/) | 国际化 | 9.2.0 |  
37 -| [vue-router](https://router.vuejs.org/) | vue 路由 | 4.1.3 | 30 +| [Vue](https://staging-cn.vuejs.org/) | vue 框架 | 3.2.41 |
  31 +| [Vite](https://cn.vitejs.dev//) | 开发与构建工具 | 3.1.8 |
  32 +| [Element Plus](https://element-plus.org/zh-CN/) | Element Plus | 2.2.18 |
  33 +| [TypeScript](https://www.typescriptlang.org/docs/) | JavaScript 的超集 | 4.8.4 |
  34 +| [pinia](https://pinia.vuejs.org/) | Vue 存储库 替代 vuex5 | 2.0.23 |
  35 +| [vueuse](https://vueuse.org//) | 常用工具集 | 9.3.1 |
  36 +| [vue-i18n](https://kazupon.github.io/vue-i18n/zh/introduction.html/) | 国际化 | 9.2.2 |
  37 +| [vue-router](https://router.vuejs.org/) | vue 路由 | 4.1.5 |
38 | [windicss](https://cn.windicss.org/) | 下一代工具优先的 CSS 框架 | 3.5.6 | 38 | [windicss](https://cn.windicss.org/) | 下一代工具优先的 CSS 框架 | 3.5.6 |
39 -| [iconify](https://icon-sets.iconify.design/) | 在线图标库 | 2.2.1 |  
40 -| [wangeditor](https://www.wangeditor.com/) | 富文本编辑器 | 5.1.14 | 39 +| [iconify](https://icon-sets.iconify.design/) | 在线图标库 | 3.0.0 |
  40 +| [wangeditor](https://www.wangeditor.com/) | 富文本编辑器 | 5.1.21 |
41 41
42 ### 推荐 VScode 开发,插件如下 42 ### 推荐 VScode 开发,插件如下
43 43
yudao-ui-admin-vue3/package.json
1 { 1 {
2 "name": "ruoyi-vue-pro-vue3", 2 "name": "ruoyi-vue-pro-vue3",
3 - "version": "1.6.3.1611", 3 + "version": "1.6.4.1811",
4 "description": "基于vue3、element-plus、typesScript、vite3", 4 "description": "基于vue3、element-plus、typesScript、vite3",
5 "author": "xingyu", 5 "author": "xingyu",
6 "private": false, 6 "private": false,
@@ -10,7 +10,7 @@ @@ -10,7 +10,7 @@
10 "ts:check": "vue-tsc --noEmit", 10 "ts:check": "vue-tsc --noEmit",
11 "build:pro": "vite build --mode pro", 11 "build:pro": "vite build --mode pro",
12 "build:dev": "vite build --mode dev", 12 "build:dev": "vite build --mode dev",
13 - "build:test": "pnpm run ts:check && vite build --mode test", 13 + "build:test": "npm run ts:check && vite build --mode test",
14 "serve:pro": "vite preview --mode pro", 14 "serve:pro": "vite preview --mode pro",
15 "serve:dev": "vite preview --mode dev", 15 "serve:dev": "vite preview --mode dev",
16 "serve:test": "vite preview --mode test", 16 "serve:test": "vite preview --mode test",
@@ -25,84 +25,84 @@ @@ -25,84 +25,84 @@
25 "p": "plop" 25 "p": "plop"
26 }, 26 },
27 "dependencies": { 27 "dependencies": {
28 - "@iconify/iconify": "^2.2.1",  
29 - "@vueuse/core": "^9.1.0",  
30 - "@wangeditor/editor": "^5.1.14", 28 + "@iconify/iconify": "^3.0.0",
  29 + "@vueuse/core": "^9.3.1",
  30 + "@wangeditor/editor": "^5.1.21",
31 "@wangeditor/editor-for-vue": "^5.1.10", 31 "@wangeditor/editor-for-vue": "^5.1.10",
32 - "@zxcvbn-ts/core": "^2.0.4", 32 + "@zxcvbn-ts/core": "^2.0.5",
33 "animate.css": "^4.1.1", 33 "animate.css": "^4.1.1",
34 "axios": "^0.27.2", 34 "axios": "^0.27.2",
35 "crypto-js": "^4.1.1", 35 "crypto-js": "^4.1.1",
36 - "dayjs": "^1.11.4",  
37 - "echarts": "^5.3.3", 36 + "dayjs": "^1.11.5",
  37 + "echarts": "^5.4.0",
38 "echarts-wordcloud": "^2.0.0", 38 "echarts-wordcloud": "^2.0.0",
39 - "element-plus": "2.2.12", 39 + "element-plus": "2.2.18",
40 "intro.js": "^6.0.0", 40 "intro.js": "^6.0.0",
41 "jsencrypt": "^3.2.1", 41 "jsencrypt": "^3.2.1",
42 "lodash-es": "^4.17.21", 42 "lodash-es": "^4.17.21",
43 "mitt": "^3.0.0", 43 "mitt": "^3.0.0",
44 "nprogress": "^0.2.0", 44 "nprogress": "^0.2.0",
45 - "pinia": "^2.0.17",  
46 - "pinia-plugin-persist": "^1.0.0", 45 + "pinia": "^2.0.23",
47 "qrcode": "^1.5.1", 46 "qrcode": "^1.5.1",
48 "qs": "^6.11.0", 47 "qs": "^6.11.0",
49 "url": "^0.11.0", 48 "url": "^0.11.0",
50 - "vue": "3.2.37", 49 + "vue": "3.2.41",
51 "vue-cropper": "^1.0.3", 50 "vue-cropper": "^1.0.3",
52 "vue-i18n": "9.2.2", 51 "vue-i18n": "9.2.2",
53 - "vue-router": "^4.1.3", 52 + "vue-router": "^4.1.5",
54 "vue-types": "^4.2.1", 53 "vue-types": "^4.2.1",
55 "web-storage-cache": "^1.1.1" 54 "web-storage-cache": "^1.1.1"
56 }, 55 },
57 "devDependencies": { 56 "devDependencies": {
58 - "@commitlint/cli": "^17.0.3",  
59 - "@commitlint/config-conventional": "^17.0.3",  
60 - "@iconify/json": "^2.1.89",  
61 - "@intlify/vite-plugin-vue-i18n": "^6.0.0", 57 + "@commitlint/cli": "^17.1.2",
  58 + "@commitlint/config-conventional": "^17.1.0",
  59 + "@iconify/json": "^2.1.122",
  60 + "@intlify/vite-plugin-vue-i18n": "^6.0.3",
62 "@purge-icons/generated": "^0.9.0", 61 "@purge-icons/generated": "^0.9.0",
63 "@types/intro.js": "^5.1.0", 62 "@types/intro.js": "^5.1.0",
64 "@types/lodash-es": "^4.17.6", 63 "@types/lodash-es": "^4.17.6",
65 - "@types/node": "^18.6.5", 64 + "@types/node": "^18.11.0",
66 "@types/nprogress": "^0.2.0", 65 "@types/nprogress": "^0.2.0",
67 - "@types/qrcode": "^1.4.2", 66 + "@types/qrcode": "^1.5.0",
68 "@types/qs": "^6.9.7", 67 "@types/qs": "^6.9.7",
69 - "@typescript-eslint/eslint-plugin": "^5.33.0",  
70 - "@typescript-eslint/parser": "^5.33.0",  
71 - "@vitejs/plugin-vue": "^3.0.1",  
72 - "@vitejs/plugin-vue-jsx": "^2.0.0",  
73 - "autoprefixer": "^10.4.8",  
74 - "eslint": "^8.21.0", 68 + "@typescript-eslint/eslint-plugin": "^5.40.0",
  69 + "@typescript-eslint/parser": "^5.40.0",
  70 + "@vitejs/plugin-vue": "^3.1.2",
  71 + "@vitejs/plugin-vue-jsx": "^2.0.1",
  72 + "autoprefixer": "^10.4.12",
  73 + "eslint": "^8.25.0",
75 "eslint-config-prettier": "^8.5.0", 74 "eslint-config-prettier": "^8.5.0",
76 - "eslint-define-config": "^1.6.0", 75 + "eslint-define-config": "^1.7.0",
77 "eslint-plugin-prettier": "^4.2.1", 76 "eslint-plugin-prettier": "^4.2.1",
78 - "eslint-plugin-vue": "^9.3.0", 77 + "eslint-plugin-vue": "^9.6.0",
79 "less": "^4.1.3", 78 "less": "^4.1.3",
80 "lint-staged": "^13.0.3", 79 "lint-staged": "^13.0.3",
81 "plop": "^3.1.1", 80 "plop": "^3.1.1",
82 - "postcss": "^8.4.16", 81 + "postcss": "^8.4.18",
83 "postcss-html": "^1.5.0", 82 "postcss-html": "^1.5.0",
84 "postcss-less": "^6.0.0", 83 "postcss-less": "^6.0.0",
85 "prettier": "^2.7.1", 84 "prettier": "^2.7.1",
86 "rimraf": "^3.0.2", 85 "rimraf": "^3.0.2",
87 - "rollup": "^2.77.2",  
88 - "stylelint": "^14.9.1", 86 + "rollup": "^2.79.1",
  87 + "stylelint": "^14.14.0",
89 "stylelint-config-html": "^1.1.0", 88 "stylelint-config-html": "^1.1.0",
90 "stylelint-config-prettier": "^9.0.3", 89 "stylelint-config-prettier": "^9.0.3",
91 - "stylelint-config-recommended": "^8.0.0",  
92 - "stylelint-config-standard": "^26.0.0", 90 + "stylelint-config-recommended": "^9.0.0",
  91 + "stylelint-config-standard": "^29.0.0",
93 "stylelint-order": "^5.0.0", 92 "stylelint-order": "^5.0.0",
94 - "typescript": "4.7.4",  
95 - "unplugin-vue-define-options": "^0.7.3",  
96 - "vite": "3.0.5", 93 + "typescript": "4.8.4",
  94 + "unplugin-vue-macros": "^0.13.2",
  95 + "vite": "3.1.8",
97 "vite-plugin-compression": "^0.5.1", 96 "vite-plugin-compression": "^0.5.1",
98 - "vite-plugin-eslint": "^1.7.0", 97 + "vite-plugin-eslint": "^1.8.1",
99 "vite-plugin-html": "^3.2.0", 98 "vite-plugin-html": "^3.2.0",
100 - "vite-plugin-purge-icons": "^0.9.0",  
101 - "vite-plugin-style-import": "^2.0.0", 99 + "vite-plugin-purge-icons": "^0.9.1",
  100 + "vite-plugin-style-import": "2.0.0",
102 "vite-plugin-svg-icons": "^2.0.1", 101 "vite-plugin-svg-icons": "^2.0.1",
103 - "vite-plugin-windicss": "^1.8.7",  
104 - "vue-tsc": "^0.39.5",  
105 - "windicss": "^3.5.6" 102 + "vite-plugin-windicss": "^1.8.8",
  103 + "vue-tsc": "^1.0.8",
  104 + "windicss": "^3.5.6",
  105 + "windicss-analysis": "^0.3.5"
106 }, 106 },
107 "engines": { 107 "engines": {
108 "node": ">= 14.18.0" 108 "node": ">= 14.18.0"
yudao-ui-admin-vue3/src/api/system/tenant/types.ts
@@ -4,6 +4,8 @@ export type TenantVO = { @@ -4,6 +4,8 @@ export type TenantVO = {
4 packageId: number 4 packageId: number
5 contactName: string 5 contactName: string
6 contactMobile: string 6 contactMobile: string
  7 + username: string
  8 + password: string
7 accountCount: number 9 accountCount: number
8 expireTime: string 10 expireTime: string
9 domain: string 11 domain: string
yudao-ui-admin-vue3/src/components/ConfigGlobal/src/ConfigGlobal.vue
@@ -7,13 +7,14 @@ import { useWindowSize } from &#39;@vueuse/core&#39; @@ -7,13 +7,14 @@ import { useWindowSize } from &#39;@vueuse/core&#39;
7 import { useAppStore } from '@/store/modules/app' 7 import { useAppStore } from '@/store/modules/app'
8 import { setCssVar } from '@/utils' 8 import { setCssVar } from '@/utils'
9 import { useDesign } from '@/hooks/web/useDesign' 9 import { useDesign } from '@/hooks/web/useDesign'
  10 +import { ElementPlusSize } from '@/types/elementPlus'
10 11
11 const { variables } = useDesign() 12 const { variables } = useDesign()
12 13
13 const appStore = useAppStore() 14 const appStore = useAppStore()
14 15
15 const props = defineProps({ 16 const props = defineProps({
16 - size: propTypes.oneOf<ElememtPlusSize[]>(['default', 'small', 'large']).def('default') 17 + size: propTypes.oneOf<ElementPlusSize[]>(['default', 'small', 'large']).def('default')
17 }) 18 })
18 19
19 provide('configGlobal', props) 20 provide('configGlobal', props)
yudao-ui-admin-vue3/src/components/ContextMenu/src/ContextMenu.vue
1 <script setup lang="ts"> 1 <script setup lang="ts">
2 import { ElDropdown, ElDropdownMenu, ElDropdownItem } from 'element-plus' 2 import { ElDropdown, ElDropdownMenu, ElDropdownItem } from 'element-plus'
3 -import { PropType, ref } from 'vue' 3 +import { PropType, ref, defineEmits } from 'vue'
4 import { useI18n } from '@/hooks/web/useI18n' 4 import { useI18n } from '@/hooks/web/useI18n'
5 import { useDesign } from '@/hooks/web/useDesign' 5 import { useDesign } from '@/hooks/web/useDesign'
6 import type { RouteLocationNormalizedLoaded } from 'vue-router' 6 import type { RouteLocationNormalizedLoaded } from 'vue-router'
  7 +import { contextMenuSchema } from '../../../types/contextMenu'
7 8
8 const { getPrefixCls } = useDesign() 9 const { getPrefixCls } = useDesign()
9 10
yudao-ui-admin-vue3/src/components/CountTo/src/CountTo.vue
1 <script setup lang="ts"> 1 <script setup lang="ts">
2 -import { reactive, computed, watch, onMounted, unref, toRef, PropType } from 'vue' 2 +import { reactive, computed, watch, onMounted, unref, toRef, PropType, defineEmits } from 'vue'
3 import { isNumber } from '@/utils/is' 3 import { isNumber } from '@/utils/is'
4 import { propTypes } from '@/utils/propTypes' 4 import { propTypes } from '@/utils/propTypes'
5 import { useDesign } from '@/hooks/web/useDesign' 5 import { useDesign } from '@/hooks/web/useDesign'
yudao-ui-admin-vue3/src/components/Crontab/src/Crontab.vue
@@ -24,7 +24,7 @@ import { @@ -24,7 +24,7 @@ import {
24 ElRadioButton, 24 ElRadioButton,
25 ElMessage 25 ElMessage
26 } from 'element-plus' 26 } from 'element-plus'
27 -import { ref, computed, onMounted, reactive, watch, PropType } from 'vue' 27 +import { ref, computed, onMounted, reactive, watch, PropType, defineEmits } from 'vue'
28 interface shortcutsType { 28 interface shortcutsType {
29 text: string 29 text: string
30 value: string 30 value: string
yudao-ui-admin-vue3/src/components/Descriptions/src/Descriptions.vue
@@ -4,6 +4,7 @@ import { useDesign } from &#39;@/hooks/web/useDesign&#39; @@ -4,6 +4,7 @@ import { useDesign } from &#39;@/hooks/web/useDesign&#39;
4 import { propTypes } from '@/utils/propTypes' 4 import { propTypes } from '@/utils/propTypes'
5 import { ref, unref, PropType, computed, useAttrs } from 'vue' 5 import { ref, unref, PropType, computed, useAttrs } from 'vue'
6 import { useAppStore } from '@/store/modules/app' 6 import { useAppStore } from '@/store/modules/app'
  7 +import { DescriptionsSchema } from '@/types/descriptions'
7 8
8 const appStore = useAppStore() 9 const appStore = useAppStore()
9 10
yudao-ui-admin-vue3/src/components/Dialog/src/Dialog.vue
@@ -74,7 +74,7 @@ const dialogStyle = computed(() =&gt; { @@ -74,7 +74,7 @@ const dialogStyle = computed(() =&gt; {
74 </slot> 74 </slot>
75 <Icon 75 <Icon
76 v-if="fullscreen" 76 v-if="fullscreen"
77 - class="mr-22px cursor-pointer is-hover mt-2px" 77 + class="mr-22px cursor-pointer is-hover mt-2px z-10"
78 :icon="isFullscreen ? 'zmdi:fullscreen-exit' : 'zmdi:fullscreen'" 78 :icon="isFullscreen ? 'zmdi:fullscreen-exit' : 'zmdi:fullscreen'"
79 color="var(--el-color-info)" 79 color="var(--el-color-info)"
80 @click="toggleFull" 80 @click="toggleFull"
yudao-ui-admin-vue3/src/components/Editor/src/Editor.vue
@@ -177,7 +177,7 @@ defineExpose({ @@ -177,7 +177,7 @@ defineExpose({
177 </script> 177 </script>
178 178
179 <template> 179 <template>
180 - <div class="border-1 border-solid border-[var(--tags-view-border-color)]"> 180 + <div class="border-1 border-solid border-[var(--tags-view-border-color)] z-3000">
181 <!-- 工具栏 --> 181 <!-- 工具栏 -->
182 <Toolbar 182 <Toolbar
183 :editor="editorRef" 183 :editor="editorRef"
yudao-ui-admin-vue3/src/components/Error/src/Error.vue
@@ -4,6 +4,7 @@ import networkError from &#39;@/assets/svgs/500.svg&#39; @@ -4,6 +4,7 @@ import networkError from &#39;@/assets/svgs/500.svg&#39;
4 import noPermission from '@/assets/svgs/403.svg' 4 import noPermission from '@/assets/svgs/403.svg'
5 import { propTypes } from '@/utils/propTypes' 5 import { propTypes } from '@/utils/propTypes'
6 import { useI18n } from '@/hooks/web/useI18n' 6 import { useI18n } from '@/hooks/web/useI18n'
  7 +import { defineEmits } from 'vue'
7 8
8 interface ErrorMap { 9 interface ErrorMap {
9 url: string 10 url: string
yudao-ui-admin-vue3/src/components/Form/index.ts
1 import Form from './src/Form.vue' 1 import Form from './src/Form.vue'
2 import { ElForm } from 'element-plus' 2 import { ElForm } from 'element-plus'
  3 +import { FormSchema, FormSetPropsType } from '@/types/form'
3 4
4 export interface FormExpose { 5 export interface FormExpose {
5 setValues: (data: Recordable) => void 6 setValues: (data: Recordable) => void
yudao-ui-admin-vue3/src/components/Form/src/Form.vue
@@ -20,6 +20,7 @@ import { findIndex } from &#39;@/utils&#39; @@ -20,6 +20,7 @@ import { findIndex } from &#39;@/utils&#39;
20 import { set } from 'lodash-es' 20 import { set } from 'lodash-es'
21 import { FormProps } from './types' 21 import { FormProps } from './types'
22 import { Icon } from '@/components/Icon' 22 import { Icon } from '@/components/Icon'
  23 +import { FormSchema, FormSetPropsType } from '@/types/form'
23 24
24 const { getPrefixCls } = useDesign() 25 const { getPrefixCls } = useDesign()
25 26
yudao-ui-admin-vue3/src/components/Form/src/componentMap.ts
@@ -20,6 +20,7 @@ import { @@ -20,6 +20,7 @@ import {
20 } from 'element-plus' 20 } from 'element-plus'
21 import { InputPassword } from '@/components/InputPassword' 21 import { InputPassword } from '@/components/InputPassword'
22 import { Editor } from '@/components/Editor' 22 import { Editor } from '@/components/Editor'
  23 +import { ComponentName } from '@/types/components'
23 24
24 const componentMap: Recordable<Component, ComponentName> = { 25 const componentMap: Recordable<Component, ComponentName> = {
25 Radio: ElRadioGroup, 26 Radio: ElRadioGroup,
yudao-ui-admin-vue3/src/components/Form/src/components/useRenderCheckbox.tsx
  1 +import { FormSchema } from '@/types/form'
1 import { ElCheckbox, ElCheckboxButton } from 'element-plus' 2 import { ElCheckbox, ElCheckboxButton } from 'element-plus'
2 import { defineComponent } from 'vue' 3 import { defineComponent } from 'vue'
3 4
yudao-ui-admin-vue3/src/components/Form/src/components/useRenderRadio.tsx
  1 +import { FormSchema } from '@/types/form'
1 import { ElRadio, ElRadioButton } from 'element-plus' 2 import { ElRadio, ElRadioButton } from 'element-plus'
2 import { defineComponent } from 'vue' 3 import { defineComponent } from 'vue'
3 4
yudao-ui-admin-vue3/src/components/Form/src/components/useRenderSelect.tsx
  1 +import { FormSchema } from '@/types/form'
  2 +import { ComponentOptions } from '@/types/components'
1 import { ElOption, ElOptionGroup } from 'element-plus' 3 import { ElOption, ElOptionGroup } from 'element-plus'
2 import { getSlot } from '@/utils/tsxHelper' 4 import { getSlot } from '@/utils/tsxHelper'
3 import { Slots } from 'vue' 5 import { Slots } from 'vue'
@@ -29,8 +31,15 @@ export const useRenderSelect = (slots: Slots) =&gt; { @@ -29,8 +31,15 @@ export const useRenderSelect = (slots: Slots) =&gt; {
29 // 如果有别名,就取别名 31 // 如果有别名,就取别名
30 const labelAlias = item?.componentProps?.optionsAlias?.labelField 32 const labelAlias = item?.componentProps?.optionsAlias?.labelField
31 const valueAlias = item?.componentProps?.optionsAlias?.valueField 33 const valueAlias = item?.componentProps?.optionsAlias?.valueField
  34 +
  35 + const { label, value, ...other } = option
  36 +
32 return ( 37 return (
33 - <ElOption label={option[labelAlias || 'label']} value={option[valueAlias || 'value']}> 38 + <ElOption
  39 + label={labelAlias ? option[labelAlias] : label}
  40 + value={valueAlias ? option[valueAlias] : value}
  41 + {...other}
  42 + >
34 {{ 43 {{
35 default: () => 44 default: () =>
36 // option 插槽名规则,{field}-option 45 // option 插槽名规则,{field}-option
yudao-ui-admin-vue3/src/components/Form/src/helper.ts
@@ -2,6 +2,8 @@ import { useI18n } from &#39;@/hooks/web/useI18n&#39; @@ -2,6 +2,8 @@ import { useI18n } from &#39;@/hooks/web/useI18n&#39;
2 import type { Slots } from 'vue' 2 import type { Slots } from 'vue'
3 import { getSlot } from '@/utils/tsxHelper' 3 import { getSlot } from '@/utils/tsxHelper'
4 import { PlaceholderMoel } from './types' 4 import { PlaceholderMoel } from './types'
  5 +import { FormSchema } from '@/types/form'
  6 +import { ColProps } from '@/types/components'
5 7
6 /** 8 /**
7 * 9 *
yudao-ui-admin-vue3/src/components/Form/src/types.ts
  1 +import { FormSchema } from '@/types/form'
  2 +
1 export interface PlaceholderMoel { 3 export interface PlaceholderMoel {
2 placeholder?: string 4 placeholder?: string
3 startPlaceholder?: string 5 startPlaceholder?: string
yudao-ui-admin-vue3/src/components/Icon/src/IconSelect.vue
1 <script setup lang="ts"> 1 <script setup lang="ts">
2 import { cloneDeep } from 'lodash-es' 2 import { cloneDeep } from 'lodash-es'
3 -import { ref, computed, CSSProperties, toRef, watch } from 'vue' 3 +import { ref, computed, CSSProperties, toRef, watch, defineEmits } from 'vue'
4 import { 4 import {
5 ElInput, 5 ElInput,
6 ElPopover, 6 ElPopover,
yudao-ui-admin-vue3/src/components/Infotip/src/Infotip.vue
1 <script setup lang="ts"> 1 <script setup lang="ts">
2 -import { PropType } from 'vue'  
3 -import { Highlight } from '@//components/Highlight' 2 +import { PropType, defineEmits } from 'vue'
  3 +import { Highlight } from '@/components/Highlight'
4 import { useDesign } from '@/hooks/web/useDesign' 4 import { useDesign } from '@/hooks/web/useDesign'
5 import { propTypes } from '@/utils/propTypes' 5 import { propTypes } from '@/utils/propTypes'
  6 +import { TipSchema } from '@/types/infoTip'
6 7
7 const { getPrefixCls } = useDesign() 8 const { getPrefixCls } = useDesign()
8 9
yudao-ui-admin-vue3/src/components/InputPassword/src/InputPassword.vue
1 <script setup lang="ts"> 1 <script setup lang="ts">
2 -import { ref, unref, computed, watch } from 'vue' 2 +import { ref, unref, computed, watch, defineEmits } from 'vue'
3 import { ElInput } from 'element-plus' 3 import { ElInput } from 'element-plus'
4 import { propTypes } from '@/utils/propTypes' 4 import { propTypes } from '@/utils/propTypes'
5 import { useConfigGlobal } from '@/hooks/web/useConfigGlobal' 5 import { useConfigGlobal } from '@/hooks/web/useConfigGlobal'
yudao-ui-admin-vue3/src/components/Menu/src/Menu.vue
@@ -3,11 +3,11 @@ import { computed, defineComponent, unref, PropType } from &#39;vue&#39; @@ -3,11 +3,11 @@ import { computed, defineComponent, unref, PropType } from &#39;vue&#39;
3 import { ElMenu, ElScrollbar } from 'element-plus' 3 import { ElMenu, ElScrollbar } from 'element-plus'
4 import { useAppStore } from '@/store/modules/app' 4 import { useAppStore } from '@/store/modules/app'
5 import { usePermissionStore } from '@/store/modules/permission' 5 import { usePermissionStore } from '@/store/modules/permission'
6 -import type { LayoutType } from '@/config/app'  
7 import { useRenderMenuItem } from './components/useRenderMenuItem' 6 import { useRenderMenuItem } from './components/useRenderMenuItem'
8 import { useRouter } from 'vue-router' 7 import { useRouter } from 'vue-router'
9 import { isUrl } from '@/utils/is' 8 import { isUrl } from '@/utils/is'
10 import { useDesign } from '@/hooks/web/useDesign' 9 import { useDesign } from '@/hooks/web/useDesign'
  10 +import { LayoutType } from '@/types/layout'
11 11
12 const { getPrefixCls } = useDesign() 12 const { getPrefixCls } = useDesign()
13 13
yudao-ui-admin-vue3/src/components/Qrcode/src/Qrcode.vue
1 <script setup lang="ts"> 1 <script setup lang="ts">
2 -import { PropType, nextTick, ref, watch, computed, unref } from 'vue' 2 +import { PropType, nextTick, ref, watch, computed, unref, defineEmits } from 'vue'
3 import QRCode from 'qrcode' 3 import QRCode from 'qrcode'
4 import { QRCodeRenderersOptions } from 'qrcode' 4 import { QRCodeRenderersOptions } from 'qrcode'
5 import { cloneDeep } from 'lodash-es' 5 import { cloneDeep } from 'lodash-es'
6 import { propTypes } from '@/utils/propTypes' 6 import { propTypes } from '@/utils/propTypes'
7 import { useDesign } from '@/hooks/web/useDesign' 7 import { useDesign } from '@/hooks/web/useDesign'
8 import { isString } from '@/utils/is' 8 import { isString } from '@/utils/is'
  9 +import { QrcodeLogo } from '@/types/qrcode'
9 10
10 const props = defineProps({ 11 const props = defineProps({
11 // img 或者 canvas,img不支持logo嵌套 12 // img 或者 canvas,img不支持logo嵌套
yudao-ui-admin-vue3/src/components/Search/src/Search.vue
1 <script setup lang="ts"> 1 <script setup lang="ts">
2 import { Form } from '@/components/Form' 2 import { Form } from '@/components/Form'
3 -import { PropType, computed, unref, ref } from 'vue' 3 +import { PropType, computed, unref, ref, defineEmits } from 'vue'
4 import { propTypes } from '@/utils/propTypes' 4 import { propTypes } from '@/utils/propTypes'
5 import { ElButton } from 'element-plus' 5 import { ElButton } from 'element-plus'
6 import { useI18n } from '@/hooks/web/useI18n' 6 import { useI18n } from '@/hooks/web/useI18n'
7 import { useForm } from '@/hooks/web/useForm' 7 import { useForm } from '@/hooks/web/useForm'
8 import { findIndex } from '@/utils' 8 import { findIndex } from '@/utils'
9 import { cloneDeep } from 'lodash-es' 9 import { cloneDeep } from 'lodash-es'
  10 +import { FormSchema } from '@/types/form'
10 11
11 const { t } = useI18n() 12 const { t } = useI18n()
12 13
yudao-ui-admin-vue3/src/components/Setting/src/Setting.vue
@@ -208,7 +208,7 @@ const clear = () =&gt; { @@ -208,7 +208,7 @@ const clear = () =&gt; {
208 <Icon icon="ep:setting" color="#fff" /> 208 <Icon icon="ep:setting" color="#fff" />
209 </div> 209 </div>
210 210
211 - <ElDrawer v-model="drawer" direction="rtl" size="350px"> 211 + <ElDrawer v-model="drawer" direction="rtl" size="350px" :z-index="4000">
212 <template #header> 212 <template #header>
213 <span class="text-16px font-700">{{ t('setting.projectSetting') }}</span> 213 <span class="text-16px font-700">{{ t('setting.projectSetting') }}</span>
214 </template> 214 </template>
yudao-ui-admin-vue3/src/components/Setting/src/components/ColorRadioPicker.vue
1 <script setup lang="ts"> 1 <script setup lang="ts">
2 -import { PropType, watch, unref, ref } from 'vue' 2 +import { PropType, watch, unref, ref, defineEmits } from 'vue'
3 import { propTypes } from '@/utils/propTypes' 3 import { propTypes } from '@/utils/propTypes'
4 import { useDesign } from '@/hooks/web/useDesign' 4 import { useDesign } from '@/hooks/web/useDesign'
5 5
yudao-ui-admin-vue3/src/components/Setting/src/components/InterfaceDisplay.vue
1 <script setup lang="ts"> 1 <script setup lang="ts">
2 -import { ElSwitch } from 'element-plus' 2 +import { ElSwitch, ElMessage } from 'element-plus'
3 import { useI18n } from '@/hooks/web/useI18n' 3 import { useI18n } from '@/hooks/web/useI18n'
4 import { useAppStore } from '@/store/modules/app' 4 import { useAppStore } from '@/store/modules/app'
5 import { computed, ref, watch } from 'vue' 5 import { computed, ref, watch } from 'vue'
@@ -107,6 +107,21 @@ const greyModeChange = (show: boolean) =&gt; { @@ -107,6 +107,21 @@ const greyModeChange = (show: boolean) =&gt; {
107 appStore.setGreyMode(show) 107 appStore.setGreyMode(show)
108 } 108 }
109 109
  110 +// 动态路由
  111 +const dynamicRouter = ref(appStore.getDynamicRouter)
  112 +
  113 +const dynamicRouterChange = (show: boolean) => {
  114 + ElMessage.info(t('setting.reExperienced'))
  115 + appStore.setDynamicRouter(show)
  116 +}
  117 +
  118 +// 固定菜单
  119 +const fixedMenu = ref(appStore.getFixedMenu)
  120 +
  121 +const fixedMenuChange = (show: boolean) => {
  122 + appStore.setFixedMenu(show)
  123 +}
  124 +
110 const layout = computed(() => appStore.getLayout) 125 const layout = computed(() => appStore.getLayout)
111 126
112 watch( 127 watch(
@@ -185,5 +200,15 @@ watch( @@ -185,5 +200,15 @@ watch(
185 <span class="text-14px">{{ t('setting.greyMode') }}</span> 200 <span class="text-14px">{{ t('setting.greyMode') }}</span>
186 <ElSwitch v-model="greyMode" @change="greyModeChange" /> 201 <ElSwitch v-model="greyMode" @change="greyModeChange" />
187 </div> 202 </div>
  203 +
  204 + <div class="flex justify-between items-center">
  205 + <span class="text-14px">{{ t('setting.dynamicRouter') }}</span>
  206 + <ElSwitch v-model="dynamicRouter" @change="dynamicRouterChange" />
  207 + </div>
  208 +
  209 + <div class="flex justify-between items-center">
  210 + <span class="text-14px">{{ t('setting.fixedMenu') }}</span>
  211 + <ElSwitch v-model="fixedMenu" @change="fixedMenuChange" />
  212 + </div>
188 </div> 213 </div>
189 </template> 214 </template>
yudao-ui-admin-vue3/src/components/SizeDropdown/src/SizeDropdown.vue
@@ -5,6 +5,7 @@ import { useAppStore } from &#39;@/store/modules/app&#39; @@ -5,6 +5,7 @@ import { useAppStore } from &#39;@/store/modules/app&#39;
5 import { useI18n } from '@/hooks/web/useI18n' 5 import { useI18n } from '@/hooks/web/useI18n'
6 import { propTypes } from '@/utils/propTypes' 6 import { propTypes } from '@/utils/propTypes'
7 import { useDesign } from '@/hooks/web/useDesign' 7 import { useDesign } from '@/hooks/web/useDesign'
  8 +import { ElementPlusSize } from '@/types/elementPlus'
8 9
9 const { getPrefixCls } = useDesign() 10 const { getPrefixCls } = useDesign()
10 11
@@ -20,7 +21,7 @@ const appStore = useAppStore() @@ -20,7 +21,7 @@ const appStore = useAppStore()
20 21
21 const sizeMap = computed(() => appStore.sizeMap) 22 const sizeMap = computed(() => appStore.sizeMap)
22 23
23 -const setCurrentSize = (size: ElememtPlusSize) => { 24 +const setCurrentSize = (size: ElementPlusSize) => {
24 appStore.setCurrentSize(size) 25 appStore.setCurrentSize(size)
25 } 26 }
26 </script> 27 </script>
yudao-ui-admin-vue3/src/components/TabMenu/src/TabMenu.vue
1 <script lang="tsx"> 1 <script lang="tsx">
2 import { usePermissionStore } from '@/store/modules/permission' 2 import { usePermissionStore } from '@/store/modules/permission'
3 import { useAppStore } from '@/store/modules/app' 3 import { useAppStore } from '@/store/modules/app'
4 -import { computed, unref, defineComponent, watch, ref } from 'vue' 4 +import { computed, unref, defineComponent, watch, ref, onMounted } from 'vue'
5 import { useI18n } from '@/hooks/web/useI18n' 5 import { useI18n } from '@/hooks/web/useI18n'
6 import { ElScrollbar } from 'element-plus' 6 import { ElScrollbar } from 'element-plus'
7 import { Icon } from '@/components/Icon' 7 import { Icon } from '@/components/Icon'
@@ -28,6 +28,8 @@ export default defineComponent({ @@ -28,6 +28,8 @@ export default defineComponent({
28 28
29 const collapse = computed(() => appStore.getCollapse) 29 const collapse = computed(() => appStore.getCollapse)
30 30
  31 + const fixedMenu = computed(() => appStore.getFixedMenu)
  32 +
31 const permissionStore = usePermissionStore() 33 const permissionStore = usePermissionStore()
32 34
33 const routers = computed(() => permissionStore.getRouters) 35 const routers = computed(() => permissionStore.getRouters)
@@ -38,6 +40,27 @@ export default defineComponent({ @@ -38,6 +40,27 @@ export default defineComponent({
38 appStore.setCollapse(!unref(collapse)) 40 appStore.setCollapse(!unref(collapse))
39 } 41 }
40 42
  43 + onMounted(() => {
  44 + if (unref(fixedMenu)) {
  45 + const path = `/${unref(currentRoute).path.split('/')[1]}`
  46 + const children = unref(tabRouters).find(
  47 + (v) =>
  48 + (v.meta?.alwaysShow || (v?.children?.length && v?.children?.length > 1)) &&
  49 + v.path === path
  50 + )?.children
  51 +
  52 + tabActive.value = path
  53 + if (children) {
  54 + permissionStore.setMenuTabRouters(
  55 + cloneDeep(children).map((v) => {
  56 + v.path = pathResolve(unref(tabActive), v.path)
  57 + return v
  58 + })
  59 + )
  60 + }
  61 + }
  62 + })
  63 +
41 watch( 64 watch(
42 () => routers.value, 65 () => routers.value,
43 (routers: AppRouteRecordRaw[]) => { 66 (routers: AppRouteRecordRaw[]) => {
@@ -66,7 +89,7 @@ export default defineComponent({ @@ -66,7 +89,7 @@ export default defineComponent({
66 ) 89 )
67 90
68 // 是否显示菜单 91 // 是否显示菜单
69 - const showMenu = ref(false) 92 + const showMenu = ref(unref(fixedMenu) ? true : false)
70 93
71 // tab高亮 94 // tab高亮
72 const tabActive = ref('') 95 const tabActive = ref('')
@@ -77,9 +100,13 @@ export default defineComponent({ @@ -77,9 +100,13 @@ export default defineComponent({
77 window.open(item.path) 100 window.open(item.path)
78 return 101 return
79 } 102 }
  103 + const newPath = item.children ? item.path : item.path.split('/')[0]
  104 + const oldPath = unref(tabActive)
80 tabActive.value = item.children ? item.path : item.path.split('/')[0] 105 tabActive.value = item.children ? item.path : item.path.split('/')[0]
81 if (item.children) { 106 if (item.children) {
82 - showMenu.value = !unref(showMenu) 107 + if (newPath === oldPath || !unref(showMenu)) {
  108 + showMenu.value = unref(fixedMenu) ? true : !unref(showMenu)
  109 + }
83 if (unref(showMenu)) { 110 if (unref(showMenu)) {
84 permissionStore.setMenuTabRouters( 111 permissionStore.setMenuTabRouters(
85 cloneDeep(item.children).map((v) => { 112 cloneDeep(item.children).map((v) => {
@@ -96,7 +123,7 @@ export default defineComponent({ @@ -96,7 +123,7 @@ export default defineComponent({
96 } 123 }
97 124
98 // 设置高亮 125 // 设置高亮
99 - const isActice = (currentPath: string) => { 126 + const isActive = (currentPath: string) => {
100 const { path } = unref(currentRoute) 127 const { path } = unref(currentRoute)
101 if (tabPathMap[currentPath].includes(path)) { 128 if (tabPathMap[currentPath].includes(path)) {
102 return true 129 return true
@@ -105,7 +132,7 @@ export default defineComponent({ @@ -105,7 +132,7 @@ export default defineComponent({
105 } 132 }
106 133
107 const mouseleave = () => { 134 const mouseleave = () => {
108 - if (!unref(showMenu)) return 135 + if (!unref(showMenu) || unref(fixedMenu)) return
109 showMenu.value = false 136 showMenu.value = false
110 } 137 }
111 138
@@ -114,7 +141,7 @@ export default defineComponent({ @@ -114,7 +141,7 @@ export default defineComponent({
114 id={`${variables.namespace}-menu`} 141 id={`${variables.namespace}-menu`}
115 class={[ 142 class={[
116 prefixCls, 143 prefixCls,
117 - 'relative bg-[var(--left-menu-bg-color)] top-1px z-999', 144 + 'relative bg-[var(--left-menu-bg-color)] top-1px z-3000',
118 { 145 {
119 'w-[var(--tab-menu-max-width)]': !unref(collapse), 146 'w-[var(--tab-menu-max-width)]': !unref(collapse),
120 'w-[var(--tab-menu-min-width)]': unref(collapse) 147 'w-[var(--tab-menu-min-width)]': unref(collapse)
@@ -140,7 +167,7 @@ export default defineComponent({ @@ -140,7 +167,7 @@ export default defineComponent({
140 `${prefixCls}__item`, 167 `${prefixCls}__item`,
141 'text-center text-12px relative py-12px cursor-pointer', 168 'text-center text-12px relative py-12px cursor-pointer',
142 { 169 {
143 - 'is-active': isActice(v.path) 170 + 'is-active': isActive(v.path)
144 } 171 }
145 ]} 172 ]}
146 onClick={() => { 173 onClick={() => {
@@ -174,8 +201,8 @@ export default defineComponent({ @@ -174,8 +201,8 @@ export default defineComponent({
174 { 201 {
175 '!left-[var(--tab-menu-min-width)]': unref(collapse), 202 '!left-[var(--tab-menu-min-width)]': unref(collapse),
176 '!left-[var(--tab-menu-max-width)]': !unref(collapse), 203 '!left-[var(--tab-menu-max-width)]': !unref(collapse),
177 - '!w-[calc(var(--left-menu-max-width)+1px)]': unref(showMenu),  
178 - '!w-0': !unref(showMenu) 204 + '!w-[calc(var(--left-menu-max-width)+1px)]': unref(showMenu) || unref(fixedMenu),
  205 + '!w-0': !unref(showMenu) && !unref(fixedMenu)
179 } 206 }
180 ]} 207 ]}
181 style="transition: width var(--transition-time-02), left var(--transition-time-02);" 208 style="transition: width var(--transition-time-02), left var(--transition-time-02);"
yudao-ui-admin-vue3/src/components/TabMenu/src/helper.ts
@@ -28,9 +28,9 @@ export const filterMenusPath = ( @@ -28,9 +28,9 @@ export const filterMenusPath = (
28 let data: Nullable<AppRouteRecordRaw> = null 28 let data: Nullable<AppRouteRecordRaw> = null
29 const meta = (v.meta ?? {}) as RouteMeta 29 const meta = (v.meta ?? {}) as RouteMeta
30 if (!meta.hidden || meta.canTo) { 30 if (!meta.hidden || meta.canTo) {
31 - const allParentPaht = getAllParentPath<AppRouteRecordRaw>(allRoutes, v.path) 31 + const allParentPath = getAllParentPath<AppRouteRecordRaw>(allRoutes, v.path)
32 32
33 - const fullPath = isUrl(v.path) ? v.path : allParentPaht.join('/') 33 + const fullPath = isUrl(v.path) ? v.path : allParentPath.join('/')
34 34
35 data = cloneDeep(v) 35 data = cloneDeep(v)
36 data.path = fullPath 36 data.path = fullPath
@@ -42,8 +42,8 @@ export const filterMenusPath = ( @@ -42,8 +42,8 @@ export const filterMenusPath = (
42 res.push(data) 42 res.push(data)
43 } 43 }
44 44
45 - if (allParentPaht.length && Reflect.has(tabPathMap, allParentPaht[0])) {  
46 - tabPathMap[allParentPaht[0]].push(fullPath) 45 + if (allParentPath.length && Reflect.has(tabPathMap, allParentPath[0])) {
  46 + tabPathMap[allParentPath[0]].push(fullPath)
47 } 47 }
48 } 48 }
49 } 49 }
yudao-ui-admin-vue3/src/components/Table/index.ts
1 import Table from './src/Table.vue' 1 import Table from './src/Table.vue'
  2 +import { ElTable } from 'element-plus'
  3 +import { TableSetPropsType } from '@/types/table'
2 4
3 export interface TableExpose { 5 export interface TableExpose {
4 setProps: (props: Recordable) => void 6 setProps: (props: Recordable) => void
5 setColumn: (columnProps: TableSetPropsType[]) => void 7 setColumn: (columnProps: TableSetPropsType[]) => void
6 selections: Recordable[] 8 selections: Recordable[]
  9 + elTableRef: ComponentRef<typeof ElTable>
7 } 10 }
8 11
9 export { Table } 12 export { Table }
yudao-ui-admin-vue3/src/components/Table/src/Table.vue
@@ -6,6 +6,7 @@ import { setIndex } from &#39;./helper&#39; @@ -6,6 +6,7 @@ import { setIndex } from &#39;./helper&#39;
6 import { getSlot } from '@/utils/tsxHelper' 6 import { getSlot } from '@/utils/tsxHelper'
7 import type { TableProps } from './types' 7 import type { TableProps } from './types'
8 import { set } from 'lodash-es' 8 import { set } from 'lodash-es'
  9 +import { Pagination, TableColumn, TableSetPropsType, TableSlotDefault } from '@/types/table'
9 10
10 export default defineComponent({ 11 export default defineComponent({
11 name: 'Table', 12 name: 'Table',
yudao-ui-admin-vue3/src/components/Table/src/types.ts
  1 +import { Pagination, TableColumn } from '@/types/table'
  2 +
1 export type TableProps = { 3 export type TableProps = {
2 pageSize?: number 4 pageSize?: number
3 currentPage?: number 5 currentPage?: number
yudao-ui-admin-vue3/src/components/UserInfo/src/UserInfo.vue
@@ -36,8 +36,8 @@ const loginOut = () =&gt; { @@ -36,8 +36,8 @@ const loginOut = () =&gt; {
36 }) 36 })
37 .then(async () => { 37 .then(async () => {
38 userStore.loginOut() 38 userStore.loginOut()
39 - tagsViewStore.delAllViews  
40 - replace('/login') 39 + tagsViewStore.delAllViews()
  40 + replace('/login?redirect=/index')
41 }) 41 })
42 .catch(() => {}) 42 .catch(() => {})
43 } 43 }
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 import { ElMessage, ElMessageBox, ElNotification } from 'element-plus' 8 import { ElMessage, ElMessageBox, ElNotification } from 'element-plus'
3 import qs from 'qs' 9 import qs from 'qs'
4 import { config } from '@/config/axios/config' 10 import { config } from '@/config/axios/config'
@@ -48,7 +54,8 @@ service.interceptors.request.use( @@ -48,7 +54,8 @@ service.interceptors.request.use(
48 const data = config.data || false 54 const data = config.data || false
49 if ( 55 if (
50 config.method?.toUpperCase() === 'POST' && 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 config.data = qs.stringify(data) 60 config.data = qs.stringify(data)
54 } 61 }
@@ -121,12 +128,18 @@ service.interceptors.response.use( @@ -121,12 +128,18 @@ service.interceptors.response.use(
121 const refreshTokenRes = await refreshToken() 128 const refreshTokenRes = await refreshToken()
122 // 2.1 刷新成功,则回放队列的请求 + 当前请求 129 // 2.1 刷新成功,则回放队列的请求 + 当前请求
123 setToken(refreshTokenRes.data) 130 setToken(refreshTokenRes.data)
124 - requestList.forEach((cb: any) => cb()) 131 + ;(config as Recordable).headers.Authorization = 'Bearer ' + getAccessToken()
  132 + requestList.forEach((cb: any) => {
  133 + cb()
  134 + })
  135 + requestList = []
125 return service(response.config) 136 return service(response.config)
126 } catch (e) { 137 } catch (e) {
127 // 为什么需要 catch 异常呢?刷新失败时,请求因为 Promise.reject 触发异常。 138 // 为什么需要 catch 异常呢?刷新失败时,请求因为 Promise.reject 触发异常。
128 // 2.2 刷新失败,只回放队列的请求 139 // 2.2 刷新失败,只回放队列的请求
129 - requestList.forEach((cb: any) => cb()) 140 + requestList.forEach((cb: any) => {
  141 + cb()
  142 + })
130 // 提示是否要登出。即不回放当前请求!不然会形成递归 143 // 提示是否要登出。即不回放当前请求!不然会形成递归
131 return handleAuthorized() 144 return handleAuthorized()
132 } finally { 145 } finally {
@@ -187,10 +200,7 @@ service.interceptors.response.use( @@ -187,10 +200,7 @@ service.interceptors.response.use(
187 ) 200 )
188 201
189 const refreshToken = async () => { 202 const refreshToken = async () => {
190 - return await service({  
191 - url: '/system/auth/refresh-token?refreshToken=' + getRefreshToken(),  
192 - method: 'post'  
193 - }) 203 + return await axios.post(base_url + '/system/auth/refresh-token?refreshToken=' + getRefreshToken())
194 } 204 }
195 const handleAuthorized = () => { 205 const handleAuthorized = () => {
196 const { t } = useI18n() 206 const { t } = useI18n()
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/hooks/web/useConfigGlobal.ts
  1 +import { ConfigGlobalTypes } from '@/types/configGlobal'
1 import { inject } from 'vue' 2 import { inject } from 'vue'
2 3
3 export const useConfigGlobal = () => { 4 export const useConfigGlobal = () => {
yudao-ui-admin-vue3/src/hooks/web/useCrudSchemas.ts
1 import { reactive } from 'vue' 1 import { reactive } from 'vue'
2 import { eachTree, treeMap, filter } from '@/utils/tree' 2 import { eachTree, treeMap, filter } from '@/utils/tree'
3 import { getIntDictOptions } from '@/utils/dict' 3 import { getIntDictOptions } from '@/utils/dict'
  4 +import { FormSchema } from '@/types/form'
  5 +import { TableColumn } from '@/types/table'
  6 +import { DescriptionsSchema } from '@/types/descriptions'
  7 +import { ComponentOptions } from '@/types/components'
4 8
5 export type CrudSchema = Omit<TableColumn, 'children'> & { 9 export type CrudSchema = Omit<TableColumn, 'children'> & {
6 search?: CrudSearchParams 10 search?: CrudSearchParams
yudao-ui-admin-vue3/src/hooks/web/useForm.ts
@@ -2,6 +2,7 @@ import type { Form, FormExpose } from &#39;@/components/Form&#39; @@ -2,6 +2,7 @@ import type { Form, FormExpose } from &#39;@/components/Form&#39;
2 import type { ElForm } from 'element-plus' 2 import type { ElForm } from 'element-plus'
3 import { ref, unref, nextTick } from 'vue' 3 import { ref, unref, nextTick } from 'vue'
4 import type { FormProps } from '@/components/Form/src/types' 4 import type { FormProps } from '@/components/Form/src/types'
  5 +import { FormSchema, FormSetPropsType } from '@/types/form'
5 6
6 export const useForm = (props?: FormProps) => { 7 export const useForm = (props?: FormProps) => {
7 // From实例 8 // From实例
yudao-ui-admin-vue3/src/hooks/web/useIcon.ts
1 import { h } from 'vue' 1 import { h } from 'vue'
2 import type { VNode } from 'vue' 2 import type { VNode } from 'vue'
3 import { Icon } from '@/components/Icon' 3 import { Icon } from '@/components/Icon'
  4 +import { IconTypes } from '@/types/icon'
4 5
5 export const useIcon = (props: IconTypes): VNode => { 6 export const useIcon = (props: IconTypes): VNode => {
6 return h(Icon, props) 7 return h(Icon, props)
yudao-ui-admin-vue3/src/hooks/web/useTable.ts
@@ -4,6 +4,7 @@ import { ElMessage, ElMessageBox, ElTable } from &#39;element-plus&#39; @@ -4,6 +4,7 @@ import { ElMessage, ElMessageBox, ElTable } from &#39;element-plus&#39;
4 import { computed, nextTick, reactive, ref, unref, watch } from 'vue' 4 import { computed, nextTick, reactive, ref, unref, watch } from 'vue'
5 import type { TableProps } from '@/components/Table/src/types' 5 import type { TableProps } from '@/components/Table/src/types'
6 import { useI18n } from '@/hooks/web/useI18n' 6 import { useI18n } from '@/hooks/web/useI18n'
  7 +import { TableSetPropsType } from '@/types/table'
7 8
8 const { t } = useI18n() 9 const { t } = useI18n()
9 interface ResponseType<T = any> { 10 interface ResponseType<T = any> {
@@ -150,13 +151,17 @@ export const useTable = &lt;T = any&gt;(config?: UseTableConfig&lt;T&gt;) =&gt; { @@ -150,13 +151,17 @@ export const useTable = &lt;T = any&gt;(config?: UseTableConfig&lt;T&gt;) =&gt; {
150 }, 151 },
151 // 与Search组件结合 152 // 与Search组件结合
152 setSearchParams: (data: Recordable) => { 153 setSearchParams: (data: Recordable) => {
153 - tableObject.currentPage = 1  
154 tableObject.params = Object.assign(tableObject.params, { 154 tableObject.params = Object.assign(tableObject.params, {
155 pageSize: tableObject.pageSize, 155 pageSize: tableObject.pageSize,
156 - pageNo: tableObject.currentPage, 156 + pageNo: 1,
157 ...data 157 ...data
158 }) 158 })
159 - methods.getList() 159 + // 页码不等于1时更新页码重新获取数据,页码等于1时重新获取数据
  160 + if (tableObject.currentPage !== 1) {
  161 + tableObject.currentPage = 1
  162 + } else {
  163 + methods.getList()
  164 + }
160 }, 165 },
161 // 删除数据 166 // 删除数据
162 delList: async ( 167 delList: async (
yudao-ui-admin-vue3/src/layout/components/useRenderLayout.tsx
@@ -32,6 +32,9 @@ const fixedHeader = computed(() =&gt; appStore.getFixedHeader) @@ -32,6 +32,9 @@ const fixedHeader = computed(() =&gt; appStore.getFixedHeader)
32 // 是否是移动端 32 // 是否是移动端
33 const mobile = computed(() => appStore.getMobile) 33 const mobile = computed(() => appStore.getMobile)
34 34
  35 +// 固定菜单
  36 +const fixedMenu = computed(() => appStore.getFixedMenu)
  37 +
35 export const useRenderLayout = () => { 38 export const useRenderLayout = () => {
36 const renderClassic = () => { 39 const renderClassic = () => {
37 return ( 40 return (
@@ -213,9 +216,13 @@ export const useRenderLayout = () =&gt; { @@ -213,9 +216,13 @@ export const useRenderLayout = () =&gt; {
213 'h-[100%]', 216 'h-[100%]',
214 { 217 {
215 'w-[calc(100%-var(--tab-menu-min-width))] left-[var(--tab-menu-min-width)]': 218 'w-[calc(100%-var(--tab-menu-min-width))] left-[var(--tab-menu-min-width)]':
216 - collapse.value, 219 + collapse.value && !fixedMenu.value,
217 'w-[calc(100%-var(--tab-menu-max-width))] left-[var(--tab-menu-max-width)]': 220 'w-[calc(100%-var(--tab-menu-max-width))] left-[var(--tab-menu-max-width)]':
218 - !collapse.value 221 + !collapse.value && !fixedMenu.value,
  222 + 'w-[calc(100%-var(--tab-menu-min-width)-var(--left-menu-max-width))] ml-[var(--left-menu-max-width)]':
  223 + collapse.value && fixedMenu.value,
  224 + 'w-[calc(100%-var(--tab-menu-max-width)-var(--left-menu-max-width))] ml-[var(--left-menu-max-width)]':
  225 + !collapse.value && fixedMenu.value
219 } 226 }
220 ]} 227 ]}
221 style="transition: all var(--transition-time-02);" 228 style="transition: all var(--transition-time-02);"
@@ -239,7 +246,13 @@ export const useRenderLayout = () =&gt; { @@ -239,7 +246,13 @@ export const useRenderLayout = () =&gt; {
239 'w-[calc(100%-var(--tab-menu-min-width))] left-[var(--tab-menu-min-width)] mt-[var(--logo-height)]': 246 'w-[calc(100%-var(--tab-menu-min-width))] left-[var(--tab-menu-min-width)] mt-[var(--logo-height)]':
240 collapse.value && fixedHeader.value, 247 collapse.value && fixedHeader.value,
241 'w-[calc(100%-var(--tab-menu-max-width))] left-[var(--tab-menu-max-width)] mt-[var(--logo-height)]': 248 'w-[calc(100%-var(--tab-menu-max-width))] left-[var(--tab-menu-max-width)] mt-[var(--logo-height)]':
242 - !collapse.value && fixedHeader.value 249 + !collapse.value && fixedHeader.value,
  250 + '!fixed top-0 left-[var(--tab-menu-min-width)+var(--left-menu-max-width)] z-10':
  251 + fixedHeader.value && fixedMenu.value,
  252 + 'w-[calc(100%-var(--tab-menu-min-width)-var(--left-menu-max-width))] left-[var(--tab-menu-min-width)+var(--left-menu-max-width)] mt-[var(--logo-height)]':
  253 + collapse.value && fixedHeader.value && fixedMenu.value,
  254 + 'w-[calc(100%-var(--tab-menu-max-width)-var(--left-menu-max-width))] left-[var(--tab-menu-max-width)+var(--left-menu-max-width)] mt-[var(--logo-height)]':
  255 + !collapse.value && fixedHeader.value && fixedMenu.value
243 } 256 }
244 ]} 257 ]}
245 style="transition: width var(--transition-time-02), left var(--transition-time-02);" 258 style="transition: width var(--transition-time-02), left var(--transition-time-02);"
yudao-ui-admin-vue3/src/locales/en.ts
@@ -91,7 +91,10 @@ export default { @@ -91,7 +91,10 @@ export default {
91 copyFailed: 'Copy failed', 91 copyFailed: 'Copy failed',
92 footer: 'Footer', 92 footer: 'Footer',
93 uniqueOpened: 'Unique opened', 93 uniqueOpened: 'Unique opened',
94 - tagsViewIcon: 'Tags view icon' 94 + tagsViewIcon: 'Tags view icon',
  95 + dynamicRouter: 'Dynamic router',
  96 + reExperienced: 'Please exit the login experience again',
  97 + fixedMenu: 'Fixed menu'
95 }, 98 },
96 size: { 99 size: {
97 default: 'Default', 100 default: 'Default',
yudao-ui-admin-vue3/src/locales/zh-CN.ts
@@ -91,7 +91,10 @@ export default { @@ -91,7 +91,10 @@ export default {
91 copyFailed: '拷贝失败', 91 copyFailed: '拷贝失败',
92 footer: '页脚', 92 footer: '页脚',
93 uniqueOpened: '菜单手风琴', 93 uniqueOpened: '菜单手风琴',
94 - tagsViewIcon: '标签页图标' 94 + tagsViewIcon: '标签页图标',
  95 + dynamicRouter: '动态路由',
  96 + reExperienced: '请重新退出登录体验',
  97 + fixedMenu: '固定菜单'
95 }, 98 },
96 size: { 99 size: {
97 default: '默认', 100 default: '默认',
yudao-ui-admin-vue3/src/store/index.ts
1 import type { App } from 'vue' 1 import type { App } from 'vue'
2 import { createPinia } from 'pinia' 2 import { createPinia } from 'pinia'
3 -import piniaPluginPersist from 'pinia-plugin-persist'  
4 3
5 const store = createPinia() 4 const store = createPinia()
6 5
7 -store.use(piniaPluginPersist)  
8 -  
9 export const setupStore = (app: App<Element>) => { 6 export const setupStore = (app: App<Element>) => {
10 app.use(store) 7 app.use(store)
11 } 8 }
yudao-ui-admin-vue3/src/store/modules/app.ts
1 import { defineStore } from 'pinia' 1 import { defineStore } from 'pinia'
2 import { store } from '../index' 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 import { setCssVar, humpToUnderline } from '@/utils' 3 import { setCssVar, humpToUnderline } from '@/utils'
7 import { ElMessage } from 'element-plus' 4 import { ElMessage } from 'element-plus'
  5 +import { useCache } from '@/hooks/web/useCache'
  6 +import { ElementPlusSize } from '@/types/elementPlus'
  7 +import { LayoutType } from '@/types/layout'
  8 +import { ThemeTypes } from '@/types/theme'
8 9
9 const { wsCache } = useCache() 10 const { wsCache } = useCache()
10 11
11 -export const useAppStore = defineStore({  
12 - id: 'app',  
13 - state: (): AppState => appModules,  
14 - persist: {  
15 - enabled: true 12 +interface AppState {
  13 + breadcrumb: boolean
  14 + breadcrumbIcon: boolean
  15 + collapse: boolean
  16 + uniqueOpened: boolean
  17 + hamburger: boolean
  18 + screenfull: boolean
  19 + size: boolean
  20 + locale: boolean
  21 + tagsView: boolean
  22 + tagsViewIcon: boolean
  23 + logo: boolean
  24 + fixedHeader: boolean
  25 + greyMode: boolean
  26 + pageLoading: boolean
  27 + layout: LayoutType
  28 + title: string
  29 + userInfo: string
  30 + isDark: boolean
  31 + currentSize: ElementPlusSize
  32 + sizeMap: ElementPlusSize[]
  33 + mobile: boolean
  34 + footer: boolean
  35 + theme: ThemeTypes
  36 + fixedMenu: boolean
  37 +}
  38 +
  39 +export const useAppStore = defineStore('app', {
  40 + state: (): AppState => {
  41 + return {
  42 + userInfo: 'userInfo', // 登录信息存储字段-建议每个项目换一个字段,避免与其他项目冲突
  43 + sizeMap: ['default', 'large', 'small'],
  44 + mobile: false, // 是否是移动端
  45 + title: import.meta.env.VITE_APP_TITLE, // 标题
  46 + pageLoading: false, // 路由跳转loading
  47 +
  48 + breadcrumb: true, // 面包屑
  49 + breadcrumbIcon: true, // 面包屑图标
  50 + collapse: false, // 折叠菜单
  51 + uniqueOpened: true, // 是否只保持一个子菜单的展开
  52 + hamburger: true, // 折叠图标
  53 + screenfull: true, // 全屏图标
  54 + size: true, // 尺寸图标
  55 + locale: true, // 多语言图标
  56 + tagsView: true, // 标签页
  57 + tagsViewIcon: true, // 是否显示标签图标
  58 + logo: true, // logo
  59 + fixedHeader: true, // 固定toolheader
  60 + footer: true, // 显示页脚
  61 + greyMode: false, // 是否开始灰色模式,用于特殊悼念日
  62 + fixedMenu: wsCache.get('fixedMenu') || false, // 是否固定菜单
  63 +
  64 + layout: wsCache.get('layout') || 'classic', // layout布局
  65 + isDark: wsCache.get('isDark') || false, // 是否是暗黑模式
  66 + currentSize: wsCache.get('default') || 'default', // 组件尺寸
  67 + theme: wsCache.get('theme') || {
  68 + // 主题色
  69 + elColorPrimary: '#409eff',
  70 + // 左侧菜单边框颜色
  71 + leftMenuBorderColor: 'inherit',
  72 + // 左侧菜单背景颜色
  73 + leftMenuBgColor: '#001529',
  74 + // 左侧菜单浅色背景颜色
  75 + leftMenuBgLightColor: '#0f2438',
  76 + // 左侧菜单选中背景颜色
  77 + leftMenuBgActiveColor: 'var(--el-color-primary)',
  78 + // 左侧菜单收起选中背景颜色
  79 + leftMenuCollapseBgActiveColor: 'var(--el-color-primary)',
  80 + // 左侧菜单字体颜色
  81 + leftMenuTextColor: '#bfcbd9',
  82 + // 左侧菜单选中字体颜色
  83 + leftMenuTextActiveColor: '#fff',
  84 + // logo字体颜色
  85 + logoTitleTextColor: '#fff',
  86 + // logo边框颜色
  87 + logoBorderColor: 'inherit',
  88 + // 头部背景颜色
  89 + topHeaderBgColor: '#fff',
  90 + // 头部字体颜色
  91 + topHeaderTextColor: 'inherit',
  92 + // 头部悬停颜色
  93 + topHeaderHoverColor: '#f6f6f6',
  94 + // 头部边框颜色
  95 + topToolBorderColor: '#eee'
  96 + }
  97 + }
16 }, 98 },
17 getters: { 99 getters: {
18 getBreadcrumb(): boolean { 100 getBreadcrumb(): boolean {
@@ -54,6 +136,9 @@ export const useAppStore = defineStore({ @@ -54,6 +136,9 @@ export const useAppStore = defineStore({
54 getGreyMode(): boolean { 136 getGreyMode(): boolean {
55 return this.greyMode 137 return this.greyMode
56 }, 138 },
  139 + getFixedMenu(): boolean {
  140 + return this.fixedMenu
  141 + },
57 getPageLoading(): boolean { 142 getPageLoading(): boolean {
58 return this.pageLoading 143 return this.pageLoading
59 }, 144 },
@@ -69,10 +154,10 @@ export const useAppStore = defineStore({ @@ -69,10 +154,10 @@ export const useAppStore = defineStore({
69 getIsDark(): boolean { 154 getIsDark(): boolean {
70 return this.isDark 155 return this.isDark
71 }, 156 },
72 - getCurrentSize(): ElememtPlusSize { 157 + getCurrentSize(): ElementPlusSize {
73 return this.currentSize 158 return this.currentSize
74 }, 159 },
75 - getSizeMap(): ElememtPlusSize[] { 160 + getSizeMap(): ElementPlusSize[] {
76 return this.sizeMap 161 return this.sizeMap
77 }, 162 },
78 getMobile(): boolean { 163 getMobile(): boolean {
@@ -125,6 +210,10 @@ export const useAppStore = defineStore({ @@ -125,6 +210,10 @@ export const useAppStore = defineStore({
125 setGreyMode(greyMode: boolean) { 210 setGreyMode(greyMode: boolean) {
126 this.greyMode = greyMode 211 this.greyMode = greyMode
127 }, 212 },
  213 + setFixedMenu(fixedMenu: boolean) {
  214 + wsCache.set('fixedMenu', fixedMenu)
  215 + this.fixedMenu = fixedMenu
  216 + },
128 setPageLoading(pageLoading: boolean) { 217 setPageLoading(pageLoading: boolean) {
129 this.pageLoading = pageLoading 218 this.pageLoading = pageLoading
130 }, 219 },
@@ -150,7 +239,7 @@ export const useAppStore = defineStore({ @@ -150,7 +239,7 @@ export const useAppStore = defineStore({
150 } 239 }
151 wsCache.set('isDark', this.isDark) 240 wsCache.set('isDark', this.isDark)
152 }, 241 },
153 - setCurrentSize(currentSize: ElememtPlusSize) { 242 + setCurrentSize(currentSize: ElementPlusSize) {
154 this.currentSize = currentSize 243 this.currentSize = currentSize
155 wsCache.set('currentSize', this.currentSize) 244 wsCache.set('currentSize', this.currentSize)
156 }, 245 },
yudao-ui-admin-vue3/src/store/modules/dict.ts
@@ -16,14 +16,10 @@ export interface DictState { @@ -16,14 +16,10 @@ export interface DictState {
16 dictMap: Recordable 16 dictMap: Recordable
17 } 17 }
18 18
19 -export const useDictStore = defineStore({  
20 - id: 'dict', 19 +export const useDictStore = defineStore('dict', {
21 state: (): DictState => ({ 20 state: (): DictState => ({
22 dictMap: {} 21 dictMap: {}
23 }), 22 }),
24 - persist: {  
25 - enabled: true  
26 - },  
27 getters: { 23 getters: {
28 getDictMap(): Recordable { 24 getDictMap(): Recordable {
29 return this.dictMap 25 return this.dictMap
yudao-ui-admin-vue3/src/store/modules/locale.ts
1 import { defineStore } from 'pinia' 1 import { defineStore } from 'pinia'
2 import { store } from '../index' 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 import { useCache } from '@/hooks/web/useCache' 5 import { useCache } from '@/hooks/web/useCache'
4 -import { localeModules, elLocaleMap } from '@/config/locale'  
5 -import type { LocaleState } from '@/config/locale' 6 +import { LocaleDropdownType } from '@/types/localeDropdown'
6 7
7 const { wsCache } = useCache() 8 const { wsCache } = useCache()
8 9
9 -export const useLocaleStore = defineStore({  
10 - id: 'locales',  
11 - state: (): LocaleState => localeModules,  
12 - persist: {  
13 - enabled: true 10 +const elLocaleMap = {
  11 + 'zh-CN': zhCn,
  12 + en: en
  13 +}
  14 +interface LocaleState {
  15 + currentLocale: LocaleDropdownType
  16 + localeMap: LocaleDropdownType[]
  17 +}
  18 +
  19 +export const useLocaleStore = defineStore('locales', {
  20 + state: (): LocaleState => {
  21 + return {
  22 + currentLocale: {
  23 + lang: wsCache.get('lang') || 'zh-CN',
  24 + elLocale: elLocaleMap[wsCache.get('lang') || 'zh-CN']
  25 + },
  26 + // 多语言
  27 + localeMap: [
  28 + {
  29 + lang: 'zh-CN',
  30 + name: '简体中文'
  31 + },
  32 + {
  33 + lang: 'en',
  34 + name: 'English'
  35 + }
  36 + ]
  37 + }
14 }, 38 },
15 getters: { 39 getters: {
16 getCurrentLocale(): LocaleDropdownType { 40 getCurrentLocale(): LocaleDropdownType {
yudao-ui-admin-vue3/src/store/modules/permission.ts
@@ -14,16 +14,12 @@ export interface PermissionState { @@ -14,16 +14,12 @@ export interface PermissionState {
14 menuTabRouters: AppRouteRecordRaw[] 14 menuTabRouters: AppRouteRecordRaw[]
15 } 15 }
16 16
17 -export const usePermissionStore = defineStore({  
18 - id: 'permission', 17 +export const usePermissionStore = defineStore('permission', {
19 state: (): PermissionState => ({ 18 state: (): PermissionState => ({
20 routers: [], 19 routers: [],
21 addRouters: [], 20 addRouters: [],
22 menuTabRouters: [] 21 menuTabRouters: []
23 }), 22 }),
24 - persist: {  
25 - enabled: true  
26 - },  
27 getters: { 23 getters: {
28 getRouters(): AppRouteRecordRaw[] { 24 getRouters(): AppRouteRecordRaw[] {
29 return this.routers 25 return this.routers
yudao-ui-admin-vue3/src/store/modules/tagsView.ts
@@ -10,8 +10,7 @@ export interface TagsViewState { @@ -10,8 +10,7 @@ export interface TagsViewState {
10 cachedViews: Set<string> 10 cachedViews: Set<string>
11 } 11 }
12 12
13 -export const useTagsViewStore = defineStore({  
14 - id: 'tagsView', 13 +export const useTagsViewStore = defineStore('tagsView', {
15 state: (): TagsViewState => ({ 14 state: (): TagsViewState => ({
16 visitedViews: [], 15 visitedViews: [],
17 cachedViews: new Set() 16 cachedViews: new Set()
yudao-ui-admin-vue3/src/store/modules/user.ts
@@ -16,8 +16,7 @@ interface UserInfoVO { @@ -16,8 +16,7 @@ interface UserInfoVO {
16 user: UserVO 16 user: UserVO
17 } 17 }
18 18
19 -export const useUserStore = defineStore({  
20 - id: 'admin-user', 19 +export const useUserStore = defineStore('admin-user', {
21 state: (): UserInfoVO => ({ 20 state: (): UserInfoVO => ({
22 permissions: [], 21 permissions: [],
23 roles: [], 22 roles: [],
yudao-ui-admin-vue3/types/componentType/form.d.ts renamed to yudao-ui-admin-vue3/src/types/components.d.ts
1 -import type { CSSProperties } from 'vue'  
2 -  
3 -declare global {  
4 - declare type ComponentName =  
5 - | 'Radio'  
6 - | 'RadioButton'  
7 - | 'Checkbox'  
8 - | 'CheckboxButton'  
9 - | 'Input'  
10 - | 'Autocomplete'  
11 - | 'InputNumber'  
12 - | 'Select'  
13 - | 'Cascader'  
14 - | 'Switch'  
15 - | 'Slider'  
16 - | 'TimePicker'  
17 - | 'DatePicker'  
18 - | 'Rate'  
19 - | 'ColorPicker'  
20 - | 'Transfer'  
21 - | 'Divider'  
22 - | 'TimeSelect'  
23 - | 'SelectV2'  
24 - | 'InputPassword'  
25 - | 'Editor'  
26 -  
27 - declare type ColProps = {  
28 - span?: number  
29 - xs?: number  
30 - sm?: number  
31 - md?: number  
32 - lg?: number  
33 - xl?: number  
34 - tag?: string  
35 - }  
36 -  
37 - declare type FormValueType = string | number | string[] | number[] | boolean | undefined | null  
38 -  
39 - declare type FormItemProps = {  
40 - labelWidth?: string | number  
41 - required?: boolean  
42 - rules?: Recordable  
43 - error?: string  
44 - showMessage?: boolean  
45 - inlineMessage?: boolean  
46 - style?: CSSProperties  
47 - }  
48 -  
49 - declare type ComponentOptions = {  
50 - label?: string  
51 - value?: FormValueType  
52 - disabled?: boolean  
53 - key?: string | number  
54 - children?: ComponentOptions[]  
55 - options?: ComponentOptions[]  
56 - } & Recordable  
57 -  
58 - declare type ComponentOptionsAlias = {  
59 - labelField?: string  
60 - valueField?: string  
61 - }  
62 -  
63 - declare type ComponentProps = {  
64 - optionsAlias?: ComponentOptionsAlias  
65 - options?: ComponentOptions[]  
66 - optionsSlot?: boolean  
67 - } & Recordable  
68 -  
69 - declare type FormSchema = {  
70 - // 唯一值  
71 - field: string  
72 - // 标题  
73 - label?: string  
74 - // 提示  
75 - labelMessage?: string  
76 - // col组件属性  
77 - colProps?: ColProps  
78 - // 表单组件属性,slots对应的是表单组件的插槽,规则:${field}-xxx,具体可以查看element-plus文档  
79 - componentProps?: { slots?: Recordable } & ComponentProps  
80 - // formItem组件属性  
81 - formItemProps?: FormItemProps  
82 - // 渲染的组件  
83 - component?: ComponentName  
84 - // 初始值  
85 - value?: FormValueType  
86 - // 是否隐藏  
87 - hidden?: boolean  
88 - // 远程加载下拉项  
89 - api?: <T = any>() => Promise<T>  
90 - } 1 +export type ComponentName =
  2 + | 'Radio'
  3 + | 'RadioButton'
  4 + | 'Checkbox'
  5 + | 'CheckboxButton'
  6 + | 'Input'
  7 + | 'Autocomplete'
  8 + | 'InputNumber'
  9 + | 'Select'
  10 + | 'Cascader'
  11 + | 'Switch'
  12 + | 'Slider'
  13 + | 'TimePicker'
  14 + | 'DatePicker'
  15 + | 'Rate'
  16 + | 'ColorPicker'
  17 + | 'Transfer'
  18 + | 'Divider'
  19 + | 'TimeSelect'
  20 + | 'SelectV2'
  21 + | 'InputPassword'
  22 + | 'Editor'
  23 +
  24 +export type ColProps = {
  25 + span?: number
  26 + xs?: number
  27 + sm?: number
  28 + md?: number
  29 + lg?: number
  30 + xl?: number
  31 + tag?: string
  32 +}
91 33
92 - declare type FormSetPropsType = {  
93 - field: string  
94 - path: string  
95 - value: any  
96 - } 34 +export type ComponentOptions = {
  35 + label?: string
  36 + value?: FormValueType
  37 + disabled?: boolean
  38 + key?: string | number
  39 + children?: ComponentOptions[]
  40 + options?: ComponentOptions[]
  41 +} & Recordable
  42 +
  43 +export type ComponentOptionsAlias = {
  44 + labelField?: string
  45 + valueField?: string
97 } 46 }
  47 +
  48 +export type ComponentProps = {
  49 + optionsAlias?: ComponentOptionsAlias
  50 + options?: ComponentOptions[]
  51 + optionsSlot?: boolean
  52 +} & Recordable
yudao-ui-admin-vue3/src/types/configGlobal.d.ts 0 → 100644
  1 +import { ElementPlusSize } from './elementPlus'
  2 +export interface ConfigGlobalTypes {
  3 + size?: ElementPlusSize
  4 +}
yudao-ui-admin-vue3/types/componentType/contextMenu.d.ts renamed to yudao-ui-admin-vue3/src/types/contextMenu.d.ts
1 -declare type contextMenuSchema = { 1 +export type contextMenuSchema = {
2 disabled?: boolean 2 disabled?: boolean
3 divided?: boolean 3 divided?: boolean
4 icon?: string 4 icon?: string
5 label: string 5 label: string
6 - command?: (item: contextMenuSchema) => viod 6 + command?: (item: contextMenuSchema) => void
7 } 7 }
yudao-ui-admin-vue3/types/componentType/descriptions.d.ts renamed to yudao-ui-admin-vue3/src/types/descriptions.d.ts
1 -declare interface DescriptionsSchema { 1 +export interface DescriptionsSchema {
2 span?: number // 占多少分 2 span?: number // 占多少分
3 field: string // 字段名 3 field: string // 字段名
4 label?: string // label名 4 label?: string // label名
yudao-ui-admin-vue3/src/types/elementPlus.d.ts 0 → 100644
  1 +export type ElementPlusSize = 'default' | 'small' | 'large'
  2 +
  3 +export type ElementPlusInfoType = 'success' | 'info' | 'warning' | 'danger'
yudao-ui-admin-vue3/src/types/form.d.ts 0 → 100644
  1 +import type { CSSProperties } from 'vue'
  2 +import { ColProps, ComponentProps, ComponentName } from '@/types/components'
  3 +import { FormValueType, FormValueType } from '@/types/form'
  4 +import type { AxiosPromise } from 'axios'
  5 +
  6 +export type FormSetPropsType = {
  7 + field: string
  8 + path: string
  9 + value: any
  10 +}
  11 +
  12 +export type FormValueType = string | number | string[] | number[] | boolean | undefined | null
  13 +
  14 +export type FormItemProps = {
  15 + labelWidth?: string | number
  16 + required?: boolean
  17 + rules?: Recordable
  18 + error?: string
  19 + showMessage?: boolean
  20 + inlineMessage?: boolean
  21 + style?: CSSProperties
  22 +}
  23 +
  24 +export type FormSchema = {
  25 + // 唯一值
  26 + field: string
  27 + // 标题
  28 + label?: string
  29 + // 提示
  30 + labelMessage?: string
  31 + // col组件属性
  32 + colProps?: ColProps
  33 + // 表单组件属性,slots对应的是表单组件的插槽,规则:${field}-xxx,具体可以查看element-plus文档
  34 + componentProps?: { slots?: Recordable } & ComponentProps
  35 + // formItem组件属性
  36 + formItemProps?: FormItemProps
  37 + // 渲染的组件
  38 + component?: ComponentName
  39 + // 初始值
  40 + value?: FormValueType
  41 + // 是否隐藏
  42 + hidden?: boolean
  43 + // 远程加载下拉项
  44 + api?: <T = any>() => AxiosPromise<T>
  45 +}
yudao-ui-admin-vue3/types/componentType/icon.d.ts renamed to yudao-ui-admin-vue3/src/types/icon.d.ts
1 -declare interface IconTypes { 1 +export interface IconTypes {
2 size?: number 2 size?: number
3 color?: string 3 color?: string
4 icon: string 4 icon: string
yudao-ui-admin-vue3/types/componentType/infotip.d.ts renamed to yudao-ui-admin-vue3/src/types/infoTip.d.ts
1 -declare interface TipSchema { 1 +export interface TipSchema {
2 label: string 2 label: string
3 keys?: string[] 3 keys?: string[]
4 } 4 }
yudao-ui-admin-vue3/src/types/layout.d.ts 0 → 100644
  1 +export type LayoutType = 'classic' | 'topLeft' | 'top' | 'cutMenu'
yudao-ui-admin-vue3/types/componentType/localeDropdown.d.ts renamed to yudao-ui-admin-vue3/src/types/localeDropdown.d.ts
1 -declare interface Language { 1 +export interface Language {
2 el: Recordable 2 el: Recordable
3 name: string 3 name: string
4 } 4 }
5 5
6 -declare interface LocaleDropdownType { 6 +export interface LocaleDropdownType {
7 lang: LocaleType 7 lang: LocaleType
8 name?: string 8 name?: string
9 elLocale?: Language 9 elLocale?: Language
yudao-ui-admin-vue3/types/componentType/qrcode.d.ts renamed to yudao-ui-admin-vue3/src/types/qrcode.d.ts
1 -declare interface QrcodeLogo { 1 +export interface QrcodeLogo {
2 src?: string 2 src?: string
3 logoSize?: number 3 logoSize?: number
4 bgColor?: string 4 bgColor?: string
yudao-ui-admin-vue3/types/componentType/table.d.ts renamed to yudao-ui-admin-vue3/src/types/table.d.ts
1 -declare type TableColumn = { 1 +export type TableColumn = {
2 field: string 2 field: string
3 label?: string 3 label?: string
4 children?: TableColumn[] 4 children?: TableColumn[]
5 } & Recordable 5 } & Recordable
6 6
7 -declare type TableSlotDefault = { 7 +export type TableSlotDefault = {
8 row: Recordable 8 row: Recordable
9 column: TableColumn 9 column: TableColumn
10 $index: number 10 $index: number
11 } & Recordable 11 } & Recordable
12 12
13 -declare interface Pagination { 13 +export interface Pagination {
14 small?: boolean 14 small?: boolean
15 background?: boolean 15 background?: boolean
16 pageSize?: number 16 pageSize?: number
@@ -29,7 +29,7 @@ declare interface Pagination { @@ -29,7 +29,7 @@ declare interface Pagination {
29 hideOnSinglePage?: boolean 29 hideOnSinglePage?: boolean
30 } 30 }
31 31
32 -declare interface TableSetPropsType { 32 +export interface TableSetPropsType {
33 field: string 33 field: string
34 path: string 34 path: string
35 value: any 35 value: any
yudao-ui-admin-vue3/src/types/theme.d.ts 0 → 100644
  1 +export type ThemeTypes = {
  2 + elColorPrimary?: string
  3 + leftMenuBorderColor?: string
  4 + leftMenuBgColor?: string
  5 + leftMenuBgLightColor?: string
  6 + leftMenuBgActiveColor?: string
  7 + leftMenuCollapseBgActiveColor?: string
  8 + leftMenuTextColor?: string
  9 + leftMenuTextActiveColor?: string
  10 + logoTitleTextColor?: string
  11 + logoBorderColor?: string
  12 + topHeaderBgColor?: string
  13 + topHeaderTextColor?: string
  14 + topHeaderHoverColor?: string
  15 + topToolBorderColor?: string
  16 +}
yudao-ui-admin-vue3/src/utils/dict.ts
@@ -2,6 +2,7 @@ @@ -2,6 +2,7 @@
2 * 数据字典工具类 2 * 数据字典工具类
3 */ 3 */
4 import { useDictStoreWithOut } from '@/store/modules/dict' 4 import { useDictStoreWithOut } from '@/store/modules/dict'
  5 +import { ElementPlusInfoType } from '@/types/elementPlus'
5 6
6 const dictStore = useDictStoreWithOut() 7 const dictStore = useDictStoreWithOut()
7 8
yudao-ui-admin-vue3/src/views/Login/components/LoginForm.vue
@@ -103,20 +103,25 @@ const getCookie = () =&gt; { @@ -103,20 +103,25 @@ const getCookie = () =&gt; {
103 // 登录 103 // 登录
104 const handleLogin = async (params) => { 104 const handleLogin = async (params) => {
105 loginLoading.value = true 105 loginLoading.value = true
106 - await getTenantId()  
107 - const data = await validForm()  
108 - if (!data) { 106 + try {
  107 + await getTenantId()
  108 + const data = await validForm()
  109 + if (!data) {
  110 + return
  111 + }
  112 + loginData.loginForm.captchaVerification = params.captchaVerification
  113 + const res = await LoginApi.loginApi(loginData.loginForm)
  114 + if (!res) {
  115 + return
  116 + }
  117 + setToken(res)
  118 + if (!redirect.value) {
  119 + redirect.value = '/'
  120 + }
  121 + push({ path: redirect.value || permissionStore.addRouters[0].path })
  122 + } finally {
109 loginLoading.value = false 123 loginLoading.value = false
110 - return  
111 - }  
112 - loginData.loginForm.captchaVerification = params.captchaVerification  
113 - const res = await LoginApi.loginApi(loginData.loginForm)  
114 - setToken(res)  
115 - if (!redirect.value) {  
116 - redirect.value = '/'  
117 } 124 }
118 - push({ path: redirect.value || permissionStore.addRouters[0].path })  
119 - loginLoading.value = false  
120 } 125 }
121 126
122 // 社交登录 127 // 社交登录
yudao-ui-admin-vue3/src/views/Login/components/RegisterForm.vue
@@ -7,6 +7,7 @@ import { ElInput, FormRules } from &#39;element-plus&#39; @@ -7,6 +7,7 @@ import { ElInput, FormRules } from &#39;element-plus&#39;
7 import { useValidator } from '@/hooks/web/useValidator' 7 import { useValidator } from '@/hooks/web/useValidator'
8 import { useLoginState, LoginStateEnum } from './useLogin' 8 import { useLoginState, LoginStateEnum } from './useLogin'
9 import LoginFormTitle from './LoginFormTitle.vue' 9 import LoginFormTitle from './LoginFormTitle.vue'
  10 +import { FormSchema } from '@/types/form'
10 11
11 const { register, elFormRef } = useForm() 12 const { register, elFormRef } = useForm()
12 const { handleBackLogin, getLoginState } = useLoginState() 13 const { handleBackLogin, getLoginState } = useLoginState()
yudao-ui-admin-vue3/src/views/bpm/form/index.vue
@@ -49,23 +49,29 @@ const handleUpdate = async (row: FormVO) =&gt; { @@ -49,23 +49,29 @@ const handleUpdate = async (row: FormVO) =&gt; {
49 49
50 // 提交按钮 50 // 提交按钮
51 const submitForm = async () => { 51 const submitForm = async () => {
52 - actionLoading.value = true  
53 - // 提交请求  
54 - try {  
55 - const data = unref(formRef)?.formModel as FormVO  
56 - if (actionType.value === 'create') {  
57 - await FormApi.createFormApi(data)  
58 - ElMessage.success(t('common.createSuccess'))  
59 - } else {  
60 - await FormApi.updateFormApi(data)  
61 - ElMessage.success(t('common.updateSuccess')) 52 + const elForm = unref(formRef)?.getElFormRef()
  53 + if (!elForm) return
  54 + elForm.validate(async (valid) => {
  55 + if (valid) {
  56 + actionLoading.value = true
  57 + // 提交请求
  58 + try {
  59 + const data = unref(formRef)?.formModel as FormVO
  60 + if (actionType.value === 'create') {
  61 + await FormApi.createFormApi(data)
  62 + ElMessage.success(t('common.createSuccess'))
  63 + } else {
  64 + await FormApi.updateFormApi(data)
  65 + ElMessage.success(t('common.updateSuccess'))
  66 + }
  67 + // 操作成功,重新加载列表
  68 + dialogVisible.value = false
  69 + await getList()
  70 + } finally {
  71 + actionLoading.value = false
  72 + }
62 } 73 }
63 - // 操作成功,重新加载列表  
64 - dialogVisible.value = false  
65 - await getList()  
66 - } finally {  
67 - actionLoading.value = false  
68 - } 74 + })
69 } 75 }
70 76
71 // ========== 详情相关 ========== 77 // ========== 详情相关 ==========
yudao-ui-admin-vue3/src/views/bpm/group/index.vue
@@ -62,24 +62,30 @@ const handleUpdate = async (row: UserGroupVO) =&gt; { @@ -62,24 +62,30 @@ const handleUpdate = async (row: UserGroupVO) =&gt; {
62 62
63 // 提交按钮 63 // 提交按钮
64 const submitForm = async () => { 64 const submitForm = async () => {
65 - actionLoading.value = true  
66 - // 提交请求  
67 - try {  
68 - const data = unref(formRef)?.formModel as UserGroupVO  
69 - data.memberUserIds = userIds.value  
70 - if (actionType.value === 'create') {  
71 - await UserGroupApi.createUserGroupApi(data)  
72 - ElMessage.success(t('common.createSuccess'))  
73 - } else {  
74 - await UserGroupApi.updateUserGroupApi(data)  
75 - ElMessage.success(t('common.updateSuccess')) 65 + const elForm = unref(formRef)?.getElFormRef()
  66 + if (!elForm) return
  67 + elForm.validate(async (valid) => {
  68 + if (valid) {
  69 + actionLoading.value = true
  70 + // 提交请求
  71 + try {
  72 + const data = unref(formRef)?.formModel as UserGroupVO
  73 + data.memberUserIds = userIds.value
  74 + if (actionType.value === 'create') {
  75 + await UserGroupApi.createUserGroupApi(data)
  76 + ElMessage.success(t('common.createSuccess'))
  77 + } else {
  78 + await UserGroupApi.updateUserGroupApi(data)
  79 + ElMessage.success(t('common.updateSuccess'))
  80 + }
  81 + // 操作成功,重新加载列表
  82 + dialogVisible.value = false
  83 + await getList()
  84 + } finally {
  85 + actionLoading.value = false
  86 + }
76 } 87 }
77 - // 操作成功,重新加载列表  
78 - dialogVisible.value = false  
79 - await getList()  
80 - } finally {  
81 - actionLoading.value = false  
82 - } 88 + })
83 } 89 }
84 90
85 // 根据用户名获取用户真实名 91 // 根据用户名获取用户真实名
yudao-ui-admin-vue3/src/views/bpm/model/index.vue
@@ -51,23 +51,29 @@ const handleUpdate = async (row: ModelVO) =&gt; { @@ -51,23 +51,29 @@ const handleUpdate = async (row: ModelVO) =&gt; {
51 51
52 // 提交按钮 52 // 提交按钮
53 const submitForm = async () => { 53 const submitForm = async () => {
54 - actionLoading.value = true  
55 - // 提交请求  
56 - try {  
57 - const data = unref(formRef)?.formModel as ModelVO  
58 - if (actionType.value === 'create') {  
59 - await ModelApi.createModelApi(data)  
60 - message.success(t('common.createSuccess'))  
61 - } else {  
62 - await ModelApi.updateModelApi(data)  
63 - message.success(t('common.updateSuccess')) 54 + const elForm = unref(formRef)?.getElFormRef()
  55 + if (!elForm) return
  56 + elForm.validate(async (valid) => {
  57 + if (valid) {
  58 + actionLoading.value = true
  59 + // 提交请求
  60 + try {
  61 + const data = unref(formRef)?.formModel as ModelVO
  62 + if (actionType.value === 'create') {
  63 + await ModelApi.createModelApi(data)
  64 + message.success(t('common.createSuccess'))
  65 + } else {
  66 + await ModelApi.updateModelApi(data)
  67 + message.success(t('common.updateSuccess'))
  68 + }
  69 + // 操作成功,重新加载列表
  70 + dialogVisible.value = false
  71 + await getList()
  72 + } finally {
  73 + actionLoading.value = false
  74 + }
64 } 75 }
65 - // 操作成功,重新加载列表  
66 - dialogVisible.value = false  
67 - await getList()  
68 - } finally {  
69 - actionLoading.value = false  
70 - } 76 + })
71 } 77 }
72 78
73 /** 流程表单的详情按钮操作 */ 79 /** 流程表单的详情按钮操作 */
yudao-ui-admin-vue3/src/views/infra/codegen/EditTable.vue
@@ -26,6 +26,10 @@ const activeName = ref(&#39;cloum&#39;) @@ -26,6 +26,10 @@ const activeName = ref(&#39;cloum&#39;)
26 const basicInfoRef = ref<ComponentRef<typeof BasicInfoForm>>() 26 const basicInfoRef = ref<ComponentRef<typeof BasicInfoForm>>()
27 const genInfoRef = ref<ComponentRef<typeof GenInfoForm>>() 27 const genInfoRef = ref<ComponentRef<typeof GenInfoForm>>()
28 const cloumInfoRef = ref(null) 28 const cloumInfoRef = ref(null)
  29 +const parentMenuId = ref<number>()
  30 +const menu = (id: number) => {
  31 + parentMenuId.value = id
  32 +}
29 const submitForm = async () => { 33 const submitForm = async () => {
30 const basicInfo = unref(basicInfoRef) 34 const basicInfo = unref(basicInfoRef)
31 const genInfo = unref(genInfoRef) 35 const genInfo = unref(genInfoRef)
@@ -38,6 +42,11 @@ const submitForm = async () =&gt; { @@ -38,6 +42,11 @@ const submitForm = async () =&gt; {
38 table: Object.assign({}, basicInfoData, genInfoData), 42 table: Object.assign({}, basicInfoData, genInfoData),
39 columns: cloumCurrentRow.value 43 columns: cloumCurrentRow.value
40 } 44 }
  45 + if (parentMenuId.value) {
  46 + genInfoData.parentMenuId = parentMenuId.value
  47 + } else {
  48 + genInfoData.parentMenuId = 0
  49 + }
41 await updateCodegenTableApi(genTable) 50 await updateCodegenTableApi(genTable)
42 ElMessage.success(t('common.updateSuccess')) 51 ElMessage.success(t('common.updateSuccess'))
43 push('/infra/codegen') 52 push('/infra/codegen')
@@ -57,7 +66,7 @@ onMounted(() =&gt; { @@ -57,7 +66,7 @@ onMounted(() =&gt; {
57 <CloumInfoForm ref="cloumInfoRef" :info="cloumCurrentRow" /> 66 <CloumInfoForm ref="cloumInfoRef" :info="cloumCurrentRow" />
58 </el-tab-pane> 67 </el-tab-pane>
59 <el-tab-pane label="生成信息" name="genInfo"> 68 <el-tab-pane label="生成信息" name="genInfo">
60 - <GenInfoForm ref="genInfoRef" :genInfo="tableCurrentRow" /> 69 + <GenInfoForm ref="genInfoRef" :genInfo="tableCurrentRow" @menu="menu" />
61 </el-tab-pane> 70 </el-tab-pane>
62 </el-tabs> 71 </el-tabs>
63 <template #right> 72 <template #right>
yudao-ui-admin-vue3/src/views/infra/codegen/components/BasicInfoForm.vue
@@ -4,6 +4,8 @@ import { required } from &#39;@/utils/formRules&#39; @@ -4,6 +4,8 @@ import { required } from &#39;@/utils/formRules&#39;
4 import { CodegenTableVO } from '@/api/infra/codegen/types' 4 import { CodegenTableVO } from '@/api/infra/codegen/types'
5 import { Form } from '@/components/Form' 5 import { Form } from '@/components/Form'
6 import { useForm } from '@/hooks/web/useForm' 6 import { useForm } from '@/hooks/web/useForm'
  7 +import { FormSchema } from '@/types/form'
  8 +
7 const props = defineProps({ 9 const props = defineProps({
8 basicInfo: { 10 basicInfo: {
9 type: Object as PropType<Nullable<CodegenTableVO>>, 11 type: Object as PropType<Nullable<CodegenTableVO>>,
yudao-ui-admin-vue3/src/views/infra/codegen/components/GenInfoForm.vue
1 <script setup lang="ts"> 1 <script setup lang="ts">
2 -import { PropType, reactive, watch } from 'vue' 2 +import { onMounted, PropType, reactive, ref, watch } from 'vue'
3 import { required } from '@/utils/formRules' 3 import { required } from '@/utils/formRules'
4 -import { CodegenTableVO } from '@/api/infra/codegen/types'  
5 import { Form } from '@/components/Form' 4 import { Form } from '@/components/Form'
  5 +import { handleTree } from '@/utils/tree'
  6 +import { ElTreeSelect } from 'element-plus'
6 import { useForm } from '@/hooks/web/useForm' 7 import { useForm } from '@/hooks/web/useForm'
7 import { DICT_TYPE, getIntDictOptions } from '@/utils/dict' 8 import { DICT_TYPE, getIntDictOptions } from '@/utils/dict'
  9 +import { listSimpleMenusApi } from '@/api/system/menu'
  10 +import { CodegenTableVO } from '@/api/infra/codegen/types'
  11 +import { FormSchema } from '@/types/form'
8 const props = defineProps({ 12 const props = defineProps({
9 genInfo: { 13 genInfo: {
10 type: Object as PropType<Nullable<CodegenTableVO>>, 14 type: Object as PropType<Nullable<CodegenTableVO>>,
11 default: () => null 15 default: () => null
12 } 16 }
13 }) 17 })
  18 +const menuProps = {
  19 + checkStrictly: true,
  20 + children: 'children',
  21 + label: 'name',
  22 + value: 'id'
  23 +}
14 const rules = reactive({ 24 const rules = reactive({
15 templateType: [required], 25 templateType: [required],
16 scene: [required], 26 scene: [required],
@@ -22,6 +32,12 @@ const rules = reactive({ @@ -22,6 +32,12 @@ const rules = reactive({
22 }) 32 })
23 const templateTypeOptions = getIntDictOptions(DICT_TYPE.INFRA_CODEGEN_TEMPLATE_TYPE) 33 const templateTypeOptions = getIntDictOptions(DICT_TYPE.INFRA_CODEGEN_TEMPLATE_TYPE)
24 const sceneOptions = getIntDictOptions(DICT_TYPE.INFRA_CODEGEN_SCENE) 34 const sceneOptions = getIntDictOptions(DICT_TYPE.INFRA_CODEGEN_SCENE)
  35 +const treeRef = ref<InstanceType<typeof ElTreeSelect>>()
  36 +const menuOptions = ref<any>([]) // 树形结构
  37 +const getTree = async () => {
  38 + const res = await listSimpleMenusApi()
  39 + menuOptions.value = handleTree(res)
  40 +}
25 const schema = reactive<FormSchema[]>([ 41 const schema = reactive<FormSchema[]>([
26 { 42 {
27 label: '生成模板', 43 label: '生成模板',
@@ -84,7 +100,9 @@ const schema = reactive&lt;FormSchema[]&gt;([ @@ -84,7 +100,9 @@ const schema = reactive&lt;FormSchema[]&gt;([
84 { 100 {
85 label: '上级菜单', 101 label: '上级菜单',
86 field: 'parentMenuId', 102 field: 'parentMenuId',
87 - component: 'Input', 103 + componentProps: {
  104 + optionsSlot: true
  105 + },
88 labelMessage: '分配到指定菜单下,例如 系统管理', 106 labelMessage: '分配到指定菜单下,例如 系统管理',
89 colProps: { 107 colProps: {
90 span: 12 108 span: 12
@@ -94,6 +112,17 @@ const schema = reactive&lt;FormSchema[]&gt;([ @@ -94,6 +112,17 @@ const schema = reactive&lt;FormSchema[]&gt;([
94 const { register, methods, elFormRef } = useForm({ 112 const { register, methods, elFormRef } = useForm({
95 schema 113 schema
96 }) 114 })
  115 +const parentMenuId = ref<number>()
  116 +//子组件像父组件传值
  117 +const emit = defineEmits(['menu'])
  118 +const handleNodeClick = () => {
  119 + emit('menu', parentMenuId.value)
  120 +}
  121 +
  122 +// ========== 初始化 ==========
  123 +onMounted(async () => {
  124 + await getTree()
  125 +})
97 watch( 126 watch(
98 () => props.genInfo, 127 () => props.genInfo,
99 (genInfo) => { 128 (genInfo) => {
@@ -106,12 +135,23 @@ watch( @@ -106,12 +135,23 @@ watch(
106 immediate: true 135 immediate: true
107 } 136 }
108 ) 137 )
109 -  
110 defineExpose({ 138 defineExpose({
111 elFormRef, 139 elFormRef,
112 getFormData: methods.getFormData 140 getFormData: methods.getFormData
113 }) 141 })
114 </script> 142 </script>
115 <template> 143 <template>
116 - <Form :rules="rules" @register="register" /> 144 + <Form :rules="rules" @register="register">
  145 + <template #parentMenuId>
  146 + <el-tree-select
  147 + v-model="parentMenuId"
  148 + ref="treeRef"
  149 + node-key="id"
  150 + :props="menuProps"
  151 + :data="menuOptions"
  152 + check-strictly
  153 + @node-click="handleNodeClick"
  154 + />
  155 + </template>
  156 + </Form>
117 </template> 157 </template>
yudao-ui-admin-vue3/src/views/infra/codegen/components/ImportTable.vue
1 <script setup lang="ts"> 1 <script setup lang="ts">
2 -import { reactive, ref } from 'vue' 2 +import { reactive, ref, defineEmits } from 'vue'
3 import { getSchemaTableListApi, createCodegenListApi } from '@/api/infra/codegen' 3 import { getSchemaTableListApi, createCodegenListApi } from '@/api/infra/codegen'
4 import { 4 import {
5 ElMessage, 5 ElMessage,
yudao-ui-admin-vue3/src/views/infra/config/index.vue
@@ -50,23 +50,29 @@ const handleUpdate = async (row: ConfigVO) =&gt; { @@ -50,23 +50,29 @@ const handleUpdate = async (row: ConfigVO) =&gt; {
50 50
51 // 提交按钮 51 // 提交按钮
52 const submitForm = async () => { 52 const submitForm = async () => {
53 - actionLoading.value = true  
54 - // 提交请求  
55 - try {  
56 - const data = unref(formRef)?.formModel as ConfigVO  
57 - if (actionType.value === 'create') {  
58 - await ConfigApi.createConfigApi(data)  
59 - ElMessage.success(t('common.createSuccess'))  
60 - } else {  
61 - await ConfigApi.updateConfigApi(data)  
62 - ElMessage.success(t('common.updateSuccess')) 53 + const elForm = unref(formRef)?.getElFormRef()
  54 + if (!elForm) return
  55 + elForm.validate(async (valid) => {
  56 + if (valid) {
  57 + actionLoading.value = true
  58 + // 提交请求
  59 + try {
  60 + const data = unref(formRef)?.formModel as ConfigVO
  61 + if (actionType.value === 'create') {
  62 + await ConfigApi.createConfigApi(data)
  63 + ElMessage.success(t('common.createSuccess'))
  64 + } else {
  65 + await ConfigApi.updateConfigApi(data)
  66 + ElMessage.success(t('common.updateSuccess'))
  67 + }
  68 + // 操作成功,重新加载列表
  69 + dialogVisible.value = false
  70 + await getList()
  71 + } finally {
  72 + actionLoading.value = false
  73 + }
63 } 74 }
64 - // 操作成功,重新加载列表  
65 - dialogVisible.value = false  
66 - await getList()  
67 - } finally {  
68 - actionLoading.value = false  
69 - } 75 + })
70 } 76 }
71 77
72 // ========== 详情相关 ========== 78 // ========== 详情相关 ==========
yudao-ui-admin-vue3/src/views/infra/dataSourceConfig/index.vue
@@ -44,23 +44,29 @@ const handleUpdate = async (row: DataSourceConfigVO) =&gt; { @@ -44,23 +44,29 @@ const handleUpdate = async (row: DataSourceConfigVO) =&gt; {
44 44
45 // 提交按钮 45 // 提交按钮
46 const submitForm = async () => { 46 const submitForm = async () => {
47 - loading.value = true  
48 - // 提交请求  
49 - try {  
50 - const data = unref(formRef)?.formModel as DataSourceConfigVO  
51 - if (actionType.value === 'create') {  
52 - await DataSourceConfiggApi.createDataSourceConfigApi(data)  
53 - ElMessage.success(t('common.createSuccess'))  
54 - } else {  
55 - await DataSourceConfiggApi.updateDataSourceConfigApi(data)  
56 - ElMessage.success(t('common.updateSuccess')) 47 + const elForm = unref(formRef)?.getElFormRef()
  48 + if (!elForm) return
  49 + elForm.validate(async (valid) => {
  50 + if (valid) {
  51 + loading.value = true
  52 + // 提交请求
  53 + try {
  54 + const data = unref(formRef)?.formModel as DataSourceConfigVO
  55 + if (actionType.value === 'create') {
  56 + await DataSourceConfiggApi.createDataSourceConfigApi(data)
  57 + ElMessage.success(t('common.createSuccess'))
  58 + } else {
  59 + await DataSourceConfiggApi.updateDataSourceConfigApi(data)
  60 + ElMessage.success(t('common.updateSuccess'))
  61 + }
  62 + // 操作成功,重新加载列表
  63 + dialogVisible.value = false
  64 + await getList()
  65 + } finally {
  66 + loading.value = false
  67 + }
57 } 68 }
58 - // 操作成功,重新加载列表  
59 - dialogVisible.value = false  
60 - await getList()  
61 - } finally {  
62 - loading.value = false  
63 - } 69 + })
64 } 70 }
65 71
66 // 删除操作 72 // 删除操作
yudao-ui-admin-vue3/src/views/infra/fileConfig/index.vue
@@ -60,23 +60,29 @@ const handleMaster = (row: FileConfigVO) =&gt; { @@ -60,23 +60,29 @@ const handleMaster = (row: FileConfigVO) =&gt; {
60 60
61 // 提交按钮 61 // 提交按钮
62 const submitForm = async () => { 62 const submitForm = async () => {
63 - actionLoading.value = true  
64 - // 提交请求  
65 - try {  
66 - const data = unref(formRef)?.formModel as FileConfigVO  
67 - if (actionType.value === 'create') {  
68 - await FileConfigApi.createFileConfigApi(data)  
69 - message.success(t('common.createSuccess'))  
70 - } else {  
71 - await FileConfigApi.updateFileConfigApi(data)  
72 - message.success(t('common.updateSuccess')) 63 + const elForm = unref(formRef)?.getElFormRef()
  64 + if (!elForm) return
  65 + elForm.validate(async (valid) => {
  66 + if (valid) {
  67 + actionLoading.value = true
  68 + // 提交请求
  69 + try {
  70 + const data = unref(formRef)?.formModel as FileConfigVO
  71 + if (actionType.value === 'create') {
  72 + await FileConfigApi.createFileConfigApi(data)
  73 + message.success(t('common.createSuccess'))
  74 + } else {
  75 + await FileConfigApi.updateFileConfigApi(data)
  76 + message.success(t('common.updateSuccess'))
  77 + }
  78 + // 操作成功,重新加载列表
  79 + dialogVisible.value = false
  80 + await getList()
  81 + } finally {
  82 + actionLoading.value = false
  83 + }
73 } 84 }
74 - // 操作成功,重新加载列表  
75 - dialogVisible.value = false  
76 - await getList()  
77 - } finally {  
78 - actionLoading.value = false  
79 - } 85 + })
80 } 86 }
81 87
82 // ========== 详情相关 ========== 88 // ========== 详情相关 ==========
yudao-ui-admin-vue3/src/views/infra/job/index.vue
@@ -98,24 +98,30 @@ const handleRun = (row: JobVO) =&gt; { @@ -98,24 +98,30 @@ const handleRun = (row: JobVO) =&gt; {
98 } 98 }
99 // 提交按钮 99 // 提交按钮
100 const submitForm = async () => { 100 const submitForm = async () => {
101 - actionLoading.value = true  
102 - // 提交请求  
103 - try {  
104 - const data = unref(formRef)?.formModel as JobVO  
105 - data.cronExpression = cronExpression.value  
106 - if (actionType.value === 'create') {  
107 - await JobApi.createJobApi(data)  
108 - message.success(t('common.createSuccess'))  
109 - } else {  
110 - await JobApi.updateJobApi(data)  
111 - message.success(t('common.updateSuccess')) 101 + const elForm = unref(formRef)?.getElFormRef()
  102 + if (!elForm) return
  103 + elForm.validate(async (valid) => {
  104 + if (valid) {
  105 + actionLoading.value = true
  106 + // 提交请求
  107 + try {
  108 + const data = unref(formRef)?.formModel as JobVO
  109 + data.cronExpression = cronExpression.value
  110 + if (actionType.value === 'create') {
  111 + await JobApi.createJobApi(data)
  112 + message.success(t('common.createSuccess'))
  113 + } else {
  114 + await JobApi.updateJobApi(data)
  115 + message.success(t('common.updateSuccess'))
  116 + }
  117 + // 操作成功,重新加载列表
  118 + dialogVisible.value = false
  119 + await getList()
  120 + } finally {
  121 + actionLoading.value = false
  122 + }
112 } 123 }
113 - // 操作成功,重新加载列表  
114 - dialogVisible.value = false  
115 - await getList()  
116 - } finally {  
117 - actionLoading.value = false  
118 - } 124 + })
119 } 125 }
120 126
121 // ========== 详情相关 ========== 127 // ========== 详情相关 ==========
yudao-ui-admin-vue3/src/views/pay/app/index.vue
@@ -50,23 +50,29 @@ const handleUpdate = async (row: AppVO) =&gt; { @@ -50,23 +50,29 @@ const handleUpdate = async (row: AppVO) =&gt; {
50 50
51 // 提交按钮 51 // 提交按钮
52 const submitForm = async () => { 52 const submitForm = async () => {
53 - actionLoading.value = true  
54 - // 提交请求  
55 - try {  
56 - const data = unref(formRef)?.formModel as AppVO  
57 - if (actionType.value === 'create') {  
58 - await AppApi.createAppApi(data)  
59 - ElMessage.success(t('common.createSuccess'))  
60 - } else {  
61 - await AppApi.updateAppApi(data)  
62 - ElMessage.success(t('common.updateSuccess')) 53 + const elForm = unref(formRef)?.getElFormRef()
  54 + if (!elForm) return
  55 + elForm.validate(async (valid) => {
  56 + if (valid) {
  57 + actionLoading.value = true
  58 + // 提交请求
  59 + try {
  60 + const data = unref(formRef)?.formModel as AppVO
  61 + if (actionType.value === 'create') {
  62 + await AppApi.createAppApi(data)
  63 + ElMessage.success(t('common.createSuccess'))
  64 + } else {
  65 + await AppApi.updateAppApi(data)
  66 + ElMessage.success(t('common.updateSuccess'))
  67 + }
  68 + // 操作成功,重新加载列表
  69 + dialogVisible.value = false
  70 + await getList()
  71 + } finally {
  72 + actionLoading.value = false
  73 + }
63 } 74 }
64 - // 操作成功,重新加载列表  
65 - dialogVisible.value = false  
66 - await getList()  
67 - } finally {  
68 - actionLoading.value = false  
69 - } 75 + })
70 } 76 }
71 77
72 // ========== 详情相关 ========== 78 // ========== 详情相关 ==========
yudao-ui-admin-vue3/src/views/pay/merchant/index.vue
@@ -50,23 +50,29 @@ const handleUpdate = async (row: MerchantVO) =&gt; { @@ -50,23 +50,29 @@ const handleUpdate = async (row: MerchantVO) =&gt; {
50 50
51 // 提交按钮 51 // 提交按钮
52 const submitForm = async () => { 52 const submitForm = async () => {
53 - actionLoading.value = true  
54 - // 提交请求  
55 - try {  
56 - const data = unref(formRef)?.formModel as MerchantVO  
57 - if (actionType.value === 'create') {  
58 - await MerchantApi.createMerchantApi(data)  
59 - ElMessage.success(t('common.createSuccess'))  
60 - } else {  
61 - await MerchantApi.updateMerchantApi(data)  
62 - ElMessage.success(t('common.updateSuccess')) 53 + const elForm = unref(formRef)?.getElFormRef()
  54 + if (!elForm) return
  55 + elForm.validate(async (valid) => {
  56 + if (valid) {
  57 + actionLoading.value = true
  58 + // 提交请求
  59 + try {
  60 + const data = unref(formRef)?.formModel as MerchantVO
  61 + if (actionType.value === 'create') {
  62 + await MerchantApi.createMerchantApi(data)
  63 + ElMessage.success(t('common.createSuccess'))
  64 + } else {
  65 + await MerchantApi.updateMerchantApi(data)
  66 + ElMessage.success(t('common.updateSuccess'))
  67 + }
  68 + // 操作成功,重新加载列表
  69 + dialogVisible.value = false
  70 + await getList()
  71 + } finally {
  72 + actionLoading.value = false
  73 + }
63 } 74 }
64 - // 操作成功,重新加载列表  
65 - dialogVisible.value = false  
66 - await getList()  
67 - } finally {  
68 - actionLoading.value = false  
69 - } 75 + })
70 } 76 }
71 77
72 // ========== 详情相关 ========== 78 // ========== 详情相关 ==========
yudao-ui-admin-vue3/src/views/pay/order/index.vue
@@ -48,23 +48,29 @@ const handleUpdate = async (row: OrderVO) =&gt; { @@ -48,23 +48,29 @@ const handleUpdate = async (row: OrderVO) =&gt; {
48 48
49 // 提交按钮 49 // 提交按钮
50 const submitForm = async () => { 50 const submitForm = async () => {
51 - actionLoading.value = true  
52 - // 提交请求  
53 - try {  
54 - const data = unref(formRef)?.formModel as OrderVO  
55 - if (actionType.value === 'create') {  
56 - await OrderApi.createOrderApi(data)  
57 - ElMessage.success(t('common.createSuccess'))  
58 - } else {  
59 - await OrderApi.updateOrderApi(data)  
60 - ElMessage.success(t('common.updateSuccess')) 51 + const elForm = unref(formRef)?.getElFormRef()
  52 + if (!elForm) return
  53 + elForm.validate(async (valid) => {
  54 + if (valid) {
  55 + actionLoading.value = true
  56 + // 提交请求
  57 + try {
  58 + const data = unref(formRef)?.formModel as OrderVO
  59 + if (actionType.value === 'create') {
  60 + await OrderApi.createOrderApi(data)
  61 + ElMessage.success(t('common.createSuccess'))
  62 + } else {
  63 + await OrderApi.updateOrderApi(data)
  64 + ElMessage.success(t('common.updateSuccess'))
  65 + }
  66 + // 操作成功,重新加载列表
  67 + dialogVisible.value = false
  68 + await getList()
  69 + } finally {
  70 + actionLoading.value = false
  71 + }
61 } 72 }
62 - // 操作成功,重新加载列表  
63 - dialogVisible.value = false  
64 - await getList()  
65 - } finally {  
66 - actionLoading.value = false  
67 - } 73 + })
68 } 74 }
69 75
70 // ========== 详情相关 ========== 76 // ========== 详情相关 ==========
yudao-ui-admin-vue3/src/views/system/dept/dept.data.ts
1 import { required } from '@/utils/formRules' 1 import { required } from '@/utils/formRules'
2 import { reactive } from 'vue' 2 import { reactive } from 'vue'
  3 +import { FormSchema } from '@/types/form'
  4 +
3 // 表单校验 5 // 表单校验
4 export const rules = reactive({ 6 export const rules = reactive({
5 name: [required], 7 name: [required],
yudao-ui-admin-vue3/src/views/system/dept/index.vue
@@ -82,22 +82,28 @@ const handleDelete = async (data: { id: number }) =&gt; { @@ -82,22 +82,28 @@ const handleDelete = async (data: { id: number }) =&gt; {
82 } 82 }
83 // 提交按钮 83 // 提交按钮
84 const submitForm = async () => { 84 const submitForm = async () => {
85 - loading.value = true  
86 - // 提交请求  
87 - try {  
88 - const data = unref(formRef)?.formModel as DeptVO  
89 - data.parentId = deptParentId.value  
90 - data.leaderUserId = leaderUserId.value  
91 - if (formTitle.value.startsWith('新增')) {  
92 - await DeptApi.createDeptApi(data)  
93 - } else if (formTitle.value.startsWith('修改')) {  
94 - await DeptApi.updateDeptApi(data) 85 + const elForm = unref(formRef)?.getElFormRef()
  86 + if (!elForm) return
  87 + elForm.validate(async (valid) => {
  88 + if (valid) {
  89 + loading.value = true
  90 + // 提交请求
  91 + try {
  92 + const data = unref(formRef)?.formModel as DeptVO
  93 + data.parentId = deptParentId.value
  94 + data.leaderUserId = leaderUserId.value
  95 + if (formTitle.value.startsWith('新增')) {
  96 + await DeptApi.createDeptApi(data)
  97 + } else if (formTitle.value.startsWith('修改')) {
  98 + await DeptApi.updateDeptApi(data)
  99 + }
  100 + // 操作成功,重新加载列表
  101 + dialogVisible.value = false
  102 + } finally {
  103 + loading.value = false
  104 + }
95 } 105 }
96 - // 操作成功,重新加载列表  
97 - dialogVisible.value = false  
98 - } finally {  
99 - loading.value = false  
100 - } 106 + })
101 } 107 }
102 onMounted(async () => { 108 onMounted(async () => {
103 await getTree() 109 await getTree()
yudao-ui-admin-vue3/src/views/system/dict/index.vue
@@ -92,43 +92,55 @@ const setDialogTile = (type: string) =&gt; { @@ -92,43 +92,55 @@ const setDialogTile = (type: string) =&gt; {
92 } 92 }
93 // 提交按钮 93 // 提交按钮
94 const submitTypeForm = async () => { 94 const submitTypeForm = async () => {
95 - actionLoading.value = true  
96 - // 提交请求  
97 - try {  
98 - const data = unref(typeFormRef)?.formModel as DictTypeVO  
99 - if (actionType.value === 'typeCreate') {  
100 - await DictTypeApi.createDictTypeApi(data)  
101 - ElMessage.success(t('common.createSuccess'))  
102 - } else if (actionType.value === 'typeUpdate') {  
103 - await DictTypeApi.updateDictTypeApi(data)  
104 - ElMessage.success(t('common.updateSuccess')) 95 + const elForm = unref(typeFormRef)?.getElFormRef()
  96 + if (!elForm) return
  97 + elForm.validate(async (valid) => {
  98 + if (valid) {
  99 + actionLoading.value = true
  100 + // 提交请求
  101 + try {
  102 + const data = unref(typeFormRef)?.formModel as DictTypeVO
  103 + if (actionType.value === 'typeCreate') {
  104 + await DictTypeApi.createDictTypeApi(data)
  105 + ElMessage.success(t('common.createSuccess'))
  106 + } else if (actionType.value === 'typeUpdate') {
  107 + await DictTypeApi.updateDictTypeApi(data)
  108 + ElMessage.success(t('common.updateSuccess'))
  109 + }
  110 + // 操作成功,重新加载列表
  111 + await getTypeList()
  112 + dialogVisible.value = false
  113 + } finally {
  114 + actionLoading.value = false
  115 + }
105 } 116 }
106 - // 操作成功,重新加载列表  
107 - await getTypeList()  
108 - dialogVisible.value = false  
109 - } finally {  
110 - actionLoading.value = false  
111 - } 117 + })
112 } 118 }
113 const submitDataForm = async () => { 119 const submitDataForm = async () => {
114 - actionLoading.value = true  
115 - // 提交请求  
116 - try {  
117 - const data = unref(dataFormRef)?.formModel as DictDataVO  
118 - if (actionType.value === 'dataCreate') {  
119 - data.dictType = parentType.value  
120 - await DictDataApi.createDictDataApi(data)  
121 - ElMessage.success(t('common.createSuccess'))  
122 - } else if (actionType.value === 'dataUpdate') {  
123 - await DictDataApi.updateDictDataApi(data)  
124 - ElMessage.success(t('common.updateSuccess')) 120 + const elForm = unref(dataFormRef)?.getElFormRef()
  121 + if (!elForm) return
  122 + elForm.validate(async (valid) => {
  123 + if (valid) {
  124 + actionLoading.value = true
  125 + // 提交请求
  126 + try {
  127 + const data = unref(dataFormRef)?.formModel as DictDataVO
  128 + if (actionType.value === 'dataCreate') {
  129 + data.dictType = parentType.value
  130 + await DictDataApi.createDictDataApi(data)
  131 + ElMessage.success(t('common.createSuccess'))
  132 + } else if (actionType.value === 'dataUpdate') {
  133 + await DictDataApi.updateDictDataApi(data)
  134 + ElMessage.success(t('common.updateSuccess'))
  135 + }
  136 + await getDataList()
  137 + // 操作成功,重新加载列表
  138 + dialogVisible.value = false
  139 + } finally {
  140 + actionLoading.value = false
  141 + }
125 } 142 }
126 - await getDataList()  
127 - // 操作成功,重新加载列表  
128 - dialogVisible.value = false  
129 - } finally {  
130 - actionLoading.value = false  
131 - } 143 + })
132 } 144 }
133 // 初始化查询 145 // 初始化查询
134 onMounted(async () => { 146 onMounted(async () => {
yudao-ui-admin-vue3/src/views/system/errorCode/index.vue
@@ -49,23 +49,29 @@ const handleUpdate = async (row: ErrorCodeVO) =&gt; { @@ -49,23 +49,29 @@ const handleUpdate = async (row: ErrorCodeVO) =&gt; {
49 49
50 // 提交按钮 50 // 提交按钮
51 const submitForm = async () => { 51 const submitForm = async () => {
52 - loading.value = true  
53 - // 提交请求  
54 - try {  
55 - const data = unref(formRef)?.formModel as ErrorCodeVO  
56 - if (actionType.value === 'create') {  
57 - await ErrorCodeApi.createErrorCodeApi(data)  
58 - ElMessage.success(t('common.createSuccess'))  
59 - } else {  
60 - await ErrorCodeApi.updateErrorCodeApi(data)  
61 - ElMessage.success(t('common.updateSuccess')) 52 + const elForm = unref(formRef)?.getElFormRef()
  53 + if (!elForm) return
  54 + elForm.validate(async (valid) => {
  55 + if (valid) {
  56 + loading.value = true
  57 + // 提交请求
  58 + try {
  59 + const data = unref(formRef)?.formModel as ErrorCodeVO
  60 + if (actionType.value === 'create') {
  61 + await ErrorCodeApi.createErrorCodeApi(data)
  62 + ElMessage.success(t('common.createSuccess'))
  63 + } else {
  64 + await ErrorCodeApi.updateErrorCodeApi(data)
  65 + ElMessage.success(t('common.updateSuccess'))
  66 + }
  67 + // 操作成功,重新加载列表
  68 + dialogVisible.value = false
  69 + await getList()
  70 + } finally {
  71 + loading.value = false
  72 + }
62 } 73 }
63 - // 操作成功,重新加载列表  
64 - dialogVisible.value = false  
65 - await getList()  
66 - } finally {  
67 - loading.value = false  
68 - } 74 + })
69 } 75 }
70 76
71 // ========== 详情相关 ========== 77 // ========== 详情相关 ==========
yudao-ui-admin-vue3/src/views/system/menu/index.vue
@@ -42,12 +42,18 @@ const menuProps = { @@ -42,12 +42,18 @@ const menuProps = {
42 label: 'name', 42 label: 'name',
43 value: 'id' 43 value: 'id'
44 } 44 }
45 -const menuOptions = ref() // 树形结构 45 +interface Tree {
  46 + id: number
  47 + name: string
  48 + children?: Tree[] | any[]
  49 +}
  50 +const menuOptions = ref<any[]>([]) // 树形结构
46 const getTree = async () => { 51 const getTree = async () => {
  52 + menuOptions.value = []
47 const res = await MenuApi.listSimpleMenusApi() 53 const res = await MenuApi.listSimpleMenusApi()
48 - const menu = { id: 0, name: '主类目', children: [] as any[] } 54 + let menu: Tree = { id: 0, name: '主类目', children: [] }
49 menu.children = handleTree(res) 55 menu.children = handleTree(res)
50 - menuOptions.value = menu 56 + menuOptions.value.push(menu)
51 } 57 }
52 // ========== 查询 ========== 58 // ========== 查询 ==========
53 const queryParams = reactive({ 59 const queryParams = reactive({
@@ -121,7 +127,7 @@ const handleDelete = async (row: MenuVO) =&gt; { @@ -121,7 +127,7 @@ const handleDelete = async (row: MenuVO) =&gt; {
121 await getList() 127 await getList()
122 } 128 }
123 // 保存操作 129 // 保存操作
124 -function isExternal(path: string) { 130 +const isExternal = (path: string) => {
125 return /^(https?:|mailto:|tel:)/.test(path) 131 return /^(https?:|mailto:|tel:)/.test(path)
126 } 132 }
127 const submitForm = async () => { 133 const submitForm = async () => {
@@ -268,7 +274,7 @@ onMounted(async () =&gt; { @@ -268,7 +274,7 @@ onMounted(async () =&gt; {
268 node-key="id" 274 node-key="id"
269 v-model="menuForm.parentId" 275 v-model="menuForm.parentId"
270 :props="menuProps" 276 :props="menuProps"
271 - :data="menuData" 277 + :data="menuOptions"
272 check-strictly 278 check-strictly
273 /> 279 />
274 </el-form-item> 280 </el-form-item>
yudao-ui-admin-vue3/src/views/system/notice/index.vue
@@ -48,23 +48,29 @@ const handleUpdate = async (row: NoticeVO) =&gt; { @@ -48,23 +48,29 @@ const handleUpdate = async (row: NoticeVO) =&gt; {
48 48
49 // 提交按钮 49 // 提交按钮
50 const submitForm = async () => { 50 const submitForm = async () => {
51 - actionLoading.value = true  
52 - // 提交请求  
53 - try {  
54 - const data = unref(formRef)?.formModel as NoticeVO  
55 - if (actionType.value === 'create') {  
56 - await NoticeApi.createNoticeApi(data)  
57 - ElMessage.success(t('common.createSuccess'))  
58 - } else {  
59 - await NoticeApi.updateNoticeApi(data)  
60 - ElMessage.success(t('common.updateSuccess')) 51 + const elForm = unref(formRef)?.getElFormRef()
  52 + if (!elForm) return
  53 + elForm.validate(async (valid) => {
  54 + if (valid) {
  55 + actionLoading.value = true
  56 + // 提交请求
  57 + try {
  58 + const data = unref(formRef)?.formModel as NoticeVO
  59 + if (actionType.value === 'create') {
  60 + await NoticeApi.createNoticeApi(data)
  61 + ElMessage.success(t('common.createSuccess'))
  62 + } else {
  63 + await NoticeApi.updateNoticeApi(data)
  64 + ElMessage.success(t('common.updateSuccess'))
  65 + }
  66 + // 操作成功,重新加载列表
  67 + dialogVisible.value = false
  68 + await getList()
  69 + } finally {
  70 + actionLoading.value = false
  71 + }
61 } 72 }
62 - // 操作成功,重新加载列表  
63 - dialogVisible.value = false  
64 - await getList()  
65 - } finally {  
66 - actionLoading.value = false  
67 - } 73 + })
68 } 74 }
69 75
70 // ========== 详情相关 ========== 76 // ========== 详情相关 ==========
yudao-ui-admin-vue3/src/views/system/oauth2/client/index.vue
@@ -49,23 +49,29 @@ const handleUpdate = async (row: OAuth2ClientVo) =&gt; { @@ -49,23 +49,29 @@ const handleUpdate = async (row: OAuth2ClientVo) =&gt; {
49 49
50 // 提交按钮 50 // 提交按钮
51 const submitForm = async () => { 51 const submitForm = async () => {
52 - actionLoading.value = true  
53 - // 提交请求  
54 - try {  
55 - const data = unref(formRef)?.formModel as OAuth2ClientVo  
56 - if (actionType.value === 'create') {  
57 - await ClientApi.createOAuth2ClientApi(data)  
58 - ElMessage.success(t('common.createSuccess'))  
59 - } else {  
60 - await ClientApi.updateOAuth2ClientApi(data)  
61 - ElMessage.success(t('common.updateSuccess')) 52 + const elForm = unref(formRef)?.getElFormRef()
  53 + if (!elForm) return
  54 + elForm.validate(async (valid) => {
  55 + if (valid) {
  56 + actionLoading.value = true
  57 + // 提交请求
  58 + try {
  59 + const data = unref(formRef)?.formModel as OAuth2ClientVo
  60 + if (actionType.value === 'create') {
  61 + await ClientApi.createOAuth2ClientApi(data)
  62 + ElMessage.success(t('common.createSuccess'))
  63 + } else {
  64 + await ClientApi.updateOAuth2ClientApi(data)
  65 + ElMessage.success(t('common.updateSuccess'))
  66 + }
  67 + // 操作成功,重新加载列表
  68 + dialogVisible.value = false
  69 + await getList()
  70 + } finally {
  71 + actionLoading.value = false
  72 + }
62 } 73 }
63 - // 操作成功,重新加载列表  
64 - dialogVisible.value = false  
65 - await getList()  
66 - } finally {  
67 - actionLoading.value = false  
68 - } 74 + })
69 } 75 }
70 76
71 // ========== 详情相关 ========== 77 // ========== 详情相关 ==========
yudao-ui-admin-vue3/src/views/system/post/index.vue
@@ -50,23 +50,29 @@ const handleUpdate = async (row: PostVO) =&gt; { @@ -50,23 +50,29 @@ const handleUpdate = async (row: PostVO) =&gt; {
50 50
51 // 提交按钮 51 // 提交按钮
52 const submitForm = async () => { 52 const submitForm = async () => {
53 - actionLoading.value = true  
54 - // 提交请求  
55 - try {  
56 - const data = unref(formRef)?.formModel as PostVO  
57 - if (actionType.value === 'create') {  
58 - await PostApi.createPostApi(data)  
59 - ElMessage.success(t('common.createSuccess'))  
60 - } else {  
61 - await PostApi.updatePostApi(data)  
62 - ElMessage.success(t('common.updateSuccess')) 53 + const elForm = unref(formRef)?.getElFormRef()
  54 + if (!elForm) return
  55 + elForm.validate(async (valid) => {
  56 + if (valid) {
  57 + actionLoading.value = true
  58 + // 提交请求
  59 + try {
  60 + const data = unref(formRef)?.formModel as PostVO
  61 + if (actionType.value === 'create') {
  62 + await PostApi.createPostApi(data)
  63 + ElMessage.success(t('common.createSuccess'))
  64 + } else {
  65 + await PostApi.updatePostApi(data)
  66 + ElMessage.success(t('common.updateSuccess'))
  67 + }
  68 + // 操作成功,重新加载列表
  69 + dialogVisible.value = false
  70 + await getList()
  71 + } finally {
  72 + actionLoading.value = false
  73 + }
63 } 74 }
64 - // 操作成功,重新加载列表  
65 - dialogVisible.value = false  
66 - await getList()  
67 - } finally {  
68 - actionLoading.value = false  
69 - } 75 + })
70 } 76 }
71 77
72 // ========== 详情相关 ========== 78 // ========== 详情相关 ==========
yudao-ui-admin-vue3/src/views/system/role/index.vue
@@ -68,23 +68,29 @@ const handleUpdate = async (row: RoleVO) =&gt; { @@ -68,23 +68,29 @@ const handleUpdate = async (row: RoleVO) =&gt; {
68 68
69 // 提交按钮 69 // 提交按钮
70 const submitForm = async () => { 70 const submitForm = async () => {
71 - loading.value = true  
72 - // 提交请求  
73 - try {  
74 - const data = unref(formRef)?.formModel as RoleVO  
75 - if (actionType.value === 'create') {  
76 - await RoleApi.createRoleApi(data)  
77 - ElMessage.success(t('common.createSuccess'))  
78 - } else {  
79 - await RoleApi.updateRoleApi(data)  
80 - ElMessage.success(t('common.updateSuccess')) 71 + const elForm = unref(formRef)?.getElFormRef()
  72 + if (!elForm) return
  73 + elForm.validate(async (valid) => {
  74 + if (valid) {
  75 + loading.value = true
  76 + // 提交请求
  77 + try {
  78 + const data = unref(formRef)?.formModel as RoleVO
  79 + if (actionType.value === 'create') {
  80 + await RoleApi.createRoleApi(data)
  81 + ElMessage.success(t('common.createSuccess'))
  82 + } else {
  83 + await RoleApi.updateRoleApi(data)
  84 + ElMessage.success(t('common.updateSuccess'))
  85 + }
  86 + // 操作成功,重新加载列表
  87 + dialogVisible.value = false
  88 + await getList()
  89 + } finally {
  90 + loading.value = false
  91 + }
81 } 92 }
82 - // 操作成功,重新加载列表  
83 - dialogVisible.value = false  
84 - await getList()  
85 - } finally {  
86 - loading.value = false  
87 - } 93 + })
88 } 94 }
89 95
90 // ========== 详情相关 ========== 96 // ========== 详情相关 ==========
yudao-ui-admin-vue3/src/views/system/sensitiveWord/index.vue
@@ -56,23 +56,29 @@ const handleUpdate = async (row: SensitiveWordVO) =&gt; { @@ -56,23 +56,29 @@ const handleUpdate = async (row: SensitiveWordVO) =&gt; {
56 56
57 // 提交按钮 57 // 提交按钮
58 const submitForm = async () => { 58 const submitForm = async () => {
59 - actionLoading.value = true  
60 - // 提交请求  
61 - try {  
62 - const data = unref(formRef)?.formModel as SensitiveWordVO  
63 - if (actionType.value === 'create') {  
64 - await SensitiveWordApi.createSensitiveWordApi(data)  
65 - ElMessage.success(t('common.createSuccess'))  
66 - } else {  
67 - await SensitiveWordApi.updateSensitiveWordApi(data)  
68 - ElMessage.success(t('common.updateSuccess')) 59 + const elForm = unref(formRef)?.getElFormRef()
  60 + if (!elForm) return
  61 + elForm.validate(async (valid) => {
  62 + if (valid) {
  63 + actionLoading.value = true
  64 + // 提交请求
  65 + try {
  66 + const data = unref(formRef)?.formModel as SensitiveWordVO
  67 + if (actionType.value === 'create') {
  68 + await SensitiveWordApi.createSensitiveWordApi(data)
  69 + ElMessage.success(t('common.createSuccess'))
  70 + } else {
  71 + await SensitiveWordApi.updateSensitiveWordApi(data)
  72 + ElMessage.success(t('common.updateSuccess'))
  73 + }
  74 + // 操作成功,重新加载列表
  75 + dialogVisible.value = false
  76 + await getList()
  77 + } finally {
  78 + actionLoading.value = false
  79 + }
69 } 80 }
70 - // 操作成功,重新加载列表  
71 - dialogVisible.value = false  
72 - await getList()  
73 - } finally {  
74 - actionLoading.value = false  
75 - } 81 + })
76 } 82 }
77 83
78 // ========== 详情相关 ========== 84 // ========== 详情相关 ==========
yudao-ui-admin-vue3/src/views/system/sms/smsChannel/index.vue
@@ -49,23 +49,29 @@ const handleUpdate = async (row: SmsChannelVO) =&gt; { @@ -49,23 +49,29 @@ const handleUpdate = async (row: SmsChannelVO) =&gt; {
49 49
50 // 提交按钮 50 // 提交按钮
51 const submitForm = async () => { 51 const submitForm = async () => {
52 - loading.value = true  
53 - // 提交请求  
54 - try {  
55 - const data = unref(formRef)?.formModel as SmsChannelVO  
56 - if (actionType.value === 'create') {  
57 - await SmsChannelApi.createSmsChannelApi(data)  
58 - ElMessage.success(t('common.createSuccess'))  
59 - } else {  
60 - await SmsChannelApi.updateSmsChannelApi(data)  
61 - ElMessage.success(t('common.updateSuccess')) 52 + const elForm = unref(formRef)?.getElFormRef()
  53 + if (!elForm) return
  54 + elForm.validate(async (valid) => {
  55 + if (valid) {
  56 + loading.value = true
  57 + // 提交请求
  58 + try {
  59 + const data = unref(formRef)?.formModel as SmsChannelVO
  60 + if (actionType.value === 'create') {
  61 + await SmsChannelApi.createSmsChannelApi(data)
  62 + ElMessage.success(t('common.createSuccess'))
  63 + } else {
  64 + await SmsChannelApi.updateSmsChannelApi(data)
  65 + ElMessage.success(t('common.updateSuccess'))
  66 + }
  67 + // 操作成功,重新加载列表
  68 + dialogVisible.value = false
  69 + await getList()
  70 + } finally {
  71 + loading.value = false
  72 + }
62 } 73 }
63 - // 操作成功,重新加载列表  
64 - dialogVisible.value = false  
65 - await getList()  
66 - } finally {  
67 - loading.value = false  
68 - } 74 + })
69 } 75 }
70 76
71 // ========== 详情相关 ========== 77 // ========== 详情相关 ==========
yudao-ui-admin-vue3/src/views/system/sms/smsTemplate/index.vue
@@ -49,23 +49,29 @@ const handleUpdate = async (row: SmsTemplateVO) =&gt; { @@ -49,23 +49,29 @@ const handleUpdate = async (row: SmsTemplateVO) =&gt; {
49 49
50 // 提交按钮 50 // 提交按钮
51 const submitForm = async () => { 51 const submitForm = async () => {
52 - loading.value = true  
53 - // 提交请求  
54 - try {  
55 - const data = unref(formRef)?.formModel as SmsTemplateVO  
56 - if (actionType.value === 'create') {  
57 - await SmsTemplateApi.createSmsTemplateApi(data)  
58 - ElMessage.success(t('common.createSuccess'))  
59 - } else {  
60 - await SmsTemplateApi.updateSmsTemplateApi(data)  
61 - ElMessage.success(t('common.updateSuccess')) 52 + const elForm = unref(formRef)?.getElFormRef()
  53 + if (!elForm) return
  54 + elForm.validate(async (valid) => {
  55 + if (valid) {
  56 + loading.value = true
  57 + // 提交请求
  58 + try {
  59 + const data = unref(formRef)?.formModel as SmsTemplateVO
  60 + if (actionType.value === 'create') {
  61 + await SmsTemplateApi.createSmsTemplateApi(data)
  62 + ElMessage.success(t('common.createSuccess'))
  63 + } else {
  64 + await SmsTemplateApi.updateSmsTemplateApi(data)
  65 + ElMessage.success(t('common.updateSuccess'))
  66 + }
  67 + // 操作成功,重新加载列表
  68 + dialogVisible.value = false
  69 + await getList()
  70 + } finally {
  71 + loading.value = false
  72 + }
62 } 73 }
63 - // 操作成功,重新加载列表  
64 - dialogVisible.value = false  
65 - await getList()  
66 - } finally {  
67 - loading.value = false  
68 - } 74 + })
69 } 75 }
70 76
71 // ========== 详情相关 ========== 77 // ========== 详情相关 ==========
yudao-ui-admin-vue3/src/views/system/tenant/index.vue
@@ -71,26 +71,32 @@ const handleUpdate = async (row: any) =&gt; { @@ -71,26 +71,32 @@ const handleUpdate = async (row: any) =&gt; {
71 71
72 // 提交按钮 72 // 提交按钮
73 const submitForm = async () => { 73 const submitForm = async () => {
74 - actionLoading.value = true  
75 - // 提交请求 unix()  
76 - try {  
77 - const data = unref(formRef)?.formModel as TenantVO  
78 - data.packageId = tenantPackageId.value  
79 - if (actionType.value === 'create') {  
80 - data.expireTime = dayjs(data.expireTime).valueOf().toString()  
81 - await TenantApi.createTenantApi(data)  
82 - ElMessage.success(t('common.createSuccess'))  
83 - } else {  
84 - data.expireTime = dayjs(data.expireTime).valueOf().toString()  
85 - await TenantApi.updateTenantApi(data)  
86 - ElMessage.success(t('common.updateSuccess')) 74 + const elForm = unref(formRef)?.getElFormRef()
  75 + if (!elForm) return
  76 + elForm.validate(async (valid) => {
  77 + if (valid) {
  78 + actionLoading.value = true
  79 + // 提交请求
  80 + try {
  81 + const data = unref(formRef)?.formModel as TenantVO
  82 + data.packageId = tenantPackageId.value
  83 + if (actionType.value === 'create') {
  84 + data.expireTime = dayjs(data.expireTime).valueOf().toString()
  85 + await TenantApi.createTenantApi(data)
  86 + ElMessage.success(t('common.createSuccess'))
  87 + } else {
  88 + data.expireTime = dayjs(data.expireTime).valueOf().toString()
  89 + await TenantApi.updateTenantApi(data)
  90 + ElMessage.success(t('common.updateSuccess'))
  91 + }
  92 + // 操作成功,重新加载列表
  93 + dialogVisible.value = false
  94 + await getList()
  95 + } finally {
  96 + actionLoading.value = false
  97 + }
87 } 98 }
88 - // 操作成功,重新加载列表  
89 - dialogVisible.value = false  
90 - await getList()  
91 - } finally {  
92 - actionLoading.value = false  
93 - } 99 + })
94 } 100 }
95 101
96 // ========== 详情相关 ========== 102 // ========== 详情相关 ==========
@@ -150,7 +156,6 @@ onMounted(async () =&gt; { @@ -150,7 +156,6 @@ onMounted(async () =&gt; {
150 <DictTag :type="DICT_TYPE.COMMON_STATUS" :value="row.status" /> 156 <DictTag :type="DICT_TYPE.COMMON_STATUS" :value="row.status" />
151 </template> 157 </template>
152 <template #packageId="{ row }"> 158 <template #packageId="{ row }">
153 - <!-- <DictTag :type="DICT_TYPE.SYSTEM_TENANT_PACKAGE_ID" :value="row.packageId" />-->  
154 <el-tag v-if="row.packageId === 0" type="danger">系统租户</el-tag> 159 <el-tag v-if="row.packageId === 0" type="danger">系统租户</el-tag>
155 <el-tag v-else type="success"> {{ getPackageName(row.packageId) }} </el-tag> 160 <el-tag v-else type="success"> {{ getPackageName(row.packageId) }} </el-tag>
156 </template> 161 </template>
@@ -161,7 +166,6 @@ onMounted(async () =&gt; { @@ -161,7 +166,6 @@ onMounted(async () =&gt; {
161 <span>{{ dayjs(row.createTime).format('YYYY-MM-DD HH:mm:ss') }}</span> 166 <span>{{ dayjs(row.createTime).format('YYYY-MM-DD HH:mm:ss') }}</span>
162 </template> 167 </template>
163 <template #action="{ row }"> 168 <template #action="{ row }">
164 - <!-- <el-button type="text" v-hasPermi="['system:tenant:update']" @click="handleUpdate(row)">-->  
165 <el-button 169 <el-button
166 link 170 link
167 type="primary" 171 type="primary"
@@ -199,7 +203,7 @@ onMounted(async () =&gt; { @@ -199,7 +203,7 @@ onMounted(async () =&gt; {
199 ref="formRef" 203 ref="formRef"
200 > 204 >
201 <template #packageId> 205 <template #packageId>
202 - <el-select v-model="tenantPackageId" placeholder="Select"> 206 + <el-select v-model="tenantPackageId">
203 <el-option 207 <el-option
204 v-for="item in tenantPackageOptions" 208 v-for="item in tenantPackageOptions"
205 :key="item.id" 209 :key="item.id"
yudao-ui-admin-vue3/src/views/system/tenant/tenant.data.ts
@@ -56,6 +56,29 @@ const crudSchemas = reactive&lt;CrudSchema[]&gt;([ @@ -56,6 +56,29 @@ const crudSchemas = reactive&lt;CrudSchema[]&gt;([
56 } 56 }
57 }, 57 },
58 { 58 {
  59 + label: '用户名称',
  60 + field: 'username',
  61 + table: {
  62 + show: false
  63 + },
  64 + detail: {
  65 + show: false
  66 + }
  67 + },
  68 + {
  69 + label: '用户密码',
  70 + field: 'password',
  71 + table: {
  72 + show: false
  73 + },
  74 + detail: {
  75 + show: false
  76 + },
  77 + form: {
  78 + component: 'InputPassword'
  79 + }
  80 + },
  81 + {
59 label: '账号额度', 82 label: '账号额度',
60 field: 'accountCount', 83 field: 'accountCount',
61 form: { 84 form: {
@@ -71,7 +94,7 @@ const crudSchemas = reactive&lt;CrudSchema[]&gt;([ @@ -71,7 +94,7 @@ const crudSchemas = reactive&lt;CrudSchema[]&gt;([
71 component: 'DatePicker', 94 component: 'DatePicker',
72 componentProps: { 95 componentProps: {
73 type: 'datetime', 96 type: 'datetime',
74 - valueFormat: 'YYYY-MM-DD HH:mm:ss' 97 + valueFormat: 'x'
75 } 98 }
76 } 99 }
77 }, 100 },
yudao-ui-admin-vue3/src/views/system/tenantPackage/index.vue
@@ -76,24 +76,30 @@ const handleUpdate = async (row: any) =&gt; { @@ -76,24 +76,30 @@ const handleUpdate = async (row: any) =&gt; {
76 } 76 }
77 // 提交按钮 77 // 提交按钮
78 const submitForm = async () => { 78 const submitForm = async () => {
79 - loading.value = true  
80 - // 提交请求  
81 - try {  
82 - const data = unref(formRef)?.formModel as TenantPackageVO  
83 - data.menuIds = treeRef.value!.getCheckedKeys(false) as string[]  
84 - if (actionType.value === 'create') {  
85 - await TenantPackageApi.createTenantPackageTypeApi(data)  
86 - ElMessage.success(t('common.createSuccess'))  
87 - } else {  
88 - await TenantPackageApi.updateTenantPackageTypeApi(data)  
89 - ElMessage.success(t('common.updateSuccess')) 79 + const elForm = unref(formRef)?.getElFormRef()
  80 + if (!elForm) return
  81 + elForm.validate(async (valid) => {
  82 + if (valid) {
  83 + loading.value = true
  84 + // 提交请求
  85 + try {
  86 + const data = unref(formRef)?.formModel as TenantPackageVO
  87 + data.menuIds = treeRef.value!.getCheckedKeys(false) as string[]
  88 + if (actionType.value === 'create') {
  89 + await TenantPackageApi.createTenantPackageTypeApi(data)
  90 + ElMessage.success(t('common.createSuccess'))
  91 + } else {
  92 + await TenantPackageApi.updateTenantPackageTypeApi(data)
  93 + ElMessage.success(t('common.updateSuccess'))
  94 + }
  95 + // 操作成功,重新加载列表
  96 + dialogVisible.value = false
  97 + await getList()
  98 + } finally {
  99 + loading.value = false
  100 + }
90 } 101 }
91 - // 操作成功,重新加载列表  
92 - dialogVisible.value = false  
93 - await getList()  
94 - } finally {  
95 - loading.value = false  
96 - } 102 + })
97 } 103 }
98 104
99 // ========== 初始化 ========== 105 // ========== 初始化 ==========
yudao-ui-admin-vue3/src/views/system/user/index.vue
@@ -112,9 +112,9 @@ const setDialogTile = async (type: string) =&gt; { @@ -112,9 +112,9 @@ const setDialogTile = async (type: string) =&gt; {
112 112
113 // 新增操作 113 // 新增操作
114 const handleAdd = () => { 114 const handleAdd = () => {
115 - setDialogTile('create')  
116 // 重置表单 115 // 重置表单
117 deptId.value = 0 116 deptId.value = 0
  117 + setDialogTile('create')
118 unref(formRef)?.getElFormRef()?.resetFields() 118 unref(formRef)?.getElFormRef()?.resetFields()
119 } 119 }
120 120
@@ -123,6 +123,7 @@ const handleUpdate = async (row: UserVO) =&gt; { @@ -123,6 +123,7 @@ const handleUpdate = async (row: UserVO) =&gt; {
123 await setDialogTile('update') 123 await setDialogTile('update')
124 // 设置数据 124 // 设置数据
125 const res = await UserApi.getUserApi(row.id) 125 const res = await UserApi.getUserApi(row.id)
  126 + console.info(res)
126 deptId.value = res.deptId 127 deptId.value = res.deptId
127 postIds.value = res.postIds 128 postIds.value = res.postIds
128 unref(formRef)?.setValues(res) 129 unref(formRef)?.setValues(res)
@@ -281,9 +282,9 @@ const excelUploadError = (): void =&gt; { @@ -281,9 +282,9 @@ const excelUploadError = (): void =&gt; {
281 } 282 }
282 // ========== 初始化 ========== 283 // ========== 初始化 ==========
283 onMounted(async () => { 284 onMounted(async () => {
284 - await getTree()  
285 await getPostOptions() 285 await getPostOptions()
286 await getList() 286 await getList()
  287 + await getTree()
287 }) 288 })
288 </script> 289 </script>
289 290
yudao-ui-admin-vue3/tsconfig.json
@@ -30,7 +30,7 @@ @@ -30,7 +30,7 @@
30 "@types/intro.js", 30 "@types/intro.js",
31 "@types/qrcode", 31 "@types/qrcode",
32 "vite-plugin-svg-icons/client", 32 "vite-plugin-svg-icons/client",
33 - "unplugin-vue-define-options" 33 + "unplugin-vue-macros/macros-global"
34 ], 34 ],
35 "typeRoots": ["./node_modules/@types/", "./types"] 35 "typeRoots": ["./node_modules/@types/", "./types"]
36 }, 36 },
yudao-ui-admin-vue3/types/componentType/configGlobal.d.ts deleted
1 -declare interface ConfigGlobalTypes {  
2 - size?: ElememtPlusSize  
3 -}  
yudao-ui-admin-vue3/types/global.d.ts
1 -declare interface Fn<T = any> {  
2 - (...arg: T[]): T  
3 -}  
4 -  
5 -declare type Nullable<T> = T | null 1 +import type { CSSProperties } from 'vue'
  2 +declare global {
  3 + declare interface Fn<T = any> {
  4 + (...arg: T[]): T
  5 + }
6 6
7 -declare type ElRef<T extends HTMLElement = HTMLDivElement> = Nullable<T> 7 + declare type Nullable<T> = T | null
8 8
9 -declare type ElememtPlusSize = 'default' | 'small' | 'large' 9 + declare type ElRef<T extends HTMLElement = HTMLDivElement> = Nullable<T>
10 10
11 -declare type ElementPlusInfoType = 'success' | 'info' | 'warning' | 'danger' 11 + declare type Recordable<T = any, K = string> = Record<K extends null | undefined ? string : K, T>
12 12
13 -declare type Recordable<T = any, K = string> = Record<K extends null | undefined ? string : K, T> 13 + declare type ComponentRef<T> = InstanceType<T>
14 14
15 -declare type ComponentRef<T> = InstanceType<T> 15 + declare type LocaleType = 'zh-CN' | 'en'
16 16
17 -declare type LocaleType = 'zh-CN' | 'en' 17 + declare type AxiosHeaders =
  18 + | 'application/json'
  19 + | 'application/x-www-form-urlencoded'
  20 + | 'multipart/form-data'
18 21
19 -declare type AxiosHeaders =  
20 - | 'application/json'  
21 - | 'application/x-www-form-urlencoded'  
22 - | 'multipart/form-data' 22 + declare type AxiosMethod = 'get' | 'post' | 'delete' | 'put' | 'GET' | 'POST' | 'DELETE' | 'PUT'
23 23
24 -declare type AxiosMethod = 'GET' | 'POST' | 'DELETE' | 'PUT' 24 + declare type AxiosResponseType = 'arraybuffer' | 'blob' | 'document' | 'json' | 'text' | 'stream'
25 25
26 -declare type AxiosResponseType = 'arraybuffer' | 'blob' | 'document' | 'json' | 'text' | 'stream'  
27 -  
28 -declare interface AxiosConfig {  
29 - params?: any  
30 - data?: any  
31 - url?: string  
32 - method?: AxiosMethod  
33 - headersType?: string  
34 - responseType?: AxiosResponseType  
35 -} 26 + declare interface AxiosConfig {
  27 + params?: any
  28 + data?: any
  29 + url?: string
  30 + method?: AxiosMethod
  31 + headersType?: string
  32 + responseType?: AxiosResponseType
  33 + }
36 34
37 -declare interface IResponse<T = any> {  
38 - code?: number  
39 - data: T extends any ? T : T & any 35 + declare interface IResponse<T = any> {
  36 + code: string
  37 + data: T extends any ? T : T & any
  38 + }
40 } 39 }
yudao-ui-admin-vue3/vite.config.ts
@@ -9,9 +9,9 @@ import VueI18n from &#39;@intlify/vite-plugin-vue-i18n&#39; @@ -9,9 +9,9 @@ import VueI18n from &#39;@intlify/vite-plugin-vue-i18n&#39;
9 import { createStyleImportPlugin, ElementPlusResolve } from 'vite-plugin-style-import' 9 import { createStyleImportPlugin, ElementPlusResolve } from 'vite-plugin-style-import'
10 import { createSvgIconsPlugin } from 'vite-plugin-svg-icons' 10 import { createSvgIconsPlugin } from 'vite-plugin-svg-icons'
11 import PurgeIcons from 'vite-plugin-purge-icons' 11 import PurgeIcons from 'vite-plugin-purge-icons'
12 -import DefineOptions from 'unplugin-vue-define-options/vite'  
13 import { createHtmlPlugin } from 'vite-plugin-html' 12 import { createHtmlPlugin } from 'vite-plugin-html'
14 import viteCompression from 'vite-plugin-compression' 13 import viteCompression from 'vite-plugin-compression'
  14 +import VueMarcos from 'unplugin-vue-macros/vite'
15 15
16 // 当前执行node命令时文件夹的地址(工作目录) 16 // 当前执行node命令时文件夹的地址(工作目录)
17 const root = process.cwd() 17 const root = process.cwd()
@@ -80,7 +80,7 @@ export default ({ command, mode }: ConfigEnv): UserConfig =&gt; { @@ -80,7 +80,7 @@ export default ({ command, mode }: ConfigEnv): UserConfig =&gt; {
80 svgoOptions: true 80 svgoOptions: true
81 }), 81 }),
82 PurgeIcons(), 82 PurgeIcons(),
83 - DefineOptions(), 83 + VueMarcos(),
84 viteCompression({ 84 viteCompression({
85 verbose: true, // 是否在控制台输出压缩结果 85 verbose: true, // 是否在控制台输出压缩结果
86 disable: true, // 是否禁用 86 disable: true, // 是否禁用