Compare commits
199 Commits
Author | SHA1 | Date | |
---|---|---|---|
9d02f8f7e7 | |||
70205922fc | |||
f3d1f0afe2 | |||
7ee6ad8aec | |||
4ff9afac23 | |||
167970e5c4 | |||
29395be19a | |||
da01f093f8 | |||
f53515eb70 | |||
84dde0dcf2 | |||
df1c283335 | |||
faa4bfaef3 | |||
eef7ef6544 | |||
22d42048ab | |||
e5b905c455 | |||
c64f027e66 | |||
96934ca139 | |||
f4c763c84d | |||
8cd0d9f366 | |||
6a7f727f70 | |||
62381f0472 | |||
2952337f15 | |||
c719be609a | |||
6253e41658 | |||
bd0e574268 | |||
6e176c807c | |||
2bdf12b1e1 | |||
67f2ba2aa9 | |||
c105f44eb9 | |||
e23a6919af | |||
b362e58646 | |||
db3e571af0 | |||
52fe19e933 | |||
7b3ab45ecc | |||
e337f685bc | |||
13287e02eb | |||
d4a33eab94 | |||
0ca327f538 | |||
31bd27fcf0 | |||
dcfc062c01 | |||
daa8286804 | |||
5a3714e9bc | |||
abe1f0d63e | |||
c95cb70af3 | |||
47bd3c4c10 | |||
1c8f55c2c1 | |||
0f9558a825 | |||
8a4d37e975 | |||
7fbabe1a8e | |||
53cd4867df | |||
7aa4872cb9 | |||
8fcc548d34 | |||
d318b719fc | |||
d6db5963d5 | |||
d5f4bba084 | |||
960dee7756 | |||
08f775da4b | |||
2a0fcdea21 | |||
3f0a34e20f | |||
289161b8c6 | |||
47b51fe965 | |||
0c0efc9455 | |||
dd86447176 | |||
3427223da2 | |||
1959b02220 | |||
acf8ea428f | |||
6e476e40af | |||
25d07b11cc | |||
36013e6139 | |||
87d3c9a93c | |||
d1b3f4f397 | |||
5c5961f1b4 | |||
e932a7ead1 | |||
20db92ecf5 | |||
e1c855b091 | |||
693498b877 | |||
0ef403d785 | |||
d8b2a9a905 | |||
6df2609d1a | |||
608f05b21b | |||
8145485cff | |||
7506ac77cb | |||
5142e2d668 | |||
ef1cf982e3 | |||
12d550d2b6 | |||
2304f95b13 | |||
a4be143104 | |||
0209ed0326 | |||
55846c5658 | |||
799815c273 | |||
baa689b098 | |||
e4bc44115a | |||
53bb1da7a1 | |||
977ceb562e | |||
0264da8d7c | |||
94e23ec0f8 | |||
7610e138dc | |||
b04c6833a3 | |||
035c326071 | |||
e7660d94c9 | |||
5f996472e1 | |||
7cbdc0eb8e | |||
615aa58bea | |||
de7e2f1bfc | |||
41bf76a49f | |||
2a2744a1bf | |||
757c0eebaf | |||
f60cb25245 | |||
199eb3f191 | |||
c1de1113c4 | |||
19803715be | |||
d60d0425bc | |||
28387c46e2 | |||
6e06a6a9e8 | |||
9a60c27785 | |||
4613984fb4 | |||
893b29cae8 | |||
b99efad19c | |||
034e7ec9f0 | |||
72540d01ab | |||
85677a3349 | |||
b5301a3632 | |||
c2743f949e | |||
a7350294e8 | |||
6d531fb173 | |||
18517b6dc5 | |||
27889b0a14 | |||
6bd0dc8e05 | |||
248fe926c5 | |||
8c6546f5d8 | |||
b04eac0566 | |||
6984644313 | |||
174520d259 | |||
e4a22fabc5 | |||
d770e73e31 | |||
e73877f0a2 | |||
0086cc9f53 | |||
2f4c975615 | |||
bbfe5889ea | |||
8b2177673b | |||
eb0602033d | |||
210d75be8e | |||
ed1e7e69a8 | |||
e9ebf86ac8 | |||
8faea4836d | |||
30f821be49 | |||
3361f420c4 | |||
07357a8b75 | |||
c009c88a5b | |||
40715336e3 | |||
16ec346493 | |||
a11fb3ddf7 | |||
063ee7f773 | |||
008a461968 | |||
36f428d928 | |||
871c0a115d | |||
6c3f0c36ff | |||
26c76deb5f | |||
20e2b60370 | |||
503e9c3a8e | |||
cea74fec35 | |||
9cca7839bc | |||
8bcbdc3160 | |||
a9e38fa54d | |||
a5573315a1 | |||
d7ed5a1f73 | |||
4c9c67927b | |||
4a53b718b1 | |||
6f42d2e821 | |||
07cc5dfa51 | |||
22881ccb59 | |||
c44c280b21 | |||
452da5caeb | |||
c78758e32d | |||
4b7e9152c6 | |||
e8e149719a | |||
d2730a187e | |||
068483ac6a | |||
e597cdead4 | |||
25340da2e2 | |||
02375cbe7d | |||
5587d39d42 | |||
ae8f069cbc | |||
d6f7423d59 | |||
2a3981268a | |||
40263f9549 | |||
be8cb965e3 | |||
8a92dc8257 | |||
2cd634a8de | |||
a23af96034 | |||
78abc63c06 | |||
ba9b483472 | |||
a21b875402 | |||
366459e8f3 | |||
7414626137 | |||
9ff9eb30aa | |||
4d6ff66187 | |||
0bc9bd2cfb | |||
7cd98d6dd0 |
1
.github/FUNDING.yml
vendored
Normal file
1
.github/FUNDING.yml
vendored
Normal file
@ -0,0 +1 @@
|
||||
custom: http://doc.ruoyi.vip/ruoyi/other/donate.html
|
3
.gitignore
vendored
3
.gitignore
vendored
@ -25,6 +25,8 @@ target/
|
||||
*.iml
|
||||
*.ipr
|
||||
|
||||
### JRebel ###
|
||||
rebel.xml
|
||||
### NetBeans ###
|
||||
nbproject/private/
|
||||
build/*
|
||||
@ -37,6 +39,7 @@ nbdist/
|
||||
# Others
|
||||
*.log
|
||||
*.xml.versionsBackup
|
||||
*.swp
|
||||
|
||||
!*/build/*.java
|
||||
!*/build/*.html
|
||||
|
13
README.md
13
README.md
@ -1,3 +1,14 @@
|
||||
<p align="center">
|
||||
<img alt="logo" src="https://oscimg.oschina.net/oscnet/up-dd77653d7c9f197dd9d93684f3c8dcfbab6.png">
|
||||
</p>
|
||||
<h1 align="center" style="margin: 30px 0 30px; font-weight: bold;">RuoYi v4.7.6</h1>
|
||||
<h4 align="center">基于SpringBoot开发的轻量级Java快速开发框架</h4>
|
||||
<p align="center">
|
||||
<a href="https://gitee.com/y_project/RuoYi/stargazers"><img src="https://gitee.com/y_project/RuoYi/badge/star.svg?theme=gvp"></a>
|
||||
<a href="https://gitee.com/y_project/RuoYi"><img src="https://img.shields.io/badge/RuoYi-v4.7.6-brightgreen.svg"></a>
|
||||
<a href="https://gitee.com/y_project/RuoYi/blob/master/LICENSE"><img src="https://img.shields.io/github/license/mashape/apistatus.svg"></a>
|
||||
</p>
|
||||
|
||||
## 平台简介
|
||||
|
||||
一直想做一款后台管理系统,看了很多优秀的开源项目但是发现没有合适的。于是利用空闲休息时间开始自己写了一套后台系统。如此有了若依。她可以用于所有的Web应用程序,如网站管理后台,网站会员中心,CMS,CRM,OA。所有前端后台代码封装过后十分精简易上手,出错概率低。同时支持移动客户端访问。系统会陆续更新一些实用功能。
|
||||
@ -88,4 +99,4 @@
|
||||
|
||||
## 若依交流群
|
||||
|
||||
QQ群: [](https://jq.qq.com/?_wv=1027&k=5HBAaYN) [](https://jq.qq.com/?_wv=1027&k=5cHeRVW) [](https://jq.qq.com/?_wv=1027&k=53R0L5Z) [](https://jq.qq.com/?_wv=1027&k=5g75dCU) [](https://jq.qq.com/?_wv=1027&k=58cPoHA) [](https://jq.qq.com/?_wv=1027&k=5Ofd4Pb) [](https://jq.qq.com/?_wv=1027&k=5yugASz) [](https://jq.qq.com/?_wv=1027&k=5Rf3d2P) [](https://jq.qq.com/?_wv=1027&k=5ZIjaeP) [](https://jq.qq.com/?_wv=1027&k=5CJw1jY) [](https://jq.qq.com/?_wv=1027&k=5omzbKc) [](https://jq.qq.com/?_wv=1027&k=qPIKBb7s) [](https://jq.qq.com/?_wv=1027&k=4NsjKbtU) [](https://jq.qq.com/?_wv=1027&k=VD2pkz2G) [](https://jq.qq.com/?_wv=1027&k=HlshFwkJ) [](https://jq.qq.com/?_wv=1027&k=0ARRrO9V) [](https://jq.qq.com/?_wv=1027&k=up9k3ZXJ)
|
||||
QQ群: [](https://jq.qq.com/?_wv=1027&k=5HBAaYN) [](https://jq.qq.com/?_wv=1027&k=5cHeRVW) [](https://jq.qq.com/?_wv=1027&k=53R0L5Z) [](https://jq.qq.com/?_wv=1027&k=5g75dCU) [](https://jq.qq.com/?_wv=1027&k=58cPoHA) [](https://jq.qq.com/?_wv=1027&k=5Ofd4Pb) [](https://jq.qq.com/?_wv=1027&k=5yugASz) [](https://jq.qq.com/?_wv=1027&k=5Rf3d2P) [](https://jq.qq.com/?_wv=1027&k=5ZIjaeP) [](https://jq.qq.com/?_wv=1027&k=5CJw1jY) [](https://jq.qq.com/?_wv=1027&k=5omzbKc) [](https://jq.qq.com/?_wv=1027&k=qPIKBb7s) [](https://jq.qq.com/?_wv=1027&k=4NsjKbtU) [](https://jq.qq.com/?_wv=1027&k=VD2pkz2G) [](https://jq.qq.com/?_wv=1027&k=HlshFwkJ) [](https://jq.qq.com/?_wv=1027&k=0ARRrO9V) [](https://jq.qq.com/?_wv=1027&k=up9k3ZXJ) [](https://jq.qq.com/?_wv=1027&k=540WfdEr) [](https://jq.qq.com/?_wv=1027&k=ss91fC4t) [](https://jq.qq.com/?_wv=1027&k=Cqd66IKe)
|
51
pom.xml
51
pom.xml
@ -5,33 +5,31 @@
|
||||
|
||||
<groupId>com.ruoyi</groupId>
|
||||
<artifactId>ruoyi</artifactId>
|
||||
<version>4.7.1</version>
|
||||
<version>4.7.6</version>
|
||||
|
||||
<name>ruoyi</name>
|
||||
<url>http://www.ruoyi.vip</url>
|
||||
<description>若依管理系统</description>
|
||||
|
||||
<properties>
|
||||
<ruoyi.version>4.7.1</ruoyi.version>
|
||||
<ruoyi.version>4.7.6</ruoyi.version>
|
||||
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
|
||||
<project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding>
|
||||
<java.version>1.8</java.version>
|
||||
<maven-jar-plugin.version>3.1.1</maven-jar-plugin.version>
|
||||
<shiro.version>1.8.0</shiro.version>
|
||||
<shiro.version>1.10.1</shiro.version>
|
||||
<thymeleaf.extras.shiro.version>2.1.0</thymeleaf.extras.shiro.version>
|
||||
<druid.version>1.2.8</druid.version>
|
||||
<druid.version>1.2.15</druid.version>
|
||||
<bitwalker.version>1.21</bitwalker.version>
|
||||
<kaptcha.version>2.3.2</kaptcha.version>
|
||||
<kaptcha.version>2.3.3</kaptcha.version>
|
||||
<swagger.version>3.0.0</swagger.version>
|
||||
<mybatis-spring-boot.version>2.2.0</mybatis-spring-boot.version>
|
||||
<pagehelper.boot.version>1.4.0</pagehelper.boot.version>
|
||||
<fastjson.version>1.2.78</fastjson.version>
|
||||
<oshi.version>5.8.2</oshi.version>
|
||||
<jna.version>5.9.0</jna.version>
|
||||
<pagehelper.boot.version>1.4.6</pagehelper.boot.version>
|
||||
<fastjson.version>1.2.83</fastjson.version>
|
||||
<oshi.version>6.4.0</oshi.version>
|
||||
<commons.io.version>2.11.0</commons.io.version>
|
||||
<commons.fileupload.version>1.4</commons.fileupload.version>
|
||||
<poi.version>4.1.2</poi.version>
|
||||
<velocity.version>1.7</velocity.version>
|
||||
<velocity.version>2.3</velocity.version>
|
||||
</properties>
|
||||
|
||||
<!-- 依赖声明 -->
|
||||
@ -42,7 +40,7 @@
|
||||
<dependency>
|
||||
<groupId>org.springframework.boot</groupId>
|
||||
<artifactId>spring-boot-dependencies</artifactId>
|
||||
<version>2.5.6</version>
|
||||
<version>2.5.14</version>
|
||||
<type>pom</type>
|
||||
<scope>import</scope>
|
||||
</dependency>
|
||||
@ -56,7 +54,7 @@
|
||||
|
||||
<!-- 验证码 -->
|
||||
<dependency>
|
||||
<groupId>com.github.penggle</groupId>
|
||||
<groupId>pro.fessional</groupId>
|
||||
<artifactId>kaptcha</artifactId>
|
||||
<version>${kaptcha.version}</version>
|
||||
</dependency>
|
||||
@ -96,13 +94,6 @@
|
||||
<version>${bitwalker.version}</version>
|
||||
</dependency>
|
||||
|
||||
<!-- SpringBoot集成mybatis框架 -->
|
||||
<dependency>
|
||||
<groupId>org.mybatis.spring.boot</groupId>
|
||||
<artifactId>mybatis-spring-boot-starter</artifactId>
|
||||
<version>${mybatis-spring-boot.version}</version>
|
||||
</dependency>
|
||||
|
||||
<!-- pagehelper 分页插件 -->
|
||||
<dependency>
|
||||
<groupId>com.github.pagehelper</groupId>
|
||||
@ -117,18 +108,6 @@
|
||||
<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>
|
||||
|
||||
<!-- Swagger3依赖 -->
|
||||
<dependency>
|
||||
<groupId>io.springfox</groupId>
|
||||
@ -166,14 +145,8 @@
|
||||
<!-- velocity代码生成使用模板 -->
|
||||
<dependency>
|
||||
<groupId>org.apache.velocity</groupId>
|
||||
<artifactId>velocity</artifactId>
|
||||
<artifactId>velocity-engine-core</artifactId>
|
||||
<version>${velocity.version}</version>
|
||||
<exclusions>
|
||||
<exclusion>
|
||||
<groupId>commons-collections</groupId>
|
||||
<artifactId>commons-collections</artifactId>
|
||||
</exclusion>
|
||||
</exclusions>
|
||||
</dependency>
|
||||
|
||||
<!-- 阿里JSON解析器 -->
|
||||
|
@ -5,7 +5,7 @@
|
||||
<parent>
|
||||
<artifactId>ruoyi</artifactId>
|
||||
<groupId>com.ruoyi</groupId>
|
||||
<version>4.7.1</version>
|
||||
<version>4.7.6</version>
|
||||
</parent>
|
||||
<modelVersion>4.0.0</modelVersion>
|
||||
<packaging>jar</packaging>
|
||||
|
@ -11,6 +11,7 @@ import org.springframework.http.MediaType;
|
||||
import org.springframework.stereotype.Controller;
|
||||
import org.springframework.web.bind.annotation.GetMapping;
|
||||
import org.springframework.web.bind.annotation.PostMapping;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.ResponseBody;
|
||||
import org.springframework.web.multipart.MultipartFile;
|
||||
import com.ruoyi.common.config.RuoYiConfig;
|
||||
@ -27,6 +28,7 @@ import com.ruoyi.common.utils.file.FileUtils;
|
||||
* @author ruoyi
|
||||
*/
|
||||
@Controller
|
||||
@RequestMapping("/common")
|
||||
public class CommonController
|
||||
{
|
||||
private static final Logger log = LoggerFactory.getLogger(CommonController.class);
|
||||
@ -42,7 +44,7 @@ public class CommonController
|
||||
* @param fileName 文件名称
|
||||
* @param delete 是否删除
|
||||
*/
|
||||
@GetMapping("common/download")
|
||||
@GetMapping("/download")
|
||||
public void fileDownload(String fileName, Boolean delete, HttpServletResponse response, HttpServletRequest request)
|
||||
{
|
||||
try
|
||||
@ -71,7 +73,7 @@ public class CommonController
|
||||
/**
|
||||
* 通用上传请求(单个)
|
||||
*/
|
||||
@PostMapping("/common/upload")
|
||||
@PostMapping("/upload")
|
||||
@ResponseBody
|
||||
public AjaxResult uploadFile(MultipartFile file) throws Exception
|
||||
{
|
||||
@ -83,8 +85,10 @@ public class CommonController
|
||||
String fileName = FileUploadUtils.upload(filePath, file);
|
||||
String url = serverConfig.getUrl() + fileName;
|
||||
AjaxResult ajax = AjaxResult.success();
|
||||
ajax.put("fileName", fileName);
|
||||
ajax.put("url", url);
|
||||
ajax.put("fileName", fileName);
|
||||
ajax.put("newFileName", FileUtils.getName(fileName));
|
||||
ajax.put("originalFilename", file.getOriginalFilename());
|
||||
return ajax;
|
||||
}
|
||||
catch (Exception e)
|
||||
@ -96,7 +100,7 @@ public class CommonController
|
||||
/**
|
||||
* 通用上传请求(多个)
|
||||
*/
|
||||
@PostMapping("/common/uploads")
|
||||
@PostMapping("/uploads")
|
||||
@ResponseBody
|
||||
public AjaxResult uploadFiles(List<MultipartFile> files) throws Exception
|
||||
{
|
||||
@ -104,19 +108,25 @@ public class CommonController
|
||||
{
|
||||
// 上传文件路径
|
||||
String filePath = RuoYiConfig.getUploadPath();
|
||||
List<String> fileNames = new ArrayList<String>();
|
||||
List<String> urls = new ArrayList<String>();
|
||||
List<String> fileNames = new ArrayList<String>();
|
||||
List<String> newFileNames = new ArrayList<String>();
|
||||
List<String> originalFilenames = new ArrayList<String>();
|
||||
for (MultipartFile file : files)
|
||||
{
|
||||
// 上传并返回新文件名称
|
||||
String fileName = FileUploadUtils.upload(filePath, file);
|
||||
String url = serverConfig.getUrl() + fileName;
|
||||
fileNames.add(fileName);
|
||||
urls.add(url);
|
||||
fileNames.add(fileName);
|
||||
newFileNames.add(FileUtils.getName(fileName));
|
||||
originalFilenames.add(file.getOriginalFilename());
|
||||
}
|
||||
AjaxResult ajax = AjaxResult.success();
|
||||
ajax.put("fileNames", StringUtils.join(fileNames, FILE_DELIMETER));
|
||||
ajax.put("urls", StringUtils.join(urls, FILE_DELIMETER));
|
||||
ajax.put("fileNames", StringUtils.join(fileNames, FILE_DELIMETER));
|
||||
ajax.put("newFileNames", StringUtils.join(newFileNames, FILE_DELIMETER));
|
||||
ajax.put("originalFilenames", StringUtils.join(originalFilenames, FILE_DELIMETER));
|
||||
return ajax;
|
||||
}
|
||||
catch (Exception e)
|
||||
@ -128,7 +138,7 @@ public class CommonController
|
||||
/**
|
||||
* 本地资源通用下载
|
||||
*/
|
||||
@GetMapping("/common/download/resource")
|
||||
@GetMapping("/download/resource")
|
||||
public void resourceDownload(String resource, HttpServletRequest request, HttpServletResponse response)
|
||||
throws Exception
|
||||
{
|
||||
|
@ -62,6 +62,15 @@ public class DemoFormController
|
||||
return prefix + "/timeline";
|
||||
}
|
||||
|
||||
/**
|
||||
* 进度条
|
||||
*/
|
||||
@GetMapping("/progress_bars")
|
||||
public String progress_bars()
|
||||
{
|
||||
return prefix + "/progress_bars";
|
||||
}
|
||||
|
||||
/**
|
||||
* 表单校验
|
||||
*/
|
||||
|
@ -65,6 +65,57 @@ public class DemoTableController extends BaseController
|
||||
users.add(new UserTableModel(26, "1000026", "测试26", "1", "15666666666", "ry@qq.com", 250.0, "1"));
|
||||
}
|
||||
|
||||
private final static List<AreaModel> areas = new ArrayList<AreaModel>();
|
||||
{
|
||||
areas.add(new AreaModel(1, 0, "广东省", "440000", "GDS", "GuangDongSheng", 1));
|
||||
areas.add(new AreaModel(2, 0, "湖南省", "430000", "HNS", "HuNanSheng", 1));
|
||||
areas.add(new AreaModel(3, 0, "河南省", "410000", "HNS", "HeNanSheng", 0));
|
||||
areas.add(new AreaModel(4, 0, "湖北省", "420000", "HBS", "HuBeiSheng", 0));
|
||||
areas.add(new AreaModel(5, 0, "辽宁省", "210000", "LNS", "LiaoNingSheng", 0));
|
||||
areas.add(new AreaModel(6, 0, "山东省", "370000", "SDS", "ShanDongSheng", 0));
|
||||
areas.add(new AreaModel(7, 0, "陕西省", "610000", "SXS", "ShanXiSheng", 0));
|
||||
areas.add(new AreaModel(8, 0, "贵州省", "520000", "GZS", "GuiZhouSheng", 0));
|
||||
areas.add(new AreaModel(9, 0, "上海市", "310000", "SHS", "ShangHaiShi", 0));
|
||||
areas.add(new AreaModel(10, 0, "重庆市", "500000", "CQS", "ChongQingShi", 0));
|
||||
areas.add(new AreaModel(11, 0, "若依省", "666666", "YYS", "RuoYiSheng", 0));
|
||||
areas.add(new AreaModel(12, 0, "安徽省", "340000", "AHS", "AnHuiSheng", 0));
|
||||
areas.add(new AreaModel(13, 0, "福建省", "350000", "FJS", "FuJianSheng", 0));
|
||||
areas.add(new AreaModel(14, 0, "海南省", "460000", "HNS", "HaiNanSheng", 0));
|
||||
areas.add(new AreaModel(15, 0, "江苏省", "320000", "JSS", "JiangSuSheng", 0));
|
||||
areas.add(new AreaModel(16, 0, "青海省", "630000", "QHS", "QingHaiSheng", 0));
|
||||
areas.add(new AreaModel(17, 0, "广西壮族自治区", "450000", "GXZZZZQ", "GuangXiZhuangZuZiZhiQu", 0));
|
||||
areas.add(new AreaModel(18, 0, "宁夏回族自治区", "640000", "NXHZZZQ", "NingXiaHuiZuZiZhiQu", 0));
|
||||
areas.add(new AreaModel(19, 0, "内蒙古自治区", "150000", "NMGZZQ", "NeiMengGuZiZhiQu", 0));
|
||||
areas.add(new AreaModel(20, 0, "新疆维吾尔自治区", "650000", "XJWWEZZQ", "XinJiangWeiWuErZiZhiQu", 0));
|
||||
areas.add(new AreaModel(21, 0, "江西省", "360000", "JXS", "JiangXiSheng", 0));
|
||||
areas.add(new AreaModel(22, 0, "浙江省", "330000", "ZJS", "ZheJiangSheng", 0));
|
||||
areas.add(new AreaModel(23, 0, "河北省", "130000", "HBS", "HeBeiSheng", 0));
|
||||
areas.add(new AreaModel(24, 0, "天津市", "120000", "TJS", "TianJinShi", 0));
|
||||
areas.add(new AreaModel(25, 0, "山西省", "140000", "SXS", "ShanXiSheng", 0));
|
||||
areas.add(new AreaModel(26, 0, "台湾省", "710000", "TWS", "TaiWanSheng", 0));
|
||||
areas.add(new AreaModel(27, 0, "甘肃省", "620000", "GSS", "GanSuSheng", 0));
|
||||
areas.add(new AreaModel(28, 0, "四川省", "510000", "SCS", "SiChuanSheng", 0));
|
||||
areas.add(new AreaModel(29, 0, "云南省", "530000", "YNS", "YunNanSheng", 0));
|
||||
areas.add(new AreaModel(30, 0, "北京市", "110000", "BJS", "BeiJingShi", 0));
|
||||
areas.add(new AreaModel(31, 0, "香港特别行政区", "810000", "XGTBXZQ", "XiangGangTeBieXingZhengQu", 0));
|
||||
areas.add(new AreaModel(32, 0, "澳门特别行政区", "820000", "AMTBXZQ", "AoMenTeBieXingZhengQu", 0));
|
||||
|
||||
areas.add(new AreaModel(100, 1, "深圳市", "440300", "SZS", "ShenZhenShi", 1));
|
||||
areas.add(new AreaModel(101, 1, "广州市", "440100", "GZS", "GuangZhouShi", 0));
|
||||
areas.add(new AreaModel(102, 1, "东莞市", "441900", "DGS", "DongGuanShi", 0));
|
||||
areas.add(new AreaModel(103, 2, "长沙市", "410005", "CSS", "ChangShaShi", 1));
|
||||
areas.add(new AreaModel(104, 2, "岳阳市", "414000", "YYS", "YueYangShi", 0));
|
||||
|
||||
areas.add(new AreaModel(1000, 100, "龙岗区", "518172", "LGQ", "LongGangQu", 0));
|
||||
areas.add(new AreaModel(1001, 100, "南山区", "518051", "NSQ", "NanShanQu", 0));
|
||||
areas.add(new AreaModel(1002, 100, "宝安区", "518101", "BAQ", "BaoAnQu", 0));
|
||||
areas.add(new AreaModel(1003, 100, "福田区", "518081", "FTQ", "FuTianQu", 0));
|
||||
areas.add(new AreaModel(1004, 103, "天心区", "410004", "TXQ", "TianXinQu", 0));
|
||||
areas.add(new AreaModel(1005, 103, "开福区", "410008", "KFQ", "KaiFuQu", 0));
|
||||
areas.add(new AreaModel(1006, 103, "芙蓉区", "410011", "FRQ", "FuRongQu", 0));
|
||||
areas.add(new AreaModel(1007, 103, "雨花区", "410011", "YHQ", "YuHuaQu", 0));
|
||||
}
|
||||
|
||||
private final static List<UserTableColumn> columns = new ArrayList<UserTableColumn>();
|
||||
{
|
||||
columns.add(new UserTableColumn("用户ID", "userId"));
|
||||
@ -348,6 +399,15 @@ public class DemoTableController extends BaseController
|
||||
return prefix + "/customView";
|
||||
}
|
||||
|
||||
/**
|
||||
* 异步加载表格树
|
||||
*/
|
||||
@GetMapping("/asynTree")
|
||||
public String asynTree()
|
||||
{
|
||||
return prefix + "/asynTree";
|
||||
}
|
||||
|
||||
/**
|
||||
* 表格其他操作
|
||||
*/
|
||||
@ -412,6 +472,84 @@ public class DemoTableController extends BaseController
|
||||
rspData.setTotal(userList.size());
|
||||
return rspData;
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询树表数据
|
||||
*/
|
||||
@PostMapping("/tree/list")
|
||||
@ResponseBody
|
||||
public TableDataInfo treeList(AreaModel areaModel)
|
||||
{
|
||||
TableDataInfo rspData = new TableDataInfo();
|
||||
List<AreaModel> areaList = new ArrayList<AreaModel>(Arrays.asList(new AreaModel[areas.size()]));
|
||||
// 默认查询条件 parentId 0
|
||||
Collections.copy(areaList, areas);
|
||||
areaList.clear();
|
||||
if (StringUtils.isNotEmpty(areaModel.getAreaName()))
|
||||
{
|
||||
for (AreaModel area : areas)
|
||||
{
|
||||
if (area.getParentId() == 0 && area.getAreaName().equals(areaModel.getAreaName()))
|
||||
{
|
||||
areaList.add(area);
|
||||
}
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
for (AreaModel area : areas)
|
||||
{
|
||||
if (area.getParentId() == 0)
|
||||
{
|
||||
areaList.add(area);
|
||||
}
|
||||
}
|
||||
}
|
||||
PageDomain pageDomain = TableSupport.buildPageRequest();
|
||||
Integer pageNum = (pageDomain.getPageNum() - 1) * 10;
|
||||
Integer pageSize = pageDomain.getPageNum() * 10;
|
||||
if (pageSize > areaList.size())
|
||||
{
|
||||
pageSize = areaList.size();
|
||||
}
|
||||
rspData.setRows(areaList.subList(pageNum, pageSize));
|
||||
rspData.setTotal(areaList.size());
|
||||
return rspData;
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询树表子节点数据
|
||||
*/
|
||||
@PostMapping("/tree/listChild")
|
||||
@ResponseBody
|
||||
public List<AreaModel> listChild(AreaModel areaModel)
|
||||
{
|
||||
List<AreaModel> areaList = new ArrayList<AreaModel>(Arrays.asList(new AreaModel[areas.size()]));
|
||||
// 查询条件 parentId
|
||||
Collections.copy(areaList, areas);
|
||||
areaList.clear();
|
||||
if (StringUtils.isNotEmpty(areaModel.getAreaName()))
|
||||
{
|
||||
for (AreaModel area : areas)
|
||||
{
|
||||
if (area.getParentId().intValue() == areaModel.getParentId().intValue() && area.getAreaName().equals(areaModel.getAreaName()))
|
||||
{
|
||||
areaList.add(area);
|
||||
}
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
for (AreaModel area : areas)
|
||||
{
|
||||
if (area.getParentId().intValue() == areaModel.getParentId().intValue())
|
||||
{
|
||||
areaList.add(area);
|
||||
}
|
||||
}
|
||||
}
|
||||
return areaList;
|
||||
}
|
||||
}
|
||||
|
||||
class UserTableColumn
|
||||
@ -597,3 +735,112 @@ class UserTableModel
|
||||
this.createTime = createTime;
|
||||
}
|
||||
}
|
||||
class AreaModel
|
||||
{
|
||||
/** 编号 */
|
||||
private Long id;
|
||||
|
||||
/** 父编号 */
|
||||
private Long parentId;
|
||||
|
||||
/** 区域名称 */
|
||||
private String areaName;
|
||||
|
||||
/** 区域代码 */
|
||||
private String areaCode;
|
||||
|
||||
/** 名称首字母 */
|
||||
private String simplePy;
|
||||
|
||||
/** 名称全拼 */
|
||||
private String pinYin;
|
||||
|
||||
/** 是否有子节点(0无 1有) */
|
||||
private Integer isTreeLeaf = 1;
|
||||
|
||||
public AreaModel()
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
public AreaModel(int id, int parentId, String areaName, String areaCode, String simplePy, String pinYin, Integer isTreeLeaf)
|
||||
{
|
||||
this.id = Long.valueOf(id);
|
||||
this.parentId = Long.valueOf(parentId);
|
||||
this.areaName = areaName;
|
||||
this.areaCode = areaCode;
|
||||
this.simplePy = simplePy;
|
||||
this.pinYin = pinYin;
|
||||
this.isTreeLeaf = isTreeLeaf;
|
||||
}
|
||||
|
||||
public Long getId()
|
||||
{
|
||||
return id;
|
||||
}
|
||||
|
||||
public void setId(Long id)
|
||||
{
|
||||
this.id = id;
|
||||
}
|
||||
|
||||
public Long getParentId()
|
||||
{
|
||||
return parentId;
|
||||
}
|
||||
|
||||
public void setParentId(Long parentId)
|
||||
{
|
||||
this.parentId = parentId;
|
||||
}
|
||||
|
||||
public String getAreaName()
|
||||
{
|
||||
return areaName;
|
||||
}
|
||||
|
||||
public void setAreaName(String areaName)
|
||||
{
|
||||
this.areaName = areaName;
|
||||
}
|
||||
|
||||
public String getAreaCode()
|
||||
{
|
||||
return areaCode;
|
||||
}
|
||||
|
||||
public void setAreaCode(String areaCode)
|
||||
{
|
||||
this.areaCode = areaCode;
|
||||
}
|
||||
|
||||
public String getSimplePy()
|
||||
{
|
||||
return simplePy;
|
||||
}
|
||||
|
||||
public void setSimplePy(String simplePy)
|
||||
{
|
||||
this.simplePy = simplePy;
|
||||
}
|
||||
|
||||
public String getPinYin()
|
||||
{
|
||||
return pinYin;
|
||||
}
|
||||
|
||||
public void setPinYin(String pinYin)
|
||||
{
|
||||
this.pinYin = pinYin;
|
||||
}
|
||||
|
||||
public Integer getIsTreeLeaf()
|
||||
{
|
||||
return isTreeLeaf;
|
||||
}
|
||||
|
||||
public void setIsTreeLeaf(Integer isTreeLeaf)
|
||||
{
|
||||
this.isTreeLeaf = isTreeLeaf;
|
||||
}
|
||||
}
|
||||
|
@ -1,5 +1,6 @@
|
||||
package com.ruoyi.web.controller.monitor;
|
||||
|
||||
import org.apache.shiro.authz.annotation.RequiresPermissions;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Controller;
|
||||
import org.springframework.ui.ModelMap;
|
||||
@ -25,6 +26,7 @@ public class CacheController extends BaseController
|
||||
@Autowired
|
||||
private CacheService cacheService;
|
||||
|
||||
@RequiresPermissions("monitor:cache:view")
|
||||
@GetMapping()
|
||||
public String cache(ModelMap mmap)
|
||||
{
|
||||
@ -32,6 +34,7 @@ public class CacheController extends BaseController
|
||||
return prefix + "/cache";
|
||||
}
|
||||
|
||||
@RequiresPermissions("monitor:cache:view")
|
||||
@PostMapping("/getNames")
|
||||
public String getCacheNames(String fragment, ModelMap mmap)
|
||||
{
|
||||
@ -39,14 +42,16 @@ public class CacheController extends BaseController
|
||||
return prefix + "/cache::" + fragment;
|
||||
}
|
||||
|
||||
@RequiresPermissions("monitor:cache:view")
|
||||
@PostMapping("/getKeys")
|
||||
public String getCacheKeys(String fragment, String cacheName, ModelMap mmap)
|
||||
{
|
||||
mmap.put("cacheName", cacheName);
|
||||
mmap.put("cacheKyes", cacheService.getCacheKeys(cacheName));
|
||||
mmap.put("cacheKeys", cacheService.getCacheKeys(cacheName));
|
||||
return prefix + "/cache::" + fragment;
|
||||
}
|
||||
|
||||
@RequiresPermissions("monitor:cache:view")
|
||||
@PostMapping("/getValue")
|
||||
public String getCacheValue(String fragment, String cacheName, String cacheKey, ModelMap mmap)
|
||||
{
|
||||
@ -56,6 +61,7 @@ public class CacheController extends BaseController
|
||||
return prefix + "/cache::" + fragment;
|
||||
}
|
||||
|
||||
@RequiresPermissions("monitor:cache:view")
|
||||
@PostMapping("/clearCacheName")
|
||||
@ResponseBody
|
||||
public AjaxResult clearCacheName(String cacheName, ModelMap mmap)
|
||||
@ -64,6 +70,7 @@ public class CacheController extends BaseController
|
||||
return AjaxResult.success();
|
||||
}
|
||||
|
||||
@RequiresPermissions("monitor:cache:view")
|
||||
@PostMapping("/clearCacheKey")
|
||||
@ResponseBody
|
||||
public AjaxResult clearCacheKey(String cacheName, String cacheKey, ModelMap mmap)
|
||||
@ -72,6 +79,7 @@ public class CacheController extends BaseController
|
||||
return AjaxResult.success();
|
||||
}
|
||||
|
||||
@RequiresPermissions("monitor:cache:view")
|
||||
@GetMapping("/clearAll")
|
||||
@ResponseBody
|
||||
public AjaxResult clearAll(ModelMap mmap)
|
||||
|
@ -95,6 +95,7 @@ public class SysConfigController extends BaseController
|
||||
/**
|
||||
* 修改参数配置
|
||||
*/
|
||||
@RequiresPermissions("system:config:edit")
|
||||
@GetMapping("/edit/{configId}")
|
||||
public String edit(@PathVariable("configId") Long configId, ModelMap mmap)
|
||||
{
|
||||
|
@ -17,7 +17,6 @@ import com.ruoyi.common.core.controller.BaseController;
|
||||
import com.ruoyi.common.core.domain.AjaxResult;
|
||||
import com.ruoyi.common.core.domain.Ztree;
|
||||
import com.ruoyi.common.core.domain.entity.SysDept;
|
||||
import com.ruoyi.common.core.domain.entity.SysRole;
|
||||
import com.ruoyi.common.enums.BusinessType;
|
||||
import com.ruoyi.common.utils.StringUtils;
|
||||
import com.ruoyi.system.service.ISysDeptService;
|
||||
@ -84,8 +83,9 @@ public class SysDeptController extends BaseController
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改
|
||||
* 修改部门
|
||||
*/
|
||||
@RequiresPermissions("system:dept:edit")
|
||||
@GetMapping("/edit/{deptId}")
|
||||
public String edit(@PathVariable("deptId") Long deptId, ModelMap mmap)
|
||||
{
|
||||
@ -100,7 +100,7 @@ public class SysDeptController extends BaseController
|
||||
}
|
||||
|
||||
/**
|
||||
* 保存
|
||||
* 修改保存部门
|
||||
*/
|
||||
@Log(title = "部门管理", businessType = BusinessType.UPDATE)
|
||||
@RequiresPermissions("system:dept:edit")
|
||||
@ -108,16 +108,17 @@ public class SysDeptController extends BaseController
|
||||
@ResponseBody
|
||||
public AjaxResult editSave(@Validated SysDept dept)
|
||||
{
|
||||
Long deptId = dept.getDeptId();
|
||||
deptService.checkDeptDataScope(deptId);
|
||||
if (UserConstants.DEPT_NAME_NOT_UNIQUE.equals(deptService.checkDeptNameUnique(dept)))
|
||||
{
|
||||
return error("修改部门'" + dept.getDeptName() + "'失败,部门名称已存在");
|
||||
}
|
||||
else if (dept.getParentId().equals(dept.getDeptId()))
|
||||
else if (dept.getParentId().equals(deptId))
|
||||
{
|
||||
return error("修改部门'" + dept.getDeptName() + "'失败,上级部门不能是自己");
|
||||
}
|
||||
else if (StringUtils.equals(UserConstants.DEPT_DISABLE, dept.getStatus())
|
||||
&& deptService.selectNormalChildrenDeptById(dept.getDeptId()) > 0)
|
||||
else if (StringUtils.equals(UserConstants.DEPT_DISABLE, dept.getStatus()) && deptService.selectNormalChildrenDeptById(deptId) > 0)
|
||||
{
|
||||
return AjaxResult.error("该部门包含未停用的子部门!");
|
||||
}
|
||||
@ -142,6 +143,7 @@ public class SysDeptController extends BaseController
|
||||
{
|
||||
return AjaxResult.warn("部门存在用户,不允许删除");
|
||||
}
|
||||
deptService.checkDeptDataScope(deptId);
|
||||
return toAjax(deptService.deleteDeptById(deptId));
|
||||
}
|
||||
|
||||
@ -163,24 +165,13 @@ public class SysDeptController extends BaseController
|
||||
*/
|
||||
@GetMapping(value = { "/selectDeptTree/{deptId}", "/selectDeptTree/{deptId}/{excludeId}" })
|
||||
public String selectDeptTree(@PathVariable("deptId") Long deptId,
|
||||
@PathVariable(value = "excludeId", required = false) String excludeId, ModelMap mmap)
|
||||
@PathVariable(value = "excludeId", required = false) Long excludeId, ModelMap mmap)
|
||||
{
|
||||
mmap.put("dept", deptService.selectDeptById(deptId));
|
||||
mmap.put("excludeId", excludeId);
|
||||
return prefix + "/tree";
|
||||
}
|
||||
|
||||
/**
|
||||
* 加载部门列表树
|
||||
*/
|
||||
@GetMapping("/treeData")
|
||||
@ResponseBody
|
||||
public List<Ztree> treeData()
|
||||
{
|
||||
List<Ztree> ztrees = deptService.selectDeptTree(new SysDept());
|
||||
return ztrees;
|
||||
}
|
||||
|
||||
/**
|
||||
* 加载部门列表树(排除下级)
|
||||
*/
|
||||
@ -193,15 +184,4 @@ public class SysDeptController extends BaseController
|
||||
List<Ztree> ztrees = deptService.selectDeptTreeExcludeChild(dept);
|
||||
return ztrees;
|
||||
}
|
||||
|
||||
/**
|
||||
* 加载角色部门(数据权限)列表树
|
||||
*/
|
||||
@GetMapping("/roleDeptTreeData")
|
||||
@ResponseBody
|
||||
public List<Ztree> deptTreeData(SysRole role)
|
||||
{
|
||||
List<Ztree> ztrees = deptService.roleDeptTreeData(role);
|
||||
return ztrees;
|
||||
}
|
||||
}
|
||||
|
@ -88,6 +88,7 @@ public class SysDictDataController extends BaseController
|
||||
/**
|
||||
* 修改字典类型
|
||||
*/
|
||||
@RequiresPermissions("system:dict:edit")
|
||||
@GetMapping("/edit/{dictCode}")
|
||||
public String edit(@PathVariable("dictCode") Long dictCode, ModelMap mmap)
|
||||
{
|
||||
|
@ -94,6 +94,7 @@ public class SysDictTypeController extends BaseController
|
||||
/**
|
||||
* 修改字典类型
|
||||
*/
|
||||
@RequiresPermissions("system:dict:edit")
|
||||
@GetMapping("/edit/{dictId}")
|
||||
public String edit(@PathVariable("dictId") Long dictId, ModelMap mmap)
|
||||
{
|
||||
|
@ -117,6 +117,7 @@ public class SysMenuController extends BaseController
|
||||
/**
|
||||
* 修改菜单
|
||||
*/
|
||||
@RequiresPermissions("system:menu:edit")
|
||||
@GetMapping("/edit/{menuId}")
|
||||
public String edit(@PathVariable("menuId") Long menuId, ModelMap mmap)
|
||||
{
|
||||
|
@ -5,6 +5,7 @@ import org.apache.shiro.authz.annotation.RequiresPermissions;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Controller;
|
||||
import org.springframework.ui.ModelMap;
|
||||
import org.springframework.validation.annotation.Validated;
|
||||
import org.springframework.web.bind.annotation.GetMapping;
|
||||
import org.springframework.web.bind.annotation.PathVariable;
|
||||
import org.springframework.web.bind.annotation.PostMapping;
|
||||
@ -68,7 +69,7 @@ public class SysNoticeController extends BaseController
|
||||
@Log(title = "通知公告", businessType = BusinessType.INSERT)
|
||||
@PostMapping("/add")
|
||||
@ResponseBody
|
||||
public AjaxResult addSave(SysNotice notice)
|
||||
public AjaxResult addSave(@Validated SysNotice notice)
|
||||
{
|
||||
notice.setCreateBy(getLoginName());
|
||||
return toAjax(noticeService.insertNotice(notice));
|
||||
@ -77,6 +78,7 @@ public class SysNoticeController extends BaseController
|
||||
/**
|
||||
* 修改公告
|
||||
*/
|
||||
@RequiresPermissions("system:notice:edit")
|
||||
@GetMapping("/edit/{noticeId}")
|
||||
public String edit(@PathVariable("noticeId") Long noticeId, ModelMap mmap)
|
||||
{
|
||||
@ -91,7 +93,7 @@ public class SysNoticeController extends BaseController
|
||||
@Log(title = "通知公告", businessType = BusinessType.UPDATE)
|
||||
@PostMapping("/edit")
|
||||
@ResponseBody
|
||||
public AjaxResult editSave(SysNotice notice)
|
||||
public AjaxResult editSave(@Validated SysNotice notice)
|
||||
{
|
||||
notice.setUpdateBy(getLoginName());
|
||||
return toAjax(noticeService.updateNotice(notice));
|
||||
|
@ -112,6 +112,7 @@ public class SysPostController extends BaseController
|
||||
/**
|
||||
* 修改岗位
|
||||
*/
|
||||
@RequiresPermissions("system:post:edit")
|
||||
@GetMapping("/edit/{postId}")
|
||||
public String edit(@PathVariable("postId") Long postId, ModelMap mmap)
|
||||
{
|
||||
|
@ -22,6 +22,7 @@ import com.ruoyi.common.utils.DateUtils;
|
||||
import com.ruoyi.common.utils.ShiroUtils;
|
||||
import com.ruoyi.common.utils.StringUtils;
|
||||
import com.ruoyi.common.utils.file.FileUploadUtils;
|
||||
import com.ruoyi.common.utils.file.MimeTypeUtils;
|
||||
import com.ruoyi.framework.shiro.service.SysPasswordService;
|
||||
import com.ruoyi.system.service.ISysUserService;
|
||||
|
||||
@ -62,11 +63,7 @@ public class SysProfileController extends BaseController
|
||||
public boolean checkPassword(String password)
|
||||
{
|
||||
SysUser user = getSysUser();
|
||||
if (passwordService.matches(user, password))
|
||||
{
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
return passwordService.matches(user, password);
|
||||
}
|
||||
|
||||
@GetMapping("/resetPwd")
|
||||
@ -168,7 +165,7 @@ public class SysProfileController extends BaseController
|
||||
{
|
||||
if (!file.isEmpty())
|
||||
{
|
||||
String avatar = FileUploadUtils.upload(RuoYiConfig.getAvatarPath(), file);
|
||||
String avatar = FileUploadUtils.upload(RuoYiConfig.getAvatarPath(), file, MimeTypeUtils.IMAGE_EXTENSION);
|
||||
currentUser.setAvatar(avatar);
|
||||
if (userService.updateUserInfo(currentUser) > 0)
|
||||
{
|
||||
|
@ -15,6 +15,7 @@ import com.ruoyi.common.annotation.Log;
|
||||
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.Ztree;
|
||||
import com.ruoyi.common.core.domain.entity.SysRole;
|
||||
import com.ruoyi.common.core.domain.entity.SysUser;
|
||||
import com.ruoyi.common.core.page.TableDataInfo;
|
||||
@ -22,6 +23,7 @@ import com.ruoyi.common.enums.BusinessType;
|
||||
import com.ruoyi.common.utils.poi.ExcelUtil;
|
||||
import com.ruoyi.framework.shiro.util.AuthorizationUtils;
|
||||
import com.ruoyi.system.domain.SysUserRole;
|
||||
import com.ruoyi.system.service.ISysDeptService;
|
||||
import com.ruoyi.system.service.ISysRoleService;
|
||||
import com.ruoyi.system.service.ISysUserService;
|
||||
|
||||
@ -42,6 +44,9 @@ public class SysRoleController extends BaseController
|
||||
@Autowired
|
||||
private ISysUserService userService;
|
||||
|
||||
@Autowired
|
||||
private ISysDeptService deptService;
|
||||
|
||||
@RequiresPermissions("system:role:view")
|
||||
@GetMapping()
|
||||
public String role()
|
||||
@ -105,6 +110,7 @@ public class SysRoleController extends BaseController
|
||||
/**
|
||||
* 修改角色
|
||||
*/
|
||||
@RequiresPermissions("system:role:edit")
|
||||
@GetMapping("/edit/{roleId}")
|
||||
public String edit(@PathVariable("roleId") Long roleId, ModelMap mmap)
|
||||
{
|
||||
@ -123,6 +129,7 @@ public class SysRoleController extends BaseController
|
||||
public AjaxResult editSave(@Validated SysRole role)
|
||||
{
|
||||
roleService.checkRoleAllowed(role);
|
||||
roleService.checkRoleDataScope(role.getRoleId());
|
||||
if (UserConstants.ROLE_NAME_NOT_UNIQUE.equals(roleService.checkRoleNameUnique(role)))
|
||||
{
|
||||
return error("修改角色'" + role.getRoleName() + "'失败,角色名称已存在");
|
||||
@ -156,6 +163,7 @@ public class SysRoleController extends BaseController
|
||||
public AjaxResult authDataScopeSave(SysRole role)
|
||||
{
|
||||
roleService.checkRoleAllowed(role);
|
||||
roleService.checkRoleDataScope(role.getRoleId());
|
||||
role.setUpdateBy(getLoginName());
|
||||
if (roleService.authDataScope(role) > 0)
|
||||
{
|
||||
@ -213,6 +221,7 @@ public class SysRoleController extends BaseController
|
||||
public AjaxResult changeStatus(SysRole role)
|
||||
{
|
||||
roleService.checkRoleAllowed(role);
|
||||
roleService.checkRoleDataScope(role.getRoleId());
|
||||
return toAjax(roleService.changeStatus(role));
|
||||
}
|
||||
|
||||
@ -296,6 +305,19 @@ public class SysRoleController extends BaseController
|
||||
@ResponseBody
|
||||
public AjaxResult selectAuthUserAll(Long roleId, String userIds)
|
||||
{
|
||||
roleService.checkRoleDataScope(roleId);
|
||||
return toAjax(roleService.insertAuthUsers(roleId, userIds));
|
||||
}
|
||||
|
||||
/**
|
||||
* 加载角色部门(数据权限)列表树
|
||||
*/
|
||||
@RequiresPermissions("system:role:edit")
|
||||
@GetMapping("/deptTreeData")
|
||||
@ResponseBody
|
||||
public List<Ztree> deptTreeData(SysRole role)
|
||||
{
|
||||
List<Ztree> ztrees = deptService.roleDeptTreeData(role);
|
||||
return ztrees;
|
||||
}
|
||||
}
|
@ -18,6 +18,8 @@ import com.ruoyi.common.annotation.Log;
|
||||
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.Ztree;
|
||||
import com.ruoyi.common.core.domain.entity.SysDept;
|
||||
import com.ruoyi.common.core.domain.entity.SysRole;
|
||||
import com.ruoyi.common.core.domain.entity.SysUser;
|
||||
import com.ruoyi.common.core.page.TableDataInfo;
|
||||
@ -27,6 +29,8 @@ import com.ruoyi.common.utils.ShiroUtils;
|
||||
import com.ruoyi.common.utils.StringUtils;
|
||||
import com.ruoyi.common.utils.poi.ExcelUtil;
|
||||
import com.ruoyi.framework.shiro.service.SysPasswordService;
|
||||
import com.ruoyi.framework.shiro.util.AuthorizationUtils;
|
||||
import com.ruoyi.system.service.ISysDeptService;
|
||||
import com.ruoyi.system.service.ISysPostService;
|
||||
import com.ruoyi.system.service.ISysRoleService;
|
||||
import com.ruoyi.system.service.ISysUserService;
|
||||
@ -48,6 +52,9 @@ public class SysUserController extends BaseController
|
||||
@Autowired
|
||||
private ISysRoleService roleService;
|
||||
|
||||
@Autowired
|
||||
private ISysDeptService deptService;
|
||||
|
||||
@Autowired
|
||||
private ISysPostService postService;
|
||||
|
||||
@ -123,7 +130,7 @@ public class SysUserController extends BaseController
|
||||
@ResponseBody
|
||||
public AjaxResult addSave(@Validated SysUser user)
|
||||
{
|
||||
if (UserConstants.USER_NAME_NOT_UNIQUE.equals(userService.checkLoginNameUnique(user.getLoginName())))
|
||||
if (UserConstants.USER_NAME_NOT_UNIQUE.equals(userService.checkLoginNameUnique(user)))
|
||||
{
|
||||
return error("新增用户'" + user.getLoginName() + "'失败,登录账号已存在");
|
||||
}
|
||||
@ -146,6 +153,7 @@ public class SysUserController extends BaseController
|
||||
/**
|
||||
* 修改用户
|
||||
*/
|
||||
@RequiresPermissions("system:user:edit")
|
||||
@GetMapping("/edit/{userId}")
|
||||
public String edit(@PathVariable("userId") Long userId, ModelMap mmap)
|
||||
{
|
||||
@ -167,7 +175,12 @@ public class SysUserController extends BaseController
|
||||
public AjaxResult editSave(@Validated SysUser user)
|
||||
{
|
||||
userService.checkUserAllowed(user);
|
||||
if (StringUtils.isNotEmpty(user.getPhonenumber())
|
||||
userService.checkUserDataScope(user.getUserId());
|
||||
if (UserConstants.USER_NAME_NOT_UNIQUE.equals(userService.checkLoginNameUnique(user)))
|
||||
{
|
||||
return error("修改用户'" + user.getLoginName() + "'失败,登录账号已存在");
|
||||
}
|
||||
else if (StringUtils.isNotEmpty(user.getPhonenumber())
|
||||
&& UserConstants.USER_PHONE_NOT_UNIQUE.equals(userService.checkPhoneUnique(user)))
|
||||
{
|
||||
return error("修改用户'" + user.getLoginName() + "'失败,手机号码已存在");
|
||||
@ -178,6 +191,7 @@ public class SysUserController extends BaseController
|
||||
return error("修改用户'" + user.getLoginName() + "'失败,邮箱账号已存在");
|
||||
}
|
||||
user.setUpdateBy(getLoginName());
|
||||
AuthorizationUtils.clearAllCachedAuthorizationInfo();
|
||||
return toAjax(userService.updateUser(user));
|
||||
}
|
||||
|
||||
@ -196,6 +210,7 @@ public class SysUserController extends BaseController
|
||||
public AjaxResult resetPwdSave(SysUser user)
|
||||
{
|
||||
userService.checkUserAllowed(user);
|
||||
userService.checkUserDataScope(user.getUserId());
|
||||
user.setSalt(ShiroUtils.randomSalt());
|
||||
user.setPassword(passwordService.encryptPassword(user.getLoginName(), user.getPassword(), user.getSalt()));
|
||||
if (userService.resetUserPwd(user) > 0)
|
||||
@ -232,7 +247,9 @@ public class SysUserController extends BaseController
|
||||
@ResponseBody
|
||||
public AjaxResult insertAuthRole(Long userId, Long[] roleIds)
|
||||
{
|
||||
userService.checkUserDataScope(userId);
|
||||
userService.insertUserAuth(userId, roleIds);
|
||||
AuthorizationUtils.clearAllCachedAuthorizationInfo();
|
||||
return success();
|
||||
}
|
||||
|
||||
@ -256,7 +273,7 @@ public class SysUserController extends BaseController
|
||||
@ResponseBody
|
||||
public String checkLoginNameUnique(SysUser user)
|
||||
{
|
||||
return userService.checkLoginNameUnique(user.getLoginName());
|
||||
return userService.checkLoginNameUnique(user);
|
||||
}
|
||||
|
||||
/**
|
||||
@ -289,6 +306,32 @@ public class SysUserController extends BaseController
|
||||
public AjaxResult changeStatus(SysUser user)
|
||||
{
|
||||
userService.checkUserAllowed(user);
|
||||
userService.checkUserDataScope(user.getUserId());
|
||||
return toAjax(userService.changeStatus(user));
|
||||
}
|
||||
|
||||
/**
|
||||
* 加载部门列表树
|
||||
*/
|
||||
@RequiresPermissions("system:user:list")
|
||||
@GetMapping("/deptTreeData")
|
||||
@ResponseBody
|
||||
public List<Ztree> deptTreeData()
|
||||
{
|
||||
List<Ztree> ztrees = deptService.selectDeptTree(new SysDept());
|
||||
return ztrees;
|
||||
}
|
||||
|
||||
/**
|
||||
* 选择部门树
|
||||
*
|
||||
* @param deptId 部门ID
|
||||
*/
|
||||
@RequiresPermissions("system:user:list")
|
||||
@GetMapping("/selectDeptTree/{deptId}")
|
||||
public String selectDeptTree(@PathVariable("deptId") Long deptId, ModelMap mmap)
|
||||
{
|
||||
mmap.put("dept", deptService.selectDeptById(deptId));
|
||||
return prefix + "/deptTree";
|
||||
}
|
||||
}
|
@ -13,7 +13,7 @@ import org.springframework.web.bind.annotation.RequestBody;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
import com.ruoyi.common.core.controller.BaseController;
|
||||
import com.ruoyi.common.core.domain.AjaxResult;
|
||||
import com.ruoyi.common.core.domain.R;
|
||||
import com.ruoyi.common.utils.StringUtils;
|
||||
import io.swagger.annotations.Api;
|
||||
import io.swagger.annotations.ApiImplicitParam;
|
||||
@ -40,24 +40,24 @@ public class TestController extends BaseController
|
||||
|
||||
@ApiOperation("获取用户列表")
|
||||
@GetMapping("/list")
|
||||
public AjaxResult userList()
|
||||
public R<List<UserEntity>> userList()
|
||||
{
|
||||
List<UserEntity> userList = new ArrayList<UserEntity>(users.values());
|
||||
return AjaxResult.success(userList);
|
||||
return R.ok(userList);
|
||||
}
|
||||
|
||||
@ApiOperation("获取用户详细")
|
||||
@ApiImplicitParam(name = "userId", value = "用户ID", required = true, dataType = "int", paramType = "path", dataTypeClass = Integer.class)
|
||||
@GetMapping("/{userId}")
|
||||
public AjaxResult getUser(@PathVariable Integer userId)
|
||||
public R<UserEntity> getUser(@PathVariable Integer userId)
|
||||
{
|
||||
if (!users.isEmpty() && users.containsKey(userId))
|
||||
{
|
||||
return AjaxResult.success(users.get(userId));
|
||||
return R.ok(users.get(userId));
|
||||
}
|
||||
else
|
||||
{
|
||||
return error("用户不存在");
|
||||
return R.fail("用户不存在");
|
||||
}
|
||||
}
|
||||
|
||||
@ -69,44 +69,46 @@ public class TestController extends BaseController
|
||||
@ApiImplicitParam(name = "mobile", value = "用户手机", dataType = "String", dataTypeClass = String.class)
|
||||
})
|
||||
@PostMapping("/save")
|
||||
public AjaxResult save(UserEntity user)
|
||||
public R<String> save(UserEntity user)
|
||||
{
|
||||
if (StringUtils.isNull(user) || StringUtils.isNull(user.getUserId()))
|
||||
{
|
||||
return error("用户ID不能为空");
|
||||
return R.fail("用户ID不能为空");
|
||||
}
|
||||
return AjaxResult.success(users.put(user.getUserId(), user));
|
||||
users.put(user.getUserId(), user);
|
||||
return R.ok();
|
||||
}
|
||||
|
||||
@ApiOperation("更新用户")
|
||||
@PutMapping("/update")
|
||||
public AjaxResult update(@RequestBody UserEntity user)
|
||||
public R<String> update(@RequestBody UserEntity user)
|
||||
{
|
||||
if (StringUtils.isNull(user) || StringUtils.isNull(user.getUserId()))
|
||||
{
|
||||
return error("用户ID不能为空");
|
||||
return R.fail("用户ID不能为空");
|
||||
}
|
||||
if (users.isEmpty() || !users.containsKey(user.getUserId()))
|
||||
{
|
||||
return error("用户不存在");
|
||||
return R.fail("用户不存在");
|
||||
}
|
||||
users.remove(user.getUserId());
|
||||
return AjaxResult.success(users.put(user.getUserId(), user));
|
||||
users.put(user.getUserId(), user);
|
||||
return R.ok();
|
||||
}
|
||||
|
||||
@ApiOperation("删除用户信息")
|
||||
@ApiImplicitParam(name = "userId", value = "用户ID", required = true, dataType = "int", paramType = "path", dataTypeClass = Integer.class)
|
||||
@DeleteMapping("/{userId}")
|
||||
public AjaxResult delete(@PathVariable Integer userId)
|
||||
public R<String> delete(@PathVariable Integer userId)
|
||||
{
|
||||
if (!users.isEmpty() && users.containsKey(userId))
|
||||
{
|
||||
users.remove(userId);
|
||||
return success();
|
||||
return R.ok();
|
||||
}
|
||||
else
|
||||
{
|
||||
return error("用户不存在");
|
||||
return R.fail("用户不存在");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -3,9 +3,9 @@ ruoyi:
|
||||
# 名称
|
||||
name: RuoYi
|
||||
# 版本
|
||||
version: 4.7.1
|
||||
version: 4.7.6
|
||||
# 版权年份
|
||||
copyrightYear: 2021
|
||||
copyrightYear: 2022
|
||||
# 实例演示开关
|
||||
demoEnabled: true
|
||||
# 文件路径 示例( Windows配置D:/ruoyi/uploadPath,Linux配置 /home/ruoyi/uploadPath)
|
||||
@ -23,10 +23,13 @@ server:
|
||||
tomcat:
|
||||
# tomcat的URI编码
|
||||
uri-encoding: UTF-8
|
||||
# 连接数满后的排队数,默认为100
|
||||
accept-count: 1000
|
||||
threads:
|
||||
# tomcat最大线程数,默认为200
|
||||
max-threads: 800
|
||||
# Tomcat启动初始化的线程数,默认值25
|
||||
min-spare-threads: 30
|
||||
max: 800
|
||||
# Tomcat启动初始化的线程数,默认值10
|
||||
min-spare: 100
|
||||
|
||||
# 日志配置
|
||||
logging:
|
||||
|
@ -1,11 +1,11 @@
|
||||
/*!
|
||||
* bootstrap-fileinput v5.2.4
|
||||
* bootstrap-fileinput v5.5.2
|
||||
* http://plugins.krajee.com/file-input
|
||||
*
|
||||
* Krajee default styling for bootstrap-fileinput.
|
||||
*
|
||||
* Author: Kartik Visweswaran
|
||||
* Copyright: 2014 - 2021, Kartik Visweswaran, Krajee.com
|
||||
* Copyright: 2014 - 2022, Kartik Visweswaran, Krajee.com
|
||||
*
|
||||
* Licensed under the BSD-3-Clause
|
||||
* https://github.com/kartik-v/bootstrap-fileinput/blob/master/LICENSE.md
|
||||
@ -50,6 +50,10 @@ input[type=file].file-loading {
|
||||
display: none;
|
||||
}
|
||||
|
||||
.file-caption .input-group {
|
||||
align-items: center;
|
||||
}
|
||||
|
||||
.btn-file input[type=file],
|
||||
.file-caption-icon,
|
||||
.file-preview .fileinput-remove,
|
||||
@ -274,6 +278,7 @@ input[type=file].file-loading {
|
||||
padding: 6px;
|
||||
float: left;
|
||||
text-align: center;
|
||||
|
||||
}
|
||||
|
||||
.krajee-default.file-preview-frame .kv-file-content {
|
||||
@ -281,12 +286,6 @@ input[type=file].file-loading {
|
||||
height: 160px;
|
||||
}
|
||||
|
||||
.krajee-default .file-preview-other-frame {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
}
|
||||
|
||||
.krajee-default.file-preview-frame .kv-file-content.kv-pdf-rendered {
|
||||
width: 400px;
|
||||
}
|
||||
@ -330,7 +329,7 @@ input[type=file].file-loading {
|
||||
text-align: center;
|
||||
padding-top: 4px;
|
||||
font-size: 11px;
|
||||
color: #777;
|
||||
color: #999;
|
||||
margin-bottom: 30px;
|
||||
}
|
||||
|
||||
@ -426,19 +425,12 @@ input[type=file].file-loading {
|
||||
right: 0;
|
||||
}
|
||||
|
||||
.file-zoom-dialog .kv-zoom-caption {
|
||||
max-width: 50%;
|
||||
overflow: hidden;
|
||||
white-space: nowrap;
|
||||
text-overflow: ellipsis;
|
||||
}
|
||||
|
||||
.file-zoom-dialog .kv-zoom-header {
|
||||
padding: 0.5rem;
|
||||
}
|
||||
|
||||
.file-zoom-dialog .kv-zoom-body {
|
||||
padding: 0.25rem 0.5rem 0.25rem 0;
|
||||
padding: 0.25rem;
|
||||
}
|
||||
|
||||
.file-zoom-dialog .kv-zoom-description {
|
||||
@ -554,6 +546,10 @@ input[type=file].file-loading {
|
||||
z-index: 3000;
|
||||
}
|
||||
|
||||
.kv-zoom-actions {
|
||||
min-width: 140px;
|
||||
}
|
||||
|
||||
.kv-zoom-actions .btn-kv {
|
||||
margin-left: 3px;
|
||||
}
|
||||
@ -568,15 +564,6 @@ input[type=file].file-loading {
|
||||
background: transparent;
|
||||
}
|
||||
|
||||
.file-zoom-content > * {
|
||||
display: inline-block;
|
||||
vertical-align: middle;
|
||||
}
|
||||
|
||||
.file-zoom-content .kv-spacer {
|
||||
height: 100%;
|
||||
}
|
||||
|
||||
.file-zoom-content .file-preview-image {
|
||||
max-height: 100%;
|
||||
}
|
||||
@ -669,3 +656,33 @@ input[type=file].file-loading {
|
||||
.file-preview .kv-zoom-cache {
|
||||
display: none;
|
||||
}
|
||||
|
||||
.file-preview-other-frame, .file-preview-object, .kv-file-content, .kv-zoom-body {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
}
|
||||
|
||||
.btn-kv-rotate,
|
||||
.kv-file-rotate {
|
||||
display: none;
|
||||
}
|
||||
|
||||
.rotatable:not(.hide-rotate) .btn-kv-rotate,
|
||||
.rotatable:not(.hide-rotate) .kv-file-rotate {
|
||||
display: inline-block;
|
||||
}
|
||||
|
||||
.rotatable .file-zoom-detail,
|
||||
.rotatable .kv-file-content,
|
||||
.rotatable .kv-file-content > :first-child {
|
||||
transform-origin: center center;
|
||||
}
|
||||
|
||||
.rotate-animate {
|
||||
transition: transform 0.3s ease;
|
||||
}
|
||||
|
||||
.kv-overflow-hidden {
|
||||
overflow: hidden;
|
||||
}
|
File diff suppressed because it is too large
Load Diff
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
@ -4,10 +4,11 @@
|
||||
* @update: zhixin wen <wenzhixin2010@gmail.com>
|
||||
*/
|
||||
|
||||
const Utils = $.fn.bootstrapTable.utils
|
||||
var Utils = $.fn.bootstrapTable.utils
|
||||
|
||||
$.extend($.fn.bootstrapTable.defaults, {
|
||||
autoRefresh: false,
|
||||
showAutoRefresh: true,
|
||||
autoRefreshInterval: 60,
|
||||
autoRefreshSilent: true,
|
||||
autoRefreshStatus: true,
|
||||
@ -17,6 +18,7 @@ $.extend($.fn.bootstrapTable.defaults, {
|
||||
$.extend($.fn.bootstrapTable.defaults.icons, {
|
||||
autoRefresh: {
|
||||
bootstrap3: 'glyphicon-time icon-time',
|
||||
bootstrap5: 'bi-clock',
|
||||
materialize: 'access_time',
|
||||
'bootstrap-table': 'icon-clock'
|
||||
}[$.fn.bootstrapTable.theme] || 'fa-clock'
|
||||
|
@ -2,7 +2,7 @@
|
||||
* @author zhixin wen <wenzhixin2010@gmail.com>
|
||||
*/
|
||||
|
||||
const Utils = $.fn.bootstrapTable.utils
|
||||
var Utils = $.fn.bootstrapTable.utils
|
||||
|
||||
// Reasonable defaults
|
||||
const PIXEL_STEP = 10
|
||||
@ -225,6 +225,7 @@ $.BootstrapTable = class extends $.BootstrapTable {
|
||||
const initFixedBody = ($fixedColumns, $fixedHeader) => {
|
||||
$fixedColumns.find('.fixed-table-body').remove()
|
||||
$fixedColumns.append(this.$tableBody.clone(true))
|
||||
$fixedColumns.find('.fixed-table-body table').removeAttr('id')
|
||||
|
||||
const $fixedBody = $fixedColumns.find('.fixed-table-body')
|
||||
|
||||
|
@ -1,8 +1,9 @@
|
||||
/**
|
||||
* @author zhixin wen <wenzhixin2010@gmail.com>
|
||||
* @author: Dustin Utecht
|
||||
* @github: https://github.com/UtechtDustin
|
||||
*/
|
||||
|
||||
const Utils = $.fn.bootstrapTable.utils
|
||||
var Utils = $.fn.bootstrapTable.utils
|
||||
|
||||
$.extend($.fn.bootstrapTable.defaults, {
|
||||
customView: false,
|
||||
|
@ -4,7 +4,7 @@
|
||||
* extensions: https://github.com/vitalets/x-editable
|
||||
*/
|
||||
|
||||
const Utils = $.fn.bootstrapTable.utils
|
||||
var Utils = $.fn.bootstrapTable.utils
|
||||
|
||||
$.extend($.fn.bootstrapTable.defaults, {
|
||||
editable: true,
|
||||
|
@ -3,7 +3,7 @@
|
||||
* extensions: https://github.com/hhurz/tableExport.jquery.plugin
|
||||
*/
|
||||
|
||||
const Utils = $.fn.bootstrapTable.utils
|
||||
var Utils = $.fn.bootstrapTable.utils
|
||||
|
||||
const TYPE_NAME = {
|
||||
json: 'JSON',
|
||||
@ -43,6 +43,7 @@ $.extend($.fn.bootstrapTable.columnDefaults, {
|
||||
$.extend($.fn.bootstrapTable.defaults.icons, {
|
||||
export: {
|
||||
bootstrap3: 'glyphicon-export icon-share',
|
||||
bootstrap5: 'bi-download',
|
||||
materialize: 'file_download',
|
||||
'bootstrap-table': 'icon-download'
|
||||
}[$.fn.bootstrapTable.theme] || 'fa-download'
|
||||
@ -91,7 +92,10 @@ $.BootstrapTable = class extends $.BootstrapTable {
|
||||
|
||||
this.buttons = Object.assign(this.buttons, {
|
||||
export: {
|
||||
html: exportTypes.length === 1 ? `
|
||||
html:
|
||||
(() => {
|
||||
if (exportTypes.length === 1) {
|
||||
return `
|
||||
<div class="export ${this.constants.classes.buttonsDropdown}"
|
||||
data-type="${exportTypes[0]}">
|
||||
<button class="${this.constants.buttonsClass}"
|
||||
@ -102,7 +106,12 @@ $.BootstrapTable = class extends $.BootstrapTable {
|
||||
${o.showButtonText ? o.formatExport() : ''}
|
||||
</button>
|
||||
</div>
|
||||
` : `
|
||||
`
|
||||
}
|
||||
|
||||
const html = []
|
||||
|
||||
html.push(`
|
||||
<div class="export ${this.constants.classes.buttonsDropdown}">
|
||||
<button class="${this.constants.buttonsClass} dropdown-toggle"
|
||||
aria-label="Export"
|
||||
@ -113,8 +122,21 @@ $.BootstrapTable = class extends $.BootstrapTable {
|
||||
${o.showButtonText ? o.formatExport() : ''}
|
||||
${this.constants.html.dropdownCaret}
|
||||
</button>
|
||||
</div>
|
||||
`
|
||||
${this.constants.html.toolbarDropdown[0]}
|
||||
`)
|
||||
|
||||
for (const type of exportTypes) {
|
||||
if (TYPE_NAME.hasOwnProperty(type)) {
|
||||
const $item = $(Utils.sprintf(this.constants.html.pageDropdownItem, '', TYPE_NAME[type]))
|
||||
|
||||
$item.attr('data-type', type)
|
||||
html.push($item.prop('outerHTML'))
|
||||
}
|
||||
}
|
||||
|
||||
html.push(this.constants.html.toolbarDropdown[1], '</div>')
|
||||
return html.join('')
|
||||
})
|
||||
}
|
||||
})
|
||||
}
|
||||
@ -126,32 +148,14 @@ $.BootstrapTable = class extends $.BootstrapTable {
|
||||
return
|
||||
}
|
||||
|
||||
let $menu = $(this.constants.html.toolbarDropdown.join(''))
|
||||
let $items = this.$export
|
||||
|
||||
if (exportTypes.length > 1) {
|
||||
this.$export.append($menu)
|
||||
|
||||
// themes support
|
||||
if ($menu.children().length) {
|
||||
$menu = $menu.children().eq(0)
|
||||
}
|
||||
for (const type of exportTypes) {
|
||||
if (TYPE_NAME.hasOwnProperty(type)) {
|
||||
const $item = $(Utils.sprintf(this.constants.html.pageDropdownItem,
|
||||
'', TYPE_NAME[type]))
|
||||
|
||||
$item.attr('data-type', type)
|
||||
$menu.append($item)
|
||||
}
|
||||
}
|
||||
|
||||
$items = $menu.children()
|
||||
}
|
||||
|
||||
this.updateExportButton()
|
||||
let $exportButtons = this.$export.find('[data-type]')
|
||||
|
||||
$items.click(e => {
|
||||
if (exportTypes.length === 1) {
|
||||
$exportButtons = this.$export.find('button')
|
||||
}
|
||||
|
||||
$exportButtons.click(e => {
|
||||
e.preventDefault()
|
||||
|
||||
const type = $(e.currentTarget).data('type')
|
||||
|
@ -2,7 +2,7 @@
|
||||
* @update zhixin wen <wenzhixin2010@gmail.com>
|
||||
*/
|
||||
|
||||
const Utils = $.fn.bootstrapTable.utils
|
||||
var Utils = $.fn.bootstrapTable.utils
|
||||
|
||||
function printPageBuilderDefault (table) {
|
||||
return `
|
||||
@ -134,8 +134,9 @@ $.BootstrapTable = class extends $.BootstrapTable {
|
||||
|
||||
doPrint (data) {
|
||||
const formatValue = (row, i, column) => {
|
||||
const value = Utils.calculateObjectValue(column, column.printFormatter,
|
||||
[row[column.field], row, i], row[column.field])
|
||||
const value = Utils.calculateObjectValue(column,
|
||||
column.printFormatter || column.formatter,
|
||||
[$.common.getItemField(row, column.field), row, i], $.common.getItemField(row, column.field))
|
||||
|
||||
return typeof value === 'undefined' || value === null ?
|
||||
this.options.undefinedText : value
|
||||
|
@ -13,7 +13,7 @@ $.extend($.fn.bootstrapTable.defaults, {
|
||||
onDragStyle: null,
|
||||
onDropStyle: null,
|
||||
onDragClass: 'reorder_rows_onDragClass',
|
||||
dragHandle: '>tbody>tr>td',
|
||||
dragHandle: '>tbody>tr>td:not(.bs-checkbox)',
|
||||
useRowAttrFunc: false,
|
||||
// eslint-disable-next-line no-unused-vars
|
||||
onReorderRowsDrag (row) {
|
||||
|
@ -43,6 +43,8 @@ $.BootstrapTable = class extends $.BootstrapTable {
|
||||
.on('column-switch.bs.table page-change.bs.table', () => {
|
||||
reInitResizable(this)
|
||||
})
|
||||
|
||||
reInitResizable(this)
|
||||
}
|
||||
|
||||
toggleView (...args) {
|
||||
|
@ -20,6 +20,8 @@
|
||||
target.hiddenColumns = []; // 用于存放被隐藏列的field
|
||||
target.lastAjaxParams; // 用户最后一次请求的参数
|
||||
target.isFixWidth=false; // 是否有固定宽度
|
||||
target.totalRows = 0; // 记录总数
|
||||
target.totalPages = 0; // 总页数
|
||||
// 初始化
|
||||
var init = function() {
|
||||
// 初始化容器
|
||||
@ -148,12 +150,30 @@
|
||||
if (options.height) {
|
||||
$tbody.css("height", options.height);
|
||||
}
|
||||
if (options.pagination) {
|
||||
var $pagination = $('<div class="fixed-table-pagination"></div>');
|
||||
target.append($pagination);
|
||||
}
|
||||
}
|
||||
// 初始化数据服务
|
||||
var initServer = function(parms) {
|
||||
if (options.pagination) {
|
||||
if(parms == undefined || parms == null) {
|
||||
parms = {};
|
||||
}
|
||||
parms[options.parentCode] = options.rootIdValue;
|
||||
}
|
||||
// 加载数据前先清空
|
||||
target.data_list = {};
|
||||
target.data_obj = {};
|
||||
// 设置请求分页参数
|
||||
if (options.pagination) {
|
||||
var params = {};
|
||||
params.offset = options.pageSize * (options.pageNumber - 1);
|
||||
params.limit = options.pageSize;
|
||||
var curParams = { pageSize: params.limit, pageNum: params.offset / params.limit + 1 };
|
||||
parms = $.extend(curParams, parms);
|
||||
}
|
||||
var $tbody = target.find("tbody");
|
||||
// 添加加载loading
|
||||
var $loading = '<tr><td colspan="' + options.columns.length + '"><div style="display: block;text-align: center;">正在努力地加载数据中,请稍候……</div></td></tr>'
|
||||
@ -162,8 +182,8 @@
|
||||
$.ajax({
|
||||
type: options.type,
|
||||
url: options.url,
|
||||
data: parms ? parms : options.ajaxParams,
|
||||
dataType: "JSON",
|
||||
data: $.extend(parms, options.ajaxParams),
|
||||
dataType: "json",
|
||||
success: function(data, textStatus, jqXHR) {
|
||||
data = calculateObjectValue(options, options.responseHandler, [data], data);
|
||||
renderTable(data);
|
||||
@ -172,7 +192,7 @@
|
||||
error: function(xhr, textStatus) {
|
||||
var _errorMsg = '<tr><td colspan="' + options.columns.length + '"><div style="display: block;text-align: center;">' + xhr.responseText + '</div></td></tr>'
|
||||
$tbody.html(_errorMsg);
|
||||
},
|
||||
}
|
||||
});
|
||||
} else {
|
||||
renderTable(options.data);
|
||||
@ -180,6 +200,17 @@
|
||||
}
|
||||
// 加载完数据后渲染表格
|
||||
var renderTable = function(data) {
|
||||
var list, totalPage = 0, currPage = 0;
|
||||
if (options.pagination) {
|
||||
list = data.rows; // 数据
|
||||
currPage = options.pageNumber; // 当前页
|
||||
totalPage = ~~((data.total - 1) / options.pageSize) + 1 // 总页数
|
||||
target.totalPages = totalPage;
|
||||
target.totalRows = data.total; // 总记录数
|
||||
} else {
|
||||
list = data;
|
||||
}
|
||||
data = list;
|
||||
var $tbody = target.find("tbody");
|
||||
// 先清空
|
||||
$tbody.html("");
|
||||
@ -196,22 +227,24 @@
|
||||
if (rootNode) {
|
||||
$.each(rootNode, function(i, item) {
|
||||
var _child_row_id = "row_id_" + i
|
||||
recursionNode(item, 1, _child_row_id, "row_root");
|
||||
recursionNode(item, 1, _child_row_id, "row_root", item[options.code]);
|
||||
});
|
||||
}
|
||||
// 下边的操作主要是为了查询时让一些没有根节点的节点显示
|
||||
$.each(data, function(i, item) {
|
||||
if (!item.isShow) {
|
||||
var tr = renderRow(item, false, 1, "", "");
|
||||
var tr = renderRow(item, false, 1, "", "", options.pagination, item[options.code]);
|
||||
$tbody.append(tr);
|
||||
}
|
||||
});
|
||||
target.append($tbody);
|
||||
registerExpanderEvent();
|
||||
registerRowClickEvent();
|
||||
initHiddenColumns();
|
||||
// 动态设置表头宽度
|
||||
autoTheadWidth();
|
||||
if (options.pagination) {
|
||||
initPagination(totalPage, currPage);
|
||||
}
|
||||
// 移动端适配
|
||||
var treetableTable = $(target).parent('.treetable-table');
|
||||
var availableHeight = treetableTable.outerWidth();
|
||||
@ -229,6 +262,180 @@
|
||||
$(target).attr('style','width:' + w +'px');
|
||||
}
|
||||
}
|
||||
// 初始化分页
|
||||
var initPagination = function (totalPage,currPage) {
|
||||
var $pagination = target.find(".fixed-table-pagination");
|
||||
$pagination.empty();
|
||||
var html = [];
|
||||
var pageFrom = (options.pageNumber - 1) * options.pageSize + 1;
|
||||
var pageTo = options.pageNumber * options.pageSize;
|
||||
if (pageTo > target.totalRows) {
|
||||
pageTo = target.totalRows;
|
||||
}
|
||||
html.push('<div class="pull-left pagination-detail">');
|
||||
html.push('<span class="pagination-info">' + formatShowingRows(pageFrom, pageTo, target.totalRows) + '</span>');
|
||||
var pageList = false;
|
||||
$.each(options.pageList, function (i, page) {
|
||||
if(target.totalRows > page){
|
||||
pageList = true;
|
||||
}
|
||||
})
|
||||
if(pageList){
|
||||
var _page_list = [];
|
||||
_page_list.push('<span class="page-list">');
|
||||
_page_list.push('<span class="btn-group dropup">');
|
||||
_page_list.push('<button type="button" class="btn btn-default btn-outline dropdown-toggle" data-toggle="dropdown">');
|
||||
_page_list.push('<span class="page-size">' + options.pageSize + '</span>');
|
||||
_page_list.push('<span class="caret"></span>');
|
||||
_page_list.push('</button>');
|
||||
_page_list.push('<ul class="dropdown-menu" role="menu">');
|
||||
$.each(options.pageList, function (i, page) {
|
||||
if(page == options.pageSize){
|
||||
_page_list.push('<li class="active"><a href="javascript:void(0)">' + page + '</a></li>');
|
||||
}
|
||||
else if(page >= target.totalRows && i === 1){
|
||||
_page_list.push('<li><a href="javascript:void(0)">' + page + '</a></li>');
|
||||
}
|
||||
else if(page <= target.totalRows){
|
||||
_page_list.push('<li><a href="javascript:void(0)">' + page + '</a></li>');
|
||||
}
|
||||
})
|
||||
_page_list.push('</ul>');
|
||||
_page_list.push('</span>');
|
||||
html.push(formatRecordsPerPage(_page_list.join('')))
|
||||
html.push('</span>');
|
||||
}
|
||||
html.push('</div>');
|
||||
|
||||
if(totalPage > 1){
|
||||
html.push('<div class="pull-right pagination">');
|
||||
html.push('<ul class="pagination pagination-outline">');
|
||||
html.push('<li class="page-pre"><a href="javascript:void(0)">' + options.paginationPreText + '</a></li>');
|
||||
var from, to;
|
||||
if (totalPage < 5) {
|
||||
from = 1;
|
||||
to = totalPage;
|
||||
} else {
|
||||
from = currPage - 2;
|
||||
to = from + 4;
|
||||
if (from < 1) {
|
||||
from = 1;
|
||||
to = 5;
|
||||
}
|
||||
if (to > totalPage) {
|
||||
to = totalPage;
|
||||
from = to - 4;
|
||||
}
|
||||
}
|
||||
|
||||
if (totalPage >= 6) {
|
||||
if (currPage >= 3) {
|
||||
html.push('<li class="page-first' + (1 == currPage ? ' active' : '') + '">', '<a href="javascript:void(0)">', 1, '</a>', '</li>');
|
||||
from++;
|
||||
}
|
||||
if (currPage >= 4) {
|
||||
if (currPage == 4 || totalPage == 6 || totalPage == 7) {
|
||||
from--;
|
||||
} else {
|
||||
html.push('<li class="page-first-separator disabled">', '<a href="javascript:void(0)">...</a>', '</li>');
|
||||
}
|
||||
to--;
|
||||
}
|
||||
}
|
||||
|
||||
if (totalPage >= 7) {
|
||||
if (currPage >= (totalPage - 2)) {
|
||||
from--;
|
||||
}
|
||||
}
|
||||
if (totalPage == 6) {
|
||||
if (currPage >= (totalPage - 2)) {
|
||||
to++;
|
||||
}
|
||||
} else if (totalPage >= 7) {
|
||||
if (totalPage == 7 || currPage >= (totalPage - 3)) {
|
||||
to++;
|
||||
}
|
||||
}
|
||||
|
||||
for (var i = from; i <= to; i++) {
|
||||
html.push('<li class="page-number' + (i == currPage ? ' active' : '') + '">', '<a href="javascript:void(0)">', i, '</a>', '</li>');
|
||||
}
|
||||
|
||||
if (totalPage >= 8) {
|
||||
if (currPage <= (totalPage - 4)) {
|
||||
html.push('<li class="page-last-separator disabled">', '<a href="javascript:void(0)">...</a>', '</li>');
|
||||
}
|
||||
}
|
||||
|
||||
if (totalPage >= 6) {
|
||||
if (currPage <= (totalPage - 3)) {
|
||||
html.push('<li class="page-last' + (totalPage === currPage ? ' active' : '') + '">', '<a href="javascript:void(0)">', totalPage, '</a>', '</li>');
|
||||
}
|
||||
}
|
||||
|
||||
html.push('<li class="page-next"><a href="javascript:void(0)">' + options.paginationNextText + '</a></li>');
|
||||
html.push('</ul></div>');
|
||||
}
|
||||
|
||||
$pagination.append(html.join(''));
|
||||
|
||||
var $pageList = $pagination.find('.page-list a');
|
||||
var $pre = $pagination.find('.page-pre');
|
||||
var $next = $pagination.find('.page-next');
|
||||
var $number = $pagination.find('.page-number');
|
||||
var $first = $pagination.find('.page-first');
|
||||
var $last = $pagination.find('.page-last');
|
||||
$pre.off('click').on('click', $.proxy(onPagePre, this));
|
||||
$pageList.off('click').on('click', $.proxy(onPageListChange, this));
|
||||
$number.off('click').on('click', $.proxy(onPageNumber, this));
|
||||
$first.off('click').on('click', $.proxy(onPageFirst, this));
|
||||
$last.off('click').on('click', $.proxy(onPageLast, this));
|
||||
$next.off('click').on('click', $.proxy(onPageNext, this));
|
||||
}
|
||||
var onPageListChange = function(event){
|
||||
var $this = $(event.currentTarget);
|
||||
$this.parent().addClass('active').siblings().removeClass('active');
|
||||
var $pagination = target.find(".fixed-table-pagination");
|
||||
options.pageSize = $this.text().toUpperCase() === target.totalRows ? target.totalRows : + $this.text();
|
||||
|
||||
if(target.totalRows < options.pageSize * options.pageNumber){
|
||||
options.pageNumber = 1;
|
||||
}
|
||||
$pagination.find('.page-size').text(options.pageSize);
|
||||
initServer();
|
||||
}
|
||||
var onPagePre = function(event){
|
||||
if ((options.pageNumber - 1) === 0) {
|
||||
options.pageNumber = target.totalPages;
|
||||
} else {
|
||||
options.pageNumber--;
|
||||
}
|
||||
initServer();
|
||||
}
|
||||
var onPageNumber = function(event){
|
||||
if (options.pageNumber == $(event.currentTarget).text()) {
|
||||
return;
|
||||
}
|
||||
options.pageNumber = $(event.currentTarget).text();
|
||||
initServer();
|
||||
}
|
||||
var onPageFirst = function(event){
|
||||
options.pageNumber = 1;
|
||||
initServer();
|
||||
}
|
||||
var onPageLast = function (event) {
|
||||
options.pageNumber = target.totalPages;
|
||||
initServer();
|
||||
}
|
||||
var onPageNext = function(event){
|
||||
if ((options.pageNumber + 1) > target.totalPages) {
|
||||
options.pageNumber = 1;
|
||||
} else {
|
||||
options.pageNumber++;
|
||||
}
|
||||
initServer();
|
||||
}
|
||||
// 动态设置表头宽度
|
||||
var autoTheadWidth = function(initFlag) {
|
||||
if(options.height>0){
|
||||
@ -269,6 +476,14 @@
|
||||
$.each(data, function(index, item) {
|
||||
// 添加一个默认属性,用来判断当前节点有没有被显示
|
||||
item.isShow = false;
|
||||
// 是否分页
|
||||
if (options.pagination) {
|
||||
if (item.isTreeLeaf == undefined || item.isTreeLeaf == null) {
|
||||
item.isTreeLeaf = false;
|
||||
} else {
|
||||
item.isTreeLeaf = (item["isTreeLeaf"] == 1 ? true: false) || ((item["isTreeLeaf"] == 'true' || item["isTreeLeaf"] == true) ? true: false);
|
||||
}
|
||||
}
|
||||
// 顶级节点校验判断,兼容0,'0','',null
|
||||
var _defaultRootFlag = item[options.parentCode] == '0' ||
|
||||
item[options.parentCode] == 0 ||
|
||||
@ -295,26 +510,26 @@
|
||||
});
|
||||
}
|
||||
// 递归获取子节点并且设置子节点
|
||||
var recursionNode = function(parentNode, lv, row_id, p_id) {
|
||||
var recursionNode = function(parentNode, lv, row_id, p_id, k) {
|
||||
var $tbody = target.find("tbody");
|
||||
var _ls = target.data_list["_n_" + parentNode[options.code]];
|
||||
var $tr = renderRow(parentNode, _ls ? true : false, lv, row_id, p_id);
|
||||
var $tr = renderRow(parentNode, _ls ? true : false, lv, row_id, p_id, options.pagination, k);
|
||||
$tbody.append($tr);
|
||||
if (_ls) {
|
||||
$.each(_ls, function(i, item) {
|
||||
var _child_row_id = row_id + "_" + i
|
||||
recursionNode(item, (lv + 1), _child_row_id, row_id)
|
||||
recursionNode(item, (lv + 1), _child_row_id, row_id, item[options.code])
|
||||
});
|
||||
}
|
||||
};
|
||||
// 绘制行
|
||||
var renderRow = function(item, isP, lv, row_id, p_id) {
|
||||
var renderRow = function(item, isP, lv, row_id, p_id, _pagination, k) {
|
||||
// 标记已显示
|
||||
item.isShow = true;
|
||||
item.row_id = row_id;
|
||||
item.p_id = p_id;
|
||||
item.lv = lv;
|
||||
var $tr = $('<tr id="' + row_id + '" pid="' + p_id + '"></tr>');
|
||||
var $tr = $('<tr id="' + row_id + '" data-id="' + k + '"pid="' + p_id + '"></tr>');
|
||||
var _icon = options.expanderCollapsedClass;
|
||||
if (options.expandAll) {
|
||||
$tr.css("display", "table");
|
||||
@ -329,6 +544,10 @@
|
||||
$tr.css("display", "none");
|
||||
}
|
||||
_icon = options.expanderCollapsedClass;
|
||||
} else if (_pagination) {
|
||||
if (item.isTreeLeaf) {
|
||||
_icon = options.expanderCollapsedClass;
|
||||
}
|
||||
} else {
|
||||
$tr.css("display", "none");
|
||||
_icon = options.expanderCollapsedClass;
|
||||
@ -375,12 +594,20 @@
|
||||
$td.text(getItemField(item, column.field));
|
||||
}
|
||||
if (options.expandColumn == index) {
|
||||
if (_pagination) {
|
||||
if (item["isTreeLeaf"]) {
|
||||
$td.prepend('<span class="treetable-expander ' + _icon + '"></span>');
|
||||
} else {
|
||||
$td.prepend('<span class="treetable-expander"></span>')
|
||||
}
|
||||
} else {
|
||||
if (!isP) {
|
||||
$td.prepend('<span class="treetable-expander"></span>')
|
||||
} else {
|
||||
$td.prepend('<span class="treetable-expander ' + _icon + '"></span>')
|
||||
$td.prepend('<span class="treetable-expander ' + _icon + '"></span>');
|
||||
}
|
||||
for (var int = 0; int < (lv - 1); int++) {
|
||||
}
|
||||
for (var int = 0; int < (lv - options.expandColumn); int++) {
|
||||
$td.prepend('<span class="treetable-indent"></span>')
|
||||
}
|
||||
}
|
||||
@ -440,6 +667,8 @@
|
||||
$(this).addClass("treetable-selected");
|
||||
}
|
||||
}
|
||||
var _rowData = target.data_obj["id_" + $(this).data('id')];
|
||||
calculateObjectValue(options, options.onClickRow, [_rowData], _rowData);
|
||||
}
|
||||
});
|
||||
}
|
||||
@ -452,7 +681,9 @@
|
||||
if (_isExpanded || _isCollapsed) {
|
||||
var tr = $(this).parent().parent();
|
||||
var row_id = tr.attr("id");
|
||||
var _ls = target.find("tbody").find("tr[id^='" + row_id + "_']"); //下所有
|
||||
var _id = tr.attr("data-id");
|
||||
var _ls = target.find("tbody").find("tr[id^='" + row_id + "_']");
|
||||
if (!options.pagination) {
|
||||
if (_isExpanded) {
|
||||
$(this).removeClass(options.expanderExpandedClass);
|
||||
$(this).addClass(options.expanderCollapsedClass);
|
||||
@ -466,14 +697,63 @@
|
||||
$(this).addClass(options.expanderExpandedClass);
|
||||
if (_ls && _ls.length > 0) {
|
||||
$.each(_ls, function(index, item) {
|
||||
// 父icon
|
||||
var _p_icon = $("#" + $(item).attr("pid")).children().eq(options.expandColumn).find(".treetable-expander");
|
||||
if (_p_icon.hasClass(options.expanderExpandedClass)) {
|
||||
var _p_display = $("#" + $(item).attr("pid")).css('display');
|
||||
if (_p_icon.hasClass(options.expanderExpandedClass) && _p_display == 'table') {
|
||||
$(item).css("display", "table");
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
} else {
|
||||
var _ls = target.find("tbody").find("tr[id^='" + row_id + "_']");
|
||||
if (_ls && _ls.length > 0) {
|
||||
if (_isExpanded) {
|
||||
$.each(_ls, function(index, item) {
|
||||
$(item).css("display", "none");
|
||||
});
|
||||
} else {
|
||||
$.each(_ls, function(index, item) {
|
||||
var _icon = $(item).eq(options.expandColumn).find(".treetable-expander");
|
||||
if (_icon && _icon.hasClass(options.expanderExpandedClass)) {
|
||||
$(item).css("display", "table");
|
||||
} else {
|
||||
$(item).css("display", "table");
|
||||
}
|
||||
});
|
||||
}
|
||||
} else {
|
||||
if (options.pagination) {
|
||||
var parms = {};
|
||||
parms[options.parentCode] = _id;
|
||||
if (options.dataUrl) {
|
||||
$.ajax({
|
||||
type: options.type,
|
||||
url: options.dataUrl,
|
||||
data: $.extend(parms, options.ajaxParams),
|
||||
dataType: "json",
|
||||
success: function(data, textStatus, jqXHR) {
|
||||
$("#" + row_id + "_load").remove();
|
||||
var list = data;
|
||||
data = list;
|
||||
target.appendData(data)
|
||||
},
|
||||
error: function(xhr, textStatus) {
|
||||
var _errorMsg = '<tr><td colspan="' + options.columns.length + '"><div style="display: block;text-align: center;">' + xhr.responseText + '</div></td></tr>'
|
||||
$("#" + row_id).after(_errorMsg);
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
}
|
||||
if (_isExpanded) {
|
||||
$(this).removeClass(options.expanderExpandedClass);
|
||||
$(this).addClass(options.expanderCollapsedClass);
|
||||
} else {
|
||||
$(this).removeClass(options.expanderCollapsedClass);
|
||||
$(this).addClass(options.expanderExpandedClass);
|
||||
}
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
@ -488,6 +768,9 @@
|
||||
target.appendData = function(data) {
|
||||
// 下边的操作主要是为了查询时让一些没有根节点的节点显示
|
||||
$.each(data, function(i, item) {
|
||||
if (options.pagination) {
|
||||
item.__nodes = (item["nodes"] == 1 ? true: false) || ((item["nodes"] == 'true' || item["nodes"] == true) ? true: false);
|
||||
}
|
||||
var _data = target.data_obj["id_" + item[options.code]];
|
||||
var _p_data = target.data_obj["id_" + item[options.parentCode]];
|
||||
var _c_list = target.data_list["_n_" + item[options.parentCode]];
|
||||
@ -509,7 +792,7 @@
|
||||
}
|
||||
_lv = _p_data.lv + 1; //如果有父
|
||||
// 绘制行
|
||||
tr = renderRow(item, false, _lv, row_id, p_id);
|
||||
tr = renderRow(item, true, _lv, row_id, p_id, options.pagination, item[options.code]);
|
||||
|
||||
var _p_icon = $("#" + _p_data.row_id).children().eq(options.expandColumn).find(".treetable-expander");
|
||||
var _isExpanded = _p_icon.hasClass(options.expanderExpandedClass);
|
||||
@ -531,12 +814,11 @@
|
||||
} else {
|
||||
// 计算父的同级下一行
|
||||
var _tmp_ls = _p_data.row_id.split("_");
|
||||
var _p_next = _p_data.row_id.substring(0, _p_data.row_id.length - 1) + (parseInt(_tmp_ls[_tmp_ls.length - 1]) + 1);
|
||||
// 画上
|
||||
$("#" + _p_next).before(tr);
|
||||
var _p_next = _p_data.row_id.substring(0, _p_data.row_id.length - (_tmp_ls[_tmp_ls.length - 1] + "").length) + (parseInt(_tmp_ls[_tmp_ls.length - 1]) + 1);
|
||||
$("#" + _p_data.row_id).after(tr);
|
||||
}
|
||||
} else {
|
||||
tr = renderRow(item, false, _lv, row_id, p_id);
|
||||
tr = renderRow(item, false, _lv, row_id, p_id, options.pagination, item[options.code]);
|
||||
if (_data) {
|
||||
$("#" + _data.row_id).before(tr);
|
||||
$("#" + _data.row_id).remove();
|
||||
@ -660,6 +942,12 @@
|
||||
}
|
||||
return defaultValue;
|
||||
};
|
||||
var formatRecordsPerPage = function (pageNumber) {
|
||||
return '每页显示 ' + pageNumber + ' 条记录';
|
||||
};
|
||||
var formatShowingRows = function (pageFrom, pageTo, totalRows) {
|
||||
return '显示第 ' + pageFrom + ' 到第 ' + pageTo + ' 条记录,总共 ' + totalRows + ' 条记录。';
|
||||
};
|
||||
// 初始化
|
||||
init();
|
||||
return target;
|
||||
@ -732,12 +1020,12 @@
|
||||
$.fn.bootstrapTreeTable.defaults = {
|
||||
code: 'code', // 选取记录返回的值,用于设置父子关系
|
||||
parentCode: 'parentCode', // 用于设置父子关系
|
||||
rootIdValue: null, // 设置根节点id值----可指定根节点,默认为null,"",0,"0"
|
||||
rootIdValue: 0, // 设置根节点id值----可指定根节点,默认为null,"",0,"0"
|
||||
data: null, // 构造table的数据集合
|
||||
type: "GET", // 请求数据的ajax类型
|
||||
url: null, // 请求数据的ajax的url
|
||||
ajaxParams: {}, // 请求数据的ajax的data属性
|
||||
expandColumn: 0, // 在哪一列上面显示展开按钮
|
||||
expandColumn: 1, // 在哪一列上面显示展开按钮
|
||||
expandAll: false, // 是否全部展开
|
||||
expandFirst: true, // 是否默认第一级展开--expandAll为false时生效
|
||||
striped: false, // 是否各行渐变色
|
||||
@ -747,10 +1035,18 @@
|
||||
columns: [], // 列
|
||||
toolbar: null, // 顶部工具条
|
||||
height: 0, // 表格高度
|
||||
pagination: false, // 是否显示分页
|
||||
dataUrl: null, // 加载子节点异步请求数据url
|
||||
pageNumber: 1, // 当前页条数
|
||||
pageSize: 10, // 每页的记录行数
|
||||
onClickRow: null, // 单击某行事件
|
||||
pageList: [10, 25, 50], // 可供选择的每页的行数
|
||||
showTitle: true, // 是否采用title属性显示字段内容(被formatter格式化的字段不会显示)
|
||||
showSearch: true, // 是否显示检索信息
|
||||
showColumns: true, // 是否显示内容列下拉框
|
||||
showRefresh: true, // 是否显示刷新按钮
|
||||
paginationPreText: '‹',
|
||||
paginationNextText: '›',
|
||||
expanderExpandedClass: 'glyphicon glyphicon-chevron-down', // 展开的按钮的图标
|
||||
expanderCollapsedClass: 'glyphicon glyphicon-chevron-right', // 缩起的按钮的图标
|
||||
responseHandler: function(res) {
|
||||
|
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
@ -8,7 +8,7 @@ $(document).ready(function(){
|
||||
//手机号码验证身份证正则合并:(^\d{15}$)|(^\d{17}([0-9]|X)$)
|
||||
jQuery.validator.addMethod("isPhone",function(value,element){
|
||||
var length = value.length;
|
||||
var phone=/^1[3|4|5|6|7|8|9][0-9]\d{8}$/;
|
||||
var phone=/^1[3-9]\d{9}$/;
|
||||
return this.optional(element)||(length == 11 && phone.test(value));
|
||||
},"请填写正确的11位手机号");
|
||||
//电话号码验证
|
||||
@ -31,7 +31,12 @@ $(document).ready(function(){
|
||||
jQuery.validator.addMethod("isIdentity",function(value,element){
|
||||
var id= /^(\d{15}$|^\d{18}$|^\d{17}(\d|X))$/;
|
||||
return this.optional(element) || (id.test(value));
|
||||
},"请输入正确的15或18位身份证号,末尾为大写X");
|
||||
},"请输入正确的15或18位身份证号,末尾若为X请大写");
|
||||
//校验二代身份证
|
||||
jQuery.validator.addMethod("isIdentity18",function(value,element){
|
||||
var id= /^(^\d{17}(\d|X))$/;
|
||||
return this.optional(element) || (id.test(value));
|
||||
},"请输入正确的18位身份证号,末尾若为X请大写");
|
||||
//校验出生日期
|
||||
jQuery.validator.addMethod("isBirth",function(value,element){
|
||||
var birth = /^(19|20)\d{2}-(1[0-2]|0?[1-9])-(0?[1-9]|[1-2][0-9]|3[0-1])$/;
|
||||
|
@ -726,8 +726,8 @@ body.canvas-menu.mini-navbar nav.navbar-static-side {
|
||||
}
|
||||
|
||||
.btn-success:hover, .btn-success:focus, .btn-success:active, .btn-success.active, .open .dropdown-toggle.btn-success {
|
||||
background-color: #1a7bb9;
|
||||
border-color: #1a7bb9;
|
||||
background-color: #1a7bb9 !important;
|
||||
border-color: #1a7bb9 !important;
|
||||
color: #FFFFFF;
|
||||
}
|
||||
|
||||
|
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
@ -338,7 +338,7 @@ label.error {
|
||||
|
||||
.input-group label.error {
|
||||
z-index:99;
|
||||
right: 42px
|
||||
right: 42px;
|
||||
}
|
||||
|
||||
.input-group input.error + label.error + .input-group-addon>i {
|
||||
@ -347,10 +347,14 @@ label.error {
|
||||
|
||||
.input-group.date label.error {
|
||||
z-index:99;
|
||||
right: 3px
|
||||
right: 42px;
|
||||
}
|
||||
|
||||
.Validform_error,input.error,textarea.error,select.error {
|
||||
.select2-hidden-accessible + label.error {
|
||||
right: 38px;
|
||||
}
|
||||
|
||||
.Validform_error,input.error,textarea.error,select.error,label.error+.select2-container--bootstrap .select2-selection--single {
|
||||
background-color: #fbe2e2;
|
||||
border-color: #c66161;
|
||||
color: #c00
|
||||
@ -908,6 +912,9 @@ table.rc-table-resizing thead > th > a {
|
||||
background-color: #fff;
|
||||
box-sizing: border-box;
|
||||
z-index: 1;
|
||||
border-width: 0 0 0 1px;
|
||||
-webkit-box-shadow: 0 0 10px rgba(0,0,0,.12);
|
||||
box-shadow: 0 0 10px rgba(0,0,0,.12);
|
||||
}
|
||||
|
||||
.fixed-columns {
|
||||
@ -948,6 +955,7 @@ table.rc-table-resizing thead > th > a {
|
||||
.bootstrap-tree-table .table{border-bottom: 0px solid #e7eaec!important;}
|
||||
.bootstrap-tree-table .table-bordered .treetable-thead th {border-left: 1px solid #e7eaec!important;}
|
||||
.bootstrap-tree-table .table-bordered .treetable-tbody td {border-right: 1px solid #e7eaec!important;}
|
||||
.bootstrap-tree-table .fixed-table-pagination .pagination-detail {margin-top: 10px;margin-bottom: 10px;}
|
||||
|
||||
/** 首页样式 **/
|
||||
.ax_close_max {
|
||||
|
@ -262,7 +262,7 @@ $(function() {
|
||||
// 获取标识数据
|
||||
var dataUrl = $(this).attr('href'),
|
||||
dataIndex = $(this).data('index'),
|
||||
menuName = $.trim($(this).text()),
|
||||
menuName = $(this).data('title') || $.trim($(this).text()),
|
||||
isRefresh = $(this).data("refresh"),
|
||||
flag = true;
|
||||
|
||||
@ -306,7 +306,7 @@ $(function() {
|
||||
$('.menuTab').removeClass('active');
|
||||
|
||||
// 添加选项卡对应的iframe
|
||||
var str1 = '<iframe class="RuoYi_iframe" name="iframe' + dataIndex + '" width="100%" height="100%" src="' + dataUrl + '" frameborder="0" data-id="' + dataUrl + '" seamless></iframe>';
|
||||
var str1 = '<iframe class="RuoYi_iframe" name="iframe' + dataIndex + '" width="100%" height="100%" src="' + dataUrl + '" frameborder="0" data-id="' + dataUrl + '" data-refresh="' + isRefresh + '" seamless></iframe>';
|
||||
$('.mainContent').find('iframe.RuoYi_iframe').hide().parents('.mainContent').append(str1);
|
||||
|
||||
$.modal.loading("数据加载中,请稍候...");
|
||||
@ -434,15 +434,20 @@ $(function() {
|
||||
function activeTab() {
|
||||
if (!$(this).hasClass('active')) {
|
||||
var currentId = $(this).data('id');
|
||||
var isRefresh = false;
|
||||
syncMenuTab(currentId);
|
||||
// 显示tab对应的内容区
|
||||
$('.mainContent .RuoYi_iframe').each(function() {
|
||||
if ($(this).data('id') == currentId) {
|
||||
$(this).show().siblings('.RuoYi_iframe').hide();
|
||||
isRefresh = $(this).data('refresh');
|
||||
return false;
|
||||
}
|
||||
});
|
||||
$(this).addClass('active').siblings('.menuTab').removeClass('active');
|
||||
if (isRefresh) {
|
||||
refreshTab();
|
||||
}
|
||||
scrollToTab(this);
|
||||
}
|
||||
}
|
||||
|
@ -417,7 +417,7 @@ var storage = {
|
||||
|
||||
// 主子表操作封装处理
|
||||
var sub = {
|
||||
editColumn: function() {
|
||||
editRow: function() {
|
||||
var dataColumns = [];
|
||||
for (var columnIndex = 0; columnIndex < table.options.columns.length; columnIndex++) {
|
||||
if (table.options.columns[columnIndex].visible != false) {
|
||||
@ -441,18 +441,22 @@ var sub = {
|
||||
obj[key] = selectValue.val();
|
||||
} else if ($.common.isNotEmpty(textareaValue.val())) {
|
||||
obj[key] = textareaValue.val();
|
||||
} else {
|
||||
if (key == "index" && $.common.isNotEmpty(data[dataIndex].index)) {
|
||||
obj[key] = data[dataIndex].index;
|
||||
} else {
|
||||
obj[key] = "";
|
||||
}
|
||||
}
|
||||
}
|
||||
var item = data[dataIndex];
|
||||
var extendObj = $.extend({}, item, obj);
|
||||
params.push({ index: dataIndex, row: extendObj });
|
||||
}
|
||||
$("#" + table.options.id).bootstrapTable("updateRow", params);
|
||||
},
|
||||
delColumn: function(column) {
|
||||
sub.editColumn();
|
||||
delRow: function(column) {
|
||||
sub.editRow();
|
||||
var subColumn = $.common.isEmpty(column) ? "index" : column;
|
||||
var ids = $.table.selectColumns(subColumn);
|
||||
if (ids.length == 0) {
|
||||
@ -461,15 +465,17 @@ var sub = {
|
||||
}
|
||||
$("#" + table.options.id).bootstrapTable('remove', { field: subColumn, values: ids });
|
||||
},
|
||||
addColumn: function(row, tableId) {
|
||||
delRowByIndex: function(value) {
|
||||
sub.editRow();
|
||||
$("#" + table.options.id).bootstrapTable('remove', { field: "index", values: [value] });
|
||||
sub.editRow();
|
||||
},
|
||||
addRow: function(row, tableId) {
|
||||
var currentId = $.common.isEmpty(tableId) ? table.options.id : tableId;
|
||||
table.set(currentId);
|
||||
var count = $("#" + currentId).bootstrapTable('getData').length;
|
||||
sub.editColumn();
|
||||
$("#" + currentId).bootstrapTable('insertRow', {
|
||||
index: count + 1,
|
||||
row: row
|
||||
});
|
||||
sub.editRow();
|
||||
$("#" + currentId).bootstrapTable('insertRow', { index: count + 1, row: row });
|
||||
}
|
||||
};
|
||||
|
||||
@ -511,7 +517,7 @@ window.onload = function() {
|
||||
return _stopIt(event);
|
||||
}
|
||||
var type_e = elem.type.toUpperCase();
|
||||
if (name == 'INPUT' && (type_e != 'TEXT' && type_e != 'TEXTAREA' && type_e != 'PASSWORD' && type_e != 'FILE' && type_e != 'SEARCH' && type_e != 'NUMBER')) {
|
||||
if (name == 'INPUT' && (type_e != 'TEXT' && type_e != 'TEXTAREA' && type_e != 'PASSWORD' && type_e != 'FILE' && type_e != 'SEARCH' && type_e != 'NUMBER' && type_e != 'EMAIL' && type_e != 'URL')) {
|
||||
return _stopIt(event);
|
||||
}
|
||||
if (name == 'INPUT' && (elem.readOnly == true || elem.disabled == true)) {
|
||||
|
@ -11,7 +11,7 @@ var table = {
|
||||
// 设置实例配置
|
||||
set: function(id) {
|
||||
if ($.common.getLength(table.config) > 1 && $.common.isNotEmpty(event)) {
|
||||
var tableId = $.common.isEmpty(id) ? $(event.currentTarget).parents(".bootstrap-table").find("table.table").attr("id") : id;
|
||||
var tableId = $.common.isEmpty(id) ? $(event.currentTarget).parents(".bootstrap-table").find("table.table").attr("id") || $(event.currentTarget).parents(".bootstrap-tree-table").find("table.table").attr("id") : id;
|
||||
if ($.common.isNotEmpty(tableId)) {
|
||||
table.options = table.get(tableId);
|
||||
}
|
||||
@ -180,14 +180,15 @@ var table = {
|
||||
if (typeof table.get(this.id).responseHandler == "function") {
|
||||
table.get(this.id).responseHandler(res);
|
||||
}
|
||||
var thisOptions = table.config[this.id];
|
||||
if (res.code == web_status.SUCCESS) {
|
||||
if ($.common.isNotEmpty(table.options.sidePagination) && table.options.sidePagination == 'client') {
|
||||
if ($.common.isNotEmpty(thisOptions.sidePagination) && thisOptions.sidePagination == 'client') {
|
||||
return res.rows;
|
||||
} else {
|
||||
if ($.common.isNotEmpty(table.options.rememberSelected) && table.options.rememberSelected) {
|
||||
var column = $.common.isEmpty(table.options.uniqueId) ? table.options.columns[1].field : table.options.uniqueId;
|
||||
if ($.common.isNotEmpty(thisOptions.rememberSelected) && thisOptions.rememberSelected) {
|
||||
var column = $.common.isEmpty(thisOptions.uniqueId) ? thisOptions.columns[1].field : thisOptions.uniqueId;
|
||||
$.each(res.rows, function(i, row) {
|
||||
row.state = $.inArray(row[column], table.rememberSelectedIds[table.options.id]) !== -1;
|
||||
row.state = $.inArray(row[column], table.rememberSelectedIds[thisOptions.id]) !== -1;
|
||||
})
|
||||
}
|
||||
return { rows: res.rows, total: res.total };
|
||||
@ -299,6 +300,9 @@ var table = {
|
||||
var tableParams = $("#" + currentId).bootstrapTable('getOptions');
|
||||
var pageSize = $.common.isNotEmpty(tableParams.pageSize) ? tableParams.pageSize: table.options.pageSize;
|
||||
var pageNumber = $.common.isNotEmpty(tableParams.pageNumber) ? tableParams.pageNumber: table.options.pageNumber;
|
||||
if (table.options.sidePagination == 'client') {
|
||||
return index + 1;
|
||||
}
|
||||
return pageSize * (pageNumber - 1) + index + 1;
|
||||
},
|
||||
// 列超出指定长度浮动提示 target(copy单击复制文本 open弹窗打开文本)
|
||||
@ -539,6 +543,9 @@ var table = {
|
||||
return false;
|
||||
}
|
||||
});
|
||||
if (actions.length === 0) {
|
||||
actions.push($.common.sprintf("<span>%s</span>", value))
|
||||
}
|
||||
return actions.join('');
|
||||
},
|
||||
// 回显数据字典(字符串数组)
|
||||
@ -549,13 +556,18 @@ var table = {
|
||||
var currentSeparator = $.common.isEmpty(separator) ? "," : separator;
|
||||
var actions = [];
|
||||
$.each(value.split(currentSeparator), function(i, val) {
|
||||
var match = false
|
||||
$.each(datas, function(index, dict) {
|
||||
if (dict.dictValue == ('' + val)) {
|
||||
var listClass = $.common.equals("default", dict.listClass) || $.common.isEmpty(dict.listClass) ? "" : "badge badge-" + dict.listClass;
|
||||
actions.push($.common.sprintf("<span class='%s'>%s</span>", listClass, dict.dictLabel));
|
||||
match = true
|
||||
return false;
|
||||
}
|
||||
});
|
||||
if (!match) {
|
||||
actions.push($.common.sprintf("<span> %s </span>", val));
|
||||
}
|
||||
});
|
||||
return actions.join('');
|
||||
},
|
||||
@ -588,10 +600,13 @@ var table = {
|
||||
id: "bootstrap-tree-table",
|
||||
type: 1, // 0 代表bootstrapTable 1代表bootstrapTreeTable
|
||||
height: 0,
|
||||
rootIdValue: null,
|
||||
rootIdValue: 0,
|
||||
ajaxParams: {},
|
||||
toolbar: "toolbar",
|
||||
striped: false,
|
||||
pagination: false,
|
||||
pageSize: 10,
|
||||
pageList: [10, 25, 50],
|
||||
expandColumn: 1,
|
||||
showSearch: true,
|
||||
showRefresh: true,
|
||||
@ -612,6 +627,10 @@ var table = {
|
||||
ajaxParams: options.ajaxParams, // 请求数据的ajax的data属性
|
||||
rootIdValue: options.rootIdValue, // 设置指定根节点id值
|
||||
height: options.height, // 表格树的高度
|
||||
pagination: options.pagination, // 是否显示分页
|
||||
dataUrl: options.dataUrl, // 加载子节点异步请求数据url
|
||||
pageSize: options.pageSize, // 每页的记录行数
|
||||
pageList: options.pageList, // 可供选择的每页的行数
|
||||
expandColumn: options.expandColumn, // 在哪一列上面显示展开按钮
|
||||
striped: options.striped, // 是否显示行间隔色
|
||||
bordered: options.bordered, // 是否显示边框
|
||||
@ -622,6 +641,7 @@ var table = {
|
||||
expandAll: options.expandAll, // 是否全部展开
|
||||
expandFirst: options.expandFirst, // 是否默认第一级展开--expandAll为false时生效
|
||||
columns: options.columns, // 显示列信息(*)
|
||||
onClickRow: options.onClickRow, // 单击某行事件
|
||||
responseHandler: $.treeTable.responseHandler, // 在加载服务器发送来的数据之前处理函数
|
||||
onLoadSuccess: $.treeTable.onLoadSuccess // 当所有数据被加载时触发处理函数
|
||||
});
|
||||
@ -630,7 +650,7 @@ var table = {
|
||||
search: function(formId) {
|
||||
var currentId = $.common.isEmpty(formId) ? $('form').attr('id') : formId;
|
||||
var params = $.common.formToJSON(currentId);
|
||||
$.bttTable.bootstrapTreeTable('refresh', params);
|
||||
$.bttTable.bootstrapTreeTable('refresh', $.extend(params, table.options.ajaxParams));
|
||||
},
|
||||
// 刷新
|
||||
refresh: function() {
|
||||
@ -682,7 +702,7 @@ var table = {
|
||||
}
|
||||
$("#" + tableId).bootstrapTable('refresh', params);
|
||||
} else if (table.options.type == table_type.bootstrapTreeTable) {
|
||||
$("#" + tableId).bootstrapTreeTable('refresh', []);
|
||||
$("#" + tableId).bootstrapTreeTable('refresh', table.options.ajaxParams);
|
||||
}
|
||||
if ($.common.isNotEmpty(startLayDate) && $.common.isNotEmpty(endLayDate)) {
|
||||
endLayDate.config.min.year = '';
|
||||
@ -863,6 +883,9 @@ var table = {
|
||||
yes: callback,
|
||||
cancel: function(index) {
|
||||
return true;
|
||||
},
|
||||
success: function () {
|
||||
$(':focus').blur();
|
||||
}
|
||||
});
|
||||
},
|
||||
@ -909,6 +932,9 @@ var table = {
|
||||
yes: options.yes,
|
||||
cancel: function () {
|
||||
return true;
|
||||
},
|
||||
success: function () {
|
||||
$(':focus').blur();
|
||||
}
|
||||
}, btnCallback));
|
||||
if ($.common.isNotEmpty(options.full) && options.full === true) {
|
||||
@ -952,6 +978,9 @@ var table = {
|
||||
},
|
||||
cancel: function(index) {
|
||||
return true;
|
||||
},
|
||||
success: function () {
|
||||
$(':focus').blur();
|
||||
}
|
||||
});
|
||||
top.layer.full(index);
|
||||
@ -1293,8 +1322,9 @@ var table = {
|
||||
if (result.code == web_status.SUCCESS) {
|
||||
var topWindow = $(window.parent.document);
|
||||
var currentId = $('.page-tabs-content', topWindow).find('.active').attr('data-panel');
|
||||
var $contentWindow = $('.RuoYi_iframe[data-id="' + currentId + '"]', topWindow)[0].contentWindow;
|
||||
$.modal.close();
|
||||
var topWindow = $('.RuoYi_iframe[data-id="' + currentId + '"]', topWindow)[0];
|
||||
if ($.common.isNotEmpty(topWindow) && $.common.isNotEmpty(currentId)) {
|
||||
var $contentWindow = topWindow.contentWindow;
|
||||
$contentWindow.$.modal.msgSuccess(result.msg);
|
||||
$contentWindow.$(".layui-layer-padding").removeAttr("style");
|
||||
if ($contentWindow.table.options.type == table_type.bootstrapTable) {
|
||||
@ -1302,6 +1332,10 @@ var table = {
|
||||
} else if ($contentWindow.table.options.type == table_type.bootstrapTreeTable) {
|
||||
$contentWindow.$.treeTable.refresh();
|
||||
}
|
||||
} else {
|
||||
$.modal.msgSuccess(result.msg);
|
||||
}
|
||||
$.modal.close();
|
||||
$.modal.closeTab();
|
||||
} else if (result.code == web_status.WARNING) {
|
||||
$.modal.alertWarning(result.msg)
|
||||
@ -1313,7 +1347,7 @@ var table = {
|
||||
},
|
||||
// 校验封装处理
|
||||
validate: {
|
||||
// 判断返回标识是否唯一 false 不存在 true 存在
|
||||
// 判断返回标识是否唯一 false 为存在 true 为不存在
|
||||
unique: function (value) {
|
||||
if (value == "0") {
|
||||
return true;
|
||||
@ -1520,7 +1554,7 @@ var table = {
|
||||
common: {
|
||||
// 判断字符串是否为空
|
||||
isEmpty: function (value) {
|
||||
if (value == null || this.trim(value) == "") {
|
||||
if (value == null || this.trim(value) == "" || value == undefined || value == "undefined") {
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
|
@ -33,11 +33,11 @@ function login() {
|
||||
if (r.code == web_status.SUCCESS) {
|
||||
location.href = ctx + 'index';
|
||||
} else {
|
||||
$.modal.closeLoading();
|
||||
$('.imgcode').click();
|
||||
$(".code").val("");
|
||||
$.modal.msg(r.msg);
|
||||
}
|
||||
$.modal.closeLoading();
|
||||
}
|
||||
});
|
||||
}
|
||||
|
@ -0,0 +1,91 @@
|
||||
<!DOCTYPE html>
|
||||
<html lang="zh">
|
||||
<head>
|
||||
<th:block th:include="include :: header('进度条')" />
|
||||
</head>
|
||||
<body class="gray-bg">
|
||||
<div class="wrapper wrapper-content animated fadeInRight">
|
||||
<div class="row">
|
||||
<div class="col-sm-12">
|
||||
<div class="ibox float-e-margins">
|
||||
<div class="ibox-title">
|
||||
<h5>进度条 (Progress Bars)</h5>
|
||||
<div class="ibox-tools">
|
||||
<a class="collapse-link">
|
||||
<i class="fa fa-chevron-up"></i>
|
||||
</a>
|
||||
<a class="dropdown-toggle" data-toggle="dropdown" href="#">
|
||||
<i class="fa fa-wrench"></i>
|
||||
</a>
|
||||
<ul class="dropdown-menu dropdown-user">
|
||||
<li><a href="#">选项1</a>
|
||||
</li>
|
||||
<li><a href="#">选项2</a>
|
||||
</li>
|
||||
</ul>
|
||||
<a class="close-link">
|
||||
<i class="fa fa-times"></i>
|
||||
</a>
|
||||
</div>
|
||||
</div>
|
||||
<div class="ibox-content">
|
||||
<!-- style: progress-bar-success/progress-bar-info/progress-bar-warning/progress-bar-danger -->
|
||||
<h5>基本</h5>
|
||||
<div class="progress">
|
||||
<div style="width: 35%" aria-valuemax="100" aria-valuemin="0" aria-valuenow="35" role="progressbar" class="progress-bar progress-bar-success">
|
||||
<span class="sr-only">35% Complete (success)</span>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="progress progress-bar-default">
|
||||
<div style="width: 43%" aria-valuemax="100" aria-valuemin="0" aria-valuenow="43" role="progressbar" class="progress-bar">
|
||||
<span class="sr-only">43% Complete (success)</span>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<h5>条纹效果</h5>
|
||||
<div class="progress progress-striped">
|
||||
<div style="width: 50%" aria-valuemax="100" aria-valuemin="0" aria-valuenow="50" role="progressbar" class="progress-bar progress-bar-warning">
|
||||
<span class="sr-only">50% Complete (success)</span>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<h5>动画效果</h5>
|
||||
<div class="progress progress-striped active">
|
||||
<div style="width: 75%" aria-valuemax="100" aria-valuemin="0" aria-valuenow="75" role="progressbar" class="progress-bar progress-bar-danger">
|
||||
<span class="sr-only">75% Complete (success)</span>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<h5>堆叠效果</h5>
|
||||
<div class="progress progress-striped active">
|
||||
<div style="width: 30%" class="progress-bar progress-bar-success">
|
||||
<span class="sr-only">30% Complete (success)</span>
|
||||
</div>
|
||||
<div style="width: 20%" class="progress-bar progress-bar-warning">
|
||||
<span class="sr-only">20% Complete (warning)</span>
|
||||
</div>
|
||||
<div style="width: 40%" class="progress-bar progress-bar-danger">
|
||||
<span class="sr-only">40% Complete (danger)</span>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<h5>带有提示标签的进度条</h5>
|
||||
<div class="progress">
|
||||
<div class="progress-bar" role="progressbar" aria-valuenow="95" aria-valuemin="0" aria-valuemax="100" style="width: 95%;">
|
||||
95%
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<th:block th:include="include :: footer" />
|
||||
<script type="text/javascript">
|
||||
$("[data-toggle='tooltip']").tooltip();
|
||||
$("[data-toggle=popover]").popover();
|
||||
</script>
|
||||
</body>
|
||||
</html>
|
@ -17,7 +17,7 @@
|
||||
<h2>若依后台管理系统</h2>
|
||||
<p>ruoyi是一个完全响应式,基于Bootstrap3.3.7最新版本开发的扁平化主题,她采用了主流的左右两栏式布局,使用了Html5+CSS3等现代技术,她提供了诸多的强大的可以重新组合的UI组件,并集成了最新的jQuery版本(v2.1.1),当然,也集成了很多功能强大,用途广泛的就jQuery插件,她可以用于所有的Web应用程序,如<b>网站管理后台</b>,<b>网站会员中心</b>,<b>CMS</b>,<b>CRM</b>,<b>OA</b>等等,当然,您也可以对她进行深度定制,以做出更强系统。</p>
|
||||
<p>
|
||||
<b>当前版本:</b>v4.7.1
|
||||
<b>当前版本:</b>v4.7.6
|
||||
</p>
|
||||
<p>
|
||||
<span class="label label-warning">免费开源</span>
|
||||
@ -56,7 +56,7 @@
|
||||
<h3>你好,若依 </h3>
|
||||
<p>H+是一个完全响应式,基于Bootstrap3.3.7最新版本开发的扁平化主题,她采用了主流的左右两栏式布局,使用了Html5+CSS3等现代技术,她提供了诸多的强大的可以重新组合的UI组件,并集成了最新的jQuery版本(v2.1.1),当然,也集成了很多功能强大,用途广泛的就jQuery插件,她可以用于所有的Web应用程序,如<b>网站管理后台</b>,<b>网站会员中心</b>,<b>CMS</b>,<b>CRM</b>,<b>OA</b>等等,当然,您也可以对她进行深度定制,以做出更强系统。</p>
|
||||
<p>
|
||||
<b>当前版本:</b>v4.7.1
|
||||
<b>当前版本:</b>v4.7.6
|
||||
</p>
|
||||
<p>
|
||||
<span class="label label-warning">开源免费</span>
|
||||
|
@ -50,6 +50,8 @@
|
||||
var rsp = data.response;
|
||||
log.info("return url:" + rsp.url)
|
||||
log.info("reutrn fileName:" + rsp.fileName)
|
||||
log.info("reutrn newFileName:" + rsp.newFileName)
|
||||
log.info("return originalFilename:" + rsp.originalFilename)
|
||||
}).on('fileremoved', function (event, id, index) {
|
||||
$("input[name='" + event.currentTarget.id + "']").val('')
|
||||
})
|
||||
@ -62,6 +64,8 @@
|
||||
var rsp = data.response;
|
||||
log.info("return urls:" + rsp.urls)
|
||||
log.info("reutrn fileNames:" + rsp.fileNames)
|
||||
log.info("reutrn newFileNames:" + rsp.newFileNames)
|
||||
log.info("return originalFilenames:" + rsp.originalFilenames)
|
||||
}).on('fileremoved', function (event, id, index) {
|
||||
$("input[name='" + event.currentTarget.id + "']").val('')
|
||||
})
|
||||
|
@ -181,7 +181,7 @@ $('#smartwizard').smartWizard({
|
||||
enableURLhash: true, // Enable selection of the step based on url hash
|
||||
transition: {
|
||||
animation: 'none', // Effect on navigation, none/fade/slide-horizontal/slide-vertical/slide-swing
|
||||
speed: '400', // Transion animation speed
|
||||
speed: '400', // Transition animation speed
|
||||
easing:'' // Transition animation easing. Not supported without a jQuery easing plugin
|
||||
},
|
||||
toolbarSettings: {
|
||||
|
@ -6,9 +6,9 @@
|
||||
<body class="gray-bg">
|
||||
<div class="row border-bottom white-bg dashboard-header">
|
||||
<div class="col-sm-12">
|
||||
<p>ECharts开源来自百度商业前端数据可视化团队,基于html5 Canvas,是一个纯Javascript图表库,提供直观,生动,可交互,可个性化定制的数据可视化图表。创新的拖拽重计算、数据视图、值域漫游等特性大大增强了用户体验,赋予了用户对数据进行挖掘、整合的能力。 <a href="http://echarts.baidu.com/doc/about.html" target="_blank">了解更多</a>
|
||||
<p>ECharts开源来自百度商业前端数据可视化团队,基于html5 Canvas,是一个纯Javascript图表库,提供直观,生动,可交互,可个性化定制的数据可视化图表。创新的拖拽重计算、数据视图、值域漫游等特性大大增强了用户体验,赋予了用户对数据进行挖掘、整合的能力。 <a href="https://echarts.apache.org/handbook/zh/get-started/" target="_blank">了解更多</a>
|
||||
</p>
|
||||
<p>ECharts官网:<a href="http://echarts.baidu.com/" target="_blank">http://echarts.baidu.com/</a>
|
||||
<p>ECharts官网:<a href="https://echarts.apache.org/" target="_blank">https://echarts.apache.org/</a>
|
||||
</p>
|
||||
|
||||
</div>
|
||||
|
@ -0,0 +1,85 @@
|
||||
<!DOCTYPE html>
|
||||
<html lang="zh" xmlns:th="http://www.thymeleaf.org" xmlns:shiro="http://www.pollix.at/thymeleaf/shiro">
|
||||
<head>
|
||||
<th:block th:include="include :: header('异步加载表格树')" />
|
||||
</head>
|
||||
<body class="gray-bg">
|
||||
<div class="container-div">
|
||||
<div class="row">
|
||||
<div class="col-sm-12 search-collapse">
|
||||
<form id="formId">
|
||||
<div class="select-list">
|
||||
<ul>
|
||||
<li>
|
||||
<label>区域名称:</label>
|
||||
<input type="text" name="areaName"/>
|
||||
</li>
|
||||
<li>
|
||||
<a class="btn btn-primary btn-rounded btn-sm" onclick="$.treeTable.search()"><i class="fa fa-search"></i> 搜索</a>
|
||||
<a class="btn btn-warning btn-rounded btn-sm" onclick="$.form.reset()"><i class="fa fa-refresh"></i> 重置</a>
|
||||
</li>
|
||||
</ul>
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
|
||||
<div class="btn-group-sm" id="toolbar" role="group">
|
||||
<a class="btn btn-info" id="expandAllBtn">
|
||||
<i class="fa fa-exchange"></i> 展开/折叠
|
||||
</a>
|
||||
</div>
|
||||
<div class="col-sm-12 select-table table-striped">
|
||||
<table id="bootstrap-tree-table"></table>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<th:block th:include="include :: footer" />
|
||||
<script th:inline="javascript">
|
||||
var prefix = ctx + "demo/table";
|
||||
|
||||
$(function() {
|
||||
var options = {
|
||||
code: "id",
|
||||
parentCode: "parentId",
|
||||
uniqueId: "id",
|
||||
expandAll: false,
|
||||
expandFirst: false,
|
||||
expandColumn: 1,
|
||||
pagination: true, // 开启分页
|
||||
url: prefix + "/tree/list", // 列表请求
|
||||
dataUrl: prefix + "/tree/listChild", // 子节点异步请求
|
||||
onClickRow: onClickRow,
|
||||
columns: [{
|
||||
field: 'selectItem',
|
||||
radio: true
|
||||
},
|
||||
{
|
||||
field: 'areaName',
|
||||
title: '区域名称',
|
||||
align: 'left',
|
||||
},
|
||||
{
|
||||
field: 'areaCode',
|
||||
title: '区域代码',
|
||||
align: 'left'
|
||||
},
|
||||
{
|
||||
field: 'simplePy',
|
||||
title: '首字母简拼',
|
||||
align: 'left'
|
||||
},
|
||||
{
|
||||
field: 'pinYin',
|
||||
title: '名称全拼',
|
||||
align: 'left'
|
||||
}]
|
||||
};
|
||||
$.treeTable.init(options);
|
||||
});
|
||||
|
||||
function onClickRow(row, $element){
|
||||
// alert("单击行id:" + row.id + " name:" + row.name);
|
||||
}
|
||||
</script>
|
||||
</body>
|
||||
</html>
|
@ -7,6 +7,9 @@
|
||||
<div class="container-div">
|
||||
<div class="row">
|
||||
<div class="col-sm-12 select-table table-striped">
|
||||
<!-- 点击事件的方式打开使用 detailViewIcon: false and detailViewByClick: true
|
||||
data-detail-view-icon="false"
|
||||
data-detail-view-by-click="true" -->
|
||||
<table id="bootstrap-table"></table>
|
||||
</div>
|
||||
</div>
|
||||
|
@ -3,6 +3,9 @@
|
||||
<head>
|
||||
<th:block th:include="include :: header('主子表提交')" />
|
||||
<th:block th:include="include :: datetimepicker-css" />
|
||||
<style type="text/css">
|
||||
table label.error{position: inherit;}select + label.error{z-index:1;right:40px;}
|
||||
</style>
|
||||
</head>
|
||||
<body class="gray-bg">
|
||||
<div class="main-content">
|
||||
@ -13,7 +16,7 @@
|
||||
<div class="form-group">
|
||||
<label class="col-sm-4 control-label is-required">客户名称:</label>
|
||||
<div class="col-sm-8">
|
||||
<input name="name" placeholder="请输入客户名称" class="form-control" type="text" maxlength="30">
|
||||
<input name="name" placeholder="请输入客户名称" class="form-control" type="text" maxlength="30" required>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@ -31,9 +34,9 @@
|
||||
<div class="row">
|
||||
<div class="col-sm-6">
|
||||
<div class="form-group">
|
||||
<label class="col-sm-4 control-label is-required">手机号码:</label>
|
||||
<label class="col-sm-4 control-label">手机号码:</label>
|
||||
<div class="col-sm-8">
|
||||
<input id="phonenumber" name="phonenumber" placeholder="请输入手机号码" class="form-control" type="text" maxlength="11">
|
||||
<input id="phonenumber" name="phonenumber" placeholder="请输入手机号码" class="form-control isPhone" type="text" maxlength="11">
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@ -62,8 +65,8 @@
|
||||
<h4 class="form-header h4">商品数据</h4>
|
||||
<div class="row">
|
||||
<div class="col-sm-12">
|
||||
<button type="button" class="btn btn-white btn-sm" onclick="addColumn()"><i class="fa fa-plus"> 增加</i></button>
|
||||
<button type="button" class="btn btn-white btn-sm" onclick="sub.delColumn()"><i class="fa fa-minus"> 删除</i></button>
|
||||
<button type="button" class="btn btn-white btn-sm" onclick="addRow()"><i class="fa fa-plus"> 增加</i></button>
|
||||
<button type="button" class="btn btn-white btn-sm" onclick="sub.delRow()"><i class="fa fa-minus"> 删除</i></button>
|
||||
<div class="col-sm-12 select-table table-striped">
|
||||
<table id="bootstrap-table"></table>
|
||||
</div>
|
||||
@ -127,7 +130,7 @@
|
||||
align: 'center',
|
||||
title: '商品名称',
|
||||
formatter: function(value, row, index) {
|
||||
var html = $.common.sprintf("<input class='form-control' type='text' name='goods[%s].name' value='%s'>", index, value);
|
||||
var html = $.common.sprintf("<input class='form-control goodsName' type='text' name='goods[%s].name' value='%s'>", index, value);
|
||||
return html;
|
||||
}
|
||||
},
|
||||
@ -136,7 +139,7 @@
|
||||
align: 'center',
|
||||
title: '商品重量',
|
||||
formatter: function(value, row, index) {
|
||||
var html = $.common.sprintf("<input class='form-control' type='text' name='goods[%s].weight' value='%s'>", index, value);
|
||||
var html = $.common.sprintf("<input class='form-control goodsWeight' type='text' name='goods[%s].weight' value='%s'>", index, value);
|
||||
return html;
|
||||
}
|
||||
},
|
||||
@ -166,17 +169,35 @@
|
||||
var data = [{ index: index, type: value }];
|
||||
return $("#goodsTypeTpl").tmpl(data).html();
|
||||
}
|
||||
},
|
||||
{
|
||||
title: '操作',
|
||||
align: 'center',
|
||||
formatter: function(value, row, index) {
|
||||
var value = $.common.isNotEmpty(row.index) ? row.index : $.table.serialNumber(index);
|
||||
return '<a class="btn btn-danger btn-xs" href="javascript:void(0)" onclick="sub.delRowByIndex(\'' + value + '\')"><i class="fa fa-remove"></i>删除</a>';
|
||||
}
|
||||
}]
|
||||
};
|
||||
$.table.init(options);
|
||||
});
|
||||
|
||||
$.validator.addMethod("goodsName", function(value, element) {
|
||||
return !this.optional(element);
|
||||
}, "商品名称必填。");
|
||||
|
||||
$.validator.addMethod("goodsWeight", function(value, element) {
|
||||
return !this.optional(element) && (value <= 100 && value >= 0);
|
||||
}, "商品重量长度区间0-100。");
|
||||
|
||||
/* 主子表-提交 */
|
||||
function submitHandler(index, layero){
|
||||
if ($.validate.form()) {
|
||||
var data = $("#form-add").serializeArray();
|
||||
alert(JSON.stringify(data))
|
||||
$.operate.saveModal("/demo/operate/customer/add", data);
|
||||
}
|
||||
}
|
||||
|
||||
$("input[name='birthday']").datetimepicker({
|
||||
format: "yyyy-mm-dd",
|
||||
@ -184,15 +205,17 @@
|
||||
autoclose: true
|
||||
});
|
||||
|
||||
function addColumn() {
|
||||
function addRow() {
|
||||
var count = $("#" + table.options.id).bootstrapTable('getData').length;
|
||||
var row = {
|
||||
index: $.table.serialNumber(count),
|
||||
name: "",
|
||||
weight: "",
|
||||
price: "",
|
||||
date: "",
|
||||
type: "",
|
||||
}
|
||||
sub.addColumn(row);
|
||||
sub.addRow(row);
|
||||
}
|
||||
|
||||
$("#bootstrap-table").on("post-body.bs.table", function (e, args) {
|
||||
|
@ -7,19 +7,19 @@
|
||||
<meta name="description" content="">
|
||||
<title th:text="${title}"></title>
|
||||
<link th:href="@{/css/bootstrap.min.css?v=3.3.7}" rel="stylesheet"/>
|
||||
<link th:href="@{/css/font-awesome.min.css?v=4.7.1}" rel="stylesheet"/>
|
||||
<link th:href="@{/css/font-awesome.min.css?v=4.7.0}" rel="stylesheet"/>
|
||||
<!-- bootstrap-table 表格插件样式 -->
|
||||
<link th:href="@{/ajax/libs/bootstrap-table/bootstrap-table.min.css?v=1.18.3}" rel="stylesheet"/>
|
||||
<link th:href="@{/css/animate.min.css?v=20210831}" rel="stylesheet"/>
|
||||
<link th:href="@{/css/style.min.css?v=20210831}" rel="stylesheet"/>
|
||||
<link th:href="@{/ruoyi/css/ry-ui.css?v=4.7.1}" rel="stylesheet"/>
|
||||
<link th:href="@{/ruoyi/css/ry-ui.css?v=4.7.6}" rel="stylesheet"/>
|
||||
</head>
|
||||
|
||||
<!-- 通用JS -->
|
||||
<div th:fragment="footer">
|
||||
<script th:inline="javascript"> var ctx = [[@{/}]]; var lockscreen = [[${session.lockscreen}]]; if(lockscreen){window.top.location=ctx+"lockscreen";} </script>
|
||||
<a id="scroll-up" href="#" class="btn btn-sm display"><i class="fa fa-angle-double-up"></i></a>
|
||||
<script th:src="@{/js/jquery.min.js?v=3.6.0}"></script>
|
||||
<script th:src="@{/js/jquery.min.js?v=3.6.1}"></script>
|
||||
<script th:src="@{/js/bootstrap.min.js?v=3.3.7}"></script>
|
||||
<!-- bootstrap-table 表格插件 -->
|
||||
<script th:src="@{/ajax/libs/bootstrap-table/bootstrap-table.min.js?v=1.18.3}"></script>
|
||||
@ -35,9 +35,9 @@
|
||||
<script th:src="@{/ajax/libs/blockUI/jquery.blockUI.js?v=2.70.0}"></script>
|
||||
<script th:src="@{/ajax/libs/iCheck/icheck.min.js?v=1.0.3}"></script>
|
||||
<script th:src="@{/ajax/libs/layer/layer.min.js?v=3.5.1}"></script>
|
||||
<script th:src="@{/ajax/libs/layui/layui.min.js?v=2.6.8}"></script>
|
||||
<script th:src="@{/ruoyi/js/common.js?v=4.7.1}"></script>
|
||||
<script th:src="@{/ruoyi/js/ry-ui.js?v=4.7.1}"></script>
|
||||
<script th:src="@{/ajax/libs/layui/layui.min.js?v=2.7.5}"></script>
|
||||
<script th:src="@{/ruoyi/js/common.js?v=4.7.6}"></script>
|
||||
<script th:src="@{/ruoyi/js/ry-ui.js?v=4.7.6}"></script>
|
||||
</div>
|
||||
|
||||
<!-- ztree树插件 -->
|
||||
@ -108,10 +108,10 @@
|
||||
|
||||
<!-- fileinput文件上传插件 -->
|
||||
<div th:fragment="bootstrap-fileinput-css">
|
||||
<link th:href="@{/ajax/libs/bootstrap-fileinput/fileinput.min.css?v=5.2.4}" rel="stylesheet"/>
|
||||
<link th:href="@{/ajax/libs/bootstrap-fileinput/fileinput.min.css?v=5.5.2}" rel="stylesheet"/>
|
||||
</div>
|
||||
<div th:fragment="bootstrap-fileinput-js">
|
||||
<script th:src="@{/ajax/libs/bootstrap-fileinput/fileinput.min.js?v=5.2.4}"></script>
|
||||
<script th:src="@{/ajax/libs/bootstrap-fileinput/fileinput.min.js?v=5.5.2}"></script>
|
||||
</div>
|
||||
|
||||
<!-- duallistbox双列表框插件 -->
|
||||
|
@ -14,7 +14,8 @@
|
||||
<link th:href="@{/css/animate.min.css}" rel="stylesheet"/>
|
||||
<link th:href="@{/css/style.min.css}" rel="stylesheet"/>
|
||||
<link th:href="@{/css/skins.css?v=20200902}" rel="stylesheet"/>
|
||||
<link th:href="@{/ruoyi/css/ry-ui.css?v=4.7.1}" rel="stylesheet"/>
|
||||
<link th:href="@{/ruoyi/css/ry-ui.css?v=4.7.6}" rel="stylesheet"/>
|
||||
<style type="text/css">.fixed-sidebar .nav:not(.navbar-toolbar)>li.active{border-left:0px!important;}</style>
|
||||
</head>
|
||||
<body class="fixed-sidebar full-height-layout gray-bg" th:classappend="${isMobile} ? 'canvas-menu'" style="overflow: hidden">
|
||||
<div id="wrapper">
|
||||
@ -98,6 +99,7 @@
|
||||
<li><a class="menuItem" th:href="@{/demo/form/grid}">栅格</a></li>
|
||||
<li><a class="menuItem" th:href="@{/demo/form/select}">下拉框</a></li>
|
||||
<li><a class="menuItem" th:href="@{/demo/form/timeline}">时间轴</a></li>
|
||||
<li><a class="menuItem" th:href="@{/demo/form/progress_bars}">进度条</a></li>
|
||||
<li><a class="menuItem" th:href="@{/demo/form/basic}">基本表单</a></li>
|
||||
<li><a class="menuItem" th:href="@{/demo/form/cards}">卡片列表</a></li>
|
||||
<li><a class="menuItem" th:href="@{/demo/form/jasny}">功能扩展</a></li>
|
||||
@ -146,6 +148,7 @@
|
||||
<li><a class="menuItem" th:href="@{/demo/table/print}">表格打印配置</a></li>
|
||||
<li><a class="menuItem" th:href="@{/demo/table/dynamicColumns}">表格动态列</a></li>
|
||||
<li><a class="menuItem" th:href="@{/demo/table/customView}">自定义视图分页</a></li>
|
||||
<li><a class="menuItem" th:href="@{/demo/table/asynTree}">异步加载表格树</a></li>
|
||||
<li><a class="menuItem" th:href="@{/demo/table/other}">表格其他操作</a></li>
|
||||
</ul>
|
||||
</li>
|
||||
@ -315,8 +318,8 @@
|
||||
<script th:src="@{/js/jquery.contextMenu.min.js}"></script>
|
||||
<script th:src="@{/ajax/libs/blockUI/jquery.blockUI.js}"></script>
|
||||
<script th:src="@{/ajax/libs/layer/layer.min.js}"></script>
|
||||
<script th:src="@{/ruoyi/js/ry-ui.js?v=4.7.1}"></script>
|
||||
<script th:src="@{/ruoyi/js/common.js?v=4.7.1}"></script>
|
||||
<script th:src="@{/ruoyi/js/ry-ui.js?v=4.7.6}"></script>
|
||||
<script th:src="@{/ruoyi/js/common.js?v=4.7.6}"></script>
|
||||
<script th:src="@{/ruoyi/index.js?v=20201208}"></script>
|
||||
<script th:src="@{/ajax/libs/fullscreen/jquery.fullscreen.js}"></script>
|
||||
<script th:src="@{/js/resize-tabs.js}"></script>
|
||||
|
@ -14,7 +14,7 @@
|
||||
<link th:href="@{/css/animate.min.css}" rel="stylesheet"/>
|
||||
<link th:href="@{/css/style.min.css}" rel="stylesheet"/>
|
||||
<link th:href="@{/css/skins.css}" rel="stylesheet"/>
|
||||
<link th:href="@{/ruoyi/css/ry-ui.css?v=4.7.1}" rel="stylesheet"/>
|
||||
<link th:href="@{/ruoyi/css/ry-ui.css?v=4.7.6}" rel="stylesheet"/>
|
||||
</head>
|
||||
<body class="fixed-sidebar full-height-layout gray-bg" th:classappend="${isMobile} ? 'canvas-menu'" style="overflow: hidden">
|
||||
<div id="wrapper">
|
||||
@ -80,6 +80,7 @@
|
||||
<li><a class="menuItem" th:href="@{/demo/form/grid}">栅格</a></li>
|
||||
<li><a class="menuItem" th:href="@{/demo/form/select}">下拉框</a></li>
|
||||
<li><a class="menuItem" th:href="@{/demo/form/timeline}">时间轴</a></li>
|
||||
<li><a class="menuItem" th:href="@{/demo/form/progress_bars}">进度条</a></li>
|
||||
<li><a class="menuItem" th:href="@{/demo/form/basic}">基本表单</a></li>
|
||||
<li><a class="menuItem" th:href="@{/demo/form/cards}">卡片列表</a></li>
|
||||
<li><a class="menuItem" th:href="@{/demo/form/jasny}">功能扩展</a></li>
|
||||
@ -127,6 +128,7 @@
|
||||
<li><a class="menuItem" th:href="@{/demo/table/print}">表格打印配置</a></li>
|
||||
<li><a class="menuItem" th:href="@{/demo/table/dynamicColumns}">表格动态列</a></li>
|
||||
<li><a class="menuItem" th:href="@{/demo/table/customView}">自定义视图分页</a></li>
|
||||
<li><a class="menuItem" th:href="@{/demo/table/asynTree}">异步加载表格树</a></li>
|
||||
<li><a class="menuItem" th:href="@{/demo/table/other}">表格其他操作</a></li>
|
||||
</ul>
|
||||
</li>
|
||||
@ -262,8 +264,8 @@
|
||||
<script th:src="@{/js/jquery.contextMenu.min.js}"></script>
|
||||
<script th:src="@{/ajax/libs/blockUI/jquery.blockUI.js}"></script>
|
||||
<script th:src="@{/ajax/libs/layer/layer.min.js}"></script>
|
||||
<script th:src="@{/ruoyi/js/ry-ui.js?v=4.7.1}"></script>
|
||||
<script th:src="@{/ruoyi/js/common.js?v=4.7.1}"></script>
|
||||
<script th:src="@{/ruoyi/js/ry-ui.js?v=4.7.6}"></script>
|
||||
<script th:src="@{/ruoyi/js/common.js?v=4.7.6}"></script>
|
||||
<script th:src="@{/ruoyi/index.js?v=20201208}"></script>
|
||||
<script th:src="@{/ajax/libs/fullscreen/jquery.fullscreen.js}"></script>
|
||||
<script th:inline="javascript">
|
||||
|
@ -38,7 +38,7 @@
|
||||
<script src="../static/js/bootstrap.min.js" th:src="@{/js/bootstrap.min.js}"></script>
|
||||
<script src="../static/js/three.min.js" th:src="@{/js/three.min.js}"></script>
|
||||
<script src="../static/ajax/libs/layer/layer.min.js" th:src="@{/ajax/libs/layer/layer.min.js}"></script>
|
||||
<script src="../static/ruoyi/js/ry-ui.js" th:src="@{/ruoyi/js/ry-ui.js?v=4.7.1}"></script>
|
||||
<script src="../static/ruoyi/js/ry-ui.js" th:src="@{/ruoyi/js/ry-ui.js?v=4.7.6}"></script>
|
||||
</body>
|
||||
<script th:inline="javascript">
|
||||
var ctx = [[@{/}]];
|
||||
|
@ -9,7 +9,7 @@
|
||||
<link href="../static/css/font-awesome.min.css" th:href="@{/css/font-awesome.min.css}" rel="stylesheet"/>
|
||||
<link href="../static/css/style.min.css" th:href="@{/css/style.min.css}" rel="stylesheet"/>
|
||||
<link href="../static/css/login.min.css" th:href="@{/css/login.min.css}" rel="stylesheet"/>
|
||||
<link href="../static/ruoyi/css/ry-ui.css" th:href="@{/ruoyi/css/ry-ui.css?v=4.7.1}" rel="stylesheet"/>
|
||||
<link href="../static/ruoyi/css/ry-ui.css" th:href="@{/ruoyi/css/ry-ui.css?v=4.7.6}" rel="stylesheet"/>
|
||||
<!-- 360浏览器急速模式 -->
|
||||
<meta name="renderer" content="webkit">
|
||||
<!-- 避免IE使用兼容模式 -->
|
||||
@ -65,7 +65,7 @@
|
||||
</div>
|
||||
<div class="signup-footer">
|
||||
<div class="pull-left">
|
||||
Copyright © 2018-2021 ruoyi.vip All Rights Reserved. <br>
|
||||
Copyright © 2018-2022 ruoyi.vip All Rights Reserved. <br>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@ -76,7 +76,7 @@
|
||||
<script src="../static/ajax/libs/validate/jquery.validate.min.js" th:src="@{/ajax/libs/validate/jquery.validate.min.js}"></script>
|
||||
<script src="../static/ajax/libs/layer/layer.min.js" th:src="@{/ajax/libs/layer/layer.min.js}"></script>
|
||||
<script src="../static/ajax/libs/blockUI/jquery.blockUI.js" th:src="@{/ajax/libs/blockUI/jquery.blockUI.js}"></script>
|
||||
<script src="../static/ruoyi/js/ry-ui.js" th:src="@{/ruoyi/js/ry-ui.js?v=4.7.1}"></script>
|
||||
<script src="../static/ruoyi/js/ry-ui.js" th:src="@{/ruoyi/js/ry-ui.js?v=4.7.6}"></script>
|
||||
<script src="../static/ruoyi/login.js" th:src="@{/ruoyi/login.js}"></script>
|
||||
</body>
|
||||
</html>
|
||||
|
@ -79,7 +79,7 @@
|
||||
<div class="ibox-content">
|
||||
<p><i class="fa fa-send-o"></i> 官网:<a href="http://www.ruoyi.vip" target="_blank">http://www.ruoyi.vip</a>
|
||||
</p>
|
||||
<p><i class="fa fa-qq"></i> QQ群:<s>满1389287</s> <s>满1679294</s> <s>满1529866</s> <s>满1772718</s> <s>满1366522</s> <s>满1382251</s> <s>满1145125</s> <s>满86752435</s> <s>满134072510</s> <s>满210336300</s> <s>满339522636</s> <s>满130035985</s> <s>满143151071</s> <s>满158781320</s> <s>满201531282</s> <s>满101526938</s> <a href="https://jq.qq.com/?_wv=1027&k=up9k3ZXJ" target="_blank">264355400</a>
|
||||
<p><i class="fa fa-qq"></i> QQ群:<s>满1389287</s> <s>满1679294</s> <s>满1529866</s> <s>满1772718</s> <s>满1366522</s> <s>满1382251</s> <s>满1145125</s> <s>满86752435</s> <s>满134072510</s> <s>满210336300</s> <s>满339522636</s> <s>满130035985</s> <s>满143151071</s> <s>满158781320</s> <s>满201531282</s> <s>满101526938</s> <s>满264355400</s> <s>满298522656</s> <s>满139845794</s> <a href="https://jq.qq.com/?_wv=1027&k=Cqd66IKe" target="_blank">185760789</a>
|
||||
</p>
|
||||
<p><i class="fa fa-weixin"></i> 微信:<a href="javascript:;">/ *若依</a>
|
||||
</p>
|
||||
@ -96,13 +96,208 @@
|
||||
<div class="ibox-content no-padding">
|
||||
<div class="panel-body">
|
||||
<div class="panel-group" id="version">
|
||||
<div class="panel panel-default">
|
||||
<div class="panel-heading">
|
||||
<h5 class="panel-title">
|
||||
<a data-toggle="collapse" data-parent="#version" href="#v476">v4.7.6</a><code class="pull-right">2022.12.16</code>
|
||||
</h5>
|
||||
</div>
|
||||
<div id="v476" class="panel-collapse collapse in">
|
||||
<div class="panel-body">
|
||||
<ol>
|
||||
<li>定时任务违规的字符</li>
|
||||
<li>忽略不必要的属性数据返回</li>
|
||||
<li>导入更新用户数据前校验数据权限</li>
|
||||
<li>修改参数键名时移除前缓存配置</li>
|
||||
<li>修改用户登录账号进行重复验证</li>
|
||||
<li>兼容Excel下拉框内容过多无法显示</li>
|
||||
<li>升级oshi到最新版本6.4.0</li>
|
||||
<li>升级kaptcha到最新版2.3.3</li>
|
||||
<li>升级druid到最新版本1.2.15</li>
|
||||
<li>升级shiro到最新版本1.10.1</li>
|
||||
<li>升级pagehelper到最新版1.4.6</li>
|
||||
<li>升级bootstrap-fileinput到最新版本5.5.2</li>
|
||||
<li>修复sheet超出最大行数异常问题</li>
|
||||
<li>修复关闭父页签后提交无法跳转的问题</li>
|
||||
<li>修复操作日志类型多选导出不生效问题</li>
|
||||
<li>修复导出包含空子列表数据异常的问题</li>
|
||||
<li>优化树形表格层级显示</li>
|
||||
<li>优化SQL关键字检查防止注入</li>
|
||||
<li>优化用户管理重置时取消部门选择</li>
|
||||
<li>优化代码生成同步后字典值NULL问题</li>
|
||||
<li>优化导出对象的子列表为空会出现[]问题</li>
|
||||
<li>优化select2搜索下拉后校验必填样式问题</li>
|
||||
<li>其他细节优化</li>
|
||||
</ol>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="panel panel-default">
|
||||
<div class="panel-heading">
|
||||
<h5 class="panel-title">
|
||||
<a data-toggle="collapse" data-parent="#version" href="#v475">v4.7.5</a><code class="pull-right">2022.09.05</code>
|
||||
</h5>
|
||||
</div>
|
||||
<div id="v475" class="panel-collapse collapse">
|
||||
<div class="panel-body">
|
||||
<ol>
|
||||
<li>Excel支持导出对象的子列表方法</li>
|
||||
<li>数据逻辑删除不进行唯一验证</li>
|
||||
<li>优化多角色数据权限匹配规则</li>
|
||||
<li>新增主子表提交校验示例</li>
|
||||
<li>支持自定义隐藏Excel属性列</li>
|
||||
<li>Excel注解支持backgroundColor属性设置背景颜色</li>
|
||||
<li>菜单配置刷新时Tab页签切换时刷新</li>
|
||||
<li>增加对AjaxResult消息结果类型的判断</li>
|
||||
<li>新增示例(进度条)</li>
|
||||
<li>新增内容编码/解码方便插件集成使用</li>
|
||||
<li>升级jquery到最新版3.6.1</li>
|
||||
<li>升级layui到最新版本2.7.5</li>
|
||||
<li>升级shiro到最新版本1.9.1</li>
|
||||
<li>升级druid到最新版本1.2.11</li>
|
||||
<li>升级pagehelper到最新版1.4.3</li>
|
||||
<li>升级oshi到最新版本6.2.2</li>
|
||||
<li>修复树表onLoadSuccess不生效的问题</li>
|
||||
<li>修复用户分配角色大于默认页数丢失问题</li>
|
||||
<li>定时任务支持执行父类方法</li>
|
||||
<li>自动设置切换多个树表格实例配置</li>
|
||||
<li>页签创建标题优先data-title属性</li>
|
||||
<li>优化任务过期不执行调度</li>
|
||||
<li>优化横向菜单下激活菜单样式</li>
|
||||
<li>优化按钮打开窗口后按回车反复弹出</li>
|
||||
<li>优化excel/scale属性导出单元格数值类型</li>
|
||||
<li>优化druid开启wall过滤器出现的异常问题</li>
|
||||
<li>优化多个相同角色数据导致权限SQL重复问题</li>
|
||||
<li>其他细节优化</li>
|
||||
</ol>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="panel panel-default">
|
||||
<div class="panel-heading">
|
||||
<h5 class="panel-title">
|
||||
<a data-toggle="collapse" data-parent="#version" href="#v474">v4.7.4</a><code class="pull-right">2022.06.01</code>
|
||||
</h5>
|
||||
</div>
|
||||
<div id="v474" class="panel-collapse collapse">
|
||||
<div class="panel-body">
|
||||
<ol>
|
||||
<li>用户头像上传图片格式限制</li>
|
||||
<li>Excel注解支持color属性设置字体颜色</li>
|
||||
<li>设置分页参数默认值</li>
|
||||
<li>主子表操作列新增单个删除</li>
|
||||
<li>定时任务检查Bean包名是否为白名单配置</li>
|
||||
<li>升级spring-boot到最新版本2.5.14</li>
|
||||
<li>升级shiro到最新版本1.9.0</li>
|
||||
<li>升级oshi到最新版本6.1.6</li>
|
||||
<li>升级fastjson到最新版1.2.83 安全修复版本</li>
|
||||
<li>文件上传兼容Weblogic环境</li>
|
||||
<li>新增清理分页的线程变量方法</li>
|
||||
<li>新增获取不带后缀文件名称方法</li>
|
||||
<li>用户缓存信息添加部门ancestors祖级列表</li>
|
||||
<li>自定义ShiroFilterFactoryBean防止中文请求被拦截</li>
|
||||
<li>字典类型必须以字母开头,且只能为(小写字母,数字,下滑线)</li>
|
||||
<li>优化IP地址获取到多个的问题</li>
|
||||
<li>优化表格冻结列阴影效果显示</li>
|
||||
<li>优化菜单侧边栏滚动条尺寸及颜色</li>
|
||||
<li>优化显示顺序orderNum类型为整型</li>
|
||||
<li>优化接口使用泛型使其看到响应属性字段</li>
|
||||
<li>优化导出数据LocalDateTime类型无数据问题</li>
|
||||
<li>修复导入Excel时字典字段类型为Long转义为空问题</li>
|
||||
<li>优化导出excel单元格验证,包含变更为开头.防止正常内容被替换</li>
|
||||
<li>修复URL类型回退键被禁止问题</li>
|
||||
<li>修复表格客户端分页序号显示错误问题</li>
|
||||
<li>修复代码生成拖拽多次出现的排序不正确问题</li>
|
||||
<li>修复表格打印组件不识别多层对象属性值问题</li>
|
||||
<li>修复操作日志查询类型条件为0时会查到所有数据</li>
|
||||
<li>修复Excel注解prompt/combo同时使用不生效问题</li>
|
||||
<li>修复初始化多表格处理回调函数时获取的表格配置不一致问题</li>
|
||||
<li>其他细节优化</li>
|
||||
</ol>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="panel panel-default">
|
||||
<div class="panel-heading">
|
||||
<h5 class="panel-title">
|
||||
<a data-toggle="collapse" data-parent="#version" href="#v473">v4.7.3</a><code class="pull-right">2022.03.01</code>
|
||||
</h5>
|
||||
</div>
|
||||
<div id="v473" class="panel-collapse collapse">
|
||||
<div class="panel-body">
|
||||
<ol>
|
||||
<li>表格树支持分页/异步加载</li>
|
||||
<li>代码生成预览支持复制内容</li>
|
||||
<li>定时任务默认保存到内存中执行</li>
|
||||
<li>代码生成同步保留必填/类型选项</li>
|
||||
<li>页面若未匹配到字典标签则返回原字典值</li>
|
||||
<li>用户访问控制时校验数据权限,防止越权</li>
|
||||
<li>导出Excel时屏蔽公式,防止CSV注入风险</li>
|
||||
<li>升级spring-boot到最新版本2.5.10</li>
|
||||
<li>升级spring-boot-mybatis到最新版2.2.2</li>
|
||||
<li>升级pagehelper到最新版1.4.1</li>
|
||||
<li>升级oshi到最新版本6.1.2</li>
|
||||
<li>升级bootstrap-table到最新版本1.19.1</li>
|
||||
<li>服务监控新增运行参数信息显示</li>
|
||||
<li>定时任务目标字符串验证包名白名单</li>
|
||||
<li>文件上传接口新增原/新文件名返回参数</li>
|
||||
<li>定时任务屏蔽违规的字符</li>
|
||||
<li>分页数据新增分页参数合理化参数</li>
|
||||
<li>表格父子视图添加点击事件打开示例</li>
|
||||
<li>优化上传文件名称命名规则</li>
|
||||
<li>优化加载字典缓存数据</li>
|
||||
<li>优化任务队列满时任务拒绝策略</li>
|
||||
<li>优化IE11上传预览不显示的问题</li>
|
||||
<li>优化Excel格式化不同类型的日期对象</li>
|
||||
<li>优化国际化配置多余的zh请求问题</li>
|
||||
<li>优化新版Chrome浏览器回退出现的遮罩层</li>
|
||||
<li>修复EMAIL类型回退键被禁止问题</li>
|
||||
<li>修复Xss注解字段值为空时的异常问题</li>
|
||||
<li>其他细节优化</li>
|
||||
</ol>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="panel panel-default">
|
||||
<div class="panel-heading">
|
||||
<h5 class="panel-title">
|
||||
<a data-toggle="collapse" data-parent="#version" href="#v472">v4.7.2</a><code class="pull-right">2021.12.23</code>
|
||||
</h5>
|
||||
</div>
|
||||
<div id="v472" class="panel-collapse collapse">
|
||||
<div class="panel-body">
|
||||
<ol>
|
||||
<li>自定义xss校验注解实现</li>
|
||||
<li>进入修改页面方法添加权限标识</li>
|
||||
<li>代码生成创建按钮添加超级管理员权限</li>
|
||||
<li>代码生成创建表检查关键字,防止注入风险</li>
|
||||
<li>修复定时任务多参数逗号分隔的问题</li>
|
||||
<li>修复表格插件一起使用出现的声明报错问题</li>
|
||||
<li>修复代码生成主子表模板删除方法缺少事务</li>
|
||||
<li>升级oshi到最新版本v5.8.6</li>
|
||||
<li>升级velocity到最新版本2.3</li>
|
||||
<li>升级fastjson到最新版1.2.79</li>
|
||||
<li>升级log4j2到最新版2.17.0 防止漏洞风险</li>
|
||||
<li>升级thymeleaf到最新版3.0.14 阻止远程代码执行漏洞</li>
|
||||
<li>优化修改/授权角色实时生效</li>
|
||||
<li>修整tomcat配置参数已过期问题</li>
|
||||
<li>前端添加单独的二代身份证校验</li>
|
||||
<li>优化新增部门时验证用户所属部门</li>
|
||||
<li>优化查询用户的角色组&岗位组代码</li>
|
||||
<li>请求分页方法设置成通用方便灵活调用</li>
|
||||
<li>优化日期类型错误提示与图标重叠问题</li>
|
||||
<li>其他细节优化</li>
|
||||
</ol>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="panel panel-default">
|
||||
<div class="panel-heading">
|
||||
<h5 class="panel-title">
|
||||
<a data-toggle="collapse" data-parent="#version" href="#v471">v4.7.1</a><code class="pull-right">2021.11.10</code>
|
||||
</h5>
|
||||
</div>
|
||||
<div id="v471" class="panel-collapse collapse in">
|
||||
<div id="v471" class="panel-collapse collapse">
|
||||
<div class="panel-body">
|
||||
<ol>
|
||||
<li>新增是否开启页签功能</li>
|
||||
|
@ -53,8 +53,8 @@
|
||||
<th>操作</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody id="cacheKyes">
|
||||
<tr th:fragment="fragment-cache-kyes" th:each="cacheKey, stat : ${cacheKyes}">
|
||||
<tbody id="cacheKeys">
|
||||
<tr th:fragment="fragment-cache-kyes" th:each="cacheKey, stat : ${cacheKeys}">
|
||||
<td>[[${stat.index + 1}]]</td>
|
||||
<td style="word-wrap:break-word;word-break:break-all;" th:onclick="getCacheValue([[${cacheName}]], [[${cacheKey}]])">[[${cacheKey}]]</td>
|
||||
<td style="width: 50px"><a href="#" th:onclick="clearCacheKey([[${cacheName}]], [[${cacheKey}]])" title="清空"><i class="fa fa-trash-o text-danger"></i></a></td>
|
||||
@ -125,7 +125,7 @@ function getCacheKeys(cacheName, isMsg) {
|
||||
"fragment": 'fragment-cache-kyes'
|
||||
},
|
||||
success: function(data) {
|
||||
$("#cacheKyes").html(data);
|
||||
$("#cacheKeys").html(data);
|
||||
$("#cacheName").val(_cacheName);
|
||||
if (isMsg) {
|
||||
$.modal.msgSuccess("刷新键名列表成功");
|
||||
@ -174,7 +174,7 @@ function clearCacheKey(cacheName, cacheKey) {
|
||||
function clearAll(){
|
||||
$.get(prefix + "/clearAll", function(result) {
|
||||
if (result.code == web_status.SUCCESS) {
|
||||
$.modal.msgSuccess("清理缓存成功")
|
||||
$.modal.msgSuccess("清理全部缓存成功")
|
||||
} else {
|
||||
$.modal.msgError(result.msg);
|
||||
}
|
||||
|
@ -18,7 +18,7 @@
|
||||
<label>操作人员: </label><input type="text" name="operName"/>
|
||||
</li>
|
||||
<li class="select-selectpicker">
|
||||
<label>操作类型: </label><select id="businessTypes" th:with="type=${@dict.getType('sys_oper_type')}" class="selectpicker" data-none-selected-text="请选择" multiple>
|
||||
<label>操作类型: </label><select id="businessTypes" name="businessTypes" th:with="type=${@dict.getType('sys_oper_type')}" class="selectpicker" data-none-selected-text="请选择" multiple>
|
||||
<option th:each="dict : ${type}" th:text="${dict.dictLabel}" th:value="${dict.dictValue}"></option>
|
||||
</select>
|
||||
</li>
|
||||
|
@ -152,7 +152,7 @@
|
||||
|
||||
<div class="row">
|
||||
<div class="col-sm-12">
|
||||
<table class="table table-hover margin bottom">
|
||||
<table class="table table-hover margin bottom" style="table-layout:fixed;">
|
||||
<tbody>
|
||||
<tr>
|
||||
<td>Java名称</td>
|
||||
@ -174,6 +174,10 @@
|
||||
<td colspan="1">项目路径</td>
|
||||
<td colspan="3" th:text="${server.sys.userDir}"></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td colspan="1">运行参数</td>
|
||||
<td colspan="3" th:text="${server.jvm.inputArgs}"></td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
|
@ -9,7 +9,7 @@
|
||||
<link href="../static/css/font-awesome.min.css" th:href="@{/css/font-awesome.min.css}" rel="stylesheet"/>
|
||||
<link href="../static/css/style.min.css" th:href="@{/css/style.min.css}" rel="stylesheet"/>
|
||||
<link href="../static/css/login.min.css" th:href="@{/css/login.min.css}" rel="stylesheet"/>
|
||||
<link href="../static/ruoyi/css/ry-ui.css" th:href="@{/ruoyi/css/ry-ui.css?v=4.7.1}" rel="stylesheet"/>
|
||||
<link href="../static/ruoyi/css/ry-ui.css" th:href="@{/ruoyi/css/ry-ui.css?v=4.7.6}" rel="stylesheet"/>
|
||||
<!-- 360浏览器急速模式 -->
|
||||
<meta name="renderer" content="webkit">
|
||||
<!-- 避免IE使用兼容模式 -->
|
||||
@ -64,7 +64,7 @@
|
||||
</div>
|
||||
<div class="signup-footer">
|
||||
<div class="pull-left">
|
||||
© 2018-2021 All Rights Reserved. RuoYi <br>
|
||||
© 2018-2022 All Rights Reserved. RuoYi <br>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@ -74,7 +74,7 @@
|
||||
<script src="../static/ajax/libs/validate/jquery.validate.min.js" th:src="@{/ajax/libs/validate/jquery.validate.min.js}"></script>
|
||||
<script src="../static/ajax/libs/layer/layer.min.js" th:src="@{/ajax/libs/layer/layer.min.js}"></script>
|
||||
<script src="../static/ajax/libs/blockUI/jquery.blockUI.js" th:src="@{/ajax/libs/blockUI/jquery.blockUI.js}"></script>
|
||||
<script src="../static/ruoyi/js/ry-ui.js" th:src="@{/ruoyi/js/ry-ui.js?v=4.7.1}"></script>
|
||||
<script src="../static/ruoyi/js/ry-ui.js" th:src="@{/ruoyi/js/ry-ui.js?v=4.7.6}"></script>
|
||||
<script src="../static/ruoyi/register.js" th:src="@{/ruoyi/register.js}"></script>
|
||||
</body>
|
||||
</html>
|
||||
|
@ -140,7 +140,7 @@
|
||||
</ul>
|
||||
</body>
|
||||
<script th:src="@{/js/jquery.min.js}"></script>
|
||||
<script th:src="@{/ruoyi/js/common.js?v=4.7.1}"></script>
|
||||
<script th:src="@{/ruoyi/js/common.js?v=4.7.6}"></script>
|
||||
<script type="text/javascript">
|
||||
//皮肤样式列表
|
||||
var skins = ["skin-blue", "skin-green", "skin-purple", "skin-red", "skin-yellow"];
|
||||
|
@ -6,12 +6,12 @@
|
||||
<body class="white-bg">
|
||||
<div class="wrapper wrapper-content animated fadeInRight ibox-content">
|
||||
<form class="form-horizontal m" id="form-dept-add">
|
||||
<input id="treeId" name="parentId" type="hidden" th:value="${dept.deptId}" />
|
||||
<input id="treeId" name="parentId" type="hidden" th:value="${dept?.deptId}" />
|
||||
<div class="form-group">
|
||||
<label class="col-sm-3 control-label">上级部门:</label>
|
||||
<label class="col-sm-3 control-label is-required">上级部门:</label>
|
||||
<div class="col-sm-8">
|
||||
<div class="input-group">
|
||||
<input class="form-control" type="text" onclick="selectDeptTree()" id="treeName" readonly="true" th:value="${dept.deptName}">
|
||||
<input class="form-control" type="text" onclick="selectDeptTree()" id="treeName" readonly="true" th:value="${dept?.deptName}" required>
|
||||
<span class="input-group-addon"><i class="fa fa-search"></i></span>
|
||||
</div>
|
||||
</div>
|
||||
@ -108,10 +108,15 @@
|
||||
|
||||
/*部门管理-新增-选择父部门树*/
|
||||
function selectDeptTree() {
|
||||
var treeId = $("#treeId").val();
|
||||
if ($.common.isEmpty(treeId)) {
|
||||
$.modal.alertWarning("请先添加用户所属的部门!");
|
||||
return;
|
||||
}
|
||||
var options = {
|
||||
title: '部门选择',
|
||||
width: "380",
|
||||
url: prefix + "/selectDeptTree/" + $("#treeId").val(),
|
||||
url: prefix + "/selectDeptTree/" + treeId + "/0",
|
||||
callBack: doSubmit
|
||||
};
|
||||
$.modal.openOptions(options);
|
||||
|
@ -32,7 +32,7 @@
|
||||
var deptId = [[${deptId}]];
|
||||
var excludeId = [[${excludeId}]];
|
||||
$(function() {
|
||||
var url = $.common.isEmpty(excludeId) ? prefix + "/treeData": prefix + "/treeData/" + excludeId;
|
||||
var url = prefix + "/treeData/" + excludeId;
|
||||
var options = {
|
||||
url: url,
|
||||
expandLevel: 2,
|
||||
|
@ -52,7 +52,7 @@
|
||||
<script type="text/javascript">
|
||||
|
||||
$(function() {
|
||||
var url = ctx + "system/dept/roleDeptTreeData?roleId=" + $("#roleId").val();
|
||||
var url = ctx + "system/role/deptTreeData?roleId=" + $("#roleId").val();
|
||||
var options = {
|
||||
id: "deptTrees",
|
||||
url: url,
|
||||
|
@ -239,7 +239,7 @@
|
||||
function selectDeptTree() {
|
||||
var treeId = $("#treeId").val();
|
||||
var deptId = $.common.isEmpty(treeId) ? "100" : $("#treeId").val();
|
||||
var url = ctx + "system/dept/selectDeptTree/" + deptId;
|
||||
var url = ctx + "system/user/selectDeptTree/" + deptId;
|
||||
var options = {
|
||||
title: '选择部门',
|
||||
width: "380",
|
||||
@ -250,7 +250,6 @@
|
||||
}
|
||||
|
||||
function doSubmit(index, layero){
|
||||
var tree = layero.find("iframe")[0].contentWindow.$._tree;
|
||||
var body = $.modal.getChildFrame(index);
|
||||
$("#treeId").val(body.find('#treeId').val());
|
||||
$("#treeName").val(body.find('#treeName').val());
|
||||
|
@ -100,9 +100,14 @@
|
||||
|
||||
/* 添加角色-提交 */
|
||||
function submitHandler(index, layero){
|
||||
var rows = $.table.selectFirstColumns();
|
||||
var data = { "userId": $("#userId").val(), "roleIds": rows.join() };
|
||||
$.operate.saveTab(prefix + "/insertAuthRole", data);
|
||||
var roleIds = [];
|
||||
var data = $('#bootstrap-table').bootstrapTable('getData');
|
||||
for (var i = 0; i < data.length; i++) {
|
||||
if (data[i][0] || ($.common.isEmpty(data[i][0]) && data[i].flag)) {
|
||||
roleIds.push(data[i].roleId)
|
||||
}
|
||||
}
|
||||
$.operate.saveTab(prefix + "/insertAuthRole", { "userId": $("#userId").val(), "roleIds": roleIds.join() });
|
||||
}
|
||||
</script>
|
||||
</body>
|
||||
|
@ -0,0 +1,51 @@
|
||||
<!DOCTYPE html>
|
||||
<html lang="zh" xmlns:th="http://www.thymeleaf.org" >
|
||||
<head>
|
||||
<th:block th:include="include :: header('部门树选择')" />
|
||||
<th:block th:include="include :: ztree-css" />
|
||||
</head>
|
||||
<style>
|
||||
body{height:auto;font-family: "Microsoft YaHei";}
|
||||
button{font-family: "SimSun","Helvetica Neue",Helvetica,Arial;}
|
||||
</style>
|
||||
<body class="hold-transition box box-main">
|
||||
<input id="treeId" name="treeId" type="hidden" th:value="${dept.deptId}"/>
|
||||
<input id="treeName" name="treeName" type="hidden" th:value="${dept.deptName}"/>
|
||||
<div class="wrapper"><div class="treeShowHideButton" onclick="$.tree.toggleSearch();">
|
||||
<label id="btnShow" title="显示搜索" style="display:none;">︾</label>
|
||||
<label id="btnHide" title="隐藏搜索">︽</label>
|
||||
</div>
|
||||
<div class="treeSearchInput" id="search">
|
||||
<label for="keyword">关键字:</label><input type="text" class="empty" id="keyword" maxlength="50">
|
||||
<button class="btn" id="btn" onclick="$.tree.searchNode()"> 搜索 </button>
|
||||
</div>
|
||||
<div class="treeExpandCollapse">
|
||||
<a href="#" onclick="$.tree.expand()">展开</a> /
|
||||
<a href="#" onclick="$.tree.collapse()">折叠</a>
|
||||
</div>
|
||||
<div id="tree" class="ztree treeselect"></div>
|
||||
</div>
|
||||
<th:block th:include="include :: footer" />
|
||||
<th:block th:include="include :: ztree-js" />
|
||||
<script th:inline="javascript">
|
||||
var prefix = ctx + "system/user"
|
||||
var deptId = [[${deptId}]];
|
||||
$(function() {
|
||||
var url = prefix + "/deptTreeData";
|
||||
var options = {
|
||||
url: url,
|
||||
expandLevel: 2,
|
||||
onClick : zOnClick
|
||||
};
|
||||
$.tree.init(options);
|
||||
});
|
||||
|
||||
function zOnClick(event, treeId, treeNode) {
|
||||
var treeId = treeNode.id;
|
||||
var treeName = treeNode.name;
|
||||
$("#treeId").val(treeId);
|
||||
$("#treeName").val(treeName);
|
||||
}
|
||||
</script>
|
||||
</body>
|
||||
</html>
|
@ -203,7 +203,7 @@
|
||||
/* 用户管理-修改-选择部门树 */
|
||||
function selectDeptTree() {
|
||||
var deptId = $.common.isEmpty($("#treeId").val()) ? "100" : $("#treeId").val();
|
||||
var url = ctx + "system/dept/selectDeptTree/" + deptId;
|
||||
var url = ctx + "system/user/selectDeptTree/" + deptId;
|
||||
var options = {
|
||||
title: '选择部门',
|
||||
width: "380",
|
||||
@ -214,7 +214,6 @@
|
||||
}
|
||||
|
||||
function doSubmit(index, layero){
|
||||
var tree = layero.find("iframe")[0].contentWindow.$._tree;
|
||||
var body = $.modal.getChildFrame(index);
|
||||
$("#treeId").val(body.find('#treeId').val());
|
||||
$("#treeName").val(body.find('#treeName').val());
|
||||
|
@ -54,7 +54,7 @@
|
||||
</li>
|
||||
<li>
|
||||
<a class="btn btn-primary btn-rounded btn-sm" onclick="$.table.search()"><i class="fa fa-search"></i> 搜索</a>
|
||||
<a class="btn btn-warning btn-rounded btn-sm" onclick="$.form.reset()"><i class="fa fa-refresh"></i> 重置</a>
|
||||
<a class="btn btn-warning btn-rounded btn-sm" onclick="resetPre()"><i class="fa fa-refresh"></i> 重置</a>
|
||||
</li>
|
||||
</ul>
|
||||
</div>
|
||||
@ -191,7 +191,7 @@
|
||||
|
||||
function queryDeptTree()
|
||||
{
|
||||
var url = ctx + "system/dept/treeData";
|
||||
var url = ctx + "system/user/deptTreeData";
|
||||
var options = {
|
||||
url: url,
|
||||
expandLevel: 2,
|
||||
@ -222,6 +222,15 @@
|
||||
queryDeptTree();
|
||||
});
|
||||
|
||||
/* 自定义重置-表单重置/隐藏框/树节点选择色/搜索 */
|
||||
function resetPre() {
|
||||
$("#user-form")[0].reset();
|
||||
$("#deptId").val("");
|
||||
$("#parentId").val("");
|
||||
$(".curSelectedNode").removeClass("curSelectedNode");
|
||||
$.table.search();
|
||||
}
|
||||
|
||||
/* 用户管理-部门 */
|
||||
function dept() {
|
||||
var url = ctx + "system/dept";
|
||||
|
@ -5,7 +5,7 @@
|
||||
<parent>
|
||||
<artifactId>ruoyi</artifactId>
|
||||
<groupId>com.ruoyi</groupId>
|
||||
<version>4.7.1</version>
|
||||
<version>4.7.6</version>
|
||||
</parent>
|
||||
<modelVersion>4.0.0</modelVersion>
|
||||
|
||||
|
@ -25,4 +25,9 @@ public @interface DataScope
|
||||
* 用户表的别名
|
||||
*/
|
||||
public String userAlias() default "";
|
||||
|
||||
/**
|
||||
* 权限字符(用于多个角色匹配符合要求的权限)默认根据权限注解@RequiresPermissions获取,多个权限用逗号分隔开来
|
||||
*/
|
||||
public String permission() default "";
|
||||
}
|
||||
|
@ -5,6 +5,8 @@ import java.lang.annotation.Retention;
|
||||
import java.lang.annotation.RetentionPolicy;
|
||||
import java.lang.annotation.Target;
|
||||
import java.math.BigDecimal;
|
||||
import org.apache.poi.ss.usermodel.HorizontalAlignment;
|
||||
import org.apache.poi.ss.usermodel.IndexedColors;
|
||||
import com.ruoyi.common.utils.poi.ExcelHandlerAdapter;
|
||||
|
||||
/**
|
||||
@ -56,11 +58,6 @@ public @interface Excel
|
||||
*/
|
||||
public int roundingMode() default BigDecimal.ROUND_HALF_EVEN;
|
||||
|
||||
/**
|
||||
* 导出类型(0数字 1字符串)
|
||||
*/
|
||||
public ColumnType cellType() default ColumnType.STRING;
|
||||
|
||||
/**
|
||||
* 导出时在excel中每个列的高度 单位为字符
|
||||
*/
|
||||
@ -91,6 +88,11 @@ public @interface Excel
|
||||
*/
|
||||
public String[] combo() default {};
|
||||
|
||||
/**
|
||||
* 是否需要纵向合并单元格,应对需求:含有list集合单元格)
|
||||
*/
|
||||
public boolean needMerge() default false;
|
||||
|
||||
/**
|
||||
* 是否导出数据,应对需求:有时我们需要导出一份模板,这是标题需要但内容需要用户手工填写.
|
||||
*/
|
||||
@ -107,9 +109,34 @@ public @interface Excel
|
||||
public boolean isStatistics() default false;
|
||||
|
||||
/**
|
||||
* 导出字段对齐方式(0:默认;1:靠左;2:居中;3:靠右)
|
||||
* 导出类型(0数字 1字符串 2图片)
|
||||
*/
|
||||
public Align align() default Align.AUTO;
|
||||
public ColumnType cellType() default ColumnType.STRING;
|
||||
|
||||
/**
|
||||
* 导出列头背景色
|
||||
*/
|
||||
public IndexedColors headerBackgroundColor() default IndexedColors.GREY_50_PERCENT;
|
||||
|
||||
/**
|
||||
* 导出列头字体颜色
|
||||
*/
|
||||
public IndexedColors headerColor() default IndexedColors.WHITE;
|
||||
|
||||
/**
|
||||
* 导出单元格背景色
|
||||
*/
|
||||
public IndexedColors backgroundColor() default IndexedColors.WHITE;
|
||||
|
||||
/**
|
||||
* 导出单元格字体颜色
|
||||
*/
|
||||
public IndexedColors color() default IndexedColors.BLACK;
|
||||
|
||||
/**
|
||||
* 导出字段对齐方式
|
||||
*/
|
||||
public HorizontalAlignment align() default HorizontalAlignment.CENTER;
|
||||
|
||||
/**
|
||||
* 自定义数据处理器
|
||||
@ -121,22 +148,6 @@ public @interface Excel
|
||||
*/
|
||||
public String[] args() default {};
|
||||
|
||||
public enum Align
|
||||
{
|
||||
AUTO(0), LEFT(1), CENTER(2), RIGHT(3);
|
||||
private final int value;
|
||||
|
||||
Align(int value)
|
||||
{
|
||||
this.value = value;
|
||||
}
|
||||
|
||||
public int value()
|
||||
{
|
||||
return this.value;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 字段类型(0:导出导入;1:仅导出;2:仅导入)
|
||||
*/
|
||||
|
@ -49,7 +49,8 @@ public class ThreadPoolConfig
|
||||
protected ScheduledExecutorService scheduledExecutorService()
|
||||
{
|
||||
return new ScheduledThreadPoolExecutor(corePoolSize,
|
||||
new BasicThreadFactory.Builder().namingPattern("schedule-pool-%d").daemon(true).build())
|
||||
new BasicThreadFactory.Builder().namingPattern("schedule-pool-%d").daemon(true).build(),
|
||||
new ThreadPoolExecutor.CallerRunsPolicy())
|
||||
{
|
||||
@Override
|
||||
protected void afterExecute(Runnable r, Throwable t)
|
||||
|
@ -57,26 +57,6 @@ public class Constants
|
||||
*/
|
||||
public static final String LOGIN_FAIL = "Error";
|
||||
|
||||
/**
|
||||
* 当前记录起始索引
|
||||
*/
|
||||
public static final String PAGE_NUM = "pageNum";
|
||||
|
||||
/**
|
||||
* 每页显示记录数
|
||||
*/
|
||||
public static final String PAGE_SIZE = "pageSize";
|
||||
|
||||
/**
|
||||
* 排序列
|
||||
*/
|
||||
public static final String ORDER_BY_COLUMN = "orderByColumn";
|
||||
|
||||
/**
|
||||
* 排序的方向 "desc" 或者 "asc".
|
||||
*/
|
||||
public static final String IS_ASC = "isAsc";
|
||||
|
||||
/**
|
||||
* 系统用户授权缓存
|
||||
*/
|
||||
@ -110,16 +90,26 @@ public class Constants
|
||||
/**
|
||||
* RMI 远程方法调用
|
||||
*/
|
||||
public static final String LOOKUP_RMI = "rmi://";
|
||||
public static final String LOOKUP_RMI = "rmi:";
|
||||
|
||||
/**
|
||||
* LDAP 远程方法调用
|
||||
*/
|
||||
public static final String LOOKUP_LDAP = "ldap://";
|
||||
public static final String LOOKUP_LDAP = "ldap:";
|
||||
|
||||
/**
|
||||
* LDAPS 远程方法调用
|
||||
*/
|
||||
public static final String LOOKUP_LDAPS = "ldaps:";
|
||||
|
||||
/**
|
||||
* 定时任务白名单配置(仅允许访问的包名,如其他需要可以自行添加)
|
||||
*/
|
||||
public static final String[] JOB_WHITELIST_STR = { "com.ruoyi" };
|
||||
|
||||
/**
|
||||
* 定时任务违规的字符
|
||||
*/
|
||||
public static final String[] JOB_ERROR_STR = { "java.net.URL", "javax.naming.InitialContext", "org.yaml.snakeyaml",
|
||||
"org.springframework.jndi" };
|
||||
"org.springframework", "org.apache", "com.ruoyi.common.utils.file", "com.ruoyi.common.config" };
|
||||
}
|
@ -106,6 +106,9 @@ public class GenConstants
|
||||
/** 模糊查询 */
|
||||
public static final String QUERY_LIKE = "LIKE";
|
||||
|
||||
/** 相等查询 */
|
||||
public static final String QUERY_EQ = "EQ";
|
||||
|
||||
/** 需要 */
|
||||
public static final String REQUIRE = "1";
|
||||
}
|
||||
|
@ -0,0 +1,27 @@
|
||||
package com.ruoyi.common.core.context;
|
||||
|
||||
import org.springframework.web.context.request.RequestAttributes;
|
||||
import org.springframework.web.context.request.RequestContextHolder;
|
||||
import com.ruoyi.common.core.text.Convert;
|
||||
|
||||
/**
|
||||
* 权限信息
|
||||
*
|
||||
* @author ruoyi
|
||||
*/
|
||||
public class PermissionContextHolder
|
||||
{
|
||||
private static final String PERMISSION_CONTEXT_ATTRIBUTES = "PERMISSION_CONTEXT";
|
||||
|
||||
public static void setContext(String permission)
|
||||
{
|
||||
RequestContextHolder.currentRequestAttributes().setAttribute(PERMISSION_CONTEXT_ATTRIBUTES, permission,
|
||||
RequestAttributes.SCOPE_REQUEST);
|
||||
}
|
||||
|
||||
public static String getContext()
|
||||
{
|
||||
return Convert.toStr(RequestContextHolder.currentRequestAttributes().getAttribute(PERMISSION_CONTEXT_ATTRIBUTES,
|
||||
RequestAttributes.SCOPE_REQUEST));
|
||||
}
|
||||
}
|
@ -19,6 +19,7 @@ import com.ruoyi.common.core.page.PageDomain;
|
||||
import com.ruoyi.common.core.page.TableDataInfo;
|
||||
import com.ruoyi.common.core.page.TableSupport;
|
||||
import com.ruoyi.common.utils.DateUtils;
|
||||
import com.ruoyi.common.utils.PageUtils;
|
||||
import com.ruoyi.common.utils.ServletUtils;
|
||||
import com.ruoyi.common.utils.ShiroUtils;
|
||||
import com.ruoyi.common.utils.StringUtils;
|
||||
@ -55,14 +56,7 @@ public class BaseController
|
||||
*/
|
||||
protected void startPage()
|
||||
{
|
||||
PageDomain pageDomain = TableSupport.buildPageRequest();
|
||||
Integer pageNum = pageDomain.getPageNum();
|
||||
Integer pageSize = pageDomain.getPageSize();
|
||||
if (StringUtils.isNotNull(pageNum) && StringUtils.isNotNull(pageSize))
|
||||
{
|
||||
String orderBy = SqlUtil.escapeOrderBySql(pageDomain.getOrderBy());
|
||||
PageHelper.startPage(pageNum, pageSize, orderBy);
|
||||
}
|
||||
PageUtils.startPage();
|
||||
}
|
||||
|
||||
/**
|
||||
@ -78,6 +72,14 @@ public class BaseController
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 清理分页的线程变量
|
||||
*/
|
||||
protected void clearPage()
|
||||
{
|
||||
PageUtils.clearPage();
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取request
|
||||
*/
|
||||
|
@ -1,6 +1,7 @@
|
||||
package com.ruoyi.common.core.domain;
|
||||
|
||||
import java.util.HashMap;
|
||||
import java.util.Objects;
|
||||
import com.ruoyi.common.utils.StringUtils;
|
||||
|
||||
/**
|
||||
@ -81,20 +82,6 @@ public class AjaxResult extends HashMap<String, Object>
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 方便链式调用
|
||||
*
|
||||
* @param key 键
|
||||
* @param value 值
|
||||
* @return 数据对象
|
||||
*/
|
||||
@Override
|
||||
public AjaxResult put(String key, Object value)
|
||||
{
|
||||
super.put(key, value);
|
||||
return this;
|
||||
}
|
||||
|
||||
/**
|
||||
* 返回成功消息
|
||||
*
|
||||
@ -193,4 +180,38 @@ public class AjaxResult extends HashMap<String, Object>
|
||||
{
|
||||
return new AjaxResult(Type.ERROR, msg, data);
|
||||
}
|
||||
|
||||
/**
|
||||
* 是否为成功消息
|
||||
*
|
||||
* @return 结果
|
||||
*/
|
||||
public boolean isSuccess()
|
||||
{
|
||||
return !isError();
|
||||
}
|
||||
|
||||
/**
|
||||
* 是否为错误消息
|
||||
*
|
||||
* @return 结果
|
||||
*/
|
||||
public boolean isError()
|
||||
{
|
||||
return Objects.equals(Type.ERROR.value, this.get(CODE_TAG));
|
||||
}
|
||||
|
||||
/**
|
||||
* 方便链式调用
|
||||
*
|
||||
* @param key 键
|
||||
* @param value 值
|
||||
* @return 数据对象
|
||||
*/
|
||||
@Override
|
||||
public AjaxResult put(String key, Object value)
|
||||
{
|
||||
super.put(key, value);
|
||||
return this;
|
||||
}
|
||||
}
|
||||
|
@ -5,6 +5,8 @@ import java.util.Date;
|
||||
import java.util.HashMap;
|
||||
import java.util.Map;
|
||||
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||
import com.fasterxml.jackson.annotation.JsonIgnore;
|
||||
import com.fasterxml.jackson.annotation.JsonInclude;
|
||||
|
||||
/**
|
||||
* Entity基类
|
||||
@ -16,6 +18,7 @@ public class BaseEntity implements Serializable
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
/** 搜索值 */
|
||||
@JsonIgnore
|
||||
private String searchValue;
|
||||
|
||||
/** 创建者 */
|
||||
@ -36,6 +39,7 @@ public class BaseEntity implements Serializable
|
||||
private String remark;
|
||||
|
||||
/** 请求参数 */
|
||||
@JsonInclude(JsonInclude.Include.NON_EMPTY)
|
||||
private Map<String, Object> params;
|
||||
|
||||
public String getSearchValue()
|
||||
|
114
ruoyi-common/src/main/java/com/ruoyi/common/core/domain/R.java
Normal file
114
ruoyi-common/src/main/java/com/ruoyi/common/core/domain/R.java
Normal file
@ -0,0 +1,114 @@
|
||||
package com.ruoyi.common.core.domain;
|
||||
|
||||
import java.io.Serializable;
|
||||
|
||||
/**
|
||||
* 响应信息主体
|
||||
*
|
||||
* @author ruoyi
|
||||
*/
|
||||
public class R<T> implements Serializable
|
||||
{
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
/** 成功 */
|
||||
public static final int SUCCESS = 0;
|
||||
|
||||
/** 失败 */
|
||||
public static final int FAIL = 500;
|
||||
|
||||
private int code;
|
||||
|
||||
private String msg;
|
||||
|
||||
private T data;
|
||||
|
||||
public static <T> R<T> ok()
|
||||
{
|
||||
return restResult(null, SUCCESS, "操作成功");
|
||||
}
|
||||
|
||||
public static <T> R<T> ok(T data)
|
||||
{
|
||||
return restResult(data, SUCCESS, "操作成功");
|
||||
}
|
||||
|
||||
public static <T> R<T> ok(T data, String msg)
|
||||
{
|
||||
return restResult(data, SUCCESS, msg);
|
||||
}
|
||||
|
||||
public static <T> R<T> fail()
|
||||
{
|
||||
return restResult(null, FAIL, "操作失败");
|
||||
}
|
||||
|
||||
public static <T> R<T> fail(String msg)
|
||||
{
|
||||
return restResult(null, FAIL, msg);
|
||||
}
|
||||
|
||||
public static <T> R<T> fail(T data)
|
||||
{
|
||||
return restResult(data, FAIL, "操作失败");
|
||||
}
|
||||
|
||||
public static <T> R<T> fail(T data, String msg)
|
||||
{
|
||||
return restResult(data, FAIL, msg);
|
||||
}
|
||||
|
||||
public static <T> R<T> fail(int code, String msg)
|
||||
{
|
||||
return restResult(null, code, msg);
|
||||
}
|
||||
|
||||
private static <T> R<T> restResult(T data, int code, String msg)
|
||||
{
|
||||
R<T> apiResult = new R<>();
|
||||
apiResult.setCode(code);
|
||||
apiResult.setData(data);
|
||||
apiResult.setMsg(msg);
|
||||
return apiResult;
|
||||
}
|
||||
|
||||
public int getCode()
|
||||
{
|
||||
return code;
|
||||
}
|
||||
|
||||
public void setCode(int code)
|
||||
{
|
||||
this.code = code;
|
||||
}
|
||||
|
||||
public String getMsg()
|
||||
{
|
||||
return msg;
|
||||
}
|
||||
|
||||
public void setMsg(String msg)
|
||||
{
|
||||
this.msg = msg;
|
||||
}
|
||||
|
||||
public T getData()
|
||||
{
|
||||
return data;
|
||||
}
|
||||
|
||||
public void setData(T data)
|
||||
{
|
||||
this.data = data;
|
||||
}
|
||||
|
||||
public static <T> Boolean isError(R<T> ret)
|
||||
{
|
||||
return !isSuccess(ret);
|
||||
}
|
||||
|
||||
public static <T> Boolean isSuccess(R<T> ret)
|
||||
{
|
||||
return R.SUCCESS == ret.getCode();
|
||||
}
|
||||
}
|
@ -2,6 +2,7 @@ package com.ruoyi.common.core.domain.entity;
|
||||
|
||||
import javax.validation.constraints.Email;
|
||||
import javax.validation.constraints.NotBlank;
|
||||
import javax.validation.constraints.NotNull;
|
||||
import javax.validation.constraints.Size;
|
||||
import org.apache.commons.lang3.builder.ToStringBuilder;
|
||||
import org.apache.commons.lang3.builder.ToStringStyle;
|
||||
@ -30,7 +31,7 @@ public class SysDept extends BaseEntity
|
||||
private String deptName;
|
||||
|
||||
/** 显示顺序 */
|
||||
private String orderNum;
|
||||
private Integer orderNum;
|
||||
|
||||
/** 负责人 */
|
||||
private String leader;
|
||||
@ -95,13 +96,13 @@ public class SysDept extends BaseEntity
|
||||
this.deptName = deptName;
|
||||
}
|
||||
|
||||
@NotBlank(message = "显示顺序不能为空")
|
||||
public String getOrderNum()
|
||||
@NotNull(message = "显示顺序不能为空")
|
||||
public Integer getOrderNum()
|
||||
{
|
||||
return orderNum;
|
||||
}
|
||||
|
||||
public void setOrderNum(String orderNum)
|
||||
public void setOrderNum(Integer orderNum)
|
||||
{
|
||||
this.orderNum = orderNum;
|
||||
}
|
||||
|
@ -131,7 +131,7 @@ public class SysDictData extends BaseEntity
|
||||
|
||||
public boolean getDefault()
|
||||
{
|
||||
return UserConstants.YES.equals(this.isDefault) ? true : false;
|
||||
return UserConstants.YES.equals(this.isDefault);
|
||||
}
|
||||
|
||||
public String getIsDefault()
|
||||
|
@ -56,6 +56,7 @@ public class SysDictType extends BaseEntity
|
||||
|
||||
@NotBlank(message = "字典类型不能为空")
|
||||
@Size(min = 0, max = 100, message = "字典类型类型长度不能超过100个字符")
|
||||
@Pattern(regexp = "^[a-z][a-z0-9_]*$", message = "字典类型必须以字母开头,且只能为(小写字母,数字,下滑线)")
|
||||
public String getDictType()
|
||||
{
|
||||
return dictType;
|
||||
|
@ -1,5 +1,6 @@
|
||||
package com.ruoyi.common.core.domain.entity;
|
||||
|
||||
import java.util.Set;
|
||||
import javax.validation.constraints.*;
|
||||
import org.apache.commons.lang3.builder.ToStringBuilder;
|
||||
import org.apache.commons.lang3.builder.ToStringStyle;
|
||||
@ -52,6 +53,9 @@ public class SysRole extends BaseEntity
|
||||
/** 部门组(数据权限) */
|
||||
private Long[] deptIds;
|
||||
|
||||
/** 角色菜单权限 */
|
||||
private Set<String> permissions;
|
||||
|
||||
public SysRole()
|
||||
{
|
||||
|
||||
@ -177,6 +181,16 @@ public class SysRole extends BaseEntity
|
||||
this.deptIds = deptIds;
|
||||
}
|
||||
|
||||
public Set<String> getPermissions()
|
||||
{
|
||||
return permissions;
|
||||
}
|
||||
|
||||
public void setPermissions(Set<String> permissions)
|
||||
{
|
||||
this.permissions = permissions;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE)
|
||||
|
@ -11,6 +11,7 @@ import com.ruoyi.common.annotation.Excel.ColumnType;
|
||||
import com.ruoyi.common.annotation.Excel.Type;
|
||||
import com.ruoyi.common.annotation.Excels;
|
||||
import com.ruoyi.common.core.domain.BaseEntity;
|
||||
import com.ruoyi.common.xss.Xss;
|
||||
|
||||
/**
|
||||
* 用户对象 sys_user
|
||||
@ -160,6 +161,7 @@ public class SysUser extends BaseEntity
|
||||
this.roleId = roleId;
|
||||
}
|
||||
|
||||
@Xss(message = "登录账号不能包含脚本字符")
|
||||
@NotBlank(message = "登录账号不能为空")
|
||||
@Size(min = 0, max = 30, message = "登录账号长度不能超过30个字符")
|
||||
public String getLoginName()
|
||||
@ -172,6 +174,7 @@ public class SysUser extends BaseEntity
|
||||
this.loginName = loginName;
|
||||
}
|
||||
|
||||
@Xss(message = "用户昵称不能包含脚本字符")
|
||||
@Size(min = 0, max = 30, message = "用户昵称长度不能超过30个字符")
|
||||
public String getUserName()
|
||||
{
|
||||
|
@ -21,6 +21,9 @@ public class PageDomain
|
||||
/** 排序的方向desc或者asc */
|
||||
private String isAsc = "asc";
|
||||
|
||||
/** 分页参数合理化 */
|
||||
private Boolean reasonable = true;
|
||||
|
||||
public String getOrderBy()
|
||||
{
|
||||
if (StringUtils.isEmpty(orderByColumn))
|
||||
@ -69,4 +72,18 @@ public class PageDomain
|
||||
{
|
||||
this.isAsc = isAsc;
|
||||
}
|
||||
|
||||
public Boolean getReasonable()
|
||||
{
|
||||
if (StringUtils.isNull(reasonable))
|
||||
{
|
||||
return Boolean.TRUE;
|
||||
}
|
||||
return reasonable;
|
||||
}
|
||||
|
||||
public void setReasonable(Boolean reasonable)
|
||||
{
|
||||
this.reasonable = reasonable;
|
||||
}
|
||||
}
|
||||
|
@ -1,6 +1,6 @@
|
||||
package com.ruoyi.common.core.page;
|
||||
|
||||
import com.ruoyi.common.constant.Constants;
|
||||
import com.ruoyi.common.core.text.Convert;
|
||||
import com.ruoyi.common.utils.ServletUtils;
|
||||
|
||||
/**
|
||||
@ -10,16 +10,42 @@ import com.ruoyi.common.utils.ServletUtils;
|
||||
*/
|
||||
public class TableSupport
|
||||
{
|
||||
/**
|
||||
* 当前记录起始索引
|
||||
*/
|
||||
public static final String PAGE_NUM = "pageNum";
|
||||
|
||||
/**
|
||||
* 每页显示记录数
|
||||
*/
|
||||
public static final String PAGE_SIZE = "pageSize";
|
||||
|
||||
/**
|
||||
* 排序列
|
||||
*/
|
||||
public static final String ORDER_BY_COLUMN = "orderByColumn";
|
||||
|
||||
/**
|
||||
* 排序的方向 "desc" 或者 "asc".
|
||||
*/
|
||||
public static final String IS_ASC = "isAsc";
|
||||
|
||||
/**
|
||||
* 分页参数合理化
|
||||
*/
|
||||
public static final String REASONABLE = "reasonable";
|
||||
|
||||
/**
|
||||
* 封装分页对象
|
||||
*/
|
||||
public static PageDomain getPageDomain()
|
||||
{
|
||||
PageDomain pageDomain = new PageDomain();
|
||||
pageDomain.setPageNum(ServletUtils.getParameterToInt(Constants.PAGE_NUM));
|
||||
pageDomain.setPageSize(ServletUtils.getParameterToInt(Constants.PAGE_SIZE));
|
||||
pageDomain.setOrderByColumn(ServletUtils.getParameter(Constants.ORDER_BY_COLUMN));
|
||||
pageDomain.setIsAsc(ServletUtils.getParameter(Constants.IS_ASC));
|
||||
pageDomain.setPageNum(Convert.toInt(ServletUtils.getParameter(PAGE_NUM), 1));
|
||||
pageDomain.setPageSize(Convert.toInt(ServletUtils.getParameter(PAGE_SIZE), 10));
|
||||
pageDomain.setOrderByColumn(ServletUtils.getParameter(ORDER_BY_COLUMN));
|
||||
pageDomain.setIsAsc(ServletUtils.getParameter(IS_ASC));
|
||||
pageDomain.setReasonable(ServletUtils.getParameterToBool(REASONABLE));
|
||||
return pageDomain;
|
||||
}
|
||||
|
||||
|
@ -562,17 +562,12 @@ public class Convert
|
||||
switch (valueStr)
|
||||
{
|
||||
case "true":
|
||||
return true;
|
||||
case "false":
|
||||
return false;
|
||||
case "yes":
|
||||
return true;
|
||||
case "ok":
|
||||
return true;
|
||||
case "no":
|
||||
return false;
|
||||
case "1":
|
||||
return true;
|
||||
case "false":
|
||||
case "no":
|
||||
case "0":
|
||||
return false;
|
||||
default:
|
||||
@ -718,7 +713,7 @@ public class Convert
|
||||
}
|
||||
if (value instanceof Double)
|
||||
{
|
||||
return new BigDecimal((Double) value);
|
||||
return BigDecimal.valueOf((Double) value);
|
||||
}
|
||||
if (value instanceof Integer)
|
||||
{
|
||||
|
@ -7,7 +7,6 @@ package com.ruoyi.common.exception;
|
||||
*/
|
||||
public class GlobalException extends RuntimeException
|
||||
{
|
||||
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
/**
|
||||
@ -45,6 +44,7 @@ public class GlobalException extends RuntimeException
|
||||
return this;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getMessage()
|
||||
{
|
||||
return message;
|
||||
|
@ -44,6 +44,7 @@ public final class ServiceException extends RuntimeException
|
||||
return this;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getMessage()
|
||||
{
|
||||
return message;
|
||||
|
@ -18,7 +18,7 @@ public class InvalidExtensionException extends FileUploadException
|
||||
|
||||
public InvalidExtensionException(String[] allowedExtension, String extension, String filename)
|
||||
{
|
||||
super("filename : [" + filename + "], extension : [" + extension + "], allowed extension : [" + Arrays.toString(allowedExtension) + "]");
|
||||
super("文件[" + filename + "]后缀[" + extension + "]不正确,请上传" + Arrays.toString(allowedExtension) + "格式");
|
||||
this.allowedExtension = allowedExtension;
|
||||
this.extension = extension;
|
||||
this.filename = filename;
|
||||
|
@ -24,7 +24,6 @@ public class AddressUtils
|
||||
|
||||
public static String getRealAddressByIP(String ip)
|
||||
{
|
||||
String address = UNKNOWN;
|
||||
// 内网不查询
|
||||
if (IpUtils.internalIp(ip))
|
||||
{
|
||||
@ -50,6 +49,6 @@ public class AddressUtils
|
||||
log.error("获取地理位置异常 {}", e);
|
||||
}
|
||||
}
|
||||
return address;
|
||||
return UNKNOWN;
|
||||
}
|
||||
}
|
||||
|
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user