Compare commits
151 Commits
Author | SHA1 | Date | |
---|---|---|---|
8f145bba3a | |||
6bb166b89f | |||
823e95667e | |||
566053da0c | |||
0ef007240d | |||
0a75dcdd85 | |||
4c2626ffec | |||
082b19e33a | |||
b779cf053d | |||
212012dc62 | |||
7de2cf77b4 | |||
2b9d46439f | |||
79265d59b7 | |||
093ba5b389 | |||
3807b11290 | |||
c9f25cb34e | |||
203b54e5aa | |||
403f5c5dcf | |||
c6d0b9a9ae | |||
08df2c93a9 | |||
fbbdd94999 | |||
0cae7d0058 | |||
b0965653bf | |||
e472f62523 | |||
69256940df | |||
b9f686be53 | |||
521ff51238 | |||
f67c97e095 | |||
dd721ff894 | |||
ae4290bdda | |||
c19fec2cf8 | |||
669c42795a | |||
0d79f10c2f | |||
d3595cd930 | |||
5b0525d05c | |||
fb07677c32 | |||
a82a3d9465 | |||
28bceda630 | |||
69829827fe | |||
89607fb028 | |||
1aa18c523d | |||
abeb8d7fd8 | |||
478fae0d28 | |||
0ecf27f8d6 | |||
0a5bb34fbf | |||
9e38c7de2e | |||
9ca28d6dbf | |||
497f98ba90 | |||
a948affb2d | |||
57b49dd5fa | |||
9c0ed9c424 | |||
70ab18052c | |||
aeb02c79d8 | |||
33793d8eff | |||
9652906954 | |||
9fccc7de40 | |||
599be64fa8 | |||
50ac363682 | |||
f84b157419 | |||
f4536d5d2e | |||
aed958b1be | |||
0a51f7d743 | |||
3fd9147afb | |||
4f86b6d9ca | |||
a65c287075 | |||
1af0d1665c | |||
4e32788b36 | |||
068c3e6f0d | |||
dd6640086e | |||
be54188ba6 | |||
a4e2339f90 | |||
bf771ae5c8 | |||
fa5596bb20 | |||
eb30fc4b1a | |||
0446d211df | |||
da146c2a70 | |||
7de5358dcd | |||
549c7ee97a | |||
5fcf342f5a | |||
c89722a7dd | |||
61e10f2783 | |||
c6912ca1d5 | |||
5c4f0c5503 | |||
4f7702b22a | |||
04e294b3e5 | |||
d596d5bb8e | |||
8f9f0c04cc | |||
1bad003fe3 | |||
ad4df6245d | |||
0070297fe1 | |||
71ec44a545 | |||
1efae4a588 | |||
650359c357 | |||
a78211ca00 | |||
74f52677be | |||
60d5c03e65 | |||
5b04f388e9 | |||
a7eb07c7a0 | |||
d0b315f4a5 | |||
a6051d4638 | |||
c4ee9ea7c8 | |||
7c39f92538 | |||
51fa66f61a | |||
3b61ed56b0 | |||
db904f679e | |||
98982515f7 | |||
1a7baa0639 | |||
a9695d1756 | |||
d78f642201 | |||
26dfee2ce8 | |||
b56898858d | |||
503dd64e3f | |||
876ecf21c7 | |||
107672419e | |||
21d07c1d71 | |||
d8d636fdbd | |||
743fce7829 | |||
de2ac66f0b | |||
8b5d254242 | |||
a7eb0f98ac | |||
4dcf737db0 | |||
b32d0724b7 | |||
8deacb702e | |||
5be8d46d05 | |||
fb19dd3e4e | |||
cbf4795fd5 | |||
5d74ed32bd | |||
6afaced3cf | |||
f3976c0792 | |||
22225a5119 | |||
fe030cc022 | |||
ca657b0482 | |||
c1d1ace36d | |||
6e7d7aba93 | |||
388e36ed4d | |||
5d89d0b36a | |||
55095a50b5 | |||
ee4b4de7b1 | |||
92c6301285 | |||
5c6adb25fc | |||
8dd3ca5bb6 | |||
be778ba370 | |||
52d48fa63e | |||
df3ef54b41 | |||
1e40e60dbf | |||
133a10ecf2 | |||
6a84ae42a5 | |||
b2d79b62d1 | |||
a09a342f58 | |||
3e1bd8e3bc | |||
8a076e175f |
3
.gitignore
vendored
3
.gitignore
vendored
@ -37,7 +37,8 @@ nbdist/
|
||||
# Others
|
||||
*.log
|
||||
*.xml.versionsBackup
|
||||
*.swp
|
||||
|
||||
!*/build/*.java
|
||||
!*/build/*.html
|
||||
!*/build/*.xml
|
||||
!*/build/*.xml
|
||||
|
23
README.md
23
README.md
@ -6,9 +6,10 @@
|
||||
* 支持加载动态权限菜单,多方式轻松权限控制。
|
||||
* 高效率开发,使用代码生成器可以一键生成前后端代码。
|
||||
* 提供了一个Oracle版本[RuoYi-Vue-Oracle](https://github.com/yangzongzhuan/RuoYi-Vue-Oracle),保持同步更新。
|
||||
* 感谢[Vue-Element-Admin](https://github.com/PanJiaChen/vue-element-admin),[eladmin-web](https://gitee.com/elunez/eladmin-web?_from=gitee_search)。
|
||||
* 不分离版本,请移步[RuoYi](https://gitee.com/y_project/RuoYi),微服务版本,请移步[RuoYi-Cloud](https://gitee.com/y_project/RuoYi-Cloud)
|
||||
* 阿里云优惠券:[点我进入](https://www.aliyun.com/minisite/goods?userCode=brki8iof&share_source=copy_link),腾讯云优惠券:[点我领取](https://cloud.tencent.com/redirect.php?redirect=1025&cps_key=198c8df2ed259157187173bc7f4f32fd&from=console)
|
||||
* 感谢[Vue-Element-Admin](https://github.com/PanJiaChen/vue-element-admin),[eladmin-web](https://gitee.com/elunez/eladmin-web?_from=gitee_search)。
|
||||
* 阿里云折扣场:[点我进入](http://aly.ruoyi.vip),腾讯云秒杀场:[点我进入](http://txy.ruoyi.vip)
|
||||
* 阿里云优惠券:[点我领取](https://www.aliyun.com/minisite/goods?userCode=brki8iof&share_source=copy_link),腾讯云优惠券:[点我领取](https://cloud.tencent.com/redirect.php?redirect=1025&cps_key=198c8df2ed259157187173bc7f4f32fd&from=console)
|
||||
|
||||
## 内置功能
|
||||
|
||||
@ -46,27 +47,27 @@
|
||||
<td><img src="https://oscimg.oschina.net/oscnet/1cbcf0e6f257c7d3a063c0e3f2ff989e4b3.jpg"/></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td><img src="https://oscimg.oschina.net/oscnet/707825ad3f29de74a8d6d02fbd73ad631ea.jpg"/></td>
|
||||
<td><img src="https://oscimg.oschina.net/oscnet/46be40cc6f01aa300eed53a19b5012bf484.jpg"/></td>
|
||||
<td><img src="https://oscimg.oschina.net/oscnet/up-8074972883b5ba0622e13246738ebba237a.png"/></td>
|
||||
<td><img src="https://oscimg.oschina.net/oscnet/up-9f88719cdfca9af2e58b352a20e23d43b12.png"/></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td><img src="https://oscimg.oschina.net/oscnet/4284796d4cea240d181b8f2201813dda710.jpg"/></td>
|
||||
<td><img src="https://oscimg.oschina.net/oscnet/3ecfac87a049f7fe36abbcaafb2c40d36cf.jpg"/></td>
|
||||
<td><img src="https://oscimg.oschina.net/oscnet/up-39bf2584ec3a529b0d5a3b70d15c9b37646.png"/></td>
|
||||
<td><img src="https://oscimg.oschina.net/oscnet/up-936ec82d1f4872e1bc980927654b6007307.png"/></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td><img src="https://oscimg.oschina.net/oscnet/71c2d48905221a09a728df4aff4160b8607.jpg"/></td>
|
||||
<td><img src="https://oscimg.oschina.net/oscnet/c14c1ee9a64a6a9c2c22f67d43198767dbe.jpg"/></td>
|
||||
<td><img src="https://oscimg.oschina.net/oscnet/up-b2d62ceb95d2dd9b3fbe157bb70d26001e9.png"/></td>
|
||||
<td><img src="https://oscimg.oschina.net/oscnet/up-d67451d308b7a79ad6819723396f7c3d77a.png"/></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td><img src="https://oscimg.oschina.net/oscnet/5e8c387724954459291aafd5eb52b456f53.jpg"/></td>
|
||||
<td><img src="https://oscimg.oschina.net/oscnet/644e78da53c2e92a95dfda4f76e6d117c4b.jpg"/></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td><img src="https://oscimg.oschina.net/oscnet/fdea1d8bb8625c27bf964176a2c8ebc6945.jpg"/></td>
|
||||
<td><img src="https://oscimg.oschina.net/oscnet/509d2708cfd762b6e6339364cac1cc1970c.jpg"/></td>
|
||||
<td><img src="https://oscimg.oschina.net/oscnet/up-8370a0d02977eebf6dbf854c8450293c937.png"/></td>
|
||||
<td><img src="https://oscimg.oschina.net/oscnet/up-49003ed83f60f633e7153609a53a2b644f7.png"/></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td><img src="https://oscimg.oschina.net/oscnet/up-f1fd681cc9d295db74e85ad6d2fe4389454.png"/></td>
|
||||
<td><img src="https://oscimg.oschina.net/oscnet/up-d4fe726319ece268d4746602c39cffc0621.png"/></td>
|
||||
<td><img src="https://oscimg.oschina.net/oscnet/up-c195234bbcd30be6927f037a6755e6ab69c.png"/></td>
|
||||
</tr>
|
||||
<tr>
|
||||
|
39
pom.xml
39
pom.xml
@ -6,29 +6,31 @@
|
||||
|
||||
<groupId>com.ruoyi</groupId>
|
||||
<artifactId>ruoyi</artifactId>
|
||||
<version>3.0.0</version>
|
||||
<version>3.2.1</version>
|
||||
|
||||
<name>ruoyi</name>
|
||||
<url>http://www.ruoyi.vip</url>
|
||||
<description>若依管理系统</description>
|
||||
|
||||
<properties>
|
||||
<ruoyi.version>3.0.0</ruoyi.version>
|
||||
<ruoyi.version>3.2.1</ruoyi.version>
|
||||
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
|
||||
<project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding>
|
||||
<java.version>1.8</java.version>
|
||||
<mybatis.boot.version>1.3.2</mybatis.boot.version>
|
||||
<druid.version>1.1.14</druid.version>
|
||||
<maven-jar-plugin.version>3.1.1</maven-jar-plugin.version>
|
||||
<druid.version>1.2.2</druid.version>
|
||||
<bitwalker.version>1.19</bitwalker.version>
|
||||
<swagger.version>2.9.2</swagger.version>
|
||||
<pagehelper.boot.version>1.2.5</pagehelper.boot.version>
|
||||
<fastjson.version>1.2.70</fastjson.version>
|
||||
<oshi.version>3.9.1</oshi.version>
|
||||
<kaptcha.version>2.3.2</kaptcha.version>
|
||||
<pagehelper.boot.version>1.3.0</pagehelper.boot.version>
|
||||
<fastjson.version>1.2.74</fastjson.version>
|
||||
<oshi.version>5.2.5</oshi.version>
|
||||
<jna.version>5.5.0</jna.version>
|
||||
<commons.io.version>2.5</commons.io.version>
|
||||
<commons.fileupload.version>1.3.3</commons.fileupload.version>
|
||||
<poi.version>3.17</poi.version>
|
||||
<velocity.version>1.7</velocity.version>
|
||||
<jwt.version>0.9.0</jwt.version>
|
||||
<jwt.version>0.9.1</jwt.version>
|
||||
</properties>
|
||||
|
||||
<!-- 依赖声明 -->
|
||||
@ -39,7 +41,7 @@
|
||||
<dependency>
|
||||
<groupId>org.springframework.boot</groupId>
|
||||
<artifactId>spring-boot-dependencies</artifactId>
|
||||
<version>2.1.1.RELEASE</version>
|
||||
<version>2.1.17.RELEASE</version>
|
||||
<type>pom</type>
|
||||
<scope>import</scope>
|
||||
</dependency>
|
||||
@ -71,6 +73,18 @@
|
||||
<artifactId>oshi-core</artifactId>
|
||||
<version>${oshi.version}</version>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<groupId>net.java.dev.jna</groupId>
|
||||
<artifactId>jna</artifactId>
|
||||
<version>${jna.version}</version>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<groupId>net.java.dev.jna</groupId>
|
||||
<artifactId>jna-platform</artifactId>
|
||||
<version>${jna.version}</version>
|
||||
</dependency>
|
||||
|
||||
<!-- swagger2-->
|
||||
<dependency>
|
||||
@ -137,6 +151,13 @@
|
||||
<artifactId>jjwt</artifactId>
|
||||
<version>${jwt.version}</version>
|
||||
</dependency>
|
||||
|
||||
<!--验证码 -->
|
||||
<dependency>
|
||||
<groupId>com.github.penggle</groupId>
|
||||
<artifactId>kaptcha</artifactId>
|
||||
<version>${kaptcha.version}</version>
|
||||
</dependency>
|
||||
|
||||
<!-- 定时任务-->
|
||||
<dependency>
|
||||
|
@ -5,7 +5,7 @@
|
||||
<parent>
|
||||
<artifactId>ruoyi</artifactId>
|
||||
<groupId>com.ruoyi</groupId>
|
||||
<version>3.0.0</version>
|
||||
<version>3.2.1</version>
|
||||
</parent>
|
||||
<modelVersion>4.0.0</modelVersion>
|
||||
<packaging>jar</packaging>
|
||||
@ -95,7 +95,7 @@
|
||||
<plugin>
|
||||
<groupId>org.apache.maven.plugins</groupId>
|
||||
<artifactId>maven-war-plugin</artifactId>
|
||||
<version>3.0.0</version>
|
||||
<version>3.1.0</version>
|
||||
<configuration>
|
||||
<failOnMissingWebXml>false</failOnMissingWebXml>
|
||||
<warName>${project.artifactId}</warName>
|
||||
|
@ -1,16 +1,20 @@
|
||||
package com.ruoyi.web.controller.common;
|
||||
|
||||
import java.io.ByteArrayOutputStream;
|
||||
import java.awt.image.BufferedImage;
|
||||
import java.io.IOException;
|
||||
import java.util.concurrent.TimeUnit;
|
||||
import javax.annotation.Resource;
|
||||
import javax.imageio.ImageIO;
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.beans.factory.annotation.Value;
|
||||
import org.springframework.util.FastByteArrayOutputStream;
|
||||
import org.springframework.web.bind.annotation.GetMapping;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
import com.google.code.kaptcha.Producer;
|
||||
import com.ruoyi.common.constant.Constants;
|
||||
import com.ruoyi.common.core.domain.AjaxResult;
|
||||
import com.ruoyi.common.core.redis.RedisCache;
|
||||
import com.ruoyi.common.utils.VerifyCodeUtils;
|
||||
import com.ruoyi.common.utils.sign.Base64;
|
||||
import com.ruoyi.common.utils.uuid.IdUtils;
|
||||
|
||||
@ -22,8 +26,18 @@ import com.ruoyi.common.utils.uuid.IdUtils;
|
||||
@RestController
|
||||
public class CaptchaController
|
||||
{
|
||||
@Resource(name = "captchaProducer")
|
||||
private Producer captchaProducer;
|
||||
|
||||
@Resource(name = "captchaProducerMath")
|
||||
private Producer captchaProducerMath;
|
||||
|
||||
@Autowired
|
||||
private RedisCache redisCache;
|
||||
|
||||
// 验证码类型
|
||||
@Value("${ruoyi.captchaType}")
|
||||
private String captchaType;
|
||||
|
||||
/**
|
||||
* 生成验证码
|
||||
@ -31,32 +45,42 @@ public class CaptchaController
|
||||
@GetMapping("/captchaImage")
|
||||
public AjaxResult getCode(HttpServletResponse response) throws IOException
|
||||
{
|
||||
// 生成随机字串
|
||||
String verifyCode = VerifyCodeUtils.generateVerifyCode(4);
|
||||
// 唯一标识
|
||||
// 保存验证码信息
|
||||
String uuid = IdUtils.simpleUUID();
|
||||
String verifyKey = Constants.CAPTCHA_CODE_KEY + uuid;
|
||||
|
||||
redisCache.setCacheObject(verifyKey, verifyCode, Constants.CAPTCHA_EXPIRATION, TimeUnit.MINUTES);
|
||||
// 生成图片
|
||||
int w = 111, h = 36;
|
||||
ByteArrayOutputStream stream = new ByteArrayOutputStream();
|
||||
VerifyCodeUtils.outputImage(w, h, stream, verifyCode);
|
||||
String capStr = null, code = null;
|
||||
BufferedImage image = null;
|
||||
|
||||
// 生成验证码
|
||||
if ("math".equals(captchaType))
|
||||
{
|
||||
String capText = captchaProducerMath.createText();
|
||||
capStr = capText.substring(0, capText.lastIndexOf("@"));
|
||||
code = capText.substring(capText.lastIndexOf("@") + 1);
|
||||
image = captchaProducerMath.createImage(capStr);
|
||||
}
|
||||
else if ("char".equals(captchaType))
|
||||
{
|
||||
capStr = code = captchaProducer.createText();
|
||||
image = captchaProducer.createImage(capStr);
|
||||
}
|
||||
|
||||
redisCache.setCacheObject(verifyKey, code, Constants.CAPTCHA_EXPIRATION, TimeUnit.MINUTES);
|
||||
// 转换流信息写出
|
||||
FastByteArrayOutputStream os = new FastByteArrayOutputStream();
|
||||
try
|
||||
{
|
||||
AjaxResult ajax = AjaxResult.success();
|
||||
ajax.put("uuid", uuid);
|
||||
ajax.put("img", Base64.encode(stream.toByteArray()));
|
||||
return ajax;
|
||||
ImageIO.write(image, "jpg", os);
|
||||
}
|
||||
catch (Exception e)
|
||||
catch (IOException e)
|
||||
{
|
||||
e.printStackTrace();
|
||||
return AjaxResult.error(e.getMessage());
|
||||
}
|
||||
finally
|
||||
{
|
||||
stream.close();
|
||||
}
|
||||
|
||||
AjaxResult ajax = AjaxResult.success();
|
||||
ajax.put("uuid", uuid);
|
||||
ajax.put("img", Base64.encode(os.toByteArray()));
|
||||
return ajax;
|
||||
}
|
||||
}
|
||||
|
@ -5,6 +5,7 @@ import javax.servlet.http.HttpServletResponse;
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.http.MediaType;
|
||||
import org.springframework.web.bind.annotation.GetMapping;
|
||||
import org.springframework.web.bind.annotation.PostMapping;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
@ -41,17 +42,15 @@ public class CommonController
|
||||
{
|
||||
try
|
||||
{
|
||||
if (!FileUtils.isValidFilename(fileName))
|
||||
if (!FileUtils.checkAllowDownload(fileName))
|
||||
{
|
||||
throw new Exception(StringUtils.format("文件名称({})非法,不允许下载。 ", fileName));
|
||||
}
|
||||
String realFileName = System.currentTimeMillis() + fileName.substring(fileName.indexOf("_") + 1);
|
||||
String filePath = RuoYiConfig.getDownloadPath() + fileName;
|
||||
|
||||
response.setCharacterEncoding("utf-8");
|
||||
response.setContentType("multipart/form-data");
|
||||
response.setHeader("Content-Disposition",
|
||||
"attachment;fileName=" + FileUtils.setFileDownloadHeader(request, realFileName));
|
||||
response.setContentType(MediaType.APPLICATION_OCTET_STREAM_VALUE);
|
||||
FileUtils.setAttachmentResponseHeader(response, realFileName);
|
||||
FileUtils.writeBytes(filePath, response.getOutputStream());
|
||||
if (delete)
|
||||
{
|
||||
@ -92,18 +91,28 @@ public class CommonController
|
||||
* 本地资源通用下载
|
||||
*/
|
||||
@GetMapping("/common/download/resource")
|
||||
public void resourceDownload(String name, HttpServletRequest request, HttpServletResponse response) throws Exception
|
||||
public void resourceDownload(String resource, HttpServletRequest request, HttpServletResponse response)
|
||||
throws Exception
|
||||
{
|
||||
// 本地资源路径
|
||||
String localPath = RuoYiConfig.getProfile();
|
||||
// 数据库资源地址
|
||||
String downloadPath = localPath + StringUtils.substringAfter(name, Constants.RESOURCE_PREFIX);
|
||||
// 下载名称
|
||||
String downloadName = StringUtils.substringAfterLast(downloadPath, "/");
|
||||
response.setCharacterEncoding("utf-8");
|
||||
response.setContentType("multipart/form-data");
|
||||
response.setHeader("Content-Disposition",
|
||||
"attachment;fileName=" + FileUtils.setFileDownloadHeader(request, downloadName));
|
||||
FileUtils.writeBytes(downloadPath, response.getOutputStream());
|
||||
try
|
||||
{
|
||||
if (!FileUtils.checkAllowDownload(resource))
|
||||
{
|
||||
throw new Exception(StringUtils.format("资源文件({})非法,不允许下载。 ", resource));
|
||||
}
|
||||
// 本地资源路径
|
||||
String localPath = RuoYiConfig.getProfile();
|
||||
// 数据库资源地址
|
||||
String downloadPath = localPath + StringUtils.substringAfter(resource, Constants.RESOURCE_PREFIX);
|
||||
// 下载名称
|
||||
String downloadName = StringUtils.substringAfterLast(downloadPath, "/");
|
||||
response.setContentType(MediaType.APPLICATION_OCTET_STREAM_VALUE);
|
||||
FileUtils.setAttachmentResponseHeader(response, downloadName);
|
||||
FileUtils.writeBytes(downloadPath, response.getOutputStream());
|
||||
}
|
||||
catch (Exception e)
|
||||
{
|
||||
log.error("下载文件失败", e);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -38,18 +38,18 @@ public class SysLogininforController extends BaseController
|
||||
return getDataTable(list);
|
||||
}
|
||||
|
||||
@Log(title = "登陆日志", businessType = BusinessType.EXPORT)
|
||||
@Log(title = "登录日志", businessType = BusinessType.EXPORT)
|
||||
@PreAuthorize("@ss.hasPermi('monitor:logininfor:export')")
|
||||
@GetMapping("/export")
|
||||
public AjaxResult export(SysLogininfor logininfor)
|
||||
{
|
||||
List<SysLogininfor> list = logininforService.selectLogininforList(logininfor);
|
||||
ExcelUtil<SysLogininfor> util = new ExcelUtil<SysLogininfor>(SysLogininfor.class);
|
||||
return util.exportExcel(list, "登陆日志");
|
||||
return util.exportExcel(list, "登录日志");
|
||||
}
|
||||
|
||||
@PreAuthorize("@ss.hasPermi('monitor:logininfor:remove')")
|
||||
@Log(title = "登陆日志", businessType = BusinessType.DELETE)
|
||||
@Log(title = "登录日志", businessType = BusinessType.DELETE)
|
||||
@DeleteMapping("/{infoIds}")
|
||||
public AjaxResult remove(@PathVariable Long[] infoIds)
|
||||
{
|
||||
@ -57,7 +57,7 @@ public class SysLogininforController extends BaseController
|
||||
}
|
||||
|
||||
@PreAuthorize("@ss.hasPermi('monitor:logininfor:remove')")
|
||||
@Log(title = "登陆日志", businessType = BusinessType.CLEAN)
|
||||
@Log(title = "登录日志", businessType = BusinessType.CLEAN)
|
||||
@DeleteMapping("/clean")
|
||||
public AjaxResult clean()
|
||||
{
|
||||
|
@ -82,7 +82,7 @@ public class SysUserOnlineController extends BaseController
|
||||
* 强退用户
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('monitor:online:forceLogout')")
|
||||
@Log(title = "在线用户", businessType = BusinessType.DELETE)
|
||||
@Log(title = "在线用户", businessType = BusinessType.FORCE)
|
||||
@DeleteMapping("/{tokenId}")
|
||||
public AjaxResult forceLogout(@PathVariable String tokenId)
|
||||
{
|
||||
|
@ -126,7 +126,11 @@ public class SysMenuController extends BaseController
|
||||
else if (UserConstants.YES_FRAME.equals(menu.getIsFrame())
|
||||
&& !StringUtils.startsWithAny(menu.getPath(), Constants.HTTP, Constants.HTTPS))
|
||||
{
|
||||
return AjaxResult.error("新增菜单'" + menu.getMenuName() + "'失败,地址必须以http(s)://开头");
|
||||
return AjaxResult.error("修改菜单'" + menu.getMenuName() + "'失败,地址必须以http(s)://开头");
|
||||
}
|
||||
else if (menu.getMenuId().equals(menu.getParentId()))
|
||||
{
|
||||
return AjaxResult.error("修改菜单'" + menu.getMenuName() + "'失败,上级菜单不能选择自己");
|
||||
}
|
||||
menu.setUpdateBy(SecurityUtils.getUsername());
|
||||
return toAjax(menuService.updateMenu(menu));
|
||||
|
@ -17,11 +17,17 @@ import com.ruoyi.common.constant.UserConstants;
|
||||
import com.ruoyi.common.core.controller.BaseController;
|
||||
import com.ruoyi.common.core.domain.AjaxResult;
|
||||
import com.ruoyi.common.core.domain.entity.SysRole;
|
||||
import com.ruoyi.common.core.domain.model.LoginUser;
|
||||
import com.ruoyi.common.core.page.TableDataInfo;
|
||||
import com.ruoyi.common.enums.BusinessType;
|
||||
import com.ruoyi.common.utils.SecurityUtils;
|
||||
import com.ruoyi.common.utils.ServletUtils;
|
||||
import com.ruoyi.common.utils.StringUtils;
|
||||
import com.ruoyi.common.utils.poi.ExcelUtil;
|
||||
import com.ruoyi.framework.web.service.SysPermissionService;
|
||||
import com.ruoyi.framework.web.service.TokenService;
|
||||
import com.ruoyi.system.service.ISysRoleService;
|
||||
import com.ruoyi.system.service.ISysUserService;
|
||||
|
||||
/**
|
||||
* 角色信息
|
||||
@ -35,6 +41,15 @@ public class SysRoleController extends BaseController
|
||||
@Autowired
|
||||
private ISysRoleService roleService;
|
||||
|
||||
@Autowired
|
||||
private TokenService tokenService;
|
||||
|
||||
@Autowired
|
||||
private SysPermissionService permissionService;
|
||||
|
||||
@Autowired
|
||||
private ISysUserService userService;
|
||||
|
||||
@PreAuthorize("@ss.hasPermi('system:role:list')")
|
||||
@GetMapping("/list")
|
||||
public TableDataInfo list(SysRole role)
|
||||
@ -103,7 +118,20 @@ public class SysRoleController extends BaseController
|
||||
return AjaxResult.error("修改角色'" + role.getRoleName() + "'失败,角色权限已存在");
|
||||
}
|
||||
role.setUpdateBy(SecurityUtils.getUsername());
|
||||
return toAjax(roleService.updateRole(role));
|
||||
|
||||
if (roleService.updateRole(role) > 0)
|
||||
{
|
||||
// 更新缓存用户权限
|
||||
LoginUser loginUser = tokenService.getLoginUser(ServletUtils.getRequest());
|
||||
if (StringUtils.isNotNull(loginUser.getUser()) && !loginUser.getUser().isAdmin())
|
||||
{
|
||||
loginUser.setPermissions(permissionService.getMenuPermission(loginUser.getUser()));
|
||||
loginUser.setUser(userService.selectUserByUserName(loginUser.getUser().getUserName()));
|
||||
tokenService.setLoginUser(loginUser);
|
||||
}
|
||||
return AjaxResult.success();
|
||||
}
|
||||
return AjaxResult.error("修改角色'" + role.getRoleName() + "'失败,请联系管理员");
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -175,7 +175,7 @@ public class SysUserController extends BaseController
|
||||
/**
|
||||
* 重置密码
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('system:user:edit')")
|
||||
@PreAuthorize("@ss.hasPermi('system:user:resetPwd')")
|
||||
@Log(title = "用户管理", businessType = BusinessType.UPDATE)
|
||||
@PutMapping("/resetPwd")
|
||||
public AjaxResult resetPwd(@RequestBody SysUser user)
|
||||
|
@ -3,15 +3,17 @@ ruoyi:
|
||||
# 名称
|
||||
name: RuoYi
|
||||
# 版本
|
||||
version: 3.0.0
|
||||
version: 3.2.1
|
||||
# 版权年份
|
||||
copyrightYear: 2019
|
||||
copyrightYear: 2020
|
||||
# 实例演示开关
|
||||
demoEnabled: true
|
||||
# 文件路径 示例( Windows配置D:/ruoyi/uploadPath,Linux配置 /home/ruoyi/uploadPath)
|
||||
profile: D:/ruoyi/uploadPath
|
||||
# 获取ip地址开关
|
||||
addressEnabled: false
|
||||
# 验证码类型 math 数组计算 char 字符验证
|
||||
captchaType: math
|
||||
|
||||
# 开发环境配置
|
||||
server:
|
||||
|
@ -5,7 +5,7 @@
|
||||
<parent>
|
||||
<artifactId>ruoyi</artifactId>
|
||||
<groupId>com.ruoyi</groupId>
|
||||
<version>3.0.0</version>
|
||||
<version>3.2.1</version>
|
||||
</parent>
|
||||
<modelVersion>4.0.0</modelVersion>
|
||||
|
||||
|
@ -4,6 +4,7 @@ import java.lang.annotation.ElementType;
|
||||
import java.lang.annotation.Retention;
|
||||
import java.lang.annotation.RetentionPolicy;
|
||||
import java.lang.annotation.Target;
|
||||
import java.math.BigDecimal;
|
||||
|
||||
/**
|
||||
* 自定义导出Excel数据注解
|
||||
@ -29,11 +30,31 @@ public @interface Excel
|
||||
*/
|
||||
public String dateFormat() default "";
|
||||
|
||||
/**
|
||||
* 如果是字典类型,请设置字典的type值 (如: sys_user_sex)
|
||||
*/
|
||||
public String dictType() default "";
|
||||
|
||||
/**
|
||||
* 读取内容转表达式 (如: 0=男,1=女,2=未知)
|
||||
*/
|
||||
public String readConverterExp() default "";
|
||||
|
||||
/**
|
||||
* 分隔符,读取字符串组内容
|
||||
*/
|
||||
public String separator() default ",";
|
||||
|
||||
/**
|
||||
* BigDecimal 精度 默认:-1(默认不开启BigDecimal格式化)
|
||||
*/
|
||||
public int scale() default -1;
|
||||
|
||||
/**
|
||||
* BigDecimal 舍入规则 默认:BigDecimal.ROUND_HALF_EVEN
|
||||
*/
|
||||
public int roundingMode() default BigDecimal.ROUND_HALF_EVEN;
|
||||
|
||||
/**
|
||||
* 导出类型(0数字 1字符串)
|
||||
*/
|
||||
@ -79,6 +100,11 @@ public @interface Excel
|
||||
*/
|
||||
public String targetAttr() default "";
|
||||
|
||||
/**
|
||||
* 是否自动统计数据,在最后追加一行统计数据总和
|
||||
*/
|
||||
public boolean isStatistics() default false;
|
||||
|
||||
/**
|
||||
* 字段类型(0:导出导入;1:仅导出;2:仅导入)
|
||||
*/
|
||||
@ -115,4 +141,4 @@ public @interface Excel
|
||||
return this.value;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
@ -61,6 +61,11 @@ public class Constants
|
||||
* 登录用户 redis key
|
||||
*/
|
||||
public static final String LOGIN_TOKEN_KEY = "login_tokens:";
|
||||
|
||||
/**
|
||||
* 防重提交 redis key
|
||||
*/
|
||||
public static final String REPEAT_SUBMIT_KEY = "repeat_submit:";
|
||||
|
||||
/**
|
||||
* 验证码有效期(分钟)
|
||||
|
@ -22,8 +22,14 @@ public class GenConstants
|
||||
/** 树名称字段 */
|
||||
public static final String TREE_NAME = "treeName";
|
||||
|
||||
/** 上级菜单ID字段 */
|
||||
public static final String PARENT_MENU_ID = "parentMenuId";
|
||||
|
||||
/** 上级菜单名称字段 */
|
||||
public static final String PARENT_MENU_NAME = "parentMenuName";
|
||||
|
||||
/** 数据库字符串类型 */
|
||||
public static final String[] COLUMNTYPE_STR = { "char", "varchar", "narchar", "varchar2", "tinytext", "text",
|
||||
public static final String[] COLUMNTYPE_STR = { "char", "varchar", "nvarchar", "varchar2", "tinytext", "text",
|
||||
"mediumtext", "longtext" };
|
||||
|
||||
/** 数据库时间类型 */
|
||||
@ -31,7 +37,7 @@ public class GenConstants
|
||||
|
||||
/** 数据库数字类型 */
|
||||
public static final String[] COLUMNTYPE_NUMBER = { "tinyint", "smallint", "mediumint", "int", "number", "integer",
|
||||
"bigint", "float", "float", "double", "decimal" };
|
||||
"bit", "bigint", "float", "float", "double", "decimal" };
|
||||
|
||||
/** 页面不需要编辑字段 */
|
||||
public static final String[] COLUMNNAME_NOT_EDIT = { "id", "create_by", "create_time", "del_flag" };
|
||||
@ -68,6 +74,12 @@ public class GenConstants
|
||||
/** 日期控件 */
|
||||
public static final String HTML_DATETIME = "datetime";
|
||||
|
||||
/** 上传控件 */
|
||||
public static final String HTML_UPLOAD_IMAGE = "uploadImage";
|
||||
|
||||
/** 富文本控件 */
|
||||
public static final String HTML_EDITOR = "editor";
|
||||
|
||||
/** 字符串类型 */
|
||||
public static final String TYPE_STRING = "String";
|
||||
|
||||
|
@ -41,6 +41,9 @@ public class SysMenu extends BaseEntity
|
||||
/** 是否为外链(0是 1否) */
|
||||
private String isFrame;
|
||||
|
||||
/** 是否缓存(0缓存 1不缓存) */
|
||||
private String isCache;
|
||||
|
||||
/** 类型(M目录 C菜单 F按钮) */
|
||||
private String menuType;
|
||||
|
||||
@ -144,6 +147,16 @@ public class SysMenu extends BaseEntity
|
||||
this.isFrame = isFrame;
|
||||
}
|
||||
|
||||
public String getIsCache()
|
||||
{
|
||||
return isCache;
|
||||
}
|
||||
|
||||
public void setIsCache(String isCache)
|
||||
{
|
||||
this.isCache = isCache;
|
||||
}
|
||||
|
||||
@NotBlank(message = "菜单类型不能为空")
|
||||
public String getMenuType()
|
||||
{
|
||||
@ -216,6 +229,7 @@ public class SysMenu extends BaseEntity
|
||||
.append("path", getPath())
|
||||
.append("component", getComponent())
|
||||
.append("isFrame", getIsFrame())
|
||||
.append("IsCache", getIsCache())
|
||||
.append("menuType", getMenuType())
|
||||
.append("visible", getVisible())
|
||||
.append("status ", getStatus())
|
||||
|
@ -37,6 +37,12 @@ public class SysRole extends BaseEntity
|
||||
@Excel(name = "数据范围", readConverterExp = "1=所有数据权限,2=自定义数据权限,3=本部门数据权限,4=本部门及以下数据权限")
|
||||
private String dataScope;
|
||||
|
||||
/** 菜单树选择项是否关联显示( 0:父子不互相关联显示 1:父子互相关联显示) */
|
||||
private boolean menuCheckStrictly;
|
||||
|
||||
/** 部门树选择项是否关联显示(0:父子不互相关联显示 1:父子互相关联显示 ) */
|
||||
private boolean deptCheckStrictly;
|
||||
|
||||
/** 角色状态(0正常 1停用) */
|
||||
@Excel(name = "角色状态", readConverterExp = "0=正常,1=停用")
|
||||
private String status;
|
||||
@ -128,6 +134,26 @@ public class SysRole extends BaseEntity
|
||||
this.dataScope = dataScope;
|
||||
}
|
||||
|
||||
public boolean isMenuCheckStrictly()
|
||||
{
|
||||
return menuCheckStrictly;
|
||||
}
|
||||
|
||||
public void setMenuCheckStrictly(boolean menuCheckStrictly)
|
||||
{
|
||||
this.menuCheckStrictly = menuCheckStrictly;
|
||||
}
|
||||
|
||||
public boolean isDeptCheckStrictly()
|
||||
{
|
||||
return deptCheckStrictly;
|
||||
}
|
||||
|
||||
public void setDeptCheckStrictly(boolean deptCheckStrictly)
|
||||
{
|
||||
this.deptCheckStrictly = deptCheckStrictly;
|
||||
}
|
||||
|
||||
public String getStatus()
|
||||
{
|
||||
return status;
|
||||
@ -186,6 +212,8 @@ public class SysRole extends BaseEntity
|
||||
.append("roleKey", getRoleKey())
|
||||
.append("roleSort", getRoleSort())
|
||||
.append("dataScope", getDataScope())
|
||||
.append("menuCheckStrictly", isMenuCheckStrictly())
|
||||
.append("deptCheckStrictly", isDeptCheckStrictly())
|
||||
.append("status", getStatus())
|
||||
.append("delFlag", getDelFlag())
|
||||
.append("createBy", getCreateBy())
|
||||
|
@ -68,12 +68,12 @@ public class SysUser extends BaseEntity
|
||||
/** 删除标志(0代表存在 2代表删除) */
|
||||
private String delFlag;
|
||||
|
||||
/** 最后登陆IP */
|
||||
@Excel(name = "最后登陆IP", type = Type.EXPORT)
|
||||
/** 最后登录IP */
|
||||
@Excel(name = "最后登录IP", type = Type.EXPORT)
|
||||
private String loginIp;
|
||||
|
||||
/** 最后登陆时间 */
|
||||
@Excel(name = "最后登陆时间", width = 30, dateFormat = "yyyy-MM-dd HH:mm:ss", type = Type.EXPORT)
|
||||
/** 最后登录时间 */
|
||||
@Excel(name = "最后登录时间", width = 30, dateFormat = "yyyy-MM-dd HH:mm:ss", type = Type.EXPORT)
|
||||
private Date loginDate;
|
||||
|
||||
/** 部门对象 */
|
||||
|
@ -22,7 +22,7 @@ public class LoginUser implements UserDetails
|
||||
private String token;
|
||||
|
||||
/**
|
||||
* 登陆时间
|
||||
* 登录时间
|
||||
*/
|
||||
private Long loginTime;
|
||||
|
||||
|
@ -18,8 +18,8 @@ public class PageDomain
|
||||
/** 排序列 */
|
||||
private String orderByColumn;
|
||||
|
||||
/** 排序的方向 "desc" 或者 "asc". */
|
||||
private String isAsc;
|
||||
/** 排序的方向desc或者asc */
|
||||
private String isAsc = "asc";
|
||||
|
||||
public String getOrderBy()
|
||||
{
|
||||
|
@ -13,7 +13,7 @@ import org.springframework.stereotype.Component;
|
||||
|
||||
/**
|
||||
* spring redis 工具类
|
||||
*
|
||||
*
|
||||
* @author ruoyi
|
||||
**/
|
||||
@SuppressWarnings(value = { "unchecked", "rawtypes" })
|
||||
@ -109,7 +109,7 @@ public class RedisCache
|
||||
* 缓存List数据
|
||||
*
|
||||
* @param key 缓存的键值
|
||||
* @param values 待缓存的List数据
|
||||
* @param dataList 待缓存的List数据
|
||||
* @return 缓存的对象
|
||||
*/
|
||||
public <T> long setCacheList(final String key, final List<T> dataList)
|
||||
@ -216,7 +216,7 @@ public class RedisCache
|
||||
|
||||
/**
|
||||
* 获得缓存的基本对象列表
|
||||
*
|
||||
*
|
||||
* @param pattern 字符串前缀
|
||||
* @return 对象列表
|
||||
*/
|
||||
|
@ -2,7 +2,6 @@ package com.ruoyi.common.utils;
|
||||
|
||||
import java.util.Collection;
|
||||
import java.util.List;
|
||||
|
||||
import com.ruoyi.common.constant.Constants;
|
||||
import com.ruoyi.common.core.domain.entity.SysDictData;
|
||||
import com.ruoyi.common.core.redis.RedisCache;
|
||||
@ -15,6 +14,11 @@ import com.ruoyi.common.utils.spring.SpringUtils;
|
||||
*/
|
||||
public class DictUtils
|
||||
{
|
||||
/**
|
||||
* 分隔符
|
||||
*/
|
||||
public static final String SEPARATOR = ",";
|
||||
|
||||
/**
|
||||
* 设置字典缓存
|
||||
*
|
||||
@ -37,12 +41,116 @@ public class DictUtils
|
||||
Object cacheObj = SpringUtils.getBean(RedisCache.class).getCacheObject(getCacheKey(key));
|
||||
if (StringUtils.isNotNull(cacheObj))
|
||||
{
|
||||
List<SysDictData> DictDatas = StringUtils.cast(cacheObj);
|
||||
return DictDatas;
|
||||
List<SysDictData> dictDatas = StringUtils.cast(cacheObj);
|
||||
return dictDatas;
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
/**
|
||||
* 根据字典类型和字典值获取字典标签
|
||||
*
|
||||
* @param dictType 字典类型
|
||||
* @param dictValue 字典值
|
||||
* @return 字典标签
|
||||
*/
|
||||
public static String getDictLabel(String dictType, String dictValue)
|
||||
{
|
||||
return getDictLabel(dictType, dictValue, SEPARATOR);
|
||||
}
|
||||
|
||||
/**
|
||||
* 根据字典类型和字典标签获取字典值
|
||||
*
|
||||
* @param dictType 字典类型
|
||||
* @param dictLabel 字典标签
|
||||
* @return 字典值
|
||||
*/
|
||||
public static String getDictValue(String dictType, String dictLabel)
|
||||
{
|
||||
return getDictValue(dictType, dictLabel, SEPARATOR);
|
||||
}
|
||||
|
||||
/**
|
||||
* 根据字典类型和字典值获取字典标签
|
||||
*
|
||||
* @param dictType 字典类型
|
||||
* @param dictValue 字典值
|
||||
* @param separator 分隔符
|
||||
* @return 字典标签
|
||||
*/
|
||||
public static String getDictLabel(String dictType, String dictValue, String separator)
|
||||
{
|
||||
StringBuilder propertyString = new StringBuilder();
|
||||
List<SysDictData> datas = getDictCache(dictType);
|
||||
|
||||
if (StringUtils.containsAny(separator, dictValue) && StringUtils.isNotEmpty(datas))
|
||||
{
|
||||
for (SysDictData dict : datas)
|
||||
{
|
||||
for (String value : dictValue.split(separator))
|
||||
{
|
||||
if (value.equals(dict.getDictValue()))
|
||||
{
|
||||
propertyString.append(dict.getDictLabel() + separator);
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
for (SysDictData dict : datas)
|
||||
{
|
||||
if (dictValue.equals(dict.getDictValue()))
|
||||
{
|
||||
return dict.getDictLabel();
|
||||
}
|
||||
}
|
||||
}
|
||||
return StringUtils.stripEnd(propertyString.toString(), separator);
|
||||
}
|
||||
|
||||
/**
|
||||
* 根据字典类型和字典标签获取字典值
|
||||
*
|
||||
* @param dictType 字典类型
|
||||
* @param dictLabel 字典标签
|
||||
* @param separator 分隔符
|
||||
* @return 字典值
|
||||
*/
|
||||
public static String getDictValue(String dictType, String dictLabel, String separator)
|
||||
{
|
||||
StringBuilder propertyString = new StringBuilder();
|
||||
List<SysDictData> datas = getDictCache(dictType);
|
||||
|
||||
if (StringUtils.containsAny(separator, dictLabel) && StringUtils.isNotEmpty(datas))
|
||||
{
|
||||
for (SysDictData dict : datas)
|
||||
{
|
||||
for (String label : dictLabel.split(separator))
|
||||
{
|
||||
if (label.equals(dict.getDictLabel()))
|
||||
{
|
||||
propertyString.append(dict.getDictValue() + separator);
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
for (SysDictData dict : datas)
|
||||
{
|
||||
if (dictLabel.equals(dict.getDictLabel()))
|
||||
{
|
||||
return dict.getDictValue();
|
||||
}
|
||||
}
|
||||
}
|
||||
return StringUtils.stripEnd(propertyString.toString(), separator);
|
||||
}
|
||||
|
||||
/**
|
||||
* 清空字典缓存
|
||||
*/
|
||||
|
@ -0,0 +1,47 @@
|
||||
package com.ruoyi.common.utils.file;
|
||||
|
||||
import java.io.File;
|
||||
import org.apache.commons.lang3.StringUtils;
|
||||
|
||||
/**
|
||||
* 文件类型工具类
|
||||
*
|
||||
* @author ruoyi
|
||||
*/
|
||||
public class FileTypeUtils
|
||||
{
|
||||
/**
|
||||
* 获取文件类型
|
||||
* <p>
|
||||
* 例如: ruoyi.txt, 返回: txt
|
||||
*
|
||||
* @param file 文件名
|
||||
* @return 后缀(不含".")
|
||||
*/
|
||||
public static String getFileType(File file)
|
||||
{
|
||||
if (null == file)
|
||||
{
|
||||
return StringUtils.EMPTY;
|
||||
}
|
||||
return getFileType(file.getName());
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取文件类型
|
||||
* <p>
|
||||
* 例如: ruoyi.txt, 返回: txt
|
||||
*
|
||||
* @param fileName 文件名
|
||||
* @return 后缀(不含".")
|
||||
*/
|
||||
public static String getFileType(String fileName)
|
||||
{
|
||||
int separatorIndex = fileName.lastIndexOf(".");
|
||||
if (separatorIndex < 0)
|
||||
{
|
||||
return "";
|
||||
}
|
||||
return fileName.substring(separatorIndex + 1).toLowerCase();
|
||||
}
|
||||
}
|
@ -15,7 +15,7 @@ import com.ruoyi.common.utils.uuid.IdUtils;
|
||||
|
||||
/**
|
||||
* 文件上传工具类
|
||||
*
|
||||
*
|
||||
* @author ruoyi
|
||||
*/
|
||||
public class FileUploadUtils
|
||||
@ -89,7 +89,7 @@ public class FileUploadUtils
|
||||
*
|
||||
* @param baseDir 相对应用的基目录
|
||||
* @param file 上传的文件
|
||||
* @param extension 上传文件类型
|
||||
* @param allowedExtension 上传文件类型
|
||||
* @return 返回上传成功的文件名
|
||||
* @throws FileSizeLimitExceededException 如果超出最大大小
|
||||
* @throws FileNameLengthLimitExceededException 文件名太长
|
||||
@ -215,7 +215,7 @@ public class FileUploadUtils
|
||||
|
||||
/**
|
||||
* 获取文件名的后缀
|
||||
*
|
||||
*
|
||||
* @param file 表单文件
|
||||
* @return 后缀名
|
||||
*/
|
||||
@ -228,4 +228,4 @@ public class FileUploadUtils
|
||||
}
|
||||
return extension;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -7,14 +7,18 @@ import java.io.IOException;
|
||||
import java.io.OutputStream;
|
||||
import java.io.UnsupportedEncodingException;
|
||||
import java.net.URLEncoder;
|
||||
import java.nio.charset.StandardCharsets;
|
||||
import javax.servlet.http.HttpServletRequest;
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
import org.apache.commons.lang3.ArrayUtils;
|
||||
import com.ruoyi.common.utils.StringUtils;
|
||||
|
||||
/**
|
||||
* 文件处理工具类
|
||||
*
|
||||
* @author ruoyi
|
||||
*/
|
||||
public class FileUtils
|
||||
public class FileUtils extends org.apache.commons.io.FileUtils
|
||||
{
|
||||
public static String FILENAME_PATTERN = "[a-zA-Z0-9_\\-\\|\\.\\u4e00-\\u9fa5]+";
|
||||
|
||||
@ -104,6 +108,30 @@ public class FileUtils
|
||||
return filename.matches(FILENAME_PATTERN);
|
||||
}
|
||||
|
||||
/**
|
||||
* 检查文件是否可下载
|
||||
*
|
||||
* @param resource 需要下载的文件
|
||||
* @return true 正常 false 非法
|
||||
*/
|
||||
public static boolean checkAllowDownload(String resource)
|
||||
{
|
||||
// 禁止目录上跳级别
|
||||
if (StringUtils.contains(resource, ".."))
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
// 检查允许下载的文件规则
|
||||
if (ArrayUtils.contains(MimeTypeUtils.DEFAULT_ALLOWED_EXTENSION, FileTypeUtils.getFileType(resource)))
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
||||
// 不在允许下载的文件规则
|
||||
return false;
|
||||
}
|
||||
|
||||
/**
|
||||
* 下载文件名重新编码
|
||||
*
|
||||
@ -111,8 +139,7 @@ public class FileUtils
|
||||
* @param fileName 文件名
|
||||
* @return 编码后的文件名
|
||||
*/
|
||||
public static String setFileDownloadHeader(HttpServletRequest request, String fileName)
|
||||
throws UnsupportedEncodingException
|
||||
public static String setFileDownloadHeader(HttpServletRequest request, String fileName) throws UnsupportedEncodingException
|
||||
{
|
||||
final String agent = request.getHeader("USER-AGENT");
|
||||
String filename = fileName;
|
||||
@ -139,4 +166,38 @@ public class FileUtils
|
||||
}
|
||||
return filename;
|
||||
}
|
||||
|
||||
/**
|
||||
* 下载文件名重新编码
|
||||
*
|
||||
* @param response 响应对象
|
||||
* @param realFileName 真实文件名
|
||||
* @return
|
||||
*/
|
||||
public static void setAttachmentResponseHeader(HttpServletResponse response, String realFileName) throws UnsupportedEncodingException
|
||||
{
|
||||
String percentEncodedFileName = percentEncode(realFileName);
|
||||
|
||||
StringBuilder contentDispositionValue = new StringBuilder();
|
||||
contentDispositionValue.append("attachment; filename=")
|
||||
.append(percentEncodedFileName)
|
||||
.append(";")
|
||||
.append("filename*=")
|
||||
.append("utf-8''")
|
||||
.append(percentEncodedFileName);
|
||||
|
||||
response.setHeader("Content-disposition", contentDispositionValue.toString());
|
||||
}
|
||||
|
||||
/**
|
||||
* 百分号编码工具方法
|
||||
*
|
||||
* @param s 需要百分号编码的字符串
|
||||
* @return 百分号编码后的字符串
|
||||
*/
|
||||
public static String percentEncode(String s) throws UnsupportedEncodingException
|
||||
{
|
||||
String encode = URLEncoder.encode(s, StandardCharsets.UTF_8.toString());
|
||||
return encode.replaceAll("\\+", "%20");
|
||||
}
|
||||
}
|
||||
|
@ -144,7 +144,10 @@ public class EscapeUtil
|
||||
|
||||
public static void main(String[] args)
|
||||
{
|
||||
String html = "alert('11111');";
|
||||
String html = "<script>alert(1);</script>";
|
||||
// String html = "<scr<script>ipt>alert(\"XSS\")</scr<script>ipt>";
|
||||
// String html = "<123";
|
||||
// String html = "123>";
|
||||
System.out.println(EscapeUtil.clean(html));
|
||||
System.out.println(EscapeUtil.escape(html));
|
||||
System.out.println(EscapeUtil.unescape(html));
|
||||
|
@ -131,7 +131,7 @@ public final class HTMLFilter
|
||||
vAllowedEntities = new String[] { "amp", "gt", "lt", "quot" };
|
||||
stripComment = true;
|
||||
encodeQuotes = true;
|
||||
alwaysMakeTags = true;
|
||||
alwaysMakeTags = false;
|
||||
}
|
||||
|
||||
/**
|
||||
@ -208,7 +208,7 @@ public final class HTMLFilter
|
||||
|
||||
s = processRemoveBlanks(s);
|
||||
|
||||
s = validateEntities(s);
|
||||
// s = validateEntities(s);
|
||||
|
||||
return s;
|
||||
}
|
||||
@ -245,6 +245,7 @@ public final class HTMLFilter
|
||||
// try and form html
|
||||
//
|
||||
s = regexReplace(P_END_ARROW, "", s);
|
||||
// 不追加结束标签
|
||||
s = regexReplace(P_BODY_TO_END, "<$1>", s);
|
||||
s = regexReplace(P_XML_CONTENT, "$1<$2", s);
|
||||
|
||||
|
@ -6,7 +6,6 @@ import java.io.IOException;
|
||||
import java.io.InputStream;
|
||||
import java.io.OutputStream;
|
||||
import java.lang.reflect.Field;
|
||||
import java.lang.reflect.Method;
|
||||
import java.math.BigDecimal;
|
||||
import java.text.DecimalFormat;
|
||||
import java.util.ArrayList;
|
||||
@ -16,6 +15,7 @@ import java.util.Date;
|
||||
import java.util.HashMap;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.Set;
|
||||
import java.util.UUID;
|
||||
import java.util.stream.Collectors;
|
||||
import org.apache.poi.hssf.usermodel.HSSFDateUtil;
|
||||
@ -50,6 +50,7 @@ import com.ruoyi.common.core.domain.AjaxResult;
|
||||
import com.ruoyi.common.core.text.Convert;
|
||||
import com.ruoyi.common.exception.CustomException;
|
||||
import com.ruoyi.common.utils.DateUtils;
|
||||
import com.ruoyi.common.utils.DictUtils;
|
||||
import com.ruoyi.common.utils.StringUtils;
|
||||
import com.ruoyi.common.utils.reflect.ReflectUtils;
|
||||
|
||||
@ -102,6 +103,16 @@ public class ExcelUtil<T>
|
||||
*/
|
||||
private List<Object[]> fields;
|
||||
|
||||
/**
|
||||
* 统计列表
|
||||
*/
|
||||
private Map<Integer, Double> statistics = new HashMap<Integer, Double>();
|
||||
|
||||
/**
|
||||
* 数字格式
|
||||
*/
|
||||
private static final DecimalFormat DOUBLE_FORMAT = new DecimalFormat("######0.00");
|
||||
|
||||
/**
|
||||
* 实体对象
|
||||
*/
|
||||
@ -199,7 +210,10 @@ public class ExcelUtil<T>
|
||||
// 设置类的私有字段属性可访问.
|
||||
field.setAccessible(true);
|
||||
Integer column = cellMap.get(attr.name());
|
||||
fieldsMap.put(column, field);
|
||||
if (column != null)
|
||||
{
|
||||
fieldsMap.put(column, field);
|
||||
}
|
||||
}
|
||||
}
|
||||
for (int i = 1; i < rows; i++)
|
||||
@ -229,19 +243,19 @@ public class ExcelUtil<T>
|
||||
val = Convert.toStr(val);
|
||||
}
|
||||
}
|
||||
else if ((Integer.TYPE == fieldType) || (Integer.class == fieldType))
|
||||
else if ((Integer.TYPE == fieldType || Integer.class == fieldType) && StringUtils.isNumeric(Convert.toStr(val)))
|
||||
{
|
||||
val = Convert.toInt(val);
|
||||
}
|
||||
else if ((Long.TYPE == fieldType) || (Long.class == fieldType))
|
||||
else if (Long.TYPE == fieldType || Long.class == fieldType)
|
||||
{
|
||||
val = Convert.toLong(val);
|
||||
}
|
||||
else if ((Double.TYPE == fieldType) || (Double.class == fieldType))
|
||||
else if (Double.TYPE == fieldType || Double.class == fieldType)
|
||||
{
|
||||
val = Convert.toDouble(val);
|
||||
}
|
||||
else if ((Float.TYPE == fieldType) || (Float.class == fieldType))
|
||||
else if (Float.TYPE == fieldType || Float.class == fieldType)
|
||||
{
|
||||
val = Convert.toFloat(val);
|
||||
}
|
||||
@ -270,7 +284,11 @@ public class ExcelUtil<T>
|
||||
}
|
||||
else if (StringUtils.isNotEmpty(attr.readConverterExp()))
|
||||
{
|
||||
val = reverseByExp(String.valueOf(val), attr.readConverterExp());
|
||||
val = reverseByExp(Convert.toStr(val), attr.readConverterExp(), attr.separator());
|
||||
}
|
||||
else if (StringUtils.isNotEmpty(attr.dictType()))
|
||||
{
|
||||
val = reverseDictByExp(Convert.toStr(val), attr.dictType(), attr.separator());
|
||||
}
|
||||
ReflectUtils.invokeSetter(entity, propertyName, val);
|
||||
}
|
||||
@ -334,6 +352,7 @@ public class ExcelUtil<T>
|
||||
if (Type.EXPORT.equals(type))
|
||||
{
|
||||
fillExcelData(index, row);
|
||||
addStatisticsRow();
|
||||
}
|
||||
}
|
||||
String filename = encodingFilename(sheetName);
|
||||
@ -440,6 +459,15 @@ public class ExcelUtil<T>
|
||||
headerFont.setColor(IndexedColors.WHITE.getIndex());
|
||||
style.setFont(headerFont);
|
||||
styles.put("header", style);
|
||||
|
||||
style = wb.createCellStyle();
|
||||
style.setAlignment(HorizontalAlignment.CENTER);
|
||||
style.setVerticalAlignment(VerticalAlignment.CENTER);
|
||||
Font totalFont = wb.createFont();
|
||||
totalFont.setFontName("Arial");
|
||||
totalFont.setFontHeightInPoints((short) 10);
|
||||
style.setFont(totalFont);
|
||||
styles.put("total", style);
|
||||
|
||||
return styles;
|
||||
}
|
||||
@ -469,13 +497,13 @@ public class ExcelUtil<T>
|
||||
{
|
||||
if (ColumnType.STRING == attr.cellType())
|
||||
{
|
||||
cell.setCellType(CellType.NUMERIC);
|
||||
cell.setCellType(CellType.STRING);
|
||||
cell.setCellValue(StringUtils.isNull(value) ? attr.defaultValue() : value + attr.suffix());
|
||||
}
|
||||
else if (ColumnType.NUMERIC == attr.cellType())
|
||||
{
|
||||
cell.setCellType(CellType.NUMERIC);
|
||||
cell.setCellValue(Integer.parseInt(value + ""));
|
||||
cell.setCellValue(StringUtils.contains(Convert.toStr(value), ".") ? Convert.toDouble(value) : Convert.toInt(value));
|
||||
}
|
||||
}
|
||||
|
||||
@ -529,19 +557,30 @@ public class ExcelUtil<T>
|
||||
Object value = getTargetValue(vo, field, attr);
|
||||
String dateFormat = attr.dateFormat();
|
||||
String readConverterExp = attr.readConverterExp();
|
||||
String separator = attr.separator();
|
||||
String dictType = attr.dictType();
|
||||
if (StringUtils.isNotEmpty(dateFormat) && StringUtils.isNotNull(value))
|
||||
{
|
||||
cell.setCellValue(DateUtils.parseDateToStr(dateFormat, (Date) value));
|
||||
}
|
||||
else if (StringUtils.isNotEmpty(readConverterExp) && StringUtils.isNotNull(value))
|
||||
{
|
||||
cell.setCellValue(convertByExp(String.valueOf(value), readConverterExp));
|
||||
cell.setCellValue(convertByExp(Convert.toStr(value), readConverterExp, separator));
|
||||
}
|
||||
else if (StringUtils.isNotEmpty(dictType) && StringUtils.isNotNull(value))
|
||||
{
|
||||
cell.setCellValue(convertDictByExp(Convert.toStr(value), dictType, separator));
|
||||
}
|
||||
else if (value instanceof BigDecimal && -1 != attr.scale())
|
||||
{
|
||||
cell.setCellValue((((BigDecimal) value).setScale(attr.scale(), attr.roundingMode())).toString());
|
||||
}
|
||||
else
|
||||
{
|
||||
// 设置列类型
|
||||
setCellVo(value, attr, cell);
|
||||
}
|
||||
addStatisticsData(column, Convert.toStr(value), attr);
|
||||
}
|
||||
}
|
||||
catch (Exception e)
|
||||
@ -613,28 +652,36 @@ public class ExcelUtil<T>
|
||||
*
|
||||
* @param propertyValue 参数值
|
||||
* @param converterExp 翻译注解
|
||||
* @param separator 分隔符
|
||||
* @return 解析后值
|
||||
* @throws Exception
|
||||
*/
|
||||
public static String convertByExp(String propertyValue, String converterExp) throws Exception
|
||||
public static String convertByExp(String propertyValue, String converterExp, String separator)
|
||||
{
|
||||
try
|
||||
StringBuilder propertyString = new StringBuilder();
|
||||
String[] convertSource = converterExp.split(",");
|
||||
for (String item : convertSource)
|
||||
{
|
||||
String[] convertSource = converterExp.split(",");
|
||||
for (String item : convertSource)
|
||||
String[] itemArray = item.split("=");
|
||||
if (StringUtils.containsAny(separator, propertyValue))
|
||||
{
|
||||
for (String value : propertyValue.split(separator))
|
||||
{
|
||||
if (itemArray[0].equals(value))
|
||||
{
|
||||
propertyString.append(itemArray[1] + separator);
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
String[] itemArray = item.split("=");
|
||||
if (itemArray[0].equals(propertyValue))
|
||||
{
|
||||
return itemArray[1];
|
||||
}
|
||||
}
|
||||
}
|
||||
catch (Exception e)
|
||||
{
|
||||
throw e;
|
||||
}
|
||||
return propertyValue;
|
||||
return StringUtils.stripEnd(propertyString.toString(), separator);
|
||||
}
|
||||
|
||||
/**
|
||||
@ -642,28 +689,109 @@ public class ExcelUtil<T>
|
||||
*
|
||||
* @param propertyValue 参数值
|
||||
* @param converterExp 翻译注解
|
||||
* @param separator 分隔符
|
||||
* @return 解析后值
|
||||
* @throws Exception
|
||||
*/
|
||||
public static String reverseByExp(String propertyValue, String converterExp) throws Exception
|
||||
public static String reverseByExp(String propertyValue, String converterExp, String separator)
|
||||
{
|
||||
try
|
||||
StringBuilder propertyString = new StringBuilder();
|
||||
String[] convertSource = converterExp.split(",");
|
||||
for (String item : convertSource)
|
||||
{
|
||||
String[] convertSource = converterExp.split(",");
|
||||
for (String item : convertSource)
|
||||
String[] itemArray = item.split("=");
|
||||
if (StringUtils.containsAny(separator, propertyValue))
|
||||
{
|
||||
for (String value : propertyValue.split(separator))
|
||||
{
|
||||
if (itemArray[1].equals(value))
|
||||
{
|
||||
propertyString.append(itemArray[0] + separator);
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
String[] itemArray = item.split("=");
|
||||
if (itemArray[1].equals(propertyValue))
|
||||
{
|
||||
return itemArray[0];
|
||||
}
|
||||
}
|
||||
}
|
||||
catch (Exception e)
|
||||
return StringUtils.stripEnd(propertyString.toString(), separator);
|
||||
}
|
||||
|
||||
/**
|
||||
* 解析字典值
|
||||
*
|
||||
* @param dictValue 字典值
|
||||
* @param dictType 字典类型
|
||||
* @param separator 分隔符
|
||||
* @return 字典标签
|
||||
*/
|
||||
public static String convertDictByExp(String dictValue, String dictType, String separator)
|
||||
{
|
||||
return DictUtils.getDictLabel(dictType, dictValue, separator);
|
||||
}
|
||||
|
||||
/**
|
||||
* 反向解析值字典值
|
||||
*
|
||||
* @param dictLabel 字典标签
|
||||
* @param dictType 字典类型
|
||||
* @param separator 分隔符
|
||||
* @return 字典值
|
||||
*/
|
||||
public static String reverseDictByExp(String dictLabel, String dictType, String separator)
|
||||
{
|
||||
return DictUtils.getDictValue(dictType, dictLabel, separator);
|
||||
}
|
||||
|
||||
/**
|
||||
* 合计统计信息
|
||||
*/
|
||||
private void addStatisticsData(Integer index, String text, Excel entity)
|
||||
{
|
||||
if (entity != null && entity.isStatistics())
|
||||
{
|
||||
throw e;
|
||||
Double temp = 0D;
|
||||
if (!statistics.containsKey(index))
|
||||
{
|
||||
statistics.put(index, temp);
|
||||
}
|
||||
try
|
||||
{
|
||||
temp = Double.valueOf(text);
|
||||
}
|
||||
catch (NumberFormatException e)
|
||||
{
|
||||
}
|
||||
statistics.put(index, statistics.get(index) + temp);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 创建统计行
|
||||
*/
|
||||
public void addStatisticsRow()
|
||||
{
|
||||
if (statistics.size() > 0)
|
||||
{
|
||||
Cell cell = null;
|
||||
Row row = sheet.createRow(sheet.getLastRowNum() + 1);
|
||||
Set<Integer> keys = statistics.keySet();
|
||||
cell = row.createCell(0);
|
||||
cell.setCellStyle(styles.get("total"));
|
||||
cell.setCellValue("合计");
|
||||
|
||||
for (Integer key : keys)
|
||||
{
|
||||
cell = row.createCell(key);
|
||||
cell.setCellStyle(styles.get("total"));
|
||||
cell.setCellValue(DOUBLE_FORMAT.format(statistics.get(key)));
|
||||
}
|
||||
statistics.clear();
|
||||
}
|
||||
return propertyValue;
|
||||
}
|
||||
|
||||
/**
|
||||
@ -735,9 +863,9 @@ public class ExcelUtil<T>
|
||||
if (StringUtils.isNotEmpty(name))
|
||||
{
|
||||
Class<?> clazz = o.getClass();
|
||||
String methodName = "get" + name.substring(0, 1).toUpperCase() + name.substring(1);
|
||||
Method method = clazz.getMethod(methodName);
|
||||
o = method.invoke(o);
|
||||
Field field = clazz.getDeclaredField(name);
|
||||
field.setAccessible(true);
|
||||
o = field.get(o);
|
||||
}
|
||||
return o;
|
||||
}
|
||||
@ -843,7 +971,7 @@ public class ExcelUtil<T>
|
||||
{
|
||||
if ((Double) val % 1 > 0)
|
||||
{
|
||||
val = new DecimalFormat("0.00").format(val);
|
||||
val = new BigDecimal(val.toString());
|
||||
}
|
||||
else
|
||||
{
|
||||
|
@ -5,7 +5,10 @@ import org.springframework.beans.BeansException;
|
||||
import org.springframework.beans.factory.NoSuchBeanDefinitionException;
|
||||
import org.springframework.beans.factory.config.BeanFactoryPostProcessor;
|
||||
import org.springframework.beans.factory.config.ConfigurableListableBeanFactory;
|
||||
import org.springframework.context.ApplicationContext;
|
||||
import org.springframework.context.ApplicationContextAware;
|
||||
import org.springframework.stereotype.Component;
|
||||
import com.ruoyi.common.utils.StringUtils;
|
||||
|
||||
/**
|
||||
* spring工具类 方便在非spring管理环境中获取bean
|
||||
@ -13,17 +16,25 @@ import org.springframework.stereotype.Component;
|
||||
* @author ruoyi
|
||||
*/
|
||||
@Component
|
||||
public final class SpringUtils implements BeanFactoryPostProcessor
|
||||
public final class SpringUtils implements BeanFactoryPostProcessor, ApplicationContextAware
|
||||
{
|
||||
/** Spring应用上下文环境 */
|
||||
private static ConfigurableListableBeanFactory beanFactory;
|
||||
|
||||
private static ApplicationContext applicationContext;
|
||||
|
||||
@Override
|
||||
public void postProcessBeanFactory(ConfigurableListableBeanFactory beanFactory) throws BeansException
|
||||
public void postProcessBeanFactory(ConfigurableListableBeanFactory beanFactory) throws BeansException
|
||||
{
|
||||
SpringUtils.beanFactory = beanFactory;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setApplicationContext(ApplicationContext applicationContext) throws BeansException
|
||||
{
|
||||
SpringUtils.applicationContext = applicationContext;
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取对象
|
||||
*
|
||||
@ -111,4 +122,25 @@ public final class SpringUtils implements BeanFactoryPostProcessor
|
||||
{
|
||||
return (T) AopContext.currentProxy();
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取当前的环境配置,无配置返回null
|
||||
*
|
||||
* @return 当前的环境配置
|
||||
*/
|
||||
public static String[] getActiveProfiles()
|
||||
{
|
||||
return applicationContext.getEnvironment().getActiveProfiles();
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取当前的环境配置,当有多个环境配置时,只获取第一个
|
||||
*
|
||||
* @return 当前的环境配置
|
||||
*/
|
||||
public static String getActiveProfile()
|
||||
{
|
||||
final String[] activeProfiles = getActiveProfiles();
|
||||
return StringUtils.isNotEmpty(activeProfiles) ? activeProfiles[0] : null;
|
||||
}
|
||||
}
|
||||
|
@ -1,5 +1,6 @@
|
||||
package com.ruoyi.common.utils.sql;
|
||||
|
||||
import com.ruoyi.common.exception.BaseException;
|
||||
import com.ruoyi.common.utils.StringUtils;
|
||||
|
||||
/**
|
||||
@ -10,9 +11,9 @@ import com.ruoyi.common.utils.StringUtils;
|
||||
public class SqlUtil
|
||||
{
|
||||
/**
|
||||
* 仅支持字母、数字、下划线、空格、逗号(支持多个字段排序)
|
||||
* 仅支持字母、数字、下划线、空格、逗号、小数点(支持多个字段排序)
|
||||
*/
|
||||
public static String SQL_PATTERN = "[a-zA-Z0-9_\\ \\,]+";
|
||||
public static String SQL_PATTERN = "[a-zA-Z0-9_\\ \\,\\.]+";
|
||||
|
||||
/**
|
||||
* 检查字符,防止注入绕过
|
||||
@ -21,7 +22,7 @@ public class SqlUtil
|
||||
{
|
||||
if (StringUtils.isNotEmpty(value) && !isValidOrderBySql(value))
|
||||
{
|
||||
return StringUtils.EMPTY;
|
||||
throw new BaseException("参数不符合规范,不能进行查询");
|
||||
}
|
||||
return value;
|
||||
}
|
||||
|
@ -5,7 +5,7 @@
|
||||
<parent>
|
||||
<artifactId>ruoyi</artifactId>
|
||||
<groupId>com.ruoyi</groupId>
|
||||
<version>3.0.0</version>
|
||||
<version>3.2.1</version>
|
||||
</parent>
|
||||
<modelVersion>4.0.0</modelVersion>
|
||||
|
||||
@ -35,22 +35,24 @@
|
||||
<artifactId>druid-spring-boot-starter</artifactId>
|
||||
</dependency>
|
||||
|
||||
<!-- 验证码 -->
|
||||
<dependency>
|
||||
<groupId>com.github.penggle</groupId>
|
||||
<artifactId>kaptcha</artifactId>
|
||||
<exclusions>
|
||||
<exclusion>
|
||||
<artifactId>javax.servlet-api</artifactId>
|
||||
<groupId>javax.servlet</groupId>
|
||||
</exclusion>
|
||||
</exclusions>
|
||||
</dependency>
|
||||
|
||||
<!-- 获取系统信息 -->
|
||||
<dependency>
|
||||
<groupId>com.github.oshi</groupId>
|
||||
<artifactId>oshi-core</artifactId>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<groupId>net.java.dev.jna</groupId>
|
||||
<artifactId>jna</artifactId>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<groupId>net.java.dev.jna</groupId>
|
||||
<artifactId>jna-platform</artifactId>
|
||||
</dependency>
|
||||
|
||||
<!-- 系统模块-->
|
||||
<dependency>
|
||||
<groupId>com.ruoyi</groupId>
|
||||
|
@ -20,7 +20,7 @@ import com.ruoyi.framework.web.service.TokenService;
|
||||
|
||||
/**
|
||||
* 数据过滤处理
|
||||
*
|
||||
*
|
||||
* @author ruoyi
|
||||
*/
|
||||
@Aspect
|
||||
@ -79,11 +79,11 @@ public class DataScopeAspect
|
||||
}
|
||||
// 获取当前的用户
|
||||
LoginUser loginUser = SpringUtils.getBean(TokenService.class).getLoginUser(ServletUtils.getRequest());
|
||||
SysUser currentUser = loginUser.getUser();
|
||||
if (currentUser != null)
|
||||
if (StringUtils.isNotNull(loginUser))
|
||||
{
|
||||
SysUser currentUser = loginUser.getUser();
|
||||
// 如果是超级管理员,则不过滤数据
|
||||
if (!currentUser.isAdmin())
|
||||
if (StringUtils.isNotNull(currentUser) && !currentUser.isAdmin())
|
||||
{
|
||||
dataScopeFilter(joinPoint, currentUser, controllerDataScope.deptAlias(),
|
||||
controllerDataScope.userAlias());
|
||||
@ -93,10 +93,10 @@ public class DataScopeAspect
|
||||
|
||||
/**
|
||||
* 数据范围过滤
|
||||
*
|
||||
*
|
||||
* @param joinPoint 切点
|
||||
* @param user 用户
|
||||
* @param alias 别名
|
||||
* @param userAlias 别名
|
||||
*/
|
||||
public static void dataScopeFilter(JoinPoint joinPoint, SysUser user, String deptAlias, String userAlias)
|
||||
{
|
||||
@ -142,8 +142,12 @@ public class DataScopeAspect
|
||||
|
||||
if (StringUtils.isNotBlank(sqlString.toString()))
|
||||
{
|
||||
BaseEntity baseEntity = (BaseEntity) joinPoint.getArgs()[0];
|
||||
baseEntity.getParams().put(DATA_SCOPE, " AND (" + sqlString.substring(4) + ")");
|
||||
Object params = joinPoint.getArgs()[0];
|
||||
if (StringUtils.isNotNull(params) && params instanceof BaseEntity)
|
||||
{
|
||||
BaseEntity baseEntity = (BaseEntity) params;
|
||||
baseEntity.getParams().put(DATA_SCOPE, " AND (" + sqlString.substring(4) + ")");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -0,0 +1,83 @@
|
||||
package com.ruoyi.framework.config;
|
||||
|
||||
import java.util.Properties;
|
||||
import org.springframework.context.annotation.Bean;
|
||||
import org.springframework.context.annotation.Configuration;
|
||||
import com.google.code.kaptcha.impl.DefaultKaptcha;
|
||||
import com.google.code.kaptcha.util.Config;
|
||||
import static com.google.code.kaptcha.Constants.*;
|
||||
|
||||
/**
|
||||
* 验证码配置
|
||||
*
|
||||
* @author ruoyi
|
||||
*/
|
||||
@Configuration
|
||||
public class CaptchaConfig
|
||||
{
|
||||
@Bean(name = "captchaProducer")
|
||||
public DefaultKaptcha getKaptchaBean()
|
||||
{
|
||||
DefaultKaptcha defaultKaptcha = new DefaultKaptcha();
|
||||
Properties properties = new Properties();
|
||||
// 是否有边框 默认为true 我们可以自己设置yes,no
|
||||
properties.setProperty(KAPTCHA_BORDER, "yes");
|
||||
// 验证码文本字符颜色 默认为Color.BLACK
|
||||
properties.setProperty(KAPTCHA_TEXTPRODUCER_FONT_COLOR, "black");
|
||||
// 验证码图片宽度 默认为200
|
||||
properties.setProperty(KAPTCHA_IMAGE_WIDTH, "160");
|
||||
// 验证码图片高度 默认为50
|
||||
properties.setProperty(KAPTCHA_IMAGE_HEIGHT, "60");
|
||||
// 验证码文本字符大小 默认为40
|
||||
properties.setProperty(KAPTCHA_TEXTPRODUCER_FONT_SIZE, "38");
|
||||
// KAPTCHA_SESSION_KEY
|
||||
properties.setProperty(KAPTCHA_SESSION_CONFIG_KEY, "kaptchaCode");
|
||||
// 验证码文本字符长度 默认为5
|
||||
properties.setProperty(KAPTCHA_TEXTPRODUCER_CHAR_LENGTH, "4");
|
||||
// 验证码文本字体样式 默认为new Font("Arial", 1, fontSize), new Font("Courier", 1, fontSize)
|
||||
properties.setProperty(KAPTCHA_TEXTPRODUCER_FONT_NAMES, "Arial,Courier");
|
||||
// 图片样式 水纹com.google.code.kaptcha.impl.WaterRipple 鱼眼com.google.code.kaptcha.impl.FishEyeGimpy 阴影com.google.code.kaptcha.impl.ShadowGimpy
|
||||
properties.setProperty(KAPTCHA_OBSCURIFICATOR_IMPL, "com.google.code.kaptcha.impl.ShadowGimpy");
|
||||
Config config = new Config(properties);
|
||||
defaultKaptcha.setConfig(config);
|
||||
return defaultKaptcha;
|
||||
}
|
||||
|
||||
@Bean(name = "captchaProducerMath")
|
||||
public DefaultKaptcha getKaptchaBeanMath()
|
||||
{
|
||||
DefaultKaptcha defaultKaptcha = new DefaultKaptcha();
|
||||
Properties properties = new Properties();
|
||||
// 是否有边框 默认为true 我们可以自己设置yes,no
|
||||
properties.setProperty(KAPTCHA_BORDER, "yes");
|
||||
// 边框颜色 默认为Color.BLACK
|
||||
properties.setProperty(KAPTCHA_BORDER_COLOR, "105,179,90");
|
||||
// 验证码文本字符颜色 默认为Color.BLACK
|
||||
properties.setProperty(KAPTCHA_TEXTPRODUCER_FONT_COLOR, "blue");
|
||||
// 验证码图片宽度 默认为200
|
||||
properties.setProperty(KAPTCHA_IMAGE_WIDTH, "160");
|
||||
// 验证码图片高度 默认为50
|
||||
properties.setProperty(KAPTCHA_IMAGE_HEIGHT, "60");
|
||||
// 验证码文本字符大小 默认为40
|
||||
properties.setProperty(KAPTCHA_TEXTPRODUCER_FONT_SIZE, "35");
|
||||
// KAPTCHA_SESSION_KEY
|
||||
properties.setProperty(KAPTCHA_SESSION_CONFIG_KEY, "kaptchaCodeMath");
|
||||
// 验证码文本生成器
|
||||
properties.setProperty(KAPTCHA_TEXTPRODUCER_IMPL, "com.ruoyi.framework.config.KaptchaTextCreator");
|
||||
// 验证码文本字符间距 默认为2
|
||||
properties.setProperty(KAPTCHA_TEXTPRODUCER_CHAR_SPACE, "3");
|
||||
// 验证码文本字符长度 默认为5
|
||||
properties.setProperty(KAPTCHA_TEXTPRODUCER_CHAR_LENGTH, "6");
|
||||
// 验证码文本字体样式 默认为new Font("Arial", 1, fontSize), new Font("Courier", 1, fontSize)
|
||||
properties.setProperty(KAPTCHA_TEXTPRODUCER_FONT_NAMES, "Arial,Courier");
|
||||
// 验证码噪点颜色 默认为Color.BLACK
|
||||
properties.setProperty(KAPTCHA_NOISE_COLOR, "white");
|
||||
// 干扰实现类
|
||||
properties.setProperty(KAPTCHA_NOISE_IMPL, "com.google.code.kaptcha.impl.NoNoise");
|
||||
// 图片样式 水纹com.google.code.kaptcha.impl.WaterRipple 鱼眼com.google.code.kaptcha.impl.FishEyeGimpy 阴影com.google.code.kaptcha.impl.ShadowGimpy
|
||||
properties.setProperty(KAPTCHA_OBSCURIFICATOR_IMPL, "com.google.code.kaptcha.impl.ShadowGimpy");
|
||||
Config config = new Config(properties);
|
||||
defaultKaptcha.setConfig(config);
|
||||
return defaultKaptcha;
|
||||
}
|
||||
}
|
@ -0,0 +1,75 @@
|
||||
package com.ruoyi.framework.config;
|
||||
|
||||
import java.util.Random;
|
||||
import com.google.code.kaptcha.text.impl.DefaultTextCreator;
|
||||
|
||||
/**
|
||||
* 验证码文本生成器
|
||||
*
|
||||
* @author ruoyi
|
||||
*/
|
||||
public class KaptchaTextCreator extends DefaultTextCreator
|
||||
{
|
||||
private static final String[] CNUMBERS = "0,1,2,3,4,5,6,7,8,9,10".split(",");
|
||||
|
||||
@Override
|
||||
public String getText()
|
||||
{
|
||||
Integer result = 0;
|
||||
Random random = new Random();
|
||||
int x = random.nextInt(10);
|
||||
int y = random.nextInt(10);
|
||||
StringBuilder suChinese = new StringBuilder();
|
||||
int randomoperands = (int) Math.round(Math.random() * 2);
|
||||
if (randomoperands == 0)
|
||||
{
|
||||
result = x * y;
|
||||
suChinese.append(CNUMBERS[x]);
|
||||
suChinese.append("*");
|
||||
suChinese.append(CNUMBERS[y]);
|
||||
}
|
||||
else if (randomoperands == 1)
|
||||
{
|
||||
if (!(x == 0) && y % x == 0)
|
||||
{
|
||||
result = y / x;
|
||||
suChinese.append(CNUMBERS[y]);
|
||||
suChinese.append("/");
|
||||
suChinese.append(CNUMBERS[x]);
|
||||
}
|
||||
else
|
||||
{
|
||||
result = x + y;
|
||||
suChinese.append(CNUMBERS[x]);
|
||||
suChinese.append("+");
|
||||
suChinese.append(CNUMBERS[y]);
|
||||
}
|
||||
}
|
||||
else if (randomoperands == 2)
|
||||
{
|
||||
if (x >= y)
|
||||
{
|
||||
result = x - y;
|
||||
suChinese.append(CNUMBERS[x]);
|
||||
suChinese.append("-");
|
||||
suChinese.append(CNUMBERS[y]);
|
||||
}
|
||||
else
|
||||
{
|
||||
result = y - x;
|
||||
suChinese.append(CNUMBERS[y]);
|
||||
suChinese.append("-");
|
||||
suChinese.append(CNUMBERS[x]);
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
result = x + y;
|
||||
suChinese.append(CNUMBERS[x]);
|
||||
suChinese.append("+");
|
||||
suChinese.append(CNUMBERS[y]);
|
||||
}
|
||||
suChinese.append("=?@" + result);
|
||||
return suChinese.toString();
|
||||
}
|
||||
}
|
@ -2,6 +2,7 @@ package com.ruoyi.framework.config;
|
||||
|
||||
import java.io.IOException;
|
||||
import java.util.ArrayList;
|
||||
import java.util.Arrays;
|
||||
import java.util.HashSet;
|
||||
import java.util.List;
|
||||
import javax.sql.DataSource;
|
||||
@ -21,6 +22,7 @@ import org.springframework.core.type.classreading.CachingMetadataReaderFactory;
|
||||
import org.springframework.core.type.classreading.MetadataReader;
|
||||
import org.springframework.core.type.classreading.MetadataReaderFactory;
|
||||
import org.springframework.util.ClassUtils;
|
||||
import com.ruoyi.common.utils.StringUtils;
|
||||
|
||||
/**
|
||||
* Mybatis支持*匹配扫描包
|
||||
@ -89,6 +91,28 @@ public class MyBatisConfig
|
||||
return typeAliasesPackage;
|
||||
}
|
||||
|
||||
public Resource[] resolveMapperLocations(String[] mapperLocations)
|
||||
{
|
||||
ResourcePatternResolver resourceResolver = new PathMatchingResourcePatternResolver();
|
||||
List<Resource> resources = new ArrayList<Resource>();
|
||||
if (mapperLocations != null)
|
||||
{
|
||||
for (String mapperLocation : mapperLocations)
|
||||
{
|
||||
try
|
||||
{
|
||||
Resource[] mappers = resourceResolver.getResources(mapperLocation);
|
||||
resources.addAll(Arrays.asList(mappers));
|
||||
}
|
||||
catch (IOException e)
|
||||
{
|
||||
// ignore
|
||||
}
|
||||
}
|
||||
}
|
||||
return resources.toArray(new Resource[resources.size()]);
|
||||
}
|
||||
|
||||
@Bean
|
||||
public SqlSessionFactory sqlSessionFactory(DataSource dataSource) throws Exception
|
||||
{
|
||||
@ -101,7 +125,7 @@ public class MyBatisConfig
|
||||
final SqlSessionFactoryBean sessionFactory = new SqlSessionFactoryBean();
|
||||
sessionFactory.setDataSource(dataSource);
|
||||
sessionFactory.setTypeAliasesPackage(typeAliasesPackage);
|
||||
sessionFactory.setMapperLocations(new PathMatchingResourcePatternResolver().getResources(mapperLocations));
|
||||
sessionFactory.setMapperLocations(resolveMapperLocations(StringUtils.split(mapperLocations, ",")));
|
||||
sessionFactory.setConfigLocation(new DefaultResourceLoader().getResource(configLocation));
|
||||
return sessionFactory.getObject();
|
||||
}
|
||||
|
@ -1,7 +1,11 @@
|
||||
package com.ruoyi.framework.config;
|
||||
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.context.annotation.Bean;
|
||||
import org.springframework.context.annotation.Configuration;
|
||||
import org.springframework.web.cors.CorsConfiguration;
|
||||
import org.springframework.web.cors.UrlBasedCorsConfigurationSource;
|
||||
import org.springframework.web.filter.CorsFilter;
|
||||
import org.springframework.web.servlet.config.annotation.InterceptorRegistry;
|
||||
import org.springframework.web.servlet.config.annotation.ResourceHandlerRegistry;
|
||||
import org.springframework.web.servlet.config.annotation.WebMvcConfigurer;
|
||||
@ -39,4 +43,24 @@ public class ResourcesConfig implements WebMvcConfigurer
|
||||
{
|
||||
registry.addInterceptor(repeatSubmitInterceptor).addPathPatterns("/**");
|
||||
}
|
||||
|
||||
/**
|
||||
* 跨域配置
|
||||
*/
|
||||
@Bean
|
||||
public CorsFilter corsFilter()
|
||||
{
|
||||
UrlBasedCorsConfigurationSource source = new UrlBasedCorsConfigurationSource();
|
||||
CorsConfiguration config = new CorsConfiguration();
|
||||
config.setAllowCredentials(true);
|
||||
// 设置访问源地址
|
||||
config.addAllowedOrigin("*");
|
||||
// 设置访问源请求头
|
||||
config.addAllowedHeader("*");
|
||||
// 设置访问源请求方法
|
||||
config.addAllowedMethod("*");
|
||||
// 对接口配置跨域设置
|
||||
source.registerCorsConfiguration("/**", config);
|
||||
return new CorsFilter(source);
|
||||
}
|
||||
}
|
@ -12,6 +12,8 @@ import org.springframework.security.config.http.SessionCreationPolicy;
|
||||
import org.springframework.security.core.userdetails.UserDetailsService;
|
||||
import org.springframework.security.crypto.bcrypt.BCryptPasswordEncoder;
|
||||
import org.springframework.security.web.authentication.UsernamePasswordAuthenticationFilter;
|
||||
import org.springframework.security.web.authentication.logout.LogoutFilter;
|
||||
import org.springframework.web.filter.CorsFilter;
|
||||
import com.ruoyi.framework.security.filter.JwtAuthenticationTokenFilter;
|
||||
import com.ruoyi.framework.security.handle.AuthenticationEntryPointImpl;
|
||||
import com.ruoyi.framework.security.handle.LogoutSuccessHandlerImpl;
|
||||
@ -47,6 +49,12 @@ public class SecurityConfig extends WebSecurityConfigurerAdapter
|
||||
*/
|
||||
@Autowired
|
||||
private JwtAuthenticationTokenFilter authenticationTokenFilter;
|
||||
|
||||
/**
|
||||
* 跨域过滤器
|
||||
*/
|
||||
@Autowired
|
||||
private CorsFilter corsFilter;
|
||||
|
||||
/**
|
||||
* 解决 无法直接注入 AuthenticationManager
|
||||
@ -80,7 +88,7 @@ public class SecurityConfig extends WebSecurityConfigurerAdapter
|
||||
protected void configure(HttpSecurity httpSecurity) throws Exception
|
||||
{
|
||||
httpSecurity
|
||||
// CRSF禁用,因为不使用session
|
||||
// CSRF禁用,因为不使用session
|
||||
.csrf().disable()
|
||||
// 认证失败处理类
|
||||
.exceptionHandling().authenticationEntryPoint(unauthorizedHandler).and()
|
||||
@ -112,6 +120,9 @@ public class SecurityConfig extends WebSecurityConfigurerAdapter
|
||||
httpSecurity.logout().logoutUrl("/logout").logoutSuccessHandler(logoutSuccessHandler);
|
||||
// 添加JWT filter
|
||||
httpSecurity.addFilterBefore(authenticationTokenFilter, UsernamePasswordAuthenticationFilter.class);
|
||||
// 添加CORS filter
|
||||
httpSecurity.addFilterBefore(corsFilter, JwtAuthenticationTokenFilter.class);
|
||||
httpSecurity.addFilterBefore(corsFilter, LogoutFilter.class);
|
||||
}
|
||||
|
||||
|
||||
|
@ -13,7 +13,7 @@ import com.ruoyi.common.utils.ServletUtils;
|
||||
|
||||
/**
|
||||
* 防止重复提交拦截器
|
||||
*
|
||||
*
|
||||
* @author ruoyi
|
||||
*/
|
||||
@Component
|
||||
@ -46,8 +46,8 @@ public abstract class RepeatSubmitInterceptor extends HandlerInterceptorAdapter
|
||||
|
||||
/**
|
||||
* 验证是否重复提交由子类实现具体的防重复提交的规则
|
||||
*
|
||||
* @param httpServletRequest
|
||||
*
|
||||
* @param request
|
||||
* @return
|
||||
* @throws Exception
|
||||
*/
|
||||
|
@ -5,8 +5,10 @@ import java.util.Map;
|
||||
import java.util.concurrent.TimeUnit;
|
||||
import javax.servlet.http.HttpServletRequest;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.beans.factory.annotation.Value;
|
||||
import org.springframework.stereotype.Component;
|
||||
import com.alibaba.fastjson.JSONObject;
|
||||
import com.ruoyi.common.constant.Constants;
|
||||
import com.ruoyi.common.core.redis.RedisCache;
|
||||
import com.ruoyi.common.filter.RepeatedlyRequestWrapper;
|
||||
import com.ruoyi.common.utils.StringUtils;
|
||||
@ -26,7 +28,9 @@ public class SameUrlDataInterceptor extends RepeatSubmitInterceptor
|
||||
|
||||
public final String REPEAT_TIME = "repeatTime";
|
||||
|
||||
public final String CACHE_REPEAT_KEY = "repeatData";
|
||||
// 令牌自定义标识
|
||||
@Value("${token.header}")
|
||||
private String header;
|
||||
|
||||
@Autowired
|
||||
private RedisCache redisCache;
|
||||
@ -47,8 +51,12 @@ public class SameUrlDataInterceptor extends RepeatSubmitInterceptor
|
||||
@Override
|
||||
public boolean isRepeatSubmit(HttpServletRequest request)
|
||||
{
|
||||
RepeatedlyRequestWrapper repeatedlyRequest = (RepeatedlyRequestWrapper) request;
|
||||
String nowParams = HttpHelper.getBodyString(repeatedlyRequest);
|
||||
String nowParams = "";
|
||||
if (request instanceof RepeatedlyRequestWrapper)
|
||||
{
|
||||
RepeatedlyRequestWrapper repeatedlyRequest = (RepeatedlyRequestWrapper) request;
|
||||
nowParams = HttpHelper.getBodyString(repeatedlyRequest);
|
||||
}
|
||||
|
||||
// body参数为空,获取Parameter的数据
|
||||
if (StringUtils.isEmpty(nowParams))
|
||||
@ -62,7 +70,17 @@ public class SameUrlDataInterceptor extends RepeatSubmitInterceptor
|
||||
// 请求地址(作为存放cache的key值)
|
||||
String url = request.getRequestURI();
|
||||
|
||||
Object sessionObj = redisCache.getCacheObject(CACHE_REPEAT_KEY);
|
||||
// 唯一值(没有消息头则使用请求地址)
|
||||
String submitKey = request.getHeader(header);
|
||||
if (StringUtils.isEmpty(submitKey))
|
||||
{
|
||||
submitKey = url;
|
||||
}
|
||||
|
||||
// 唯一标识(指定key + 消息头)
|
||||
String cache_repeat_key = Constants.REPEAT_SUBMIT_KEY + submitKey;
|
||||
|
||||
Object sessionObj = redisCache.getCacheObject(cache_repeat_key);
|
||||
if (sessionObj != null)
|
||||
{
|
||||
Map<String, Object> sessionMap = (Map<String, Object>) sessionObj;
|
||||
@ -77,7 +95,7 @@ public class SameUrlDataInterceptor extends RepeatSubmitInterceptor
|
||||
}
|
||||
Map<String, Object> cacheMap = new HashMap<String, Object>();
|
||||
cacheMap.put(url, nowDataMap);
|
||||
redisCache.setCacheObject(CACHE_REPEAT_KEY, cacheMap, intervalTime, TimeUnit.SECONDS);
|
||||
redisCache.setCacheObject(cache_repeat_key, cacheMap, intervalTime, TimeUnit.SECONDS);
|
||||
return false;
|
||||
}
|
||||
|
||||
|
@ -25,7 +25,7 @@ public class AsyncFactory
|
||||
private static final Logger sys_user_logger = LoggerFactory.getLogger("sys-user");
|
||||
|
||||
/**
|
||||
* 记录登陆信息
|
||||
* 记录登录信息
|
||||
*
|
||||
* @param username 用户名
|
||||
* @param status 状态
|
||||
|
@ -189,7 +189,7 @@ public class Server
|
||||
private void setSysFiles(OperatingSystem os)
|
||||
{
|
||||
FileSystem fileSystem = os.getFileSystem();
|
||||
OSFileStore[] fsArray = fileSystem.getFileStores();
|
||||
List<OSFileStore> fsArray = fileSystem.getFileStores();
|
||||
for (OSFileStore fs : fsArray)
|
||||
{
|
||||
long free = fs.getUsableSpace();
|
||||
|
@ -109,7 +109,7 @@ public class PermissionService
|
||||
for (SysRole sysRole : loginUser.getUser().getRoles())
|
||||
{
|
||||
String roleKey = sysRole.getRoleKey();
|
||||
if (SUPER_ADMIN.contains(roleKey) || roleKey.contains(StringUtils.trim(role)))
|
||||
if (SUPER_ADMIN.equals(roleKey) || roleKey.equals(StringUtils.trim(role)))
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
@ -22,7 +22,7 @@ import io.jsonwebtoken.SignatureAlgorithm;
|
||||
|
||||
/**
|
||||
* token验证处理
|
||||
*
|
||||
*
|
||||
* @author ruoyi
|
||||
*/
|
||||
@Component
|
||||
@ -51,7 +51,7 @@ public class TokenService
|
||||
|
||||
/**
|
||||
* 获取用户身份信息
|
||||
*
|
||||
*
|
||||
* @return 用户信息
|
||||
*/
|
||||
public LoginUser getLoginUser(HttpServletRequest request)
|
||||
@ -95,7 +95,7 @@ public class TokenService
|
||||
|
||||
/**
|
||||
* 创建令牌
|
||||
*
|
||||
*
|
||||
* @param loginUser 用户信息
|
||||
* @return 令牌
|
||||
*/
|
||||
@ -113,8 +113,8 @@ public class TokenService
|
||||
|
||||
/**
|
||||
* 验证令牌有效期,相差不足20分钟,自动刷新缓存
|
||||
*
|
||||
* @param token 令牌
|
||||
*
|
||||
* @param loginUser
|
||||
* @return 令牌
|
||||
*/
|
||||
public void verifyToken(LoginUser loginUser)
|
||||
@ -129,7 +129,7 @@ public class TokenService
|
||||
|
||||
/**
|
||||
* 刷新令牌有效期
|
||||
*
|
||||
*
|
||||
* @param loginUser 登录信息
|
||||
*/
|
||||
public void refreshToken(LoginUser loginUser)
|
||||
@ -140,10 +140,10 @@ public class TokenService
|
||||
String userKey = getTokenKey(loginUser.getToken());
|
||||
redisCache.setCacheObject(userKey, loginUser, expireTime, TimeUnit.MINUTES);
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 设置用户代理信息
|
||||
*
|
||||
*
|
||||
* @param loginUser 登录信息
|
||||
*/
|
||||
public void setUserAgent(LoginUser loginUser)
|
||||
@ -155,7 +155,7 @@ public class TokenService
|
||||
loginUser.setBrowser(userAgent.getBrowser().getName());
|
||||
loginUser.setOs(userAgent.getOperatingSystem().getName());
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 从数据声明生成令牌
|
||||
*
|
||||
|
@ -5,7 +5,7 @@
|
||||
<parent>
|
||||
<artifactId>ruoyi</artifactId>
|
||||
<groupId>com.ruoyi</groupId>
|
||||
<version>3.0.0</version>
|
||||
<version>3.2.1</version>
|
||||
</parent>
|
||||
<modelVersion>4.0.0</modelVersion>
|
||||
|
||||
|
@ -148,15 +148,39 @@ public class GenController extends BaseController
|
||||
}
|
||||
|
||||
/**
|
||||
* 生成代码
|
||||
* 生成代码(下载方式)
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('tool:gen:code')")
|
||||
@Log(title = "代码生成", businessType = BusinessType.GENCODE)
|
||||
@GetMapping("/download/{tableName}")
|
||||
public void download(HttpServletResponse response, @PathVariable("tableName") String tableName) throws IOException
|
||||
{
|
||||
byte[] data = genTableService.downloadCode(tableName);
|
||||
genCode(response, data);
|
||||
}
|
||||
|
||||
/**
|
||||
* 生成代码(自定义路径)
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('tool:gen:code')")
|
||||
@Log(title = "代码生成", businessType = BusinessType.GENCODE)
|
||||
@GetMapping("/genCode/{tableName}")
|
||||
public void genCode(HttpServletResponse response, @PathVariable("tableName") String tableName) throws IOException
|
||||
public AjaxResult genCode(@PathVariable("tableName") String tableName)
|
||||
{
|
||||
byte[] data = genTableService.generatorCode(tableName);
|
||||
genCode(response, data);
|
||||
genTableService.generatorCode(tableName);
|
||||
return AjaxResult.success();
|
||||
}
|
||||
|
||||
/**
|
||||
* 同步数据库
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('tool:gen:edit')")
|
||||
@Log(title = "代码生成", businessType = BusinessType.UPDATE)
|
||||
@GetMapping("/synchDb/{tableName}")
|
||||
public AjaxResult synchDb(@PathVariable("tableName") String tableName)
|
||||
{
|
||||
genTableService.synchDb(tableName);
|
||||
return AjaxResult.success();
|
||||
}
|
||||
|
||||
/**
|
||||
@ -168,7 +192,7 @@ public class GenController extends BaseController
|
||||
public void batchGenCode(HttpServletResponse response, String tables) throws IOException
|
||||
{
|
||||
String[] tableNames = Convert.toStrArray(tables);
|
||||
byte[] data = genTableService.generatorCode(tableNames);
|
||||
byte[] data = genTableService.downloadCode(tableNames);
|
||||
genCode(response, data);
|
||||
}
|
||||
|
||||
@ -178,9 +202,11 @@ public class GenController extends BaseController
|
||||
private void genCode(HttpServletResponse response, byte[] data) throws IOException
|
||||
{
|
||||
response.reset();
|
||||
response.addHeader("Access-Control-Allow-Origin", "*");
|
||||
response.addHeader("Access-Control-Expose-Headers", "Content-Disposition");
|
||||
response.setHeader("Content-Disposition", "attachment; filename=\"ruoyi.zip\"");
|
||||
response.addHeader("Content-Length", "" + data.length);
|
||||
response.setContentType("application/octet-stream; charset=UTF-8");
|
||||
IOUtils.write(data, response.getOutputStream());
|
||||
}
|
||||
}
|
||||
}
|
@ -55,6 +55,12 @@ public class GenTable extends BaseEntity
|
||||
@NotBlank(message = "作者不能为空")
|
||||
private String functionAuthor;
|
||||
|
||||
/** 生成代码方式(0zip压缩包 1自定义路径) */
|
||||
private String genType;
|
||||
|
||||
/** 生成路径(不填默认项目路径) */
|
||||
private String genPath;
|
||||
|
||||
/** 主键信息 */
|
||||
private GenTableColumn pkColumn;
|
||||
|
||||
@ -74,6 +80,12 @@ public class GenTable extends BaseEntity
|
||||
/** 树名称字段 */
|
||||
private String treeName;
|
||||
|
||||
/** 上级菜单ID字段 */
|
||||
private String parentMenuId;
|
||||
|
||||
/** 上级菜单名称字段 */
|
||||
private String parentMenuName;
|
||||
|
||||
public Long getTableId()
|
||||
{
|
||||
return tableId;
|
||||
@ -174,6 +186,26 @@ public class GenTable extends BaseEntity
|
||||
this.functionAuthor = functionAuthor;
|
||||
}
|
||||
|
||||
public String getGenType()
|
||||
{
|
||||
return genType;
|
||||
}
|
||||
|
||||
public void setGenType(String genType)
|
||||
{
|
||||
this.genType = genType;
|
||||
}
|
||||
|
||||
public String getGenPath()
|
||||
{
|
||||
return genPath;
|
||||
}
|
||||
|
||||
public void setGenPath(String genPath)
|
||||
{
|
||||
this.genPath = genPath;
|
||||
}
|
||||
|
||||
public GenTableColumn getPkColumn()
|
||||
{
|
||||
return pkColumn;
|
||||
@ -234,6 +266,26 @@ public class GenTable extends BaseEntity
|
||||
this.treeName = treeName;
|
||||
}
|
||||
|
||||
public String getParentMenuId()
|
||||
{
|
||||
return parentMenuId;
|
||||
}
|
||||
|
||||
public void setParentMenuId(String parentMenuId)
|
||||
{
|
||||
this.parentMenuId = parentMenuId;
|
||||
}
|
||||
|
||||
public String getParentMenuName()
|
||||
{
|
||||
return parentMenuName;
|
||||
}
|
||||
|
||||
public void setParentMenuName(String parentMenuName)
|
||||
{
|
||||
this.parentMenuName = parentMenuName;
|
||||
}
|
||||
|
||||
public boolean isTree()
|
||||
{
|
||||
return isTree(this.tplCategory);
|
||||
@ -268,4 +320,4 @@ public class GenTable extends BaseEntity
|
||||
}
|
||||
return StringUtils.equalsAnyIgnoreCase(javaField, GenConstants.BASE_ENTITY);
|
||||
}
|
||||
}
|
||||
}
|
@ -59,7 +59,7 @@ public class GenTableColumn extends BaseEntity
|
||||
/** 查询方式(EQ等于、NE不等于、GT大于、LT小于、LIKE模糊、BETWEEN范围) */
|
||||
private String queryType;
|
||||
|
||||
/** 显示类型(input文本框、textarea文本域、select下拉框、checkbox复选框、radio单选框、datetime日期控件) */
|
||||
/** 显示类型(input文本框、textarea文本域、select下拉框、checkbox复选框、radio单选框、datetime日期控件、upload上传控件、editor富文本控件) */
|
||||
private String htmlType;
|
||||
|
||||
/** 字典类型 */
|
||||
@ -340,7 +340,7 @@ public class GenTableColumn extends BaseEntity
|
||||
public static boolean isUsableColumn(String javaField)
|
||||
{
|
||||
// isSuperColumn()中的名单用于避免生成多余Domain属性,若某些属性在生成页面时需要用到不能忽略,则放在此处白名单
|
||||
return StringUtils.equalsAnyIgnoreCase(javaField, "parentId", "orderNum");
|
||||
return StringUtils.equalsAnyIgnoreCase(javaField, "parentId", "orderNum", "remark");
|
||||
}
|
||||
|
||||
public String readConverterExp()
|
||||
|
@ -17,7 +17,7 @@ public interface GenTableColumnMapper
|
||||
* @return 列信息
|
||||
*/
|
||||
public List<GenTableColumn> selectDbTableColumnsByName(String tableName);
|
||||
|
||||
|
||||
/**
|
||||
* 查询业务字段列表
|
||||
*
|
||||
@ -42,6 +42,14 @@ public interface GenTableColumnMapper
|
||||
*/
|
||||
public int updateGenTableColumn(GenTableColumn genTableColumn);
|
||||
|
||||
/**
|
||||
* 删除业务字段
|
||||
*
|
||||
* @param genTableColumns 列数据
|
||||
* @return 结果
|
||||
*/
|
||||
public int deleteGenTableColumns(List<GenTableColumn> genTableColumns);
|
||||
|
||||
/**
|
||||
* 批量删除业务字段
|
||||
*
|
||||
|
@ -1,11 +1,13 @@
|
||||
package com.ruoyi.generator.service;
|
||||
|
||||
import java.io.ByteArrayOutputStream;
|
||||
import java.io.File;
|
||||
import java.io.IOException;
|
||||
import java.io.StringWriter;
|
||||
import java.util.LinkedHashMap;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.stream.Collectors;
|
||||
import java.util.zip.ZipEntry;
|
||||
import java.util.zip.ZipOutputStream;
|
||||
import org.apache.commons.io.IOUtils;
|
||||
@ -21,9 +23,11 @@ import com.alibaba.fastjson.JSON;
|
||||
import com.alibaba.fastjson.JSONObject;
|
||||
import com.ruoyi.common.constant.Constants;
|
||||
import com.ruoyi.common.constant.GenConstants;
|
||||
import com.ruoyi.common.core.text.CharsetKit;
|
||||
import com.ruoyi.common.exception.CustomException;
|
||||
import com.ruoyi.common.utils.SecurityUtils;
|
||||
import com.ruoyi.common.utils.StringUtils;
|
||||
import com.ruoyi.common.utils.file.FileUtils;
|
||||
import com.ruoyi.generator.domain.GenTable;
|
||||
import com.ruoyi.generator.domain.GenTableColumn;
|
||||
import com.ruoyi.generator.mapper.GenTableColumnMapper;
|
||||
@ -202,13 +206,13 @@ public class GenTableServiceImpl implements IGenTableService
|
||||
}
|
||||
|
||||
/**
|
||||
* 生成代码
|
||||
* 生成代码(下载方式)
|
||||
*
|
||||
* @param tableName 表名称
|
||||
* @return 数据
|
||||
*/
|
||||
@Override
|
||||
public byte[] generatorCode(String tableName)
|
||||
public byte[] downloadCode(String tableName)
|
||||
{
|
||||
ByteArrayOutputStream outputStream = new ByteArrayOutputStream();
|
||||
ZipOutputStream zip = new ZipOutputStream(outputStream);
|
||||
@ -218,13 +222,85 @@ public class GenTableServiceImpl implements IGenTableService
|
||||
}
|
||||
|
||||
/**
|
||||
* 批量生成代码
|
||||
* 生成代码(自定义路径)
|
||||
*
|
||||
* @param tableName 表名称
|
||||
*/
|
||||
@Override
|
||||
public void generatorCode(String tableName)
|
||||
{
|
||||
// 查询表信息
|
||||
GenTable table = genTableMapper.selectGenTableByName(tableName);
|
||||
// 查询列信息
|
||||
List<GenTableColumn> columns = table.getColumns();
|
||||
setPkColumn(table, columns);
|
||||
|
||||
VelocityInitializer.initVelocity();
|
||||
|
||||
VelocityContext context = VelocityUtils.prepareContext(table);
|
||||
|
||||
// 获取模板列表
|
||||
List<String> templates = VelocityUtils.getTemplateList(table.getTplCategory());
|
||||
for (String template : templates)
|
||||
{
|
||||
if (!StringUtils.containsAny(template, "sql.vm", "api.js.vm", "index.vue.vm", "index-tree.vue.vm"))
|
||||
{
|
||||
// 渲染模板
|
||||
StringWriter sw = new StringWriter();
|
||||
Template tpl = Velocity.getTemplate(template, Constants.UTF8);
|
||||
tpl.merge(context, sw);
|
||||
try
|
||||
{
|
||||
String path = getGenPath(table, template);
|
||||
FileUtils.writeStringToFile(new File(path), sw.toString(), CharsetKit.UTF_8);
|
||||
}
|
||||
catch (IOException e)
|
||||
{
|
||||
throw new CustomException("渲染模板失败,表名:" + table.getTableName());
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 同步数据库
|
||||
*
|
||||
* @param tableName 表名称
|
||||
*/
|
||||
@Override
|
||||
@Transactional
|
||||
public void synchDb(String tableName)
|
||||
{
|
||||
GenTable table = genTableMapper.selectGenTableByName(tableName);
|
||||
List<GenTableColumn> tableColumns = table.getColumns();
|
||||
List<String> tableColumnNames = tableColumns.stream().map(GenTableColumn::getColumnName).collect(Collectors.toList());
|
||||
|
||||
List<GenTableColumn> dbTableColumns = genTableColumnMapper.selectDbTableColumnsByName(tableName);
|
||||
List<String> dbTableColumnNames = dbTableColumns.stream().map(GenTableColumn::getColumnName).collect(Collectors.toList());
|
||||
|
||||
dbTableColumns.forEach(column -> {
|
||||
if (!tableColumnNames.contains(column.getColumnName()))
|
||||
{
|
||||
GenUtils.initColumnField(column, table);
|
||||
genTableColumnMapper.insertGenTableColumn(column);
|
||||
}
|
||||
});
|
||||
|
||||
List<GenTableColumn> delColumns = tableColumns.stream().filter(column -> !dbTableColumnNames.contains(column.getColumnName())).collect(Collectors.toList());
|
||||
if (StringUtils.isNotEmpty(delColumns))
|
||||
{
|
||||
genTableColumnMapper.deleteGenTableColumns(delColumns);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 批量生成代码(下载方式)
|
||||
*
|
||||
* @param tableNames 表数组
|
||||
* @return 数据
|
||||
*/
|
||||
@Override
|
||||
public byte[] generatorCode(String[] tableNames)
|
||||
public byte[] downloadCode(String[] tableNames)
|
||||
{
|
||||
ByteArrayOutputStream outputStream = new ByteArrayOutputStream();
|
||||
ZipOutputStream zip = new ZipOutputStream(outputStream);
|
||||
@ -337,9 +413,31 @@ public class GenTableServiceImpl implements IGenTableService
|
||||
String treeCode = paramsObj.getString(GenConstants.TREE_CODE);
|
||||
String treeParentCode = paramsObj.getString(GenConstants.TREE_PARENT_CODE);
|
||||
String treeName = paramsObj.getString(GenConstants.TREE_NAME);
|
||||
String parentMenuId = paramsObj.getString(GenConstants.PARENT_MENU_ID);
|
||||
String parentMenuName = paramsObj.getString(GenConstants.PARENT_MENU_NAME);
|
||||
|
||||
genTable.setTreeCode(treeCode);
|
||||
genTable.setTreeParentCode(treeParentCode);
|
||||
genTable.setTreeName(treeName);
|
||||
genTable.setParentMenuId(parentMenuId);
|
||||
genTable.setParentMenuName(parentMenuName);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取代码生成地址
|
||||
*
|
||||
* @param table 业务表信息
|
||||
* @param template 模板文件路径
|
||||
* @return 生成地址
|
||||
*/
|
||||
public static String getGenPath(GenTable table, String template)
|
||||
{
|
||||
String genPath = table.getGenPath();
|
||||
if (StringUtils.equals(genPath, "/"))
|
||||
{
|
||||
return System.getProperty("user.dir") + File.separator + "src" + File.separator + VelocityUtils.getFileName(template, table);
|
||||
}
|
||||
return genPath + File.separator + VelocityUtils.getFileName(template, table);
|
||||
}
|
||||
}
|
@ -75,20 +75,35 @@ public interface IGenTableService
|
||||
public Map<String, String> previewCode(Long tableId);
|
||||
|
||||
/**
|
||||
* 生成代码
|
||||
* 生成代码(下载方式)
|
||||
*
|
||||
* @param tableName 表名称
|
||||
* @return 数据
|
||||
*/
|
||||
public byte[] generatorCode(String tableName);
|
||||
public byte[] downloadCode(String tableName);
|
||||
|
||||
/**
|
||||
* 批量生成代码
|
||||
* 生成代码(自定义路径)
|
||||
*
|
||||
* @param tableName 表名称
|
||||
* @return 数据
|
||||
*/
|
||||
public void generatorCode(String tableName);
|
||||
|
||||
/**
|
||||
* 同步数据库
|
||||
*
|
||||
* @param tableName 表名称
|
||||
*/
|
||||
public void synchDb(String tableName);
|
||||
|
||||
/**
|
||||
* 批量生成代码(下载方式)
|
||||
*
|
||||
* @param tableNames 表数组
|
||||
* @return 数据
|
||||
*/
|
||||
public byte[] generatorCode(String[] tableNames);
|
||||
public byte[] downloadCode(String[] tableNames);
|
||||
|
||||
/**
|
||||
* 修改保存参数校验
|
||||
|
@ -111,6 +111,16 @@ public class GenUtils
|
||||
{
|
||||
column.setHtmlType(GenConstants.HTML_SELECT);
|
||||
}
|
||||
// 文件字段设置上传控件
|
||||
else if (StringUtils.endsWithIgnoreCase(columnName, "image"))
|
||||
{
|
||||
column.setHtmlType(GenConstants.HTML_UPLOAD_IMAGE);
|
||||
}
|
||||
// 内容字段设置富文本控件
|
||||
else if (StringUtils.endsWithIgnoreCase(columnName, "content"))
|
||||
{
|
||||
column.setHtmlType(GenConstants.HTML_EDITOR);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
@ -195,7 +205,7 @@ public class GenUtils
|
||||
/**
|
||||
* 关键字替换
|
||||
*
|
||||
* @param name 需要被替换的名字
|
||||
* @param text 需要被替换的名字
|
||||
* @return 替换后的名字
|
||||
*/
|
||||
public static String replaceText(String text)
|
||||
|
@ -12,7 +12,7 @@ import com.ruoyi.generator.domain.GenTable;
|
||||
import com.ruoyi.generator.domain.GenTableColumn;
|
||||
|
||||
/**
|
||||
* 代码生成模板处理
|
||||
* 模板处理工具类
|
||||
*
|
||||
* @author ruoyi
|
||||
*/
|
||||
@ -24,9 +24,12 @@ public class VelocityUtils
|
||||
/** mybatis空间路径 */
|
||||
private static final String MYBATIS_PATH = "main/resources/mapper";
|
||||
|
||||
/** 默认上级菜单,系统工具 */
|
||||
private static final String DEFAULT_PARENT_MENU_ID = "3";
|
||||
|
||||
/**
|
||||
* 设置模板变量信息
|
||||
*
|
||||
*
|
||||
* @return 模板列表
|
||||
*/
|
||||
public static VelocityContext prepareContext(GenTable genTable)
|
||||
@ -55,6 +58,7 @@ public class VelocityUtils
|
||||
velocityContext.put("permissionPrefix", getPermissionPrefix(moduleName, businessName));
|
||||
velocityContext.put("columns", genTable.getColumns());
|
||||
velocityContext.put("table", genTable);
|
||||
setMenuVelocityContext(velocityContext, genTable);
|
||||
if (GenConstants.TPL_TREE.equals(tplCategory))
|
||||
{
|
||||
setTreeVelocityContext(velocityContext, genTable);
|
||||
@ -62,6 +66,14 @@ public class VelocityUtils
|
||||
return velocityContext;
|
||||
}
|
||||
|
||||
public static void setMenuVelocityContext(VelocityContext context, GenTable genTable)
|
||||
{
|
||||
String options = genTable.getOptions();
|
||||
JSONObject paramsObj = JSONObject.parseObject(options);
|
||||
String parentMenuId = getParentMenuId(paramsObj);
|
||||
context.put("parentMenuId", parentMenuId);
|
||||
}
|
||||
|
||||
public static void setTreeVelocityContext(VelocityContext context, GenTable genTable)
|
||||
{
|
||||
String options = genTable.getOptions();
|
||||
@ -86,7 +98,7 @@ public class VelocityUtils
|
||||
|
||||
/**
|
||||
* 获取模板信息
|
||||
*
|
||||
*
|
||||
* @return 模板列表
|
||||
*/
|
||||
public static List<String> getTemplateList(String tplCategory)
|
||||
@ -176,7 +188,7 @@ public class VelocityUtils
|
||||
|
||||
/**
|
||||
* 获取包前缀
|
||||
*
|
||||
*
|
||||
* @param packageName 包名称
|
||||
* @return 包前缀名称
|
||||
*/
|
||||
@ -189,8 +201,8 @@ public class VelocityUtils
|
||||
|
||||
/**
|
||||
* 根据列类型获取导入包
|
||||
*
|
||||
* @param column 列集合
|
||||
*
|
||||
* @param columns 列集合
|
||||
* @return 返回需要导入的包列表
|
||||
*/
|
||||
public static HashSet<String> getImportList(List<GenTableColumn> columns)
|
||||
@ -213,7 +225,7 @@ public class VelocityUtils
|
||||
|
||||
/**
|
||||
* 获取权限前缀
|
||||
*
|
||||
*
|
||||
* @param moduleName 模块名称
|
||||
* @param businessName 业务名称
|
||||
* @return 返回权限前缀
|
||||
@ -221,13 +233,27 @@ public class VelocityUtils
|
||||
public static String getPermissionPrefix(String moduleName, String businessName)
|
||||
{
|
||||
return StringUtils.format("{}:{}", moduleName, businessName);
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取上级菜单ID字段
|
||||
*
|
||||
* @param paramsObj 生成其他选项
|
||||
* @return 上级菜单ID字段
|
||||
*/
|
||||
public static String getParentMenuId(JSONObject paramsObj)
|
||||
{
|
||||
if (StringUtils.isNotEmpty(paramsObj) && paramsObj.containsKey(GenConstants.PARENT_MENU_ID))
|
||||
{
|
||||
return paramsObj.getString(GenConstants.PARENT_MENU_ID);
|
||||
}
|
||||
return DEFAULT_PARENT_MENU_ID;
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取树编码
|
||||
*
|
||||
* @param options 生成其他选项
|
||||
*
|
||||
* @param paramsObj 生成其他选项
|
||||
* @return 树编码
|
||||
*/
|
||||
public static String getTreecode(JSONObject paramsObj)
|
||||
@ -236,13 +262,13 @@ public class VelocityUtils
|
||||
{
|
||||
return StringUtils.toCamelCase(paramsObj.getString(GenConstants.TREE_CODE));
|
||||
}
|
||||
return "";
|
||||
return StringUtils.EMPTY;
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取树父编码
|
||||
*
|
||||
* @param options 生成其他选项
|
||||
*
|
||||
* @param paramsObj 生成其他选项
|
||||
* @return 树父编码
|
||||
*/
|
||||
public static String getTreeParentCode(JSONObject paramsObj)
|
||||
@ -251,13 +277,13 @@ public class VelocityUtils
|
||||
{
|
||||
return StringUtils.toCamelCase(paramsObj.getString(GenConstants.TREE_PARENT_CODE));
|
||||
}
|
||||
return "";
|
||||
return StringUtils.EMPTY;
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取树名称
|
||||
*
|
||||
* @param options 生成其他选项
|
||||
*
|
||||
* @param paramsObj 生成其他选项
|
||||
* @return 树名称
|
||||
*/
|
||||
public static String getTreeName(JSONObject paramsObj)
|
||||
@ -266,12 +292,12 @@ public class VelocityUtils
|
||||
{
|
||||
return StringUtils.toCamelCase(paramsObj.getString(GenConstants.TREE_NAME));
|
||||
}
|
||||
return "";
|
||||
return StringUtils.EMPTY;
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取需要在哪一列上面显示展开按钮
|
||||
*
|
||||
*
|
||||
* @param genTable 业务表对象
|
||||
* @return 展开按钮列序号
|
||||
*/
|
||||
|
@ -117,4 +117,11 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||
</foreach>
|
||||
</delete>
|
||||
|
||||
<delete id="deleteGenTableColumns">
|
||||
delete from gen_table_column where column_id in
|
||||
<foreach collection="list" item="item" open="(" separator="," close=")">
|
||||
#{item.columnId}
|
||||
</foreach>
|
||||
</delete>
|
||||
|
||||
</mapper>
|
@ -15,6 +15,8 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||
<result property="businessName" column="business_name" />
|
||||
<result property="functionName" column="function_name" />
|
||||
<result property="functionAuthor" column="function_author" />
|
||||
<result property="genType" column="gen_type" />
|
||||
<result property="genPath" column="gen_path" />
|
||||
<result property="options" column="options" />
|
||||
<result property="createBy" column="create_by" />
|
||||
<result property="createTime" column="create_time" />
|
||||
@ -50,7 +52,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||
</resultMap>
|
||||
|
||||
<sql id="selectGenTableVo">
|
||||
select table_id, table_name, table_comment, class_name, tpl_category, package_name, module_name, business_name, function_name, function_author, options, create_by, create_time, update_by, update_time, remark from gen_table
|
||||
select table_id, table_name, table_comment, class_name, tpl_category, package_name, module_name, business_name, function_name, function_author, gen_type, gen_path, options, create_by, create_time, update_by, update_time, remark from gen_table
|
||||
</sql>
|
||||
|
||||
<select id="selectGenTableList" parameterType="GenTable" resultMap="GenTableResult">
|
||||
@ -106,7 +108,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||
</select>
|
||||
|
||||
<select id="selectGenTableById" parameterType="Long" resultMap="GenTableResult">
|
||||
SELECT t.table_id, t.table_name, t.table_comment, t.class_name, t.tpl_category, t.package_name, t.module_name, t.business_name, t.function_name, t.function_author, t.options, t.remark,
|
||||
SELECT t.table_id, t.table_name, t.table_comment, t.class_name, t.tpl_category, t.package_name, t.module_name, t.business_name, t.function_name, t.function_author, t.gen_type, t.gen_path, t.options, t.remark,
|
||||
c.column_id, c.column_name, c.column_comment, c.column_type, c.java_type, c.java_field, c.is_pk, c.is_increment, c.is_required, c.is_insert, c.is_edit, c.is_list, c.is_query, c.query_type, c.html_type, c.dict_type, c.sort
|
||||
FROM gen_table t
|
||||
LEFT JOIN gen_table_column c ON t.table_id = c.table_id
|
||||
@ -114,7 +116,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||
</select>
|
||||
|
||||
<select id="selectGenTableByName" parameterType="String" resultMap="GenTableResult">
|
||||
SELECT t.table_id, t.table_name, t.table_comment, t.class_name, t.tpl_category, t.package_name, t.module_name, t.business_name, t.function_name, t.function_author, t.options, t.remark,
|
||||
SELECT t.table_id, t.table_name, t.table_comment, t.class_name, t.tpl_category, t.package_name, t.module_name, t.business_name, t.function_name, t.function_author, t.gen_type, t.gen_path, t.options, t.remark,
|
||||
c.column_id, c.column_name, c.column_comment, c.column_type, c.java_type, c.java_field, c.is_pk, c.is_increment, c.is_required, c.is_insert, c.is_edit, c.is_list, c.is_query, c.query_type, c.html_type, c.dict_type, c.sort
|
||||
FROM gen_table t
|
||||
LEFT JOIN gen_table_column c ON t.table_id = c.table_id
|
||||
@ -132,6 +134,8 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||
<if test="businessName != null and businessName != ''">business_name,</if>
|
||||
<if test="functionName != null and functionName != ''">function_name,</if>
|
||||
<if test="functionAuthor != null and functionAuthor != ''">function_author,</if>
|
||||
<if test="genType != null and genType != ''">gen_type,</if>
|
||||
<if test="genPath != null and genPath != ''">gen_path,</if>
|
||||
<if test="remark != null and remark != ''">remark,</if>
|
||||
<if test="createBy != null and createBy != ''">create_by,</if>
|
||||
create_time
|
||||
@ -145,6 +149,8 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||
<if test="businessName != null and businessName != ''">#{businessName},</if>
|
||||
<if test="functionName != null and functionName != ''">#{functionName},</if>
|
||||
<if test="functionAuthor != null and functionAuthor != ''">#{functionAuthor},</if>
|
||||
<if test="genType != null and genType != ''">#{genType},</if>
|
||||
<if test="genPath != null and genPath != ''">#{genPath},</if>
|
||||
<if test="remark != null and remark != ''">#{remark},</if>
|
||||
<if test="createBy != null and createBy != ''">#{createBy},</if>
|
||||
sysdate()
|
||||
@ -158,6 +164,8 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||
<if test="tableComment != null and tableComment != ''">table_comment = #{tableComment},</if>
|
||||
<if test="className != null and className != ''">class_name = #{className},</if>
|
||||
<if test="functionAuthor != null and functionAuthor != ''">function_author = #{functionAuthor},</if>
|
||||
<if test="genType != null and genType != ''">gen_type = #{genType},</if>
|
||||
<if test="genPath != null and genPath != ''">gen_path = #{genPath},</if>
|
||||
<if test="tplCategory != null and tplCategory != ''">tpl_category = #{tplCategory},</if>
|
||||
<if test="packageName != null and packageName != ''">package_name = #{packageName},</if>
|
||||
<if test="moduleName != null and moduleName != ''">module_name = #{moduleName},</if>
|
||||
@ -178,4 +186,4 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||
</foreach>
|
||||
</delete>
|
||||
|
||||
</mapper>
|
||||
</mapper>
|
@ -1,22 +1,22 @@
|
||||
-- 菜单 SQL
|
||||
insert into sys_menu (menu_name, parent_id, order_num, path, component, is_frame, menu_type, visible, status, perms, icon, create_by, create_time, update_by, update_time, remark)
|
||||
values('${functionName}', '3', '1', '${businessName}', '${moduleName}/${businessName}/index', 1, 'C', '0', '0', '${permissionPrefix}:list', '#', 'admin', '2018-03-01', 'ry', '2018-03-01', '${functionName}菜单');
|
||||
insert into sys_menu (menu_name, parent_id, order_num, path, component, is_frame, is_cache, menu_type, visible, status, perms, icon, create_by, create_time, update_by, update_time, remark)
|
||||
values('${functionName}', '${parentMenuId}', '1', '${businessName}', '${moduleName}/${businessName}/index', 1, 0, 'C', '0', '0', '${permissionPrefix}:list', '#', 'admin', sysdate(), '', null, '${functionName}菜单');
|
||||
|
||||
-- 按钮父菜单ID
|
||||
SELECT @parentId := LAST_INSERT_ID();
|
||||
|
||||
-- 按钮 SQL
|
||||
insert into sys_menu (menu_name, parent_id, order_num, path, component, is_frame, menu_type, visible, status, perms, icon, create_by, create_time, update_by, update_time, remark)
|
||||
values('${functionName}查询', @parentId, '1', '#', '', 1, 'F', '0', '0', '${permissionPrefix}:query', '#', 'admin', '2018-03-01', 'ry', '2018-03-01', '');
|
||||
insert into sys_menu (menu_name, parent_id, order_num, path, component, is_frame, is_cache, menu_type, visible, status, perms, icon, create_by, create_time, update_by, update_time, remark)
|
||||
values('${functionName}查询', @parentId, '1', '#', '', 1, 0, 'F', '0', '0', '${permissionPrefix}:query', '#', 'admin', sysdate(), '', null, '');
|
||||
|
||||
insert into sys_menu (menu_name, parent_id, order_num, path, component, is_frame, menu_type, visible, status, perms, icon, create_by, create_time, update_by, update_time, remark)
|
||||
values('${functionName}新增', @parentId, '2', '#', '', 1, 'F', '0', '0', '${permissionPrefix}:add', '#', 'admin', '2018-03-01', 'ry', '2018-03-01', '');
|
||||
insert into sys_menu (menu_name, parent_id, order_num, path, component, is_frame, is_cache, menu_type, visible, status, perms, icon, create_by, create_time, update_by, update_time, remark)
|
||||
values('${functionName}新增', @parentId, '2', '#', '', 1, 0, 'F', '0', '0', '${permissionPrefix}:add', '#', 'admin', sysdate(), '', null, '');
|
||||
|
||||
insert into sys_menu (menu_name, parent_id, order_num, path, component, is_frame, menu_type, visible, status, perms, icon, create_by, create_time, update_by, update_time, remark)
|
||||
values('${functionName}修改', @parentId, '3', '#', '', 1, 'F', '0', '0', '${permissionPrefix}:edit', '#', 'admin', '2018-03-01', 'ry', '2018-03-01', '');
|
||||
insert into sys_menu (menu_name, parent_id, order_num, path, component, is_frame, is_cache, menu_type, visible, status, perms, icon, create_by, create_time, update_by, update_time, remark)
|
||||
values('${functionName}修改', @parentId, '3', '#', '', 1, 0, 'F', '0', '0', '${permissionPrefix}:edit', '#', 'admin', sysdate(), '', null, '');
|
||||
|
||||
insert into sys_menu (menu_name, parent_id, order_num, path, component, is_frame, menu_type, visible, status, perms, icon, create_by, create_time, update_by, update_time, remark)
|
||||
values('${functionName}删除', @parentId, '4', '#', '', 1, 'F', '0', '0', '${permissionPrefix}:remove', '#', 'admin', '2018-03-01', 'ry', '2018-03-01', '');
|
||||
insert into sys_menu (menu_name, parent_id, order_num, path, component, is_frame, is_cache, menu_type, visible, status, perms, icon, create_by, create_time, update_by, update_time, remark)
|
||||
values('${functionName}删除', @parentId, '4', '#', '', 1, 0, 'F', '0', '0', '${permissionPrefix}:remove', '#', 'admin', sysdate(), '', null, '');
|
||||
|
||||
insert into sys_menu (menu_name, parent_id, order_num, path, component, is_frame, menu_type, visible, status, perms, icon, create_by, create_time, update_by, update_time, remark)
|
||||
values('${functionName}导出', @parentId, '5', '#', '', 1, 'F', '0', '0', '${permissionPrefix}:export', '#', 'admin', '2018-03-01', 'ry', '2018-03-01', '');
|
||||
insert into sys_menu (menu_name, parent_id, order_num, path, component, is_frame, is_cache, menu_type, visible, status, perms, icon, create_by, create_time, update_by, update_time, remark)
|
||||
values('${functionName}导出', @parentId, '5', '#', '', 1, 0, 'F', '0', '0', '${permissionPrefix}:export', '#', 'admin', sysdate(), '', null, '');
|
@ -1,6 +1,6 @@
|
||||
<template>
|
||||
<div class="app-container">
|
||||
<el-form :model="queryParams" ref="queryForm" :inline="true" label-width="68px">
|
||||
<el-form :model="queryParams" ref="queryForm" :inline="true" v-show="showSearch" label-width="68px">
|
||||
#foreach($column in $columns)
|
||||
#if($column.query)
|
||||
#set($dictType=$column.dictType)
|
||||
@ -51,23 +51,23 @@
|
||||
#end
|
||||
#end
|
||||
<el-form-item>
|
||||
<el-button type="cyan" icon="el-icon-search" size="mini" @click="handleQuery">搜索</el-button>
|
||||
<el-button icon="el-icon-refresh" size="mini" @click="resetQuery">重置</el-button>
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
|
||||
<el-row :gutter="10" class="mb8">
|
||||
<el-col :span="1.5">
|
||||
<el-button
|
||||
class="filter-item"
|
||||
type="primary"
|
||||
icon="el-icon-search"
|
||||
size="mini"
|
||||
@click="handleQuery"
|
||||
>搜索</el-button>
|
||||
<el-button
|
||||
class="filter-item"
|
||||
type="primary"
|
||||
icon="el-icon-plus"
|
||||
size="mini"
|
||||
@click="handleAdd"
|
||||
v-hasPermi="['${moduleName}:${businessName}:add']"
|
||||
>新增</el-button>
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
</el-col>
|
||||
<right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar>
|
||||
</el-row>
|
||||
|
||||
<el-table
|
||||
v-loading="loading"
|
||||
@ -139,8 +139,16 @@
|
||||
<el-form-item label="${comment}" prop="${field}">
|
||||
<el-input v-model="form.${field}" placeholder="请输入${comment}" />
|
||||
</el-form-item>
|
||||
#elseif($column.htmlType == "select" && "" != $dictType)
|
||||
#elseif($column.htmlType == "uploadImage")
|
||||
<el-form-item label="${comment}">
|
||||
<uploadImage v-model="form.${field}"/>
|
||||
</el-form-item>
|
||||
#elseif($column.htmlType == "editor")
|
||||
<el-form-item label="${comment}">
|
||||
<editor v-model="form.${field}" :min-height="192"/>
|
||||
</el-form-item>
|
||||
#elseif($column.htmlType == "select" && "" != $dictType)
|
||||
<el-form-item label="${comment}" prop="${field}">
|
||||
<el-select v-model="form.${field}" placeholder="请选择${comment}">
|
||||
<el-option
|
||||
v-for="dict in ${field}Options"
|
||||
@ -152,11 +160,28 @@
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
#elseif($column.htmlType == "select" && $dictType)
|
||||
<el-form-item label="${comment}">
|
||||
<el-form-item label="${comment}" prop="${field}">
|
||||
<el-select v-model="form.${field}" placeholder="请选择${comment}">
|
||||
<el-option label="请选择字典生成" value="" />
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
#elseif($column.htmlType == "checkbox" && "" != $dictType)
|
||||
<el-form-item label="${comment}">
|
||||
<el-checkbox-group v-model="form.${field}">
|
||||
<el-checkbox
|
||||
v-for="dict in ${field}Options"
|
||||
:key="dict.dictValue"
|
||||
:label="dict.dictValue">
|
||||
{{dict.dictLabel}}
|
||||
</el-checkbox>
|
||||
</el-checkbox-group>
|
||||
</el-form-item>
|
||||
#elseif($column.htmlType == "checkbox" && $dictType)
|
||||
<el-form-item label="${comment}">
|
||||
<el-checkbox-group v-model="form.${field}">
|
||||
<el-checkbox>请选择字典生成</el-checkbox>
|
||||
</el-checkbox-group>
|
||||
</el-form-item>
|
||||
#elseif($column.htmlType == "radio" && "" != $dictType)
|
||||
<el-form-item label="${comment}">
|
||||
<el-radio-group v-model="form.${field}">
|
||||
@ -204,14 +229,42 @@
|
||||
import { list${BusinessName}, get${BusinessName}, del${BusinessName}, add${BusinessName}, update${BusinessName}, export${BusinessName} } from "@/api/${moduleName}/${businessName}";
|
||||
import Treeselect from "@riophae/vue-treeselect";
|
||||
import "@riophae/vue-treeselect/dist/vue-treeselect.css";
|
||||
#foreach($column in $columns)
|
||||
#if($column.insert && !$column.superColumn && !$column.pk && $column.htmlType == "uploadImage")
|
||||
import UploadImage from '@/components/UploadImage';
|
||||
#break
|
||||
#end
|
||||
#end
|
||||
#foreach($column in $columns)
|
||||
#if($column.insert && !$column.superColumn && !$column.pk && $column.htmlType == "editor")
|
||||
import Editor from '@/components/Editor';
|
||||
#break
|
||||
#end
|
||||
#end
|
||||
|
||||
export default {
|
||||
name: "${BusinessName}",
|
||||
components: { Treeselect },
|
||||
components: {
|
||||
#foreach($column in $columns)
|
||||
#if($column.insert && !$column.superColumn && !$column.pk && $column.htmlType == "uploadImage")
|
||||
UploadImage,
|
||||
#break
|
||||
#end
|
||||
#end
|
||||
#foreach($column in $columns)
|
||||
#if($column.insert && !$column.superColumn && !$column.pk && $column.htmlType == "editor")
|
||||
Editor,
|
||||
#break
|
||||
#end
|
||||
#end
|
||||
Treeselect
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
// 遮罩层
|
||||
loading: true,
|
||||
// 显示搜索条件
|
||||
showSearch: true,
|
||||
// ${functionName}表格数据
|
||||
${businessName}List: [],
|
||||
// ${functionName}树选项
|
||||
@ -236,7 +289,7 @@ export default {
|
||||
queryParams: {
|
||||
#foreach ($column in $columns)
|
||||
#if($column.query)
|
||||
$column.javaField: undefined#if($velocityCount != $columns.size()),#end
|
||||
$column.javaField: null#if($velocityCount != $columns.size()),#end
|
||||
|
||||
#end
|
||||
#end
|
||||
@ -253,9 +306,8 @@ export default {
|
||||
#else
|
||||
#set($comment=$column.columnComment)
|
||||
#end
|
||||
#set($comment=$column.columnComment)
|
||||
$column.javaField: [
|
||||
{ required: true, message: "$comment不能为空", trigger: "blur" }
|
||||
{ required: true, message: "$comment不能为空", trigger: #if($column.htmlType == "select")"change"#else"blur"#end }
|
||||
]#if($velocityCount != $columns.size()),#end
|
||||
|
||||
#end
|
||||
@ -312,7 +364,7 @@ export default {
|
||||
#end
|
||||
// $comment字典翻译
|
||||
${column.javaField}Format(row, column) {
|
||||
return this.selectDictLabel(this.${column.javaField}Options, row.${column.javaField});
|
||||
return this.selectDictLabel#if($column.htmlType == "checkbox")s#end(this.${column.javaField}Options, row.${column.javaField});
|
||||
},
|
||||
#end
|
||||
#end
|
||||
@ -326,10 +378,13 @@ export default {
|
||||
this.form = {
|
||||
#foreach ($column in $columns)
|
||||
#if($column.htmlType == "radio")
|
||||
$column.javaField: "0"#if($velocityCount != $columns.size()),#end
|
||||
$column.javaField: #if($column.javaType == "Integer" || $column.javaType == "Long")0#else"0"#end#if($velocityCount != $columns.size()),#end
|
||||
|
||||
#elseif($column.htmlType == "checkbox")
|
||||
$column.javaField: []#if($velocityCount != $columns.size()),#end
|
||||
|
||||
#else
|
||||
$column.javaField: undefined#if($velocityCount != $columns.size()),#end
|
||||
$column.javaField: null#if($velocityCount != $columns.size()),#end
|
||||
|
||||
#end
|
||||
#end
|
||||
@ -356,34 +411,40 @@ export default {
|
||||
handleUpdate(row) {
|
||||
this.reset();
|
||||
this.getTreeselect();
|
||||
if (row != undefined) {
|
||||
if (row != null) {
|
||||
this.form.${treeParentCode} = row.${treeCode};
|
||||
}
|
||||
get${BusinessName}(row.${pkColumn.javaField}).then(response => {
|
||||
this.form = response.data;
|
||||
#foreach ($column in $columns)
|
||||
#if($column.htmlType == "checkbox")
|
||||
this.form.$column.javaField = this.form.${column.javaField}.split(",");
|
||||
#end
|
||||
#end
|
||||
this.open = true;
|
||||
this.title = "修改${functionName}";
|
||||
});
|
||||
},
|
||||
/** 提交按钮 */
|
||||
submitForm: function() {
|
||||
submitForm() {
|
||||
this.#[[$]]#refs["form"].validate(valid => {
|
||||
if (valid) {
|
||||
if (this.form.${pkColumn.javaField} != undefined) {
|
||||
#foreach ($column in $columns)
|
||||
#if($column.htmlType == "checkbox")
|
||||
this.form.$column.javaField = this.form.${column.javaField}.join(",");
|
||||
#end
|
||||
#end
|
||||
if (this.form.${pkColumn.javaField} != null) {
|
||||
update${BusinessName}(this.form).then(response => {
|
||||
if (response.code === 200) {
|
||||
this.msgSuccess("修改成功");
|
||||
this.open = false;
|
||||
this.getList();
|
||||
}
|
||||
this.msgSuccess("修改成功");
|
||||
this.open = false;
|
||||
this.getList();
|
||||
});
|
||||
} else {
|
||||
add${BusinessName}(this.form).then(response => {
|
||||
if (response.code === 200) {
|
||||
this.msgSuccess("新增成功");
|
||||
this.open = false;
|
||||
this.getList();
|
||||
}
|
||||
this.msgSuccess("新增成功");
|
||||
this.open = false;
|
||||
this.getList();
|
||||
});
|
||||
}
|
||||
}
|
||||
@ -400,8 +461,8 @@ export default {
|
||||
}).then(() => {
|
||||
this.getList();
|
||||
this.msgSuccess("删除成功");
|
||||
}).catch(function() {});
|
||||
})
|
||||
}
|
||||
}
|
||||
};
|
||||
</script>
|
||||
</script>
|
||||
|
@ -1,6 +1,6 @@
|
||||
<template>
|
||||
<div class="app-container">
|
||||
<el-form :model="queryParams" ref="queryForm" :inline="true" label-width="68px">
|
||||
<el-form :model="queryParams" ref="queryForm" :inline="true" v-show="showSearch" label-width="68px">
|
||||
#foreach($column in $columns)
|
||||
#if($column.query)
|
||||
#set($dictType=$column.dictType)
|
||||
@ -51,7 +51,7 @@
|
||||
#end
|
||||
#end
|
||||
<el-form-item>
|
||||
<el-button type="primary" icon="el-icon-search" size="mini" @click="handleQuery">搜索</el-button>
|
||||
<el-button type="cyan" icon="el-icon-search" size="mini" @click="handleQuery">搜索</el-button>
|
||||
<el-button icon="el-icon-refresh" size="mini" @click="resetQuery">重置</el-button>
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
@ -95,6 +95,7 @@
|
||||
v-hasPermi="['${moduleName}:${businessName}:export']"
|
||||
>导出</el-button>
|
||||
</el-col>
|
||||
<right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar>
|
||||
</el-row>
|
||||
|
||||
<el-table v-loading="loading" :data="${businessName}List" @selection-change="handleSelectionChange">
|
||||
@ -167,8 +168,16 @@
|
||||
<el-form-item label="${comment}" prop="${field}">
|
||||
<el-input v-model="form.${field}" placeholder="请输入${comment}" />
|
||||
</el-form-item>
|
||||
#elseif($column.htmlType == "select" && "" != $dictType)
|
||||
#elseif($column.htmlType == "uploadImage")
|
||||
<el-form-item label="${comment}">
|
||||
<uploadImage v-model="form.${field}"/>
|
||||
</el-form-item>
|
||||
#elseif($column.htmlType == "editor")
|
||||
<el-form-item label="${comment}">
|
||||
<editor v-model="form.${field}" :min-height="192"/>
|
||||
</el-form-item>
|
||||
#elseif($column.htmlType == "select" && "" != $dictType)
|
||||
<el-form-item label="${comment}" prop="${field}">
|
||||
<el-select v-model="form.${field}" placeholder="请选择${comment}">
|
||||
<el-option
|
||||
v-for="dict in ${field}Options"
|
||||
@ -180,11 +189,28 @@
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
#elseif($column.htmlType == "select" && $dictType)
|
||||
<el-form-item label="${comment}">
|
||||
<el-form-item label="${comment}" prop="${field}">
|
||||
<el-select v-model="form.${field}" placeholder="请选择${comment}">
|
||||
<el-option label="请选择字典生成" value="" />
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
#elseif($column.htmlType == "checkbox" && "" != $dictType)
|
||||
<el-form-item label="${comment}">
|
||||
<el-checkbox-group v-model="form.${field}">
|
||||
<el-checkbox
|
||||
v-for="dict in ${field}Options"
|
||||
:key="dict.dictValue"
|
||||
:label="dict.dictValue">
|
||||
{{dict.dictLabel}}
|
||||
</el-checkbox>
|
||||
</el-checkbox-group>
|
||||
</el-form-item>
|
||||
#elseif($column.htmlType == "checkbox" && $dictType)
|
||||
<el-form-item label="${comment}">
|
||||
<el-checkbox-group v-model="form.${field}">
|
||||
<el-checkbox>请选择字典生成</el-checkbox>
|
||||
</el-checkbox-group>
|
||||
</el-form-item>
|
||||
#elseif($column.htmlType == "radio" && "" != $dictType)
|
||||
<el-form-item label="${comment}">
|
||||
<el-radio-group v-model="form.${field}">
|
||||
@ -230,9 +256,35 @@
|
||||
|
||||
<script>
|
||||
import { list${BusinessName}, get${BusinessName}, del${BusinessName}, add${BusinessName}, update${BusinessName}, export${BusinessName} } from "@/api/${moduleName}/${businessName}";
|
||||
#foreach($column in $columns)
|
||||
#if($column.insert && !$column.superColumn && !$column.pk && $column.htmlType == "uploadImage")
|
||||
import UploadImage from '@/components/UploadImage';
|
||||
#break
|
||||
#end
|
||||
#end
|
||||
#foreach($column in $columns)
|
||||
#if($column.insert && !$column.superColumn && !$column.pk && $column.htmlType == "editor")
|
||||
import Editor from '@/components/Editor';
|
||||
#break
|
||||
#end
|
||||
#end
|
||||
|
||||
export default {
|
||||
name: "${BusinessName}",
|
||||
components: {
|
||||
#foreach($column in $columns)
|
||||
#if($column.insert && !$column.superColumn && !$column.pk && $column.htmlType == "uploadImage")
|
||||
UploadImage,
|
||||
#break
|
||||
#end
|
||||
#end
|
||||
#foreach($column in $columns)
|
||||
#if($column.insert && !$column.superColumn && !$column.pk && $column.htmlType == "editor")
|
||||
Editor,
|
||||
#break
|
||||
#end
|
||||
#end
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
// 遮罩层
|
||||
@ -243,6 +295,8 @@ export default {
|
||||
single: true,
|
||||
// 非多个禁用
|
||||
multiple: true,
|
||||
// 显示搜索条件
|
||||
showSearch: true,
|
||||
// 总条数
|
||||
total: 0,
|
||||
// ${functionName}表格数据
|
||||
@ -269,7 +323,7 @@ export default {
|
||||
pageSize: 10,
|
||||
#foreach ($column in $columns)
|
||||
#if($column.query)
|
||||
$column.javaField: undefined#if($velocityCount != $columns.size()),#end
|
||||
$column.javaField: null#if($velocityCount != $columns.size()),#end
|
||||
|
||||
#end
|
||||
#end
|
||||
@ -286,9 +340,8 @@ export default {
|
||||
#else
|
||||
#set($comment=$column.columnComment)
|
||||
#end
|
||||
#set($comment=$column.columnComment)
|
||||
$column.javaField: [
|
||||
{ required: true, message: "$comment不能为空", trigger: "blur" }
|
||||
{ required: true, message: "$comment不能为空", trigger: #if($column.htmlType == "select")"change"#else"blur"#end }
|
||||
]#if($velocityCount != $columns.size()),#end
|
||||
|
||||
#end
|
||||
@ -326,7 +379,7 @@ export default {
|
||||
#end
|
||||
// $comment字典翻译
|
||||
${column.javaField}Format(row, column) {
|
||||
return this.selectDictLabel(this.${column.javaField}Options, row.${column.javaField});
|
||||
return this.selectDictLabel#if($column.htmlType == "checkbox")s#end(this.${column.javaField}Options, row.${column.javaField});
|
||||
},
|
||||
#end
|
||||
#end
|
||||
@ -340,10 +393,13 @@ export default {
|
||||
this.form = {
|
||||
#foreach ($column in $columns)
|
||||
#if($column.htmlType == "radio")
|
||||
$column.javaField: "0"#if($velocityCount != $columns.size()),#end
|
||||
$column.javaField: #if($column.javaType == "Integer" || $column.javaType == "Long")0#else"0"#end#if($velocityCount != $columns.size()),#end
|
||||
|
||||
#elseif($column.htmlType == "checkbox")
|
||||
$column.javaField: []#if($velocityCount != $columns.size()),#end
|
||||
|
||||
#else
|
||||
$column.javaField: undefined#if($velocityCount != $columns.size()),#end
|
||||
$column.javaField: null#if($velocityCount != $columns.size()),#end
|
||||
|
||||
#end
|
||||
#end
|
||||
@ -363,7 +419,7 @@ export default {
|
||||
// 多选框选中数据
|
||||
handleSelectionChange(selection) {
|
||||
this.ids = selection.map(item => item.${pkColumn.javaField})
|
||||
this.single = selection.length!=1
|
||||
this.single = selection.length!==1
|
||||
this.multiple = !selection.length
|
||||
},
|
||||
/** 新增按钮操作 */
|
||||
@ -378,29 +434,35 @@ export default {
|
||||
const ${pkColumn.javaField} = row.${pkColumn.javaField} || this.ids
|
||||
get${BusinessName}(${pkColumn.javaField}).then(response => {
|
||||
this.form = response.data;
|
||||
#foreach ($column in $columns)
|
||||
#if($column.htmlType == "checkbox")
|
||||
this.form.$column.javaField = this.form.${column.javaField}.split(",");
|
||||
#end
|
||||
#end
|
||||
this.open = true;
|
||||
this.title = "修改${functionName}";
|
||||
});
|
||||
},
|
||||
/** 提交按钮 */
|
||||
submitForm: function() {
|
||||
submitForm() {
|
||||
this.#[[$]]#refs["form"].validate(valid => {
|
||||
if (valid) {
|
||||
if (this.form.${pkColumn.javaField} != undefined) {
|
||||
#foreach ($column in $columns)
|
||||
#if($column.htmlType == "checkbox")
|
||||
this.form.$column.javaField = this.form.${column.javaField}.join(",");
|
||||
#end
|
||||
#end
|
||||
if (this.form.${pkColumn.javaField} != null) {
|
||||
update${BusinessName}(this.form).then(response => {
|
||||
if (response.code === 200) {
|
||||
this.msgSuccess("修改成功");
|
||||
this.open = false;
|
||||
this.getList();
|
||||
}
|
||||
this.msgSuccess("修改成功");
|
||||
this.open = false;
|
||||
this.getList();
|
||||
});
|
||||
} else {
|
||||
add${BusinessName}(this.form).then(response => {
|
||||
if (response.code === 200) {
|
||||
this.msgSuccess("新增成功");
|
||||
this.open = false;
|
||||
this.getList();
|
||||
}
|
||||
this.msgSuccess("新增成功");
|
||||
this.open = false;
|
||||
this.getList();
|
||||
});
|
||||
}
|
||||
}
|
||||
@ -418,7 +480,7 @@ export default {
|
||||
}).then(() => {
|
||||
this.getList();
|
||||
this.msgSuccess("删除成功");
|
||||
}).catch(function() {});
|
||||
})
|
||||
},
|
||||
/** 导出按钮操作 */
|
||||
handleExport() {
|
||||
@ -431,8 +493,8 @@ export default {
|
||||
return export${BusinessName}(queryParams);
|
||||
}).then(response => {
|
||||
this.download(response.msg);
|
||||
}).catch(function() {});
|
||||
})
|
||||
}
|
||||
}
|
||||
};
|
||||
</script>
|
||||
</script>
|
||||
|
@ -5,7 +5,7 @@
|
||||
<parent>
|
||||
<artifactId>ruoyi</artifactId>
|
||||
<groupId>com.ruoyi</groupId>
|
||||
<version>3.0.0</version>
|
||||
<version>3.2.1</version>
|
||||
</parent>
|
||||
<modelVersion>4.0.0</modelVersion>
|
||||
|
||||
|
@ -88,7 +88,7 @@ public class SysJob extends BaseEntity implements Serializable
|
||||
}
|
||||
|
||||
@NotBlank(message = "调用目标字符串不能为空")
|
||||
@Size(min = 0, max = 1000, message = "调用目标字符串长度不能超过500个字符")
|
||||
@Size(min = 0, max = 500, message = "调用目标字符串长度不能超过500个字符")
|
||||
public String getInvokeTarget()
|
||||
{
|
||||
return invokeTarget;
|
||||
|
@ -66,7 +66,7 @@ public abstract class AbstractQuartzJob implements Job
|
||||
* 执行后
|
||||
*
|
||||
* @param context 工作执行上下文对象
|
||||
* @param sysScheduleJob 系统计划任务
|
||||
* @param sysJob 系统计划任务
|
||||
*/
|
||||
protected void after(JobExecutionContext context, SysJob sysJob, Exception e)
|
||||
{
|
||||
|
@ -5,7 +5,7 @@
|
||||
<parent>
|
||||
<artifactId>ruoyi</artifactId>
|
||||
<groupId>com.ruoyi</groupId>
|
||||
<version>3.0.0</version>
|
||||
<version>3.2.1</version>
|
||||
</parent>
|
||||
<modelVersion>4.0.0</modelVersion>
|
||||
|
||||
|
@ -13,10 +13,15 @@ public class MetaVo
|
||||
private String title;
|
||||
|
||||
/**
|
||||
* 设置该路由的图标,对应路径src/icons/svg
|
||||
* 设置该路由的图标,对应路径src/assets/icons/svg
|
||||
*/
|
||||
private String icon;
|
||||
|
||||
/**
|
||||
* 设置为true,则不会被 <keep-alive>缓存
|
||||
*/
|
||||
private boolean noCache;
|
||||
|
||||
public MetaVo()
|
||||
{
|
||||
}
|
||||
@ -27,6 +32,23 @@ public class MetaVo
|
||||
this.icon = icon;
|
||||
}
|
||||
|
||||
public MetaVo(String title, String icon, boolean noCache)
|
||||
{
|
||||
this.title = title;
|
||||
this.icon = icon;
|
||||
this.noCache = noCache;
|
||||
}
|
||||
|
||||
public boolean isNoCache()
|
||||
{
|
||||
return noCache;
|
||||
}
|
||||
|
||||
public void setNoCache(boolean noCache)
|
||||
{
|
||||
this.noCache = noCache;
|
||||
}
|
||||
|
||||
public String getTitle()
|
||||
{
|
||||
return title;
|
||||
|
@ -23,9 +23,10 @@ public interface SysDeptMapper
|
||||
* 根据角色ID查询部门树信息
|
||||
*
|
||||
* @param roleId 角色ID
|
||||
* @param deptCheckStrictly 部门树选择项是否关联显示
|
||||
* @return 选中部门列表
|
||||
*/
|
||||
public List<Integer> selectDeptListByRoleId(Long roleId);
|
||||
public List<Integer> selectDeptListByRoleId(@Param("roleId") Long roleId, @Param("deptCheckStrictly") boolean deptCheckStrictly);
|
||||
|
||||
/**
|
||||
* 根据部门ID查询信息
|
||||
|
@ -6,14 +6,14 @@ import com.ruoyi.common.core.domain.entity.SysMenu;
|
||||
|
||||
/**
|
||||
* 菜单表 数据层
|
||||
*
|
||||
*
|
||||
* @author ruoyi
|
||||
*/
|
||||
public interface SysMenuMapper
|
||||
{
|
||||
/**
|
||||
* 查询系统菜单列表
|
||||
*
|
||||
*
|
||||
* @param menu 菜单信息
|
||||
* @return 菜单列表
|
||||
*/
|
||||
@ -21,14 +21,14 @@ public interface SysMenuMapper
|
||||
|
||||
/**
|
||||
* 根据用户所有权限
|
||||
*
|
||||
*
|
||||
* @return 权限列表
|
||||
*/
|
||||
public List<String> selectMenuPerms();
|
||||
|
||||
/**
|
||||
* 根据用户查询系统菜单列表
|
||||
*
|
||||
*
|
||||
* @param menu 菜单信息
|
||||
* @return 菜单列表
|
||||
*/
|
||||
@ -36,7 +36,7 @@ public interface SysMenuMapper
|
||||
|
||||
/**
|
||||
* 根据用户ID查询权限
|
||||
*
|
||||
*
|
||||
* @param userId 用户ID
|
||||
* @return 权限列表
|
||||
*/
|
||||
@ -44,15 +44,15 @@ public interface SysMenuMapper
|
||||
|
||||
/**
|
||||
* 根据用户ID查询菜单
|
||||
*
|
||||
*
|
||||
* @return 菜单列表
|
||||
*/
|
||||
public List<SysMenu> selectMenuTreeAll();
|
||||
|
||||
/**
|
||||
* 根据用户ID查询菜单
|
||||
*
|
||||
* @param username 用户ID
|
||||
*
|
||||
* @param userId 用户ID
|
||||
* @return 菜单列表
|
||||
*/
|
||||
public List<SysMenu> selectMenuTreeByUserId(Long userId);
|
||||
@ -61,13 +61,14 @@ public interface SysMenuMapper
|
||||
* 根据角色ID查询菜单树信息
|
||||
*
|
||||
* @param roleId 角色ID
|
||||
* @param menuCheckStrictly 菜单树选择项是否关联显示
|
||||
* @return 选中菜单列表
|
||||
*/
|
||||
public List<Integer> selectMenuListByRoleId(Long roleId);
|
||||
public List<Integer> selectMenuListByRoleId(@Param("roleId") Long roleId, @Param("menuCheckStrictly") boolean menuCheckStrictly);
|
||||
|
||||
/**
|
||||
* 根据菜单ID查询信息
|
||||
*
|
||||
*
|
||||
* @param menuId 菜单ID
|
||||
* @return 菜单信息
|
||||
*/
|
||||
@ -75,7 +76,7 @@ public interface SysMenuMapper
|
||||
|
||||
/**
|
||||
* 是否存在菜单子节点
|
||||
*
|
||||
*
|
||||
* @param menuId 菜单ID
|
||||
* @return 结果
|
||||
*/
|
||||
@ -83,7 +84,7 @@ public interface SysMenuMapper
|
||||
|
||||
/**
|
||||
* 新增菜单信息
|
||||
*
|
||||
*
|
||||
* @param menu 菜单信息
|
||||
* @return 结果
|
||||
*/
|
||||
@ -91,7 +92,7 @@ public interface SysMenuMapper
|
||||
|
||||
/**
|
||||
* 修改菜单信息
|
||||
*
|
||||
*
|
||||
* @param menu 菜单信息
|
||||
* @return 结果
|
||||
*/
|
||||
@ -99,7 +100,7 @@ public interface SysMenuMapper
|
||||
|
||||
/**
|
||||
* 删除菜单管理信息
|
||||
*
|
||||
*
|
||||
* @param menuId 菜单ID
|
||||
* @return 结果
|
||||
*/
|
||||
@ -107,7 +108,7 @@ public interface SysMenuMapper
|
||||
|
||||
/**
|
||||
* 校验菜单名称是否唯一
|
||||
*
|
||||
*
|
||||
* @param menuName 菜单名称
|
||||
* @param parentId 父菜单ID
|
||||
* @return 结果
|
||||
|
@ -11,6 +11,7 @@ import com.ruoyi.common.constant.UserConstants;
|
||||
import com.ruoyi.common.core.redis.RedisCache;
|
||||
import com.ruoyi.common.core.text.Convert;
|
||||
import com.ruoyi.common.enums.DataSourceType;
|
||||
import com.ruoyi.common.exception.CustomException;
|
||||
import com.ruoyi.common.utils.StringUtils;
|
||||
import com.ruoyi.system.domain.SysConfig;
|
||||
import com.ruoyi.system.mapper.SysConfigMapper;
|
||||
@ -138,6 +139,14 @@ public class SysConfigServiceImpl implements ISysConfigService
|
||||
@Override
|
||||
public int deleteConfigByIds(Long[] configIds)
|
||||
{
|
||||
for (Long configId : configIds)
|
||||
{
|
||||
SysConfig config = selectConfigById(configId);
|
||||
if (StringUtils.equals(UserConstants.YES, config.getConfigType()))
|
||||
{
|
||||
throw new CustomException(String.format("内置参数【%1$s】不能删除 ", config.getConfigKey()));
|
||||
}
|
||||
}
|
||||
int count = configMapper.deleteConfigByIds(configIds);
|
||||
if (count > 0)
|
||||
{
|
||||
|
@ -10,9 +10,11 @@ import com.ruoyi.common.annotation.DataScope;
|
||||
import com.ruoyi.common.constant.UserConstants;
|
||||
import com.ruoyi.common.core.domain.TreeSelect;
|
||||
import com.ruoyi.common.core.domain.entity.SysDept;
|
||||
import com.ruoyi.common.core.domain.entity.SysRole;
|
||||
import com.ruoyi.common.exception.CustomException;
|
||||
import com.ruoyi.common.utils.StringUtils;
|
||||
import com.ruoyi.system.mapper.SysDeptMapper;
|
||||
import com.ruoyi.system.mapper.SysRoleMapper;
|
||||
import com.ruoyi.system.service.ISysDeptService;
|
||||
|
||||
/**
|
||||
@ -26,6 +28,9 @@ public class SysDeptServiceImpl implements ISysDeptService
|
||||
@Autowired
|
||||
private SysDeptMapper deptMapper;
|
||||
|
||||
@Autowired
|
||||
private SysRoleMapper roleMapper;
|
||||
|
||||
/**
|
||||
* 查询部门管理数据
|
||||
*
|
||||
@ -93,7 +98,8 @@ public class SysDeptServiceImpl implements ISysDeptService
|
||||
@Override
|
||||
public List<Integer> selectDeptListByRoleId(Long roleId)
|
||||
{
|
||||
return deptMapper.selectDeptListByRoleId(roleId);
|
||||
SysRole role = roleMapper.selectRoleById(roleId);
|
||||
return deptMapper.selectDeptListByRoleId(roleId, role.isDeptCheckStrictly());
|
||||
}
|
||||
|
||||
/**
|
||||
@ -267,13 +273,7 @@ public class SysDeptServiceImpl implements ISysDeptService
|
||||
{
|
||||
if (hasChild(list, tChild))
|
||||
{
|
||||
// 判断是否有子节点
|
||||
Iterator<SysDept> it = childList.iterator();
|
||||
while (it.hasNext())
|
||||
{
|
||||
SysDept n = (SysDept) it.next();
|
||||
recursionFn(list, n);
|
||||
}
|
||||
recursionFn(list, tChild);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -76,12 +76,12 @@ public class SysDictTypeServiceImpl implements ISysDictTypeService
|
||||
public List<SysDictData> selectDictDataByType(String dictType)
|
||||
{
|
||||
List<SysDictData> dictDatas = DictUtils.getDictCache(dictType);
|
||||
if (StringUtils.isNotNull(dictDatas))
|
||||
if (StringUtils.isNotEmpty(dictDatas))
|
||||
{
|
||||
return dictDatas;
|
||||
}
|
||||
dictDatas = dictDataMapper.selectDictDataByType(dictType);
|
||||
if (StringUtils.isNotNull(dictDatas))
|
||||
if (StringUtils.isNotEmpty(dictDatas))
|
||||
{
|
||||
DictUtils.setDictCache(dictType, dictDatas);
|
||||
return dictDatas;
|
||||
|
@ -13,12 +13,14 @@ import org.springframework.stereotype.Service;
|
||||
import com.ruoyi.common.constant.UserConstants;
|
||||
import com.ruoyi.common.core.domain.TreeSelect;
|
||||
import com.ruoyi.common.core.domain.entity.SysMenu;
|
||||
import com.ruoyi.common.core.domain.entity.SysRole;
|
||||
import com.ruoyi.common.core.domain.entity.SysUser;
|
||||
import com.ruoyi.common.utils.SecurityUtils;
|
||||
import com.ruoyi.common.utils.StringUtils;
|
||||
import com.ruoyi.system.domain.vo.MetaVo;
|
||||
import com.ruoyi.system.domain.vo.RouterVo;
|
||||
import com.ruoyi.system.mapper.SysMenuMapper;
|
||||
import com.ruoyi.system.mapper.SysRoleMapper;
|
||||
import com.ruoyi.system.mapper.SysRoleMenuMapper;
|
||||
import com.ruoyi.system.service.ISysMenuService;
|
||||
|
||||
@ -35,6 +37,9 @@ public class SysMenuServiceImpl implements ISysMenuService
|
||||
@Autowired
|
||||
private SysMenuMapper menuMapper;
|
||||
|
||||
@Autowired
|
||||
private SysRoleMapper roleMapper;
|
||||
|
||||
@Autowired
|
||||
private SysRoleMenuMapper roleMenuMapper;
|
||||
|
||||
@ -124,7 +129,8 @@ public class SysMenuServiceImpl implements ISysMenuService
|
||||
@Override
|
||||
public List<Integer> selectMenuListByRoleId(Long roleId)
|
||||
{
|
||||
return menuMapper.selectMenuListByRoleId(roleId);
|
||||
SysRole role = roleMapper.selectRoleById(roleId);
|
||||
return menuMapper.selectMenuListByRoleId(roleId, role.isMenuCheckStrictly());
|
||||
}
|
||||
|
||||
/**
|
||||
@ -144,7 +150,7 @@ public class SysMenuServiceImpl implements ISysMenuService
|
||||
router.setName(getRouteName(menu));
|
||||
router.setPath(getRouterPath(menu));
|
||||
router.setComponent(getComponent(menu));
|
||||
router.setMeta(new MetaVo(menu.getMenuName(), menu.getIcon()));
|
||||
router.setMeta(new MetaVo(menu.getMenuName(), menu.getIcon(), StringUtils.equals("1", menu.getIsCache())));
|
||||
List<SysMenu> cMenus = menu.getChildren();
|
||||
if (!cMenus.isEmpty() && cMenus.size() > 0 && UserConstants.TYPE_DIR.equals(menu.getMenuType()))
|
||||
{
|
||||
@ -159,7 +165,7 @@ public class SysMenuServiceImpl implements ISysMenuService
|
||||
children.setPath(menu.getPath());
|
||||
children.setComponent(menu.getComponent());
|
||||
children.setName(StringUtils.capitalize(menu.getPath()));
|
||||
children.setMeta(new MetaVo(menu.getMenuName(), menu.getIcon()));
|
||||
children.setMeta(new MetaVo(menu.getMenuName(), menu.getIcon(), StringUtils.equals("1", menu.getIsCache())));
|
||||
childrenList.add(children);
|
||||
router.setChildren(childrenList);
|
||||
}
|
||||
@ -178,14 +184,19 @@ public class SysMenuServiceImpl implements ISysMenuService
|
||||
public List<SysMenu> buildMenuTree(List<SysMenu> menus)
|
||||
{
|
||||
List<SysMenu> returnList = new ArrayList<SysMenu>();
|
||||
List<Long> tempList = new ArrayList<Long>();
|
||||
for (SysMenu dept : menus)
|
||||
{
|
||||
tempList.add(dept.getMenuId());
|
||||
}
|
||||
for (Iterator<SysMenu> iterator = menus.iterator(); iterator.hasNext();)
|
||||
{
|
||||
SysMenu t = (SysMenu) iterator.next();
|
||||
// 根据传入的某个父节点ID,遍历该父节点的所有子节点
|
||||
if (t.getParentId() == 0)
|
||||
SysMenu menu = (SysMenu) iterator.next();
|
||||
// 如果是顶级节点, 遍历该父节点的所有子节点
|
||||
if (!tempList.contains(menu.getParentId()))
|
||||
{
|
||||
recursionFn(menus, t);
|
||||
returnList.add(t);
|
||||
recursionFn(menus, menu);
|
||||
returnList.add(menu);
|
||||
}
|
||||
}
|
||||
if (returnList.isEmpty())
|
||||
@ -406,13 +417,7 @@ public class SysMenuServiceImpl implements ISysMenuService
|
||||
{
|
||||
if (hasChild(list, tChild))
|
||||
{
|
||||
// 判断是否有子节点
|
||||
Iterator<SysMenu> it = childList.iterator();
|
||||
while (it.hasNext())
|
||||
{
|
||||
SysMenu n = (SysMenu) it.next();
|
||||
recursionFn(list, n);
|
||||
}
|
||||
recursionFn(list, tChild);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -75,7 +75,7 @@ public class SysUserOnlineServiceImpl implements ISysUserOnlineService
|
||||
@Override
|
||||
public SysUserOnline loginUserToUserOnline(LoginUser user)
|
||||
{
|
||||
if (StringUtils.isNull(user) && StringUtils.isNull(user.getUser()))
|
||||
if (StringUtils.isNull(user) || StringUtils.isNull(user.getUser()))
|
||||
{
|
||||
return null;
|
||||
}
|
||||
|
@ -61,7 +61,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||
|
||||
<select id="checkConfigKeyUnique" parameterType="String" resultMap="SysConfigResult">
|
||||
<include refid="selectConfigVo"/>
|
||||
where config_key = #{configKey}
|
||||
where config_key = #{configKey} limit 1
|
||||
</select>
|
||||
|
||||
<insert id="insertConfig" parameterType="SysConfig">
|
||||
|
@ -44,12 +44,14 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||
order by d.parent_id, d.order_num
|
||||
</select>
|
||||
|
||||
<select id="selectDeptListByRoleId" parameterType="Long" resultType="Integer">
|
||||
select d.dept_id, d.parent_id
|
||||
<select id="selectDeptListByRoleId" resultType="Integer">
|
||||
select d.dept_id
|
||||
from sys_dept d
|
||||
left join sys_role_dept rd on d.dept_id = rd.dept_id
|
||||
where rd.role_id = #{roleId}
|
||||
and d.dept_id not in (select d.parent_id from sys_dept d inner join sys_role_dept rd on d.dept_id = rd.dept_id and rd.role_id = #{roleId})
|
||||
<if test="deptCheckStrictly">
|
||||
and d.dept_id not in (select d.parent_id from sys_dept d inner join sys_role_dept rd on d.dept_id = rd.dept_id and rd.role_id = #{roleId})
|
||||
</if>
|
||||
order by d.parent_id, d.order_num
|
||||
</select>
|
||||
|
||||
@ -64,7 +66,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||
|
||||
<select id="hasChildByDeptId" parameterType="Long" resultType="int">
|
||||
select count(1) from sys_dept
|
||||
where del_flag = '0' and parent_id = #{deptId}
|
||||
where del_flag = '0' and parent_id = #{deptId} limit 1
|
||||
</select>
|
||||
|
||||
<select id="selectChildrenDeptById" parameterType="Long" resultMap="SysDeptResult">
|
||||
@ -77,7 +79,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||
|
||||
<select id="checkDeptNameUnique" resultMap="SysDeptResult">
|
||||
<include refid="selectDeptVo"/>
|
||||
where dept_name=#{deptName} and parent_id = #{parentId}
|
||||
where dept_name=#{deptName} and parent_id = #{parentId} limit 1
|
||||
</select>
|
||||
|
||||
<insert id="insertDept" parameterType="SysDept">
|
||||
|
@ -57,7 +57,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||
|
||||
<select id="checkDictTypeUnique" parameterType="String" resultMap="SysDictTypeResult">
|
||||
<include refid="selectDictTypeVo"/>
|
||||
where dict_type = #{dictType}
|
||||
where dict_type = #{dictType} limit 1
|
||||
</select>
|
||||
|
||||
<delete id="deleteDictTypeById" parameterType="Long">
|
||||
|
@ -13,6 +13,7 @@
|
||||
<result property="path" column="path" />
|
||||
<result property="component" column="component" />
|
||||
<result property="isFrame" column="is_frame" />
|
||||
<result property="isCache" column="is_cache" />
|
||||
<result property="menuType" column="menu_type" />
|
||||
<result property="visible" column="visible" />
|
||||
<result property="status" column="status" />
|
||||
@ -26,7 +27,7 @@
|
||||
</resultMap>
|
||||
|
||||
<sql id="selectMenuVo">
|
||||
select menu_id, menu_name, parent_id, order_num, path, component, is_frame, menu_type, visible, status, ifnull(perms,'') as perms, icon, create_time
|
||||
select menu_id, menu_name, parent_id, order_num, path, component, is_frame, is_cache, menu_type, visible, status, ifnull(perms,'') as perms, icon, create_time
|
||||
from sys_menu
|
||||
</sql>
|
||||
|
||||
@ -47,13 +48,13 @@
|
||||
</select>
|
||||
|
||||
<select id="selectMenuTreeAll" resultMap="SysMenuResult">
|
||||
select distinct m.menu_id, m.parent_id, m.menu_name, m.path, m.component, m.visible, m.status, ifnull(m.perms,'') as perms, m.is_frame, m.menu_type, m.icon, m.order_num, m.create_time
|
||||
select distinct m.menu_id, m.parent_id, m.menu_name, m.path, m.component, m.visible, m.status, ifnull(m.perms,'') as perms, m.is_frame, m.is_cache, m.menu_type, m.icon, m.order_num, m.create_time
|
||||
from sys_menu m where m.menu_type in ('M', 'C') and m.status = 0
|
||||
order by m.parent_id, m.order_num
|
||||
</select>
|
||||
|
||||
<select id="selectMenuListByUserId" parameterType="SysMenu" resultMap="SysMenuResult">
|
||||
select distinct m.menu_id, m.parent_id, m.menu_name, m.path, m.component, m.visible, m.status, ifnull(m.perms,'') as perms, m.is_frame, m.menu_type, m.icon, m.order_num, m.create_time
|
||||
select distinct m.menu_id, m.parent_id, m.menu_name, m.path, m.component, m.visible, m.status, ifnull(m.perms,'') as perms, m.is_frame, m.is_cache, m.menu_type, m.icon, m.order_num, m.create_time
|
||||
from sys_menu m
|
||||
left join sys_role_menu rm on m.menu_id = rm.menu_id
|
||||
left join sys_user_role ur on rm.role_id = ur.role_id
|
||||
@ -72,7 +73,7 @@
|
||||
</select>
|
||||
|
||||
<select id="selectMenuTreeByUserId" parameterType="Long" resultMap="SysMenuResult">
|
||||
select distinct m.menu_id, m.parent_id, m.menu_name, m.path, m.component, m.visible, m.status, ifnull(m.perms,'') as perms, m.is_frame, m.menu_type, m.icon, m.order_num, m.create_time
|
||||
select distinct m.menu_id, m.parent_id, m.menu_name, m.path, m.component, m.visible, m.status, ifnull(m.perms,'') as perms, m.is_frame, m.is_cache, m.menu_type, m.icon, m.order_num, m.create_time
|
||||
from sys_menu m
|
||||
left join sys_role_menu rm on m.menu_id = rm.menu_id
|
||||
left join sys_user_role ur on rm.role_id = ur.role_id
|
||||
@ -82,12 +83,14 @@
|
||||
order by m.parent_id, m.order_num
|
||||
</select>
|
||||
|
||||
<select id="selectMenuListByRoleId" parameterType="Long" resultType="Integer">
|
||||
select m.menu_id, m.parent_id
|
||||
<select id="selectMenuListByRoleId" resultType="Integer">
|
||||
select m.menu_id
|
||||
from sys_menu m
|
||||
left join sys_role_menu rm on m.menu_id = rm.menu_id
|
||||
where rm.role_id = #{roleId}
|
||||
and m.menu_id not in (select m.parent_id from sys_menu m inner join sys_role_menu rm on m.menu_id = rm.menu_id and rm.role_id = #{roleId})
|
||||
<if test="menuCheckStrictly">
|
||||
and m.menu_id not in (select m.parent_id from sys_menu m inner join sys_role_menu rm on m.menu_id = rm.menu_id and rm.role_id = #{roleId})
|
||||
</if>
|
||||
order by m.parent_id, m.order_num
|
||||
</select>
|
||||
|
||||
@ -118,7 +121,7 @@
|
||||
|
||||
<select id="checkMenuNameUnique" parameterType="SysMenu" resultMap="SysMenuResult">
|
||||
<include refid="selectMenuVo"/>
|
||||
where menu_name=#{menuName} and parent_id = #{parentId}
|
||||
where menu_name=#{menuName} and parent_id = #{parentId} limit 1
|
||||
</select>
|
||||
|
||||
<update id="updateMenu" parameterType="SysMenu">
|
||||
@ -130,6 +133,7 @@
|
||||
<if test="path != null and path != ''">path = #{path},</if>
|
||||
<if test="component != null and component != ''">component = #{component},</if>
|
||||
<if test="isFrame != null and isFrame != ''">is_frame = #{isFrame},</if>
|
||||
<if test="isCache != null and isCache != ''">is_cache = #{isCache},</if>
|
||||
<if test="menuType != null and menuType != ''">menu_type = #{menuType},</if>
|
||||
<if test="visible != null">visible = #{visible},</if>
|
||||
<if test="status != null">status = #{status},</if>
|
||||
@ -151,6 +155,7 @@
|
||||
<if test="path != null and path != ''">path,</if>
|
||||
<if test="component != null and component != ''">component,</if>
|
||||
<if test="isFrame != null and isFrame != ''">is_frame,</if>
|
||||
<if test="isCache != null and isCache != ''">is_cache,</if>
|
||||
<if test="menuType != null and menuType != ''">menu_type,</if>
|
||||
<if test="visible != null">visible,</if>
|
||||
<if test="status != null">status,</if>
|
||||
@ -167,6 +172,7 @@
|
||||
<if test="path != null and path != ''">#{path},</if>
|
||||
<if test="component != null and component != ''">#{component},</if>
|
||||
<if test="isFrame != null and isFrame != ''">#{isFrame},</if>
|
||||
<if test="isCache != null and isCache != ''">#{isCache},</if>
|
||||
<if test="menuType != null and menuType != ''">#{menuType},</if>
|
||||
<if test="visible != null">#{visible},</if>
|
||||
<if test="status != null">#{status},</if>
|
||||
|
@ -18,7 +18,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||
</resultMap>
|
||||
|
||||
<sql id="selectNoticeVo">
|
||||
select notice_id, notice_title, notice_type, notice_content, status, create_by, create_time, update_by, update_time, remark
|
||||
select notice_id, notice_title, notice_type, cast(notice_content as char) as notice_content, status, create_by, create_time, update_by, update_time, remark
|
||||
from sys_notice
|
||||
</sql>
|
||||
|
||||
|
@ -64,12 +64,12 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||
|
||||
<select id="checkPostNameUnique" parameterType="String" resultMap="SysPostResult">
|
||||
<include refid="selectPostVo"/>
|
||||
where post_name=#{postName}
|
||||
where post_name=#{postName} limit 1
|
||||
</select>
|
||||
|
||||
<select id="checkPostCodeUnique" parameterType="String" resultMap="SysPostResult">
|
||||
<include refid="selectPostVo"/>
|
||||
where post_code=#{postCode}
|
||||
where post_code=#{postCode} limit 1
|
||||
</select>
|
||||
|
||||
<update id="updatePost" parameterType="SysPost">
|
||||
|
@ -5,22 +5,24 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||
<mapper namespace="com.ruoyi.system.mapper.SysRoleMapper">
|
||||
|
||||
<resultMap type="SysRole" id="SysRoleResult">
|
||||
<id property="roleId" column="role_id" />
|
||||
<result property="roleName" column="role_name" />
|
||||
<result property="roleKey" column="role_key" />
|
||||
<result property="roleSort" column="role_sort" />
|
||||
<result property="dataScope" column="data_scope" />
|
||||
<result property="status" column="status" />
|
||||
<result property="delFlag" column="del_flag" />
|
||||
<result property="createBy" column="create_by" />
|
||||
<result property="createTime" column="create_time" />
|
||||
<result property="updateBy" column="update_by" />
|
||||
<result property="updateTime" column="update_time" />
|
||||
<result property="remark" column="remark" />
|
||||
<id property="roleId" column="role_id" />
|
||||
<result property="roleName" column="role_name" />
|
||||
<result property="roleKey" column="role_key" />
|
||||
<result property="roleSort" column="role_sort" />
|
||||
<result property="dataScope" column="data_scope" />
|
||||
<result property="menuCheckStrictly" column="menu_check_strictly" />
|
||||
<result property="deptCheckStrictly" column="dept_check_strictly" />
|
||||
<result property="status" column="status" />
|
||||
<result property="delFlag" column="del_flag" />
|
||||
<result property="createBy" column="create_by" />
|
||||
<result property="createTime" column="create_time" />
|
||||
<result property="updateBy" column="update_by" />
|
||||
<result property="updateTime" column="update_time" />
|
||||
<result property="remark" column="remark" />
|
||||
</resultMap>
|
||||
|
||||
<sql id="selectRoleVo">
|
||||
select distinct r.role_id, r.role_name, r.role_key, r.role_sort, r.data_scope,
|
||||
select distinct r.role_id, r.role_name, r.role_key, r.role_sort, r.data_scope, r.menu_check_strictly, r.dept_check_strictly,
|
||||
r.status, r.del_flag, r.create_time, r.remark
|
||||
from sys_role r
|
||||
left join sys_user_role ur on ur.role_id = r.role_id
|
||||
@ -80,12 +82,12 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||
|
||||
<select id="checkRoleNameUnique" parameterType="String" resultMap="SysRoleResult">
|
||||
<include refid="selectRoleVo"/>
|
||||
where r.role_name=#{roleName}
|
||||
where r.role_name=#{roleName} limit 1
|
||||
</select>
|
||||
|
||||
<select id="checkRoleKeyUnique" parameterType="String" resultMap="SysRoleResult">
|
||||
<include refid="selectRoleVo"/>
|
||||
where r.role_key=#{roleKey}
|
||||
where r.role_key=#{roleKey} limit 1
|
||||
</select>
|
||||
|
||||
<insert id="insertRole" parameterType="SysRole" useGeneratedKeys="true" keyProperty="roleId">
|
||||
@ -95,6 +97,8 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||
<if test="roleKey != null and roleKey != ''">role_key,</if>
|
||||
<if test="roleSort != null and roleSort != ''">role_sort,</if>
|
||||
<if test="dataScope != null and dataScope != ''">data_scope,</if>
|
||||
<if test="menuCheckStrictly != null">menu_check_strictly,</if>
|
||||
<if test="deptCheckStrictly != null">dept_check_strictly,</if>
|
||||
<if test="status != null and status != ''">status,</if>
|
||||
<if test="remark != null and remark != ''">remark,</if>
|
||||
<if test="createBy != null and createBy != ''">create_by,</if>
|
||||
@ -105,6 +109,8 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||
<if test="roleKey != null and roleKey != ''">#{roleKey},</if>
|
||||
<if test="roleSort != null and roleSort != ''">#{roleSort},</if>
|
||||
<if test="dataScope != null and dataScope != ''">#{dataScope},</if>
|
||||
<if test="menuCheckStrictly != null">#{menuCheckStrictly},</if>
|
||||
<if test="deptCheckStrictly != null">#{deptCheckStrictly},</if>
|
||||
<if test="status != null and status != ''">#{status},</if>
|
||||
<if test="remark != null and remark != ''">#{remark},</if>
|
||||
<if test="createBy != null and createBy != ''">#{createBy},</if>
|
||||
@ -119,6 +125,8 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||
<if test="roleKey != null and roleKey != ''">role_key = #{roleKey},</if>
|
||||
<if test="roleSort != null and roleSort != ''">role_sort = #{roleSort},</if>
|
||||
<if test="dataScope != null and dataScope != ''">data_scope = #{dataScope},</if>
|
||||
<if test="menuCheckStrictly != null">menu_check_strictly = #{menuCheckStrictly},</if>
|
||||
<if test="deptCheckStrictly != null">dept_check_strictly = #{deptCheckStrictly},</if>
|
||||
<if test="status != null and status != ''">status = #{status},</if>
|
||||
<if test="remark != null">remark = #{remark},</if>
|
||||
<if test="updateBy != null and updateBy != ''">update_by = #{updateBy},</if>
|
||||
|
@ -10,7 +10,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||
</resultMap>
|
||||
|
||||
<select id="checkMenuExistRole" resultType="Integer">
|
||||
select count(1) from sys_role_menu where menu_id = #{menuId}
|
||||
select count(1) from sys_role_menu where menu_id = #{menuId}
|
||||
</select>
|
||||
|
||||
<delete id="deleteRoleMenuByRoleId" parameterType="Long">
|
||||
|
@ -75,7 +75,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||
AND date_format(u.create_time,'%y%m%d') <= date_format(#{endTime},'%y%m%d')
|
||||
</if>
|
||||
<if test="deptId != null and deptId != 0">
|
||||
AND (u.dept_id = #{deptId} OR u.dept_id IN ( SELECT t.dept_id FROM sys_dept t WHERE FIND_IN_SET (#{deptId},ancestors) ))
|
||||
AND (u.dept_id = #{deptId} OR u.dept_id IN ( SELECT t.dept_id FROM sys_dept t WHERE find_in_set(#{deptId}, ancestors) ))
|
||||
</if>
|
||||
<!-- 数据范围过滤 -->
|
||||
${params.dataScope}
|
||||
@ -92,15 +92,15 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||
</select>
|
||||
|
||||
<select id="checkUserNameUnique" parameterType="String" resultType="int">
|
||||
select count(1) from sys_user where user_name = #{userName}
|
||||
select count(1) from sys_user where user_name = #{userName} limit 1
|
||||
</select>
|
||||
|
||||
<select id="checkPhoneUnique" parameterType="String" resultMap="SysUserResult">
|
||||
select user_id, phonenumber from sys_user where phonenumber = #{phonenumber}
|
||||
select user_id, phonenumber from sys_user where phonenumber = #{phonenumber} limit 1
|
||||
</select>
|
||||
|
||||
<select id="checkEmailUnique" parameterType="String" resultMap="SysUserResult">
|
||||
select user_id, email from sys_user where email = #{email}
|
||||
select user_id, email from sys_user where email = #{email} limit 1
|
||||
</select>
|
||||
|
||||
<insert id="insertUser" parameterType="SysUser" useGeneratedKeys="true" keyProperty="userId">
|
||||
|
@ -1,5 +1,13 @@
|
||||
module.exports = {
|
||||
presets: [
|
||||
'@vue/app'
|
||||
]
|
||||
// https://github.com/vuejs/vue-cli/tree/master/packages/@vue/babel-preset-app
|
||||
'@vue/cli-plugin-babel/preset'
|
||||
],
|
||||
'env': {
|
||||
'development': {
|
||||
// babel-plugin-dynamic-import-node plugin only does one thing by converting all import() to require().
|
||||
// This plugin can significantly increase the speed of hot updates, when you have a large number of pages.
|
||||
'plugins': ['dynamic-import-node']
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -1,11 +1,11 @@
|
||||
{
|
||||
"name": "ruoyi",
|
||||
"version": "3.0.0",
|
||||
"version": "3.2.1",
|
||||
"description": "若依管理系统",
|
||||
"author": "若依",
|
||||
"license": "MIT",
|
||||
"scripts": {
|
||||
"dev": "vue-cli-service serve --open",
|
||||
"dev": "vue-cli-service serve",
|
||||
"build:prod": "vue-cli-service build",
|
||||
"build:stage": "vue-cli-service build --mode staging",
|
||||
"preview": "node build/index.js --preview",
|
||||
@ -43,10 +43,11 @@
|
||||
"@riophae/vue-treeselect": "0.4.0",
|
||||
"axios": "0.18.1",
|
||||
"clipboard": "2.0.4",
|
||||
"core-js": "3.6.5",
|
||||
"echarts": "4.2.1",
|
||||
"element-ui": "2.13.2",
|
||||
"file-saver": "2.0.1",
|
||||
"js-beautify": "^1.10.2",
|
||||
"js-beautify": "1.10.2",
|
||||
"fuse.js": "3.4.4",
|
||||
"js-cookie": "2.2.0",
|
||||
"jsencrypt": "3.0.0-rc.1",
|
||||
@ -57,7 +58,7 @@
|
||||
"sortablejs": "1.8.4",
|
||||
"vue": "2.6.10",
|
||||
"vue-count-to": "1.0.13",
|
||||
"vue-quill-editor": "3.0.6",
|
||||
"quill": "1.3.7",
|
||||
"vue-cropper": "0.4.9",
|
||||
"vue-router": "3.0.2",
|
||||
"vue-splitpane": "1.0.4",
|
||||
@ -65,32 +66,31 @@
|
||||
"vuex": "3.1.0"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@vue/cli-plugin-babel": "3.5.3",
|
||||
"@vue/cli-plugin-eslint": "^3.9.1",
|
||||
"@vue/cli-plugin-unit-jest": "3.5.3",
|
||||
"@vue/cli-service": "3.5.3",
|
||||
"@vue/cli-plugin-babel": "4.4.4",
|
||||
"@vue/cli-plugin-eslint": "4.4.4",
|
||||
"@vue/cli-plugin-unit-jest": "4.4.4",
|
||||
"@vue/cli-service": "4.4.4",
|
||||
"@vue/test-utils": "1.0.0-beta.29",
|
||||
"autoprefixer": "^9.5.1",
|
||||
"babel-core": "7.0.0-bridge.0",
|
||||
"babel-eslint": "10.0.1",
|
||||
"autoprefixer": "9.5.1",
|
||||
"babel-eslint": "10.1.0",
|
||||
"babel-jest": "23.6.0",
|
||||
"babel-plugin-dynamic-import-node": "2.3.3",
|
||||
"chalk": "2.4.2",
|
||||
"chokidar": "2.1.5",
|
||||
"connect": "3.6.6",
|
||||
"eslint": "5.15.3",
|
||||
"eslint-plugin-vue": "5.2.2",
|
||||
"eslint": "6.7.2",
|
||||
"eslint-plugin-vue": "6.2.2",
|
||||
"html-webpack-plugin": "3.2.0",
|
||||
"http-proxy-middleware": "^0.19.1",
|
||||
"husky": "1.3.1",
|
||||
"lint-staged": "8.1.5",
|
||||
"mockjs": "1.0.1-beta3",
|
||||
"node-sass": "^4.9.0",
|
||||
"plop": "2.3.0",
|
||||
"runjs": "^4.3.2",
|
||||
"sass-loader": "^7.1.0",
|
||||
"runjs": "4.3.2",
|
||||
"node-sass": "4.14.1",
|
||||
"sass-loader": "8.0.2",
|
||||
"script-ext-html-webpack-plugin": "2.1.3",
|
||||
"script-loader": "0.7.2",
|
||||
"serve-static": "^1.13.2",
|
||||
"serve-static": "1.13.2",
|
||||
"svg-sprite-loader": "4.1.3",
|
||||
"svgo": "1.2.0",
|
||||
"vue-template-compiler": "2.6.10"
|
||||
|
@ -42,6 +42,7 @@ export function importTable(data) {
|
||||
params: data
|
||||
})
|
||||
}
|
||||
|
||||
// 预览生成代码
|
||||
export function previewTable(tableId) {
|
||||
return request({
|
||||
@ -49,6 +50,7 @@ export function previewTable(tableId) {
|
||||
method: 'get'
|
||||
})
|
||||
}
|
||||
|
||||
// 删除表数据
|
||||
export function delTable(tableId) {
|
||||
return request({
|
||||
@ -57,3 +59,18 @@ export function delTable(tableId) {
|
||||
})
|
||||
}
|
||||
|
||||
// 生成代码(自定义路径)
|
||||
export function genCode(tableName) {
|
||||
return request({
|
||||
url: '/tool/gen/genCode/' + tableName,
|
||||
method: 'get'
|
||||
})
|
||||
}
|
||||
|
||||
// 同步数据库
|
||||
export function synchDb(tableName) {
|
||||
return request({
|
||||
url: '/tool/gen/synchDb/' + tableName,
|
||||
method: 'get'
|
||||
})
|
||||
}
|
||||
|
1
ruoyi-ui/src/assets/icons/svg/button.svg
Normal file
1
ruoyi-ui/src/assets/icons/svg/button.svg
Normal file
@ -0,0 +1 @@
|
||||
<?xml version="1.0" standalone="no"?><!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd"><svg t="1588670460195" class="icon" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="1314" xmlns:xlink="http://www.w3.org/1999/xlink" width="200" height="200"><defs><style type="text/css"></style></defs><path d="M230.4 307.712c13.824 0 25.088-11.264 25.088-25.088 0-100.352 81.92-182.272 182.272-182.272s182.272 81.408 182.272 182.272c0 13.824 11.264 25.088 25.088 25.088s25.088-11.264 24.576-25.088c0-127.488-103.936-231.936-231.936-231.936S205.824 154.624 205.824 282.624c-0.512 14.336 10.752 25.088 24.576 25.088z m564.736 234.496c-11.264 0-21.504 2.048-31.232 6.144 0-44.544-40.448-81.92-88.064-81.92-14.848 0-28.16 3.584-39.936 10.24-13.824-28.16-44.544-48.128-78.848-48.128-12.288 0-24.576 2.56-35.328 7.68V284.16c0-45.568-37.888-81.92-84.48-81.92s-84.48 36.864-84.48 81.92v348.672l-69.12-112.64c-18.432-28.16-58.368-36.864-91.136-19.968-26.624 14.336-46.592 47.104-30.208 88.064 3.072 8.192 76.8 205.312 171.52 311.296 0 0 28.16 24.576 43.008 58.88 4.096 9.728 13.312 15.36 22.528 15.36 3.072 0 6.656-0.512 9.728-2.048 12.288-5.12 18.432-19.968 12.8-32.256-19.456-44.544-53.76-74.752-53.76-74.752C281.6 768 209.408 573.44 208.384 570.88c-5.12-12.8-2.56-20.992 7.168-26.112 9.216-4.608 21.504-4.608 26.112 2.56l113.152 184.32c4.096 8.704 12.8 14.336 22.528 14.336 13.824 0 25.088-10.752 25.088-25.088V284.16c0-17.92 15.36-32.256 34.816-32.256s34.816 14.336 34.816 32.256v284.16c0 13.824 10.24 25.088 24.576 25.088 13.824 0 25.088-11.264 25.088-25.088v-57.344c0-17.92 15.36-32.768 34.816-32.768 19.968 0 37.376 15.36 37.376 32.768v95.232c0 7.168 3.072 13.312 7.68 17.92 4.608 4.608 10.752 7.168 17.92 7.168 13.824 0 24.576-11.264 24.576-25.088V547.84c0-18.432 13.824-32.256 32.256-32.256 20.48 0 38.912 15.36 38.912 32.256v95.232c0 13.824 11.264 25.088 25.088 25.088s24.576-11.264 25.088-25.088v-18.944c0-18.944 12.8-32.256 30.72-32.256 18.432 0 22.528 18.944 22.528 31.744 0 1.024-11.776 99.84-50.688 173.056-30.72 58.368-45.056 112.128-51.2 146.944-2.56 13.312 6.656 26.112 19.968 28.672 1.536 0 3.072 0.512 4.608 0.512 11.776 0 22.016-8.192 24.064-20.48 5.632-31.232 18.432-79.36 46.08-132.608 43.52-81.92 55.808-186.88 56.32-193.536-0.512-50.688-29.696-83.968-72.704-83.968z"></path></path></svg>
|
After Width: | Height: | Size: 2.3 KiB |
@ -67,6 +67,11 @@
|
||||
font-size: 13px;
|
||||
}
|
||||
}
|
||||
.el-table__body-wrapper {
|
||||
.el-button [class*="el-icon-"] + span {
|
||||
margin-left: 1px;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/** 表单布局 **/
|
||||
@ -87,6 +92,14 @@
|
||||
padding: 10px 20px !important;
|
||||
}
|
||||
|
||||
/* tree border */
|
||||
.tree-border {
|
||||
margin-top: 5px;
|
||||
border: 1px solid #e5e6e7;
|
||||
background: #FFFFFF none;
|
||||
border-radius:4px;
|
||||
}
|
||||
|
||||
.pagination-container .el-pagination {
|
||||
right: 0;
|
||||
position: absolute;
|
||||
@ -142,7 +155,28 @@
|
||||
padding-left: 15px;
|
||||
margin-bottom: 10px;
|
||||
}
|
||||
|
||||
|
||||
/* button color */
|
||||
.el-button--cyan.is-active,
|
||||
.el-button--cyan:active {
|
||||
background: #20B2AA;
|
||||
border-color: #20B2AA;
|
||||
color: #FFFFFF;
|
||||
}
|
||||
|
||||
.el-button--cyan:focus,
|
||||
.el-button--cyan:hover {
|
||||
background: #48D1CC;
|
||||
border-color: #48D1CC;
|
||||
color: #FFFFFF;
|
||||
}
|
||||
|
||||
.el-button--cyan {
|
||||
background-color: #20B2AA;
|
||||
border-color: #20B2AA;
|
||||
color: #FFFFFF;
|
||||
}
|
||||
|
||||
/* text color */
|
||||
.text-navy {
|
||||
color: #1ab394;
|
||||
@ -198,4 +232,9 @@
|
||||
opacity: .8;
|
||||
color: #fff!important;
|
||||
background: #42b983!important;
|
||||
}
|
||||
|
||||
.top-right-btn {
|
||||
position: relative;
|
||||
float: right;
|
||||
}
|
@ -63,6 +63,12 @@
|
||||
width: 100% !important;
|
||||
}
|
||||
|
||||
.el-menu-item, .el-submenu__title {
|
||||
overflow: hidden !important;
|
||||
text-overflow: ellipsis !important;
|
||||
white-space: nowrap !important;
|
||||
}
|
||||
|
||||
// menu hover
|
||||
.submenu-title-noDropdown,
|
||||
.el-submenu__title {
|
||||
|
@ -1,153 +1,122 @@
|
||||
<template>
|
||||
<div>
|
||||
<!-- 图片上传组件辅助 -->
|
||||
<el-upload
|
||||
class="avatar-uploader quill-img"
|
||||
:action="uploadImgUrl"
|
||||
name="file"
|
||||
:headers="headers"
|
||||
:show-file-list="false"
|
||||
:on-success="quillImgSuccess"
|
||||
:on-error="uploadError"
|
||||
:before-upload="quillImgBefore"
|
||||
accept='.jpg,.jpeg,.png,.gif'
|
||||
></el-upload>
|
||||
|
||||
<!-- 富文本组件 -->
|
||||
<quill-editor
|
||||
class="editor"
|
||||
v-model="content"
|
||||
ref="quillEditor"
|
||||
:options="editorOption"
|
||||
@blur="onEditorBlur($event)"
|
||||
@focus="onEditorFocus($event)"
|
||||
@change="onEditorChange($event)"
|
||||
></quill-editor>
|
||||
</div>
|
||||
<div class="editor" ref="editor" :style="styles"></div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import { getToken } from '@/utils/auth'
|
||||
|
||||
// 工具栏配置
|
||||
const toolbarOptions = [
|
||||
["bold", "italic", "underline", "strike"], // 加粗 斜体 下划线 删除线
|
||||
["blockquote", "code-block"], // 引用 代码块
|
||||
[{ list: "ordered" }, { list: "bullet" }], // 有序、无序列表
|
||||
[{ indent: "-1" }, { indent: "+1" }], // 缩进
|
||||
[{ size: ["small", false, "large", "huge"] }], // 字体大小
|
||||
[{ header: [1, 2, 3, 4, 5, 6, false] }], // 标题
|
||||
[{ color: [] }, { background: [] }], // 字体颜色、字体背景颜色
|
||||
[{ align: [] }], // 对齐方式
|
||||
["clean"], // 清除文本格式
|
||||
["link", "image", "video"] // 链接、图片、视频
|
||||
];
|
||||
|
||||
import { quillEditor } from "vue-quill-editor";
|
||||
import Quill from "quill";
|
||||
import "quill/dist/quill.core.css";
|
||||
import "quill/dist/quill.snow.css";
|
||||
import "quill/dist/quill.bubble.css";
|
||||
|
||||
export default {
|
||||
name: "Editor",
|
||||
props: {
|
||||
/* 编辑器的内容 */
|
||||
value: {
|
||||
type: String
|
||||
type: String,
|
||||
default: "",
|
||||
},
|
||||
/* 图片大小 */
|
||||
maxSize: {
|
||||
/* 高度 */
|
||||
height: {
|
||||
type: Number,
|
||||
default: 4000 //kb
|
||||
}
|
||||
default: null,
|
||||
},
|
||||
/* 最小高度 */
|
||||
minHeight: {
|
||||
type: Number,
|
||||
default: null,
|
||||
},
|
||||
},
|
||||
components: { quillEditor },
|
||||
data() {
|
||||
return {
|
||||
content: this.value,
|
||||
uploadImgUrl: "",
|
||||
editorOption: {
|
||||
placeholder: "",
|
||||
theme: "snow", // or 'bubble'
|
||||
placeholder: "请输入内容",
|
||||
Quill: null,
|
||||
currentValue: "",
|
||||
options: {
|
||||
theme: "snow",
|
||||
bounds: document.body,
|
||||
debug: "warn",
|
||||
modules: {
|
||||
toolbar: {
|
||||
container: toolbarOptions,
|
||||
handlers: {
|
||||
image: function(value) {
|
||||
if (value) {
|
||||
// 触发input框选择图片文件
|
||||
document.querySelector(".quill-img input").click();
|
||||
} else {
|
||||
this.quill.format("image", false);
|
||||
}
|
||||
}
|
||||
}
|
||||
// 工具栏配置
|
||||
toolbar: [
|
||||
["bold", "italic", "underline", "strike"], // 加粗 斜体 下划线 删除线
|
||||
["blockquote", "code-block"], // 引用 代码块
|
||||
[{ list: "ordered" }, { list: "bullet" }], // 有序、无序列表
|
||||
[{ indent: "-1" }, { indent: "+1" }], // 缩进
|
||||
[{ size: ["small", false, "large", "huge"] }], // 字体大小
|
||||
[{ header: [1, 2, 3, 4, 5, 6, false] }], // 标题
|
||||
[{ color: [] }, { background: [] }], // 字体颜色、字体背景颜色
|
||||
[{ align: [] }], // 对齐方式
|
||||
["clean"], // 清除文本格式
|
||||
["link", "image", "video"] // 链接、图片、视频
|
||||
],
|
||||
},
|
||||
placeholder: "请输入内容",
|
||||
readOnly: false,
|
||||
},
|
||||
};
|
||||
},
|
||||
computed: {
|
||||
styles() {
|
||||
let style = {};
|
||||
if (this.minHeight) {
|
||||
style.minHeight = `${this.minHeight}px`;
|
||||
}
|
||||
if (this.height) {
|
||||
style.height = `${this.height}px`;
|
||||
}
|
||||
return style;
|
||||
},
|
||||
},
|
||||
watch: {
|
||||
value: {
|
||||
handler(val) {
|
||||
if (val !== this.currentValue) {
|
||||
this.currentValue = val === null ? "" : val;
|
||||
if (this.Quill) {
|
||||
this.Quill.pasteHTML(this.currentValue);
|
||||
}
|
||||
}
|
||||
},
|
||||
uploadImgUrl: process.env.VUE_APP_BASE_API + "/common/upload", // 上传的图片服务器地址
|
||||
headers: {
|
||||
Authorization: 'Bearer ' + getToken()
|
||||
}
|
||||
};
|
||||
immediate: true,
|
||||
},
|
||||
},
|
||||
watch: {
|
||||
value: function() {
|
||||
this.content = this.value;
|
||||
}
|
||||
mounted() {
|
||||
this.init();
|
||||
},
|
||||
beforeDestroy() {
|
||||
this.Quill = null;
|
||||
},
|
||||
methods: {
|
||||
onEditorBlur() {
|
||||
//失去焦点事件
|
||||
init() {
|
||||
const editor = this.$refs.editor;
|
||||
this.Quill = new Quill(editor, this.options);
|
||||
this.Quill.pasteHTML(this.currentValue);
|
||||
this.Quill.on("text-change", (delta, oldDelta, source) => {
|
||||
const html = this.$refs.editor.children[0].innerHTML;
|
||||
const text = this.Quill.getText();
|
||||
const quill = this.Quill;
|
||||
this.currentValue = html;
|
||||
this.$emit("input", html);
|
||||
this.$emit("on-change", { html, text, quill });
|
||||
});
|
||||
this.Quill.on("text-change", (delta, oldDelta, source) => {
|
||||
this.$emit("on-text-change", delta, oldDelta, source);
|
||||
});
|
||||
this.Quill.on("selection-change", (range, oldRange, source) => {
|
||||
this.$emit("on-selection-change", range, oldRange, source);
|
||||
});
|
||||
this.Quill.on("editor-change", (eventName, ...args) => {
|
||||
this.$emit("on-editor-change", eventName, ...args);
|
||||
});
|
||||
},
|
||||
onEditorFocus() {
|
||||
//获得焦点事件
|
||||
},
|
||||
onEditorChange() {
|
||||
//内容改变事件
|
||||
this.$emit("input", this.content);
|
||||
},
|
||||
|
||||
// 富文本图片上传前
|
||||
quillImgBefore(file) {
|
||||
let fileType = file.type;
|
||||
if(fileType === 'image/jpeg' || fileType === 'image/png'){
|
||||
return true;
|
||||
}else {
|
||||
this.$message.error('请插入图片类型文件(jpg/jpeg/png)');
|
||||
return false;
|
||||
}
|
||||
},
|
||||
|
||||
quillImgSuccess(res, file) {
|
||||
// res为图片服务器返回的数据
|
||||
// 获取富文本组件实例
|
||||
let quill = this.$refs.quillEditor.quill;
|
||||
// 如果上传成功
|
||||
if (res.code == 200) {
|
||||
// 获取光标所在位置
|
||||
let length = quill.getSelection().index;
|
||||
// 插入图片 res.url为服务器返回的图片地址
|
||||
quill.insertEmbed(length, "image", res.url);
|
||||
// 调整光标到最后
|
||||
quill.setSelection(length + 1);
|
||||
} else {
|
||||
this.$message.error("图片插入失败");
|
||||
}
|
||||
},
|
||||
// 富文本图片上传失败
|
||||
uploadError() {
|
||||
// loading动画消失
|
||||
this.$message.error("图片插入失败");
|
||||
}
|
||||
}
|
||||
},
|
||||
};
|
||||
</script>
|
||||
</script>
|
||||
|
||||
<style>
|
||||
.editor {
|
||||
.editor, .ql-toolbar {
|
||||
white-space: pre-wrap!important;
|
||||
line-height: normal !important;
|
||||
height: 192px;
|
||||
}
|
||||
.quill-img {
|
||||
display: none;
|
||||
|
38
ruoyi-ui/src/components/RightToolbar/index.vue
Normal file
38
ruoyi-ui/src/components/RightToolbar/index.vue
Normal file
@ -0,0 +1,38 @@
|
||||
<!-- @author Shiyn/ huangmx 20200807优化-->
|
||||
<template>
|
||||
<div class="top-right-btn">
|
||||
<el-row>
|
||||
<el-tooltip class="item" effect="dark" :content="showSearch ? '隐藏搜索' : '显示搜索'" placement="top">
|
||||
<el-button size="mini" circle icon="el-icon-search" @click="toggleSearch()" />
|
||||
</el-tooltip>
|
||||
<el-tooltip class="item" effect="dark" content="刷新" placement="top">
|
||||
<el-button size="mini" circle icon="el-icon-refresh" @click="refresh()" />
|
||||
</el-tooltip>
|
||||
</el-row>
|
||||
</div>
|
||||
</template>
|
||||
<script>
|
||||
export default {
|
||||
name: "RightToolbar",
|
||||
data() {
|
||||
return {};
|
||||
},
|
||||
props: {
|
||||
showSearch: {
|
||||
type: Boolean,
|
||||
default: true,
|
||||
},
|
||||
},
|
||||
|
||||
methods: {
|
||||
//搜索
|
||||
toggleSearch() {
|
||||
this.$emit("update:showSearch", !this.showSearch);
|
||||
},
|
||||
//刷新
|
||||
refresh() {
|
||||
this.$emit("queryTable");
|
||||
},
|
||||
},
|
||||
};
|
||||
</script>
|
68
ruoyi-ui/src/components/UploadImage/index.vue
Normal file
68
ruoyi-ui/src/components/UploadImage/index.vue
Normal file
@ -0,0 +1,68 @@
|
||||
<template>
|
||||
<div class="component-upload-image">
|
||||
<el-upload
|
||||
:action="uploadImgUrl"
|
||||
list-type="picture-card"
|
||||
:on-success="handleUploadSuccess"
|
||||
:before-upload="handleBeforeUpload"
|
||||
:on-error="handleUploadError"
|
||||
name="file"
|
||||
:show-file-list="false"
|
||||
:headers="headers"
|
||||
style="display: inline-block; vertical-align: top"
|
||||
>
|
||||
<img v-if="value" :src="value" class="avatar" />
|
||||
<i v-else class="el-icon-plus avatar-uploader-icon"></i>
|
||||
</el-upload>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import { getToken } from "@/utils/auth";
|
||||
|
||||
export default {
|
||||
components: {},
|
||||
data() {
|
||||
return {
|
||||
uploadImgUrl: process.env.VUE_APP_BASE_API + "/common/upload", // 上传的图片服务器地址
|
||||
headers: {
|
||||
Authorization: "Bearer " + getToken(),
|
||||
},
|
||||
};
|
||||
},
|
||||
props: {
|
||||
value: {
|
||||
type: String,
|
||||
default: "",
|
||||
},
|
||||
},
|
||||
methods: {
|
||||
handleUploadSuccess(res) {
|
||||
this.$emit("input", res.url);
|
||||
this.loading.close();
|
||||
},
|
||||
handleBeforeUpload() {
|
||||
this.loading = this.$loading({
|
||||
lock: true,
|
||||
text: "上传中",
|
||||
background: "rgba(0, 0, 0, 0.7)",
|
||||
});
|
||||
},
|
||||
handleUploadError() {
|
||||
this.$message({
|
||||
type: "error",
|
||||
message: "上传失败",
|
||||
});
|
||||
this.loading.close();
|
||||
},
|
||||
},
|
||||
watch: {},
|
||||
};
|
||||
</script>
|
||||
|
||||
<style scoped lang="scss">
|
||||
.avatar {
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
}
|
||||
</style>
|
@ -160,7 +160,7 @@ export default {
|
||||
},
|
||||
closeAllTags(view) {
|
||||
this.$store.dispatch('tagsView/delAllViews').then(({ visitedViews }) => {
|
||||
if (this.affixTags.some(tag => tag.path === view.path)) {
|
||||
if (this.affixTags.some(tag => tag.path === this.$route.path)) {
|
||||
return
|
||||
}
|
||||
this.toLastView(visitedViews, view)
|
||||
|
@ -18,8 +18,10 @@ import './assets/icons' // icon
|
||||
import './permission' // permission control
|
||||
import { getDicts } from "@/api/system/dict/data";
|
||||
import { getConfigKey } from "@/api/system/config";
|
||||
import { parseTime, resetForm, addDateRange, selectDictLabel, download, handleTree } from "@/utils/ruoyi";
|
||||
import { parseTime, resetForm, addDateRange, selectDictLabel, selectDictLabels, download, handleTree } from "@/utils/ruoyi";
|
||||
import Pagination from "@/components/Pagination";
|
||||
//自定义表格工具扩展
|
||||
import RightToolbar from "@/components/RightToolbar"
|
||||
|
||||
// 全局方法挂载
|
||||
Vue.prototype.getDicts = getDicts
|
||||
@ -28,6 +30,7 @@ Vue.prototype.parseTime = parseTime
|
||||
Vue.prototype.resetForm = resetForm
|
||||
Vue.prototype.addDateRange = addDateRange
|
||||
Vue.prototype.selectDictLabel = selectDictLabel
|
||||
Vue.prototype.selectDictLabels = selectDictLabels
|
||||
Vue.prototype.download = download
|
||||
Vue.prototype.handleTree = handleTree
|
||||
|
||||
@ -45,6 +48,7 @@ Vue.prototype.msgInfo = function (msg) {
|
||||
|
||||
// 全局组件挂载
|
||||
Vue.component('Pagination', Pagination)
|
||||
Vue.component('RightToolbar', RightToolbar)
|
||||
|
||||
Vue.use(permission)
|
||||
|
||||
|
@ -17,9 +17,9 @@ import Layout from '@/layout'
|
||||
* redirect: noRedirect // 当设置 noRedirect 的时候该路由在面包屑导航中不可被点击
|
||||
* name:'router-name' // 设定路由的名字,一定要填写不然使用<keep-alive>时会出现各种问题
|
||||
* meta : {
|
||||
roles: ['admin','editor'] // 设置该路由进入的权限,支持多个权限叠加
|
||||
noCache: true // 如果设置为true,则不会被 <keep-alive> 缓存(默认 false)
|
||||
title: 'title' // 设置该路由在侧边栏和面包屑中展示的名字
|
||||
icon: 'svg-name' // 设置该路由的图标,对应路径src/icons/svg
|
||||
icon: 'svg-name' // 设置该路由的图标,对应路径src/assets/icons/svg
|
||||
breadcrumb: false // 如果设置为false,则不会在breadcrumb面包屑中显示
|
||||
}
|
||||
*/
|
||||
|
@ -406,6 +406,21 @@ export const layoutComponents = [
|
||||
layoutTree: true,
|
||||
children: [],
|
||||
document: 'https://element.eleme.cn/#/zh-CN/component/layout'
|
||||
},
|
||||
{
|
||||
layout: 'colFormItem',
|
||||
label: '按钮',
|
||||
changeTag: true,
|
||||
labelWidth: null,
|
||||
tag: 'el-button',
|
||||
tagIcon: 'button',
|
||||
span: 24,
|
||||
default: '主要按钮',
|
||||
type: 'primary',
|
||||
icon: 'el-icon-search',
|
||||
size: 'medium',
|
||||
disabled: false,
|
||||
document: 'https://element.eleme.cn/#/zh-CN/component/button'
|
||||
}
|
||||
]
|
||||
|
||||
|
@ -107,6 +107,18 @@ const layouts = {
|
||||
}
|
||||
|
||||
const tags = {
|
||||
'el-button': el => {
|
||||
const {
|
||||
tag, disabled
|
||||
} = attrBuilder(el)
|
||||
const type = el.type ? `type="${el.type}"` : ''
|
||||
const icon = el.icon ? `icon="${el.icon}"` : ''
|
||||
const size = el.size ? `size="${el.size}"` : ''
|
||||
let child = buildElButtonChild(el)
|
||||
|
||||
if (child) child = `\n${child}\n` // 换行
|
||||
return `<${el.tag} ${type} ${icon} ${size} ${disabled}>${child}</${el.tag}>`
|
||||
},
|
||||
'el-input': el => {
|
||||
const {
|
||||
disabled, vModel, clearable, placeholder, width
|
||||
@ -272,6 +284,15 @@ function attrBuilder(el) {
|
||||
}
|
||||
}
|
||||
|
||||
// el-buttin 子级
|
||||
function buildElButtonChild(conf) {
|
||||
const children = []
|
||||
if (conf.default) {
|
||||
children.push(conf.default)
|
||||
}
|
||||
return children.join('\n')
|
||||
}
|
||||
|
||||
// el-input innerHTML
|
||||
function buildElInputChild(conf) {
|
||||
const children = []
|
||||
|
@ -26,6 +26,11 @@ function vModel(self, dataObject, defaultValue) {
|
||||
}
|
||||
|
||||
const componentChild = {
|
||||
'el-button': {
|
||||
default(h, conf, key) {
|
||||
return conf[key]
|
||||
},
|
||||
},
|
||||
'el-input': {
|
||||
prepend(h, conf, key) {
|
||||
return <template slot="prepend">{conf[key]}</template>
|
||||
|
@ -1,3 +1,5 @@
|
||||
import { parseTime } from './ruoyi'
|
||||
|
||||
/**
|
||||
* 表格时间格式化
|
||||
*/
|
||||
@ -385,4 +387,4 @@ export function camelCase(str) {
|
||||
export function isNumberStr(str) {
|
||||
return /^[+-]?(0|([1-9]\d*))(\.\d+)?$/g.test(str)
|
||||
}
|
||||
|
||||
|
||||
|
@ -2,29 +2,29 @@ import JSEncrypt from 'jsencrypt/bin/jsencrypt'
|
||||
|
||||
// 密钥对生成 http://web.chacuo.net/netrsakeypair
|
||||
|
||||
const publicKey = 'MFwwDQYJKoZIhvcNAQEBBQADSwAwSAJBANL378k3RiZHWx5AfJqdH9xRNBmD9wGD\n' +
|
||||
'2iRe41HdTNF8RUhNnHit5NpMNtGL0NPTSSpPjjI1kJfVorRvaQerUgkCAwEAAQ=='
|
||||
const publicKey = 'MFwwDQYJKoZIhvcNAQEBBQADSwAwSAJBAKoR8mX0rGKLqzcWmOzbfj64K8ZIgOdH\n' +
|
||||
'nzkXSOVOZbFu/TJhZ7rFAN+eaGkl3C4buccQd/EjEsj9ir7ijT7h96MCAwEAAQ=='
|
||||
|
||||
const privateKey = 'MIIBUwIBADANBgkqhkiG9w0BAQEFAASCAT0wggE5AgEAAkEA0vfvyTdGJkdbHkB8\n' +
|
||||
'mp0f3FE0GYP3AYPaJF7jUd1M0XxFSE2ceK3k2kw20YvQ09NJKk+OMjWQl9WitG9p\n' +
|
||||
'B6tSCQIDAQABAkA2SimBrWC2/wvauBuYqjCFwLvYiRYqZKThUS3MZlebXJiLB+Ue\n' +
|
||||
'/gUifAAKIg1avttUZsHBHrop4qfJCwAI0+YRAiEA+W3NK/RaXtnRqmoUUkb59zsZ\n' +
|
||||
'UBLpvZgQPfj1MhyHDz0CIQDYhsAhPJ3mgS64NbUZmGWuuNKp5coY2GIj/zYDMJp6\n' +
|
||||
'vQIgUueLFXv/eZ1ekgz2Oi67MNCk5jeTF2BurZqNLR3MSmUCIFT3Q6uHMtsB9Eha\n' +
|
||||
'4u7hS31tj1UWE+D+ADzp59MGnoftAiBeHT7gDMuqeJHPL4b+kC+gzV4FGTfhR9q3\n' +
|
||||
'tTbklZkD2A=='
|
||||
const privateKey = 'MIIBVAIBADANBgkqhkiG9w0BAQEFAASCAT4wggE6AgEAAkEAqhHyZfSsYourNxaY\n' +
|
||||
'7Nt+PrgrxkiA50efORdI5U5lsW79MmFnusUA355oaSXcLhu5xxB38SMSyP2KvuKN\n' +
|
||||
'PuH3owIDAQABAkAfoiLyL+Z4lf4Myxk6xUDgLaWGximj20CUf+5BKKnlrK+Ed8gA\n' +
|
||||
'kM0HqoTt2UZwA5E2MzS4EI2gjfQhz5X28uqxAiEA3wNFxfrCZlSZHb0gn2zDpWow\n' +
|
||||
'cSxQAgiCstxGUoOqlW8CIQDDOerGKH5OmCJ4Z21v+F25WaHYPxCFMvwxpcw99Ecv\n' +
|
||||
'DQIgIdhDTIqD2jfYjPTY8Jj3EDGPbH2HHuffvflECt3Ek60CIQCFRlCkHpi7hthh\n' +
|
||||
'YhovyloRYsM+IS9h/0BzlEAuO0ktMQIgSPT3aFAgJYwKpqRYKlLDVcflZFCKY7u3\n' +
|
||||
'UP8iWi1Qw0Y='
|
||||
|
||||
// 加密
|
||||
export function encrypt(txt) {
|
||||
const encryptor = new JSEncrypt()
|
||||
encryptor.setPublicKey(publicKey) // 设置公钥
|
||||
return encryptor.encrypt(txt) // 对需要加密的数据进行加密
|
||||
return encryptor.encrypt(txt) // 对数据进行加密
|
||||
}
|
||||
|
||||
// 解密
|
||||
export function decrypt(txt) {
|
||||
const encryptor = new JSEncrypt()
|
||||
encryptor.setPrivateKey(privateKey)
|
||||
return encryptor.decrypt(txt)
|
||||
encryptor.setPrivateKey(privateKey) // 设置私钥
|
||||
return encryptor.decrypt(txt) // 对数据进行解密
|
||||
}
|
||||
|
||||
|
@ -30,30 +30,27 @@ service.interceptors.response.use(res => {
|
||||
// 未设置状态码则默认成功状态
|
||||
const code = res.data.code || 200;
|
||||
// 获取错误信息
|
||||
const message = errorCode[code] || res.data.msg || errorCode['default']
|
||||
const msg = errorCode[code] || res.data.msg || errorCode['default']
|
||||
if (code === 401) {
|
||||
MessageBox.confirm(
|
||||
'登录状态已过期,您可以继续留在该页面,或者重新登录',
|
||||
'系统提示',
|
||||
{
|
||||
MessageBox.confirm('登录状态已过期,您可以继续留在该页面,或者重新登录', '系统提示', {
|
||||
confirmButtonText: '重新登录',
|
||||
cancelButtonText: '取消',
|
||||
type: 'warning'
|
||||
}
|
||||
).then(() => {
|
||||
store.dispatch('LogOut').then(() => {
|
||||
location.reload() // 为了重新实例化vue-router对象 避免bug
|
||||
location.href = '/index';
|
||||
})
|
||||
})
|
||||
} else if (code === 500) {
|
||||
Message({
|
||||
message: message,
|
||||
message: msg,
|
||||
type: 'error'
|
||||
})
|
||||
return Promise.reject(new Error(message))
|
||||
return Promise.reject(new Error(msg))
|
||||
} else if (code !== 200) {
|
||||
Notification.error({
|
||||
title: message
|
||||
title: msg
|
||||
})
|
||||
return Promise.reject('error')
|
||||
} else {
|
||||
@ -62,8 +59,18 @@ service.interceptors.response.use(res => {
|
||||
},
|
||||
error => {
|
||||
console.log('err' + error)
|
||||
let { message } = error;
|
||||
if (message == "Network Error") {
|
||||
message = "后端接口连接异常";
|
||||
}
|
||||
else if (message.includes("timeout")) {
|
||||
message = "系统接口请求超时";
|
||||
}
|
||||
else if (message.includes("Request failed with status code")) {
|
||||
message = "系统接口" + message.substr(message.length - 3) + "异常";
|
||||
}
|
||||
Message({
|
||||
message: error.message,
|
||||
message: message,
|
||||
type: 'error',
|
||||
duration: 5 * 1000
|
||||
})
|
||||
|
@ -1,134 +1,148 @@
|
||||
/**
|
||||
* 通用js方法封装处理
|
||||
* Copyright (c) 2019 ruoyi
|
||||
*/
|
||||
|
||||
const baseURL = process.env.VUE_APP_BASE_API
|
||||
|
||||
// 日期格式化
|
||||
export function parseTime(time, pattern) {
|
||||
if (arguments.length === 0 || !time) {
|
||||
return null
|
||||
}
|
||||
const format = pattern || '{y}-{m}-{d} {h}:{i}:{s}'
|
||||
let date
|
||||
if (typeof time === 'object') {
|
||||
date = time
|
||||
} else {
|
||||
if ((typeof time === 'string') && (/^[0-9]+$/.test(time))) {
|
||||
time = parseInt(time)
|
||||
} else if (typeof time === 'string') {
|
||||
time = time.replace(new RegExp(/-/gm), '/');
|
||||
}
|
||||
if ((typeof time === 'number') && (time.toString().length === 10)) {
|
||||
time = time * 1000
|
||||
}
|
||||
date = new Date(time)
|
||||
}
|
||||
const formatObj = {
|
||||
y: date.getFullYear(),
|
||||
m: date.getMonth() + 1,
|
||||
d: date.getDate(),
|
||||
h: date.getHours(),
|
||||
i: date.getMinutes(),
|
||||
s: date.getSeconds(),
|
||||
a: date.getDay()
|
||||
}
|
||||
const time_str = format.replace(/{(y|m|d|h|i|s|a)+}/g, (result, key) => {
|
||||
let value = formatObj[key]
|
||||
// Note: getDay() returns 0 on Sunday
|
||||
if (key === 'a') { return ['日', '一', '二', '三', '四', '五', '六'][value] }
|
||||
if (result.length > 0 && value < 10) {
|
||||
value = '0' + value
|
||||
}
|
||||
return value || 0
|
||||
})
|
||||
return time_str
|
||||
}
|
||||
|
||||
// 表单重置
|
||||
export function resetForm(refName) {
|
||||
if (this.$refs[refName]) {
|
||||
this.$refs[refName].resetFields();
|
||||
}
|
||||
}
|
||||
|
||||
// 添加日期范围
|
||||
export function addDateRange(params, dateRange) {
|
||||
var search = params;
|
||||
search.beginTime = "";
|
||||
search.endTime = "";
|
||||
if (null != dateRange && '' != dateRange) {
|
||||
search.beginTime = this.dateRange[0];
|
||||
search.endTime = this.dateRange[1];
|
||||
}
|
||||
return search;
|
||||
}
|
||||
|
||||
// 回显数据字典
|
||||
export function selectDictLabel(datas, value) {
|
||||
var actions = [];
|
||||
Object.keys(datas).map((key) => {
|
||||
if (datas[key].dictValue == ('' + value)) {
|
||||
actions.push(datas[key].dictLabel);
|
||||
return false;
|
||||
}
|
||||
})
|
||||
return actions.join('');
|
||||
}
|
||||
|
||||
// 通用下载方法
|
||||
export function download(fileName) {
|
||||
window.location.href = baseURL + "/common/download?fileName=" + encodeURI(fileName) + "&delete=" + true;
|
||||
}
|
||||
|
||||
// 字符串格式化(%s )
|
||||
export function sprintf(str) {
|
||||
var args = arguments, flag = true, i = 1;
|
||||
str = str.replace(/%s/g, function () {
|
||||
var arg = args[i++];
|
||||
if (typeof arg === 'undefined') {
|
||||
flag = false;
|
||||
return '';
|
||||
}
|
||||
return arg;
|
||||
});
|
||||
return flag ? str : '';
|
||||
}
|
||||
|
||||
// 转换字符串,undefined,null等转化为""
|
||||
export function praseStrEmpty(str) {
|
||||
if (!str || str == "undefined" || str == "null") {
|
||||
return "";
|
||||
}
|
||||
return str;
|
||||
}
|
||||
|
||||
/**
|
||||
* 构造树型结构数据
|
||||
* @param {*} data 数据源
|
||||
* @param {*} id id字段 默认 'id'
|
||||
* @param {*} parentId 父节点字段 默认 'parentId'
|
||||
* @param {*} children 孩子节点字段 默认 'children'
|
||||
* @param {*} rootId 根Id 默认 0
|
||||
*/
|
||||
export function handleTree(data, id, parentId, children, rootId) {
|
||||
id = id || 'id'
|
||||
parentId = parentId || 'parentId'
|
||||
children = children || 'children'
|
||||
rootId = rootId || 0
|
||||
//对源数据深度克隆
|
||||
const cloneData = JSON.parse(JSON.stringify(data))
|
||||
//循环所有项
|
||||
const treeData = cloneData.filter(father => {
|
||||
let branchArr = cloneData.filter(child => {
|
||||
//返回每一项的子级数组
|
||||
return father[id] === child[parentId]
|
||||
});
|
||||
branchArr.length > 0 ? father.children = branchArr : '';
|
||||
//返回第一层
|
||||
return father[parentId] === rootId;
|
||||
});
|
||||
return treeData != '' ? treeData : data;
|
||||
}
|
||||
|
||||
/**
|
||||
* 通用js方法封装处理
|
||||
* Copyright (c) 2019 ruoyi
|
||||
*/
|
||||
|
||||
const baseURL = process.env.VUE_APP_BASE_API
|
||||
|
||||
// 日期格式化
|
||||
export function parseTime(time, pattern) {
|
||||
if (arguments.length === 0 || !time) {
|
||||
return null
|
||||
}
|
||||
const format = pattern || '{y}-{m}-{d} {h}:{i}:{s}'
|
||||
let date
|
||||
if (typeof time === 'object') {
|
||||
date = time
|
||||
} else {
|
||||
if ((typeof time === 'string') && (/^[0-9]+$/.test(time))) {
|
||||
time = parseInt(time)
|
||||
} else if (typeof time === 'string') {
|
||||
time = time.replace(new RegExp(/-/gm), '/');
|
||||
}
|
||||
if ((typeof time === 'number') && (time.toString().length === 10)) {
|
||||
time = time * 1000
|
||||
}
|
||||
date = new Date(time)
|
||||
}
|
||||
const formatObj = {
|
||||
y: date.getFullYear(),
|
||||
m: date.getMonth() + 1,
|
||||
d: date.getDate(),
|
||||
h: date.getHours(),
|
||||
i: date.getMinutes(),
|
||||
s: date.getSeconds(),
|
||||
a: date.getDay()
|
||||
}
|
||||
const time_str = format.replace(/{(y|m|d|h|i|s|a)+}/g, (result, key) => {
|
||||
let value = formatObj[key]
|
||||
// Note: getDay() returns 0 on Sunday
|
||||
if (key === 'a') { return ['日', '一', '二', '三', '四', '五', '六'][value] }
|
||||
if (result.length > 0 && value < 10) {
|
||||
value = '0' + value
|
||||
}
|
||||
return value || 0
|
||||
})
|
||||
return time_str
|
||||
}
|
||||
|
||||
// 表单重置
|
||||
export function resetForm(refName) {
|
||||
if (this.$refs[refName]) {
|
||||
this.$refs[refName].resetFields();
|
||||
}
|
||||
}
|
||||
|
||||
// 添加日期范围
|
||||
export function addDateRange(params, dateRange) {
|
||||
var search = params;
|
||||
search.beginTime = "";
|
||||
search.endTime = "";
|
||||
if (null != dateRange && '' != dateRange) {
|
||||
search.beginTime = dateRange[0];
|
||||
search.endTime = dateRange[1];
|
||||
}
|
||||
return search;
|
||||
}
|
||||
|
||||
// 回显数据字典
|
||||
export function selectDictLabel(datas, value) {
|
||||
var actions = [];
|
||||
Object.keys(datas).some((key) => {
|
||||
if (datas[key].dictValue == ('' + value)) {
|
||||
actions.push(datas[key].dictLabel);
|
||||
return true;
|
||||
}
|
||||
})
|
||||
return actions.join('');
|
||||
}
|
||||
|
||||
// 回显数据字典(字符串数组)
|
||||
export function selectDictLabels(datas, value, separator) {
|
||||
var actions = [];
|
||||
var currentSeparator = undefined === separator ? "," : separator;
|
||||
var temp = value.split(currentSeparator);
|
||||
Object.keys(value.split(currentSeparator)).some((val) => {
|
||||
Object.keys(datas).some((key) => {
|
||||
if (datas[key].dictValue == ('' + temp[val])) {
|
||||
actions.push(datas[key].dictLabel + currentSeparator);
|
||||
}
|
||||
})
|
||||
})
|
||||
return actions.join('').substring(0, actions.join('').length - 1);
|
||||
}
|
||||
|
||||
// 通用下载方法
|
||||
export function download(fileName) {
|
||||
window.location.href = baseURL + "/common/download?fileName=" + encodeURI(fileName) + "&delete=" + true;
|
||||
}
|
||||
|
||||
// 字符串格式化(%s )
|
||||
export function sprintf(str) {
|
||||
var args = arguments, flag = true, i = 1;
|
||||
str = str.replace(/%s/g, function () {
|
||||
var arg = args[i++];
|
||||
if (typeof arg === 'undefined') {
|
||||
flag = false;
|
||||
return '';
|
||||
}
|
||||
return arg;
|
||||
});
|
||||
return flag ? str : '';
|
||||
}
|
||||
|
||||
// 转换字符串,undefined,null等转化为""
|
||||
export function praseStrEmpty(str) {
|
||||
if (!str || str == "undefined" || str == "null") {
|
||||
return "";
|
||||
}
|
||||
return str;
|
||||
}
|
||||
|
||||
/**
|
||||
* 构造树型结构数据
|
||||
* @param {*} data 数据源
|
||||
* @param {*} id id字段 默认 'id'
|
||||
* @param {*} parentId 父节点字段 默认 'parentId'
|
||||
* @param {*} children 孩子节点字段 默认 'children'
|
||||
* @param {*} rootId 根Id 默认 0
|
||||
*/
|
||||
export function handleTree(data, id, parentId, children, rootId) {
|
||||
id = id || 'id'
|
||||
parentId = parentId || 'parentId'
|
||||
children = children || 'children'
|
||||
rootId = rootId || Math.min.apply(Math, data.map(item => { return item[parentId] })) || 0
|
||||
//对源数据深度克隆
|
||||
const cloneData = JSON.parse(JSON.stringify(data))
|
||||
//循环所有项
|
||||
const treeData = cloneData.filter(father => {
|
||||
let branchArr = cloneData.filter(child => {
|
||||
//返回每一项的子级数组
|
||||
return father[id] === child[parentId]
|
||||
});
|
||||
branchArr.length > 0 ? father.children = branchArr : '';
|
||||
//返回第一层
|
||||
return father[parentId] === rootId;
|
||||
});
|
||||
return treeData != '' ? treeData : data;
|
||||
}
|
||||
|
@ -1,98 +1,512 @@
|
||||
<template>
|
||||
<div class="dashboard-editor-container">
|
||||
<div class="app-container home">
|
||||
<el-row :gutter="20">
|
||||
<el-col :sm="24" :lg="24">
|
||||
<blockquote class="text-warning" style="font-size: 14px">
|
||||
领取阿里云通用云产品1888优惠券
|
||||
<br />
|
||||
<el-link
|
||||
href="https://www.aliyun.com/minisite/goods?userCode=brki8iof"
|
||||
type="primary"
|
||||
target="_blank"
|
||||
>https://www.aliyun.com/minisite/goods?userCode=brki8iof</el-link
|
||||
>
|
||||
<br />
|
||||
领取腾讯云通用云产品2860优惠券
|
||||
<br />
|
||||
<el-link
|
||||
href="https://cloud.tencent.com/redirect.php?redirect=1025&cps_key=198c8df2ed259157187173bc7f4f32fd&from=console"
|
||||
type="primary"
|
||||
target="_blank"
|
||||
>https://cloud.tencent.com/redirect.php?redirect=1025&cps_key=198c8df2ed259157187173bc7f4f32fd&from=console</el-link
|
||||
>
|
||||
<br />
|
||||
阿里云服务器折扣区
|
||||
<el-link href="http://aly.ruoyi.vip" type="primary" target="_blank"
|
||||
>>☛☛点我进入☚☚</el-link
|
||||
>
|
||||
腾讯云服务器秒杀区
|
||||
<el-link href="http://txy.ruoyi.vip" type="primary" target="_blank"
|
||||
>>☛☛点我进入☚☚</el-link
|
||||
><br />
|
||||
<h4 class="text-danger">
|
||||
云产品通用红包,可叠加官网常规优惠使用。(仅限新用户)
|
||||
</h4>
|
||||
</blockquote>
|
||||
|
||||
<panel-group @handleSetLineChartData="handleSetLineChartData" />
|
||||
|
||||
<el-row style="background:#fff;padding:16px 16px 0;margin-bottom:32px;">
|
||||
<line-chart :chart-data="lineChartData" />
|
||||
</el-row>
|
||||
|
||||
<el-row :gutter="32">
|
||||
<el-col :xs="24" :sm="24" :lg="8">
|
||||
<div class="chart-wrapper">
|
||||
<raddar-chart />
|
||||
</div>
|
||||
</el-col>
|
||||
<el-col :xs="24" :sm="24" :lg="8">
|
||||
<div class="chart-wrapper">
|
||||
<pie-chart />
|
||||
</div>
|
||||
</el-col>
|
||||
<el-col :xs="24" :sm="24" :lg="8">
|
||||
<div class="chart-wrapper">
|
||||
<bar-chart />
|
||||
</div>
|
||||
<hr />
|
||||
</el-col>
|
||||
</el-row>
|
||||
<el-row :gutter="20">
|
||||
<el-col :sm="24" :lg="12" style="padding-left: 20px">
|
||||
<h2>若依后台管理框架</h2>
|
||||
<p>
|
||||
一直想做一款后台管理系统,看了很多优秀的开源项目但是发现没有合适自己的。于是利用空闲休息时间开始自己写一套后台系统。如此有了若依管理系统。,她可以用于所有的Web应用程序,如网站管理后台,网站会员中心,CMS,CRM,OA等等,当然,您也可以对她进行深度定制,以做出更强系统。所有前端后台代码封装过后十分精简易上手,出错概率低。同时支持移动客户端访问。系统会陆续更新一些实用功能。
|
||||
</p>
|
||||
<p>
|
||||
<b>当前版本:</b> <span>v{{ version }}</span>
|
||||
</p>
|
||||
<p>
|
||||
<el-tag type="danger">¥免费开源</el-tag>
|
||||
</p>
|
||||
<p>
|
||||
<el-button
|
||||
type="primary"
|
||||
size="mini"
|
||||
icon="el-icon-cloudy"
|
||||
plain
|
||||
@click="goTarget('https://gitee.com/y_project/RuoYi-Vue')"
|
||||
>访问码云</el-button
|
||||
>
|
||||
<el-button
|
||||
size="mini"
|
||||
icon="el-icon-s-home"
|
||||
plain
|
||||
@click="goTarget('http://ruoyi.vip')"
|
||||
>访问主页</el-button
|
||||
>
|
||||
</p>
|
||||
</el-col>
|
||||
|
||||
|
||||
<el-col :sm="24" :lg="12" style="padding-left: 50px">
|
||||
<el-row>
|
||||
<el-col :span="12">
|
||||
<h2>技术选型</h2>
|
||||
</el-col>
|
||||
</el-row>
|
||||
<el-row>
|
||||
<el-col :span="6">
|
||||
<h4>后端技术</h4>
|
||||
<ul>
|
||||
<li>SpringBoot</li>
|
||||
<li>Spring Security</li>
|
||||
<li>JWT</li>
|
||||
<li>MyBatis</li>
|
||||
<li>Druid</li>
|
||||
<li>Fastjson</li>
|
||||
<li>...</li>
|
||||
</ul>
|
||||
</el-col>
|
||||
<el-col :span="6">
|
||||
<h4>前端技术</h4>
|
||||
<ul>
|
||||
<li>Vue</li>
|
||||
<li>Vuex</li>
|
||||
<li>Element-ui</li>
|
||||
<li>Axios</li>
|
||||
<li>Sass</li>
|
||||
<li>Quill</li>
|
||||
<li>...</li>
|
||||
</ul>
|
||||
</el-col>
|
||||
</el-row>
|
||||
</el-col>
|
||||
</el-row>
|
||||
<el-divider />
|
||||
<el-row :gutter="20">
|
||||
<el-col :xs="24" :sm="24" :md="12" :lg="8">
|
||||
<el-card class="update-log">
|
||||
<div slot="header" class="clearfix">
|
||||
<span>联系信息</span>
|
||||
</div>
|
||||
<div class="body">
|
||||
<p>
|
||||
<i class="el-icon-s-promotion"></i> 官网:<el-link
|
||||
href="http://www.ruoyi.vip"
|
||||
target="_blank"
|
||||
>http://www.ruoyi.vip</el-link
|
||||
>
|
||||
</p>
|
||||
<p>
|
||||
<i class="el-icon-user-solid"></i> QQ群:<s>满937441</s>
|
||||
<s>满887144332</s> <s>满180251782</s>
|
||||
<a href="https://jq.qq.com/?_wv=1027&k=4WWwqNxN" target="_blank"
|
||||
> 104180207</a
|
||||
>
|
||||
</p>
|
||||
<p>
|
||||
<i class="el-icon-chat-dot-round"></i> 微信:<a
|
||||
href="javascript:;"
|
||||
>/ *若依</a
|
||||
>
|
||||
</p>
|
||||
<p>
|
||||
<i class="el-icon-money"></i> 支付宝:<a
|
||||
href="javascript:;"
|
||||
class="支付宝信息"
|
||||
>/ *若依</a
|
||||
>
|
||||
</p>
|
||||
</div>
|
||||
</el-card>
|
||||
</el-col>
|
||||
<el-col :xs="24" :sm="24" :md="12" :lg="8">
|
||||
<el-card class="update-log">
|
||||
<div slot="header" class="clearfix">
|
||||
<span>更新日志</span>
|
||||
</div>
|
||||
<el-collapse accordion>
|
||||
<el-collapse-item title="v3.2.1 - 2020-11-18">
|
||||
<ol>
|
||||
<li>阻止任意文件下载漏洞</li>
|
||||
<li>代码生成支持上传控件</li>
|
||||
<li>新增图片上传组件</li>
|
||||
<li>调整默认首页</li>
|
||||
<li>升级druid到最新版本v1.2.2</li>
|
||||
<li>mapperLocations配置支持分隔符</li>
|
||||
<li>权限信息调整</li>
|
||||
<li>调整sql默认时间</li>
|
||||
<li>解决代码生成没有bit类型的问题</li>
|
||||
<li>升级pagehelper到最新版1.3.0</li>
|
||||
</ol>
|
||||
</el-collapse-item>
|
||||
<el-collapse-item title="v3.2.0 - 2020-10-10">
|
||||
<ol>
|
||||
<li>升级springboot版本到2.1.17 提升安全性</li>
|
||||
<li>升级oshi到最新版本v5.2.5</li>
|
||||
<li>升级druid到最新版本v1.2.1</li>
|
||||
<li>升级jjwt到版本0.9.1</li>
|
||||
<li>升级fastjson到最新版1.2.74</li>
|
||||
<li>修改sass为node-sass,避免el-icon图标乱码</li>
|
||||
<li>代码生成支持同步数据库</li>
|
||||
<li>代码生成支持富文本控件</li>
|
||||
<li>代码生成页面时不忽略remark属性</li>
|
||||
<li>代码生成添加select必填选项</li>
|
||||
<li>Excel导出类型NUMERIC支持精度浮点类型</li>
|
||||
<li>Excel导出targetAttr优化获取值,防止get方法不规范</li>
|
||||
<li>Excel注解支持自动统计数据总和</li>
|
||||
<li>Excel注解支持设置BigDecimal精度&舍入规则</li>
|
||||
<li>菜单&数据权限新增(展开/折叠 全选/全不选 父子联动)</li>
|
||||
<li>允许用户分配到部门父节点</li>
|
||||
<li>菜单新增是否缓存keep-alive</li>
|
||||
<li>表格操作列间距调整</li>
|
||||
<li>限制系统内置参数不允许删除</li>
|
||||
<li>富文本组件优化,支持自定义高度&图片冲突问题</li>
|
||||
<li>富文本工具栏样式对齐</li>
|
||||
<li>导入excel整形值校验优化</li>
|
||||
<li>修复页签关闭所有时固定标签路由不刷新问题</li>
|
||||
<li>表单构建布局型组件新增按钮</li>
|
||||
<li>左侧菜单文字过长显示省略号</li>
|
||||
<li>修正根节点为子部门时,树状结构显示问题</li>
|
||||
<li>修正调用目标字符串最大长度</li>
|
||||
<li>修正菜单提示信息错误</li>
|
||||
<li>修正定时任务执行一次权限标识</li>
|
||||
<li>修正数据库字符串类型nvarchar</li>
|
||||
<li>优化递归子节点</li>
|
||||
<li>优化数据权限判断</li>
|
||||
<li>其他细节优化</li>
|
||||
</ol>
|
||||
</el-collapse-item>
|
||||
|
||||
<el-collapse-item title="v3.1.0 - 2020-08-13">
|
||||
<ol>
|
||||
<li>表格工具栏右侧添加刷新&显隐查询组件</li>
|
||||
<li>后端支持CORS跨域请求</li>
|
||||
<li>代码生成支持选择上级菜单</li>
|
||||
<li>代码生成支持自定义路径</li>
|
||||
<li>代码生成支持复选框</li>
|
||||
<li>Excel导出导入支持dictType字典类型</li>
|
||||
<li>Excel支持分割字符串组内容</li>
|
||||
<li>验证码类型支持(数组计算、字符验证)</li>
|
||||
<li>升级vue-cli版本到4.4.4</li>
|
||||
<li>修改 node-sass 为 dart-sass</li>
|
||||
<li>表单类型为Integer/Long设置整形默认值</li>
|
||||
<li>代码生成器默认mapper路径与默认mapperScan路径不一致</li>
|
||||
<li>优化防重复提交拦截器</li>
|
||||
<li>优化上级菜单不能选择自己</li>
|
||||
<li>修复角色的权限分配后,未实时生效问题</li>
|
||||
<li>修复在线用户日志记录类型</li>
|
||||
<li>修复富文本空格和缩进保存后不生效问题</li>
|
||||
<li>修复在线用户判断逻辑</li>
|
||||
<li>唯一限制条件只返回单条数据</li>
|
||||
<li>添加获取当前的环境配置方法</li>
|
||||
<li>超时登录后页面跳转到首页</li>
|
||||
<li>全局异常状态汉化拦截处理</li>
|
||||
<li>HTML过滤器改为将html转义</li>
|
||||
<li>检查字符支持小数点&降级改成异常提醒</li>
|
||||
<li>其他细节优化</li>
|
||||
</ol>
|
||||
</el-collapse-item>
|
||||
|
||||
<el-collapse-item title="v3.0.0 - 2020-07-20">
|
||||
<ol>
|
||||
<li>单应用调整为多模块项目</li>
|
||||
<li>升级element-ui版本到2.13.2</li>
|
||||
<li>删除babel,提高编译速度。</li>
|
||||
<li>新增菜单默认主类目</li>
|
||||
<li>编码文件名修改为uuid方式</li>
|
||||
<li>定时任务cron表达式验证</li>
|
||||
<li>角色权限修改时已有权限未自动勾选异常修复</li>
|
||||
<li>防止切换权限用户后登录出现404</li>
|
||||
<li>Excel支持sort导出排序</li>
|
||||
<li>创建用户不允许选择超级管理员角色</li>
|
||||
<li>修复代码生成导入表结构出现异常页面不提醒问题</li>
|
||||
<li>修复代码生成点击多次表修改数据不变化的问题</li>
|
||||
<li>修复头像上传成功二次打开无法改变裁剪框大小和位置问题</li>
|
||||
<li>修复布局为small者mini用户表单显示错位问题</li>
|
||||
<li>修复热部署导致的强换异常问题</li>
|
||||
<li>修改用户管理复选框宽度,防止部分浏览器出现省略号</li>
|
||||
<li>IpUtils工具,清除Xss特殊字符,防止Xff注入攻击</li>
|
||||
<li>生成domain 如果是浮点型 统一用BigDecimal</li>
|
||||
<li>定时任务调整label-width,防止部署出现错位</li>
|
||||
<li>调整表头固定列默认样式</li>
|
||||
<li>代码生成模板调整,字段为String并且必填则加空串条件</li>
|
||||
<li>代码生成字典Integer/Long使用parseInt</li>
|
||||
<li>
|
||||
修复dict_sort不可update为0的问题&查询返回增加dict_sort升序排序
|
||||
</li>
|
||||
<li>修正岗位导出权限注解</li>
|
||||
<li>禁止加密密文返回前端</li>
|
||||
<li>修复代码生成页面中的查询条件创建时间未生效的问题</li>
|
||||
<li>修复首页搜索菜单外链无法点击跳转问题</li>
|
||||
<li>修复菜单管理选择图标,backspace删除时不过滤数据</li>
|
||||
<li>用户管理部门分支节点不可检查&显示计数</li>
|
||||
<li>数据范围过滤属性调整</li>
|
||||
<li>其他细节优化</li>
|
||||
</ol>
|
||||
</el-collapse-item>
|
||||
|
||||
<el-collapse-item title="v2.3.0 - 2020-06-01">
|
||||
<ol>
|
||||
<li>升级fastjson到最新版1.2.70 修复高危安全漏洞</li>
|
||||
<li>dev启动默认打开浏览器</li>
|
||||
<li>vue-cli使用默认source-map</li>
|
||||
<li>slidebar eslint报错优化</li>
|
||||
<li>当tags-view滚动关闭右键菜单</li>
|
||||
<li>字典管理添加缓存读取</li>
|
||||
<li>参数管理支持缓存操作</li>
|
||||
<li>支持一级菜单(和主页同级)在main区域显示</li>
|
||||
<li>限制外链地址必须以http(s)开头</li>
|
||||
<li>tagview & sidebar 主题颜色与element ui(全局)同步</li>
|
||||
<li>修改数据源类型优先级,先根据方法,再根据类</li>
|
||||
<li>支持是否需要设置token属性,自定义返回码消息。</li>
|
||||
<li>swagger请求前缀加入配置。</li>
|
||||
<li>登录地点设置内容过长则隐藏显示</li>
|
||||
<li>修复定时任务执行一次按钮后不提示消息问题</li>
|
||||
<li>修改上级部门(选择项排除本身和下级)</li>
|
||||
<li>通用http发送方法增加参数 contentType 编码类型</li>
|
||||
<li>更换IP地址查询接口</li>
|
||||
<li>修复页签变量undefined</li>
|
||||
<li>添加校验部门包含未停用的子部门</li>
|
||||
<li>修改定时任务详情下次执行时间日期显示错误</li>
|
||||
<li>角色管理查询设置默认排序字段</li>
|
||||
<li>swagger添加enable参数控制是否启用</li>
|
||||
<li>只对json类型请求构建可重复读取inputStream的request</li>
|
||||
<li>修改代码生成字典字段int类型没有自动选中问题</li>
|
||||
<li>vuex用户名取值修正</li>
|
||||
<li>表格树模板去掉多余的)</li>
|
||||
<li>代码生成序号修正</li>
|
||||
<li>全屏情况下不调整上外边距</li>
|
||||
<li>代码生成Date字段添加默认格式</li>
|
||||
<li>用户管理角色选择权限控制</li>
|
||||
<li>修复路由懒加载报错问题</li>
|
||||
<li>模板sql.vm添加菜单状态</li>
|
||||
<li>设置用户名称不能修改</li>
|
||||
<li>dialog添加append-to-body属性,防止ie遮罩</li>
|
||||
<li>菜单区分状态和显示隐藏功能</li>
|
||||
<li>升级fastjson到最新版1.2.68 修复安全加固</li>
|
||||
<li>修复代码生成如果选择字典类型缺失逗号问题</li>
|
||||
<li>登录请求params更换为data,防止暴露url</li>
|
||||
<li>日志返回时间格式处理</li>
|
||||
<li>添加handle控制允许拖动的元素</li>
|
||||
<li>布局设置点击扩大范围</li>
|
||||
<li>代码生成列属性排序查询</li>
|
||||
<li>代码生成列支持拖动排序</li>
|
||||
<li>修复时间格式不支持ios问题</li>
|
||||
<li>表单构建添加父级class,防止冲突</li>
|
||||
<li>定时任务并发属性修正</li>
|
||||
<li>角色禁用&菜单隐藏不查询权限</li>
|
||||
<li>其他细节优化</li>
|
||||
</ol>
|
||||
</el-collapse-item>
|
||||
|
||||
<el-collapse-item title="v2.2.0 - 2020-03-18">
|
||||
<ol>
|
||||
<li>系统监控新增定时任务功能</li>
|
||||
<li>添加一个打包Web工程bat</li>
|
||||
<li>修复页签鼠标滚轮按下的时候,可以关闭不可关闭的tag</li>
|
||||
<li>修复点击退出登录有时会无提示问题</li>
|
||||
<li>修复防重复提交注解无效问题</li>
|
||||
<li>修复通知公告批量删除异常问题</li>
|
||||
<li>添加菜单时路由地址必填限制</li>
|
||||
<li>代码生成字段描述可编辑</li>
|
||||
<li>修复用户修改个人信息导致缓存不过期问题</li>
|
||||
<li>个人信息创建时间获取正确属性值</li>
|
||||
<li>操作日志详细显示正确类型</li>
|
||||
<li>导入表单击行数据时选中对应的复选框</li>
|
||||
<li>批量替换表前缀逻辑调整</li>
|
||||
<li>固定重定向路径表达式</li>
|
||||
<li>升级element-ui版本到2.13.0</li>
|
||||
<li>操作日志排序调整</li>
|
||||
<li>修复charts切换侧边栏或者缩放窗口显示bug</li>
|
||||
<li>其他细节优化</li>
|
||||
</ol>
|
||||
</el-collapse-item>
|
||||
|
||||
<el-collapse-item title="v2.1.0 - 2020-02-24">
|
||||
<ol>
|
||||
<li>新增表单构建</li>
|
||||
<li>代码生成支持树表结构</li>
|
||||
<li>新增用户导入</li>
|
||||
<li>修复动态加载路由页面刷新问题</li>
|
||||
<li>修复地址开关无效问题</li>
|
||||
<li>汉化错误提示页面</li>
|
||||
<li>代码生成已知问题修改</li>
|
||||
<li>修复多数据源下配置关闭出现异常处理</li>
|
||||
<li>添加HTML过滤器,用于去除XSS漏洞隐患</li>
|
||||
<li>修复上传头像控制台出现异常</li>
|
||||
<li>修改用户管理分页不正确的问题</li>
|
||||
<li>修复验证码记录提示错误</li>
|
||||
<li>修复request.js缺少Message引用</li>
|
||||
<li>修复表格时间为空出现的异常</li>
|
||||
<li>添加Jackson日期反序列化时区配置</li>
|
||||
<li>调整根据用户权限加载菜单数据树形结构</li>
|
||||
<li>调整成功登陆不恢复按钮,防止多次点击</li>
|
||||
<li>修改用户个人资料同步缓存信息</li>
|
||||
<li>修复页面同时出现el-upload和Editor不显示处理</li>
|
||||
<li>修复在角色管理页修改菜单权限偶尔未选中问题</li>
|
||||
<li>配置文件新增redis密码属性</li>
|
||||
<li>设置mybatis全局的配置文件</li>
|
||||
<li>其他细节优化</li>
|
||||
</ol>
|
||||
</el-collapse-item>
|
||||
|
||||
<el-collapse-item title="v2.0.0 - 2019-12-02">
|
||||
<ol>
|
||||
<li>新增代码生成</li>
|
||||
<li>新增@RepeatSubmit注解,防止重复提交</li>
|
||||
<li>新增菜单主目录添加/删除操作</li>
|
||||
<li>日志记录过滤特殊对象,防止转换异常</li>
|
||||
<li>修改代码生成路由脚本错误</li>
|
||||
<li>用户上传头像实时同步缓存,无需重新登录</li>
|
||||
<li>调整切换页签后不重新加载数据</li>
|
||||
<li>添加jsencrypt实现参数的前端加密</li>
|
||||
<li>系统退出删除用户缓存记录</li>
|
||||
<li>其他细节优化</li>
|
||||
</ol>
|
||||
</el-collapse-item>
|
||||
<el-collapse-item title="v1.1.0 - 2019-11-11">
|
||||
<ol>
|
||||
<li>新增在线用户管理</li>
|
||||
<li>新增按钮组功能实现(批量删除、导出、清空)</li>
|
||||
<li>新增查询条件重置按钮</li>
|
||||
<li>新增Swagger全局Token配置</li>
|
||||
<li>新增后端参数校验</li>
|
||||
<li>修复字典管理页面的日期查询异常</li>
|
||||
<li>修改时间函数命名防止冲突</li>
|
||||
<li>去除菜单上级校验,默认为顶级</li>
|
||||
<li>修复用户密码无法修改问题</li>
|
||||
<li>修复菜单类型为按钮时不显示权限标识</li>
|
||||
<li>其他细节优化</li>
|
||||
</ol>
|
||||
</el-collapse-item>
|
||||
<el-collapse-item title="v1.0.0 - 2019-10-08">
|
||||
<ol>
|
||||
<li>若依前后端分离系统正式发布</li>
|
||||
</ol>
|
||||
</el-collapse-item>
|
||||
</el-collapse>
|
||||
</el-card>
|
||||
</el-col>
|
||||
<el-col :xs="24" :sm="24" :md="12" :lg="8">
|
||||
<el-card class="update-log">
|
||||
<div slot="header" class="clearfix">
|
||||
<span>捐赠支持</span>
|
||||
</div>
|
||||
<div class="body">
|
||||
<img
|
||||
src="https://oscimg.oschina.net/oscnet/up-d6695f82666e5018f715c41cb7ee60d3b73.png"
|
||||
alt="donate"
|
||||
width="100%"
|
||||
/>
|
||||
<span style="display: inline-block; height: 30px; line-height: 30px"
|
||||
>你可以请作者喝杯咖啡表示鼓励</span
|
||||
>
|
||||
</div>
|
||||
</el-card>
|
||||
</el-col>
|
||||
</el-row>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import PanelGroup from './dashboard/PanelGroup'
|
||||
import LineChart from './dashboard/LineChart'
|
||||
import RaddarChart from './dashboard/RaddarChart'
|
||||
import PieChart from './dashboard/PieChart'
|
||||
import BarChart from './dashboard/BarChart'
|
||||
|
||||
const lineChartData = {
|
||||
newVisitis: {
|
||||
expectedData: [100, 120, 161, 134, 105, 160, 165],
|
||||
actualData: [120, 82, 91, 154, 162, 140, 145]
|
||||
},
|
||||
messages: {
|
||||
expectedData: [200, 192, 120, 144, 160, 130, 140],
|
||||
actualData: [180, 160, 151, 106, 145, 150, 130]
|
||||
},
|
||||
purchases: {
|
||||
expectedData: [80, 100, 121, 104, 105, 90, 100],
|
||||
actualData: [120, 90, 100, 138, 142, 130, 130]
|
||||
},
|
||||
shoppings: {
|
||||
expectedData: [130, 140, 141, 142, 145, 150, 160],
|
||||
actualData: [120, 82, 91, 154, 162, 140, 130]
|
||||
}
|
||||
}
|
||||
|
||||
export default {
|
||||
name: 'Index',
|
||||
components: {
|
||||
PanelGroup,
|
||||
LineChart,
|
||||
RaddarChart,
|
||||
PieChart,
|
||||
BarChart
|
||||
},
|
||||
name: "index",
|
||||
data() {
|
||||
return {
|
||||
lineChartData: lineChartData.newVisitis
|
||||
}
|
||||
// 版本号
|
||||
version: "3.2.1",
|
||||
};
|
||||
},
|
||||
methods: {
|
||||
handleSetLineChartData(type) {
|
||||
this.lineChartData = lineChartData[type]
|
||||
}
|
||||
}
|
||||
}
|
||||
goTarget(href) {
|
||||
window.open(href, "_blank");
|
||||
},
|
||||
},
|
||||
};
|
||||
</script>
|
||||
|
||||
<style lang="scss" scoped>
|
||||
.dashboard-editor-container {
|
||||
padding: 32px;
|
||||
background-color: rgb(240, 242, 245);
|
||||
position: relative;
|
||||
|
||||
.chart-wrapper {
|
||||
background: #fff;
|
||||
padding: 16px 16px 0;
|
||||
margin-bottom: 32px;
|
||||
<style scoped lang="scss">
|
||||
.home {
|
||||
blockquote {
|
||||
padding: 10px 20px;
|
||||
margin: 0 0 20px;
|
||||
font-size: 17.5px;
|
||||
border-left: 5px solid #eee;
|
||||
}
|
||||
hr {
|
||||
margin-top: 20px;
|
||||
margin-bottom: 20px;
|
||||
border: 0;
|
||||
border-top: 1px solid #eee;
|
||||
}
|
||||
.col-item {
|
||||
margin-bottom: 20px;
|
||||
}
|
||||
}
|
||||
|
||||
@media (max-width:1024px) {
|
||||
.chart-wrapper {
|
||||
padding: 8px;
|
||||
ul {
|
||||
padding: 0;
|
||||
margin: 0;
|
||||
}
|
||||
|
||||
font-family: "open sans", "Helvetica Neue", Helvetica, Arial, sans-serif;
|
||||
font-size: 13px;
|
||||
color: #676a6c;
|
||||
overflow-x: hidden;
|
||||
|
||||
ul {
|
||||
list-style-type: none;
|
||||
}
|
||||
|
||||
h4 {
|
||||
margin-top: 0px;
|
||||
}
|
||||
|
||||
h2 {
|
||||
margin-top: 10px;
|
||||
font-size: 26px;
|
||||
font-weight: 100;
|
||||
}
|
||||
|
||||
p {
|
||||
margin-top: 10px;
|
||||
|
||||
b {
|
||||
font-weight: 700;
|
||||
}
|
||||
}
|
||||
|
||||
.update-log {
|
||||
ol {
|
||||
display: block;
|
||||
list-style-type: decimal;
|
||||
margin-block-start: 1em;
|
||||
margin-block-end: 1em;
|
||||
margin-inline-start: 0;
|
||||
margin-inline-end: 0;
|
||||
padding-inline-start: 40px;
|
||||
}
|
||||
}
|
||||
}
|
||||
</style>
|
||||
|
||||
|
98
ruoyi-ui/src/views/index_v1.vue
Normal file
98
ruoyi-ui/src/views/index_v1.vue
Normal file
@ -0,0 +1,98 @@
|
||||
<template>
|
||||
<div class="dashboard-editor-container">
|
||||
|
||||
<panel-group @handleSetLineChartData="handleSetLineChartData" />
|
||||
|
||||
<el-row style="background:#fff;padding:16px 16px 0;margin-bottom:32px;">
|
||||
<line-chart :chart-data="lineChartData" />
|
||||
</el-row>
|
||||
|
||||
<el-row :gutter="32">
|
||||
<el-col :xs="24" :sm="24" :lg="8">
|
||||
<div class="chart-wrapper">
|
||||
<raddar-chart />
|
||||
</div>
|
||||
</el-col>
|
||||
<el-col :xs="24" :sm="24" :lg="8">
|
||||
<div class="chart-wrapper">
|
||||
<pie-chart />
|
||||
</div>
|
||||
</el-col>
|
||||
<el-col :xs="24" :sm="24" :lg="8">
|
||||
<div class="chart-wrapper">
|
||||
<bar-chart />
|
||||
</div>
|
||||
</el-col>
|
||||
</el-row>
|
||||
|
||||
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import PanelGroup from './dashboard/PanelGroup'
|
||||
import LineChart from './dashboard/LineChart'
|
||||
import RaddarChart from './dashboard/RaddarChart'
|
||||
import PieChart from './dashboard/PieChart'
|
||||
import BarChart from './dashboard/BarChart'
|
||||
|
||||
const lineChartData = {
|
||||
newVisitis: {
|
||||
expectedData: [100, 120, 161, 134, 105, 160, 165],
|
||||
actualData: [120, 82, 91, 154, 162, 140, 145]
|
||||
},
|
||||
messages: {
|
||||
expectedData: [200, 192, 120, 144, 160, 130, 140],
|
||||
actualData: [180, 160, 151, 106, 145, 150, 130]
|
||||
},
|
||||
purchases: {
|
||||
expectedData: [80, 100, 121, 104, 105, 90, 100],
|
||||
actualData: [120, 90, 100, 138, 142, 130, 130]
|
||||
},
|
||||
shoppings: {
|
||||
expectedData: [130, 140, 141, 142, 145, 150, 160],
|
||||
actualData: [120, 82, 91, 154, 162, 140, 130]
|
||||
}
|
||||
}
|
||||
|
||||
export default {
|
||||
name: 'Index',
|
||||
components: {
|
||||
PanelGroup,
|
||||
LineChart,
|
||||
RaddarChart,
|
||||
PieChart,
|
||||
BarChart
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
lineChartData: lineChartData.newVisitis
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
handleSetLineChartData(type) {
|
||||
this.lineChartData = lineChartData[type]
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<style lang="scss" scoped>
|
||||
.dashboard-editor-container {
|
||||
padding: 32px;
|
||||
background-color: rgb(240, 242, 245);
|
||||
position: relative;
|
||||
|
||||
.chart-wrapper {
|
||||
background: #fff;
|
||||
padding: 16px 16px 0;
|
||||
margin-bottom: 32px;
|
||||
}
|
||||
}
|
||||
|
||||
@media (max-width:1024px) {
|
||||
.chart-wrapper {
|
||||
padding: 8px;
|
||||
}
|
||||
}
|
||||
</style>
|
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user