Commit 4034699b59682fa60f0822f7c7709d21688e49ed

Authored by mahuandong
1 parent c3b1d1fb

删除验证码过滤器,修改js封装方法

Showing 23 changed files with 2215 additions and 1389 deletions
src/main/java/com/huaheng/framework/config/ShiroConfig.java
... ... @@ -263,13 +263,13 @@ public class ShiroConfig
263 263 filterChainDefinitionMap.put("/admin/logout", "adminlogout");
264 264 // 不需要拦截的访问
265 265 // filterChainDefinitionMap.put("/admin/home", "anon,captchaValidate");
266   - filterChainDefinitionMap.put("/mobile/download/*", "anon,captchaValidate");
267   - filterChainDefinitionMap.put("/admin/login", "anon,captchaValidate");
268   - filterChainDefinitionMap.put("/login", "anon,captchaValidate");
269   - filterChainDefinitionMap.put("/api/login", "anon,captchaValidate");
270   - filterChainDefinitionMap.put("/mobile/login", "anon,captchaValidate");
271   - filterChainDefinitionMap.put("/getWarehouseByUserCode", "anon,captchaValidate");
272   - filterChainDefinitionMap.put("/API/WMS/v2/login", "anon,captchaValidate");
  266 + filterChainDefinitionMap.put("/mobile/download/*", "anon");
  267 + filterChainDefinitionMap.put("/admin/login", "anon");
  268 + filterChainDefinitionMap.put("/login", "anon");
  269 + filterChainDefinitionMap.put("/api/login", "anon");
  270 + filterChainDefinitionMap.put("/mobile/login", "anon");
  271 + filterChainDefinitionMap.put("/getWarehouseByUserCode", "anon");
  272 + filterChainDefinitionMap.put("/API/WMS/v2/login", "anon");
273 273 // 系统权限列表
274 274 // filterChainDefinitionMap.putAll(SpringUtils.getBean(IMenuService.class).selectPermsAll());
275 275  
... ...
src/main/java/com/huaheng/mobile/receipt/MobileOneByOneReceiptController.java
... ... @@ -35,7 +35,7 @@ public class MobileOneByOneReceiptController {
35 35 public AjaxResult save(@RequestBody @ApiParam(value="容器号") ReceiptContainerView record) throws Exception {
36 36 record.setQty(new BigDecimal("1"));
37 37 AjaxResult retResult = receiptContainerHeaderService.saveCountain(record.getReceiptCode(), record.getReceiptContainerCode(),
38   - record.getReceiptDetailId(), record.getLocationCode(), record.getQty().intValue(), null);
  38 + record.getReceiptDetailId(), record.getLocationCode(), record.getQty(), null);
39 39 return retResult;
40 40 }
41 41 }
... ...
src/main/java/com/huaheng/pc/receipt/receiptContainerHeader/service/ReceiptContainerHeaderService.java
... ... @@ -6,6 +6,7 @@ import com.huaheng.pc.receipt.receiptContainerHeader.domain.ReceiptContainerHead
6 6 import com.baomidou.mybatisplus.extension.service.IService;
7 7 import com.huaheng.pc.receipt.receiptContainerHeader.domain.ReceiptContainerView;
8 8  
  9 +import java.math.BigDecimal;
9 10 import java.util.List;
10 11  
11 12 public interface ReceiptContainerHeaderService extends IService<ReceiptContainerHeader>{
... ... @@ -21,7 +22,7 @@ public interface ReceiptContainerHeaderService extends IService&lt;ReceiptContainer
21 22 * @return 是否保存成功
22 23 */
23 24 AjaxResult saveCountain(String receiptCode, String containerCode, Integer receiptDetailId,
24   - String locationCode, Integer qty, String locatingRule);
  25 + String locationCode, BigDecimal qty, String locatingRule);
25 26  
26 27 /**
27 28 * 取消组盘
... ...
src/main/java/com/huaheng/pc/receipt/receiptContainerHeader/service/ReceiptContainerHeaderServiceImpl.java
... ... @@ -70,7 +70,7 @@ public class ReceiptContainerHeaderServiceImpl extends ServiceImpl&lt;ReceiptContai
70 70 @Override
71 71 @Transactional
72 72 public AjaxResult saveCountain(String receiptCode, String containerCode, Integer receiptDetailId,
73   - String locationCode, Integer qty, String locatingRule) {
  73 + String locationCode, BigDecimal qty, String locatingRule) {
74 74 ReceiptDetail detail = receiptDetailService.getById(receiptDetailId);
75 75 //检查容器编码合法性
76 76 Integer taskType = checkContainer(containerCode, detail.getMaterialCode());
... ... @@ -129,7 +129,7 @@ public class ReceiptContainerHeaderServiceImpl extends ServiceImpl&lt;ReceiptContai
129 129 //根据入库单详情id查询入库详情
130 130 ReceiptDetail receiptDetail = receiptDetailService.getById(receiptDetailId);
131 131 receiptDetail.setId(receiptDetailId);
132   - receiptDetail.setOpenQty(new BigDecimal(qty).add(receiptDetail.getOpenQty()));
  132 + receiptDetail.setOpenQty(qty.add(receiptDetail.getOpenQty()));
133 133 //更新入库单详情的收货数量
134 134 if (!receiptDetailService.updateById(receiptDetail)){
135 135 throw new ServiceException("更新入库单详情失败");
... ... @@ -246,7 +246,7 @@ public class ReceiptContainerHeaderServiceImpl extends ServiceImpl&lt;ReceiptContai
246 246 AjaxResult ajaxResult = null;
247 247 for (ReceiptContainerView receiptContainerView : list) {
248 248 ajaxResult = saveCountain(receiptContainerView.getReceiptCode(), receiptContainerView.getReceiptContainerCode(),
249   - receiptContainerView.getReceiptDetailId(), receiptContainerView.getLocationCode(), receiptContainerView.getQty().intValue(), null);
  249 + receiptContainerView.getReceiptDetailId(), receiptContainerView.getLocationCode(), receiptContainerView.getQty(), null);
250 250 }
251 251 return ajaxResult;
252 252 }
... ... @@ -298,9 +298,9 @@ public class ReceiptContainerHeaderServiceImpl extends ServiceImpl&lt;ReceiptContai
298 298 if (taskHeaderService.count(lambdaQueryWrapper) > 0){
299 299 throw new ServiceException("容器已经存在任务,请更换容器");
300 300 }
301   - if ("empty".equals(container.getStatus())){
  301 + if ("empty".equals(container.getStatus()) && StringUtils.isEmpty(container.getLocationCode())){
302 302 return QuantityConstant.TASK_TYPE_WHOLERECEIPT;
303   - }else if ("some".equals(container.getStatus())) {
  303 + }else if ("some".equals(container.getStatus()) || StringUtils.isNotEmpty(container.getLocationCode())) {
304 304 return QuantityConstant.TASK_TYPE_SUPPLEMENTRECEIPT;
305 305 } else if ("full".equals(container.getStatus())) {
306 306 throw new ServiceException("该容器已满,请更换容器");
... ... @@ -389,7 +389,7 @@ public class ReceiptContainerHeaderServiceImpl extends ServiceImpl&lt;ReceiptContai
389 389 * @param containerCode 容器编码
390 390 */
391 391 @Transactional
392   - public void receiptContainerDetailAdd(Integer receiptContainerHeaderId, ReceiptDetail receiptDetail, Integer qty, String containerCode, String locationCode){
  392 + public void receiptContainerDetailAdd(Integer receiptContainerHeaderId, ReceiptDetail receiptDetail, BigDecimal qty, String containerCode, String locationCode){
393 393 LambdaQueryWrapper<ReceiptContainerDetail> lambda = Wrappers.lambdaQuery();
394 394 lambda.eq(ReceiptContainerDetail::getReceiptContainerId, receiptContainerHeaderId)
395 395 .eq(ReceiptContainerDetail::getReceiptId, receiptDetail.getReceiptId())
... ... @@ -424,7 +424,7 @@ public class ReceiptContainerHeaderServiceImpl extends ServiceImpl&lt;ReceiptContai
424 424 receiptContainerDetail.setMaterialName(receiptDetail.getMaterialName());
425 425 receiptContainerDetail.setMaterialSpec(receiptDetail.getMaterialSpec());
426 426 receiptContainerDetail.setMaterialUnit(receiptDetail.getMaterialUnit());
427   - receiptContainerDetail.setQty(new BigDecimal(qty));
  427 + receiptContainerDetail.setQty(qty);
428 428 receiptContainerDetail.setSupplierCode(receiptDetail.getSupplierCode());
429 429 receiptContainerDetail.setBatch(receiptDetail.getBatch());
430 430 receiptContainerDetail.setLot(receiptDetail.getLot());
... ... @@ -439,7 +439,7 @@ public class ReceiptContainerHeaderServiceImpl extends ServiceImpl&lt;ReceiptContai
439 439 throw new ServiceException("保存入库组盘详情失败");
440 440 }
441 441 } else {
442   - receiptContainerDetail.setQty(receiptContainerDetail.getQty().add(BigDecimal.valueOf(qty)));
  442 + receiptContainerDetail.setQty(receiptContainerDetail.getQty().add(qty));
443 443 if (!receiptContainerDetailService.updateById(receiptContainerDetail)){
444 444 throw new ServiceException("更新入库组盘详情失败");
445 445 }
... ...
src/main/java/com/huaheng/pc/receipt/receiving/controller/ReceivingController.java
... ... @@ -17,6 +17,7 @@ import org.springframework.web.bind.annotation.RequestMapping;
17 17 import org.springframework.web.bind.annotation.ResponseBody;
18 18  
19 19 import javax.annotation.Resource;
  20 +import java.math.BigDecimal;
20 21  
21 22 /**
22 23 * @author mahua
... ... @@ -87,7 +88,7 @@ public class ReceivingController extends BaseController {
87 88 @ApiParam(name="containerCode",value="容器编码")String containerCode,
88 89 @ApiParam(name="receiptDetailId",value="入库单详情id")Integer receiptDetailId,
89 90 @ApiParam(name="locationCode",value="库位编码", required = false)String locationCode,
90   - @ApiParam(name="qty",value="收货数量")Integer qty,
  91 + @ApiParam(name="qty",value="收货数量") BigDecimal qty,
91 92 @ApiParam(name="localtionRule",value="定位规则", required = false)String locatingRule){
92 93 // LambdaQueryWrapper<TaskHeader> lambdaQueryWrapper = Wrappers.lambdaQuery();
93 94 // lambdaQueryWrapper.eq(TaskHeader::getTaskType, 900)
... ...
src/main/resources/application-druid.properties
... ... @@ -2,16 +2,16 @@
2 2 spring.datasource.type=com.alibaba.druid.pool.DruidDataSource
3 3 spring.datasource.driverClassName=com.mysql.cj.jdbc.Driver
4 4 # Ö÷¿â
5   -spring.datasource.druid.master.url=jdbc:mysql://172.16.29.45:3306/wms_v2?useUnicode=true&characterEncoding=utf8&zeroDateTimeBehavior=convertToNull&useSSL=false&serverTimezone=GMT%2b8
  5 +#spring.datasource.druid.master.url=jdbc:mysql://172.16.29.45:3306/wms_v2?useUnicode=true&characterEncoding=utf8&zeroDateTimeBehavior=convertToNull&useSSL=false&serverTimezone=GMT%2b8
6 6 #spring.datasource.druid.master.url=jdbc:mysql://172.16.29.45:3306/huahengExample?useUnicode=true&characterEncoding=utf8&zeroDateTimeBehavior=convertToNull&useSSL=false
7   -#spring.datasource.druid.master.url=jdbc:mysql://localhost:3306/wms2.0?characterEncoding=utf8&serverTimezone=GMT%2b8
  7 +spring.datasource.druid.master.url=jdbc:mysql://localhost:3306/wms2.0?characterEncoding=utf8&serverTimezone=GMT%2b8
8 8  
9   -spring.datasource.druid.master.username=softhuaheng
10   -spring.datasource.druid.master.password=HHrobot123.
11   -#spring.datasource.druid.master.username=root
12   -#spring.datasource.druid.master.password=123456
  9 +#spring.datasource.druid.master.username=softhuaheng
  10 +#spring.datasource.druid.master.password=HHrobot123.
  11 +spring.datasource.druid.master.username=root
  12 +spring.datasource.druid.master.password=123456
13 13 # ´Ó¿â
14   -spring.datasource.druid.slave.open = true
  14 +spring.datasource.druid.slave.open = false
15 15 spring.datasource.druid.slave.url=jdbc:mysql://199.19.109.117:3306/wms_v2?useUnicode=true&characterEncoding=utf8&zeroDateTimeBehavior=convertToNull&useSSL=false
16 16 #spring.datasource.druid.master.username=softhuaheng
17 17 #spring.datasource.druid.master.password=HHrobot123.
... ...
src/main/resources/application.yml
1 1 spring:
2 2 profiles:
3   - active: dev
  3 + active: druid
4 4 ---
5 5 #项目相关配置
6 6 #名称
... ...
src/main/resources/static/ajax/libs/bootstrap-table/bootstrap-table.min.css
1   -.fixed-table-container .bs-checkbox, .fixed-table-container .no-records-found {
2   - text-align: center;
3   -}
4   -
5   -.fixed-table-body thead th .th-inner, .table td, .table th {
6   - box-sizing: border-box
7   -}
8   -
9   -.bootstrap-table .table {
10   - margin-bottom: 0 !important;
11   - border-bottom: 1px solid #ddd;
12   - border-collapse: collapse !important;
13   - border-radius: 1px
14   -}
15   -
16   -.bootstrap-table .table:not(.table-condensed), .bootstrap-table .table:not(.table-condensed) > tbody > tr > td, .bootstrap-table .table:not(.table-condensed) > tbody > tr > th, .bootstrap-table .table:not(.table-condensed) > tfoot > tr > td, .bootstrap-table .table:not(.table-condensed) > tfoot > tr > th, .bootstrap-table .table:not(.table-condensed) > thead > tr > td {
17   - padding: 8px
18   -}
19   -
20   -.bootstrap-table .table.table-no-bordered > tbody > tr > td, .bootstrap-table .table.table-no-bordered > thead > tr > th {
21   - border-right: 2px solid transparent
22   -}
23   -
24   -.bootstrap-table .table.table-no-bordered > tbody > tr > td:last-child {
25   - border-right: none
26   -}
27   -
28   -.fixed-table-container {
29   - position: relative;
30   - clear: both;
31   - border: 1px solid #ddd;
32   - border-radius: 4px;
33   - white-space: nowrap;
34   - -webkit-border-radius: 4px;
35   - -moz-border-radius: 4px
36   -}
37   -
38   -.fixed-table-container.table-no-bordered {
39   - border: 1px solid transparent
40   -}
41   -
42   -.fixed-table-footer, .fixed-table-header {
43   - overflow: hidden
44   -}
45   -
46   -.fixed-table-footer {
47   - border-top: 1px solid #ddd
48   -}
49   -
50   -.fixed-table-body {
51   - overflow-x: auto;
52   - overflow-y: auto;
53   - height: 100%
54   -}
55   -
56   -.fixed-table-container table {
57   - width: 100%
58   -}
59   -
60   -.fixed-table-container thead th {
61   - height: 0;
62   - padding: 0;
63   - margin: 0;
64   - border-left: 1px solid #ddd
65   -}
66   -
67   -.fixed-table-container thead th:focus {
68   - outline: transparent solid 0
69   -}
70   -
71   -.fixed-table-container thead th:first-child {
72   - border-left: none;
73   - border-top-left-radius: 4px;
74   - -webkit-border-top-left-radius: 4px;
75   - -moz-border-radius-topleft: 4px
76   -}
77   -
78   -.fixed-table-container tbody td .th-inner, .fixed-table-container thead th .th-inner {
79   - padding: 8px;
80   - line-height: 24px;
81   - vertical-align: top;
82   - overflow: hidden;
83   - text-overflow: ellipsis;
84   - white-space: nowrap
85   -}
86   -
87   -.fixed-table-container thead th .sortable {
88   - cursor: pointer;
89   - background-position: right;
90   - background-repeat: no-repeat;
91   - padding-right: 30px
92   -}
93   -
94   -.fixed-table-container thead th .both {
95   - background-image: url('data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABMAAAATCAQAAADYWf5HAAAAkElEQVQoz7X QMQ5AQBCF4dWQSJxC5wwax1Cq1e7BAdxD5SL+Tq/QCM1oNiJidwox0355mXnG/DrEtIQ6azioNZQxI0ykPhTQIwhCR+BmBYtlK7kLJYwWCcJA9M4qdrZrd8pPjZWPtOqdRQy320YSV17OatFC4euts6z39GYMKRPCTKY9UnPQ6P+GtMRfGtPnBCiqhAeJPmkqAAAAAElFTkSuQmCC')
96   -}
97   -
98   -.fixed-table-container thead th .asc {
99   - background-image: url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABMAAAATCAYAAAByUDbMAAAAZ0lEQVQ4y2NgGLKgquEuFxBPAGI2ahhWCsS/gDibUoO0gPgxEP8H4ttArEyuQYxAPBdqEAxPBImTY5gjEL9DM+wTENuQahAvEO9DMwiGdwAxOymGJQLxTyD+jgWDxCMZRsEoGAVoAADeemwtPcZI2wAAAABJRU5ErkJggg==)
100   -}
101   -
102   -.fixed-table-container thead th .desc {
103   - background-image: url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABMAAAATCAYAAAByUDbMAAAAZUlEQVQ4y2NgGAWjYBSggaqGu5FA/BOIv2PBIPFEUgxjB+IdQPwfC94HxLykus4GiD+hGfQOiB3J8SojEE9EM2wuSJzcsFMG4ttQgx4DsRalkZENxL+AuJQaMcsGxBOAmGvopk8AVz1sLZgg0bsAAAAASUVORK5CYII=)
104   -}
105   -
106   -.fixed-table-container th.detail {
107   - width: 30px
108   -}
109   -
110   -.fixed-table-container tbody td {
111   - border-left: 1px solid #ddd
112   -}
113   -
114   -.fixed-table-container tbody tr:first-child td {
115   - border-top: none
116   -}
117   -
118   -.fixed-table-container tbody td:first-child {
119   - border-left: none
120   -}
121   -
122   -.fixed-table-container tbody .selected td {
123   - background-color: #f5f5f5
124   -}
125   -
126   -.fixed-table-container .bs-checkbox .th-inner {
127   - padding: 8px 0
128   -}
129   -
130   -.fixed-table-container input[type=radio], .fixed-table-container input[type=checkbox] {
131   - margin: 0 auto !important
132   -}
133   -
134   -.fixed-table-pagination .pagination-detail, .fixed-table-pagination div.pagination {
135   - margin-top: 10px;
136   - margin-bottom: 10px
137   -}
138   -
139   -.fixed-table-pagination div.pagination .pagination {
140   - margin: 0
141   -}
142   -
143   -.fixed-table-pagination .pagination a {
144   - padding: 6px 12px;
145   - line-height: 1.428571429
146   -}
147   -
148   -.fixed-table-pagination .pagination-info {
149   - line-height: 34px;
150   - margin-right: 5px
151   -}
152   -
153   -.fixed-table-pagination .btn-group {
154   - position: relative;
155   - display: inline-block;
156   - vertical-align: middle
157   -}
158   -
159   -.fixed-table-pagination .dropup .dropdown-menu {
160   - margin-bottom: 0
161   -}
162   -
163   -.fixed-table-pagination .page-list {
164   - display: inline-block
165   -}
166   -
167   -.fixed-table-toolbar .columns-left {
168   - margin-right: 5px
169   -}
170   -
171   -.fixed-table-toolbar .columns-right {
172   - margin-left: 5px
173   -}
174   -
175   -.fixed-table-toolbar .columns label {
176   - display: block;
177   - padding: 3px 20px;
178   - clear: both;
179   - font-weight: 400;
180   - line-height: 1.428571429
181   -}
182   -
183   -.fixed-table-toolbar .bs-bars, .fixed-table-toolbar .columns, .fixed-table-toolbar .search {
184   - position: relative;
185   - margin-top: 10px;
186   - margin-bottom: 10px;
187   - line-height: 34px
188   -}
189   -
190   -.fixed-table-pagination li.disabled a {
191   - pointer-events: none;
192   - cursor: default
193   -}
194   -
195   -.fixed-table-loading {
196   - display: none;
197   - position: absolute;
198   - top: 42px;
199   - right: 0;
200   - bottom: 0;
201   - left: 0;
202   - z-index: 99;
203   - background-color: #fff;
204   - text-align: center
205   -}
206   -
207   -.fixed-table-body .card-view .title {
208   - font-weight: 700;
209   - display: inline-block;
210   - min-width: 30%;
211   - text-align: left !important
212   -}
213   -
214   -.table td, .table th {
215   - vertical-align: middle
216   -}
217   -
218   -.fixed-table-toolbar .dropdown-menu {
219   - text-align: left;
220   - max-height: 300px;
221   - overflow: auto
222   -}
223   -
224   -.fixed-table-toolbar .btn-group > .btn-group {
225   - display: inline-block;
226   - margin-left: -1px !important
227   -}
228   -
229   -.fixed-table-toolbar .btn-group > .btn-group > .btn {
230   - border-radius: 0
231   -}
232   -
233   -.fixed-table-toolbar .btn-group > .btn-group:first-child > .btn {
234   - border-top-left-radius: 4px;
235   - border-bottom-left-radius: 4px
236   -}
237   -
238   -.fixed-table-toolbar .btn-group > .btn-group:last-child > .btn {
239   - border-top-right-radius: 4px;
240   - border-bottom-right-radius: 4px
241   -}
242   -
243   -.bootstrap-table .table > thead > tr > th {
244   - vertical-align: bottom;
245   - border-bottom: 1px solid #ddd
246   -}
247   -
248   -.bootstrap-table .table thead > tr > th {
249   - padding: 0;
250   - margin: 0
251   -}
252   -
253   -.bootstrap-table .fixed-table-footer tbody > tr > td {
254   - padding: 0 !important
255   -}
256   -
257   -.bootstrap-table .fixed-table-footer .table {
258   - border-bottom: none;
259   - border-radius: 0;
260   - padding: 0 !important
261   -}
262   -
263   -.pull-right .dropdown-menu {
264   - right: 0;
265   - left: auto
266   -}
267   -
268   -p.fixed-table-scroll-inner {
269   - width: 100%;
270   - height: 200px
271   -}
272   -
273   -div.fixed-table-scroll-outer {
274   - top: 0;
275   - left: 0;
276   - visibility: hidden;
277   - width: 200px;
278   - height: 150px;
279   - overflow: hidden
280   -}
281 1 \ No newline at end of file
  2 +.fixed-table-container .bs-checkbox,.fixed-table-container .no-records-found{text-align:center}.fixed-table-body thead th .th-inner,.table td,.table th{box-sizing:border-box}.bootstrap-table .table{margin-bottom:0!important;border-bottom:1px solid #ddd;border-collapse:collapse!important;border-radius:1px}.bootstrap-table .table:not(.table-condensed),.bootstrap-table .table:not(.table-condensed)>tbody>tr>td,.bootstrap-table .table:not(.table-condensed)>tbody>tr>th,.bootstrap-table .table:not(.table-condensed)>tfoot>tr>td,.bootstrap-table .table:not(.table-condensed)>tfoot>tr>th,.bootstrap-table .table:not(.table-condensed)>thead>tr>td{padding:8px}.bootstrap-table .table.table-no-bordered>tbody>tr>td,.bootstrap-table .table.table-no-bordered>thead>tr>th{border-right:2px solid transparent}.bootstrap-table .table.table-no-bordered>tbody>tr>td:last-child{border-right:none}.fixed-table-container{position:relative;clear:both;border:1px solid #ddd;border-radius:4px;-webkit-border-radius:4px;-moz-border-radius:4px}.fixed-table-container.table-no-bordered{border:1px solid transparent}.fixed-table-footer,.fixed-table-header{overflow:hidden}.fixed-table-footer{border-top:1px solid #ddd}.fixed-table-body{overflow-x:auto;overflow-y:auto;height:100%}.fixed-table-container table{width:100%}.fixed-table-container thead th{height:0;padding:0;margin:0;border-left:1px solid #ddd}.fixed-table-container thead th:focus{outline:transparent solid 0}.fixed-table-container thead th:first-child{border-left:none;border-top-left-radius:4px;-webkit-border-top-left-radius:4px;-moz-border-radius-topleft:4px}.fixed-table-container tbody td .th-inner,.fixed-table-container thead th .th-inner{padding:8px;line-height:24px;vertical-align:top;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.fixed-table-container thead th .sortable{cursor:pointer;background-position:right;background-repeat:no-repeat;padding-right:30px}.fixed-table-container thead th .both{background-image:url('data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABMAAAATCAQAAADYWf5HAAAAkElEQVQoz7X QMQ5AQBCF4dWQSJxC5wwax1Cq1e7BAdxD5SL+Tq/QCM1oNiJidwox0355mXnG/DrEtIQ6azioNZQxI0ykPhTQIwhCR+BmBYtlK7kLJYwWCcJA9M4qdrZrd8pPjZWPtOqdRQy320YSV17OatFC4euts6z39GYMKRPCTKY9UnPQ6P+GtMRfGtPnBCiqhAeJPmkqAAAAAElFTkSuQmCC')}.fixed-table-container thead th .asc{background-image:url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABMAAAATCAYAAAByUDbMAAAAZ0lEQVQ4y2NgGLKgquEuFxBPAGI2ahhWCsS/gDibUoO0gPgxEP8H4ttArEyuQYxAPBdqEAxPBImTY5gjEL9DM+wTENuQahAvEO9DMwiGdwAxOymGJQLxTyD+jgWDxCMZRsEoGAVoAADeemwtPcZI2wAAAABJRU5ErkJggg==)}.fixed-table-container thead th .desc{background-image:url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABMAAAATCAYAAAByUDbMAAAAZUlEQVQ4y2NgGAWjYBSggaqGu5FA/BOIv2PBIPFEUgxjB+IdQPwfC94HxLykus4GiD+hGfQOiB3J8SojEE9EM2wuSJzcsFMG4ttQgx4DsRalkZENxL+AuJQaMcsGxBOAmGvopk8AVz1sLZgg0bsAAAAASUVORK5CYII=)}.fixed-table-container th.detail{width:30px}.fixed-table-container tbody td{border-left:1px solid #ddd}.fixed-table-container tbody tr:first-child td{border-top:none}.fixed-table-container tbody td:first-child{border-left:none}.fixed-table-container tbody .selected td{background-color:#f5f5f5}.fixed-table-container .bs-checkbox .th-inner{padding:8px 0}.fixed-table-container input[type=radio],.fixed-table-container input[type=checkbox]{margin:0 auto!important}.fixed-table-pagination .pagination-detail,.fixed-table-pagination div.pagination{margin-top:10px;margin-bottom:10px}.fixed-table-pagination div.pagination .pagination{margin:0}.fixed-table-pagination .pagination a{padding:6px 12px;line-height:1.428571429}.fixed-table-pagination .pagination-info{line-height:34px;margin-right:5px}.fixed-table-pagination .btn-group{position:relative;display:inline-block;vertical-align:middle}.fixed-table-pagination .dropup .dropdown-menu{margin-bottom:0}.fixed-table-pagination .page-list{display:inline-block}.fixed-table-toolbar .columns-left{margin-right:5px}.fixed-table-toolbar .columns-right{margin-left:5px}.fixed-table-toolbar .columns label{display:block;padding:3px 20px;clear:both;font-weight:400;line-height:1.428571429}.fixed-table-toolbar .bs-bars,.fixed-table-toolbar .columns,.fixed-table-toolbar .search{position:relative;margin-top:10px;margin-bottom:10px;line-height:34px}.fixed-table-pagination li.disabled a{pointer-events:none;cursor:default}.fixed-table-loading{display:none;position:absolute;top:42px;right:0;bottom:0;left:0;z-index:99;background-color:#fff;text-align:center}.fixed-table-body .card-view .title{font-weight:700;display:inline-block;min-width:30%;text-align:left!important}.table td,.table th{vertical-align:middle}.fixed-table-toolbar .dropdown-menu{text-align:left;max-height:300px;overflow:auto}.fixed-table-toolbar .btn-group>.btn-group{display:inline-block;margin-left:-1px!important}.fixed-table-toolbar .btn-group>.btn-group>.btn{border-radius:0}.fixed-table-toolbar .btn-group>.btn-group:first-child>.btn{border-top-left-radius:4px;border-bottom-left-radius:4px}.fixed-table-toolbar .btn-group>.btn-group:last-child>.btn{border-top-right-radius:4px;border-bottom-right-radius:4px}.bootstrap-table .table>thead>tr>th{vertical-align:bottom;border-bottom:1px solid #ddd}.bootstrap-table .table thead>tr>th{padding:0;margin:0}.bootstrap-table .fixed-table-footer tbody>tr>td{padding:0!important}.bootstrap-table .fixed-table-footer .table{border-bottom:none;border-radius:0;padding:0!important}.pull-right .dropdown-menu{right:0;left:auto}p.fixed-table-scroll-inner{width:100%;height:200px}div.fixed-table-scroll-outer{top:0;left:0;visibility:hidden;width:200px;height:150px;overflow:hidden}
282 3 \ No newline at end of file
... ...
src/main/resources/static/ajax/libs/bootstrap-table/bootstrap-table.min.js
1   -/*
2   -* bootstrap-table - v1.11.0 - 2016-07-02
3   -* https://github.com/wenzhixin/bootstrap-table
4   -* Copyright (c) 2016 zhixin wen
5   -* Licensed MIT License
6   -*/
7   -!function (a) {
8   - "use strict";
9   - var b = null, c = function (a) {
10   - var b = arguments, c = !0, d = 1;
11   - return a = a.replace(/%s/g, function () {
12   - var a = b[d++];
13   - return "undefined" == typeof a ? (c = !1, "") : a
14   - }), c ? a : ""
15   - }, d = function (b, c, d, e) {
16   - var f = "";
17   - return a.each(b, function (a, b) {
18   - return b[c] === e ? (f = b[d], !1) : !0
19   - }), f
20   - }, e = function (b, c) {
21   - var d = -1;
22   - return a.each(b, function (a, b) {
23   - return b.field === c ? (d = a, !1) : !0
24   - }), d
25   - }, f = function (b) {
26   - var c, d, e, f = 0, g = [];
27   - for (c = 0; c < b[0].length; c++) f += b[0][c].colspan || 1;
28   - for (c = 0; c < b.length; c++) for (g[c] = [], d = 0; f > d; d++) g[c][d] = !1;
29   - for (c = 0; c < b.length; c++) for (d = 0; d < b[c].length; d++) {
30   - var h = b[c][d], i = h.rowspan || 1, j = h.colspan || 1, k = a.inArray(!1, g[c]);
31   - for (1 === j && (h.fieldIndex = k, "undefined" == typeof h.field && (h.field = k)), e = 0; i > e; e++) g[c + e][k] = !0;
32   - for (e = 0; j > e; e++) g[c][k + e] = !0
33   - }
34   - }, g = function () {
35   - if (null === b) {
36   - var c, d, e = a("<p/>").addClass("fixed-table-scroll-inner"),
37   - f = a("<div/>").addClass("fixed-table-scroll-outer");
38   - f.append(e), a("body").append(f), c = e[0].offsetWidth, f.css("overflow", "scroll"), d = e[0].offsetWidth, c === d && (d = f[0].clientWidth), f.remove(), b = c - d
39   - }
40   - return b
41   - }, h = function (b, d, e, f) {
42   - var g = d;
43   - if ("string" == typeof d) {
44   - var h = d.split(".");
45   - h.length > 1 ? (g = window, a.each(h, function (a, b) {
46   - g = g[b]
47   - })) : g = window[d]
48   - }
49   - return "object" == typeof g ? g : "function" == typeof g ? g.apply(b, e) : !g && "string" == typeof d && c.apply(this, [d].concat(e)) ? c.apply(this, [d].concat(e)) : f
50   - }, i = function (b, c, d) {
51   - var e = Object.getOwnPropertyNames(b), f = Object.getOwnPropertyNames(c), g = "";
52   - if (d && e.length !== f.length) return !1;
53   - for (var h = 0; h < e.length; h++) if (g = e[h], a.inArray(g, f) > -1 && b[g] !== c[g]) return !1;
54   - return !0
55   - }, j = function (a) {
56   - return "string" == typeof a ? a.replace(/&/g, "&amp;").replace(/</g, "&lt;").replace(/>/g, "&gt;").replace(/"/g, "&quot;").replace(/'/g, "&#039;").replace(/`/g, "&#x60;") : a
57   - }, k = function (b) {
58   - var c = 0;
59   - return b.children().each(function () {
60   - c < a(this).outerHeight(!0) && (c = a(this).outerHeight(!0))
61   - }), c
62   - }, l = function (a) {
63   - for (var b in a) {
64   - var c = b.split(/(?=[A-Z])/).join("-").toLowerCase();
65   - c !== b && (a[c] = a[b], delete a[b])
66   - }
67   - return a
68   - }, m = function (a, b, c) {
69   - var d = a;
70   - if ("string" != typeof b || a.hasOwnProperty(b)) return c ? j(a[b]) : a[b];
71   - var e = b.split(".");
72   - for (var f in e) d = d && d[e[f]];
73   - return c ? j(d) : d
74   - }, n = function () {
75   - return !!(navigator.userAgent.indexOf("MSIE ") > 0 || navigator.userAgent.match(/Trident.*rv\:11\./))
76   - }, o = function () {
77   - Object.keys || (Object.keys = function () {
78   - var a = Object.prototype.hasOwnProperty, b = !{toString: null}.propertyIsEnumerable("toString"),
79   - c = ["toString", "toLocaleString", "valueOf", "hasOwnProperty", "isPrototypeOf", "propertyIsEnumerable", "constructor"],
80   - d = c.length;
81   - return function (e) {
82   - if ("object" != typeof e && ("function" != typeof e || null === e)) throw new TypeError("Object.keys called on non-object");
83   - var f, g, h = [];
84   - for (f in e) a.call(e, f) && h.push(f);
85   - if (b) for (g = 0; d > g; g++) a.call(e, c[g]) && h.push(c[g]);
86   - return h
87   - }
88   - }())
89   - }, p = function (b, c) {
90   - this.options = c, this.$el = a(b), this.$el_ = this.$el.clone(), this.timeoutId_ = 0, this.timeoutFooter_ = 0, this.init()
91   - };
92   - p.DEFAULTS = {
93   - classes: "table table-hover",
94   - locale: void 0,
95   - height: void 0,
96   - undefinedText: "-",
97   - sortName: void 0,
98   - sortOrder: "asc",
99   - sortStable: !1,
100   - striped: !1,
101   - columns: [[]],
102   - data: [],
103   - dataField: "rows",
104   - method: "get",
105   - url: void 0,
106   - ajax: void 0,
107   - cache: !0,
108   - contentType: "application/json",
109   - dataType: "json",
110   - ajaxOptions: {},
111   - queryParams: function (a) {
112   - return a
113   - },
114   - queryParamsType: "limit",
115   - responseHandler: function (a) {
116   - return a
117   - },
118   - pagination: !1,
119   - onlyInfoPagination: !1,
120   - sidePagination: "client",
121   - totalRows: 0,
122   - pageNumber: 1,
123   - pageSize: 10,
124   - pageList: [10, 25, 50, 100],
125   - paginationHAlign: "right",
126   - paginationVAlign: "bottom",
127   - paginationDetailHAlign: "left",
128   - paginationPreText: "&lsaquo;",
129   - paginationNextText: "&rsaquo;",
130   - search: !1,
131   - searchOnEnterKey: !1,
132   - strictSearch: !1,
133   - searchAlign: "right",
134   - selectItemName: "btSelectItem",
135   - showHeader: !0,
136   - showFooter: !1,
137   - showColumns: !1,
138   - showPaginationSwitch: !1,
139   - showRefresh: !1,
140   - showToggle: !1,
141   - buttonsAlign: "right",
142   - smartDisplay: !0,
143   - escape: !1,
144   - minimumCountColumns: 1,
145   - idField: void 0,
146   - uniqueId: void 0,
147   - cardView: !1,
148   - detailView: !1,
149   - detailFormatter: function () {
150   - return ""
151   - },
152   - trimOnSearch: !0,
153   - clickToSelect: !1,
154   - singleSelect: !1,
155   - toolbar: void 0,
156   - toolbarAlign: "left",
157   - checkboxHeader: !0,
158   - sortable: !0,
159   - silentSort: !0,
160   - maintainSelected: !1,
161   - searchTimeOut: 500,
162   - searchText: "",
163   - iconSize: void 0,
164   - buttonsClass: "default",
165   - iconsPrefix: "glyphicon",
166   - icons: {
167   - paginationSwitchDown: "glyphicon-collapse-down icon-chevron-down",
168   - paginationSwitchUp: "glyphicon-collapse-up icon-chevron-up",
169   - refresh: "glyphicon-refresh icon-refresh",
170   - toggle: "glyphicon-list-alt icon-list-alt",
171   - columns: "glyphicon-th icon-th",
172   - detailOpen: "glyphicon-plus icon-plus",
173   - detailClose: "glyphicon-minus icon-minus"
174   - },
175   - customSearch: a.noop,
176   - customSort: a.noop,
177   - rowStyle: function () {
178   - return {}
179   - },
180   - rowAttributes: function () {
181   - return {}
182   - },
183   - footerStyle: function () {
184   - return {}
185   - },
186   - onAll: function () {
187   - return !1
188   - },
189   - onClickCell: function () {
190   - return !1
191   - },
192   - onDblClickCell: function () {
193   - return !1
194   - },
195   - onClickRow: function () {
196   - return !1
197   - },
198   - onDblClickRow: function () {
199   - return !1
200   - },
201   - onSort: function () {
202   - return !1
203   - },
204   - onCheck: function () {
205   - return !1
206   - },
207   - onUncheck: function () {
208   - return !1
209   - },
210   - onCheckAll: function () {
211   - return !1
212   - },
213   - onUncheckAll: function () {
214   - return !1
215   - },
216   - onCheckSome: function () {
217   - return !1
218   - },
219   - onUncheckSome: function () {
220   - return !1
221   - },
222   - onLoadSuccess: function () {
223   - return !1
224   - },
225   - onLoadError: function () {
226   - return !1
227   - },
228   - onColumnSwitch: function () {
229   - return !1
230   - },
231   - onPageChange: function () {
232   - return !1
233   - },
234   - onSearch: function () {
235   - return !1
236   - },
237   - onToggle: function () {
238   - return !1
239   - },
240   - onPreBody: function () {
241   - return !1
242   - },
243   - onPostBody: function () {
244   - return !1
245   - },
246   - onPostHeader: function () {
247   - return !1
248   - },
249   - onExpandRow: function () {
250   - return !1
251   - },
252   - onCollapseRow: function () {
253   - return !1
254   - },
255   - onRefreshOptions: function () {
256   - return !1
257   - },
258   - onRefresh: function () {
259   - return !1
260   - },
261   - onResetView: function () {
262   - return !1
263   - }
264   - }, p.LOCALES = {}, p.LOCALES["en-US"] = p.LOCALES.en = {
265   - formatLoadingMessage: function () {
266   - return "Loading, please wait..."
267   - }, formatRecordsPerPage: function (a) {
268   - return c("%s rows per page", a)
269   - }, formatShowingRows: function (a, b, d) {
270   - return c("Showing %s to %s of %s rows", a, b, d)
271   - }, formatDetailPagination: function (a) {
272   - return c("Showing %s rows", a)
273   - }, formatSearch: function () {
274   - return "Search"
275   - }, formatNoMatches: function () {
276   - return "No matching records found"
277   - }, formatPaginationSwitch: function () {
278   - return "Hide/Show pagination"
279   - }, formatRefresh: function () {
280   - return "Refresh"
281   - }, formatToggle: function () {
282   - return "Toggle"
283   - }, formatColumns: function () {
284   - return "Columns"
285   - }, formatAllRows: function () {
286   - return "All"
287   - }
288   - }, a.extend(p.DEFAULTS, p.LOCALES["en-US"]), p.COLUMN_DEFAULTS = {
289   - radio: !1,
290   - checkbox: !1,
291   - checkboxEnabled: !0,
292   - field: void 0,
293   - title: void 0,
294   - titleTooltip: void 0,
295   - "class": void 0,
296   - align: void 0,
297   - halign: void 0,
298   - falign: void 0,
299   - valign: void 0,
300   - width: void 0,
301   - sortable: !1,
302   - order: "asc",
303   - visible: !0,
304   - switchable: !0,
305   - clickToSelect: !0,
306   - formatter: void 0,
307   - footerFormatter: void 0,
308   - events: void 0,
309   - sorter: void 0,
310   - sortName: void 0,
311   - cellStyle: void 0,
312   - searchable: !0,
313   - searchFormatter: !0,
314   - cardVisible: !0
315   - }, p.EVENTS = {
316   - "all.bs.table": "onAll",
317   - "click-cell.bs.table": "onClickCell",
318   - "dbl-click-cell.bs.table": "onDblClickCell",
319   - "click-row.bs.table": "onClickRow",
320   - "dbl-click-row.bs.table": "onDblClickRow",
321   - "sort.bs.table": "onSort",
322   - "check.bs.table": "onCheck",
323   - "uncheck.bs.table": "onUncheck",
324   - "check-all.bs.table": "onCheckAll",
325   - "uncheck-all.bs.table": "onUncheckAll",
326   - "check-some.bs.table": "onCheckSome",
327   - "uncheck-some.bs.table": "onUncheckSome",
328   - "load-success.bs.table": "onLoadSuccess",
329   - "load-error.bs.table": "onLoadError",
330   - "column-switch.bs.table": "onColumnSwitch",
331   - "page-change.bs.table": "onPageChange",
332   - "search.bs.table": "onSearch",
333   - "toggle.bs.table": "onToggle",
334   - "pre-body.bs.table": "onPreBody",
335   - "post-body.bs.table": "onPostBody",
336   - "post-header.bs.table": "onPostHeader",
337   - "expand-row.bs.table": "onExpandRow",
338   - "collapse-row.bs.table": "onCollapseRow",
339   - "refresh-options.bs.table": "onRefreshOptions",
340   - "reset-view.bs.table": "onResetView",
341   - "refresh.bs.table": "onRefresh"
342   - }, p.prototype.init = function () {
343   - this.initLocale(), this.initContainer(), this.initTable(), this.initHeader(), this.initData(), this.initFooter(), this.initToolbar(), this.initPagination(), this.initBody(), this.initSearchText(), this.initServer()
344   - }, p.prototype.initLocale = function () {
345   - if (this.options.locale) {
346   - var b = this.options.locale.split(/-|_/);
347   - b[0].toLowerCase(), b[1] && b[1].toUpperCase(), a.fn.bootstrapTable.locales[this.options.locale] ? a.extend(this.options, a.fn.bootstrapTable.locales[this.options.locale]) : a.fn.bootstrapTable.locales[b.join("-")] ? a.extend(this.options, a.fn.bootstrapTable.locales[b.join("-")]) : a.fn.bootstrapTable.locales[b[0]] && a.extend(this.options, a.fn.bootstrapTable.locales[b[0]])
348   - }
349   - }, p.prototype.initContainer = function () {
350   - this.$container = a(['<div class="bootstrap-table">', '<div class="fixed-table-toolbar"></div>', "top" === this.options.paginationVAlign || "both" === this.options.paginationVAlign ? '<div class="fixed-table-pagination" style="clear: both;"></div>' : "", '<div class="fixed-table-container">', '<div class="fixed-table-header"><table></table></div>', '<div class="fixed-table-body">', '<div class="fixed-table-loading">', this.options.formatLoadingMessage(), "</div>", "</div>", '<div class="fixed-table-footer"><table><tr></tr></table></div>', "bottom" === this.options.paginationVAlign || "both" === this.options.paginationVAlign ? '<div class="fixed-table-pagination"></div>' : "", "</div>", "</div>"].join("")), 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.$container.find(".fixed-table-footer"), this.$toolbar = this.$container.find(".fixed-table-toolbar"), this.$pagination = this.$container.find(".fixed-table-pagination"), this.$tableBody.append(this.$el), this.$container.after('<div class="clearfix"></div>'), this.$el.addClass(this.options.classes), this.options.striped && this.$el.addClass("table-striped"), -1 !== a.inArray("table-no-bordered", this.options.classes.split(" ")) && this.$tableContainer.addClass("table-no-bordered")
351   - }, p.prototype.initTable = function () {
352   - var b = this, c = [], d = [];
353   - if (this.$header = this.$el.find(">thead"), this.$header.length || (this.$header = a("<thead></thead>").appendTo(this.$el)), this.$header.find("tr").each(function () {
354   - var b = [];
355   - a(this).find("th").each(function () {
356   - "undefined" != typeof a(this).data("field") && a(this).data("field", a(this).data("field") + ""), b.push(a.extend({}, {
357   - title: a(this).html(),
358   - "class": a(this).attr("class"),
359   - titleTooltip: a(this).attr("title"),
360   - rowspan: a(this).attr("rowspan") ? +a(this).attr("rowspan") : void 0,
361   - colspan: a(this).attr("colspan") ? +a(this).attr("colspan") : void 0
362   - }, a(this).data()))
363   - }), c.push(b)
364   - }), a.isArray(this.options.columns[0]) || (this.options.columns = [this.options.columns]), this.options.columns = a.extend(!0, [], c, this.options.columns), this.columns = [], f(this.options.columns), a.each(this.options.columns, function (c, d) {
365   - a.each(d, function (d, e) {
366   - e = a.extend({}, p.COLUMN_DEFAULTS, e), "undefined" != typeof e.fieldIndex && (b.columns[e.fieldIndex] = e), b.options.columns[c][d] = e
367   - })
368   - }), !this.options.data.length) {
369   - var e = [];
370   - this.$el.find(">tbody>tr").each(function (c) {
371   - var f = {};
372   - f._id = a(this).attr("id"), f._class = a(this).attr("class"), f._data = l(a(this).data()), a(this).find(">td").each(function (d) {
373   - for (var g, h, i = a(this), j = +i.attr("colspan") || 1, k = +i.attr("rowspan") || 1; e[c] && e[c][d]; d++) ;
374   - for (g = d; d + j > g; g++) for (h = c; c + k > h; h++) e[h] || (e[h] = []), e[h][g] = !0;
375   - var m = b.columns[d].field;
376   - f[m] = a(this).html(), f["_" + m + "_id"] = a(this).attr("id"), f["_" + m + "_class"] = a(this).attr("class"), f["_" + m + "_rowspan"] = a(this).attr("rowspan"), f["_" + m + "_colspan"] = a(this).attr("colspan"), f["_" + m + "_title"] = a(this).attr("title"), f["_" + m + "_data"] = l(a(this).data())
377   - }), d.push(f)
378   - }), this.options.data = d, d.length && (this.fromHtml = !0)
379   - }
380   - }, p.prototype.initHeader = function () {
381   - var b = this, d = {}, e = [];
382   - this.header = {
383   - fields: [],
384   - styles: [],
385   - classes: [],
386   - formatters: [],
387   - events: [],
388   - sorters: [],
389   - sortNames: [],
390   - cellStyles: [],
391   - searchables: []
392   - }, a.each(this.options.columns, function (f, g) {
393   - e.push("<tr>"), 0 === f && !b.options.cardView && b.options.detailView && e.push(c('<th class="detail" rowspan="%s"><div class="fht-cell"></div></th>', b.options.columns.length)), a.each(g, function (a, f) {
394   - var g = "", h = "", i = "", j = "", k = c(' class="%s"', f["class"]),
395   - l = (b.options.sortOrder || f.order, "px"), m = f.width;
396   - if (void 0 === f.width || b.options.cardView || "string" == typeof f.width && -1 !== f.width.indexOf("%") && (l = "%"), f.width && "string" == typeof f.width && (m = f.width.replace("%", "").replace("px", "")), h = c("text-align: %s; ", f.halign ? f.halign : f.align), i = c("text-align: %s; ", f.align), j = c("vertical-align: %s; ", f.valign), j += c("width: %s; ", !f.checkbox && !f.radio || m ? m ? m + l : void 0 : "36px"), "undefined" != typeof f.fieldIndex) {
397   - if (b.header.fields[f.fieldIndex] = f.field, b.header.styles[f.fieldIndex] = i + j, b.header.classes[f.fieldIndex] = k, b.header.formatters[f.fieldIndex] = f.formatter, b.header.events[f.fieldIndex] = f.events, b.header.sorters[f.fieldIndex] = f.sorter, b.header.sortNames[f.fieldIndex] = f.sortName, b.header.cellStyles[f.fieldIndex] = f.cellStyle, b.header.searchables[f.fieldIndex] = f.searchable, !f.visible) return;
398   - if (b.options.cardView && !f.cardVisible) return;
399   - d[f.field] = f
400   - }
401   - e.push("<th" + c(' title="%s"', f.titleTooltip), f.checkbox || f.radio ? c(' class="bs-checkbox %s"', f["class"] || "") : k, c(' style="%s"', h + j), c(' rowspan="%s"', f.rowspan), c(' colspan="%s"', f.colspan), c(' data-field="%s"', f.field), "tabindex='0'", ">"), e.push(c('<div class="th-inner %s">', b.options.sortable && f.sortable ? "sortable both" : "")), g = f.title, f.checkbox && (!b.options.singleSelect && b.options.checkboxHeader && (g = '<input name="btSelectAll" type="checkbox" />'), b.header.stateField = f.field), f.radio && (g = "", b.header.stateField = f.field, b.options.singleSelect = !0), e.push(g), e.push("</div>"), e.push('<div class="fht-cell"></div>'), e.push("</div>"), e.push("</th>")
402   - }), e.push("</tr>")
403   - }), this.$header.html(e.join("")), this.$header.find("th[data-field]").each(function () {
404   - a(this).data(d[a(this).data("field")])
405   - }), this.$container.off("click", ".th-inner").on("click", ".th-inner", function (c) {
406   - var d = a(this);
407   - return b.options.detailView && d.closest(".bootstrap-table")[0] !== b.$container[0] ? !1 : void(b.options.sortable && d.parent().data().sortable && b.onSort(c))
408   - }), this.$header.children().children().off("keypress").on("keypress", function (c) {
409   - if (b.options.sortable && a(this).data().sortable) {
410   - var d = c.keyCode || c.which;
411   - 13 == d && b.onSort(c)
412   - }
413   - }), a(window).off("resize.bootstrap-table"), !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(), a(window).on("resize.bootstrap-table", a.proxy(this.resetWidth, this))), this.$selectAll = this.$header.find('[name="btSelectAll"]'), this.$selectAll.off("click").on("click", function () {
414   - var c = a(this).prop("checked");
415   - b[c ? "checkAll" : "uncheckAll"](), b.updateSelected()
416   - })
417   - }, p.prototype.initFooter = function () {
418   - !this.options.showFooter || this.options.cardView ? this.$tableFooter.hide() : this.$tableFooter.show()
419   - }, p.prototype.initData = function (a, b) {
420   - this.data = "append" === b ? this.data.concat(a) : "prepend" === b ? [].concat(a).concat(this.data) : a || this.options.data, this.options.data = "append" === b ? this.options.data.concat(a) : "prepend" === b ? [].concat(a).concat(this.options.data) : this.data, "server" !== this.options.sidePagination && this.initSort()
421   - }, p.prototype.initSort = function () {
422   - var b = this, c = this.options.sortName, d = "desc" === this.options.sortOrder ? -1 : 1,
423   - e = a.inArray(this.options.sortName, this.header.fields);
424   - return this.options.customSort !== a.noop ? void this.options.customSort.apply(this, [this.options.sortName, this.options.sortOrder]) : void(-1 !== e && (this.options.sortStable && a.each(this.data, function (a, b) {
425   - b.hasOwnProperty("_position") || (b._position = a)
426   - }), this.data.sort(function (f, g) {
427   - b.header.sortNames[e] && (c = b.header.sortNames[e]);
428   - var i = m(f, c, b.options.escape), j = m(g, c, b.options.escape),
429   - k = h(b.header, b.header.sorters[e], [i, j]);
430   - return void 0 !== k ? d * k : ((void 0 === i || null === i) && (i = ""), (void 0 === j || null === j) && (j = ""), b.options.sortStable && i === j && (i = f._position, j = g._position), a.isNumeric(i) && a.isNumeric(j) ? (i = parseFloat(i), j = parseFloat(j), j > i ? -1 * d : d) : i === j ? 0 : ("string" != typeof i && (i = i.toString()), -1 === i.localeCompare(j) ? -1 * d : d))
431   - })))
432   - }, p.prototype.onSort = function (b) {
433   - var c = "keypress" === b.type ? a(b.currentTarget) : a(b.currentTarget).parent(),
434   - d = this.$header.find("th").eq(c.index());
435   - return this.$header.add(this.$header_).find("span.order").remove(), this.options.sortName === c.data("field") ? this.options.sortOrder = "asc" === this.options.sortOrder ? "desc" : "asc" : (this.options.sortName = c.data("field"), this.options.sortOrder = "asc" === c.data("order") ? "desc" : "asc"), this.trigger("sort", this.options.sortName, this.options.sortOrder), c.add(d).data("order", this.options.sortOrder), this.getCaret(), "server" === this.options.sidePagination ? void this.initServer(this.options.silentSort) : (this.initSort(), void this.initBody())
436   - }, p.prototype.initToolbar = function () {
437   - var b, d, e = this, f = [], g = 0, i = 0;
438   - this.$toolbar.find(".bs-bars").children().length && a("body").append(a(this.options.toolbar)), this.$toolbar.html(""), ("string" == typeof this.options.toolbar || "object" == typeof this.options.toolbar) && a(c('<div class="bs-bars pull-%s"></div>', this.options.toolbarAlign)).appendTo(this.$toolbar).append(a(this.options.toolbar)), f = [c('<div class="columns columns-%s btn-group pull-%s">', this.options.buttonsAlign, this.options.buttonsAlign)], "string" == typeof this.options.icons && (this.options.icons = h(null, this.options.icons)), this.options.showPaginationSwitch && f.push(c('<button class="btn' + c(" btn-%s", this.options.buttonsClass) + c(" btn-%s", this.options.iconSize) + '" type="button" name="paginationSwitch" title="%s">', this.options.formatPaginationSwitch()), c('<i class="%s %s"></i>', this.options.iconsPrefix, this.options.icons.paginationSwitchDown), "</button>"), this.options.showRefresh && f.push(c('<button class="btn' + c(" btn-%s", this.options.buttonsClass) + c(" btn-%s", this.options.iconSize) + '" type="button" name="refresh" title="%s">', this.options.formatRefresh()), c('<i class="%s %s"></i>', this.options.iconsPrefix, this.options.icons.refresh), "</button>"), this.options.showToggle && f.push(c('<button class="btn' + c(" btn-%s", this.options.buttonsClass) + c(" btn-%s", this.options.iconSize) + '" type="button" name="toggle" title="%s">', this.options.formatToggle()), c('<i class="%s %s"></i>', this.options.iconsPrefix, this.options.icons.toggle), "</button>"), this.options.showColumns && (f.push(c('<div class="keep-open btn-group" title="%s">', this.options.formatColumns()), '<button type="button" class="btn' + c(" btn-%s", this.options.buttonsClass) + c(" btn-%s", this.options.iconSize) + ' dropdown-toggle" data-toggle="dropdown">', c('<i class="%s %s"></i>', this.options.iconsPrefix, this.options.icons.columns), ' <span class="caret"></span>', "</button>", '<ul class="dropdown-menu" role="menu">'), a.each(this.columns, function (a, b) {
439   - if (!(b.radio || b.checkbox || e.options.cardView && !b.cardVisible)) {
440   - var d = b.visible ? ' checked="checked"' : "";
441   - b.switchable && (f.push(c('<li><label><input type="checkbox" data-field="%s" value="%s"%s> %s</label></li>', b.field, a, d, b.title)), i++)
442   - }
443   - }), f.push("</ul>", "</div>")), f.push("</div>"), (this.showToolbar || f.length > 2) && this.$toolbar.append(f.join("")), this.options.showPaginationSwitch && this.$toolbar.find('button[name="paginationSwitch"]').off("click").on("click", a.proxy(this.togglePagination, this)), this.options.showRefresh && this.$toolbar.find('button[name="refresh"]').off("click").on("click", a.proxy(this.refresh, this)), this.options.showToggle && this.$toolbar.find('button[name="toggle"]').off("click").on("click", function () {
444   - e.toggleView()
445   - }), this.options.showColumns && (b = this.$toolbar.find(".keep-open"), i <= this.options.minimumCountColumns && b.find("input").prop("disabled", !0), b.find("li").off("click").on("click", function (a) {
446   - a.stopImmediatePropagation()
447   - }), b.find("input").off("click").on("click", function () {
448   - var b = a(this);
449   - e.toggleColumn(a(this).val(), b.prop("checked"), !1), e.trigger("column-switch", a(this).data("field"), b.prop("checked"))
450   - })), this.options.search && (f = [], f.push('<div class="pull-' + this.options.searchAlign + ' search">', c('<input class="form-control' + c(" input-%s", this.options.iconSize) + '" type="text" placeholder="%s">', this.options.formatSearch()), "</div>"), this.$toolbar.append(f.join("")), d = this.$toolbar.find(".search input"), d.off("keyup drop").on("keyup drop", function (b) {
451   - e.options.searchOnEnterKey && 13 !== b.keyCode || a.inArray(b.keyCode, [37, 38, 39, 40]) > -1 || (clearTimeout(g), g = setTimeout(function () {
452   - e.onSearch(b)
453   - }, e.options.searchTimeOut))
454   - }), n() && d.off("mouseup").on("mouseup", function (a) {
455   - clearTimeout(g), g = setTimeout(function () {
456   - e.onSearch(a)
457   - }, e.options.searchTimeOut)
458   - }))
459   - }, p.prototype.onSearch = function (b) {
460   - var c = a.trim(a(b.currentTarget).val());
461   - this.options.trimOnSearch && a(b.currentTarget).val() !== c && a(b.currentTarget).val(c), c !== this.searchText && (this.searchText = c, this.options.searchText = c, this.options.pageNumber = 1, this.initSearch(), this.updatePagination(), this.trigger("search", c))
462   - }, p.prototype.initSearch = function () {
463   - var b = this;
464   - if ("server" !== this.options.sidePagination) {
465   - if (this.options.customSearch !== a.noop) return void this.options.customSearch.apply(this, [this.searchText]);
466   - var c = this.searchText && (this.options.escape ? j(this.searchText) : this.searchText).toLowerCase(),
467   - d = a.isEmptyObject(this.filterColumns) ? null : this.filterColumns;
468   - this.data = d ? a.grep(this.options.data, function (b) {
469   - for (var c in d) if (a.isArray(d[c]) && -1 === a.inArray(b[c], d[c]) || b[c] !== d[c]) return !1;
470   - return !0
471   - }) : this.options.data, this.data = c ? a.grep(this.data, function (d, f) {
472   - for (var g = 0; g < b.header.fields.length; g++) if (b.header.searchables[g]) {
473   - var i, j = a.isNumeric(b.header.fields[g]) ? parseInt(b.header.fields[g], 10) : b.header.fields[g],
474   - k = b.columns[e(b.columns, j)];
475   - if ("string" == typeof j) {
476   - i = d;
477   - for (var l = j.split("."), m = 0; m < l.length; m++) i = i[l[m]];
478   - k && k.searchFormatter && (i = h(k, b.header.formatters[g], [i, d, f], i))
479   - } else i = d[j];
480   - if ("string" == typeof i || "number" == typeof i) if (b.options.strictSearch) {
481   - if ((i + "").toLowerCase() === c) return !0
482   - } else if (-1 !== (i + "").toLowerCase().indexOf(c)) return !0
483   - }
484   - return !1
485   - }) : this.data
486   - }
487   - }, p.prototype.initPagination = function () {
488   - if (!this.options.pagination) return void this.$pagination.hide();
489   - this.$pagination.show();
490   - var b, d, e, f, g, h, i, j, k, l = this, m = [], n = !1, o = this.getData(), p = this.options.pageList;
491   - if ("server" !== this.options.sidePagination && (this.options.totalRows = o.length), this.totalPages = 0, this.options.totalRows) {
492   - if (this.options.pageSize === this.options.formatAllRows()) this.options.pageSize = this.options.totalRows, n = !0; else if (this.options.pageSize === this.options.totalRows) {
493   - var q = "string" == typeof this.options.pageList ? this.options.pageList.replace("[", "").replace("]", "").replace(/ /g, "").toLowerCase().split(",") : this.options.pageList;
494   - a.inArray(this.options.formatAllRows().toLowerCase(), q) > -1 && (n = !0)
495   - }
496   - this.totalPages = ~~((this.options.totalRows - 1) / this.options.pageSize) + 1, this.options.totalPages = this.totalPages
497   - }
498   - if (this.totalPages > 0 && this.options.pageNumber > this.totalPages && (this.options.pageNumber = this.totalPages), this.pageFrom = (this.options.pageNumber - 1) * this.options.pageSize + 1, this.pageTo = this.options.pageNumber * this.options.pageSize, this.pageTo > this.options.totalRows && (this.pageTo = this.options.totalRows), m.push('<div class="pull-' + this.options.paginationDetailHAlign + ' pagination-detail">', '<span class="pagination-info">', this.options.onlyInfoPagination ? this.options.formatDetailPagination(this.options.totalRows) : this.options.formatShowingRows(this.pageFrom, this.pageTo, this.options.totalRows), "</span>"), !this.options.onlyInfoPagination) {
499   - m.push('<span class="page-list">');
500   - var r = [c('<span class="btn-group %s">', "top" === this.options.paginationVAlign || "both" === this.options.paginationVAlign ? "dropdown" : "dropup"), '<button type="button" class="btn' + c(" btn-%s", this.options.buttonsClass) + c(" btn-%s", this.options.iconSize) + ' dropdown-toggle" data-toggle="dropdown">', '<span class="page-size">', n ? this.options.formatAllRows() : this.options.pageSize, "</span>", ' <span class="caret"></span>', "</button>", '<ul class="dropdown-menu" role="menu">'];
501   - if ("string" == typeof this.options.pageList) {
502   - var s = this.options.pageList.replace("[", "").replace("]", "").replace(/ /g, "").split(",");
503   - p = [], a.each(s, function (a, b) {
504   - p.push(b.toUpperCase() === l.options.formatAllRows().toUpperCase() ? l.options.formatAllRows() : +b)
505   - })
506   - }
507   - for (a.each(p, function (a, b) {
508   - if (!l.options.smartDisplay || 0 === a || p[a - 1] <= l.options.totalRows) {
509   - var d;
510   - d = n ? b === l.options.formatAllRows() ? ' class="active"' : "" : b === l.options.pageSize ? ' class="active"' : "", r.push(c('<li%s><a href="javascript:void(0)">%s</a></li>', d, b))
511   - }
512   - }), r.push("</ul></span>"), m.push(this.options.formatRecordsPerPage(r.join(""))), m.push("</span>"), m.push("</div>", '<div class="pull-' + this.options.paginationHAlign + ' pagination">', '<ul class="pagination' + c(" pagination-%s", this.options.iconSize) + '">', '<li class="page-pre"><a href="javascript:void(0)">' + this.options.paginationPreText + "</a></li>"), this.totalPages < 5 ? (d = 1, e = this.totalPages) : (d = this.options.pageNumber - 2, e = d + 4, 1 > d && (d = 1, e = 5), e > this.totalPages && (e = this.totalPages, d = e - 4)), this.totalPages >= 6 && (this.options.pageNumber >= 3 && (m.push('<li class="page-first' + (1 === this.options.pageNumber ? " active" : "") + '">', '<a href="javascript:void(0)">', 1, "</a>", "</li>"), d++), this.options.pageNumber >= 4 && (4 == this.options.pageNumber || 6 == this.totalPages || 7 == this.totalPages ? d-- : m.push('<li class="page-first-separator disabled">', '<a href="javascript:void(0)">...</a>', "</li>"), e--)), this.totalPages >= 7 && this.options.pageNumber >= this.totalPages - 2 && d--, 6 == this.totalPages ? this.options.pageNumber >= this.totalPages - 2 && e++ : this.totalPages >= 7 && (7 == this.totalPages || this.options.pageNumber >= this.totalPages - 3) && e++, b = d; e >= b; b++) m.push('<li class="page-number' + (b === this.options.pageNumber ? " active" : "") + '">', '<a href="javascript:void(0)">', b, "</a>", "</li>");
513   - this.totalPages >= 8 && this.options.pageNumber <= this.totalPages - 4 && m.push('<li class="page-last-separator disabled">', '<a href="javascript:void(0)">...</a>', "</li>"), this.totalPages >= 6 && this.options.pageNumber <= this.totalPages - 3 && m.push('<li class="page-last' + (this.totalPages === this.options.pageNumber ? " active" : "") + '">', '<a href="javascript:void(0)">', this.totalPages, "</a>", "</li>"), m.push('<li class="page-next"><a href="javascript:void(0)">' + this.options.paginationNextText + "</a></li>", "</ul>", "</div>")
514   - }
515   - this.$pagination.html(m.join("")), this.options.onlyInfoPagination || (f = this.$pagination.find(".page-list a"), g = this.$pagination.find(".page-first"), h = this.$pagination.find(".page-pre"), i = this.$pagination.find(".page-next"), j = this.$pagination.find(".page-last"), k = this.$pagination.find(".page-number"), this.options.smartDisplay && (this.totalPages <= 1 && this.$pagination.find("div.pagination").hide(), (p.length < 2 || this.options.totalRows <= p[0]) && this.$pagination.find("span.page-list").hide(), this.$pagination[this.getData().length ? "show" : "hide"]()), n && (this.options.pageSize = this.options.formatAllRows()), f.off("click").on("click", a.proxy(this.onPageListChange, this)), g.off("click").on("click", a.proxy(this.onPageFirst, this)), h.off("click").on("click", a.proxy(this.onPagePre, this)), i.off("click").on("click", a.proxy(this.onPageNext, this)), j.off("click").on("click", a.proxy(this.onPageLast, this)), k.off("click").on("click", a.proxy(this.onPageNumber, this)))
516   - }, p.prototype.updatePagination = function (b) {
517   - b && a(b.currentTarget).hasClass("disabled") || (this.options.maintainSelected || this.resetRows(), this.initPagination(), "server" === this.options.sidePagination ? this.initServer() : this.initBody(), this.trigger("page-change", this.options.pageNumber, this.options.pageSize))
518   - }, p.prototype.onPageListChange = function (b) {
519   - var c = a(b.currentTarget);
520   - c.parent().addClass("active").siblings().removeClass("active"), this.options.pageSize = c.text().toUpperCase() === this.options.formatAllRows().toUpperCase() ? this.options.formatAllRows() : +c.text(), this.$toolbar.find(".page-size").text(this.options.pageSize), this.updatePagination(b)
521   - }, p.prototype.onPageFirst = function (a) {
522   - this.options.pageNumber = 1, this.updatePagination(a)
523   - }, p.prototype.onPagePre = function (a) {
524   - this.options.pageNumber - 1 === 0 ? this.options.pageNumber = this.options.totalPages : this.options.pageNumber--, this.updatePagination(a)
525   - }, p.prototype.onPageNext = function (a) {
526   - this.options.pageNumber + 1 > this.options.totalPages ? this.options.pageNumber = 1 : this.options.pageNumber++, this.updatePagination(a)
527   - }, p.prototype.onPageLast = function (a) {
528   - this.options.pageNumber = this.totalPages, this.updatePagination(a)
529   - }, p.prototype.onPageNumber = function (b) {
530   - this.options.pageNumber !== +a(b.currentTarget).text() && (this.options.pageNumber = +a(b.currentTarget).text(), this.updatePagination(b))
531   - }, p.prototype.initBody = function (b) {
532   - var f = this, g = [], i = this.getData();
533   - this.trigger("pre-body", i), this.$body = this.$el.find(">tbody"), this.$body.length || (this.$body = a("<tbody></tbody>").appendTo(this.$el)), this.options.pagination && "server" !== this.options.sidePagination || (this.pageFrom = 1, this.pageTo = i.length);
534   - for (var k = this.pageFrom - 1; k < this.pageTo; k++) {
535   - var l, n = i[k], o = {}, p = [], q = "", r = {}, s = [];
536   - if (o = h(this.options, this.options.rowStyle, [n, k], o), o && o.css) for (l in o.css) p.push(l + ": " + o.css[l]);
537   - if (r = h(this.options, this.options.rowAttributes, [n, k], r)) for (l in r) s.push(c('%s="%s"', l, j(r[l])));
538   - n._data && !a.isEmptyObject(n._data) && a.each(n._data, function (a, b) {
539   - "index" !== a && (q += c(' data-%s="%s"', a, b))
540   - }), g.push("<tr", c(" %s", s.join(" ")), c(' id="%s"', a.isArray(n) ? void 0 : n._id), c(' class="%s"', o.classes || (a.isArray(n) ? void 0 : n._class)), c(' data-index="%s"', k), c(' data-uniqueid="%s"', n[this.options.uniqueId]), c("%s", q), ">"), this.options.cardView && g.push(c('<td colspan="%s"><div class="card-views">', this.header.fields.length)), !this.options.cardView && this.options.detailView && g.push("<td>", '<a class="detail-icon" href="javascript:">', c('<i class="%s %s"></i>', this.options.iconsPrefix, this.options.icons.detailOpen), "</a>", "</td>"), a.each(this.header.fields, function (b, e) {
541   - var i = "", j = m(n, e, f.options.escape), l = "", q = {}, r = "", s = f.header.classes[b], t = "",
542   - u = "", v = "", w = "", x = f.columns[b];
543   - if (!(f.fromHtml && "undefined" == typeof j || !x.visible || f.options.cardView && !x.cardVisible)) {
544   - if (o = c('style="%s"', p.concat(f.header.styles[b]).join("; ")), n["_" + e + "_id"] && (r = c(' id="%s"', n["_" + e + "_id"])), n["_" + e + "_class"] && (s = c(' class="%s"', n["_" + e + "_class"])), n["_" + e + "_rowspan"] && (u = c(' rowspan="%s"', n["_" + e + "_rowspan"])), n["_" + e + "_colspan"] && (v = c(' colspan="%s"', n["_" + e + "_colspan"])), n["_" + e + "_title"] && (w = c(' title="%s"', n["_" + e + "_title"])), q = h(f.header, f.header.cellStyles[b], [j, n, k, e], q), q.classes && (s = c(' class="%s"', q.classes)), q.css) {
545   - var y = [];
546   - for (var z in q.css) y.push(z + ": " + q.css[z]);
547   - o = c('style="%s"', y.concat(f.header.styles[b]).join("; "))
548   - }
549   - j = h(x, f.header.formatters[b], [j, n, k], j), n["_" + e + "_data"] && !a.isEmptyObject(n["_" + e + "_data"]) && a.each(n["_" + e + "_data"], function (a, b) {
550   - "index" !== a && (t += c(' data-%s="%s"', a, b))
551   - }), x.checkbox || x.radio ? (l = x.checkbox ? "checkbox" : l, l = x.radio ? "radio" : l, i = [c(f.options.cardView ? '<div class="card-view %s">' : '<td class="bs-checkbox %s">', x["class"] || ""), "<input" + c(' data-index="%s"', k) + c(' name="%s"', f.options.selectItemName) + c(' type="%s"', l) + c(' value="%s"', n[f.options.idField]) + c(' checked="%s"', j === !0 || j && j.checked ? "checked" : void 0) + c(' disabled="%s"', !x.checkboxEnabled || j && j.disabled ? "disabled" : void 0) + " />", f.header.formatters[b] && "string" == typeof j ? j : "", f.options.cardView ? "</div>" : "</td>"].join(""), n[f.header.stateField] = j === !0 || j && j.checked) : (j = "undefined" == typeof j || null === j ? f.options.undefinedText : j, i = f.options.cardView ? ['<div class="card-view">', f.options.showHeader ? c('<span class="title" %s>%s</span>', o, d(f.columns, "field", "title", e)) : "", c('<span class="value">%s</span>', j), "</div>"].join("") : [c("<td%s %s %s %s %s %s %s>", r, s, o, t, u, v, w), j, "</td>"].join(""), f.options.cardView && f.options.smartDisplay && "" === j && (i = '<div class="card-view"></div>')), g.push(i)
552   - }
553   - }), this.options.cardView && g.push("</div></td>"), g.push("</tr>")
554   - }
555   - g.length || g.push('<tr class="no-records-found">', c('<td colspan="%s">%s</td>', this.$header.find("th").length, this.options.formatNoMatches()), "</tr>"), this.$body.html(g.join("")), b || this.scrollTo(0), this.$body.find("> tr[data-index] > td").off("click dblclick").on("click dblclick", function (b) {
556   - var d = a(this), g = d.parent(), h = f.data[g.data("index")], i = d[0].cellIndex, j = f.getVisibleFields(),
557   - k = j[f.options.detailView && !f.options.cardView ? i - 1 : i], l = f.columns[e(f.columns, k)],
558   - n = m(h, k, f.options.escape);
559   - if (!d.find(".detail-icon").length && (f.trigger("click" === b.type ? "click-cell" : "dbl-click-cell", k, n, h, d), f.trigger("click" === b.type ? "click-row" : "dbl-click-row", h, g, k),
560   - "click" === b.type && f.options.clickToSelect && l.clickToSelect)) {
561   - var o = g.find(c('[name="%s"]', f.options.selectItemName));
562   - o.length && o[0].click()
563   - }
564   - }), this.$body.find("> tr[data-index] > td > .detail-icon").off("click").on("click", function () {
565   - var b = a(this), d = b.parent().parent(), e = d.data("index"), g = i[e];
566   - if (d.next().is("tr.detail-view")) b.find("i").attr("class", c("%s %s", f.options.iconsPrefix, f.options.icons.detailOpen)), d.next().remove(), f.trigger("collapse-row", e, g); else {
567   - b.find("i").attr("class", c("%s %s", f.options.iconsPrefix, f.options.icons.detailClose)), d.after(c('<tr class="detail-view"><td colspan="%s"></td></tr>', d.find("td").length));
568   - var j = d.next().find("td"), k = h(f.options, f.options.detailFormatter, [e, g, j], "");
569   - 1 === j.length && j.append(k), f.trigger("expand-row", e, g, j)
570   - }
571   - f.resetView()
572   - }), this.$selectItem = this.$body.find(c('[name="%s"]', this.options.selectItemName)), this.$selectItem.off("click").on("click", function (b) {
573   - b.stopImmediatePropagation();
574   - var c = a(this), d = c.prop("checked"), e = f.data[c.data("index")];
575   - f.options.maintainSelected && a(this).is(":radio") && a.each(f.options.data, function (a, b) {
576   - b[f.header.stateField] = !1
577   - }), e[f.header.stateField] = d, f.options.singleSelect && (f.$selectItem.not(this).each(function () {
578   - f.data[a(this).data("index")][f.header.stateField] = !1
579   - }), f.$selectItem.filter(":checked").not(this).prop("checked", !1)), f.updateSelected(), f.trigger(d ? "check" : "uncheck", e, c)
580   - }), a.each(this.header.events, function (b, c) {
581   - if (c) {
582   - "string" == typeof c && (c = h(null, c));
583   - var d = f.header.fields[b], e = a.inArray(d, f.getVisibleFields());
584   - f.options.detailView && !f.options.cardView && (e += 1);
585   - for (var g in c) f.$body.find(">tr:not(.no-records-found)").each(function () {
586   - var b = a(this), h = b.find(f.options.cardView ? ".card-view" : "td").eq(e), i = g.indexOf(" "),
587   - j = g.substring(0, i), k = g.substring(i + 1), l = c[g];
588   - h.find(k).off(j).on(j, function (a) {
589   - var c = b.data("index"), e = f.data[c], g = e[d];
590   - l.apply(this, [a, g, e, c])
591   - })
592   - })
593   - }
594   - }), this.updateSelected(), this.resetView(), this.trigger("post-body", i)
595   - }, p.prototype.initServer = function (b, c, d) {
596   - var e, f = this, g = {},
597   - i = {searchText: this.searchText, sortName: this.options.sortName, sortOrder: this.options.sortOrder};
598   - this.options.pagination && (i.pageSize = this.options.pageSize === this.options.formatAllRows() ? this.options.totalRows : this.options.pageSize, i.pageNumber = this.options.pageNumber), (d || this.options.url || this.options.ajax) && ("limit" === this.options.queryParamsType && (i = {
599   - search: i.searchText,
600   - sort: i.sortName,
601   - order: i.sortOrder
602   - }, this.options.pagination && (i.offset = this.options.pageSize === this.options.formatAllRows() ? 0 : this.options.pageSize * (this.options.pageNumber - 1), i.limit = this.options.pageSize === this.options.formatAllRows() ? this.options.totalRows : this.options.pageSize)), a.isEmptyObject(this.filterColumnsPartial) || (i.filter = JSON.stringify(this.filterColumnsPartial, null)), g = h(this.options, this.options.queryParams, [i], g), a.extend(g, c || {}), g !== !1 && (b || this.$tableLoading.show(), e = a.extend({}, h(null, this.options.ajaxOptions), {
603   - type: this.options.method,
604   - url: d || this.options.url,
605   - data: "application/json" === this.options.contentType && "post" === this.options.method ? JSON.stringify(g) : g,
606   - cache: this.options.cache,
607   - contentType: this.options.contentType,
608   - dataType: this.options.dataType,
609   - success: function (a) {
610   - a = h(f.options, f.options.responseHandler, [a], a), f.load(a), f.trigger("load-success", a), b || f.$tableLoading.hide()
611   - },
612   - error: function (a) {
613   - f.trigger("load-error", a.status, a), b || f.$tableLoading.hide()
614   - }
615   - }), this.options.ajax ? h(this, this.options.ajax, [e], null) : (this._xhr && 4 !== this._xhr.readyState && this._xhr.abort(), this._xhr = a.ajax(e))))
616   - }, p.prototype.initSearchText = function () {
617   - if (this.options.search && "" !== this.options.searchText) {
618   - var a = this.$toolbar.find(".search input");
619   - a.val(this.options.searchText), this.onSearch({currentTarget: a})
620   - }
621   - }, p.prototype.getCaret = function () {
622   - var b = this;
623   - a.each(this.$header.find("th"), function (c, d) {
624   - a(d).find(".sortable").removeClass("desc asc").addClass(a(d).data("field") === b.options.sortName ? b.options.sortOrder : "both")
625   - })
626   - }, p.prototype.updateSelected = function () {
627   - var b = this.$selectItem.filter(":enabled").length && this.$selectItem.filter(":enabled").length === this.$selectItem.filter(":enabled").filter(":checked").length;
628   - this.$selectAll.add(this.$selectAll_).prop("checked", b), this.$selectItem.each(function () {
629   - a(this).closest("tr")[a(this).prop("checked") ? "addClass" : "removeClass"]("selected")
630   - })
631   - }, p.prototype.updateRows = function () {
632   - var b = this;
633   - this.$selectItem.each(function () {
634   - b.data[a(this).data("index")][b.header.stateField] = a(this).prop("checked")
635   - })
636   - }, p.prototype.resetRows = function () {
637   - var b = this;
638   - a.each(this.data, function (a, c) {
639   - b.$selectAll.prop("checked", !1), b.$selectItem.prop("checked", !1), b.header.stateField && (c[b.header.stateField] = !1)
640   - })
641   - }, p.prototype.trigger = function (b) {
642   - var c = Array.prototype.slice.call(arguments, 1);
643   - b += ".bs.table", this.options[p.EVENTS[b]].apply(this.options, c), this.$el.trigger(a.Event(b), c), this.options.onAll(b, c), this.$el.trigger(a.Event("all.bs.table"), [b, c])
644   - }, p.prototype.resetHeader = function () {
645   - clearTimeout(this.timeoutId_), this.timeoutId_ = setTimeout(a.proxy(this.fitHeader, this), this.$el.is(":hidden") ? 100 : 0)
646   - }, p.prototype.fitHeader = function () {
647   - var b, d, e, f, h = this;
648   - if (h.$el.is(":hidden")) return void(h.timeoutId_ = setTimeout(a.proxy(h.fitHeader, h), 100));
649   - if (b = this.$tableBody.get(0), d = b.scrollWidth > b.clientWidth && b.scrollHeight > b.clientHeight + this.$header.outerHeight() ? g() : 0, this.$el.css("margin-top", -this.$header.outerHeight()), e = a(":focus"), e.length > 0) {
650   - var i = e.parents("th");
651   - if (i.length > 0) {
652   - var j = i.attr("data-field");
653   - if (void 0 !== j) {
654   - var k = this.$header.find("[data-field='" + j + "']");
655   - k.length > 0 && k.find(":input").addClass("focus-temp")
656   - }
657   - }
658   - }
659   - this.$header_ = this.$header.clone(!0, !0), this.$selectAll_ = this.$header_.find('[name="btSelectAll"]'), this.$tableHeader.css({"margin-right": d}).find("table").css("width", this.$el.outerWidth()).html("").attr("class", this.$el.attr("class")).append(this.$header_), f = a(".focus-temp:visible:eq(0)"), f.length > 0 && (f.focus(), this.$header.find(".focus-temp").removeClass("focus-temp")), this.$header.find("th[data-field]").each(function () {
660   - h.$header_.find(c('th[data-field="%s"]', a(this).data("field"))).data(a(this).data())
661   - });
662   - var l = this.getVisibleFields(), m = this.$header_.find("th");
663   - this.$body.find(">tr:first-child:not(.no-records-found) > *").each(function (b) {
664   - var d = a(this), e = b;
665   - h.options.detailView && !h.options.cardView && (0 === b && h.$header_.find("th.detail").find(".fht-cell").width(d.innerWidth()), e = b - 1);
666   - var f = h.$header_.find(c('th[data-field="%s"]', l[e]));
667   - f.length > 1 && (f = a(m[d[0].cellIndex])), f.find(".fht-cell").width(d.innerWidth())
668   - }), this.$tableBody.off("scroll").on("scroll", function () {
669   - h.$tableHeader.scrollLeft(a(this).scrollLeft()), h.options.showFooter && !h.options.cardView && h.$tableFooter.scrollLeft(a(this).scrollLeft())
670   - }), h.trigger("post-header")
671   - }, p.prototype.resetFooter = function () {
672   - var b = this, d = b.getData(), e = [];
673   - this.options.showFooter && !this.options.cardView && (!this.options.cardView && this.options.detailView && e.push('<td><div class="th-inner">&nbsp;</div><div class="fht-cell"></div></td>'), a.each(this.columns, function (a, f) {
674   - var g, i = "", j = "", k = [], l = {}, m = c(' class="%s"', f["class"]);
675   - if (f.visible && (!b.options.cardView || f.cardVisible)) {
676   - if (i = c("text-align: %s; ", f.falign ? f.falign : f.align), j = c("vertical-align: %s; ", f.valign), l = h(null, b.options.footerStyle), l && l.css) for (g in l.css) k.push(g + ": " + l.css[g]);
677   - e.push("<td", m, c(' style="%s"', i + j + k.concat().join("; ")), ">"), e.push('<div class="th-inner">'), e.push(h(f, f.footerFormatter, [d], "&nbsp;") || "&nbsp;"), e.push("</div>"), e.push('<div class="fht-cell"></div>'), e.push("</div>"), e.push("</td>")
678   - }
679   - }), this.$tableFooter.find("tr").html(e.join("")), this.$tableFooter.show(), clearTimeout(this.timeoutFooter_), this.timeoutFooter_ = setTimeout(a.proxy(this.fitFooter, this), this.$el.is(":hidden") ? 100 : 0))
680   - }, p.prototype.fitFooter = function () {
681   - var b, c, d;
682   - return clearTimeout(this.timeoutFooter_), this.$el.is(":hidden") ? void(this.timeoutFooter_ = setTimeout(a.proxy(this.fitFooter, this), 100)) : (c = this.$el.css("width"), d = c > this.$tableBody.width() ? g() : 0, this.$tableFooter.css({"margin-right": d}).find("table").css("width", c).attr("class", this.$el.attr("class")), b = this.$tableFooter.find("td"), void this.$body.find(">tr:first-child:not(.no-records-found) > *").each(function (c) {
683   - var d = a(this);
684   - b.eq(c).find(".fht-cell").width(d.innerWidth())
685   - }))
686   - }, p.prototype.toggleColumn = function (a, b, d) {
687   - if (-1 !== a && (this.columns[a].visible = b, this.initHeader(), this.initSearch(), this.initPagination(), this.initBody(), this.options.showColumns)) {
688   - var e = this.$toolbar.find(".keep-open input").prop("disabled", !1);
689   - d && e.filter(c('[value="%s"]', a)).prop("checked", b), e.filter(":checked").length <= this.options.minimumCountColumns && e.filter(":checked").prop("disabled", !0)
690   - }
691   - }, p.prototype.toggleRow = function (a, b, d) {
692   - -1 !== a && this.$body.find("undefined" != typeof a ? c('tr[data-index="%s"]', a) : c('tr[data-uniqueid="%s"]', b))[d ? "show" : "hide"]()
693   - }, p.prototype.getVisibleFields = function () {
694   - var b = this, c = [];
695   - return a.each(this.header.fields, function (a, d) {
696   - var f = b.columns[e(b.columns, d)];
697   - f.visible && c.push(d)
698   - }), c
699   - }, p.prototype.resetView = function (a) {
700   - var b = 0;
701   - if (a && a.height && (this.options.height = a.height), this.$selectAll.prop("checked", this.$selectItem.length > 0 && this.$selectItem.length === this.$selectItem.filter(":checked").length), this.options.height) {
702   - var c = k(this.$toolbar), d = k(this.$pagination), e = this.options.height - c - d;
703   - this.$tableContainer.css("height", e + "px")
704   - }
705   - return this.options.cardView ? (this.$el.css("margin-top", "0"), this.$tableContainer.css("padding-bottom", "0"), void this.$tableFooter.hide()) : (this.options.showHeader && this.options.height ? (this.$tableHeader.show(), this.resetHeader(), b += this.$header.outerHeight()) : (this.$tableHeader.hide(), this.trigger("post-header")), this.options.showFooter && (this.resetFooter(), this.options.height && (b += this.$tableFooter.outerHeight() + 1)), this.getCaret(), this.$tableContainer.css("padding-bottom", b + "px"), void this.trigger("reset-view"))
706   - }, p.prototype.getData = function (b) {
707   - return !this.searchText && a.isEmptyObject(this.filterColumns) && a.isEmptyObject(this.filterColumnsPartial) ? b ? this.options.data.slice(this.pageFrom - 1, this.pageTo) : this.options.data : b ? this.data.slice(this.pageFrom - 1, this.pageTo) : this.data
708   - }, p.prototype.load = function (b) {
709   - var c = !1;
710   - "server" === this.options.sidePagination ? (this.options.totalRows = b.total, c = b.fixedScroll, b = b[this.options.dataField]) : a.isArray(b) || (c = b.fixedScroll, b = b.data), this.initData(b), this.initSearch(), this.initPagination(), this.initBody(c)
711   - }, p.prototype.append = function (a) {
712   - this.initData(a, "append"), this.initSearch(), this.initPagination(), this.initSort(), this.initBody(!0)
713   - }, p.prototype.prepend = function (a) {
714   - this.initData(a, "prepend"), this.initSearch(), this.initPagination(), this.initSort(), this.initBody(!0)
715   - }, p.prototype.remove = function (b) {
716   - var c, d, e = this.options.data.length;
717   - if (b.hasOwnProperty("field") && b.hasOwnProperty("values")) {
718   - for (c = e - 1; c >= 0; c--) d = this.options.data[c], d.hasOwnProperty(b.field) && -1 !== a.inArray(d[b.field], b.values) && this.options.data.splice(c, 1);
719   - e !== this.options.data.length && (this.initSearch(), this.initPagination(), this.initSort(), this.initBody(!0))
720   - }
721   - }, p.prototype.removeAll = function () {
722   - this.options.data.length > 0 && (this.options.data.splice(0, this.options.data.length), this.initSearch(), this.initPagination(), this.initBody(!0))
723   - }, p.prototype.getRowByUniqueId = function (a) {
724   - var b, c, d, e = this.options.uniqueId, f = this.options.data.length, g = null;
725   - for (b = f - 1; b >= 0; b--) {
726   - if (c = this.options.data[b], c.hasOwnProperty(e)) d = c[e]; else {
727   - if (!c._data.hasOwnProperty(e)) continue;
728   - d = c._data[e]
729   - }
730   - if ("string" == typeof d ? a = a.toString() : "number" == typeof d && (Number(d) === d && d % 1 === 0 ? a = parseInt(a) : d === Number(d) && 0 !== d && (a = parseFloat(a))), d === a) {
731   - g = c;
732   - break
733   - }
734   - }
735   - return g
736   - }, p.prototype.removeByUniqueId = function (a) {
737   - var b = this.options.data.length, c = this.getRowByUniqueId(a);
738   - c && this.options.data.splice(this.options.data.indexOf(c), 1), b !== this.options.data.length && (this.initSearch(), this.initPagination(), this.initBody(!0))
739   - }, p.prototype.updateByUniqueId = function (b) {
740   - var c = this, d = a.isArray(b) ? b : [b];
741   - a.each(d, function (b, d) {
742   - var e;
743   - d.hasOwnProperty("id") && d.hasOwnProperty("row") && (e = a.inArray(c.getRowByUniqueId(d.id), c.options.data), -1 !== e && a.extend(c.options.data[e], d.row))
744   - }), this.initSearch(), this.initSort(), this.initBody(!0)
745   - }, p.prototype.insertRow = function (a) {
746   - a.hasOwnProperty("index") && a.hasOwnProperty("row") && (this.data.splice(a.index, 0, a.row), this.initSearch(), this.initPagination(), this.initSort(), this.initBody(!0))
747   - }, p.prototype.updateRow = function (b) {
748   - var c = this, d = a.isArray(b) ? b : [b];
749   - a.each(d, function (b, d) {
750   - d.hasOwnProperty("index") && d.hasOwnProperty("row") && a.extend(c.options.data[d.index], d.row)
751   - }), this.initSearch(), this.initSort(), this.initBody(!0)
752   - }, p.prototype.showRow = function (a) {
753   - (a.hasOwnProperty("index") || a.hasOwnProperty("uniqueId")) && this.toggleRow(a.index, a.uniqueId, !0)
754   - }, p.prototype.hideRow = function (a) {
755   - (a.hasOwnProperty("index") || a.hasOwnProperty("uniqueId")) && this.toggleRow(a.index, a.uniqueId, !1)
756   - }, p.prototype.getRowsHidden = function (b) {
757   - var c = a(this.$body[0]).children().filter(":hidden"), d = 0;
758   - if (b) for (; d < c.length; d++) a(c[d]).show();
759   - return c
760   - }, p.prototype.mergeCells = function (b) {
761   - var c, d, e, f = b.index, g = a.inArray(b.field, this.getVisibleFields()), h = b.rowspan || 1,
762   - i = b.colspan || 1, j = this.$body.find(">tr");
763   - if (this.options.detailView && !this.options.cardView && (g += 1), e = j.eq(f).find(">td").eq(g), !(0 > f || 0 > g || f >= this.data.length)) {
764   - for (c = f; f + h > c; c++) for (d = g; g + i > d; d++) j.eq(c).find(">td").eq(d).hide();
765   - e.attr("rowspan", h).attr("colspan", i).show()
766   - }
767   - }, p.prototype.updateCell = function (a) {
768   - a.hasOwnProperty("index") && a.hasOwnProperty("field") && a.hasOwnProperty("value") && (this.data[a.index][a.field] = a.value, a.reinit !== !1 && (this.initSort(), this.initBody(!0)))
769   - }, p.prototype.getOptions = function () {
770   - return this.options
771   - }, p.prototype.getSelections = function () {
772   - var b = this;
773   - return a.grep(this.options.data, function (a) {
774   - return a[b.header.stateField]
775   - })
776   - }, p.prototype.getAllSelections = function () {
777   - var b = this;
778   - return a.grep(this.options.data, function (a) {
779   - return a[b.header.stateField]
780   - })
781   - }, p.prototype.checkAll = function () {
782   - this.checkAll_(!0)
783   - }, p.prototype.uncheckAll = function () {
784   - this.checkAll_(!1)
785   - },p.prototype.getRowByIndex = function (index) {
786   - if((index * 1+1)>this.options.data.length){
787   - throw new Error("Unknown method: 没有当前序号!");
788   - }
789   - return this.options.data[index * 1];
790   - }, p.prototype.checkInvert = function () {
791   - var b = this, c = b.$selectItem.filter(":enabled"), d = c.filter(":checked");
792   - c.each(function () {
793   - a(this).prop("checked", !a(this).prop("checked"))
794   - }), b.updateRows(), b.updateSelected(), b.trigger("uncheck-some", d), d = b.getSelections(), b.trigger("check-some", d)
795   - }, p.prototype.checkAll_ = function (a) {
796   - var b;
797   - a || (b = this.getSelections()), this.$selectAll.add(this.$selectAll_).prop("checked", a), this.$selectItem.filter(":enabled").prop("checked", a), this.updateRows(), a && (b = this.getSelections()), this.trigger(a ? "check-all" : "uncheck-all", b)
798   - }, p.prototype.check = function (a) {
799   - this.check_(!0, a)
800   - }, p.prototype.uncheck = function (a) {
801   - this.check_(!1, a)
802   - }, p.prototype.check_ = function (a, b) {
803   - var d = this.$selectItem.filter(c('[data-index="%s"]', b)).prop("checked", a);
804   - this.data[b][this.header.stateField] = a, this.updateSelected(), this.trigger(a ? "check" : "uncheck", this.data[b], d)
805   - }, p.prototype.checkBy = function (a) {
806   - this.checkBy_(!0, a)
807   - }, p.prototype.uncheckBy = function (a) {
808   - this.checkBy_(!1, a)
809   - }, p.prototype.checkBy_ = function (b, d) {
810   - if (d.hasOwnProperty("field") && d.hasOwnProperty("values")) {
811   - var e = this, f = [];
812   - a.each(this.options.data, function (g, h) {
813   - if (!h.hasOwnProperty(d.field)) return !1;
814   - if (-1 !== a.inArray(h[d.field], d.values)) {
815   - var i = e.$selectItem.filter(":enabled").filter(c('[data-index="%s"]', g)).prop("checked", b);
816   - h[e.header.stateField] = b, f.push(h), e.trigger(b ? "check" : "uncheck", h, i)
817   - }
818   - }), this.updateSelected(), this.trigger(b ? "check-some" : "uncheck-some", f)
819   - }
820   - }, p.prototype.destroy = function () {
821   - this.$el.insertBefore(this.$container), a(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") || "")
822   - }, p.prototype.showLoading = function () {
823   - this.$tableLoading.show()
824   - }, p.prototype.hideLoading = function () {
825   - this.$tableLoading.hide()
826   - }, p.prototype.togglePagination = function () {
827   - this.options.pagination = !this.options.pagination;
828   - var a = this.$toolbar.find('button[name="paginationSwitch"] i');
829   - this.options.pagination ? a.attr("class", this.options.iconsPrefix + " " + this.options.icons.paginationSwitchDown) : a.attr("class", this.options.iconsPrefix + " " + this.options.icons.paginationSwitchUp), this.updatePagination()
830   - }, p.prototype.refresh = function (a) {
831   - a && a.url && (this.options.pageNumber = 1), this.initServer(a && a.silent, a && a.query, a && a.url), this.trigger("refresh", a)
832   - }, p.prototype.resetWidth = function () {
833   - this.options.showHeader && this.options.height && this.fitHeader(), this.options.showFooter && this.fitFooter()
834   - }, p.prototype.showColumn = function (a) {
835   - this.toggleColumn(e(this.columns, a), !0, !0)
836   - }, p.prototype.hideColumn = function (a) {
837   - this.toggleColumn(e(this.columns, a), !1, !0)
838   - }, p.prototype.getHiddenColumns = function () {
839   - return a.grep(this.columns, function (a) {
840   - return !a.visible
841   - })
842   - }, p.prototype.getVisibleColumns = function () {
843   - return a.grep(this.columns, function (a) {
844   - return a.visible
845   - })
846   - }, p.prototype.toggleAllColumns = function (b) {
847   - if (a.each(this.columns, function (a) {
848   - this.columns[a].visible = b
849   - }), this.initHeader(), this.initSearch(), this.initPagination(), this.initBody(), this.options.showColumns) {
850   - var c = this.$toolbar.find(".keep-open input").prop("disabled", !1);
851   - c.filter(":checked").length <= this.options.minimumCountColumns && c.filter(":checked").prop("disabled", !0)
852   - }
853   - }, p.prototype.showAllColumns = function () {
854   - this.toggleAllColumns(!0)
855   - }, p.prototype.hideAllColumns = function () {
856   - this.toggleAllColumns(!1)
857   - }, p.prototype.filterBy = function (b) {
858   - this.filterColumns = a.isEmptyObject(b) ? {} : b, this.options.pageNumber = 1, this.initSearch(), this.updatePagination()
859   - }, p.prototype.scrollTo = function (a) {
860   - return "string" == typeof a && (a = "bottom" === a ? this.$tableBody[0].scrollHeight : 0), "number" == typeof a && this.$tableBody.scrollTop(a), "undefined" == typeof a ? this.$tableBody.scrollTop() : void 0
861   - }, p.prototype.getScrollPosition = function () {
862   - return this.scrollTo()
863   - }, p.prototype.selectPage = function (a) {
864   - a > 0 && a <= this.options.totalPages && (this.options.pageNumber = a, this.updatePagination())
865   - }, p.prototype.prevPage = function () {
866   - this.options.pageNumber > 1 && (this.options.pageNumber--, this.updatePagination())
867   - }, p.prototype.nextPage = function () {
868   - this.options.pageNumber < this.options.totalPages && (this.options.pageNumber++, this.updatePagination())
869   - }, p.prototype.toggleView = function () {
870   - this.options.cardView = !this.options.cardView, this.initHeader(), this.initBody(), this.trigger("toggle", this.options.cardView)
871   - }, p.prototype.refreshOptions = function (b) {
872   - i(this.options, b, !0) || (this.options = a.extend(this.options, b), this.trigger("refresh-options", this.options), this.destroy(), this.init())
873   - }, p.prototype.resetSearch = function (a) {
874   - var b = this.$toolbar.find(".search input");
875   - b.val(a || ""), this.onSearch({currentTarget: b})
876   - }, p.prototype.expandRow_ = function (a, b) {
877   - var d = this.$body.find(c('> tr[data-index="%s"]', b));
878   - d.next().is("tr.detail-view") === (a ? !1 : !0) && d.find("> td > .detail-icon").click()
879   - }, p.prototype.expandRow = function (a) {
880   - this.expandRow_(!0, a)
881   - }, p.prototype.collapseRow = function (a) {
882   - this.expandRow_(!1, a)
883   - }, p.prototype.expandAllRows = function (b) {
884   - if (b) {
885   - var d = this.$body.find(c('> tr[data-index="%s"]', 0)), e = this, f = null, g = !1, h = -1;
886   - if (d.next().is("tr.detail-view") ? d.next().next().is("tr.detail-view") || (d.next().find(".detail-icon").click(), g = !0) : (d.find("> td > .detail-icon").click(), g = !0), g) try {
887   - h = setInterval(function () {
888   - f = e.$body.find("tr.detail-view").last().find(".detail-icon"), f.length > 0 ? f.click() : clearInterval(h)
889   - }, 1)
890   - } catch (i) {
891   - clearInterval(h)
892   - }
893   - } else for (var j = this.$body.children(), k = 0; k < j.length; k++) this.expandRow_(!0, a(j[k]).data("index"))
894   - }, p.prototype.collapseAllRows = function (b) {
895   - if (b) this.expandRow_(!1, 0); else for (var c = this.$body.children(), d = 0; d < c.length; d++) this.expandRow_(!1, a(c[d]).data("index"))
896   - }, p.prototype.updateFormatText = function (a, b) {
897   - this.options[c("format%s", a)] && ("string" == typeof b ? this.options[c("format%s", a)] = function () {
898   - return b
899   - } : "function" == typeof b && (this.options[c("format%s", a)] = b)), this.initToolbar(), this.initPagination(), this.initBody()
900   - };
901   - var q = ["getOptions", "getSelections", "getAllSelections", "getData", "load", "append", "prepend", "remove", "removeAll", "insertRow", "updateRow", "updateCell", "updateByUniqueId", "removeByUniqueId", "getRowByUniqueId", "showRow", "hideRow", "getRowsHidden", "mergeCells", "checkAll", "uncheckAll", "checkInvert", "check", "uncheck", "checkBy", "uncheckBy", "refresh", "resetView", "resetWidth", "destroy", "showLoading", "hideLoading", "showColumn", "hideColumn", "getHiddenColumns", "getVisibleColumns", "showAllColumns", "hideAllColumns", "filterBy", "scrollTo", "getScrollPosition", "selectPage", "prevPage", "nextPage", "togglePagination", "toggleView", "refreshOptions", "resetSearch", "expandRow", "collapseRow", "expandAllRows", "collapseAllRows", "updateFormatText","getRowByIndex"];
902   - a.fn.bootstrapTable = function (b) {
903   - var c, d = Array.prototype.slice.call(arguments, 1);
904   - return this.each(function () {
905   - var e = a(this), f = e.data("bootstrap.table"),
906   - g = a.extend({}, p.DEFAULTS, e.data(), "object" == typeof b && b);
907   - if ("string" == typeof b) {
908   - if (a.inArray(b, q) < 0) throw new Error("Unknown method: " + b);
909   - if (!f) return;
910   - c = f[b].apply(f, d), "destroy" === b && e.removeData("bootstrap.table")
911   - }
912   - f || e.data("bootstrap.table", f = new p(this, g))
913   - }), "undefined" == typeof c ? this : c
914   - }, a.fn.bootstrapTable.Constructor = p, a.fn.bootstrapTable.defaults = p.DEFAULTS, a.fn.bootstrapTable.columnDefaults = p.COLUMN_DEFAULTS, a.fn.bootstrapTable.locales = p.LOCALES, a.fn.bootstrapTable.methods = q, a.fn.bootstrapTable.utils = {
915   - sprintf: c,
916   - getFieldIndex: e,
917   - compareObjects: i,
918   - calculateObjectValue: h,
919   - getItemField: m,
920   - objectKeys: o,
921   - isIEBrowser: n
922   - }, a(function () {
923   - a('[data-toggle="table"]').bootstrapTable()
924   - })
925   -}(jQuery);
926 1 \ No newline at end of file
  2 +/**
  3 + * @author zhixin wen <wenzhixin2010@gmail.com>
  4 + * version: 1.11.0
  5 + * https://github.com/wenzhixin/bootstrap-table/
  6 + */
  7 +(function(j){var k=null;var m=function(u){var s=arguments,r=true,t=1;u=u.replace(/%s/g,function(){var v=s[t++];if(typeof v==="undefined"){r=false;return""}return v});return r?u:""};var c=function(t,v,u,s){var r="";j.each(t,function(w,x){if(x[v]===s){r=x[u];return false}return true});return r};var i=function(s,t){var r=-1;j.each(s,function(u,v){if(v.field===t){r=u;return false}return true});return r};var l=function(u){var y,x,w,A=0,B=[];for(y=0;y<u[0].length;y++){A+=u[0][y].colspan||1}for(y=0;y<u.length;y++){B[y]=[];for(x=0;x<A;x++){B[y][x]=false}}for(y=0;y<u.length;y++){for(x=0;x<u[y].length;x++){var s=u[y][x],v=s.rowspan||1,t=s.colspan||1,z=j.inArray(false,B[y]);if(t===1){s.fieldIndex=z;if(typeof s.field==="undefined"){s.field=z}}for(w=0;w<v;w++){B[y+w][z]=true}for(w=0;w<t;w++){B[y][z+w]=true}}}};var a=function(){if(k===null){var t=j("<p/>").addClass("fixed-table-scroll-inner"),u=j("<div/>").addClass("fixed-table-scroll-outer"),s,r;u.append(t);j("body").append(u);s=t[0].offsetWidth;u.css("overflow","scroll");r=t[0].offsetWidth;if(s===r){r=u[0].clientWidth}u.remove();k=s-r}return k};var q=function(s,u,t,r){var v=u;if(typeof u==="string"){var w=u.split(".");if(w.length>1){v=window;j.each(w,function(x,y){v=v[y]})}else{v=window[u]}}if(typeof v==="object"){return v}if(typeof v==="function"){return v.apply(s,t)}if(!v&&typeof u==="string"&&m.apply(this,[u].concat(t))){return m.apply(this,[u].concat(t))}return r};var f=function(s,r,w){var x=Object.getOwnPropertyNames(s),u=Object.getOwnPropertyNames(r),v="";if(w){if(x.length!==u.length){return false}}for(var t=0;t<x.length;t++){v=x[t];if(j.inArray(v,u)>-1){if(s[v]!==r[v]){return false}}}return true};var p=function(r){if(typeof r==="string"){return r.replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;").replace(/"/g,"&quot;").replace(/'/g,"&#039;").replace(/`/g,"&#x60;")}return r};var d=function(s){var r=0;s.children().each(function(){if(r<j(this).outerHeight(true)){r=j(this).outerHeight(true)}});return r};var g=function(t){for(var r in t){var s=r.split(/(?=[A-Z])/).join("-").toLowerCase();if(s!==r){t[s]=t[r];delete t[r]}}return t};var o=function(t,w,s){var u=t;if(typeof w!=="string"||t.hasOwnProperty(w)){return s?p(t[w]):t[w]}var r=w.split(".");for(var v in r){u=u&&u[r[v]]}return s?p(u):u};var b=function(){return !!(navigator.userAgent.indexOf("MSIE ")>0||!!navigator.userAgent.match(/Trident.*rv\:11\./))};var h=function(){if(!Object.keys){Object.keys=(function(){var t=Object.prototype.hasOwnProperty,u=!({toString:null}).propertyIsEnumerable("toString"),s=["toString","toLocaleString","valueOf","hasOwnProperty","isPrototypeOf","propertyIsEnumerable","constructor"],r=s.length;return function(x){if(typeof x!=="object"&&(typeof x!=="function"||x===null)){throw new TypeError("Object.keys called on non-object")}var v=[],y,w;for(y in x){if(t.call(x,y)){v.push(y)}}if(u){for(w=0;w<r;w++){if(t.call(x,s[w])){v.push(s[w])}}}return v}}())}};var e=function(s,r){this.options=r;this.$el=j(s);this.$el_=this.$el.clone();this.timeoutId_=0;this.timeoutFooter_=0;this.init()};e.DEFAULTS={id:undefined,classes:"table table-hover",locale:undefined,height:undefined,undefinedText:"-",sortName:undefined,sortOrder:"asc",sortStable:false,striped:false,columns:[[]],data:[],dataField:"rows",method:"get",url:undefined,ajax:undefined,cache:true,contentType:"application/json",dataType:"json",ajaxOptions:{},queryParams:function(r){return r},queryParamsType:"limit",responseHandler:function(r){return r},pagination:false,onlyInfoPagination:false,sidePagination:"client",totalRows:0,pageNumber:1,pageSize:10,pageList:[10,25,50,100],paginationHAlign:"right",paginationVAlign:"bottom",paginationDetailHAlign:"left",paginationPreText:"&lsaquo;",paginationNextText:"&rsaquo;",search:false,searchOnEnterKey:false,strictSearch:false,searchAlign:"right",selectItemName:"btSelectItem",showHeader:true,showFooter:false,showColumns:false,showSearch:false,showPageGo:false,showPaginationSwitch:false,showRefresh:false,showToggle:false,buttonsAlign:"right",smartDisplay:true,escape:false,firstLoad:true,minimumCountColumns:1,idField:undefined,uniqueId:undefined,cardView:false,detailView:false,detailFormatter:function(r,s){return""},trimOnSearch:true,clickToSelect:false,singleSelect:false,toolbar:undefined,toolbarAlign:"left",checkboxHeader:true,sortable:true,silentSort:true,maintainSelected:false,searchTimeOut:500,searchText:"",iconSize:undefined,buttonsClass:"default",iconsPrefix:"glyphicon",icons:{search:"glyphicon-search",paginationSwitchDown:"glyphicon-collapse-down icon-chevron-down",paginationSwitchUp:"glyphicon-collapse-up icon-chevron-up",refresh:"glyphicon-refresh icon-refresh",toggle:"glyphicon-list-alt icon-list-alt",columns:"glyphicon-th icon-th",detailOpen:"glyphicon-plus icon-plus",detailClose:"glyphicon-minus icon-minus"},customSearch:j.noop,customSort:j.noop,rowStyle:function(s,r){return{}},rowAttributes:function(s,r){return{}},footerStyle:function(s,r){return{}},onAll:function(s,r){return false},onClickCell:function(t,s,u,r){return false},onDblClickCell:function(t,s,u,r){return false},onClickRow:function(s,r){return false},onDblClickRow:function(s,r){return false},onSort:function(s,r){return false},onCheck:function(r){return false},onUncheck:function(r){return false},onCheckAll:function(r){return false},onUncheckAll:function(r){return false},onCheckSome:function(r){return false},onUncheckSome:function(r){return false},onLoadSuccess:function(r){return false},onLoadError:function(r){return false},onColumnSwitch:function(s,r){return false},onPageChange:function(s,r){return false},onSearch:function(r){return false},onShowSearch:function(){return false},onToggle:function(r){return false},onPreBody:function(r){return false},onPostBody:function(){return false},onPostHeader:function(){return false},onExpandRow:function(r,t,s){return false},onCollapseRow:function(r,s){return false},onRefreshOptions:function(r){return false},onRefresh:function(r){return false},onResetView:function(){return false}};e.LOCALES={};e.LOCALES["en-US"]=e.LOCALES.en={formatLoadingMessage:function(){return"Loading, please wait..."},formatRecordsPerPage:function(r){return m("%s rows per page",r)},formatShowingRows:function(t,r,s){return m("Showing %s to %s of %s rows",t,r,s)},formatPageGo:function(){return"跳转"},formatDetailPagination:function(r){return m("Showing %s rows",r)},formatSearch:function(){return"Search"},formatNoMatches:function(){return"No matching records found"},formatPaginationSwitch:function(){return"Hide/Show pagination"},formatRefresh:function(){return"Refresh"},formatToggle:function(){return"Toggle"},formatColumns:function(){return"Columns"},formatAllRows:function(){return"All"}};j.extend(e.DEFAULTS,e.LOCALES["en-US"]);e.COLUMN_DEFAULTS={radio:false,checkbox:false,checkboxEnabled:true,field:undefined,title:undefined,titleTooltip:undefined,"class":undefined,align:undefined,halign:undefined,falign:undefined,valign:undefined,width:undefined,sortable:false,order:"asc",visible:true,switchable:true,clickToSelect:true,formatter:undefined,footerFormatter:undefined,events:undefined,sorter:undefined,sortName:undefined,cellStyle:undefined,searchable:true,searchFormatter:true,cardVisible:true};e.EVENTS={"all.bs.table":"onAll","click-cell.bs.table":"onClickCell","dbl-click-cell.bs.table":"onDblClickCell","click-row.bs.table":"onClickRow","dbl-click-row.bs.table":"onDblClickRow","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","show-search.bs.table":"onShowSearch","pre-body.bs.table":"onPreBody","post-body.bs.table":"onPostBody","post-header.bs.table":"onPostHeader","expand-row.bs.table":"onExpandRow","collapse-row.bs.table":"onCollapseRow","refresh-options.bs.table":"onRefreshOptions","reset-view.bs.table":"onResetView","refresh.bs.table":"onRefresh"};e.prototype.init=function(){this.initLocale();this.initContainer();this.initTable();this.initHeader();this.initData();this.initFooter();this.initToolbar();this.initPagination();this.initBody();this.initSearchText();this.initServer()};e.prototype.initLocale=function(){if(this.options.locale){var r=this.options.locale.split(/-|_/);r[0].toLowerCase();if(r[1]){r[1].toUpperCase()}if(j.fn.bootstrapTable.locales[this.options.locale]){j.extend(this.options,j.fn.bootstrapTable.locales[this.options.locale])}else{if(j.fn.bootstrapTable.locales[r.join("-")]){j.extend(this.options,j.fn.bootstrapTable.locales[r.join("-")])}else{if(j.fn.bootstrapTable.locales[r[0]]){j.extend(this.options,j.fn.bootstrapTable.locales[r[0]])}}}}};e.prototype.initContainer=function(){this.$container=j(['<div class="bootstrap-table">','<div class="fixed-table-toolbar"></div>',this.options.paginationVAlign==="top"||this.options.paginationVAlign==="both"?'<div class="fixed-table-pagination" style="clear: both;"></div>':"",'<div class="fixed-table-container">','<div class="fixed-table-header"><table></table></div>','<div class="fixed-table-body">','<div class="fixed-table-loading">',this.options.formatLoadingMessage(),"</div>","</div>",'<div class="fixed-table-footer"><table><tr></tr></table></div>',this.options.paginationVAlign==="bottom"||this.options.paginationVAlign==="both"?'<div class="fixed-table-pagination"></div>':"","</div>","</div>"].join(""));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.$container.find(".fixed-table-footer");this.$toolbar=this.$container.find(".fixed-table-toolbar");this.$pagination=this.$container.find(".fixed-table-pagination");this.$tableBody.append(this.$el);this.$container.after('<div class="clearfix"></div>');this.$el.addClass(this.options.classes);if(this.options.striped){this.$el.addClass("table-striped")}if(j.inArray("table-no-bordered",this.options.classes.split(" "))!==-1){this.$tableContainer.addClass("table-no-bordered")}};e.prototype.initTable=function(){var t=this,s=[],u=[];this.$header=this.$el.find(">thead");if(!this.$header.length){this.$header=j("<thead></thead>").appendTo(this.$el)}this.$header.find("tr").each(function(){var v=[];j(this).find("th").each(function(){if(typeof j(this).data("field")!=="undefined"){j(this).data("field",j(this).data("field")+"")}v.push(j.extend({},{title:j(this).html(),"class":j(this).attr("class"),titleTooltip:j(this).attr("title"),rowspan:j(this).attr("rowspan")?+j(this).attr("rowspan"):undefined,colspan:j(this).attr("colspan")?+j(this).attr("colspan"):undefined},j(this).data()))});s.push(v)});if(!j.isArray(this.options.columns[0])){this.options.columns=[this.options.columns]}this.options.columns=j.extend(true,[],s,this.options.columns);this.columns=[];l(this.options.columns);j.each(this.options.columns,function(w,v){j.each(v,function(x,y){y=j.extend({},e.COLUMN_DEFAULTS,y);if(typeof y.fieldIndex!=="undefined"){t.columns[y.fieldIndex]=y}t.options.columns[w][x]=y})});if(this.options.data.length){return}var r=[];this.$el.find(">tbody>tr").each(function(w){var v={};v._id=j(this).attr("id");v._class=j(this).attr("class");v._data=g(j(this).data());j(this).find(">td").each(function(z){var E=j(this),B=+E.attr("colspan")||1,C=+E.attr("rowspan")||1,A,y;for(;r[w]&&r[w][z];z++){}for(A=z;A<z+B;A++){for(y=w;y<w+C;y++){if(!r[y]){r[y]=[]}r[y][A]=true}}var D=t.columns[z].field;v[D]=j(this).html();v["_"+D+"_id"]=j(this).attr("id");v["_"+D+"_class"]=j(this).attr("class");v["_"+D+"_rowspan"]=j(this).attr("rowspan");v["_"+D+"_colspan"]=j(this).attr("colspan");v["_"+D+"_title"]=j(this).attr("title");v["_"+D+"_data"]=g(j(this).data())});u.push(v)});this.options.data=u;if(u.length){this.fromHtml=true}};e.prototype.initHeader=function(){var t=this,r={},s=[];this.header={fields:[],styles:[],classes:[],formatters:[],events:[],sorters:[],sortNames:[],cellStyles:[],searchables:[]};j.each(this.options.columns,function(v,u){s.push("<tr>");if(v===0&&!t.options.cardView&&t.options.detailView){s.push(m('<th class="detail" rowspan="%s"><div class="fht-cell"></div></th>',t.options.columns.length))}j.each(u,function(B,A){var F="",C="",E="",w="",D=m(' class="%s"',A["class"]),z=t.options.sortOrder||A.order,y="px",x=A.width;if(A.width!==undefined&&(!t.options.cardView)){if(typeof A.width==="string"){if(A.width.indexOf("%")!==-1){y="%"}}}if(A.width&&typeof A.width==="string"){x=A.width.replace("%","").replace("px","")}C=m("text-align: %s; ",A.halign?A.halign:A.align);E=m("text-align: %s; ",A.align);w=m("vertical-align: %s; ",A.valign);w+=m("width: %s; ",(A.checkbox||A.radio)&&!x?"36px":(x?x+y:undefined));if(typeof A.fieldIndex!=="undefined"){t.header.fields[A.fieldIndex]=A.field;t.header.styles[A.fieldIndex]=E+w;t.header.classes[A.fieldIndex]=D;t.header.formatters[A.fieldIndex]=A.formatter;t.header.events[A.fieldIndex]=A.events;t.header.sorters[A.fieldIndex]=A.sorter;t.header.sortNames[A.fieldIndex]=A.sortName;t.header.cellStyles[A.fieldIndex]=A.cellStyle;t.header.searchables[A.fieldIndex]=A.searchable;if(!A.visible){return}if(t.options.cardView&&(!A.cardVisible)){return}r[A.field]=A}s.push("<th"+m(' title="%s"',A.titleTooltip),A.checkbox||A.radio?m(' class="bs-checkbox %s"',A["class"]||""):D,m(' style="%s"',C+w),m(' rowspan="%s"',A.rowspan),m(' colspan="%s"',A.colspan),m(' data-field="%s"',A.field),"tabindex='0'",">");s.push(m('<div class="th-inner %s">',t.options.sortable&&A.sortable?"sortable both":""));F=A.title;if(A.checkbox){if(!t.options.singleSelect&&t.options.checkboxHeader){F='<input name="btSelectAll" type="checkbox" />'}t.header.stateField=A.field}if(A.radio){F="";t.header.stateField=A.field;t.options.singleSelect=true}s.push(F);s.push("</div>");s.push('<div class="fht-cell"></div>');s.push("</div>");s.push("</th>")});s.push("</tr>")});this.$header.html(s.join(""));this.$header.find("th[data-field]").each(function(u){j(this).data(r[j(this).data("field")])});this.$container.off("click",".th-inner").on("click",".th-inner",function(u){var v=j(this);if(t.options.detailView){if(v.closest(".bootstrap-table")[0]!==t.$container[0]){return false}}if(t.options.sortable&&v.parent().data().sortable){t.onSort(u)}});this.$header.children().children().off("keypress").on("keypress",function(v){if(t.options.sortable&&j(this).data().sortable){var u=v.keyCode||v.which;if(u==13){t.onSort(v)}}});j(window).off("resize.bootstrap-table");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();j(window).on("resize.bootstrap-table",j.proxy(this.resetWidth,this))}this.$selectAll=this.$header.find('[name="btSelectAll"]');this.$selectAll.off("click").on("click",function(){var u=j(this).prop("checked");t[u?"checkAll":"uncheckAll"]();t.updateSelected()})};e.prototype.initFooter=function(){if(!this.options.showFooter||this.options.cardView){this.$tableFooter.hide()}else{this.$tableFooter.show()}};e.prototype.initData=function(s,r){if(r==="append"){this.data=this.data.concat(s)}else{if(r==="prepend"){this.data=[].concat(s).concat(this.data)}else{this.data=s||this.options.data}}if(r==="append"){this.options.data=this.options.data.concat(s)}else{if(r==="prepend"){this.options.data=[].concat(s).concat(this.options.data)}else{this.options.data=this.data}}if(this.options.sidePagination==="server"){return}this.initSort()};e.prototype.initSort=function(){var u=this,t=this.options.sortName,r=this.options.sortOrder==="desc"?-1:1,s=j.inArray(this.options.sortName,this.header.fields);if(this.options.customSort!==j.noop){this.options.customSort.apply(this,[this.options.sortName,this.options.sortOrder]);return}if(s!==-1){if(this.options.sortStable){j.each(this.data,function(v,w){if(!w.hasOwnProperty("_position")){w._position=v}})}this.data.sort(function(w,v){if(u.header.sortNames[s]){t=u.header.sortNames[s]}var y=o(w,t,u.options.escape),z=o(v,t,u.options.escape),x=q(u.header,u.header.sorters[s],[y,z]);if(x!==undefined){return r*x}if(y===undefined||y===null){y=""}if(z===undefined||z===null){z=""}if(u.options.sortStable&&y===z){y=w._position;z=v._position}if(j.isNumeric(y)&&j.isNumeric(z)){y=parseFloat(y);z=parseFloat(z);if(y<z){return r*-1}return r}if(y===z){return 0}if(typeof y!=="string"){y=y.toString()}if(y.localeCompare(z)===-1){return r*-1}return r})}};e.prototype.onSort=function(r){var t=r.type==="keypress"?j(r.currentTarget):j(r.currentTarget).parent(),s=this.$header.find("th").eq(t.index());this.$header.add(this.$header_).find("span.order").remove();if(this.options.sortName===t.data("field")){this.options.sortOrder=this.options.sortOrder==="asc"?"desc":"asc"}else{this.options.sortOrder=t.data("order")==="asc"?"desc":"asc"}this.options.sortName=t.data("sortName")?t.data("sortName"):t.data("field");this.trigger("sort",this.options.sortName,this.options.sortOrder);t.add(s).data("order",this.options.sortOrder);this.getCaret();if(this.options.sidePagination==="server"){this.initServer(this.options.silentSort);return}this.initSort();this.initBody()};e.prototype.initToolbar=function(){var u=this,t=[],w=0,s,v,r=0;if(this.$toolbar.find(".bs-bars").children().length){j("body").append(j(this.options.toolbar))}this.$toolbar.html("");if(typeof this.options.toolbar==="string"||typeof this.options.toolbar==="object"){j(m('<div class="bs-bars pull-%s"></div>',this.options.toolbarAlign)).appendTo(this.$toolbar).append(j(this.options.toolbar))}t=[m('<div class="columns columns-%s btn-group pull-%s">',this.options.buttonsAlign,this.options.buttonsAlign)];if(typeof this.options.icons==="string"){this.options.icons=q(null,this.options.icons)}if(this.options.showSearch){t.push(m('<button class="btn'+m(" btn-%s",this.options.buttonsClass)+m(" btn-%s",this.options.iconSize)+'" type="button" name="showSearch" title="%s">',this.options.formatSearch()),m('<i class="%s %s"></i>',this.options.iconsPrefix,this.options.icons.search),"</button>")}if(this.options.showPaginationSwitch){t.push(m('<button class="btn'+m(" btn-%s",this.options.buttonsClass)+m(" btn-%s",this.options.iconSize)+'" type="button" name="paginationSwitch" title="%s">',this.options.formatPaginationSwitch()),m('<i class="%s %s"></i>',this.options.iconsPrefix,this.options.icons.paginationSwitchDown),"</button>")}if(this.options.showRefresh){t.push(m('<button class="btn'+m(" btn-%s",this.options.buttonsClass)+m(" btn-%s",this.options.iconSize)+'" type="button" name="refresh" title="%s">',this.options.formatRefresh()),m('<i class="%s %s"></i>',this.options.iconsPrefix,this.options.icons.refresh),"</button>")}if(this.options.showToggle){t.push(m('<button class="btn'+m(" btn-%s",this.options.buttonsClass)+m(" btn-%s",this.options.iconSize)+'" type="button" name="toggle" title="%s">',this.options.formatToggle()),m('<i class="%s %s"></i>',this.options.iconsPrefix,this.options.icons.toggle),"</button>")}if(this.options.showColumns){t.push(m('<div class="keep-open btn-group" title="%s">',this.options.formatColumns()),'<button type="button" class="btn'+m(" btn-%s",this.options.buttonsClass)+m(" btn-%s",this.options.iconSize)+' dropdown-toggle" data-toggle="dropdown">',m('<i class="%s %s"></i>',this.options.iconsPrefix,this.options.icons.columns),' <span class="caret"></span>',"</button>",'<ul class="dropdown-menu" role="menu">');j.each(this.columns,function(x,y){if(y.radio||y.checkbox){return}if(u.options.cardView&&!y.cardVisible){return}var z=y.visible?' checked="checked"':"";if(y.switchable){t.push(m("<li>"+'<label><input type="checkbox" data-field="%s" value="%s"%s> %s</label>'+"</li>",y.field,x,z,y.title));r++}});t.push("</ul>","</div>")}t.push("</div>");if(this.showToolbar||t.length>2){this.$toolbar.append(t.join(""))}if(this.options.showPaginationSwitch){this.$toolbar.find('button[name="paginationSwitch"]').off("click").on("click",j.proxy(this.togglePagination,this))}if(this.options.showRefresh){this.$toolbar.find('button[name="refresh"]').off("click").on("click",j.proxy(this.refresh,this))}if(this.options.showToggle){this.$toolbar.find('button[name="toggle"]').off("click").on("click",function(){u.toggleView()})}if(this.options.showSearch){this.$toolbar.find('button[name="showSearch"]').off("click").on("click",function(){j(this).parents(".select-table").siblings().slideToggle()})}if(this.options.showColumns){s=this.$toolbar.find(".keep-open");if(r<=this.options.minimumCountColumns){s.find("input").prop("disabled",true)}s.find("li").off("click").on("click",function(x){x.stopImmediatePropagation()});s.find("input").off("click").on("click",function(){var x=j(this);u.toggleColumn(j(this).val(),x.prop("checked"),false);u.trigger("column-switch",j(this).data("field"),x.prop("checked"))})}if(this.options.search){t=[];t.push('<div class="pull-'+this.options.searchAlign+' search">',m('<input class="form-control'+m(" input-%s",this.options.iconSize)+'" type="text" placeholder="%s">',this.options.formatSearch()),"</div>");this.$toolbar.append(t.join(""));v=this.$toolbar.find(".search input");v.off("keyup drop").on("keyup drop",function(x){if(u.options.searchOnEnterKey&&x.keyCode!==13){return}if(j.inArray(x.keyCode,[37,38,39,40])>-1){return}clearTimeout(w);w=setTimeout(function(){u.onSearch(x)},u.options.searchTimeOut)});if(b()){v.off("mouseup").on("mouseup",function(x){clearTimeout(w);w=setTimeout(function(){u.onSearch(x)},u.options.searchTimeOut)})}}};e.prototype.onSearch=function(r){var s=j.trim(j(r.currentTarget).val());if(this.options.trimOnSearch&&j(r.currentTarget).val()!==s){j(r.currentTarget).val(s)}if(s===this.searchText){return}this.searchText=s;this.options.searchText=s;this.options.pageNumber=1;this.initSearch();this.updatePagination();this.trigger("search",s)};e.prototype.initSearch=function(){var t=this;if(this.options.sidePagination!=="server"){if(this.options.customSearch!==j.noop){this.options.customSearch.apply(this,[this.searchText]);return}var r=this.searchText&&(this.options.escape?p(this.searchText):this.searchText).toLowerCase();var u=j.isEmptyObject(this.filterColumns)?null:this.filterColumns;this.data=u?j.grep(this.options.data,function(w,v){for(var s in u){if(j.isArray(u[s])&&j.inArray(w[s],u[s])===-1||w[s]!==u[s]){return false}}return true}):this.options.data;this.data=r?j.grep(this.data,function(A,x){for(var v=0;v<t.header.fields.length;v++){if(!t.header.searchables[v]){continue}var w=j.isNumeric(t.header.fields[v])?parseInt(t.header.fields[v],10):t.header.fields[v];var z=t.columns[i(t.columns,w)];var B;if(typeof w==="string"){B=A;var y=w.split(".");for(var s=0;s<y.length;s++){B=B[y[s]]}if(z&&z.searchFormatter){B=q(z,t.header.formatters[v],[B,A,x],B)}}else{B=A[w]}if(typeof B==="string"||typeof B==="number"){if(t.options.strictSearch){if((B+"").toLowerCase()===r){return true}}else{if((B+"").toLowerCase().indexOf(r)!==-1){return true}}}}return false}):this.data}};e.prototype.initPagination=function(){if(!this.options.pagination){this.$pagination.hide();return}else{this.$pagination.show()}var v=this,x=[],r=false,A,z,s,w,G,I,E,y,u,J=this.getData(),t=this.options.pageList;if(this.options.sidePagination!=="server"){this.options.totalRows=J.length}this.totalPages=0;if(this.options.totalRows){if(this.options.pageSize===this.options.formatAllRows()){this.options.pageSize=this.options.totalRows;r=true}else{if(this.options.pageSize===this.options.totalRows){var H=typeof this.options.pageList==="string"?this.options.pageList.replace("[","").replace("]","").replace(/ /g,"").toLowerCase().split(","):this.options.pageList;if(j.inArray(this.options.formatAllRows().toLowerCase(),H)>-1){r=true}}}this.totalPages=~~((this.options.totalRows-1)/this.options.pageSize)+1;this.options.totalPages=this.totalPages}if(this.totalPages>0&&this.options.pageNumber>this.totalPages){this.options.pageNumber=this.totalPages}this.pageFrom=(this.options.pageNumber-1)*this.options.pageSize+1;this.pageTo=this.options.pageNumber*this.options.pageSize;if(this.pageTo>this.options.totalRows){this.pageTo=this.options.totalRows}x.push('<div class="pull-'+this.options.paginationDetailHAlign+' pagination-detail">','<span class="pagination-info">',this.options.onlyInfoPagination?this.options.formatDetailPagination(this.options.totalRows):this.options.formatShowingRows(this.pageFrom,this.pageTo,this.options.totalRows),"</span>");if(!this.options.onlyInfoPagination){x.push('<span class="page-list">');var F=[m('<span class="btn-group %s">',this.options.paginationVAlign==="top"||this.options.paginationVAlign==="both"?"dropdown":"dropup"),'<button type="button" class="btn'+m(" btn-%s",this.options.buttonsClass)+m(" btn-%s",this.options.iconSize)+' dropdown-toggle" data-toggle="dropdown">','<span class="page-size">',r?this.options.formatAllRows():this.options.pageSize,"</span>",' <span class="caret"></span>',"</button>",'<ul class="dropdown-menu" role="menu">'];if(typeof this.options.pageList==="string"){var D=this.options.pageList.replace("[","").replace("]","").replace(/ /g,"").split(",");t=[];j.each(D,function(K,L){t.push(L.toUpperCase()===v.options.formatAllRows().toUpperCase()?v.options.formatAllRows():+L)})}j.each(t,function(K,L){if(!v.options.smartDisplay||K===0||t[K-1]<=v.options.totalRows){var M;if(r){M=L===v.options.formatAllRows()?' class="active"':""}else{M=L===v.options.pageSize?' class="active"':""}F.push(m('<li%s><a href="javascript:void(0)">%s</a></li>',M,L))}});F.push("</ul></span>");x.push(this.options.formatRecordsPerPage(F.join("")));x.push("</span>");x.push("</div>",'<div class="pull-'+this.options.paginationHAlign+' pagination">','<ul class="pagination'+m(" pagination-%s",this.options.iconSize)+'">','<li class="page-pre"><a href="javascript:void(0)">'+this.options.paginationPreText+"</a></li>");if(this.totalPages<5){z=1;s=this.totalPages}else{z=this.options.pageNumber-2;s=z+4;if(z<1){z=1;s=5}if(s>this.totalPages){s=this.totalPages;z=s-4}}if(this.totalPages>=6){if(this.options.pageNumber>=3){x.push('<li class="page-first'+(1===this.options.pageNumber?" active":"")+'">','<a href="javascript:void(0)">',1,"</a>","</li>");z++}if(this.options.pageNumber>=4){if(this.options.pageNumber==4||this.totalPages==6||this.totalPages==7){z--}else{x.push('<li class="page-first-separator disabled">','<a href="javascript:void(0)">...</a>',"</li>")}s--}}if(this.totalPages>=7){if(this.options.pageNumber>=(this.totalPages-2)){z--}}if(this.totalPages==6){if(this.options.pageNumber>=(this.totalPages-2)){s++}}else{if(this.totalPages>=7){if(this.totalPages==7||this.options.pageNumber>=(this.totalPages-3)){s++}}}for(A=z;A<=s;A++){x.push('<li class="page-number'+(A===this.options.pageNumber?" active":"")+'">','<a href="javascript:void(0)">',A,"</a>","</li>")}if(this.totalPages>=8){if(this.options.pageNumber<=(this.totalPages-4)){x.push('<li class="page-last-separator disabled">','<a href="javascript:void(0)">...</a>',"</li>")}}if(this.totalPages>=6){if(this.options.pageNumber<=(this.totalPages-3)){x.push('<li class="page-last'+(this.totalPages===this.options.pageNumber?" active":"")+'">','<a href="javascript:void(0)">',this.totalPages,"</a>","</li>")}}x.push('<li class="page-next"><a href="javascript:void(0)">'+this.options.paginationNextText+"</a></li>","</ul>","</div>")}this.$pagination.html(x.join(""));if(!this.options.onlyInfoPagination){w=this.$pagination.find(".page-list a");G=this.$pagination.find(".page-first");I=this.$pagination.find(".page-pre");E=this.$pagination.find(".page-next");y=this.$pagination.find(".page-last");u=this.$pagination.find(".page-number");if(this.options.smartDisplay){if(this.totalPages<=1){this.$pagination.find("div.pagination").hide()}if(t.length<2||this.options.totalRows<=t[0]){this.$pagination.find("span.page-list").hide()}this.$pagination[this.getData().length?"show":"hide"]()}if(r){this.options.pageSize=this.options.formatAllRows()}w.off("click").on("click",j.proxy(this.onPageListChange,this));G.off("click").on("click",j.proxy(this.onPageFirst,this));I.off("click").on("click",j.proxy(this.onPagePre,this));E.off("click").on("click",j.proxy(this.onPageNext,this));y.off("click").on("click",j.proxy(this.onPageLast,this));u.off("click").on("click",j.proxy(this.onPageNumber,this))}if(this.options.showPageGo){var v=this,C=this.$pagination.find("ul.pagination"),B=C.find("li.pageGo");if(!B.length){B=j(['<li class="pageGo">',m('<input type="text" class="form-control" value="%s">',this.options.pageNumber),'<button class="btn'+m(" btn-%s",this.options.buttonsClass)+m(" btn-%s",this.options.iconSize)+'" title="'+this.options.formatPageGo()+'" '+' type="button">'+this.options.formatPageGo(),"</button>","</li>"].join("")).appendTo(C);B.find("button").click(function(){var K=parseInt(B.find("input").val())||1;if(K<1||K>v.options.totalPages){K=1}v.selectPage(K)})}}};e.prototype.updatePagination=function(r){if(r&&j(r.currentTarget).hasClass("disabled")){return}if(!this.options.maintainSelected){this.resetRows()}this.initPagination();if(this.options.sidePagination==="server"){this.initServer()}else{this.initBody()}this.trigger("page-change",this.options.pageNumber,this.options.pageSize)};e.prototype.onPageListChange=function(r){var s=j(r.currentTarget);s.parent().addClass("active").siblings().removeClass("active");this.options.pageSize=s.text().toUpperCase()===this.options.formatAllRows().toUpperCase()?this.options.formatAllRows():+s.text();this.$toolbar.find(".page-size").text(this.options.pageSize);this.updatePagination(r)};e.prototype.onPageFirst=function(r){this.options.pageNumber=1;this.updatePagination(r)};e.prototype.onPagePre=function(r){if((this.options.pageNumber-1)===0){this.options.pageNumber=this.options.totalPages}else{this.options.pageNumber--}this.updatePagination(r)};e.prototype.onPageNext=function(r){if((this.options.pageNumber+1)>this.options.totalPages){this.options.pageNumber=1}else{this.options.pageNumber++}this.updatePagination(r)};e.prototype.onPageLast=function(r){this.options.pageNumber=this.totalPages;this.updatePagination(r)};e.prototype.onPageNumber=function(r){if(this.options.pageNumber===+j(r.currentTarget).text()){return}this.options.pageNumber=+j(r.currentTarget).text();this.updatePagination(r)};e.prototype.initBody=function(x){var z=this,y=[],v=this.getData();this.trigger("pre-body",v);this.$body=this.$el.find(">tbody");if(!this.$body.length){this.$body=j("<tbody></tbody>").appendTo(this.$el)}if(!this.options.pagination||this.options.sidePagination==="server"){this.pageFrom=1;this.pageTo=v.length}for(var w=this.pageFrom-1;w<this.pageTo;w++){var B,C=v[w],r={},s=[],t="",u={},A=[];r=q(this.options,this.options.rowStyle,[C,w],r);if(r&&r.css){for(B in r.css){s.push(B+": "+r.css[B])}}u=q(this.options,this.options.rowAttributes,[C,w],u);if(u){for(B in u){A.push(m('%s="%s"',B,p(u[B])))}}if(C._data&&!j.isEmptyObject(C._data)){j.each(C._data,function(E,D){if(E==="index"){return}t+=m(' data-%s="%s"',E,D)})}y.push("<tr",m(" %s",A.join(" ")),m(' id="%s"',j.isArray(C)?undefined:C._id),m(' class="%s"',r.classes||(j.isArray(C)?undefined:C._class)),m(' data-index="%s"',w),m(' data-uniqueid="%s"',C[this.options.uniqueId]),m("%s",t),">");if(this.options.cardView){y.push(m('<td colspan="%s"><div class="card-views">',this.header.fields.length))}if(!this.options.cardView&&this.options.detailView){y.push("<td>",'<a class="detail-icon" href="javascript:">',m('<i class="%s %s"></i>',this.options.iconsPrefix,this.options.icons.detailOpen),"</a>","</td>")}j.each(this.header.fields,function(I,L){var P="",M=o(C,L,z.options.escape),K="",E={},Q="",J=z.header.classes[I],G="",O="",R="",H="",F=z.columns[I];if(z.fromHtml&&typeof M==="undefined"){return}if(!F.visible){return}if(z.options.cardView&&!F.cardVisible){return}r=m('style="%s"',s.concat(z.header.styles[I]).join("; "));if(C["_"+L+"_id"]){Q=m(' id="%s"',C["_"+L+"_id"])}if(C["_"+L+"_class"]){J=m(' class="%s"',C["_"+L+"_class"])}if(C["_"+L+"_rowspan"]){O=m(' rowspan="%s"',C["_"+L+"_rowspan"])}if(C["_"+L+"_colspan"]){R=m(' colspan="%s"',C["_"+L+"_colspan"])}if(C["_"+L+"_title"]){H=m(' title="%s"',C["_"+L+"_title"])}E=q(z.header,z.header.cellStyles[I],[M,C,w,L],E);if(E.classes){J=m(' class="%s"',E.classes)}if(E.css){var D=[];for(var N in E.css){D.push(N+": "+E.css[N])}r=m('style="%s"',D.concat(z.header.styles[I]).join("; "))}M=q(F,z.header.formatters[I],[M,C,w],M);if(C["_"+L+"_data"]&&!j.isEmptyObject(C["_"+L+"_data"])){j.each(C["_"+L+"_data"],function(T,S){if(T==="index"){return}G+=m(' data-%s="%s"',T,S)})}if(F.checkbox||F.radio){K=F.checkbox?"checkbox":K;K=F.radio?"radio":K;P=[m(z.options.cardView?'<div class="card-view %s">':'<td class="bs-checkbox %s">',F["class"]||""),"<input"+m(' data-index="%s"',w)+m(' name="%s"',z.options.selectItemName)+m(' type="%s"',K)+m(' value="%s"',C[z.options.idField])+m(' checked="%s"',M===true||(M&&M.checked)?"checked":undefined)+m(' disabled="%s"',!F.checkboxEnabled||(M&&M.disabled)?"disabled":undefined)+" />",z.header.formatters[I]&&typeof M==="string"?M:"",z.options.cardView?"</div>":"</td>"].join("");C[z.header.stateField]=M===true||(M&&M.checked)}else{M=typeof M==="undefined"||M===null?z.options.undefinedText:M;P=z.options.cardView?['<div class="card-view">',z.options.showHeader?m('<span class="title" %s>%s</span>',r,c(z.columns,"field","title",L)):"",m('<span class="value">%s</span>',M),"</div>"].join(""):[m("<td%s %s %s %s %s %s %s>",Q,J,r,G,O,R,H),M,"</td>"].join("");if(z.options.cardView&&z.options.smartDisplay&&M===""){P='<div class="card-view"></div>'}}y.push(P)});if(this.options.cardView){y.push("</div></td>")}y.push("</tr>")}if(!y.length){y.push('<tr class="no-records-found">',m('<td colspan="%s">%s</td>',this.$header.find("th").length,this.options.formatNoMatches()),"</tr>")}this.$body.html(y.join(""));if(!x){this.scrollTo(0)}this.$body.find("> tr[data-index] > td").off("click dblclick").on("click dblclick",function(J){var D=j(this),F=D.parent(),M=z.data[F.data("index")],H=D[0].cellIndex,G=z.getVisibleFields(),K=G[z.options.detailView&&!z.options.cardView?H-1:H],E=z.columns[i(z.columns,K)],L=o(M,K,z.options.escape);if(D.find(".detail-icon").length){return}z.trigger(J.type==="click"?"click-cell":"dbl-click-cell",K,L,M,D);z.trigger(J.type==="click"?"click-row":"dbl-click-row",M,F,K);if(J.type==="click"&&z.options.clickToSelect&&E.clickToSelect){var I=F.find(m('[name="%s"]',z.options.selectItemName));if(I.length){I[0].click()}}});this.$body.find("> tr[data-index] > td > .detail-icon").off("click").on("click",function(){var H=j(this),G=H.parent().parent(),E=G.data("index"),I=v[E];if(G.next().is("tr.detail-view")){H.find("i").attr("class",m("%s %s",z.options.iconsPrefix,z.options.icons.detailOpen));G.next().remove();z.trigger("collapse-row",E,I)}else{H.find("i").attr("class",m("%s %s",z.options.iconsPrefix,z.options.icons.detailClose));G.after(m('<tr class="detail-view"><td colspan="%s"></td></tr>',G.find("td").length));var D=G.next().find("td");var F=q(z.options,z.options.detailFormatter,[E,I,D],"");if(D.length===1){D.append(F)}z.trigger("expand-row",E,I,D)}z.resetView()});this.$selectItem=this.$body.find(m('[name="%s"]',this.options.selectItemName));this.$selectItem.off("click").on("click",function(E){E.stopImmediatePropagation();var F=j(this),D=F.prop("checked"),G=z.data[F.data("index")];if(z.options.maintainSelected&&j(this).is(":radio")){j.each(z.options.data,function(H,I){I[z.header.stateField]=false})}G[z.header.stateField]=D;if(z.options.singleSelect){z.$selectItem.not(this).each(function(){z.data[j(this).data("index")][z.header.stateField]=false});z.$selectItem.filter(":checked").not(this).prop("checked",false)}z.updateSelected();z.trigger(D?"check":"uncheck",G,F)});j.each(this.header.events,function(G,F){if(!F){return}if(typeof F==="string"){F=q(null,F)}var H=z.header.fields[G],D=j.inArray(H,z.getVisibleFields());if(z.options.detailView&&!z.options.cardView){D+=1}for(var E in F){z.$body.find(">tr:not(.no-records-found)").each(function(){var M=j(this),N=M.find(z.options.cardView?".card-view":"td").eq(D),J=E.indexOf(" "),I=E.substring(0,J),K=E.substring(J+1),L=F[E];N.find(K).off(I).on(I,function(Q){var O=M.data("index"),R=z.data[O],P=R[H];L.apply(this,[Q,P,R,O])})})}});this.updateSelected();this.resetView();this.trigger("post-body",v)};e.prototype.initServer=function(r,w,s){var u=this,v={},x={searchText:this.searchText,sortName:this.options.sortName,sortOrder:this.options.sortOrder},t;if(this.options.pagination){x.pageSize=this.options.pageSize===this.options.formatAllRows()?this.options.totalRows:this.options.pageSize;x.pageNumber=this.options.pageNumber}if(!this.options.firstLoad&&!firstLoadTable.includes(this.options.id)){firstLoadTable.push(this.options.id);return}if(!(s||this.options.url)&&!this.options.ajax){return}if(this.options.queryParamsType==="limit"){x={search:x.searchText,sort:x.sortName,order:x.sortOrder};if(this.options.pagination){x.offset=this.options.pageSize===this.options.formatAllRows()?0:this.options.pageSize*(this.options.pageNumber-1);x.limit=this.options.pageSize===this.options.formatAllRows()?this.options.totalRows:this.options.pageSize}}if(!(j.isEmptyObject(this.filterColumnsPartial))){x.filter=JSON.stringify(this.filterColumnsPartial,null)}v=q(this.options,this.options.queryParams,[x],v);j.extend(v,w||{});if(v===false){return}if(!r){this.$tableLoading.show()}t=j.extend({},q(null,this.options.ajaxOptions),{type:this.options.method,url:s||this.options.url,data:this.options.contentType==="application/json"&&this.options.method==="post"?JSON.stringify(v):v,cache:this.options.cache,contentType:this.options.contentType,dataType:this.options.dataType,success:function(y){y=q(u.options,u.options.responseHandler,[y],y);u.load(y);u.trigger("load-success",y);if(!r){u.$tableLoading.hide()}},error:function(y){u.trigger("load-error",y.status,y);if(!r){u.$tableLoading.hide()}}});if(this.options.ajax){q(this,this.options.ajax,[t],null)}else{if(this._xhr&&this._xhr.readyState!==4){this._xhr.abort()}this._xhr=j.ajax(t)}};e.prototype.initSearchText=function(){if(this.options.search){if(this.options.searchText!==""){var r=this.$toolbar.find(".search input");r.val(this.options.searchText);this.onSearch({currentTarget:r})}}};e.prototype.getCaret=function(){var r=this;j.each(this.$header.find("th"),function(s,t){j(t).find(".sortable").removeClass("desc asc").addClass((j(t).data("field")===r.options.sortName||j(t).data("sortName")===r.options.sortName)?r.options.sortOrder:"both")})};e.prototype.updateSelected=function(){var r=this.$selectItem.filter(":enabled").length&&this.$selectItem.filter(":enabled").length===this.$selectItem.filter(":enabled").filter(":checked").length;var s=j(".left-fixed-table-columns input[name=btSelectItem]");if(s.length>0){r=this.$selectItem.filter(":enabled").length&&this.$selectItem.filter(":enabled").length===s.filter(":enabled").filter(":checked").length}this.$selectAll.add(this.$selectAll_).prop("checked",r);this.$selectItem.each(function(){j(this).closest("tr")[j(this).prop("checked")?"addClass":"removeClass"]("selected")})};e.prototype.updateRows=function(){var r=this;this.$selectItem.each(function(){r.data[j(this).data("index")][r.header.stateField]=j(this).prop("checked")})};e.prototype.resetRows=function(){var r=this;j.each(this.data,function(s,t){r.$selectAll.prop("checked",false);r.$selectItem.prop("checked",false);if(r.header.stateField){t[r.header.stateField]=false}})};e.prototype.trigger=function(s){var r=Array.prototype.slice.call(arguments,1);s+=".bs.table";this.options[e.EVENTS[s]].apply(this.options,r);this.$el.trigger(j.Event(s),r);this.options.onAll(s,r);this.$el.trigger(j.Event("all.bs.table"),[s,r])};e.prototype.resetHeader=function(){clearTimeout(this.timeoutId_);this.timeoutId_=setTimeout(j.proxy(this.fitHeader,this),this.$el.is(":hidden")?100:0)};e.prototype.fitHeader=function(){var t=this,u,r,x,y;if(t.$el.is(":hidden")){t.timeoutId_=setTimeout(j.proxy(t.fitHeader,t),100);return}u=this.$tableBody.get(0);r=u.scrollWidth>u.clientWidth&&u.scrollHeight>u.clientHeight+this.$header.outerHeight()?a():0;this.$el.css("margin-top",-this.$header.outerHeight());x=j(":focus");if(x.length>0){var z=x.parents("th");if(z.length>0){var A=z.attr("data-field");if(A!==undefined){var s=this.$header.find("[data-field='"+A+"']");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":r}).find("table").css("width",this.$el.outerWidth()).html("").attr("class",this.$el.attr("class")).append(this.$header_);y=j(".focus-temp:visible:eq(0)");if(y.length>0){y.focus();this.$header.find(".focus-temp").removeClass("focus-temp")}this.$header.find("th[data-field]").each(function(B){t.$header_.find(m('th[data-field="%s"]',j(this).data("field"))).data(j(this).data())});var w=this.getVisibleFields(),v=this.$header_.find("th");this.$body.find(">tr:first-child:not(.no-records-found) > *").each(function(C){var E=j(this),B=C;if(t.options.detailView&&!t.options.cardView){if(C===0){t.$header_.find("th.detail").find(".fht-cell").width(E.innerWidth())}B=C-1}var D=t.$header_.find(m('th[data-field="%s"]',w[B]));if(D.length>1){D=j(v[E[0].cellIndex])}D.find(".fht-cell").width(E.innerWidth())});this.$tableBody.off("scroll").on("scroll",function(){t.$tableHeader.scrollLeft(j(this).scrollLeft());if(t.options.showFooter&&!t.options.cardView){t.$tableFooter.scrollLeft(j(this).scrollLeft())}});t.trigger("post-header")};e.prototype.resetFooter=function(){var s=this,t=s.getData(),r=[];if(!this.options.showFooter||this.options.cardView){return}if(!this.options.cardView&&this.options.detailView){r.push('<td><div class="th-inner">&nbsp;</div><div class="fht-cell"></div></td>')}j.each(this.columns,function(x,z){var w,B="",v="",A=[],y={},u=m(' class="%s"',z["class"]);if(!z.visible){return}if(s.options.cardView&&(!z.cardVisible)){return}B=m("text-align: %s; ",z.falign?z.falign:z.align);v=m("vertical-align: %s; ",z.valign);y=q(null,s.options.footerStyle);if(y&&y.css){for(w in y.css){A.push(w+": "+y.css[w])}}r.push("<td",u,m(' style="%s"',B+v+A.concat().join("; ")),">");r.push('<div class="th-inner">');r.push(q(z,z.footerFormatter,[t],"&nbsp;")||"&nbsp;");r.push("</div>");r.push('<div class="fht-cell"></div>');r.push("</div>");r.push("</td>")});this.$tableFooter.find("tr").html(r.join(""));this.$tableFooter.show();clearTimeout(this.timeoutFooter_);this.timeoutFooter_=setTimeout(j.proxy(this.fitFooter,this),this.$el.is(":hidden")?100:0)};e.prototype.fitFooter=function(){var u=this,r,t,s;clearTimeout(this.timeoutFooter_);if(this.$el.is(":hidden")){this.timeoutFooter_=setTimeout(j.proxy(this.fitFooter,this),100);return}t=this.$el.css("width");s=t>this.$tableBody.width()?a():0;this.$tableFooter.css({"margin-right":s}).find("table").css("width",t).attr("class",this.$el.attr("class"));r=this.$tableFooter.find("td");this.$body.find(">tr:first-child:not(.no-records-found) > *").each(function(v){var w=j(this);r.eq(v).find(".fht-cell").width(w.innerWidth()+1)})};e.prototype.toggleColumn=function(r,s,u){if(r===-1){return}this.columns[r].visible=s;this.initHeader();this.initSearch();this.initPagination();this.initBody();if(this.options.showColumns){var t=this.$toolbar.find(".keep-open input").prop("disabled",false);if(u){t.filter(m('[value="%s"]',r)).prop("checked",s)}if(t.filter(":checked").length<=this.options.minimumCountColumns){t.filter(":checked").prop("disabled",true)}}};e.prototype.toggleRow=function(r,t,s){if(r===-1){return}this.$body.find(typeof r!=="undefined"?m('tr[data-index="%s"]',r):m('tr[data-uniqueid="%s"]',t))[s?"show":"hide"]()};e.prototype.getVisibleFields=function(){var s=this,r=[];j.each(this.header.fields,function(t,v){var u=s.columns[i(s.columns,v)];if(!u.visible){return}r.push(v)});return r};e.prototype.resetView=function(u){var s=0;if(u&&u.height){this.options.height=u.height}this.$selectAll.prop("checked",this.$selectItem.length>0&&this.$selectItem.length===this.$selectItem.filter(":checked").length);if(this.options.height){var t=d(this.$toolbar),v=d(this.$pagination),r=this.options.height-t-v;this.$tableContainer.css("height",r+"px")}if(this.options.cardView){this.$el.css("margin-top","0");this.$tableContainer.css("padding-bottom","0");this.$tableFooter.hide();return}if(this.options.showHeader&&this.options.height){this.$tableHeader.show();this.resetHeader();s+=this.$header.outerHeight()}else{this.$tableHeader.hide();this.trigger("post-header")}if(this.options.showFooter){this.resetFooter();if(this.options.height){s+=this.$tableFooter.outerHeight()+1}}this.getCaret();this.$tableContainer.css("padding-bottom",s+"px");this.trigger("reset-view")};e.prototype.getData=function(r){return(this.searchText||!j.isEmptyObject(this.filterColumns)||!j.isEmptyObject(this.filterColumnsPartial))?(r?this.data.slice(this.pageFrom-1,this.pageTo):this.data):(r?this.options.data.slice(this.pageFrom-1,this.pageTo):this.options.data)};e.prototype.load=function(s){var r=false;if(this.options.sidePagination==="server"){this.options.totalRows=s.total;r=s.fixedScroll;s=s[this.options.dataField]}else{if(!j.isArray(s)){r=s.fixedScroll;s=s.data}}this.initData(s);this.initSearch();this.initPagination();this.initBody(r)};e.prototype.append=function(r){this.initData(r,"append");this.initSearch();this.initPagination();this.initSort();this.initBody(true)};e.prototype.prepend=function(r){this.initData(r,"prepend");this.initSearch();this.initPagination();this.initSort();this.initBody(true)};e.prototype.remove=function(u){var r=this.options.data.length,s,t;if(!u.hasOwnProperty("field")||!u.hasOwnProperty("values")){return}for(s=r-1;s>=0;s--){t=this.options.data[s];if(!t.hasOwnProperty(u.field)){continue}if(j.inArray(t[u.field],u.values)!==-1){this.options.data.splice(s,1)}}if(r===this.options.data.length){return}this.initSearch();this.initPagination();this.initSort();this.initBody(true)};e.prototype.removeAll=function(){if(this.options.data.length>0){this.options.data.splice(0,this.options.data.length);this.initSearch();this.initPagination();this.initBody(true)}};e.prototype.getRowByUniqueId=function(x){var w=this.options.uniqueId,r=this.options.data.length,s=null,t,v,u;for(t=r-1;t>=0;t--){v=this.options.data[t];if(v.hasOwnProperty(w)){u=v[w]}else{if(v._data.hasOwnProperty(w)){u=v._data[w]}else{continue}}if(typeof u==="string"){x=x.toString()}else{if(typeof u==="number"){if((Number(u)===u)&&(u%1===0)){x=parseInt(x)}else{if((u===Number(u))&&(u!==0)){x=parseFloat(x)}}}}if(u===x){s=v;break}}return s};e.prototype.removeByUniqueId=function(t){var r=this.options.data.length,s=this.getRowByUniqueId(t);if(s){this.options.data.splice(this.options.data.indexOf(s),1)}if(r===this.options.data.length){return}this.initSearch();this.initPagination();this.initBody(true)};e.prototype.updateByUniqueId=function(t){var r=this;var s=j.isArray(t)?t:[t];j.each(s,function(u,w){var v;if(!w.hasOwnProperty("id")||!w.hasOwnProperty("row")){return}v=j.inArray(r.getRowByUniqueId(w.id),r.options.data);if(v===-1){return}j.extend(r.options.data[v],w.row)});this.initSearch();this.initSort();this.initBody(true)};e.prototype.insertRow=function(r){if(!r.hasOwnProperty("index")||!r.hasOwnProperty("row")){return}this.data.splice(r.index,0,r.row);this.initSearch();this.initPagination();this.initSort();this.initBody(true)};e.prototype.updateRow=function(t){var r=this;var s=j.isArray(t)?t:[t];j.each(s,function(u,v){if(!v.hasOwnProperty("index")||!v.hasOwnProperty("row")){return}j.extend(r.options.data[v.index],v.row)});this.initSearch();this.initSort();this.initBody(true)};e.prototype.showRow=function(r){if(!r.hasOwnProperty("index")&&!r.hasOwnProperty("uniqueId")){return}this.toggleRow(r.index,r.uniqueId,true)};e.prototype.hideRow=function(r){if(!r.hasOwnProperty("index")&&!r.hasOwnProperty("uniqueId")){return}this.toggleRow(r.index,r.uniqueId,false)};e.prototype.getRowsHidden=function(r){var t=j(this.$body[0]).children().filter(":hidden"),s=0;if(r){for(;s<t.length;s++){j(t[s]).show()}}return t};e.prototype.mergeCells=function(z){var y=z.index,t=j.inArray(z.field,this.getVisibleFields()),u=z.rowspan||1,s=z.colspan||1,w,v,x=this.$body.find(">tr"),r;if(this.options.detailView&&!this.options.cardView){t+=1}r=x.eq(y).find(">td").eq(t);if(y<0||t<0||y>=this.data.length){return}for(w=y;w<y+u;w++){for(v=t;v<t+s;v++){x.eq(w).find(">td").eq(v).hide()}}r.attr("rowspan",u).attr("colspan",s).show()};e.prototype.updateCell=function(r){if(!r.hasOwnProperty("index")||!r.hasOwnProperty("field")||!r.hasOwnProperty("value")){return}this.data[r.index][r.field]=r.value;if(r.reinit===false){return}this.initSort();this.initBody(true)};e.prototype.getOptions=function(){return this.options};e.prototype.getSelections=function(){var r=this;return j.grep(this.options.data,function(s){return s[r.header.stateField]})};e.prototype.getAllSelections=function(){var r=this;return j.grep(this.options.data,function(s){return s[r.header.stateField]})};e.prototype.checkAll=function(){this.checkAll_(true)};e.prototype.uncheckAll=function(){this.checkAll_(false)};e.prototype.checkInvert=function(){var s=this;var t=s.$selectItem.filter(":enabled");var r=t.filter(":checked");t.each(function(){j(this).prop("checked",!j(this).prop("checked"))});s.updateRows();s.updateSelected();s.trigger("uncheck-some",r);r=s.getSelections();s.trigger("check-some",r)};e.prototype.checkAll_=function(r){var s;if(!r){s=this.getSelections()}this.$selectAll.add(this.$selectAll_).prop("checked",r);this.$selectItem.filter(":enabled").prop("checked",r);this.updateRows();if(r){s=this.getSelections()}this.trigger(r?"check-all":"uncheck-all",s)};e.prototype.check=function(r){this.check_(true,r)
  8 +};e.prototype.uncheck=function(r){this.check_(false,r)};e.prototype.check_=function(t,r){var s=this.$selectItem.filter(m('[data-index="%s"]',r)).prop("checked",t);this.data[r][this.header.stateField]=t;this.updateSelected();this.trigger(t?"check":"uncheck",this.data[r],s)};e.prototype.checkBy=function(r){this.checkBy_(true,r)};e.prototype.uncheckBy=function(r){this.checkBy_(false,r)};e.prototype.checkBy_=function(s,u){if(!u.hasOwnProperty("field")||!u.hasOwnProperty("values")){return}var r=this,t=[];j.each(this.options.data,function(v,x){if(!x.hasOwnProperty(u.field)){return false}if(j.inArray(x[u.field],u.values)!==-1){var w=r.$selectItem.filter(":enabled").filter(m('[data-index="%s"]',v)).prop("checked",s);x[r.header.stateField]=s;t.push(x);r.trigger(s?"check":"uncheck",x,w)}});this.updateSelected();this.trigger(s?"check-some":"uncheck-some",t)};e.prototype.destroy=function(){this.$el.insertBefore(this.$container);j(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")||"")};e.prototype.showLoading=function(){this.$tableLoading.show()};e.prototype.hideLoading=function(){this.$tableLoading.hide()};e.prototype.togglePagination=function(){this.options.pagination=!this.options.pagination;var r=this.$toolbar.find('button[name="paginationSwitch"] i');if(this.options.pagination){r.attr("class",this.options.iconsPrefix+" "+this.options.icons.paginationSwitchDown)}else{r.attr("class",this.options.iconsPrefix+" "+this.options.icons.paginationSwitchUp)}this.updatePagination()};e.prototype.refresh=function(r){if(r&&r.url){this.options.pageNumber=1}table.rememberSelecteds={};table.rememberSelectedIds={};this.initServer(r&&r.silent,r&&r.query,r&&r.url);this.trigger("refresh",r)};e.prototype.resetWidth=function(){if(this.options.showHeader&&this.options.height){this.fitHeader()}if(this.options.showFooter){this.fitFooter()}};e.prototype.showColumn=function(r){this.toggleColumn(i(this.columns,r),true,true)};e.prototype.hideColumn=function(r){this.toggleColumn(i(this.columns,r),false,true)};e.prototype.getHiddenColumns=function(){return j.grep(this.columns,function(r){return !r.visible})};e.prototype.getVisibleColumns=function(){return j.grep(this.columns,function(r){return r.visible})};e.prototype.toggleAllColumns=function(r){j.each(this.columns,function(t,u){this.columns[t].visible=r});this.initHeader();this.initSearch();this.initPagination();this.initBody();if(this.options.showColumns){var s=this.$toolbar.find(".keep-open input").prop("disabled",false);if(s.filter(":checked").length<=this.options.minimumCountColumns){s.filter(":checked").prop("disabled",true)}}};e.prototype.showAllColumns=function(){this.toggleAllColumns(true)};e.prototype.hideAllColumns=function(){this.toggleAllColumns(false)};e.prototype.filterBy=function(r){this.filterColumns=j.isEmptyObject(r)?{}:r;this.options.pageNumber=1;this.initSearch();this.updatePagination()};e.prototype.scrollTo=function(r){if(typeof r==="string"){r=r==="bottom"?this.$tableBody[0].scrollHeight:0}if(typeof r==="number"){this.$tableBody.scrollTop(r)}if(typeof r==="undefined"){return this.$tableBody.scrollTop()}};e.prototype.getScrollPosition=function(){return this.scrollTo()};e.prototype.selectPage=function(r){if(r>0&&r<=this.options.totalPages){this.options.pageNumber=r;this.updatePagination()}};e.prototype.prevPage=function(){if(this.options.pageNumber>1){this.options.pageNumber--;this.updatePagination()}};e.prototype.nextPage=function(){if(this.options.pageNumber<this.options.totalPages){this.options.pageNumber++;this.updatePagination()}};e.prototype.toggleView=function(){this.options.cardView=!this.options.cardView;this.initHeader();this.initBody();this.trigger("toggle",this.options.cardView)};e.prototype.refreshOptions=function(r){if(f(this.options,r,true)){return}this.options=j.extend(this.options,r);this.trigger("refresh-options",this.options);this.destroy();this.init()};e.prototype.resetSearch=function(s){var r=this.$toolbar.find(".search input");r.val(s||"");this.onSearch({currentTarget:r})};e.prototype.expandRow_=function(s,r){var t=this.$body.find(m('> tr[data-index="%s"]',r));if(t.next().is("tr.detail-view")===(s?false:true)){t.find("> td > .detail-icon").click()}};e.prototype.expandRow=function(r){this.expandRow_(true,r)};e.prototype.collapseRow=function(r){this.expandRow_(false,r)};e.prototype.expandAllRows=function(r){if(r){var w=this.$body.find(m('> tr[data-index="%s"]',0)),x=this,u=null,v=false,s=-1;if(!w.next().is("tr.detail-view")){w.find("> td > .detail-icon").click();v=true}else{if(!w.next().next().is("tr.detail-view")){w.next().find(".detail-icon").click();v=true}}if(v){try{s=setInterval(function(){u=x.$body.find("tr.detail-view").last().find(".detail-icon");if(u.length>0){u.click()}else{clearInterval(s)}},1)}catch(z){clearInterval(s)}}}else{var y=this.$body.children();for(var t=0;t<y.length;t++){this.expandRow_(true,j(y[t]).data("index"))}}};e.prototype.collapseAllRows=function(s){if(s){this.expandRow_(false,0)}else{var r=this.$body.children();for(var t=0;t<r.length;t++){this.expandRow_(false,j(r[t]).data("index"))}}};e.prototype.updateFormatText=function(r,s){if(this.options[m("format%s",r)]){if(typeof s==="string"){this.options[m("format%s",r)]=function(){return s}}else{if(typeof s==="function"){this.options[m("format%s",r)]=s}}}this.initToolbar();this.initPagination();this.initBody()};var n=["getOptions","getSelections","getAllSelections","getData","load","append","prepend","remove","removeAll","insertRow","updateRow","updateCell","updateByUniqueId","removeByUniqueId","getRowByUniqueId","showRow","hideRow","getRowsHidden","mergeCells","checkAll","uncheckAll","checkInvert","check","uncheck","checkBy","uncheckBy","refresh","resetView","resetWidth","destroy","showLoading","hideLoading","showColumn","hideColumn","getHiddenColumns","getVisibleColumns","showAllColumns","hideAllColumns","filterBy","scrollTo","getScrollPosition","selectPage","prevPage","nextPage","togglePagination","toggleView","refreshOptions","resetSearch","expandRow","collapseRow","expandAllRows","collapseAllRows","updateFormatText"];j.fn.bootstrapTable=function(s){var t,r=Array.prototype.slice.call(arguments,1);this.each(function(){var w=j(this),v=w.data("bootstrap.table"),u=j.extend({},e.DEFAULTS,w.data(),typeof s==="object"&&s);if(typeof s==="string"){if(j.inArray(s,n)<0){throw new Error("Unknown method: "+s)}if(!v){return}t=v[s].apply(v,r);if(s==="destroy"){w.removeData("bootstrap.table")}}if(!v){w.data("bootstrap.table",(v=new e(this,u)))}});return typeof t==="undefined"?this:t};j.fn.bootstrapTable.Constructor=e;j.fn.bootstrapTable.defaults=e.DEFAULTS;j.fn.bootstrapTable.columnDefaults=e.COLUMN_DEFAULTS;j.fn.bootstrapTable.locales=e.LOCALES;j.fn.bootstrapTable.methods=n;j.fn.bootstrapTable.utils={sprintf:m,getFieldIndex:i,compareObjects:f,calculateObjectValue:q,getItemField:o,objectKeys:h,isIEBrowser:b};j(function(){j('[data-toggle="table"]').bootstrapTable()})})(jQuery);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";var firstLoadTable=[];var union=function(b,a){if($.isArray(a)){$.each(a,function(c,d){if($.inArray(d,b)==-1){b[b.length]=d}})}else{if($.inArray(a,b)==-1){b[b.length]=a}}return b};var difference=function(c,b){if($.isArray(b)){$.each(b,function(e,f){var d=$.inArray(f,c);if(d!=-1){c.splice(d,1)}})}else{var a=$.inArray(b,c);if(a!=-1){c.splice(a,1)}}return c};var _={"union":union,"difference":difference};
927 9 \ No newline at end of file
... ...
src/main/resources/static/ajax/libs/bootstrap-table/extensions/columns/bootstrap-table-fixed-columns.js 0 → 100644
  1 +/**
  2 + * 基于bootstrap-table-fixed-columns修改
  3 + * 支持左右列冻结、支持固定高度
  4 + * Copyright (c) 2019 ruoyi
  5 + */
  6 +(function ($) {
  7 + 'use strict';
  8 +
  9 + $.extend($.fn.bootstrapTable.defaults, {
  10 + fixedColumns: false,
  11 + fixedNumber: 1,
  12 + rightFixedColumns: false,
  13 + rightFixedNumber: 1
  14 + });
  15 +
  16 + var BootstrapTable = $.fn.bootstrapTable.Constructor,
  17 + _initHeader = BootstrapTable.prototype.initHeader,
  18 + _initBody = BootstrapTable.prototype.initBody,
  19 + _resetView = BootstrapTable.prototype.resetView;
  20 +
  21 + BootstrapTable.prototype.initFixedColumns = function () {
  22 + this.timeoutHeaderColumns_ = 0;
  23 + this.timeoutBodyColumns_ = 0;
  24 + if (this.options.fixedColumns) {
  25 + this.$fixedHeader = $([
  26 + '<div class="left-fixed-table-columns">',
  27 + '<table>',
  28 + '<thead></thead>',
  29 + '</table>',
  30 + '</div>'].join(''));
  31 +
  32 + this.$fixedHeader.find('table').attr('class', this.$el.attr('class'));
  33 + this.$fixedHeaderColumns = this.$fixedHeader.find('thead');
  34 + this.$tableHeader.before(this.$fixedHeader);
  35 +
  36 + this.$fixedBody = $([
  37 + '<div class="left-fixed-body-columns">',
  38 + '<table>',
  39 + '<tbody></tbody>',
  40 + '</table>',
  41 + '</div>'].join(''));
  42 +
  43 + this.$fixedBody.find('table').attr('class', this.$el.attr('class'));
  44 + this.$fixedBodyColumns = this.$fixedBody.find('tbody');
  45 + this.$tableBody.before(this.$fixedBody);
  46 + }
  47 + if (this.options.rightFixedColumns) {
  48 + this.$rightfixedBody = $([
  49 + '<div class="right-fixed-table-columns">',
  50 + '<table>',
  51 + '<thead></thead>',
  52 + '<tbody style="background-color: #fff;"></tbody>',
  53 + '</table>',
  54 + '</div>'].join(''));
  55 + this.$rightfixedBody.find('table').attr('class', this.$el.attr('class'));
  56 + this.$rightfixedHeaderColumns = this.$rightfixedBody.find('thead');
  57 + this.$rightfixedBodyColumns = this.$rightfixedBody.find('tbody');
  58 + this.$tableBody.before(this.$rightfixedBody);
  59 + if (this.options.fixedColumns) {
  60 + $('.right-fixed-table-columns').attr('style','right:0px');
  61 + }
  62 + }
  63 + };
  64 +
  65 + BootstrapTable.prototype.initHeader = function () {
  66 + _initHeader.apply(this, Array.prototype.slice.apply(arguments));
  67 +
  68 + if (!this.options.fixedColumns && !this.options.rightFixedColumns){
  69 + return;
  70 + }
  71 + this.initFixedColumns();
  72 +
  73 + var $ltr = this.$header.find('tr:eq(0)').clone(true),
  74 + $rtr = this.$header.find('tr:eq(0)').clone(),
  75 + $lths = $ltr.clone(true).find('th'),
  76 + $rths = $rtr.clone().find('th');
  77 +
  78 + $ltr.html('');
  79 + $rtr.html('');
  80 + //右边列冻结
  81 + if (this.options.rightFixedColumns) {
  82 + for (var i = 0; i < this.options.rightFixedNumber; i++) {
  83 + $rtr.append($rths.eq($rths.length - this.options.rightFixedNumber + i).clone());
  84 + }
  85 + this.$rightfixedHeaderColumns.html('').append($rtr);
  86 + }
  87 +
  88 + //左边列冻结
  89 + if (this.options.fixedColumns) {
  90 + for (var i = 0; i < this.options.fixedNumber; i++) {
  91 + $ltr.append($lths.eq(i).clone(true));
  92 + }
  93 + this.$fixedHeaderColumns.html('').append($ltr);
  94 + this.$selectAll = $ltr.find('[name="btSelectAll"]');
  95 + this.$selectAll.on('click', function () {
  96 + var checked = $(this).prop('checked');
  97 + $(".left-fixed-body-columns input[name=btSelectItem]").filter(':enabled').prop('checked', checked);
  98 + $('.fixed-table-body input[name=btSelectItem]').closest('tr').removeClass('selected');
  99 + });
  100 + }
  101 + };
  102 +
  103 + BootstrapTable.prototype.initBody = function () {
  104 + _initBody.apply(this, Array.prototype.slice.apply(arguments));
  105 +
  106 + if (!this.options.fixedColumns && !this.options.rightFixedColumns) {
  107 + return;
  108 + }
  109 +
  110 + var that = this;
  111 + if (this.options.fixedColumns) {
  112 + this.$fixedBodyColumns.html('');
  113 + this.$body.find('> tr[data-index]').each(function () {
  114 + var $tr = $(this).clone(true),
  115 + $tds = $tr.clone(true).find('td');
  116 +
  117 + $tr.html('');
  118 + for (var i = 0; i < that.options.fixedNumber; i++) {
  119 + $tr.append($tds.eq(i).clone(true));
  120 + }
  121 + that.$fixedBodyColumns.append($tr);
  122 + });
  123 + }
  124 + if (this.options.rightFixedColumns) {
  125 + this.$rightfixedBodyColumns.html('');
  126 + this.$body.find('> tr[data-index]').each(function () {
  127 + var $tr = $(this).clone(),
  128 + $tds = $tr.clone().find('td');
  129 +
  130 + $tr.html('');
  131 + for (var i = 0; i < that.options.rightFixedNumber; i++) {
  132 + var indexTd = $tds.length - that.options.rightFixedNumber + i;
  133 + var oldTd = $tds.eq(indexTd);
  134 + var fixTd = oldTd.clone();
  135 + var buttons = fixTd.find('button');
  136 + //事件转移:冻结列里面的事件转移到实际按钮的事件
  137 + buttons.each(function (key, item) {
  138 + $(item).click(function () {
  139 + that.$body.find("tr[data-index=" + $tr.attr('data-index') + "] td:eq(" + indexTd + ") button:eq(" + key + ")").click();
  140 + });
  141 + });
  142 + $tr.append(fixTd);
  143 + }
  144 + that.$rightfixedBodyColumns.append($tr);
  145 + });
  146 + }
  147 + };
  148 +
  149 + BootstrapTable.prototype.resetView = function () {
  150 + _resetView.apply(this, Array.prototype.slice.apply(arguments));
  151 +
  152 + if (!this.options.fixedColumns && !this.options.rightFixedColumns) {
  153 + return;
  154 + }
  155 +
  156 + clearTimeout(this.timeoutHeaderColumns_);
  157 + this.timeoutHeaderColumns_ = setTimeout($.proxy(this.fitHeaderColumns, this), this.$el.is(':hidden') ? 100 : 0);
  158 +
  159 + clearTimeout(this.timeoutBodyColumns_);
  160 + this.timeoutBodyColumns_ = setTimeout($.proxy(this.fitBodyColumns, this), this.$el.is(':hidden') ? 100 : 0);
  161 + };
  162 +
  163 + BootstrapTable.prototype.fitHeaderColumns = function () {
  164 + var that = this,
  165 + visibleFields = this.getVisibleFields(),
  166 + headerWidth = 0;
  167 + if (that.options.fixedColumns) {
  168 + this.$body.find('tr:first-child:not(.no-records-found) > *').each(function (i) {
  169 + var $this = $(this),
  170 + index = i;
  171 +
  172 + if (i >= that.options.fixedNumber) {
  173 + return false;
  174 + }
  175 +
  176 + if (that.options.detailView && !that.options.cardView) {
  177 + index = i - 1;
  178 + }
  179 + that.$fixedHeader.find('thead th[data-field="' + visibleFields[index] + '"]')
  180 + .find('.fht-cell').width($this.innerWidth());
  181 + headerWidth += $this.outerWidth();
  182 + });
  183 + this.$fixedHeader.width(headerWidth + 2).show();
  184 + }
  185 + if (that.options.rightFixedColumns) {
  186 + this.$body.find('tr:first-child:not(.no-records-found) > *').each(function (i) {
  187 + var $this = $(this),
  188 + index = i;
  189 +
  190 + if (i >= visibleFields.length - that.options.rightFixedNumber) {
  191 + return false;
  192 +
  193 +
  194 + if (that.options.detailView && !that.options.cardView) {
  195 + index = i - 1;
  196 + }
  197 + that.$rightfixedBody.find('thead th[data-field="' + visibleFields[index] + '"]')
  198 + .find('.fht-cell').width($this.innerWidth() - 1);
  199 + headerWidth += $this.outerWidth();
  200 + }
  201 + });
  202 + this.$rightfixedBody.width(headerWidth - 1).show();
  203 + }
  204 + };
  205 +
  206 + BootstrapTable.prototype.fitBodyColumns = function () {
  207 + var that = this,
  208 + top = -(parseInt(this.$el.css('margin-top'))),
  209 + height = this.$tableBody.height();
  210 +
  211 + if (that.options.fixedColumns) {
  212 + if (!this.$body.find('> tr[data-index]').length) {
  213 + this.$fixedBody.hide();
  214 + return;
  215 + }
  216 +
  217 + if (!this.options.height) {
  218 + top = this.$fixedHeader.height()- 1;
  219 + height = height - top;
  220 + }
  221 +
  222 + this.$fixedBody.css({
  223 + width: this.$fixedHeader.width(),
  224 + height: height,
  225 + top: top + 1
  226 + }).show();
  227 +
  228 + this.$body.find('> tr').each(function (i) {
  229 + that.$fixedBody.find('tr:eq(' + i + ')').height($(this).height() - 0.5);
  230 + var thattds = this;
  231 + that.$fixedBody.find('tr:eq(' + i + ')').find('td').each(function (j) {
  232 + $(this).width($($(thattds).find('td')[j]).width() + 1);
  233 + });
  234 + });
  235 +
  236 + $("#" + table.options.id).on("check.bs.table uncheck.bs.table", function (e, rows, $element) {
  237 + var index= $element.data('index');
  238 + $(this).find('.bs-checkbox').find('input[data-index="' + index + '"]').prop("checked", true);
  239 + var selectFixedItem = $('.left-fixed-body-columns input[name=btSelectItem]');
  240 + var checkAll = selectFixedItem.filter(':enabled').length &&
  241 + selectFixedItem.filter(':enabled').length ===
  242 + selectFixedItem.filter(':enabled').filter(':checked').length;
  243 + $(".left-fixed-table-columns input[name=btSelectAll]").prop('checked', checkAll);
  244 + $('.fixed-table-body input[name=btSelectItem]').closest('tr').removeClass('selected');
  245 + });
  246 +
  247 + //// events
  248 + this.$tableBody.on('scroll', function () {
  249 + that.$fixedBody.find('table').css('top', -$(this).scrollTop());
  250 + });
  251 + this.$body.find('> tr[data-index]').off('hover').hover(function () {
  252 + var index = $(this).data('index');
  253 + that.$fixedBody.find('tr[data-index="' + index + '"]').addClass('hover');
  254 + }, function () {
  255 + var index = $(this).data('index');
  256 + that.$fixedBody.find('tr[data-index="' + index + '"]').removeClass('hover');
  257 + });
  258 + this.$fixedBody.find('tr[data-index]').off('hover').hover(function () {
  259 + var index = $(this).data('index');
  260 + that.$body.find('tr[data-index="' + index + '"]').addClass('hover');
  261 + }, function () {
  262 + var index = $(this).data('index');
  263 + that.$body.find('> tr[data-index="' + index + '"]').removeClass('hover');
  264 + });
  265 + }
  266 + if (that.options.rightFixedColumns) {
  267 + if (!this.$body.find('> tr[data-index]').length) {
  268 + this.$rightfixedBody.hide();
  269 + return;
  270 + }
  271 +
  272 + this.$body.find('> tr').each(function (i) {
  273 + that.$rightfixedBody.find('tbody tr:eq(' + i + ')').height($(this).height());
  274 + });
  275 +
  276 + //// events
  277 + this.$tableBody.on('scroll', function () {
  278 + that.$rightfixedBody.find('table').css('top', -$(this).scrollTop());
  279 + });
  280 + this.$body.find('> tr[data-index]').off('hover').hover(function () {
  281 + var index = $(this).data('index');
  282 + that.$rightfixedBody.find('tr[data-index="' + index + '"]').addClass('hover');
  283 + }, function () {
  284 + var index = $(this).data('index');
  285 + that.$rightfixedBody.find('tr[data-index="' + index + '"]').removeClass('hover');
  286 + });
  287 + this.$rightfixedBody.find('tr[data-index]').off('hover').hover(function () {
  288 + var index = $(this).data('index');
  289 + that.$body.find('tr[data-index="' + index + '"]').addClass('hover');
  290 + }, function () {
  291 + var index = $(this).data('index');
  292 + that.$body.find('> tr[data-index="' + index + '"]').removeClass('hover');
  293 + });
  294 + }
  295 + };
  296 +
  297 +})(jQuery);
0 298 \ No newline at end of file
... ...
src/main/resources/static/ajax/libs/bootstrap-table/extensions/editable/bootstrap-editable.css 0 → 100644
  1 +/*! X-editable - v1.5.1
  2 +* In-place editing with Twitter Bootstrap, jQuery UI or pure jQuery
  3 +* http://github.com/vitalets/x-editable
  4 +* Copyright (c) 2013 Vitaliy Potapov; Licensed MIT */
  5 +.editableform {
  6 + margin-bottom: 0; /* overwrites bootstrap margin */
  7 +}
  8 +
  9 +.editableform .control-group {
  10 + margin-bottom: 0; /* overwrites bootstrap margin */
  11 + white-space: nowrap; /* prevent wrapping buttons on new line */
  12 + line-height: 20px; /* overwriting bootstrap line-height. See #133 */
  13 +}
  14 +
  15 +/*
  16 + BS3 width:1005 for inputs breaks editable form in popup
  17 + See: https://github.com/vitalets/x-editable/issues/393
  18 +*/
  19 +.editableform .form-control {
  20 + width: auto;
  21 +}
  22 +
  23 +.editable-buttons {
  24 + display: inline-block; /* should be inline to take effect of parent's white-space: nowrap */
  25 + vertical-align: top;
  26 + margin-left: 7px;
  27 + /* inline-block emulation for IE7*/
  28 + zoom: 1;
  29 + *display: inline;
  30 +}
  31 +
  32 +.editable-buttons.editable-buttons-bottom {
  33 + display: block;
  34 + margin-top: 7px;
  35 + margin-left: 0;
  36 +}
  37 +
  38 +.editable-input {
  39 + vertical-align: top;
  40 + display: inline-block; /* should be inline to take effect of parent's white-space: nowrap */
  41 + width: auto; /* bootstrap-responsive has width: 100% that breakes layout */
  42 + white-space: normal; /* reset white-space decalred in parent*/
  43 + /* display-inline emulation for IE7*/
  44 + zoom: 1;
  45 + *display: inline;
  46 +}
  47 +
  48 +.editable-buttons .editable-cancel {
  49 + margin-left: 7px;
  50 +}
  51 +
  52 +/*for jquery-ui buttons need set height to look more pretty*/
  53 +.editable-buttons button.ui-button-icon-only {
  54 + height: 24px;
  55 + width: 30px;
  56 +}
  57 +
  58 +.editableform-loading {
  59 + background: url('loading.gif') center center no-repeat;
  60 + height: 25px;
  61 + width: auto;
  62 + min-width: 25px;
  63 +}
  64 +
  65 +.editable-inline .editableform-loading {
  66 + background-position: left 5px;
  67 +}
  68 +
  69 + .editable-error-block {
  70 + max-width: 300px;
  71 + margin: 5px 0 0 0;
  72 + width: auto;
  73 + white-space: normal;
  74 +}
  75 +
  76 +/*add padding for jquery ui*/
  77 +.editable-error-block.ui-state-error {
  78 + padding: 3px;
  79 +}
  80 +
  81 +.editable-error {
  82 + color: red;
  83 +}
  84 +
  85 +/* ---- For specific types ---- */
  86 +
  87 +.editableform .editable-date {
  88 + padding: 0;
  89 + margin: 0;
  90 + float: left;
  91 +}
  92 +
  93 +/* move datepicker icon to center of add-on button. See https://github.com/vitalets/x-editable/issues/183 */
  94 +.editable-inline .add-on .icon-th {
  95 + margin-top: 3px;
  96 + margin-left: 1px;
  97 +}
  98 +
  99 +
  100 +/* checklist vertical alignment */
  101 +.editable-checklist label input[type="checkbox"],
  102 +.editable-checklist label span {
  103 + vertical-align: middle;
  104 + margin: 0;
  105 +}
  106 +
  107 +.editable-checklist label {
  108 + white-space: nowrap;
  109 +}
  110 +
  111 +/* set exact width of textarea to fit buttons toolbar */
  112 +.editable-wysihtml5 {
  113 + width: 566px;
  114 + height: 250px;
  115 +}
  116 +
  117 +/* clear button shown as link in date inputs */
  118 +.editable-clear {
  119 + clear: both;
  120 + font-size: 0.9em;
  121 + text-decoration: none;
  122 + text-align: right;
  123 +}
  124 +
  125 +/* IOS-style clear button for text inputs */
  126 +.editable-clear-x {
  127 + background: url('clear.png') center center no-repeat;
  128 + display: block;
  129 + width: 13px;
  130 + height: 13px;
  131 + position: absolute;
  132 + opacity: 0.6;
  133 + z-index: 100;
  134 +
  135 + top: 50%;
  136 + right: 6px;
  137 + margin-top: -6px;
  138 +
  139 +}
  140 +
  141 +.editable-clear-x:hover {
  142 + opacity: 1;
  143 +}
  144 +
  145 +.editable-pre-wrapped {
  146 + white-space: pre-wrap;
  147 +}
  148 +.editable-container.editable-popup {
  149 + max-width: none !important; /* without this rule poshytip/tooltip does not stretch */
  150 +}
  151 +
  152 +.editable-container.popover {
  153 + width: auto; /* without this rule popover does not stretch */
  154 +}
  155 +
  156 +.editable-container.editable-inline {
  157 + display: inline-block;
  158 + vertical-align: middle;
  159 + width: auto;
  160 + /* inline-block emulation for IE7*/
  161 + zoom: 1;
  162 + *display: inline;
  163 +}
  164 +
  165 +.editable-container.ui-widget {
  166 + font-size: inherit; /* jqueryui widget font 1.1em too big, overwrite it */
  167 + z-index: 9990; /* should be less than select2 dropdown z-index to close dropdown first when click */
  168 +}
  169 +.editable-click,
  170 +a.editable-click,
  171 +a.editable-click:hover {
  172 + text-decoration: none;
  173 + border-bottom: dashed 1px #0088cc;
  174 +}
  175 +
  176 +.editable-click.editable-disabled,
  177 +a.editable-click.editable-disabled,
  178 +a.editable-click.editable-disabled:hover {
  179 + color: #585858;
  180 + cursor: default;
  181 + border-bottom: none;
  182 +}
  183 +
  184 +.editable-empty, .editable-empty:hover, .editable-empty:focus{
  185 + font-style: italic;
  186 + color: #DD1144;
  187 + /* border-bottom: none; */
  188 + text-decoration: none;
  189 +}
  190 +
  191 +.editable-unsaved {
  192 + font-weight: bold;
  193 +}
  194 +
  195 +.editable-unsaved:after {
  196 +/* content: '*'*/
  197 +}
  198 +
  199 +.editable-bg-transition {
  200 + -webkit-transition: background-color 1400ms ease-out;
  201 + -moz-transition: background-color 1400ms ease-out;
  202 + -o-transition: background-color 1400ms ease-out;
  203 + -ms-transition: background-color 1400ms ease-out;
  204 + transition: background-color 1400ms ease-out;
  205 +}
  206 +
  207 +/*see https://github.com/vitalets/x-editable/issues/139 */
  208 +.form-horizontal .editable
  209 +{
  210 + padding-top: 5px;
  211 + display:inline-block;
  212 +}
  213 +
  214 +
  215 +/*!
  216 + * Datepicker for Bootstrap
  217 + *
  218 + * Copyright 2012 Stefan Petre
  219 + * Improvements by Andrew Rowls
  220 + * Licensed under the Apache License v2.0
  221 + * http://www.apache.org/licenses/LICENSE-2.0
  222 + *
  223 + */
  224 +.datepicker {
  225 + padding: 4px;
  226 + -webkit-border-radius: 4px;
  227 + -moz-border-radius: 4px;
  228 + border-radius: 4px;
  229 + direction: ltr;
  230 + /*.dow {
  231 + border-top: 1px solid #ddd !important;
  232 + }*/
  233 +
  234 +}
  235 +.datepicker-inline {
  236 + width: 220px;
  237 +}
  238 +.datepicker.datepicker-rtl {
  239 + direction: rtl;
  240 +}
  241 +.datepicker.datepicker-rtl table tr td span {
  242 + float: right;
  243 +}
  244 +.datepicker-dropdown {
  245 + top: 0;
  246 + left: 0;
  247 +}
  248 +.datepicker-dropdown:before {
  249 + content: '';
  250 + display: inline-block;
  251 + border-left: 7px solid transparent;
  252 + border-right: 7px solid transparent;
  253 + border-bottom: 7px solid #ccc;
  254 + border-bottom-color: rgba(0, 0, 0, 0.2);
  255 + position: absolute;
  256 + top: -7px;
  257 + left: 6px;
  258 +}
  259 +.datepicker-dropdown:after {
  260 + content: '';
  261 + display: inline-block;
  262 + border-left: 6px solid transparent;
  263 + border-right: 6px solid transparent;
  264 + border-bottom: 6px solid #ffffff;
  265 + position: absolute;
  266 + top: -6px;
  267 + left: 7px;
  268 +}
  269 +.datepicker > div {
  270 + display: none;
  271 +}
  272 +.datepicker.days div.datepicker-days {
  273 + display: block;
  274 +}
  275 +.datepicker.months div.datepicker-months {
  276 + display: block;
  277 +}
  278 +.datepicker.years div.datepicker-years {
  279 + display: block;
  280 +}
  281 +.datepicker table {
  282 + margin: 0;
  283 +}
  284 +.datepicker td,
  285 +.datepicker th {
  286 + text-align: center;
  287 + width: 20px;
  288 + height: 20px;
  289 + -webkit-border-radius: 4px;
  290 + -moz-border-radius: 4px;
  291 + border-radius: 4px;
  292 + border: none;
  293 +}
  294 +.table-striped .datepicker table tr td,
  295 +.table-striped .datepicker table tr th {
  296 + background-color: transparent;
  297 +}
  298 +.datepicker table tr td.day:hover {
  299 + background: #eeeeee;
  300 + cursor: pointer;
  301 +}
  302 +.datepicker table tr td.old,
  303 +.datepicker table tr td.new {
  304 + color: #999999;
  305 +}
  306 +.datepicker table tr td.disabled,
  307 +.datepicker table tr td.disabled:hover {
  308 + background: none;
  309 + color: #999999;
  310 + cursor: default;
  311 +}
  312 +.datepicker table tr td.today,
  313 +.datepicker table tr td.today:hover,
  314 +.datepicker table tr td.today.disabled,
  315 +.datepicker table tr td.today.disabled:hover {
  316 + background-color: #fde19a;
  317 + background-image: -moz-linear-gradient(top, #fdd49a, #fdf59a);
  318 + background-image: -ms-linear-gradient(top, #fdd49a, #fdf59a);
  319 + background-image: -webkit-gradient(linear, 0 0, 0 100%, from(#fdd49a), to(#fdf59a));
  320 + background-image: -webkit-linear-gradient(top, #fdd49a, #fdf59a);
  321 + background-image: -o-linear-gradient(top, #fdd49a, #fdf59a);
  322 + background-image: linear-gradient(top, #fdd49a, #fdf59a);
  323 + background-repeat: repeat-x;
  324 + filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#fdd49a', endColorstr='#fdf59a', GradientType=0);
  325 + border-color: #fdf59a #fdf59a #fbed50;
  326 + border-color: rgba(0, 0, 0, 0.1) rgba(0, 0, 0, 0.1) rgba(0, 0, 0, 0.25);
  327 + filter: progid:DXImageTransform.Microsoft.gradient(enabled=false);
  328 + color: #000;
  329 +}
  330 +.datepicker table tr td.today:hover,
  331 +.datepicker table tr td.today:hover:hover,
  332 +.datepicker table tr td.today.disabled:hover,
  333 +.datepicker table tr td.today.disabled:hover:hover,
  334 +.datepicker table tr td.today:active,
  335 +.datepicker table tr td.today:hover:active,
  336 +.datepicker table tr td.today.disabled:active,
  337 +.datepicker table tr td.today.disabled:hover:active,
  338 +.datepicker table tr td.today.active,
  339 +.datepicker table tr td.today:hover.active,
  340 +.datepicker table tr td.today.disabled.active,
  341 +.datepicker table tr td.today.disabled:hover.active,
  342 +.datepicker table tr td.today.disabled,
  343 +.datepicker table tr td.today:hover.disabled,
  344 +.datepicker table tr td.today.disabled.disabled,
  345 +.datepicker table tr td.today.disabled:hover.disabled,
  346 +.datepicker table tr td.today[disabled],
  347 +.datepicker table tr td.today:hover[disabled],
  348 +.datepicker table tr td.today.disabled[disabled],
  349 +.datepicker table tr td.today.disabled:hover[disabled] {
  350 + background-color: #fdf59a;
  351 +}
  352 +.datepicker table tr td.today:active,
  353 +.datepicker table tr td.today:hover:active,
  354 +.datepicker table tr td.today.disabled:active,
  355 +.datepicker table tr td.today.disabled:hover:active,
  356 +.datepicker table tr td.today.active,
  357 +.datepicker table tr td.today:hover.active,
  358 +.datepicker table tr td.today.disabled.active,
  359 +.datepicker table tr td.today.disabled:hover.active {
  360 + background-color: #fbf069 \9;
  361 +}
  362 +.datepicker table tr td.today:hover:hover {
  363 + color: #000;
  364 +}
  365 +.datepicker table tr td.today.active:hover {
  366 + color: #fff;
  367 +}
  368 +.datepicker table tr td.range,
  369 +.datepicker table tr td.range:hover,
  370 +.datepicker table tr td.range.disabled,
  371 +.datepicker table tr td.range.disabled:hover {
  372 + background: #eeeeee;
  373 + -webkit-border-radius: 0;
  374 + -moz-border-radius: 0;
  375 + border-radius: 0;
  376 +}
  377 +.datepicker table tr td.range.today,
  378 +.datepicker table tr td.range.today:hover,
  379 +.datepicker table tr td.range.today.disabled,
  380 +.datepicker table tr td.range.today.disabled:hover {
  381 + background-color: #f3d17a;
  382 + background-image: -moz-linear-gradient(top, #f3c17a, #f3e97a);
  383 + background-image: -ms-linear-gradient(top, #f3c17a, #f3e97a);
  384 + background-image: -webkit-gradient(linear, 0 0, 0 100%, from(#f3c17a), to(#f3e97a));
  385 + background-image: -webkit-linear-gradient(top, #f3c17a, #f3e97a);
  386 + background-image: -o-linear-gradient(top, #f3c17a, #f3e97a);
  387 + background-image: linear-gradient(top, #f3c17a, #f3e97a);
  388 + background-repeat: repeat-x;
  389 + filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#f3c17a', endColorstr='#f3e97a', GradientType=0);
  390 + border-color: #f3e97a #f3e97a #edde34;
  391 + border-color: rgba(0, 0, 0, 0.1) rgba(0, 0, 0, 0.1) rgba(0, 0, 0, 0.25);
  392 + filter: progid:DXImageTransform.Microsoft.gradient(enabled=false);
  393 + -webkit-border-radius: 0;
  394 + -moz-border-radius: 0;
  395 + border-radius: 0;
  396 +}
  397 +.datepicker table tr td.range.today:hover,
  398 +.datepicker table tr td.range.today:hover:hover,
  399 +.datepicker table tr td.range.today.disabled:hover,
  400 +.datepicker table tr td.range.today.disabled:hover:hover,
  401 +.datepicker table tr td.range.today:active,
  402 +.datepicker table tr td.range.today:hover:active,
  403 +.datepicker table tr td.range.today.disabled:active,
  404 +.datepicker table tr td.range.today.disabled:hover:active,
  405 +.datepicker table tr td.range.today.active,
  406 +.datepicker table tr td.range.today:hover.active,
  407 +.datepicker table tr td.range.today.disabled.active,
  408 +.datepicker table tr td.range.today.disabled:hover.active,
  409 +.datepicker table tr td.range.today.disabled,
  410 +.datepicker table tr td.range.today:hover.disabled,
  411 +.datepicker table tr td.range.today.disabled.disabled,
  412 +.datepicker table tr td.range.today.disabled:hover.disabled,
  413 +.datepicker table tr td.range.today[disabled],
  414 +.datepicker table tr td.range.today:hover[disabled],
  415 +.datepicker table tr td.range.today.disabled[disabled],
  416 +.datepicker table tr td.range.today.disabled:hover[disabled] {
  417 + background-color: #f3e97a;
  418 +}
  419 +.datepicker table tr td.range.today:active,
  420 +.datepicker table tr td.range.today:hover:active,
  421 +.datepicker table tr td.range.today.disabled:active,
  422 +.datepicker table tr td.range.today.disabled:hover:active,
  423 +.datepicker table tr td.range.today.active,
  424 +.datepicker table tr td.range.today:hover.active,
  425 +.datepicker table tr td.range.today.disabled.active,
  426 +.datepicker table tr td.range.today.disabled:hover.active {
  427 + background-color: #efe24b \9;
  428 +}
  429 +.datepicker table tr td.selected,
  430 +.datepicker table tr td.selected:hover,
  431 +.datepicker table tr td.selected.disabled,
  432 +.datepicker table tr td.selected.disabled:hover {
  433 + background-color: #9e9e9e;
  434 + background-image: -moz-linear-gradient(top, #b3b3b3, #808080);
  435 + background-image: -ms-linear-gradient(top, #b3b3b3, #808080);
  436 + background-image: -webkit-gradient(linear, 0 0, 0 100%, from(#b3b3b3), to(#808080));
  437 + background-image: -webkit-linear-gradient(top, #b3b3b3, #808080);
  438 + background-image: -o-linear-gradient(top, #b3b3b3, #808080);
  439 + background-image: linear-gradient(top, #b3b3b3, #808080);
  440 + background-repeat: repeat-x;
  441 + filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#b3b3b3', endColorstr='#808080', GradientType=0);
  442 + border-color: #808080 #808080 #595959;
  443 + border-color: rgba(0, 0, 0, 0.1) rgba(0, 0, 0, 0.1) rgba(0, 0, 0, 0.25);
  444 + filter: progid:DXImageTransform.Microsoft.gradient(enabled=false);
  445 + color: #fff;
  446 + text-shadow: 0 -1px 0 rgba(0, 0, 0, 0.25);
  447 +}
  448 +.datepicker table tr td.selected:hover,
  449 +.datepicker table tr td.selected:hover:hover,
  450 +.datepicker table tr td.selected.disabled:hover,
  451 +.datepicker table tr td.selected.disabled:hover:hover,
  452 +.datepicker table tr td.selected:active,
  453 +.datepicker table tr td.selected:hover:active,
  454 +.datepicker table tr td.selected.disabled:active,
  455 +.datepicker table tr td.selected.disabled:hover:active,
  456 +.datepicker table tr td.selected.active,
  457 +.datepicker table tr td.selected:hover.active,
  458 +.datepicker table tr td.selected.disabled.active,
  459 +.datepicker table tr td.selected.disabled:hover.active,
  460 +.datepicker table tr td.selected.disabled,
  461 +.datepicker table tr td.selected:hover.disabled,
  462 +.datepicker table tr td.selected.disabled.disabled,
  463 +.datepicker table tr td.selected.disabled:hover.disabled,
  464 +.datepicker table tr td.selected[disabled],
  465 +.datepicker table tr td.selected:hover[disabled],
  466 +.datepicker table tr td.selected.disabled[disabled],
  467 +.datepicker table tr td.selected.disabled:hover[disabled] {
  468 + background-color: #808080;
  469 +}
  470 +.datepicker table tr td.selected:active,
  471 +.datepicker table tr td.selected:hover:active,
  472 +.datepicker table tr td.selected.disabled:active,
  473 +.datepicker table tr td.selected.disabled:hover:active,
  474 +.datepicker table tr td.selected.active,
  475 +.datepicker table tr td.selected:hover.active,
  476 +.datepicker table tr td.selected.disabled.active,
  477 +.datepicker table tr td.selected.disabled:hover.active {
  478 + background-color: #666666 \9;
  479 +}
  480 +.datepicker table tr td.active,
  481 +.datepicker table tr td.active:hover,
  482 +.datepicker table tr td.active.disabled,
  483 +.datepicker table tr td.active.disabled:hover {
  484 + background-color: #006dcc;
  485 + background-image: -moz-linear-gradient(top, #0088cc, #0044cc);
  486 + background-image: -ms-linear-gradient(top, #0088cc, #0044cc);
  487 + background-image: -webkit-gradient(linear, 0 0, 0 100%, from(#0088cc), to(#0044cc));
  488 + background-image: -webkit-linear-gradient(top, #0088cc, #0044cc);
  489 + background-image: -o-linear-gradient(top, #0088cc, #0044cc);
  490 + background-image: linear-gradient(top, #0088cc, #0044cc);
  491 + background-repeat: repeat-x;
  492 + filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#0088cc', endColorstr='#0044cc', GradientType=0);
  493 + border-color: #0044cc #0044cc #002a80;
  494 + border-color: rgba(0, 0, 0, 0.1) rgba(0, 0, 0, 0.1) rgba(0, 0, 0, 0.25);
  495 + filter: progid:DXImageTransform.Microsoft.gradient(enabled=false);
  496 + color: #fff;
  497 + text-shadow: 0 -1px 0 rgba(0, 0, 0, 0.25);
  498 +}
  499 +.datepicker table tr td.active:hover,
  500 +.datepicker table tr td.active:hover:hover,
  501 +.datepicker table tr td.active.disabled:hover,
  502 +.datepicker table tr td.active.disabled:hover:hover,
  503 +.datepicker table tr td.active:active,
  504 +.datepicker table tr td.active:hover:active,
  505 +.datepicker table tr td.active.disabled:active,
  506 +.datepicker table tr td.active.disabled:hover:active,
  507 +.datepicker table tr td.active.active,
  508 +.datepicker table tr td.active:hover.active,
  509 +.datepicker table tr td.active.disabled.active,
  510 +.datepicker table tr td.active.disabled:hover.active,
  511 +.datepicker table tr td.active.disabled,
  512 +.datepicker table tr td.active:hover.disabled,
  513 +.datepicker table tr td.active.disabled.disabled,
  514 +.datepicker table tr td.active.disabled:hover.disabled,
  515 +.datepicker table tr td.active[disabled],
  516 +.datepicker table tr td.active:hover[disabled],
  517 +.datepicker table tr td.active.disabled[disabled],
  518 +.datepicker table tr td.active.disabled:hover[disabled] {
  519 + background-color: #0044cc;
  520 +}
  521 +.datepicker table tr td.active:active,
  522 +.datepicker table tr td.active:hover:active,
  523 +.datepicker table tr td.active.disabled:active,
  524 +.datepicker table tr td.active.disabled:hover:active,
  525 +.datepicker table tr td.active.active,
  526 +.datepicker table tr td.active:hover.active,
  527 +.datepicker table tr td.active.disabled.active,
  528 +.datepicker table tr td.active.disabled:hover.active {
  529 + background-color: #003399 \9;
  530 +}
  531 +.datepicker table tr td span {
  532 + display: block;
  533 + width: 23%;
  534 + height: 54px;
  535 + line-height: 54px;
  536 + float: left;
  537 + margin: 1%;
  538 + cursor: pointer;
  539 + -webkit-border-radius: 4px;
  540 + -moz-border-radius: 4px;
  541 + border-radius: 4px;
  542 +}
  543 +.datepicker table tr td span:hover {
  544 + background: #eeeeee;
  545 +}
  546 +.datepicker table tr td span.disabled,
  547 +.datepicker table tr td span.disabled:hover {
  548 + background: none;
  549 + color: #999999;
  550 + cursor: default;
  551 +}
  552 +.datepicker table tr td span.active,
  553 +.datepicker table tr td span.active:hover,
  554 +.datepicker table tr td span.active.disabled,
  555 +.datepicker table tr td span.active.disabled:hover {
  556 + background-color: #006dcc;
  557 + background-image: -moz-linear-gradient(top, #0088cc, #0044cc);
  558 + background-image: -ms-linear-gradient(top, #0088cc, #0044cc);
  559 + background-image: -webkit-gradient(linear, 0 0, 0 100%, from(#0088cc), to(#0044cc));
  560 + background-image: -webkit-linear-gradient(top, #0088cc, #0044cc);
  561 + background-image: -o-linear-gradient(top, #0088cc, #0044cc);
  562 + background-image: linear-gradient(top, #0088cc, #0044cc);
  563 + background-repeat: repeat-x;
  564 + filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#0088cc', endColorstr='#0044cc', GradientType=0);
  565 + border-color: #0044cc #0044cc #002a80;
  566 + border-color: rgba(0, 0, 0, 0.1) rgba(0, 0, 0, 0.1) rgba(0, 0, 0, 0.25);
  567 + filter: progid:DXImageTransform.Microsoft.gradient(enabled=false);
  568 + color: #fff;
  569 + text-shadow: 0 -1px 0 rgba(0, 0, 0, 0.25);
  570 +}
  571 +.datepicker table tr td span.active:hover,
  572 +.datepicker table tr td span.active:hover:hover,
  573 +.datepicker table tr td span.active.disabled:hover,
  574 +.datepicker table tr td span.active.disabled:hover:hover,
  575 +.datepicker table tr td span.active:active,
  576 +.datepicker table tr td span.active:hover:active,
  577 +.datepicker table tr td span.active.disabled:active,
  578 +.datepicker table tr td span.active.disabled:hover:active,
  579 +.datepicker table tr td span.active.active,
  580 +.datepicker table tr td span.active:hover.active,
  581 +.datepicker table tr td span.active.disabled.active,
  582 +.datepicker table tr td span.active.disabled:hover.active,
  583 +.datepicker table tr td span.active.disabled,
  584 +.datepicker table tr td span.active:hover.disabled,
  585 +.datepicker table tr td span.active.disabled.disabled,
  586 +.datepicker table tr td span.active.disabled:hover.disabled,
  587 +.datepicker table tr td span.active[disabled],
  588 +.datepicker table tr td span.active:hover[disabled],
  589 +.datepicker table tr td span.active.disabled[disabled],
  590 +.datepicker table tr td span.active.disabled:hover[disabled] {
  591 + background-color: #0044cc;
  592 +}
  593 +.datepicker table tr td span.active:active,
  594 +.datepicker table tr td span.active:hover:active,
  595 +.datepicker table tr td span.active.disabled:active,
  596 +.datepicker table tr td span.active.disabled:hover:active,
  597 +.datepicker table tr td span.active.active,
  598 +.datepicker table tr td span.active:hover.active,
  599 +.datepicker table tr td span.active.disabled.active,
  600 +.datepicker table tr td span.active.disabled:hover.active {
  601 + background-color: #003399 \9;
  602 +}
  603 +.datepicker table tr td span.old,
  604 +.datepicker table tr td span.new {
  605 + color: #999999;
  606 +}
  607 +.datepicker th.datepicker-switch {
  608 + width: 145px;
  609 +}
  610 +.datepicker thead tr:first-child th,
  611 +.datepicker tfoot tr th {
  612 + cursor: pointer;
  613 +}
  614 +.datepicker thead tr:first-child th:hover,
  615 +.datepicker tfoot tr th:hover {
  616 + background: #eeeeee;
  617 +}
  618 +.datepicker .cw {
  619 + font-size: 10px;
  620 + width: 12px;
  621 + padding: 0 2px 0 5px;
  622 + vertical-align: middle;
  623 +}
  624 +.datepicker thead tr:first-child th.cw {
  625 + cursor: default;
  626 + background-color: transparent;
  627 +}
  628 +.input-append.date .add-on i,
  629 +.input-prepend.date .add-on i {
  630 + display: block;
  631 + cursor: pointer;
  632 + width: 16px;
  633 + height: 16px;
  634 +}
  635 +.input-daterange input {
  636 + text-align: center;
  637 +}
  638 +.input-daterange input:first-child {
  639 + -webkit-border-radius: 3px 0 0 3px;
  640 + -moz-border-radius: 3px 0 0 3px;
  641 + border-radius: 3px 0 0 3px;
  642 +}
  643 +.input-daterange input:last-child {
  644 + -webkit-border-radius: 0 3px 3px 0;
  645 + -moz-border-radius: 0 3px 3px 0;
  646 + border-radius: 0 3px 3px 0;
  647 +}
  648 +.input-daterange .add-on {
  649 + display: inline-block;
  650 + width: auto;
  651 + min-width: 16px;
  652 + height: 18px;
  653 + padding: 4px 5px;
  654 + font-weight: normal;
  655 + line-height: 18px;
  656 + text-align: center;
  657 + text-shadow: 0 1px 0 #ffffff;
  658 + vertical-align: middle;
  659 + background-color: #eeeeee;
  660 + border: 1px solid #ccc;
  661 + margin-left: -5px;
  662 + margin-right: -5px;
  663 +}
0 664 \ No newline at end of file
... ...
src/main/resources/static/ajax/libs/bootstrap-table/extensions/editable/bootstrap-editable.min.js 0 → 100644
  1 +/*! X-editable - v1.5.1
  2 +* In-place editing with Twitter Bootstrap, jQuery UI or pure jQuery
  3 +* http://github.com/vitalets/x-editable
  4 +* Copyright (c) 2013 Vitaliy Potapov; Licensed MIT */
  5 +!function(a){"use strict";var b=function(b,c){this.options=a.extend({},a.fn.editableform.defaults,c),this.$div=a(b),this.options.scope||(this.options.scope=this)};b.prototype={constructor:b,initInput:function(){this.input=this.options.input,this.value=this.input.str2value(this.options.value),this.input.prerender()},initTemplate:function(){this.$form=a(a.fn.editableform.template)},initButtons:function(){var b=this.$form.find(".editable-buttons");b.append(a.fn.editableform.buttons),"bottom"===this.options.showbuttons&&b.addClass("editable-buttons-bottom")},render:function(){this.$loading=a(a.fn.editableform.loading),this.$div.empty().append(this.$loading),this.initTemplate(),this.options.showbuttons?this.initButtons():this.$form.find(".editable-buttons").remove(),this.showLoading(),this.isSaving=!1,this.$div.triggerHandler("rendering"),this.initInput(),this.$form.find("div.editable-input").append(this.input.$tpl),this.$div.append(this.$form),a.when(this.input.render()).then(a.proxy(function(){if(this.options.showbuttons||this.input.autosubmit(),this.$form.find(".editable-cancel").click(a.proxy(this.cancel,this)),this.input.error)this.error(this.input.error),this.$form.find(".editable-submit").attr("disabled",!0),this.input.$input.attr("disabled",!0),this.$form.submit(function(a){a.preventDefault()});else{this.error(!1),this.input.$input.removeAttr("disabled"),this.$form.find(".editable-submit").removeAttr("disabled");var b=null===this.value||void 0===this.value||""===this.value?this.options.defaultValue:this.value;this.input.value2input(b),this.$form.submit(a.proxy(this.submit,this))}this.$div.triggerHandler("rendered"),this.showForm(),this.input.postrender&&this.input.postrender()},this))},cancel:function(){this.$div.triggerHandler("cancel")},showLoading:function(){var a,b;this.$form?(a=this.$form.outerWidth(),b=this.$form.outerHeight(),a&&this.$loading.width(a),b&&this.$loading.height(b),this.$form.hide()):(a=this.$loading.parent().width(),a&&this.$loading.width(a)),this.$loading.show()},showForm:function(a){this.$loading.hide(),this.$form.show(),a!==!1&&this.input.activate(),this.$div.triggerHandler("show")},error:function(b){var c,d=this.$form.find(".control-group"),e=this.$form.find(".editable-error-block");if(b===!1)d.removeClass(a.fn.editableform.errorGroupClass),e.removeClass(a.fn.editableform.errorBlockClass).empty().hide();else{if(b){c=(""+b).split("\n");for(var f=0;f<c.length;f++)c[f]=a("<div>").text(c[f]).html();b=c.join("<br>")}d.addClass(a.fn.editableform.errorGroupClass),e.addClass(a.fn.editableform.errorBlockClass).html(b).show()}},submit:function(b){b.stopPropagation(),b.preventDefault();var c=this.input.input2value(),d=this.validate(c);if("object"===a.type(d)&&void 0!==d.newValue){if(c=d.newValue,this.input.value2input(c),"string"==typeof d.msg)return this.error(d.msg),this.showForm(),void 0}else if(d)return this.error(d),this.showForm(),void 0;if(!this.options.savenochange&&this.input.value2str(c)==this.input.value2str(this.value))return this.$div.triggerHandler("nochange"),void 0;var e=this.input.value2submit(c);this.isSaving=!0,a.when(this.save(e)).done(a.proxy(function(a){this.isSaving=!1;var b="function"==typeof this.options.success?this.options.success.call(this.options.scope,a,c):null;return b===!1?(this.error(!1),this.showForm(!1),void 0):"string"==typeof b?(this.error(b),this.showForm(),void 0):(b&&"object"==typeof b&&b.hasOwnProperty("newValue")&&(c=b.newValue),this.error(!1),this.value=c,this.$div.triggerHandler("save",{newValue:c,submitValue:e,response:a}),void 0)},this)).fail(a.proxy(function(a){this.isSaving=!1;var b;b="function"==typeof this.options.error?this.options.error.call(this.options.scope,a,c):"string"==typeof a?a:a.responseText||a.statusText||"Unknown error!",this.error(b),this.showForm()},this))},save:function(b){this.options.pk=a.fn.editableutils.tryParseJson(this.options.pk,!0);var c,d="function"==typeof this.options.pk?this.options.pk.call(this.options.scope):this.options.pk,e=!!("function"==typeof this.options.url||this.options.url&&("always"===this.options.send||"auto"===this.options.send&&null!==d&&void 0!==d));return e?(this.showLoading(),c={name:this.options.name||"",value:b,pk:d},"function"==typeof this.options.params?c=this.options.params.call(this.options.scope,c):(this.options.params=a.fn.editableutils.tryParseJson(this.options.params,!0),a.extend(c,this.options.params)),"function"==typeof this.options.url?this.options.url.call(this.options.scope,c):a.ajax(a.extend({url:this.options.url,data:c,type:"POST"},this.options.ajaxOptions))):void 0},validate:function(a){return void 0===a&&(a=this.value),"function"==typeof this.options.validate?this.options.validate.call(this.options.scope,a):void 0},option:function(a,b){a in this.options&&(this.options[a]=b),"value"===a&&this.setValue(b)},setValue:function(a,b){this.value=b?this.input.str2value(a):a,this.$form&&this.$form.is(":visible")&&this.input.value2input(this.value)}},a.fn.editableform=function(c){var d=arguments;return this.each(function(){var e=a(this),f=e.data("editableform"),g="object"==typeof c&&c;f||e.data("editableform",f=new b(this,g)),"string"==typeof c&&f[c].apply(f,Array.prototype.slice.call(d,1))})},a.fn.editableform.Constructor=b,a.fn.editableform.defaults={type:"text",url:null,params:null,name:null,pk:null,value:null,defaultValue:null,send:"auto",validate:null,success:null,error:null,ajaxOptions:null,showbuttons:!0,scope:null,savenochange:!1},a.fn.editableform.template='<form class="form-inline editableform"><div class="control-group"><div><div class="editable-input"></div><div class="editable-buttons"></div></div><div class="editable-error-block"></div></div></form>',a.fn.editableform.loading='<div class="editableform-loading"></div>',a.fn.editableform.buttons='<button type="submit" class="editable-submit">ok</button><button type="button" class="editable-cancel">cancel</button>',a.fn.editableform.errorGroupClass=null,a.fn.editableform.errorBlockClass="editable-error",a.fn.editableform.engine="jquery"}(window.jQuery),function(a){"use strict";a.fn.editableutils={inherit:function(a,b){var c=function(){};c.prototype=b.prototype,a.prototype=new c,a.prototype.constructor=a,a.superclass=b.prototype},setCursorPosition:function(a,b){if(a.setSelectionRange)a.setSelectionRange(b,b);else if(a.createTextRange){var c=a.createTextRange();c.collapse(!0),c.moveEnd("character",b),c.moveStart("character",b),c.select()}},tryParseJson:function(a,b){if("string"==typeof a&&a.length&&a.match(/^[\{\[].*[\}\]]$/))if(b)try{a=new Function("return "+a)()}catch(c){}finally{return a}else a=new Function("return "+a)();return a},sliceObj:function(b,c,d){var e,f,g={};if(!a.isArray(c)||!c.length)return g;for(var h=0;h<c.length;h++)e=c[h],b.hasOwnProperty(e)&&(g[e]=b[e]),d!==!0&&(f=e.toLowerCase(),b.hasOwnProperty(f)&&(g[e]=b[f]));return g},getConfigData:function(b){var c={};return a.each(b.data(),function(a,b){("object"!=typeof b||b&&"object"==typeof b&&(b.constructor===Object||b.constructor===Array))&&(c[a]=b)}),c},objectKeys:function(a){if(Object.keys)return Object.keys(a);if(a!==Object(a))throw new TypeError("Object.keys called on a non-object");var b,c=[];for(b in a)Object.prototype.hasOwnProperty.call(a,b)&&c.push(b);return c},escape:function(b){return a("<div>").text(b).html()},itemsByValue:function(b,c,d){if(!c||null===b)return[];if("function"!=typeof d){var e=d||"value";d=function(a){return a[e]}}var f=a.isArray(b),g=[],h=this;return a.each(c,function(c,e){if(e.children)g=g.concat(h.itemsByValue(b,e.children,d));else if(f)a.grep(b,function(a){return a==(e&&"object"==typeof e?d(e):e)}).length&&g.push(e);else{var i=e&&"object"==typeof e?d(e):e;b==i&&g.push(e)}}),g},createInput:function(b){var c,d,e,f=b.type;return"date"===f&&("inline"===b.mode?a.fn.editabletypes.datefield?f="datefield":a.fn.editabletypes.dateuifield&&(f="dateuifield"):a.fn.editabletypes.date?f="date":a.fn.editabletypes.dateui&&(f="dateui"),"date"!==f||a.fn.editabletypes.date||(f="combodate")),"datetime"===f&&"inline"===b.mode&&(f="datetimefield"),"wysihtml5"!==f||a.fn.editabletypes[f]||(f="textarea"),"function"==typeof a.fn.editabletypes[f]?(c=a.fn.editabletypes[f],d=this.sliceObj(b,this.objectKeys(c.defaults)),e=new c(d)):(a.error("Unknown type: "+f),!1)},supportsTransitions:function(){var a=document.body||document.documentElement,b=a.style,c="transition",d=["Moz","Webkit","Khtml","O","ms"];if("string"==typeof b[c])return!0;c=c.charAt(0).toUpperCase()+c.substr(1);for(var e=0;e<d.length;e++)if("string"==typeof b[d[e]+c])return!0;return!1}}}(window.jQuery),function(a){"use strict";var b=function(a,b){this.init(a,b)},c=function(a,b){this.init(a,b)};b.prototype={containerName:null,containerDataName:null,innerCss:null,containerClass:"editable-container editable-popup",defaults:{},init:function(c,d){this.$element=a(c),this.options=a.extend({},a.fn.editableContainer.defaults,d),this.splitOptions(),this.formOptions.scope=this.$element[0],this.initContainer(),this.delayedHide=!1,this.$element.on("destroyed",a.proxy(function(){this.destroy()},this)),a(document).data("editable-handlers-attached")||(a(document).on("keyup.editable",function(b){27===b.which&&a(".editable-open").editableContainer("hide")}),a(document).on("click.editable",function(c){var d,e=a(c.target),f=[".editable-container",".ui-datepicker-header",".datepicker",".modal-backdrop",".bootstrap-wysihtml5-insert-image-modal",".bootstrap-wysihtml5-insert-link-modal"];if(a.contains(document.documentElement,c.target)&&!e.is(document)){for(d=0;d<f.length;d++)if(e.is(f[d])||e.parents(f[d]).length)return;b.prototype.closeOthers(c.target)}}),a(document).data("editable-handlers-attached",!0))},splitOptions:function(){if(this.containerOptions={},this.formOptions={},!a.fn[this.containerName])throw new Error(this.containerName+" not found. Have you included corresponding js file?");for(var b in this.options)b in this.defaults?this.containerOptions[b]=this.options[b]:this.formOptions[b]=this.options[b]},tip:function(){return this.container()?this.container().$tip:null},container:function(){var a;return this.containerDataName&&(a=this.$element.data(this.containerDataName))?a:a=this.$element.data(this.containerName)},call:function(){this.$element[this.containerName].apply(this.$element,arguments)},initContainer:function(){this.call(this.containerOptions)},renderForm:function(){this.$form.editableform(this.formOptions).on({save:a.proxy(this.save,this),nochange:a.proxy(function(){this.hide("nochange")},this),cancel:a.proxy(function(){this.hide("cancel")},this),show:a.proxy(function(){this.delayedHide?(this.hide(this.delayedHide.reason),this.delayedHide=!1):this.setPosition()},this),rendering:a.proxy(this.setPosition,this),resize:a.proxy(this.setPosition,this),rendered:a.proxy(function(){this.$element.triggerHandler("shown",a(this.options.scope).data("editable"))},this)}).editableform("render")},show:function(b){this.$element.addClass("editable-open"),b!==!1&&this.closeOthers(this.$element[0]),this.innerShow(),this.tip().addClass(this.containerClass),this.$form,this.$form=a("<div>"),this.tip().is(this.innerCss)?this.tip().append(this.$form):this.tip().find(this.innerCss).append(this.$form),this.renderForm()},hide:function(a){if(this.tip()&&this.tip().is(":visible")&&this.$element.hasClass("editable-open")){if(this.$form.data("editableform").isSaving)return this.delayedHide={reason:a},void 0;this.delayedHide=!1,this.$element.removeClass("editable-open"),this.innerHide(),this.$element.triggerHandler("hidden",a||"manual")}},innerShow:function(){},innerHide:function(){},toggle:function(a){this.container()&&this.tip()&&this.tip().is(":visible")?this.hide():this.show(a)},setPosition:function(){},save:function(a,b){this.$element.triggerHandler("save",b),this.hide("save")},option:function(a,b){this.options[a]=b,a in this.containerOptions?(this.containerOptions[a]=b,this.setContainerOption(a,b)):(this.formOptions[a]=b,this.$form&&this.$form.editableform("option",a,b))},setContainerOption:function(a,b){this.call("option",a,b)},destroy:function(){this.hide(),this.innerDestroy(),this.$element.off("destroyed"),this.$element.removeData("editableContainer")},innerDestroy:function(){},closeOthers:function(b){a(".editable-open").each(function(c,d){if(d!==b&&!a(d).find(b).length){var e=a(d),f=e.data("editableContainer");f&&("cancel"===f.options.onblur?e.data("editableContainer").hide("onblur"):"submit"===f.options.onblur&&e.data("editableContainer").tip().find("form").submit())}})},activate:function(){this.tip&&this.tip().is(":visible")&&this.$form&&this.$form.data("editableform").input.activate()}},a.fn.editableContainer=function(d){var e=arguments;return this.each(function(){var f=a(this),g="editableContainer",h=f.data(g),i="object"==typeof d&&d,j="inline"===i.mode?c:b;h||f.data(g,h=new j(this,i)),"string"==typeof d&&h[d].apply(h,Array.prototype.slice.call(e,1))})},a.fn.editableContainer.Popup=b,a.fn.editableContainer.Inline=c,a.fn.editableContainer.defaults={value:null,placement:"top",autohide:!0,onblur:"cancel",anim:!1,mode:"popup"},jQuery.event.special.destroyed={remove:function(a){a.handler&&a.handler()}}}(window.jQuery),function(a){"use strict";a.extend(a.fn.editableContainer.Inline.prototype,a.fn.editableContainer.Popup.prototype,{containerName:"editableform",innerCss:".editable-inline",containerClass:"editable-container editable-inline",initContainer:function(){this.$tip=a("<span></span>"),this.options.anim||(this.options.anim=0)},splitOptions:function(){this.containerOptions={},this.formOptions=this.options},tip:function(){return this.$tip},innerShow:function(){this.$element.hide(),this.tip().insertAfter(this.$element).show()},innerHide:function(){this.$tip.hide(this.options.anim,a.proxy(function(){this.$element.show(),this.innerDestroy()},this))},innerDestroy:function(){this.tip()&&this.tip().empty().remove()}})}(window.jQuery),function(a){"use strict";var b=function(b,c){this.$element=a(b),this.options=a.extend({},a.fn.editable.defaults,c,a.fn.editableutils.getConfigData(this.$element)),this.options.selector?this.initLive():this.init(),this.options.highlight&&!a.fn.editableutils.supportsTransitions()&&(this.options.highlight=!1)};b.prototype={constructor:b,init:function(){var b,c=!1;if(this.options.name=this.options.name||this.$element.attr("id"),this.options.scope=this.$element[0],this.input=a.fn.editableutils.createInput(this.options),this.input){switch(void 0===this.options.value||null===this.options.value?(this.value=this.input.html2value(a.trim(this.$element.html())),c=!0):(this.options.value=a.fn.editableutils.tryParseJson(this.options.value,!0),this.value="string"==typeof this.options.value?this.input.str2value(this.options.value):this.options.value),this.$element.addClass("editable"),"textarea"===this.input.type&&this.$element.addClass("editable-pre-wrapped"),"manual"!==this.options.toggle?(this.$element.addClass("editable-click"),this.$element.on(this.options.toggle+".editable",a.proxy(function(a){if(this.options.disabled||a.preventDefault(),"mouseenter"===this.options.toggle)this.show();else{var b="click"!==this.options.toggle;this.toggle(b)}},this))):this.$element.attr("tabindex",-1),"function"==typeof this.options.display&&(this.options.autotext="always"),this.options.autotext){case"always":b=!0;break;case"auto":b=!a.trim(this.$element.text()).length&&null!==this.value&&void 0!==this.value&&!c;break;default:b=!1}a.when(b?this.render():!0).then(a.proxy(function(){this.options.disabled?this.disable():this.enable(),this.$element.triggerHandler("init",this)},this))}},initLive:function(){var b=this.options.selector;this.options.selector=!1,this.options.autotext="never",this.$element.on(this.options.toggle+".editable",b,a.proxy(function(b){var c=a(b.target);c.data("editable")||(c.hasClass(this.options.emptyclass)&&c.empty(),c.editable(this.options).trigger(b))},this))},render:function(a){return this.options.display!==!1?this.input.value2htmlFinal?this.input.value2html(this.value,this.$element[0],this.options.display,a):"function"==typeof this.options.display?this.options.display.call(this.$element[0],this.value,a):this.input.value2html(this.value,this.$element[0]):void 0},enable:function(){this.options.disabled=!1,this.$element.removeClass("editable-disabled"),this.handleEmpty(this.isEmpty),"manual"!==this.options.toggle&&"-1"===this.$element.attr("tabindex")&&this.$element.removeAttr("tabindex")},disable:function(){this.options.disabled=!0,this.hide(),this.$element.addClass("editable-disabled"),this.handleEmpty(this.isEmpty),this.$element.attr("tabindex",-1)},toggleDisabled:function(){this.options.disabled?this.enable():this.disable()},option:function(b,c){return b&&"object"==typeof b?(a.each(b,a.proxy(function(b,c){this.option(a.trim(b),c)},this)),void 0):(this.options[b]=c,"disabled"===b?c?this.disable():this.enable():("value"===b&&this.setValue(c),this.container&&this.container.option(b,c),this.input.option&&this.input.option(b,c),void 0))},handleEmpty:function(b){this.options.display!==!1&&(this.isEmpty=void 0!==b?b:"function"==typeof this.input.isEmpty?this.input.isEmpty(this.$element):""===a.trim(this.$element.html()),this.options.disabled?this.isEmpty&&(this.$element.empty(),this.options.emptyclass&&this.$element.removeClass(this.options.emptyclass)):this.isEmpty?(this.$element.html(this.options.emptytext),this.options.emptyclass&&this.$element.addClass(this.options.emptyclass)):this.options.emptyclass&&this.$element.removeClass(this.options.emptyclass))},show:function(b){if(!this.options.disabled){if(this.container){if(this.container.tip().is(":visible"))return}else{var c=a.extend({},this.options,{value:this.value,input:this.input});this.$element.editableContainer(c),this.$element.on("save.internal",a.proxy(this.save,this)),this.container=this.$element.data("editableContainer")}this.container.show(b)}},hide:function(){this.container&&this.container.hide()},toggle:function(a){this.container&&this.container.tip().is(":visible")?this.hide():this.show(a)},save:function(a,b){if(this.options.unsavedclass){var c=!1;c=c||"function"==typeof this.options.url,c=c||this.options.display===!1,c=c||void 0!==b.response,c=c||this.options.savenochange&&this.input.value2str(this.value)!==this.input.value2str(b.newValue),c?this.$element.removeClass(this.options.unsavedclass):this.$element.addClass(this.options.unsavedclass)}if(this.options.highlight){var d=this.$element,e=d.css("background-color");d.css("background-color",this.options.highlight),setTimeout(function(){"transparent"===e&&(e=""),d.css("background-color",e),d.addClass("editable-bg-transition"),setTimeout(function(){d.removeClass("editable-bg-transition")},1700)},10)}this.setValue(b.newValue,!1,b.response)},validate:function(){return"function"==typeof this.options.validate?this.options.validate.call(this,this.value):void 0},setValue:function(b,c,d){this.value=c?this.input.str2value(b):b,this.container&&this.container.option("value",this.value),a.when(this.render(d)).then(a.proxy(function(){this.handleEmpty()},this))},activate:function(){this.container&&this.container.activate()},destroy:function(){this.disable(),this.container&&this.container.destroy(),this.input.destroy(),"manual"!==this.options.toggle&&(this.$element.removeClass("editable-click"),this.$element.off(this.options.toggle+".editable")),this.$element.off("save.internal"),this.$element.removeClass("editable editable-open editable-disabled"),this.$element.removeData("editable")}},a.fn.editable=function(c){var d={},e=arguments,f="editable";switch(c){case"validate":return this.each(function(){var b,c=a(this),e=c.data(f);e&&(b=e.validate())&&(d[e.options.name]=b)}),d;case"getValue":return 2===arguments.length&&arguments[1]===!0?d=this.eq(0).data(f).value:this.each(function(){var b=a(this),c=b.data(f);c&&void 0!==c.value&&null!==c.value&&(d[c.options.name]=c.input.value2submit(c.value))}),d;case"submit":var g=arguments[1]||{},h=this,i=this.editable("validate");if(a.isEmptyObject(i)){var j={};if(1===h.length){var k=h.data("editable"),l={name:k.options.name||"",value:k.input.value2submit(k.value),pk:"function"==typeof k.options.pk?k.options.pk.call(k.options.scope):k.options.pk};"function"==typeof k.options.params?l=k.options.params.call(k.options.scope,l):(k.options.params=a.fn.editableutils.tryParseJson(k.options.params,!0),a.extend(l,k.options.params)),j={url:k.options.url,data:l,type:"POST"},g.success=g.success||k.options.success,g.error=g.error||k.options.error}else{var m=this.editable("getValue");j={url:g.url,data:m,type:"POST"}}j.success="function"==typeof g.success?function(a){g.success.call(h,a,g)}:a.noop,j.error="function"==typeof g.error?function(){g.error.apply(h,arguments)}:a.noop,g.ajaxOptions&&a.extend(j,g.ajaxOptions),g.data&&a.extend(j.data,g.data),a.ajax(j)}else"function"==typeof g.error&&g.error.call(h,i);return this}return this.each(function(){var d=a(this),g=d.data(f),h="object"==typeof c&&c;return h&&h.selector?(g=new b(this,h),void 0):(g||d.data(f,g=new b(this,h)),"string"==typeof c&&g[c].apply(g,Array.prototype.slice.call(e,1)),void 0)})},a.fn.editable.defaults={type:"text",disabled:!1,toggle:"click",emptytext:"Empty",autotext:"auto",value:null,display:null,emptyclass:"editable-empty",unsavedclass:"editable-unsaved",selector:null,highlight:"#FFFF80"}}(window.jQuery),function(a){"use strict";a.fn.editabletypes={};var b=function(){};b.prototype={init:function(b,c,d){this.type=b,this.options=a.extend({},d,c)},prerender:function(){this.$tpl=a(this.options.tpl),this.$input=this.$tpl,this.$clear=null,this.error=null},render:function(){},value2html:function(b,c){a(c)[this.options.escape?"text":"html"](a.trim(b))},html2value:function(b){return a("<div>").html(b).text()},value2str:function(a){return a},str2value:function(a){return a},value2submit:function(a){return a},value2input:function(a){this.$input.val(a)},input2value:function(){return this.$input.val()},activate:function(){this.$input.is(":visible")&&this.$input.focus()},clear:function(){this.$input.val(null)},escape:function(b){return a("<div>").text(b).html()},autosubmit:function(){},destroy:function(){},setClass:function(){this.options.inputclass&&this.$input.addClass(this.options.inputclass)},setAttr:function(a){void 0!==this.options[a]&&null!==this.options[a]&&this.$input.attr(a,this.options[a])},option:function(a,b){this.options[a]=b}},b.defaults={tpl:"",inputclass:null,escape:!0,scope:null,showbuttons:!0},a.extend(a.fn.editabletypes,{abstractinput:b})}(window.jQuery),function(a){"use strict";var b=function(){};a.fn.editableutils.inherit(b,a.fn.editabletypes.abstractinput),a.extend(b.prototype,{render:function(){var b=a.Deferred();return this.error=null,this.onSourceReady(function(){this.renderList(),b.resolve()},function(){this.error=this.options.sourceError,b.resolve()}),b.promise()},html2value:function(){return null},value2html:function(b,c,d,e){var f=a.Deferred(),g=function(){"function"==typeof d?d.call(c,b,this.sourceData,e):this.value2htmlFinal(b,c),f.resolve()};return null===b?g.call(this):this.onSourceReady(g,function(){f.resolve()}),f.promise()},onSourceReady:function(b,c){var d;if(a.isFunction(this.options.source)?(d=this.options.source.call(this.options.scope),this.sourceData=null):d=this.options.source,this.options.sourceCache&&a.isArray(this.sourceData))return b.call(this),void 0;try{d=a.fn.editableutils.tryParseJson(d,!1)}catch(e){return c.call(this),void 0}if("string"==typeof d){if(this.options.sourceCache){var f,g=d;if(a(document).data(g)||a(document).data(g,{}),f=a(document).data(g),f.loading===!1&&f.sourceData)return this.sourceData=f.sourceData,this.doPrepend(),b.call(this),void 0;if(f.loading===!0)return f.callbacks.push(a.proxy(function(){this.sourceData=f.sourceData,this.doPrepend(),b.call(this)},this)),f.err_callbacks.push(a.proxy(c,this)),void 0;f.loading=!0,f.callbacks=[],f.err_callbacks=[]}var h=a.extend({url:d,type:"get",cache:!1,dataType:"json",success:a.proxy(function(d){f&&(f.loading=!1),this.sourceData=this.makeArray(d),a.isArray(this.sourceData)?(f&&(f.sourceData=this.sourceData,a.each(f.callbacks,function(){this.call()})),this.doPrepend(),b.call(this)):(c.call(this),f&&a.each(f.err_callbacks,function(){this.call()}))},this),error:a.proxy(function(){c.call(this),f&&(f.loading=!1,a.each(f.err_callbacks,function(){this.call()}))},this)},this.options.sourceOptions);a.ajax(h)}else this.sourceData=this.makeArray(d),a.isArray(this.sourceData)?(this.doPrepend(),b.call(this)):c.call(this)},doPrepend:function(){null!==this.options.prepend&&void 0!==this.options.prepend&&(a.isArray(this.prependData)||(a.isFunction(this.options.prepend)&&(this.options.prepend=this.options.prepend.call(this.options.scope)),this.options.prepend=a.fn.editableutils.tryParseJson(this.options.prepend,!0),"string"==typeof this.options.prepend&&(this.options.prepend={"":this.options.prepend}),this.prependData=this.makeArray(this.options.prepend)),a.isArray(this.prependData)&&a.isArray(this.sourceData)&&(this.sourceData=this.prependData.concat(this.sourceData)))},renderList:function(){},value2htmlFinal:function(){},makeArray:function(b){var c,d,e,f,g=[];if(!b||"string"==typeof b)return null;if(a.isArray(b)){f=function(a,b){return d={value:a,text:b},c++>=2?!1:void 0};for(var h=0;h<b.length;h++)e=b[h],"object"==typeof e?(c=0,a.each(e,f),1===c?g.push(d):c>1&&(e.children&&(e.children=this.makeArray(e.children)),g.push(e))):g.push({value:e,text:e})}else a.each(b,function(a,b){g.push({value:a,text:b})});return g},option:function(a,b){this.options[a]=b,"source"===a&&(this.sourceData=null),"prepend"===a&&(this.prependData=null)}}),b.defaults=a.extend({},a.fn.editabletypes.abstractinput.defaults,{source:null,prepend:!1,sourceError:"Error when loading list",sourceCache:!0,sourceOptions:null}),a.fn.editabletypes.list=b}(window.jQuery),function(a){"use strict";var b=function(a){this.init("text",a,b.defaults)};a.fn.editableutils.inherit(b,a.fn.editabletypes.abstractinput),a.extend(b.prototype,{render:function(){this.renderClear(),this.setClass(),this.setAttr("placeholder")},activate:function(){this.$input.is(":visible")&&(this.$input.focus(),a.fn.editableutils.setCursorPosition(this.$input.get(0),this.$input.val().length),this.toggleClear&&this.toggleClear())},renderClear:function(){this.options.clear&&(this.$clear=a('<span class="editable-clear-x"></span>'),this.$input.after(this.$clear).css("padding-right",24).keyup(a.proxy(function(b){if(!~a.inArray(b.keyCode,[40,38,9,13,27])){clearTimeout(this.t);var c=this;this.t=setTimeout(function(){c.toggleClear(b)},100)}},this)).parent().css("position","relative"),this.$clear.click(a.proxy(this.clear,this)))},postrender:function(){},toggleClear:function(){if(this.$clear){var a=this.$input.val().length,b=this.$clear.is(":visible");a&&!b&&this.$clear.show(),!a&&b&&this.$clear.hide()}},clear:function(){this.$clear.hide(),this.$input.val("").focus()}}),b.defaults=a.extend({},a.fn.editabletypes.abstractinput.defaults,{tpl:'<input type="text">',placeholder:null,clear:!0}),a.fn.editabletypes.text=b}(window.jQuery),function(a){"use strict";var b=function(a){this.init("textarea",a,b.defaults)};a.fn.editableutils.inherit(b,a.fn.editabletypes.abstractinput),a.extend(b.prototype,{render:function(){this.setClass(),this.setAttr("placeholder"),this.setAttr("rows"),this.$input.keydown(function(b){b.ctrlKey&&13===b.which&&a(this).closest("form").submit()})},activate:function(){a.fn.editabletypes.text.prototype.activate.call(this)}}),b.defaults=a.extend({},a.fn.editabletypes.abstractinput.defaults,{tpl:"<textarea></textarea>",inputclass:"input-large",placeholder:null,rows:7}),a.fn.editabletypes.textarea=b}(window.jQuery),function(a){"use strict";var b=function(a){this.init("select",a,b.defaults)};a.fn.editableutils.inherit(b,a.fn.editabletypes.list),a.extend(b.prototype,{renderList:function(){this.$input.empty();var b=function(c,d){var e;if(a.isArray(d))for(var f=0;f<d.length;f++)e={},d[f].children?(e.label=d[f].text,c.append(b(a("<optgroup>",e),d[f].children))):(e.value=d[f].value,d[f].disabled&&(e.disabled=!0),c.append(a("<option>",e).text(d[f].text)));return c};b(this.$input,this.sourceData),this.setClass(),this.$input.on("keydown.editable",function(b){13===b.which&&a(this).closest("form").submit()})},value2htmlFinal:function(b,c){var d="",e=a.fn.editableutils.itemsByValue(b,this.sourceData);e.length&&(d=e[0].text),a.fn.editabletypes.abstractinput.prototype.value2html.call(this,d,c)},autosubmit:function(){this.$input.off("keydown.editable").on("change.editable",function(){a(this).closest("form").submit()})}}),b.defaults=a.extend({},a.fn.editabletypes.list.defaults,{tpl:"<select></select>"}),a.fn.editabletypes.select=b}(window.jQuery),function(a){"use strict";var b=function(a){this.init("checklist",a,b.defaults)};a.fn.editableutils.inherit(b,a.fn.editabletypes.list),a.extend(b.prototype,{renderList:function(){var b;if(this.$tpl.empty(),a.isArray(this.sourceData)){for(var c=0;c<this.sourceData.length;c++)b=a("<label>").append(a("<input>",{type:"checkbox",value:this.sourceData[c].value})).append(a("<span>").text(" "+this.sourceData[c].text)),a("<div>").append(b).appendTo(this.$tpl);this.$input=this.$tpl.find('input[type="checkbox"]'),this.setClass()}},value2str:function(b){return a.isArray(b)?b.sort().join(a.trim(this.options.separator)):""},str2value:function(b){var c,d=null;return"string"==typeof b&&b.length?(c=new RegExp("\\s*"+a.trim(this.options.separator)+"\\s*"),d=b.split(c)):d=a.isArray(b)?b:[b],d},value2input:function(b){this.$input.prop("checked",!1),a.isArray(b)&&b.length&&this.$input.each(function(c,d){var e=a(d);a.each(b,function(a,b){e.val()==b&&e.prop("checked",!0)})})},input2value:function(){var b=[];return this.$input.filter(":checked").each(function(c,d){b.push(a(d).val())}),b},value2htmlFinal:function(b,c){var d=[],e=a.fn.editableutils.itemsByValue(b,this.sourceData),f=this.options.escape;e.length?(a.each(e,function(b,c){var e=f?a.fn.editableutils.escape(c.text):c.text;d.push(e)}),a(c).html(d.join("<br>"))):a(c).empty()},activate:function(){this.$input.first().focus()},autosubmit:function(){this.$input.on("keydown",function(b){13===b.which&&a(this).closest("form").submit()})}}),b.defaults=a.extend({},a.fn.editabletypes.list.defaults,{tpl:'<div class="editable-checklist"></div>',inputclass:null,separator:","}),a.fn.editabletypes.checklist=b}(window.jQuery),function(a){"use strict";var b=function(a){this.init("password",a,b.defaults)};a.fn.editableutils.inherit(b,a.fn.editabletypes.text),a.extend(b.prototype,{value2html:function(b,c){b?a(c).text("[hidden]"):a(c).empty()},html2value:function(){return null}}),b.defaults=a.extend({},a.fn.editabletypes.text.defaults,{tpl:'<input type="password">'}),a.fn.editabletypes.password=b}(window.jQuery),function(a){"use strict";var b=function(a){this.init("email",a,b.defaults)};a.fn.editableutils.inherit(b,a.fn.editabletypes.text),b.defaults=a.extend({},a.fn.editabletypes.text.defaults,{tpl:'<input type="email">'}),a.fn.editabletypes.email=b}(window.jQuery),function(a){"use strict";var b=function(a){this.init("url",a,b.defaults)};a.fn.editableutils.inherit(b,a.fn.editabletypes.text),b.defaults=a.extend({},a.fn.editabletypes.text.defaults,{tpl:'<input type="url">'}),a.fn.editabletypes.url=b}(window.jQuery),function(a){"use strict";var b=function(a){this.init("tel",a,b.defaults)};a.fn.editableutils.inherit(b,a.fn.editabletypes.text),b.defaults=a.extend({},a.fn.editabletypes.text.defaults,{tpl:'<input type="tel">'}),a.fn.editabletypes.tel=b}(window.jQuery),function(a){"use strict";var b=function(a){this.init("number",a,b.defaults)};a.fn.editableutils.inherit(b,a.fn.editabletypes.text),a.extend(b.prototype,{render:function(){b.superclass.render.call(this),this.setAttr("min"),this.setAttr("max"),this.setAttr("step")},postrender:function(){this.$clear&&this.$clear.css({right:24})}}),b.defaults=a.extend({},a.fn.editabletypes.text.defaults,{tpl:'<input type="number">',inputclass:"input-mini",min:null,max:null,step:null}),a.fn.editabletypes.number=b}(window.jQuery),function(a){"use strict";
  6 +var b=function(a){this.init("range",a,b.defaults)};a.fn.editableutils.inherit(b,a.fn.editabletypes.number),a.extend(b.prototype,{render:function(){this.$input=this.$tpl.filter("input"),this.setClass(),this.setAttr("min"),this.setAttr("max"),this.setAttr("step"),this.$input.on("input",function(){a(this).siblings("output").text(a(this).val())})},activate:function(){this.$input.focus()}}),b.defaults=a.extend({},a.fn.editabletypes.number.defaults,{tpl:'<input type="range"><output style="width: 30px; display: inline-block"></output>',inputclass:"input-medium"}),a.fn.editabletypes.range=b}(window.jQuery),function(a){"use strict";var b=function(a){this.init("time",a,b.defaults)};a.fn.editableutils.inherit(b,a.fn.editabletypes.abstractinput),a.extend(b.prototype,{render:function(){this.setClass()}}),b.defaults=a.extend({},a.fn.editabletypes.abstractinput.defaults,{tpl:'<input type="time">'}),a.fn.editabletypes.time=b}(window.jQuery),function(a){"use strict";var b=function(c){if(this.init("select2",c,b.defaults),c.select2=c.select2||{},this.sourceData=null,c.placeholder&&(c.select2.placeholder=c.placeholder),!c.select2.tags&&c.source){var d=c.source;a.isFunction(c.source)&&(d=c.source.call(c.scope)),"string"==typeof d?(c.select2.ajax=c.select2.ajax||{},c.select2.ajax.data||(c.select2.ajax.data=function(a){return{query:a}}),c.select2.ajax.results||(c.select2.ajax.results=function(a){return{results:a}}),c.select2.ajax.url=d):(this.sourceData=this.convertSource(d),c.select2.data=this.sourceData)}if(this.options.select2=a.extend({},b.defaults.select2,c.select2),this.isMultiple=this.options.select2.tags||this.options.select2.multiple,this.isRemote="ajax"in this.options.select2,this.idFunc=this.options.select2.id,"function"!=typeof this.idFunc){var e=this.idFunc||"id";this.idFunc=function(a){return a[e]}}this.formatSelection=this.options.select2.formatSelection,"function"!=typeof this.formatSelection&&(this.formatSelection=function(a){return a.text})};a.fn.editableutils.inherit(b,a.fn.editabletypes.abstractinput),a.extend(b.prototype,{render:function(){this.setClass(),this.isRemote&&this.$input.on("select2-loaded",a.proxy(function(a){this.sourceData=a.items.results},this)),this.isMultiple&&this.$input.on("change",function(){a(this).closest("form").parent().triggerHandler("resize")})},value2html:function(c,d){var e,f="",g=this;this.options.select2.tags?e=c:this.sourceData&&(e=a.fn.editableutils.itemsByValue(c,this.sourceData,this.idFunc)),a.isArray(e)?(f=[],a.each(e,function(a,b){f.push(b&&"object"==typeof b?g.formatSelection(b):b)})):e&&(f=g.formatSelection(e)),f=a.isArray(f)?f.join(this.options.viewseparator):f,b.superclass.value2html.call(this,f,d)},html2value:function(a){return this.options.select2.tags?this.str2value(a,this.options.viewseparator):null},value2input:function(b){if(a.isArray(b)&&(b=b.join(this.getSeparator())),this.$input.data("select2")?this.$input.val(b).trigger("change",!0):(this.$input.val(b),this.$input.select2(this.options.select2)),this.isRemote&&!this.isMultiple&&!this.options.select2.initSelection){var c=this.options.select2.id,d=this.options.select2.formatSelection;if(!c&&!d){var e=a(this.options.scope);if(!e.data("editable").isEmpty){var f={id:b,text:e.text()};this.$input.select2("data",f)}}}},input2value:function(){return this.$input.select2("val")},str2value:function(b,c){if("string"!=typeof b||!this.isMultiple)return b;c=c||this.getSeparator();var d,e,f;if(null===b||b.length<1)return null;for(d=b.split(c),e=0,f=d.length;f>e;e+=1)d[e]=a.trim(d[e]);return d},autosubmit:function(){this.$input.on("change",function(b,c){c||a(this).closest("form").submit()})},getSeparator:function(){return this.options.select2.separator||a.fn.select2.defaults.separator},convertSource:function(b){if(a.isArray(b)&&b.length&&void 0!==b[0].value)for(var c=0;c<b.length;c++)void 0!==b[c].value&&(b[c].id=b[c].value,delete b[c].value);return b},destroy:function(){this.$input.data("select2")&&this.$input.select2("destroy")}}),b.defaults=a.extend({},a.fn.editabletypes.abstractinput.defaults,{tpl:'<input type="hidden">',select2:null,placeholder:null,source:null,viewseparator:", "}),a.fn.editabletypes.select2=b}(window.jQuery),function(a){var b=function(b,c){return this.$element=a(b),this.$element.is("input")?(this.options=a.extend({},a.fn.combodate.defaults,c,this.$element.data()),this.init(),void 0):(a.error("Combodate should be applied to INPUT element"),void 0)};b.prototype={constructor:b,init:function(){this.map={day:["D","date"],month:["M","month"],year:["Y","year"],hour:["[Hh]","hours"],minute:["m","minutes"],second:["s","seconds"],ampm:["[Aa]",""]},this.$widget=a('<span class="combodate"></span>').html(this.getTemplate()),this.initCombos(),this.$widget.on("change","select",a.proxy(function(b){this.$element.val(this.getValue()).change(),this.options.smartDays&&(a(b.target).is(".month")||a(b.target).is(".year"))&&this.fillCombo("day")},this)),this.$widget.find("select").css("width","auto"),this.$element.hide().after(this.$widget),this.setValue(this.$element.val()||this.options.value)},getTemplate:function(){var b=this.options.template;return a.each(this.map,function(a,c){c=c[0];var d=new RegExp(c+"+"),e=c.length>1?c.substring(1,2):c;b=b.replace(d,"{"+e+"}")}),b=b.replace(/ /g,"&nbsp;"),a.each(this.map,function(a,c){c=c[0];var d=c.length>1?c.substring(1,2):c;b=b.replace("{"+d+"}",'<select class="'+a+'"></select>')}),b},initCombos:function(){for(var a in this.map){var b=this.$widget.find("."+a);this["$"+a]=b.length?b:null,this.fillCombo(a)}},fillCombo:function(a){var b=this["$"+a];if(b){var c="fill"+a.charAt(0).toUpperCase()+a.slice(1),d=this[c](),e=b.val();b.empty();for(var f=0;f<d.length;f++)b.append('<option value="'+d[f][0]+'">'+d[f][1]+"</option>");b.val(e)}},fillCommon:function(a){var b,c=[];if("name"===this.options.firstItem){b=moment.relativeTime||moment.langData()._relativeTime;var d="function"==typeof b[a]?b[a](1,!0,a,!1):b[a];d=d.split(" ").reverse()[0],c.push(["",d])}else"empty"===this.options.firstItem&&c.push(["",""]);return c},fillDay:function(){var a,b,c=this.fillCommon("d"),d=-1!==this.options.template.indexOf("DD"),e=31;if(this.options.smartDays&&this.$month&&this.$year){var f=parseInt(this.$month.val(),10),g=parseInt(this.$year.val(),10);isNaN(f)||isNaN(g)||(e=moment([g,f]).daysInMonth())}for(b=1;e>=b;b++)a=d?this.leadZero(b):b,c.push([b,a]);return c},fillMonth:function(){var a,b,c=this.fillCommon("M"),d=-1!==this.options.template.indexOf("MMMM"),e=-1!==this.options.template.indexOf("MMM"),f=-1!==this.options.template.indexOf("MM");for(b=0;11>=b;b++)a=d?moment().date(1).month(b).format("MMMM"):e?moment().date(1).month(b).format("MMM"):f?this.leadZero(b+1):b+1,c.push([b,a]);return c},fillYear:function(){var a,b,c=[],d=-1!==this.options.template.indexOf("YYYY");for(b=this.options.maxYear;b>=this.options.minYear;b--)a=d?b:(b+"").substring(2),c[this.options.yearDescending?"push":"unshift"]([b,a]);return c=this.fillCommon("y").concat(c)},fillHour:function(){var a,b,c=this.fillCommon("h"),d=-1!==this.options.template.indexOf("h"),e=(-1!==this.options.template.indexOf("H"),-1!==this.options.template.toLowerCase().indexOf("hh")),f=d?1:0,g=d?12:23;for(b=f;g>=b;b++)a=e?this.leadZero(b):b,c.push([b,a]);return c},fillMinute:function(){var a,b,c=this.fillCommon("m"),d=-1!==this.options.template.indexOf("mm");for(b=0;59>=b;b+=this.options.minuteStep)a=d?this.leadZero(b):b,c.push([b,a]);return c},fillSecond:function(){var a,b,c=this.fillCommon("s"),d=-1!==this.options.template.indexOf("ss");for(b=0;59>=b;b+=this.options.secondStep)a=d?this.leadZero(b):b,c.push([b,a]);return c},fillAmpm:function(){var a=-1!==this.options.template.indexOf("a"),b=(-1!==this.options.template.indexOf("A"),[["am",a?"am":"AM"],["pm",a?"pm":"PM"]]);return b},getValue:function(b){var c,d={},e=this,f=!1;return a.each(this.map,function(a){if("ampm"!==a){var b="day"===a?1:0;return d[a]=e["$"+a]?parseInt(e["$"+a].val(),10):b,isNaN(d[a])?(f=!0,!1):void 0}}),f?"":(this.$ampm&&(d.hour=12===d.hour?"am"===this.$ampm.val()?0:12:"am"===this.$ampm.val()?d.hour:d.hour+12),c=moment([d.year,d.month,d.day,d.hour,d.minute,d.second]),this.highlight(c),b=void 0===b?this.options.format:b,null===b?c.isValid()?c:null:c.isValid()?c.format(b):"")},setValue:function(b){function c(b,c){var d={};return b.children("option").each(function(b,e){var f,g=a(e).attr("value");""!==g&&(f=Math.abs(g-c),("undefined"==typeof d.distance||f<d.distance)&&(d={value:g,distance:f}))}),d.value}if(b){var d="string"==typeof b?moment(b,this.options.format):moment(b),e=this,f={};d.isValid()&&(a.each(this.map,function(a,b){"ampm"!==a&&(f[a]=d[b[1]]())}),this.$ampm&&(f.hour>=12?(f.ampm="pm",f.hour>12&&(f.hour-=12)):(f.ampm="am",0===f.hour&&(f.hour=12))),a.each(f,function(a,b){e["$"+a]&&("minute"===a&&e.options.minuteStep>1&&e.options.roundTime&&(b=c(e["$"+a],b)),"second"===a&&e.options.secondStep>1&&e.options.roundTime&&(b=c(e["$"+a],b)),e["$"+a].val(b))}),this.options.smartDays&&this.fillCombo("day"),this.$element.val(d.format(this.options.format)).change())}},highlight:function(a){a.isValid()?this.options.errorClass?this.$widget.removeClass(this.options.errorClass):this.$widget.find("select").css("border-color",this.borderColor):this.options.errorClass?this.$widget.addClass(this.options.errorClass):(this.borderColor||(this.borderColor=this.$widget.find("select").css("border-color")),this.$widget.find("select").css("border-color","red"))},leadZero:function(a){return 9>=a?"0"+a:a},destroy:function(){this.$widget.remove(),this.$element.removeData("combodate").show()}},a.fn.combodate=function(c){var d,e=Array.apply(null,arguments);return e.shift(),"getValue"===c&&this.length&&(d=this.eq(0).data("combodate"))?d.getValue.apply(d,e):this.each(function(){var d=a(this),f=d.data("combodate"),g="object"==typeof c&&c;f||d.data("combodate",f=new b(this,g)),"string"==typeof c&&"function"==typeof f[c]&&f[c].apply(f,e)})},a.fn.combodate.defaults={format:"DD-MM-YYYY HH:mm",template:"D / MMM / YYYY H : mm",value:null,minYear:1970,maxYear:2015,yearDescending:!0,minuteStep:5,secondStep:1,firstItem:"empty",errorClass:null,roundTime:!0,smartDays:!1}}(window.jQuery),function(a){"use strict";var b=function(c){this.init("combodate",c,b.defaults),this.options.viewformat||(this.options.viewformat=this.options.format),c.combodate=a.fn.editableutils.tryParseJson(c.combodate,!0),this.options.combodate=a.extend({},b.defaults.combodate,c.combodate,{format:this.options.format,template:this.options.template})};a.fn.editableutils.inherit(b,a.fn.editabletypes.abstractinput),a.extend(b.prototype,{render:function(){this.$input.combodate(this.options.combodate),"bs3"===a.fn.editableform.engine&&this.$input.siblings().find("select").addClass("form-control"),this.options.inputclass&&this.$input.siblings().find("select").addClass(this.options.inputclass)},value2html:function(a,c){var d=a?a.format(this.options.viewformat):"";b.superclass.value2html.call(this,d,c)},html2value:function(a){return a?moment(a,this.options.viewformat):null},value2str:function(a){return a?a.format(this.options.format):""},str2value:function(a){return a?moment(a,this.options.format):null},value2submit:function(a){return this.value2str(a)},value2input:function(a){this.$input.combodate("setValue",a)},input2value:function(){return this.$input.combodate("getValue",null)},activate:function(){this.$input.siblings(".combodate").find("select").eq(0).focus()},autosubmit:function(){}}),b.defaults=a.extend({},a.fn.editabletypes.abstractinput.defaults,{tpl:'<input type="text">',inputclass:null,format:"YYYY-MM-DD",viewformat:null,template:"D / MMM / YYYY",combodate:null}),a.fn.editabletypes.combodate=b}(window.jQuery),function(a){"use strict";var b=a.fn.editableform.Constructor.prototype.initInput;a.extend(a.fn.editableform.Constructor.prototype,{initTemplate:function(){this.$form=a(a.fn.editableform.template),this.$form.find(".control-group").addClass("form-group"),this.$form.find(".editable-error-block").addClass("help-block")},initInput:function(){b.apply(this);var c=null===this.input.options.inputclass||this.input.options.inputclass===!1,d="input-sm",e="text,select,textarea,password,email,url,tel,number,range,time,typeaheadjs".split(",");~a.inArray(this.input.type,e)&&(this.input.$input.addClass("form-control"),c&&(this.input.options.inputclass=d,this.input.$input.addClass(d)));for(var f=this.$form.find(".editable-buttons"),g=c?[d]:this.input.options.inputclass.split(" "),h=0;h<g.length;h++)"input-lg"===g[h].toLowerCase()&&f.find("button").removeClass("btn-sm").addClass("btn-lg")}}),a.fn.editableform.buttons='<button type="submit" class="btn btn-primary btn-sm editable-submit"><i class="glyphicon glyphicon-ok"></i></button><button type="button" class="btn btn-default btn-sm editable-cancel"><i class="glyphicon glyphicon-remove"></i></button>',a.fn.editableform.errorGroupClass="has-error",a.fn.editableform.errorBlockClass=null,a.fn.editableform.engine="bs3"}(window.jQuery),function(a){"use strict";a.extend(a.fn.editableContainer.Popup.prototype,{containerName:"popover",containerDataName:"bs.popover",innerCss:".popover-content",defaults:a.fn.popover.Constructor.DEFAULTS,initContainer:function(){a.extend(this.containerOptions,{trigger:"manual",selector:!1,content:" ",template:this.defaults.template});var b;this.$element.data("template")&&(b=this.$element.data("template"),this.$element.removeData("template")),this.call(this.containerOptions),b&&this.$element.data("template",b)},innerShow:function(){this.call("show")},innerHide:function(){this.call("hide")},innerDestroy:function(){this.call("destroy")},setContainerOption:function(a,b){this.container().options[a]=b},setPosition:function(){!function(){var a=this.tip(),b="function"==typeof this.options.placement?this.options.placement.call(this,a[0],this.$element[0]):this.options.placement,c=/\s?auto?\s?/i,d=c.test(b);d&&(b=b.replace(c,"")||"top");var e=this.getPosition(),f=a[0].offsetWidth,g=a[0].offsetHeight;if(d){var h=this.$element.parent(),i=b,j=document.documentElement.scrollTop||document.body.scrollTop,k="body"==this.options.container?window.innerWidth:h.outerWidth(),l="body"==this.options.container?window.innerHeight:h.outerHeight(),m="body"==this.options.container?0:h.offset().left;b="bottom"==b&&e.top+e.height+g-j>l?"top":"top"==b&&e.top-j-g<0?"bottom":"right"==b&&e.right+f>k?"left":"left"==b&&e.left-f<m?"right":b,a.removeClass(i).addClass(b)}var n=this.getCalculatedOffset(b,e,f,g);this.applyPlacement(n,b)}.call(this.container())}})}(window.jQuery),function(a){function b(){return new Date(Date.UTC.apply(Date,arguments))}function c(b,c){var d,e=a(b).data(),f={},g=new RegExp("^"+c.toLowerCase()+"([A-Z])"),c=new RegExp("^"+c.toLowerCase());for(var h in e)c.test(h)&&(d=h.replace(g,function(a,b){return b.toLowerCase()}),f[d]=e[h]);return f}function d(b){var c={};if(k[b]||(b=b.split("-")[0],k[b])){var d=k[b];return a.each(j,function(a,b){b in d&&(c[b]=d[b])}),c}}var e=function(b,c){this._process_options(c),this.element=a(b),this.isInline=!1,this.isInput=this.element.is("input"),this.component=this.element.is(".date")?this.element.find(".add-on, .btn"):!1,this.hasInput=this.component&&this.element.find("input").length,this.component&&0===this.component.length&&(this.component=!1),this.picker=a(l.template),this._buildEvents(),this._attachEvents(),this.isInline?this.picker.addClass("datepicker-inline").appendTo(this.element):this.picker.addClass("datepicker-dropdown dropdown-menu"),this.o.rtl&&(this.picker.addClass("datepicker-rtl"),this.picker.find(".prev i, .next i").toggleClass("icon-arrow-left icon-arrow-right")),this.viewMode=this.o.startView,this.o.calendarWeeks&&this.picker.find("tfoot th.today").attr("colspan",function(a,b){return parseInt(b)+1}),this._allow_update=!1,this.setStartDate(this.o.startDate),this.setEndDate(this.o.endDate),this.setDaysOfWeekDisabled(this.o.daysOfWeekDisabled),this.fillDow(),this.fillMonths(),this._allow_update=!0,this.update(),this.showMode(),this.isInline&&this.show()};e.prototype={constructor:e,_process_options:function(b){this._o=a.extend({},this._o,b);var c=this.o=a.extend({},this._o),d=c.language;switch(k[d]||(d=d.split("-")[0],k[d]||(d=i.language)),c.language=d,c.startView){case 2:case"decade":c.startView=2;break;case 1:case"year":c.startView=1;break;default:c.startView=0}switch(c.minViewMode){case 1:case"months":c.minViewMode=1;break;case 2:case"years":c.minViewMode=2;break;default:c.minViewMode=0}c.startView=Math.max(c.startView,c.minViewMode),c.weekStart%=7,c.weekEnd=(c.weekStart+6)%7;var e=l.parseFormat(c.format);c.startDate!==-1/0&&(c.startDate=l.parseDate(c.startDate,e,c.language)),1/0!==c.endDate&&(c.endDate=l.parseDate(c.endDate,e,c.language)),c.daysOfWeekDisabled=c.daysOfWeekDisabled||[],a.isArray(c.daysOfWeekDisabled)||(c.daysOfWeekDisabled=c.daysOfWeekDisabled.split(/[,\s]*/)),c.daysOfWeekDisabled=a.map(c.daysOfWeekDisabled,function(a){return parseInt(a,10)})},_events:[],_secondaryEvents:[],_applyEvents:function(a){for(var b,c,d=0;d<a.length;d++)b=a[d][0],c=a[d][1],b.on(c)},_unapplyEvents:function(a){for(var b,c,d=0;d<a.length;d++)b=a[d][0],c=a[d][1],b.off(c)},_buildEvents:function(){this.isInput?this._events=[[this.element,{focus:a.proxy(this.show,this),keyup:a.proxy(this.update,this),keydown:a.proxy(this.keydown,this)}]]:this.component&&this.hasInput?this._events=[[this.element.find("input"),{focus:a.proxy(this.show,this),keyup:a.proxy(this.update,this),keydown:a.proxy(this.keydown,this)}],[this.component,{click:a.proxy(this.show,this)}]]:this.element.is("div")?this.isInline=!0:this._events=[[this.element,{click:a.proxy(this.show,this)}]],this._secondaryEvents=[[this.picker,{click:a.proxy(this.click,this)}],[a(window),{resize:a.proxy(this.place,this)}],[a(document),{mousedown:a.proxy(function(a){this.element.is(a.target)||this.element.find(a.target).size()||this.picker.is(a.target)||this.picker.find(a.target).size()||this.hide()},this)}]]},_attachEvents:function(){this._detachEvents(),this._applyEvents(this._events)},_detachEvents:function(){this._unapplyEvents(this._events)},_attachSecondaryEvents:function(){this._detachSecondaryEvents(),this._applyEvents(this._secondaryEvents)},_detachSecondaryEvents:function(){this._unapplyEvents(this._secondaryEvents)},_trigger:function(b,c){var d=c||this.date,e=new Date(d.getTime()+6e4*d.getTimezoneOffset());this.element.trigger({type:b,date:e,format:a.proxy(function(a){var b=a||this.o.format;return l.formatDate(d,b,this.o.language)},this)})},show:function(a){this.isInline||this.picker.appendTo("body"),this.picker.show(),this.height=this.component?this.component.outerHeight():this.element.outerHeight(),this.place(),this._attachSecondaryEvents(),a&&a.preventDefault(),this._trigger("show")},hide:function(){this.isInline||this.picker.is(":visible")&&(this.picker.hide().detach(),this._detachSecondaryEvents(),this.viewMode=this.o.startView,this.showMode(),this.o.forceParse&&(this.isInput&&this.element.val()||this.hasInput&&this.element.find("input").val())&&this.setValue(),this._trigger("hide"))},remove:function(){this.hide(),this._detachEvents(),this._detachSecondaryEvents(),this.picker.remove(),delete this.element.data().datepicker,this.isInput||delete this.element.data().date},getDate:function(){var a=this.getUTCDate();return new Date(a.getTime()+6e4*a.getTimezoneOffset())},getUTCDate:function(){return this.date},setDate:function(a){this.setUTCDate(new Date(a.getTime()-6e4*a.getTimezoneOffset()))},setUTCDate:function(a){this.date=a,this.setValue()},setValue:function(){var a=this.getFormattedDate();this.isInput?this.element.val(a):this.component&&this.element.find("input").val(a)},getFormattedDate:function(a){return void 0===a&&(a=this.o.format),l.formatDate(this.date,a,this.o.language)},setStartDate:function(a){this._process_options({startDate:a}),this.update(),this.updateNavArrows()},setEndDate:function(a){this._process_options({endDate:a}),this.update(),this.updateNavArrows()},setDaysOfWeekDisabled:function(a){this._process_options({daysOfWeekDisabled:a}),this.update(),this.updateNavArrows()},place:function(){if(!this.isInline){var b=parseInt(this.element.parents().filter(function(){return"auto"!=a(this).css("z-index")}).first().css("z-index"))+10,c=this.component?this.component.parent().offset():this.element.offset(),d=this.component?this.component.outerHeight(!0):this.element.outerHeight(!0);this.picker.css({top:c.top+d,left:c.left,zIndex:b})}},_allow_update:!0,update:function(){if(this._allow_update){var a,b=!1;arguments&&arguments.length&&("string"==typeof arguments[0]||arguments[0]instanceof Date)?(a=arguments[0],b=!0):(a=this.isInput?this.element.val():this.element.data("date")||this.element.find("input").val(),delete this.element.data().date),this.date=l.parseDate(a,this.o.format,this.o.language),b&&this.setValue(),this.viewDate=this.date<this.o.startDate?new Date(this.o.startDate):this.date>this.o.endDate?new Date(this.o.endDate):new Date(this.date),this.fill()}},fillDow:function(){var a=this.o.weekStart,b="<tr>";if(this.o.calendarWeeks){var c='<th class="cw">&nbsp;</th>';b+=c,this.picker.find(".datepicker-days thead tr:first-child").prepend(c)}for(;a<this.o.weekStart+7;)b+='<th class="dow">'+k[this.o.language].daysMin[a++%7]+"</th>";b+="</tr>",this.picker.find(".datepicker-days thead").append(b)},fillMonths:function(){for(var a="",b=0;12>b;)a+='<span class="month">'+k[this.o.language].monthsShort[b++]+"</span>";this.picker.find(".datepicker-months td").html(a)},setRange:function(b){b&&b.length?this.range=a.map(b,function(a){return a.valueOf()}):delete this.range,this.fill()},getClassNames:function(b){var c=[],d=this.viewDate.getUTCFullYear(),e=this.viewDate.getUTCMonth(),f=this.date.valueOf(),g=new Date;return b.getUTCFullYear()<d||b.getUTCFullYear()==d&&b.getUTCMonth()<e?c.push("old"):(b.getUTCFullYear()>d||b.getUTCFullYear()==d&&b.getUTCMonth()>e)&&c.push("new"),this.o.todayHighlight&&b.getUTCFullYear()==g.getFullYear()&&b.getUTCMonth()==g.getMonth()&&b.getUTCDate()==g.getDate()&&c.push("today"),f&&b.valueOf()==f&&c.push("active"),(b.valueOf()<this.o.startDate||b.valueOf()>this.o.endDate||-1!==a.inArray(b.getUTCDay(),this.o.daysOfWeekDisabled))&&c.push("disabled"),this.range&&(b>this.range[0]&&b<this.range[this.range.length-1]&&c.push("range"),-1!=a.inArray(b.valueOf(),this.range)&&c.push("selected")),c},fill:function(){var c,d=new Date(this.viewDate),e=d.getUTCFullYear(),f=d.getUTCMonth(),g=this.o.startDate!==-1/0?this.o.startDate.getUTCFullYear():-1/0,h=this.o.startDate!==-1/0?this.o.startDate.getUTCMonth():-1/0,i=1/0!==this.o.endDate?this.o.endDate.getUTCFullYear():1/0,j=1/0!==this.o.endDate?this.o.endDate.getUTCMonth():1/0;this.date&&this.date.valueOf(),this.picker.find(".datepicker-days thead th.datepicker-switch").text(k[this.o.language].months[f]+" "+e),this.picker.find("tfoot th.today").text(k[this.o.language].today).toggle(this.o.todayBtn!==!1),this.picker.find("tfoot th.clear").text(k[this.o.language].clear).toggle(this.o.clearBtn!==!1),this.updateNavArrows(),this.fillMonths();var m=b(e,f-1,28,0,0,0,0),n=l.getDaysInMonth(m.getUTCFullYear(),m.getUTCMonth());m.setUTCDate(n),m.setUTCDate(n-(m.getUTCDay()-this.o.weekStart+7)%7);var o=new Date(m);o.setUTCDate(o.getUTCDate()+42),o=o.valueOf();for(var p,q=[];m.valueOf()<o;){if(m.getUTCDay()==this.o.weekStart&&(q.push("<tr>"),this.o.calendarWeeks)){var r=new Date(+m+864e5*((this.o.weekStart-m.getUTCDay()-7)%7)),s=new Date(+r+864e5*((11-r.getUTCDay())%7)),t=new Date(+(t=b(s.getUTCFullYear(),0,1))+864e5*((11-t.getUTCDay())%7)),u=(s-t)/864e5/7+1;q.push('<td class="cw">'+u+"</td>")}p=this.getClassNames(m),p.push("day");var v=this.o.beforeShowDay(m);void 0===v?v={}:"boolean"==typeof v?v={enabled:v}:"string"==typeof v&&(v={classes:v}),v.enabled===!1&&p.push("disabled"),v.classes&&(p=p.concat(v.classes.split(/\s+/))),v.tooltip&&(c=v.tooltip),p=a.unique(p),q.push('<td class="'+p.join(" ")+'"'+(c?' title="'+c+'"':"")+">"+m.getUTCDate()+"</td>"),m.getUTCDay()==this.o.weekEnd&&q.push("</tr>"),m.setUTCDate(m.getUTCDate()+1)}this.picker.find(".datepicker-days tbody").empty().append(q.join(""));var w=this.date&&this.date.getUTCFullYear(),x=this.picker.find(".datepicker-months").find("th:eq(1)").text(e).end().find("span").removeClass("active");w&&w==e&&x.eq(this.date.getUTCMonth()).addClass("active"),(g>e||e>i)&&x.addClass("disabled"),e==g&&x.slice(0,h).addClass("disabled"),e==i&&x.slice(j+1).addClass("disabled"),q="",e=10*parseInt(e/10,10);var y=this.picker.find(".datepicker-years").find("th:eq(1)").text(e+"-"+(e+9)).end().find("td");e-=1;for(var z=-1;11>z;z++)q+='<span class="year'+(-1==z?" old":10==z?" new":"")+(w==e?" active":"")+(g>e||e>i?" disabled":"")+'">'+e+"</span>",e+=1;y.html(q)},updateNavArrows:function(){if(this._allow_update){var a=new Date(this.viewDate),b=a.getUTCFullYear(),c=a.getUTCMonth();switch(this.viewMode){case 0:this.o.startDate!==-1/0&&b<=this.o.startDate.getUTCFullYear()&&c<=this.o.startDate.getUTCMonth()?this.picker.find(".prev").css({visibility:"hidden"}):this.picker.find(".prev").css({visibility:"visible"}),1/0!==this.o.endDate&&b>=this.o.endDate.getUTCFullYear()&&c>=this.o.endDate.getUTCMonth()?this.picker.find(".next").css({visibility:"hidden"}):this.picker.find(".next").css({visibility:"visible"});break;case 1:case 2:this.o.startDate!==-1/0&&b<=this.o.startDate.getUTCFullYear()?this.picker.find(".prev").css({visibility:"hidden"}):this.picker.find(".prev").css({visibility:"visible"}),1/0!==this.o.endDate&&b>=this.o.endDate.getUTCFullYear()?this.picker.find(".next").css({visibility:"hidden"}):this.picker.find(".next").css({visibility:"visible"})}}},click:function(c){c.preventDefault();var d=a(c.target).closest("span, td, th");if(1==d.length)switch(d[0].nodeName.toLowerCase()){case"th":switch(d[0].className){case"datepicker-switch":this.showMode(1);break;case"prev":case"next":var e=l.modes[this.viewMode].navStep*("prev"==d[0].className?-1:1);switch(this.viewMode){case 0:this.viewDate=this.moveMonth(this.viewDate,e);break;case 1:case 2:this.viewDate=this.moveYear(this.viewDate,e)}this.fill();break;case"today":var f=new Date;f=b(f.getFullYear(),f.getMonth(),f.getDate(),0,0,0),this.showMode(-2);var g="linked"==this.o.todayBtn?null:"view";this._setDate(f,g);break;case"clear":var h;this.isInput?h=this.element:this.component&&(h=this.element.find("input")),h&&h.val("").change(),this._trigger("changeDate"),this.update(),this.o.autoclose&&this.hide()}break;case"span":if(!d.is(".disabled")){if(this.viewDate.setUTCDate(1),d.is(".month")){var i=1,j=d.parent().find("span").index(d),k=this.viewDate.getUTCFullYear();this.viewDate.setUTCMonth(j),this._trigger("changeMonth",this.viewDate),1===this.o.minViewMode&&this._setDate(b(k,j,i,0,0,0,0))}else{var k=parseInt(d.text(),10)||0,i=1,j=0;this.viewDate.setUTCFullYear(k),this._trigger("changeYear",this.viewDate),2===this.o.minViewMode&&this._setDate(b(k,j,i,0,0,0,0))}this.showMode(-1),this.fill()}break;case"td":if(d.is(".day")&&!d.is(".disabled")){var i=parseInt(d.text(),10)||1,k=this.viewDate.getUTCFullYear(),j=this.viewDate.getUTCMonth();d.is(".old")?0===j?(j=11,k-=1):j-=1:d.is(".new")&&(11==j?(j=0,k+=1):j+=1),this._setDate(b(k,j,i,0,0,0,0))}}},_setDate:function(a,b){b&&"date"!=b||(this.date=new Date(a)),b&&"view"!=b||(this.viewDate=new Date(a)),this.fill(),this.setValue(),this._trigger("changeDate");var c;this.isInput?c=this.element:this.component&&(c=this.element.find("input")),c&&(c.change(),!this.o.autoclose||b&&"date"!=b||this.hide())},moveMonth:function(a,b){if(!b)return a;var c,d,e=new Date(a.valueOf()),f=e.getUTCDate(),g=e.getUTCMonth(),h=Math.abs(b);if(b=b>0?1:-1,1==h)d=-1==b?function(){return e.getUTCMonth()==g}:function(){return e.getUTCMonth()!=c},c=g+b,e.setUTCMonth(c),(0>c||c>11)&&(c=(c+12)%12);else{for(var i=0;h>i;i++)e=this.moveMonth(e,b);c=e.getUTCMonth(),e.setUTCDate(f),d=function(){return c!=e.getUTCMonth()}}for(;d();)e.setUTCDate(--f),e.setUTCMonth(c);return e},moveYear:function(a,b){return this.moveMonth(a,12*b)},dateWithinRange:function(a){return a>=this.o.startDate&&a<=this.o.endDate},keydown:function(a){if(this.picker.is(":not(:visible)"))return 27==a.keyCode&&this.show(),void 0;var b,c,d,e=!1;switch(a.keyCode){case 27:this.hide(),a.preventDefault();break;case 37:case 39:if(!this.o.keyboardNavigation)break;b=37==a.keyCode?-1:1,a.ctrlKey?(c=this.moveYear(this.date,b),d=this.moveYear(this.viewDate,b)):a.shiftKey?(c=this.moveMonth(this.date,b),d=this.moveMonth(this.viewDate,b)):(c=new Date(this.date),c.setUTCDate(this.date.getUTCDate()+b),d=new Date(this.viewDate),d.setUTCDate(this.viewDate.getUTCDate()+b)),this.dateWithinRange(c)&&(this.date=c,this.viewDate=d,this.setValue(),this.update(),a.preventDefault(),e=!0);break;case 38:case 40:if(!this.o.keyboardNavigation)break;b=38==a.keyCode?-1:1,a.ctrlKey?(c=this.moveYear(this.date,b),d=this.moveYear(this.viewDate,b)):a.shiftKey?(c=this.moveMonth(this.date,b),d=this.moveMonth(this.viewDate,b)):(c=new Date(this.date),c.setUTCDate(this.date.getUTCDate()+7*b),d=new Date(this.viewDate),d.setUTCDate(this.viewDate.getUTCDate()+7*b)),this.dateWithinRange(c)&&(this.date=c,this.viewDate=d,this.setValue(),this.update(),a.preventDefault(),e=!0);break;case 13:this.hide(),a.preventDefault();break;case 9:this.hide()}if(e){this._trigger("changeDate");var f;this.isInput?f=this.element:this.component&&(f=this.element.find("input")),f&&f.change()}},showMode:function(a){a&&(this.viewMode=Math.max(this.o.minViewMode,Math.min(2,this.viewMode+a))),this.picker.find(">div").hide().filter(".datepicker-"+l.modes[this.viewMode].clsName).css("display","block"),this.updateNavArrows()}};var f=function(b,c){this.element=a(b),this.inputs=a.map(c.inputs,function(a){return a.jquery?a[0]:a}),delete c.inputs,a(this.inputs).datepicker(c).bind("changeDate",a.proxy(this.dateUpdated,this)),this.pickers=a.map(this.inputs,function(b){return a(b).data("datepicker")}),this.updateDates()};f.prototype={updateDates:function(){this.dates=a.map(this.pickers,function(a){return a.date}),this.updateRanges()},updateRanges:function(){var b=a.map(this.dates,function(a){return a.valueOf()});a.each(this.pickers,function(a,c){c.setRange(b)})},dateUpdated:function(b){var c=a(b.target).data("datepicker"),d=c.getUTCDate(),e=a.inArray(b.target,this.inputs),f=this.inputs.length;if(-1!=e){if(d<this.dates[e])for(;e>=0&&d<this.dates[e];)this.pickers[e--].setUTCDate(d);else if(d>this.dates[e])for(;f>e&&d>this.dates[e];)this.pickers[e++].setUTCDate(d);this.updateDates()}},remove:function(){a.map(this.pickers,function(a){a.remove()}),delete this.element.data().datepicker}};var g=a.fn.datepicker,h=a.fn.datepicker=function(b){var g=Array.apply(null,arguments);g.shift();var h;return this.each(function(){var j=a(this),k=j.data("datepicker"),l="object"==typeof b&&b;if(!k){var m=c(this,"date"),n=a.extend({},i,m,l),o=d(n.language),p=a.extend({},i,o,m,l);if(j.is(".input-daterange")||p.inputs){var q={inputs:p.inputs||j.find("input").toArray()};j.data("datepicker",k=new f(this,a.extend(p,q)))}else j.data("datepicker",k=new e(this,p))}return"string"==typeof b&&"function"==typeof k[b]&&(h=k[b].apply(k,g),void 0!==h)?!1:void 0}),void 0!==h?h:this},i=a.fn.datepicker.defaults={autoclose:!1,beforeShowDay:a.noop,calendarWeeks:!1,clearBtn:!1,daysOfWeekDisabled:[],endDate:1/0,forceParse:!0,format:"mm/dd/yyyy",keyboardNavigation:!0,language:"en",minViewMode:0,rtl:!1,startDate:-1/0,startView:0,todayBtn:!1,todayHighlight:!1,weekStart:0},j=a.fn.datepicker.locale_opts=["format","rtl","weekStart"];a.fn.datepicker.Constructor=e;var k=a.fn.datepicker.dates={en:{days:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday","Sunday"],daysShort:["Sun","Mon","Tue","Wed","Thu","Fri","Sat","Sun"],daysMin:["Su","Mo","Tu","We","Th","Fr","Sa","Su"],months:["January","February","March","April","May","June","July","August","September","October","November","December"],monthsShort:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],today:"Today",clear:"Clear"}},l={modes:[{clsName:"days",navFnc:"Month",navStep:1},{clsName:"months",navFnc:"FullYear",navStep:1},{clsName:"years",navFnc:"FullYear",navStep:10}],isLeapYear:function(a){return 0===a%4&&0!==a%100||0===a%400
  7 +},getDaysInMonth:function(a,b){return[31,l.isLeapYear(a)?29:28,31,30,31,30,31,31,30,31,30,31][b]},validParts:/dd?|DD?|mm?|MM?|yy(?:yy)?/g,nonpunctuation:/[^ -\/:-@\[\u3400-\u9fff-`{-~\t\n\r]+/g,parseFormat:function(a){var b=a.replace(this.validParts,"\0").split("\0"),c=a.match(this.validParts);if(!b||!b.length||!c||0===c.length)throw new Error("Invalid date format.");return{separators:b,parts:c}},parseDate:function(c,d,f){if(c instanceof Date)return c;if("string"==typeof d&&(d=l.parseFormat(d)),/^[\-+]\d+[dmwy]([\s,]+[\-+]\d+[dmwy])*$/.test(c)){var g,h,i=/([\-+]\d+)([dmwy])/,j=c.match(/([\-+]\d+)([dmwy])/g);c=new Date;for(var m=0;m<j.length;m++)switch(g=i.exec(j[m]),h=parseInt(g[1]),g[2]){case"d":c.setUTCDate(c.getUTCDate()+h);break;case"m":c=e.prototype.moveMonth.call(e.prototype,c,h);break;case"w":c.setUTCDate(c.getUTCDate()+7*h);break;case"y":c=e.prototype.moveYear.call(e.prototype,c,h)}return b(c.getUTCFullYear(),c.getUTCMonth(),c.getUTCDate(),0,0,0)}var n,o,g,j=c&&c.match(this.nonpunctuation)||[],c=new Date,p={},q=["yyyy","yy","M","MM","m","mm","d","dd"],r={yyyy:function(a,b){return a.setUTCFullYear(b)},yy:function(a,b){return a.setUTCFullYear(2e3+b)},m:function(a,b){for(b-=1;0>b;)b+=12;for(b%=12,a.setUTCMonth(b);a.getUTCMonth()!=b;)a.setUTCDate(a.getUTCDate()-1);return a},d:function(a,b){return a.setUTCDate(b)}};r.M=r.MM=r.mm=r.m,r.dd=r.d,c=b(c.getFullYear(),c.getMonth(),c.getDate(),0,0,0);var s=d.parts.slice();if(j.length!=s.length&&(s=a(s).filter(function(b,c){return-1!==a.inArray(c,q)}).toArray()),j.length==s.length){for(var m=0,t=s.length;t>m;m++){if(n=parseInt(j[m],10),g=s[m],isNaN(n))switch(g){case"MM":o=a(k[f].months).filter(function(){var a=this.slice(0,j[m].length),b=j[m].slice(0,a.length);return a==b}),n=a.inArray(o[0],k[f].months)+1;break;case"M":o=a(k[f].monthsShort).filter(function(){var a=this.slice(0,j[m].length),b=j[m].slice(0,a.length);return a==b}),n=a.inArray(o[0],k[f].monthsShort)+1}p[g]=n}for(var u,m=0;m<q.length;m++)u=q[m],u in p&&!isNaN(p[u])&&r[u](c,p[u])}return c},formatDate:function(b,c,d){"string"==typeof c&&(c=l.parseFormat(c));var e={d:b.getUTCDate(),D:k[d].daysShort[b.getUTCDay()],DD:k[d].days[b.getUTCDay()],m:b.getUTCMonth()+1,M:k[d].monthsShort[b.getUTCMonth()],MM:k[d].months[b.getUTCMonth()],yy:b.getUTCFullYear().toString().substring(2),yyyy:b.getUTCFullYear()};e.dd=(e.d<10?"0":"")+e.d,e.mm=(e.m<10?"0":"")+e.m;for(var b=[],f=a.extend([],c.separators),g=0,h=c.parts.length;h>=g;g++)f.length&&b.push(f.shift()),b.push(e[c.parts[g]]);return b.join("")},headTemplate:'<thead><tr><th class="prev"><i class="icon-arrow-left"/></th><th colspan="5" class="datepicker-switch"></th><th class="next"><i class="icon-arrow-right"/></th></tr></thead>',contTemplate:'<tbody><tr><td colspan="7"></td></tr></tbody>',footTemplate:'<tfoot><tr><th colspan="7" class="today"></th></tr><tr><th colspan="7" class="clear"></th></tr></tfoot>'};l.template='<div class="datepicker"><div class="datepicker-days"><table class=" table-condensed">'+l.headTemplate+"<tbody></tbody>"+l.footTemplate+"</table>"+"</div>"+'<div class="datepicker-months">'+'<table class="table-condensed">'+l.headTemplate+l.contTemplate+l.footTemplate+"</table>"+"</div>"+'<div class="datepicker-years">'+'<table class="table-condensed">'+l.headTemplate+l.contTemplate+l.footTemplate+"</table>"+"</div>"+"</div>",a.fn.datepicker.DPGlobal=l,a.fn.datepicker.noConflict=function(){return a.fn.datepicker=g,this},a(document).on("focus.datepicker.data-api click.datepicker.data-api",'[data-provide="datepicker"]',function(b){var c=a(this);c.data("datepicker")||(b.preventDefault(),h.call(c,"show"))}),a(function(){h.call(a('[data-provide="datepicker-inline"]'))})}(window.jQuery),function(a){"use strict";a.fn.bdatepicker=a.fn.datepicker.noConflict(),a.fn.datepicker||(a.fn.datepicker=a.fn.bdatepicker);var b=function(a){this.init("date",a,b.defaults),this.initPicker(a,b.defaults)};a.fn.editableutils.inherit(b,a.fn.editabletypes.abstractinput),a.extend(b.prototype,{initPicker:function(b,c){this.options.viewformat||(this.options.viewformat=this.options.format),b.datepicker=a.fn.editableutils.tryParseJson(b.datepicker,!0),this.options.datepicker=a.extend({},c.datepicker,b.datepicker,{format:this.options.viewformat}),this.options.datepicker.language=this.options.datepicker.language||"en",this.dpg=a.fn.bdatepicker.DPGlobal,this.parsedFormat=this.dpg.parseFormat(this.options.format),this.parsedViewFormat=this.dpg.parseFormat(this.options.viewformat)},render:function(){this.$input.bdatepicker(this.options.datepicker),this.options.clear&&(this.$clear=a('<a href="#"></a>').html(this.options.clear).click(a.proxy(function(a){a.preventDefault(),a.stopPropagation(),this.clear()},this)),this.$tpl.parent().append(a('<div class="editable-clear">').append(this.$clear)))},value2html:function(a,c){var d=a?this.dpg.formatDate(a,this.parsedViewFormat,this.options.datepicker.language):"";b.superclass.value2html.call(this,d,c)},html2value:function(a){return this.parseDate(a,this.parsedViewFormat)},value2str:function(a){return a?this.dpg.formatDate(a,this.parsedFormat,this.options.datepicker.language):""},str2value:function(a){return this.parseDate(a,this.parsedFormat)},value2submit:function(a){return this.value2str(a)},value2input:function(a){this.$input.bdatepicker("update",a)},input2value:function(){return this.$input.data("datepicker").date},activate:function(){},clear:function(){this.$input.data("datepicker").date=null,this.$input.find(".active").removeClass("active"),this.options.showbuttons||this.$input.closest("form").submit()},autosubmit:function(){this.$input.on("mouseup",".day",function(b){if(!a(b.currentTarget).is(".old")&&!a(b.currentTarget).is(".new")){var c=a(this).closest("form");setTimeout(function(){c.submit()},200)}})},parseDate:function(a,b){var c,d=null;return a&&(d=this.dpg.parseDate(a,b,this.options.datepicker.language),"string"==typeof a&&(c=this.dpg.formatDate(d,b,this.options.datepicker.language),a!==c&&(d=null))),d}}),b.defaults=a.extend({},a.fn.editabletypes.abstractinput.defaults,{tpl:'<div class="editable-date well"></div>',inputclass:null,format:"yyyy-mm-dd",viewformat:null,datepicker:{weekStart:0,startView:0,minViewMode:0,autoclose:!1},clear:"&times; clear"}),a.fn.editabletypes.date=b}(window.jQuery),function(a){"use strict";var b=function(a){this.init("datefield",a,b.defaults),this.initPicker(a,b.defaults)};a.fn.editableutils.inherit(b,a.fn.editabletypes.date),a.extend(b.prototype,{render:function(){this.$input=this.$tpl.find("input"),this.setClass(),this.setAttr("placeholder"),this.$tpl.bdatepicker(this.options.datepicker),this.$input.off("focus keydown"),this.$input.keyup(a.proxy(function(){this.$tpl.removeData("date"),this.$tpl.bdatepicker("update")},this))},value2input:function(a){this.$input.val(a?this.dpg.formatDate(a,this.parsedViewFormat,this.options.datepicker.language):""),this.$tpl.bdatepicker("update")},input2value:function(){return this.html2value(this.$input.val())},activate:function(){a.fn.editabletypes.text.prototype.activate.call(this)},autosubmit:function(){}}),b.defaults=a.extend({},a.fn.editabletypes.date.defaults,{tpl:'<div class="input-append date"><input type="text"/><span class="add-on"><i class="icon-th"></i></span></div>',inputclass:"input-small",datepicker:{weekStart:0,startView:0,minViewMode:0,autoclose:!0}}),a.fn.editabletypes.datefield=b}(window.jQuery),function(a){"use strict";var b=function(a){this.init("datetime",a,b.defaults),this.initPicker(a,b.defaults)};a.fn.editableutils.inherit(b,a.fn.editabletypes.abstractinput),a.extend(b.prototype,{initPicker:function(b,c){this.options.viewformat||(this.options.viewformat=this.options.format),b.datetimepicker=a.fn.editableutils.tryParseJson(b.datetimepicker,!0),this.options.datetimepicker=a.extend({},c.datetimepicker,b.datetimepicker,{format:this.options.viewformat}),this.options.datetimepicker.language=this.options.datetimepicker.language||"en",this.dpg=a.fn.datetimepicker.DPGlobal,this.parsedFormat=this.dpg.parseFormat(this.options.format,this.options.formatType),this.parsedViewFormat=this.dpg.parseFormat(this.options.viewformat,this.options.formatType)},render:function(){this.$input.datetimepicker(this.options.datetimepicker),this.$input.on("changeMode",function(){var b=a(this).closest("form").parent();setTimeout(function(){b.triggerHandler("resize")},0)}),this.options.clear&&(this.$clear=a('<a href="#"></a>').html(this.options.clear).click(a.proxy(function(a){a.preventDefault(),a.stopPropagation(),this.clear()},this)),this.$tpl.parent().append(a('<div class="editable-clear">').append(this.$clear)))},value2html:function(a,c){var d=a?this.dpg.formatDate(this.toUTC(a),this.parsedViewFormat,this.options.datetimepicker.language,this.options.formatType):"";return c?(b.superclass.value2html.call(this,d,c),void 0):d},html2value:function(a){var b=this.parseDate(a,this.parsedViewFormat);return b?this.fromUTC(b):null},value2str:function(a){return a?this.dpg.formatDate(this.toUTC(a),this.parsedFormat,this.options.datetimepicker.language,this.options.formatType):""},str2value:function(a){var b=this.parseDate(a,this.parsedFormat);return b?this.fromUTC(b):null},value2submit:function(a){return this.value2str(a)},value2input:function(a){a&&this.$input.data("datetimepicker").setDate(a)},input2value:function(){var a=this.$input.data("datetimepicker");return a.date?a.getDate():null},activate:function(){},clear:function(){this.$input.data("datetimepicker").date=null,this.$input.find(".active").removeClass("active"),this.options.showbuttons||this.$input.closest("form").submit()},autosubmit:function(){this.$input.on("mouseup",".minute",function(){var b=a(this).closest("form");setTimeout(function(){b.submit()},200)})},toUTC:function(a){return a?new Date(a.valueOf()-6e4*a.getTimezoneOffset()):a},fromUTC:function(a){return a?new Date(a.valueOf()+6e4*a.getTimezoneOffset()):a},parseDate:function(a,b){var c,d=null;return a&&(d=this.dpg.parseDate(a,b,this.options.datetimepicker.language,this.options.formatType),"string"==typeof a&&(c=this.dpg.formatDate(d,b,this.options.datetimepicker.language,this.options.formatType),a!==c&&(d=null))),d}}),b.defaults=a.extend({},a.fn.editabletypes.abstractinput.defaults,{tpl:'<div class="editable-date well"></div>',inputclass:null,format:"yyyy-mm-dd hh:ii",formatType:"standard",viewformat:null,datetimepicker:{todayHighlight:!1,autoclose:!1},clear:"&times; clear"}),a.fn.editabletypes.datetime=b}(window.jQuery),function(a){"use strict";var b=function(a){this.init("datetimefield",a,b.defaults),this.initPicker(a,b.defaults)};a.fn.editableutils.inherit(b,a.fn.editabletypes.datetime),a.extend(b.prototype,{render:function(){this.$input=this.$tpl.find("input"),this.setClass(),this.setAttr("placeholder"),this.$tpl.datetimepicker(this.options.datetimepicker),this.$input.off("focus keydown"),this.$input.keyup(a.proxy(function(){this.$tpl.removeData("date"),this.$tpl.datetimepicker("update")},this))},value2input:function(a){this.$input.val(this.value2html(a)),this.$tpl.datetimepicker("update")},input2value:function(){return this.html2value(this.$input.val())},activate:function(){a.fn.editabletypes.text.prototype.activate.call(this)},autosubmit:function(){}}),b.defaults=a.extend({},a.fn.editabletypes.datetime.defaults,{tpl:'<div class="input-append date"><input type="text"/><span class="add-on"><i class="icon-th"></i></span></div>',inputclass:"input-medium",datetimepicker:{todayHighlight:!1,autoclose:!0}}),a.fn.editabletypes.datetimefield=b}(window.jQuery);
0 8 \ No newline at end of file
... ...
src/main/resources/static/ajax/libs/bootstrap-table/extensions/editable/bootstrap-table-editable.min.js deleted
1   -/*
2   -* bootstrap-table - v1.11.0 - 2016-07-02
3   -* https://github.com/wenzhixin/bootstrap-table
4   -* Copyright (c) 2016 zhixin wen
5   -* Licensed MIT License
6   -*/
7   -!function(a){"use strict";a.extend(a.fn.bootstrapTable.defaults,{editable:!0,onEditableInit:function(){return!1},onEditableSave:function(){return!1},onEditableShown:function(){return!1},onEditableHidden:function(){return!1}}),a.extend(a.fn.bootstrapTable.Constructor.EVENTS,{"editable-init.bs.table":"onEditableInit","editable-save.bs.table":"onEditableSave","editable-shown.bs.table":"onEditableShown","editable-hidden.bs.table":"onEditableHidden"});var b=a.fn.bootstrapTable.Constructor,c=b.prototype.initTable,d=b.prototype.initBody;b.prototype.initTable=function(){var b=this;c.apply(this,Array.prototype.slice.apply(arguments)),this.options.editable&&a.each(this.columns,function(c,d){if(d.editable){var e={},f=[],g="editable-",h=function(a,b){var c=a.replace(/([A-Z])/g,function(a){return"-"+a.toLowerCase()});if(c.slice(0,g.length)==g){var d=c.replace(g,"data-");e[d]=b}};a.each(b.options,h),d.formatter=d.formatter||function(a){return a},d._formatter=d._formatter?d._formatter:d.formatter,d.formatter=function(c,g,i){var j=d._formatter?d._formatter(c,g,i):c;a.each(d,h),a.each(e,function(a,b){f.push(" "+a+'="'+b+'"')});var k=!1;return d.editable.hasOwnProperty("noeditFormatter")&&(k=d.editable.noeditFormatter(c,g,i)),k===!1?['<a href="javascript:void(0)"',' data-name="'+d.field+'"',' data-pk="'+g[b.options.idField]+'"',' data-value="'+j+'"',f.join(""),"></a>"].join(""):k}}})},b.prototype.initBody=function(){var b=this;d.apply(this,Array.prototype.slice.apply(arguments)),this.options.editable&&(a.each(this.columns,function(c,d){d.editable&&(b.$body.find('a[data-name="'+d.field+'"]').editable(d.editable).off("save").on("save",function(c,e){var f=b.getData(),g=a(this).parents("tr[data-index]").data("index"),h=f[g],i=h[d.field];a(this).data("value",e.submitValue),h[d.field]=e.submitValue,b.trigger("editable-save",d.field,h,i,a(this)),b.resetFooter()}),b.$body.find('a[data-name="'+d.field+'"]').editable(d.editable).off("shown").on("shown",function(c,e){var f=b.getData(),g=a(this).parents("tr[data-index]").data("index"),h=f[g];b.trigger("editable-shown",d.field,h,a(this),e)}),b.$body.find('a[data-name="'+d.field+'"]').editable(d.editable).off("hidden").on("hidden",function(c,e){var f=b.getData(),g=a(this).parents("tr[data-index]").data("index"),h=f[g];b.trigger("editable-hidden",d.field,h,a(this),e)}))}),this.trigger("editable-init"))}}(jQuery);
8 0 \ No newline at end of file
src/main/resources/static/ajax/libs/bootstrap-table/extensions/editable/clear.png 0 → 100644

244 Bytes

src/main/resources/static/ajax/libs/bootstrap-table/extensions/editable/loading.gif 0 → 100644

1.81 KB

src/main/resources/static/ajax/libs/bootstrap-table/extensions/export/bootstrap-table-export.js
... ... @@ -29,7 +29,7 @@
29 29  
30 30 $.extend($.fn.bootstrapTable.locales, {
31 31 formatExport: function () {
32   - return 'Export data';
  32 + return '导出';
33 33 }
34 34 });
35 35 $.extend($.fn.bootstrapTable.defaults, $.fn.bootstrapTable.locales);
... ...
src/main/resources/static/ajax/libs/bootstrap-table/extensions/export/tableExport.js
... ... @@ -690,8 +690,6 @@
690 690  
691 691 if ( typeof tdcss == 'undefined' && typeof defaults.onMsoNumberFormat === 'function' )
692 692 tdcss = defaults.onMsoNumberFormat(cell, row, col);
693   - else
694   - tdcss = "\\@"
695 693  
696 694 if ( typeof tdcss != 'undefined' && tdcss !== '' )
697 695 tdstyle = 'style="mso-number-format:\'' + tdcss + '\'';
... ...
src/main/resources/static/ajax/libs/bootstrap-table/extensions/mobile/bootstrap-table-mobile.js
1 1 /**
2   - * @author: Dennis Hernández
3   - * @webSite: http://djhvscf.github.io/Blog
4   - * @version: v1.1.0
  2 + * 基于bootstrap-table-mobile修改
  3 + * 修正部分iPhone手机不显示卡片视图
  4 + * Copyright (c) 2019 ruoyi
5 5 */
6   -
7 6 !function ($) {
8   -
  7 +
9 8 'use strict';
10   -
11   - var showHideColumns = function (that, checked) {
12   - if (that.options.columnsHidden.length > 0 ) {
13   - $.each(that.columns, function (i, column) {
14   - if (that.options.columnsHidden.indexOf(column.field) !== -1) {
15   - if (column.visible !== checked) {
16   - that.toggleColumn($.fn.bootstrapTable.utils.getFieldIndex(that.columns, column.field), checked, true);
17   - }
18   - }
19   - });
20   - }
21   - };
22   -
  9 +
23 10 var resetView = function (that) {
24 11 if (that.options.height || that.options.showFooter) {
25   - setTimeout(function(){
26   - that.resetView.call(that);
27   - }, 1);
  12 + setTimeout(that.resetView(), 1);
28 13 }
29 14 };
  15 +
  16 + // 判断是否 iphone
  17 + var isIPhone = function () {
  18 + var browserName = navigator.userAgent.toLowerCase();
  19 + return /(iPhone|iPad|iPod|iOS)/i.test(browserName);
  20 + };
30 21  
31 22 var changeView = function (that, width, height) {
32 23 if (that.options.minHeight) {
33   - if ((width <= that.options.minWidth) && (height <= that.options.minHeight)) {
  24 + if (checkValuesLessEqual(width, that.options.minWidth) && checkValuesLessEqual(height, that.options.minHeight)) {
34 25 conditionCardView(that);
35   - } else if ((width > that.options.minWidth) && (height > that.options.minHeight)) {
  26 + } else if (checkValuesGreater(width, that.options.minWidth) && checkValuesGreater(height, that.options.minHeight)) {
36 27 conditionFullView(that);
37 28 }
38 29 } else {
39   - if (width <= that.options.minWidth) {
  30 + if (checkValuesLessEqual(width, that.options.minWidth) || isIPhone()) {
40 31 conditionCardView(that);
41   - } else if (width > that.options.minWidth) {
  32 + } else if (checkValuesGreater(width, that.options.minWidth)) {
42 33 conditionFullView(that);
43 34 }
44 35 }
... ... @@ -46,14 +37,20 @@
46 37 resetView(that);
47 38 };
48 39  
  40 + var checkValuesLessEqual = function (currentValue, targetValue) {
  41 + return currentValue <= targetValue;
  42 + };
  43 +
  44 + var checkValuesGreater = function (currentValue, targetValue) {
  45 + return currentValue > targetValue;
  46 + };
  47 +
49 48 var conditionCardView = function (that) {
50 49 changeTableView(that, false);
51   - showHideColumns(that, false);
52 50 };
53 51  
54 52 var conditionFullView = function (that) {
55 53 changeTableView(that, true);
56   - showHideColumns(that, true);
57 54 };
58 55  
59 56 var changeTableView = function (that, cardViewState) {
... ... @@ -61,27 +58,12 @@
61 58 that.toggleView();
62 59 };
63 60  
64   - var debounce = function(func,wait) {
65   - var timeout;
66   - return function() {
67   - var context = this,
68   - args = arguments;
69   - var later = function() {
70   - timeout = null;
71   - func.apply(context,args);
72   - };
73   - clearTimeout(timeout);
74   - timeout = setTimeout(later, wait);
75   - };
76   - };
77   -
78 61 $.extend($.fn.bootstrapTable.defaults, {
79 62 mobileResponsive: false,
80 63 minWidth: 562,
81 64 minHeight: undefined,
82   - heightThreshold: 100, // just slightly larger than mobile chrome's auto-hiding toolbar
83 65 checkOnInit: true,
84   - columnsHidden: []
  66 + toggled: false
85 67 });
86 68  
87 69 var BootstrapTable = $.fn.bootstrapTable.Constructor,
... ... @@ -98,39 +80,13 @@
98 80 return;
99 81 }
100 82  
101   - if (this.options.minWidth < 100 && this.options.resizable) {
102   - console.log("The minWidth when the resizable extension is active should be greater or equal than 100");
103   - this.options.minWidth = 100;
104   - }
105   -
106   - var that = this,
107   - old = {
108   - width: $(window).width(),
109   - height: $(window).height()
110   - };
111   -
112   - $(window).on('resize orientationchange',debounce(function (evt) {
113   - // reset view if height has only changed by at least the threshold.
114   - var height = $(this).height(),
115   - width = $(this).width();
116   -
117   - if (Math.abs(old.height - height) > that.options.heightThreshold || old.width != width) {
118   - changeView(that, width, height);
119   - old = {
120   - width: width,
121   - height: height
122   - };
123   - }
124   - },200));
  83 + var that = this;
  84 + $(window).resize(function () {
  85 + changeView(that, $(this).width(), $(this).height())
  86 + });
125 87  
126 88 if (this.options.checkOnInit) {
127   - var height = $(window).height(),
128   - width = $(window).width();
129   - changeView(this, width, height);
130   - old = {
131   - width: width,
132   - height: height
133   - };
  89 + changeView(this, $(window).width(), $(window).height());
134 90 }
135 91 };
136 92 }(jQuery);
137 93 \ No newline at end of file
... ...
src/main/resources/static/ajax/libs/bootstrap-table/extensions/mobile/bootstrap-table-mobile.min.js deleted
1   -/*
2   -* bootstrap-table - v1.11.0 - 2016-07-02
3   -* https://github.com/wenzhixin/bootstrap-table
4   -* Copyright (c) 2016 zhixin wen
5   -* Licensed MIT License
6   -*/
7   -!function(a){"use strict";var b=function(b,c){b.options.columnsHidden.length>0&&a.each(b.columns,function(d,e){-1!==b.options.columnsHidden.indexOf(e.field)&&e.visible!==c&&b.toggleColumn(a.fn.bootstrapTable.utils.getFieldIndex(b.columns,e.field),c,!0)})},c=function(a){(a.options.height||a.options.showFooter)&&setTimeout(function(){a.resetView.call(a)},1)},d=function(a,b,d){a.options.minHeight?b<=a.options.minWidth&&d<=a.options.minHeight?e(a):b>a.options.minWidth&&d>a.options.minHeight&&f(a):b<=a.options.minWidth?e(a):b>a.options.minWidth&&f(a),c(a)},e=function(a){g(a,!1),b(a,!1)},f=function(a){g(a,!0),b(a,!0)},g=function(a,b){a.options.cardView=b,a.toggleView()},h=function(a,b){var c;return function(){var d=this,e=arguments,f=function(){c=null,a.apply(d,e)};clearTimeout(c),c=setTimeout(f,b)}};a.extend(a.fn.bootstrapTable.defaults,{mobileResponsive:!1,minWidth:562,minHeight:void 0,heightThreshold:100,checkOnInit:!0,columnsHidden:[]});var i=a.fn.bootstrapTable.Constructor,j=i.prototype.init;i.prototype.init=function(){if(j.apply(this,Array.prototype.slice.apply(arguments)),this.options.mobileResponsive&&this.options.minWidth){this.options.minWidth<100&&this.options.resizable&&(console.log("The minWidth when the resizable extension is active should be greater or equal than 100"),this.options.minWidth=100);var b=this,c={width:a(window).width(),height:a(window).height()};if(a(window).on("resize orientationchange",h(function(){var e=a(this).height(),f=a(this).width();(Math.abs(c.height-e)>b.options.heightThreshold||c.width!=f)&&(d(b,f,e),c={width:f,height:e})},200)),this.options.checkOnInit){var e=a(window).height(),f=a(window).width();d(this,f,e),c={width:f,height:e}}}}}(jQuery);
8 0 \ No newline at end of file
src/main/resources/static/ajax/libs/bootstrap-table/extensions/reorder/bootstrap-table-reorder.js 0 → 100644
  1 +/**
  2 + * @author: Dennis Hernández
  3 + * 实现表格拖拽功能
  4 + * @version: v1.0.1
  5 + */
  6 +(function ($) {
  7 +
  8 + 'use strict';
  9 +
  10 + var isSearch = false;
  11 +
  12 + var rowAttr = function (row, index) {
  13 + return {
  14 + id: 'customId_' + index
  15 + };
  16 + };
  17 +
  18 + $.extend($.fn.bootstrapTable.defaults, {
  19 + reorderableRows: false,
  20 + onDragStyle: null,
  21 + onDropStyle: null,
  22 + onDragClass: "reorder_rows_onDragClass",
  23 + dragHandle: null,
  24 + useRowAttrFunc: false,
  25 + onReorderRowsDrag: function (table, row) {
  26 + return false;
  27 + },
  28 + onReorderRowsDrop: function (table, row) {
  29 + return false;
  30 + },
  31 + onReorderRow: function (newData) {
  32 + return false;
  33 + }
  34 + });
  35 +
  36 + $.extend($.fn.bootstrapTable.Constructor.EVENTS, {
  37 + 'reorder-row.bs.table': 'onReorderRow'
  38 + });
  39 +
  40 + var BootstrapTable = $.fn.bootstrapTable.Constructor,
  41 + _init = BootstrapTable.prototype.init,
  42 + _initSearch = BootstrapTable.prototype.initSearch;
  43 +
  44 + BootstrapTable.prototype.init = function () {
  45 +
  46 + if (!this.options.reorderableRows) {
  47 + _init.apply(this, Array.prototype.slice.apply(arguments));
  48 + return;
  49 + }
  50 +
  51 + var that = this;
  52 + if (this.options.useRowAttrFunc) {
  53 + this.options.rowAttributes = rowAttr;
  54 + }
  55 +
  56 + var onPostBody = this.options.onPostBody;
  57 + this.options.onPostBody = function () {
  58 + setTimeout(function () {
  59 + that.makeRowsReorderable();
  60 + onPostBody.apply();
  61 + }, 1);
  62 + };
  63 +
  64 + _init.apply(this, Array.prototype.slice.apply(arguments));
  65 + };
  66 +
  67 + BootstrapTable.prototype.initSearch = function () {
  68 + _initSearch.apply(this, Array.prototype.slice.apply(arguments));
  69 +
  70 + if (!this.options.reorderableRows) {
  71 + return;
  72 + }
  73 +
  74 + //Known issue after search if you reorder the rows the data is not display properly
  75 + //isSearch = true;
  76 + };
  77 +
  78 + BootstrapTable.prototype.makeRowsReorderable = function () {
  79 + if (this.options.cardView) {
  80 + return;
  81 + }
  82 +
  83 + var that = this;
  84 + this.$el.tableDnD({
  85 + onDragStyle: that.options.onDragStyle,
  86 + onDropStyle: that.options.onDropStyle,
  87 + onDragClass: that.options.onDragClass,
  88 + onDrop: that.onDrop,
  89 + onDragStart: that.options.onReorderRowsDrag,
  90 + dragHandle: that.options.dragHandle
  91 + });
  92 + };
  93 +
  94 + BootstrapTable.prototype.onDrop = function (table, droppedRow) {
  95 + var tableBs = $(table),
  96 + tableBsData = tableBs.data('bootstrap.table'),
  97 + tableBsOptions = tableBs.data('bootstrap.table').options,
  98 + row = null,
  99 + newData = [];
  100 +
  101 + for (var i = 0; i < table.tBodies[0].rows.length; i++) {
  102 + row = $(table.tBodies[0].rows[i]);
  103 + newData.push(tableBsOptions.data[row.data('index')]);
  104 + row.data('index', i).attr('data-index', i);
  105 + }
  106 +
  107 + tableBsOptions.data = tableBsOptions.data.slice(0, tableBsData.pageFrom - 1)
  108 + .concat(newData)
  109 + .concat(tableBsOptions.data.slice(tableBsData.pageTo));
  110 +
  111 + //Call the user defined function
  112 + tableBsOptions.onReorderRowsDrop.apply(table, [table, droppedRow]);
  113 +
  114 + //Call the event reorder-row
  115 + tableBsData.trigger('reorder-row', newData);
  116 + };
  117 +})(jQuery);
0 118 \ No newline at end of file
... ...
src/main/resources/static/ajax/libs/bootstrap-table/extensions/reorder/jquery.tablednd.js 0 → 100644
  1 +/**
  2 + * TableDnD plug-in for JQuery, allows you to drag and drop table rows
  3 + * You can set up various options to control how the system will work
  4 + * Copyright (c) Denis Howlett <denish@isocra.com>
  5 + * License: MIT.
  6 + * See https://github.com/isocra/TableDnD
  7 + */
  8 +!function ($, window, document, undefined) {
  9 +
  10 +var startEvent = 'touchstart mousedown',
  11 + moveEvent = 'touchmove mousemove',
  12 + endEvent = 'touchend mouseup';
  13 +
  14 +$(document).ready(function () {
  15 + function parseStyle(css) {
  16 + var objMap = {},
  17 + parts = css.match(/([^;:]+)/g) || [];
  18 + while (parts.length)
  19 + objMap[parts.shift()] = parts.shift().trim();
  20 +
  21 + return objMap;
  22 + }
  23 + $('table').each(function () {
  24 + if ($(this).data('table') === 'dnd') {
  25 +
  26 + $(this).tableDnD({
  27 + onDragStyle: $(this).data('ondragstyle') && parseStyle($(this).data('ondragstyle')) || null,
  28 + onDropStyle: $(this).data('ondropstyle') && parseStyle($(this).data('ondropstyle')) || null,
  29 + onDragClass: $(this).data('ondragclass') === undefined && "tDnD_whileDrag" || $(this).data('ondragclass'),
  30 + onDrop: $(this).data('ondrop') && new Function('table', 'row', $(this).data('ondrop')), // 'return eval("'+$(this).data('ondrop')+'");') || null,
  31 + onDragStart: $(this).data('ondragstart') && new Function('table', 'row' ,$(this).data('ondragstart')), // 'return eval("'+$(this).data('ondragstart')+'");') || null,
  32 + onDragStop: $(this).data('ondragstop') && new Function('table', 'row' ,$(this).data('ondragstop')),
  33 + scrollAmount: $(this).data('scrollamount') || 5,
  34 + sensitivity: $(this).data('sensitivity') || 10,
  35 + hierarchyLevel: $(this).data('hierarchylevel') || 0,
  36 + indentArtifact: $(this).data('indentartifact') || '<div class="indent">&nbsp;</div>',
  37 + autoWidthAdjust: $(this).data('autowidthadjust') || true,
  38 + autoCleanRelations: $(this).data('autocleanrelations') || true,
  39 + jsonPretifySeparator: $(this).data('jsonpretifyseparator') || '\t',
  40 + serializeRegexp: $(this).data('serializeregexp') && new RegExp($(this).data('serializeregexp')) || /[^\-]*$/,
  41 + serializeParamName: $(this).data('serializeparamname') || false,
  42 + dragHandle: $(this).data('draghandle') || null
  43 + });
  44 + }
  45 +
  46 +
  47 + });
  48 +});
  49 +
  50 +jQuery.tableDnD = {
  51 + /** Keep hold of the current table being dragged */
  52 + currentTable: null,
  53 + /** Keep hold of the current drag object if any */
  54 + dragObject: null,
  55 + /** The current mouse offset */
  56 + mouseOffset: null,
  57 + /** Remember the old value of X and Y so that we don't do too much processing */
  58 + oldX: 0,
  59 + oldY: 0,
  60 +
  61 + /** Actually build the structure */
  62 + build: function(options) {
  63 + // Set up the defaults if any
  64 +
  65 + this.each(function() {
  66 + // This is bound to each matching table, set up the defaults and override with user options
  67 + this.tableDnDConfig = $.extend({
  68 + onDragStyle: null,
  69 + onDropStyle: null,
  70 + // Add in the default class for whileDragging
  71 + onDragClass: "tDnD_whileDrag",
  72 + onDrop: null,
  73 + onDragStart: null,
  74 + onDragStop: null,
  75 + scrollAmount: 5,
  76 + /** Sensitivity setting will throttle the trigger rate for movement detection */
  77 + sensitivity: 10,
  78 + /** Hierarchy level to support parent child. 0 switches this functionality off */
  79 + hierarchyLevel: 0,
  80 + /** The html artifact to prepend the first cell with as indentation */
  81 + indentArtifact: '<div class="indent">&nbsp;</div>',
  82 + /** Automatically adjust width of first cell */
  83 + autoWidthAdjust: true,
  84 + /** Automatic clean-up to ensure relationship integrity */
  85 + autoCleanRelations: true,
  86 + /** Specify a number (4) as number of spaces or any indent string for JSON.stringify */
  87 + jsonPretifySeparator: '\t',
  88 + /** The regular expression to use to trim row IDs */
  89 + serializeRegexp: /[^\-]*$/,
  90 + /** If you want to specify another parameter name instead of the table ID */
  91 + serializeParamName: false,
  92 + /** If you give the name of a class here, then only Cells with this class will be draggable */
  93 + dragHandle: null
  94 + }, options || {});
  95 +
  96 + // Now make the rows draggable
  97 + $.tableDnD.makeDraggable(this);
  98 + // Prepare hierarchy support
  99 + this.tableDnDConfig.hierarchyLevel
  100 + && $.tableDnD.makeIndented(this);
  101 + });
  102 +
  103 + // Don't break the chain
  104 + return this;
  105 + },
  106 + makeIndented: function (table) {
  107 + var config = table.tableDnDConfig,
  108 + rows = table.rows,
  109 + firstCell = $(rows).first().find('td:first')[0],
  110 + indentLevel = 0,
  111 + cellWidth = 0,
  112 + longestCell,
  113 + tableStyle;
  114 +
  115 + if ($(table).hasClass('indtd'))
  116 + return null;
  117 +
  118 + tableStyle = $(table).addClass('indtd').attr('style');
  119 + $(table).css({whiteSpace: "nowrap"});
  120 +
  121 + for (var w = 0; w < rows.length; w++) {
  122 + if (cellWidth < $(rows[w]).find('td:first').text().length) {
  123 + cellWidth = $(rows[w]).find('td:first').text().length;
  124 + longestCell = w;
  125 + }
  126 + }
  127 + $(firstCell).css({width: 'auto'});
  128 + for (w = 0; w < config.hierarchyLevel; w++)
  129 + $(rows[longestCell]).find('td:first').prepend(config.indentArtifact);
  130 + firstCell && $(firstCell).css({width: firstCell.offsetWidth});
  131 + tableStyle && $(table).css(tableStyle);
  132 +
  133 + for (w = 0; w < config.hierarchyLevel; w++)
  134 + $(rows[longestCell]).find('td:first').children(':first').remove();
  135 +
  136 + config.hierarchyLevel
  137 + && $(rows).each(function () {
  138 + indentLevel = $(this).data('level') || 0;
  139 + indentLevel <= config.hierarchyLevel
  140 + && $(this).data('level', indentLevel)
  141 + || $(this).data('level', 0);
  142 + for (var i = 0; i < $(this).data('level'); i++)
  143 + $(this).find('td:first').prepend(config.indentArtifact);
  144 + });
  145 +
  146 + return this;
  147 + },
  148 + /** This function makes all the rows on the table draggable apart from those marked as "NoDrag" */
  149 + makeDraggable: function(table) {
  150 + var config = table.tableDnDConfig;
  151 +
  152 + config.dragHandle
  153 + // We only need to add the event to the specified cells
  154 + && $(config.dragHandle, table).each(function() {
  155 + // The cell is bound to "this"
  156 + $(this).bind(startEvent, function(e) {
  157 + $.tableDnD.initialiseDrag($(this).parents('tr')[0], table, this, e, config);
  158 + return false;
  159 + });
  160 + })
  161 + // For backwards compatibility, we add the event to the whole row
  162 + // get all the rows as a wrapped set
  163 + || $(table.rows).each(function() {
  164 + // Iterate through each row, the row is bound to "this"
  165 + if (! $(this).hasClass("nodrag")) {
  166 + $(this).bind(startEvent, function(e) {
  167 + if (e.target.tagName === "TD" && event.target.className !== "nodrag") {
  168 + $.tableDnD.initialiseDrag(this, table, this, e, config);
  169 + return false;
  170 + }
  171 + }).css("cursor", "move"); // Store the tableDnD object
  172 + } else {
  173 + $(this).css("cursor", ""); // Remove the cursor if we don't have the nodrag class
  174 + }
  175 + });
  176 + },
  177 + currentOrder: function() {
  178 + var rows = this.currentTable.rows;
  179 + return $.map(rows, function (val) {
  180 + return ($(val).data('level') + val.id).replace(/\s/g, '');
  181 + }).join('');
  182 + },
  183 + initialiseDrag: function(dragObject, table, target, e, config) {
  184 + this.dragObject = dragObject;
  185 + this.currentTable = table;
  186 + this.mouseOffset = this.getMouseOffset(target, e);
  187 + this.originalOrder = this.currentOrder();
  188 +
  189 + // Now we need to capture the mouse up and mouse move event
  190 + // We can use bind so that we don't interfere with other event handlers
  191 + $(document)
  192 + .bind(moveEvent, this.mousemove)
  193 + .bind(endEvent, this.mouseup);
  194 +
  195 + // Call the onDragStart method if there is one
  196 + config.onDragStart
  197 + && config.onDragStart(table, target);
  198 + },
  199 + updateTables: function() {
  200 + this.each(function() {
  201 + // this is now bound to each matching table
  202 + if (this.tableDnDConfig)
  203 + $.tableDnD.makeDraggable(this);
  204 + });
  205 + },
  206 + /** Get the mouse coordinates from the event (allowing for browser differences) */
  207 + mouseCoords: function(e) {
  208 + if (e.originalEvent.changedTouches)
  209 + return {
  210 + x: e.originalEvent.changedTouches[0].clientX,
  211 + y: e.originalEvent.changedTouches[0].clientY
  212 + };
  213 +
  214 + if(e.pageX || e.pageY)
  215 + return {
  216 + x: e.pageX,
  217 + y: e.pageY
  218 + };
  219 +
  220 + return {
  221 + x: e.clientX + document.body.scrollLeft - document.body.clientLeft,
  222 + y: e.clientY + document.body.scrollTop - document.body.clientTop
  223 + };
  224 + },
  225 + /** Given a target element and a mouse eent, get the mouse offset from that element.
  226 + To do this we need the element's position and the mouse position */
  227 + getMouseOffset: function(target, e) {
  228 + var mousePos,
  229 + docPos;
  230 +
  231 + e = e || window.event;
  232 +
  233 + docPos = this.getPosition(target);
  234 + mousePos = this.mouseCoords(e);
  235 +
  236 + return {
  237 + x: mousePos.x - docPos.x,
  238 + y: mousePos.y - docPos.y
  239 + };
  240 + },
  241 + /** Get the position of an element by going up the DOM tree and adding up all the offsets */
  242 + getPosition: function(element) {
  243 + var left = 0,
  244 + top = 0;
  245 +
  246 + // Safari fix -- thanks to Luis Chato for this!
  247 + // Safari 2 doesn't correctly grab the offsetTop of a table row
  248 + // this is detailed here:
  249 + // http://jacob.peargrove.com/blog/2006/technical/table-row-offsettop-bug-in-safari/
  250 + // the solution is likewise noted there, grab the offset of a table cell in the row - the firstChild.
  251 + // note that firefox will return a text node as a first child, so designing a more thorough
  252 + // solution may need to take that into account, for now this seems to work in firefox, safari, ie
  253 + if (element.offsetHeight === 0)
  254 + element = element.firstChild; // a table cell
  255 +
  256 + while (element.offsetParent) {
  257 + left += element.offsetLeft;
  258 + top += element.offsetTop;
  259 + element = element.offsetParent;
  260 + }
  261 +
  262 + left += element.offsetLeft;
  263 + top += element.offsetTop;
  264 +
  265 + return {
  266 + x: left,
  267 + y: top
  268 + };
  269 + },
  270 + autoScroll: function (mousePos) {
  271 + var config = this.currentTable.tableDnDConfig,
  272 + yOffset = window.pageYOffset,
  273 + windowHeight = window.innerHeight
  274 + ? window.innerHeight
  275 + : document.documentElement.clientHeight
  276 + ? document.documentElement.clientHeight
  277 + : document.body.clientHeight;
  278 +
  279 + // Windows version
  280 + // yOffset=document.body.scrollTop;
  281 + if (document.all)
  282 + if (typeof document.compatMode !== 'undefined'
  283 + && document.compatMode !== 'BackCompat')
  284 + yOffset = document.documentElement.scrollTop;
  285 + else if (typeof document.body !== 'undefined')
  286 + yOffset = document.body.scrollTop;
  287 +
  288 + mousePos.y - yOffset < config.scrollAmount
  289 + && window.scrollBy(0, - config.scrollAmount)
  290 + || windowHeight - (mousePos.y - yOffset) < config.scrollAmount
  291 + && window.scrollBy(0, config.scrollAmount);
  292 +
  293 + },
  294 + moveVerticle: function (moving, currentRow) {
  295 +
  296 + if (0 !== moving.vertical
  297 + // If we're over a row then move the dragged row to there so that the user sees the
  298 + // effect dynamically
  299 + && currentRow
  300 + && this.dragObject !== currentRow
  301 + && this.dragObject.parentNode === currentRow.parentNode)
  302 + 0 > moving.vertical
  303 + && this.dragObject.parentNode.insertBefore(this.dragObject, currentRow.nextSibling)
  304 + || 0 < moving.vertical
  305 + && this.dragObject.parentNode.insertBefore(this.dragObject, currentRow);
  306 +
  307 + },
  308 + moveHorizontal: function (moving, currentRow) {
  309 + var config = this.currentTable.tableDnDConfig,
  310 + currentLevel;
  311 +
  312 + if (!config.hierarchyLevel
  313 + || 0 === moving.horizontal
  314 + // We only care if moving left or right on the current row
  315 + || !currentRow
  316 + || this.dragObject !== currentRow)
  317 + return null;
  318 +
  319 + currentLevel = $(currentRow).data('level');
  320 +
  321 + 0 < moving.horizontal
  322 + && currentLevel > 0
  323 + && $(currentRow).find('td:first').children(':first').remove()
  324 + && $(currentRow).data('level', --currentLevel);
  325 +
  326 + 0 > moving.horizontal
  327 + && currentLevel < config.hierarchyLevel
  328 + && $(currentRow).prev().data('level') >= currentLevel
  329 + && $(currentRow).children(':first').prepend(config.indentArtifact)
  330 + && $(currentRow).data('level', ++currentLevel);
  331 +
  332 + },
  333 + mousemove: function(e) {
  334 + var dragObj = $($.tableDnD.dragObject),
  335 + config = $.tableDnD.currentTable.tableDnDConfig,
  336 + currentRow,
  337 + mousePos,
  338 + moving,
  339 + x,
  340 + y;
  341 +
  342 + e && e.preventDefault();
  343 +
  344 + if (!$.tableDnD.dragObject)
  345 + return false;
  346 +
  347 + // prevent touch device screen scrolling
  348 + e.type === 'touchmove'
  349 + && event.preventDefault(); // TODO verify this is event and not really e
  350 +
  351 + // update the style to show we're dragging
  352 + config.onDragClass
  353 + && dragObj.addClass(config.onDragClass)
  354 + || dragObj.css(config.onDragStyle);
  355 +
  356 + mousePos = $.tableDnD.mouseCoords(e);
  357 + x = mousePos.x - $.tableDnD.mouseOffset.x;
  358 + y = mousePos.y - $.tableDnD.mouseOffset.y;
  359 +
  360 + // auto scroll the window
  361 + $.tableDnD.autoScroll(mousePos);
  362 +
  363 + currentRow = $.tableDnD.findDropTargetRow(dragObj, y);
  364 + moving = $.tableDnD.findDragDirection(x, y);
  365 +
  366 + $.tableDnD.moveVerticle(moving, currentRow);
  367 + $.tableDnD.moveHorizontal(moving, currentRow);
  368 +
  369 + return false;
  370 + },
  371 + findDragDirection: function (x,y) {
  372 + var sensitivity = this.currentTable.tableDnDConfig.sensitivity,
  373 + oldX = this.oldX,
  374 + oldY = this.oldY,
  375 + xMin = oldX - sensitivity,
  376 + xMax = oldX + sensitivity,
  377 + yMin = oldY - sensitivity,
  378 + yMax = oldY + sensitivity,
  379 + moving = {
  380 + horizontal: x >= xMin && x <= xMax ? 0 : x > oldX ? -1 : 1,
  381 + vertical : y >= yMin && y <= yMax ? 0 : y > oldY ? -1 : 1
  382 + };
  383 +
  384 + // update the old value
  385 + if (moving.horizontal !== 0)
  386 + this.oldX = x;
  387 + if (moving.vertical !== 0)
  388 + this.oldY = y;
  389 +
  390 + return moving;
  391 + },
  392 + /** We're only worried about the y position really, because we can only move rows up and down */
  393 + findDropTargetRow: function(draggedRow, y) {
  394 + var rowHeight = 0,
  395 + rows = this.currentTable.rows,
  396 + config = this.currentTable.tableDnDConfig,
  397 + rowY = 0,
  398 + row = null;
  399 +
  400 + for (var i = 0; i < rows.length; i++) {
  401 + row = rows[i];
  402 + rowY = this.getPosition(row).y;
  403 + rowHeight = parseInt(row.offsetHeight) / 2;
  404 + if (row.offsetHeight === 0) {
  405 + rowY = this.getPosition(row.firstChild).y;
  406 + rowHeight = parseInt(row.firstChild.offsetHeight) / 2;
  407 + }
  408 + // Because we always have to insert before, we need to offset the height a bit
  409 + if (y > (rowY - rowHeight) && y < (rowY + rowHeight))
  410 + // that's the row we're over
  411 + // If it's the same as the current row, ignore it
  412 + if (draggedRow.is(row)
  413 + || (config.onAllowDrop
  414 + && !config.onAllowDrop(draggedRow, row))
  415 + // If a row has nodrop class, then don't allow dropping (inspired by John Tarr and Famic)
  416 + || $(row).hasClass("nodrop"))
  417 + return null;
  418 + else
  419 + return row;
  420 + }
  421 + return null;
  422 + },
  423 + processMouseup: function() {
  424 + if (!this.currentTable || !this.dragObject)
  425 + return null;
  426 +
  427 + var config = this.currentTable.tableDnDConfig,
  428 + droppedRow = this.dragObject,
  429 + parentLevel = 0,
  430 + myLevel = 0;
  431 +
  432 + // Unbind the event handlers
  433 + $(document)
  434 + .unbind(moveEvent, this.mousemove)
  435 + .unbind(endEvent, this.mouseup);
  436 +
  437 + config.hierarchyLevel
  438 + && config.autoCleanRelations
  439 + && $(this.currentTable.rows).first().find('td:first').children().each(function () {
  440 + myLevel = $(this).parents('tr:first').data('level');
  441 + myLevel
  442 + && $(this).parents('tr:first').data('level', --myLevel)
  443 + && $(this).remove();
  444 + })
  445 + && config.hierarchyLevel > 1
  446 + && $(this.currentTable.rows).each(function () {
  447 + myLevel = $(this).data('level');
  448 + if (myLevel > 1) {
  449 + parentLevel = $(this).prev().data('level');
  450 + while (myLevel > parentLevel + 1) {
  451 + $(this).find('td:first').children(':first').remove();
  452 + $(this).data('level', --myLevel);
  453 + }
  454 + }
  455 + });
  456 +
  457 + // If we have a dragObject, then we need to release it,
  458 + // The row will already have been moved to the right place so we just reset stuff
  459 + config.onDragClass
  460 + && $(droppedRow).removeClass(config.onDragClass)
  461 + || $(droppedRow).css(config.onDropStyle);
  462 +
  463 + this.dragObject = null;
  464 + // Call the onDrop method if there is one
  465 + config.onDrop
  466 + && this.originalOrder !== this.currentOrder()
  467 + && $(droppedRow).hide().fadeIn('fast')
  468 + && config.onDrop(this.currentTable, droppedRow);
  469 +
  470 + // Call the onDragStop method if there is one
  471 + config.onDragStop
  472 + && config.onDragStop(this.currentTable, droppedRow);
  473 +
  474 + this.currentTable = null; // let go of the table too
  475 + },
  476 + mouseup: function(e) {
  477 + e && e.preventDefault();
  478 + $.tableDnD.processMouseup();
  479 + return false;
  480 + },
  481 + jsonize: function(pretify) {
  482 + var table = this.currentTable;
  483 + if (pretify)
  484 + return JSON.stringify(
  485 + this.tableData(table),
  486 + null,
  487 + table.tableDnDConfig.jsonPretifySeparator
  488 + );
  489 + return JSON.stringify(this.tableData(table));
  490 + },
  491 + serialize: function() {
  492 + return $.param(this.tableData(this.currentTable));
  493 + },
  494 + serializeTable: function(table) {
  495 + var result = "";
  496 + var paramName = table.tableDnDConfig.serializeParamName || table.id;
  497 + var rows = table.rows;
  498 + for (var i=0; i<rows.length; i++) {
  499 + if (result.length > 0) result += "&";
  500 + var rowId = rows[i].id;
  501 + if (rowId && table.tableDnDConfig && table.tableDnDConfig.serializeRegexp) {
  502 + rowId = rowId.match(table.tableDnDConfig.serializeRegexp)[0];
  503 + result += paramName + '[]=' + rowId;
  504 + }
  505 + }
  506 + return result;
  507 + },
  508 + serializeTables: function() {
  509 + var result = [];
  510 + $('table').each(function() {
  511 + this.id && result.push($.param($.tableDnD.tableData(this)));
  512 + });
  513 + return result.join('&');
  514 + },
  515 + tableData: function (table) {
  516 + var config = table.tableDnDConfig,
  517 + previousIDs = [],
  518 + currentLevel = 0,
  519 + indentLevel = 0,
  520 + rowID = null,
  521 + data = {},
  522 + getSerializeRegexp,
  523 + paramName,
  524 + currentID,
  525 + rows;
  526 +
  527 + if (!table)
  528 + table = this.currentTable;
  529 + if (!table || !table.rows || !table.rows.length)
  530 + return {error: { code: 500, message: "Not a valid table."}};
  531 + if (!table.id && !config.serializeParamName)
  532 + return {error: { code: 500, message: "No serializable unique id provided."}};
  533 +
  534 + rows = config.autoCleanRelations
  535 + && table.rows
  536 + || $.makeArray(table.rows);
  537 + paramName = config.serializeParamName || table.id;
  538 + currentID = paramName;
  539 +
  540 + getSerializeRegexp = function (rowId) {
  541 + if (rowId && config && config.serializeRegexp)
  542 + return rowId.match(config.serializeRegexp)[0];
  543 + return rowId;
  544 + };
  545 +
  546 + data[currentID] = [];
  547 + !config.autoCleanRelations
  548 + && $(rows[0]).data('level')
  549 + && rows.unshift({id: 'undefined'});
  550 +
  551 +
  552 +
  553 + for (var i=0; i < rows.length; i++) {
  554 + if (config.hierarchyLevel) {
  555 + indentLevel = $(rows[i]).data('level') || 0;
  556 + if (indentLevel === 0) {
  557 + currentID = paramName;
  558 + previousIDs = [];
  559 + }
  560 + else if (indentLevel > currentLevel) {
  561 + previousIDs.push([currentID, currentLevel]);
  562 + currentID = getSerializeRegexp(rows[i-1].id);
  563 + }
  564 + else if (indentLevel < currentLevel) {
  565 + for (var h = 0; h < previousIDs.length; h++) {
  566 + if (previousIDs[h][1] === indentLevel)
  567 + currentID = previousIDs[h][0];
  568 + if (previousIDs[h][1] >= currentLevel)
  569 + previousIDs[h][1] = 0;
  570 + }
  571 + }
  572 + currentLevel = indentLevel;
  573 +
  574 + if (!$.isArray(data[currentID]))
  575 + data[currentID] = [];
  576 + rowID = getSerializeRegexp(rows[i].id);
  577 + rowID && data[currentID].push(rowID);
  578 + }
  579 + else {
  580 + rowID = getSerializeRegexp(rows[i].id);
  581 + rowID && data[currentID].push(rowID);
  582 + }
  583 + }
  584 + return data;
  585 + }
  586 +};
  587 +
  588 +jQuery.fn.extend(
  589 + {
  590 + tableDnD : $.tableDnD.build,
  591 + tableDnDUpdate : $.tableDnD.updateTables,
  592 + tableDnDSerialize : $.proxy($.tableDnD.serialize, $.tableDnD),
  593 + tableDnDSerializeAll : $.tableDnD.serializeTables,
  594 + tableDnDData : $.proxy($.tableDnD.tableData, $.tableDnD)
  595 + }
  596 +);
  597 +
  598 +}(jQuery, window, window.document);
... ...
src/main/resources/static/huaheng/js/huahengUI.js
... ... @@ -2,66 +2,149 @@
2 2 * 通用方法封装处理
3 3 * Copyright (c) 2018 huaheng
4 4 */
  5 +// 当前table相关信息
  6 +var table = {
  7 + config: {},
  8 + // 当前实例配置
  9 + options: {},
  10 + // 设置实例配置
  11 + set: function(id) {
  12 + if($.common.getLength(table.config) > 1) {
  13 + var tableId = $.common.isEmpty(id) ? $(event.currentTarget).parents(".bootstrap-table").find(".table").attr("id") : id;
  14 + if ($.common.isNotEmpty(tableId)) {
  15 + table.options = table.get(tableId);
  16 + }
  17 + }
  18 + },
  19 + // 获取实例配置
  20 + get: function(id) {
  21 + return table.config[id];
  22 + },
  23 + // 记住选择实例组
  24 + rememberSelecteds: {},
  25 + // 记住选择ID组
  26 + rememberSelectedIds: {}
  27 +};
  28 +
5 29 (function ($) {
6 30 $.extend({
  31 + _tree: {},
  32 + bttTable: {},
7 33 // 表格封装处理
8 34 table: {
9   - _option: {},
10   - _params: {},
11 35 // 初始化表格
12 36 init: function(options) {
13   - $.table._option = options;
14   - $.table._params = $.common.isEmpty(options.queryParams) ? $.table.queryParams : options.queryParams;
15   - _sortOrder = $.common.isEmpty(options.sortOrder) ? "asc" : options.sortOrder;
16   - _sortName = $.common.isEmpty(options.sortName) ? "" : options.sortName;
17   - _detailView = $.common.isEmpty(options.detailView)? false: options.detailView;
18   - $('#bootstrap-table').bootstrapTable({
  37 + var defaults = {
  38 + id: "bootstrap-table",
  39 + type: 0, // 0 代表bootstrapTable 1代表bootstrapTreeTable
  40 + height: undefined,
  41 + sidePagination: "server",
  42 + sortName: "",
  43 + sortOrder: "asc",
  44 + pagination: true,
  45 + pageSize: 10,
  46 + pageList: [10, 25, 50],
  47 + toolbar: "toolbar",
  48 + striped: false,
  49 + escape: false,
  50 + firstLoad: true,
  51 + showFooter: false,
  52 + search: false,
  53 + showSearch: true,
  54 + showPageGo: false,
  55 + showRefresh: true,
  56 + showColumns: true,
  57 + showToggle: true,
  58 + showExport: false,
  59 + clickToSelect: false,
  60 + mobileResponsive: true,
  61 + rememberSelected: false,
  62 + fixedColumns: false,
  63 + fixedNumber: 0,
  64 + rightFixedColumns: false,
  65 + rightFixedNumber: 0,
  66 + queryParams: $.table.queryParams,
  67 + rowStyle: {},
  68 + };
  69 + var options = $.extend(defaults, options);
  70 + table.options = options;
  71 + table.config[options.id] = options;
  72 + $.table.initEvent();
  73 + $('#'+ options.id).bootstrapTable({
  74 + id: options.id,
19 75 url: options.url, // 请求后台的URL(*)
20 76 contentType: "application/x-www-form-urlencoded", // 编码类型
21 77 method: 'post', // 请求方式(*)
22 78 cache: false, // 是否使用缓存
  79 + height: options.height, // 表格的高度
  80 + striped: options.striped, // 是否显示行间隔色
23 81 sortable: true, // 是否启用排序
24 82 sortStable: true, // 设置为 true 将获得稳定的排序
25   - sortName: _sortName, // 排序列名称
26   - sortOrder: _sortOrder, // 排序方式 asc 或者 desc
27   - detailView: _detailView, // 是否启用细节视图
28   - pagination: $.common.visible(options.pagination), // 是否显示分页(*)
  83 + sortName: options.sortName, // 排序列名称
  84 + sortOrder: options.sortOrder, // 排序方式 asc 或者 desc
  85 + detailView: options.detailView, // 是否启用细节视图
  86 + pagination: options.pagination, // 是否显示分页(*)
29 87 pageNumber: 1, // 初始化加载第一页,默认第一页
30   - pageSize: 10, // 每页的记录行数(*)
31   - pageList: [10, 25, 50], // 可供选择的每页的行数(*)
  88 + pageSize: options.pageSize, // 每页的记录行数(*)
  89 + pageList: options.pageList, // 可供选择的每页的行数(*)
  90 + firstLoad: options.firstLoad, // 是否首次请求加载数据,对于数据较大可以配置false
  91 + escape: options.escape, // 转义HTML字符串
  92 + showFooter: options.showFooter, // 是否显示表尾
32 93 iconSize: 'outline', // 图标大小:undefined默认的按钮尺寸 xs超小按钮sm小按钮lg大按钮
33   - toolbar: '#toolbar', // 指定工作栏
34   - sidePagination: "server", // 启用服务端分页
35   - search: $.common.visible(options.search), // 是否显示搜索框功能
36   - showRefresh: $.common.visible(options.showRefresh), // 是否显示刷新按钮
37   - showColumns: $.common.visible(options.showColumns), // 是否显示隐藏某列下拉框
38   - showToggle: $.common.visible(options.showToggle), // 是否显示详细视图和列表视图的切换按钮
39   - showExport: $.common.visible(options.showExport), // 是否支持导出文件
40   - clickToSelect:$.common.visible(options.clickToSelect),
41   - queryParams: $.table._params, // 传递参数(*)
  94 + toolbar: '#'+options.toolbar, // 指定工作栏
  95 + sidePagination: options.sidePagination, // 启用服务端分页
  96 + search: options.search, // 是否显示搜索框功能
  97 + showSearch: options.showSearch, // 是否显示检索信息
  98 + showPageGo: options.showPageGo, // 是否显示跳转页
  99 + showRefresh: options.showRefresh, // 是否显示刷新按钮
  100 + showColumns: options.showColumns, // 是否显示隐藏某列下拉框
  101 + showToggle: options.showToggle, // 是否显示详细视图和列表视图的切换按钮
  102 + showExport: options.showExport, // 是否支持导出文件
  103 + uniqueId: options.uniqueId, // 唯 一的标识符
  104 + clickToSelect: options.clickToSelect, // 是否启用点击选中行
  105 + mobileResponsive: options.mobileResponsive, // 是否支持移动端适配
  106 + onClickRow: options.onClickRow, // 点击某行触发的事件
  107 + onDblClickRow: options.onDblClickRow, // 双击某行触发的事件
  108 + onClickCell: options.onClickCell, // 单击某格触发的事件
  109 + onDblClickCell: options.onDblClickCell, // 双击某格触发的事件
  110 + onEditableSave: options.onEditableSave, // 行内编辑保存的事件
  111 + onExpandRow: options.onExpandRow, // 点击详细视图的事件
  112 + rememberSelected: options.rememberSelected, // 启用翻页记住前面的选择
  113 + fixedColumns: options.fixedColumns, // 是否启用冻结列(左侧)
  114 + fixedNumber: options.fixedNumber, // 列冻结的个数(左侧)
  115 + rightFixedColumns: options.rightFixedColumns, // 是否启用冻结列(右侧)
  116 + rightFixedNumber: options.rightFixedNumber, // 列冻结的个数(右侧)
  117 + onReorderRow: options.onReorderRow, // 当拖拽结束后处理函数
  118 + queryParams: options.queryParams, // 传递参数(*)
  119 + rowStyle: options.rowStyle, // 通过自定义函数设置行样式
42 120 columns: options.columns, // 显示列信息(*)
43   - responseHandler: $.table.responseHandler , // 回调函数
44   - onDblClickRow:function(row){
45   - if (typeof detail != 'undefined') {
46   - detail(row.id, row.code)
47   - }
48   - },
49   - onExpandRow: options.onExpandRow,
50   - onClickCell: options.onClickCell,
51   - onClickRow: options.onClickRow,
52   - onLoadSuccess: options.onLoadSuccess,
  121 + responseHandler: $.table.responseHandler, // 在加载服务器发送来的数据之前处理函数
  122 + onLoadSuccess: $.table.onLoadSuccess, // 当所有数据被加载时触发处理函数
  123 + exportOptions: options.exportOptions, // 前端导出忽略列索引
  124 + detailFormatter: options.detailFormatter, // 在行下面展示其他数据列表
53 125 });
54 126 },
  127 + // 获取实例ID,如存在多个返回#id1,#id2 delimeter分隔符
  128 + getOptionsIds: function(separator) {
  129 + var _separator = $.common.isEmpty(separator) ? "," : separator;
  130 + var optionsIds = "";
  131 + $.each(table.config, function(key, value){
  132 + optionsIds += "#" + key + _separator;
  133 + });
  134 + return optionsIds.substring(0, optionsIds.length - 1);
  135 + },
55 136 // 查询条件
56 137 queryParams: function(params) {
57   - return {
58   - // 传递参数查询参数
59   - pageSize: params.limit,
60   - pageNum: params.offset / params.limit + 1,
61   - searchValue: params.search,
62   - orderByColumn: params.sort,
63   - isAsc: params.order
64   - };
  138 + var curParams = {
  139 + // 传递参数查询参数
  140 + pageSize: params.limit,
  141 + pageNum: params.offset / params.limit + 1,
  142 + searchValue: params.search,
  143 + orderByColumn: params.sort,
  144 + isAsc: params.order
  145 + };
  146 + var currentId = $.common.isEmpty(table.options.formId) ? $('form').attr('id') : table.options.formId;
  147 + return $.extend(curParams, $.common.formToJSON(currentId));
65 148 },
66 149 // 请求获取数据后处理回调函数
67 150 responseHandler: function(res) {
... ... @@ -72,6 +155,148 @@
72 155 return { rows: [], total: 0 };
73 156 }
74 157 },
  158 + // 初始化事件
  159 + initEvent: function() {
  160 + // 实例ID信息
  161 + var optionsIds = $.table.getOptionsIds();
  162 + // 监听事件处理
  163 + $(optionsIds).on(TABLE_EVENTS, function () {
  164 + table.set($(this).attr("id"));
  165 + });
  166 + // 选中、取消、全部选中、全部取消(事件)
  167 + $(optionsIds).on("check.bs.table check-all.bs.table uncheck.bs.table uncheck-all.bs.table", function (e, rows) {
  168 + // 复选框分页保留保存选中数组
  169 + var rowIds = $.table.affectedRowIds(rows);
  170 + if ($.common.isNotEmpty(table.options.rememberSelected) && table.options.rememberSelected) {
  171 + func = $.inArray(e.type, ['check', 'check-all']) > -1 ? 'union' : 'difference';
  172 + var selectedIds = table.rememberSelectedIds[table.options.id];
  173 + if($.common.isNotEmpty(selectedIds)) {
  174 + table.rememberSelectedIds[table.options.id] = _[func](selectedIds, rowIds);
  175 + } else {
  176 + table.rememberSelectedIds[table.options.id] = _[func]([], rowIds);
  177 + }
  178 + var selectedRows = table.rememberSelecteds[table.options.id];
  179 + if($.common.isNotEmpty(selectedRows)) {
  180 + table.rememberSelecteds[table.options.id] = _[func](selectedRows, rows);
  181 + } else {
  182 + table.rememberSelecteds[table.options.id] = _[func]([], rows);
  183 + }
  184 + }
  185 + });
  186 + // 加载成功、选中、取消、全部选中、全部取消(事件)
  187 + $(optionsIds).on("check.bs.table uncheck.bs.table check-all.bs.table uncheck-all.bs.table load-success.bs.table", function () {
  188 + var toolbar = table.options.toolbar;
  189 + var uniqueId = table.options.uniqueId;
  190 + // 工具栏按钮控制
  191 + var rows = $.common.isEmpty(uniqueId) ? $.table.selectFirstColumns() : $.table.selectColumns(uniqueId);
  192 + // 非多个禁用
  193 + $('#' + toolbar + ' .multiple').toggleClass('disabled', !rows.length);
  194 + // 非单个禁用
  195 + $('#' + toolbar + ' .single').toggleClass('disabled', rows.length!=1);
  196 + });
  197 + // 图片预览事件
  198 + $(optionsIds).off("click").on("click", '.img-circle', function() {
  199 + var src = $(this).attr('src');
  200 + var target = $(this).data('target');
  201 + var height = $(this).data('height');
  202 + var width = $(this).data('width');
  203 + if($.common.equals("self", target)) {
  204 + layer.open({
  205 + title: false,
  206 + type: 1,
  207 + closeBtn: true,
  208 + shadeClose: true,
  209 + area: ['auto', 'auto'],
  210 + content: "<img src='" + src + "' height='" + height + "' width='" + width + "'/>"
  211 + });
  212 + } else if ($.common.equals("blank", target)) {
  213 + window.open(src);
  214 + }
  215 + });
  216 + // 单击tooltip事件
  217 + $(optionsIds).on("click", '.tooltip-show', function() {
  218 + var target = $(this).data('target');
  219 + var input = $(this).prev();
  220 + if ($.common.equals("copy", target)) {
  221 + input.select();
  222 + document.execCommand("copy");
  223 + } else if ($.common.equals("open", target)) {
  224 + parent.layer.alert(input.val(), {
  225 + title: "信息内容",
  226 + shadeClose: true,
  227 + btn: ['确认'],
  228 + btnclass: ['btn btn-primary'],
  229 + });
  230 + }
  231 + });
  232 + },
  233 + // 当所有数据被加载时触发
  234 + onLoadSuccess: function(data) {
  235 + if (typeof table.options.onLoadSuccess == "function") {
  236 + table.options.onLoadSuccess(data);
  237 + }
  238 + // 浮动提示框特效
  239 + $("[data-toggle='tooltip']").tooltip();
  240 + },
  241 + // 表格销毁
  242 + destroy: function (tableId) {
  243 + var currentId = $.common.isEmpty(tableId) ? table.options.id : tableId;
  244 + $("#" + currentId).bootstrapTable('destroy');
  245 + },
  246 + // 序列号生成
  247 + serialNumber: function (index, tableId) {
  248 + var currentId = $.common.isEmpty(tableId) ? table.options.id : tableId;
  249 + var tableParams = $("#" + currentId).bootstrapTable('getOptions');
  250 + var pageSize = tableParams.pageSize;
  251 + var pageNumber = tableParams.pageNumber;
  252 + return pageSize * (pageNumber - 1) + index + 1;
  253 + },
  254 + // 列超出指定长度浮动提示 target(copy单击复制文本 open弹窗打开文本)
  255 + tooltip: function (value, length, target) {
  256 + var _length = $.common.isEmpty(length) ? 20 : length;
  257 + var _text = "";
  258 + var _value = $.common.nullToStr(value);
  259 + var _target = $.common.isEmpty(target) ? 'copy' : target;
  260 + if (_value.length > _length) {
  261 + _text = _value.substr(0, _length) + "...";
  262 + _value = _value.replace(/\'/g,"’");
  263 + var actions = [];
  264 + actions.push($.common.sprintf('<input id="tooltip-show" style="opacity: 0;position: absolute;z-index:-1" type="text" value="%s"/>', _value));
  265 + actions.push($.common.sprintf("<a href='###' class='tooltip-show' data-toggle='tooltip' data-target='%s' title='%s'>%s</a>", _target, _value, _text));
  266 + return actions.join('');
  267 + } else {
  268 + _text = _value;
  269 + return _text;
  270 + }
  271 + },
  272 + // 下拉按钮切换
  273 + dropdownToggle: function (value) {
  274 + var actions = [];
  275 + actions.push('<div class="btn-group">');
  276 + actions.push('<button type="button" class="btn btn-xs dropdown-toggle" data-toggle="dropdown" aria-expanded="false">');
  277 + actions.push('<i class="fa fa-cog"></i>&nbsp;<span class="fa fa-chevron-down"></span></button>');
  278 + actions.push('<ul class="dropdown-menu">');
  279 + actions.push(value.replace(/<a/g,"<li><a").replace(/<\/a>/g,"</a></li>"));
  280 + actions.push('</ul>');
  281 + actions.push('</div>');
  282 + return actions.join('');
  283 + },
  284 + // 图片预览
  285 + imageView: function (value, height, width, target) {
  286 + if ($.common.isEmpty(width)) {
  287 + width = 'auto';
  288 + }
  289 + if ($.common.isEmpty(height)) {
  290 + height = 'auto';
  291 + }
  292 + // blank or self
  293 + var _target = $.common.isEmpty(target) ? 'self' : target;
  294 + if ($.common.isNotEmpty(value)) {
  295 + return $.common.sprintf("<img class='img-circle img-xs' data-height='%s' data-width='%s' data-target='%s' src='%s'/>", height, width, _target, value);
  296 + } else {
  297 + return $.common.nullToStr(value);
  298 + }
  299 + },
75 300 // 搜索
76 301 search: function(formId) {
77 302 var currentId = $.common.isEmpty(formId) ? $('form').attr('id') : formId;
... ... @@ -167,13 +392,40 @@
167 392 }
168 393 });
169 394 },
170   - // 刷新
171   - refresh: function() {
172   - $("#bootstrap-table").bootstrapTable('refresh', {
173   - url: $.table._option.url,
  395 + refresh: function(tableId) {
  396 + var currentId = $.common.isEmpty(tableId) ? table.options.id : tableId;
  397 + $("#" + currentId).bootstrapTable('refresh', {
174 398 silent: true
175 399 });
176 400 },
  401 + // 查询表格指定列值
  402 + selectColumns: function(column) {
  403 + var rows = $.map($("#" + table.options.id).bootstrapTable('getSelections'), function (row) {
  404 + return row[column];
  405 + });
  406 + if ($.common.isNotEmpty(table.options.rememberSelected) && table.options.rememberSelected) {
  407 + var selectedRows = table.rememberSelecteds[table.options.id];
  408 + if($.common.isNotEmpty(selectedRows)) {
  409 + rows = $.map(table.rememberSelecteds[table.options.id], function (row) {
  410 + return row[column];
  411 + });
  412 + }
  413 + }
  414 + return $.common.uniqueFn(rows);
  415 + },
  416 + // 获取当前页选中或者取消的行ID
  417 + affectedRowIds: function(rows) {
  418 + var column = $.common.isEmpty(table.options.uniqueId) ? table.options.columns[1].field : table.options.uniqueId;
  419 + var rowIds;
  420 + if ($.isArray(rows)) {
  421 + rowIds = $.map(rows, function(row) {
  422 + return row[column];
  423 + });
  424 + } else {
  425 + rowIds = [rows[column]];
  426 + }
  427 + return rowIds;
  428 + },
177 429 // 查询选中列值
178 430 selectColumns: function(column) {
179 431 return $.map($('#bootstrap-table').bootstrapTable('getSelections'), function (row) {
... ... @@ -182,9 +434,18 @@
182 434 },
183 435 // 查询选中首列值
184 436 selectFirstColumns: function() {
185   - return $.map($('#bootstrap-table').bootstrapTable('getSelections'), function (row) {
186   - return row[$.table._option.columns[1].field];
187   - });
  437 + var rows = $.map($("#" + table.options.id).bootstrapTable('getSelections'), function (row) {
  438 + return row[table.options.columns[1].field];
  439 + });
  440 + if ($.common.isNotEmpty(table.options.rememberSelected) && table.options.rememberSelected) {
  441 + var selectedRows = table.rememberSelecteds[table.options.id];
  442 + if($.common.isNotEmpty(selectedRows)) {
  443 + rows = $.map(selectedRows, function (row) {
  444 + return row[table.options.columns[1].field];
  445 + });
  446 + }
  447 + }
  448 + return $.common.uniqueFn(rows);
188 449 },
189 450 // 回显数据字典
190 451 selectDictLabel: function(_datas, _value) {
... ... @@ -291,24 +552,16 @@
291 552 }
292 553 });
293 554 },
294   - // 列超出指定长度浮动提示 target(copy单击复制文本 open弹窗打开文本)
295   - tooltip: function (value, length, target) {
296   - var _length = $.common.isEmpty(length) ? 20 : length;
297   - var _text = "";
298   - var _value = $.common.nullToStr(value);
299   - var _target = $.common.isEmpty(target) ? 'copy' : target;
300   - if (_value.length > _length) {
301   - _text = _value.substr(0, _length) + "...";
302   - _value = _value.replace(/\'/g,"’");
303   - var actions = [];
304   - actions.push($.common.sprintf('<input id="tooltip-show" style="opacity: 0;position: absolute;z-index:-1" type="text" value="%s"/>', _value));
305   - actions.push($.common.sprintf("<a href='###' class='tooltip-show' data-toggle='tooltip' data-target='%s' title='%s'>%s</a>", _target, _value, _text));
306   - return actions.join('');
307   - } else {
308   - _text = _value;
309   - return _text;
310   - }
  555 + // 显示表格指定列
  556 + showColumn: function(column, tableId) {
  557 + var currentId = $.common.isEmpty(tableId) ? table.options.id : tableId;
  558 + $("#" + currentId).bootstrapTable('showColumn', column);
311 559 },
  560 + // 隐藏表格指定列
  561 + hideColumn: function(column, tableId) {
  562 + var currentId = $.common.isEmpty(tableId) ? table.options.id : tableId;
  563 + $("#" + currentId).bootstrapTable('hideColumn', column);
  564 + }
312 565 },
313 566 // 表格树封装处理
314 567 treeTable: {
... ... @@ -546,6 +799,20 @@
546 799 var doc = window.top == window.parent ? window.document : window.parent.document;
547 800 $("a[class*=layui-layer-btn]", doc).removeClass("layer-disabled");
548 801 },
  802 + // 选卡页方式打开
  803 + openTab: function (title, url) {
  804 + createMenuItem(url, title);
  805 + },
  806 + // 选卡页同一页签打开
  807 + parentTab: function (title, url) {
  808 + var dataId = window.frameElement.getAttribute('data-id');
  809 + createMenuItem(url, title);
  810 + closeItem(dataId);
  811 + },
  812 + // 关闭选项卡
  813 + closeTab: function (dataId) {
  814 + closeItem(dataId);
  815 + },
549 816 },
550 817 // 操作封装处理
551 818 operate: {
... ... @@ -587,6 +854,45 @@
587 854 post: function(url, data) {
588 855 $.operate.submit(url, "post", "json", data);
589 856 },
  857 + // 详细信息
  858 + detail: function(id, width, height) {
  859 + table.set();
  860 + var _url = $.operate.detailUrl(id);
  861 + var _width = $.common.isEmpty(width) ? "800" : width;
  862 + var _height = $.common.isEmpty(height) ? ($(window).height() - 50) : height;
  863 + //如果是移动端,就使用自适应大小弹窗
  864 + if (navigator.userAgent.match(/(iPhone|iPod|Android|ios)/i)) {
  865 + _width = 'auto';
  866 + _height = 'auto';
  867 + }
  868 + var options = {
  869 + title: table.options.modalName + "详细",
  870 + width: _width,
  871 + height: _height,
  872 + url: _url,
  873 + skin: 'layui-layer-gray',
  874 + btn: ['关闭'],
  875 + yes: function (index, layero) {
  876 + layer.close(index);
  877 + }
  878 + };
  879 + $.modal.openOptions(options);
  880 + },
  881 + // 详细访问地址
  882 + detailUrl: function(id) {
  883 + var url = "/404.html";
  884 + if ($.common.isNotEmpty(id)) {
  885 + url = table.options.detailUrl.replace("{id}", id);
  886 + } else {
  887 + var id = $.common.isEmpty(table.options.uniqueId) ? $.table.selectFirstColumns() : $.table.selectColumns(table.options.uniqueId);
  888 + if (id.length == 0) {
  889 + $.modal.alertWarning("请至少选择一条记录");
  890 + return;
  891 + }
  892 + url = table.options.detailUrl.replace("{id}", id);
  893 + }
  894 + return url;
  895 + },
590 896 // 删除信息
591 897 remove: function(id) {
592 898 $.modal.confirm("确定删除该条" + $.table._option.modalName + "信息吗?", function() {
... ... @@ -686,6 +992,10 @@
686 992 }
687 993 return false;
688 994 },
  995 + // 判断一个字符串是否为非空串
  996 + isNotEmpty: function (value) {
  997 + return !$.common.isEmpty(value);
  998 + },
689 999 // 空对象转字符串
690 1000 nullToStr: function(value) {
691 1001 if ($.common.isEmpty(value)) {
... ... @@ -707,10 +1017,51 @@
707 1017 }
708 1018 return value.toString().replace(/(^\s*)|(\s*$)|\r|\n/g, "");
709 1019 },
  1020 + // 比较两个字符串(大小写敏感)
  1021 + equals: function (str, that) {
  1022 + return str == that;
  1023 + },
  1024 + // 比较两个字符串(大小写不敏感)
  1025 + equalsIgnoreCase: function (str, that) {
  1026 + return String(str).toUpperCase() === String(that).toUpperCase();
  1027 + },
710 1028 // 指定随机数返回
711 1029 random: function (min, max) {
712 1030 return Math.floor((Math.random() * max) + min);
713 1031 },
  1032 + // 将字符串按指定字符分割
  1033 + split: function (str, sep, maxLen) {
  1034 + if ($.common.isEmpty(str)) {
  1035 + return null;
  1036 + }
  1037 + var value = String(str).split(sep);
  1038 + return maxLen ? value.slice(0, maxLen - 1) : value;
  1039 + },
  1040 + // 字符串格式化(%s )
  1041 + sprintf: function (str) {
  1042 + var args = arguments, flag = true, i = 1;
  1043 + str = str.replace(/%s/g, function () {
  1044 + var arg = args[i++];
  1045 + if (typeof arg === 'undefined') {
  1046 + flag = false;
  1047 + return '';
  1048 + }
  1049 + return arg;
  1050 + });
  1051 + return flag ? str : '';
  1052 + },
  1053 + // 数组去重
  1054 + uniqueFn: function(array) {
  1055 + var result = [];
  1056 + var hashObj = {};
  1057 + for (var i = 0; i < array.length; i++) {
  1058 + if (!hashObj[array[i]]) {
  1059 + hashObj[array[i]] = true;
  1060 + result.push(array[i]);
  1061 + }
  1062 + }
  1063 + return result;
  1064 + },
714 1065 // 序列化表单
715 1066 getTableValue: function (formName) {
716 1067 var tableValue = $(formName).serialize();
... ... @@ -729,8 +1080,50 @@
729 1080 tableValue = tableValue + "&enable=" + $("input[name='enable']").is(':checked')
730 1081 }
731 1082 return tableValue;
  1083 + },
  1084 + // 获取form下所有的字段并转换为json对象
  1085 + formToJSON: function(formId) {
  1086 + var json = {};
  1087 + $.each($("#" + formId).serializeArray(), function(i, field) {
  1088 + if(json[field.name]) {
  1089 + json[field.name] += ("," + field.value);
  1090 + } else {
  1091 + json[field.name] = field.value;
  1092 + }
  1093 + });
  1094 + return json;
  1095 + },
  1096 + // 获取obj对象长度
  1097 + getLength: function(obj) {
  1098 + var count = 0;
  1099 + for (var i in obj) {
  1100 + if (obj.hasOwnProperty(i)) {
  1101 + count++;
  1102 + }
  1103 + }
  1104 + return count;
732 1105 }
733   - }
  1106 + },
  1107 + // 校验封装处理
  1108 + validate: {
  1109 + // 判断返回标识是否唯一 false 不存在 true 存在
  1110 + unique: function (value) {
  1111 + if (value == "0") {
  1112 + return true;
  1113 + }
  1114 + return false;
  1115 + },
  1116 + // 表单验证
  1117 + form: function (formId) {
  1118 + var currentId = $.common.isEmpty(formId) ? $('form').attr('id') : formId;
  1119 + return $("#" + currentId).validate().form();
  1120 + },
  1121 + // 重置表单验证(清除提示信息)
  1122 + reset: function (formId) {
  1123 + var currentId = $.common.isEmpty(formId) ? $('form').attr('id') : formId;
  1124 + return $("#" + currentId).validate().resetForm();
  1125 + }
  1126 + },
734 1127 });
735 1128 })(jQuery);
736 1129  
... ... @@ -745,4 +1138,10 @@ modal_status = {
745 1138 SUCCESS: "success",
746 1139 FAIL: "error",
747 1140 WARNING: "warning"
  1141 +};
  1142 +
  1143 +/** 表格类型 */
  1144 +table_type = {
  1145 + bootstrapTable: 0,
  1146 + bootstrapTreeTable: 1
748 1147 };
749 1148 \ No newline at end of file
... ...
src/main/resources/templates/include.html
... ... @@ -26,7 +26,7 @@
26 26 <script th:src="@{/ajax/libs/bootstrap3-editable/js/bootstrap-editable.js}"></script>
27 27 <script th:src="@{/ajax/libs/bootstrap-table/locale/bootstrap-table-zh-CN.min.js}"></script>
28 28 <script th:src="@{/ajax/libs/bootstrap-table/extensions/editable/bootstrap-table-editable.js}"></script>
29   - <script th:src="@{/ajax/libs/bootstrap-table/extensions/mobile/bootstrap-table-mobile.min.js}"></script>
  29 + <script th:src="@{/ajax/libs/bootstrap-table/extensions/mobile/bootstrap-table-mobile.js}"></script>
30 30 <script th:src="@{/ajax/libs/bootstrap-table/extensions/toolbar/bootstrap-table-toolbar.min.js}"></script>
31 31 <!-- jquery-validate 表单验证插件 -->
32 32 <script th:src="@{/ajax/libs/validate/jquery.validate.min.js}"></script>
... ...