mirror of
https://gitee.com/y_project/RuoYi-Cloud.git
synced 2026-04-27 01:37:53 +08:00
Compare commits
181 Commits
a57fbeb1a3
...
springboot
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
8c49d541ba | ||
|
|
91185005ce | ||
|
|
8dd8bc784a | ||
|
|
bcdb182129 | ||
|
|
2bffc42d19 | ||
|
|
a1e7704286 | ||
|
|
ad242d9327 | ||
|
|
19748abe4b | ||
|
|
cb7f4b2877 | ||
|
|
c9e3c072d2 | ||
|
|
314a36bcfd | ||
|
|
fba922ccb7 | ||
|
|
566cbc8c5d | ||
|
|
3b0982515e | ||
|
|
d9a6263626 | ||
|
|
b2685bf8e8 | ||
|
|
b0b4d2e446 | ||
|
|
af768553bb | ||
|
|
74bd4562bd | ||
|
|
219848fdb7 | ||
|
|
b232e394c6 | ||
|
|
9df5446d5f | ||
|
|
997dc3968e | ||
|
|
751844f441 | ||
|
|
74207e2593 | ||
|
|
943be56511 | ||
|
|
e30ecdbf2d | ||
|
|
4c952fbe36 | ||
|
|
00ac3e3df6 | ||
|
|
1eaf3a6ec7 | ||
|
|
59392c7b35 | ||
|
|
29d4ea24e0 | ||
|
|
ca80568837 | ||
|
|
254e7522db | ||
|
|
466f0f559d | ||
|
|
970f718351 | ||
|
|
97759ec0ed | ||
|
|
114e806326 | ||
|
|
09e7ccdc61 | ||
|
|
7a829c44cb | ||
|
|
2844201b6f | ||
|
|
18079f70d0 | ||
|
|
1a3f3ebaea | ||
|
|
8c122a9609 | ||
|
|
de1dbe61a5 | ||
|
|
156471d638 | ||
|
|
661e8cf7b4 | ||
|
|
28be96930c | ||
|
|
6c6a2c0623 | ||
|
|
7d821ed043 | ||
|
|
5d54693b27 | ||
|
|
cfd619fa4f | ||
|
|
e942847b89 | ||
|
|
0b09d7c1da | ||
|
|
1c0562ba18 | ||
|
|
da65996e69 | ||
|
|
873444dd0b | ||
|
|
2301280c4d | ||
|
|
4eebb27956 | ||
|
|
c2ff461ff0 | ||
|
|
eb489bda83 | ||
|
|
1db2086163 | ||
|
|
839e4f35f5 | ||
|
|
f53b783049 | ||
|
|
97f30a5415 | ||
|
|
ad1d009165 | ||
|
|
90cbabb7a7 | ||
|
|
1c4dbb1e46 | ||
|
|
a3eefb6bad | ||
|
|
09e8e9995a | ||
|
|
381151bc50 | ||
|
|
66e502727a | ||
|
|
4265f8ecb7 | ||
|
|
2c82079d04 | ||
|
|
6aecd35a4f | ||
|
|
ac92ae3ae6 | ||
|
|
1d2c8378f7 | ||
|
|
50a9337ee8 | ||
|
|
e6a3415a71 | ||
|
|
7919af54da | ||
|
|
3503005f9d | ||
|
|
b304a41194 | ||
|
|
a39ae33c82 | ||
|
|
b9a27657c5 | ||
|
|
2e009841ca | ||
|
|
2cbe4a8234 | ||
|
|
4b37049713 | ||
|
|
e549210ad6 | ||
|
|
ad988d54bb | ||
|
|
51a6fce0a5 | ||
|
|
c86bfa9243 | ||
|
|
8aca11c2a2 | ||
|
|
725033e361 | ||
|
|
d29e49e23b | ||
|
|
706c3bb69b | ||
|
|
cd0ee95b9c | ||
|
|
3293e2fb56 | ||
|
|
924ec0eb6e | ||
|
|
135b1204a9 | ||
|
|
cb566a704b | ||
|
|
aadba0382e | ||
|
|
a0ce1cf33b | ||
|
|
3915c77391 | ||
|
|
b80932ceb4 | ||
|
|
056cf94082 | ||
|
|
0dcd3e6183 | ||
|
|
07be5ceb26 | ||
|
|
cc59502d7c | ||
|
|
98738f23ad | ||
|
|
57fe1c663e | ||
|
|
7b6fdb3a89 | ||
|
|
79c885decb | ||
|
|
1a0f37a2dc | ||
|
|
02de344d8c | ||
|
|
189100f74e | ||
|
|
e29284e687 | ||
|
|
d4af286f41 | ||
|
|
60e2d55a23 | ||
|
|
bbd112d5a3 | ||
|
|
90922844ea | ||
|
|
3a9f56f04b | ||
|
|
a1ec1d57d4 | ||
|
|
060959a7c5 | ||
|
|
43e1d8d573 | ||
|
|
67cf51ba77 | ||
|
|
a256618d5d | ||
|
|
a6bcebb62b | ||
|
|
1cb262daa3 | ||
|
|
8c096cba8d | ||
|
|
088cec8adf | ||
|
|
85ff6a9910 | ||
|
|
cab5beaca7 | ||
|
|
fc8069a250 | ||
|
|
924e705dca | ||
|
|
049ba453d1 | ||
|
|
4aa261e8f7 | ||
|
|
914a6620f5 | ||
|
|
3dcee7057d | ||
|
|
0467631319 | ||
|
|
a11df90255 | ||
|
|
596e4fe756 | ||
|
|
37219e4ae6 | ||
|
|
adaa3e1db8 | ||
|
|
88ad5a2c19 | ||
|
|
b45dc2ec25 | ||
|
|
67b17da06f | ||
|
|
b25a280ebb | ||
|
|
cc026e75a3 | ||
|
|
7216b56a56 | ||
|
|
a326e880a1 | ||
|
|
92c6d21855 | ||
|
|
2335157f6e | ||
|
|
6c3b01c3c5 | ||
|
|
8faea60191 | ||
|
|
28a16d9878 | ||
|
|
dd3cf18e27 | ||
|
|
65d03dc014 | ||
|
|
7912fd81bd | ||
|
|
e2175e5b9d | ||
|
|
c0e119f8e0 | ||
|
|
fa77b2a08c | ||
|
|
a222c24796 | ||
|
|
08f4b877ce | ||
|
|
aa607d135c | ||
|
|
6d34cdb8a3 | ||
|
|
d47352253e | ||
|
|
61cbd470e1 | ||
|
|
b3ef4adfed | ||
|
|
856c471472 | ||
|
|
bec5600f16 | ||
|
|
5b485e7934 | ||
|
|
73a752d3ab | ||
|
|
1899a832b9 | ||
|
|
e6796c0954 | ||
|
|
4987289a98 | ||
|
|
18409922a5 | ||
|
|
3dca02b306 | ||
|
|
75f3275e15 | ||
|
|
b2e4a7046b | ||
|
|
60618c1da9 | ||
|
|
3b499b1344 |
10
README.md
10
README.md
@@ -13,8 +13,8 @@
|
|||||||
|
|
||||||
若依是一套全部开源的快速开发平台,毫无保留给个人及企业免费使用。
|
若依是一套全部开源的快速开发平台,毫无保留给个人及企业免费使用。
|
||||||
|
|
||||||
* 本仓库为RuoYi-Cloud的Spring Boot 3 的版本,保持同步更新。
|
* 本仓库为RuoYi-Cloud的Spring Boot 2 的版本,保持同步更新。
|
||||||
* 后端采用Spring Boot3、Spring Cloud & Alibaba。
|
* 后端采用Spring Boot2、Spring Cloud & Alibaba。
|
||||||
* 注册中心、配置中心选型Nacos,权限认证使用Redis。
|
* 注册中心、配置中心选型Nacos,权限认证使用Redis。
|
||||||
* 流量控制框架选型Sentinel,分布式事务选型Seata。
|
* 流量控制框架选型Sentinel,分布式事务选型Seata。
|
||||||
* 阿里云优惠券:[点我进入](http://aly.ruoyi.vip),腾讯云优惠券:[点我进入](http://txy.ruoyi.vip)
|
* 阿里云优惠券:[点我进入](http://aly.ruoyi.vip),腾讯云优惠券:[点我进入](http://txy.ruoyi.vip)
|
||||||
@@ -23,11 +23,11 @@
|
|||||||
|
|
||||||
RuoYi-Cloud 后端项目提供 Spring Boot 2.x / 3.x / 4.x 多版本分支的并行维护。
|
RuoYi-Cloud 后端项目提供 Spring Boot 2.x / 3.x / 4.x 多版本分支的并行维护。
|
||||||
|
|
||||||
| 名称 | 说明 | 地址 |
|
| 名称 | 说明 | 地址 |
|
||||||
| :---------------- | :------------------------ | :-------------------------------------------------------- |
|
| :---------------- | :----------------------------------- | :-------------------------------------------------------- |
|
||||||
| master 默认分支 | Spring Boot 4.x (JDK 17+、Nacos 3.x) | https://gitee.com/y_project/RuoYi-Cloud |
|
| master 默认分支 | Spring Boot 4.x (JDK 17+、Nacos 3.x) | https://gitee.com/y_project/RuoYi-Cloud |
|
||||||
| springboot3 分支 | Spring Boot 3.x (JDK 17+、Nacos 3.x) | https://gitee.com/y_project/RuoYi-Cloud/tree/springboot3 |
|
| springboot3 分支 | Spring Boot 3.x (JDK 17+、Nacos 3.x) | https://gitee.com/y_project/RuoYi-Cloud/tree/springboot3 |
|
||||||
| springboot2 分支 | Spring Boot 2.x (JDK 8+、Nacos 2.x) | https://gitee.com/y_project/RuoYi-Cloud/tree/springboot2 |
|
| springboot2 分支 | Spring Boot 2.x (JDK 8+、 Nacos 2.x) | https://gitee.com/y_project/RuoYi-Cloud/tree/springboot2 |
|
||||||
|
|
||||||
RuoYi-Cloud 前端项目提供 Vue 2.x / 3.x / JavaScript TypeScript 版本均可混用搭配
|
RuoYi-Cloud 前端项目提供 Vue 2.x / 3.x / JavaScript TypeScript 版本均可混用搭配
|
||||||
|
|
||||||
|
|||||||
@@ -9,7 +9,7 @@ usage() {
|
|||||||
|
|
||||||
# copy sql
|
# copy sql
|
||||||
echo "begin copy sql "
|
echo "begin copy sql "
|
||||||
cp ../sql/ry_20260321.sql ./mysql/db
|
cp ../sql/ry_20260402.sql ./mysql/db
|
||||||
cp ../sql/ry_config_20260311.sql ./mysql/db
|
cp ../sql/ry_config_20260311.sql ./mysql/db
|
||||||
|
|
||||||
# copy html
|
# copy html
|
||||||
|
|||||||
@@ -2,14 +2,11 @@ version : '3.8'
|
|||||||
services:
|
services:
|
||||||
ruoyi-nacos:
|
ruoyi-nacos:
|
||||||
container_name: ruoyi-nacos
|
container_name: ruoyi-nacos
|
||||||
image: nacos/nacos-server:v3.0.2
|
image: nacos/nacos-server:v2.4.2
|
||||||
build:
|
build:
|
||||||
context: ./nacos
|
context: ./nacos
|
||||||
environment:
|
environment:
|
||||||
- MODE=standalone
|
- MODE=standalone
|
||||||
- NACOS_AUTH_TOKEN=your_auth_token
|
|
||||||
- NACOS_AUTH_IDENTITY_KEY=your_identity_key
|
|
||||||
- NACOS_AUTH_IDENTITY_VALUE=your_identity_value
|
|
||||||
volumes:
|
volumes:
|
||||||
- ./nacos/logs/:/home/nacos/logs
|
- ./nacos/logs/:/home/nacos/logs
|
||||||
- ./nacos/conf/application.properties:/home/nacos/conf/application.properties
|
- ./nacos/conf/application.properties:/home/nacos/conf/application.properties
|
||||||
|
|||||||
@@ -24,7 +24,6 @@ nacos.core.auth.system.type=nacos
|
|||||||
nacos.core.auth.enabled=false
|
nacos.core.auth.enabled=false
|
||||||
nacos.core.auth.default.token.expire.seconds=18000
|
nacos.core.auth.default.token.expire.seconds=18000
|
||||||
nacos.core.auth.default.token.secret.key=SecretKey012345678901234567890123456789012345678901234567890123456789
|
nacos.core.auth.default.token.secret.key=SecretKey012345678901234567890123456789012345678901234567890123456789
|
||||||
nacos.core.auth.plugin.nacos.token.secret.key=SecretKey012345678901234567890123456789012345678901234567890123456789
|
|
||||||
nacos.core.auth.caching.enabled=true
|
nacos.core.auth.caching.enabled=true
|
||||||
nacos.core.auth.enable.userAgentAuthWhite=false
|
nacos.core.auth.enable.userAgentAuthWhite=false
|
||||||
nacos.core.auth.server.identity.key=serverIdentity
|
nacos.core.auth.server.identity.key=serverIdentity
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
# 基础镜像
|
# 基础镜像
|
||||||
FROM nacos/nacos-server:v3.0.2
|
FROM nacos/nacos-server:v2.4.2
|
||||||
# author
|
# author
|
||||||
MAINTAINER ruoyi
|
MAINTAINER ruoyi
|
||||||
|
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
# 基础镜像
|
# 基础镜像
|
||||||
FROM openjdk:17
|
FROM openjdk:8-jre
|
||||||
# author
|
# author
|
||||||
MAINTAINER ruoyi
|
MAINTAINER ruoyi
|
||||||
|
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
# 基础镜像
|
# 基础镜像
|
||||||
FROM openjdk:17
|
FROM openjdk:8-jre
|
||||||
# author
|
# author
|
||||||
MAINTAINER ruoyi
|
MAINTAINER ruoyi
|
||||||
|
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
# 基础镜像
|
# 基础镜像
|
||||||
FROM openjdk:17
|
FROM openjdk:8-jre
|
||||||
# author
|
# author
|
||||||
MAINTAINER ruoyi
|
MAINTAINER ruoyi
|
||||||
|
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
# 基础镜像
|
# 基础镜像
|
||||||
FROM openjdk:17
|
FROM openjdk:8-jre
|
||||||
# author
|
# author
|
||||||
MAINTAINER ruoyi
|
MAINTAINER ruoyi
|
||||||
|
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
# 基础镜像
|
# 基础镜像
|
||||||
FROM openjdk:17
|
FROM openjdk:8-jre
|
||||||
# author
|
# author
|
||||||
MAINTAINER ruoyi
|
MAINTAINER ruoyi
|
||||||
|
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
# 基础镜像
|
# 基础镜像
|
||||||
FROM openjdk:17
|
FROM openjdk:8-jre
|
||||||
# author
|
# author
|
||||||
MAINTAINER ruoyi
|
MAINTAINER ruoyi
|
||||||
|
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
# 基础镜像
|
# 基础镜像
|
||||||
FROM openjdk:17
|
FROM openjdk:8-jre
|
||||||
# author
|
# author
|
||||||
MAINTAINER ruoyi
|
MAINTAINER ruoyi
|
||||||
|
|
||||||
|
|||||||
88
pom.xml
88
pom.xml
@@ -16,30 +16,43 @@
|
|||||||
<ruoyi.version>3.6.8</ruoyi.version>
|
<ruoyi.version>3.6.8</ruoyi.version>
|
||||||
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
|
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
|
||||||
<project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding>
|
<project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding>
|
||||||
<java.version>17</java.version>
|
<java.version>1.8</java.version>
|
||||||
<spring-boot.version>3.5.11</spring-boot.version>
|
<spring-boot.version>2.7.18</spring-boot.version>
|
||||||
<spring-cloud.version>2025.0.1</spring-cloud.version>
|
<spring-cloud.version>2021.0.9</spring-cloud.version>
|
||||||
<spring-cloud-alibaba.version>2025.0.0.0</spring-cloud-alibaba.version>
|
<spring-cloud-alibaba.version>2021.0.6.1</spring-cloud-alibaba.version>
|
||||||
<spring-boot-admin.version>3.5.8</spring-boot-admin.version>
|
<spring-boot-admin.version>2.7.16</spring-boot-admin.version>
|
||||||
<mybatis-spring.version>3.0.5</mybatis-spring.version>
|
<tobato.version>1.27.2</tobato.version>
|
||||||
<kaptcha.version>2.3.3</kaptcha.version>
|
<kaptcha.version>2.3.3</kaptcha.version>
|
||||||
<pagehelper.boot.version>2.1.0</pagehelper.boot.version>
|
<pagehelper.boot.version>2.0.0</pagehelper.boot.version>
|
||||||
<druid.version>1.2.27</druid.version>
|
<druid.version>1.2.27</druid.version>
|
||||||
<dynamic-ds.version>4.5.0</dynamic-ds.version>
|
<dynamic-ds.version>4.3.1</dynamic-ds.version>
|
||||||
<commons.io.version>2.21.0</commons.io.version>
|
<commons.io.version>2.21.0</commons.io.version>
|
||||||
<velocity.version>2.3</velocity.version>
|
<velocity.version>2.3</velocity.version>
|
||||||
<fastjson.version>2.0.61</fastjson.version>
|
<fastjson.version>2.0.61</fastjson.version>
|
||||||
<jjwt.version>0.9.1</jjwt.version>
|
<jjwt.version>0.9.1</jjwt.version>
|
||||||
<minio.version>8.2.2</minio.version>
|
<minio.version>8.2.2</minio.version>
|
||||||
<poi.version>4.1.2</poi.version>
|
<poi.version>4.1.2</poi.version>
|
||||||
<springdoc.version>2.8.16</springdoc.version>
|
<springdoc.version>1.6.9</springdoc.version>
|
||||||
<transmittable-thread-local.version>2.14.5</transmittable-thread-local.version>
|
<transmittable-thread-local.version>2.14.4</transmittable-thread-local.version>
|
||||||
|
<!-- override dependency version -->
|
||||||
|
<tomcat.version>9.0.112</tomcat.version>
|
||||||
|
<logback.version>1.2.13</logback.version>
|
||||||
|
<spring-framework.version>5.3.39</spring-framework.version>
|
||||||
</properties>
|
</properties>
|
||||||
|
|
||||||
<!-- 依赖声明 -->
|
<!-- 依赖声明 -->
|
||||||
<dependencyManagement>
|
<dependencyManagement>
|
||||||
<dependencies>
|
<dependencies>
|
||||||
|
|
||||||
|
<!-- 覆盖SpringFramework的依赖配置-->
|
||||||
|
<dependency>
|
||||||
|
<groupId>org.springframework</groupId>
|
||||||
|
<artifactId>spring-framework-bom</artifactId>
|
||||||
|
<version>${spring-framework.version}</version>
|
||||||
|
<type>pom</type>
|
||||||
|
<scope>import</scope>
|
||||||
|
</dependency>
|
||||||
|
|
||||||
<!-- SpringCloud 微服务 -->
|
<!-- SpringCloud 微服务 -->
|
||||||
<dependency>
|
<dependency>
|
||||||
<groupId>org.springframework.cloud</groupId>
|
<groupId>org.springframework.cloud</groupId>
|
||||||
@@ -67,10 +80,49 @@
|
|||||||
<scope>import</scope>
|
<scope>import</scope>
|
||||||
</dependency>
|
</dependency>
|
||||||
|
|
||||||
|
<!-- 覆盖logback的依赖配置-->
|
||||||
|
<dependency>
|
||||||
|
<groupId>ch.qos.logback</groupId>
|
||||||
|
<artifactId>logback-core</artifactId>
|
||||||
|
<version>${logback.version}</version>
|
||||||
|
</dependency>
|
||||||
|
|
||||||
|
<dependency>
|
||||||
|
<groupId>ch.qos.logback</groupId>
|
||||||
|
<artifactId>logback-classic</artifactId>
|
||||||
|
<version>${logback.version}</version>
|
||||||
|
</dependency>
|
||||||
|
|
||||||
|
<!-- 覆盖tomcat的依赖配置-->
|
||||||
|
<dependency>
|
||||||
|
<groupId>org.apache.tomcat.embed</groupId>
|
||||||
|
<artifactId>tomcat-embed-core</artifactId>
|
||||||
|
<version>${tomcat.version}</version>
|
||||||
|
</dependency>
|
||||||
|
|
||||||
|
<dependency>
|
||||||
|
<groupId>org.apache.tomcat.embed</groupId>
|
||||||
|
<artifactId>tomcat-embed-el</artifactId>
|
||||||
|
<version>${tomcat.version}</version>
|
||||||
|
</dependency>
|
||||||
|
|
||||||
|
<dependency>
|
||||||
|
<groupId>org.apache.tomcat.embed</groupId>
|
||||||
|
<artifactId>tomcat-embed-websocket</artifactId>
|
||||||
|
<version>${tomcat.version}</version>
|
||||||
|
</dependency>
|
||||||
|
|
||||||
|
<!-- FastDFS 分布式文件系统 -->
|
||||||
|
<dependency>
|
||||||
|
<groupId>com.github.tobato</groupId>
|
||||||
|
<artifactId>fastdfs-client</artifactId>
|
||||||
|
<version>${tobato.version}</version>
|
||||||
|
</dependency>
|
||||||
|
|
||||||
<!-- Springdoc webmvc 依赖配置 -->
|
<!-- Springdoc webmvc 依赖配置 -->
|
||||||
<dependency>
|
<dependency>
|
||||||
<groupId>org.springdoc</groupId>
|
<groupId>org.springdoc</groupId>
|
||||||
<artifactId>springdoc-openapi-starter-webmvc-ui</artifactId>
|
<artifactId>springdoc-openapi-ui</artifactId>
|
||||||
<version>${springdoc.version}</version>
|
<version>${springdoc.version}</version>
|
||||||
</dependency>
|
</dependency>
|
||||||
|
|
||||||
@@ -86,18 +138,6 @@
|
|||||||
<groupId>com.github.pagehelper</groupId>
|
<groupId>com.github.pagehelper</groupId>
|
||||||
<artifactId>pagehelper-spring-boot-starter</artifactId>
|
<artifactId>pagehelper-spring-boot-starter</artifactId>
|
||||||
<version>${pagehelper.boot.version}</version>
|
<version>${pagehelper.boot.version}</version>
|
||||||
<exclusions>
|
|
||||||
<exclusion>
|
|
||||||
<artifactId>mybatis-spring</artifactId>
|
|
||||||
<groupId>org.mybatis</groupId>
|
|
||||||
</exclusion>
|
|
||||||
</exclusions>
|
|
||||||
</dependency>
|
|
||||||
|
|
||||||
<dependency>
|
|
||||||
<groupId>org.mybatis</groupId>
|
|
||||||
<artifactId>mybatis-spring</artifactId>
|
|
||||||
<version>${mybatis-spring.version}</version>
|
|
||||||
</dependency>
|
</dependency>
|
||||||
|
|
||||||
<!-- io常用工具类 -->
|
<!-- io常用工具类 -->
|
||||||
@@ -238,9 +278,7 @@
|
|||||||
<plugin>
|
<plugin>
|
||||||
<groupId>org.apache.maven.plugins</groupId>
|
<groupId>org.apache.maven.plugins</groupId>
|
||||||
<artifactId>maven-compiler-plugin</artifactId>
|
<artifactId>maven-compiler-plugin</artifactId>
|
||||||
<version>3.11.0</version>
|
|
||||||
<configuration>
|
<configuration>
|
||||||
<parameters>true</parameters>
|
|
||||||
<source>${java.version}</source>
|
<source>${java.version}</source>
|
||||||
<target>${java.version}</target>
|
<target>${java.version}</target>
|
||||||
<encoding>${project.build.sourceEncoding}</encoding>
|
<encoding>${project.build.sourceEncoding}</encoding>
|
||||||
|
|||||||
@@ -2,10 +2,10 @@ package com.ruoyi.system.api.domain;
|
|||||||
|
|
||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
import jakarta.validation.constraints.Email;
|
import javax.validation.constraints.Email;
|
||||||
import jakarta.validation.constraints.NotBlank;
|
import javax.validation.constraints.NotBlank;
|
||||||
import jakarta.validation.constraints.NotNull;
|
import javax.validation.constraints.NotNull;
|
||||||
import jakarta.validation.constraints.Size;
|
import javax.validation.constraints.Size;
|
||||||
import org.apache.commons.lang3.builder.ToStringBuilder;
|
import org.apache.commons.lang3.builder.ToStringBuilder;
|
||||||
import org.apache.commons.lang3.builder.ToStringStyle;
|
import org.apache.commons.lang3.builder.ToStringStyle;
|
||||||
import com.ruoyi.common.core.web.domain.BaseEntity;
|
import com.ruoyi.common.core.web.domain.BaseEntity;
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
package com.ruoyi.system.api.domain;
|
package com.ruoyi.system.api.domain;
|
||||||
|
|
||||||
import jakarta.validation.constraints.NotBlank;
|
import javax.validation.constraints.NotBlank;
|
||||||
import jakarta.validation.constraints.Size;
|
import javax.validation.constraints.Size;
|
||||||
import org.apache.commons.lang3.builder.ToStringBuilder;
|
import org.apache.commons.lang3.builder.ToStringBuilder;
|
||||||
import org.apache.commons.lang3.builder.ToStringStyle;
|
import org.apache.commons.lang3.builder.ToStringStyle;
|
||||||
import com.ruoyi.common.core.annotation.Excel;
|
import com.ruoyi.common.core.annotation.Excel;
|
||||||
|
|||||||
@@ -1,8 +1,8 @@
|
|||||||
package com.ruoyi.system.api.domain;
|
package com.ruoyi.system.api.domain;
|
||||||
|
|
||||||
import jakarta.validation.constraints.NotBlank;
|
import javax.validation.constraints.NotBlank;
|
||||||
import jakarta.validation.constraints.Pattern;
|
import javax.validation.constraints.Pattern;
|
||||||
import jakarta.validation.constraints.Size;
|
import javax.validation.constraints.Size;
|
||||||
import org.apache.commons.lang3.builder.ToStringBuilder;
|
import org.apache.commons.lang3.builder.ToStringBuilder;
|
||||||
import org.apache.commons.lang3.builder.ToStringStyle;
|
import org.apache.commons.lang3.builder.ToStringStyle;
|
||||||
import com.ruoyi.common.core.annotation.Excel;
|
import com.ruoyi.common.core.annotation.Excel;
|
||||||
|
|||||||
@@ -1,9 +1,9 @@
|
|||||||
package com.ruoyi.system.api.domain;
|
package com.ruoyi.system.api.domain;
|
||||||
|
|
||||||
import java.util.Set;
|
import java.util.Set;
|
||||||
import jakarta.validation.constraints.NotBlank;
|
import javax.validation.constraints.NotBlank;
|
||||||
import jakarta.validation.constraints.NotNull;
|
import javax.validation.constraints.NotNull;
|
||||||
import jakarta.validation.constraints.Size;
|
import javax.validation.constraints.Size;
|
||||||
import org.apache.commons.lang3.builder.ToStringBuilder;
|
import org.apache.commons.lang3.builder.ToStringBuilder;
|
||||||
import org.apache.commons.lang3.builder.ToStringStyle;
|
import org.apache.commons.lang3.builder.ToStringStyle;
|
||||||
import com.ruoyi.common.core.annotation.Excel;
|
import com.ruoyi.common.core.annotation.Excel;
|
||||||
|
|||||||
@@ -2,7 +2,8 @@ package com.ruoyi.system.api.domain;
|
|||||||
|
|
||||||
import java.util.Date;
|
import java.util.Date;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
import jakarta.validation.constraints.*;
|
import javax.validation.constraints.*;
|
||||||
|
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||||
import org.apache.commons.lang3.builder.ToStringBuilder;
|
import org.apache.commons.lang3.builder.ToStringBuilder;
|
||||||
import org.apache.commons.lang3.builder.ToStringStyle;
|
import org.apache.commons.lang3.builder.ToStringStyle;
|
||||||
import com.ruoyi.common.core.annotation.Excel;
|
import com.ruoyi.common.core.annotation.Excel;
|
||||||
@@ -68,6 +69,7 @@ public class SysUser extends BaseEntity
|
|||||||
private String loginIp;
|
private String loginIp;
|
||||||
|
|
||||||
/** 最后登录时间 */
|
/** 最后登录时间 */
|
||||||
|
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
|
||||||
@Excel(name = "最后登录时间", width = 30, dateFormat = "yyyy-MM-dd HH:mm:ss", type = Type.EXPORT)
|
@Excel(name = "最后登录时间", width = 30, dateFormat = "yyyy-MM-dd HH:mm:ss", type = Type.EXPORT)
|
||||||
private Date loginDate;
|
private Date loginDate;
|
||||||
|
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
package com.ruoyi.auth.controller;
|
package com.ruoyi.auth.controller;
|
||||||
|
|
||||||
import jakarta.servlet.http.HttpServletRequest;
|
import javax.servlet.http.HttpServletRequest;
|
||||||
import org.springframework.beans.factory.annotation.Autowired;
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
import org.springframework.web.bind.annotation.DeleteMapping;
|
import org.springframework.web.bind.annotation.DeleteMapping;
|
||||||
import org.springframework.web.bind.annotation.PostMapping;
|
import org.springframework.web.bind.annotation.PostMapping;
|
||||||
|
|||||||
@@ -18,9 +18,8 @@ spring:
|
|||||||
config:
|
config:
|
||||||
# 配置中心地址
|
# 配置中心地址
|
||||||
server-addr: 127.0.0.1:8848
|
server-addr: 127.0.0.1:8848
|
||||||
config:
|
# 配置文件格式
|
||||||
# 配置文件格式
|
file-extension: yml
|
||||||
file-extension: yml
|
# 共享配置
|
||||||
import:
|
shared-configs:
|
||||||
- nacos:application-${spring.profiles.active}.${spring.config.file-extension}
|
- application-${spring.profiles.active}.${spring.cloud.nacos.config.file-extension}
|
||||||
- nacos:${spring.application.name}-${spring.profiles.active}.${spring.config.file-extension}
|
|
||||||
|
|||||||
@@ -53,24 +53,12 @@
|
|||||||
<artifactId>pagehelper-spring-boot-starter</artifactId>
|
<artifactId>pagehelper-spring-boot-starter</artifactId>
|
||||||
</dependency>
|
</dependency>
|
||||||
|
|
||||||
<!-- Mybatis Spring -->
|
|
||||||
<dependency>
|
|
||||||
<groupId>org.mybatis</groupId>
|
|
||||||
<artifactId>mybatis-spring</artifactId>
|
|
||||||
</dependency>
|
|
||||||
|
|
||||||
<!-- Hibernate Validator -->
|
<!-- Hibernate Validator -->
|
||||||
<dependency>
|
<dependency>
|
||||||
<groupId>org.springframework.boot</groupId>
|
<groupId>org.springframework.boot</groupId>
|
||||||
<artifactId>spring-boot-starter-validation</artifactId>
|
<artifactId>spring-boot-starter-validation</artifactId>
|
||||||
</dependency>
|
</dependency>
|
||||||
|
|
||||||
<!-- Spring Aop -->
|
|
||||||
<dependency>
|
|
||||||
<groupId>org.springframework.boot</groupId>
|
|
||||||
<artifactId>spring-boot-starter-aop</artifactId>
|
|
||||||
</dependency>
|
|
||||||
|
|
||||||
<!-- Jackson -->
|
<!-- Jackson -->
|
||||||
<dependency>
|
<dependency>
|
||||||
<groupId>com.fasterxml.jackson.core</groupId>
|
<groupId>com.fasterxml.jackson.core</groupId>
|
||||||
@@ -93,7 +81,6 @@
|
|||||||
<dependency>
|
<dependency>
|
||||||
<groupId>javax.xml.bind</groupId>
|
<groupId>javax.xml.bind</groupId>
|
||||||
<artifactId>jaxb-api</artifactId>
|
<artifactId>jaxb-api</artifactId>
|
||||||
<version>2.3.1</version>
|
|
||||||
</dependency>
|
</dependency>
|
||||||
|
|
||||||
<!-- Apache Lang3 -->
|
<!-- Apache Lang3 -->
|
||||||
@@ -116,8 +103,8 @@
|
|||||||
|
|
||||||
<!-- Java Servlet -->
|
<!-- Java Servlet -->
|
||||||
<dependency>
|
<dependency>
|
||||||
<groupId>jakarta.servlet</groupId>
|
<groupId>javax.servlet</groupId>
|
||||||
<artifactId>jakarta.servlet-api</artifactId>
|
<artifactId>javax.servlet-api</artifactId>
|
||||||
</dependency>
|
</dependency>
|
||||||
|
|
||||||
</dependencies>
|
</dependencies>
|
||||||
|
|||||||
@@ -51,8 +51,7 @@ public @interface Excel
|
|||||||
/**
|
/**
|
||||||
* BigDecimal 舍入规则 默认:BigDecimal.ROUND_HALF_EVEN
|
* BigDecimal 舍入规则 默认:BigDecimal.ROUND_HALF_EVEN
|
||||||
*/
|
*/
|
||||||
@SuppressWarnings("deprecation")
|
public int roundingMode() default BigDecimal.ROUND_HALF_EVEN;
|
||||||
public int roundingMode() default BigDecimal.ROUND_HALF_EVEN;
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 导出时在excel中每个列的高度
|
* 导出时在excel中每个列的高度
|
||||||
|
|||||||
@@ -142,4 +142,35 @@ public class Constants
|
|||||||
*/
|
*/
|
||||||
public static final String[] JOB_ERROR_STR = { "java.net.URL", "javax.naming.InitialContext", "org.yaml.snakeyaml",
|
public static final String[] JOB_ERROR_STR = { "java.net.URL", "javax.naming.InitialContext", "org.yaml.snakeyaml",
|
||||||
"org.springframework", "org.apache", "com.ruoyi.common.core.utils.file" };
|
"org.springframework", "org.apache", "com.ruoyi.common.core.utils.file" };
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 部门相关常量
|
||||||
|
*/
|
||||||
|
public static class Dept
|
||||||
|
{
|
||||||
|
/**
|
||||||
|
* 全部数据权限
|
||||||
|
*/
|
||||||
|
public static final String DATA_SCOPE_ALL = "1";
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 自定数据权限
|
||||||
|
*/
|
||||||
|
public static final String DATA_SCOPE_CUSTOM = "2";
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 部门数据权限
|
||||||
|
*/
|
||||||
|
public static final String DATA_SCOPE_DEPT = "3";
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 部门及以下数据权限
|
||||||
|
*/
|
||||||
|
public static final String DATA_SCOPE_DEPT_AND_CHILD = "4";
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 仅本人数据权限
|
||||||
|
*/
|
||||||
|
public static final String DATA_SCOPE_SELF = "5";
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -31,6 +31,9 @@ public class GenConstants
|
|||||||
/** 上级菜单名称字段 */
|
/** 上级菜单名称字段 */
|
||||||
public static final String PARENT_MENU_NAME = "parentMenuName";
|
public static final String PARENT_MENU_NAME = "parentMenuName";
|
||||||
|
|
||||||
|
/** 生成详情页开关 */
|
||||||
|
public static final String GEN_VIEW = "genView";
|
||||||
|
|
||||||
/** 数据库字符串类型 */
|
/** 数据库字符串类型 */
|
||||||
public static final String[] COLUMNTYPE_STR = { "char", "varchar", "nvarchar", "varchar2" };
|
public static final String[] COLUMNTYPE_STR = { "char", "varchar", "nvarchar", "varchar2" };
|
||||||
|
|
||||||
|
|||||||
@@ -16,7 +16,6 @@ import org.apache.commons.lang3.time.DateFormatUtils;
|
|||||||
*
|
*
|
||||||
* @author ruoyi
|
* @author ruoyi
|
||||||
*/
|
*/
|
||||||
@SuppressWarnings("deprecation")
|
|
||||||
public class DateUtils extends org.apache.commons.lang3.time.DateUtils
|
public class DateUtils extends org.apache.commons.lang3.time.DateUtils
|
||||||
{
|
{
|
||||||
public static String YYYY = "yyyy";
|
public static String YYYY = "yyyy";
|
||||||
|
|||||||
@@ -8,10 +8,10 @@ import java.util.Collections;
|
|||||||
import java.util.Enumeration;
|
import java.util.Enumeration;
|
||||||
import java.util.HashMap;
|
import java.util.HashMap;
|
||||||
import java.util.Map;
|
import java.util.Map;
|
||||||
import jakarta.servlet.ServletRequest;
|
import javax.servlet.ServletRequest;
|
||||||
import jakarta.servlet.http.HttpServletRequest;
|
import javax.servlet.http.HttpServletRequest;
|
||||||
import jakarta.servlet.http.HttpServletResponse;
|
import javax.servlet.http.HttpServletResponse;
|
||||||
import jakarta.servlet.http.HttpSession;
|
import javax.servlet.http.HttpSession;
|
||||||
import org.springframework.core.io.buffer.DataBuffer;
|
import org.springframework.core.io.buffer.DataBuffer;
|
||||||
import org.springframework.http.HttpHeaders;
|
import org.springframework.http.HttpHeaders;
|
||||||
import org.springframework.http.HttpStatus;
|
import org.springframework.http.HttpStatus;
|
||||||
|
|||||||
@@ -12,7 +12,6 @@ import com.ruoyi.common.core.text.StrFormatter;
|
|||||||
*
|
*
|
||||||
* @author ruoyi
|
* @author ruoyi
|
||||||
*/
|
*/
|
||||||
@SuppressWarnings("deprecation")
|
|
||||||
public class StringUtils extends org.apache.commons.lang3.StringUtils
|
public class StringUtils extends org.apache.commons.lang3.StringUtils
|
||||||
{
|
{
|
||||||
/** 空字符串 */
|
/** 空字符串 */
|
||||||
|
|||||||
@@ -1,9 +1,9 @@
|
|||||||
package com.ruoyi.common.core.utils.bean;
|
package com.ruoyi.common.core.utils.bean;
|
||||||
|
|
||||||
import java.util.Set;
|
import java.util.Set;
|
||||||
import jakarta.validation.ConstraintViolation;
|
import javax.validation.ConstraintViolation;
|
||||||
import jakarta.validation.ConstraintViolationException;
|
import javax.validation.ConstraintViolationException;
|
||||||
import jakarta.validation.Validator;
|
import javax.validation.Validator;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* bean对象属性验证
|
* bean对象属性验证
|
||||||
|
|||||||
@@ -8,8 +8,8 @@ import java.io.OutputStream;
|
|||||||
import java.io.UnsupportedEncodingException;
|
import java.io.UnsupportedEncodingException;
|
||||||
import java.net.URLEncoder;
|
import java.net.URLEncoder;
|
||||||
import java.nio.charset.StandardCharsets;
|
import java.nio.charset.StandardCharsets;
|
||||||
import jakarta.servlet.http.HttpServletRequest;
|
import javax.servlet.http.HttpServletRequest;
|
||||||
import jakarta.servlet.http.HttpServletResponse;
|
import javax.servlet.http.HttpServletResponse;
|
||||||
import org.apache.commons.lang3.ArrayUtils;
|
import org.apache.commons.lang3.ArrayUtils;
|
||||||
import com.ruoyi.common.core.utils.StringUtils;
|
import com.ruoyi.common.core.utils.StringUtils;
|
||||||
|
|
||||||
|
|||||||
@@ -2,7 +2,7 @@ package com.ruoyi.common.core.utils.ip;
|
|||||||
|
|
||||||
import java.net.InetAddress;
|
import java.net.InetAddress;
|
||||||
import java.net.UnknownHostException;
|
import java.net.UnknownHostException;
|
||||||
import jakarta.servlet.http.HttpServletRequest;
|
import javax.servlet.http.HttpServletRequest;
|
||||||
import com.ruoyi.common.core.utils.ServletUtils;
|
import com.ruoyi.common.core.utils.ServletUtils;
|
||||||
import com.ruoyi.common.core.utils.StringUtils;
|
import com.ruoyi.common.core.utils.StringUtils;
|
||||||
|
|
||||||
|
|||||||
@@ -19,7 +19,7 @@ import java.util.List;
|
|||||||
import java.util.Map;
|
import java.util.Map;
|
||||||
import java.util.Set;
|
import java.util.Set;
|
||||||
import java.util.stream.Collectors;
|
import java.util.stream.Collectors;
|
||||||
import jakarta.servlet.http.HttpServletResponse;
|
import javax.servlet.http.HttpServletResponse;
|
||||||
import org.apache.commons.lang3.ArrayUtils;
|
import org.apache.commons.lang3.ArrayUtils;
|
||||||
import org.apache.commons.lang3.RegExUtils;
|
import org.apache.commons.lang3.RegExUtils;
|
||||||
import org.apache.commons.lang3.reflect.FieldUtils;
|
import org.apache.commons.lang3.reflect.FieldUtils;
|
||||||
@@ -387,7 +387,7 @@ public class ExcelUtil<T>
|
|||||||
Object val = this.getCellValue(row, entry.getKey());
|
Object val = this.getCellValue(row, entry.getKey());
|
||||||
|
|
||||||
// 如果不存在实例则新建.
|
// 如果不存在实例则新建.
|
||||||
entity = (entity == null ? clazz.getDeclaredConstructor().newInstance() : entity);
|
entity = (entity == null ? clazz.newInstance() : entity);
|
||||||
// 从map中得到对应列的field.
|
// 从map中得到对应列的field.
|
||||||
Field field = (Field) entry.getValue()[0];
|
Field field = (Field) entry.getValue()[0];
|
||||||
Excel attr = (Excel) entry.getValue()[1];
|
Excel attr = (Excel) entry.getValue()[1];
|
||||||
@@ -1056,7 +1056,6 @@ public class ExcelUtil<T>
|
|||||||
/**
|
/**
|
||||||
* 添加单元格
|
* 添加单元格
|
||||||
*/
|
*/
|
||||||
@SuppressWarnings("deprecation")
|
|
||||||
public Cell addCell(Excel attr, Row row, T vo, Field field, int column)
|
public Cell addCell(Excel attr, Row row, T vo, Field field, int column)
|
||||||
{
|
{
|
||||||
Cell cell = null;
|
Cell cell = null;
|
||||||
@@ -1329,7 +1328,7 @@ public class ExcelUtil<T>
|
|||||||
{
|
{
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
Object instance = excel.handler().getDeclaredConstructor().newInstance();
|
Object instance = excel.handler().newInstance();
|
||||||
Method formatMethod = excel.handler().getMethod("format", new Class[] { Object.class, String[].class, Cell.class, Workbook.class });
|
Method formatMethod = excel.handler().getMethod("format", new Class[] { Object.class, String[].class, Cell.class, Workbook.class });
|
||||||
value = formatMethod.invoke(instance, value, excel.args(), cell, this.wb);
|
value = formatMethod.invoke(instance, value, excel.args(), cell, this.wb);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -310,8 +310,7 @@ public class ReflectUtils
|
|||||||
/**
|
/**
|
||||||
* 改变private/protected的方法为public,尽量不调用实际改动的语句,避免JDK的SecurityManager抱怨。
|
* 改变private/protected的方法为public,尽量不调用实际改动的语句,避免JDK的SecurityManager抱怨。
|
||||||
*/
|
*/
|
||||||
@SuppressWarnings("deprecation")
|
public static void makeAccessible(Method method)
|
||||||
public static void makeAccessible(Method method)
|
|
||||||
{
|
{
|
||||||
if ((!Modifier.isPublic(method.getModifiers()) || !Modifier.isPublic(method.getDeclaringClass().getModifiers()))
|
if ((!Modifier.isPublic(method.getModifiers()) || !Modifier.isPublic(method.getDeclaringClass().getModifiers()))
|
||||||
&& !method.isAccessible())
|
&& !method.isAccessible())
|
||||||
@@ -323,8 +322,7 @@ public class ReflectUtils
|
|||||||
/**
|
/**
|
||||||
* 改变private/protected的成员变量为public,尽量不调用实际改动的语句,避免JDK的SecurityManager抱怨。
|
* 改变private/protected的成员变量为public,尽量不调用实际改动的语句,避免JDK的SecurityManager抱怨。
|
||||||
*/
|
*/
|
||||||
@SuppressWarnings("deprecation")
|
public static void makeAccessible(Field field)
|
||||||
public static void makeAccessible(Field field)
|
|
||||||
{
|
{
|
||||||
if ((!Modifier.isPublic(field.getModifiers()) || !Modifier.isPublic(field.getDeclaringClass().getModifiers())
|
if ((!Modifier.isPublic(field.getModifiers()) || !Modifier.isPublic(field.getDeclaringClass().getModifiers())
|
||||||
|| Modifier.isFinal(field.getModifiers())) && !field.isAccessible())
|
|| Modifier.isFinal(field.getModifiers())) && !field.isAccessible())
|
||||||
|
|||||||
@@ -7,12 +7,17 @@ import org.slf4j.Logger;
|
|||||||
import org.slf4j.LoggerFactory;
|
import org.slf4j.LoggerFactory;
|
||||||
import org.springframework.web.bind.WebDataBinder;
|
import org.springframework.web.bind.WebDataBinder;
|
||||||
import org.springframework.web.bind.annotation.InitBinder;
|
import org.springframework.web.bind.annotation.InitBinder;
|
||||||
|
import com.github.pagehelper.PageHelper;
|
||||||
import com.github.pagehelper.PageInfo;
|
import com.github.pagehelper.PageInfo;
|
||||||
import com.ruoyi.common.core.constant.HttpStatus;
|
import com.ruoyi.common.core.constant.HttpStatus;
|
||||||
import com.ruoyi.common.core.utils.DateUtils;
|
import com.ruoyi.common.core.utils.DateUtils;
|
||||||
import com.ruoyi.common.core.utils.PageUtils;
|
import com.ruoyi.common.core.utils.PageUtils;
|
||||||
|
import com.ruoyi.common.core.utils.StringUtils;
|
||||||
|
import com.ruoyi.common.core.utils.sql.SqlUtil;
|
||||||
import com.ruoyi.common.core.web.domain.AjaxResult;
|
import com.ruoyi.common.core.web.domain.AjaxResult;
|
||||||
|
import com.ruoyi.common.core.web.page.PageDomain;
|
||||||
import com.ruoyi.common.core.web.page.TableDataInfo;
|
import com.ruoyi.common.core.web.page.TableDataInfo;
|
||||||
|
import com.ruoyi.common.core.web.page.TableSupport;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* web层通用数据处理
|
* web层通用数据处理
|
||||||
@@ -48,6 +53,19 @@ public class BaseController
|
|||||||
PageUtils.startPage();
|
PageUtils.startPage();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 设置请求排序数据
|
||||||
|
*/
|
||||||
|
protected void startOrderBy()
|
||||||
|
{
|
||||||
|
PageDomain pageDomain = TableSupport.buildPageRequest();
|
||||||
|
if (StringUtils.isNotEmpty(pageDomain.getOrderBy()))
|
||||||
|
{
|
||||||
|
String orderBy = SqlUtil.escapeOrderBySql(pageDomain.getOrderBy());
|
||||||
|
PageHelper.orderBy(orderBy);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 清理分页的线程变量
|
* 清理分页的线程变量
|
||||||
*/
|
*/
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
package com.ruoyi.common.core.xss;
|
package com.ruoyi.common.core.xss;
|
||||||
|
|
||||||
import jakarta.validation.Constraint;
|
import javax.validation.Constraint;
|
||||||
import jakarta.validation.Payload;
|
import javax.validation.Payload;
|
||||||
import java.lang.annotation.ElementType;
|
import java.lang.annotation.ElementType;
|
||||||
import java.lang.annotation.Retention;
|
import java.lang.annotation.Retention;
|
||||||
import java.lang.annotation.RetentionPolicy;
|
import java.lang.annotation.RetentionPolicy;
|
||||||
|
|||||||
@@ -2,8 +2,8 @@ package com.ruoyi.common.core.xss;
|
|||||||
|
|
||||||
import java.util.regex.Matcher;
|
import java.util.regex.Matcher;
|
||||||
import java.util.regex.Pattern;
|
import java.util.regex.Pattern;
|
||||||
import jakarta.validation.ConstraintValidator;
|
import javax.validation.ConstraintValidator;
|
||||||
import jakarta.validation.ConstraintValidatorContext;
|
import javax.validation.ConstraintValidatorContext;
|
||||||
import com.ruoyi.common.core.utils.StringUtils;
|
import com.ruoyi.common.core.utils.StringUtils;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|||||||
@@ -16,15 +16,25 @@ import java.lang.annotation.Target;
|
|||||||
@Documented
|
@Documented
|
||||||
public @interface DataScope
|
public @interface DataScope
|
||||||
{
|
{
|
||||||
|
/**
|
||||||
|
* 用户表的别名
|
||||||
|
*/
|
||||||
|
public String userAlias() default "";
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 部门表的别名
|
* 部门表的别名
|
||||||
*/
|
*/
|
||||||
public String deptAlias() default "";
|
public String deptAlias() default "";
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 用户表的别名
|
* 用户字段名
|
||||||
*/
|
*/
|
||||||
public String userAlias() default "";
|
public String userField() default "user_id";
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 部门字段名
|
||||||
|
*/
|
||||||
|
public String deptField() default "dept_id";
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 权限字符(用于多个角色匹配符合要求的权限)默认根据权限注解@RequiresPermissions获取,多个权限用逗号分隔开来
|
* 权限字符(用于多个角色匹配符合要求的权限)默认根据权限注解@RequiresPermissions获取,多个权限用逗号分隔开来
|
||||||
|
|||||||
@@ -6,6 +6,7 @@ import org.aspectj.lang.JoinPoint;
|
|||||||
import org.aspectj.lang.annotation.Aspect;
|
import org.aspectj.lang.annotation.Aspect;
|
||||||
import org.aspectj.lang.annotation.Before;
|
import org.aspectj.lang.annotation.Before;
|
||||||
import org.springframework.stereotype.Component;
|
import org.springframework.stereotype.Component;
|
||||||
|
import com.ruoyi.common.core.constant.Constants;
|
||||||
import com.ruoyi.common.core.constant.UserConstants;
|
import com.ruoyi.common.core.constant.UserConstants;
|
||||||
import com.ruoyi.common.core.context.SecurityContextHolder;
|
import com.ruoyi.common.core.context.SecurityContextHolder;
|
||||||
import com.ruoyi.common.core.text.Convert;
|
import com.ruoyi.common.core.text.Convert;
|
||||||
@@ -26,31 +27,6 @@ import com.ruoyi.system.api.model.LoginUser;
|
|||||||
@Component
|
@Component
|
||||||
public class DataScopeAspect
|
public class DataScopeAspect
|
||||||
{
|
{
|
||||||
/**
|
|
||||||
* 全部数据权限
|
|
||||||
*/
|
|
||||||
public static final String DATA_SCOPE_ALL = "1";
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 自定数据权限
|
|
||||||
*/
|
|
||||||
public static final String DATA_SCOPE_CUSTOM = "2";
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 部门数据权限
|
|
||||||
*/
|
|
||||||
public static final String DATA_SCOPE_DEPT = "3";
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 部门及以下数据权限
|
|
||||||
*/
|
|
||||||
public static final String DATA_SCOPE_DEPT_AND_CHILD = "4";
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 仅本人数据权限
|
|
||||||
*/
|
|
||||||
public static final String DATA_SCOPE_SELF = "5";
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 数据权限过滤关键字
|
* 数据权限过滤关键字
|
||||||
*/
|
*/
|
||||||
@@ -74,7 +50,7 @@ public class DataScopeAspect
|
|||||||
if (StringUtils.isNotNull(currentUser) && !currentUser.isAdmin())
|
if (StringUtils.isNotNull(currentUser) && !currentUser.isAdmin())
|
||||||
{
|
{
|
||||||
String permission = StringUtils.defaultIfEmpty(controllerDataScope.permission(), SecurityContextHolder.getPermission());
|
String permission = StringUtils.defaultIfEmpty(controllerDataScope.permission(), SecurityContextHolder.getPermission());
|
||||||
dataScopeFilter(joinPoint, currentUser, controllerDataScope.deptAlias(), controllerDataScope.userAlias(), permission);
|
dataScopeFilter(joinPoint, currentUser, controllerDataScope.userAlias(), controllerDataScope.deptAlias(), controllerDataScope.userField(), controllerDataScope.deptField(), permission);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -88,13 +64,13 @@ public class DataScopeAspect
|
|||||||
* @param userAlias 用户别名
|
* @param userAlias 用户别名
|
||||||
* @param permission 权限字符
|
* @param permission 权限字符
|
||||||
*/
|
*/
|
||||||
public static void dataScopeFilter(JoinPoint joinPoint, SysUser user, String deptAlias, String userAlias, String permission)
|
public static void dataScopeFilter(JoinPoint joinPoint, SysUser user, String userAlias, String deptAlias, String userField, String deptField, String permission)
|
||||||
{
|
{
|
||||||
StringBuilder sqlString = new StringBuilder();
|
StringBuilder sqlString = new StringBuilder();
|
||||||
List<String> conditions = new ArrayList<String>();
|
List<String> conditions = new ArrayList<String>();
|
||||||
List<String> scopeCustomIds = new ArrayList<String>();
|
List<String> scopeCustomIds = new ArrayList<String>();
|
||||||
user.getRoles().forEach(role -> {
|
user.getRoles().forEach(role -> {
|
||||||
if (DATA_SCOPE_CUSTOM.equals(role.getDataScope()) && StringUtils.equals(role.getStatus(), UserConstants.ROLE_NORMAL) && (StringUtils.isEmpty(permission) || StringUtils.containsAny(role.getPermissions(), Convert.toStrArray(permission))))
|
if (Constants.Dept.DATA_SCOPE_CUSTOM.equals(role.getDataScope()) && StringUtils.equals(role.getStatus(), UserConstants.ROLE_NORMAL) && (StringUtils.isEmpty(permission) || StringUtils.containsAny(role.getPermissions(), Convert.toStrArray(permission))))
|
||||||
{
|
{
|
||||||
scopeCustomIds.add(Convert.toStr(role.getRoleId()));
|
scopeCustomIds.add(Convert.toStr(role.getRoleId()));
|
||||||
}
|
}
|
||||||
@@ -111,42 +87,42 @@ public class DataScopeAspect
|
|||||||
{
|
{
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
if (DATA_SCOPE_ALL.equals(dataScope))
|
if (Constants.Dept.DATA_SCOPE_ALL.equals(dataScope))
|
||||||
{
|
{
|
||||||
sqlString = new StringBuilder();
|
sqlString = new StringBuilder();
|
||||||
conditions.add(dataScope);
|
conditions.add(dataScope);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
else if (DATA_SCOPE_CUSTOM.equals(dataScope))
|
else if (Constants.Dept.DATA_SCOPE_CUSTOM.equals(dataScope))
|
||||||
{
|
{
|
||||||
if (scopeCustomIds.size() > 1)
|
if (scopeCustomIds.size() > 1)
|
||||||
{
|
{
|
||||||
// 多个自定数据权限使用in查询,避免多次拼接。
|
// 多个自定数据权限使用in查询,避免多次拼接。
|
||||||
sqlString.append(StringUtils.format(" OR {}.dept_id IN ( SELECT dept_id FROM sys_role_dept WHERE role_id in ({}) ) ", deptAlias, String.join(",", scopeCustomIds)));
|
sqlString.append(StringUtils.format(" OR {}.{} IN ( SELECT dept_id FROM sys_role_dept WHERE role_id in ({}) ) ", deptAlias, deptField, String.join(",", scopeCustomIds)));
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
sqlString.append(StringUtils.format(" OR {}.dept_id IN ( SELECT dept_id FROM sys_role_dept WHERE role_id = {} ) ", deptAlias, role.getRoleId()));
|
sqlString.append(StringUtils.format(" OR {}.{} IN ( SELECT dept_id FROM sys_role_dept WHERE role_id = {} ) ", deptAlias, deptField, role.getRoleId()));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else if (DATA_SCOPE_DEPT.equals(dataScope))
|
else if (Constants.Dept.DATA_SCOPE_DEPT.equals(dataScope))
|
||||||
{
|
{
|
||||||
sqlString.append(StringUtils.format(" OR {}.dept_id = {} ", deptAlias, user.getDeptId()));
|
sqlString.append(StringUtils.format(" OR {}.{} = {} ", deptAlias, deptField, user.getDeptId()));
|
||||||
}
|
}
|
||||||
else if (DATA_SCOPE_DEPT_AND_CHILD.equals(dataScope))
|
else if (Constants.Dept.DATA_SCOPE_DEPT_AND_CHILD.equals(dataScope))
|
||||||
{
|
{
|
||||||
sqlString.append(StringUtils.format(" OR {}.dept_id IN ( SELECT dept_id FROM sys_dept WHERE dept_id = {} or find_in_set( {} , ancestors ) )", deptAlias, user.getDeptId(), user.getDeptId()));
|
sqlString.append(StringUtils.format(" OR {}.{} IN ( SELECT dept_id FROM sys_dept WHERE dept_id = {} or find_in_set( {} , ancestors ) )", deptAlias, deptField, user.getDeptId(), user.getDeptId()));
|
||||||
}
|
}
|
||||||
else if (DATA_SCOPE_SELF.equals(dataScope))
|
else if (Constants.Dept.DATA_SCOPE_SELF.equals(dataScope))
|
||||||
{
|
{
|
||||||
if (StringUtils.isNotBlank(userAlias))
|
if (StringUtils.isNotBlank(userAlias))
|
||||||
{
|
{
|
||||||
sqlString.append(StringUtils.format(" OR {}.user_id = {} ", userAlias, user.getUserId()));
|
sqlString.append(StringUtils.format(" OR {}.{} = {} ", userAlias, userField, user.getUserId()));
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
// 数据权限为仅本人且没有userAlias别名不查询任何数据
|
// 数据权限为仅本人且没有userAlias别名不查询任何数据
|
||||||
sqlString.append(StringUtils.format(" OR {}.dept_id = 0 ", deptAlias));
|
sqlString.append(StringUtils.format(" OR {}.{} = 0 ", deptAlias, deptField));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
conditions.add(dataScope);
|
conditions.add(dataScope);
|
||||||
@@ -155,7 +131,7 @@ public class DataScopeAspect
|
|||||||
// 角色都不包含传递过来的权限字符,这个时候sqlString也会为空,所以要限制一下,不查询任何数据
|
// 角色都不包含传递过来的权限字符,这个时候sqlString也会为空,所以要限制一下,不查询任何数据
|
||||||
if (StringUtils.isEmpty(conditions))
|
if (StringUtils.isEmpty(conditions))
|
||||||
{
|
{
|
||||||
sqlString.append(StringUtils.format(" OR {}.dept_id = 0 ", deptAlias));
|
sqlString.append(StringUtils.format(" OR {}.{} = 0 ", deptAlias, deptField));
|
||||||
}
|
}
|
||||||
|
|
||||||
if (StringUtils.isNotBlank(sqlString.toString()))
|
if (StringUtils.isNotBlank(sqlString.toString()))
|
||||||
|
|||||||
@@ -20,14 +20,14 @@
|
|||||||
<!-- Druid -->
|
<!-- Druid -->
|
||||||
<dependency>
|
<dependency>
|
||||||
<groupId>com.alibaba</groupId>
|
<groupId>com.alibaba</groupId>
|
||||||
<artifactId>druid-spring-boot-3-starter</artifactId>
|
<artifactId>druid-spring-boot-starter</artifactId>
|
||||||
<version>${druid.version}</version>
|
<version>${druid.version}</version>
|
||||||
</dependency>
|
</dependency>
|
||||||
|
|
||||||
<!-- Dynamic DataSource -->
|
<!-- Dynamic DataSource -->
|
||||||
<dependency>
|
<dependency>
|
||||||
<groupId>com.baomidou</groupId>
|
<groupId>com.baomidou</groupId>
|
||||||
<artifactId>dynamic-datasource-spring-boot3-starter</artifactId>
|
<artifactId>dynamic-datasource-spring-boot-starter</artifactId>
|
||||||
<version>${dynamic-ds.version}</version>
|
<version>${dynamic-ds.version}</version>
|
||||||
</dependency>
|
</dependency>
|
||||||
|
|
||||||
|
|||||||
@@ -2,8 +2,8 @@ package com.ruoyi.common.log.aspect;
|
|||||||
|
|
||||||
import java.util.Collection;
|
import java.util.Collection;
|
||||||
import java.util.Map;
|
import java.util.Map;
|
||||||
import jakarta.servlet.http.HttpServletRequest;
|
import javax.servlet.http.HttpServletRequest;
|
||||||
import jakarta.servlet.http.HttpServletResponse;
|
import javax.servlet.http.HttpServletResponse;
|
||||||
import org.apache.commons.lang3.ArrayUtils;
|
import org.apache.commons.lang3.ArrayUtils;
|
||||||
import org.aspectj.lang.JoinPoint;
|
import org.aspectj.lang.JoinPoint;
|
||||||
import org.aspectj.lang.annotation.AfterReturning;
|
import org.aspectj.lang.annotation.AfterReturning;
|
||||||
|
|||||||
@@ -18,7 +18,6 @@ import org.springframework.data.redis.serializer.StringRedisSerializer;
|
|||||||
@Configuration
|
@Configuration
|
||||||
@EnableCaching
|
@EnableCaching
|
||||||
@AutoConfigureBefore(RedisAutoConfiguration.class)
|
@AutoConfigureBefore(RedisAutoConfiguration.class)
|
||||||
@SuppressWarnings("deprecation")
|
|
||||||
public class RedisConfig extends CachingConfigurerSupport
|
public class RedisConfig extends CachingConfigurerSupport
|
||||||
{
|
{
|
||||||
@Bean
|
@Bean
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
package com.ruoyi.common.security.feign;
|
package com.ruoyi.common.security.feign;
|
||||||
|
|
||||||
import java.util.Map;
|
import java.util.Map;
|
||||||
import jakarta.servlet.http.HttpServletRequest;
|
import javax.servlet.http.HttpServletRequest;
|
||||||
import org.springframework.stereotype.Component;
|
import org.springframework.stereotype.Component;
|
||||||
import com.ruoyi.common.core.constant.SecurityConstants;
|
import com.ruoyi.common.core.constant.SecurityConstants;
|
||||||
import com.ruoyi.common.core.utils.ServletUtils;
|
import com.ruoyi.common.core.utils.ServletUtils;
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
package com.ruoyi.common.security.handler;
|
package com.ruoyi.common.security.handler;
|
||||||
|
|
||||||
import jakarta.servlet.http.HttpServletRequest;
|
import javax.servlet.http.HttpServletRequest;
|
||||||
import org.slf4j.Logger;
|
import org.slf4j.Logger;
|
||||||
import org.slf4j.LoggerFactory;
|
import org.slf4j.LoggerFactory;
|
||||||
import org.springframework.validation.BindException;
|
import org.springframework.validation.BindException;
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
package com.ruoyi.common.security.interceptor;
|
package com.ruoyi.common.security.interceptor;
|
||||||
|
|
||||||
import jakarta.servlet.http.HttpServletRequest;
|
import javax.servlet.http.HttpServletRequest;
|
||||||
import jakarta.servlet.http.HttpServletResponse;
|
import javax.servlet.http.HttpServletResponse;
|
||||||
import org.springframework.web.method.HandlerMethod;
|
import org.springframework.web.method.HandlerMethod;
|
||||||
import org.springframework.web.servlet.AsyncHandlerInterceptor;
|
import org.springframework.web.servlet.AsyncHandlerInterceptor;
|
||||||
import com.ruoyi.common.core.constant.SecurityConstants;
|
import com.ruoyi.common.core.constant.SecurityConstants;
|
||||||
|
|||||||
@@ -3,7 +3,7 @@ package com.ruoyi.common.security.service;
|
|||||||
import java.util.HashMap;
|
import java.util.HashMap;
|
||||||
import java.util.Map;
|
import java.util.Map;
|
||||||
import java.util.concurrent.TimeUnit;
|
import java.util.concurrent.TimeUnit;
|
||||||
import jakarta.servlet.http.HttpServletRequest;
|
import javax.servlet.http.HttpServletRequest;
|
||||||
import org.slf4j.Logger;
|
import org.slf4j.Logger;
|
||||||
import org.slf4j.LoggerFactory;
|
import org.slf4j.LoggerFactory;
|
||||||
import org.springframework.beans.factory.annotation.Autowired;
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
|
|||||||
@@ -1,5 +1,6 @@
|
|||||||
package com.ruoyi.common.security.utils;
|
package com.ruoyi.common.security.utils;
|
||||||
|
|
||||||
|
import javax.servlet.http.HttpServletRequest;
|
||||||
import org.springframework.security.crypto.bcrypt.BCryptPasswordEncoder;
|
import org.springframework.security.crypto.bcrypt.BCryptPasswordEncoder;
|
||||||
import com.ruoyi.common.core.constant.SecurityConstants;
|
import com.ruoyi.common.core.constant.SecurityConstants;
|
||||||
import com.ruoyi.common.core.constant.TokenConstants;
|
import com.ruoyi.common.core.constant.TokenConstants;
|
||||||
@@ -8,7 +9,6 @@ import com.ruoyi.common.core.context.SecurityContextHolder;
|
|||||||
import com.ruoyi.common.core.utils.ServletUtils;
|
import com.ruoyi.common.core.utils.ServletUtils;
|
||||||
import com.ruoyi.common.core.utils.StringUtils;
|
import com.ruoyi.common.core.utils.StringUtils;
|
||||||
import com.ruoyi.system.api.model.LoginUser;
|
import com.ruoyi.system.api.model.LoginUser;
|
||||||
import jakarta.servlet.http.HttpServletRequest;
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 权限获取工具类
|
* 权限获取工具类
|
||||||
|
|||||||
@@ -26,7 +26,7 @@
|
|||||||
<!-- SpringDoc webmvc -->
|
<!-- SpringDoc webmvc -->
|
||||||
<dependency>
|
<dependency>
|
||||||
<groupId>org.springdoc</groupId>
|
<groupId>org.springdoc</groupId>
|
||||||
<artifactId>springdoc-openapi-starter-webmvc-ui</artifactId>
|
<artifactId>springdoc-openapi-ui</artifactId>
|
||||||
</dependency>
|
</dependency>
|
||||||
|
|
||||||
</dependencies>
|
</dependencies>
|
||||||
|
|||||||
@@ -2,8 +2,6 @@ package com.ruoyi.common.swagger.config;
|
|||||||
|
|
||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
import org.springdoc.core.configuration.SpringDocConfiguration;
|
|
||||||
import org.springframework.boot.autoconfigure.AutoConfiguration;
|
|
||||||
import org.springframework.boot.autoconfigure.condition.ConditionalOnMissingBean;
|
import org.springframework.boot.autoconfigure.condition.ConditionalOnMissingBean;
|
||||||
import org.springframework.boot.autoconfigure.condition.ConditionalOnProperty;
|
import org.springframework.boot.autoconfigure.condition.ConditionalOnProperty;
|
||||||
import org.springframework.boot.context.properties.EnableConfigurationProperties;
|
import org.springframework.boot.context.properties.EnableConfigurationProperties;
|
||||||
@@ -21,7 +19,6 @@ import io.swagger.v3.oas.models.servers.Server;
|
|||||||
*
|
*
|
||||||
* @author ruoyi
|
* @author ruoyi
|
||||||
*/
|
*/
|
||||||
@AutoConfiguration(before = SpringDocConfiguration.class)
|
|
||||||
@EnableConfigurationProperties(SpringDocProperties.class)
|
@EnableConfigurationProperties(SpringDocProperties.class)
|
||||||
@ConditionalOnProperty(name = "springdoc.api-docs.enabled", havingValue = "true", matchIfMissing = true)
|
@ConditionalOnProperty(name = "springdoc.api-docs.enabled", havingValue = "true", matchIfMissing = true)
|
||||||
public class SpringDocAutoConfiguration
|
public class SpringDocAutoConfiguration
|
||||||
|
|||||||
@@ -19,7 +19,7 @@
|
|||||||
<!-- SpringCloud Gateway -->
|
<!-- SpringCloud Gateway -->
|
||||||
<dependency>
|
<dependency>
|
||||||
<groupId>org.springframework.cloud</groupId>
|
<groupId>org.springframework.cloud</groupId>
|
||||||
<artifactId>spring-cloud-starter-gateway-server-webflux</artifactId>
|
<artifactId>spring-cloud-starter-gateway</artifactId>
|
||||||
</dependency>
|
</dependency>
|
||||||
|
|
||||||
<!-- SpringCloud Alibaba Nacos -->
|
<!-- SpringCloud Alibaba Nacos -->
|
||||||
@@ -79,7 +79,7 @@
|
|||||||
<!-- Springdoc -->
|
<!-- Springdoc -->
|
||||||
<dependency>
|
<dependency>
|
||||||
<groupId>org.springdoc</groupId>
|
<groupId>org.springdoc</groupId>
|
||||||
<artifactId>springdoc-openapi-starter-webflux-ui</artifactId>
|
<artifactId>springdoc-openapi-webflux-ui</artifactId>
|
||||||
<version>${springdoc.version}</version>
|
<version>${springdoc.version}</version>
|
||||||
</dependency>
|
</dependency>
|
||||||
|
|
||||||
|
|||||||
@@ -2,8 +2,8 @@ package com.ruoyi.gateway.config;
|
|||||||
|
|
||||||
import java.util.Set;
|
import java.util.Set;
|
||||||
import java.util.stream.Collectors;
|
import java.util.stream.Collectors;
|
||||||
import org.springdoc.core.properties.AbstractSwaggerUiConfigProperties;
|
import org.springdoc.core.AbstractSwaggerUiConfigProperties;
|
||||||
import org.springdoc.core.properties.SwaggerUiConfigProperties;
|
import org.springdoc.core.SwaggerUiConfigProperties;
|
||||||
import org.springframework.beans.factory.InitializingBean;
|
import org.springframework.beans.factory.InitializingBean;
|
||||||
import org.springframework.beans.factory.annotation.Autowired;
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
import org.springframework.boot.autoconfigure.condition.ConditionalOnProperty;
|
import org.springframework.boot.autoconfigure.condition.ConditionalOnProperty;
|
||||||
|
|||||||
@@ -64,7 +64,6 @@ public class ValidateCodeFilter extends AbstractGatewayFilterFactory<Object>
|
|||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
@SuppressWarnings("deprecation")
|
|
||||||
private String resolveBodyFromRequest(ServerHttpRequest serverHttpRequest)
|
private String resolveBodyFromRequest(ServerHttpRequest serverHttpRequest)
|
||||||
{
|
{
|
||||||
// 获取请求体
|
// 获取请求体
|
||||||
|
|||||||
@@ -3,7 +3,7 @@ package com.ruoyi.gateway.service.impl;
|
|||||||
import java.awt.image.BufferedImage;
|
import java.awt.image.BufferedImage;
|
||||||
import java.io.IOException;
|
import java.io.IOException;
|
||||||
import java.util.concurrent.TimeUnit;
|
import java.util.concurrent.TimeUnit;
|
||||||
import jakarta.annotation.Resource;
|
import javax.annotation.Resource;
|
||||||
import javax.imageio.ImageIO;
|
import javax.imageio.ImageIO;
|
||||||
import org.springframework.beans.factory.annotation.Autowired;
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
import org.springframework.stereotype.Service;
|
import org.springframework.stereotype.Service;
|
||||||
|
|||||||
@@ -18,6 +18,11 @@ spring:
|
|||||||
config:
|
config:
|
||||||
# 配置中心地址
|
# 配置中心地址
|
||||||
server-addr: 127.0.0.1:8848
|
server-addr: 127.0.0.1:8848
|
||||||
|
# 配置文件格式
|
||||||
|
file-extension: yml
|
||||||
|
# 共享配置
|
||||||
|
shared-configs:
|
||||||
|
- application-${spring.profiles.active}.${spring.cloud.nacos.config.file-extension}
|
||||||
sentinel:
|
sentinel:
|
||||||
# 取消控制台懒加载
|
# 取消控制台懒加载
|
||||||
eager: true
|
eager: true
|
||||||
@@ -33,9 +38,3 @@ spring:
|
|||||||
groupId: DEFAULT_GROUP
|
groupId: DEFAULT_GROUP
|
||||||
data-type: json
|
data-type: json
|
||||||
rule-type: gw-flow
|
rule-type: gw-flow
|
||||||
config:
|
|
||||||
# 配置文件格式
|
|
||||||
file-extension: yml
|
|
||||||
import:
|
|
||||||
- nacos:application-${spring.profiles.active}.${spring.config.file-extension}
|
|
||||||
- nacos:${spring.application.name}-${spring.profiles.active}.${spring.config.file-extension}
|
|
||||||
|
|||||||
@@ -47,6 +47,12 @@
|
|||||||
<artifactId>spring-boot-starter-web</artifactId>
|
<artifactId>spring-boot-starter-web</artifactId>
|
||||||
</dependency>
|
</dependency>
|
||||||
|
|
||||||
|
<!-- FastDFS -->
|
||||||
|
<dependency>
|
||||||
|
<groupId>com.github.tobato</groupId>
|
||||||
|
<artifactId>fastdfs-client</artifactId>
|
||||||
|
</dependency>
|
||||||
|
|
||||||
<!-- Minio -->
|
<!-- Minio -->
|
||||||
<dependency>
|
<dependency>
|
||||||
<groupId>io.minio</groupId>
|
<groupId>io.minio</groupId>
|
||||||
|
|||||||
@@ -2,7 +2,7 @@ package com.ruoyi.file.config;
|
|||||||
|
|
||||||
import java.util.HashMap;
|
import java.util.HashMap;
|
||||||
import java.util.Map;
|
import java.util.Map;
|
||||||
import jakarta.servlet.DispatcherType;
|
import javax.servlet.DispatcherType;
|
||||||
import org.springframework.beans.factory.annotation.Value;
|
import org.springframework.beans.factory.annotation.Value;
|
||||||
import org.springframework.boot.autoconfigure.condition.ConditionalOnProperty;
|
import org.springframework.boot.autoconfigure.condition.ConditionalOnProperty;
|
||||||
import org.springframework.boot.web.servlet.FilterRegistrationBean;
|
import org.springframework.boot.web.servlet.FilterRegistrationBean;
|
||||||
|
|||||||
@@ -3,14 +3,14 @@ package com.ruoyi.file.filter;
|
|||||||
import java.io.IOException;
|
import java.io.IOException;
|
||||||
import java.util.Arrays;
|
import java.util.Arrays;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
import jakarta.servlet.Filter;
|
import javax.servlet.Filter;
|
||||||
import jakarta.servlet.FilterChain;
|
import javax.servlet.FilterChain;
|
||||||
import jakarta.servlet.FilterConfig;
|
import javax.servlet.FilterConfig;
|
||||||
import jakarta.servlet.ServletException;
|
import javax.servlet.ServletException;
|
||||||
import jakarta.servlet.ServletRequest;
|
import javax.servlet.ServletRequest;
|
||||||
import jakarta.servlet.ServletResponse;
|
import javax.servlet.ServletResponse;
|
||||||
import jakarta.servlet.http.HttpServletRequest;
|
import javax.servlet.http.HttpServletRequest;
|
||||||
import jakarta.servlet.http.HttpServletResponse;
|
import javax.servlet.http.HttpServletResponse;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 防盗链过滤器
|
* 防盗链过滤器
|
||||||
|
|||||||
@@ -0,0 +1,76 @@
|
|||||||
|
package com.ruoyi.file.service;
|
||||||
|
|
||||||
|
import java.io.InputStream;
|
||||||
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
|
import org.springframework.beans.factory.annotation.Value;
|
||||||
|
import org.springframework.stereotype.Service;
|
||||||
|
import org.springframework.web.multipart.MultipartFile;
|
||||||
|
import com.alibaba.nacos.common.utils.IoUtils;
|
||||||
|
import com.github.tobato.fastdfs.domain.fdfs.StorePath;
|
||||||
|
import com.github.tobato.fastdfs.service.FastFileStorageClient;
|
||||||
|
import com.ruoyi.common.core.utils.file.FileTypeUtils;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* FastDFS 文件存储
|
||||||
|
*
|
||||||
|
* @author ruoyi
|
||||||
|
*/
|
||||||
|
@Service
|
||||||
|
public class FastDfsSysFileServiceImpl implements ISysFileService
|
||||||
|
{
|
||||||
|
/**
|
||||||
|
* 域名或本机访问地址
|
||||||
|
*/
|
||||||
|
@Value("${fdfs.domain}")
|
||||||
|
public String domain;
|
||||||
|
|
||||||
|
@Autowired
|
||||||
|
private FastFileStorageClient storageClient;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* FastDfs文件上传接口
|
||||||
|
*
|
||||||
|
* @param file 上传的文件
|
||||||
|
* @return 访问地址
|
||||||
|
* @throws Exception
|
||||||
|
*/
|
||||||
|
@Override
|
||||||
|
public String uploadFile(MultipartFile file) throws Exception
|
||||||
|
{
|
||||||
|
InputStream inputStream = null;
|
||||||
|
try
|
||||||
|
{
|
||||||
|
inputStream = file.getInputStream();
|
||||||
|
StorePath storePath = storageClient.uploadFile(inputStream, file.getSize(), FileTypeUtils.getExtension(file), null);
|
||||||
|
return domain + "/" + storePath.getFullPath();
|
||||||
|
}
|
||||||
|
catch (Exception e)
|
||||||
|
{
|
||||||
|
throw new RuntimeException("FastDfs Failed to upload file", e);
|
||||||
|
}
|
||||||
|
finally
|
||||||
|
{
|
||||||
|
IoUtils.closeQuietly(inputStream);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* FastDFS文件删除接口
|
||||||
|
*
|
||||||
|
* @param fileUrl 文件访问URL
|
||||||
|
* @throws Exception
|
||||||
|
*/
|
||||||
|
@Override
|
||||||
|
public void deleteFile(String fileUrl) throws Exception
|
||||||
|
{
|
||||||
|
try
|
||||||
|
{
|
||||||
|
StorePath storePath = StorePath.parseFromUrl(fileUrl);
|
||||||
|
storageClient.deleteFile(storePath.getGroup(), storePath.getPath());
|
||||||
|
}
|
||||||
|
catch (Exception e)
|
||||||
|
{
|
||||||
|
throw new RuntimeException("FastDfs Failed to delete file: ", e);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -18,9 +18,8 @@ spring:
|
|||||||
config:
|
config:
|
||||||
# 配置中心地址
|
# 配置中心地址
|
||||||
server-addr: 127.0.0.1:8848
|
server-addr: 127.0.0.1:8848
|
||||||
config:
|
# 配置文件格式
|
||||||
# 配置文件格式
|
file-extension: yml
|
||||||
file-extension: yml
|
# 共享配置
|
||||||
import:
|
shared-configs:
|
||||||
- nacos:application-${spring.profiles.active}.${spring.config.file-extension}
|
- application-${spring.profiles.active}.${spring.cloud.nacos.config.file-extension}
|
||||||
- nacos:${spring.application.name}-${spring.profiles.active}.${spring.config.file-extension}
|
|
||||||
|
|||||||
@@ -4,7 +4,7 @@ import java.io.IOException;
|
|||||||
import java.util.HashMap;
|
import java.util.HashMap;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
import java.util.Map;
|
import java.util.Map;
|
||||||
import jakarta.servlet.http.HttpServletResponse;
|
import javax.servlet.http.HttpServletResponse;
|
||||||
import org.apache.commons.io.IOUtils;
|
import org.apache.commons.io.IOUtils;
|
||||||
import org.springframework.beans.factory.annotation.Autowired;
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
import org.springframework.validation.annotation.Validated;
|
import org.springframework.validation.annotation.Validated;
|
||||||
|
|||||||
@@ -1,8 +1,8 @@
|
|||||||
package com.ruoyi.gen.domain;
|
package com.ruoyi.gen.domain;
|
||||||
|
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
import jakarta.validation.Valid;
|
import javax.validation.Valid;
|
||||||
import jakarta.validation.constraints.NotBlank;
|
import javax.validation.constraints.NotBlank;
|
||||||
import org.apache.commons.lang3.ArrayUtils;
|
import org.apache.commons.lang3.ArrayUtils;
|
||||||
import com.ruoyi.common.core.constant.GenConstants;
|
import com.ruoyi.common.core.constant.GenConstants;
|
||||||
import com.ruoyi.common.core.utils.StringUtils;
|
import com.ruoyi.common.core.utils.StringUtils;
|
||||||
@@ -64,6 +64,9 @@ public class GenTable extends BaseEntity
|
|||||||
@NotBlank(message = "作者不能为空")
|
@NotBlank(message = "作者不能为空")
|
||||||
private String functionAuthor;
|
private String functionAuthor;
|
||||||
|
|
||||||
|
/** 表单布局(单列 双列 三列) */
|
||||||
|
private Integer formColNum;
|
||||||
|
|
||||||
/** 生成代码方式(0zip压缩包 1自定义路径) */
|
/** 生成代码方式(0zip压缩包 1自定义路径) */
|
||||||
private String genType;
|
private String genType;
|
||||||
|
|
||||||
@@ -98,6 +101,9 @@ public class GenTable extends BaseEntity
|
|||||||
/** 上级菜单名称字段 */
|
/** 上级菜单名称字段 */
|
||||||
private String parentMenuName;
|
private String parentMenuName;
|
||||||
|
|
||||||
|
/** 是否生成详情页 */
|
||||||
|
private boolean isView;
|
||||||
|
|
||||||
public Long getTableId()
|
public Long getTableId()
|
||||||
{
|
{
|
||||||
return tableId;
|
return tableId;
|
||||||
@@ -228,6 +234,16 @@ public class GenTable extends BaseEntity
|
|||||||
this.functionAuthor = functionAuthor;
|
this.functionAuthor = functionAuthor;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public Integer getFormColNum()
|
||||||
|
{
|
||||||
|
return formColNum;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setFormColNum(Integer formColNum)
|
||||||
|
{
|
||||||
|
this.formColNum = formColNum;
|
||||||
|
}
|
||||||
|
|
||||||
public String getGenType()
|
public String getGenType()
|
||||||
{
|
{
|
||||||
return genType;
|
return genType;
|
||||||
@@ -338,6 +354,16 @@ public class GenTable extends BaseEntity
|
|||||||
this.parentMenuName = parentMenuName;
|
this.parentMenuName = parentMenuName;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public boolean isView()
|
||||||
|
{
|
||||||
|
return isView;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setView(boolean isView)
|
||||||
|
{
|
||||||
|
this.isView = isView;
|
||||||
|
}
|
||||||
|
|
||||||
public boolean isSub()
|
public boolean isSub()
|
||||||
{
|
{
|
||||||
return isSub(this.tplCategory);
|
return isSub(this.tplCategory);
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
package com.ruoyi.gen.domain;
|
package com.ruoyi.gen.domain;
|
||||||
|
|
||||||
import jakarta.validation.constraints.NotBlank;
|
import javax.validation.constraints.NotBlank;
|
||||||
import com.ruoyi.common.core.utils.StringUtils;
|
import com.ruoyi.common.core.utils.StringUtils;
|
||||||
import com.ruoyi.common.core.web.domain.BaseEntity;
|
import com.ruoyi.common.core.web.domain.BaseEntity;
|
||||||
|
|
||||||
|
|||||||
@@ -209,7 +209,7 @@ public class GenTableServiceImpl implements IGenTableService
|
|||||||
VelocityContext context = VelocityUtils.prepareContext(table);
|
VelocityContext context = VelocityUtils.prepareContext(table);
|
||||||
|
|
||||||
// 获取模板列表
|
// 获取模板列表
|
||||||
List<String> templates = VelocityUtils.getTemplateList(table.getTplCategory(), table.getTplWebType());
|
List<String> templates = VelocityUtils.getTemplateList(table);
|
||||||
for (String template : templates)
|
for (String template : templates)
|
||||||
{
|
{
|
||||||
// 渲染模板
|
// 渲染模板
|
||||||
@@ -253,10 +253,10 @@ public class GenTableServiceImpl implements IGenTableService
|
|||||||
VelocityContext context = VelocityUtils.prepareContext(table);
|
VelocityContext context = VelocityUtils.prepareContext(table);
|
||||||
|
|
||||||
// 获取模板列表
|
// 获取模板列表
|
||||||
List<String> templates = VelocityUtils.getTemplateList(table.getTplCategory(), table.getTplWebType());
|
List<String> templates = VelocityUtils.getTemplateList(table);
|
||||||
for (String template : templates)
|
for (String template : templates)
|
||||||
{
|
{
|
||||||
if (!StringUtils.containsAny(template, "sql.vm", "api.js.vm", "index.vue.vm", "index-tree.vue.vm"))
|
if (!StringUtils.containsAny(template, "sql.vm", "api.js.vm", "api.ts.vm", "type.ts.vm", "index.ts.vm", "index.vue.vm", "index-tree.vue.vm", "view.vue.vm"))
|
||||||
{
|
{
|
||||||
// 渲染模板
|
// 渲染模板
|
||||||
StringWriter sw = new StringWriter();
|
StringWriter sw = new StringWriter();
|
||||||
@@ -371,7 +371,7 @@ public class GenTableServiceImpl implements IGenTableService
|
|||||||
VelocityContext context = VelocityUtils.prepareContext(table);
|
VelocityContext context = VelocityUtils.prepareContext(table);
|
||||||
|
|
||||||
// 获取模板列表
|
// 获取模板列表
|
||||||
List<String> templates = VelocityUtils.getTemplateList(table.getTplCategory(), table.getTplWebType());
|
List<String> templates = VelocityUtils.getTemplateList(table);
|
||||||
for (String template : templates)
|
for (String template : templates)
|
||||||
{
|
{
|
||||||
// 渲染模板
|
// 渲染模板
|
||||||
@@ -524,12 +524,14 @@ public class GenTableServiceImpl implements IGenTableService
|
|||||||
String treeName = paramsObj.getString(GenConstants.TREE_NAME);
|
String treeName = paramsObj.getString(GenConstants.TREE_NAME);
|
||||||
Long parentMenuId = paramsObj.getLongValue(GenConstants.PARENT_MENU_ID);
|
Long parentMenuId = paramsObj.getLongValue(GenConstants.PARENT_MENU_ID);
|
||||||
String parentMenuName = paramsObj.getString(GenConstants.PARENT_MENU_NAME);
|
String parentMenuName = paramsObj.getString(GenConstants.PARENT_MENU_NAME);
|
||||||
|
boolean isView = paramsObj.getBooleanValue(GenConstants.GEN_VIEW);
|
||||||
|
|
||||||
genTable.setTreeCode(treeCode);
|
genTable.setTreeCode(treeCode);
|
||||||
genTable.setTreeParentCode(treeParentCode);
|
genTable.setTreeParentCode(treeParentCode);
|
||||||
genTable.setTreeName(treeName);
|
genTable.setTreeName(treeName);
|
||||||
genTable.setParentMenuId(parentMenuId);
|
genTable.setParentMenuId(parentMenuId);
|
||||||
genTable.setParentMenuName(parentMenuName);
|
genTable.setParentMenuName(parentMenuName);
|
||||||
|
genTable.setView(isView);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -14,7 +14,7 @@ import com.ruoyi.gen.domain.GenTable;
|
|||||||
import com.ruoyi.gen.domain.GenTableColumn;
|
import com.ruoyi.gen.domain.GenTableColumn;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 模板工具类
|
* 模板处理工具类
|
||||||
*
|
*
|
||||||
* @author ruoyi
|
* @author ruoyi
|
||||||
*/
|
*/
|
||||||
@@ -60,6 +60,7 @@ public class VelocityUtils
|
|||||||
velocityContext.put("basePackage", getPackagePrefix(packageName));
|
velocityContext.put("basePackage", getPackagePrefix(packageName));
|
||||||
velocityContext.put("packageName", packageName);
|
velocityContext.put("packageName", packageName);
|
||||||
velocityContext.put("author", genTable.getFunctionAuthor());
|
velocityContext.put("author", genTable.getFunctionAuthor());
|
||||||
|
velocityContext.put("colSpan", getColSpan(genTable.getFormColNum()));
|
||||||
velocityContext.put("datetime", DateUtils.getDate());
|
velocityContext.put("datetime", DateUtils.getDate());
|
||||||
velocityContext.put("pkColumn", genTable.getPkColumn());
|
velocityContext.put("pkColumn", genTable.getPkColumn());
|
||||||
velocityContext.put("importList", getImportList(genTable));
|
velocityContext.put("importList", getImportList(genTable));
|
||||||
@@ -67,6 +68,7 @@ public class VelocityUtils
|
|||||||
velocityContext.put("columns", genTable.getColumns());
|
velocityContext.put("columns", genTable.getColumns());
|
||||||
velocityContext.put("table", genTable);
|
velocityContext.put("table", genTable);
|
||||||
velocityContext.put("dicts", getDicts(genTable));
|
velocityContext.put("dicts", getDicts(genTable));
|
||||||
|
setExtensionsContext(velocityContext, genTable.getOptions());
|
||||||
setMenuVelocityContext(velocityContext, genTable);
|
setMenuVelocityContext(velocityContext, genTable);
|
||||||
if (GenConstants.TPL_TREE.equals(tplCategory))
|
if (GenConstants.TPL_TREE.equals(tplCategory))
|
||||||
{
|
{
|
||||||
@@ -79,6 +81,13 @@ public class VelocityUtils
|
|||||||
return velocityContext;
|
return velocityContext;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public static void setExtensionsContext(VelocityContext context, String options)
|
||||||
|
{
|
||||||
|
JSONObject paramsObj = JSONObject.parseObject(options);
|
||||||
|
boolean genView = genView(paramsObj);
|
||||||
|
context.put("genView", genView);
|
||||||
|
}
|
||||||
|
|
||||||
public static void setMenuVelocityContext(VelocityContext context, GenTable genTable)
|
public static void setMenuVelocityContext(VelocityContext context, GenTable genTable)
|
||||||
{
|
{
|
||||||
String options = genTable.getOptions();
|
String options = genTable.getOptions();
|
||||||
@@ -133,8 +142,12 @@ public class VelocityUtils
|
|||||||
* @param tplWebType 前端类型
|
* @param tplWebType 前端类型
|
||||||
* @return 模板列表
|
* @return 模板列表
|
||||||
*/
|
*/
|
||||||
public static List<String> getTemplateList(String tplCategory, String tplWebType)
|
public static List<String> getTemplateList(GenTable table)
|
||||||
{
|
{
|
||||||
|
String tplWebType = table.getTplWebType();
|
||||||
|
String tplCategory = table.getTplCategory();
|
||||||
|
JSONObject paramsObj = JSONObject.parseObject(table.getOptions());
|
||||||
|
boolean isView = genView(paramsObj);
|
||||||
String useWebType = "vm/vue";
|
String useWebType = "vm/vue";
|
||||||
String apiTemplate = "vm/js/api.js.vm";
|
String apiTemplate = "vm/js/api.js.vm";
|
||||||
if (StringUtils.equals(ELEMENT_PLUS, tplWebType))
|
if (StringUtils.equals(ELEMENT_PLUS, tplWebType))
|
||||||
@@ -173,6 +186,10 @@ public class VelocityUtils
|
|||||||
templates.add(useWebType + "/index.vue.vm");
|
templates.add(useWebType + "/index.vue.vm");
|
||||||
templates.add("vm/java/sub-domain.java.vm");
|
templates.add("vm/java/sub-domain.java.vm");
|
||||||
}
|
}
|
||||||
|
if (isView)
|
||||||
|
{
|
||||||
|
templates.add(useWebType + "/view.vue.vm");
|
||||||
|
}
|
||||||
return templates;
|
return templates;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -252,6 +269,10 @@ public class VelocityUtils
|
|||||||
{
|
{
|
||||||
fileName = StringUtils.format("{}/views/{}/{}/index.vue", vuePath, moduleName, businessName);
|
fileName = StringUtils.format("{}/views/{}/{}/index.vue", vuePath, moduleName, businessName);
|
||||||
}
|
}
|
||||||
|
else if (template.contains("view.vue.vm"))
|
||||||
|
{
|
||||||
|
fileName = StringUtils.format("{}/views/{}/{}/view.vue", vuePath, moduleName, businessName);
|
||||||
|
}
|
||||||
return fileName;
|
return fileName;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -393,6 +414,21 @@ public class VelocityUtils
|
|||||||
return StringUtils.EMPTY;
|
return StringUtils.EMPTY;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 扩展功能/生成详情页
|
||||||
|
*
|
||||||
|
* @param paramsObj 生成其他选项
|
||||||
|
* @return 是否生成详细页
|
||||||
|
*/
|
||||||
|
public static boolean genView(JSONObject paramsObj)
|
||||||
|
{
|
||||||
|
if (StringUtils.isNotNull(paramsObj) && paramsObj.containsKey(GenConstants.GEN_VIEW))
|
||||||
|
{
|
||||||
|
return paramsObj.getBoolean(GenConstants.GEN_VIEW);
|
||||||
|
}
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 获取树名称
|
* 获取树名称
|
||||||
*
|
*
|
||||||
@@ -434,4 +470,23 @@ public class VelocityUtils
|
|||||||
}
|
}
|
||||||
return num;
|
return num;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 获取表单 el-col span
|
||||||
|
*
|
||||||
|
* @param formColNum 表单布局方式(1单列 2双列 3三列)
|
||||||
|
* @return span 数值字符串
|
||||||
|
*/
|
||||||
|
public static String getColSpan(int formColNum)
|
||||||
|
{
|
||||||
|
if (formColNum == 2)
|
||||||
|
{
|
||||||
|
return "12";
|
||||||
|
}
|
||||||
|
else if (formColNum == 3)
|
||||||
|
{
|
||||||
|
return "8";
|
||||||
|
}
|
||||||
|
return "24";
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -18,9 +18,8 @@ spring:
|
|||||||
config:
|
config:
|
||||||
# 配置中心地址
|
# 配置中心地址
|
||||||
server-addr: 127.0.0.1:8848
|
server-addr: 127.0.0.1:8848
|
||||||
config:
|
# 配置文件格式
|
||||||
# 配置文件格式
|
file-extension: yml
|
||||||
file-extension: yml
|
# 共享配置
|
||||||
import:
|
shared-configs:
|
||||||
- nacos:application-${spring.profiles.active}.${spring.config.file-extension}
|
- application-${spring.profiles.active}.${spring.cloud.nacos.config.file-extension}
|
||||||
- nacos:${spring.application.name}-${spring.profiles.active}.${spring.config.file-extension}
|
|
||||||
|
|||||||
@@ -94,6 +94,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|||||||
<set>
|
<set>
|
||||||
<if test="columnComment != null">column_comment = #{columnComment},</if>
|
<if test="columnComment != null">column_comment = #{columnComment},</if>
|
||||||
<if test="javaType != null">java_type = #{javaType},</if>
|
<if test="javaType != null">java_type = #{javaType},</if>
|
||||||
|
<if test="columnType != null">column_type = #{columnType},</if>
|
||||||
<if test="javaField != null">java_field = #{javaField},</if>
|
<if test="javaField != null">java_field = #{javaField},</if>
|
||||||
<if test="isInsert != null">is_insert = #{isInsert},</if>
|
<if test="isInsert != null">is_insert = #{isInsert},</if>
|
||||||
<if test="isEdit != null">is_edit = #{isEdit},</if>
|
<if test="isEdit != null">is_edit = #{isEdit},</if>
|
||||||
|
|||||||
@@ -18,6 +18,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|||||||
<result property="businessName" column="business_name" />
|
<result property="businessName" column="business_name" />
|
||||||
<result property="functionName" column="function_name" />
|
<result property="functionName" column="function_name" />
|
||||||
<result property="functionAuthor" column="function_author" />
|
<result property="functionAuthor" column="function_author" />
|
||||||
|
<result property="formColNum" column="form_col_num" />
|
||||||
<result property="genType" column="gen_type" />
|
<result property="genType" column="gen_type" />
|
||||||
<result property="genPath" column="gen_path" />
|
<result property="genPath" column="gen_path" />
|
||||||
<result property="options" column="options" />
|
<result property="options" column="options" />
|
||||||
@@ -55,7 +56,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|||||||
</resultMap>
|
</resultMap>
|
||||||
|
|
||||||
<sql id="selectGenTableVo">
|
<sql id="selectGenTableVo">
|
||||||
select table_id, table_name, table_comment, sub_table_name, sub_table_fk_name, class_name, tpl_category, tpl_web_type, package_name, module_name, business_name, function_name, function_author, gen_type, gen_path, options, create_by, create_time, update_by, update_time, remark from gen_table
|
select table_id, table_name, table_comment, sub_table_name, sub_table_fk_name, class_name, tpl_category, tpl_web_type, package_name, module_name, business_name, function_name, function_author, form_col_num, gen_type, gen_path, options, create_by, create_time, update_by, update_time, remark from gen_table
|
||||||
</sql>
|
</sql>
|
||||||
|
|
||||||
<select id="selectGenTableList" parameterType="GenTable" resultMap="GenTableResult">
|
<select id="selectGenTableList" parameterType="GenTable" resultMap="GenTableResult">
|
||||||
@@ -112,7 +113,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|||||||
</select>
|
</select>
|
||||||
|
|
||||||
<select id="selectGenTableById" parameterType="Long" resultMap="GenTableResult">
|
<select id="selectGenTableById" parameterType="Long" resultMap="GenTableResult">
|
||||||
SELECT t.table_id, t.table_name, t.table_comment, t.sub_table_name, t.sub_table_fk_name, t.class_name, t.tpl_category, t.tpl_web_type, t.package_name, t.module_name, t.business_name, t.function_name, t.function_author, t.gen_type, t.gen_path, t.options, t.remark,
|
SELECT t.table_id, t.table_name, t.table_comment, t.sub_table_name, t.sub_table_fk_name, t.class_name, t.tpl_category, t.tpl_web_type, t.package_name, t.module_name, t.business_name, t.function_name, t.function_author, t.form_col_num, t.gen_type, t.gen_path, t.options, t.remark,
|
||||||
c.column_id, c.column_name, c.column_comment, c.column_type, c.java_type, c.java_field, c.is_pk, c.is_increment, c.is_required, c.is_insert, c.is_edit, c.is_list, c.is_query, c.query_type, c.html_type, c.dict_type, c.sort
|
c.column_id, c.column_name, c.column_comment, c.column_type, c.java_type, c.java_field, c.is_pk, c.is_increment, c.is_required, c.is_insert, c.is_edit, c.is_list, c.is_query, c.query_type, c.html_type, c.dict_type, c.sort
|
||||||
FROM gen_table t
|
FROM gen_table t
|
||||||
LEFT JOIN gen_table_column c ON t.table_id = c.table_id
|
LEFT JOIN gen_table_column c ON t.table_id = c.table_id
|
||||||
@@ -120,7 +121,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|||||||
</select>
|
</select>
|
||||||
|
|
||||||
<select id="selectGenTableByName" parameterType="String" resultMap="GenTableResult">
|
<select id="selectGenTableByName" parameterType="String" resultMap="GenTableResult">
|
||||||
SELECT t.table_id, t.table_name, t.table_comment, t.sub_table_name, t.sub_table_fk_name, t.class_name, t.tpl_category, t.tpl_web_type, t.package_name, t.module_name, t.business_name, t.function_name, t.function_author, t.gen_type, t.gen_path, t.options, t.remark,
|
SELECT t.table_id, t.table_name, t.table_comment, t.sub_table_name, t.sub_table_fk_name, t.class_name, t.tpl_category, t.tpl_web_type, t.package_name, t.module_name, t.business_name, t.function_name, t.function_author, t.form_col_num, t.gen_type, t.gen_path, t.options, t.remark,
|
||||||
c.column_id, c.column_name, c.column_comment, c.column_type, c.java_type, c.java_field, c.is_pk, c.is_increment, c.is_required, c.is_insert, c.is_edit, c.is_list, c.is_query, c.query_type, c.html_type, c.dict_type, c.sort
|
c.column_id, c.column_name, c.column_comment, c.column_type, c.java_type, c.java_field, c.is_pk, c.is_increment, c.is_required, c.is_insert, c.is_edit, c.is_list, c.is_query, c.query_type, c.html_type, c.dict_type, c.sort
|
||||||
FROM gen_table t
|
FROM gen_table t
|
||||||
LEFT JOIN gen_table_column c ON t.table_id = c.table_id
|
LEFT JOIN gen_table_column c ON t.table_id = c.table_id
|
||||||
@@ -128,7 +129,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|||||||
</select>
|
</select>
|
||||||
|
|
||||||
<select id="selectGenTableAll" parameterType="String" resultMap="GenTableResult">
|
<select id="selectGenTableAll" parameterType="String" resultMap="GenTableResult">
|
||||||
SELECT t.table_id, t.table_name, t.table_comment, t.sub_table_name, t.sub_table_fk_name, t.class_name, t.tpl_category, t.tpl_web_type, t.package_name, t.module_name, t.business_name, t.function_name, t.function_author, t.options, t.remark,
|
SELECT t.table_id, t.table_name, t.table_comment, t.sub_table_name, t.sub_table_fk_name, t.class_name, t.tpl_category, t.tpl_web_type, t.package_name, t.module_name, t.business_name, t.function_name, t.function_author, t.form_col_num, t.options, t.remark,
|
||||||
c.column_id, c.column_name, c.column_comment, c.column_type, c.java_type, c.java_field, c.is_pk, c.is_increment, c.is_required, c.is_insert, c.is_edit, c.is_list, c.is_query, c.query_type, c.html_type, c.dict_type, c.sort
|
c.column_id, c.column_name, c.column_comment, c.column_type, c.java_type, c.java_field, c.is_pk, c.is_increment, c.is_required, c.is_insert, c.is_edit, c.is_list, c.is_query, c.query_type, c.html_type, c.dict_type, c.sort
|
||||||
FROM gen_table t
|
FROM gen_table t
|
||||||
LEFT JOIN gen_table_column c ON t.table_id = c.table_id
|
LEFT JOIN gen_table_column c ON t.table_id = c.table_id
|
||||||
@@ -147,6 +148,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|||||||
<if test="businessName != null and businessName != ''">business_name,</if>
|
<if test="businessName != null and businessName != ''">business_name,</if>
|
||||||
<if test="functionName != null and functionName != ''">function_name,</if>
|
<if test="functionName != null and functionName != ''">function_name,</if>
|
||||||
<if test="functionAuthor != null and functionAuthor != ''">function_author,</if>
|
<if test="functionAuthor != null and functionAuthor != ''">function_author,</if>
|
||||||
|
<if test="formColNum != null">form_col_num,</if>
|
||||||
<if test="genType != null and genType != ''">gen_type,</if>
|
<if test="genType != null and genType != ''">gen_type,</if>
|
||||||
<if test="genPath != null and genPath != ''">gen_path,</if>
|
<if test="genPath != null and genPath != ''">gen_path,</if>
|
||||||
<if test="remark != null and remark != ''">remark,</if>
|
<if test="remark != null and remark != ''">remark,</if>
|
||||||
@@ -163,6 +165,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|||||||
<if test="businessName != null and businessName != ''">#{businessName},</if>
|
<if test="businessName != null and businessName != ''">#{businessName},</if>
|
||||||
<if test="functionName != null and functionName != ''">#{functionName},</if>
|
<if test="functionName != null and functionName != ''">#{functionName},</if>
|
||||||
<if test="functionAuthor != null and functionAuthor != ''">#{functionAuthor},</if>
|
<if test="functionAuthor != null and functionAuthor != ''">#{functionAuthor},</if>
|
||||||
|
<if test="formColNum != null">#{formColNum},</if>
|
||||||
<if test="genType != null and genType != ''">#{genType},</if>
|
<if test="genType != null and genType != ''">#{genType},</if>
|
||||||
<if test="genPath != null and genPath != ''">#{genPath},</if>
|
<if test="genPath != null and genPath != ''">#{genPath},</if>
|
||||||
<if test="remark != null and remark != ''">#{remark},</if>
|
<if test="remark != null and remark != ''">#{remark},</if>
|
||||||
@@ -180,6 +183,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|||||||
<if test="subTableFkName != null">sub_table_fk_name = #{subTableFkName},</if>
|
<if test="subTableFkName != null">sub_table_fk_name = #{subTableFkName},</if>
|
||||||
<if test="className != null and className != ''">class_name = #{className},</if>
|
<if test="className != null and className != ''">class_name = #{className},</if>
|
||||||
<if test="functionAuthor != null and functionAuthor != ''">function_author = #{functionAuthor},</if>
|
<if test="functionAuthor != null and functionAuthor != ''">function_author = #{functionAuthor},</if>
|
||||||
|
<if test="formColNum != null">form_col_num = #{formColNum},</if>
|
||||||
<if test="genType != null and genType != ''">gen_type = #{genType},</if>
|
<if test="genType != null and genType != ''">gen_type = #{genType},</if>
|
||||||
<if test="genPath != null and genPath != ''">gen_path = #{genPath},</if>
|
<if test="genPath != null and genPath != ''">gen_path = #{genPath},</if>
|
||||||
<if test="tplCategory != null and tplCategory != ''">tpl_category = #{tplCategory},</if>
|
<if test="tplCategory != null and tplCategory != ''">tpl_category = #{tplCategory},</if>
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
package ${packageName}.controller;
|
package ${packageName}.controller;
|
||||||
|
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
import jakarta.servlet.http.HttpServletResponse;
|
import javax.servlet.http.HttpServletResponse;
|
||||||
import org.springframework.beans.factory.annotation.Autowired;
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
import org.springframework.web.bind.annotation.GetMapping;
|
import org.springframework.web.bind.annotation.GetMapping;
|
||||||
import org.springframework.web.bind.annotation.PostMapping;
|
import org.springframework.web.bind.annotation.PostMapping;
|
||||||
|
|||||||
@@ -139,6 +139,15 @@
|
|||||||
#end
|
#end
|
||||||
<el-table-column label="操作" align="center" class-name="small-padding fixed-width">
|
<el-table-column label="操作" align="center" class-name="small-padding fixed-width">
|
||||||
<template slot-scope="scope">
|
<template slot-scope="scope">
|
||||||
|
#if($genView)
|
||||||
|
<el-button
|
||||||
|
size="mini"
|
||||||
|
type="text"
|
||||||
|
icon="el-icon-view"
|
||||||
|
@click="handleViewData(scope.row)"
|
||||||
|
v-hasPermi="['${permissionPrefix}:query']"
|
||||||
|
>详情</el-button>
|
||||||
|
#end
|
||||||
<el-button
|
<el-button
|
||||||
size="mini"
|
size="mini"
|
||||||
type="text"
|
type="text"
|
||||||
@@ -164,9 +173,21 @@
|
|||||||
</el-table-column>
|
</el-table-column>
|
||||||
</el-table>
|
</el-table>
|
||||||
|
|
||||||
|
#if($genView)
|
||||||
|
<!-- ${functionName}详情抽屉 -->
|
||||||
|
<${businessName}-view-drawer ref="${businessName}ViewRef" />
|
||||||
|
#end
|
||||||
<!-- 添加或修改${functionName}对话框 -->
|
<!-- 添加或修改${functionName}对话框 -->
|
||||||
<el-dialog :title="title" :visible.sync="open" width="500px" append-to-body>
|
#if($table.formColNum == 2)
|
||||||
<el-form ref="form" :model="form" :rules="rules" label-width="80px">
|
#set($dialogWidth = "800px")
|
||||||
|
#elseif($table.formColNum == 3)
|
||||||
|
#set($dialogWidth = "1100px")
|
||||||
|
#else
|
||||||
|
#set($dialogWidth = "500px")
|
||||||
|
#end
|
||||||
|
<el-dialog :title="title" :visible.sync="open" width="${dialogWidth}" append-to-body>
|
||||||
|
<el-form ref="form" :model="form" :rules="rules" label-width="100px">
|
||||||
|
<el-row>
|
||||||
#foreach($column in $columns)
|
#foreach($column in $columns)
|
||||||
#set($field=$column.javaField)
|
#set($field=$column.javaField)
|
||||||
#if($column.insert && !$column.pk)
|
#if($column.insert && !$column.pk)
|
||||||
@@ -179,100 +200,127 @@
|
|||||||
#end
|
#end
|
||||||
#set($dictType=$column.dictType)
|
#set($dictType=$column.dictType)
|
||||||
#if("" != $treeParentCode && $column.javaField == $treeParentCode)
|
#if("" != $treeParentCode && $column.javaField == $treeParentCode)
|
||||||
<el-form-item label="${comment}" prop="${treeParentCode}">
|
<el-col :span="${colSpan}">
|
||||||
<treeselect v-model="form.${treeParentCode}" :options="${businessName}Options" :normalizer="normalizer" placeholder="请选择${comment}" />
|
<el-form-item label="${comment}" prop="${treeParentCode}">
|
||||||
</el-form-item>
|
<treeselect v-model="form.${treeParentCode}" :options="${businessName}Options" :normalizer="normalizer" placeholder="请选择${comment}" />
|
||||||
|
</el-form-item>
|
||||||
|
</el-col>
|
||||||
#elseif($column.htmlType == "input")
|
#elseif($column.htmlType == "input")
|
||||||
<el-form-item label="${comment}" prop="${field}">
|
<el-col :span="${colSpan}">
|
||||||
<el-input v-model="form.${field}" placeholder="请输入${comment}" />
|
<el-form-item label="${comment}" prop="${field}">
|
||||||
</el-form-item>
|
<el-input v-model="form.${field}" placeholder="请输入${comment}" />
|
||||||
|
</el-form-item>
|
||||||
|
</el-col>
|
||||||
#elseif($column.htmlType == "imageUpload")
|
#elseif($column.htmlType == "imageUpload")
|
||||||
<el-form-item label="${comment}" prop="${field}">
|
<el-col :span="${colSpan}">
|
||||||
<image-upload v-model="form.${field}"/>
|
<el-form-item label="${comment}" prop="${field}">
|
||||||
</el-form-item>
|
<image-upload v-model="form.${field}"/>
|
||||||
|
</el-form-item>
|
||||||
|
</el-col>
|
||||||
#elseif($column.htmlType == "fileUpload")
|
#elseif($column.htmlType == "fileUpload")
|
||||||
<el-form-item label="${comment}" prop="${field}">
|
<el-col :span="${colSpan}">
|
||||||
<file-upload v-model="form.${field}"/>
|
<el-form-item label="${comment}" prop="${field}">
|
||||||
</el-form-item>
|
<file-upload v-model="form.${field}"/>
|
||||||
|
</el-form-item>
|
||||||
|
</el-col>
|
||||||
#elseif($column.htmlType == "editor")
|
#elseif($column.htmlType == "editor")
|
||||||
<el-form-item label="${comment}">
|
<el-col :span="24">
|
||||||
<editor v-model="form.${field}" :min-height="192"/>
|
<el-form-item label="${comment}">
|
||||||
</el-form-item>
|
<editor v-model="form.${field}" :min-height="192"/>
|
||||||
|
</el-form-item>
|
||||||
|
</el-col>
|
||||||
#elseif($column.htmlType == "select" && "" != $dictType)
|
#elseif($column.htmlType == "select" && "" != $dictType)
|
||||||
<el-form-item label="${comment}" prop="${field}">
|
<el-col :span="${colSpan}">
|
||||||
<el-select v-model="form.${field}" placeholder="请选择${comment}">
|
<el-form-item label="${comment}" prop="${field}">
|
||||||
<el-option
|
<el-select v-model="form.${field}" placeholder="请选择${comment}">
|
||||||
v-for="dict in dict.type.${dictType}"
|
<el-option
|
||||||
:key="dict.value"
|
v-for="dict in dict.type.${dictType}"
|
||||||
:label="dict.label"
|
:key="dict.value"
|
||||||
|
:label="dict.label"
|
||||||
#if($column.javaType == "Integer" || $column.javaType == "Long")
|
#if($column.javaType == "Integer" || $column.javaType == "Long")
|
||||||
:value="parseInt(dict.value)"
|
:value="parseInt(dict.value)"
|
||||||
#else
|
#else
|
||||||
:value="dict.value"
|
:value="dict.value"
|
||||||
#end
|
#end
|
||||||
></el-option>
|
></el-option>
|
||||||
</el-select>
|
</el-select>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
|
</el-col>
|
||||||
#elseif($column.htmlType == "select" && $dictType)
|
#elseif($column.htmlType == "select" && $dictType)
|
||||||
<el-form-item label="${comment}" prop="${field}">
|
<el-col :span="${colSpan}">
|
||||||
<el-select v-model="form.${field}" placeholder="请选择${comment}">
|
<el-form-item label="${comment}" prop="${field}">
|
||||||
<el-option label="请选择字典生成" value="" />
|
<el-select v-model="form.${field}" placeholder="请选择${comment}">
|
||||||
</el-select>
|
<el-option label="请选择字典生成" value="" />
|
||||||
</el-form-item>
|
</el-select>
|
||||||
|
</el-form-item>
|
||||||
|
</el-col>
|
||||||
#elseif($column.htmlType == "checkbox" && "" != $dictType)
|
#elseif($column.htmlType == "checkbox" && "" != $dictType)
|
||||||
<el-form-item label="${comment}" prop="${field}">
|
<el-col :span="${colSpan}">
|
||||||
<el-checkbox-group v-model="form.${field}">
|
<el-form-item label="${comment}" prop="${field}">
|
||||||
<el-checkbox
|
<el-checkbox-group v-model="form.${field}">
|
||||||
v-for="dict in dict.type.${dictType}"
|
<el-checkbox
|
||||||
:key="dict.value"
|
v-for="dict in dict.type.${dictType}"
|
||||||
:label="dict.value">
|
:key="dict.value"
|
||||||
{{dict.label}}
|
:label="dict.value">
|
||||||
</el-checkbox>
|
{{dict.label}}
|
||||||
</el-checkbox-group>
|
</el-checkbox>
|
||||||
</el-form-item>
|
</el-checkbox-group>
|
||||||
|
</el-form-item>
|
||||||
|
</el-col>
|
||||||
#elseif($column.htmlType == "checkbox" && $dictType)
|
#elseif($column.htmlType == "checkbox" && $dictType)
|
||||||
<el-form-item label="${comment}" prop="${field}">
|
<el-col :span="${colSpan}">
|
||||||
<el-checkbox-group v-model="form.${field}">
|
<el-form-item label="${comment}" prop="${field}">
|
||||||
<el-checkbox>请选择字典生成</el-checkbox>
|
<el-checkbox-group v-model="form.${field}">
|
||||||
</el-checkbox-group>
|
<el-checkbox>请选择字典生成</el-checkbox>
|
||||||
</el-form-item>
|
</el-checkbox-group>
|
||||||
|
</el-form-item>
|
||||||
|
</el-col>
|
||||||
#elseif($column.htmlType == "radio" && "" != $dictType)
|
#elseif($column.htmlType == "radio" && "" != $dictType)
|
||||||
<el-form-item label="${comment}" prop="${field}">
|
<el-col :span="${colSpan}">
|
||||||
<el-radio-group v-model="form.${field}">
|
<el-form-item label="${comment}" prop="${field}">
|
||||||
<el-radio
|
<el-radio-group v-model="form.${field}">
|
||||||
v-for="dict in dict.type.${dictType}"
|
<el-radio
|
||||||
:key="dict.value"
|
v-for="dict in dict.type.${dictType}"
|
||||||
|
:key="dict.value"
|
||||||
#if($column.javaType == "Integer" || $column.javaType == "Long")
|
#if($column.javaType == "Integer" || $column.javaType == "Long")
|
||||||
:label="parseInt(dict.value)"
|
:label="parseInt(dict.value)"
|
||||||
#else
|
#else
|
||||||
:label="dict.value"
|
:label="dict.value"
|
||||||
#end
|
#end
|
||||||
>{{dict.label}}</el-radio>
|
>{{dict.label}}</el-radio>
|
||||||
</el-radio-group>
|
</el-radio-group>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
|
</el-col>
|
||||||
#elseif($column.htmlType == "radio" && $dictType)
|
#elseif($column.htmlType == "radio" && $dictType)
|
||||||
<el-form-item label="${comment}" prop="${field}">
|
<el-col :span="${colSpan}">
|
||||||
<el-radio-group v-model="form.${field}">
|
<el-form-item label="${comment}" prop="${field}">
|
||||||
<el-radio label="1">请选择字典生成</el-radio>
|
<el-radio-group v-model="form.${field}">
|
||||||
</el-radio-group>
|
<el-radio label="1">请选择字典生成</el-radio>
|
||||||
</el-form-item>
|
</el-radio-group>
|
||||||
|
</el-form-item>
|
||||||
|
</el-col>
|
||||||
#elseif($column.htmlType == "datetime")
|
#elseif($column.htmlType == "datetime")
|
||||||
<el-form-item label="${comment}" prop="${field}">
|
<el-col :span="${colSpan}">
|
||||||
<el-date-picker clearable
|
<el-form-item label="${comment}" prop="${field}">
|
||||||
v-model="form.${field}"
|
<el-date-picker clearable
|
||||||
type="date"
|
v-model="form.${field}"
|
||||||
value-format="yyyy-MM-dd"
|
type="date"
|
||||||
placeholder="选择${comment}">
|
value-format="yyyy-MM-dd"
|
||||||
</el-date-picker>
|
placeholder="选择${comment}">
|
||||||
</el-form-item>
|
</el-date-picker>
|
||||||
|
</el-form-item>
|
||||||
|
</el-col>
|
||||||
#elseif($column.htmlType == "textarea")
|
#elseif($column.htmlType == "textarea")
|
||||||
<el-form-item label="${comment}" prop="${field}">
|
<el-col :span="24">
|
||||||
<el-input v-model="form.${field}" type="textarea" placeholder="请输入内容" />
|
<el-form-item label="${comment}" prop="${field}">
|
||||||
</el-form-item>
|
<el-input v-model="form.${field}" type="textarea" placeholder="请输入内容" />
|
||||||
|
</el-form-item>
|
||||||
|
</el-col>
|
||||||
#end
|
#end
|
||||||
#end
|
#end
|
||||||
#end
|
#end
|
||||||
#end
|
#end
|
||||||
|
</el-row>
|
||||||
</el-form>
|
</el-form>
|
||||||
<div slot="footer" class="dialog-footer">
|
<div slot="footer" class="dialog-footer">
|
||||||
<el-button type="primary" @click="submitForm">确 定</el-button>
|
<el-button type="primary" @click="submitForm">确 定</el-button>
|
||||||
@@ -284,6 +332,9 @@
|
|||||||
|
|
||||||
<script>
|
<script>
|
||||||
import { list${BusinessName}, get${BusinessName}, del${BusinessName}, add${BusinessName}, update${BusinessName} } from "@/api/${moduleName}/${businessName}"
|
import { list${BusinessName}, get${BusinessName}, del${BusinessName}, add${BusinessName}, update${BusinessName} } from "@/api/${moduleName}/${businessName}"
|
||||||
|
#if($genView)
|
||||||
|
import ${BusinessName}ViewDrawer from "./view"
|
||||||
|
#end
|
||||||
import Treeselect from "@riophae/vue-treeselect"
|
import Treeselect from "@riophae/vue-treeselect"
|
||||||
import "@riophae/vue-treeselect/dist/vue-treeselect.css"
|
import "@riophae/vue-treeselect/dist/vue-treeselect.css"
|
||||||
|
|
||||||
@@ -293,6 +344,9 @@ export default {
|
|||||||
dicts: [${dicts}],
|
dicts: [${dicts}],
|
||||||
#end
|
#end
|
||||||
components: {
|
components: {
|
||||||
|
#if($genView)
|
||||||
|
${BusinessName}ViewDrawer,
|
||||||
|
#end
|
||||||
Treeselect
|
Treeselect
|
||||||
},
|
},
|
||||||
data() {
|
data() {
|
||||||
@@ -448,6 +502,12 @@ export default {
|
|||||||
this.refreshTable = true
|
this.refreshTable = true
|
||||||
})
|
})
|
||||||
},
|
},
|
||||||
|
#if($genView)
|
||||||
|
/** 详情按钮操作 */
|
||||||
|
handleViewData(row) {
|
||||||
|
this.#[[$]]#refs["${businessName}ViewRef"].open(row.${pkColumn.javaField})
|
||||||
|
},
|
||||||
|
#end
|
||||||
/** 修改按钮操作 */
|
/** 修改按钮操作 */
|
||||||
handleUpdate(row) {
|
handleUpdate(row) {
|
||||||
this.reset()
|
this.reset()
|
||||||
|
|||||||
@@ -153,6 +153,15 @@
|
|||||||
#end
|
#end
|
||||||
<el-table-column label="操作" align="center" class-name="small-padding fixed-width">
|
<el-table-column label="操作" align="center" class-name="small-padding fixed-width">
|
||||||
<template slot-scope="scope">
|
<template slot-scope="scope">
|
||||||
|
#if($genView)
|
||||||
|
<el-button
|
||||||
|
size="mini"
|
||||||
|
type="text"
|
||||||
|
icon="el-icon-view"
|
||||||
|
@click="handleViewData(scope.row)"
|
||||||
|
v-hasPermi="['${permissionPrefix}:query']"
|
||||||
|
>详情</el-button>
|
||||||
|
#end
|
||||||
<el-button
|
<el-button
|
||||||
size="mini"
|
size="mini"
|
||||||
type="text"
|
type="text"
|
||||||
@@ -179,9 +188,21 @@
|
|||||||
@pagination="getList"
|
@pagination="getList"
|
||||||
/>
|
/>
|
||||||
|
|
||||||
|
#if($genView)
|
||||||
|
<!-- ${functionName}详情抽屉 -->
|
||||||
|
<${businessName}-view-drawer ref="${businessName}ViewRef" />
|
||||||
|
#end
|
||||||
<!-- 添加或修改${functionName}对话框 -->
|
<!-- 添加或修改${functionName}对话框 -->
|
||||||
<el-dialog :title="title" :visible.sync="open" width="500px" append-to-body>
|
#if($table.formColNum == 2)
|
||||||
<el-form ref="form" :model="form" :rules="rules" label-width="80px">
|
#set($dialogWidth = "800px")
|
||||||
|
#elseif($table.formColNum == 3)
|
||||||
|
#set($dialogWidth = "1100px")
|
||||||
|
#else
|
||||||
|
#set($dialogWidth = "500px")
|
||||||
|
#end
|
||||||
|
<el-dialog :title="title" :visible.sync="open" width="${dialogWidth}" append-to-body>
|
||||||
|
<el-form ref="form" :model="form" :rules="rules" label-width="100px">
|
||||||
|
<el-row>
|
||||||
#foreach($column in $columns)
|
#foreach($column in $columns)
|
||||||
#set($field=$column.javaField)
|
#set($field=$column.javaField)
|
||||||
#if($column.insert && !$column.pk)
|
#if($column.insert && !$column.pk)
|
||||||
@@ -194,96 +215,121 @@
|
|||||||
#end
|
#end
|
||||||
#set($dictType=$column.dictType)
|
#set($dictType=$column.dictType)
|
||||||
#if($column.htmlType == "input")
|
#if($column.htmlType == "input")
|
||||||
<el-form-item label="${comment}" prop="${field}">
|
<el-col :span="${colSpan}">
|
||||||
<el-input v-model="form.${field}" placeholder="请输入${comment}" />
|
<el-form-item label="${comment}" prop="${field}">
|
||||||
</el-form-item>
|
<el-input v-model="form.${field}" placeholder="请输入${comment}" />
|
||||||
|
</el-form-item>
|
||||||
|
</el-col>
|
||||||
#elseif($column.htmlType == "imageUpload")
|
#elseif($column.htmlType == "imageUpload")
|
||||||
<el-form-item label="${comment}" prop="${field}">
|
<el-col :span="${colSpan}">
|
||||||
<image-upload v-model="form.${field}"/>
|
<el-form-item label="${comment}" prop="${field}">
|
||||||
</el-form-item>
|
<image-upload v-model="form.${field}"/>
|
||||||
|
</el-form-item>
|
||||||
|
</el-col>
|
||||||
#elseif($column.htmlType == "fileUpload")
|
#elseif($column.htmlType == "fileUpload")
|
||||||
<el-form-item label="${comment}" prop="${field}">
|
<el-col :span="${colSpan}">
|
||||||
<file-upload v-model="form.${field}"/>
|
<el-form-item label="${comment}" prop="${field}">
|
||||||
</el-form-item>
|
<file-upload v-model="form.${field}"/>
|
||||||
|
</el-form-item>
|
||||||
|
</el-col>
|
||||||
#elseif($column.htmlType == "editor")
|
#elseif($column.htmlType == "editor")
|
||||||
<el-form-item label="${comment}">
|
<el-col :span="24">
|
||||||
<editor v-model="form.${field}" :min-height="192"/>
|
<el-form-item label="${comment}">
|
||||||
</el-form-item>
|
<editor v-model="form.${field}" :min-height="192"/>
|
||||||
|
</el-form-item>
|
||||||
|
</el-col>
|
||||||
#elseif($column.htmlType == "select" && "" != $dictType)
|
#elseif($column.htmlType == "select" && "" != $dictType)
|
||||||
<el-form-item label="${comment}" prop="${field}">
|
<el-col :span="${colSpan}">
|
||||||
<el-select v-model="form.${field}" placeholder="请选择${comment}">
|
<el-form-item label="${comment}" prop="${field}">
|
||||||
<el-option
|
<el-select v-model="form.${field}" placeholder="请选择${comment}">
|
||||||
v-for="dict in dict.type.${dictType}"
|
<el-option
|
||||||
:key="dict.value"
|
v-for="dict in dict.type.${dictType}"
|
||||||
:label="dict.label"
|
:key="dict.value"
|
||||||
|
:label="dict.label"
|
||||||
#if($column.javaType == "Integer" || $column.javaType == "Long")
|
#if($column.javaType == "Integer" || $column.javaType == "Long")
|
||||||
:value="parseInt(dict.value)"
|
:value="parseInt(dict.value)"
|
||||||
#else
|
#else
|
||||||
:value="dict.value"
|
:value="dict.value"
|
||||||
#end
|
#end
|
||||||
></el-option>
|
></el-option>
|
||||||
</el-select>
|
</el-select>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
|
</el-col>
|
||||||
#elseif($column.htmlType == "select" && $dictType)
|
#elseif($column.htmlType == "select" && $dictType)
|
||||||
<el-form-item label="${comment}" prop="${field}">
|
<el-col :span="${colSpan}">
|
||||||
<el-select v-model="form.${field}" placeholder="请选择${comment}">
|
<el-form-item label="${comment}" prop="${field}">
|
||||||
<el-option label="请选择字典生成" value="" />
|
<el-select v-model="form.${field}" placeholder="请选择${comment}">
|
||||||
</el-select>
|
<el-option label="请选择字典生成" value="" />
|
||||||
</el-form-item>
|
</el-select>
|
||||||
|
</el-form-item>
|
||||||
|
</el-col>
|
||||||
#elseif($column.htmlType == "checkbox" && "" != $dictType)
|
#elseif($column.htmlType == "checkbox" && "" != $dictType)
|
||||||
<el-form-item label="${comment}" prop="${field}">
|
<el-col :span="${colSpan}">
|
||||||
<el-checkbox-group v-model="form.${field}">
|
<el-form-item label="${comment}" prop="${field}">
|
||||||
<el-checkbox
|
<el-checkbox-group v-model="form.${field}">
|
||||||
v-for="dict in dict.type.${dictType}"
|
<el-checkbox
|
||||||
:key="dict.value"
|
v-for="dict in dict.type.${dictType}"
|
||||||
:label="dict.value">
|
:key="dict.value"
|
||||||
{{dict.label}}
|
:label="dict.value">
|
||||||
</el-checkbox>
|
{{dict.label}}
|
||||||
</el-checkbox-group>
|
</el-checkbox>
|
||||||
</el-form-item>
|
</el-checkbox-group>
|
||||||
|
</el-form-item>
|
||||||
|
</el-col>
|
||||||
#elseif($column.htmlType == "checkbox" && $dictType)
|
#elseif($column.htmlType == "checkbox" && $dictType)
|
||||||
<el-form-item label="${comment}" prop="${field}">
|
<el-col :span="${colSpan}">
|
||||||
<el-checkbox-group v-model="form.${field}">
|
<el-form-item label="${comment}" prop="${field}">
|
||||||
<el-checkbox>请选择字典生成</el-checkbox>
|
<el-checkbox-group v-model="form.${field}">
|
||||||
</el-checkbox-group>
|
<el-checkbox>请选择字典生成</el-checkbox>
|
||||||
</el-form-item>
|
</el-checkbox-group>
|
||||||
|
</el-form-item>
|
||||||
|
</el-col>
|
||||||
#elseif($column.htmlType == "radio" && "" != $dictType)
|
#elseif($column.htmlType == "radio" && "" != $dictType)
|
||||||
<el-form-item label="${comment}" prop="${field}">
|
<el-col :span="${colSpan}">
|
||||||
<el-radio-group v-model="form.${field}">
|
<el-form-item label="${comment}" prop="${field}">
|
||||||
<el-radio
|
<el-radio-group v-model="form.${field}">
|
||||||
v-for="dict in dict.type.${dictType}"
|
<el-radio
|
||||||
:key="dict.value"
|
v-for="dict in dict.type.${dictType}"
|
||||||
|
:key="dict.value"
|
||||||
#if($column.javaType == "Integer" || $column.javaType == "Long")
|
#if($column.javaType == "Integer" || $column.javaType == "Long")
|
||||||
:label="parseInt(dict.value)"
|
:label="parseInt(dict.value)"
|
||||||
#else
|
#else
|
||||||
:label="dict.value"
|
:label="dict.value"
|
||||||
#end
|
#end
|
||||||
>{{dict.label}}</el-radio>
|
>{{dict.label}}</el-radio>
|
||||||
</el-radio-group>
|
</el-radio-group>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
|
</el-col>
|
||||||
#elseif($column.htmlType == "radio" && $dictType)
|
#elseif($column.htmlType == "radio" && $dictType)
|
||||||
<el-form-item label="${comment}" prop="${field}">
|
<el-col :span="${colSpan}">
|
||||||
<el-radio-group v-model="form.${field}">
|
<el-form-item label="${comment}" prop="${field}">
|
||||||
<el-radio label="1">请选择字典生成</el-radio>
|
<el-radio-group v-model="form.${field}">
|
||||||
</el-radio-group>
|
<el-radio label="1">请选择字典生成</el-radio>
|
||||||
</el-form-item>
|
</el-radio-group>
|
||||||
|
</el-form-item>
|
||||||
|
</el-col>
|
||||||
#elseif($column.htmlType == "datetime")
|
#elseif($column.htmlType == "datetime")
|
||||||
<el-form-item label="${comment}" prop="${field}">
|
<el-col :span="${colSpan}">
|
||||||
<el-date-picker clearable
|
<el-form-item label="${comment}" prop="${field}">
|
||||||
v-model="form.${field}"
|
<el-date-picker clearable
|
||||||
type="date"
|
v-model="form.${field}"
|
||||||
value-format="yyyy-MM-dd"
|
type="date"
|
||||||
placeholder="请选择${comment}">
|
value-format="yyyy-MM-dd"
|
||||||
</el-date-picker>
|
placeholder="请选择${comment}">
|
||||||
</el-form-item>
|
</el-date-picker>
|
||||||
|
</el-form-item>
|
||||||
|
</el-col>
|
||||||
#elseif($column.htmlType == "textarea")
|
#elseif($column.htmlType == "textarea")
|
||||||
<el-form-item label="${comment}" prop="${field}">
|
<el-col :span="24">
|
||||||
<el-input v-model="form.${field}" type="textarea" placeholder="请输入内容" />
|
<el-form-item label="${comment}" prop="${field}">
|
||||||
</el-form-item>
|
<el-input v-model="form.${field}" type="textarea" placeholder="请输入内容" />
|
||||||
|
</el-form-item>
|
||||||
|
</el-col>
|
||||||
#end
|
#end
|
||||||
#end
|
#end
|
||||||
#end
|
#end
|
||||||
#end
|
#end
|
||||||
|
</el-row>
|
||||||
#if($table.sub)
|
#if($table.sub)
|
||||||
<el-divider content-position="center">${subTable.functionName}信息</el-divider>
|
<el-divider content-position="center">${subTable.functionName}信息</el-divider>
|
||||||
<el-row :gutter="10" class="mb8">
|
<el-row :gutter="10" class="mb8">
|
||||||
@@ -354,9 +400,15 @@
|
|||||||
|
|
||||||
<script>
|
<script>
|
||||||
import { list${BusinessName}, get${BusinessName}, del${BusinessName}, add${BusinessName}, update${BusinessName} } from "@/api/${moduleName}/${businessName}"
|
import { list${BusinessName}, get${BusinessName}, del${BusinessName}, add${BusinessName}, update${BusinessName} } from "@/api/${moduleName}/${businessName}"
|
||||||
|
#if($genView)
|
||||||
|
import ${BusinessName}ViewDrawer from "./view"
|
||||||
|
#end
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
name: "${BusinessName}",
|
name: "${BusinessName}",
|
||||||
|
#if($genView)
|
||||||
|
components: { ${BusinessName}ViewDrawer },
|
||||||
|
#end
|
||||||
#if(${dicts} != '')
|
#if(${dicts} != '')
|
||||||
dicts: [${dicts}],
|
dicts: [${dicts}],
|
||||||
#end
|
#end
|
||||||
@@ -493,7 +545,7 @@ export default {
|
|||||||
// 多选框选中数据
|
// 多选框选中数据
|
||||||
handleSelectionChange(selection) {
|
handleSelectionChange(selection) {
|
||||||
this.ids = selection.map(item => item.${pkColumn.javaField})
|
this.ids = selection.map(item => item.${pkColumn.javaField})
|
||||||
this.single = selection.length!==1
|
this.single = selection.length !== 1
|
||||||
this.multiple = !selection.length
|
this.multiple = !selection.length
|
||||||
},
|
},
|
||||||
/** 新增按钮操作 */
|
/** 新增按钮操作 */
|
||||||
@@ -590,6 +642,12 @@ export default {
|
|||||||
handle${subClassName}SelectionChange(selection) {
|
handle${subClassName}SelectionChange(selection) {
|
||||||
this.checked${subClassName} = selection.map(item => item.index)
|
this.checked${subClassName} = selection.map(item => item.index)
|
||||||
},
|
},
|
||||||
|
#end
|
||||||
|
#if($genView)
|
||||||
|
/** 详情按钮操作 */
|
||||||
|
handleViewData(row) {
|
||||||
|
this.#[[$]]#refs["${businessName}ViewRef"].open(row.${pkColumn.javaField})
|
||||||
|
},
|
||||||
#end
|
#end
|
||||||
/** 导出按钮操作 */
|
/** 导出按钮操作 */
|
||||||
handleExport() {
|
handleExport() {
|
||||||
|
|||||||
@@ -136,6 +136,9 @@
|
|||||||
#end
|
#end
|
||||||
<el-table-column label="操作" align="center" class-name="small-padding fixed-width">
|
<el-table-column label="操作" align="center" class-name="small-padding fixed-width">
|
||||||
<template #default="scope">
|
<template #default="scope">
|
||||||
|
#if($genView)
|
||||||
|
<el-button link type="primary" icon="View" @click="handleViewData(scope.row)" v-hasPermi="['${permissionPrefix}:query']">详情</el-button>
|
||||||
|
#end
|
||||||
<el-button link type="primary" icon="Edit" @click="handleUpdate(scope.row)" v-hasPermi="['${permissionPrefix}:edit']">修改</el-button>
|
<el-button link type="primary" icon="Edit" @click="handleUpdate(scope.row)" v-hasPermi="['${permissionPrefix}:edit']">修改</el-button>
|
||||||
<el-button link type="primary" icon="Plus" @click="handleAdd(scope.row)" v-hasPermi="['${permissionPrefix}:add']">新增</el-button>
|
<el-button link type="primary" icon="Plus" @click="handleAdd(scope.row)" v-hasPermi="['${permissionPrefix}:add']">新增</el-button>
|
||||||
<el-button link type="primary" icon="Delete" @click="handleDelete(scope.row)" v-hasPermi="['${permissionPrefix}:remove']">删除</el-button>
|
<el-button link type="primary" icon="Delete" @click="handleDelete(scope.row)" v-hasPermi="['${permissionPrefix}:remove']">删除</el-button>
|
||||||
@@ -143,9 +146,21 @@
|
|||||||
</el-table-column>
|
</el-table-column>
|
||||||
</el-table>
|
</el-table>
|
||||||
|
|
||||||
|
#if($genView)
|
||||||
|
<!-- ${functionName}详情抽屉 -->
|
||||||
|
<${businessName}-view-drawer ref="${businessName}ViewRef" />
|
||||||
|
#end
|
||||||
<!-- 添加或修改${functionName}对话框 -->
|
<!-- 添加或修改${functionName}对话框 -->
|
||||||
<el-dialog :title="title" v-model="open" width="500px" append-to-body>
|
#if($table.formColNum == 2)
|
||||||
<el-form ref="${businessName}Ref" :model="form" :rules="rules" label-width="80px">
|
#set($dialogWidth = "800px")
|
||||||
|
#elseif($table.formColNum == 3)
|
||||||
|
#set($dialogWidth = "1100px")
|
||||||
|
#else
|
||||||
|
#set($dialogWidth = "500px")
|
||||||
|
#end
|
||||||
|
<el-dialog :title="title" v-model="open" width="${dialogWidth}" append-to-body>
|
||||||
|
<el-form ref="${businessName}Ref" :model="form" :rules="rules" label-width="100px">
|
||||||
|
<el-row>
|
||||||
#foreach($column in $columns)
|
#foreach($column in $columns)
|
||||||
#set($field=$column.javaField)
|
#set($field=$column.javaField)
|
||||||
#if($column.insert && !$column.pk)
|
#if($column.insert && !$column.pk)
|
||||||
@@ -158,107 +173,134 @@
|
|||||||
#end
|
#end
|
||||||
#set($dictType=$column.dictType)
|
#set($dictType=$column.dictType)
|
||||||
#if("" != $treeParentCode && $column.javaField == $treeParentCode)
|
#if("" != $treeParentCode && $column.javaField == $treeParentCode)
|
||||||
<el-form-item label="${comment}" prop="${treeParentCode}">
|
<el-col :span="${colSpan}">
|
||||||
<el-tree-select
|
<el-form-item label="${comment}" prop="${treeParentCode}">
|
||||||
v-model="form.${treeParentCode}"
|
<el-tree-select
|
||||||
:data="${businessName}Options"
|
v-model="form.${treeParentCode}"
|
||||||
:props="{ value: '${treeCode}', label: '${treeName}', children: 'children' }"
|
:data="${businessName}Options"
|
||||||
value-key="${treeCode}"
|
:props="{ value: '${treeCode}', label: '${treeName}', children: 'children' }"
|
||||||
placeholder="请选择${comment}"
|
value-key="${treeCode}"
|
||||||
check-strictly
|
placeholder="请选择${comment}"
|
||||||
/>
|
check-strictly
|
||||||
</el-form-item>
|
/>
|
||||||
|
</el-form-item>
|
||||||
|
</el-col>
|
||||||
#elseif($column.htmlType == "input")
|
#elseif($column.htmlType == "input")
|
||||||
<el-form-item label="${comment}" prop="${field}">
|
<el-col :span="${colSpan}">
|
||||||
<el-input v-model="form.${field}" placeholder="请输入${comment}" />
|
<el-form-item label="${comment}" prop="${field}">
|
||||||
</el-form-item>
|
<el-input v-model="form.${field}" placeholder="请输入${comment}" />
|
||||||
|
</el-form-item>
|
||||||
|
</el-col>
|
||||||
#elseif($column.htmlType == "imageUpload")
|
#elseif($column.htmlType == "imageUpload")
|
||||||
<el-form-item label="${comment}" prop="${field}">
|
<el-col :span="${colSpan}">
|
||||||
<image-upload v-model="form.${field}"/>
|
<el-form-item label="${comment}" prop="${field}">
|
||||||
</el-form-item>
|
<image-upload v-model="form.${field}"/>
|
||||||
|
</el-form-item>
|
||||||
|
</el-col>
|
||||||
#elseif($column.htmlType == "fileUpload")
|
#elseif($column.htmlType == "fileUpload")
|
||||||
<el-form-item label="${comment}" prop="${field}">
|
<el-col :span="${colSpan}">
|
||||||
<file-upload v-model="form.${field}"/>
|
<el-form-item label="${comment}" prop="${field}">
|
||||||
</el-form-item>
|
<file-upload v-model="form.${field}"/>
|
||||||
|
</el-form-item>
|
||||||
|
</el-col>
|
||||||
#elseif($column.htmlType == "editor")
|
#elseif($column.htmlType == "editor")
|
||||||
<el-form-item label="${comment}">
|
<el-col :span="24">
|
||||||
<editor v-model="form.${field}" :min-height="192"/>
|
<el-form-item label="${comment}">
|
||||||
</el-form-item>
|
<editor v-model="form.${field}" :min-height="192"/>
|
||||||
|
</el-form-item>
|
||||||
|
</el-col>
|
||||||
#elseif($column.htmlType == "select" && "" != $dictType)
|
#elseif($column.htmlType == "select" && "" != $dictType)
|
||||||
<el-form-item label="${comment}" prop="${field}">
|
<el-col :span="${colSpan}">
|
||||||
<el-select v-model="form.${field}" placeholder="请选择${comment}">
|
<el-form-item label="${comment}" prop="${field}">
|
||||||
<el-option
|
<el-select v-model="form.${field}" placeholder="请选择${comment}">
|
||||||
v-for="dict in ${dictType}"
|
<el-option
|
||||||
:key="dict.value"
|
v-for="dict in ${dictType}"
|
||||||
:label="dict.label"
|
:key="dict.value"
|
||||||
|
:label="dict.label"
|
||||||
#if($column.javaType == "Integer" || $column.javaType == "Long")
|
#if($column.javaType == "Integer" || $column.javaType == "Long")
|
||||||
:value="parseInt(dict.value)"
|
:value="parseInt(dict.value)"
|
||||||
#else
|
#else
|
||||||
:value="dict.value"
|
:value="dict.value"
|
||||||
#end
|
#end
|
||||||
></el-option>
|
></el-option>
|
||||||
</el-select>
|
</el-select>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
|
</el-col>
|
||||||
#elseif($column.htmlType == "select" && $dictType)
|
#elseif($column.htmlType == "select" && $dictType)
|
||||||
<el-form-item label="${comment}" prop="${field}">
|
<el-col :span="${colSpan}">
|
||||||
<el-select v-model="form.${field}" placeholder="请选择${comment}">
|
<el-form-item label="${comment}" prop="${field}">
|
||||||
<el-option label="请选择字典生成" value="" />
|
<el-select v-model="form.${field}" placeholder="请选择${comment}">
|
||||||
</el-select>
|
<el-option label="请选择字典生成" value="" />
|
||||||
</el-form-item>
|
</el-select>
|
||||||
|
</el-form-item>
|
||||||
|
</el-col>
|
||||||
#elseif($column.htmlType == "checkbox" && "" != $dictType)
|
#elseif($column.htmlType == "checkbox" && "" != $dictType)
|
||||||
<el-form-item label="${comment}" prop="${field}">
|
<el-col :span="${colSpan}">
|
||||||
<el-checkbox-group v-model="form.${field}">
|
<el-form-item label="${comment}" prop="${field}">
|
||||||
<el-checkbox
|
<el-checkbox-group v-model="form.${field}">
|
||||||
v-for="dict in ${dictType}"
|
<el-checkbox
|
||||||
:key="dict.value"
|
v-for="dict in ${dictType}"
|
||||||
:label="dict.value">
|
:key="dict.value"
|
||||||
{{dict.label}}
|
:label="dict.value">
|
||||||
</el-checkbox>
|
{{dict.label}}
|
||||||
</el-checkbox-group>
|
</el-checkbox>
|
||||||
</el-form-item>
|
</el-checkbox-group>
|
||||||
|
</el-form-item>
|
||||||
|
</el-col>
|
||||||
#elseif($column.htmlType == "checkbox" && $dictType)
|
#elseif($column.htmlType == "checkbox" && $dictType)
|
||||||
<el-form-item label="${comment}" prop="${field}">
|
<el-col :span="${colSpan}">
|
||||||
<el-checkbox-group v-model="form.${field}">
|
<el-form-item label="${comment}" prop="${field}">
|
||||||
<el-checkbox>请选择字典生成</el-checkbox>
|
<el-checkbox-group v-model="form.${field}">
|
||||||
</el-checkbox-group>
|
<el-checkbox>请选择字典生成</el-checkbox>
|
||||||
</el-form-item>
|
</el-checkbox-group>
|
||||||
|
</el-form-item>
|
||||||
|
</el-col>
|
||||||
#elseif($column.htmlType == "radio" && "" != $dictType)
|
#elseif($column.htmlType == "radio" && "" != $dictType)
|
||||||
<el-form-item label="${comment}" prop="${field}">
|
<el-col :span="${colSpan}">
|
||||||
<el-radio-group v-model="form.${field}">
|
<el-form-item label="${comment}" prop="${field}">
|
||||||
<el-radio
|
<el-radio-group v-model="form.${field}">
|
||||||
v-for="dict in ${dictType}"
|
<el-radio
|
||||||
:key="dict.value"
|
v-for="dict in ${dictType}"
|
||||||
|
:key="dict.value"
|
||||||
#if($column.javaType == "Integer" || $column.javaType == "Long")
|
#if($column.javaType == "Integer" || $column.javaType == "Long")
|
||||||
:label="parseInt(dict.value)"
|
:label="parseInt(dict.value)"
|
||||||
#else
|
#else
|
||||||
:label="dict.value"
|
:label="dict.value"
|
||||||
#end
|
#end
|
||||||
>{{dict.label}}</el-radio>
|
>{{dict.label}}</el-radio>
|
||||||
</el-radio-group>
|
</el-radio-group>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
|
</el-col>
|
||||||
#elseif($column.htmlType == "radio" && $dictType)
|
#elseif($column.htmlType == "radio" && $dictType)
|
||||||
<el-form-item label="${comment}" prop="${field}">
|
<el-col :span="${colSpan}">
|
||||||
<el-radio-group v-model="form.${field}">
|
<el-form-item label="${comment}" prop="${field}">
|
||||||
<el-radio label="1">请选择字典生成</el-radio>
|
<el-radio-group v-model="form.${field}">
|
||||||
</el-radio-group>
|
<el-radio label="1">请选择字典生成</el-radio>
|
||||||
</el-form-item>
|
</el-radio-group>
|
||||||
|
</el-form-item>
|
||||||
|
</el-col>
|
||||||
#elseif($column.htmlType == "datetime")
|
#elseif($column.htmlType == "datetime")
|
||||||
<el-form-item label="${comment}" prop="${field}">
|
<el-col :span="${colSpan}">
|
||||||
<el-date-picker clearable
|
<el-form-item label="${comment}" prop="${field}">
|
||||||
v-model="form.${field}"
|
<el-date-picker clearable
|
||||||
type="date"
|
v-model="form.${field}"
|
||||||
value-format="YYYY-MM-DD"
|
type="date"
|
||||||
placeholder="选择${comment}">
|
value-format="YYYY-MM-DD"
|
||||||
</el-date-picker>
|
placeholder="选择${comment}">
|
||||||
</el-form-item>
|
</el-date-picker>
|
||||||
|
</el-form-item>
|
||||||
|
</el-col>
|
||||||
#elseif($column.htmlType == "textarea")
|
#elseif($column.htmlType == "textarea")
|
||||||
<el-form-item label="${comment}" prop="${field}">
|
<el-col :span="24">
|
||||||
<el-input v-model="form.${field}" type="textarea" placeholder="请输入内容" />
|
<el-form-item label="${comment}" prop="${field}">
|
||||||
</el-form-item>
|
<el-input v-model="form.${field}" type="textarea" placeholder="请输入内容" />
|
||||||
|
</el-form-item>
|
||||||
|
</el-col>
|
||||||
#end
|
#end
|
||||||
#end
|
#end
|
||||||
#end
|
#end
|
||||||
#end
|
#end
|
||||||
|
</el-row>
|
||||||
</el-form>
|
</el-form>
|
||||||
<template #footer>
|
<template #footer>
|
||||||
<div class="dialog-footer">
|
<div class="dialog-footer">
|
||||||
@@ -272,11 +314,14 @@
|
|||||||
|
|
||||||
<script setup name="${BusinessName}">
|
<script setup name="${BusinessName}">
|
||||||
import { list${BusinessName}, get${BusinessName}, del${BusinessName}, add${BusinessName}, update${BusinessName} } from "@/api/${moduleName}/${businessName}"
|
import { list${BusinessName}, get${BusinessName}, del${BusinessName}, add${BusinessName}, update${BusinessName} } from "@/api/${moduleName}/${businessName}"
|
||||||
|
#if($genView)
|
||||||
|
import ${BusinessName}ViewDrawer from "./view"
|
||||||
|
#end
|
||||||
|
|
||||||
const { proxy } = getCurrentInstance()
|
const { proxy } = getCurrentInstance()
|
||||||
#if(${dicts} != '')
|
#if(${dicts} != '')
|
||||||
#set($dictsNoSymbol=$dicts.replace("'", ""))
|
#set($dictsNoSymbol=$dicts.replace("'", ""))
|
||||||
const { ${dictsNoSymbol} } = proxy.useDict(${dicts})
|
const { ${dictsNoSymbol} } = useDict(${dicts})
|
||||||
#end
|
#end
|
||||||
|
|
||||||
const ${businessName}List = ref([])
|
const ${businessName}List = ref([])
|
||||||
@@ -299,7 +344,7 @@ const data = reactive({
|
|||||||
queryParams: {
|
queryParams: {
|
||||||
#foreach ($column in $columns)
|
#foreach ($column in $columns)
|
||||||
#if($column.query)
|
#if($column.query)
|
||||||
$column.javaField: null#if($foreach.count != $columns.size()),#end
|
$column.javaField: undefined#if($foreach.count != $columns.size()),#end
|
||||||
#end
|
#end
|
||||||
#end
|
#end
|
||||||
},
|
},
|
||||||
@@ -356,13 +401,13 @@ function getTreeselect() {
|
|||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
// 取消按钮
|
/** 取消按钮 */
|
||||||
function cancel() {
|
function cancel() {
|
||||||
open.value = false
|
open.value = false
|
||||||
reset()
|
reset()
|
||||||
}
|
}
|
||||||
|
|
||||||
// 表单重置
|
/** 表单重置 */
|
||||||
function reset() {
|
function reset() {
|
||||||
form.value = {
|
form.value = {
|
||||||
#foreach ($column in $columns)
|
#foreach ($column in $columns)
|
||||||
@@ -414,6 +459,13 @@ function toggleExpandAll() {
|
|||||||
refreshTable.value = true
|
refreshTable.value = true
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
#if($genView)
|
||||||
|
|
||||||
|
/** 详情按钮操作 */
|
||||||
|
function handleViewData(row) {
|
||||||
|
proxy.#[[$]]#refs["${businessName}ViewRef"].open(row.${pkColumn.javaField})
|
||||||
|
}
|
||||||
|
#end
|
||||||
|
|
||||||
/** 修改按钮操作 */
|
/** 修改按钮操作 */
|
||||||
async function handleUpdate(row) {
|
async function handleUpdate(row) {
|
||||||
@@ -444,13 +496,13 @@ function submitForm() {
|
|||||||
#end
|
#end
|
||||||
#end
|
#end
|
||||||
if (form.value.${pkColumn.javaField} != null) {
|
if (form.value.${pkColumn.javaField} != null) {
|
||||||
update${BusinessName}(form.value).then(response => {
|
update${BusinessName}(form.value).then(() => {
|
||||||
proxy.#[[$modal]]#.msgSuccess("修改成功")
|
proxy.#[[$modal]]#.msgSuccess("修改成功")
|
||||||
open.value = false
|
open.value = false
|
||||||
getList()
|
getList()
|
||||||
})
|
})
|
||||||
} else {
|
} else {
|
||||||
add${BusinessName}(form.value).then(response => {
|
add${BusinessName}(form.value).then(() => {
|
||||||
proxy.#[[$modal]]#.msgSuccess("新增成功")
|
proxy.#[[$modal]]#.msgSuccess("新增成功")
|
||||||
open.value = false
|
open.value = false
|
||||||
getList()
|
getList()
|
||||||
|
|||||||
@@ -148,6 +148,9 @@
|
|||||||
#end
|
#end
|
||||||
<el-table-column label="操作" align="center" class-name="small-padding fixed-width">
|
<el-table-column label="操作" align="center" class-name="small-padding fixed-width">
|
||||||
<template #default="scope">
|
<template #default="scope">
|
||||||
|
#if($genView)
|
||||||
|
<el-button link type="primary" icon="View" @click="handleViewData(scope.row)" v-hasPermi="['${permissionPrefix}:query']">详情</el-button>
|
||||||
|
#end
|
||||||
<el-button link type="primary" icon="Edit" @click="handleUpdate(scope.row)" v-hasPermi="['${permissionPrefix}:edit']">修改</el-button>
|
<el-button link type="primary" icon="Edit" @click="handleUpdate(scope.row)" v-hasPermi="['${permissionPrefix}:edit']">修改</el-button>
|
||||||
<el-button link type="primary" icon="Delete" @click="handleDelete(scope.row)" v-hasPermi="['${permissionPrefix}:remove']">删除</el-button>
|
<el-button link type="primary" icon="Delete" @click="handleDelete(scope.row)" v-hasPermi="['${permissionPrefix}:remove']">删除</el-button>
|
||||||
</template>
|
</template>
|
||||||
@@ -162,9 +165,21 @@
|
|||||||
@pagination="getList"
|
@pagination="getList"
|
||||||
/>
|
/>
|
||||||
|
|
||||||
|
#if($genView)
|
||||||
|
<!-- ${functionName}详情抽屉 -->
|
||||||
|
<${businessName}-view-drawer ref="${businessName}ViewRef" />
|
||||||
|
#end
|
||||||
<!-- 添加或修改${functionName}对话框 -->
|
<!-- 添加或修改${functionName}对话框 -->
|
||||||
<el-dialog :title="title" v-model="open" width="500px" append-to-body>
|
#if($table.formColNum == 2)
|
||||||
<el-form ref="${businessName}Ref" :model="form" :rules="rules" label-width="80px">
|
#set($dialogWidth = "800px")
|
||||||
|
#elseif($table.formColNum == 3)
|
||||||
|
#set($dialogWidth = "1100px")
|
||||||
|
#else
|
||||||
|
#set($dialogWidth = "500px")
|
||||||
|
#end
|
||||||
|
<el-dialog :title="title" v-model="open" width="${dialogWidth}" append-to-body>
|
||||||
|
<el-form ref="${businessName}Ref" :model="form" :rules="rules" label-width="100px">
|
||||||
|
<el-row>
|
||||||
#foreach($column in $columns)
|
#foreach($column in $columns)
|
||||||
#set($field=$column.javaField)
|
#set($field=$column.javaField)
|
||||||
#if($column.insert && !$column.pk)
|
#if($column.insert && !$column.pk)
|
||||||
@@ -177,96 +192,121 @@
|
|||||||
#end
|
#end
|
||||||
#set($dictType=$column.dictType)
|
#set($dictType=$column.dictType)
|
||||||
#if($column.htmlType == "input")
|
#if($column.htmlType == "input")
|
||||||
<el-form-item label="${comment}" prop="${field}">
|
<el-col :span="${colSpan}">
|
||||||
<el-input v-model="form.${field}" placeholder="请输入${comment}" />
|
<el-form-item label="${comment}" prop="${field}">
|
||||||
</el-form-item>
|
<el-input v-model="form.${field}" placeholder="请输入${comment}" />
|
||||||
|
</el-form-item>
|
||||||
|
</el-col>
|
||||||
#elseif($column.htmlType == "imageUpload")
|
#elseif($column.htmlType == "imageUpload")
|
||||||
<el-form-item label="${comment}" prop="${field}">
|
<el-col :span="${colSpan}">
|
||||||
<image-upload v-model="form.${field}"/>
|
<el-form-item label="${comment}" prop="${field}">
|
||||||
</el-form-item>
|
<image-upload v-model="form.${field}"/>
|
||||||
|
</el-form-item>
|
||||||
|
</el-col>
|
||||||
#elseif($column.htmlType == "fileUpload")
|
#elseif($column.htmlType == "fileUpload")
|
||||||
<el-form-item label="${comment}" prop="${field}">
|
<el-col :span="${colSpan}">
|
||||||
<file-upload v-model="form.${field}"/>
|
<el-form-item label="${comment}" prop="${field}">
|
||||||
</el-form-item>
|
<file-upload v-model="form.${field}"/>
|
||||||
|
</el-form-item>
|
||||||
|
</el-col>
|
||||||
#elseif($column.htmlType == "editor")
|
#elseif($column.htmlType == "editor")
|
||||||
<el-form-item label="${comment}">
|
<el-col :span="24">
|
||||||
<editor v-model="form.${field}" :min-height="192"/>
|
<el-form-item label="${comment}">
|
||||||
</el-form-item>
|
<editor v-model="form.${field}" :min-height="192"/>
|
||||||
|
</el-form-item>
|
||||||
|
</el-col>
|
||||||
#elseif($column.htmlType == "select" && "" != $dictType)
|
#elseif($column.htmlType == "select" && "" != $dictType)
|
||||||
<el-form-item label="${comment}" prop="${field}">
|
<el-col :span="${colSpan}">
|
||||||
<el-select v-model="form.${field}" placeholder="请选择${comment}">
|
<el-form-item label="${comment}" prop="${field}">
|
||||||
<el-option
|
<el-select v-model="form.${field}" placeholder="请选择${comment}">
|
||||||
v-for="dict in ${dictType}"
|
<el-option
|
||||||
:key="dict.value"
|
v-for="dict in ${dictType}"
|
||||||
:label="dict.label"
|
:key="dict.value"
|
||||||
|
:label="dict.label"
|
||||||
#if($column.javaType == "Integer" || $column.javaType == "Long")
|
#if($column.javaType == "Integer" || $column.javaType == "Long")
|
||||||
:value="parseInt(dict.value)"
|
:value="parseInt(dict.value)"
|
||||||
#else
|
#else
|
||||||
:value="dict.value"
|
:value="dict.value"
|
||||||
#end
|
#end
|
||||||
></el-option>
|
></el-option>
|
||||||
</el-select>
|
</el-select>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
|
</el-col>
|
||||||
#elseif($column.htmlType == "select" && $dictType)
|
#elseif($column.htmlType == "select" && $dictType)
|
||||||
<el-form-item label="${comment}" prop="${field}">
|
<el-col :span="${colSpan}">
|
||||||
<el-select v-model="form.${field}" placeholder="请选择${comment}">
|
<el-form-item label="${comment}" prop="${field}">
|
||||||
<el-option label="请选择字典生成" value="" />
|
<el-select v-model="form.${field}" placeholder="请选择${comment}">
|
||||||
</el-select>
|
<el-option label="请选择字典生成" value="" />
|
||||||
</el-form-item>
|
</el-select>
|
||||||
|
</el-form-item>
|
||||||
|
</el-col>
|
||||||
#elseif($column.htmlType == "checkbox" && "" != $dictType)
|
#elseif($column.htmlType == "checkbox" && "" != $dictType)
|
||||||
<el-form-item label="${comment}" prop="${field}">
|
<el-col :span="${colSpan}">
|
||||||
<el-checkbox-group v-model="form.${field}">
|
<el-form-item label="${comment}" prop="${field}">
|
||||||
<el-checkbox
|
<el-checkbox-group v-model="form.${field}">
|
||||||
v-for="dict in ${dictType}"
|
<el-checkbox
|
||||||
:key="dict.value"
|
v-for="dict in ${dictType}"
|
||||||
:label="dict.value">
|
:key="dict.value"
|
||||||
{{dict.label}}
|
:label="dict.value">
|
||||||
</el-checkbox>
|
{{dict.label}}
|
||||||
</el-checkbox-group>
|
</el-checkbox>
|
||||||
</el-form-item>
|
</el-checkbox-group>
|
||||||
|
</el-form-item>
|
||||||
|
</el-col>
|
||||||
#elseif($column.htmlType == "checkbox" && $dictType)
|
#elseif($column.htmlType == "checkbox" && $dictType)
|
||||||
<el-form-item label="${comment}" prop="${field}">
|
<el-col :span="${colSpan}">
|
||||||
<el-checkbox-group v-model="form.${field}">
|
<el-form-item label="${comment}" prop="${field}">
|
||||||
<el-checkbox>请选择字典生成</el-checkbox>
|
<el-checkbox-group v-model="form.${field}">
|
||||||
</el-checkbox-group>
|
<el-checkbox>请选择字典生成</el-checkbox>
|
||||||
</el-form-item>
|
</el-checkbox-group>
|
||||||
|
</el-form-item>
|
||||||
|
</el-col>
|
||||||
#elseif($column.htmlType == "radio" && "" != $dictType)
|
#elseif($column.htmlType == "radio" && "" != $dictType)
|
||||||
<el-form-item label="${comment}" prop="${field}">
|
<el-col :span="${colSpan}">
|
||||||
<el-radio-group v-model="form.${field}">
|
<el-form-item label="${comment}" prop="${field}">
|
||||||
<el-radio
|
<el-radio-group v-model="form.${field}">
|
||||||
v-for="dict in ${dictType}"
|
<el-radio
|
||||||
:key="dict.value"
|
v-for="dict in ${dictType}"
|
||||||
|
:key="dict.value"
|
||||||
#if($column.javaType == "Integer" || $column.javaType == "Long")
|
#if($column.javaType == "Integer" || $column.javaType == "Long")
|
||||||
:label="parseInt(dict.value)"
|
:label="parseInt(dict.value)"
|
||||||
#else
|
#else
|
||||||
:label="dict.value"
|
:label="dict.value"
|
||||||
#end
|
#end
|
||||||
>{{dict.label}}</el-radio>
|
>{{dict.label}}</el-radio>
|
||||||
</el-radio-group>
|
</el-radio-group>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
|
</el-col>
|
||||||
#elseif($column.htmlType == "radio" && $dictType)
|
#elseif($column.htmlType == "radio" && $dictType)
|
||||||
<el-form-item label="${comment}" prop="${field}">
|
<el-col :span="${colSpan}">
|
||||||
<el-radio-group v-model="form.${field}">
|
<el-form-item label="${comment}" prop="${field}">
|
||||||
<el-radio label="1">请选择字典生成</el-radio>
|
<el-radio-group v-model="form.${field}">
|
||||||
</el-radio-group>
|
<el-radio label="1">请选择字典生成</el-radio>
|
||||||
</el-form-item>
|
</el-radio-group>
|
||||||
|
</el-form-item>
|
||||||
|
</el-col>
|
||||||
#elseif($column.htmlType == "datetime")
|
#elseif($column.htmlType == "datetime")
|
||||||
<el-form-item label="${comment}" prop="${field}">
|
<el-col :span="${colSpan}">
|
||||||
<el-date-picker clearable
|
<el-form-item label="${comment}" prop="${field}">
|
||||||
v-model="form.${field}"
|
<el-date-picker clearable
|
||||||
type="date"
|
v-model="form.${field}"
|
||||||
value-format="YYYY-MM-DD"
|
type="date"
|
||||||
placeholder="请选择${comment}">
|
value-format="YYYY-MM-DD"
|
||||||
</el-date-picker>
|
placeholder="请选择${comment}">
|
||||||
</el-form-item>
|
</el-date-picker>
|
||||||
|
</el-form-item>
|
||||||
|
</el-col>
|
||||||
#elseif($column.htmlType == "textarea")
|
#elseif($column.htmlType == "textarea")
|
||||||
<el-form-item label="${comment}" prop="${field}">
|
<el-col :span="24">
|
||||||
<el-input v-model="form.${field}" type="textarea" placeholder="请输入内容" />
|
<el-form-item label="${comment}" prop="${field}">
|
||||||
</el-form-item>
|
<el-input v-model="form.${field}" type="textarea" placeholder="请输入内容" />
|
||||||
|
</el-form-item>
|
||||||
|
</el-col>
|
||||||
#end
|
#end
|
||||||
#end
|
#end
|
||||||
#end
|
#end
|
||||||
#end
|
#end
|
||||||
|
</el-row>
|
||||||
#if($table.sub)
|
#if($table.sub)
|
||||||
<el-divider content-position="center">${subTable.functionName}信息</el-divider>
|
<el-divider content-position="center">${subTable.functionName}信息</el-divider>
|
||||||
<el-row :gutter="10" class="mb8">
|
<el-row :gutter="10" class="mb8">
|
||||||
@@ -277,9 +317,13 @@
|
|||||||
<el-button type="danger" icon="Delete" @click="handleDelete${subClassName}">删除</el-button>
|
<el-button type="danger" icon="Delete" @click="handleDelete${subClassName}">删除</el-button>
|
||||||
</el-col>
|
</el-col>
|
||||||
</el-row>
|
</el-row>
|
||||||
<el-table :data="${subclassName}List" :row-class-name="row${subClassName}Index" @selection-change="handle${subClassName}SelectionChange" ref="${subclassName}">
|
<el-table :data="${subclassName}List" @selection-change="handle${subClassName}SelectionChange" ref="${subclassName}">
|
||||||
<el-table-column type="selection" width="50" align="center" />
|
<el-table-column type="selection" width="50" align="center" />
|
||||||
<el-table-column label="序号" align="center" prop="index" width="50"/>
|
<el-table-column label="序号" width="60">
|
||||||
|
<template #default="{ $index }">
|
||||||
|
{{ $index + 1 }}
|
||||||
|
</template>
|
||||||
|
</el-table-column>
|
||||||
#foreach($column in $subTable.columns)
|
#foreach($column in $subTable.columns)
|
||||||
#set($javaField=$column.javaField)
|
#set($javaField=$column.javaField)
|
||||||
#set($parentheseIndex=$column.columnComment.indexOf("("))
|
#set($parentheseIndex=$column.columnComment.indexOf("("))
|
||||||
@@ -344,11 +388,14 @@
|
|||||||
|
|
||||||
<script setup name="${BusinessName}">
|
<script setup name="${BusinessName}">
|
||||||
import { list${BusinessName}, get${BusinessName}, del${BusinessName}, add${BusinessName}, update${BusinessName} } from "@/api/${moduleName}/${businessName}"
|
import { list${BusinessName}, get${BusinessName}, del${BusinessName}, add${BusinessName}, update${BusinessName} } from "@/api/${moduleName}/${businessName}"
|
||||||
|
#if($genView)
|
||||||
|
import ${BusinessName}ViewDrawer from "./view"
|
||||||
|
#end
|
||||||
|
|
||||||
const { proxy } = getCurrentInstance()
|
const { proxy } = getCurrentInstance()
|
||||||
#if(${dicts} != '')
|
#if(${dicts} != '')
|
||||||
#set($dictsNoSymbol=$dicts.replace("'", ""))
|
#set($dictsNoSymbol=$dicts.replace("'", ""))
|
||||||
const { ${dictsNoSymbol} } = proxy.useDict(${dicts})
|
const { ${dictsNoSymbol} } = useDict(${dicts})
|
||||||
#end
|
#end
|
||||||
|
|
||||||
const ${businessName}List = ref([])
|
const ${businessName}List = ref([])
|
||||||
@@ -380,7 +427,7 @@ const data = reactive({
|
|||||||
pageSize: 10,
|
pageSize: 10,
|
||||||
#foreach ($column in $columns)
|
#foreach ($column in $columns)
|
||||||
#if($column.query)
|
#if($column.query)
|
||||||
$column.javaField: null#if($foreach.count != $columns.size()),#end
|
$column.javaField: undefined#if($foreach.count != $columns.size()),#end
|
||||||
#end
|
#end
|
||||||
#end
|
#end
|
||||||
},
|
},
|
||||||
@@ -428,13 +475,13 @@ function getList() {
|
|||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
// 取消按钮
|
/** 取消按钮 */
|
||||||
function cancel() {
|
function cancel() {
|
||||||
open.value = false
|
open.value = false
|
||||||
reset()
|
reset()
|
||||||
}
|
}
|
||||||
|
|
||||||
// 表单重置
|
/** 表单重置 */
|
||||||
function reset() {
|
function reset() {
|
||||||
form.value = {
|
form.value = {
|
||||||
#foreach ($column in $columns)
|
#foreach ($column in $columns)
|
||||||
@@ -469,7 +516,7 @@ function resetQuery() {
|
|||||||
handleQuery()
|
handleQuery()
|
||||||
}
|
}
|
||||||
|
|
||||||
// 多选框选中数据
|
/** 多选框选中数据 */
|
||||||
function handleSelectionChange(selection) {
|
function handleSelectionChange(selection) {
|
||||||
ids.value = selection.map(item => item.${pkColumn.javaField})
|
ids.value = selection.map(item => item.${pkColumn.javaField})
|
||||||
single.value = selection.length != 1
|
single.value = selection.length != 1
|
||||||
@@ -515,13 +562,13 @@ function submitForm() {
|
|||||||
form.value.${subclassName}List = ${subclassName}List.value
|
form.value.${subclassName}List = ${subclassName}List.value
|
||||||
#end
|
#end
|
||||||
if (form.value.${pkColumn.javaField} != null) {
|
if (form.value.${pkColumn.javaField} != null) {
|
||||||
update${BusinessName}(form.value).then(response => {
|
update${BusinessName}(form.value).then(() => {
|
||||||
proxy.#[[$modal]]#.msgSuccess("修改成功")
|
proxy.#[[$modal]]#.msgSuccess("修改成功")
|
||||||
open.value = false
|
open.value = false
|
||||||
getList()
|
getList()
|
||||||
})
|
})
|
||||||
} else {
|
} else {
|
||||||
add${BusinessName}(form.value).then(response => {
|
add${BusinessName}(form.value).then(() => {
|
||||||
proxy.#[[$modal]]#.msgSuccess("新增成功")
|
proxy.#[[$modal]]#.msgSuccess("新增成功")
|
||||||
open.value = false
|
open.value = false
|
||||||
getList()
|
getList()
|
||||||
@@ -543,18 +590,13 @@ function handleDelete(row) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
#if($table.sub)
|
#if($table.sub)
|
||||||
/** ${subTable.functionName}序号 */
|
|
||||||
function row${subClassName}Index({ row, rowIndex }) {
|
|
||||||
row.index = rowIndex + 1
|
|
||||||
}
|
|
||||||
|
|
||||||
/** ${subTable.functionName}添加按钮操作 */
|
/** ${subTable.functionName}添加按钮操作 */
|
||||||
function handleAdd${subClassName}() {
|
function handleAdd${subClassName}() {
|
||||||
let obj = {}
|
let obj = {}
|
||||||
#foreach($column in $subTable.columns)
|
#foreach($column in $subTable.columns)
|
||||||
#if($column.pk || $column.javaField == ${subTableFkclassName})
|
#if($column.pk || $column.javaField == ${subTableFkclassName})
|
||||||
#elseif($column.list && "" != $javaField)
|
#elseif($column.list && "" != $javaField)
|
||||||
obj.$column.javaField = ""
|
obj.$column.javaField = undefined
|
||||||
#end
|
#end
|
||||||
#end
|
#end
|
||||||
${subclassName}List.value.push(obj)
|
${subclassName}List.value.push(obj)
|
||||||
@@ -578,6 +620,13 @@ function handle${subClassName}SelectionChange(selection) {
|
|||||||
checked${subClassName}.value = selection.map(item => item.index)
|
checked${subClassName}.value = selection.map(item => item.index)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#end
|
||||||
|
#if($genView)
|
||||||
|
/** 详情按钮操作 */
|
||||||
|
function handleViewData(row) {
|
||||||
|
proxy.#[[$]]#refs["${businessName}ViewRef"].open(row.${pkColumn.javaField})
|
||||||
|
}
|
||||||
|
|
||||||
#end
|
#end
|
||||||
/** 导出按钮操作 */
|
/** 导出按钮操作 */
|
||||||
function handleExport() {
|
function handleExport() {
|
||||||
|
|||||||
@@ -0,0 +1,83 @@
|
|||||||
|
<template>
|
||||||
|
<el-drawer title="${functionName}详情" v-model="visible" direction="rtl" size="60%" append-to-body :before-close="handleClose" class="detail-drawer">
|
||||||
|
<div v-loading="loading" class="drawer-content">
|
||||||
|
<h4 class="section-header">基本信息</h4>
|
||||||
|
#set($i = 0)
|
||||||
|
#foreach($column in $columns)
|
||||||
|
#if(!$column.pk && $column.list)
|
||||||
|
#set($dictType=$column.dictType)
|
||||||
|
#set($javaField=$column.javaField)
|
||||||
|
#set($parentheseIndex=$column.columnComment.indexOf("("))
|
||||||
|
#if($parentheseIndex != -1)
|
||||||
|
#set($comment=$column.columnComment.substring(0, $parentheseIndex))
|
||||||
|
#else
|
||||||
|
#set($comment=$column.columnComment)
|
||||||
|
#end
|
||||||
|
#if($i % 2 == 0)
|
||||||
|
<el-row :gutter="20" class="mb8">
|
||||||
|
#end
|
||||||
|
<el-col :span="12">
|
||||||
|
<div class="info-item">
|
||||||
|
<label class="info-label">${comment}:</label>
|
||||||
|
<span class="info-value plaintext">
|
||||||
|
#if("" != $dictType)
|
||||||
|
#if($column.htmlType == "checkbox")
|
||||||
|
<dict-tag :options="${dictType}" :value="info.${javaField} ? info.${javaField}.split(',') : []" />
|
||||||
|
#else
|
||||||
|
<dict-tag :options="${dictType}" :value="info.${javaField}" />
|
||||||
|
#end
|
||||||
|
#elseif($column.htmlType == "datetime")
|
||||||
|
{{ parseTime(info.${javaField}, '{y}-{m}-{d}') }}
|
||||||
|
#elseif($column.htmlType == "imageUpload")
|
||||||
|
<image-preview :src="info.${javaField}" :width="60" :height="60" />
|
||||||
|
#else
|
||||||
|
{{ info.${javaField} }}
|
||||||
|
#end
|
||||||
|
</span>
|
||||||
|
</div>
|
||||||
|
</el-col>
|
||||||
|
#set($i = $i + 1)
|
||||||
|
#if($i % 2 == 0)
|
||||||
|
</el-row>
|
||||||
|
#end
|
||||||
|
#end
|
||||||
|
#end
|
||||||
|
#if($i % 2 != 0)
|
||||||
|
</el-row>
|
||||||
|
#end
|
||||||
|
</div>
|
||||||
|
</el-drawer>
|
||||||
|
</template>
|
||||||
|
|
||||||
|
<script setup name="${BusinessName}ViewDrawer">
|
||||||
|
import { get${BusinessName} } from '@/api/${moduleName}/${businessName}'
|
||||||
|
|
||||||
|
#if(${dicts} != '')
|
||||||
|
#set($dictsNoSymbol=$dicts.replace("'", ""))
|
||||||
|
const { ${dictsNoSymbol} } = useDict(${dicts})
|
||||||
|
#end
|
||||||
|
|
||||||
|
const visible = ref(false)
|
||||||
|
const loading = ref(false)
|
||||||
|
const info = reactive({})
|
||||||
|
|
||||||
|
const open = async (${pkColumn.javaField}) => {
|
||||||
|
visible.value = true
|
||||||
|
loading.value = true
|
||||||
|
try {
|
||||||
|
const res = await get${BusinessName}(${pkColumn.javaField})
|
||||||
|
Object.assign(info, res.data || {})
|
||||||
|
} catch (error) {
|
||||||
|
console.error('获取${functionName}信息失败:', error)
|
||||||
|
} finally {
|
||||||
|
loading.value = false
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
function handleClose() {
|
||||||
|
visible.value = false
|
||||||
|
Object.keys(info).forEach(key => delete info[key])
|
||||||
|
}
|
||||||
|
|
||||||
|
defineExpose({ open })
|
||||||
|
</script>
|
||||||
@@ -136,6 +136,9 @@
|
|||||||
#end
|
#end
|
||||||
<el-table-column label="操作" align="center" class-name="small-padding fixed-width">
|
<el-table-column label="操作" align="center" class-name="small-padding fixed-width">
|
||||||
<template #default="scope">
|
<template #default="scope">
|
||||||
|
#if($genView)
|
||||||
|
<el-button link type="primary" icon="View" @click="handleViewData(scope.row)" v-hasPermi="['${permissionPrefix}:query']">详情</el-button>
|
||||||
|
#end
|
||||||
<el-button link type="primary" icon="Edit" @click="handleUpdate(scope.row)" v-hasPermi="['${permissionPrefix}:edit']">修改</el-button>
|
<el-button link type="primary" icon="Edit" @click="handleUpdate(scope.row)" v-hasPermi="['${permissionPrefix}:edit']">修改</el-button>
|
||||||
<el-button link type="primary" icon="Plus" @click="handleAdd(scope.row)" v-hasPermi="['${permissionPrefix}:add']">新增</el-button>
|
<el-button link type="primary" icon="Plus" @click="handleAdd(scope.row)" v-hasPermi="['${permissionPrefix}:add']">新增</el-button>
|
||||||
<el-button link type="primary" icon="Delete" @click="handleDelete(scope.row)" v-hasPermi="['${permissionPrefix}:remove']">删除</el-button>
|
<el-button link type="primary" icon="Delete" @click="handleDelete(scope.row)" v-hasPermi="['${permissionPrefix}:remove']">删除</el-button>
|
||||||
@@ -143,9 +146,21 @@
|
|||||||
</el-table-column>
|
</el-table-column>
|
||||||
</el-table>
|
</el-table>
|
||||||
|
|
||||||
|
#if($genView)
|
||||||
|
<!-- ${functionName}详情抽屉 -->
|
||||||
|
<${businessName}-view-drawer ref="${businessName}ViewRef" />
|
||||||
|
#end
|
||||||
<!-- 添加或修改${functionName}对话框 -->
|
<!-- 添加或修改${functionName}对话框 -->
|
||||||
<el-dialog :title="title" v-model="open" width="500px" append-to-body>
|
#if($table.formColNum == 2)
|
||||||
<el-form ref="${businessName}Ref" :model="form" :rules="rules" label-width="80px">
|
#set($dialogWidth = "800px")
|
||||||
|
#elseif($table.formColNum == 3)
|
||||||
|
#set($dialogWidth = "1100px")
|
||||||
|
#else
|
||||||
|
#set($dialogWidth = "500px")
|
||||||
|
#end
|
||||||
|
<el-dialog :title="title" v-model="open" width="${dialogWidth}" append-to-body>
|
||||||
|
<el-form ref="${businessName}Ref" :model="form" :rules="rules" label-width="100px">
|
||||||
|
<el-row>
|
||||||
#foreach($column in $columns)
|
#foreach($column in $columns)
|
||||||
#set($field=$column.javaField)
|
#set($field=$column.javaField)
|
||||||
#if($column.insert && !$column.pk)
|
#if($column.insert && !$column.pk)
|
||||||
@@ -158,107 +173,134 @@
|
|||||||
#end
|
#end
|
||||||
#set($dictType=$column.dictType)
|
#set($dictType=$column.dictType)
|
||||||
#if("" != $treeParentCode && $column.javaField == $treeParentCode)
|
#if("" != $treeParentCode && $column.javaField == $treeParentCode)
|
||||||
<el-form-item label="${comment}" prop="${treeParentCode}">
|
<el-col :span="${colSpan}">
|
||||||
<el-tree-select
|
<el-form-item label="${comment}" prop="${treeParentCode}">
|
||||||
v-model="form.${treeParentCode}"
|
<el-tree-select
|
||||||
:data="${businessName}Options"
|
v-model="form.${treeParentCode}"
|
||||||
:props="{ value: '${treeCode}', label: '${treeName}', children: 'children' }"
|
:data="${businessName}Options"
|
||||||
value-key="${treeCode}"
|
:props="{ value: '${treeCode}', label: '${treeName}', children: 'children' }"
|
||||||
placeholder="请选择${comment}"
|
value-key="${treeCode}"
|
||||||
check-strictly
|
placeholder="请选择${comment}"
|
||||||
/>
|
check-strictly
|
||||||
</el-form-item>
|
/>
|
||||||
|
</el-form-item>
|
||||||
|
</el-col>
|
||||||
#elseif($column.htmlType == "input")
|
#elseif($column.htmlType == "input")
|
||||||
<el-form-item label="${comment}" prop="${field}">
|
<el-col :span="${colSpan}">
|
||||||
<el-input v-model="form.${field}" placeholder="请输入${comment}" />
|
<el-form-item label="${comment}" prop="${field}">
|
||||||
</el-form-item>
|
<el-input v-model="form.${field}" placeholder="请输入${comment}" />
|
||||||
|
</el-form-item>
|
||||||
|
</el-col>
|
||||||
#elseif($column.htmlType == "imageUpload")
|
#elseif($column.htmlType == "imageUpload")
|
||||||
<el-form-item label="${comment}" prop="${field}">
|
<el-col :span="${colSpan}">
|
||||||
<image-upload v-model="form.${field}"/>
|
<el-form-item label="${comment}" prop="${field}">
|
||||||
</el-form-item>
|
<image-upload v-model="form.${field}"/>
|
||||||
|
</el-form-item>
|
||||||
|
</el-col>
|
||||||
#elseif($column.htmlType == "fileUpload")
|
#elseif($column.htmlType == "fileUpload")
|
||||||
<el-form-item label="${comment}" prop="${field}">
|
<el-col :span="${colSpan}">
|
||||||
<file-upload v-model="form.${field}"/>
|
<el-form-item label="${comment}" prop="${field}">
|
||||||
</el-form-item>
|
<file-upload v-model="form.${field}"/>
|
||||||
|
</el-form-item>
|
||||||
|
</el-col>
|
||||||
#elseif($column.htmlType == "editor")
|
#elseif($column.htmlType == "editor")
|
||||||
<el-form-item label="${comment}">
|
<el-col :span="24">
|
||||||
<editor v-model="form.${field}" :min-height="192"/>
|
<el-form-item label="${comment}">
|
||||||
</el-form-item>
|
<editor v-model="form.${field}" :min-height="192"/>
|
||||||
|
</el-form-item>
|
||||||
|
</el-col>
|
||||||
#elseif($column.htmlType == "select" && "" != $dictType)
|
#elseif($column.htmlType == "select" && "" != $dictType)
|
||||||
<el-form-item label="${comment}" prop="${field}">
|
<el-col :span="${colSpan}">
|
||||||
<el-select v-model="form.${field}" placeholder="请选择${comment}">
|
<el-form-item label="${comment}" prop="${field}">
|
||||||
<el-option
|
<el-select v-model="form.${field}" placeholder="请选择${comment}">
|
||||||
v-for="dict in ${dictType}"
|
<el-option
|
||||||
:key="dict.value"
|
v-for="dict in ${dictType}"
|
||||||
:label="dict.label"
|
:key="dict.value"
|
||||||
|
:label="dict.label"
|
||||||
#if($column.javaType == "Integer" || $column.javaType == "Long")
|
#if($column.javaType == "Integer" || $column.javaType == "Long")
|
||||||
:value="parseInt(dict.value)"
|
:value="parseInt(dict.value)"
|
||||||
#else
|
#else
|
||||||
:value="dict.value"
|
:value="dict.value"
|
||||||
#end
|
#end
|
||||||
></el-option>
|
></el-option>
|
||||||
</el-select>
|
</el-select>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
|
</el-col>
|
||||||
#elseif($column.htmlType == "select" && $dictType)
|
#elseif($column.htmlType == "select" && $dictType)
|
||||||
<el-form-item label="${comment}" prop="${field}">
|
<el-col :span="${colSpan}">
|
||||||
<el-select v-model="form.${field}" placeholder="请选择${comment}">
|
<el-form-item label="${comment}" prop="${field}">
|
||||||
<el-option label="请选择字典生成" value="" />
|
<el-select v-model="form.${field}" placeholder="请选择${comment}">
|
||||||
</el-select>
|
<el-option label="请选择字典生成" value="" />
|
||||||
</el-form-item>
|
</el-select>
|
||||||
|
</el-form-item>
|
||||||
|
</el-col>
|
||||||
#elseif($column.htmlType == "checkbox" && "" != $dictType)
|
#elseif($column.htmlType == "checkbox" && "" != $dictType)
|
||||||
<el-form-item label="${comment}" prop="${field}">
|
<el-col :span="${colSpan}">
|
||||||
<el-checkbox-group v-model="form.${field}">
|
<el-form-item label="${comment}" prop="${field}">
|
||||||
<el-checkbox
|
<el-checkbox-group v-model="form.${field}">
|
||||||
v-for="dict in ${dictType}"
|
<el-checkbox
|
||||||
:key="dict.value"
|
v-for="dict in ${dictType}"
|
||||||
:label="dict.value">
|
:key="dict.value"
|
||||||
{{dict.label}}
|
:label="dict.value">
|
||||||
</el-checkbox>
|
{{dict.label}}
|
||||||
</el-checkbox-group>
|
</el-checkbox>
|
||||||
</el-form-item>
|
</el-checkbox-group>
|
||||||
|
</el-form-item>
|
||||||
|
</el-col>
|
||||||
#elseif($column.htmlType == "checkbox" && $dictType)
|
#elseif($column.htmlType == "checkbox" && $dictType)
|
||||||
<el-form-item label="${comment}" prop="${field}">
|
<el-col :span="${colSpan}">
|
||||||
<el-checkbox-group v-model="form.${field}">
|
<el-form-item label="${comment}" prop="${field}">
|
||||||
<el-checkbox>请选择字典生成</el-checkbox>
|
<el-checkbox-group v-model="form.${field}">
|
||||||
</el-checkbox-group>
|
<el-checkbox>请选择字典生成</el-checkbox>
|
||||||
</el-form-item>
|
</el-checkbox-group>
|
||||||
|
</el-form-item>
|
||||||
|
</el-col>
|
||||||
#elseif($column.htmlType == "radio" && "" != $dictType)
|
#elseif($column.htmlType == "radio" && "" != $dictType)
|
||||||
<el-form-item label="${comment}" prop="${field}">
|
<el-col :span="${colSpan}">
|
||||||
<el-radio-group v-model="form.${field}">
|
<el-form-item label="${comment}" prop="${field}">
|
||||||
<el-radio
|
<el-radio-group v-model="form.${field}">
|
||||||
v-for="dict in ${dictType}"
|
<el-radio
|
||||||
:key="dict.value"
|
v-for="dict in ${dictType}"
|
||||||
|
:key="dict.value"
|
||||||
#if($column.javaType == "Integer" || $column.javaType == "Long")
|
#if($column.javaType == "Integer" || $column.javaType == "Long")
|
||||||
:label="parseInt(dict.value)"
|
:label="parseInt(dict.value)"
|
||||||
#else
|
#else
|
||||||
:label="dict.value"
|
:label="dict.value"
|
||||||
#end
|
#end
|
||||||
>{{dict.label}}</el-radio>
|
>{{dict.label}}</el-radio>
|
||||||
</el-radio-group>
|
</el-radio-group>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
|
</el-col>
|
||||||
#elseif($column.htmlType == "radio" && $dictType)
|
#elseif($column.htmlType == "radio" && $dictType)
|
||||||
<el-form-item label="${comment}" prop="${field}">
|
<el-col :span="${colSpan}">
|
||||||
<el-radio-group v-model="form.${field}">
|
<el-form-item label="${comment}" prop="${field}">
|
||||||
<el-radio label="1">请选择字典生成</el-radio>
|
<el-radio-group v-model="form.${field}">
|
||||||
</el-radio-group>
|
<el-radio label="1">请选择字典生成</el-radio>
|
||||||
</el-form-item>
|
</el-radio-group>
|
||||||
|
</el-form-item>
|
||||||
|
</el-col>
|
||||||
#elseif($column.htmlType == "datetime")
|
#elseif($column.htmlType == "datetime")
|
||||||
<el-form-item label="${comment}" prop="${field}">
|
<el-col :span="${colSpan}">
|
||||||
<el-date-picker clearable
|
<el-form-item label="${comment}" prop="${field}">
|
||||||
v-model="form.${field}"
|
<el-date-picker clearable
|
||||||
type="date"
|
v-model="form.${field}"
|
||||||
value-format="YYYY-MM-DD"
|
type="date"
|
||||||
placeholder="选择${comment}">
|
value-format="YYYY-MM-DD"
|
||||||
</el-date-picker>
|
placeholder="选择${comment}">
|
||||||
</el-form-item>
|
</el-date-picker>
|
||||||
|
</el-form-item>
|
||||||
|
</el-col>
|
||||||
#elseif($column.htmlType == "textarea")
|
#elseif($column.htmlType == "textarea")
|
||||||
<el-form-item label="${comment}" prop="${field}">
|
<el-col :span="24">
|
||||||
<el-input v-model="form.${field}" type="textarea" placeholder="请输入内容" />
|
<el-form-item label="${comment}" prop="${field}">
|
||||||
</el-form-item>
|
<el-input v-model="form.${field}" type="textarea" placeholder="请输入内容" />
|
||||||
|
</el-form-item>
|
||||||
|
</el-col>
|
||||||
#end
|
#end
|
||||||
#end
|
#end
|
||||||
#end
|
#end
|
||||||
#end
|
#end
|
||||||
|
</el-row>
|
||||||
</el-form>
|
</el-form>
|
||||||
<template #footer>
|
<template #footer>
|
||||||
<div class="dialog-footer">
|
<div class="dialog-footer">
|
||||||
@@ -272,13 +314,16 @@
|
|||||||
|
|
||||||
<script setup lang="ts" name="${BusinessName}">
|
<script setup lang="ts" name="${BusinessName}">
|
||||||
import { list${BusinessName}, get${BusinessName}, del${BusinessName}, add${BusinessName}, update${BusinessName} } from "@/api/${moduleName}/${businessName}"
|
import { list${BusinessName}, get${BusinessName}, del${BusinessName}, add${BusinessName}, update${BusinessName} } from "@/api/${moduleName}/${businessName}"
|
||||||
|
#if($genView)
|
||||||
|
import ${BusinessName}ViewDrawer from "./view"
|
||||||
|
#end
|
||||||
import type { ${ClassName}, ${BusinessName}QueryParams } from "@/types/api/${moduleName}/${businessName}"
|
import type { ${ClassName}, ${BusinessName}QueryParams } from "@/types/api/${moduleName}/${businessName}"
|
||||||
import type { TreeSelect } from '@/types/api/common'
|
import type { TreeSelect } from '@/types/api/common'
|
||||||
|
|
||||||
const { proxy } = getCurrentInstance()
|
const { proxy } = getCurrentInstance()
|
||||||
#if(${dicts} != '')
|
#if(${dicts} != '')
|
||||||
#set($dictsNoSymbol=$dicts.replace("'", ""))
|
#set($dictsNoSymbol=$dicts.replace("'", ""))
|
||||||
const { ${dictsNoSymbol} } = proxy.useDict(${dicts})
|
const { ${dictsNoSymbol} } = useDict(${dicts})
|
||||||
#end
|
#end
|
||||||
|
|
||||||
const ${businessName}List = ref<any[]>([])
|
const ${businessName}List = ref<any[]>([])
|
||||||
@@ -358,13 +403,13 @@ function getTreeselect() {
|
|||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
// 取消按钮
|
/** 取消按钮 */
|
||||||
function cancel() {
|
function cancel() {
|
||||||
open.value = false
|
open.value = false
|
||||||
reset()
|
reset()
|
||||||
}
|
}
|
||||||
|
|
||||||
// 表单重置
|
/** 表单重置 */
|
||||||
function reset() {
|
function reset() {
|
||||||
form.value = {
|
form.value = {
|
||||||
#foreach ($column in $columns)
|
#foreach ($column in $columns)
|
||||||
@@ -416,6 +461,13 @@ function toggleExpandAll() {
|
|||||||
refreshTable.value = true
|
refreshTable.value = true
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
#if($genView)
|
||||||
|
|
||||||
|
/** 详情按钮操作 */
|
||||||
|
function handleViewData(row: ${ClassName}) {
|
||||||
|
proxy.#[[$]]#refs["${businessName}ViewRef"].open(row.${pkColumn.javaField})
|
||||||
|
}
|
||||||
|
#end
|
||||||
|
|
||||||
/** 修改按钮操作 */
|
/** 修改按钮操作 */
|
||||||
async function handleUpdate(row: ${ClassName}) {
|
async function handleUpdate(row: ${ClassName}) {
|
||||||
|
|||||||
@@ -148,6 +148,9 @@
|
|||||||
#end
|
#end
|
||||||
<el-table-column label="操作" align="center" class-name="small-padding fixed-width">
|
<el-table-column label="操作" align="center" class-name="small-padding fixed-width">
|
||||||
<template #default="scope">
|
<template #default="scope">
|
||||||
|
#if($genView)
|
||||||
|
<el-button link type="primary" icon="View" @click="handleViewData(scope.row)" v-hasPermi="['${permissionPrefix}:query']">详情</el-button>
|
||||||
|
#end
|
||||||
<el-button link type="primary" icon="Edit" @click="handleUpdate(scope.row)" v-hasPermi="['${permissionPrefix}:edit']">修改</el-button>
|
<el-button link type="primary" icon="Edit" @click="handleUpdate(scope.row)" v-hasPermi="['${permissionPrefix}:edit']">修改</el-button>
|
||||||
<el-button link type="primary" icon="Delete" @click="handleDelete(scope.row)" v-hasPermi="['${permissionPrefix}:remove']">删除</el-button>
|
<el-button link type="primary" icon="Delete" @click="handleDelete(scope.row)" v-hasPermi="['${permissionPrefix}:remove']">删除</el-button>
|
||||||
</template>
|
</template>
|
||||||
@@ -162,9 +165,21 @@
|
|||||||
@pagination="getList"
|
@pagination="getList"
|
||||||
/>
|
/>
|
||||||
|
|
||||||
|
#if($genView)
|
||||||
|
<!-- ${functionName}详情抽屉 -->
|
||||||
|
<${businessName}-view-drawer ref="${businessName}ViewRef" />
|
||||||
|
#end
|
||||||
<!-- 添加或修改${functionName}对话框 -->
|
<!-- 添加或修改${functionName}对话框 -->
|
||||||
<el-dialog :title="title" v-model="open" width="500px" append-to-body>
|
#if($table.formColNum == 2)
|
||||||
<el-form ref="${businessName}Ref" :model="form" :rules="rules" label-width="80px">
|
#set($dialogWidth = "800px")
|
||||||
|
#elseif($table.formColNum == 3)
|
||||||
|
#set($dialogWidth = "1100px")
|
||||||
|
#else
|
||||||
|
#set($dialogWidth = "500px")
|
||||||
|
#end
|
||||||
|
<el-dialog :title="title" v-model="open" width="${dialogWidth}" append-to-body>
|
||||||
|
<el-form ref="${businessName}Ref" :model="form" :rules="rules" label-width="100px">
|
||||||
|
<el-row>
|
||||||
#foreach($column in $columns)
|
#foreach($column in $columns)
|
||||||
#set($field=$column.javaField)
|
#set($field=$column.javaField)
|
||||||
#if($column.insert && !$column.pk)
|
#if($column.insert && !$column.pk)
|
||||||
@@ -177,96 +192,121 @@
|
|||||||
#end
|
#end
|
||||||
#set($dictType=$column.dictType)
|
#set($dictType=$column.dictType)
|
||||||
#if($column.htmlType == "input")
|
#if($column.htmlType == "input")
|
||||||
<el-form-item label="${comment}" prop="${field}">
|
<el-col :span="${colSpan}">
|
||||||
<el-input v-model="form.${field}" placeholder="请输入${comment}" />
|
<el-form-item label="${comment}" prop="${field}">
|
||||||
</el-form-item>
|
<el-input v-model="form.${field}" placeholder="请输入${comment}" />
|
||||||
|
</el-form-item>
|
||||||
|
</el-col>
|
||||||
#elseif($column.htmlType == "imageUpload")
|
#elseif($column.htmlType == "imageUpload")
|
||||||
<el-form-item label="${comment}" prop="${field}">
|
<el-col :span="${colSpan}">
|
||||||
<image-upload v-model="form.${field}"/>
|
<el-form-item label="${comment}" prop="${field}">
|
||||||
</el-form-item>
|
<image-upload v-model="form.${field}"/>
|
||||||
|
</el-form-item>
|
||||||
|
</el-col>
|
||||||
#elseif($column.htmlType == "fileUpload")
|
#elseif($column.htmlType == "fileUpload")
|
||||||
<el-form-item label="${comment}" prop="${field}">
|
<el-col :span="${colSpan}">
|
||||||
<file-upload v-model="form.${field}"/>
|
<el-form-item label="${comment}" prop="${field}">
|
||||||
</el-form-item>
|
<file-upload v-model="form.${field}"/>
|
||||||
|
</el-form-item>
|
||||||
|
</el-col>
|
||||||
#elseif($column.htmlType == "editor")
|
#elseif($column.htmlType == "editor")
|
||||||
<el-form-item label="${comment}">
|
<el-col :span="24">
|
||||||
<editor v-model="form.${field}" :min-height="192"/>
|
<el-form-item label="${comment}">
|
||||||
</el-form-item>
|
<editor v-model="form.${field}" :min-height="192"/>
|
||||||
|
</el-form-item>
|
||||||
|
</el-col>
|
||||||
#elseif($column.htmlType == "select" && "" != $dictType)
|
#elseif($column.htmlType == "select" && "" != $dictType)
|
||||||
<el-form-item label="${comment}" prop="${field}">
|
<el-col :span="${colSpan}">
|
||||||
<el-select v-model="form.${field}" placeholder="请选择${comment}">
|
<el-form-item label="${comment}" prop="${field}">
|
||||||
<el-option
|
<el-select v-model="form.${field}" placeholder="请选择${comment}">
|
||||||
v-for="dict in ${dictType}"
|
<el-option
|
||||||
:key="dict.value"
|
v-for="dict in ${dictType}"
|
||||||
:label="dict.label"
|
:key="dict.value"
|
||||||
|
:label="dict.label"
|
||||||
#if($column.javaType == "Integer" || $column.javaType == "Long")
|
#if($column.javaType == "Integer" || $column.javaType == "Long")
|
||||||
:value="parseInt(dict.value)"
|
:value="parseInt(dict.value)"
|
||||||
#else
|
#else
|
||||||
:value="dict.value"
|
:value="dict.value"
|
||||||
#end
|
#end
|
||||||
></el-option>
|
></el-option>
|
||||||
</el-select>
|
</el-select>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
|
</el-col>
|
||||||
#elseif($column.htmlType == "select" && $dictType)
|
#elseif($column.htmlType == "select" && $dictType)
|
||||||
<el-form-item label="${comment}" prop="${field}">
|
<el-col :span="${colSpan}">
|
||||||
<el-select v-model="form.${field}" placeholder="请选择${comment}">
|
<el-form-item label="${comment}" prop="${field}">
|
||||||
<el-option label="请选择字典生成" value="" />
|
<el-select v-model="form.${field}" placeholder="请选择${comment}">
|
||||||
</el-select>
|
<el-option label="请选择字典生成" value="" />
|
||||||
</el-form-item>
|
</el-select>
|
||||||
|
</el-form-item>
|
||||||
|
</el-col>
|
||||||
#elseif($column.htmlType == "checkbox" && "" != $dictType)
|
#elseif($column.htmlType == "checkbox" && "" != $dictType)
|
||||||
<el-form-item label="${comment}" prop="${field}">
|
<el-col :span="${colSpan}">
|
||||||
<el-checkbox-group v-model="form.${field}">
|
<el-form-item label="${comment}" prop="${field}">
|
||||||
<el-checkbox
|
<el-checkbox-group v-model="form.${field}">
|
||||||
v-for="dict in ${dictType}"
|
<el-checkbox
|
||||||
:key="dict.value"
|
v-for="dict in ${dictType}"
|
||||||
:label="dict.value">
|
:key="dict.value"
|
||||||
{{dict.label}}
|
:label="dict.value">
|
||||||
</el-checkbox>
|
{{dict.label}}
|
||||||
</el-checkbox-group>
|
</el-checkbox>
|
||||||
</el-form-item>
|
</el-checkbox-group>
|
||||||
|
</el-form-item>
|
||||||
|
</el-col>
|
||||||
#elseif($column.htmlType == "checkbox" && $dictType)
|
#elseif($column.htmlType == "checkbox" && $dictType)
|
||||||
<el-form-item label="${comment}" prop="${field}">
|
<el-col :span="${colSpan}">
|
||||||
<el-checkbox-group v-model="form.${field}">
|
<el-form-item label="${comment}" prop="${field}">
|
||||||
<el-checkbox>请选择字典生成</el-checkbox>
|
<el-checkbox-group v-model="form.${field}">
|
||||||
</el-checkbox-group>
|
<el-checkbox>请选择字典生成</el-checkbox>
|
||||||
</el-form-item>
|
</el-checkbox-group>
|
||||||
|
</el-form-item>
|
||||||
|
</el-col>
|
||||||
#elseif($column.htmlType == "radio" && "" != $dictType)
|
#elseif($column.htmlType == "radio" && "" != $dictType)
|
||||||
<el-form-item label="${comment}" prop="${field}">
|
<el-col :span="${colSpan}">
|
||||||
<el-radio-group v-model="form.${field}">
|
<el-form-item label="${comment}" prop="${field}">
|
||||||
<el-radio
|
<el-radio-group v-model="form.${field}">
|
||||||
v-for="dict in ${dictType}"
|
<el-radio
|
||||||
:key="dict.value"
|
v-for="dict in ${dictType}"
|
||||||
|
:key="dict.value"
|
||||||
#if($column.javaType == "Integer" || $column.javaType == "Long")
|
#if($column.javaType == "Integer" || $column.javaType == "Long")
|
||||||
:label="parseInt(dict.value)"
|
:label="parseInt(dict.value)"
|
||||||
#else
|
#else
|
||||||
:label="dict.value"
|
:label="dict.value"
|
||||||
#end
|
#end
|
||||||
>{{dict.label}}</el-radio>
|
>{{dict.label}}</el-radio>
|
||||||
</el-radio-group>
|
</el-radio-group>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
|
</el-col>
|
||||||
#elseif($column.htmlType == "radio" && $dictType)
|
#elseif($column.htmlType == "radio" && $dictType)
|
||||||
<el-form-item label="${comment}" prop="${field}">
|
<el-col :span="${colSpan}">
|
||||||
<el-radio-group v-model="form.${field}">
|
<el-form-item label="${comment}" prop="${field}">
|
||||||
<el-radio label="1">请选择字典生成</el-radio>
|
<el-radio-group v-model="form.${field}">
|
||||||
</el-radio-group>
|
<el-radio label="1">请选择字典生成</el-radio>
|
||||||
</el-form-item>
|
</el-radio-group>
|
||||||
|
</el-form-item>
|
||||||
|
</el-col>
|
||||||
#elseif($column.htmlType == "datetime")
|
#elseif($column.htmlType == "datetime")
|
||||||
<el-form-item label="${comment}" prop="${field}">
|
<el-col :span="${colSpan}">
|
||||||
<el-date-picker clearable
|
<el-form-item label="${comment}" prop="${field}">
|
||||||
v-model="form.${field}"
|
<el-date-picker clearable
|
||||||
type="date"
|
v-model="form.${field}"
|
||||||
value-format="YYYY-MM-DD"
|
type="date"
|
||||||
placeholder="请选择${comment}">
|
value-format="YYYY-MM-DD"
|
||||||
</el-date-picker>
|
placeholder="请选择${comment}">
|
||||||
</el-form-item>
|
</el-date-picker>
|
||||||
|
</el-form-item>
|
||||||
|
</el-col>
|
||||||
#elseif($column.htmlType == "textarea")
|
#elseif($column.htmlType == "textarea")
|
||||||
<el-form-item label="${comment}" prop="${field}">
|
<el-col :span="24">
|
||||||
<el-input v-model="form.${field}" type="textarea" placeholder="请输入内容" />
|
<el-form-item label="${comment}" prop="${field}">
|
||||||
</el-form-item>
|
<el-input v-model="form.${field}" type="textarea" placeholder="请输入内容" />
|
||||||
|
</el-form-item>
|
||||||
|
</el-col>
|
||||||
#end
|
#end
|
||||||
#end
|
#end
|
||||||
#end
|
#end
|
||||||
#end
|
#end
|
||||||
|
</el-row>
|
||||||
#if($table.sub)
|
#if($table.sub)
|
||||||
<el-divider content-position="center">${subTable.functionName}信息</el-divider>
|
<el-divider content-position="center">${subTable.functionName}信息</el-divider>
|
||||||
<el-row :gutter="10" class="mb8">
|
<el-row :gutter="10" class="mb8">
|
||||||
@@ -346,18 +386,21 @@
|
|||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script setup lang="ts" name="Config">
|
<script setup lang="ts" name="${BusinessName}">
|
||||||
#if($table.sub)
|
#if($table.sub)
|
||||||
import type { ${ClassName}, ${subClassName}, ${BusinessName}QueryParams } from "@/types/api/${moduleName}/${businessName}"
|
import type { ${ClassName}, ${subClassName}, ${BusinessName}QueryParams } from "@/types/api/${moduleName}/${businessName}"
|
||||||
#else
|
#else
|
||||||
import type { ${ClassName}, ${BusinessName}QueryParams } from "@/types/api/${moduleName}/${businessName}"
|
import type { ${ClassName}, ${BusinessName}QueryParams } from "@/types/api/${moduleName}/${businessName}"
|
||||||
#end
|
#end
|
||||||
import { list${BusinessName}, get${BusinessName}, del${BusinessName}, add${BusinessName}, update${BusinessName} } from "@/api/${moduleName}/${businessName}"
|
import { list${BusinessName}, get${BusinessName}, del${BusinessName}, add${BusinessName}, update${BusinessName} } from "@/api/${moduleName}/${businessName}"
|
||||||
|
#if($genView)
|
||||||
|
import ${BusinessName}ViewDrawer from "./view"
|
||||||
|
#end
|
||||||
|
|
||||||
const { proxy } = getCurrentInstance()
|
const { proxy } = getCurrentInstance()
|
||||||
#if(${dicts} != '')
|
#if(${dicts} != '')
|
||||||
#set($dictsNoSymbol=$dicts.replace("'", ""))
|
#set($dictsNoSymbol=$dicts.replace("'", ""))
|
||||||
const { ${dictsNoSymbol} } = proxy.useDict(${dicts})
|
const { ${dictsNoSymbol} } = useDict(${dicts})
|
||||||
#end
|
#end
|
||||||
|
|
||||||
const ${businessName}List = ref<${ClassName}[]>([])
|
const ${businessName}List = ref<${ClassName}[]>([])
|
||||||
@@ -437,13 +480,13 @@ function getList() {
|
|||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
// 取消按钮
|
/** 取消按钮 */
|
||||||
function cancel() {
|
function cancel() {
|
||||||
open.value = false
|
open.value = false
|
||||||
reset()
|
reset()
|
||||||
}
|
}
|
||||||
|
|
||||||
// 表单重置
|
/** 表单重置 */
|
||||||
function reset() {
|
function reset() {
|
||||||
form.value = {
|
form.value = {
|
||||||
#foreach ($column in $columns)
|
#foreach ($column in $columns)
|
||||||
@@ -478,7 +521,7 @@ function resetQuery() {
|
|||||||
handleQuery()
|
handleQuery()
|
||||||
}
|
}
|
||||||
|
|
||||||
// 多选框选中数据
|
/** 多选框选中数据 */
|
||||||
function handleSelectionChange(selection: ${ClassName}[]) {
|
function handleSelectionChange(selection: ${ClassName}[]) {
|
||||||
ids.value = selection.map(item => item.${pkColumn.javaField})
|
ids.value = selection.map(item => item.${pkColumn.javaField})
|
||||||
single.value = selection.length != 1
|
single.value = selection.length != 1
|
||||||
@@ -582,6 +625,13 @@ function handle${subClassName}SelectionChange(selection: any[]) {
|
|||||||
checked${subClassName}.value = selection.map(item => item.index)
|
checked${subClassName}.value = selection.map(item => item.index)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#end
|
||||||
|
#if($genView)
|
||||||
|
/** 详情按钮操作 */
|
||||||
|
function handleViewData(row: ${ClassName}) {
|
||||||
|
proxy.#[[$]]#refs["${businessName}ViewRef"].open(row.${pkColumn.javaField})
|
||||||
|
}
|
||||||
|
|
||||||
#end
|
#end
|
||||||
/** 导出按钮操作 */
|
/** 导出按钮操作 */
|
||||||
function handleExport() {
|
function handleExport() {
|
||||||
|
|||||||
@@ -0,0 +1,84 @@
|
|||||||
|
<template>
|
||||||
|
<el-drawer title="${functionName}详情" v-model="visible" direction="rtl" size="60%" append-to-body :before-close="handleClose" class="detail-drawer">
|
||||||
|
<div v-loading="loading" class="drawer-content">
|
||||||
|
<h4 class="section-header">基本信息</h4>
|
||||||
|
#set($i = 0)
|
||||||
|
#foreach($column in $columns)
|
||||||
|
#if(!$column.pk && $column.list)
|
||||||
|
#set($dictType=$column.dictType)
|
||||||
|
#set($javaField=$column.javaField)
|
||||||
|
#set($parentheseIndex=$column.columnComment.indexOf("("))
|
||||||
|
#if($parentheseIndex != -1)
|
||||||
|
#set($comment=$column.columnComment.substring(0, $parentheseIndex))
|
||||||
|
#else
|
||||||
|
#set($comment=$column.columnComment)
|
||||||
|
#end
|
||||||
|
#if($i % 2 == 0)
|
||||||
|
<el-row :gutter="20" class="mb8">
|
||||||
|
#end
|
||||||
|
<el-col :span="12">
|
||||||
|
<div class="info-item">
|
||||||
|
<label class="info-label">${comment}:</label>
|
||||||
|
<span class="info-value plaintext">
|
||||||
|
#if("" != $dictType)
|
||||||
|
#if($column.htmlType == "checkbox")
|
||||||
|
<dict-tag :options="${dictType}" :value="info.${javaField} ? info.${javaField}.split(',') : []" />
|
||||||
|
#else
|
||||||
|
<dict-tag :options="${dictType}" :value="info.${javaField}" />
|
||||||
|
#end
|
||||||
|
#elseif($column.htmlType == "datetime")
|
||||||
|
{{ parseTime(info.${javaField}, '{y}-{m}-{d}') }}
|
||||||
|
#elseif($column.htmlType == "imageUpload")
|
||||||
|
<image-preview :src="info.${javaField}" :width="60" :height="60" />
|
||||||
|
#else
|
||||||
|
{{ info.${javaField} }}
|
||||||
|
#end
|
||||||
|
</span>
|
||||||
|
</div>
|
||||||
|
</el-col>
|
||||||
|
#set($i = $i + 1)
|
||||||
|
#if($i % 2 == 0)
|
||||||
|
</el-row>
|
||||||
|
#end
|
||||||
|
#end
|
||||||
|
#end
|
||||||
|
#if($i % 2 != 0)
|
||||||
|
</el-row>
|
||||||
|
#end
|
||||||
|
</div>
|
||||||
|
</el-drawer>
|
||||||
|
</template>
|
||||||
|
|
||||||
|
<script setup lang="ts" name="${BusinessName}ViewDrawer">
|
||||||
|
import type { ${ClassName} } from "@/types/api/${moduleName}/${businessName}"
|
||||||
|
import { get${BusinessName} } from '@/api/${moduleName}/${businessName}'
|
||||||
|
#if(${dicts} != '')
|
||||||
|
#set($dictsNoSymbol=$dicts.replace("'", ""))
|
||||||
|
|
||||||
|
const { ${dictsNoSymbol} } = useDict(${dicts})
|
||||||
|
#end
|
||||||
|
|
||||||
|
const visible = ref<boolean>(false)
|
||||||
|
const loading = ref<boolean>(false)
|
||||||
|
const info = reactive<Partial<${ClassName}>>({})
|
||||||
|
|
||||||
|
const open = async (#if($pkColumn.javaType == "Long" || $pkColumn.javaType == "Integer")${pkColumn.javaField}: number#else${pkColumn.javaField}: string#end): Promise<void> => {
|
||||||
|
visible.value = true
|
||||||
|
loading.value = true
|
||||||
|
try {
|
||||||
|
const res = await get${BusinessName}(${pkColumn.javaField})
|
||||||
|
Object.assign(info, res.data ?? {})
|
||||||
|
} catch (error) {
|
||||||
|
console.error('获取${functionName}信息失败:', error)
|
||||||
|
} finally {
|
||||||
|
loading.value = false
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
const handleClose = (): void => {
|
||||||
|
visible.value = false
|
||||||
|
Object.keys(info).forEach(key => delete (info as any)[key])
|
||||||
|
}
|
||||||
|
|
||||||
|
defineExpose({ open })
|
||||||
|
</script>
|
||||||
@@ -0,0 +1,86 @@
|
|||||||
|
<template>
|
||||||
|
<el-drawer title="${functionName}详情" :visible.sync="visible" direction="rtl" size="60%" append-to-body :before-close="handleClose" custom-class="detail-drawer">
|
||||||
|
<div v-loading="loading" class="drawer-content">
|
||||||
|
<h4 class="section-header">基本信息</h4>
|
||||||
|
#set($i = 0)
|
||||||
|
#foreach($column in $columns)
|
||||||
|
#if(!$column.pk && $column.list)
|
||||||
|
#set($dictType=$column.dictType)
|
||||||
|
#set($javaField=$column.javaField)
|
||||||
|
#set($parentheseIndex=$column.columnComment.indexOf("("))
|
||||||
|
#if($parentheseIndex != -1)
|
||||||
|
#set($comment=$column.columnComment.substring(0, $parentheseIndex))
|
||||||
|
#else
|
||||||
|
#set($comment=$column.columnComment)
|
||||||
|
#end
|
||||||
|
#if($i % 2 == 0)
|
||||||
|
<el-row :gutter="20" class="mb8">
|
||||||
|
#end
|
||||||
|
<el-col :span="12">
|
||||||
|
<div class="info-item">
|
||||||
|
<label class="info-label">${comment}:</label>
|
||||||
|
<span class="info-value plaintext">
|
||||||
|
#if("" != $dictType)
|
||||||
|
#if($column.htmlType == "checkbox")
|
||||||
|
<dict-tag :options="dict.type.${dictType}" :value="info.${javaField} ? info.${javaField}.split(',') : []" />
|
||||||
|
#else
|
||||||
|
<dict-tag :options="dict.type.${dictType}" :value="info.${javaField}" />
|
||||||
|
#end
|
||||||
|
#elseif($column.htmlType == "datetime")
|
||||||
|
{{ parseTime(info.${javaField}, '{y}-{m}-{d}') }}
|
||||||
|
#else
|
||||||
|
{{ info.${javaField} }}
|
||||||
|
#end
|
||||||
|
</span>
|
||||||
|
</div>
|
||||||
|
</el-col>
|
||||||
|
#set($i = $i + 1)
|
||||||
|
#if($i % 2 == 0)
|
||||||
|
</el-row>
|
||||||
|
#end
|
||||||
|
#end
|
||||||
|
#end
|
||||||
|
#if($i % 2 != 0)
|
||||||
|
</el-row>
|
||||||
|
#end
|
||||||
|
</div>
|
||||||
|
</el-drawer>
|
||||||
|
</template>
|
||||||
|
|
||||||
|
<script>
|
||||||
|
import { get${BusinessName} } from '@/api/${moduleName}/${businessName}'
|
||||||
|
|
||||||
|
export default {
|
||||||
|
name: '${BusinessName}ViewDrawer',
|
||||||
|
#foreach($column in $columns)
|
||||||
|
#if("" != $column.dictType)
|
||||||
|
#set($hasDicts = true)
|
||||||
|
#break
|
||||||
|
#end
|
||||||
|
#end
|
||||||
|
#if($hasDicts)
|
||||||
|
dicts: [#foreach($column in $columns)#if("" != $column.dictType)'${column.dictType}'#if($foreach.hasNext), #end#end#end],
|
||||||
|
#end
|
||||||
|
data() {
|
||||||
|
return {
|
||||||
|
visible: false,
|
||||||
|
loading: false,
|
||||||
|
info: {}
|
||||||
|
}
|
||||||
|
},
|
||||||
|
methods: {
|
||||||
|
open(${pkColumn.javaField}) {
|
||||||
|
this.visible = true
|
||||||
|
this.loading = true
|
||||||
|
get${BusinessName}(${pkColumn.javaField}).then(res => {
|
||||||
|
this.info = res.data || {}
|
||||||
|
}).finally(() => {
|
||||||
|
this.loading = false
|
||||||
|
})
|
||||||
|
},
|
||||||
|
handleClose() {
|
||||||
|
this.visible = false
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
</script>
|
||||||
@@ -1,7 +1,7 @@
|
|||||||
package com.ruoyi.job.controller;
|
package com.ruoyi.job.controller;
|
||||||
|
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
import jakarta.servlet.http.HttpServletResponse;
|
import javax.servlet.http.HttpServletResponse;
|
||||||
import org.quartz.SchedulerException;
|
import org.quartz.SchedulerException;
|
||||||
import org.springframework.beans.factory.annotation.Autowired;
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
import org.springframework.web.bind.annotation.DeleteMapping;
|
import org.springframework.web.bind.annotation.DeleteMapping;
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
package com.ruoyi.job.controller;
|
package com.ruoyi.job.controller;
|
||||||
|
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
import jakarta.servlet.http.HttpServletResponse;
|
import javax.servlet.http.HttpServletResponse;
|
||||||
import org.springframework.beans.factory.annotation.Autowired;
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
import org.springframework.web.bind.annotation.DeleteMapping;
|
import org.springframework.web.bind.annotation.DeleteMapping;
|
||||||
import org.springframework.web.bind.annotation.GetMapping;
|
import org.springframework.web.bind.annotation.GetMapping;
|
||||||
|
|||||||
@@ -1,8 +1,8 @@
|
|||||||
package com.ruoyi.job.domain;
|
package com.ruoyi.job.domain;
|
||||||
|
|
||||||
import java.util.Date;
|
import java.util.Date;
|
||||||
import jakarta.validation.constraints.NotBlank;
|
import javax.validation.constraints.NotBlank;
|
||||||
import jakarta.validation.constraints.Size;
|
import javax.validation.constraints.Size;
|
||||||
import org.apache.commons.lang3.builder.ToStringBuilder;
|
import org.apache.commons.lang3.builder.ToStringBuilder;
|
||||||
import org.apache.commons.lang3.builder.ToStringStyle;
|
import org.apache.commons.lang3.builder.ToStringStyle;
|
||||||
import com.fasterxml.jackson.annotation.JsonFormat;
|
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
package com.ruoyi.job.service;
|
package com.ruoyi.job.service;
|
||||||
|
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
import jakarta.annotation.PostConstruct;
|
import javax.annotation.PostConstruct;
|
||||||
import org.quartz.JobDataMap;
|
import org.quartz.JobDataMap;
|
||||||
import org.quartz.JobKey;
|
import org.quartz.JobKey;
|
||||||
import org.quartz.Scheduler;
|
import org.quartz.Scheduler;
|
||||||
|
|||||||
@@ -18,9 +18,8 @@ spring:
|
|||||||
config:
|
config:
|
||||||
# 配置中心地址
|
# 配置中心地址
|
||||||
server-addr: 127.0.0.1:8848
|
server-addr: 127.0.0.1:8848
|
||||||
config:
|
# 配置文件格式
|
||||||
# 配置文件格式
|
file-extension: yml
|
||||||
file-extension: yml
|
# 共享配置
|
||||||
import:
|
shared-configs:
|
||||||
- nacos:application-${spring.profiles.active}.${spring.config.file-extension}
|
- application-${spring.profiles.active}.${spring.cloud.nacos.config.file-extension}
|
||||||
- nacos:${spring.application.name}-${spring.profiles.active}.${spring.config.file-extension}
|
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
package com.ruoyi.system.controller;
|
package com.ruoyi.system.controller;
|
||||||
|
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
import jakarta.servlet.http.HttpServletResponse;
|
import javax.servlet.http.HttpServletResponse;
|
||||||
import org.springframework.beans.factory.annotation.Autowired;
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
import org.springframework.validation.annotation.Validated;
|
import org.springframework.validation.annotation.Validated;
|
||||||
import org.springframework.web.bind.annotation.DeleteMapping;
|
import org.springframework.web.bind.annotation.DeleteMapping;
|
||||||
|
|||||||
@@ -2,7 +2,7 @@ package com.ruoyi.system.controller;
|
|||||||
|
|
||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
import jakarta.servlet.http.HttpServletResponse;
|
import javax.servlet.http.HttpServletResponse;
|
||||||
import org.springframework.beans.factory.annotation.Autowired;
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
import org.springframework.validation.annotation.Validated;
|
import org.springframework.validation.annotation.Validated;
|
||||||
import org.springframework.web.bind.annotation.DeleteMapping;
|
import org.springframework.web.bind.annotation.DeleteMapping;
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
package com.ruoyi.system.controller;
|
package com.ruoyi.system.controller;
|
||||||
|
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
import jakarta.servlet.http.HttpServletResponse;
|
import javax.servlet.http.HttpServletResponse;
|
||||||
import org.springframework.beans.factory.annotation.Autowired;
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
import org.springframework.validation.annotation.Validated;
|
import org.springframework.validation.annotation.Validated;
|
||||||
import org.springframework.web.bind.annotation.DeleteMapping;
|
import org.springframework.web.bind.annotation.DeleteMapping;
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
package com.ruoyi.system.controller;
|
package com.ruoyi.system.controller;
|
||||||
|
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
import jakarta.servlet.http.HttpServletResponse;
|
import javax.servlet.http.HttpServletResponse;
|
||||||
import org.springframework.beans.factory.annotation.Autowired;
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
import org.springframework.web.bind.annotation.DeleteMapping;
|
import org.springframework.web.bind.annotation.DeleteMapping;
|
||||||
import org.springframework.web.bind.annotation.GetMapping;
|
import org.springframework.web.bind.annotation.GetMapping;
|
||||||
|
|||||||
@@ -54,7 +54,6 @@ public class SysNoticeController extends BaseController
|
|||||||
/**
|
/**
|
||||||
* 根据通知公告编号获取详细信息
|
* 根据通知公告编号获取详细信息
|
||||||
*/
|
*/
|
||||||
@RequiresPermissions("system:notice:query")
|
|
||||||
@GetMapping(value = "/{noticeId}")
|
@GetMapping(value = "/{noticeId}")
|
||||||
public AjaxResult getInfo(@PathVariable Long noticeId)
|
public AjaxResult getInfo(@PathVariable Long noticeId)
|
||||||
{
|
{
|
||||||
@@ -125,6 +124,19 @@ public class SysNoticeController extends BaseController
|
|||||||
return success();
|
return success();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 已读用户列表数据
|
||||||
|
*/
|
||||||
|
@RequiresPermissions("system:notice:list")
|
||||||
|
@GetMapping("/readUsers/list")
|
||||||
|
@ResponseBody
|
||||||
|
public TableDataInfo readUsersList(Long noticeId, String searchValue)
|
||||||
|
{
|
||||||
|
startPage();
|
||||||
|
List<?> list = noticeReadService.selectReadUsersByNoticeId(noticeId, searchValue);
|
||||||
|
return getDataTable(list);
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 删除通知公告
|
* 删除通知公告
|
||||||
*/
|
*/
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
package com.ruoyi.system.controller;
|
package com.ruoyi.system.controller;
|
||||||
|
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
import jakarta.servlet.http.HttpServletResponse;
|
import javax.servlet.http.HttpServletResponse;
|
||||||
import org.springframework.beans.factory.annotation.Autowired;
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
import org.springframework.web.bind.annotation.DeleteMapping;
|
import org.springframework.web.bind.annotation.DeleteMapping;
|
||||||
import org.springframework.web.bind.annotation.GetMapping;
|
import org.springframework.web.bind.annotation.GetMapping;
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
package com.ruoyi.system.controller;
|
package com.ruoyi.system.controller;
|
||||||
|
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
import jakarta.servlet.http.HttpServletResponse;
|
import javax.servlet.http.HttpServletResponse;
|
||||||
import org.springframework.beans.factory.annotation.Autowired;
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
import org.springframework.validation.annotation.Validated;
|
import org.springframework.validation.annotation.Validated;
|
||||||
import org.springframework.web.bind.annotation.DeleteMapping;
|
import org.springframework.web.bind.annotation.DeleteMapping;
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
package com.ruoyi.system.controller;
|
package com.ruoyi.system.controller;
|
||||||
|
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
import jakarta.servlet.http.HttpServletResponse;
|
import javax.servlet.http.HttpServletResponse;
|
||||||
import org.springframework.beans.factory.annotation.Autowired;
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
import org.springframework.validation.annotation.Validated;
|
import org.springframework.validation.annotation.Validated;
|
||||||
import org.springframework.web.bind.annotation.DeleteMapping;
|
import org.springframework.web.bind.annotation.DeleteMapping;
|
||||||
|
|||||||
@@ -5,7 +5,7 @@ import java.util.Date;
|
|||||||
import java.util.List;
|
import java.util.List;
|
||||||
import java.util.Set;
|
import java.util.Set;
|
||||||
import java.util.stream.Collectors;
|
import java.util.stream.Collectors;
|
||||||
import jakarta.servlet.http.HttpServletResponse;
|
import javax.servlet.http.HttpServletResponse;
|
||||||
import org.apache.commons.lang3.ArrayUtils;
|
import org.apache.commons.lang3.ArrayUtils;
|
||||||
import org.springframework.beans.factory.annotation.Autowired;
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
import org.springframework.validation.annotation.Validated;
|
import org.springframework.validation.annotation.Validated;
|
||||||
@@ -189,11 +189,18 @@ public class SysUserController extends BaseController
|
|||||||
ajax.put("user", user);
|
ajax.put("user", user);
|
||||||
ajax.put("roles", roles);
|
ajax.put("roles", roles);
|
||||||
ajax.put("permissions", permissions);
|
ajax.put("permissions", permissions);
|
||||||
|
ajax.put("pwdChrtype", getSysAccountChrtype());
|
||||||
ajax.put("isDefaultModifyPwd", initPasswordIsModify(user.getPwdUpdateDate()));
|
ajax.put("isDefaultModifyPwd", initPasswordIsModify(user.getPwdUpdateDate()));
|
||||||
ajax.put("isPasswordExpired", passwordIsExpiration(user.getPwdUpdateDate()));
|
ajax.put("isPasswordExpired", passwordIsExpiration(user.getPwdUpdateDate()));
|
||||||
return ajax;
|
return ajax;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// 获取用户密码自定义配置规则
|
||||||
|
public String getSysAccountChrtype()
|
||||||
|
{
|
||||||
|
return Convert.toStr(configService.selectConfigByKey("sys.account.chrtype"), "0");
|
||||||
|
}
|
||||||
|
|
||||||
// 检查初始密码是否提醒修改
|
// 检查初始密码是否提醒修改
|
||||||
public boolean initPasswordIsModify(Date pwdUpdateDate)
|
public boolean initPasswordIsModify(Date pwdUpdateDate)
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
package com.ruoyi.system.domain;
|
package com.ruoyi.system.domain;
|
||||||
|
|
||||||
import jakarta.validation.constraints.NotBlank;
|
import javax.validation.constraints.NotBlank;
|
||||||
import jakarta.validation.constraints.Size;
|
import javax.validation.constraints.Size;
|
||||||
import org.apache.commons.lang3.builder.ToStringBuilder;
|
import org.apache.commons.lang3.builder.ToStringBuilder;
|
||||||
import org.apache.commons.lang3.builder.ToStringStyle;
|
import org.apache.commons.lang3.builder.ToStringStyle;
|
||||||
import com.ruoyi.common.core.annotation.Excel;
|
import com.ruoyi.common.core.annotation.Excel;
|
||||||
|
|||||||
@@ -2,9 +2,9 @@ package com.ruoyi.system.domain;
|
|||||||
|
|
||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
import jakarta.validation.constraints.NotBlank;
|
import javax.validation.constraints.NotBlank;
|
||||||
import jakarta.validation.constraints.NotNull;
|
import javax.validation.constraints.NotNull;
|
||||||
import jakarta.validation.constraints.Size;
|
import javax.validation.constraints.Size;
|
||||||
import org.apache.commons.lang3.builder.ToStringBuilder;
|
import org.apache.commons.lang3.builder.ToStringBuilder;
|
||||||
import org.apache.commons.lang3.builder.ToStringStyle;
|
import org.apache.commons.lang3.builder.ToStringStyle;
|
||||||
import com.ruoyi.common.core.web.domain.BaseEntity;
|
import com.ruoyi.common.core.web.domain.BaseEntity;
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
package com.ruoyi.system.domain;
|
package com.ruoyi.system.domain;
|
||||||
|
|
||||||
import jakarta.validation.constraints.NotBlank;
|
import javax.validation.constraints.NotBlank;
|
||||||
import jakarta.validation.constraints.Size;
|
import javax.validation.constraints.Size;
|
||||||
import org.apache.commons.lang3.builder.ToStringBuilder;
|
import org.apache.commons.lang3.builder.ToStringBuilder;
|
||||||
import org.apache.commons.lang3.builder.ToStringStyle;
|
import org.apache.commons.lang3.builder.ToStringStyle;
|
||||||
import com.fasterxml.jackson.annotation.JsonProperty;
|
import com.fasterxml.jackson.annotation.JsonProperty;
|
||||||
|
|||||||
@@ -1,8 +1,8 @@
|
|||||||
package com.ruoyi.system.domain;
|
package com.ruoyi.system.domain;
|
||||||
|
|
||||||
import jakarta.validation.constraints.NotBlank;
|
import javax.validation.constraints.NotBlank;
|
||||||
import jakarta.validation.constraints.NotNull;
|
import javax.validation.constraints.NotNull;
|
||||||
import jakarta.validation.constraints.Size;
|
import javax.validation.constraints.Size;
|
||||||
import org.apache.commons.lang3.builder.ToStringBuilder;
|
import org.apache.commons.lang3.builder.ToStringBuilder;
|
||||||
import org.apache.commons.lang3.builder.ToStringStyle;
|
import org.apache.commons.lang3.builder.ToStringStyle;
|
||||||
import com.ruoyi.common.core.annotation.Excel;
|
import com.ruoyi.common.core.annotation.Excel;
|
||||||
|
|||||||
@@ -1,9 +1,10 @@
|
|||||||
package com.ruoyi.system.mapper;
|
package com.ruoyi.system.mapper;
|
||||||
|
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
import java.util.Map;
|
||||||
import org.apache.ibatis.annotations.Param;
|
import org.apache.ibatis.annotations.Param;
|
||||||
import com.ruoyi.system.domain.SysNoticeRead;
|
|
||||||
import com.ruoyi.system.domain.SysNotice;
|
import com.ruoyi.system.domain.SysNotice;
|
||||||
|
import com.ruoyi.system.domain.SysNoticeRead;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 公告已读记录 数据层
|
* 公告已读记录 数据层
|
||||||
@@ -55,6 +56,15 @@ public interface SysNoticeReadMapper
|
|||||||
*/
|
*/
|
||||||
public List<SysNotice> selectNoticeListWithReadStatus(@Param("userId") Long userId, @Param("limit") int limit);
|
public List<SysNotice> selectNoticeListWithReadStatus(@Param("userId") Long userId, @Param("limit") int limit);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 查询已阅读某公告的用户列表
|
||||||
|
*
|
||||||
|
* @param noticeId 公告ID
|
||||||
|
* @param searchValue 搜索值
|
||||||
|
* @return 已读用户列表
|
||||||
|
*/
|
||||||
|
public List<Map<String, Object>> selectReadUsersByNoticeId(@Param("noticeId") Long noticeId, @Param("searchValue") String searchValue);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 公告删除时清理对应已读记录
|
* 公告删除时清理对应已读记录
|
||||||
*
|
*
|
||||||
|
|||||||
@@ -1,6 +1,7 @@
|
|||||||
package com.ruoyi.system.service;
|
package com.ruoyi.system.service;
|
||||||
|
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
import java.util.Map;
|
||||||
import com.ruoyi.system.domain.SysNotice;
|
import com.ruoyi.system.domain.SysNotice;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -43,6 +44,15 @@ public interface ISysNoticeReadService
|
|||||||
*/
|
*/
|
||||||
public void markReadBatch(Long userId, Long[] noticeIds);
|
public void markReadBatch(Long userId, Long[] noticeIds);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 查询已阅读某公告的用户列表
|
||||||
|
*
|
||||||
|
* @param noticeId 公告ID
|
||||||
|
* @param searchValue 搜索值
|
||||||
|
* @return 已读用户列表
|
||||||
|
*/
|
||||||
|
public List<Map<String, Object>> selectReadUsersByNoticeId(Long noticeId, String searchValue);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 删除公告时清理对应已读记录
|
* 删除公告时清理对应已读记录
|
||||||
*
|
*
|
||||||
|
|||||||
@@ -2,7 +2,7 @@ package com.ruoyi.system.service.impl;
|
|||||||
|
|
||||||
import java.util.Collection;
|
import java.util.Collection;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
import jakarta.annotation.PostConstruct;
|
import javax.annotation.PostConstruct;
|
||||||
import org.springframework.beans.factory.annotation.Autowired;
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
import org.springframework.stereotype.Service;
|
import org.springframework.stereotype.Service;
|
||||||
import com.ruoyi.common.core.constant.CacheConstants;
|
import com.ruoyi.common.core.constant.CacheConstants;
|
||||||
|
|||||||
@@ -4,7 +4,7 @@ import java.util.Comparator;
|
|||||||
import java.util.List;
|
import java.util.List;
|
||||||
import java.util.Map;
|
import java.util.Map;
|
||||||
import java.util.stream.Collectors;
|
import java.util.stream.Collectors;
|
||||||
import jakarta.annotation.PostConstruct;
|
import javax.annotation.PostConstruct;
|
||||||
import org.springframework.beans.factory.annotation.Autowired;
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
import org.springframework.stereotype.Service;
|
import org.springframework.stereotype.Service;
|
||||||
import org.springframework.transaction.annotation.Transactional;
|
import org.springframework.transaction.annotation.Transactional;
|
||||||
|
|||||||
@@ -1,10 +1,11 @@
|
|||||||
package com.ruoyi.system.service.impl;
|
package com.ruoyi.system.service.impl;
|
||||||
|
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
import java.util.Map;
|
||||||
import org.springframework.beans.factory.annotation.Autowired;
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
import org.springframework.stereotype.Service;
|
import org.springframework.stereotype.Service;
|
||||||
import com.ruoyi.system.domain.SysNoticeRead;
|
|
||||||
import com.ruoyi.system.domain.SysNotice;
|
import com.ruoyi.system.domain.SysNotice;
|
||||||
|
import com.ruoyi.system.domain.SysNoticeRead;
|
||||||
import com.ruoyi.system.mapper.SysNoticeReadMapper;
|
import com.ruoyi.system.mapper.SysNoticeReadMapper;
|
||||||
import com.ruoyi.system.service.ISysNoticeReadService;
|
import com.ruoyi.system.service.ISysNoticeReadService;
|
||||||
|
|
||||||
@@ -62,6 +63,15 @@ public class SysNoticeReadServiceImpl implements ISysNoticeReadService
|
|||||||
noticeReadMapper.insertNoticeReadBatch(userId, noticeIds);
|
noticeReadMapper.insertNoticeReadBatch(userId, noticeIds);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 查询已阅读某公告的用户列表
|
||||||
|
*/
|
||||||
|
@Override
|
||||||
|
public List<Map<String, Object>> selectReadUsersByNoticeId(Long noticeId, String searchValue)
|
||||||
|
{
|
||||||
|
return noticeReadMapper.selectReadUsersByNoticeId(noticeId, searchValue);
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 删除公告时清理对应已读记录
|
* 删除公告时清理对应已读记录
|
||||||
*/
|
*/
|
||||||
|
|||||||
@@ -3,7 +3,7 @@ package com.ruoyi.system.service.impl;
|
|||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
import java.util.stream.Collectors;
|
import java.util.stream.Collectors;
|
||||||
import jakarta.validation.Validator;
|
import javax.validation.Validator;
|
||||||
import org.slf4j.Logger;
|
import org.slf4j.Logger;
|
||||||
import org.slf4j.LoggerFactory;
|
import org.slf4j.LoggerFactory;
|
||||||
import org.springframework.beans.factory.annotation.Autowired;
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
|
|||||||
@@ -18,9 +18,8 @@ spring:
|
|||||||
config:
|
config:
|
||||||
# 配置中心地址
|
# 配置中心地址
|
||||||
server-addr: 127.0.0.1:8848
|
server-addr: 127.0.0.1:8848
|
||||||
config:
|
# 配置文件格式
|
||||||
# 配置文件格式
|
file-extension: yml
|
||||||
file-extension: yml
|
# 共享配置
|
||||||
import:
|
shared-configs:
|
||||||
- nacos:application-${spring.profiles.active}.${spring.config.file-extension}
|
- application-${spring.profiles.active}.${spring.cloud.nacos.config.file-extension}
|
||||||
- nacos:${spring.application.name}-${spring.profiles.active}.${spring.config.file-extension}
|
|
||||||
|
|||||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user