Compare commits
No commits in common. "master" and "v4.6.2" have entirely different histories.
|
|
@ -1 +0,0 @@
|
|||
custom: http://doc.ruoyi.vip/ruoyi/other/donate.html
|
||||
|
|
@ -25,8 +25,6 @@ target/
|
|||
*.iml
|
||||
*.ipr
|
||||
|
||||
### JRebel ###
|
||||
rebel.xml
|
||||
### NetBeans ###
|
||||
nbproject/private/
|
||||
build/*
|
||||
|
|
@ -39,7 +37,6 @@ nbdist/
|
|||
# Others
|
||||
*.log
|
||||
*.xml.versionsBackup
|
||||
*.swp
|
||||
|
||||
!*/build/*.java
|
||||
!*/build/*.html
|
||||
|
|
|
|||
13
README.md
13
README.md
|
|
@ -1,14 +1,3 @@
|
|||
<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.9</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.9-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。所有前端后台代码封装过后十分精简易上手,出错概率低。同时支持移动客户端访问。系统会陆续更新一些实用功能。
|
||||
|
|
@ -99,4 +88,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) [](https://jq.qq.com/?_wv=1027&k=540WfdEr) [](https://jq.qq.com/?_wv=1027&k=ss91fC4t) [](https://jq.qq.com/?_wv=1027&k=Cqd66IKe) [](https://jq.qq.com/?_wv=1027&k=7FplYUnR) [](http://qm.qq.com/cgi-bin/qm/qr?_wv=1027&k=lqMHu_5Fskm7H2S1vNAQTtzAUokVydwc&authKey=ptw0Fpch5pbNocML3CIJKKqZBaq2DI7cusKuzIgfMNiY3t9Pvd9hP%2BA8WYx3yaY1&noverify=0&group_code=174942938) [](http://qm.qq.com/cgi-bin/qm/qr?_wv=1027&k=blYlRDmwZXSXI5pVrPPU7ZJ1stFJ6Q2Q&authKey=ForGBWffHVlPt9NE3d7g4DoOIouBh%2BqvAj2lp1CLReHfZAUaK7SRrdwsChKpRJDJ&noverify=0&group_code=287843737)
|
||||
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)
|
||||
|
|
@ -1,6 +1,6 @@
|
|||
@echo off
|
||||
echo.
|
||||
echo [信息] 清理工程target生成路径。
|
||||
echo [信息] 清理生成路径。
|
||||
echo.
|
||||
|
||||
%~d0
|
||||
|
|
|
|||
|
|
@ -1,6 +1,6 @@
|
|||
@echo off
|
||||
echo.
|
||||
echo [信息] 使用Jar命令运行Web工程。
|
||||
echo [信息] 运行Web工程。
|
||||
echo.
|
||||
|
||||
cd %~dp0
|
||||
|
|
|
|||
77
pom.xml
77
pom.xml
|
|
@ -5,51 +5,44 @@
|
|||
|
||||
<groupId>com.ruoyi</groupId>
|
||||
<artifactId>ruoyi</artifactId>
|
||||
<version>4.7.9</version>
|
||||
<version>4.6.2</version>
|
||||
|
||||
<name>ruoyi</name>
|
||||
<url>http://www.ruoyi.vip</url>
|
||||
<description>若依管理系统</description>
|
||||
|
||||
<properties>
|
||||
<ruoyi.version>4.7.9</ruoyi.version>
|
||||
<ruoyi.version>4.6.2</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.13.0</shiro.version>
|
||||
<spring-framework.version>5.3.33</spring-framework.version>
|
||||
<thymeleaf.extras.shiro.version>2.1.0</thymeleaf.extras.shiro.version>
|
||||
<druid.version>1.2.23</druid.version>
|
||||
<shiro.version>1.7.1</shiro.version>
|
||||
<thymeleaf.extras.shiro.version>2.0.0</thymeleaf.extras.shiro.version>
|
||||
<druid.version>1.2.6</druid.version>
|
||||
<bitwalker.version>1.21</bitwalker.version>
|
||||
<kaptcha.version>2.3.3</kaptcha.version>
|
||||
<kaptcha.version>2.3.2</kaptcha.version>
|
||||
<swagger.version>3.0.0</swagger.version>
|
||||
<pagehelper.boot.version>1.4.7</pagehelper.boot.version>
|
||||
<fastjson.version>1.2.83</fastjson.version>
|
||||
<oshi.version>6.6.1</oshi.version>
|
||||
<commons.io.version>2.13.0</commons.io.version>
|
||||
<mybatis-spring-boot.version>2.1.4</mybatis-spring-boot.version>
|
||||
<pagehelper.boot.version>1.3.1</pagehelper.boot.version>
|
||||
<fastjson.version>1.2.76</fastjson.version>
|
||||
<oshi.version>5.7.4</oshi.version>
|
||||
<jna.version>5.8.0</jna.version>
|
||||
<commons.io.version>2.10.0</commons.io.version>
|
||||
<commons.fileupload.version>1.4</commons.fileupload.version>
|
||||
<poi.version>4.1.2</poi.version>
|
||||
<velocity.version>2.3</velocity.version>
|
||||
<velocity.version>1.7</velocity.version>
|
||||
</properties>
|
||||
|
||||
<!-- 依赖声明 -->
|
||||
<dependencyManagement>
|
||||
<dependencies>
|
||||
|
||||
<!-- SpringFramework的依赖配置-->
|
||||
<dependency>
|
||||
<groupId>org.springframework</groupId>
|
||||
<artifactId>spring-framework-bom</artifactId>
|
||||
<version>${spring-framework.version}</version>
|
||||
<type>pom</type>
|
||||
<scope>import</scope>
|
||||
</dependency>
|
||||
|
||||
<!-- SpringBoot的依赖配置-->
|
||||
<dependency>
|
||||
<groupId>org.springframework.boot</groupId>
|
||||
<artifactId>spring-boot-dependencies</artifactId>
|
||||
<version>2.5.15</version>
|
||||
<version>2.2.13.RELEASE</version>
|
||||
<type>pom</type>
|
||||
<scope>import</scope>
|
||||
</dependency>
|
||||
|
|
@ -63,7 +56,7 @@
|
|||
|
||||
<!-- 验证码 -->
|
||||
<dependency>
|
||||
<groupId>pro.fessional</groupId>
|
||||
<groupId>com.github.penggle</groupId>
|
||||
<artifactId>kaptcha</artifactId>
|
||||
<version>${kaptcha.version}</version>
|
||||
</dependency>
|
||||
|
|
@ -103,6 +96,13 @@
|
|||
<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,6 +117,18 @@
|
|||
<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>
|
||||
|
|
@ -137,6 +149,13 @@
|
|||
<version>${commons.io.version}</version>
|
||||
</dependency>
|
||||
|
||||
<!-- 文件上传工具类 -->
|
||||
<dependency>
|
||||
<groupId>commons-fileupload</groupId>
|
||||
<artifactId>commons-fileupload</artifactId>
|
||||
<version>${commons.fileupload.version}</version>
|
||||
</dependency>
|
||||
|
||||
<!-- excel工具 -->
|
||||
<dependency>
|
||||
<groupId>org.apache.poi</groupId>
|
||||
|
|
@ -147,8 +166,14 @@
|
|||
<!-- velocity代码生成使用模板 -->
|
||||
<dependency>
|
||||
<groupId>org.apache.velocity</groupId>
|
||||
<artifactId>velocity-engine-core</artifactId>
|
||||
<artifactId>velocity</artifactId>
|
||||
<version>${velocity.version}</version>
|
||||
<exclusions>
|
||||
<exclusion>
|
||||
<groupId>commons-collections</groupId>
|
||||
<artifactId>commons-collections</artifactId>
|
||||
</exclusion>
|
||||
</exclusions>
|
||||
</dependency>
|
||||
|
||||
<!-- 阿里JSON解析器 -->
|
||||
|
|
@ -230,7 +255,7 @@
|
|||
<repository>
|
||||
<id>public</id>
|
||||
<name>aliyun nexus</name>
|
||||
<url>https://maven.aliyun.com/repository/public</url>
|
||||
<url>http://maven.aliyun.com/nexus/content/groups/public/</url>
|
||||
<releases>
|
||||
<enabled>true</enabled>
|
||||
</releases>
|
||||
|
|
@ -241,7 +266,7 @@
|
|||
<pluginRepository>
|
||||
<id>public</id>
|
||||
<name>aliyun nexus</name>
|
||||
<url>https://maven.aliyun.com/repository/public</url>
|
||||
<url>http://maven.aliyun.com/nexus/content/groups/public/</url>
|
||||
<releases>
|
||||
<enabled>true</enabled>
|
||||
</releases>
|
||||
|
|
|
|||
|
|
@ -5,7 +5,7 @@
|
|||
<parent>
|
||||
<artifactId>ruoyi</artifactId>
|
||||
<groupId>com.ruoyi</groupId>
|
||||
<version>4.7.9</version>
|
||||
<version>4.6.2</version>
|
||||
</parent>
|
||||
<modelVersion>4.0.0</modelVersion>
|
||||
<packaging>jar</packaging>
|
||||
|
|
@ -74,7 +74,7 @@
|
|||
<plugin>
|
||||
<groupId>org.springframework.boot</groupId>
|
||||
<artifactId>spring-boot-maven-plugin</artifactId>
|
||||
<version>2.5.15</version>
|
||||
<version>2.1.1.RELEASE</version>
|
||||
<configuration>
|
||||
<fork>true</fork> <!-- 如果没有该配置,devtools不会生效 -->
|
||||
</configuration>
|
||||
|
|
@ -123,7 +123,6 @@
|
|||
<exclude>**/*.min.js</exclude>
|
||||
<exclude>**/*.min.css</exclude>
|
||||
<exclude>**/fileinput.js</exclude>
|
||||
<exclude>**/validate/**</exclude>
|
||||
<exclude>**/bootstrap-table/**</exclude>
|
||||
</excludes>
|
||||
</configuration>
|
||||
|
|
|
|||
|
|
@ -1,7 +1,5 @@
|
|||
package com.ruoyi.web.controller.common;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
import javax.servlet.http.HttpServletRequest;
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
import org.slf4j.Logger;
|
||||
|
|
@ -11,7 +9,6 @@ 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;
|
||||
|
|
@ -28,7 +25,6 @@ import com.ruoyi.common.utils.file.FileUtils;
|
|||
* @author ruoyi
|
||||
*/
|
||||
@Controller
|
||||
@RequestMapping("/common")
|
||||
public class CommonController
|
||||
{
|
||||
private static final Logger log = LoggerFactory.getLogger(CommonController.class);
|
||||
|
|
@ -36,15 +32,13 @@ public class CommonController
|
|||
@Autowired
|
||||
private ServerConfig serverConfig;
|
||||
|
||||
private static final String FILE_DELIMETER = ",";
|
||||
|
||||
/**
|
||||
* 通用下载请求
|
||||
*
|
||||
* @param fileName 文件名称
|
||||
* @param delete 是否删除
|
||||
*/
|
||||
@GetMapping("/download")
|
||||
@GetMapping("common/download")
|
||||
public void fileDownload(String fileName, Boolean delete, HttpServletResponse response, HttpServletRequest request)
|
||||
{
|
||||
try
|
||||
|
|
@ -71,9 +65,9 @@ public class CommonController
|
|||
}
|
||||
|
||||
/**
|
||||
* 通用上传请求(单个)
|
||||
* 通用上传请求
|
||||
*/
|
||||
@PostMapping("/upload")
|
||||
@PostMapping("/common/upload")
|
||||
@ResponseBody
|
||||
public AjaxResult uploadFile(MultipartFile file) throws Exception
|
||||
{
|
||||
|
|
@ -85,48 +79,8 @@ public class CommonController
|
|||
String fileName = FileUploadUtils.upload(filePath, file);
|
||||
String url = serverConfig.getUrl() + fileName;
|
||||
AjaxResult ajax = AjaxResult.success();
|
||||
ajax.put("url", url);
|
||||
ajax.put("fileName", fileName);
|
||||
ajax.put("newFileName", FileUtils.getName(fileName));
|
||||
ajax.put("originalFilename", file.getOriginalFilename());
|
||||
return ajax;
|
||||
}
|
||||
catch (Exception e)
|
||||
{
|
||||
return AjaxResult.error(e.getMessage());
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 通用上传请求(多个)
|
||||
*/
|
||||
@PostMapping("/uploads")
|
||||
@ResponseBody
|
||||
public AjaxResult uploadFiles(List<MultipartFile> files) throws Exception
|
||||
{
|
||||
try
|
||||
{
|
||||
// 上传文件路径
|
||||
String filePath = RuoYiConfig.getUploadPath();
|
||||
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;
|
||||
urls.add(url);
|
||||
fileNames.add(fileName);
|
||||
newFileNames.add(FileUtils.getName(fileName));
|
||||
originalFilenames.add(file.getOriginalFilename());
|
||||
}
|
||||
AjaxResult ajax = AjaxResult.success();
|
||||
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));
|
||||
ajax.put("url", url);
|
||||
return ajax;
|
||||
}
|
||||
catch (Exception e)
|
||||
|
|
@ -138,7 +92,7 @@ public class CommonController
|
|||
/**
|
||||
* 本地资源通用下载
|
||||
*/
|
||||
@GetMapping("/download/resource")
|
||||
@GetMapping("/common/download/resource")
|
||||
public void resourceDownload(String resource, HttpServletRequest request, HttpServletResponse response)
|
||||
throws Exception
|
||||
{
|
||||
|
|
|
|||
|
|
@ -77,22 +77,4 @@ public class DemoDialogController
|
|||
{
|
||||
return prefix + "/table/parent";
|
||||
}
|
||||
|
||||
/**
|
||||
* 多层窗口frame1
|
||||
*/
|
||||
@GetMapping("/frame1")
|
||||
public String frame1()
|
||||
{
|
||||
return prefix + "/table/frame1";
|
||||
}
|
||||
|
||||
/**
|
||||
* 多层窗口frame2
|
||||
*/
|
||||
@GetMapping("/frame2")
|
||||
public String frame2()
|
||||
{
|
||||
return prefix + "/table/frame2";
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -62,15 +62,6 @@ public class DemoFormController
|
|||
return prefix + "/timeline";
|
||||
}
|
||||
|
||||
/**
|
||||
* 进度条
|
||||
*/
|
||||
@GetMapping("/progress_bars")
|
||||
public String progress_bars()
|
||||
{
|
||||
return prefix + "/progress_bars";
|
||||
}
|
||||
|
||||
/**
|
||||
* 表单校验
|
||||
*/
|
||||
|
|
|
|||
|
|
@ -18,7 +18,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.core.text.Convert;
|
||||
import com.ruoyi.common.exception.ServiceException;
|
||||
import com.ruoyi.common.exception.BusinessException;
|
||||
import com.ruoyi.common.utils.StringUtils;
|
||||
import com.ruoyi.common.utils.poi.ExcelUtil;
|
||||
import com.ruoyi.web.controller.demo.domain.CustomerModel;
|
||||
|
|
@ -265,7 +265,7 @@ public class DemoOperateController extends BaseController
|
|||
{
|
||||
if (StringUtils.isNull(userList) || userList.size() == 0)
|
||||
{
|
||||
throw new ServiceException("导入用户数据不能为空!");
|
||||
throw new BusinessException("导入用户数据不能为空!");
|
||||
}
|
||||
int successNum = 0;
|
||||
int failureNum = 0;
|
||||
|
|
@ -315,7 +315,7 @@ public class DemoOperateController extends BaseController
|
|||
if (failureNum > 0)
|
||||
{
|
||||
failureMsg.insert(0, "很抱歉,导入失败!共 " + failureNum + " 条数据格式不正确,错误如下:");
|
||||
throw new ServiceException(failureMsg.toString());
|
||||
throw new BusinessException(failureMsg.toString());
|
||||
}
|
||||
else
|
||||
{
|
||||
|
|
|
|||
|
|
@ -16,7 +16,6 @@ import com.ruoyi.common.annotation.Excel;
|
|||
import com.ruoyi.common.annotation.Excel.ColumnType;
|
||||
import com.ruoyi.common.core.controller.BaseController;
|
||||
import com.ruoyi.common.core.domain.AjaxResult;
|
||||
import com.ruoyi.common.core.domain.BaseEntity;
|
||||
import com.ruoyi.common.core.page.PageDomain;
|
||||
import com.ruoyi.common.core.page.TableDataInfo;
|
||||
import com.ruoyi.common.core.page.TableSupport;
|
||||
|
|
@ -66,57 +65,6 @@ 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"));
|
||||
|
|
@ -127,22 +75,6 @@ public class DemoTableController extends BaseController
|
|||
columns.add(new UserTableColumn("用户状态", "status"));
|
||||
}
|
||||
|
||||
private final static List<DocumentModel> documents = new ArrayList<DocumentModel>();
|
||||
{
|
||||
documents.add(new DocumentModel(1, "247-XW·2024-D10-0001", "新闻热线[2024]000001", "筑路千条 幸福万家——新疆“四好农村路”十年成果显著", "新疆地域广袤,农村公路是群众出行的重要选择。顾志峰介绍,2014年以来的十年间,新疆累计完成农村公路建设投资约1071亿元,累计新改建农村公路11.99万公里。截至2023年底,全疆农村公路总里程达15.6万公里,农村公路乡镇通三级及以上公路比例达到90.3%、较大人口规模自然村通硬化路比例达到91.5%,农村公路路网进一步完善,特别是南疆四地州农村路网结构得到根本性改善。"));
|
||||
documents.add(new DocumentModel(2, "247-XW·2024-D30-0002", "新闻热线[2024]000002", "网红账号被封,央媒:如此炫富毒瘤早就该拔了", "在社交平台上分享自己的生活日常,本来无可厚非。但无底线地展示物欲、宣扬拜金,取笑甚至嘲讽工薪者的烟火生活,就会遮蔽普通人的平凡质朴和坚韧奋斗,在无形中消解芸芸众生脚踏实地、自立自强的社会正气。对这种助长金钱至上、刺激公众焦虑,既污染网络生态,又撕裂社会和谐的炫富“毒瘤”,必须坚决拔除之。在国家有关部门的部署下,近日,多个网络平台开展“不良价值导向内容专项治理”行动,对“奢靡浪费”“炫富拜金”等问题从严打击,倡导理性、文明的消费观和价值观。"));
|
||||
documents.add(new DocumentModel(3, "CT01-XW·2024-Y-0003", "新闻热线[2024]000003", "重庆一夫妻被骗至缅甸,家属:两人已被解救,预计很快能回国", "5月25日,重庆一对夫妻在前往泰国后失联,疑被诈骗集团骗至缅甸的消息引发广泛关注。警方已对此事立案调查,而这对夫妻的亲属则每天生活在焦急和不安之中。亲属:家都瘫痪了,事情一经曝光,迅速登上了热搜,成为公众热议的话题。据了解,这对夫妻原计划是去泰国谈生意,但不幸的是,他们的泰国之行变成了一场噩梦。亲属李先生透露,4月14日,他们夫妻二人抵达泰国,不久后便疑似被人以10万元的价格卖到缅甸,目前被困在缅甸妙瓦底的一个电信诈骗园区。"));
|
||||
documents.add(new DocumentModel(4, "CT01-XW·2024-Y-0004", "新闻热线[2024]000004", "江滨社区联合派出所、金霞消防站开展电动自行车安全隐患夜查活动", "近日,长沙市开福区江滨社区联合派出所、金霞消防站深入居民小区、单位场所,以电动车自行车火灾防范为重点,开展消防安全夜查行动。此次夜查紧紧围绕老旧居民区、“三合一”场所、沿街门店、夜间经营使用场所等场所开展监督检查,重点检查电动自行车违规停放充电、堵塞疏散通道和安全出口,架空层违规作为电动自行车停放充电场所,电动自行车违规“进楼入户”“飞线充电”,电动自行车擅自改装等五大类问题。"));
|
||||
documents.add(new DocumentModel(5, "CT01-XW·2024-Y-0005", "新闻热线[2024]000005", "奋力建设“七个岳阳”,筑牢民生保障 奔向美好生活", "岳阳市委八届六次全会提出,坚持“1376”总体思路,着力推动高质量发展。“1”即始终牢记习近平总书记“守护好一江碧水”殷殷嘱托;“3”即在锚定“三高四新”美好蓝图中强化融入长江经济带、省域副中心、内陆地区改革开放高地三种意识;“7”即全面把握打造实力岳阳、富饶岳阳、美丽岳阳、开放岳阳、幸福岳阳、平安岳阳、新风岳阳“七个岳阳”目标任务;“6”即抓紧抓实“抓产业、促协调、优生态、扩开放、惠民生、防风险”六项重点工作。“1376”总体思路站位高远,契合实际,是岳阳深入学习贯彻落实习近平新时代中国特色社会主义思想,向着强国建设、民族复兴宏伟目标奋勇前进的行动方案、奋进号令。为全面展示岳阳锚定新坐标、攀登新高度的奋斗姿态,营造催人奋进的舆论氛围,从2月1日起,湖南日报社岳阳分社联动岳阳日报社、岳阳市广播电视台等主流媒体推出《奋力建设“七个岳阳”》系列报道。敬请关注。"));
|
||||
documents.add(new DocumentModel(6, "CT01-XW·2024-Y-0006", "新闻热线[2024]000006", "市场状况充满挑战!极星宣布裁员全球约15%的员工", "据路透社报道,极星周五以“充满挑战的市场状况”为由,宣布计划在全球范围内裁减约450个职位。此次裁员之际,许多人都对电动汽车需求降温表示担忧,而且极星预计汽车业务最早将在2025年开始实现收支平衡。极星发言人表示:“作为该商业计划的一部分,我们需要调整我们的业务和运营规模。” “这涉及减少外部支出,遗憾的是,还包括我们的员工数量。”该公司还表示,希望减少对沃尔沃及其母公司吉利外部融资的依赖,最近还表示希望削减成本并提高电动汽车的利润率。"));
|
||||
documents.add(new DocumentModel(7, "CT01-XW·2024-Y-0007", "新闻热线[2024]000007", "浙江隐秘富豪涉百亿非法集资案,部分资金流入新造车公司", "5月10日、11日,上海北广投资管理有限公司(下称“北广投”)非法集资案在上海黄浦区人民法院一审公开开庭审理,北广投实控人周敏、法定代表人朱江等30余名中高管被控非法吸收公众存款罪。根据财新报道,这一案件中,非法集资的资金有部分流入了两家新能源车企——爱驰汽车、万象汽车。同时,有多位投资人引述与经侦部门沟通时的说法称,该案事发时未兑付金额有130余亿元,其中去往广微控股45亿元、万象汽车63亿元、爱驰汽车15亿元。"));
|
||||
documents.add(new DocumentModel(8, "CT01-XW·2024-Y-0008", "新闻热线[2024]000008", "特斯拉宣布Model Y升级:搭载HW4.0硬件,售价仍25.89万元起", "2月1日,特斯拉官方宣布ModelY升级。外观上,新增ModelY专属色“快银车漆”,并采用烈焰红代替中国红、星空灰代替冷光银;性能上,ModelY全系配备全新一代自动辅助驾驶硬件(HW4.0),通过搭载超远距离双目摄像头,ModelY的最远探测距离达424米。由此,特斯拉全系车型均配备了自动辅助驾驶硬件HW4.0。在售价方面,特斯拉中国官网显示,ModelY车型依然保持原价。ModelY后轮驱动版25.89万元起、ModelY长续航版29.99万元起、ModelY高性能版售价36.39万元起。"));
|
||||
documents.add(new DocumentModel(9, "CT01-XW·2024-D10-0009", "新闻热线[2024]000009", "华为手机归来,谁最受伤?", "低迷周期下的智能手机市场在2023年下半年迎来了华为的回归,这也给本就竞争激烈的市场环境带来了更大变数。1月29日,有消息称,华为已注册“星耀手机”品牌商标,定位中端手机市场,但上述消息并未获得华为方面确认。“目前星耀的相关信息我们看到了,但是没有获得产品信息以及启动线下铺货的通知。对于和其他品牌的二选一问题,听其他省份的经销商说过,但目前(华为渠道)这边也没有更多动作。”一位广东区域的华为核心经销商对记者说。但华为手机的反扑已经开始。在多家调研机构公布的2023年四季度智能手机出货数据中,华为手机的量正在明显上升,当季增幅在35%到47%之间。不过,从全年数据来看,并未登上前五榜单。"));
|
||||
documents.add(new DocumentModel(10, "CT01-XW·2024-D10-0010", "新闻热线[2024]000010", "疯狂裁员的硅谷大厂:除了AI,其它都是将就", "放眼望去,近期科技企业财报形势一片大好,裁员浪潮却仍在不断蔓延。国内职场动态看脉脉,那硅谷裁员情况就得看layoff.fyi了。数据显示,2024年,103家科技企业进行了裁员,28963位员工失去了饭碗。其中,电子支付公司PayPal大笔一挥,裁掉2500人,微软则在开年就裁掉1900人。回望2023年,谷歌、Meta、亚马逊、微软均为裁员重灾区,裁员人数在一万左右。具体而言,谷歌近日披露的财报指出,2023年谷歌解雇了12000多名员工,光是在遣散费和其他费用上就花费了21亿美元。而且裁员费用还在不断增加,2024年刚过去一个月,谷歌就已经花费了7亿美元用来裁员。"));
|
||||
documents.add(new DocumentModel(11, "CT01-XW·2024-D30-0011", "新闻热线[2024]000011", "国产手机品牌重新崛起背后:市场正在逐步恢复活力,竞争也愈发激烈", "2024年伊始,随着全球经济的逐渐复苏,手机消费市场也展现出勃勃生机。中国信通院最新数据显示,2023年中国市场手机出货量实现了6.5%的同比增长,其中5G手机增长势头更为强劲,占比高达82.8%。1月25日,国际数据公司(IDC)发布了最新手机季度跟踪报告,揭示了中国智能手机市场在2023年第四季度的出货量情况。报告显示,该季度中国智能手机市场出货量达到了约7363万台,同比增长1.2%。这是在连续十个季度同比下降后,中国智能手机市场首次实现反弹。这一积极信号表明,市场正在逐步恢复活力,各大品牌之间的竞争也愈发激烈。"));
|
||||
documents.add(new DocumentModel(12, "CT01-XW·2024-D30-0012", "新闻热线[2024]000012", "SpaceX将于1月31日向国际空间站发射天鹅号货运飞船", "1月29日消息,美国太空探索技术公司SpaceX计划于当地时间1月30日,利用“猎鹰9号”火箭从佛罗里达州肯尼迪航天中心发射诺斯罗普·格鲁曼公司的“天鹅号”货运飞船至国际空间站。此次任务是执行NG-20商业补给,将运送约8200多磅的物资、设备及科学实验器材。"));
|
||||
}
|
||||
|
||||
/**
|
||||
* 搜索相关
|
||||
*/
|
||||
|
|
@ -226,15 +158,6 @@ public class DemoTableController extends BaseController
|
|||
return prefix + "/remember";
|
||||
}
|
||||
|
||||
/**
|
||||
* 表格保存状态
|
||||
*/
|
||||
@GetMapping("/cookie")
|
||||
public String cookie()
|
||||
{
|
||||
return prefix + "/cookie";
|
||||
}
|
||||
|
||||
/**
|
||||
* 跳转至指定页
|
||||
*/
|
||||
|
|
@ -416,15 +339,6 @@ public class DemoTableController extends BaseController
|
|||
return prefix + "/dynamicColumns";
|
||||
}
|
||||
|
||||
/**
|
||||
* 表格虚拟滚动
|
||||
*/
|
||||
@GetMapping("/virtualScroll")
|
||||
public String virtualScroll()
|
||||
{
|
||||
return prefix + "/virtualScroll";
|
||||
}
|
||||
|
||||
/**
|
||||
* 自定义视图分页
|
||||
*/
|
||||
|
|
@ -434,24 +348,6 @@ public class DemoTableController extends BaseController
|
|||
return prefix + "/customView";
|
||||
}
|
||||
|
||||
/**
|
||||
* 全文索引
|
||||
*/
|
||||
@GetMapping("/textSearch")
|
||||
public String textSearch()
|
||||
{
|
||||
return prefix + "/textSearch";
|
||||
}
|
||||
|
||||
/**
|
||||
* 异步加载表格树
|
||||
*/
|
||||
@GetMapping("/asynTree")
|
||||
public String asynTree()
|
||||
{
|
||||
return prefix + "/asynTree";
|
||||
}
|
||||
|
||||
/**
|
||||
* 表格其他操作
|
||||
*/
|
||||
|
|
@ -516,135 +412,6 @@ public class DemoTableController extends BaseController
|
|||
rspData.setTotal(userList.size());
|
||||
return rspData;
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询全文索引数据
|
||||
*/
|
||||
@PostMapping("/text/list")
|
||||
@ResponseBody
|
||||
public TableDataInfo textList(BaseEntity baseEntity)
|
||||
{
|
||||
TableDataInfo rspData = new TableDataInfo();
|
||||
List<DocumentModel> documentList = new ArrayList<DocumentModel>(Arrays.asList(new DocumentModel[documents.size()]));
|
||||
Collections.copy(documentList, documents);
|
||||
// 查询条件过滤
|
||||
if (StringUtils.isNotEmpty(baseEntity.getSearchValue()))
|
||||
{
|
||||
documentList.clear();
|
||||
for (DocumentModel document : documents)
|
||||
{
|
||||
boolean indexFlag = false;
|
||||
if (document.getTitle().contains(baseEntity.getSearchValue()))
|
||||
{
|
||||
indexFlag = true;
|
||||
document.setTitle(document.getTitle().replace(baseEntity.getSearchValue(), "<font color=\"red\">" + baseEntity.getSearchValue() + "</font>"));
|
||||
}
|
||||
if (document.getContent().contains(baseEntity.getSearchValue()))
|
||||
{
|
||||
indexFlag = true;
|
||||
document.setContent(document.getContent().replace(baseEntity.getSearchValue(), "<font color=\"red\">" + baseEntity.getSearchValue() + "</font>"));
|
||||
}
|
||||
if (indexFlag)
|
||||
{
|
||||
documentList.add(document);
|
||||
}
|
||||
}
|
||||
}
|
||||
PageDomain pageDomain = TableSupport.buildPageRequest();
|
||||
if (null == pageDomain.getPageNum() || null == pageDomain.getPageSize())
|
||||
{
|
||||
rspData.setRows(documentList);
|
||||
rspData.setTotal(documentList.size());
|
||||
return rspData;
|
||||
}
|
||||
Integer pageNum = (pageDomain.getPageNum() - 1) * 10;
|
||||
Integer pageSize = pageDomain.getPageNum() * 10;
|
||||
if (pageSize > documentList.size())
|
||||
{
|
||||
pageSize = documentList.size();
|
||||
}
|
||||
rspData.setRows(documentList.subList(pageNum, pageSize));
|
||||
rspData.setTotal(documentList.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) * pageDomain.getPageSize();
|
||||
Integer pageSize = pageDomain.getPageNum() * pageDomain.getPageSize();
|
||||
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
|
||||
|
|
@ -830,194 +597,3 @@ 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;
|
||||
}
|
||||
}
|
||||
|
||||
class DocumentModel
|
||||
{
|
||||
/** 编号 */
|
||||
private int tableId;
|
||||
|
||||
/** 档号 */
|
||||
private String archiveNo;
|
||||
|
||||
/** 文件编号 */
|
||||
private String docNo;
|
||||
|
||||
/** 标题 */
|
||||
private String title;
|
||||
|
||||
/** 内容 */
|
||||
private String content;
|
||||
|
||||
public DocumentModel()
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
public DocumentModel(int tableId, String archiveNo, String docNo, String title, String content)
|
||||
{
|
||||
this.tableId = tableId;
|
||||
this.archiveNo = archiveNo;
|
||||
this.docNo = docNo;
|
||||
this.title = title;
|
||||
this.content = content;
|
||||
}
|
||||
|
||||
public int getTableId()
|
||||
{
|
||||
return tableId;
|
||||
}
|
||||
|
||||
public String getArchiveNo()
|
||||
{
|
||||
return archiveNo;
|
||||
}
|
||||
|
||||
public String getDocNo()
|
||||
{
|
||||
return docNo;
|
||||
}
|
||||
|
||||
public String getTitle()
|
||||
{
|
||||
return title;
|
||||
}
|
||||
|
||||
public String getContent()
|
||||
{
|
||||
return content;
|
||||
}
|
||||
|
||||
public void setTableId(int tableId)
|
||||
{
|
||||
this.tableId = tableId;
|
||||
}
|
||||
|
||||
public void setArchiveNo(String archiveNo)
|
||||
{
|
||||
this.archiveNo = archiveNo;
|
||||
}
|
||||
|
||||
public void setDocNo(String docNo)
|
||||
{
|
||||
this.docNo = docNo;
|
||||
}
|
||||
|
||||
public void setTitle(String title)
|
||||
{
|
||||
this.title = title;
|
||||
}
|
||||
|
||||
public void setContent(String content)
|
||||
{
|
||||
this.content = content;
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,6 +1,5 @@
|
|||
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;
|
||||
|
|
@ -26,7 +25,6 @@ public class CacheController extends BaseController
|
|||
@Autowired
|
||||
private CacheService cacheService;
|
||||
|
||||
@RequiresPermissions("monitor:cache:view")
|
||||
@GetMapping()
|
||||
public String cache(ModelMap mmap)
|
||||
{
|
||||
|
|
@ -34,7 +32,6 @@ public class CacheController extends BaseController
|
|||
return prefix + "/cache";
|
||||
}
|
||||
|
||||
@RequiresPermissions("monitor:cache:view")
|
||||
@PostMapping("/getNames")
|
||||
public String getCacheNames(String fragment, ModelMap mmap)
|
||||
{
|
||||
|
|
@ -42,16 +39,14 @@ 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("cacheKeys", cacheService.getCacheKeys(cacheName));
|
||||
mmap.put("cacheKyes", cacheService.getCacheKeys(cacheName));
|
||||
return prefix + "/cache::" + fragment;
|
||||
}
|
||||
|
||||
@RequiresPermissions("monitor:cache:view")
|
||||
@PostMapping("/getValue")
|
||||
public String getCacheValue(String fragment, String cacheName, String cacheKey, ModelMap mmap)
|
||||
{
|
||||
|
|
@ -61,7 +56,6 @@ public class CacheController extends BaseController
|
|||
return prefix + "/cache::" + fragment;
|
||||
}
|
||||
|
||||
@RequiresPermissions("monitor:cache:view")
|
||||
@PostMapping("/clearCacheName")
|
||||
@ResponseBody
|
||||
public AjaxResult clearCacheName(String cacheName, ModelMap mmap)
|
||||
|
|
@ -70,7 +64,6 @@ public class CacheController extends BaseController
|
|||
return AjaxResult.success();
|
||||
}
|
||||
|
||||
@RequiresPermissions("monitor:cache:view")
|
||||
@PostMapping("/clearCacheKey")
|
||||
@ResponseBody
|
||||
public AjaxResult clearCacheKey(String cacheName, String cacheKey, ModelMap mmap)
|
||||
|
|
@ -79,7 +72,6 @@ public class CacheController extends BaseController
|
|||
return AjaxResult.success();
|
||||
}
|
||||
|
||||
@RequiresPermissions("monitor:cache:view")
|
||||
@GetMapping("/clearAll")
|
||||
@ResponseBody
|
||||
public AjaxResult clearAll(ModelMap mmap)
|
||||
|
|
|
|||
|
|
@ -12,10 +12,12 @@ import org.springframework.web.bind.annotation.PostMapping;
|
|||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.ResponseBody;
|
||||
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.page.TableDataInfo;
|
||||
import com.ruoyi.common.enums.BusinessType;
|
||||
import com.ruoyi.common.utils.ShiroUtils;
|
||||
import com.ruoyi.common.utils.poi.ExcelUtil;
|
||||
import com.ruoyi.system.domain.SysConfig;
|
||||
import com.ruoyi.system.service.ISysConfigService;
|
||||
|
|
@ -83,18 +85,17 @@ public class SysConfigController extends BaseController
|
|||
@ResponseBody
|
||||
public AjaxResult addSave(@Validated SysConfig config)
|
||||
{
|
||||
if (!configService.checkConfigKeyUnique(config))
|
||||
if (UserConstants.CONFIG_KEY_NOT_UNIQUE.equals(configService.checkConfigKeyUnique(config)))
|
||||
{
|
||||
return error("新增参数'" + config.getConfigName() + "'失败,参数键名已存在");
|
||||
}
|
||||
config.setCreateBy(getLoginName());
|
||||
config.setCreateBy(ShiroUtils.getLoginName());
|
||||
return toAjax(configService.insertConfig(config));
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改参数配置
|
||||
*/
|
||||
@RequiresPermissions("system:config:edit")
|
||||
@GetMapping("/edit/{configId}")
|
||||
public String edit(@PathVariable("configId") Long configId, ModelMap mmap)
|
||||
{
|
||||
|
|
@ -111,11 +112,11 @@ public class SysConfigController extends BaseController
|
|||
@ResponseBody
|
||||
public AjaxResult editSave(@Validated SysConfig config)
|
||||
{
|
||||
if (!configService.checkConfigKeyUnique(config))
|
||||
if (UserConstants.CONFIG_KEY_NOT_UNIQUE.equals(configService.checkConfigKeyUnique(config)))
|
||||
{
|
||||
return error("修改参数'" + config.getConfigName() + "'失败,参数键名已存在");
|
||||
}
|
||||
config.setUpdateBy(getLoginName());
|
||||
config.setUpdateBy(ShiroUtils.getLoginName());
|
||||
return toAjax(configService.updateConfig(config));
|
||||
}
|
||||
|
||||
|
|
@ -150,7 +151,7 @@ public class SysConfigController extends BaseController
|
|||
*/
|
||||
@PostMapping("/checkConfigKeyUnique")
|
||||
@ResponseBody
|
||||
public boolean checkConfigKeyUnique(SysConfig config)
|
||||
public String checkConfigKeyUnique(SysConfig config)
|
||||
{
|
||||
return configService.checkConfigKeyUnique(config);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -17,7 +17,9 @@ 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.ShiroUtils;
|
||||
import com.ruoyi.common.utils.StringUtils;
|
||||
import com.ruoyi.system.service.ISysDeptService;
|
||||
|
||||
|
|
@ -57,9 +59,9 @@ public class SysDeptController extends BaseController
|
|||
@GetMapping("/add/{parentId}")
|
||||
public String add(@PathVariable("parentId") Long parentId, ModelMap mmap)
|
||||
{
|
||||
if (!getSysUser().isAdmin())
|
||||
if (!ShiroUtils.getSysUser().isAdmin())
|
||||
{
|
||||
parentId = getSysUser().getDeptId();
|
||||
parentId = ShiroUtils.getSysUser().getDeptId();
|
||||
}
|
||||
mmap.put("dept", deptService.selectDeptById(parentId));
|
||||
return prefix + "/add";
|
||||
|
|
@ -74,22 +76,20 @@ public class SysDeptController extends BaseController
|
|||
@ResponseBody
|
||||
public AjaxResult addSave(@Validated SysDept dept)
|
||||
{
|
||||
if (!deptService.checkDeptNameUnique(dept))
|
||||
if (UserConstants.DEPT_NAME_NOT_UNIQUE.equals(deptService.checkDeptNameUnique(dept)))
|
||||
{
|
||||
return error("新增部门'" + dept.getDeptName() + "'失败,部门名称已存在");
|
||||
}
|
||||
dept.setCreateBy(getLoginName());
|
||||
dept.setCreateBy(ShiroUtils.getLoginName());
|
||||
return toAjax(deptService.insertDept(dept));
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改部门
|
||||
* 修改
|
||||
*/
|
||||
@RequiresPermissions("system:dept:edit")
|
||||
@GetMapping("/edit/{deptId}")
|
||||
public String edit(@PathVariable("deptId") Long deptId, ModelMap mmap)
|
||||
{
|
||||
deptService.checkDeptDataScope(deptId);
|
||||
SysDept dept = deptService.selectDeptById(deptId);
|
||||
if (StringUtils.isNotNull(dept) && 100L == deptId)
|
||||
{
|
||||
|
|
@ -100,7 +100,7 @@ public class SysDeptController extends BaseController
|
|||
}
|
||||
|
||||
/**
|
||||
* 修改保存部门
|
||||
* 保存
|
||||
*/
|
||||
@Log(title = "部门管理", businessType = BusinessType.UPDATE)
|
||||
@RequiresPermissions("system:dept:edit")
|
||||
|
|
@ -108,21 +108,20 @@ public class SysDeptController extends BaseController
|
|||
@ResponseBody
|
||||
public AjaxResult editSave(@Validated SysDept dept)
|
||||
{
|
||||
Long deptId = dept.getDeptId();
|
||||
deptService.checkDeptDataScope(deptId);
|
||||
if (!deptService.checkDeptNameUnique(dept))
|
||||
if (UserConstants.DEPT_NAME_NOT_UNIQUE.equals(deptService.checkDeptNameUnique(dept)))
|
||||
{
|
||||
return error("修改部门'" + dept.getDeptName() + "'失败,部门名称已存在");
|
||||
}
|
||||
else if (dept.getParentId().equals(deptId))
|
||||
else if (dept.getParentId().equals(dept.getDeptId()))
|
||||
{
|
||||
return error("修改部门'" + dept.getDeptName() + "'失败,上级部门不能是自己");
|
||||
}
|
||||
else if (StringUtils.equals(UserConstants.DEPT_DISABLE, dept.getStatus()) && deptService.selectNormalChildrenDeptById(deptId) > 0)
|
||||
else if (StringUtils.equals(UserConstants.DEPT_DISABLE, dept.getStatus())
|
||||
&& deptService.selectNormalChildrenDeptById(dept.getDeptId()) > 0)
|
||||
{
|
||||
return AjaxResult.error("该部门包含未停用的子部门!");
|
||||
}
|
||||
dept.setUpdateBy(getLoginName());
|
||||
dept.setUpdateBy(ShiroUtils.getLoginName());
|
||||
return toAjax(deptService.updateDept(dept));
|
||||
}
|
||||
|
||||
|
|
@ -143,7 +142,6 @@ public class SysDeptController extends BaseController
|
|||
{
|
||||
return AjaxResult.warn("部门存在用户,不允许删除");
|
||||
}
|
||||
deptService.checkDeptDataScope(deptId);
|
||||
return toAjax(deptService.deleteDeptById(deptId));
|
||||
}
|
||||
|
||||
|
|
@ -152,7 +150,7 @@ public class SysDeptController extends BaseController
|
|||
*/
|
||||
@PostMapping("/checkDeptNameUnique")
|
||||
@ResponseBody
|
||||
public boolean checkDeptNameUnique(SysDept dept)
|
||||
public String checkDeptNameUnique(SysDept dept)
|
||||
{
|
||||
return deptService.checkDeptNameUnique(dept);
|
||||
}
|
||||
|
|
@ -165,13 +163,24 @@ public class SysDeptController extends BaseController
|
|||
*/
|
||||
@GetMapping(value = { "/selectDeptTree/{deptId}", "/selectDeptTree/{deptId}/{excludeId}" })
|
||||
public String selectDeptTree(@PathVariable("deptId") Long deptId,
|
||||
@PathVariable(value = "excludeId", required = false) Long excludeId, ModelMap mmap)
|
||||
@PathVariable(value = "excludeId", required = false) String 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;
|
||||
}
|
||||
|
||||
/**
|
||||
* 加载部门列表树(排除下级)
|
||||
*/
|
||||
|
|
@ -180,8 +189,19 @@ public class SysDeptController extends BaseController
|
|||
public List<Ztree> treeDataExcludeChild(@PathVariable(value = "excludeId", required = false) Long excludeId)
|
||||
{
|
||||
SysDept dept = new SysDept();
|
||||
dept.setExcludeId(excludeId);
|
||||
dept.setDeptId(excludeId);
|
||||
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;
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -17,6 +17,7 @@ import com.ruoyi.common.core.domain.AjaxResult;
|
|||
import com.ruoyi.common.core.domain.entity.SysDictData;
|
||||
import com.ruoyi.common.core.page.TableDataInfo;
|
||||
import com.ruoyi.common.enums.BusinessType;
|
||||
import com.ruoyi.common.utils.ShiroUtils;
|
||||
import com.ruoyi.common.utils.poi.ExcelUtil;
|
||||
import com.ruoyi.system.service.ISysDictDataService;
|
||||
|
||||
|
|
@ -81,14 +82,13 @@ public class SysDictDataController extends BaseController
|
|||
@ResponseBody
|
||||
public AjaxResult addSave(@Validated SysDictData dict)
|
||||
{
|
||||
dict.setCreateBy(getLoginName());
|
||||
dict.setCreateBy(ShiroUtils.getLoginName());
|
||||
return toAjax(dictDataService.insertDictData(dict));
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改字典类型
|
||||
*/
|
||||
@RequiresPermissions("system:dict:edit")
|
||||
@GetMapping("/edit/{dictCode}")
|
||||
public String edit(@PathVariable("dictCode") Long dictCode, ModelMap mmap)
|
||||
{
|
||||
|
|
@ -105,7 +105,7 @@ public class SysDictDataController extends BaseController
|
|||
@ResponseBody
|
||||
public AjaxResult editSave(@Validated SysDictData dict)
|
||||
{
|
||||
dict.setUpdateBy(getLoginName());
|
||||
dict.setUpdateBy(ShiroUtils.getLoginName());
|
||||
return toAjax(dictDataService.updateDictData(dict));
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -12,12 +12,14 @@ import org.springframework.web.bind.annotation.PostMapping;
|
|||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.ResponseBody;
|
||||
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.SysDictType;
|
||||
import com.ruoyi.common.core.page.TableDataInfo;
|
||||
import com.ruoyi.common.enums.BusinessType;
|
||||
import com.ruoyi.common.utils.ShiroUtils;
|
||||
import com.ruoyi.common.utils.poi.ExcelUtil;
|
||||
import com.ruoyi.system.service.ISysDictTypeService;
|
||||
|
||||
|
|
@ -82,18 +84,17 @@ public class SysDictTypeController extends BaseController
|
|||
@ResponseBody
|
||||
public AjaxResult addSave(@Validated SysDictType dict)
|
||||
{
|
||||
if (!dictTypeService.checkDictTypeUnique(dict))
|
||||
if (UserConstants.DICT_TYPE_NOT_UNIQUE.equals(dictTypeService.checkDictTypeUnique(dict)))
|
||||
{
|
||||
return error("新增字典'" + dict.getDictName() + "'失败,字典类型已存在");
|
||||
}
|
||||
dict.setCreateBy(getLoginName());
|
||||
dict.setCreateBy(ShiroUtils.getLoginName());
|
||||
return toAjax(dictTypeService.insertDictType(dict));
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改字典类型
|
||||
*/
|
||||
@RequiresPermissions("system:dict:edit")
|
||||
@GetMapping("/edit/{dictId}")
|
||||
public String edit(@PathVariable("dictId") Long dictId, ModelMap mmap)
|
||||
{
|
||||
|
|
@ -110,11 +111,11 @@ public class SysDictTypeController extends BaseController
|
|||
@ResponseBody
|
||||
public AjaxResult editSave(@Validated SysDictType dict)
|
||||
{
|
||||
if (!dictTypeService.checkDictTypeUnique(dict))
|
||||
if (UserConstants.DICT_TYPE_NOT_UNIQUE.equals(dictTypeService.checkDictTypeUnique(dict)))
|
||||
{
|
||||
return error("修改字典'" + dict.getDictName() + "'失败,字典类型已存在");
|
||||
}
|
||||
dict.setUpdateBy(getLoginName());
|
||||
dict.setUpdateBy(ShiroUtils.getLoginName());
|
||||
return toAjax(dictTypeService.updateDictType(dict));
|
||||
}
|
||||
|
||||
|
|
@ -158,7 +159,7 @@ public class SysDictTypeController extends BaseController
|
|||
*/
|
||||
@PostMapping("/checkDictTypeUnique")
|
||||
@ResponseBody
|
||||
public boolean checkDictTypeUnique(SysDictType dictType)
|
||||
public String checkDictTypeUnique(SysDictType dictType)
|
||||
{
|
||||
return dictTypeService.checkDictTypeUnique(dictType);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -21,6 +21,7 @@ import com.ruoyi.common.core.text.Convert;
|
|||
import com.ruoyi.common.utils.CookieUtils;
|
||||
import com.ruoyi.common.utils.DateUtils;
|
||||
import com.ruoyi.common.utils.ServletUtils;
|
||||
import com.ruoyi.common.utils.ShiroUtils;
|
||||
import com.ruoyi.common.utils.StringUtils;
|
||||
import com.ruoyi.framework.shiro.service.SysPasswordService;
|
||||
import com.ruoyi.system.service.ISysConfigService;
|
||||
|
|
@ -48,23 +49,18 @@ public class SysIndexController extends BaseController
|
|||
public String index(ModelMap mmap)
|
||||
{
|
||||
// 取身份信息
|
||||
SysUser user = getSysUser();
|
||||
SysUser user = ShiroUtils.getSysUser();
|
||||
// 根据用户id取出菜单
|
||||
List<SysMenu> menus = menuService.selectMenusByUser(user);
|
||||
mmap.put("menus", menus);
|
||||
mmap.put("user", user);
|
||||
mmap.put("sideTheme", configService.selectConfigByKey("sys.index.sideTheme"));
|
||||
mmap.put("skinName", configService.selectConfigByKey("sys.index.skinName"));
|
||||
Boolean footer = Convert.toBool(configService.selectConfigByKey("sys.index.footer"), true);
|
||||
Boolean tagsView = Convert.toBool(configService.selectConfigByKey("sys.index.tagsView"), true);
|
||||
mmap.put("footer", footer);
|
||||
mmap.put("tagsView", tagsView);
|
||||
mmap.put("mainClass", contentMainClass(footer, tagsView));
|
||||
mmap.put("ignoreFooter", configService.selectConfigByKey("sys.index.ignoreFooter"));
|
||||
mmap.put("copyrightYear", RuoYiConfig.getCopyrightYear());
|
||||
mmap.put("demoEnabled", RuoYiConfig.isDemoEnabled());
|
||||
mmap.put("isDefaultModifyPwd", initPasswordIsModify(user.getPwdUpdateDate()));
|
||||
mmap.put("isPasswordExpired", passwordIsExpiration(user.getPwdUpdateDate()));
|
||||
mmap.put("isMobile", ServletUtils.checkAgentIsMobile(ServletUtils.getRequest().getHeader("User-Agent")));
|
||||
|
||||
// 菜单导航显示风格
|
||||
String menuStyle = configService.selectConfigByKey("sys.index.menuStyle");
|
||||
|
|
@ -89,7 +85,7 @@ public class SysIndexController extends BaseController
|
|||
@GetMapping("/lockscreen")
|
||||
public String lockscreen(ModelMap mmap)
|
||||
{
|
||||
mmap.put("user", getSysUser());
|
||||
mmap.put("user", ShiroUtils.getSysUser());
|
||||
ServletUtils.getSession().setAttribute(ShiroConstants.LOCK_SCREEN, true);
|
||||
return "lock";
|
||||
}
|
||||
|
|
@ -99,10 +95,10 @@ public class SysIndexController extends BaseController
|
|||
@ResponseBody
|
||||
public AjaxResult unlockscreen(String password)
|
||||
{
|
||||
SysUser user = getSysUser();
|
||||
SysUser user = ShiroUtils.getSysUser();
|
||||
if (StringUtils.isNull(user))
|
||||
{
|
||||
return AjaxResult.error("服务器超时,请重新登录");
|
||||
return AjaxResult.error("服务器超时,请重新登陆");
|
||||
}
|
||||
if (passwordService.matches(user, password))
|
||||
{
|
||||
|
|
@ -134,24 +130,6 @@ public class SysIndexController extends BaseController
|
|||
return "main";
|
||||
}
|
||||
|
||||
// content-main class
|
||||
public String contentMainClass(Boolean footer, Boolean tagsView)
|
||||
{
|
||||
if (!footer && !tagsView)
|
||||
{
|
||||
return "tagsview-footer-hide";
|
||||
}
|
||||
else if (!footer)
|
||||
{
|
||||
return "footer-hide";
|
||||
}
|
||||
else if (!tagsView)
|
||||
{
|
||||
return "tagsview-hide";
|
||||
}
|
||||
return StringUtils.EMPTY;
|
||||
}
|
||||
|
||||
// 检查初始密码是否提醒修改
|
||||
public boolean initPasswordIsModify(Date pwdUpdateDate)
|
||||
{
|
||||
|
|
|
|||
|
|
@ -6,19 +6,14 @@ import org.apache.shiro.SecurityUtils;
|
|||
import org.apache.shiro.authc.AuthenticationException;
|
||||
import org.apache.shiro.authc.UsernamePasswordToken;
|
||||
import org.apache.shiro.subject.Subject;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.beans.factory.annotation.Value;
|
||||
import org.springframework.stereotype.Controller;
|
||||
import org.springframework.ui.ModelMap;
|
||||
import org.springframework.web.bind.annotation.GetMapping;
|
||||
import org.springframework.web.bind.annotation.PostMapping;
|
||||
import org.springframework.web.bind.annotation.ResponseBody;
|
||||
import com.ruoyi.common.core.controller.BaseController;
|
||||
import com.ruoyi.common.core.domain.AjaxResult;
|
||||
import com.ruoyi.common.core.text.Convert;
|
||||
import com.ruoyi.common.utils.ServletUtils;
|
||||
import com.ruoyi.common.utils.StringUtils;
|
||||
import com.ruoyi.framework.web.service.ConfigService;
|
||||
|
||||
/**
|
||||
* 登录验证
|
||||
|
|
@ -28,27 +23,15 @@ import com.ruoyi.framework.web.service.ConfigService;
|
|||
@Controller
|
||||
public class SysLoginController extends BaseController
|
||||
{
|
||||
/**
|
||||
* 是否开启记住我功能
|
||||
*/
|
||||
@Value("${shiro.rememberMe.enabled: false}")
|
||||
private boolean rememberMe;
|
||||
|
||||
@Autowired
|
||||
private ConfigService configService;
|
||||
|
||||
@GetMapping("/login")
|
||||
public String login(HttpServletRequest request, HttpServletResponse response, ModelMap mmap)
|
||||
public String login(HttpServletRequest request, HttpServletResponse response)
|
||||
{
|
||||
// 如果是Ajax请求,返回Json字符串。
|
||||
if (ServletUtils.isAjaxRequest(request))
|
||||
{
|
||||
return ServletUtils.renderString(response, "{\"code\":\"1\",\"msg\":\"未登录或登录超时。请重新登录\"}");
|
||||
}
|
||||
// 是否开启记住我
|
||||
mmap.put("isRemembered", rememberMe);
|
||||
// 是否开启用户注册
|
||||
mmap.put("isAllowRegister", Convert.toBool(configService.getKey("sys.account.registerUser"), false));
|
||||
|
||||
return "login";
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -12,6 +12,7 @@ import org.springframework.web.bind.annotation.PostMapping;
|
|||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.ResponseBody;
|
||||
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;
|
||||
|
|
@ -104,11 +105,11 @@ public class SysMenuController extends BaseController
|
|||
@ResponseBody
|
||||
public AjaxResult addSave(@Validated SysMenu menu)
|
||||
{
|
||||
if (!menuService.checkMenuNameUnique(menu))
|
||||
if (UserConstants.MENU_NAME_NOT_UNIQUE.equals(menuService.checkMenuNameUnique(menu)))
|
||||
{
|
||||
return error("新增菜单'" + menu.getMenuName() + "'失败,菜单名称已存在");
|
||||
}
|
||||
menu.setCreateBy(getLoginName());
|
||||
menu.setCreateBy(ShiroUtils.getLoginName());
|
||||
AuthorizationUtils.clearAllCachedAuthorizationInfo();
|
||||
return toAjax(menuService.insertMenu(menu));
|
||||
}
|
||||
|
|
@ -116,7 +117,6 @@ public class SysMenuController extends BaseController
|
|||
/**
|
||||
* 修改菜单
|
||||
*/
|
||||
@RequiresPermissions("system:menu:edit")
|
||||
@GetMapping("/edit/{menuId}")
|
||||
public String edit(@PathVariable("menuId") Long menuId, ModelMap mmap)
|
||||
{
|
||||
|
|
@ -133,11 +133,11 @@ public class SysMenuController extends BaseController
|
|||
@ResponseBody
|
||||
public AjaxResult editSave(@Validated SysMenu menu)
|
||||
{
|
||||
if (!menuService.checkMenuNameUnique(menu))
|
||||
if (UserConstants.MENU_NAME_NOT_UNIQUE.equals(menuService.checkMenuNameUnique(menu)))
|
||||
{
|
||||
return error("修改菜单'" + menu.getMenuName() + "'失败,菜单名称已存在");
|
||||
}
|
||||
menu.setUpdateBy(getLoginName());
|
||||
menu.setUpdateBy(ShiroUtils.getLoginName());
|
||||
AuthorizationUtils.clearAllCachedAuthorizationInfo();
|
||||
return toAjax(menuService.updateMenu(menu));
|
||||
}
|
||||
|
|
@ -156,7 +156,7 @@ public class SysMenuController extends BaseController
|
|||
*/
|
||||
@PostMapping("/checkMenuNameUnique")
|
||||
@ResponseBody
|
||||
public boolean checkMenuNameUnique(SysMenu menu)
|
||||
public String checkMenuNameUnique(SysMenu menu)
|
||||
{
|
||||
return menuService.checkMenuNameUnique(menu);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -5,7 +5,6 @@ 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;
|
||||
|
|
@ -16,6 +15,7 @@ import com.ruoyi.common.core.controller.BaseController;
|
|||
import com.ruoyi.common.core.domain.AjaxResult;
|
||||
import com.ruoyi.common.core.page.TableDataInfo;
|
||||
import com.ruoyi.common.enums.BusinessType;
|
||||
import com.ruoyi.common.utils.ShiroUtils;
|
||||
import com.ruoyi.system.domain.SysNotice;
|
||||
import com.ruoyi.system.service.ISysNoticeService;
|
||||
|
||||
|
|
@ -69,16 +69,15 @@ public class SysNoticeController extends BaseController
|
|||
@Log(title = "通知公告", businessType = BusinessType.INSERT)
|
||||
@PostMapping("/add")
|
||||
@ResponseBody
|
||||
public AjaxResult addSave(@Validated SysNotice notice)
|
||||
public AjaxResult addSave(SysNotice notice)
|
||||
{
|
||||
notice.setCreateBy(getLoginName());
|
||||
notice.setCreateBy(ShiroUtils.getLoginName());
|
||||
return toAjax(noticeService.insertNotice(notice));
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改公告
|
||||
*/
|
||||
@RequiresPermissions("system:notice:edit")
|
||||
@GetMapping("/edit/{noticeId}")
|
||||
public String edit(@PathVariable("noticeId") Long noticeId, ModelMap mmap)
|
||||
{
|
||||
|
|
@ -93,23 +92,12 @@ public class SysNoticeController extends BaseController
|
|||
@Log(title = "通知公告", businessType = BusinessType.UPDATE)
|
||||
@PostMapping("/edit")
|
||||
@ResponseBody
|
||||
public AjaxResult editSave(@Validated SysNotice notice)
|
||||
public AjaxResult editSave(SysNotice notice)
|
||||
{
|
||||
notice.setUpdateBy(getLoginName());
|
||||
notice.setUpdateBy(ShiroUtils.getLoginName());
|
||||
return toAjax(noticeService.updateNotice(notice));
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询公告详细
|
||||
*/
|
||||
@RequiresPermissions("system:notice:list")
|
||||
@GetMapping("/view/{noticeId}")
|
||||
public String view(@PathVariable("noticeId") Long noticeId, ModelMap mmap)
|
||||
{
|
||||
mmap.put("notice", noticeService.selectNoticeById(noticeId));
|
||||
return prefix + "/view";
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除公告
|
||||
*/
|
||||
|
|
|
|||
|
|
@ -12,10 +12,12 @@ import org.springframework.web.bind.annotation.PostMapping;
|
|||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.ResponseBody;
|
||||
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.page.TableDataInfo;
|
||||
import com.ruoyi.common.enums.BusinessType;
|
||||
import com.ruoyi.common.utils.ShiroUtils;
|
||||
import com.ruoyi.common.utils.poi.ExcelUtil;
|
||||
import com.ruoyi.system.domain.SysPost;
|
||||
import com.ruoyi.system.service.ISysPostService;
|
||||
|
|
@ -96,22 +98,21 @@ public class SysPostController extends BaseController
|
|||
@ResponseBody
|
||||
public AjaxResult addSave(@Validated SysPost post)
|
||||
{
|
||||
if (!postService.checkPostNameUnique(post))
|
||||
if (UserConstants.POST_NAME_NOT_UNIQUE.equals(postService.checkPostNameUnique(post)))
|
||||
{
|
||||
return error("新增岗位'" + post.getPostName() + "'失败,岗位名称已存在");
|
||||
}
|
||||
else if (!postService.checkPostCodeUnique(post))
|
||||
else if (UserConstants.POST_CODE_NOT_UNIQUE.equals(postService.checkPostCodeUnique(post)))
|
||||
{
|
||||
return error("新增岗位'" + post.getPostName() + "'失败,岗位编码已存在");
|
||||
}
|
||||
post.setCreateBy(getLoginName());
|
||||
post.setCreateBy(ShiroUtils.getLoginName());
|
||||
return toAjax(postService.insertPost(post));
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改岗位
|
||||
*/
|
||||
@RequiresPermissions("system:post:edit")
|
||||
@GetMapping("/edit/{postId}")
|
||||
public String edit(@PathVariable("postId") Long postId, ModelMap mmap)
|
||||
{
|
||||
|
|
@ -128,15 +129,15 @@ public class SysPostController extends BaseController
|
|||
@ResponseBody
|
||||
public AjaxResult editSave(@Validated SysPost post)
|
||||
{
|
||||
if (!postService.checkPostNameUnique(post))
|
||||
if (UserConstants.POST_NAME_NOT_UNIQUE.equals(postService.checkPostNameUnique(post)))
|
||||
{
|
||||
return error("修改岗位'" + post.getPostName() + "'失败,岗位名称已存在");
|
||||
}
|
||||
else if (!postService.checkPostCodeUnique(post))
|
||||
else if (UserConstants.POST_CODE_NOT_UNIQUE.equals(postService.checkPostCodeUnique(post)))
|
||||
{
|
||||
return error("修改岗位'" + post.getPostName() + "'失败,岗位编码已存在");
|
||||
}
|
||||
post.setUpdateBy(getLoginName());
|
||||
post.setUpdateBy(ShiroUtils.getLoginName());
|
||||
return toAjax(postService.updatePost(post));
|
||||
}
|
||||
|
||||
|
|
@ -145,7 +146,7 @@ public class SysPostController extends BaseController
|
|||
*/
|
||||
@PostMapping("/checkPostNameUnique")
|
||||
@ResponseBody
|
||||
public boolean checkPostNameUnique(SysPost post)
|
||||
public String checkPostNameUnique(SysPost post)
|
||||
{
|
||||
return postService.checkPostNameUnique(post);
|
||||
}
|
||||
|
|
@ -155,7 +156,7 @@ public class SysPostController extends BaseController
|
|||
*/
|
||||
@PostMapping("/checkPostCodeUnique")
|
||||
@ResponseBody
|
||||
public boolean checkPostCodeUnique(SysPost post)
|
||||
public String checkPostCodeUnique(SysPost post)
|
||||
{
|
||||
return postService.checkPostCodeUnique(post);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -13,6 +13,7 @@ import org.springframework.web.bind.annotation.ResponseBody;
|
|||
import org.springframework.web.multipart.MultipartFile;
|
||||
import com.ruoyi.common.annotation.Log;
|
||||
import com.ruoyi.common.config.RuoYiConfig;
|
||||
import com.ruoyi.common.constant.UserConstants;
|
||||
import com.ruoyi.common.core.controller.BaseController;
|
||||
import com.ruoyi.common.core.domain.AjaxResult;
|
||||
import com.ruoyi.common.core.domain.entity.SysUser;
|
||||
|
|
@ -21,7 +22,6 @@ 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;
|
||||
|
||||
|
|
@ -50,7 +50,7 @@ public class SysProfileController extends BaseController
|
|||
@GetMapping()
|
||||
public String profile(ModelMap mmap)
|
||||
{
|
||||
SysUser user = getSysUser();
|
||||
SysUser user = ShiroUtils.getSysUser();
|
||||
mmap.put("user", user);
|
||||
mmap.put("roleGroup", userService.selectUserRoleGroup(user.getUserId()));
|
||||
mmap.put("postGroup", userService.selectUserPostGroup(user.getUserId()));
|
||||
|
|
@ -61,14 +61,18 @@ public class SysProfileController extends BaseController
|
|||
@ResponseBody
|
||||
public boolean checkPassword(String password)
|
||||
{
|
||||
SysUser user = getSysUser();
|
||||
return passwordService.matches(user, password);
|
||||
SysUser user = ShiroUtils.getSysUser();
|
||||
if (passwordService.matches(user, password))
|
||||
{
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
@GetMapping("/resetPwd")
|
||||
public String resetPwd(ModelMap mmap)
|
||||
{
|
||||
SysUser user = getSysUser();
|
||||
SysUser user = ShiroUtils.getSysUser();
|
||||
mmap.put("user", userService.selectUserById(user.getUserId()));
|
||||
return prefix + "/resetPwd";
|
||||
}
|
||||
|
|
@ -78,7 +82,7 @@ public class SysProfileController extends BaseController
|
|||
@ResponseBody
|
||||
public AjaxResult resetPwd(String oldPassword, String newPassword)
|
||||
{
|
||||
SysUser user = getSysUser();
|
||||
SysUser user = ShiroUtils.getSysUser();
|
||||
if (!passwordService.matches(user, oldPassword))
|
||||
{
|
||||
return error("修改密码失败,旧密码错误");
|
||||
|
|
@ -92,7 +96,7 @@ public class SysProfileController extends BaseController
|
|||
user.setPwdUpdateDate(DateUtils.getNowDate());
|
||||
if (userService.resetUserPwd(user) > 0)
|
||||
{
|
||||
setSysUser(userService.selectUserById(user.getUserId()));
|
||||
ShiroUtils.setSysUser(userService.selectUserById(user.getUserId()));
|
||||
return success();
|
||||
}
|
||||
return error("修改密码异常,请联系管理员");
|
||||
|
|
@ -104,7 +108,7 @@ public class SysProfileController extends BaseController
|
|||
@GetMapping("/edit")
|
||||
public String edit(ModelMap mmap)
|
||||
{
|
||||
SysUser user = getSysUser();
|
||||
SysUser user = ShiroUtils.getSysUser();
|
||||
mmap.put("user", userService.selectUserById(user.getUserId()));
|
||||
return prefix + "/edit";
|
||||
}
|
||||
|
|
@ -115,7 +119,7 @@ public class SysProfileController extends BaseController
|
|||
@GetMapping("/avatar")
|
||||
public String avatar(ModelMap mmap)
|
||||
{
|
||||
SysUser user = getSysUser();
|
||||
SysUser user = ShiroUtils.getSysUser();
|
||||
mmap.put("user", userService.selectUserById(user.getUserId()));
|
||||
return prefix + "/avatar";
|
||||
}
|
||||
|
|
@ -128,22 +132,24 @@ public class SysProfileController extends BaseController
|
|||
@ResponseBody
|
||||
public AjaxResult update(SysUser user)
|
||||
{
|
||||
SysUser currentUser = getSysUser();
|
||||
SysUser currentUser = ShiroUtils.getSysUser();
|
||||
currentUser.setUserName(user.getUserName());
|
||||
currentUser.setEmail(user.getEmail());
|
||||
currentUser.setPhonenumber(user.getPhonenumber());
|
||||
currentUser.setSex(user.getSex());
|
||||
if (StringUtils.isNotEmpty(user.getPhonenumber()) && !userService.checkPhoneUnique(currentUser))
|
||||
if (StringUtils.isNotEmpty(user.getPhonenumber())
|
||||
&& UserConstants.USER_PHONE_NOT_UNIQUE.equals(userService.checkPhoneUnique(currentUser)))
|
||||
{
|
||||
return error("修改用户'" + currentUser.getLoginName() + "'失败,手机号码已存在");
|
||||
}
|
||||
else if (StringUtils.isNotEmpty(user.getEmail()) && !userService.checkEmailUnique(currentUser))
|
||||
else if (StringUtils.isNotEmpty(user.getEmail())
|
||||
&& UserConstants.USER_EMAIL_NOT_UNIQUE.equals(userService.checkEmailUnique(currentUser)))
|
||||
{
|
||||
return error("修改用户'" + currentUser.getLoginName() + "'失败,邮箱账号已存在");
|
||||
}
|
||||
if (userService.updateUserInfo(currentUser) > 0)
|
||||
{
|
||||
setSysUser(userService.selectUserById(currentUser.getUserId()));
|
||||
ShiroUtils.setSysUser(userService.selectUserById(currentUser.getUserId()));
|
||||
return success();
|
||||
}
|
||||
return error();
|
||||
|
|
@ -157,16 +163,16 @@ public class SysProfileController extends BaseController
|
|||
@ResponseBody
|
||||
public AjaxResult updateAvatar(@RequestParam("avatarfile") MultipartFile file)
|
||||
{
|
||||
SysUser currentUser = getSysUser();
|
||||
SysUser currentUser = ShiroUtils.getSysUser();
|
||||
try
|
||||
{
|
||||
if (!file.isEmpty())
|
||||
{
|
||||
String avatar = FileUploadUtils.upload(RuoYiConfig.getAvatarPath(), file, MimeTypeUtils.IMAGE_EXTENSION);
|
||||
String avatar = FileUploadUtils.upload(RuoYiConfig.getAvatarPath(), file);
|
||||
currentUser.setAvatar(avatar);
|
||||
if (userService.updateUserInfo(currentUser) > 0)
|
||||
{
|
||||
setSysUser(userService.selectUserById(currentUser.getUserId()));
|
||||
ShiroUtils.setSysUser(userService.selectUserById(currentUser.getUserId()));
|
||||
return success();
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -2,13 +2,13 @@ package com.ruoyi.web.controller.system;
|
|||
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Controller;
|
||||
import org.springframework.util.StringUtils;
|
||||
import org.springframework.web.bind.annotation.GetMapping;
|
||||
import org.springframework.web.bind.annotation.PostMapping;
|
||||
import org.springframework.web.bind.annotation.ResponseBody;
|
||||
import com.ruoyi.common.core.controller.BaseController;
|
||||
import com.ruoyi.common.core.domain.AjaxResult;
|
||||
import com.ruoyi.common.core.domain.entity.SysUser;
|
||||
import com.ruoyi.common.utils.StringUtils;
|
||||
import com.ruoyi.framework.shiro.service.SysRegisterService;
|
||||
import com.ruoyi.system.service.ISysConfigService;
|
||||
|
||||
|
|
|
|||
|
|
@ -12,17 +12,17 @@ import org.springframework.web.bind.annotation.PostMapping;
|
|||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.ResponseBody;
|
||||
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;
|
||||
import com.ruoyi.common.enums.BusinessType;
|
||||
import com.ruoyi.common.utils.ShiroUtils;
|
||||
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;
|
||||
|
||||
|
|
@ -43,9 +43,6 @@ public class SysRoleController extends BaseController
|
|||
@Autowired
|
||||
private ISysUserService userService;
|
||||
|
||||
@Autowired
|
||||
private ISysDeptService deptService;
|
||||
|
||||
@RequiresPermissions("system:role:view")
|
||||
@GetMapping()
|
||||
public String role()
|
||||
|
|
@ -92,15 +89,15 @@ public class SysRoleController extends BaseController
|
|||
@ResponseBody
|
||||
public AjaxResult addSave(@Validated SysRole role)
|
||||
{
|
||||
if (!roleService.checkRoleNameUnique(role))
|
||||
if (UserConstants.ROLE_NAME_NOT_UNIQUE.equals(roleService.checkRoleNameUnique(role)))
|
||||
{
|
||||
return error("新增角色'" + role.getRoleName() + "'失败,角色名称已存在");
|
||||
}
|
||||
else if (!roleService.checkRoleKeyUnique(role))
|
||||
else if (UserConstants.ROLE_KEY_NOT_UNIQUE.equals(roleService.checkRoleKeyUnique(role)))
|
||||
{
|
||||
return error("新增角色'" + role.getRoleName() + "'失败,角色权限已存在");
|
||||
}
|
||||
role.setCreateBy(getLoginName());
|
||||
role.setCreateBy(ShiroUtils.getLoginName());
|
||||
AuthorizationUtils.clearAllCachedAuthorizationInfo();
|
||||
return toAjax(roleService.insertRole(role));
|
||||
|
||||
|
|
@ -109,11 +106,9 @@ public class SysRoleController extends BaseController
|
|||
/**
|
||||
* 修改角色
|
||||
*/
|
||||
@RequiresPermissions("system:role:edit")
|
||||
@GetMapping("/edit/{roleId}")
|
||||
public String edit(@PathVariable("roleId") Long roleId, ModelMap mmap)
|
||||
{
|
||||
roleService.checkRoleDataScope(roleId);
|
||||
mmap.put("role", roleService.selectRoleById(roleId));
|
||||
return prefix + "/edit";
|
||||
}
|
||||
|
|
@ -128,16 +123,15 @@ public class SysRoleController extends BaseController
|
|||
public AjaxResult editSave(@Validated SysRole role)
|
||||
{
|
||||
roleService.checkRoleAllowed(role);
|
||||
roleService.checkRoleDataScope(role.getRoleId());
|
||||
if (!roleService.checkRoleNameUnique(role))
|
||||
if (UserConstants.ROLE_NAME_NOT_UNIQUE.equals(roleService.checkRoleNameUnique(role)))
|
||||
{
|
||||
return error("修改角色'" + role.getRoleName() + "'失败,角色名称已存在");
|
||||
}
|
||||
else if (!roleService.checkRoleKeyUnique(role))
|
||||
else if (UserConstants.ROLE_KEY_NOT_UNIQUE.equals(roleService.checkRoleKeyUnique(role)))
|
||||
{
|
||||
return error("修改角色'" + role.getRoleName() + "'失败,角色权限已存在");
|
||||
}
|
||||
role.setUpdateBy(getLoginName());
|
||||
role.setUpdateBy(ShiroUtils.getLoginName());
|
||||
AuthorizationUtils.clearAllCachedAuthorizationInfo();
|
||||
return toAjax(roleService.updateRole(role));
|
||||
}
|
||||
|
|
@ -162,11 +156,10 @@ public class SysRoleController extends BaseController
|
|||
public AjaxResult authDataScopeSave(SysRole role)
|
||||
{
|
||||
roleService.checkRoleAllowed(role);
|
||||
roleService.checkRoleDataScope(role.getRoleId());
|
||||
role.setUpdateBy(getLoginName());
|
||||
role.setUpdateBy(ShiroUtils.getLoginName());
|
||||
if (roleService.authDataScope(role) > 0)
|
||||
{
|
||||
setSysUser(userService.selectUserById(getUserId()));
|
||||
ShiroUtils.setSysUser(userService.selectUserById(ShiroUtils.getSysUser().getUserId()));
|
||||
return success();
|
||||
}
|
||||
return error();
|
||||
|
|
@ -186,7 +179,7 @@ public class SysRoleController extends BaseController
|
|||
*/
|
||||
@PostMapping("/checkRoleNameUnique")
|
||||
@ResponseBody
|
||||
public boolean checkRoleNameUnique(SysRole role)
|
||||
public String checkRoleNameUnique(SysRole role)
|
||||
{
|
||||
return roleService.checkRoleNameUnique(role);
|
||||
}
|
||||
|
|
@ -196,7 +189,7 @@ public class SysRoleController extends BaseController
|
|||
*/
|
||||
@PostMapping("/checkRoleKeyUnique")
|
||||
@ResponseBody
|
||||
public boolean checkRoleKeyUnique(SysRole role)
|
||||
public String checkRoleKeyUnique(SysRole role)
|
||||
{
|
||||
return roleService.checkRoleKeyUnique(role);
|
||||
}
|
||||
|
|
@ -220,7 +213,6 @@ public class SysRoleController extends BaseController
|
|||
public AjaxResult changeStatus(SysRole role)
|
||||
{
|
||||
roleService.checkRoleAllowed(role);
|
||||
roleService.checkRoleDataScope(role.getRoleId());
|
||||
return toAjax(roleService.changeStatus(role));
|
||||
}
|
||||
|
||||
|
|
@ -251,7 +243,6 @@ public class SysRoleController extends BaseController
|
|||
/**
|
||||
* 取消授权
|
||||
*/
|
||||
@RequiresPermissions("system:role:edit")
|
||||
@Log(title = "角色管理", businessType = BusinessType.GRANT)
|
||||
@PostMapping("/authUser/cancel")
|
||||
@ResponseBody
|
||||
|
|
@ -263,7 +254,6 @@ public class SysRoleController extends BaseController
|
|||
/**
|
||||
* 批量取消授权
|
||||
*/
|
||||
@RequiresPermissions("system:role:edit")
|
||||
@Log(title = "角色管理", businessType = BusinessType.GRANT)
|
||||
@PostMapping("/authUser/cancelAll")
|
||||
@ResponseBody
|
||||
|
|
@ -298,25 +288,11 @@ public class SysRoleController extends BaseController
|
|||
/**
|
||||
* 批量选择用户授权
|
||||
*/
|
||||
@RequiresPermissions("system:role:edit")
|
||||
@Log(title = "角色管理", businessType = BusinessType.GRANT)
|
||||
@PostMapping("/authUser/selectAll")
|
||||
@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;
|
||||
}
|
||||
}
|
||||
|
|
@ -2,7 +2,6 @@ package com.ruoyi.web.controller.system;
|
|||
|
||||
import java.util.List;
|
||||
import java.util.stream.Collectors;
|
||||
import org.apache.commons.lang3.ArrayUtils;
|
||||
import org.apache.shiro.authz.annotation.RequiresPermissions;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Controller;
|
||||
|
|
@ -15,22 +14,17 @@ import org.springframework.web.bind.annotation.RequestMapping;
|
|||
import org.springframework.web.bind.annotation.ResponseBody;
|
||||
import org.springframework.web.multipart.MultipartFile;
|
||||
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;
|
||||
import com.ruoyi.common.core.text.Convert;
|
||||
import com.ruoyi.common.enums.BusinessType;
|
||||
import com.ruoyi.common.utils.DateUtils;
|
||||
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;
|
||||
|
|
@ -52,9 +46,6 @@ public class SysUserController extends BaseController
|
|||
@Autowired
|
||||
private ISysRoleService roleService;
|
||||
|
||||
@Autowired
|
||||
private ISysDeptService deptService;
|
||||
|
||||
@Autowired
|
||||
private ISysPostService postService;
|
||||
|
||||
|
|
@ -97,7 +88,8 @@ public class SysUserController extends BaseController
|
|||
{
|
||||
ExcelUtil<SysUser> util = new ExcelUtil<SysUser>(SysUser.class);
|
||||
List<SysUser> userList = util.importExcel(file.getInputStream());
|
||||
String message = userService.importUser(userList, updateSupport, getLoginName());
|
||||
String operName = ShiroUtils.getSysUser().getLoginName();
|
||||
String message = userService.importUser(userList, updateSupport, operName);
|
||||
return AjaxResult.success(message);
|
||||
}
|
||||
|
||||
|
|
@ -130,35 +122,32 @@ public class SysUserController extends BaseController
|
|||
@ResponseBody
|
||||
public AjaxResult addSave(@Validated SysUser user)
|
||||
{
|
||||
deptService.checkDeptDataScope(user.getDeptId());
|
||||
roleService.checkRoleDataScope(user.getRoleIds());
|
||||
if (!userService.checkLoginNameUnique(user))
|
||||
if (UserConstants.USER_NAME_NOT_UNIQUE.equals(userService.checkLoginNameUnique(user.getLoginName())))
|
||||
{
|
||||
return error("新增用户'" + user.getLoginName() + "'失败,登录账号已存在");
|
||||
}
|
||||
else if (StringUtils.isNotEmpty(user.getPhonenumber()) && !userService.checkPhoneUnique(user))
|
||||
else if (StringUtils.isNotEmpty(user.getPhonenumber())
|
||||
&& UserConstants.USER_PHONE_NOT_UNIQUE.equals(userService.checkPhoneUnique(user)))
|
||||
{
|
||||
return error("新增用户'" + user.getLoginName() + "'失败,手机号码已存在");
|
||||
}
|
||||
else if (StringUtils.isNotEmpty(user.getEmail()) && !userService.checkEmailUnique(user))
|
||||
else if (StringUtils.isNotEmpty(user.getEmail())
|
||||
&& UserConstants.USER_EMAIL_NOT_UNIQUE.equals(userService.checkEmailUnique(user)))
|
||||
{
|
||||
return error("新增用户'" + user.getLoginName() + "'失败,邮箱账号已存在");
|
||||
}
|
||||
user.setSalt(ShiroUtils.randomSalt());
|
||||
user.setPassword(passwordService.encryptPassword(user.getLoginName(), user.getPassword(), user.getSalt()));
|
||||
user.setPwdUpdateDate(DateUtils.getNowDate());
|
||||
user.setCreateBy(getLoginName());
|
||||
user.setCreateBy(ShiroUtils.getLoginName());
|
||||
return toAjax(userService.insertUser(user));
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改用户
|
||||
*/
|
||||
@RequiresPermissions("system:user:edit")
|
||||
@GetMapping("/edit/{userId}")
|
||||
public String edit(@PathVariable("userId") Long userId, ModelMap mmap)
|
||||
{
|
||||
userService.checkUserDataScope(userId);
|
||||
List<SysRole> roles = roleService.selectRolesByUserId(userId);
|
||||
mmap.put("user", userService.selectUserById(userId));
|
||||
mmap.put("roles", SysUser.isAdmin(userId) ? roles : roles.stream().filter(r -> !r.isAdmin()).collect(Collectors.toList()));
|
||||
|
|
@ -166,20 +155,6 @@ public class SysUserController extends BaseController
|
|||
return prefix + "/edit";
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询用户详细
|
||||
*/
|
||||
@RequiresPermissions("system:user:list")
|
||||
@GetMapping("/view/{userId}")
|
||||
public String view(@PathVariable("userId") Long userId, ModelMap mmap)
|
||||
{
|
||||
userService.checkUserDataScope(userId);
|
||||
mmap.put("user", userService.selectUserById(userId));
|
||||
mmap.put("roleGroup", userService.selectUserRoleGroup(userId));
|
||||
mmap.put("postGroup", userService.selectUserPostGroup(userId));
|
||||
return prefix + "/view";
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改保存用户
|
||||
*/
|
||||
|
|
@ -190,23 +165,17 @@ public class SysUserController extends BaseController
|
|||
public AjaxResult editSave(@Validated SysUser user)
|
||||
{
|
||||
userService.checkUserAllowed(user);
|
||||
userService.checkUserDataScope(user.getUserId());
|
||||
deptService.checkDeptDataScope(user.getDeptId());
|
||||
roleService.checkRoleDataScope(user.getRoleIds());
|
||||
if (!userService.checkLoginNameUnique(user))
|
||||
{
|
||||
return error("修改用户'" + user.getLoginName() + "'失败,登录账号已存在");
|
||||
}
|
||||
else if (StringUtils.isNotEmpty(user.getPhonenumber()) && !userService.checkPhoneUnique(user))
|
||||
if (StringUtils.isNotEmpty(user.getPhonenumber())
|
||||
&& UserConstants.USER_PHONE_NOT_UNIQUE.equals(userService.checkPhoneUnique(user)))
|
||||
{
|
||||
return error("修改用户'" + user.getLoginName() + "'失败,手机号码已存在");
|
||||
}
|
||||
else if (StringUtils.isNotEmpty(user.getEmail()) && !userService.checkEmailUnique(user))
|
||||
else if (StringUtils.isNotEmpty(user.getEmail())
|
||||
&& UserConstants.USER_EMAIL_NOT_UNIQUE.equals(userService.checkEmailUnique(user)))
|
||||
{
|
||||
return error("修改用户'" + user.getLoginName() + "'失败,邮箱账号已存在");
|
||||
}
|
||||
user.setUpdateBy(getLoginName());
|
||||
AuthorizationUtils.clearAllCachedAuthorizationInfo();
|
||||
user.setUpdateBy(ShiroUtils.getLoginName());
|
||||
return toAjax(userService.updateUser(user));
|
||||
}
|
||||
|
||||
|
|
@ -225,14 +194,13 @@ 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)
|
||||
{
|
||||
if (ShiroUtils.getUserId().longValue() == user.getUserId().longValue())
|
||||
{
|
||||
setSysUser(userService.selectUserById(user.getUserId()));
|
||||
ShiroUtils.setSysUser(userService.selectUserById(user.getUserId()));
|
||||
}
|
||||
return success();
|
||||
}
|
||||
|
|
@ -256,16 +224,13 @@ public class SysUserController extends BaseController
|
|||
/**
|
||||
* 用户授权角色
|
||||
*/
|
||||
@RequiresPermissions("system:user:edit")
|
||||
@RequiresPermissions("system:user:add")
|
||||
@Log(title = "用户管理", businessType = BusinessType.GRANT)
|
||||
@PostMapping("/authRole/insertAuthRole")
|
||||
@ResponseBody
|
||||
public AjaxResult insertAuthRole(Long userId, Long[] roleIds)
|
||||
{
|
||||
userService.checkUserDataScope(userId);
|
||||
roleService.checkRoleDataScope(roleIds);
|
||||
userService.insertUserAuth(userId, roleIds);
|
||||
AuthorizationUtils.clearAllCachedAuthorizationInfo();
|
||||
return success();
|
||||
}
|
||||
|
||||
|
|
@ -275,10 +240,6 @@ public class SysUserController extends BaseController
|
|||
@ResponseBody
|
||||
public AjaxResult remove(String ids)
|
||||
{
|
||||
if (ArrayUtils.contains(Convert.toLongArray(ids), getUserId()))
|
||||
{
|
||||
return error("当前用户不能删除");
|
||||
}
|
||||
return toAjax(userService.deleteUserByIds(ids));
|
||||
}
|
||||
|
||||
|
|
@ -287,9 +248,9 @@ public class SysUserController extends BaseController
|
|||
*/
|
||||
@PostMapping("/checkLoginNameUnique")
|
||||
@ResponseBody
|
||||
public boolean checkLoginNameUnique(SysUser user)
|
||||
public String checkLoginNameUnique(SysUser user)
|
||||
{
|
||||
return userService.checkLoginNameUnique(user);
|
||||
return userService.checkLoginNameUnique(user.getLoginName());
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
@ -297,7 +258,7 @@ public class SysUserController extends BaseController
|
|||
*/
|
||||
@PostMapping("/checkPhoneUnique")
|
||||
@ResponseBody
|
||||
public boolean checkPhoneUnique(SysUser user)
|
||||
public String checkPhoneUnique(SysUser user)
|
||||
{
|
||||
return userService.checkPhoneUnique(user);
|
||||
}
|
||||
|
|
@ -307,7 +268,7 @@ public class SysUserController extends BaseController
|
|||
*/
|
||||
@PostMapping("/checkEmailUnique")
|
||||
@ResponseBody
|
||||
public boolean checkEmailUnique(SysUser user)
|
||||
public String checkEmailUnique(SysUser user)
|
||||
{
|
||||
return userService.checkEmailUnique(user);
|
||||
}
|
||||
|
|
@ -322,32 +283,6 @@ 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.R;
|
||||
import com.ruoyi.common.core.domain.AjaxResult;
|
||||
import com.ruoyi.common.utils.StringUtils;
|
||||
import io.swagger.annotations.Api;
|
||||
import io.swagger.annotations.ApiImplicitParam;
|
||||
|
|
@ -40,75 +40,73 @@ public class TestController extends BaseController
|
|||
|
||||
@ApiOperation("获取用户列表")
|
||||
@GetMapping("/list")
|
||||
public R<List<UserEntity>> userList()
|
||||
public AjaxResult userList()
|
||||
{
|
||||
List<UserEntity> userList = new ArrayList<UserEntity>(users.values());
|
||||
return R.ok(userList);
|
||||
return AjaxResult.success(userList);
|
||||
}
|
||||
|
||||
@ApiOperation("获取用户详细")
|
||||
@ApiImplicitParam(name = "userId", value = "用户ID", required = true, dataType = "int", paramType = "path", dataTypeClass = Integer.class)
|
||||
@ApiImplicitParam(name = "userId", value = "用户ID", required = true, dataType = "int", paramType = "path")
|
||||
@GetMapping("/{userId}")
|
||||
public R<UserEntity> getUser(@PathVariable Integer userId)
|
||||
public AjaxResult getUser(@PathVariable Integer userId)
|
||||
{
|
||||
if (!users.isEmpty() && users.containsKey(userId))
|
||||
{
|
||||
return R.ok(users.get(userId));
|
||||
return AjaxResult.success(users.get(userId));
|
||||
}
|
||||
else
|
||||
{
|
||||
return R.fail("用户不存在");
|
||||
return error("用户不存在");
|
||||
}
|
||||
}
|
||||
|
||||
@ApiOperation("新增用户")
|
||||
@ApiImplicitParams({
|
||||
@ApiImplicitParam(name = "userId", value = "用户id", dataType = "Integer", dataTypeClass = Integer.class),
|
||||
@ApiImplicitParam(name = "username", value = "用户名称", dataType = "String", dataTypeClass = String.class),
|
||||
@ApiImplicitParam(name = "password", value = "用户密码", dataType = "String", dataTypeClass = String.class),
|
||||
@ApiImplicitParam(name = "mobile", value = "用户手机", dataType = "String", dataTypeClass = String.class)
|
||||
@ApiImplicitParam(name = "userId", value = "用户id", dataType = "Integer"),
|
||||
@ApiImplicitParam(name = "username", value = "用户名称", dataType = "String"),
|
||||
@ApiImplicitParam(name = "password", value = "用户密码", dataType = "String"),
|
||||
@ApiImplicitParam(name = "mobile", value = "用户手机", dataType = "String")
|
||||
})
|
||||
@PostMapping("/save")
|
||||
public R<String> save(UserEntity user)
|
||||
public AjaxResult save(UserEntity user)
|
||||
{
|
||||
if (StringUtils.isNull(user) || StringUtils.isNull(user.getUserId()))
|
||||
{
|
||||
return R.fail("用户ID不能为空");
|
||||
return error("用户ID不能为空");
|
||||
}
|
||||
users.put(user.getUserId(), user);
|
||||
return R.ok();
|
||||
return AjaxResult.success(users.put(user.getUserId(), user));
|
||||
}
|
||||
|
||||
@ApiOperation("更新用户")
|
||||
@PutMapping("/update")
|
||||
public R<String> update(@RequestBody UserEntity user)
|
||||
public AjaxResult update(@RequestBody UserEntity user)
|
||||
{
|
||||
if (StringUtils.isNull(user) || StringUtils.isNull(user.getUserId()))
|
||||
{
|
||||
return R.fail("用户ID不能为空");
|
||||
return error("用户ID不能为空");
|
||||
}
|
||||
if (users.isEmpty() || !users.containsKey(user.getUserId()))
|
||||
{
|
||||
return R.fail("用户不存在");
|
||||
return error("用户不存在");
|
||||
}
|
||||
users.remove(user.getUserId());
|
||||
users.put(user.getUserId(), user);
|
||||
return R.ok();
|
||||
return AjaxResult.success(users.put(user.getUserId(), user));
|
||||
}
|
||||
|
||||
@ApiOperation("删除用户信息")
|
||||
@ApiImplicitParam(name = "userId", value = "用户ID", required = true, dataType = "int", paramType = "path", dataTypeClass = Integer.class)
|
||||
@ApiImplicitParam(name = "userId", value = "用户ID", required = true, dataType = "int", paramType = "path")
|
||||
@DeleteMapping("/{userId}")
|
||||
public R<String> delete(@PathVariable Integer userId)
|
||||
public AjaxResult delete(@PathVariable Integer userId)
|
||||
{
|
||||
if (!users.isEmpty() && users.containsKey(userId))
|
||||
{
|
||||
users.remove(userId);
|
||||
return R.ok();
|
||||
return success();
|
||||
}
|
||||
else
|
||||
{
|
||||
return R.fail("用户不存在");
|
||||
return error("用户不存在");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -24,10 +24,6 @@ spring:
|
|||
maxActive: 20
|
||||
# 配置获取连接等待超时的时间
|
||||
maxWait: 60000
|
||||
# 配置连接超时时间
|
||||
connectTimeout: 30000
|
||||
# 配置网络超时时间
|
||||
socketTimeout: 60000
|
||||
# 配置间隔多久才进行一次检测,检测需要关闭的空闲连接,单位是毫秒
|
||||
timeBetweenEvictionRunsMillis: 60000
|
||||
# 配置一个连接在池中最小生存的时间,单位是毫秒
|
||||
|
|
|
|||
|
|
@ -3,9 +3,9 @@ ruoyi:
|
|||
# 名称
|
||||
name: RuoYi
|
||||
# 版本
|
||||
version: 4.7.9
|
||||
version: 4.6.2
|
||||
# 版权年份
|
||||
copyrightYear: 2024
|
||||
copyrightYear: 2021
|
||||
# 实例演示开关
|
||||
demoEnabled: true
|
||||
# 文件路径 示例( Windows配置D:/ruoyi/uploadPath,Linux配置 /home/ruoyi/uploadPath)
|
||||
|
|
@ -23,13 +23,10 @@ server:
|
|||
tomcat:
|
||||
# tomcat的URI编码
|
||||
uri-encoding: UTF-8
|
||||
# 连接数满后的排队数,默认为100
|
||||
accept-count: 1000
|
||||
threads:
|
||||
# tomcat最大线程数,默认为200
|
||||
max: 800
|
||||
# Tomcat启动初始化的线程数,默认值10
|
||||
min-spare: 100
|
||||
max-threads: 800
|
||||
# Tomcat启动初始化的线程数,默认值25
|
||||
min-spare-threads: 30
|
||||
|
||||
# 日志配置
|
||||
logging:
|
||||
|
|
@ -85,6 +82,7 @@ mybatis:
|
|||
# PageHelper分页插件
|
||||
pagehelper:
|
||||
helperDialect: mysql
|
||||
reasonable: true
|
||||
supportMethodsArguments: true
|
||||
params: count=countSql
|
||||
|
||||
|
|
@ -99,7 +97,7 @@ shiro:
|
|||
indexUrl: /index
|
||||
# 验证码开关
|
||||
captchaEnabled: true
|
||||
# 验证码类型 math 数字计算 char 字符验证
|
||||
# 验证码类型 math 数组计算 char 字符
|
||||
captchaType: math
|
||||
cookie:
|
||||
# 设置Cookie的域名 默认空,即当前访问的域名
|
||||
|
|
@ -123,9 +121,6 @@ shiro:
|
|||
maxSession: -1
|
||||
# 踢出之前登录的/之后登录的用户,默认踢出之前登录的用户
|
||||
kickoutAfter: false
|
||||
rememberMe:
|
||||
# 是否开启记住我
|
||||
enabled: true
|
||||
|
||||
# 防止XSS攻击
|
||||
xss:
|
||||
|
|
|
|||
|
|
@ -3,18 +3,13 @@
|
|||
PUBLIC "-//mybatis.org//DTD Config 3.0//EN"
|
||||
"http://mybatis.org/dtd/mybatis-3-config.dtd">
|
||||
<configuration>
|
||||
<!-- 全局参数 -->
|
||||
|
||||
<settings>
|
||||
<!-- 使全局的映射器启用或禁用缓存 -->
|
||||
<setting name="cacheEnabled" value="true" />
|
||||
<!-- 允许JDBC 支持自动生成主键 -->
|
||||
<setting name="useGeneratedKeys" value="true" />
|
||||
<!-- 配置默认的执行器.SIMPLE就是普通执行器;REUSE执行器会重用预处理语句(prepared statements);BATCH执行器将重用语句并执行批量更新 -->
|
||||
<setting name="defaultExecutorType" value="SIMPLE" />
|
||||
<!-- 指定 MyBatis 所用日志的具体实现 -->
|
||||
<setting name="logImpl" value="SLF4J" />
|
||||
<!-- 使用驼峰命名法转换字段 -->
|
||||
<!-- <setting name="mapUnderscoreToCamelCase" value="true"/> -->
|
||||
<setting name="cacheEnabled" value="true" /> <!-- 全局映射器启用缓存 -->
|
||||
<setting name="useGeneratedKeys" value="true" /> <!-- 允许 JDBC 支持自动生成主键 -->
|
||||
<setting name="defaultExecutorType" value="REUSE" /> <!-- 配置默认的执行器 -->
|
||||
<setting name="logImpl" value="SLF4J" /> <!-- 指定 MyBatis 所用日志的具体实现 -->
|
||||
<!-- <setting name="mapUnderscoreToCamelCase" value="true"/> 驼峰式命名 -->
|
||||
</settings>
|
||||
|
||||
</configuration>
|
||||
|
|
|
|||
|
|
@ -1,18 +1,16 @@
|
|||
/*!
|
||||
* bootstrap-fileinput v5.5.2
|
||||
* bootstrap-fileinput v5.1.3
|
||||
* http://plugins.krajee.com/file-input
|
||||
*
|
||||
* Krajee default styling for bootstrap-fileinput.
|
||||
*
|
||||
* Author: Kartik Visweswaran
|
||||
* Copyright: 2014 - 2022, Kartik Visweswaran, Krajee.com
|
||||
* Copyright: 2014 - 2020, Kartik Visweswaran, Krajee.com
|
||||
*
|
||||
* Licensed under the BSD-3-Clause
|
||||
* https://github.com/kartik-v/bootstrap-fileinput/blob/master/LICENSE.md
|
||||
*/
|
||||
|
||||
.file-loading input[type=file],
|
||||
input[type=file].file-loading {
|
||||
.file-loading input[type=file], input[type=file].file-loading {
|
||||
width: 0;
|
||||
height: 0;
|
||||
}
|
||||
|
|
@ -31,35 +29,11 @@ input[type=file].file-loading {
|
|||
box-shadow: none;
|
||||
}
|
||||
|
||||
.kv-hidden,
|
||||
.file-caption-icon,
|
||||
.file-zoom-dialog .modal-header:before,
|
||||
.file-zoom-dialog .modal-header:after,
|
||||
.file-input-new .file-preview,
|
||||
.file-input-new .close,
|
||||
.file-input-new .glyphicon-file,
|
||||
.file-input-new .fileinput-remove-button,
|
||||
.file-input-new .fileinput-upload-button,
|
||||
.file-input-new .no-browse .input-group-btn,
|
||||
.file-input-ajax-new .fileinput-remove-button,
|
||||
.file-input-ajax-new .fileinput-upload-button,
|
||||
.file-input-ajax-new .no-browse .input-group-btn,
|
||||
.hide-content .kv-file-content,
|
||||
.is-locked .fileinput-upload-button,
|
||||
.is-locked .fileinput-remove-button {
|
||||
.kv-hidden, .file-caption-icon, .file-zoom-dialog .modal-header:before, .file-zoom-dialog .modal-header:after, .file-input-new .file-preview, .file-input-new .close, .file-input-new .glyphicon-file, .file-input-new .fileinput-remove-button, .file-input-new .fileinput-upload-button, .file-input-new .no-browse .input-group-btn, .file-input-ajax-new .fileinput-remove-button, .file-input-ajax-new .fileinput-upload-button, .file-input-ajax-new .no-browse .input-group-btn, .hide-content .kv-file-content, .is-locked .fileinput-upload-button, .is-locked .fileinput-remove-button {
|
||||
display: none;
|
||||
}
|
||||
|
||||
.file-caption .input-group {
|
||||
align-items: center;
|
||||
}
|
||||
|
||||
.btn-file input[type=file],
|
||||
.file-caption-icon,
|
||||
.file-preview .fileinput-remove,
|
||||
.krajee-default .file-thumb-progress,
|
||||
.file-zoom-dialog .btn-navigate,
|
||||
.file-zoom-dialog .floating-buttons {
|
||||
.btn-file input[type=file], .file-caption-icon, .file-preview .fileinput-remove, .krajee-default .file-thumb-progress, .file-zoom-dialog .btn-navigate, .file-zoom-dialog .floating-buttons {
|
||||
position: absolute;
|
||||
}
|
||||
|
||||
|
|
@ -67,50 +41,35 @@ input[type=file].file-loading {
|
|||
line-height: inherit;
|
||||
}
|
||||
|
||||
.file-input,
|
||||
.file-loading:before,
|
||||
.btn-file,
|
||||
.file-caption,
|
||||
.file-preview,
|
||||
.krajee-default.file-preview-frame,
|
||||
.krajee-default .file-thumbnail-footer,
|
||||
.file-zoom-dialog .modal-dialog {
|
||||
.file-input, .file-loading:before, .btn-file, .file-caption, .file-preview, .krajee-default.file-preview-frame, .krajee-default .file-thumbnail-footer, .file-zoom-dialog .modal-dialog {
|
||||
position: relative;
|
||||
}
|
||||
|
||||
.file-error-message pre,
|
||||
.file-error-message ul,
|
||||
.krajee-default .file-actions,
|
||||
.krajee-default .file-other-error {
|
||||
.file-error-message pre, .file-error-message ul, .krajee-default .file-actions, .krajee-default .file-other-error {
|
||||
text-align: left;
|
||||
}
|
||||
|
||||
.file-error-message pre,
|
||||
.file-error-message ul {
|
||||
.file-error-message pre, .file-error-message ul {
|
||||
margin: 0;
|
||||
}
|
||||
|
||||
.krajee-default .file-drag-handle,
|
||||
.krajee-default .file-upload-indicator {
|
||||
.krajee-default .file-drag-handle, .krajee-default .file-upload-indicator {
|
||||
float: left;
|
||||
margin-top: 10px;
|
||||
width: 16px;
|
||||
height: 16px;
|
||||
}
|
||||
|
||||
.file-thumb-progress .progress,
|
||||
.file-thumb-progress .progress-bar {
|
||||
.file-thumb-progress .progress, .file-thumb-progress .progress-bar {
|
||||
font-family: Verdana, Helvetica, sans-serif;
|
||||
font-size: 0.7rem;
|
||||
}
|
||||
|
||||
.krajee-default .file-thumb-progress .progress,
|
||||
.kv-upload-progress .progress {
|
||||
.krajee-default .file-thumb-progress .progress, .kv-upload-progress .progress {
|
||||
background-color: #ccc;
|
||||
}
|
||||
|
||||
.krajee-default .file-caption-info,
|
||||
.krajee-default .file-size-info {
|
||||
.krajee-default .file-caption-info, .krajee-default .file-size-info {
|
||||
display: block;
|
||||
white-space: nowrap;
|
||||
overflow: hidden;
|
||||
|
|
@ -120,23 +79,17 @@ input[type=file].file-loading {
|
|||
margin: auto;
|
||||
}
|
||||
|
||||
.file-zoom-content > .file-object.type-video,
|
||||
.file-zoom-content > .file-object.type-flash,
|
||||
.file-zoom-content > .file-object.type-image {
|
||||
.file-zoom-content > .file-object.type-video, .file-zoom-content > .file-object.type-flash, .file-zoom-content > .file-object.type-image {
|
||||
max-width: 100%;
|
||||
max-height: 100%;
|
||||
width: auto;
|
||||
}
|
||||
|
||||
.file-zoom-content > .file-object.type-video,
|
||||
.file-zoom-content > .file-object.type-flash {
|
||||
.file-zoom-content > .file-object.type-video, .file-zoom-content > .file-object.type-flash {
|
||||
height: 100%;
|
||||
}
|
||||
|
||||
.file-zoom-content > .file-object.type-pdf,
|
||||
.file-zoom-content > .file-object.type-html,
|
||||
.file-zoom-content > .file-object.type-text,
|
||||
.file-zoom-content > .file-object.type-default {
|
||||
.file-zoom-content > .file-object.type-pdf, .file-zoom-content > .file-object.type-html, .file-zoom-content > .file-object.type-text, .file-zoom-content > .file-object.type-default {
|
||||
width: 100%;
|
||||
}
|
||||
|
||||
|
|
@ -178,44 +131,26 @@ input[type=file].file-loading {
|
|||
height: 100%;
|
||||
}
|
||||
|
||||
.file-caption .file-caption-name {
|
||||
width: 100%;
|
||||
margin: 0;
|
||||
padding: 0;
|
||||
box-shadow: none;
|
||||
border: none;
|
||||
background: none;
|
||||
outline: none;
|
||||
}
|
||||
|
||||
.file-caption.icon-visible .file-caption-icon {
|
||||
display: inline-block;
|
||||
}
|
||||
|
||||
.file-caption.icon-visible .file-caption-name {
|
||||
padding-left: 25px;
|
||||
}
|
||||
|
||||
.file-caption.icon-visible > .input-group-lg .file-caption-name {
|
||||
padding-left: 30px;
|
||||
}
|
||||
|
||||
.file-caption.icon-visible > .input-group-sm .file-caption-name {
|
||||
padding-left: 22px;
|
||||
}
|
||||
|
||||
.file-caption-name:not(.file-caption-disabled) {
|
||||
background-color: transparent;
|
||||
}
|
||||
|
||||
.file-caption-name.file-processing {
|
||||
font-style: italic;
|
||||
border-color: #bbb;
|
||||
opacity: 0.5;
|
||||
padding-left: 15px;
|
||||
}
|
||||
|
||||
.file-caption-icon {
|
||||
padding: 7px 5px;
|
||||
left: 4px;
|
||||
}
|
||||
|
||||
.input-group-lg .file-caption-icon {
|
||||
font-size: 1.25rem;
|
||||
}
|
||||
|
||||
.input-group-sm .file-caption-icon {
|
||||
font-size: 0.875rem;
|
||||
padding: 0.25rem;
|
||||
left: 8px;
|
||||
}
|
||||
|
||||
.file-error-message {
|
||||
|
|
@ -265,10 +200,10 @@ input[type=file].file-loading {
|
|||
.file-preview-image {
|
||||
font: 40px Impact, Charcoal, sans-serif;
|
||||
color: #008000;
|
||||
width: auto;
|
||||
height: auto;
|
||||
max-width: 100%;
|
||||
max-height: 100%;
|
||||
width:auto;
|
||||
height:auto;
|
||||
max-width:100%;
|
||||
max-height:100%;
|
||||
}
|
||||
|
||||
.krajee-default.file-preview-frame {
|
||||
|
|
@ -278,7 +213,6 @@ input[type=file].file-loading {
|
|||
padding: 6px;
|
||||
float: left;
|
||||
text-align: center;
|
||||
|
||||
}
|
||||
|
||||
.krajee-default.file-preview-frame .kv-file-content {
|
||||
|
|
@ -286,6 +220,12 @@ 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;
|
||||
}
|
||||
|
|
@ -329,7 +269,7 @@ input[type=file].file-loading {
|
|||
text-align: center;
|
||||
padding-top: 4px;
|
||||
font-size: 11px;
|
||||
color: #999;
|
||||
color: #777;
|
||||
margin-bottom: 30px;
|
||||
}
|
||||
|
||||
|
|
@ -379,9 +319,7 @@ input[type=file].file-loading {
|
|||
font-family: Verdana, Helvetica, sans-serif;
|
||||
}
|
||||
|
||||
|
||||
/*noinspection CssOverwrittenProperties*/
|
||||
|
||||
.file-zoom-dialog .file-other-icon {
|
||||
font-size: 22em;
|
||||
font-size: 50vmin;
|
||||
|
|
@ -398,18 +336,21 @@ input[type=file].file-loading {
|
|||
}
|
||||
|
||||
.file-zoom-dialog .btn-navigate {
|
||||
margin: 0 0.1rem;
|
||||
padding: 0;
|
||||
font-size: 1.2rem;
|
||||
width: 2.4rem;
|
||||
height: 2.4rem;
|
||||
margin: -60px 0 0;
|
||||
font-size: 60px;
|
||||
background: transparent;
|
||||
text-decoration: none;
|
||||
outline: none;
|
||||
opacity: 0.7;
|
||||
top: 50%;
|
||||
border-radius: 50%;
|
||||
text-align: center;
|
||||
color: #1c94c4;
|
||||
}
|
||||
|
||||
.btn-navigate * {
|
||||
width: auto;
|
||||
.file-zoom-dialog .btn-navigate:not([disabled]):hover {
|
||||
outline: none;
|
||||
box-shadow: none;
|
||||
opacity: 0.6;
|
||||
}
|
||||
|
||||
.file-zoom-dialog .floating-buttons {
|
||||
|
|
@ -417,50 +358,25 @@ input[type=file].file-loading {
|
|||
right: 10px;
|
||||
}
|
||||
|
||||
.file-zoom-dialog .btn-kv-prev {
|
||||
left: 0;
|
||||
.file-zoom-dialog .btn-navigate[disabled] {
|
||||
opacity: 0.3;
|
||||
}
|
||||
|
||||
.file-zoom-dialog .btn-kv-next {
|
||||
right: 0;
|
||||
.file-zoom-dialog .btn-prev {
|
||||
left: 1px;
|
||||
}
|
||||
|
||||
.file-zoom-dialog .kv-zoom-header {
|
||||
padding: 0.5rem;
|
||||
.file-zoom-dialog .btn-next {
|
||||
right: 1px;
|
||||
}
|
||||
|
||||
.file-zoom-dialog .kv-zoom-body {
|
||||
padding: 0.25rem;
|
||||
}
|
||||
|
||||
.file-zoom-dialog .kv-zoom-description {
|
||||
position: absolute;
|
||||
opacity: 0.8;
|
||||
font-size: 0.8rem;
|
||||
background-color: #1a1a1a;
|
||||
padding: 1rem;
|
||||
text-align: center;
|
||||
border-radius: 0.5rem;
|
||||
color: #fff;
|
||||
left: 15%;
|
||||
right: 15%;
|
||||
bottom: 15%;
|
||||
}
|
||||
|
||||
.file-zoom-dialog .kv-desc-hide {
|
||||
float: right;
|
||||
color: #fff;
|
||||
padding: 0 0.1rem;
|
||||
background: none;
|
||||
border: none;
|
||||
}
|
||||
|
||||
.file-zoom-dialog .kv-desc-hide:hover {
|
||||
opacity: 0.7;
|
||||
}
|
||||
|
||||
.file-zoom-dialog .kv-desc-hide:focus {
|
||||
opacity: 0.9;
|
||||
.file-zoom-dialog .kv-zoom-title {
|
||||
font-weight: 300;
|
||||
color: #999;
|
||||
max-width: 50%;
|
||||
overflow: hidden;
|
||||
white-space: nowrap;
|
||||
text-overflow: ellipsis;
|
||||
}
|
||||
|
||||
.file-input-new .no-browse .form-control {
|
||||
|
|
@ -473,9 +389,8 @@ input[type=file].file-loading {
|
|||
border-bottom-right-radius: 4px;
|
||||
}
|
||||
|
||||
.file-caption {
|
||||
.file-caption-main {
|
||||
width: 100%;
|
||||
position: relative;
|
||||
}
|
||||
|
||||
.file-thumb-loading {
|
||||
|
|
@ -507,7 +422,7 @@ input[type=file].file-loading {
|
|||
.file-drop-zone-title {
|
||||
color: #aaa;
|
||||
font-size: 1.6em;
|
||||
text-align: center;
|
||||
text-align:center;
|
||||
padding: 85px 10px;
|
||||
cursor: default;
|
||||
}
|
||||
|
|
@ -533,7 +448,7 @@ input[type=file].file-loading {
|
|||
min-height: 100vh;
|
||||
}
|
||||
|
||||
.file-zoom-fullscreen .kv-zoom-body {
|
||||
.file-zoom-fullscreen .modal-body {
|
||||
overflow-y: auto;
|
||||
}
|
||||
|
||||
|
|
@ -546,24 +461,15 @@ input[type=file].file-loading {
|
|||
z-index: 3000;
|
||||
}
|
||||
|
||||
.kv-zoom-actions {
|
||||
min-width: 140px;
|
||||
}
|
||||
|
||||
.kv-zoom-actions .btn-kv {
|
||||
margin-left: 3px;
|
||||
}
|
||||
|
||||
.file-zoom-content {
|
||||
text-align: center;
|
||||
white-space: nowrap;
|
||||
min-height: 300px;
|
||||
}
|
||||
|
||||
.file-zoom-content:hover {
|
||||
background: transparent;
|
||||
}
|
||||
|
||||
.file-zoom-content .file-preview-image {
|
||||
max-height: 100%;
|
||||
}
|
||||
|
|
@ -638,8 +544,7 @@ input[type=file].file-loading {
|
|||
opacity: 1;
|
||||
}
|
||||
|
||||
.file-grabbing,
|
||||
.file-grabbing * {
|
||||
.file-grabbing, .file-grabbing * {
|
||||
cursor: not-allowed !important;
|
||||
}
|
||||
|
||||
|
|
@ -656,33 +561,3 @@ 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
|
|
@ -1,34 +1,10 @@
|
|||
/*!
|
||||
* Bootstrap-select v1.13.18 (https://developer.snapappointments.com/bootstrap-select)
|
||||
* Bootstrap-select v1.13.10 (https://developer.snapappointments.com/bootstrap-select)
|
||||
*
|
||||
* Copyright 2012-2020 SnapAppointments, LLC
|
||||
* Copyright 2012-2019 SnapAppointments, LLC
|
||||
* Licensed under MIT (https://github.com/snapappointments/bootstrap-select/blob/master/LICENSE)
|
||||
*/
|
||||
|
||||
@-webkit-keyframes bs-notify-fadeOut {
|
||||
0% {
|
||||
opacity: 0.9;
|
||||
}
|
||||
100% {
|
||||
opacity: 0;
|
||||
}
|
||||
}
|
||||
@-o-keyframes bs-notify-fadeOut {
|
||||
0% {
|
||||
opacity: 0.9;
|
||||
}
|
||||
100% {
|
||||
opacity: 0;
|
||||
}
|
||||
}
|
||||
@keyframes bs-notify-fadeOut {
|
||||
0% {
|
||||
opacity: 0.9;
|
||||
}
|
||||
100% {
|
||||
opacity: 0;
|
||||
}
|
||||
}
|
||||
select.bs-select-hidden,
|
||||
.bootstrap-select > select.bs-select-hidden,
|
||||
select.selectpicker {
|
||||
|
|
@ -114,11 +90,11 @@ select.selectpicker {
|
|||
.has-error .bootstrap-select .dropdown-toggle,
|
||||
.error .bootstrap-select .dropdown-toggle,
|
||||
.bootstrap-select.is-invalid .dropdown-toggle,
|
||||
.was-validated .bootstrap-select select:invalid + .dropdown-toggle {
|
||||
.was-validated .bootstrap-select .selectpicker:invalid + .dropdown-toggle {
|
||||
border-color: #b94a48;
|
||||
}
|
||||
.bootstrap-select.is-valid .dropdown-toggle,
|
||||
.was-validated .bootstrap-select select:valid + .dropdown-toggle {
|
||||
.was-validated .bootstrap-select .selectpicker:valid + .dropdown-toggle {
|
||||
border-color: #28a745;
|
||||
}
|
||||
.bootstrap-select.fit-width {
|
||||
|
|
@ -324,11 +300,6 @@ select.selectpicker {
|
|||
-moz-box-sizing: border-box;
|
||||
box-sizing: border-box;
|
||||
}
|
||||
.bootstrap-select .dropdown-menu .notify.fadeOut {
|
||||
-webkit-animation: 300ms linear 750ms forwards bs-notify-fadeOut;
|
||||
-o-animation: 300ms linear 750ms forwards bs-notify-fadeOut;
|
||||
animation: 300ms linear 750ms forwards bs-notify-fadeOut;
|
||||
}
|
||||
.bootstrap-select .no-results {
|
||||
padding: 3px;
|
||||
background: #f5f5f5;
|
||||
|
|
@ -368,8 +339,6 @@ select.selectpicker {
|
|||
height: 1em;
|
||||
border-style: solid;
|
||||
border-width: 0 0.26em 0.26em 0;
|
||||
-webkit-transform-style: preserve-3d;
|
||||
transform-style: preserve-3d;
|
||||
-webkit-transform: rotate(45deg);
|
||||
-ms-transform: rotate(45deg);
|
||||
-o-transform: rotate(45deg);
|
||||
|
|
@ -457,3 +426,4 @@ select.selectpicker {
|
|||
width: 100%;
|
||||
float: none;
|
||||
}
|
||||
/*# sourceMappingURL=bootstrap-select.css.map */
|
||||
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,11 +4,10 @@
|
|||
* @update: zhixin wen <wenzhixin2010@gmail.com>
|
||||
*/
|
||||
|
||||
var Utils = $.fn.bootstrapTable.utils
|
||||
const Utils = $.fn.bootstrapTable.utils
|
||||
|
||||
$.extend($.fn.bootstrapTable.defaults, {
|
||||
autoRefresh: false,
|
||||
showAutoRefresh: true,
|
||||
autoRefreshInterval: 60,
|
||||
autoRefreshSilent: true,
|
||||
autoRefreshStatus: true,
|
||||
|
|
@ -18,7 +17,6 @@ $.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'
|
||||
|
|
@ -49,8 +47,8 @@ $.BootstrapTable = class extends $.BootstrapTable {
|
|||
<button class="auto-refresh ${this.constants.buttonsClass}
|
||||
${this.options.autoRefreshStatus ? ` ${this.constants.classes.buttonActive}` : ''}"
|
||||
type="button" name="autoRefresh" title="${this.options.formatAutoRefresh()}">
|
||||
${this.options.showButtonIcons ? Utils.sprintf(this.constants.html.icon, this.options.iconsPrefix, this.options.icons.autoRefresh) : ''}
|
||||
${this.options.showButtonText ? this.options.formatAutoRefresh() : ''}
|
||||
${ this.options.showButtonIcons ? Utils.sprintf(this.constants.html.icon, this.options.iconsPrefix, this.options.icons.autoRefresh) : ''}
|
||||
${ this.options.showButtonText ? this.options.formatAutoRefresh() : ''}
|
||||
</button>
|
||||
`,
|
||||
event: this.toggleAutoRefresh
|
||||
|
|
|
|||
File diff suppressed because one or more lines are too long
|
|
@ -1,606 +0,0 @@
|
|||
/**
|
||||
* @author: Dennis Hernández
|
||||
* @update zhixin wen <wenzhixin2010@gmail.com>
|
||||
*/
|
||||
var Utils = $.fn.bootstrapTable.utils
|
||||
var UtilsCookie = {
|
||||
cookieIds: {
|
||||
sortOrder: 'bs.table.sortOrder',
|
||||
sortName: 'bs.table.sortName',
|
||||
sortPriority: 'bs.table.sortPriority',
|
||||
pageNumber: 'bs.table.pageNumber',
|
||||
pageList: 'bs.table.pageList',
|
||||
hiddenColumns: 'bs.table.hiddenColumns',
|
||||
cardView: 'bs.table.cardView',
|
||||
customView: 'bs.table.customView',
|
||||
searchText: 'bs.table.searchText',
|
||||
reorderColumns: 'bs.table.reorderColumns',
|
||||
filterControl: 'bs.table.filterControl',
|
||||
filterBy: 'bs.table.filterBy'
|
||||
},
|
||||
getCurrentHeader (that) {
|
||||
return that.options.height ? that.$tableHeader : that.$header
|
||||
},
|
||||
getCurrentSearchControls (that) {
|
||||
return that.options.height ? 'table select, table input' : 'select, input'
|
||||
},
|
||||
isCookieSupportedByBrowser () {
|
||||
return navigator.cookieEnabled
|
||||
},
|
||||
isCookieEnabled (that, cookieName) {
|
||||
return that.options.cookiesEnabled.includes(cookieName)
|
||||
},
|
||||
setCookie (that, cookieName, cookieValue) {
|
||||
if (
|
||||
!that.options.cookie ||
|
||||
!UtilsCookie.isCookieEnabled(that, cookieName)
|
||||
) {
|
||||
return
|
||||
}
|
||||
|
||||
return that._storage.setItem(`${that.options.cookieIdTable}.${cookieName}`, cookieValue)
|
||||
},
|
||||
getCookie (that, cookieName) {
|
||||
if (
|
||||
!cookieName ||
|
||||
!UtilsCookie.isCookieEnabled(that, cookieName)
|
||||
) {
|
||||
return null
|
||||
}
|
||||
|
||||
return that._storage.getItem(`${that.options.cookieIdTable}.${cookieName}`)
|
||||
},
|
||||
deleteCookie (that, cookieName) {
|
||||
return that._storage.removeItem(`${that.options.cookieIdTable}.${cookieName}`)
|
||||
},
|
||||
calculateExpiration (cookieExpire) {
|
||||
const time = cookieExpire.replace(/[0-9]*/, '') // s,mi,h,d,m,y
|
||||
|
||||
cookieExpire = cookieExpire.replace(/[A-Za-z]{1,2}/, '') // number
|
||||
|
||||
switch (time.toLowerCase()) {
|
||||
case 's':
|
||||
cookieExpire = +cookieExpire
|
||||
break
|
||||
case 'mi':
|
||||
cookieExpire *= 60
|
||||
break
|
||||
case 'h':
|
||||
cookieExpire = cookieExpire * 60 * 60
|
||||
break
|
||||
case 'd':
|
||||
cookieExpire = cookieExpire * 24 * 60 * 60
|
||||
break
|
||||
case 'm':
|
||||
cookieExpire = cookieExpire * 30 * 24 * 60 * 60
|
||||
break
|
||||
case 'y':
|
||||
cookieExpire = cookieExpire * 365 * 24 * 60 * 60
|
||||
break
|
||||
default:
|
||||
cookieExpire = undefined
|
||||
break
|
||||
}
|
||||
if (!cookieExpire) {
|
||||
return ''
|
||||
}
|
||||
const d = new Date()
|
||||
|
||||
d.setTime(d.getTime() + cookieExpire * 1000)
|
||||
return d.toGMTString()
|
||||
},
|
||||
initCookieFilters (that) {
|
||||
setTimeout(() => {
|
||||
const parsedCookieFilters = JSON.parse(
|
||||
UtilsCookie.getCookie(that, UtilsCookie.cookieIds.filterControl))
|
||||
|
||||
if (!that._filterControlValuesLoaded && parsedCookieFilters) {
|
||||
const cachedFilters = {}
|
||||
const header = UtilsCookie.getCurrentHeader(that)
|
||||
const searchControls = UtilsCookie.getCurrentSearchControls(that)
|
||||
|
||||
const applyCookieFilters = (element, filteredCookies) => {
|
||||
filteredCookies.forEach(cookie => {
|
||||
const value = element.value.toString()
|
||||
const text = cookie.text
|
||||
|
||||
if (
|
||||
text === '' ||
|
||||
element.type === 'radio' &&
|
||||
value !== text
|
||||
) {
|
||||
return
|
||||
}
|
||||
|
||||
if (
|
||||
element.tagName === 'INPUT' &&
|
||||
element.type === 'radio' &&
|
||||
value === text
|
||||
) {
|
||||
element.checked = true
|
||||
cachedFilters[cookie.field] = text
|
||||
} else if (element.tagName === 'INPUT') {
|
||||
element.value = text
|
||||
cachedFilters[cookie.field] = text
|
||||
} else if (
|
||||
element.tagName === 'SELECT' &&
|
||||
that.options.filterControlContainer
|
||||
) {
|
||||
element.value = text
|
||||
cachedFilters[cookie.field] = text
|
||||
} else if (text !== '' && element.tagName === 'SELECT') {
|
||||
cachedFilters[cookie.field] = text
|
||||
for (const currentElement of element) {
|
||||
if (currentElement.value === text) {
|
||||
currentElement.selected = true
|
||||
return
|
||||
}
|
||||
}
|
||||
const option = document.createElement('option')
|
||||
|
||||
option.value = text
|
||||
option.text = text
|
||||
element.add(option, element[1])
|
||||
element.selectedIndex = 1
|
||||
}
|
||||
})
|
||||
}
|
||||
|
||||
let filterContainer = header
|
||||
|
||||
if (that.options.filterControlContainer) {
|
||||
filterContainer = $(`${that.options.filterControlContainer}`)
|
||||
}
|
||||
|
||||
filterContainer.find(searchControls).each(function () {
|
||||
const field = $(this).closest('[data-field]').data('field')
|
||||
const filteredCookies = parsedCookieFilters.filter(cookie => cookie.field === field)
|
||||
|
||||
applyCookieFilters(this, filteredCookies)
|
||||
})
|
||||
|
||||
that.initColumnSearch(cachedFilters)
|
||||
that._filterControlValuesLoaded = true
|
||||
that.initServer()
|
||||
}
|
||||
}, 250)
|
||||
}
|
||||
}
|
||||
|
||||
Object.assign($.fn.bootstrapTable.defaults, {
|
||||
cookie: false,
|
||||
cookieExpire: '2h',
|
||||
cookiePath: null,
|
||||
cookieDomain: null,
|
||||
cookieSecure: null,
|
||||
cookieSameSite: 'Lax',
|
||||
cookieIdTable: '',
|
||||
cookiesEnabled: [
|
||||
'bs.table.sortOrder', 'bs.table.sortName', 'bs.table.sortPriority',
|
||||
'bs.table.pageNumber', 'bs.table.pageList',
|
||||
'bs.table.hiddenColumns', 'bs.table.searchText',
|
||||
'bs.table.filterControl', 'bs.table.filterBy',
|
||||
'bs.table.reorderColumns', 'bs.table.cardView', 'bs.table.customView'
|
||||
],
|
||||
cookieStorage: 'cookieStorage', // localStorage, sessionStorage, customStorage
|
||||
cookieCustomStorageGet: null,
|
||||
cookieCustomStorageSet: null,
|
||||
cookieCustomStorageDelete: null,
|
||||
// internal variable
|
||||
_filterControls: [],
|
||||
_filterControlValuesLoaded: false,
|
||||
_storage: {
|
||||
setItem: undefined,
|
||||
getItem: undefined,
|
||||
removeItem: undefined
|
||||
}
|
||||
})
|
||||
|
||||
$.fn.bootstrapTable.methods.push('getCookies')
|
||||
$.fn.bootstrapTable.methods.push('deleteCookie')
|
||||
|
||||
Object.assign($.fn.bootstrapTable.utils, {
|
||||
setCookie: UtilsCookie.setCookie,
|
||||
getCookie: UtilsCookie.getCookie
|
||||
})
|
||||
|
||||
$.BootstrapTable = class extends $.BootstrapTable {
|
||||
init () {
|
||||
if (this.options.cookie) {
|
||||
if (
|
||||
this.options.cookieStorage === 'cookieStorage' &&
|
||||
!UtilsCookie.isCookieSupportedByBrowser()
|
||||
) {
|
||||
throw new Error('Cookies are not enabled in this browser.')
|
||||
}
|
||||
|
||||
this.configureStorage()
|
||||
|
||||
// FilterBy logic
|
||||
const filterByCookieValue = UtilsCookie.getCookie(this, UtilsCookie.cookieIds.filterBy)
|
||||
|
||||
if (typeof filterByCookieValue === 'boolean' && !filterByCookieValue) {
|
||||
throw new Error('The cookie value of filterBy must be a json!')
|
||||
}
|
||||
|
||||
let filterByCookie = {}
|
||||
|
||||
try {
|
||||
filterByCookie = JSON.parse(filterByCookieValue)
|
||||
} catch (e) {
|
||||
throw new Error('Could not parse the json of the filterBy cookie!')
|
||||
}
|
||||
this.filterColumns = filterByCookie ? filterByCookie : {}
|
||||
|
||||
// FilterControl logic
|
||||
this._filterControls = []
|
||||
this._filterControlValuesLoaded = false
|
||||
|
||||
this.options.cookiesEnabled = typeof this.options.cookiesEnabled === 'string' ?
|
||||
this.options.cookiesEnabled.replace('[', '').replace(']', '')
|
||||
.replace(/'/g, '').replace(/ /g, '').split(',') :
|
||||
this.options.cookiesEnabled
|
||||
|
||||
if (this.options.filterControl) {
|
||||
const that = this
|
||||
|
||||
this.$el.on('column-search.bs.table', (e, field, text) => {
|
||||
let isNewField = true
|
||||
|
||||
for (let i = 0; i < that._filterControls.length; i++) {
|
||||
if (that._filterControls[i].field === field) {
|
||||
that._filterControls[i].text = text
|
||||
isNewField = false
|
||||
break
|
||||
}
|
||||
}
|
||||
if (isNewField) {
|
||||
that._filterControls.push({
|
||||
field,
|
||||
text
|
||||
})
|
||||
}
|
||||
|
||||
UtilsCookie.setCookie(that, UtilsCookie.cookieIds.filterControl, JSON.stringify(that._filterControls))
|
||||
}).on('created-controls.bs.table', UtilsCookie.initCookieFilters(that))
|
||||
}
|
||||
}
|
||||
super.init()
|
||||
}
|
||||
|
||||
initServer (...args) {
|
||||
if (
|
||||
this.options.cookie &&
|
||||
this.options.filterControl &&
|
||||
!this._filterControlValuesLoaded
|
||||
) {
|
||||
const cookie = JSON.parse(UtilsCookie.getCookie(this, UtilsCookie.cookieIds.filterControl))
|
||||
|
||||
if (cookie) {
|
||||
return
|
||||
}
|
||||
}
|
||||
super.initServer(...args)
|
||||
}
|
||||
|
||||
initTable (...args) {
|
||||
super.initTable(...args)
|
||||
this.initCookie()
|
||||
}
|
||||
|
||||
onSort (...args) {
|
||||
super.onSort(...args)
|
||||
|
||||
if (!this.options.cookie) {
|
||||
return
|
||||
}
|
||||
|
||||
if (this.options.sortName === undefined || this.options.sortOrder === undefined) {
|
||||
UtilsCookie.deleteCookie(this, UtilsCookie.cookieIds.sortName)
|
||||
UtilsCookie.deleteCookie(this, UtilsCookie.cookieIds.sortOrder)
|
||||
} else {
|
||||
this.options.sortPriority = null
|
||||
UtilsCookie.deleteCookie(this, UtilsCookie.cookieIds.sortPriority)
|
||||
|
||||
UtilsCookie.setCookie(this, UtilsCookie.cookieIds.sortOrder, this.options.sortOrder)
|
||||
UtilsCookie.setCookie(this, UtilsCookie.cookieIds.sortName, this.options.sortName)
|
||||
}
|
||||
}
|
||||
|
||||
onMultipleSort (...args) {
|
||||
super.onMultipleSort(...args)
|
||||
|
||||
if (!this.options.cookie) {
|
||||
return
|
||||
}
|
||||
|
||||
if (this.options.sortPriority === undefined) {
|
||||
UtilsCookie.deleteCookie(this, UtilsCookie.cookieIds.sortPriority)
|
||||
} else {
|
||||
this.options.sortName = undefined
|
||||
this.options.sortOrder = undefined
|
||||
UtilsCookie.deleteCookie(this, UtilsCookie.cookieIds.sortName)
|
||||
UtilsCookie.deleteCookie(this, UtilsCookie.cookieIds.sortOrder)
|
||||
|
||||
UtilsCookie.setCookie(this, UtilsCookie.cookieIds.sortPriority, JSON.stringify(this.options.sortPriority))
|
||||
}
|
||||
}
|
||||
|
||||
onPageNumber (...args) {
|
||||
super.onPageNumber(...args)
|
||||
if (!this.options.cookie) {
|
||||
return
|
||||
}
|
||||
UtilsCookie.setCookie(this, UtilsCookie.cookieIds.pageNumber, this.options.pageNumber)
|
||||
}
|
||||
|
||||
onPageListChange (...args) {
|
||||
super.onPageListChange(...args)
|
||||
if (!this.options.cookie) {
|
||||
return
|
||||
}
|
||||
UtilsCookie.setCookie(this, UtilsCookie.cookieIds.pageList,
|
||||
this.options.pageSize === this.options.formatAllRows() ? 'all' : this.options.pageSize)
|
||||
UtilsCookie.setCookie(this, UtilsCookie.cookieIds.pageNumber, this.options.pageNumber)
|
||||
}
|
||||
|
||||
onPagePre (...args) {
|
||||
super.onPagePre(...args)
|
||||
if (!this.options.cookie) {
|
||||
return
|
||||
}
|
||||
UtilsCookie.setCookie(this, UtilsCookie.cookieIds.pageNumber, this.options.pageNumber)
|
||||
}
|
||||
|
||||
onPageNext (...args) {
|
||||
super.onPageNext(...args)
|
||||
if (!this.options.cookie) {
|
||||
return
|
||||
}
|
||||
UtilsCookie.setCookie(this, UtilsCookie.cookieIds.pageNumber, this.options.pageNumber)
|
||||
}
|
||||
|
||||
_toggleColumn (...args) {
|
||||
super._toggleColumn(...args)
|
||||
if (!this.options.cookie) {
|
||||
return
|
||||
}
|
||||
UtilsCookie.setCookie(this, UtilsCookie.cookieIds.hiddenColumns, JSON.stringify(this.getHiddenColumns().map(column => column.field)))
|
||||
}
|
||||
|
||||
_toggleAllColumns (...args) {
|
||||
super._toggleAllColumns(...args)
|
||||
if (!this.options.cookie) {
|
||||
return
|
||||
}
|
||||
UtilsCookie.setCookie(this, UtilsCookie.cookieIds.hiddenColumns, JSON.stringify(this.getHiddenColumns().map(column => column.field)))
|
||||
}
|
||||
|
||||
toggleView () {
|
||||
super.toggleView()
|
||||
UtilsCookie.setCookie(this, UtilsCookie.cookieIds.cardView, this.options.cardView)
|
||||
}
|
||||
|
||||
toggleCustomView () {
|
||||
super.toggleCustomView()
|
||||
UtilsCookie.setCookie(this, UtilsCookie.cookieIds.customView, this.customViewDefaultView)
|
||||
}
|
||||
|
||||
selectPage (page) {
|
||||
super.selectPage(page)
|
||||
if (!this.options.cookie) {
|
||||
return
|
||||
}
|
||||
UtilsCookie.setCookie(this, UtilsCookie.cookieIds.pageNumber, page)
|
||||
}
|
||||
|
||||
onSearch (event) {
|
||||
super.onSearch(event, arguments.length > 1 ? arguments[1] : true)
|
||||
if (!this.options.cookie) {
|
||||
return
|
||||
}
|
||||
if (this.options.search) {
|
||||
UtilsCookie.setCookie(this, UtilsCookie.cookieIds.searchText, this.searchText)
|
||||
}
|
||||
UtilsCookie.setCookie(this, UtilsCookie.cookieIds.pageNumber, this.options.pageNumber)
|
||||
}
|
||||
|
||||
initHeader (...args) {
|
||||
if (this.options.reorderableColumns && this.options.cookie) {
|
||||
this.columnsSortOrder = JSON.parse(UtilsCookie.getCookie(this, UtilsCookie.cookieIds.reorderColumns))
|
||||
}
|
||||
super.initHeader(...args)
|
||||
}
|
||||
|
||||
persistReorderColumnsState (that) {
|
||||
UtilsCookie.setCookie(that, UtilsCookie.cookieIds.reorderColumns, JSON.stringify(that.columnsSortOrder))
|
||||
}
|
||||
|
||||
filterBy (...args) {
|
||||
super.filterBy(...args)
|
||||
if (!this.options.cookie) {
|
||||
return
|
||||
}
|
||||
UtilsCookie.setCookie(this, UtilsCookie.cookieIds.filterBy, JSON.stringify(this.filterColumns))
|
||||
}
|
||||
|
||||
initCookie () {
|
||||
if (!this.options.cookie) {
|
||||
return
|
||||
}
|
||||
|
||||
if (this.options.cookieIdTable === '' || this.options.cookieExpire === '') {
|
||||
console.error('Configuration error. Please review the cookieIdTable and the cookieExpire property. If the properties are correct, then this browser does not support cookies.')
|
||||
this.options.cookie = false // Make sure that the cookie extension is disabled
|
||||
return
|
||||
}
|
||||
|
||||
const sortOrderCookie = UtilsCookie.getCookie(this, UtilsCookie.cookieIds.sortOrder)
|
||||
const sortOrderNameCookie = UtilsCookie.getCookie(this, UtilsCookie.cookieIds.sortName)
|
||||
let sortPriorityCookie = UtilsCookie.getCookie(this, UtilsCookie.cookieIds.sortPriority)
|
||||
const pageNumberCookie = UtilsCookie.getCookie(this, UtilsCookie.cookieIds.pageNumber)
|
||||
const pageListCookie = UtilsCookie.getCookie(this, UtilsCookie.cookieIds.pageList)
|
||||
const searchTextCookie = UtilsCookie.getCookie(this, UtilsCookie.cookieIds.searchText)
|
||||
const cardViewCookie = UtilsCookie.getCookie(this, UtilsCookie.cookieIds.cardView)
|
||||
const customViewCookie = UtilsCookie.getCookie(this, UtilsCookie.cookieIds.customView)
|
||||
const hiddenColumnsCookieValue = UtilsCookie.getCookie(this, UtilsCookie.cookieIds.hiddenColumns)
|
||||
|
||||
let hiddenColumnsCookie = {}
|
||||
|
||||
try {
|
||||
hiddenColumnsCookie = JSON.parse(hiddenColumnsCookieValue)
|
||||
} catch (e) {
|
||||
throw new Error('Could not parse the json of the hidden columns cookie!', hiddenColumnsCookieValue)
|
||||
}
|
||||
|
||||
try {
|
||||
sortPriorityCookie = JSON.parse(sortPriorityCookie)
|
||||
} catch (e) {
|
||||
throw new Error('Could not parse the json of the sortPriority cookie!', sortPriorityCookie)
|
||||
}
|
||||
|
||||
if (!sortPriorityCookie) {
|
||||
// sortOrder
|
||||
this.options.sortOrder = sortOrderCookie ? sortOrderCookie : this.options.sortOrder
|
||||
// sortName
|
||||
this.options.sortName = sortOrderNameCookie ? sortOrderNameCookie : this.options.sortName
|
||||
} else {
|
||||
this.options.sortOrder = undefined
|
||||
this.options.sortName = undefined
|
||||
}
|
||||
|
||||
// sortPriority
|
||||
this.options.sortPriority = sortPriorityCookie ? sortPriorityCookie : this.options.sortPriority
|
||||
|
||||
if (this.options.sortOrder || this.options.sortName) {
|
||||
// sortPriority
|
||||
this.options.sortPriority = null
|
||||
}
|
||||
|
||||
// pageNumber
|
||||
this.options.pageNumber = pageNumberCookie ? +pageNumberCookie : this.options.pageNumber
|
||||
// pageSize
|
||||
this.options.pageSize = pageListCookie ? pageListCookie === 'all' ?
|
||||
this.options.formatAllRows() : +pageListCookie : this.options.pageSize
|
||||
// searchText
|
||||
if (UtilsCookie.isCookieEnabled(this, UtilsCookie.cookieIds.searchText) && this.options.searchText === '') {
|
||||
this.options.searchText = searchTextCookie ? searchTextCookie : ''
|
||||
}
|
||||
// cardView
|
||||
if (cardViewCookie !== null) {
|
||||
this.options.cardView = cardViewCookie === 'true' ? cardViewCookie : false
|
||||
}
|
||||
this.customViewDefaultView = customViewCookie === 'true'
|
||||
|
||||
if (hiddenColumnsCookie) {
|
||||
for (const column of this.columns) {
|
||||
if (!column.switchable) {
|
||||
continue
|
||||
}
|
||||
|
||||
column.visible = this.isSelectionColumn(column) ||
|
||||
!hiddenColumnsCookie.includes(column.field)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
getCookies () {
|
||||
const bootstrapTable = this
|
||||
const cookies = {}
|
||||
|
||||
for (const [key, value] of Object.entries(UtilsCookie.cookieIds)) {
|
||||
cookies[key] = UtilsCookie.getCookie(bootstrapTable, value)
|
||||
if (key === 'columns' || key === 'hiddenColumns' || key === 'sortPriority') {
|
||||
cookies[key] = JSON.parse(cookies[key])
|
||||
}
|
||||
}
|
||||
return cookies
|
||||
}
|
||||
|
||||
deleteCookie (cookieName) {
|
||||
if (!cookieName) {
|
||||
return
|
||||
}
|
||||
|
||||
UtilsCookie.deleteCookie(this, UtilsCookie.cookieIds[cookieName])
|
||||
}
|
||||
|
||||
configureStorage () {
|
||||
const that = this
|
||||
|
||||
this._storage = {}
|
||||
switch (this.options.cookieStorage) {
|
||||
case 'cookieStorage':
|
||||
this._storage.setItem = function (cookieName, cookieValue) {
|
||||
document.cookie = [
|
||||
cookieName, '=', encodeURIComponent(cookieValue),
|
||||
`; expires=${UtilsCookie.calculateExpiration(that.options.cookieExpire)}`,
|
||||
that.options.cookiePath ? `; path=${that.options.cookiePath}` : '',
|
||||
that.options.cookieDomain ? `; domain=${that.options.cookieDomain}` : '',
|
||||
that.options.cookieSecure ? '; secure' : '',
|
||||
`;SameSite=${that.options.cookieSameSite}`
|
||||
].join('')
|
||||
}
|
||||
this._storage.getItem = function (cookieName) {
|
||||
const value = `; ${document.cookie}`
|
||||
const parts = value.split(`; ${cookieName}=`)
|
||||
|
||||
return parts.length === 2 ? decodeURIComponent(parts.pop().split(';').shift()) : null
|
||||
}
|
||||
this._storage.removeItem = function (cookieName) {
|
||||
document.cookie = [
|
||||
encodeURIComponent(cookieName), '=',
|
||||
'; expires=Thu, 01 Jan 1970 00:00:00 GMT',
|
||||
that.options.cookiePath ? `; path=${that.options.cookiePath}` : '',
|
||||
that.options.cookieDomain ? `; domain=${that.options.cookieDomain}` : '',
|
||||
`;SameSite=${that.options.cookieSameSite}`
|
||||
].join('')
|
||||
}
|
||||
break
|
||||
case 'localStorage':
|
||||
this._storage.setItem = function (cookieName, cookieValue) {
|
||||
localStorage.setItem(cookieName, cookieValue)
|
||||
}
|
||||
this._storage.getItem = function (cookieName) {
|
||||
return localStorage.getItem(cookieName)
|
||||
}
|
||||
this._storage.removeItem = function (cookieName) {
|
||||
localStorage.removeItem(cookieName)
|
||||
}
|
||||
break
|
||||
case 'sessionStorage':
|
||||
this._storage.setItem = function (cookieName, cookieValue) {
|
||||
sessionStorage.setItem(cookieName, cookieValue)
|
||||
}
|
||||
this._storage.getItem = function (cookieName) {
|
||||
return sessionStorage.getItem(cookieName)
|
||||
}
|
||||
this._storage.removeItem = function (cookieName) {
|
||||
sessionStorage.removeItem(cookieName)
|
||||
}
|
||||
break
|
||||
case 'customStorage':
|
||||
if (
|
||||
!this.options.cookieCustomStorageSet ||
|
||||
!this.options.cookieCustomStorageGet ||
|
||||
!this.options.cookieCustomStorageDelete
|
||||
) {
|
||||
throw new Error('The following options must be set while using the customStorage: cookieCustomStorageSet, cookieCustomStorageGet and cookieCustomStorageDelete')
|
||||
}
|
||||
|
||||
this._storage.setItem = function (cookieName, cookieValue) {
|
||||
Utils.calculateObjectValue(that.options, that.options.cookieCustomStorageSet, [cookieName, cookieValue], '')
|
||||
}
|
||||
this._storage.getItem = function (cookieName) {
|
||||
return Utils.calculateObjectValue(that.options, that.options.cookieCustomStorageGet, [cookieName], '')
|
||||
}
|
||||
this._storage.removeItem = function (cookieName) {
|
||||
Utils.calculateObjectValue(that.options, that.options.cookieCustomStorageDelete, [cookieName], '')
|
||||
}
|
||||
|
||||
break
|
||||
default:
|
||||
throw new Error('Storage method not supported.')
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -1,85 +1,68 @@
|
|||
/**
|
||||
* @author: Dustin Utecht
|
||||
* @github: https://github.com/UtechtDustin
|
||||
* @author zhixin wen <wenzhixin2010@gmail.com>
|
||||
*/
|
||||
|
||||
var Utils = $.fn.bootstrapTable.utils
|
||||
const Utils = $.fn.bootstrapTable.utils
|
||||
|
||||
Object.assign($.fn.bootstrapTable.defaults, {
|
||||
$.extend($.fn.bootstrapTable.defaults, {
|
||||
customView: false,
|
||||
showCustomView: false,
|
||||
customViewDefaultView: false
|
||||
showCustomViewButton: false
|
||||
})
|
||||
|
||||
Object.assign($.fn.bootstrapTable.defaults.icons, {
|
||||
customViewOn: {
|
||||
bootstrap3: 'glyphicon glyphicon-list',
|
||||
bootstrap5: 'bi-list',
|
||||
bootstrap4: 'fa fa-list',
|
||||
semantic: 'fa fa-list',
|
||||
foundation: 'fa fa-list',
|
||||
bulma: 'fa fa-list',
|
||||
materialize: 'list'
|
||||
}[$.fn.bootstrapTable.theme] || 'fa-list',
|
||||
customViewOff: {
|
||||
$.extend($.fn.bootstrapTable.defaults.icons, {
|
||||
customView: {
|
||||
bootstrap3: 'glyphicon glyphicon-eye-open',
|
||||
bootstrap5: 'bi-grid',
|
||||
bootstrap4: 'fa fa-th',
|
||||
semantic: 'fa fa-th',
|
||||
foundation: 'fa fa-th',
|
||||
bulma: 'fa fa-th',
|
||||
materialize: 'grid_on'
|
||||
}[$.fn.bootstrapTable.theme] || 'fa-th'
|
||||
bootstrap5: 'bi-eye',
|
||||
bootstrap4: 'fa fa-eye',
|
||||
semantic: 'fa fa-eye',
|
||||
foundation: 'fa fa-eye',
|
||||
bulma: 'fa fa-eye',
|
||||
materialize: 'remove_red_eye'
|
||||
}[$.fn.bootstrapTable.theme] || 'fa-eye'
|
||||
})
|
||||
|
||||
Object.assign($.fn.bootstrapTable.defaults, {
|
||||
$.extend($.fn.bootstrapTable.defaults, {
|
||||
onCustomViewPostBody () {
|
||||
return false
|
||||
},
|
||||
onCustomViewPreBody () {
|
||||
return false
|
||||
},
|
||||
onToggleCustomView () {
|
||||
return false
|
||||
}
|
||||
})
|
||||
|
||||
Object.assign($.fn.bootstrapTable.locales, {
|
||||
formatToggleCustomViewOn () {
|
||||
return 'Show custom view'
|
||||
},
|
||||
formatToggleCustomViewOff () {
|
||||
return 'Hide custom view'
|
||||
$.extend($.fn.bootstrapTable.locales, {
|
||||
formatToggleCustomView () {
|
||||
return 'Toggle custom view'
|
||||
}
|
||||
})
|
||||
Object.assign($.fn.bootstrapTable.defaults, $.fn.bootstrapTable.locales)
|
||||
$.extend($.fn.bootstrapTable.defaults, $.fn.bootstrapTable.locales)
|
||||
|
||||
$.fn.bootstrapTable.methods.push('toggleCustomView')
|
||||
|
||||
Object.assign($.fn.bootstrapTable.events, {
|
||||
$.extend($.fn.bootstrapTable.Constructor.EVENTS, {
|
||||
'custom-view-post-body.bs.table': 'onCustomViewPostBody',
|
||||
'custom-view-pre-body.bs.table': 'onCustomViewPreBody',
|
||||
'toggle-custom-view.bs.table': 'onToggleCustomView'
|
||||
'custom-view-pre-body.bs.table': 'onCustomViewPreBody'
|
||||
})
|
||||
|
||||
$.BootstrapTable = class extends $.BootstrapTable {
|
||||
|
||||
init () {
|
||||
this.customViewDefaultView = this.options.customViewDefaultView
|
||||
this.showCustomView = this.options.showCustomView
|
||||
|
||||
super.init()
|
||||
}
|
||||
|
||||
initToolbar (...args) {
|
||||
if (this.options.customView && this.options.showCustomView) {
|
||||
if (this.options.customView && this.options.showCustomViewButton) {
|
||||
this.buttons = Object.assign(this.buttons, {
|
||||
customView: {
|
||||
text: this.options.customViewDefaultView ? this.options.formatToggleCustomViewOff() : this.options.formatToggleCustomViewOn(),
|
||||
icon: this.options.customViewDefaultView ? this.options.icons.customViewOn : this.options.icons.customViewOff,
|
||||
text: this.options.formatToggleCustomView(),
|
||||
icon: this.options.icons.customView,
|
||||
event: this.toggleCustomView,
|
||||
attributes: {
|
||||
'aria-label': this.options.customViewDefaultView ? this.options.formatToggleCustomViewOff() : this.options.formatToggleCustomViewOn(),
|
||||
title: this.options.customViewDefaultView ? this.options.formatToggleCustomViewOff() : this.options.formatToggleCustomViewOn()
|
||||
'aria-label': this.options.formatToggleCustomView(),
|
||||
title: this.options.formatToggleCustomView()
|
||||
}
|
||||
}
|
||||
})
|
||||
|
|
@ -100,7 +83,7 @@ $.BootstrapTable = class extends $.BootstrapTable {
|
|||
|
||||
$table.hide()
|
||||
$customViewContainer.hide()
|
||||
if (!this.options.customView || !this.customViewDefaultView) {
|
||||
if (!this.options.customView || !this.showCustomView) {
|
||||
$table.show()
|
||||
return
|
||||
}
|
||||
|
|
@ -119,17 +102,7 @@ $.BootstrapTable = class extends $.BootstrapTable {
|
|||
}
|
||||
|
||||
toggleCustomView () {
|
||||
this.customViewDefaultView = !this.customViewDefaultView
|
||||
|
||||
const icon = this.options.showButtonIcons ? this.customViewDefaultView ? this.options.icons.customViewOn : this.options.icons.customViewOff : ''
|
||||
const text = this.options.showButtonText ? this.customViewDefaultView ? this.options.formatToggleCustomViewOff() : this.options.formatToggleCustomViewOn() : ''
|
||||
|
||||
this.$toolbar.find('button[name="customView"]')
|
||||
.html(`${Utils.sprintf(this.constants.html.icon, this.options.iconsPrefix, icon)} ${text}`)
|
||||
.attr('aria-label', text)
|
||||
.attr('title', text)
|
||||
|
||||
this.showCustomView = !this.showCustomView
|
||||
this.initBody()
|
||||
this.trigger('toggle-custom-view', this.customViewDefaultView)
|
||||
}
|
||||
}
|
||||
|
|
@ -1,7 +1,7 @@
|
|||
/*! X-editable - v1.5.3
|
||||
/*! X-editable - v1.5.1
|
||||
* In-place editing with Twitter Bootstrap, jQuery UI or pure jQuery
|
||||
* http://github.com/vitalets/x-editable
|
||||
* Copyright (c) 2019 Vitaliy Potapov; Licensed MIT */
|
||||
* Copyright (c) 2013 Vitaliy Potapov; Licensed MIT */
|
||||
.editableform {
|
||||
margin-bottom: 0; /* overwrites bootstrap margin */
|
||||
}
|
||||
|
|
@ -12,16 +12,6 @@
|
|||
line-height: 20px; /* overwriting bootstrap line-height. See #133 */
|
||||
}
|
||||
|
||||
/*
|
||||
BS3 fix: stop css from breaking when the form is inside a popup and inside a form with the class .form-horizontal
|
||||
See: https://github.com/vitalets/x-editable/issues/682
|
||||
*/
|
||||
.form-horizontal .editable-popup .editableform .form-group {
|
||||
margin-left:0;
|
||||
margin-right:0;
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
BS3 width:1005 for inputs breaks editable form in popup
|
||||
See: https://github.com/vitalets/x-editable/issues/393
|
||||
|
|
@ -155,7 +145,6 @@
|
|||
.editable-pre-wrapped {
|
||||
white-space: pre-wrap;
|
||||
}
|
||||
|
||||
.editable-container.editable-popup {
|
||||
max-width: none !important; /* without this rule poshytip/tooltip does not stretch */
|
||||
}
|
||||
|
|
|
|||
File diff suppressed because one or more lines are too long
|
|
@ -4,7 +4,7 @@
|
|||
* extensions: https://github.com/vitalets/x-editable
|
||||
*/
|
||||
|
||||
var Utils = $.fn.bootstrapTable.utils
|
||||
const Utils = $.fn.bootstrapTable.utils
|
||||
|
||||
$.extend($.fn.bootstrapTable.defaults, {
|
||||
editable: true,
|
||||
|
|
@ -26,7 +26,7 @@ $.extend($.fn.bootstrapTable.columnDefaults, {
|
|||
alwaysUseFormatter: false
|
||||
})
|
||||
|
||||
$.extend($.fn.bootstrapTable.events, {
|
||||
$.extend($.fn.bootstrapTable.Constructor.EVENTS, {
|
||||
'editable-init.bs.table': 'onEditableInit',
|
||||
'editable-save.bs.table': 'onEditableSave',
|
||||
'editable-shown.bs.table': 'onEditableShown',
|
||||
|
|
@ -63,7 +63,7 @@ $.BootstrapTable = class extends $.BootstrapTable {
|
|||
|
||||
column.formatter = column.formatter || (value => value)
|
||||
column._formatter = column._formatter ? column._formatter : column.formatter
|
||||
column.formatter = (value, row, index, field) => {
|
||||
column.formatter = (value, row, index) => {
|
||||
let result = Utils.calculateObjectValue(column, column._formatter, [value, row, index], value)
|
||||
|
||||
result = typeof result === 'undefined' || result === null ? this.options.undefinedText : result
|
||||
|
|
@ -86,7 +86,7 @@ $.BootstrapTable = class extends $.BootstrapTable {
|
|||
column.editable, [index, row], {})
|
||||
|
||||
if (editableOpts.hasOwnProperty('noEditFormatter')) {
|
||||
noEditFormatter = editableOpts.noEditFormatter(value, row, index, field)
|
||||
noEditFormatter = editableOpts.noEditFormatter(value, row, index)
|
||||
}
|
||||
|
||||
if (noEditFormatter === false) {
|
||||
|
|
@ -177,12 +177,10 @@ $.BootstrapTable = class extends $.BootstrapTable {
|
|||
if (params && params.escape) {
|
||||
for (const row of data) {
|
||||
for (const [key, value] of Object.entries(row)) {
|
||||
if (typeof(value) !== "number") {
|
||||
row[key] = Utils.unescapeHTML(value)
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return data
|
||||
}
|
||||
|
|
|
|||
|
|
@ -3,7 +3,7 @@
|
|||
* extensions: https://github.com/hhurz/tableExport.jquery.plugin
|
||||
*/
|
||||
|
||||
var Utils = $.fn.bootstrapTable.utils
|
||||
const Utils = $.fn.bootstrapTable.utils
|
||||
|
||||
const TYPE_NAME = {
|
||||
json: 'JSON',
|
||||
|
|
@ -19,50 +19,53 @@ const TYPE_NAME = {
|
|||
pdf: 'PDF'
|
||||
}
|
||||
|
||||
Object.assign($.fn.bootstrapTable.defaults, {
|
||||
$.extend($.fn.bootstrapTable.defaults, {
|
||||
showExport: false,
|
||||
exportDataType: 'basic', // basic, all, selected
|
||||
exportTypes: ['json', 'xml', 'csv', 'txt', 'sql', 'excel'],
|
||||
exportOptions: {},
|
||||
exportOptions: {
|
||||
onCellHtmlData (cell, rowIndex, colIndex, htmlData) {
|
||||
if (cell.is('th')) {
|
||||
return cell.find('.th-inner').text()
|
||||
}
|
||||
|
||||
return htmlData
|
||||
}
|
||||
},
|
||||
exportFooter: false
|
||||
})
|
||||
|
||||
Object.assign($.fn.bootstrapTable.columnDefaults, {
|
||||
$.extend($.fn.bootstrapTable.columnDefaults, {
|
||||
forceExport: false,
|
||||
forceHide: false
|
||||
})
|
||||
|
||||
Object.assign($.fn.bootstrapTable.defaults.icons, {
|
||||
$.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'
|
||||
})
|
||||
|
||||
Object.assign($.fn.bootstrapTable.locales, {
|
||||
$.extend($.fn.bootstrapTable.locales, {
|
||||
formatExport () {
|
||||
return 'Export data'
|
||||
}
|
||||
})
|
||||
Object.assign($.fn.bootstrapTable.defaults, $.fn.bootstrapTable.locales)
|
||||
$.extend($.fn.bootstrapTable.defaults, $.fn.bootstrapTable.locales)
|
||||
|
||||
$.fn.bootstrapTable.methods.push('exportTable')
|
||||
|
||||
Object.assign($.fn.bootstrapTable.defaults, {
|
||||
$.extend($.fn.bootstrapTable.defaults, {
|
||||
// eslint-disable-next-line no-unused-vars
|
||||
onExportSaved (exportedRows) {
|
||||
return false
|
||||
},
|
||||
onExportStarted () {
|
||||
return false
|
||||
}
|
||||
})
|
||||
|
||||
Object.assign($.fn.bootstrapTable.events, {
|
||||
'export-saved.bs.table': 'onExportSaved',
|
||||
'export-started.bs.table': 'onExportStarted'
|
||||
$.extend($.fn.bootstrapTable.Constructor.EVENTS, {
|
||||
'export-saved.bs.table': 'onExportSaved'
|
||||
})
|
||||
|
||||
$.BootstrapTable = class extends $.BootstrapTable {
|
||||
|
|
@ -80,10 +83,6 @@ $.BootstrapTable = class extends $.BootstrapTable {
|
|||
exportTypes = types.map(t => t.slice(1, -1))
|
||||
}
|
||||
|
||||
if (typeof o.exportOptions === 'string') {
|
||||
o.exportOptions = Utils.calculateObjectValue(null, o.exportOptions)
|
||||
}
|
||||
|
||||
this.$export = this.$toolbar.find('>.columns div.export')
|
||||
if (this.$export.length) {
|
||||
this.updateExportButton()
|
||||
|
|
@ -92,29 +91,21 @@ $.BootstrapTable = class extends $.BootstrapTable {
|
|||
|
||||
this.buttons = Object.assign(this.buttons, {
|
||||
export: {
|
||||
html:
|
||||
() => {
|
||||
if (exportTypes.length === 1) {
|
||||
return `
|
||||
html: exportTypes.length === 1 ? `
|
||||
<div class="export ${this.constants.classes.buttonsDropdown}"
|
||||
data-type="${exportTypes[0]}">
|
||||
<button class="${this.constants.buttonsClass}"
|
||||
aria-label="${o.formatExport()}"
|
||||
aria-label="Export"
|
||||
type="button"
|
||||
title="${o.formatExport()}">
|
||||
${o.showButtonIcons ? Utils.sprintf(this.constants.html.icon, o.iconsPrefix, o.icons.export) : ''}
|
||||
${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="${o.formatExport()}"
|
||||
aria-label="Export"
|
||||
${this.constants.dataToggle}="dropdown"
|
||||
type="button"
|
||||
title="${o.formatExport()}">
|
||||
|
|
@ -122,21 +113,8 @@ $.BootstrapTable = class extends $.BootstrapTable {
|
|||
${o.showButtonText ? o.formatExport() : ''}
|
||||
${this.constants.html.dropdownCaret}
|
||||
</button>
|
||||
${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('')
|
||||
}
|
||||
</div>
|
||||
`
|
||||
}
|
||||
})
|
||||
}
|
||||
|
|
@ -148,19 +126,41 @@ $.BootstrapTable = class extends $.BootstrapTable {
|
|||
return
|
||||
}
|
||||
|
||||
this.updateExportButton()
|
||||
let $exportButtons = this.$export.find('[data-type]')
|
||||
let $menu = $(this.constants.html.toolbarDropdown.join(''))
|
||||
let $items = this.$export
|
||||
|
||||
if (exportTypes.length === 1) {
|
||||
$exportButtons = 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)
|
||||
}
|
||||
}
|
||||
|
||||
$exportButtons.click(e => {
|
||||
$items = $menu.children()
|
||||
}
|
||||
|
||||
this.updateExportButton()
|
||||
|
||||
$items.click(e => {
|
||||
e.preventDefault()
|
||||
this.trigger('export-started')
|
||||
this.exportTable({
|
||||
type: $(e.currentTarget).data('type')
|
||||
})
|
||||
|
||||
const type = $(e.currentTarget).data('type')
|
||||
const exportOptions = {
|
||||
type,
|
||||
escape: false
|
||||
}
|
||||
|
||||
this.exportTable(exportOptions)
|
||||
})
|
||||
this.handleToolbar()
|
||||
}
|
||||
|
|
@ -202,7 +202,7 @@ $.BootstrapTable = class extends $.BootstrapTable {
|
|||
o.exportOptions.ignoreColumn = [detailViewIndex].concat(o.exportOptions.ignoreColumn || [])
|
||||
}
|
||||
|
||||
if (o.exportFooter && o.height) {
|
||||
if (o.exportFooter) {
|
||||
const $footerRow = this.$tableFooter.find('tr').first()
|
||||
const footerData = {}
|
||||
const footerHtml = []
|
||||
|
|
@ -236,7 +236,7 @@ $.BootstrapTable = class extends $.BootstrapTable {
|
|||
options.fileName = o.exportOptions.fileName()
|
||||
}
|
||||
|
||||
this.$el.tableExport(Utils.extend({
|
||||
this.$el.tableExport($.extend({
|
||||
onAfterSaveToFile: () => {
|
||||
if (o.exportFooter) {
|
||||
this.load(data)
|
||||
|
|
@ -273,17 +273,15 @@ $.BootstrapTable = class extends $.BootstrapTable {
|
|||
|
||||
this.$el.one(eventName, () => {
|
||||
setTimeout(() => {
|
||||
const data = this.getData()
|
||||
|
||||
doExport(() => {
|
||||
this.options.virtualScroll = virtualScroll
|
||||
this.togglePagination()
|
||||
})
|
||||
this.trigger('export-saved', data)
|
||||
}, 0)
|
||||
})
|
||||
this.options.virtualScroll = false
|
||||
this.togglePagination()
|
||||
this.trigger('export-saved', this.getData())
|
||||
} else if (o.exportDataType === 'selected') {
|
||||
let data = this.getData()
|
||||
let selectedData = this.getSelections()
|
||||
|
|
|
|||
|
|
@ -1,5 +1,6 @@
|
|||
/**
|
||||
* @author: Dennis Hernández
|
||||
* @webSite: http://djhvscf.github.io/Blog
|
||||
* @update zhixin wen <wenzhixin2010@gmail.com>
|
||||
*/
|
||||
|
||||
|
|
@ -17,7 +18,7 @@ const debounce = (func, wait) => {
|
|||
}
|
||||
}
|
||||
|
||||
Object.assign($.fn.bootstrapTable.defaults, {
|
||||
$.extend($.fn.bootstrapTable.defaults, {
|
||||
mobileResponsive: false,
|
||||
minWidth: 562,
|
||||
minHeight: undefined,
|
||||
|
|
@ -107,9 +108,9 @@ $.BootstrapTable = class extends $.BootstrapTable {
|
|||
|
||||
changeView (width, height) {
|
||||
if (this.options.minHeight) {
|
||||
if (width <= this.options.minWidth && height <= this.options.minHeight) {
|
||||
if ((width <= this.options.minWidth) && (height <= this.options.minHeight)) {
|
||||
this.conditionCardView()
|
||||
} else if (width > this.options.minWidth && height > this.options.minHeight) {
|
||||
} else if ((width > this.options.minWidth) && (height > this.options.minHeight)) {
|
||||
this.conditionFullView()
|
||||
}
|
||||
} else if (width <= this.options.minWidth) {
|
||||
|
|
|
|||
|
|
@ -2,13 +2,12 @@
|
|||
* @update zhixin wen <wenzhixin2010@gmail.com>
|
||||
*/
|
||||
|
||||
var Utils = $.fn.bootstrapTable.utils
|
||||
const Utils = $.fn.bootstrapTable.utils
|
||||
|
||||
function printPageBuilderDefault (table, styles) {
|
||||
function printPageBuilderDefault (table) {
|
||||
return `
|
||||
<html>
|
||||
<head>
|
||||
${styles}
|
||||
<style type="text/css" media="print">
|
||||
@page {
|
||||
size: auto;
|
||||
|
|
@ -32,12 +31,12 @@ function printPageBuilderDefault (table, styles) {
|
|||
margin-left:20px;
|
||||
}
|
||||
table {
|
||||
width: 94%;
|
||||
margin-left: 3%;
|
||||
margin-right: 3%;
|
||||
width:94%;
|
||||
margin-left:3%;
|
||||
margin-right:3%;
|
||||
}
|
||||
div.bs-table-print {
|
||||
text-align: center;
|
||||
text-align:center;
|
||||
}
|
||||
</style>
|
||||
</head>
|
||||
|
|
@ -46,38 +45,35 @@ function printPageBuilderDefault (table, styles) {
|
|||
<p>Printed on: ${new Date} </p>
|
||||
<div class="bs-table-print">${table}</div>
|
||||
</body>
|
||||
</html>
|
||||
`
|
||||
</html>`
|
||||
}
|
||||
|
||||
Object.assign($.fn.bootstrapTable.locales, {
|
||||
$.extend($.fn.bootstrapTable.locales, {
|
||||
formatPrint () {
|
||||
return 'Print'
|
||||
}
|
||||
})
|
||||
Object.assign($.fn.bootstrapTable.defaults, $.fn.bootstrapTable.locales)
|
||||
$.extend($.fn.bootstrapTable.defaults, $.fn.bootstrapTable.locales)
|
||||
|
||||
Object.assign($.fn.bootstrapTable.defaults, {
|
||||
$.extend($.fn.bootstrapTable.defaults, {
|
||||
showPrint: false,
|
||||
printAsFilteredAndSortedOnUI: true,
|
||||
printSortColumn: undefined,
|
||||
printSortOrder: 'asc',
|
||||
printStyles: [],
|
||||
printPageBuilder (table, styles) {
|
||||
return printPageBuilderDefault(table, styles)
|
||||
printPageBuilder (table) {
|
||||
return printPageBuilderDefault(table)
|
||||
}
|
||||
})
|
||||
|
||||
Object.assign($.fn.bootstrapTable.columnDefaults, {
|
||||
$.extend($.fn.bootstrapTable.COLUMN_DEFAULTS, {
|
||||
printFilter: undefined,
|
||||
printIgnore: false,
|
||||
printFormatter: undefined
|
||||
})
|
||||
|
||||
Object.assign($.fn.bootstrapTable.defaults.icons, {
|
||||
$.extend($.fn.bootstrapTable.defaults.icons, {
|
||||
print: {
|
||||
bootstrap3: 'glyphicon-print icon-share',
|
||||
bootstrap5: 'bi-printer',
|
||||
'bootstrap-table': 'icon-printer'
|
||||
}[$.fn.bootstrapTable.theme] || 'fa-print'
|
||||
})
|
||||
|
|
@ -137,15 +133,9 @@ $.BootstrapTable = class extends $.BootstrapTable {
|
|||
}
|
||||
|
||||
doPrint (data) {
|
||||
const canPrint = column => {
|
||||
return !column.printIgnore && column.visible
|
||||
}
|
||||
|
||||
const formatValue = (row, i, column) => {
|
||||
const value_ = Utils.getItemField(row, column.field, this.options.escape, column.escape)
|
||||
const value = Utils.calculateObjectValue(column,
|
||||
column.printFormatter || column.formatter,
|
||||
[value_, row, i], value_)
|
||||
const value = Utils.calculateObjectValue(column, column.printFormatter,
|
||||
[row[column.field], row, i], row[column.field])
|
||||
|
||||
return typeof value === 'undefined' || value === null ?
|
||||
this.options.undefinedText : value
|
||||
|
|
@ -158,7 +148,7 @@ $.BootstrapTable = class extends $.BootstrapTable {
|
|||
for (const columns of columnsArray) {
|
||||
html.push('<tr>')
|
||||
for (let h = 0; h < columns.length; h++) {
|
||||
if (canPrint(columns[h])) {
|
||||
if (!columns[h].printIgnore) {
|
||||
html.push(
|
||||
`<th
|
||||
${Utils.sprintf(' rowspan="%s"', columns[h].rowspan)}
|
||||
|
|
@ -171,7 +161,7 @@ $.BootstrapTable = class extends $.BootstrapTable {
|
|||
|
||||
html.push('</thead><tbody>')
|
||||
|
||||
const notRender = []
|
||||
const dontRender = []
|
||||
|
||||
if (this.mergedCells) {
|
||||
for (let mc = 0; mc < this.mergedCells.length; mc++) {
|
||||
|
|
@ -183,7 +173,7 @@ $.BootstrapTable = class extends $.BootstrapTable {
|
|||
for (let cs = 0; cs < currentMergedCell.colspan; cs++) {
|
||||
const col = currentMergedCell.col + cs
|
||||
|
||||
notRender.push(`${row},${col}`)
|
||||
dontRender.push(`${row },${ col}`)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -216,10 +206,10 @@ $.BootstrapTable = class extends $.BootstrapTable {
|
|||
}
|
||||
|
||||
if (
|
||||
canPrint(columns[j]) &&
|
||||
!columns[j].printIgnore && columns[j].field &&
|
||||
(
|
||||
!notRender.includes(`${i},${j}`) ||
|
||||
rowspan > 0 && colspan > 0
|
||||
!dontRender.includes(`${i },${ j}`) ||
|
||||
(rowspan > 0 && colspan > 0)
|
||||
)
|
||||
) {
|
||||
if (rowspan > 0 && colspan > 0) {
|
||||
|
|
@ -230,6 +220,7 @@ $.BootstrapTable = class extends $.BootstrapTable {
|
|||
}
|
||||
}
|
||||
|
||||
|
||||
html.push('</tr>')
|
||||
}
|
||||
|
||||
|
|
@ -239,7 +230,7 @@ $.BootstrapTable = class extends $.BootstrapTable {
|
|||
|
||||
for (const columns of columnsArray) {
|
||||
for (let h = 0; h < columns.length; h++) {
|
||||
if (canPrint(columns)) {
|
||||
if (!columns[h].printIgnore) {
|
||||
const footerData = Utils.trToData(columns, this.$el.find('>tfoot>tr'))
|
||||
const footerValue = Utils.calculateObjectValue(columns[h], columns[h].footerFormatter, [data], footerData[0] && footerData[0][columns[h].field] || '')
|
||||
|
||||
|
|
@ -260,8 +251,8 @@ $.BootstrapTable = class extends $.BootstrapTable {
|
|||
}
|
||||
let reverse = sortOrder !== 'asc'
|
||||
|
||||
reverse = -(+reverse || -1)
|
||||
return data.sort((a, b) => reverse * a[colName].localeCompare(b[colName]))
|
||||
reverse = -((+reverse) || -1)
|
||||
return data.sort((a, b) => reverse * (a[colName].localeCompare(b[colName])))
|
||||
}
|
||||
|
||||
const filterRow = (row, filters) => {
|
||||
|
|
@ -283,30 +274,11 @@ $.BootstrapTable = class extends $.BootstrapTable {
|
|||
data = sortRows(data, this.options.printSortColumn, this.options.printSortOrder)
|
||||
const table = buildTable(data, this.options.columns)
|
||||
const newWin = window.open('')
|
||||
const printStyles = typeof this.options.printStyles === 'string' ?
|
||||
this.options.printStyles.replace(/\[|\]| /g, '').toLowerCase().split(',') :
|
||||
this.options.printStyles
|
||||
const styles = printStyles.map(it =>
|
||||
`<link rel="stylesheet" href="${it}" />`).join('')
|
||||
|
||||
const calculatedPrintPage = Utils.calculateObjectValue(this, this.options.printPageBuilder,
|
||||
[table, styles], printPageBuilderDefault(table, styles))
|
||||
const startPrint = () => {
|
||||
newWin.document.write(this.options.printPageBuilder.call(this, table))
|
||||
newWin.document.close()
|
||||
newWin.focus()
|
||||
newWin.print()
|
||||
newWin.close()
|
||||
}
|
||||
|
||||
newWin.document.write(calculatedPrintPage)
|
||||
newWin.document.close()
|
||||
|
||||
if (printStyles.length) {
|
||||
const links = document.getElementsByTagName('link')
|
||||
const lastLink = links[links.length - 1]
|
||||
|
||||
lastLink.onload = startPrint
|
||||
} else {
|
||||
startPrint()
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -1,5 +1,6 @@
|
|||
/**
|
||||
* @author: Dennis Hernández
|
||||
* @webSite: http://djhvscf.github.io/Blog
|
||||
* @update: https://github.com/wenzhixin
|
||||
* @version: v1.2.0
|
||||
*/
|
||||
|
|
@ -59,7 +60,7 @@ const filterFn = () => {
|
|||
}
|
||||
}
|
||||
|
||||
Object.assign($.fn.bootstrapTable.defaults, {
|
||||
$.extend($.fn.bootstrapTable.defaults, {
|
||||
reorderableColumns: false,
|
||||
maxMovingRows: 10,
|
||||
// eslint-disable-next-line no-unused-vars
|
||||
|
|
@ -69,7 +70,7 @@ Object.assign($.fn.bootstrapTable.defaults, {
|
|||
dragaccept: null
|
||||
})
|
||||
|
||||
Object.assign($.fn.bootstrapTable.events, {
|
||||
$.extend($.fn.bootstrapTable.Constructor.EVENTS, {
|
||||
'reorder-column.bs.table': 'onReorderColumn'
|
||||
})
|
||||
|
||||
|
|
@ -83,7 +84,7 @@ $.BootstrapTable = class extends $.BootstrapTable {
|
|||
return
|
||||
}
|
||||
|
||||
this.makeColumnsReorderable()
|
||||
this.makeRowsReorderable()
|
||||
}
|
||||
|
||||
_toggleColumn (...args) {
|
||||
|
|
@ -93,7 +94,7 @@ $.BootstrapTable = class extends $.BootstrapTable {
|
|||
return
|
||||
}
|
||||
|
||||
this.makeColumnsReorderable()
|
||||
this.makeRowsReorderable()
|
||||
}
|
||||
|
||||
toggleView (...args) {
|
||||
|
|
@ -107,7 +108,7 @@ $.BootstrapTable = class extends $.BootstrapTable {
|
|||
return
|
||||
}
|
||||
|
||||
this.makeColumnsReorderable()
|
||||
this.makeRowsReorderable()
|
||||
}
|
||||
|
||||
resetView (...args) {
|
||||
|
|
@ -117,10 +118,10 @@ $.BootstrapTable = class extends $.BootstrapTable {
|
|||
return
|
||||
}
|
||||
|
||||
this.makeColumnsReorderable()
|
||||
this.makeRowsReorderable()
|
||||
}
|
||||
|
||||
makeColumnsReorderable (order = null) {
|
||||
makeRowsReorderable (order = null) {
|
||||
try {
|
||||
$(this.$el).dragtable('destroy')
|
||||
} catch (e) {
|
||||
|
|
@ -207,6 +208,6 @@ $.BootstrapTable = class extends $.BootstrapTable {
|
|||
|
||||
orderColumns (order) {
|
||||
this.columnsSortOrder = order
|
||||
this.makeColumnsReorderable()
|
||||
this.makeRowsReorderable()
|
||||
}
|
||||
}
|
||||
File diff suppressed because one or more lines are too long
|
|
@ -1,5 +1,6 @@
|
|||
/**
|
||||
* @author: Dennis Hernández
|
||||
* @webSite: http://djhvscf.github.io/Blog
|
||||
* @update zhixin wen <wenzhixin2010@gmail.com>
|
||||
*/
|
||||
|
||||
|
|
@ -7,12 +8,12 @@ const rowAttr = (row, index) => ({
|
|||
id: `customId_${index}`
|
||||
})
|
||||
|
||||
Object.assign($.fn.bootstrapTable.defaults, {
|
||||
$.extend($.fn.bootstrapTable.defaults, {
|
||||
reorderableRows: false,
|
||||
onDragStyle: null,
|
||||
onDropStyle: null,
|
||||
onDragClass: 'reorder-rows-on-drag-class',
|
||||
dragHandle: '>tbody>tr>td:not(.bs-checkbox)',
|
||||
onDragClass: 'reorder_rows_onDragClass',
|
||||
dragHandle: '>tbody>tr>td',
|
||||
useRowAttrFunc: false,
|
||||
// eslint-disable-next-line no-unused-vars
|
||||
onReorderRowsDrag (row) {
|
||||
|
|
@ -25,14 +26,10 @@ Object.assign($.fn.bootstrapTable.defaults, {
|
|||
// eslint-disable-next-line no-unused-vars
|
||||
onReorderRow (newData) {
|
||||
return false
|
||||
},
|
||||
onDragStop () {},
|
||||
onAllowDrop () {
|
||||
return true
|
||||
}
|
||||
})
|
||||
|
||||
Object.assign($.fn.bootstrapTable.events, {
|
||||
$.extend($.fn.bootstrapTable.Constructor.EVENTS, {
|
||||
'reorder-row.bs.table': 'onReorderRow'
|
||||
})
|
||||
|
||||
|
|
@ -64,8 +61,6 @@ $.BootstrapTable = class extends $.BootstrapTable {
|
|||
onDragStyle: this.options.onDragStyle,
|
||||
onDropStyle: this.options.onDropStyle,
|
||||
onDragClass: this.options.onDragClass,
|
||||
onAllowDrop: (hoveredRow, draggedRow) => this.onAllowDrop(hoveredRow, draggedRow),
|
||||
onDragStop: (table, draggedRow) => this.onDragStop(table, draggedRow),
|
||||
onDragStart: (table, droppedRow) => this.onDropStart(table, droppedRow),
|
||||
onDrop: (table, droppedRow) => this.onDrop(table, droppedRow),
|
||||
dragHandle: this.options.dragHandle
|
||||
|
|
@ -79,26 +74,8 @@ $.BootstrapTable = class extends $.BootstrapTable {
|
|||
this.options.onReorderRowsDrag(this.data[this.draggingIndex])
|
||||
}
|
||||
|
||||
onDragStop (table, draggedRow) {
|
||||
const rowIndexDraggedRow = $(draggedRow).data('index')
|
||||
const draggedRowItem = this.data[rowIndexDraggedRow]
|
||||
|
||||
this.options.onDragStop(table, draggedRowItem, draggedRow)
|
||||
}
|
||||
|
||||
onAllowDrop (hoveredRow, draggedRow) {
|
||||
const rowIndexDraggedRow = $(draggedRow).data('index')
|
||||
const rowIndexHoveredRow = $(hoveredRow).data('index')
|
||||
const draggedRowItem = this.data[rowIndexDraggedRow]
|
||||
const hoveredRowItem = this.data[rowIndexHoveredRow]
|
||||
|
||||
return this.options.onAllowDrop(hoveredRowItem, draggedRowItem, hoveredRow, draggedRow)
|
||||
}
|
||||
|
||||
onDrop (table) {
|
||||
this.$draggingTd.css('cursor', '')
|
||||
const pageNum = this.options.pageNumber
|
||||
const pageSize = this.options.pageSize
|
||||
const newData = []
|
||||
|
||||
for (let i = 0; i < table.tBodies[0].rows.length; i++) {
|
||||
|
|
@ -111,35 +88,15 @@ $.BootstrapTable = class extends $.BootstrapTable {
|
|||
const draggingRow = this.data[this.draggingIndex]
|
||||
const droppedIndex = newData.indexOf(this.data[this.draggingIndex])
|
||||
const droppedRow = this.data[droppedIndex]
|
||||
const index = (pageNum - 1) * pageSize + this.options.data.indexOf(this.data[droppedIndex])
|
||||
const index = this.options.data.indexOf(this.data[droppedIndex])
|
||||
|
||||
this.options.data.splice(this.options.data.indexOf(draggingRow), 1)
|
||||
this.options.data.splice(index, 0, draggingRow)
|
||||
|
||||
this.initSearch()
|
||||
|
||||
if (this.options.sidePagination === 'server') {
|
||||
this.data = [...this.options.data]
|
||||
}
|
||||
|
||||
// Call the user defined function
|
||||
this.options.onReorderRowsDrop(droppedRow)
|
||||
|
||||
// Call the event reorder-row
|
||||
this.trigger('reorder-row', newData, draggingRow, droppedRow)
|
||||
}
|
||||
|
||||
initSearch () {
|
||||
this.ignoreInitSort = true
|
||||
super.initSearch()
|
||||
}
|
||||
|
||||
initSort () {
|
||||
if (this.ignoreInitSort) {
|
||||
this.ignoreInitSort = false
|
||||
return
|
||||
}
|
||||
|
||||
super.initSort()
|
||||
}
|
||||
}
|
||||
|
|
@ -1,5 +1,6 @@
|
|||
/**
|
||||
* @author: Dennis Hernández
|
||||
* @webSite: http://djhvscf.github.io/Blog
|
||||
* @version: v2.0.0
|
||||
*/
|
||||
|
||||
|
|
@ -29,7 +30,7 @@ const reInitResizable = that => {
|
|||
initResizable(that)
|
||||
}
|
||||
|
||||
Object.assign($.fn.bootstrapTable.defaults, {
|
||||
$.extend($.fn.bootstrapTable.defaults, {
|
||||
resizable: false
|
||||
})
|
||||
|
||||
|
|
@ -42,8 +43,6 @@ $.BootstrapTable = class extends $.BootstrapTable {
|
|||
.on('column-switch.bs.table page-change.bs.table', () => {
|
||||
reInitResizable(this)
|
||||
})
|
||||
|
||||
reInitResizable(this)
|
||||
}
|
||||
|
||||
toggleView (...args) {
|
||||
|
|
|
|||
File diff suppressed because one or more lines are too long
|
|
@ -14,14 +14,12 @@
|
|||
}
|
||||
// 如果是初始化组件
|
||||
options = $.extend({}, $.fn.bootstrapTreeTable.defaults, options || {});
|
||||
target.hasSelectItem = false; // 是否有radio或checkbox
|
||||
target.data_list = null; // 用于缓存格式化后的数据-按父分组
|
||||
target.data_obj = null; // 用于缓存格式化后的数据-按id存对象
|
||||
target.hiddenColumns = []; // 用于存放被隐藏列的field
|
||||
target.lastAjaxParams; // 用户最后一次请求的参数
|
||||
target.isFixWidth=false; // 是否有固定宽度
|
||||
target.totalRows = 0; // 记录总数
|
||||
target.totalPages = 0; // 总页数
|
||||
target.hasSelectItem = false;// 是否有radio或checkbox
|
||||
target.data_list = null; //用于缓存格式化后的数据-按父分组
|
||||
target.data_obj = null; //用于缓存格式化后的数据-按id存对象
|
||||
target.hiddenColumns = []; //用于存放被隐藏列的field
|
||||
target.lastAjaxParams; //用户最后一次请求的参数
|
||||
target.isFixWidth=false; //是否有固定宽度
|
||||
// 初始化
|
||||
var init = function() {
|
||||
// 初始化容器
|
||||
|
|
@ -131,9 +129,6 @@
|
|||
$th = $('<th style="width:36px"></th>');
|
||||
} else {
|
||||
$th = $('<th style="' + ((column.width) ? ('width:' + column.width + ((column.widthUnit) ? column.widthUnit : 'px')) : '') + '" class="' + column.field + '_cls"></th>');
|
||||
if (column.align) {
|
||||
$th.css("text-align", column.align);
|
||||
}
|
||||
}
|
||||
if((!target.isFixWidth)&& column.width){
|
||||
target.isFixWidth = column.width.indexOf("px")>-1?true:false;
|
||||
|
|
@ -153,30 +148,12 @@
|
|||
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>'
|
||||
|
|
@ -185,8 +162,8 @@
|
|||
$.ajax({
|
||||
type: options.type,
|
||||
url: options.url,
|
||||
data: $.extend(parms, options.ajaxParams),
|
||||
dataType: "json",
|
||||
data: parms ? parms : options.ajaxParams,
|
||||
dataType: "JSON",
|
||||
success: function(data, textStatus, jqXHR) {
|
||||
data = calculateObjectValue(options, options.responseHandler, [data], data);
|
||||
renderTable(data);
|
||||
|
|
@ -195,7 +172,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);
|
||||
|
|
@ -203,25 +180,12 @@
|
|||
}
|
||||
// 加载完数据后渲染表格
|
||||
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("");
|
||||
if (!data || data.length <= 0) {
|
||||
var _empty = '<tr><td colspan="' + options.columns.length + '"><div style="display: block;text-align: center;">没有找到匹配的记录</div></td></tr>'
|
||||
$tbody.html(_empty);
|
||||
options.pageNumber = 1;
|
||||
initPagination(0, 0);
|
||||
return;
|
||||
}
|
||||
// 缓存并格式化数据
|
||||
|
|
@ -232,24 +196,22 @@
|
|||
if (rootNode) {
|
||||
$.each(rootNode, function(i, item) {
|
||||
var _child_row_id = "row_id_" + i
|
||||
recursionNode(item, 1, _child_row_id, "row_root", item[options.code]);
|
||||
recursionNode(item, 1, _child_row_id, "row_root");
|
||||
});
|
||||
}
|
||||
// 下边的操作主要是为了查询时让一些没有根节点的节点显示
|
||||
$.each(data, function(i, item) {
|
||||
if (!item.isShow) {
|
||||
var tr = renderRow(item, false, 1, "", "", options.pagination, item[options.code]);
|
||||
var tr = renderRow(item, false, 1, "", "");
|
||||
$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();
|
||||
|
|
@ -267,183 +229,6 @@
|
|||
$(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;
|
||||
}
|
||||
if (pageFrom > pageTo) {
|
||||
pageFrom = pageTo;
|
||||
}
|
||||
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){
|
||||
|
|
@ -484,14 +269,6 @@
|
|||
$.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 ||
|
||||
|
|
@ -518,26 +295,26 @@
|
|||
});
|
||||
}
|
||||
// 递归获取子节点并且设置子节点
|
||||
var recursionNode = function(parentNode, lv, row_id, p_id, k) {
|
||||
var recursionNode = function(parentNode, lv, row_id, p_id) {
|
||||
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, options.pagination, k);
|
||||
var $tr = renderRow(parentNode, _ls ? true : false, lv, row_id, p_id);
|
||||
$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, item[options.code])
|
||||
recursionNode(item, (lv + 1), _child_row_id, row_id)
|
||||
});
|
||||
}
|
||||
};
|
||||
// 绘制行
|
||||
var renderRow = function(item, isP, lv, row_id, p_id, _pagination, k) {
|
||||
var renderRow = function(item, isP, lv, row_id, p_id) {
|
||||
// 标记已显示
|
||||
item.isShow = true;
|
||||
item.row_id = row_id;
|
||||
item.p_id = p_id;
|
||||
item.lv = lv;
|
||||
var $tr = $('<tr id="' + row_id + '" data-id="' + k + '"pid="' + p_id + '"></tr>');
|
||||
var $tr = $('<tr id="' + row_id + '" pid="' + p_id + '"></tr>');
|
||||
var _icon = options.expanderCollapsedClass;
|
||||
if (options.expandAll) {
|
||||
$tr.css("display", "table");
|
||||
|
|
@ -552,10 +329,6 @@
|
|||
$tr.css("display", "none");
|
||||
}
|
||||
_icon = options.expanderCollapsedClass;
|
||||
} else if (_pagination) {
|
||||
if (item.isTreeLeaf) {
|
||||
_icon = options.expanderCollapsedClass;
|
||||
}
|
||||
} else {
|
||||
$tr.css("display", "none");
|
||||
_icon = options.expanderCollapsedClass;
|
||||
|
|
@ -602,20 +375,12 @@
|
|||
$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 - options.expandColumn); int++) {
|
||||
for (var int = 0; int < (lv - 1); int++) {
|
||||
$td.prepend('<span class="treetable-indent"></span>')
|
||||
}
|
||||
}
|
||||
|
|
@ -675,8 +440,6 @@
|
|||
$(this).addClass("treetable-selected");
|
||||
}
|
||||
}
|
||||
var _rowData = target.data_obj["id_" + $(this).data('id')];
|
||||
calculateObjectValue(options, options.onClickRow, [_rowData], _rowData);
|
||||
}
|
||||
});
|
||||
}
|
||||
|
|
@ -689,9 +452,7 @@
|
|||
if (_isExpanded || _isCollapsed) {
|
||||
var tr = $(this).parent().parent();
|
||||
var row_id = tr.attr("id");
|
||||
var _id = tr.attr("data-id");
|
||||
var _ls = target.find("tbody").find("tr[id^='" + row_id + "_']");
|
||||
if (!options.pagination) {
|
||||
var _ls = target.find("tbody").find("tr[id^='" + row_id + "_']"); //下所有
|
||||
if (_isExpanded) {
|
||||
$(this).removeClass(options.expanderExpandedClass);
|
||||
$(this).addClass(options.expanderCollapsedClass);
|
||||
|
|
@ -705,63 +466,14 @@
|
|||
$(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");
|
||||
var _p_display = $("#" + $(item).attr("pid")).css('display');
|
||||
if (_p_icon.hasClass(options.expanderExpandedClass) && _p_display == 'table') {
|
||||
if (_p_icon.hasClass(options.expanderExpandedClass)) {
|
||||
$(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: parms,
|
||||
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);
|
||||
}
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
|
|
@ -774,12 +486,8 @@
|
|||
}
|
||||
// 添加数据刷新表格
|
||||
target.appendData = function(data) {
|
||||
data.reverse()
|
||||
// 下边的操作主要是为了查询时让一些没有根节点的节点显示
|
||||
$.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]];
|
||||
|
|
@ -801,7 +509,7 @@
|
|||
}
|
||||
_lv = _p_data.lv + 1; //如果有父
|
||||
// 绘制行
|
||||
tr = renderRow(item, true, _lv, row_id, p_id, options.pagination, item[options.code]);
|
||||
tr = renderRow(item, false, _lv, row_id, p_id);
|
||||
|
||||
var _p_icon = $("#" + _p_data.row_id).children().eq(options.expandColumn).find(".treetable-expander");
|
||||
var _isExpanded = _p_icon.hasClass(options.expanderExpandedClass);
|
||||
|
|
@ -823,11 +531,12 @@
|
|||
} else {
|
||||
// 计算父的同级下一行
|
||||
var _tmp_ls = _p_data.row_id.split("_");
|
||||
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);
|
||||
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);
|
||||
}
|
||||
} else {
|
||||
tr = renderRow(item, false, _lv, row_id, p_id, options.pagination, item[options.code]);
|
||||
tr = renderRow(item, false, _lv, row_id, p_id);
|
||||
if (_data) {
|
||||
$("#" + _data.row_id).before(tr);
|
||||
$("#" + _data.row_id).remove();
|
||||
|
|
@ -951,12 +660,6 @@
|
|||
}
|
||||
return defaultValue;
|
||||
};
|
||||
var formatRecordsPerPage = function (pageNumber) {
|
||||
return '每页显示 ' + pageNumber + ' 条记录';
|
||||
};
|
||||
var formatShowingRows = function (pageFrom, pageTo, totalRows) {
|
||||
return '显示第 ' + pageFrom + ' 到第 ' + pageTo + ' 条记录,总共 ' + totalRows + ' 条记录。';
|
||||
};
|
||||
// 初始化
|
||||
init();
|
||||
return target;
|
||||
|
|
@ -1029,12 +732,12 @@
|
|||
$.fn.bootstrapTreeTable.defaults = {
|
||||
code: 'code', // 选取记录返回的值,用于设置父子关系
|
||||
parentCode: 'parentCode', // 用于设置父子关系
|
||||
rootIdValue: 0, // 设置根节点id值----可指定根节点,默认为null,"",0,"0"
|
||||
rootIdValue: null, // 设置根节点id值----可指定根节点,默认为null,"",0,"0"
|
||||
data: null, // 构造table的数据集合
|
||||
type: "GET", // 请求数据的ajax类型
|
||||
url: null, // 请求数据的ajax的url
|
||||
ajaxParams: {}, // 请求数据的ajax的data属性
|
||||
expandColumn: 1, // 在哪一列上面显示展开按钮
|
||||
expandColumn: 0, // 在哪一列上面显示展开按钮
|
||||
expandAll: false, // 是否全部展开
|
||||
expandFirst: true, // 是否默认第一级展开--expandAll为false时生效
|
||||
striped: false, // 是否各行渐变色
|
||||
|
|
@ -1044,18 +747,10 @@
|
|||
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
|
|
@ -1,11 +1,11 @@
|
|||
/*!
|
||||
* Cropper.js v1.5.12
|
||||
* Cropper.js v1.5.7
|
||||
* https://fengyuanchen.github.io/cropperjs
|
||||
*
|
||||
* Copyright 2015-present Chen Fengyuan
|
||||
* Released under the MIT license
|
||||
*
|
||||
* Date: 2021-06-12T08:00:11.623Z
|
||||
* Date: 2020-05-23T05:22:57.283Z
|
||||
*/
|
||||
|
||||
.cropper-container {
|
||||
|
|
|
|||
|
|
@ -1,57 +1,19 @@
|
|||
/*!
|
||||
* Cropper.js v1.5.12
|
||||
* Cropper.js v1.5.7
|
||||
* https://fengyuanchen.github.io/cropperjs
|
||||
*
|
||||
* Copyright 2015-present Chen Fengyuan
|
||||
* Released under the MIT license
|
||||
*
|
||||
* Date: 2021-06-12T08:00:17.411Z
|
||||
* Date: 2020-05-23T05:23:00.081Z
|
||||
*/
|
||||
|
||||
(function (global, factory) {
|
||||
typeof exports === 'object' && typeof module !== 'undefined' ? module.exports = factory() :
|
||||
typeof define === 'function' && define.amd ? define(factory) :
|
||||
(global = typeof globalThis !== 'undefined' ? globalThis : global || self, global.Cropper = factory());
|
||||
(global = global || self, global.Cropper = factory());
|
||||
}(this, (function () { 'use strict';
|
||||
|
||||
function ownKeys(object, enumerableOnly) {
|
||||
var keys = Object.keys(object);
|
||||
|
||||
if (Object.getOwnPropertySymbols) {
|
||||
var symbols = Object.getOwnPropertySymbols(object);
|
||||
|
||||
if (enumerableOnly) {
|
||||
symbols = symbols.filter(function (sym) {
|
||||
return Object.getOwnPropertyDescriptor(object, sym).enumerable;
|
||||
});
|
||||
}
|
||||
|
||||
keys.push.apply(keys, symbols);
|
||||
}
|
||||
|
||||
return keys;
|
||||
}
|
||||
|
||||
function _objectSpread2(target) {
|
||||
for (var i = 1; i < arguments.length; i++) {
|
||||
var source = arguments[i] != null ? arguments[i] : {};
|
||||
|
||||
if (i % 2) {
|
||||
ownKeys(Object(source), true).forEach(function (key) {
|
||||
_defineProperty(target, key, source[key]);
|
||||
});
|
||||
} else if (Object.getOwnPropertyDescriptors) {
|
||||
Object.defineProperties(target, Object.getOwnPropertyDescriptors(source));
|
||||
} else {
|
||||
ownKeys(Object(source)).forEach(function (key) {
|
||||
Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key));
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
return target;
|
||||
}
|
||||
|
||||
function _typeof(obj) {
|
||||
"@babel/helpers - typeof";
|
||||
|
||||
|
|
@ -105,6 +67,40 @@
|
|||
return obj;
|
||||
}
|
||||
|
||||
function ownKeys(object, enumerableOnly) {
|
||||
var keys = Object.keys(object);
|
||||
|
||||
if (Object.getOwnPropertySymbols) {
|
||||
var symbols = Object.getOwnPropertySymbols(object);
|
||||
if (enumerableOnly) symbols = symbols.filter(function (sym) {
|
||||
return Object.getOwnPropertyDescriptor(object, sym).enumerable;
|
||||
});
|
||||
keys.push.apply(keys, symbols);
|
||||
}
|
||||
|
||||
return keys;
|
||||
}
|
||||
|
||||
function _objectSpread2(target) {
|
||||
for (var i = 1; i < arguments.length; i++) {
|
||||
var source = arguments[i] != null ? arguments[i] : {};
|
||||
|
||||
if (i % 2) {
|
||||
ownKeys(Object(source), true).forEach(function (key) {
|
||||
_defineProperty(target, key, source[key]);
|
||||
});
|
||||
} else if (Object.getOwnPropertyDescriptors) {
|
||||
Object.defineProperties(target, Object.getOwnPropertyDescriptors(source));
|
||||
} else {
|
||||
ownKeys(Object(source)).forEach(function (key) {
|
||||
Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key));
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
return target;
|
||||
}
|
||||
|
||||
function _toConsumableArray(arr) {
|
||||
return _arrayWithoutHoles(arr) || _iterableToArray(arr) || _unsupportedIterableToArray(arr) || _nonIterableSpread();
|
||||
}
|
||||
|
|
@ -114,7 +110,7 @@
|
|||
}
|
||||
|
||||
function _iterableToArray(iter) {
|
||||
if (typeof Symbol !== "undefined" && iter[Symbol.iterator] != null || iter["@@iterator"] != null) return Array.from(iter);
|
||||
if (typeof Symbol !== "undefined" && Symbol.iterator in Object(iter)) return Array.from(iter);
|
||||
}
|
||||
|
||||
function _unsupportedIterableToArray(o, minLen) {
|
||||
|
|
@ -194,10 +190,6 @@
|
|||
var REGEXP_DATA_URL = /^data:/;
|
||||
var REGEXP_DATA_URL_JPEG = /^data:image\/jpeg;base64,/;
|
||||
var REGEXP_TAG_NAME = /^img|canvas$/i; // Misc
|
||||
// Inspired by the default width and height of a canvas element.
|
||||
|
||||
var MIN_CONTAINER_WIDTH = 200;
|
||||
var MIN_CONTAINER_HEIGHT = 100;
|
||||
|
||||
var DEFAULTS = {
|
||||
// Define the view mode of the cropper
|
||||
|
|
@ -261,8 +253,8 @@
|
|||
minCanvasHeight: 0,
|
||||
minCropBoxWidth: 0,
|
||||
minCropBoxHeight: 0,
|
||||
minContainerWidth: MIN_CONTAINER_WIDTH,
|
||||
minContainerHeight: MIN_CONTAINER_HEIGHT,
|
||||
minContainerWidth: 200,
|
||||
minContainerHeight: 100,
|
||||
// Shortcuts of events
|
||||
ready: null,
|
||||
cropstart: null,
|
||||
|
|
@ -810,7 +802,7 @@
|
|||
function getMaxZoomRatio(pointers) {
|
||||
var pointers2 = _objectSpread2({}, pointers);
|
||||
|
||||
var maxRatio = 0;
|
||||
var ratios = [];
|
||||
forEach(pointers, function (pointer, pointerId) {
|
||||
delete pointers2[pointerId];
|
||||
forEach(pointers2, function (pointer2) {
|
||||
|
|
@ -821,13 +813,13 @@
|
|||
var z1 = Math.sqrt(x1 * x1 + y1 * y1);
|
||||
var z2 = Math.sqrt(x2 * x2 + y2 * y2);
|
||||
var ratio = (z2 - z1) / z1;
|
||||
|
||||
if (Math.abs(ratio) > Math.abs(maxRatio)) {
|
||||
maxRatio = ratio;
|
||||
}
|
||||
ratios.push(ratio);
|
||||
});
|
||||
});
|
||||
return maxRatio;
|
||||
ratios.sort(function (a, b) {
|
||||
return Math.abs(a) < Math.abs(b);
|
||||
});
|
||||
return ratios[0];
|
||||
}
|
||||
/**
|
||||
* Get a pointer from an event object.
|
||||
|
|
@ -1231,13 +1223,11 @@
|
|||
options = this.options,
|
||||
container = this.container,
|
||||
cropper = this.cropper;
|
||||
var minWidth = Number(options.minContainerWidth);
|
||||
var minHeight = Number(options.minContainerHeight);
|
||||
addClass(cropper, CLASS_HIDDEN);
|
||||
removeClass(element, CLASS_HIDDEN);
|
||||
var containerData = {
|
||||
width: Math.max(container.offsetWidth, minWidth >= 0 ? minWidth : MIN_CONTAINER_WIDTH),
|
||||
height: Math.max(container.offsetHeight, minHeight >= 0 ? minHeight : MIN_CONTAINER_HEIGHT)
|
||||
width: Math.max(container.offsetWidth, Number(options.minContainerWidth) || 200),
|
||||
height: Math.max(container.offsetHeight, Number(options.minContainerHeight) || 100)
|
||||
};
|
||||
this.containerData = containerData;
|
||||
setStyle(cropper, {
|
||||
|
|
@ -1278,15 +1268,14 @@
|
|||
width: canvasWidth,
|
||||
height: canvasHeight
|
||||
};
|
||||
canvasData.left = (containerData.width - canvasWidth) / 2;
|
||||
canvasData.top = (containerData.height - canvasHeight) / 2;
|
||||
canvasData.oldLeft = canvasData.left;
|
||||
canvasData.oldTop = canvasData.top;
|
||||
this.canvasData = canvasData;
|
||||
this.limited = viewMode === 1 || viewMode === 2;
|
||||
this.limitCanvas(true, true);
|
||||
canvasData.width = Math.min(Math.max(canvasData.width, canvasData.minWidth), canvasData.maxWidth);
|
||||
canvasData.height = Math.min(Math.max(canvasData.height, canvasData.minHeight), canvasData.maxHeight);
|
||||
canvasData.left = (containerData.width - canvasData.width) / 2;
|
||||
canvasData.top = (containerData.height - canvasData.height) / 2;
|
||||
canvasData.oldLeft = canvasData.left;
|
||||
canvasData.oldTop = canvasData.top;
|
||||
this.initialImageData = assign({}, imageData);
|
||||
this.initialCanvasData = assign({}, canvasData);
|
||||
},
|
||||
limitCanvas: function limitCanvas(sizeLimited, positionLimited) {
|
||||
|
|
@ -1820,11 +1809,9 @@
|
|||
var options = this.options,
|
||||
container = this.container,
|
||||
containerData = this.containerData;
|
||||
var ratioX = container.offsetWidth / containerData.width;
|
||||
var ratioY = container.offsetHeight / containerData.height;
|
||||
var ratio = Math.abs(ratioX - 1) > Math.abs(ratioY - 1) ? ratioX : ratioY; // Resize when width changed or height changed
|
||||
var ratio = container.offsetWidth / containerData.width; // Resize when width changed or height changed
|
||||
|
||||
if (ratio !== 1) {
|
||||
if (ratio !== 1 || container.offsetHeight !== containerData.height) {
|
||||
var canvasData;
|
||||
var cropBoxData;
|
||||
|
||||
|
|
@ -3344,10 +3331,9 @@
|
|||
|
||||
if (options.checkCrossOrigin && isCrossOriginURL(url) && element.crossOrigin) {
|
||||
url = addTimestamp(url);
|
||||
} // The third parameter is required for avoiding side-effect (#682)
|
||||
}
|
||||
|
||||
|
||||
xhr.open('GET', url, true);
|
||||
xhr.open('GET', url);
|
||||
xhr.responseType = 'arraybuffer';
|
||||
xhr.withCredentials = element.crossOrigin === 'use-credentials';
|
||||
xhr.send();
|
||||
|
|
@ -3438,7 +3424,6 @@
|
|||
naturalHeight: naturalHeight,
|
||||
aspectRatio: naturalWidth / naturalHeight
|
||||
});
|
||||
_this2.initialImageData = assign({}, _this2.imageData);
|
||||
_this2.sizing = false;
|
||||
_this2.sized = true;
|
||||
|
||||
|
|
|
|||
|
|
@ -1,9 +1,9 @@
|
|||
/*!
|
||||
* Cropper.js v1.5.12
|
||||
* Cropper.js v1.5.7
|
||||
* https://fengyuanchen.github.io/cropperjs
|
||||
*
|
||||
* Copyright 2015-present Chen Fengyuan
|
||||
* Released under the MIT license
|
||||
*
|
||||
* Date: 2021-06-12T08:00:11.623Z
|
||||
*/.cropper-container{direction:ltr;font-size:0;line-height:0;position:relative;-ms-touch-action:none;touch-action:none;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none}.cropper-container img{image-orientation:0deg;display:block;height:100%;max-height:none!important;max-width:none!important;min-height:0!important;min-width:0!important;width:100%}.cropper-canvas,.cropper-crop-box,.cropper-drag-box,.cropper-modal,.cropper-wrap-box{bottom:0;left:0;position:absolute;right:0;top:0}.cropper-canvas,.cropper-wrap-box{overflow:hidden}.cropper-drag-box{background-color:#fff;opacity:0}.cropper-modal{background-color:#000;opacity:.5}.cropper-view-box{display:block;height:100%;outline:1px solid #39f;outline-color:rgba(51,153,255,.75);overflow:hidden;width:100%}.cropper-dashed{border:0 dashed #eee;display:block;opacity:.5;position:absolute}.cropper-dashed.dashed-h{border-bottom-width:1px;border-top-width:1px;height:33.33333%;left:0;top:33.33333%;width:100%}.cropper-dashed.dashed-v{border-left-width:1px;border-right-width:1px;height:100%;left:33.33333%;top:0;width:33.33333%}.cropper-center{display:block;height:0;left:50%;opacity:.75;position:absolute;top:50%;width:0}.cropper-center:after,.cropper-center:before{background-color:#eee;content:" ";display:block;position:absolute}.cropper-center:before{height:1px;left:-3px;top:0;width:7px}.cropper-center:after{height:7px;left:0;top:-3px;width:1px}.cropper-face,.cropper-line,.cropper-point{display:block;height:100%;opacity:.1;position:absolute;width:100%}.cropper-face{background-color:#fff;left:0;top:0}.cropper-line{background-color:#39f}.cropper-line.line-e{cursor:ew-resize;right:-3px;top:0;width:5px}.cropper-line.line-n{cursor:ns-resize;height:5px;left:0;top:-3px}.cropper-line.line-w{cursor:ew-resize;left:-3px;top:0;width:5px}.cropper-line.line-s{bottom:-3px;cursor:ns-resize;height:5px;left:0}.cropper-point{background-color:#39f;height:5px;opacity:.75;width:5px}.cropper-point.point-e{cursor:ew-resize;margin-top:-3px;right:-3px;top:50%}.cropper-point.point-n{cursor:ns-resize;left:50%;margin-left:-3px;top:-3px}.cropper-point.point-w{cursor:ew-resize;left:-3px;margin-top:-3px;top:50%}.cropper-point.point-s{bottom:-3px;cursor:s-resize;left:50%;margin-left:-3px}.cropper-point.point-ne{cursor:nesw-resize;right:-3px;top:-3px}.cropper-point.point-nw{cursor:nwse-resize;left:-3px;top:-3px}.cropper-point.point-sw{bottom:-3px;cursor:nesw-resize;left:-3px}.cropper-point.point-se{bottom:-3px;cursor:nwse-resize;height:20px;opacity:1;right:-3px;width:20px}@media (min-width:768px){.cropper-point.point-se{height:15px;width:15px}}@media (min-width:992px){.cropper-point.point-se{height:10px;width:10px}}@media (min-width:1200px){.cropper-point.point-se{height:5px;opacity:.75;width:5px}}.cropper-point.point-se:before{background-color:#39f;bottom:-50%;content:" ";display:block;height:200%;opacity:0;position:absolute;right:-50%;width:200%}.cropper-invisible{opacity:0}.cropper-bg{background-image:url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQAQMAAAAlPW0iAAAAA3NCSVQICAjb4U/gAAAABlBMVEXMzMz////TjRV2AAAACXBIWXMAAArrAAAK6wGCiw1aAAAAHHRFWHRTb2Z0d2FyZQBBZG9iZSBGaXJld29ya3MgQ1M26LyyjAAAABFJREFUCJlj+M/AgBVhF/0PAH6/D/HkDxOGAAAAAElFTkSuQmCC")}.cropper-hide{display:block;height:0;position:absolute;width:0}.cropper-hidden{display:none!important}.cropper-move{cursor:move}.cropper-crop{cursor:crosshair}.cropper-disabled .cropper-drag-box,.cropper-disabled .cropper-face,.cropper-disabled .cropper-line,.cropper-disabled .cropper-point{cursor:not-allowed}
|
||||
* Date: 2020-05-23T05:22:57.283Z
|
||||
*/.cropper-container{direction:ltr;font-size:0;line-height:0;position:relative;-ms-touch-action:none;touch-action:none;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none}.cropper-container img{display:block;height:100%;image-orientation:0deg;max-height:none!important;max-width:none!important;min-height:0!important;min-width:0!important;width:100%}.cropper-canvas,.cropper-crop-box,.cropper-drag-box,.cropper-modal,.cropper-wrap-box{bottom:0;left:0;position:absolute;right:0;top:0}.cropper-canvas,.cropper-wrap-box{overflow:hidden}.cropper-drag-box{background-color:#fff;opacity:0}.cropper-modal{background-color:#000;opacity:.5}.cropper-view-box{display:block;height:100%;outline:1px solid #39f;outline-color:rgba(51,153,255,.75);overflow:hidden;width:100%}.cropper-dashed{border:0 dashed #eee;display:block;opacity:.5;position:absolute}.cropper-dashed.dashed-h{border-bottom-width:1px;border-top-width:1px;height:33.33333%;left:0;top:33.33333%;width:100%}.cropper-dashed.dashed-v{border-left-width:1px;border-right-width:1px;height:100%;left:33.33333%;top:0;width:33.33333%}.cropper-center{display:block;height:0;left:50%;opacity:.75;position:absolute;top:50%;width:0}.cropper-center:after,.cropper-center:before{background-color:#eee;content:" ";display:block;position:absolute}.cropper-center:before{height:1px;left:-3px;top:0;width:7px}.cropper-center:after{height:7px;left:0;top:-3px;width:1px}.cropper-face,.cropper-line,.cropper-point{display:block;height:100%;opacity:.1;position:absolute;width:100%}.cropper-face{background-color:#fff;left:0;top:0}.cropper-line{background-color:#39f}.cropper-line.line-e{cursor:ew-resize;right:-3px;top:0;width:5px}.cropper-line.line-n{cursor:ns-resize;height:5px;left:0;top:-3px}.cropper-line.line-w{cursor:ew-resize;left:-3px;top:0;width:5px}.cropper-line.line-s{bottom:-3px;cursor:ns-resize;height:5px;left:0}.cropper-point{background-color:#39f;height:5px;opacity:.75;width:5px}.cropper-point.point-e{cursor:ew-resize;margin-top:-3px;right:-3px;top:50%}.cropper-point.point-n{cursor:ns-resize;left:50%;margin-left:-3px;top:-3px}.cropper-point.point-w{cursor:ew-resize;left:-3px;margin-top:-3px;top:50%}.cropper-point.point-s{bottom:-3px;cursor:s-resize;left:50%;margin-left:-3px}.cropper-point.point-ne{cursor:nesw-resize;right:-3px;top:-3px}.cropper-point.point-nw{cursor:nwse-resize;left:-3px;top:-3px}.cropper-point.point-sw{bottom:-3px;cursor:nesw-resize;left:-3px}.cropper-point.point-se{bottom:-3px;cursor:nwse-resize;height:20px;opacity:1;right:-3px;width:20px}@media (min-width:768px){.cropper-point.point-se{height:15px;width:15px}}@media (min-width:992px){.cropper-point.point-se{height:10px;width:10px}}@media (min-width:1200px){.cropper-point.point-se{height:5px;opacity:.75;width:5px}}.cropper-point.point-se:before{background-color:#39f;bottom:-50%;content:" ";display:block;height:200%;opacity:0;position:absolute;right:-50%;width:200%}.cropper-invisible{opacity:0}.cropper-bg{background-image:url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQAQMAAAAlPW0iAAAAA3NCSVQICAjb4U/gAAAABlBMVEXMzMz////TjRV2AAAACXBIWXMAAArrAAAK6wGCiw1aAAAAHHRFWHRTb2Z0d2FyZQBBZG9iZSBGaXJld29ya3MgQ1M26LyyjAAAABFJREFUCJlj+M/AgBVhF/0PAH6/D/HkDxOGAAAAAElFTkSuQmCC")}.cropper-hide{display:block;height:0;position:absolute;width:0}.cropper-hidden{display:none!important}.cropper-move{cursor:move}.cropper-crop{cursor:crosshair}.cropper-disabled .cropper-drag-box,.cropper-disabled .cropper-face,.cropper-disabled .cropper-line,.cropper-disabled .cropper-point{cursor:not-allowed}
|
||||
File diff suppressed because one or more lines are too long
|
|
@ -1,5 +1,5 @@
|
|||
/*
|
||||
* Bootstrap Duallistbox - v3.0.9
|
||||
* Bootstrap Duallistbox - v3.0.7
|
||||
* A responsive dual listbox widget optimized for Twitter Bootstrap. It works on all modern browsers and on touch devices.
|
||||
* https://www.virtuosoft.eu/code/bootstrap-duallistbox/
|
||||
*
|
||||
|
|
|
|||
|
|
@ -1,5 +1,5 @@
|
|||
/*
|
||||
* Bootstrap Duallistbox - v3.0.9
|
||||
* Bootstrap Duallistbox - v3.0.7
|
||||
* A responsive dual listbox widget optimized for Twitter Bootstrap. It works on all modern browsers and on touch devices.
|
||||
* https://www.virtuosoft.eu/code/bootstrap-duallistbox/
|
||||
*
|
||||
|
|
@ -206,13 +206,10 @@
|
|||
selectopt.detach().appendTo(select);
|
||||
}
|
||||
|
||||
function sortOptions(select, dualListbox) {
|
||||
function sortOptions(select) {
|
||||
select.find('option').sort(function(a, b) {
|
||||
return ($(a).data('original-index') > $(b).data('original-index')) ? 1 : -1;
|
||||
}).appendTo(select);
|
||||
|
||||
// workaround for chromium bug: https://bugs.chromium.org/p/chromium/issues/detail?id=1072475
|
||||
refreshSelects(dualListbox);
|
||||
}
|
||||
|
||||
function clearSelections(dualListbox) {
|
||||
|
|
@ -241,7 +238,7 @@
|
|||
if(dualListbox.settings.sortByInputOrder){
|
||||
sortOptionsByInputOrder(dualListbox.elements.select2);
|
||||
} else {
|
||||
sortOptions(dualListbox.elements.select2, dualListbox);
|
||||
sortOptions(dualListbox.elements.select2);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -262,7 +259,7 @@
|
|||
|
||||
refreshSelects(dualListbox);
|
||||
triggerChangeEvent(dualListbox);
|
||||
sortOptions(dualListbox.elements.select1, dualListbox);
|
||||
sortOptions(dualListbox.elements.select1);
|
||||
if(dualListbox.settings.sortByInputOrder){
|
||||
sortOptionsByInputOrder(dualListbox.elements.select2);
|
||||
}
|
||||
|
|
@ -487,17 +484,17 @@
|
|||
if (value) {
|
||||
this.container.removeClass('row').addClass('row-fluid bs2compatible');
|
||||
this.container.find('.box1, .box2').removeClass('col-md-6').addClass('span6');
|
||||
this.container.find('.clear1, .clear2').removeClass('btn-default btn-xs').addClass('btn-mini');
|
||||
this.container.find('.clear1, .clear2').removeClass('btn-white btn-xs').addClass('btn-mini');
|
||||
this.container.find('input, select').removeClass('form-control');
|
||||
this.container.find('.btn').removeClass('btn-default');
|
||||
this.container.find('.btn').removeClass('btn-white');
|
||||
this.container.find('.moveall > i, .move > i').removeClass('glyphicon glyphicon-arrow-right').addClass('icon-arrow-right');
|
||||
this.container.find('.removeall > i, .remove > i').removeClass('glyphicon glyphicon-arrow-left').addClass('icon-arrow-left');
|
||||
} else {
|
||||
this.container.removeClass('row-fluid bs2compatible').addClass('row');
|
||||
this.container.find('.box1, .box2').removeClass('span6').addClass('col-md-6');
|
||||
this.container.find('.clear1, .clear2').removeClass('btn-mini').addClass('btn-default btn-xs');
|
||||
this.container.find('.clear1, .clear2').removeClass('btn-mini').addClass('btn-white btn-xs');
|
||||
this.container.find('input, select').addClass('form-control');
|
||||
this.container.find('.btn').addClass('btn-default');
|
||||
this.container.find('.btn').addClass('btn-white');
|
||||
this.container.find('.moveall > i, .move > i').removeClass('icon-arrow-right').addClass('glyphicon glyphicon-arrow-right');
|
||||
this.container.find('.removeall > i, .remove > i').removeClass('icon-arrow-left').addClass('glyphicon glyphicon-arrow-left');
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,9 +1 @@
|
|||
/*
|
||||
* Bootstrap Duallistbox - v3.0.9
|
||||
* A responsive dual listbox widget optimized for Twitter Bootstrap. It works on all modern browsers and on touch devices.
|
||||
* https://www.virtuosoft.eu/code/bootstrap-duallistbox/
|
||||
*
|
||||
* Made by István Ujj-Mészáros
|
||||
* Under Apache License v2.0 License
|
||||
*/
|
||||
.bootstrap-duallistbox-container .buttons{width:100%;margin-bottom:-1px}.bootstrap-duallistbox-container label{display:block}.bootstrap-duallistbox-container .info{display:inline-block;margin-bottom:5px;font-size:11px}.bootstrap-duallistbox-container .clear1,.bootstrap-duallistbox-container .clear2{display:none;font-size:10px}.bootstrap-duallistbox-container .box1.filtered .clear1,.bootstrap-duallistbox-container .box2.filtered .clear2{display:inline-block}.bootstrap-duallistbox-container .move,.bootstrap-duallistbox-container .remove{width:60%}.bootstrap-duallistbox-container .btn-group .btn{border-bottom-left-radius:0;border-bottom-right-radius:0}.bootstrap-duallistbox-container select{border-top-left-radius:0;border-top-right-radius:0}.bootstrap-duallistbox-container .moveall,.bootstrap-duallistbox-container .removeall{width:40%}.bootstrap-duallistbox-container.bs2compatible .btn-group>.btn+.btn{margin-left:0}.bootstrap-duallistbox-container select{width:100%;height:300px;padding:0}.bootstrap-duallistbox-container .filter{display:inline-block;width:100%;height:31px;margin:0 0 5px 0;-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box}.bootstrap-duallistbox-container .filter.placeholder{color:#aaa}.bootstrap-duallistbox-container.moveonselect .move,.bootstrap-duallistbox-container.moveonselect .remove{display:none}.bootstrap-duallistbox-container.moveonselect .moveall,.bootstrap-duallistbox-container.moveonselect .removeall{width:100%}
|
||||
File diff suppressed because one or more lines are too long
|
|
@ -1,11 +1,11 @@
|
|||
/*! iCheck v1.0.3 by Damir Sultanov, https://github.com/dargullin/icheck, MIT Licensed */
|
||||
(function(k){function E(a,b,e){var c=a[0],f=/er/.test(e)?"indeterminate":/bl/.test(e)?"disabled":"checked",d="update"==e?{checked:c.checked,disabled:c.disabled,indeterminate:"true"==a.attr("indeterminate")||"false"==a.attr("determinate")}:c[f];if(/^(ch|di|in)/.test(e)&&!d)B(a,f);else if(/^(un|en|de)/.test(e)&&d)v(a,f);else if("update"==e)for(var l in d)d[l]?B(a,l,!0):v(a,l,!0);else b&&"toggle"!=e||(b||a.trigger("ifClicked"),d?"radio"!==c.type&&v(a,f):B(a,f))}function B(a,b,e){var c=a[0],f=a.parent(),
|
||||
d="checked"==b,l="indeterminate"==b,t="disabled"==b,u=l?"determinate":d?"unchecked":"enabled",x=q(a,u+C(c.type)),y=q(a,b+C(c.type));if(!0!==c[b]){if(!e&&"checked"==b&&"radio"==c.type&&c.name){var z=a.closest("form"),r='input[name="'+c.name+'"]';r=z.length?z.find(r):k(r);r.each(function(){this!==c&&k(this).data("iCheck")&&v(k(this),b)})}l?(c[b]=!0,c.checked&&v(a,"checked","force")):(e||(c[b]=!0),d&&c.indeterminate&&v(a,"indeterminate",!1));I(a,d,b,e)}c.disabled&&q(a,"cursor",!0)&&f.find(".iCheck-helper").css("cursor",
|
||||
"default");f.addClass(y||q(a,b)||"");f.attr("role")&&!l&&f.attr("aria-"+(t?"disabled":"checked"),"true");f.removeClass(x||q(a,u)||"")}function v(a,b,e){var c=a[0],f=a.parent(),d="checked"==b,l="indeterminate"==b,t="disabled"==b,u=l?"determinate":d?"unchecked":"enabled",x=q(a,u+C(c.type)),y=q(a,b+C(c.type));if(!1!==c[b]){if(l||!e||"force"==e)c[b]=!1;I(a,d,u,e)}!c.disabled&&q(a,"cursor",!0)&&f.find(".iCheck-helper").css("cursor","pointer");f.removeClass(y||q(a,b)||"");f.attr("role")&&!l&&f.attr("aria-"+
|
||||
(t?"disabled":"checked"),"false");f.addClass(x||q(a,u)||"")}function J(a,b){a.data("iCheck")&&(a.parent().html(a.attr("style",a.data("iCheck").s||"")),b&&a.trigger(b),a.off(".i").unwrap(),k('label[for="'+a[0].id+'"]').add(a.closest("label")).off(".i"))}function q(a,b,e){if(a.data("iCheck"))return a.data("iCheck").o[b+(e?"":"Class")]}function C(a){return a.charAt(0).toUpperCase()+a.slice(1)}function I(a,b,e,c){c||(b&&a.trigger("ifToggled"),a.trigger("change").trigger("ifChanged").trigger("if"+C(e)))}
|
||||
var G=/ip(hone|od|ad)|android|blackberry|windows phone|opera mini|silk/i.test(navigator.userAgent)||"MacIntel"===navigator.platform&&1<navigator.maxTouchPoints;k.fn.iCheck=function(a,b){var e='input[type="checkbox"], input[type="radio"]',c=k(),f=function(g){g.each(function(){var m=k(this);c=m.is(e)?c.add(m):c.add(m.find(e))})};if(/^(check|uncheck|toggle|indeterminate|determinate|disable|enable|update|destroy)$/i.test(a))return a=a.toLowerCase(),f(this),c.each(function(){var g=k(this);"destroy"==a?
|
||||
J(g,"ifDestroyed"):E(g,!0,a);k.isFunction(b)&&b()});if("object"!=typeof a&&a)return this;var d=k.extend({checkedClass:"checked",disabledClass:"disabled",indeterminateClass:"indeterminate",labelHover:!0},a),l=d.handle,t=d.hoverClass||"hover",u=d.focusClass||"focus",x=d.activeClass||"active",y=!!d.labelHover,z=d.labelHoverClass||"hover",r=(""+d.increaseArea).replace("%","")|0;if("checkbox"==l||"radio"==l)e='input[type="'+l+'"]';-50>r&&(r=-50);f(this);return c.each(function(){var g=k(this);J(g);var m=
|
||||
this,H=m.id,F=-r+"%",w=100+2*r+"%";w={position:"absolute",top:F,left:F,display:"block",width:w,height:w,margin:0,padding:0,background:"#fff",border:0,opacity:0};F=G?{position:"absolute",visibility:"hidden"}:r?w:{position:"absolute",opacity:0};var M="checkbox"==m.type?d.checkboxClass||"icheckbox":d.radioClass||"iradio",D=k('label[for="'+H+'"]').add(g.closest("label")),K=!!d.aria,L="iCheck-"+Math.random().toString(36).substr(2,6),h='<div class="'+M+'" '+(K?'role="'+m.type+'" ':"");K&&D.each(function(){h+=
|
||||
'aria-labelledby="';this.id?h+=this.id:(this.id=L,h+=L);h+='"'});h=g.wrap(h+"/>").trigger("ifCreated").parent().append(d.insert);w=k('<ins class="iCheck-helper"/>').css(w).appendTo(h);g.data("iCheck",{o:d,s:g.attr("style")}).css(F);d.inheritClass&&h.addClass(m.className||"");d.inheritID&&H&&h.attr("id","iCheck-"+H);"static"==h.css("position")&&h.css("position","relative");E(g,!0,"update");if(D.length)D.on("click.i mouseover.i mouseout.i touchbegin.i touchend.i",function(p){var n=p.type,A=k(this);
|
||||
if(!m.disabled){if("click"==n){if(k(p.target).is("a"))return;E(g,!1,!0)}else y&&(/ut|nd/.test(n)?(h.removeClass(t),A.removeClass(z)):(h.addClass(t),A.addClass(z)));if(G)p.stopPropagation();else return!1}});g.on("click.i focus.i blur.i keyup.i keydown.i keypress.i",function(p){var n=p.type;p=p.keyCode;if("click"==n)return!1;if("keydown"==n&&32==p)return"radio"==m.type&&m.checked||(m.checked?v(g,"checked"):B(g,"checked")),!1;if("keyup"==n&&"radio"==m.type)!m.checked&&B(g,"checked");else if(/us|ur/.test(n))h["blur"==
|
||||
n?"removeClass":"addClass"](u)});w.on("click mousedown mouseup mouseover mouseout touchbegin.i touchend.i",function(p){var n=p.type,A=/wn|up/.test(n)?x:t;if(!m.disabled){if("click"==n)E(g,!1,!0);else if(/wn|er|in/.test(n)?h.addClass(A):h.removeClass(A+" "+x),D.length&&y&&A==t)D[/ut|nd/.test(n)?"removeClass":"addClass"](z);if(G)p.stopPropagation();else return!1}})})}})(window.jQuery||window.Zepto);
|
||||
/*! iCheck v1.0.2 by Damir Sultanov, http://git.io/arlzeA, MIT Licensed */
|
||||
(function(f){function A(a,b,d){var c=a[0],g=/er/.test(d)?_indeterminate:/bl/.test(d)?n:k,e=d==_update?{checked:c[k],disabled:c[n],indeterminate:"true"==a.attr(_indeterminate)||"false"==a.attr(_determinate)}:c[g];if(/^(ch|di|in)/.test(d)&&!e)x(a,g);else if(/^(un|en|de)/.test(d)&&e)q(a,g);else if(d==_update)for(var f in e)e[f]?x(a,f,!0):q(a,f,!0);else if(!b||"toggle"==d){if(!b)a[_callback]("ifClicked");e?c[_type]!==r&&q(a,g):x(a,g)}}function x(a,b,d){var c=a[0],g=a.parent(),e=b==k,u=b==_indeterminate,
|
||||
v=b==n,s=u?_determinate:e?y:"enabled",F=l(a,s+t(c[_type])),B=l(a,b+t(c[_type]));if(!0!==c[b]){if(!d&&b==k&&c[_type]==r&&c.name){var w=a.closest("form"),p='input[name="'+c.name+'"]',p=w.length?w.find(p):f(p);p.each(function(){this!==c&&f(this).data(m)&&q(f(this),b)})}u?(c[b]=!0,c[k]&&q(a,k,"force")):(d||(c[b]=!0),e&&c[_indeterminate]&&q(a,_indeterminate,!1));D(a,e,b,d)}c[n]&&l(a,_cursor,!0)&&g.find("."+C).css(_cursor,"default");g[_add](B||l(a,b)||"");g.attr("role")&&!u&&g.attr("aria-"+(v?n:k),"true");
|
||||
g[_remove](F||l(a,s)||"")}function q(a,b,d){var c=a[0],g=a.parent(),e=b==k,f=b==_indeterminate,m=b==n,s=f?_determinate:e?y:"enabled",q=l(a,s+t(c[_type])),r=l(a,b+t(c[_type]));if(!1!==c[b]){if(f||!d||"force"==d)c[b]=!1;D(a,e,s,d)}!c[n]&&l(a,_cursor,!0)&&g.find("."+C).css(_cursor,"pointer");g[_remove](r||l(a,b)||"");g.attr("role")&&!f&&g.attr("aria-"+(m?n:k),"false");g[_add](q||l(a,s)||"")}function E(a,b){if(a.data(m)){a.parent().html(a.attr("style",a.data(m).s||""));if(b)a[_callback](b);a.off(".i").unwrap();
|
||||
f(_label+'[for="'+a[0].id+'"]').add(a.closest(_label)).off(".i")}}function l(a,b,f){if(a.data(m))return a.data(m).o[b+(f?"":"Class")]}function t(a){return a.charAt(0).toUpperCase()+a.slice(1)}function D(a,b,f,c){if(!c){if(b)a[_callback]("ifToggled");a[_callback]("ifChanged")[_callback]("if"+t(f))}}var m="iCheck",C=m+"-helper",r="radio",k="checked",y="un"+k,n="disabled";_determinate="determinate";_indeterminate="in"+_determinate;_update="update";_type="type";_click="click";_touch="touchbegin.i touchend.i";
|
||||
_add="addClass";_remove="removeClass";_callback="trigger";_label="label";_cursor="cursor";_mobile=/ipad|iphone|ipod|android|blackberry|windows phone|opera mini|silk/i.test(navigator.userAgent);f.fn[m]=function(a,b){var d='input[type="checkbox"], input[type="'+r+'"]',c=f(),g=function(a){a.each(function(){var a=f(this);c=a.is(d)?c.add(a):c.add(a.find(d))})};if(/^(check|uncheck|toggle|indeterminate|determinate|disable|enable|update|destroy)$/i.test(a))return a=a.toLowerCase(),g(this),c.each(function(){var c=
|
||||
f(this);"destroy"==a?E(c,"ifDestroyed"):A(c,!0,a);f.isFunction(b)&&b()});if("object"!=typeof a&&a)return this;var e=f.extend({checkedClass:k,disabledClass:n,indeterminateClass:_indeterminate,labelHover:!0},a),l=e.handle,v=e.hoverClass||"hover",s=e.focusClass||"focus",t=e.activeClass||"active",B=!!e.labelHover,w=e.labelHoverClass||"hover",p=(""+e.increaseArea).replace("%","")|0;if("checkbox"==l||l==r)d='input[type="'+l+'"]';-50>p&&(p=-50);g(this);return c.each(function(){var a=f(this);E(a);var c=this,
|
||||
b=c.id,g=-p+"%",d=100+2*p+"%",d={position:"absolute",top:g,left:g,display:"block",width:d,height:d,margin:0,padding:0,background:"#fff",border:0,opacity:0},g=_mobile?{position:"absolute",visibility:"hidden"}:p?d:{position:"absolute",opacity:0},l="checkbox"==c[_type]?e.checkboxClass||"icheckbox":e.radioClass||"i"+r,z=f(_label+'[for="'+b+'"]').add(a.closest(_label)),u=!!e.aria,y=m+"-"+Math.random().toString(36).substr(2,6),h='<div class="'+l+'" '+(u?'role="'+c[_type]+'" ':"");u&&z.each(function(){h+=
|
||||
'aria-labelledby="';this.id?h+=this.id:(this.id=y,h+=y);h+='"'});h=a.wrap(h+"/>")[_callback]("ifCreated").parent().append(e.insert);d=f('<ins class="'+C+'"/>').css(d).appendTo(h);a.data(m,{o:e,s:a.attr("style")}).css(g);e.inheritClass&&h[_add](c.className||"");e.inheritID&&b&&h.attr("id",m+"-"+b);"static"==h.css("position")&&h.css("position","relative");A(a,!0,_update);if(z.length)z.on(_click+".i mouseover.i mouseout.i "+_touch,function(b){var d=b[_type],e=f(this);if(!c[n]){if(d==_click){if(f(b.target).is("a"))return;
|
||||
A(a,!1,!0)}else B&&(/ut|nd/.test(d)?(h[_remove](v),e[_remove](w)):(h[_add](v),e[_add](w)));if(_mobile)b.stopPropagation();else return!1}});a.on(_click+".i focus.i blur.i keyup.i keydown.i keypress.i",function(b){var d=b[_type];b=b.keyCode;if(d==_click)return!1;if("keydown"==d&&32==b)return c[_type]==r&&c[k]||(c[k]?q(a,k):x(a,k)),!1;if("keyup"==d&&c[_type]==r)!c[k]&&x(a,k);else if(/us|ur/.test(d))h["blur"==d?_remove:_add](s)});d.on(_click+" mousedown mouseup mouseover mouseout "+_touch,function(b){var d=
|
||||
b[_type],e=/wn|up/.test(d)?t:v;if(!c[n]){if(d==_click)A(a,!1,!0);else{if(/wn|er|in/.test(d))h[_add](e);else h[_remove](e+" "+t);if(z.length&&B&&e==v)z[/ut|nd/.test(d)?_remove:_add](w)}if(_mobile)b.stopPropagation();else return!1}})})}})(window.jQuery||window.Zepto);
|
||||
|
|
|
|||
|
|
@ -618,3 +618,4 @@
|
|||
.input-group-addon:not(:first-child) {
|
||||
border-left: 0;
|
||||
}
|
||||
/*# sourceMappingURL=jasny-bootstrap.css.map */
|
||||
|
|
|
|||
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
Binary file not shown.
|
After Width: | Height: | Size: 5.8 KiB |
Binary file not shown.
|
After Width: | Height: | Size: 11 KiB |
|
|
@ -1,3 +1,4 @@
|
|||
/* *html{background-image: url(about:blank); background-attachment: fixed;} */
|
||||
html #layuicss-layer{display: none; position: absolute; width: 1989px;}
|
||||
|
||||
/* common */
|
||||
|
|
@ -8,8 +9,11 @@ html #layuicss-layer{display: none; position: absolute; width: 1989px;}
|
|||
.layui-layer-close{position:absolute;}
|
||||
.layui-layer-content{position:relative;}
|
||||
.layui-layer-border{border: 1px solid #B2B2B2; border: 1px solid rgba(0,0,0,.1); box-shadow: 1px 1px 5px rgba(0,0,0,.2);}
|
||||
.layui-layer-setwin span,
|
||||
.layui-layer-btn a{display: inline-block; vertical-align: middle; *display: inline; *zoom:1; }
|
||||
.layui-layer-load{background:url(loading-1.gif) #eee center center no-repeat;}
|
||||
.layui-layer-ico{ background:url(icon.png) no-repeat;}
|
||||
.layui-layer-dialog .layui-layer-ico,
|
||||
.layui-layer-setwin a,
|
||||
.layui-layer-btn a{display:inline-block; *display:inline; *zoom:1; vertical-align:top;}
|
||||
|
||||
.layui-layer-move{display: none; position: fixed; *position: absolute; left: 0px; top: 0px; width: 100%; height: 100%; cursor: move; opacity: 0; filter:alpha(opacity=0); background-color: #fff; z-index: 2147483647;}
|
||||
.layui-layer-resize{position: absolute; width: 15px; height: 15px; right: 0; bottom: 0; cursor: se-resize;}
|
||||
|
|
@ -39,139 +43,54 @@ html #layuicss-layer{display: none; position: absolute; width: 1989px;}
|
|||
|
||||
@-webkit-keyframes layer-shake{0%,100%{-webkit-transform:translateX(0);transform:translateX(0)}10%,30%,50%,70%,90%{-webkit-transform:translateX(-10px);transform:translateX(-10px)}20%,40%,60%,80%{-webkit-transform:translateX(10px);transform:translateX(10px)}}@keyframes layer-shake{0%,100%{-webkit-transform:translateX(0);-ms-transform:translateX(0);transform:translateX(0)}10%,30%,50%,70%,90%{-webkit-transform:translateX(-10px);-ms-transform:translateX(-10px);transform:translateX(-10px)}20%,40%,60%,80%{-webkit-transform:translateX(10px);-ms-transform:translateX(10px);transform:translateX(10px)}}.layer-anim-06{-webkit-animation-name:layer-shake;animation-name:layer-shake}@-webkit-keyframes fadeIn{0%{opacity:0}100%{opacity:1}}
|
||||
|
||||
/* 从上往下 */
|
||||
@keyframes layer-slide-down {
|
||||
from {
|
||||
transform: translate3d(0,-100%,0);
|
||||
} to {
|
||||
transform: translate3d(0,0,0);
|
||||
}
|
||||
}
|
||||
@keyframes layer-slide-down-out {
|
||||
from {
|
||||
transform: translate3d(0,0,0);
|
||||
} to {
|
||||
transform: translate3d(0,-100%,0);
|
||||
}
|
||||
}
|
||||
.layer-anim-slide-down{animation-name: layer-slide-down}
|
||||
.layer-anim-slide-down-out{animation-name: layer-slide-down-out}
|
||||
|
||||
/* 从右往左 */
|
||||
@keyframes layer-slide-left {
|
||||
from {
|
||||
transform: translate3d(100%,0,0);
|
||||
} to {
|
||||
transform: translate3d(0,0,0);
|
||||
}
|
||||
}
|
||||
@keyframes layer-slide-left-out {
|
||||
from {
|
||||
transform: translate3d(0,0,0);
|
||||
} to {
|
||||
transform: translate3d(100%,0,0);
|
||||
}
|
||||
}
|
||||
.layer-anim-slide-left{animation-name: layer-slide-left}
|
||||
.layer-anim-slide-left-out{animation-name: layer-slide-left-out}
|
||||
|
||||
/* 从下往上 */
|
||||
@keyframes layer-slide-up {
|
||||
from {
|
||||
transform: translate3d(0,100%,0);
|
||||
} to {
|
||||
transform: translate3d(0,0,0);
|
||||
}
|
||||
}
|
||||
@keyframes layer-slide-up-out {
|
||||
from {
|
||||
transform: translate3d(0,0,0);
|
||||
} to {
|
||||
transform: translate3d(0,100%,0);
|
||||
}
|
||||
}
|
||||
.layer-anim-slide-up{animation-name: layer-slide-up}
|
||||
.layer-anim-slide-up-out{animation-name: layer-slide-up-out}
|
||||
|
||||
/* 从左往右 */
|
||||
@keyframes layer-slide-right {
|
||||
from {
|
||||
transform: translate3d(-100%,0,0);
|
||||
} to {
|
||||
transform: translate3d(0,0,0);
|
||||
}
|
||||
}
|
||||
@keyframes layer-slide-right-out {
|
||||
from {
|
||||
transform: translate3d(0,0,0);
|
||||
} to {
|
||||
transform: translate3d(-100%,0,0);
|
||||
}
|
||||
}
|
||||
.layer-anim-slide-right{animation-name: layer-slide-right;}
|
||||
.layer-anim-slide-right-out{animation-name: layer-slide-right-out;}
|
||||
|
||||
|
||||
|
||||
/* 标题栏 */
|
||||
.layui-layer-title{padding: 0 81px 0 16px; height: 50px; line-height: 50px; border-bottom:1px solid #F0F0F0; font-size: 14px; color:#333; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; border-radius: 2px 2px 0 0;}
|
||||
.layui-layer-setwin{position:absolute; right: 15px; *right:0; top: 16px; font-size:0; line-height: initial;}
|
||||
.layui-layer-setwin span{position:relative; width: 16px; height: 16px; line-height: 18px; margin-left: 10px; text-align: center; font-size: 16px; cursor: pointer; color: #000; _overflow: hidden; box-sizing: border-box;}
|
||||
.layui-layer-setwin .layui-layer-min:before{content: ''; position: absolute; width: 12px; border-bottom: 1px solid #2E2D3C; left: 50%; top: 50%; margin: -0.5px 0 0 -6px; cursor: pointer; _overflow:hidden;}
|
||||
.layui-layer-setwin .layui-layer-min:hover:before{background-color: #2D93CA}
|
||||
.layui-layer-setwin .layui-layer-max:hover:before,
|
||||
.layui-layer-setwin .layui-layer-max:hover:after{border-color: #2D93CA;}
|
||||
.layui-layer-setwin .layui-layer-min:hover:before{background-color: #2D93CA}
|
||||
.layui-layer-setwin .layui-layer-maxmin:before,
|
||||
.layui-layer-setwin .layui-layer-maxmin:after{width: 7px; height: 7px; margin: -3px 0 0 -3px; background-color: #fff;}
|
||||
.layui-layer-setwin .layui-layer-maxmin:after{z-index: 0; margin: -5px 0 0 -1px;}
|
||||
.layui-layer-setwin .layui-layer-close{cursor: pointer;}
|
||||
.layui-layer-setwin .layui-layer-close:hover{opacity:0.7;}
|
||||
.layui-layer-setwin .layui-layer-close2{position:absolute; right: -28px; top: -28px; color: #fff; background-color: #787878; padding: 3px; width: 16px; height: 20px; font-size: 16px; font-weight: bolder; border-radius: 50%; margin-left: 0; *right:-18px; _display:none;}
|
||||
.layui-layer-setwin .layui-layer-close2:hover{opacity: unset; background-color: #3888f6;}
|
||||
.layui-layer-title{padding:0 80px 0 20px; height: 50px; line-height: 50px; border-bottom:1px solid #F0F0F0; font-size: 14px; color:#333; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; border-radius: 2px 2px 0 0;}
|
||||
.layui-layer-setwin{position:absolute; right: 15px; *right:0; top: 17px; font-size:0; line-height: initial;}
|
||||
.layui-layer-setwin a{position:relative; width: 16px; height:16px; margin-left:10px; font-size:12px; _overflow:hidden;}
|
||||
.layui-layer-setwin .layui-layer-min cite{position:absolute; width:14px; height:2px; left:0; top:50%; margin-top:-1px; background-color:#2E2D3C; cursor:pointer; _overflow:hidden;}
|
||||
.layui-layer-setwin .layui-layer-min:hover cite{background-color:#2D93CA; }
|
||||
.layui-layer-setwin .layui-layer-max{background-position:-32px -40px;}
|
||||
.layui-layer-setwin .layui-layer-max:hover{background-position:-16px -40px;}
|
||||
.layui-layer-setwin .layui-layer-maxmin{background-position:-65px -40px;}
|
||||
.layui-layer-setwin .layui-layer-maxmin:hover{background-position:-49px -40px;}
|
||||
.layui-layer-setwin .layui-layer-close1{background-position: 1px -40px; cursor: pointer;}
|
||||
.layui-layer-setwin .layui-layer-close1:hover{opacity:0.7;}
|
||||
.layui-layer-setwin .layui-layer-close2{position:absolute; right:-28px; top:-28px; width:30px; height:30px; margin-left:0; background-position:-149px -31px; *right:-18px; _display:none;}
|
||||
.layui-layer-setwin .layui-layer-close2:hover{ background-position:-180px -31px;}
|
||||
|
||||
/* 按钮栏 */
|
||||
.layui-layer-btn{text-align: right; padding: 0 15px 12px; pointer-events: auto; user-select: none; -webkit-user-select: none;}
|
||||
.layui-layer-btn a{height: 30px; line-height: 30px; margin: 5px 5px 0; padding: 0 16px; border: 1px solid #dedede; background-color: #fff; color: #333; border-radius: 2px; font-weight: 400; cursor: pointer; text-decoration: none; box-sizing: border-box;}
|
||||
.layui-layer-btn a{height: 28px; line-height: 28px; margin: 5px 5px 0; padding: 0 15px; border: 1px solid #dedede; background-color:#fff; color: #333; border-radius: 2px; font-weight:400; cursor:pointer; text-decoration: none;}
|
||||
.layui-layer-btn a:hover{opacity: 0.9; text-decoration: none;}
|
||||
.layui-layer-btn a:active{opacity: 0.8;}
|
||||
.layui-layer-btn .layui-layer-btn0{border-color: transparent; background-color: #1E9FFF; color:#fff;}
|
||||
.layui-layer-btn .layui-layer-btn0{border-color: #1E9FFF; background-color: #1E9FFF; color:#fff;}
|
||||
.layui-layer-btn-l{text-align: left;}
|
||||
.layui-layer-btn-c{text-align: center;}
|
||||
|
||||
/* 定制化 */
|
||||
.layui-layer-dialog{min-width: 240px;}
|
||||
.layui-layer-dialog .layui-layer-content{position: relative; padding: 16px; line-height: 24px; word-break: break-all; overflow:hidden; font-size:14px; overflow-x: hidden; overflow-y:auto;}
|
||||
.layui-layer-dialog .layui-layer-content .layui-layer-face{position: absolute; top: 18px; left: 16px; color: #959595; font-size: 32px; _left: -40px;}
|
||||
.layui-layer-dialog .layui-layer-content .layui-icon-tips{color: #F39B12;}
|
||||
.layui-layer-dialog .layui-layer-content .layui-icon-success{color: #16b777;}
|
||||
.layui-layer-dialog .layui-layer-content .layui-icon-error{top: 19px; color: #FF5722;}
|
||||
.layui-layer-dialog .layui-layer-content .layui-icon-question{color: #FFB800;}
|
||||
.layui-layer-dialog .layui-layer-content .layui-icon-lock{color: #787878;}
|
||||
.layui-layer-dialog .layui-layer-content .layui-icon-face-cry{color: #FF5722;}
|
||||
.layui-layer-dialog .layui-layer-content .layui-icon-face-smile{color: #16b777;}
|
||||
|
||||
.layui-layer-dialog{min-width: 300px;}
|
||||
.layui-layer-dialog .layui-layer-content{position: relative; padding:20px; line-height:24px; word-break: break-all; overflow:hidden; font-size:14px; overflow-x: hidden; overflow-y:auto;}
|
||||
.layui-layer-dialog .layui-layer-content .layui-layer-ico{position:absolute; top:16px; left:15px; _left:-40px; width:30px; height:30px;}
|
||||
.layui-layer-ico1{background-position:-30px 0 }
|
||||
.layui-layer-ico2{background-position:-60px 0;}
|
||||
.layui-layer-ico3{background-position:-90px 0;}
|
||||
.layui-layer-ico4{background-position:-120px 0;}
|
||||
.layui-layer-ico5{background-position:-150px 0;}
|
||||
.layui-layer-ico6{background-position:-180px 0;}
|
||||
.layui-layer-rim{border:6px solid #8D8D8D; border:6px solid rgba(0,0,0,.3); border-radius:5px; box-shadow: none;}
|
||||
.layui-layer-msg{min-width:180px; border:1px solid #D3D4D3; box-shadow: none;}
|
||||
.layui-layer-hui{min-width:100px; background-color: #000; filter:alpha(opacity=60); background-color: rgba(0,0,0,0.6); color: #fff; border:none;}
|
||||
.layui-layer-hui .layui-layer-close{color: #fff;}
|
||||
.layui-layer-hui .layui-layer-content{padding: 11px 24px; text-align: center;}
|
||||
.layui-layer-dialog .layui-layer-padding{padding: 18px 24px 18px 58px; text-align: left;}
|
||||
.layui-layer-hui .layui-layer-content{padding:12px 25px; text-align:center;}
|
||||
.layui-layer-dialog .layui-layer-padding{padding: 20px 20px 20px 55px; text-align: left;}
|
||||
.layui-layer-page .layui-layer-content{position:relative; overflow:auto;}
|
||||
.layui-layer-page .layui-layer-btn,.layui-layer-iframe .layui-layer-btn{padding-top:10px;}
|
||||
.layui-layer-nobg{background:none;}
|
||||
.layui-layer-iframe iframe{display: block; width: 100%;}
|
||||
|
||||
.layui-layer-loading{border-radius:100%; background:none; box-shadow:none; border:none;}
|
||||
.layui-layer-loading .layui-layer-content{width: 76px; height: 38px; line-height: 38px; text-align: center;}
|
||||
.layui-layer-loading-icon{font-size: 38px; color: #959595;}
|
||||
.layui-layer-loading2{text-align: center;}
|
||||
.layui-layer-loading-2{position: relative; height: 38px;}
|
||||
.layui-layer-loading-2:before,
|
||||
.layui-layer-loading-2:after{content: ''; position: absolute; left: 50%; top: 50%; width: 38px; height: 38px; margin: -19px 0 0 -19px; border-radius: 50%; border: 3px solid #d2d2d2; box-sizing: border-box;}
|
||||
.layui-layer-loading-2:after{border-color: transparent; border-left-color: #1E9FFF;}
|
||||
|
||||
|
||||
.layui-layer-loading .layui-layer-content{width:60px; height:24px; background:url(loading-0.gif) no-repeat;}
|
||||
.layui-layer-loading .layui-layer-loading1{width:37px; height:37px; background:url(loading-1.gif) no-repeat;}
|
||||
.layui-layer-loading .layui-layer-loading2, .layui-layer-ico16{width:32px; height:32px; background:url(loading-2.gif) no-repeat;}
|
||||
.layui-layer-tips{background: none; box-shadow:none; border:none;}
|
||||
.layui-layer-tips .layui-layer-content{position: relative; line-height: 22px; min-width: 12px; padding: 8px 15px; font-size: 12px; _float:left; border-radius: 2px; box-shadow: 1px 1px 3px rgba(0,0,0,.2); background-color: #000; color: #fff;}
|
||||
.layui-layer-tips .layui-layer-close{right:-2px; top:-1px;}
|
||||
|
|
@ -183,31 +102,15 @@ html #layuicss-layer{display: none; position: absolute; width: 1989px;}
|
|||
.layui-layer-tips i.layui-layer-TipsR{left:-8px;}
|
||||
.layui-layer-tips i.layui-layer-TipsL{right:-8px;}
|
||||
|
||||
/* 内置 skin */
|
||||
/* skin */
|
||||
.layui-layer-lan[type="dialog"]{min-width:280px;}
|
||||
.layui-layer-lan .layui-layer-title{background:#4476A7; color:#fff; border: none;}
|
||||
.layui-layer-lan .layui-layer-btn{padding: 5px 10px 10px; border-top:1px solid #E9E7E7}
|
||||
.layui-layer-lan .layui-layer-btn{padding: 5px 10px 10px; text-align: right; border-top:1px solid #E9E7E7}
|
||||
.layui-layer-lan .layui-layer-btn a{background: #fff; border-color: #E9E7E7; color: #333;}
|
||||
.layui-layer-lan .layui-layer-btn .layui-layer-btn1{background:#C9C5C5;}
|
||||
.layui-layer-molv .layui-layer-title{background: #009f95; color:#fff; border: none;}
|
||||
.layui-layer-molv .layui-layer-btn a{background: #009f95; border-color: #009f95;}
|
||||
.layui-layer-molv .layui-layer-btn .layui-layer-btn1{background:#92B8B1;}
|
||||
.layui-layer-lan .layui-layer-setwin .layui-icon,
|
||||
.layui-layer-molv .layui-layer-setwin .layui-icon{color: #fff;}
|
||||
|
||||
/* Windows 10 风格主题 */
|
||||
.layui-layer-win10{border: 1px solid #aaa; box-shadow: 1px 1px 6px rgba(0,0,0,.3); border-radius: none;}
|
||||
.layui-layer-win10 .layui-layer-title{height: 32px; line-height: 32px; padding-left: 8px; border-bottom: none; font-size: 12px;}
|
||||
.layui-layer-win10 .layui-layer-setwin{right: 0; top: 0;}
|
||||
.layui-layer-win10 .layui-layer-setwin span{margin-left: 0; width: 32px; height: 32px; padding: 8px;}
|
||||
.layui-layer-win10.layui-layer-page .layui-layer-setwin span{width: 38px;}
|
||||
.layui-layer-win10 .layui-layer-setwin span:hover{background-color: #E5E5E5;}
|
||||
.layui-layer-win10 .layui-layer-setwin span.layui-icon-close:hover{background-color: #E81123; color: #fff;}
|
||||
.layui-layer-win10.layui-layer-dialog .layui-layer-content{padding: 8px 16px 32px; color: #0033BC;}
|
||||
.layui-layer-win10.layui-layer-dialog .layui-layer-padding{padding-top: 18px; padding-left: 58px;}
|
||||
.layui-layer-win10 .layui-layer-btn{padding: 5px 5px 10px; border-top:1px solid #DFDFDF; background-color: #F0F0F0;}
|
||||
.layui-layer-win10 .layui-layer-btn a{height: 20px; line-height: 18px; background-color: #E1E1E1; border-color: #ADADAD; color: #000; font-size: 12px; transition: all .3s;}
|
||||
.layui-layer-win10 .layui-layer-btn a:hover{border-color: #2A8EDD; background-color: #E5F1FB;}
|
||||
.layui-layer-win10 .layui-layer-btn .layui-layer-btn0{border-color: #0078D7;}
|
||||
|
||||
|
||||
/**
|
||||
|
|
@ -216,44 +119,39 @@ html #layuicss-layer{display: none; position: absolute; width: 1989px;}
|
|||
|
||||
*/
|
||||
|
||||
.layui-layer-iconext{background:url(icon-ext.png) no-repeat;}
|
||||
|
||||
/* prompt模式 */
|
||||
.layui-layer-prompt .layui-layer-input{display: block; width: 260px; height: 36px; margin: 0 auto; line-height: 30px; padding-left: 10px; border: 1px solid #e6e6e6; color: #333;}
|
||||
.layui-layer-prompt textarea.layui-layer-input{width: 300px; height: 100px; line-height: 20px; padding: 6px 10px;}
|
||||
.layui-layer-prompt .layui-layer-content{padding: 16px;}
|
||||
.layui-layer-prompt .layui-layer-content{padding: 20px;}
|
||||
.layui-layer-prompt .layui-layer-btn{padding-top: 0;}
|
||||
|
||||
/* tab模式 */
|
||||
.layui-layer-tab{box-shadow:1px 1px 50px rgba(0,0,0,.4);}
|
||||
.layui-layer-tab .layui-layer-title{padding-left:0; overflow: visible;}
|
||||
.layui-layer-tab .layui-layer-title span{position:relative; display: inline-block; vertical-align: top; border-left: 1px solid transparent; border-right: 1px solid transparent; min-width:80px; max-width: 300px; padding:0 16px; text-align:center; cursor:default; text-overflow: ellipsis; overflow: hidden; white-space: nowrap; cursor: pointer;}
|
||||
.layui-layer-tab .layui-layer-title span.layui-this{height: 51px; border-left-color: #eee; border-right-color: #eee; background-color: #fff; z-index: 10;}
|
||||
.layui-layer-tab .layui-layer-title span:first-child{border-left-color: transparent;}
|
||||
.layui-layer-tabmain{line-height:24px; clear: both;}
|
||||
.layui-layer-tab .layui-layer-title span{position:relative; float:left; min-width:80px; max-width: 300px; padding:0 20px; text-align:center; cursor:default; text-overflow: ellipsis; overflow: hidden; white-space: nowrap; cursor: pointer;}
|
||||
.layui-layer-tab .layui-layer-title span.layui-this{height: 51px; border-left: 1px solid #eee; border-right: 1px solid #eee; background-color: #fff; z-index: 10;}
|
||||
.layui-layer-tab .layui-layer-title span:first-child{border-left:none;}
|
||||
.layui-layer-tabmain{line-height:24px; clear:both;}
|
||||
.layui-layer-tabmain .layui-layer-tabli{display:none;}
|
||||
.layui-layer-tabmain .layui-layer-tabli.layui-this{display: block;}
|
||||
|
||||
/* photos */
|
||||
/* photo模式 */
|
||||
.layui-layer-photos{background: none; box-shadow: none;}
|
||||
.layui-layer-photos .layui-layer-content{overflow: visible; text-align: center;}
|
||||
.layui-layer-photos .layer-layer-photos-main img{position: relative; width:100%; display: inline-block; *display:inline; *zoom:1; vertical-align:top;}
|
||||
.layui-layer-photos-prev,
|
||||
.layui-layer-photos-next{position: fixed; top: 50%; width: 52px; height: 52px; line-height: 52px; margin-top: -26px; cursor: pointer; font-size: 52px; color: #717171;}
|
||||
.layui-layer-photos-prev{left: 32px;}
|
||||
.layui-layer-photos-next{right: 32px;}
|
||||
.layui-layer-photos-prev:hover,
|
||||
.layui-layer-photos-next:hover{color: #959595;}
|
||||
|
||||
.layui-layer-photos-toolbar{position: fixed; left: 0; right: 0; bottom: 0; width: 100%; height: 52px; line-height: 52px; background-color: #000\9; filter: Alpha(opacity=60); background-color: rgba(0,0,0,.32); color: #fff; text-overflow: ellipsis; overflow: hidden; white-space: nowrap; font-size:0;}
|
||||
.layui-layer-photos-toolbar > *{display:inline-block; vertical-align: top; padding: 0 16px; font-size: 12px; color: #fff; *display:inline; *zoom: 1;}
|
||||
.layui-layer-photos-toolbar *{font-size: 12px;}
|
||||
.layui-layer-photos-header{top: 0; bottom: auto;}
|
||||
.layui-layer-photos-header > span{cursor: pointer;}
|
||||
.layui-layer-photos-header > span:hover{background-color: rgba(51,51,51,.32);}
|
||||
.layui-layer-photos-header .layui-icon{font-size: 18px;}
|
||||
.layui-layer-photos-footer > h3{max-width: 65%; text-overflow: ellipsis; overflow: hidden; white-space: nowrap;}
|
||||
.layui-layer-photos-footer a:hover{text-decoration: underline;}
|
||||
.layui-layer-photos-footer em{font-style: normal;}
|
||||
|
||||
.layui-layer-photos .layui-layer-content{overflow:hidden; text-align: center;}
|
||||
.layui-layer-photos .layui-layer-phimg img{position: relative; width:100%; display: inline-block; *display:inline; *zoom:1; vertical-align:top;}
|
||||
.layui-layer-imgprev, .layui-layer-imgnext{position: fixed; top: 50%; width: 27px; _width: 44px; height: 44px; margin-top:-22px; outline:none;blr:expression(this.onFocus=this.blur());}
|
||||
.layui-layer-imgprev{left: 30px; background-position:-5px -5px; _background-position:-70px -5px;}
|
||||
.layui-layer-imgprev:hover{background-position:-33px -5px; _background-position:-120px -5px;}
|
||||
.layui-layer-imgnext{right: 30px; _right:8px; background-position:-5px -50px; _background-position:-70px -50px;}
|
||||
.layui-layer-imgnext:hover{background-position: -33px -50px; _background-position: -120px -50px;}
|
||||
.layui-layer-imgbar{position: fixed; left:0; right: 0; bottom:0; width:100%; height: 40px; line-height: 40px; background-color:#000\9; filter:Alpha(opacity=60); background-color: rgba(2,0,0,.35); color: #fff; text-overflow: ellipsis; overflow: hidden; white-space: nowrap; font-size:0;}
|
||||
.layui-layer-imgtit{/*position:absolute; left:20px;*/}
|
||||
.layui-layer-imgtit *{display:inline-block; *display:inline; *zoom:1; vertical-align:top; font-size:12px;}
|
||||
.layui-layer-imgtit a{max-width:65%; text-overflow: ellipsis; overflow: hidden; white-space: nowrap; color:#fff;}
|
||||
.layui-layer-imgtit a:hover{color:#fff; text-decoration:underline;}
|
||||
.layui-layer-imgtit em{padding-left:10px; font-style: normal;}
|
||||
|
||||
/* 关闭动画 */
|
||||
@-webkit-keyframes layer-bounceOut {
|
||||
Binary file not shown.
|
After Width: | Height: | Size: 5.7 KiB |
Binary file not shown.
|
After Width: | Height: | Size: 701 B |
Binary file not shown.
|
After Width: | Height: | Size: 1.7 KiB |
|
|
@ -21,33 +21,35 @@ body .layer-ext-moon .layui-layer-title {
|
|||
border: none;
|
||||
}
|
||||
|
||||
body .layer-ext-moon .layui-layer-content .layui-layer-face {
|
||||
body .layer-ext-moon .layui-layer-content .layui-layer-ico {
|
||||
height: 32px;
|
||||
width: 32px;
|
||||
top:18.5px;
|
||||
}
|
||||
body .layer-ext-moon .layui-icon-tips {
|
||||
body .layer-ext-moon .layui-layer-ico0 {
|
||||
background: url(default.png) no-repeat -96px 0;
|
||||
;
|
||||
}
|
||||
body .layer-ext-moon .layui-icon-success {
|
||||
body .layer-ext-moon .layui-layer-ico1 {
|
||||
background: url(default.png) no-repeat -224px 0;
|
||||
;
|
||||
}
|
||||
body .layer-ext-moon .layui-icon-error {
|
||||
body .layer-ext-moon .layui-layer-ico2 {
|
||||
background: url(default.png) no-repeat -192px 0;
|
||||
}
|
||||
body .layer-ext-moon .layui-icon-question {
|
||||
body .layer-ext-moon .layui-layer-ico3 {
|
||||
background: url(default.png) no-repeat -160px 0;
|
||||
}
|
||||
body .layer-ext-moon .layui-icon-lock {
|
||||
body .layer-ext-moon .layui-layer-ico4 {
|
||||
background: url(default.png) no-repeat -320px 0;
|
||||
}
|
||||
body .layer-ext-moon .layui-icon-face-cry {
|
||||
body .layer-ext-moon .layui-layer-ico5 {
|
||||
background: url(default.png) no-repeat -288px 0;
|
||||
}
|
||||
body .layer-ext-moon .layui-icon-face-smile {
|
||||
body .layer-ext-moon .layui-layer-ico6 {
|
||||
background: url(default.png) -256px 0;
|
||||
}
|
||||
body .layer-ext-moon .layui-layer-download {
|
||||
body .layer-ext-moon .layui-layer-ico7 {
|
||||
background: url(default.png) no-repeat -128px 0;
|
||||
}
|
||||
body .layer-ext-moon .layui-layer-setwin {
|
||||
|
|
@ -73,10 +75,10 @@ body .layer-ext-moon .layui-layer-setwin .layui-layer-maxmin {
|
|||
body .layer-ext-moon .layui-layer-setwin .layui-layer-maxmin:hover {
|
||||
background: url(default.png) no-repeat -16px 0;
|
||||
}
|
||||
body .layer-ext-moon .layui-layer-setwin .layui-layer-close1,body .layer-ext-moon .layui-layer-setwin .layui-layer-close2, body .layui-layer-tab .layui-layer-setwin .layui-layer-close1,body .layui-layer-tab .layui-layer-setwin .layui-layer-close2 {
|
||||
body .layer-ext-moon .layui-layer-setwin .layui-layer-close1,body .layer-ext-moon .layui-layer-setwin .layui-layer-close2 {
|
||||
background: url(default.png) 0 0;
|
||||
}
|
||||
body .layer-ext-moon .layui-layer-setwin .layui-layer-close1:hover,body .layer-ext-moon .layui-layer-setwin .layui-layer-close2:hover, body .layui-layer-tab .layui-layer-setwin .layui-layer-close1:hover,body .layui-layer-tab .layui-layer-setwin .layui-layer-close2:hover {
|
||||
body .layer-ext-moon .layui-layer-setwin .layui-layer-close1:hover,body .layer-ext-moon .layui-layer-setwin .layui-layer-close2:hover {
|
||||
background: url(default.png) -48px 0;
|
||||
}
|
||||
body .layer-ext-moon .layui-layer-padding{padding-top: 24px;}
|
||||
|
|
@ -134,36 +136,3 @@ body .layer-ext-moon .layui-layer-btn .layui-layer-btn3 {
|
|||
body .layer-ext-moon .layui-layer-title span.layui-layer-tabnow{
|
||||
height:47px;
|
||||
}
|
||||
|
||||
/** 图标字体 **/
|
||||
@font-face {
|
||||
font-family: 'layui-icon';
|
||||
src: url('../../../../../fonts/iconfont.woff?v=282') format('woff');
|
||||
}
|
||||
|
||||
.layui-icon{
|
||||
font-family:"layui-icon" !important;
|
||||
font-style: normal;
|
||||
-webkit-font-smoothing: antialiased;
|
||||
-moz-osx-font-smoothing: grayscale;
|
||||
}
|
||||
/* font-class */
|
||||
.layui-icon-left:before{content:"\e603"}
|
||||
.layui-icon-right:before{content:"\e602"}
|
||||
.layui-icon-refresh:before{content:"\e669"}
|
||||
.layui-icon-slider:before{content:"\e714"}
|
||||
.layui-icon-add-circle:before{content:"\e61f"}
|
||||
.layui-icon-reduce-circle:before{content:"\e616"}
|
||||
.layui-icon-refresh-1:before{content:"\e666"}
|
||||
.layui-icon-loading:before{content:"\e63d"}
|
||||
.layui-icon-loading-1:before{content:"\e63e"}
|
||||
|
||||
/** 循环旋转动画 **/
|
||||
.layui-anim{-webkit-animation-duration: 0.3s; -webkit-animation-fill-mode: both; animation-duration: 0.3s; animation-fill-mode: both;}
|
||||
.layui-anim.layui-icon{display: inline-block;}
|
||||
.layui-anim-loop{-webkit-animation-iteration-count: infinite; animation-iteration-count: infinite;}
|
||||
.layui-trans,
|
||||
.layui-trans a{transition: all .2s; -webkit-transition: all .2s;}
|
||||
@-webkit-keyframes layui-rotate{from {-webkit-transform: rotate(0deg);} to {-webkit-transform: rotate(360deg);}}
|
||||
@keyframes layui-rotate{from {transform: rotate(0deg);} to {transform: rotate(360deg);}}
|
||||
.layui-anim-rotate{-webkit-animation-name: layui-rotate; animation-name: layui-rotate; -webkit-animation-duration: 1s; animation-duration: 1s; -webkit-animation-timing-function: linear; animation-timing-function: linear;}
|
||||
|
|
|
|||
File diff suppressed because one or more lines are too long
Binary file not shown.
|
|
@ -0,0 +1,45 @@
|
|||
<?xml version="1.0" standalone="no"?>
|
||||
<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd" >
|
||||
<!--
|
||||
2013-9-30: Created.
|
||||
-->
|
||||
<svg>
|
||||
<metadata>
|
||||
Created by iconfont
|
||||
</metadata>
|
||||
<defs>
|
||||
|
||||
<font id="laydate-icon" horiz-adv-x="1024" >
|
||||
<font-face
|
||||
font-family="laydate-icon"
|
||||
font-weight="500"
|
||||
font-stretch="normal"
|
||||
units-per-em="1024"
|
||||
ascent="896"
|
||||
descent="-128"
|
||||
/>
|
||||
<missing-glyph />
|
||||
|
||||
<glyph glyph-name="x" unicode="x" horiz-adv-x="1001"
|
||||
d="M281 543q-27 -1 -53 -1h-83q-18 0 -36.5 -6t-32.5 -18.5t-23 -32t-9 -45.5v-76h912v41q0 16 -0.5 30t-0.5 18q0 13 -5 29t-17 29.5t-31.5 22.5t-49.5 9h-133v-97h-438v97zM955 310v-52q0 -23 0.5 -52t0.5 -58t-10.5 -47.5t-26 -30t-33 -16t-31.5 -4.5q-14 -1 -29.5 -0.5
|
||||
t-29.5 0.5h-32l-45 128h-439l-44 -128h-29h-34q-20 0 -45 1q-25 0 -41 9.5t-25.5 23t-13.5 29.5t-4 30v167h911zM163 247q-12 0 -21 -8.5t-9 -21.5t9 -21.5t21 -8.5q13 0 22 8.5t9 21.5t-9 21.5t-22 8.5zM316 123q-8 -26 -14 -48q-5 -19 -10.5 -37t-7.5 -25t-3 -15t1 -14.5
|
||||
t9.5 -10.5t21.5 -4h37h67h81h80h64h36q23 0 34 12t2 38q-5 13 -9.5 30.5t-9.5 34.5q-5 19 -11 39h-368zM336 498v228q0 11 2.5 23t10 21.5t20.5 15.5t34 6h188q31 0 51.5 -14.5t20.5 -52.5v-227h-327z" />
|
||||
|
||||
|
||||
|
||||
<glyph glyph-name="youyou" unicode="" d="M283.648 721.918976 340.873216 780.926976 740.352 383.997952 340.876288-12.925952 283.648 46.077952 619.52 383.997952Z" horiz-adv-x="1024" />
|
||||
|
||||
|
||||
<glyph glyph-name="zuozuo" unicode="" d="M740.352 721.918976 683.126784 780.926976 283.648 383.997952 683.123712-12.925952 740.352 46.077952 404.48 383.997952Z" horiz-adv-x="1024" />
|
||||
|
||||
|
||||
<glyph glyph-name="xiayiye" unicode="" d="M62.573 384.103l423.401 423.662c18.985 18.985 49.757 18.985 68.727 0 18.982-18.972 18.985-49.746 0-68.729l-355.058-355.067 356.796-356.796c18.977-18.971 18.976-49.746 0-68.727-18.982-18.976-49.751-18.976-68.727 0l-39.753 39.753 0.269 0.246-385.655 385.661zM451.365 384.103l423.407 423.662c18.985 18.985 49.757 18.985 68.727 0 18.982-18.972 18.985-49.746 0-68.729l-355.058-355.067 356.796-356.796c18.977-18.971 18.976-49.746 0-68.727-18.982-18.976-49.757-18.977-68.727 0l-39.762 39.754 0.273 0.249-385.662 385.661zM451.365 384.103z" horiz-adv-x="1024" />
|
||||
|
||||
|
||||
<glyph glyph-name="xiayiye1" unicode="" d="M948.066926 382.958838l-411.990051-412.24426c-18.47333-18.47333-48.417689-18.47333-66.875207 0-18.47333 18.461167-18.47333 48.405526 0 66.875207L814.691135 383.088983 467.512212 730.269123c-18.466032 18.458735-18.466032 48.405526 0 66.873991 18.468465 18.464816 48.410391 18.464816 66.872774 0l38.682336-38.682336-0.261507-0.239614 375.259894-375.265975v0.003649m-378.312834 0L157.756743-29.285422c-18.47333-18.47333-48.415256-18.47333-66.872775 0-18.47333 18.461167-18.47333 48.405526 0 66.875207L436.369787 383.088983 89.19208 730.269123c-18.4636 18.458735-18.4636 48.405526 0 66.873991 18.470898 18.464816 48.415256 18.464816 66.872774 0l38.692067-38.682336-0.266372-0.239614 375.267191-375.265975-0.004865 0.003649m0 0z" horiz-adv-x="1024" />
|
||||
|
||||
|
||||
|
||||
|
||||
</font>
|
||||
</defs></svg>
|
||||
|
After Width: | Height: | Size: 3.0 KiB |
Binary file not shown.
Binary file not shown.
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
|
|
@ -188,13 +188,16 @@
|
|||
width: 100%; }
|
||||
.select2-container--default .select2-selection--multiple .select2-selection__rendered li {
|
||||
list-style: none; }
|
||||
.select2-container--default .select2-selection--multiple .select2-selection__placeholder {
|
||||
color: #999;
|
||||
margin-top: 5px;
|
||||
float: left; }
|
||||
.select2-container--default .select2-selection--multiple .select2-selection__clear {
|
||||
cursor: pointer;
|
||||
float: right;
|
||||
font-weight: bold;
|
||||
margin-top: 5px;
|
||||
margin-right: 10px;
|
||||
padding: 1px; }
|
||||
margin-right: 10px; }
|
||||
.select2-container--default .select2-selection--multiple .select2-selection__choice {
|
||||
background-color: #e4e4e4;
|
||||
border: 1px solid #aaa;
|
||||
|
|
@ -213,7 +216,7 @@
|
|||
.select2-container--default .select2-selection--multiple .select2-selection__choice__remove:hover {
|
||||
color: #333; }
|
||||
|
||||
.select2-container--default[dir="rtl"] .select2-selection--multiple .select2-selection__choice, .select2-container--default[dir="rtl"] .select2-selection--multiple .select2-search--inline {
|
||||
.select2-container--default[dir="rtl"] .select2-selection--multiple .select2-selection__choice, .select2-container--default[dir="rtl"] .select2-selection--multiple .select2-selection__placeholder, .select2-container--default[dir="rtl"] .select2-selection--multiple .select2-search--inline {
|
||||
float: right; }
|
||||
|
||||
.select2-container--default[dir="rtl"] .select2-selection--multiple .select2-selection__choice {
|
||||
|
|
|
|||
|
|
@ -1,5 +1,5 @@
|
|||
/*!
|
||||
* Select2 4.0.13
|
||||
* Select2 4.0.7
|
||||
* https://select2.github.io
|
||||
*
|
||||
* Released under the MIT license
|
||||
|
|
@ -832,8 +832,6 @@ S2.define('select2/utils',[
|
|||
if (Utils.__cache[id] != null) {
|
||||
delete Utils.__cache[id];
|
||||
}
|
||||
|
||||
element.removeAttribute('data-select2-id');
|
||||
};
|
||||
|
||||
return Utils;
|
||||
|
|
@ -855,7 +853,7 @@ S2.define('select2/results',[
|
|||
|
||||
Results.prototype.render = function () {
|
||||
var $results = $(
|
||||
'<ul class="select2-results__options" role="listbox"></ul>'
|
||||
'<ul class="select2-results__options" role="tree"></ul>'
|
||||
);
|
||||
|
||||
if (this.options.get('multiple')) {
|
||||
|
|
@ -878,7 +876,7 @@ S2.define('select2/results',[
|
|||
this.hideLoading();
|
||||
|
||||
var $message = $(
|
||||
'<li role="alert" aria-live="assertive"' +
|
||||
'<li role="treeitem" aria-live="assertive"' +
|
||||
' class="select2-results__option"></li>'
|
||||
);
|
||||
|
||||
|
|
@ -1012,16 +1010,11 @@ S2.define('select2/results',[
|
|||
option.className = 'select2-results__option';
|
||||
|
||||
var attrs = {
|
||||
'role': 'option',
|
||||
'role': 'treeitem',
|
||||
'aria-selected': 'false'
|
||||
};
|
||||
|
||||
var matches = window.Element.prototype.matches ||
|
||||
window.Element.prototype.msMatchesSelector ||
|
||||
window.Element.prototype.webkitMatchesSelector;
|
||||
|
||||
if ((data.element != null && matches.call(data.element, ':disabled')) ||
|
||||
(data.element == null && data.disabled)) {
|
||||
if (data.disabled) {
|
||||
delete attrs['aria-selected'];
|
||||
attrs['aria-disabled'] = 'true';
|
||||
}
|
||||
|
|
@ -1432,7 +1425,6 @@ S2.define('select2/selection/base',[
|
|||
|
||||
$selection.attr('title', this.$element.attr('title'));
|
||||
$selection.attr('tabindex', this._tabindex);
|
||||
$selection.attr('aria-disabled', 'false');
|
||||
|
||||
this.$selection = $selection;
|
||||
|
||||
|
|
@ -1442,6 +1434,7 @@ S2.define('select2/selection/base',[
|
|||
BaseSelection.prototype.bind = function (container, $container) {
|
||||
var self = this;
|
||||
|
||||
var id = container.id + '-container';
|
||||
var resultsId = container.id + '-results';
|
||||
|
||||
this.container = container;
|
||||
|
|
@ -1484,19 +1477,19 @@ S2.define('select2/selection/base',[
|
|||
self.$selection.removeAttr('aria-activedescendant');
|
||||
self.$selection.removeAttr('aria-owns');
|
||||
|
||||
self.$selection.trigger('focus');
|
||||
window.setTimeout(function () {
|
||||
self.$selection.focus();
|
||||
}, 0);
|
||||
|
||||
self._detachCloseHandler(container);
|
||||
});
|
||||
|
||||
container.on('enable', function () {
|
||||
self.$selection.attr('tabindex', self._tabindex);
|
||||
self.$selection.attr('aria-disabled', 'false');
|
||||
});
|
||||
|
||||
container.on('disable', function () {
|
||||
self.$selection.attr('tabindex', '-1');
|
||||
self.$selection.attr('aria-disabled', 'true');
|
||||
});
|
||||
};
|
||||
|
||||
|
|
@ -1519,6 +1512,7 @@ S2.define('select2/selection/base',[
|
|||
};
|
||||
|
||||
BaseSelection.prototype._attachCloseHandler = function (container) {
|
||||
var self = this;
|
||||
|
||||
$(document.body).on('mousedown.select2.' + container.id, function (e) {
|
||||
var $target = $(e.target);
|
||||
|
|
@ -1528,6 +1522,8 @@ S2.define('select2/selection/base',[
|
|||
var $all = $('.select2.select2-container--open');
|
||||
|
||||
$all.each(function () {
|
||||
var $this = $(this);
|
||||
|
||||
if (this == $select[0]) {
|
||||
return;
|
||||
}
|
||||
|
|
@ -1556,27 +1552,6 @@ S2.define('select2/selection/base',[
|
|||
throw new Error('The `update` method must be defined in child classes.');
|
||||
};
|
||||
|
||||
/**
|
||||
* Helper method to abstract the "enabled" (not "disabled") state of this
|
||||
* object.
|
||||
*
|
||||
* @return {true} if the instance is not disabled.
|
||||
* @return {false} if the instance is disabled.
|
||||
*/
|
||||
BaseSelection.prototype.isEnabled = function () {
|
||||
return !this.isDisabled();
|
||||
};
|
||||
|
||||
/**
|
||||
* Helper method to abstract the "disabled" state of this object.
|
||||
*
|
||||
* @return {true} if the disabled option is true.
|
||||
* @return {false} if the disabled option is false.
|
||||
*/
|
||||
BaseSelection.prototype.isDisabled = function () {
|
||||
return this.options.get('disabled');
|
||||
};
|
||||
|
||||
return BaseSelection;
|
||||
});
|
||||
|
||||
|
|
@ -1641,7 +1616,7 @@ S2.define('select2/selection/single',[
|
|||
|
||||
container.on('focus', function (evt) {
|
||||
if (!container.isOpen()) {
|
||||
self.$selection.trigger('focus');
|
||||
self.$selection.focus();
|
||||
}
|
||||
});
|
||||
};
|
||||
|
|
@ -1675,14 +1650,7 @@ S2.define('select2/selection/single',[
|
|||
var formatted = this.display(selection, $rendered);
|
||||
|
||||
$rendered.empty().append(formatted);
|
||||
|
||||
var title = selection.title || selection.text;
|
||||
|
||||
if (title) {
|
||||
$rendered.attr('title', title);
|
||||
} else {
|
||||
$rendered.removeAttr('title');
|
||||
}
|
||||
$rendered.attr('title', selection.title || selection.text);
|
||||
};
|
||||
|
||||
return SingleSelection;
|
||||
|
|
@ -1727,7 +1695,7 @@ S2.define('select2/selection/multiple',[
|
|||
'.select2-selection__choice__remove',
|
||||
function (evt) {
|
||||
// Ignore the event if it is disabled
|
||||
if (self.isDisabled()) {
|
||||
if (self.options.get('disabled')) {
|
||||
return;
|
||||
}
|
||||
|
||||
|
|
@ -1785,12 +1753,7 @@ S2.define('select2/selection/multiple',[
|
|||
var formatted = this.display(selection, $selection);
|
||||
|
||||
$selection.append(formatted);
|
||||
|
||||
var title = selection.title || selection.text;
|
||||
|
||||
if (title) {
|
||||
$selection.attr('title', title);
|
||||
}
|
||||
$selection.attr('title', selection.title || selection.text);
|
||||
|
||||
Utils.StoreData($selection[0], 'data', selection);
|
||||
|
||||
|
|
@ -1888,7 +1851,7 @@ S2.define('select2/selection/allowClear',[
|
|||
|
||||
AllowClear.prototype._handleClear = function (_, evt) {
|
||||
// Ignore the event if it is disabled
|
||||
if (this.isDisabled()) {
|
||||
if (this.options.get('disabled')) {
|
||||
return;
|
||||
}
|
||||
|
||||
|
|
@ -1931,7 +1894,7 @@ S2.define('select2/selection/allowClear',[
|
|||
}
|
||||
}
|
||||
|
||||
this.$element.trigger('input').trigger('change');
|
||||
this.$element.trigger('change');
|
||||
|
||||
this.trigger('toggle', {});
|
||||
};
|
||||
|
|
@ -1983,7 +1946,7 @@ S2.define('select2/selection/search',[
|
|||
'<li class="select2-search select2-search--inline">' +
|
||||
'<input class="select2-search__field" type="search" tabindex="-1"' +
|
||||
' autocomplete="off" autocorrect="off" autocapitalize="none"' +
|
||||
' spellcheck="false" role="searchbox" aria-autocomplete="list" />' +
|
||||
' spellcheck="false" role="textbox" aria-autocomplete="list" />' +
|
||||
'</li>'
|
||||
);
|
||||
|
||||
|
|
@ -2000,18 +1963,14 @@ S2.define('select2/selection/search',[
|
|||
Search.prototype.bind = function (decorated, container, $container) {
|
||||
var self = this;
|
||||
|
||||
var resultsId = container.id + '-results';
|
||||
|
||||
decorated.call(this, container, $container);
|
||||
|
||||
container.on('open', function () {
|
||||
self.$search.attr('aria-controls', resultsId);
|
||||
self.$search.trigger('focus');
|
||||
});
|
||||
|
||||
container.on('close', function () {
|
||||
self.$search.val('');
|
||||
self.$search.removeAttr('aria-controls');
|
||||
self.$search.removeAttr('aria-activedescendant');
|
||||
self.$search.trigger('focus');
|
||||
});
|
||||
|
|
@ -2031,11 +1990,7 @@ S2.define('select2/selection/search',[
|
|||
});
|
||||
|
||||
container.on('results:focus', function (params) {
|
||||
if (params.data._resultId) {
|
||||
self.$search.attr('aria-activedescendant', params.data._resultId);
|
||||
} else {
|
||||
self.$search.removeAttr('aria-activedescendant');
|
||||
}
|
||||
self.$search.attr('aria-activedescendant', params.id);
|
||||
});
|
||||
|
||||
this.$selection.on('focusin', '.select2-search--inline', function (evt) {
|
||||
|
|
@ -2069,12 +2024,6 @@ S2.define('select2/selection/search',[
|
|||
}
|
||||
});
|
||||
|
||||
this.$selection.on('click', '.select2-search--inline', function (evt) {
|
||||
if (self.$search.val()) {
|
||||
evt.stopPropagation();
|
||||
}
|
||||
});
|
||||
|
||||
// Try to detect the IE version should the `documentMode` property that
|
||||
// is stored on the document. This is only implemented in IE and is
|
||||
// slightly cleaner than doing a user agent check.
|
||||
|
|
@ -2160,7 +2109,13 @@ S2.define('select2/selection/search',[
|
|||
|
||||
this.resizeSearch();
|
||||
if (searchHadFocus) {
|
||||
this.$search.trigger('focus');
|
||||
var isTagInput = this.$element.find('[data-select2-tag]').length;
|
||||
if (isTagInput) {
|
||||
// fix IE11 bug where tag input lost focus
|
||||
this.$element.focus();
|
||||
} else {
|
||||
this.$search.focus();
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
|
|
@ -2193,7 +2148,7 @@ S2.define('select2/selection/search',[
|
|||
var width = '';
|
||||
|
||||
if (this.$search.attr('placeholder') !== '') {
|
||||
width = this.$selection.find('.select2-selection__rendered').width();
|
||||
width = this.$selection.find('.select2-selection__rendered').innerWidth();
|
||||
} else {
|
||||
var minimumWidth = this.$search.val().length + 1;
|
||||
|
||||
|
|
@ -3222,7 +3177,7 @@ S2.define('select2/data/select',[
|
|||
if ($(data.element).is('option')) {
|
||||
data.element.selected = true;
|
||||
|
||||
this.$element.trigger('input').trigger('change');
|
||||
this.$element.trigger('change');
|
||||
|
||||
return;
|
||||
}
|
||||
|
|
@ -3243,13 +3198,13 @@ S2.define('select2/data/select',[
|
|||
}
|
||||
|
||||
self.$element.val(val);
|
||||
self.$element.trigger('input').trigger('change');
|
||||
self.$element.trigger('change');
|
||||
});
|
||||
} else {
|
||||
var val = data.id;
|
||||
|
||||
this.$element.val(val);
|
||||
this.$element.trigger('input').trigger('change');
|
||||
this.$element.trigger('change');
|
||||
}
|
||||
};
|
||||
|
||||
|
|
@ -3265,7 +3220,7 @@ S2.define('select2/data/select',[
|
|||
if ($(data.element).is('option')) {
|
||||
data.element.selected = false;
|
||||
|
||||
this.$element.trigger('input').trigger('change');
|
||||
this.$element.trigger('change');
|
||||
|
||||
return;
|
||||
}
|
||||
|
|
@ -3283,7 +3238,7 @@ S2.define('select2/data/select',[
|
|||
|
||||
self.$element.val(val);
|
||||
|
||||
self.$element.trigger('input').trigger('change');
|
||||
self.$element.trigger('change');
|
||||
});
|
||||
};
|
||||
|
||||
|
|
@ -3476,19 +3431,15 @@ S2.define('select2/data/array',[
|
|||
'jquery'
|
||||
], function (SelectAdapter, Utils, $) {
|
||||
function ArrayAdapter ($element, options) {
|
||||
this._dataToConvert = options.get('data') || [];
|
||||
var data = options.get('data') || [];
|
||||
|
||||
ArrayAdapter.__super__.constructor.call(this, $element, options);
|
||||
|
||||
this.addOptions(this.convertToOptions(data));
|
||||
}
|
||||
|
||||
Utils.Extend(ArrayAdapter, SelectAdapter);
|
||||
|
||||
ArrayAdapter.prototype.bind = function (container, $container) {
|
||||
ArrayAdapter.__super__.bind.call(this, container, $container);
|
||||
|
||||
this.addOptions(this.convertToOptions(this._dataToConvert));
|
||||
};
|
||||
|
||||
ArrayAdapter.prototype.select = function (data) {
|
||||
var $option = this.$element.find('option').filter(function (i, elm) {
|
||||
return elm.value == data.id.toString();
|
||||
|
|
@ -3778,6 +3729,8 @@ S2.define('select2/data/tags',[
|
|||
};
|
||||
|
||||
Tags.prototype._removeOldTags = function (_) {
|
||||
var tag = this._lastTag;
|
||||
|
||||
var $options = this.$element.find('option[data-select2-tag]');
|
||||
|
||||
$options.each(function () {
|
||||
|
|
@ -3852,7 +3805,7 @@ S2.define('select2/data/tokenizer',[
|
|||
// Replace the search term if we have the search box
|
||||
if (this.$search.length) {
|
||||
this.$search.val(tokenData.term);
|
||||
this.$search.trigger('focus');
|
||||
this.$search.focus();
|
||||
}
|
||||
|
||||
params.term = tokenData.term;
|
||||
|
|
@ -3981,30 +3934,10 @@ S2.define('select2/data/maximumSelectionLength',[
|
|||
decorated.call(this, $e, options);
|
||||
}
|
||||
|
||||
MaximumSelectionLength.prototype.bind =
|
||||
function (decorated, container, $container) {
|
||||
var self = this;
|
||||
|
||||
decorated.call(this, container, $container);
|
||||
|
||||
container.on('select', function () {
|
||||
self._checkIfMaximumSelected();
|
||||
});
|
||||
};
|
||||
|
||||
MaximumSelectionLength.prototype.query =
|
||||
function (decorated, params, callback) {
|
||||
var self = this;
|
||||
|
||||
this._checkIfMaximumSelected(function () {
|
||||
decorated.call(self, params, callback);
|
||||
});
|
||||
};
|
||||
|
||||
MaximumSelectionLength.prototype._checkIfMaximumSelected =
|
||||
function (_, successCallback) {
|
||||
var self = this;
|
||||
|
||||
this.current(function (currentData) {
|
||||
var count = currentData != null ? currentData.length : 0;
|
||||
if (self.maximumSelectionLength > 0 &&
|
||||
|
|
@ -4017,10 +3950,7 @@ S2.define('select2/data/maximumSelectionLength',[
|
|||
});
|
||||
return;
|
||||
}
|
||||
|
||||
if (successCallback) {
|
||||
successCallback();
|
||||
}
|
||||
decorated.call(self, params, callback);
|
||||
});
|
||||
};
|
||||
|
||||
|
|
@ -4083,7 +4013,7 @@ S2.define('select2/dropdown/search',[
|
|||
'<span class="select2-search select2-search--dropdown">' +
|
||||
'<input class="select2-search__field" type="search" tabindex="-1"' +
|
||||
' autocomplete="off" autocorrect="off" autocapitalize="none"' +
|
||||
' spellcheck="false" role="searchbox" aria-autocomplete="list" />' +
|
||||
' spellcheck="false" role="textbox" />' +
|
||||
'</span>'
|
||||
);
|
||||
|
||||
|
|
@ -4098,8 +4028,6 @@ S2.define('select2/dropdown/search',[
|
|||
Search.prototype.bind = function (decorated, container, $container) {
|
||||
var self = this;
|
||||
|
||||
var resultsId = container.id + '-results';
|
||||
|
||||
decorated.call(this, container, $container);
|
||||
|
||||
this.$search.on('keydown', function (evt) {
|
||||
|
|
@ -4122,27 +4050,24 @@ S2.define('select2/dropdown/search',[
|
|||
|
||||
container.on('open', function () {
|
||||
self.$search.attr('tabindex', 0);
|
||||
self.$search.attr('aria-controls', resultsId);
|
||||
|
||||
self.$search.trigger('focus');
|
||||
self.$search.focus();
|
||||
|
||||
window.setTimeout(function () {
|
||||
self.$search.trigger('focus');
|
||||
self.$search.focus();
|
||||
}, 0);
|
||||
});
|
||||
|
||||
container.on('close', function () {
|
||||
self.$search.attr('tabindex', -1);
|
||||
self.$search.removeAttr('aria-controls');
|
||||
self.$search.removeAttr('aria-activedescendant');
|
||||
|
||||
self.$search.val('');
|
||||
self.$search.trigger('blur');
|
||||
self.$search.blur();
|
||||
});
|
||||
|
||||
container.on('focus', function () {
|
||||
if (!container.isOpen()) {
|
||||
self.$search.trigger('focus');
|
||||
self.$search.focus();
|
||||
}
|
||||
});
|
||||
|
||||
|
|
@ -4157,14 +4082,6 @@ S2.define('select2/dropdown/search',[
|
|||
}
|
||||
}
|
||||
});
|
||||
|
||||
container.on('results:focus', function (params) {
|
||||
if (params.data._resultId) {
|
||||
self.$search.attr('aria-activedescendant', params.data._resultId);
|
||||
} else {
|
||||
self.$search.removeAttr('aria-activedescendant');
|
||||
}
|
||||
});
|
||||
};
|
||||
|
||||
Search.prototype.handleSearch = function (evt) {
|
||||
|
|
@ -4249,7 +4166,6 @@ S2.define('select2/dropdown/infiniteScroll',[
|
|||
|
||||
if (this.showLoadingMore(data)) {
|
||||
this.$results.append(this.$loadingMore);
|
||||
this.loadMoreIfNeeded();
|
||||
}
|
||||
};
|
||||
|
||||
|
|
@ -4268,27 +4184,25 @@ S2.define('select2/dropdown/infiniteScroll',[
|
|||
self.loading = true;
|
||||
});
|
||||
|
||||
this.$results.on('scroll', this.loadMoreIfNeeded.bind(this));
|
||||
};
|
||||
|
||||
InfiniteScroll.prototype.loadMoreIfNeeded = function () {
|
||||
this.$results.on('scroll', function () {
|
||||
var isLoadMoreVisible = $.contains(
|
||||
document.documentElement,
|
||||
this.$loadingMore[0]
|
||||
self.$loadingMore[0]
|
||||
);
|
||||
|
||||
if (this.loading || !isLoadMoreVisible) {
|
||||
if (self.loading || !isLoadMoreVisible) {
|
||||
return;
|
||||
}
|
||||
|
||||
var currentOffset = this.$results.offset().top +
|
||||
this.$results.outerHeight(false);
|
||||
var loadingMoreOffset = this.$loadingMore.offset().top +
|
||||
this.$loadingMore.outerHeight(false);
|
||||
var currentOffset = self.$results.offset().top +
|
||||
self.$results.outerHeight(false);
|
||||
var loadingMoreOffset = self.$loadingMore.offset().top +
|
||||
self.$loadingMore.outerHeight(false);
|
||||
|
||||
if (currentOffset + 50 >= loadingMoreOffset) {
|
||||
this.loadMore();
|
||||
self.loadMore();
|
||||
}
|
||||
});
|
||||
};
|
||||
|
||||
InfiniteScroll.prototype.loadMore = function () {
|
||||
|
|
@ -4309,7 +4223,7 @@ S2.define('select2/dropdown/infiniteScroll',[
|
|||
var $option = $(
|
||||
'<li ' +
|
||||
'class="select2-results__option select2-results__option--load-more"' +
|
||||
'role="option" aria-disabled="true"></li>'
|
||||
'role="treeitem" aria-disabled="true"></li>'
|
||||
);
|
||||
|
||||
var message = this.options.get('translations').get('loadingMore');
|
||||
|
|
@ -4327,7 +4241,7 @@ S2.define('select2/dropdown/attachBody',[
|
|||
'../utils'
|
||||
], function ($, Utils) {
|
||||
function AttachBody (decorated, $element, options) {
|
||||
this.$dropdownParent = $(options.get('dropdownParent') || document.body);
|
||||
this.$dropdownParent = options.get('dropdownParent') || $(document.body);
|
||||
|
||||
decorated.call(this, $element, options);
|
||||
}
|
||||
|
|
@ -4335,14 +4249,27 @@ S2.define('select2/dropdown/attachBody',[
|
|||
AttachBody.prototype.bind = function (decorated, container, $container) {
|
||||
var self = this;
|
||||
|
||||
var setupResultsEvents = false;
|
||||
|
||||
decorated.call(this, container, $container);
|
||||
|
||||
container.on('open', function () {
|
||||
self._showDropdown();
|
||||
self._attachPositioningHandler(container);
|
||||
|
||||
// Must bind after the results handlers to ensure correct sizing
|
||||
self._bindContainerResultHandlers(container);
|
||||
if (!setupResultsEvents) {
|
||||
setupResultsEvents = true;
|
||||
|
||||
container.on('results:all', function () {
|
||||
self._positionDropdown();
|
||||
self._resizeDropdown();
|
||||
});
|
||||
|
||||
container.on('results:append', function () {
|
||||
self._positionDropdown();
|
||||
self._resizeDropdown();
|
||||
});
|
||||
}
|
||||
});
|
||||
|
||||
container.on('close', function () {
|
||||
|
|
@ -4391,44 +4318,6 @@ S2.define('select2/dropdown/attachBody',[
|
|||
this.$dropdownContainer.detach();
|
||||
};
|
||||
|
||||
AttachBody.prototype._bindContainerResultHandlers =
|
||||
function (decorated, container) {
|
||||
|
||||
// These should only be bound once
|
||||
if (this._containerResultsHandlersBound) {
|
||||
return;
|
||||
}
|
||||
|
||||
var self = this;
|
||||
|
||||
container.on('results:all', function () {
|
||||
self._positionDropdown();
|
||||
self._resizeDropdown();
|
||||
});
|
||||
|
||||
container.on('results:append', function () {
|
||||
self._positionDropdown();
|
||||
self._resizeDropdown();
|
||||
});
|
||||
|
||||
container.on('results:message', function () {
|
||||
self._positionDropdown();
|
||||
self._resizeDropdown();
|
||||
});
|
||||
|
||||
container.on('select', function () {
|
||||
self._positionDropdown();
|
||||
self._resizeDropdown();
|
||||
});
|
||||
|
||||
container.on('unselect', function () {
|
||||
self._positionDropdown();
|
||||
self._resizeDropdown();
|
||||
});
|
||||
|
||||
this._containerResultsHandlersBound = true;
|
||||
};
|
||||
|
||||
AttachBody.prototype._attachPositioningHandler =
|
||||
function (decorated, container) {
|
||||
var self = this;
|
||||
|
|
@ -4514,17 +4403,7 @@ S2.define('select2/dropdown/attachBody',[
|
|||
$offsetParent = $offsetParent.offsetParent();
|
||||
}
|
||||
|
||||
var parentOffset = {
|
||||
top: 0,
|
||||
left: 0
|
||||
};
|
||||
|
||||
if (
|
||||
$.contains(document.body, $offsetParent[0]) ||
|
||||
$offsetParent[0].isConnected
|
||||
) {
|
||||
parentOffset = $offsetParent.offset();
|
||||
}
|
||||
var parentOffset = $offsetParent.offset();
|
||||
|
||||
css.top -= parentOffset.top;
|
||||
css.left -= parentOffset.left;
|
||||
|
|
@ -4711,7 +4590,7 @@ S2.define('select2/i18n/en',[],function () {
|
|||
// English
|
||||
return {
|
||||
errorLoading: function () {
|
||||
return '无法载入结果。';
|
||||
return '无法载入结果';
|
||||
},
|
||||
inputTooLong: function (args) {
|
||||
var overChars = args.input.length - args.maximum;
|
||||
|
|
@ -4989,29 +4868,66 @@ S2.define('select2/defaults',[
|
|||
);
|
||||
}
|
||||
|
||||
// If the defaults were not previously applied from an element, it is
|
||||
// possible for the language option to have not been resolved
|
||||
options.language = this._resolveLanguage(options.language);
|
||||
if (typeof options.language === 'string') {
|
||||
// Check if the language is specified with a region
|
||||
if (options.language.indexOf('-') > 0) {
|
||||
// Extract the region information if it is included
|
||||
var languageParts = options.language.split('-');
|
||||
var baseLanguage = languageParts[0];
|
||||
|
||||
// Always fall back to English since it will always be complete
|
||||
options.language = [options.language, baseLanguage];
|
||||
} else {
|
||||
options.language = [options.language];
|
||||
}
|
||||
}
|
||||
|
||||
if ($.isArray(options.language)) {
|
||||
var languages = new Translation();
|
||||
options.language.push('en');
|
||||
|
||||
var uniqueLanguages = [];
|
||||
var languageNames = options.language;
|
||||
|
||||
for (var l = 0; l < options.language.length; l++) {
|
||||
var language = options.language[l];
|
||||
for (var l = 0; l < languageNames.length; l++) {
|
||||
var name = languageNames[l];
|
||||
var language = {};
|
||||
|
||||
if (uniqueLanguages.indexOf(language) === -1) {
|
||||
uniqueLanguages.push(language);
|
||||
}
|
||||
}
|
||||
|
||||
options.language = uniqueLanguages;
|
||||
|
||||
options.translations = this._processTranslations(
|
||||
options.language,
|
||||
options.debug
|
||||
try {
|
||||
// Try to load it with the original name
|
||||
language = Translation.loadPath(name);
|
||||
} catch (e) {
|
||||
try {
|
||||
// If we couldn't load it, check if it wasn't the full path
|
||||
name = this.defaults.amdLanguageBase + name;
|
||||
language = Translation.loadPath(name);
|
||||
} catch (ex) {
|
||||
// The translation could not be loaded at all. Sometimes this is
|
||||
// because of a configuration problem, other times this can be
|
||||
// because of how Select2 helps load all possible translation files.
|
||||
if (options.debug && window.console && console.warn) {
|
||||
console.warn(
|
||||
'Select2: The language file for "' + name + '" could not be ' +
|
||||
'automatically loaded. A fallback will be used instead.'
|
||||
);
|
||||
}
|
||||
|
||||
continue;
|
||||
}
|
||||
}
|
||||
|
||||
languages.extend(language);
|
||||
}
|
||||
|
||||
options.translations = languages;
|
||||
} else {
|
||||
var baseTranslation = Translation.loadPath(
|
||||
this.defaults.amdLanguageBase + 'en'
|
||||
);
|
||||
var customTranslation = new Translation(options.language);
|
||||
|
||||
customTranslation.extend(baseTranslation);
|
||||
|
||||
options.translations = customTranslation;
|
||||
}
|
||||
|
||||
return options;
|
||||
};
|
||||
|
|
@ -5078,7 +4994,7 @@ S2.define('select2/defaults',[
|
|||
debug: false,
|
||||
dropdownAutoWidth: false,
|
||||
escapeMarkup: Utils.escapeMarkup,
|
||||
language: {},
|
||||
language: EnglishTranslation,
|
||||
matcher: matcher,
|
||||
minimumInputLength: 0,
|
||||
maximumInputLength: 0,
|
||||
|
|
@ -5096,107 +5012,10 @@ S2.define('select2/defaults',[
|
|||
return selection.text;
|
||||
},
|
||||
theme: 'default',
|
||||
width: 'resolve'
|
||||
width: '100%'
|
||||
};
|
||||
};
|
||||
|
||||
Defaults.prototype.applyFromElement = function (options, $element) {
|
||||
var optionLanguage = options.language;
|
||||
var defaultLanguage = this.defaults.language;
|
||||
var elementLanguage = $element.prop('lang');
|
||||
var parentLanguage = $element.closest('[lang]').prop('lang');
|
||||
|
||||
var languages = Array.prototype.concat.call(
|
||||
this._resolveLanguage(elementLanguage),
|
||||
this._resolveLanguage(optionLanguage),
|
||||
this._resolveLanguage(defaultLanguage),
|
||||
this._resolveLanguage(parentLanguage)
|
||||
);
|
||||
|
||||
options.language = languages;
|
||||
|
||||
return options;
|
||||
};
|
||||
|
||||
Defaults.prototype._resolveLanguage = function (language) {
|
||||
if (!language) {
|
||||
return [];
|
||||
}
|
||||
|
||||
if ($.isEmptyObject(language)) {
|
||||
return [];
|
||||
}
|
||||
|
||||
if ($.isPlainObject(language)) {
|
||||
return [language];
|
||||
}
|
||||
|
||||
var languages;
|
||||
|
||||
if (!$.isArray(language)) {
|
||||
languages = [language];
|
||||
} else {
|
||||
languages = language;
|
||||
}
|
||||
|
||||
var resolvedLanguages = [];
|
||||
|
||||
for (var l = 0; l < languages.length; l++) {
|
||||
resolvedLanguages.push(languages[l]);
|
||||
|
||||
if (typeof languages[l] === 'string' && languages[l].indexOf('-') > 0) {
|
||||
// Extract the region information if it is included
|
||||
var languageParts = languages[l].split('-');
|
||||
var baseLanguage = languageParts[0];
|
||||
|
||||
resolvedLanguages.push(baseLanguage);
|
||||
}
|
||||
}
|
||||
|
||||
return resolvedLanguages;
|
||||
};
|
||||
|
||||
Defaults.prototype._processTranslations = function (languages, debug) {
|
||||
var translations = new Translation();
|
||||
|
||||
for (var l = 0; l < languages.length; l++) {
|
||||
var languageData = new Translation();
|
||||
|
||||
var language = languages[l];
|
||||
|
||||
if (typeof language === 'string') {
|
||||
try {
|
||||
// Try to load it with the original name
|
||||
languageData = Translation.loadPath(language);
|
||||
} catch (e) {
|
||||
try {
|
||||
// If we couldn't load it, check if it wasn't the full path
|
||||
language = this.defaults.amdLanguageBase + language;
|
||||
languageData = Translation.loadPath(language);
|
||||
} catch (ex) {
|
||||
// The translation could not be loaded at all. Sometimes this is
|
||||
// because of a configuration problem, other times this can be
|
||||
// because of how Select2 helps load all possible translation files
|
||||
if (debug && window.console && console.warn) {
|
||||
console.warn(
|
||||
'Select2: The language file for "' + language + '" could ' +
|
||||
'not be automatically loaded. A fallback will be used instead.'
|
||||
);
|
||||
}
|
||||
}
|
||||
}
|
||||
} else if ($.isPlainObject(language)) {
|
||||
languageData = new Translation(language);
|
||||
} else {
|
||||
languageData = language;
|
||||
}
|
||||
|
||||
translations.extend(languageData);
|
||||
}
|
||||
|
||||
return translations;
|
||||
};
|
||||
|
||||
Defaults.prototype.set = function (key, value) {
|
||||
var camelKey = $.camelCase(key);
|
||||
|
||||
|
|
@ -5226,10 +5045,6 @@ S2.define('select2/options',[
|
|||
this.fromElement($element);
|
||||
}
|
||||
|
||||
if ($element != null) {
|
||||
this.options = Defaults.applyFromElement(this.options, $element);
|
||||
}
|
||||
|
||||
this.options = Defaults.apply(this.options);
|
||||
|
||||
if ($element && $element.is('input')) {
|
||||
|
|
@ -5253,6 +5068,14 @@ S2.define('select2/options',[
|
|||
this.options.disabled = $e.prop('disabled');
|
||||
}
|
||||
|
||||
if (this.options.language == null) {
|
||||
if ($e.prop('lang')) {
|
||||
this.options.language = $e.prop('lang').toLowerCase();
|
||||
} else if ($e.closest('[lang]').prop('lang')) {
|
||||
this.options.language = $e.closest('[lang]').prop('lang');
|
||||
}
|
||||
}
|
||||
|
||||
if (this.options.dir == null) {
|
||||
if ($e.prop('dir')) {
|
||||
this.options.dir = $e.prop('dir');
|
||||
|
|
@ -5520,12 +5343,6 @@ S2.define('select2/core',[
|
|||
return null;
|
||||
}
|
||||
|
||||
if (method == 'computedstyle') {
|
||||
var computedStyle = window.getComputedStyle($element[0]);
|
||||
|
||||
return computedStyle.width;
|
||||
}
|
||||
|
||||
return method;
|
||||
};
|
||||
|
||||
|
|
@ -5566,8 +5383,8 @@ S2.define('select2/core',[
|
|||
|
||||
if (observer != null) {
|
||||
this._observer = new observer(function (mutations) {
|
||||
self._syncA();
|
||||
self._syncS(null, mutations);
|
||||
$.each(mutations, self._syncA);
|
||||
$.each(mutations, self._syncS);
|
||||
});
|
||||
this._observer.observe(this.$element[0], {
|
||||
attributes: true,
|
||||
|
|
@ -5689,7 +5506,7 @@ S2.define('select2/core',[
|
|||
if (self.isOpen()) {
|
||||
if (key === KEYS.ESC || key === KEYS.TAB ||
|
||||
(key === KEYS.UP && evt.altKey)) {
|
||||
self.close(evt);
|
||||
self.close();
|
||||
|
||||
evt.preventDefault();
|
||||
} else if (key === KEYS.ENTER) {
|
||||
|
|
@ -5723,7 +5540,7 @@ S2.define('select2/core',[
|
|||
Select2.prototype._syncAttributes = function () {
|
||||
this.options.set('disabled', this.$element.prop('disabled'));
|
||||
|
||||
if (this.isDisabled()) {
|
||||
if (this.options.get('disabled')) {
|
||||
if (this.isOpen()) {
|
||||
this.close();
|
||||
}
|
||||
|
|
@ -5734,7 +5551,7 @@ S2.define('select2/core',[
|
|||
}
|
||||
};
|
||||
|
||||
Select2.prototype._isChangeMutation = function (evt, mutations) {
|
||||
Select2.prototype._syncSubtree = function (evt, mutations) {
|
||||
var changed = false;
|
||||
var self = this;
|
||||
|
||||
|
|
@ -5762,22 +5579,7 @@ S2.define('select2/core',[
|
|||
}
|
||||
} else if (mutations.removedNodes && mutations.removedNodes.length > 0) {
|
||||
changed = true;
|
||||
} else if ($.isArray(mutations)) {
|
||||
$.each(mutations, function(evt, mutation) {
|
||||
if (self._isChangeMutation(evt, mutation)) {
|
||||
// We've found a change mutation.
|
||||
// Let's escape from the loop and continue
|
||||
changed = true;
|
||||
return false;
|
||||
}
|
||||
});
|
||||
}
|
||||
return changed;
|
||||
};
|
||||
|
||||
Select2.prototype._syncSubtree = function (evt, mutations) {
|
||||
var changed = this._isChangeMutation(evt, mutations);
|
||||
var self = this;
|
||||
|
||||
// Only re-pull the data if we think there is a change
|
||||
if (changed) {
|
||||
|
|
@ -5828,7 +5630,7 @@ S2.define('select2/core',[
|
|||
};
|
||||
|
||||
Select2.prototype.toggleDropdown = function () {
|
||||
if (this.isDisabled()) {
|
||||
if (this.options.get('disabled')) {
|
||||
return;
|
||||
}
|
||||
|
||||
|
|
@ -5844,40 +5646,15 @@ S2.define('select2/core',[
|
|||
return;
|
||||
}
|
||||
|
||||
if (this.isDisabled()) {
|
||||
return;
|
||||
}
|
||||
|
||||
this.trigger('query', {});
|
||||
};
|
||||
|
||||
Select2.prototype.close = function (evt) {
|
||||
Select2.prototype.close = function () {
|
||||
if (!this.isOpen()) {
|
||||
return;
|
||||
}
|
||||
|
||||
this.trigger('close', { originalEvent : evt });
|
||||
};
|
||||
|
||||
/**
|
||||
* Helper method to abstract the "enabled" (not "disabled") state of this
|
||||
* object.
|
||||
*
|
||||
* @return {true} if the instance is not disabled.
|
||||
* @return {false} if the instance is disabled.
|
||||
*/
|
||||
Select2.prototype.isEnabled = function () {
|
||||
return !this.isDisabled();
|
||||
};
|
||||
|
||||
/**
|
||||
* Helper method to abstract the "disabled" state of this object.
|
||||
*
|
||||
* @return {true} if the disabled option is true.
|
||||
* @return {false} if the disabled option is false.
|
||||
*/
|
||||
Select2.prototype.isDisabled = function () {
|
||||
return this.options.get('disabled');
|
||||
this.trigger('close', {});
|
||||
};
|
||||
|
||||
Select2.prototype.isOpen = function () {
|
||||
|
|
@ -5954,7 +5731,7 @@ S2.define('select2/core',[
|
|||
});
|
||||
}
|
||||
|
||||
this.$element.val(newVal).trigger('input').trigger('change');
|
||||
this.$element.val(newVal).trigger('change');
|
||||
};
|
||||
|
||||
Select2.prototype.destroy = function () {
|
||||
|
|
|
|||
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 it is too large
Load Diff
File diff suppressed because one or more lines are too long
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
File diff suppressed because it is too large
Load Diff
|
|
@ -1,4 +1,4 @@
|
|||
(function ($) {
|
||||
(function($) {
|
||||
$.extend($.summernote.lang, {
|
||||
'zh-CN': {
|
||||
font: {
|
||||
|
|
@ -11,7 +11,7 @@
|
|||
strikethrough: '删除线',
|
||||
subscript: '下标',
|
||||
superscript: '上标',
|
||||
size: '字号'
|
||||
size: '字号',
|
||||
},
|
||||
image: {
|
||||
image: '图片',
|
||||
|
|
@ -33,14 +33,14 @@
|
|||
maximumFileSizeError: '文件大小超出最大值。',
|
||||
url: '图片地址',
|
||||
remove: '移除图片',
|
||||
original: '原始图片'
|
||||
original: '原始图片',
|
||||
},
|
||||
video: {
|
||||
video: '视频',
|
||||
videoLink: '视频链接',
|
||||
insert: '插入视频',
|
||||
url: '视频地址',
|
||||
providers: '(优酷, 腾讯, Instagram, DailyMotion, Youtube等)'
|
||||
providers: '(优酷, 腾讯, Instagram, DailyMotion, Youtube等)',
|
||||
},
|
||||
link: {
|
||||
link: '链接',
|
||||
|
|
@ -49,7 +49,7 @@
|
|||
edit: '编辑链接',
|
||||
textToDisplay: '显示文本',
|
||||
url: '链接地址',
|
||||
openInNewWindow: '在新窗口打开'
|
||||
openInNewWindow: '在新窗口打开',
|
||||
},
|
||||
table: {
|
||||
table: '表格',
|
||||
|
|
@ -59,10 +59,10 @@
|
|||
addColRight: '在右侧插入列',
|
||||
delRow: '删除行',
|
||||
delCol: '删除列',
|
||||
delTable: '删除表格'
|
||||
delTable: '删除表格',
|
||||
},
|
||||
hr: {
|
||||
insert: '水平线'
|
||||
insert: '水平线',
|
||||
},
|
||||
style: {
|
||||
style: '样式',
|
||||
|
|
@ -74,16 +74,16 @@
|
|||
h3: '标题 3',
|
||||
h4: '标题 4',
|
||||
h5: '标题 5',
|
||||
h6: '标题 6'
|
||||
h6: '标题 6',
|
||||
},
|
||||
lists: {
|
||||
unordered: '无序列表',
|
||||
ordered: '有序列表'
|
||||
ordered: '有序列表',
|
||||
},
|
||||
options: {
|
||||
help: '帮助',
|
||||
fullscreen: '全屏',
|
||||
codeview: '源代码'
|
||||
codeview: '源代码',
|
||||
},
|
||||
paragraph: {
|
||||
paragraph: '段落',
|
||||
|
|
@ -92,7 +92,7 @@
|
|||
left: '左对齐',
|
||||
center: '居中对齐',
|
||||
right: '右对齐',
|
||||
justify: '两端对齐'
|
||||
justify: '两端对齐',
|
||||
},
|
||||
color: {
|
||||
recent: '最近使用',
|
||||
|
|
@ -102,7 +102,7 @@
|
|||
transparent: '透明',
|
||||
setTransparent: '透明',
|
||||
reset: '重置',
|
||||
resetToDefault: '默认'
|
||||
resetToDefault: '默认',
|
||||
},
|
||||
shortcut: {
|
||||
shortcuts: '快捷键',
|
||||
|
|
@ -111,7 +111,7 @@
|
|||
action: '动作',
|
||||
paragraphFormatting: '段落格式',
|
||||
documentStyle: '文档样式',
|
||||
extraKeys: '额外按键'
|
||||
extraKeys: '额外按键',
|
||||
},
|
||||
help: {
|
||||
insertParagraph: '插入段落',
|
||||
|
|
@ -140,16 +140,16 @@
|
|||
formatH5: '设置选中内容样式为 标题5',
|
||||
formatH6: '设置选中内容样式为 标题6',
|
||||
insertHorizontalRule: '插入水平线',
|
||||
'linkDialog.show': '显示链接对话框'
|
||||
'linkDialog.show': '显示链接对话框',
|
||||
},
|
||||
history: {
|
||||
undo: '撤销',
|
||||
redo: '重做'
|
||||
redo: '重做',
|
||||
},
|
||||
specialChar: {
|
||||
specialChar: '特殊字符',
|
||||
select: '选取特殊字符'
|
||||
}
|
||||
}
|
||||
select: '选取特殊字符',
|
||||
},
|
||||
},
|
||||
});
|
||||
})(jQuery);
|
||||
|
|
|
|||
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in New Issue