Commit 3cdea063ea9e98735cb793c637ef71f67e0cdf11
Merge branch 'develop' of http://172.16.29.40:8010/wms/wms2 into develop
Showing
34 changed files
with
1802 additions
and
1774 deletions
src/main/java/com/huaheng/pc/shipment/shipmentHeader/controller/ShipmentHeaderController.java
... | ... | @@ -34,6 +34,7 @@ import org.springframework.web.bind.annotation.*; |
34 | 34 | |
35 | 35 | import javax.annotation.Resource; |
36 | 36 | import java.lang.reflect.InvocationTargetException; |
37 | +import java.util.Date; | |
37 | 38 | import java.util.List; |
38 | 39 | |
39 | 40 | |
... | ... | @@ -157,6 +158,7 @@ public class ShipmentHeaderController extends BaseController { |
157 | 158 | temp.setCustomerCode(shipmentHeader.getCustomerCode()); |
158 | 159 | temp.setPriority(shipmentHeader.getPriority()); |
159 | 160 | temp.setLastUpdatedBy(ShiroUtils.getLoginName()); |
161 | + temp.setLastUpdated(new Date()); | |
160 | 162 | return toAjax(shipmentHeaderService.saveOrUpdate(temp)); |
161 | 163 | } |
162 | 164 | |
... | ... |
src/main/java/com/huaheng/pc/shipment/shipmentHeader/service/ShipmentHeaderServiceImpl.java
... | ... | @@ -159,28 +159,36 @@ public class ShipmentHeaderServiceImpl extends ServiceImpl<ShipmentHeaderMapper, |
159 | 159 | @Override |
160 | 160 | @Transactional |
161 | 161 | public AjaxResult addHistory(ShipmentHeader shipmentHeader) throws InvocationTargetException, IllegalAccessException { |
162 | - //历史出库主单 | |
163 | - ShipmentHeaderHistory shipmentHeaderHistory=new ShipmentHeaderHistory(); | |
164 | - BeanUtils.copyProperties(shipmentHeaderHistory,shipmentHeader); | |
165 | - if(shipmentHeaderHistoryService.save(shipmentHeaderHistory)==false){ | |
166 | - throw new ServiceException("存入历史出库主单失败"); | |
167 | - } | |
168 | - LambdaQueryWrapper<ShipmentDetail> lambdaQueryWrapper=Wrappers.lambdaQuery(); | |
169 | - lambdaQueryWrapper.eq(ShipmentDetail::getWarehouseCode,shipmentHeader.getWarehouseCode()) | |
170 | - .eq(ShipmentDetail::getShipmentCode,shipmentHeader.getCode()); | |
171 | - List<ShipmentDetail> shipmentDetails=shipmentDetailService.list(lambdaQueryWrapper); | |
172 | - | |
173 | - //历史出库子单 | |
174 | - List<ShipmentDetailHistory> shipmentDetailHistories=new ArrayList<>(); | |
175 | - for(ShipmentDetail item:shipmentDetails){ | |
176 | - ShipmentDetailHistory shipmentDetailHistory=new ShipmentDetailHistory(); | |
177 | - BeanUtils.copyProperties(shipmentDetailHistory,item); | |
178 | - shipmentDetailHistories.add(shipmentDetailHistory); | |
179 | - } | |
180 | - Boolean flag=shipmentDetailHistoryService.saveBatch(shipmentDetailHistories); | |
181 | - if(flag==false){ | |
182 | - throw new ServiceException("存入历史出库子单失败"); | |
162 | + //单据主单重复 | |
163 | + LambdaQueryWrapper<ShipmentHeaderHistory> headerHistoryLamb = Wrappers.lambdaQuery(); | |
164 | + headerHistoryLamb.eq(ShipmentHeaderHistory::getCode,shipmentHeader.getCode()) | |
165 | + .eq(ShipmentHeaderHistory::getWarehouseCode,shipmentHeader.getWarehouseCode()); | |
166 | + | |
167 | + ShipmentHeaderHistory headerHistory =shipmentHeaderHistoryService.getOne(headerHistoryLamb); | |
168 | + if(headerHistory == null) { | |
169 | + //历史出库主单 | |
170 | + ShipmentHeaderHistory shipmentHeaderHistory = new ShipmentHeaderHistory(); | |
171 | + BeanUtils.copyProperties(shipmentHeaderHistory, shipmentHeader); | |
172 | + if (shipmentHeaderHistoryService.save(shipmentHeaderHistory) == false) { | |
173 | + throw new ServiceException("存入历史出库主单失败"); | |
174 | + } | |
183 | 175 | } |
176 | + LambdaQueryWrapper<ShipmentDetail> lambdaQueryWrapper = Wrappers.lambdaQuery(); | |
177 | + lambdaQueryWrapper.eq(ShipmentDetail::getWarehouseCode, shipmentHeader.getWarehouseCode()) | |
178 | + .eq(ShipmentDetail::getShipmentCode, shipmentHeader.getCode()); | |
179 | + List<ShipmentDetail> shipmentDetails = shipmentDetailService.list(lambdaQueryWrapper); | |
180 | + | |
181 | + //历史出库子单 | |
182 | + List<ShipmentDetailHistory> shipmentDetailHistories = new ArrayList<>(); | |
183 | + for (ShipmentDetail item : shipmentDetails) { | |
184 | + ShipmentDetailHistory shipmentDetailHistory = new ShipmentDetailHistory(); | |
185 | + BeanUtils.copyProperties(shipmentDetailHistory, item); | |
186 | + shipmentDetailHistories.add(shipmentDetailHistory); | |
187 | + } | |
188 | + Boolean flag = shipmentDetailHistoryService.saveBatch(shipmentDetailHistories); | |
189 | + if (flag == false) { | |
190 | + throw new ServiceException("存入历史出库子单失败"); | |
191 | + } | |
184 | 192 | return null; |
185 | 193 | } |
186 | 194 | |
... | ... |
src/main/java/com/huaheng/pc/system/systable/controller/SysTableInfoController.java
... | ... | @@ -134,4 +134,10 @@ public class SysTableInfoController extends BaseController { |
134 | 134 | } |
135 | 135 | return toAjax(sysTableInfoService.removeByIds(Arrays.asList(Convert.toIntArray(ids)))); |
136 | 136 | } |
137 | + | |
138 | + @GetMapping("/init") | |
139 | + @ResponseBody | |
140 | + public AjaxResult init() { | |
141 | + return toAjax(sysTableInfoService.init()); | |
142 | + } | |
137 | 143 | } |
138 | 144 | \ No newline at end of file |
... | ... |
src/main/java/com/huaheng/pc/system/systable/domain/SysTableFieldInfo.java
src/main/java/com/huaheng/pc/system/systable/mapper/SysTableFieldInfoMapper.java
... | ... | @@ -2,10 +2,22 @@ package com.huaheng.pc.system.systable.mapper; |
2 | 2 | |
3 | 3 | import com.baomidou.mybatisplus.core.mapper.BaseMapper; |
4 | 4 | import com.huaheng.pc.system.systable.domain.SysTableFieldInfo; |
5 | +import org.apache.ibatis.annotations.Param; | |
6 | + | |
7 | +import java.util.List; | |
8 | +import java.util.Map; | |
5 | 9 | |
6 | 10 | /** |
7 | 11 | * Created by Enzo Cotter on 2020/3/21. |
8 | 12 | */ |
9 | 13 | |
10 | 14 | public interface SysTableFieldInfoMapper extends BaseMapper<SysTableFieldInfo> { |
15 | + | |
16 | + /** | |
17 | + * 查询表中所有字段信息 | |
18 | + * @param tableName 表名 | |
19 | + * @param schema 数据库名 | |
20 | + * @return | |
21 | + */ | |
22 | + List<Map<String, Object>> getColumnName(@Param("tableName") String tableName, @Param("schema")String schema); | |
11 | 23 | } |
12 | 24 | \ No newline at end of file |
... | ... |
src/main/java/com/huaheng/pc/system/systable/mapper/SysTableInfoMapper.java
... | ... | @@ -2,10 +2,21 @@ package com.huaheng.pc.system.systable.mapper; |
2 | 2 | |
3 | 3 | import com.baomidou.mybatisplus.core.mapper.BaseMapper; |
4 | 4 | import com.huaheng.pc.system.systable.domain.SysTableInfo; |
5 | +import org.apache.ibatis.annotations.Param; | |
6 | + | |
7 | +import java.util.List; | |
8 | +import java.util.Map; | |
5 | 9 | |
6 | 10 | /** |
7 | 11 | * Created by Enzo Cotter on 2020/3/20. |
8 | 12 | */ |
9 | 13 | |
10 | 14 | public interface SysTableInfoMapper extends BaseMapper<SysTableInfo> { |
15 | + | |
16 | + /** | |
17 | + * 查询数据库中所有表格和表注释 | |
18 | + * @param dbSchema | |
19 | + * @return | |
20 | + */ | |
21 | + List<Map<String, Object>> showTable(@Param("dbSchema") String dbSchema); | |
11 | 22 | } |
12 | 23 | \ No newline at end of file |
... | ... |
src/main/java/com/huaheng/pc/system/systable/service/SysTableFieldInfoService.java
... | ... | @@ -2,11 +2,39 @@ package com.huaheng.pc.system.systable.service; |
2 | 2 | |
3 | 3 | import com.huaheng.pc.system.systable.domain.SysTableFieldInfo; |
4 | 4 | import com.baomidou.mybatisplus.extension.service.IService; |
5 | - /** | |
5 | +import org.apache.ibatis.annotations.Param; | |
6 | + | |
7 | +import java.util.List; | |
8 | +import java.util.Map; | |
9 | + | |
10 | +/** | |
6 | 11 | * Created by Enzo Cotter on 2020/3/21. |
7 | 12 | */ |
8 | 13 | |
9 | 14 | public interface SysTableFieldInfoService extends IService<SysTableFieldInfo>{ |
10 | 15 | |
16 | + /** | |
17 | + * 查询表中所有字段信息 | |
18 | + * @param tableName 表名 | |
19 | + * @param schema 数据库名 | |
20 | + * @return | |
21 | + */ | |
22 | + List<Map<String, Object>> getColumnName(String tableName, String schema); | |
23 | + | |
24 | + /** | |
25 | + * 添加字段信息 | |
26 | + * @param headId | |
27 | + * @param tableName | |
28 | + * @param schema | |
29 | + * @return | |
30 | + */ | |
31 | + | |
32 | + boolean addColumn(Long headId, String tableName, String schema); | |
11 | 33 | |
34 | + /** | |
35 | + * 根据表名查询字段信息 | |
36 | + * @param tableCode | |
37 | + * @return | |
38 | + */ | |
39 | + SysTableFieldInfo findTableFieldByTableCodeAndFieldCode(String tableCode, String fieldCode); | |
12 | 40 | } |
... | ... |
src/main/java/com/huaheng/pc/system/systable/service/SysTableInfoService.java
... | ... | @@ -8,5 +8,16 @@ import com.baomidou.mybatisplus.extension.service.IService; |
8 | 8 | |
9 | 9 | public interface SysTableInfoService extends IService<SysTableInfo>{ |
10 | 10 | |
11 | + /** | |
12 | + * 查询数据库中所有表格和表注释 | |
13 | + * @return | |
14 | + */ | |
15 | + Boolean init(); | |
11 | 16 | |
17 | + /** | |
18 | + * 通过表明查询表信息 | |
19 | + * @param code | |
20 | + * @return | |
21 | + */ | |
22 | + SysTableInfo getTableInfoByCode(String code); | |
12 | 23 | } |
... | ... |
src/main/java/com/huaheng/pc/system/systable/service/impl/SysTableFieldInfoServiceImpl.java
1 | 1 | package com.huaheng.pc.system.systable.service.impl; |
2 | 2 | |
3 | +import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; | |
4 | +import com.baomidou.mybatisplus.core.toolkit.Wrappers; | |
5 | +import com.huaheng.common.exception.BusinessException; | |
6 | +import com.huaheng.common.utils.security.ShiroUtils; | |
3 | 7 | import org.springframework.stereotype.Service; |
4 | 8 | import javax.annotation.Resource; |
9 | +import java.util.Date; | |
5 | 10 | import java.util.List; |
11 | +import java.util.Map; | |
12 | + | |
6 | 13 | import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; |
7 | 14 | import com.huaheng.pc.system.systable.mapper.SysTableFieldInfoMapper; |
8 | 15 | import com.huaheng.pc.system.systable.domain.SysTableFieldInfo; |
... | ... | @@ -14,4 +21,72 @@ import com.huaheng.pc.system.systable.service.SysTableFieldInfoService; |
14 | 21 | @Service |
15 | 22 | public class SysTableFieldInfoServiceImpl extends ServiceImpl<SysTableFieldInfoMapper, SysTableFieldInfo> implements SysTableFieldInfoService{ |
16 | 23 | |
24 | + @Resource | |
25 | + private SysTableFieldInfoMapper tableFieldInfoMapper; | |
26 | + | |
27 | + /** | |
28 | + * 查询表中所有字段信息 | |
29 | + * @param tableName 表名 | |
30 | + * @param schema 数据库名 | |
31 | + * @return | |
32 | + */ | |
33 | + @Override | |
34 | + public List<Map<String, Object>> getColumnName(String tableName, String schema) { | |
35 | + return tableFieldInfoMapper.getColumnName(tableName, schema); | |
36 | + } | |
37 | + | |
38 | + /** | |
39 | + * 添加字段信息 | |
40 | + * @param tableName | |
41 | + * @param schema | |
42 | + * @return | |
43 | + */ | |
44 | + @Override | |
45 | + public boolean addColumn(Long headId, String tableName, String schema){ | |
46 | + List<Map<String, Object>> columnList = getColumnName(tableName, schema); | |
47 | + for (Map map:columnList) { | |
48 | + SysTableFieldInfo sysTableFieldInfo = findTableFieldByTableCodeAndFieldCode(tableName, String.valueOf(map.get("COLUMN_NAME"))); | |
49 | + if (sysTableFieldInfo == null) { | |
50 | + SysTableFieldInfo tableFieldInfo = new SysTableFieldInfo(); | |
51 | + tableFieldInfo.setHeadId(headId); | |
52 | + tableFieldInfo.setTableCode(tableName); | |
53 | + tableFieldInfo.setFieldCode(String.valueOf(map.get("COLUMN_NAME"))); | |
54 | + tableFieldInfo.setFiledName(String.valueOf(map.get("COLUMN_COMMENT"))); | |
55 | + tableFieldInfo.setFiledFuncation(String.valueOf(map.get("COLUMN_COMMENT"))); | |
56 | + tableFieldInfo.setCreated(new Date()); | |
57 | + tableFieldInfo.setCreatedBy(ShiroUtils.getLoginName()); | |
58 | + tableFieldInfo.setLastUpdated(new Date()); | |
59 | + tableFieldInfo.setLastUpdateBy(ShiroUtils.getLoginName()); | |
60 | + if (!save(tableFieldInfo)) { | |
61 | + throw new BusinessException("保存字段失败"); | |
62 | + } | |
63 | + } else { | |
64 | + sysTableFieldInfo.setFieldCode(String.valueOf(map.get("COLUMN_NAME"))); | |
65 | + sysTableFieldInfo.setFiledName(String.valueOf(map.get("COLUMN_COMMENT"))); | |
66 | + sysTableFieldInfo.setFiledFuncation(String.valueOf(map.get("COLUMN_COMMENT"))); | |
67 | + sysTableFieldInfo.setLastUpdated(new Date()); | |
68 | + sysTableFieldInfo.setLastUpdateBy(ShiroUtils.getLoginName()); | |
69 | + if (!updateById(sysTableFieldInfo)) { | |
70 | + throw new BusinessException("保存字段失败"); | |
71 | + } | |
72 | + } | |
73 | + } | |
74 | + return true; | |
75 | + } | |
76 | + | |
77 | + /** | |
78 | + * 根据表名查询字段信息 | |
79 | + * @param tableCode | |
80 | + * @param fieldCode | |
81 | + * @return | |
82 | + */ | |
83 | + @Override | |
84 | + public SysTableFieldInfo findTableFieldByTableCodeAndFieldCode(String tableCode, String fieldCode) { | |
85 | + LambdaQueryWrapper<SysTableFieldInfo> queryWrapper = Wrappers.lambdaQuery(); | |
86 | + queryWrapper.eq(SysTableFieldInfo::getFieldCode, fieldCode) | |
87 | + .eq(SysTableFieldInfo::getTableCode, tableCode); | |
88 | + return getOne(queryWrapper); | |
89 | + } | |
90 | + | |
91 | + | |
17 | 92 | } |
... | ... |
src/main/java/com/huaheng/pc/system/systable/service/impl/SysTableInfoServiceImpl.java
1 | 1 | package com.huaheng.pc.system.systable.service.impl; |
2 | 2 | |
3 | +import com.baomidou.mybatisplus.annotation.TableField; | |
4 | +import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; | |
5 | +import com.baomidou.mybatisplus.core.toolkit.Wrappers; | |
6 | +import com.huaheng.common.exception.BusinessException; | |
7 | +import com.huaheng.common.exception.service.ServiceException; | |
8 | +import com.huaheng.common.utils.StringUtils; | |
9 | +import com.huaheng.common.utils.security.ShiroUtils; | |
10 | +import com.huaheng.framework.datasource.DynamicDataSourceContextHolder; | |
11 | +import com.huaheng.pc.system.systable.mapper.SysTableFieldInfoMapper; | |
12 | +import com.huaheng.pc.system.systable.service.SysTableFieldInfoService; | |
13 | +import org.springframework.beans.factory.annotation.Value; | |
3 | 14 | import org.springframework.stereotype.Service; |
4 | 15 | import javax.annotation.Resource; |
16 | +import java.util.ArrayList; | |
17 | +import java.util.Date; | |
5 | 18 | import java.util.List; |
19 | +import java.util.Map; | |
20 | + | |
6 | 21 | import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; |
7 | 22 | import com.huaheng.pc.system.systable.domain.SysTableInfo; |
8 | 23 | import com.huaheng.pc.system.systable.mapper.SysTableInfoMapper; |
9 | 24 | import com.huaheng.pc.system.systable.service.SysTableInfoService; |
25 | +import org.springframework.transaction.annotation.Transactional; | |
26 | + | |
10 | 27 | /** |
11 | 28 | * Created by Enzo Cotter on 2020/3/20. |
12 | 29 | */ |
... | ... | @@ -14,4 +31,63 @@ import com.huaheng.pc.system.systable.service.SysTableInfoService; |
14 | 31 | @Service |
15 | 32 | public class SysTableInfoServiceImpl extends ServiceImpl<SysTableInfoMapper, SysTableInfo> implements SysTableInfoService{ |
16 | 33 | |
34 | + @Value("${spring.datasource.druid.master.url}") | |
35 | + private String dbSchema; | |
36 | + @Resource | |
37 | + private SysTableInfoMapper tableInfoMapper; | |
38 | + @Resource | |
39 | + private SysTableFieldInfoService tableFieldInfoService; | |
40 | + /** | |
41 | + * 查询数据库中所有表格和表注释 | |
42 | + * @return | |
43 | + */ | |
44 | + @Override | |
45 | + @Transactional(rollbackFor = Exception.class) | |
46 | + public Boolean init() { | |
47 | + String schema = dbSchema.substring(0,dbSchema.indexOf("?")).substring(dbSchema.indexOf("3306/")+5); | |
48 | + if (StringUtils.isEmpty(schema)) { | |
49 | + throw new BusinessException("数据库名为空"); | |
50 | + } | |
51 | + List<Map<String, Object>> tableList = tableInfoMapper.showTable(schema); | |
52 | + for (Map<String, Object> map : tableList) { | |
53 | + SysTableInfo sysTableInfo = getTableInfoByCode(String.valueOf(map.get("table_name"))); | |
54 | + if (sysTableInfo == null) { | |
55 | + SysTableInfo tableInfo = new SysTableInfo(); | |
56 | + tableInfo.setTableCode(String.valueOf(map.get("table_name"))); | |
57 | + tableInfo.setTableName(String.valueOf(map.get("TABLE_COMMENT"))); | |
58 | + tableInfo.setTableFuncation(String.valueOf(map.get("TABLE_COMMENT"))); | |
59 | + tableInfo.setLastUpdated(new Date()); | |
60 | + tableInfo.setLastUpdateBy(ShiroUtils.getLoginName()); | |
61 | + tableInfo.setWarehouseCode(ShiroUtils.getWarehouseCode()); | |
62 | + tableInfo.setCreated(new Date()); | |
63 | + tableInfo.setCreatedBy(ShiroUtils.getLoginName()); | |
64 | + if (!save(tableInfo)) { | |
65 | + throw new BusinessException("保存失败"); | |
66 | + } | |
67 | + } else { | |
68 | + sysTableInfo.setCreated(new Date()); | |
69 | + sysTableInfo.setCreatedBy(ShiroUtils.getLoginName()); | |
70 | + sysTableInfo.setTableName(String.valueOf(map.get("TABLE_COMMENT"))); | |
71 | + sysTableInfo.setTableFuncation(String.valueOf(map.get("TABLE_COMMENT"))); | |
72 | + if (!updateById(sysTableInfo)) { | |
73 | + throw new BusinessException("保存失败"); | |
74 | + } | |
75 | + } | |
76 | + sysTableInfo = getTableInfoByCode(String.valueOf(map.get("table_name"))); | |
77 | + tableFieldInfoService.addColumn(sysTableInfo.getId(), sysTableInfo.getTableCode(), schema); | |
78 | + } | |
79 | + return true; | |
80 | + } | |
81 | + | |
82 | + /** | |
83 | + * 通过表明查询表信息 | |
84 | + * @param code | |
85 | + * @return | |
86 | + */ | |
87 | + @Override | |
88 | + public SysTableInfo getTableInfoByCode(String code) { | |
89 | + LambdaQueryWrapper<SysTableInfo> queryWrapper = Wrappers.lambdaQuery(); | |
90 | + queryWrapper.eq(SysTableInfo::getTableCode, code); | |
91 | + return getOne(queryWrapper); | |
92 | + } | |
17 | 93 | } |
... | ... |
src/main/resources/mybatis/system/SysTableFieldInfoMapper.xml
... | ... | @@ -19,4 +19,11 @@ |
19 | 19 | id, head_id, field_code, filed_name, filed_funcation, created, create_by, last_updated, |
20 | 20 | last_update_by |
21 | 21 | </sql> |
22 | + | |
23 | + <select id="getColumnName" resultType="java.util.Map"> | |
24 | + select COLUMN_NAME, DATA_TYPE, COLUMN_COMMENT | |
25 | + from INFORMATION_SCHEMA.COLUMNS | |
26 | + where table_name = #{tableName} | |
27 | + AND table_schema = #{schema} | |
28 | + </select> | |
22 | 29 | </mapper> |
23 | 30 | \ No newline at end of file |
... | ... |
src/main/resources/mybatis/system/SysTableInfoMapper.xml
... | ... | @@ -19,4 +19,8 @@ |
19 | 19 | id, warehouse_code, table_code, `table_name`, table_funcation, created, created_by, |
20 | 20 | last_updated, last_update_by |
21 | 21 | </sql> |
22 | + | |
23 | + <select id="showTable" resultType="java.util.Map"> | |
24 | + select table_name ,TABLE_COMMENT from INFORMATION_SCHEMA.TABLES where table_schema = #{dbSchema} | |
25 | + </select> | |
22 | 26 | </mapper> |
23 | 27 | \ No newline at end of file |
... | ... |
src/main/resources/static/ajax/libs/bootstrap-table/bootstrap-table.min.css
1 | -.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} | |
2 | 1 | \ No newline at end of file |
2 | +.fixed-table-container .bs-checkbox, .fixed-table-container .no-records-found { | |
3 | + text-align: center; | |
4 | +} | |
5 | + | |
6 | +.fixed-table-body thead th .th-inner, .table td, .table th { | |
7 | + box-sizing: border-box | |
8 | +} | |
9 | + | |
10 | +.bootstrap-table .table { | |
11 | + margin-bottom: 0 !important; | |
12 | + border-bottom: 1px solid #ddd; | |
13 | + border-collapse: collapse !important; | |
14 | + border-radius: 1px | |
15 | +} | |
16 | + | |
17 | +.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 { | |
18 | + padding: 8px | |
19 | +} | |
20 | + | |
21 | +.bootstrap-table .table.table-no-bordered > tbody > tr > td, .bootstrap-table .table.table-no-bordered > thead > tr > th { | |
22 | + border-right: 2px solid transparent | |
23 | +} | |
24 | + | |
25 | +.bootstrap-table .table.table-no-bordered > tbody > tr > td:last-child { | |
26 | + border-right: none | |
27 | +} | |
28 | + | |
29 | +.fixed-table-container { | |
30 | + position: relative; | |
31 | + clear: both; | |
32 | + border: 1px solid #ddd; | |
33 | + border-radius: 4px; | |
34 | + white-space: nowrap; | |
35 | + -webkit-border-radius: 4px; | |
36 | + -moz-border-radius: 4px | |
37 | +} | |
38 | + | |
39 | +.fixed-table-container.table-no-bordered { | |
40 | + border: 1px solid transparent | |
41 | +} | |
42 | + | |
43 | +.fixed-table-footer, .fixed-table-header { | |
44 | + overflow: hidden | |
45 | +} | |
46 | + | |
47 | +.fixed-table-footer { | |
48 | + border-top: 1px solid #ddd | |
49 | +} | |
50 | + | |
51 | +.fixed-table-body { | |
52 | + overflow-x: auto; | |
53 | + overflow-y: auto; | |
54 | + height: 100% | |
55 | +} | |
56 | + | |
57 | +.fixed-table-container table { | |
58 | + width: 100% | |
59 | +} | |
60 | + | |
61 | +.fixed-table-container thead th { | |
62 | + height: 0; | |
63 | + padding: 0; | |
64 | + margin: 0; | |
65 | + border-left: 1px solid #ddd | |
66 | +} | |
67 | + | |
68 | +.fixed-table-container thead th:focus { | |
69 | + outline: transparent solid 0 | |
70 | +} | |
71 | + | |
72 | +.fixed-table-container thead th:first-child { | |
73 | + border-left: none; | |
74 | + border-top-left-radius: 4px; | |
75 | + -webkit-border-top-left-radius: 4px; | |
76 | + -moz-border-radius-topleft: 4px | |
77 | +} | |
78 | + | |
79 | +.fixed-table-container tbody td .th-inner, .fixed-table-container thead th .th-inner { | |
80 | + padding: 8px; | |
81 | + line-height: 24px; | |
82 | + vertical-align: top; | |
83 | + overflow: hidden; | |
84 | + text-overflow: ellipsis; | |
85 | + white-space: nowrap | |
86 | +} | |
87 | + | |
88 | +.fixed-table-container thead th .sortable { | |
89 | + cursor: pointer; | |
90 | + background-position: right; | |
91 | + background-repeat: no-repeat; | |
92 | + padding-right: 30px | |
93 | +} | |
94 | + | |
95 | +.fixed-table-container thead th .both { | |
96 | + background-image: url('data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABMAAAATCAQAAADYWf5HAAAAkElEQVQoz7X QMQ5AQBCF4dWQSJxC5wwax1Cq1e7BAdxD5SL+Tq/QCM1oNiJidwox0355mXnG/DrEtIQ6azioNZQxI0ykPhTQIwhCR+BmBYtlK7kLJYwWCcJA9M4qdrZrd8pPjZWPtOqdRQy320YSV17OatFC4euts6z39GYMKRPCTKY9UnPQ6P+GtMRfGtPnBCiqhAeJPmkqAAAAAElFTkSuQmCC') | |
97 | +} | |
98 | + | |
99 | +.fixed-table-container thead th .asc { | |
100 | + background-image: url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABMAAAATCAYAAAByUDbMAAAAZ0lEQVQ4y2NgGLKgquEuFxBPAGI2ahhWCsS/gDibUoO0gPgxEP8H4ttArEyuQYxAPBdqEAxPBImTY5gjEL9DM+wTENuQahAvEO9DMwiGdwAxOymGJQLxTyD+jgWDxCMZRsEoGAVoAADeemwtPcZI2wAAAABJRU5ErkJggg==) | |
101 | +} | |
102 | + | |
103 | +.fixed-table-container thead th .desc { | |
104 | + background-image: url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABMAAAATCAYAAAByUDbMAAAAZUlEQVQ4y2NgGAWjYBSggaqGu5FA/BOIv2PBIPFEUgxjB+IdQPwfC94HxLykus4GiD+hGfQOiB3J8SojEE9EM2wuSJzcsFMG4ttQgx4DsRalkZENxL+AuJQaMcsGxBOAmGvopk8AVz1sLZgg0bsAAAAASUVORK5CYII=) | |
105 | +} | |
106 | + | |
107 | +.fixed-table-container th.detail { | |
108 | + width: 30px | |
109 | +} | |
110 | + | |
111 | +.fixed-table-container tbody td { | |
112 | + border-left: 1px solid #ddd | |
113 | +} | |
114 | + | |
115 | +.fixed-table-container tbody tr:first-child td { | |
116 | + border-top: none | |
117 | +} | |
118 | + | |
119 | +.fixed-table-container tbody td:first-child { | |
120 | + border-left: none | |
121 | +} | |
122 | + | |
123 | +.fixed-table-container tbody .selected td { | |
124 | + background-color: #f5f5f5 | |
125 | +} | |
126 | + | |
127 | +.fixed-table-container .bs-checkbox .th-inner { | |
128 | + padding: 8px 0 | |
129 | +} | |
130 | + | |
131 | +.fixed-table-container input[type=radio], .fixed-table-container input[type=checkbox] { | |
132 | + margin: 0 auto !important | |
133 | +} | |
134 | + | |
135 | +.fixed-table-pagination .pagination-detail, .fixed-table-pagination div.pagination { | |
136 | + margin-top: 10px; | |
137 | + margin-bottom: 10px | |
138 | +} | |
139 | + | |
140 | +.fixed-table-pagination div.pagination .pagination { | |
141 | + margin: 0 | |
142 | +} | |
143 | + | |
144 | +.fixed-table-pagination .pagination a { | |
145 | + padding: 6px 12px; | |
146 | + line-height: 1.428571429 | |
147 | +} | |
148 | + | |
149 | +.fixed-table-pagination .pagination-info { | |
150 | + line-height: 34px; | |
151 | + margin-right: 5px | |
152 | +} | |
153 | + | |
154 | +.fixed-table-pagination .btn-group { | |
155 | + position: relative; | |
156 | + display: inline-block; | |
157 | + vertical-align: middle | |
158 | +} | |
159 | + | |
160 | +.fixed-table-pagination .dropup .dropdown-menu { | |
161 | + margin-bottom: 0 | |
162 | +} | |
163 | + | |
164 | +.fixed-table-pagination .page-list { | |
165 | + display: inline-block | |
166 | +} | |
167 | + | |
168 | +.fixed-table-toolbar .columns-left { | |
169 | + margin-right: 5px | |
170 | +} | |
171 | + | |
172 | +.fixed-table-toolbar .columns-right { | |
173 | + margin-left: 5px | |
174 | +} | |
175 | + | |
176 | +.fixed-table-toolbar .columns label { | |
177 | + display: block; | |
178 | + padding: 3px 20px; | |
179 | + clear: both; | |
180 | + font-weight: 400; | |
181 | + line-height: 1.428571429 | |
182 | +} | |
183 | + | |
184 | +.fixed-table-toolbar .bs-bars, .fixed-table-toolbar .columns, .fixed-table-toolbar .search { | |
185 | + position: relative; | |
186 | + margin-top: 10px; | |
187 | + margin-bottom: 10px; | |
188 | + line-height: 34px | |
189 | +} | |
190 | + | |
191 | +.fixed-table-pagination li.disabled a { | |
192 | + pointer-events: none; | |
193 | + cursor: default | |
194 | +} | |
195 | + | |
196 | +.fixed-table-loading { | |
197 | + display: none; | |
198 | + position: absolute; | |
199 | + top: 42px; | |
200 | + right: 0; | |
201 | + bottom: 0; | |
202 | + left: 0; | |
203 | + z-index: 99; | |
204 | + background-color: #fff; | |
205 | + text-align: center | |
206 | +} | |
207 | + | |
208 | +.fixed-table-body .card-view .title { | |
209 | + font-weight: 700; | |
210 | + display: inline-block; | |
211 | + min-width: 30%; | |
212 | + text-align: left !important | |
213 | +} | |
214 | + | |
215 | +.table td, .table th { | |
216 | + vertical-align: middle | |
217 | +} | |
218 | + | |
219 | +.fixed-table-toolbar .dropdown-menu { | |
220 | + text-align: left; | |
221 | + max-height: 300px; | |
222 | + overflow: auto | |
223 | +} | |
224 | + | |
225 | +.fixed-table-toolbar .btn-group > .btn-group { | |
226 | + display: inline-block; | |
227 | + margin-left: -1px !important | |
228 | +} | |
229 | + | |
230 | +.fixed-table-toolbar .btn-group > .btn-group > .btn { | |
231 | + border-radius: 0 | |
232 | +} | |
233 | + | |
234 | +.fixed-table-toolbar .btn-group > .btn-group:first-child > .btn { | |
235 | + border-top-left-radius: 4px; | |
236 | + border-bottom-left-radius: 4px | |
237 | +} | |
238 | + | |
239 | +.fixed-table-toolbar .btn-group > .btn-group:last-child > .btn { | |
240 | + border-top-right-radius: 4px; | |
241 | + border-bottom-right-radius: 4px | |
242 | +} | |
243 | + | |
244 | +.bootstrap-table .table > thead > tr > th { | |
245 | + vertical-align: bottom; | |
246 | + border-bottom: 1px solid #ddd | |
247 | +} | |
248 | + | |
249 | +.bootstrap-table .table thead > tr > th { | |
250 | + padding: 0; | |
251 | + margin: 0 | |
252 | +} | |
253 | + | |
254 | +.bootstrap-table .fixed-table-footer tbody > tr > td { | |
255 | + padding: 0 !important | |
256 | +} | |
257 | + | |
258 | +.bootstrap-table .fixed-table-footer .table { | |
259 | + border-bottom: none; | |
260 | + border-radius: 0; | |
261 | + padding: 0 !important | |
262 | +} | |
263 | + | |
264 | +.pull-right .dropdown-menu { | |
265 | + right: 0; | |
266 | + left: auto | |
267 | +} | |
268 | + | |
269 | +p.fixed-table-scroll-inner { | |
270 | + width: 100%; | |
271 | + height: 200px | |
272 | +} | |
273 | + | |
274 | +div.fixed-table-scroll-outer { | |
275 | + top: 0; | |
276 | + left: 0; | |
277 | + visibility: hidden; | |
278 | + width: 200px; | |
279 | + height: 150px; | |
280 | + overflow: hidden | |
281 | +} | |
3 | 282 | \ No newline at end of file |
... | ... |
src/main/resources/static/ajax/libs/bootstrap-table/bootstrap-table.min.js
1 | -/** | |
2 | - * @author zhixin wen <wenzhixin2010@gmail.com> | |
3 | - * version: 1.11.0 | |
4 | - * https://github.com/wenzhixin/bootstrap-table/ | |
5 | - */ | |
6 | -(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,"&").replace(/</g,"<").replace(/>/g,">").replace(/"/g,""").replace(/'/g,"'").replace(/`/g,"`")}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:"‹",paginationNextText:"›",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"> </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]," ")||" ");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) | |
7 | -};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}; | |
8 | 1 | \ No newline at end of file |
2 | +/* | |
3 | +* bootstrap-table - v1.11.0 - 2016-07-02 | |
4 | +* https://github.com/wenzhixin/bootstrap-table | |
5 | +* Copyright (c) 2016 zhixin wen | |
6 | +* Licensed MIT License | |
7 | +*/ | |
8 | +!function (a) { | |
9 | + "use strict"; | |
10 | + var b = null, c = function (a) { | |
11 | + var b = arguments, c = !0, d = 1; | |
12 | + return a = a.replace(/%s/g, function () { | |
13 | + var a = b[d++]; | |
14 | + return "undefined" == typeof a ? (c = !1, "") : a | |
15 | + }), c ? a : "" | |
16 | + }, d = function (b, c, d, e) { | |
17 | + var f = ""; | |
18 | + return a.each(b, function (a, b) { | |
19 | + return b[c] === e ? (f = b[d], !1) : !0 | |
20 | + }), f | |
21 | + }, e = function (b, c) { | |
22 | + var d = -1; | |
23 | + return a.each(b, function (a, b) { | |
24 | + return b.field === c ? (d = a, !1) : !0 | |
25 | + }), d | |
26 | + }, f = function (b) { | |
27 | + var c, d, e, f = 0, g = []; | |
28 | + for (c = 0; c < b[0].length; c++) f += b[0][c].colspan || 1; | |
29 | + for (c = 0; c < b.length; c++) for (g[c] = [], d = 0; f > d; d++) g[c][d] = !1; | |
30 | + for (c = 0; c < b.length; c++) for (d = 0; d < b[c].length; d++) { | |
31 | + var h = b[c][d], i = h.rowspan || 1, j = h.colspan || 1, k = a.inArray(!1, g[c]); | |
32 | + for (1 === j && (h.fieldIndex = k, "undefined" == typeof h.field && (h.field = k)), e = 0; i > e; e++) g[c + e][k] = !0; | |
33 | + for (e = 0; j > e; e++) g[c][k + e] = !0 | |
34 | + } | |
35 | + }, g = function () { | |
36 | + if (null === b) { | |
37 | + var c, d, e = a("<p/>").addClass("fixed-table-scroll-inner"), | |
38 | + f = a("<div/>").addClass("fixed-table-scroll-outer"); | |
39 | + 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 | |
40 | + } | |
41 | + return b | |
42 | + }, h = function (b, d, e, f) { | |
43 | + var g = d; | |
44 | + if ("string" == typeof d) { | |
45 | + var h = d.split("."); | |
46 | + h.length > 1 ? (g = window, a.each(h, function (a, b) { | |
47 | + g = g[b] | |
48 | + })) : g = window[d] | |
49 | + } | |
50 | + 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 | |
51 | + }, i = function (b, c, d) { | |
52 | + var e = Object.getOwnPropertyNames(b), f = Object.getOwnPropertyNames(c), g = ""; | |
53 | + if (d && e.length !== f.length) return !1; | |
54 | + for (var h = 0; h < e.length; h++) if (g = e[h], a.inArray(g, f) > -1 && b[g] !== c[g]) return !1; | |
55 | + return !0 | |
56 | + }, j = function (a) { | |
57 | + return "string" == typeof a ? a.replace(/&/g, "&").replace(/</g, "<").replace(/>/g, ">").replace(/"/g, """).replace(/'/g, "'").replace(/`/g, "`") : a | |
58 | + }, k = function (b) { | |
59 | + var c = 0; | |
60 | + return b.children().each(function () { | |
61 | + c < a(this).outerHeight(!0) && (c = a(this).outerHeight(!0)) | |
62 | + }), c | |
63 | + }, l = function (a) { | |
64 | + for (var b in a) { | |
65 | + var c = b.split(/(?=[A-Z])/).join("-").toLowerCase(); | |
66 | + c !== b && (a[c] = a[b], delete a[b]) | |
67 | + } | |
68 | + return a | |
69 | + }, m = function (a, b, c) { | |
70 | + var d = a; | |
71 | + if ("string" != typeof b || a.hasOwnProperty(b)) return c ? j(a[b]) : a[b]; | |
72 | + var e = b.split("."); | |
73 | + for (var f in e) d = d && d[e[f]]; | |
74 | + return c ? j(d) : d | |
75 | + }, n = function () { | |
76 | + return !!(navigator.userAgent.indexOf("MSIE ") > 0 || navigator.userAgent.match(/Trident.*rv\:11\./)) | |
77 | + }, o = function () { | |
78 | + Object.keys || (Object.keys = function () { | |
79 | + var a = Object.prototype.hasOwnProperty, b = !{toString: null}.propertyIsEnumerable("toString"), | |
80 | + c = ["toString", "toLocaleString", "valueOf", "hasOwnProperty", "isPrototypeOf", "propertyIsEnumerable", "constructor"], | |
81 | + d = c.length; | |
82 | + return function (e) { | |
83 | + if ("object" != typeof e && ("function" != typeof e || null === e)) throw new TypeError("Object.keys called on non-object"); | |
84 | + var f, g, h = []; | |
85 | + for (f in e) a.call(e, f) && h.push(f); | |
86 | + if (b) for (g = 0; d > g; g++) a.call(e, c[g]) && h.push(c[g]); | |
87 | + return h | |
88 | + } | |
89 | + }()) | |
90 | + }, p = function (b, c) { | |
91 | + this.options = c, this.$el = a(b), this.$el_ = this.$el.clone(), this.timeoutId_ = 0, this.timeoutFooter_ = 0, this.init() | |
92 | + }; | |
93 | + p.DEFAULTS = { | |
94 | + classes: "table table-hover", | |
95 | + locale: void 0, | |
96 | + height: void 0, | |
97 | + undefinedText: "-", | |
98 | + sortName: void 0, | |
99 | + sortOrder: "asc", | |
100 | + sortStable: !1, | |
101 | + striped: !1, | |
102 | + columns: [[]], | |
103 | + data: [], | |
104 | + dataField: "rows", | |
105 | + method: "get", | |
106 | + url: void 0, | |
107 | + ajax: void 0, | |
108 | + cache: !0, | |
109 | + contentType: "application/json", | |
110 | + dataType: "json", | |
111 | + ajaxOptions: {}, | |
112 | + queryParams: function (a) { | |
113 | + return a | |
114 | + }, | |
115 | + queryParamsType: "limit", | |
116 | + responseHandler: function (a) { | |
117 | + return a | |
118 | + }, | |
119 | + pagination: !1, | |
120 | + onlyInfoPagination: !1, | |
121 | + sidePagination: "client", | |
122 | + totalRows: 0, | |
123 | + pageNumber: 1, | |
124 | + pageSize: 10, | |
125 | + pageList: [10, 25, 50, 100], | |
126 | + paginationHAlign: "right", | |
127 | + paginationVAlign: "bottom", | |
128 | + paginationDetailHAlign: "left", | |
129 | + paginationPreText: "‹", | |
130 | + paginationNextText: "›", | |
131 | + search: !1, | |
132 | + searchOnEnterKey: !1, | |
133 | + strictSearch: !1, | |
134 | + searchAlign: "right", | |
135 | + selectItemName: "btSelectItem", | |
136 | + showHeader: !0, | |
137 | + showFooter: !1, | |
138 | + showColumns: !1, | |
139 | + showPaginationSwitch: !1, | |
140 | + showRefresh: !1, | |
141 | + showToggle: !1, | |
142 | + buttonsAlign: "right", | |
143 | + smartDisplay: !0, | |
144 | + escape: !1, | |
145 | + minimumCountColumns: 1, | |
146 | + idField: void 0, | |
147 | + uniqueId: void 0, | |
148 | + cardView: !1, | |
149 | + detailView: !1, | |
150 | + detailFormatter: function () { | |
151 | + return "" | |
152 | + }, | |
153 | + trimOnSearch: !0, | |
154 | + clickToSelect: !1, | |
155 | + singleSelect: !1, | |
156 | + toolbar: void 0, | |
157 | + toolbarAlign: "left", | |
158 | + checkboxHeader: !0, | |
159 | + sortable: !0, | |
160 | + silentSort: !0, | |
161 | + maintainSelected: !1, | |
162 | + searchTimeOut: 500, | |
163 | + searchText: "", | |
164 | + iconSize: void 0, | |
165 | + buttonsClass: "default", | |
166 | + iconsPrefix: "glyphicon", | |
167 | + icons: { | |
168 | + paginationSwitchDown: "glyphicon-collapse-down icon-chevron-down", | |
169 | + paginationSwitchUp: "glyphicon-collapse-up icon-chevron-up", | |
170 | + refresh: "glyphicon-refresh icon-refresh", | |
171 | + toggle: "glyphicon-list-alt icon-list-alt", | |
172 | + columns: "glyphicon-th icon-th", | |
173 | + detailOpen: "glyphicon-plus icon-plus", | |
174 | + detailClose: "glyphicon-minus icon-minus" | |
175 | + }, | |
176 | + customSearch: a.noop, | |
177 | + customSort: a.noop, | |
178 | + rowStyle: function () { | |
179 | + return {} | |
180 | + }, | |
181 | + rowAttributes: function () { | |
182 | + return {} | |
183 | + }, | |
184 | + footerStyle: function () { | |
185 | + return {} | |
186 | + }, | |
187 | + onAll: function () { | |
188 | + return !1 | |
189 | + }, | |
190 | + onClickCell: function () { | |
191 | + return !1 | |
192 | + }, | |
193 | + onDblClickCell: function () { | |
194 | + return !1 | |
195 | + }, | |
196 | + onClickRow: function () { | |
197 | + return !1 | |
198 | + }, | |
199 | + onDblClickRow: function () { | |
200 | + return !1 | |
201 | + }, | |
202 | + onSort: function () { | |
203 | + return !1 | |
204 | + }, | |
205 | + onCheck: function () { | |
206 | + return !1 | |
207 | + }, | |
208 | + onUncheck: function () { | |
209 | + return !1 | |
210 | + }, | |
211 | + onCheckAll: function () { | |
212 | + return !1 | |
213 | + }, | |
214 | + onUncheckAll: function () { | |
215 | + return !1 | |
216 | + }, | |
217 | + onCheckSome: function () { | |
218 | + return !1 | |
219 | + }, | |
220 | + onUncheckSome: function () { | |
221 | + return !1 | |
222 | + }, | |
223 | + onLoadSuccess: function () { | |
224 | + return !1 | |
225 | + }, | |
226 | + onLoadError: function () { | |
227 | + return !1 | |
228 | + }, | |
229 | + onColumnSwitch: function () { | |
230 | + return !1 | |
231 | + }, | |
232 | + onPageChange: function () { | |
233 | + return !1 | |
234 | + }, | |
235 | + onSearch: function () { | |
236 | + return !1 | |
237 | + }, | |
238 | + onToggle: function () { | |
239 | + return !1 | |
240 | + }, | |
241 | + onPreBody: function () { | |
242 | + return !1 | |
243 | + }, | |
244 | + onPostBody: function () { | |
245 | + return !1 | |
246 | + }, | |
247 | + onPostHeader: function () { | |
248 | + return !1 | |
249 | + }, | |
250 | + onExpandRow: function () { | |
251 | + return !1 | |
252 | + }, | |
253 | + onCollapseRow: function () { | |
254 | + return !1 | |
255 | + }, | |
256 | + onRefreshOptions: function () { | |
257 | + return !1 | |
258 | + }, | |
259 | + onRefresh: function () { | |
260 | + return !1 | |
261 | + }, | |
262 | + onResetView: function () { | |
263 | + return !1 | |
264 | + } | |
265 | + }, p.LOCALES = {}, p.LOCALES["en-US"] = p.LOCALES.en = { | |
266 | + formatLoadingMessage: function () { | |
267 | + return "Loading, please wait..." | |
268 | + }, formatRecordsPerPage: function (a) { | |
269 | + return c("%s rows per page", a) | |
270 | + }, formatShowingRows: function (a, b, d) { | |
271 | + return c("Showing %s to %s of %s rows", a, b, d) | |
272 | + }, formatDetailPagination: function (a) { | |
273 | + return c("Showing %s rows", a) | |
274 | + }, formatSearch: function () { | |
275 | + return "Search" | |
276 | + }, formatNoMatches: function () { | |
277 | + return "No matching records found" | |
278 | + }, formatPaginationSwitch: function () { | |
279 | + return "Hide/Show pagination" | |
280 | + }, formatRefresh: function () { | |
281 | + return "Refresh" | |
282 | + }, formatToggle: function () { | |
283 | + return "Toggle" | |
284 | + }, formatColumns: function () { | |
285 | + return "Columns" | |
286 | + }, formatAllRows: function () { | |
287 | + return "All" | |
288 | + } | |
289 | + }, a.extend(p.DEFAULTS, p.LOCALES["en-US"]), p.COLUMN_DEFAULTS = { | |
290 | + radio: !1, | |
291 | + checkbox: !1, | |
292 | + checkboxEnabled: !0, | |
293 | + field: void 0, | |
294 | + title: void 0, | |
295 | + titleTooltip: void 0, | |
296 | + "class": void 0, | |
297 | + align: void 0, | |
298 | + halign: void 0, | |
299 | + falign: void 0, | |
300 | + valign: void 0, | |
301 | + width: void 0, | |
302 | + sortable: !1, | |
303 | + order: "asc", | |
304 | + visible: !0, | |
305 | + switchable: !0, | |
306 | + clickToSelect: !0, | |
307 | + formatter: void 0, | |
308 | + footerFormatter: void 0, | |
309 | + events: void 0, | |
310 | + sorter: void 0, | |
311 | + sortName: void 0, | |
312 | + cellStyle: void 0, | |
313 | + searchable: !0, | |
314 | + searchFormatter: !0, | |
315 | + cardVisible: !0 | |
316 | + }, p.EVENTS = { | |
317 | + "all.bs.table": "onAll", | |
318 | + "click-cell.bs.table": "onClickCell", | |
319 | + "dbl-click-cell.bs.table": "onDblClickCell", | |
320 | + "click-row.bs.table": "onClickRow", | |
321 | + "dbl-click-row.bs.table": "onDblClickRow", | |
322 | + "sort.bs.table": "onSort", | |
323 | + "check.bs.table": "onCheck", | |
324 | + "uncheck.bs.table": "onUncheck", | |
325 | + "check-all.bs.table": "onCheckAll", | |
326 | + "uncheck-all.bs.table": "onUncheckAll", | |
327 | + "check-some.bs.table": "onCheckSome", | |
328 | + "uncheck-some.bs.table": "onUncheckSome", | |
329 | + "load-success.bs.table": "onLoadSuccess", | |
330 | + "load-error.bs.table": "onLoadError", | |
331 | + "column-switch.bs.table": "onColumnSwitch", | |
332 | + "page-change.bs.table": "onPageChange", | |
333 | + "search.bs.table": "onSearch", | |
334 | + "toggle.bs.table": "onToggle", | |
335 | + "pre-body.bs.table": "onPreBody", | |
336 | + "post-body.bs.table": "onPostBody", | |
337 | + "post-header.bs.table": "onPostHeader", | |
338 | + "expand-row.bs.table": "onExpandRow", | |
339 | + "collapse-row.bs.table": "onCollapseRow", | |
340 | + "refresh-options.bs.table": "onRefreshOptions", | |
341 | + "reset-view.bs.table": "onResetView", | |
342 | + "refresh.bs.table": "onRefresh" | |
343 | + }, p.prototype.init = function () { | |
344 | + this.initLocale(), this.initContainer(), this.initTable(), this.initHeader(), this.initData(), this.initFooter(), this.initToolbar(), this.initPagination(), this.initBody(), this.initSearchText(), this.initServer() | |
345 | + }, p.prototype.initLocale = function () { | |
346 | + if (this.options.locale) { | |
347 | + var b = this.options.locale.split(/-|_/); | |
348 | + 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]]) | |
349 | + } | |
350 | + }, p.prototype.initContainer = function () { | |
351 | + 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") | |
352 | + }, p.prototype.initTable = function () { | |
353 | + var b = this, c = [], d = []; | |
354 | + if (this.$header = this.$el.find(">thead"), this.$header.length || (this.$header = a("<thead></thead>").appendTo(this.$el)), this.$header.find("tr").each(function () { | |
355 | + var b = []; | |
356 | + a(this).find("th").each(function () { | |
357 | + "undefined" != typeof a(this).data("field") && a(this).data("field", a(this).data("field") + ""), b.push(a.extend({}, { | |
358 | + title: a(this).html(), | |
359 | + "class": a(this).attr("class"), | |
360 | + titleTooltip: a(this).attr("title"), | |
361 | + rowspan: a(this).attr("rowspan") ? +a(this).attr("rowspan") : void 0, | |
362 | + colspan: a(this).attr("colspan") ? +a(this).attr("colspan") : void 0 | |
363 | + }, a(this).data())) | |
364 | + }), c.push(b) | |
365 | + }), 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) { | |
366 | + a.each(d, function (d, e) { | |
367 | + e = a.extend({}, p.COLUMN_DEFAULTS, e), "undefined" != typeof e.fieldIndex && (b.columns[e.fieldIndex] = e), b.options.columns[c][d] = e | |
368 | + }) | |
369 | + }), !this.options.data.length) { | |
370 | + var e = []; | |
371 | + this.$el.find(">tbody>tr").each(function (c) { | |
372 | + var f = {}; | |
373 | + 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) { | |
374 | + for (var g, h, i = a(this), j = +i.attr("colspan") || 1, k = +i.attr("rowspan") || 1; e[c] && e[c][d]; d++) ; | |
375 | + for (g = d; d + j > g; g++) for (h = c; c + k > h; h++) e[h] || (e[h] = []), e[h][g] = !0; | |
376 | + var m = b.columns[d].field; | |
377 | + 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()) | |
378 | + }), d.push(f) | |
379 | + }), this.options.data = d, d.length && (this.fromHtml = !0) | |
380 | + } | |
381 | + }, p.prototype.initHeader = function () { | |
382 | + var b = this, d = {}, e = []; | |
383 | + this.header = { | |
384 | + fields: [], | |
385 | + styles: [], | |
386 | + classes: [], | |
387 | + formatters: [], | |
388 | + events: [], | |
389 | + sorters: [], | |
390 | + sortNames: [], | |
391 | + cellStyles: [], | |
392 | + searchables: [] | |
393 | + }, a.each(this.options.columns, function (f, g) { | |
394 | + 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) { | |
395 | + var g = "", h = "", i = "", j = "", k = c(' class="%s"', f["class"]), | |
396 | + l = (b.options.sortOrder || f.order, "px"), m = f.width; | |
397 | + 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) { | |
398 | + 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; | |
399 | + if (b.options.cardView && !f.cardVisible) return; | |
400 | + d[f.field] = f | |
401 | + } | |
402 | + 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>") | |
403 | + }), e.push("</tr>") | |
404 | + }), this.$header.html(e.join("")), this.$header.find("th[data-field]").each(function () { | |
405 | + a(this).data(d[a(this).data("field")]) | |
406 | + }), this.$container.off("click", ".th-inner").on("click", ".th-inner", function (c) { | |
407 | + var d = a(this); | |
408 | + return b.options.detailView && d.closest(".bootstrap-table")[0] !== b.$container[0] ? !1 : void(b.options.sortable && d.parent().data().sortable && b.onSort(c)) | |
409 | + }), this.$header.children().children().off("keypress").on("keypress", function (c) { | |
410 | + if (b.options.sortable && a(this).data().sortable) { | |
411 | + var d = c.keyCode || c.which; | |
412 | + 13 == d && b.onSort(c) | |
413 | + } | |
414 | + }), 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 () { | |
415 | + var c = a(this).prop("checked"); | |
416 | + b[c ? "checkAll" : "uncheckAll"](), b.updateSelected() | |
417 | + }) | |
418 | + }, p.prototype.initFooter = function () { | |
419 | + !this.options.showFooter || this.options.cardView ? this.$tableFooter.hide() : this.$tableFooter.show() | |
420 | + }, p.prototype.initData = function (a, b) { | |
421 | + 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() | |
422 | + }, p.prototype.initSort = function () { | |
423 | + var b = this, c = this.options.sortName, d = "desc" === this.options.sortOrder ? -1 : 1, | |
424 | + e = a.inArray(this.options.sortName, this.header.fields); | |
425 | + 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) { | |
426 | + b.hasOwnProperty("_position") || (b._position = a) | |
427 | + }), this.data.sort(function (f, g) { | |
428 | + b.header.sortNames[e] && (c = b.header.sortNames[e]); | |
429 | + var i = m(f, c, b.options.escape), j = m(g, c, b.options.escape), | |
430 | + k = h(b.header, b.header.sorters[e], [i, j]); | |
431 | + 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)) | |
432 | + }))) | |
433 | + }, p.prototype.onSort = function (b) { | |
434 | + var c = "keypress" === b.type ? a(b.currentTarget) : a(b.currentTarget).parent(), | |
435 | + d = this.$header.find("th").eq(c.index()); | |
436 | + 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()) | |
437 | + }, p.prototype.initToolbar = function () { | |
438 | + var b, d, e = this, f = [], g = 0, i = 0; | |
439 | + 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) { | |
440 | + if (!(b.radio || b.checkbox || e.options.cardView && !b.cardVisible)) { | |
441 | + var d = b.visible ? ' checked="checked"' : ""; | |
442 | + 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++) | |
443 | + } | |
444 | + }), 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 () { | |
445 | + e.toggleView() | |
446 | + }), 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) { | |
447 | + a.stopImmediatePropagation() | |
448 | + }), b.find("input").off("click").on("click", function () { | |
449 | + var b = a(this); | |
450 | + e.toggleColumn(a(this).val(), b.prop("checked"), !1), e.trigger("column-switch", a(this).data("field"), b.prop("checked")) | |
451 | + })), 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) { | |
452 | + e.options.searchOnEnterKey && 13 !== b.keyCode || a.inArray(b.keyCode, [37, 38, 39, 40]) > -1 || (clearTimeout(g), g = setTimeout(function () { | |
453 | + e.onSearch(b) | |
454 | + }, e.options.searchTimeOut)) | |
455 | + }), n() && d.off("mouseup").on("mouseup", function (a) { | |
456 | + clearTimeout(g), g = setTimeout(function () { | |
457 | + e.onSearch(a) | |
458 | + }, e.options.searchTimeOut) | |
459 | + })) | |
460 | + }, p.prototype.onSearch = function (b) { | |
461 | + var c = a.trim(a(b.currentTarget).val()); | |
462 | + 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)) | |
463 | + }, p.prototype.initSearch = function () { | |
464 | + var b = this; | |
465 | + if ("server" !== this.options.sidePagination) { | |
466 | + if (this.options.customSearch !== a.noop) return void this.options.customSearch.apply(this, [this.searchText]); | |
467 | + var c = this.searchText && (this.options.escape ? j(this.searchText) : this.searchText).toLowerCase(), | |
468 | + d = a.isEmptyObject(this.filterColumns) ? null : this.filterColumns; | |
469 | + this.data = d ? a.grep(this.options.data, function (b) { | |
470 | + for (var c in d) if (a.isArray(d[c]) && -1 === a.inArray(b[c], d[c]) || b[c] !== d[c]) return !1; | |
471 | + return !0 | |
472 | + }) : this.options.data, this.data = c ? a.grep(this.data, function (d, f) { | |
473 | + for (var g = 0; g < b.header.fields.length; g++) if (b.header.searchables[g]) { | |
474 | + var i, j = a.isNumeric(b.header.fields[g]) ? parseInt(b.header.fields[g], 10) : b.header.fields[g], | |
475 | + k = b.columns[e(b.columns, j)]; | |
476 | + if ("string" == typeof j) { | |
477 | + i = d; | |
478 | + for (var l = j.split("."), m = 0; m < l.length; m++) i = i[l[m]]; | |
479 | + k && k.searchFormatter && (i = h(k, b.header.formatters[g], [i, d, f], i)) | |
480 | + } else i = d[j]; | |
481 | + if ("string" == typeof i || "number" == typeof i) if (b.options.strictSearch) { | |
482 | + if ((i + "").toLowerCase() === c) return !0 | |
483 | + } else if (-1 !== (i + "").toLowerCase().indexOf(c)) return !0 | |
484 | + } | |
485 | + return !1 | |
486 | + }) : this.data | |
487 | + } | |
488 | + }, p.prototype.initPagination = function () { | |
489 | + if (!this.options.pagination) return void this.$pagination.hide(); | |
490 | + this.$pagination.show(); | |
491 | + var b, d, e, f, g, h, i, j, k, l = this, m = [], n = !1, o = this.getData(), p = this.options.pageList; | |
492 | + if ("server" !== this.options.sidePagination && (this.options.totalRows = o.length), this.totalPages = 0, this.options.totalRows) { | |
493 | + if (this.options.pageSize === this.options.formatAllRows()) this.options.pageSize = this.options.totalRows, n = !0; else if (this.options.pageSize === this.options.totalRows) { | |
494 | + var q = "string" == typeof this.options.pageList ? this.options.pageList.replace("[", "").replace("]", "").replace(/ /g, "").toLowerCase().split(",") : this.options.pageList; | |
495 | + a.inArray(this.options.formatAllRows().toLowerCase(), q) > -1 && (n = !0) | |
496 | + } | |
497 | + this.totalPages = ~~((this.options.totalRows - 1) / this.options.pageSize) + 1, this.options.totalPages = this.totalPages | |
498 | + } | |
499 | + 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) { | |
500 | + m.push('<span class="page-list">'); | |
501 | + 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">']; | |
502 | + if ("string" == typeof this.options.pageList) { | |
503 | + var s = this.options.pageList.replace("[", "").replace("]", "").replace(/ /g, "").split(","); | |
504 | + p = [], a.each(s, function (a, b) { | |
505 | + p.push(b.toUpperCase() === l.options.formatAllRows().toUpperCase() ? l.options.formatAllRows() : +b) | |
506 | + }) | |
507 | + } | |
508 | + for (a.each(p, function (a, b) { | |
509 | + if (!l.options.smartDisplay || 0 === a || p[a - 1] <= l.options.totalRows) { | |
510 | + var d; | |
511 | + 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)) | |
512 | + } | |
513 | + }), 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>"); | |
514 | + 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>") | |
515 | + } | |
516 | + 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))) | |
517 | + }, p.prototype.updatePagination = function (b) { | |
518 | + 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)) | |
519 | + }, p.prototype.onPageListChange = function (b) { | |
520 | + var c = a(b.currentTarget); | |
521 | + 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) | |
522 | + }, p.prototype.onPageFirst = function (a) { | |
523 | + this.options.pageNumber = 1, this.updatePagination(a) | |
524 | + }, p.prototype.onPagePre = function (a) { | |
525 | + this.options.pageNumber - 1 === 0 ? this.options.pageNumber = this.options.totalPages : this.options.pageNumber--, this.updatePagination(a) | |
526 | + }, p.prototype.onPageNext = function (a) { | |
527 | + this.options.pageNumber + 1 > this.options.totalPages ? this.options.pageNumber = 1 : this.options.pageNumber++, this.updatePagination(a) | |
528 | + }, p.prototype.onPageLast = function (a) { | |
529 | + this.options.pageNumber = this.totalPages, this.updatePagination(a) | |
530 | + }, p.prototype.onPageNumber = function (b) { | |
531 | + this.options.pageNumber !== +a(b.currentTarget).text() && (this.options.pageNumber = +a(b.currentTarget).text(), this.updatePagination(b)) | |
532 | + }, p.prototype.initBody = function (b) { | |
533 | + var f = this, g = [], i = this.getData(); | |
534 | + 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); | |
535 | + for (var k = this.pageFrom - 1; k < this.pageTo; k++) { | |
536 | + var l, n = i[k], o = {}, p = [], q = "", r = {}, s = []; | |
537 | + 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]); | |
538 | + if (r = h(this.options, this.options.rowAttributes, [n, k], r)) for (l in r) s.push(c('%s="%s"', l, j(r[l]))); | |
539 | + n._data && !a.isEmptyObject(n._data) && a.each(n._data, function (a, b) { | |
540 | + "index" !== a && (q += c(' data-%s="%s"', a, b)) | |
541 | + }), 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) { | |
542 | + var i = "", j = m(n, e, f.options.escape), l = "", q = {}, r = "", s = f.header.classes[b], t = "", | |
543 | + u = "", v = "", w = "", x = f.columns[b]; | |
544 | + if (!(f.fromHtml && "undefined" == typeof j || !x.visible || f.options.cardView && !x.cardVisible)) { | |
545 | + 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) { | |
546 | + var y = []; | |
547 | + for (var z in q.css) y.push(z + ": " + q.css[z]); | |
548 | + o = c('style="%s"', y.concat(f.header.styles[b]).join("; ")) | |
549 | + } | |
550 | + 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) { | |
551 | + "index" !== a && (t += c(' data-%s="%s"', a, b)) | |
552 | + }), 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) | |
553 | + } | |
554 | + }), this.options.cardView && g.push("</div></td>"), g.push("</tr>") | |
555 | + } | |
556 | + 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) { | |
557 | + var d = a(this), g = d.parent(), h = f.data[g.data("index")], i = d[0].cellIndex, j = f.getVisibleFields(), | |
558 | + k = j[f.options.detailView && !f.options.cardView ? i - 1 : i], l = f.columns[e(f.columns, k)], | |
559 | + n = m(h, k, f.options.escape); | |
560 | + 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), | |
561 | + "click" === b.type && f.options.clickToSelect && l.clickToSelect)) { | |
562 | + var o = g.find(c('[name="%s"]', f.options.selectItemName)); | |
563 | + o.length && o[0].click() | |
564 | + } | |
565 | + }), this.$body.find("> tr[data-index] > td > .detail-icon").off("click").on("click", function () { | |
566 | + var b = a(this), d = b.parent().parent(), e = d.data("index"), g = i[e]; | |
567 | + 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 { | |
568 | + 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)); | |
569 | + var j = d.next().find("td"), k = h(f.options, f.options.detailFormatter, [e, g, j], ""); | |
570 | + 1 === j.length && j.append(k), f.trigger("expand-row", e, g, j) | |
571 | + } | |
572 | + f.resetView() | |
573 | + }), this.$selectItem = this.$body.find(c('[name="%s"]', this.options.selectItemName)), this.$selectItem.off("click").on("click", function (b) { | |
574 | + b.stopImmediatePropagation(); | |
575 | + var c = a(this), d = c.prop("checked"), e = f.data[c.data("index")]; | |
576 | + f.options.maintainSelected && a(this).is(":radio") && a.each(f.options.data, function (a, b) { | |
577 | + b[f.header.stateField] = !1 | |
578 | + }), e[f.header.stateField] = d, f.options.singleSelect && (f.$selectItem.not(this).each(function () { | |
579 | + f.data[a(this).data("index")][f.header.stateField] = !1 | |
580 | + }), f.$selectItem.filter(":checked").not(this).prop("checked", !1)), f.updateSelected(), f.trigger(d ? "check" : "uncheck", e, c) | |
581 | + }), a.each(this.header.events, function (b, c) { | |
582 | + if (c) { | |
583 | + "string" == typeof c && (c = h(null, c)); | |
584 | + var d = f.header.fields[b], e = a.inArray(d, f.getVisibleFields()); | |
585 | + f.options.detailView && !f.options.cardView && (e += 1); | |
586 | + for (var g in c) f.$body.find(">tr:not(.no-records-found)").each(function () { | |
587 | + var b = a(this), h = b.find(f.options.cardView ? ".card-view" : "td").eq(e), i = g.indexOf(" "), | |
588 | + j = g.substring(0, i), k = g.substring(i + 1), l = c[g]; | |
589 | + h.find(k).off(j).on(j, function (a) { | |
590 | + var c = b.data("index"), e = f.data[c], g = e[d]; | |
591 | + l.apply(this, [a, g, e, c]) | |
592 | + }) | |
593 | + }) | |
594 | + } | |
595 | + }), this.updateSelected(), this.resetView(), this.trigger("post-body", i) | |
596 | + }, p.prototype.initServer = function (b, c, d) { | |
597 | + var e, f = this, g = {}, | |
598 | + i = {searchText: this.searchText, sortName: this.options.sortName, sortOrder: this.options.sortOrder}; | |
599 | + 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 = { | |
600 | + search: i.searchText, | |
601 | + sort: i.sortName, | |
602 | + order: i.sortOrder | |
603 | + }, 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), { | |
604 | + type: this.options.method, | |
605 | + url: d || this.options.url, | |
606 | + data: "application/json" === this.options.contentType && "post" === this.options.method ? JSON.stringify(g) : g, | |
607 | + cache: this.options.cache, | |
608 | + contentType: this.options.contentType, | |
609 | + dataType: this.options.dataType, | |
610 | + success: function (a) { | |
611 | + a = h(f.options, f.options.responseHandler, [a], a), f.load(a), f.trigger("load-success", a), b || f.$tableLoading.hide() | |
612 | + }, | |
613 | + error: function (a) { | |
614 | + f.trigger("load-error", a.status, a), b || f.$tableLoading.hide() | |
615 | + } | |
616 | + }), this.options.ajax ? h(this, this.options.ajax, [e], null) : (this._xhr && 4 !== this._xhr.readyState && this._xhr.abort(), this._xhr = a.ajax(e)))) | |
617 | + }, p.prototype.initSearchText = function () { | |
618 | + if (this.options.search && "" !== this.options.searchText) { | |
619 | + var a = this.$toolbar.find(".search input"); | |
620 | + a.val(this.options.searchText), this.onSearch({currentTarget: a}) | |
621 | + } | |
622 | + }, p.prototype.getCaret = function () { | |
623 | + var b = this; | |
624 | + a.each(this.$header.find("th"), function (c, d) { | |
625 | + a(d).find(".sortable").removeClass("desc asc").addClass(a(d).data("field") === b.options.sortName ? b.options.sortOrder : "both") | |
626 | + }) | |
627 | + }, p.prototype.updateSelected = function () { | |
628 | + var b = this.$selectItem.filter(":enabled").length && this.$selectItem.filter(":enabled").length === this.$selectItem.filter(":enabled").filter(":checked").length; | |
629 | + this.$selectAll.add(this.$selectAll_).prop("checked", b), this.$selectItem.each(function () { | |
630 | + a(this).closest("tr")[a(this).prop("checked") ? "addClass" : "removeClass"]("selected") | |
631 | + }) | |
632 | + }, p.prototype.updateRows = function () { | |
633 | + var b = this; | |
634 | + this.$selectItem.each(function () { | |
635 | + b.data[a(this).data("index")][b.header.stateField] = a(this).prop("checked") | |
636 | + }) | |
637 | + }, p.prototype.resetRows = function () { | |
638 | + var b = this; | |
639 | + a.each(this.data, function (a, c) { | |
640 | + b.$selectAll.prop("checked", !1), b.$selectItem.prop("checked", !1), b.header.stateField && (c[b.header.stateField] = !1) | |
641 | + }) | |
642 | + }, p.prototype.trigger = function (b) { | |
643 | + var c = Array.prototype.slice.call(arguments, 1); | |
644 | + 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]) | |
645 | + }, p.prototype.resetHeader = function () { | |
646 | + clearTimeout(this.timeoutId_), this.timeoutId_ = setTimeout(a.proxy(this.fitHeader, this), this.$el.is(":hidden") ? 100 : 0) | |
647 | + }, p.prototype.fitHeader = function () { | |
648 | + var b, d, e, f, h = this; | |
649 | + if (h.$el.is(":hidden")) return void(h.timeoutId_ = setTimeout(a.proxy(h.fitHeader, h), 100)); | |
650 | + 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) { | |
651 | + var i = e.parents("th"); | |
652 | + if (i.length > 0) { | |
653 | + var j = i.attr("data-field"); | |
654 | + if (void 0 !== j) { | |
655 | + var k = this.$header.find("[data-field='" + j + "']"); | |
656 | + k.length > 0 && k.find(":input").addClass("focus-temp") | |
657 | + } | |
658 | + } | |
659 | + } | |
660 | + 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 () { | |
661 | + h.$header_.find(c('th[data-field="%s"]', a(this).data("field"))).data(a(this).data()) | |
662 | + }); | |
663 | + var l = this.getVisibleFields(), m = this.$header_.find("th"); | |
664 | + this.$body.find(">tr:first-child:not(.no-records-found) > *").each(function (b) { | |
665 | + var d = a(this), e = b; | |
666 | + h.options.detailView && !h.options.cardView && (0 === b && h.$header_.find("th.detail").find(".fht-cell").width(d.innerWidth()), e = b - 1); | |
667 | + var f = h.$header_.find(c('th[data-field="%s"]', l[e])); | |
668 | + f.length > 1 && (f = a(m[d[0].cellIndex])), f.find(".fht-cell").width(d.innerWidth()) | |
669 | + }), this.$tableBody.off("scroll").on("scroll", function () { | |
670 | + h.$tableHeader.scrollLeft(a(this).scrollLeft()), h.options.showFooter && !h.options.cardView && h.$tableFooter.scrollLeft(a(this).scrollLeft()) | |
671 | + }), h.trigger("post-header") | |
672 | + }, p.prototype.resetFooter = function () { | |
673 | + var b = this, d = b.getData(), e = []; | |
674 | + this.options.showFooter && !this.options.cardView && (!this.options.cardView && this.options.detailView && e.push('<td><div class="th-inner"> </div><div class="fht-cell"></div></td>'), a.each(this.columns, function (a, f) { | |
675 | + var g, i = "", j = "", k = [], l = {}, m = c(' class="%s"', f["class"]); | |
676 | + if (f.visible && (!b.options.cardView || f.cardVisible)) { | |
677 | + 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]); | |
678 | + 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], " ") || " "), e.push("</div>"), e.push('<div class="fht-cell"></div>'), e.push("</div>"), e.push("</td>") | |
679 | + } | |
680 | + }), 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)) | |
681 | + }, p.prototype.fitFooter = function () { | |
682 | + var b, c, d; | |
683 | + 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) { | |
684 | + var d = a(this); | |
685 | + b.eq(c).find(".fht-cell").width(d.innerWidth()) | |
686 | + })) | |
687 | + }, p.prototype.toggleColumn = function (a, b, d) { | |
688 | + if (-1 !== a && (this.columns[a].visible = b, this.initHeader(), this.initSearch(), this.initPagination(), this.initBody(), this.options.showColumns)) { | |
689 | + var e = this.$toolbar.find(".keep-open input").prop("disabled", !1); | |
690 | + d && e.filter(c('[value="%s"]', a)).prop("checked", b), e.filter(":checked").length <= this.options.minimumCountColumns && e.filter(":checked").prop("disabled", !0) | |
691 | + } | |
692 | + }, p.prototype.toggleRow = function (a, b, d) { | |
693 | + -1 !== a && this.$body.find("undefined" != typeof a ? c('tr[data-index="%s"]', a) : c('tr[data-uniqueid="%s"]', b))[d ? "show" : "hide"]() | |
694 | + }, p.prototype.getVisibleFields = function () { | |
695 | + var b = this, c = []; | |
696 | + return a.each(this.header.fields, function (a, d) { | |
697 | + var f = b.columns[e(b.columns, d)]; | |
698 | + f.visible && c.push(d) | |
699 | + }), c | |
700 | + }, p.prototype.resetView = function (a) { | |
701 | + var b = 0; | |
702 | + 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) { | |
703 | + var c = k(this.$toolbar), d = k(this.$pagination), e = this.options.height - c - d; | |
704 | + this.$tableContainer.css("height", e + "px") | |
705 | + } | |
706 | + 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")) | |
707 | + }, p.prototype.getData = function (b) { | |
708 | + 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 | |
709 | + }, p.prototype.load = function (b) { | |
710 | + var c = !1; | |
711 | + "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) | |
712 | + }, p.prototype.append = function (a) { | |
713 | + this.initData(a, "append"), this.initSearch(), this.initPagination(), this.initSort(), this.initBody(!0) | |
714 | + }, p.prototype.prepend = function (a) { | |
715 | + this.initData(a, "prepend"), this.initSearch(), this.initPagination(), this.initSort(), this.initBody(!0) | |
716 | + }, p.prototype.remove = function (b) { | |
717 | + var c, d, e = this.options.data.length; | |
718 | + if (b.hasOwnProperty("field") && b.hasOwnProperty("values")) { | |
719 | + 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); | |
720 | + e !== this.options.data.length && (this.initSearch(), this.initPagination(), this.initSort(), this.initBody(!0)) | |
721 | + } | |
722 | + }, p.prototype.removeAll = function () { | |
723 | + this.options.data.length > 0 && (this.options.data.splice(0, this.options.data.length), this.initSearch(), this.initPagination(), this.initBody(!0)) | |
724 | + }, p.prototype.getRowByUniqueId = function (a) { | |
725 | + var b, c, d, e = this.options.uniqueId, f = this.options.data.length, g = null; | |
726 | + for (b = f - 1; b >= 0; b--) { | |
727 | + if (c = this.options.data[b], c.hasOwnProperty(e)) d = c[e]; else { | |
728 | + if (!c._data.hasOwnProperty(e)) continue; | |
729 | + d = c._data[e] | |
730 | + } | |
731 | + 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) { | |
732 | + g = c; | |
733 | + break | |
734 | + } | |
735 | + } | |
736 | + return g | |
737 | + }, p.prototype.removeByUniqueId = function (a) { | |
738 | + var b = this.options.data.length, c = this.getRowByUniqueId(a); | |
739 | + c && this.options.data.splice(this.options.data.indexOf(c), 1), b !== this.options.data.length && (this.initSearch(), this.initPagination(), this.initBody(!0)) | |
740 | + }, p.prototype.updateByUniqueId = function (b) { | |
741 | + var c = this, d = a.isArray(b) ? b : [b]; | |
742 | + a.each(d, function (b, d) { | |
743 | + var e; | |
744 | + 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)) | |
745 | + }), this.initSearch(), this.initSort(), this.initBody(!0) | |
746 | + }, p.prototype.insertRow = function (a) { | |
747 | + a.hasOwnProperty("index") && a.hasOwnProperty("row") && (this.data.splice(a.index, 0, a.row), this.initSearch(), this.initPagination(), this.initSort(), this.initBody(!0)) | |
748 | + }, p.prototype.updateRow = function (b) { | |
749 | + var c = this, d = a.isArray(b) ? b : [b]; | |
750 | + a.each(d, function (b, d) { | |
751 | + d.hasOwnProperty("index") && d.hasOwnProperty("row") && a.extend(c.options.data[d.index], d.row) | |
752 | + }), this.initSearch(), this.initSort(), this.initBody(!0) | |
753 | + }, p.prototype.showRow = function (a) { | |
754 | + (a.hasOwnProperty("index") || a.hasOwnProperty("uniqueId")) && this.toggleRow(a.index, a.uniqueId, !0) | |
755 | + }, p.prototype.hideRow = function (a) { | |
756 | + (a.hasOwnProperty("index") || a.hasOwnProperty("uniqueId")) && this.toggleRow(a.index, a.uniqueId, !1) | |
757 | + }, p.prototype.getRowsHidden = function (b) { | |
758 | + var c = a(this.$body[0]).children().filter(":hidden"), d = 0; | |
759 | + if (b) for (; d < c.length; d++) a(c[d]).show(); | |
760 | + return c | |
761 | + }, p.prototype.mergeCells = function (b) { | |
762 | + var c, d, e, f = b.index, g = a.inArray(b.field, this.getVisibleFields()), h = b.rowspan || 1, | |
763 | + i = b.colspan || 1, j = this.$body.find(">tr"); | |
764 | + 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)) { | |
765 | + for (c = f; f + h > c; c++) for (d = g; g + i > d; d++) j.eq(c).find(">td").eq(d).hide(); | |
766 | + e.attr("rowspan", h).attr("colspan", i).show() | |
767 | + } | |
768 | + }, p.prototype.updateCell = function (a) { | |
769 | + 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))) | |
770 | + }, p.prototype.getOptions = function () { | |
771 | + return this.options | |
772 | + }, p.prototype.getSelections = function () { | |
773 | + var b = this; | |
774 | + return a.grep(this.options.data, function (a) { | |
775 | + return a[b.header.stateField] | |
776 | + }) | |
777 | + }, p.prototype.getAllSelections = function () { | |
778 | + var b = this; | |
779 | + return a.grep(this.options.data, function (a) { | |
780 | + return a[b.header.stateField] | |
781 | + }) | |
782 | + }, p.prototype.checkAll = function () { | |
783 | + this.checkAll_(!0) | |
784 | + }, p.prototype.uncheckAll = function () { | |
785 | + this.checkAll_(!1) | |
786 | + },p.prototype.getRowByIndex = function (index) { | |
787 | + if((index * 1+1)>this.options.data.length){ | |
788 | + throw new Error("Unknown method: 没有当前序号!"); | |
789 | + } | |
790 | + return this.options.data[index * 1]; | |
791 | + }, p.prototype.checkInvert = function () { | |
792 | + var b = this, c = b.$selectItem.filter(":enabled"), d = c.filter(":checked"); | |
793 | + c.each(function () { | |
794 | + a(this).prop("checked", !a(this).prop("checked")) | |
795 | + }), b.updateRows(), b.updateSelected(), b.trigger("uncheck-some", d), d = b.getSelections(), b.trigger("check-some", d) | |
796 | + }, p.prototype.checkAll_ = function (a) { | |
797 | + var b; | |
798 | + 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) | |
799 | + }, p.prototype.check = function (a) { | |
800 | + this.check_(!0, a) | |
801 | + }, p.prototype.uncheck = function (a) { | |
802 | + this.check_(!1, a) | |
803 | + }, p.prototype.check_ = function (a, b) { | |
804 | + var d = this.$selectItem.filter(c('[data-index="%s"]', b)).prop("checked", a); | |
805 | + this.data[b][this.header.stateField] = a, this.updateSelected(), this.trigger(a ? "check" : "uncheck", this.data[b], d) | |
806 | + }, p.prototype.checkBy = function (a) { | |
807 | + this.checkBy_(!0, a) | |
808 | + }, p.prototype.uncheckBy = function (a) { | |
809 | + this.checkBy_(!1, a) | |
810 | + }, p.prototype.checkBy_ = function (b, d) { | |
811 | + if (d.hasOwnProperty("field") && d.hasOwnProperty("values")) { | |
812 | + var e = this, f = []; | |
813 | + a.each(this.options.data, function (g, h) { | |
814 | + if (!h.hasOwnProperty(d.field)) return !1; | |
815 | + if (-1 !== a.inArray(h[d.field], d.values)) { | |
816 | + var i = e.$selectItem.filter(":enabled").filter(c('[data-index="%s"]', g)).prop("checked", b); | |
817 | + h[e.header.stateField] = b, f.push(h), e.trigger(b ? "check" : "uncheck", h, i) | |
818 | + } | |
819 | + }), this.updateSelected(), this.trigger(b ? "check-some" : "uncheck-some", f) | |
820 | + } | |
821 | + }, p.prototype.destroy = function () { | |
822 | + 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") || "") | |
823 | + }, p.prototype.showLoading = function () { | |
824 | + this.$tableLoading.show() | |
825 | + }, p.prototype.hideLoading = function () { | |
826 | + this.$tableLoading.hide() | |
827 | + }, p.prototype.togglePagination = function () { | |
828 | + this.options.pagination = !this.options.pagination; | |
829 | + var a = this.$toolbar.find('button[name="paginationSwitch"] i'); | |
830 | + 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() | |
831 | + }, p.prototype.refresh = function (a) { | |
832 | + a && a.url && (this.options.pageNumber = 1), this.initServer(a && a.silent, a && a.query, a && a.url), this.trigger("refresh", a) | |
833 | + }, p.prototype.resetWidth = function () { | |
834 | + this.options.showHeader && this.options.height && this.fitHeader(), this.options.showFooter && this.fitFooter() | |
835 | + }, p.prototype.showColumn = function (a) { | |
836 | + this.toggleColumn(e(this.columns, a), !0, !0) | |
837 | + }, p.prototype.hideColumn = function (a) { | |
838 | + this.toggleColumn(e(this.columns, a), !1, !0) | |
839 | + }, p.prototype.getHiddenColumns = function () { | |
840 | + return a.grep(this.columns, function (a) { | |
841 | + return !a.visible | |
842 | + }) | |
843 | + }, p.prototype.getVisibleColumns = function () { | |
844 | + return a.grep(this.columns, function (a) { | |
845 | + return a.visible | |
846 | + }) | |
847 | + }, p.prototype.toggleAllColumns = function (b) { | |
848 | + if (a.each(this.columns, function (a) { | |
849 | + this.columns[a].visible = b | |
850 | + }), this.initHeader(), this.initSearch(), this.initPagination(), this.initBody(), this.options.showColumns) { | |
851 | + var c = this.$toolbar.find(".keep-open input").prop("disabled", !1); | |
852 | + c.filter(":checked").length <= this.options.minimumCountColumns && c.filter(":checked").prop("disabled", !0) | |
853 | + } | |
854 | + }, p.prototype.showAllColumns = function () { | |
855 | + this.toggleAllColumns(!0) | |
856 | + }, p.prototype.hideAllColumns = function () { | |
857 | + this.toggleAllColumns(!1) | |
858 | + }, p.prototype.filterBy = function (b) { | |
859 | + this.filterColumns = a.isEmptyObject(b) ? {} : b, this.options.pageNumber = 1, this.initSearch(), this.updatePagination() | |
860 | + }, p.prototype.scrollTo = function (a) { | |
861 | + 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 | |
862 | + }, p.prototype.getScrollPosition = function () { | |
863 | + return this.scrollTo() | |
864 | + }, p.prototype.selectPage = function (a) { | |
865 | + a > 0 && a <= this.options.totalPages && (this.options.pageNumber = a, this.updatePagination()) | |
866 | + }, p.prototype.prevPage = function () { | |
867 | + this.options.pageNumber > 1 && (this.options.pageNumber--, this.updatePagination()) | |
868 | + }, p.prototype.nextPage = function () { | |
869 | + this.options.pageNumber < this.options.totalPages && (this.options.pageNumber++, this.updatePagination()) | |
870 | + }, p.prototype.toggleView = function () { | |
871 | + this.options.cardView = !this.options.cardView, this.initHeader(), this.initBody(), this.trigger("toggle", this.options.cardView) | |
872 | + }, p.prototype.refreshOptions = function (b) { | |
873 | + i(this.options, b, !0) || (this.options = a.extend(this.options, b), this.trigger("refresh-options", this.options), this.destroy(), this.init()) | |
874 | + }, p.prototype.resetSearch = function (a) { | |
875 | + var b = this.$toolbar.find(".search input"); | |
876 | + b.val(a || ""), this.onSearch({currentTarget: b}) | |
877 | + }, p.prototype.expandRow_ = function (a, b) { | |
878 | + var d = this.$body.find(c('> tr[data-index="%s"]', b)); | |
879 | + d.next().is("tr.detail-view") === (a ? !1 : !0) && d.find("> td > .detail-icon").click() | |
880 | + }, p.prototype.expandRow = function (a) { | |
881 | + this.expandRow_(!0, a) | |
882 | + }, p.prototype.collapseRow = function (a) { | |
883 | + this.expandRow_(!1, a) | |
884 | + }, p.prototype.expandAllRows = function (b) { | |
885 | + if (b) { | |
886 | + var d = this.$body.find(c('> tr[data-index="%s"]', 0)), e = this, f = null, g = !1, h = -1; | |
887 | + 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 { | |
888 | + h = setInterval(function () { | |
889 | + f = e.$body.find("tr.detail-view").last().find(".detail-icon"), f.length > 0 ? f.click() : clearInterval(h) | |
890 | + }, 1) | |
891 | + } catch (i) { | |
892 | + clearInterval(h) | |
893 | + } | |
894 | + } else for (var j = this.$body.children(), k = 0; k < j.length; k++) this.expandRow_(!0, a(j[k]).data("index")) | |
895 | + }, p.prototype.collapseAllRows = function (b) { | |
896 | + 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")) | |
897 | + }, p.prototype.updateFormatText = function (a, b) { | |
898 | + this.options[c("format%s", a)] && ("string" == typeof b ? this.options[c("format%s", a)] = function () { | |
899 | + return b | |
900 | + } : "function" == typeof b && (this.options[c("format%s", a)] = b)), this.initToolbar(), this.initPagination(), this.initBody() | |
901 | + }; | |
902 | + 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"]; | |
903 | + a.fn.bootstrapTable = function (b) { | |
904 | + var c, d = Array.prototype.slice.call(arguments, 1); | |
905 | + return this.each(function () { | |
906 | + var e = a(this), f = e.data("bootstrap.table"), | |
907 | + g = a.extend({}, p.DEFAULTS, e.data(), "object" == typeof b && b); | |
908 | + if ("string" == typeof b) { | |
909 | + if (a.inArray(b, q) < 0) throw new Error("Unknown method: " + b); | |
910 | + if (!f) return; | |
911 | + c = f[b].apply(f, d), "destroy" === b && e.removeData("bootstrap.table") | |
912 | + } | |
913 | + f || e.data("bootstrap.table", f = new p(this, g)) | |
914 | + }), "undefined" == typeof c ? this : c | |
915 | + }, 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 = { | |
916 | + sprintf: c, | |
917 | + getFieldIndex: e, | |
918 | + compareObjects: i, | |
919 | + calculateObjectValue: h, | |
920 | + getItemField: m, | |
921 | + objectKeys: o, | |
922 | + isIEBrowser: n | |
923 | + }, a(function () { | |
924 | + a('[data-toggle="table"]').bootstrapTable() | |
925 | + }) | |
926 | +}(jQuery); | |
9 | 927 | \ No newline at end of file |
... | ... |
src/main/resources/static/ajax/libs/bootstrap-table/extensions/columns/bootstrap-table-fixed-columns.js deleted
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); | |
298 | 0 | \ No newline at end of file |
src/main/resources/static/ajax/libs/bootstrap-table/extensions/editable/bootstrap-editable.css deleted
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 | -} | |
664 | 0 | \ No newline at end of file |
src/main/resources/static/ajax/libs/bootstrap-table/extensions/editable/bootstrap-editable.min.js deleted
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," "),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"> </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:"× 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:"× 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); | |
8 | 0 | \ No newline at end of file |
src/main/resources/static/ajax/libs/bootstrap-table/extensions/editable/clear.png deleted
244 Bytes
src/main/resources/static/ajax/libs/bootstrap-table/extensions/editable/loading.gif deleted
1.81 KB
src/main/resources/static/ajax/libs/bootstrap-table/extensions/export/bootstrap-table-export.js
src/main/resources/static/ajax/libs/bootstrap-table/extensions/export/tableExport.js
... | ... | @@ -690,6 +690,8 @@ |
690 | 690 | |
691 | 691 | if ( typeof tdcss == 'undefined' && typeof defaults.onMsoNumberFormat === 'function' ) |
692 | 692 | tdcss = defaults.onMsoNumberFormat(cell, row, col); |
693 | + else | |
694 | + tdcss = "\\@" | |
693 | 695 | |
694 | 696 | if ( typeof tdcss != 'undefined' && tdcss !== '' ) |
695 | 697 | tdstyle = 'style="mso-number-format:\'' + tdcss + '\''; |
... | ... |
src/main/resources/static/ajax/libs/bootstrap-table/extensions/mobile/bootstrap-table-mobile.js
1 | 1 | /** |
2 | - * 基于bootstrap-table-mobile修改 | |
3 | - * 修正部分iPhone手机不显示卡片视图 | |
4 | - * Copyright (c) 2019 ruoyi | |
2 | + * @author: Dennis Hernández | |
3 | + * @webSite: http://djhvscf.github.io/Blog | |
4 | + * @version: v1.1.0 | |
5 | 5 | */ |
6 | + | |
6 | 7 | !function ($) { |
7 | - | |
8 | + | |
8 | 9 | 'use strict'; |
9 | - | |
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 | + | |
10 | 23 | var resetView = function (that) { |
11 | 24 | if (that.options.height || that.options.showFooter) { |
12 | - setTimeout(that.resetView(), 1); | |
25 | + setTimeout(function(){ | |
26 | + that.resetView.call(that); | |
27 | + }, 1); | |
13 | 28 | } |
14 | 29 | }; |
15 | - | |
16 | - // 判断是否 iphone | |
17 | - var isIPhone = function () { | |
18 | - var browserName = navigator.userAgent.toLowerCase(); | |
19 | - return /(iPhone|iPad|iPod|iOS)/i.test(browserName); | |
20 | - }; | |
21 | 30 | |
22 | 31 | var changeView = function (that, width, height) { |
23 | 32 | if (that.options.minHeight) { |
24 | - if (checkValuesLessEqual(width, that.options.minWidth) && checkValuesLessEqual(height, that.options.minHeight)) { | |
33 | + if ((width <= that.options.minWidth) && (height <= that.options.minHeight)) { | |
25 | 34 | conditionCardView(that); |
26 | - } else if (checkValuesGreater(width, that.options.minWidth) && checkValuesGreater(height, that.options.minHeight)) { | |
35 | + } else if ((width > that.options.minWidth) && (height > that.options.minHeight)) { | |
27 | 36 | conditionFullView(that); |
28 | 37 | } |
29 | 38 | } else { |
30 | - if (checkValuesLessEqual(width, that.options.minWidth) || isIPhone()) { | |
39 | + if (width <= that.options.minWidth) { | |
31 | 40 | conditionCardView(that); |
32 | - } else if (checkValuesGreater(width, that.options.minWidth)) { | |
41 | + } else if (width > that.options.minWidth) { | |
33 | 42 | conditionFullView(that); |
34 | 43 | } |
35 | 44 | } |
... | ... | @@ -37,20 +46,14 @@ |
37 | 46 | resetView(that); |
38 | 47 | }; |
39 | 48 | |
40 | - var checkValuesLessEqual = function (currentValue, targetValue) { | |
41 | - return currentValue <= targetValue; | |
42 | - }; | |
43 | - | |
44 | - var checkValuesGreater = function (currentValue, targetValue) { | |
45 | - return currentValue > targetValue; | |
46 | - }; | |
47 | - | |
48 | 49 | var conditionCardView = function (that) { |
49 | 50 | changeTableView(that, false); |
51 | + showHideColumns(that, false); | |
50 | 52 | }; |
51 | 53 | |
52 | 54 | var conditionFullView = function (that) { |
53 | 55 | changeTableView(that, true); |
56 | + showHideColumns(that, true); | |
54 | 57 | }; |
55 | 58 | |
56 | 59 | var changeTableView = function (that, cardViewState) { |
... | ... | @@ -58,12 +61,27 @@ |
58 | 61 | that.toggleView(); |
59 | 62 | }; |
60 | 63 | |
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 | + | |
61 | 78 | $.extend($.fn.bootstrapTable.defaults, { |
62 | 79 | mobileResponsive: false, |
63 | 80 | minWidth: 562, |
64 | 81 | minHeight: undefined, |
82 | + heightThreshold: 100, // just slightly larger than mobile chrome's auto-hiding toolbar | |
65 | 83 | checkOnInit: true, |
66 | - toggled: false | |
84 | + columnsHidden: [] | |
67 | 85 | }); |
68 | 86 | |
69 | 87 | var BootstrapTable = $.fn.bootstrapTable.Constructor, |
... | ... | @@ -80,13 +98,39 @@ |
80 | 98 | return; |
81 | 99 | } |
82 | 100 | |
83 | - var that = this; | |
84 | - $(window).resize(function () { | |
85 | - changeView(that, $(this).width(), $(this).height()) | |
86 | - }); | |
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)); | |
87 | 125 | |
88 | 126 | if (this.options.checkOnInit) { |
89 | - changeView(this, $(window).width(), $(window).height()); | |
127 | + var height = $(window).height(), | |
128 | + width = $(window).width(); | |
129 | + changeView(this, width, height); | |
130 | + old = { | |
131 | + width: width, | |
132 | + height: height | |
133 | + }; | |
90 | 134 | } |
91 | 135 | }; |
92 | 136 | }(jQuery); |
93 | 137 | \ No newline at end of file |
... | ... |
src/main/resources/static/ajax/libs/bootstrap-table/extensions/reorder/bootstrap-table-reorder.js deleted
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); | |
118 | 0 | \ No newline at end of file |
src/main/resources/static/ajax/libs/bootstrap-table/extensions/reorder/jquery.tablednd.js deleted
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"> </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"> </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/templates/config/corporation/add.html
0 → 100644
src/main/resources/templates/config/corporation/corporation.html
0 → 100644
1 | +<!DOCTYPE HTML> | |
2 | +<html lang="zh" xmlns:th="http://www.thymeleaf.org" xmlns:shiro="http://www.pollix.at/thymeleaf/shiro"> | |
3 | +<meta charset="utf-8"> | |
4 | +<head th:include="include :: header"></head> | |
5 | +<body class="gray-bg"> | |
6 | +<div class="container-div"> | |
7 | + <div class="row"> | |
8 | + <div class="col-sm-12 select-info"> | |
9 | + <form id="customer-form"> | |
10 | + <div class="select-list"> | |
11 | + <ul> | |
12 | + <li> | |
13 | + 编码:<input type="text" name="code"/> | |
14 | + </li> | |
15 | + <li> | |
16 | + 名称:<input type="text" name="name"/> | |
17 | + </li> | |
18 | + <li> | |
19 | + <a class="btn btn-primary btn-rounded btn-sm" onclick="$.table.search()"><i class="fa fa-search"></i> 搜索</a> | |
20 | + <a class="btn btn-warning btn-rounded btn-sm" onclick="$.form.reset('customer-form')"><i class="fa fa-refresh"></i> 重置</a> | |
21 | + </li> | |
22 | + </ul> | |
23 | + </div> | |
24 | + </form> | |
25 | + </div> | |
26 | + | |
27 | + <div class="btn-group hidden-xs" id="toolbar" role="group"> | |
28 | + <a class="btn btn-outline btn-success btn-rounded" onclick="$.operate.add()" shiro:hasPermission="config:customer:add"> | |
29 | + <i class="fa fa-plus"></i> 新增 | |
30 | + </a> | |
31 | + <a class="btn btn-outline btn-danger btn-rounded" onclick="$.operate.batRemove()" shiro:hasPermission="config:customer:remove"> | |
32 | + <i class="fa fa-trash-o"></i> 删除 | |
33 | + </a> | |
34 | + </div> | |
35 | + | |
36 | + <div class="col-sm-12 select-info"> | |
37 | + <table id="bootstrap-table" data-mobile-responsive="true" class="table table-bordered table-hover"></table> | |
38 | + </div> | |
39 | + </div> | |
40 | +</div> | |
41 | +<div th:include="include :: footer"></div> | |
42 | +<script th:inline="javascript"> | |
43 | + var editFlag = [[${@permission.hasPermi('config:customer:edit')}]]; | |
44 | + var removeFlag = [[${@permission.hasPermi('config:customer:remove')}]]; | |
45 | + var prefix = ctx + "config/customer" | |
46 | + var datas = [[${@dict.getType('sys_normal_disable')}]]; | |
47 | + | |
48 | + $(function() { | |
49 | + var options = { | |
50 | + url: prefix + "/list", | |
51 | + createUrl: prefix + "/add", | |
52 | + updateUrl: prefix + "/edit/{id}", | |
53 | + removeUrl: prefix + "/remove", | |
54 | + modalName: "客户", | |
55 | + search: false, | |
56 | + sortName: "id", | |
57 | + sortOrder: "desc", | |
58 | + columns: [{ | |
59 | + checkbox: true | |
60 | + }, | |
61 | + { | |
62 | + field : 'id', | |
63 | + title : 'id' | |
64 | + }, | |
65 | + { | |
66 | + field : 'code', | |
67 | + title : '编码' | |
68 | + }, | |
69 | + { | |
70 | + field : 'shipToCode', | |
71 | + title : '配送点代码' | |
72 | + }, | |
73 | + { | |
74 | + field : 'warehouseCode', | |
75 | + title : '仓库编码', | |
76 | + visible : false | |
77 | + }, | |
78 | + { | |
79 | + field : 'companyCode', | |
80 | + title : '货主代码' | |
81 | + }, | |
82 | + { | |
83 | + field : 'name', | |
84 | + title : '名称' | |
85 | + }, | |
86 | + { | |
87 | + field : 'address1', | |
88 | + title : '地址1' | |
89 | + }, | |
90 | + { | |
91 | + field : 'address2', | |
92 | + title : '地址2' , | |
93 | + visible:false | |
94 | + }, | |
95 | + { | |
96 | + field : 'city', | |
97 | + title : '城市' | |
98 | + }, | |
99 | + { | |
100 | + field : 'province', | |
101 | + title : '省份' , | |
102 | + visible:false | |
103 | + }, | |
104 | + { | |
105 | + field : 'country', | |
106 | + title : '国家' , | |
107 | + visible:false | |
108 | + }, | |
109 | + { | |
110 | + field : 'postalCode', | |
111 | + title : '邮编' , | |
112 | + visible:false | |
113 | + }, | |
114 | + { | |
115 | + field : 'parent', | |
116 | + title : '父', | |
117 | + visible:false | |
118 | + }, | |
119 | + { | |
120 | + field : 'attentionTo', | |
121 | + title : '联系人' | |
122 | + }, | |
123 | + { | |
124 | + field : 'phoneNum', | |
125 | + title : '电话' | |
126 | + }, | |
127 | + { | |
128 | + field : 'mobile', | |
129 | + title : '手机' | |
130 | + }, | |
131 | + { | |
132 | + field : 'faxNum', | |
133 | + title : '传真' , | |
134 | + visible:false | |
135 | + }, | |
136 | + { | |
137 | + field : 'email', | |
138 | + title : 'E-mail' | |
139 | + }, | |
140 | + { | |
141 | + field : 'created', | |
142 | + title : '创建时间' | |
143 | + }, | |
144 | + { | |
145 | + field : 'createdBy', | |
146 | + title : '创建用户' | |
147 | + }, | |
148 | + { | |
149 | + field : 'lastUpdated', | |
150 | + title : '更新时间' | |
151 | + }, | |
152 | + { | |
153 | + field : 'lastUpdatedBy', | |
154 | + title : '更新用户' | |
155 | + }, | |
156 | + { | |
157 | + field : 'enable', | |
158 | + title : '是否有效' , | |
159 | + align: 'center', | |
160 | + formatter: function(value, row, index) { | |
161 | + return $.table.selectDictLabel(datas, value); | |
162 | + } | |
163 | + }, | |
164 | + { | |
165 | + field : 'deleted', | |
166 | + title : '是否删除' , | |
167 | + visible:false | |
168 | + }, | |
169 | + { | |
170 | + field : 'userDef1', | |
171 | + title : '自定义字段1' , | |
172 | + visible:false | |
173 | + }, | |
174 | + { | |
175 | + field : 'userDef2', | |
176 | + title : '自定义字段2' , | |
177 | + visible:false | |
178 | + }, | |
179 | + { | |
180 | + field : 'userDef3', | |
181 | + title : '自定义字段3' , | |
182 | + visible:false | |
183 | + }, | |
184 | + { | |
185 | + title: '操作', | |
186 | + align: 'center', | |
187 | + formatter: function(value, row, index) { | |
188 | + var actions = []; | |
189 | + actions.push('<a class="btn btn-success btn-xs ' + editFlag + '" href="#" onclick="$.operate.edit(\'' + row.id + '\')"><i class="fa fa-edit"></i>编辑</a> '); | |
190 | + actions.push('<a class="btn btn-danger btn-xs ' + removeFlag + '" href="#" onclick="$.operate.remove(\'' + row.id + '\')"><i class="fa fa-trash-o"></i>删除</a>'); | |
191 | + return actions.join(''); | |
192 | + } | |
193 | + }] | |
194 | + }; | |
195 | + $.table.init(options); | |
196 | + }); | |
197 | +</script> | |
198 | +</body> | |
199 | +</html> | |
0 | 200 | \ No newline at end of file |
... | ... |
src/main/resources/templates/config/corporation/edit.html
0 → 100644
src/main/resources/templates/shipment/shipmentHeader/shipmentHeader.html
... | ... | @@ -726,21 +726,6 @@ |
726 | 726 | } |
727 | 727 | |
728 | 728 | |
729 | - function localHeaderSubmit (url, type, dataType, data) { | |
730 | - $.modal.loading("正在处理中,请稍后..."); | |
731 | - var config = { | |
732 | - url: url, type: type, dataType: dataType, data: data, success: function (result) { | |
733 | - if (result.code == web_status.SUCCESS) { | |
734 | - $.modal.msgSuccess(result.msg); | |
735 | - loadDetail(shipmentId, shipmentCode) | |
736 | - } else { | |
737 | - $.modal.alertError(result.msg) | |
738 | - } | |
739 | - $.modal.closeLoading() | |
740 | - } | |
741 | - }; | |
742 | - $.ajax(config) | |
743 | - } | |
744 | 729 | |
745 | 730 | /* 出库组盘 */ |
746 | 731 | function Toshipping(auto) { |
... | ... |
src/main/resources/templates/shipment/shipmentHeaderHistory/shipmentHeaderHistory.html
... | ... | @@ -289,14 +289,14 @@ |
289 | 289 | title: '路线', |
290 | 290 | sortable:true |
291 | 291 | }, |
292 | - { | |
293 | - field: 'totalQty', | |
294 | - title: '总数量' | |
295 | - }, | |
296 | - { | |
297 | - field: 'totalLines', | |
298 | - title: '总行数' | |
299 | - }, | |
292 | + // { | |
293 | + // field: 'totalQty', | |
294 | + // title: '总数量' | |
295 | + // }, | |
296 | + // { | |
297 | + // field: 'totalLines', | |
298 | + // title: '总行数' | |
299 | + // }, | |
300 | 300 | { |
301 | 301 | field: 'firstStatus', |
302 | 302 | title: '头状态', |
... | ... |
src/main/resources/templates/shipment/shippingCombination/combination.html
... | ... | @@ -12,7 +12,7 @@ |
12 | 12 | <ul th:object="${shipmentDetail}"> |
13 | 13 | <li style="display: none"><input type="hidden" id="zoneCode" th:value="*{zoneCode}"></li> |
14 | 14 | <li style="display: none"><input type="hidden" id="shipmentDetailId" th:value="*{id}"></li> |
15 | - <li style="display: none"><input type="hidden" id="inventoryStatus" th:value="*{inventoryStatus}"></li> | |
15 | + <li style="display: none"><input type="hidden" id="inventorySts" th:value="*{inventorySts}"></li> | |
16 | 16 | <li>出库单号:<input type="text" readonly="readonly" id="code" th:value="*{shipmentCode}"></li> |
17 | 17 | <li>存货编码:<input type="text" readonly="readonly" th:value="*{materialCode}"></li> |
18 | 18 | <li>物料名称:<input type="text" readonly="readonly" th:value="*{materialName}"></li> |
... | ... | @@ -62,7 +62,7 @@ |
62 | 62 | </li> |
63 | 63 | <li> |
64 | 64 | 库存状态: |
65 | - <select name="inventoryStatus" th:with="type=${@dict.getType('inventoryStatus')}"> | |
65 | + <select name="inventorySts" th:with="type=${@dict.getType('inventorySts')}"> | |
66 | 66 | <option value="">所有</option> |
67 | 67 | <option th:each="e : ${type}" th:text="${e['dictLabel']}" th:value="${e['dictValue']}"></option> |
68 | 68 | </select> |
... | ... | @@ -93,7 +93,7 @@ |
93 | 93 | <script th:inline="javascript"> |
94 | 94 | var addFlag = [[${@permission.hasPermi('shipment:shippingCombination:combination')}]]; |
95 | 95 | var prefix = ctx + "shipment/shippingCombination"; |
96 | - var inventoryStatus=[[${@dict.getType('inventoryStatus')}]]; | |
96 | + var inventoryStatus=[[${@dict.getType('inventorySts')}]]; | |
97 | 97 | $(function() { |
98 | 98 | $("#bootstrap-table").bootstrapTable({ |
99 | 99 | url: prefix + "/getInventory", |
... | ... | @@ -190,7 +190,7 @@ |
190 | 190 | title : '数量' |
191 | 191 | }, |
192 | 192 | { |
193 | - field : 'status', | |
193 | + field : 'inventorySts', | |
194 | 194 | title : '库存状态' , |
195 | 195 | formatter: function(value, row, index) { |
196 | 196 | return $.table.selectDictLabel(inventoryStatus, value); |
... | ... |
src/main/resources/templates/shipment/shippingCombination/shippingCombination.html
... | ... | @@ -69,7 +69,7 @@ |
69 | 69 | var cancelFlag = [[${@permission.hasPermi('shipment:shippingCombination:remove')}]]; |
70 | 70 | var taskTypeReal=[[${@dict.getType('taskType')}]]; |
71 | 71 | var containerHeaderStatus = [[${@dict.getType('shipmentContainerHeaderStatus')}]]; |
72 | - var inventoryStatus = [[${@dict.getType('inventoryStatus')}]]; | |
72 | + var inventoryStatus = [[${@dict.getType('inventorySts')}]]; | |
73 | 73 | |
74 | 74 | var prefix = ctx + "shipment/shippingCombination"; |
75 | 75 | |
... | ... |
src/main/resources/templates/system/table/editDetails.html
... | ... | @@ -10,13 +10,13 @@ |
10 | 10 | <div class="form-group"> |
11 | 11 | <label class="col-sm-3 control-label">字段名:</label> |
12 | 12 | <div class="col-sm-8"> |
13 | - <input class="form-control" type="text" name="fieldCode" id="tableCode" th:field="*{tableCode}"> | |
13 | + <input class="form-control" type="text" name="fieldCode" id="fieldCode" th:field="*{fieldCode}"> | |
14 | 14 | </div> |
15 | 15 | </div> |
16 | 16 | <div class="form-group"> |
17 | 17 | <label class="col-sm-3 control-label">字段中文名:</label> |
18 | 18 | <div class="col-sm-8"> |
19 | - <input class="form-control" type="text" name="filedName" id="tableName" th:field="*{tableName}" > | |
19 | + <input class="form-control" type="text" name="filedName" id="filedName" th:field="*{filedName}" > | |
20 | 20 | </div> |
21 | 21 | </div> |
22 | 22 | <div class="form-group"> |
... | ... |
src/main/resources/templates/system/table/table.html
... | ... | @@ -49,6 +49,7 @@ |
49 | 49 | </form> |
50 | 50 | </div> |
51 | 51 | <div class="btn-group hidden-xs" id="toolbar" role="group"> |
52 | + <a class="btn btn-outline btn-info btn-rounded" onclick="initialization()" shiro:hasPermission="system:table:add">初始化</a> | |
52 | 53 | <a class="btn btn-outline btn-success btn-rounded" onclick="$.operate.add()" shiro:hasPermission="system:table:add"> |
53 | 54 | <i class="fa fa-plus"></i> 新增 |
54 | 55 | </a> |
... | ... | @@ -296,6 +297,17 @@ |
296 | 297 | $.modal.open("添加表字段信息", detailUpdateUrl+id); |
297 | 298 | } |
298 | 299 | |
300 | + function initialization() { | |
301 | + $.modal.loading("正在处理中,请稍后..."); | |
302 | + let config = { | |
303 | + url: prefix+"/init", | |
304 | + type: 'get', | |
305 | + success: function(result) { | |
306 | + $.operate.ajaxSuccess(result); | |
307 | + } | |
308 | + }; | |
309 | + $.ajax(config) | |
310 | + } | |
299 | 311 | </script> |
300 | 312 | </body> |
301 | 313 | </html> |
302 | 314 | \ No newline at end of file |
... | ... |
src/test/java/com.huaheng.test/BatchCreated.java
... | ... | @@ -6,6 +6,11 @@ package com.huaheng.test; |
6 | 6 | public class BatchCreated { |
7 | 7 | |
8 | 8 | public static void main(String[] args) { |
9 | - | |
9 | + String url = "jdbc:mysql://172.16.29.45:3306/wms_v2?useUnicode=true&characterEncoding=utf8&zeroDateTimeBehavior=convertToNull&useSSL=false&serverTimezone=GMT%2b8"; | |
10 | + String s = url.substring(0,url.indexOf("?")).substring(url.indexOf("3306/")+5); | |
11 | + String u = s.substring(s.indexOf("3306/")+5); | |
12 | + | |
13 | + System.out.println(s); | |
14 | + | |
10 | 15 | } |
11 | 16 | } |
... | ... |