diff --git a/README.md b/README.md index 7a4a0c6b3..6ae5c5429 100644 --- a/README.md +++ b/README.md @@ -1,11 +1,11 @@

logo

-

RuoYi v4.7.5

+

RuoYi v4.8.0

基于SpringBoot开发的轻量级Java快速开发框架

- +

@@ -19,7 +19,6 @@ * 前后端分离版本,请移步[RuoYi-Vue](https://gitee.com/y_project/RuoYi-Vue),微服务版本,请移步[RuoYi-Cloud](https://gitee.com/y_project/RuoYi-Cloud) * 阿里云折扣场:[点我进入](http://aly.ruoyi.vip),腾讯云秒杀场:[点我进入](http://txy.ruoyi.vip)   -* 阿里云优惠券:[点我领取](https://www.aliyun.com/minisite/goods?userCode=brki8iof&share_source=copy_link),腾讯云优惠券:[点我领取](https://cloud.tencent.com/redirect.php?redirect=1025&cps_key=198c8df2ed259157187173bc7f4f32fd&from=console)   ## 内置功能 @@ -98,4 +97,4 @@ ## 若依交流群 -QQ群: [![加入QQ群](https://img.shields.io/badge/已满-1389287-blue.svg)](https://jq.qq.com/?_wv=1027&k=5HBAaYN) [![加入QQ群](https://img.shields.io/badge/已满-1679294-blue.svg)](https://jq.qq.com/?_wv=1027&k=5cHeRVW) [![加入QQ群](https://img.shields.io/badge/已满-1529866-blue.svg)](https://jq.qq.com/?_wv=1027&k=53R0L5Z) [![加入QQ群](https://img.shields.io/badge/已满-1772718-blue.svg)](https://jq.qq.com/?_wv=1027&k=5g75dCU) [![加入QQ群](https://img.shields.io/badge/已满-1366522-blue.svg)](https://jq.qq.com/?_wv=1027&k=58cPoHA) [![加入QQ群](https://img.shields.io/badge/已满-1382251-blue.svg)](https://jq.qq.com/?_wv=1027&k=5Ofd4Pb) [![加入QQ群](https://img.shields.io/badge/已满-1145125-blue.svg)](https://jq.qq.com/?_wv=1027&k=5yugASz) [![加入QQ群](https://img.shields.io/badge/已满-86752435-blue.svg)](https://jq.qq.com/?_wv=1027&k=5Rf3d2P) [![加入QQ群](https://img.shields.io/badge/已满-134072510-blue.svg)](https://jq.qq.com/?_wv=1027&k=5ZIjaeP) [![加入QQ群](https://img.shields.io/badge/已满-210336300-blue.svg)](https://jq.qq.com/?_wv=1027&k=5CJw1jY) [![加入QQ群](https://img.shields.io/badge/已满-339522636-blue.svg)](https://jq.qq.com/?_wv=1027&k=5omzbKc) [![加入QQ群](https://img.shields.io/badge/已满-130035985-blue.svg)](https://jq.qq.com/?_wv=1027&k=qPIKBb7s) [![加入QQ群](https://img.shields.io/badge/已满-143151071-blue.svg)](https://jq.qq.com/?_wv=1027&k=4NsjKbtU) [![加入QQ群](https://img.shields.io/badge/已满-158781320-blue.svg)](https://jq.qq.com/?_wv=1027&k=VD2pkz2G) [![加入QQ群](https://img.shields.io/badge/已满-201531282-blue.svg)](https://jq.qq.com/?_wv=1027&k=HlshFwkJ) [![加入QQ群](https://img.shields.io/badge/已满-101526938-blue.svg)](https://jq.qq.com/?_wv=1027&k=0ARRrO9V) [![加入QQ群](https://img.shields.io/badge/已满-264355400-blue.svg)](https://jq.qq.com/?_wv=1027&k=up9k3ZXJ) [![加入QQ群](https://img.shields.io/badge/已满-298522656-blue.svg)](https://jq.qq.com/?_wv=1027&k=540WfdEr) [![加入QQ群](https://img.shields.io/badge/已满-139845794-blue.svg)](https://jq.qq.com/?_wv=1027&k=ss91fC4t) [![加入QQ群](https://img.shields.io/badge/213650505-blue.svg)](https://jq.qq.com/?_wv=1027&k=uUQpdY7J) \ No newline at end of file +QQ群: [![加入QQ群](https://img.shields.io/badge/已满-1389287-blue.svg)](https://jq.qq.com/?_wv=1027&k=5HBAaYN) [![加入QQ群](https://img.shields.io/badge/已满-1679294-blue.svg)](https://jq.qq.com/?_wv=1027&k=5cHeRVW) [![加入QQ群](https://img.shields.io/badge/已满-1529866-blue.svg)](https://jq.qq.com/?_wv=1027&k=53R0L5Z) [![加入QQ群](https://img.shields.io/badge/已满-1772718-blue.svg)](https://jq.qq.com/?_wv=1027&k=5g75dCU) [![加入QQ群](https://img.shields.io/badge/已满-1366522-blue.svg)](https://jq.qq.com/?_wv=1027&k=58cPoHA) [![加入QQ群](https://img.shields.io/badge/已满-1382251-blue.svg)](https://jq.qq.com/?_wv=1027&k=5Ofd4Pb) [![加入QQ群](https://img.shields.io/badge/已满-1145125-blue.svg)](https://jq.qq.com/?_wv=1027&k=5yugASz) [![加入QQ群](https://img.shields.io/badge/已满-86752435-blue.svg)](https://jq.qq.com/?_wv=1027&k=5Rf3d2P) [![加入QQ群](https://img.shields.io/badge/已满-134072510-blue.svg)](https://jq.qq.com/?_wv=1027&k=5ZIjaeP) [![加入QQ群](https://img.shields.io/badge/已满-210336300-blue.svg)](https://jq.qq.com/?_wv=1027&k=5CJw1jY) [![加入QQ群](https://img.shields.io/badge/已满-339522636-blue.svg)](https://jq.qq.com/?_wv=1027&k=5omzbKc) [![加入QQ群](https://img.shields.io/badge/已满-130035985-blue.svg)](https://jq.qq.com/?_wv=1027&k=qPIKBb7s) [![加入QQ群](https://img.shields.io/badge/已满-143151071-blue.svg)](https://jq.qq.com/?_wv=1027&k=4NsjKbtU) [![加入QQ群](https://img.shields.io/badge/已满-158781320-blue.svg)](https://jq.qq.com/?_wv=1027&k=VD2pkz2G) [![加入QQ群](https://img.shields.io/badge/已满-201531282-blue.svg)](https://jq.qq.com/?_wv=1027&k=HlshFwkJ) [![加入QQ群](https://img.shields.io/badge/已满-101526938-blue.svg)](https://jq.qq.com/?_wv=1027&k=0ARRrO9V) [![加入QQ群](https://img.shields.io/badge/已满-264355400-blue.svg)](https://jq.qq.com/?_wv=1027&k=up9k3ZXJ) [![加入QQ群](https://img.shields.io/badge/已满-298522656-blue.svg)](https://jq.qq.com/?_wv=1027&k=540WfdEr) [![加入QQ群](https://img.shields.io/badge/已满-139845794-blue.svg)](https://jq.qq.com/?_wv=1027&k=ss91fC4t) [![加入QQ群](https://img.shields.io/badge/已满-185760789-blue.svg)](https://jq.qq.com/?_wv=1027&k=Cqd66IKe) [![加入QQ群](https://img.shields.io/badge/已满-175104288-blue.svg)](https://jq.qq.com/?_wv=1027&k=7FplYUnR) [![加入QQ群](https://img.shields.io/badge/已满-174942938-blue.svg)](http://qm.qq.com/cgi-bin/qm/qr?_wv=1027&k=lqMHu_5Fskm7H2S1vNAQTtzAUokVydwc&authKey=ptw0Fpch5pbNocML3CIJKKqZBaq2DI7cusKuzIgfMNiY3t9Pvd9hP%2BA8WYx3yaY1&noverify=0&group_code=174942938) [![加入QQ群](https://img.shields.io/badge/已满-287843737-blue.svg)](http://qm.qq.com/cgi-bin/qm/qr?_wv=1027&k=blYlRDmwZXSXI5pVrPPU7ZJ1stFJ6Q2Q&authKey=ForGBWffHVlPt9NE3d7g4DoOIouBh%2BqvAj2lp1CLReHfZAUaK7SRrdwsChKpRJDJ&noverify=0&group_code=287843737) [![加入QQ群](https://img.shields.io/badge/232896766-blue.svg)](http://qm.qq.com/cgi-bin/qm/qr?_wv=1027&k=KTVAIhggR3rR3uZWK9A8kR4yYNREQ4jo&authKey=An4DUV9e7uK8I8VgBbp949z0ypQoDrOoqvVg%2FWOr2vuNNDMZUAMPvqHor6TFMIgz&noverify=0&group_code=232896766) \ No newline at end of file diff --git a/pom.xml b/pom.xml index 74778dd35..446999bb5 100644 --- a/pom.xml +++ b/pom.xml @@ -5,7 +5,7 @@ com.ruoyi ruoyi - 4.7.5 + 4.8.0 jar ruoyi @@ -15,7 +15,7 @@ org.springframework.boot spring-boot-starter-parent - 2.5.14 + 2.5.15 @@ -24,20 +24,22 @@ UTF-8 1.8 3.1.1 - 1.9.1 + 1.13.0 2.1.0 - 2.2.2 - 1.4.3 + 1.4.7 1.2.83 - 1.2.11 - 2.11.0 - 1.4 + 1.2.23 + 2.16.1 1.21 2.3 - 2.3.2 + 2.3.3 3.0.0 4.1.2 - 6.2.2 + 6.6.5 + + 9.0.96 + 1.2.13 + 5.3.39 @@ -86,13 +88,6 @@ mysql-connector-java - - - org.mybatis.spring.boot - mybatis-spring-boot-starter - ${mybatis.spring.boot.starter.version} - - com.github.pagehelper @@ -126,13 +121,6 @@ ${commons.io.version} - - - commons-fileupload - commons-fileupload - ${commons.fileupload.version} - - org.apache.shiro @@ -202,12 +190,12 @@ - com.github.penggle + pro.fessional kaptcha ${kaptcha.version} - javax.servlet-api + servlet-api javax.servlet @@ -287,6 +275,7 @@ **/*.min.js **/*.min.css **/fileinput.js + **/validate/** **/bootstrap-table/** diff --git a/sql/ry_20210924.sql b/sql/ry_20240601.sql similarity index 94% rename from sql/ry_20210924.sql rename to sql/ry_20240601.sql index 1fa768be3..166b5a9f3 100644 --- a/sql/ry_20210924.sql +++ b/sql/ry_20240601.sql @@ -67,8 +67,8 @@ create table sys_user ( -- ---------------------------- -- 初始化-用户信息表数据 -- ---------------------------- -insert into sys_user values(1, 103, 'admin', '若依', '00', 'ry@163.com', '15888888888', '1', '', '29c67a30398638269fe600f73a054934', '111111', '0', '0', '127.0.0.1', sysdate(), sysdate(), 'admin', sysdate(), '', null, '管理员'); -insert into sys_user values(2, 105, 'ry', '若依', '00', 'ry@qq.com', '15666666666', '1', '', '8e6d98b90472783cc73c17047ddccf36', '222222', '0', '0', '127.0.0.1', sysdate(), sysdate(), 'admin', sysdate(), '', null, '测试员'); +insert into sys_user values(1, 103, 'admin', '若依', '00', 'ry@163.com', '15888888888', '1', '', '29c67a30398638269fe600f73a054934', '111111', '0', '0', '127.0.0.1', null, null, 'admin', sysdate(), '', null, '管理员'); +insert into sys_user values(2, 105, 'ry', '若依', '00', 'ry@qq.com', '15666666666', '1', '', '8e6d98b90472783cc73c17047ddccf36', '222222', '0', '0', '127.0.0.1', null, null, 'admin', sysdate(), '', null, '测试员'); -- ---------------------------- @@ -415,7 +415,7 @@ create table sys_oper_log ( oper_id bigint(20) not null auto_increment comment '日志主键', title varchar(50) default '' comment '模块标题', business_type int(2) default 0 comment '业务类型(0其它 1新增 2修改 3删除)', - method varchar(100) default '' comment '方法名称', + method varchar(200) default '' comment '方法名称', request_method varchar(10) default '' comment '请求方式', operator_type int(1) default 0 comment '操作类别(0其它 1后台用户 2手机端用户)', oper_name varchar(50) default '' comment '操作人员', @@ -428,7 +428,11 @@ create table sys_oper_log ( status int(1) default 0 comment '操作状态(0正常 1异常)', error_msg varchar(2000) default '' comment '错误消息', oper_time datetime comment '操作时间', - primary key (oper_id) + cost_time bigint(20) default 0 comment '消耗时间', + primary key (oper_id), + key idx_sys_oper_log_bt (business_type), + key idx_sys_oper_log_s (status), + key idx_sys_oper_log_ot (oper_time) ) engine=innodb auto_increment=100 comment = '操作日志记录'; @@ -540,11 +544,12 @@ insert into sys_config values(2, '用户管理-账号初始密码', 'sy insert into sys_config values(3, '主框架页-侧边栏主题', 'sys.index.sideTheme', 'theme-dark', 'Y', 'admin', sysdate(), '', null, '深黑主题theme-dark,浅色主题theme-light,深蓝主题theme-blue'); insert into sys_config values(4, '账号自助-是否开启用户注册功能', 'sys.account.registerUser', 'false', 'Y', 'admin', sysdate(), '', null, '是否开启注册用户功能(true开启,false关闭)'); insert into sys_config values(5, '用户管理-密码字符范围', 'sys.account.chrtype', '0', 'Y', 'admin', sysdate(), '', null, '默认任意字符范围,0任意(密码可以输入任意字符),1数字(密码只能为0-9数字),2英文字母(密码只能为a-z和A-Z字母),3字母和数字(密码必须包含字母,数字),4字母数字和特殊字符(目前支持的特殊字符包括:~!@#$%^&*()-=_+)'); -insert into sys_config values(6, '用户管理-初始密码修改策略', 'sys.account.initPasswordModify', '0', 'Y', 'admin', sysdate(), '', null, '0:初始密码修改策略关闭,没有任何提示,1:提醒用户,如果未修改初始密码,则在登录时就会提醒修改密码对话框'); +insert into sys_config values(6, '用户管理-初始密码修改策略', 'sys.account.initPasswordModify', '1', 'Y', 'admin', sysdate(), '', null, '0:初始密码修改策略关闭,没有任何提示,1:提醒用户,如果未修改初始密码,则在登录时就会提醒修改密码对话框'); insert into sys_config values(7, '用户管理-账号密码更新周期', 'sys.account.passwordValidateDays', '0', 'Y', 'admin', sysdate(), '', null, '密码更新周期(填写数字,数据初始化值为0不限制,若修改必须为大于0小于365的正整数),如果超过这个周期登录系统时,则在登录时就会提醒修改密码对话框'); insert into sys_config values(8, '主框架页-菜单导航显示风格', 'sys.index.menuStyle', 'default', 'Y', 'admin', sysdate(), '', null, '菜单导航显示风格(default为左侧导航菜单,topnav为顶部导航菜单)'); insert into sys_config values(9, '主框架页-是否开启页脚', 'sys.index.footer', 'true', 'Y', 'admin', sysdate(), '', null, '是否开启底部页脚显示(true显示,false隐藏)'); insert into sys_config values(10, '主框架页-是否开启页签', 'sys.index.tagsView', 'true', 'Y', 'admin', sysdate(), '', null, '是否开启菜单多页签显示(true显示,false隐藏)'); +insert into sys_config values(11, '用户登录-黑名单列表', 'sys.login.blackIPList', '', 'Y', 'admin', sysdate(), '', null, '设置登录IP黑名单限制,多个匹配项以;分隔,支持匹配(*通配、网段)'); -- ---------------------------- @@ -561,7 +566,9 @@ create table sys_logininfor ( status char(1) default '0' comment '登录状态(0成功 1失败)', msg varchar(255) default '' comment '提示消息', login_time datetime comment '访问时间', - primary key (info_id) + primary key (info_id), + key idx_sys_logininfor_s (status), + key idx_sys_logininfor_lt (login_time) ) engine=innodb auto_increment=100 comment = '系统访问记录'; @@ -636,7 +643,7 @@ create table sys_notice ( notice_id int(4) not null auto_increment comment '公告ID', notice_title varchar(50) not null comment '公告标题', notice_type char(1) not null comment '公告类型(1通知 2公告)', - notice_content varchar(2000) default null comment '公告内容', + notice_content longblob default null comment '公告内容', status char(1) default '0' comment '公告状态(0正常 1关闭)', create_by varchar(64) default '' comment '创建者', create_time datetime comment '创建时间', @@ -651,6 +658,7 @@ create table sys_notice ( -- ---------------------------- insert into sys_notice values('1', '温馨提醒:2018-07-01 若依新版本发布啦', '2', '新版本内容', '0', 'admin', sysdate(), '', null, '管理员'); insert into sys_notice values('2', '维护通知:2018-07-01 若依系统凌晨维护', '1', '维护内容', '0', 'admin', sysdate(), '', null, '管理员'); +insert into sys_notice values('3', '若依开源框架介绍', '1', '

项目介绍

RuoYi开源项目是为企业用户定制的后台脚手架框架,为企业打造的一站式解决方案,降低企业开发成本,提升开发效率。主要包括用户管理、角色管理、部门管理、菜单管理、参数管理、字典管理、岗位管理、定时任务服务监控、登录日志、操作日志、代码生成等功能。其中,还支持多数据源、数据权限、国际化、Redis缓存、Docker部署、滑动验证码、第三方认证登录、分布式事务、分布式文件存储、分库分表处理等技术特点。


官网及演示

若依官网地址: http://ruoyi.vip

若依文档地址: http://doc.ruoyi.vip

演示地址【不分离版】: http://demo.ruoyi.vip

演示地址【分离版本】: http://vue.ruoyi.vip

演示地址【微服务版】: http://cloud.ruoyi.vip

演示地址【移动端版】: http://h5.ruoyi.vip


', '0', 'admin', sysdate(), '', null, '管理员'); -- ---------------------------- @@ -670,6 +678,7 @@ create table gen_table ( business_name varchar(30) comment '生成业务名', function_name varchar(50) comment '生成功能名', function_author varchar(50) comment '生成功能作者', + form_col_num int(1) default 1 comment '表单布局(单列 双列 三列)', gen_type char(1) default '0' comment '生成代码方式(0zip压缩包 1自定义路径)', gen_path varchar(200) default '/' comment '生成路径(不填默认项目路径)', options varchar(1000) comment '其它生成选项', @@ -688,7 +697,7 @@ create table gen_table ( drop table if exists gen_table_column; create table gen_table_column ( column_id bigint(20) not null auto_increment comment '编号', - table_id varchar(64) comment '归属表编号', + table_id bigint(20) comment '归属表编号', column_name varchar(200) comment '列名称', column_comment varchar(500) comment '列描述', column_type varchar(100) comment '列类型', diff --git a/src/main/java/com/ruoyi/common/constant/Constants.java b/src/main/java/com/ruoyi/common/constant/Constants.java index 4224bbcf7..f5ff36be4 100644 --- a/src/main/java/com/ruoyi/common/constant/Constants.java +++ b/src/main/java/com/ruoyi/common/constant/Constants.java @@ -1,5 +1,7 @@ package com.ruoyi.common.constant; +import java.util.Locale; + /** * 通用常量信息 * @@ -17,6 +19,11 @@ public class Constants */ public static final String GBK = "GBK"; + /** + * 系统语言 + */ + public static final Locale DEFAULT_LOCALE = Locale.SIMPLIFIED_CHINESE; + /** * http请求 */ @@ -105,11 +112,11 @@ public class Constants /** * 定时任务白名单配置(仅允许访问的包名,如其他需要可以自行添加) */ - public static final String[] JOB_WHITELIST_STR = { "com.ruoyi" }; + public static final String[] JOB_WHITELIST_STR = { "com.ruoyi.framework.task" }; /** * 定时任务违规的字符 */ public static final String[] JOB_ERROR_STR = { "java.net.URL", "javax.naming.InitialContext", "org.yaml.snakeyaml", - "org.springframework", "com.ruoyi.common.utils.file" }; + "org.springframework", "com.ruoyi.common.utils.file", "com.ruoyi.framework.config", "com.ruoyi.project.tool" }; } diff --git a/src/main/java/com/ruoyi/common/constant/ShiroConstants.java b/src/main/java/com/ruoyi/common/constant/ShiroConstants.java index f21a0cb67..37664e77b 100644 --- a/src/main/java/com/ruoyi/common/constant/ShiroConstants.java +++ b/src/main/java/com/ruoyi/common/constant/ShiroConstants.java @@ -70,7 +70,7 @@ public class ShiroConstants /** * 登录记录缓存 */ - public static final String LOGINRECORDCACHE = "loginRecordCache"; + public static final String LOGIN_RECORD_CACHE = "loginRecordCache"; /** * 系统活跃用户缓存 diff --git a/src/main/java/com/ruoyi/common/constant/UserConstants.java b/src/main/java/com/ruoyi/common/constant/UserConstants.java index cbc88abe4..ffaef6aba 100644 --- a/src/main/java/com/ruoyi/common/constant/UserConstants.java +++ b/src/main/java/com/ruoyi/common/constant/UserConstants.java @@ -16,6 +16,9 @@ public class UserConstants /** 用户封禁状态 */ public static final String USER_DISABLE = "1"; + /** 角色正常状态 */ + public static final String ROLE_NORMAL = "0"; + /** 角色封禁状态 */ public static final String ROLE_DISABLE = "1"; @@ -31,56 +34,16 @@ public class UserConstants /** 是否为系统默认(是) */ public static final String YES = "Y"; + /** 是否唯一的返回标识 */ + public final static boolean UNIQUE = true; + public final static boolean NOT_UNIQUE = false; + /** * 用户名长度限制 */ public static final int USERNAME_MIN_LENGTH = 2; public static final int USERNAME_MAX_LENGTH = 20; - /** 登录名称是否唯一的返回结果码 */ - public final static String USER_NAME_UNIQUE = "0"; - public final static String USER_NAME_NOT_UNIQUE = "1"; - - /** 手机号码是否唯一的返回结果 */ - public final static String USER_PHONE_UNIQUE = "0"; - public final static String USER_PHONE_NOT_UNIQUE = "1"; - - /** e-mail 是否唯一的返回结果 */ - public final static String USER_EMAIL_UNIQUE = "0"; - public final static String USER_EMAIL_NOT_UNIQUE = "1"; - - /** 部门名称是否唯一的返回结果码 */ - public final static String DEPT_NAME_UNIQUE = "0"; - public final static String DEPT_NAME_NOT_UNIQUE = "1"; - - /** 角色名称是否唯一的返回结果码 */ - public final static String ROLE_NAME_UNIQUE = "0"; - public final static String ROLE_NAME_NOT_UNIQUE = "1"; - - /** 岗位名称是否唯一的返回结果码 */ - public final static String POST_NAME_UNIQUE = "0"; - public final static String POST_NAME_NOT_UNIQUE = "1"; - - /** 角色权限是否唯一的返回结果码 */ - public final static String ROLE_KEY_UNIQUE = "0"; - public final static String ROLE_KEY_NOT_UNIQUE = "1"; - - /** 岗位编码是否唯一的返回结果码 */ - public final static String POST_CODE_UNIQUE = "0"; - public final static String POST_CODE_NOT_UNIQUE = "1"; - - /** 菜单名称是否唯一的返回结果码 */ - public final static String MENU_NAME_UNIQUE = "0"; - public final static String MENU_NAME_NOT_UNIQUE = "1"; - - /** 字典类型是否唯一的返回结果码 */ - public final static String DICT_TYPE_UNIQUE = "0"; - public final static String DICT_TYPE_NOT_UNIQUE = "1"; - - /** 参数键名是否唯一的返回结果码 */ - public final static String CONFIG_KEY_UNIQUE = "0"; - public final static String CONFIG_KEY_NOT_UNIQUE = "1"; - /** * 密码长度限制 */ diff --git a/src/main/java/com/ruoyi/common/exception/file/FileUploadException.java b/src/main/java/com/ruoyi/common/exception/file/FileUploadException.java new file mode 100644 index 000000000..f45e7ef40 --- /dev/null +++ b/src/main/java/com/ruoyi/common/exception/file/FileUploadException.java @@ -0,0 +1,61 @@ +package com.ruoyi.common.exception.file; + +import java.io.PrintStream; +import java.io.PrintWriter; + +/** + * 文件上传异常类 + * + * @author ruoyi + */ +public class FileUploadException extends Exception +{ + + private static final long serialVersionUID = 1L; + + private final Throwable cause; + + public FileUploadException() + { + this(null, null); + } + + public FileUploadException(final String msg) + { + this(msg, null); + } + + public FileUploadException(String msg, Throwable cause) + { + super(msg); + this.cause = cause; + } + + @Override + public void printStackTrace(PrintStream stream) + { + super.printStackTrace(stream); + if (cause != null) + { + stream.println("Caused by:"); + cause.printStackTrace(stream); + } + } + + @Override + public void printStackTrace(PrintWriter writer) + { + super.printStackTrace(writer); + if (cause != null) + { + writer.println("Caused by:"); + cause.printStackTrace(writer); + } + } + + @Override + public Throwable getCause() + { + return cause; + } +} diff --git a/src/main/java/com/ruoyi/common/exception/file/InvalidExtensionException.java b/src/main/java/com/ruoyi/common/exception/file/InvalidExtensionException.java index 1d1eedfbe..c40e0b00f 100644 --- a/src/main/java/com/ruoyi/common/exception/file/InvalidExtensionException.java +++ b/src/main/java/com/ruoyi/common/exception/file/InvalidExtensionException.java @@ -1,7 +1,6 @@ package com.ruoyi.common.exception.file; import java.util.Arrays; -import org.apache.commons.fileupload.FileUploadException; /** * 文件上传 误异常类 diff --git a/src/main/java/com/ruoyi/common/exception/user/BlackListException.java b/src/main/java/com/ruoyi/common/exception/user/BlackListException.java new file mode 100644 index 000000000..2bf503865 --- /dev/null +++ b/src/main/java/com/ruoyi/common/exception/user/BlackListException.java @@ -0,0 +1,16 @@ +package com.ruoyi.common.exception.user; + +/** + * 黑名单IP异常类 + * + * @author ruoyi + */ +public class BlackListException extends UserException +{ + private static final long serialVersionUID = 1L; + + public BlackListException() + { + super("login.blocked", null); + } +} diff --git a/src/main/java/com/ruoyi/common/utils/DateUtils.java b/src/main/java/com/ruoyi/common/utils/DateUtils.java index a2cb78d99..20dbbb746 100644 --- a/src/main/java/com/ruoyi/common/utils/DateUtils.java +++ b/src/main/java/com/ruoyi/common/utils/DateUtils.java @@ -145,16 +145,20 @@ public static int differentDaysByMillisecond(Date date1, Date date2) } /** - * 计算两个时间差 + * 计算时间差 + * + * @param endDate 最后时间 + * @param startTime 开始时间 + * @return 时间差(天/小时/分钟) */ - public static String getDatePoor(Date endDate, Date nowDate) + public static String timeDistance(Date endDate, Date startTime) { long nd = 1000 * 24 * 60 * 60; long nh = 1000 * 60 * 60; long nm = 1000 * 60; // long ns = 1000; // 获得两个时间的毫秒时间差异 - long diff = endDate.getTime() - nowDate.getTime(); + long diff = endDate.getTime() - startTime.getTime(); // 计算差多少天 long day = diff / nd; // 计算差多少小时 diff --git a/src/main/java/com/ruoyi/common/utils/DesensitizedUtil.java b/src/main/java/com/ruoyi/common/utils/DesensitizedUtil.java new file mode 100644 index 000000000..f8a4c022e --- /dev/null +++ b/src/main/java/com/ruoyi/common/utils/DesensitizedUtil.java @@ -0,0 +1,49 @@ +package com.ruoyi.common.utils; + +/** + * 脱敏工具类 + * + * @author ruoyi + */ +public class DesensitizedUtil +{ + /** + * 密码的全部字符都用*代替,比如:****** + * + * @param password 密码 + * @return 脱敏后的密码 + */ + public static String password(String password) + { + if (StringUtils.isBlank(password)) + { + return StringUtils.EMPTY; + } + return StringUtils.repeat('*', password.length()); + } + + /** + * 车牌中间用*代替,如果是错误的车牌,不处理 + * + * @param carLicense 完整的车牌号 + * @return 脱敏后的车牌 + */ + public static String carLicense(String carLicense) + { + if (StringUtils.isBlank(carLicense)) + { + return StringUtils.EMPTY; + } + // 普通车牌 + if (carLicense.length() == 7) + { + carLicense = StringUtils.hide(carLicense, 3, 6); + } + else if (carLicense.length() == 8) + { + // 新能源车牌 + carLicense = StringUtils.hide(carLicense, 3, 7); + } + return carLicense; + } +} diff --git a/src/main/java/com/ruoyi/common/utils/ExceptionUtil.java b/src/main/java/com/ruoyi/common/utils/ExceptionUtil.java index 33e4e05bd..4ced7a242 100644 --- a/src/main/java/com/ruoyi/common/utils/ExceptionUtil.java +++ b/src/main/java/com/ruoyi/common/utils/ExceptionUtil.java @@ -37,4 +37,32 @@ public static String getRootErrorMessage(Exception e) } return StringUtils.defaultString(msg); } + + /** + * 检测异常e被触发的原因是不是因为异常cause。 + * + * @param e 捕获的异常。 + * @param cause 异常触发原因。 + * @return 如果异常e是由cause类异常触发,则返回true;否则返回false。 + */ + public static boolean isCausedBy(final Throwable e, final Class cause) + { + if (cause.isAssignableFrom(e.getClass())) + { + return true; + } + else + { + Throwable t = e.getCause(); + while (t != null && t != e) + { + if (cause.isAssignableFrom(t.getClass())) + { + return true; + } + t = t.getCause(); + } + return false; + } + } } diff --git a/src/main/java/com/ruoyi/common/utils/IpUtils.java b/src/main/java/com/ruoyi/common/utils/IpUtils.java index 5b3baa002..1a3f210cd 100644 --- a/src/main/java/com/ruoyi/common/utils/IpUtils.java +++ b/src/main/java/com/ruoyi/common/utils/IpUtils.java @@ -11,6 +11,13 @@ */ public class IpUtils { + public final static String REGX_0_255 = "(25[0-5]|2[0-4]\\d|1\\d{2}|[1-9]\\d|\\d)"; + // 匹配 ip + public final static String REGX_IP = "((" + REGX_0_255 + "\\.){3}" + REGX_0_255 + ")"; + public final static String REGX_IP_WILDCARD = "(((\\*\\.){3}\\*)|(" + REGX_0_255 + "(\\.\\*){3})|(" + REGX_0_255 + "\\." + REGX_0_255 + ")(\\.\\*){2}" + "|((" + REGX_0_255 + "\\.){3}\\*))"; + // 匹配网段 + public final static String REGX_IP_SEG = "(" + REGX_IP + "\\-" + REGX_IP + ")"; + /** * 获取客户端IP * @@ -247,7 +254,7 @@ public static String getMultistageReverseProxyIp(String ip) } } } - return ip; + return StringUtils.substring(ip, 0, 255); } /** @@ -260,4 +267,104 @@ public static boolean isUnknown(String checkString) { return StringUtils.isBlank(checkString) || "unknown".equalsIgnoreCase(checkString); } + + /** + * 是否为IP + */ + public static boolean isIP(String ip) + { + return StringUtils.isNotBlank(ip) && ip.matches(REGX_IP); + } + + /** + * 是否为IP,或 *为间隔的通配符地址 + */ + public static boolean isIpWildCard(String ip) + { + return StringUtils.isNotBlank(ip) && ip.matches(REGX_IP_WILDCARD); + } + + /** + * 检测参数是否在ip通配符里 + */ + public static boolean ipIsInWildCardNoCheck(String ipWildCard, String ip) + { + String[] s1 = ipWildCard.split("\\."); + String[] s2 = ip.split("\\."); + boolean isMatchedSeg = true; + for (int i = 0; i < s1.length && !s1[i].equals("*"); i++) + { + if (!s1[i].equals(s2[i])) + { + isMatchedSeg = false; + break; + } + } + return isMatchedSeg; + } + + /** + * 是否为特定格式如:“10.10.10.1-10.10.10.99”的ip段字符串 + */ + public static boolean isIPSegment(String ipSeg) + { + return StringUtils.isNotBlank(ipSeg) && ipSeg.matches(REGX_IP_SEG); + } + + /** + * 判断ip是否在指定网段中 + */ + public static boolean ipIsInNetNoCheck(String iparea, String ip) + { + int idx = iparea.indexOf('-'); + String[] sips = iparea.substring(0, idx).split("\\."); + String[] sipe = iparea.substring(idx + 1).split("\\."); + String[] sipt = ip.split("\\."); + long ips = 0L, ipe = 0L, ipt = 0L; + for (int i = 0; i < 4; ++i) + { + ips = ips << 8 | Integer.parseInt(sips[i]); + ipe = ipe << 8 | Integer.parseInt(sipe[i]); + ipt = ipt << 8 | Integer.parseInt(sipt[i]); + } + if (ips > ipe) + { + long t = ips; + ips = ipe; + ipe = t; + } + return ips <= ipt && ipt <= ipe; + } + + /** + * 校验ip是否符合过滤串规则 + * + * @param filter 过滤IP列表,支持后缀'*'通配,支持网段如:`10.10.10.1-10.10.10.99` + * @param ip 校验IP地址 + * @return boolean 结果 + */ + public static boolean isMatchedIp(String filter, String ip) + { + if (StringUtils.isEmpty(filter) || StringUtils.isEmpty(ip)) + { + return false; + } + String[] ips = filter.split(";"); + for (String iStr : ips) + { + if (isIP(iStr) && iStr.equals(ip)) + { + return true; + } + else if (isIpWildCard(iStr) && ipIsInWildCardNoCheck(iStr, ip)) + { + return true; + } + else if (isIPSegment(iStr) && ipIsInNetNoCheck(iStr, ip)) + { + return true; + } + } + return false; + } } \ No newline at end of file diff --git a/src/main/java/com/ruoyi/common/utils/StringUtils.java b/src/main/java/com/ruoyi/common/utils/StringUtils.java index 641c4decb..5684b0462 100644 --- a/src/main/java/com/ruoyi/common/utils/StringUtils.java +++ b/src/main/java/com/ruoyi/common/utils/StringUtils.java @@ -23,6 +23,9 @@ public class StringUtils extends org.apache.commons.lang3.StringUtils /** 下划线 */ private static final char SEPARATOR = '_'; + /** 星号 */ + private static final char ASTERISK = '*'; + /** * 获取参数不为空值 * @@ -163,6 +166,49 @@ public static String trim(String str) return (str == null ? "" : str.trim()); } + /** + * 替换指定字符串的指定区间内字符为"*" + * + * @param str 字符串 + * @param startInclude 开始位置(包含) + * @param endExclude 结束位置(不包含) + * @return 替换后的字符串 + */ + public static String hide(CharSequence str, int startInclude, int endExclude) + { + if (isEmpty(str)) + { + return NULLSTR; + } + final int strLength = str.length(); + if (startInclude > strLength) + { + return NULLSTR; + } + if (endExclude > strLength) + { + endExclude = strLength; + } + if (startInclude > endExclude) + { + // 如果起始位置大于结束位置,不替换 + return NULLSTR; + } + final char[] chars = new char[strLength]; + for (int i = 0; i < strLength; i++) + { + if (i >= startInclude && i < endExclude) + { + chars[i] = ASTERISK; + } + else + { + chars[i] = str.charAt(i); + } + } + return new String(chars); + } + /** * 截取字符串 * @@ -325,9 +371,9 @@ public static final List str2List(String str, String sep, boolean filter } /** - * 判断给定的set列表中是否包含数组array 判断给定的数组array中是否包含给定的元素value + * 判断给定的collection列表中是否包含数组array 判断给定的数组array中是否包含给定的元素value * - * @param set 给定的集合 + * @param collection 给定的集合 * @param array 给定的数组 * @return boolean 结果 */ diff --git a/src/main/java/com/ruoyi/common/utils/file/FileUploadUtils.java b/src/main/java/com/ruoyi/common/utils/file/FileUploadUtils.java index c909fbcf0..7ffde0d4c 100644 --- a/src/main/java/com/ruoyi/common/utils/file/FileUploadUtils.java +++ b/src/main/java/com/ruoyi/common/utils/file/FileUploadUtils.java @@ -25,7 +25,7 @@ public class FileUploadUtils /** * 默认大小 50M */ - public static final long DEFAULT_MAX_SIZE = 50 * 1024 * 1024; + public static final long DEFAULT_MAX_SIZE = 50 * 1024 * 1024L; /** * 默认的文件名最大长度 100 @@ -102,8 +102,8 @@ public static final String upload(String baseDir, MultipartFile file, String[] a throws FileSizeLimitExceededException, IOException, FileNameLengthLimitExceededException, InvalidExtensionException { - int fileNamelength = Objects.requireNonNull(file.getOriginalFilename()).length(); - if (fileNamelength > FileUploadUtils.DEFAULT_FILE_NAME_LENGTH) + int fileNameLength = Objects.requireNonNull(file.getOriginalFilename()).length(); + if (fileNameLength > FileUploadUtils.DEFAULT_FILE_NAME_LENGTH) { throw new FileNameLengthLimitExceededException(FileUploadUtils.DEFAULT_FILE_NAME_LENGTH); } diff --git a/src/main/java/com/ruoyi/common/utils/file/FileUtils.java b/src/main/java/com/ruoyi/common/utils/file/FileUtils.java index fda8267a2..53090e510 100644 --- a/src/main/java/com/ruoyi/common/utils/file/FileUtils.java +++ b/src/main/java/com/ruoyi/common/utils/file/FileUtils.java @@ -116,8 +116,7 @@ public static boolean deleteFile(String filePath) // 路径为文件且不为空则进行删除 if (file.isFile() && file.exists()) { - file.delete(); - flag = true; + flag = file.delete(); } return flag; } diff --git a/src/main/java/com/ruoyi/common/utils/http/HttpUtils.java b/src/main/java/com/ruoyi/common/utils/http/HttpUtils.java index 1fdb68c67..46f56ab02 100644 --- a/src/main/java/com/ruoyi/common/utils/http/HttpUtils.java +++ b/src/main/java/com/ruoyi/common/utils/http/HttpUtils.java @@ -74,7 +74,7 @@ public static String sendGet(String url, String param, String contentType) URLConnection connection = realUrl.openConnection(); connection.setRequestProperty("accept", "*/*"); connection.setRequestProperty("connection", "Keep-Alive"); - connection.setRequestProperty("user-agent", "Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1;SV1)"); + connection.setRequestProperty("user-agent", "Mozilla/5.0 (Windows NT 10.0; Win64; x64)"); connection.connect(); in = new BufferedReader(new InputStreamReader(connection.getInputStream(), contentType)); String line; @@ -136,7 +136,7 @@ public static String sendPost(String url, String param) URLConnection conn = realUrl.openConnection(); conn.setRequestProperty("accept", "*/*"); conn.setRequestProperty("connection", "Keep-Alive"); - conn.setRequestProperty("user-agent", "Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1;SV1)"); + conn.setRequestProperty("user-agent", "Mozilla/5.0 (Windows NT 10.0; Win64; x64)"); conn.setRequestProperty("Accept-Charset", "utf-8"); conn.setRequestProperty("contentType", "utf-8"); conn.setDoOutput(true); @@ -202,7 +202,7 @@ public static String sendSSLPost(String url, String param) HttpsURLConnection conn = (HttpsURLConnection) console.openConnection(); conn.setRequestProperty("accept", "*/*"); conn.setRequestProperty("connection", "Keep-Alive"); - conn.setRequestProperty("user-agent", "Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1;SV1)"); + conn.setRequestProperty("user-agent", "Mozilla/5.0 (Windows NT 10.0; Win64; x64)"); conn.setRequestProperty("Accept-Charset", "utf-8"); conn.setRequestProperty("contentType", "utf-8"); conn.setDoOutput(true); diff --git a/src/main/java/com/ruoyi/common/utils/poi/ExcelHandlerAdapter.java b/src/main/java/com/ruoyi/common/utils/poi/ExcelHandlerAdapter.java index 5ea74c11e..ccab28818 100644 --- a/src/main/java/com/ruoyi/common/utils/poi/ExcelHandlerAdapter.java +++ b/src/main/java/com/ruoyi/common/utils/poi/ExcelHandlerAdapter.java @@ -1,5 +1,8 @@ package com.ruoyi.common.utils.poi; +import org.apache.poi.ss.usermodel.Cell; +import org.apache.poi.ss.usermodel.Workbook; + /** * Excel数据格式处理适配器 * @@ -12,8 +15,10 @@ public interface ExcelHandlerAdapter * * @param value 单元格数据值 * @param args excel注解args参数组 + * @param cell 单元格对象 + * @param wb 工作簿对象 * * @return 处理后的值 */ - Object format(Object value, String[] args); + Object format(Object value, String[] args, Cell cell, Workbook wb); } diff --git a/src/main/java/com/ruoyi/common/utils/poi/ExcelUtil.java b/src/main/java/com/ruoyi/common/utils/poi/ExcelUtil.java index 8abad49af..15906f869 100644 --- a/src/main/java/com/ruoyi/common/utils/poi/ExcelUtil.java +++ b/src/main/java/com/ruoyi/common/utils/poi/ExcelUtil.java @@ -39,6 +39,7 @@ import org.apache.poi.ss.usermodel.CellStyle; import org.apache.poi.ss.usermodel.CellType; import org.apache.poi.ss.usermodel.ClientAnchor; +import org.apache.poi.ss.usermodel.DataFormat; import org.apache.poi.ss.usermodel.DataValidation; import org.apache.poi.ss.usermodel.DataValidationConstraint; import org.apache.poi.ss.usermodel.DataValidationHelper; @@ -48,6 +49,7 @@ import org.apache.poi.ss.usermodel.Font; import org.apache.poi.ss.usermodel.HorizontalAlignment; import org.apache.poi.ss.usermodel.IndexedColors; +import org.apache.poi.ss.usermodel.Name; import org.apache.poi.ss.usermodel.PictureData; import org.apache.poi.ss.usermodel.Row; import org.apache.poi.ss.usermodel.Sheet; @@ -97,6 +99,11 @@ public class ExcelUtil public static final String[] FORMULA_STR = { "=", "-", "+", "@" }; + /** + * 用于dictType属性数据存储,避免重复查缓存 + */ + public Map sysDictMap = new HashMap(); + /** * Excel sheet最大行数,默认65536 */ @@ -187,6 +194,11 @@ public class ExcelUtil */ public Class clazz; + /** + * 需要显示列属性 + */ + public String[] includeFields; + /** * 需要排除列属性 */ @@ -197,11 +209,20 @@ public ExcelUtil(Class clazz) this.clazz = clazz; } + /** + * 仅在Excel中显示列属性 + * + * @param fields 列属性名 示例[单个"name"/多个"id","name"] + */ + public void showColumn(String... fields) + { + this.includeFields = fields; + } + /** * 隐藏Excel中列属性 * * @param fields 列属性名 示例[单个"name"/多个"id","name"] - * @throws Exception */ public void hideColumn(String... fields) { @@ -231,8 +252,6 @@ public void createTitle() { if (StringUtils.isNotEmpty(title)) { - subMergedFirstRowNum++; - subMergedLastRowNum++; int titleLastCol = this.fields.size() - 1; if (isSubList()) { @@ -243,7 +262,7 @@ public void createTitle() Cell titleCell = titleRow.createCell(0); titleCell.setCellStyle(styles.get("title")); titleCell.setCellValue(title); - sheet.addMergedRegion(new CellRangeAddress(titleRow.getRowNum(), titleRow.getRowNum(), titleRow.getRowNum(), titleLastCol)); + sheet.addMergedRegion(new CellRangeAddress(titleRow.getRowNum(), titleRow.getRowNum(), 0, titleLastCol)); } } @@ -254,23 +273,31 @@ public void createSubHead() { if (isSubList()) { - subMergedFirstRowNum++; - subMergedLastRowNum++; Row subRow = sheet.createRow(rownum); - int excelNum = 0; + int column = 0; + int subFieldSize = subFields != null ? subFields.size() : 0; for (Object[] objects : fields) { + Field field = (Field) objects[0]; Excel attr = (Excel) objects[1]; - Cell headCell1 = subRow.createCell(excelNum); - headCell1.setCellValue(attr.name()); - headCell1.setCellStyle(styles.get(StringUtils.format("header_{}_{}", attr.headerColor(), attr.headerBackgroundColor()))); - excelNum++; - } - int headFirstRow = excelNum - 1; - int headLastRow = headFirstRow + subFields.size() - 1; - if (headLastRow > headFirstRow) - { - sheet.addMergedRegion(new CellRangeAddress(rownum, rownum, headFirstRow, headLastRow)); + if (Collection.class.isAssignableFrom(field.getType())) + { + Cell cell = subRow.createCell(column); + cell.setCellValue(attr.name()); + cell.setCellStyle(styles.get(StringUtils.format("header_{}_{}", attr.headerColor(), attr.headerBackgroundColor()))); + if (subFieldSize > 1) + { + CellRangeAddress cellAddress = new CellRangeAddress(rownum, rownum, column, column + subFieldSize - 1); + sheet.addMergedRegion(cellAddress); + } + column += subFieldSize; + } + else + { + Cell cell = subRow.createCell(column++); + cell.setCellValue(attr.name()); + cell.setCellStyle(styles.get(StringUtils.format("header_{}_{}", attr.headerColor(), attr.headerBackgroundColor()))); + } } rownum++; } @@ -282,7 +309,7 @@ public void createSubHead() * @param is 输入流 * @return 转换后集合 */ - public List importExcel(InputStream is) throws Exception + public List importExcel(InputStream is) { return importExcel(is, 0); } @@ -294,9 +321,23 @@ public List importExcel(InputStream is) throws Exception * @param titleNum 标题占用行数 * @return 转换后集合 */ - public List importExcel(InputStream is, int titleNum) throws Exception + public List importExcel(InputStream is, int titleNum) { - return importExcel(StringUtils.EMPTY, is, titleNum); + List list = null; + try + { + list = importExcel(StringUtils.EMPTY, is, titleNum); + } + catch (Exception e) + { + log.error("导入Excel异常{}", e.getMessage()); + throw new UtilException(e.getMessage()); + } + finally + { + IOUtils.closeQuietly(is); + } + return list; } /** @@ -330,7 +371,6 @@ public List importExcel(String sheetName, InputStream is, int titleNum) throw } // 获取最后一个非空行的行下标,比如总行数为n,则返回的为n-1 int rows = sheet.getLastRowNum(); - if (rows > 0) { // 定义一个map用于存放excel列的序号和field. @@ -445,17 +485,22 @@ else if (Boolean.TYPE == fieldType || Boolean.class == fieldType) { propertyName = field.getName() + "." + attr.targetAttr(); } - else if (StringUtils.isNotEmpty(attr.readConverterExp())) + if (StringUtils.isNotEmpty(attr.readConverterExp())) { val = reverseByExp(Convert.toStr(val), attr.readConverterExp(), attr.separator()); } else if (StringUtils.isNotEmpty(attr.dictType())) { - val = reverseDictByExp(Convert.toStr(val), attr.dictType(), attr.separator()); + if (!sysDictMap.containsKey(attr.dictType() + val)) + { + String dictValue = reverseDictByExp(Convert.toStr(val), attr.dictType(), attr.separator()); + sysDictMap.put(attr.dictType() + val, dictValue); + } + val = sysDictMap.get(attr.dictType() + val); } else if (!attr.handler().equals(ExcelHandlerAdapter.class)) { - val = dataFormatHandlerAdapter(val, attr); + val = dataFormatHandlerAdapter(val, attr, null); } else if (ColumnType.IMAGE == attr.cellType() && StringUtils.isNotEmpty(pictures)) { @@ -686,57 +731,91 @@ public void fillExcelData(int index, Row row) { int startNo = index * sheetSize; int endNo = Math.min(startNo + sheetSize, list.size()); - int rowNo = (1 + rownum) - startNo; + int currentRowNum = rownum + 1; // 从标题行后开始 + for (int i = startNo; i < endNo; i++) { - rowNo = i > 1 ? rowNo + 1 : rowNo + i; - row = sheet.createRow(rowNo); - // 得到导出对象. + row = sheet.createRow(currentRowNum); T vo = (T) list.get(i); - Collection subList = null; - if (isSubListValue(vo)) - { - subList = getListCellValue(vo); - subMergedLastRowNum = subMergedLastRowNum + subList.size(); - } - int column = 0; + int maxSubListSize = getCurrentMaxSubListSize(vo); for (Object[] os : fields) { Field field = (Field) os[0]; Excel excel = (Excel) os[1]; - if (Collection.class.isAssignableFrom(field.getType()) && StringUtils.isNotNull(subList)) + if (Collection.class.isAssignableFrom(field.getType())) { - boolean subFirst = false; - for (Object obj : subList) + try { - if (subFirst) + Collection subList = (Collection) getTargetValue(vo, field, excel); + if (subList != null && !subList.isEmpty()) { - rowNo++; - row = sheet.createRow(rowNo); - } - List subFields = FieldUtils.getFieldsListWithAnnotation(obj.getClass(), Excel.class); - int subIndex = 0; - for (Field subField : subFields) - { - if (subField.isAnnotationPresent(Excel.class)) + int subIndex = 0; + for (Object subVo : subList) { - subField.setAccessible(true); - Excel attr = subField.getAnnotation(Excel.class); - this.addCell(attr, row, (T) obj, subField, column + subIndex); + Row subRow = sheet.getRow(currentRowNum + subIndex); + if (subRow == null) + { + subRow = sheet.createRow(currentRowNum + subIndex); + } + + int subColumn = column; + for (Field subField : subFields) + { + Excel subExcel = subField.getAnnotation(Excel.class); + addCell(subExcel, subRow, (T) subVo, subField, subColumn++); + } + subIndex++; } - subIndex++; + column += subFields.size(); } - subFirst = true; } - this.subMergedFirstRowNum = this.subMergedFirstRowNum + subList.size(); + catch (Exception e) + { + log.error("填充集合数据失败", e); + } } else { - this.addCell(excel, row, vo, field, column++); + // 创建单元格并设置值 + addCell(excel, row, vo, field, column); + if (maxSubListSize > 1 && excel.needMerge()) + { + sheet.addMergedRegion(new CellRangeAddress(currentRowNum, currentRowNum + maxSubListSize - 1, column, column)); + } + column++; + } + } + currentRowNum += maxSubListSize; + } + } + + /** + * 获取子列表最大数 + */ + private int getCurrentMaxSubListSize(T vo) + { + int maxSubListSize = 1; + for (Object[] os : fields) + { + Field field = (Field) os[0]; + if (Collection.class.isAssignableFrom(field.getType())) + { + try + { + Collection subList = (Collection) getTargetValue(vo, field, (Excel) os[1]); + if (subList != null && !subList.isEmpty()) + { + maxSubListSize = Math.max(maxSubListSize, subList.size()); + } + } + catch (Exception e) + { + log.error("获取集合大小失败", e); } } } + return maxSubListSize; } /** @@ -757,6 +836,8 @@ private Map createStyles(Workbook wb) titleFont.setFontHeightInPoints((short) 16); titleFont.setBold(true); style.setFont(titleFont); + DataFormat dataFormat = wb.createDataFormat(); + style.setDataFormat(dataFormat.getFormat("@")); styles.put("title", style); style = wb.createCellStyle(); @@ -808,7 +889,6 @@ private Map annotationHeaderStyles(Workbook wb, Map annotationHeaderStyles(Workbook wb, Map annotationDataStyles(Workbook wb) Map styles = new HashMap(); for (Object[] os : fields) { + Field field = (Field) os[0]; Excel excel = (Excel) os[1]; - String key = StringUtils.format("data_{}_{}_{}", excel.align(), excel.color(), excel.backgroundColor()); - if (!styles.containsKey(key)) + if (Collection.class.isAssignableFrom(field.getType())) { - CellStyle style = wb.createCellStyle(); - style = wb.createCellStyle(); - style.setAlignment(excel.align()); - style.setVerticalAlignment(VerticalAlignment.CENTER); - style.setBorderRight(BorderStyle.THIN); - style.setRightBorderColor(IndexedColors.GREY_50_PERCENT.getIndex()); - style.setBorderLeft(BorderStyle.THIN); - style.setLeftBorderColor(IndexedColors.GREY_50_PERCENT.getIndex()); - style.setBorderTop(BorderStyle.THIN); - style.setTopBorderColor(IndexedColors.GREY_50_PERCENT.getIndex()); - style.setBorderBottom(BorderStyle.THIN); - style.setBottomBorderColor(IndexedColors.GREY_50_PERCENT.getIndex()); - style.setFillPattern(FillPatternType.SOLID_FOREGROUND); - style.setFillForegroundColor(excel.backgroundColor().getIndex()); - Font dataFont = wb.createFont(); - dataFont.setFontName("Arial"); - dataFont.setFontHeightInPoints((short) 10); - dataFont.setColor(excel.color().index); - style.setFont(dataFont); - styles.put(key, style); + ParameterizedType pt = (ParameterizedType) field.getGenericType(); + Class subClass = (Class) pt.getActualTypeArguments()[0]; + List subFields = FieldUtils.getFieldsListWithAnnotation(subClass, Excel.class); + for (Field subField : subFields) + { + Excel subExcel = subField.getAnnotation(Excel.class); + annotationDataStyles(styles, subField, subExcel); + } + } + else + { + annotationDataStyles(styles, field, excel); } } return styles; } + /** + * 根据Excel注解创建表格列样式 + * + * @param styles 自定义样式列表 + * @param field 属性列信息 + * @param excel 注解信息 + */ + public void annotationDataStyles(Map styles, Field field, Excel excel) + { + String key = StringUtils.format("data_{}_{}_{}_{}_{}", excel.align(), excel.color(), excel.backgroundColor(), excel.cellType(), excel.wrapText()); + if (!styles.containsKey(key)) + { + CellStyle style = wb.createCellStyle(); + style.setAlignment(excel.align()); + style.setVerticalAlignment(VerticalAlignment.CENTER); + style.setBorderRight(BorderStyle.THIN); + style.setRightBorderColor(IndexedColors.GREY_50_PERCENT.getIndex()); + style.setBorderLeft(BorderStyle.THIN); + style.setLeftBorderColor(IndexedColors.GREY_50_PERCENT.getIndex()); + style.setBorderTop(BorderStyle.THIN); + style.setTopBorderColor(IndexedColors.GREY_50_PERCENT.getIndex()); + style.setBorderBottom(BorderStyle.THIN); + style.setBottomBorderColor(IndexedColors.GREY_50_PERCENT.getIndex()); + style.setFillPattern(FillPatternType.SOLID_FOREGROUND); + style.setFillForegroundColor(excel.backgroundColor().getIndex()); + style.setWrapText(excel.wrapText()); + Font dataFont = wb.createFont(); + dataFont.setFontName("Arial"); + dataFont.setFontHeightInPoints((short) 10); + dataFont.setColor(excel.color().index); + style.setFont(dataFont); + if (ColumnType.TEXT == excel.cellType()) + { + DataFormat dataFormat = wb.createDataFormat(); + style.setDataFormat(dataFormat.getFormat("@")); + } + styles.put(key, style); + } + } + /** * 创建单元格 */ @@ -880,7 +995,7 @@ public Cell createHeadCell(Excel attr, Row row, int column) if (isSubList()) { // 填充默认样式,防止合并单元格样式失效 - sheet.setDefaultColumnStyle(column, styles.get(StringUtils.format("data_{}_{}_{}", attr.align(), attr.color(), attr.backgroundColor()))); + sheet.setDefaultColumnStyle(column, styles.get(StringUtils.format("data_{}_{}_{}_{}_{}", attr.align(), attr.color(), attr.backgroundColor(), attr.cellType(), attr.wrapText()))); if (attr.needMerge()) { sheet.addMergedRegion(new CellRangeAddress(rownum - 1, rownum, column, column)); @@ -898,7 +1013,7 @@ public Cell createHeadCell(Excel attr, Row row, int column) */ public void setCellVo(Object value, Excel attr, Cell cell) { - if (ColumnType.STRING == attr.cellType()) + if (ColumnType.STRING == attr.cellType() || ColumnType.TEXT == attr.cellType()) { String cellValue = Convert.toStr(value); // 对于任何以表达式触发字符 =-+@开头的单元格,直接使用tab字符作为前缀,防止CSV注入。 @@ -906,6 +1021,10 @@ public void setCellVo(Object value, Excel attr, Cell cell) { cellValue = RegExUtils.replaceFirst(cellValue, FORMULA_REGEX_STR, "\t$0"); } + if (value instanceof Collection && StringUtils.equals("[]", cellValue)) + { + cellValue = StringUtils.EMPTY; + } cell.setCellValue(StringUtils.isNull(cellValue) ? attr.defaultValue() : cellValue + attr.suffix()); } else if (ColumnType.NUMERIC == attr.cellType()) @@ -971,10 +1090,29 @@ public void setDataValidation(Excel attr, Row row, int column) // 设置列宽 sheet.setColumnWidth(column, (int) ((attr.width() + 0.72) * 256)); } - if (StringUtils.isNotEmpty(attr.prompt()) || attr.combo().length > 0) + if (StringUtils.isNotEmpty(attr.prompt()) || attr.combo().length > 0 || attr.comboReadDict()) { - // 提示信息或只能选择不能输入的列内容. - setPromptOrValidation(sheet, attr.combo(), attr.prompt(), 1, 100, column, column); + String[] comboArray = attr.combo(); + if (attr.comboReadDict()) + { + if (!sysDictMap.containsKey("combo_" + attr.dictType())) + { + String labels = DictUtils.getDictLabels(attr.dictType()); + sysDictMap.put("combo_" + attr.dictType(), labels); + } + String val = sysDictMap.get("combo_" + attr.dictType()); + comboArray = StringUtils.split(val, DictUtils.SEPARATOR); + } + if (comboArray.length > 15 || StringUtils.join(comboArray).length() > 255) + { + // 如果下拉数大于15或字符串长度大于255,则使用一个新sheet存储,避免生成的模板下拉值获取不到 + setXSSFValidationWithHidden(sheet, comboArray, attr.prompt(), 1, 100, column, column); + } + else + { + // 提示信息或只能选择不能输入的列内容. + setPromptOrValidation(sheet, comboArray, attr.prompt(), 1, 100, column, column); + } } } @@ -995,10 +1133,12 @@ public Cell addCell(Excel attr, Row row, T vo, Field field, int column) cell = row.createCell(column); if (isSubListValue(vo) && getListCellValue(vo).size() > 1 && attr.needMerge()) { - CellRangeAddress cellAddress = new CellRangeAddress(subMergedFirstRowNum, subMergedLastRowNum, column, column); - sheet.addMergedRegion(cellAddress); + if (subMergedLastRowNum >= subMergedFirstRowNum) + { + sheet.addMergedRegion(new CellRangeAddress(subMergedFirstRowNum, subMergedLastRowNum, column, column)); + } } - cell.setCellStyle(styles.get(StringUtils.format("data_{}_{}_{}", attr.align(), attr.color(), attr.backgroundColor()))); + cell.setCellStyle(styles.get(StringUtils.format("data_{}_{}_{}_{}_{}", attr.align(), attr.color(), attr.backgroundColor(), attr.cellType(), attr.wrapText()))); // 用于读取对象中的属性 Object value = getTargetValue(vo, field, attr); @@ -1016,7 +1156,12 @@ else if (StringUtils.isNotEmpty(readConverterExp) && StringUtils.isNotNull(value } else if (StringUtils.isNotEmpty(dictType) && StringUtils.isNotNull(value)) { - cell.setCellValue(convertDictByExp(Convert.toStr(value), dictType, separator)); + if (!sysDictMap.containsKey(dictType + value)) + { + String lable = convertDictByExp(Convert.toStr(value), dictType, separator); + sysDictMap.put(dictType + value, lable); + } + cell.setCellValue(sysDictMap.get(dictType + value)); } else if (value instanceof BigDecimal && -1 != attr.scale()) { @@ -1024,7 +1169,7 @@ else if (value instanceof BigDecimal && -1 != attr.scale()) } else if (!attr.handler().equals(ExcelHandlerAdapter.class)) { - cell.setCellValue(dataFormatHandlerAdapter(value, attr)); + cell.setCellValue(dataFormatHandlerAdapter(value, attr, cell)); } else { @@ -1078,6 +1223,58 @@ public void setPromptOrValidation(Sheet sheet, String[] textlist, String promptC sheet.addValidationData(dataValidation); } + /** + * 设置某些列的值只能输入预制的数据,显示下拉框(兼容超出一定数量的下拉框). + * + * @param sheet 要设置的sheet. + * @param textlist 下拉框显示的内容 + * @param promptContent 提示内容 + * @param firstRow 开始行 + * @param endRow 结束行 + * @param firstCol 开始列 + * @param endCol 结束列 + */ + public void setXSSFValidationWithHidden(Sheet sheet, String[] textlist, String promptContent, int firstRow, int endRow, int firstCol, int endCol) + { + String hideSheetName = "combo_" + firstCol + "_" + endCol; + Sheet hideSheet = wb.createSheet(hideSheetName); // 用于存储 下拉菜单数据 + for (int i = 0; i < textlist.length; i++) + { + hideSheet.createRow(i).createCell(0).setCellValue(textlist[i]); + } + // 创建名称,可被其他单元格引用 + Name name = wb.createName(); + name.setNameName(hideSheetName + "_data"); + name.setRefersToFormula(hideSheetName + "!$A$1:$A$" + textlist.length); + DataValidationHelper helper = sheet.getDataValidationHelper(); + // 加载下拉列表内容 + DataValidationConstraint constraint = helper.createFormulaListConstraint(hideSheetName + "_data"); + // 设置数据有效性加载在哪个单元格上,四个参数分别是:起始行、终止行、起始列、终止列 + CellRangeAddressList regions = new CellRangeAddressList(firstRow, endRow, firstCol, endCol); + // 数据有效性对象 + DataValidation dataValidation = helper.createValidation(constraint, regions); + if (StringUtils.isNotEmpty(promptContent)) + { + // 如果设置了提示信息则鼠标放上去提示 + dataValidation.createPromptBox("", promptContent); + dataValidation.setShowPromptBox(true); + } + // 处理Excel兼容性问题 + if (dataValidation instanceof XSSFDataValidation) + { + dataValidation.setSuppressDropDownArrow(true); + dataValidation.setShowErrorBox(true); + } + else + { + dataValidation.setSuppressDropDownArrow(false); + } + + sheet.addValidationData(dataValidation); + // 设置hiddenSheet隐藏 + wb.setSheetHidden(wb.getSheetIndex(hideSheet), true); + } + /** * 解析导出值 0=男,1=女,2=未知 * @@ -1185,13 +1382,13 @@ public static String reverseDictByExp(String dictLabel, String dictType, String * @param excel 数据注解 * @return */ - public String dataFormatHandlerAdapter(Object value, Excel excel) + public String dataFormatHandlerAdapter(Object value, Excel excel, Cell cell) { try { Object instance = excel.handler().newInstance(); - Method formatMethod = excel.handler().getMethod("format", new Class[] { Object.class, String[].class }); - value = formatMethod.invoke(instance, value, excel.args()); + Method formatMethod = excel.handler().getMethod("format", new Class[] { Object.class, String[].class, Cell.class, Workbook.class }); + value = formatMethod.invoke(instance, value, excel.args(), cell, this.wb); } catch (Exception e) { @@ -1251,7 +1448,7 @@ public void addStatisticsRow() */ public String encodingFilename(String filename) { - filename = UUID.randomUUID().toString() + "_" + filename + ".xlsx"; + filename = UUID.randomUUID() + "_" + filename + ".xlsx"; return filename; } @@ -1282,6 +1479,7 @@ public String getAbsoluteFile(String filename) */ private Object getTargetValue(T vo, Field field, Excel excel) throws Exception { + field.setAccessible(true); Object o = field.get(vo); if (StringUtils.isNotEmpty(excel.targetAttr())) { @@ -1341,45 +1539,83 @@ public List getFields() List tempFields = new ArrayList<>(); tempFields.addAll(Arrays.asList(clazz.getSuperclass().getDeclaredFields())); tempFields.addAll(Arrays.asList(clazz.getDeclaredFields())); - for (Field field : tempFields) + if (StringUtils.isNotEmpty(includeFields)) + { + for (Field field : tempFields) + { + if (ArrayUtils.contains(this.includeFields, field.getName()) || field.isAnnotationPresent(Excels.class)) + { + addField(fields, field); + } + } + } + else if (StringUtils.isNotEmpty(excludeFields)) { - if (!ArrayUtils.contains(this.excludeFields, field.getName())) + for (Field field : tempFields) { - // 单注解 - if (field.isAnnotationPresent(Excel.class)) + if (!ArrayUtils.contains(this.excludeFields, field.getName())) { - Excel attr = field.getAnnotation(Excel.class); - if (attr != null && (attr.type() == Type.ALL || attr.type() == type)) + addField(fields, field); + } + } + } + else + { + for (Field field : tempFields) + { + addField(fields, field); + } + } + return fields; + } + + /** + * 添加字段信息 + */ + public void addField(List fields, Field field) + { + // 单注解 + if (field.isAnnotationPresent(Excel.class)) + { + Excel attr = field.getAnnotation(Excel.class); + if (attr != null && (attr.type() == Type.ALL || attr.type() == type)) + { + fields.add(new Object[] { field, attr }); + } + if (Collection.class.isAssignableFrom(field.getType())) + { + subMethod = getSubMethod(field.getName(), clazz); + ParameterizedType pt = (ParameterizedType) field.getGenericType(); + Class subClass = (Class) pt.getActualTypeArguments()[0]; + this.subFields = FieldUtils.getFieldsListWithAnnotation(subClass, Excel.class); + } + } + + // 多注解 + if (field.isAnnotationPresent(Excels.class)) + { + Excels attrs = field.getAnnotation(Excels.class); + Excel[] excels = attrs.value(); + for (Excel attr : excels) + { + if (StringUtils.isNotEmpty(includeFields)) + { + if (ArrayUtils.contains(this.includeFields, field.getName() + "." + attr.targetAttr()) + && (attr != null && (attr.type() == Type.ALL || attr.type() == type))) { - field.setAccessible(true); fields.add(new Object[] { field, attr }); } - if (Collection.class.isAssignableFrom(field.getType())) - { - subMethod = getSubMethod(field.getName(), clazz); - ParameterizedType pt = (ParameterizedType) field.getGenericType(); - Class subClass = (Class) pt.getActualTypeArguments()[0]; - this.subFields = FieldUtils.getFieldsListWithAnnotation(subClass, Excel.class); - } } - - // 多注解 - if (field.isAnnotationPresent(Excels.class)) + else { - Excels attrs = field.getAnnotation(Excels.class); - Excel[] excels = attrs.value(); - for (Excel attr : excels) + if (!ArrayUtils.contains(this.excludeFields, field.getName() + "." + attr.targetAttr()) + && (attr != null && (attr.type() == Type.ALL || attr.type() == type))) { - if (attr != null && (attr.type() == Type.ALL || attr.type() == type)) - { - field.setAccessible(true); - fields.add(new Object[] { field, attr }); - } + fields.add(new Object[] { field, attr }); } } } } - return fields; } /** @@ -1528,7 +1764,7 @@ public static Map getSheetPictures03(HSSFSheet sheet, HSSFW HSSFPicture pic = (HSSFPicture) shape; int pictureIndex = pic.getPictureIndex() - 1; HSSFPictureData picData = pictures.get(pictureIndex); - String picIndex = String.valueOf(anchor.getRow1()) + "_" + String.valueOf(anchor.getCol1()); + String picIndex = anchor.getRow1() + "_" + anchor.getCol1(); sheetIndexPicMap.put(picIndex, picData); } } diff --git a/src/main/java/com/ruoyi/common/utils/security/ShiroUtils.java b/src/main/java/com/ruoyi/common/utils/security/ShiroUtils.java index b6d9178a8..a2b667fb1 100644 --- a/src/main/java/com/ruoyi/common/utils/security/ShiroUtils.java +++ b/src/main/java/com/ruoyi/common/utils/security/ShiroUtils.java @@ -65,7 +65,7 @@ public static String getLoginName() public static String getIp() { - return getSubject().getSession().getHost(); + return StringUtils.substring(getSubject().getSession().getHost(), 0, 128); } public static String getSessionId() diff --git a/src/main/java/com/ruoyi/common/utils/sql/SqlUtil.java b/src/main/java/com/ruoyi/common/utils/sql/SqlUtil.java index 246a9cfc8..48720dc93 100644 --- a/src/main/java/com/ruoyi/common/utils/sql/SqlUtil.java +++ b/src/main/java/com/ruoyi/common/utils/sql/SqlUtil.java @@ -13,13 +13,18 @@ public class SqlUtil /** * 定义常用的 sql关键字 */ - public static String SQL_REGEX = "select |insert |delete |update |drop |count |exec |chr |mid |master |truncate |char |and |declare "; + public static String SQL_REGEX = "\u000B|and |extractvalue|updatexml|sleep|exec |insert |select |delete |update |drop |count |chr |mid |master |truncate |char |declare |or |union |like |+|/*|user()"; /** * 仅支持字母、数字、下划线、空格、逗号、小数点(支持多个字段排序) */ public static String SQL_PATTERN = "[a-zA-Z0-9_\\ \\,\\.]+"; + /** + * 限制orderBy最大长度 + */ + private static final int ORDER_BY_MAX_LENGTH = 500; + /** * 检查字符,防止注入绕过 */ @@ -29,6 +34,10 @@ public static String escapeOrderBySql(String value) { throw new UtilException("参数不符合规范,不能进行查询"); } + if (StringUtils.length(value) > ORDER_BY_MAX_LENGTH) + { + throw new UtilException("参数已超过最大限制,不能进行查询"); + } return value; } diff --git a/src/main/java/com/ruoyi/common/utils/text/Convert.java b/src/main/java/com/ruoyi/common/utils/text/Convert.java index e7b0eac3a..c2fd3c671 100644 --- a/src/main/java/com/ruoyi/common/utils/text/Convert.java +++ b/src/main/java/com/ruoyi/common/utils/text/Convert.java @@ -2,6 +2,7 @@ import java.math.BigDecimal; import java.math.BigInteger; +import java.math.RoundingMode; import java.nio.ByteBuffer; import java.nio.charset.Charset; import java.text.NumberFormat; @@ -11,7 +12,7 @@ /** * 类型转换器 - * + * * @author ruoyi */ public class Convert @@ -20,7 +21,7 @@ public class Convert * 转换为字符串
* 如果给定的值为null,或者转换失败,返回默认值
* 转换失败不会报错 - * + * * @param value 被转换的值 * @param defaultValue 转换错误时的默认值 * @return 结果 @@ -42,7 +43,7 @@ public static String toStr(Object value, String defaultValue) * 转换为字符串
* 如果给定的值为null,或者转换失败,返回默认值null
* 转换失败不会报错 - * + * * @param value 被转换的值 * @return 结果 */ @@ -55,7 +56,7 @@ public static String toStr(Object value) * 转换为字符
* 如果给定的值为null,或者转换失败,返回默认值
* 转换失败不会报错 - * + * * @param value 被转换的值 * @param defaultValue 转换错误时的默认值 * @return 结果 @@ -79,7 +80,7 @@ public static Character toChar(Object value, Character defaultValue) * 转换为字符
* 如果给定的值为null,或者转换失败,返回默认值null
* 转换失败不会报错 - * + * * @param value 被转换的值 * @return 结果 */ @@ -92,7 +93,7 @@ public static Character toChar(Object value) * 转换为byte
* 如果给定的值为null,或者转换失败,返回默认值
* 转换失败不会报错 - * + * * @param value 被转换的值 * @param defaultValue 转换错误时的默认值 * @return 结果 @@ -130,7 +131,7 @@ public static Byte toByte(Object value, Byte defaultValue) * 转换为byte
* 如果给定的值为null,或者转换失败,返回默认值null
* 转换失败不会报错 - * + * * @param value 被转换的值 * @return 结果 */ @@ -143,7 +144,7 @@ public static Byte toByte(Object value) * 转换为Short
* 如果给定的值为null,或者转换失败,返回默认值
* 转换失败不会报错 - * + * * @param value 被转换的值 * @param defaultValue 转换错误时的默认值 * @return 结果 @@ -181,7 +182,7 @@ public static Short toShort(Object value, Short defaultValue) * 转换为Short
* 如果给定的值为null,或者转换失败,返回默认值null
* 转换失败不会报错 - * + * * @param value 被转换的值 * @return 结果 */ @@ -194,7 +195,7 @@ public static Short toShort(Object value) * 转换为Number
* 如果给定的值为空,或者转换失败,返回默认值
* 转换失败不会报错 - * + * * @param value 被转换的值 * @param defaultValue 转换错误时的默认值 * @return 结果 @@ -228,7 +229,7 @@ public static Number toNumber(Object value, Number defaultValue) * 转换为Number
* 如果给定的值为空,或者转换失败,返回默认值null
* 转换失败不会报错 - * + * * @param value 被转换的值 * @return 结果 */ @@ -241,7 +242,7 @@ public static Number toNumber(Object value) * 转换为int
* 如果给定的值为空,或者转换失败,返回默认值
* 转换失败不会报错 - * + * * @param value 被转换的值 * @param defaultValue 转换错误时的默认值 * @return 结果 @@ -279,7 +280,7 @@ public static Integer toInt(Object value, Integer defaultValue) * 转换为int
* 如果给定的值为null,或者转换失败,返回默认值null
* 转换失败不会报错 - * + * * @param value 被转换的值 * @return 结果 */ @@ -290,7 +291,7 @@ public static Integer toInt(Object value) /** * 转换为Integer数组
- * + * * @param str 被转换的值 * @return 结果 */ @@ -301,7 +302,7 @@ public static Integer[] toIntArray(String str) /** * 转换为Long数组
- * + * * @param str 被转换的值 * @return 结果 */ @@ -312,7 +313,7 @@ public static Long[] toLongArray(String str) /** * 转换为Integer数组
- * + * * @param split 分隔符 * @param split 被转换的值 * @return 结果 @@ -335,7 +336,7 @@ public static Integer[] toIntArray(String split, String str) /** * 转换为Long数组
- * + * * @param split 分隔符 * @param str 被转换的值 * @return 结果 @@ -358,18 +359,22 @@ public static Long[] toLongArray(String split, String str) /** * 转换为String数组
- * + * * @param str 被转换的值 * @return 结果 */ public static String[] toStrArray(String str) { + if (StringUtils.isEmpty(str)) + { + return new String[] {}; + } return toStrArray(",", str); } /** * 转换为String数组
- * + * * @param split 分隔符 * @param split 被转换的值 * @return 结果 @@ -383,7 +388,7 @@ public static String[] toStrArray(String split, String str) * 转换为long
* 如果给定的值为空,或者转换失败,返回默认值
* 转换失败不会报错 - * + * * @param value 被转换的值 * @param defaultValue 转换错误时的默认值 * @return 结果 @@ -422,7 +427,7 @@ public static Long toLong(Object value, Long defaultValue) * 转换为long
* 如果给定的值为null,或者转换失败,返回默认值null
* 转换失败不会报错 - * + * * @param value 被转换的值 * @return 结果 */ @@ -435,7 +440,7 @@ public static Long toLong(Object value) * 转换为double
* 如果给定的值为空,或者转换失败,返回默认值
* 转换失败不会报错 - * + * * @param value 被转换的值 * @param defaultValue 转换错误时的默认值 * @return 结果 @@ -474,7 +479,7 @@ public static Double toDouble(Object value, Double defaultValue) * 转换为double
* 如果给定的值为空,或者转换失败,返回默认值null
* 转换失败不会报错 - * + * * @param value 被转换的值 * @return 结果 */ @@ -487,7 +492,7 @@ public static Double toDouble(Object value) * 转换为Float
* 如果给定的值为空,或者转换失败,返回默认值
* 转换失败不会报错 - * + * * @param value 被转换的值 * @param defaultValue 转换错误时的默认值 * @return 结果 @@ -525,7 +530,7 @@ public static Float toFloat(Object value, Float defaultValue) * 转换为Float
* 如果给定的值为空,或者转换失败,返回默认值null
* 转换失败不会报错 - * + * * @param value 被转换的值 * @return 结果 */ @@ -538,7 +543,7 @@ public static Float toFloat(Object value) * 转换为boolean
* String支持的值为:true、false、yes、ok、no,1,0 如果给定的值为空,或者转换失败,返回默认值
* 转换失败不会报错 - * + * * @param value 被转换的值 * @param defaultValue 转换错误时的默认值 * @return 结果 @@ -579,7 +584,7 @@ public static Boolean toBool(Object value, Boolean defaultValue) * 转换为boolean
* 如果给定的值为空,或者转换失败,返回默认值null
* 转换失败不会报错 - * + * * @param value 被转换的值 * @return 结果 */ @@ -591,7 +596,7 @@ public static Boolean toBool(Object value) /** * 转换为Enum对象
* 如果给定的值为空,或者转换失败,返回默认值
- * + * * @param clazz Enum的Class * @param value 值 * @param defaultValue 默认值 @@ -627,7 +632,7 @@ public static > E toEnum(Class clazz, Object value, E defau /** * 转换为Enum对象
* 如果给定的值为空,或者转换失败,返回默认值null
- * + * * @param clazz Enum的Class * @param value 值 * @return Enum @@ -641,7 +646,7 @@ public static > E toEnum(Class clazz, Object value) * 转换为BigInteger
* 如果给定的值为空,或者转换失败,返回默认值
* 转换失败不会报错 - * + * * @param value 被转换的值 * @param defaultValue 转换错误时的默认值 * @return 结果 @@ -679,7 +684,7 @@ public static BigInteger toBigInteger(Object value, BigInteger defaultValue) * 转换为BigInteger
* 如果给定的值为空,或者转换失败,返回默认值null
* 转换失败不会报错 - * + * * @param value 被转换的值 * @return 结果 */ @@ -692,7 +697,7 @@ public static BigInteger toBigInteger(Object value) * 转换为BigDecimal
* 如果给定的值为空,或者转换失败,返回默认值
* 转换失败不会报错 - * + * * @param value 被转换的值 * @param defaultValue 转换错误时的默认值 * @return 结果 @@ -713,7 +718,7 @@ public static BigDecimal toBigDecimal(Object value, BigDecimal defaultValue) } if (value instanceof Double) { - return new BigDecimal((Double) value); + return BigDecimal.valueOf((Double) value); } if (value instanceof Integer) { @@ -738,7 +743,7 @@ public static BigDecimal toBigDecimal(Object value, BigDecimal defaultValue) * 转换为BigDecimal
* 如果给定的值为空,或者转换失败,返回默认值
* 转换失败不会报错 - * + * * @param value 被转换的值 * @return 结果 */ @@ -750,7 +755,7 @@ public static BigDecimal toBigDecimal(Object value) /** * 将对象转为字符串
* 1、Byte数组和ByteBuffer会被转换为对应字符串的数组 2、对象数组会调用Arrays.toString方法 - * + * * @param obj 对象 * @return 字符串 */ @@ -762,7 +767,7 @@ public static String utf8Str(Object obj) /** * 将对象转为字符串
* 1、Byte数组和ByteBuffer会被转换为对应字符串的数组 2、对象数组会调用Arrays.toString方法 - * + * * @param obj 对象 * @param charsetName 字符集 * @return 字符串 @@ -775,7 +780,7 @@ public static String str(Object obj, String charsetName) /** * 将对象转为字符串
* 1、Byte数组和ByteBuffer会被转换为对应字符串的数组 2、对象数组会调用Arrays.toString方法 - * + * * @param obj 对象 * @param charset 字符集 * @return 字符串 @@ -809,7 +814,7 @@ else if (obj instanceof ByteBuffer) /** * 将byte数组转为字符串 - * + * * @param bytes byte数组 * @param charset 字符集 * @return 字符串 @@ -821,7 +826,7 @@ public static String str(byte[] bytes, String charset) /** * 解码字节码 - * + * * @param data 字符串 * @param charset 字符集,如果此字段为空,则解码的结果取决于平台 * @return 解码后的字符串 @@ -842,7 +847,7 @@ public static String str(byte[] data, Charset charset) /** * 将编码的byteBuffer数据转换为字符串 - * + * * @param data 数据 * @param charset 字符集,如果为空使用当前系统字符集 * @return 字符串 @@ -859,7 +864,7 @@ public static String str(ByteBuffer data, String charset) /** * 将编码的byteBuffer数据转换为字符串 - * + * * @param data 数据 * @param charset 字符集,如果为空使用当前系统字符集 * @return 字符串 @@ -876,7 +881,7 @@ public static String str(ByteBuffer data, Charset charset) // ----------------------------------------------------------------------- 全角半角转换 /** * 半角转全角 - * + * * @param input String. * @return 全角字符串. */ @@ -887,14 +892,14 @@ public static String toSBC(String input) /** * 半角转全角 - * + * * @param input String * @param notConvertSet 不替换的字符集合 * @return 全角字符串. */ public static String toSBC(String input, Set notConvertSet) { - char c[] = input.toCharArray(); + char[] c = input.toCharArray(); for (int i = 0; i < c.length; i++) { if (null != notConvertSet && notConvertSet.contains(c[i])) @@ -918,7 +923,7 @@ else if (c[i] < '\177') /** * 全角转半角 - * + * * @param input String. * @return 半角字符串 */ @@ -929,14 +934,14 @@ public static String toDBC(String input) /** * 替换全角为半角 - * + * * @param text 文本 * @param notConvertSet 不替换的字符集合 * @return 替换后的字符 */ public static String toDBC(String text, Set notConvertSet) { - char c[] = text.toCharArray(); + char[] c = text.toCharArray(); for (int i = 0; i < c.length; i++) { if (null != notConvertSet && notConvertSet.contains(c[i])) @@ -961,7 +966,7 @@ else if (c[i] > '\uFF00' && c[i] < '\uFF5F') /** * 数字金额大写转换 先写个完整的然后将如零拾替换成零 - * + * * @param n 数字 * @return 中文大写数字 */ @@ -977,7 +982,12 @@ public static String digitUppercase(double n) String s = ""; for (int i = 0; i < fraction.length; i++) { - s += (digit[(int) (Math.floor(n * 10 * Math.pow(10, i)) % 10)] + fraction[i]).replaceAll("(零.)+", ""); + // 优化double计算精度丢失问题 + BigDecimal nNum = new BigDecimal(n); + BigDecimal decimal = new BigDecimal(10); + BigDecimal scale = nNum.multiply(decimal).setScale(2, RoundingMode.HALF_EVEN); + double d = scale.doubleValue(); + s += (digit[(int) (Math.floor(d * Math.pow(10, i)) % 10)] + fraction[i]).replaceAll("(零.)+", ""); } if (s.length() < 1) { diff --git a/src/main/java/com/ruoyi/common/utils/uuid/Seq.java b/src/main/java/com/ruoyi/common/utils/uuid/Seq.java index fd88245c4..3f621d5db 100644 --- a/src/main/java/com/ruoyi/common/utils/uuid/Seq.java +++ b/src/main/java/com/ruoyi/common/utils/uuid/Seq.java @@ -22,7 +22,7 @@ public class Seq private static AtomicInteger uploadSeq = new AtomicInteger(1); // 机器标识 - private static String machineCode = "A"; + private static final String machineCode = "A"; /** * 获取通用序列号 diff --git a/src/main/java/com/ruoyi/common/utils/uuid/UUID.java b/src/main/java/com/ruoyi/common/utils/uuid/UUID.java index 062d6336c..68ce94386 100644 --- a/src/main/java/com/ruoyi/common/utils/uuid/UUID.java +++ b/src/main/java/com/ruoyi/common/utils/uuid/UUID.java @@ -66,7 +66,7 @@ public UUID(long mostSigBits, long leastSigBits) } /** - * 获取类型 4(伪随机生成的)UUID 的静态工厂。 使用加密的本地线程伪随机数生成器生成该 UUID。 + * 获取类型 4(伪随机生成的)UUID 的静态工厂。 * * @return 随机生成的 {@code UUID} */ diff --git a/src/main/java/com/ruoyi/common/xss/XssFilter.java b/src/main/java/com/ruoyi/common/xss/XssFilter.java index 30fd69ce8..145ae7aef 100644 --- a/src/main/java/com/ruoyi/common/xss/XssFilter.java +++ b/src/main/java/com/ruoyi/common/xss/XssFilter.java @@ -31,10 +31,10 @@ public void init(FilterConfig filterConfig) throws ServletException String tempExcludes = filterConfig.getInitParameter("excludes"); if (StringUtils.isNotEmpty(tempExcludes)) { - String[] url = tempExcludes.split(","); - for (int i = 0; url != null && i < url.length; i++) + String[] urls = tempExcludes.split(","); + for (String url : urls) { - excludes.add(url[i]); + excludes.add(url); } } } diff --git a/src/main/java/com/ruoyi/common/xss/XssValidator.java b/src/main/java/com/ruoyi/common/xss/XssValidator.java index 34d07004e..b859428e8 100644 --- a/src/main/java/com/ruoyi/common/xss/XssValidator.java +++ b/src/main/java/com/ruoyi/common/xss/XssValidator.java @@ -27,8 +27,13 @@ public boolean isValid(String value, ConstraintValidatorContext constraintValida public static boolean containsHtml(String value) { + StringBuilder sHtml = new StringBuilder(); Pattern pattern = Pattern.compile(HTML_PATTERN); Matcher matcher = pattern.matcher(value); - return matcher.matches(); + while (matcher.find()) + { + sHtml.append(matcher.group()); + } + return pattern.matcher(sHtml).matches(); } } \ No newline at end of file diff --git a/src/main/java/com/ruoyi/framework/aspectj/DataScopeAspect.java b/src/main/java/com/ruoyi/framework/aspectj/DataScopeAspect.java index bf14f8bf1..c71cfc9cc 100644 --- a/src/main/java/com/ruoyi/framework/aspectj/DataScopeAspect.java +++ b/src/main/java/com/ruoyi/framework/aspectj/DataScopeAspect.java @@ -6,6 +6,7 @@ import org.aspectj.lang.annotation.Aspect; import org.aspectj.lang.annotation.Before; import org.springframework.stereotype.Component; +import com.ruoyi.common.constant.UserConstants; import com.ruoyi.common.utils.StringUtils; import com.ruoyi.common.utils.security.ShiroUtils; import com.ruoyi.common.utils.text.Convert; @@ -71,8 +72,7 @@ protected void handleDataScope(final JoinPoint joinPoint, DataScope controllerDa if (!currentUser.isAdmin()) { String permission = StringUtils.defaultIfEmpty(controllerDataScope.permission(), PermissionContextHolder.getContext()); - dataScopeFilter(joinPoint, currentUser, controllerDataScope.deptAlias(), - controllerDataScope.userAlias(), permission); + dataScopeFilter(joinPoint, currentUser, controllerDataScope.deptAlias(), controllerDataScope.userAlias(), permission); } } } @@ -90,29 +90,42 @@ public static void dataScopeFilter(JoinPoint joinPoint, User user, String deptAl { StringBuilder sqlString = new StringBuilder(); List conditions = new ArrayList(); + List scopeCustomIds = new ArrayList(); + user.getRoles().forEach(role -> { + if (DATA_SCOPE_CUSTOM.equals(role.getDataScope()) && StringUtils.equals(role.getStatus(), UserConstants.ROLE_NORMAL) && StringUtils.containsAny(role.getPermissions(), Convert.toStrArray(permission))) + { + scopeCustomIds.add(Convert.toStr(role.getRoleId())); + } + }); for (Role role : user.getRoles()) { String dataScope = role.getDataScope(); - if (!DATA_SCOPE_CUSTOM.equals(dataScope) && conditions.contains(dataScope)) + if (conditions.contains(dataScope) || StringUtils.equals(role.getStatus(), UserConstants.ROLE_DISABLE)) { continue; } - if (StringUtils.isNotEmpty(permission) && StringUtils.isNotEmpty(role.getPermissions()) - && !StringUtils.containsAny(role.getPermissions(), Convert.toStrArray(permission))) + if (!StringUtils.containsAny(role.getPermissions(), Convert.toStrArray(permission))) { continue; } if (DATA_SCOPE_ALL.equals(dataScope)) { sqlString = new StringBuilder(); + conditions.add(dataScope); break; } else if (DATA_SCOPE_CUSTOM.equals(dataScope)) { - sqlString.append(StringUtils.format( - " OR {}.dept_id IN ( SELECT dept_id FROM sys_role_dept WHERE role_id = {} ) ", deptAlias, - role.getRoleId())); + if (scopeCustomIds.size() > 1) + { + // 多个自定数据权限使用in查询,避免多次拼接。 + sqlString.append(StringUtils.format(" OR {}.dept_id IN ( SELECT dept_id FROM sys_role_dept WHERE role_id in ({}) ) ", deptAlias, String.join(",", scopeCustomIds))); + } + else + { + sqlString.append(StringUtils.format(" OR {}.dept_id IN ( SELECT dept_id FROM sys_role_dept WHERE role_id = {} ) ", deptAlias, role.getRoleId())); + } } else if (DATA_SCOPE_DEPT.equals(dataScope)) { @@ -120,9 +133,7 @@ else if (DATA_SCOPE_DEPT.equals(dataScope)) } else if (DATA_SCOPE_DEPT_AND_CHILD.equals(dataScope)) { - sqlString.append(StringUtils.format( - " OR {}.dept_id IN ( SELECT dept_id FROM sys_dept WHERE dept_id = {} or find_in_set( {} , ancestors ) )", - deptAlias, user.getDeptId(), user.getDeptId())); + sqlString.append(StringUtils.format(" OR {}.dept_id IN ( SELECT dept_id FROM sys_dept WHERE dept_id = {} or find_in_set( {} , ancestors ) )", deptAlias, user.getDeptId(), user.getDeptId())); } else if (DATA_SCOPE_SELF.equals(dataScope)) { @@ -139,6 +150,12 @@ else if (DATA_SCOPE_SELF.equals(dataScope)) conditions.add(dataScope); } + // 角色都不包含传递过来的权限字符,这个时候sqlString也会为空,所以要限制一下,不查询任何数据 + if (StringUtils.isEmpty(conditions)) + { + sqlString.append(StringUtils.format(" OR {}.dept_id = 0 ", deptAlias)); + } + if (StringUtils.isNotBlank(sqlString.toString())) { Object params = joinPoint.getArgs()[0]; diff --git a/src/main/java/com/ruoyi/framework/aspectj/LogAspect.java b/src/main/java/com/ruoyi/framework/aspectj/LogAspect.java index ba0dc4ab5..bc0f05de1 100644 --- a/src/main/java/com/ruoyi/framework/aspectj/LogAspect.java +++ b/src/main/java/com/ruoyi/framework/aspectj/LogAspect.java @@ -4,12 +4,15 @@ import java.util.Map; import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletResponse; +import org.apache.commons.lang3.ArrayUtils; import org.aspectj.lang.JoinPoint; import org.aspectj.lang.annotation.AfterReturning; import org.aspectj.lang.annotation.AfterThrowing; import org.aspectj.lang.annotation.Aspect; +import org.aspectj.lang.annotation.Before; import org.slf4j.Logger; import org.slf4j.LoggerFactory; +import org.springframework.core.NamedThreadLocal; import org.springframework.stereotype.Component; import org.springframework.validation.BindingResult; import org.springframework.web.multipart.MultipartFile; @@ -39,6 +42,18 @@ public class LogAspect /** 排除敏感属性字段 */ public static final String[] EXCLUDE_PROPERTIES = { "password", "oldPassword", "newPassword", "confirmPassword" }; + /** 计算操作消耗时间 */ + private static final ThreadLocal TIME_THREADLOCAL = new NamedThreadLocal("Cost Time"); + + /** + * 处理请求前执行 + */ + @Before(value = "@annotation(controllerLog)") + public void boBefore(JoinPoint joinPoint, Log controllerLog) + { + TIME_THREADLOCAL.set(System.currentTimeMillis()); + } + /** * 处理完请求后执行 * @@ -75,7 +90,7 @@ protected void handleLog(final JoinPoint joinPoint, Log controllerLog, final Exc // 请求的地址 String ip = ShiroUtils.getIp(); operLog.setOperIp(ip); - operLog.setOperUrl(ServletUtils.getRequest().getRequestURI()); + operLog.setOperUrl(StringUtils.substring(ServletUtils.getRequest().getRequestURI(), 0, 255)); if (currentUser != null) { operLog.setOperName(currentUser.getLoginName()); @@ -99,16 +114,21 @@ protected void handleLog(final JoinPoint joinPoint, Log controllerLog, final Exc operLog.setRequestMethod(ServletUtils.getRequest().getMethod()); // 处理设置注解上的参数 getControllerMethodDescription(joinPoint, controllerLog, operLog, jsonResult); + // 设置消耗时间 + operLog.setCostTime(System.currentTimeMillis() - TIME_THREADLOCAL.get()); // 保存数据库 AsyncManager.me().execute(AsyncFactory.recordOper(operLog)); } catch (Exception exp) { // 记录本地异常日志 - log.error("==前置通知异常=="); log.error("异常信息:{}", exp.getMessage()); exp.printStackTrace(); } + finally + { + TIME_THREADLOCAL.remove(); + } } /** @@ -130,7 +150,7 @@ public void getControllerMethodDescription(JoinPoint joinPoint, Log log, OperLog if (log.isSaveRequestData()) { // 获取参数的信息,传入到数据库中。 - setRequestValue(joinPoint, operLog); + setRequestValue(joinPoint, operLog, log.excludeParamNames()); } // 是否需要保存response,参数和值 if (log.isSaveResponseData() && StringUtils.isNotNull(jsonResult)) @@ -145,12 +165,12 @@ public void getControllerMethodDescription(JoinPoint joinPoint, Log log, OperLog * @param operLog * @param request */ - private void setRequestValue(JoinPoint joinPoint, OperLog operLog) + private void setRequestValue(JoinPoint joinPoint, OperLog operLog, String[] excludeParamNames) { Map map = ServletUtils.getRequest().getParameterMap(); if (StringUtils.isNotEmpty(map)) { - String params = JSONObject.toJSONString(map, excludePropertyPreFilter()); + String params = JSONObject.toJSONString(map, excludePropertyPreFilter(excludeParamNames)); operLog.setOperParam(StringUtils.substring(params, 0, 2000)); } else @@ -158,7 +178,7 @@ private void setRequestValue(JoinPoint joinPoint, OperLog operLog) Object args = joinPoint.getArgs(); if (StringUtils.isNotNull(args)) { - String params = argsArrayToString(joinPoint.getArgs()); + String params = argsArrayToString(joinPoint.getArgs(), excludeParamNames); operLog.setOperParam(StringUtils.substring(params, 0, 2000)); } } @@ -167,15 +187,15 @@ private void setRequestValue(JoinPoint joinPoint, OperLog operLog) /** * 忽略敏感属性 */ - public PropertyPreFilters.MySimplePropertyPreFilter excludePropertyPreFilter() + public PropertyPreFilters.MySimplePropertyPreFilter excludePropertyPreFilter(String[] excludeParamNames) { - return new PropertyPreFilters().addFilter().addExcludes(EXCLUDE_PROPERTIES); + return new PropertyPreFilters().addFilter().addExcludes(ArrayUtils.addAll(EXCLUDE_PROPERTIES, excludeParamNames)); } /** * 参数拼装 */ - private String argsArrayToString(Object[] paramsArray) + private String argsArrayToString(Object[] paramsArray, String[] excludeParamNames) { String params = ""; if (paramsArray != null && paramsArray.length > 0) @@ -186,7 +206,7 @@ private String argsArrayToString(Object[] paramsArray) { try { - Object jsonObj = JSONObject.toJSONString(o, excludePropertyPreFilter()); + Object jsonObj = JSONObject.toJSONString(o, excludePropertyPreFilter(excludeParamNames)); params += jsonObj.toString() + " "; } catch (Exception e) diff --git a/src/main/java/com/ruoyi/framework/aspectj/lang/annotation/Anonymous.java b/src/main/java/com/ruoyi/framework/aspectj/lang/annotation/Anonymous.java new file mode 100644 index 000000000..2fb432cd8 --- /dev/null +++ b/src/main/java/com/ruoyi/framework/aspectj/lang/annotation/Anonymous.java @@ -0,0 +1,19 @@ +package com.ruoyi.framework.aspectj.lang.annotation; + +import java.lang.annotation.Documented; +import java.lang.annotation.ElementType; +import java.lang.annotation.Retention; +import java.lang.annotation.RetentionPolicy; +import java.lang.annotation.Target; + +/** + * 匿名访问不鉴权注解 + * + * @author ruoyi + */ +@Target({ ElementType.METHOD, ElementType.TYPE }) +@Retention(RetentionPolicy.RUNTIME) +@Documented +public @interface Anonymous +{ +} diff --git a/src/main/java/com/ruoyi/framework/aspectj/lang/annotation/Excel.java b/src/main/java/com/ruoyi/framework/aspectj/lang/annotation/Excel.java index f089c6d65..b7bfda15e 100644 --- a/src/main/java/com/ruoyi/framework/aspectj/lang/annotation/Excel.java +++ b/src/main/java/com/ruoyi/framework/aspectj/lang/annotation/Excel.java @@ -59,12 +59,12 @@ public int roundingMode() default BigDecimal.ROUND_HALF_EVEN; /** - * 导出时在excel中每个列的高度 单位为字符 + * 导出时在excel中每个列的高度 */ public double height() default 14; /** - * 导出时在excel中每个列的宽 单位为字符 + * 导出时在excel中每个列的宽度 */ public double width() default 16; @@ -83,11 +83,21 @@ */ public String prompt() default ""; + /** + * 是否允许内容换行 + */ + public boolean wrapText() default false; + /** * 设置只能选择不能输入的列内容. */ public String[] combo() default {}; + /** + * 是否从字典读数据到combo,默认不读取,如读取需要设置dictType注解. + */ + public boolean comboReadDict() default false; + /** * 是否需要纵向合并单元格,应对需求:含有list集合单元格) */ @@ -171,7 +181,7 @@ public int value() public enum ColumnType { - NUMERIC(0), STRING(1), IMAGE(2); + NUMERIC(0), STRING(1), IMAGE(2), TEXT(3); private final int value; ColumnType(int value) diff --git a/src/main/java/com/ruoyi/framework/aspectj/lang/annotation/Log.java b/src/main/java/com/ruoyi/framework/aspectj/lang/annotation/Log.java index ca9de602d..d347bcee0 100644 --- a/src/main/java/com/ruoyi/framework/aspectj/lang/annotation/Log.java +++ b/src/main/java/com/ruoyi/framework/aspectj/lang/annotation/Log.java @@ -20,7 +20,7 @@ public @interface Log { /** - * 模块 + * 模块 */ public String title() default ""; @@ -43,4 +43,9 @@ * 是否保存响应的参数 */ public boolean isSaveResponseData() default true; + + /** + * 排除指定的请求参数 + */ + public String[] excludeParamNames() default {}; } diff --git a/src/main/java/com/ruoyi/framework/aspectj/lang/annotation/Sensitive.java b/src/main/java/com/ruoyi/framework/aspectj/lang/annotation/Sensitive.java new file mode 100644 index 000000000..ae121fa01 --- /dev/null +++ b/src/main/java/com/ruoyi/framework/aspectj/lang/annotation/Sensitive.java @@ -0,0 +1,24 @@ +package com.ruoyi.framework.aspectj.lang.annotation; + +import java.lang.annotation.ElementType; +import java.lang.annotation.Retention; +import java.lang.annotation.RetentionPolicy; +import java.lang.annotation.Target; +import com.fasterxml.jackson.annotation.JacksonAnnotationsInside; +import com.fasterxml.jackson.databind.annotation.JsonSerialize; +import com.ruoyi.framework.aspectj.lang.enums.DesensitizedType; +import com.ruoyi.framework.config.SensitiveJsonSerializer; + +/** + * 数据脱敏注解 + * + * @author ruoyi + */ +@Retention(RetentionPolicy.RUNTIME) +@Target(ElementType.FIELD) +@JacksonAnnotationsInside +@JsonSerialize(using = SensitiveJsonSerializer.class) +public @interface Sensitive +{ + DesensitizedType desensitizedType(); +} diff --git a/src/main/java/com/ruoyi/framework/aspectj/lang/enums/DesensitizedType.java b/src/main/java/com/ruoyi/framework/aspectj/lang/enums/DesensitizedType.java new file mode 100644 index 000000000..52fca0fdf --- /dev/null +++ b/src/main/java/com/ruoyi/framework/aspectj/lang/enums/DesensitizedType.java @@ -0,0 +1,59 @@ +package com.ruoyi.framework.aspectj.lang.enums; + +import java.util.function.Function; +import com.ruoyi.common.utils.DesensitizedUtil; + +/** + * 脱敏类型 + * + * @author ruoyi + */ +public enum DesensitizedType +{ + /** + * 姓名,第2位星号替换 + */ + USERNAME(s -> s.replaceAll("(\\S)\\S(\\S*)", "$1*$2")), + + /** + * 密码,全部字符都用*代替 + */ + PASSWORD(DesensitizedUtil::password), + + /** + * 身份证,中间10位星号替换 + */ + ID_CARD(s -> s.replaceAll("(\\d{4})\\d{10}(\\d{3}[Xx]|\\d{4})", "$1** **** ****$2")), + + /** + * 手机号,中间4位星号替换 + */ + PHONE(s -> s.replaceAll("(\\d{3})\\d{4}(\\d{4})", "$1****$2")), + + /** + * 电子邮箱,仅显示第一个字母和@后面的地址显示,其他星号替换 + */ + EMAIL(s -> s.replaceAll("(^.)[^@]*(@.*$)", "$1****$2")), + + /** + * 银行卡号,保留最后4位,其他星号替换 + */ + BANK_CARD(s -> s.replaceAll("\\d{15}(\\d{3})", "**** **** **** **** $1")), + + /** + * 车牌号码,包含普通车辆、新能源车辆 + */ + CAR_LICENSE(DesensitizedUtil::carLicense); + + private final Function desensitizer; + + DesensitizedType(Function desensitizer) + { + this.desensitizer = desensitizer; + } + + public Function desensitizer() + { + return desensitizer; + } +} diff --git a/src/main/java/com/ruoyi/framework/config/GenConfig.java b/src/main/java/com/ruoyi/framework/config/GenConfig.java index a74e2c38e..6d432ea49 100644 --- a/src/main/java/com/ruoyi/framework/config/GenConfig.java +++ b/src/main/java/com/ruoyi/framework/config/GenConfig.java @@ -18,12 +18,15 @@ public class GenConfig /** 生成包路径 */ public static String packageName; - /** 自动去除表前缀,默认是true */ + /** 自动去除表前缀 */ public static boolean autoRemovePre; - /** 表前缀(类名不会包含表前缀) */ + /** 表前缀 */ public static String tablePrefix; + /** 是否允许生成文件覆盖到本地(自定义路径) */ + public static boolean allowOverwrite; + public static String getAuthor() { return author; @@ -63,4 +66,14 @@ public void setTablePrefix(String tablePrefix) { GenConfig.tablePrefix = tablePrefix; } + + public static boolean isAllowOverwrite() + { + return allowOverwrite; + } + + public void setAllowOverwrite(boolean allowOverwrite) + { + GenConfig.allowOverwrite = allowOverwrite; + } } diff --git a/src/main/java/com/ruoyi/framework/config/I18nConfig.java b/src/main/java/com/ruoyi/framework/config/I18nConfig.java index c572e1c5c..1e977ba0e 100644 --- a/src/main/java/com/ruoyi/framework/config/I18nConfig.java +++ b/src/main/java/com/ruoyi/framework/config/I18nConfig.java @@ -1,6 +1,5 @@ package com.ruoyi.framework.config; -import java.util.Locale; import org.springframework.context.annotation.Bean; import org.springframework.context.annotation.Configuration; import org.springframework.web.servlet.LocaleResolver; @@ -8,6 +7,7 @@ import org.springframework.web.servlet.config.annotation.WebMvcConfigurer; import org.springframework.web.servlet.i18n.LocaleChangeInterceptor; import org.springframework.web.servlet.i18n.SessionLocaleResolver; +import com.ruoyi.common.constant.Constants; /** * 资源文件配置加载 @@ -22,7 +22,7 @@ public LocaleResolver localeResolver() { SessionLocaleResolver slr = new SessionLocaleResolver(); // 默认语言 - slr.setDefaultLocale(Locale.SIMPLIFIED_CHINESE); + slr.setDefaultLocale(Constants.DEFAULT_LOCALE); return slr; } diff --git a/src/main/java/com/ruoyi/framework/config/ScheduleConfig.java b/src/main/java/com/ruoyi/framework/config/ScheduleConfig.java index 75a232332..c7b7db248 100644 --- a/src/main/java/com/ruoyi/framework/config/ScheduleConfig.java +++ b/src/main/java/com/ruoyi/framework/config/ScheduleConfig.java @@ -34,7 +34,7 @@ // // 集群配置 // prop.put("org.quartz.jobStore.isClustered", "true"); // prop.put("org.quartz.jobStore.clusterCheckinInterval", "15000"); -// prop.put("org.quartz.jobStore.maxMisfiresToHandleAtATime", "1"); +// prop.put("org.quartz.jobStore.maxMisfiresToHandleAtATime", "10"); // prop.put("org.quartz.jobStore.txIsolationLevelSerializable", "true"); // // // sqlserver 启用 diff --git a/src/main/java/com/ruoyi/framework/config/SensitiveJsonSerializer.java b/src/main/java/com/ruoyi/framework/config/SensitiveJsonSerializer.java new file mode 100644 index 000000000..583802ce2 --- /dev/null +++ b/src/main/java/com/ruoyi/framework/config/SensitiveJsonSerializer.java @@ -0,0 +1,64 @@ +package com.ruoyi.framework.config; + +import java.io.IOException; +import java.util.Objects; +import com.fasterxml.jackson.core.JsonGenerator; +import com.fasterxml.jackson.databind.BeanProperty; +import com.fasterxml.jackson.databind.JsonMappingException; +import com.fasterxml.jackson.databind.JsonSerializer; +import com.fasterxml.jackson.databind.SerializerProvider; +import com.fasterxml.jackson.databind.ser.ContextualSerializer; +import com.ruoyi.common.utils.security.ShiroUtils; +import com.ruoyi.framework.aspectj.lang.annotation.Sensitive; +import com.ruoyi.framework.aspectj.lang.enums.DesensitizedType; +import com.ruoyi.project.system.user.domain.User; + +/** + * 数据脱敏序列化过滤 + * + * @author ruoyi + */ +public class SensitiveJsonSerializer extends JsonSerializer implements ContextualSerializer +{ + private DesensitizedType desensitizedType; + + @Override + public void serialize(String value, JsonGenerator gen, SerializerProvider serializers) throws IOException + { + if (desensitization()) + { + gen.writeString(desensitizedType.desensitizer().apply(value)); + } + else + { + gen.writeString(value); + } + } + + @Override + public JsonSerializer createContextual(SerializerProvider prov, BeanProperty property) + throws JsonMappingException + { + Sensitive annotation = property.getAnnotation(Sensitive.class); + if (Objects.nonNull(annotation) && Objects.equals(String.class, property.getType().getRawClass())) + { + this.desensitizedType = annotation.desensitizedType(); + return this; + } + return prov.findValueSerializer(property.getType(), property); + } + + /** + * 是否需要脱敏处理 + */ + private boolean desensitization() + { + User securityUser = ShiroUtils.getSysUser(); + if (securityUser == null) + { + return true; + } + // 管理员不脱敏 + return !securityUser.isAdmin(); + } +} diff --git a/src/main/java/com/ruoyi/framework/config/ShiroConfig.java b/src/main/java/com/ruoyi/framework/config/ShiroConfig.java index e14a3b477..809027036 100644 --- a/src/main/java/com/ruoyi/framework/config/ShiroConfig.java +++ b/src/main/java/com/ruoyi/framework/config/ShiroConfig.java @@ -4,6 +4,7 @@ import java.io.IOException; import java.io.InputStream; import java.util.LinkedHashMap; +import java.util.List; import java.util.Map; import javax.servlet.Filter; import org.apache.commons.io.IOUtils; @@ -14,7 +15,6 @@ import org.apache.shiro.mgt.SecurityManager; import org.apache.shiro.spring.security.interceptor.AuthorizationAttributeSourceAdvisor; import org.apache.shiro.spring.web.ShiroFilterFactoryBean; -import org.apache.shiro.web.mgt.CookieRememberMeManager; import org.apache.shiro.web.mgt.DefaultWebSecurityManager; import org.apache.shiro.web.servlet.SimpleCookie; import org.springframework.beans.factory.annotation.Qualifier; @@ -25,7 +25,9 @@ import com.ruoyi.common.utils.StringUtils; import com.ruoyi.common.utils.security.CipherUtils; import com.ruoyi.common.utils.spring.SpringUtils; +import com.ruoyi.framework.config.properties.PermitAllUrlProperties; import com.ruoyi.framework.shiro.realm.UserRealm; +import com.ruoyi.framework.shiro.rememberMe.CustomCookieRememberMeManager; import com.ruoyi.framework.shiro.session.OnlineSessionDAO; import com.ruoyi.framework.shiro.session.OnlineSessionFactory; import com.ruoyi.framework.shiro.web.CustomShiroFilterFactoryBean; @@ -288,6 +290,12 @@ public ShiroFilterFactoryBean shiroFilterFactoryBean(SecurityManager securityMan filterChainDefinitionMap.put("/js/**", "anon"); filterChainDefinitionMap.put("/ruoyi/**", "anon"); filterChainDefinitionMap.put("/captcha/captchaImage**", "anon"); + // 匿名访问不鉴权注解列表 + List permitAllUrl = SpringUtils.getBean(PermitAllUrlProperties.class).getUrls(); + if (StringUtils.isNotEmpty(permitAllUrl)) + { + permitAllUrl.forEach(url -> filterChainDefinitionMap.put(url, "anon")); + } // 退出 logout地址,shiro去清除session filterChainDefinitionMap.put("/logout", "logout"); // 不需要拦截的访问 @@ -361,9 +369,9 @@ public SimpleCookie rememberMeCookie() /** * 记住我 */ - public CookieRememberMeManager rememberMeManager() + public CustomCookieRememberMeManager rememberMeManager() { - CookieRememberMeManager cookieRememberMeManager = new CookieRememberMeManager(); + CustomCookieRememberMeManager cookieRememberMeManager = new CustomCookieRememberMeManager(); cookieRememberMeManager.setCookie(rememberMeCookie()); if (StringUtils.isNotEmpty(cipherKey)) { diff --git a/src/main/java/com/ruoyi/framework/config/properties/DruidProperties.java b/src/main/java/com/ruoyi/framework/config/properties/DruidProperties.java index 84f7e0090..c8a5c8a70 100644 --- a/src/main/java/com/ruoyi/framework/config/properties/DruidProperties.java +++ b/src/main/java/com/ruoyi/framework/config/properties/DruidProperties.java @@ -24,6 +24,12 @@ public class DruidProperties @Value("${spring.datasource.druid.maxWait}") private int maxWait; + @Value("${spring.datasource.druid.connectTimeout}") + private int connectTimeout; + + @Value("${spring.datasource.druid.socketTimeout}") + private int socketTimeout; + @Value("${spring.datasource.druid.timeBetweenEvictionRunsMillis}") private int timeBetweenEvictionRunsMillis; @@ -54,6 +60,12 @@ public DruidDataSource dataSource(DruidDataSource datasource) /** 配置获取连接等待超时的时间 */ datasource.setMaxWait(maxWait); + + /** 配置驱动连接超时时间,检测数据库建立连接的超时时间,单位是毫秒 */ + datasource.setConnectTimeout(connectTimeout); + + /** 配置网络超时时间,等待数据库操作完成的网络超时时间,单位是毫秒 */ + datasource.setSocketTimeout(socketTimeout); /** 配置间隔多久才进行一次检测,检测需要关闭的空闲连接,单位是毫秒 */ datasource.setTimeBetweenEvictionRunsMillis(timeBetweenEvictionRunsMillis); diff --git a/src/main/java/com/ruoyi/framework/config/properties/PermitAllUrlProperties.java b/src/main/java/com/ruoyi/framework/config/properties/PermitAllUrlProperties.java new file mode 100644 index 000000000..d3bc71150 --- /dev/null +++ b/src/main/java/com/ruoyi/framework/config/properties/PermitAllUrlProperties.java @@ -0,0 +1,151 @@ +package com.ruoyi.framework.config.properties; + +import java.lang.reflect.Method; +import java.util.ArrayList; +import java.util.List; +import java.util.Map; +import java.util.Objects; +import org.springframework.aop.framework.Advised; +import org.springframework.beans.BeansException; +import org.springframework.beans.factory.InitializingBean; +import org.springframework.context.ApplicationContext; +import org.springframework.context.ApplicationContextAware; +import org.springframework.context.annotation.Configuration; +import org.springframework.stereotype.Controller; +import org.springframework.web.bind.annotation.DeleteMapping; +import org.springframework.web.bind.annotation.GetMapping; +import org.springframework.web.bind.annotation.PostMapping; +import org.springframework.web.bind.annotation.PutMapping; +import org.springframework.web.bind.annotation.RequestMapping; +import com.ruoyi.framework.aspectj.lang.annotation.Anonymous; + +/** + * 设置Anonymous注解允许匿名访问的url + * + * @author ruoyi + */ +@Configuration +public class PermitAllUrlProperties implements InitializingBean, ApplicationContextAware +{ + private List urls = new ArrayList<>(); + + private ApplicationContext applicationContext; + + @Override + public void afterPropertiesSet() throws Exception + { + Map controllers = applicationContext.getBeansWithAnnotation(Controller.class); + for (Object bean : controllers.values()) + { + Class beanClass; + if (bean instanceof Advised) + { + beanClass = ((Advised) bean).getTargetSource().getTarget().getClass(); + } + else + { + beanClass = bean.getClass(); + } + // 处理类级别的匿名访问注解 + if (beanClass.isAnnotationPresent(Anonymous.class)) + { + RequestMapping baseMapping = beanClass.getAnnotation(RequestMapping.class); + if (Objects.nonNull(baseMapping)) + { + String[] baseUrl = baseMapping.value(); + for (String url : baseUrl) + { + urls.add(prefix(url) + "/*"); + } + continue; + } + } + + // 处理方法级别的匿名访问注解 + Method[] methods = beanClass.getDeclaredMethods(); + for (Method method : methods) + { + if (method.isAnnotationPresent(Anonymous.class)) + { + RequestMapping baseMapping = beanClass.getAnnotation(RequestMapping.class); + String[] baseUrl = {}; + if (Objects.nonNull(baseMapping)) + { + baseUrl = baseMapping.value(); + } + if (method.isAnnotationPresent(RequestMapping.class)) + { + RequestMapping requestMapping = method.getAnnotation(RequestMapping.class); + String[] uri = requestMapping.value(); + urls.addAll(rebuildUrl(baseUrl, uri)); + } + else if (method.isAnnotationPresent(GetMapping.class)) + { + GetMapping requestMapping = method.getAnnotation(GetMapping.class); + String[] uri = requestMapping.value(); + urls.addAll(rebuildUrl(baseUrl, uri)); + } + else if (method.isAnnotationPresent(PostMapping.class)) + { + PostMapping requestMapping = method.getAnnotation(PostMapping.class); + String[] uri = requestMapping.value(); + urls.addAll(rebuildUrl(baseUrl, uri)); + } + else if (method.isAnnotationPresent(PutMapping.class)) + { + PutMapping requestMapping = method.getAnnotation(PutMapping.class); + String[] uri = requestMapping.value(); + urls.addAll(rebuildUrl(baseUrl, uri)); + } + else if (method.isAnnotationPresent(DeleteMapping.class)) + { + DeleteMapping requestMapping = method.getAnnotation(DeleteMapping.class); + String[] uri = requestMapping.value(); + urls.addAll(rebuildUrl(baseUrl, uri)); + } + } + } + } + } + + private List rebuildUrl(String[] bases, String[] uris) + { + List urls = new ArrayList<>(); + for (String base : bases) + { + if (uris.length > 0) + { + for (String uri : uris) + { + urls.add(prefix(base) + prefix(uri)); + } + } + else + { + urls.add(prefix(base)); + } + } + return urls; + } + + private String prefix(String seg) + { + return seg.startsWith("/") ? seg : "/" + seg; + } + + @Override + public void setApplicationContext(ApplicationContext context) throws BeansException + { + this.applicationContext = context; + } + + public List getUrls() + { + return urls; + } + + public void setUrls(List urls) + { + this.urls = urls; + } +} diff --git a/src/main/java/com/ruoyi/framework/datasource/DynamicDataSourceContextHolder.java b/src/main/java/com/ruoyi/framework/datasource/DynamicDataSourceContextHolder.java index 20a0dda4e..859a78240 100644 --- a/src/main/java/com/ruoyi/framework/datasource/DynamicDataSourceContextHolder.java +++ b/src/main/java/com/ruoyi/framework/datasource/DynamicDataSourceContextHolder.java @@ -14,7 +14,7 @@ public class DynamicDataSourceContextHolder /** * 使用ThreadLocal维护变量,ThreadLocal为每个使用该变量的线程提供独立的变量副本, - * 所以每一个线程都可以独立地改变自己的副本,而不会影响其它线程所对应的副本。 + * 所以每一个线程都可以独立地改变自己的副本,而不会影响其它线程所对应的副本。 */ private static final ThreadLocal CONTEXT_HOLDER = new ThreadLocal<>(); diff --git a/src/main/java/com/ruoyi/framework/shiro/rememberMe/CustomCookieRememberMeManager.java b/src/main/java/com/ruoyi/framework/shiro/rememberMe/CustomCookieRememberMeManager.java new file mode 100644 index 000000000..d7bc8b375 --- /dev/null +++ b/src/main/java/com/ruoyi/framework/shiro/rememberMe/CustomCookieRememberMeManager.java @@ -0,0 +1,79 @@ +package com.ruoyi.framework.shiro.rememberMe; + +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Set; +import org.apache.shiro.subject.PrincipalCollection; +import org.apache.shiro.subject.Subject; +import org.apache.shiro.subject.SubjectContext; +import org.apache.shiro.web.mgt.CookieRememberMeManager; +import com.ruoyi.common.utils.spring.SpringUtils; +import com.ruoyi.framework.shiro.service.LoginService; +import com.ruoyi.project.system.role.domain.Role; +import com.ruoyi.project.system.user.domain.User; + +/** + * 自定义CookieRememberMeManager + * + * @author ruoyi + */ +public class CustomCookieRememberMeManager extends CookieRememberMeManager +{ + /** + * 记住我时去掉角色的permissions权限字符串,防止http请求头过大。 + */ + @Override + protected void rememberIdentity(Subject subject, PrincipalCollection principalCollection) + { + Map> rolePermissions = new HashMap<>(); + // 清除角色的permissions权限字符串 + for (Object principal : principalCollection) + { + if (principal instanceof User) + { + List roles = ((User) principal).getRoles(); + for (Role role : roles) + { + rolePermissions.put(role, role.getPermissions()); + role.setPermissions(null); + } + } + } + byte[] bytes = convertPrincipalsToBytes(principalCollection); + // 恢复角色的permissions权限字符串 + for (Object principal : principalCollection) + { + if (principal instanceof User) + { + List roles = ((User) principal).getRoles(); + for (Role role : roles) + { + role.setPermissions(rolePermissions.get(role)); + } + } + } + rememberSerializedIdentity(subject, bytes); + } + + /** + * 取记住我身份时恢复角色permissions权限字符串。 + */ + @Override + public PrincipalCollection getRememberedPrincipals(SubjectContext subjectContext) + { + PrincipalCollection principals = super.getRememberedPrincipals(subjectContext); + if (principals == null || principals.isEmpty()) + { + return principals; + } + for (Object principal : principals) + { + if (principal instanceof User) + { + SpringUtils.getBean(LoginService.class).setRolePermission((User) principal); + } + } + return principals; + } +} diff --git a/src/main/java/com/ruoyi/framework/shiro/service/LoginService.java b/src/main/java/com/ruoyi/framework/shiro/service/LoginService.java index a897f30b0..132dfa7d2 100644 --- a/src/main/java/com/ruoyi/framework/shiro/service/LoginService.java +++ b/src/main/java/com/ruoyi/framework/shiro/service/LoginService.java @@ -7,18 +7,21 @@ import com.ruoyi.common.constant.Constants; import com.ruoyi.common.constant.ShiroConstants; import com.ruoyi.common.constant.UserConstants; +import com.ruoyi.common.exception.user.BlackListException; import com.ruoyi.common.exception.user.CaptchaException; import com.ruoyi.common.exception.user.UserBlockedException; import com.ruoyi.common.exception.user.UserDeleteException; import com.ruoyi.common.exception.user.UserNotExistsException; import com.ruoyi.common.exception.user.UserPasswordNotMatchException; import com.ruoyi.common.utils.DateUtils; +import com.ruoyi.common.utils.IpUtils; import com.ruoyi.common.utils.MessageUtils; import com.ruoyi.common.utils.ServletUtils; import com.ruoyi.common.utils.StringUtils; import com.ruoyi.common.utils.security.ShiroUtils; import com.ruoyi.framework.manager.AsyncManager; import com.ruoyi.framework.manager.factory.AsyncFactory; +import com.ruoyi.project.system.config.service.IConfigService; import com.ruoyi.project.system.menu.service.IMenuService; import com.ruoyi.project.system.role.domain.Role; import com.ruoyi.project.system.user.domain.User; @@ -42,6 +45,9 @@ public class LoginService @Autowired private IMenuService menuService; + @Autowired + private IConfigService configService; + /** * 登录 */ @@ -75,6 +81,14 @@ public User login(String username, String password) throw new UserPasswordNotMatchException(); } + // IP黑名单校验 + String blackStr = configService.selectConfigByKey("sys.login.blackIPList"); + if (IpUtils.isMatchedIp(blackStr, ShiroUtils.getIp())) + { + AsyncManager.me().execute(AsyncFactory.recordLogininfor(username, Constants.LOGIN_FAIL, MessageUtils.message("login.blocked"))); + throw new BlackListException(); + } + // 查询用户信息 User user = userService.selectUserByLoginName(username); @@ -104,7 +118,7 @@ public User login(String username, String password) if (UserStatus.DISABLE.getCode().equals(user.getStatus())) { - AsyncManager.me().execute(AsyncFactory.recordLogininfor(username, Constants.LOGIN_FAIL, MessageUtils.message("user.blocked", user.getRemark()))); + AsyncManager.me().execute(AsyncFactory.recordLogininfor(username, Constants.LOGIN_FAIL, MessageUtils.message("user.blocked"))); throw new UserBlockedException(); } @@ -144,13 +158,16 @@ private boolean maybeMobilePhoneNumber(String username) public void setRolePermission(User user) { List roles = user.getRoles(); - if (!roles.isEmpty() && roles.size() > 1) + if (!roles.isEmpty()) { - // 多角色设置permissions属性,以便数据权限匹配权限 + // 设置permissions属性,以便数据权限匹配权限 for (Role role : roles) { - Set rolePerms = menuService.selectPermsByRoleId(role.getRoleId()); - role.setPermissions(rolePerms); + if (StringUtils.equals(role.getStatus(), UserConstants.ROLE_NORMAL)) + { + Set rolePerms = menuService.selectPermsByRoleId(role.getRoleId()); + role.setPermissions(rolePerms); + } } } } diff --git a/src/main/java/com/ruoyi/framework/shiro/service/PasswordService.java b/src/main/java/com/ruoyi/framework/shiro/service/PasswordService.java index c16bf8a0e..7025feff6 100644 --- a/src/main/java/com/ruoyi/framework/shiro/service/PasswordService.java +++ b/src/main/java/com/ruoyi/framework/shiro/service/PasswordService.java @@ -36,7 +36,7 @@ public class PasswordService @PostConstruct public void init() { - loginRecordCache = cacheManager.getCache(ShiroConstants.LOGINRECORDCACHE); + loginRecordCache = cacheManager.getCache(ShiroConstants.LOGIN_RECORD_CACHE); } public void validate(User user, String password) diff --git a/src/main/java/com/ruoyi/framework/shiro/service/RegisterService.java b/src/main/java/com/ruoyi/framework/shiro/service/RegisterService.java index c73a4a58f..b035b28d2 100644 --- a/src/main/java/com/ruoyi/framework/shiro/service/RegisterService.java +++ b/src/main/java/com/ruoyi/framework/shiro/service/RegisterService.java @@ -54,7 +54,7 @@ else if (loginName.length() < UserConstants.USERNAME_MIN_LENGTH { msg = "账户长度必须在2到20个字符之间"; } - else if (UserConstants.USER_NAME_NOT_UNIQUE.equals(userService.checkLoginNameUnique(loginName))) + else if (!userService.checkLoginNameUnique(user)) { msg = "保存用户'" + loginName + "'失败,注册账号已存在"; } diff --git a/src/main/java/com/ruoyi/framework/shiro/session/OnlineSessionFactory.java b/src/main/java/com/ruoyi/framework/shiro/session/OnlineSessionFactory.java index ed97c82a5..f2c9af93a 100644 --- a/src/main/java/com/ruoyi/framework/shiro/session/OnlineSessionFactory.java +++ b/src/main/java/com/ruoyi/framework/shiro/session/OnlineSessionFactory.java @@ -6,7 +6,6 @@ import org.apache.shiro.session.mgt.SessionFactory; import org.apache.shiro.web.session.mgt.WebSessionContext; import org.springframework.stereotype.Component; -import com.ruoyi.common.utils.ServletUtils; import com.ruoyi.common.utils.IpUtils; import com.ruoyi.common.utils.StringUtils; import com.ruoyi.project.monitor.online.domain.OnlineSession; @@ -41,7 +40,7 @@ public Session createSession(SessionContext initData) HttpServletRequest request = (HttpServletRequest) sessionContext.getServletRequest(); if (request != null) { - UserAgent userAgent = UserAgent.parseUserAgentString(ServletUtils.getRequest().getHeader("User-Agent")); + UserAgent userAgent = UserAgent.parseUserAgentString(request.getHeader("User-Agent")); // 获取客户端操作系统 String os = userAgent.getOperatingSystem().getName(); // 获取客户端浏览器 diff --git a/src/main/java/com/ruoyi/project/monitor/job/task/RyTask.java b/src/main/java/com/ruoyi/framework/task/RyTask.java similarity index 90% rename from src/main/java/com/ruoyi/project/monitor/job/task/RyTask.java rename to src/main/java/com/ruoyi/framework/task/RyTask.java index 56dff4ea0..ef44e1d48 100644 --- a/src/main/java/com/ruoyi/project/monitor/job/task/RyTask.java +++ b/src/main/java/com/ruoyi/framework/task/RyTask.java @@ -1,4 +1,4 @@ -package com.ruoyi.project.monitor.job.task; +package com.ruoyi.framework.task; import org.springframework.stereotype.Component; import com.ruoyi.common.utils.StringUtils; diff --git a/src/main/java/com/ruoyi/framework/web/domain/AjaxResult.java b/src/main/java/com/ruoyi/framework/web/domain/AjaxResult.java index c22620543..7cf5086ff 100644 --- a/src/main/java/com/ruoyi/framework/web/domain/AjaxResult.java +++ b/src/main/java/com/ruoyi/framework/web/domain/AjaxResult.java @@ -188,7 +188,17 @@ public static AjaxResult error(String msg, Object data) */ public boolean isSuccess() { - return !isError(); + return Objects.equals(Type.SUCCESS.value, this.get(CODE_TAG)); + } + + /** + * 是否为警告消息 + * + * @return 结果 + */ + public boolean isWarn() + { + return Objects.equals(Type.WARN.value, this.get(CODE_TAG)); } /** diff --git a/src/main/java/com/ruoyi/framework/web/domain/BaseEntity.java b/src/main/java/com/ruoyi/framework/web/domain/BaseEntity.java index 52c3424e2..bbc43e765 100644 --- a/src/main/java/com/ruoyi/framework/web/domain/BaseEntity.java +++ b/src/main/java/com/ruoyi/framework/web/domain/BaseEntity.java @@ -5,6 +5,8 @@ import java.util.HashMap; import java.util.Map; import com.fasterxml.jackson.annotation.JsonFormat; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonInclude; /** * Entity基类 @@ -16,26 +18,28 @@ public class BaseEntity implements Serializable private static final long serialVersionUID = 1L; /** 搜索值 */ + @JsonIgnore private String searchValue; /** 创建者 */ private String createBy; /** 创建时间 */ - @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss") + @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8") private Date createTime; /** 更新者 */ private String updateBy; /** 更新时间 */ - @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss") + @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8") private Date updateTime; /** 备注 */ private String remark; /** 请求参数 */ + @JsonInclude(JsonInclude.Include.NON_EMPTY) private Map params; public String getSearchValue() diff --git a/src/main/java/com/ruoyi/framework/web/domain/R.java b/src/main/java/com/ruoyi/framework/web/domain/R.java index b4db8fd04..95ae38480 100644 --- a/src/main/java/com/ruoyi/framework/web/domain/R.java +++ b/src/main/java/com/ruoyi/framework/web/domain/R.java @@ -101,4 +101,14 @@ public void setData(T data) { this.data = data; } + + public static Boolean isError(R ret) + { + return !isSuccess(ret); + } + + public static Boolean isSuccess(R ret) + { + return R.SUCCESS == ret.getCode(); + } } diff --git a/src/main/java/com/ruoyi/framework/web/exception/GlobalExceptionHandler.java b/src/main/java/com/ruoyi/framework/web/exception/GlobalExceptionHandler.java index f225c725a..05673513d 100644 --- a/src/main/java/com/ruoyi/framework/web/exception/GlobalExceptionHandler.java +++ b/src/main/java/com/ruoyi/framework/web/exception/GlobalExceptionHandler.java @@ -6,13 +6,18 @@ import org.slf4j.LoggerFactory; import org.springframework.validation.BindException; import org.springframework.web.HttpRequestMethodNotSupportedException; +import org.springframework.web.bind.MissingPathVariableException; import org.springframework.web.bind.annotation.ExceptionHandler; import org.springframework.web.bind.annotation.RestControllerAdvice; +import org.springframework.web.method.annotation.MethodArgumentTypeMismatchException; import org.springframework.web.servlet.ModelAndView; import com.ruoyi.common.exception.DemoModeException; import com.ruoyi.common.exception.ServiceException; import com.ruoyi.common.utils.ServletUtils; +import com.ruoyi.common.utils.StringUtils; +import com.ruoyi.common.utils.html.EscapeUtil; import com.ruoyi.common.utils.security.PermissionUtils; +import com.ruoyi.common.utils.text.Convert; import com.ruoyi.framework.web.domain.AjaxResult; /** @@ -93,6 +98,33 @@ public Object handleServiceException(ServiceException e, HttpServletRequest requ return new ModelAndView("error/service", "errorMessage", e.getMessage()); } } + + /** + * 请求路径中缺少必需的路径变量 + */ + @ExceptionHandler(MissingPathVariableException.class) + public AjaxResult handleMissingPathVariableException(MissingPathVariableException e, HttpServletRequest request) + { + String requestURI = request.getRequestURI(); + log.error("请求路径中缺少必需的路径变量'{}',发生系统异常.", requestURI, e); + return AjaxResult.error(String.format("请求路径中缺少必需的路径变量[%s]", e.getVariableName())); + } + + /** + * 请求参数类型不匹配 + */ + @ExceptionHandler(MethodArgumentTypeMismatchException.class) + public AjaxResult handleMethodArgumentTypeMismatchException(MethodArgumentTypeMismatchException e, HttpServletRequest request) + { + String requestURI = request.getRequestURI(); + String value = Convert.toStr(e.getValue()); + if (StringUtils.isNotEmpty(value)) + { + value = EscapeUtil.clean(value); + } + log.error("请求参数类型不匹配'{}',发生系统异常.", requestURI, e); + return AjaxResult.error(String.format("请求参数类型不匹配,参数[%s]要求类型为:'%s',但输入值为:'%s'", e.getName(), e.getRequiredType().getName(), value)); + } /** * 自定义验证异常 diff --git a/src/main/java/com/ruoyi/framework/web/service/CacheService.java b/src/main/java/com/ruoyi/framework/web/service/CacheService.java index 33d17ac46..b9680671b 100644 --- a/src/main/java/com/ruoyi/framework/web/service/CacheService.java +++ b/src/main/java/com/ruoyi/framework/web/service/CacheService.java @@ -1,6 +1,7 @@ package com.ruoyi.framework.web.service; import java.util.Set; +import java.util.TreeSet; import org.apache.commons.lang3.ArrayUtils; import org.springframework.stereotype.Service; import com.ruoyi.common.constant.Constants; @@ -33,7 +34,7 @@ public String[] getCacheNames() */ public Set getCacheKeys(String cacheName) { - return CacheUtils.getCache(cacheName).keys(); + return new TreeSet<>(CacheUtils.getCache(cacheName).keys()); } /** diff --git a/src/main/java/com/ruoyi/framework/web/service/PermissionService.java b/src/main/java/com/ruoyi/framework/web/service/PermissionService.java index 405e0325c..c806a364e 100644 --- a/src/main/java/com/ruoyi/framework/web/service/PermissionService.java +++ b/src/main/java/com/ruoyi/framework/web/service/PermissionService.java @@ -52,7 +52,7 @@ public String lacksPermi(String permission) /** * 验证用户是否具有以下任意一个权限,无权限返回hidden用于隐藏(如需返回Boolean使用hasAnyPermissions) * - * @param permissions 以 PERMISSION_NAMES_DELIMETER 为分隔符的权限列表 + * @param permissions 以 PERMISSION_DELIMETER 为分隔符的权限列表 * @return 用户是否具有以下任意一个权限 */ public String hasAnyPermi(String permissions) @@ -129,7 +129,7 @@ public boolean isLacksPermitted(String permission) /** * 验证用户是否具有以下任意一个权限。 * - * @param permissions 以 PERMISSION_NAMES_DELIMETER 为分隔符的权限列表 + * @param permissions 以 PERMISSION_DELIMETER 为分隔符的权限列表 * @return 用户是否具有以下任意一个权限 */ public boolean hasAnyPermissions(String permissions) diff --git a/src/main/java/com/ruoyi/project/common/CommonController.java b/src/main/java/com/ruoyi/project/common/CommonController.java index c185c8bfe..405d7097e 100644 --- a/src/main/java/com/ruoyi/project/common/CommonController.java +++ b/src/main/java/com/ruoyi/project/common/CommonController.java @@ -139,8 +139,7 @@ public AjaxResult uploadFiles(List files) throws Exception * 本地资源通用下载 */ @GetMapping("/download/resource") - public void resourceDownload(String resource, HttpServletRequest request, HttpServletResponse response) - throws Exception + public void resourceDownload(String resource, HttpServletRequest request, HttpServletResponse response) throws Exception { try { diff --git a/src/main/java/com/ruoyi/project/demo/controller/DemoTableController.java b/src/main/java/com/ruoyi/project/demo/controller/DemoTableController.java index f7888f10f..691b65389 100644 --- a/src/main/java/com/ruoyi/project/demo/controller/DemoTableController.java +++ b/src/main/java/com/ruoyi/project/demo/controller/DemoTableController.java @@ -20,6 +20,7 @@ import com.ruoyi.framework.aspectj.lang.annotation.Excel.ColumnType; import com.ruoyi.framework.web.controller.BaseController; import com.ruoyi.framework.web.domain.AjaxResult; +import com.ruoyi.framework.web.domain.BaseEntity; import com.ruoyi.framework.web.page.PageDomain; import com.ruoyi.framework.web.page.TableDataInfo; import com.ruoyi.framework.web.page.TableSupport; @@ -125,6 +126,22 @@ public class DemoTableController extends BaseController columns.add(new UserTableColumn("用户邮箱", "userEmail")); columns.add(new UserTableColumn("用户状态", "status")); } + + private final static List documents = new ArrayList(); + { + documents.add(new DocumentModel(1, "247-XW·2024-D10-0001", "新闻热线[2024]000001", "索尼射击游戏《Concord》停止运营,玩家将获全额退款", "索尼宣布多人射击游戏《Concord》将于9月6日停止运营,玩家将获得全额退款。游戏总监Ryan Ellis在给玩家的信中表示,这款游戏首次发布“并没有像我们预期的那样顺利”。《Concord》的开发历时8年,投资超过1.5亿美元。游戏在Steam平台的售价为40美元,采用买断制销售模式。据SteamDB统计,游戏上市后的最高同时在线人数为697人。")); + 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", "《黑神话》让海外玩家迷上“悟空”", "备受全球玩家瞩目的首款国产3A游戏《黑神话:悟空》日前正式发布。精美绝伦的东方美学世界、精彩纷呈的中国神话故事、酣畅淋漓的游戏体验,这款游戏为全球玩家带来一场视觉与文化的双重盛宴。从“悟空”成功出海的背后,海外人士看到了中国游戏产业的巨大进步,感受到了中国文化的多元精彩,并对下一个“悟空”的诞生及更多中国文化产品走向世界充满期待。")); + 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多磅的物资、设备及科学实验器材。")); + } /** * 搜索相关 @@ -209,6 +226,15 @@ public String remember() return prefix + "/remember"; } + /** + * 表格保存状态 + */ + @GetMapping("/cookie") + public String cookie() + { + return prefix + "/cookie"; + } + /** * 跳转至指定页 */ @@ -390,6 +416,15 @@ public String dynamicColumns() return prefix + "/dynamicColumns"; } + /** + * 表格虚拟滚动 + */ + @GetMapping("/virtualScroll") + public String virtualScroll() + { + return prefix + "/virtualScroll"; + } + /** * 自定义视图分页 */ @@ -399,6 +434,15 @@ public String customView() return prefix + "/customView"; } + /** + * 全文索引 + */ + @GetMapping("/textSearch") + public String textSearch() + { + return prefix + "/textSearch"; + } + /** * 异步加载表格树 */ @@ -473,6 +517,57 @@ public TableDataInfo list(UserTableModel userModel) return rspData; } + /** + * 查询全文索引数据 + */ + @PostMapping("/text/list") + @ResponseBody + public TableDataInfo textList(BaseEntity baseEntity) + { + TableDataInfo rspData = new TableDataInfo(); + List documentList = new ArrayList(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(), "" + baseEntity.getSearchValue() + "")); + } + if (document.getContent().contains(baseEntity.getSearchValue())) + { + indexFlag = true; + document.setContent(document.getContent().replace(baseEntity.getSearchValue(), "" + baseEntity.getSearchValue() + "")); + } + 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; + } + /** * 查询树表数据 */ @@ -506,8 +601,8 @@ public TableDataInfo treeList(AreaModel areaModel) } } PageDomain pageDomain = TableSupport.buildPageRequest(); - Integer pageNum = (pageDomain.getPageNum() - 1) * 10; - Integer pageSize = pageDomain.getPageNum() * 10; + Integer pageNum = (pageDomain.getPageNum() - 1) * pageDomain.getPageSize(); + Integer pageSize = pageDomain.getPageNum() * pageDomain.getPageSize(); if (pageSize > areaList.size()) { pageSize = areaList.size(); @@ -844,3 +939,85 @@ 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; + } +} diff --git a/src/main/java/com/ruoyi/project/monitor/job/controller/JobController.java b/src/main/java/com/ruoyi/project/monitor/job/controller/JobController.java index 4ec3541af..e069a0be0 100644 --- a/src/main/java/com/ruoyi/project/monitor/job/controller/JobController.java +++ b/src/main/java/com/ruoyi/project/monitor/job/controller/JobController.java @@ -118,6 +118,7 @@ public AjaxResult run(Job job) throws SchedulerException /** * 新增调度 */ + @RequiresPermissions("monitor:job:add") @GetMapping("/add") public String add() { diff --git a/src/main/java/com/ruoyi/project/monitor/job/util/AbstractQuartzJob.java b/src/main/java/com/ruoyi/project/monitor/job/util/AbstractQuartzJob.java index 78aca625a..e1f1b7217 100644 --- a/src/main/java/com/ruoyi/project/monitor/job/util/AbstractQuartzJob.java +++ b/src/main/java/com/ruoyi/project/monitor/job/util/AbstractQuartzJob.java @@ -65,7 +65,7 @@ protected void before(JobExecutionContext context, Job job) * 执行后 * * @param context 工作执行上下文对象 - * @param sysScheduleJob 系统计划任务 + * @param job 系统计划任务 */ protected void after(JobExecutionContext context, Job job, Exception e) { diff --git a/src/main/java/com/ruoyi/project/monitor/job/util/JobInvokeUtil.java b/src/main/java/com/ruoyi/project/monitor/job/util/JobInvokeUtil.java index 50b552122..4685bdead 100644 --- a/src/main/java/com/ruoyi/project/monitor/job/util/JobInvokeUtil.java +++ b/src/main/java/com/ruoyi/project/monitor/job/util/JobInvokeUtil.java @@ -34,7 +34,7 @@ public static void invokeMethod(Job job) throws Exception } else { - Object bean = Class.forName(beanName).newInstance(); + Object bean = Class.forName(beanName).getDeclaredConstructor().newInstance(); invokeMethod(bean, methodName, methodParams); } } diff --git a/src/main/java/com/ruoyi/project/monitor/job/util/ScheduleUtils.java b/src/main/java/com/ruoyi/project/monitor/job/util/ScheduleUtils.java index 704d8e1fb..864a44c74 100644 --- a/src/main/java/com/ruoyi/project/monitor/job/util/ScheduleUtils.java +++ b/src/main/java/com/ruoyi/project/monitor/job/util/ScheduleUtils.java @@ -133,6 +133,8 @@ public static boolean whiteList(String invokeTarget) return StringUtils.containsAnyIgnoreCase(invokeTarget, Constants.JOB_WHITELIST_STR); } Object obj = SpringUtils.getBean(StringUtils.split(invokeTarget, ".")[0]); - return StringUtils.containsAnyIgnoreCase(obj.getClass().getPackage().getName(), Constants.JOB_WHITELIST_STR); + String beanPackageName = obj.getClass().getPackage().getName(); + return StringUtils.containsAnyIgnoreCase(beanPackageName, Constants.JOB_WHITELIST_STR) + && !StringUtils.containsAnyIgnoreCase(beanPackageName, Constants.JOB_ERROR_STR); } } \ No newline at end of file diff --git a/src/main/java/com/ruoyi/project/monitor/online/domain/UserOnline.java b/src/main/java/com/ruoyi/project/monitor/online/domain/UserOnline.java index 1c86fb5fa..094323b70 100644 --- a/src/main/java/com/ruoyi/project/monitor/online/domain/UserOnline.java +++ b/src/main/java/com/ruoyi/project/monitor/online/domain/UserOnline.java @@ -42,7 +42,7 @@ public class UserOnline extends BaseEntity /** session最后访问时间 */ private Date lastAccessTime; - /** 超时时间,单位为分钟 */ + /** 超时时间,单位为毫秒 */ private Long expireTime; /** 在线状态 */ diff --git a/src/main/java/com/ruoyi/project/monitor/operlog/domain/OperLog.java b/src/main/java/com/ruoyi/project/monitor/operlog/domain/OperLog.java index 4ec03def7..6b42dc4eb 100644 --- a/src/main/java/com/ruoyi/project/monitor/operlog/domain/OperLog.java +++ b/src/main/java/com/ruoyi/project/monitor/operlog/domain/OperLog.java @@ -83,6 +83,10 @@ public class OperLog extends BaseEntity @Excel(name = "操作时间", width = 30, dateFormat = "yyyy-MM-dd HH:mm:ss") private Date operTime; + /** 消耗时间 */ + @Excel(name = "消耗时间", suffix = "毫秒") + private Long costTime; + public Long getOperId() { return operId; @@ -253,6 +257,16 @@ public void setOperTime(Date operTime) this.operTime = operTime; } + public Long getCostTime() + { + return costTime; + } + + public void setCostTime(Long costTime) + { + this.costTime = costTime; + } + @Override public String toString() { return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE) @@ -272,6 +286,7 @@ public String toString() { .append("status", getStatus()) .append("errorMsg", getErrorMsg()) .append("operTime", getOperTime()) + .append("costTime", getCostTime()) .toString(); } } diff --git a/src/main/java/com/ruoyi/project/monitor/server/domain/Jvm.java b/src/main/java/com/ruoyi/project/monitor/server/domain/Jvm.java index e27ea25fb..ab27a5a5f 100644 --- a/src/main/java/com/ruoyi/project/monitor/server/domain/Jvm.java +++ b/src/main/java/com/ruoyi/project/monitor/server/domain/Jvm.java @@ -117,7 +117,7 @@ public String getStartTime() */ public String getRunTime() { - return DateUtils.getDatePoor(DateUtils.getNowDate(), DateUtils.getServerStartDate()); + return DateUtils.timeDistance(DateUtils.getNowDate(), DateUtils.getServerStartDate()); } /** diff --git a/src/main/java/com/ruoyi/project/system/config/controller/ConfigController.java b/src/main/java/com/ruoyi/project/system/config/controller/ConfigController.java index b7d91a309..96f55c728 100644 --- a/src/main/java/com/ruoyi/project/system/config/controller/ConfigController.java +++ b/src/main/java/com/ruoyi/project/system/config/controller/ConfigController.java @@ -11,7 +11,6 @@ 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.constant.UserConstants; import com.ruoyi.common.utils.poi.ExcelUtil; import com.ruoyi.framework.aspectj.lang.annotation.Log; import com.ruoyi.framework.aspectj.lang.enums.BusinessType; @@ -69,6 +68,7 @@ public AjaxResult export(Config config) /** * 新增参数配置 */ + @RequiresPermissions("system:config:add") @GetMapping("/add") public String add() { @@ -84,7 +84,7 @@ public String add() @ResponseBody public AjaxResult addSave(@Validated Config config) { - if (UserConstants.CONFIG_KEY_NOT_UNIQUE.equals(configService.checkConfigKeyUnique(config))) + if (!configService.checkConfigKeyUnique(config)) { return error("新增参数'" + config.getConfigName() + "'失败,参数键名已存在"); } @@ -111,7 +111,7 @@ public String edit(@PathVariable("configId") Long configId, ModelMap mmap) @ResponseBody public AjaxResult editSave(@Validated Config config) { - if (UserConstants.CONFIG_KEY_NOT_UNIQUE.equals(configService.checkConfigKeyUnique(config))) + if (!configService.checkConfigKeyUnique(config)) { return error("修改参数'" + config.getConfigName() + "'失败,参数键名已存在"); } @@ -149,7 +149,7 @@ public AjaxResult refreshCache() */ @PostMapping("/checkConfigKeyUnique") @ResponseBody - public String checkConfigKeyUnique(Config config) + public boolean checkConfigKeyUnique(Config config) { return configService.checkConfigKeyUnique(config); } diff --git a/src/main/java/com/ruoyi/project/system/config/mapper/ConfigMapper.java b/src/main/java/com/ruoyi/project/system/config/mapper/ConfigMapper.java index c1c4c6321..e4e74a992 100644 --- a/src/main/java/com/ruoyi/project/system/config/mapper/ConfigMapper.java +++ b/src/main/java/com/ruoyi/project/system/config/mapper/ConfigMapper.java @@ -18,6 +18,14 @@ public interface ConfigMapper */ public Config selectConfig(Config config); + /** + * 通过ID查询配置 + * + * @param configId 参数ID + * @return 参数配置信息 + */ + public Config selectConfigById(Long configId); + /** * 查询参数配置列表 * diff --git a/src/main/java/com/ruoyi/project/system/config/service/ConfigServiceImpl.java b/src/main/java/com/ruoyi/project/system/config/service/ConfigServiceImpl.java index e3e2c1c07..11b604ac7 100644 --- a/src/main/java/com/ruoyi/project/system/config/service/ConfigServiceImpl.java +++ b/src/main/java/com/ruoyi/project/system/config/service/ConfigServiceImpl.java @@ -113,6 +113,12 @@ public int insertConfig(Config config) public int updateConfig(Config config) { config.setUpdateBy(ShiroUtils.getLoginName()); + Config temp = configMapper.selectConfigById(config.getConfigId()); + if (!StringUtils.equals(temp.getConfigKey(), config.getConfigKey())) + { + CacheUtils.remove(getCacheName(), getCacheKey(temp.getConfigKey())); + } + int row = configMapper.updateConfig(config); if (row > 0) { @@ -181,15 +187,15 @@ public void resetConfigCache() * @return 结果 */ @Override - public String checkConfigKeyUnique(Config config) + public boolean checkConfigKeyUnique(Config config) { Long configId = StringUtils.isNull(config.getConfigId()) ? -1L : config.getConfigId(); Config info = configMapper.checkConfigKeyUnique(config.getConfigKey()); if (StringUtils.isNotNull(info) && info.getConfigId().longValue() != configId.longValue()) { - return UserConstants.CONFIG_KEY_NOT_UNIQUE; + return UserConstants.NOT_UNIQUE; } - return UserConstants.CONFIG_KEY_UNIQUE; + return UserConstants.UNIQUE; } /** diff --git a/src/main/java/com/ruoyi/project/system/config/service/IConfigService.java b/src/main/java/com/ruoyi/project/system/config/service/IConfigService.java index 54c408551..bfce9f4b6 100644 --- a/src/main/java/com/ruoyi/project/system/config/service/IConfigService.java +++ b/src/main/java/com/ruoyi/project/system/config/service/IConfigService.java @@ -78,5 +78,5 @@ public interface IConfigService * @param config 参数信息 * @return 结果 */ - public String checkConfigKeyUnique(Config config); + public boolean checkConfigKeyUnique(Config config); } diff --git a/src/main/java/com/ruoyi/project/system/dept/controller/DeptController.java b/src/main/java/com/ruoyi/project/system/dept/controller/DeptController.java index c457e0836..3fbc80c35 100644 --- a/src/main/java/com/ruoyi/project/system/dept/controller/DeptController.java +++ b/src/main/java/com/ruoyi/project/system/dept/controller/DeptController.java @@ -54,6 +54,7 @@ public List list(Dept dept) /** * 新增部门 */ + @RequiresPermissions("system:dept:add") @GetMapping("/add/{parentId}") public String add(@PathVariable("parentId") Long parentId, ModelMap mmap) { @@ -74,7 +75,7 @@ public String add(@PathVariable("parentId") Long parentId, ModelMap mmap) @ResponseBody public AjaxResult addSave(@Validated Dept dept) { - if (UserConstants.DEPT_NAME_NOT_UNIQUE.equals(deptService.checkDeptNameUnique(dept))) + if (!deptService.checkDeptNameUnique(dept)) { return error("新增部门'" + dept.getDeptName() + "'失败,部门名称已存在"); } @@ -109,7 +110,7 @@ public AjaxResult editSave(@Validated Dept dept) { Long deptId = dept.getDeptId(); deptService.checkDeptDataScope(deptId); - if (UserConstants.DEPT_NAME_NOT_UNIQUE.equals(deptService.checkDeptNameUnique(dept))) + if (!deptService.checkDeptNameUnique(dept)) { return error("修改部门'" + dept.getDeptName() + "'失败,部门名称已存在"); } @@ -150,7 +151,7 @@ public AjaxResult remove(@PathVariable("deptId") Long deptId) */ @PostMapping("/checkDeptNameUnique") @ResponseBody - public String checkDeptNameUnique(Dept dept) + public boolean checkDeptNameUnique(Dept dept) { return deptService.checkDeptNameUnique(dept); } @@ -161,9 +162,9 @@ public String checkDeptNameUnique(Dept dept) * @param deptId 部门ID * @param excludeId 排除ID */ + @RequiresPermissions("system:dept:list") @GetMapping(value = { "/selectDeptTree/{deptId}", "/selectDeptTree/{deptId}/{excludeId}" }) - public String selectDeptTree(@PathVariable("deptId") Long deptId, - @PathVariable(value = "excludeId", required = false) Long excludeId, ModelMap mmap) + public String selectDeptTree(@PathVariable("deptId") Long deptId, @PathVariable(value = "excludeId", required = false) Long excludeId, ModelMap mmap) { mmap.put("dept", deptService.selectDeptById(deptId)); mmap.put("excludeId", excludeId); @@ -173,6 +174,7 @@ public String selectDeptTree(@PathVariable("deptId") Long deptId, /** * 加载部门列表树(排除下级) */ + @RequiresPermissions("system:dept:list") @GetMapping("/treeData/{excludeId}") @ResponseBody public List treeDataExcludeChild(@PathVariable(value = "excludeId", required = false) Long excludeId) diff --git a/src/main/java/com/ruoyi/project/system/dept/mapper/DeptMapper.java b/src/main/java/com/ruoyi/project/system/dept/mapper/DeptMapper.java index 458820d91..c32de49fb 100644 --- a/src/main/java/com/ruoyi/project/system/dept/mapper/DeptMapper.java +++ b/src/main/java/com/ruoyi/project/system/dept/mapper/DeptMapper.java @@ -12,7 +12,7 @@ public interface DeptMapper { /** - * 查询部门人数 + * 查询下级部门数量 * * @param dept 部门信息 * @return 结果 diff --git a/src/main/java/com/ruoyi/project/system/dept/service/DeptServiceImpl.java b/src/main/java/com/ruoyi/project/system/dept/service/DeptServiceImpl.java index 0729280d4..bab3382be 100644 --- a/src/main/java/com/ruoyi/project/system/dept/service/DeptServiceImpl.java +++ b/src/main/java/com/ruoyi/project/system/dept/service/DeptServiceImpl.java @@ -144,7 +144,7 @@ public List initZtree(List deptList, List roleDeptList) } /** - * 查询部门人数 + * 根据父部门ID查询下级部门数量 * * @param parentId 部门ID * @return 结果 @@ -316,15 +316,15 @@ public int selectNormalChildrenDeptById(Long deptId) * @return 结果 */ @Override - public String checkDeptNameUnique(Dept dept) + public boolean checkDeptNameUnique(Dept dept) { Long deptId = StringUtils.isNull(dept.getDeptId()) ? -1L : dept.getDeptId(); Dept info = deptMapper.checkDeptNameUnique(dept.getDeptName(), dept.getParentId()); if (StringUtils.isNotNull(info) && info.getDeptId().longValue() != deptId.longValue()) { - return UserConstants.DEPT_NAME_NOT_UNIQUE; + return UserConstants.NOT_UNIQUE; } - return UserConstants.DEPT_NAME_UNIQUE; + return UserConstants.UNIQUE; } /** @@ -335,7 +335,7 @@ public String checkDeptNameUnique(Dept dept) @Override public void checkDeptDataScope(Long deptId) { - if (!User.isAdmin(ShiroUtils.getUserId())) + if (!User.isAdmin(ShiroUtils.getUserId()) && StringUtils.isNotNull(deptId)) { Dept dept = new Dept(); dept.setDeptId(deptId); diff --git a/src/main/java/com/ruoyi/project/system/dept/service/IDeptService.java b/src/main/java/com/ruoyi/project/system/dept/service/IDeptService.java index 50d59e696..990db0c65 100644 --- a/src/main/java/com/ruoyi/project/system/dept/service/IDeptService.java +++ b/src/main/java/com/ruoyi/project/system/dept/service/IDeptService.java @@ -45,7 +45,7 @@ public interface IDeptService public List roleDeptTreeData(Role role); /** - * 查询部门人数 + * 根据父部门ID查询下级部门数量 * * @param parentId 父部门ID * @return 结果 @@ -106,7 +106,7 @@ public interface IDeptService * @param dept 部门信息 * @return 结果 */ - public String checkDeptNameUnique(Dept dept); + public boolean checkDeptNameUnique(Dept dept); /** * 校验部门是否有数据权限 diff --git a/src/main/java/com/ruoyi/project/system/dict/controller/DictDataController.java b/src/main/java/com/ruoyi/project/system/dict/controller/DictDataController.java index ea97ce912..54ad995ff 100644 --- a/src/main/java/com/ruoyi/project/system/dict/controller/DictDataController.java +++ b/src/main/java/com/ruoyi/project/system/dict/controller/DictDataController.java @@ -65,6 +65,7 @@ public AjaxResult export(DictData dictData) /** * 新增字典类型 */ + @RequiresPermissions("system:dict:add") @GetMapping("/add/{dictType}") public String add(@PathVariable("dictType") String dictType, ModelMap mmap) { diff --git a/src/main/java/com/ruoyi/project/system/dict/controller/DictTypeController.java b/src/main/java/com/ruoyi/project/system/dict/controller/DictTypeController.java index 3f8908e47..bf623b6b2 100644 --- a/src/main/java/com/ruoyi/project/system/dict/controller/DictTypeController.java +++ b/src/main/java/com/ruoyi/project/system/dict/controller/DictTypeController.java @@ -11,7 +11,6 @@ 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.constant.UserConstants; import com.ruoyi.common.utils.poi.ExcelUtil; import com.ruoyi.framework.aspectj.lang.annotation.Log; import com.ruoyi.framework.aspectj.lang.enums.BusinessType; @@ -68,6 +67,7 @@ public AjaxResult export(DictType dictType) /** * 新增字典类型 */ + @RequiresPermissions("system:dict:add") @GetMapping("/add") public String add() { @@ -83,7 +83,7 @@ public String add() @ResponseBody public AjaxResult addSave(@Validated DictType dict) { - if (UserConstants.DICT_TYPE_NOT_UNIQUE.equals(dictTypeService.checkDictTypeUnique(dict))) + if (!dictTypeService.checkDictTypeUnique(dict)) { return error("新增字典'" + dict.getDictName() + "'失败,字典类型已存在"); } @@ -110,7 +110,7 @@ public String edit(@PathVariable("dictId") Long dictId, ModelMap mmap) @ResponseBody public AjaxResult editSave(@Validated DictType dict) { - if (UserConstants.DICT_TYPE_NOT_UNIQUE.equals(dictTypeService.checkDictTypeUnique(dict))) + if (!dictTypeService.checkDictTypeUnique(dict)) { return error("修改字典'" + dict.getDictName() + "'失败,字典类型已存在"); } @@ -157,7 +157,7 @@ public String detail(@PathVariable("dictId") Long dictId, ModelMap mmap) */ @PostMapping("/checkDictTypeUnique") @ResponseBody - public String checkDictTypeUnique(DictType dictType) + public boolean checkDictTypeUnique(DictType dictType) { return dictTypeService.checkDictTypeUnique(dictType); } @@ -166,8 +166,7 @@ public String checkDictTypeUnique(DictType dictType) * 选择字典树 */ @GetMapping("/selectDictTree/{columnId}/{dictType}") - public String selectDeptTree(@PathVariable("columnId") Long columnId, @PathVariable("dictType") String dictType, - ModelMap mmap) + public String selectDeptTree(@PathVariable("columnId") Long columnId, @PathVariable("dictType") String dictType, ModelMap mmap) { mmap.put("columnId", columnId); mmap.put("dict", dictTypeService.selectDictTypeByType(dictType)); diff --git a/src/main/java/com/ruoyi/project/system/dict/service/DictTypeServiceImpl.java b/src/main/java/com/ruoyi/project/system/dict/service/DictTypeServiceImpl.java index 864cc8878..b87e20286 100644 --- a/src/main/java/com/ruoyi/project/system/dict/service/DictTypeServiceImpl.java +++ b/src/main/java/com/ruoyi/project/system/dict/service/DictTypeServiceImpl.java @@ -216,15 +216,15 @@ public int updateDictType(DictType dict) * @return 结果 */ @Override - public String checkDictTypeUnique(DictType dict) + public boolean checkDictTypeUnique(DictType dict) { Long dictId = StringUtils.isNull(dict.getDictId()) ? -1L : dict.getDictId(); DictType dictType = dictTypeMapper.checkDictTypeUnique(dict.getDictType()); if (StringUtils.isNotNull(dictType) && dictType.getDictId().longValue() != dictId.longValue()) { - return UserConstants.DICT_TYPE_NOT_UNIQUE; + return UserConstants.NOT_UNIQUE; } - return UserConstants.DICT_TYPE_UNIQUE; + return UserConstants.UNIQUE; } /** diff --git a/src/main/java/com/ruoyi/project/system/dict/service/IDictTypeService.java b/src/main/java/com/ruoyi/project/system/dict/service/IDictTypeService.java index f188ed4fe..23eb1bbb2 100644 --- a/src/main/java/com/ruoyi/project/system/dict/service/IDictTypeService.java +++ b/src/main/java/com/ruoyi/project/system/dict/service/IDictTypeService.java @@ -95,7 +95,7 @@ public interface IDictTypeService * @param dictType 字典类型 * @return 结果 */ - public String checkDictTypeUnique(DictType dictType); + public boolean checkDictTypeUnique(DictType dictType); /** * 查询字典类型树 diff --git a/src/main/java/com/ruoyi/project/system/dict/utils/DictUtils.java b/src/main/java/com/ruoyi/project/system/dict/utils/DictUtils.java index 109193060..375c37406 100644 --- a/src/main/java/com/ruoyi/project/system/dict/utils/DictUtils.java +++ b/src/main/java/com/ruoyi/project/system/dict/utils/DictUtils.java @@ -54,6 +54,10 @@ public static List getDictCache(String key) */ public static String getDictLabel(String dictType, String dictValue) { + if (StringUtils.isEmpty(dictValue)) + { + return StringUtils.EMPTY; + } return getDictLabel(dictType, dictValue, SEPARATOR); } @@ -66,6 +70,10 @@ public static String getDictLabel(String dictType, String dictValue) */ public static String getDictValue(String dictType, String dictLabel) { + if (StringUtils.isEmpty(dictLabel)) + { + return StringUtils.EMPTY; + } return getDictValue(dictType, dictLabel, SEPARATOR); } @@ -81,8 +89,11 @@ public static String getDictLabel(String dictType, String dictValue, String sepa { StringBuilder propertyString = new StringBuilder(); List datas = getDictCache(dictType); - - if (StringUtils.containsAny(separator, dictValue) && StringUtils.isNotEmpty(datas)) + if (StringUtils.isNull(datas)) + { + return StringUtils.EMPTY; + } + if (StringUtils.containsAny(dictValue, separator)) { for (DictData dict : datas) { @@ -109,16 +120,6 @@ public static String getDictLabel(String dictType, String dictValue, String sepa return StringUtils.stripEnd(propertyString.toString(), separator); } - /** - * 删除指定字典缓存 - * - * @param key 字典键 - */ - public static void removeDictCache(String key) - { - CacheUtils.remove(getCacheName(), getCacheKey(key)); - } - /** * 根据字典类型和字典标签获取字典值 * @@ -131,8 +132,11 @@ public static String getDictValue(String dictType, String dictLabel, String sepa { StringBuilder propertyString = new StringBuilder(); List datas = getDictCache(dictType); - - if (StringUtils.containsAny(separator, dictLabel) && StringUtils.isNotEmpty(datas)) + if (StringUtils.isNull(datas)) + { + return StringUtils.EMPTY; + } + if (StringUtils.containsAny(dictLabel, separator)) { for (DictData dict : datas) { @@ -159,6 +163,58 @@ public static String getDictValue(String dictType, String dictLabel, String sepa return StringUtils.stripEnd(propertyString.toString(), separator); } + /** + * 根据字典类型获取字典所有值 + * + * @param dictType 字典类型 + * @return 字典值 + */ + public static String getDictValues(String dictType) + { + StringBuilder propertyString = new StringBuilder(); + List datas = getDictCache(dictType); + if (StringUtils.isNull(datas)) + { + return StringUtils.EMPTY; + } + for (DictData dict : datas) + { + propertyString.append(dict.getDictValue()).append(SEPARATOR); + } + return StringUtils.stripEnd(propertyString.toString(), SEPARATOR); + } + + /** + * 根据字典类型获取字典所有标签 + * + * @param dictType 字典类型 + * @return 字典值 + */ + public static String getDictLabels(String dictType) + { + StringBuilder propertyString = new StringBuilder(); + List datas = getDictCache(dictType); + if (StringUtils.isNull(datas)) + { + return StringUtils.EMPTY; + } + for (DictData dict : datas) + { + propertyString.append(dict.getDictLabel()).append(SEPARATOR); + } + return StringUtils.stripEnd(propertyString.toString(), SEPARATOR); + } + + /** + * 删除指定字典缓存 + * + * @param key 字典键 + */ + public static void removeDictCache(String key) + { + CacheUtils.remove(getCacheName(), getCacheKey(key)); + } + /** * 清空字典缓存 */ diff --git a/src/main/java/com/ruoyi/project/system/menu/controller/MenuController.java b/src/main/java/com/ruoyi/project/system/menu/controller/MenuController.java index 8172e822b..6b6a8fa28 100644 --- a/src/main/java/com/ruoyi/project/system/menu/controller/MenuController.java +++ b/src/main/java/com/ruoyi/project/system/menu/controller/MenuController.java @@ -11,7 +11,6 @@ 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.constant.UserConstants; import com.ruoyi.common.utils.security.AuthorizationUtils; import com.ruoyi.framework.aspectj.lang.annotation.Log; import com.ruoyi.framework.aspectj.lang.enums.BusinessType; @@ -76,6 +75,7 @@ public AjaxResult remove(@PathVariable("menuId") Long menuId) /** * 新增 */ + @RequiresPermissions("system:menu:add") @GetMapping("/add/{parentId}") public String add(@PathVariable("parentId") Long parentId, ModelMap mmap) { @@ -103,7 +103,7 @@ public String add(@PathVariable("parentId") Long parentId, ModelMap mmap) @ResponseBody public AjaxResult addSave(@Validated Menu menu) { - if (UserConstants.MENU_NAME_NOT_UNIQUE.equals(menuService.checkMenuNameUnique(menu))) + if (!menuService.checkMenuNameUnique(menu)) { return error("新增菜单'" + menu.getMenuName() + "'失败,菜单名称已存在"); } @@ -131,7 +131,7 @@ public String edit(@PathVariable("menuId") Long menuId, ModelMap mmap) @ResponseBody public AjaxResult editSave(@Validated Menu menu) { - if (UserConstants.MENU_NAME_NOT_UNIQUE.equals(menuService.checkMenuNameUnique(menu))) + if (!menuService.checkMenuNameUnique(menu)) { return error("修改菜单'" + menu.getMenuName() + "'失败,菜单名称已存在"); } @@ -153,7 +153,7 @@ public String icon() */ @PostMapping("/checkMenuNameUnique") @ResponseBody - public String checkMenuNameUnique(Menu menu) + public boolean checkMenuNameUnique(Menu menu) { return menuService.checkMenuNameUnique(menu); } diff --git a/src/main/java/com/ruoyi/project/system/menu/service/IMenuService.java b/src/main/java/com/ruoyi/project/system/menu/service/IMenuService.java index 34020b0db..8f947f30e 100644 --- a/src/main/java/com/ruoyi/project/system/menu/service/IMenuService.java +++ b/src/main/java/com/ruoyi/project/system/menu/service/IMenuService.java @@ -131,5 +131,5 @@ public interface IMenuService * @param menu 菜单信息 * @return 结果 */ - public String checkMenuNameUnique(Menu menu); + public boolean checkMenuNameUnique(Menu menu); } diff --git a/src/main/java/com/ruoyi/project/system/menu/service/MenuServiceImpl.java b/src/main/java/com/ruoyi/project/system/menu/service/MenuServiceImpl.java index 1bd761dde..beffaad0e 100644 --- a/src/main/java/com/ruoyi/project/system/menu/service/MenuServiceImpl.java +++ b/src/main/java/com/ruoyi/project/system/menu/service/MenuServiceImpl.java @@ -332,14 +332,14 @@ public int updateMenu(Menu menu) * @return 结果 */ @Override - public String checkMenuNameUnique(Menu menu) + public boolean checkMenuNameUnique(Menu menu) { Long menuId = StringUtils.isNull(menu.getMenuId()) ? -1L : menu.getMenuId(); Menu info = menuMapper.checkMenuNameUnique(menu.getMenuName(), menu.getParentId()); if (StringUtils.isNotNull(info) && info.getMenuId().longValue() != menuId.longValue()) { - return UserConstants.MENU_NAME_NOT_UNIQUE; + return UserConstants.NOT_UNIQUE; } - return UserConstants.MENU_NAME_UNIQUE; + return UserConstants.UNIQUE; } } diff --git a/src/main/java/com/ruoyi/project/system/notice/controller/NoticeController.java b/src/main/java/com/ruoyi/project/system/notice/controller/NoticeController.java index 8c1e60de3..62eb49eee 100644 --- a/src/main/java/com/ruoyi/project/system/notice/controller/NoticeController.java +++ b/src/main/java/com/ruoyi/project/system/notice/controller/NoticeController.java @@ -56,6 +56,7 @@ public TableDataInfo list(Notice notice) /** * 新增公告 */ + @RequiresPermissions("system:notice:add") @GetMapping("/add") public String add() { @@ -97,6 +98,17 @@ public AjaxResult editSave(@Validated Notice notice) 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"; + } + /** * 删除公告 */ diff --git a/src/main/java/com/ruoyi/project/system/post/controller/PostController.java b/src/main/java/com/ruoyi/project/system/post/controller/PostController.java index ac1c92d55..b1e1dadb1 100644 --- a/src/main/java/com/ruoyi/project/system/post/controller/PostController.java +++ b/src/main/java/com/ruoyi/project/system/post/controller/PostController.java @@ -11,7 +11,6 @@ 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.constant.UserConstants; import com.ruoyi.common.utils.poi.ExcelUtil; import com.ruoyi.framework.aspectj.lang.annotation.Log; import com.ruoyi.framework.aspectj.lang.enums.BusinessType; @@ -69,19 +68,13 @@ public AjaxResult export(Post post) @ResponseBody public AjaxResult remove(String ids) { - try - { - return toAjax(postService.deletePostByIds(ids)); - } - catch (Exception e) - { - return error(e.getMessage()); - } + return toAjax(postService.deletePostByIds(ids)); } /** * 新增岗位 */ + @RequiresPermissions("system:post:add") @GetMapping("/add") public String add() { @@ -97,11 +90,11 @@ public String add() @ResponseBody public AjaxResult addSave(@Validated Post post) { - if (UserConstants.POST_NAME_NOT_UNIQUE.equals(postService.checkPostNameUnique(post))) + if (!postService.checkPostNameUnique(post)) { return error("新增岗位'" + post.getPostName() + "'失败,岗位名称已存在"); } - else if (UserConstants.POST_CODE_NOT_UNIQUE.equals(postService.checkPostCodeUnique(post))) + else if (!postService.checkPostCodeUnique(post)) { return error("新增岗位'" + post.getPostName() + "'失败,岗位编码已存在"); } @@ -128,11 +121,11 @@ public String edit(@PathVariable("postId") Long postId, ModelMap mmap) @ResponseBody public AjaxResult editSave(@Validated Post post) { - if (UserConstants.POST_NAME_NOT_UNIQUE.equals(postService.checkPostNameUnique(post))) + if (!postService.checkPostNameUnique(post)) { return error("修改岗位'" + post.getPostName() + "'失败,岗位名称已存在"); } - else if (UserConstants.POST_CODE_NOT_UNIQUE.equals(postService.checkPostCodeUnique(post))) + else if (!postService.checkPostCodeUnique(post)) { return error("修改岗位'" + post.getPostName() + "'失败,岗位编码已存在"); } @@ -144,7 +137,7 @@ else if (UserConstants.POST_CODE_NOT_UNIQUE.equals(postService.checkPostCodeUniq */ @PostMapping("/checkPostNameUnique") @ResponseBody - public String checkPostNameUnique(Post post) + public boolean checkPostNameUnique(Post post) { return postService.checkPostNameUnique(post); } @@ -154,7 +147,7 @@ public String checkPostNameUnique(Post post) */ @PostMapping("/checkPostCodeUnique") @ResponseBody - public String checkPostCodeUnique(Post post) + public boolean checkPostCodeUnique(Post post) { return postService.checkPostCodeUnique(post); } diff --git a/src/main/java/com/ruoyi/project/system/post/service/IPostService.java b/src/main/java/com/ruoyi/project/system/post/service/IPostService.java index ea02e264e..9c66300da 100644 --- a/src/main/java/com/ruoyi/project/system/post/service/IPostService.java +++ b/src/main/java/com/ruoyi/project/system/post/service/IPostService.java @@ -79,7 +79,7 @@ public interface IPostService * @param post 岗位信息 * @return 结果 */ - public String checkPostNameUnique(Post post); + public boolean checkPostNameUnique(Post post); /** * 校验岗位编码 @@ -87,5 +87,5 @@ public interface IPostService * @param post 岗位信息 * @return 结果 */ - public String checkPostCodeUnique(Post post); + public boolean checkPostCodeUnique(Post post); } diff --git a/src/main/java/com/ruoyi/project/system/post/service/PostServiceImpl.java b/src/main/java/com/ruoyi/project/system/post/service/PostServiceImpl.java index 1f3883a90..7772159b7 100644 --- a/src/main/java/com/ruoyi/project/system/post/service/PostServiceImpl.java +++ b/src/main/java/com/ruoyi/project/system/post/service/PostServiceImpl.java @@ -152,15 +152,15 @@ public int countUserPostById(Long postId) * @return 结果 */ @Override - public String checkPostNameUnique(Post post) + public boolean checkPostNameUnique(Post post) { Long postId = StringUtils.isNull(post.getPostId()) ? -1L : post.getPostId(); Post info = postMapper.checkPostNameUnique(post.getPostName()); if (StringUtils.isNotNull(info) && info.getPostId().longValue() != postId.longValue()) { - return UserConstants.POST_NAME_NOT_UNIQUE; + return UserConstants.NOT_UNIQUE; } - return UserConstants.POST_NAME_UNIQUE; + return UserConstants.UNIQUE; } /** @@ -170,14 +170,14 @@ public String checkPostNameUnique(Post post) * @return 结果 */ @Override - public String checkPostCodeUnique(Post post) + public boolean checkPostCodeUnique(Post post) { Long postId = StringUtils.isNull(post.getPostId()) ? -1L : post.getPostId(); Post info = postMapper.checkPostCodeUnique(post.getPostCode()); if (StringUtils.isNotNull(info) && info.getPostId().longValue() != postId.longValue()) { - return UserConstants.POST_CODE_NOT_UNIQUE; + return UserConstants.NOT_UNIQUE; } - return UserConstants.POST_CODE_UNIQUE; + return UserConstants.UNIQUE; } } diff --git a/src/main/java/com/ruoyi/project/system/role/controller/RoleController.java b/src/main/java/com/ruoyi/project/system/role/controller/RoleController.java index 9bab05990..e7a3cfd1b 100644 --- a/src/main/java/com/ruoyi/project/system/role/controller/RoleController.java +++ b/src/main/java/com/ruoyi/project/system/role/controller/RoleController.java @@ -11,7 +11,6 @@ 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.constant.UserConstants; import com.ruoyi.common.utils.poi.ExcelUtil; import com.ruoyi.common.utils.security.AuthorizationUtils; import com.ruoyi.framework.aspectj.lang.annotation.Log; @@ -78,6 +77,7 @@ public AjaxResult export(Role role) /** * 新增角色 */ + @RequiresPermissions("system:role:add") @GetMapping("/add") public String add() { @@ -93,11 +93,11 @@ public String add() @ResponseBody public AjaxResult addSave(@Validated Role role) { - if (UserConstants.ROLE_NAME_NOT_UNIQUE.equals(roleService.checkRoleNameUnique(role))) + if (!roleService.checkRoleNameUnique(role)) { return error("新增角色'" + role.getRoleName() + "'失败,角色名称已存在"); } - else if (UserConstants.ROLE_KEY_NOT_UNIQUE.equals(roleService.checkRoleKeyUnique(role))) + else if (!roleService.checkRoleKeyUnique(role)) { return error("新增角色'" + role.getRoleName() + "'失败,角色权限已存在"); } @@ -129,11 +129,11 @@ public AjaxResult editSave(@Validated Role role) { roleService.checkRoleAllowed(role); roleService.checkRoleDataScope(role.getRoleId()); - if (UserConstants.ROLE_NAME_NOT_UNIQUE.equals(roleService.checkRoleNameUnique(role))) + if (!roleService.checkRoleNameUnique(role)) { return error("修改角色'" + role.getRoleName() + "'失败,角色名称已存在"); } - else if (UserConstants.ROLE_KEY_NOT_UNIQUE.equals(roleService.checkRoleKeyUnique(role))) + else if (!roleService.checkRoleKeyUnique(role)) { return error("修改角色'" + role.getRoleName() + "'失败,角色权限已存在"); } @@ -185,7 +185,7 @@ public AjaxResult remove(String ids) */ @PostMapping("/checkRoleNameUnique") @ResponseBody - public String checkRoleNameUnique(Role role) + public boolean checkRoleNameUnique(Role role) { return roleService.checkRoleNameUnique(role); } @@ -195,7 +195,7 @@ public String checkRoleNameUnique(Role role) */ @PostMapping("/checkRoleKeyUnique") @ResponseBody - public String checkRoleKeyUnique(Role role) + public boolean checkRoleKeyUnique(Role role) { return roleService.checkRoleKeyUnique(role); } diff --git a/src/main/java/com/ruoyi/project/system/role/service/IRoleService.java b/src/main/java/com/ruoyi/project/system/role/service/IRoleService.java index 9391a24a4..50ba7217f 100644 --- a/src/main/java/com/ruoyi/project/system/role/service/IRoleService.java +++ b/src/main/java/com/ruoyi/project/system/role/service/IRoleService.java @@ -98,7 +98,7 @@ public interface IRoleService * @param role 角色信息 * @return 结果 */ - public String checkRoleNameUnique(Role role); + public boolean checkRoleNameUnique(Role role); /** * 校验角色权限是否唯一 @@ -106,7 +106,7 @@ public interface IRoleService * @param role 角色信息 * @return 结果 */ - public String checkRoleKeyUnique(Role role); + public boolean checkRoleKeyUnique(Role role); /** * 校验角色是否允许操作 @@ -118,9 +118,9 @@ public interface IRoleService /** * 校验角色是否有数据权限 * - * @param roleId 角色id + * @param roleIds 角色id */ - public void checkRoleDataScope(Long roleId); + public void checkRoleDataScope(Long... roleIds); /** * 通过角色ID查询角色使用数量 diff --git a/src/main/java/com/ruoyi/project/system/role/service/RoleServiceImpl.java b/src/main/java/com/ruoyi/project/system/role/service/RoleServiceImpl.java index 9262b057b..b26c19e22 100644 --- a/src/main/java/com/ruoyi/project/system/role/service/RoleServiceImpl.java +++ b/src/main/java/com/ruoyi/project/system/role/service/RoleServiceImpl.java @@ -280,15 +280,15 @@ public int insertRoleDept(Role role) * @return 结果 */ @Override - public String checkRoleNameUnique(Role role) + public boolean checkRoleNameUnique(Role role) { Long roleId = StringUtils.isNull(role.getRoleId()) ? -1L : role.getRoleId(); Role info = roleMapper.checkRoleNameUnique(role.getRoleName()); if (StringUtils.isNotNull(info) && info.getRoleId().longValue() != roleId.longValue()) { - return UserConstants.ROLE_NAME_NOT_UNIQUE; + return UserConstants.NOT_UNIQUE; } - return UserConstants.ROLE_NAME_UNIQUE; + return UserConstants.UNIQUE; } /** @@ -298,15 +298,15 @@ public String checkRoleNameUnique(Role role) * @return 结果 */ @Override - public String checkRoleKeyUnique(Role role) + public boolean checkRoleKeyUnique(Role role) { Long roleId = StringUtils.isNull(role.getRoleId()) ? -1L : role.getRoleId(); Role info = roleMapper.checkRoleKeyUnique(role.getRoleKey()); if (StringUtils.isNotNull(info) && info.getRoleId().longValue() != roleId.longValue()) { - return UserConstants.ROLE_KEY_NOT_UNIQUE; + return UserConstants.NOT_UNIQUE; } - return UserConstants.ROLE_KEY_UNIQUE; + return UserConstants.UNIQUE; } /** @@ -329,16 +329,19 @@ public void checkRoleAllowed(Role role) * @param roleId 角色id */ @Override - public void checkRoleDataScope(Long roleId) + public void checkRoleDataScope(Long... roleIds) { if (!User.isAdmin(ShiroUtils.getUserId())) { - Role role = new Role(); - role.setRoleId(roleId); - List roles = SpringUtils.getAopProxy(this).selectRoleList(role); - if (StringUtils.isEmpty(roles)) + for (Long roleId : roleIds) { - throw new ServiceException("没有权限访问角色数据!"); + Role role = new Role(); + role.setRoleId(roleId); + List roles = SpringUtils.getAopProxy(this).selectRoleList(role); + if (StringUtils.isEmpty(roles)) + { + throw new ServiceException("没有权限访问角色数据!"); + } } } } diff --git a/src/main/java/com/ruoyi/project/system/user/controller/ProfileController.java b/src/main/java/com/ruoyi/project/system/user/controller/ProfileController.java index 351a22b70..f474ffbf5 100644 --- a/src/main/java/com/ruoyi/project/system/user/controller/ProfileController.java +++ b/src/main/java/com/ruoyi/project/system/user/controller/ProfileController.java @@ -11,7 +11,6 @@ import org.springframework.web.bind.annotation.RequestParam; import org.springframework.web.bind.annotation.ResponseBody; import org.springframework.web.multipart.MultipartFile; -import com.ruoyi.common.constant.UserConstants; import com.ruoyi.common.utils.DateUtils; import com.ruoyi.common.utils.StringUtils; import com.ruoyi.common.utils.file.FileUploadUtils; @@ -62,11 +61,7 @@ public String profile(ModelMap mmap) public boolean checkPassword(String password) { User user = getSysUser(); - if (passwordService.matches(user, password)) - { - return true; - } - return false; + return passwordService.matches(user, password); } @GetMapping("/resetPwd") @@ -136,13 +131,11 @@ public AjaxResult update(User user) currentUser.setEmail(user.getEmail()); currentUser.setPhonenumber(user.getPhonenumber()); currentUser.setSex(user.getSex()); - if (StringUtils.isNotEmpty(user.getPhonenumber()) - && UserConstants.USER_PHONE_NOT_UNIQUE.equals(userService.checkPhoneUnique(currentUser))) + if (StringUtils.isNotEmpty(user.getPhonenumber()) && !userService.checkPhoneUnique(currentUser)) { return error("修改用户'" + currentUser.getLoginName() + "'失败,手机号码已存在"); } - else if (StringUtils.isNotEmpty(user.getEmail()) - && UserConstants.USER_EMAIL_NOT_UNIQUE.equals(userService.checkEmailUnique(currentUser))) + else if (StringUtils.isNotEmpty(user.getEmail()) && !userService.checkEmailUnique(currentUser)) { return error("修改用户'" + currentUser.getLoginName() + "'失败,邮箱账号已存在"); } diff --git a/src/main/java/com/ruoyi/project/system/user/controller/UserController.java b/src/main/java/com/ruoyi/project/system/user/controller/UserController.java index 73b431850..7d3d3f954 100644 --- a/src/main/java/com/ruoyi/project/system/user/controller/UserController.java +++ b/src/main/java/com/ruoyi/project/system/user/controller/UserController.java @@ -14,7 +14,6 @@ import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.web.bind.annotation.ResponseBody; import org.springframework.web.multipart.MultipartFile; -import com.ruoyi.common.constant.UserConstants; import com.ruoyi.common.utils.StringUtils; import com.ruoyi.common.utils.poi.ExcelUtil; import com.ruoyi.common.utils.security.AuthorizationUtils; @@ -109,6 +108,7 @@ public AjaxResult importTemplate() /** * 新增用户 */ + @RequiresPermissions("system:user:add") @GetMapping("/add") public String add(ModelMap mmap) { @@ -126,17 +126,17 @@ public String add(ModelMap mmap) @ResponseBody public AjaxResult addSave(@Validated User user) { - if (UserConstants.USER_NAME_NOT_UNIQUE.equals(userService.checkLoginNameUnique(user.getLoginName()))) + deptService.checkDeptDataScope(user.getDeptId()); + roleService.checkRoleDataScope(user.getRoleIds()); + if (!userService.checkLoginNameUnique(user)) { return error("新增用户'" + user.getLoginName() + "'失败,登录账号已存在"); } - else if (StringUtils.isNotEmpty(user.getPhonenumber()) - && UserConstants.USER_PHONE_NOT_UNIQUE.equals(userService.checkPhoneUnique(user))) + else if (StringUtils.isNotEmpty(user.getPhonenumber()) && !userService.checkPhoneUnique(user)) { return error("新增用户'" + user.getLoginName() + "'失败,手机号码已存在"); } - else if (StringUtils.isNotEmpty(user.getEmail()) - && UserConstants.USER_EMAIL_NOT_UNIQUE.equals(userService.checkEmailUnique(user))) + else if (StringUtils.isNotEmpty(user.getEmail()) && !userService.checkEmailUnique(user)) { return error("新增用户'" + user.getLoginName() + "'失败,邮箱账号已存在"); } @@ -158,6 +158,20 @@ public String edit(@PathVariable("userId") Long userId, ModelMap mmap) 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"; + } + /** * 修改保存用户 */ @@ -169,13 +183,17 @@ public AjaxResult editSave(@Validated User user) { userService.checkUserAllowed(user); userService.checkUserDataScope(user.getUserId()); - if (StringUtils.isNotEmpty(user.getPhonenumber()) - && UserConstants.USER_PHONE_NOT_UNIQUE.equals(userService.checkPhoneUnique(user))) + 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)) { return error("修改用户'" + user.getLoginName() + "'失败,手机号码已存在"); } - else if (StringUtils.isNotEmpty(user.getEmail()) - && UserConstants.USER_EMAIL_NOT_UNIQUE.equals(userService.checkEmailUnique(user))) + else if (StringUtils.isNotEmpty(user.getEmail()) && !userService.checkEmailUnique(user)) { return error("修改用户'" + user.getLoginName() + "'失败,邮箱账号已存在"); } @@ -235,6 +253,7 @@ public String authRole(@PathVariable("userId") Long userId, ModelMap mmap) public AjaxResult insertAuthRole(Long userId, Long[] roleIds) { userService.checkUserDataScope(userId); + roleService.checkRoleDataScope(roleIds); userService.insertUserAuth(userId, roleIds); AuthorizationUtils.clearAllCachedAuthorizationInfo(); return success(); @@ -258,9 +277,9 @@ public AjaxResult remove(String ids) */ @PostMapping("/checkLoginNameUnique") @ResponseBody - public String checkLoginNameUnique(User user) + public boolean checkLoginNameUnique(User user) { - return userService.checkLoginNameUnique(user.getLoginName()); + return userService.checkLoginNameUnique(user); } /** @@ -268,7 +287,7 @@ public String checkLoginNameUnique(User user) */ @PostMapping("/checkPhoneUnique") @ResponseBody - public String checkPhoneUnique(User user) + public boolean checkPhoneUnique(User user) { return userService.checkPhoneUnique(user); } @@ -278,7 +297,7 @@ public String checkPhoneUnique(User user) */ @PostMapping("/checkEmailUnique") @ResponseBody - public String checkEmailUnique(User user) + public boolean checkEmailUnique(User user) { return userService.checkEmailUnique(user); } diff --git a/src/main/java/com/ruoyi/project/system/user/domain/User.java b/src/main/java/com/ruoyi/project/system/user/domain/User.java index a09179a48..00529c8a7 100644 --- a/src/main/java/com/ruoyi/project/system/user/domain/User.java +++ b/src/main/java/com/ruoyi/project/system/user/domain/User.java @@ -26,7 +26,7 @@ public class User extends BaseEntity private static final long serialVersionUID = 1L; /** 用户ID */ - @Excel(name = "用户序号", cellType = ColumnType.NUMERIC, prompt = "用户编号") + @Excel(name = "用户序号", type = Type.EXPORT, cellType = ColumnType.NUMERIC, prompt = "用户编号") private Long userId; /** 部门ID */ @@ -55,7 +55,7 @@ public class User extends BaseEntity private String email; /** 手机号码 */ - @Excel(name = "手机号码") + @Excel(name = "手机号码", cellType = ColumnType.TEXT) private String phonenumber; /** 用户性别 */ @@ -253,6 +253,7 @@ public void setPassword(String password) this.password = password; } + @JsonIgnore public String getSalt() { return salt; diff --git a/src/main/java/com/ruoyi/project/system/user/mapper/UserMapper.java b/src/main/java/com/ruoyi/project/system/user/mapper/UserMapper.java index a1278aa9d..0c2c9c686 100644 --- a/src/main/java/com/ruoyi/project/system/user/mapper/UserMapper.java +++ b/src/main/java/com/ruoyi/project/system/user/mapper/UserMapper.java @@ -104,7 +104,7 @@ public interface UserMapper * @param loginName 登录名称 * @return 结果 */ - public int checkLoginNameUnique(String loginName); + public User checkLoginNameUnique(String loginName); /** * 校验手机号码是否唯一 diff --git a/src/main/java/com/ruoyi/project/system/user/mapper/UserPostMapper.java b/src/main/java/com/ruoyi/project/system/user/mapper/UserPostMapper.java index af6dd7cb1..287604c54 100644 --- a/src/main/java/com/ruoyi/project/system/user/mapper/UserPostMapper.java +++ b/src/main/java/com/ruoyi/project/system/user/mapper/UserPostMapper.java @@ -37,7 +37,7 @@ public interface UserPostMapper /** * 批量新增用户岗位信息 * - * @param userPostList 用户角色列表 + * @param userPostList 用户岗位列表 * @return 结果 */ public int batchUserPost(List userPostList); diff --git a/src/main/java/com/ruoyi/project/system/user/service/IUserService.java b/src/main/java/com/ruoyi/project/system/user/service/IUserService.java index d710b71f8..241f50692 100644 --- a/src/main/java/com/ruoyi/project/system/user/service/IUserService.java +++ b/src/main/java/com/ruoyi/project/system/user/service/IUserService.java @@ -143,10 +143,10 @@ public interface IUserService /** * 校验用户名称是否唯一 * - * @param loginName 登录名称 + * @param user 用户信息 * @return 结果 */ - public String checkLoginNameUnique(String loginName); + public boolean checkLoginNameUnique(User user); /** * 校验手机号码是否唯一 @@ -154,7 +154,7 @@ public interface IUserService * @param user 用户信息 * @return 结果 */ - public String checkPhoneUnique(User user); + public boolean checkPhoneUnique(User user); /** * 校验email是否唯一 @@ -162,7 +162,7 @@ public interface IUserService * @param user 用户信息 * @return 结果 */ - public String checkEmailUnique(User user); + public boolean checkEmailUnique(User user); /** * 校验用户是否允许操作 diff --git a/src/main/java/com/ruoyi/project/system/user/service/UserServiceImpl.java b/src/main/java/com/ruoyi/project/system/user/service/UserServiceImpl.java index 27996c81b..0b8850fcc 100644 --- a/src/main/java/com/ruoyi/project/system/user/service/UserServiceImpl.java +++ b/src/main/java/com/ruoyi/project/system/user/service/UserServiceImpl.java @@ -3,6 +3,7 @@ import java.util.ArrayList; import java.util.List; import java.util.stream.Collectors; +import javax.validation.ConstraintViolationException; import javax.validation.Validator; import org.slf4j.Logger; import org.slf4j.LoggerFactory; @@ -12,14 +13,19 @@ import org.springframework.util.CollectionUtils; import com.ruoyi.common.constant.UserConstants; import com.ruoyi.common.exception.ServiceException; +import com.ruoyi.common.utils.DateUtils; +import com.ruoyi.common.utils.ExceptionUtil; +import com.ruoyi.common.utils.Md5Utils; import com.ruoyi.common.utils.StringUtils; import com.ruoyi.common.utils.bean.BeanValidators; +import com.ruoyi.common.utils.html.EscapeUtil; import com.ruoyi.common.utils.security.ShiroUtils; import com.ruoyi.common.utils.spring.SpringUtils; import com.ruoyi.common.utils.text.Convert; import com.ruoyi.framework.aspectj.lang.annotation.DataScope; import com.ruoyi.framework.shiro.service.PasswordService; import com.ruoyi.project.system.config.service.IConfigService; +import com.ruoyi.project.system.dept.service.IDeptService; import com.ruoyi.project.system.post.domain.Post; import com.ruoyi.project.system.post.mapper.PostMapper; import com.ruoyi.project.system.role.domain.Role; @@ -62,6 +68,9 @@ public class UserServiceImpl implements IUserService @Autowired private PasswordService passwordService; + @Autowired + private IDeptService deptService; + @Autowired protected Validator validator; @@ -217,6 +226,7 @@ public int insertUser(User user) { user.randomSalt(); user.setPassword(passwordService.encryptPassword(user.getLoginName(), user.getPassword(), user.getSalt())); + user.setPwdUpdateDate(DateUtils.getNowDate()); user.setCreateBy(ShiroUtils.getLoginName()); // 新增用户信息 int rows = userMapper.insertUser(user); @@ -358,20 +368,21 @@ public void insertUserPost(User user) } /** - * 校验登录名称是否唯一 + * 校验用户名称是否唯一 * - * @param loginName 用户名 - * @return + * @param user 用户信息 + * @return 结果 */ @Override - public String checkLoginNameUnique(String loginName) + public boolean checkLoginNameUnique(User user) { - int count = userMapper.checkLoginNameUnique(loginName); - if (count > 0) + Long userId = StringUtils.isNull(user.getUserId()) ? -1L : user.getUserId(); + User info = userMapper.checkLoginNameUnique(user.getLoginName()); + if (StringUtils.isNotNull(info) && info.getUserId().longValue() != userId.longValue()) { - return UserConstants.USER_NAME_NOT_UNIQUE; + return UserConstants.NOT_UNIQUE; } - return UserConstants.USER_NAME_UNIQUE; + return UserConstants.UNIQUE; } /** @@ -381,15 +392,15 @@ public String checkLoginNameUnique(String loginName) * @return */ @Override - public String checkPhoneUnique(User user) + public boolean checkPhoneUnique(User user) { Long userId = StringUtils.isNull(user.getUserId()) ? -1L : user.getUserId(); User info = userMapper.checkPhoneUnique(user.getPhonenumber()); if (StringUtils.isNotNull(info) && info.getUserId().longValue() != userId.longValue()) { - return UserConstants.USER_PHONE_NOT_UNIQUE; + return UserConstants.NOT_UNIQUE; } - return UserConstants.USER_PHONE_UNIQUE; + return UserConstants.UNIQUE; } /** @@ -399,15 +410,15 @@ public String checkPhoneUnique(User user) * @return */ @Override - public String checkEmailUnique(User user) + public boolean checkEmailUnique(User user) { Long userId = StringUtils.isNull(user.getUserId()) ? -1L : user.getUserId(); User info = userMapper.checkEmailUnique(user.getEmail()); if (StringUtils.isNotNull(info) && info.getUserId().longValue() != userId.longValue()) { - return UserConstants.USER_EMAIL_NOT_UNIQUE; + return UserConstants.NOT_UNIQUE; } - return UserConstants.USER_EMAIL_UNIQUE; + return UserConstants.UNIQUE; } /** @@ -497,7 +508,6 @@ public String importUser(List userList, Boolean isUpdateSupport) StringBuilder successMsg = new StringBuilder(); StringBuilder failureMsg = new StringBuilder(); String operName = ShiroUtils.getLoginName(); - String password = configService.selectConfigByKey("sys.user.initPassword"); for (User user : userList) { try @@ -507,17 +517,23 @@ public String importUser(List userList, Boolean isUpdateSupport) if (StringUtils.isNull(u)) { BeanValidators.validateWithException(validator, user); - user.setPassword(password); + deptService.checkDeptDataScope(user.getDeptId()); + String password = configService.selectConfigByKey("sys.user.initPassword"); + user.setPassword(Md5Utils.hash(user.getLoginName() + password)); user.setCreateBy(operName); - this.insertUser(user); + userMapper.insertUser(user); successNum++; successMsg.append("
" + successNum + "、账号 " + user.getLoginName() + " 导入成功"); } else if (isUpdateSupport) { BeanValidators.validateWithException(validator, user); + checkUserAllowed(u); + checkUserDataScope(u.getUserId()); + deptService.checkDeptDataScope(user.getDeptId()); + user.setUserId(u.getUserId()); user.setUpdateBy(operName); - this.updateUser(user); + userMapper.updateUser(user); successNum++; successMsg.append("
" + successNum + "、账号 " + user.getLoginName() + " 更新成功"); } @@ -530,7 +546,12 @@ else if (isUpdateSupport) catch (Exception e) { failureNum++; - String msg = "
" + failureNum + "、账号 " + user.getLoginName() + " 导入失败:"; + String loginName = user.getLoginName(); + if (ExceptionUtil.isCausedBy(e, ConstraintViolationException.class)) + { + loginName = EscapeUtil.clean(loginName); + } + String msg = "
" + failureNum + "、账号 " + loginName + " 导入失败:"; failureMsg.append(msg + e.getMessage()); log.error(msg, e); } diff --git a/src/main/java/com/ruoyi/project/tool/gen/controller/GenController.java b/src/main/java/com/ruoyi/project/tool/gen/controller/GenController.java index 630db107b..34fca9d4f 100644 --- a/src/main/java/com/ruoyi/project/tool/gen/controller/GenController.java +++ b/src/main/java/com/ruoyi/project/tool/gen/controller/GenController.java @@ -27,6 +27,7 @@ import com.ruoyi.common.utils.text.Convert; import com.ruoyi.framework.aspectj.lang.annotation.Log; import com.ruoyi.framework.aspectj.lang.enums.BusinessType; +import com.ruoyi.framework.config.GenConfig; import com.ruoyi.framework.web.controller.BaseController; import com.ruoyi.framework.web.domain.AjaxResult; import com.ruoyi.framework.web.domain.CxSelect; @@ -219,7 +220,7 @@ public AjaxResult create(String sql) catch (Exception e) { logger.error(e.getMessage(), e); - return AjaxResult.error("创建表结构异常[" + e.getMessage() + "]"); + return AjaxResult.error("创建表结构异常"); } } @@ -256,6 +257,10 @@ public void download(HttpServletResponse response, @PathVariable("tableName") St @ResponseBody public AjaxResult genCode(@PathVariable("tableName") String tableName) { + if (!GenConfig.isAllowOverwrite()) + { + return AjaxResult.error("【系统预设】不允许生成文件覆盖到本地"); + } genTableService.generatorCode(tableName); return AjaxResult.success(); } diff --git a/src/main/java/com/ruoyi/project/tool/gen/domain/GenTable.java b/src/main/java/com/ruoyi/project/tool/gen/domain/GenTable.java index 4bbe7e5a6..d2bf4882f 100644 --- a/src/main/java/com/ruoyi/project/tool/gen/domain/GenTable.java +++ b/src/main/java/com/ruoyi/project/tool/gen/domain/GenTable.java @@ -61,6 +61,9 @@ public class GenTable extends BaseEntity @NotBlank(message = "作者不能为空") private String functionAuthor; + /** 表单布局(单列 双列 三列) */ + private int formColNum; + /** 生成代码方式(0zip压缩包 1自定义路径) */ private String genType; @@ -215,6 +218,16 @@ public void setFunctionAuthor(String functionAuthor) this.functionAuthor = functionAuthor; } + public int getFormColNum() + { + return formColNum; + } + + public void setFormColNum(int formColNum) + { + this.formColNum = formColNum; + } + public String getGenType() { return genType; diff --git a/src/main/java/com/ruoyi/project/tool/gen/domain/GenTableColumn.java b/src/main/java/com/ruoyi/project/tool/gen/domain/GenTableColumn.java index 60cef762b..c61f329cc 100644 --- a/src/main/java/com/ruoyi/project/tool/gen/domain/GenTableColumn.java +++ b/src/main/java/com/ruoyi/project/tool/gen/domain/GenTableColumn.java @@ -63,7 +63,7 @@ public class GenTableColumn extends BaseEntity private String htmlType; /** 字典类型 */ - private String dictType; + private String dictType = ""; /** 排序 */ private Integer sort; diff --git a/src/main/java/com/ruoyi/project/tool/gen/service/GenTableServiceImpl.java b/src/main/java/com/ruoyi/project/tool/gen/service/GenTableServiceImpl.java index 8e6b79113..48a4da0ab 100644 --- a/src/main/java/com/ruoyi/project/tool/gen/service/GenTableServiceImpl.java +++ b/src/main/java/com/ruoyi/project/tool/gen/service/GenTableServiceImpl.java @@ -130,9 +130,9 @@ public void updateGenTable(GenTable genTable) int row = genTableMapper.updateGenTable(genTable); if (row > 0) { - for (GenTableColumn cenTableColumn : genTable.getColumns()) + for (GenTableColumn genTableColumn : genTable.getColumns()) { - genTableColumnMapper.updateGenTableColumn(cenTableColumn); + genTableColumnMapper.updateGenTableColumn(genTableColumn); } } } diff --git a/src/main/java/com/ruoyi/project/tool/gen/util/VelocityUtils.java b/src/main/java/com/ruoyi/project/tool/gen/util/VelocityUtils.java index 7c1c64b1e..5cb3ede15 100644 --- a/src/main/java/com/ruoyi/project/tool/gen/util/VelocityUtils.java +++ b/src/main/java/com/ruoyi/project/tool/gen/util/VelocityUtils.java @@ -49,6 +49,8 @@ public static VelocityContext prepareContext(GenTable genTable) velocityContext.put("basePackage", getPackagePrefix(packageName)); velocityContext.put("packageName", packageName); velocityContext.put("author", genTable.getFunctionAuthor()); + velocityContext.put("colXsNum", getColXsNum(genTable.getFormColNum())); + velocityContext.put("colSmNum", getColSmNum(genTable.getFormColNum())); velocityContext.put("datetime", DateUtils.getDate()); velocityContext.put("pkColumn", genTable.getPkColumn()); velocityContext.put("importList", getImportList(genTable)); @@ -365,4 +367,40 @@ public static int getExpandColumn(GenTable genTable) } return num; } + + /** + * 获取表单排列网格 + * + * @param formColNum 表单布局方式 + * @return 排列类样式 + */ + public static String getColXsNum(int formColNum) + { + String colXsNum = "col-xs-12"; + if (formColNum == 2) + { + return "col-xs-6"; + } + else if (formColNum == 3) + { + return "col-xs-4"; + } + return colXsNum; + } + + /** + * 获取表单label网格 + * + * @param formColNum 表单布局方式 + * @return 网格类样式 + */ + public static String getColSmNum(int formColNum) + { + String colSmNum = "col-sm-3"; + if (formColNum == 2 || formColNum == 3) + { + return "col-sm-4"; + } + return colSmNum; + } } diff --git a/src/main/resources/application-druid.yml b/src/main/resources/application-druid.yml index 3c46fd50b..a69d8feb2 100644 --- a/src/main/resources/application-druid.yml +++ b/src/main/resources/application-druid.yml @@ -24,6 +24,10 @@ spring: maxActive: 20 # 配置获取连接等待超时的时间 maxWait: 60000 + # 配置连接超时时间 + connectTimeout: 30000 + # 配置网络超时时间 + socketTimeout: 60000 # 配置间隔多久才进行一次检测,检测需要关闭的空闲连接,单位是毫秒 timeBetweenEvictionRunsMillis: 60000 # 配置一个连接在池中最小生存的时间,单位是毫秒 diff --git a/src/main/resources/application.yml b/src/main/resources/application.yml index b945cd73f..88fc89be0 100644 --- a/src/main/resources/application.yml +++ b/src/main/resources/application.yml @@ -3,9 +3,9 @@ ruoyi: # 名称 name: RuoYi # 版本 - version: 4.7.5 + version: 4.8.0 # 版权年份 - copyrightYear: 2022 + copyrightYear: 2024 # 实例演示开关 demoEnabled: true # 文件路径 示例( Windows配置D:/ruoyi/uploadPath,Linux配置 /home/ruoyi/uploadPath) @@ -58,15 +58,15 @@ spring: jackson: time-zone: GMT+8 date-format: yyyy-MM-dd HH:mm:ss - profiles: + profiles: active: druid # 文件上传 servlet: - multipart: - # 单个文件大小 - max-file-size: 10MB - # 设置总上传的文件大小 - max-request-size: 20MB + multipart: + # 单个文件大小 + max-file-size: 10MB + # 设置总上传的文件大小 + max-request-size: 20MB # 服务模块 devtools: restart: @@ -83,10 +83,10 @@ mybatis: configLocation: classpath:mybatis/mybatis-config.xml # PageHelper分页插件 -pagehelper: +pagehelper: helperDialect: mysql supportMethodsArguments: true - params: count=countSql + params: count=countSql # Shiro shiro: @@ -99,11 +99,11 @@ shiro: indexUrl: /index # 验证码开关 captchaEnabled: true - # 验证码类型 math 数组计算 char 字符 + # 验证码类型 math 数字计算 char 字符验证 captchaType: math cookie: # 设置Cookie的域名 默认空,即当前访问的域名 - domain: + domain: # 设置cookie的有效访问路径 path: / # 设置HttpOnly属性 @@ -111,7 +111,7 @@ shiro: # 设置Cookie的过期时间,天为单位 maxAge: 30 # 设置密钥,务必保持唯一性(生成方式,直接拷贝到main运行即可)Base64.encodeToString(CipherUtils.generateNewKey(128, "AES").getEncoded()) (默认启动生成随机秘钥,随机秘钥会导致之前客户端RememberMe Cookie无效,如设置固定秘钥RememberMe Cookie则有效) - cipherKey: + cipherKey: session: # Session超时时间,-1代表永不过期(默认30分钟) expireTime: 30 @@ -128,7 +128,7 @@ shiro: enabled: true # 防止XSS攻击 -xss: +xss: # 过滤开关 enabled: true # 排除链接(多个用逗号分隔) @@ -142,7 +142,7 @@ swagger: enabled: true # 代码生成 -gen: +gen: # 作者 author: ruoyi # 默认生成包路径 system 需改成自己的模块名称 如 system monitor tool @@ -150,4 +150,6 @@ gen: # 自动去除表前缀,默认是true autoRemovePre: true # 表前缀(生成类名不会包含表前缀,多个用逗号分隔) - tablePrefix: sys_ \ No newline at end of file + tablePrefix: sys_ + # 是否允许生成文件覆盖到本地(自定义路径),默认不允许 + allowOverwrite: false \ No newline at end of file diff --git a/src/main/resources/mybatis/monitor/JobLogMapper.xml b/src/main/resources/mybatis/monitor/JobLogMapper.xml index 06698d72a..46296e487 100644 --- a/src/main/resources/mybatis/monitor/JobLogMapper.xml +++ b/src/main/resources/mybatis/monitor/JobLogMapper.xml @@ -36,12 +36,13 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" AND invoke_target like concat('%', #{invokeTarget}, '%') - and date_format(create_time,'%y%m%d') >= date_format(#{params.beginTime},'%y%m%d') + and date_format(create_time,'%Y%m%d') >= date_format(#{params.beginTime},'%Y%m%d') - and date_format(create_time,'%y%m%d') <= date_format(#{params.endTime},'%y%m%d') + and date_format(create_time,'%Y%m%d') <= date_format(#{params.endTime},'%Y%m%d') + order by create_time desc diff --git a/src/main/resources/mybatis/monitor/OperLogMapper.xml b/src/main/resources/mybatis/monitor/OperLogMapper.xml index f55bbc0ff..e43cb7522 100644 --- a/src/main/resources/mybatis/monitor/OperLogMapper.xml +++ b/src/main/resources/mybatis/monitor/OperLogMapper.xml @@ -21,21 +21,25 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" + - select oper_id, title, business_type, method, request_method, operator_type, oper_name, dept_name, oper_url, oper_ip, oper_location, oper_param, json_result, status, error_msg, oper_time + select oper_id, title, business_type, method, request_method, operator_type, oper_name, dept_name, oper_url, oper_ip, oper_location, oper_param, json_result, status, error_msg, oper_time, cost_time from sys_oper_log - insert into sys_oper_log(title, business_type, method, request_method, operator_type, oper_name, dept_name, oper_url, oper_ip, oper_location, oper_param, json_result, status, error_msg, oper_time) - values (#{title}, #{businessType}, #{method}, #{requestMethod}, #{operatorType}, #{operName}, #{deptName}, #{operUrl}, #{operIp}, #{operLocation}, #{operParam}, #{jsonResult}, #{status}, #{errorMsg}, sysdate()) + insert into sys_oper_log(title, business_type, method, request_method, operator_type, oper_name, dept_name, oper_url, oper_ip, oper_location, oper_param, json_result, status, error_msg, cost_time, oper_time) + values (#{title}, #{businessType}, #{method}, #{requestMethod}, #{operatorType}, #{operName}, #{deptName}, #{operUrl}, #{operIp}, #{operLocation}, #{operParam}, #{jsonResult}, #{status}, #{errorMsg}, #{costTime}, sysdate()) diff --git a/src/main/resources/mybatis/system/ConfigMapper.xml b/src/main/resources/mybatis/system/ConfigMapper.xml index 5973cdb89..d8efd52af 100644 --- a/src/main/resources/mybatis/system/ConfigMapper.xml +++ b/src/main/resources/mybatis/system/ConfigMapper.xml @@ -51,14 +51,19 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" AND config_key like concat('%', #{configKey}, '%') - and date_format(create_time,'%y%m%d') >= date_format(#{params.beginTime},'%y%m%d') + and date_format(create_time,'%Y%m%d') >= date_format(#{params.beginTime},'%Y%m%d') - and date_format(create_time,'%y%m%d') <= date_format(#{params.endTime},'%y%m%d') + and date_format(create_time,'%Y%m%d') <= date_format(#{params.endTime},'%Y%m%d') + + - where status = '0' and dict_type = #{dictType} order by dict_sort asc diff --git a/src/main/resources/mybatis/system/DictTypeMapper.xml b/src/main/resources/mybatis/system/DictTypeMapper.xml index ca4c867e7..b7d987285 100644 --- a/src/main/resources/mybatis/system/DictTypeMapper.xml +++ b/src/main/resources/mybatis/system/DictTypeMapper.xml @@ -33,10 +33,10 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" AND dict_type like concat('%', #{dictType}, '%') - and date_format(create_time,'%y%m%d') >= date_format(#{params.beginTime},'%y%m%d') + and date_format(create_time,'%Y%m%d') >= date_format(#{params.beginTime},'%Y%m%d') - and date_format(create_time,'%y%m%d') <= date_format(#{params.endTime},'%y%m%d') + and date_format(create_time,'%Y%m%d') <= date_format(#{params.endTime},'%Y%m%d') diff --git a/src/main/resources/mybatis/system/NoticeMapper.xml b/src/main/resources/mybatis/system/NoticeMapper.xml index a8b00e25f..627432887 100644 --- a/src/main/resources/mybatis/system/NoticeMapper.xml +++ b/src/main/resources/mybatis/system/NoticeMapper.xml @@ -18,7 +18,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" - select notice_id, notice_title, notice_type, notice_content, status, create_by, create_time, update_by, update_time, remark + select notice_id, notice_title, notice_type, cast(notice_content as char) as notice_content, status, create_by, create_time, update_by, update_time, remark from sys_notice diff --git a/src/main/resources/mybatis/system/RoleMapper.xml b/src/main/resources/mybatis/system/RoleMapper.xml index 1891e0d2f..7c1676266 100644 --- a/src/main/resources/mybatis/system/RoleMapper.xml +++ b/src/main/resources/mybatis/system/RoleMapper.xml @@ -52,10 +52,10 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" AND r.data_scope = #{dataScope} - and date_format(r.create_time,'%y%m%d') >= date_format(#{params.beginTime},'%y%m%d') + and date_format(r.create_time,'%Y%m%d') >= date_format(#{params.beginTime},'%Y%m%d') - and date_format(r.create_time,'%y%m%d') <= date_format(#{params.endTime},'%y%m%d') + and date_format(r.create_time,'%Y%m%d') <= date_format(#{params.endTime},'%Y%m%d') ${params.dataScope} diff --git a/src/main/resources/mybatis/system/UserMapper.xml b/src/main/resources/mybatis/system/UserMapper.xml index c7f752cf9..b60373aca 100644 --- a/src/main/resources/mybatis/system/UserMapper.xml +++ b/src/main/resources/mybatis/system/UserMapper.xml @@ -26,8 +26,8 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" - - + + @@ -50,7 +50,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" - select u.user_id, u.dept_id, u.login_name, u.user_name, u.user_type, u.email, u.avatar, u.phonenumber, u.sex, u.password, u.salt, u.status, u.del_flag, u.login_ip, u.login_date, u.pwd_update_date, u.create_time, u.remark, + select u.user_id, u.dept_id, u.login_name, u.user_name, u.user_type, u.email, u.avatar, u.phonenumber, u.sex, u.password, u.salt, u.status, u.del_flag, u.login_ip, u.login_date, u.pwd_update_date, u.create_by, u.create_time, u.update_by, u.update_time, u.remark, d.dept_id, d.parent_id, d.ancestors, d.dept_name, d.order_num, d.leader, d.status as dept_status, r.role_id, r.role_name, r.role_key, r.role_sort, r.data_scope, r.status as role_status from sys_user u @@ -76,10 +76,10 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" AND u.phonenumber like concat('%', #{phonenumber}, '%') - AND date_format(u.create_time,'%y%m%d') >= date_format(#{params.beginTime},'%y%m%d') + AND date_format(u.create_time,'%Y%m%d') >= date_format(#{params.beginTime},'%Y%m%d') - AND date_format(u.create_time,'%y%m%d') <= date_format(#{params.endTime},'%y%m%d') + AND date_format(u.create_time,'%Y%m%d') <= date_format(#{params.endTime},'%Y%m%d') AND (u.dept_id = #{deptId} OR u.dept_id IN ( SELECT t.dept_id FROM sys_dept t WHERE FIND_IN_SET (#{deptId},ancestors) )) @@ -138,8 +138,8 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" where u.email = #{email} and u.del_flag = '0' - + select user_id, login_name from sys_user where login_name=#{loginName} and del_flag = '0' limit 1 @@ -66,13 +67,19 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" AND lower(table_comment) like lower(concat('%', #{tableComment}, '%')) + + and date_format(create_time,'%Y%m%d') >= date_format(#{params.beginTime},'%Y%m%d') + + + and date_format(create_time,'%Y%m%d') <= date_format(#{params.endTime},'%Y%m%d') + select table_name, table_comment, create_time, update_time from information_schema.tables - where table_name NOT LIKE 'qrtz_%' and table_name NOT LIKE 'gen_%' and table_schema = (select database()) + where table_name NOT LIKE 'qrtz\_%' and table_name NOT LIKE 'gen\_%' and table_schema = (select database()) and table_name in #{name} @@ -99,7 +106,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" \n',modalMain:o,modal:s,descriptionClose:'',progress:'
\n
\n {status}\n
\n
{stats}',stats:'
{pendingTime} {uploadSpeed}
',size:" ({sizeText})",footer:'',indicator:'
{indicator}
',actions:'
\n \n
\n{drag}\n
',actionDelete:'\n',actionUpload:'',actionDownload:'{downloadIcon}',actionZoom:'',actionDrag:'{dragIcon}',btnDefault:'',btnLink:'{icon} {label}',btnBrowse:'
{icon} {label}
',zoomCache:'
{zoomContent}
'},previewMarkupTags:{tagBefore1:'
\n',tagBefore2:'
\n',tagAfter:"
{footer}\n{zoomCache}
\n"},previewContentTemplates:{generic:"{content}\n",html:d,image:p,text:c,office:f,gdocs:g,video:m,audio:h,flash:v,object:n,pdf:u,other:w},allowedPreviewTypes:["image","html","text","video","audio","flash","pdf","object"],previewTemplates:{},previewSettings:{image:{width:"auto",height:"auto","max-width":"100%","max-height":"100%"},html:{width:"213px",height:"160px"},text:{width:"213px",height:"160px"},office:{width:"213px",height:"160px"},gdocs:{width:"213px",height:"160px"},video:{width:"213px",height:"160px"},audio:{width:"100%",height:"30px"},flash:{width:"213px",height:"160px"},object:{width:"213px",height:"160px"},pdf:{width:"100%",height:"160px",position:"relative"},other:{width:"213px",height:"160px"}},previewSettingsSmall:{image:{width:"auto",height:"auto","max-width":"100%","max-height":"100%"},html:{width:"100%",height:"160px"},text:{width:"100%",height:"160px"},office:{width:"100%",height:"160px"},gdocs:{width:"100%",height:"160px"},video:{width:"100%",height:"auto"},audio:{width:"100%",height:"30px"},flash:{width:"100%",height:"auto"},object:{width:"100%",height:"auto"},pdf:{width:"100%",height:"160px"},other:{width:"100%",height:"160px"}},previewZoomSettings:{image:{width:"auto",height:"auto","max-width":"100%","max-height":"100%"},html:e,text:e,office:{width:"100%",height:"100%","max-width":"100%","min-height":"480px"},gdocs:{width:"100%",height:"100%","max-width":"100%","min-height":"480px"},video:{width:"auto",height:"100%","max-width":"100%"},audio:{width:"100%",height:"30px"},flash:{width:"auto",height:"480px"},object:{width:"auto",height:"100%","max-width":"100%","min-height":"480px"},pdf:e,other:{width:"auto",height:"100%","min-height":"480px"}},mimeTypeAliases:{"video/quicktime":"video/mp4"},fileTypeSettings:{image:function(e,t){return N.compare(e,"image.*")&&!N.compare(e,/(tiff?|wmf)$/i)||N.compare(t,/\.(gif|png|jpe?g)$/i)},html:function(e,t){return N.compare(e,"text/html")||N.compare(t,/\.(htm|html)$/i)},office:function(e,t){return N.compare(e,/(word|excel|powerpoint|office)$/i)||N.compare(t,/\.(docx?|xlsx?|pptx?|pps|potx?)$/i)},gdocs:function(e,t){return N.compare(e,/(word|excel|powerpoint|office|iwork-pages|tiff?)$/i)||N.compare(t,/\.(docx?|xlsx?|pptx?|pps|potx?|rtf|ods|odt|pages|ai|dxf|ttf|tiff?|wmf|e?ps)$/i)},text:function(e,t){return N.compare(e,"text.*")||N.compare(t,/\.(xml|javascript)$/i)||N.compare(t,/\.(txt|md|nfo|ini|json|php|js|css)$/i)},video:function(e,t){return N.compare(e,"video.*")&&(N.compare(e,/(ogg|mp4|mp?g|mov|webm|3gp)$/i)||N.compare(t,/\.(og?|mp4|webm|mp?g|mov|3gp)$/i))},audio:function(e,t){return N.compare(e,"audio.*")&&(N.compare(t,/(ogg|mp3|mp?g|wav)$/i)||N.compare(t,/\.(og?|mp3|mp?g|wav)$/i))},flash:function(e,t){return N.compare(e,"application/x-shockwave-flash",!0)||N.compare(t,/\.(swf)$/i)},pdf:function(e,t){return N.compare(e,"application/pdf",!0)||N.compare(t,/\.(pdf)$/i)},object:function(){return!0},other:function(){return!0}},fileActionSettings:{showRemove:!0,showUpload:!0,showDownload:!0,showZoom:!0,showDrag:!0,removeIcon:'',removeClass:t,removeErrorClass:"btn btn-sm btn-kv btn-danger",removeTitle:"Remove file",uploadIcon:'',uploadClass:t,uploadTitle:"Upload file",uploadRetryIcon:'',uploadRetryTitle:"Retry upload",downloadIcon:'',downloadClass:t,downloadTitle:"Download file",zoomIcon:'',zoomClass:t,zoomTitle:"View Details",dragIcon:'',dragClass:"text-primary",dragTitle:"Move / Rearrange",dragSettings:{},indicatorNew:'',indicatorSuccess:'',indicatorError:'',indicatorLoading:'',indicatorPaused:'',indicatorNewTitle:"Not uploaded yet",indicatorSuccessTitle:"Uploaded",indicatorErrorTitle:"Upload Error",indicatorLoadingTitle:"Uploading …",indicatorPausedTitle:"Upload Paused"}},L.each(i.defaults,function(e,t){"allowedPreviewTypes"!==e?i[e]=L.extend(!0,{},t,i[e]):void 0===i.allowedPreviewTypes&&(i.allowedPreviewTypes=t)}),i._initPreviewTemplates()},_initPreviewTemplates:function(){var i,a=this,r=a.previewMarkupTags,n=r.tagAfter;L.each(a.previewContentTemplates,function(e,t){N.isEmpty(a.previewTemplates[e])&&(i=r.tagBefore2,"generic"!==e&&"image"!==e||(i=r.tagBefore1),a._isPdfRendered()&&"pdf"===e&&(i=i.replace("kv-file-content","kv-file-content kv-pdf-rendered")),a.previewTemplates[e]=i+t+n)})},_initPreviewCache:function(){var f=this;f.previewCache={data:{},init:function(){var e=f.initialPreview;0'+e+"":"
  • "+e+"
  • ";return 0===r.find("ul").length?a._addError("
      "+i+"
    "):r.find("ul").append(i),r.fadeIn(a.fadeDelay),a._raise(n,[t,e]),a._setValidationError("file-input-new"),!0},_showError:function(e,t,i){var a=this,r=a.$errorContainer,i=i||"fileerror";return(t=t||{}).reader=a.reader,a._addError(e),r.fadeIn(a.fadeDelay),a._raise(i,[t,e]),a.isAjaxUpload||a._clearFileInput(),a._setValidationError("file-input-new"),a.$btnUpload.attr("disabled",!0),!0},_noFilesError:function(e){var t=this,i=1"+a+"";0===i.find("ul").length?t._addError("
      "+a+"
    "):i.find("ul").append(a),t.isError=!0,t._updateFileDetails(0),i.fadeIn(t.fadeDelay),t._raise("fileerror",[e,a]),t._clearFileInput(),t._setValidationError()},_parseError:function(e,t,i,a){var r=this,n=L.trim(i+""),i=t.responseJSON&&t.responseJSON.error?t.responseJSON.error.toString():"",t=i||t.responseText;return r.cancelling&&r.msgUploadAborted&&(n=r.msgUploadAborted),r.showAjaxErrorDetails&&t&&(i?n=L.trim(i+""):(i=(t=L.trim(t.replace(/\n\s*\n/g,"\n"))).length?"
    "+t+"
    ":"",n+=n?i:t)),n=n||r.msgAjaxError.replace("{operation}",e),r.cancelling=!1,a?""+a+": "+n:n},_parseFileType:function(e,t){var i,a,r=this.allowedPreviewTypes||[];if("application/text-plain"===e)return"text";for(a=0;a.kv-file-content img"),t=r._getZoom(t," >.kv-file-content img"),o?e.css("image-orientation",r.autoOrientImageInitial?"from-image":"none"):r.setImageOrientation(e,t,a.exif.Orientation,i)),n++})},_initPreview:function(e){var t,i=this,a=i.initialCaption||"";if(!i.previewCache.count(!0))return i._clearPreview(),void(e?i._setCaption(a):i._initCaption());t=i.previewCache.out(),a=e&&i.initialCaption?i.initialCaption:t.caption,i._setPreviewContent(t.content),i._setInitThumbAttr(),i._setCaption(a),i._initSortable(),N.isEmpty(t.content)||i.$container.removeClass("file-input-new"),i._initPreviewImageOrientations()},_getZoomButton:function(e){var t=this.previewZoomButtonIcons[e],i=this.previewZoomButtonClasses[e],a=' title="'+(this.previewZoomButtonTitles[e]||"")+'" ',r=N.isBs(5)?"bs-":"",r=a+("close"===e?" data-"+r+'dismiss="modal" aria-hidden="true"':"");return"fullscreen"!==e&&"borderless"!==e&&"toggleheader"!==e||(r+=' data-toggle="button" aria-pressed="false" autocomplete="off"'),'"},_getModalContent:function(){var e=this;return e._getLayoutTemplate("modal").setTokens({rtl:e.rtl?" kv-rtl":"",zoomFrameClass:e.frameClass,prev:e._getZoomButton("prev"),next:e._getZoomButton("next"),toggleheader:e._getZoomButton("toggleheader"),fullscreen:e._getZoomButton("fullscreen"),borderless:e._getZoomButton("borderless"),close:e._getZoomButton("close")})},_listenModalEvent:function(a){var r=this,n=r.$modal;n.on(a+".bs.modal",function(e){var t,i;"bs.modal"===e.namespace&&(t=n.find(".btn-fullscreen"),i=n.find(".btn-borderless"),n.data("fileinputPluginId")===r.$element.attr("id")&&r._raise("filezoom"+a,{sourceEvent:e,previewId:n.data("previewId"),modal:n}),"shown"===a&&(i.removeClass("active").attr("aria-pressed","false"),t.removeClass("active").attr("aria-pressed","false"),n.hasClass("file-zoom-fullscreen")&&(r._maximizeZoomDialog(),(N.checkFullScreen()?t:i).addClass("active").attr("aria-pressed","true"))))})},_initZoom:function(){var i=this,e=i._getLayoutTemplate("modalMain"),t="#"+N.MODAL_ID,e=i._setTabIndex("modal",e);i.showPreview&&(i.$modal=L(t),i.$modal&&i.$modal.length||(e=N.createElement(N.cspBuffer.stash(e)).insertAfter(i.$container),i.$modal=L(t).insertBefore(e),N.cspBuffer.apply(i.$modal),e.remove()),N.initModal(i.$modal),i.$modal.html(N.cspBuffer.stash(i._getModalContent())),N.cspBuffer.apply(i.$modal),L.each(N.MODAL_EVENTS,function(e,t){i._listenModalEvent(t)}))},_initZoomButtons:function(){var e,t=this,i=t.$modal.data("previewId")||"",a=t.getFrames().toArray(),r=a.length,n=t.$modal.find(".btn-kv-prev"),o=t.$modal.find(".btn-kv-next");if(a.length<2)return n.hide(),void o.hide();n.show(),o.show(),r&&(e=L(a[0]),r=L(a[r-1]),n.removeAttr("disabled"),o.removeAttr("disabled"),t.reversePreviewOrder&&([n,o]=[o,n]),e.length&&e.attr("id")===i&&n.attr("disabled",!0),r.length&&r.attr("id")===i&&o.attr("disabled",!0))},_maximizeZoomDialog:function(){var e=this.$modal,t=e.find(".modal-header:visible"),i=e.find(".modal-footer:visible"),a=e.find(".kv-zoom-body"),r=L(window).height();e.addClass("file-zoom-fullscreen"),t&&t.length&&(r-=t.outerHeight(!0)),i&&i.length&&(r-=i.outerHeight(!0)),a&&a.length&&(r-=a.outerHeight(!0)-a.height()),e.find(".kv-zoom-body").height(r)},_resizeZoomDialog:function(e){var t=this,i=t.$modal,a=i.find(".btn-kv-fullscreen"),r=i.find(".btn-kv-borderless");if(i.hasClass("file-zoom-fullscreen"))N.toggleFullScreen(!1),e?a.hasClass("active")||(i.removeClass("file-zoom-fullscreen"),t._resizeZoomDialog(!0),r.hasClass("active")&&r.removeClass("active").attr("aria-pressed","false")):a.hasClass("active")?a.removeClass("active").attr("aria-pressed","false"):(i.removeClass("file-zoom-fullscreen"),t.$modal.find(".kv-zoom-body").css("height",t.zoomModalHeight));else{if(!e)return void t._maximizeZoomDialog();N.toggleFullScreen(!0)}i.focus()},_setZoomContent:function(e,t){var i,a,r,n,o,s=this,l=e.attr("id"),d=s._getZoom(l),c=s.$modal,u=c.find(".btn-kv-fullscreen"),p=c.find(".btn-kv-borderless"),f=c.find(".btn-kv-toggleheader"),g=e.data("zoom");g&&(g=decodeURIComponent(g),o=d.html().replace(N.ZOOM_VAR,"").setTokens({zoomData:g}),d.html(o),e.data("zoom",""),d.attr("data-zoom",g)),n=d.attr("data-template")||"generic",g=(o=d.find(".kv-file-content")).length?'\n'+o.html():"",d=e.data("caption")||s.msgZoomModalHeading,o=e.data("size")||"",e=e.data("description")||"",c.find(".kv-zoom-caption").attr("title",d).html(d),c.find(".kv-zoom-size").html(o),o=c.find(".kv-zoom-description").hide(),e&&(s.showDescriptionClose&&(e=s._getLayoutTemplate("descriptionClose").setTokens({closeIcon:s.previewZoomButtonIcons.close})+""+e),o.show().html(e),s.showDescriptionClose&&s._handler(c.find(".kv-desc-hide"),"click",function(){L(this).parent().fadeOut("fast",function(){c.focus()})})),i=c.find(".kv-zoom-body"),c.removeClass("kv-single-content"),t?(r=i.addClass("file-thumb-loading").clone().insertAfter(i),N.setHtml(i,g).hide(),r.fadeOut("fast",function(){i.fadeIn("fast",function(){i.removeClass("file-thumb-loading")}),r.remove()})):N.setHtml(i,g),(n=s.previewZoomSettings[n])&&(a=i.find(".kv-preview-data"),N.addCss(a,"file-zoom-detail"),L.each(n,function(e,t){a.css(e,t),(a.attr("width")&&"width"===e||a.attr("height")&&"height"===e)&&a.removeAttr(e)})),c.data("previewId",l),s._handler(c.find(".btn-kv-prev"),"click",function(){s._zoomSlideShow("prev",l)}),s._handler(c.find(".btn-kv-next"),"click",function(){s._zoomSlideShow("next",l)}),s._handler(u,"click",function(){s._resizeZoomDialog(!0)}),s._handler(p,"click",function(){s._resizeZoomDialog(!1)}),s._handler(f,"click",function(){function e(e){var t=s.$modal.find(".kv-zoom-body"),i=s.zoomModalHeight;c.hasClass("file-zoom-fullscreen")&&(i=t.outerHeight(!0),e||(i-=a.outerHeight(!0))),t.css("height",e?i+e:i)}var t,a=c.find(".modal-header"),i=c.find(".floating-buttons"),r=a.find(".kv-zoom-actions");a.is(":visible")?(t=a.outerHeight(!0),a.slideUp("slow",function(){r.find(".btn").appendTo(i),e(t)})):(i.find(".btn").appendTo(r),a.slideDown("slow",function(){e()})),c.focus()}),s._handler(c,"keydown",function(e){var t,a=e.which||e.keyCode,r=s.processDelay+1,i=L(this).find(".btn-kv-prev"),n=L(this).find(".btn-kv-next"),o=L(this).data("previewId");[t,e]=s.rtl?[39,37]:[37,39],L.each({prev:[i,t],next:[n,e]},function(e,t){var i=t[0],t=t[1];a===t&&i.length&&(c.focus(),i.attr("disabled")||(i.focus(),s._zoomSlideShow(e,o),setTimeout(function(){i.attr("disabled")&&c.focus()},r)))})})},_showModal:function(e){var t=this.$modal;e&&e.length&&(N.initModal(t),N.setHtml(t,this._getModalContent()),this._setZoomContent(e),t.data({backdrop:!1}),t.modal("show"),this._initZoomButtons())},_zoomPreview:function(e){if(!e.length)throw"Cannot zoom to detailed preview!";e=e.closest(N.FRAMES),this._showModal(e)},_zoomSlideShow:function(e,t){var i,a,r,n=this,o=n.$modal.find(".kv-zoom-actions .btn-kv-"+e),s=n.getFrames().toArray(),l=[],d=s.length;if(n.reversePreviewOrder&&(e="prev"===e?"next":"prev"),!o.attr("disabled")){for(i=0;i'+e.defaultPreviewContent+"
    "),e.$container.removeClass("file-input-new"),e._initClickable())},_resetPreviewThumbs:function(e){var t=this;if(e)return t._clearPreview(),void t.clearFileStack();t._hasInitialPreview()?(e=t.previewCache.out(),t._setPreviewContent(e.content),t._setInitThumbAttr(),t._setCaption(e.caption),t._initPreviewActions()):t._clearPreview()},_getLayoutTemplate:function(e){e=this.layoutTemplates[e];return N.isEmpty(this.customLayoutTags)?e:N.replaceTags(e,this.customLayoutTags)},_getPreviewTemplate:function(e){var t=this.previewTemplates,t=t[e]||t.other;return N.isEmpty(this.customPreviewTags)?t:N.replaceTags(t,this.customPreviewTags)},_getOutData:function(e,t,i,a){var r=this;return t=t||{},i=i||{},{formdata:e,files:a=a||r.fileManager.list(),filenames:r.filenames,filescount:r.getFilesCount(),extra:r._getExtraData(),response:i,reader:r.reader,jqXHR:t}},_getMsgSelected:function(e,t){var i=this,a=1===e?i.fileSingle:i.filePlural;return 0 .file-preview-frame");e&&e.length&&e.insertBefore(t).fadeIn("slow").css("display:inline-block"),l._initPreviewActions(),l._clearFileInput(),t.remove(),a.remove(),l._initSortable()})):(l.previewCache.set(r,n,o,e),l._initPreview(),l._initPreviewActions())),l._resetCaption()},_getUploadCacheIndex:function(e){for(var t=this.uploadCache.length,i=0;i&"']/g,"_")},_updateFileDetails:function(e){var t=this,i=t.$element,a=N.isIE(9)&&N.findFileName(i.val())||i[0].files[0]&&i[0].files[0].name,r=!a&&0'+a+"
    "),t.$container.removeClass("file-input-new"),N.addCss(t.$container,"file-input-ajax-new"))},_getStats:function(e){var t,i;return this.showUploadStats&&e&&e.bitrate?(i=this._getLayoutTemplate("stats"),t=e.elapsed&&e.bps?this.msgPendingTime.setTokens({time:N.getElapsed(Math.ceil(e.pendingBytes/e.bps))}):this.msgCalculatingTime,i.setTokens({uploadSpeed:e.bitrate,pendingTime:t})):""},_setResumableProgress:function(e,t,i){var a=this.resumableManager,a=i?a:this,i=i?i.find(".file-thumb-progress"):null;0===a.lastProgress&&(a.lastProgress=e),eo*a.bytesToKB&&a._getResizedImage(e,t,r,n),t.validated=!0)}))},_getResizedImage:function(e,t,i,a){var r,n,o=this,s=L(t.img)[0],l=s.naturalWidth,d=s.naturalHeight,c=1,u=o.maxImageWidth||l,p=o.maxImageHeight||d,f=!(!l||!d),g=o.imageCanvas,m=o.imageCanvasContext,h=t.typ,v=t.pid,w=t.ind,b=t.thumb,_=t.exifObj,C=function(e,t,i){o.isAjaxUpload?o._showFileError(e,t,i):o._showError(e,t,i),o._setPreviewError(b)},t=o.fileManager.getFile(e),y={id:v,index:w,fileId:e},x=[e,v,w];if(t&&f&&!(l<=u&&d<=p)||(f&&t&&o._raise("fileimageresized",x),i.val++,i.val===a&&o._raise("fileimagesresized"),f)){h=h||o.resizeDefaultImageType,t=u"+n.msgValidationError+"").text(),r=(a=n.fileManager.count())?(r=n.fileManager.getFirstFile(),1===a&&r?r.nameFmt:n._getMsgSelected(a)):n._getMsgSelected(n.msgNo),a=N.isEmpty(e)?r:e,r=''+n.msgValidationErrorIcon+"";else{if(N.isEmpty(e))return void n.$caption.attr("title","");a=i=L("
    "+e+"
    ").text(),r=n._getLayoutTemplate("fileIcon")}n.$captionContainer.addClass("icon-visible"),n.$caption.attr("title",i).val(a),N.setHtml(n.$captionIcon,r)}},_createContainer:function(){var e=this,t={class:"file-input file-input-new"+(e.rtl?" kv-rtl":"")},i=N.createElement(N.cspBuffer.stash(e._renderMain()));return N.cspBuffer.apply(i),i.insertBefore(e.$element).attr(t),e._initBrowse(i),e.theme&&i.addClass("theme-"+e.theme),i},_refreshContainer:function(){var e=this,t=e.$container;e.$element.insertAfter(t),N.setHtml(t,e._renderMain()),e._initBrowse(t),e._validateDisabled()},_validateDisabled:function(){this.$caption.attr({readonly:this.isDisabled})},_setTabIndex:function(e,t){e=this.tabIndexConfig[e];return t.setTokens({tabIndexConfig:null==e?"":'tabindex="'+e+'"'})},_renderMain:function(){var e=this,t=e.dropZoneEnabled?" file-drop-zone":"file-drop-disabled",i=e.showClose?e._getLayoutTemplate("close"):"",a=e.showPreview?e._getLayoutTemplate("preview").setTokens({class:e.previewClass,dropClass:t}):"",t=e.isDisabled?e.captionClass+" file-caption-disabled":e.captionClass,t=e.captionTemplate.setTokens({class:t+" kv-fileinput-caption"}),t=e._setTabIndex("caption",t);return e.mainTemplate.setTokens({class:e.mainClass+(!e.showBrowse&&e.showCaption?" no-browse":""),inputGroupClass:e.inputGroupClass,preview:a,close:i,caption:t,upload:e._renderButton("upload"),remove:e._renderButton("remove"),cancel:e._renderButton("cancel"),pause:e._renderButton("pause"),browse:e._renderButton("browse")})},_renderButton:function(e){var t=this,i=t._getLayoutTemplate("btnDefault"),a=t[e+"Class"],r=t[e+"Title"],n=t[e+"Icon"],o=t[e+"Label"],s=t.isDisabled?" disabled":"",l="button";switch(e){case"remove":if(!t.showRemove)return"";break;case"cancel":if(!t.showCancel)return"";a+=" kv-hidden";break;case"pause":if(!t.showPause)return"";a+=" kv-hidden";break;case"upload":if(!t.showUpload)return"";t.isAjaxUpload&&!t.isDisabled?i=t._getLayoutTemplate("btnLink").replace("{href}",t.uploadUrl):l="submit";break;case"browse":if(!t.showBrowse)return"";i=t._getLayoutTemplate("btnBrowse");break;default:return""}return i=t._setTabIndex(e,i),a+="browse"===e?" btn-file":" fileinput-"+e+" fileinput-"+e+"-button",N.isEmpty(o)||(o=' '+o+""),i.setTokens({type:l,css:a,title:r,status:s,icon:n,label:o})},_renderThumbProgress:function(){return'
    '+this.progressInfoTemplate.setTokens({percent:101,status:this.msgUploadBegin,stats:""})+"
    "},_renderFileFooter:function(e,t,i,a,r){var n=this,o=n.fileActionSettings,s=o.showRemove,l=o.showDrag,d=o.showUpload,c=o.showZoom,u=n._getLayoutTemplate("footer"),p=n._getLayoutTemplate("indicator"),f=r?o.indicatorError:o.indicatorNew,o=r?o.indicatorErrorTitle:o.indicatorNewTitle,o=p.setTokens({indicator:f,indicatorTitle:o}),o={type:e,caption:t,size:i=n._getSize(i),width:a,progress:"",indicator:o};return n.isAjaxUpload?(o.progress=n._renderThumbProgress(),o.actions=n._renderFileActions(o,d,!1,s,c,l,!1,!1,!1)):o.actions=n._renderFileActions(o,!1,!1,!1,c,l,!1,!1,!1),o=u.setTokens(o),o=N.replaceTags(o,n.previewThumbTags)},_renderFileActions:function(e,t,i,a,r,n,o,s,l,d,c,u){var p=this;if(!e.type&&d&&(e.type="image"),p.enableResumableUpload?t=!1:"function"==typeof t&&(t=t(e)),"function"==typeof i&&(i=i(e)),"function"==typeof a&&(a=a(e)),"function"==typeof r&&(r=r(e)),"function"==typeof n&&(n=n(e)),!(t||i||a||r||n))return"";var f=!1===s?"":' data-url="'+s+'"',g="",m="",h=!1===l?"":' data-key="'+l+'"',v="",w="",b="",_=p._getLayoutTemplate("actions"),e=p.fileActionSettings,s=p.otherActionButtons.setTokens({dataKey:h,key:l}),o=o?e.removeClass+" disabled":e.removeClass;return a&&(v=p._getLayoutTemplate("actionDelete").setTokens({removeClass:o,removeIcon:e.removeIcon,removeTitle:e.removeTitle,dataUrl:f,dataKey:h,key:l})),t&&(w=p._getLayoutTemplate("actionUpload").setTokens({uploadClass:e.uploadClass,uploadIcon:e.uploadIcon,uploadTitle:e.uploadTitle})),i&&(b=(b=p._getLayoutTemplate("actionDownload").setTokens({downloadClass:e.downloadClass,downloadIcon:e.downloadIcon,downloadTitle:e.downloadTitle,downloadUrl:c||p.initialPreviewDownloadUrl})).setTokens({filename:u,key:l})),r&&(g=p._getLayoutTemplate("actionZoom").setTokens({zoomClass:e.zoomClass,zoomIcon:e.zoomIcon,zoomTitle:e.zoomTitle})),n&&d&&(d="drag-handle-init "+e.dragClass,m=p._getLayoutTemplate("actionDrag").setTokens({dragClass:d,dragTitle:e.dragTitle,dragIcon:e.dragIcon})),_.setTokens({delete:v,upload:w,download:b,zoom:g,drag:m,other:s})},_browse:function(e){var t=this;e&&e.isDefaultPrevented()||!t._raise("filebrowse")||(t.isError&&!t.isAjaxUpload&&t.clear(),t.focusCaptionOnBrowse&&t.$captionContainer.focus())},_change:function(e){var n=this;if(L(document.body).off("focusin.fileinput focusout.fileinput"),!n.changeTriggered){n._setLoading("show");var t=n.$element,i=1
  • ")+"
  • ",0===e.find("ul").length?N.setHtml(e,S.errorCloseButton+"
      "+x+"
    "):e.find("ul").append(x),e.fadeIn(S.fadeDelay),S._handler(e.find(".kv-error-close"),"click",function(){e.fadeOut(S.fadeDelay)}),S.duplicateErrors=[]),S.isAjaxUpload?(S._raise("filebatchselected",[i.stack]),0!==i.count()||S.isError||S.reset()):S._raise("filebatchselected",[P]),I.removeClass("file-thumb-loading"),S._initCapStatus("valid"),void A.html("");S.lock(!0);function c(){var e=!!i.loadedImages[s],t=D.setTokens({index:d+1,files:j,percent:50,name:m});setTimeout(function(){A.html(t),S._updateFileDetails(j),k(d+1)},S.processDelay),S._raise("fileloaded",[f,l,s,d,E])&&S.isAjaxUpload?e||i.add(f):e&&i.removeFile(s)}var t,u,a,r,n,o,p,f=P[d],s=S._getFileId(f),l=U+"-"+s,g=M.image,m=S._getFileName(f,""),h=(f&&f.size||0)/S.bytesToKB,v="",w=N.createObjectURL(f),b=0,_="",C=!1,y=0;if(f){if(r=i.getId(f),0S.maxFileSize)return T=S.msgSizeTooLarge.setTokens({name:m,size:t,maxSize:S.maxFileSize}),void F(T,f,l,d,r);if(null!==S.minFileSize&&h<=N.getNum(S.minFileSize))return T=S.msgSizeTooSmall.setTokens({name:m,size:t,minSize:S.minFileSize}),void F(T,f,l,d,r);if(!N.isEmpty($)&&N.isArray($)){for(u=0;u<$.length;u+=1)o=$[u],b+=(o=M[o])&&"function"==typeof o&&o(f.type,N.getFileName(f))?1:0;if(0===b)return T=S.msgInvalidFileType.setTokens({name:m,types:_}),void F(T,f,l,d,r)}return 0!==b||N.isEmpty(R)||!N.isArray(R)||N.isEmpty(v)||(v=N.compare(m,v),0!==(b+=N.isEmpty(v)?0:v.length))?S._canPreview(f)?(p=g(f.type,m),A.html(z.replace("{index}",d+1).replace("{files}",j)),I.addClass("file-thumb-loading"),S._initCapStatus("processing"),E.onerror=function(e){S._errorHandler(e,m)},E.onload=function(e){var t,i,a,r,n,o,s=[],l={name:m,type:f.type};if(L.each(M,function(e,t){"object"!==e&&"other"!==e&&"function"==typeof t&&t(f.type,m)&&y++}),0===y){for(i=new Uint8Array(e.target.result),u=0;u',next:'',toggleheader:'',fullscreen:'',borderless:'',close:''},previewZoomButtonClasses:{prev:"btn btn-default btn-outline-secondary btn-navigate",next:"btn btn-default btn-outline-secondary btn-navigate",toggleheader:t,fullscreen:t,borderless:t,close:t},previewTemplates:{},previewContentTemplates:{},preferIconicPreview:!1,preferIconicZoomPreview:!1,allowedFileTypes:null,allowedFileExtensions:null,allowedPreviewTypes:void 0,allowedPreviewMimeTypes:null,allowedPreviewExtensions:null,disabledPreviewTypes:void 0,disabledPreviewExtensions:["msi","exe","com","zip","rar","app","vb","scr"],disabledPreviewMimeTypes:null,defaultPreviewContent:null,customLayoutTags:{},customPreviewTags:{},previewFileIcon:'',previewFileIconClass:"file-other-icon",previewFileIconSettings:{},previewFileExtSettings:{},buttonLabelClass:"hidden-xs",browseIcon:' ',browseClass:"btn btn-primary",removeIcon:'',removeClass:i,cancelIcon:'',cancelClass:i,pauseIcon:'',pauseClass:i,uploadIcon:'',uploadClass:i,uploadUrl:null,uploadUrlThumb:null,uploadAsync:!0,uploadParamNames:{chunkCount:"chunkCount",chunkIndex:"chunkIndex",chunkSize:"chunkSize",chunkSizeStart:"chunkSizeStart",chunksUploaded:"chunksUploaded",fileBlob:"fileBlob",fileId:"fileId",fileName:"fileName",fileRelativePath:"fileRelativePath",fileSize:"fileSize",retryCount:"retryCount"},maxAjaxThreads:5,fadeDelay:800,processDelay:100,bitrateUpdateDelay:500,queueDelay:10,progressDelay:0,enableResumableUpload:!1,resumableUploadOptions:{fallback:null,testUrl:null,chunkSize:2048,maxThreads:4,maxRetries:3,showErrorLog:!0,retainErrorHistory:!0,skipErrorsAndProceed:!1},uploadExtraData:{},zoomModalHeight:480,minImageWidth:null,minImageHeight:null,maxImageWidth:null,maxImageHeight:null,resizeImage:!1,resizePreference:"width",resizeQuality:.92,resizeDefaultImageType:"image/jpeg",resizeIfSizeMoreThan:0,minFileSize:-1,maxFileSize:0,maxFilePreviewSize:25600,minFileCount:0,maxFileCount:0,maxTotalFileCount:0,validateInitialCount:!1,msgValidationErrorClass:"text-danger",msgValidationErrorIcon:' ',msgErrorClass:"file-error-message",progressThumbClass:"progress-bar progress-bar-striped active progress-bar-animated",progressClass:"progress-bar bg-success progress-bar-success progress-bar-striped active progress-bar-animated",progressInfoClass:"progress-bar bg-info progress-bar-info progress-bar-striped active progress-bar-animated",progressCompleteClass:"progress-bar bg-success progress-bar-success",progressPauseClass:"progress-bar bg-primary progress-bar-primary progress-bar-striped active progress-bar-animated",progressErrorClass:"progress-bar bg-danger progress-bar-danger",progressUploadThreshold:99,previewFileType:"image",elCaptionContainer:null,elCaptionText:null,elPreviewContainer:null,elPreviewImage:null,elPreviewStatus:null,elErrorContainer:null,errorCloseButton:void 0,slugCallback:null,dropZoneEnabled:!0,dropZoneTitleClass:"file-drop-zone-title",fileActionSettings:{},otherActionButtons:"",textEncoding:"UTF-8",preProcessUpload:null,ajaxSettings:{},ajaxDeleteSettings:{},showAjaxErrorDetails:!0,mergeAjaxCallbacks:!1,mergeAjaxDeleteCallbacks:!1,retryErrorUploads:!0,reversePreviewOrder:!1,usePdfRenderer:function(){var e=!!window.MSInputMethodContext&&!!document.documentMode;return!!navigator.userAgent.match(/(iPod|iPhone|iPad|Android)/i)||e},pdfRendererUrl:"",pdfRendererTemplate:'',tabIndexConfig:{browse:500,remove:500,upload:500,cancel:null,pause:null,modal:-1}},L.fn.fileinputLocales.en={sizeUnits:["B","KB","MB","GB","TB","PB","EB","ZB","YB"],bitRateUnits:["B/s","KB/s","MB/s","GB/s","TB/s","PB/s","EB/s","ZB/s","YB/s"],fileSingle:"file",filePlural:"files",browseLabel:"Browse …",removeLabel:"Remove",removeTitle:"Clear all unprocessed files",cancelLabel:"Cancel",cancelTitle:"Abort ongoing upload",pauseLabel:"Pause",pauseTitle:"Pause ongoing upload",uploadLabel:"Upload",uploadTitle:"Upload selected files",msgNo:"No",msgNoFilesSelected:"No files selected",msgCancelled:"Cancelled",msgPaused:"Paused",msgPlaceholder:"Select {files} ...",msgZoomModalHeading:"Detailed Preview",msgFileRequired:"You must select a file to upload.",msgSizeTooSmall:'File "{name}" ({size} KB) is too small and must be larger than {minSize} KB.',msgSizeTooLarge:'File "{name}" ({size} KB) exceeds maximum allowed upload size of {maxSize} KB.',msgFilesTooLess:"You must select at least {n} {files} to upload.",msgFilesTooMany:"Number of files selected for upload ({n}) exceeds maximum allowed limit of {m}.",msgTotalFilesTooMany:"You can upload a maximum of {m} files ({n} files detected).",msgFileNotFound:'File "{name}" not found!',msgFileSecured:'Security restrictions prevent reading the file "{name}".',msgFileNotReadable:'File "{name}" is not readable.',msgFilePreviewAborted:'File preview aborted for "{name}".',msgFilePreviewError:'An error occurred while reading the file "{name}".',msgInvalidFileName:'Invalid or unsupported characters in file name "{name}".',msgInvalidFileType:'Invalid type for file "{name}". Only "{types}" files are supported.',msgInvalidFileExtension:'Invalid extension for file "{name}". Only "{extensions}" files are supported.',msgFileTypes:{image:"image",html:"HTML",text:"text",video:"video",audio:"audio",flash:"flash",pdf:"PDF",object:"object"},msgUploadAborted:"The file upload was aborted",msgUploadThreshold:"Processing …",msgUploadBegin:"Initializing …",msgUploadEnd:"Done",msgUploadResume:"Resuming upload …",msgUploadEmpty:"No valid data available for upload.",msgUploadError:"Upload Error",msgDeleteError:"Delete Error",msgProgressError:"Error",msgValidationError:"Validation Error",msgLoading:"Loading file {index} of {files} …",msgProgress:"Loading file {index} of {files} - {name} - {percent}% completed.",msgSelected:"{n} {files} selected",msgProcessing:"Processing ...",msgFoldersNotAllowed:"Drag & drop files only! {n} folder(s) dropped were skipped.",msgImageWidthSmall:'Width of image file "{name}" must be at least {size} px.',msgImageHeightSmall:'Height of image file "{name}" must be at least {size} px.',msgImageWidthLarge:'Width of image file "{name}" cannot exceed {size} px.',msgImageHeightLarge:'Height of image file "{name}" cannot exceed {size} px.',msgImageResizeError:"Could not get the image dimensions to resize.",msgImageResizeException:"Error while resizing the image.
    {errors}
    ",msgAjaxError:"Something went wrong with the {operation} operation. Please try again later!",msgAjaxProgressError:"{operation} failed",msgDuplicateFile:'File "{name}" of same size "{size} KB" has already been selected earlier. Skipping duplicate selection.',msgResumableUploadRetriesExceeded:"Upload aborted beyond {max} retries for file {file}! Error Details:
    {error}
    ",msgPendingTime:"{time} remaining",msgCalculatingTime:"calculating time remaining",ajaxOperations:{deleteThumb:"file delete",uploadThumb:"file upload",uploadBatch:"batch file upload",uploadExtra:"form data upload"},dropZoneTitle:"Drag & drop files here …",dropZoneClickTitle:"
    (or click to select {files})",previewZoomButtonTitles:{prev:"View previous file",next:"View next file",toggleheader:"Toggle header",fullscreen:"Toggle full screen",borderless:"Toggle borderless mode",close:"Close detailed preview"}},L.fn.fileinputLocales.zh={sizeUnits:["B","KB","MB","GB","TB","PB","EB","ZB","YB"],bitRateUnits:["B/s","KB/s","MB/s","GB/s","TB/s","PB/s","EB/s","ZB/s","YB/s"],fileSingle:"文件",filePlural:"个文件",browseLabel:"选择 …",removeLabel:"移除",removeTitle:"清除选中文件",cancelLabel:"取消",cancelTitle:"取消进行中的上传",pauseLabel:"暂停",pauseTitle:"暂停上传",uploadLabel:"上传",uploadTitle:"上传选中文件",msgNo:"没有",msgNoFilesSelected:"未选择文件",msgPaused:"已暂停",msgCancelled:"取消",msgPlaceholder:"选择 {files} ...",msgZoomModalHeading:"详细预览",msgFileRequired:"必须选择一个文件上传.",msgSizeTooSmall:'文件 "{name}" ({size} KB) 必须大于限定大小 {minSize} KB.',msgSizeTooLarge:'文件 "{name}" ({size} KB) 超过了允许大小 {maxSize} KB.',msgFilesTooLess:"你必须选择最少 {n} {files} 来上传. ",msgFilesTooMany:"选择的上传文件个数 ({n}) 超出最大文件的限制个数 {m}.",msgTotalFilesTooMany:"你最多可以上传 {m} 个文件 (当前有{n} 个文件).",msgFileNotFound:'文件 "{name}" 未找到!',msgFileSecured:'安全限制,为了防止读取文件 "{name}".',msgFileNotReadable:'文件 "{name}" 不可读.',msgFilePreviewAborted:'取消 "{name}" 的预览.',msgFilePreviewError:'读取 "{name}" 时出现了一个错误.',msgInvalidFileName:'文件名 "{name}" 包含非法字符.',msgInvalidFileType:'不正确的类型 "{name}". 只支持 "{types}" 类型的文件.',msgInvalidFileExtension:'不正确的文件扩展名 "{name}". 只支持 "{extensions}" 的文件扩展名.',msgFileTypes:{image:"image",html:"HTML",text:"text",video:"video",audio:"audio",flash:"flash",pdf:"PDF",object:"object"},msgUploadAborted:"该文件上传被中止",msgUploadThreshold:"处理中 …",msgUploadBegin:"正在初始化 …",msgUploadEnd:"完成",msgUploadResume:"继续上传 …",msgUploadEmpty:"无效的文件上传.",msgUploadError:"上传出错",msgDeleteError:"删除出错",msgProgressError:"上传出错",msgValidationError:"验证错误",msgLoading:"加载第 {index} 文件 共 {files} …",msgProgress:"加载第 {index} 文件 共 {files} - {name} - {percent}% 完成.",msgSelected:"{n} {files} 选中",msgProcessing:"处理中 ...",msgFoldersNotAllowed:"只支持拖拽文件! 跳过 {n} 拖拽的文件夹.",msgImageWidthSmall:'图像文件的"{name}"的宽度必须是至少{size}像素.',msgImageHeightSmall:'图像文件的"{name}"的高度必须至少为{size}像素.',msgImageWidthLarge:'图像文件"{name}"的宽度不能超过{size}像素.',msgImageHeightLarge:'图像文件"{name}"的高度不能超过{size}像素.',msgImageResizeError:"无法获取的图像尺寸调整。",msgImageResizeException:"调整图像大小时发生错误。
    {errors}
    ",msgAjaxError:"{operation} 发生错误. 请重试!",msgAjaxProgressError:"{operation} 失败",msgDuplicateFile:'文件 "{name}",大小 "{size} KB" 已经被选中.忽略相同的文件.',msgResumableUploadRetriesExceeded:"文件 {file} 上传失败超过 {max} 次重试 ! 错误详情:
    {error}
    ",msgPendingTime:"{time} 剩余",msgCalculatingTime:"计算剩余时间",ajaxOperations:{deleteThumb:"删除文件",uploadThumb:"上传文件",uploadBatch:"批量上传",uploadExtra:"表单数据上传"},dropZoneTitle:"拖拽文件到这里 …
    支持多文件同时上传",dropZoneClickTitle:"
    (或点击{files}按钮选择文件)",fileActionSettings:{removeTitle:"删除文件",uploadTitle:"上传文件",downloadTitle:"下载文件",uploadRetryTitle:"重试",zoomTitle:"查看详情",dragTitle:"移动 / 重置",indicatorNewTitle:"没有上传",indicatorSuccessTitle:"上传",indicatorErrorTitle:"上传错误",indicatorPausedTitle:"上传已暂停",indicatorLoadingTitle:"上传 …"},previewZoomButtonTitles:{prev:"预览上一个文件",next:"预览下一个文件",toggleheader:"缩放",fullscreen:"全屏",borderless:"无边界模式",close:"关闭当前预览"}},L.fn.fileinput.Constructor=c,L(document).ready(function(){var e=L("input.file[type=file]");e.length&&e.fileinput()})}); \ No newline at end of file +(function(factory){'use strict';if(typeof define==='function'&&define.amd){define(['jquery'],factory)}else if(typeof module==='object'&&typeof module.exports==='object'){factory(require('jquery'))}else{factory(window.jQuery)}}(function($){'use strict';$.fn.fileinputLocales={};$.fn.fileinputThemes={};if(!$.fn.fileinputBsVersion){$.fn.fileinputBsVersion=(window.bootstrap&&window.bootstrap.Alert&&window.bootstrap.Alert.VERSION)||(window.Alert&&window.Alert.VERSION)||'3.x.x'}String.prototype.setTokens=function(replacePairs){var str=this.toString(),key,re;for(key in replacePairs){if(replacePairs.hasOwnProperty(key)){re=new RegExp('\{'+key+'\}','g');str=str.replace(re,replacePairs[key])}}return str};if(!Array.prototype.flatMap){Array.prototype.flatMap=function(lambda){return[].concat(this.map(lambda))}}var $h,FileInput;$h={FRAMES:'.kv-preview-thumb',SORT_CSS:'file-sortable',INIT_FLAG:'init-',SCRIPT_SRC:document&&document.currentScript&&document.currentScript.src||null,OBJECT_PARAMS:'\n\n\n\n\n\n',DEFAULT_PREVIEW:'
    \n{previewFileIcon}\n
    ',MODAL_ID:'kvFileinputModal',MODAL_EVENTS:['show','shown','hide','hidden','loaded'],logMessages:{ajaxError:'{status}: {error}. Error Details: {text}.',badDroppedFiles:'Error scanning dropped files!',badExifParser:'Error loading the piexif.js library. {details}',badInputType:'The input "type" must be set to "file" for initializing the "bootstrap-fileinput" plugin.',exifWarning:'To avoid this warning, either set "autoOrientImage" to "false" OR ensure you have loaded the "piexif.js" library correctly on your page before the "fileinput.js" script.',invalidChunkSize:'Invalid upload chunk size: "{chunkSize}". Resumable uploads are disabled.',invalidThumb:'Invalid thumb frame with id: "{id}".',noResumableSupport:'The browser does not support resumable or chunk uploads.',noUploadUrl:'The "uploadUrl" is not set. Ajax uploads and resumable uploads have been disabled.',retryStatus:'Retrying upload for chunk # {chunk} for {filename}... retry # {retry}.',chunkQueueError:'Could not push task to ajax pool for chunk index # {index}.',resumableMaxRetriesReached:'Maximum resumable ajax retries ({n}) reached.',resumableRetryError:'Could not retry the resumable request (try # {n})... aborting.',resumableAborting:'Aborting / cancelling the resumable request.',resumableRequestError:'Error processing resumable request. {msg}'},objUrl:window.URL||window.webkitURL,getZoomPlaceholder:function(){var src=$h.SCRIPT_SRC,srcPath,zoomVar='?kvTemp__2873389129__=';if(!src){return zoomVar}srcPath=src.substring(0,src.lastIndexOf("/"));return srcPath.substring(0,srcPath.lastIndexOf("/")+1)+'img/loading.gif'+zoomVar},isBs:function(ver){var chk=$.trim(($.fn.fileinputBsVersion||'')+'');ver=parseInt(ver,10);if(!chk){return ver===4}return ver===parseInt(chk.charAt(0),10)},defaultButtonCss:function(fill){return'btn-default btn-'+(fill?'':'outline-')+'secondary'},now:function(){return new Date().getTime()},round:function(num){num=parseFloat(num);return isNaN(num)?0:Math.floor(Math.round(num))},getArray:function(obj){var i,arr=[],len=obj&&obj.length||0;for(i=0;i0){out+=(out?' ':'')+value+key.substring(0,1)}});return out},debounce:function(func,delay){var inDebounce;return function(){var args=arguments,context=this;clearTimeout(inDebounce);inDebounce=setTimeout(function(){func.apply(context,args)},delay)}},stopEvent:function(e){e.stopPropagation();e.preventDefault()},getFileName:function(file){return file?(file.fileName||file.name||''):''},createObjectURL:function(data){if($h.objUrl&&$h.objUrl.createObjectURL&&data){return $h.objUrl.createObjectURL(data)}return''},revokeObjectURL:function(data){if($h.objUrl&&$h.objUrl.revokeObjectURL&&data){$h.objUrl.revokeObjectURL(data)}},compare:function(input,str,exact){return input!==undefined&&(exact?input===str:input.match(str))},isIE:function(ver){var div,status;if(navigator.appName!=='Microsoft Internet Explorer'){return false}if(ver===10){return new RegExp('msie\\s'+ver,'i').test(navigator.userAgent)}div=document.createElement('div');div.innerHTML='';status=div.getElementsByTagName('i').length;document.body.appendChild(div);div.parentNode.removeChild(div);return status},canOrientImage:function($el){var $img=$(document.createElement('img')).css({width:'1px',height:'1px'}).insertAfter($el),flag=$img.css('image-orientation');$img.remove();return!!flag},canAssignFilesToInput:function(){var input=document.createElement('input');try{input.type='file';input.files=null;return true}catch(err){return false}},getDragDropFolders:function(items){var i,item,len=items?items.length:0,folders=0;if(len>0&&items[0].webkitGetAsEntry()){for(i=0;i=0){byteStr=atob(dataURI.split(',')[1])}else{byteStr=decodeURIComponent(dataURI.split(',')[1])}arrayBuffer=new ArrayBuffer(byteStr.length);intArray=new Uint8Array(arrayBuffer);for(i=0;i>4){case 0:case 1:case 2:case 3:case 4:case 5:case 6:case 7:out+=String.fromCharCode(c);break;case 12:case 13:char2=array[i++];out+=String.fromCharCode(((c&0x1F)<<6)|(char2&0x3F));break;case 14:char2=array[i++];char3=array[i++];out+=String.fromCharCode(((c&0x0F)<<12)|((char2&0x3F)<<6)|((char3&0x3F)<<0));break}}return out},isHtml:function(str){var a=document.createElement('div');a.innerHTML=str;for(var c=a.childNodes,i=c.length;i--;){if(c[i].nodeType===1){return true}}return false},isPdf:function(str){if($h.isEmpty(str)){return false}str=str.toString().trim().replace(/\n/g,' ');if(str.length===0){return false}},isSvg:function(str){if($h.isEmpty(str)){return false}str=str.toString().trim().replace(/\n/g,' ');if(str.length===0){return false}return str.match(/^\s*<\?xml/i)&&(str.match(/'+str+''))},uniqId:function(){return(new Date().getTime()+Math.floor(Math.random()*Math.pow(10,15))).toString(36)},cspBuffer:{CSP_ATTRIB:'data-csp-01928735',domElementsStyles:{},stash:function(htmlString){var self=this,outerDom=$.parseHTML('
    '+htmlString+'
    '),$el=$(outerDom);$el.find('[style]').each(function(key,elem){var $elem=$(elem),styleDeclaration=$elem[0].style,id=$h.uniqId(),styles={};if(styleDeclaration&&styleDeclaration.length){$(styleDeclaration).each(function(){styles[this]=styleDeclaration[this]});self.domElementsStyles[id]=styles;$elem.removeAttr('style').attr(self.CSP_ATTRIB,id)}});$el.filter('*').removeAttr('style');var values=Object.values?Object.values(outerDom):Object.keys(outerDom).map(function(itm){return outerDom[itm]});return values.flatMap(function(elem){return elem.innerHTML}).join('')},apply:function(domElement){var self=this,$el=$(domElement);$el.find('['+self.CSP_ATTRIB+']').each(function(key,elem){var $elem=$(elem),id=$elem.attr(self.CSP_ATTRIB),styles=self.domElementsStyles[id];if(styles){$elem.css(styles)}$elem.removeAttr(self.CSP_ATTRIB)});self.domElementsStyles={}}},setHtml:function($elem,htmlString){var buf=$h.cspBuffer;$elem.html(buf.stash(htmlString));buf.apply($elem);return $elem},htmlEncode:function(str,undefVal){if(str===undefined){return undefVal||null}return str.replace(/&/g,'&').replace(//g,'>').replace(/"/g,'"').replace(/'/g,''')},replaceTags:function(str,tags){var out=str;if(!tags){return out}$.each(tags,function(key,value){if(typeof value==='function'){value=value()}out=out.split(key).join(value)});return out},cleanMemory:function($thumb){var data=$thumb.is('img')?$thumb.attr('src'):$thumb.find('source').attr('src');$h.revokeObjectURL(data)},findFileName:function(filePath){var sepIndex=filePath.lastIndexOf('/');if(sepIndex===-1){sepIndex=filePath.lastIndexOf('\\')}return filePath.split(filePath.substring(sepIndex,sepIndex+1)).pop()},checkFullScreen:function(){return document.fullscreenElement||document.mozFullScreenElement||document.webkitFullscreenElement||document.msFullscreenElement},toggleFullScreen:function(maximize){var doc=document,de=doc.documentElement,isFullScreen=$h.checkFullScreen();if(de&&maximize&&!isFullScreen){if(de.requestFullscreen){de.requestFullscreen()}else{if(de.msRequestFullscreen){de.msRequestFullscreen()}else{if(de.mozRequestFullScreen){de.mozRequestFullScreen()}else{if(de.webkitRequestFullscreen){de.webkitRequestFullscreen(Element.ALLOW_KEYBOARD_INPUT)}}}}}else{if(isFullScreen){if(doc.exitFullscreen){doc.exitFullscreen()}else{if(doc.msExitFullscreen){doc.msExitFullscreen()}else{if(doc.mozCancelFullScreen){doc.mozCancelFullScreen()}else{if(doc.webkitExitFullscreen){doc.webkitExitFullscreen()}}}}}}},moveArray:function(arr,oldIndex,newIndex,reverseOrder){var newArr=$.extend(true,[],arr);if(reverseOrder){newArr.reverse()}if(newIndex>=newArr.length){var k=newIndex-newArr.length;while((k--)+1){newArr.push(undefined)}}newArr.splice(newIndex,0,newArr.splice(oldIndex,1)[0]);if(reverseOrder){newArr.reverse()}return newArr},closeButton:function(css){css=($h.isBs(5)?'btn-close':'close')+(css?' '+css:'');return''},getRotation:function(value){switch(value){case 2:return'rotateY(180deg)';case 3:return'rotate(180deg)';case 4:return'rotate(180deg) rotateY(180deg)';case 5:return'rotate(270deg) rotateY(180deg)';case 6:return'rotate(90deg)';case 7:return'rotate(90deg) rotateY(180deg)';case 8:return'rotate(270deg)';default:return''}},setTransform:function(el,val){if(!el){return}el.style.transform=val;el.style.webkitTransform=val;el.style['-moz-transform']=val;el.style['-ms-transform']=val;el.style['-o-transform']=val},getObjectKeys:function(obj){var keys=[];if(obj){$.each(obj,function(key){keys.push(key)})}return keys},getObjectSize:function(obj){return $h.getObjectKeys(obj).length},whenAll:function(array){var s=[].slice,resolveValues=arguments.length===1&&$h.isArray(array)?array:s.call(arguments),deferred=$.Deferred(),i,failed=0,value,length=resolveValues.length,remaining=length,rejectContexts,rejectValues,resolveContexts,updateFunc;rejectContexts=rejectValues=resolveContexts=Array(length);updateFunc=function(index,contexts,values){return function(){if(values!==resolveValues){failed++}deferred.notifyWith(contexts[index]=this,values[index]=s.call(arguments));if(!(--remaining)){deferred[(!failed?'resolve':'reject')+'With'](contexts,values)}}};for(i=0;i0&&self.maxTotalFileCount10?len-10:Math.ceil(len/2);for(i=len;i>beg;i--){n=parseFloat(fm.bpsLog[i]);j++}fm.bps=(j>0?n/j:0)*64},delay);out={fileId:id,started:started,elapsed:elapsed,loaded:loaded,total:total,bps:fm.bps,bitrate:self._getSize(fm.bps,false,self.bitRateUnits),pendingBytes:pendingBytes};if(id){fm.stats[id]=out}else{fm.stats=out}return out},exists:function(id){return $.inArray(id,self.fileManager.getIdList())!==-1},count:function(){return self.fileManager.getIdList().length},total:function(){var fm=self.fileManager;if(!fm.totalFiles){fm.totalFiles=fm.count()}return fm.totalFiles},getTotalSize:function(){var fm=self.fileManager;if(fm.totalSize){return fm.totalSize}fm.totalSize=0;$.each(self.getFileStack(),function(id,f){var size=parseFloat(f.size);fm.totalSize+=isNaN(size)?0:size});return fm.totalSize},add:function(file,id){if(!id){id=self.fileManager.getId(file)}if(!id){return}self.fileManager.stack[id]={file:file,name:$h.getFileName(file),relativePath:$h.getFileRelativePath(file),size:file.size,nameFmt:self._getFileName(file,''),sizeFmt:self._getSize(file.size)}},remove:function($thumb){var id=self._getThumbFileId($thumb);self.fileManager.removeFile(id)},removeFile:function(id){var fm=self.fileManager;if(!id){return}delete fm.stack[id];delete fm.loadedImages[id]},move:function(idFrom,idTo){var result={},stack=self.fileManager.stack;if(!idFrom&&!idTo||idFrom===idTo){return}$.each(stack,function(k,v){if(k!==idFrom){result[k]=v}if(k===idTo){result[idFrom]=stack[idFrom]}});self.fileManager.stack=result},list:function(){var files=[];$.each(self.getFileStack(),function(k,v){if(v&&v.file){files.push(v.file)}});return files},isPending:function(id){return $.inArray(id,self.fileManager.filesProcessed)===-1&&self.fileManager.exists(id)},isProcessed:function(){var filesProcessed=true,fm=self.fileManager;$.each(self.getFileStack(),function(id){if(fm.isPending(id)){filesProcessed=false}});return filesProcessed},clear:function(){var fm=self.fileManager;self.isDuplicateError=false;self.isPersistentError=false;fm.totalFiles=null;fm.totalSize=null;fm.uploadedSize=0;fm.stack={};fm.errors=[];fm.filesProcessed=[];fm.stats={};fm.bpsLog=[];fm.bps=0;fm.clearImages()},clearImages:function(){self.fileManager.loadedImages={};self.fileManager.totalImages=0},addImage:function(id,config){self.fileManager.loadedImages[id]=config},removeImage:function(id){delete self.fileManager.loadedImages[id]},getImageIdList:function(){return $h.getObjectKeys(self.fileManager.loadedImages)},getImageCount:function(){return self.fileManager.getImageIdList().length},getId:function(file){return self._getFileId(file)},getIndex:function(id){return self.fileManager.getIdList().indexOf(id)},getThumb:function(id){var $thumb=null;self._getThumbs().each(function(){var $t=$(this);if(self._getThumbFileId($t)===id){$thumb=$t}});return $thumb},getThumbIndex:function($thumb){var id=self._getThumbFileId($thumb);return self.fileManager.getIndex(id)},getIdList:function(){return $h.getObjectKeys(self.fileManager.stack)},getFile:function(id){return self.fileManager.stack[id]||null},getFileName:function(id,fmt){var file=self.fileManager.getFile(id);if(!file){return''}return fmt?(file.nameFmt||''):file.name||''},getFirstFile:function(){var ids=self.fileManager.getIdList(),id=ids&&ids.length?ids[0]:null;return self.fileManager.getFile(id)},setFile:function(id,file){if(self.fileManager.getFile(id)){self.fileManager.stack[id].file=file}else{self.fileManager.add(file,id)}},setProcessed:function(id){self.fileManager.filesProcessed.push(id)},getProgress:function(){var total=self.fileManager.total(),filesProcessed=self.fileManager.filesProcessed.length;if(!total){return 0}return Math.ceil(filesProcessed/total*100)},setProgress:function(id,pct){var f=self.fileManager.getFile(id);if(!isNaN(pct)&&f){f.progress=pct}}}},_setUploadData:function(fd,config){var self=this;$.each(config,function(key,value){var param=self.uploadParamNames[key]||key;if($h.isArray(value)){fd.append(param,value[0],value[1])}else{fd.append(param,value)}})},_initResumableUpload:function(){var self=this,opts=self.resumableUploadOptions,logs=$h.logMessages,rm,fm=self.fileManager;if(!self.enableResumableUpload){return}if(opts.fallback!==false&&typeof opts.fallback!=='function'){opts.fallback=function(s){s._log(logs.noResumableSupport);s.enableResumableUpload=false}}if(!$h.hasResumableUploadSupport()&&opts.fallback!==false){opts.fallback(self);return}if(!self.uploadUrl&&self.enableResumableUpload){self._log(logs.noUploadUrl);self.enableResumableUpload=false;return}opts.chunkSize=parseFloat(opts.chunkSize);if(opts.chunkSize<=0||isNaN(opts.chunkSize)){self._log(logs.invalidChunkSize,{chunkSize:opts.chunkSize});self.enableResumableUpload=false;return}rm=self.resumableManager={init:function(id,f,index){rm.logs=[];rm.stack=[];rm.error='';rm.id=id;rm.file=f.file;rm.fileName=f.name;rm.fileIndex=index;rm.completed=false;rm.lastProgress=0;if(self.showPreview){rm.$thumb=fm.getThumb(id)||null;rm.$progress=rm.$btnDelete=null;if(rm.$thumb&&rm.$thumb.length){rm.$progress=rm.$thumb.find('.file-thumb-progress');rm.$btnDelete=rm.$thumb.find('.kv-file-remove')}}rm.chunkSize=opts.chunkSize*self.bytesToKB;rm.chunkCount=rm.getTotalChunks()},setAjaxError:function(jqXHR,textStatus,errorThrown,isTest){if(jqXHR.responseJSON&&jqXHR.responseJSON.error){errorThrown=jqXHR.responseJSON.error.toString()}if(!isTest){rm.error=errorThrown}if(opts.showErrorLog){self._log(logs.ajaxError,{status:jqXHR.status,error:errorThrown,text:jqXHR.responseText||''})}},reset:function(){rm.stack=[];rm.chunksProcessed={}},setProcessed:function(status){var id=rm.id,msg,$thumb=rm.$thumb,$prog=rm.$progress,hasThumb=$thumb&&$thumb.length,params={id:hasThumb?$thumb.attr('id'):'',index:fm.getIndex(id),fileId:id},tokens,skipErrorsAndProceed=self.resumableUploadOptions.skipErrorsAndProceed;rm.completed=true;rm.lastProgress=0;if(hasThumb){$thumb.removeClass('file-uploading')}if(status==='success'){fm.uploadedSize+=rm.file.size;if(self.showPreview){self._setProgress(101,$prog);self._setThumbStatus($thumb,'Success');self._initUploadSuccess(rm.chunksProcessed[id].data,$thumb)}fm.removeFile(id);delete rm.chunksProcessed[id];self._raise('fileuploaded',[params.id,params.index,params.fileId]);if(fm.isProcessed()){self._setProgress(101)}}else{if(status!=='cancel'){if(self.showPreview){self._setThumbStatus($thumb,'Error');self._setPreviewError($thumb,true);self._setProgress(101,$prog,self.msgProgressError);self._setProgress(101,self.$progress,self.msgProgressError);self.cancelling=!skipErrorsAndProceed}if(!self.$errorContainer.find('li[data-file-id="'+params.fileId+'"]').length){tokens={file:rm.fileName,max:opts.maxRetries,error:rm.error};msg=self.msgResumableUploadRetriesExceeded.setTokens(tokens);$.extend(params,tokens);self._showFileError(msg,params,'filemaxretries');if(skipErrorsAndProceed){fm.removeFile(id);delete rm.chunksProcessed[id];if(fm.isProcessed()){self._setProgress(101)}}}}}if(fm.isProcessed()){rm.reset()}},check:function(){var status=true;$.each(rm.logs,function(index,value){if(!value){status=false;return false}})},processedResumables:function(){var logs=rm.logs,i,count=0;if(!logs||!logs.length){return 0}for(i=0;irm.file.size?rm.file.size:size},getTotalChunks:function(){var chunkSize=parseFloat(rm.chunkSize);if(!isNaN(chunkSize)&&chunkSize>0){return Math.ceil(rm.file.size/chunkSize)}return 0},getProgress:function(){var chunksProcessed=rm.processedResumables(),total=rm.chunkCount;if(total===0){return 0}return Math.ceil(chunksProcessed/total*100)},checkAborted:function(intervalId){if(self._isAborted()){clearInterval(intervalId);self.unlock()}},upload:function(){var ids=fm.getIdList(),flag='new',intervalId;intervalId=setInterval(function(){var id;rm.checkAborted(intervalId);if(flag==='new'){self.lock();flag='processing';id=ids.shift();fm.initStats(id);if(fm.stack[id]){rm.init(id,fm.stack[id],fm.getIndex(id));rm.processUpload()}}if(!fm.isPending(id)&&rm.completed){flag='new'}if(fm.isProcessed()){var $initThumbs=self.$preview.find('.file-preview-initial');if($initThumbs.length){$h.addCss($initThumbs,$h.SORT_CSS);self._initSortable()}clearInterval(intervalId);self._clearFileInput();self.unlock();setTimeout(function(){var data=self.previewCache.data;if(data){self.initialPreview=data.content;self.initialPreviewConfig=data.config;self.initialPreviewThumbTags=data.tags}self._raise('filebatchuploadcomplete',[self.initialPreview,self.initialPreviewConfig,self.initialPreviewThumbTags,self._getExtraData()])},self.processDelay)}},self.processDelay)},uploadResumable:function(){var i,pool,tm=self.taskManager,total=rm.chunkCount;pool=tm.addPool(rm.id);for(i=0;iopts.maxRetries){logError(msgs.resumableMaxRetriesReached,{n:opts.maxRetries});rm.setProcessed('error');return}var fd,outData,fnBefore,fnSuccess,fnError,fnComplete,slice=file.slice?'slice':(file.mozSlice?'mozSlice':(file.webkitSlice?'webkitSlice':'slice')),blob=file[slice](chunkSize*index,chunkSize*(index+1));fd=new FormData();f=fm.stack[id];self._setUploadData(fd,{chunkCount:rm.chunkCount,chunkIndex:index,chunkSize:chunkSize,chunkSizeStart:chunkSize*index,fileBlob:[blob,rm.fileName],fileId:id,fileName:rm.fileName,fileRelativePath:f.relativePath,fileSize:file.size,retryCount:retry});if(rm.$progress&&rm.$progress.length){rm.$progress.show()}fnBefore=function(jqXHR){outData=self._getOutData(fd,jqXHR);if(self.showPreview){if(!$thumb.hasClass('file-preview-success')){self._setThumbStatus($thumb,'Loading');$h.addCss($thumb,'file-uploading')}$btnDelete.attr('disabled',true)}self._raise('filechunkbeforesend',[id,index,retry,fm,rm,outData])};fnSuccess=function(data,textStatus,jqXHR){if(self._isAborted()){logError(msgs.resumableAborting);return}outData=self._getOutData(fd,jqXHR,data);var paramNames=self.uploadParamNames,chunkIndex=paramNames.chunkIndex||'chunkIndex',params=[id,index,retry,fm,rm,outData];if(data.error){if(opts.showErrorLog){self._log(logs.retryStatus,{retry:retry+1,filename:rm.fileName,chunk:index})}self._raise('filechunkerror',params);rm.pushAjax(index,retry+1);rm.error=data.error;logError(data.error)}else{rm.logs[data[chunkIndex]]=true;if(!rm.chunksProcessed[id]){rm.chunksProcessed[id]={}}rm.chunksProcessed[id][data[chunkIndex]]=true;rm.chunksProcessed[id].data=data;deferrer.resolve.call(null,data);self._raise('filechunksuccess',params);rm.check()}};fnError=function(jqXHR,textStatus,errorThrown){if(self._isAborted()){logError(msgs.resumableAborting);return}outData=self._getOutData(fd,jqXHR);rm.setAjaxError(jqXHR,textStatus,errorThrown);self._raise('filechunkajaxerror',[id,index,retry,fm,rm,outData]);rm.pushAjax(index,retry+1);logError(msgs.resumableRetryError,{n:retry-1})};fnComplete=function(){if(!self._isAborted()){self._raise('filechunkcomplete',[id,index,retry,fm,rm,self._getOutData(fd)])}};self._ajaxSubmit(fnBefore,fnSuccess,fnComplete,fnError,fd,id,rm.fileIndex)}};rm.reset()},_initTemplateDefaults:function(){var self=this,tMain1,tMain2,tPreview,tFileIcon,tClose,tCaption,tBtnDefault,tBtnLink,tBtnBrowse,tModalMain,tModal,tProgress,tSize,tFooter,tActions,tActionDelete,tActionUpload,tActionDownload,tActionZoom,tActionDrag,tIndicator,tTagBef,tTagBef1,tTagBef2,tTagAft,tGeneric,tHtml,tImage,tText,tOffice,tGdocs,tVideo,tAudio,tFlash,tObject,tPdf,tOther,tStyle,tZoomCache,vDefaultDim,tActionRotate,tStats,tModalLabel,tDescClose,renderObject=function(type,mime){return'\n'+$h.DEFAULT_PREVIEW+'\n\n'},defBtnCss1='btn btn-sm btn-kv '+$h.defaultButtonCss();tMain1='{preview}\n
    \n
    \n
    \n {caption}\n\n'+($h.isBs(5)?'':'
    \n')+' {remove}\n {cancel}\n {pause}\n {upload}\n {browse}\n'+($h.isBs(5)?'':'
    \n')+'
    ';'
    ';tMain2='{preview}\n
    \n
    \n{remove}\n{cancel}\n{upload}\n{browse}\n';tPreview='
    \n {close}
    \n
    \n
    \n
    \n
    \n
    \n
    ';tClose=$h.closeButton('fileinput-remove');tFileIcon='';tCaption='\n';tBtnDefault='';tBtnLink='{icon} {label}';tBtnBrowse='
    {icon} {label}
    ';tModalLabel=$h.MODAL_ID+'Label';tModalMain='';tModal='\n';tDescClose='';tProgress='
    \n
    \n {status}\n
    \n
    {stats}';tStats='
    {pendingTime} {uploadSpeed}
    ';tSize=' ({sizeText})';tFooter='';tActions='
    \n \n
    \n{drag}\n
    ';tActionDelete='\n';tActionUpload='';tActionRotate='';tActionDownload='{downloadIcon}';tActionZoom='';tActionDrag='{dragIcon}';tIndicator='
    {indicator}
    ';tTagBef='
    \n';tTagBef2=tTagBef+' title="{caption}">
    \n';tTagAft='
    {footer}\n{zoomCache}
    \n';tGeneric='{content}\n';tStyle=' {style}';tHtml=renderObject('html','text/html');tText=renderObject('text','text/plain;charset=UTF-8');tPdf=renderObject('pdf','application/pdf');tImage='{alt}\n';tOffice='';tGdocs='';tVideo='\n';tAudio='\n';tFlash='\n';tObject='\n\n'+$h.OBJECT_PARAMS+' '+$h.DEFAULT_PREVIEW+'\n\n';tOther='
    \n'+$h.DEFAULT_PREVIEW+'\n
    \n';tZoomCache='
    {zoomContent}
    ';vDefaultDim={width:'100%',height:'100%','min-height':'480px'};if(self._isPdfRendered()){tPdf=self.pdfRendererTemplate.replace('{renderer}',self._encodeURI(self.pdfRendererUrl))}self.defaults={layoutTemplates:{main1:tMain1,main2:tMain2,preview:tPreview,close:tClose,fileIcon:tFileIcon,caption:tCaption,modalMain:tModalMain,modal:tModal,descriptionClose:tDescClose,progress:tProgress,stats:tStats,size:tSize,footer:tFooter,indicator:tIndicator,actions:tActions,actionDelete:tActionDelete,actionRotate:tActionRotate,actionUpload:tActionUpload,actionDownload:tActionDownload,actionZoom:tActionZoom,actionDrag:tActionDrag,btnDefault:tBtnDefault,btnLink:tBtnLink,btnBrowse:tBtnBrowse,zoomCache:tZoomCache},previewMarkupTags:{tagBefore1:tTagBef1,tagBefore2:tTagBef2,tagAfter:tTagAft},previewContentTemplates:{generic:tGeneric,html:tHtml,image:tImage,text:tText,office:tOffice,gdocs:tGdocs,video:tVideo,audio:tAudio,flash:tFlash,object:tObject,pdf:tPdf,other:tOther},allowedPreviewTypes:['image','html','text','video','audio','flash','pdf','object'],previewTemplates:{},previewSettings:{image:{width:'auto',height:'auto','max-width':'100%','max-height':'100%'},html:{width:'213px',height:'160px'},text:{width:'213px',height:'160px'},office:{width:'213px',height:'160px'},gdocs:{width:'213px',height:'160px'},video:{width:'213px',height:'160px'},audio:{width:'100%',height:'30px'},flash:{width:'213px',height:'160px'},object:{width:'213px',height:'160px'},pdf:{width:'100%',height:'160px','position':'relative'},other:{width:'213px',height:'160px'}},previewSettingsSmall:{image:{width:'auto',height:'auto','max-width':'100%','max-height':'100%'},html:{width:'100%',height:'160px'},text:{width:'100%',height:'160px'},office:{width:'100%',height:'160px'},gdocs:{width:'100%',height:'160px'},video:{width:'100%',height:'auto'},audio:{width:'100%',height:'30px'},flash:{width:'100%',height:'auto'},object:{width:'100%',height:'auto'},pdf:{width:'100%',height:'160px'},other:{width:'100%',height:'160px'}},previewZoomSettings:{image:{width:'auto',height:'auto','max-width':'100%','max-height':'100%'},html:vDefaultDim,text:vDefaultDim,office:{width:'100%',height:'100%','max-width':'100%','min-height':'480px'},gdocs:{width:'100%',height:'100%','max-width':'100%','min-height':'480px'},video:{width:'auto',height:'100%','max-width':'100%'},audio:{width:'100%',height:'30px'},flash:{width:'auto',height:'480px'},object:{width:'auto',height:'100%','max-width':'100%','min-height':'480px'},pdf:vDefaultDim,other:{width:'auto',height:'100%','min-height':'480px'}},mimeTypeAliases:{'video/quicktime':'video/mp4'},fileTypeSettings:{image:function(vType,vName){return($h.compare(vType,'image.*')&&!$h.compare(vType,/(tiff?|wmf)$/i)||$h.compare(vName,/\.(gif|png|jpe?g)$/i))},html:function(vType,vName){return $h.compare(vType,'text/html')||$h.compare(vName,/\.(htm|html)$/i)},office:function(vType,vName){return $h.compare(vType,/(word|excel|powerpoint|office)$/i)||$h.compare(vName,/\.(docx?|xlsx?|pptx?|pps|potx?)$/i)},gdocs:function(vType,vName){return $h.compare(vType,/(word|excel|powerpoint|office|iwork-pages|tiff?)$/i)||$h.compare(vName,/\.(docx?|xlsx?|pptx?|pps|potx?|rtf|ods|odt|pages|ai|dxf|ttf|tiff?|wmf|e?ps)$/i)},text:function(vType,vName){return $h.compare(vType,'text.*')||$h.compare(vName,/\.(xml|javascript)$/i)||$h.compare(vName,/\.(txt|md|nfo|ini|json|php|js|css)$/i)},video:function(vType,vName){return $h.compare(vType,'video.*')&&($h.compare(vType,/(ogg|mp4|mp?g|mov|webm|3gp)$/i)||$h.compare(vName,/\.(og?|mp4|webm|mp?g|mov|3gp)$/i))},audio:function(vType,vName){return $h.compare(vType,'audio.*')&&($h.compare(vName,/(ogg|mp3|mp?g|wav)$/i)||$h.compare(vName,/\.(og?|mp3|mp?g|wav)$/i))},flash:function(vType,vName){return $h.compare(vType,'application/x-shockwave-flash',true)||$h.compare(vName,/\.(swf)$/i)},pdf:function(vType,vName){return $h.compare(vType,'application/pdf',true)||$h.compare(vName,/\.(pdf)$/i)},object:function(){return true},other:function(){return true}},fileActionSettings:{showRemove:true,showUpload:true,showDownload:true,showZoom:true,showDrag:true,showRotate:false,removeIcon:'',removeClass:defBtnCss1,removeErrorClass:'btn btn-sm btn-kv btn-danger',removeTitle:'Remove file',uploadIcon:'',uploadClass:defBtnCss1,uploadTitle:'Upload file',uploadRetryIcon:'',uploadRetryTitle:'Retry upload',downloadIcon:'',downloadClass:defBtnCss1,downloadTitle:'Download file',rotateIcon:'',rotateClass:defBtnCss1,rotateTitle:'Rotate 90 deg. clockwise',zoomIcon:'',zoomClass:defBtnCss1,zoomTitle:'View Details',dragIcon:'',dragClass:'text-primary',dragTitle:'Move / Rearrange',dragSettings:{},indicatorNew:'',indicatorSuccess:'',indicatorError:'',indicatorLoading:'',indicatorPaused:'',indicatorNewTitle:'Not uploaded yet',indicatorSuccessTitle:'Uploaded',indicatorErrorTitle:'Upload Error',indicatorLoadingTitle:'Uploading …',indicatorPausedTitle:'Upload Paused'}};$.each(self.defaults,function(key,setting){if(key==='allowedPreviewTypes'){if(self.allowedPreviewTypes===undefined){self.allowedPreviewTypes=setting}return}self[key]=$.extend(true,{},setting,self[key])});self._initPreviewTemplates()},_initPreviewTemplates:function(){var self=this,tags=self.previewMarkupTags,tagBef,tagAft=tags.tagAfter;$.each(self.previewContentTemplates,function(key,value){if($h.isEmpty(self.previewTemplates[key])){tagBef=tags.tagBefore2;if(key==='generic'||key==='image'){tagBef=tags.tagBefore1}if(self._isPdfRendered()&&key==='pdf'){tagBef=tagBef.replace('kv-file-content','kv-file-content kv-pdf-rendered')}self.previewTemplates[key]=tagBef+value+tagAft}})},_initPreviewCache:function(){var self=this;self.previewCache={data:{},init:function(){var content=self.initialPreview;if(content.length>0&&!$h.isArray(content)){content=content.split(self.initialPreviewDelimiter)}self.previewCache.data={content:content,config:self.initialPreviewConfig,tags:self.initialPreviewThumbTags}},count:function(skipNull){if(!self.previewCache.data||!self.previewCache.data.content){return 0}if(skipNull){var chk=self.previewCache.data.content.filter(function(n){return n!==null});return chk.length}return self.previewCache.data.content.length},get:function(i,isDisabled){var ind=$h.INIT_FLAG+i,data=self.previewCache.data,config=data.config[i],content=data.content[i],out,$tmp,cat,ftr,fname,ftype,frameClass,asData=$h.ifSet('previewAsData',config,self.initialPreviewAsData),a=config?{title:config.title||null,alt:config.alt||null}:{title:null,alt:null},parseTemplate=function(cat,dat,fname,ftype,ftr,ind,fclass,t){var fc=' file-preview-initial '+$h.SORT_CSS+(fclass?' '+fclass:''),id=self.previewInitId+'-'+ind,fileId=config&&config.fileId||id;return self._generatePreviewTemplate(cat,dat,fname,ftype,id,fileId,false,null,null,fc,ftr,ind,t,a,config&&config.zoomData||dat)};if(!content||!content.length){return''}isDisabled=isDisabled===undefined?true:isDisabled;cat=$h.ifSet('type',config,self.initialPreviewFileType||'generic');fname=$h.ifSet('filename',config,$h.ifSet('caption',config));ftype=$h.ifSet('filetype',config,cat);ftr=self.previewCache.footer(i,isDisabled,(config&&config.size||null));frameClass=$h.ifSet('frameClass',config);if(asData){out=parseTemplate(cat,content,fname,ftype,ftr,ind,frameClass)}else{out=parseTemplate('generic',content,fname,ftype,ftr,ind,frameClass,cat).setTokens({'content':data.content[i]})}if(data.tags.length&&data.tags[i]){out=$h.replaceTags(out,data.tags[i])}if(!$h.isEmpty(config)&&!$h.isEmpty(config.frameAttr)){$tmp=$h.createElement(out);$tmp.find('.file-preview-initial').attr(config.frameAttr);out=$tmp.html();$tmp.remove()}return out},clean:function(data){data.content=$h.cleanArray(data.content);data.config=$h.cleanArray(data.config);data.tags=$h.cleanArray(data.tags);self.previewCache.data=data},add:function(content,config,tags,append){var data=self.previewCache.data,index;if(!content||!content.length){return 0}index=content.length-1;if(!$h.isArray(content)){content=content.split(self.initialPreviewDelimiter)}if(append&&data.content){index=data.content.push(content[0])-1;data.config[index]=config;data.tags[index]=tags}else{data.content=content;data.config=config;data.tags=tags}self.previewCache.clean(data);return index},set:function(content,config,tags,append){var data=self.previewCache.data,i,chk;if(!content||!content.length){return}if(!$h.isArray(content)){content=content.split(self.initialPreviewDelimiter)}chk=content.filter(function(n){return n!==null});if(!chk.length){return}if(data.content===undefined){data.content=[]}if(data.config===undefined){data.config=[]}if(data.tags===undefined){data.tags=[]}if(append){for(i=0;i'+fileName+': '+msg}}self._showFileError(msg,params,'fileusererror')},_showFileError:function(msg,params,event){var self=this,$error=self.$errorContainer,ev=event||'fileuploaderror',fId=params&¶ms.fileId||'',e=params&¶ms.id?'
  • '+msg+'
  • ':'
  • '+msg+'
  • ';if($error.find('ul').length===0){self._addError('
      '+e+'
    ')}else{$error.find('ul').append(e)}$error.fadeIn(self.fadeDelay);self._raise(ev,[params,msg]);self._setValidationError('file-input-new');return true},_showError:function(msg,params,event){var self=this,$error=self.$errorContainer,ev=event||'fileerror';params=params||{};params.reader=self.reader;self._addError(msg);$error.fadeIn(self.fadeDelay);self._raise(ev,[params,msg]);if(!self.isAjaxUpload){self._clearFileInput()}self._setValidationError('file-input-new');self.$btnUpload.attr('disabled',true);return true},_noFilesError:function(params){var self=this,label=self.minFileCount>1?self.filePlural:self.fileSingle,msg=self.msgFilesTooLess.replace('{n}',self.minFileCount).replace('{files}',label),$error=self.$errorContainer;msg='
  • '+msg+'
  • ';if($error.find('ul').length===0){self._addError('
      '+msg+'
    ')}else{$error.find('ul').append(msg)}self.isError=true;self._updateFileDetails(0);$error.fadeIn(self.fadeDelay);self._raise('fileerror',[params,msg]);self._clearFileInput();self._setValidationError()},_parseError:function(operation,jqXHR,errorThrown,fileName){var self=this,errMsg=$.trim(errorThrown+''),textPre,errText,text;errText=jqXHR.responseJSON&&jqXHR.responseJSON.error?jqXHR.responseJSON.error.toString():'';text=errText?errText:jqXHR.responseText;if(self.cancelling&&self.msgUploadAborted){errMsg=self.msgUploadAborted}if(self.showAjaxErrorDetails&&text){if(errText){errMsg=$.trim(errText+'')}else{text=$.trim(text.replace(/\n\s*\n/g,'\n'));textPre=text.length?'
    '+text+'
    ':'';errMsg+=errMsg?textPre:text}}if(!errMsg){errMsg=self.msgAjaxError.replace('{operation}',operation)}self.cancelling=false;return fileName?''+fileName+': '+errMsg:errMsg},_parseFileType:function(type,name){var self=this,isValid,vType,cat,i,types=self.allowedPreviewTypes||[];if(type==='application/text-plain'){return'text'}for(i=0;i-1){ext=fname.split('.').pop();if(self.previewFileIconSettings){out=self.previewFileIconSettings[ext]||self.previewFileIconSettings[ext.toLowerCase()]||null}if(self.previewFileExtSettings){$.each(self.previewFileExtSettings,function(key,func){if(self.previewFileIconSettings[key]&&func(ext)){out=self.previewFileIconSettings[key];return}})}}return out||self.previewFileIcon},_parseFilePreviewIcon:function(content,fname){var self=this,icn=self._getPreviewIcon(fname),out=content;if(out.indexOf('{previewFileIcon}')>-1){out=out.setTokens({'previewFileIconClass':self.previewFileIconClass,'previewFileIcon':icn})}return out},_raise:function(event,params){var self=this,e=$.Event(event);if(params!==undefined){self.$element.trigger(e,params)}else{self.$element.trigger(e)}var out=e.result,isAborted=out===false;if(e.isDefaultPrevented()||isAborted){return false}if(e.type==='filebatchpreupload'&&(out||isAborted)){self.ajaxAborted=out;return false}switch(event){case'filebatchuploadcomplete':case'filebatchuploadsuccess':case'fileuploaded':case'fileclear':case'filecleared':case'filereset':case'fileerror':case'filefoldererror':case'filecustomerror':case'filesuccessremove':break;default:if(!self.ajaxAborted){self.ajaxAborted=out}break}return true},_listenFullScreen:function(isFullScreen){var self=this,$modal=self.$modal,$btnFull,$btnBord;if(!$modal||!$modal.length){return}$btnFull=$modal&&$modal.find('.btn-kv-fullscreen');$btnBord=$modal&&$modal.find('.btn-kv-borderless');if(!$btnFull.length||!$btnBord.length){return}$btnFull.removeClass('active').attr('aria-pressed','false');$btnBord.removeClass('active').attr('aria-pressed','false');if(isFullScreen){$btnFull.addClass('active').attr('aria-pressed','true')}else{$btnBord.addClass('active').attr('aria-pressed','true')}if($modal.hasClass('file-zoom-fullscreen')){self._maximizeZoomDialog()}else{if(isFullScreen){self._maximizeZoomDialog()}else{$btnBord.removeClass('active').attr('aria-pressed','false')}}},_listen:function(){var self=this,$el=self.$element,$form=self.$form,$cont=self.$container,fullScreenEv;self._handler($el,'click',function(e){self._initFileSelected();if($el.hasClass('file-no-browse')){if($el.data('zoneClicked')){$el.data('zoneClicked',false)}else{e.preventDefault()}}});self._handler($el,'change',$.proxy(self._change,self));self._handler(self.$caption,'paste',$.proxy(self.paste,self));if(self.showBrowse){self._handler(self.$btnFile,'click',$.proxy(self._browse,self));self._handler(self.$btnFile,'keypress',function(e){var keycode=e.keyCode||e.which;if(keycode===13){$el.trigger('click');self._browse(e)}})}self._handler($cont.find('.fileinput-remove:not([disabled])'),'click',$.proxy(self.clear,self));self._handler($cont.find('.fileinput-cancel'),'click',$.proxy(self.cancel,self));self._handler($cont.find('.fileinput-pause'),'click',$.proxy(self.pause,self));self._initDragDrop();self._handler($form,'reset',$.proxy(self.clear,self));if(!self.isAjaxUpload){self._handler($form,'submit',$.proxy(self._submitForm,self))}self._handler(self.$container.find('.fileinput-upload'),'click',$.proxy(self._uploadClick,self));self._handler($(window),'resize',function(){self._listenFullScreen(screen.width===window.innerWidth&&screen.height===window.innerHeight)});fullScreenEv='webkitfullscreenchange mozfullscreenchange fullscreenchange MSFullscreenChange';self._handler($(document),fullScreenEv,function(){self._listenFullScreen($h.checkFullScreen())});self.$caption.on('focus',function(){self.$captionContainer.focus()});self._autoFitContent();self._initClickable();self._refreshPreview()},_autoFitContent:function(){var width=window.innerWidth||document.documentElement.clientWidth||document.body.clientWidth,self=this,config=width<400?(self.previewSettingsSmall||self.defaults.previewSettingsSmall):(self.previewSettings||self.defaults.previewSettings),sel;$.each(config,function(cat,settings){sel='.file-preview-frame .file-preview-'+cat;self.$preview.find(sel+'.kv-preview-data,'+sel+' .kv-preview-data').css(settings)})},_scanDroppedItems:function(item,files,path){path=path||'';var self=this,i,dirReader,readDir,errorHandler=function(e){self._log($h.logMessages.badDroppedFiles);self._log(e)};if(item.isFile){item.file(function(file){if(path){file.newPath=path+file.name}files.push(file)},errorHandler)}else{if(item.isDirectory){dirReader=item.createReader();readDir=function(){dirReader.readEntries(function(entries){if(entries&&entries.length>0){for(i=0;i-1;self._zoneDragDropInit(e);if(self.isDisabled||!hasFiles){dt.effectAllowed='none';dt.dropEffect='none';return}dt.dropEffect='copy';if(self._raise('fileDragEnter',{'sourceEvent':e,'files':dt.types.Files})){$h.addCss(self.$dropZone,'file-highlighted')}},_zoneDragLeave:function(e){var self=this;self._zoneDragDropInit(e);if(self.isDisabled){return}if(self._raise('fileDragLeave',{'sourceEvent':e})){self.$dropZone.removeClass('file-highlighted')}},_dropFiles:function(e,files){var self=this,$el=self.$element;if(!self.isAjaxUpload){self.changeTriggered=true;$el.get(0).files=files;setTimeout(function(){self.changeTriggered=false;$el.trigger('change'+self.namespace)},self.processDelay)}else{self._change(e,files)}self.$dropZone.removeClass('file-highlighted')},_zoneDrop:function(e){var self=this,i,$el=self.$element,dt=e.originalEvent.dataTransfer,files=dt.files,items=dt.items,folders=$h.getDragDropFolders(items);e.preventDefault();if(self.isDisabled||$h.isEmpty(files)){return}if(!self._raise('fileDragDrop',{'sourceEvent':e,'files':files})){return}if(folders>0){if(!self.isAjaxUpload){self._showFolderError(folders);return}files=[];for(i=0;i0&&newIndex>=len,$item=$(e.item),$first;if(exceedsLast){newIndex=len-1}self.initialPreview=$h.moveArray(self.initialPreview,oldIndex,newIndex,rev);self.initialPreviewConfig=$h.moveArray(self.initialPreviewConfig,oldIndex,newIndex,rev);self.previewCache.init();self.getFrames('.file-preview-initial').each(function(){$(this).attr('data-fileindex',$h.INIT_FLAG+i);i++});if(exceedsLast){$first=self.getFrames(':not(.file-preview-initial):first');if($first.length){$item.slideUp(function(){$item.insertBefore($first).slideDown()})}}self._raise('filesorted',{previewId:$item.attr('id'),'oldIndex':oldIndex,'newIndex':newIndex,stack:self.initialPreviewConfig})},};$.extend(true,settings,self.fileActionSettings.dragSettings);if(self.sortable){self.sortable.destroy()}self.sortable=Sortable.create($el[0],settings)},_setPreviewContent:function(content){var self=this;$h.setHtml(self.$preview,content);self._autoFitContent()},_initPreviewImageOrientations:function(){var self=this,i=0,canOrientImage=self.canOrientImage;if(!self.autoOrientImageInitial&&!canOrientImage){return}self.getFrames('.file-preview-initial').each(function(){var $thumb=$(this),$img,$zoomImg,id,config=self.initialPreviewConfig[i];if(config&&config.exif&&config.exif.Orientation){id=$thumb.attr('id');$img=$thumb.find('>.kv-file-content img');$zoomImg=self._getZoom(id,' >.kv-file-content img');if(canOrientImage){$img.css('image-orientation',(self.autoOrientImageInitial?'from-image':'none'))}else{self.setImageOrientation($img,$zoomImg,config.exif.Orientation,$thumb)}}i++})},_initPreview:function(isInit){var self=this,cap=self.initialCaption||'',out;if(!self.previewCache.count(true)){self._clearPreview();if(isInit){self._setCaption(cap)}else{self._initCaption()}return}out=self.previewCache.out();cap=isInit&&self.initialCaption?self.initialCaption:out.caption;self._setPreviewContent(out.content);self._setInitThumbAttr();self._setCaption(cap);self._initSortable();if(!$h.isEmpty(out.content)){self.$container.removeClass('file-input-new')}self._initPreviewImageOrientations()},_getZoomButton:function(type){var self=this,label=self.previewZoomButtonIcons[type],css=self.previewZoomButtonClasses[type],title=' title="'+(self.previewZoomButtonTitles[type]||'')+'" ',tag=$h.isBs(5)?'bs-':'',params=title+(type==='close'?' data-'+tag+'dismiss="modal" aria-hidden="true"':'');if(type==='fullscreen'||type==='borderless'||type==='toggleheader'){params+=' data-toggle="button" aria-pressed="false" autocomplete="off"'}return''},_getModalContent:function(){var self=this;return self._getLayoutTemplate('modal').setTokens({'rtl':self.rtl?' kv-rtl':'','zoomFrameClass':self.frameClass,'prev':self._getZoomButton('prev'),'next':self._getZoomButton('next'),'rotate':self._getZoomButton('rotate'),'toggleheader':self._getZoomButton('toggleheader'),'fullscreen':self._getZoomButton('fullscreen'),'borderless':self._getZoomButton('borderless'),'close':self._getZoomButton('close')})},_listenModalEvent:function(event){var self=this,$modal=self.$modal,getParams=function(e){return{sourceEvent:e,previewId:$modal.data('previewId'),modal:$modal}};$modal.on(event+'.bs.modal',function(e){if(e.namespace!=='bs.modal'){return}var $btnFull=$modal.find('.btn-fullscreen'),$btnBord=$modal.find('.btn-borderless');if($modal.data('fileinputPluginId')===self.$element.attr('id')){self._raise('filezoom'+event,getParams(e))}if(event==='shown'){self._handleRotation($modal,$modal.find('.file-zoom-detail'),$modal.data('angle'));$btnBord.removeClass('active').attr('aria-pressed','false');$btnFull.removeClass('active').attr('aria-pressed','false');if($modal.hasClass('file-zoom-fullscreen')){self._maximizeZoomDialog();if($h.checkFullScreen()){$btnFull.addClass('active').attr('aria-pressed','true')}else{$btnBord.addClass('active').attr('aria-pressed','true')}}}})},_initZoom:function(){var self=this,$dialog,modalMain=self._getLayoutTemplate('modalMain'),modalId='#'+$h.MODAL_ID;modalMain=self._setTabIndex('modal',modalMain);if(!self.showPreview){return}self.$modal=$(modalId);if(!self.$modal||!self.$modal.length){$dialog=$h.createElement($h.cspBuffer.stash(modalMain)).insertAfter(self.$container);self.$modal=$(modalId).insertBefore($dialog);$h.cspBuffer.apply(self.$modal);$dialog.remove()}$h.initModal(self.$modal);self.$modal.html($h.cspBuffer.stash(self._getModalContent()));$h.cspBuffer.apply(self.$modal);$.each($h.MODAL_EVENTS,function(key,event){self._listenModalEvent(event)})},_initZoomButtons:function(){var self=this,$modal=self.$modal,previewId=$modal.data('previewId')||'',$first,$last,thumbs=self.getFrames().toArray(),len=thumbs.length,$prev=$modal.find('.btn-kv-prev'),$next=$modal.find('.btn-kv-next'),$rotate=$modal.find('.btn-kv-rotate');if(thumbs.length<2){$prev.hide();$next.hide();return}else{$prev.show();$next.show()}if(!len){return}$first=$(thumbs[0]);$last=$(thumbs[len-1]);$prev.removeAttr('disabled');$next.removeAttr('disabled');if(self.reversePreviewOrder){[$prev,$next]=[$next,$prev]}if($first.length&&$first.attr('id')===previewId){$prev.attr('disabled',true)}if($last.length&&$last.attr('id')===previewId){$next.attr('disabled',true)}},_maximizeZoomDialog:function(){var self=this,$modal=self.$modal,$head=$modal.find('.modal-header:visible'),$foot=$modal.find('.modal-footer:visible'),$body=$modal.find('.kv-zoom-body'),h=$(window).height(),diff=0;$modal.addClass('file-zoom-fullscreen');if($head&&$head.length){h-=$head.outerHeight(true)}if($foot&&$foot.length){h-=$foot.outerHeight(true)}if($body&&$body.length){diff=$body.outerHeight(true)-$body.height();h-=diff}$modal.find('.kv-zoom-body').height(h)},_resizeZoomDialog:function(fullScreen){var self=this,$modal=self.$modal,$btnFull=$modal.find('.btn-kv-fullscreen'),$btnBord=$modal.find('.btn-kv-borderless');if($modal.hasClass('file-zoom-fullscreen')){$h.toggleFullScreen(false);if(!fullScreen){if(!$btnFull.hasClass('active')){$modal.removeClass('file-zoom-fullscreen');self.$modal.find('.kv-zoom-body').css('height',self.zoomModalHeight)}else{$btnFull.removeClass('active').attr('aria-pressed','false')}}else{if(!$btnFull.hasClass('active')){$modal.removeClass('file-zoom-fullscreen');self._resizeZoomDialog(true);if($btnBord.hasClass('active')){$btnBord.removeClass('active').attr('aria-pressed','false')}}}}else{if(!fullScreen){self._maximizeZoomDialog();return}$h.toggleFullScreen(true)}$modal.focus()},_setZoomContent:function($frame,navigate){var self=this,$content,tmplt,body,title,$body,$dataEl,config,previewId=$frame.attr('id'),$zoomPreview=self._getZoom(previewId),$modal=self.$modal,$tmp,desc,$desc,$btnFull=$modal.find('.btn-kv-fullscreen'),$btnBord=$modal.find('.btn-kv-borderless'),cap,size,$btnTogh=$modal.find('.btn-kv-toggleheader'),dir=navigate==='prev'?'Left':'Right',slideIn='slideIn'+dir,slideOut='slideOut'+dir,parsed,zoomData=$frame.data('zoom');if(zoomData){zoomData=decodeURIComponent(zoomData);parsed=$zoomPreview.html().replace(self.zoomPlaceholder,'').setTokens({zoomData:zoomData});$zoomPreview.html(parsed);$frame.data('zoom','');$zoomPreview.attr('data-zoom',zoomData)}tmplt=$zoomPreview.attr('data-template')||'generic';$content=$zoomPreview.find('.kv-file-content');body=$content.length?$content.html():'';cap=$frame.data('caption')||self.msgZoomModalHeading;size=$frame.data('size')||'';desc=$frame.data('description')||'';$modal.find('.kv-zoom-caption').attr('title',cap).html(cap);$modal.find('.kv-zoom-size').html(size);$desc=$modal.find('.kv-zoom-description').hide();if(desc){if(self.showDescriptionClose){desc=self._getLayoutTemplate('descriptionClose').setTokens({closeIcon:self.previewZoomButtonIcons.close})+''+desc}$desc.show().html(desc);if(self.showDescriptionClose){self._handler($modal.find('.kv-desc-hide'),'click',function(){$(this).parent().fadeOut('fast',function(){$modal.focus()})})}}$body=$modal.find('.kv-zoom-body');$modal.removeClass('kv-single-content');if(navigate){$tmp=$body.addClass('file-thumb-loading').clone().insertAfter($body);$h.setHtml($body,body).hide();$tmp.fadeOut('fast',function(){$body.fadeIn('fast',function(){$body.removeClass('file-thumb-loading')});$tmp.remove()})}else{$h.setHtml($body,body)}config=self.previewZoomSettings[tmplt];if(config){$dataEl=$body.find('.kv-preview-data');$h.addCss($dataEl,'file-zoom-detail');$.each(config,function(key,value){$dataEl.css(key,value);if(($dataEl.attr('width')&&key==='width')||($dataEl.attr('height')&&key==='height')){$dataEl.removeAttr(key)}})}$modal.data('previewId',previewId);self._handler($modal.find('.btn-kv-prev'),'click',function(){self._zoomSlideShow('prev',previewId)});self._handler($modal.find('.btn-kv-next'),'click',function(){self._zoomSlideShow('next',previewId)});self._handler($btnFull,'click',function(){self._resizeZoomDialog(true)});self._handler($btnBord,'click',function(){self._resizeZoomDialog(false)});self._handler($btnTogh,'click',function(){var $header=$modal.find('.modal-header'),$floatBar=$modal.find('.floating-buttons'),ht,$actions=$header.find('.kv-zoom-actions'),resize=function(height){var $body=self.$modal.find('.kv-zoom-body'),h=self.zoomModalHeight;if($modal.hasClass('file-zoom-fullscreen')){h=$body.outerHeight(true);if(!height){h=h-$header.outerHeight(true)}}$body.css('height',height?h+height:h)};if($header.is(':visible')){ht=$header.outerHeight(true);$header.slideUp('slow',function(){$actions.find('.btn').appendTo($floatBar);resize(ht)})}else{$floatBar.find('.btn').appendTo($actions);$header.slideDown('slow',function(){resize()})}$modal.focus()});self._handler($modal,'keydown',function(e){var key=e.which||e.keyCode,delay=self.processDelay+1,$prev=$(this).find('.btn-kv-prev'),$next=$(this).find('.btn-kv-next'),vId=$(this).data('previewId'),vPrevKey,vNextKey;[vPrevKey,vNextKey]=self.rtl?[39,37]:[37,39];$.each({prev:[$prev,vPrevKey],next:[$next,vNextKey]},function(direction,config){var $btn=config[0],vKey=config[1];if(key===vKey&&$btn.length){$modal.focus();if(!$btn.attr('disabled')){$btn.blur();setTimeout(function(){$btn.focus();self._zoomSlideShow(direction,vId);setTimeout(function(){if($btn.attr('disabled')){$modal.focus()}},delay)},delay)}}})})},_showModal:function($frame){var self=this,$modal=self.$modal,$content,css,angle;if(!$frame||!$frame.length){return}$h.initModal($modal);$h.setHtml($modal,self._getModalContent());self._setZoomContent($frame);$modal.removeClass('rotatable');$modal.data({backdrop:false,fileinputPluginId:self.$element.attr('id')});$modal.find('.kv-zoom-body').css('height',self.zoomModalHeight);$content=$frame.find('.kv-file-content > :first-child');if($content.length){css=$content.css('transform');if(css){$modal.find('.file-zoom-detail').css('transform',css)}}if($frame.hasClass('rotatable')){$modal.addClass('rotatable')}if($frame.data('angle')){$modal.data('angle',$frame.data('angle'))}angle=($frame.data('angle')||0);$modal.modal('show');self._initZoomButtons();self._initRotateZoom($frame,$content)},_zoomPreview:function($btn){var self=this,$frame;if(!$btn.length){throw'Cannot zoom to detailed preview!';}$frame=$btn.closest($h.FRAMES);self._showModal($frame)},_zoomSlideShow:function(dir,previewId){var self=this,$modal=self.$modal,$btn=$modal.find('.kv-zoom-actions .btn-kv-'+dir),$targFrame,i,$thumb,thumbsData=self.getFrames().toArray(),thumbs=[],len=thumbsData.length,out,angle,$content;if(self.reversePreviewOrder){dir=dir==='prev'?'next':'prev'}if($btn.attr('disabled')){return}for(i=0;i=len||!thumbs[out]){return}$targFrame=$(thumbs[out]);if($targFrame.length){self._setZoomContent($targFrame,dir)}self._initZoomButtons();if($targFrame.length&&$targFrame.hasClass('rotatable')){angle=$targFrame.data('angle')||0;$modal.addClass('rotatable').data('angle',angle);$content=$targFrame.find('.kv-file-content > :first-child');self._initRotateZoom($targFrame,$content)}else{$modal.removeClass('rotatable').removeData('angle')}self._raise('filezoom'+dir,{'previewId':previewId,modal:self.$modal})},_initZoomButton:function(){var self=this;self.$preview.find('.kv-file-zoom').each(function(){var $el=$(this);self._handler($el,'click',function(){self._zoomPreview($el)})})},_inputFileCount:function(){return this.$element[0].files.length},_refreshPreview:function(){var self=this,files;if((!self._inputFileCount()&&!self.isAjaxUpload)||!self.showPreview||!self.isPreviewable){return}if(self.isAjaxUpload){if(self.fileManager.count()>0){files=$.extend(true,[],self.getFileList());self.fileManager.clear();self._clearFileInput()}else{files=self.$element[0].files}}else{files=self.$element[0].files}if(files&&files.length){self.readFiles(files)}},_clearObjects:function($el){$el.find('video audio').each(function(){this.pause();$(this).remove()});$el.find('img object div').each(function(){$(this).remove()})},_clearFileInput:function(){var self=this,$el=self.$element,$srcFrm,$tmpFrm,$tmpEl;if(!self._inputFileCount()){return}$srcFrm=$el.closest('form');$tmpFrm=$(document.createElement('form'));$tmpEl=$(document.createElement('div'));$el.before($tmpEl);if($srcFrm.length){$srcFrm.after($tmpFrm)}else{$tmpEl.after($tmpFrm)}$tmpFrm.append($el).trigger('reset');$tmpEl.before($el).remove();$tmpFrm.remove()},_resetUpload:function(){var self=this;self.uploadInitiated=false;self.uploadStartTime=$h.now();self.uploadCache=[];self.$btnUpload.removeAttr('disabled');self._setProgress(0);self._hideProgress();self._resetErrors(false);self._initAjax();self.fileManager.clearImages();self._resetCanvas();if(self.overwriteInitial){self.initialPreview=[];self.initialPreviewConfig=[];self.initialPreviewThumbTags=[];self.previewCache.data={content:[],config:[],tags:[]}}},_resetCanvas:function(){var self=this;if(self.imageCanvas&&self.imageCanvasContext){self.imageCanvasContext.clearRect(0,0,self.imageCanvas.width,self.imageCanvas.height)}},_hasInitialPreview:function(){var self=this;return!self.overwriteInitial&&self.previewCache.count(true)},_resetPreview:function(){var self=this,out,cap,$div,hasSuc=self.showUploadedThumbs,hasErr=!self.removeFromPreviewOnError,includeProcessed=(hasSuc||hasErr)&&self.isDuplicateError;if(self.previewCache.count(true)){out=self.previewCache.out();if(includeProcessed){$div=$h.createElement('').insertAfter(self.$container);self.getFrames().each(function(){var $thumb=$(this);if((hasSuc&&$thumb.hasClass('file-preview-success'))||(hasErr&&$thumb.hasClass('file-preview-error'))){$div.append($thumb)}})}self._setPreviewContent(out.content);self._setInitThumbAttr();cap=self.initialCaption?self.initialCaption:out.caption;self._setCaption(cap);if(includeProcessed){$div.contents().appendTo(self.$preview);$div.remove()}}else{self._clearPreview();self._initCaption()}if(self.showPreview){self._initZoom();self._initSortable()}self.isDuplicateError=false},_clearDefaultPreview:function(){var self=this;self.$preview.find('.file-default-preview').remove()},_validateDefaultPreview:function(){var self=this;if(!self.showPreview||$h.isEmpty(self.defaultPreviewContent)){return}self._setPreviewContent('
    '+self.defaultPreviewContent+'
    ');self.$container.removeClass('file-input-new');self._initClickable()},_resetPreviewThumbs:function(isAjax){var self=this,out;if(isAjax){self._clearPreview();self.clearFileStack();return}if(self._hasInitialPreview()){out=self.previewCache.out();self._setPreviewContent(out.content);self._setInitThumbAttr();self._setCaption(out.caption);self._initPreviewActions()}else{self._clearPreview()}},_getLayoutTemplate:function(t){var self=this,template=self.layoutTemplates[t];if($h.isEmpty(self.customLayoutTags)){return template}return $h.replaceTags(template,self.customLayoutTags)},_getPreviewTemplate:function(t){var self=this,templates=self.previewTemplates,template=templates[t]||templates.other;if($h.isEmpty(self.customPreviewTags)){return template}return $h.replaceTags(template,self.customPreviewTags)},_getOutData:function(formdata,jqXHR,responseData,filesData){var self=this;jqXHR=jqXHR||{};responseData=responseData||{};filesData=filesData||self.fileManager.list();return{formdata:formdata,files:filesData,filenames:self.filenames,filescount:self.getFilesCount(),extra:self._getExtraData(),response:responseData,reader:self.reader,jqXHR:jqXHR}},_getMsgSelected:function(n,processing){var self=this,strFiles=n===1?self.fileSingle:self.filePlural;return n>0?self.msgSelected.replace('{n}',n).replace('{files}',strFiles):(processing?self.msgProcessing:self.msgNoFilesSelected)},_getFrame:function(id,skipWarning){var self=this,$frame=$h.getFrameElement(self.$preview,id);if(self.showPreview&&!skipWarning&&!$frame.length){self._log($h.logMessages.invalidThumb,{id:id})}return $frame},_getZoom:function(id,selector){var self=this,$frame=$h.getZoomElement(self.$preview,id,selector);if(self.showPreview&&!$frame.length){self._log($h.logMessages.invalidThumb,{id:id})}return $frame},_getThumbs:function(css){css=css||'';return this.getFrames(':not(.file-preview-initial)'+css)},_getThumbId:function(fileId){var self=this;return self.previewInitId+'-'+fileId},_getExtraData:function(fileId,index){var self=this,data=self.uploadExtraData;if(typeof self.uploadExtraData==='function'){data=self.uploadExtraData(fileId,index)}return data},_initXhr:function(xhrobj,fileId){var self=this,fm=self.fileManager,func=function(event){var pct=0,total=event.total,loaded=event.loaded||event.position,stats=fm.getUploadStats(fileId,loaded,total);if(event.lengthComputable&&!self.enableResumableUpload){pct=$h.round(loaded/total*100)}if(fileId){self._setFileUploadStats(fileId,pct,stats)}else{self._setProgress(pct,null,null,self._getStats(stats))}self._raise('fileajaxprogress',[stats])};if(xhrobj.upload){if(self.progressDelay){func=$h.debounce(func,self.progressDelay)}xhrobj.upload.addEventListener('progress',func,false)}return xhrobj},_initAjaxSettings:function(){var self=this;self._ajaxSettings=$.extend(true,{},self.ajaxSettings);self._ajaxDeleteSettings=$.extend(true,{},self.ajaxDeleteSettings)},_mergeAjaxCallback:function(funcName,srcFunc,type){var self=this,settings=self._ajaxSettings,flag=self.mergeAjaxCallbacks,targFunc;if(type==='delete'){settings=self._ajaxDeleteSettings;flag=self.mergeAjaxDeleteCallbacks}targFunc=settings[funcName];if(flag&&typeof targFunc==='function'){if(flag==='before'){settings[funcName]=function(){targFunc.apply(this,arguments);srcFunc.apply(this,arguments)}}else{settings[funcName]=function(){srcFunc.apply(this,arguments);targFunc.apply(this,arguments)}}}else{settings[funcName]=srcFunc}},_ajaxSubmit:function(fnBefore,fnSuccess,fnComplete,fnError,formdata,fileId,index,vUrl){var self=this,settings,defaults,data,tm=self.taskManager;if(!self._raise('filepreajax',[formdata,fileId,index])){return}formdata.append('initialPreview',JSON.stringify(self.initialPreview));formdata.append('initialPreviewConfig',JSON.stringify(self.initialPreviewConfig));formdata.append('initialPreviewThumbTags',JSON.stringify(self.initialPreviewThumbTags));self._initAjaxSettings();self._mergeAjaxCallback('beforeSend',fnBefore);self._mergeAjaxCallback('success',fnSuccess);self._mergeAjaxCallback('complete',fnComplete);self._mergeAjaxCallback('error',fnError);vUrl=vUrl||self.uploadUrlThumb||self.uploadUrl;if(typeof vUrl==='function'){vUrl=vUrl()}data=self._getExtraData(fileId,index)||{};if(typeof data==='object'){$.each(data,function(key,value){formdata.append(key,value)})}defaults={xhr:function(){var xhrobj=$.ajaxSettings.xhr();return self._initXhr(xhrobj,fileId)},url:self._encodeURI(vUrl),type:'POST',dataType:'json',data:formdata,cache:false,processData:false,contentType:false};settings=$.extend(true,{},defaults,self._ajaxSettings);self.ajaxQueue.push(settings);tm.addTask(fileId+'-'+index,function(){var self=this.self,config,xhr;config=self.ajaxQueue.shift();xhr=$.ajax(config);self.ajaxRequests.push(xhr)}).runWithContext({self:self})},_mergeArray:function(prop,content){var self=this,arr1=$h.cleanArray(self[prop]),arr2=$h.cleanArray(content);self[prop]=arr1.concat(arr2)},_initUploadSuccess:function(out,$thumb,allFiles){var self=this,append,data,index,$div,content,config,tags,id,i;if(!self.showPreview||typeof out!=='object'||$.isEmptyObject(out)){self._resetCaption();return}if(out.initialPreview!==undefined&&out.initialPreview.length>0){self.hasInitData=true;content=out.initialPreview||[];config=out.initialPreviewConfig||[];tags=out.initialPreviewThumbTags||[];append=out.append===undefined||out.append;if(content.length>0&&!$h.isArray(content)){content=content.split(self.initialPreviewDelimiter)}if(content.length){self._mergeArray('initialPreview',content);self._mergeArray('initialPreviewConfig',config);self._mergeArray('initialPreviewThumbTags',tags)}if($thumb!==undefined){if(!allFiles){index=self.previewCache.add(content[0],config[0],tags[0],append);data=self.previewCache.get(index,false);$div=$h.createElement(data).hide().appendTo($thumb);$thumb.fadeOut('slow',function(){var $newThumb=$div.find('> .file-preview-frame');if($newThumb&&$newThumb.length){$newThumb.insertBefore($thumb).fadeIn('slow').css('display:inline-block')}self._initPreviewActions();self._clearFileInput();$thumb.remove();$div.remove();self._initSortable()})}else{id=$thumb.attr('id');i=self._getUploadCacheIndex(id);if(i!==null){self.uploadCache[i]={id:id,content:content[0],config:config[0]||[],tags:tags[0]||[],append:append}}}}else{self.previewCache.set(content,config,tags,append);self._initPreview();self._initPreviewActions()}}self._resetCaption()},_getUploadCacheIndex:function(id){var self=this,i,len=self.uploadCache.length,config;for(i=0;i0||!$.isEmptyObject(self.uploadExtraData),uploadFailed,$prog,fnBefore,errMsg,fnSuccess,fnComplete,fnError,updateUploadLog,op=self.ajaxOperations.uploadThumb,fileObj=fm.getFile(id),params={id:previewId,index:i,fileId:id},fileName=self.fileManager.getFileName(id,true),resolve=function(){if(deferrer&&deferrer.resolve){deferrer.resolve()}},reject=function(){if(deferrer&&deferrer.reject){deferrer.reject()}};if(self.enableResumableUpload){return}self.uploadInitiated=true;if(self.showPreview){$thumb=fm.getThumb(id);$prog=$thumb.find('.file-thumb-progress');$btnUpload=$thumb.find('.kv-file-upload');$btnDelete=$thumb.find('.kv-file-remove');$prog.show()}if(count===0||!hasPostData||(self.showPreview&&$btnUpload&&$btnUpload.hasClass('disabled'))||self._abort(params)){return}updateUploadLog=function(){if(!uploadFailed){fm.removeFile(id)}else{fm.errors.push(id)}fm.setProcessed(id);if(fm.isProcessed()){self.fileBatchCompleted=true;chkComplete()}};chkComplete=function(){var $initThumbs;if(!self.fileBatchCompleted){return}setTimeout(function(){var triggerReset=fm.count()===0,errCount=fm.errors.length;self._updateInitialPreview();self.unlock(triggerReset);if(triggerReset){self._clearFileInput()}$initThumbs=self.$preview.find('.file-preview-initial');if(self.uploadAsync&&$initThumbs.length){$h.addCss($initThumbs,$h.SORT_CSS);self._initSortable()}self._raise('filebatchuploadcomplete',[fm.stack,self._getExtraData()]);if(!self.retryErrorUploads||errCount===0){fm.clear()}self._setProgress(101);self.ajaxAborted=false;self.uploadInitiated=false},self.processDelay)};fnBefore=function(jqXHR){outData=self._getOutData(formdata,jqXHR);fm.initStats(id);self.fileBatchCompleted=false;if(!isBatch){self.ajaxAborted=false}if(self.showPreview){if(!$thumb.hasClass('file-preview-success')){self._setThumbStatus($thumb,'Loading');$h.addCss($thumb,'file-uploading')}$btnUpload.attr('disabled',true);$btnDelete.attr('disabled',true)}if(!isBatch){self.lock()}if(fm.errors.indexOf(id)!==-1){delete fm.errors[id]}self._raise('filepreupload',[outData,previewId,i,self._getThumbFileId($thumb)]);$.extend(true,params,outData);if(self._abort(params)){jqXHR.abort();if(!isBatch){self._setThumbStatus($thumb,'New');$thumb.removeClass('file-uploading');$btnUpload.removeAttr('disabled');$btnDelete.removeAttr('disabled')}self._setProgressCancelled()}};fnSuccess=function(data,textStatus,jqXHR){var pid=self.showPreview&&$thumb.attr('id')?$thumb.attr('id'):previewId;outData=self._getOutData(formdata,jqXHR,data);$.extend(true,params,outData);setTimeout(function(){if($h.isEmpty(data)||$h.isEmpty(data.error)){if(self.showPreview){self._setThumbStatus($thumb,'Success');$btnUpload.hide();self._initUploadSuccess(data,$thumb,isBatch);self._setProgress(101,$prog)}self._raise('fileuploaded',[outData,pid,i,self._getThumbFileId($thumb)]);if(!isBatch){self.fileManager.remove($thumb)}else{updateUploadLog();resolve()}}else{uploadFailed=true;errMsg=self._parseError(op,jqXHR,self.msgUploadError,self.fileManager.getFileName(id));self._showFileError(errMsg,params);self._setPreviewError($thumb,true);if(!self.retryErrorUploads){$btnUpload.hide()}if(isBatch){updateUploadLog();resolve()}self._setProgress(101,self._getFrame(pid).find('.file-thumb-progress'),self.msgUploadError)}},self.processDelay)};fnComplete=function(){if(self.showPreview){$btnUpload.removeAttr('disabled');$btnDelete.removeAttr('disabled');$thumb.removeClass('file-uploading')}if(!isBatch){self.unlock(false);self._clearFileInput()}else{chkComplete()}self._initSuccessThumbs()};fnError=function(jqXHR,textStatus,errorThrown){errMsg=self._parseError(op,jqXHR,errorThrown,self.fileManager.getFileName(id));uploadFailed=true;setTimeout(function(){var $prog;if(isBatch){updateUploadLog();reject()}self.fileManager.setProgress(id,100);self._setPreviewError($thumb,true);if(!self.retryErrorUploads){$btnUpload.hide()}$.extend(true,params,self._getOutData(formdata,jqXHR));self._setProgress(101,self.$progress,self.msgAjaxProgressError.replace('{operation}',op));$prog=self.showPreview&&$thumb?$thumb.find('.file-thumb-progress'):'';self._setProgress(101,$prog,self.msgUploadError);self._showFileError(errMsg,params)},self.processDelay)};self._setFileData(formdata,fileObj.file,fileName,id);self._setUploadData(formdata,{fileId:id});self._ajaxSubmit(fnBefore,fnSuccess,fnComplete,fnError,formdata,id,i)},_setFileData:function(formdata,file,fileName,fileId){var self=this,preProcess=self.preProcessUpload;if(preProcess&&typeof preProcess==='function'){formdata.append(self.uploadFileAttr,preProcess(fileId,file))}else{formdata.append(self.uploadFileAttr,file,fileName)}},_checkBatchPreupload:function(outData,jqXHR){var self=this,out=self._raise('filebatchpreupload',[outData]);if(out){return true}self._abort(outData);if(jqXHR){jqXHR.abort()}self._getThumbs().each(function(){var $thumb=$(this),$btnUpload=$thumb.find('.kv-file-upload'),$btnDelete=$thumb.find('.kv-file-remove');if($thumb.hasClass('file-preview-loading')){self._setThumbStatus($thumb,'New');$thumb.removeClass('file-uploading')}$btnUpload.removeAttr('disabled');$btnDelete.removeAttr('disabled')});self._setProgressCancelled();return false},_uploadBatch:function(){var self=this,fm=self.fileManager,total=fm.total(),params={},fnBefore,fnSuccess,fnError,fnComplete,hasPostData=total>0||!$.isEmptyObject(self.uploadExtraData),errMsg,setAllUploaded,formdata=new FormData(),op=self.ajaxOperations.uploadBatch;if(total===0||!hasPostData||self._abort(params)){return}setAllUploaded=function(){self.fileManager.clear();self._clearFileInput()};fnBefore=function(jqXHR){self.lock();fm.initStats();var outData=self._getOutData(formdata,jqXHR);self.ajaxAborted=false;if(self.showPreview){self._getThumbs().each(function(){var $thumb=$(this),$btnUpload=$thumb.find('.kv-file-upload'),$btnDelete=$thumb.find('.kv-file-remove');if(!$thumb.hasClass('file-preview-success')){self._setThumbStatus($thumb,'Loading');$h.addCss($thumb,'file-uploading')}$btnUpload.attr('disabled',true);$btnDelete.attr('disabled',true)})}self._checkBatchPreupload(outData,jqXHR)};fnSuccess=function(data,textStatus,jqXHR){var outData=self._getOutData(formdata,jqXHR,data),key=0,$thumbs=self._getThumbs(':not(.file-preview-success)'),keys=$h.isEmpty(data)||$h.isEmpty(data.errorkeys)?[]:data.errorkeys;if($h.isEmpty(data)||$h.isEmpty(data.error)){self._raise('filebatchuploadsuccess',[outData]);setAllUploaded();if(self.showPreview){$thumbs.each(function(){var $thumb=$(this);self._setThumbStatus($thumb,'Success');$thumb.removeClass('file-uploading');$thumb.find('.kv-file-upload').hide().removeAttr('disabled')});self._initUploadSuccess(data)}else{self.reset()}self._setProgress(101)}else{if(self.showPreview){$thumbs.each(function(){var $thumb=$(this);$thumb.removeClass('file-uploading');$thumb.find('.kv-file-upload').removeAttr('disabled');$thumb.find('.kv-file-remove').removeAttr('disabled');if(keys.length===0||$.inArray(key,keys)!==-1){self._setPreviewError($thumb,true);if(!self.retryErrorUploads){$thumb.find('.kv-file-upload').hide();self.fileManager.remove($thumb)}}else{$thumb.find('.kv-file-upload').hide();self._setThumbStatus($thumb,'Success');self.fileManager.remove($thumb)}if(!$thumb.hasClass('file-preview-error')||self.retryErrorUploads){key++}});self._initUploadSuccess(data)}errMsg=self._parseError(op,jqXHR,self.msgUploadError);self._showFileError(errMsg,outData,'filebatchuploaderror');self._setProgress(101,self.$progress,self.msgUploadError)}};fnComplete=function(){self.unlock();self._initSuccessThumbs();self._clearFileInput();self._raise('filebatchuploadcomplete',[self.fileManager.stack,self._getExtraData()])};fnError=function(jqXHR,textStatus,errorThrown){var outData=self._getOutData(formdata,jqXHR);errMsg=self._parseError(op,jqXHR,errorThrown);self._showFileError(errMsg,outData,'filebatchuploaderror');self.uploadFileCount=total-1;if(!self.showPreview){return}self._getThumbs().each(function(){var $thumb=$(this);$thumb.removeClass('file-uploading');if(self._getThumbFile($thumb)){self._setPreviewError($thumb)}});self._getThumbs().removeClass('file-uploading');self._getThumbs(' .kv-file-upload').removeAttr('disabled');self._getThumbs(' .kv-file-delete').removeAttr('disabled');self._setProgress(101,self.$progress,self.msgAjaxProgressError.replace('{operation}',op))};var ctr=0;$.each(self.fileManager.stack,function(key,data){if(!$h.isEmpty(data.file)){self._setFileData(formdata,data.file,(data.nameFmt||('untitled_'+ctr)),key)}ctr++});self._ajaxSubmit(fnBefore,fnSuccess,fnComplete,fnError,formdata)},_uploadExtraOnly:function(){var self=this,params={},fnBefore,fnSuccess,fnComplete,fnError,formdata=new FormData(),errMsg,op=self.ajaxOperations.uploadExtra;fnBefore=function(jqXHR){self.lock();var outData=self._getOutData(formdata,jqXHR);self._setProgress(50);params.data=outData;params.xhr=jqXHR;self._checkBatchPreupload(outData,jqXHR)};fnSuccess=function(data,textStatus,jqXHR){var outData=self._getOutData(formdata,jqXHR,data);if($h.isEmpty(data)||$h.isEmpty(data.error)){self._raise('filebatchuploadsuccess',[outData]);self._clearFileInput();self._initUploadSuccess(data);self._setProgress(101)}else{errMsg=self._parseError(op,jqXHR,self.msgUploadError);self._showFileError(errMsg,outData,'filebatchuploaderror')}};fnComplete=function(){self.unlock();self._clearFileInput();self._raise('filebatchuploadcomplete',[self.fileManager.stack,self._getExtraData()])};fnError=function(jqXHR,textStatus,errorThrown){var outData=self._getOutData(formdata,jqXHR);errMsg=self._parseError(op,jqXHR,errorThrown);params.data=outData;self._showFileError(errMsg,outData,'filebatchuploaderror');self._setProgress(101,self.$progress,self.msgAjaxProgressError.replace('{operation}',op))};self._ajaxSubmit(fnBefore,fnSuccess,fnComplete,fnError,formdata)},_deleteFileIndex:function($frame){var self=this,ind=$frame.attr('data-fileindex'),rev=self.reversePreviewOrder;if(ind.substring(0,5)===$h.INIT_FLAG){ind=parseInt(ind.replace($h.INIT_FLAG,''));self.initialPreview=$h.spliceArray(self.initialPreview,ind,rev);self.initialPreviewConfig=$h.spliceArray(self.initialPreviewConfig,ind,rev);self.initialPreviewThumbTags=$h.spliceArray(self.initialPreviewThumbTags,ind,rev);self.getFrames().each(function(){var $nFrame=$(this),nInd=$nFrame.attr('data-fileindex');if(nInd.substring(0,5)===$h.INIT_FLAG){nInd=parseInt(nInd.replace($h.INIT_FLAG,''));if(nInd>ind){nInd--;$nFrame.attr('data-fileindex',$h.INIT_FLAG+nInd)}}})}},_resetCaption:function(){var self=this;setTimeout(function(){var cap='',n,chk=self.previewCache.count(true),len=self.fileManager.count(),file,incomplete=':not(.file-preview-success):not(.file-preview-error)',cfg,hasThumb=self.showPreview&&self.getFrames(incomplete).length;if(len===0&&chk===0&&!hasThumb){self.reset()}else{n=chk+len;if(n>1){cap=self._getMsgSelected(n)}else{if(len===0){cfg=self.initialPreviewConfig[0];cap='';if(cfg){cap=cfg.caption||cfg.filename||''}if(!cap){cap=self._getMsgSelected(n)}}else{file=self.fileManager.getFirstFile();cap=file?file.nameFmt:'_'}}self._setCaption(cap)}},self.processDelay)},_handleRotation:function($el,$content,angle){var self=this,css,newCss,addCss='',scale=1,elContent=$content[0],quadrant,transform,h,w,wNew,$parent=$content.parent(),hParent,wParent,$body=$('body'),bodyExists=!!$body.length;if(bodyExists){$body.addClass('kv-overflow-hidden')}if(!$content.length||$el.hasClass('hide-rotate')){if(bodyExists){$body.removeClass('kv-overflow-hidden')}return}transform=$content.css('transform');if(transform){$content.css('transform','none')}if(transform){$content.css('transform',transform)}angle=angle||0;quadrant=angle%360;css='rotate('+angle+'deg)';newCss='rotate('+quadrant+'deg)';addCss='';if(quadrant===90||quadrant===270){w=elContent.naturalWidth||$content.outerWidth()||0;h=elContent.naturalHeight||$content.outerHeight()||0;scale=w>h&&w!=0?(h/w).toFixed(2):1;if($parent.length){hParent=$parent.height();wParent=$parent.width();wNew=Math.min(w,wParent);if(hParent>scale*wNew){scale=wNew>hParent&&wNew!=0?(hParent/wNew).toFixed(2):1}}if(scale!==1){addCss=' scale('+scale+')'}}$content.addClass('rotate-animate').css('transform',css+addCss);setTimeout(function(){$content.removeClass('rotate-animate').css('transform',newCss+addCss);if(bodyExists){$body.removeClass('kv-overflow-hidden')}$el.data('angle',quadrant)},self.fadeDelay)},_initRotateButton:function(){var self=this;self.getFrames('.rotatable .kv-file-rotate').each(function(){var $el=$(this),$frame=$el.closest($h.FRAMES),$content=$frame.find('.kv-file-content > :first-child');self._handler($el,'click',function(){var angle=($frame.data('angle')||0)+90;self._handleRotation($frame,$content,angle)})})},_initRotateZoom:function($frame,$content){var self=this,$modal=self.$modal,$rotate=$modal.find('.btn-kv-rotate'),angle=$frame.data('angle');$modal.data('angle',angle);if($rotate.length){$rotate.off('click');if($modal.hasClass('rotatable')){$rotate.on('click',function(){angle=($modal.data('angle')||0)+90;$modal.data('angle',angle);self._handleRotation($modal,$modal.find('.file-zoom-detail'),angle);self._handleRotation($frame,$content,angle);if($frame.hasClass('hide-rotate')){$frame.data('angle',angle)}})}}},_initFileActions:function(){var self=this;if(!self.showPreview){return}self._initZoomButton();self._initRotateButton();self.getFrames(' .kv-file-remove').each(function(){var $el=$(this),$frame=$el.closest($h.FRAMES),hasError,id=$frame.attr('id'),ind=$frame.attr('data-fileindex'),status,fm=self.fileManager;self._handler($el,'click',function(){status=self._raise('filepreremove',[id,ind]);if(status===false||!self._validateMinCount()){return false}hasError=$frame.hasClass('file-preview-error');$h.cleanMemory($frame);$frame.fadeOut('slow',function(){self.fileManager.remove($frame);self._clearObjects($frame);$frame.remove();if(id&&hasError){self.$errorContainer.find('li[data-thumb-id="'+id+'"]').fadeOut('fast',function(){$(this).remove();if(!self._errorsExist()){self._resetErrors()}})}self._clearFileInput();self._resetCaption();self._raise('fileremoved',[id,ind])})})});self.getFrames(' .kv-file-upload').each(function(){var $el=$(this);self._handler($el,'click',function(){var $frame=$el.closest($h.FRAMES),fileId=self._getThumbFileId($frame);self._hideProgress();if($frame.hasClass('file-preview-error')&&!self.retryErrorUploads){return}self._uploadSingle(self.fileManager.getIndex(fileId),fileId,false)})})},_initPreviewActions:function(){var self=this,$preview=self.$preview,deleteExtraData=self.deleteExtraData||{},btnRemove=$h.FRAMES+' .kv-file-remove',settings=self.fileActionSettings,origClass=settings.removeClass,errClass=settings.removeErrorClass,resetProgress=function(){var hasFiles=self.isAjaxUpload?self.previewCache.count(true):self._inputFileCount();if(!self.getFrames().length&&!hasFiles){self._setCaption('');self.reset();self.initialCaption=''}else{self._resetCaption()}};self._initZoomButton();self._initRotateButton();$preview.find(btnRemove).each(function(){var $el=$(this),vUrl=$el.data('url')||self.deleteUrl,vKey=$el.data('key'),errMsg,fnBefore,fnSuccess,fnError,op=self.ajaxOperations.deleteThumb;if($h.isEmpty(vUrl)||vKey===undefined){return}if(typeof vUrl==='function'){vUrl=vUrl()}var $frame=$el.closest($h.FRAMES),cache=self.previewCache.data,settings,params,config,fileName,extraData,index=$frame.attr('data-fileindex');index=parseInt(index.replace($h.INIT_FLAG,''));config=$h.isEmpty(cache.config)&&$h.isEmpty(cache.config[index])?null:cache.config[index];extraData=$h.isEmpty(config)||$h.isEmpty(config.extra)?deleteExtraData:config.extra;fileName=config&&(config.filename||config.caption)||'';if(typeof extraData==='function'){extraData=extraData()}params={id:$el.attr('id'),key:vKey,extra:extraData};fnBefore=function(jqXHR){self.ajaxAborted=false;self._raise('filepredelete',[vKey,jqXHR,extraData]);if(self._abort()){jqXHR.abort()}else{$el.removeClass(errClass);$h.addCss($frame,'file-uploading');$h.addCss($el,'disabled '+origClass)}};fnSuccess=function(data,textStatus,jqXHR){var n,cap;if(!$h.isEmpty(data)&&!$h.isEmpty(data.error)){params.jqXHR=jqXHR;params.response=data;errMsg=self._parseError(op,jqXHR,self.msgDeleteError,fileName);self._showFileError(errMsg,params,'filedeleteerror');$frame.removeClass('file-uploading');$el.removeClass('disabled '+origClass).addClass(errClass);resetProgress();return}$frame.removeClass('file-uploading').addClass('file-deleted');$frame.fadeOut('slow',function(){index=parseInt(($frame.attr('data-fileindex')).replace($h.INIT_FLAG,''));self.previewCache.unset(index);self._deleteFileIndex($frame);n=self.previewCache.count(true);cap=n>0?self._getMsgSelected(n):'';self._setCaption(cap);self._raise('filedeleted',[vKey,jqXHR,extraData]);self._clearObjects($frame);$frame.remove();resetProgress()})};fnError=function(jqXHR,textStatus,errorThrown){var errMsg=self._parseError(op,jqXHR,errorThrown,fileName);params.jqXHR=jqXHR;params.response={};self._showFileError(errMsg,params,'filedeleteerror');$frame.removeClass('file-uploading');$el.removeClass('disabled '+origClass).addClass(errClass);resetProgress()};self._initAjaxSettings();self._mergeAjaxCallback('beforeSend',fnBefore,'delete');self._mergeAjaxCallback('success',fnSuccess,'delete');self._mergeAjaxCallback('error',fnError,'delete');settings=$.extend(true,{},{url:self._encodeURI(vUrl),type:'POST',dataType:'json',data:$.extend(true,{},{key:vKey},extraData)},self._ajaxDeleteSettings);self._handler($el,'click',function(){if(!self._validateMinCount()){return false}self.ajaxAborted=false;self._raise('filebeforedelete',[vKey,extraData]);if(self.ajaxAborted instanceof Promise){self.ajaxAborted.then(function(result){if(!result){$.ajax(settings)}})}else{if(!self.ajaxAborted){$.ajax(settings)}}})})},_hideFileIcon:function(){var self=this;if(self.overwriteInitial){self.$captionContainer.removeClass('icon-visible')}},_showFileIcon:function(){var self=this;$h.addCss(self.$captionContainer,'icon-visible')},_getSize:function(bytes,skipTemplate,sizeUnits){var self=this,size=parseFloat(bytes),i=0,factor=self.bytesToKB,func=self.fileSizeGetter,out,sizeHuman=size,newSize;if(!$.isNumeric(bytes)||!$.isNumeric(size)){return''}if(typeof func==='function'){out=func(size)}else{if(!sizeUnits){sizeUnits=self.sizeUnits}if(size>0){while(sizeHuman>=factor){sizeHuman/=factor;++i}if(!sizeUnits[i]){sizeHuman=size;i=0}}newSize=sizeHuman.toFixed(2);if(newSize==sizeHuman){newSize=sizeHuman}out=newSize+' '+sizeUnits[i]}return skipTemplate?out:self._getLayoutTemplate('size').replace('{sizeText}',out)},_getFileType:function(ftype){var self=this;return self.mimeTypeAliases[ftype]||ftype},_generatePreviewTemplate:function(cat,data,fname,ftype,previewId,fileId,isError,size,fnameUpdated,frameClass,foot,ind,templ,attrs,zoomData){var self=this,caption=self.slug(fname),prevContent,zoomContent='',styleAttribs='',filename=fnameUpdated||fname,isIconic,ext=filename.split('.').pop().toLowerCase(),screenW=window.innerWidth||document.documentElement.clientWidth||document.body.clientWidth,config,title=caption,alt=caption,typeCss='type-default',getContent,addFrameCss,footer=foot||self._renderFileFooter(cat,caption,size,'auto',isError),isRotatable,alwaysPreview=$.inArray(ext,self.alwaysPreviewFileExtensions)!==-1,forcePrevIcon=self.preferIconicPreview&&!alwaysPreview,forceZoomIcon=self.preferIconicZoomPreview&&!alwaysPreview,newCat=forcePrevIcon?'other':cat;config=screenW<400?(self.previewSettingsSmall[newCat]||self.defaults.previewSettingsSmall[newCat]):(self.previewSettings[newCat]||self.defaults.previewSettings[newCat]);if(config){$.each(config,function(key,val){styleAttribs+=key+':'+val+';'})}getContent=function(vCat,vData,zoom,frameCss,vZoomData){var id=zoom?'zoom-'+previewId:previewId,tmplt=self._getPreviewTemplate(vCat),css=(frameClass||'')+' '+frameCss,tokens;if(self.frameClass){css=self.frameClass+' '+css}if(zoom){css=css.replace(' '+$h.SORT_CSS,'')}tmplt=self._parseFilePreviewIcon(tmplt,fname);if(cat==='object'&&!ftype){$.each(self.defaults.fileTypeSettings,function(key,func){if(key==='object'||key==='other'){return}if(func(fname,ftype)){typeCss='type-'+key}})}if(!$h.isEmpty(attrs)){if(attrs.title!==undefined&&attrs.title!==null){title=attrs.title}if(attrs.alt!==undefined&&attrs.alt!==null){alt=title=attrs.alt}}tokens={'previewId':id,'caption':caption,'title':title,'alt':alt,'frameClass':css,'type':self._getFileType(ftype),'fileindex':ind,'fileid':fileId||'','filename':filename,'typeCss':typeCss,'footer':footer,'data':vData,'template':templ||cat,'style':styleAttribs?'style="'+styleAttribs+'"':'','zoomData':vZoomData?encodeURIComponent(vZoomData):''};if(zoom){tokens.zoomCache='';tokens.zoomData='{zoomData}'}return tmplt.setTokens(tokens)};ind=ind||previewId.slice(previewId.lastIndexOf('-')+1);isRotatable=self.fileActionSettings.showRotate&&$.inArray(ext,self.rotatableFileExtensions)!==-1;if(self.fileActionSettings.showZoom){addFrameCss='kv-zoom-thumb';if(isRotatable){addFrameCss+=' rotatable'+(forceZoomIcon?' hide-rotate':'')}zoomContent=getContent((forceZoomIcon?'other':cat),data,true,addFrameCss,zoomData)}zoomContent='\n'+self._getLayoutTemplate('zoomCache').replace('{zoomContent}',zoomContent);if(typeof self.sanitizeZoomCache==='function'){zoomContent=self.sanitizeZoomCache(zoomContent)}addFrameCss='kv-preview-thumb';if(isRotatable){isIconic=forcePrevIcon||self.hideThumbnailContent||!!self.previewFileIconSettings[ext];addFrameCss+=' rotatable'+(isIconic?' hide-rotate':'')}prevContent=getContent((forcePrevIcon?'other':cat),data,false,addFrameCss,zoomData);return prevContent.setTokens({zoomCache:zoomContent})},_addToPreview:function($preview,content){var self=this,$el;content=$h.cspBuffer.stash(content);$el=self.reversePreviewOrder?$preview.prepend(content):$preview.append(content);$h.cspBuffer.apply($preview);return $el},_previewDefault:function(file,isDisabled){var self=this,$preview=self.$preview;if(!self.showPreview){return}var fname=$h.getFileName(file),ftype=file?file.type:'',content,size=file.size||0,caption=self._getFileName(file,''),isError=isDisabled===true&&!self.isAjaxUpload,data=$h.createObjectURL(file),fileId=self.fileManager.getId(file),previewId=self._getThumbId(fileId);self._clearDefaultPreview();content=self._generatePreviewTemplate('other',data,fname,ftype,previewId,fileId,isError,size);self._addToPreview($preview,content);self._setThumbAttr(previewId,caption,size);if(isDisabled===true&&self.isAjaxUpload){self._setThumbStatus(self._getFrame(previewId),'Error')}},_previewFile:function(i,file,theFile,data,fileInfo){if(!this.showPreview){return}var self=this,fname=$h.getFileName(file),ftype=fileInfo.type,content,caption=fileInfo.name,cat=self._parseFileType(ftype,fname),$preview=self.$preview,fsize=file.size||0,iData=cat==='image'?theFile.target.result:data,fm=self.fileManager,fileId=fm.getId(file),previewId=self._getThumbId(fileId);content=self._generatePreviewTemplate(cat,iData,fname,ftype,previewId,fileId,false,fsize,fileInfo.filename);self._clearDefaultPreview();self._addToPreview($preview,content);var $thumb=self._getFrame(previewId);self._validateImageOrientation($thumb.find('img'),file,previewId,fileId,caption,ftype,fsize,iData);self._setThumbAttr(previewId,caption,fsize);self._initSortable()},_setThumbAttr:function(id,caption,size,description){var self=this,$frame=self._getFrame(id);if($frame.length){size=size&&size>0?self._getSize(size):'';$frame.data({'caption':caption,'size':size,'description':description||''})}},_setInitThumbAttr:function(){var self=this,data=self.previewCache.data,len=self.previewCache.count(true),config,caption,size,description,previewId;if(len===0){return}for(var i=0;i&"']/g,'_')},_updateFileDetails:function(numFiles){var self=this,$el=self.$element,label,n,log,nFiles,file,name=($h.isIE(9)&&$h.findFileName($el.val()))||($el[0].files[0]&&$el[0].files[0].name);if(!name&&self.fileManager.count()>0){file=self.fileManager.getFirstFile();label=file.nameFmt}else{label=name?self.slug(name):'_'}n=self.isAjaxUpload?self.fileManager.count():numFiles;nFiles=self.previewCache.count(true)+n;log=n===1?label:self._getMsgSelected(nFiles,!self.isAjaxUpload&&!self.isError);if(self.isError){self.$previewContainer.removeClass('file-thumb-loading');self._initCapStatus();self.$previewStatus.html('');self.$captionContainer.removeClass('icon-visible')}else{self._showFileIcon()}self._setCaption(log,self.isError);self.$container.removeClass('file-input-new file-input-ajax-new');self._raise('fileselect',[numFiles,label]);if(self.previewCache.count(true)){self._initPreviewActions()}},_setThumbStatus:function($thumb,status){var self=this;if(!self.showPreview){return}var icon='indicator'+status,msg=icon+'Title',css='file-preview-'+status.toLowerCase(),$indicator=$thumb.find('.file-upload-indicator'),config=self.fileActionSettings;$thumb.removeClass('file-preview-success file-preview-error file-preview-paused file-preview-loading');if(status==='Success'){$thumb.find('.file-drag-handle').remove()}$h.setHtml($indicator,config[icon]);$indicator.attr('title',config[msg]);$thumb.addClass(css);if(status==='Error'&&!self.retryErrorUploads){$thumb.find('.kv-file-upload').attr('disabled',true)}},_setProgressCancelled:function(){var self=this;self._setProgress(101,self.$progress,self.msgCancelled)},_setProgress:function(p,$el,error,stats){var self=this;$el=$el||self.$progress;if(!$el.length){return}var pct=Math.min(p,100),out,pctLimit=self.progressUploadThreshold,t=p<=100?self.progressTemplate:self.progressCompleteTemplate,template=pct<100?self.progressTemplate:(error?(self.paused?self.progressPauseTemplate:self.progressErrorTemplate):t);if(p>=100){stats=''}if(!$h.isEmpty(template)){if(pctLimit&&pct>pctLimit&&p<=100){out=template.setTokens({'percent':pctLimit,'status':self.msgUploadThreshold})}else{out=template.setTokens({'percent':pct,'status':(p>100?self.msgUploadEnd:pct+'%')})}stats=stats||'';out=out.setTokens({stats:stats});$h.setHtml($el,out);if(error){$h.setHtml($el.find('[role="progressbar"]'),error)}}},_hasFiles:function(){var el=this.$element[0];return!!(el&&el.files&&el.files.length)},_setFileDropZoneTitle:function(){var self=this,$zone=self.$container.find('.file-drop-zone'),title=self.dropZoneTitle,strFiles;if(self.isClickable){strFiles=$h.isEmpty(self.$element.attr('multiple'))?self.fileSingle:self.filePlural;title+=self.dropZoneClickTitle.replace('{files}',strFiles)}$zone.find('.'+self.dropZoneTitleClass).remove();if(!self.showPreview||$zone.length===0||self.fileManager.count()>0||!self.dropZoneEnabled||self.previewCache.count()>0||(!self.isAjaxUpload&&self._hasFiles())){return}if($zone.find($h.FRAMES).length===0&&$h.isEmpty(self.defaultPreviewContent)){$zone.prepend('
    '+title+'
    ')}self.$container.removeClass('file-input-new');$h.addCss(self.$container,'file-input-ajax-new')},_getStats:function(stats){var self=this,pendingTime,t;if(!self.showUploadStats||!stats||!stats.bitrate){return''}t=self._getLayoutTemplate('stats');pendingTime=(!stats.elapsed||!stats.bps)?self.msgCalculatingTime:self.msgPendingTime.setTokens({time:$h.getElapsed(Math.ceil(stats.pendingBytes/stats.bps))});return t.setTokens({uploadSpeed:stats.bitrate,pendingTime:pendingTime})},_setResumableProgress:function(pct,stats,$thumb){var self=this,rm=self.resumableManager,obj=$thumb?rm:self,$prog=$thumb?$thumb.find('.file-thumb-progress'):null;if(obj.lastProgress===0){obj.lastProgress=pct}if(pct0&&self._getFileCount(len-1)=limit:dim<=limit){return true}msg=self['msgImage'+type+size]||'Image "{name}" has a size validation error (limit "{size}").';self._showFileError(msg.setTokens({'name':filename,'size':limit,'dimension':dim}),params);self._setPreviewError($thumb);self.fileManager.remove($thumb);self._clearFileInput();return false},_getExifObj:function(data){var self=this,exifObj,error=$h.logMessages.exifWarning;if(data.slice(0,23)!=='data:image/jpeg;base64,'&&data.slice(0,22)!=='data:image/jpg;base64,'){exifObj=null;return}try{exifObj=window.piexif?window.piexif.load(data):null}catch(err){exifObj=null;error=err&&err.message||''}if(!exifObj&&self.showExifErrorLog){self._log($h.logMessages.badExifParser,{details:error})}return exifObj},setImageOrientation:function($img,$zoomImg,value,$thumb){var self=this,invalidImg=!$img||!$img.length,invalidZoomImg=!$zoomImg||!$zoomImg.length,$mark,isHidden=false,$div,zoomOnly=invalidImg&&$thumb&&$thumb.attr('data-template')==='image',ev;if(invalidImg&&invalidZoomImg){return}ev='load.fileinputimageorient';if(zoomOnly){$img=$zoomImg;$zoomImg=null;$img.css(self.previewSettings.image);$div=$(document.createElement('div')).appendTo($thumb.find('.kv-file-content'));$mark=$(document.createElement('span')).insertBefore($img);$img.css('visibility','hidden').removeClass('file-zoom-detail').appendTo($div)}else{isHidden=!$img.is(':visible')}$img.off(ev).on(ev,function(){if(isHidden){self.$preview.removeClass('hide-content');$thumb.find('.kv-file-content').css('visibility','hidden')}var img=$img[0],zoomImg=$zoomImg&&$zoomImg.length?$zoomImg[0]:null,h=img.offsetHeight,w=img.offsetWidth,r=$h.getRotation(value);if(isHidden){$thumb.find('.kv-file-content').css('visibility','visible');self.$preview.addClass('hide-content')}$img.data('orientation',value);if(zoomImg){$zoomImg.data('orientation',value)}if(value<5){$h.setTransform(img,r);$h.setTransform(zoomImg,r);return}var offsetAngle=Math.atan(w/h),origFactor=Math.sqrt(Math.pow(h,2)+Math.pow(w,2)),scale=!origFactor?1:(h/Math.cos(Math.PI/2+offsetAngle))/origFactor,s=' scale('+Math.abs(scale)+')';$h.setTransform(img,r+s);$h.setTransform(zoomImg,r+s);if(zoomOnly){$img.css('visibility','visible').insertAfter($mark).addClass('file-zoom-detail');$mark.remove();$div.remove()}})},_validateImageOrientation:function($img,file,previewId,fileId,caption,ftype,fsize,iData){var self=this,exifObj=null,value,autoOrientImage=self.autoOrientImage,selector;exifObj=self._getExifObj(iData);if(self.canOrientImage){$img.css('image-orientation',(autoOrientImage?'from-image':'none'));self._validateImage(previewId,fileId,caption,ftype,fsize,iData,exifObj);return}selector=$h.getZoomSelector(previewId,' img');value=exifObj?exifObj['0th'][piexif.ImageIFD.Orientation]:null;if(!value){self._validateImage(previewId,fileId,caption,ftype,fsize,iData,exifObj);return}self.setImageOrientation($img,$(selector),value,self._getFrame(previewId));self._raise('fileimageoriented',{'$img':$img,'file':file});self._validateImage(previewId,fileId,caption,ftype,fsize,iData,exifObj)},_validateImage:function(previewId,fileId,fname,ftype,fsize,iData,exifObj){var self=this,$preview=self.$preview,params,w1,w2,$thumb=self._getFrame(previewId),i=$thumb.attr('data-fileindex'),$img=$thumb.find('img');fname=fname||'Untitled';$img.one('load',function(){if($img.data('validated')){return}$img.data('validated',true);w1=$thumb.width();w2=$preview.width();if(w1>w2){$img.css('width','100%')}params={ind:i,id:previewId,fileId:fileId};setTimeout(function(){var isValidWidth,isValidHeight;isValidWidth=self._isValidSize('Small','Width',$img,$thumb,fname,params);isValidHeight=self._isValidSize('Small','Height',$img,$thumb,fname,params);if(!self.resizeImage){isValidWidth=isValidWidth&&self._isValidSize('Large','Width',$img,$thumb,fname,params);isValidHeight=isValidHeight&&self._isValidSize('Large','Height',$img,$thumb,fname,params)}self._raise('fileimageloaded',[previewId]);$thumb.data('exif',exifObj);if(isValidWidth&&isValidHeight){self.fileManager.addImage(fileId,{ind:i,img:$img,thumb:$thumb,pid:previewId,typ:ftype,siz:fsize,validated:false,imgData:iData,exifObj:exifObj});self._validateAllImages()}},self.processDelay)}).one('error',function(){self._raise('fileimageloaderror',[previewId])})},_validateAllImages:function(){var self=this,counter={val:0},numImgs=self.fileManager.getImageCount(),fsize,minSize=self.resizeIfSizeMoreThan;if(numImgs!==self.fileManager.totalImages){return}self._raise('fileimagesloaded');if(!self.resizeImage){return}$.each(self.fileManager.loadedImages,function(id,config){if(!config.validated){fsize=config.siz;if(fsize&&fsize>minSize*self.bytesToKB){self._getResizedImage(id,config,counter,numImgs)}config.validated=true}})},_getResizedImage:function(id,config,counter,numImgs){var self=this,img=$(config.img)[0],width=img.naturalWidth,height=img.naturalHeight,blob,ratio=1,maxWidth=self.maxImageWidth||width,maxHeight=self.maxImageHeight||height,isValidImage=!!(width&&height),chkWidth,chkHeight,canvas=self.imageCanvas,dataURI,context=self.imageCanvasContext,type=config.typ,pid=config.pid,ind=config.ind,$thumb=config.thumb,throwError,msg,exifObj=config.exifObj,exifStr,file,params,evParams;throwError=function(msg,params,ev){if(self.isAjaxUpload){self._showFileError(msg,params,ev);}else{self._showError(msg,params,ev)}self._setPreviewError($thumb)};file=self.fileManager.getFile(id);params={id:pid,'index':ind,fileId:id};evParams=[id,pid,ind];if(!file||!isValidImage||(width<=maxWidth&&height<=maxHeight)){if(isValidImage&&file){self._raise('fileimageresized',evParams)}counter.val++;if(counter.val===numImgs){self._raise('fileimagesresized')}if(!isValidImage){throwError(self.msgImageResizeError,params,'fileimageresizeerror');return}}type=type||self.resizeDefaultImageType;chkWidth=width>maxWidth;chkHeight=height>maxHeight;if(self.resizePreference==='width'){ratio=chkWidth?maxWidth/width:(chkHeight?maxHeight/height:1)}else{ratio=chkHeight?maxHeight/height:(chkWidth?maxWidth/width:1)}self._resetCanvas();width*=ratio;height*=ratio;canvas.width=width;canvas.height=height;try{context.drawImage(img,0,0,width,height);dataURI=canvas.toDataURL(type,self.resizeQuality);if(exifObj){exifStr=window.piexif.dump(exifObj);dataURI=window.piexif.insert(exifStr,dataURI)}blob=$h.dataURI2Blob(dataURI);self.fileManager.setFile(id,blob);self._raise('fileimageresized',evParams);counter.val++;if(counter.val===numImgs){self._raise('fileimagesresized',[undefined,undefined])}if(!(blob instanceof Blob)){throwError(self.msgImageResizeError,params,'fileimageresizeerror');}}catch(err){counter.val++;if(counter.val===numImgs){self._raise('fileimagesresized',[undefined,undefined])}msg=self.msgImageResizeException.replace('{errors}',err.message);throwError(msg,params,'fileimageresizeexception');}},_showProgress:function(){var self=this;if(self.$progress&&self.$progress.length){self.$progress.show()}},_hideProgress:function(){var self=this;if(self.$progress&&self.$progress.length){self.$progress.hide()}},_initBrowse:function($container){var self=this,$el=self.$element;if(self.showBrowse){self.$btnFile=$container.find('.btn-file').append($el)}else{$el.appendTo($container).attr('tabindex',-1);$h.addCss($el,'file-no-browse')}},_initClickable:function(){var self=this,$zone,$tmpZone;if(!self.isClickable){return}$zone=self.$dropZone;if(!self.isAjaxUpload){$tmpZone=self.$preview.find('.file-default-preview');if($tmpZone.length){$zone=$tmpZone}}$h.addCss($zone,'clickable');$zone.attr('tabindex',-1);self._handler($zone,'click',function(e){var $tar=$(e.target);if(!self.$errorContainer.is(':visible')&&(!$tar.parents('.file-preview-thumbnails').length||$tar.parents('.file-default-preview').length)){self.$element.data('zoneClicked',true).trigger('click');$zone.blur()}})},_initCaption:function(){var self=this,cap=self.initialCaption||'';if(self.overwriteInitial||$h.isEmpty(cap)){self.$caption.val('');return false}self._setCaption(cap);return true},_setCaption:function(content,isError){var self=this,title,out,icon,n,cap,file;if(!self.$caption.length){return}self.$captionContainer.removeClass('icon-visible');if(isError){title=$('
    '+self.msgValidationError+'
    ').text();n=self.fileManager.count();if(n){file=self.fileManager.getFirstFile();cap=n===1&&file?file.nameFmt:self._getMsgSelected(n)}else{cap=self._getMsgSelected(self.msgNo)}out=$h.isEmpty(content)?cap:content;icon=''+self.msgValidationErrorIcon+''}else{if($h.isEmpty(content)){self.$caption.attr('title','');return}title=$('
    '+content+'
    ').text();out=title;icon=self._getLayoutTemplate('fileIcon')}self.$captionContainer.addClass('icon-visible');self.$caption.attr('title',title).val(out);$h.setHtml(self.$captionIcon,icon)},_createContainer:function(){var self=this,attribs={'class':'file-input file-input-new'+(self.rtl?' kv-rtl':'')},$container=$h.createElement($h.cspBuffer.stash(self._renderMain()));$h.cspBuffer.apply($container);$container.insertBefore(self.$element).attr(attribs);self._initBrowse($container);if(self.theme){$container.addClass('theme-'+self.theme)}return $container},_refreshContainer:function(){var self=this,$container=self.$container,$el=self.$element;$el.insertAfter($container);$h.setHtml($container,self._renderMain());self._initBrowse($container);self._validateDisabled()},_validateDisabled:function(){var self=this;self.$caption.attr({readonly:self.isDisabled})},_setTabIndex:function(type,html){var self=this,index=self.tabIndexConfig[type];return html.setTokens({tabIndexConfig:index===undefined||index===null?'':'tabindex="'+index+'"'})},_renderMain:function(){var self=this,dropCss=self.dropZoneEnabled?' file-drop-zone':'file-drop-disabled',close=!self.showClose?'':self._getLayoutTemplate('close'),preview=!self.showPreview?'':self._getLayoutTemplate('preview').setTokens({'class':self.previewClass,'dropClass':dropCss}),css=self.isDisabled?self.captionClass+' file-caption-disabled':self.captionClass,caption=self.captionTemplate.setTokens({'class':css+' kv-fileinput-caption'});caption=self._setTabIndex('caption',caption);return self.mainTemplate.setTokens({'class':self.mainClass+(!self.showBrowse&&self.showCaption?' no-browse':''),'inputGroupClass':self.inputGroupClass,'preview':preview,'close':close,'caption':caption,'upload':self._renderButton('upload'),'remove':self._renderButton('remove'),'cancel':self._renderButton('cancel'),'pause':self._renderButton('pause'),'browse':self._renderButton('browse')})},_renderButton:function(type){var self=this,tmplt=self._getLayoutTemplate('btnDefault'),css=self[type+'Class'],title=self[type+'Title'],icon=self[type+'Icon'],label=self[type+'Label'],status=self.isDisabled?' disabled':'',btnType='button';switch(type){case'remove':if(!self.showRemove){return''}break;case'cancel':if(!self.showCancel){return''}css+=' kv-hidden';break;case'pause':if(!self.showPause){return''}css+=' kv-hidden';break;case'upload':if(!self.showUpload){return''}if(self.isAjaxUpload&&!self.isDisabled){tmplt=self._getLayoutTemplate('btnLink').replace('{href}',self.uploadUrl)}else{btnType='submit'}break;case'browse':if(!self.showBrowse){return''}tmplt=self._getLayoutTemplate('btnBrowse');break;default:return''}tmplt=self._setTabIndex(type,tmplt);css+=type==='browse'?' btn-file':' fileinput-'+type+' fileinput-'+type+'-button';if(!$h.isEmpty(label)){label=' '+label+''}return tmplt.setTokens({'type':btnType,'css':css,'title':title,'status':status,'icon':icon,'label':label})},_renderThumbProgress:function(){var self=this;return'
    '+self.progressInfoTemplate.setTokens({percent:101,status:self.msgUploadBegin,stats:''})+'
    '},_renderFileFooter:function(cat,caption,size,width,isError){var self=this,config=self.fileActionSettings,rem=config.showRemove,drg=config.showDrag,upl=config.showUpload,rot=config.showRotate,zoom=config.showZoom,out,params,template=self._getLayoutTemplate('footer'),tInd=self._getLayoutTemplate('indicator'),ind=isError?config.indicatorError:config.indicatorNew,title=isError?config.indicatorErrorTitle:config.indicatorNewTitle,indicator=tInd.setTokens({'indicator':ind,'indicatorTitle':title});size=self._getSize(size);params={type:cat,caption:caption,size:size,width:width,progress:'',indicator:indicator};if(self.isAjaxUpload){params.progress=self._renderThumbProgress();params.actions=self._renderFileActions(params,upl,false,rem,rot,zoom,drg,false,false,false)}else{params.actions=self._renderFileActions(params,false,false,false,false,zoom,drg,false,false,false)}out=template.setTokens(params);out=$h.replaceTags(out,self.previewThumbTags);return out},_renderFileActions:function(cfg,showUpl,showDwn,showDel,showRot,showZoom,showDrag,disabled,url,key,isInit,dUrl,dFile){var self=this;if(!cfg.type&&isInit){cfg.type='image'}if(self.enableResumableUpload){showUpl=false}else{if(typeof showUpl==='function'){showUpl=showUpl(cfg)}}if(typeof showDwn==='function'){showDwn=showDwn(cfg)}if(typeof showDel==='function'){showDel=showDel(cfg)}if(typeof showZoom==='function'){showZoom=showZoom(cfg)}if(typeof showDrag==='function'){showDrag=showDrag(cfg)}if(typeof showRot==='function'){showRot=showRot(cfg)}if(!showUpl&&!showDwn&&!showDel&&!showRot&&!showZoom&&!showDrag){return''}var vUrl=url===false?'':' data-url="'+url+'"',btnZoom='',btnDrag='',btnRotate='',css,vKey=key===false?'':' data-key="'+key+'"',btnDelete='',btnUpload='',btnDownload='',template=self._getLayoutTemplate('actions'),config=self.fileActionSettings,otherButtons=self.otherActionButtons.setTokens({'dataKey':vKey,'key':key}),removeClass=disabled?config.removeClass+' disabled':config.removeClass;if(showDel){btnDelete=self._getLayoutTemplate('actionDelete').setTokens({'removeClass':removeClass,'removeIcon':config.removeIcon,'removeTitle':config.removeTitle,'dataUrl':vUrl,'dataKey':vKey,'key':key})}if(showRot){btnRotate=self._getLayoutTemplate('actionRotate').setTokens({'rotateClass':config.rotateClass,'rotateIcon':config.rotateIcon,'rotateTitle':config.rotateTitle})}if(showUpl){btnUpload=self._getLayoutTemplate('actionUpload').setTokens({'uploadClass':config.uploadClass,'uploadIcon':config.uploadIcon,'uploadTitle':config.uploadTitle})}if(showDwn){btnDownload=self._getLayoutTemplate('actionDownload').setTokens({'downloadClass':config.downloadClass,'downloadIcon':config.downloadIcon,'downloadTitle':config.downloadTitle,'downloadUrl':dUrl||self.initialPreviewDownloadUrl});btnDownload=btnDownload.setTokens({'filename':dFile,'key':key})}if(showZoom){btnZoom=self._getLayoutTemplate('actionZoom').setTokens({'zoomClass':config.zoomClass,'zoomIcon':config.zoomIcon,'zoomTitle':config.zoomTitle})}if(showDrag&&isInit){css='drag-handle-init '+config.dragClass;btnDrag=self._getLayoutTemplate('actionDrag').setTokens({'dragClass':css,'dragTitle':config.dragTitle,'dragIcon':config.dragIcon})}return template.setTokens({'delete':btnDelete,'upload':btnUpload,'download':btnDownload,'rotate':btnRotate,'zoom':btnZoom,'drag':btnDrag,'other':otherButtons})},_browse:function(e){var self=this;if(e&&e.isDefaultPrevented()||!self._raise('filebrowse')){return}if(self.isError&&!self.isAjaxUpload){self.clear()}if(self.focusCaptionOnBrowse){self.$captionContainer.focus()}},_change:function(e){var self=this;$(document.body).off('focusin.fileinput focusout.fileinput');if(self.changeTriggered){self._toggleLoading('hide');return}self._toggleLoading('show');var $el=self.$element,isDragDrop=arguments.length>1,isAjaxUpload=self.isAjaxUpload,tfiles,files=isDragDrop?arguments[1]:$el[0].files,ctr=self.fileManager.count(),total,initCount,len,isSingleUpl=$h.isEmpty($el.attr('multiple')),maxCount=!isAjaxUpload&&isSingleUpl?1:self.maxFileCount,maxTotCount=self.maxTotalFileCount,inclAll=maxTotCount>0&&maxTotCount>maxCount,flagSingle=(isSingleUpl&&ctr>0),throwError=function(mesg,file,previewId,index){var p1=$.extend(true,{},self._getOutData(null,{},{},files),{id:previewId,index:index}),p2={id:previewId,index:index,file:file,files:files};self.isPersistentError=true;self._toggleLoading('hide');return isAjaxUpload?self._showFileError(mesg,p1):self._showError(mesg,p2)},maxCountCheck=function(n,m,all){var msg=all?self.msgTotalFilesTooMany:self.msgFilesTooMany;msg=msg.replace('{m}',m).replace('{n}',n);self.isError=throwError(msg,null,null,null);self.$captionContainer.removeClass('icon-visible');self._setCaption('',true);self.$container.removeClass('file-input-new file-input-ajax-new')};self.reader=null;self._resetUpload();self._hideFileIcon();if(self.dropZoneEnabled){self.$container.find('.file-drop-zone .'+self.dropZoneTitleClass).remove()}if(!isAjaxUpload){if(e.target&&e.target.files===undefined){files=e.target.value?[{name:e.target.value.replace(/^.+\\/,'')}]:[]}else{files=e.target.files||{}}}tfiles=files;if($h.isEmpty(tfiles)||tfiles.length===0){if(!isAjaxUpload){self.clear()}self._raise('fileselectnone');return}self._resetErrors();len=tfiles.length;initCount=isAjaxUpload?(self.fileManager.count()+len):len;total=self._getFileCount(initCount,inclAll?false:undefined);if(maxCount>0&&total>maxCount){if(!self.autoReplace||len>maxCount){maxCountCheck((self.autoReplace&&len>maxCount?len:total),maxCount);return}if(total>maxCount){self._resetPreviewThumbs(isAjaxUpload)}}else{if(inclAll){total=self._getFileCount(initCount,true);if(maxTotCount>0&&total>maxTotCount){if(!self.autoReplace||len>maxCount){maxCountCheck((self.autoReplace&&len>maxTotCount?len:total),maxTotCount,true);return}if(total>maxCount){self._resetPreviewThumbs(isAjaxUpload)}}}if(!isAjaxUpload||flagSingle){self._resetPreviewThumbs(false);if(flagSingle){self.clearFileStack()}}else{if(isAjaxUpload&&ctr===0&&(!self.previewCache.count(true)||self.overwriteInitial)){self._resetPreviewThumbs(true)}}}if(self.autoReplace){self._getThumbs().each(function(){var $thumb=$(this);if($thumb.hasClass('file-preview-success')||$thumb.hasClass('file-preview-error')){$thumb.remove()}})}self.readFiles(tfiles);self._toggleLoading('hide')},_abort:function(params){var self=this,data;if(self.ajaxAborted&&typeof self.ajaxAborted==='object'&&self.ajaxAborted.message!==undefined){data=$.extend(true,{},self._getOutData(null),params);data.abortData=self.ajaxAborted.data||{};data.abortMessage=self.ajaxAborted.message;self._setProgress(101,self.$progress,self.msgCancelled);self._showFileError(self.ajaxAborted.message,data,'filecustomerror');self.cancel();self.unlock();return true}return!!self.ajaxAborted},_resetFileStack:function(){var self=this,i=0;self._getThumbs().each(function(){var $thumb=$(this),ind=$thumb.attr('data-fileindex'),pid=$thumb.attr('id');if(ind==='-1'||ind===-1){return}if(!self._getThumbFile($thumb)){$thumb.attr({'data-fileindex':i});i++}else{$thumb.attr({'data-fileindex':'-1'})}self._getZoom(pid).attr({'data-fileindex':$thumb.attr('data-fileindex')})})},_isFileSelectionValid:function(cnt){var self=this;cnt=cnt||0;if(self.required&&!self.getFilesCount()){self.$errorContainer.html('');self._showFileError(self.msgFileRequired);return false}if(self.minFileCount>0&&self._getFileCount(cnt)maxSize);return!skipPreview&&(allowedTypes||allowedMimes||allowedExts)},addToStack:function(file,id){var self=this;self.stackIsUpdating=true;self.fileManager.add(file,id);self._refreshPreview();self.stackIsUpdating=false},clearFileStack:function(){var self=this;self.fileManager.clear();self._initResumableUpload();if(self.enableResumableUpload){if(self.showPause===null){self.showPause=true}if(self.showCancel===null){self.showCancel=false}}else{self.showPause=false;if(self.showCancel===null){self.showCancel=true}}return self.$element},getFileStack:function(){return this.fileManager.stack},getFileList:function(){return this.fileManager.list()},getFilesSize:function(){return this.fileManager.getTotalSize()},getFilesCount:function(includeInitial){var self=this,len=self.isAjaxUpload?self.fileManager.count():self._inputFileCount();if(includeInitial){len+=self.previewCache.count(true)}return self._getFileCount(len)},_initCapStatus:function(status){var self=this,$cap=self.$caption;$cap.removeClass('is-valid file-processing');if(!status){return}if(status==='processing'){$cap.addClass('file-processing')}else{$cap.addClass('is-valid')}},_toggleLoading:function(type){var self=this;self.$previewStatus.html(type==='hide'?'':self.msgProcessing);self.$container.removeClass('file-thumb-loading');self._initCapStatus(type==='hide'?'':'processing');if(type!=='hide'){if(self.dropZoneEnabled){self.$container.find('.file-drop-zone .'+self.dropZoneTitleClass).remove()}self.$container.addClass('file-thumb-loading')}},_initFileSelected:function(){var self=this,$el=self.$element,$body=$(document.body),ev='focusin.fileinput focusout.fileinput';if($body.length){$body.off(ev).on('focusout.fileinput',function(){self._toggleLoading('show')}).on('focusin.fileinput',function(){setTimeout(function(){if(!$el.val()){self._setFileDropZoneTitle()}$body.off(ev);self._toggleLoading('hide')},2500)})}else{self._toggleLoading('hide')}},readFiles:function(files){this.reader=new FileReader();var self=this,reader=self.reader,$container=self.$previewContainer,$status=self.$previewStatus,msgLoading=self.msgLoading,msgProgress=self.msgProgress,previewInitId=self.previewInitId,numFiles=files.length,settings=self.fileTypeSettings,readFile,fileTypes=self.allowedFileTypes,typLen=fileTypes?fileTypes.length:0,fileExt=self.allowedFileExtensions,strExt=$h.isEmpty(fileExt)?'':fileExt.join(', '),throwError=function(msg,file,previewId,index,fileId){var $thumb,p1=$.extend(true,{},self._getOutData(null,{},{},files),{id:previewId,index:index,fileId:fileId}),p2={id:previewId,index:index,fileId:fileId,file:file,files:files};self._previewDefault(file,true);$thumb=self._getFrame(previewId,true);self._toggleLoading('hide');if(self.isAjaxUpload){setTimeout(function(){readFile(index+1)},self.processDelay)}else{self.unlock();numFiles=0}if(self.removeFromPreviewOnError&&$thumb.length){$thumb.remove()}else{self._initFileActions();$thumb.find('.kv-file-upload').remove()}self.isPersistentError=true;self.isError=self.isAjaxUpload?self._showFileError(msg,p1):self._showError(msg,p2);self._updateFileDetails(numFiles)};self.fileManager.clearImages();$.each(files,function(key,file){var func=self.fileTypeSettings.image;if(func&&func(file.type)){self.fileManager.totalImages++}});readFile=function(i){var $error=self.$errorContainer,errors,fm=self.fileManager;if(i>=numFiles){self.unlock();if(self.duplicateErrors.length){errors='
  • '+self.duplicateErrors.join('
  • ')+'
  • ';if($error.find('ul').length===0){$h.setHtml($error,self.errorCloseButton+'
      '+errors+'
    ')}else{$error.find('ul').append(errors)}$error.fadeIn(self.fadeDelay);self._handler($error.find('.kv-error-close'),'click',function(){$error.fadeOut(self.fadeDelay)});self.duplicateErrors=[]}if(self.isAjaxUpload){self._raise('filebatchselected',[fm.stack]);if(fm.count()===0&&!self.isError){self.reset()}}else{self._raise('filebatchselected',[files])}$container.removeClass('file-thumb-loading');self._initCapStatus('valid');$status.html('');return}self.lock(true);var file=files[i],id,previewId,fileProcessed,fSize=(file&&file.size||0),sizeHuman=self._getSize(fSize,true),j,msg,fnImage=settings.image,chk,typ,typ1,typ2,caption,fileSize=fSize/self.bytesToKB,fileExtExpr='',previewData,fileCount=0,strTypes='',fileId,canLoad,fileReaderAborted=false,func,knownTypes=0,isImage,processFileLoaded,initFileData;initFileData=function(dataSource){dataSource=dataSource||file;id=fileId=self._getFileId(file);previewId=previewInitId+'-'+id;previewData=$h.createObjectURL(dataSource);caption=self._getFileName(file,'')};processFileLoaded=function(){var isImageResized=!!fm.loadedImages[id],msg=msgProgress.setTokens({'index':i+1,'files':numFiles,'percent':50,'name':caption});setTimeout(function(){$status.html(msg);self._updateFileDetails(numFiles);if(self.getFilesCount(true)>0&&self.getFrames(':visible')){self.$dropZone.find('.'+self.dropZoneTitleClass).remove()}readFile(i+1)},self.processDelay);if(self._raise('fileloaded',[file,previewId,id,i,reader])&&self.isAjaxUpload){if(!isImageResized){fm.add(file)}}else{if(isImageResized){fm.removeFile(id)}}};if(!file){return}initFileData();if(typLen>0){for(j=0;j0&&fileSize>self.maxFileSize){msg=self.msgSizeTooLarge.setTokens({'name':caption,'size':sizeHuman,'maxSize':self._getSize(self.maxFileSize*self.bytesToKB,true)});throwError(msg,file,previewId,i,fileId);return}if(self.minFileSize!==null&&fileSize<=$h.getNum(self.minFileSize)){msg=self.msgSizeTooSmall.setTokens({'name':caption,'size':sizeHuman,'minSize':self._getSize(self.minFileSize*self.bytesToKB,true)});throwError(msg,file,previewId,i,fileId);return}if(!$h.isEmpty(fileTypes)&&$h.isArray(fileTypes)){for(j=0;j0){for(i=0;i0){for(i=0;i0)?self.initialCaption:'';self.$caption.attr('title','').val(cap);$h.addCss(self.$container,'file-input-new');self._validateDefaultPreview()}if(self.$container.find($h.FRAMES).length===0){if(!self._initCaption()){self.$captionContainer.removeClass('icon-visible')}}self._hideFileIcon();if(self.focusCaptionOnClear){self.$captionContainer.focus()}self._setFileDropZoneTitle();self._raise('filecleared');return self.$element},reset:function(){var self=this;if(!self._raise('filereset')){return}self.lastProgress=0;self._resetPreview();self.$container.find('.fileinput-filename').text('');$h.addCss(self.$container,'file-input-new');if(self.getFrames().length){self.$container.removeClass('file-input-new')}self.clearFileStack();self._setFileDropZoneTitle();return self.$element},disable:function(){var self=this,$container=self.$container;self.isDisabled=true;self._raise('filedisabled');self.$element.attr('disabled','disabled');$container.addClass('is-locked');$h.addCss($container.find('.btn-file'),'disabled');$container.find('.kv-fileinput-caption').addClass('file-caption-disabled');$container.find('.fileinput-remove, .fileinput-upload, .file-preview-frame button').attr('disabled',true);self._initDragDrop();return self.$element},enable:function(){var self=this,$container=self.$container;self.isDisabled=false;self._raise('fileenabled');self.$element.removeAttr('disabled');$container.removeClass('is-locked');$container.find('.kv-fileinput-caption').removeClass('file-caption-disabled');$container.find('.fileinput-remove, .fileinput-upload, .file-preview-frame button').removeAttr('disabled');$container.find('.btn-file').removeClass('disabled');self._initDragDrop();return self.$element},upload:function(){var self=this,fm=self.fileManager,totLen=fm.count(),i,outData,tm=self.taskManager,hasExtraData=!$.isEmptyObject(self._getExtraData());fm.bpsLog=[];fm.bps=0;if(!self.isAjaxUpload||self.isDisabled||!self._isFileSelectionValid(totLen)){return}self.lastProgress=0;self._resetUpload();if(totLen===0&&!hasExtraData){self._showFileError(self.msgUploadEmpty);return}self.cancelling=false;self.uploadInitiated=true;self._showProgress();self.lock();if(totLen===0&&hasExtraData){self._setProgress(2);self._uploadExtraOnly();return}if(self.enableResumableUpload){return self.resume()}if(self.uploadAsync||self.enableResumableUpload){outData=self._getOutData(null);if(!self._checkBatchPreupload(outData)){return}self.fileBatchCompleted=false;self.uploadCache=[];$.each(self.getFileStack(),function(id){var previewId=self._getThumbId(id);self.uploadCache.push({id:previewId,content:null,config:null,tags:null,append:true})});self.$preview.find('.file-preview-initial').removeClass($h.SORT_CSS);self._initSortable()}self._setProgress(2);self.hasInitData=false;if(self.uploadAsync){i=0;var pool=self.ajaxPool=tm.addPool($h.uniqId());$.each(self.getFileStack(),function(id){pool.addTask(id+i,function(deferrer){self._uploadSingle(i,id,true,deferrer)});i++});pool.run(self.maxAjaxThreads).done(function(){self._log('Async upload batch completed successfully.');self._raise('filebatchuploadsuccess',[fm.stack,self._getExtraData()])}).fail(function(){self._log('Async upload batch completed with errors.');self._raise('filebatchuploaderror',[fm.stack,self._getExtraData()])});return}self._uploadBatch();return self.$element},destroy:function(){var self=this,$form=self.$form,$cont=self.$container,$el=self.$element,ns=self.namespace;$(document).off(ns);$(window).off(ns);if($form&&$form.length){$form.off(ns)}if(self.isAjaxUpload){self._clearFileInput()}self._cleanup();self._initPreviewCache();$el.insertBefore($cont).off(ns).removeData();$cont.off().remove();return $el},refresh:function(options){var self=this,$el=self.$element;if(typeof options!=='object'||$h.isEmpty(options)){options=self.options}else{options=$.extend(true,{},self.options,options)}self._init(options,true);self._listen();return $el},zoom:function(frameId){var self=this,$frame=self._getFrame(frameId);self._showModal($frame)},getExif:function(frameId){var self=this,$frame=self._getFrame(frameId);return $frame&&$frame.data('exif')||null},getFrames:function(cssFilter){var self=this,$frames;cssFilter=cssFilter||'';$frames=self.$preview.find($h.FRAMES+cssFilter);if(self.reversePreviewOrder){$frames=$($frames.get().reverse())}return $frames},getPreview:function(){var self=this;return{content:self.initialPreview,config:self.initialPreviewConfig,tags:self.initialPreviewThumbTags}}};$.fn.fileinput=function(option){if(!$h.hasFileAPISupport()&&!$h.isIE(9)){return}var args=Array.apply(null,arguments),retvals=[];args.shift();this.each(function(){var self=$(this),data=self.data('fileinput'),options=typeof option==='object'&&option,theme=options.theme||self.data('theme'),l={},t={},lang=options.language||self.data('language')||$.fn.fileinput.defaults.language||'en',opt;if(!data){if(theme){t=$.fn.fileinputThemes[theme]||{}}if(lang!=='en'&&!$h.isEmpty($.fn.fileinputLocales[lang])){l=$.fn.fileinputLocales[lang]||{}}opt=$.extend(true,{},$.fn.fileinput.defaults,t,$.fn.fileinputLocales.en,l,options,self.data());data=new FileInput(this,opt);self.data('fileinput',data)}if(typeof option==='string'){retvals.push(data[option].apply(data,args))}});switch(retvals.length){case 0:return this;case 1:return retvals[0];default:return retvals}};var IFRAME_ATTRIBS='class="kv-preview-data file-preview-pdf" src="{renderer}?file={data}" {style}',defBtnCss1='btn btn-sm btn-kv '+$h.defaultButtonCss(),defBtnCss2='btn '+$h.defaultButtonCss();$.fn.fileinput.defaults={language:'zh',bytesToKB:1024,showCaption:true,showBrowse:true,showPreview:true,showRemove:true,showUpload:true,showUploadStats:true,showCancel:null,showPause:null,showClose:true,showUploadedThumbs:true,showConsoleLogs:false,browseOnZoneClick:false,autoReplace:false,showDescriptionClose:true,autoOrientImage:function(){var ua=window.navigator.userAgent,webkit=!!ua.match(/WebKit/i),iOS=!!ua.match(/iP(od|ad|hone)/i),iOSSafari=iOS&&webkit&&!ua.match(/CriOS/i);return!iOSSafari},autoOrientImageInitial:true,showExifErrorLog:false,required:false,rtl:false,hideThumbnailContent:false,encodeUrl:true,focusCaptionOnBrowse:true,focusCaptionOnClear:true,generateFileId:null,previewClass:'',captionClass:'',frameClass:'krajee-default',mainClass:'',inputGroupClass:'',mainTemplate:null,fileSizeGetter:null,initialCaption:'',initialPreview:[],initialPreviewDelimiter:'*$$*',initialPreviewAsData:false,initialPreviewFileType:'image',initialPreviewConfig:[],initialPreviewThumbTags:[],previewThumbTags:{},initialPreviewShowDelete:true,initialPreviewDownloadUrl:'',removeFromPreviewOnError:false,deleteUrl:'',deleteExtraData:{},overwriteInitial:true,sanitizeZoomCache:function(content){var $container=$h.createElement(content);$container.find('input,textarea,select,datalist,form,.file-thumbnail-footer').remove();return $container.html()},previewZoomButtonIcons:{prev:'',next:'',toggleheader:'',fullscreen:'',borderless:'',close:''},previewZoomButtonClasses:{prev:'btn btn-default btn-outline-secondary btn-navigate',next:'btn btn-default btn-outline-secondary btn-navigate',rotate:defBtnCss1,toggleheader:defBtnCss1,fullscreen:defBtnCss1,borderless:defBtnCss1,close:defBtnCss1},previewTemplates:{},previewContentTemplates:{},preferIconicPreview:false,preferIconicZoomPreview:false,alwaysPreviewFileExtensions:[],rotatableFileExtensions:['jpg','jpeg','png','gif'],allowedFileTypes:null,allowedFileExtensions:null,allowedPreviewTypes:undefined,allowedPreviewMimeTypes:null,allowedPreviewExtensions:null,disabledPreviewTypes:undefined,disabledPreviewExtensions:['msi','exe','com','zip','rar','app','vb','scr'],disabledPreviewMimeTypes:null,defaultPreviewContent:null,customLayoutTags:{},customPreviewTags:{},previewFileIcon:'',previewFileIconClass:'file-other-icon',previewFileIconSettings:{},previewFileExtSettings:{},buttonLabelClass:'hidden-xs',browseIcon:' ',browseClass:'btn btn-primary',removeIcon:'',removeClass:defBtnCss2,cancelIcon:'',cancelClass:defBtnCss2,pauseIcon:'',pauseClass:defBtnCss2,uploadIcon:'',uploadClass:defBtnCss2,uploadUrl:null,uploadUrlThumb:null,uploadAsync:true,uploadParamNames:{chunkCount:'chunkCount',chunkIndex:'chunkIndex',chunkSize:'chunkSize',chunkSizeStart:'chunkSizeStart',chunksUploaded:'chunksUploaded',fileBlob:'fileBlob',fileId:'fileId',fileName:'fileName',fileRelativePath:'fileRelativePath',fileSize:'fileSize',retryCount:'retryCount'},maxAjaxThreads:5,fadeDelay:800,processDelay:100,bitrateUpdateDelay:500,queueDelay:10,progressDelay:0,enableResumableUpload:false,resumableUploadOptions:{fallback:null,testUrl:null,chunkSize:2048,maxThreads:4,maxRetries:3,showErrorLog:true,retainErrorHistory:false,skipErrorsAndProceed:false},uploadExtraData:{},zoomModalHeight:485,minImageWidth:null,minImageHeight:null,maxImageWidth:null,maxImageHeight:null,resizeImage:false,resizePreference:'width',resizeQuality:0.92,resizeDefaultImageType:'image/jpeg',resizeIfSizeMoreThan:0,minFileSize:-1,maxFileSize:0,maxFilePreviewSize:25600,minFileCount:0,maxFileCount:0,maxTotalFileCount:0,validateInitialCount:false,msgValidationErrorClass:'text-danger',msgValidationErrorIcon:' ',msgErrorClass:'file-error-message',progressThumbClass:'progress-bar progress-bar-striped active progress-bar-animated',progressClass:'progress-bar bg-success progress-bar-success progress-bar-striped active progress-bar-animated',progressInfoClass:'progress-bar bg-info progress-bar-info progress-bar-striped active progress-bar-animated',progressCompleteClass:'progress-bar bg-success progress-bar-success',progressPauseClass:'progress-bar bg-primary progress-bar-primary progress-bar-striped active progress-bar-animated',progressErrorClass:'progress-bar bg-danger progress-bar-danger',progressUploadThreshold:99,previewFileType:'image',elCaptionContainer:null,elCaptionText:null,elPreviewContainer:null,elPreviewImage:null,elPreviewStatus:null,elErrorContainer:null,errorCloseButton:undefined,slugCallback:null,dropZoneEnabled:true,dropZoneTitleClass:'file-drop-zone-title',fileActionSettings:{},otherActionButtons:'',textEncoding:'UTF-8',preProcessUpload:null,ajaxSettings:{},ajaxDeleteSettings:{},showAjaxErrorDetails:true,mergeAjaxCallbacks:false,mergeAjaxDeleteCallbacks:false,retryErrorUploads:true,reversePreviewOrder:false,usePdfRenderer:function(){var isIE11=!!window.MSInputMethodContext&&!!document.documentMode;return!!navigator.userAgent.match(/(iPod|iPhone|iPad|Android)/i)||isIE11},pdfRendererUrl:'',pdfRendererTemplate:'',tabIndexConfig:{browse:500,remove:500,upload:500,cancel:null,pause:null,modal:-1}};$.fn.fileinputLocales.en={sizeUnits:['B','KB','MB','GB','TB','PB','EB','ZB','YB'],bitRateUnits:['B/s','KB/s','MB/s','GB/s','TB/s','PB/s','EB/s','ZB/s','YB/s'],fileSingle:'file',filePlural:'files',browseLabel:'Browse …',removeLabel:'Remove',removeTitle:'Clear all unprocessed files',cancelLabel:'Cancel',cancelTitle:'Abort ongoing upload',pauseLabel:'Pause',pauseTitle:'Pause ongoing upload',uploadLabel:'Upload',uploadTitle:'Upload selected files',msgNo:'No',msgNoFilesSelected:'No files selected',msgCancelled:'Cancelled',msgPaused:'Paused',msgPlaceholder:'Select {files} ...',msgZoomModalHeading:'Detailed Preview',msgFileRequired:'You must select a file to upload.',msgSizeTooSmall:'File "{name}" ({size}) is too small and must be larger than {minSize}.',msgSizeTooLarge:'File "{name}" ({size}) exceeds maximum allowed upload size of {maxSize}.',msgFilesTooLess:'You must select at least {n} {files} to upload.',msgFilesTooMany:'Number of files selected for upload ({n}) exceeds maximum allowed limit of {m}.',msgTotalFilesTooMany:'You can upload a maximum of {m} files ({n} files detected).',msgFileNotFound:'File "{name}" not found!',msgFileSecured:'Security restrictions prevent reading the file "{name}".',msgFileNotReadable:'File "{name}" is not readable.',msgFilePreviewAborted:'File preview aborted for "{name}".',msgFilePreviewError:'An error occurred while reading the file "{name}".',msgInvalidFileName:'Invalid or unsupported characters in file name "{name}".',msgInvalidFileType:'Invalid type for file "{name}". Only "{types}" files are supported.',msgInvalidFileExtension:'Invalid extension for file "{name}". Only "{extensions}" files are supported.',msgFileTypes:{'image':'image','html':'HTML','text':'text','video':'video','audio':'audio','flash':'flash','pdf':'PDF','object':'object'},msgUploadAborted:'The file upload was aborted',msgUploadThreshold:'Processing …',msgUploadBegin:'Initializing …',msgUploadEnd:'Done',msgUploadResume:'Resuming upload …',msgUploadEmpty:'No valid data available for upload.',msgUploadError:'Upload Error',msgDeleteError:'Delete Error',msgProgressError:'Error',msgValidationError:'Validation Error',msgLoading:'Loading file {index} of {files} …',msgProgress:'Loading file {index} of {files} - {name} - {percent}% completed.',msgSelected:'{n} {files} selected',msgProcessing:'Processing ...',msgFoldersNotAllowed:'Drag & drop files only! {n} folder(s) dropped were skipped.',msgImageWidthSmall:'Width of image file "{name}" must be at least {size} px (detected {dimension} px).',msgImageHeightSmall:'Height of image file "{name}" must be at least {size} px (detected {dimension} px).',msgImageWidthLarge:'Width of image file "{name}" cannot exceed {size} px (detected {dimension} px).',msgImageHeightLarge:'Height of image file "{name}" cannot exceed {size} px (detected {dimension} px).',msgImageResizeError:'Could not get the image dimensions to resize.',msgImageResizeException:'Error while resizing the image.
    {errors}
    ',msgAjaxError:'Something went wrong with the {operation} operation. Please try again later!',msgAjaxProgressError:'{operation} failed',msgDuplicateFile:'File "{name}" of same size "{size}" has already been selected earlier. Skipping duplicate selection.',msgResumableUploadRetriesExceeded:'Upload aborted beyond {max} retries for file {file}! Error Details:
    {error}
    ',msgPendingTime:'{time} remaining',msgCalculatingTime:'calculating time remaining',ajaxOperations:{deleteThumb:'file delete',uploadThumb:'file upload',uploadBatch:'batch file upload',uploadExtra:'form data upload'},dropZoneTitle:'Drag & drop files here …',dropZoneClickTitle:'
    (or click to select {files})',previewZoomButtonTitles:{prev:'View previous file',next:'View next file',rotate:'Rotate 90 deg. clockwise',toggleheader:'Toggle header',fullscreen:'Toggle full screen',borderless:'Toggle borderless mode',close:'Close detailed preview'}};$.fn.fileinputLocales.zh={sizeUnits:['B','KB','MB','GB','TB','PB','EB','ZB','YB'],bitRateUnits:['B/s','KB/s','MB/s','GB/s','TB/s','PB/s','EB/s','ZB/s','YB/s'],fileSingle:'文件',filePlural:'个文件',browseLabel:'选择 …',removeLabel:'移除',removeTitle:'清除选中文件',cancelLabel:'取消',cancelTitle:'取消进行中的上传',pauseLabel:'暂停',pauseTitle:'暂停上传',uploadLabel:'上传',uploadTitle:'上传选中文件',msgNo:'没有',msgNoFilesSelected:'未选择文件',msgPaused:'已暂停',msgCancelled:'取消',msgPlaceholder:'选择 {files} ...',msgZoomModalHeading:'详细预览',msgFileRequired:'必须选择一个文件上传.',msgSizeTooSmall:'文件 "{name}" ({size}) 必须大于限定大小 {minSize}.',msgSizeTooLarge:'文件 "{name}" ({size}) 超过了允许大小 {maxSize}.',msgFilesTooLess:'你必须选择最少 {n} {files} 来上传. ',msgFilesTooMany:'选择的上传文件个数 ({n}) 超出最大文件的限制个数 {m}.',msgTotalFilesTooMany:'你最多可以上传 {m} 个文件 (当前有{n} 个文件).',msgFileNotFound:'文件 "{name}" 未找到!',msgFileSecured:'安全限制,为了防止读取文件 "{name}".',msgFileNotReadable:'文件 "{name}" 不可读.',msgFilePreviewAborted:'取消 "{name}" 的预览.',msgFilePreviewError:'读取 "{name}" 时出现了一个错误.',msgInvalidFileName:'文件名 "{name}" 包含非法字符.',msgInvalidFileType:'不正确的类型 "{name}". 只支持 "{types}" 类型的文件.',msgInvalidFileExtension:'不正确的文件扩展名 "{name}". 只支持 "{extensions}" 的文件扩展名.',msgFileTypes:{'image':'image','html':'HTML','text':'text','video':'video','audio':'audio','flash':'flash','pdf':'PDF','object':'object'},msgUploadAborted:'该文件上传被中止',msgUploadThreshold:'处理中 …',msgUploadBegin:'正在初始化 …',msgUploadEnd:'完成',msgUploadResume:'继续上传 …',msgUploadEmpty:'无效的文件上传.',msgUploadError:'上传出错',msgDeleteError:'删除出错',msgProgressError:'上传出错',msgValidationError:'验证错误',msgLoading:'加载第 {index} 文件 共 {files} …',msgProgress:'加载第 {index} 文件 共 {files} - {name} - {percent}% 完成.',msgSelected:'{n} {files} 选中',msgProcessing:'处理中 ...',msgFoldersNotAllowed:'只支持拖拽文件! 跳过 {n} 拖拽的文件夹.',msgImageWidthSmall:'图像文件的"{name}"的宽度必须是至少{size}像素.',msgImageHeightSmall:'图像文件的"{name}"的高度必须至少为{size}像素.',msgImageWidthLarge:'图像文件"{name}"的宽度不能超过{size}像素.',msgImageHeightLarge:'图像文件"{name}"的高度不能超过{size}像素.',msgImageResizeError:'无法获取的图像尺寸调整。',msgImageResizeException:'调整图像大小时发生错误。
    {errors}
    ',msgAjaxError:'{operation} 发生错误. 请重试!',msgAjaxProgressError:'{operation} 失败',msgDuplicateFile:'文件 "{name}",大小 "{size}" 已经被选中.忽略相同的文件.',msgResumableUploadRetriesExceeded:'文件 {file} 上传失败超过 {max} 次重试 ! 错误详情:
    {error}
    ',msgPendingTime:'{time} 剩余',msgCalculatingTime:'计算剩余时间',ajaxOperations:{deleteThumb:'删除文件',uploadThumb:'上传文件',uploadBatch:'批量上传',uploadExtra:'表单数据上传'},dropZoneTitle:'拖拽文件到这里 …
    支持多文件同时上传',dropZoneClickTitle:'
    (或点击{files}按钮选择文件)',fileActionSettings:{removeTitle:'删除文件',uploadTitle:'上传文件',downloadTitle:'下载文件',uploadRetryTitle:'重试',rotateTitle:'顺时针旋转90度',zoomTitle:'查看详情',dragTitle:'移动 / 重置',indicatorNewTitle:'没有上传',indicatorSuccessTitle:'上传',indicatorErrorTitle:'上传错误',indicatorPausedTitle:'上传已暂停',indicatorLoadingTitle:'上传 …'},previewZoomButtonTitles:{prev:'预览上一个文件',next:'预览下一个文件',rotate:'顺时针旋转90度',toggleheader:'缩放',fullscreen:'全屏',borderless:'无边界模式',close:'关闭当前预览'}};$.fn.fileinput.Constructor=FileInput;$(document).ready(function(){var $input=$('input.file[type=file]');if($input.length){$input.fileinput()}})})); \ No newline at end of file diff --git a/src/main/resources/static/ajax/libs/bootstrap-table/bootstrap-table.min.js b/src/main/resources/static/ajax/libs/bootstrap-table/bootstrap-table.min.js index f7e0b862a..8c9bd202f 100644 --- a/src/main/resources/static/ajax/libs/bootstrap-table/bootstrap-table.min.js +++ b/src/main/resources/static/ajax/libs/bootstrap-table/bootstrap-table.min.js @@ -1,6 +1,6 @@ /** - * @author zhixin wen - * version: 1.19.1 + * @author zhixin wen + * version: 1.22.6 * https://github.com/wenzhixin/bootstrap-table/ */ -function getRememberRowIds(t,e){return $.isArray(t)?props=$.map(t,function(t){return t[e]}):props=[t[e]],props}function addRememberRow(t,e){var i=null==table.options.uniqueId?table.options.columns[1].field:table.options.uniqueId,n=getRememberRowIds(t,i);-1==$.inArray(e[i],n)&&(t[t.length]=e)}function removeRememberRow(t,e){var i=null==table.options.uniqueId?table.options.columns[1].field:table.options.uniqueId,n=getRememberRowIds(t,i),o=$.inArray(e[i],n);-1!=o&&t.splice(o,1)}!function(t,e){"object"==typeof exports&&"undefined"!=typeof module?module.exports=e(require("jquery")):"function"==typeof define&&define.amd?define(["jquery"],e):(t="undefined"!=typeof globalThis?globalThis:t||self,t.BootstrapTable=e(t.jQuery))}(this,function(t){function e(t){return t&&"object"==typeof t&&"default" in t?t:{"default":t}}function i(t){return(i="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function n(t,e){if(!(t instanceof e)){throw new TypeError("Cannot call a class as a function")}}function o(t,e){for(var i=0;it.length)&&(e=t.length);for(var i=0,n=Array(e);e>i;i++){n[i]=t[i]}return n}function p(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}function g(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}function v(t,e){var i;if("undefined"==typeof Symbol||null==t[Symbol.iterator]){if(Array.isArray(t)||(i=d(t))||e&&t&&"number"==typeof t.length){i&&(t=i);var n=0,o=function(){};return{s:o,n:function(){return n>=t.length?{done:!0}:{done:!1,value:t[n++]}},e:function(t){throw t},f:o}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var a,s=!0,r=!1;return{s:function(){i=t[Symbol.iterator]()},n:function(){var t=i.next();return s=t.done,t},e:function(t){r=!0,a=t},f:function(){try{s||null==i["return"]||i["return"]()}finally{if(r){throw a}}}}}function b(t,e){return e={exports:{}},t(e,e.exports),e.exports}function m(t,e){return RegExp(t,e)}var y=e(t),w="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{},S=function(t){return t&&t.Math==Math&&t},x=S("object"==typeof globalThis&&globalThis)||S("object"==typeof window&&window)||S("object"==typeof self&&self)||S("object"==typeof w&&w)||function(){return this}()||Function("return this")(),k=function(t){try{return !!t()}catch(e){return !0}},O=!k(function(){return 7!=Object.defineProperty({},1,{get:function(){return 7}})[1]}),T={}.propertyIsEnumerable,C=Object.getOwnPropertyDescriptor,P=C&&!T.call({1:2},1),I=P?function(t){var e=C(this,t);return !!e&&e.enumerable}:T,A={f:I},$=function(t,e){return{enumerable:!(1&t),configurable:!(2&t),writable:!(4&t),value:e}},R={}.toString,E=function(t){return R.call(t).slice(8,-1)},j="".split,_=k(function(){return !Object("z").propertyIsEnumerable(0)})?function(t){return"String"==E(t)?j.call(t,""):Object(t)}:Object,N=function(t){if(void 0==t){throw TypeError("Can't call method on "+t)}return t},F=function(t){return _(N(t))},D=function(t){return"object"==typeof t?null!==t:"function"==typeof t},V=function(t,e){if(!D(t)){return t}var i,n;if(e&&"function"==typeof(i=t.toString)&&!D(n=i.call(t))){return n}if("function"==typeof(i=t.valueOf)&&!D(n=i.call(t))){return n}if(!e&&"function"==typeof(i=t.toString)&&!D(n=i.call(t))){return n}throw TypeError("Can't convert object to primitive value")},B={}.hasOwnProperty,L=function(t,e){return B.call(t,e)},H=x.document,M=D(H)&&D(H.createElement),U=function(t){return M?H.createElement(t):{}},q=!O&&!k(function(){return 7!=Object.defineProperty(U("div"),"a",{get:function(){return 7}}).a}),z=Object.getOwnPropertyDescriptor,W=O?z:function(t,e){if(t=F(t),e=V(e,!0),q){try{return z(t,e)}catch(i){}}return L(t,e)?$(!A.f.call(t,e),t[e]):void 0},G={f:W},K=function(t){if(!D(t)){throw TypeError(t+" is not an object")}return t},Y=Object.defineProperty,X=O?Y:function(t,e,i){if(K(t),e=V(e,!0),K(i),q){try{return Y(t,e,i)}catch(n){}}if("get" in i||"set" in i){throw TypeError("Accessors not supported")}return"value" in i&&(t[e]=i.value),t},J={f:X},Q=O?function(t,e,i){return J.f(t,e,$(1,i))}:function(t,e,i){return t[e]=i,t},Z=function(t,e){try{Q(x,t,e)}catch(i){x[t]=e}return e},tt="__core-js_shared__",et=x[tt]||Z(tt,{}),it=et,nt=Function.toString;"function"!=typeof it.inspectSource&&(it.inspectSource=function(t){return nt.call(t)});var ot,at,st,rt=it.inspectSource,lt=x.WeakMap,ct="function"==typeof lt&&/native code/.test(rt(lt)),ht=b(function(t){(t.exports=function(t,e){return it[t]||(it[t]=void 0!==e?e:{})})("versions",[]).push({version:"3.10.1",mode:"global",copyright:"© 2021 Denis Pushkarev (zloirock.ru)"})}),ut=0,dt=Math.random(),ft=function(t){return"Symbol("+((void 0===t?"":t)+"")+")_"+(++ut+dt).toString(36)},pt=ht("keys"),gt=function(t){return pt[t]||(pt[t]=ft(t))},vt={},bt=x.WeakMap,mt=function(t){return st(t)?at(t):ot(t,{})},yt=function(t){return function(e){var i;if(!D(e)||(i=at(e)).type!==t){throw TypeError("Incompatible receiver, "+t+" required")}return i}};if(ct){var wt=it.state||(it.state=new bt),St=wt.get,xt=wt.has,kt=wt.set;ot=function(t,e){return e.facade=t,kt.call(wt,t,e),e},at=function(t){return St.call(wt,t)||{}},st=function(t){return xt.call(wt,t)}}else{var Ot=gt("state");vt[Ot]=!0,ot=function(t,e){return e.facade=t,Q(t,Ot,e),e},at=function(t){return L(t,Ot)?t[Ot]:{}},st=function(t){return L(t,Ot)}}var Tt={set:ot,get:at,has:st,enforce:mt,getterFor:yt},Ct=b(function(t){var e=Tt.get,i=Tt.enforce,n=(String+"").split("String");(t.exports=function(t,e,o,a){var s,r=a?!!a.unsafe:!1,l=a?!!a.enumerable:!1,c=a?!!a.noTargetGet:!1;return"function"==typeof o&&("string"!=typeof e||L(o,"name")||Q(o,"name",e),s=i(o),s.source||(s.source=n.join("string"==typeof e?e:""))),t===x?void (l?t[e]=o:Z(e,o)):(r?!c&&t[e]&&(l=!0):delete t[e],void (l?t[e]=o:Q(t,e,o)))})(Function.prototype,"toString",function(){return"function"==typeof this&&e(this).source||rt(this)})}),Pt=x,It=function(t){return"function"==typeof t?t:void 0},At=function(t,e){return arguments.length<2?It(Pt[t])||It(x[t]):Pt[t]&&Pt[t][e]||x[t]&&x[t][e]},$t=Math.ceil,Rt=Math.floor,Et=function(t){return isNaN(t=+t)?0:(t>0?Rt:$t)(t)},jt=Math.min,_t=function(t){return t>0?jt(Et(t),9007199254740991):0},Nt=Math.max,Ft=Math.min,Dt=function(t,e){var i=Et(t);return 0>i?Nt(i+e,0):Ft(i,e)},Vt=function(t){return function(e,i,n){var o,a=F(e),s=_t(a.length),r=Dt(n,s);if(t&&i!=i){for(;s>r;){if(o=a[r++],o!=o){return !0}}}else{for(;s>r;r++){if((t||r in a)&&a[r]===i){return t||r||0}}}return !t&&-1}},Bt={includes:Vt(!0),indexOf:Vt(!1)},Lt=Bt.indexOf,Ht=function(t,e){var i,n=F(t),o=0,a=[];for(i in n){!L(vt,i)&&L(n,i)&&a.push(i)}for(;e.length>o;){L(n,i=e[o++])&&(~Lt(a,i)||a.push(i))}return a},Mt=["constructor","hasOwnProperty","isPrototypeOf","propertyIsEnumerable","toLocaleString","toString","valueOf"],Ut=Mt.concat("length","prototype"),qt=Object.getOwnPropertyNames||function(t){return Ht(t,Ut)},zt={f:qt},Wt=Object.getOwnPropertySymbols,Gt={f:Wt},Kt=At("Reflect","ownKeys")||function(t){var e=zt.f(K(t)),i=Gt.f;return i?e.concat(i(t)):e},Yt=function(t,e){for(var i=Kt(e),n=J.f,o=G.f,a=0;a0&&(!a.multiline||a.multiline&&"\n"!==t[a.lastIndex-1])&&(l="(?: "+l+")",h=" "+h,c++),i=RegExp("^(?:"+l+")",r)),Pe&&(i=RegExp("^"+l+"$(?!\\s)",r)),Te&&(e=a.lastIndex),n=xe.call(s?i:a,h),s?n?(n.input=n.input.slice(c),n[0]=n[0].slice(c),n.index=a.lastIndex,a.lastIndex+=n[0].length):a.lastIndex=0:Te&&n&&(a.lastIndex=a.global?n.index+n[0].length:e),Pe&&n&&n.length>1&&ke.call(n[0],i,function(){for(o=1;o=74)&&($e=je.match(/Chrome\/(\d+)/),$e&&(Re=$e[1])));var De=Re&&+Re,Ve=!!Object.getOwnPropertySymbols&&!k(function(){return !Symbol.sham&&(Ee?38===De:De>37&&41>De)}),Be=Ve&&!Symbol.sham&&"symbol"==typeof Symbol.iterator,Le=ht("wks"),He=x.Symbol,Me=Be?He:He&&He.withoutSetter||ft,Ue=function(t){return(!L(Le,t)||!Ve&&"string"!=typeof Le[t])&&(Ve&&L(He,t)?Le[t]=He[t]:Le[t]=Me("Symbol."+t)),Le[t]},qe=Ue("species"),ze=!k(function(){var t=/./;return t.exec=function(){var t=[];return t.groups={a:"7"},t},"7"!=="".replace(t,"$")}),We=function(){return"$0"==="a".replace(/./,"$0")}(),Ge=Ue("replace"),Ke=function(){return/./[Ge]?""===/./[Ge]("a","$0"):!1}(),Ye=!k(function(){var t=/(?:)/,e=t.exec;t.exec=function(){return e.apply(this,arguments)};var i="ab".split(t);return 2!==i.length||"a"!==i[0]||"b"!==i[1]}),Xe=function(t,e,i,n){var o=Ue(t),a=!k(function(){var e={};return e[o]=function(){return 7},7!=""[t](e)}),s=a&&!k(function(){var e=!1,i=/a/;return"split"===t&&(i={},i.constructor={},i.constructor[qe]=function(){return i},i.flags="",i[o]=/./[o]),i.exec=function(){return e=!0,null},i[o](""),!e});if(!a||!s||"replace"===t&&(!ze||!We||Ke)||"split"===t&&!Ye){var r=/./[o],l=i(o,""[t],function(t,e,i,n,o){return e.exec===RegExp.prototype.exec?a&&!o?{done:!0,value:r.call(e,i,n)}:{done:!0,value:t.call(i,e,n)}:{done:!1}},{REPLACE_KEEPS_$0:We,REGEXP_REPLACE_SUBSTITUTES_UNDEFINED_CAPTURE:Ke}),c=l[0],h=l[1];Ct(String.prototype,t,c),Ct(RegExp.prototype,o,2==e?function(t,e){return h.call(t,this,e)}:function(t){return h.call(t,this)})}n&&Q(RegExp.prototype[o],"sham",!0)},Je=Ue("match"),Qe=function(t){var e;return D(t)&&(void 0!==(e=t[Je])?!!e:"RegExp"==E(t))},Ze=function(t){if("function"!=typeof t){throw TypeError(t+" is not a function")}return t},ti=Ue("species"),ei=function(t,e){var i,n=K(t).constructor;return void 0===n||void 0==(i=K(n)[ti])?e:Ze(i)},ii=function(t){return function(e,i){var n,o,a=N(e)+"",s=Et(i),r=a.length;return 0>s||s>=r?t?"":void 0:(n=a.charCodeAt(s),55296>n||n>56319||s+1===r||(o=a.charCodeAt(s+1))<56320||o>57343?t?a.charAt(s):n:t?a.slice(s,s+2):(n-55296<<10)+(o-56320)+65536)}},ni={codeAt:ii(!1),charAt:ii(!0)},oi=ni.charAt,ai=function(t,e,i){return e+(i?oi(t,e).length:1)},si=function(t,e){var i=t.exec;if("function"==typeof i){var n=i.call(t,e);if("object"!=typeof n){throw TypeError("RegExp exec method returned something other than an Object or null")}return n}if("RegExp"!==E(t)){throw TypeError("RegExp#exec called on incompatible receiver")}return Ae.call(t,e)},ri=Se.UNSUPPORTED_Y,li=[].push,ci=Math.min,hi=4294967295;Xe("split",2,function(t,e,i){var n;return n="c"=="abbc".split(/(b)*/)[1]||4!="test".split(/(?:)/,-1).length||2!="ab".split(/(?:ab)*/).length||4!=".".split(/(.?)(.?)/).length||".".split(/()()/).length>1||"".split(/.?/).length?function(t,i){var n=N(this)+"",o=void 0===i?hi:i>>>0;if(0===o){return[]}if(void 0===t){return[n]}if(!Qe(t)){return e.call(n,t,o)}for(var a,s,r,l=[],c=(t.ignoreCase?"i":"")+(t.multiline?"m":"")+(t.unicode?"u":"")+(t.sticky?"y":""),h=0,u=RegExp(t.source,c+"g");(a=Ae.call(u,n))&&(s=u.lastIndex,!(s>h&&(l.push(n.slice(h,a.index)),a.length>1&&a.index=o)));){u.lastIndex===a.index&&u.lastIndex++}return h===n.length?(r||!u.test(""))&&l.push(""):l.push(n.slice(h)),l.length>o?l.slice(0,o):l}:"0".split(void 0,0).length?function(t,i){return void 0===t&&0===i?[]:e.call(this,t,i)}:e,[function(e,i){var o=N(this),a=void 0==e?void 0:e[t];return void 0!==a?a.call(e,o,i):n.call(o+"",e,i)},function(t,o){var a=i(n,t,this,o,n!==e);if(a.done){return a.value}var s=K(t),r=this+"",l=ei(s,RegExp),c=s.unicode,h=(s.ignoreCase?"i":"")+(s.multiline?"m":"")+(s.unicode?"u":"")+(ri?"g":"y"),u=new l(ri?"^(?:"+s.source+")":s,h),d=void 0===o?hi:o>>>0;if(0===d){return[]}if(0===r.length){return null===si(u,r)?[r]:[]}for(var f=0,p=0,g=[];ps;){i=o[s++],(!O||di.call(n,i))&&r.push(t?[i,n[i]]:n[i])}return r}},pi={entries:fi(!0),values:fi(!1)},gi=pi.entries;oe({target:"Object",stat:!0},{entries:function(t){return gi(t)}});var vi,bi=O?Object.defineProperties:function(t,e){K(t);for(var i,n=ui(e),o=n.length,a=0;o>a;){J.f(t,i=n[a++],e[i])}return t},mi=At("document","documentElement"),yi=">",wi="<",Si="prototype",xi="script",ki=gt("IE_PROTO"),Oi=function(){},Ti=function(t){return wi+xi+yi+t+wi+"/"+xi+yi},Ci=function(t){t.write(Ti("")),t.close();var e=t.parentWindow.Object;return t=null,e},Pi=function(){var t,e=U("iframe"),i="java"+xi+":";return e.style.display="none",mi.appendChild(e),e.src=i+"",t=e.contentWindow.document,t.open(),t.write(Ti("document.F=Object")),t.close(),t.F},Ii=function(){try{vi=document.domain&&new ActiveXObject("htmlfile")}catch(t){}Ii=vi?Ci(vi):Pi();for(var e=Mt.length;e--;){delete Ii[Si][Mt[e]]}return Ii()};vt[ki]=!0;var Ai=Object.create||function(t,e){var i;return null!==t?(Oi[Si]=K(t),i=new Oi,Oi[Si]=null,i[ki]=t):i=Ii(),void 0===e?i:bi(i,e)},$i=Ue("unscopables"),Ri=Array.prototype;void 0==Ri[$i]&&J.f(Ri,$i,{configurable:!0,value:Ai(null)});var Ei=function(t){Ri[$i][t]=!0},ji=Bt.includes;oe({target:"Array",proto:!0},{includes:function(t){return ji(this,t,arguments.length>1?arguments[1]:void 0)}}),Ei("includes");var _i=Array.isArray||function(t){return"Array"==E(t)},Ni=function(t){return Object(N(t))},Fi=function(t,e,i){var n=V(e);n in t?J.f(t,n,$(0,i)):t[n]=i},Di=Ue("species"),Vi=function(t,e){var i;return _i(t)&&(i=t.constructor,"function"!=typeof i||i!==Array&&!_i(i.prototype)?D(i)&&(i=i[Di],null===i&&(i=void 0)):i=void 0),new (void 0===i?Array:i)(0===e?0:e)},Bi=Ue("species"),Li=function(t){return De>=51||!k(function(){var e=[],i=e.constructor={};return i[Bi]=function(){return{foo:1}},1!==e[t](Boolean).foo})},Hi=Ue("isConcatSpreadable"),Mi=9007199254740991,Ui="Maximum allowed index exceeded",qi=De>=51||!k(function(){var t=[];return t[Hi]=!1,t.concat()[0]!==t}),zi=Li("concat"),Wi=function(t){if(!D(t)){return !1}var e=t[Hi];return void 0!==e?!!e:_i(t)},Gi=!qi||!zi;oe({target:"Array",proto:!0,forced:Gi},{concat:function(t){var e,i,n,o,a,s=Ni(this),r=Vi(s,0),l=0;for(e=-1,n=arguments.length;n>e;e++){if(a=-1===e?s:arguments[e],Wi(a)){if(o=_t(a.length),l+o>Mi){throw TypeError(Ui)}for(i=0;o>i;i++,l++){i in a&&Fi(r,l,a[i])}}else{if(l>=Mi){throw TypeError(Ui)}Fi(r,l++,a)}}return r.length=l,r}});var Ki=function(t,e,i){if(Ze(t),void 0===e){return t}switch(i){case 0:return function(){return t.call(e)};case 1:return function(i){return t.call(e,i)};case 2:return function(i,n){return t.call(e,i,n)};case 3:return function(i,n,o){return t.call(e,i,n,o)}}return function(){return t.apply(e,arguments)}},Yi=[].push,Xi=function(t){var e=1==t,i=2==t,n=3==t,o=4==t,a=6==t,s=7==t,r=5==t||a;return function(l,c,h,u){for(var d,f,p=Ni(l),g=_(p),v=Ki(c,h,3),b=_t(g.length),m=0,y=u||Vi,w=e?y(l,b):i||s?y(l,0):void 0;b>m;m++){if((r||m in g)&&(d=g[m],f=v(d,m,p),t)){if(e){w[m]=f}else{if(f){switch(t){case 3:return !0;case 5:return d;case 6:return m;case 2:Yi.call(w,d)}}else{switch(t){case 4:return !1;case 7:Yi.call(w,d)}}}}}return a?-1:n||o?o:w}},Ji={forEach:Xi(0),map:Xi(1),filter:Xi(2),some:Xi(3),every:Xi(4),find:Xi(5),findIndex:Xi(6),filterOut:Xi(7)},Qi=Ji.find,Zi="find",tn=!0;Zi in []&&Array(1)[Zi](function(){tn=!1}),oe({target:"Array",proto:!0,forced:tn},{find:function(t){return Qi(this,t,arguments.length>1?arguments[1]:void 0)}}),Ei(Zi);var en=function(t){if(Qe(t)){throw TypeError("The method doesn't accept regular expressions")}return t},nn=Ue("match"),on=function(t){var e=/./;try{"/./"[t](e)}catch(i){try{return e[nn]=!1,"/./"[t](e)}catch(n){}}return !1};oe({target:"String",proto:!0,forced:!on("includes")},{includes:function(t){return !!~(N(this)+"").indexOf(en(t),arguments.length>1?arguments[1]:void 0)}});var an={CSSRuleList:0,CSSStyleDeclaration:0,CSSValueList:0,ClientRectList:0,DOMRectList:0,DOMStringList:0,DOMTokenList:1,DataTransferItemList:0,FileList:0,HTMLAllCollection:0,HTMLCollection:0,HTMLFormElement:0,HTMLSelectElement:0,MediaList:0,MimeTypeArray:0,NamedNodeMap:0,NodeList:1,PaintRequestList:0,Plugin:0,PluginArray:0,SVGLengthList:0,SVGNumberList:0,SVGPathSegList:0,SVGPointList:0,SVGStringList:0,SVGTransformList:0,SourceBufferList:0,StyleSheetList:0,TextTrackCueList:0,TextTrackList:0,TouchList:0},sn=Ji.forEach,rn=pe("forEach"),ln=rn?[].forEach:function(t){return sn(this,t,arguments.length>1?arguments[1]:void 0)};for(var cn in an){var hn=x[cn],un=hn&&hn.prototype;if(un&&un.forEach!==ln){try{Q(un,"forEach",ln)}catch(dn){un.forEach=ln}}}var fn=he.trim,pn=x.parseFloat,gn=1/pn(ae+"-0")!==-(1/0),vn=gn?function(t){var e=fn(t+""),i=pn(e);return 0===i&&"-"==e.charAt(0)?-0:i}:pn;oe({global:!0,forced:parseFloat!=vn},{parseFloat:vn});var bn=Bt.indexOf,mn=[].indexOf,yn=!!mn&&1/[1].indexOf(1,-0)<0,wn=pe("indexOf");oe({target:"Array",proto:!0,forced:yn||!wn},{indexOf:function(t){return yn?mn.apply(this,arguments)||0:bn(this,t,arguments.length>1?arguments[1]:void 0)}});var Sn=[],xn=Sn.sort,kn=k(function(){Sn.sort(void 0)}),On=k(function(){Sn.sort(null)}),Tn=pe("sort"),Cn=kn||!On||!Tn;oe({target:"Array",proto:!0,forced:Cn},{sort:function(t){return void 0===t?xn.call(Ni(this)):xn.call(Ni(this),Ze(t))}});var Pn=Math.floor,In="".replace,An=/\$([$&'`]|\d{1,2}|<[^>]*>)/g,$n=/\$([$&'`]|\d{1,2})/g,Rn=function(t,e,i,n,o,a){var s=i+t.length,r=n.length,l=$n;return void 0!==o&&(o=Ni(o),l=An),In.call(a,l,function(a,l){var c;switch(l.charAt(0)){case"$":return"$";case"&":return t;case"`":return e.slice(0,i);case"'":return e.slice(s);case"<":c=o[l.slice(1,-1)];break;default:var h=+l;if(0===h){return a}if(h>r){var u=Pn(h/10);return 0===u?a:r>=u?void 0===n[u-1]?l.charAt(1):n[u-1]+l.charAt(1):a}c=n[h-1]}return void 0===c?"":c})},En=Math.max,jn=Math.min,_n=function(t){return void 0===t?t:t+""};Xe("replace",2,function(t,e,i,n){var o=n.REGEXP_REPLACE_SUBSTITUTES_UNDEFINED_CAPTURE,a=n.REPLACE_KEEPS_$0,s=o?"$":"$0";return[function(i,n){var o=N(this),a=void 0==i?void 0:i[t];return void 0!==a?a.call(i,o,n):e.call(o+"",i,n)},function(t,n){if(!o&&a||"string"==typeof n&&-1===n.indexOf(s)){var r=i(e,t,this,n);if(r.done){return r.value}}var l=K(t),c=this+"",h="function"==typeof n;h||(n+="");var u=l.global;if(u){var d=l.unicode;l.lastIndex=0}for(var f=[];;){var p=si(l,c);if(null===p){break}if(f.push(p),!u){break}var g=p[0]+"";""===g&&(l.lastIndex=ai(c,_t(l.lastIndex),d))}for(var v="",b=0,m=0;m=b&&(v+=c.slice(b,w)+T,b=w+y.length)}return v+c.slice(b)}]});var Nn=Object.assign,Fn=Object.defineProperty,Dn=!Nn||k(function(){if(O&&1!==Nn({b:1},Nn(Fn({},"a",{enumerable:!0,get:function(){Fn(this,"b",{value:3,enumerable:!1})}}),{b:2})).b){return !0}var t={},e={},i=Symbol(),n="abcdefghijklmnopqrst";return t[i]=7,n.split("").forEach(function(t){e[t]=t}),7!=Nn({},t)[i]||ui(Nn({},e)).join("")!=n})?function(t,e){for(var i=Ni(t),n=arguments.length,o=1,a=Gt.f,s=A.f;n>o;){for(var r,l=_(arguments[o++]),c=a?ui(l).concat(a(l)):ui(l),h=c.length,u=0;h>u;){r=c[u++],(!O||s.call(l,r))&&(i[r]=l[r])}}return i}:Nn;oe({target:"Object",stat:!0,forced:Object.assign!==Dn},{assign:Dn});var Vn=Ji.filter,Bn=Li("filter");oe({target:"Array",proto:!0,forced:!Bn},{filter:function(t){return Vn(this,t,arguments.length>1?arguments[1]:void 0)}});var Ln=Object.is||function(t,e){return t===e?0!==t||1/t===1/e:t!=t&&e!=e};Xe("search",1,function(t,e,i){return[function(e){var i=N(this),n=void 0==e?void 0:e[t];return void 0!==n?n.call(e,i):RegExp(e)[t](i+"")},function(t){var n=i(e,t,this);if(n.done){return n.value}var o=K(t),a=this+"",s=o.lastIndex;Ln(s,0)||(o.lastIndex=0);var r=si(o,a);return Ln(o.lastIndex,s)||(o.lastIndex=s),null===r?-1:r.index}]});var Hn=he.trim,Mn=x.parseInt,Un=/^[+-]?0[Xx]/,qn=8!==Mn(ae+"08")||22!==Mn(ae+"0x16"),zn=qn?function(t,e){var i=Hn(t+"");return Mn(i,e>>>0||(Un.test(i)?16:10))}:Mn;oe({global:!0,forced:parseInt!=zn},{parseInt:zn});var Wn=Ji.map,Gn=Li("map");oe({target:"Array",proto:!0,forced:!Gn},{map:function(t){return Wn(this,t,arguments.length>1?arguments[1]:void 0)}});var Kn=Ji.findIndex,Yn="findIndex",Xn=!0;Yn in []&&Array(1)[Yn](function(){Xn=!1}),oe({target:"Array",proto:!0,forced:Xn},{findIndex:function(t){return Kn(this,t,arguments.length>1?arguments[1]:void 0)}}),Ei(Yn);var Jn=function(t){if(!D(t)&&null!==t){throw TypeError("Can't set "+(t+"")+" as a prototype")}return t},Qn=Object.setPrototypeOf||("__proto__" in {}?function(){var t,e=!1,i={};try{t=Object.getOwnPropertyDescriptor(Object.prototype,"__proto__").set,t.call(i,[]),e=i instanceof Array}catch(n){}return function(i,n){return K(i),Jn(n),e?t.call(i,n):i.__proto__=n,i}}():void 0),Zn=function(t,e,i){var n,o;return Qn&&"function"==typeof(n=e.constructor)&&n!==i&&D(o=n.prototype)&&o!==i.prototype&&Qn(t,o),t},to=Ue("species"),eo=function(t){var e=At(t),i=J.f;O&&e&&!e[to]&&i(e,to,{configurable:!0,get:function(){return this}})},io=J.f,no=zt.f,oo=Tt.set,ao=Ue("match"),so=x.RegExp,ro=so.prototype,lo=/a/g,co=/a/g,ho=new so(lo)!==lo,uo=Se.UNSUPPORTED_Y,fo=O&&ie("RegExp",!ho||uo||k(function(){return co[ao]=!1,so(lo)!=lo||so(co)==co||"/a/i"!=so(lo,"i")}));if(fo){for(var po=function(t,e){var i,n=this instanceof po,o=Qe(t),a=void 0===e;if(!n&&o&&t.constructor===po&&a){return t}ho?o&&!a&&(t=t.source):t instanceof po&&(a&&(e=me.call(t)),t=t.source),uo&&(i=!!e&&e.indexOf("y")>-1,i&&(e=e.replace(/y/g,"")));var s=Zn(ho?new so(t,e):so(t,e),n?this:ro,po);return uo&&i&&oo(s,{sticky:i}),s},go=(function(t){t in po||io(po,t,{configurable:!0,get:function(){return so[t]},set:function(e){so[t]=e}})}),vo=no(so),bo=0;vo.length>bo;){go(vo[bo++])}ro.constructor=po,po.prototype=ro,Ct(x,"RegExp",po)}eo("RegExp");var mo="toString",yo=RegExp.prototype,wo=yo[mo],So=k(function(){return"/a/b"!=wo.call({source:"a",flags:"b"})}),xo=wo.name!=mo;(So||xo)&&Ct(RegExp.prototype,mo,function(){var t=K(this),e=t.source+"",i=t.flags,n=(void 0===i&&t instanceof RegExp&&!("flags" in yo)?me.call(t):i)+"";return"/"+e+"/"+n},{unsafe:!0});var ko=Ue("toStringTag"),Oo={};Oo[ko]="z";var To=Oo+""=="[object z]",Co=Ue("toStringTag"),Po="Arguments"==E(function(){return arguments}()),Io=function(t,e){try{return t[e]}catch(i){}},Ao=To?E:function(t){var e,i,n;return void 0===t?"Undefined":null===t?"Null":"string"==typeof(i=Io(e=Object(t),Co))?i:Po?E(e):"Object"==(n=E(e))&&"function"==typeof e.callee?"Arguments":n},$o=To?{}.toString:function(){return"[object "+Ao(this)+"]"};To||Ct(Object.prototype,"toString",$o,{unsafe:!0});var Ro=Li("slice"),Eo=Ue("species"),jo=[].slice,_o=Math.max;oe({target:"Array",proto:!0,forced:!Ro},{slice:function(t,e){var i,n,o,a=F(this),s=_t(a.length),r=Dt(t,s),l=Dt(void 0===e?s:e,s);if(_i(a)&&(i=a.constructor,"function"!=typeof i||i!==Array&&!_i(i.prototype)?D(i)&&(i=i[Eo],null===i&&(i=void 0)):i=void 0,i===Array||void 0===i)){return jo.call(a,r,l)}for(n=new (void 0===i?Array:i)(_o(l-r,0)),o=0;l>r;r++,o++){r in a&&Fi(n,o,a[r])}return n.length=o,n}});var No,Fo,Do,Vo=!k(function(){function t(){}return t.prototype.constructor=null,Object.getPrototypeOf(new t)!==t.prototype}),Bo=gt("IE_PROTO"),Lo=Object.prototype,Ho=Vo?Object.getPrototypeOf:function(t){return t=Ni(t),L(t,Bo)?t[Bo]:"function"==typeof t.constructor&&t instanceof t.constructor?t.constructor.prototype:t instanceof Object?Lo:null},Mo=Ue("iterator"),Uo=!1,qo=function(){return this};[].keys&&(Do=[].keys(),"next" in Do?(Fo=Ho(Ho(Do)),Fo!==Object.prototype&&(No=Fo)):Uo=!0);var zo=void 0==No||k(function(){var t={};return No[Mo].call(t)!==t});zo&&(No={}),L(No,Mo)||Q(No,Mo,qo);var Wo={IteratorPrototype:No,BUGGY_SAFARI_ITERATORS:Uo},Go=J.f,Ko=Ue("toStringTag"),Yo=function(t,e,i){t&&!L(t=i?t:t.prototype,Ko)&&Go(t,Ko,{configurable:!0,value:e})},Xo=Wo.IteratorPrototype,Jo=function(t,e,i){var n=e+" Iterator";return t.prototype=Ai(Xo,{next:$(1,i)}),Yo(t,n,!1),t},Qo=Wo.IteratorPrototype,Zo=Wo.BUGGY_SAFARI_ITERATORS,ta=Ue("iterator"),ea="keys",ia="values",na="entries",oa=function(){return this},aa=function(t,e,i,n,o,a,s){Jo(i,e,n);var r,l,c,h=function(t){if(t===o&&g){return g}if(!Zo&&t in f){return f[t]}switch(t){case ea:return function(){return new i(this,t)};case ia:return function(){return new i(this,t)};case na:return function(){return new i(this,t)}}return function(){return new i(this)}},u=e+" Iterator",d=!1,f=t.prototype,p=f[ta]||f["@@iterator"]||o&&f[o],g=!Zo&&p||h(o),v="Array"==e?f.entries||p:p;if(v&&(r=Ho(v.call(new t)),Qo!==Object.prototype&&r.next&&(Ho(r)!==Qo&&(Qn?Qn(r,Qo):"function"!=typeof r[ta]&&Q(r,ta,oa)),Yo(r,u,!0))),o==ia&&p&&p.name!==ia&&(d=!0,g=function(){return p.call(this)}),f[ta]!==g&&Q(f,ta,g),o){if(l={values:h(ia),keys:a?g:h(ea),entries:h(na)},s){for(c in l){!Zo&&!d&&c in f||Ct(f,c,l[c])}}else{oe({target:e,proto:!0,forced:Zo||d},l)}}return l},sa="Array Iterator",ra=Tt.set,la=Tt.getterFor(sa),ca=aa(Array,"Array",function(t,e){ra(this,{type:sa,target:F(t),index:0,kind:e})},function(){var t=la(this),e=t.target,i=t.kind,n=t.index++;return !e||n>=e.length?(t.target=void 0,{value:void 0,done:!0}):"keys"==i?{value:n,done:!1}:"values"==i?{value:e[n],done:!1}:{value:[n,e[n]],done:!1}},"values");Ei("keys"),Ei("values"),Ei("entries");var ha=Ue("iterator"),ua=Ue("toStringTag"),da=ca.values;for(var fa in an){var pa=x[fa],ga=pa&&pa.prototype;if(ga){if(ga[ha]!==da){try{Q(ga,ha,da)}catch(dn){ga[ha]=da}}if(ga[ua]||Q(ga,ua,fa),an[fa]){for(var va in ca){if(ga[va]!==ca[va]){try{Q(ga,va,ca[va])}catch(dn){ga[va]=ca[va]}}}}}}var ba=Li("splice"),ma=Math.max,ya=Math.min,wa=9007199254740991,Sa="Maximum allowed length exceeded";oe({target:"Array",proto:!0,forced:!ba},{splice:function(t,e){var i,n,o,a,s,r,l=Ni(this),c=_t(l.length),h=Dt(t,c),u=arguments.length;if(0===u?i=n=0:1===u?(i=0,n=c-h):(i=u-2,n=ya(ma(Et(e),0),c-h)),c+i-n>wa){throw TypeError(Sa)}for(o=Vi(l,n),a=0;n>a;a++){s=h+a,s in l&&Fi(o,a,l[s])}if(o.length=n,n>i){for(a=h;c-n>a;a++){s=a+n,r=a+i,s in l?l[r]=l[s]:delete l[r]}for(a=c;a>c-n+i;a--){delete l[a-1]}}else{if(i>n){for(a=c-n;a>h;a--){s=a+n-1,r=a+i-1,s in l?l[r]=l[s]:delete l[r]}}}for(a=0;i>a;a++){l[a+h]=arguments[a+2]}return l.length=c-n+i,o}});var xa=zt.f,ka=G.f,Oa=J.f,Ta=he.trim,Ca="Number",Pa=x[Ca],Ia=Pa.prototype,Aa=E(Ai(Ia))==Ca,$a=function(t){var e,i,n,o,a,s,r,l,c=V(t,!1);if("string"==typeof c&&c.length>2){if(c=Ta(c),e=c.charCodeAt(0),43===e||45===e){if(i=c.charCodeAt(2),88===i||120===i){return NaN}}else{if(48===e){switch(c.charCodeAt(1)){case 66:case 98:n=2,o=49;break;case 79:case 111:n=8,o=55;break;default:return +c}for(a=c.slice(2),s=a.length,r=0;s>r;r++){if(l=a.charCodeAt(r),48>l||l>o){return NaN}}return parseInt(a,n)}}}return +c};if(ie(Ca,!Pa(" 0o1")||!Pa("0b1")||Pa("+0x1"))){for(var Ra,Ea=function(t){var e=arguments.length<1?0:t,i=this;return i instanceof Ea&&(Aa?k(function(){Ia.valueOf.call(i)}):E(i)!=Ca)?Zn(new Pa($a(e)),i,Ea):$a(e)},ja=O?xa(Pa):"MAX_VALUE,MIN_VALUE,NaN,NEGATIVE_INFINITY,POSITIVE_INFINITY,EPSILON,isFinite,isInteger,isNaN,isSafeInteger,MAX_SAFE_INTEGER,MIN_SAFE_INTEGER,parseFloat,parseInt,isInteger,fromString,range".split(","),_a=0;ja.length>_a;_a++){L(Pa,Ra=ja[_a])&&!L(Ea,Ra)&&Oa(Ea,Ra,ka(Pa,Ra))}Ea.prototype=Ia,Ia.constructor=Ea,Ct(x,Ca,Ea)}var Na=[].reverse,Fa=[1,2];oe({target:"Array",proto:!0,forced:Fa+""==Fa.reverse()+""},{reverse:function(){return _i(this)&&(this.length=this.length),Na.call(this)}});var Da="1.19.1",Va=4;try{var Ba=y["default"].fn.dropdown.Constructor.VERSION;void 0!==Ba&&(Va=parseInt(Ba,10))}catch(La){}try{var Ha=bootstrap.Tooltip.VERSION;void 0!==Ha&&(Va=parseInt(Ha,10))}catch(La){}var Ma={3:{iconsPrefix:"glyphicon",icons:{paginationSwitchDown:"glyphicon-collapse-down icon-chevron-down",paginationSwitchUp:"glyphicon-collapse-up icon-chevron-up",refresh:"glyphicon-refresh icon-refresh",toggleOff:"glyphicon-list-alt icon-list-alt",toggleOn:"glyphicon-list-alt icon-list-alt",columns:"glyphicon-th icon-th",detailOpen:"glyphicon-plus icon-plus",detailClose:"glyphicon-minus icon-minus",fullscreen:"glyphicon-fullscreen",search:"glyphicon-search",clearSearch:"glyphicon-trash"},classes:{buttonsPrefix:"btn",buttons:"default",buttonsGroup:"btn-group",buttonsDropdown:"btn-group",pull:"pull",inputGroup:"input-group",inputPrefix:"input-",input:"form-control",paginationDropdown:"btn-group dropdown",dropup:"dropup",dropdownActive:"active",paginationActive:"active",buttonActive:"active"},html:{toolbarDropdown:['"],toolbarDropdownItem:'',toolbarDropdownSeparator:'
  • ',pageDropdown:['"],pageDropdownItem:'
    ',dropdownCaret:'',pagination:['
      ',"
    "],paginationItem:'
  • %s
  • ',icon:'',inputGroup:'
    %s%s
    ',searchInput:'',searchButton:'',searchClearButton:''}},4:{iconsPrefix:"fa",icons:{paginationSwitchDown:"fa-caret-square-down",paginationSwitchUp:"fa-caret-square-up",refresh:"fa-sync",toggleOff:"fa-toggle-off",toggleOn:"fa-toggle-on",columns:"fa-th-list",detailOpen:"fa-plus",detailClose:"fa-minus",fullscreen:"fa-arrows-alt",search:"fa-search",clearSearch:"fa-trash"},classes:{buttonsPrefix:"btn",buttons:"secondary",buttonsGroup:"btn-group",buttonsDropdown:"btn-group",pull:"float",inputGroup:"btn-group",inputPrefix:"form-control-",input:"form-control",paginationDropdown:"btn-group dropdown",dropup:"dropup",dropdownActive:"active",paginationActive:"active",buttonActive:"active"},html:{toolbarDropdown:['"],toolbarDropdownItem:'',pageDropdown:['"],pageDropdownItem:'%s',toolbarDropdownSeparator:'',dropdownCaret:'',pagination:['
      ',"
    "],paginationItem:'
  • %s
  • ',icon:'',inputGroup:'
    %s
    %s
    ',searchInput:'',searchButton:'',searchClearButton:''}},5:{iconsPrefix:"bi",icons:{paginationSwitchDown:"bi-caret-down-square",paginationSwitchUp:"bi-caret-up-square",refresh:"bi-arrow-clockwise",toggleOff:"bi-toggle-off",toggleOn:"bi-toggle-on",columns:"bi-list-ul",detailOpen:"bi-plus",detailClose:"bi-dash",fullscreen:"bi-arrows-move",search:"bi-search",clearSearch:"bi-trash"},classes:{buttonsPrefix:"btn",buttons:"secondary",buttonsGroup:"btn-group",buttonsDropdown:"btn-group",pull:"float",inputGroup:"btn-group",inputPrefix:"form-control-",input:"form-control",paginationDropdown:"btn-group dropdown",dropup:"dropup",dropdownActive:"active",paginationActive:"active",buttonActive:"active"},html:{dataToggle:"data-bs-toggle",toolbarDropdown:['"],toolbarDropdownItem:'',pageDropdown:['"],pageDropdownItem:'%s',toolbarDropdownSeparator:'',dropdownCaret:'',pagination:['
      ',"
    "],paginationItem:'
  • %s
  • ',icon:'',inputGroup:'
    %s%s
    ',searchInput:'',searchButton:'',searchClearButton:''}}}[Va],Ua={id:void 0,firstLoad:!0,height:void 0,classes:"table table-bordered table-hover",buttons:{},theadClasses:"",striped:!1,headerStyle:function(t){return{}},rowStyle:function(t,e){return{}},rowAttributes:function(t,e){return{}},undefinedText:"-",locale:void 0,virtualScroll:!1,virtualScrollItemHeight:void 0,sortable:!0,sortClass:void 0,silentSort:!0,sortName:void 0,sortOrder:void 0,sortReset:!1,sortStable:!1,rememberOrder:!1,serverSort:!0,customSort:void 0,columns:[[]],data:[],url:void 0,method:"get",cache:!0,contentType:"application/json",dataType:"json",ajax:void 0,ajaxOptions:{},queryParams:function(t){return t},queryParamsType:"limit",responseHandler:function(t){return t},totalField:"total",totalNotFilteredField:"totalNotFiltered",dataField:"rows",footerField:"footer",pagination:!1,paginationParts:["pageInfo","pageSize","pageList"],showExtendedPagination:!1,paginationLoop:!0,sidePagination:"client",totalRows:0,totalNotFiltered:0,pageNumber:1,pageSize:10,pageList:[10,25,50,100],paginationHAlign:"right",paginationVAlign:"bottom",paginationDetailHAlign:"left",paginationPreText:"‹",paginationNextText:"›",paginationSuccessivelySize:5,paginationPagesBySide:1,paginationUseIntermediate:!1,search:!1,searchHighlight:!1,searchOnEnterKey:!1,strictSearch:!1,regexSearch:!1,searchSelector:!1,visibleSearch:!1,showButtonIcons:!0,showButtonText:!1,showSearchButton:!1,showSearchClearButton:!1,trimOnSearch:!0,searchAlign:"right",searchTimeOut:500,searchText:"",customSearch:void 0,showHeader:!0,showFooter:!1,footerStyle:function(t){return{}},searchAccentNeutralise:!1,showColumns:!1,showSearch:!1,showPageGo:!1,showColumnsToggleAll:!1,showColumnsSearch:!1,minimumCountColumns:1,showPaginationSwitch:!1,showRefresh:!1,showToggle:!1,showFullscreen:!1,smartDisplay:!0,escape:!1,filterOptions:{filterAlgorithm:"and"},idField:void 0,selectItemName:"btSelectItem",clickToSelect:!1,ignoreClickToSelectOn:function(t){var e=t.tagName;return["A","BUTTON"].includes(e)},singleSelect:!1,checkboxHeader:!0,maintainMetaData:!1,multipleSelectRow:!1,uniqueId:void 0,cardView:!1,detailView:!1,detailViewIcon:!0,detailViewByClick:!1,detailViewAlign:"left",detailFormatter:function(t,e){return""},detailFilter:function(t,e){return !0},toolbar:void 0,toolbarAlign:"left",buttonsToolbar:void 0,buttonsAlign:"right",buttonsOrder:["search","paginationSwitch","refresh","toggle","fullscreen","columns"],buttonsPrefix:Ma.classes.buttonsPrefix,buttonsClass:Ma.classes.buttons,icons:Ma.icons,iconSize:void 0,iconsPrefix:Ma.iconsPrefix,loadingFontSize:"auto",loadingTemplate:function(t){return'\n '.concat(t,'\n \n \n ')},onAll:function(t,e){return !1},onClickCell:function(t,e,i,n){return !1},onDblClickCell:function(t,e,i,n){return !1},onClickRow:function(t,e){return !1},onDblClickRow:function(t,e){return !1},onSort:function(t,e){return !1},onCheck:function(t){return !1},onUncheck:function(t){return !1},onCheckAll:function(t){return !1},onUncheckAll:function(t){return !1},onCheckSome:function(t){return !1},onUncheckSome:function(t){return !1},onLoadSuccess:function(t){return !1},onLoadError:function(t){return !1},onColumnSwitch:function(t,e){return !1},onPageChange:function(t,e){return !1},onSearch:function(t){return !1},onShowSearch:function(){return !1},onToggle:function(t){return !1},onPreBody:function(t){return !1},onPostBody:function(){return !1},onPostHeader:function(){return !1},onPostFooter:function(){return !1},onExpandRow:function(t,e,i){return !1},onCollapseRow:function(t,e){return !1},onRefreshOptions:function(t){return !1},onRefresh:function(t){return !1},onResetView:function(){return !1},onScrollBody:function(){return !1},onTogglePagination:function(t){return !1}},qa={formatLoadingMessage:function(){return"Loading, please wait"},formatRecordsPerPage:function(t){return"".concat(t," rows per page")},formatShowingRows:function(t,e,i,n){return void 0!==n&&n>0&&n>i?"Showing ".concat(t," to ").concat(e," of ").concat(i," rows (filtered from ").concat(n," total rows)"):"Showing ".concat(t," to ").concat(e," of ").concat(i," rows")},formatSRPaginationPreText:function(){return"previous page"},formatSRPaginationPageText:function(t){return"to page ".concat(t)},formatSRPaginationNextText:function(){return"next page"},formatDetailPagination:function(t){return"Showing ".concat(t," rows")},formatSearch:function(){return"Search"},formatShowSearch:function(){return"Show Search"},formatPageGo:function(){return"Go"},formatClearSearch:function(){return"Clear Search"},formatNoMatches:function(){return"No matching records found"},formatPaginationSwitch:function(){return"Hide/Show pagination"},formatPaginationSwitchDown:function(){return"Show pagination"},formatPaginationSwitchUp:function(){return"Hide pagination"},formatRefresh:function(){return"Refresh"},formatToggle:function(){return"Toggle"},formatToggleOn:function(){return"Show card view"},formatToggleOff:function(){return"Hide card view"},formatColumns:function(){return"Columns"},formatColumnsToggleAll:function(){return"Toggle all"},formatFullscreen:function(){return"Fullscreen"},formatAllRows:function(){return"All"}},za={field:void 0,title:void 0,titleTooltip:void 0,"class":void 0,width:void 0,widthUnit:"px",rowspan:void 0,colspan:void 0,align:void 0,halign:void 0,falign:void 0,valign:void 0,cellStyle:void 0,radio:!1,checkbox:!1,checkboxEnabled:!0,clickToSelect:!0,showSelectTitle:!1,sortable:!1,sortName:void 0,order:"asc",sorter:void 0,visible:!0,ignore:!1,switchable:!0,cardVisible:!0,searchable:!0,formatter:void 0,footerFormatter:void 0,detailFormatter:void 0,searchFormatter:!0,searchHighlightFormatter:!1,escape:!1,events:void 0},Wa=["getOptions","refreshOptions","getData","getSelections","load","append","prepend","remove","removeAll","insertRow","updateRow","getRowByUniqueId","updateByUniqueId","removeByUniqueId","updateCell","updateCellByUniqueId","showRow","hideRow","getHiddenRows","showColumn","hideColumn","getVisibleColumns","getHiddenColumns","showAllColumns","hideAllColumns","mergeCells","checkAll","uncheckAll","checkInvert","check","uncheck","checkBy","uncheckBy","refresh","destroy","resetView","showLoading","hideLoading","togglePagination","toggleFullscreen","toggleView","resetSearch","filterBy","scrollTo","getScrollPosition","selectPage","prevPage","nextPage","toggleDetailView","expandRow","collapseRow","expandRowByUniqueId","collapseRowByUniqueId","expandAllRows","collapseAllRows","updateColumnTitle","updateFormatText"],Ga={"all.bs.table":"onAll","click-row.bs.table":"onClickRow","dbl-click-row.bs.table":"onDblClickRow","click-cell.bs.table":"onClickCell","dbl-click-cell.bs.table":"onDblClickCell","sort.bs.table":"onSort","check.bs.table":"onCheck","uncheck.bs.table":"onUncheck","check-all.bs.table":"onCheckAll","uncheck-all.bs.table":"onUncheckAll","check-some.bs.table":"onCheckSome","uncheck-some.bs.table":"onUncheckSome","load-success.bs.table":"onLoadSuccess","load-error.bs.table":"onLoadError","column-switch.bs.table":"onColumnSwitch","page-change.bs.table":"onPageChange","search.bs.table":"onSearch","toggle.bs.table":"onToggle","pre-body.bs.table":"onPreBody","post-body.bs.table":"onPostBody","post-header.bs.table":"onPostHeader","post-footer.bs.table":"onPostFooter","expand-row.bs.table":"onExpandRow","collapse-row.bs.table":"onCollapseRow","refresh-options.bs.table":"onRefreshOptions","reset-view.bs.table":"onResetView","refresh.bs.table":"onRefresh","scroll-body.bs.table":"onScrollBody","toggle-pagination.bs.table":"onTogglePagination","virtual-scroll.bs.table":"onVirtualScroll"};Object.assign(Ua,qa);var Ka={VERSION:Da,THEME:"bootstrap".concat(Va),CONSTANTS:Ma,DEFAULTS:Ua,COLUMN_DEFAULTS:za,METHODS:Wa,EVENTS:Ga,LOCALES:{en:qa,"en-US":qa}},Ya=k(function(){ui(1)});oe({target:"Object",stat:!0,forced:Ya},{keys:function(t){return ui(Ni(t))}}),Xe("match",1,function(t,e,i){return[function(e){var i=N(this),n=void 0==e?void 0:e[t];return void 0!==n?n.call(e,i):RegExp(e)[t](i+"")},function(t){var n=i(e,t,this);if(n.done){return n.value}var o=K(t),a=this+"";if(!o.global){return si(o,a)}var s=o.unicode;o.lastIndex=0;for(var r,l=[],c=0;null!==(r=si(o,a));){var h=r[0]+"";l[c]=h,""===h&&(o.lastIndex=ai(a,_t(o.lastIndex),s)),c++}return 0===c?null:l}]});var Xa=G.f,Ja="".startsWith,Qa=Math.min,Za=on("startsWith"),ts=!Za&&!!function(){var t=Xa(String.prototype,"startsWith");return t&&!t.writable}();oe({target:"String",proto:!0,forced:!ts&&!Za},{startsWith:function(t){var e=N(this)+"";en(t);var i=_t(Qa(arguments.length>1?arguments[1]:void 0,e.length)),n=t+"";return Ja?Ja.call(e,n,i):e.slice(i,i+n.length)===n}});var es=G.f,is="".endsWith,ns=Math.min,os=on("endsWith"),as=!os&&!!function(){var t=es(String.prototype,"endsWith");return t&&!t.writable}();oe({target:"String",proto:!0,forced:!as&&!os},{endsWith:function(t){var e=N(this)+"";en(t);var i=arguments.length>1?arguments[1]:void 0,n=_t(e.length),o=void 0===i?n:ns(_t(i),n),a=t+"";return is?is.call(e,a,o):e.slice(o-a.length,o)===a}});var ss={getSearchInput:function(t){return"string"==typeof t.options.searchSelector?y["default"](t.options.searchSelector):t.$toolbar.find(".search input")},sprintf:function(t){for(var e=arguments.length,i=Array(e>1?e-1:0),n=1;e>n;n++){i[n-1]=arguments[n]}var o=!0,a=0,s=t.replace(/%s/g,function(){var t=i[a++];return void 0===t?(o=!1,""):t});return o?s:""},isObject:function(t){return t instanceof Object&&!Array.isArray(t)},isEmptyObject:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return 0===Object.entries(t).length&&t.constructor===Object},isNumeric:function(t){return !isNaN(parseFloat(t))&&isFinite(t)},getFieldTitle:function(t,e){var i,n=v(t);try{for(n.s();!(i=n.n()).done;){var o=i.value;if(o.field===e){return o.title}}}catch(a){n.e(a)}finally{n.f()}return""},setFieldIndex:function(t){var e,i=0,n=[],o=v(t[0]);try{for(o.s();!(e=o.n()).done;){var a=e.value;i+=a.colspan||1}}catch(s){o.e(s)}finally{o.f()}for(var r=0;rl;l++){n[r][l]=!1}}for(var c=0;cb;b++){for(var m=0;p>m;m++){n[c+b][g+m]=!0}}}}catch(s){u.e(s)}finally{u.f()}}},normalizeAccent:function(t){return"string"!=typeof t?t:t.normalize("NFD").replace(/[\u0300-\u036f]/g,"")},updateFieldGroup:function(t){var e,i,n=(e=[]).concat.apply(e,r(t)),o=v(t);try{for(o.s();!(i=o.n()).done;){var a,s=i.value,l=v(s);try{for(l.s();!(a=l.n()).done;){var c=a.value;if(c.colspanGroup>1){for(var h=0,u=function(t){var e=n.find(function(e){return e.fieldIndex===t});e.visible&&h++},d=c.colspanIndex;d0}}}catch(f){l.e(f)}finally{l.f()}}}catch(f){o.e(f)}finally{o.f()}},getScrollBarWidth:function(){if(void 0===this.cachedWidth){var t=y["default"]("
    ").addClass("fixed-table-scroll-inner"),e=y["default"]("
    ").addClass("fixed-table-scroll-outer");e.append(t),y["default"]("body").append(e);var i=t[0].offsetWidth;e.css("overflow","scroll");var n=t[0].offsetWidth;i===n&&(n=e[0].clientWidth),e.remove(),this.cachedWidth=i-n}return this.cachedWidth},calculateObjectValue:function(t,e,n,o){var a=e;if("string"==typeof e){var s=e.split(".");if(s.length>1){a=window;var l,c=v(s);try{for(c.s();!(l=c.n()).done;){var h=l.value;a=a[h]}}catch(u){c.e(u)}finally{c.f()}}else{a=window[e]}}return null!==a&&"object"===i(a)?a:"function"==typeof a?a.apply(t,n||[]):!a&&"string"==typeof e&&this.sprintf.apply(this,[e].concat(r(n)))?this.sprintf.apply(this,[e].concat(r(n))):o},compareObjects:function(t,e,i){var n=Object.keys(t),o=Object.keys(e);if(i&&n.length!==o.length){return !1}for(var a=0,s=n;a/g,">").replace(/"/g,""").replace(/'/g,"'"):t},unescapeHTML:function(t){return t?(""+t).replace(/&/g,"&").replace(/</g,"<").replace(/>/g,">").replace(/"/g,'"').replace(/'/g,"'"):t},getRealDataAttr:function(t){for(var e=0,i=Object.entries(t);etd,>th").each(function(n,a){for(var s=y["default"](a),l=+s.attr("colspan")||1,c=+s.attr("rowspan")||1,h=n;o[e]&&o[e][h];h++){}for(var u=h;h+l>u;u++){for(var d=e;e+c>d;d++){o[d]||(o[d]=[]),o[d][u]=!0}}var f=t[h].field;r[f]=s.html().trim(),r["_".concat(f,"_id")]=s.attr("id"),r["_".concat(f,"_class")]=s.attr("class"),r["_".concat(f,"_rowspan")]=s.attr("rowspan"),r["_".concat(f,"_colspan")]=s.attr("colspan"),r["_".concat(f,"_title")]=s.attr("title"),r["_".concat(f,"_data")]=i.getRealDataAttr(s.data()),r["_".concat(f,"_style")]=s.attr("style")}),n.push(r)}),n},sort:function(t,e,i,n,o,a){return(void 0===t||null===t)&&(t=""),(void 0===e||null===e)&&(e=""),n&&t===e&&(t=o,e=a),this.isNumeric(t)&&this.isNumeric(e)?(t=parseFloat(t),e=parseFloat(e),e>t?-1*i:t>e?i:0):t===e?0:("string"!=typeof t&&(t=""+t),-1===t.localeCompare(e)?-1*i:i)},getEventName:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"";return e=e||"".concat(+new Date).concat(~~(1000000*Math.random())),"".concat(t,"-").concat(e)},hasDetailViewIcon:function(t){return t.detailView&&t.detailViewIcon&&!t.cardView},getDetailViewIndexOffset:function(t){return this.hasDetailViewIcon(t)&&"right"!==t.detailViewAlign?1:0},checkAutoMergeCells:function(t){var e,i=v(t);try{for(i.s();!(e=i.n()).done;){for(var n=e.value,o=0,a=Object.keys(n);oo&&r++;for(var l=i;n>l;l++){t[l]&&s.push(t[l])}return{start:i,end:n,topOffset:o,bottomOffset:a,rowsAbove:r,rows:s}}},{key:"checkChanges",value:function(t,e){var i=e!==this.cache[t];return this.cache[t]=e,i}},{key:"getExtra",value:function(t,e){var i=document.createElement("tr");return i.className="virtual-scroll-".concat(t),e&&(i.style.height="".concat(e,"px")),i.outerHTML}}]),t}(),hs=function(){function e(t,i){n(this,e),this.options=i,this.$el=y["default"](t),this.$el_=this.$el.clone(),this.timeoutId_=0,this.timeoutFooter_=0}return a(e,[{key:"init",value:function(){this.initConstants(),this.initLocale(),this.initContainer(),this.initTable(),this.initHeader(),this.initData(),this.initHiddenRows(),this.initToolbar(),this.initPagination(),this.initBody(),this.initSearchText(),this.initServer()}},{key:"initConstants",value:function(){var t=this.options;this.constants=Ka.CONSTANTS,this.constants.theme=y["default"].fn.bootstrapTable.theme,this.constants.dataToggle=this.constants.html.dataToggle||"data-toggle";var e=t.buttonsPrefix?"".concat(t.buttonsPrefix,"-"):"";this.constants.buttonsClass=[t.buttonsPrefix,e+t.buttonsClass,ss.sprintf("".concat(e,"%s"),t.iconSize)].join(" ").trim(),this.buttons=ss.calculateObjectValue(this,t.buttons,[],{}),"object"!==i(this.buttons)&&(this.buttons={}),"string"==typeof t.icons&&(t.icons=ss.calculateObjectValue(null,t.icons))}},{key:"initLocale",value:function(){if(this.options.locale){var t=y["default"].fn.bootstrapTable.locales,i=this.options.locale.split(/-|_/);i[0]=i[0].toLowerCase(),i[1]&&(i[1]=i[1].toUpperCase());var n={};t[this.options.locale]?n=t[this.options.locale]:t[i.join("-")]?n=t[i.join("-")]:t[i[0]]&&(n=t[i[0]]);for(var o=0,a=Object.entries(n);o
    ':"",e=["bottom","both"].includes(this.options.paginationVAlign)?'
    ':"",i=ss.calculateObjectValue(this.options,this.options.loadingTemplate,[this.options.formatLoadingMessage()]);this.$container=y["default"]('\n
    \n
    \n ').concat(t,'\n
    \n
    \n
    \n
    \n ').concat(i,'\n
    \n
    \n \n
    \n ').concat(e,"\n
    \n ")),this.$container.insertAfter(this.$el),this.$tableContainer=this.$container.find(".fixed-table-container"),this.$tableHeader=this.$container.find(".fixed-table-header"),this.$tableBody=this.$container.find(".fixed-table-body"),this.$tableLoading=this.$container.find(".fixed-table-loading"),this.$tableFooter=this.$el.find("tfoot"),this.options.buttonsToolbar?this.$toolbar=y["default"]("body").find(this.options.buttonsToolbar):this.$toolbar=this.$container.find(".fixed-table-toolbar"),this.$pagination=this.$container.find(".fixed-table-pagination"),this.$tableBody.append(this.$el),this.$container.after('
    '),this.$el.addClass(this.options.classes),this.$tableLoading.addClass(this.options.classes),this.options.striped&&this.$el.addClass("table-striped"),this.options.height&&(this.$tableContainer.addClass("fixed-height"),this.options.showFooter&&this.$tableContainer.addClass("has-footer"),this.options.classes.split(" ").includes("table-bordered")&&(this.$tableBody.append('
    '),this.$tableBorder=this.$tableBody.find(".fixed-table-border"),this.$tableLoading.addClass("fixed-table-border")),this.$tableFooter=this.$container.find(".fixed-table-footer"))}},{key:"initTable",value:function(){var t=this,i=[];if(this.$header=this.$el.find(">thead"),this.$header.length?this.options.theadClasses&&this.$header.addClass(this.options.theadClasses):this.$header=y["default"]('')).appendTo(this.$el),this._headerTrClasses=[],this._headerTrStyles=[],this.$header.find("tr").each(function(e,n){var o=y["default"](n),a=[];o.find("th").each(function(t,e){var i=y["default"](e);void 0!==i.data("field")&&i.data("field","".concat(i.data("field"))),a.push(y["default"].extend({},{title:i.html(),"class":i.attr("class"),titleTooltip:i.attr("title"),rowspan:i.attr("rowspan")?+i.attr("rowspan"):void 0,colspan:i.attr("colspan")?+i.attr("colspan"):void 0},i.data()))}),i.push(a),o.attr("class")&&t._headerTrClasses.push(o.attr("class")),o.attr("style")&&t._headerTrStyles.push(o.attr("style"))}),Array.isArray(this.options.columns[0])||(this.options.columns=[this.options.columns]),this.options.columns=y["default"].extend(!0,[],i,this.options.columns),this.columns=[],this.fieldsColumnsIndex=[],ss.setFieldIndex(this.options.columns),this.options.columns.forEach(function(i,n){i.forEach(function(i,o){var a=y["default"].extend({},e.COLUMN_DEFAULTS,i);void 0!==a.fieldIndex&&(t.columns[a.fieldIndex]=a,t.fieldsColumnsIndex[a.field]=a.fieldIndex),t.options.columns[n][o]=a})}),!this.options.data.length){var n=ss.trToData(this.columns,this.$el.find(">tbody>tr"));n.length&&(this.options.data=n,this.fromHtml=!0)}this.options.pagination&&"server"!==this.options.sidePagination||(this.footerData=ss.trToData(this.columns,this.$el.find(">tfoot>tr"))),this.footerData&&this.$el.find("tfoot").html(""),!this.options.showFooter||this.options.cardView?this.$tableFooter.hide():this.$tableFooter.show()}},{key:"initHeader",value:function(){var t=this,e={},i=[];this.header={fields:[],styles:[],classes:[],formatters:[],detailFormatters:[],events:[],sorters:[],sortNames:[],cellStyles:[],searchables:[]},ss.updateFieldGroup(this.options.columns),this.options.columns.forEach(function(n,o){var a=[];a.push(""));var r="";if(0===o&&ss.hasDetailViewIcon(t.options)){var l=t.options.columns.length>1?' rowspan="'.concat(t.options.columns.length,'"'):"";r='\n
    \n ')}r&&"right"!==t.options.detailViewAlign&&a.push(r),n.forEach(function(i,n){var r=ss.sprintf(' class="%s"',i["class"]),l=i.widthUnit,c=parseFloat(i.width),h=ss.sprintf("text-align: %s; ",i.halign?i.halign:i.align),u=ss.sprintf("text-align: %s; ",i.align),d=ss.sprintf("vertical-align: %s; ",i.valign);if(d+=ss.sprintf("width: %s; ",!i.checkbox&&!i.radio||c?c?c+l:void 0:i.showSelectTitle?void 0:"36px"),void 0!==i.fieldIndex||i.visible){var f=ss.calculateObjectValue(null,t.options.headerStyle,[i]),p=[],g="";if(f&&f.css){for(var v=0,b=Object.entries(f.css);v0?" data-not-first-th":"",">"),a.push(ss.sprintf('
    ',t.options.sortable&&i.sortable?"sortable both":""));var S=t.options.escape?ss.escapeHTML(i.title):i.title,x=S;i.checkbox&&(S="",!t.options.singleSelect&&t.options.checkboxHeader&&(S=''),t.header.stateField=i.field),i.radio&&(S="",t.header.stateField=i.field),!S&&i.showSelectTitle&&(S+=x),a.push(S),a.push("
    "),a.push('
    '),a.push("
    "),a.push("")}}),r&&"right"===t.options.detailViewAlign&&a.push(r),a.push(""),a.length>3&&i.push(a.join(""))}),this.$header.html(i.join("")),this.$header.find("th[data-field]").each(function(t,i){y["default"](i).data(e[y["default"](i).data("field")])}),this.$container.off("click",".th-inner").on("click",".th-inner",function(e){var i=y["default"](e.currentTarget);return t.options.detailView&&!i.parent().hasClass("bs-checkbox")&&i.closest(".bootstrap-table")[0]!==t.$container[0]?!1:void (t.options.sortable&&i.parent().data().sortable&&t.onSort(e))});var n=ss.getEventName("resize.bootstrap-table",this.$el.attr("id"));y["default"](window).off(n),!this.options.showHeader||this.options.cardView?(this.$header.hide(),this.$tableHeader.hide(),this.$tableLoading.css("top",0)):(this.$header.show(),this.$tableHeader.show(),this.$tableLoading.css("top",this.$header.outerHeight()+1),this.getCaret(),y["default"](window).on(n,function(){return t.resetView()})),this.$selectAll=this.$header.find('[name="btSelectAll"]'),this.$selectAll.off("click").on("click",function(e){e.stopPropagation();var i=y["default"](e.currentTarget).prop("checked");t[i?"checkAll":"uncheckAll"](),t.updateSelected()})}},{key:"initData",value:function(t,e){"append"===e?this.options.data=this.options.data.concat(t):"prepend"===e?this.options.data=[].concat(t).concat(this.options.data):(t=t||ss.deepCopy(this.options.data),this.options.data=Array.isArray(t)?t:t[this.options.dataField]),this.data=r(this.options.data),this.options.sortReset&&(this.unsortedData=r(this.data)),"server"!==this.options.sidePagination&&this.initSort()}},{key:"initSort",value:function(){var t=this,e=this.options.sortName,i="desc"===this.options.sortOrder?-1:1,n=this.header.fields.indexOf(this.options.sortName),o=0;-1!==n?(this.options.sortStable&&this.data.forEach(function(t,e){t.hasOwnProperty("_position")||(t._position=e)}),this.options.customSort?ss.calculateObjectValue(this.options,this.options.customSort,[this.options.sortName,this.options.sortOrder,this.data]):this.data.sort(function(o,a){t.header.sortNames[n]&&(e=t.header.sortNames[n]);var s=ss.getItemField(o,e,t.options.escape),r=ss.getItemField(a,e,t.options.escape),l=ss.calculateObjectValue(t.header,t.header.sorters[n],[s,r,o,a]);return void 0!==l?t.options.sortStable&&0===l?i*(o._position-a._position):i*l:ss.sort(s,r,i,t.options.sortStable,o._position,a._position)}),void 0!==this.options.sortClass&&(clearTimeout(o),o=setTimeout(function(){t.$el.removeClass(t.options.sortClass);var e=t.$header.find('[data-field="'.concat(t.options.sortName,'"]')).index();t.$el.find("tr td:nth-child(".concat(e+1,")")).addClass(t.options.sortClass)},250))):this.options.sortReset&&(this.data=r(this.unsortedData))}},{key:"onSort",value:function(t){var e=t.type,i=t.currentTarget,n="keypress"===e?y["default"](i):y["default"](i).parent(),o=this.$header.find("th").eq(n.index());if(this.$header.add(this.$header_).find("span.order").remove(),this.options.sortName===n.data("field")){var a=this.options.sortOrder;void 0===a?this.options.sortOrder="asc":"asc"===a?this.options.sortOrder="desc":"desc"===this.options.sortOrder&&(this.options.sortOrder=this.options.sortReset?void 0:"asc"),void 0===this.options.sortOrder&&(this.options.sortName=void 0)}else{this.options.sortName=n.data("field"),this.options.rememberOrder?this.options.sortOrder="asc"===n.data("order")?"desc":"asc":this.options.sortOrder=this.columns[this.fieldsColumnsIndex[n.data("field")]].sortOrder||this.columns[this.fieldsColumnsIndex[n.data("field")]].order}return this.trigger("sort",this.options.sortName,this.options.sortOrder),n.add(o).data("order",this.options.sortOrder),this.getCaret(),"server"===this.options.sidePagination&&this.options.serverSort?(this.options.pageNumber=1,void this.initServer(this.options.silentSort)):(this.initSort(),void this.initBody())}},{key:"initToolbar",value:function(){var t,e=this,n=this.options,o=[],a=0,r=0;this.$toolbar.find(".bs-bars").children().length&&y["default"]("body").append(y["default"](n.toolbar)),this.$toolbar.html(""),("string"==typeof n.toolbar||"object"===i(n.toolbar))&&y["default"](ss.sprintf('
    ',this.constants.classes.pull,n.toolbarAlign)).appendTo(this.$toolbar).append(y["default"](n.toolbar)),o=['
    ')],"string"==typeof n.buttonsOrder&&(n.buttonsOrder=n.buttonsOrder.replace(/\[|\]| |'/g,"").split(",")),this.buttons=Object.assign(this.buttons,{search:{text:n.formatSearch(),icon:n.icons.search,render:!1,event:this.toggleShowSearch,attributes:{"aria-label":n.formatShowSearch(),title:n.formatShowSearch()}},paginationSwitch:{text:n.pagination?n.formatPaginationSwitchUp():n.formatPaginationSwitchDown(),icon:n.pagination?n.icons.paginationSwitchDown:n.icons.paginationSwitchUp,render:!1,event:this.togglePagination,attributes:{"aria-label":n.formatPaginationSwitch(),title:n.formatPaginationSwitch()}},refresh:{text:n.formatRefresh(),icon:n.icons.refresh,render:!1,event:this.refresh,attributes:{"aria-label":n.formatRefresh(),title:n.formatRefresh()}},toggle:{text:n.formatToggle(),icon:n.icons.toggleOff,render:!1,event:this.toggleView,attributes:{"aria-label":n.formatToggleOn(),title:n.formatToggleOn()}},fullscreen:{text:n.formatFullscreen(),icon:n.icons.fullscreen,render:!1,event:this.toggleFullscreen,attributes:{"aria-label":n.formatFullscreen(),title:n.formatFullscreen()}},columns:{render:!1,html:function X(){var X=[];if(X.push('
    \n \n ").concat(e.constants.html.toolbarDropdown[0])),n.showColumnsSearch&&(X.push(ss.sprintf(e.constants.html.toolbarDropdownItem,ss.sprintf('',e.constants.classes.input,n.formatSearch()))),X.push(e.constants.html.toolbarDropdownSeparator)),n.showColumnsToggleAll){var t=e.getVisibleColumns().length===e.columns.filter(function(t){return !e.isSelectionColumn(t)}).length;X.push(ss.sprintf(e.constants.html.toolbarDropdownItem,ss.sprintf(' %s',t?'checked="checked"':"",n.formatColumnsToggleAll()))),X.push(e.constants.html.toolbarDropdownSeparator)}var i=0;return e.columns.forEach(function(t){t.visible&&i++}),e.columns.forEach(function(t,o){if(!e.isSelectionColumn(t)&&(!n.cardView||t.cardVisible)&&!t.ignore){var a=t.visible?' checked="checked"':"",s=i<=n.minimumCountColumns&&a?' disabled="disabled"':"";t.switchable&&(X.push(ss.sprintf(e.constants.html.toolbarDropdownItem,ss.sprintf(' %s',t.field,o,a,s,t.title))),r++)}}),X.push(e.constants.html.toolbarDropdown[1],"
    "),X.join("")}}});for(var l={},c=0,h=Object.entries(this.buttons);c"}l[d]=p;var x="show".concat(d.charAt(0).toUpperCase()).concat(d.substring(1)),k=n[x];!(!f.hasOwnProperty("render")||f.hasOwnProperty("render")&&f.render)||void 0!==k&&k!==!0||(n[x]=!0),n.buttonsOrder.includes(d)||n.buttonsOrder.push(d)}var O,T=v(n.buttonsOrder);try{for(T.s();!(O=T.n()).done;){var C=O.value,P=n["show".concat(C.charAt(0).toUpperCase()).concat(C.substring(1))];P&&o.push(l[C])}}catch(I){T.e(I)}finally{T.f()}o.push("
    "),(this.showToolbar||o.length>2)&&this.$toolbar.append(o.join("")),n.showSearch&&this.$toolbar.find('button[name="showSearch"]').off("click").on("click",function(){return e.toggleShowSearch()});for(var A=0,$=Object.entries(this.buttons);A<$.length;A++){var R=s($[A],2),E=R[0],j=R[1];if(j.hasOwnProperty("event")){if("function"==typeof j.event||"string"==typeof j.event){var _=function(){var t="string"==typeof j.event?window[j.event]:j.event;return e.$toolbar.find('button[name="'.concat(E,'"]')).off("click").on("click",function(){return t.call(e)}),"continue"}();if("continue"===_){continue}}for(var N=function(){var t=s(D[F],2),i=t[0],n=t[1],o="string"==typeof n?window[n]:n;e.$toolbar.find('button[name="'.concat(E,'"]')).off(i).on(i,function(){return o.call(e)})},F=0,D=Object.entries(j.event);F'),W=z;if(n.showSearchButton||n.showSearchClearButton){var G=(n.showSearchButton?U:"")+(n.showSearchClearButton?q:"");W=n.search?ss.sprintf(this.constants.html.inputGroup,z,G):G}o.push(ss.sprintf('\n
    \n %s\n
    \n '),W)),this.$toolbar.append(o.join(""));var K=ss.getSearchInput(this);n.showSearchButton?(this.$toolbar.find(".search button[name=search]").off("click").on("click",function(){clearTimeout(a),a=setTimeout(function(){e.onSearch({currentTarget:K})},n.searchTimeOut)}),n.searchOnEnterKey&&M(K)):M(K),n.showSearchClearButton&&this.$toolbar.find(".search button[name=clearSearch]").click(function(){e.resetSearch()})}else{if("string"==typeof n.searchSelector){var Y=ss.getSearchInput(this);M(Y)}}}},{key:"onSearch",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},e=t.currentTarget,i=t.firedByInitSearchText,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:!0;if(void 0!==e&&y["default"](e).length&&n){var o=y["default"](e).val().trim();if(this.options.trimOnSearch&&y["default"](e).val()!==o&&y["default"](e).val(o),this.searchText===o){return}var a=ss.getSearchInput(this),s=e instanceof jQuery?e:y["default"](e);(s.is(a)||s.hasClass("search-input"))&&(this.searchText=o,this.options.searchText=o)}i||(this.options.pageNumber=1),this.initSearch(),i?"client"===this.options.sidePagination&&this.updatePagination():this.updatePagination(),this.trigger("search",this.searchText)}},{key:"initSearch",value:function(){var t=this;if(this.filterOptions=this.filterOptions||this.options.filterOptions,"server"!==this.options.sidePagination){if(this.options.customSearch){return this.data=ss.calculateObjectValue(this.options,this.options.customSearch,[this.options.data,this.searchText,this.filterColumns]),void (this.options.sortReset&&(this.unsortedData=r(this.data)))}var e=this.searchText&&(this.fromHtml?ss.escapeHTML(this.searchText):this.searchText),i=e?e.toLowerCase():"",n=ss.isEmptyObject(this.filterColumns)?null:this.filterColumns;this.options.searchAccentNeutralise&&(i=ss.normalizeAccent(i)),"function"==typeof this.filterOptions.filterAlgorithm?this.data=this.options.data.filter(function(e){return t.filterOptions.filterAlgorithm.apply(null,[e,n])}):"string"==typeof this.filterOptions.filterAlgorithm&&(this.data=n?this.options.data.filter(function(e){var i=t.filterOptions.filterAlgorithm;if("and"===i){for(var o in n){if(Array.isArray(n[o])&&!n[o].includes(e[o])||!Array.isArray(n[o])&&e[o]!==n[o]){return !1}}}else{if("or"===i){var a=!1;for(var s in n){(Array.isArray(n[s])&&n[s].includes(e[s])||!Array.isArray(n[s])&&e[s]===n[s])&&(a=!0)}return a}}return !0}):r(this.options.data));var o=this.getVisibleFields();this.data=i?this.data.filter(function(n,a){for(var s=0;s|=<|>=|>|<)(?:\s+)?(-?\d+)?|(-?\d+)?(\s+)?(<=|=>|=<|>=|>|<))/gm,f=d.exec(t.searchText),p=!1;if(f){var g=f[1]||"".concat(f[5],"l"),v=f[2]||f[3],b=parseInt(c,10),m=parseInt(v,10);switch(g){case">":case"m;break;case"<":case">l":p=m>b;break;case"<=":case"=<":case">=l":case"=>l":p=m>=b;break;case">=":case"=>":case"<=l":case"==m}}if(p||"".concat(c).toLowerCase().includes(i)){return !0}}}}return !1}):this.data,this.options.sortReset&&(this.unsortedData=r(this.data)),this.initSort()}}},{key:"initPagination",value:function(){var e=this,i=this.options;if(!i.pagination){return void this.$pagination.hide()}this.$pagination.show();var n,o,a,s,r,l,c,h=[],u=!1,d=this.getData({includeHiddenRows:!1}),f=i.pageList;if("string"==typeof f&&(f=f.replace(/\[|\]| /g,"").toLowerCase().split(",")),f=f.map(function(t){return"string"==typeof t?t.toLowerCase()===i.formatAllRows().toLowerCase()||["all","unlimited"].includes(t.toLowerCase())?i.formatAllRows():+t:t}),this.paginationParts=i.paginationParts,"string"==typeof this.paginationParts&&(this.paginationParts=this.paginationParts.replace(/\[|\]| |'/g,"").split(",")),"server"!==i.sidePagination&&(i.totalRows=d.length),this.totalPages=0,i.totalRows&&(i.pageSize===i.formatAllRows()&&(i.pageSize=i.totalRows,u=!0),this.totalPages=~~((i.totalRows-1)/i.pageSize)+1,i.totalPages=this.totalPages),this.totalPages>0&&i.pageNumber>this.totalPages&&(i.pageNumber=this.totalPages),this.pageFrom=(i.pageNumber-1)*i.pageSize+1,this.pageTo=i.pageNumber*i.pageSize,this.pageTo>i.totalRows&&(this.pageTo=i.totalRows),this.options.pagination&&"server"!==this.options.sidePagination&&(this.options.totalNotFiltered=this.options.data.length),this.options.showExtendedPagination||(this.options.totalNotFiltered=void 0),(this.paginationParts.includes("pageInfo")||this.paginationParts.includes("pageInfoShort")||this.paginationParts.includes("pageSize"))&&h.push('
    ')),this.paginationParts.includes("pageInfo")||this.paginationParts.includes("pageInfoShort")){var p=this.paginationParts.includes("pageInfoShort")?i.formatDetailPagination(i.totalRows):i.formatShowingRows(this.pageFrom,this.pageTo,i.totalRows,i.totalNotFiltered);h.push('\n '.concat(p,"\n "))}if(this.paginationParts.includes("pageSize")){h.push('
    ');var g=['
    \n \n ").concat(this.constants.html.pageDropdown[0])];f.forEach(function(t,n){if(!i.smartDisplay||0===n||f[n-1]")),h.push(i.formatRecordsPerPage(g.join("")))}if((this.paginationParts.includes("pageInfo")||this.paginationParts.includes("pageInfoShort")||this.paginationParts.includes("pageSize"))&&h.push("
    "),this.paginationParts.includes("pageList")){h.push('
    '),ss.sprintf(this.constants.html.pagination[0],ss.sprintf(" pagination-%s",i.iconSize)),ss.sprintf(this.constants.html.paginationItem," page-pre",i.formatSRPaginationPreText(),i.paginationPreText)),this.totalPagesthis.totalPages-o&&(o=o-(i.paginationSuccessivelySize-(this.totalPages-o))+1),1>o&&(o=1),a>this.totalPages&&(a=this.totalPages);var v=Math.round(i.paginationPagesBySide/2),b=function(t){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"";return ss.sprintf(e.constants.html.paginationItem,n+(t===i.pageNumber?" ".concat(e.constants.classes.paginationActive):""),i.formatSRPaginationPageText(t),t)};if(o>1){var m=i.paginationPagesBySide;for(m>=o&&(m=o-1),n=1;m>=n;n++){h.push(b(n))}o-1===m+1?(n=o-1,h.push(b(n))):o-1>m&&(o-2*i.paginationPagesBySide>i.paginationPagesBySide&&i.paginationUseIntermediate?(n=Math.round((o-v)/2+v),h.push(b(n," page-intermediate"))):h.push(ss.sprintf(this.constants.html.paginationItem," page-first-separator disabled","","...")))}for(n=o;a>=n;n++){h.push(b(n))}if(this.totalPages>a){var y=this.totalPages-(i.paginationPagesBySide-1);for(a>=y&&(y=a+1),a+1===y-1?(n=a+1,h.push(b(n))):y>a+1&&(this.totalPages-a>2*i.paginationPagesBySide&&i.paginationUseIntermediate?(n=Math.round((this.totalPages-v-a)/2+a),h.push(b(n," page-intermediate"))):h.push(ss.sprintf(this.constants.html.paginationItem," page-last-separator disabled","","..."))),n=y;n<=this.totalPages;n++){h.push(b(n))}}h.push(ss.sprintf(this.constants.html.paginationItem," page-next",i.formatSRPaginationNextText(),i.paginationNextText)),h.push(this.constants.html.pagination[1],"
    ")}this.$pagination.html(h.join(""));var w=["bottom","both"].includes(i.paginationVAlign)?" ".concat(this.constants.classes.dropup):"";if(this.$pagination.last().find(".page-list > div").addClass(w),!i.onlyInfoPagination&&(s=this.$pagination.find(".page-list a"),r=this.$pagination.find(".page-pre"),l=this.$pagination.find(".page-next"),c=this.$pagination.find(".page-item").not(".page-next, .page-pre, .page-last-separator, .page-first-separator"),this.totalPages<=1&&this.$pagination.find("div.pagination").hide(),i.smartDisplay&&(f.length<2||i.totalRows<=f[0])&&this.$pagination.find("div.page-list").hide(),this.$pagination[this.getData().length?"show":"hide"](),i.paginationLoop||(1===i.pageNumber&&r.addClass("disabled"),i.pageNumber===this.totalPages&&l.addClass("disabled")),u&&(i.pageSize=i.formatAllRows()),s.off("click").on("click",function(t){return e.onPageListChange(t)}),r.off("click").on("click",function(t){return e.onPagePre(t)}),l.off("click").on("click",function(t){return e.onPageNext(t)}),c.off("click").on("click",function(t){return e.onPageNumber(t)}),this.options.showPageGo)){var S=this,x=this.$pagination.find("ul.pagination"),k=x.find("li.pageGo");k.length||(k=t('
  • '+ss.sprintf('',this.options.pageNumber)+('
  • ").appendTo(x),k.find("button").click(function(){var t=parseInt(k.find("input").val())||1;(1>t||t>S.options.totalPages)&&(t=1),S.selectPage(t)}))}}},{key:"updatePagination",value:function(t){t&&y["default"](t.currentTarget).hasClass("disabled")||(this.options.maintainMetaData||this.resetRows(),this.initPagination(),this.trigger("page-change",this.options.pageNumber,this.options.pageSize),"server"===this.options.sidePagination?this.initServer():this.initBody())}},{key:"onPageListChange",value:function(t){t.preventDefault();var e=y["default"](t.currentTarget);return e.parent().addClass(this.constants.classes.dropdownActive).siblings().removeClass(this.constants.classes.dropdownActive),this.options.pageSize=e.text().toUpperCase()===this.options.formatAllRows().toUpperCase()?this.options.formatAllRows():+e.text(),this.$toolbar.find(".page-size").text(this.options.pageSize),this.updatePagination(t),!1}},{key:"onPagePre",value:function(t){return y["default"](t.target).hasClass("disabled")?void 0:(t.preventDefault(),this.options.pageNumber-1===0?this.options.pageNumber=this.options.totalPages:this.options.pageNumber--,this.updatePagination(t),!1)}},{key:"onPageNext",value:function(t){return y["default"](t.target).hasClass("disabled")?void 0:(t.preventDefault(),this.options.pageNumber+1>this.options.totalPages?this.options.pageNumber=1:this.options.pageNumber++,this.updatePagination(t),!1)}},{key:"onPageNumber",value:function(t){return t.preventDefault(),this.options.pageNumber!==+y["default"](t.currentTarget).text()?(this.options.pageNumber=+y["default"](t.currentTarget).text(),this.updatePagination(t),!1):void 0}},{key:"initRow",value:function(t,e,n,o){var a=this,r=[],l={},c=[],h="",u={},d=[];if(!(ss.findIndex(this.hiddenRows,t)>-1)){if(l=ss.calculateObjectValue(this.options,this.options.rowStyle,[t,e],l),l&&l.css){for(var f=0,p=Object.entries(l.css);f"),this.options.cardView&&r.push('
    '));var I="";return ss.hasDetailViewIcon(this.options)&&(I="",ss.calculateObjectValue(null,this.options.detailFilter,[e,t])&&(I+='\n \n '.concat(ss.sprintf(this.constants.html.icon,this.options.iconsPrefix,this.options.icons.detailOpen),"\n \n ")),I+=""),I&&"right"!==this.options.detailViewAlign&&r.push(I),this.header.fields.forEach(function(i,n){var o="",l=ss.getItemField(t,i,a.options.escape),h="",u="",d={},f="",p=a.header.classes[n],g="",v="",b="",m="",y="",w="",S=a.columns[n];if((!a.fromHtml&&!a.autoMergeCells||void 0!==l||S.checkbox||S.radio)&&S.visible&&(!a.options.cardView||S.cardVisible)){if(S.escape&&(l=ss.escapeHTML(l)),c.concat([a.header.styles[n]]).length&&(v+="".concat(c.concat([a.header.styles[n]]).join("; "))),t["_".concat(i,"_style")]&&(v+="".concat(t["_".concat(i,"_style")])),v&&(g=' style="'.concat(v,'"')),t["_".concat(i,"_id")]&&(f=ss.sprintf(' id="%s"',t["_".concat(i,"_id")])),t["_".concat(i,"_class")]&&(p=ss.sprintf(' class="%s"',t["_".concat(i,"_class")])),t["_".concat(i,"_rowspan")]&&(m=ss.sprintf(' rowspan="%s"',t["_".concat(i,"_rowspan")])),t["_".concat(i,"_colspan")]&&(y=ss.sprintf(' colspan="%s"',t["_".concat(i,"_colspan")])),t["_".concat(i,"_title")]&&(w=ss.sprintf(' title="%s"',t["_".concat(i,"_title")])),d=ss.calculateObjectValue(a.header,a.header.cellStyles[n],[l,t,e,i],d),d.classes&&(p=' class="'.concat(d.classes,'"')),d.css){for(var x=[],k=0,O=Object.entries(d.css);k$1",R=h&&/<(?=.*? .*?\/ ?>|br|hr|input|!--|wbr)[a-z]+.*?>|<([a-z]+).*?<\/\1>/i.test(h);if(R){var E=(new DOMParser).parseFromString(""+h,"text/html").documentElement.textContent,j=E.replace(A,$);E=E.replace(/[.*+?^${}()|[\]\\]/g,"\\$&"),I=h.replace(RegExp("(>\\s*)(".concat(E,")(\\s*)"),"gm"),"$1".concat(j,"$3"))}else{I=(""+h).replace(A,$)}h=ss.calculateObjectValue(S,S.searchHighlightFormatter,[h,a.searchText],I)}if(t["_".concat(i,"_data")]&&!ss.isEmptyObject(t["_".concat(i,"_data")])){for(var _=0,N=Object.entries(t["_".concat(i,"_data")]);_'):'"))+'")+(a.header.formatters[n]&&"string"==typeof h?h:"")+(a.options.cardView?"
    ":""),t[a.header.stateField]=h===!0||!!l||h&&h.checked}else{if(a.options.cardView){var M=a.options.showHeader?'").concat(ss.getFieldTitle(a.columns,i),""):"";o='
    '.concat(M,'").concat(h,"
    "),a.options.smartDisplay&&""===h&&(o='
    ')}else{o="").concat(h,"")}}r.push(o)}}),I&&"right"===this.options.detailViewAlign&&r.push(I),this.options.cardView&&r.push("
    "),r.push(""),r.join("")}}},{key:"initBody",value:function(t,e){var i=this,n=this.getData();this.trigger("pre-body",n),this.$body=this.$el.find(">tbody"),this.$body.length||(this.$body=y["default"]("").appendTo(this.$el)),this.options.pagination&&"server"!==this.options.sidePagination||(this.pageFrom=1,this.pageTo=n.length);var o=[],a=y["default"](document.createDocumentFragment()),s=!1,r=[];this.autoMergeCells=ss.checkAutoMergeCells(n.slice(this.pageFrom-1,this.pageTo));for(var l=this.pageFrom-1;l tr[data-uniqueid="%s"][data-has-detail-view]',d)),p=f.next();p.is("tr.detail-view")&&(r.push(l),e&&d===e||(h+=p[0].outerHTML))}this.options.virtualScroll?o.push(h):a.append(h)}}s?this.options.virtualScroll?(this.virtualScroll&&this.virtualScroll.destroy(),this.virtualScroll=new cs({rows:o,fixedScroll:t,scrollEl:this.$tableBody[0],contentEl:this.$body[0],itemHeight:this.options.virtualScrollItemHeight,callback:function(t,e){i.fitHeader(),i.initBodyEvent(),i.trigger("virtual-scroll",t,e)}})):this.$body.html(a):this.$body.html(''.concat(ss.sprintf('%s',this.getVisibleFields().length+ss.getDetailViewIndexOffset(this.options),this.options.formatNoMatches()),"")),r.forEach(function(t){i.expandRow(t)}),t||this.scrollTo(0),this.initBodyEvent(),this.initFooter(),this.resetView(),this.updateSelected(),"server"!==this.options.sidePagination&&(this.options.totalRows=n.length),this.trigger("post-body",n)}},{key:"initBodyEvent",value:function(){var t=this;this.$body.find("> tr[data-index] > td").off("click dblclick").on("click dblclick",function(e){var i=y["default"](e.currentTarget),n=i.parent(),o=y["default"](e.target).parents(".card-views").children(),a=y["default"](e.target).parents(".card-view"),s=n.data("index"),r=t.data[s],l=t.options.cardView?o.index(a):i[0].cellIndex,c=t.getVisibleFields(),h=c[l-ss.getDetailViewIndexOffset(t.options)],u=t.columns[t.fieldsColumnsIndex[h]],d=ss.getItemField(r,h,t.options.escape);if(!i.find(".detail-icon").length){if(t.trigger("click"===e.type?"click-cell":"dbl-click-cell",h,d,r,i),t.trigger("click"===e.type?"click-row":"dbl-click-row",r,n,h),"click"===e.type&&t.options.clickToSelect&&u.clickToSelect&&!ss.calculateObjectValue(t.options,t.options.ignoreClickToSelectOn,[e.target])){var f=n.find(ss.sprintf('[name="%s"]',t.options.selectItemName));f.length&&f[0].click()}"click"===e.type&&t.options.detailViewByClick&&t.toggleDetailView(s,t.header.detailFormatters[t.fieldsColumnsIndex[h]])}}).off("mousedown").on("mousedown",function(e){t.multipleSelectRowCtrlKey=e.ctrlKey||e.metaKey,t.multipleSelectRowShiftKey=e.shiftKey}),this.$body.find("> tr[data-index] > td > .detail-icon").off("click").on("click",function(e){return e.preventDefault(),t.toggleDetailView(y["default"](e.currentTarget).parent().parent().data("index")),!1}),this.$selectItem=this.$body.find(ss.sprintf('[name="%s"]',this.options.selectItemName)),this.$selectItem.off("click").on("click",function(e){e.stopImmediatePropagation();var i=y["default"](e.currentTarget);t._toggleCheck(i.prop("checked"),i.data("index"))}),this.header.events.forEach(function(e,i){var n=e;if(n){"string"==typeof n&&(n=ss.calculateObjectValue(null,n));var o=t.header.fields[i],a=t.getVisibleFields().indexOf(o);if(-1!==a){a+=ss.getDetailViewIndexOffset(t.options);var s=function(e){if(!n.hasOwnProperty(e)){return"continue"}var i=n[e];t.$body.find(">tr:not(.no-records-found)").each(function(n,s){var r=y["default"](s),l=r.find(t.options.cardView?".card-views>.card-view":">td").eq(a),c=e.indexOf(" "),h=e.substring(0,c),u=e.substring(c+1);l.find(u).off(h).on(h,function(e){var n=r.data("index"),a=t.data[n],s=a[o];i.apply(t,[e,s,a,n])})})};for(var r in n){s(r)}}}})}},{key:"initServer",value:function(t,e,i){var n=this,o={},a=this.header.fields.indexOf(this.options.sortName),s={searchText:this.searchText,sortName:this.options.sortName,sortOrder:this.options.sortOrder};if(this.header.sortNames[a]&&(s.sortName=this.header.sortNames[a]),this.options.pagination&&"server"===this.options.sidePagination&&(s.pageSize=this.options.pageSize===this.options.formatAllRows()?this.options.totalRows:this.options.pageSize,s.pageNumber=this.options.pageNumber),!this.options.firstLoad&&!firstLoadTable.includes(this.options.id)){return void firstLoadTable.push(this.options.id)}if(i||this.options.url||this.options.ajax){if("limit"===this.options.queryParamsType&&(s={search:s.searchText,sort:s.sortName,order:s.sortOrder},this.options.pagination&&"server"===this.options.sidePagination&&(s.offset=this.options.pageSize===this.options.formatAllRows()?0:this.options.pageSize*(this.options.pageNumber-1),s.limit=this.options.pageSize,(0===s.limit||this.options.pageSize===this.options.formatAllRows())&&delete s.limit)),this.options.search&&"server"===this.options.sidePagination&&this.columns.filter(function(t){return !t.searchable}).length){s.searchable=[];var r,l=v(this.columns);try{for(l.s();!(r=l.n()).done;){var c=r.value;!c.checkbox&&c.searchable&&(this.options.visibleSearch&&c.visible||!this.options.visibleSearch)&&s.searchable.push(c.field)}}catch(h){l.e(h)}finally{l.f()}}if(ss.isEmptyObject(this.filterColumnsPartial)||(s.filter=JSON.stringify(this.filterColumnsPartial,null)),y["default"].extend(s,e||{}),o=ss.calculateObjectValue(this.options,this.options.queryParams,[s],o),o!==!1){t||this.showLoading();var u=y["default"].extend({},ss.calculateObjectValue(null,this.options.ajaxOptions),{type:this.options.method,url:i||this.options.url,data:"application/json"===this.options.contentType&&"post"===this.options.method?JSON.stringify(o):o,cache:this.options.cache,contentType:this.options.contentType,dataType:this.options.dataType,success:function(e,i,o){var a=ss.calculateObjectValue(n.options,n.options.responseHandler,[e,o],e);n.load(a),n.trigger("load-success",a,o&&o.status,o),t||n.hideLoading(),"server"===n.options.sidePagination&&n.options.pageNumber>1&&a[n.options.totalField]>0&&!a[n.options.dataField].length&&n.updatePagination()},error:function(e){if(e&&0===e.status&&n._xhrAbort){return void (n._xhrAbort=!1)}var i=[];"server"===n.options.sidePagination&&(i={},i[n.options.totalField]=0,i[n.options.dataField]=[]),n.load(i),n.trigger("load-error",e&&e.status,e),t||n.$tableLoading.hide()}});return this.options.ajax?ss.calculateObjectValue(this,this.options.ajax,[u],null):(this._xhr&&4!==this._xhr.readyState&&(this._xhrAbort=!0,this._xhr.abort()),this._xhr=y["default"].ajax(u)),o}}}},{key:"initSearchText",value:function(){if(this.options.search&&(this.searchText="",""!==this.options.searchText)){var t=ss.getSearchInput(this);t.val(this.options.searchText),this.onSearch({currentTarget:t,firedByInitSearchText:!0})}}},{key:"getCaret",value:function(){var t=this;this.$header.find("th").each(function(e,i){y["default"](i).find(".sortable").removeClass("desc asc").addClass(y["default"](i).data("field")===t.options.sortName?t.options.sortOrder:"both")})}},{key:"updateSelected",value:function(){var t=this.$selectItem.filter(":enabled").length&&this.$selectItem.filter(":enabled").length===this.$selectItem.filter(":enabled").filter(":checked").length;this.$selectAll.add(this.$selectAll_).prop("checked",t),this.$selectItem.each(function(t,e){y["default"](e).closest("tr")[y["default"](e).prop("checked")?"addClass":"removeClass"]("selected")})}},{key:"updateRows",value:function(){var t=this;this.$selectItem.each(function(e,i){t.data[y["default"](i).data("index")][t.header.stateField]=y["default"](i).prop("checked")})}},{key:"resetRows",value:function(){var t,e=v(this.data);try{for(e.s();!(t=e.n()).done;){var i=t.value;this.$selectAll.prop("checked",!1),this.$selectItem.prop("checked",!1),this.header.stateField&&(i[this.header.stateField]=!1)}}catch(n){e.e(n)}finally{e.f()}this.initHiddenRows()}},{key:"trigger",value:function(t){for(var i,n,o="".concat(t,".bs.table"),a=arguments.length,s=Array(a>1?a-1:0),r=1;a>r;r++){s[r-1]=arguments[r]}(i=this.options)[e.EVENTS[o]].apply(i,[].concat(s,[this])),this.$el.trigger(y["default"].Event(o,{sender:this}),s),(n=this.options).onAll.apply(n,[o].concat([].concat(s,[this]))),this.$el.trigger(y["default"].Event("all.bs.table",{sender:this}),[o,s])}},{key:"resetHeader",value:function(){var t=this;clearTimeout(this.timeoutId_),this.timeoutId_=setTimeout(function(){return t.fitHeader()},this.$el.is(":hidden")?100:0)}},{key:"fitHeader",value:function(){var t=this;if(this.$el.is(":hidden")){return void (this.timeoutId_=setTimeout(function(){return t.fitHeader()},100))}var e=this.$tableBody.get(0),i=e.scrollWidth>e.clientWidth&&e.scrollHeight>e.clientHeight+this.$header.outerHeight()?ss.getScrollBarWidth():0;this.$el.css("margin-top",-this.$header.outerHeight());var n=y["default"](":focus");if(n.length>0){var o=n.parents("th");if(o.length>0){var a=o.attr("data-field");if(void 0!==a){var s=this.$header.find("[data-field='".concat(a,"']"));s.length>0&&s.find(":input").addClass("focus-temp")}}}this.$header_=this.$header.clone(!0,!0),this.$selectAll_=this.$header_.find('[name="btSelectAll"]'),this.$tableHeader.css("margin-right",i).find("table").css("width",this.$el.outerWidth()).html("").attr("class",this.$el.attr("class")).append(this.$header_),this.$tableLoading.css("width",this.$el.outerWidth());var r=y["default"](".focus-temp:visible:eq(0)");r.length>0&&(r.focus(),this.$header.find(".focus-temp").removeClass("focus-temp")),this.$header.find("th[data-field]").each(function(e,i){t.$header_.find(ss.sprintf('th[data-field="%s"]',y["default"](i).data("field"))).data(y["default"](i).data())});for(var l=this.getVisibleFields(),c=this.$header_.find("th"),h=this.$body.find(">tr:not(.no-records-found,.virtual-scroll-top)").eq(0);h.length&&h.find('>td[colspan]:not([colspan="1"])').length;){h=h.next()}var u=h.find("> *").length;h.find("> *").each(function(e,i){var n=y["default"](i);if(ss.hasDetailViewIcon(t.options)&&(0===e&&"right"!==t.options.detailViewAlign||e===u-1&&"right"===t.options.detailViewAlign)){var o=c.filter(".detail"),a=o.innerWidth()-o.find(".fht-cell").width();return void o.find(".fht-cell").width(n.innerWidth()-a)}var s=e-ss.getDetailViewIndexOffset(t.options),r=t.$header_.find(ss.sprintf('th[data-field="%s"]',l[s]));r.length>1&&(r=y["default"](c[n[0].cellIndex]));var h=r.innerWidth()-r.find(".fht-cell").width();r.find(".fht-cell").width(n.innerWidth()-h)}),this.horizontalScroll(),this.trigger("post-header")}},{key:"initFooter",value:function(){if(this.options.showFooter&&!this.options.cardView){var t=this.getData(),e=[],i="";ss.hasDetailViewIcon(this.options)&&(i='
    '),i&&"right"!==this.options.detailViewAlign&&e.push(i);var n,o=v(this.columns);try{for(o.s();!(n=o.n()).done;){var a=n.value,r="",l="",c=[],h={},u=ss.sprintf(' class="%s"',a["class"]);if(a.visible&&(!(this.footerData&&this.footerData.length>0)||a.field in this.footerData[0])){if(this.options.cardView&&!a.cardVisible){return}if(r=ss.sprintf("text-align: %s; ",a.falign?a.falign:a.align),l=ss.sprintf("vertical-align: %s; ",a.valign),h=ss.calculateObjectValue(null,this.options.footerStyle,[a]),h&&h.css){for(var d=0,f=Object.entries(h.css);d0&&(m=this.footerData[0]["_".concat(a.field,"_colspan")]||0),m&&e.push(' colspan="'.concat(m,'" ')),e.push(">"),e.push('
    ');var y="";this.footerData&&this.footerData.length>0&&(y=this.footerData[0][a.field]||""),e.push(ss.calculateObjectValue(a,a.footerFormatter,[t,y],y)),e.push("
    "),e.push('
    '),e.push("
    "),e.push("")}}}catch(w){o.e(w)}finally{o.f()}i&&"right"===this.options.detailViewAlign&&e.push(i),this.options.height||this.$tableFooter.length||(this.$el.append(""),this.$tableFooter=this.$el.find("tfoot")),this.$tableFooter.find("tr").length||this.$tableFooter.html("
    "),this.$tableFooter.find("tr").html(e.join("")),this.trigger("post-footer",this.$tableFooter)}}},{key:"fitFooter",value:function(){var t=this;if(this.$el.is(":hidden")){return void setTimeout(function(){return t.fitFooter()},100)}var e=this.$tableBody.get(0),i=e.scrollWidth>e.clientWidth&&e.scrollHeight>e.clientHeight+this.$header.outerHeight()?ss.getScrollBarWidth():0;this.$tableFooter.css("margin-right",i).find("table").css("width",this.$el.outerWidth()).attr("class",this.$el.attr("class"));var n=this.$tableFooter.find("th"),o=this.$body.find(">tr:first-child:not(.no-records-found)");for(n.find(".fht-cell").width("auto");o.length&&o.find('>td[colspan]:not([colspan="1"])').length;){o=o.next()}var a=o.find("> *").length;o.find("> *").each(function(e,i){var o=y["default"](i);if(ss.hasDetailViewIcon(t.options)&&(0===e&&"left"===t.options.detailViewAlign||e===a-1&&"right"===t.options.detailViewAlign)){var s=n.filter(".detail"),r=s.innerWidth()-s.find(".fht-cell").width();return void s.find(".fht-cell").width(o.innerWidth()-r)}var l=n.eq(e),c=l.innerWidth()-l.find(".fht-cell").width();l.find(".fht-cell").width(o.innerWidth()-c)}),this.horizontalScroll()}},{key:"horizontalScroll",value:function(){var t=this;this.$tableBody.off("scroll").on("scroll",function(){var e=t.$tableBody.scrollLeft();t.options.showHeader&&t.options.height&&t.$tableHeader.scrollLeft(e),t.options.showFooter&&!t.options.cardView&&t.$tableFooter.scrollLeft(e),t.trigger("scroll-body",t.$tableBody)})}},{key:"getVisibleFields",value:function(){var t,e=[],i=v(this.header.fields);try{for(i.s();!(t=i.n()).done;){var n=t.value,o=this.columns[this.fieldsColumnsIndex[n]];o&&o.visible&&e.push(n)}}catch(a){i.e(a)}finally{i.f()}return e}},{key:"initHiddenRows",value:function(){this.hiddenRows=[]}},{key:"getOptions",value:function(){var t=y["default"].extend({},this.options);return delete t.data,y["default"].extend(!0,{},t)}},{key:"refreshOptions",value:function(t){ss.compareObjects(this.options,t,!0)||(this.options=y["default"].extend(this.options,t),this.trigger("refresh-options",this.options),this.destroy(),this.init())}},{key:"getData",value:function(t){var e=this,i=this.options.data;if(!(this.searchText||this.options.customSearch||void 0!==this.options.sortName||this.enableCustomSort)&&ss.isEmptyObject(this.filterColumns)&&ss.isEmptyObject(this.filterColumnsPartial)||t&&t.unfiltered||(i=this.data),t&&t.useCurrentPage&&(i=i.slice(this.pageFrom-1,this.pageTo)),t&&!t.includeHiddenRows){var n=this.getHiddenRows();i=i.filter(function(t){return -1===ss.findIndex(n,t)})}return t&&t.formatted&&i.forEach(function(t){for(var i=0,n=Object.entries(t);i=0;i--){var n=this.options.data[i];(n.hasOwnProperty(t.field)||"$index"===t.field)&&(!n.hasOwnProperty(t.field)&&"$index"===t.field&&t.values.includes(i)||t.values.includes(n[t.field]))&&(e++,this.options.data.splice(i,1))}e&&("server"===this.options.sidePagination&&(this.options.totalRows-=e,this.data=r(this.options.data)),this.initSearch(),this.initPagination(),this.initSort(),this.initBody(!0))}},{key:"removeAll",value:function(){this.options.data.length>0&&(this.options.data.splice(0,this.options.data.length),this.initSearch(),this.initPagination(),this.initBody(!0))}},{key:"insertRow",value:function(t){t.hasOwnProperty("index")&&t.hasOwnProperty("row")&&(this.options.data.splice(t.index,0,t.row),this.initSearch(),this.initPagination(),this.initSort(),this.initBody(!0))}},{key:"updateRow",value:function(t){var e,i=Array.isArray(t)?t:[t],n=v(i);try{for(n.s();!(e=n.n()).done;){var o=e.value;o.hasOwnProperty("index")&&o.hasOwnProperty("row")&&(o.hasOwnProperty("replace")&&o.replace?this.options.data[o.index]=o.row:y["default"].extend(this.options.data[o.index],o.row))}}catch(a){n.e(a)}finally{n.f()}this.initSearch(),this.initPagination(),this.initSort(),this.initBody(!0)}},{key:"getRowByUniqueId",value:function(t){var e,i,n,o=this.options.uniqueId,a=this.options.data.length,s=t,r=null;for(e=a-1;e>=0;e--){if(i=this.options.data[e],i.hasOwnProperty(o)){n=i[o]}else{if(!i._data||!i._data.hasOwnProperty(o)){continue}n=i._data[o]}if("string"==typeof n?s=""+s:"number"==typeof n&&(+n===n&&n%1===0?s=parseInt(s,10):n===+n&&0!==n&&(s=parseFloat(s))),n===s){r=i;break}}return r}},{key:"updateByUniqueId",value:function(t){var e,i=Array.isArray(t)?t:[t],n=null,o=v(i);try{for(o.s();!(e=o.n()).done;){var a=e.value;if(a.hasOwnProperty("id")&&a.hasOwnProperty("row")){var s=this.options.data.indexOf(this.getRowByUniqueId(a.id));-1!==s&&(a.hasOwnProperty("replace")&&a.replace?this.options.data[s]=a.row:y["default"].extend(this.options.data[s],a.row),n=a.id)}}}catch(r){o.e(r)}finally{o.f()}this.initSearch(),this.initPagination(),this.initSort(),this.initBody(!0,n)}},{key:"removeByUniqueId",value:function(t){var e=this.options.data.length,i=this.getRowByUniqueId(t);i&&this.options.data.splice(this.options.data.indexOf(i),1),e!==this.options.data.length&&("server"===this.options.sidePagination&&(this.options.totalRows-=1,this.data=r(this.options.data)),this.initSearch(),this.initPagination(),this.initBody(!0))}},{key:"updateCell",value:function(t){t.hasOwnProperty("index")&&t.hasOwnProperty("field")&&t.hasOwnProperty("value")&&(this.data[t.index][t.field]=t.value,t.reinit!==!1&&(this.initSort(),this.initBody(!0)))}},{key:"updateCellByUniqueId",value:function(t){var e=this,i=Array.isArray(t)?t:[t];i.forEach(function(t){var i=t.id,n=t.field,o=t.value,a=e.options.data.indexOf(e.getRowByUniqueId(i));-1!==a&&(e.options.data[a][n]=o)}),t.reinit!==!1&&(this.initSort(),this.initBody(!0))}},{key:"showRow",value:function(t){this._toggleRow(t,!0)}},{key:"hideRow",value:function(t){this._toggleRow(t,!1)}},{key:"_toggleRow",value:function(t,e){var i;if(t.hasOwnProperty("index")?i=this.getData()[t.index]:t.hasOwnProperty("uniqueId")&&(i=this.getRowByUniqueId(t.uniqueId)),i){var n=ss.findIndex(this.hiddenRows,i);e||-1!==n?e&&n>-1&&this.hiddenRows.splice(n,1):this.hiddenRows.push(i),this.initBody(!0),this.initPagination()}}},{key:"getHiddenRows",value:function(t){if(t){return this.initHiddenRows(),this.initBody(!0),void this.initPagination()}var e,i=this.getData(),n=[],o=v(i);try{for(o.s();!(e=o.n()).done;){var a=e.value;this.hiddenRows.includes(a)&&n.push(a)}}catch(s){o.e(s)}finally{o.f()}return this.hiddenRows=n,n}},{key:"showColumn",value:function(t){var e=this,i=Array.isArray(t)?t:[t];i.forEach(function(t){e._toggleColumn(e.fieldsColumnsIndex[t],!0,!0)})}},{key:"hideColumn",value:function(t){var e=this,i=Array.isArray(t)?t:[t];i.forEach(function(t){e._toggleColumn(e.fieldsColumnsIndex[t],!1,!0)})}},{key:"_toggleColumn",value:function(t,e,i){if(-1!==t&&this.columns[t].visible!==e&&(this.columns[t].visible=e,this.initHeader(),this.initSearch(),this.initPagination(),this.initBody(),this.options.showColumns)){var n=this.$toolbar.find('.keep-open input:not(".toggle-all")').prop("disabled",!1);i&&n.filter(ss.sprintf('[value="%s"]',t)).prop("checked",e),n.filter(":checked").length<=this.options.minimumCountColumns&&n.filter(":checked").prop("disabled",!0)}}},{key:"getVisibleColumns",value:function(){var t=this;return this.columns.filter(function(e){return e.visible&&!t.isSelectionColumn(e)})}},{key:"getHiddenColumns",value:function(){return this.columns.filter(function(t){var e=t.visible;return !e})}},{key:"isSelectionColumn",value:function(t){return t.radio||t.checkbox}},{key:"showAllColumns",value:function(){this._toggleAllColumns(!0)}},{key:"hideAllColumns",value:function(){this._toggleAllColumns(!1)}},{key:"_toggleAllColumns",value:function(t){var e,i=this,n=v(this.columns.slice().reverse());try{for(n.s();!(e=n.n()).done;){var o=e.value;if(o.switchable){if(!t&&this.options.showColumns&&this.getVisibleColumns().length===this.options.minimumCountColumns){continue}o.visible=t}}}catch(a){n.e(a)}finally{n.f()}if(this.initHeader(),this.initSearch(),this.initPagination(),this.initBody(),this.options.showColumns){var s=this.$toolbar.find('.keep-open input[type="checkbox"]:not(".toggle-all")').prop("disabled",!1);t?s.prop("checked",t):s.get().reverse().forEach(function(e){s.filter(":checked").length>i.options.minimumCountColumns&&y["default"](e).prop("checked",t)}),s.filter(":checked").length<=this.options.minimumCountColumns&&s.filter(":checked").prop("disabled",!0)}}},{key:"mergeCells",value:function(t){var e,i,n=t.index,o=this.getVisibleFields().indexOf(t.field),a=t.rowspan||1,s=t.colspan||1,r=this.$body.find(">tr[data-index]");o+=ss.getDetailViewIndexOffset(this.options);var l=r.eq(n).find(">td").eq(o);if(!(0>n||0>o||n>=this.data.length)){for(e=n;n+a>e;e++){for(i=o;o+s>i;i++){r.eq(e).find(">td").eq(i).hide()}}l.attr("rowspan",a).attr("colspan",s).show()}}},{key:"checkAll",value:function(){this._toggleCheckAll(!0)}},{key:"uncheckAll",value:function(){this._toggleCheckAll(!1)}},{key:"_toggleCheckAll",value:function(t){var e=this.getSelections();this.$selectAll.add(this.$selectAll_).prop("checked",t),this.$selectItem.filter(":enabled").prop("checked",t),this.updateRows(),this.updateSelected();var i=this.getSelections();return t?void this.trigger("check-all",i,e):void this.trigger("uncheck-all",i,e)}},{key:"checkInvert",value:function(){var t=this.$selectItem.filter(":enabled"),e=t.filter(":checked");t.each(function(t,e){y["default"](e).prop("checked",!y["default"](e).prop("checked"))}),this.updateRows(),this.updateSelected(),this.trigger("uncheck-some",e),e=this.getSelections(),this.trigger("check-some",e)}},{key:"check",value:function(t){this._toggleCheck(!0,t)}},{key:"uncheck",value:function(t){this._toggleCheck(!1,t)}},{key:"_toggleCheck",value:function(t,e){var i=this.$selectItem.filter('[data-index="'.concat(e,'"]')),n=this.data[e];if(i.is(":radio")||this.options.singleSelect||this.options.multipleSelectRow&&!this.multipleSelectRowCtrlKey&&!this.multipleSelectRowShiftKey){var o,a=v(this.options.data);try{for(a.s();!(o=a.n()).done;){var r=o.value;r[this.header.stateField]=!1}}catch(l){a.e(l)}finally{a.f()}this.$selectItem.filter(":checked").not(i).prop("checked",!1)}if(n[this.header.stateField]=t,this.options.multipleSelectRow){if(this.multipleSelectRowShiftKey&&this.multipleSelectRowLastSelectedIndex>=0){for(var c=this.multipleSelectRowLastSelectedIndexf;f++){this.data[f][this.header.stateField]=!0,this.$selectItem.filter('[data-index="'.concat(f,'"]')).prop("checked",!0)}}this.multipleSelectRowCtrlKey=!1,this.multipleSelectRowShiftKey=!1,this.multipleSelectRowLastSelectedIndex=t?e:-1}i.prop("checked",t),this.updateSelected(),this.trigger(t?"check":"uncheck",this.data[e],i)}},{key:"checkBy",value:function(t){this._toggleCheckBy(!0,t)}},{key:"uncheckBy",value:function(t){this._toggleCheckBy(!1,t)}},{key:"_toggleCheckBy",value:function(t,e){var i=this;if(e.hasOwnProperty("field")&&e.hasOwnProperty("values")){var n=[];this.data.forEach(function(o,a){if(!o.hasOwnProperty(e.field)){return !1}if(e.values.includes(o[e.field])){var s=i.$selectItem.filter(":enabled").filter(ss.sprintf('[data-index="%s"]',a)),r=e.hasOwnProperty("onlyCurrentPage")?e.onlyCurrentPage:!1;if(s=t?s.not(":checked"):s.filter(":checked"),!s.length&&r){return}s.prop("checked",t),o[i.header.stateField]=t,n.push(o),i.trigger(t?"check":"uncheck",o,s)}}),this.updateSelected(),this.trigger(t?"check-some":"uncheck-some",n)}}},{key:"refresh",value:function(t){t&&t.url&&(this.options.url=t.url),t&&t.pageNumber&&(this.options.pageNumber=t.pageNumber),t&&t.pageSize&&(this.options.pageSize=t.pageSize),table.rememberSelecteds={},table.rememberSelectedIds={},this.trigger("refresh",this.initServer(t&&t.silent,t&&t.query,t&&t.url))}},{key:"destroy",value:function(){this.$el.insertBefore(this.$container),y["default"](this.options.toolbar).insertBefore(this.$el),this.$container.next().remove(),this.$container.remove(),this.$el.html(this.$el_.html()).css("margin-top","0").attr("class",this.$el_.attr("class")||"")}},{key:"resetView",value:function(t){var e=0;if(t&&t.height&&(this.options.height=t.height),this.$tableContainer.toggleClass("has-card-view",this.options.cardView),!this.options.cardView&&this.options.showHeader&&this.options.height?(this.$tableHeader.show(),this.resetHeader(),e+=this.$header.outerHeight(!0)+1):(this.$tableHeader.hide(),this.trigger("post-header")),!this.options.cardView&&this.options.showFooter&&(this.$tableFooter.show(),this.fitFooter(),this.options.height&&(e+=this.$tableFooter.outerHeight(!0))),this.$container.hasClass("fullscreen")){this.$tableContainer.css("height",""),this.$tableContainer.css("width","")}else{if(this.options.height){this.$tableBorder&&(this.$tableBorder.css("width",""),this.$tableBorder.css("height",""));var i=this.$toolbar.outerHeight(!0),n=this.$pagination.outerHeight(!0),o=this.options.height-i-n,a=this.$tableBody.find(">table"),s=a.outerHeight();if(this.$tableContainer.css("height","".concat(o,"px")),this.$tableBorder&&a.is(":visible")){var r=o-s-2;this.$tableBody[0].scrollWidth-this.$tableBody.innerWidth()&&(r-=ss.getScrollBarWidth()),this.$tableBorder.css("width","".concat(a.outerWidth(),"px")),this.$tableBorder.css("height","".concat(r,"px"))}}}this.options.cardView?(this.$el.css("margin-top","0"),this.$tableContainer.css("padding-bottom","0"),this.$tableFooter.hide()):(this.getCaret(),this.$tableContainer.css("padding-bottom","".concat(e,"px"))),this.trigger("reset-view")}},{key:"showLoading",value:function(){this.$tableLoading.toggleClass("open",!0);var t=this.options.loadingFontSize;"auto"===this.options.loadingFontSize&&(t=0.04*this.$tableLoading.width(),t=Math.max(12,t),t=Math.min(32,t),t="".concat(t,"px")),this.$tableLoading.find(".loading-text").css("font-size",t)}},{key:"hideLoading",value:function(){this.$tableLoading.toggleClass("open",!1)}},{key:"toggleShowSearch",value:function(){this.$el.parents(".select-table").siblings().slideToggle()}},{key:"togglePagination",value:function(){this.options.pagination=!this.options.pagination;var t=this.options.showButtonIcons?this.options.pagination?this.options.icons.paginationSwitchDown:this.options.icons.paginationSwitchUp:"",e=this.options.showButtonText?this.options.pagination?this.options.formatPaginationSwitchUp():this.options.formatPaginationSwitchDown():"";this.$toolbar.find('button[name="paginationSwitch"]').html("".concat(ss.sprintf(this.constants.html.icon,this.options.iconsPrefix,t)," ").concat(e)),this.updatePagination(),this.trigger("toggle-pagination",this.options.pagination)}},{key:"toggleFullscreen",value:function(){this.$el.closest(".bootstrap-table").toggleClass("fullscreen"),this.resetView()}},{key:"toggleView",value:function(){this.options.cardView=!this.options.cardView,this.initHeader();var t=this.options.showButtonIcons?this.options.cardView?this.options.icons.toggleOn:this.options.icons.toggleOff:"",e=this.options.showButtonText?this.options.cardView?this.options.formatToggleOff():this.options.formatToggleOn():"";this.$toolbar.find('button[name="toggle"]').html("".concat(ss.sprintf(this.constants.html.icon,this.options.iconsPrefix,t)," ").concat(e)),this.initBody(),this.trigger("toggle",this.options.cardView)}},{key:"resetSearch",value:function(t){var e=ss.getSearchInput(this);e.val(t||""),this.onSearch({currentTarget:e})}},{key:"filterBy",value:function(t,e){this.filterOptions=ss.isEmptyObject(e)?this.options.filterOptions:y["default"].extend(this.options.filterOptions,e),this.filterColumns=ss.isEmptyObject(t)?{}:t,this.options.pageNumber=1,this.initSearch(),this.updatePagination()}},{key:"scrollTo",value:function o(t){var e={unit:"px",value:0};"object"===i(t)?e=Object.assign(e,t):"string"==typeof t&&"bottom"===t?e.value=this.$tableBody[0].scrollHeight:("string"==typeof t||"number"==typeof t)&&(e.value=t);var o=e.value;"rows"===e.unit&&(o=0,this.$body.find("> tr:lt(".concat(e.value,")")).each(function(t,e){o+=y["default"](e).outerHeight(!0)})),this.$tableBody.scrollTop(o)}},{key:"getScrollPosition",value:function(){return this.$tableBody.scrollTop()}},{key:"selectPage",value:function(t){t>0&&t<=this.options.totalPages&&(this.options.pageNumber=t,this.updatePagination())}},{key:"prevPage",value:function(){this.options.pageNumber>1&&(this.options.pageNumber--,this.updatePagination())}},{key:"nextPage",value:function(){this.options.pageNumber tr[data-index="%s"]',t));i.next().is("tr.detail-view")?this.collapseRow(t):this.expandRow(t,e),this.resetView()}},{key:"expandRow",value:function(t,e){var i=this.data[t],n=this.$body.find(ss.sprintf('> tr[data-index="%s"][data-has-detail-view]',t));if(this.options.detailViewIcon&&n.find("a.detail-icon").html(ss.sprintf(this.constants.html.icon,this.options.iconsPrefix,this.options.icons.detailClose)),!n.next().is("tr.detail-view")){n.after(ss.sprintf('',n.children("td").length));var o=n.next().find("td"),a=e||this.options.detailFormatter,s=ss.calculateObjectValue(this.options,a,[t,i,o],"");1===o.length&&o.append(s),this.trigger("expand-row",t,i,o)}}},{key:"expandRowByUniqueId",value:function(t){var e=this.getRowByUniqueId(t);e&&this.expandRow(this.data.indexOf(e))}},{key:"collapseRow",value:function(t){var e=this.data[t],i=this.$body.find(ss.sprintf('> tr[data-index="%s"][data-has-detail-view]',t));i.next().is("tr.detail-view")&&(this.options.detailViewIcon&&i.find("a.detail-icon").html(ss.sprintf(this.constants.html.icon,this.options.iconsPrefix,this.options.icons.detailOpen)),this.trigger("collapse-row",t,e,i.next()),i.next().remove())}},{key:"collapseRowByUniqueId",value:function(t){var e=this.getRowByUniqueId(t);e&&this.collapseRow(this.data.indexOf(e))}},{key:"expandAllRows",value:function(){for(var t=this.$body.find("> tr[data-index][data-has-detail-view]"),e=0;e tr[data-index][data-has-detail-view]"),e=0;e1?e-1:0),o=1;e>o;o++){n[o-1]=arguments[o]}var a;return this.each(function(e,o){var s=y["default"](o).data("bootstrap.table"),r=y["default"].extend({},hs.DEFAULTS,y["default"](o).data(),"object"===i(t)&&t);if("string"==typeof t){var l;if(!Ka.METHODS.includes(t)){throw Error("Unknown method: ".concat(t))}if(!s){return}a=(l=s)[t].apply(l,n),"destroy"===t&&y["default"](o).removeData("bootstrap.table")}s||(s=new y["default"].BootstrapTable(o,r),y["default"](o).data("bootstrap.table",s),s.init())}),void 0===a?this:a},y["default"].fn.bootstrapTable.Constructor=hs,y["default"].fn.bootstrapTable.theme=Ka.THEME,y["default"].fn.bootstrapTable.VERSION=Ka.VERSION,y["default"].fn.bootstrapTable.defaults=hs.DEFAULTS,y["default"].fn.bootstrapTable.columnDefaults=hs.COLUMN_DEFAULTS,y["default"].fn.bootstrapTable.events=hs.EVENTS,y["default"].fn.bootstrapTable.locales=hs.LOCALES,y["default"].fn.bootstrapTable.methods=hs.METHODS,y["default"].fn.bootstrapTable.utils=ss,y["default"](function(){y["default"]('[data-toggle="table"]').bootstrapTable()}),hs});var TABLE_EVENTS="all.bs.table click-cell.bs.table dbl-click-cell.bs.table click-row.bs.table dbl-click-row.bs.table sort.bs.table check.bs.table uncheck.bs.table onUncheck check-all.bs.table uncheck-all.bs.table check-some.bs.table uncheck-some.bs.table load-success.bs.table load-error.bs.table column-switch.bs.table page-change.bs.table search.bs.table toggle.bs.table show-search.bs.table expand-row.bs.table collapse-row.bs.table refresh-options.bs.table reset-view.bs.table refresh.bs.table",firstLoadTable=[],union=function(t,e){return $.isPlainObject(e)?addRememberRow(t,e):$.isArray(e)?$.each(e,function(e,i){$.isPlainObject(i)?addRememberRow(t,i):-1==$.inArray(i,t)&&(t[t.length]=i)}):-1==$.inArray(e,t)&&(t[t.length]=e),t},difference=function(t,e){if($.isPlainObject(e)){removeRememberRow(t,e)}else{if($.isArray(e)){$.each(e,function(e,i){if($.isPlainObject(i)){removeRememberRow(t,i)}else{var n=$.inArray(i,t);-1!=n&&t.splice(n,1)}})}else{var i=$.inArray(e,t);-1!=i&&t.splice(i,1)}}return t},_={union:union,difference:difference}; \ No newline at end of file +!function(t,e){"object"===typeof exports&&"undefined"!==typeof module?module.exports=e(require("jquery")):"function"===typeof define&&define.amd?define(["jquery"],e):(t="undefined"!==typeof globalThis?globalThis:t||self,t.BootstrapTable=e(t.jQuery))}(this,function(t){"use strict";function e(t,e){var r=null==t?null:"undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(null!=r){var a,i,n,o,s=[],l=!0,c=!1;try{if(n=(r=r.call(t)).next,0===e){if(Object(r)!==r)return;l=!1}else for(;!(l=(a=n.call(r)).done)&&(s.push(a.value),s.length!==e);l=!0);}catch(t){c=!0,i=t}finally{try{if(!l&&null!=r["return"]&&(o=r["return"](),Object(o)!==o))return}finally{if(c)throw i}}return s}}function r(t,e){if("object"!=typeof t||!t)return t;var r=t[Symbol.toPrimitive];if(void 0!==r){var a=r.call(t,e||"default");if("object"!=typeof a)return a;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===e?String:Number)(t)}function a(t){var e=r(t,"string");return"symbol"==typeof e?e:e+""}function i(t){"@babel/helpers - typeof";return i="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},i(t)}function n(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function o(t,e){for(var r=0;rt.length)e=t.length;for(var r=0,a=new Array(e);r=t.length)return{done:true};return{done:false,value:t[a++]}},e:function(t){throw t},f:i}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var n=true,o=false,s;return{s:function(){r=r.call(t)},n:function(){var t=r.next();n=t.done;return t},e:function(t){o=true;s=t},f:function(){try{if(!n&&null!=r["return"])r["return"]()}finally{if(o)throw s}}}}var m="undefined"!==typeof globalThis?globalThis:"undefined"!==typeof window?window:"undefined"!==typeof global?global:"undefined"!==typeof self?self:{};var y=function(t){return t&&t.Math===Math&&t};var w=y("object"==typeof globalThis&&globalThis)||y("object"==typeof window&&window)||y("object"==typeof self&&self)||y("object"==typeof m&&m)||y("object"==typeof m&&m)||function(){return this}()||Function("return this")();var S={};var x=function(t){try{return!!t()}catch(e){return true}};var O=x;var k=!O(function(){return 7!==Object.defineProperty({},1,{get:function(){return 7}})[1]});var P=x;var C=!P(function(){var t=function(){}.bind();return"function"!=typeof t||t.hasOwnProperty("prototype")});var T=C;var I=Function.prototype.call;var A=T?I.bind(I):function(){return I.apply(I,arguments)};var $={};var R={}.propertyIsEnumerable;var E=Object.getOwnPropertyDescriptor;var j=E&&!R.call({1:2},1);$.f=j?function ky(t){var e=E(this,t);return!!e&&e.enumerable}:R;var _=function(t,e){return{enumerable:!(1&t),configurable:!(2&t),writable:!(4&t),value:e}};var N=C;var F=Function.prototype;var D=F.call;var V=N&&F.bind.bind(D,D);var B=N?V:function(t){return function(){return D.apply(t,arguments)}};var L=B;var H=L({}.toString);var M=L("".slice);var U=function(t){return M(H(t),8,-1)};var z=B;var q=x;var G=U;var W=Object;var K=z("".split);var Y=q(function(){return!W("z").propertyIsEnumerable(0)})?function(t){return"String"===G(t)?K(t,""):W(t)}:W;var J=function(t){return null===t||void 0===t};var X=J;var Q=TypeError;var Z=function(t){if(X(t))throw new Q("Can't call method on "+t);return t};var tt=Y;var et=Z;var rt=function(t){return tt(et(t))};var at="object"==typeof document&&document.all;var it="undefined"==typeof at&&void 0!==at?function(t){return"function"==typeof t||t===at}:function(t){return"function"==typeof t};var nt=it;var ot=function(t){return"object"==typeof t?null!==t:nt(t)};var st=w;var lt=it;var ct=function(t){return lt(t)?t:void 0};var ft=function(t,e){return arguments.length<2?ct(st[t]):st[t]&&st[t][e]};var ut=B;var ht=ut({}.isPrototypeOf);var vt="undefined"!=typeof navigator&&String(navigator.userAgent)||"";var dt=w;var pt=vt;var gt=dt.process;var bt=dt.Deno;var mt=gt&>.versions||bt&&bt.version;var yt=mt&&mt.v8;var wt,St;if(yt){wt=yt.split(".");St=wt[0]>0&&wt[0]<4?1:+(wt[0]+wt[1])}if(!St&&pt){wt=pt.match(/Edge\/(\d+)/);if(!wt||wt[1]>=74){wt=pt.match(/Chrome\/(\d+)/);if(wt)St=+wt[1]}}var xt=St;var Ot=xt;var kt=x;var Pt=w;var Ct=Pt.String;var Tt=!!Object.getOwnPropertySymbols&&!kt(function(){var t=Symbol("symbol detection");return!Ct(t)||!(Object(t)instanceof Symbol)||!Symbol.sham&&Ot&&Ot<41});var It=Tt;var At=It&&!Symbol.sham&&"symbol"==typeof Symbol.iterator;var $t=ft;var Rt=it;var Et=ht;var jt=At;var _t=Object;var Nt=jt?function(t){return"symbol"==typeof t}:function(t){var e=$t("Symbol");return Rt(e)&&Et(e.prototype,_t(t))};var Ft=String;var Dt=function(t){try{return Ft(t)}catch(e){return"Object"}};var Vt=it;var Bt=Dt;var Lt=TypeError;var Ht=function(t){if(Vt(t))return t;throw new Lt(Bt(t)+" is not a function")};var Mt=Ht;var Ut=J;var zt=function(t,e){var r=t[e];return Ut(r)?void 0:Mt(r)};var qt=A;var Gt=it;var Wt=ot;var Kt=TypeError;var Yt=function(t,e){var r,a;if("string"===e&&Gt(r=t.toString)&&!Wt(a=qt(r,t)))return a;if(Gt(r=t.valueOf)&&!Wt(a=qt(r,t)))return a;if("string"!==e&&Gt(r=t.toString)&&!Wt(a=qt(r,t)))return a;throw new Kt("Can't convert object to primitive value")};var Jt={exports:{}};var Xt=false;var Qt=w;var Zt=Object.defineProperty;var te=function(t,e){try{Zt(Qt,t,{value:e,configurable:true,writable:true})}catch(r){Qt[t]=e}return e};var ee=w;var re=te;var ae="__core-js_shared__";var ie=Jt.exports=ee[ae]||re(ae,{});(ie.versions||(ie.versions=[])).push({version:"3.36.1",mode:"global",copyright:"© 2014-2024 Denis Pushkarev (zloirock.ru)",license:"https://github.com/zloirock/core-js/blob/v3.36.1/LICENSE",source:"https://github.com/zloirock/core-js"});var ne=Jt.exports;var oe=ne;var se=function(t,e){return oe[t]||(oe[t]=e||{})};var le=Z;var ce=Object;var fe=function(t){return ce(le(t))};var ue=B;var he=fe;var ve=ue({}.hasOwnProperty);var de=Object.hasOwn||function Py(t,e){return ve(he(t),e)};var pe=B;var ge=0;var be=Math.random();var me=pe(1..toString);var ye=function(t){return"Symbol("+(void 0===t?"":t)+")_"+me(++ge+be,36)};var we=w;var Se=se;var xe=de;var Oe=ye;var ke=Tt;var Pe=At;var Ce=we.Symbol;var Te=Se("wks");var Ie=Pe?Ce["for"]||Ce:Ce&&Ce.withoutSetter||Oe;var Ae=function(t){if(!xe(Te,t))Te[t]=ke&&xe(Ce,t)?Ce[t]:Ie("Symbol."+t);return Te[t]};var $e=A;var Re=ot;var Ee=Nt;var je=zt;var _e=Yt;var Ne=Ae;var Fe=TypeError;var De=Ne("toPrimitive");var Ve=function(t,e){if(!Re(t)||Ee(t))return t;var r=je(t,De);var a;if(r){if(void 0===e)e="default";a=$e(r,t,e);if(!Re(a)||Ee(a))return a;throw new Fe("Can't convert object to primitive value")}if(void 0===e)e="number";return _e(t,e)};var Be=Ve;var Le=Nt;var He=function(t){var e=Be(t,"string");return Le(e)?e:e+""};var Me=w;var Ue=ot;var ze=Me.document;var qe=Ue(ze)&&Ue(ze.createElement);var Ge=function(t){return qe?ze.createElement(t):{}};var We=k;var Ke=x;var Ye=Ge;var Je=!We&&!Ke(function(){return 7!==Object.defineProperty(Ye("div"),"a",{get:function(){return 7}}).a});var Xe=k;var Qe=A;var Ze=$;var tr=_;var er=rt;var rr=He;var ar=de;var ir=Je;var nr=Object.getOwnPropertyDescriptor;S.f=Xe?nr:function Cy(t,e){t=er(t);e=rr(e);if(ir)try{return nr(t,e)}catch(r){}if(ar(t,e))return tr(!Qe(Ze.f,t,e),t[e])};var or={};var sr=k;var lr=x;var cr=sr&&lr(function(){return 42!==Object.defineProperty(function(){},"prototype",{value:42,writable:false}).prototype});var fr=ot;var ur=String;var hr=TypeError;var vr=function(t){if(fr(t))return t;throw new hr(ur(t)+" is not an object")};var dr=k;var pr=Je;var gr=cr;var br=vr;var mr=He;var yr=TypeError;var wr=Object.defineProperty;var Sr=Object.getOwnPropertyDescriptor;var xr="enumerable";var Or="configurable";var kr="writable";or.f=dr?gr?function Ty(t,e,r){br(t);e=mr(e);br(r);if("function"===typeof t&&"prototype"===e&&"value"in r&&kr in r&&!r[kr]){var a=Sr(t,e);if(a&&a[kr]){t[e]=r.value;r={configurable:Or in r?r[Or]:a[Or],enumerable:xr in r?r[xr]:a[xr],writable:false}}}return wr(t,e,r)}:wr:function Iy(t,e,r){br(t);e=mr(e);br(r);if(pr)try{return wr(t,e,r)}catch(a){}if("get"in r||"set"in r)throw new yr("Accessors not supported");if("value"in r)t[e]=r.value;return t};var Pr=k;var Cr=or;var Tr=_;var Ir=Pr?function(t,e,r){return Cr.f(t,e,Tr(1,r))}:function(t,e,r){t[e]=r;return t};var Ar={exports:{}};var $r=k;var Rr=de;var Er=Function.prototype;var jr=$r&&Object.getOwnPropertyDescriptor;var _r=Rr(Er,"name");var Nr=_r&&"something"===function Ay(){}.name;var Fr=_r&&(!$r||$r&&jr(Er,"name").configurable);var Dr={EXISTS:_r,PROPER:Nr,CONFIGURABLE:Fr};var Vr=B;var Br=it;var Lr=ne;var Hr=Vr(Function.toString);if(!Br(Lr.inspectSource))Lr.inspectSource=function(t){return Hr(t)};var Mr=Lr.inspectSource;var Ur=w;var zr=it;var qr=Ur.WeakMap;var Gr=zr(qr)&&/native code/.test(String(qr));var Wr=se;var Kr=ye;var Yr=Wr("keys");var Jr=function(t){return Yr[t]||(Yr[t]=Kr(t))};var Xr={};var Qr=Gr;var Zr=w;var ta=ot;var ea=Ir;var ra=de;var aa=ne;var ia=Jr;var na=Xr;var oa="Object already initialized";var sa=Zr.TypeError;var la=Zr.WeakMap;var ca,fa,ua;var ha=function(t){return ua(t)?fa(t):ca(t,{})};var va=function(t){return function(e){var r;if(!ta(e)||(r=fa(e)).type!==t)throw new sa("Incompatible receiver, "+t+" required");return r}};if(Qr||aa.state){var da=aa.state||(aa.state=new la);da.get=da.get;da.has=da.has;da.set=da.set;ca=function(t,e){if(da.has(t))throw new sa(oa);e.facade=t;da.set(t,e);return e};fa=function(t){return da.get(t)||{}};ua=function(t){return da.has(t)}}else{var pa=ia("state");na[pa]=true;ca=function(t,e){if(ra(t,pa))throw new sa(oa);e.facade=t;ea(t,pa,e);return e};fa=function(t){return ra(t,pa)?t[pa]:{}};ua=function(t){return ra(t,pa)}}var ga={set:ca,get:fa,has:ua,enforce:ha,getterFor:va};var ba=B;var ma=x;var ya=it;var wa=de;var Sa=k;var xa=Dr.CONFIGURABLE;var Oa=Mr;var ka=ga;var Pa=ka.enforce;var Ca=ka.get;var Ta=String;var Ia=Object.defineProperty;var Aa=ba("".slice);var $a=ba("".replace);var Ra=ba([].join);var Ea=Sa&&!ma(function(){return 8!==Ia(function(){},"length",{value:8}).length});var ja=String(String).split("String");var _a=Ar.exports=function(t,e,r){if("Symbol("===Aa(Ta(e),0,7))e="["+$a(Ta(e),/^Symbol\(([^)]*)\).*$/,"$1")+"]";if(r&&r.getter)e="get "+e;if(r&&r.setter)e="set "+e;if(!wa(t,"name")||xa&&t.name!==e)if(Sa)Ia(t,"name",{value:e,configurable:true});else t.name=e;if(Ea&&r&&wa(r,"arity")&&t.length!==r.arity)Ia(t,"length",{value:r.arity});try{if(r&&wa(r,"constructor")&&r.constructor){if(Sa)Ia(t,"prototype",{writable:false})}else if(t.prototype)t.prototype=void 0}catch(a){}var i=Pa(t);if(!wa(i,"source"))i.source=Ra(ja,"string"==typeof e?e:"");return t};Function.prototype.toString=_a(function $y(){return ya(this)&&Ca(this).source||Oa(this)},"toString");var Na=Ar.exports;var Fa=it;var Da=or;var Va=Na;var Ba=te;var La=function(t,e,r,a){if(!a)a={};var i=a.enumerable;var n=void 0!==a.name?a.name:e;if(Fa(r))Va(r,n,a);if(a.global)if(i)t[e]=r;else Ba(e,r);else{try{if(!a.unsafe)delete t[e];else if(t[e])i=true}catch(o){}if(i)t[e]=r;else Da.f(t,e,{value:r,enumerable:false,configurable:!a.nonConfigurable,writable:!a.nonWritable})}return t};var Ha={};var Ma=Math.ceil;var Ua=Math.floor;var za=Math.trunc||function Ry(t){var e=+t;return(e>0?Ua:Ma)(e)};var qa=za;var Ga=function(t){var e=+t;return e!==e||0===e?0:qa(e)};var Wa=Ga;var Ka=Math.max;var Ya=Math.min;var Ja=function(t,e){var r=Wa(t);return r<0?Ka(r+e,0):Ya(r,e)};var Xa=Ga;var Qa=Math.min;var Za=function(t){var e=Xa(t);return e>0?Qa(e,9007199254740991):0};var ti=Za;var ei=function(t){return ti(t.length)};var ri=rt;var ai=Ja;var ii=ei;var ni=function(t){return function(e,r,a){var i=ri(e);var n=ii(i);if(0===n)return!t&&-1;var o=ai(a,n);var s;if(t&&r!==r)while(n>o){s=i[o++];if(s!==s)return true}else for(;n>o;o++)if((t||o in i)&&i[o]===r)return t||o||0;return!t&&-1}};var oi={includes:ni(true),indexOf:ni(false)};var si=B;var li=de;var ci=rt;var fi=oi.indexOf;var ui=Xr;var hi=si([].push);var vi=function(t,e){var r=ci(t);var a=0;var i=[];var n;for(n in r)!li(ui,n)&&li(r,n)&&hi(i,n);while(e.length>a)if(li(r,n=e[a++]))~fi(i,n)||hi(i,n);return i};var di=["constructor","hasOwnProperty","isPrototypeOf","propertyIsEnumerable","toLocaleString","toString","valueOf"];var pi=vi;var gi=di;var bi=gi.concat("length","prototype");Ha.f=Object.getOwnPropertyNames||function Ey(t){return pi(t,bi)};var mi={};mi.f=Object.getOwnPropertySymbols;var yi=ft;var wi=B;var Si=Ha;var xi=mi;var Oi=vr;var ki=wi([].concat);var Pi=yi("Reflect","ownKeys")||function jy(t){var e=Si.f(Oi(t));var r=xi.f;return r?ki(e,r(t)):e};var Ci=de;var Ti=Pi;var Ii=S;var Ai=or;var $i=function(t,e,r){var a=Ti(e);var i=Ai.f;var n=Ii.f;for(var o=0;oXi)throw Ji("Maximum allowed index exceeded");return t};var Zi=k;var tn=or;var en=_;var rn=function(t,e,r){if(Zi)tn.f(t,e,en(0,r));else t[e]=r};var an=Ae;var nn=an("toStringTag");var on={};on[nn]="z";var sn="[object z]"===String(on);var ln=sn;var cn=it;var fn=U;var un=Ae;var hn=un("toStringTag");var vn=Object;var dn="Arguments"===fn(function(){return arguments}());var pn=function(t,e){try{return t[e]}catch(r){}};var gn=ln?fn:function(t){var e,r,a;return void 0===t?"Undefined":null===t?"Null":"string"==typeof(r=pn(e=vn(t),hn))?r:dn?fn(e):"Object"===(a=fn(e))&&cn(e.callee)?"Arguments":a};var bn=B;var mn=x;var yn=it;var wn=gn;var Sn=ft;var xn=Mr;var On=function(){};var kn=Sn("Reflect","construct");var Pn=/^\s*(?:class|function)\b/;var Cn=bn(Pn.exec);var Tn=!Pn.test(On);var In=function Ny(t){if(!yn(t))return false;try{kn(On,[],t);return true}catch(e){return false}};var An=function Fy(t){if(!yn(t))return false;switch(wn(t)){case"AsyncFunction":case"GeneratorFunction":case"AsyncGeneratorFunction":return false}try{return Tn||!!Cn(Pn,xn(t))}catch(e){return true}};An.sham=true;var $n=!kn||mn(function(){var t;return In(In.call)||!In(Object)||!In(function(){t=true})||t})?An:In;var Rn=Yi;var En=$n;var jn=ot;var _n=Ae;var Nn=_n("species");var Fn=Array;var Dn=function(t){var e;if(Rn(t)){e=t.constructor;if(En(e)&&(e===Fn||Rn(e.prototype)))e=void 0;else if(jn(e)){e=e[Nn];if(null===e)e=void 0}}return void 0===e?Fn:e};var Vn=Dn;var Bn=function(t,e){return new(Vn(t))(0===e?0:e)};var Ln=x;var Hn=Ae;var Mn=xt;var Un=Hn("species");var zn=function(t){return Mn>=51||!Ln(function(){var e=[];var r=e.constructor={};r[Un]=function(){return{foo:1}};return 1!==e[t](Boolean).foo})};var qn=Wi;var Gn=x;var Wn=Yi;var Kn=ot;var Yn=fe;var Jn=ei;var Xn=Qi;var Qn=rn;var Zn=Bn;var to=zn;var eo=Ae;var ro=xt;var ao=eo("isConcatSpreadable");var io=ro>=51||!Gn(function(){var t=[];t[ao]=false;return t.concat()[0]!==t});var no=function(t){if(!Kn(t))return false;var e=t[ao];return void 0!==e?!!e:Wn(t)};var oo=!io||!to("concat");qn({target:"Array",proto:true,arity:1,forced:oo},{concat:function Dy(t){var e=Yn(this);var r=Zn(e,0);var a=0;var i,n,o,s,l;for(i=-1,o=arguments.length;ig;g++)if(s||g in v){y=v[g];w=p(y,g,h);if(t)if(e)m[g]=w;else if(w)switch(t){case 3:return true;case 5:return y;case 6:return g;case 2:xo(m,y)}else switch(t){case 4:return false;case 7:xo(m,y)}}return n?-1:a||i?i:m}};var ko={forEach:Oo(0),map:Oo(1),filter:Oo(2),some:Oo(3),every:Oo(4),find:Oo(5),findIndex:Oo(6),filterReject:Oo(7)};var Po=Wi;var Co=ko.filter;var To=zn;var Io=To("filter");Po({target:"Array",proto:true,forced:!Io},{filter:function Vy(t){return Co(this,t,arguments.length>1?arguments[1]:void 0)}});var Ao={};var $o=vi;var Ro=di;var Eo=Object.keys||function By(t){return $o(t,Ro)};var jo=k;var _o=cr;var No=or;var Fo=vr;var Do=rt;var Vo=Eo;Ao.f=jo&&!_o?Object.defineProperties:function Ly(t,e){Fo(t);var r=Do(e);var a=Vo(e);var i=a.length;var n=0;var o;while(i>n)No.f(t,o=a[n++],r[o]);return t};var Bo=ft;var Lo=Bo("document","documentElement");var Ho=vr;var Mo=Ao;var Uo=di;var zo=Xr;var qo=Lo;var Go=Ge;var Wo=Jr;var Ko=">";var Yo="<";var Jo="prototype";var Xo="script";var Qo=Wo("IE_PROTO");var Zo=function(){};var ts=function(t){return Yo+Xo+Ko+t+Yo+"/"+Xo+Ko};var es=function(t){t.write(ts(""));t.close();var e=t.parentWindow.Object;t=null;return e};var rs=function(){var t=Go("iframe");var e="java"+Xo+":";var r;t.style.display="none";qo.appendChild(t);t.src=String(e);r=t.contentWindow.document;r.open();r.write(ts("document.F=Object"));r.close();return r.F};var as;var is=function(){try{as=new ActiveXObject("htmlfile")}catch(t){}is="undefined"!=typeof document?document.domain&&as?es(as):rs():es(as);var e=Uo.length;while(e--)delete is[Jo][Uo[e]];return is()};zo[Qo]=true;var ns=Object.create||function Hy(t,e){var r;if(null!==t){Zo[Jo]=Ho(t);r=new Zo;Zo[Jo]=null;r[Qo]=t}else r=is();return void 0===e?r:Mo.f(r,e)};var os=Ae;var ss=ns;var ls=or.f;var cs=os("unscopables");var fs=Array.prototype;if(void 0===fs[cs])ls(fs,cs,{configurable:true,value:ss(null)});var us=function(t){fs[cs][t]=true};var hs=Wi;var vs=ko.find;var ds=us;var ps="find";var gs=true;if(ps in[])Array(1)[ps](function(){gs=false});hs({target:"Array",proto:true,forced:gs},{find:function My(t){return vs(this,t,arguments.length>1?arguments[1]:void 0)}});ds(ps);var bs=Wi;var ms=ko.findIndex;var ys=us;var ws="findIndex";var Ss=true;if(ws in[])Array(1)[ws](function(){Ss=false});bs({target:"Array",proto:true,forced:Ss},{findIndex:function Uy(t){return ms(this,t,arguments.length>1?arguments[1]:void 0)}});ys(ws);var xs=Wi;var Os=oi.includes;var ks=x;var Ps=us;var Cs=ks(function(){return!Array(1).includes()});xs({target:"Array",proto:true,forced:Cs},{includes:function zy(t){return Os(this,t,arguments.length>1?arguments[1]:void 0)}});Ps("includes");var Ts=x;var Is=function(t,e){var r=[][t];return!!r&&Ts(function(){r.call(null,e||function(){return 1},1)})};var As=Wi;var $s=co;var Rs=oi.indexOf;var Es=Is;var js=$s([].indexOf);var _s=!!js&&1/js([1],1,-0)<0;var Ns=_s||!Es("indexOf");As({target:"Array",proto:true,forced:Ns},{indexOf:function qy(t){var e=arguments.length>1?arguments[1]:void 0;return _s?js(this,t,e)||0:Rs(this,t,e)}});var Fs={};var Ds=x;var Vs=!Ds(function(){function t(){}t.prototype.constructor=null;return Object.getPrototypeOf(new t)!==t.prototype});var Bs=de;var Ls=it;var Hs=fe;var Ms=Jr;var Us=Vs;var zs=Ms("IE_PROTO");var qs=Object;var Gs=qs.prototype;var Ws=Us?qs.getPrototypeOf:function(t){var e=Hs(t);if(Bs(e,zs))return e[zs];var r=e.constructor;if(Ls(r)&&e instanceof r)return r.prototype;return e instanceof qs?Gs:null};var Ks=x;var Ys=it;var Js=ot;var Xs=Ws;var Qs=La;var Zs=Ae;var tl=Zs("iterator");var el=false;var rl,al,il;if([].keys){il=[].keys();if(!("next"in il))el=true;else{al=Xs(Xs(il));if(al!==Object.prototype)rl=al}}var nl=!Js(rl)||Ks(function(){var t={};return rl[tl].call(t)!==t});if(nl)rl={};if(!Ys(rl[tl]))Qs(rl,tl,function(){return this});var ol={IteratorPrototype:rl,BUGGY_SAFARI_ITERATORS:el};var sl=or.f;var ll=de;var cl=Ae;var fl=cl("toStringTag");var ul=function(t,e,r){if(t&&!r)t=t.prototype;if(t&&!ll(t,fl))sl(t,fl,{configurable:true,value:e})};var hl=ol.IteratorPrototype;var vl=ns;var dl=_;var pl=ul;var gl=Fs;var bl=function(){return this};var ml=function(t,e,r,a){var i=e+" Iterator";t.prototype=vl(hl,{next:dl(+!a,r)});pl(t,i,false);gl[i]=bl;return t};var yl=B;var wl=Ht;var Sl=function(t,e,r){try{return yl(wl(Object.getOwnPropertyDescriptor(t,e)[r]))}catch(a){}};var xl=ot;var Ol=function(t){return xl(t)||null===t};var kl=Ol;var Pl=String;var Cl=TypeError;var Tl=function(t){if(kl(t))return t;throw new Cl("Can't set "+Pl(t)+" as a prototype")};var Il=Sl;var Al=ot;var $l=Z;var Rl=Tl;var El=Object.setPrototypeOf||("__proto__"in{}?function(){var t=false;var e={};var r;try{r=Il(Object.prototype,"__proto__","set");r(e,[]);t=e instanceof Array}catch(a){}return function i(e,a){$l(e);Rl(a);if(!Al(e))return e;if(t)r(e,a);else e.__proto__=a;return e}}():void 0);var jl=Wi;var _l=A;var Nl=Dr;var Fl=it;var Dl=ml;var Vl=Ws;var Bl=El;var Ll=ul;var Hl=Ir;var Ml=La;var Ul=Ae;var zl=Fs;var ql=ol;var Gl=Nl.PROPER;var Wl=Nl.CONFIGURABLE;var Kl=ql.IteratorPrototype;var Yl=ql.BUGGY_SAFARI_ITERATORS;var Jl=Ul("iterator");var Xl="keys";var Ql="values";var Zl="entries";var tc=function(){return this};var ec=function(t,e,r,a,i,n,o){Dl(r,e,a);var s=function(t){if(t===i&&h)return h;if(!Yl&&t&&t in f)return f[t];switch(t){case Xl:return function e(){return new r(this,t)};case Ql:return function a(){return new r(this,t)};case Zl:return function n(){return new r(this,t)}}return function(){return new r(this)}};var l=e+" Iterator";var c=false;var f=t.prototype;var u=f[Jl]||f["@@iterator"]||i&&f[i];var h=!Yl&&u||s(i);var v="Array"===e?f.entries||u:u;var d,p,g;if(v){d=Vl(v.call(new t));if(d!==Object.prototype&&d.next){if(Vl(d)!==Kl)if(Bl)Bl(d,Kl);else if(!Fl(d[Jl]))Ml(d,Jl,tc);Ll(d,l,true)}}if(Gl&&i===Ql&&u&&u.name!==Ql)if(Wl)Hl(f,"name",Ql);else{c=true;h=function b(){return _l(u,this)}}if(i){p={values:s(Ql),keys:n?h:s(Xl),entries:s(Zl)};if(o){for(g in p)if(Yl||c||!(g in f))Ml(f,g,p[g])}else jl({target:e,proto:true,forced:Yl||c},p)}if(f[Jl]!==h)Ml(f,Jl,h,{name:i});zl[e]=h;return p};var rc=function(t,e){return{value:t,done:e}};var ac=rt;var ic=us;var nc=Fs;var oc=ga;var sc=or.f;var lc=ec;var cc=rc;var fc=k;var uc="Array Iterator";var hc=oc.set;var vc=oc.getterFor(uc);var dc=lc(Array,"Array",function(t,e){hc(this,{type:uc,target:ac(t),index:0,kind:e})},function(){var t=vc(this);var e=t.target;var r=t.index++;if(!e||r>=e.length){t.target=void 0;return cc(void 0,true)}switch(t.kind){case"keys":return cc(r,false);case"values":return cc(e[r],false)}return cc([r,e[r]],false)},"values");var pc=nc.Arguments=nc.Array;ic("keys");ic("values");ic("entries");if(fc&&"values"!==pc.name)try{sc(pc,"name",{value:"values"})}catch(gc){}var bc=Wi;var mc=B;var yc=Y;var wc=rt;var Sc=Is;var xc=mc([].join);var Oc=yc!==Object;var kc=Oc||!Sc("join",",");bc({target:"Array",proto:true,forced:kc},{join:function Gy(t){return xc(wc(this),void 0===t?",":t)}});var Pc=Wi;var Cc=ko.map;var Tc=zn;var Ic=Tc("map");Pc({target:"Array",proto:true,forced:!Ic},{map:function Wy(t){return Cc(this,t,arguments.length>1?arguments[1]:void 0)}});var Ac=Wi;var $c=B;var Rc=Yi;var Ec=$c([].reverse);var jc=[1,2];Ac({target:"Array",proto:true,forced:String(jc)===String(jc.reverse())},{reverse:function Ky(){if(Rc(this))this.length=this.length;return Ec(this)}});var _c=B;var Nc=_c([].slice);var Fc=Wi;var Dc=Yi;var Vc=$n;var Bc=ot;var Lc=Ja;var Hc=ei;var Mc=rt;var Uc=rn;var zc=Ae;var qc=zn;var Gc=Nc;var Wc=qc("slice");var Kc=zc("species");var Yc=Array;var Jc=Math.max;Fc({target:"Array",proto:true,forced:!Wc},{slice:function Yy(t,e){var r=Mc(this);var a=Hc(r);var i=Lc(t,a);var n=Lc(void 0===e?a:e,a);var o,s,l;if(Dc(r)){o=r.constructor;if(Vc(o)&&(o===Yc||Dc(o.prototype)))o=void 0;else if(Bc(o)){o=o[Kc];if(null===o)o=void 0}if(o===Yc||void 0===o)return Gc(r,i,n)}s=new(void 0===o?Yc:o)(Jc(n-i,0));for(l=0;i0)t[n]=t[--n];if(n!==a++)t[n]=i}}else{var o=nf(r/2);var s=of(af(t,0,o),e);var l=of(af(t,o),e);var c=s.length;var f=l.length;var u=0;var h=0;while(u3)return;if(Tf)return true;if(Af)return Af<603;var t="";var e,r,a,i;for(e=65;e<76;e++){r=String.fromCharCode(e);switch(e){case 66:case 69:case 70:case 72:a=3;break;case 68:case 71:a=4;break;default:a=2}for(i=0;i<47;i++)$f.push({k:r+i,v:a})}$f.sort(function(t,e){return e.v-t.v});for(i=0;i<$f.length;i++){r=$f[i].k.charAt(0);if(t.charAt(t.length-1)!==r)t+=r}return"DGBEFHACIJK"!==t});var Df=jf||!_f||!Nf||!Ff;var Vf=function(t){return function(e,r){if(void 0===r)return-1;if(void 0===e)return 1;if(void 0!==t)return+t(e,r)||0;return xf(e)>xf(r)?1:-1}};gf({target:"Array",proto:true,forced:Df},{sort:function Jy(t){if(void 0!==t)mf(t);var e=yf(this);if(Ff)return void 0===t?Rf(e):Rf(e,t);var r=[];var a=wf(e);var i,n;for(n=0;na-s+o;c--)tu(r,c-1)}else if(o>s)for(c=a-s;c>i;c--){f=c+s-1;u=c+o-1;if(f in r)r[u]=r[f];else tu(r,u)}for(c=0;c2){e=qu(e);r=Xu(e,0);if(43===r||45===r){a=Xu(e,2);if(88===a||120===a)return NaN}else if(48===r){switch(Xu(e,1)){case 66:case 98:i=2;n=49;break;case 79:case 111:i=8;n=55;break;default:return+e}o=Ju(e,2);s=o.length;for(l=0;ln)return NaN}return parseInt(o,i)}}return+e};var th=_u(Gu,!Wu(" 0o1")||!Wu("0b1")||Wu("+0x1"));var eh=function(t){return Du(Ku,t)&&Lu(function(){zu(t)})};var rh=function Zy(t){var e=arguments.length<1?0:Wu(Qu(t));return eh(this)?Fu(Object(e),this,rh):e};rh.prototype=Ku;if(th&&!Au)Ku.constructor=rh;Iu({global:true,constructor:true,wrap:true,forced:th},{Number:rh});var ah=function(t,e){for(var r=$u?Hu(e):("MAX_VALUE,MIN_VALUE,NaN,NEGATIVE_INFINITY,POSITIVE_INFINITY,"+"EPSILON,MAX_SAFE_INTEGER,MIN_SAFE_INTEGER,isFinite,isInteger,isNaN,isSafeInteger,parseFloat,parseInt,"+"fromString,range").split(","),a=0,i;r.length>a;a++)if(Nu(e,i=r[a])&&!Nu(t,i))Uu(t,i,Mu(e,i))};if(th||Au)ah(Eu[Gu],Wu);var ih=k;var nh=B;var oh=A;var sh=x;var lh=Eo;var ch=mi;var fh=$;var uh=fe;var hh=Y;var vh=Object.assign;var dh=Object.defineProperty;var ph=nh([].concat);var gh=!vh||sh(function(){if(ih&&1!==vh({b:1},vh(dh({},"a",{enumerable:true,get:function(){dh(this,"b",{value:3,enumerable:false})}}),{b:2})).b)return true;var t={};var e={};var r=Symbol("assign detection");var a="abcdefghijklmnopqrst";t[r]=7;a.split("").forEach(function(t){e[t]=t});return 7!==vh({},t)[r]||lh(vh({},e)).join("")!==a})?function tw(t,e){var r=uh(t);var a=arguments.length;var i=1;var n=ch.f;var o=fh.f;while(a>i){var s=hh(arguments[i++]);var l=n?ph(lh(s),n(s)):lh(s);var c=l.length;var f=0;var u;while(c>f){u=l[f++];if(!ih||oh(o,s,u))r[u]=s[u]}}return r}:vh;var bh=Wi;var mh=gh;bh({target:"Object",stat:true,arity:2,forced:Object.assign!==mh},{assign:mh});var yh=k;var wh=x;var Sh=B;var xh=Ws;var Oh=Eo;var kh=rt;var Ph=$.f;var Ch=Sh(Ph);var Th=Sh([].push);var Ih=yh&&wh(function(){var t=Object.create(null);t[2]=2;return!Ch(t,2)});var Ah=function(t){return function(e){var r=kh(e);var a=Oh(r);var i=Ih&&null===xh(r);var n=a.length;var o=0;var s=[];var l;while(n>o){l=a[o++];if(!yh||(i?l in r:Ch(r,l)))Th(s,t?[l,r[l]]:r[l])}return s}};var $h={entries:Ah(true),values:Ah(false)};var Rh=Wi;var Eh=$h.entries;Rh({target:"Object",stat:true},{entries:function ew(t){return Eh(t)}});var jh=Wi;var _h=fe;var Nh=Eo;var Fh=x;var Dh=Fh(function(){Nh(1)});jh({target:"Object",stat:true,forced:Dh},{keys:function rw(t){return Nh(_h(t))}});var Vh=sn;var Bh=gn;var Lh=Vh?{}.toString:function aw(){return"[object "+Bh(this)+"]"};var Hh=sn;var Mh=La;var Uh=Lh;if(!Hh)Mh(Object.prototype,"toString",Uh,{unsafe:true});var zh=w;var qh=x;var Gh=B;var Wh=rf;var Kh=Tu.trim;var Yh=mu;var Jh=Gh("".charAt);var Xh=zh.parseFloat;var Qh=zh.Symbol;var Zh=Qh&&Qh.iterator;var tv=1/Xh(Yh+"-0")!==-(1/0)||Zh&&!qh(function(){Xh(Object(Zh))});var ev=tv?function iw(t){var e=Kh(Wh(t));var r=Xh(e);return 0===r&&"-"===Jh(e,0)?-0:r}:Xh;var rv=Wi;var av=ev;rv({global:true,forced:parseFloat!==av},{parseFloat:av});var iv=w;var nv=x;var ov=B;var sv=rf;var lv=Tu.trim;var cv=mu;var fv=iv.parseInt;var uv=iv.Symbol;var hv=uv&&uv.iterator;var vv=/^[+-]?0x/i;var dv=ov(vv.exec);var pv=8!==fv(cv+"08")||22!==fv(cv+"0x16")||hv&&!nv(function(){fv(Object(hv))});var gv=pv?function nw(t,e){var r=lv(sv(t));return fv(r,e>>>0||(dv(vv,r)?16:10))}:fv;var bv=Wi;var mv=gv;bv({global:true,forced:parseInt!==mv},{parseInt:mv});var yv=ot;var wv=U;var Sv=Ae;var xv=Sv("match");var Ov=function(t){var e;return yv(t)&&(void 0!==(e=t[xv])?!!e:"RegExp"===wv(t))};var kv=vr;var Pv=function(){var t=kv(this);var e="";if(t.hasIndices)e+="d";if(t.global)e+="g";if(t.ignoreCase)e+="i";if(t.multiline)e+="m";if(t.dotAll)e+="s";if(t.unicode)e+="u";if(t.unicodeSets)e+="v";if(t.sticky)e+="y";return e};var Cv=A;var Tv=de;var Iv=ht;var Av=Pv;var $v=RegExp.prototype;var Rv=function(t){var e=t.flags;return void 0===e&&!("flags"in $v)&&!Tv(t,"flags")&&Iv($v,t)?Cv(Av,t):e};var Ev=x;var jv=w;var _v=jv.RegExp;var Nv=Ev(function(){var t=_v("a","y");t.lastIndex=2;return null!==t.exec("abcd")});var Fv=Nv||Ev(function(){return!_v("a","y").sticky});var Dv=Nv||Ev(function(){var t=_v("^r","gy");t.lastIndex=2;return null!==t.exec("str")});var Vv={BROKEN_CARET:Dv,MISSED_STICKY:Fv,UNSUPPORTED_Y:Nv};var Bv=or.f;var Lv=function(t,e,r){r in t||Bv(t,r,{configurable:true,get:function(){return e[r]},set:function(t){e[r]=t}})};var Hv=Na;var Mv=or;var Uv=function(t,e,r){if(r.get)Hv(r.get,e,{getter:true});if(r.set)Hv(r.set,e,{setter:true});return Mv.f(t,e,r)};var zv=ft;var qv=Uv;var Gv=Ae;var Wv=k;var Kv=Gv("species");var Yv=function(t){var e=zv(t);if(Wv&&e&&!e[Kv])qv(e,Kv,{configurable:true,get:function(){return this}})};var Jv=x;var Xv=w;var Qv=Xv.RegExp;var Zv=Jv(function(){var t=Qv(".","s");return!(t.dotAll&&t.test("\n")&&"s"===t.flags)});var td=x;var ed=w;var rd=ed.RegExp;var ad=td(function(){var t=rd("(?b)","g");return"b"!==t.exec("b").groups.a||"bc"!=="b".replace(t,"$c")});var id=k;var nd=w;var od=B;var sd=Bi;var ld=pu;var cd=Ir;var fd=ns;var ud=Ha.f;var hd=ht;var vd=Ov;var dd=rf;var pd=Rv;var gd=Vv;var bd=Lv;var md=La;var yd=x;var wd=de;var Sd=ga.enforce;var xd=Yv;var Od=Ae;var kd=Zv;var Pd=ad;var Cd=Od("match");var Td=nd.RegExp;var Id=Td.prototype;var Ad=nd.SyntaxError;var $d=od(Id.exec);var Rd=od("".charAt);var Ed=od("".replace);var jd=od("".indexOf);var _d=od("".slice);var Nd=/^\?<[^\s\d!#%&*+<=>@^][^\s!#%&*+<=>@^]*>/;var Fd=/a/g;var Dd=/a/g;var Vd=new Td(Fd)!==Fd;var Bd=gd.MISSED_STICKY;var Ld=gd.UNSUPPORTED_Y;var Hd=id&&(!Vd||Bd||kd||Pd||yd(function(){Dd[Cd]=false;return Td(Fd)!==Fd||Td(Dd)===Dd||"/a/i"!==String(Td(Fd,"i"))}));var Md=function(t){var e=t.length;var r=0;var a="";var i=false;var n;for(;r<=e;r++){n=Rd(t,r);if("\\"===n){a+=n+Rd(t,++r);continue}if(!i&&"."===n)a+="[\\s\\S]";else{if("["===n)i=true;else if("]"===n)i=false;a+=n}}return a};var Ud=function(t){var e=t.length;var r=0;var a="";var i=[];var n=fd(null);var o=false;var s=false;var l=0;var c="";var f;for(;r<=e;r++){f=Rd(t,r);if("\\"===f)f+=Rd(t,++r);else if("]"===f)o=false;else if(!o)switch(true){case"["===f:o=true;break;case"("===f:if($d(Nd,_d(t,r+1))){r+=2;s=true}a+=f;l++;continue;case">"===f&&s:if(""===c||wd(n,c))throw new Ad("Invalid capture group name");n[c]=true;i[i.length]=[c,l];s=false;c="";continue}if(s)c+=f;else a+=f}return[a,i]};if(sd("RegExp",Hd)){var zd=function ow(t,e){var r=hd(Id,this);var a=vd(t);var i=void 0===e;var n=[];var o=t;var s,l,c,f,u,h;if(!r&&a&&i&&t.constructor===zd)return t;if(a||hd(Id,t)){t=t.source;if(i)e=pd(o)}t=void 0===t?"":dd(t);e=void 0===e?"":dd(e);o=t;if(kd&&"dotAll"in Fd){l=!!e&&jd(e,"s")>-1;if(l)e=Ed(e,/s/g,"")}s=e;if(Bd&&"sticky"in Fd){c=!!e&&jd(e,"y")>-1;if(c&&Ld)e=Ed(e,/y/g,"")}if(Pd){f=Ud(t);t=f[0];n=f[1]}u=ld(Td(t,e),r?this:Id,zd);if(l||c||n.length){h=Sd(u);if(l){h.dotAll=true;h.raw=zd(Md(t),s)}if(c)h.sticky=true;if(n.length)h.groups=n}if(t!==o)try{cd(u,"source",""===o?"(?:)":o)}catch(v){}return u};for(var qd=ud(Td),Gd=0;qd.length>Gd;)bd(zd,Td,qd[Gd++]);Id.constructor=zd;zd.prototype=Id;md(nd,"RegExp",zd,{constructor:true})}xd("RegExp");var Wd=A;var Kd=B;var Yd=rf;var Jd=Pv;var Xd=Vv;var Qd=se;var Zd=ns;var tp=ga.get;var ep=Zv;var rp=ad;var ap=Qd("native-string-replace",String.prototype.replace);var ip=RegExp.prototype.exec;var np=ip;var op=Kd("".charAt);var sp=Kd("".indexOf);var lp=Kd("".replace);var cp=Kd("".slice);var fp=function(){var t=/a/;var e=/b*/g;Wd(ip,t,"a");Wd(ip,e,"a");return 0!==t.lastIndex||0!==e.lastIndex}();var up=Xd.BROKEN_CARET;var hp=void 0!==/()??/.exec("")[1];var vp=fp||hp||up||ep||rp;if(vp)np=function sw(t){var e=this;var r=tp(e);var a=Yd(t);var i=r.raw;var n,o,s,l,c,f,u;if(i){i.lastIndex=e.lastIndex;n=Wd(np,i,a);e.lastIndex=i.lastIndex;return n}var h=r.groups;var v=up&&e.sticky;var d=Wd(Jd,e);var p=e.source;var g=0;var b=a;if(v){d=lp(d,"y","");if(sp(d,"g")===-1)d+="g";b=cp(a,e.lastIndex);if(e.lastIndex>0&&(!e.multiline||e.multiline&&"\n"!==op(a,e.lastIndex-1))){p="(?: "+p+")";b=" "+b;g++}o=new RegExp("^(?:"+p+")",d)}if(hp)o=new RegExp("^"+p+"$(?!\\s)",d);if(fp)s=e.lastIndex;l=Wd(ip,v?o:e,b);if(v)if(l){l.input=cp(l.input,g);l[0]=cp(l[0],g);l.index=e.lastIndex;e.lastIndex+=l[0].length}else e.lastIndex=0;else if(fp&&l)e.lastIndex=e.global?l.index+l[0].length:s;if(hp&&l&&l.length>1)Wd(ap,l[0],o,function(){for(c=1;c1?arguments[1]:void 0)}});var Hp=C;var Mp=Function.prototype;var Up=Mp.apply;var zp=Mp.call;var qp="object"==typeof Reflect&&Reflect.apply||(Hp?zp.bind(Up):function(){return zp.apply(Up,arguments)});var Gp=A;var Wp=La;var Kp=dp;var Yp=x;var Jp=Ae;var Xp=Ir;var Qp=Jp("species");var Zp=RegExp.prototype;var tg=function(t,e,r,a){var i=Jp(t);var n=!Yp(function(){var e={};e[i]=function(){return 7};return 7!==""[t](e)});var o=n&&!Yp(function(){var e=false;var r=/a/;if("split"===t){r={};r.constructor={};r.constructor[Qp]=function(){return r};r.flags="";r[i]=/./[i]}r.exec=function(){e=true;return null};r[i]("");return!e});if(!n||!o||r){var s=/./[i];var l=e(i,""[t],function(t,e,r,a,i){var o=e.exec;if(o===Kp||o===Zp.exec){if(n&&!i)return{done:true,value:Gp(s,e,r,a)};return{done:true,value:Gp(t,r,e,a)}}return{done:false}});Wp(String.prototype,t,l[0]);Wp(Zp,i,l[1])}if(a)Xp(Zp[i],"sham",true)};var eg=B;var rg=Ga;var ag=rf;var ig=Z;var ng=eg("".charAt);var og=eg("".charCodeAt);var sg=eg("".slice);var lg=function(t){return function(e,r){var a=ag(ig(e));var i=rg(r);var n=a.length;var o,s;if(i<0||i>=n)return t?"":void 0;o=og(a,i);return o<55296||o>56319||i+1===n||(s=og(a,i+1))<56320||s>57343?t?ng(a,i):o:t?sg(a,i,i+2):(o-55296<<10)+(s-56320)+65536}};var cg={codeAt:lg(false),charAt:lg(true)};var fg=cg.charAt;var ug=function(t,e,r){return e+(r?fg(t,e).length:1)};var hg=B;var vg=fe;var dg=Math.floor;var pg=hg("".charAt);var gg=hg("".replace);var bg=hg("".slice);var mg=/\$([$&'`]|\d{1,2}|<[^>]*>)/g;var yg=/\$([$&'`]|\d{1,2})/g;var wg=function(t,e,r,a,i,n){var o=r+t.length;var s=a.length;var l=yg;if(void 0!==i){i=vg(i);l=mg}return gg(n,l,function(n,l){var c;switch(pg(l,0)){case"$":return"$";case"&":return t;case"`":return bg(e,0,r);case"'":return bg(e,o);case"<":c=i[bg(l,1,-1)];break;default:var f=+l;if(0===f)return n;if(f>s){var u=dg(f/10);if(0===u)return n;if(u<=s)return void 0===a[u-1]?pg(l,1):a[u-1]+pg(l,1);return n}c=a[f-1]}return void 0===c?"":c})};var Sg=A;var xg=vr;var Og=it;var kg=U;var Pg=dp;var Cg=TypeError;var Tg=function(t,e){var r=t.exec;if(Og(r)){var a=Sg(r,t,e);if(null!==a)xg(a);return a}if("RegExp"===kg(t))return Sg(Pg,t,e);throw new Cg("RegExp#exec called on incompatible receiver")};var Ig=qp;var Ag=A;var $g=B;var Rg=tg;var Eg=x;var jg=vr;var _g=it;var Ng=J;var Fg=Ga;var Dg=Za;var Vg=rf;var Bg=Z;var Lg=ug;var Hg=zt;var Mg=wg;var Ug=Tg;var zg=Ae;var qg=zg("replace");var Gg=Math.max;var Wg=Math.min;var Kg=$g([].concat);var Yg=$g([].push);var Jg=$g("".indexOf);var Xg=$g("".slice);var Qg=function(t){return void 0===t?t:String(t)};var Zg=function(){return"$0"==="a".replace(/./,"$0")}();var tb=function(){if(/./[qg])return""===/./[qg]("a","$0");return false}();var eb=!Eg(function(){var t=/./;t.exec=function(){var t=[];t.groups={a:"7"};return t};return"7"!=="".replace(t,"$")});Rg("replace",function(t,e,r){var a=tb?"$":"$0";return[function i(t,r){var a=Bg(this);var i=Ng(t)?void 0:Hg(t,qg);return i?Ag(i,t,a,r):Ag(e,Vg(a),t,r)},function(t,i){var n=jg(this);var o=Vg(t);if("string"==typeof i&&Jg(i,a)===-1&&Jg(i,"$<")===-1){var s=r(e,n,o,i);if(s.done)return s.value}var l=_g(i);if(!l)i=Vg(i);var c=n.global;var f;if(c){f=n.unicode;n.lastIndex=0}var u=[];var h;while(true){h=Ug(n,o);if(null===h)break;Yg(u,h);if(!c)break;var v=Vg(h[0]);if(""===v)n.lastIndex=Lg(o,Dg(n.lastIndex),f)}var d="";var p=0;for(var g=0;g=p){d+=Xg(o,p,m)+w;p=m+b.length}}return d+Xg(o,p)}]},!eb||!Zg||tb);var rb=Object.is||function fw(t,e){return t===e?0!==t||1/t===1/e:t!==t&&e!==e};var ab=A;var ib=tg;var nb=vr;var ob=J;var sb=Z;var lb=rb;var cb=rf;var fb=zt;var ub=Tg;ib("search",function(t,e,r){return[function a(e){var r=sb(this);var a=ob(e)?void 0:fb(e,t);return a?ab(a,e,r):new RegExp(e)[t](cb(r))},function(t){var a=nb(this);var i=cb(t);var n=r(e,a,i);if(n.done)return n.value;var o=a.lastIndex;if(!lb(o,0))a.lastIndex=0;var s=ub(a,i);if(!lb(a.lastIndex,o))a.lastIndex=o;return null===s?-1:s.index}]});var hb=$n;var vb=Dt;var db=TypeError;var pb=function(t){if(hb(t))return t;throw new db(vb(t)+" is not a constructor")};var gb=vr;var bb=pb;var mb=J;var yb=Ae;var wb=yb("species");var Sb=function(t,e){var r=gb(t).constructor;var a;return void 0===r||mb(a=gb(r)[wb])?e:bb(a)};var xb=A;var Ob=B;var kb=tg;var Pb=vr;var Cb=J;var Tb=Z;var Ib=Sb;var Ab=ug;var $b=Za;var Rb=rf;var Eb=zt;var jb=Tg;var _b=Vv;var Nb=x;var Fb=_b.UNSUPPORTED_Y;var Db=4294967295;var Vb=Math.min;var Bb=Ob([].push);var Lb=Ob("".slice);var Hb=!Nb(function(){var t=/(?:)/;var e=t.exec;t.exec=function(){return e.apply(this,arguments)};var r="ab".split(t);return 2!==r.length||"a"!==r[0]||"b"!==r[1]});var Mb="c"==="abbc".split(/(b)*/)[1]||4!=="test".split(/(?:)/,-1).length||2!=="ab".split(/(?:ab)*/).length||4!==".".split(/(.?)(.?)/).length||".".split(/()()/).length>1||"".split(/.?/).length;kb("split",function(t,e,r){var a="0".split(void 0,0).length?function(t,r){return void 0===t&&0===r?[]:xb(e,this,t,r)}:e;return[function i(e,r){var i=Tb(this);var n=Cb(e)?void 0:Eb(e,t);return n?xb(n,e,i,r):xb(a,Rb(i),e,r)},function(t,i){var n=Pb(this);var o=Rb(t);if(!Mb){var s=r(a,n,o,i,a!==e);if(s.done)return s.value}var l=Ib(n,RegExp);var c=n.unicode;var f=(n.ignoreCase?"i":"")+(n.multiline?"m":"")+(n.unicode?"u":"")+(Fb?"g":"y");var u=new l(Fb?"^(?:"+n.source+")":n,f);var h=void 0===i?Db:i>>>0;if(0===h)return[];if(0===o.length)return null===jb(u,o)?[o]:[];var v=0;var d=0;var p=[];while(d1?arguments[1]:void 0)}:[].forEach;var om=w;var sm=Xb;var lm=em;var cm=nm;var fm=Ir;var um=function(t){if(t&&t.forEach!==cm)try{fm(t,"forEach",cm)}catch(e){t.forEach=cm}};for(var hm in sm)if(sm[hm])um(om[hm]&&om[hm].prototype);um(lm);var vm=w;var dm=Xb;var pm=em;var gm=dc;var bm=Ir;var mm=ul;var ym=Ae;var wm=ym("iterator");var Sm=gm.values;var xm=function(t,e){if(t){if(t[wm]!==Sm)try{bm(t,wm,Sm)}catch(r){t[wm]=Sm}mm(t,e,true);if(dm[e])for(var a in gm)if(t[a]!==gm[a])try{bm(t,a,gm[a])}catch(r){t[a]=gm[a]}}};for(var Om in dm)xm(vm[Om]&&vm[Om].prototype,Om);xm(pm,"DOMTokenList");var km=Wi;var Pm=x;var Cm=fe;var Tm=Ws;var Im=Vs;var Am=Pm(function(){Tm(1)});km({target:"Object",stat:true,forced:Am,sham:!Im},{getPrototypeOf:function vw(t){return Tm(Cm(t))}});var $m=Wi;var Rm=co;var Em=S.f;var jm=Za;var _m=rf;var Nm=$p;var Fm=Z;var Dm=jp;var Vm=Rm("".slice);var Bm=Math.min;var Lm=Dm("endsWith");var Hm=!Lm&&!!function(){var t=Em(String.prototype,"endsWith");return t&&!t.writable}();$m({target:"String",proto:true,forced:!Hm&&!Lm},{endsWith:function dw(t){var e=_m(Fm(this));Nm(t);var r=arguments.length>1?arguments[1]:void 0;var a=e.length;var i=void 0===r?a:Bm(jm(r),a);var n=_m(t);return Vm(e,i-n.length,i)===n}});var Mm=A;var Um=tg;var zm=vr;var qm=J;var Gm=Za;var Wm=rf;var Km=Z;var Ym=zt;var Jm=ug;var Xm=Tg;Um("match",function(t,e,r){return[function a(e){var r=Km(this);var a=qm(e)?void 0:Ym(e,t);return a?Mm(a,e,r):new RegExp(e)[t](Wm(r))},function(t){var a=zm(this);var i=Wm(t);var n=r(e,a,i);if(n.done)return n.value;if(!a.global)return Xm(a,i);var o=a.unicode;a.lastIndex=0;var s=[];var l=0;var c;while(null!==(c=Xm(a,i))){var f=Wm(c[0]);s[l]=f;if(""===f)a.lastIndex=Jm(i,Gm(a.lastIndex),o);l++}return 0===l?null:s}]});var Qm=Wi;var Zm=co;var ty=S.f;var ey=Za;var ry=rf;var ay=$p;var iy=Z;var ny=jp;var oy=Zm("".slice);var sy=Math.min;var ly=ny("startsWith");var cy=!ly&&!!function(){var t=ty(String.prototype,"startsWith");return t&&!t.writable}();Qm({target:"String",proto:true,forced:!cy&&!ly},{startsWith:function pw(t){var e=ry(iy(this));ay(t);var r=ey(sy(arguments.length>1?arguments[1]:void 0,e.length));var a=ry(t);return oy(e,r,r+a.length)===a}});var fy={getBootstrapVersion:function gw(){var e=5;try{var r=t.fn.dropdown.Constructor.VERSION;if(void 0!==r)e=parseInt(r,10)}catch(a){}try{var i=bootstrap.Tooltip.VERSION;if(void 0!==i)e=parseInt(i,10)}catch(a){}return e},getIconsPrefix:function bw(t){return{bootstrap3:"glyphicon",bootstrap4:"fa",bootstrap5:"bi","bootstrap-table":"icon",bulma:"fa",foundation:"fa",materialize:"material-icons",semantic:"fa"}[t]||"fa"},getIcons:function mw(t){return{glyphicon:{paginationSwitchDown:"glyphicon-collapse-down icon-chevron-down",paginationSwitchUp:"glyphicon-collapse-up icon-chevron-up",refresh:"glyphicon-refresh icon-refresh",toggleOff:"glyphicon-list-alt icon-list-alt",toggleOn:"glyphicon-list-alt icon-list-alt",columns:"glyphicon-th icon-th",detailOpen:"glyphicon-plus icon-plus",detailClose:"glyphicon-minus icon-minus",fullscreen:"glyphicon-fullscreen",search:"glyphicon-search",clearSearch:"glyphicon-trash"},fa:{paginationSwitchDown:"fa-caret-square-down",paginationSwitchUp:"fa-caret-square-up",refresh:"fa-sync",toggleOff:"fa-toggle-off",toggleOn:"fa-toggle-on",columns:"fa-th-list",detailOpen:"fa-plus",detailClose:"fa-minus",fullscreen:"fa-arrows-alt",search:"fa-search",clearSearch:"fa-trash"},bi:{paginationSwitchDown:"bi-caret-down-square",paginationSwitchUp:"bi-caret-up-square",refresh:"bi-arrow-clockwise",toggleOff:"bi-toggle-off",toggleOn:"bi-toggle-on",columns:"bi-list-ul",detailOpen:"bi-plus",detailClose:"bi-dash",fullscreen:"bi-arrows-move",search:"bi-search",clearSearch:"bi-trash"},icon:{paginationSwitchDown:"icon-arrow-up-circle",paginationSwitchUp:"icon-arrow-down-circle",refresh:"icon-refresh-cw",toggleOff:"icon-toggle-right",toggleOn:"icon-toggle-right",columns:"icon-list",detailOpen:"icon-plus",detailClose:"icon-minus",fullscreen:"icon-maximize",search:"icon-search",clearSearch:"icon-trash-2"},"material-icons":{paginationSwitchDown:"grid_on",paginationSwitchUp:"grid_off",refresh:"refresh",toggleOff:"tablet",toggleOn:"tablet_android",columns:"view_list",detailOpen:"add",detailClose:"remove",fullscreen:"fullscreen",sort:"sort",search:"search",clearSearch:"delete"}}[t]||{}},getSearchInput:function yw(e){if("string"===typeof e.options.searchSelector)return t(e.options.searchSelector);return e.$toolbar.find(".search input")},extend:function ww(){var t=this;for(var e=arguments.length,r=new Array(e),a=0;a1?e-1:0),a=1;a0&&void 0!==arguments[0]?arguments[0]:{};return 0===Object.entries(t).length&&t.constructor===Object},isNumeric:function kw(t){return!isNaN(parseFloat(t))&&isFinite(t)},getFieldTitle:function Pw(t,e){var r=b(t),a;try{for(r.s();!(a=r.n()).done;){var i=a.value;if(i.field===e)return i.title}}catch(n){r.e(n)}finally{r.f()}return""},setFieldIndex:function Cw(t){var e=0;var r=[];var a=b(t[0]),i;try{for(a.s();!(i=a.n()).done;){var n=i.value;e+=n.colspan||1}}catch(o){a.e(o)}finally{a.f()}for(var s=0;s1){var u=0;var h=function y(t){var e=a.filter(function(e){return e.fieldIndex===t});var r=e[e.length-1];if(e.length>1)for(var i=0;i0}}}catch(d){s.e(d)}finally{s.f()}}}catch(d){i.e(d)}finally{i.f()}if(t.length<2)return;var p=b(e),g;try{var m=function w(){var t=g.value;var e=a.filter(function(e){return e.fieldIndex===t.fieldIndex});if(e.length>1){var r=b(e),i;try{for(r.s();!(i=r.n()).done;){var n=i.value;n.visible=t.visible}}catch(o){r.e(o)}finally{r.f()}}};for(p.s();!(g=p.n()).done;)m()}catch(d){p.e(d)}finally{p.f()}},getScrollBarWidth:function Aw(){if(void 0===this.cachedWidth){var e=t("
    ").addClass("fixed-table-scroll-inner");var r=t("
    ").addClass("fixed-table-scroll-outer");r.append(e);t("body").append(r);var a=e[0].offsetWidth;r.css("overflow","scroll");var i=e[0].offsetWidth;if(a===i)i=r[0].clientWidth;r.remove();this.cachedWidth=a-i}return this.cachedWidth},calculateObjectValue:function $w(t,e,r,a){var n=e;if("string"===typeof e){var o=e.split(".");if(o.length>1){n=window;var s=b(o),l;try{for(s.s();!(l=s.n()).done;){var f=l.value;n=n[f]}}catch(u){s.e(u)}finally{s.f()}}else n=window[e]}if(null!==n&&"object"===i(n))return n;if("function"===typeof n)return n.apply(t,r||[]);if(!n&&"string"===typeof e&&r&&this.sprintf.apply(this,[e].concat(c(r))))return this.sprintf.apply(this,[e].concat(c(r)));return a},compareObjects:function Rw(t,e,r){var a=Object.keys(t);var i=Object.keys(e);if(r&&a.length!==i.length)return false;for(var n=0,o=a;n/g,">").replace(/"/g,""").replace(/'/g,"'")},unescapeHTML:function Nw(t){if("string"!==typeof t||!t)return t;return t.toString().replace(/&/g,"&").replace(/</g,"<").replace(/>/g,">").replace(/"/g,'"').replace(/'/g,"'")},removeHTML:function Fw(t){if(!t)return t;return t.toString().replace(/(<([^>]+)>)/gi,"").replace(/&[#A-Za-z0-9]+;/gi,"").trim()},getRealDataAttr:function Dw(t){for(var e=0,r=Object.entries(t);e3&&void 0!==arguments[3]?arguments[3]:void 0;var i=t;if("undefined"!==typeof a)r=a;if("string"!==typeof e||t.hasOwnProperty(e))return r?this.escapeHTML(t[e]):t[e];var n=e.split(".");var o=b(n),s;try{for(o.s();!(s=o.n()).done;){var l=s.value;i=i&&i[l]}}catch(c){o.e(c)}finally{o.f()}return r?this.escapeHTML(i):i},isIEBrowser:function Bw(){return navigator.userAgent.includes("MSIE ")||/Trident.*rv:11\./.test(navigator.userAgent)},findIndex:function Lw(t,e){var r=b(t),a;try{for(r.s();!(a=r.n()).done;){var i=a.value;if(JSON.stringify(i)===JSON.stringify(e))return t.indexOf(i)}}catch(n){r.e(n)}finally{r.f()}return-1},trToData:function Hw(e,r){var a=this;var i=[];var n=[];r.each(function(r,o){var s=t(o);var l={};l._id=s.attr("id");l._class=s.attr("class");l._data=a.getRealDataAttr(s.data());l._style=s.attr("style");s.find(">td,>th").each(function(i,o){var s=t(o);var c=+s.attr("colspan")||1;var f=+s.attr("rowspan")||1;var u=i;for(;n[r]&&n[r][u];u++);for(var h=u;he)return r;return 0}if(a.sortEmptyLast){if(""===t)return 1;if(""===e)return-1}if(t===e)return 0;if("string"!==typeof t)t=t.toString();if(t.localeCompare(e)===-1)return r*-1;return r},getEventName:function Uw(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"";e=e||"".concat(+new Date).concat(~~(1e6*Math.random()));return"".concat(t,"-").concat(e)},hasDetailViewIcon:function zw(t){return t.detailView&&t.detailViewIcon&&!t.cardView},getDetailViewIndexOffset:function qw(t){return this.hasDetailViewIcon(t)&&"right"!==t.detailViewAlign?1:0},checkAutoMergeCells:function Gw(t){var e=b(t),r;try{for(e.s();!(r=e.n()).done;){var a=r.value;for(var i=0,n=Object.keys(a);i',""],toolbarDropdownItem:'',toolbarDropdownSeparator:'
  • ',pageDropdown:['"],pageDropdownItem:'
    ',dropdownCaret:'',pagination:['
      ',"
    "],paginationItem:'
  • %s
  • ',icon:'',inputGroup:'
    %s%s
    ',searchInput:'',searchButton:'',searchClearButton:''}},4:{classes:{buttonsPrefix:"btn",buttons:"secondary",buttonsGroup:"btn-group",buttonsDropdown:"btn-group",pull:"float",inputGroup:"btn-group",inputPrefix:"form-control-",input:"form-control",select:"form-control",paginationDropdown:"btn-group dropdown",dropup:"dropup",dropdownActive:"active",paginationActive:"active",buttonActive:"active"},html:{toolbarDropdown:['"],toolbarDropdownItem:'',pageDropdown:['"],pageDropdownItem:'%s',toolbarDropdownSeparator:'',dropdownCaret:'',pagination:['
      ',"
    "],paginationItem:'
  • %s
  • ',icon:'',inputGroup:'
    %s
    %s
    ',searchInput:'',searchButton:'',searchClearButton:''}},5:{classes:{buttonsPrefix:"btn",buttons:"secondary",buttonsGroup:"btn-group",buttonsDropdown:"btn-group",pull:"float",inputGroup:"btn-group",inputPrefix:"form-control-",input:"form-control",select:"form-select",paginationDropdown:"btn-group dropdown",dropup:"dropup",dropdownActive:"active",paginationActive:"active",buttonActive:"active"},html:{dataToggle:"data-bs-toggle",toolbarDropdown:['"],toolbarDropdownItem:'',pageDropdown:['"],pageDropdownItem:'%s',toolbarDropdownSeparator:'',dropdownCaret:'',pagination:['
      ',"
    "],paginationItem:'
  • %s
  • ',icon:'',inputGroup:'
    %s%s
    ',searchInput:'',searchButton:'',searchClearButton:''}}}[hy];var dy={id:void 0,firstLoad:true,height:void 0,classes:"table table-bordered table-hover",buttons:{},theadClasses:"",striped:false,headerStyle:function Yw(t){return{}},rowStyle:function Jw(t,e){return{}},rowAttributes:function Xw(t,e){return{}},undefinedText:"-",locale:void 0,virtualScroll:false,virtualScrollItemHeight:void 0,sortable:true,sortClass:void 0,silentSort:true,sortEmptyLast:false,sortName:void 0,sortOrder:void 0,sortReset:false,sortStable:false,sortResetPage:false,rememberOrder:false,serverSort:true,customSort:void 0,columns:[[]],data:[],url:void 0,method:"get",cache:true,contentType:"application/json",dataType:"json",ajax:void 0,ajaxOptions:{},queryParams:function Qw(t){return t},queryParamsType:"limit",responseHandler:function Zw(t){return t},totalField:"total",totalNotFilteredField:"totalNotFiltered",dataField:"rows",footerField:"footer",pagination:false,paginationParts:["pageInfo","pageSize","pageList"],showExtendedPagination:false,paginationLoop:true,sidePagination:"client",totalRows:0,totalNotFiltered:0,pageNumber:1,pageSize:10,pageList:[10,25,50,100],paginationHAlign:"right",paginationVAlign:"bottom",paginationDetailHAlign:"left",paginationPreText:"‹",paginationNextText:"›",paginationSuccessivelySize:5,paginationPagesBySide:1,paginationUseIntermediate:false,paginationLoadMore:false,search:false,searchable:false,searchHighlight:false,searchOnEnterKey:false,strictSearch:false,regexSearch:false,searchSelector:false,visibleSearch:false,showButtonIcons:true,showButtonText:false,showSearchButton:false,showSearchClearButton:false,trimOnSearch:true,searchAlign:"right",searchTimeOut:500,searchText:"",customSearch:void 0,showHeader:true,showFooter:false,footerStyle:function tS(t){return{}},searchAccentNeutralise:false,showColumns:false,showSearch:false,showPageGo:false,showColumnsToggleAll:false,showColumnsSearch:false,minimumCountColumns:1,showPaginationSwitch:false,showRefresh:false,showToggle:false,showFullscreen:false,smartDisplay:true,escape:false,escapeTitle:true,filterOptions:{filterAlgorithm:"and"},idField:void 0,selectItemName:"btSelectItem",clickToSelect:false,ignoreClickToSelectOn:function eS(t){var e=t.tagName;return["A","BUTTON"].includes(e)},singleSelect:false,checkboxHeader:true,maintainMetaData:false,multipleSelectRow:false,uniqueId:void 0,cardView:false,detailView:false,detailViewIcon:true,detailViewByClick:false,detailViewAlign:"left",detailFormatter:function rS(t,e){return""},detailFilter:function aS(t,e){return true},toolbar:void 0,toolbarAlign:"left",buttonsToolbar:void 0,buttonsAlign:"right",buttonsOrder:["search","paginationSwitch","refresh","toggle","fullscreen","columns"],buttonsPrefix:vy.classes.buttonsPrefix,buttonsClass:vy.classes.buttons,iconsPrefix:void 0,icons:{},iconSize:void 0,fixedScroll:false,loadingFontSize:"auto",loadingTemplate:function iS(t){return'\n '.concat(t,'\n \n \n ')},onAll:function nS(t,e){return false},onClickCell:function oS(t,e,r,a){return false},onDblClickCell:function sS(t,e,r,a){return false},onClickRow:function lS(t,e){return false},onDblClickRow:function cS(t,e){return false},onSort:function fS(t,e){return false},onCheck:function uS(t){return false},onUncheck:function hS(t){return false},onCheckAll:function vS(t){return false},onUncheckAll:function dS(t){return false},onCheckSome:function pS(t){return false},onUncheckSome:function gS(t){return false},onLoadSuccess:function bS(t){return false},onLoadError:function mS(t){return false},onColumnSwitch:function yS(t,e){return false},onColumnSwitchAll:function wS(t){return false},onPageChange:function SS(t,e){return false},onSearch:function xS(t){return false},onShowSearch:function OS(){return false},onToggle:function kS(t){return false},onPreBody:function PS(t){return false},onPostBody:function CS(){return false},onPostHeader:function TS(){return false},onPostFooter:function IS(){return false},onExpandRow:function AS(t,e,r){return false},onCollapseRow:function $S(t,e){return false},onRefreshOptions:function RS(t){return false},onRefresh:function ES(t){return false},onResetView:function jS(){return false},onScrollBody:function _S(){return false},onTogglePagination:function NS(t){return false},onVirtualScroll:function FS(t,e){return false}};var py={formatLoadingMessage:function DS(){return"Loading, please wait"},formatRecordsPerPage:function VS(t){return"".concat(t," rows per page")},formatShowingRows:function BS(t,e,r,a){if(void 0!==a&&a>0&&a>r)return"Showing ".concat(t," to ").concat(e," of ").concat(r," rows (filtered from ").concat(a," total rows)");return"Showing ".concat(t," to ").concat(e," of ").concat(r," rows")},formatSRPaginationPreText:function LS(){return"previous page"},formatSRPaginationPageText:function HS(t){return"to page ".concat(t)},formatSRPaginationNextText:function MS(){return"next page"},formatDetailPagination:function US(t){return"Showing ".concat(t," rows")},formatSearch:function zS(){return"Search"},formatShowSearch:function qS(){return"Show Search"},formatPageGo:function(){return"Go"},formatClearSearch:function GS(){return"Clear Search"},formatNoMatches:function WS(){return"No matching records found"},formatPaginationSwitch:function KS(){return"Hide/Show pagination"},formatPaginationSwitchDown:function YS(){return"Show pagination"},formatPaginationSwitchUp:function JS(){return"Hide pagination"},formatRefresh:function XS(){return"Refresh"},formatToggleOn:function QS(){return"Show card view"},formatToggleOff:function ZS(){return"Hide card view"},formatColumns:function tx(){return"Columns"},formatColumnsToggleAll:function ex(){return"Toggle all"},formatFullscreen:function rx(){return"Fullscreen"},formatAllRows:function ax(){return"All"}};var gy={field:void 0,title:void 0,titleTooltip:void 0,class:void 0,width:void 0,widthUnit:"px",rowspan:void 0,colspan:void 0,align:void 0,halign:void 0,falign:void 0,valign:void 0,cellStyle:void 0,radio:false,checkbox:false,checkboxEnabled:true,clickToSelect:true,showSelectTitle:false,sortable:false,sortName:void 0,order:"asc",sorter:void 0,visible:true,ignore:false,switchable:true,switchableLabel:void 0,cardVisible:true,searchable:true,formatter:void 0,footerFormatter:void 0,footerStyle:void 0,detailFormatter:void 0,searchFormatter:true,searchHighlightFormatter:false,escape:void 0,events:void 0};var by=["getOptions","refreshOptions","getData","getSelections","load","append","prepend","remove","removeAll","insertRow","updateRow","getRowByUniqueId","updateByUniqueId","removeByUniqueId","updateCell","updateCellByUniqueId","showRow","hideRow","getHiddenRows","showColumn","hideColumn","getVisibleColumns","getHiddenColumns","showAllColumns","hideAllColumns","mergeCells","checkAll","uncheckAll","checkInvert","check","uncheck","checkBy","uncheckBy","refresh","destroy","resetView","showLoading","hideLoading","togglePagination","toggleFullscreen","toggleView","resetSearch","filterBy","sortBy","scrollTo","getScrollPosition","selectPage","prevPage","nextPage","toggleDetailView","expandRow","collapseRow","expandRowByUniqueId","collapseRowByUniqueId","expandAllRows","collapseAllRows","updateColumnTitle","updateFormatText"];var my={"all.bs.table":"onAll","click-row.bs.table":"onClickRow","dbl-click-row.bs.table":"onDblClickRow","click-cell.bs.table":"onClickCell","dbl-click-cell.bs.table":"onDblClickCell","sort.bs.table":"onSort","check.bs.table":"onCheck","uncheck.bs.table":"onUncheck","check-all.bs.table":"onCheckAll","uncheck-all.bs.table":"onUncheckAll","check-some.bs.table":"onCheckSome","uncheck-some.bs.table":"onUncheckSome","load-success.bs.table":"onLoadSuccess","load-error.bs.table":"onLoadError","column-switch.bs.table":"onColumnSwitch","column-switch-all.bs.table":"onColumnSwitchAll","page-change.bs.table":"onPageChange","search.bs.table":"onSearch","toggle.bs.table":"onToggle","pre-body.bs.table":"onPreBody","post-body.bs.table":"onPostBody","post-header.bs.table":"onPostHeader","post-footer.bs.table":"onPostFooter","expand-row.bs.table":"onExpandRow","collapse-row.bs.table":"onCollapseRow","refresh-options.bs.table":"onRefreshOptions","reset-view.bs.table":"onResetView","refresh.bs.table":"onRefresh","scroll-body.bs.table":"onScrollBody","toggle-pagination.bs.table":"onTogglePagination","virtual-scroll.bs.table":"onVirtualScroll"};Object.assign(dy,py);var yy={VERSION:uy,THEME:"bootstrap".concat(hy),CONSTANTS:vy,DEFAULTS:dy,COLUMN_DEFAULTS:gy,METHODS:by,EVENTS:my,LOCALES:{en:py,"en-US":py}};var wy=50;var Sy=4;var xy=function(){function t(e){var r=this;n(this,t);this.rows=e.rows;this.scrollEl=e.scrollEl;this.contentEl=e.contentEl;this.callback=e.callback;this.itemHeight=e.itemHeight;this.cache={};this.scrollTop=this.scrollEl.scrollTop;this.initDOM(this.rows,e.fixedScroll);this.scrollEl.scrollTop=this.scrollTop;this.lastCluster=0;var a=function i(){if(r.lastCluster!==(r.lastCluster=r.getNum())){r.initDOM(r.rows);r.callback(r.startIndex,r.endIndex)}};this.scrollEl.addEventListener("scroll",a,false);this.destroy=function(){r.contentEl.innerHtml="";r.scrollEl.removeEventListener("scroll",a,false)}}return s(t,[{key:"initDOM",value:function e(t,r){if("undefined"===typeof this.clusterHeight){this.cache.scrollTop=this.scrollEl.scrollTop;this.cache.data=this.contentEl.innerHTML=t[0]+t[0]+t[0];this.getRowsHeight(t)}else if(0===this.blockHeight)this.getRowsHeight(t);var a=this.initData(t,this.getNum(r));var i=a.rows.join("");var n=this.checkChanges("data",i);var o=this.checkChanges("top",a.topOffset);var s=this.checkChanges("bottom",a.bottomOffset);var l=[];if(n&&o){if(a.topOffset)l.push(this.getExtra("top",a.topOffset));l.push(i);if(a.bottomOffset)l.push(this.getExtra("bottom",a.bottomOffset));this.startIndex=a.start;this.endIndex=a.end;this.contentEl.innerHTML=l.join("");if(r)this.contentEl.scrollTop=this.cache.scrollTop}else if(s)this.contentEl.lastChild.style.height="".concat(a.bottomOffset,"px")}},{key:"getRowsHeight",value:function r(){if("undefined"===typeof this.itemHeight||0===this.itemHeight){var t=this.contentEl.children;var e=t[Math.floor(t.length/2)];this.itemHeight=e.offsetHeight}this.blockHeight=this.itemHeight*wy;this.clusterRows=wy*Sy;this.clusterHeight=this.blockHeight*Sy}},{key:"getNum",value:function a(t){this.scrollTop=t?this.cache.scrollTop:this.scrollEl.scrollTop;return Math.floor(this.scrollTop/(this.clusterHeight-this.blockHeight))||0}},{key:"initData",value:function i(t,e){if(t.length
    ':"";var r=["bottom","both"].includes(this.options.paginationVAlign)?'
    ':"";var a=fy.calculateObjectValue(this.options,this.options.loadingTemplate,[this.options.formatLoadingMessage()]);this.$container=t('\n
    \n
    \n ').concat(e,'\n
    \n
    \n
    \n
    \n ').concat(a,'\n
    \n
    \n \n
    \n ').concat(r,"\n
    \n "));this.$container.insertAfter(this.$el);this.$tableContainer=this.$container.find(".fixed-table-container");this.$tableHeader=this.$container.find(".fixed-table-header");this.$tableBody=this.$container.find(".fixed-table-body");this.$tableLoading=this.$container.find(".fixed-table-loading");this.$tableFooter=this.$el.find("tfoot");if(this.options.buttonsToolbar)this.$toolbar=t("body").find(this.options.buttonsToolbar);else this.$toolbar=this.$container.find(".fixed-table-toolbar");this.$pagination=this.$container.find(".fixed-table-pagination");this.$tableBody.append(this.$el);this.$container.after('
    ');this.$el.addClass(this.options.classes);this.$tableLoading.addClass(this.options.classes);if(this.options.striped)this.$el.addClass("table-striped");if(this.options.height){this.$tableContainer.addClass("fixed-height");if(this.options.showFooter)this.$tableContainer.addClass("has-footer");if(this.options.classes.split(" ").includes("table-bordered")){this.$tableBody.append('
    ');this.$tableBorder=this.$tableBody.find(".fixed-table-border");this.$tableLoading.addClass("fixed-table-border")}this.$tableFooter=this.$container.find(".fixed-table-footer")}}},{key:"initTable",value:function u(){var r=this;var a=[];this.$header=this.$el.find(">thead");if(!this.$header.length)this.$header=t('')).appendTo(this.$el);else if(this.options.theadClasses)this.$header.addClass(this.options.theadClasses);this._headerTrClasses=[];this._headerTrStyles=[];this.$header.find("tr").each(function(e,i){var n=t(i);var o=[];n.find("th").each(function(e,r){var a=t(r);if("undefined"!==typeof a.data("field"))a.data("field","".concat(a.data("field")));var i=Object.assign({},a.data());for(var n in i)if(t.fn.bootstrapTable.columnDefaults.hasOwnProperty(n))delete i[n];o.push(fy.extend({},{_data:fy.getRealDataAttr(i),title:a.html(),class:a.attr("class"),titleTooltip:a.attr("title"),rowspan:a.attr("rowspan")?+a.attr("rowspan"):void 0,colspan:a.attr("colspan")?+a.attr("colspan"):void 0},a.data()))});a.push(o);if(n.attr("class"))r._headerTrClasses.push(n.attr("class"));if(n.attr("style"))r._headerTrStyles.push(n.attr("style"))});if(!Array.isArray(this.options.columns[0]))this.options.columns=[this.options.columns];this.options.columns=fy.extend(true,[],a,this.options.columns);this.columns=[];this.fieldsColumnsIndex=[];fy.setFieldIndex(this.options.columns);this.options.columns.forEach(function(t,a){t.forEach(function(t,i){var n=fy.extend({},e.COLUMN_DEFAULTS,t,{passed:t});if("undefined"!==typeof n.fieldIndex){r.columns[n.fieldIndex]=n;r.fieldsColumnsIndex[n.field]=n.fieldIndex}r.options.columns[a][i]=n})});if(!this.options.data.length){var i=fy.trToData(this.columns,this.$el.find(">tbody>tr"));if(i.length){this.options.data=i;this.fromHtml=true}}if(!(this.options.pagination&&"server"!==this.options.sidePagination))this.footerData=fy.trToData(this.columns,this.$el.find(">tfoot>tr"));if(this.footerData)this.$el.find("tfoot").html("");if(!this.options.showFooter||this.options.cardView)this.$tableFooter.hide();else this.$tableFooter.show()}},{key:"initHeader",value:function h(){var e=this;var r={};var a=[];this.header={fields:[],styles:[],classes:[],formatters:[],detailFormatters:[],events:[],sorters:[],sortNames:[],cellStyles:[],searchables:[]};fy.updateFieldGroup(this.options.columns,this.columns);this.options.columns.forEach(function(t,n){var o=[];o.push(""));var s="";if(0===n&&fy.hasDetailViewIcon(e.options)){var c=e.options.columns.length>1?' rowspan="'.concat(e.options.columns.length,'"'):"";s='\n
    \n ')}if(s&&"right"!==e.options.detailViewAlign)o.push(s);t.forEach(function(t,a){var s=fy.sprintf(' class="%s"',t["class"]);var c=t.widthUnit;var f=parseFloat(t.width);var u=t.halign?t.halign:t.align;var h=fy.sprintf("text-align: %s; ",u);var v=fy.sprintf("text-align: %s; ",t.align);var d=fy.sprintf("vertical-align: %s; ",t.valign);d+=fy.sprintf("width: %s; ",(t.checkbox||t.radio)&&!f?!t.showSelectTitle?"36px":void 0:f?f+c:void 0);if("undefined"===typeof t.fieldIndex&&!t.visible)return;var p=fy.calculateObjectValue(null,e.options.headerStyle,[t]);var g=[];var b=[];var m="";if(p&&p.css)for(var y=0,w=Object.entries(p.css);y0)for(var k=0,P=Object.entries(t._data);k0?" data-not-first-th":"",b.length>0?b.join(" "):"",">");o.push(fy.sprintf('
    ',e.options.sortable&&t.sortable?"sortable".concat("center"===u?" sortable-center":""," both"):""));var A=e.options.escape&&e.options.escapeTitle?fy.escapeHTML(t.title):t.title;var $=A;if(t.checkbox){A="";if(!e.options.singleSelect&&e.options.checkboxHeader)A='';e.header.stateField=t.field}if(t.radio){A="";e.header.stateField=t.field}if(!A&&t.showSelectTitle)A+=$;o.push(A);o.push("
    ");o.push('
    ');o.push("
    ");o.push("")});if(s&&"right"===e.options.detailViewAlign)o.push(s);o.push("");if(o.length>3)a.push(o.join(""))});this.$header.html(a.join(""));this.$header.find("th[data-field]").each(function(e,a){t(a).data(r[t(a).data("field")])});this.$container.off("click",".th-inner").on("click",".th-inner",function(r){var a=t(r.currentTarget);if(e.options.detailView&&!a.parent().hasClass("bs-checkbox"))if(a.closest(".bootstrap-table")[0]!==e.$container[0])return false;if(e.options.sortable&&a.parent().data().sortable)e.onSort(r)});var n=fy.getEventName("resize.bootstrap-table",this.$el.attr("id"));t(window).off(n);if(!this.options.showHeader||this.options.cardView){this.$header.hide();this.$tableHeader.hide();this.$tableLoading.css("top",0)}else{this.$header.show();this.$tableHeader.show();this.$tableLoading.css("top",this.$header.outerHeight()+1);this.getCaret();t(window).on(n,function(){return e.resetView()})}this.$selectAll=this.$header.find('[name="btSelectAll"]');this.$selectAll.off("click").on("click",function(r){r.stopPropagation();var a=t(r.currentTarget).prop("checked");e[a?"checkAll":"uncheckAll"]();e.updateSelected()})}},{key:"initData",value:function v(t,e){if("append"===e)this.options.data=this.options.data.concat(t);else if("prepend"===e)this.options.data=[].concat(t).concat(this.options.data);else{t=t||fy.deepCopy(this.options.data);this.options.data=Array.isArray(t)?t:t[this.options.dataField]}this.data=c(this.options.data);if(this.options.sortReset)this.unsortedData=c(this.data);if("server"===this.options.sidePagination)return;this.initSort()}},{key:"initSort",value:function d(){var t=this;var e=this.options.sortName;var r="desc"===this.options.sortOrder?-1:1;var a=this.header.fields.indexOf(this.options.sortName);var i=0;if(a!==-1){if(this.options.sortStable)this.data.forEach(function(t,e){if(!t.hasOwnProperty("_position"))t._position=e});if(this.options.customSort)fy.calculateObjectValue(this.options,this.options.customSort,[this.options.sortName,this.options.sortOrder,this.data]);else this.data.sort(function(i,n){if(t.header.sortNames[a])e=t.header.sortNames[a];var o=fy.getItemField(i,e,t.options.escape);var s=fy.getItemField(n,e,t.options.escape);var l=fy.calculateObjectValue(t.header,t.header.sorters[a],[o,s,i,n]);if(void 0!==l){if(t.options.sortStable&&0===l)return r*(i._position-n._position);return r*l}return fy.sort(o,s,r,t.options,i._position,n._position)});if(void 0!==this.options.sortClass){clearTimeout(i);i=setTimeout(function(){t.$el.removeClass(t.options.sortClass);var e=t.$header.find('[data-field="'.concat(t.options.sortName,'"]')).index();t.$el.find("tr td:nth-child(".concat(e+1,")")).addClass(t.options.sortClass)},250)}}else if(this.options.sortReset)this.data=c(this.unsortedData)}},{key:"sortBy",value:function p(t){this.options.sortName=t.field;this.options.sortOrder=t.hasOwnProperty("sortOrder")?t.sortOrder:"asc";this._sort()}},{key:"onSort",value:function g(e){var r=e.type,a=e.currentTarget;var i="keypress"===r?t(a):t(a).parent();var n=this.$header.find("th").eq(i.index());this.$header.add(this.$header_).find("span.order").remove();if(this.options.sortName===i.data("field")){var o=this.options.sortOrder;var s=this.columns[this.fieldsColumnsIndex[i.data("field")]].sortOrder||this.columns[this.fieldsColumnsIndex[i.data("field")]].order;if(void 0===o)this.options.sortOrder="asc";else if("asc"===o)this.options.sortOrder=this.options.sortReset?"asc"===s?"desc":void 0:"desc";else if("desc"===this.options.sortOrder)this.options.sortOrder=this.options.sortReset?"desc"===s?"asc":void 0:"asc";if(void 0===this.options.sortOrder)this.options.sortName=void 0}else{this.options.sortName=i.data("field");if(this.options.rememberOrder)this.options.sortOrder="asc"===i.data("order")?"desc":"asc";else this.options.sortOrder=this.columns[this.fieldsColumnsIndex[i.data("field")]].sortOrder||this.columns[this.fieldsColumnsIndex[i.data("field")]].order}i.add(n).data("order",this.options.sortOrder);this.getCaret();this._sort()}},{key:"_sort",value:function m(){if("server"===this.options.sidePagination&&this.options.serverSort){this.options.pageNumber=1;this.trigger("sort",this.options.sortName,this.options.sortOrder);this.initServer(this.options.silentSort);return}if(this.options.pagination&&this.options.sortResetPage){this.options.pageNumber=1;this.initPagination()}this.trigger("sort",this.options.sortName,this.options.sortOrder);this.initSort();this.initBody()}},{key:"initToolbar",value:function y(){var e=this;var r=this.options;var a=[];var n=0;var o;var s=0;if(this.$toolbar.find(".bs-bars").children().length)t("body").append(t(r.toolbar));this.$toolbar.html("");if("string"===typeof r.toolbar||"object"===i(r.toolbar))t(fy.sprintf('
    ',this.constants.classes.pull,r.toolbarAlign)).appendTo(this.$toolbar).append(t(r.toolbar));a=['
    ')];if("string"===typeof r.buttonsOrder)r.buttonsOrder=r.buttonsOrder.replace(/\[|\]| |'/g,"").split(",");this.buttons=Object.assign(this.buttons,{search:{text:r.formatSearch(),icon:r.icons.search,render:false,event:this.toggleShowSearch,attributes:{"aria-label":r.formatShowSearch(),title:r.formatShowSearch()}},paginationSwitch:{text:r.pagination?r.formatPaginationSwitchUp():r.formatPaginationSwitchDown(),icon:r.pagination?r.icons.paginationSwitchDown:r.icons.paginationSwitchUp,render:false,event:this.togglePagination,attributes:{"aria-label":r.formatPaginationSwitch(),title:r.formatPaginationSwitch()}},refresh:{text:r.formatRefresh(),icon:r.icons.refresh,render:false,event:this.refresh,attributes:{"aria-label":r.formatRefresh(),title:r.formatRefresh()}},toggle:{text:r.formatToggleOn(),icon:r.icons.toggleOff,render:false,event:this.toggleView,attributes:{"aria-label":r.formatToggleOn(),title:r.formatToggleOn()}},fullscreen:{text:r.formatFullscreen(),icon:r.icons.fullscreen,render:false,event:this.toggleFullscreen,attributes:{"aria-label":r.formatFullscreen(),title:r.formatFullscreen()}},columns:{render:false,html:function z(){var z=[];z.push('
    \n \n ").concat(e.constants.html.toolbarDropdown[0]));if(r.showColumnsSearch){z.push(fy.sprintf(e.constants.html.toolbarDropdownItem,fy.sprintf('',e.constants.classes.input,r.formatSearch())));z.push(e.constants.html.toolbarDropdownSeparator)}if(r.showColumnsToggleAll){var t=e.getVisibleColumns().length===e.columns.filter(function(t){return!e.isSelectionColumn(t)}).length;z.push(fy.sprintf(e.constants.html.toolbarDropdownItem,fy.sprintf(' %s',t?'checked="checked"':"",r.formatColumnsToggleAll())));z.push(e.constants.html.toolbarDropdownSeparator)}var a=0;e.columns.forEach(function(t){if(t.visible)a++});e.columns.forEach(function(t,i){if(e.isSelectionColumn(t))return;if(r.cardView&&!t.cardVisible)return;if(t.ignore)return;var n=t.visible?' checked="checked"':"";var o=a<=r.minimumCountColumns&&n?' disabled="disabled"':"";if(t.switchable){z.push(fy.sprintf(e.constants.html.toolbarDropdownItem,fy.sprintf(' %s',t.field,i,n,o,t.switchableLabel||t.title)));s++}});z.push(e.constants.html.toolbarDropdown[1],"
    ");return z.join("")}}});var c={};for(var f=0,u=Object.entries(this.buttons);f"}c[v]=p;var O="show".concat(v.charAt(0).toUpperCase()).concat(v.substring(1));var k=r[O];if((!d.hasOwnProperty("render")||d.hasOwnProperty("render")&&d.render)&&(void 0===k||true===k))r[O]=true;if(!r.buttonsOrder.includes(v))r.buttonsOrder.push(v)}var P=b(r.buttonsOrder),C;try{for(P.s();!(C=P.n()).done;){var T=C.value;var I=r["show".concat(T.charAt(0).toUpperCase()).concat(T.substring(1))];if(I)a.push(c[T])}}catch(A){P.e(A)}finally{P.f()}a.push("
    ");if(this.showToolbar||a.length>2)this.$toolbar.append(a.join(""));if(r.showSearch)this.$toolbar.find('button[name="showSearch"]').off("click").on("click",function(){return e.toggleShowSearch()});var $=function q(){var t=l(E[R],2),r=t[0],a=t[1];if(a.hasOwnProperty("event")){if("function"===typeof a.event||"string"===typeof a.event){var i="string"===typeof a.event?window[a.event]:a.event;e.$toolbar.find('button[name="'.concat(r,'"]')).off("click").on("click",function(){return i.call(e)});return 1}var n=function c(){var t=l(s[o],2),a=t[0],i=t[1];var n="string"===typeof i?window[i]:i;e.$toolbar.find('button[name="'.concat(r,'"]')).off(a).on(a,function(){return n.call(e)})};for(var o=0,s=Object.entries(a.event);o');var H=L;if(r.showSearchButton||r.showSearchClearButton){var M=(r.showSearchButton?V:"")+(r.showSearchClearButton?B:"");H=r.search?fy.sprintf(this.constants.html.inputGroup,L,M):M}a.push(fy.sprintf('\n
    \n %s\n
    \n '),H));this.$toolbar.append(a.join(""));var U=fy.getSearchInput(this);if(r.showSearchButton){this.$toolbar.find(".search button[name=search]").off("click").on("click",function(){clearTimeout(n);n=setTimeout(function(){e.onSearch({currentTarget:U})},r.searchTimeOut)});if(r.searchOnEnterKey)D(U)}else D(U);if(r.showSearchClearButton)this.$toolbar.find(".search button[name=clearSearch]").click(function(){e.resetSearch()})}else if("string"===typeof r.searchSelector)D(fy.getSearchInput(this))}},{key:"onSearch",value:function w(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},r=e.currentTarget,a=e.firedByInitSearchText;var i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:true;if(void 0!==r&&t(r).length&&i){var n=t(r).val().trim();if(this.options.trimOnSearch&&t(r).val()!==n)t(r).val(n);if(this.searchText===n)return;var o=fy.getSearchInput(this);var s=r instanceof jQuery?r:t(r);if(s.is(o)||s.hasClass("search-input")){this.searchText=n;this.options.searchText=n}}if(!a)this.options.pageNumber=1;this.initSearch();if(a){if("client"===this.options.sidePagination)this.updatePagination()}else this.updatePagination();this.trigger("search",this.searchText)}},{key:"initSearch",value:function S(){var t=this;this.filterOptions=this.filterOptions||this.options.filterOptions;if("server"!==this.options.sidePagination){if(this.options.customSearch){this.data=fy.calculateObjectValue(this.options,this.options.customSearch,[this.options.data,this.searchText,this.filterColumns]);if(this.options.sortReset)this.unsortedData=c(this.data);this.initSort();return}var e=this.searchText&&(this.fromHtml?fy.escapeHTML(this.searchText):this.searchText);var r=e?e.toLowerCase():"";var a=fy.isEmptyObject(this.filterColumns)?null:this.filterColumns;if(this.options.searchAccentNeutralise)r=fy.normalizeAccent(r);if("function"===typeof this.filterOptions.filterAlgorithm)this.data=this.options.data.filter(function(e){return t.filterOptions.filterAlgorithm.apply(null,[e,a])});else if("string"===typeof this.filterOptions.filterAlgorithm)this.data=a?this.options.data.filter(function(e){var r=t.filterOptions.filterAlgorithm;if("and"===r){for(var i in a)if(Array.isArray(a[i])&&!a[i].includes(e[i])||!Array.isArray(a[i])&&e[i]!==a[i])return false}else if("or"===r){var n=false;for(var o in a)if(Array.isArray(a[o])&&a[o].includes(e[o])||!Array.isArray(a[o])&&e[o]===a[o])n=true;return n}return true}):c(this.options.data);var i=this.getVisibleFields();this.data=r?this.data.filter(function(a,n){for(var o=0;o|=<|>=|>|<)(?:\s+)?(-?\d+)?|(-?\d+)?(\s+)?(<=|=>|=<|>=|>|<))/gm;var v=h.exec(t.searchText);var d=false;if(v){var p=v[1]||"".concat(v[5],"l");var g=v[2]||v[3];var b=parseInt(c,10);var m=parseInt(g,10);switch(p){case">":case"m;break;case"<":case">l":d=b=l":case"=>l":d=b<=m;break;case">=":case"=>":case"<=l":case"==m}}if(d||"".concat(c).toLowerCase().includes(r))return true}}return false}):this.data;if(this.options.sortReset)this.unsortedData=c(this.data);this.initSort()}}},{key:"initPagination",value:function x(){var e=this;var r=this.options;if(!r.pagination){this.$pagination.hide();return}this.$pagination.show();var a=[];var i=false;var n;var o;var s;var l;var c;var f;var u;var h=this.getData({includeHiddenRows:false});var v=r.pageList;if("string"===typeof v)v=v.replace(/\[|\]| /g,"").toLowerCase().split(",");v=v.map(function(t){if("string"===typeof t)return t.toLowerCase()===r.formatAllRows().toLowerCase()||["all","unlimited"].includes(t.toLowerCase())?r.formatAllRows():+t;return t});this.paginationParts=r.paginationParts;if("string"===typeof this.paginationParts)this.paginationParts=this.paginationParts.replace(/\[|\]| |'/g,"").split(",");if("server"!==r.sidePagination)r.totalRows=h.length;this.totalPages=0;if(r.totalRows){if(r.pageSize===r.formatAllRows()){r.pageSize=r.totalRows;i=true}this.totalPages=~~((r.totalRows-1)/r.pageSize)+1;r.totalPages=this.totalPages}if(this.totalPages>0&&r.pageNumber>this.totalPages)r.pageNumber=this.totalPages;this.pageFrom=(r.pageNumber-1)*r.pageSize+1;this.pageTo=r.pageNumber*r.pageSize;if(this.pageTo>r.totalRows)this.pageTo=r.totalRows;if(this.options.pagination&&"server"!==this.options.sidePagination)this.options.totalNotFiltered=this.options.data.length;if(!this.options.showExtendedPagination)this.options.totalNotFiltered=void 0;if(this.paginationParts.includes("pageInfo")||this.paginationParts.includes("pageInfoShort")||this.paginationParts.includes("pageSize"))a.push('
    '));if(this.paginationParts.includes("pageInfo")||this.paginationParts.includes("pageInfoShort")){var d=this.options.totalRows+("client"===this.options.sidePagination&&this.options.paginationLoadMore&&!this._paginationLoaded?" +":"");var p=this.paginationParts.includes("pageInfoShort")?r.formatDetailPagination(d):r.formatShowingRows(this.pageFrom,this.pageTo,d,r.totalNotFiltered);a.push('\n '.concat(p,"\n "))}if(this.paginationParts.includes("pageSize")){a.push('
    ');var g=['
    \n \n ").concat(this.constants.html.pageDropdown[0])];v.forEach(function(t,a){if(!r.smartDisplay||0===a||v[a-1]"));a.push(r.formatRecordsPerPage(g.join("")))}if(this.paginationParts.includes("pageInfo")||this.paginationParts.includes("pageInfoShort")||this.paginationParts.includes("pageSize"))a.push("
    ");if(this.paginationParts.includes("pageList")){a.push('
    '),fy.sprintf(this.constants.html.pagination[0],fy.sprintf(" pagination-%s",r.iconSize)),fy.sprintf(this.constants.html.paginationItem," page-pre",r.formatSRPaginationPreText(),r.paginationPreText));if(this.totalPagesthis.totalPages-o)o=o-(r.paginationSuccessivelySize-(this.totalPages-o))+1;if(o<1)o=1;if(s>this.totalPages)s=this.totalPages;var b=Math.round(r.paginationPagesBySide/2);var m=function P(t){var a=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"";return fy.sprintf(e.constants.html.paginationItem,a+(t===r.pageNumber?" ".concat(e.constants.classes.paginationActive):""),r.formatSRPaginationPageText(t),t)};if(o>1){var y=r.paginationPagesBySide;if(y>=o)y=o-1;for(n=1;n<=y;n++)a.push(m(n));if(o-1===y+1){n=o-1;a.push(m(n))}else if(o-1>y)if(o-2*r.paginationPagesBySide>r.paginationPagesBySide&&r.paginationUseIntermediate){n=Math.round((o-b)/2+b);a.push(m(n," page-intermediate"))}else a.push(fy.sprintf(this.constants.html.paginationItem," page-first-separator disabled","","..."))}for(n=o;n<=s;n++)a.push(m(n));if(this.totalPages>s){var w=this.totalPages-(r.paginationPagesBySide-1);if(s>=w)w=s+1;if(s+1===w-1){n=s+1;a.push(m(n))}else if(w>s+1)if(this.totalPages-s>2*r.paginationPagesBySide&&r.paginationUseIntermediate){n=Math.round((this.totalPages-b-s)/2+s);a.push(m(n," page-intermediate"))}else a.push(fy.sprintf(this.constants.html.paginationItem," page-last-separator disabled","","..."));for(n=w;n<=this.totalPages;n++)a.push(m(n))}a.push(fy.sprintf(this.constants.html.paginationItem," page-next",r.formatSRPaginationNextText(),r.paginationNextText));a.push(this.constants.html.pagination[1],"
    ")}this.$pagination.html(a.join(""));var S=["bottom","both"].includes(r.paginationVAlign)?" ".concat(this.constants.classes.dropup):"";this.$pagination.last().find(".page-list > div").addClass(S);if(!r.onlyInfoPagination){l=this.$pagination.find(".page-list a");c=this.$pagination.find(".page-pre");f=this.$pagination.find(".page-next");u=this.$pagination.find(".page-item").not(".page-next, .page-pre, .page-last-separator, .page-first-separator");if(this.totalPages<=1)this.$pagination.find("div.pagination").hide();if(r.smartDisplay)if(v.length<2||r.totalRows<=v[0])this.$pagination.find("div.page-list").hide();this.$pagination[this.getData().length?"show":"hide"]();if(!r.paginationLoop){if(1===r.pageNumber)c.addClass("disabled");if(r.pageNumber===this.totalPages)f.addClass("disabled")}if(i)r.pageSize=r.formatAllRows();l.off("click").on("click",function(t){return e.onPageListChange(t)});c.off("click").on("click",function(t){return e.onPagePre(t)});f.off("click").on("click",function(t){return e.onPageNext(t)});u.off("click").on("click",function(t){return e.onPageNumber(t)});if(this.options.showPageGo){var x=this,O=this.$pagination.find("ul.pagination"),k=O.find("li.pageGo");if(!k.length){k=t(['
  • ',fy.sprintf('',this.options.pageNumber),'","
  • "].join("")).appendTo(O);k.find("button").click(function(){var t=parseInt(k.find("input").val())||1;if(t<1||t>x.options.totalPages)t=1;x.selectPage(t)})}}}}},{key:"updatePagination",value:function O(e){if(e&&t(e.currentTarget).hasClass("disabled"))return;if(!this.options.maintainMetaData)this.resetRows();this.initPagination();this.trigger("page-change",this.options.pageNumber,this.options.pageSize);if("server"===this.options.sidePagination||"client"===this.options.sidePagination&&this.options.paginationLoadMore&&!this._paginationLoaded&&this.options.pageNumber===this.totalPages)this.initServer();else this.initBody()}},{key:"onPageListChange",value:function k(e){e.preventDefault();var r=t(e.currentTarget);r.parent().addClass(this.constants.classes.dropdownActive).siblings().removeClass(this.constants.classes.dropdownActive);this.options.pageSize=r.text().toUpperCase()===this.options.formatAllRows().toUpperCase()?this.options.formatAllRows():+r.text();this.$toolbar.find(".page-size").text(this.options.pageSize);this.updatePagination(e);return false}},{key:"onPagePre",value:function P(e){if(t(e.target).hasClass("disabled"))return;e.preventDefault();if(this.options.pageNumber-1===0)this.options.pageNumber=this.options.totalPages;else this.options.pageNumber--;this.updatePagination(e);return false}},{key:"onPageNext",value:function C(e){if(t(e.target).hasClass("disabled"))return;e.preventDefault();if(this.options.pageNumber+1>this.options.totalPages)this.options.pageNumber=1;else this.options.pageNumber++;this.updatePagination(e);return false}},{key:"onPageNumber",value:function T(e){e.preventDefault();if(this.options.pageNumber===+t(e.currentTarget).text())return;this.options.pageNumber=+t(e.currentTarget).text();this.updatePagination(e);return false}},{key:"initRow",value:function I(t,e,r,a){var n=this;var o=[];var s={};var c=[];var f="";var u={};var h=[];if(fy.findIndex(this.hiddenRows,t)>-1)return;s=fy.calculateObjectValue(this.options,this.options.rowStyle,[t,e],s);if(s&&s.css)for(var v=0,d=Object.entries(s.css);v");if(this.options.cardView)o.push('
    '));var I="";if(fy.hasDetailViewIcon(this.options)){I="";if(fy.calculateObjectValue(null,this.options.detailFilter,[e,t]))I+='\n \n '.concat(fy.sprintf(this.constants.html.icon,this.options.iconsPrefix,this.options.icons.detailOpen),"\n \n ");I+=""}if(I&&"right"!==this.options.detailViewAlign)o.push(I);this.header.fields.forEach(function(r,a){var i=n.columns[a];var s="";var f=fy.getItemField(t,r,n.options.escape,i.escape);var u="";var h="";var v={};var d="";var p=n.header.classes[a];var g="";var b="";var m="";var y="";var w="";var S="";if((n.fromHtml||n.autoMergeCells)&&"undefined"===typeof f)if(!i.checkbox&&!i.radio)return;if(!i.visible)return;if(n.options.cardView&&!i.cardVisible)return;if(c.concat([n.header.styles[a]]).length)b+="".concat(c.concat([n.header.styles[a]]).join("; "));if(t["_".concat(r,"_style")])b+="".concat(t["_".concat(r,"_style")]);if(b)g=' style="'.concat(b,'"');if(t["_".concat(r,"_id")])d=fy.sprintf(' id="%s"',t["_".concat(r,"_id")]);if(t["_".concat(r,"_class")])p=fy.sprintf(' class="%s"',t["_".concat(r,"_class")]);if(t["_".concat(r,"_rowspan")])y=fy.sprintf(' rowspan="%s"',t["_".concat(r,"_rowspan")]);if(t["_".concat(r,"_colspan")])w=fy.sprintf(' colspan="%s"',t["_".concat(r,"_colspan")]);if(t["_".concat(r,"_title")])S=fy.sprintf(' title="%s"',t["_".concat(r,"_title")]);v=fy.calculateObjectValue(n.header,n.header.cellStyles[a],[f,t,e,r],v);if(v.classes)p=' class="'.concat(v.classes,'"');if(v.css){var x=[];for(var O=0,k=Object.entries(v.css);O|br|hr|input|!--|wbr)[a-z]+.*?>|<([a-z]+).*?<\/\1>/i.test(u);if(_){var N=(new DOMParser).parseFromString(u.toString(),"text/html").documentElement.textContent;var F=N.replace(E,j);N=N.replace(/[.*+?^${}()|[\]\\]/g,"\\$&");I=u.replace(new RegExp("(>\\s*)(".concat(N,")(\\s*)"),"gm"),"$1".concat(F,"$3"))}else I=u.toString().replace(E,j);u=fy.calculateObjectValue(i,i.searchHighlightFormatter,[u,n.searchText],I)}if(t["_".concat(r,"_data")]&&!fy.isEmptyObject(t["_".concat(r,"_data")]))for(var D=0,V=Object.entries(t["_".concat(r,"_data")]);D'):'"),'"),n.header.formatters[a]&&"string"===typeof u?u:"",n.options.cardView?"
    ":""].join("");t[n.header.stateField]=true===u||!!f||u&&u.checked}else if(n.options.cardView){var q=n.options.showHeader?'").concat(fy.getFieldTitle(n.columns,r),""):"";s='
    '.concat(q,'").concat(u,"
    ");if(n.options.smartDisplay&&""===u)s='
    '}else s="").concat(u,"");o.push(s)});if(I&&"right"===this.options.detailViewAlign)o.push(I);if(this.options.cardView)o.push("
    ");o.push("");return o.join("")}},{key:"initBody",value:function A(e,r){var a=this;var i=this.getData();this.trigger("pre-body",i);this.$body=this.$el.find(">tbody");if(!this.$body.length)this.$body=t("").appendTo(this.$el);if(!this.options.pagination||"server"===this.options.sidePagination){this.pageFrom=1;this.pageTo=i.length}var n=[];var o=t(document.createDocumentFragment());var s=false;var l=[];this.autoMergeCells=fy.checkAutoMergeCells(i.slice(this.pageFrom-1,this.pageTo));for(var c=this.pageFrom-1;c tr[data-uniqueid="%s"][data-has-detail-view]',v));var p=d.next();if(p.is("tr.detail-view")){l.push(c);if(!r||v!==r)u+=p[0].outerHTML}}if(!this.options.virtualScroll)o.append(u);else n.push(u)}}if(!s)this.$body.html(''.concat(fy.sprintf('%s',this.getVisibleFields().length+fy.getDetailViewIndexOffset(this.options),this.options.formatNoMatches()),""));else if(!this.options.virtualScroll)this.$body.html(o);else{if(this.virtualScroll)this.virtualScroll.destroy();this.virtualScroll=new xy({rows:n,fixedScroll:e,scrollEl:this.$tableBody[0],contentEl:this.$body[0],itemHeight:this.options.virtualScrollItemHeight,callback:function g(t,e){a.fitHeader();a.initBodyEvent();a.trigger("virtual-scroll",t,e)}})}l.forEach(function(t){a.expandRow(t)});if(!e)this.scrollTo(0);this.initBodyEvent();this.initFooter();this.resetView();this.updateSelected();if("server"!==this.options.sidePagination)this.options.totalRows=i.length;this.trigger("post-body",i)}},{key:"initBodyEvent",value:function $(){var e=this;this.$body.find("> tr[data-index] > td").off("click dblclick").on("click dblclick",function(r){var a=t(r.currentTarget);if(a.find(".detail-icon").length||a.index()-fy.getDetailViewIndexOffset(e.options)<0)return;var i=a.parent();var n=t(r.target).parents(".card-views").children();var o=t(r.target).parents(".card-view");var s=i.data("index");var l=e.data[s];var c=e.options.cardView?n.index(o):a[0].cellIndex;var f=e.getVisibleFields();var u=f[c-fy.getDetailViewIndexOffset(e.options)];var h=e.columns[e.fieldsColumnsIndex[u]];var v=fy.getItemField(l,u,e.options.escape,h.escape);e.trigger("click"===r.type?"click-cell":"dbl-click-cell",u,v,l,a);e.trigger("click"===r.type?"click-row":"dbl-click-row",l,i,u);if("click"===r.type&&e.options.clickToSelect&&h.clickToSelect&&!fy.calculateObjectValue(e.options,e.options.ignoreClickToSelectOn,[r.target])){var d=i.find(fy.sprintf('[name="%s"]',e.options.selectItemName));if(d.length)d[0].click()}if("click"===r.type&&e.options.detailViewByClick)e.toggleDetailView(s,e.header.detailFormatters[e.fieldsColumnsIndex[u]])}).off("mousedown").on("mousedown",function(t){e.multipleSelectRowCtrlKey=t.ctrlKey||t.metaKey;e.multipleSelectRowShiftKey=t.shiftKey});this.$body.find("> tr[data-index] > td > .detail-icon").off("click").on("click",function(r){r.preventDefault();e.toggleDetailView(t(r.currentTarget).parent().parent().data("index"));return false});this.$selectItem=this.$body.find(fy.sprintf('[name="%s"]',this.options.selectItemName));this.$selectItem.off("click").on("click",function(r){r.stopImmediatePropagation();var a=t(r.currentTarget);e._toggleCheck(a.prop("checked"),a.data("index"))});this.header.events.forEach(function(r,a){var i=r;if(!i)return;if("string"===typeof i)i=fy.calculateObjectValue(null,i);if(!i)throw new Error("Unknown event in the scope: ".concat(r));var n=e.header.fields[a];var o=e.getVisibleFields().indexOf(n);if(o===-1)return;o+=fy.getDetailViewIndexOffset(e.options);var s=function c(r){if(!i.hasOwnProperty(r))return 1;var a=i[r];e.$body.find(">tr:not(.no-records-found)").each(function(i,s){var l=t(s);var c=l.find(e.options.cardView?".card-views>.card-view":">td").eq(o);var f=r.indexOf(" ");var u=r.substring(0,f);var h=r.substring(f+1);c.find(h).off(u).on(u,function(t){var r=l.data("index");var i=e.data[r];var o=i[n];a.apply(e,[t,o,i,r])})})};for(var l in i)if(s(l))continue})}},{key:"initServer",value:function R(e,r,a){var i=this;var n={};var o=this.header.fields.indexOf(this.options.sortName);var s={searchText:this.searchText,sortName:this.options.sortName,sortOrder:this.options.sortOrder};if(this.header.sortNames[o])s.sortName=this.header.sortNames[o];if(this.options.pagination&&"server"===this.options.sidePagination){s.pageSize=this.options.pageSize===this.options.formatAllRows()?this.options.totalRows:this.options.pageSize;s.pageNumber=this.options.pageNumber}if(!this.options.firstLoad&&!firstLoadTable.includes(this.options.id)){firstLoadTable.push(this.options.id);return}if(!(a||this.options.url)&&!this.options.ajax)return;if("limit"===this.options.queryParamsType){s={search:s.searchText,sort:s.sortName,order:s.sortOrder};if(this.options.pagination&&"server"===this.options.sidePagination){s.offset=this.options.pageSize===this.options.formatAllRows()?0:this.options.pageSize*(this.options.pageNumber-1);s.limit=this.options.pageSize;if(0===s.limit||this.options.pageSize===this.options.formatAllRows())delete s.limit}}if(this.options.search&&"server"===this.options.sidePagination&&this.options.searchable&&this.columns.filter(function(t){return t.searchable}).length){s.searchable=[];var l=b(this.columns),c;try{for(l.s();!(c=l.n()).done;){var f=c.value;if(!f.checkbox&&f.searchable&&(this.options.visibleSearch&&f.visible||!this.options.visibleSearch))s.searchable.push(f.field)}}catch(u){l.e(u)}finally{l.f()}}if(!fy.isEmptyObject(this.filterColumnsPartial))s.filter=JSON.stringify(this.filterColumnsPartial,null);fy.extend(s,r||{});n=fy.calculateObjectValue(this.options,this.options.queryParams,[s],n);if(false===n)return;if(!e)this.showLoading();var h=fy.extend({},fy.calculateObjectValue(null,this.options.ajaxOptions),{type:this.options.method,url:a||this.options.url,data:"application/json"===this.options.contentType&&"post"===this.options.method?JSON.stringify(n):n,cache:this.options.cache,contentType:this.options.contentType,dataType:this.options.dataType,success:function v(t,r,a){var n=fy.calculateObjectValue(i.options,i.options.responseHandler,[t,a],t);if("client"===i.options.sidePagination&&i.options.paginationLoadMore)i._paginationLoaded=i.data.length===n.length;i.load(n);i.trigger("load-success",n,a&&a.status,a);if(!e)i.hideLoading();if("server"===i.options.sidePagination&&i.options.pageNumber>1&&n[i.options.totalField]>0&&!n[i.options.dataField].length)i.updatePagination()},error:function d(t){if(t&&0===t.status&&i._xhrAbort){i._xhrAbort=false;return}var r=[];if("server"===i.options.sidePagination){r={};r[i.options.totalField]=0;r[i.options.dataField]=[]}i.load(r);i.trigger("load-error",t&&t.status,t);if(!e)i.hideLoading()}});if(this.options.ajax)fy.calculateObjectValue(this,this.options.ajax,[h],null);else{if(this._xhr&&4!==this._xhr.readyState){this._xhrAbort=true;this._xhr.abort()}this._xhr=t.ajax(h)}return n}},{key:"initSearchText",value:function E(){if(this.options.search){this.searchText="";if(""!==this.options.searchText){var t=fy.getSearchInput(this);t.val(this.options.searchText);this.onSearch({currentTarget:t,firedByInitSearchText:true})}}}},{key:"getCaret",value:function j(){var e=this;this.$header.find("th").each(function(r,a){t(a).find(".sortable").removeClass("desc asc").addClass(t(a).data("field")===e.options.sortName?e.options.sortOrder:"both")})}},{key:"updateSelected",value:function _(){var e=this.$selectItem.filter(":enabled").length&&this.$selectItem.filter(":enabled").length===this.$selectItem.filter(":enabled").filter(":checked").length;this.$selectAll.add(this.$selectAll_).prop("checked",e);this.$selectItem.each(function(e,r){t(r).closest("tr")[t(r).prop("checked")?"addClass":"removeClass"]("selected")})}},{key:"updateRows",value:function N(){var e=this;this.$selectItem.each(function(r,a){e.data[t(a).data("index")][e.header.stateField]=t(a).prop("checked")})}},{key:"resetRows",value:function F(){var t=b(this.data),e;try{for(t.s();!(e=t.n()).done;){var r=e.value;this.$selectAll.prop("checked",false);this.$selectItem.prop("checked",false);if(this.header.stateField)r[this.header.stateField]=false}}catch(a){t.e(a)}finally{t.f()}this.initHiddenRows()}},{key:"trigger",value:function D(r){var a,i;var n="".concat(r,".bs.table");for(var o=arguments.length,s=new Array(o>1?o-1:0),l=1;lr.clientHeight+this.$header.outerHeight()?fy.getScrollBarWidth():0;this.$el.css("margin-top",-this.$header.outerHeight());var i=this.$tableHeader.find(":focus");if(i.length>0){var n=i.parents("th");if(n.length>0){var o=n.attr("data-field");if(void 0!==o){var s=this.$header.find("[data-field='".concat(o,"']"));if(s.length>0)s.find(":input").addClass("focus-temp")}}}this.$header_=this.$header.clone(true,true);this.$selectAll_=this.$header_.find('[name="btSelectAll"]');this.$tableHeader.css("margin-right",a).find("table").css("width",this.$el.outerWidth()).html("").attr("class",this.$el.attr("class")).append(this.$header_);this.$tableLoading.css("width",this.$el.outerWidth());var l=t(".focus-temp:visible:eq(0)");if(l.length>0){l.focus();this.$header.find(".focus-temp").removeClass("focus-temp")}this.$header.find("th[data-field]").each(function(r,a){e.$header_.find(fy.sprintf('th[data-field="%s"]',t(a).data("field"))).data(t(a).data())});var c=this.getVisibleFields();var f=this.$header_.find("th");var u=this.$body.find(">tr:not(.no-records-found,.virtual-scroll-top)").eq(0);while(u.length&&u.find('>td[colspan]:not([colspan="1"])').length)u=u.next();var h=u.find("> *").length;u.find("> *").each(function(r,a){var i=t(a);if(fy.hasDetailViewIcon(e.options))if(0===r&&"right"!==e.options.detailViewAlign||r===h-1&&"right"===e.options.detailViewAlign){var n=f.filter(".detail");var o=n.innerWidth()-n.find(".fht-cell").width();n.find(".fht-cell").width(i.innerWidth()-o);return}var s=r-fy.getDetailViewIndexOffset(e.options);var l=e.$header_.find(fy.sprintf('th[data-field="%s"]',c[s]));if(l.length>1)l=t(f[i[0].cellIndex]);var u=l.innerWidth()-l.find(".fht-cell").width();l.find(".fht-cell").width(i.innerWidth()-u)});this.horizontalScroll();this.trigger("post-header")}},{key:"initFooter",value:function L(){if(!this.options.showFooter||this.options.cardView)return;var t=this.getData();var e=[];var r="";if(fy.hasDetailViewIcon(this.options))r='
    ';if(r&&"right"!==this.options.detailViewAlign)e.push(r);var a=b(this.columns),i;try{for(a.s();!(i=a.n()).done;){var n=i.value;var o="";var s="";var c=[];var f={};var u=fy.sprintf(' class="%s"',n["class"]);if(!n.visible||this.footerData&&this.footerData.length>0&&!(n.field in this.footerData[0]))continue;if(this.options.cardView&&!n.cardVisible)return;o=fy.sprintf("text-align: %s; ",n.falign?n.falign:n.align);s=fy.sprintf("vertical-align: %s; ",n.valign);f=fy.calculateObjectValue(null,n.footerStyle||this.options.footerStyle,[n]);if(f&&f.css)for(var h=0,v=Object.entries(f.css);h0)m=this.footerData[0]["_".concat(n.field,"_colspan")]||0;if(m)e.push(' colspan="'.concat(m,'" '));e.push(">");e.push('
    ');var y="";if(this.footerData&&this.footerData.length>0)y=this.footerData[0][n.field]||"";e.push(fy.calculateObjectValue(n,n.footerFormatter,[t,y],y));e.push("
    ");e.push('
    ');e.push("");e.push("")}}catch(w){a.e(w)}finally{a.f()}if(r&&"right"===this.options.detailViewAlign)e.push(r);if(!this.options.height&&!this.$tableFooter.length){this.$el.append("");this.$tableFooter=this.$el.find("tfoot")}if(!this.$tableFooter.find("tr").length)this.$tableFooter.html("
    ");this.$tableFooter.find("tr").html(e.join(""));this.trigger("post-footer",this.$tableFooter)}},{key:"fitFooter",value:function H(){var e=this;if(this.$el.is(":hidden")){setTimeout(function(){return e.fitFooter()},100);return}var r=this.$tableBody.get(0);var a=this.hasScrollBar&&r.scrollHeight>r.clientHeight+this.$header.outerHeight()?fy.getScrollBarWidth():0;this.$tableFooter.css("margin-right",a).find("table").css("width",this.$el.outerWidth()).attr("class",this.$el.attr("class"));var i=this.$tableFooter.find("th");var n=this.$body.find(">tr:first-child:not(.no-records-found)");i.find(".fht-cell").width("auto");while(n.length&&n.find('>td[colspan]:not([colspan="1"])').length)n=n.next();var o=n.find("> *").length;n.find("> *").each(function(r,a){var n=t(a);if(fy.hasDetailViewIcon(e.options))if(0===r&&"left"===e.options.detailViewAlign||r===o-1&&"right"===e.options.detailViewAlign){var s=i.filter(".detail");var l=s.innerWidth()-s.find(".fht-cell").width();s.find(".fht-cell").width(n.innerWidth()-l);return}var c=i.eq(r);var f=c.innerWidth()-c.find(".fht-cell").width();c.find(".fht-cell").width(n.innerWidth()-f)});this.horizontalScroll()}},{key:"horizontalScroll",value:function M(){var t=this;this.$tableBody.off("scroll").on("scroll",function(){var e=t.$tableBody.scrollLeft();if(t.options.showHeader&&t.options.height)t.$tableHeader.scrollLeft(e);if(t.options.showFooter&&!t.options.cardView)t.$tableFooter.scrollLeft(e);t.trigger("scroll-body",t.$tableBody)})}},{key:"getVisibleFields",value:function U(){var t=[];var e=b(this.header.fields),r;try{for(e.s();!(r=e.n()).done;){var a=r.value;var i=this.columns[this.fieldsColumnsIndex[a]];if(!i||!i.visible||this.options.cardView&&!i.cardVisible)continue;t.push(a)}}catch(n){e.e(n)}finally{e.f()}return t}},{key:"initHiddenRows",value:function z(){this.hiddenRows=[]}},{key:"getOptions",value:function q(){var t=fy.extend({},this.options);delete t.data;return fy.extend(true,{},t)}},{key:"refreshOptions",value:function G(t){if(fy.compareObjects(this.options,t,true))return;this.options=fy.extend(this.options,t);this.trigger("refresh-options",this.options);this.destroy();this.init()}},{key:"getData",value:function W(t){var e=this;var r=this.options.data;if((this.searchText||this.options.customSearch||void 0!==this.options.sortName||this.enableCustomSort||!fy.isEmptyObject(this.filterColumns)||"function"===typeof this.options.filterOptions.filterAlgorithm||!fy.isEmptyObject(this.filterColumnsPartial))&&(!t||!t.unfiltered))r=this.data;if(t&&!t.includeHiddenRows){var a=this.getHiddenRows();r=r.filter(function(t){return fy.findIndex(a,t)===-1})}if(t&&t.useCurrentPage)r=r.slice(this.pageFrom-1,this.pageTo);if(t&&t.formatted)r.forEach(function(t){for(var r=0,a=Object.entries(t);r=0;r--){var a=this.options.data[r];var i=fy.getItemField(a,t.field,this.options.escape,a.escape);if(void 0===i&&"$index"!==t.field)continue;if(!a.hasOwnProperty(t.field)&&"$index"===t.field&&t.values.includes(r)||t.values.includes(i)){e++;this.options.data.splice(r,1)}}if(!e)return;if("server"===this.options.sidePagination){this.options.totalRows-=e;this.data=c(this.options.data)}this.initSearch();this.initPagination();this.initSort();this.initBody(true)}},{key:"removeAll",value:function Z(){if(this.options.data.length>0){this.options.data.splice(0,this.options.data.length);this.initSearch();this.initPagination();this.initBody(true)}}},{key:"insertRow",value:function tt(t){if(!t.hasOwnProperty("index")||!t.hasOwnProperty("row"))return;this.options.data.splice(t.index,0,t.row);this.initSearch();this.initPagination();this.initSort();this.initBody(true)}},{key:"updateRow",value:function et(t){var e=Array.isArray(t)?t:[t];var r=b(e),a;try{for(r.s();!(a=r.n()).done;){var i=a.value;if(!i.hasOwnProperty("index")||!i.hasOwnProperty("row"))continue;if(i.hasOwnProperty("replace")&&i.replace)this.options.data[i.index]=i.row;else fy.extend(this.options.data[i.index],i.row)}}catch(n){r.e(n)}finally{r.f()}this.initSearch();this.initPagination();this.initSort();this.initBody(true)}},{key:"getRowByUniqueId",value:function rt(t){var e=this.options.uniqueId;var r=this.options.data.length;var a=t;var i=null;var n;var o;for(n=r-1;n>=0;n--){o=this.options.data[n];var s=fy.getItemField(o,e,this.options.escape,o.escape);if(void 0===s)continue;if("string"===typeof s)a=t.toString();else if("number"===typeof s)if(Number(s)===s&&s%1===0)a=parseInt(t,10);else if(s===Number(s)&&0!==s)a=parseFloat(t);if(s===a){i=o;break}}return i}},{key:"updateByUniqueId",value:function at(t){var e=Array.isArray(t)?t:[t];var r=null;var a=b(e),i;try{for(a.s();!(i=a.n()).done;){var n=i.value;if(!n.hasOwnProperty("id")||!n.hasOwnProperty("row"))continue;var o=this.options.data.indexOf(this.getRowByUniqueId(n.id));if(o===-1)continue;if(n.hasOwnProperty("replace")&&n.replace)this.options.data[o]=n.row;else fy.extend(this.options.data[o],n.row);r=n.id}}catch(s){a.e(s)}finally{a.f()}this.initSearch();this.initPagination();this.initSort();this.initBody(true,r)}},{key:"removeByUniqueId",value:function it(t){var e=this.options.data.length;var r=this.getRowByUniqueId(t);if(r)this.options.data.splice(this.options.data.indexOf(r),1);if(e===this.options.data.length)return;if("server"===this.options.sidePagination){this.options.totalRows-=1;this.data=c(this.options.data)}this.initSearch();this.initPagination();this.initBody(true)}},{key:"_updateCellOnly",value:function nt(e,r){var a=this.initRow(this.options.data[r],r);var i=this.getVisibleFields().indexOf(e);if(i===-1)return;i+=fy.getDetailViewIndexOffset(this.options);this.$body.find(">tr[data-index=".concat(r,"]")).find(">td:eq(".concat(i,")")).replaceWith(t(a).find(">td:eq(".concat(i,")")));this.initBodyEvent();this.initFooter();this.resetView();this.updateSelected()}},{key:"updateCell",value:function ot(t){if(!t.hasOwnProperty("index")||!t.hasOwnProperty("field")||!t.hasOwnProperty("value"))return;this.options.data[t.index][t.field]=t.value;if(false===t.reinit){this._updateCellOnly(t.field,t.index);return}this.initSort();this.initBody(true)}},{key:"updateCellByUniqueId",value:function st(t){var e=this;var r=Array.isArray(t)?t:[t];r.forEach(function(t){var r=t.id,a=t.field,i=t.value;var n=e.options.data.indexOf(e.getRowByUniqueId(r));if(n===-1)return;e.options.data[n][a]=i});if(false===t.reinit){this._updateCellOnly(t.field,this.options.data.indexOf(this.getRowByUniqueId(t.id)));return}this.initSort();this.initBody(true)}},{key:"showRow",value:function lt(t){this._toggleRow(t,true)}},{key:"hideRow",value:function ct(t){this._toggleRow(t,false)}},{key:"_toggleRow",value:function ft(t,e){var r;if(t.hasOwnProperty("index"))r=this.getData()[t.index];else if(t.hasOwnProperty("uniqueId"))r=this.getRowByUniqueId(t.uniqueId);if(!r)return;var a=fy.findIndex(this.hiddenRows,r);if(!e&&a===-1)this.hiddenRows.push(r);else if(e&&a>-1)this.hiddenRows.splice(a,1);this.initBody(true);this.initPagination()}},{key:"getHiddenRows",value:function ut(t){if(t){this.initHiddenRows();this.initBody(true);this.initPagination();return}var e=this.getData();var r=[];var a=b(e),i;try{for(a.s();!(i=a.n()).done;){var n=i.value;if(this.hiddenRows.includes(n))r.push(n)}}catch(o){a.e(o)}finally{a.f()}this.hiddenRows=r;return r}},{key:"showColumn",value:function ht(t){var e=this;var r=Array.isArray(t)?t:[t];r.forEach(function(t){e._toggleColumn(e.fieldsColumnsIndex[t],true,true)})}},{key:"hideColumn",value:function vt(t){var e=this;var r=Array.isArray(t)?t:[t];r.forEach(function(t){e._toggleColumn(e.fieldsColumnsIndex[t],false,true)})}},{key:"_toggleColumn",value:function dt(t,e,r){if(t===-1||this.columns[t].visible===e)return;this.columns[t].visible=e;this.initHeader();this.initSearch();this.initPagination();this.initBody();if(this.options.showColumns){var a=this.$toolbar.find('.keep-open input:not(".toggle-all")').prop("disabled",false);if(r)a.filter(fy.sprintf('[value="%s"]',t)).prop("checked",e);if(a.filter(":checked").length<=this.options.minimumCountColumns)a.filter(":checked").prop("disabled",true)}}},{key:"getVisibleColumns",value:function pt(){var t=this;return this.columns.filter(function(e){return e.visible&&!t.isSelectionColumn(e)})}},{key:"getHiddenColumns",value:function gt(){return this.columns.filter(function(t){var e=t.visible;return!e})}},{key:"isSelectionColumn",value:function bt(t){return t.radio||t.checkbox}},{key:"showAllColumns",value:function mt(){this._toggleAllColumns(true)}},{key:"hideAllColumns",value:function yt(){this._toggleAllColumns(false)}},{key:"_toggleAllColumns",value:function wt(e){var r=this;var a=b(this.columns.slice().reverse()),i;try{for(a.s();!(i=a.n()).done;){var n=i.value;if(n.switchable){if(!e&&this.options.showColumns&&this.getVisibleColumns().filter(function(t){return t.switchable}).length===this.options.minimumCountColumns)continue;n.visible=e}}}catch(o){a.e(o)}finally{a.f()}this.initHeader();this.initSearch();this.initPagination();this.initBody();if(this.options.showColumns){var s=this.$toolbar.find('.keep-open input[type="checkbox"]:not(".toggle-all")').prop("disabled",false);if(e)s.prop("checked",e);else s.get().reverse().forEach(function(a){if(s.filter(":checked").length>r.options.minimumCountColumns)t(a).prop("checked",e)});if(s.filter(":checked").length<=this.options.minimumCountColumns)s.filter(":checked").prop("disabled",true)}}},{key:"mergeCells",value:function St(t){var e=t.index;var r=this.getVisibleFields().indexOf(t.field);var a=t.rowspan||1;var i=t.colspan||1;var n;var o;var s=this.$body.find(">tr[data-index]");r+=fy.getDetailViewIndexOffset(this.options);var l=s.eq(e).find(">td").eq(r);if(e<0||r<0||e>=this.data.length)return;for(n=e;ntd").eq(o).hide();l.attr("rowspan",a).attr("colspan",i).show()}},{key:"checkAll",value:function xt(){this._toggleCheckAll(true)}},{key:"uncheckAll",value:function Ot(){this._toggleCheckAll(false)}},{key:"_toggleCheckAll",value:function kt(t){var e=this.getSelections();this.$selectAll.add(this.$selectAll_).prop("checked",t);this.$selectItem.filter(":enabled").prop("checked",t);this.updateRows();this.updateSelected();var r=this.getSelections();if(t){this.trigger("check-all",r,e);return}this.trigger("uncheck-all",r,e)}},{key:"checkInvert",value:function Pt(){var e=this.$selectItem.filter(":enabled");var r=e.filter(":checked");e.each(function(e,r){t(r).prop("checked",!t(r).prop("checked"))});this.updateRows();this.updateSelected();this.trigger("uncheck-some",r);r=this.getSelections();this.trigger("check-some",r)}},{key:"check",value:function Ct(t){this._toggleCheck(true,t)}},{key:"uncheck",value:function Tt(t){this._toggleCheck(false,t)}},{key:"_toggleCheck",value:function It(t,e){var r=this.$selectItem.filter('[data-index="'.concat(e,'"]'));var a=this.data[e];if(r.is(":radio")||this.options.singleSelect||this.options.multipleSelectRow&&!this.multipleSelectRowCtrlKey&&!this.multipleSelectRowShiftKey){var i=b(this.options.data),n;try{for(i.s();!(n=i.n()).done;){var o=n.value;o[this.header.stateField]=false}}catch(s){i.e(s)}finally{i.f()}this.$selectItem.filter(":checked").not(r).prop("checked",false)}a[this.header.stateField]=t;if(this.options.multipleSelectRow){if(this.multipleSelectRowShiftKey&&this.multipleSelectRowLastSelectedIndex>=0){var c=this.multipleSelectRowLastSelectedIndexr.clientWidth}if(!this.options.cardView&&this.options.showHeader&&this.options.height){this.$tableHeader.show();this.resetHeader();e+=this.$header.outerHeight(true)+1}else{this.$tableHeader.hide();this.trigger("post-header")}if(!this.options.cardView&&this.options.showFooter){this.$tableFooter.show();this.fitFooter();if(this.options.height)e+=this.$tableFooter.outerHeight(true)}if(this.$container.hasClass("fullscreen")){this.$tableContainer.css("height","");this.$tableContainer.css("width","")}else if(this.options.height){if(this.$tableBorder){this.$tableBorder.css("width","");this.$tableBorder.css("height","")}var a=this.$toolbar.outerHeight(true);var i=this.$pagination.outerHeight(true);var n=this.options.height-a-i;var o=this.$tableBody.find(">table");var s=o.outerHeight();this.$tableContainer.css("height","".concat(n,"px"));if(this.$tableBorder&&o.is(":visible")){var l=n-s-2;if(this.hasScrollBar)l-=fy.getScrollBarWidth();this.$tableBorder.css("width","".concat(o.outerWidth(),"px"));this.$tableBorder.css("height","".concat(l,"px"))}}if(this.options.cardView){this.$el.css("margin-top","0");this.$tableContainer.css("padding-bottom","0");this.$tableFooter.hide()}else{this.getCaret();this.$tableContainer.css("padding-bottom","".concat(e,"px"))}this.trigger("reset-view")}},{key:"showLoading",value:function Nt(){this.$tableLoading.toggleClass("open",true);var t=this.options.loadingFontSize;if("auto"===this.options.loadingFontSize){t=.04*this.$tableLoading.width();t=Math.max(12,t);t=Math.min(32,t);t="".concat(t,"px")}this.$tableLoading.find(".loading-text").css("font-size",t)}},{key:"hideLoading",value:function Ft(){this.$tableLoading.toggleClass("open",false)}},{key:"toggleShowSearch",value:function Dt(){this.$el.parents(".select-table").siblings().slideToggle()}},{key:"togglePagination",value:function Vt(){this.options.pagination=!this.options.pagination;var t=this.options.showButtonIcons?this.options.pagination?this.options.icons.paginationSwitchDown:this.options.icons.paginationSwitchUp:"";var e=this.options.showButtonText?this.options.pagination?this.options.formatPaginationSwitchUp():this.options.formatPaginationSwitchDown():"";this.$toolbar.find('button[name="paginationSwitch"]').html("".concat(fy.sprintf(this.constants.html.icon,this.options.iconsPrefix,t)," ").concat(e));this.updatePagination();this.trigger("toggle-pagination",this.options.pagination)}},{key:"toggleFullscreen",value:function Bt(){this.$el.closest(".bootstrap-table").toggleClass("fullscreen");this.resetView()}},{key:"toggleView",value:function Lt(){this.options.cardView=!this.options.cardView;this.initHeader();var t=this.options.showButtonIcons?this.options.cardView?this.options.icons.toggleOn:this.options.icons.toggleOff:"";var e=this.options.showButtonText?this.options.cardView?this.options.formatToggleOff():this.options.formatToggleOn():"";this.$toolbar.find('button[name="toggle"]').html("".concat(fy.sprintf(this.constants.html.icon,this.options.iconsPrefix,t)," ").concat(e)).attr("aria-label",e).attr("title",e);this.initBody();this.trigger("toggle",this.options.cardView)}},{key:"resetSearch",value:function Ht(t){var e=fy.getSearchInput(this);var r=t||"";e.val(r);this.searchText=r;this.onSearch({currentTarget:e},false)}},{key:"filterBy",value:function Mt(t,e){this.filterOptions=fy.isEmptyObject(e)?this.options.filterOptions:fy.extend(this.options.filterOptions,e);this.filterColumns=fy.isEmptyObject(t)?{}:t;this.options.pageNumber=1;this.initSearch();this.updatePagination()}},{key:"scrollTo",value:function Ut(e){var r={unit:"px",value:0};if("object"===i(e))r=Object.assign(r,e);else if("string"===typeof e&&"bottom"===e)r.value=this.$tableBody[0].scrollHeight;else if("string"===typeof e||"number"===typeof e)r.value=e;var Ut=r.value;if("rows"===r.unit){Ut=0;this.$body.find("> tr:lt(".concat(r.value,")")).each(function(e,r){Ut+=t(r).outerHeight(true)})}this.$tableBody.scrollTop(Ut)}},{key:"getScrollPosition",value:function zt(){return this.$tableBody.scrollTop()}},{key:"selectPage",value:function qt(t){if(t>0&&t<=this.options.totalPages){this.options.pageNumber=t;this.updatePagination()}}},{key:"prevPage",value:function Gt(){if(this.options.pageNumber>1){this.options.pageNumber--;this.updatePagination()}}},{key:"nextPage",value:function Wt(){if(this.options.pageNumber tr[data-index="%s"]',t));if(r.next().is("tr.detail-view"))this.collapseRow(t);else this.expandRow(t,e);this.resetView()}},{key:"expandRow",value:function Yt(t,e){var r=this.data[t];var a=this.$body.find(fy.sprintf('> tr[data-index="%s"][data-has-detail-view]',t));if(this.options.detailViewIcon)a.find("a.detail-icon").html(fy.sprintf(this.constants.html.icon,this.options.iconsPrefix,this.options.icons.detailClose));if(a.next().is("tr.detail-view"))return;a.after(fy.sprintf('',a.children("td").length));var i=a.next().find("td");var n=e||this.options.detailFormatter;var o=fy.calculateObjectValue(this.options,n,[t,r,i],"");if(1===i.length)i.append(o);this.trigger("expand-row",t,r,i)}},{key:"expandRowByUniqueId",value:function Jt(t){var e=this.getRowByUniqueId(t);if(!e)return;this.expandRow(this.data.indexOf(e))}},{key:"collapseRow",value:function Xt(t){var e=this.data[t];var r=this.$body.find(fy.sprintf('> tr[data-index="%s"][data-has-detail-view]',t));if(!r.next().is("tr.detail-view"))return;if(this.options.detailViewIcon)r.find("a.detail-icon").html(fy.sprintf(this.constants.html.icon,this.options.iconsPrefix,this.options.icons.detailOpen));this.trigger("collapse-row",t,e,r.next());r.next().remove()}},{key:"collapseRowByUniqueId",value:function Qt(t){var e=this.getRowByUniqueId(t);if(!e)return;this.collapseRow(this.data.indexOf(e))}},{key:"expandAllRows",value:function Zt(){var e=this.$body.find("> tr[data-index][data-has-detail-view]");for(var r=0;r tr[data-index][data-has-detail-view]");for(var r=0;r1?r-1:0),n=1;n - ${ 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() : ''} `, event: this.toggleAutoRefresh diff --git a/src/main/resources/static/ajax/libs/bootstrap-table/extensions/columns/bootstrap-table-fixed-columns.js b/src/main/resources/static/ajax/libs/bootstrap-table/extensions/columns/bootstrap-table-fixed-columns.js index b78d1b5c6..288fca2f8 100644 --- a/src/main/resources/static/ajax/libs/bootstrap-table/extensions/columns/bootstrap-table-fixed-columns.js +++ b/src/main/resources/static/ajax/libs/bootstrap-table/extensions/columns/bootstrap-table-fixed-columns.js @@ -1,405 +1,5 @@ /** * @author zhixin wen + * @github: bootstrap-table/dist/extensions/fixed-columns/bootstrap-table-fixed-columns.min.js */ - -var Utils = $.fn.bootstrapTable.utils - -// Reasonable defaults -const PIXEL_STEP = 10 -const LINE_HEIGHT = 40 -const PAGE_HEIGHT = 800 - -function normalizeWheel (event) { - let sX = 0 // spinX - let sY = 0 // spinY - let pX = 0 // pixelX - let pY = 0 // pixelY - - // Legacy - if ('detail' in event) { sY = event.detail } - if ('wheelDelta' in event) { sY = -event.wheelDelta / 120 } - if ('wheelDeltaY' in event) { sY = -event.wheelDeltaY / 120 } - if ('wheelDeltaX' in event) { sX = -event.wheelDeltaX / 120 } - - // side scrolling on FF with DOMMouseScroll - if ('axis' in event && event.axis === event.HORIZONTAL_AXIS) { - sX = sY - sY = 0 - } - - pX = sX * PIXEL_STEP - pY = sY * PIXEL_STEP - - if ('deltaY' in event) { pY = event.deltaY } - if ('deltaX' in event) { pX = event.deltaX } - - if ((pX || pY) && event.deltaMode) { - if (event.deltaMode === 1) { // delta in LINE units - pX *= LINE_HEIGHT - pY *= LINE_HEIGHT - } else { // delta in PAGE units - pX *= PAGE_HEIGHT - pY *= PAGE_HEIGHT - } - } - - // Fall-back if spin cannot be determined - if (pX && !sX) { sX = (pX < 1) ? -1 : 1 } - if (pY && !sY) { sY = (pY < 1) ? -1 : 1 } - - return { - spinX: sX, - spinY: sY, - pixelX: pX, - pixelY: pY - } -} - -$.extend($.fn.bootstrapTable.defaults, { - fixedColumns: false, - fixedNumber: 0, - fixedRightNumber: 0 -}) - -$.BootstrapTable = class extends $.BootstrapTable { - - fixedColumnsSupported () { - return this.options.fixedColumns && - !this.options.detailView && - !this.options.cardView - } - - initContainer () { - super.initContainer() - - if (!this.fixedColumnsSupported()) { - return - } - - if (this.options.fixedNumber) { - this.$tableContainer.append('
    ') - this.$fixedColumns = this.$tableContainer.find('.fixed-columns') - } - - if (this.options.fixedRightNumber) { - this.$tableContainer.append('
    ') - this.$fixedColumnsRight = this.$tableContainer.find('.fixed-columns-right') - } - } - - initBody (...args) { - super.initBody(...args) - - if (this.$fixedColumns && this.$fixedColumns.length) { - this.$fixedColumns.toggle(this.fixedColumnsSupported()) - } - if (this.$fixedColumnsRight && this.$fixedColumnsRight.length) { - this.$fixedColumnsRight.toggle(this.fixedColumnsSupported()) - } - - if (!this.fixedColumnsSupported()) { - return - } - - if (this.options.showHeader && this.options.height) { - return - } - - this.initFixedColumnsBody() - this.initFixedColumnsEvents() - } - - trigger (...args) { - super.trigger(...args) - - if (!this.fixedColumnsSupported()) { - return - } - - if (args[0] === 'post-header') { - this.initFixedColumnsHeader() - } else if (args[0] === 'scroll-body') { - if (this.needFixedColumns && this.options.fixedNumber) { - this.$fixedBody.scrollTop(this.$tableBody.scrollTop()) - } - - if (this.needFixedColumns && this.options.fixedRightNumber) { - this.$fixedBodyRight.scrollTop(this.$tableBody.scrollTop()) - } - } - } - - updateSelected () { - super.updateSelected() - - if (!this.fixedColumnsSupported()) { - return - } - - this.$tableBody.find('tr').each((i, el) => { - const $el = $(el) - const index = $el.data('index') - const classes = $el.attr('class') - - const inputSelector = `[name="${this.options.selectItemName}"]` - const $input = $el.find(inputSelector) - - if (typeof index === undefined) { - return - } - - const updateFixedBody = ($fixedHeader, $fixedBody) => { - const $tr = $fixedBody.find(`tr[data-index="${index}"]`) - - $tr.attr('class', classes) - - if ($input.length) { - $tr.find(inputSelector).prop('checked', $input.prop('checked')) - } - - if (this.$selectAll.length) { - $fixedHeader.add($fixedBody) - .find('[name="btSelectAll"]') - .prop('checked', this.$selectAll.prop('checked')) - } - } - - if (this.$fixedBody && this.options.fixedNumber) { - updateFixedBody(this.$fixedHeader, this.$fixedBody) - } - - if (this.$fixedBodyRight && this.options.fixedRightNumber) { - updateFixedBody(this.$fixedHeaderRight, this.$fixedBodyRight) - } - }) - } - - hideLoading () { - super.hideLoading() - - if (this.needFixedColumns && this.options.fixedNumber) { - this.$fixedColumns.find('.fixed-table-loading').hide() - } - - if (this.needFixedColumns && this.options.fixedRightNumber) { - this.$fixedColumnsRight.find('.fixed-table-loading').hide() - } - } - - initFixedColumnsHeader () { - if (this.options.height) { - this.needFixedColumns = this.$tableHeader.outerWidth(true) < this.$tableHeader.find('table').outerWidth(true) - } else { - this.needFixedColumns = this.$tableBody.outerWidth(true) < this.$tableBody.find('table').outerWidth(true) - } - - const initFixedHeader = ($fixedColumns, isRight) => { - $fixedColumns.find('.fixed-table-header').remove() - $fixedColumns.append(this.$tableHeader.clone(true)) - - $fixedColumns.css({ - width: this.getFixedColumnsWidth(isRight) - }) - return $fixedColumns.find('.fixed-table-header') - } - - if (this.needFixedColumns && this.options.fixedNumber) { - this.$fixedHeader = initFixedHeader(this.$fixedColumns) - this.$fixedHeader.css('margin-right', '') - } else if (this.$fixedColumns) { - this.$fixedColumns.html('').css('width', '') - } - - if (this.needFixedColumns && this.options.fixedRightNumber) { - this.$fixedHeaderRight = initFixedHeader(this.$fixedColumnsRight, true) - this.$fixedHeaderRight.scrollLeft(this.$fixedHeaderRight.find('table').width()) - } else if (this.$fixedColumnsRight) { - this.$fixedColumnsRight.html('').css('width', '') - } - - this.initFixedColumnsBody() - this.initFixedColumnsEvents() - } - - initFixedColumnsBody () { - const initFixedBody = ($fixedColumns, $fixedHeader) => { - $fixedColumns.find('.fixed-table-body').remove() - $fixedColumns.append(this.$tableBody.clone(true)) - $fixedColumns.find('.fixed-table-body table').removeAttr('id') - - const $fixedBody = $fixedColumns.find('.fixed-table-body') - - const tableBody = this.$tableBody.get(0) - const scrollHeight = tableBody.scrollWidth > tableBody.clientWidth ? - Utils.getScrollBarWidth() : 0 - const height = this.$tableContainer.outerHeight(true) - scrollHeight - 1 - - $fixedColumns.css({ - height - }) - - $fixedBody.css({ - height: height - $fixedHeader.height() - }) - - return $fixedBody - } - - if (this.needFixedColumns && this.options.fixedNumber) { - this.$fixedBody = initFixedBody(this.$fixedColumns, this.$fixedHeader) - } - - if (this.needFixedColumns && this.options.fixedRightNumber) { - this.$fixedBodyRight = initFixedBody(this.$fixedColumnsRight, this.$fixedHeaderRight) - this.$fixedBodyRight.scrollLeft(this.$fixedBodyRight.find('table').width()) - this.$fixedBodyRight.css('overflow-y', this.options.height ? 'auto' : 'hidden') - } - } - - getFixedColumnsWidth (isRight) { - let visibleFields = this.getVisibleFields() - let width = 0 - let fixedNumber = this.options.fixedNumber - let marginRight = 0 - - if (isRight) { - visibleFields = visibleFields.reverse() - fixedNumber = this.options.fixedRightNumber - marginRight = parseInt(this.$tableHeader.css('margin-right'), 10) - } - - for (let i = 0; i < fixedNumber; i++) { - width += this.$header.find(`th[data-field="${visibleFields[i]}"]`).outerWidth(true) - } - - return width + marginRight + 1 - } - - initFixedColumnsEvents () { - const toggleHover = (e, toggle) => { - const tr = `tr[data-index="${$(e.currentTarget).data('index')}"]` - let $trs = this.$tableBody.find(tr) - - if (this.$fixedBody) { - $trs = $trs.add(this.$fixedBody.find(tr)) - } - if (this.$fixedBodyRight) { - $trs = $trs.add(this.$fixedBodyRight.find(tr)) - } - - $trs.css('background-color', toggle ? $(e.currentTarget).css('background-color') : '') - } - - this.$tableBody.find('tr').hover(e => { - toggleHover(e, true) - }, e => { - toggleHover(e, false) - }) - - const isFirefox = typeof navigator !== 'undefined' && - navigator.userAgent.toLowerCase().indexOf('firefox') > -1 - const mousewheel = isFirefox ? 'DOMMouseScroll' : 'mousewheel' - const updateScroll = (e, fixedBody) => { - const normalized = normalizeWheel(e) - const deltaY = Math.ceil(normalized.pixelY) - const top = this.$tableBody.scrollTop() + deltaY - - if ( - deltaY < 0 && top > 0 || - deltaY > 0 && top < fixedBody.scrollHeight - fixedBody.clientHeight - ) { - e.preventDefault() - } - - this.$tableBody.scrollTop(top) - if (this.$fixedBody) { - this.$fixedBody.scrollTop(top) - } - if (this.$fixedBodyRight) { - this.$fixedBodyRight.scrollTop(top) - } - } - - if (this.needFixedColumns && this.options.fixedNumber) { - this.$fixedBody.find('tr').hover(e => { - toggleHover(e, true) - }, e => { - toggleHover(e, false) - }) - - this.$fixedBody[0].addEventListener(mousewheel, e => { - updateScroll(e, this.$fixedBody[0]) - }) - } - - if (this.needFixedColumns && this.options.fixedRightNumber) { - this.$fixedBodyRight.find('tr').hover(e => { - toggleHover(e, true) - }, e => { - toggleHover(e, false) - }) - - this.$fixedBodyRight.off('scroll').on('scroll', () => { - const top = this.$fixedBodyRight.scrollTop() - - this.$tableBody.scrollTop(top) - if (this.$fixedBody) { - this.$fixedBody.scrollTop(top) - } - }) - } - - if (this.options.filterControl) { - $(this.$fixedColumns).off('keyup change').on('keyup change', e => { - const $target = $(e.target) - const value = $target.val() - const field = $target.parents('th').data('field') - const $coreTh = this.$header.find(`th[data-field="${field}"]`) - - if ($target.is('input')) { - $coreTh.find('input').val(value) - } else if ($target.is('select')) { - const $select = $coreTh.find('select') - - $select.find('option[selected]').removeAttr('selected') - $select.find(`option[value="${value}"]`).attr('selected', true) - } - - this.triggerSearch() - }) - } - } - - renderStickyHeader () { - if (!this.options.stickyHeader) { - return - } - - this.$stickyContainer = this.$container.find('.sticky-header-container') - super.renderStickyHeader() - - if (this.needFixedColumns && this.options.fixedNumber) { - this.$fixedColumns.css('z-index', 101) - .find('.sticky-header-container') - .css('right', '') - .width(this.$fixedColumns.outerWidth()) - } - - if (this.needFixedColumns && this.options.fixedRightNumber) { - const $stickyHeaderContainerRight = this.$fixedColumnsRight.find('.sticky-header-container') - - this.$fixedColumnsRight.css('z-index', 101) - $stickyHeaderContainerRight.css('left', '') - .scrollLeft($stickyHeaderContainerRight.find('.table').outerWidth()) - .width(this.$fixedColumnsRight.outerWidth()) - } - } - - matchPositionX () { - if (!this.options.stickyHeader) { - return - } - - this.$stickyContainer.eq(0).scrollLeft(this.$tableBody.scrollLeft()) - } -} +!function(t,e){"object"==typeof exports&&"undefined"!=typeof module?e(require("jquery")):"function"==typeof define&&define.amd?define(["jquery"],e):e((t="undefined"!=typeof globalThis?globalThis:t||self).jQuery)}(this,(function(t){"use strict";function e(t){return t&&"object"==typeof t&&"default"in t?t:{default:t}}var n=e(t);function i(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function r(t,e){for(var n=0;n0&&S[0]<4?1:+(S[0]+S[1])),!j&<&&(!(S=lt.match(/Edge\/(\d+)/))||S[1]>=74)&&(S=lt.match(/Chrome\/(\d+)/))&&(j=+S[1]);var bt=j,gt=bt,vt=y,mt=!!Object.getOwnPropertySymbols&&!vt((function(){var t=Symbol();return!String(t)||!(Object(t)instanceof Symbol)||!Symbol.sham&>&><41})),xt=mt&&!Symbol.sham&&"symbol"==typeof Symbol.iterator,$t=at,wt=et,Ct=ct,Ot=Object,St=xt?function(t){return"symbol"==typeof t}:function(t){var e=$t("Symbol");return wt(e)&&Ct(e.prototype,Ot(t))},jt=String,Rt=et,Bt=function(t){try{return jt(t)}catch(t){return"Object"}},Tt=TypeError,Ft=function(t){if(Rt(t))return t;throw Tt(Bt(t)+" is not a function")},kt=Ft,Pt=Y,Et=x,At=et,Nt=rt,Ht=TypeError,Dt={exports:{}},It=h,Lt=Object.defineProperty,Mt=function(t,e){try{Lt(It,t,{value:e,configurable:!0,writable:!0})}catch(n){It[t]=e}return e},_t=Mt,Wt="__core-js_shared__",zt=h[Wt]||_t(Wt,{}),Xt=zt;(Dt.exports=function(t,e){return Xt[t]||(Xt[t]=void 0!==e?e:{})})("versions",[]).push({version:"3.25.5",mode:"global",copyright:"© 2014-2022 Denis Pushkarev (zloirock.ru)",license:"https://github.com/zloirock/core-js/blob/v3.25.5/LICENSE",source:"https://github.com/zloirock/core-js"});var Yt=V,qt=Object,Gt=function(t){return qt(Yt(t))},Vt=Gt,Ut=L({}.hasOwnProperty),Kt=Object.hasOwn||function(t,e){return Ut(Vt(t),e)},Qt=L,Zt=0,Jt=Math.random(),te=Qt(1..toString),ee=function(t){return"Symbol("+(void 0===t?"":t)+")_"+te(++Zt+Jt,36)},ne=h,ie=Dt.exports,re=Kt,oe=ee,ue=mt,fe=xt,ae=ie("wks"),ce=ne.Symbol,se=ce&&ce.for,le=fe?ce:ce&&ce.withoutSetter||oe,de=function(t){if(!re(ae,t)||!ue&&"string"!=typeof ae[t]){var e="Symbol."+t;ue&&re(ce,t)?ae[t]=ce[t]:ae[t]=fe&&se?se(e):le(e)}return ae[t]},he=x,pe=rt,ye=St,be=function(t,e){var n=t[e];return Pt(n)?void 0:kt(n)},ge=function(t,e){var n,i;if("string"===e&&At(n=t.toString)&&!Nt(i=Et(n,t)))return i;if(At(n=t.valueOf)&&!Nt(i=Et(n,t)))return i;if("string"!==e&&At(n=t.toString)&&!Nt(i=Et(n,t)))return i;throw Ht("Can't convert object to primitive value")},ve=TypeError,me=de("toPrimitive"),xe=function(t,e){if(!pe(t)||ye(t))return t;var n,i=be(t,me);if(i){if(void 0===e&&(e="default"),n=he(i,t,e),!pe(n)||ye(n))return n;throw ve("Can't convert object to primitive value")}return void 0===e&&(e="number"),ge(t,e)},$e=St,we=function(t){var e=xe(t,"string");return $e(e)?e:e+""},Ce=rt,Oe=h.document,Se=Ce(Oe)&&Ce(Oe.createElement),je=function(t){return Se?Oe.createElement(t):{}},Re=je,Be=!b&&!y((function(){return 7!=Object.defineProperty(Re("div"),"a",{get:function(){return 7}}).a})),Te=b,Fe=x,ke=$,Pe=R,Ee=Q,Ae=we,Ne=Kt,He=Be,De=Object.getOwnPropertyDescriptor;p.f=Te?De:function(t,e){if(t=Ee(t),e=Ae(e),He)try{return De(t,e)}catch(t){}if(Ne(t,e))return Pe(!Fe(ke.f,t,e),t[e])};var Ie={},Le=b&&y((function(){return 42!=Object.defineProperty((function(){}),"prototype",{value:42,writable:!1}).prototype})),Me=rt,_e=String,We=TypeError,ze=function(t){if(Me(t))return t;throw We(_e(t)+" is not an object")},Xe=b,Ye=Be,qe=Le,Ge=ze,Ve=we,Ue=TypeError,Ke=Object.defineProperty,Qe=Object.getOwnPropertyDescriptor,Ze="enumerable",Je="configurable",tn="writable";Ie.f=Xe?qe?function(t,e,n){if(Ge(t),e=Ve(e),Ge(n),"function"==typeof t&&"prototype"===e&&"value"in n&&tn in n&&!n.writable){var i=Qe(t,e);i&&i.writable&&(t[e]=n.value,n={configurable:Je in n?n.configurable:i.configurable,enumerable:Ze in n?n.enumerable:i.enumerable,writable:!1})}return Ke(t,e,n)}:Ke:function(t,e,n){if(Ge(t),e=Ve(e),Ge(n),Ye)try{return Ke(t,e,n)}catch(t){}if("get"in n||"set"in n)throw Ue("Accessors not supported");return"value"in n&&(t[e]=n.value),t};var en=Ie,nn=R,rn=b?function(t,e,n){return en.f(t,e,nn(1,n))}:function(t,e,n){return t[e]=n,t},on={exports:{}},un=b,fn=Kt,an=Function.prototype,cn=un&&Object.getOwnPropertyDescriptor,sn=fn(an,"name"),ln={EXISTS:sn,PROPER:sn&&"something"===function(){}.name,CONFIGURABLE:sn&&(!un||un&&cn(an,"name").configurable)},dn=et,hn=zt,pn=L(Function.toString);dn(hn.inspectSource)||(hn.inspectSource=function(t){return pn(t)});var yn,bn,gn,vn=hn.inspectSource,mn=et,xn=h.WeakMap,$n=mn(xn)&&/native code/.test(String(xn)),wn=Dt.exports,Cn=ee,On=wn("keys"),Sn=function(t){return On[t]||(On[t]=Cn(t))},jn={},Rn=$n,Bn=h,Tn=rt,Fn=rn,kn=Kt,Pn=zt,En=Sn,An=jn,Nn="Object already initialized",Hn=Bn.TypeError,Dn=Bn.WeakMap;if(Rn||Pn.state){var In=Pn.state||(Pn.state=new Dn);In.get=In.get,In.has=In.has,In.set=In.set,yn=function(t,e){if(In.has(t))throw Hn(Nn);return e.facade=t,In.set(t,e),e},bn=function(t){return In.get(t)||{}},gn=function(t){return In.has(t)}}else{var Ln=En("state");An[Ln]=!0,yn=function(t,e){if(kn(t,Ln))throw Hn(Nn);return e.facade=t,Fn(t,Ln,e),e},bn=function(t){return kn(t,Ln)?t[Ln]:{}},gn=function(t){return kn(t,Ln)}}var Mn={set:yn,get:bn,has:gn,enforce:function(t){return gn(t)?bn(t):yn(t,{})},getterFor:function(t){return function(e){var n;if(!Tn(e)||(n=bn(e)).type!==t)throw Hn("Incompatible receiver, "+t+" required");return n}}},_n=y,Wn=et,zn=Kt,Xn=b,Yn=ln.CONFIGURABLE,qn=vn,Gn=Mn.enforce,Vn=Mn.get,Un=Object.defineProperty,Kn=Xn&&!_n((function(){return 8!==Un((function(){}),"length",{value:8}).length})),Qn=String(String).split("String"),Zn=on.exports=function(t,e,n){"Symbol("===String(e).slice(0,7)&&(e="["+String(e).replace(/^Symbol\(([^)]*)\)/,"$1")+"]"),n&&n.getter&&(e="get "+e),n&&n.setter&&(e="set "+e),(!zn(t,"name")||Yn&&t.name!==e)&&(Xn?Un(t,"name",{value:e,configurable:!0}):t.name=e),Kn&&n&&zn(n,"arity")&&t.length!==n.arity&&Un(t,"length",{value:n.arity});try{n&&zn(n,"constructor")&&n.constructor?Xn&&Un(t,"prototype",{writable:!1}):t.prototype&&(t.prototype=void 0)}catch(t){}var i=Gn(t);return zn(i,"source")||(i.source=Qn.join("string"==typeof e?e:"")),t};Function.prototype.toString=Zn((function(){return Wn(this)&&Vn(this).source||qn(this)}),"toString");var Jn=et,ti=Ie,ei=on.exports,ni=Mt,ii=function(t,e,n,i){i||(i={});var r=i.enumerable,o=void 0!==i.name?i.name:e;if(Jn(n)&&ei(n,o,i),i.global)r?t[e]=n:ni(e,n);else{try{i.unsafe?t[e]&&(r=!0):delete t[e]}catch(t){}r?t[e]=n:ti.f(t,e,{value:n,enumerable:!1,configurable:!i.nonConfigurable,writable:!i.nonWritable})}return t},ri={},oi=Math.ceil,ui=Math.floor,fi=Math.trunc||function(t){var e=+t;return(e>0?ui:oi)(e)},ai=function(t){var e=+t;return e!=e||0===e?0:fi(e)},ci=ai,si=Math.max,li=Math.min,di=ai,hi=Math.min,pi=function(t){return t>0?hi(di(t),9007199254740991):0},yi=function(t){return pi(t.length)},bi=Q,gi=function(t,e){var n=ci(t);return n<0?si(n+e,0):li(n,e)},vi=yi,mi=function(t){return function(e,n,i){var r,o=bi(e),u=vi(o),f=gi(i,u);if(t&&n!=n){for(;u>f;)if((r=o[f++])!=r)return!0}else for(;u>f;f++)if((t||f in o)&&o[f]===n)return t||f||0;return!t&&-1}},xi={includes:mi(!0),indexOf:mi(!1)},$i=Kt,wi=Q,Ci=xi.indexOf,Oi=jn,Si=L([].push),ji=function(t,e){var n,i=wi(t),r=0,o=[];for(n in i)!$i(Oi,n)&&$i(i,n)&&Si(o,n);for(;e.length>r;)$i(i,n=e[r++])&&(~Ci(o,n)||Si(o,n));return o},Ri=["constructor","hasOwnProperty","isPrototypeOf","propertyIsEnumerable","toLocaleString","toString","valueOf"],Bi=ji,Ti=Ri.concat("length","prototype");ri.f=Object.getOwnPropertyNames||function(t){return Bi(t,Ti)};var Fi={};Fi.f=Object.getOwnPropertySymbols;var ki=at,Pi=ri,Ei=Fi,Ai=ze,Ni=L([].concat),Hi=ki("Reflect","ownKeys")||function(t){var e=Pi.f(Ai(t)),n=Ei.f;return n?Ni(e,n(t)):e},Di=Kt,Ii=Hi,Li=p,Mi=Ie,_i=y,Wi=et,zi=/#|\.prototype\./,Xi=function(t,e){var n=qi[Yi(t)];return n==Vi||n!=Gi&&(Wi(e)?_i(e):!!e)},Yi=Xi.normalize=function(t){return String(t).replace(zi,".").toLowerCase()},qi=Xi.data={},Gi=Xi.NATIVE="N",Vi=Xi.POLYFILL="P",Ui=Xi,Ki=h,Qi=p.f,Zi=rn,Ji=ii,tr=Mt,er=function(t,e,n){for(var i=Ii(e),r=Mi.f,o=Li.f,u=0;uv;v++)if((f||v in y)&&(h=b(d=y[v],v,p),t))if(e)x[v]=h;else if(h)switch(t){case 3:return!0;case 5:return d;case 6:return v;case 2:Xr(x,d)}else switch(t){case 4:return!1;case 7:Xr(x,d)}return o?-1:i||r?r:x}},qr={forEach:Yr(0),map:Yr(1),filter:Yr(2),some:Yr(3),every:Yr(4),find:Yr(5),findIndex:Yr(6),filterReject:Yr(7)},Gr={},Vr=ji,Ur=Ri,Kr=Object.keys||function(t){return Vr(t,Ur)},Qr=b,Zr=Le,Jr=Ie,to=ze,eo=Q,no=Kr;Gr.f=Qr&&!Zr?Object.defineProperties:function(t,e){to(t);for(var n,i=eo(e),r=no(e),o=r.length,u=0;o>u;)Jr.f(t,n=r[u++],i[n]);return t};var io,ro=at("document","documentElement"),oo=ze,uo=Gr,fo=Ri,ao=jn,co=ro,so=je,lo=Sn("IE_PROTO"),ho=function(){},po=function(t){return" + + \ No newline at end of file diff --git a/src/main/resources/templates/demo/table/customView.html b/src/main/resources/templates/demo/table/customView.html index a2f4d1ceb..63b09999e 100644 --- a/src/main/resources/templates/demo/table/customView.html +++ b/src/main/resources/templates/demo/table/customView.html @@ -9,7 +9,7 @@
    + data-custom-view-default-view="true">
    @@ -94,8 +94,8 @@

    %userCode%

    align: 'center', formatter: function(value, row, index) { var actions = []; - actions.push('编辑 '); - actions.push('删除'); + actions.push('编辑 '); + actions.push('删除'); return actions.join(''); } }] diff --git a/src/main/resources/templates/demo/table/data.html b/src/main/resources/templates/demo/table/data.html index 818d5b7d1..50a9d0c46 100644 --- a/src/main/resources/templates/demo/table/data.html +++ b/src/main/resources/templates/demo/table/data.html @@ -63,8 +63,8 @@ align: 'center', formatter: function(value, row, index) { var actions = []; - actions.push('编辑 '); - actions.push('删除'); + actions.push('编辑 '); + actions.push('删除'); return actions.join(''); } }] diff --git a/src/main/resources/templates/demo/table/detail.html b/src/main/resources/templates/demo/table/detail.html index de12dbd8d..d0031db62 100644 --- a/src/main/resources/templates/demo/table/detail.html +++ b/src/main/resources/templates/demo/table/detail.html @@ -65,8 +65,8 @@ align: 'center', formatter: function(value, row, index) { var actions = []; - actions.push('编辑 '); - actions.push('删除'); + actions.push('编辑 '); + actions.push('删除'); return actions.join(''); } }] diff --git a/src/main/resources/templates/demo/table/dynamicColumns.html b/src/main/resources/templates/demo/table/dynamicColumns.html index 9338d2fa9..392b95248 100644 --- a/src/main/resources/templates/demo/table/dynamicColumns.html +++ b/src/main/resources/templates/demo/table/dynamicColumns.html @@ -79,8 +79,8 @@ align: 'center', formatter: function(value, row, index) { var actions = []; - actions.push('编辑 '); - actions.push('删除'); + actions.push('编辑 '); + actions.push('删除'); return actions.join(''); } }); diff --git a/src/main/resources/templates/demo/table/editable.html b/src/main/resources/templates/demo/table/editable.html index 3395e6d4e..7a25782dc 100644 --- a/src/main/resources/templates/demo/table/editable.html +++ b/src/main/resources/templates/demo/table/editable.html @@ -99,8 +99,8 @@ align: 'center', formatter: function(value, row, index) { var actions = []; - actions.push('编辑 '); - actions.push('删除'); + actions.push('编辑 '); + actions.push('删除'); return actions.join(''); } }] diff --git a/src/main/resources/templates/demo/table/event.html b/src/main/resources/templates/demo/table/event.html index 372b4c916..bafc455b0 100644 --- a/src/main/resources/templates/demo/table/event.html +++ b/src/main/resources/templates/demo/table/event.html @@ -74,8 +74,8 @@ align: 'center', formatter: function(value, row, index) { var actions = []; - actions.push('编辑 '); - actions.push('删除'); + actions.push('编辑 '); + actions.push('删除'); return actions.join(''); } }] diff --git a/src/main/resources/templates/demo/table/export.html b/src/main/resources/templates/demo/table/export.html index 083a87d7c..65cb3bf2c 100644 --- a/src/main/resources/templates/demo/table/export.html +++ b/src/main/resources/templates/demo/table/export.html @@ -72,8 +72,8 @@ align: 'center', formatter: function(value, row, index) { var actions = []; - actions.push('编辑 '); - actions.push('删除'); + actions.push('编辑 '); + actions.push('删除'); return actions.join(''); } }] diff --git a/src/main/resources/templates/demo/table/exportSelected.html b/src/main/resources/templates/demo/table/exportSelected.html index 4aec88df4..657bb8357 100644 --- a/src/main/resources/templates/demo/table/exportSelected.html +++ b/src/main/resources/templates/demo/table/exportSelected.html @@ -87,8 +87,8 @@ align: 'center', formatter: function(value, row, index) { var actions = []; - actions.push('编辑 '); - actions.push('删除'); + actions.push('编辑 '); + actions.push('删除'); return actions.join(''); } }] diff --git a/src/main/resources/templates/demo/table/footer.html b/src/main/resources/templates/demo/table/footer.html index 0988f8d68..3aaed27e0 100644 --- a/src/main/resources/templates/demo/table/footer.html +++ b/src/main/resources/templates/demo/table/footer.html @@ -71,8 +71,8 @@ align: 'center', formatter: function(value, row, index) { var actions = []; - actions.push('编辑 '); - actions.push('删除'); + actions.push('编辑 '); + actions.push('删除'); return actions.join(''); } }] diff --git a/src/main/resources/templates/demo/table/groupHeader.html b/src/main/resources/templates/demo/table/groupHeader.html index 27d2b8d60..a152dfb4f 100644 --- a/src/main/resources/templates/demo/table/groupHeader.html +++ b/src/main/resources/templates/demo/table/groupHeader.html @@ -65,8 +65,8 @@ align : 'center', formatter : function (value, row, index) { var actions = []; - actions.push('编辑 '); - actions.push('删除'); + actions.push('编辑 '); + actions.push('删除'); return actions.join(''); } } diff --git a/src/main/resources/templates/demo/table/headerStyle.html b/src/main/resources/templates/demo/table/headerStyle.html index 0c862c739..0af7a0249 100644 --- a/src/main/resources/templates/demo/table/headerStyle.html +++ b/src/main/resources/templates/demo/table/headerStyle.html @@ -64,8 +64,8 @@ align: 'center', formatter: function(value, row, index) { var actions = []; - actions.push('编辑 '); - actions.push('删除'); + actions.push('编辑 '); + actions.push('删除'); return actions.join(''); } }] diff --git a/src/main/resources/templates/demo/table/image.html b/src/main/resources/templates/demo/table/image.html index 34a60ab01..9a34e86bb 100644 --- a/src/main/resources/templates/demo/table/image.html +++ b/src/main/resources/templates/demo/table/image.html @@ -66,8 +66,8 @@ align: 'center', formatter: function(value, row, index) { var actions = []; - actions.push('编辑 '); - actions.push('删除'); + actions.push('编辑 '); + actions.push('删除'); return actions.join(''); } }] diff --git a/src/main/resources/templates/demo/table/other.html b/src/main/resources/templates/demo/table/other.html index d0f791b7f..b0a6e9cce 100644 --- a/src/main/resources/templates/demo/table/other.html +++ b/src/main/resources/templates/demo/table/other.html @@ -83,8 +83,8 @@ align: 'center', formatter: function(value, row, index) { var actions = []; - actions.push('编辑 '); - actions.push('删除'); + actions.push('编辑 '); + actions.push('删除'); return actions.join(''); } }] diff --git a/src/main/resources/templates/demo/table/pageGo.html b/src/main/resources/templates/demo/table/pageGo.html index 32a95817c..7f3d59701 100644 --- a/src/main/resources/templates/demo/table/pageGo.html +++ b/src/main/resources/templates/demo/table/pageGo.html @@ -64,8 +64,8 @@ align: 'center', formatter: function(value, row, index) { var actions = []; - actions.push('编辑 '); - actions.push('删除'); + actions.push('编辑 '); + actions.push('删除'); return actions.join(''); } }] diff --git a/src/main/resources/templates/demo/table/params.html b/src/main/resources/templates/demo/table/params.html index ba852f100..30b12572e 100644 --- a/src/main/resources/templates/demo/table/params.html +++ b/src/main/resources/templates/demo/table/params.html @@ -81,8 +81,8 @@ align: 'center', formatter: function(value, row, index) { var actions = []; - actions.push('编辑 '); - actions.push('删除'); + actions.push('编辑 '); + actions.push('删除'); return actions.join(''); } }] @@ -145,8 +145,8 @@ align: 'center', formatter: function(value, row, index) { var actions = []; - actions.push('编辑 '); - actions.push('删除'); + actions.push('编辑 '); + actions.push('删除'); return actions.join(''); } }] diff --git a/src/main/resources/templates/demo/table/remember.html b/src/main/resources/templates/demo/table/remember.html index 4c0b9ec7e..1fff9a3f2 100644 --- a/src/main/resources/templates/demo/table/remember.html +++ b/src/main/resources/templates/demo/table/remember.html @@ -66,8 +66,8 @@ align: 'center', formatter: function(value, row, index) { var actions = []; - actions.push('编辑 '); - actions.push('删除'); + actions.push('编辑 '); + actions.push('删除'); return actions.join(''); } }] diff --git a/src/main/resources/templates/demo/table/reorderRows.html b/src/main/resources/templates/demo/table/reorderRows.html index e788ccbd2..ded9ecec9 100644 --- a/src/main/resources/templates/demo/table/reorderRows.html +++ b/src/main/resources/templates/demo/table/reorderRows.html @@ -32,11 +32,14 @@ showRefresh: false, showToggle: false, showColumns: false, - onReorderRow: function (data) { - //当拖拽结束后,data为整个表格的数据 + onReorderRow: function (data, newRow, oldRow, el) { + // 当拖拽结束后,data为整个表格的数据 console.table(data) // 当sidePagination: "server"时,拖拽行后顺序错乱,需要重新调用加载数据方法 - $("#" + table.options.id).bootstrapTable('load', data); + $("#" + table.options.id).bootstrapTable('load', { + total: el._xhr.responseJSON.total, + rows: data + }); return false; }, columns: [{ diff --git a/src/main/resources/templates/demo/table/resizable.html b/src/main/resources/templates/demo/table/resizable.html index 40f92f51a..8d2b6fa35 100644 --- a/src/main/resources/templates/demo/table/resizable.html +++ b/src/main/resources/templates/demo/table/resizable.html @@ -38,7 +38,16 @@ }, { field : 'userName', - title : '用户姓名' + title : '用户姓名', + cellStyle: function (value, row, index) { + return { css: { "min-width": "100px", "white-space": "nowrap", "text-overflow": "ellipsis", "overflow": "hidden", "max-width": "200px" } } + }, + formatter: function(value, row, index) { + if (index == 0) { + value = value + ",测试用户姓名,这是一条长文本,可以通过拖拽自适应内容显示。。。。"; + } + return $.table.tooltip(value, 30, "open"); + } }, { field : 'userPhone', @@ -65,8 +74,8 @@ align: 'center', formatter: function(value, row, index) { var actions = []; - actions.push('编辑 '); - actions.push('删除'); + actions.push('编辑 '); + actions.push('删除'); return actions.join(''); } }] diff --git a/src/main/resources/templates/demo/table/textSearch.html b/src/main/resources/templates/demo/table/textSearch.html new file mode 100644 index 000000000..8457e6191 --- /dev/null +++ b/src/main/resources/templates/demo/table/textSearch.html @@ -0,0 +1,112 @@ + + + + + + +
    +
    +
    + +
    +
    +
    +
    + + + +
    + + + + \ No newline at end of file diff --git a/src/main/resources/templates/demo/table/virtualScroll.html b/src/main/resources/templates/demo/table/virtualScroll.html new file mode 100644 index 000000000..5c0fa839d --- /dev/null +++ b/src/main/resources/templates/demo/table/virtualScroll.html @@ -0,0 +1,98 @@ + + + + + + + +
    + + + + \ No newline at end of file diff --git a/src/main/resources/templates/include.html b/src/main/resources/templates/include.html index b32419a7d..d156314c1 100644 --- a/src/main/resources/templates/include.html +++ b/src/main/resources/templates/include.html @@ -9,35 +9,35 @@ - + - +
    - - + + - - - + + + - - - + + + - + - - - - + + + +
    @@ -108,10 +108,10 @@
    - +
    - +
    @@ -170,20 +170,20 @@
    - +
    - +
    - +
    @@ -192,31 +192,36 @@
    - +
    - +
    - +
    - +
    - +
    - + +
    + + +
    +
    diff --git a/src/main/resources/templates/index-topnav.html b/src/main/resources/templates/index-topnav.html index 08b9441b3..61012ae38 100644 --- a/src/main/resources/templates/index-topnav.html +++ b/src/main/resources/templates/index-topnav.html @@ -14,8 +14,8 @@ - - + +
    @@ -40,7 +40,7 @@

    [[${user.loginName}]]

    - 在线 + 在线 注销
    @@ -53,7 +53,7 @@ [[${cmenu.menuName}]] - + [[${cmenu.menuName}]] @@ -64,7 +64,7 @@ [[${emenu.menuName}]] - + [[${emenu.menuName}]] @@ -93,7 +93,7 @@
    @@ -211,7 +214,7 @@ - +