mirror of
https://gitee.com/y_project/RuoYi-Cloud.git
synced 2026-04-26 01:07:52 +08:00
Compare commits
175 Commits
springboot
...
ad242d9327
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
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 的版本,保持同步更新。
|
||||
* 后端采用Spring Boot3、Spring Cloud & Alibaba。
|
||||
* 本仓库为RuoYi-Cloud的Spring Boot 2 的版本,保持同步更新。
|
||||
* 后端采用Spring Boot2、Spring Cloud & Alibaba。
|
||||
* 注册中心、配置中心选型Nacos,权限认证使用Redis。
|
||||
* 流量控制框架选型Sentinel,分布式事务选型Seata。
|
||||
* 阿里云优惠券:[点我进入](http://aly.ruoyi.vip),腾讯云优惠券:[点我进入](http://txy.ruoyi.vip)
|
||||
@@ -23,11 +23,11 @@
|
||||
|
||||
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 |
|
||||
| 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 版本均可混用搭配
|
||||
|
||||
|
||||
@@ -2,14 +2,11 @@ version : '3.8'
|
||||
services:
|
||||
ruoyi-nacos:
|
||||
container_name: ruoyi-nacos
|
||||
image: nacos/nacos-server:v3.0.2
|
||||
image: nacos/nacos-server:v2.4.2
|
||||
build:
|
||||
context: ./nacos
|
||||
environment:
|
||||
- MODE=standalone
|
||||
- NACOS_AUTH_TOKEN=your_auth_token
|
||||
- NACOS_AUTH_IDENTITY_KEY=your_identity_key
|
||||
- NACOS_AUTH_IDENTITY_VALUE=your_identity_value
|
||||
volumes:
|
||||
- ./nacos/logs/:/home/nacos/logs
|
||||
- ./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.default.token.expire.seconds=18000
|
||||
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.enable.userAgentAuthWhite=false
|
||||
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
|
||||
MAINTAINER ruoyi
|
||||
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
# 基础镜像
|
||||
FROM openjdk:17
|
||||
FROM openjdk:8-jre
|
||||
# author
|
||||
MAINTAINER ruoyi
|
||||
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
# 基础镜像
|
||||
FROM openjdk:17
|
||||
FROM openjdk:8-jre
|
||||
# author
|
||||
MAINTAINER ruoyi
|
||||
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
# 基础镜像
|
||||
FROM openjdk:17
|
||||
FROM openjdk:8-jre
|
||||
# author
|
||||
MAINTAINER ruoyi
|
||||
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
# 基础镜像
|
||||
FROM openjdk:17
|
||||
FROM openjdk:8-jre
|
||||
# author
|
||||
MAINTAINER ruoyi
|
||||
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
# 基础镜像
|
||||
FROM openjdk:17
|
||||
FROM openjdk:8-jre
|
||||
# author
|
||||
MAINTAINER ruoyi
|
||||
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
# 基础镜像
|
||||
FROM openjdk:17
|
||||
FROM openjdk:8-jre
|
||||
# author
|
||||
MAINTAINER ruoyi
|
||||
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
# 基础镜像
|
||||
FROM openjdk:17
|
||||
FROM openjdk:8-jre
|
||||
# author
|
||||
MAINTAINER ruoyi
|
||||
|
||||
|
||||
88
pom.xml
88
pom.xml
@@ -16,30 +16,43 @@
|
||||
<ruoyi.version>3.6.8</ruoyi.version>
|
||||
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
|
||||
<project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding>
|
||||
<java.version>17</java.version>
|
||||
<spring-boot.version>3.5.11</spring-boot.version>
|
||||
<spring-cloud.version>2025.0.1</spring-cloud.version>
|
||||
<spring-cloud-alibaba.version>2025.0.0.0</spring-cloud-alibaba.version>
|
||||
<spring-boot-admin.version>3.5.8</spring-boot-admin.version>
|
||||
<mybatis-spring.version>3.0.5</mybatis-spring.version>
|
||||
<java.version>1.8</java.version>
|
||||
<spring-boot.version>2.7.18</spring-boot.version>
|
||||
<spring-cloud.version>2021.0.9</spring-cloud.version>
|
||||
<spring-cloud-alibaba.version>2021.0.6.1</spring-cloud-alibaba.version>
|
||||
<spring-boot-admin.version>2.7.16</spring-boot-admin.version>
|
||||
<tobato.version>1.27.2</tobato.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>
|
||||
<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>
|
||||
<velocity.version>2.3</velocity.version>
|
||||
<fastjson.version>2.0.61</fastjson.version>
|
||||
<jjwt.version>0.9.1</jjwt.version>
|
||||
<minio.version>8.2.2</minio.version>
|
||||
<poi.version>4.1.2</poi.version>
|
||||
<springdoc.version>2.8.16</springdoc.version>
|
||||
<transmittable-thread-local.version>2.14.5</transmittable-thread-local.version>
|
||||
<springdoc.version>1.6.9</springdoc.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>
|
||||
|
||||
<!-- 依赖声明 -->
|
||||
<dependencyManagement>
|
||||
<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 微服务 -->
|
||||
<dependency>
|
||||
<groupId>org.springframework.cloud</groupId>
|
||||
@@ -67,10 +80,49 @@
|
||||
<scope>import</scope>
|
||||
</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 依赖配置 -->
|
||||
<dependency>
|
||||
<groupId>org.springdoc</groupId>
|
||||
<artifactId>springdoc-openapi-starter-webmvc-ui</artifactId>
|
||||
<artifactId>springdoc-openapi-ui</artifactId>
|
||||
<version>${springdoc.version}</version>
|
||||
</dependency>
|
||||
|
||||
@@ -86,18 +138,6 @@
|
||||
<groupId>com.github.pagehelper</groupId>
|
||||
<artifactId>pagehelper-spring-boot-starter</artifactId>
|
||||
<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>
|
||||
|
||||
<!-- io常用工具类 -->
|
||||
@@ -238,9 +278,7 @@
|
||||
<plugin>
|
||||
<groupId>org.apache.maven.plugins</groupId>
|
||||
<artifactId>maven-compiler-plugin</artifactId>
|
||||
<version>3.11.0</version>
|
||||
<configuration>
|
||||
<parameters>true</parameters>
|
||||
<source>${java.version}</source>
|
||||
<target>${java.version}</target>
|
||||
<encoding>${project.build.sourceEncoding}</encoding>
|
||||
|
||||
@@ -2,10 +2,10 @@ package com.ruoyi.system.api.domain;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
import jakarta.validation.constraints.Email;
|
||||
import jakarta.validation.constraints.NotBlank;
|
||||
import jakarta.validation.constraints.NotNull;
|
||||
import jakarta.validation.constraints.Size;
|
||||
import javax.validation.constraints.Email;
|
||||
import javax.validation.constraints.NotBlank;
|
||||
import javax.validation.constraints.NotNull;
|
||||
import javax.validation.constraints.Size;
|
||||
import org.apache.commons.lang3.builder.ToStringBuilder;
|
||||
import org.apache.commons.lang3.builder.ToStringStyle;
|
||||
import com.ruoyi.common.core.web.domain.BaseEntity;
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
package com.ruoyi.system.api.domain;
|
||||
|
||||
import jakarta.validation.constraints.NotBlank;
|
||||
import jakarta.validation.constraints.Size;
|
||||
import javax.validation.constraints.NotBlank;
|
||||
import javax.validation.constraints.Size;
|
||||
import org.apache.commons.lang3.builder.ToStringBuilder;
|
||||
import org.apache.commons.lang3.builder.ToStringStyle;
|
||||
import com.ruoyi.common.core.annotation.Excel;
|
||||
|
||||
@@ -1,8 +1,8 @@
|
||||
package com.ruoyi.system.api.domain;
|
||||
|
||||
import jakarta.validation.constraints.NotBlank;
|
||||
import jakarta.validation.constraints.Pattern;
|
||||
import jakarta.validation.constraints.Size;
|
||||
import javax.validation.constraints.NotBlank;
|
||||
import javax.validation.constraints.Pattern;
|
||||
import javax.validation.constraints.Size;
|
||||
import org.apache.commons.lang3.builder.ToStringBuilder;
|
||||
import org.apache.commons.lang3.builder.ToStringStyle;
|
||||
import com.ruoyi.common.core.annotation.Excel;
|
||||
|
||||
@@ -1,9 +1,9 @@
|
||||
package com.ruoyi.system.api.domain;
|
||||
|
||||
import java.util.Set;
|
||||
import jakarta.validation.constraints.NotBlank;
|
||||
import jakarta.validation.constraints.NotNull;
|
||||
import jakarta.validation.constraints.Size;
|
||||
import javax.validation.constraints.NotBlank;
|
||||
import javax.validation.constraints.NotNull;
|
||||
import javax.validation.constraints.Size;
|
||||
import org.apache.commons.lang3.builder.ToStringBuilder;
|
||||
import org.apache.commons.lang3.builder.ToStringStyle;
|
||||
import com.ruoyi.common.core.annotation.Excel;
|
||||
|
||||
@@ -2,7 +2,7 @@ package com.ruoyi.system.api.domain;
|
||||
|
||||
import java.util.Date;
|
||||
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.ToStringStyle;
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
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.web.bind.annotation.DeleteMapping;
|
||||
import org.springframework.web.bind.annotation.PostMapping;
|
||||
|
||||
@@ -18,9 +18,8 @@ spring:
|
||||
config:
|
||||
# 配置中心地址
|
||||
server-addr: 127.0.0.1:8848
|
||||
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}
|
||||
# 配置文件格式
|
||||
file-extension: yml
|
||||
# 共享配置
|
||||
shared-configs:
|
||||
- application-${spring.profiles.active}.${spring.cloud.nacos.config.file-extension}
|
||||
|
||||
@@ -53,24 +53,12 @@
|
||||
<artifactId>pagehelper-spring-boot-starter</artifactId>
|
||||
</dependency>
|
||||
|
||||
<!-- Mybatis Spring -->
|
||||
<dependency>
|
||||
<groupId>org.mybatis</groupId>
|
||||
<artifactId>mybatis-spring</artifactId>
|
||||
</dependency>
|
||||
|
||||
<!-- Hibernate Validator -->
|
||||
<dependency>
|
||||
<groupId>org.springframework.boot</groupId>
|
||||
<artifactId>spring-boot-starter-validation</artifactId>
|
||||
</dependency>
|
||||
|
||||
<!-- Spring Aop -->
|
||||
<dependency>
|
||||
<groupId>org.springframework.boot</groupId>
|
||||
<artifactId>spring-boot-starter-aop</artifactId>
|
||||
</dependency>
|
||||
|
||||
<!-- Jackson -->
|
||||
<dependency>
|
||||
<groupId>com.fasterxml.jackson.core</groupId>
|
||||
@@ -93,7 +81,6 @@
|
||||
<dependency>
|
||||
<groupId>javax.xml.bind</groupId>
|
||||
<artifactId>jaxb-api</artifactId>
|
||||
<version>2.3.1</version>
|
||||
</dependency>
|
||||
|
||||
<!-- Apache Lang3 -->
|
||||
@@ -116,8 +103,8 @@
|
||||
|
||||
<!-- Java Servlet -->
|
||||
<dependency>
|
||||
<groupId>jakarta.servlet</groupId>
|
||||
<artifactId>jakarta.servlet-api</artifactId>
|
||||
<groupId>javax.servlet</groupId>
|
||||
<artifactId>javax.servlet-api</artifactId>
|
||||
</dependency>
|
||||
|
||||
</dependencies>
|
||||
|
||||
@@ -51,8 +51,7 @@ public @interface Excel
|
||||
/**
|
||||
* BigDecimal 舍入规则 默认:BigDecimal.ROUND_HALF_EVEN
|
||||
*/
|
||||
@SuppressWarnings("deprecation")
|
||||
public int roundingMode() default BigDecimal.ROUND_HALF_EVEN;
|
||||
public int roundingMode() default BigDecimal.ROUND_HALF_EVEN;
|
||||
|
||||
/**
|
||||
* 导出时在excel中每个列的高度
|
||||
|
||||
@@ -31,9 +31,6 @@ public class GenConstants
|
||||
/** 上级菜单名称字段 */
|
||||
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" };
|
||||
|
||||
|
||||
@@ -16,7 +16,6 @@ import org.apache.commons.lang3.time.DateFormatUtils;
|
||||
*
|
||||
* @author ruoyi
|
||||
*/
|
||||
@SuppressWarnings("deprecation")
|
||||
public class DateUtils extends org.apache.commons.lang3.time.DateUtils
|
||||
{
|
||||
public static String YYYY = "yyyy";
|
||||
|
||||
@@ -8,10 +8,10 @@ import java.util.Collections;
|
||||
import java.util.Enumeration;
|
||||
import java.util.HashMap;
|
||||
import java.util.Map;
|
||||
import jakarta.servlet.ServletRequest;
|
||||
import jakarta.servlet.http.HttpServletRequest;
|
||||
import jakarta.servlet.http.HttpServletResponse;
|
||||
import jakarta.servlet.http.HttpSession;
|
||||
import javax.servlet.ServletRequest;
|
||||
import javax.servlet.http.HttpServletRequest;
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
import javax.servlet.http.HttpSession;
|
||||
import org.springframework.core.io.buffer.DataBuffer;
|
||||
import org.springframework.http.HttpHeaders;
|
||||
import org.springframework.http.HttpStatus;
|
||||
|
||||
@@ -12,7 +12,6 @@ import com.ruoyi.common.core.text.StrFormatter;
|
||||
*
|
||||
* @author ruoyi
|
||||
*/
|
||||
@SuppressWarnings("deprecation")
|
||||
public class StringUtils extends org.apache.commons.lang3.StringUtils
|
||||
{
|
||||
/** 空字符串 */
|
||||
|
||||
@@ -1,9 +1,9 @@
|
||||
package com.ruoyi.common.core.utils.bean;
|
||||
|
||||
import java.util.Set;
|
||||
import jakarta.validation.ConstraintViolation;
|
||||
import jakarta.validation.ConstraintViolationException;
|
||||
import jakarta.validation.Validator;
|
||||
import javax.validation.ConstraintViolation;
|
||||
import javax.validation.ConstraintViolationException;
|
||||
import javax.validation.Validator;
|
||||
|
||||
/**
|
||||
* bean对象属性验证
|
||||
|
||||
@@ -8,8 +8,8 @@ import java.io.OutputStream;
|
||||
import java.io.UnsupportedEncodingException;
|
||||
import java.net.URLEncoder;
|
||||
import java.nio.charset.StandardCharsets;
|
||||
import jakarta.servlet.http.HttpServletRequest;
|
||||
import jakarta.servlet.http.HttpServletResponse;
|
||||
import javax.servlet.http.HttpServletRequest;
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
import org.apache.commons.lang3.ArrayUtils;
|
||||
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.UnknownHostException;
|
||||
import jakarta.servlet.http.HttpServletRequest;
|
||||
import javax.servlet.http.HttpServletRequest;
|
||||
import com.ruoyi.common.core.utils.ServletUtils;
|
||||
import com.ruoyi.common.core.utils.StringUtils;
|
||||
|
||||
|
||||
@@ -19,7 +19,7 @@ import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.Set;
|
||||
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.RegExUtils;
|
||||
import org.apache.commons.lang3.reflect.FieldUtils;
|
||||
@@ -387,7 +387,7 @@ public class ExcelUtil<T>
|
||||
Object val = this.getCellValue(row, entry.getKey());
|
||||
|
||||
// 如果不存在实例则新建.
|
||||
entity = (entity == null ? clazz.getDeclaredConstructor().newInstance() : entity);
|
||||
entity = (entity == null ? clazz.newInstance() : entity);
|
||||
// 从map中得到对应列的field.
|
||||
Field field = (Field) entry.getValue()[0];
|
||||
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)
|
||||
{
|
||||
Cell cell = null;
|
||||
@@ -1329,7 +1328,7 @@ public class ExcelUtil<T>
|
||||
{
|
||||
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 });
|
||||
value = formatMethod.invoke(instance, value, excel.args(), cell, this.wb);
|
||||
}
|
||||
|
||||
@@ -310,8 +310,7 @@ public class ReflectUtils
|
||||
/**
|
||||
* 改变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()))
|
||||
&& !method.isAccessible())
|
||||
@@ -323,8 +322,7 @@ public class ReflectUtils
|
||||
/**
|
||||
* 改变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())
|
||||
|| Modifier.isFinal(field.getModifiers())) && !field.isAccessible())
|
||||
|
||||
@@ -7,12 +7,17 @@ import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
import org.springframework.web.bind.WebDataBinder;
|
||||
import org.springframework.web.bind.annotation.InitBinder;
|
||||
import com.github.pagehelper.PageHelper;
|
||||
import com.github.pagehelper.PageInfo;
|
||||
import com.ruoyi.common.core.constant.HttpStatus;
|
||||
import com.ruoyi.common.core.utils.DateUtils;
|
||||
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.page.PageDomain;
|
||||
import com.ruoyi.common.core.web.page.TableDataInfo;
|
||||
import com.ruoyi.common.core.web.page.TableSupport;
|
||||
|
||||
/**
|
||||
* web层通用数据处理
|
||||
@@ -48,6 +53,19 @@ public class BaseController
|
||||
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;
|
||||
|
||||
import jakarta.validation.Constraint;
|
||||
import jakarta.validation.Payload;
|
||||
import javax.validation.Constraint;
|
||||
import javax.validation.Payload;
|
||||
import java.lang.annotation.ElementType;
|
||||
import java.lang.annotation.Retention;
|
||||
import java.lang.annotation.RetentionPolicy;
|
||||
|
||||
@@ -2,8 +2,8 @@ package com.ruoyi.common.core.xss;
|
||||
|
||||
import java.util.regex.Matcher;
|
||||
import java.util.regex.Pattern;
|
||||
import jakarta.validation.ConstraintValidator;
|
||||
import jakarta.validation.ConstraintValidatorContext;
|
||||
import javax.validation.ConstraintValidator;
|
||||
import javax.validation.ConstraintValidatorContext;
|
||||
import com.ruoyi.common.core.utils.StringUtils;
|
||||
|
||||
/**
|
||||
|
||||
@@ -20,14 +20,14 @@
|
||||
<!-- Druid -->
|
||||
<dependency>
|
||||
<groupId>com.alibaba</groupId>
|
||||
<artifactId>druid-spring-boot-3-starter</artifactId>
|
||||
<artifactId>druid-spring-boot-starter</artifactId>
|
||||
<version>${druid.version}</version>
|
||||
</dependency>
|
||||
|
||||
<!-- Dynamic DataSource -->
|
||||
<dependency>
|
||||
<groupId>com.baomidou</groupId>
|
||||
<artifactId>dynamic-datasource-spring-boot3-starter</artifactId>
|
||||
<artifactId>dynamic-datasource-spring-boot-starter</artifactId>
|
||||
<version>${dynamic-ds.version}</version>
|
||||
</dependency>
|
||||
|
||||
|
||||
@@ -2,8 +2,8 @@ package com.ruoyi.common.log.aspect;
|
||||
|
||||
import java.util.Collection;
|
||||
import java.util.Map;
|
||||
import jakarta.servlet.http.HttpServletRequest;
|
||||
import jakarta.servlet.http.HttpServletResponse;
|
||||
import javax.servlet.http.HttpServletRequest;
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
import org.apache.commons.lang3.ArrayUtils;
|
||||
import org.aspectj.lang.JoinPoint;
|
||||
import org.aspectj.lang.annotation.AfterReturning;
|
||||
|
||||
@@ -18,7 +18,6 @@ import org.springframework.data.redis.serializer.StringRedisSerializer;
|
||||
@Configuration
|
||||
@EnableCaching
|
||||
@AutoConfigureBefore(RedisAutoConfiguration.class)
|
||||
@SuppressWarnings("deprecation")
|
||||
public class RedisConfig extends CachingConfigurerSupport
|
||||
{
|
||||
@Bean
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
package com.ruoyi.common.security.feign;
|
||||
|
||||
import java.util.Map;
|
||||
import jakarta.servlet.http.HttpServletRequest;
|
||||
import javax.servlet.http.HttpServletRequest;
|
||||
import org.springframework.stereotype.Component;
|
||||
import com.ruoyi.common.core.constant.SecurityConstants;
|
||||
import com.ruoyi.common.core.utils.ServletUtils;
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
package com.ruoyi.common.security.handler;
|
||||
|
||||
import jakarta.servlet.http.HttpServletRequest;
|
||||
import javax.servlet.http.HttpServletRequest;
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
import org.springframework.validation.BindException;
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
package com.ruoyi.common.security.interceptor;
|
||||
|
||||
import jakarta.servlet.http.HttpServletRequest;
|
||||
import jakarta.servlet.http.HttpServletResponse;
|
||||
import javax.servlet.http.HttpServletRequest;
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
import org.springframework.web.method.HandlerMethod;
|
||||
import org.springframework.web.servlet.AsyncHandlerInterceptor;
|
||||
import com.ruoyi.common.core.constant.SecurityConstants;
|
||||
|
||||
@@ -3,7 +3,7 @@ package com.ruoyi.common.security.service;
|
||||
import java.util.HashMap;
|
||||
import java.util.Map;
|
||||
import java.util.concurrent.TimeUnit;
|
||||
import jakarta.servlet.http.HttpServletRequest;
|
||||
import javax.servlet.http.HttpServletRequest;
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
package com.ruoyi.common.security.utils;
|
||||
|
||||
import javax.servlet.http.HttpServletRequest;
|
||||
import org.springframework.security.crypto.bcrypt.BCryptPasswordEncoder;
|
||||
import com.ruoyi.common.core.constant.SecurityConstants;
|
||||
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.StringUtils;
|
||||
import com.ruoyi.system.api.model.LoginUser;
|
||||
import jakarta.servlet.http.HttpServletRequest;
|
||||
|
||||
/**
|
||||
* 权限获取工具类
|
||||
|
||||
@@ -26,7 +26,7 @@
|
||||
<!-- SpringDoc webmvc -->
|
||||
<dependency>
|
||||
<groupId>org.springdoc</groupId>
|
||||
<artifactId>springdoc-openapi-starter-webmvc-ui</artifactId>
|
||||
<artifactId>springdoc-openapi-ui</artifactId>
|
||||
</dependency>
|
||||
|
||||
</dependencies>
|
||||
|
||||
@@ -2,8 +2,6 @@ package com.ruoyi.common.swagger.config;
|
||||
|
||||
import java.util.ArrayList;
|
||||
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.ConditionalOnProperty;
|
||||
import org.springframework.boot.context.properties.EnableConfigurationProperties;
|
||||
@@ -21,7 +19,6 @@ import io.swagger.v3.oas.models.servers.Server;
|
||||
*
|
||||
* @author ruoyi
|
||||
*/
|
||||
@AutoConfiguration(before = SpringDocConfiguration.class)
|
||||
@EnableConfigurationProperties(SpringDocProperties.class)
|
||||
@ConditionalOnProperty(name = "springdoc.api-docs.enabled", havingValue = "true", matchIfMissing = true)
|
||||
public class SpringDocAutoConfiguration
|
||||
|
||||
@@ -19,7 +19,7 @@
|
||||
<!-- SpringCloud Gateway -->
|
||||
<dependency>
|
||||
<groupId>org.springframework.cloud</groupId>
|
||||
<artifactId>spring-cloud-starter-gateway-server-webflux</artifactId>
|
||||
<artifactId>spring-cloud-starter-gateway</artifactId>
|
||||
</dependency>
|
||||
|
||||
<!-- SpringCloud Alibaba Nacos -->
|
||||
@@ -57,7 +57,7 @@
|
||||
<groupId>org.springframework.boot</groupId>
|
||||
<artifactId>spring-boot-starter-actuator</artifactId>
|
||||
</dependency>
|
||||
|
||||
|
||||
<!-- SpringCloud Loadbalancer -->
|
||||
<dependency>
|
||||
<groupId>org.springframework.cloud</groupId>
|
||||
@@ -79,7 +79,7 @@
|
||||
<!-- Springdoc -->
|
||||
<dependency>
|
||||
<groupId>org.springdoc</groupId>
|
||||
<artifactId>springdoc-openapi-starter-webflux-ui</artifactId>
|
||||
<artifactId>springdoc-openapi-webflux-ui</artifactId>
|
||||
<version>${springdoc.version}</version>
|
||||
</dependency>
|
||||
|
||||
|
||||
@@ -2,8 +2,8 @@ package com.ruoyi.gateway.config;
|
||||
|
||||
import java.util.Set;
|
||||
import java.util.stream.Collectors;
|
||||
import org.springdoc.core.properties.AbstractSwaggerUiConfigProperties;
|
||||
import org.springdoc.core.properties.SwaggerUiConfigProperties;
|
||||
import org.springdoc.core.AbstractSwaggerUiConfigProperties;
|
||||
import org.springdoc.core.SwaggerUiConfigProperties;
|
||||
import org.springframework.beans.factory.InitializingBean;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.boot.autoconfigure.condition.ConditionalOnProperty;
|
||||
|
||||
@@ -64,7 +64,6 @@ public class ValidateCodeFilter extends AbstractGatewayFilterFactory<Object>
|
||||
};
|
||||
}
|
||||
|
||||
@SuppressWarnings("deprecation")
|
||||
private String resolveBodyFromRequest(ServerHttpRequest serverHttpRequest)
|
||||
{
|
||||
// 获取请求体
|
||||
|
||||
@@ -3,7 +3,7 @@ package com.ruoyi.gateway.service.impl;
|
||||
import java.awt.image.BufferedImage;
|
||||
import java.io.IOException;
|
||||
import java.util.concurrent.TimeUnit;
|
||||
import jakarta.annotation.Resource;
|
||||
import javax.annotation.Resource;
|
||||
import javax.imageio.ImageIO;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
@@ -18,6 +18,11 @@ spring:
|
||||
config:
|
||||
# 配置中心地址
|
||||
server-addr: 127.0.0.1:8848
|
||||
# 配置文件格式
|
||||
file-extension: yml
|
||||
# 共享配置
|
||||
shared-configs:
|
||||
- application-${spring.profiles.active}.${spring.cloud.nacos.config.file-extension}
|
||||
sentinel:
|
||||
# 取消控制台懒加载
|
||||
eager: true
|
||||
@@ -33,9 +38,3 @@ spring:
|
||||
groupId: DEFAULT_GROUP
|
||||
data-type: json
|
||||
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}
|
||||
|
||||
@@ -46,6 +46,12 @@
|
||||
<groupId>org.springframework.boot</groupId>
|
||||
<artifactId>spring-boot-starter-web</artifactId>
|
||||
</dependency>
|
||||
|
||||
<!-- FastDFS -->
|
||||
<dependency>
|
||||
<groupId>com.github.tobato</groupId>
|
||||
<artifactId>fastdfs-client</artifactId>
|
||||
</dependency>
|
||||
|
||||
<!-- Minio -->
|
||||
<dependency>
|
||||
|
||||
@@ -2,7 +2,7 @@ package com.ruoyi.file.config;
|
||||
|
||||
import java.util.HashMap;
|
||||
import java.util.Map;
|
||||
import jakarta.servlet.DispatcherType;
|
||||
import javax.servlet.DispatcherType;
|
||||
import org.springframework.beans.factory.annotation.Value;
|
||||
import org.springframework.boot.autoconfigure.condition.ConditionalOnProperty;
|
||||
import org.springframework.boot.web.servlet.FilterRegistrationBean;
|
||||
|
||||
@@ -3,14 +3,14 @@ package com.ruoyi.file.filter;
|
||||
import java.io.IOException;
|
||||
import java.util.Arrays;
|
||||
import java.util.List;
|
||||
import jakarta.servlet.Filter;
|
||||
import jakarta.servlet.FilterChain;
|
||||
import jakarta.servlet.FilterConfig;
|
||||
import jakarta.servlet.ServletException;
|
||||
import jakarta.servlet.ServletRequest;
|
||||
import jakarta.servlet.ServletResponse;
|
||||
import jakarta.servlet.http.HttpServletRequest;
|
||||
import jakarta.servlet.http.HttpServletResponse;
|
||||
import javax.servlet.Filter;
|
||||
import javax.servlet.FilterChain;
|
||||
import javax.servlet.FilterConfig;
|
||||
import javax.servlet.ServletException;
|
||||
import javax.servlet.ServletRequest;
|
||||
import javax.servlet.ServletResponse;
|
||||
import javax.servlet.http.HttpServletRequest;
|
||||
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:
|
||||
# 配置中心地址
|
||||
server-addr: 127.0.0.1:8848
|
||||
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}
|
||||
# 配置文件格式
|
||||
file-extension: yml
|
||||
# 共享配置
|
||||
shared-configs:
|
||||
- application-${spring.profiles.active}.${spring.cloud.nacos.config.file-extension}
|
||||
|
||||
@@ -4,7 +4,7 @@ import java.io.IOException;
|
||||
import java.util.HashMap;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import jakarta.servlet.http.HttpServletResponse;
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
import org.apache.commons.io.IOUtils;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.validation.annotation.Validated;
|
||||
|
||||
@@ -1,8 +1,8 @@
|
||||
package com.ruoyi.gen.domain;
|
||||
|
||||
import java.util.List;
|
||||
import jakarta.validation.Valid;
|
||||
import jakarta.validation.constraints.NotBlank;
|
||||
import javax.validation.Valid;
|
||||
import javax.validation.constraints.NotBlank;
|
||||
import org.apache.commons.lang3.ArrayUtils;
|
||||
import com.ruoyi.common.core.constant.GenConstants;
|
||||
import com.ruoyi.common.core.utils.StringUtils;
|
||||
@@ -101,9 +101,6 @@ public class GenTable extends BaseEntity
|
||||
/** 上级菜单名称字段 */
|
||||
private String parentMenuName;
|
||||
|
||||
/** 是否生成详情页 */
|
||||
private boolean isView;
|
||||
|
||||
public Long getTableId()
|
||||
{
|
||||
return tableId;
|
||||
@@ -354,16 +351,6 @@ public class GenTable extends BaseEntity
|
||||
this.parentMenuName = parentMenuName;
|
||||
}
|
||||
|
||||
public boolean isView()
|
||||
{
|
||||
return isView;
|
||||
}
|
||||
|
||||
public void setView(boolean isView)
|
||||
{
|
||||
this.isView = isView;
|
||||
}
|
||||
|
||||
public boolean isSub()
|
||||
{
|
||||
return isSub(this.tplCategory);
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
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.web.domain.BaseEntity;
|
||||
|
||||
|
||||
@@ -209,7 +209,7 @@ public class GenTableServiceImpl implements IGenTableService
|
||||
VelocityContext context = VelocityUtils.prepareContext(table);
|
||||
|
||||
// 获取模板列表
|
||||
List<String> templates = VelocityUtils.getTemplateList(table);
|
||||
List<String> templates = VelocityUtils.getTemplateList(table.getTplCategory(), table.getTplWebType());
|
||||
for (String template : templates)
|
||||
{
|
||||
// 渲染模板
|
||||
@@ -253,10 +253,10 @@ public class GenTableServiceImpl implements IGenTableService
|
||||
VelocityContext context = VelocityUtils.prepareContext(table);
|
||||
|
||||
// 获取模板列表
|
||||
List<String> templates = VelocityUtils.getTemplateList(table);
|
||||
List<String> templates = VelocityUtils.getTemplateList(table.getTplCategory(), table.getTplWebType());
|
||||
for (String template : templates)
|
||||
{
|
||||
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"))
|
||||
if (!StringUtils.containsAny(template, "sql.vm", "api.js.vm", "index.vue.vm", "index-tree.vue.vm"))
|
||||
{
|
||||
// 渲染模板
|
||||
StringWriter sw = new StringWriter();
|
||||
@@ -371,7 +371,7 @@ public class GenTableServiceImpl implements IGenTableService
|
||||
VelocityContext context = VelocityUtils.prepareContext(table);
|
||||
|
||||
// 获取模板列表
|
||||
List<String> templates = VelocityUtils.getTemplateList(table);
|
||||
List<String> templates = VelocityUtils.getTemplateList(table.getTplCategory(), table.getTplWebType());
|
||||
for (String template : templates)
|
||||
{
|
||||
// 渲染模板
|
||||
@@ -524,14 +524,12 @@ public class GenTableServiceImpl implements IGenTableService
|
||||
String treeName = paramsObj.getString(GenConstants.TREE_NAME);
|
||||
Long parentMenuId = paramsObj.getLongValue(GenConstants.PARENT_MENU_ID);
|
||||
String parentMenuName = paramsObj.getString(GenConstants.PARENT_MENU_NAME);
|
||||
boolean isView = paramsObj.getBooleanValue(GenConstants.GEN_VIEW);
|
||||
|
||||
genTable.setTreeCode(treeCode);
|
||||
genTable.setTreeParentCode(treeParentCode);
|
||||
genTable.setTreeName(treeName);
|
||||
genTable.setParentMenuId(parentMenuId);
|
||||
genTable.setParentMenuName(parentMenuName);
|
||||
genTable.setView(isView);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -14,7 +14,7 @@ import com.ruoyi.gen.domain.GenTable;
|
||||
import com.ruoyi.gen.domain.GenTableColumn;
|
||||
|
||||
/**
|
||||
* 模板处理工具类
|
||||
* 模板工具类
|
||||
*
|
||||
* @author ruoyi
|
||||
*/
|
||||
@@ -68,7 +68,6 @@ public class VelocityUtils
|
||||
velocityContext.put("columns", genTable.getColumns());
|
||||
velocityContext.put("table", genTable);
|
||||
velocityContext.put("dicts", getDicts(genTable));
|
||||
setExtensionsContext(velocityContext, genTable.getOptions());
|
||||
setMenuVelocityContext(velocityContext, genTable);
|
||||
if (GenConstants.TPL_TREE.equals(tplCategory))
|
||||
{
|
||||
@@ -81,13 +80,6 @@ public class VelocityUtils
|
||||
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)
|
||||
{
|
||||
String options = genTable.getOptions();
|
||||
@@ -142,12 +134,8 @@ public class VelocityUtils
|
||||
* @param tplWebType 前端类型
|
||||
* @return 模板列表
|
||||
*/
|
||||
public static List<String> getTemplateList(GenTable table)
|
||||
public static List<String> getTemplateList(String tplCategory, String tplWebType)
|
||||
{
|
||||
String tplWebType = table.getTplWebType();
|
||||
String tplCategory = table.getTplCategory();
|
||||
JSONObject paramsObj = JSONObject.parseObject(table.getOptions());
|
||||
boolean isView = genView(paramsObj);
|
||||
String useWebType = "vm/vue";
|
||||
String apiTemplate = "vm/js/api.js.vm";
|
||||
if (StringUtils.equals(ELEMENT_PLUS, tplWebType))
|
||||
@@ -186,10 +174,6 @@ public class VelocityUtils
|
||||
templates.add(useWebType + "/index.vue.vm");
|
||||
templates.add("vm/java/sub-domain.java.vm");
|
||||
}
|
||||
if (isView)
|
||||
{
|
||||
templates.add(useWebType + "/view.vue.vm");
|
||||
}
|
||||
return templates;
|
||||
}
|
||||
|
||||
@@ -269,10 +253,6 @@ public class VelocityUtils
|
||||
{
|
||||
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;
|
||||
}
|
||||
|
||||
@@ -414,21 +394,6 @@ public class VelocityUtils
|
||||
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;
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取树名称
|
||||
*
|
||||
|
||||
@@ -18,9 +18,8 @@ spring:
|
||||
config:
|
||||
# 配置中心地址
|
||||
server-addr: 127.0.0.1:8848
|
||||
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}
|
||||
# 配置文件格式
|
||||
file-extension: yml
|
||||
# 共享配置
|
||||
shared-configs:
|
||||
- application-${spring.profiles.active}.${spring.cloud.nacos.config.file-extension}
|
||||
|
||||
@@ -94,7 +94,6 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||
<set>
|
||||
<if test="columnComment != null">column_comment = #{columnComment},</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="isInsert != null">is_insert = #{isInsert},</if>
|
||||
<if test="isEdit != null">is_edit = #{isEdit},</if>
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
package ${packageName}.controller;
|
||||
|
||||
import java.util.List;
|
||||
import jakarta.servlet.http.HttpServletResponse;
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.web.bind.annotation.GetMapping;
|
||||
import org.springframework.web.bind.annotation.PostMapping;
|
||||
|
||||
@@ -139,15 +139,6 @@
|
||||
#end
|
||||
<el-table-column label="操作" align="center" class-name="small-padding fixed-width">
|
||||
<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
|
||||
size="mini"
|
||||
type="text"
|
||||
@@ -173,10 +164,6 @@
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
|
||||
#if($genView)
|
||||
<!-- ${functionName}详情抽屉 -->
|
||||
<${businessName}-view-drawer ref="${businessName}ViewRef" />
|
||||
#end
|
||||
<!-- 添加或修改${functionName}对话框 -->
|
||||
#if($table.formColNum == 2)
|
||||
#set($dialogWidth = "800px")
|
||||
@@ -332,9 +319,6 @@
|
||||
|
||||
<script>
|
||||
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 "@riophae/vue-treeselect/dist/vue-treeselect.css"
|
||||
|
||||
@@ -344,9 +328,6 @@ export default {
|
||||
dicts: [${dicts}],
|
||||
#end
|
||||
components: {
|
||||
#if($genView)
|
||||
${BusinessName}ViewDrawer,
|
||||
#end
|
||||
Treeselect
|
||||
},
|
||||
data() {
|
||||
@@ -502,12 +483,6 @@ export default {
|
||||
this.refreshTable = true
|
||||
})
|
||||
},
|
||||
#if($genView)
|
||||
/** 详情按钮操作 */
|
||||
handleViewData(row) {
|
||||
this.#[[$]]#refs["${businessName}ViewRef"].open(row.${pkColumn.javaField})
|
||||
},
|
||||
#end
|
||||
/** 修改按钮操作 */
|
||||
handleUpdate(row) {
|
||||
this.reset()
|
||||
|
||||
@@ -153,15 +153,6 @@
|
||||
#end
|
||||
<el-table-column label="操作" align="center" class-name="small-padding fixed-width">
|
||||
<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
|
||||
size="mini"
|
||||
type="text"
|
||||
@@ -188,10 +179,6 @@
|
||||
@pagination="getList"
|
||||
/>
|
||||
|
||||
#if($genView)
|
||||
<!-- ${functionName}详情抽屉 -->
|
||||
<${businessName}-view-drawer ref="${businessName}ViewRef" />
|
||||
#end
|
||||
<!-- 添加或修改${functionName}对话框 -->
|
||||
#if($table.formColNum == 2)
|
||||
#set($dialogWidth = "800px")
|
||||
@@ -400,15 +387,9 @@
|
||||
|
||||
<script>
|
||||
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 {
|
||||
name: "${BusinessName}",
|
||||
#if($genView)
|
||||
components: { ${BusinessName}ViewDrawer },
|
||||
#end
|
||||
#if(${dicts} != '')
|
||||
dicts: [${dicts}],
|
||||
#end
|
||||
@@ -642,12 +623,6 @@ export default {
|
||||
handle${subClassName}SelectionChange(selection) {
|
||||
this.checked${subClassName} = selection.map(item => item.index)
|
||||
},
|
||||
#end
|
||||
#if($genView)
|
||||
/** 详情按钮操作 */
|
||||
handleViewData(row) {
|
||||
this.#[[$]]#refs["${businessName}ViewRef"].open(row.${pkColumn.javaField})
|
||||
},
|
||||
#end
|
||||
/** 导出按钮操作 */
|
||||
handleExport() {
|
||||
|
||||
@@ -136,9 +136,6 @@
|
||||
#end
|
||||
<el-table-column label="操作" align="center" class-name="small-padding fixed-width">
|
||||
<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="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>
|
||||
@@ -146,10 +143,6 @@
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
|
||||
#if($genView)
|
||||
<!-- ${functionName}详情抽屉 -->
|
||||
<${businessName}-view-drawer ref="${businessName}ViewRef" />
|
||||
#end
|
||||
<!-- 添加或修改${functionName}对话框 -->
|
||||
#if($table.formColNum == 2)
|
||||
#set($dialogWidth = "800px")
|
||||
@@ -314,9 +307,6 @@
|
||||
|
||||
<script setup name="${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()
|
||||
#if(${dicts} != '')
|
||||
@@ -344,7 +334,7 @@ const data = reactive({
|
||||
queryParams: {
|
||||
#foreach ($column in $columns)
|
||||
#if($column.query)
|
||||
$column.javaField: undefined#if($foreach.count != $columns.size()),#end
|
||||
$column.javaField: null#if($foreach.count != $columns.size()),#end
|
||||
#end
|
||||
#end
|
||||
},
|
||||
@@ -401,13 +391,13 @@ function getTreeselect() {
|
||||
})
|
||||
}
|
||||
|
||||
/** 取消按钮 */
|
||||
// 取消按钮
|
||||
function cancel() {
|
||||
open.value = false
|
||||
reset()
|
||||
}
|
||||
|
||||
/** 表单重置 */
|
||||
// 表单重置
|
||||
function reset() {
|
||||
form.value = {
|
||||
#foreach ($column in $columns)
|
||||
@@ -459,13 +449,6 @@ function toggleExpandAll() {
|
||||
refreshTable.value = true
|
||||
})
|
||||
}
|
||||
#if($genView)
|
||||
|
||||
/** 详情按钮操作 */
|
||||
function handleViewData(row) {
|
||||
proxy.#[[$]]#refs["${businessName}ViewRef"].open(row.${pkColumn.javaField})
|
||||
}
|
||||
#end
|
||||
|
||||
/** 修改按钮操作 */
|
||||
async function handleUpdate(row) {
|
||||
|
||||
@@ -148,9 +148,6 @@
|
||||
#end
|
||||
<el-table-column label="操作" align="center" class-name="small-padding fixed-width">
|
||||
<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="Delete" @click="handleDelete(scope.row)" v-hasPermi="['${permissionPrefix}:remove']">删除</el-button>
|
||||
</template>
|
||||
@@ -165,10 +162,6 @@
|
||||
@pagination="getList"
|
||||
/>
|
||||
|
||||
#if($genView)
|
||||
<!-- ${functionName}详情抽屉 -->
|
||||
<${businessName}-view-drawer ref="${businessName}ViewRef" />
|
||||
#end
|
||||
<!-- 添加或修改${functionName}对话框 -->
|
||||
#if($table.formColNum == 2)
|
||||
#set($dialogWidth = "800px")
|
||||
@@ -388,9 +381,6 @@
|
||||
|
||||
<script setup name="${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()
|
||||
#if(${dicts} != '')
|
||||
@@ -427,7 +417,7 @@ const data = reactive({
|
||||
pageSize: 10,
|
||||
#foreach ($column in $columns)
|
||||
#if($column.query)
|
||||
$column.javaField: undefined#if($foreach.count != $columns.size()),#end
|
||||
$column.javaField: null#if($foreach.count != $columns.size()),#end
|
||||
#end
|
||||
#end
|
||||
},
|
||||
@@ -475,13 +465,13 @@ function getList() {
|
||||
})
|
||||
}
|
||||
|
||||
/** 取消按钮 */
|
||||
// 取消按钮
|
||||
function cancel() {
|
||||
open.value = false
|
||||
reset()
|
||||
}
|
||||
|
||||
/** 表单重置 */
|
||||
// 表单重置
|
||||
function reset() {
|
||||
form.value = {
|
||||
#foreach ($column in $columns)
|
||||
@@ -516,7 +506,7 @@ function resetQuery() {
|
||||
handleQuery()
|
||||
}
|
||||
|
||||
/** 多选框选中数据 */
|
||||
// 多选框选中数据
|
||||
function handleSelectionChange(selection) {
|
||||
ids.value = selection.map(item => item.${pkColumn.javaField})
|
||||
single.value = selection.length != 1
|
||||
@@ -596,7 +586,7 @@ function handleAdd${subClassName}() {
|
||||
#foreach($column in $subTable.columns)
|
||||
#if($column.pk || $column.javaField == ${subTableFkclassName})
|
||||
#elseif($column.list && "" != $javaField)
|
||||
obj.$column.javaField = undefined
|
||||
obj.$column.javaField = ""
|
||||
#end
|
||||
#end
|
||||
${subclassName}List.value.push(obj)
|
||||
@@ -620,13 +610,6 @@ function handle${subClassName}SelectionChange(selection) {
|
||||
checked${subClassName}.value = selection.map(item => item.index)
|
||||
}
|
||||
|
||||
#end
|
||||
#if($genView)
|
||||
/** 详情按钮操作 */
|
||||
function handleViewData(row) {
|
||||
proxy.#[[$]]#refs["${businessName}ViewRef"].open(row.${pkColumn.javaField})
|
||||
}
|
||||
|
||||
#end
|
||||
/** 导出按钮操作 */
|
||||
function handleExport() {
|
||||
|
||||
@@ -1,83 +0,0 @@
|
||||
<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,9 +136,6 @@
|
||||
#end
|
||||
<el-table-column label="操作" align="center" class-name="small-padding fixed-width">
|
||||
<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="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>
|
||||
@@ -146,10 +143,6 @@
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
|
||||
#if($genView)
|
||||
<!-- ${functionName}详情抽屉 -->
|
||||
<${businessName}-view-drawer ref="${businessName}ViewRef" />
|
||||
#end
|
||||
<!-- 添加或修改${functionName}对话框 -->
|
||||
#if($table.formColNum == 2)
|
||||
#set($dialogWidth = "800px")
|
||||
@@ -314,9 +307,6 @@
|
||||
|
||||
<script setup lang="ts" name="${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 { TreeSelect } from '@/types/api/common'
|
||||
|
||||
@@ -403,13 +393,13 @@ function getTreeselect() {
|
||||
})
|
||||
}
|
||||
|
||||
/** 取消按钮 */
|
||||
// 取消按钮
|
||||
function cancel() {
|
||||
open.value = false
|
||||
reset()
|
||||
}
|
||||
|
||||
/** 表单重置 */
|
||||
// 表单重置
|
||||
function reset() {
|
||||
form.value = {
|
||||
#foreach ($column in $columns)
|
||||
@@ -461,13 +451,6 @@ function toggleExpandAll() {
|
||||
refreshTable.value = true
|
||||
})
|
||||
}
|
||||
#if($genView)
|
||||
|
||||
/** 详情按钮操作 */
|
||||
function handleViewData(row: ${ClassName}) {
|
||||
proxy.#[[$]]#refs["${businessName}ViewRef"].open(row.${pkColumn.javaField})
|
||||
}
|
||||
#end
|
||||
|
||||
/** 修改按钮操作 */
|
||||
async function handleUpdate(row: ${ClassName}) {
|
||||
|
||||
@@ -148,9 +148,6 @@
|
||||
#end
|
||||
<el-table-column label="操作" align="center" class-name="small-padding fixed-width">
|
||||
<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="Delete" @click="handleDelete(scope.row)" v-hasPermi="['${permissionPrefix}:remove']">删除</el-button>
|
||||
</template>
|
||||
@@ -165,10 +162,6 @@
|
||||
@pagination="getList"
|
||||
/>
|
||||
|
||||
#if($genView)
|
||||
<!-- ${functionName}详情抽屉 -->
|
||||
<${businessName}-view-drawer ref="${businessName}ViewRef" />
|
||||
#end
|
||||
<!-- 添加或修改${functionName}对话框 -->
|
||||
#if($table.formColNum == 2)
|
||||
#set($dialogWidth = "800px")
|
||||
@@ -386,16 +379,13 @@
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script setup lang="ts" name="${BusinessName}">
|
||||
<script setup lang="ts" name="Config">
|
||||
#if($table.sub)
|
||||
import type { ${ClassName}, ${subClassName}, ${BusinessName}QueryParams } from "@/types/api/${moduleName}/${businessName}"
|
||||
#else
|
||||
import type { ${ClassName}, ${BusinessName}QueryParams } from "@/types/api/${moduleName}/${businessName}"
|
||||
#end
|
||||
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()
|
||||
#if(${dicts} != '')
|
||||
@@ -480,13 +470,13 @@ function getList() {
|
||||
})
|
||||
}
|
||||
|
||||
/** 取消按钮 */
|
||||
// 取消按钮
|
||||
function cancel() {
|
||||
open.value = false
|
||||
reset()
|
||||
}
|
||||
|
||||
/** 表单重置 */
|
||||
// 表单重置
|
||||
function reset() {
|
||||
form.value = {
|
||||
#foreach ($column in $columns)
|
||||
@@ -521,7 +511,7 @@ function resetQuery() {
|
||||
handleQuery()
|
||||
}
|
||||
|
||||
/** 多选框选中数据 */
|
||||
// 多选框选中数据
|
||||
function handleSelectionChange(selection: ${ClassName}[]) {
|
||||
ids.value = selection.map(item => item.${pkColumn.javaField})
|
||||
single.value = selection.length != 1
|
||||
@@ -625,13 +615,6 @@ function handle${subClassName}SelectionChange(selection: any[]) {
|
||||
checked${subClassName}.value = selection.map(item => item.index)
|
||||
}
|
||||
|
||||
#end
|
||||
#if($genView)
|
||||
/** 详情按钮操作 */
|
||||
function handleViewData(row: ${ClassName}) {
|
||||
proxy.#[[$]]#refs["${businessName}ViewRef"].open(row.${pkColumn.javaField})
|
||||
}
|
||||
|
||||
#end
|
||||
/** 导出按钮操作 */
|
||||
function handleExport() {
|
||||
|
||||
@@ -1,84 +0,0 @@
|
||||
<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>
|
||||
@@ -1,86 +0,0 @@
|
||||
<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;
|
||||
|
||||
import java.util.List;
|
||||
import jakarta.servlet.http.HttpServletResponse;
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
import org.quartz.SchedulerException;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.web.bind.annotation.DeleteMapping;
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
package com.ruoyi.job.controller;
|
||||
|
||||
import java.util.List;
|
||||
import jakarta.servlet.http.HttpServletResponse;
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.web.bind.annotation.DeleteMapping;
|
||||
import org.springframework.web.bind.annotation.GetMapping;
|
||||
|
||||
@@ -1,8 +1,8 @@
|
||||
package com.ruoyi.job.domain;
|
||||
|
||||
import java.util.Date;
|
||||
import jakarta.validation.constraints.NotBlank;
|
||||
import jakarta.validation.constraints.Size;
|
||||
import javax.validation.constraints.NotBlank;
|
||||
import javax.validation.constraints.Size;
|
||||
import org.apache.commons.lang3.builder.ToStringBuilder;
|
||||
import org.apache.commons.lang3.builder.ToStringStyle;
|
||||
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
package com.ruoyi.job.service;
|
||||
|
||||
import java.util.List;
|
||||
import jakarta.annotation.PostConstruct;
|
||||
import javax.annotation.PostConstruct;
|
||||
import org.quartz.JobDataMap;
|
||||
import org.quartz.JobKey;
|
||||
import org.quartz.Scheduler;
|
||||
|
||||
@@ -18,9 +18,8 @@ spring:
|
||||
config:
|
||||
# 配置中心地址
|
||||
server-addr: 127.0.0.1:8848
|
||||
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}
|
||||
# 配置文件格式
|
||||
file-extension: yml
|
||||
# 共享配置
|
||||
shared-configs:
|
||||
- application-${spring.profiles.active}.${spring.cloud.nacos.config.file-extension}
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
package com.ruoyi.system.controller;
|
||||
|
||||
import java.util.List;
|
||||
import jakarta.servlet.http.HttpServletResponse;
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.validation.annotation.Validated;
|
||||
import org.springframework.web.bind.annotation.DeleteMapping;
|
||||
|
||||
@@ -2,7 +2,7 @@ package com.ruoyi.system.controller;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
import jakarta.servlet.http.HttpServletResponse;
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.validation.annotation.Validated;
|
||||
import org.springframework.web.bind.annotation.DeleteMapping;
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
package com.ruoyi.system.controller;
|
||||
|
||||
import java.util.List;
|
||||
import jakarta.servlet.http.HttpServletResponse;
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.validation.annotation.Validated;
|
||||
import org.springframework.web.bind.annotation.DeleteMapping;
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
package com.ruoyi.system.controller;
|
||||
|
||||
import java.util.List;
|
||||
import jakarta.servlet.http.HttpServletResponse;
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.web.bind.annotation.DeleteMapping;
|
||||
import org.springframework.web.bind.annotation.GetMapping;
|
||||
|
||||
@@ -54,6 +54,7 @@ public class SysNoticeController extends BaseController
|
||||
/**
|
||||
* 根据通知公告编号获取详细信息
|
||||
*/
|
||||
@RequiresPermissions("system:notice:query")
|
||||
@GetMapping(value = "/{noticeId}")
|
||||
public AjaxResult getInfo(@PathVariable Long noticeId)
|
||||
{
|
||||
@@ -124,19 +125,6 @@ public class SysNoticeController extends BaseController
|
||||
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;
|
||||
|
||||
import java.util.List;
|
||||
import jakarta.servlet.http.HttpServletResponse;
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.web.bind.annotation.DeleteMapping;
|
||||
import org.springframework.web.bind.annotation.GetMapping;
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
package com.ruoyi.system.controller;
|
||||
|
||||
import java.util.List;
|
||||
import jakarta.servlet.http.HttpServletResponse;
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.validation.annotation.Validated;
|
||||
import org.springframework.web.bind.annotation.DeleteMapping;
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
package com.ruoyi.system.controller;
|
||||
|
||||
import java.util.List;
|
||||
import jakarta.servlet.http.HttpServletResponse;
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.validation.annotation.Validated;
|
||||
import org.springframework.web.bind.annotation.DeleteMapping;
|
||||
|
||||
@@ -5,7 +5,7 @@ import java.util.Date;
|
||||
import java.util.List;
|
||||
import java.util.Set;
|
||||
import java.util.stream.Collectors;
|
||||
import jakarta.servlet.http.HttpServletResponse;
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
import org.apache.commons.lang3.ArrayUtils;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.validation.annotation.Validated;
|
||||
@@ -189,18 +189,11 @@ public class SysUserController extends BaseController
|
||||
ajax.put("user", user);
|
||||
ajax.put("roles", roles);
|
||||
ajax.put("permissions", permissions);
|
||||
ajax.put("pwdChrtype", getSysAccountChrtype());
|
||||
ajax.put("isDefaultModifyPwd", initPasswordIsModify(user.getPwdUpdateDate()));
|
||||
ajax.put("isPasswordExpired", passwordIsExpiration(user.getPwdUpdateDate()));
|
||||
return ajax;
|
||||
}
|
||||
|
||||
// 获取用户密码自定义配置规则
|
||||
public String getSysAccountChrtype()
|
||||
{
|
||||
return Convert.toStr(configService.selectConfigByKey("sys.account.chrtype"), "0");
|
||||
}
|
||||
|
||||
// 检查初始密码是否提醒修改
|
||||
public boolean initPasswordIsModify(Date pwdUpdateDate)
|
||||
{
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
package com.ruoyi.system.domain;
|
||||
|
||||
import jakarta.validation.constraints.NotBlank;
|
||||
import jakarta.validation.constraints.Size;
|
||||
import javax.validation.constraints.NotBlank;
|
||||
import javax.validation.constraints.Size;
|
||||
import org.apache.commons.lang3.builder.ToStringBuilder;
|
||||
import org.apache.commons.lang3.builder.ToStringStyle;
|
||||
import com.ruoyi.common.core.annotation.Excel;
|
||||
|
||||
@@ -2,9 +2,9 @@ package com.ruoyi.system.domain;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
import jakarta.validation.constraints.NotBlank;
|
||||
import jakarta.validation.constraints.NotNull;
|
||||
import jakarta.validation.constraints.Size;
|
||||
import javax.validation.constraints.NotBlank;
|
||||
import javax.validation.constraints.NotNull;
|
||||
import javax.validation.constraints.Size;
|
||||
import org.apache.commons.lang3.builder.ToStringBuilder;
|
||||
import org.apache.commons.lang3.builder.ToStringStyle;
|
||||
import com.ruoyi.common.core.web.domain.BaseEntity;
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
package com.ruoyi.system.domain;
|
||||
|
||||
import jakarta.validation.constraints.NotBlank;
|
||||
import jakarta.validation.constraints.Size;
|
||||
import javax.validation.constraints.NotBlank;
|
||||
import javax.validation.constraints.Size;
|
||||
import org.apache.commons.lang3.builder.ToStringBuilder;
|
||||
import org.apache.commons.lang3.builder.ToStringStyle;
|
||||
import com.fasterxml.jackson.annotation.JsonProperty;
|
||||
|
||||
@@ -1,8 +1,8 @@
|
||||
package com.ruoyi.system.domain;
|
||||
|
||||
import jakarta.validation.constraints.NotBlank;
|
||||
import jakarta.validation.constraints.NotNull;
|
||||
import jakarta.validation.constraints.Size;
|
||||
import javax.validation.constraints.NotBlank;
|
||||
import javax.validation.constraints.NotNull;
|
||||
import javax.validation.constraints.Size;
|
||||
import org.apache.commons.lang3.builder.ToStringBuilder;
|
||||
import org.apache.commons.lang3.builder.ToStringStyle;
|
||||
import com.ruoyi.common.core.annotation.Excel;
|
||||
|
||||
@@ -1,10 +1,9 @@
|
||||
package com.ruoyi.system.mapper;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
import com.ruoyi.system.domain.SysNotice;
|
||||
import com.ruoyi.system.domain.SysNoticeRead;
|
||||
import com.ruoyi.system.domain.SysNotice;
|
||||
|
||||
/**
|
||||
* 公告已读记录 数据层
|
||||
@@ -56,15 +55,6 @@ public interface SysNoticeReadMapper
|
||||
*/
|
||||
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,7 +1,6 @@
|
||||
package com.ruoyi.system.service;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import com.ruoyi.system.domain.SysNotice;
|
||||
|
||||
/**
|
||||
@@ -44,15 +43,6 @@ public interface ISysNoticeReadService
|
||||
*/
|
||||
public void markReadBatch(Long userId, Long[] noticeIds);
|
||||
|
||||
/**
|
||||
* 查询已阅读某公告的用户列表
|
||||
*
|
||||
* @param noticeId 公告ID
|
||||
* @param searchValue 搜索值
|
||||
* @return 已读用户列表
|
||||
*/
|
||||
public List<Map<String, Object>> selectReadUsersByNoticeId(Long noticeId, String searchValue);
|
||||
|
||||
/**
|
||||
* 删除公告时清理对应已读记录
|
||||
*
|
||||
|
||||
@@ -49,7 +49,7 @@ public interface ISysNoticeService
|
||||
* @return 结果
|
||||
*/
|
||||
public int deleteNoticeById(Long noticeId);
|
||||
|
||||
|
||||
/**
|
||||
* 批量删除公告信息
|
||||
*
|
||||
|
||||
@@ -2,7 +2,7 @@ package com.ruoyi.system.service.impl;
|
||||
|
||||
import java.util.Collection;
|
||||
import java.util.List;
|
||||
import jakarta.annotation.PostConstruct;
|
||||
import javax.annotation.PostConstruct;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
import com.ruoyi.common.core.constant.CacheConstants;
|
||||
|
||||
@@ -4,7 +4,7 @@ import java.util.Comparator;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.stream.Collectors;
|
||||
import jakarta.annotation.PostConstruct;
|
||||
import javax.annotation.PostConstruct;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
|
||||
@@ -1,11 +1,10 @@
|
||||
package com.ruoyi.system.service.impl;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
import com.ruoyi.system.domain.SysNotice;
|
||||
import com.ruoyi.system.domain.SysNoticeRead;
|
||||
import com.ruoyi.system.domain.SysNotice;
|
||||
import com.ruoyi.system.mapper.SysNoticeReadMapper;
|
||||
import com.ruoyi.system.service.ISysNoticeReadService;
|
||||
|
||||
@@ -63,15 +62,6 @@ public class SysNoticeReadServiceImpl implements ISysNoticeReadService
|
||||
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.List;
|
||||
import java.util.stream.Collectors;
|
||||
import jakarta.validation.Validator;
|
||||
import javax.validation.Validator;
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
|
||||
@@ -18,9 +18,8 @@ spring:
|
||||
config:
|
||||
# 配置中心地址
|
||||
server-addr: 127.0.0.1:8848
|
||||
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}
|
||||
# 配置文件格式
|
||||
file-extension: yml
|
||||
# 共享配置
|
||||
shared-configs:
|
||||
- application-${spring.profiles.active}.${spring.cloud.nacos.config.file-extension}
|
||||
|
||||
@@ -63,26 +63,4 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||
</foreach>
|
||||
</delete>
|
||||
|
||||
<!-- 查询已阅读某公告的用户列表,支持按登录名/用户名模糊筛选 -->
|
||||
<select id="selectReadUsersByNoticeId" resultType="java.util.Map">
|
||||
select
|
||||
u.user_id as userId,
|
||||
u.user_name as userName,
|
||||
u.nick_name as nickName,
|
||||
d.dept_name as deptName,
|
||||
u.phonenumber as phonenumber,
|
||||
r.read_time as readTime
|
||||
from sys_notice_read r
|
||||
inner join sys_user u on u.user_id = r.user_id and u.del_flag = '0'
|
||||
left join sys_dept d on d.dept_id = u.dept_id
|
||||
where r.notice_id = #{noticeId}
|
||||
<if test="searchValue != null and searchValue != ''">
|
||||
and (
|
||||
u.user_name like concat('%', #{searchValue}, '%')
|
||||
or u.nick_name like concat('%', #{searchValue}, '%')
|
||||
)
|
||||
</if>
|
||||
order by r.read_time desc
|
||||
</select>
|
||||
|
||||
</mapper>
|
||||
|
||||
@@ -68,12 +68,3 @@ export function markNoticeReadAll(ids) {
|
||||
params: { ids }
|
||||
})
|
||||
}
|
||||
|
||||
// 查询公告已读用户列表
|
||||
export function listNoticeReadUsers(query) {
|
||||
return request({
|
||||
url: '/system/notice/readUsers/list',
|
||||
method: 'get',
|
||||
params: query
|
||||
})
|
||||
}
|
||||
|
||||
@@ -1,170 +1,170 @@
|
||||
<template>
|
||||
<el-color-picker
|
||||
v-model="theme"
|
||||
:predefine="['#409EFF', '#1890ff', '#304156','#212121','#11a983', '#13c2c2', '#6959CD', '#f5222d', ]"
|
||||
class="theme-picker"
|
||||
popper-class="theme-picker-dropdown"
|
||||
/>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
const ORIGINAL_THEME = '#409EFF' // default color
|
||||
|
||||
export default {
|
||||
data() {
|
||||
return {
|
||||
chalk: '', // content of theme-chalk css
|
||||
theme: ''
|
||||
}
|
||||
},
|
||||
computed: {
|
||||
defaultTheme() {
|
||||
return this.$store.state.settings.theme
|
||||
}
|
||||
},
|
||||
watch: {
|
||||
defaultTheme: {
|
||||
handler: function(val, oldVal) {
|
||||
this.theme = val
|
||||
},
|
||||
immediate: true
|
||||
},
|
||||
async theme(val) {
|
||||
await this.setTheme(val)
|
||||
}
|
||||
},
|
||||
created() {
|
||||
if(this.defaultTheme !== ORIGINAL_THEME) {
|
||||
this.setTheme(this.defaultTheme)
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
async setTheme(val) {
|
||||
const oldVal = this.chalk ? this.theme : ORIGINAL_THEME
|
||||
if (typeof val !== 'string') return
|
||||
const themeCluster = this.getThemeCluster(val.replace('#', ''))
|
||||
const originalCluster = this.getThemeCluster(oldVal.replace('#', ''))
|
||||
|
||||
const getHandler = (variable, id) => {
|
||||
return () => {
|
||||
const originalCluster = this.getThemeCluster(ORIGINAL_THEME.replace('#', ''))
|
||||
const newStyle = this.updateStyle(this[variable], originalCluster, themeCluster)
|
||||
|
||||
let styleTag = document.getElementById(id)
|
||||
if (!styleTag) {
|
||||
styleTag = document.createElement('style')
|
||||
styleTag.setAttribute('id', id)
|
||||
document.head.appendChild(styleTag)
|
||||
}
|
||||
styleTag.innerText = newStyle
|
||||
}
|
||||
}
|
||||
|
||||
if (!this.chalk) {
|
||||
const url = `/styles/theme-chalk/index.css`
|
||||
await this.getCSSString(url, 'chalk')
|
||||
}
|
||||
|
||||
const chalkHandler = getHandler('chalk', 'chalk-style')
|
||||
chalkHandler()
|
||||
|
||||
const styles = [].slice.call(document.querySelectorAll('style'))
|
||||
.filter(style => {
|
||||
const text = style.innerText
|
||||
return new RegExp(oldVal, 'i').test(text) && !/Chalk Variables/.test(text)
|
||||
})
|
||||
styles.forEach(style => {
|
||||
const { innerText } = style
|
||||
if (typeof innerText !== 'string') return
|
||||
style.innerText = this.updateStyle(innerText, originalCluster, themeCluster)
|
||||
})
|
||||
|
||||
this.$emit('change', val)
|
||||
},
|
||||
|
||||
updateStyle(style, oldCluster, newCluster) {
|
||||
let newStyle = style
|
||||
oldCluster.forEach((color, index) => {
|
||||
newStyle = newStyle.replace(new RegExp(color, 'ig'), newCluster[index])
|
||||
})
|
||||
return newStyle
|
||||
},
|
||||
|
||||
getCSSString(url, variable) {
|
||||
return new Promise(resolve => {
|
||||
const xhr = new XMLHttpRequest()
|
||||
xhr.onreadystatechange = () => {
|
||||
if (xhr.readyState === 4 && xhr.status === 200) {
|
||||
this[variable] = xhr.responseText.replace(/@font-face{[^}]+}/, '')
|
||||
resolve()
|
||||
}
|
||||
}
|
||||
xhr.open('GET', url)
|
||||
xhr.send()
|
||||
})
|
||||
},
|
||||
|
||||
getThemeCluster(theme) {
|
||||
const tintColor = (color, tint) => {
|
||||
let red = parseInt(color.slice(0, 2), 16)
|
||||
let green = parseInt(color.slice(2, 4), 16)
|
||||
let blue = parseInt(color.slice(4, 6), 16)
|
||||
|
||||
if (tint === 0) { // when primary color is in its rgb space
|
||||
return [red, green, blue].join(',')
|
||||
} else {
|
||||
red += Math.round(tint * (255 - red))
|
||||
green += Math.round(tint * (255 - green))
|
||||
blue += Math.round(tint * (255 - blue))
|
||||
|
||||
red = red.toString(16)
|
||||
green = green.toString(16)
|
||||
blue = blue.toString(16)
|
||||
|
||||
return `#${red}${green}${blue}`
|
||||
}
|
||||
}
|
||||
|
||||
const shadeColor = (color, shade) => {
|
||||
let red = parseInt(color.slice(0, 2), 16)
|
||||
let green = parseInt(color.slice(2, 4), 16)
|
||||
let blue = parseInt(color.slice(4, 6), 16)
|
||||
|
||||
red = Math.round((1 - shade) * red)
|
||||
green = Math.round((1 - shade) * green)
|
||||
blue = Math.round((1 - shade) * blue)
|
||||
|
||||
red = red.toString(16)
|
||||
green = green.toString(16)
|
||||
blue = blue.toString(16)
|
||||
|
||||
return `#${red}${green}${blue}`
|
||||
}
|
||||
|
||||
const clusters = [theme]
|
||||
for (let i = 0; i <= 9; i++) {
|
||||
clusters.push(tintColor(theme, Number((i / 10).toFixed(2))))
|
||||
}
|
||||
clusters.push(shadeColor(theme, 0.1))
|
||||
return clusters
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<style>
|
||||
.theme-message,
|
||||
.theme-picker-dropdown {
|
||||
z-index: 99999 !important;
|
||||
}
|
||||
|
||||
.theme-picker .el-color-picker__trigger {
|
||||
height: 26px !important;
|
||||
width: 26px !important;
|
||||
padding: 2px;
|
||||
}
|
||||
|
||||
.theme-picker-dropdown .el-color-dropdown__link-btn {
|
||||
display: none;
|
||||
}
|
||||
</style>
|
||||
<template>
|
||||
<el-color-picker
|
||||
v-model="theme"
|
||||
:predefine="['#409EFF', '#1890ff', '#304156','#212121','#11a983', '#13c2c2', '#6959CD', '#f5222d', ]"
|
||||
class="theme-picker"
|
||||
popper-class="theme-picker-dropdown"
|
||||
/>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
const ORIGINAL_THEME = '#409EFF' // default color
|
||||
|
||||
export default {
|
||||
data() {
|
||||
return {
|
||||
chalk: '', // content of theme-chalk css
|
||||
theme: ''
|
||||
}
|
||||
},
|
||||
computed: {
|
||||
defaultTheme() {
|
||||
return this.$store.state.settings.theme
|
||||
}
|
||||
},
|
||||
watch: {
|
||||
defaultTheme: {
|
||||
handler: function(val, oldVal) {
|
||||
this.theme = val
|
||||
},
|
||||
immediate: true
|
||||
},
|
||||
async theme(val) {
|
||||
await this.setTheme(val)
|
||||
}
|
||||
},
|
||||
created() {
|
||||
if(this.defaultTheme !== ORIGINAL_THEME) {
|
||||
this.setTheme(this.defaultTheme)
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
async setTheme(val) {
|
||||
const oldVal = this.chalk ? this.theme : ORIGINAL_THEME
|
||||
if (typeof val !== 'string') return
|
||||
const themeCluster = this.getThemeCluster(val.replace('#', ''))
|
||||
const originalCluster = this.getThemeCluster(oldVal.replace('#', ''))
|
||||
|
||||
const getHandler = (variable, id) => {
|
||||
return () => {
|
||||
const originalCluster = this.getThemeCluster(ORIGINAL_THEME.replace('#', ''))
|
||||
const newStyle = this.updateStyle(this[variable], originalCluster, themeCluster)
|
||||
|
||||
let styleTag = document.getElementById(id)
|
||||
if (!styleTag) {
|
||||
styleTag = document.createElement('style')
|
||||
styleTag.setAttribute('id', id)
|
||||
document.head.appendChild(styleTag)
|
||||
}
|
||||
styleTag.innerText = newStyle
|
||||
}
|
||||
}
|
||||
|
||||
if (!this.chalk) {
|
||||
const url = `/styles/theme-chalk/index.css`
|
||||
await this.getCSSString(url, 'chalk')
|
||||
}
|
||||
|
||||
const chalkHandler = getHandler('chalk', 'chalk-style')
|
||||
chalkHandler()
|
||||
|
||||
const styles = [].slice.call(document.querySelectorAll('style'))
|
||||
.filter(style => {
|
||||
const text = style.innerText
|
||||
return new RegExp(oldVal, 'i').test(text) && !/Chalk Variables/.test(text)
|
||||
})
|
||||
styles.forEach(style => {
|
||||
const { innerText } = style
|
||||
if (typeof innerText !== 'string') return
|
||||
style.innerText = this.updateStyle(innerText, originalCluster, themeCluster)
|
||||
})
|
||||
|
||||
this.$emit('change', val)
|
||||
},
|
||||
|
||||
updateStyle(style, oldCluster, newCluster) {
|
||||
let newStyle = style
|
||||
oldCluster.forEach((color, index) => {
|
||||
newStyle = newStyle.replace(new RegExp(color, 'ig'), newCluster[index])
|
||||
})
|
||||
return newStyle
|
||||
},
|
||||
|
||||
getCSSString(url, variable) {
|
||||
return new Promise(resolve => {
|
||||
const xhr = new XMLHttpRequest()
|
||||
xhr.onreadystatechange = () => {
|
||||
if (xhr.readyState === 4 && xhr.status === 200) {
|
||||
this[variable] = xhr.responseText.replace(/@font-face{[^}]+}/, '')
|
||||
resolve()
|
||||
}
|
||||
}
|
||||
xhr.open('GET', url)
|
||||
xhr.send()
|
||||
})
|
||||
},
|
||||
|
||||
getThemeCluster(theme) {
|
||||
const tintColor = (color, tint) => {
|
||||
let red = parseInt(color.slice(0, 2), 16)
|
||||
let green = parseInt(color.slice(2, 4), 16)
|
||||
let blue = parseInt(color.slice(4, 6), 16)
|
||||
|
||||
if (tint === 0) { // when primary color is in its rgb space
|
||||
return [red, green, blue].join(',')
|
||||
} else {
|
||||
red += Math.round(tint * (255 - red))
|
||||
green += Math.round(tint * (255 - green))
|
||||
blue += Math.round(tint * (255 - blue))
|
||||
|
||||
red = red.toString(16)
|
||||
green = green.toString(16)
|
||||
blue = blue.toString(16)
|
||||
|
||||
return `#${red}${green}${blue}`
|
||||
}
|
||||
}
|
||||
|
||||
const shadeColor = (color, shade) => {
|
||||
let red = parseInt(color.slice(0, 2), 16)
|
||||
let green = parseInt(color.slice(2, 4), 16)
|
||||
let blue = parseInt(color.slice(4, 6), 16)
|
||||
|
||||
red = Math.round((1 - shade) * red)
|
||||
green = Math.round((1 - shade) * green)
|
||||
blue = Math.round((1 - shade) * blue)
|
||||
|
||||
red = red.toString(16)
|
||||
green = green.toString(16)
|
||||
blue = blue.toString(16)
|
||||
|
||||
return `#${red}${green}${blue}`
|
||||
}
|
||||
|
||||
const clusters = [theme]
|
||||
for (let i = 0; i <= 9; i++) {
|
||||
clusters.push(tintColor(theme, Number((i / 10).toFixed(2))))
|
||||
}
|
||||
clusters.push(shadeColor(theme, 0.1))
|
||||
return clusters
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<style>
|
||||
.theme-message,
|
||||
.theme-picker-dropdown {
|
||||
z-index: 99999 !important;
|
||||
}
|
||||
|
||||
.theme-picker .el-color-picker__trigger {
|
||||
height: 26px !important;
|
||||
width: 26px !important;
|
||||
padding: 2px;
|
||||
}
|
||||
|
||||
.theme-picker-dropdown .el-color-dropdown__link-btn {
|
||||
display: none;
|
||||
}
|
||||
</style>
|
||||
|
||||
@@ -1,362 +0,0 @@
|
||||
<template>
|
||||
<el-drawer title="公告详情" :visible.sync="visible" direction="rtl" size="50%" append-to-body :before-close="handleClose" custom-class="notice-detail-drawer">
|
||||
<div v-loading="loading" class="notice-detail-drawer__body">
|
||||
<div v-if="!detail" class="notice-empty">
|
||||
<i class="el-icon-document"></i>
|
||||
<span>暂无数据</span>
|
||||
</div>
|
||||
<div v-else class="notice-page">
|
||||
<div class="notice-type-wrap">
|
||||
<span v-if="detail.noticeType === '1'" class="notice-type-tag type-notify">
|
||||
<i class="el-icon-bell"></i> 通知
|
||||
</span>
|
||||
<span v-else-if="detail.noticeType === '2'" class="notice-type-tag type-announce">
|
||||
<i class="el-icon-message"></i> 公告
|
||||
</span>
|
||||
<span v-else class="notice-type-tag type-notify">
|
||||
<i class="el-icon-document"></i> 消息
|
||||
</span>
|
||||
</div>
|
||||
|
||||
<h1 class="notice-title">{{ detail.noticeTitle }}</h1>
|
||||
|
||||
<div class="notice-meta">
|
||||
<span class="meta-item">
|
||||
<i class="el-icon-user"></i>
|
||||
<span>{{ detail.createBy || '—' }}</span>
|
||||
</span>
|
||||
<span class="meta-item">
|
||||
<i class="el-icon-time"></i>
|
||||
<span>{{ detail.createTime || '—' }}</span>
|
||||
</span>
|
||||
<span class="meta-item">
|
||||
<span :class="['status-dot', isStatusNormal ? 'status-ok' : 'status-off']"></span>
|
||||
<span>{{ isStatusNormal ? '正常' : '已关闭' }}</span>
|
||||
</span>
|
||||
</div>
|
||||
|
||||
<div class="notice-divider">
|
||||
<span class="notice-divider-dot"></span>
|
||||
<span class="notice-divider-dot"></span>
|
||||
<span class="notice-divider-dot"></span>
|
||||
</div>
|
||||
|
||||
<div class="notice-body">
|
||||
<div v-if="hasContent" class="notice-content" v-html="detail.noticeContent" />
|
||||
<div v-else class="notice-empty notice-empty--inner">
|
||||
<i class="el-icon-document"></i> 暂无内容
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</el-drawer>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import { getNotice } from '@/api/system/notice'
|
||||
|
||||
export default {
|
||||
name: 'NoticeDetailView',
|
||||
data() {
|
||||
return {
|
||||
visible: false,
|
||||
loading: false,
|
||||
detail: null
|
||||
}
|
||||
},
|
||||
computed: {
|
||||
isStatusNormal() {
|
||||
const s = this.detail && this.detail.status
|
||||
return s === '0' || s === 0
|
||||
},
|
||||
hasContent() {
|
||||
const c = this.detail && this.detail.noticeContent
|
||||
return c != null && String(c).trim() !== ''
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
open(payload) {
|
||||
let id = null
|
||||
let preset = null
|
||||
if (payload != null && typeof payload === 'object') {
|
||||
id = payload.noticeId
|
||||
if (payload.noticeContent != null) {
|
||||
preset = payload
|
||||
}
|
||||
} else {
|
||||
id = payload
|
||||
}
|
||||
this.visible = true
|
||||
if (preset) {
|
||||
this.detail = preset
|
||||
return
|
||||
}
|
||||
if (id == null || id === '') {
|
||||
this.detail = null
|
||||
return
|
||||
}
|
||||
this.loading = true
|
||||
this.detail = null
|
||||
getNotice(id).then(res => {
|
||||
this.detail = res.data
|
||||
}).catch(() => {
|
||||
this.detail = null
|
||||
}).finally(() => {
|
||||
this.loading = false
|
||||
})
|
||||
},
|
||||
handleClose() {
|
||||
this.visible = false
|
||||
this.detail = null
|
||||
this.loading = false
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<style lang="scss" scoped>
|
||||
.notice-page {
|
||||
max-width: 760px;
|
||||
margin: 0 auto;
|
||||
padding: 8px 8px 20px;
|
||||
animation: notice-fade-up 0.28s ease both;
|
||||
}
|
||||
|
||||
@keyframes notice-fade-up {
|
||||
from {
|
||||
opacity: 0;
|
||||
transform: translateY(14px);
|
||||
}
|
||||
to {
|
||||
opacity: 1;
|
||||
transform: translateY(0);
|
||||
}
|
||||
}
|
||||
|
||||
.notice-type-tag {
|
||||
display: inline-flex;
|
||||
align-items: center;
|
||||
gap: 5px;
|
||||
padding: 3px 12px;
|
||||
border-radius: 2px;
|
||||
font-size: 11px;
|
||||
font-weight: 700;
|
||||
letter-spacing: 1px;
|
||||
text-transform: uppercase;
|
||||
margin-bottom: 14px;
|
||||
}
|
||||
|
||||
.type-notify {
|
||||
background: #fff8e6;
|
||||
color: #b7791f;
|
||||
border-left: 3px solid #d97706;
|
||||
}
|
||||
|
||||
.type-announce {
|
||||
background: #e8f5e9;
|
||||
color: #276749;
|
||||
border-left: 3px solid #38a169;
|
||||
}
|
||||
|
||||
.notice-title {
|
||||
font-size: 22px;
|
||||
font-weight: 700;
|
||||
color: #1a202c;
|
||||
line-height: 1.45;
|
||||
margin: 0 0 16px;
|
||||
letter-spacing: -0.2px;
|
||||
}
|
||||
|
||||
.notice-meta {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
flex-wrap: wrap;
|
||||
gap: 16px;
|
||||
padding: 12px 0;
|
||||
border-top: 1px solid #e9ecef;
|
||||
border-bottom: 1px solid #e9ecef;
|
||||
margin-bottom: 28px;
|
||||
}
|
||||
|
||||
.meta-item {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
gap: 5px;
|
||||
font-size: 12px;
|
||||
color: #718096;
|
||||
}
|
||||
|
||||
.meta-item i {
|
||||
font-size: 12px;
|
||||
color: #a0aec0;
|
||||
}
|
||||
|
||||
.status-dot {
|
||||
display: inline-block;
|
||||
width: 7px;
|
||||
height: 7px;
|
||||
border-radius: 50%;
|
||||
margin-right: 4px;
|
||||
}
|
||||
|
||||
.status-ok {
|
||||
background: #38a169;
|
||||
}
|
||||
|
||||
.status-off {
|
||||
background: #e53e3e;
|
||||
}
|
||||
|
||||
.notice-divider {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
gap: 12px;
|
||||
margin-bottom: 24px;
|
||||
}
|
||||
|
||||
.notice-divider::before,
|
||||
.notice-divider::after {
|
||||
content: '';
|
||||
flex: 1;
|
||||
height: 1px;
|
||||
background: linear-gradient(to right, transparent, #dee2e6, transparent);
|
||||
}
|
||||
|
||||
.notice-divider-dot {
|
||||
width: 6px;
|
||||
height: 6px;
|
||||
border-radius: 50%;
|
||||
background: #cbd5e0;
|
||||
}
|
||||
|
||||
.notice-body {
|
||||
background: #fff;
|
||||
border-radius: 6px;
|
||||
padding: 28px 32px;
|
||||
box-shadow: 0 1px 4px rgba(0, 0, 0, 0.06), 0 0 0 1px rgba(0, 0, 0, 0.04);
|
||||
min-height: 120px;
|
||||
}
|
||||
|
||||
.notice-content {
|
||||
font-size: 14px;
|
||||
line-height: 1.85;
|
||||
color: #2d3748;
|
||||
word-break: break-word;
|
||||
}
|
||||
|
||||
.notice-content ::v-deep p {
|
||||
margin: 0 0 1em;
|
||||
}
|
||||
|
||||
.notice-content ::v-deep h1,
|
||||
.notice-content ::v-deep h2,
|
||||
.notice-content ::v-deep h3 {
|
||||
font-weight: 700;
|
||||
color: #1a202c;
|
||||
margin: 1.4em 0 0.6em;
|
||||
}
|
||||
|
||||
.notice-content ::v-deep h1 {
|
||||
font-size: 18px;
|
||||
}
|
||||
|
||||
.notice-content ::v-deep h2 {
|
||||
font-size: 16px;
|
||||
}
|
||||
|
||||
.notice-content ::v-deep h3 {
|
||||
font-size: 14px;
|
||||
}
|
||||
|
||||
.notice-content ::v-deep a {
|
||||
color: #3182ce;
|
||||
text-decoration: underline;
|
||||
}
|
||||
|
||||
.notice-content ::v-deep a:hover {
|
||||
color: #2b6cb0;
|
||||
}
|
||||
|
||||
.notice-content ::v-deep img {
|
||||
max-width: 100%;
|
||||
border-radius: 4px;
|
||||
margin: 8px 0;
|
||||
}
|
||||
|
||||
.notice-content ::v-deep ul,
|
||||
.notice-content ::v-deep ol {
|
||||
padding-left: 20px;
|
||||
margin: 0 0 1em;
|
||||
}
|
||||
|
||||
.notice-content ::v-deep li {
|
||||
margin-bottom: 4px;
|
||||
}
|
||||
|
||||
.notice-content ::v-deep blockquote {
|
||||
border-left: 3px solid #cbd5e0;
|
||||
margin: 1em 0;
|
||||
padding: 6px 16px;
|
||||
color: #718096;
|
||||
background: #f7fafc;
|
||||
}
|
||||
|
||||
.notice-content ::v-deep table {
|
||||
border-collapse: collapse;
|
||||
width: 100%;
|
||||
margin: 1em 0;
|
||||
font-size: 13px;
|
||||
}
|
||||
|
||||
.notice-content ::v-deep table th,
|
||||
.notice-content ::v-deep table td {
|
||||
border: 1px solid #e2e8f0;
|
||||
padding: 7px 12px;
|
||||
}
|
||||
|
||||
.notice-content ::v-deep table th {
|
||||
background: #f7fafc;
|
||||
font-weight: 600;
|
||||
}
|
||||
|
||||
.notice-empty {
|
||||
text-align: center;
|
||||
padding: 40px 0;
|
||||
color: #a0aec0;
|
||||
font-size: 13px;
|
||||
}
|
||||
|
||||
.notice-empty i {
|
||||
font-size: 28px;
|
||||
display: block;
|
||||
margin-bottom: 10px;
|
||||
}
|
||||
|
||||
.notice-empty--inner {
|
||||
padding: 32px 0;
|
||||
}
|
||||
|
||||
.notice-empty--inner i {
|
||||
font-size: 28px;
|
||||
}
|
||||
|
||||
::v-deep .notice-detail-drawer {
|
||||
.el-drawer__header {
|
||||
margin-bottom: 0;
|
||||
padding: 16px 20px;
|
||||
border-bottom: 1px solid #ebeef5;
|
||||
font-size: 16px;
|
||||
font-weight: 600;
|
||||
color: #303133;
|
||||
}
|
||||
.el-drawer__body {
|
||||
background: #f5f6f8;
|
||||
}
|
||||
}
|
||||
|
||||
.notice-detail-drawer__body {
|
||||
height: 100%;
|
||||
overflow: auto;
|
||||
padding: 10px 16px 22px;
|
||||
}
|
||||
</style>
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user