Commit f9aeede97045455276634b2e228565bbc1155366
Merge branch 'minhang' of 192.168.168.201:panzhaov5/bsth_control into
minhang # Conflicts: # src/main/resources/static/pages/forms/statement/changetochange.html
Showing
34 changed files
with
3870 additions
and
347 deletions
Too many changes to show.
To preserve performance only 34 of 91 files are displayed.
src/main/java/com/bsth/controller/BusIntervalController.java
0 → 100644
| 1 | +package com.bsth.controller; | ||
| 2 | + | ||
| 3 | +import java.util.List; | ||
| 4 | +import java.util.Map; | ||
| 5 | + | ||
| 6 | +import org.springframework.beans.factory.annotation.Autowired; | ||
| 7 | +import org.springframework.web.bind.annotation.RequestMapping; | ||
| 8 | +import org.springframework.web.bind.annotation.RequestMethod; | ||
| 9 | +import org.springframework.web.bind.annotation.RequestParam; | ||
| 10 | +import org.springframework.web.bind.annotation.RestController; | ||
| 11 | + | ||
| 12 | +import com.bsth.service.BusIntervalService; | ||
| 13 | + | ||
| 14 | +@RestController | ||
| 15 | +@RequestMapping("busInterval") | ||
| 16 | +public class BusIntervalController { | ||
| 17 | + | ||
| 18 | + @Autowired | ||
| 19 | + private BusIntervalService busIntervalService; | ||
| 20 | + | ||
| 21 | + @RequestMapping(value = "/getDir", method = RequestMethod.GET) | ||
| 22 | + public List<Map<String,Object>> getDir(@RequestParam Map<String, Object> map){ | ||
| 23 | + return busIntervalService.getDir(map); | ||
| 24 | + } | ||
| 25 | + | ||
| 26 | + @RequestMapping(value = "/interval", method = RequestMethod.GET) | ||
| 27 | + public List<Map<String,Object>> interval(@RequestParam Map<String, Object> map){ | ||
| 28 | + return busIntervalService.interval(map); | ||
| 29 | + } | ||
| 30 | + | ||
| 31 | + @RequestMapping(value = "/timeAndSpeed", method = RequestMethod.GET) | ||
| 32 | + public Map<String,Object> timeAndSpeed(@RequestParam Map<String, Object> map){ | ||
| 33 | + return busIntervalService.timeAndSpeed(map); | ||
| 34 | + } | ||
| 35 | + | ||
| 36 | + @RequestMapping(value = "/lineTimeAnaliy", method = RequestMethod.GET) | ||
| 37 | + public List<Map<String,Object>> lineTimeAnaliy(@RequestParam Map<String, Object> map){ | ||
| 38 | + return busIntervalService.lineTimeAnaliy(map); | ||
| 39 | + } | ||
| 40 | + | ||
| 41 | + @RequestMapping(value = "/lbStatuAnaly", method = RequestMethod.GET) | ||
| 42 | + public List<Map<String,Object>> lbStatuAnaly(@RequestParam Map<String, Object> map){ | ||
| 43 | + return busIntervalService.lbStatuAnaly(map); | ||
| 44 | + } | ||
| 45 | + | ||
| 46 | + @RequestMapping(value = "/correctStatis", method = RequestMethod.GET) | ||
| 47 | + public List<Map<String,Object>> correctStatis(@RequestParam Map<String, Object> map){ | ||
| 48 | + return busIntervalService.correctStatis(map); | ||
| 49 | + } | ||
| 50 | + | ||
| 51 | +} |
src/main/java/com/bsth/controller/report/ReportController.java
| @@ -48,5 +48,25 @@ public class ReportController { | @@ -48,5 +48,25 @@ public class ReportController { | ||
| 48 | @RequestParam String code) { | 48 | @RequestParam String code) { |
| 49 | return service.historyMessageCount(line, date, code); | 49 | return service.historyMessageCount(line, date, code); |
| 50 | } | 50 | } |
| 51 | + | ||
| 52 | + @RequestMapping(value = "/tbodyTime1", method = RequestMethod.GET) | ||
| 53 | + public Map<String, Object> tbodyTime1(@RequestParam String line,@RequestParam String date) { | ||
| 54 | + return service.tbodyTime1(line, date); | ||
| 55 | + } | ||
| 56 | + | ||
| 57 | + @RequestMapping(value = "/tbodyTime2", method = RequestMethod.GET) | ||
| 58 | + public Map<String, Object> tbodyTime2(@RequestParam String line,@RequestParam String date) { | ||
| 59 | + return service.tbodyTime2(line, date); | ||
| 60 | + } | ||
| 61 | + | ||
| 62 | + @RequestMapping(value = "/tbodyTime3", method = RequestMethod.GET) | ||
| 63 | + public List<Map<String, Object>> tbodyTime3(@RequestParam String line,@RequestParam String date) { | ||
| 64 | + return service.tbodyTime3(line, date); | ||
| 65 | + } | ||
| 66 | + | ||
| 67 | + @RequestMapping(value = "/tbodyTime5", method = RequestMethod.GET) | ||
| 68 | + public List<Map<String, Object>> tbodyTime5(@RequestParam String line,@RequestParam String date) { | ||
| 69 | + return service.tbodyTime5(line, date); | ||
| 70 | + } | ||
| 51 | 71 | ||
| 52 | } | 72 | } |
src/main/java/com/bsth/controller/sys/UserController.java
| @@ -73,9 +73,13 @@ public class UserController extends BaseController<SysUser, Integer> { | @@ -73,9 +73,13 @@ public class UserController extends BaseController<SysUser, Integer> { | ||
| 73 | } | 73 | } |
| 74 | 74 | ||
| 75 | //解密RSA | 75 | //解密RSA |
| 76 | - userName = RSAUtils.decryptBase64(userName); | ||
| 77 | - password = RSAUtils.decryptBase64(password); | ||
| 78 | - | 76 | + try { |
| 77 | + userName = RSAUtils.decryptBase64(userName); | ||
| 78 | + password = RSAUtils.decryptBase64(password); | ||
| 79 | + } catch (RuntimeException e) { | ||
| 80 | + return put(rs, "msg", "decrypt RSA fail!可能页面已过期,尝试刷新页面。"); | ||
| 81 | + } | ||
| 82 | + | ||
| 79 | SysUser user = sysUserService.findByUserName(userName); | 83 | SysUser user = sysUserService.findByUserName(userName); |
| 80 | if (null == user) | 84 | if (null == user) |
| 81 | return put(rs, "msg", "不存在的用户"); | 85 | return put(rs, "msg", "不存在的用户"); |
src/main/java/com/bsth/data/BasicData.java
| @@ -25,6 +25,12 @@ import java.util.concurrent.TimeUnit; | @@ -25,6 +25,12 @@ import java.util.concurrent.TimeUnit; | ||
| 25 | */ | 25 | */ |
| 26 | @Component | 26 | @Component |
| 27 | public class BasicData implements CommandLineRunner { | 27 | public class BasicData implements CommandLineRunner { |
| 28 | + | ||
| 29 | + //公司代码和公司名对照(K: 公司编码,V:公司名) | ||
| 30 | + public static Map<String, String> businessCodeNameMap; | ||
| 31 | + | ||
| 32 | + //分公司公司代码和分公司公司名对照(K: 公司编码+分公司编码,V:分公司公司名) | ||
| 33 | + public static Map<String, String> businessFgsCodeNameMap; | ||
| 28 | 34 | ||
| 29 | //设备号和车辆自编号 (K: 设备编码 ,V:车辆自编号) | 35 | //设备号和车辆自编号 (K: 设备编码 ,V:车辆自编号) |
| 30 | public static BiMap<String, String> deviceId2NbbmMap; | 36 | public static BiMap<String, String> deviceId2NbbmMap; |
| @@ -107,6 +113,9 @@ public class BasicData implements CommandLineRunner { | @@ -107,6 +113,9 @@ public class BasicData implements CommandLineRunner { | ||
| 107 | 113 | ||
| 108 | @Autowired | 114 | @Autowired |
| 109 | PersonnelRepository personnelRepository; | 115 | PersonnelRepository personnelRepository; |
| 116 | + | ||
| 117 | + @Autowired | ||
| 118 | + BusinessRepository businessRepository; | ||
| 110 | 119 | ||
| 111 | 120 | ||
| 112 | @Override | 121 | @Override |
| @@ -132,6 +141,8 @@ public class BasicData implements CommandLineRunner { | @@ -132,6 +141,8 @@ public class BasicData implements CommandLineRunner { | ||
| 132 | loadStationRouteInfo(); | 141 | loadStationRouteInfo(); |
| 133 | //人员信息 | 142 | //人员信息 |
| 134 | loadPersonnelInfo(); | 143 | loadPersonnelInfo(); |
| 144 | + //公司信息 | ||
| 145 | + loadBusinessInfo(); | ||
| 135 | logger.info("加载基础数据成功!,"); | 146 | logger.info("加载基础数据成功!,"); |
| 136 | } catch (Exception e) { | 147 | } catch (Exception e) { |
| 137 | logger.error("加载基础数据时出现异常,", e); | 148 | logger.error("加载基础数据时出现异常,", e); |
| @@ -164,6 +175,23 @@ public class BasicData implements CommandLineRunner { | @@ -164,6 +175,23 @@ public class BasicData implements CommandLineRunner { | ||
| 164 | } | 175 | } |
| 165 | 176 | ||
| 166 | /** | 177 | /** |
| 178 | + * loadBusinessInfo | ||
| 179 | + * (公司代码公司名对照) | ||
| 180 | + */ | ||
| 181 | + public void loadBusinessInfo(){ | ||
| 182 | + Map<String, String> businessMap=new HashMap<String,String>(); | ||
| 183 | + Map<String, String> businessFgsMap=new HashMap<String,String>(); | ||
| 184 | + Iterator<Business> busIter=businessRepository.findAll().iterator(); | ||
| 185 | + Business t; | ||
| 186 | + while(busIter.hasNext()){ | ||
| 187 | + t=busIter.next(); | ||
| 188 | + businessMap.put(t.getBusinessCode(), t.getBusinessName()); | ||
| 189 | + businessFgsMap.put(t.getBusinessCode()+"_"+t.getUpCode(), t.getBusinessName()); | ||
| 190 | + } | ||
| 191 | + businessCodeNameMap=businessMap; | ||
| 192 | + businessFgsCodeNameMap=businessFgsMap; | ||
| 193 | + } | ||
| 194 | + /** | ||
| 167 | * @Title: loadDeviceInfo | 195 | * @Title: loadDeviceInfo |
| 168 | * @Description: TODO(加载设备相关信息) | 196 | * @Description: TODO(加载设备相关信息) |
| 169 | */ | 197 | */ |
src/main/java/com/bsth/data/forecast/ForecastRealServer.java
| @@ -61,7 +61,7 @@ public class ForecastRealServer implements CommandLineRunner { | @@ -61,7 +61,7 @@ public class ForecastRealServer implements CommandLineRunner { | ||
| 61 | @Override | 61 | @Override |
| 62 | public void run(String... arg0) throws Exception { | 62 | public void run(String... arg0) throws Exception { |
| 63 | //2小时更新一次站点间耗时数据 | 63 | //2小时更新一次站点间耗时数据 |
| 64 | - Application.mainServices.scheduleWithFixedDelay(dataLoader, 12, 120 * 60, TimeUnit.SECONDS); | 64 | +// Application.mainServices.scheduleWithFixedDelay(dataLoader, 12, 120 * 60, TimeUnit.SECONDS); |
| 65 | } | 65 | } |
| 66 | 66 | ||
| 67 | /** | 67 | /** |
src/main/java/com/bsth/data/schedule/DayOfSchedule.java
| @@ -117,13 +117,13 @@ public class DayOfSchedule implements CommandLineRunner { | @@ -117,13 +117,13 @@ public class DayOfSchedule implements CommandLineRunner { | ||
| 117 | @Override | 117 | @Override |
| 118 | public void run(String... arg0) throws Exception { | 118 | public void run(String... arg0) throws Exception { |
| 119 | //翻班线程 | 119 | //翻班线程 |
| 120 | - Application.mainServices.scheduleWithFixedDelay(scheduleRefreshThread, 15, 240, TimeUnit.SECONDS); | 120 | +// Application.mainServices.scheduleWithFixedDelay(scheduleRefreshThread, 15, 240, TimeUnit.SECONDS); |
| 121 | //入库 | 121 | //入库 |
| 122 | - Application.mainServices.scheduleWithFixedDelay(schedulePstThread, 60, 60, TimeUnit.SECONDS); | 122 | +// Application.mainServices.scheduleWithFixedDelay(schedulePstThread, 60, 60, TimeUnit.SECONDS); |
| 123 | //首班出场指令补发器 | 123 | //首班出场指令补发器 |
| 124 | - Application.mainServices.scheduleWithFixedDelay(firstScheduleCheckThread, 30, 240, TimeUnit.SECONDS); | 124 | +// Application.mainServices.scheduleWithFixedDelay(firstScheduleCheckThread, 30, 240, TimeUnit.SECONDS); |
| 125 | //班次误点扫描 | 125 | //班次误点扫描 |
| 126 | - Application.mainServices.scheduleWithFixedDelay(scheduleLateThread, 60, 60, TimeUnit.SECONDS); | 126 | +// Application.mainServices.scheduleWithFixedDelay(scheduleLateThread, 60, 60, TimeUnit.SECONDS); |
| 127 | 127 | ||
| 128 | //每天凌晨2点20提交数据到运管处 | 128 | //每天凌晨2点20提交数据到运管处 |
| 129 | long diff = (DateUtils.getTimestamp() + 1000*60*140) - System.currentTimeMillis(); | 129 | long diff = (DateUtils.getTimestamp() + 1000*60*140) - System.currentTimeMillis(); |
| @@ -472,7 +472,6 @@ public class DayOfSchedule implements CommandLineRunner { | @@ -472,7 +472,6 @@ public class DayOfSchedule implements CommandLineRunner { | ||
| 472 | } | 472 | } |
| 473 | 473 | ||
| 474 | public void put(ScheduleRealInfo sch) { | 474 | public void put(ScheduleRealInfo sch) { |
| 475 | - | ||
| 476 | schAttrCalculator | 475 | schAttrCalculator |
| 477 | .calcRealDate(sch) | 476 | .calcRealDate(sch) |
| 478 | .calcAllTimeByFcsj(sch); | 477 | .calcAllTimeByFcsj(sch); |
src/main/java/com/bsth/data/schedule/SchAttrCalculator.java
| 1 | package com.bsth.data.schedule; | 1 | package com.bsth.data.schedule; |
| 2 | 2 | ||
| 3 | -import java.text.ParseException; | ||
| 4 | -import java.util.ArrayList; | ||
| 5 | -import java.util.Collections; | ||
| 6 | -import java.util.List; | ||
| 7 | - | 3 | +import com.bsth.data.LineConfigData; |
| 4 | +import com.bsth.entity.realcontrol.LineConfig; | ||
| 5 | +import com.bsth.entity.realcontrol.ScheduleRealInfo; | ||
| 8 | import org.joda.time.format.DateTimeFormat; | 6 | import org.joda.time.format.DateTimeFormat; |
| 9 | import org.joda.time.format.DateTimeFormatter; | 7 | import org.joda.time.format.DateTimeFormatter; |
| 10 | import org.slf4j.Logger; | 8 | import org.slf4j.Logger; |
| @@ -12,9 +10,10 @@ import org.slf4j.LoggerFactory; | @@ -12,9 +10,10 @@ import org.slf4j.LoggerFactory; | ||
| 12 | import org.springframework.beans.factory.annotation.Autowired; | 10 | import org.springframework.beans.factory.annotation.Autowired; |
| 13 | import org.springframework.stereotype.Component; | 11 | import org.springframework.stereotype.Component; |
| 14 | 12 | ||
| 15 | -import com.bsth.data.LineConfigData; | ||
| 16 | -import com.bsth.entity.realcontrol.LineConfig; | ||
| 17 | -import com.bsth.entity.realcontrol.ScheduleRealInfo; | 13 | +import java.text.ParseException; |
| 14 | +import java.util.ArrayList; | ||
| 15 | +import java.util.Collections; | ||
| 16 | +import java.util.List; | ||
| 18 | 17 | ||
| 19 | /** | 18 | /** |
| 20 | * | 19 | * |
| @@ -49,11 +48,30 @@ public class SchAttrCalculator { | @@ -49,11 +48,30 @@ public class SchAttrCalculator { | ||
| 49 | if (null == sch.getFcsjT()) | 48 | if (null == sch.getFcsjT()) |
| 50 | calcFcsjTime(sch); | 49 | calcFcsjTime(sch); |
| 51 | 50 | ||
| 52 | - | 51 | + //計發時間 |
| 53 | if(sch.getFcsj().compareTo(conf.getStartOpt()) < 0){ | 52 | if(sch.getFcsj().compareTo(conf.getStartOpt()) < 0){ |
| 54 | sch.setFcsjAll(fmtyyyyMMddHHmm.parseMillis(sch.getScheduleDateStr()+sch.getFcsj()) + DAY_TIME); | 53 | sch.setFcsjAll(fmtyyyyMMddHHmm.parseMillis(sch.getScheduleDateStr()+sch.getFcsj()) + DAY_TIME); |
| 55 | } | 54 | } |
| 56 | - | 55 | + |
| 56 | + //待發時間 | ||
| 57 | + if(sch.getDfsj().compareTo(conf.getStartOpt()) < 0){ | ||
| 58 | + sch.setDfsjAll(fmtyyyyMMddHHmm.parseMillis(sch.getScheduleDateStr()+sch.getDfsj()) + DAY_TIME); | ||
| 59 | + } | ||
| 60 | + else | ||
| 61 | + sch.setDfsjAll(fmtyyyyMMddHHmm.parseMillis(sch.getScheduleDateStr()+sch.getDfsj())); | ||
| 62 | + | ||
| 63 | + //實發時間 | ||
| 64 | + if(sch.getFcsjActual() != null && | ||
| 65 | + sch.getFcsjActual().compareTo(conf.getStartOpt()) < 0){ | ||
| 66 | + sch.setFcsjActualAll(fmtyyyyMMddHHmm.parseMillis(sch.getScheduleDateStr()+sch.getFcsjActual()) + DAY_TIME); | ||
| 67 | + } | ||
| 68 | + | ||
| 69 | + //實際終點時間 | ||
| 70 | + if(sch.getZdsjActual() != null && | ||
| 71 | + sch.getZdsjActual().compareTo(conf.getStartOpt()) < 0){ | ||
| 72 | + sch.setZdsjActualAll(fmtyyyyMMddHHmm.parseMillis(sch.getScheduleDateStr()+sch.getZdsjActual()) + DAY_TIME); | ||
| 73 | + } | ||
| 74 | + | ||
| 57 | sch.setRealExecDate(fmtyyyyMMdd.print(sch.getFcsjT())); | 75 | sch.setRealExecDate(fmtyyyyMMdd.print(sch.getFcsjT())); |
| 58 | } catch (Exception e) { | 76 | } catch (Exception e) { |
| 59 | logger.error("", e); | 77 | logger.error("", e); |
src/main/java/com/bsth/entity/oil/Ylb.java
| @@ -291,7 +291,7 @@ public class Ylb { | @@ -291,7 +291,7 @@ public class Ylb { | ||
| 291 | } | 291 | } |
| 292 | 292 | ||
| 293 | public String getGsname() { | 293 | public String getGsname() { |
| 294 | - return BasicData.nbbm2CompanyCodeMap.get(this.nbbm); | 294 | + return BasicData.businessCodeNameMap.get(this.ssgsdm); |
| 295 | } | 295 | } |
| 296 | 296 | ||
| 297 | public void setGsname(String gsname) { | 297 | public void setGsname(String gsname) { |
src/main/java/com/bsth/service/BusIntervalService.java
0 → 100644
| 1 | +package com.bsth.service; | ||
| 2 | + | ||
| 3 | +import java.util.List; | ||
| 4 | +import java.util.Map; | ||
| 5 | + | ||
| 6 | + | ||
| 7 | +public interface BusIntervalService { | ||
| 8 | + | ||
| 9 | + List<Map<String, Object>> getDir(Map<String, Object> map); | ||
| 10 | + | ||
| 11 | + List<Map<String, Object>> interval(Map<String, Object> map); | ||
| 12 | + | ||
| 13 | + Map<String, Object> timeAndSpeed(Map<String, Object> map); | ||
| 14 | + | ||
| 15 | + List<Map<String, Object>> lineTimeAnaliy(Map<String, Object> map); | ||
| 16 | + | ||
| 17 | + List<Map<String, Object>> lbStatuAnaly(Map<String, Object> map); | ||
| 18 | + | ||
| 19 | + List<Map<String, Object>> correctStatis(Map<String, Object> map); | ||
| 20 | +} |
src/main/java/com/bsth/service/impl/BusIntervalServiceImpl.java
0 → 100644
| 1 | +package com.bsth.service.impl; | ||
| 2 | + | ||
| 3 | +import java.sql.ResultSet; | ||
| 4 | +import java.sql.SQLException; | ||
| 5 | +import java.text.DecimalFormat; | ||
| 6 | +import java.text.SimpleDateFormat; | ||
| 7 | +import java.util.ArrayList; | ||
| 8 | +import java.util.Collections; | ||
| 9 | +import java.util.Comparator; | ||
| 10 | +import java.util.Date; | ||
| 11 | +import java.util.HashMap; | ||
| 12 | +import java.util.List; | ||
| 13 | +import java.util.Map; | ||
| 14 | + | ||
| 15 | +import org.springframework.beans.factory.annotation.Autowired; | ||
| 16 | +import org.springframework.jdbc.core.JdbcTemplate; | ||
| 17 | +import org.springframework.jdbc.core.RowMapper; | ||
| 18 | +import org.springframework.stereotype.Service; | ||
| 19 | + | ||
| 20 | +import com.bsth.entity.realcontrol.ScheduleRealInfo; | ||
| 21 | +import com.bsth.entity.schedule.TTInfoDetail; | ||
| 22 | +import com.bsth.repository.realcontrol.ScheduleRealInfoRepository; | ||
| 23 | +import com.bsth.service.BusIntervalService; | ||
| 24 | +import com.bsth.service.schedule.PeopleCarPlanService; | ||
| 25 | + | ||
| 26 | + | ||
| 27 | +@Service | ||
| 28 | +public class BusIntervalServiceImpl implements BusIntervalService { | ||
| 29 | + | ||
| 30 | + @Autowired | ||
| 31 | + private PeopleCarPlanService peopleCarPlanService; | ||
| 32 | + | ||
| 33 | + @Autowired | ||
| 34 | + private ScheduleRealInfoRepository scheduleRealInfoRepository; | ||
| 35 | + | ||
| 36 | + @Autowired | ||
| 37 | + private JdbcTemplate jdbcTemplate; | ||
| 38 | + | ||
| 39 | + private SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd"); | ||
| 40 | + private DecimalFormat df = new DecimalFormat("##0.00"); | ||
| 41 | + | ||
| 42 | + public List<ScheduleRealInfo> getSchedule(String line, String startDate, String endDate, String model, String times){ | ||
| 43 | + List<TTInfoDetail> ttList = new ArrayList<TTInfoDetail>(); | ||
| 44 | + List<ScheduleRealInfo> list = new ArrayList<ScheduleRealInfo>(); | ||
| 45 | + List<ScheduleRealInfo> resList = new ArrayList<ScheduleRealInfo>(); | ||
| 46 | + | ||
| 47 | + try { | ||
| 48 | + | ||
| 49 | + String sql = "select * from bsth_c_s_sp_info_real where DATE_FORMAT(schedule_date,'%Y-%m-%d') >= '"+startDate+"' and DATE_FORMAT(schedule_date,'%Y-%m-%d') <= '"+endDate+"'"; | ||
| 50 | + if(line.length() != 0){ | ||
| 51 | + sql += " and xl_bm = '"+line+"'"; | ||
| 52 | + } | ||
| 53 | + if(times.length() != 0){ | ||
| 54 | + String[] split = times.split("-"); | ||
| 55 | + sql += " and fcsj >= '"+split[0]+"' and fcsj <= '"+split[1]+"'"; | ||
| 56 | + } | ||
| 57 | + sql += " and bc_type = 'normal'"; | ||
| 58 | + | ||
| 59 | + list =jdbcTemplate.query(sql, | ||
| 60 | + new RowMapper<ScheduleRealInfo>(){ | ||
| 61 | + @Override | ||
| 62 | + public ScheduleRealInfo mapRow(ResultSet rs, int rowNum) throws SQLException { | ||
| 63 | + ScheduleRealInfo schedule = new ScheduleRealInfo(); | ||
| 64 | + schedule.setScheduleDateStr(rs.getString("schedule_date_Str")); | ||
| 65 | + schedule.setXlName(rs.getString("xl_name")); | ||
| 66 | + schedule.setLpName(rs.getString("lp_name")); | ||
| 67 | + schedule.setBcType(rs.getString("bc_type")); | ||
| 68 | + schedule.setBcs(rs.getInt("bcs")); | ||
| 69 | + schedule.setBcsj(rs.getInt("bcsj")); | ||
| 70 | + schedule.setJhlc(rs.getDouble("jhlc")); | ||
| 71 | + schedule.setDfsj(rs.getString("dfsj")); | ||
| 72 | + schedule.setFcsj(rs.getString("fcsj")); | ||
| 73 | + schedule.setFcsjActual(rs.getString("fcsj_actual")); | ||
| 74 | + schedule.setZdsj(rs.getString("zdsj")); | ||
| 75 | + schedule.setZdsjActual(rs.getString("zdsj_actual")); | ||
| 76 | + schedule.setQdzName(rs.getString("qdz_name")); | ||
| 77 | + schedule.setZdzName(rs.getString("zdz_name")); | ||
| 78 | + schedule.setXlDir(rs.getString("xl_dir")); | ||
| 79 | + schedule.setStatus(rs.getInt("status")); | ||
| 80 | + schedule.setRemarks(rs.getString("remarks")); | ||
| 81 | + schedule.setGsName(rs.getString("gs_name")); | ||
| 82 | + schedule.setFgsName(rs.getString("fgs_name")); | ||
| 83 | + schedule.setDfAuto(rs.getBoolean("df_auto")); | ||
| 84 | + schedule.setOnline(rs.getBoolean("online")); | ||
| 85 | + schedule.setClZbh(rs.getString("cl_zbh")); | ||
| 86 | + schedule.setjGh(rs.getString("j_gh")); | ||
| 87 | + schedule.setjName(rs.getString("j_name")); | ||
| 88 | + return schedule; | ||
| 89 | + } | ||
| 90 | + }); | ||
| 91 | + | ||
| 92 | + if(model.length() != 0){ | ||
| 93 | + sql = "select * from bsth_c_s_ttinfo_detail where ttinfo = '"+model+"' and bc_type = 'normal'"; | ||
| 94 | + | ||
| 95 | + ttList =jdbcTemplate.query(sql, | ||
| 96 | + new RowMapper<TTInfoDetail>(){ | ||
| 97 | + @Override | ||
| 98 | + public TTInfoDetail mapRow(ResultSet rs, int rowNum) throws SQLException { | ||
| 99 | + TTInfoDetail ttInfo = new TTInfoDetail(); | ||
| 100 | + ttInfo.setBcType(rs.getString("bc_type")); | ||
| 101 | + ttInfo.setBcs(rs.getInt("bcs")); | ||
| 102 | + ttInfo.setFcsj(rs.getString("fcsj")); | ||
| 103 | + ttInfo.setBcsj(rs.getInt("bcsj")); | ||
| 104 | + return ttInfo; | ||
| 105 | + } | ||
| 106 | + }); | ||
| 107 | + } | ||
| 108 | + | ||
| 109 | + } catch (Exception e) { | ||
| 110 | + // TODO Auto-generated catch block | ||
| 111 | + e.printStackTrace(); | ||
| 112 | + } | ||
| 113 | + | ||
| 114 | + //分组计算 同时判断是否所选时刻信息 | ||
| 115 | + for(ScheduleRealInfo schedule : list){ | ||
| 116 | + if(schedule.getFcsj() == null) | ||
| 117 | + continue; | ||
| 118 | + String[] fcsj = schedule.getFcsj().split(":"); | ||
| 119 | + String[] zdsj = schedule.getZdsj().split(":"); | ||
| 120 | + schedule.setFcsjT((Long.valueOf(fcsj[0]) * 60) + Long.valueOf(fcsj[1])); | ||
| 121 | + schedule.setZdsjT((Long.valueOf(zdsj[0]) * 60) + Long.valueOf(zdsj[1])); | ||
| 122 | + if(schedule.getFcsjActual() != null){ | ||
| 123 | + String[] fcsj_ = schedule.getFcsjActual().split(":"); | ||
| 124 | + schedule.setFcsjActualTime((Long.valueOf(fcsj_[0]) * 60) + Long.valueOf(fcsj_[1])); | ||
| 125 | + } | ||
| 126 | + if(schedule.getZdsjActual() != null){ | ||
| 127 | + String[] zdsj_ = schedule.getZdsjActual().split(":"); | ||
| 128 | + schedule.setZdsjActualTime((Long.valueOf(zdsj_[0]) * 60) + Long.valueOf(zdsj_[1])); | ||
| 129 | + } | ||
| 130 | + if(schedule.getDfsj() != null){ | ||
| 131 | + String[] dfsj = schedule.getDfsj().split(":"); | ||
| 132 | + schedule.setDfsjT((Long.valueOf(dfsj[0]) * 60) + Long.valueOf(dfsj[1])); | ||
| 133 | + } | ||
| 134 | + DO:{ | ||
| 135 | + if(model.length() != 0){ | ||
| 136 | + for(TTInfoDetail tt : ttList){ | ||
| 137 | + if(tt.getBcs() == schedule.getBcs() && tt.getFcsj().equals(schedule.getFcsj()) | ||
| 138 | + && tt.getBcsj() == schedule.getBcsj()){ | ||
| 139 | + resList.add(schedule); | ||
| 140 | + break DO; | ||
| 141 | + } | ||
| 142 | + } | ||
| 143 | + } else { | ||
| 144 | + resList.add(schedule); | ||
| 145 | + } | ||
| 146 | + } | ||
| 147 | + } | ||
| 148 | + | ||
| 149 | + list = new ArrayList<ScheduleRealInfo>(); | ||
| 150 | + List<Long> keyList = new ArrayList<Long>(); | ||
| 151 | + Map<Long, List<ScheduleRealInfo>> keyMap = new HashMap<Long, List<ScheduleRealInfo>>(); | ||
| 152 | + for(ScheduleRealInfo schedule : resList){ | ||
| 153 | + Long key = schedule.getFcsjT(); | ||
| 154 | + if(!keyMap.containsKey(key)){ | ||
| 155 | + keyMap.put(key, new ArrayList<ScheduleRealInfo>()); | ||
| 156 | + keyList.add(key); | ||
| 157 | + } | ||
| 158 | + keyMap.get(key).add(schedule); | ||
| 159 | + } | ||
| 160 | + Collections.sort(keyList); | ||
| 161 | + for(Long key : keyList){ | ||
| 162 | + for(ScheduleRealInfo schedule : keyMap.get(key)){ | ||
| 163 | + list.add(schedule); | ||
| 164 | + } | ||
| 165 | + } | ||
| 166 | + | ||
| 167 | + return list; | ||
| 168 | + } | ||
| 169 | + | ||
| 170 | + @Override | ||
| 171 | + public List<Map<String, Object>> getDir(Map<String, Object> map) { | ||
| 172 | + List<Map<String, Object>> resList = new ArrayList<Map<String, Object>>(); | ||
| 173 | + List<Map<String, Object>> list = new ArrayList<Map<String, Object>>(); | ||
| 174 | + | ||
| 175 | + String line = map.get("line").toString(); | ||
| 176 | + | ||
| 177 | + try { | ||
| 178 | + | ||
| 179 | + String sql = "select start_station_name, end_station_name from bsth_c_line where line_code = '"+line+"'"; | ||
| 180 | + | ||
| 181 | + list =jdbcTemplate.query(sql, | ||
| 182 | + new RowMapper<Map<String, Object>>(){ | ||
| 183 | + @Override | ||
| 184 | + public Map<String, Object> mapRow(ResultSet rs, int rowNum) throws SQLException { | ||
| 185 | + Map<String, Object> m = new HashMap<String, Object>(); | ||
| 186 | + m.put("startStation", rs.getString("start_station_name")); | ||
| 187 | + m.put("endStation", rs.getString("end_station_name")); | ||
| 188 | + return m; | ||
| 189 | + } | ||
| 190 | + }); | ||
| 191 | + | ||
| 192 | + } catch (Exception e) { | ||
| 193 | + // TODO Auto-generated catch block | ||
| 194 | + e.printStackTrace(); | ||
| 195 | + } | ||
| 196 | + | ||
| 197 | + for(Map<String, Object> m : list){ | ||
| 198 | + Map<String, Object> tempMap1 = new HashMap<String, Object>(); | ||
| 199 | + Map<String, Object> tempMap2 = new HashMap<String, Object>(); | ||
| 200 | + tempMap1.put("name", m.get("startStation")); | ||
| 201 | + tempMap2.put("name", m.get("endStation")); | ||
| 202 | + resList.add(tempMap1); | ||
| 203 | + resList.add(tempMap2); | ||
| 204 | + } | ||
| 205 | + | ||
| 206 | + return resList; | ||
| 207 | + } | ||
| 208 | + | ||
| 209 | + @Override | ||
| 210 | + public List<Map<String, Object>> interval(Map<String, Object> map) { | ||
| 211 | + List<Map<String, Object>> resList = new ArrayList<Map<String, Object>>(); | ||
| 212 | + Map<String, List<ScheduleRealInfo>> keyMap = new HashMap<String, List<ScheduleRealInfo>>(); | ||
| 213 | + | ||
| 214 | + String line = map.get("line").toString(); | ||
| 215 | + String startDate = map.get("startDate").toString(); | ||
| 216 | + String endDate = map.get("endDate").toString(); | ||
| 217 | + String model = map.get("model").toString(); | ||
| 218 | + String times = map.get("times").toString(); | ||
| 219 | + String type = map.get("type").toString(); | ||
| 220 | + | ||
| 221 | + if(startDate.length() == 0){ | ||
| 222 | + startDate = new SimpleDateFormat("yyyy-MM-dd").format(new Date()); | ||
| 223 | + } | ||
| 224 | + if(endDate.length() == 0){ | ||
| 225 | + endDate = new SimpleDateFormat("yyyy-MM-dd").format(new Date()); | ||
| 226 | + } | ||
| 227 | + if(times.length() == 0){ | ||
| 228 | + times = "06:00-07:00"; | ||
| 229 | + } | ||
| 230 | + | ||
| 231 | + List<ScheduleRealInfo> list = this.getSchedule(line, startDate, endDate, model, times); | ||
| 232 | + | ||
| 233 | + String[] date1 = startDate.split("-"); | ||
| 234 | + String[] date2 = endDate.split("-"); | ||
| 235 | + startDate = date1[0] + "年" + date1[1] + "月" + date1[2] + "日"; | ||
| 236 | + endDate = date2[0] + "年" + date2[1] + "月" + date2[2] + "日"; | ||
| 237 | + | ||
| 238 | + String[] split = times.split("-"); | ||
| 239 | + int startTime = Integer.valueOf(split[0].split(":")[0])*60 + Integer.valueOf(split[0].split(":")[1]); | ||
| 240 | + int endTime = Integer.valueOf(split[1].split(":")[0])*60 + Integer.valueOf(split[1].split(":")[1]); | ||
| 241 | + | ||
| 242 | + //分组统计班次间隔 | ||
| 243 | + for(ScheduleRealInfo schedule : list){ | ||
| 244 | + long fcsj = schedule.getFcsjT(); | ||
| 245 | + if(endTime != 0?(fcsj >= startTime && fcsj <= endTime):(fcsj >= startTime)){ | ||
| 246 | + String key = schedule.getXlName() + "/" + schedule.getQdzName(); | ||
| 247 | + if(!keyMap.containsKey(key)) | ||
| 248 | + keyMap.put(key, new ArrayList<ScheduleRealInfo>()); | ||
| 249 | + keyMap.get(key).add(schedule); | ||
| 250 | + } | ||
| 251 | + } | ||
| 252 | + for(String key : keyMap.keySet()){ | ||
| 253 | + long jhInterval = 0; | ||
| 254 | + long sjInterval = 0; | ||
| 255 | + int jhNum = 0; | ||
| 256 | + int sjNum = 0; | ||
| 257 | + String company = "", subCompany = ""; | ||
| 258 | + Map<String, Object> tempMap = new HashMap<String, Object>(); | ||
| 259 | + Map<String, List<ScheduleRealInfo>> temp = new HashMap<String, List<ScheduleRealInfo>>(); | ||
| 260 | + for(ScheduleRealInfo schedule : keyMap.get(key)){ | ||
| 261 | + String date = schedule.getScheduleDateStr(); | ||
| 262 | + if(!temp.containsKey(date)) | ||
| 263 | + temp.put(date, new ArrayList<ScheduleRealInfo>()); | ||
| 264 | + temp.get(date).add(schedule); | ||
| 265 | + } | ||
| 266 | + for(String date : temp.keySet()){ | ||
| 267 | + List<ScheduleRealInfo> tempList = temp.get(date); | ||
| 268 | + for(int i = 1; i < tempList.size(); i++){ | ||
| 269 | + jhNum++; | ||
| 270 | + ScheduleRealInfo schedule1 = tempList.get(i - 1); | ||
| 271 | + ScheduleRealInfo schedule2 = tempList.get(i); | ||
| 272 | + if(schedule1.getGsName() != null && company.length() == 0) | ||
| 273 | + company = schedule1.getGsName(); | ||
| 274 | + if(schedule1.getFgsName() != null && subCompany.length() == 0) | ||
| 275 | + subCompany = schedule1.getFgsName(); | ||
| 276 | + jhInterval += schedule2.getFcsjT(); | ||
| 277 | + jhInterval -= schedule1.getFcsjT(); | ||
| 278 | + if(schedule1.getFcsjActual()!=null && schedule2.getFcsjActual()!=null){ | ||
| 279 | + sjNum++; | ||
| 280 | + sjInterval += schedule2.getFcsjActualTime(); | ||
| 281 | + sjInterval -= schedule1.getFcsjActualTime(); | ||
| 282 | + } | ||
| 283 | + } | ||
| 284 | + } | ||
| 285 | + if(startDate.equals(endDate)) | ||
| 286 | + tempMap.put("date", startDate); | ||
| 287 | + else | ||
| 288 | + tempMap.put("date", startDate + "--" + endDate); | ||
| 289 | + String[] keys = key.split("/"); | ||
| 290 | + tempMap.put("line", keys[0]); | ||
| 291 | + tempMap.put("qdz", keys[1]); | ||
| 292 | + tempMap.put("times", times); | ||
| 293 | + tempMap.put("company", company); | ||
| 294 | + tempMap.put("subCompany", subCompany); | ||
| 295 | + if(jhNum != 0) | ||
| 296 | + tempMap.put("jhInterval", jhInterval/jhNum); | ||
| 297 | + else | ||
| 298 | + tempMap.put("jhInterval", "/"); | ||
| 299 | + if(sjNum != 0){ | ||
| 300 | + tempMap.put("sjInterval", sjInterval/sjNum); | ||
| 301 | + tempMap.put("deviation", sjInterval/sjNum - jhInterval/jhNum); | ||
| 302 | + } | ||
| 303 | + else{ | ||
| 304 | + tempMap.put("sjInterval", "/"); | ||
| 305 | + tempMap.put("deviation", "/"); | ||
| 306 | + } | ||
| 307 | + if(tempMap.get("jhInterval") != null && !tempMap.get("jhInterval").toString().equals("0") && !tempMap.get("jhInterval").toString().equals("/")) | ||
| 308 | + resList.add(tempMap); | ||
| 309 | + } | ||
| 310 | + | ||
| 311 | + //排序 | ||
| 312 | + Map<String, List<Map<String, Object>>> temp = new HashMap<String, List<Map<String, Object>>>(); | ||
| 313 | + List<Map<String, Object>> tempList = new ArrayList<Map<String, Object>>(); | ||
| 314 | + for(Map<String, Object> m : resList){ | ||
| 315 | + String key = m.get("line").toString(); | ||
| 316 | + if(!temp.containsKey(key)) | ||
| 317 | + temp.put(key, new ArrayList<Map<String, Object>>()); | ||
| 318 | + temp.get(key).add(m); | ||
| 319 | + } | ||
| 320 | + for(String key : temp.keySet()){ | ||
| 321 | + for(Map<String, Object> m : temp.get(key)){ | ||
| 322 | + tempList.add(m); | ||
| 323 | + } | ||
| 324 | + } | ||
| 325 | + | ||
| 326 | + return tempList; | ||
| 327 | + } | ||
| 328 | + | ||
| 329 | + @Override | ||
| 330 | + public Map<String, Object> timeAndSpeed(Map<String, Object> map) { | ||
| 331 | + List<Map<String, Object>> resList = new ArrayList<Map<String, Object>>(); | ||
| 332 | + List<Map<String, Object>> dateList = new ArrayList<Map<String, Object>>(); | ||
| 333 | + Map<String, List<ScheduleRealInfo>> keyMap = new HashMap<String, List<ScheduleRealInfo>>(); | ||
| 334 | + Map<String, Object> modelMap = new HashMap<String, Object>(); | ||
| 335 | + | ||
| 336 | + String line = map.get("line").toString(); | ||
| 337 | + String startDate = map.get("startDate").toString(); | ||
| 338 | + String endDate = map.get("endDate").toString(); | ||
| 339 | + String model = map.get("model").toString(); | ||
| 340 | + String times = map.get("times").toString(); | ||
| 341 | + String type = map.get("type").toString(); | ||
| 342 | + String zdzName = map.get("upDown").toString(); | ||
| 343 | + | ||
| 344 | + if(startDate.length() == 0){ | ||
| 345 | + startDate = new SimpleDateFormat("yyyy-MM-dd").format(new Date()); | ||
| 346 | + } | ||
| 347 | + if(endDate.length() == 0){ | ||
| 348 | + endDate = new SimpleDateFormat("yyyy-MM-dd").format(new Date()); | ||
| 349 | + } | ||
| 350 | + if(times.length() == 0){ | ||
| 351 | + times = "06:00-07:00"; | ||
| 352 | + } | ||
| 353 | + | ||
| 354 | + List<ScheduleRealInfo> list = this.getSchedule(line, startDate, endDate, model, times); | ||
| 355 | + | ||
| 356 | + String[] date1 = startDate.split("-"); | ||
| 357 | + String[] date2 = endDate.split("-"); | ||
| 358 | + startDate = date1[0] + "年" + date1[1] + "月" + date1[2] + "日"; | ||
| 359 | + endDate = date2[0] + "年" + date2[1] + "月" + date2[2] + "日"; | ||
| 360 | + | ||
| 361 | + String[] split = times.split("-"); | ||
| 362 | + int startTime = Integer.valueOf(split[0].split(":")[0])*60 + Integer.valueOf(split[0].split(":")[1]); | ||
| 363 | + int endTime = Integer.valueOf(split[1].split(":")[0])*60 + Integer.valueOf(split[1].split(":")[1]); | ||
| 364 | + | ||
| 365 | + for(ScheduleRealInfo schedule : list){ | ||
| 366 | + if(zdzName.length() != 0 && !zdzName.equals(schedule.getZdzName())){ | ||
| 367 | + continue; | ||
| 368 | + } | ||
| 369 | + int fcsj = Integer.valueOf(schedule.getFcsjT() + ""); | ||
| 370 | + if(!(endTime != 0?(fcsj >= startTime && fcsj < endTime):(fcsj >= startTime))){ | ||
| 371 | + continue; | ||
| 372 | + } | ||
| 373 | + String key = schedule.getXlName() + "/" + schedule.getLpName() + "/" + schedule.getZdzName(); | ||
| 374 | + if(!keyMap.containsKey(key)){ | ||
| 375 | + keyMap.put(key, new ArrayList<ScheduleRealInfo>()); | ||
| 376 | + } | ||
| 377 | + keyMap.get(key).add(schedule); | ||
| 378 | + } | ||
| 379 | + | ||
| 380 | + long yysjSum = 0; | ||
| 381 | + double yysdSum = 0; | ||
| 382 | + long yssjSum = 0; | ||
| 383 | + double yssdSum = 0; | ||
| 384 | + for(String key : keyMap.keySet()){ | ||
| 385 | + Map<String, Object> tempMap = new HashMap<String, Object>(); | ||
| 386 | + long yysj = 0; | ||
| 387 | + double yysd = 0; | ||
| 388 | + long yssj = 0; | ||
| 389 | + double yssd = 0; | ||
| 390 | + int yyNum = 0; | ||
| 391 | + int ysNum = 0; | ||
| 392 | + String company = "", subCompany = ""; | ||
| 393 | + for(ScheduleRealInfo schedule : keyMap.get(key)){ | ||
| 394 | + if(schedule.getGsName() != null && company.length() == 0) | ||
| 395 | + company = schedule.getGsName(); | ||
| 396 | + if(schedule.getFgsName() != null && subCompany.length() == 0) | ||
| 397 | + subCompany = schedule.getFgsName(); | ||
| 398 | + if(!tempMap.containsKey("xlDir")) | ||
| 399 | + tempMap.put("xlDir", schedule.getXlDir()); | ||
| 400 | + if(!tempMap.containsKey("qdz_zdz") && schedule.getXlDir().equals("0")) | ||
| 401 | + tempMap.put("qdz_zdz", schedule.getQdzName() + "--" + schedule.getZdzName()); | ||
| 402 | + else if(!tempMap.containsKey("qdz_zdz")) | ||
| 403 | + tempMap.put("qdz_zdz", schedule.getZdzName() + "--" + schedule.getQdzName()); | ||
| 404 | + if(schedule.getBcsj() != null && schedule.getJhlc() != null){ | ||
| 405 | + int bcsj = schedule.getBcsj(); | ||
| 406 | + double jhlc = schedule.getJhlc(); | ||
| 407 | + yysd += jhlc/bcsj; | ||
| 408 | + yysj += bcsj; | ||
| 409 | + yyNum++; | ||
| 410 | + if(schedule.getFcsjActual() != null && schedule.getZdsjActual() != null){ | ||
| 411 | + long time = schedule.getZdsjActualTime() - schedule.getFcsjActualTime(); | ||
| 412 | + yssd += jhlc/time; | ||
| 413 | + yssj += time; | ||
| 414 | + ysNum++; | ||
| 415 | + } | ||
| 416 | + } | ||
| 417 | + } | ||
| 418 | + if(startTime != endTime) | ||
| 419 | + tempMap.put("date", startDate + "--" + endDate); | ||
| 420 | + else | ||
| 421 | + tempMap.put("date", startDate); | ||
| 422 | + tempMap.put("times", times); | ||
| 423 | + String[] keys = key.split("/"); | ||
| 424 | + tempMap.put("line", keys[0]); | ||
| 425 | + tempMap.put("lp", keys[1]); | ||
| 426 | + tempMap.put("zdz", keys[2]); | ||
| 427 | + tempMap.put("company", company); | ||
| 428 | + tempMap.put("subCompany", subCompany); | ||
| 429 | + | ||
| 430 | + tempMap.put("yysj", (yysj/60) + "小时" + (yysj%60) + "分钟"); | ||
| 431 | + yysjSum += yysj; | ||
| 432 | + if(yyNum != 0){ | ||
| 433 | + tempMap.put("yysd", df.format((yysd/yyNum)*60) + "公里/小时"); | ||
| 434 | + yysdSum += Double.valueOf(df.format((yysd/yyNum)*60)); | ||
| 435 | + } else { | ||
| 436 | + tempMap.put("yysd", "/"); | ||
| 437 | + } | ||
| 438 | + | ||
| 439 | + tempMap.put("yssj", (yssj/60) + "小时" + (yssj%60) + "分钟"); | ||
| 440 | + yssjSum += yssj; | ||
| 441 | + if(ysNum != 0){ | ||
| 442 | + tempMap.put("yssd", df.format((yssd/ysNum)*60) + "公里/小时"); | ||
| 443 | + yssdSum += Double.valueOf(df.format((yssd/ysNum)*60)); | ||
| 444 | + } else { | ||
| 445 | + tempMap.put("yssd", "/"); | ||
| 446 | + } | ||
| 447 | + | ||
| 448 | + dateList.add(tempMap); | ||
| 449 | + } | ||
| 450 | + int size = keyMap.keySet().size(); | ||
| 451 | + size = size == 0 ? 1 : size; | ||
| 452 | + modelMap.put("yysj", (yysjSum/size)/60 + "小时" + (yysjSum/size)%60 + "分钟"); | ||
| 453 | + modelMap.put("yysd", df.format(yysdSum/size) + "公里/小时"); | ||
| 454 | + modelMap.put("yssj", (yssjSum/size)/60 + "小时" + (yssjSum/size)%60 + "分钟"); | ||
| 455 | + modelMap.put("yssd", df.format(yssdSum/size) + "公里/小时"); | ||
| 456 | + | ||
| 457 | + Map<String, List<Map<String, Object>>> keyMap2 = new HashMap<String, List<Map<String, Object>>>(); | ||
| 458 | + for(Map<String, Object> m : dateList){ | ||
| 459 | + String key = m.get("line").toString(); | ||
| 460 | + if(!keyMap2.containsKey(key)) | ||
| 461 | + keyMap2.put(key, new ArrayList<Map<String, Object>>()); | ||
| 462 | + keyMap2.get(key).add(m); | ||
| 463 | + } | ||
| 464 | + for(String key : keyMap2.keySet()){ | ||
| 465 | + List<Integer> keyList = new ArrayList<Integer>(); | ||
| 466 | + Map<Integer, List<Map<String, Object>>> temp = new HashMap<Integer, List<Map<String,Object>>>(); | ||
| 467 | + for(Map<String, Object> m : keyMap2.get(key)){ | ||
| 468 | + Integer num = Integer.valueOf(m.get("lp").toString())*10+Integer.valueOf(m.get("xlDir").toString()); | ||
| 469 | + if(!temp.containsKey(num)){ | ||
| 470 | + temp.put(num, new ArrayList<Map<String, Object>>()); | ||
| 471 | + keyList.add(num); | ||
| 472 | + } | ||
| 473 | + temp.get(num).add(m); | ||
| 474 | + } | ||
| 475 | + Collections.sort(keyList); | ||
| 476 | + for(Integer lp : keyList){ | ||
| 477 | + List<Map<String, Object>> tempList = temp.get(lp); | ||
| 478 | + for(Map<String, Object> m : tempList){ | ||
| 479 | + resList.add(m); | ||
| 480 | + } | ||
| 481 | + } | ||
| 482 | + } | ||
| 483 | + | ||
| 484 | + modelMap.put("dateList", resList); | ||
| 485 | + return modelMap; | ||
| 486 | + } | ||
| 487 | + | ||
| 488 | + @Override | ||
| 489 | + public List<Map<String, Object>> lineTimeAnaliy(Map<String, Object> map) { | ||
| 490 | + List<Map<String, Object>> list0 = new ArrayList<Map<String,Object>>(); | ||
| 491 | + List<Map<String, Object>> resList = new ArrayList<Map<String, Object>>(); | ||
| 492 | + List<ScheduleRealInfo> list = new ArrayList<ScheduleRealInfo>(); | ||
| 493 | + Map<String, List<ScheduleRealInfo>> keyMap = new HashMap<String, List<ScheduleRealInfo>>(); | ||
| 494 | + Map<String, List<Map<String, Object>>> keyMap0 = new HashMap<String, List<Map<String, Object>>>(); | ||
| 495 | + Map<String, List<Map<String, Object>>> keyMap1 = new HashMap<String, List<Map<String, Object>>>(); | ||
| 496 | + | ||
| 497 | + String line = map.get("line").toString(); | ||
| 498 | + String startDate = map.get("startDate").toString(); | ||
| 499 | + String endDate = map.get("endDate").toString(); | ||
| 500 | + String model = map.get("model").toString(); | ||
| 501 | + String times = map.get("times").toString(); | ||
| 502 | + String type = map.get("type").toString(); | ||
| 503 | + String qdzName = map.get("upDown").toString(); | ||
| 504 | + | ||
| 505 | + if(startDate.length() == 0){ | ||
| 506 | + startDate = new SimpleDateFormat("yyyy-MM-dd").format(new Date()); | ||
| 507 | + } | ||
| 508 | + if(endDate.length() == 0){ | ||
| 509 | + endDate = new SimpleDateFormat("yyyy-MM-dd").format(new Date()); | ||
| 510 | + } | ||
| 511 | + if(times.length() == 0){ | ||
| 512 | + times = "06:00-07:00"; | ||
| 513 | + } | ||
| 514 | + | ||
| 515 | + list = getSchedule(line, startDate, endDate, model, times); | ||
| 516 | + | ||
| 517 | + String[] date1 = startDate.split("-"); | ||
| 518 | + String[] date2 = endDate.split("-"); | ||
| 519 | + startDate = date1[0] + "年" + date1[1] + "月" + date1[2] + "日"; | ||
| 520 | + endDate = date2[0] + "年" + date2[1] + "月" + date2[2] + "日"; | ||
| 521 | + | ||
| 522 | + String[] split = times.split("-"); | ||
| 523 | + int startTime = Integer.valueOf(split[0].split(":")[0])*60 + Integer.valueOf(split[0].split(":")[1]); | ||
| 524 | + int endTime = Integer.valueOf(split[1].split(":")[0])*60 + Integer.valueOf(split[1].split(":")[1]); | ||
| 525 | + | ||
| 526 | + | ||
| 527 | + for(ScheduleRealInfo schedule : list){ | ||
| 528 | + if(qdzName.length() != 0 && !qdzName.equals(schedule.getQdzName())){ | ||
| 529 | + continue; | ||
| 530 | + } | ||
| 531 | + Long fcsj = schedule.getFcsjT(); | ||
| 532 | + if(!(endTime!=0?fcsj>=startTime&&fcsj<endTime:fcsj>=startTime)){ | ||
| 533 | + continue; | ||
| 534 | + } | ||
| 535 | + String key = schedule.getScheduleDateStr() + "/" + schedule.getXlName() + "/" + schedule.getLpName() + "/" + schedule.getFcsj() + "/" + schedule.getQdzName(); | ||
| 536 | + if(!keyMap.containsKey(key)) | ||
| 537 | + keyMap.put(key, new ArrayList<ScheduleRealInfo>()); | ||
| 538 | + keyMap.get(key).add(schedule); | ||
| 539 | + } | ||
| 540 | + for(String key : keyMap.keySet()){ | ||
| 541 | + Map<String, Object> tempMap = new HashMap<String, Object>(); | ||
| 542 | + int jhbc = 0; | ||
| 543 | + int sjbc = 0; | ||
| 544 | + int kbc = 0; | ||
| 545 | + int mbc = 0; | ||
| 546 | + long jhdf = 0l; | ||
| 547 | + long sjdf = 0l; | ||
| 548 | + long wddf1 = 0l; | ||
| 549 | + long wddf2 = 0l; | ||
| 550 | + long jhfc = 0l; | ||
| 551 | + long sjfc = 0l; | ||
| 552 | + long wdfc1 = 0l; | ||
| 553 | + long wdfc2 = 0l; | ||
| 554 | + long jhys = 0l; | ||
| 555 | + long sjys = 0l; | ||
| 556 | + long yssjMax = 0l; | ||
| 557 | + long yssjMin = 0l; | ||
| 558 | + long jhtz = 0l; | ||
| 559 | + long sjtz = 0l; | ||
| 560 | + long tzsjMax = 0l; | ||
| 561 | + long tzsjMin = 0l; | ||
| 562 | + String company = "", subCompany = ""; | ||
| 563 | + for(ScheduleRealInfo schedule : keyMap.get(key)){ | ||
| 564 | + if(schedule.getGsName() != null && company.length() == 0) | ||
| 565 | + company = schedule.getGsName(); | ||
| 566 | + if(schedule.getFgsName() != null && subCompany.length() == 0) | ||
| 567 | + subCompany = schedule.getFgsName(); | ||
| 568 | + long tzsj = 0l; | ||
| 569 | + long yssj = 0l; | ||
| 570 | + jhbc++; | ||
| 571 | + if(schedule.getDfsj() != null){ | ||
| 572 | + jhtz += schedule.getFcsjT() - schedule.getDfsjT(); | ||
| 573 | + } | ||
| 574 | + jhys += schedule.getZdsjT() - schedule.getFcsjT(); | ||
| 575 | + | ||
| 576 | + if(schedule.getFcsjActual() != null && schedule.getZdsjActual() != null){ | ||
| 577 | + sjbc++; | ||
| 578 | + sjfc += schedule.getFcsjActualTime(); | ||
| 579 | + yssj += schedule.getZdsjActualTime() - schedule.getFcsjActualTime(); | ||
| 580 | + if(schedule.getFcsjActualTime() - schedule.getFcsjT() < 0){ | ||
| 581 | + wdfc1 += schedule.getFcsjT() - schedule.getFcsjActualTime(); | ||
| 582 | + kbc++; | ||
| 583 | + } else if(schedule.getFcsjActualTime() - schedule.getFcsjT() > 0){ | ||
| 584 | + wdfc2 += schedule.getFcsjActualTime() - schedule.getFcsjT(); | ||
| 585 | + mbc++; | ||
| 586 | + } | ||
| 587 | + | ||
| 588 | + if(schedule.getDfsj() != null){ | ||
| 589 | + sjdf += schedule.getDfsjT(); | ||
| 590 | + tzsj += schedule.getFcsjActualTime() - schedule.getDfsjT(); | ||
| 591 | + if(schedule.getDfsjT() - schedule.getFcsjT() < 0) | ||
| 592 | + wddf1 += schedule.getFcsjT() - schedule.getDfsjT(); | ||
| 593 | + else | ||
| 594 | + wddf2 += schedule.getDfsjT() - schedule.getFcsjT(); | ||
| 595 | + } else { | ||
| 596 | + sjdf += schedule.getFcsjT(); | ||
| 597 | + tzsj += schedule.getFcsjActualTime() - schedule.getFcsjT(); | ||
| 598 | + } | ||
| 599 | + } | ||
| 600 | + | ||
| 601 | + sjys += yssj; | ||
| 602 | + if(yssj > yssjMax || yssjMax == 0l) | ||
| 603 | + yssjMax = yssj; | ||
| 604 | + if(yssj < yssjMin || yssjMin == 0l) | ||
| 605 | + yssjMin = yssj; | ||
| 606 | + | ||
| 607 | + sjtz += tzsj; | ||
| 608 | + if(tzsj > tzsjMax || tzsjMax == 0l) | ||
| 609 | + tzsjMax = tzsj; | ||
| 610 | + if(tzsj < tzsjMin || tzsjMin == 0l) | ||
| 611 | + tzsjMin = tzsj; | ||
| 612 | + } | ||
| 613 | + String[] keys = key.split("/"); | ||
| 614 | + tempMap.put("date", keys[0]); | ||
| 615 | + tempMap.put("line", keys[1]); | ||
| 616 | + tempMap.put("lp", keys[2]); | ||
| 617 | + tempMap.put("jhdf", keys[3]); | ||
| 618 | + tempMap.put("jhfc", keys[3]); | ||
| 619 | + tempMap.put("station", keys[4]); | ||
| 620 | + tempMap.put("times", times); | ||
| 621 | + tempMap.put("company", company); | ||
| 622 | + tempMap.put("subCompany", subCompany); | ||
| 623 | + if(startDate.equals(endDate)) | ||
| 624 | + tempMap.put("dates", startDate); | ||
| 625 | + else | ||
| 626 | + tempMap.put("dates", startDate + "--" + endDate); | ||
| 627 | + tempMap.put("jhbc", jhbc); | ||
| 628 | + tempMap.put("sjbc", sjbc); | ||
| 629 | + if(sjbc != 0){ | ||
| 630 | + tempMap.put("sjdf", ((sjdf/sjbc)/60<10?"0"+(sjdf/sjbc)/60:(sjdf/sjbc)/60) + ":" + ((sjdf/sjbc)%60<10?"0"+(sjdf/sjbc)%60:(sjdf/sjbc)%60)); | ||
| 631 | + tempMap.put("wddf1", wddf1 / sjbc + "分"); | ||
| 632 | + tempMap.put("wddf2", wddf2 / sjbc + "分"); | ||
| 633 | + tempMap.put("sjfc", ((sjfc/sjbc)/60<10?"0"+(sjfc/sjbc)/60:(sjfc/sjbc)/60) + ":" + ((sjfc/sjbc)%60<10?"0"+(sjfc/sjbc)%60:(sjfc/sjbc)%60)); | ||
| 634 | + tempMap.put("wdfc1", wdfc1 / sjbc + "分"); | ||
| 635 | + tempMap.put("wdfc2", wdfc2 / sjbc + "分"); | ||
| 636 | +// tempMap.put("kbc", df.format((((double) kbc)/sjbc)*100)+"%"); | ||
| 637 | +// tempMap.put("mbc", df.format((((double) mbc)/sjbc)*100)+"%"); | ||
| 638 | + tempMap.put("pjys", sjys / sjbc + "分"); | ||
| 639 | + tempMap.put("pjtz", sjtz / sjbc + "分"); | ||
| 640 | + } else { | ||
| 641 | + tempMap.put("sjdf", "/"); | ||
| 642 | + tempMap.put("wddf1", "0分"); | ||
| 643 | + tempMap.put("wddf2", "0分"); | ||
| 644 | + tempMap.put("sjfc", "/"); | ||
| 645 | + tempMap.put("wdfc1", "0分"); | ||
| 646 | + tempMap.put("wdfc2", "0分"); | ||
| 647 | +// tempMap.put("kbc", "0%"); | ||
| 648 | +// tempMap.put("mbc", "0%"); | ||
| 649 | + tempMap.put("pjys", "0分"); | ||
| 650 | + tempMap.put("pjtz", "0分"); | ||
| 651 | + } | ||
| 652 | + tempMap.put("kbc", kbc); | ||
| 653 | + tempMap.put("mbc", mbc); | ||
| 654 | + tempMap.put("jhys", jhys); | ||
| 655 | + tempMap.put("sjys", sjys); | ||
| 656 | + tempMap.put("yssjMin", yssjMin); | ||
| 657 | + tempMap.put("yssjMax", yssjMax); | ||
| 658 | + tempMap.put("jhtz", jhtz); | ||
| 659 | + tempMap.put("sjtz", sjtz); | ||
| 660 | + tempMap.put("tzsjMax", tzsjMax); | ||
| 661 | + tempMap.put("tzsjMin", tzsjMin); | ||
| 662 | + list0.add(tempMap); | ||
| 663 | + } | ||
| 664 | + | ||
| 665 | + Collections.sort(list0, new Comparator<Map<String, Object>>() { | ||
| 666 | + | ||
| 667 | + public int compare(Map<String, Object> o1, Map<String, Object> o2) { | ||
| 668 | + | ||
| 669 | + String[] split1 = o1.get("date").toString().split("-"); | ||
| 670 | + String[] split2 = o2.get("date").toString().split("-"); | ||
| 671 | + Long a = Long.valueOf(split1[0])*10000 + Long.valueOf(split1[1])*100 + Long.valueOf(split1[2]); | ||
| 672 | + Long b = Long.valueOf(split2[0])*10000 + Long.valueOf(split2[1])*100 + Long.valueOf(split2[2]); | ||
| 673 | + | ||
| 674 | + // 升序 | ||
| 675 | + return a.compareTo(b); | ||
| 676 | + } | ||
| 677 | + }); | ||
| 678 | + | ||
| 679 | + for(Map<String, Object> m : list0){ | ||
| 680 | + String key = m.get("line").toString() + "/" + m.get("lp").toString() + "/" + m.get("station").toString(); | ||
| 681 | + if(!keyMap0.containsKey(key)) | ||
| 682 | + keyMap0.put(key, new ArrayList<Map<String, Object>>()); | ||
| 683 | + keyMap0.get(key).add(m); | ||
| 684 | + } | ||
| 685 | + for(String key : keyMap0.keySet()){ | ||
| 686 | + Map<String, Object> tempMap = new HashMap<String, Object>(); | ||
| 687 | + int jhbc = 0; | ||
| 688 | + int sjbc = 0; | ||
| 689 | + int wddf1 = 0; | ||
| 690 | + int wddf2 = 0; | ||
| 691 | + int wdfc1 = 0; | ||
| 692 | + int wdfc2 = 0; | ||
| 693 | + int ys = 0; | ||
| 694 | + int tz = 0; | ||
| 695 | + String company = ""; | ||
| 696 | + for(Map<String, Object> m : keyMap0.get(key)){ | ||
| 697 | + if(m.containsKey("company") && company.length() == 0) | ||
| 698 | + company = m.get("company").toString(); | ||
| 699 | + jhbc += Integer.valueOf(m.get("jhbc").toString()); | ||
| 700 | + sjbc += Integer.valueOf(m.get("sjbc").toString()); | ||
| 701 | + wddf1 += Integer.valueOf(m.get("wddf1").toString().substring(0, m.get("wddf1").toString().length() - 1)); | ||
| 702 | + wddf2 += Integer.valueOf(m.get("wddf2").toString().substring(0, m.get("wddf2").toString().length() - 1)); | ||
| 703 | + wdfc1 += Integer.valueOf(m.get("wdfc1").toString().substring(0, m.get("wdfc1").toString().length() - 1)); | ||
| 704 | + wdfc2 += Integer.valueOf(m.get("wdfc2").toString().substring(0, m.get("wdfc2").toString().length() - 1)); | ||
| 705 | + ys += Integer.valueOf(m.get("pjys").toString().substring(0, m.get("pjys").toString().length() - 1)); | ||
| 706 | + tz += Integer.valueOf(m.get("pjtz").toString().substring(0, m.get("pjtz").toString().length() - 1)); | ||
| 707 | + } | ||
| 708 | + if(startDate.equals(endDate)) | ||
| 709 | + tempMap.put("dates", startDate); | ||
| 710 | + else | ||
| 711 | + tempMap.put("dates", startDate + "--" + endDate); | ||
| 712 | + tempMap.put("company", company); | ||
| 713 | + String[] keys = key.split("/"); | ||
| 714 | + tempMap.put("line", keys[0]); | ||
| 715 | + tempMap.put("lp", keys[1]); | ||
| 716 | + tempMap.put("station", keys[2]); | ||
| 717 | + tempMap.put("times", times); | ||
| 718 | + tempMap.put("jhbc", jhbc); | ||
| 719 | + tempMap.put("sjbc", sjbc); | ||
| 720 | + tempMap.put("wddf1", wddf1/keyMap0.get(key).size()+"分"); | ||
| 721 | + tempMap.put("wddf2", wddf2/keyMap0.get(key).size()+"分"); | ||
| 722 | + tempMap.put("wdfc1", wdfc1/keyMap0.get(key).size()+"分"); | ||
| 723 | + tempMap.put("wdfc2", wdfc2/keyMap0.get(key).size()+"分"); | ||
| 724 | + tempMap.put("pjys", ys/keyMap0.get(key).size()+"分"); | ||
| 725 | + tempMap.put("pjtz", tz/keyMap0.get(key).size()+"分"); | ||
| 726 | + tempMap.put("workList", keyMap0.get(key)); | ||
| 727 | + | ||
| 728 | + String key1 = tempMap.get("line").toString(); | ||
| 729 | + if(!keyMap1.containsKey(key1)) | ||
| 730 | + keyMap1.put(key1, new ArrayList<Map<String, Object>>()); | ||
| 731 | + keyMap1.get(key1).add(tempMap); | ||
| 732 | + } | ||
| 733 | + | ||
| 734 | + for(String key : keyMap1.keySet()){ | ||
| 735 | + Collections.sort(keyMap1.get(key), new Comparator<Map<String, Object>>() { | ||
| 736 | + | ||
| 737 | + public int compare(Map<String, Object> o1, Map<String, Object> o2) { | ||
| 738 | + | ||
| 739 | + Integer a = Integer.valueOf(o1.get("lp").toString()); | ||
| 740 | + Integer b = Integer.valueOf(o2.get("lp").toString()); | ||
| 741 | + | ||
| 742 | + // 升序 | ||
| 743 | + return a.compareTo(b); | ||
| 744 | + } | ||
| 745 | + }); | ||
| 746 | + | ||
| 747 | + resList.addAll(keyMap1.get(key)); | ||
| 748 | + } | ||
| 749 | + | ||
| 750 | + | ||
| 751 | + return resList; | ||
| 752 | + } | ||
| 753 | + | ||
| 754 | + @Override | ||
| 755 | + public List<Map<String, Object>> lbStatuAnaly(Map<String, Object> map) { | ||
| 756 | + List<Map<String, Object>> resList = new ArrayList<Map<String, Object>>(); | ||
| 757 | + List<ScheduleRealInfo> list = new ArrayList<ScheduleRealInfo>(); | ||
| 758 | + Map<String, List<ScheduleRealInfo>> keyMap = new HashMap<String, List<ScheduleRealInfo>>(); | ||
| 759 | + | ||
| 760 | + String line = map.get("line").toString(); | ||
| 761 | + String startDate = map.get("startDate").toString(); | ||
| 762 | + String endDate = map.get("endDate").toString(); | ||
| 763 | + String model = map.get("model").toString(); | ||
| 764 | + String times = map.get("times").toString(); | ||
| 765 | + String type = map.get("type").toString(); | ||
| 766 | + | ||
| 767 | + if(startDate.length() == 0){ | ||
| 768 | + startDate = new SimpleDateFormat("yyyy-MM-dd").format(new Date()); | ||
| 769 | + } | ||
| 770 | + if(endDate.length() == 0){ | ||
| 771 | + endDate = new SimpleDateFormat("yyyy-MM-dd").format(new Date()); | ||
| 772 | + } | ||
| 773 | + if(times.length() == 0){ | ||
| 774 | + times = "06:00-07:00"; | ||
| 775 | + } | ||
| 776 | + | ||
| 777 | + list = getSchedule(line, startDate, endDate, model, times); | ||
| 778 | + | ||
| 779 | + String[] date1 = startDate.split("-"); | ||
| 780 | + String[] date2 = endDate.split("-"); | ||
| 781 | + startDate = date1[0] + "年" + date1[1] + "月" + date1[2] + "日"; | ||
| 782 | + endDate = date2[0] + "年" + date2[1] + "月" + date2[2] + "日"; | ||
| 783 | + | ||
| 784 | + String[] split = times.split("-"); | ||
| 785 | + int startTime = Integer.valueOf(split[0].split(":")[0])*60 + Integer.valueOf(split[0].split(":")[1]); | ||
| 786 | + int endTime = Integer.valueOf(split[1].split(":")[0])*60 + Integer.valueOf(split[1].split(":")[1]); | ||
| 787 | + | ||
| 788 | + for(ScheduleRealInfo schedule : list){ | ||
| 789 | + Long fcsj = schedule.getFcsjT(); | ||
| 790 | + if(!(endTime!=0?fcsj>=startTime&&fcsj<endTime:fcsj>=startTime)){ | ||
| 791 | + continue; | ||
| 792 | + } | ||
| 793 | + String key = schedule.getXlName(); | ||
| 794 | + if(!keyMap.containsKey(key)) | ||
| 795 | + keyMap.put(key, new ArrayList<ScheduleRealInfo>()); | ||
| 796 | + keyMap.get(key).add(schedule); | ||
| 797 | + } | ||
| 798 | + for(String key : keyMap.keySet()){ | ||
| 799 | + Map<String, Object> tempMap = new HashMap<String, Object>(); | ||
| 800 | + int jhbc = 0; | ||
| 801 | + int sjbc = 0; | ||
| 802 | + int jhlc = 0; | ||
| 803 | + int sjlc = 0; | ||
| 804 | + int lzbc = 0, lzlc = 0, dmbc = 0, dmlc = 0, | ||
| 805 | + gzbc = 0, gzlc = 0, jfbc = 0, jflc = 0, | ||
| 806 | + zsbc = 0, zslc = 0, qrbc = 0, qrlc = 0, | ||
| 807 | + qcbc = 0, qclc = 0, kxbc = 0, kxlc = 0, | ||
| 808 | + qhbc = 0, qhlc = 0, wybc = 0, wylc = 0; | ||
| 809 | + int qtbc = 0, qtlc = 0; | ||
| 810 | + String company = "", subCompany = ""; | ||
| 811 | + for(ScheduleRealInfo schedule : keyMap.get(key)){ | ||
| 812 | + if(schedule.getGsName() != null && company.length() == 0) | ||
| 813 | + company = schedule.getGsName(); | ||
| 814 | + if(schedule.getFgsName() != null && subCompany.length() == 0) | ||
| 815 | + subCompany = schedule.getFgsName(); | ||
| 816 | + jhbc++; | ||
| 817 | + if(schedule.getJhlc() != null) | ||
| 818 | + jhlc += schedule.getJhlc(); | ||
| 819 | + if(schedule.getStatus() == 2){ | ||
| 820 | + sjbc++; | ||
| 821 | + if(schedule.getJhlc() != null) | ||
| 822 | + sjlc += schedule.getJhlc(); | ||
| 823 | + } else if(schedule.getStatus() == -1){ | ||
| 824 | + if(schedule.getRemarks() != null && schedule.getRemarks().indexOf("路阻") != -1){ | ||
| 825 | + lzbc++; | ||
| 826 | + lzlc += schedule.getJhlc(); | ||
| 827 | + }else if(schedule.getRemarks() != null && schedule.getRemarks().indexOf("吊慢") != -1){ | ||
| 828 | + dmbc++; | ||
| 829 | + dmlc += schedule.getJhlc(); | ||
| 830 | + }else if(schedule.getRemarks() != null && schedule.getRemarks().indexOf("故障") != -1){ | ||
| 831 | + gzbc++; | ||
| 832 | + gzlc += schedule.getJhlc(); | ||
| 833 | + }else if(schedule.getRemarks() != null && schedule.getRemarks().indexOf("纠纷") != -1){ | ||
| 834 | + jfbc++; | ||
| 835 | + jflc += schedule.getJhlc(); | ||
| 836 | + }else if(schedule.getRemarks() != null && schedule.getRemarks().indexOf("肇事") != -1){ | ||
| 837 | + zsbc++; | ||
| 838 | + zslc += schedule.getJhlc(); | ||
| 839 | + }else if(schedule.getRemarks() != null && schedule.getRemarks().indexOf("缺人") != -1){ | ||
| 840 | + qrbc++; | ||
| 841 | + qrlc += schedule.getJhlc(); | ||
| 842 | + }else if(schedule.getRemarks() != null && schedule.getRemarks().indexOf("缺车") != -1){ | ||
| 843 | + qcbc++; | ||
| 844 | + qclc += schedule.getJhlc(); | ||
| 845 | + }else if(schedule.getRemarks() != null && schedule.getRemarks().indexOf("客稀") != -1){ | ||
| 846 | + kxbc++; | ||
| 847 | + kxlc += schedule.getJhlc(); | ||
| 848 | + }else if(schedule.getRemarks() != null && schedule.getRemarks().indexOf("气候") != -1){ | ||
| 849 | + qhbc++; | ||
| 850 | + qhlc += schedule.getJhlc(); | ||
| 851 | + }else if(schedule.getRemarks() != null && schedule.getRemarks().indexOf("外援") != -1){ | ||
| 852 | + wybc++; | ||
| 853 | + wylc += schedule.getJhlc(); | ||
| 854 | + } else { | ||
| 855 | + qtbc++; | ||
| 856 | + qtlc += schedule.getJhlc(); | ||
| 857 | + } | ||
| 858 | + } | ||
| 859 | + } | ||
| 860 | + if(startDate.equals(endDate)) | ||
| 861 | + tempMap.put("date", startDate); | ||
| 862 | + else | ||
| 863 | + tempMap.put("date", startDate + "--" + endDate); | ||
| 864 | + tempMap.put("company", company); | ||
| 865 | + tempMap.put("subCompany", subCompany); | ||
| 866 | + tempMap.put("times", times); | ||
| 867 | + tempMap.put("line", key); | ||
| 868 | + tempMap.put("jhbc", jhbc); | ||
| 869 | + tempMap.put("sjbc", sjbc); | ||
| 870 | + tempMap.put("bcbfb", df.format(jhbc>0?(double)sjbc/jhbc*100:0)+"%"); | ||
| 871 | + tempMap.put("jhlc", jhlc); | ||
| 872 | + tempMap.put("sjlc", sjlc); | ||
| 873 | + tempMap.put("lcbfb", df.format(jhlc>0?(double)sjlc/jhlc*100:0)+"%"); | ||
| 874 | + tempMap.put("lzbc", lzbc); | ||
| 875 | + tempMap.put("lzlc", lzlc); | ||
| 876 | + tempMap.put("lzbfb", df.format(jhlc>0?(double)lzlc/jhlc*100:0)+"%"); | ||
| 877 | + tempMap.put("dmbc", dmbc); | ||
| 878 | + tempMap.put("dmlc", dmlc); | ||
| 879 | + tempMap.put("dmbfb", df.format(jhlc>0?(double)dmlc/jhlc*100:0)+"%"); | ||
| 880 | + tempMap.put("gzbc", gzbc); | ||
| 881 | + tempMap.put("gzlc", gzlc); | ||
| 882 | + tempMap.put("gzbfb", df.format(jhlc>0?(double)gzlc/jhlc*100:0)+"%"); | ||
| 883 | + tempMap.put("jfbc", jfbc); | ||
| 884 | + tempMap.put("jflc", jflc); | ||
| 885 | + tempMap.put("jfbfb", df.format(jhlc>0?(double)jflc/jhlc*100:0)+"%"); | ||
| 886 | + tempMap.put("zsbc", zsbc); | ||
| 887 | + tempMap.put("zslc", zslc); | ||
| 888 | + tempMap.put("zsbfb", df.format(jhlc>0?(double)zslc/jhlc*100:0)+"%"); | ||
| 889 | + tempMap.put("qrbc", qrbc); | ||
| 890 | + tempMap.put("qrlc", qrlc); | ||
| 891 | + tempMap.put("qrbfb", df.format(jhlc>0?(double)qrlc/jhlc*100:0)+"%"); | ||
| 892 | + tempMap.put("qcbc", qcbc); | ||
| 893 | + tempMap.put("qclc", qclc); | ||
| 894 | + tempMap.put("qcbfb", df.format(jhlc>0?(double)qclc/jhlc*100:0)+"%"); | ||
| 895 | + tempMap.put("kxbc", kxbc); | ||
| 896 | + tempMap.put("kxlc", kxlc); | ||
| 897 | + tempMap.put("kxbfb", df.format(jhlc>0?(double)kxlc/jhlc*100:0)+"%"); | ||
| 898 | + tempMap.put("qhbc", qhbc); | ||
| 899 | + tempMap.put("qhlc", qhlc); | ||
| 900 | + tempMap.put("qhbfb", df.format(jhlc>0?(double)qhlc/jhlc*100:0)+"%"); | ||
| 901 | + tempMap.put("wybc", wybc); | ||
| 902 | + tempMap.put("wylc", wylc); | ||
| 903 | + tempMap.put("wybfb", df.format(jhlc>0?(double)wylc/jhlc*100:0)+"%"); | ||
| 904 | + tempMap.put("qtbc", qtbc); | ||
| 905 | + tempMap.put("qtlc", qtlc); | ||
| 906 | + tempMap.put("qtbfb", df.format(jhlc>0?(double)qtlc/jhlc*100:0)+"%"); | ||
| 907 | + | ||
| 908 | + resList.add(tempMap); | ||
| 909 | + } | ||
| 910 | + | ||
| 911 | + return resList; | ||
| 912 | + } | ||
| 913 | + | ||
| 914 | + @Override | ||
| 915 | + public List<Map<String, Object>> correctStatis(Map<String, Object> map) { | ||
| 916 | + List<Map<String, Object>> resList = new ArrayList<Map<String, Object>>(); | ||
| 917 | + List<ScheduleRealInfo> list = new ArrayList<ScheduleRealInfo>(); | ||
| 918 | + Map<String, List<ScheduleRealInfo>> keyMap = new HashMap<String, List<ScheduleRealInfo>>(); | ||
| 919 | + Map<String, List<Map<String, Object>>> keyMap0 = new HashMap<String, List<Map<String, Object>>>(); | ||
| 920 | + Map<String, List<Map<String, Object>>> keyMap1 = new HashMap<String, List<Map<String, Object>>>(); | ||
| 921 | + | ||
| 922 | + String line = map.get("line").toString(); | ||
| 923 | + String startDate = map.get("startDate").toString(); | ||
| 924 | + String endDate = map.get("endDate").toString(); | ||
| 925 | + String times = map.get("times").toString(); | ||
| 926 | + String type = map.get("type").toString(); | ||
| 927 | + | ||
| 928 | + if(startDate.length() == 0){ | ||
| 929 | + startDate = new SimpleDateFormat("yyyy-MM-dd").format(new Date()); | ||
| 930 | + } | ||
| 931 | + if(endDate.length() == 0){ | ||
| 932 | + endDate = new SimpleDateFormat("yyyy-MM-dd").format(new Date()); | ||
| 933 | + } | ||
| 934 | + try { | ||
| 935 | + | ||
| 936 | + String sql = "select * from bsth_c_s_sp_info_real where DATE_FORMAT(schedule_date,'%Y-%m-%d') >= '"+startDate+"' and DATE_FORMAT(schedule_date,'%Y-%m-%d') <= '"+endDate+"' and fcsj_actual is not null"; | ||
| 937 | + if(line.length() != 0){ | ||
| 938 | + sql += " and xl_bm = '"+line+"'"; | ||
| 939 | + } | ||
| 940 | + if(times.length() != 0){ | ||
| 941 | + String[] split = times.split("-"); | ||
| 942 | + sql += " and fcsj >= '"+split[0]+"' and fcsj <= '"+split[1]+"'"; | ||
| 943 | + } | ||
| 944 | + sql += " and bc_type = 'normal'"; | ||
| 945 | + | ||
| 946 | + list =jdbcTemplate.query(sql, | ||
| 947 | + new RowMapper<ScheduleRealInfo>(){ | ||
| 948 | + @Override | ||
| 949 | + public ScheduleRealInfo mapRow(ResultSet rs, int rowNum) throws SQLException { | ||
| 950 | + ScheduleRealInfo schedule = new ScheduleRealInfo(); | ||
| 951 | + schedule.setScheduleDateStr(rs.getString("schedule_date_Str")); | ||
| 952 | + schedule.setXlName(rs.getString("xl_name")); | ||
| 953 | + schedule.setLpName(rs.getString("lp_name")); | ||
| 954 | + schedule.setBcType(rs.getString("bc_type")); | ||
| 955 | + schedule.setBcs(rs.getInt("bcs")); | ||
| 956 | + schedule.setBcsj(rs.getInt("bcsj")); | ||
| 957 | + schedule.setJhlc(rs.getDouble("jhlc")); | ||
| 958 | + schedule.setDfsj(rs.getString("dfsj")); | ||
| 959 | + schedule.setFcsj(rs.getString("fcsj")); | ||
| 960 | + schedule.setFcsjActual(rs.getString("fcsj_actual")); | ||
| 961 | + schedule.setZdsj(rs.getString("zdsj")); | ||
| 962 | + schedule.setZdsjActual(rs.getString("zdsj_actual")); | ||
| 963 | + schedule.setQdzName(rs.getString("qdz_name")); | ||
| 964 | + schedule.setZdzName(rs.getString("zdz_name")); | ||
| 965 | + schedule.setXlDir(rs.getString("xl_dir")); | ||
| 966 | + schedule.setStatus(rs.getInt("status")); | ||
| 967 | + schedule.setRemarks(rs.getString("remarks")); | ||
| 968 | + schedule.setGsName(rs.getString("gs_name")); | ||
| 969 | + schedule.setFgsName(rs.getString("fgs_name")); | ||
| 970 | + schedule.setDfAuto(rs.getBoolean("df_auto")); | ||
| 971 | + schedule.setOnline(rs.getBoolean("online")); | ||
| 972 | + schedule.setClZbh(rs.getString("cl_zbh")); | ||
| 973 | + schedule.setjGh(rs.getString("j_gh")); | ||
| 974 | + schedule.setjName(rs.getString("j_name")); | ||
| 975 | + schedule.setUpdateDate(rs.getDate("update_date")); | ||
| 976 | + | ||
| 977 | + return schedule; | ||
| 978 | + } | ||
| 979 | + }); | ||
| 980 | + }catch (Exception e) { | ||
| 981 | + // TODO: handle exception | ||
| 982 | + e.printStackTrace(); | ||
| 983 | + } | ||
| 984 | + | ||
| 985 | + String[] date1 = startDate.split("-"); | ||
| 986 | + String[] date2 = endDate.split("-"); | ||
| 987 | + startDate = date1[0] + "年" + date1[1] + "月" + date1[2] + "日"; | ||
| 988 | + endDate = date2[0] + "年" + date2[1] + "月" + date2[2] + "日"; | ||
| 989 | + String date = ""; | ||
| 990 | + if(startDate.equals(endDate)) | ||
| 991 | + date = startDate; | ||
| 992 | + else | ||
| 993 | + date = startDate + "--" + endDate; | ||
| 994 | + | ||
| 995 | + for(ScheduleRealInfo schedule : list){ | ||
| 996 | + String key = schedule.getGsName() + "/" + schedule.getFgsName() + "/" + schedule.getXlName(); | ||
| 997 | + if(!keyMap.containsKey(key)) | ||
| 998 | + keyMap.put(key, new ArrayList<ScheduleRealInfo>()); | ||
| 999 | + keyMap.get(key).add(schedule); | ||
| 1000 | + } | ||
| 1001 | + for(String key : keyMap.keySet()){ | ||
| 1002 | + Map<String, Object> tempMap = new HashMap<String, Object>(); | ||
| 1003 | + List<ScheduleRealInfo> tempList = new ArrayList<ScheduleRealInfo>(); | ||
| 1004 | + int sjbc = 0, sddf = 0, zddf = 0, | ||
| 1005 | + dxtz = 0, lbtz = 0; | ||
| 1006 | + for(ScheduleRealInfo schedule : keyMap.get(key)){ | ||
| 1007 | + if(schedule.getFcsjActual() != null){ | ||
| 1008 | + boolean flag = false; | ||
| 1009 | + sjbc++; | ||
| 1010 | + if(schedule.getDfsj() != null && !schedule.getDfsj().equals(schedule.getFcsj())){ | ||
| 1011 | + flag = true; | ||
| 1012 | + schedule.setRemarks("待发调整"); | ||
| 1013 | + if(schedule.isDfAuto()) | ||
| 1014 | + zddf++; | ||
| 1015 | + else | ||
| 1016 | + sddf++; | ||
| 1017 | + }else if(!schedule.isOnline()){ | ||
| 1018 | + flag = true; | ||
| 1019 | + schedule.setRemarks("掉线调整"); | ||
| 1020 | + dxtz++; | ||
| 1021 | + }else if(schedule.getStatus() == 2){ | ||
| 1022 | + flag = true; | ||
| 1023 | + lbtz++; | ||
| 1024 | + } | ||
| 1025 | + if(flag) | ||
| 1026 | + tempList.add(schedule); | ||
| 1027 | + } | ||
| 1028 | + } | ||
| 1029 | + tempMap.put("date", date); | ||
| 1030 | + String[] keys = key.split("/"); | ||
| 1031 | + tempMap.put("company", keys[0]); | ||
| 1032 | + tempMap.put("subCompany", keys[1]); | ||
| 1033 | + tempMap.put("line", keys[2]); | ||
| 1034 | + tempMap.put("sjbc", sjbc); | ||
| 1035 | + tempMap.put("sddf", sddf); | ||
| 1036 | + tempMap.put("zddf", zddf); | ||
| 1037 | + tempMap.put("dfhj", sddf + zddf); | ||
| 1038 | + tempMap.put("dxtz", dxtz); | ||
| 1039 | + tempMap.put("lbtz", lbtz); | ||
| 1040 | + tempMap.put("correct", sddf + zddf + dxtz + lbtz); | ||
| 1041 | + tempMap.put("dfbl", df.format((double)(sddf + zddf)/sjbc*100) + "%"); | ||
| 1042 | + tempMap.put("dxbl", df.format((double)(dxtz)/sjbc*100) + "%"); | ||
| 1043 | + tempMap.put("lbbl", df.format((double)(lbtz)/sjbc*100) + "%"); | ||
| 1044 | + tempMap.put("correctbl", df.format((double)(sddf + zddf + dxtz + lbtz)/sjbc*100) + "%"); | ||
| 1045 | + tempMap.put("workList", tempList); | ||
| 1046 | + | ||
| 1047 | + String key0 = keys[0] + "/" + keys[1]; | ||
| 1048 | + if(!keyMap0.containsKey(key0)) | ||
| 1049 | + keyMap0.put(key0, new ArrayList<Map<String, Object>>()); | ||
| 1050 | + keyMap0.get(key0).add(tempMap); | ||
| 1051 | + } | ||
| 1052 | + | ||
| 1053 | + for(String key : keyMap0.keySet()){ | ||
| 1054 | + Map<String, Object> tempMap = new HashMap<String, Object>(); | ||
| 1055 | + int sjbc = 0, sddf = 0, zddf = 0, | ||
| 1056 | + dxtz = 0, lbtz = 0; | ||
| 1057 | + for(Map<String, Object> m : keyMap0.get(key)){ | ||
| 1058 | + sjbc += (int)m.get("sjbc"); | ||
| 1059 | + sddf += (int)m.get("sddf"); | ||
| 1060 | + zddf += (int)m.get("zddf"); | ||
| 1061 | + dxtz += (int)m.get("dxtz"); | ||
| 1062 | + lbtz += (int)m.get("lbtz"); | ||
| 1063 | + } | ||
| 1064 | + tempMap.put("date", date); | ||
| 1065 | + String[] keys = key.split("/"); | ||
| 1066 | + tempMap.put("company", keys[0]); | ||
| 1067 | + tempMap.put("subCompany", keys[1]); | ||
| 1068 | + tempMap.put("lines", keyMap0.get(key).size()); | ||
| 1069 | + tempMap.put("sjbc", sjbc); | ||
| 1070 | + tempMap.put("sddf", sddf); | ||
| 1071 | + tempMap.put("zddf", zddf); | ||
| 1072 | + tempMap.put("dfhj", sddf + zddf); | ||
| 1073 | + tempMap.put("dxtz", dxtz); | ||
| 1074 | + tempMap.put("lbtz", lbtz); | ||
| 1075 | + tempMap.put("correct", sddf + zddf + dxtz + lbtz); | ||
| 1076 | + tempMap.put("dfbl", df.format((double)(sddf + zddf)/sjbc*100) + "%"); | ||
| 1077 | + tempMap.put("dxbl", df.format((double)(dxtz)/sjbc*100) + "%"); | ||
| 1078 | + tempMap.put("lbbl", df.format((double)(lbtz)/sjbc*100) + "%"); | ||
| 1079 | + tempMap.put("correctbl", df.format((double)(sddf + zddf + dxtz + lbtz)/sjbc*100) + "%"); | ||
| 1080 | + tempMap.put("workList", keyMap0.get(key)); | ||
| 1081 | + | ||
| 1082 | + String key1 = keys[0]; | ||
| 1083 | + if(!keyMap1.containsKey(key1)) | ||
| 1084 | + keyMap1.put(key1, new ArrayList<Map<String, Object>>()); | ||
| 1085 | + keyMap1.get(key1).add(tempMap); | ||
| 1086 | + } | ||
| 1087 | + | ||
| 1088 | + for(String key : keyMap1.keySet()){ | ||
| 1089 | + Map<String, Object> tempMap = new HashMap<String, Object>(); | ||
| 1090 | + int sjbc = 0, sddf = 0, zddf = 0, | ||
| 1091 | + dxtz = 0, lbtz = 0, lines = 0; | ||
| 1092 | + for(Map<String, Object> m : keyMap1.get(key)){ | ||
| 1093 | + sjbc += (int)m.get("sjbc"); | ||
| 1094 | + sddf += (int)m.get("sddf"); | ||
| 1095 | + zddf += (int)m.get("zddf"); | ||
| 1096 | + dxtz += (int)m.get("dxtz"); | ||
| 1097 | + lbtz += (int)m.get("lbtz"); | ||
| 1098 | + lines += (int)m.get("lines"); | ||
| 1099 | + } | ||
| 1100 | + tempMap.put("date", date); | ||
| 1101 | + tempMap.put("company", key); | ||
| 1102 | + tempMap.put("lines", lines); | ||
| 1103 | + tempMap.put("sjbc", sjbc); | ||
| 1104 | + tempMap.put("sddf", sddf); | ||
| 1105 | + tempMap.put("zddf", zddf); | ||
| 1106 | + tempMap.put("dfhj", sddf + zddf); | ||
| 1107 | + tempMap.put("dxtz", dxtz); | ||
| 1108 | + tempMap.put("lbtz", lbtz); | ||
| 1109 | + tempMap.put("correct", sddf + zddf + dxtz + lbtz); | ||
| 1110 | + tempMap.put("dfbl", df.format((double)(sddf + zddf)/sjbc*100) + "%"); | ||
| 1111 | + tempMap.put("dxbl", df.format((double)(dxtz)/sjbc*100) + "%"); | ||
| 1112 | + tempMap.put("lbbl", df.format((double)(lbtz)/sjbc*100) + "%"); | ||
| 1113 | + tempMap.put("correctbl", df.format((double)(sddf + zddf + dxtz + lbtz)/sjbc*100) + "%"); | ||
| 1114 | + tempMap.put("workList", keyMap1.get(key)); | ||
| 1115 | + | ||
| 1116 | + resList.add(tempMap); | ||
| 1117 | + } | ||
| 1118 | + | ||
| 1119 | + if(resList.size() != 0){ | ||
| 1120 | + Map<String, Object> tempMap = new HashMap<String, Object>(); | ||
| 1121 | + int sjbc = 0, sddf = 0, zddf = 0, | ||
| 1122 | + dxtz = 0, lbtz = 0, lines = 0; | ||
| 1123 | + for(Map<String, Object> m : resList){ | ||
| 1124 | + sjbc += (int)m.get("sjbc"); | ||
| 1125 | + sddf += (int)m.get("sddf"); | ||
| 1126 | + zddf += (int)m.get("zddf"); | ||
| 1127 | + dxtz += (int)m.get("dxtz"); | ||
| 1128 | + lbtz += (int)m.get("lbtz"); | ||
| 1129 | + lines += (int)m.get("lines"); | ||
| 1130 | + for(Map<String, Object> m0 : (List<Map<String, Object>>)m.get("workList")){ | ||
| 1131 | + Map<String, Object> temp = new HashMap<String, Object>(); | ||
| 1132 | + temp.put("date", "合计"); | ||
| 1133 | + temp.put("lines", m0.get("lines")); | ||
| 1134 | + temp.put("sjbc", m0.get("sjbc")); | ||
| 1135 | + temp.put("sddf", m0.get("sddf")); | ||
| 1136 | + temp.put("zddf", m0.get("zddf")); | ||
| 1137 | + temp.put("dfhj", m0.get("dfhj")); | ||
| 1138 | + temp.put("dxtz", m0.get("dxtz")); | ||
| 1139 | + temp.put("lbtz", m0.get("lbtz")); | ||
| 1140 | + temp.put("correct", m0.get("correct")); | ||
| 1141 | + temp.put("dfbl", m0.get("dfbl")); | ||
| 1142 | + temp.put("dxbl", m0.get("dxbl")); | ||
| 1143 | + temp.put("lbbl", m0.get("lbbl")); | ||
| 1144 | + temp.put("correctbl", m0.get("correctbl")); | ||
| 1145 | + ((List<Map<String, Object>>)m0.get("workList")).add(temp); | ||
| 1146 | + } | ||
| 1147 | + Map<String, Object> temp = new HashMap<String, Object>(); | ||
| 1148 | + temp.put("date", "合计"); | ||
| 1149 | + temp.put("lines", m.get("lines")); | ||
| 1150 | + temp.put("sjbc", m.get("sjbc")); | ||
| 1151 | + temp.put("sddf", m.get("sddf")); | ||
| 1152 | + temp.put("zddf", m.get("zddf")); | ||
| 1153 | + temp.put("dfhj", m.get("dfhj")); | ||
| 1154 | + temp.put("dxtz", m.get("dxtz")); | ||
| 1155 | + temp.put("lbtz", m.get("lbtz")); | ||
| 1156 | + temp.put("correct", m.get("correct")); | ||
| 1157 | + temp.put("dfbl", m.get("dfbl")); | ||
| 1158 | + temp.put("dxbl", m.get("dxbl")); | ||
| 1159 | + temp.put("lbbl", m.get("lbbl")); | ||
| 1160 | + temp.put("correctbl", m.get("correctbl")); | ||
| 1161 | + ((List<Map<String, Object>>)m.get("workList")).add(temp); | ||
| 1162 | + } | ||
| 1163 | + tempMap.put("date", "合计"); | ||
| 1164 | + tempMap.put("lines", lines); | ||
| 1165 | + tempMap.put("sjbc", sjbc); | ||
| 1166 | + tempMap.put("sddf", sddf); | ||
| 1167 | + tempMap.put("zddf", zddf); | ||
| 1168 | + tempMap.put("dfhj", sddf + zddf); | ||
| 1169 | + tempMap.put("dxtz", dxtz); | ||
| 1170 | + tempMap.put("lbtz", lbtz); | ||
| 1171 | + tempMap.put("correct", sddf + zddf + dxtz + lbtz); | ||
| 1172 | + tempMap.put("dfbl", df.format((double)(sddf + zddf)/sjbc*100) + "%"); | ||
| 1173 | + tempMap.put("dxbl", df.format((double)(dxtz)/sjbc*100) + "%"); | ||
| 1174 | + tempMap.put("lbbl", df.format((double)(lbtz)/sjbc*100) + "%"); | ||
| 1175 | + tempMap.put("correctbl", df.format((double)(sddf + zddf + dxtz + lbtz)/sjbc*100) + "%"); | ||
| 1176 | + resList.add(tempMap); | ||
| 1177 | + } | ||
| 1178 | + | ||
| 1179 | + return resList; | ||
| 1180 | + } | ||
| 1181 | + | ||
| 1182 | + | ||
| 1183 | + | ||
| 1184 | +} |
src/main/java/com/bsth/service/oil/impl/YlbServiceImpl.java
| @@ -373,7 +373,10 @@ public class YlbServiceImpl extends BaseServiceImpl<Ylb,Integer> implements YlbS | @@ -373,7 +373,10 @@ public class YlbServiceImpl extends BaseServiceImpl<Ylb,Integer> implements YlbS | ||
| 373 | if(t.getJcsx()==1){ | 373 | if(t.getJcsx()==1){ |
| 374 | Double jcyl=t.getCzyl(); | 374 | Double jcyl=t.getCzyl(); |
| 375 | zyl=jcyl+jzl-yl; | 375 | zyl=jcyl+jzl-yl; |
| 376 | - Double yh=Double.parseDouble(df.format(zyl*(t.getZlc()/zlc))); | 376 | + Double yh=0.0; |
| 377 | + if(zlc>0&&t.getZlc()>0){ | ||
| 378 | + yh=Double.parseDouble(df.format(zyl*(t.getZlc()/zlc))); | ||
| 379 | + } | ||
| 377 | t.setYh(yh); | 380 | t.setYh(yh); |
| 378 | nextJzyl=t.getJzl()+t.getCzyl()-yh; | 381 | nextJzyl=t.getJzl()+t.getCzyl()-yh; |
| 379 | t.setJzyl(Double.parseDouble(df.format(nextJzyl))); | 382 | t.setJzyl(Double.parseDouble(df.format(nextJzyl))); |
src/main/java/com/bsth/service/realcontrol/impl/RealMapServiceImpl.java
| @@ -40,7 +40,7 @@ public class RealMapServiceImpl implements RealMapService { | @@ -40,7 +40,7 @@ public class RealMapServiceImpl implements RealMapService { | ||
| 40 | } | 40 | } |
| 41 | inStr = " (" + inStr.substring(1) + ")"; | 41 | inStr = " (" + inStr.substring(1) + ")"; |
| 42 | 42 | ||
| 43 | - String sql = "select R.LINE_CODE,R.STATION_NAME,R.STATION_CODE,R.STATION_MARK,R.DIRECTIONS,R.DISTANCES,R.TO_TIME, R.VERSIONS,S.G_LONX,S.G_LATY,S.RADIUS,S.SHAPES_TYPE,ST_AsText(S.G_POLYGON_GRID) as G_POLYGON_GRID, R.STATION_ROUTE_CODE from bsth_c_stationroute r inner join bsth_c_station s on r.station=s.id where r.line_code in "+inStr+" and r.destroy=0"; | 43 | + String sql = "select r.LINE_CODE,r.STATION_NAME,r.STATION_CODE,r.STATION_MARK,r.DIRECTIONS,r.DISTANCES,r.TO_TIME, r.VERSIONS,s.G_LONX,s.G_LATY,s.RADIUS,s.SHAPES_TYPE,ST_AsText(s.G_POLYGON_GRID) as G_POLYGON_GRID, r.STATION_ROUTE_CODE from bsth_c_stationroute r inner join bsth_c_station s on r.station=s.id where r.line_code in "+inStr+" and r.destroy=0"; |
| 44 | 44 | ||
| 45 | List<StationSpatialData> list = jdbcTemplate.query(sql,new BeanPropertyRowMapper(StationSpatialData.class)); | 45 | List<StationSpatialData> list = jdbcTemplate.query(sql,new BeanPropertyRowMapper(StationSpatialData.class)); |
| 46 | rs.put("status", ResponseCode.SUCCESS); | 46 | rs.put("status", ResponseCode.SUCCESS); |
| @@ -59,7 +59,7 @@ public class RealMapServiceImpl implements RealMapService { | @@ -59,7 +59,7 @@ public class RealMapServiceImpl implements RealMapService { | ||
| 59 | Map<String, Object> rs = new HashMap(); | 59 | Map<String, Object> rs = new HashMap(); |
| 60 | 60 | ||
| 61 | try { | 61 | try { |
| 62 | - String sql = "select ID, AREA,PARK_CODE,PARK_NAME,ST_AsText(G_PARK_POINT) as G_PARK_POINT,G_CENTER_POINT,RADIUS,SHAPES_TYPE from bsth_c_car_park WHERE destroy=0"; | 62 | + String sql = "select ID, AREA,PARK_CODE,PARK_NAME,ST_AsText(G_PARK_POINT) as G_PARK_POINT,G_CENTER_POINT,RADIUS,SHAPES_TYPE from bsth_c_car_park WHERE destroy=0 and shapes_type='d'"; |
| 63 | 63 | ||
| 64 | List<CarPark> list = jdbcTemplate.query(sql,new BeanPropertyRowMapper(CarPark.class)); | 64 | List<CarPark> list = jdbcTemplate.query(sql,new BeanPropertyRowMapper(CarPark.class)); |
| 65 | rs.put("status", ResponseCode.SUCCESS); | 65 | rs.put("status", ResponseCode.SUCCESS); |
src/main/java/com/bsth/service/realcontrol/impl/ScheduleRealInfoServiceImpl.java
| @@ -1145,7 +1145,9 @@ public class ScheduleRealInfoServiceImpl extends BaseServiceImpl<ScheduleRealInf | @@ -1145,7 +1145,9 @@ public class ScheduleRealInfoServiceImpl extends BaseServiceImpl<ScheduleRealInf | ||
| 1145 | || scheduleRealInfo.getBcType().equals("venting")){ | 1145 | || scheduleRealInfo.getBcType().equals("venting")){ |
| 1146 | ksgl += tempJhlc; | 1146 | ksgl += tempJhlc; |
| 1147 | }else{ | 1147 | }else{ |
| 1148 | - yygl += tempJhlc; | 1148 | + if(scheduleRealInfo.getStatus() != -1){ |
| 1149 | + yygl += tempJhlc; | ||
| 1150 | + } | ||
| 1149 | } | 1151 | } |
| 1150 | }else{ | 1152 | }else{ |
| 1151 | Iterator<ChildTaskPlan> it = childTaskPlans.iterator(); | 1153 | Iterator<ChildTaskPlan> it = childTaskPlans.iterator(); |
| @@ -1154,7 +1156,12 @@ public class ScheduleRealInfoServiceImpl extends BaseServiceImpl<ScheduleRealInf | @@ -1154,7 +1156,12 @@ public class ScheduleRealInfoServiceImpl extends BaseServiceImpl<ScheduleRealInf | ||
| 1154 | if(childTaskPlan.getMileageType().equals("empty")){ | 1156 | if(childTaskPlan.getMileageType().equals("empty")){ |
| 1155 | ksgl += childTaskPlan.getMileage()==null?0:childTaskPlan.getMileage(); | 1157 | ksgl += childTaskPlan.getMileage()==null?0:childTaskPlan.getMileage(); |
| 1156 | }else{ | 1158 | }else{ |
| 1157 | - yygl += childTaskPlan.getMileage()==null?0:childTaskPlan.getMileage(); | 1159 | + if(childTaskPlan.isDestroy()){ |
| 1160 | + remMileage += tempJhlc; | ||
| 1161 | + cjbc++; | ||
| 1162 | + }else{ | ||
| 1163 | + yygl += childTaskPlan.getMileage()==null?0:childTaskPlan.getMileage(); | ||
| 1164 | + } | ||
| 1158 | } | 1165 | } |
| 1159 | } | 1166 | } |
| 1160 | } | 1167 | } |
src/main/java/com/bsth/service/report/ReportService.java
| @@ -18,4 +18,12 @@ public interface ReportService { | @@ -18,4 +18,12 @@ public interface ReportService { | ||
| 18 | List<Map<String, String>> sreachZd(String line,int zdlx,String zd); | 18 | List<Map<String, String>> sreachZd(String line,int zdlx,String zd); |
| 19 | 19 | ||
| 20 | List<Object[]> historyMessageCount(String line, String date, String code); | 20 | List<Object[]> historyMessageCount(String line, String date, String code); |
| 21 | + | ||
| 22 | + Map<String, Object> tbodyTime1(String line ,String date); | ||
| 23 | + | ||
| 24 | + Map<String, Object> tbodyTime2(String line ,String date); | ||
| 25 | + | ||
| 26 | + List<Map<String, Object>> tbodyTime3(String line ,String date); | ||
| 27 | + List<Map<String, Object>> tbodyTime5(String line ,String date); | ||
| 28 | + | ||
| 21 | } | 29 | } |
src/main/java/com/bsth/service/report/impl/ReportServiceImpl.java
| @@ -3,6 +3,7 @@ import java.sql.Connection; | @@ -3,6 +3,7 @@ import java.sql.Connection; | ||
| 3 | import java.sql.PreparedStatement; | 3 | import java.sql.PreparedStatement; |
| 4 | import java.sql.ResultSet; | 4 | import java.sql.ResultSet; |
| 5 | import java.sql.SQLException; | 5 | import java.sql.SQLException; |
| 6 | +import java.text.DecimalFormat; | ||
| 6 | import java.text.ParseException; | 7 | import java.text.ParseException; |
| 7 | import java.text.SimpleDateFormat; | 8 | import java.text.SimpleDateFormat; |
| 8 | import java.util.ArrayList; | 9 | import java.util.ArrayList; |
| @@ -16,12 +17,15 @@ import org.slf4j.Logger; | @@ -16,12 +17,15 @@ import org.slf4j.Logger; | ||
| 16 | import org.slf4j.LoggerFactory; | 17 | import org.slf4j.LoggerFactory; |
| 17 | import org.springframework.beans.factory.annotation.Autowired; | 18 | import org.springframework.beans.factory.annotation.Autowired; |
| 18 | import org.springframework.jdbc.core.JdbcTemplate; | 19 | import org.springframework.jdbc.core.JdbcTemplate; |
| 20 | +import org.springframework.jdbc.core.RowMapper; | ||
| 19 | import org.springframework.stereotype.Service; | 21 | import org.springframework.stereotype.Service; |
| 20 | 22 | ||
| 21 | import com.bsth.data.BasicData; | 23 | import com.bsth.data.BasicData; |
| 22 | import com.bsth.entity.StationRoute; | 24 | import com.bsth.entity.StationRoute; |
| 23 | import com.bsth.entity.excep.ArrivalInfo; | 25 | import com.bsth.entity.excep.ArrivalInfo; |
| 26 | +import com.bsth.entity.oil.Ylb; | ||
| 24 | import com.bsth.entity.realcontrol.ScheduleRealInfo; | 27 | import com.bsth.entity.realcontrol.ScheduleRealInfo; |
| 28 | +import com.bsth.entity.schedule.SchedulePlanInfo; | ||
| 25 | import com.bsth.repository.StationRouteRepository; | 29 | import com.bsth.repository.StationRouteRepository; |
| 26 | import com.bsth.repository.realcontrol.ScheduleRealInfoRepository; | 30 | import com.bsth.repository.realcontrol.ScheduleRealInfoRepository; |
| 27 | import com.bsth.service.report.ReportService; | 31 | import com.bsth.service.report.ReportService; |
| @@ -252,5 +256,515 @@ public class ReportServiceImpl implements ReportService{ | @@ -252,5 +256,515 @@ public class ReportServiceImpl implements ReportService{ | ||
| 252 | List<Object[]> list = scheduleRealInfoRepository.historyMessageCount(line, date, code); | 256 | List<Object[]> list = scheduleRealInfoRepository.historyMessageCount(line, date, code); |
| 253 | return list; | 257 | return list; |
| 254 | } | 258 | } |
| 259 | + @Override | ||
| 260 | + public Map<String, Object> tbodyTime1(String line, String date) { | ||
| 261 | + DecimalFormat df = new DecimalFormat("#0.00"); | ||
| 262 | + // TODO Auto-generated method stub | ||
| 263 | + //查询配车 | ||
| 264 | + String sqlPc=" SELECT cl_zbh FROM bsth_c_s_sp_info " | ||
| 265 | + +" where DATE_FORMAT(schedule_date,'%Y-%m-%d') ='"+date+"' " | ||
| 266 | + + " and xl_bm='"+line+"' and bc_type='normal' " | ||
| 267 | + + " group by cl_zbh "; | ||
| 268 | + Map<String, Object> map=new HashMap<String,Object>(); | ||
| 269 | + List<Map<String, Object>> listPc= jdbcTemplate.query(sqlPc, | ||
| 270 | + new RowMapper<Map<String, Object>>(){ | ||
| 271 | + @Override | ||
| 272 | + public Map<String, Object> mapRow(ResultSet rs, int rowNum) throws SQLException { | ||
| 273 | + Map<String, Object> m=new HashMap<String,Object>(); | ||
| 274 | + m.put("zbh", rs.getString("cl_zbh")); | ||
| 275 | + return m; | ||
| 276 | + } | ||
| 277 | + }); | ||
| 278 | + //配车 | ||
| 279 | + int pcs=listPc.size(); | ||
| 280 | + | ||
| 281 | + | ||
| 282 | + String sqlPlan="select jhlc, bc_type ,fcsj from bsth_c_s_sp_info " | ||
| 283 | + + "where DATE_FORMAT(schedule_date,'%Y-%m-%d') ='"+date+"' and xl_bm='"+line+"'"; | ||
| 284 | + | ||
| 285 | + //班次 | ||
| 286 | + int zgf_0 = 6*60+31,zgf_1 = 8*60+30,wgf_0 = 16*60+1,wgf_1 = 18*60; | ||
| 287 | + int qcBc=0,qjBc=0,zqcBc=0,zqjBc=0,wqcBc=0,wqjBc=0; | ||
| 288 | + double zlc = 0 , yylc = 0,kslc=0; | ||
| 289 | + //查询班次 | ||
| 290 | + List<Map<String, Object>> listPlan= jdbcTemplate.query(sqlPlan, | ||
| 291 | + new RowMapper<Map<String, Object>>(){ | ||
| 292 | + @Override | ||
| 293 | + public Map<String, Object> mapRow(ResultSet rs, int rowNum) throws SQLException { | ||
| 294 | + Map<String, Object> m2=new HashMap<String,Object>(); | ||
| 295 | + m2.put("jhlc", rs.getDouble("jhlc")); | ||
| 296 | + m2.put("bcType", rs.getString("bc_type")); | ||
| 297 | + m2.put("fcsj", rs.getString("fcsj")); | ||
| 298 | + return m2; | ||
| 299 | + } | ||
| 300 | + }); | ||
| 301 | + | ||
| 302 | + for (int i = 0; i < listPlan.size(); i++) { | ||
| 303 | + Map<String, Object> m=listPlan.get(i); | ||
| 304 | + double jhlc=Double.parseDouble(m.get("jhlc").toString()); | ||
| 305 | + String bcType=m.get("bcType").toString(); | ||
| 306 | + String fcsjs[]=m.get("fcsj").toString().split(":"); | ||
| 307 | + | ||
| 308 | + zlc +=jhlc; | ||
| 309 | + if(bcType.equals("normal")){ | ||
| 310 | + qcBc ++; | ||
| 311 | + if((Integer.parseInt(fcsjs[0])*60+Integer.parseInt(fcsjs[1])) > zgf_0 | ||
| 312 | + && (Integer.parseInt(fcsjs[0])*60+Integer.parseInt(fcsjs[1])) < zgf_1){ | ||
| 313 | + zqcBc++; | ||
| 314 | + }else if((Integer.parseInt(fcsjs[0])*60+Integer.parseInt(fcsjs[1])) > wgf_0 | ||
| 315 | + && (Integer.parseInt(fcsjs[0])*60+Integer.parseInt(fcsjs[1])) < wgf_1){ | ||
| 316 | + wqcBc++; | ||
| 317 | + } | ||
| 318 | + yylc +=jhlc; | ||
| 319 | + }else if(bcType.equals("region")){ | ||
| 320 | + qjBc++; | ||
| 321 | + if((Integer.parseInt(fcsjs[0])*60+Integer.parseInt(fcsjs[1])) > zgf_0 | ||
| 322 | + && (Integer.parseInt(fcsjs[0])*60+Integer.parseInt(fcsjs[1])) < zgf_1){ | ||
| 323 | + zqjBc++; | ||
| 324 | + }else if((Integer.parseInt(fcsjs[0])*60+Integer.parseInt(fcsjs[1])) > wgf_0 | ||
| 325 | + && (Integer.parseInt(fcsjs[0])*60+Integer.parseInt(fcsjs[1])) < wgf_1){ | ||
| 326 | + wqjBc++; | ||
| 327 | + } | ||
| 328 | + | ||
| 329 | + yylc+=jhlc; | ||
| 330 | + }else{ | ||
| 331 | + kslc+=jhlc; | ||
| 332 | + } | ||
| 333 | + } | ||
| 334 | + | ||
| 335 | + map.put("pcs", pcs); | ||
| 336 | + map.put("qcbc", qcBc); | ||
| 337 | + map.put("qjbc", qjBc); | ||
| 338 | + map.put("zqcbc", zqcBc); | ||
| 339 | + map.put("zqjbc", zqjBc); | ||
| 340 | + map.put("wqcbc", wqcBc); | ||
| 341 | + map.put("wqjbc", wqjBc); | ||
| 342 | + map.put("zlc", df.format( zlc)); | ||
| 343 | + map.put("yylc", df.format(yylc)); | ||
| 344 | + map.put("kslc",df.format( kslc)); | ||
| 345 | + //查询里程 | ||
| 346 | + return map; | ||
| 347 | + } | ||
| 348 | + @Override | ||
| 349 | + public Map<String, Object> tbodyTime2(String line, String date) { | ||
| 350 | + DecimalFormat df = new DecimalFormat("#0.00"); | ||
| 351 | + // TODO Auto-generated method stub | ||
| 352 | + //查询配车 | ||
| 353 | + String sqlPc=" SELECT sum(bcsj) as yysj ,sum(jhlc) as yygl FROM bsth_c_s_sp_info " | ||
| 354 | + +" where DATE_FORMAT(schedule_date,'%Y-%m-%d') ='"+date+"' " | ||
| 355 | + + " and xl_bm='"+line+"' and bc_type in ('normal' ,'region' )"; | ||
| 356 | + Map<String, Object> map=new HashMap<String,Object>(); | ||
| 357 | + List<Map<String, Object>> list= jdbcTemplate.query(sqlPc, | ||
| 358 | + new RowMapper<Map<String, Object>>(){ | ||
| 359 | + @Override | ||
| 360 | + public Map<String, Object> mapRow(ResultSet rs, int rowNum) throws SQLException { | ||
| 361 | + Map<String, Object> m=new HashMap<String,Object>(); | ||
| 362 | + m.put("yysj", rs.getInt("yysj")); | ||
| 363 | + m.put("yygl", rs.getString("yygl")==null?"0":rs.getString("yygl")); | ||
| 364 | + return m; | ||
| 365 | + } | ||
| 366 | + }); | ||
| 367 | + int yysj=0 ; | ||
| 368 | + double yycs=0 ,yygl=0; | ||
| 369 | + if(list.size()>0){ | ||
| 370 | + Map<String, Object> m=list.get(0); | ||
| 371 | + yysj=Integer.parseInt((m.get("yysj").toString())); | ||
| 372 | + yygl=Double.parseDouble(m.get("yygl").toString()); | ||
| 373 | + } | ||
| 374 | + if(yysj>0){ | ||
| 375 | + yycs =yygl/(yysj*1.0/60); | ||
| 376 | + } | ||
| 377 | + int hh=yysj/60; | ||
| 378 | + int mm=yysj%60; | ||
| 379 | + | ||
| 380 | + map.put("yysj", hh+":"+mm); | ||
| 381 | + map.put("yycs", df.format(yycs)+"公里/小时"); | ||
| 382 | +// map.put(key, value) | ||
| 383 | + return map; | ||
| 384 | + } | ||
| 255 | 385 | ||
| 386 | + public static void main(String[] args) { | ||
| 387 | + System.out.println(609360/60); | ||
| 388 | + System.out.println(609360%60); | ||
| 389 | + } | ||
| 390 | + @Override | ||
| 391 | + public List<Map<String, Object>> tbodyTime3(String line, String date) { | ||
| 392 | + // TODO Auto-generated method stub | ||
| 393 | + List<Map<String, Object>> list=new ArrayList<Map<String,Object>>(); | ||
| 394 | + String sqlZd=" select qdz_name, count(cl_zbh) as cls , 'zqc' as lx from bsth_c_s_sp_info where " | ||
| 395 | + + " DATE_FORMAT(schedule_date,'%Y-%m-%d') ='"+date+"' and xl_bm='"+line+"' and bc_type='normal' " | ||
| 396 | + + " and fcsj>'06:31' and fcsj<'08:00' group by qdz_name union " | ||
| 397 | + + " select qdz_name, count(cl_zbh) as cls , 'wqc' as lx from bsth_c_s_sp_info " | ||
| 398 | + + " where DATE_FORMAT(schedule_date,'%Y-%m-%d') ='"+date+"' and xl_bm='"+line+"' " | ||
| 399 | + + " and bc_type='normal' and fcsj>'16:01' and fcsj<'18:00' group by qdz_name union " | ||
| 400 | + + " select qdz_name, count(cl_zbh) as cls , 'zqj' as lx from bsth_c_s_sp_info " | ||
| 401 | + + " where DATE_FORMAT(schedule_date,'%Y-%m-%d') ='"+date+"' and xl_bm='"+line+"' " | ||
| 402 | + + " and bc_type='region' and fcsj>'06:31' and fcsj<'08:00' group by qdz_name union " | ||
| 403 | + + " select qdz_name, count(cl_zbh) as cls , 'wqj' as lx from bsth_c_s_sp_info " | ||
| 404 | + + " where DATE_FORMAT(schedule_date,'%Y-%m-%d') ='"+date+"' and xl_bm='"+line+"' " | ||
| 405 | + + " and bc_type='region' and fcsj>'16:01' and fcsj<'18:00'group by qdz_name"; | ||
| 406 | + | ||
| 407 | + List<Map<String, Object>> lists= jdbcTemplate.query(sqlZd, | ||
| 408 | + new RowMapper<Map<String, Object>>(){ | ||
| 409 | + @Override | ||
| 410 | + public Map<String, Object> mapRow(ResultSet rs, int rowNum) throws SQLException { | ||
| 411 | + Map<String, Object> m=new HashMap<String,Object>(); | ||
| 412 | + m.put("zdm", rs.getString("qdz_name")); | ||
| 413 | + m.put("cls", rs.getString("cls")); | ||
| 414 | + m.put("lx", rs.getString("lx")); | ||
| 415 | + return m; | ||
| 416 | + } | ||
| 417 | + }); | ||
| 418 | + int a=0; | ||
| 419 | + int b=0; | ||
| 420 | + int c=0; | ||
| 421 | + int d=0; | ||
| 422 | + for(int i=0;i<lists.size();i++){ | ||
| 423 | + boolean fage=true; | ||
| 424 | + Map<String, Object> newMap= new HashMap<String, Object>(); | ||
| 425 | + list.add(newMap); | ||
| 426 | + Map<String, Object> maps=lists.get(i); | ||
| 427 | + if(maps.get("lx").equals("zqc")){ | ||
| 428 | + list.get(a).put("zqcZm", maps.get("zdm")); | ||
| 429 | + list.get(a).put("zqcCls", maps.get("cls")); | ||
| 430 | + a++; | ||
| 431 | + fage=false; | ||
| 432 | + }else if(maps.get("lx").equals("wqc")){ | ||
| 433 | + list.get(b).put("wqcZm", maps.get("zdm")); | ||
| 434 | + list.get(b).put("wqcCls", maps.get("cls")); | ||
| 435 | + b++; | ||
| 436 | + fage=false; | ||
| 437 | + }else if(maps.get("lx").equals("zqj")){ | ||
| 438 | + list.get(c).put("zqjZm", maps.get("zdm")); | ||
| 439 | + list.get(c).put("zqjCls", maps.get("cls")); | ||
| 440 | + c++; | ||
| 441 | + fage=false; | ||
| 442 | + }else if(maps.get("lx").equals("wqj")){ | ||
| 443 | + list.get(d).put("wqjZm", maps.get("zdm")); | ||
| 444 | + list.get(d).put("wqjCls", maps.get("cls")); | ||
| 445 | + d++; | ||
| 446 | + fage=false; | ||
| 447 | + } | ||
| 448 | + if(fage){ | ||
| 449 | + break; | ||
| 450 | + } | ||
| 451 | + } | ||
| 452 | + boolean status=true; | ||
| 453 | + while (status) { | ||
| 454 | + for (int i = 0; i < list.size(); i++) { | ||
| 455 | + if(list.get(i).isEmpty()){ | ||
| 456 | + list.remove(i); | ||
| 457 | + status=true; | ||
| 458 | + }else{ | ||
| 459 | + status=false; | ||
| 460 | + } | ||
| 461 | + } | ||
| 462 | + | ||
| 463 | + } | ||
| 464 | + return list; | ||
| 465 | + } | ||
| 466 | + @Override | ||
| 467 | + public List<Map<String, Object>> tbodyTime5(String line, String date) { | ||
| 468 | + // TODO Auto-generated method stub | ||
| 469 | + String sql="select min(fcsj) as fcsj,'lx0' as lx from bsth_c_s_sp_info where " | ||
| 470 | + + " DATE_FORMAT(schedule_date,'%Y-%m-%d') ='"+date+"' and xl_bm='"+line+"'" | ||
| 471 | + + " and bc_type='out' and xl_dir=0 union " | ||
| 472 | + + " select min(fcsj) as fcsj,'lx1' as lx from bsth_c_s_sp_info where " | ||
| 473 | + + " DATE_FORMAT(schedule_date,'%Y-%m-%d') ='"+date+"' and xl_bm='"+line+"'" | ||
| 474 | + + " and bc_type='out' and xl_dir=1"; | ||
| 475 | + List<Map<String, Object>> lists= jdbcTemplate.query(sql, | ||
| 476 | + new RowMapper<Map<String, Object>>(){ | ||
| 477 | + @Override | ||
| 478 | + public Map<String, Object> mapRow(ResultSet rs, int rowNum) throws SQLException { | ||
| 479 | + Map<String, Object> m=new HashMap<String,Object>(); | ||
| 480 | + m.put("lx", rs.getString("lx")); | ||
| 481 | + m.put("fcsj", rs.getString("fcsj")); | ||
| 482 | + return m; | ||
| 483 | + } | ||
| 484 | + }); | ||
| 485 | + | ||
| 486 | + String sqlList="select * from bsth_c_s_sp_info where " | ||
| 487 | + + "DATE_FORMAT(schedule_date,'%Y-%m-%d') ='"+date+"' and xl_bm='"+line+"'" | ||
| 488 | + + " and bc_type='normal' order by fcsj"; | ||
| 489 | + List<SchedulePlanInfo> list= jdbcTemplate.query(sqlList, | ||
| 490 | + new RowMapper<SchedulePlanInfo>(){ | ||
| 491 | + @Override | ||
| 492 | + public SchedulePlanInfo mapRow(ResultSet rs, int rowNum) throws SQLException { | ||
| 493 | + SchedulePlanInfo m=new SchedulePlanInfo(); | ||
| 494 | + m.setBcsj(rs.getInt("bcsj")); | ||
| 495 | + m.setXlDir(rs.getString("xl_dir")); | ||
| 496 | + m.setFcsj(rs.getString("fcsj")); | ||
| 497 | + return m; | ||
| 498 | + } | ||
| 499 | + }); | ||
| 500 | + //上下行最早发车时间 (用于与夜班线 跨零点的班次进行比较) | ||
| 501 | + String lx0=""; | ||
| 502 | + String lx1=""; | ||
| 503 | + for (int x = 0; x < lists.size(); x++) { | ||
| 504 | + if(lists.get(x).get("lx").equals("lx0")){ | ||
| 505 | + lx0=lists.get(x).get("fcsj")==null?"0:0":lists.get(x).get("fcsj").toString(); | ||
| 506 | + }else{ | ||
| 507 | + lx1=lists.get(x).get("fcsj")==null?"0:0":lists.get(x).get("fcsj").toString(); | ||
| 508 | + } | ||
| 509 | + } | ||
| 510 | + | ||
| 511 | + String[] lx0sj = lx0.split(":"); | ||
| 512 | + int sxFc=Integer.parseInt(lx0sj[0])*60+Integer.parseInt(lx0sj[1]); | ||
| 513 | + String[] lx1sj = lx1.split(":"); | ||
| 514 | + int xxFc=Integer.parseInt(lx1sj[0])*60+Integer.parseInt(lx1sj[1]); | ||
| 515 | + //班次 | ||
| 516 | + int sj_0 = 6*60+31,sj_1 = 8*60+30,sj_2 = 16*60+1,sj_3 = 18*60; | ||
| 517 | + | ||
| 518 | + //顺序 出场--早高峰---中午---晚高峰---进场 | ||
| 519 | + //实驶时间时间(分),0为上行,1为下行 | ||
| 520 | + int ccsj0=0,ccsj1=0,zgf0=0,zgf1=0,zw0=0,zw1=0,wgf0=0,wgf1=0,jcsj0=0,jcsj1=0; | ||
| 521 | + | ||
| 522 | + //记录上一个发车时间(方便记录间距) | ||
| 523 | + int cfc0=0,cfc1=0,zfc0=0,zfc1=0,zwfc0=0,zwfc1=0,wfc0=0,wfc1=0,jcfc0Z=0,jcfc1Z=0,jcfc0W=0,jcfc1W=0; | ||
| 524 | + //车距 (发车时间的间距) i--MIN a--MAX | ||
| 525 | + int iC=999,aC=-1,iZg=999,aZg=-1,iZw=999,aZw=-1,iWg=999,aWg=-1,iJcZ=999,aJcZ=-1,iJcW=999,aJcW=-1; | ||
| 526 | + int iC1=999,aC1=-1,iZg1=999,aZg1=-1,iZw1=999,aZw1=-1,iWg1=999,aWg1=-1,iJc1Z=999,aJc1Z=-1,iJc1W=999,aJc1W=-1; | ||
| 527 | +// List<ScheduleRealInfo> list = scheduleRealInfoRepository.scheduleByDateAndLine(line, date); | ||
| 528 | + for(int i=0;i<list.size();i++){ | ||
| 529 | + SchedulePlanInfo t=list.get(i); | ||
| 530 | + String xlDir=t.getXlDir(); | ||
| 531 | + int bcsj=t.getBcsj(); | ||
| 532 | + String fcsj=t.getFcsj(); | ||
| 533 | + String[] fcsjs=fcsj.split(":"); | ||
| 534 | + int fcsjNum=Integer.parseInt(fcsjs[0])*60+Integer.parseInt(fcsjs[1]); | ||
| 535 | + | ||
| 536 | + if(xlDir.equals("0")){ | ||
| 537 | + if(fcsjNum>=sxFc && fcsjNum<sj_0){ | ||
| 538 | + ccsj0 +=bcsj; | ||
| 539 | + if(aC<0){ | ||
| 540 | + cfc0 =fcsjNum; | ||
| 541 | + aC=0; | ||
| 542 | + }else{ | ||
| 543 | + if(fcsjNum-cfc0<iC){ | ||
| 544 | + iC=fcsjNum-cfc0; | ||
| 545 | + } | ||
| 546 | + if(fcsjNum-cfc0>aC){ | ||
| 547 | + aC=fcsjNum-cfc0; | ||
| 548 | + } | ||
| 549 | + | ||
| 550 | + cfc0=fcsjNum; | ||
| 551 | + } | ||
| 552 | + | ||
| 553 | + }else if(fcsjNum>=sj_0 && fcsjNum<=sj_1){ | ||
| 554 | + zgf0 +=bcsj; | ||
| 555 | + if(aZg<0){ | ||
| 556 | + zfc0 =fcsjNum; | ||
| 557 | + aZg=0; | ||
| 558 | + }else{ | ||
| 559 | + if(fcsjNum-zfc0<iZg){ | ||
| 560 | + iZg=fcsjNum-zfc0; | ||
| 561 | + } | ||
| 562 | + | ||
| 563 | + if(fcsjNum-zfc0>aZg){ | ||
| 564 | + aZg=fcsjNum-zfc0; | ||
| 565 | + } | ||
| 566 | + | ||
| 567 | + zfc0=fcsjNum; | ||
| 568 | + } | ||
| 569 | + }else if(fcsjNum>sj_1 && fcsjNum<sj_2){ | ||
| 570 | + zw0 +=bcsj; | ||
| 571 | + if(aZw<0){ | ||
| 572 | + zwfc0 =fcsjNum; | ||
| 573 | + aZw=0; | ||
| 574 | + }else{ | ||
| 575 | + if(fcsjNum-zwfc0<iZw){ | ||
| 576 | + iZw=fcsjNum-zwfc0; | ||
| 577 | + } | ||
| 578 | + if(fcsjNum-zwfc0>aZw){ | ||
| 579 | + aZw=fcsjNum-zwfc0; | ||
| 580 | + } | ||
| 581 | + zwfc0=fcsjNum; | ||
| 582 | + } | ||
| 583 | + | ||
| 584 | + }else if(fcsjNum>=sj_2 && fcsjNum<=sj_3){ | ||
| 585 | + wgf0 +=bcsj; | ||
| 586 | + if(aWg<0){ | ||
| 587 | + wfc0=fcsjNum; | ||
| 588 | + aWg=0; | ||
| 589 | + }else{ | ||
| 590 | + if(fcsjNum-wfc0<iWg){ | ||
| 591 | + iWg=fcsjNum-wfc0; | ||
| 592 | + } | ||
| 593 | + if(fcsjNum-wfc0>aWg){ | ||
| 594 | + aWg=fcsjNum-wfc0; | ||
| 595 | + } | ||
| 596 | + wfc0=fcsjNum; | ||
| 597 | + } | ||
| 598 | + }else if(fcsjNum>sj_3){ | ||
| 599 | + jcsj0 +=bcsj; | ||
| 600 | + if(aJcW<0){ | ||
| 601 | + jcfc0W=fcsjNum; | ||
| 602 | + aJcW=0; | ||
| 603 | + }else{ | ||
| 604 | + if(fcsjNum-jcfc0W<iJcW){ | ||
| 605 | + iJcW=fcsjNum-jcfc0W; | ||
| 606 | + } | ||
| 607 | + if(fcsjNum-jcfc0W>aJcW){ | ||
| 608 | + aJcW=fcsjNum-jcfc0W; | ||
| 609 | + } | ||
| 610 | + jcfc0W=fcsjNum; | ||
| 611 | + } | ||
| 612 | + }else if(fcsjNum<sxFc){ | ||
| 613 | + jcsj0 +=bcsj; | ||
| 614 | + if(aJcZ<0){ | ||
| 615 | + jcfc0Z=fcsjNum; | ||
| 616 | + aJcZ=0; | ||
| 617 | + }else{ | ||
| 618 | + if(fcsjNum-jcfc0Z<iJcZ){ | ||
| 619 | + iJcZ=fcsjNum-jcfc0Z; | ||
| 620 | + } | ||
| 621 | + if(fcsjNum-jcfc0Z>aJcZ){ | ||
| 622 | + aJcZ=fcsjNum-jcfc0Z; | ||
| 623 | + } | ||
| 624 | + jcfc0Z=fcsjNum; | ||
| 625 | + } | ||
| 626 | + } | ||
| 627 | + | ||
| 628 | + | ||
| 629 | + }else{ | ||
| 630 | + if(fcsjNum>=xxFc && fcsjNum<sj_0){ | ||
| 631 | + ccsj1 +=bcsj; | ||
| 632 | + if(aC1<0){ | ||
| 633 | + cfc1=fcsjNum; | ||
| 634 | + aC1=0; | ||
| 635 | + }else{ | ||
| 636 | + if(fcsjNum-cfc1<iC1){ | ||
| 637 | + iC1=fcsjNum-cfc1; | ||
| 638 | + } | ||
| 639 | + if(fcsjNum-cfc1>aC1){ | ||
| 640 | + aC1=fcsjNum-cfc1; | ||
| 641 | + } | ||
| 642 | + cfc1=fcsjNum; | ||
| 643 | + } | ||
| 644 | + }else if(fcsjNum>=sj_0 && fcsjNum<=sj_1){ | ||
| 645 | + zgf1 +=bcsj; | ||
| 646 | + if(aZg1<0){ | ||
| 647 | + zfc1=fcsjNum; | ||
| 648 | + aZg1=0; | ||
| 649 | + }else{ | ||
| 650 | + if(fcsjNum-zfc1<iZg1){ | ||
| 651 | + iZg1=fcsjNum-zfc1; | ||
| 652 | + } | ||
| 653 | + if(fcsjNum-zfc1>aZg1){ | ||
| 654 | + aZg1=fcsjNum-zfc1; | ||
| 655 | + } | ||
| 656 | + | ||
| 657 | + zfc1=fcsjNum; | ||
| 658 | + } | ||
| 659 | + }else if(fcsjNum>sj_1 && fcsjNum<sj_2){ | ||
| 660 | + zw1 +=bcsj; | ||
| 661 | + if(aZw1<0){ | ||
| 662 | + zwfc1=fcsjNum; | ||
| 663 | + aZw1=0; | ||
| 664 | + }else{ | ||
| 665 | + if(fcsjNum-zwfc1<iZw1){ | ||
| 666 | + iZw1=fcsjNum-zwfc1; | ||
| 667 | + } | ||
| 668 | + if(fcsjNum-zwfc1>aZw1){ | ||
| 669 | + aZw1=fcsjNum-zwfc1; | ||
| 670 | + } | ||
| 671 | + zwfc1=fcsjNum; | ||
| 672 | + } | ||
| 673 | + }else if(fcsjNum>=sj_2 && fcsjNum<=sj_3){ | ||
| 674 | + wgf1 +=bcsj; | ||
| 675 | + if(aWg1<0){ | ||
| 676 | + wfc1=fcsjNum; | ||
| 677 | + aWg1=0; | ||
| 678 | + }else{ | ||
| 679 | + if(fcsjNum-wfc1<iWg1){ | ||
| 680 | + iWg1=fcsjNum-wfc1; | ||
| 681 | + } | ||
| 682 | + if(fcsjNum-wfc1<aWg1){ | ||
| 683 | + aWg1=fcsjNum-wfc1; | ||
| 684 | + } | ||
| 685 | + wfc1=fcsjNum; | ||
| 686 | + } | ||
| 687 | + }else if(fcsjNum>sj_3){ | ||
| 688 | + jcsj1 +=bcsj; | ||
| 689 | + if(aJc1W<0){ | ||
| 690 | + jcfc1W=fcsjNum; | ||
| 691 | + aJc1W=0; | ||
| 692 | + }else{ | ||
| 693 | + if(fcsjNum-jcfc1W<iJc1W){ | ||
| 694 | + aJc1W=fcsjNum-jcfc1W; | ||
| 695 | + } | ||
| 696 | + if(fcsjNum-jcfc1W>aJc1W){ | ||
| 697 | + aJc1W=fcsjNum-jcfc1W; | ||
| 698 | + } | ||
| 699 | + | ||
| 700 | + jcfc1W=fcsjNum; | ||
| 701 | + } | ||
| 702 | + }else if(fcsjNum<xxFc){ | ||
| 703 | + jcsj1 +=bcsj; | ||
| 704 | + if(aJc1Z<0){ | ||
| 705 | + jcfc1Z=fcsjNum; | ||
| 706 | + aJc1Z=0; | ||
| 707 | + }else{ | ||
| 708 | + if(fcsjNum-jcfc1Z<iJc1Z){ | ||
| 709 | + aJc1Z=fcsjNum-jcfc1Z; | ||
| 710 | + } | ||
| 711 | + if(fcsjNum-jcfc1Z>aJc1Z){ | ||
| 712 | + aJc1Z=fcsjNum-jcfc1Z; | ||
| 713 | + } | ||
| 714 | + | ||
| 715 | + jcfc1Z=fcsjNum; | ||
| 716 | + } | ||
| 717 | + } | ||
| 718 | + } | ||
| 719 | + | ||
| 720 | + } | ||
| 721 | + | ||
| 722 | + | ||
| 723 | + List<Map<String, Object>> newList=new ArrayList<Map<String,Object>>(); | ||
| 724 | + Map<String, Object> newmap1=new HashMap<String,Object>(); | ||
| 725 | + Map<String, Object> newmap2=new HashMap<String,Object>(); | ||
| 726 | + Map<String, Object> newmap3=new HashMap<String,Object>(); | ||
| 727 | + Map<String, Object> newmap4=new HashMap<String,Object>(); | ||
| 728 | + Map<String, Object> newmap5=new HashMap<String,Object>(); | ||
| 729 | + newmap1.put("sjd", "(首)——6:30"); | ||
| 730 | + newmap1.put("sxsj", ccsj0); | ||
| 731 | + newmap1.put("xxsj", ccsj1); | ||
| 732 | + newmap1.put("fqsj", ccsj0+ccsj1); | ||
| 733 | + newmap1.put("cj", (iC-iC1>0?iC1:iC)+"——"+(aC-aC1>0?aC:aC1)); | ||
| 734 | + | ||
| 735 | + newmap2.put("sjd", "6:31——8:30"); | ||
| 736 | + newmap2.put("sxsj", zgf0); | ||
| 737 | + newmap2.put("xxsj", zgf1); | ||
| 738 | + newmap2.put("fqsj", zgf1+zgf0); | ||
| 739 | + newmap2.put("cj", (iZg-iZg1>0?iZg1:iZg)+"——"+(aZg-aZg1>0?aZg:aZg1)); | ||
| 740 | + | ||
| 741 | + newmap3.put("sjd", "8:30——16:00"); | ||
| 742 | + newmap3.put("sxsj", zw0); | ||
| 743 | + newmap3.put("xxsj", zw1); | ||
| 744 | + newmap3.put("fqsj", zw0+zw1); | ||
| 745 | + newmap3.put("cj", (iZw-iZw1>0?iZw1:iZw)+"——"+(aZw-aZw1>0?aZw:aZw1)); | ||
| 746 | + | ||
| 747 | + newmap4.put("sjd", "16:01——18:00"); | ||
| 748 | + newmap4.put("sxsj", wgf0); | ||
| 749 | + newmap4.put("xxsj", wgf1); | ||
| 750 | + newmap4.put("fqsj", wgf0+wgf1); | ||
| 751 | + newmap4.put("cj", (iWg-iWg1>0?iWg1:iWg)+"——"+(aWg-aWg1>0?aWg:aWg1)); | ||
| 752 | + | ||
| 753 | + newmap5.put("sjd", "18:00——(末)"); | ||
| 754 | + newmap5.put("sxsj", jcsj0); | ||
| 755 | + newmap5.put("xxsj", jcsj1); | ||
| 756 | + newmap5.put("fqsj", jcsj0+jcsj1); | ||
| 757 | + int min0=iJcZ-iJcW>0?iJcW:iJcZ; | ||
| 758 | + int max0=aJcZ-aJcW>0?aJcZ:aJcW; | ||
| 759 | + int min1=iJc1Z-iJc1W>0?iJc1W:iJc1Z; | ||
| 760 | + int max1=aJc1Z-aJc1W>0?aJc1Z:aJc1W; | ||
| 761 | + newmap5.put("cj", (min0-min1>0?min1:min0)+"——"+(max0-max1>0?max0:max1)); | ||
| 762 | + | ||
| 763 | + newList.add(newmap1); | ||
| 764 | + newList.add(newmap2); | ||
| 765 | + newList.add(newmap3); | ||
| 766 | + newList.add(newmap4); | ||
| 767 | + newList.add(newmap5); | ||
| 768 | + return newList; | ||
| 769 | + } | ||
| 256 | } | 770 | } |
src/main/java/com/bsth/service/schedule/PeopleCarPlanServiceImpl.java
| @@ -26,6 +26,7 @@ import com.bsth.entity.schedule.SchedulePlanInfo; | @@ -26,6 +26,7 @@ import com.bsth.entity.schedule.SchedulePlanInfo; | ||
| 26 | import com.bsth.entity.schedule.TTInfoDetail; | 26 | import com.bsth.entity.schedule.TTInfoDetail; |
| 27 | import com.bsth.repository.realcontrol.ScheduleRealInfoRepository; | 27 | import com.bsth.repository.realcontrol.ScheduleRealInfoRepository; |
| 28 | import com.bsth.util.ReportUtils; | 28 | import com.bsth.util.ReportUtils; |
| 29 | +import com.ibm.wsdl.util.xml.DOM2Writer; | ||
| 29 | 30 | ||
| 30 | @Service | 31 | @Service |
| 31 | public class PeopleCarPlanServiceImpl implements PeopleCarPlanService { | 32 | public class PeopleCarPlanServiceImpl implements PeopleCarPlanService { |
| @@ -378,9 +379,11 @@ public class PeopleCarPlanServiceImpl implements PeopleCarPlanService { | @@ -378,9 +379,11 @@ public class PeopleCarPlanServiceImpl implements PeopleCarPlanService { | ||
| 378 | @Override | 379 | @Override |
| 379 | public ScheduleRealInfo mapRow(ResultSet rs, int rowNum) throws SQLException { | 380 | public ScheduleRealInfo mapRow(ResultSet rs, int rowNum) throws SQLException { |
| 380 | ScheduleRealInfo schedule = new ScheduleRealInfo(); | 381 | ScheduleRealInfo schedule = new ScheduleRealInfo(); |
| 382 | + schedule.setScheduleDateStr(rs.getString("schedule_date_Str")); | ||
| 381 | schedule.setXlName(rs.getString("xl_name")); | 383 | schedule.setXlName(rs.getString("xl_name")); |
| 382 | schedule.setBcType(rs.getString("bc_type")); | 384 | schedule.setBcType(rs.getString("bc_type")); |
| 383 | schedule.setBcs(rs.getInt("bcs")); | 385 | schedule.setBcs(rs.getInt("bcs")); |
| 386 | + schedule.setFcno(rs.getInt("fcno")); | ||
| 384 | schedule.setFcsj(rs.getString("fcsj")); | 387 | schedule.setFcsj(rs.getString("fcsj")); |
| 385 | schedule.setFcsjActual(rs.getString("fcsj_actual")); | 388 | schedule.setFcsjActual(rs.getString("fcsj_actual")); |
| 386 | schedule.setZdsj(rs.getString("zdsj")); | 389 | schedule.setZdsj(rs.getString("zdsj")); |
| @@ -402,6 +405,7 @@ public class PeopleCarPlanServiceImpl implements PeopleCarPlanService { | @@ -402,6 +405,7 @@ public class PeopleCarPlanServiceImpl implements PeopleCarPlanService { | ||
| 402 | TTInfoDetail ttInfo = new TTInfoDetail(); | 405 | TTInfoDetail ttInfo = new TTInfoDetail(); |
| 403 | ttInfo.setBcType(rs.getString("bc_type")); | 406 | ttInfo.setBcType(rs.getString("bc_type")); |
| 404 | ttInfo.setBcs(rs.getInt("bcs")); | 407 | ttInfo.setBcs(rs.getInt("bcs")); |
| 408 | + ttInfo.setFcno(rs.getInt("fcno")); | ||
| 405 | ttInfo.setFcsj(rs.getString("fcsj")); | 409 | ttInfo.setFcsj(rs.getString("fcsj")); |
| 406 | ttInfo.setBcsj(rs.getInt("bcsj")); | 410 | ttInfo.setBcsj(rs.getInt("bcsj")); |
| 407 | return ttInfo; | 411 | return ttInfo; |
| @@ -415,22 +419,24 @@ public class PeopleCarPlanServiceImpl implements PeopleCarPlanService { | @@ -415,22 +419,24 @@ public class PeopleCarPlanServiceImpl implements PeopleCarPlanService { | ||
| 415 | 419 | ||
| 416 | //分组计算 同时判断是否所选时刻信息 | 420 | //分组计算 同时判断是否所选时刻信息 |
| 417 | for(ScheduleRealInfo schedule : list){ | 421 | for(ScheduleRealInfo schedule : list){ |
| 418 | - if(model.length() != 0){ | ||
| 419 | - for(TTInfoDetail tt : ttList){ | ||
| 420 | - if(tt.getBcs() == schedule.getBcs() && tt.getFcsj().equals(schedule.getFcsj()) | ||
| 421 | - && tt.getBcsj() == schedule.getBcsj()){ | ||
| 422 | - String key = schedule.getXlName()+"/"+schedule.getQdzName()+"/"+schedule.getFcsj(); | ||
| 423 | - if(!keyMap.containsKey(key)) | ||
| 424 | - keyMap.put(key, new ArrayList<ScheduleRealInfo>()); | ||
| 425 | - keyMap.get(key).add(schedule); | ||
| 426 | - continue; | 422 | + DO:{ |
| 423 | + if(model.length() != 0){ | ||
| 424 | + for(TTInfoDetail tt : ttList){ | ||
| 425 | + if(tt.getBcs() == schedule.getBcs() && tt.getFcno() == schedule.getFcno() | ||
| 426 | + && tt.getFcsj().equals(schedule.getFcsj()) && tt.getBcsj() == schedule.getBcsj()){ | ||
| 427 | + String key = schedule.getXlName()+"/"+schedule.getQdzName()+"/"+schedule.getFcsj(); | ||
| 428 | + if(!keyMap.containsKey(key)) | ||
| 429 | + keyMap.put(key, new ArrayList<ScheduleRealInfo>()); | ||
| 430 | + keyMap.get(key).add(schedule); | ||
| 431 | + break DO; | ||
| 432 | + } | ||
| 427 | } | 433 | } |
| 434 | + } else { | ||
| 435 | + String key = schedule.getXlName()+"/"+schedule.getQdzName()+"/"+schedule.getFcsj(); | ||
| 436 | + if(!keyMap.containsKey(key)) | ||
| 437 | + keyMap.put(key, new ArrayList<ScheduleRealInfo>()); | ||
| 438 | + keyMap.get(key).add(schedule); | ||
| 428 | } | 439 | } |
| 429 | - } else { | ||
| 430 | - String key = schedule.getXlName()+"/"+schedule.getQdzName()+"/"+schedule.getFcsj(); | ||
| 431 | - if(!keyMap.containsKey(key)) | ||
| 432 | - keyMap.put(key, new ArrayList<ScheduleRealInfo>()); | ||
| 433 | - keyMap.get(key).add(schedule); | ||
| 434 | } | 440 | } |
| 435 | } | 441 | } |
| 436 | for(String key : keyMap.keySet()){ | 442 | for(String key : keyMap.keySet()){ |
| @@ -440,7 +446,12 @@ public class PeopleCarPlanServiceImpl implements PeopleCarPlanService { | @@ -440,7 +446,12 @@ public class PeopleCarPlanServiceImpl implements PeopleCarPlanService { | ||
| 440 | int jhbc = 0; | 446 | int jhbc = 0; |
| 441 | int sjbc = 0; | 447 | int sjbc = 0; |
| 442 | for(ScheduleRealInfo schedule : keyMap.get(key)){ | 448 | for(ScheduleRealInfo schedule : keyMap.get(key)){ |
| 449 | + tempMap.put("date", schedule.getScheduleDateStr()); | ||
| 443 | tempMap.put("bcsj", schedule.getBcsj()); | 450 | tempMap.put("bcsj", schedule.getBcsj()); |
| 451 | + if(schedule.getFcsjActual() != null){ | ||
| 452 | + String[] fcsj_ = schedule.getFcsjActual().split(":"); | ||
| 453 | + tempMap.put("fcsj_", (Integer.valueOf(fcsj_[0]) * 60) + Integer.valueOf(fcsj_[1])); | ||
| 454 | + } | ||
| 444 | jhbc++; | 455 | jhbc++; |
| 445 | if(schedule.getZdsjActual() != null && schedule.getFcsjActual() != null){ | 456 | if(schedule.getZdsjActual() != null && schedule.getFcsjActual() != null){ |
| 446 | sjbc++; | 457 | sjbc++; |
| @@ -541,6 +552,8 @@ public class PeopleCarPlanServiceImpl implements PeopleCarPlanService { | @@ -541,6 +552,8 @@ public class PeopleCarPlanServiceImpl implements PeopleCarPlanService { | ||
| 541 | int currPage = Integer.valueOf(page); | 552 | int currPage = Integer.valueOf(page); |
| 542 | modelMap.put("totalPage", resList.size()%10>0?(resList.size()/10 + 1):resList.size()/10); | 553 | modelMap.put("totalPage", resList.size()%10>0?(resList.size()/10 + 1):resList.size()/10); |
| 543 | modelMap.put("dataList", resList.subList(currPage*10,((currPage+1)*10)>=resList.size()?resList.size():(currPage+1)*10)); | 554 | modelMap.put("dataList", resList.subList(currPage*10,((currPage+1)*10)>=resList.size()?resList.size():(currPage+1)*10)); |
| 555 | + } else { | ||
| 556 | + modelMap.put("dataList", resList); | ||
| 544 | } | 557 | } |
| 545 | 558 | ||
| 546 | //导出 | 559 | //导出 |
| @@ -616,7 +629,7 @@ public class PeopleCarPlanServiceImpl implements PeopleCarPlanService { | @@ -616,7 +629,7 @@ public class PeopleCarPlanServiceImpl implements PeopleCarPlanService { | ||
| 616 | 629 | ||
| 617 | Set<Integer> ruleDays1 = new HashSet<Integer>(); | 630 | Set<Integer> ruleDays1 = new HashSet<Integer>(); |
| 618 | List<String> specialDays1 = new ArrayList<String>(); | 631 | List<String> specialDays1 = new ArrayList<String>(); |
| 619 | - for(int i = 0; ; i++){ | 632 | + for(long i = 0; ; i++){ |
| 620 | Date tempDate = new Date(date1.getTime() + i*1000*60*60*24); | 633 | Date tempDate = new Date(date1.getTime() + i*1000*60*60*24); |
| 621 | if(tempDate.getTime() > date2.getTime()) | 634 | if(tempDate.getTime() > date2.getTime()) |
| 622 | break; | 635 | break; |
| @@ -701,7 +714,12 @@ public class PeopleCarPlanServiceImpl implements PeopleCarPlanService { | @@ -701,7 +714,12 @@ public class PeopleCarPlanServiceImpl implements PeopleCarPlanService { | ||
| 701 | List<Long> longList0 = new ArrayList<Long>(); | 714 | List<Long> longList0 = new ArrayList<Long>(); |
| 702 | Map<Long, ScheduleRealInfo> temp1 = new HashMap<Long, ScheduleRealInfo>(); | 715 | Map<Long, ScheduleRealInfo> temp1 = new HashMap<Long, ScheduleRealInfo>(); |
| 703 | List<Long> longList1 = new ArrayList<Long>(); | 716 | List<Long> longList1 = new ArrayList<Long>(); |
| 717 | + String company = "", subCompany = ""; | ||
| 704 | for(ScheduleRealInfo schedule : keyMap.get(key)){ | 718 | for(ScheduleRealInfo schedule : keyMap.get(key)){ |
| 719 | + if(schedule.getGsName() != null && company.length() == 0) | ||
| 720 | + company = schedule.getGsName(); | ||
| 721 | + if(schedule.getFgsName() != null && subCompany.length() == 0) | ||
| 722 | + subCompany = schedule.getFgsName(); | ||
| 705 | String[] split = schedule.getFcsj().split(":"); | 723 | String[] split = schedule.getFcsj().split(":"); |
| 706 | long min = Integer.valueOf(split[0])*60 + Integer.valueOf(split[1]); | 724 | long min = Integer.valueOf(split[0])*60 + Integer.valueOf(split[1]); |
| 707 | schedule.setFcsjT(min); | 725 | schedule.setFcsjT(min); |
| @@ -720,6 +738,8 @@ public class PeopleCarPlanServiceImpl implements PeopleCarPlanService { | @@ -720,6 +738,8 @@ public class PeopleCarPlanServiceImpl implements PeopleCarPlanService { | ||
| 720 | ScheduleRealInfo shouban1 = temp1.get(longList1.get(0)); | 738 | ScheduleRealInfo shouban1 = temp1.get(longList1.get(0)); |
| 721 | ScheduleRealInfo moban1 = temp1.get(longList1.get(longList1.size() - 1)); | 739 | ScheduleRealInfo moban1 = temp1.get(longList1.get(longList1.size() - 1)); |
| 722 | tempMap.put("date", date); | 740 | tempMap.put("date", date); |
| 741 | + tempMap.put("company", company); | ||
| 742 | + tempMap.put("subCompany", subCompany); | ||
| 723 | tempMap.put("line", key); | 743 | tempMap.put("line", key); |
| 724 | tempMap.put("qdzFirst0", shouban0.getQdzName()); | 744 | tempMap.put("qdzFirst0", shouban0.getQdzName()); |
| 725 | tempMap.put("jhfcFirst0", shouban0.getFcsj()); | 745 | tempMap.put("jhfcFirst0", shouban0.getFcsj()); |
src/main/resources/application-dev.properties
| @@ -8,9 +8,12 @@ spring.jpa.hibernate.naming_strategy= org.hibernate.cfg.ImprovedNamingStrategy | @@ -8,9 +8,12 @@ spring.jpa.hibernate.naming_strategy= org.hibernate.cfg.ImprovedNamingStrategy | ||
| 8 | spring.jpa.database= MYSQL | 8 | spring.jpa.database= MYSQL |
| 9 | spring.jpa.show-sql= false | 9 | spring.jpa.show-sql= false |
| 10 | spring.datasource.driver-class-name= com.mysql.jdbc.Driver | 10 | spring.datasource.driver-class-name= com.mysql.jdbc.Driver |
| 11 | -spring.datasource.url= jdbc:mysql://192.168.168.201/control?useUnicode=true&characterEncoding=utf-8&useSSL=false | 11 | +spring.datasource.url= jdbc:mysql://192.168.168.201/mh_control?useUnicode=true&characterEncoding=utf-8&useSSL=false |
| 12 | spring.datasource.username= root | 12 | spring.datasource.username= root |
| 13 | spring.datasource.password= 123456 | 13 | spring.datasource.password= 123456 |
| 14 | +#spring.datasource.url= jdbc:mysql://192.168.168.117/pd_control?useUnicode=true&characterEncoding=utf-8&useSSL=false | ||
| 15 | +#spring.datasource.username= root | ||
| 16 | +#spring.datasource.password= root | ||
| 14 | #DATASOURCE | 17 | #DATASOURCE |
| 15 | spring.datasource.max-active=100 | 18 | spring.datasource.max-active=100 |
| 16 | spring.datasource.max-idle=8 | 19 | spring.datasource.max-idle=8 |
src/main/resources/static/assets/plugins/fileinput/fileinput.min.js
| 1 | -/*! | ||
| 2 | - * bootstrap-fileinput v4.3.6 | ||
| 3 | - * http://plugins.krajee.com/file-input | ||
| 4 | - * | ||
| 5 | - * Author: Kartik Visweswaran | ||
| 6 | - * Copyright: 2014 - 2016, Kartik Visweswaran, Krajee.com | ||
| 7 | - * | ||
| 8 | - * Licensed under the BSD 3-Clause | ||
| 9 | - * https://github.com/kartik-v/bootstrap-fileinput/blob/master/LICENSE.md | ||
| 10 | - */!function(a){"use strict";"function"==typeof define&&define.amd?define(["jquery"],a):"object"==typeof module&&module.exports?module.exports=a(require("jquery")):a(window.jQuery)}(function(a){"use strict";a.fn.fileinputLocales={},a.fn.fileinputThemes={};var b,c,d,e,f,g,h,i,j,k,l,m,n,o,p,q,r,s,t,u,v,w,x,y,z,A,B,C,D,E,F,G,H,I,J,K,L,M,N,O,P,Q,R,S,T,U,V,W,X,Y,Z,$,_,aa,ba,ca,da,ea,fa,ga,ha,ia,ja,ka,la,ma,na,oa;b=".fileinput",c="kvFileinputModal",d='style="width:{width};height:{height};"',e='<param name="controller" value="true" />\n<param name="allowFullScreen" value="true" />\n<param name="allowScriptAccess" value="always" />\n<param name="autoPlay" value="false" />\n<param name="autoStart" value="false" />\n<param name="quality" value="high" />\n',f='<div class="file-preview-other">\n<span class="{previewFileIconClass}">{previewFileIcon}</span>\n</div>',g=window.URL||window.webkitURL,h=function(a,b,c){return void 0!==a&&(c?a===b:a.match(b))},i=function(a){if("Microsoft Internet Explorer"!==navigator.appName)return!1;if(10===a)return new RegExp("msie\\s"+a,"i").test(navigator.userAgent);var c,b=document.createElement("div");return b.innerHTML="<!--[if IE "+a+"]> <i></i> <![endif]-->",c=b.getElementsByTagName("i").length,document.body.appendChild(b),b.parentNode.removeChild(b),c},j=function(a,c,d,e){var f=e?c:c.split(" ").join(b+" ")+b;a.off(f).on(f,d)},k={data:{},init:function(a){var b=a.initialPreview,c=a.id;b.length>0&&!ea(b)&&(b=b.split(a.initialPreviewDelimiter)),k.data[c]={content:b,config:a.initialPreviewConfig,tags:a.initialPreviewThumbTags,delimiter:a.initialPreviewDelimiter,previewFileType:a.initialPreviewFileType,previewAsData:a.initialPreviewAsData,template:a.previewGenericTemplate,showZoom:a.fileActionSettings.showZoom,showDrag:a.fileActionSettings.showDrag,getSize:function(b){return a._getSize(b)},parseTemplate:function(b,c,d,e,f,g,h){var i=" file-preview-initial";return a._generatePreviewTemplate(b,c,d,e,f,!1,null,i,g,h)},msg:function(b){return a._getMsgSelected(b)},initId:a.previewInitId,footer:a._getLayoutTemplate("footer").replace(/\{progress}/g,a._renderThumbProgress()),isDelete:a.initialPreviewShowDelete,caption:a.initialCaption,actions:function(b,c,d,e,f,g,h){return a._renderFileActions(b,c,d,e,f,g,h,!0)}}},fetch:function(a){return k.data[a].content.filter(function(a){return null!==a})},count:function(a,b){return k.data[a]&&k.data[a].content?b?k.data[a].content.length:k.fetch(a).length:0},get:function(b,c,d){var j,l,n,o,p,q,e="init_"+c,f=k.data[b],g=f.config[c],h=f.content[c],i=f.initId+"-"+e,m=" file-preview-initial",r=fa("previewAsData",g,f.previewAsData);return d=void 0===d||d,h?(g&&g.frameClass&&(m+=" "+g.frameClass),r?(n=f.previewAsData?fa("type",g,f.previewFileType||"generic"):"generic",o=fa("caption",g),p=k.footer(b,c,d,g&&g.size||null),q=fa("filetype",g,n),j=f.parseTemplate(n,h,o,q,i,p,e,null)):j=f.template.replace(/\{previewId}/g,i).replace(/\{frameClass}/g,m).replace(/\{fileindex}/g,e).replace(/\{content}/g,f.content[c]).replace(/\{template}/g,fa("type",g,f.previewFileType)).replace(/\{footer}/g,k.footer(b,c,d,g&&g.size||null)),f.tags.length&&f.tags[c]&&(j=ia(j,f.tags[c])),da(g)||da(g.frameAttr)||(l=a(document.createElement("div")).html(j),l.find(".file-preview-initial").attr(g.frameAttr),j=l.html(),l.remove()),j):""},add:function(b,c,d,e,f){var h,g=a.extend(!0,{},k.data[b]);return ea(c)||(c=c.split(g.delimiter)),f?(h=g.content.push(c)-1,g.config[h]=d,g.tags[h]=e):(h=c.length-1,g.content=c,g.config=d,g.tags=e),k.data[b]=g,h},set:function(b,c,d,e,f){var h,i,g=a.extend(!0,{},k.data[b]);if(c&&c.length&&(ea(c)||(c=c.split(g.delimiter)),i=c.filter(function(a){return null!==a}),i.length)){if(void 0===g.content&&(g.content=[]),void 0===g.config&&(g.config=[]),void 0===g.tags&&(g.tags=[]),f){for(h=0;h<c.length;h++)c[h]&&g.content.push(c[h]);for(h=0;h<d.length;h++)d[h]&&g.config.push(d[h]);for(h=0;h<e.length;h++)e[h]&&g.tags.push(e[h])}else g.content=c,g.config=d,g.tags=e;k.data[b]=g}},unset:function(a,b){var c=k.count(a.id);if(c){if(1===c)return k.data[a.id].content=[],k.data[a.id].config=[],k.data[a.id].tags=[],a.initialPreview=[],a.initialPreviewConfig=[],void(a.initialPreviewThumbTags=[]);k.data[a.id].content[b]=null,k.data[a.id].config[b]=null,k.data[a.id].tags[b]=null}},out:function(a){var d,b="",c=k.data[a],e=k.count(a,!0);if(0===e)return{content:"",caption:""};for(var f=0;f<e;f++)b+=k.get(a,f);return d=c.msg(k.count(a)),{content:'<div class="file-initial-thumbs">'+b+"</div>",caption:d}},footer:function(a,b,c,d){var e=k.data[a];if(c=void 0===c||c,0===e.config.length||da(e.config[b]))return"";var f=e.config[b],g=fa("caption",f),h=fa("width",f,"auto"),i=fa("url",f,!1),j=fa("key",f,null),l=fa("showDelete",f,!0),m=fa("showZoom",f,e.showZoom),n=fa("showDrag",f,e.showDrag),o=i===!1&&c,p=e.isDelete?e.actions(!1,l,m,n,o,i,j):"",q=e.footer.replace(/\{actions}/g,p);return q.replace(/\{caption}/g,g).replace(/\{size}/g,e.getSize(d)).replace(/\{width}/g,h).replace(/\{indicator}/g,"").replace(/\{indicatorTitle}/g,"")}},l=function(a,b){return b=b||0,"number"==typeof a?a:("string"==typeof a&&(a=parseFloat(a)),isNaN(a)?b:a)},m=function(){return!(!window.File||!window.FileReader)},n=function(){var a=document.createElement("div");return!i(9)&&(void 0!==a.draggable||void 0!==a.ondragstart&&void 0!==a.ondrop)},o=function(){return m()&&window.FormData},p=function(a,b){a.removeClass(b).addClass(b)},X={showRemove:!0,showUpload:!0,showZoom:!0,showDrag:!0,removeIcon:'<i class="glyphicon glyphicon-trash text-danger"></i>',removeClass:"btn btn-xs btn-default",removeTitle:"Remove file",uploadIcon:'<i class="glyphicon glyphicon-upload text-info"></i>',uploadClass:"btn btn-xs btn-default",uploadTitle:"Upload file",zoomIcon:'<i class="glyphicon glyphicon-zoom-in"></i>',zoomClass:"btn btn-xs btn-default",zoomTitle:"View Details",dragIcon:'<i class="glyphicon glyphicon-menu-hamburger"></i>',dragClass:"text-info",dragTitle:"Move / Rearrange",dragSettings:{},indicatorNew:'<i class="glyphicon glyphicon-hand-down text-warning"></i>',indicatorSuccess:'<i class="glyphicon glyphicon-ok-sign text-success"></i>',indicatorError:'<i class="glyphicon glyphicon-exclamation-sign text-danger"></i>',indicatorLoading:'<i class="glyphicon glyphicon-hand-up text-muted"></i>',indicatorNewTitle:"Not uploaded yet",indicatorSuccessTitle:"Uploaded",indicatorErrorTitle:"Upload Error",indicatorLoadingTitle:"Uploading ..."},q='{preview}\n<div class="kv-upload-progress hide"></div>\n<div class="input-group {class}">\n {caption}\n <div class="input-group-btn">\n {remove}\n {cancel}\n {upload}\n {browse}\n </div>\n</div>',r='{preview}\n<div class="kv-upload-progress hide"></div>\n{remove}\n{cancel}\n{upload}\n{browse}\n',s='<div class="file-preview {class}">\n {close} <div class="{dropClass}">\n <div class="file-preview-thumbnails">\n </div>\n <div class="clearfix"></div> <div class="file-preview-status text-center text-success"></div>\n <div class="kv-fileinput-error"></div>\n </div>\n</div>',u='<div class="close fileinput-remove">×</div>\n',t='<i class="glyphicon glyphicon-file kv-caption-icon"></i>',v='<div tabindex="500" class="form-control file-caption {class}">\n <div class="file-caption-name"></div>\n</div>\n',w='<button type="{type}" tabindex="500" title="{title}" class="{css}" {status}>{icon} {label}</button>',x='<a href="{href}" tabindex="500" title="{title}" class="{css}" {status}>{icon} {label}</a>',y='<div tabindex="500" class="{css}" {status}>{icon} {label}</div>',z='<div id="'+c+'" class="file-zoom-dialog modal fade" tabindex="-1" aria-labelledby="'+c+'Label"></div>',A='<div class="modal-dialog modal-lg" role="document">\n <div class="modal-content">\n <div class="modal-header">\n <div class="kv-zoom-actions pull-right">{toggleheader}{fullscreen}{borderless}{close}</div>\n <h3 class="modal-title">{heading} <small><span class="kv-zoom-title"></span></small></h3>\n </div>\n <div class="modal-body">\n <div class="floating-buttons"></div>\n <div class="kv-zoom-body file-zoom-content"></div>\n{prev} {next}\n </div>\n </div>\n</div>\n',B='<div class="progress">\n <div class="{class}" role="progressbar" aria-valuenow="{percent}" aria-valuemin="0" aria-valuemax="100" style="width:{percent}%;">\n {percent}%\n </div>\n</div>',C=" <br><samp>({sizeText})</samp>",D='<div class="file-thumbnail-footer">\n <div class="file-footer-caption" title="{caption}">{caption}{size}</div>\n {progress} {actions}\n</div>',E='<div class="file-actions">\n <div class="file-footer-buttons">\n {upload} {delete} {zoom} {other} </div>\n {drag}\n <div class="file-upload-indicator" title="{indicatorTitle}">{indicator}</div>\n <div class="clearfix"></div>\n</div>',F='<button type="button" class="kv-file-remove {removeClass}" title="{removeTitle}" {dataUrl}{dataKey}>{removeIcon}</button>\n',G='<button type="button" class="kv-file-upload {uploadClass}" title="{uploadTitle}">{uploadIcon}</button>',H='<button type="button" class="kv-file-zoom {zoomClass}" title="{zoomTitle}">{zoomIcon}</button>',I='<span class="file-drag-handle {dragClass}" title="{dragTitle}">{dragIcon}</span>',J='<div class="file-preview-frame{frameClass}" id="{previewId}" data-fileindex="{fileindex}" data-template="{template}"',K=J+'><div class="kv-file-content">\n',L=J+' title="{caption}" '+d+'><div class="kv-file-content">\n',M="</div>{footer}\n</div>\n",N="{content}\n",O='<div class="kv-preview-data file-preview-html" title="{caption}" '+d+">{data}</div>\n",P='<img src="{data}" class="kv-preview-data file-preview-image" title="{caption}" alt="{caption}" '+d+">\n",Q='<textarea class="kv-preview-data file-preview-text" title="{caption}" readonly '+d+">{data}</textarea>\n",R='<video class="kv-preview-data" width="{width}" height="{height}" controls>\n<source src="{data}" type="{type}">\n'+f+"\n</video>\n",S='<audio class="kv-preview-data" controls>\n<source src="{data}" type="{type}">\n'+f+"\n</audio>\n",T='<object class="kv-preview-data file-object" type="application/x-shockwave-flash" width="{width}" height="{height}" data="{data}">\n'+e+" "+f+"\n</object>\n",U='<object class="kv-preview-data file-object" data="{data}" type="{type}" width="{width}" height="{height}">\n<param name="movie" value="{caption}" />\n'+e+" "+f+"\n</object>\n",V='<embed class="kv-preview-data" src="{data}" width="{width}" height="{height}" type="application/pdf">\n',W='<div class="kv-preview-data file-preview-other-frame">\n'+f+"\n</div>\n",Y={main1:q,main2:r,preview:s,close:u,fileIcon:t,caption:v,modalMain:z,modal:A,progress:B,size:C,footer:D,actions:E,actionDelete:F,actionUpload:G,actionZoom:H,actionDrag:I,btnDefault:w,btnLink:x,btnBrowse:y},Z={generic:K+N+M,html:K+O+M,image:K+P+M,text:K+Q+M,video:L+R+M,audio:L+S+M,flash:L+T+M,object:L+U+M,pdf:L+V+M,other:L+W+M},_=["image","html","text","video","audio","flash","pdf","object"],ba={image:{width:"auto",height:"160px"},html:{width:"213px",height:"160px"},text:{width:"213px",height:"160px"},video:{width:"213px",height:"160px"},audio:{width:"213px",height:"80px"},flash:{width:"213px",height:"160px"},object:{width:"160px",height:"160px"},pdf:{width:"160px",height:"160px"},other:{width:"160px",height:"160px"}},$={image:{width:"auto",height:"auto","max-width":"100%","max-height":"100%"},html:{width:"100%",height:"100%","min-height":"480px"},text:{width:"100%",height:"100%","min-height":"480px"},video:{width:"auto",height:"100%","max-width":"100%"},audio:{width:"100%",height:"30px"},flash:{width:"auto",height:"480px"},object:{width:"auto",height:"100%","min-height":"480px"},pdf:{width:"100%",height:"100%","min-height":"480px"},other:{width:"auto",height:"100%","min-height":"480px"}},ca={image:function(a,b){return h(a,"image.*")||h(b,/\.(gif|png|jpe?g)$/i)},html:function(a,b){return h(a,"text/html")||h(b,/\.(htm|html)$/i)},text:function(a,b){return h(a,"text.*")||h(b,/\.(xml|javascript)$/i)||h(b,/\.(txt|md|csv|nfo|ini|json|php|js|css)$/i)},video:function(a,b){return h(a,"video.*")&&(h(a,/(ogg|mp4|mp?g|webm|3gp)$/i)||h(b,/\.(og?|mp4|webm|mp?g|3gp)$/i))},audio:function(a,b){return h(a,"audio.*")&&(h(b,/(ogg|mp3|mp?g|wav)$/i)||h(b,/\.(og?|mp3|mp?g|wav)$/i))},flash:function(a,b){return h(a,"application/x-shockwave-flash",!0)||h(b,/\.(swf)$/i)},pdf:function(a,b){return h(a,"application/pdf",!0)||h(b,/\.(pdf)$/i)},object:function(){return!0},other:function(){return!0}},da=function(b,c){return void 0===b||null===b||0===b.length||c&&""===a.trim(b)},ea=function(a){return Array.isArray(a)||"[object Array]"===Object.prototype.toString.call(a)},fa=function(a,b,c){return c=c||"",b&&"object"==typeof b&&a in b?b[a]:c},aa=function(b,c,d){return da(b)||da(b[c])?d:a(b[c])},ga=function(){return Math.round((new Date).getTime()+100*Math.random())},ha=function(a){return a.replace(/&/g,"&").replace(/</g,"<").replace(/>/g,">").replace(/"/g,""").replace(/'/g,"'")},ia=function(b,c){var d=b;return c?(a.each(c,function(a,b){"function"==typeof b&&(b=b()),d=d.split(a).join(b)}),d):d},ja=function(a){var b=a.is("img")?a.attr("src"):a.find("source").attr("src");g.revokeObjectURL(b)},ka=function(a){var b=a.lastIndexOf("/");return b===-1&&(b=a.lastIndexOf("\\")),a.split(a.substring(b,b+1)).pop()},la=function(){return document.fullscreenElement||document.mozFullScreenElement||document.webkitFullscreenElement||document.msFullscreenElement},ma=function(a){a&&!la()?document.documentElement.requestFullscreen?document.documentElement.requestFullscreen():document.documentElement.msRequestFullscreen?document.documentElement.msRequestFullscreen():document.documentElement.mozRequestFullScreen?document.documentElement.mozRequestFullScreen():document.documentElement.webkitRequestFullscreen&&document.documentElement.webkitRequestFullscreen(Element.ALLOW_KEYBOARD_INPUT):document.exitFullscreen?document.exitFullscreen():document.msExitFullscreen?document.msExitFullscreen():document.mozCancelFullScreen?document.mozCancelFullScreen():document.webkitExitFullscreen&&document.webkitExitFullscreen()},na=function(a,b,c){if(c>=a.length)for(var d=c-a.length;d--+1;)a.push(void 0);return a.splice(c,0,a.splice(b,1)[0]),a},oa=function(b,c){var d=this;d.$element=a(b),d._validate()&&(d.isPreviewable=m(),d.isIE9=i(9),d.isIE10=i(10),d.isPreviewable||d.isIE9?(d._init(c),d._listen()):d.$element.removeClass("file-loading"))},oa.prototype={constructor:oa,_init:function(b){var e,c=this,d=c.$element;a.each(b,function(a,b){switch(a){case"minFileCount":case"maxFileCount":case"maxFileSize":c[a]=l(b);break;default:c[a]=b}}),c.fileInputCleared=!1,c.fileBatchCompleted=!0,c.isPreviewable||(c.showPreview=!1),c.uploadFileAttr=da(d.attr("name"))?"file_data":d.attr("name"),c.reader=null,c.formdata={},c.clearStack(),c.uploadCount=0,c.uploadStatus={},c.uploadLog=[],c.uploadAsyncCount=0,c.loadedImages=[],c.totalImagesCount=0,c.ajaxRequests=[],c.isError=!1,c.ajaxAborted=!1,c.cancelling=!1,e=c._getLayoutTemplate("progress"),c.progressTemplate=e.replace("{class}",c.progressClass),c.progressCompleteTemplate=e.replace("{class}",c.progressCompleteClass),c.progressErrorTemplate=e.replace("{class}",c.progressErrorClass),c.dropZoneEnabled=n()&&c.dropZoneEnabled,c.isDisabled=c.$element.attr("disabled")||c.$element.attr("readonly"),c.isUploadable=o()&&!da(c.uploadUrl),c.isClickable=c.browseOnZoneClick&&c.showPreview&&(c.isUploadable&&c.dropZoneEnabled||!da(c.defaultPreviewContent)),c.slug="function"==typeof b.slugCallback?b.slugCallback:c._slugDefault,c.mainTemplate=c.showCaption?c._getLayoutTemplate("main1"):c._getLayoutTemplate("main2"),c.captionTemplate=c._getLayoutTemplate("caption"),c.previewGenericTemplate=c._getPreviewTemplate("generic"),c.resizeImage&&(c.maxImageWidth||c.maxImageHeight)&&(c.imageCanvas=document.createElement("canvas"),c.imageCanvasContext=c.imageCanvas.getContext("2d")),da(c.$element.attr("id"))&&c.$element.attr("id",ga()),void 0===c.$container?c.$container=c._createContainer():c._refreshContainer(),c.$dropZone=c.$container.find(".file-drop-zone"),c.$progress=c.$container.find(".kv-upload-progress"),c.$btnUpload=c.$container.find(".fileinput-upload"),c.$captionContainer=aa(b,"elCaptionContainer",c.$container.find(".file-caption")),c.$caption=aa(b,"elCaptionText",c.$container.find(".file-caption-name")),c.$previewContainer=aa(b,"elPreviewContainer",c.$container.find(".file-preview")),c.$preview=aa(b,"elPreviewImage",c.$container.find(".file-preview-thumbnails")),c.$previewStatus=aa(b,"elPreviewStatus",c.$container.find(".file-preview-status")),c.$errorContainer=aa(b,"elErrorContainer",c.$previewContainer.find(".kv-fileinput-error")),da(c.msgErrorClass)||p(c.$errorContainer,c.msgErrorClass),c.$errorContainer.hide(),c.fileActionSettings=a.extend(!0,X,b.fileActionSettings),c.previewInitId="preview-"+ga(),c.id=c.$element.attr("id"),k.init(c),c._initPreview(!0),c._initPreviewActions(),c.options=b,c._setFileDropZoneTitle(),c.$element.removeClass("file-loading"),c.$element.attr("disabled")&&c.disable(),c._initZoom()},_validate:function(){var b,a=this;return"file"===a.$element.attr("type")||(b='<div class="help-block alert alert-warning"><h4>Invalid Input Type</h4>You must set an input <code>type = file</code> for <b>bootstrap-fileinput</b> plugin to initialize.</div>',a.$element.after(b),!1)},_errorsExist:function(){var c,b=this;return!!b.$errorContainer.find("li").length||(c=a(document.createElement("div")).html(b.$errorContainer.html()),c.find("span.kv-error-close").remove(),c.find("ul").remove(),!!a.trim(c.text()).length)},_errorHandler:function(a,b){var c=this,d=a.target.error;d.code===d.NOT_FOUND_ERR?c._showError(c.msgFileNotFound.replace("{name}",b)):d.code===d.SECURITY_ERR?c._showError(c.msgFileSecured.replace("{name}",b)):d.code===d.NOT_READABLE_ERR?c._showError(c.msgFileNotReadable.replace("{name}",b)):d.code===d.ABORT_ERR?c._showError(c.msgFilePreviewAborted.replace("{name}",b)):c._showError(c.msgFilePreviewError.replace("{name}",b))},_addError:function(a){var b=this,c=b.$errorContainer;a&&c.length&&(c.html(b.errorCloseButton+a),j(c.find(".kv-error-close"),"click",function(){c.fadeOut("slow")}))},_resetErrors:function(a){var b=this,c=b.$errorContainer;b.isError=!1,b.$container.removeClass("has-error"),c.html(""),a?c.fadeOut("slow"):c.hide()},_showFolderError:function(a){var d,b=this,c=b.$errorContainer;a&&(d=b.msgFoldersNotAllowed.replace(/\{n}/g,a),b._addError(d),p(b.$container,"has-error"),c.fadeIn(800),b._raise("filefoldererror",[a,d]))},_showUploadError:function(a,b,c){var d=this,e=d.$errorContainer,f=c||"fileuploaderror",g=b&&b.id?'<li data-file-id="'+b.id+'">'+a+"</li>":"<li>"+a+"</li>";return 0===e.find("ul").length?d._addError("<ul>"+g+"</ul>"):e.find("ul").append(g),e.fadeIn(800),d._raise(f,[b,a]),d.$container.removeClass("file-input-new"),p(d.$container,"has-error"),!0},_showError:function(a,b,c){var d=this,e=d.$errorContainer,f=c||"fileerror";return b=b||{},b.reader=d.reader,d._addError(a),e.fadeIn(800),d._raise(f,[b,a]),d.isUploadable||d._clearFileInput(),d.$container.removeClass("file-input-new"),p(d.$container,"has-error"),d.$btnUpload.attr("disabled",!0),!0},_noFilesError:function(a){var b=this,c=b.minFileCount>1?b.filePlural:b.fileSingle,d=b.msgFilesTooLess.replace("{n}",b.minFileCount).replace("{files}",c),e=b.$errorContainer;b._addError(d),b.isError=!0,b._updateFileDetails(0),e.fadeIn(800),b._raise("fileerror",[a,d]),b._clearFileInput(),p(b.$container,"has-error")},_parseError:function(b,c,d){var e=this,f=a.trim(c+""),g="."===f.slice(-1)?"":".",h=void 0!==b.responseJSON&&void 0!==b.responseJSON.error?b.responseJSON.error:b.responseText;return e.cancelling&&e.msgUploadAborted&&(f=e.msgUploadAborted),e.showAjaxErrorDetails&&h?(h=a.trim(h.replace(/\n\s*\n/g,"\n")),h=h.length>0?"<pre>"+h+"</pre>":"",f+=g+h):f+=g,e.cancelling=!1,d?"<b>"+d+": </b>"+f:f},_parseFileType:function(a){var c,d,e,f,b=this;for(f=0;f<_.length;f+=1)if(e=_[f],c=fa(e,b.fileTypeSettings,ca[e]),d=c(a.type,a.name)?e:"",!da(d))return d;return"other"},_parseFilePreviewIcon:function(b,c){var e,f,d=this,g=d.previewFileIcon;return c&&c.indexOf(".")>-1&&(f=c.split(".").pop(),d.previewFileIconSettings&&d.previewFileIconSettings[f]&&(g=d.previewFileIconSettings[f]),d.previewFileExtSettings&&a.each(d.previewFileExtSettings,function(a,b){return d.previewFileIconSettings[a]&&b(f)?void(g=d.previewFileIconSettings[a]):void(e=!0)})),b.indexOf("{previewFileIcon}")>-1?b.replace(/\{previewFileIconClass}/g,d.previewFileIconClass).replace(/\{previewFileIcon}/g,g):b},_raise:function(b,c){var d=this,e=a.Event(b);if(void 0!==c?d.$element.trigger(e,c):d.$element.trigger(e),e.isDefaultPrevented())return!1;if(!e.result)return e.result;switch(b){case"filebatchuploadcomplete":case"filebatchuploadsuccess":case"fileuploaded":case"fileclear":case"filecleared":case"filereset":case"fileerror":case"filefoldererror":case"fileuploaderror":case"filebatchuploaderror":case"filedeleteerror":case"filecustomerror":case"filesuccessremove":break;default:d.ajaxAborted=e.result}return!0},_listenFullScreen:function(a){var d,e,b=this,c=b.$modal;c&&c.length&&(d=c&&c.find(".btn-fullscreen"),e=c&&c.find(".btn-borderless"),d.length&&e.length&&(d.removeClass("active").attr("aria-pressed","false"),e.removeClass("active").attr("aria-pressed","false"),a?d.addClass("active").attr("aria-pressed","true"):e.addClass("active").attr("aria-pressed","true"),c.hasClass("file-zoom-fullscreen")?b._maximizeZoomDialog():a?b._maximizeZoomDialog():e.removeClass("active").attr("aria-pressed","false")))},_listen:function(){var b=this,c=b.$element,d=c.closest("form"),e=b.$container;j(c,"change",a.proxy(b._change,b)),b.showBrowse&&j(b.$btnFile,"click",a.proxy(b._browse,b)),j(d,"reset",a.proxy(b.reset,b)),j(e.find(".fileinput-remove:not([disabled])"),"click",a.proxy(b.clear,b)),j(e.find(".fileinput-cancel"),"click",a.proxy(b.cancel,b)),b._initDragDrop(),b.isUploadable||j(d,"submit",a.proxy(b._submitForm,b)),j(b.$container.find(".fileinput-upload"),"click",a.proxy(b._uploadClick,b)),j(a(window),"resize",function(){b._listenFullScreen(screen.width===window.innerWidth&&screen.height===window.innerHeight)}),j(a(document),"webkitfullscreenchange mozfullscreenchange fullscreenchange MSFullscreenChange",function(){b._listenFullScreen(la())}),b._initClickable()},_initClickable:function(){var c,b=this;b.isClickable&&(c=b.isUploadable?b.$dropZone:b.$preview.find(".file-default-preview"),p(c,"clickable"),c.attr("tabindex",-1),j(c,"click",function(d){var e=a(d.target);e.parents(".file-preview-thumbnails").length&&!e.parents(".file-default-preview").length||(b.$element.trigger("click"),c.blur())}))},_initDragDrop:function(){var b=this,c=b.$dropZone;b.isUploadable&&b.dropZoneEnabled&&b.showPreview&&(j(c,"dragenter dragover",a.proxy(b._zoneDragEnter,b)),j(c,"dragleave",a.proxy(b._zoneDragLeave,b)),j(c,"drop",a.proxy(b._zoneDrop,b)),j(a(document),"dragenter dragover drop",b._zoneDragDropInit))},_zoneDragDropInit:function(a){a.stopPropagation(),a.preventDefault()},_zoneDragEnter:function(b){var c=this,d=a.inArray("Files",b.originalEvent.dataTransfer.types)>-1;return c._zoneDragDropInit(b),c.isDisabled||!d?(b.originalEvent.dataTransfer.effectAllowed="none",void(b.originalEvent.dataTransfer.dropEffect="none")):void p(c.$dropZone,"file-highlighted")},_zoneDragLeave:function(a){var b=this;b._zoneDragDropInit(a),b.isDisabled||b.$dropZone.removeClass("file-highlighted")},_zoneDrop:function(a){var b=this;a.preventDefault(),b.isDisabled||da(a.originalEvent.dataTransfer.files)||(b._change(a,"dragdrop"),b.$dropZone.removeClass("file-highlighted"))},_uploadClick:function(a){var d,b=this,c=b.$container.find(".fileinput-upload"),e=!c.hasClass("disabled")&&da(c.attr("disabled"));if(!a||!a.isDefaultPrevented()){if(!b.isUploadable)return void(e&&"submit"!==c.attr("type")&&(d=c.closest("form"),d.length&&d.trigger("submit"),a.preventDefault()));a.preventDefault(),e&&b.upload()}},_submitForm:function(){var a=this,b=a.$element,c=b.get(0).files;return c&&a.minFileCount>0&&a._getFileCount(c.length)<a.minFileCount?(a._noFilesError({}),!1):!a._abort({})},_clearPreview:function(){var a=this,b=a.showUploadedThumbs?a.$preview.find(".file-preview-frame:not(.file-preview-success)"):a.$preview.find(".file-preview-frame");b.remove(),a.$preview.find(".file-preview-frame").length&&a.showPreview||a._resetUpload(),a._validateDefaultPreview()},_initSortable:function(){var d,e,b=this,c=b.$preview;window.KvSortable&&(d=c.find(".file-initial-thumbs"),e={handle:".drag-handle-init",dataIdAttr:"data-preview-id",draggable:".file-preview-initial",onSort:function(c){var d=c.oldIndex,e=c.newIndex;b.initialPreview=na(b.initialPreview,d,e),b.initialPreviewConfig=na(b.initialPreviewConfig,d,e),k.init(b);for(var f=0;f<b.initialPreviewConfig.length;f++)if(null!==b.initialPreviewConfig[f]){var g=b.initialPreviewConfig[f].key,h=a(".kv-file-remove[data-key='"+g+"']");h=h.closest(".file-preview-frame"),h.attr("data-fileindex","init_"+f),h.data("fileindex","init_"+f)}b._raise("filesorted",{previewId:a(c.item).attr("id"),oldIndex:d,newIndex:e,stack:b.initialPreviewConfig})}},d.data("kvsortable")&&d.kvsortable("destroy"),a.extend(!0,e,b.fileActionSettings.dragSettings),d.kvsortable(e))},_initPreview:function(a){var d,b=this,c=b.initialCaption||"";return k.count(b.id)?(d=k.out(b.id),c=a&&b.initialCaption?b.initialCaption:d.caption,b.$preview.html(d.content),b._setCaption(c),b._initSortable(),void(da(d.content)||b.$container.removeClass("file-input-new"))):(b._clearPreview(),void(a?b._setCaption(c):b._initCaption()))},_getZoomButton:function(a){var b=this,c=b.previewZoomButtonIcons[a],d=b.previewZoomButtonClasses[a],e=' title="'+(b.previewZoomButtonTitles[a]||"")+'" ',f=e+("close"===a?' data-dismiss="modal" aria-hidden="true"':"");return"fullscreen"!==a&&"borderless"!==a&&"toggleheader"!==a||(f+=' data-toggle="button" aria-pressed="false" autocomplete="off"'),'<button type="button" class="'+d+" btn-"+a+'"'+f+">"+c+"</button>"},_getModalContent:function(){var a=this;return a._getLayoutTemplate("modal").replace(/\{heading}/g,a.msgZoomModalHeading).replace(/\{prev}/g,a._getZoomButton("prev")).replace(/\{next}/g,a._getZoomButton("next")).replace(/\{toggleheader}/g,a._getZoomButton("toggleheader")).replace(/\{fullscreen}/g,a._getZoomButton("fullscreen")).replace(/\{borderless}/g,a._getZoomButton("borderless")).replace(/\{close}/g,a._getZoomButton("close"))},_listenModalEvent:function(a){var b=this,c=b.$modal,d=function(a){return{sourceEvent:a,previewId:c.data("previewId"),modal:c}};c.on(a+".bs.modal",function(e){var f=c.find(".btn-fullscreen"),g=c.find(".btn-borderless");b._raise("filezoom"+a,d(e)),"shown"===a&&(g.removeClass("active").attr("aria-pressed","false"),f.removeClass("active").attr("aria-pressed","false"),c.hasClass("file-zoom-fullscreen")&&(b._maximizeZoomDialog(),la()?f.addClass("active").attr("aria-pressed","true"):g.addClass("active").attr("aria-pressed","true")))})},_initZoom:function(){var d,b=this,e=b._getLayoutTemplate("modalMain"),f="#"+c;b.$modal=a(f),b.$modal&&b.$modal.length||(d=a(document.createElement("div")).html(e).insertAfter(b.$container),b.$modal=a("#"+c).insertBefore(d),d.remove()),b.$modal.html(b._getModalContent()),b._listenModalEvent("show"),b._listenModalEvent("shown"),b._listenModalEvent("hide"),b._listenModalEvent("hidden"),b._listenModalEvent("loaded")},_initZoomButtons:function(){var d,e,b=this,c=b.$modal.data("previewId")||"",f=b.$preview.find(".file-preview-frame").toArray(),g=f.length,h=b.$modal.find(".btn-prev"),i=b.$modal.find(".btn-next");g&&(d=a(f[0]),e=a(f[g-1]),h.removeAttr("disabled"),i.removeAttr("disabled"),d.length&&d.attr("id")===c&&h.attr("disabled",!0),e.length&&e.attr("id")===c&&i.attr("disabled",!0))},_maximizeZoomDialog:function(){var b=this,c=b.$modal,d=c.find(".modal-header:visible"),e=c.find(".modal-footer:visible"),f=c.find(".modal-body"),g=a(window).height(),h=0;c.addClass("file-zoom-fullscreen"),d&&d.length&&(g-=d.outerHeight(!0)),e&&e.length&&(g-=e.outerHeight(!0)),f&&f.length&&(h=f.outerHeight(!0)-f.height(),g-=h),c.find(".kv-zoom-body").height(g)},_resizeZoomDialog:function(a){var b=this,c=b.$modal,d=c.find(".btn-fullscreen"),e=c.find(".btn-borderless");if(c.hasClass("file-zoom-fullscreen"))ma(!1),a?d.hasClass("active")||(c.removeClass("file-zoom-fullscreen"),b._resizeZoomDialog(!0),e.hasClass("active")&&e.removeClass("active").attr("aria-pressed","false")):d.hasClass("active")?d.removeClass("active").attr("aria-pressed","false"):(c.removeClass("file-zoom-fullscreen"),b.$modal.find(".kv-zoom-body").css("height",b.zoomModalHeight));else{if(!a)return void b._maximizeZoomDialog();ma(!0)}c.focus()},_setZoomContent:function(b,c){var e,f,g,h,i,k,l,r,d=this,m=b.attr("id"),n=d.$modal,o=n.find(".btn-prev"),q=n.find(".btn-next"),s=n.find(".btn-fullscreen"),t=n.find(".btn-borderless"),u=n.find(".btn-toggleheader");f=b.data("template")||"generic",e=b.find(".kv-file-content"),g=e.length?e.html():"",h=b.find(".file-footer-caption").text()||"",n.find(".kv-zoom-title").html(h),i=n.find(".kv-zoom-body"),c?(r=i.clone().insertAfter(i),i.html(g).hide(),r.fadeOut("fast",function(){i.fadeIn("fast"),r.remove()})):i.html(g),l=d.previewZoomSettings[f],l&&(k=i.find(".kv-preview-data"),p(k,"file-zoom-detail"),a.each(l,function(a,b){k.css(a,b),(k.attr("width")&&"width"===a||k.attr("height")&&"height"===a)&&k.removeAttr(a)})),n.data("previewId",m),j(o,"click",function(){d._zoomSlideShow("prev",m)}),j(q,"click",function(){d._zoomSlideShow("next",m)}),j(s,"click",function(){d._resizeZoomDialog(!0)}),j(t,"click",function(){d._resizeZoomDialog(!1)}),j(u,"click",function(){var c,a=n.find(".modal-header"),b=n.find(".modal-body .floating-buttons"),e=a.find(".kv-zoom-actions"),f=function(b){var c=d.$modal.find(".kv-zoom-body"),e=d.zoomModalHeight;n.hasClass("file-zoom-fullscreen")&&(e=c.outerHeight(!0),b||(e-=a.outerHeight(!0))),c.css("height",b?e+b:e)};a.is(":visible")?(c=a.outerHeight(!0),a.slideUp("slow",function(){e.find(".btn").appendTo(b),f(c)})):(b.find(".btn").appendTo(e),a.slideDown("slow",function(){f()})),n.focus()}),j(n,"keydown",function(a){var b=a.which||a.keyCode;37!==b||o.attr("disabled")||d._zoomSlideShow("prev",m),39!==b||q.attr("disabled")||d._zoomSlideShow("next",m)})},_zoomPreview:function(a){var c,b=this;if(!a.length)throw"Cannot zoom to detailed preview!";b.$modal.html(b._getModalContent()),c=a.closest(".file-preview-frame"),b._setZoomContent(c),b.$modal.modal("show"),b._initZoomButtons()},_zoomSlideShow:function(b,c){var f,g,j,d=this,e=d.$modal.find(".kv-zoom-actions .btn-"+b),h=d.$preview.find(".file-preview-frame").toArray(),i=h.length;if(!e.attr("disabled")){for(g=0;g<i;g++)if(a(h[g]).attr("id")===c){j="prev"===b?g-1:g+1;break}j<0||j>=i||!h[j]||(f=a(h[j]),f.length&&d._setZoomContent(f,!0),d._initZoomButtons(),d._raise("filezoom"+b,{previewId:c,modal:d.$modal}))}},_initZoomButton:function(){var b=this;b.$preview.find(".kv-file-zoom").each(function(){var c=a(this);j(c,"click",function(){b._zoomPreview(c)})})},_initPreviewActions:function(){var b=this,c=b.deleteExtraData||{},d=function(){var a=b.isUploadable?k.count(b.id):b.$element.get(0).files.length;0!==b.$preview.find(".kv-file-remove").length||a||(b.reset(),b.initialCaption="")};b._initZoomButton(),b.$preview.find(".kv-file-remove").each(function(){var e=a(this),f=e.data("url")||b.deleteUrl,g=e.data("key");if(!da(f)&&void 0!==g){var l,m,o,q,h=e.closest(".file-preview-frame"),i=k.data[b.id],n=h.data("fileindex");n=parseInt(n.replace("init_","")),o=da(i.config)&&da(i.config[n])?null:i.config[n],q=da(o)||da(o.extra)?c:o.extra,"function"==typeof q&&(q=q()),m={id:e.attr("id"),key:g,extra:q},l=a.extend(!0,{},{url:f,type:"POST",dataType:"json",data:a.extend(!0,{},{key:g},q),beforeSend:function(a){b.ajaxAborted=!1,b._raise("filepredelete",[g,a,q]),b.ajaxAborted?a.abort():(p(h,"file-uploading"),p(e,"disabled"))},success:function(a,c,f){var i,j;return da(a)||da(a.error)?(k.init(b),n=parseInt(h.data("fileindex").replace("init_","")),k.unset(b,n),i=k.count(b.id), | ||
| 11 | - j=i>0?b._getMsgSelected(i):"",b._raise("filedeleted",[g,f,q]),b._setCaption(j),h.removeClass("file-uploading").addClass("file-deleted"),void h.fadeOut("slow",function(){b._clearObjects(h),h.remove(),d(),i||0!==b.getFileStack().length||(b._setCaption(""),b.reset())})):(m.jqXHR=f,m.response=a,b._showError(a.error,m,"filedeleteerror"),h.removeClass("file-uploading"),e.removeClass("disabled"),void d())},error:function(a,c,e){var f=b._parseError(a,e);m.jqXHR=a,m.response={},b._showError(f,m,"filedeleteerror"),h.removeClass("file-uploading"),d()}},b.ajaxDeleteSettings),j(e,"click",function(){return!!b._validateMinCount()&&void a.ajax(l)})}})},_clearObjects:function(b){b.find("video audio").each(function(){this.pause(),a(this).remove()}),b.find("img object div").each(function(){a(this).remove()})},_clearFileInput:function(){var d,e,f,b=this,c=b.$element;b.fileInputCleared=!0,da(c.val())||(b.isIE9||b.isIE10?(d=c.closest("form"),e=a(document.createElement("form")),f=a(document.createElement("div")),c.before(f),d.length?d.after(e):f.after(e),e.append(c).trigger("reset"),f.before(c).remove(),e.remove()):c.val(""))},_resetUpload:function(){var a=this;a.uploadCache={content:[],config:[],tags:[],append:!0},a.uploadCount=0,a.uploadStatus={},a.uploadLog=[],a.uploadAsyncCount=0,a.loadedImages=[],a.totalImagesCount=0,a.$btnUpload.removeAttr("disabled"),a._setProgress(0),p(a.$progress,"hide"),a._resetErrors(!1),a.ajaxAborted=!1,a.ajaxRequests=[],a._resetCanvas()},_resetCanvas:function(){var a=this;a.canvas&&a.imageCanvasContext&&a.imageCanvasContext.clearRect(0,0,a.canvas.width,a.canvas.height)},_hasInitialPreview:function(){var a=this;return!a.overwriteInitial&&k.count(a.id)},_resetPreview:function(){var b,c,a=this;k.count(a.id)?(b=k.out(a.id),a.$preview.html(b.content),c=a.initialCaption?a.initialCaption:b.caption,a._setCaption(c)):(a._clearPreview(),a._initCaption()),a.showPreview&&(a._initZoom(),a._initSortable())},_clearDefaultPreview:function(){var a=this;a.$preview.find(".file-default-preview").remove()},_validateDefaultPreview:function(){var a=this;a.showPreview&&!da(a.defaultPreviewContent)&&(a.$preview.html('<div class="file-default-preview">'+a.defaultPreviewContent+"</div>"),a.$container.removeClass("file-input-new"),a._initClickable())},_resetPreviewThumbs:function(a){var c,b=this;return a?(b._clearPreview(),void b.clearStack()):void(b._hasInitialPreview()?(c=k.out(b.id),b.$preview.html(c.content),b._setCaption(c.caption),b._initPreviewActions()):b._clearPreview())},_getLayoutTemplate:function(a){var b=this,c=fa(a,b.layoutTemplates,Y[a]);return da(b.customLayoutTags)?c:ia(c,b.customLayoutTags)},_getPreviewTemplate:function(a){var b=this,c=fa(a,b.previewTemplates,Z[a]);return da(b.customPreviewTags)?c:ia(c,b.customPreviewTags)},_getOutData:function(a,b,c){var d=this;return a=a||{},b=b||{},c=c||d.filestack.slice(0)||{},{form:d.formdata,files:c,filenames:d.filenames,filescount:d.getFilesCount(),extra:d._getExtraData(),response:b,reader:d.reader,jqXHR:a}},_getMsgSelected:function(a){var b=this,c=1===a?b.fileSingle:b.filePlural;return a>0?b.msgSelected.replace("{n}",a).replace("{files}",c):b.msgNoFilesSelected},_getThumbs:function(a){return a=a||"",this.$preview.find(".file-preview-frame:not(.file-preview-initial)"+a)},_getExtraData:function(a,b){var c=this,d=c.uploadExtraData;return"function"==typeof c.uploadExtraData&&(d=c.uploadExtraData(a,b)),d},_initXhr:function(a,b,c){var d=this;return a.upload&&a.upload.addEventListener("progress",function(a){var e=0,f=a.total,g=a.loaded||a.position;a.lengthComputable&&(e=Math.floor(g/f*100)),b?d._setAsyncUploadStatus(b,e,c):d._setProgress(e)},!1),a},_ajaxSubmit:function(b,c,d,e,f,g){var i,h=this;h._raise("filepreajax",[f,g]),h._uploadExtra(f,g),i=a.extend(!0,{},{xhr:function(){var b=a.ajaxSettings.xhr();return h._initXhr(b,f,h.getFileStack().length)},url:h.uploadUrl,type:"POST",dataType:"json",data:h.formdata,cache:!1,processData:!1,contentType:!1,beforeSend:b,success:c,complete:d,error:e},h.ajaxSettings),h.ajaxRequests.push(a.ajax(i))},_initUploadSuccess:function(b,c,d){var f,g,h,i,j,l,m,n,e=this,o=function(a,b){e[a]instanceof Array||(e[a]=[]),b&&b.length&&(e[a]=e[a].concat(b))};e.showPreview&&"object"==typeof b&&!a.isEmptyObject(b)&&void 0!==b.initialPreview&&b.initialPreview.length>0&&(e.hasInitData=!0,j=b.initialPreview||[],l=b.initialPreviewConfig||[],m=b.initialPreviewThumbTags||[],f=!(void 0!==b.append&&!b.append),j.length>0&&!ea(j)&&(j=j.split(e.initialPreviewDelimiter)),e.overwriteInitial=!1,o("initialPreview",j),o("initialPreviewConfig",l),o("initialPreviewThumbTags",m),void 0!==c?d?(n=c.attr("data-fileindex"),e.uploadCache.content[n]=j[0],e.uploadCache.config[n]=l[0]||[],e.uploadCache.tags[n]=m[0]||[],e.uploadCache.append=f):(h=k.add(e.id,j,l[0],m[0],f),g=k.get(e.id,h,!1),i=a(g).hide(),c.after(i).fadeOut("slow",function(){i.fadeIn("slow").css("display:inline-block"),e._initPreviewActions(),e._clearFileInput(),c.remove()})):(k.set(e.id,j,l,m,f),e._initPreview(),e._initPreviewActions()))},_initSuccessThumbs:function(){var b=this;b.showPreview&&b._getThumbs(".file-preview-success").each(function(){var c=a(this),d=c.find(".kv-file-remove");d.removeAttr("disabled"),j(d,"click",function(){var a=b._raise("filesuccessremove",[c.attr("id"),c.data("fileindex")]);ja(c),a!==!1&&c.fadeOut("slow",function(){c.remove(),b.$preview.find(".file-preview-frame").length||b.reset()})})})},_checkAsyncComplete:function(){var c,d,b=this;for(d=0;d<b.filestack.length;d++)if(b.filestack[d]&&(c=b.previewInitId+"-"+d,a.inArray(c,b.uploadLog)===-1))return!1;return b.uploadAsyncCount===b.uploadLog.length},_uploadExtra:function(b,c){var d=this,e=d._getExtraData(b,c);0!==e.length&&a.each(e,function(a,b){d.formdata.append(a,b)})},_uploadSingle:function(b,c,d){var h,j,l,m,n,q,r,s,t,u,e=this,f=e.getFileStack().length,g=new FormData,i=e.previewInitId+"-"+b,o=e.filestack.length>0||!a.isEmptyObject(e.uploadExtraData),v={id:i,index:b};e.formdata=g,e.showPreview&&(j=a("#"+i+":not(.file-preview-initial)"),m=j.find(".kv-file-upload"),n=j.find(".kv-file-remove"),a("#"+i).find(".file-thumb-progress").removeClass("hide")),0===f||!o||m&&m.hasClass("disabled")||e._abort(v)||(u=function(a,b){e.updateStack(a,void 0),e.uploadLog.push(b),e._checkAsyncComplete()&&(e.fileBatchCompleted=!0)},l=function(){var a=e.uploadCache;e.fileBatchCompleted&&setTimeout(function(){e.showPreview&&(k.set(e.id,a.content,a.config,a.tags,a.append),e.hasInitData&&(e._initPreview(),e._initPreviewActions())),e.unlock(),e._clearFileInput(),e._raise("filebatchuploadcomplete",[e.filestack,e._getExtraData()]),e.uploadCount=0,e.uploadStatus={},e.uploadLog=[],e._setProgress(101)},100)},q=function(c){h=e._getOutData(c),e.fileBatchCompleted=!1,e.showPreview&&(j.hasClass("file-preview-success")||(e._setThumbStatus(j,"Loading"),p(j,"file-uploading")),m.attr("disabled",!0),n.attr("disabled",!0)),d||e.lock(),e._raise("filepreupload",[h,i,b]),a.extend(!0,v,h),e._abort(v)&&(c.abort(),e._setProgressCancelled())},r=function(c,f,g){var k=e.showPreview&&j.attr("id")?j.attr("id"):i;h=e._getOutData(g,c),a.extend(!0,v,h),setTimeout(function(){da(c)||da(c.error)?(e.showPreview&&(e._setThumbStatus(j,"Success"),m.hide(),e._initUploadSuccess(c,j,d)),e._raise("fileuploaded",[h,k,b]),d?u(b,k):e.updateStack(b,void 0)):(e._showUploadError(c.error,v),e._setPreviewError(j,b),d&&u(b,k))},100)},s=function(){setTimeout(function(){e.showPreview&&(m.removeAttr("disabled"),n.removeAttr("disabled"),j.removeClass("file-uploading"),e._setProgress(101,a("#"+i).find(".file-thumb-progress"))),d?l():(e.unlock(!1),e._clearFileInput()),e._initSuccessThumbs()},100)},t=function(f,g,h){var k=e._parseError(f,h,d?c[b].name:null);setTimeout(function(){d&&u(b,i),e.uploadStatus[i]=100,e._setPreviewError(j,b),a.extend(!0,v,e._getOutData(f)),e._showUploadError(k,v)},100)},g.append(e.uploadFileAttr,c[b],e.filenames[b]),g.append("file_id",b),e._ajaxSubmit(q,r,s,t,i,b))},_uploadBatch:function(){var f,g,h,i,k,b=this,c=b.filestack,d=c.length,e={},j=b.filestack.length>0||!a.isEmptyObject(b.uploadExtraData);b.formdata=new FormData,0!==d&&j&&!b._abort(e)&&(k=function(){a.each(c,function(a){b.updateStack(a,void 0)}),b._clearFileInput()},f=function(c){b.lock();var d=b._getOutData(c);b.showPreview&&b._getThumbs().each(function(){var c=a(this),d=c.find(".kv-file-upload"),e=c.find(".kv-file-remove");c.hasClass("file-preview-success")||(b._setThumbStatus(c,"Loading"),p(c,"file-uploading")),d.attr("disabled",!0),e.attr("disabled",!0)}),b._raise("filebatchpreupload",[d]),b._abort(d)&&(c.abort(),b._setProgressCancelled())},g=function(c,d,e){var f=b._getOutData(e,c),g=b._getThumbs(":not(.file-preview-error)"),h=0,i=da(c)||da(c.errorkeys)?[]:c.errorkeys;da(c)||da(c.error)?(b._raise("filebatchuploadsuccess",[f]),k(),b.showPreview?(g.each(function(){var c=a(this),d=c.find(".kv-file-upload");c.find(".kv-file-upload").hide(),b._setThumbStatus(c,"Success"),c.removeClass("file-uploading"),d.removeAttr("disabled")}),b._initUploadSuccess(c)):b.reset()):(b.showPreview&&(g.each(function(){var c=a(this),d=c.find(".kv-file-remove"),e=c.find(".kv-file-upload");return c.removeClass("file-uploading"),e.removeAttr("disabled"),d.removeAttr("disabled"),0===i.length?void b._setPreviewError(c):(a.inArray(h,i)!==-1?b._setPreviewError(c):(c.find(".kv-file-upload").hide(),b._setThumbStatus(c,"Success"),b.updateStack(h,void 0)),void h++)}),b._initUploadSuccess(c)),b._showUploadError(c.error,f,"filebatchuploaderror"))},i=function(){b._setProgress(101),b.unlock(),b._initSuccessThumbs(),b._clearFileInput(),b._raise("filebatchuploadcomplete",[b.filestack,b._getExtraData()])},h=function(c,e,f){var g=b._getOutData(c),h=b._parseError(c,f);b._showUploadError(h,g,"filebatchuploaderror"),b.uploadFileCount=d-1,b.showPreview&&(b._getThumbs().each(function(){var c=a(this),d=c.attr("data-fileindex");c.removeClass("file-uploading"),void 0!==b.filestack[d]&&b._setPreviewError(c)}),b._getThumbs().removeClass("file-uploading"),b._getThumbs(" .kv-file-upload").removeAttr("disabled"),b._getThumbs(" .kv-file-delete").removeAttr("disabled"))},a.each(c,function(a,d){da(c[a])||b.formdata.append(b.uploadFileAttr,d,b.filenames[a])}),b._ajaxSubmit(f,g,i,h))},_uploadExtraOnly:function(){var c,d,e,f,a=this,b={};a.formdata=new FormData,a._abort(b)||(c=function(c){a.lock();var d=a._getOutData(c);a._raise("filebatchpreupload",[d]),a._setProgress(50),b.data=d,b.xhr=c,a._abort(b)&&(c.abort(),a._setProgressCancelled())},d=function(b,c,d){var e=a._getOutData(d,b);da(b)||da(b.error)?(a._raise("filebatchuploadsuccess",[e]),a._clearFileInput(),a._initUploadSuccess(b)):a._showUploadError(b.error,e,"filebatchuploaderror")},e=function(){a._setProgress(101),a.unlock(),a._clearFileInput(),a._raise("filebatchuploadcomplete",[a.filestack,a._getExtraData()])},f=function(c,d,e){var f=a._getOutData(c),g=a._parseError(c,e);b.data=f,a._showUploadError(g,f,"filebatchuploaderror")},a._ajaxSubmit(c,d,e,f))},_initFileActions:function(){var b=this;b.showPreview&&(b._initZoomButton(),b.$preview.find(".kv-file-remove").each(function(){var e,h,i,l,c=a(this),d=c.closest(".file-preview-frame"),f=d.attr("id"),g=d.attr("data-fileindex");j(c,"click",function(){return l=b._raise("filepreremove",[f,g]),!(l===!1||!b._validateMinCount())&&(e=d.hasClass("file-preview-error"),ja(d),void d.fadeOut("slow",function(){b.updateStack(g,void 0),b._clearObjects(d),d.remove(),f&&e&&b.$errorContainer.find('li[data-file-id="'+f+'"]').fadeOut("fast",function(){a(this).remove(),b._errorsExist()||b._resetErrors()}),b._clearFileInput();var c=b.getFileStack(!0),j=k.count(b.id),l=c.length,m=b.showPreview&&b.$preview.find(".file-preview-frame").length;0!==l||0!==j||m?(h=j+l,i=h>1?b._getMsgSelected(h):c[0]?b._getFileNames()[0]:"",b._setCaption(i)):b.reset(),b._raise("fileremoved",[f,g])}))})}),b.$preview.find(".kv-file-upload").each(function(){var c=a(this);j(c,"click",function(){var a=c.closest(".file-preview-frame"),d=a.attr("data-fileindex");a.hasClass("file-preview-error")||b._uploadSingle(d,b.filestack,!1)})}))},_hideFileIcon:function(){this.overwriteInitial&&this.$captionContainer.find(".kv-caption-icon").hide()},_showFileIcon:function(){this.$captionContainer.find(".kv-caption-icon").show()},_getSize:function(a){var b=this,c=parseFloat(a);if(!a||!c||isNaN(a)||isNaN(c))return b._getLayoutTemplate("size").replace("{sizeText}","0.00 KB");var d,f,g,e=b.fileSizeGetter;return"function"==typeof e?g=e(a):(d=Math.floor(Math.log(c)/Math.log(1024)),f=["B","KB","MB","GB","TB","PB","EB","ZB","YB"],g=1*(c/Math.pow(1024,d)).toFixed(2)+" "+f[d]),b._getLayoutTemplate("size").replace("{sizeText}",g)},_generatePreviewTemplate:function(a,b,c,d,e,f,g,h,i,j){var m,n,k=this,l=k._getPreviewTemplate(a),o=h||"",p=fa(a,k.previewSettings,ba[a]),q=k.slug(c),r=i||k._renderFileFooter(q,g,p.width,f);return j=j||e.slice(e.lastIndexOf("-")+1),l=k._parseFilePreviewIcon(l,c),"text"===a||"html"===a?(n="text"===a?ha(b):b,m=l.replace(/\{previewId}/g,e).replace(/\{caption}/g,q).replace(/\{width}/g,p.width).replace(/\{height}/g,p.height).replace(/\{frameClass}/g,o).replace(/\{cat}/g,d).replace(/\{footer}/g,r).replace(/\{fileindex}/g,j).replace(/\{data}/g,n).replace(/\{template}/g,a)):m=l.replace(/\{previewId}/g,e).replace(/\{caption}/g,q).replace(/\{frameClass}/g,o).replace(/\{type}/g,d).replace(/\{fileindex}/g,j).replace(/\{width}/g,p.width).replace(/\{height}/g,p.height).replace(/\{footer}/g,r).replace(/\{data}/g,b).replace(/\{template}/g,a),m},_previewDefault:function(b,c,d){var e=this,f=e.$preview,h=f.find(".file-live-thumbs");if(e.showPreview){var k,i=b?b.name:"",j=b?b.type:"",l=d===!0&&!e.isUploadable,m=g.createObjectURL(b);e._clearDefaultPreview(),k=e._generatePreviewTemplate("other",m,i,j,c,l,b.size),h.length||(h=a(document.createElement("div")).addClass("file-live-thumbs").appendTo(f)),h.append("\n"+k),d===!0&&e.isUploadable&&e._setThumbStatus(a("#"+c),"Error")}},_previewFile:function(b,c,d,e,f){if(this.showPreview){var q,g=this,h=g._parseFileType(c),i=c?c.name:"",j=g.slug(i),k=g.allowedPreviewTypes,l=g.allowedPreviewMimeTypes,m=g.$preview,n=k&&k.indexOf(h)>=0,o=m.find(".file-live-thumbs"),p="text"===h||"html"===h||"image"===h?d.target.result:f,r=l&&l.indexOf(c.type)!==-1;o.length||(o=a(document.createElement("div")).addClass("file-live-thumbs").appendTo(m)),"html"===h&&g.purifyHtml&&window.DOMPurify&&(p=window.DOMPurify.sanitize(p)),n||r?(q=g._generatePreviewTemplate(h,p,i,c.type,e,!1,c.size),g._clearDefaultPreview(),o.append("\n"+q),g._validateImage(b,e,j,c.type)):g._previewDefault(c,e),g._initSortable()}},_slugDefault:function(a){return da(a)?"":String(a).replace(/[\-\[\]\/\{}:;#%=\(\)\*\+\?\\\^\$\|<>&"']/g,"_")},_readFiles:function(b){this.reader=new FileReader;var r,c=this,d=c.$element,e=c.$preview,f=c.reader,i=c.$previewContainer,j=c.$previewStatus,k=c.msgLoading,m=c.msgProgress,n=c.previewInitId,o=b.length,p=c.fileTypeSettings,q=c.filestack.length,s=c.maxFilePreviewSize&&parseFloat(c.maxFilePreviewSize),t=e.length&&(!s||isNaN(s)),u=function(d,e,f,g){var h=a.extend(!0,{},c._getOutData({},{},b),{id:f,index:g}),i={id:f,index:g,file:e,files:b};return c._previewDefault(e,f,!0),c.isUploadable&&(c.addToStack(void 0),setTimeout(function(){r(g+1)},100)),c._initFileActions(),c.removeFromPreviewOnError&&a("#"+f).remove(),c.isUploadable?c._showUploadError(d,h):c._showError(d,i)};c.loadedImages=[],c.totalImagesCount=0,a.each(b,function(a,b){var d=c.fileTypeSettings.image||ca.image;d&&d(b.type)&&c.totalImagesCount++}),r=function(a){if(da(d.attr("multiple"))&&(o=1),a>=o)return c.isUploadable&&c.filestack.length>0?c._raise("filebatchselected",[c.getFileStack()]):c._raise("filebatchselected",[b]),i.removeClass("file-thumb-loading"),void j.html("");var x,y,A,D,H,I,J,K,v=q+a,w=n+"-"+v,z=b[a],B=z.name?c.slug(z.name):"",C=(z.size||0)/1e3,E="",F=g.createObjectURL(z),G=0,L=c.allowedFileTypes,M=da(L)?"":L.join(", "),N=c.allowedFileExtensions,O=da(N)?"":N.join(", ");if(B===!1)return void r(a+1);if(0===B.length)return I=c.msgInvalidFileName.replace("{name}",ha(z.name)),void(c.isError=u(I,z,w,a));if(da(N)||(E=new RegExp("\\.("+N.join("|")+")$","i")),A=C.toFixed(2),c.maxFileSize>0&&C>c.maxFileSize)return I=c.msgSizeTooLarge.replace("{name}",B).replace("{size}",A).replace("{maxSize}",c.maxFileSize),void(c.isError=u(I,z,w,a));if(null!==c.minFileSize&&C<=l(c.minFileSize))return I=c.msgSizeTooSmall.replace("{name}",B).replace("{size}",A).replace("{minSize}",c.minFileSize),void(c.isError=u(I,z,w,a));if(!da(L)&&ea(L)){for(H=0;H<L.length;H+=1)J=L[H],D=p[J],K=void 0!==D&&D(z.type,B),G+=da(K)?0:K.length;if(0===G)return I=c.msgInvalidFileType.replace("{name}",B).replace("{types}",M),void(c.isError=u(I,z,w,a))}return 0!==G||da(N)||!ea(N)||da(E)||(K=h(B,E),G+=da(K)?0:K.length,0!==G)?c.showPreview?!t&&C>s?(c.addToStack(z),i.addClass("file-thumb-loading"),c._previewDefault(z,w),c._initFileActions(),c._updateFileDetails(o),void r(a+1)):(e.length&&void 0!==FileReader?(j.html(k.replace("{index}",a+1).replace("{files}",o)),i.addClass("file-thumb-loading"),f.onerror=function(a){c._errorHandler(a,B)},f.onload=function(b){c._previewFile(a,z,b,w,F),c._initFileActions()},f.onloadend=function(){I=m.replace("{index}",a+1).replace("{files}",o).replace("{percent}",50).replace("{name}",B),setTimeout(function(){j.html(I),c._updateFileDetails(o),r(a+1)},100),c._raise("fileloaded",[z,w,a,f])},f.onprogress=function(b){if(b.lengthComputable){var c=b.loaded/b.total*100,d=Math.ceil(c);I=m.replace("{index}",a+1).replace("{files}",o).replace("{percent}",d).replace("{name}",B),setTimeout(function(){j.html(I)},100)}},x=fa("text",p,ca.text),y=fa("image",p,ca.image),x(z.type,B)?f.readAsText(z,c.textEncoding):y(z.type,B)?f.readAsDataURL(z):f.readAsArrayBuffer(z)):(c._previewDefault(z,w),setTimeout(function(){r(a+1),c._updateFileDetails(o)},100),c._raise("fileloaded",[z,w,a,f])),void c.addToStack(z)):(c.addToStack(z),setTimeout(function(){r(a+1)},100),void c._raise("fileloaded",[z,w,a,f])):(I=c.msgInvalidFileExtension.replace("{name}",B).replace("{extensions}",O),void(c.isError=u(I,z,w,a)))},r(0),c._updateFileDetails(o,!1)},_updateFileDetails:function(a){var b=this,c=b.$element,d=b.getFileStack(),e=i(9)&&ka(c.val())||c[0].files[0]&&c[0].files[0].name||d.length&&d[0].name||"",f=b.slug(e),g=b.isUploadable?d.length:a,h=k.count(b.id)+g,j=g>1?b._getMsgSelected(h):f;b.isError?(b.$previewContainer.removeClass("file-thumb-loading"),b.$previewStatus.html(""),b.$captionContainer.find(".kv-caption-icon").hide()):b._showFileIcon(),b._setCaption(j,b.isError),b.$container.removeClass("file-input-new file-input-ajax-new"),1===arguments.length&&b._raise("fileselect",[a,f]),k.count(b.id)&&b._initPreviewActions()},_setThumbStatus:function(a,b){var c=this;if(c.showPreview){var d="indicator"+b,e=d+"Title",f="file-preview-"+b.toLowerCase(),g=a.find(".file-upload-indicator"),h=c.fileActionSettings;a.removeClass("file-preview-success file-preview-error file-preview-loading"),"Error"===b&&a.find(".kv-file-upload").attr("disabled",!0),"Success"===b&&(a.find(".file-drag-handle").remove(),g.css("margin-left",0)),g.html(h[d]),g.attr("title",h[e]),a.addClass(f)}},_setProgressCancelled:function(){var a=this;a._setProgress(101,a.$progress,a.msgCancelled)},_setProgress:function(a,b,c){var d=this,e=Math.min(a,100),f=e<100?d.progressTemplate:c?d.progressErrorTemplate:a<=100?d.progressTemplate:d.progressCompleteTemplate,g=d.progressUploadThreshold;if(b=b||d.$progress,!da(f)){if(g&&e>g&&a<=100){var h=f.replace("{percent}",g).replace("{percent}",g).replace("{percent}%",d.msgUploadThreshold);b.html(h)}else b.html(f.replace(/\{percent}/g,e));c&&b.find('[role="progressbar"]').html(c)}},_setFileDropZoneTitle:function(){var d,a=this,b=a.$container.find(".file-drop-zone"),c=a.dropZoneTitle;a.isClickable&&(d=da(a.$element.attr("multiple"))?a.fileSingle:a.filePlural,c+=a.dropZoneClickTitle.replace("{files}",d)),b.find("."+a.dropZoneTitleClass).remove(),a.isUploadable&&a.showPreview&&0!==b.length&&!(a.getFileStack().length>0)&&a.dropZoneEnabled&&(0===b.find(".file-preview-frame").length&&da(a.defaultPreviewContent)&&b.prepend('<div class="'+a.dropZoneTitleClass+'">'+c+"</div>"),a.$container.removeClass("file-input-new"),p(a.$container,"file-input-ajax-new"))},_setAsyncUploadStatus:function(b,c,d){var e=this,f=0;e._setProgress(c,a("#"+b).find(".file-thumb-progress")),e.uploadStatus[b]=c,a.each(e.uploadStatus,function(a,b){f+=b}),e._setProgress(Math.floor(f/d))},_validateMinCount:function(){var a=this,b=a.isUploadable?a.getFileStack().length:a.$element.get(0).files.length;return!(a.validateInitialCount&&a.minFileCount>0&&a._getFileCount(b-1)<a.minFileCount)||(a._noFilesError({}),!1)},_getFileCount:function(a){var b=this,c=0;return b.validateInitialCount&&!b.overwriteInitial&&(c=k.count(b.id),a+=c),a},_getFileName:function(a){return a&&a.name?this.slug(a.name):void 0},_getFileNames:function(a){var b=this;return b.filenames.filter(function(b){return a?void 0!==b:void 0!==b&&null!==b})},_setPreviewError:function(a,b,c){var d=this;void 0!==b&&d.updateStack(b,c),d.removeFromPreviewOnError?a.remove():d._setThumbStatus(a,"Error")},_checkDimensions:function(a,b,c,d,e,f,g){var i,j,m,n,h=this,k="Small"===b?"min":"max",l=h[k+"Image"+f];!da(l)&&c.length&&(m=c[0],j="Width"===f?m.naturalWidth||m.width:m.naturalHeight||m.height,n="Small"===b?j>=l:j<=l,n||(i=h["msgImage"+f+b].replace("{name}",e).replace("{size}",l),h._showUploadError(i,g),h._setPreviewError(d,a,null)))},_validateImage:function(a,b,c,d){var h,i,k,e=this,f=e.$preview,l=f.find("#"+b),m=l.find("img");c=c||"Untitled",m.length&&j(m,"load",function(){i=l.width(),k=f.width(),i>k&&(m.css("width","100%"),l.css("width","97%")),h={ind:a,id:b},e._checkDimensions(a,"Small",m,l,c,"Width",h),e._checkDimensions(a,"Small",m,l,c,"Height",h),e.resizeImage||(e._checkDimensions(a,"Large",m,l,c,"Width",h),e._checkDimensions(a,"Large",m,l,c,"Height",h)),e._raise("fileimageloaded",[b]),e.loadedImages.push({ind:a,img:m,thumb:l,pid:b,typ:d}),e._validateAllImages(),g.revokeObjectURL(m.attr("src"))})},_validateAllImages:function(){var b,c,d,e,f,g,i,a=this,h={};if(a.loadedImages.length===a.totalImagesCount&&(a._raise("fileimagesloaded"),a.resizeImage)){i=a.isUploadable?a._showUploadError:a._showError;var j={val:0};for(b=0;b<a.loadedImages.length;b++)c=a.loadedImages[b],d=c.img,e=c.thumb,f=c.pid,g=c.ind,h={id:f,index:g},a._getResizedImage(d[0],c.typ,f,g,j,a.loadedImages.length)||(i(a.msgImageResizeError,h,"fileimageresizeerror"),a._setPreviewError(e,g))}},_getResizedImage:function(a,b,c,d,e,f){var n,o,g=this,h=a.naturalWidth,i=a.naturalHeight,j=1,k=g.maxImageWidth||h,l=g.maxImageHeight||i,m=h&&i,p=g.imageCanvas,q=g.imageCanvasContext;if(!m)return e.val++,e.val===f&&g._raise("fileimagesresized"),!1;if(h===k&&i===l)return g._raise("fileimageresized",[c,d]),e.val++,e.val===f&&g._raise("fileimagesresized"),!0;b=b||g.resizeDefaultImageType,n=h>k,o=i>l,j="width"===g.resizePreference?n?k/h:o?l/i:1:o?l/i:n?k/h:1,g._resetCanvas(),h*=j,i*=j,p.width=h,p.height=i;try{return q.drawImage(a,0,0,h,i),p.toBlob(function(a){g.filestack[d]=a,g._raise("fileimageresized",[c,d]),e.val++,e.val===f&&g._raise("fileimagesresized",[void 0,void 0])},b,g.resizeQuality),!0}catch(a){return e.val++,e.val===f&&g._raise("fileimagesresized",[void 0,void 0]),!1}},_initBrowse:function(a){var b=this;b.showBrowse?(b.$btnFile=a.find(".btn-file"),b.$btnFile.append(b.$element)):b.$element.hide()},_initCaption:function(){var a=this,b=a.initialCaption||"";return a.overwriteInitial||da(b)?(a.$caption.html(""),!1):(a._setCaption(b),!0)},_setCaption:function(b,c){var e,f,g,h,d=this,i=d.getFileStack();if(d.$caption.length){if(c)e=a("<div>"+d.msgValidationError+"</div>").text(),g=i.length,h=g?1===g&&i[0]?d._getFileNames()[0]:d._getMsgSelected(g):d._getMsgSelected(d.msgNo),f='<span class="'+d.msgValidationErrorClass+'">'+d.msgValidationErrorIcon+(da(b)?h:b)+"</span>";else{if(da(b))return;e=a("<div>"+b+"</div>").text(),f=d._getLayoutTemplate("fileIcon")+e}d.$caption.html(f),d.$caption.attr("title",e),d.$captionContainer.find(".file-caption-ellipsis").attr("title",e)}},_createContainer:function(){var b=this,c=a(document.createElement("div")).attr({class:"file-input file-input-new"}).html(b._renderMain());return b.$element.before(c),b._initBrowse(c),b.theme&&c.addClass("theme-"+b.theme),c},_refreshContainer:function(){var a=this,b=a.$container;b.before(a.$element),b.html(a._renderMain()),a._initBrowse(b)},_renderMain:function(){var a=this,b=a.isUploadable&&a.dropZoneEnabled?" file-drop-zone":"file-drop-disabled",c=a.showClose?a._getLayoutTemplate("close"):"",d=a.showPreview?a._getLayoutTemplate("preview").replace(/\{class}/g,a.previewClass).replace(/\{dropClass}/g,b):"",e=a.isDisabled?a.captionClass+" file-caption-disabled":a.captionClass,f=a.captionTemplate.replace(/\{class}/g,e+" kv-fileinput-caption");return a.mainTemplate.replace(/\{class}/g,a.mainClass+(!a.showBrowse&&a.showCaption?" no-browse":"")).replace(/\{preview}/g,d).replace(/\{close}/g,c).replace(/\{caption}/g,f).replace(/\{upload}/g,a._renderButton("upload")).replace(/\{remove}/g,a._renderButton("remove")).replace(/\{cancel}/g,a._renderButton("cancel")).replace(/\{browse}/g,a._renderButton("browse"))},_renderButton:function(a){var b=this,c=b._getLayoutTemplate("btnDefault"),d=b[a+"Class"],e=b[a+"Title"],f=b[a+"Icon"],g=b[a+"Label"],h=b.isDisabled?" disabled":"",i="button";switch(a){case"remove":if(!b.showRemove)return"";break;case"cancel":if(!b.showCancel)return"";d+=" hide";break;case"upload":if(!b.showUpload)return"";b.isUploadable&&!b.isDisabled?c=b._getLayoutTemplate("btnLink").replace("{href}",b.uploadUrl):i="submit";break;case"browse":if(!b.showBrowse)return"";c=b._getLayoutTemplate("btnBrowse");break;default:return""}return d+="browse"===a?" btn-file":" fileinput-"+a+" fileinput-"+a+"-button",da(g)||(g=' <span class="'+b.buttonLabelClass+'">'+g+"</span>"),c.replace("{type}",i).replace("{css}",d).replace("{title}",e).replace("{status}",h).replace("{icon}",f).replace("{label}",g)},_renderThumbProgress:function(){return'<div class="file-thumb-progress hide">'+this.progressTemplate.replace(/\{percent}/g,"0")+"</div>"},_renderFileFooter:function(a,b,c,d){var k,e=this,f=e.fileActionSettings,g=f.showRemove,h=f.showDrag,i=f.showUpload,j=f.showZoom,l=e._getLayoutTemplate("footer"),m=d?f.indicatorError:f.indicatorNew,n=d?f.indicatorErrorTitle:f.indicatorNewTitle;return b=e._getSize(b),k=e.isUploadable?l.replace(/\{actions}/g,e._renderFileActions(i,g,j,h,!1,!1,!1)).replace(/\{caption}/g,a).replace(/\{size}/g,b).replace(/\{width}/g,c).replace(/\{progress}/g,e._renderThumbProgress()).replace(/\{indicator}/g,m).replace(/\{indicatorTitle}/g,n):l.replace(/\{actions}/g,e._renderFileActions(!1,!1,j,h,!1,!1,!1)).replace(/\{caption}/g,a).replace(/\{size}/g,b).replace(/\{width}/g,c).replace(/\{progress}/g,"").replace(/\{indicator}/g,m).replace(/\{indicatorTitle}/g,n),k=ia(k,e.previewThumbTags)},_renderFileActions:function(a,b,c,d,e,f,g,h){if(!(a||b||c||d))return"";var p,i=this,j=f===!1?"":' data-url="'+f+'"',k=g===!1?"":' data-key="'+g+'"',l="",m="",n="",o="",q=i._getLayoutTemplate("actions"),r=i.fileActionSettings,s=i.otherActionButtons.replace(/\{dataKey}/g,k),t=e?r.removeClass+" disabled":r.removeClass;return b&&(l=i._getLayoutTemplate("actionDelete").replace(/\{removeClass}/g,t).replace(/\{removeIcon}/g,r.removeIcon).replace(/\{removeTitle}/g,r.removeTitle).replace(/\{dataUrl}/g,j).replace(/\{dataKey}/g,k)),a&&(m=i._getLayoutTemplate("actionUpload").replace(/\{uploadClass}/g,r.uploadClass).replace(/\{uploadIcon}/g,r.uploadIcon).replace(/\{uploadTitle}/g,r.uploadTitle)),c&&(n=i._getLayoutTemplate("actionZoom").replace(/\{zoomClass}/g,r.zoomClass).replace(/\{zoomIcon}/g,r.zoomIcon).replace(/\{zoomTitle}/g,r.zoomTitle)),d&&h&&(p="drag-handle-init "+r.dragClass,o=i._getLayoutTemplate("actionDrag").replace(/\{dragClass}/g,p).replace(/\{dragTitle}/g,r.dragTitle).replace(/\{dragIcon}/g,r.dragIcon)),q.replace(/\{delete}/g,l).replace(/\{upload}/g,m).replace(/\{zoom}/g,n).replace(/\{drag}/g,o).replace(/\{other}/g,s)},_browse:function(a){var b=this;b._raise("filebrowse"),a&&a.isDefaultPrevented()||(b.isError&&!b.isUploadable&&b.clear(),b.$captionContainer.focus())},_change:function(b){var c=this,d=c.$element;if(!c.isUploadable&&da(d.val())&&c.fileInputCleared)return void(c.fileInputCleared=!1);c.fileInputCleared=!1;var e,f,g,l,m,n,h=arguments.length>1,i=c.isUploadable,j=0,o=h?b.originalEvent.dataTransfer.files:d.get(0).files,p=c.filestack.length,q=da(d.attr("multiple")),r=q&&p>0,s=0,t=function(b,d,e,f){var g=a.extend(!0,{},c._getOutData({},{},o),{id:e,index:f}),h={id:e,index:f,file:d,files:o};return c.isUploadable?c._showUploadError(b,g):c._showError(b,h)};if(c.reader=null,c._resetUpload(),c._hideFileIcon(),c.isUploadable&&c.$container.find(".file-drop-zone ."+c.dropZoneTitleClass).remove(),h)for(e=[];o[j];)l=o[j],l.type||l.size%4096!==0?e.push(l):s++,j++;else e=void 0===b.target.files?b.target&&b.target.value?[{name:b.target.value.replace(/^.+\\/,"")}]:[]:b.target.files;if(da(e)||0===e.length)return i||c.clear(),c._showFolderError(s),void c._raise("fileselectnone");if(c._resetErrors(),n=e.length,g=c._getFileCount(c.isUploadable?c.getFileStack().length+n:n),c.maxFileCount>0&&g>c.maxFileCount){if(!c.autoReplace||n>c.maxFileCount)return m=c.autoReplace&&n>c.maxFileCount?n:g,f=c.msgFilesTooMany.replace("{m}",c.maxFileCount).replace("{n}",m),c.isError=t(f,null,null,null),c.$captionContainer.find(".kv-caption-icon").hide(),c._setCaption("",!0),void c.$container.removeClass("file-input-new file-input-ajax-new");g>c.maxFileCount&&c._resetPreviewThumbs(i)}else!i||r?(c._resetPreviewThumbs(!1),r&&c.clearStack()):!i||0!==p||k.count(c.id)&&!c.overwriteInitial||c._resetPreviewThumbs(!0);c.isPreviewable?c._readFiles(e):c._updateFileDetails(1),c._showFolderError(s)},_abort:function(b){var d,c=this;return!(!c.ajaxAborted||"object"!=typeof c.ajaxAborted||void 0===c.ajaxAborted.message)&&(d=a.extend(!0,{},c._getOutData(),b),d.abortData=c.ajaxAborted.data||{},d.abortMessage=c.ajaxAborted.message,c.cancel(),c._setProgress(101,c.$progress,c.msgCancelled),c._showUploadError(c.ajaxAborted.message,d,"filecustomerror"),!0)},_resetFileStack:function(){var b=this,c=0,d=[],e=[];b._getThumbs().each(function(){var f=a(this),g=f.attr("data-fileindex"),h=b.filestack[g];g!==-1&&(void 0!==h?(d[c]=h,e[c]=b._getFileName(h),f.attr({id:b.previewInitId+"-"+c,"data-fileindex":c}),c++):f.attr({id:"uploaded-"+ga(),"data-fileindex":"-1"}))}),b.filestack=d,b.filenames=e},clearStack:function(){var a=this;return a.filestack=[],a.filenames=[],a.$element},updateStack:function(a,b){var c=this;return c.filestack[a]=b,c.filenames[a]=c._getFileName(b),c.$element},addToStack:function(a){var b=this;return b.filestack.push(a),b.filenames.push(b._getFileName(a)),b.$element},getFileStack:function(a){var b=this;return b.filestack.filter(function(b){return a?void 0!==b:void 0!==b&&null!==b})},getFilesCount:function(){var a=this,b=a.isUploadable?a.getFileStack().length:a.$element.get(0).files.length;return a._getFileCount(b)},lock:function(){var a=this;return a._resetErrors(),a.disable(),a.showRemove&&p(a.$container.find(".fileinput-remove"),"hide"),a.showCancel&&a.$container.find(".fileinput-cancel").removeClass("hide"),a._raise("filelock",[a.filestack,a._getExtraData()]),a.$element},unlock:function(a){var b=this;return void 0===a&&(a=!0),b.enable(),b.showCancel&&p(b.$container.find(".fileinput-cancel"),"hide"),b.showRemove&&b.$container.find(".fileinput-remove").removeClass("hide"),a&&b._resetFileStack(),b._raise("fileunlock",[b.filestack,b._getExtraData()]),b.$element},cancel:function(){var e,b=this,c=b.ajaxRequests,d=c.length;if(d>0)for(e=0;e<d;e+=1)b.cancelling=!0,c[e].abort();return b._setProgressCancelled(),b._getThumbs().each(function(){var c=a(this),d=c.attr("data-fileindex");c.removeClass("file-uploading"),void 0!==b.filestack[d]&&(c.find(".kv-file-upload").removeClass("disabled").removeAttr("disabled"),c.find(".kv-file-remove").removeClass("disabled").removeAttr("disabled")), | 1 | +/*! |
| 2 | + * bootstrap-fileinput v4.3.6 | ||
| 3 | + * http://plugins.krajee.com/file-input | ||
| 4 | + * | ||
| 5 | + * Author: Kartik Visweswaran | ||
| 6 | + * Copyright: 2014 - 2016, Kartik Visweswaran, Krajee.com | ||
| 7 | + * | ||
| 8 | + * Licensed under the BSD 3-Clause | ||
| 9 | + * https://github.com/kartik-v/bootstrap-fileinput/blob/master/LICENSE.md | ||
| 10 | + */!function(a){"use strict";"function"==typeof define&&define.amd?define(["jquery"],a):"object"==typeof module&&module.exports?module.exports=a(require("jquery")):a(window.jQuery)}(function(a){"use strict";a.fn.fileinputLocales={},a.fn.fileinputThemes={};var b,c,d,e,f,g,h,i,j,k,l,m,n,o,p,q,r,s,t,u,v,w,x,y,z,A,B,C,D,E,F,G,H,I,J,K,L,M,N,O,P,Q,R,S,T,U,V,W,X,Y,Z,$,_,aa,ba,ca,da,ea,fa,ga,ha,ia,ja,ka,la,ma,na,oa;b=".fileinput",c="kvFileinputModal",d='style="width:{width};height:{height};"',e='<param name="controller" value="true" />\n<param name="allowFullScreen" value="true" />\n<param name="allowScriptAccess" value="always" />\n<param name="autoPlay" value="false" />\n<param name="autoStart" value="false" />\n<param name="quality" value="high" />\n',f='<div class="file-preview-other">\n<span class="{previewFileIconClass}">{previewFileIcon}</span>\n</div>',g=window.URL||window.webkitURL,h=function(a,b,c){return void 0!==a&&(c?a===b:a.match(b))},i=function(a){if("Microsoft Internet Explorer"!==navigator.appName)return!1;if(10===a)return new RegExp("msie\\s"+a,"i").test(navigator.userAgent);var c,b=document.createElement("div");return b.innerHTML="<!--[if IE "+a+"]> <i></i> <![endif]-->",c=b.getElementsByTagName("i").length,document.body.appendChild(b),b.parentNode.removeChild(b),c},j=function(a,c,d,e){var f=e?c:c.split(" ").join(b+" ")+b;a.off(f).on(f,d)},k={data:{},init:function(a){var b=a.initialPreview,c=a.id;b.length>0&&!ea(b)&&(b=b.split(a.initialPreviewDelimiter)),k.data[c]={content:b,config:a.initialPreviewConfig,tags:a.initialPreviewThumbTags,delimiter:a.initialPreviewDelimiter,previewFileType:a.initialPreviewFileType,previewAsData:a.initialPreviewAsData,template:a.previewGenericTemplate,showZoom:a.fileActionSettings.showZoom,showDrag:a.fileActionSettings.showDrag,getSize:function(b){return a._getSize(b)},parseTemplate:function(b,c,d,e,f,g,h){var i=" file-preview-initial";return a._generatePreviewTemplate(b,c,d,e,f,!1,null,i,g,h)},msg:function(b){return a._getMsgSelected(b)},initId:a.previewInitId,footer:a._getLayoutTemplate("footer").replace(/\{progress}/g,a._renderThumbProgress()),isDelete:a.initialPreviewShowDelete,caption:a.initialCaption,actions:function(b,c,d,e,f,g,h){return a._renderFileActions(b,c,d,e,f,g,h,!0)}}},fetch:function(a){return k.data[a].content.filter(function(a){return null!==a})},count:function(a,b){return k.data[a]&&k.data[a].content?b?k.data[a].content.length:k.fetch(a).length:0},get:function(b,c,d){var j,l,n,o,p,q,e="init_"+c,f=k.data[b],g=f.config[c],h=f.content[c],i=f.initId+"-"+e,m=" file-preview-initial",r=fa("previewAsData",g,f.previewAsData);return d=void 0===d||d,h?(g&&g.frameClass&&(m+=" "+g.frameClass),r?(n=f.previewAsData?fa("type",g,f.previewFileType||"generic"):"generic",o=fa("caption",g),p=k.footer(b,c,d,g&&g.size||null),q=fa("filetype",g,n),j=f.parseTemplate(n,h,o,q,i,p,e,null)):j=f.template.replace(/\{previewId}/g,i).replace(/\{frameClass}/g,m).replace(/\{fileindex}/g,e).replace(/\{content}/g,f.content[c]).replace(/\{template}/g,fa("type",g,f.previewFileType)).replace(/\{footer}/g,k.footer(b,c,d,g&&g.size||null)),f.tags.length&&f.tags[c]&&(j=ia(j,f.tags[c])),da(g)||da(g.frameAttr)||(l=a(document.createElement("div")).html(j),l.find(".file-preview-initial").attr(g.frameAttr),j=l.html(),l.remove()),j):""},add:function(b,c,d,e,f){var h,g=a.extend(!0,{},k.data[b]);return ea(c)||(c=c.split(g.delimiter)),f?(h=g.content.push(c)-1,g.config[h]=d,g.tags[h]=e):(h=c.length-1,g.content=c,g.config=d,g.tags=e),k.data[b]=g,h},set:function(b,c,d,e,f){var h,i,g=a.extend(!0,{},k.data[b]);if(c&&c.length&&(ea(c)||(c=c.split(g.delimiter)),i=c.filter(function(a){return null!==a}),i.length)){if(void 0===g.content&&(g.content=[]),void 0===g.config&&(g.config=[]),void 0===g.tags&&(g.tags=[]),f){for(h=0;h<c.length;h++)c[h]&&g.content.push(c[h]);for(h=0;h<d.length;h++)d[h]&&g.config.push(d[h]);for(h=0;h<e.length;h++)e[h]&&g.tags.push(e[h])}else g.content=c,g.config=d,g.tags=e;k.data[b]=g}},unset:function(a,b){var c=k.count(a.id);if(c){if(1===c)return k.data[a.id].content=[],k.data[a.id].config=[],k.data[a.id].tags=[],a.initialPreview=[],a.initialPreviewConfig=[],void(a.initialPreviewThumbTags=[]);k.data[a.id].content[b]=null,k.data[a.id].config[b]=null,k.data[a.id].tags[b]=null}},out:function(a){var d,b="",c=k.data[a],e=k.count(a,!0);if(0===e)return{content:"",caption:""};for(var f=0;f<e;f++)b+=k.get(a,f);return d=c.msg(k.count(a)),{content:'<div class="file-initial-thumbs">'+b+"</div>",caption:d}},footer:function(a,b,c,d){var e=k.data[a];if(c=void 0===c||c,0===e.config.length||da(e.config[b]))return"";var f=e.config[b],g=fa("caption",f),h=fa("width",f,"auto"),i=fa("url",f,!1),j=fa("key",f,null),l=fa("showDelete",f,!0),m=fa("showZoom",f,e.showZoom),n=fa("showDrag",f,e.showDrag),o=i===!1&&c,p=e.isDelete?e.actions(!1,l,m,n,o,i,j):"",q=e.footer.replace(/\{actions}/g,p);return q.replace(/\{caption}/g,g).replace(/\{size}/g,e.getSize(d)).replace(/\{width}/g,h).replace(/\{indicator}/g,"").replace(/\{indicatorTitle}/g,"")}},l=function(a,b){return b=b||0,"number"==typeof a?a:("string"==typeof a&&(a=parseFloat(a)),isNaN(a)?b:a)},m=function(){return!(!window.File||!window.FileReader)},n=function(){var a=document.createElement("div");return!i(9)&&(void 0!==a.draggable||void 0!==a.ondragstart&&void 0!==a.ondrop)},o=function(){return m()&&window.FormData},p=function(a,b){a.removeClass(b).addClass(b)},X={showRemove:!0,showUpload:!0,showZoom:!0,showDrag:!0,removeIcon:'<i class="glyphicon glyphicon-trash text-danger"></i>',removeClass:"btn btn-xs btn-default",removeTitle:"Remove file",uploadIcon:'<i class="glyphicon glyphicon-upload text-info"></i>',uploadClass:"btn btn-xs btn-default",uploadTitle:"Upload file",zoomIcon:'<i class="glyphicon glyphicon-zoom-in"></i>',zoomClass:"btn btn-xs btn-default",zoomTitle:"View Details",dragIcon:'<i class="glyphicon glyphicon-menu-hamburger"></i>',dragClass:"text-info",dragTitle:"Move / Rearrange",dragSettings:{},indicatorNew:'<i class="glyphicon glyphicon-hand-down text-warning"></i>',indicatorSuccess:'<i class="glyphicon glyphicon-ok-sign text-success"></i>',indicatorError:'<i class="glyphicon glyphicon-exclamation-sign text-danger"></i>',indicatorLoading:'<i class="glyphicon glyphicon-hand-up text-muted"></i>',indicatorNewTitle:"Not uploaded yet",indicatorSuccessTitle:"Uploaded",indicatorErrorTitle:"Upload Error",indicatorLoadingTitle:"Uploading ..."},q='{preview}\n<div class="kv-upload-progress hide"></div>\n<div class="input-group {class}">\n {caption}\n <div class="input-group-btn">\n {remove}\n {cancel}\n {upload}\n {browse}\n </div>\n</div>',r='{preview}\n<div class="kv-upload-progress hide"></div>\n{remove}\n{cancel}\n{upload}\n{browse}\n',s='<div class="file-preview {class}">\n {close} <div class="{dropClass}">\n <div class="file-preview-thumbnails">\n </div>\n <div class="clearfix"></div> <div class="file-preview-status text-center text-success"></div>\n <div class="kv-fileinput-error"></div>\n </div>\n</div>',u='<div class="close fileinput-remove">×</div>\n',t='<i class="glyphicon glyphicon-file kv-caption-icon"></i>',v='<div tabindex="500" class="form-control file-caption {class}">\n <div class="file-caption-name"></div>\n</div>\n',w='<button type="{type}" tabindex="500" title="{title}" class="{css}" {status}>{icon} {label}</button>',x='<a href="{href}" tabindex="500" title="{title}" class="{css}" {status}>{icon} {label}</a>',y='<div tabindex="500" class="{css}" {status}>{icon} {label}</div>',z='<div id="'+c+'" class="file-zoom-dialog modal fade" tabindex="-1" aria-labelledby="'+c+'Label"></div>',A='<div class="modal-dialog modal-lg" role="document">\n <div class="modal-content">\n <div class="modal-header">\n <div class="kv-zoom-actions pull-right">{toggleheader}{fullscreen}{borderless}{close}</div>\n <h3 class="modal-title">{heading} <small><span class="kv-zoom-title"></span></small></h3>\n </div>\n <div class="modal-body">\n <div class="floating-buttons"></div>\n <div class="kv-zoom-body file-zoom-content"></div>\n{prev} {next}\n </div>\n </div>\n</div>\n',B='<div class="progress">\n <div class="{class}" role="progressbar" aria-valuenow="{percent}" aria-valuemin="0" aria-valuemax="100" style="width:{percent}%;">\n {percent}%\n </div>\n</div>',C=" <br><samp>({sizeText})</samp>",D='<div class="file-thumbnail-footer">\n <div class="file-footer-caption" title="{caption}">{caption}{size}</div>\n {progress} {actions}\n</div>',E='<div class="file-actions">\n <div class="file-footer-buttons">\n {upload} {delete} {zoom} {other} </div>\n {drag}\n <div class="file-upload-indicator" title="{indicatorTitle}">{indicator}</div>\n <div class="clearfix"></div>\n</div>',F='<button type="button" class="kv-file-remove {removeClass}" title="{removeTitle}" {dataUrl}{dataKey}>{removeIcon}</button>\n',G='<button type="button" class="kv-file-upload {uploadClass}" title="{uploadTitle}">{uploadIcon}</button>',H='<button type="button" class="kv-file-zoom {zoomClass}" title="{zoomTitle}">{zoomIcon}</button>',I='<span class="file-drag-handle {dragClass}" title="{dragTitle}">{dragIcon}</span>',J='<div class="file-preview-frame{frameClass}" id="{previewId}" data-fileindex="{fileindex}" data-template="{template}"',K=J+'><div class="kv-file-content">\n',L=J+' title="{caption}" '+d+'><div class="kv-file-content">\n',M="</div>{footer}\n</div>\n",N="{content}\n",O='<div class="kv-preview-data file-preview-html" title="{caption}" '+d+">{data}</div>\n",P='<img src="{data}" class="kv-preview-data file-preview-image" title="{caption}" alt="{caption}" '+d+">\n",Q='<textarea class="kv-preview-data file-preview-text" title="{caption}" readonly '+d+">{data}</textarea>\n",R='<video class="kv-preview-data" width="{width}" height="{height}" controls>\n<source src="{data}" type="{type}">\n'+f+"\n</video>\n",S='<audio class="kv-preview-data" controls>\n<source src="{data}" type="{type}">\n'+f+"\n</audio>\n",T='<object class="kv-preview-data file-object" type="application/x-shockwave-flash" width="{width}" height="{height}" data="{data}">\n'+e+" "+f+"\n</object>\n",U='<object class="kv-preview-data file-object" data="{data}" type="{type}" width="{width}" height="{height}">\n<param name="movie" value="{caption}" />\n'+e+" "+f+"\n</object>\n",V='<embed class="kv-preview-data" src="{data}" width="{width}" height="{height}" type="application/pdf">\n',W='<div class="kv-preview-data file-preview-other-frame">\n'+f+"\n</div>\n",Y={main1:q,main2:r,preview:s,close:u,fileIcon:t,caption:v,modalMain:z,modal:A,progress:B,size:C,footer:D,actions:E,actionDelete:F,actionUpload:G,actionZoom:H,actionDrag:I,btnDefault:w,btnLink:x,btnBrowse:y},Z={generic:K+N+M,html:K+O+M,image:K+P+M,text:K+Q+M,video:L+R+M,audio:L+S+M,flash:L+T+M,object:L+U+M,pdf:L+V+M,other:L+W+M},_=["image","html","text","video","audio","flash","pdf","object"],ba={image:{width:"auto",height:"160px"},html:{width:"213px",height:"160px"},text:{width:"213px",height:"160px"},video:{width:"213px",height:"160px"},audio:{width:"213px",height:"80px"},flash:{width:"213px",height:"160px"},object:{width:"160px",height:"160px"},pdf:{width:"160px",height:"160px"},other:{width:"160px",height:"160px"}},$={image:{width:"auto",height:"auto","max-width":"100%","max-height":"100%"},html:{width:"100%",height:"100%","min-height":"480px"},text:{width:"100%",height:"100%","min-height":"480px"},video:{width:"auto",height:"100%","max-width":"100%"},audio:{width:"100%",height:"30px"},flash:{width:"auto",height:"480px"},object:{width:"auto",height:"100%","min-height":"480px"},pdf:{width:"100%",height:"100%","min-height":"480px"},other:{width:"auto",height:"100%","min-height":"480px"}},ca={image:function(a,b){return h(a,"image.*")||h(b,/\.(gif|png|jpe?g)$/i)},html:function(a,b){return h(a,"text/html")||h(b,/\.(htm|html)$/i)},text:function(a,b){return h(a,"text.*")||h(b,/\.(xml|javascript)$/i)||h(b,/\.(txt|md|csv|nfo|ini|json|php|js|css)$/i)},video:function(a,b){return h(a,"video.*")&&(h(a,/(ogg|mp4|mp?g|webm|3gp)$/i)||h(b,/\.(og?|mp4|webm|mp?g|3gp)$/i))},audio:function(a,b){return h(a,"audio.*")&&(h(b,/(ogg|mp3|mp?g|wav)$/i)||h(b,/\.(og?|mp3|mp?g|wav)$/i))},flash:function(a,b){return h(a,"application/x-shockwave-flash",!0)||h(b,/\.(swf)$/i)},pdf:function(a,b){return h(a,"application/pdf",!0)||h(b,/\.(pdf)$/i)},object:function(){return!0},other:function(){return!0}},da=function(b,c){return void 0===b||null===b||0===b.length||c&&""===a.trim(b)},ea=function(a){return Array.isArray(a)||"[object Array]"===Object.prototype.toString.call(a)},fa=function(a,b,c){return c=c||"",b&&"object"==typeof b&&a in b?b[a]:c},aa=function(b,c,d){return da(b)||da(b[c])?d:a(b[c])},ga=function(){return Math.round((new Date).getTime()+100*Math.random())},ha=function(a){return a.replace(/&/g,"&").replace(/</g,"<").replace(/>/g,">").replace(/"/g,""").replace(/'/g,"'")},ia=function(b,c){var d=b;return c?(a.each(c,function(a,b){"function"==typeof b&&(b=b()),d=d.split(a).join(b)}),d):d},ja=function(a){var b=a.is("img")?a.attr("src"):a.find("source").attr("src");g.revokeObjectURL(b)},ka=function(a){var b=a.lastIndexOf("/");return b===-1&&(b=a.lastIndexOf("\\")),a.split(a.substring(b,b+1)).pop()},la=function(){return document.fullscreenElement||document.mozFullScreenElement||document.webkitFullscreenElement||document.msFullscreenElement},ma=function(a){a&&!la()?document.documentElement.requestFullscreen?document.documentElement.requestFullscreen():document.documentElement.msRequestFullscreen?document.documentElement.msRequestFullscreen():document.documentElement.mozRequestFullScreen?document.documentElement.mozRequestFullScreen():document.documentElement.webkitRequestFullscreen&&document.documentElement.webkitRequestFullscreen(Element.ALLOW_KEYBOARD_INPUT):document.exitFullscreen?document.exitFullscreen():document.msExitFullscreen?document.msExitFullscreen():document.mozCancelFullScreen?document.mozCancelFullScreen():document.webkitExitFullscreen&&document.webkitExitFullscreen()},na=function(a,b,c){if(c>=a.length)for(var d=c-a.length;d--+1;)a.push(void 0);return a.splice(c,0,a.splice(b,1)[0]),a},oa=function(b,c){var d=this;d.$element=a(b),d._validate()&&(d.isPreviewable=m(),d.isIE9=i(9),d.isIE10=i(10),d.isPreviewable||d.isIE9?(d._init(c),d._listen()):d.$element.removeClass("file-loading"))},oa.prototype={constructor:oa,_init:function(b){var e,c=this,d=c.$element;a.each(b,function(a,b){switch(a){case"minFileCount":case"maxFileCount":case"maxFileSize":c[a]=l(b);break;default:c[a]=b}}),c.fileInputCleared=!1,c.fileBatchCompleted=!0,c.isPreviewable||(c.showPreview=!1),c.uploadFileAttr=da(d.attr("name"))?"file_data":d.attr("name"),c.reader=null,c.formdata={},c.clearStack(),c.uploadCount=0,c.uploadStatus={},c.uploadLog=[],c.uploadAsyncCount=0,c.loadedImages=[],c.totalImagesCount=0,c.ajaxRequests=[],c.isError=!1,c.ajaxAborted=!1,c.cancelling=!1,e=c._getLayoutTemplate("progress"),c.progressTemplate=e.replace("{class}",c.progressClass),c.progressCompleteTemplate=e.replace("{class}",c.progressCompleteClass),c.progressErrorTemplate=e.replace("{class}",c.progressErrorClass),c.dropZoneEnabled=n()&&c.dropZoneEnabled,c.isDisabled=c.$element.attr("disabled")||c.$element.attr("readonly"),c.isUploadable=o()&&!da(c.uploadUrl),c.isClickable=c.browseOnZoneClick&&c.showPreview&&(c.isUploadable&&c.dropZoneEnabled||!da(c.defaultPreviewContent)),c.slug="function"==typeof b.slugCallback?b.slugCallback:c._slugDefault,c.mainTemplate=c.showCaption?c._getLayoutTemplate("main1"):c._getLayoutTemplate("main2"),c.captionTemplate=c._getLayoutTemplate("caption"),c.previewGenericTemplate=c._getPreviewTemplate("generic"),c.resizeImage&&(c.maxImageWidth||c.maxImageHeight)&&(c.imageCanvas=document.createElement("canvas"),c.imageCanvasContext=c.imageCanvas.getContext("2d")),da(c.$element.attr("id"))&&c.$element.attr("id",ga()),void 0===c.$container?c.$container=c._createContainer():c._refreshContainer(),c.$dropZone=c.$container.find(".file-drop-zone"),c.$progress=c.$container.find(".kv-upload-progress"),c.$btnUpload=c.$container.find(".fileinput-upload"),c.$captionContainer=aa(b,"elCaptionContainer",c.$container.find(".file-caption")),c.$caption=aa(b,"elCaptionText",c.$container.find(".file-caption-name")),c.$previewContainer=aa(b,"elPreviewContainer",c.$container.find(".file-preview")),c.$preview=aa(b,"elPreviewImage",c.$container.find(".file-preview-thumbnails")),c.$previewStatus=aa(b,"elPreviewStatus",c.$container.find(".file-preview-status")),c.$errorContainer=aa(b,"elErrorContainer",c.$previewContainer.find(".kv-fileinput-error")),da(c.msgErrorClass)||p(c.$errorContainer,c.msgErrorClass),c.$errorContainer.hide(),c.fileActionSettings=a.extend(!0,X,b.fileActionSettings),c.previewInitId="preview-"+ga(),c.id=c.$element.attr("id"),k.init(c),c._initPreview(!0),c._initPreviewActions(),c.options=b,c._setFileDropZoneTitle(),c.$element.removeClass("file-loading"),c.$element.attr("disabled")&&c.disable(),c._initZoom()},_validate:function(){var b,a=this;return"file"===a.$element.attr("type")||(b='<div class="help-block alert alert-warning"><h4>Invalid Input Type</h4>You must set an input <code>type = file</code> for <b>bootstrap-fileinput</b> plugin to initialize.</div>',a.$element.after(b),!1)},_errorsExist:function(){var c,b=this;return!!b.$errorContainer.find("li").length||(c=a(document.createElement("div")).html(b.$errorContainer.html()),c.find("span.kv-error-close").remove(),c.find("ul").remove(),!!a.trim(c.text()).length)},_errorHandler:function(a,b){var c=this,d=a.target.error;d.code===d.NOT_FOUND_ERR?c._showError(c.msgFileNotFound.replace("{name}",b)):d.code===d.SECURITY_ERR?c._showError(c.msgFileSecured.replace("{name}",b)):d.code===d.NOT_READABLE_ERR?c._showError(c.msgFileNotReadable.replace("{name}",b)):d.code===d.ABORT_ERR?c._showError(c.msgFilePreviewAborted.replace("{name}",b)):c._showError(c.msgFilePreviewError.replace("{name}",b))},_addError:function(a){var b=this,c=b.$errorContainer;a&&c.length&&(c.html(b.errorCloseButton+a),j(c.find(".kv-error-close"),"click",function(){c.fadeOut("slow")}))},_resetErrors:function(a){var b=this,c=b.$errorContainer;b.isError=!1,b.$container.removeClass("has-error"),c.html(""),a?c.fadeOut("slow"):c.hide()},_showFolderError:function(a){var d,b=this,c=b.$errorContainer;a&&(d=b.msgFoldersNotAllowed.replace(/\{n}/g,a),b._addError(d),p(b.$container,"has-error"),c.fadeIn(800),b._raise("filefoldererror",[a,d]))},_showUploadError:function(a,b,c){var d=this,e=d.$errorContainer,f=c||"fileuploaderror",g=b&&b.id?'<li data-file-id="'+b.id+'">'+a+"</li>":"<li>"+a+"</li>";return 0===e.find("ul").length?d._addError("<ul>"+g+"</ul>"):e.find("ul").append(g),e.fadeIn(800),d._raise(f,[b,a]),d.$container.removeClass("file-input-new"),p(d.$container,"has-error"),!0},_showError:function(a,b,c){var d=this,e=d.$errorContainer,f=c||"fileerror";return b=b||{},b.reader=d.reader,d._addError(a),e.fadeIn(800),d._raise(f,[b,a]),d.isUploadable||d._clearFileInput(),d.$container.removeClass("file-input-new"),p(d.$container,"has-error"),d.$btnUpload.attr("disabled",!0),!0},_noFilesError:function(a){var b=this,c=b.minFileCount>1?b.filePlural:b.fileSingle,d=b.msgFilesTooLess.replace("{n}",b.minFileCount).replace("{files}",c),e=b.$errorContainer;b._addError(d),b.isError=!0,b._updateFileDetails(0),e.fadeIn(800),b._raise("fileerror",[a,d]),b._clearFileInput(),p(b.$container,"has-error")},_parseError:function(b,c,d){var e=this,f=a.trim(c+""),g="."===f.slice(-1)?"":".",h=void 0!==b.responseJSON&&void 0!==b.responseJSON.error?b.responseJSON.error:b.responseText;return e.cancelling&&e.msgUploadAborted&&(f=e.msgUploadAborted),e.showAjaxErrorDetails&&h?(h=a.trim(h.replace(/\n\s*\n/g,"\n")),h=h.length>0?"<pre>"+h+"</pre>":"",f+=g+h):f+=g,e.cancelling=!1,d?"<b>"+d+": </b>"+f:f},_parseFileType:function(a){var c,d,e,f,b=this;for(f=0;f<_.length;f+=1)if(e=_[f],c=fa(e,b.fileTypeSettings,ca[e]),d=c(a.type,a.name)?e:"",!da(d))return d;return"other"},_parseFilePreviewIcon:function(b,c){var e,f,d=this,g=d.previewFileIcon;return c&&c.indexOf(".")>-1&&(f=c.split(".").pop(),d.previewFileIconSettings&&d.previewFileIconSettings[f]&&(g=d.previewFileIconSettings[f]),d.previewFileExtSettings&&a.each(d.previewFileExtSettings,function(a,b){return d.previewFileIconSettings[a]&&b(f)?void(g=d.previewFileIconSettings[a]):void(e=!0)})),b.indexOf("{previewFileIcon}")>-1?b.replace(/\{previewFileIconClass}/g,d.previewFileIconClass).replace(/\{previewFileIcon}/g,g):b},_raise:function(b,c){var d=this,e=a.Event(b);if(void 0!==c?d.$element.trigger(e,c):d.$element.trigger(e),e.isDefaultPrevented())return!1;if(!e.result)return e.result;switch(b){case"filebatchuploadcomplete":case"filebatchuploadsuccess":case"fileuploaded":case"fileclear":case"filecleared":case"filereset":case"fileerror":case"filefoldererror":case"fileuploaderror":case"filebatchuploaderror":case"filedeleteerror":case"filecustomerror":case"filesuccessremove":break;default:d.ajaxAborted=e.result}return!0},_listenFullScreen:function(a){var d,e,b=this,c=b.$modal;c&&c.length&&(d=c&&c.find(".btn-fullscreen"),e=c&&c.find(".btn-borderless"),d.length&&e.length&&(d.removeClass("active").attr("aria-pressed","false"),e.removeClass("active").attr("aria-pressed","false"),a?d.addClass("active").attr("aria-pressed","true"):e.addClass("active").attr("aria-pressed","true"),c.hasClass("file-zoom-fullscreen")?b._maximizeZoomDialog():a?b._maximizeZoomDialog():e.removeClass("active").attr("aria-pressed","false")))},_listen:function(){var b=this,c=b.$element,d=c.closest("form"),e=b.$container;j(c,"change",a.proxy(b._change,b)),b.showBrowse&&j(b.$btnFile,"click",a.proxy(b._browse,b)),j(d,"reset",a.proxy(b.reset,b)),j(e.find(".fileinput-remove:not([disabled])"),"click",a.proxy(b.clear,b)),j(e.find(".fileinput-cancel"),"click",a.proxy(b.cancel,b)),b._initDragDrop(),b.isUploadable||j(d,"submit",a.proxy(b._submitForm,b)),j(b.$container.find(".fileinput-upload"),"click",a.proxy(b._uploadClick,b)),j(a(window),"resize",function(){b._listenFullScreen(screen.width===window.innerWidth&&screen.height===window.innerHeight)}),j(a(document),"webkitfullscreenchange mozfullscreenchange fullscreenchange MSFullscreenChange",function(){b._listenFullScreen(la())}),b._initClickable()},_initClickable:function(){var c,b=this;b.isClickable&&(c=b.isUploadable?b.$dropZone:b.$preview.find(".file-default-preview"),p(c,"clickable"),c.attr("tabindex",-1),j(c,"click",function(d){var e=a(d.target);e.parents(".file-preview-thumbnails").length&&!e.parents(".file-default-preview").length||(b.$element.trigger("click"),c.blur())}))},_initDragDrop:function(){var b=this,c=b.$dropZone;b.isUploadable&&b.dropZoneEnabled&&b.showPreview&&(j(c,"dragenter dragover",a.proxy(b._zoneDragEnter,b)),j(c,"dragleave",a.proxy(b._zoneDragLeave,b)),j(c,"drop",a.proxy(b._zoneDrop,b)),j(a(document),"dragenter dragover drop",b._zoneDragDropInit))},_zoneDragDropInit:function(a){a.stopPropagation(),a.preventDefault()},_zoneDragEnter:function(b){var c=this,d=a.inArray("Files",b.originalEvent.dataTransfer.types)>-1;return c._zoneDragDropInit(b),c.isDisabled||!d?(b.originalEvent.dataTransfer.effectAllowed="none",void(b.originalEvent.dataTransfer.dropEffect="none")):void p(c.$dropZone,"file-highlighted")},_zoneDragLeave:function(a){var b=this;b._zoneDragDropInit(a),b.isDisabled||b.$dropZone.removeClass("file-highlighted")},_zoneDrop:function(a){var b=this;a.preventDefault(),b.isDisabled||da(a.originalEvent.dataTransfer.files)||(b._change(a,"dragdrop"),b.$dropZone.removeClass("file-highlighted"))},_uploadClick:function(a){var d,b=this,c=b.$container.find(".fileinput-upload"),e=!c.hasClass("disabled")&&da(c.attr("disabled"));if(!a||!a.isDefaultPrevented()){if(!b.isUploadable)return void(e&&"submit"!==c.attr("type")&&(d=c.closest("form"),d.length&&d.trigger("submit"),a.preventDefault()));a.preventDefault(),e&&b.upload()}},_submitForm:function(){var a=this,b=a.$element,c=b.get(0).files;return c&&a.minFileCount>0&&a._getFileCount(c.length)<a.minFileCount?(a._noFilesError({}),!1):!a._abort({})},_clearPreview:function(){var a=this,b=a.showUploadedThumbs?a.$preview.find(".file-preview-frame:not(.file-preview-success)"):a.$preview.find(".file-preview-frame");b.remove(),a.$preview.find(".file-preview-frame").length&&a.showPreview||a._resetUpload(),a._validateDefaultPreview()},_initSortable:function(){var d,e,b=this,c=b.$preview;window.KvSortable&&(d=c.find(".file-initial-thumbs"),e={handle:".drag-handle-init",dataIdAttr:"data-preview-id",draggable:".file-preview-initial",onSort:function(c){var d=c.oldIndex,e=c.newIndex;b.initialPreview=na(b.initialPreview,d,e),b.initialPreviewConfig=na(b.initialPreviewConfig,d,e),k.init(b);for(var f=0;f<b.initialPreviewConfig.length;f++)if(null!==b.initialPreviewConfig[f]){var g=b.initialPreviewConfig[f].key,h=a(".kv-file-remove[data-key='"+g+"']");h=h.closest(".file-preview-frame"),h.attr("data-fileindex","init_"+f),h.data("fileindex","init_"+f)}b._raise("filesorted",{previewId:a(c.item).attr("id"),oldIndex:d,newIndex:e,stack:b.initialPreviewConfig})}},d.data("kvsortable")&&d.kvsortable("destroy"),a.extend(!0,e,b.fileActionSettings.dragSettings),d.kvsortable(e))},_initPreview:function(a){var d,b=this,c=b.initialCaption||"";return k.count(b.id)?(d=k.out(b.id),c=a&&b.initialCaption?b.initialCaption:d.caption,b.$preview.html(d.content),b._setCaption(c),b._initSortable(),void(da(d.content)||b.$container.removeClass("file-input-new"))):(b._clearPreview(),void(a?b._setCaption(c):b._initCaption()))},_getZoomButton:function(a){var b=this,c=b.previewZoomButtonIcons[a],d=b.previewZoomButtonClasses[a],e=' title="'+(b.previewZoomButtonTitles[a]||"")+'" ',f=e+("close"===a?' data-dismiss="modal" aria-hidden="true"':"");return"fullscreen"!==a&&"borderless"!==a&&"toggleheader"!==a||(f+=' data-toggle="button" aria-pressed="false" autocomplete="off"'),'<button type="button" class="'+d+" btn-"+a+'"'+f+">"+c+"</button>"},_getModalContent:function(){var a=this;return a._getLayoutTemplate("modal").replace(/\{heading}/g,a.msgZoomModalHeading).replace(/\{prev}/g,a._getZoomButton("prev")).replace(/\{next}/g,a._getZoomButton("next")).replace(/\{toggleheader}/g,a._getZoomButton("toggleheader")).replace(/\{fullscreen}/g,a._getZoomButton("fullscreen")).replace(/\{borderless}/g,a._getZoomButton("borderless")).replace(/\{close}/g,a._getZoomButton("close"))},_listenModalEvent:function(a){var b=this,c=b.$modal,d=function(a){return{sourceEvent:a,previewId:c.data("previewId"),modal:c}};c.on(a+".bs.modal",function(e){var f=c.find(".btn-fullscreen"),g=c.find(".btn-borderless");b._raise("filezoom"+a,d(e)),"shown"===a&&(g.removeClass("active").attr("aria-pressed","false"),f.removeClass("active").attr("aria-pressed","false"),c.hasClass("file-zoom-fullscreen")&&(b._maximizeZoomDialog(),la()?f.addClass("active").attr("aria-pressed","true"):g.addClass("active").attr("aria-pressed","true")))})},_initZoom:function(){var d,b=this,e=b._getLayoutTemplate("modalMain"),f="#"+c;b.$modal=a(f),b.$modal&&b.$modal.length||(d=a(document.createElement("div")).html(e).insertAfter(b.$container),b.$modal=a("#"+c).insertBefore(d),d.remove()),b.$modal.html(b._getModalContent()),b._listenModalEvent("show"),b._listenModalEvent("shown"),b._listenModalEvent("hide"),b._listenModalEvent("hidden"),b._listenModalEvent("loaded")},_initZoomButtons:function(){var d,e,b=this,c=b.$modal.data("previewId")||"",f=b.$preview.find(".file-preview-frame").toArray(),g=f.length,h=b.$modal.find(".btn-prev"),i=b.$modal.find(".btn-next");g&&(d=a(f[0]),e=a(f[g-1]),h.removeAttr("disabled"),i.removeAttr("disabled"),d.length&&d.attr("id")===c&&h.attr("disabled",!0),e.length&&e.attr("id")===c&&i.attr("disabled",!0))},_maximizeZoomDialog:function(){var b=this,c=b.$modal,d=c.find(".modal-header:visible"),e=c.find(".modal-footer:visible"),f=c.find(".modal-body"),g=a(window).height(),h=0;c.addClass("file-zoom-fullscreen"),d&&d.length&&(g-=d.outerHeight(!0)),e&&e.length&&(g-=e.outerHeight(!0)),f&&f.length&&(h=f.outerHeight(!0)-f.height(),g-=h),c.find(".kv-zoom-body").height(g)},_resizeZoomDialog:function(a){var b=this,c=b.$modal,d=c.find(".btn-fullscreen"),e=c.find(".btn-borderless");if(c.hasClass("file-zoom-fullscreen"))ma(!1),a?d.hasClass("active")||(c.removeClass("file-zoom-fullscreen"),b._resizeZoomDialog(!0),e.hasClass("active")&&e.removeClass("active").attr("aria-pressed","false")):d.hasClass("active")?d.removeClass("active").attr("aria-pressed","false"):(c.removeClass("file-zoom-fullscreen"),b.$modal.find(".kv-zoom-body").css("height",b.zoomModalHeight));else{if(!a)return void b._maximizeZoomDialog();ma(!0)}c.focus()},_setZoomContent:function(b,c){var e,f,g,h,i,k,l,r,d=this,m=b.attr("id"),n=d.$modal,o=n.find(".btn-prev"),q=n.find(".btn-next"),s=n.find(".btn-fullscreen"),t=n.find(".btn-borderless"),u=n.find(".btn-toggleheader");f=b.data("template")||"generic",e=b.find(".kv-file-content"),g=e.length?e.html():"",h=b.find(".file-footer-caption").text()||"",n.find(".kv-zoom-title").html(h),i=n.find(".kv-zoom-body"),c?(r=i.clone().insertAfter(i),i.html(g).hide(),r.fadeOut("fast",function(){i.fadeIn("fast"),r.remove()})):i.html(g),l=d.previewZoomSettings[f],l&&(k=i.find(".kv-preview-data"),p(k,"file-zoom-detail"),a.each(l,function(a,b){k.css(a,b),(k.attr("width")&&"width"===a||k.attr("height")&&"height"===a)&&k.removeAttr(a)})),n.data("previewId",m),j(o,"click",function(){d._zoomSlideShow("prev",m)}),j(q,"click",function(){d._zoomSlideShow("next",m)}),j(s,"click",function(){d._resizeZoomDialog(!0)}),j(t,"click",function(){d._resizeZoomDialog(!1)}),j(u,"click",function(){var c,a=n.find(".modal-header"),b=n.find(".modal-body .floating-buttons"),e=a.find(".kv-zoom-actions"),f=function(b){var c=d.$modal.find(".kv-zoom-body"),e=d.zoomModalHeight;n.hasClass("file-zoom-fullscreen")&&(e=c.outerHeight(!0),b||(e-=a.outerHeight(!0))),c.css("height",b?e+b:e)};a.is(":visible")?(c=a.outerHeight(!0),a.slideUp("slow",function(){e.find(".btn").appendTo(b),f(c)})):(b.find(".btn").appendTo(e),a.slideDown("slow",function(){f()})),n.focus()}),j(n,"keydown",function(a){var b=a.which||a.keyCode;37!==b||o.attr("disabled")||d._zoomSlideShow("prev",m),39!==b||q.attr("disabled")||d._zoomSlideShow("next",m)})},_zoomPreview:function(a){var c,b=this;if(!a.length)throw"Cannot zoom to detailed preview!";b.$modal.html(b._getModalContent()),c=a.closest(".file-preview-frame"),b._setZoomContent(c),b.$modal.modal("show"),b._initZoomButtons()},_zoomSlideShow:function(b,c){var f,g,j,d=this,e=d.$modal.find(".kv-zoom-actions .btn-"+b),h=d.$preview.find(".file-preview-frame").toArray(),i=h.length;if(!e.attr("disabled")){for(g=0;g<i;g++)if(a(h[g]).attr("id")===c){j="prev"===b?g-1:g+1;break}j<0||j>=i||!h[j]||(f=a(h[j]),f.length&&d._setZoomContent(f,!0),d._initZoomButtons(),d._raise("filezoom"+b,{previewId:c,modal:d.$modal}))}},_initZoomButton:function(){var b=this;b.$preview.find(".kv-file-zoom").each(function(){var c=a(this);j(c,"click",function(){b._zoomPreview(c)})})},_initPreviewActions:function(){var b=this,c=b.deleteExtraData||{},d=function(){var a=b.isUploadable?k.count(b.id):b.$element.get(0).files.length;0!==b.$preview.find(".kv-file-remove").length||a||(b.reset(),b.initialCaption="")};b._initZoomButton(),b.$preview.find(".kv-file-remove").each(function(){var e=a(this),f=e.data("url")||b.deleteUrl,g=e.data("key");if(!da(f)&&void 0!==g){var l,m,o,q,h=e.closest(".file-preview-frame"),i=k.data[b.id],n=h.data("fileindex");n=parseInt(n.replace("init_","")),o=da(i.config)&&da(i.config[n])?null:i.config[n],q=da(o)||da(o.extra)?c:o.extra,"function"==typeof q&&(q=q()),m={id:e.attr("id"),key:g,extra:q},l=a.extend(!0,{},{url:f,type:"POST",dataType:"json",data:a.extend(!0,{},{key:g},q),beforeSend:function(a){b.ajaxAborted=!1,b._raise("filepredelete",[g,a,q]),b.ajaxAborted?a.abort():(p(h,"file-uploading"),p(e,"disabled"))},success:function(a,c,f){var i,j;return da(a)||da(a.error)?(k.init(b),n=parseInt(h.data("fileindex").replace("init_","")),k.unset(b,n),i=k.count(b.id), | ||
| 11 | + j=i>0?b._getMsgSelected(i):"",b._raise("filedeleted",[g,f,q]),b._setCaption(j),h.removeClass("file-uploading").addClass("file-deleted"),void h.fadeOut("slow",function(){b._clearObjects(h),h.remove(),d(),i||0!==b.getFileStack().length||(b._setCaption(""),b.reset())})):(m.jqXHR=f,m.response=a,b._showError(a.error,m,"filedeleteerror"),h.removeClass("file-uploading"),e.removeClass("disabled"),void d())},error:function(a,c,e){var f=b._parseError(a,e);m.jqXHR=a,m.response={},b._showError(f,m,"filedeleteerror"),h.removeClass("file-uploading"),d()}},b.ajaxDeleteSettings),j(e,"click",function(){return!!b._validateMinCount()&&void a.ajax(l)})}})},_clearObjects:function(b){b.find("video audio").each(function(){this.pause(),a(this).remove()}),b.find("img object div").each(function(){a(this).remove()})},_clearFileInput:function(){var d,e,f,b=this,c=b.$element;b.fileInputCleared=!0,da(c.val())||(b.isIE9||b.isIE10?(d=c.closest("form"),e=a(document.createElement("form")),f=a(document.createElement("div")),c.before(f),d.length?d.after(e):f.after(e),e.append(c).trigger("reset"),f.before(c).remove(),e.remove()):c.val(""))},_resetUpload:function(){var a=this;a.uploadCache={content:[],config:[],tags:[],append:!0},a.uploadCount=0,a.uploadStatus={},a.uploadLog=[],a.uploadAsyncCount=0,a.loadedImages=[],a.totalImagesCount=0,a.$btnUpload.removeAttr("disabled"),a._setProgress(0),p(a.$progress,"hide"),a._resetErrors(!1),a.ajaxAborted=!1,a.ajaxRequests=[],a._resetCanvas()},_resetCanvas:function(){var a=this;a.canvas&&a.imageCanvasContext&&a.imageCanvasContext.clearRect(0,0,a.canvas.width,a.canvas.height)},_hasInitialPreview:function(){var a=this;return!a.overwriteInitial&&k.count(a.id)},_resetPreview:function(){var b,c,a=this;k.count(a.id)?(b=k.out(a.id),a.$preview.html(b.content),c=a.initialCaption?a.initialCaption:b.caption,a._setCaption(c)):(a._clearPreview(),a._initCaption()),a.showPreview&&(a._initZoom(),a._initSortable())},_clearDefaultPreview:function(){var a=this;a.$preview.find(".file-default-preview").remove()},_validateDefaultPreview:function(){var a=this;a.showPreview&&!da(a.defaultPreviewContent)&&(a.$preview.html('<div class="file-default-preview">'+a.defaultPreviewContent+"</div>"),a.$container.removeClass("file-input-new"),a._initClickable())},_resetPreviewThumbs:function(a){var c,b=this;return a?(b._clearPreview(),void b.clearStack()):void(b._hasInitialPreview()?(c=k.out(b.id),b.$preview.html(c.content),b._setCaption(c.caption),b._initPreviewActions()):b._clearPreview())},_getLayoutTemplate:function(a){var b=this,c=fa(a,b.layoutTemplates,Y[a]);return da(b.customLayoutTags)?c:ia(c,b.customLayoutTags)},_getPreviewTemplate:function(a){var b=this,c=fa(a,b.previewTemplates,Z[a]);return da(b.customPreviewTags)?c:ia(c,b.customPreviewTags)},_getOutData:function(a,b,c){var d=this;return a=a||{},b=b||{},c=c||d.filestack.slice(0)||{},{form:d.formdata,files:c,filenames:d.filenames,filescount:d.getFilesCount(),extra:d._getExtraData(),response:b,reader:d.reader,jqXHR:a}},_getMsgSelected:function(a){var b=this,c=1===a?b.fileSingle:b.filePlural;return a>0?b.msgSelected.replace("{n}",a).replace("{files}",c):b.msgNoFilesSelected},_getThumbs:function(a){return a=a||"",this.$preview.find(".file-preview-frame:not(.file-preview-initial)"+a)},_getExtraData:function(a,b){var c=this,d=c.uploadExtraData;return"function"==typeof c.uploadExtraData&&(d=c.uploadExtraData(a,b)),d},_initXhr:function(a,b,c){var d=this;return a.upload&&a.upload.addEventListener("progress",function(a){var e=0,f=a.total,g=a.loaded||a.position;a.lengthComputable&&(e=Math.floor(g/f*100)),b?d._setAsyncUploadStatus(b,e,c):d._setProgress(e)},!1),a},_ajaxSubmit:function(b,c,d,e,f,g){var i,h=this;h._raise("filepreajax",[f,g]),h._uploadExtra(f,g),i=a.extend(!0,{},{xhr:function(){var b=a.ajaxSettings.xhr();return h._initXhr(b,f,h.getFileStack().length)},url:h.uploadUrl,type:"POST",dataType:"json",data:h.formdata,cache:!1,processData:!1,contentType:!1,beforeSend:b,success:c,complete:d,error:e},h.ajaxSettings),h.ajaxRequests.push(a.ajax(i))},_initUploadSuccess:function(b,c,d){var f,g,h,i,j,l,m,n,e=this,o=function(a,b){e[a]instanceof Array||(e[a]=[]),b&&b.length&&(e[a]=e[a].concat(b))};e.showPreview&&"object"==typeof b&&!a.isEmptyObject(b)&&void 0!==b.initialPreview&&b.initialPreview.length>0&&(e.hasInitData=!0,j=b.initialPreview||[],l=b.initialPreviewConfig||[],m=b.initialPreviewThumbTags||[],f=!(void 0!==b.append&&!b.append),j.length>0&&!ea(j)&&(j=j.split(e.initialPreviewDelimiter)),e.overwriteInitial=!1,o("initialPreview",j),o("initialPreviewConfig",l),o("initialPreviewThumbTags",m),void 0!==c?d?(n=c.attr("data-fileindex"),e.uploadCache.content[n]=j[0],e.uploadCache.config[n]=l[0]||[],e.uploadCache.tags[n]=m[0]||[],e.uploadCache.append=f):(h=k.add(e.id,j,l[0],m[0],f),g=k.get(e.id,h,!1),i=a(g).hide(),c.after(i).fadeOut("slow",function(){i.fadeIn("slow").css("display:inline-block"),e._initPreviewActions(),e._clearFileInput(),c.remove()})):(k.set(e.id,j,l,m,f),e._initPreview(),e._initPreviewActions()))},_initSuccessThumbs:function(){var b=this;b.showPreview&&b._getThumbs(".file-preview-success").each(function(){var c=a(this),d=c.find(".kv-file-remove");d.removeAttr("disabled"),j(d,"click",function(){var a=b._raise("filesuccessremove",[c.attr("id"),c.data("fileindex")]);ja(c),a!==!1&&c.fadeOut("slow",function(){c.remove(),b.$preview.find(".file-preview-frame").length||b.reset()})})})},_checkAsyncComplete:function(){var c,d,b=this;for(d=0;d<b.filestack.length;d++)if(b.filestack[d]&&(c=b.previewInitId+"-"+d,a.inArray(c,b.uploadLog)===-1))return!1;return b.uploadAsyncCount===b.uploadLog.length},_uploadExtra:function(b,c){var d=this,e=d._getExtraData(b,c);0!==e.length&&a.each(e,function(a,b){d.formdata.append(a,b)})},_uploadSingle:function(b,c,d){var h,j,l,m,n,q,r,s,t,u,e=this,f=e.getFileStack().length,g=new FormData,i=e.previewInitId+"-"+b,o=e.filestack.length>0||!a.isEmptyObject(e.uploadExtraData),v={id:i,index:b};e.formdata=g,e.showPreview&&(j=a("#"+i+":not(.file-preview-initial)"),m=j.find(".kv-file-upload"),n=j.find(".kv-file-remove"),a("#"+i).find(".file-thumb-progress").removeClass("hide")),0===f||!o||m&&m.hasClass("disabled")||e._abort(v)||(u=function(a,b){e.updateStack(a,void 0),e.uploadLog.push(b),e._checkAsyncComplete()&&(e.fileBatchCompleted=!0)},l=function(){var a=e.uploadCache;e.fileBatchCompleted&&setTimeout(function(){e.showPreview&&(k.set(e.id,a.content,a.config,a.tags,a.append),e.hasInitData&&(e._initPreview(),e._initPreviewActions())),e.unlock(),e._clearFileInput(),e._raise("filebatchuploadcomplete",[e.filestack,e._getExtraData()]),e.uploadCount=0,e.uploadStatus={},e.uploadLog=[],e._setProgress(101)},100)},q=function(c){h=e._getOutData(c),e.fileBatchCompleted=!1,e.showPreview&&(j.hasClass("file-preview-success")||(e._setThumbStatus(j,"Loading"),p(j,"file-uploading")),m.attr("disabled",!0),n.attr("disabled",!0)),d||e.lock(),e._raise("filepreupload",[h,i,b]),a.extend(!0,v,h),e._abort(v)&&(c.abort(),e._setProgressCancelled())},r=function(c,f,g){var k=e.showPreview&&j.attr("id")?j.attr("id"):i;h=e._getOutData(g,c),a.extend(!0,v,h),setTimeout(function(){da(c)||da(c.error)?(e.showPreview&&(e._setThumbStatus(j,"Success"),m.hide(),e._initUploadSuccess(c,j,d)),e._raise("fileuploaded",[h,k,b]),d?u(b,k):e.updateStack(b,void 0)):(e._showUploadError(c.error,v),e._setPreviewError(j,b),d&&u(b,k))},100)},s=function(){setTimeout(function(){e.showPreview&&(m.removeAttr("disabled"),n.removeAttr("disabled"),j.removeClass("file-uploading"),e._setProgress(101,a("#"+i).find(".file-thumb-progress"))),d?l():(e.unlock(!1),e._clearFileInput()),e._initSuccessThumbs()},100)},t=function(f,g,h){var k=e._parseError(f,h,d?c[b].name:null);setTimeout(function(){d&&u(b,i),e.uploadStatus[i]=100,e._setPreviewError(j,b),a.extend(!0,v,e._getOutData(f)),e._showUploadError(k,v)},100)},g.append(e.uploadFileAttr,c[b],e.filenames[b]),g.append("file_id",b),e._ajaxSubmit(q,r,s,t,i,b))},_uploadBatch:function(){var f,g,h,i,k,b=this,c=b.filestack,d=c.length,e={},j=b.filestack.length>0||!a.isEmptyObject(b.uploadExtraData);b.formdata=new FormData,0!==d&&j&&!b._abort(e)&&(k=function(){a.each(c,function(a){b.updateStack(a,void 0)}),b._clearFileInput()},f=function(c){b.lock();var d=b._getOutData(c);b.showPreview&&b._getThumbs().each(function(){var c=a(this),d=c.find(".kv-file-upload"),e=c.find(".kv-file-remove");c.hasClass("file-preview-success")||(b._setThumbStatus(c,"Loading"),p(c,"file-uploading")),d.attr("disabled",!0),e.attr("disabled",!0)}),b._raise("filebatchpreupload",[d]),b._abort(d)&&(c.abort(),b._setProgressCancelled())},g=function(c,d,e){var f=b._getOutData(e,c),g=b._getThumbs(":not(.file-preview-error)"),h=0,i=da(c)||da(c.errorkeys)?[]:c.errorkeys;da(c)||da(c.error)?(b._raise("filebatchuploadsuccess",[f]),k(),b.showPreview?(g.each(function(){var c=a(this),d=c.find(".kv-file-upload");c.find(".kv-file-upload").hide(),b._setThumbStatus(c,"Success"),c.removeClass("file-uploading"),d.removeAttr("disabled")}),b._initUploadSuccess(c)):b.reset()):(b.showPreview&&(g.each(function(){var c=a(this),d=c.find(".kv-file-remove"),e=c.find(".kv-file-upload");return c.removeClass("file-uploading"),e.removeAttr("disabled"),d.removeAttr("disabled"),0===i.length?void b._setPreviewError(c):(a.inArray(h,i)!==-1?b._setPreviewError(c):(c.find(".kv-file-upload").hide(),b._setThumbStatus(c,"Success"),b.updateStack(h,void 0)),void h++)}),b._initUploadSuccess(c)),b._showUploadError(c.error,f,"filebatchuploaderror"))},i=function(){b._setProgress(101),b.unlock(),b._initSuccessThumbs(),b._clearFileInput(),b._raise("filebatchuploadcomplete",[b.filestack,b._getExtraData()])},h=function(c,e,f){var g=b._getOutData(c),h=b._parseError(c,f);b._showUploadError(h,g,"filebatchuploaderror"),b.uploadFileCount=d-1,b.showPreview&&(b._getThumbs().each(function(){var c=a(this),d=c.attr("data-fileindex");c.removeClass("file-uploading"),void 0!==b.filestack[d]&&b._setPreviewError(c)}),b._getThumbs().removeClass("file-uploading"),b._getThumbs(" .kv-file-upload").removeAttr("disabled"),b._getThumbs(" .kv-file-delete").removeAttr("disabled"))},a.each(c,function(a,d){da(c[a])||b.formdata.append(b.uploadFileAttr,d,b.filenames[a])}),b._ajaxSubmit(f,g,i,h))},_uploadExtraOnly:function(){var c,d,e,f,a=this,b={};a.formdata=new FormData,a._abort(b)||(c=function(c){a.lock();var d=a._getOutData(c);a._raise("filebatchpreupload",[d]),a._setProgress(50),b.data=d,b.xhr=c,a._abort(b)&&(c.abort(),a._setProgressCancelled())},d=function(b,c,d){var e=a._getOutData(d,b);da(b)||da(b.error)?(a._raise("filebatchuploadsuccess",[e]),a._clearFileInput(),a._initUploadSuccess(b)):a._showUploadError(b.error,e,"filebatchuploaderror")},e=function(){a._setProgress(101),a.unlock(),a._clearFileInput(),a._raise("filebatchuploadcomplete",[a.filestack,a._getExtraData()])},f=function(c,d,e){var f=a._getOutData(c),g=a._parseError(c,e);b.data=f,a._showUploadError(g,f,"filebatchuploaderror")},a._ajaxSubmit(c,d,e,f))},_initFileActions:function(){var b=this;b.showPreview&&(b._initZoomButton(),b.$preview.find(".kv-file-remove").each(function(){var e,h,i,l,c=a(this),d=c.closest(".file-preview-frame"),f=d.attr("id"),g=d.attr("data-fileindex");j(c,"click",function(){return l=b._raise("filepreremove",[f,g]),!(l===!1||!b._validateMinCount())&&(e=d.hasClass("file-preview-error"),ja(d),void d.fadeOut("slow",function(){b.updateStack(g,void 0),b._clearObjects(d),d.remove(),f&&e&&b.$errorContainer.find('li[data-file-id="'+f+'"]').fadeOut("fast",function(){a(this).remove(),b._errorsExist()||b._resetErrors()}),b._clearFileInput();var c=b.getFileStack(!0),j=k.count(b.id),l=c.length,m=b.showPreview&&b.$preview.find(".file-preview-frame").length;0!==l||0!==j||m?(h=j+l,i=h>1?b._getMsgSelected(h):c[0]?b._getFileNames()[0]:"",b._setCaption(i)):b.reset(),b._raise("fileremoved",[f,g])}))})}),b.$preview.find(".kv-file-upload").each(function(){var c=a(this);j(c,"click",function(){var a=c.closest(".file-preview-frame"),d=a.attr("data-fileindex");a.hasClass("file-preview-error")||b._uploadSingle(d,b.filestack,!1)})}))},_hideFileIcon:function(){this.overwriteInitial&&this.$captionContainer.find(".kv-caption-icon").hide()},_showFileIcon:function(){this.$captionContainer.find(".kv-caption-icon").show()},_getSize:function(a){var b=this,c=parseFloat(a);if(!a||!c||isNaN(a)||isNaN(c))return b._getLayoutTemplate("size").replace("{sizeText}","0.00 KB");var d,f,g,e=b.fileSizeGetter;return"function"==typeof e?g=e(a):(d=Math.floor(Math.log(c)/Math.log(1024)),f=["B","KB","MB","GB","TB","PB","EB","ZB","YB"],g=1*(c/Math.pow(1024,d)).toFixed(2)+" "+f[d]),b._getLayoutTemplate("size").replace("{sizeText}",g)},_generatePreviewTemplate:function(a,b,c,d,e,f,g,h,i,j){var m,n,k=this,l=k._getPreviewTemplate(a),o=h||"",p=fa(a,k.previewSettings,ba[a]),q=k.slug(c),r=i||k._renderFileFooter(q,g,p.width,f);return j=j||e.slice(e.lastIndexOf("-")+1),l=k._parseFilePreviewIcon(l,c),"text"===a||"html"===a?(n="text"===a?ha(b):b,m=l.replace(/\{previewId}/g,e).replace(/\{caption}/g,q).replace(/\{width}/g,p.width).replace(/\{height}/g,p.height).replace(/\{frameClass}/g,o).replace(/\{cat}/g,d).replace(/\{footer}/g,r).replace(/\{fileindex}/g,j).replace(/\{data}/g,n).replace(/\{template}/g,a)):m=l.replace(/\{previewId}/g,e).replace(/\{caption}/g,q).replace(/\{frameClass}/g,o).replace(/\{type}/g,d).replace(/\{fileindex}/g,j).replace(/\{width}/g,p.width).replace(/\{height}/g,p.height).replace(/\{footer}/g,r).replace(/\{data}/g,b).replace(/\{template}/g,a),m},_previewDefault:function(b,c,d){var e=this,f=e.$preview,h=f.find(".file-live-thumbs");if(e.showPreview){var k,i=b?b.name:"",j=b?b.type:"",l=d===!0&&!e.isUploadable,m=g.createObjectURL(b);e._clearDefaultPreview(),k=e._generatePreviewTemplate("other",m,i,j,c,l,b.size),h.length||(h=a(document.createElement("div")).addClass("file-live-thumbs").appendTo(f)),h.append("\n"+k),d===!0&&e.isUploadable&&e._setThumbStatus(a("#"+c),"Error")}},_previewFile:function(b,c,d,e,f){if(this.showPreview){var q,g=this,h=g._parseFileType(c),i=c?c.name:"",j=g.slug(i),k=g.allowedPreviewTypes,l=g.allowedPreviewMimeTypes,m=g.$preview,n=k&&k.indexOf(h)>=0,o=m.find(".file-live-thumbs"),p="text"===h||"html"===h||"image"===h?d.target.result:f,r=l&&l.indexOf(c.type)!==-1;o.length||(o=a(document.createElement("div")).addClass("file-live-thumbs").appendTo(m)),"html"===h&&g.purifyHtml&&window.DOMPurify&&(p=window.DOMPurify.sanitize(p)),n||r?(q=g._generatePreviewTemplate(h,p,i,c.type,e,!1,c.size),g._clearDefaultPreview(),o.append("\n"+q),g._validateImage(b,e,j,c.type)):g._previewDefault(c,e),g._initSortable()}},_slugDefault:function(a){return da(a)?"":String(a).replace(/[\-\[\]\/\{}:;#%=\(\)\*\+\?\\\^\$\|<>&"']/g,"_")},_readFiles:function(b){this.reader=new FileReader;var r,c=this,d=c.$element,e=c.$preview,f=c.reader,i=c.$previewContainer,j=c.$previewStatus,k=c.msgLoading,m=c.msgProgress,n=c.previewInitId,o=b.length,p=c.fileTypeSettings,q=c.filestack.length,s=c.maxFilePreviewSize&&parseFloat(c.maxFilePreviewSize),t=e.length&&(!s||isNaN(s)),u=function(d,e,f,g){var h=a.extend(!0,{},c._getOutData({},{},b),{id:f,index:g}),i={id:f,index:g,file:e,files:b};return c._previewDefault(e,f,!0),c.isUploadable&&(c.addToStack(void 0),setTimeout(function(){r(g+1)},100)),c._initFileActions(),c.removeFromPreviewOnError&&a("#"+f).remove(),c.isUploadable?c._showUploadError(d,h):c._showError(d,i)};c.loadedImages=[],c.totalImagesCount=0,a.each(b,function(a,b){var d=c.fileTypeSettings.image||ca.image;d&&d(b.type)&&c.totalImagesCount++}),r=function(a){if(da(d.attr("multiple"))&&(o=1),a>=o)return c.isUploadable&&c.filestack.length>0?c._raise("filebatchselected",[c.getFileStack()]):c._raise("filebatchselected",[b]),i.removeClass("file-thumb-loading"),void j.html("");var x,y,A,D,H,I,J,K,v=q+a,w=n+"-"+v,z=b[a],B=z.name?c.slug(z.name):"",C=(z.size||0)/1e3,E="",F=g.createObjectURL(z),G=0,L=c.allowedFileTypes,M=da(L)?"":L.join(", "),N=c.allowedFileExtensions,O=da(N)?"":N.join(", ");if(B===!1)return void r(a+1);if(0===B.length)return I=c.msgInvalidFileName.replace("{name}",ha(z.name)),void(c.isError=u(I,z,w,a));if(da(N)||(E=new RegExp("\\.("+N.join("|")+")$","i")),A=C.toFixed(2),c.maxFileSize>0&&C>c.maxFileSize)return I=c.msgSizeTooLarge.replace("{name}",B).replace("{size}",A).replace("{maxSize}",c.maxFileSize),void(c.isError=u(I,z,w,a));if(null!==c.minFileSize&&C<=l(c.minFileSize))return I=c.msgSizeTooSmall.replace("{name}",B).replace("{size}",A).replace("{minSize}",c.minFileSize),void(c.isError=u(I,z,w,a));if(!da(L)&&ea(L)){for(H=0;H<L.length;H+=1)J=L[H],D=p[J],K=void 0!==D&&D(z.type,B),G+=da(K)?0:K.length;if(0===G)return I=c.msgInvalidFileType.replace("{name}",B).replace("{types}",M),void(c.isError=u(I,z,w,a))}return 0!==G||da(N)||!ea(N)||da(E)||(K=h(B,E),G+=da(K)?0:K.length,0!==G)?c.showPreview?!t&&C>s?(c.addToStack(z),i.addClass("file-thumb-loading"),c._previewDefault(z,w),c._initFileActions(),c._updateFileDetails(o),void r(a+1)):(e.length&&void 0!==FileReader?(j.html(k.replace("{index}",a+1).replace("{files}",o)),i.addClass("file-thumb-loading"),f.onerror=function(a){c._errorHandler(a,B)},f.onload=function(b){c._previewFile(a,z,b,w,F),c._initFileActions()},f.onloadend=function(){I=m.replace("{index}",a+1).replace("{files}",o).replace("{percent}",50).replace("{name}",B),setTimeout(function(){j.html(I),c._updateFileDetails(o),r(a+1)},100),c._raise("fileloaded",[z,w,a,f])},f.onprogress=function(b){if(b.lengthComputable){var c=b.loaded/b.total*100,d=Math.ceil(c);I=m.replace("{index}",a+1).replace("{files}",o).replace("{percent}",d).replace("{name}",B),setTimeout(function(){j.html(I)},100)}},x=fa("text",p,ca.text),y=fa("image",p,ca.image),x(z.type,B)?f.readAsText(z,c.textEncoding):y(z.type,B)?f.readAsDataURL(z):f.readAsArrayBuffer(z)):(c._previewDefault(z,w),setTimeout(function(){r(a+1),c._updateFileDetails(o)},100),c._raise("fileloaded",[z,w,a,f])),void c.addToStack(z)):(c.addToStack(z),setTimeout(function(){r(a+1)},100),void c._raise("fileloaded",[z,w,a,f])):(I=c.msgInvalidFileExtension.replace("{name}",B).replace("{extensions}",O),void(c.isError=u(I,z,w,a)))},r(0),c._updateFileDetails(o,!1)},_updateFileDetails:function(a){var b=this,c=b.$element,d=b.getFileStack(),e=i(9)&&ka(c.val())||c[0].files[0]&&c[0].files[0].name||d.length&&d[0].name||"",f=b.slug(e),g=b.isUploadable?d.length:a,h=k.count(b.id)+g,j=g>1?b._getMsgSelected(h):f;b.isError?(b.$previewContainer.removeClass("file-thumb-loading"),b.$previewStatus.html(""),b.$captionContainer.find(".kv-caption-icon").hide()):b._showFileIcon(),b._setCaption(j,b.isError),b.$container.removeClass("file-input-new file-input-ajax-new"),1===arguments.length&&b._raise("fileselect",[a,f]),k.count(b.id)&&b._initPreviewActions()},_setThumbStatus:function(a,b){var c=this;if(c.showPreview){var d="indicator"+b,e=d+"Title",f="file-preview-"+b.toLowerCase(),g=a.find(".file-upload-indicator"),h=c.fileActionSettings;a.removeClass("file-preview-success file-preview-error file-preview-loading"),"Error"===b&&a.find(".kv-file-upload").attr("disabled",!0),"Success"===b&&(a.find(".file-drag-handle").remove(),g.css("margin-left",0)),g.html(h[d]),g.attr("title",h[e]),a.addClass(f)}},_setProgressCancelled:function(){var a=this;a._setProgress(101,a.$progress,a.msgCancelled)},_setProgress:function(a,b,c){var d=this,e=Math.min(a,100),f=e<100?d.progressTemplate:c?d.progressErrorTemplate:a<=100?d.progressTemplate:d.progressCompleteTemplate,g=d.progressUploadThreshold;if(b=b||d.$progress,!da(f)){if(g&&e>g&&a<=100){var h=f.replace("{percent}",g).replace("{percent}",g).replace("{percent}%",d.msgUploadThreshold);b.html(h)}else b.html(f.replace(/\{percent}/g,e));c&&b.find('[role="progressbar"]').html(c)}},_setFileDropZoneTitle:function(){var d,a=this,b=a.$container.find(".file-drop-zone"),c=a.dropZoneTitle;a.isClickable&&(d=da(a.$element.attr("multiple"))?a.fileSingle:a.filePlural,c+=a.dropZoneClickTitle.replace("{files}",d)),b.find("."+a.dropZoneTitleClass).remove(),a.isUploadable&&a.showPreview&&0!==b.length&&!(a.getFileStack().length>0)&&a.dropZoneEnabled&&(0===b.find(".file-preview-frame").length&&da(a.defaultPreviewContent)&&b.prepend('<div class="'+a.dropZoneTitleClass+'">'+c+"</div>"),a.$container.removeClass("file-input-new"),p(a.$container,"file-input-ajax-new"))},_setAsyncUploadStatus:function(b,c,d){var e=this,f=0;e._setProgress(c,a("#"+b).find(".file-thumb-progress")),e.uploadStatus[b]=c,a.each(e.uploadStatus,function(a,b){f+=b}),e._setProgress(Math.floor(f/d))},_validateMinCount:function(){var a=this,b=a.isUploadable?a.getFileStack().length:a.$element.get(0).files.length;return!(a.validateInitialCount&&a.minFileCount>0&&a._getFileCount(b-1)<a.minFileCount)||(a._noFilesError({}),!1)},_getFileCount:function(a){var b=this,c=0;return b.validateInitialCount&&!b.overwriteInitial&&(c=k.count(b.id),a+=c),a},_getFileName:function(a){return a&&a.name?this.slug(a.name):void 0},_getFileNames:function(a){var b=this;return b.filenames.filter(function(b){return a?void 0!==b:void 0!==b&&null!==b})},_setPreviewError:function(a,b,c){var d=this;void 0!==b&&d.updateStack(b,c),d.removeFromPreviewOnError?a.remove():d._setThumbStatus(a,"Error")},_checkDimensions:function(a,b,c,d,e,f,g){var i,j,m,n,h=this,k="Small"===b?"min":"max",l=h[k+"Image"+f];!da(l)&&c.length&&(m=c[0],j="Width"===f?m.naturalWidth||m.width:m.naturalHeight||m.height,n="Small"===b?j>=l:j<=l,n||(i=h["msgImage"+f+b].replace("{name}",e).replace("{size}",l),h._showUploadError(i,g),h._setPreviewError(d,a,null)))},_validateImage:function(a,b,c,d){var h,i,k,e=this,f=e.$preview,l=f.find("#"+b),m=l.find("img");c=c||"Untitled",m.length&&j(m,"load",function(){i=l.width(),k=f.width(),i>k&&(m.css("width","100%"),l.css("width","97%")),h={ind:a,id:b},e._checkDimensions(a,"Small",m,l,c,"Width",h),e._checkDimensions(a,"Small",m,l,c,"Height",h),e.resizeImage||(e._checkDimensions(a,"Large",m,l,c,"Width",h),e._checkDimensions(a,"Large",m,l,c,"Height",h)),e._raise("fileimageloaded",[b]),e.loadedImages.push({ind:a,img:m,thumb:l,pid:b,typ:d}),e._validateAllImages(),g.revokeObjectURL(m.attr("src"))})},_validateAllImages:function(){var b,c,d,e,f,g,i,a=this,h={};if(a.loadedImages.length===a.totalImagesCount&&(a._raise("fileimagesloaded"),a.resizeImage)){i=a.isUploadable?a._showUploadError:a._showError;var j={val:0};for(b=0;b<a.loadedImages.length;b++)c=a.loadedImages[b],d=c.img,e=c.thumb,f=c.pid,g=c.ind,h={id:f,index:g},a._getResizedImage(d[0],c.typ,f,g,j,a.loadedImages.length)||(i(a.msgImageResizeError,h,"fileimageresizeerror"),a._setPreviewError(e,g))}},_getResizedImage:function(a,b,c,d,e,f){var n,o,g=this,h=a.naturalWidth,i=a.naturalHeight,j=1,k=g.maxImageWidth||h,l=g.maxImageHeight||i,m=h&&i,p=g.imageCanvas,q=g.imageCanvasContext;if(!m)return e.val++,e.val===f&&g._raise("fileimagesresized"),!1;if(h===k&&i===l)return g._raise("fileimageresized",[c,d]),e.val++,e.val===f&&g._raise("fileimagesresized"),!0;b=b||g.resizeDefaultImageType,n=h>k,o=i>l,j="width"===g.resizePreference?n?k/h:o?l/i:1:o?l/i:n?k/h:1,g._resetCanvas(),h*=j,i*=j,p.width=h,p.height=i;try{return q.drawImage(a,0,0,h,i),p.toBlob(function(a){g.filestack[d]=a,g._raise("fileimageresized",[c,d]),e.val++,e.val===f&&g._raise("fileimagesresized",[void 0,void 0])},b,g.resizeQuality),!0}catch(a){return e.val++,e.val===f&&g._raise("fileimagesresized",[void 0,void 0]),!1}},_initBrowse:function(a){var b=this;b.showBrowse?(b.$btnFile=a.find(".btn-file"),b.$btnFile.append(b.$element)):b.$element.hide()},_initCaption:function(){var a=this,b=a.initialCaption||"";return a.overwriteInitial||da(b)?(a.$caption.html(""),!1):(a._setCaption(b),!0)},_setCaption:function(b,c){var e,f,g,h,d=this,i=d.getFileStack();if(d.$caption.length){if(c)e=a("<div>"+d.msgValidationError+"</div>").text(),g=i.length,h=g?1===g&&i[0]?d._getFileNames()[0]:d._getMsgSelected(g):d._getMsgSelected(d.msgNo),f='<span class="'+d.msgValidationErrorClass+'">'+d.msgValidationErrorIcon+(da(b)?h:b)+"</span>";else{if(da(b))return;e=a("<div>"+b+"</div>").text(),f=d._getLayoutTemplate("fileIcon")+e}d.$caption.html(f),d.$caption.attr("title",e),d.$captionContainer.find(".file-caption-ellipsis").attr("title",e)}},_createContainer:function(){var b=this,c=a(document.createElement("div")).attr({class:"file-input file-input-new"}).html(b._renderMain());return b.$element.before(c),b._initBrowse(c),b.theme&&c.addClass("theme-"+b.theme),c},_refreshContainer:function(){var a=this,b=a.$container;b.before(a.$element),b.html(a._renderMain()),a._initBrowse(b)},_renderMain:function(){var a=this,b=a.isUploadable&&a.dropZoneEnabled?" file-drop-zone":"file-drop-disabled",c=a.showClose?a._getLayoutTemplate("close"):"",d=a.showPreview?a._getLayoutTemplate("preview").replace(/\{class}/g,a.previewClass).replace(/\{dropClass}/g,b):"",e=a.isDisabled?a.captionClass+" file-caption-disabled":a.captionClass,f=a.captionTemplate.replace(/\{class}/g,e+" kv-fileinput-caption");return a.mainTemplate.replace(/\{class}/g,a.mainClass+(!a.showBrowse&&a.showCaption?" no-browse":"")).replace(/\{preview}/g,d).replace(/\{close}/g,c).replace(/\{caption}/g,f).replace(/\{upload}/g,a._renderButton("upload")).replace(/\{remove}/g,a._renderButton("remove")).replace(/\{cancel}/g,a._renderButton("cancel")).replace(/\{browse}/g,a._renderButton("browse"))},_renderButton:function(a){var b=this,c=b._getLayoutTemplate("btnDefault"),d=b[a+"Class"],e=b[a+"Title"],f=b[a+"Icon"],g=b[a+"Label"],h=b.isDisabled?" disabled":"",i="button";switch(a){case"remove":if(!b.showRemove)return"";break;case"cancel":if(!b.showCancel)return"";d+=" hide";break;case"upload":if(!b.showUpload)return"";b.isUploadable&&!b.isDisabled?c=b._getLayoutTemplate("btnLink").replace("{href}",b.uploadUrl):i="submit";break;case"browse":if(!b.showBrowse)return"";c=b._getLayoutTemplate("btnBrowse");break;default:return""}return d+="browse"===a?" btn-file":" fileinput-"+a+" fileinput-"+a+"-button",da(g)||(g=' <span class="'+b.buttonLabelClass+'">'+g+"</span>"),c.replace("{type}",i).replace("{css}",d).replace("{title}",e).replace("{status}",h).replace("{icon}",f).replace("{label}",g)},_renderThumbProgress:function(){return'<div class="file-thumb-progress hide">'+this.progressTemplate.replace(/\{percent}/g,"0")+"</div>"},_renderFileFooter:function(a,b,c,d){var k,e=this,f=e.fileActionSettings,g=f.showRemove,h=f.showDrag,i=f.showUpload,j=f.showZoom,l=e._getLayoutTemplate("footer"),m=d?f.indicatorError:f.indicatorNew,n=d?f.indicatorErrorTitle:f.indicatorNewTitle;return b=e._getSize(b),k=e.isUploadable?l.replace(/\{actions}/g,e._renderFileActions(i,g,j,h,!1,!1,!1)).replace(/\{caption}/g,a).replace(/\{size}/g,b).replace(/\{width}/g,c).replace(/\{progress}/g,e._renderThumbProgress()).replace(/\{indicator}/g,m).replace(/\{indicatorTitle}/g,n):l.replace(/\{actions}/g,e._renderFileActions(!1,!1,j,h,!1,!1,!1)).replace(/\{caption}/g,a).replace(/\{size}/g,b).replace(/\{width}/g,c).replace(/\{progress}/g,"").replace(/\{indicator}/g,m).replace(/\{indicatorTitle}/g,n),k=ia(k,e.previewThumbTags)},_renderFileActions:function(a,b,c,d,e,f,g,h){if(!(a||b||c||d))return"";var p,i=this,j=f===!1?"":' data-url="'+f+'"',k=g===!1?"":' data-key="'+g+'"',l="",m="",n="",o="",q=i._getLayoutTemplate("actions"),r=i.fileActionSettings,s=i.otherActionButtons.replace(/\{dataKey}/g,k),t=e?r.removeClass+" disabled":r.removeClass;return b&&(l=i._getLayoutTemplate("actionDelete").replace(/\{removeClass}/g,t).replace(/\{removeIcon}/g,r.removeIcon).replace(/\{removeTitle}/g,r.removeTitle).replace(/\{dataUrl}/g,j).replace(/\{dataKey}/g,k)),a&&(m=i._getLayoutTemplate("actionUpload").replace(/\{uploadClass}/g,r.uploadClass).replace(/\{uploadIcon}/g,r.uploadIcon).replace(/\{uploadTitle}/g,r.uploadTitle)),c&&(n=i._getLayoutTemplate("actionZoom").replace(/\{zoomClass}/g,r.zoomClass).replace(/\{zoomIcon}/g,r.zoomIcon).replace(/\{zoomTitle}/g,r.zoomTitle)),d&&h&&(p="drag-handle-init "+r.dragClass,o=i._getLayoutTemplate("actionDrag").replace(/\{dragClass}/g,p).replace(/\{dragTitle}/g,r.dragTitle).replace(/\{dragIcon}/g,r.dragIcon)),q.replace(/\{delete}/g,l).replace(/\{upload}/g,m).replace(/\{zoom}/g,n).replace(/\{drag}/g,o).replace(/\{other}/g,s)},_browse:function(a){var b=this;b._raise("filebrowse"),a&&a.isDefaultPrevented()||(b.isError&&!b.isUploadable&&b.clear(),b.$captionContainer.focus())},_change:function(b){var c=this,d=c.$element;if(!c.isUploadable&&da(d.val())&&c.fileInputCleared)return void(c.fileInputCleared=!1);c.fileInputCleared=!1;var e,f,g,l,m,n,h=arguments.length>1,i=c.isUploadable,j=0,o=h?b.originalEvent.dataTransfer.files:d.get(0).files,p=c.filestack.length,q=da(d.attr("multiple")),r=q&&p>0,s=0,t=function(b,d,e,f){var g=a.extend(!0,{},c._getOutData({},{},o),{id:e,index:f}),h={id:e,index:f,file:d,files:o};return c.isUploadable?c._showUploadError(b,g):c._showError(b,h)};if(c.reader=null,c._resetUpload(),c._hideFileIcon(),c.isUploadable&&c.$container.find(".file-drop-zone ."+c.dropZoneTitleClass).remove(),h)for(e=[];o[j];)l=o[j],l.type||l.size%4096!==0?e.push(l):s++,j++;else e=void 0===b.target.files?b.target&&b.target.value?[{name:b.target.value.replace(/^.+\\/,"")}]:[]:b.target.files;if(da(e)||0===e.length)return i||c.clear(),c._showFolderError(s),void c._raise("fileselectnone");if(c._resetErrors(),n=e.length,g=c._getFileCount(c.isUploadable?c.getFileStack().length+n:n),c.maxFileCount>0&&g>c.maxFileCount){if(!c.autoReplace||n>c.maxFileCount)return m=c.autoReplace&&n>c.maxFileCount?n:g,f=c.msgFilesTooMany.replace("{m}",c.maxFileCount).replace("{n}",m),c.isError=t(f,null,null,null),c.$captionContainer.find(".kv-caption-icon").hide(),c._setCaption("",!0),void c.$container.removeClass("file-input-new file-input-ajax-new");g>c.maxFileCount&&c._resetPreviewThumbs(i)}else!i||r?(c._resetPreviewThumbs(!1),r&&c.clearStack()):!i||0!==p||k.count(c.id)&&!c.overwriteInitial||c._resetPreviewThumbs(!0);c.isPreviewable?c._readFiles(e):c._updateFileDetails(1),c._showFolderError(s)},_abort:function(b){var d,c=this;return!(!c.ajaxAborted||"object"!=typeof c.ajaxAborted||void 0===c.ajaxAborted.message)&&(d=a.extend(!0,{},c._getOutData(),b),d.abortData=c.ajaxAborted.data||{},d.abortMessage=c.ajaxAborted.message,c.cancel(),c._setProgress(101,c.$progress,c.msgCancelled),c._showUploadError(c.ajaxAborted.message,d,"filecustomerror"),!0)},_resetFileStack:function(){var b=this,c=0,d=[],e=[];b._getThumbs().each(function(){var f=a(this),g=f.attr("data-fileindex"),h=b.filestack[g];g!==-1&&(void 0!==h?(d[c]=h,e[c]=b._getFileName(h),f.attr({id:b.previewInitId+"-"+c,"data-fileindex":c}),c++):f.attr({id:"uploaded-"+ga(),"data-fileindex":"-1"}))}),b.filestack=d,b.filenames=e},clearStack:function(){var a=this;return a.filestack=[],a.filenames=[],a.$element},updateStack:function(a,b){var c=this;return c.filestack[a]=b,c.filenames[a]=c._getFileName(b),c.$element},addToStack:function(a){var b=this;return b.filestack.push(a),b.filenames.push(b._getFileName(a)),b.$element},getFileStack:function(a){var b=this;return b.filestack.filter(function(b){return a?void 0!==b:void 0!==b&&null!==b})},getFilesCount:function(){var a=this,b=a.isUploadable?a.getFileStack().length:a.$element.get(0).files.length;return a._getFileCount(b)},lock:function(){var a=this;return a._resetErrors(),a.disable(),a.showRemove&&p(a.$container.find(".fileinput-remove"),"hide"),a.showCancel&&a.$container.find(".fileinput-cancel").removeClass("hide"),a._raise("filelock",[a.filestack,a._getExtraData()]),a.$element},unlock:function(a){var b=this;return void 0===a&&(a=!0),b.enable(),b.showCancel&&p(b.$container.find(".fileinput-cancel"),"hide"),b.showRemove&&b.$container.find(".fileinput-remove").removeClass("hide"),a&&b._resetFileStack(),b._raise("fileunlock",[b.filestack,b._getExtraData()]),b.$element},cancel:function(){var e,b=this,c=b.ajaxRequests,d=c.length;if(d>0)for(e=0;e<d;e+=1)b.cancelling=!0,c[e].abort();return b._setProgressCancelled(),b._getThumbs().each(function(){var c=a(this),d=c.attr("data-fileindex");c.removeClass("file-uploading"),void 0!==b.filestack[d]&&(c.find(".kv-file-upload").removeClass("disabled").removeAttr("disabled"),c.find(".kv-file-remove").removeClass("disabled").removeAttr("disabled")), | ||
| 12 | b.unlock()}),b.$element},clear:function(){var c,b=this;return b.$btnUpload.removeAttr("disabled"),b._getThumbs().find("video,audio,img").each(function(){ja(a(this))}),b._resetUpload(),b.clearStack(),b._clearFileInput(),b._resetErrors(!0),b._raise("fileclear"),b._hasInitialPreview()?(b._showFileIcon(),b._resetPreview(),b._initPreviewActions(),b.$container.removeClass("file-input-new")):(b._getThumbs().each(function(){b._clearObjects(a(this))}),b.isUploadable&&(k.data[b.id]={}),b.$preview.html(""),c=!b.overwriteInitial&&b.initialCaption.length>0?b.initialCaption:"",b.$caption.html(c),b.$caption.attr("title",""),p(b.$container,"file-input-new"),b._validateDefaultPreview()),0===b.$container.find(".file-preview-frame").length&&(b._initCaption()||b.$captionContainer.find(".kv-caption-icon").hide()),b._hideFileIcon(),b._raise("filecleared"),b.$captionContainer.focus(),b._setFileDropZoneTitle(),b.$element},reset:function(){var a=this;return a._resetPreview(),a.$container.find(".fileinput-filename").text(""),a._raise("filereset"),p(a.$container,"file-input-new"),(a.$preview.find(".file-preview-frame").length||a.isUploadable&&a.dropZoneEnabled)&&a.$container.removeClass("file-input-new"),a._setFileDropZoneTitle(),a.clearStack(),a.formdata={},a.$element},disable:function(){var a=this;return a.isDisabled=!0,a._raise("filedisabled"),a.$element.attr("disabled","disabled"),a.$container.find(".kv-fileinput-caption").addClass("file-caption-disabled"),a.$container.find(".btn-file, .fileinput-remove, .fileinput-upload, .file-preview-frame button").attr("disabled",!0),a._initDragDrop(),a.$element},enable:function(){var a=this;return a.isDisabled=!1,a._raise("fileenabled"),a.$element.removeAttr("disabled"),a.$container.find(".kv-fileinput-caption").removeClass("file-caption-disabled"),a.$container.find(".btn-file, .fileinput-remove, .fileinput-upload, .file-preview-frame button").removeAttr("disabled"),a._initDragDrop(),a.$element},upload:function(){var e,f,g,b=this,c=b.getFileStack().length,d={},h=!a.isEmptyObject(b._getExtraData());if(b.minFileCount>0&&b._getFileCount(c)<b.minFileCount)return void b._noFilesError(d);if(b.isUploadable&&!b.isDisabled&&(0!==c||h)){if(b._resetUpload(),b.$progress.removeClass("hide"),b.uploadCount=0,b.uploadStatus={},b.uploadLog=[],b.lock(),b._setProgress(2),0===c&&h)return void b._uploadExtraOnly();if(g=b.filestack.length,b.hasInitData=!1,!b.uploadAsync)return b._uploadBatch(),b.$element;for(f=b._getOutData(),b._raise("filebatchpreupload",[f]),b.fileBatchCompleted=!1,b.uploadCache={content:[],config:[],tags:[],append:!0},b.uploadAsyncCount=b.getFileStack().length,e=0;e<g;e++)b.uploadCache.content[e]=null,b.uploadCache.config[e]=null,b.uploadCache.tags[e]=null;for(e=0;e<g;e++)void 0!==b.filestack[e]&&b._uploadSingle(e,b.filestack,!0)}},destroy:function(){var a=this,c=a.$container;return c.find(".file-drop-zone").off(),a.$element.insertBefore(c).off(b).removeData(),c.off().remove(),a.$element},refresh:function(b){var c=this,d=c.$element;return b=b?a.extend(!0,{},c.options,b):c.options,c.destroy(),d.fileinput(b),d.val()&&d.trigger("change.fileinput"),d}},a.fn.fileinput=function(b){if(m()||i(9)){var c=Array.apply(null,arguments),d=[];switch(c.shift(),this.each(function(){var l,e=a(this),f=e.data("fileinput"),g="object"==typeof b&&b,h=g.theme||e.data("theme"),i={},j={},k=g.language||e.data("language")||"en";f||(h&&(j=a.fn.fileinputThemes[h]||{}),"en"===k||da(a.fn.fileinputLocales[k])||(i=a.fn.fileinputLocales[k]||{}),l=a.extend(!0,{},a.fn.fileinput.defaults,j,a.fn.fileinputLocales.en,i,g,e.data()),f=new oa(this,l),e.data("fileinput",f)),"string"==typeof b&&d.push(f[b].apply(f,c))}),d.length){case 0:return this;case 1:return d[0];default:return d}}},a.fn.fileinput.defaults={language:"en",showCaption:!0,showBrowse:!0,showPreview:!0,showRemove:!0,showUpload:!0,showCancel:!0,showClose:!0,showUploadedThumbs:!0,browseOnZoneClick:!1,autoReplace:!1,previewClass:"",captionClass:"",mainClass:"file-caption-main",mainTemplate:null,purifyHtml:!0,fileSizeGetter:null,initialCaption:"",initialPreview:[],initialPreviewDelimiter:"*$$*",initialPreviewAsData:!1,initialPreviewFileType:"image",initialPreviewConfig:[],initialPreviewThumbTags:[],previewThumbTags:{},initialPreviewShowDelete:!0,removeFromPreviewOnError:!1,deleteUrl:"",deleteExtraData:{},overwriteInitial:!0,layoutTemplates:Y,previewTemplates:Z,previewZoomSettings:$,previewZoomButtonIcons:{prev:'<i class="glyphicon glyphicon-triangle-left"></i>',next:'<i class="glyphicon glyphicon-triangle-right"></i>',toggleheader:'<i class="glyphicon glyphicon-resize-vertical"></i>',fullscreen:'<i class="glyphicon glyphicon-fullscreen"></i>',borderless:'<i class="glyphicon glyphicon-resize-full"></i>',close:'<i class="glyphicon glyphicon-remove"></i>'},previewZoomButtonClasses:{prev:"btn btn-navigate",next:"btn btn-navigate",toggleheader:"btn btn-default btn-header-toggle",fullscreen:"btn btn-default",borderless:"btn btn-default",close:"btn btn-default"},allowedPreviewTypes:_,allowedPreviewMimeTypes:null,allowedFileTypes:null,allowedFileExtensions:null,defaultPreviewContent:null,customLayoutTags:{},customPreviewTags:{},previewSettings:ba,fileTypeSettings:ca,previewFileIcon:'<i class="glyphicon glyphicon-file"></i>',previewFileIconClass:"file-other-icon",previewFileIconSettings:{},previewFileExtSettings:{},buttonLabelClass:"hidden-xs",browseIcon:'<i class="glyphicon glyphicon-folder-open"></i> ',browseClass:"btn btn-primary",removeIcon:'<i class="glyphicon glyphicon-trash"></i>',removeClass:"btn btn-default",cancelIcon:'<i class="glyphicon glyphicon-ban-circle"></i>',cancelClass:"btn btn-default",uploadIcon:'<i class="glyphicon glyphicon-upload"></i>',uploadClass:"btn btn-default",uploadUrl:null,uploadAsync:!0,uploadExtraData:{},zoomModalHeight:480,minImageWidth:null,minImageHeight:null,maxImageWidth:null,maxImageHeight:null,resizeImage:!1,resizePreference:"width",resizeQuality:.92,resizeDefaultImageType:"image/jpeg",minFileSize:0,maxFileSize:0,maxFilePreviewSize:25600,minFileCount:0,maxFileCount:0,validateInitialCount:!1,msgValidationErrorClass:"text-danger",msgValidationErrorIcon:'<i class="glyphicon glyphicon-exclamation-sign"></i> ',msgErrorClass:"file-error-message",progressThumbClass:"progress-bar progress-bar-success progress-bar-striped active",progressClass:"progress-bar progress-bar-success progress-bar-striped active",progressCompleteClass:"progress-bar progress-bar-success",progressErrorClass:"progress-bar progress-bar-danger",progressUploadThreshold:99,previewFileType:"image",elCaptionContainer:null,elCaptionText:null,elPreviewContainer:null,elPreviewImage:null,elPreviewStatus:null,elErrorContainer:null,errorCloseButton:'<span class="close kv-error-close">×</span>',slugCallback:null,dropZoneEnabled:!0,dropZoneTitleClass:"file-drop-zone-title",fileActionSettings:{},otherActionButtons:"",textEncoding:"UTF-8",ajaxSettings:{},ajaxDeleteSettings:{},showAjaxErrorDetails:!0},a.fn.fileinputLocales.en={fileSingle:"file",filePlural:"files",browseLabel:"Browse …",removeLabel:"Remove",removeTitle:"Clear selected files",cancelLabel:"Cancel",cancelTitle:"Abort ongoing upload",uploadLabel:"Upload",uploadTitle:"Upload selected files",msgNo:"No",msgNoFilesSelected:"No files selected",msgCancelled:"Cancelled",msgZoomModalHeading:"Detailed Preview",msgSizeTooSmall:'File "{name}" (<b>{size} KB</b>) is too small and must be larger than <b>{minSize} KB</b>.',msgSizeTooLarge:'File "{name}" (<b>{size} KB</b>) exceeds maximum allowed upload size of <b>{maxSize} KB</b>.',msgFilesTooLess:"You must select at least <b>{n}</b> {files} to upload.",msgFilesTooMany:"Number of files selected for upload <b>({n})</b> exceeds maximum allowed limit of <b>{m}</b>.",msgFileNotFound:'File "{name}" not found!',msgFileSecured:'Security restrictions prevent reading the file "{name}".',msgFileNotReadable:'File "{name}" is not readable.',msgFilePreviewAborted:'File preview aborted for "{name}".',msgFilePreviewError:'An error occurred while reading the file "{name}".',msgInvalidFileName:'Invalid or unsupported characters in file name "{name}".',msgInvalidFileType:'Invalid type for file "{name}". Only "{types}" files are supported.',msgInvalidFileExtension:'Invalid extension for file "{name}". Only "{extensions}" files are supported.',msgUploadAborted:"The file upload was aborted",msgUploadThreshold:"Processing...",msgValidationError:"Validation Error",msgLoading:"Loading file {index} of {files} …",msgProgress:"Loading file {index} of {files} - {name} - {percent}% completed.",msgSelected:"{n} {files} selected",msgFoldersNotAllowed:"Drag & drop files only! {n} folder(s) dropped were skipped.",msgImageWidthSmall:'Width of image file "{name}" must be at least {size} px.',msgImageHeightSmall:'Height of image file "{name}" must be at least {size} px.',msgImageWidthLarge:'Width of image file "{name}" cannot exceed {size} px.',msgImageHeightLarge:'Height of image file "{name}" cannot exceed {size} px.',msgImageResizeError:"Could not get the image dimensions to resize.",msgImageResizeException:"Error while resizing the image.<pre>{errors}</pre>",dropZoneTitle:"Drag & drop files here …",dropZoneClickTitle:"<br>(or click to select {files})",previewZoomButtonTitles:{prev:"View previous file",next:"View next file",toggleheader:"Toggle header",fullscreen:"Toggle full screen",borderless:"Toggle borderless mode",close:"Close detailed preview"}},a.fn.fileinput.Constructor=oa,a(document).ready(function(){var b=a("input.file[type=file]");b.length&&b.fileinput()})}); | 12 | b.unlock()}),b.$element},clear:function(){var c,b=this;return b.$btnUpload.removeAttr("disabled"),b._getThumbs().find("video,audio,img").each(function(){ja(a(this))}),b._resetUpload(),b.clearStack(),b._clearFileInput(),b._resetErrors(!0),b._raise("fileclear"),b._hasInitialPreview()?(b._showFileIcon(),b._resetPreview(),b._initPreviewActions(),b.$container.removeClass("file-input-new")):(b._getThumbs().each(function(){b._clearObjects(a(this))}),b.isUploadable&&(k.data[b.id]={}),b.$preview.html(""),c=!b.overwriteInitial&&b.initialCaption.length>0?b.initialCaption:"",b.$caption.html(c),b.$caption.attr("title",""),p(b.$container,"file-input-new"),b._validateDefaultPreview()),0===b.$container.find(".file-preview-frame").length&&(b._initCaption()||b.$captionContainer.find(".kv-caption-icon").hide()),b._hideFileIcon(),b._raise("filecleared"),b.$captionContainer.focus(),b._setFileDropZoneTitle(),b.$element},reset:function(){var a=this;return a._resetPreview(),a.$container.find(".fileinput-filename").text(""),a._raise("filereset"),p(a.$container,"file-input-new"),(a.$preview.find(".file-preview-frame").length||a.isUploadable&&a.dropZoneEnabled)&&a.$container.removeClass("file-input-new"),a._setFileDropZoneTitle(),a.clearStack(),a.formdata={},a.$element},disable:function(){var a=this;return a.isDisabled=!0,a._raise("filedisabled"),a.$element.attr("disabled","disabled"),a.$container.find(".kv-fileinput-caption").addClass("file-caption-disabled"),a.$container.find(".btn-file, .fileinput-remove, .fileinput-upload, .file-preview-frame button").attr("disabled",!0),a._initDragDrop(),a.$element},enable:function(){var a=this;return a.isDisabled=!1,a._raise("fileenabled"),a.$element.removeAttr("disabled"),a.$container.find(".kv-fileinput-caption").removeClass("file-caption-disabled"),a.$container.find(".btn-file, .fileinput-remove, .fileinput-upload, .file-preview-frame button").removeAttr("disabled"),a._initDragDrop(),a.$element},upload:function(){var e,f,g,b=this,c=b.getFileStack().length,d={},h=!a.isEmptyObject(b._getExtraData());if(b.minFileCount>0&&b._getFileCount(c)<b.minFileCount)return void b._noFilesError(d);if(b.isUploadable&&!b.isDisabled&&(0!==c||h)){if(b._resetUpload(),b.$progress.removeClass("hide"),b.uploadCount=0,b.uploadStatus={},b.uploadLog=[],b.lock(),b._setProgress(2),0===c&&h)return void b._uploadExtraOnly();if(g=b.filestack.length,b.hasInitData=!1,!b.uploadAsync)return b._uploadBatch(),b.$element;for(f=b._getOutData(),b._raise("filebatchpreupload",[f]),b.fileBatchCompleted=!1,b.uploadCache={content:[],config:[],tags:[],append:!0},b.uploadAsyncCount=b.getFileStack().length,e=0;e<g;e++)b.uploadCache.content[e]=null,b.uploadCache.config[e]=null,b.uploadCache.tags[e]=null;for(e=0;e<g;e++)void 0!==b.filestack[e]&&b._uploadSingle(e,b.filestack,!0)}},destroy:function(){var a=this,c=a.$container;return c.find(".file-drop-zone").off(),a.$element.insertBefore(c).off(b).removeData(),c.off().remove(),a.$element},refresh:function(b){var c=this,d=c.$element;return b=b?a.extend(!0,{},c.options,b):c.options,c.destroy(),d.fileinput(b),d.val()&&d.trigger("change.fileinput"),d}},a.fn.fileinput=function(b){if(m()||i(9)){var c=Array.apply(null,arguments),d=[];switch(c.shift(),this.each(function(){var l,e=a(this),f=e.data("fileinput"),g="object"==typeof b&&b,h=g.theme||e.data("theme"),i={},j={},k=g.language||e.data("language")||"en";f||(h&&(j=a.fn.fileinputThemes[h]||{}),"en"===k||da(a.fn.fileinputLocales[k])||(i=a.fn.fileinputLocales[k]||{}),l=a.extend(!0,{},a.fn.fileinput.defaults,j,a.fn.fileinputLocales.en,i,g,e.data()),f=new oa(this,l),e.data("fileinput",f)),"string"==typeof b&&d.push(f[b].apply(f,c))}),d.length){case 0:return this;case 1:return d[0];default:return d}}},a.fn.fileinput.defaults={language:"en",showCaption:!0,showBrowse:!0,showPreview:!0,showRemove:!0,showUpload:!0,showCancel:!0,showClose:!0,showUploadedThumbs:!0,browseOnZoneClick:!1,autoReplace:!1,previewClass:"",captionClass:"",mainClass:"file-caption-main",mainTemplate:null,purifyHtml:!0,fileSizeGetter:null,initialCaption:"",initialPreview:[],initialPreviewDelimiter:"*$$*",initialPreviewAsData:!1,initialPreviewFileType:"image",initialPreviewConfig:[],initialPreviewThumbTags:[],previewThumbTags:{},initialPreviewShowDelete:!0,removeFromPreviewOnError:!1,deleteUrl:"",deleteExtraData:{},overwriteInitial:!0,layoutTemplates:Y,previewTemplates:Z,previewZoomSettings:$,previewZoomButtonIcons:{prev:'<i class="glyphicon glyphicon-triangle-left"></i>',next:'<i class="glyphicon glyphicon-triangle-right"></i>',toggleheader:'<i class="glyphicon glyphicon-resize-vertical"></i>',fullscreen:'<i class="glyphicon glyphicon-fullscreen"></i>',borderless:'<i class="glyphicon glyphicon-resize-full"></i>',close:'<i class="glyphicon glyphicon-remove"></i>'},previewZoomButtonClasses:{prev:"btn btn-navigate",next:"btn btn-navigate",toggleheader:"btn btn-default btn-header-toggle",fullscreen:"btn btn-default",borderless:"btn btn-default",close:"btn btn-default"},allowedPreviewTypes:_,allowedPreviewMimeTypes:null,allowedFileTypes:null,allowedFileExtensions:null,defaultPreviewContent:null,customLayoutTags:{},customPreviewTags:{},previewSettings:ba,fileTypeSettings:ca,previewFileIcon:'<i class="glyphicon glyphicon-file"></i>',previewFileIconClass:"file-other-icon",previewFileIconSettings:{},previewFileExtSettings:{},buttonLabelClass:"hidden-xs",browseIcon:'<i class="glyphicon glyphicon-folder-open"></i> ',browseClass:"btn btn-primary",removeIcon:'<i class="glyphicon glyphicon-trash"></i>',removeClass:"btn btn-default",cancelIcon:'<i class="glyphicon glyphicon-ban-circle"></i>',cancelClass:"btn btn-default",uploadIcon:'<i class="glyphicon glyphicon-upload"></i>',uploadClass:"btn btn-default",uploadUrl:null,uploadAsync:!0,uploadExtraData:{},zoomModalHeight:480,minImageWidth:null,minImageHeight:null,maxImageWidth:null,maxImageHeight:null,resizeImage:!1,resizePreference:"width",resizeQuality:.92,resizeDefaultImageType:"image/jpeg",minFileSize:0,maxFileSize:0,maxFilePreviewSize:25600,minFileCount:0,maxFileCount:0,validateInitialCount:!1,msgValidationErrorClass:"text-danger",msgValidationErrorIcon:'<i class="glyphicon glyphicon-exclamation-sign"></i> ',msgErrorClass:"file-error-message",progressThumbClass:"progress-bar progress-bar-success progress-bar-striped active",progressClass:"progress-bar progress-bar-success progress-bar-striped active",progressCompleteClass:"progress-bar progress-bar-success",progressErrorClass:"progress-bar progress-bar-danger",progressUploadThreshold:99,previewFileType:"image",elCaptionContainer:null,elCaptionText:null,elPreviewContainer:null,elPreviewImage:null,elPreviewStatus:null,elErrorContainer:null,errorCloseButton:'<span class="close kv-error-close">×</span>',slugCallback:null,dropZoneEnabled:!0,dropZoneTitleClass:"file-drop-zone-title",fileActionSettings:{},otherActionButtons:"",textEncoding:"UTF-8",ajaxSettings:{},ajaxDeleteSettings:{},showAjaxErrorDetails:!0},a.fn.fileinputLocales.en={fileSingle:"file",filePlural:"files",browseLabel:"Browse …",removeLabel:"Remove",removeTitle:"Clear selected files",cancelLabel:"Cancel",cancelTitle:"Abort ongoing upload",uploadLabel:"Upload",uploadTitle:"Upload selected files",msgNo:"No",msgNoFilesSelected:"No files selected",msgCancelled:"Cancelled",msgZoomModalHeading:"Detailed Preview",msgSizeTooSmall:'File "{name}" (<b>{size} KB</b>) is too small and must be larger than <b>{minSize} KB</b>.',msgSizeTooLarge:'File "{name}" (<b>{size} KB</b>) exceeds maximum allowed upload size of <b>{maxSize} KB</b>.',msgFilesTooLess:"You must select at least <b>{n}</b> {files} to upload.",msgFilesTooMany:"Number of files selected for upload <b>({n})</b> exceeds maximum allowed limit of <b>{m}</b>.",msgFileNotFound:'File "{name}" not found!',msgFileSecured:'Security restrictions prevent reading the file "{name}".',msgFileNotReadable:'File "{name}" is not readable.',msgFilePreviewAborted:'File preview aborted for "{name}".',msgFilePreviewError:'An error occurred while reading the file "{name}".',msgInvalidFileName:'Invalid or unsupported characters in file name "{name}".',msgInvalidFileType:'Invalid type for file "{name}". Only "{types}" files are supported.',msgInvalidFileExtension:'Invalid extension for file "{name}". Only "{extensions}" files are supported.',msgUploadAborted:"The file upload was aborted",msgUploadThreshold:"Processing...",msgValidationError:"Validation Error",msgLoading:"Loading file {index} of {files} …",msgProgress:"Loading file {index} of {files} - {name} - {percent}% completed.",msgSelected:"{n} {files} selected",msgFoldersNotAllowed:"Drag & drop files only! {n} folder(s) dropped were skipped.",msgImageWidthSmall:'Width of image file "{name}" must be at least {size} px.',msgImageHeightSmall:'Height of image file "{name}" must be at least {size} px.',msgImageWidthLarge:'Width of image file "{name}" cannot exceed {size} px.',msgImageHeightLarge:'Height of image file "{name}" cannot exceed {size} px.',msgImageResizeError:"Could not get the image dimensions to resize.",msgImageResizeException:"Error while resizing the image.<pre>{errors}</pre>",dropZoneTitle:"Drag & drop files here …",dropZoneClickTitle:"<br>(or click to select {files})",previewZoomButtonTitles:{prev:"View previous file",next:"View next file",toggleheader:"Toggle header",fullscreen:"Toggle full screen",borderless:"Toggle borderless mode",close:"Close detailed preview"}},a.fn.fileinput.Constructor=oa,a(document).ready(function(){var b=a("input.file[type=file]");b.length&&b.fileinput()})}); |
| 13 | \ No newline at end of file | 13 | \ No newline at end of file |
src/main/resources/static/assets/plugins/fileinput/purify.min.js
| 1 | -(function(e){"use strict";var t=typeof window==="undefined"?null:window;if(typeof define==="function"&&define.amd){define(function(){return e(t)})}else if(typeof module!=="undefined"){module.exports=e(t)}else{t.DOMPurify=e(t)}})(function e(t){"use strict";var r=function(t){return e(t)};r.version="0.7.4";if(!t||!t.document||t.document.nodeType!==9){r.isSupported=false;return r}var n=t.document;var a=n;var i=t.DocumentFragment;var o=t.HTMLTemplateElement;var l=t.NodeFilter;var s=t.NamedNodeMap||t.MozNamedAttrMap;var f=t.Text;var c=t.Comment;var u=t.DOMParser;if(typeof o==="function"){var d=n.createElement("template");if(d.content&&d.content.ownerDocument){n=d.content.ownerDocument}}var m=n.implementation;var p=n.createNodeIterator;var h=n.getElementsByTagName;var v=n.createDocumentFragment;var g=a.importNode;var y={};r.isSupported=typeof m.createHTMLDocument!=="undefined"&&n.documentMode!==9;var b=function(e,t){var r=t.length;while(r--){if(typeof t[r]==="string"){t[r]=t[r].toLowerCase()}e[t[r]]=true}return e};var T=function(e){var t={};var r;for(r in e){if(e.hasOwnProperty(r)){t[r]=e[r]}}return t};var x=null;var k=b({},["a","abbr","acronym","address","area","article","aside","audio","b","bdi","bdo","big","blink","blockquote","body","br","button","canvas","caption","center","cite","code","col","colgroup","content","data","datalist","dd","decorator","del","details","dfn","dir","div","dl","dt","element","em","fieldset","figcaption","figure","font","footer","form","h1","h2","h3","h4","h5","h6","head","header","hgroup","hr","html","i","img","input","ins","kbd","label","legend","li","main","map","mark","marquee","menu","menuitem","meter","nav","nobr","ol","optgroup","option","output","p","pre","progress","q","rp","rt","ruby","s","samp","section","select","shadow","small","source","spacer","span","strike","strong","style","sub","summary","sup","table","tbody","td","template","textarea","tfoot","th","thead","time","tr","track","tt","u","ul","var","video","wbr","svg","altglyph","altglyphdef","altglyphitem","animatecolor","animatemotion","animatetransform","circle","clippath","defs","desc","ellipse","filter","font","g","glyph","glyphref","hkern","image","line","lineargradient","marker","mask","metadata","mpath","path","pattern","polygon","polyline","radialgradient","rect","stop","switch","symbol","text","textpath","title","tref","tspan","view","vkern","feBlend","feColorMatrix","feComponentTransfer","feComposite","feConvolveMatrix","feDiffuseLighting","feDisplacementMap","feFlood","feFuncA","feFuncB","feFuncG","feFuncR","feGaussianBlur","feMerge","feMergeNode","feMorphology","feOffset","feSpecularLighting","feTile","feTurbulence","math","menclose","merror","mfenced","mfrac","mglyph","mi","mlabeledtr","mmuliscripts","mn","mo","mover","mpadded","mphantom","mroot","mrow","ms","mpspace","msqrt","mystyle","msub","msup","msubsup","mtable","mtd","mtext","mtr","munder","munderover","#text"]);var A=null;var w=b({},["accept","action","align","alt","autocomplete","background","bgcolor","border","cellpadding","cellspacing","checked","cite","class","clear","color","cols","colspan","coords","datetime","default","dir","disabled","download","enctype","face","for","headers","height","hidden","high","href","hreflang","id","ismap","label","lang","list","loop","low","max","maxlength","media","method","min","multiple","name","noshade","novalidate","nowrap","open","optimum","pattern","placeholder","poster","preload","pubdate","radiogroup","readonly","rel","required","rev","reversed","rows","rowspan","spellcheck","scope","selected","shape","size","span","srclang","start","src","step","style","summary","tabindex","title","type","usemap","valign","value","width","xmlns","accent-height","accumulate","additivive","alignment-baseline","ascent","attributename","attributetype","azimuth","basefrequency","baseline-shift","begin","bias","by","clip","clip-path","clip-rule","color","color-interpolation","color-interpolation-filters","color-profile","color-rendering","cx","cy","d","dx","dy","diffuseconstant","direction","display","divisor","dur","edgemode","elevation","end","fill","fill-opacity","fill-rule","filter","flood-color","flood-opacity","font-family","font-size","font-size-adjust","font-stretch","font-style","font-variant","font-weight","fx","fy","g1","g2","glyph-name","glyphref","gradientunits","gradienttransform","image-rendering","in","in2","k","k1","k2","k3","k4","kerning","keypoints","keysplines","keytimes","lengthadjust","letter-spacing","kernelmatrix","kernelunitlength","lighting-color","local","marker-end","marker-mid","marker-start","markerheight","markerunits","markerwidth","maskcontentunits","maskunits","max","mask","mode","min","numoctaves","offset","operator","opacity","order","orient","orientation","origin","overflow","paint-order","path","pathlength","patterncontentunits","patterntransform","patternunits","points","preservealpha","r","rx","ry","radius","refx","refy","repeatcount","repeatdur","restart","result","rotate","scale","seed","shape-rendering","specularconstant","specularexponent","spreadmethod","stddeviation","stitchtiles","stop-color","stop-opacity","stroke-dasharray","stroke-dashoffset","stroke-linecap","stroke-linejoin","stroke-miterlimit","stroke-opacity","stroke","stroke-width","surfacescale","targetx","targety","transform","text-anchor","text-decoration","text-rendering","textlength","u1","u2","unicode","values","viewbox","visibility","vert-adv-y","vert-origin-x","vert-origin-y","word-spacing","wrap","writing-mode","xchannelselector","ychannelselector","x","x1","x2","y","y1","y2","z","zoomandpan","accent","accentunder","bevelled","close","columnsalign","columnlines","columnspan","denomalign","depth","display","displaystyle","fence","frame","largeop","length","linethickness","lspace","lquote","mathbackground","mathcolor","mathsize","mathvariant","maxsize","minsize","movablelimits","notation","numalign","open","rowalign","rowlines","rowspacing","rowspan","rspace","rquote","scriptlevel","scriptminsize","scriptsizemultiplier","selection","separator","separators","stretchy","subscriptshift","supscriptshift","symmetric","voffset","xlink:href","xml:id","xlink:title","xml:space","xmlns:xlink"]);var E=null;var S=null;var M=true;var O=false;var L=false;var D=false;var N=/\{\{[\s\S]*|[\s\S]*\}\}/gm;var _=/<%[\s\S]*|[\s\S]*%>/gm;var C=false;var z=false;var R=false;var F=false;var H=true;var B=true;var W=b({},["audio","head","math","script","style","svg","video"]);var j=b({},["audio","video","img","source"]);var G=b({},["alt","class","for","id","label","name","pattern","placeholder","summary","title","value","style","xmlns"]);var I=null;var q=n.createElement("form");var P=function(e){if(typeof e!=="object"){e={}}x="ALLOWED_TAGS"in e?b({},e.ALLOWED_TAGS):k;A="ALLOWED_ATTR"in e?b({},e.ALLOWED_ATTR):w;E="FORBID_TAGS"in e?b({},e.FORBID_TAGS):{};S="FORBID_ATTR"in e?b({},e.FORBID_ATTR):{};M=e.ALLOW_DATA_ATTR!==false;O=e.ALLOW_UNKNOWN_PROTOCOLS||false;L=e.SAFE_FOR_JQUERY||false;D=e.SAFE_FOR_TEMPLATES||false;C=e.WHOLE_DOCUMENT||false;z=e.RETURN_DOM||false;R=e.RETURN_DOM_FRAGMENT||false;F=e.RETURN_DOM_IMPORT||false;H=e.SANITIZE_DOM!==false;B=e.KEEP_CONTENT!==false;if(D){M=false}if(R){z=true}if(e.ADD_TAGS){if(x===k){x=T(x)}b(x,e.ADD_TAGS)}if(e.ADD_ATTR){if(A===w){A=T(A)}b(A,e.ADD_ATTR)}if(B){x["#text"]=true}if(Object&&"freeze"in Object){Object.freeze(e)}I=e};var U=function(e){try{e.parentNode.removeChild(e)}catch(t){e.outerHTML=""}};var V=function(e){var t,r;try{t=(new u).parseFromString(e,"text/html")}catch(n){}if(!t){t=m.createHTMLDocument("");r=t.body;r.parentNode.removeChild(r.parentNode.firstElementChild);r.outerHTML=e}if(typeof t.getElementsByTagName==="function"){return t.getElementsByTagName(C?"html":"body")[0]}return h.call(t,C?"html":"body")[0]};var K=function(e){return p.call(e.ownerDocument||e,e,l.SHOW_ELEMENT|l.SHOW_COMMENT|l.SHOW_TEXT,function(){return l.FILTER_ACCEPT},false)};var J=function(e){if(e instanceof f||e instanceof c){return false}if(typeof e.nodeName!=="string"||typeof e.textContent!=="string"||typeof e.removeChild!=="function"||!(e.attributes instanceof s)||typeof e.removeAttribute!=="function"||typeof e.setAttribute!=="function"){return true}return false};var Q=function(e){var t,r;re("beforeSanitizeElements",e,null);if(J(e)){U(e);return true}t=e.nodeName.toLowerCase();re("uponSanitizeElement",e,{tagName:t});if(!x[t]||E[t]){if(B&&!W[t]&&typeof e.insertAdjacentHTML==="function"){try{e.insertAdjacentHTML("AfterEnd",e.innerHTML)}catch(n){}}U(e);return true}if(L&&!e.firstElementChild&&(!e.content||!e.content.firstElementChild)){e.innerHTML=e.textContent.replace(/</g,"<")}if(D&&e.nodeType===3){r=e.textContent;r=r.replace(N," ");r=r.replace(_," ");e.textContent=r}re("afterSanitizeElements",e,null);return false};var X=/^data-[\w.\u00B7-\uFFFF-]/;var Y=/^(?:(?:(?:f|ht)tps?|mailto|tel):|[^a-z]|[a-z+.\-]+(?:[^a-z+.\-:]|$))/i;var Z=/^(?:\w+script|data):/i;var $=/[\x00-\x20\xA0\u1680\u180E\u2000-\u2029\u205f\u3000]/g;var ee=function(e){var r,a,i,o,l,s,f,c;re("beforeSanitizeAttributes",e,null);s=e.attributes;if(!s){return}f={attrName:"",attrValue:"",keepAttr:true};c=s.length;while(c--){r=s[c];a=r.name;i=r.value;o=a.toLowerCase();f.attrName=o;f.attrValue=i;f.keepAttr=true;re("uponSanitizeAttribute",e,f);i=f.attrValue;if(o==="name"&&e.nodeName==="IMG"&&s.id){l=s.id;s=Array.prototype.slice.apply(s);e.removeAttribute("id");e.removeAttribute(a);if(s.indexOf(l)>c){e.setAttribute("id",l.value)}}else{if(a==="id"){e.setAttribute(a,"")}e.removeAttribute(a)}if(!f.keepAttr){continue}if(H&&(o==="id"||o==="name")&&(i in t||i in n||i in q)){continue}if(D){i=i.replace(N," ");i=i.replace(_," ")}if(A[o]&&!S[o]&&(G[o]||Y.test(i.replace($,""))||o==="src"&&i.indexOf("data:")===0&&j[e.nodeName.toLowerCase()])||M&&X.test(o)||O&&!Z.test(i.replace($,""))){try{e.setAttribute(a,i)}catch(u){}}}re("afterSanitizeAttributes",e,null)};var te=function(e){var t;var r=K(e);re("beforeSanitizeShadowDOM",e,null);while(t=r.nextNode()){re("uponSanitizeShadowNode",t,null);if(Q(t)){continue}if(t.content instanceof i){te(t.content)}ee(t)}re("afterSanitizeShadowDOM",e,null)};var re=function(e,t,n){if(!y[e]){return}y[e].forEach(function(e){e.call(r,t,n,I)})};r.sanitize=function(e,n){var o,l,s,f,c;if(!e){e=""}if(typeof e!=="string"){if(typeof e.toString!=="function"){throw new TypeError("toString is not a function")}else{e=e.toString()}}if(!r.isSupported){if(typeof t.toStaticHTML==="object"||typeof t.toStaticHTML==="function"){return t.toStaticHTML(e)}return e}P(n);if(!z&&!C&&e.indexOf("<")===-1){return e}o=V(e);if(!o){return z?null:""}f=K(o);while(l=f.nextNode()){if(l.nodeType===3&&l===s){continue}if(Q(l)){continue}if(l.content instanceof i){te(l.content)}ee(l);s=l}if(z){if(R){c=v.call(o.ownerDocument);while(o.firstChild){c.appendChild(o.firstChild)}}else{c=o}if(F){c=g.call(a,c,true)}return c}return C?o.outerHTML:o.innerHTML};r.addHook=function(e,t){if(typeof t!=="function"){return}y[e]=y[e]||[];y[e].push(t)};r.removeHook=function(e){if(y[e]){y[e].pop()}};r.removeHooks=function(e){if(y[e]){y[e]=[]}};r.removeAllHooks=function(){y=[]};return r}); | 1 | +(function(e){"use strict";var t=typeof window==="undefined"?null:window;if(typeof define==="function"&&define.amd){define(function(){return e(t)})}else if(typeof module!=="undefined"){module.exports=e(t)}else{t.DOMPurify=e(t)}})(function e(t){"use strict";var r=function(t){return e(t)};r.version="0.7.4";if(!t||!t.document||t.document.nodeType!==9){r.isSupported=false;return r}var n=t.document;var a=n;var i=t.DocumentFragment;var o=t.HTMLTemplateElement;var l=t.NodeFilter;var s=t.NamedNodeMap||t.MozNamedAttrMap;var f=t.Text;var c=t.Comment;var u=t.DOMParser;if(typeof o==="function"){var d=n.createElement("template");if(d.content&&d.content.ownerDocument){n=d.content.ownerDocument}}var m=n.implementation;var p=n.createNodeIterator;var h=n.getElementsByTagName;var v=n.createDocumentFragment;var g=a.importNode;var y={};r.isSupported=typeof m.createHTMLDocument!=="undefined"&&n.documentMode!==9;var b=function(e,t){var r=t.length;while(r--){if(typeof t[r]==="string"){t[r]=t[r].toLowerCase()}e[t[r]]=true}return e};var T=function(e){var t={};var r;for(r in e){if(e.hasOwnProperty(r)){t[r]=e[r]}}return t};var x=null;var k=b({},["a","abbr","acronym","address","area","article","aside","audio","b","bdi","bdo","big","blink","blockquote","body","br","button","canvas","caption","center","cite","code","col","colgroup","content","data","datalist","dd","decorator","del","details","dfn","dir","div","dl","dt","element","em","fieldset","figcaption","figure","font","footer","form","h1","h2","h3","h4","h5","h6","head","header","hgroup","hr","html","i","img","input","ins","kbd","label","legend","li","main","map","mark","marquee","menu","menuitem","meter","nav","nobr","ol","optgroup","option","output","p","pre","progress","q","rp","rt","ruby","s","samp","section","select","shadow","small","source","spacer","span","strike","strong","style","sub","summary","sup","table","tbody","td","template","textarea","tfoot","th","thead","time","tr","track","tt","u","ul","var","video","wbr","svg","altglyph","altglyphdef","altglyphitem","animatecolor","animatemotion","animatetransform","circle","clippath","defs","desc","ellipse","filter","font","g","glyph","glyphref","hkern","image","line","lineargradient","marker","mask","metadata","mpath","path","pattern","polygon","polyline","radialgradient","rect","stop","switch","symbol","text","textpath","title","tref","tspan","view","vkern","feBlend","feColorMatrix","feComponentTransfer","feComposite","feConvolveMatrix","feDiffuseLighting","feDisplacementMap","feFlood","feFuncA","feFuncB","feFuncG","feFuncR","feGaussianBlur","feMerge","feMergeNode","feMorphology","feOffset","feSpecularLighting","feTile","feTurbulence","math","menclose","merror","mfenced","mfrac","mglyph","mi","mlabeledtr","mmuliscripts","mn","mo","mover","mpadded","mphantom","mroot","mrow","ms","mpspace","msqrt","mystyle","msub","msup","msubsup","mtable","mtd","mtext","mtr","munder","munderover","#text"]);var A=null;var w=b({},["accept","action","align","alt","autocomplete","background","bgcolor","border","cellpadding","cellspacing","checked","cite","class","clear","color","cols","colspan","coords","datetime","default","dir","disabled","download","enctype","face","for","headers","height","hidden","high","href","hreflang","id","ismap","label","lang","list","loop","low","max","maxlength","media","method","min","multiple","name","noshade","novalidate","nowrap","open","optimum","pattern","placeholder","poster","preload","pubdate","radiogroup","readonly","rel","required","rev","reversed","rows","rowspan","spellcheck","scope","selected","shape","size","span","srclang","start","src","step","style","summary","tabindex","title","type","usemap","valign","value","width","xmlns","accent-height","accumulate","additivive","alignment-baseline","ascent","attributename","attributetype","azimuth","basefrequency","baseline-shift","begin","bias","by","clip","clip-path","clip-rule","color","color-interpolation","color-interpolation-filters","color-profile","color-rendering","cx","cy","d","dx","dy","diffuseconstant","direction","display","divisor","dur","edgemode","elevation","end","fill","fill-opacity","fill-rule","filter","flood-color","flood-opacity","font-family","font-size","font-size-adjust","font-stretch","font-style","font-variant","font-weight","fx","fy","g1","g2","glyph-name","glyphref","gradientunits","gradienttransform","image-rendering","in","in2","k","k1","k2","k3","k4","kerning","keypoints","keysplines","keytimes","lengthadjust","letter-spacing","kernelmatrix","kernelunitlength","lighting-color","local","marker-end","marker-mid","marker-start","markerheight","markerunits","markerwidth","maskcontentunits","maskunits","max","mask","mode","min","numoctaves","offset","operator","opacity","order","orient","orientation","origin","overflow","paint-order","path","pathlength","patterncontentunits","patterntransform","patternunits","points","preservealpha","r","rx","ry","radius","refx","refy","repeatcount","repeatdur","restart","result","rotate","scale","seed","shape-rendering","specularconstant","specularexponent","spreadmethod","stddeviation","stitchtiles","stop-color","stop-opacity","stroke-dasharray","stroke-dashoffset","stroke-linecap","stroke-linejoin","stroke-miterlimit","stroke-opacity","stroke","stroke-width","surfacescale","targetx","targety","transform","text-anchor","text-decoration","text-rendering","textlength","u1","u2","unicode","values","viewbox","visibility","vert-adv-y","vert-origin-x","vert-origin-y","word-spacing","wrap","writing-mode","xchannelselector","ychannelselector","x","x1","x2","y","y1","y2","z","zoomandpan","accent","accentunder","bevelled","close","columnsalign","columnlines","columnspan","denomalign","depth","display","displaystyle","fence","frame","largeop","length","linethickness","lspace","lquote","mathbackground","mathcolor","mathsize","mathvariant","maxsize","minsize","movablelimits","notation","numalign","open","rowalign","rowlines","rowspacing","rowspan","rspace","rquote","scriptlevel","scriptminsize","scriptsizemultiplier","selection","separator","separators","stretchy","subscriptshift","supscriptshift","symmetric","voffset","xlink:href","xml:id","xlink:title","xml:space","xmlns:xlink"]);var E=null;var S=null;var M=true;var O=false;var L=false;var D=false;var N=/\{\{[\s\S]*|[\s\S]*\}\}/gm;var _=/<%[\s\S]*|[\s\S]*%>/gm;var C=false;var z=false;var R=false;var F=false;var H=true;var B=true;var W=b({},["audio","head","math","script","style","svg","video"]);var j=b({},["audio","video","img","source"]);var G=b({},["alt","class","for","id","label","name","pattern","placeholder","summary","title","value","style","xmlns"]);var I=null;var q=n.createElement("form");var P=function(e){if(typeof e!=="object"){e={}}x="ALLOWED_TAGS"in e?b({},e.ALLOWED_TAGS):k;A="ALLOWED_ATTR"in e?b({},e.ALLOWED_ATTR):w;E="FORBID_TAGS"in e?b({},e.FORBID_TAGS):{};S="FORBID_ATTR"in e?b({},e.FORBID_ATTR):{};M=e.ALLOW_DATA_ATTR!==false;O=e.ALLOW_UNKNOWN_PROTOCOLS||false;L=e.SAFE_FOR_JQUERY||false;D=e.SAFE_FOR_TEMPLATES||false;C=e.WHOLE_DOCUMENT||false;z=e.RETURN_DOM||false;R=e.RETURN_DOM_FRAGMENT||false;F=e.RETURN_DOM_IMPORT||false;H=e.SANITIZE_DOM!==false;B=e.KEEP_CONTENT!==false;if(D){M=false}if(R){z=true}if(e.ADD_TAGS){if(x===k){x=T(x)}b(x,e.ADD_TAGS)}if(e.ADD_ATTR){if(A===w){A=T(A)}b(A,e.ADD_ATTR)}if(B){x["#text"]=true}if(Object&&"freeze"in Object){Object.freeze(e)}I=e};var U=function(e){try{e.parentNode.removeChild(e)}catch(t){e.outerHTML=""}};var V=function(e){var t,r;try{t=(new u).parseFromString(e,"text/html")}catch(n){}if(!t){t=m.createHTMLDocument("");r=t.body;r.parentNode.removeChild(r.parentNode.firstElementChild);r.outerHTML=e}if(typeof t.getElementsByTagName==="function"){return t.getElementsByTagName(C?"html":"body")[0]}return h.call(t,C?"html":"body")[0]};var K=function(e){return p.call(e.ownerDocument||e,e,l.SHOW_ELEMENT|l.SHOW_COMMENT|l.SHOW_TEXT,function(){return l.FILTER_ACCEPT},false)};var J=function(e){if(e instanceof f||e instanceof c){return false}if(typeof e.nodeName!=="string"||typeof e.textContent!=="string"||typeof e.removeChild!=="function"||!(e.attributes instanceof s)||typeof e.removeAttribute!=="function"||typeof e.setAttribute!=="function"){return true}return false};var Q=function(e){var t,r;re("beforeSanitizeElements",e,null);if(J(e)){U(e);return true}t=e.nodeName.toLowerCase();re("uponSanitizeElement",e,{tagName:t});if(!x[t]||E[t]){if(B&&!W[t]&&typeof e.insertAdjacentHTML==="function"){try{e.insertAdjacentHTML("AfterEnd",e.innerHTML)}catch(n){}}U(e);return true}if(L&&!e.firstElementChild&&(!e.content||!e.content.firstElementChild)){e.innerHTML=e.textContent.replace(/</g,"<")}if(D&&e.nodeType===3){r=e.textContent;r=r.replace(N," ");r=r.replace(_," ");e.textContent=r}re("afterSanitizeElements",e,null);return false};var X=/^data-[\w.\u00B7-\uFFFF-]/;var Y=/^(?:(?:(?:f|ht)tps?|mailto|tel):|[^a-z]|[a-z+.\-]+(?:[^a-z+.\-:]|$))/i;var Z=/^(?:\w+script|data):/i;var $=/[\x00-\x20\xA0\u1680\u180E\u2000-\u2029\u205f\u3000]/g;var ee=function(e){var r,a,i,o,l,s,f,c;re("beforeSanitizeAttributes",e,null);s=e.attributes;if(!s){return}f={attrName:"",attrValue:"",keepAttr:true};c=s.length;while(c--){r=s[c];a=r.name;i=r.value;o=a.toLowerCase();f.attrName=o;f.attrValue=i;f.keepAttr=true;re("uponSanitizeAttribute",e,f);i=f.attrValue;if(o==="name"&&e.nodeName==="IMG"&&s.id){l=s.id;s=Array.prototype.slice.apply(s);e.removeAttribute("id");e.removeAttribute(a);if(s.indexOf(l)>c){e.setAttribute("id",l.value)}}else{if(a==="id"){e.setAttribute(a,"")}e.removeAttribute(a)}if(!f.keepAttr){continue}if(H&&(o==="id"||o==="name")&&(i in t||i in n||i in q)){continue}if(D){i=i.replace(N," ");i=i.replace(_," ")}if(A[o]&&!S[o]&&(G[o]||Y.test(i.replace($,""))||o==="src"&&i.indexOf("data:")===0&&j[e.nodeName.toLowerCase()])||M&&X.test(o)||O&&!Z.test(i.replace($,""))){try{e.setAttribute(a,i)}catch(u){}}}re("afterSanitizeAttributes",e,null)};var te=function(e){var t;var r=K(e);re("beforeSanitizeShadowDOM",e,null);while(t=r.nextNode()){re("uponSanitizeShadowNode",t,null);if(Q(t)){continue}if(t.content instanceof i){te(t.content)}ee(t)}re("afterSanitizeShadowDOM",e,null)};var re=function(e,t,n){if(!y[e]){return}y[e].forEach(function(e){e.call(r,t,n,I)})};r.sanitize=function(e,n){var o,l,s,f,c;if(!e){e=""}if(typeof e!=="string"){if(typeof e.toString!=="function"){throw new TypeError("toString is not a function")}else{e=e.toString()}}if(!r.isSupported){if(typeof t.toStaticHTML==="object"||typeof t.toStaticHTML==="function"){return t.toStaticHTML(e)}return e}P(n);if(!z&&!C&&e.indexOf("<")===-1){return e}o=V(e);if(!o){return z?null:""}f=K(o);while(l=f.nextNode()){if(l.nodeType===3&&l===s){continue}if(Q(l)){continue}if(l.content instanceof i){te(l.content)}ee(l);s=l}if(z){if(R){c=v.call(o.ownerDocument);while(o.firstChild){c.appendChild(o.firstChild)}}else{c=o}if(F){c=g.call(a,c,true)}return c}return C?o.outerHTML:o.innerHTML};r.addHook=function(e,t){if(typeof t!=="function"){return}y[e]=y[e]||[];y[e].push(t)};r.removeHook=function(e){if(y[e]){y[e].pop()}};r.removeHooks=function(e){if(y[e]){y[e]=[]}};r.removeAllHooks=function(){y=[]};return r}); |
| 2 | //# sourceMappingURL=./dist/purify.min.js.map | 2 | //# sourceMappingURL=./dist/purify.min.js.map |
| 3 | \ No newline at end of file | 3 | \ No newline at end of file |
src/main/resources/static/assets/plugins/fileinput/sortable.min.js
| 1 | -/*! Sortable 1.4.2 - MIT | git://github.com/rubaxa/Sortable.git */ | 1 | +/*! Sortable 1.4.2 - MIT | git://github.com/rubaxa/Sortable.git */ |
| 2 | !function(t){"use strict";"function"==typeof define&&define.amd?define(t):"undefined"!=typeof module&&"undefined"!=typeof module.exports?module.exports=t():"undefined"!=typeof Package?KvSortable=t():window.KvSortable=t()}(function(){"use strict";function t(t,e){if(!t||!t.nodeType||1!==t.nodeType)throw"KvSortable: `el` must be HTMLElement, and not "+{}.toString.call(t);this.el=t,this.options=e=b({},e),t[j]=this;var n={group:Math.random(),sort:!0,disabled:!1,store:null,handle:null,scroll:!0,scrollSensitivity:30,scrollSpeed:10,draggable:/[uo]l/i.test(t.nodeName)?"li":">*",ghostClass:"kvsortable-ghost",chosenClass:"kvsortable-chosen",ignore:"a, img",filter:null,animation:0,setData:function(t,e){t.setData("Text",e.textContent)},dropBubble:!1,dragoverBubble:!1,dataIdAttr:"data-id",delay:0,forceFallback:!1,fallbackClass:"kvsortable-fallback",fallbackOnBody:!1};for(var i in n)!(i in e)&&(e[i]=n[i]);z(e);for(var r in this)"_"===r.charAt(0)&&(this[r]=this[r].bind(this));this.nativeDraggable=e.forceFallback?!1:P,o(t,"mousedown",this._onTapStart),o(t,"touchstart",this._onTapStart),this.nativeDraggable&&(o(t,"dragover",this),o(t,"dragenter",this)),q.push(this._onDragOver),e.store&&this.sort(e.store.get(this))}function e(t){w&&w.state!==t&&(s(w,"display",t?"none":""),!t&&w.state&&S.insertBefore(w,_),w.state=t)}function n(t,e,n){if(t){n=n||U;do if(">*"===e&&t.parentNode===n||v(t,e))return t;while(t!==n&&(t=t.parentNode))}return null}function i(t){t.dataTransfer&&(t.dataTransfer.dropEffect="move"),t.preventDefault()}function o(t,e,n){t.addEventListener(e,n,!1)}function r(t,e,n){t.removeEventListener(e,n,!1)}function a(t,e,n){if(t)if(t.classList)t.classList[n?"add":"remove"](e);else{var i=(" "+t.className+" ").replace(M," ").replace(" "+e+" "," ");t.className=(i+(n?" "+e:"")).replace(M," ")}}function s(t,e,n){var i=t&&t.style;if(i){if(void 0===n)return U.defaultView&&U.defaultView.getComputedStyle?n=U.defaultView.getComputedStyle(t,""):t.currentStyle&&(n=t.currentStyle),void 0===e?n:n[e];e in i||(e="-webkit-"+e),i[e]=n+("string"==typeof n?"":"px")}}function l(t,e,n){if(t){var i=t.getElementsByTagName(e),o=0,r=i.length;if(n)for(;r>o;o++)n(i[o],o);return i}return[]}function d(t,e,n,i,o,r,a){var s=U.createEvent("Event"),l=(t||e[j]).options,d="on"+n.charAt(0).toUpperCase()+n.substr(1);s.initEvent(n,!0,!0),s.to=e,s.from=o||e,s.item=i||e,s.clone=w,s.oldIndex=r,s.newIndex=a,e.dispatchEvent(s),l[d]&&l[d].call(t,s)}function c(t,e,n,i,o,r){var a,s,l=t[j],d=l.options.onMove;return a=U.createEvent("Event"),a.initEvent("move",!0,!0),a.to=e,a.from=t,a.dragged=n,a.draggedRect=i,a.related=o||e,a.relatedRect=r||e.getBoundingClientRect(),t.dispatchEvent(a),d&&(s=d.call(l,a)),s}function u(t){t.draggable=!1}function h(){K=!1}function f(t,e){var n=t.lastElementChild,i=n.getBoundingClientRect();return(e.clientY-(i.top+i.height)>5||e.clientX-(i.right+i.width)>5)&&n}function p(t){for(var e=t.tagName+t.className+t.src+t.href+t.textContent,n=e.length,i=0;n--;)i+=e.charCodeAt(n);return i.toString(36)}function g(t,e){var n=0;if(!t||!t.parentNode)return-1;for(;t&&(t=t.previousElementSibling);)"TEMPLATE"!==t.nodeName.toUpperCase()&&v(t,e)&&n++;return n}function v(t,e){if(t){e=e.split(".");var n=e.shift().toUpperCase(),i=new RegExp("\\s("+e.join("|")+")(?=\\s)","g");return!(""!==n&&t.nodeName.toUpperCase()!=n||e.length&&((" "+t.className+" ").match(i)||[]).length!=e.length)}return!1}function m(t,e){var n,i;return function(){void 0===n&&(n=arguments,i=this,setTimeout(function(){1===n.length?t.call(i,n[0]):t.apply(i,n),n=void 0},e))}}function b(t,e){if(t&&e)for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n]);return t}if("undefined"==typeof window||"undefined"==typeof window.document)return function(){throw new Error("sortable.js requires a window with a document")};var _,D,y,w,S,T,C,E,x,N,B,k,O,X,Y,A,I,R={},M=/\s+/g,j="KvSortable"+(new Date).getTime(),L=window,U=L.document,H=L.parseInt,P=!!("draggable"in U.createElement("div")),W=function(t){return t=U.createElement("x"),t.style.cssText="pointer-events:auto","auto"===t.style.pointerEvents}(),K=!1,F=Math.abs,q=([].slice,[]),V=m(function(t,e,n){if(n&&e.scroll){var i,o,r,a,s=e.scrollSensitivity,l=e.scrollSpeed,d=t.clientX,c=t.clientY,u=window.innerWidth,h=window.innerHeight;if(E!==n&&(C=e.scroll,E=n,C===!0)){C=n;do if(C.offsetWidth<C.scrollWidth||C.offsetHeight<C.scrollHeight)break;while(C=C.parentNode)}C&&(i=C,o=C.getBoundingClientRect(),r=(F(o.right-d)<=s)-(F(o.left-d)<=s),a=(F(o.bottom-c)<=s)-(F(o.top-c)<=s)),r||a||(r=(s>=u-d)-(s>=d),a=(s>=h-c)-(s>=c),(r||a)&&(i=L)),(R.vx!==r||R.vy!==a||R.el!==i)&&(R.el=i,R.vx=r,R.vy=a,clearInterval(R.pid),i&&(R.pid=setInterval(function(){i===L?L.scrollTo(L.pageXOffset+r*l,L.pageYOffset+a*l):(a&&(i.scrollTop+=a*l),r&&(i.scrollLeft+=r*l))},24)))}},30),z=function(t){var e=t.group;e&&"object"==typeof e||(e=t.group={name:e}),["pull","put"].forEach(function(t){t in e||(e[t]=!0)}),t.groups=" "+e.name+(e.put.join?" "+e.put.join(" "):"")+" "};return t.prototype={constructor:t,_onTapStart:function(t){var e=this,i=this.el,o=this.options,r=t.type,a=t.touches&&t.touches[0],s=(a||t).target,l=s,c=o.filter;if(!("mousedown"===r&&0!==t.button||o.disabled)&&(s=n(s,o.draggable,i))){if(k=g(s,o.draggable),"function"==typeof c){if(c.call(this,t,s,this))return d(e,l,"filter",s,i,k),void t.preventDefault()}else if(c&&(c=c.split(",").some(function(t){return t=n(l,t.trim(),i),t?(d(e,t,"filter",s,i,k),!0):void 0})))return void t.preventDefault();(!o.handle||n(l,o.handle,i))&&this._prepareDragStart(t,a,s)}},_prepareDragStart:function(t,e,n){var i,r=this,s=r.el,d=r.options,c=s.ownerDocument;n&&!_&&n.parentNode===s&&(Y=t,S=s,_=n,D=_.parentNode,T=_.nextSibling,X=d.group,i=function(){r._disableDelayedDrag(),_.draggable=!0,a(_,r.options.chosenClass,!0),r._triggerDragStart(e)},d.ignore.split(",").forEach(function(t){l(_,t.trim(),u)}),o(c,"mouseup",r._onDrop),o(c,"touchend",r._onDrop),o(c,"touchcancel",r._onDrop),d.delay?(o(c,"mouseup",r._disableDelayedDrag),o(c,"touchend",r._disableDelayedDrag),o(c,"touchcancel",r._disableDelayedDrag),o(c,"mousemove",r._disableDelayedDrag),o(c,"touchmove",r._disableDelayedDrag),r._dragStartTimer=setTimeout(i,d.delay)):i())},_disableDelayedDrag:function(){var t=this.el.ownerDocument;clearTimeout(this._dragStartTimer),r(t,"mouseup",this._disableDelayedDrag),r(t,"touchend",this._disableDelayedDrag),r(t,"touchcancel",this._disableDelayedDrag),r(t,"mousemove",this._disableDelayedDrag),r(t,"touchmove",this._disableDelayedDrag)},_triggerDragStart:function(t){t?(Y={target:_,clientX:t.clientX,clientY:t.clientY},this._onDragStart(Y,"touch")):this.nativeDraggable?(o(_,"dragend",this),o(S,"dragstart",this._onDragStart)):this._onDragStart(Y,!0);try{U.selection?U.selection.empty():window.getSelection().removeAllRanges()}catch(e){}},_dragStarted:function(){S&&_&&(a(_,this.options.ghostClass,!0),t.active=this,d(this,S,"start",_,S,k))},_emulateDragOver:function(){if(A){if(this._lastX===A.clientX&&this._lastY===A.clientY)return;this._lastX=A.clientX,this._lastY=A.clientY,W||s(y,"display","none");var t=U.elementFromPoint(A.clientX,A.clientY),e=t,n=" "+this.options.group.name,i=q.length;if(e)do{if(e[j]&&e[j].options.groups.indexOf(n)>-1){for(;i--;)q[i]({clientX:A.clientX,clientY:A.clientY,target:t,rootEl:e});break}t=e}while(e=e.parentNode);W||s(y,"display","")}},_onTouchMove:function(e){if(Y){t.active||this._dragStarted(),this._appendGhost();var n=e.touches?e.touches[0]:e,i=n.clientX-Y.clientX,o=n.clientY-Y.clientY,r=e.touches?"translate3d("+i+"px,"+o+"px,0)":"translate("+i+"px,"+o+"px)";I=!0,A=n,s(y,"webkitTransform",r),s(y,"mozTransform",r),s(y,"msTransform",r),s(y,"transform",r),e.preventDefault()}},_appendGhost:function(){if(!y){var t,e=_.getBoundingClientRect(),n=s(_),i=this.options;y=_.cloneNode(!0),a(y,i.ghostClass,!1),a(y,i.fallbackClass,!0),s(y,"top",e.top-H(n.marginTop,10)),s(y,"left",e.left-H(n.marginLeft,10)),s(y,"width",e.width),s(y,"height",e.height),s(y,"opacity","0.8"),s(y,"position","fixed"),s(y,"zIndex","100000"),s(y,"pointerEvents","none"),i.fallbackOnBody&&U.body.appendChild(y)||S.appendChild(y),t=y.getBoundingClientRect(),s(y,"width",2*e.width-t.width),s(y,"height",2*e.height-t.height)}},_onDragStart:function(t,e){var n=t.dataTransfer,i=this.options;this._offUpEvents(),"clone"==X.pull&&(w=_.cloneNode(!0),s(w,"display","none"),S.insertBefore(w,_)),e?("touch"===e?(o(U,"touchmove",this._onTouchMove),o(U,"touchend",this._onDrop),o(U,"touchcancel",this._onDrop)):(o(U,"mousemove",this._onTouchMove),o(U,"mouseup",this._onDrop)),this._loopId=setInterval(this._emulateDragOver,50)):(n&&(n.effectAllowed="move",i.setData&&i.setData.call(this,n,_)),o(U,"drop",this),setTimeout(this._dragStarted,0))},_onDragOver:function(t){var i,o,r,a=this.el,l=this.options,d=l.group,u=d.put,p=X===d,g=l.sort;if(void 0!==t.preventDefault&&(t.preventDefault(),!l.dragoverBubble&&t.stopPropagation()),I=!0,X&&!l.disabled&&(p?g||(r=!S.contains(_)):X.pull&&u&&(X.name===d.name||u.indexOf&&~u.indexOf(X.name)))&&(void 0===t.rootEl||t.rootEl===this.el)){if(V(t,l,this.el),K)return;if(i=n(t.target,l.draggable,a),o=_.getBoundingClientRect(),r)return e(!0),void(w||T?S.insertBefore(_,w||T):g||S.appendChild(_));if(0===a.children.length||a.children[0]===y||a===t.target&&(i=f(a,t))){if(i){if(i.animated)return;m=i.getBoundingClientRect()}e(p),c(S,a,_,o,i,m)!==!1&&(_.contains(a)||(a.appendChild(_),D=a),this._animate(o,_),i&&this._animate(m,i))}else if(i&&!i.animated&&i!==_&&void 0!==i.parentNode[j]){x!==i&&(x=i,N=s(i),B=s(i.parentNode));var v,m=i.getBoundingClientRect(),b=m.right-m.left,C=m.bottom-m.top,E=/left|right|inline/.test(N.cssFloat+N.display)||"flex"==B.display&&0===B["flex-direction"].indexOf("row"),k=i.offsetWidth>_.offsetWidth,O=i.offsetHeight>_.offsetHeight,Y=(E?(t.clientX-m.left)/b:(t.clientY-m.top)/C)>.5,A=i.nextElementSibling,R=c(S,a,_,o,i,m);if(R!==!1){if(K=!0,setTimeout(h,30),e(p),1===R||-1===R)v=1===R;else if(E){var M=_.offsetTop,L=i.offsetTop;v=M===L?i.previousElementSibling===_&&!k||Y&&k:L>M}else v=A!==_&&!O||Y&&O;_.contains(a)||(v&&!A?a.appendChild(_):i.parentNode.insertBefore(_,v?A:i)),D=_.parentNode,this._animate(o,_),this._animate(m,i)}}}},_animate:function(t,e){var n=this.options.animation;if(n){var i=e.getBoundingClientRect();s(e,"transition","none"),s(e,"transform","translate3d("+(t.left-i.left)+"px,"+(t.top-i.top)+"px,0)"),e.offsetWidth,s(e,"transition","all "+n+"ms"),s(e,"transform","translate3d(0,0,0)"),clearTimeout(e.animated),e.animated=setTimeout(function(){s(e,"transition",""),s(e,"transform",""),e.animated=!1},n)}},_offUpEvents:function(){var t=this.el.ownerDocument;r(U,"touchmove",this._onTouchMove),r(t,"mouseup",this._onDrop),r(t,"touchend",this._onDrop),r(t,"touchcancel",this._onDrop)},_onDrop:function(e){var n=this.el,i=this.options;clearInterval(this._loopId),clearInterval(R.pid),clearTimeout(this._dragStartTimer),r(U,"mousemove",this._onTouchMove),this.nativeDraggable&&(r(U,"drop",this),r(n,"dragstart",this._onDragStart)),this._offUpEvents(),e&&(I&&(e.preventDefault(),!i.dropBubble&&e.stopPropagation()),y&&y.parentNode.removeChild(y),_&&(this.nativeDraggable&&r(_,"dragend",this),u(_),a(_,this.options.ghostClass,!1),a(_,this.options.chosenClass,!1),S!==D?(O=g(_,i.draggable),O>=0&&(d(null,D,"sort",_,S,k,O),d(this,S,"sort",_,S,k,O),d(null,D,"add",_,S,k,O),d(this,S,"remove",_,S,k,O))):(w&&w.parentNode.removeChild(w),_.nextSibling!==T&&(O=g(_,i.draggable),O>=0&&(d(this,S,"update",_,S,k,O),d(this,S,"sort",_,S,k,O)))),t.active&&((null===O||-1===O)&&(O=k),d(this,S,"end",_,S,k,O),this.save()))),this._nulling()},_nulling:function(){S=_=D=y=T=w=C=E=Y=A=I=O=x=N=X=t.active=null},handleEvent:function(t){var e=t.type;"dragover"===e||"dragenter"===e?_&&(this._onDragOver(t),i(t)):("drop"===e||"dragend"===e)&&this._onDrop(t)},toArray:function(){for(var t,e=[],i=this.el.children,o=0,r=i.length,a=this.options;r>o;o++)t=i[o],n(t,a.draggable,this.el)&&e.push(t.getAttribute(a.dataIdAttr)||p(t));return e},sort:function(t){var e={},i=this.el;this.toArray().forEach(function(t,o){var r=i.children[o];n(r,this.options.draggable,i)&&(e[t]=r)},this),t.forEach(function(t){e[t]&&(i.removeChild(e[t]),i.appendChild(e[t]))})},save:function(){var t=this.options.store;t&&t.set(this)},closest:function(t,e){return n(t,e||this.options.draggable,this.el)},option:function(t,e){var n=this.options;return void 0===e?n[t]:(n[t]=e,void("group"===t&&z(n)))},destroy:function(){var t=this.el;t[j]=null,r(t,"mousedown",this._onTapStart),r(t,"touchstart",this._onTapStart),this.nativeDraggable&&(r(t,"dragover",this),r(t,"dragenter",this)),Array.prototype.forEach.call(t.querySelectorAll("[draggable]"),function(t){t.removeAttribute("draggable")}),q.splice(q.indexOf(this._onDragOver),1),this._onDrop(),this.el=t=null}},t.utils={on:o,off:r,css:s,find:l,is:function(t,e){return!!n(t,e,t)},extend:b,throttle:m,closest:n,toggleClass:a,index:g},t.create=function(e,n){return new t(e,n)},t.version="1.4.2",t}),function(t){"use strict";"function"==typeof define&&define.amd?define(["jquery"],t):t(jQuery)}(function(t){"use strict";t.fn.kvsortable=function(e){var n,i=arguments;return this.each(function(){var o=t(this),r=o.data("kvsortable");if(r||!(e instanceof Object)&&e||(r=new KvSortable(this,e),o.data("kvsortable",r)),r){if("widget"===e)return r;"destroy"===e?(r.destroy(),o.removeData("kvsortable")):"function"==typeof r[e]?n=r[e].apply(r,[].slice.call(i,1)):e in r.options&&(n=r.option.apply(r,i))}}),void 0===n?this:n}}); | 2 | !function(t){"use strict";"function"==typeof define&&define.amd?define(t):"undefined"!=typeof module&&"undefined"!=typeof module.exports?module.exports=t():"undefined"!=typeof Package?KvSortable=t():window.KvSortable=t()}(function(){"use strict";function t(t,e){if(!t||!t.nodeType||1!==t.nodeType)throw"KvSortable: `el` must be HTMLElement, and not "+{}.toString.call(t);this.el=t,this.options=e=b({},e),t[j]=this;var n={group:Math.random(),sort:!0,disabled:!1,store:null,handle:null,scroll:!0,scrollSensitivity:30,scrollSpeed:10,draggable:/[uo]l/i.test(t.nodeName)?"li":">*",ghostClass:"kvsortable-ghost",chosenClass:"kvsortable-chosen",ignore:"a, img",filter:null,animation:0,setData:function(t,e){t.setData("Text",e.textContent)},dropBubble:!1,dragoverBubble:!1,dataIdAttr:"data-id",delay:0,forceFallback:!1,fallbackClass:"kvsortable-fallback",fallbackOnBody:!1};for(var i in n)!(i in e)&&(e[i]=n[i]);z(e);for(var r in this)"_"===r.charAt(0)&&(this[r]=this[r].bind(this));this.nativeDraggable=e.forceFallback?!1:P,o(t,"mousedown",this._onTapStart),o(t,"touchstart",this._onTapStart),this.nativeDraggable&&(o(t,"dragover",this),o(t,"dragenter",this)),q.push(this._onDragOver),e.store&&this.sort(e.store.get(this))}function e(t){w&&w.state!==t&&(s(w,"display",t?"none":""),!t&&w.state&&S.insertBefore(w,_),w.state=t)}function n(t,e,n){if(t){n=n||U;do if(">*"===e&&t.parentNode===n||v(t,e))return t;while(t!==n&&(t=t.parentNode))}return null}function i(t){t.dataTransfer&&(t.dataTransfer.dropEffect="move"),t.preventDefault()}function o(t,e,n){t.addEventListener(e,n,!1)}function r(t,e,n){t.removeEventListener(e,n,!1)}function a(t,e,n){if(t)if(t.classList)t.classList[n?"add":"remove"](e);else{var i=(" "+t.className+" ").replace(M," ").replace(" "+e+" "," ");t.className=(i+(n?" "+e:"")).replace(M," ")}}function s(t,e,n){var i=t&&t.style;if(i){if(void 0===n)return U.defaultView&&U.defaultView.getComputedStyle?n=U.defaultView.getComputedStyle(t,""):t.currentStyle&&(n=t.currentStyle),void 0===e?n:n[e];e in i||(e="-webkit-"+e),i[e]=n+("string"==typeof n?"":"px")}}function l(t,e,n){if(t){var i=t.getElementsByTagName(e),o=0,r=i.length;if(n)for(;r>o;o++)n(i[o],o);return i}return[]}function d(t,e,n,i,o,r,a){var s=U.createEvent("Event"),l=(t||e[j]).options,d="on"+n.charAt(0).toUpperCase()+n.substr(1);s.initEvent(n,!0,!0),s.to=e,s.from=o||e,s.item=i||e,s.clone=w,s.oldIndex=r,s.newIndex=a,e.dispatchEvent(s),l[d]&&l[d].call(t,s)}function c(t,e,n,i,o,r){var a,s,l=t[j],d=l.options.onMove;return a=U.createEvent("Event"),a.initEvent("move",!0,!0),a.to=e,a.from=t,a.dragged=n,a.draggedRect=i,a.related=o||e,a.relatedRect=r||e.getBoundingClientRect(),t.dispatchEvent(a),d&&(s=d.call(l,a)),s}function u(t){t.draggable=!1}function h(){K=!1}function f(t,e){var n=t.lastElementChild,i=n.getBoundingClientRect();return(e.clientY-(i.top+i.height)>5||e.clientX-(i.right+i.width)>5)&&n}function p(t){for(var e=t.tagName+t.className+t.src+t.href+t.textContent,n=e.length,i=0;n--;)i+=e.charCodeAt(n);return i.toString(36)}function g(t,e){var n=0;if(!t||!t.parentNode)return-1;for(;t&&(t=t.previousElementSibling);)"TEMPLATE"!==t.nodeName.toUpperCase()&&v(t,e)&&n++;return n}function v(t,e){if(t){e=e.split(".");var n=e.shift().toUpperCase(),i=new RegExp("\\s("+e.join("|")+")(?=\\s)","g");return!(""!==n&&t.nodeName.toUpperCase()!=n||e.length&&((" "+t.className+" ").match(i)||[]).length!=e.length)}return!1}function m(t,e){var n,i;return function(){void 0===n&&(n=arguments,i=this,setTimeout(function(){1===n.length?t.call(i,n[0]):t.apply(i,n),n=void 0},e))}}function b(t,e){if(t&&e)for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n]);return t}if("undefined"==typeof window||"undefined"==typeof window.document)return function(){throw new Error("sortable.js requires a window with a document")};var _,D,y,w,S,T,C,E,x,N,B,k,O,X,Y,A,I,R={},M=/\s+/g,j="KvSortable"+(new Date).getTime(),L=window,U=L.document,H=L.parseInt,P=!!("draggable"in U.createElement("div")),W=function(t){return t=U.createElement("x"),t.style.cssText="pointer-events:auto","auto"===t.style.pointerEvents}(),K=!1,F=Math.abs,q=([].slice,[]),V=m(function(t,e,n){if(n&&e.scroll){var i,o,r,a,s=e.scrollSensitivity,l=e.scrollSpeed,d=t.clientX,c=t.clientY,u=window.innerWidth,h=window.innerHeight;if(E!==n&&(C=e.scroll,E=n,C===!0)){C=n;do if(C.offsetWidth<C.scrollWidth||C.offsetHeight<C.scrollHeight)break;while(C=C.parentNode)}C&&(i=C,o=C.getBoundingClientRect(),r=(F(o.right-d)<=s)-(F(o.left-d)<=s),a=(F(o.bottom-c)<=s)-(F(o.top-c)<=s)),r||a||(r=(s>=u-d)-(s>=d),a=(s>=h-c)-(s>=c),(r||a)&&(i=L)),(R.vx!==r||R.vy!==a||R.el!==i)&&(R.el=i,R.vx=r,R.vy=a,clearInterval(R.pid),i&&(R.pid=setInterval(function(){i===L?L.scrollTo(L.pageXOffset+r*l,L.pageYOffset+a*l):(a&&(i.scrollTop+=a*l),r&&(i.scrollLeft+=r*l))},24)))}},30),z=function(t){var e=t.group;e&&"object"==typeof e||(e=t.group={name:e}),["pull","put"].forEach(function(t){t in e||(e[t]=!0)}),t.groups=" "+e.name+(e.put.join?" "+e.put.join(" "):"")+" "};return t.prototype={constructor:t,_onTapStart:function(t){var e=this,i=this.el,o=this.options,r=t.type,a=t.touches&&t.touches[0],s=(a||t).target,l=s,c=o.filter;if(!("mousedown"===r&&0!==t.button||o.disabled)&&(s=n(s,o.draggable,i))){if(k=g(s,o.draggable),"function"==typeof c){if(c.call(this,t,s,this))return d(e,l,"filter",s,i,k),void t.preventDefault()}else if(c&&(c=c.split(",").some(function(t){return t=n(l,t.trim(),i),t?(d(e,t,"filter",s,i,k),!0):void 0})))return void t.preventDefault();(!o.handle||n(l,o.handle,i))&&this._prepareDragStart(t,a,s)}},_prepareDragStart:function(t,e,n){var i,r=this,s=r.el,d=r.options,c=s.ownerDocument;n&&!_&&n.parentNode===s&&(Y=t,S=s,_=n,D=_.parentNode,T=_.nextSibling,X=d.group,i=function(){r._disableDelayedDrag(),_.draggable=!0,a(_,r.options.chosenClass,!0),r._triggerDragStart(e)},d.ignore.split(",").forEach(function(t){l(_,t.trim(),u)}),o(c,"mouseup",r._onDrop),o(c,"touchend",r._onDrop),o(c,"touchcancel",r._onDrop),d.delay?(o(c,"mouseup",r._disableDelayedDrag),o(c,"touchend",r._disableDelayedDrag),o(c,"touchcancel",r._disableDelayedDrag),o(c,"mousemove",r._disableDelayedDrag),o(c,"touchmove",r._disableDelayedDrag),r._dragStartTimer=setTimeout(i,d.delay)):i())},_disableDelayedDrag:function(){var t=this.el.ownerDocument;clearTimeout(this._dragStartTimer),r(t,"mouseup",this._disableDelayedDrag),r(t,"touchend",this._disableDelayedDrag),r(t,"touchcancel",this._disableDelayedDrag),r(t,"mousemove",this._disableDelayedDrag),r(t,"touchmove",this._disableDelayedDrag)},_triggerDragStart:function(t){t?(Y={target:_,clientX:t.clientX,clientY:t.clientY},this._onDragStart(Y,"touch")):this.nativeDraggable?(o(_,"dragend",this),o(S,"dragstart",this._onDragStart)):this._onDragStart(Y,!0);try{U.selection?U.selection.empty():window.getSelection().removeAllRanges()}catch(e){}},_dragStarted:function(){S&&_&&(a(_,this.options.ghostClass,!0),t.active=this,d(this,S,"start",_,S,k))},_emulateDragOver:function(){if(A){if(this._lastX===A.clientX&&this._lastY===A.clientY)return;this._lastX=A.clientX,this._lastY=A.clientY,W||s(y,"display","none");var t=U.elementFromPoint(A.clientX,A.clientY),e=t,n=" "+this.options.group.name,i=q.length;if(e)do{if(e[j]&&e[j].options.groups.indexOf(n)>-1){for(;i--;)q[i]({clientX:A.clientX,clientY:A.clientY,target:t,rootEl:e});break}t=e}while(e=e.parentNode);W||s(y,"display","")}},_onTouchMove:function(e){if(Y){t.active||this._dragStarted(),this._appendGhost();var n=e.touches?e.touches[0]:e,i=n.clientX-Y.clientX,o=n.clientY-Y.clientY,r=e.touches?"translate3d("+i+"px,"+o+"px,0)":"translate("+i+"px,"+o+"px)";I=!0,A=n,s(y,"webkitTransform",r),s(y,"mozTransform",r),s(y,"msTransform",r),s(y,"transform",r),e.preventDefault()}},_appendGhost:function(){if(!y){var t,e=_.getBoundingClientRect(),n=s(_),i=this.options;y=_.cloneNode(!0),a(y,i.ghostClass,!1),a(y,i.fallbackClass,!0),s(y,"top",e.top-H(n.marginTop,10)),s(y,"left",e.left-H(n.marginLeft,10)),s(y,"width",e.width),s(y,"height",e.height),s(y,"opacity","0.8"),s(y,"position","fixed"),s(y,"zIndex","100000"),s(y,"pointerEvents","none"),i.fallbackOnBody&&U.body.appendChild(y)||S.appendChild(y),t=y.getBoundingClientRect(),s(y,"width",2*e.width-t.width),s(y,"height",2*e.height-t.height)}},_onDragStart:function(t,e){var n=t.dataTransfer,i=this.options;this._offUpEvents(),"clone"==X.pull&&(w=_.cloneNode(!0),s(w,"display","none"),S.insertBefore(w,_)),e?("touch"===e?(o(U,"touchmove",this._onTouchMove),o(U,"touchend",this._onDrop),o(U,"touchcancel",this._onDrop)):(o(U,"mousemove",this._onTouchMove),o(U,"mouseup",this._onDrop)),this._loopId=setInterval(this._emulateDragOver,50)):(n&&(n.effectAllowed="move",i.setData&&i.setData.call(this,n,_)),o(U,"drop",this),setTimeout(this._dragStarted,0))},_onDragOver:function(t){var i,o,r,a=this.el,l=this.options,d=l.group,u=d.put,p=X===d,g=l.sort;if(void 0!==t.preventDefault&&(t.preventDefault(),!l.dragoverBubble&&t.stopPropagation()),I=!0,X&&!l.disabled&&(p?g||(r=!S.contains(_)):X.pull&&u&&(X.name===d.name||u.indexOf&&~u.indexOf(X.name)))&&(void 0===t.rootEl||t.rootEl===this.el)){if(V(t,l,this.el),K)return;if(i=n(t.target,l.draggable,a),o=_.getBoundingClientRect(),r)return e(!0),void(w||T?S.insertBefore(_,w||T):g||S.appendChild(_));if(0===a.children.length||a.children[0]===y||a===t.target&&(i=f(a,t))){if(i){if(i.animated)return;m=i.getBoundingClientRect()}e(p),c(S,a,_,o,i,m)!==!1&&(_.contains(a)||(a.appendChild(_),D=a),this._animate(o,_),i&&this._animate(m,i))}else if(i&&!i.animated&&i!==_&&void 0!==i.parentNode[j]){x!==i&&(x=i,N=s(i),B=s(i.parentNode));var v,m=i.getBoundingClientRect(),b=m.right-m.left,C=m.bottom-m.top,E=/left|right|inline/.test(N.cssFloat+N.display)||"flex"==B.display&&0===B["flex-direction"].indexOf("row"),k=i.offsetWidth>_.offsetWidth,O=i.offsetHeight>_.offsetHeight,Y=(E?(t.clientX-m.left)/b:(t.clientY-m.top)/C)>.5,A=i.nextElementSibling,R=c(S,a,_,o,i,m);if(R!==!1){if(K=!0,setTimeout(h,30),e(p),1===R||-1===R)v=1===R;else if(E){var M=_.offsetTop,L=i.offsetTop;v=M===L?i.previousElementSibling===_&&!k||Y&&k:L>M}else v=A!==_&&!O||Y&&O;_.contains(a)||(v&&!A?a.appendChild(_):i.parentNode.insertBefore(_,v?A:i)),D=_.parentNode,this._animate(o,_),this._animate(m,i)}}}},_animate:function(t,e){var n=this.options.animation;if(n){var i=e.getBoundingClientRect();s(e,"transition","none"),s(e,"transform","translate3d("+(t.left-i.left)+"px,"+(t.top-i.top)+"px,0)"),e.offsetWidth,s(e,"transition","all "+n+"ms"),s(e,"transform","translate3d(0,0,0)"),clearTimeout(e.animated),e.animated=setTimeout(function(){s(e,"transition",""),s(e,"transform",""),e.animated=!1},n)}},_offUpEvents:function(){var t=this.el.ownerDocument;r(U,"touchmove",this._onTouchMove),r(t,"mouseup",this._onDrop),r(t,"touchend",this._onDrop),r(t,"touchcancel",this._onDrop)},_onDrop:function(e){var n=this.el,i=this.options;clearInterval(this._loopId),clearInterval(R.pid),clearTimeout(this._dragStartTimer),r(U,"mousemove",this._onTouchMove),this.nativeDraggable&&(r(U,"drop",this),r(n,"dragstart",this._onDragStart)),this._offUpEvents(),e&&(I&&(e.preventDefault(),!i.dropBubble&&e.stopPropagation()),y&&y.parentNode.removeChild(y),_&&(this.nativeDraggable&&r(_,"dragend",this),u(_),a(_,this.options.ghostClass,!1),a(_,this.options.chosenClass,!1),S!==D?(O=g(_,i.draggable),O>=0&&(d(null,D,"sort",_,S,k,O),d(this,S,"sort",_,S,k,O),d(null,D,"add",_,S,k,O),d(this,S,"remove",_,S,k,O))):(w&&w.parentNode.removeChild(w),_.nextSibling!==T&&(O=g(_,i.draggable),O>=0&&(d(this,S,"update",_,S,k,O),d(this,S,"sort",_,S,k,O)))),t.active&&((null===O||-1===O)&&(O=k),d(this,S,"end",_,S,k,O),this.save()))),this._nulling()},_nulling:function(){S=_=D=y=T=w=C=E=Y=A=I=O=x=N=X=t.active=null},handleEvent:function(t){var e=t.type;"dragover"===e||"dragenter"===e?_&&(this._onDragOver(t),i(t)):("drop"===e||"dragend"===e)&&this._onDrop(t)},toArray:function(){for(var t,e=[],i=this.el.children,o=0,r=i.length,a=this.options;r>o;o++)t=i[o],n(t,a.draggable,this.el)&&e.push(t.getAttribute(a.dataIdAttr)||p(t));return e},sort:function(t){var e={},i=this.el;this.toArray().forEach(function(t,o){var r=i.children[o];n(r,this.options.draggable,i)&&(e[t]=r)},this),t.forEach(function(t){e[t]&&(i.removeChild(e[t]),i.appendChild(e[t]))})},save:function(){var t=this.options.store;t&&t.set(this)},closest:function(t,e){return n(t,e||this.options.draggable,this.el)},option:function(t,e){var n=this.options;return void 0===e?n[t]:(n[t]=e,void("group"===t&&z(n)))},destroy:function(){var t=this.el;t[j]=null,r(t,"mousedown",this._onTapStart),r(t,"touchstart",this._onTapStart),this.nativeDraggable&&(r(t,"dragover",this),r(t,"dragenter",this)),Array.prototype.forEach.call(t.querySelectorAll("[draggable]"),function(t){t.removeAttribute("draggable")}),q.splice(q.indexOf(this._onDragOver),1),this._onDrop(),this.el=t=null}},t.utils={on:o,off:r,css:s,find:l,is:function(t,e){return!!n(t,e,t)},extend:b,throttle:m,closest:n,toggleClass:a,index:g},t.create=function(e,n){return new t(e,n)},t.version="1.4.2",t}),function(t){"use strict";"function"==typeof define&&define.amd?define(["jquery"],t):t(jQuery)}(function(t){"use strict";t.fn.kvsortable=function(e){var n,i=arguments;return this.each(function(){var o=t(this),r=o.data("kvsortable");if(r||!(e instanceof Object)&&e||(r=new KvSortable(this,e),o.data("kvsortable",r)),r){if("widget"===e)return r;"destroy"===e?(r.destroy(),o.removeData("kvsortable")):"function"==typeof r[e]?n=r[e].apply(r,[].slice.call(i,1)):e in r.options&&(n=r.option.apply(r,i))}}),void 0===n?this:n}}); |
| 3 | \ No newline at end of file | 3 | \ No newline at end of file |
src/main/resources/static/pages/forms/export/text.xls
No preview for this file type
src/main/resources/static/pages/forms/mould/daily.xls
No preview for this file type
src/main/resources/static/pages/forms/mould/firstAndLastBus.xls
No preview for this file type
src/main/resources/static/pages/forms/mould/waybill.xls
No preview for this file type
src/main/resources/static/pages/forms/statement/busInterval.html
0 → 100644
| 1 | +<style type="text/css"> | ||
| 2 | + .table-bordered { | ||
| 3 | + border: 1px solid; } | ||
| 4 | + .table-bordered > thead > tr > th, | ||
| 5 | + .table-bordered > thead > tr > td, | ||
| 6 | + .table-bordered > tbody > tr > th, | ||
| 7 | + .table-bordered > tbody > tr > td, | ||
| 8 | + .table-bordered > tfoot > tr > th, | ||
| 9 | + .table-bordered > tfoot > tr > td { | ||
| 10 | + border: 1px solid; } | ||
| 11 | + .table-bordered > thead > tr > th, | ||
| 12 | + .table-bordered > thead > tr > td { | ||
| 13 | + border-bottom-width: 2px; } | ||
| 14 | + .table > tbody + tbody { | ||
| 15 | + border-top: 1px solid; } | ||
| 16 | + #forms > tbody > tr{ | ||
| 17 | + background-color: #FFFFFF; | ||
| 18 | + } | ||
| 19 | +</style> | ||
| 20 | + | ||
| 21 | +<div class="page-head"> | ||
| 22 | + <div class="page-title"> | ||
| 23 | + <h1>班次间隔统计表</h1> | ||
| 24 | + </div> | ||
| 25 | +</div> | ||
| 26 | + | ||
| 27 | +<div class="row"> | ||
| 28 | + <div class="col-md-12"> | ||
| 29 | + <div class="portlet light porttlet-fit bordered"> | ||
| 30 | + <div class="portlet-title"> | ||
| 31 | + <form id="history" class="form-inline" action=""> | ||
| 32 | + <div style="display: inline-block; margin-left: 33px;" id="company1"> | ||
| 33 | + <span class="item-label" style="width: 80px;">公司: </span> | ||
| 34 | + <select class="form-control" name="company" id="company" style="width: 180px;"></select> | ||
| 35 | + </div> | ||
| 36 | + <div style="display: inline-block; margin-left: 24px;" id="subCompany1"> | ||
| 37 | + <span class="item-label" style="width: 80px;">分公司: </span> | ||
| 38 | + <select class="form-control" name="subCompany" id="subCompany" style="width: 180px;"></select> | ||
| 39 | + </div> | ||
| 40 | + <div style="display: inline-block; margin-left: 24px;"> | ||
| 41 | + <span class="item-label" style="width: 80px;">线路: </span> | ||
| 42 | + <select class="form-control" name="line" id="line" style="width: 180px;"></select> | ||
| 43 | + </div> | ||
| 44 | + <div style="display: inline-block; margin-left: 10px"> | ||
| 45 | + <span class="item-label" style="width: 80px;">时刻类型: </span> | ||
| 46 | + <select class="form-control" name="model" id="model" style="width: 180px;"> | ||
| 47 | + <option value="">请选择...</option> | ||
| 48 | + </select> | ||
| 49 | + </div> | ||
| 50 | + <div style="margin-top: 10px"></div> | ||
| 51 | + <div style="display: inline-block;margin-left: 5px;"> | ||
| 52 | + <span class="item-label" style="width: 80px;">开始时间: </span> | ||
| 53 | + <input class="form-control" type="text" id="startDate" style="width: 180px;"/> | ||
| 54 | + </div> | ||
| 55 | + <div style="display: inline-block;margin-left: 10px;"> | ||
| 56 | + <span class="item-label" style="width: 80px;">结束时间: </span> | ||
| 57 | + <input class="form-control" type="text" id="endDate" style="width: 180px;"/> | ||
| 58 | + </div> | ||
| 59 | + <div style="display: inline-block;margin-left: 10px;"> | ||
| 60 | + <span class="item-label" style="width: 80px;">时间段: </span> | ||
| 61 | + <input class="form-control" type="text" id="times1" style="width: 80px;"/> | ||
| 62 | + </div> | ||
| 63 | + <div style="display: inline-block;"> | ||
| 64 | + <span class="item-label" style="width: 80px;"> - </span> | ||
| 65 | + <input class="form-control" type="text" id="times2" style="width: 80px;"/> | ||
| 66 | + </div> | ||
| 67 | + <div class="form-group" style="margin-left: 10px"> | ||
| 68 | + <input class="btn btn-default" type="button" id="query" value="筛选"/> | ||
| 69 | +<!-- <input class="btn btn-default" type="button" id="export" value="导出"/> --> | ||
| 70 | + </div> | ||
| 71 | + </form> | ||
| 72 | + </div> | ||
| 73 | + <div class="portlet-body"> | ||
| 74 | + <div class="table-container" style="margin-top: 10px;overflow:auto;min-width: 906px"> | ||
| 75 | + <table class="table table-bordered table-hover table-checkable" id="forms"> | ||
| 76 | + <thead> | ||
| 77 | + <tr class="hidden"> | ||
| 78 | + <th>日期</th> | ||
| 79 | + <th>时段</th> | ||
| 80 | + <th>公司</th> | ||
| 81 | + <th>分公司</th> | ||
| 82 | + <th>线路</th> | ||
| 83 | + <th>起讫站</th> | ||
| 84 | + <th>计划车距(分钟)</th> | ||
| 85 | + <th>实际车距(分钟)</th> | ||
| 86 | + <th>误差值</th> | ||
| 87 | + </tr> | ||
| 88 | + </thead> | ||
| 89 | + <tbody> | ||
| 90 | + | ||
| 91 | + </tbody> | ||
| 92 | + </table> | ||
| 93 | + <div style="text-align: right;"> | ||
| 94 | + <ul id="pagination" class="pagination"></ul> | ||
| 95 | + </div> | ||
| 96 | + </div> | ||
| 97 | + </div> | ||
| 98 | + </div> | ||
| 99 | + </div> | ||
| 100 | +</div> | ||
| 101 | + | ||
| 102 | +<script> | ||
| 103 | + $(function(){ | ||
| 104 | + | ||
| 105 | + // 关闭左侧栏 | ||
| 106 | + if (!$('body').hasClass('page-sidebar-closed')) | ||
| 107 | + $('.menu-toggler.sidebar-toggler').click(); | ||
| 108 | + | ||
| 109 | + $("#startDate").datetimepicker({ | ||
| 110 | + format : 'YYYY-MM-DD', | ||
| 111 | + locale : 'zh-cn' | ||
| 112 | + }); | ||
| 113 | + $("#endDate").datetimepicker({ | ||
| 114 | + format : 'YYYY-MM-DD', | ||
| 115 | + locale : 'zh-cn' | ||
| 116 | + }); | ||
| 117 | + | ||
| 118 | + $("#times1").datetimepicker({ | ||
| 119 | + format : 'HH:mm', | ||
| 120 | + locale : 'zh-cn' | ||
| 121 | + }); | ||
| 122 | + $("#times2").datetimepicker({ | ||
| 123 | + format : 'HH:mm', | ||
| 124 | + locale : 'zh-cn' | ||
| 125 | + }); | ||
| 126 | + | ||
| 127 | + var d = new Date(); | ||
| 128 | + var year = d.getFullYear(); | ||
| 129 | + var month = d.getMonth() + 1; | ||
| 130 | + var day = d.getDate(); | ||
| 131 | + if(month > 9){ | ||
| 132 | + $("#startDate").val(year + "-" + month + "-" + day); | ||
| 133 | + $("#endDate").val(year + "-" + month + "-" + day); | ||
| 134 | + } else { | ||
| 135 | + $("#startDate").val(year + "-0" + month + "-" + day); | ||
| 136 | + $("#endDate").val(year + "-0" + month + "-" + day); | ||
| 137 | + } | ||
| 138 | + $("#times1").val("06:00"); | ||
| 139 | + $("#times2").val("07:00"); | ||
| 140 | + | ||
| 141 | + var obj = []; | ||
| 142 | + $.get('/user/companyData', function(result){ | ||
| 143 | + obj = result; | ||
| 144 | + var options = ''; | ||
| 145 | + for(var i = 0; i < obj.length; i++){ | ||
| 146 | + options += '<option value="'+obj[i].companyCode+'">'+obj[i].companyName+'</option>'; | ||
| 147 | + } | ||
| 148 | + if(obj.length == 1){ | ||
| 149 | + $('#company1').hide(); | ||
| 150 | + if(obj[0].children.length == 1) | ||
| 151 | + $('#subCompany1').hide(); | ||
| 152 | + } | ||
| 153 | + $('#company').html(options); | ||
| 154 | + updateCompany(); | ||
| 155 | + }); | ||
| 156 | + $("#company").on("change",updateCompany); | ||
| 157 | + function updateCompany(){ | ||
| 158 | + var company = $('#company').val(); | ||
| 159 | + var options = ''; | ||
| 160 | + for(var i = 0; i < obj.length; i++){ | ||
| 161 | + if(obj[i].companyCode == company){ | ||
| 162 | + var children = obj[i].children; | ||
| 163 | + for(var j = 0; j < children.length; j++){ | ||
| 164 | + options += '<option value="'+children[j].code+'">'+children[j].name+'</option>'; | ||
| 165 | + } | ||
| 166 | + } | ||
| 167 | + } | ||
| 168 | + $('#subCompany').html(options); | ||
| 169 | + } | ||
| 170 | + | ||
| 171 | + $.get('/basic/lineCode2Name',function(result){ | ||
| 172 | + var data=[]; | ||
| 173 | + data.push({id:" ", text:"全部线路"}); | ||
| 174 | + for(var code in result){ | ||
| 175 | + data.push({id: code, text: result[code]}); | ||
| 176 | + } | ||
| 177 | + console.log(data); | ||
| 178 | + initPinYinSelect2('#line',data,''); | ||
| 179 | + | ||
| 180 | + line = ""; | ||
| 181 | + updateModel(); | ||
| 182 | + }) | ||
| 183 | + | ||
| 184 | +// $('#line').select2({ | ||
| 185 | +// ajax: { | ||
| 186 | +// url: '/realSchedule/findLine', | ||
| 187 | +// type: 'post', | ||
| 188 | +// dataType: 'json', | ||
| 189 | +// delay: 150, | ||
| 190 | +// data: function(params){ | ||
| 191 | +// return{line: params.term}; | ||
| 192 | +// }, | ||
| 193 | +// processResults: function (data) { | ||
| 194 | +// return { | ||
| 195 | +// results: data | ||
| 196 | +// }; | ||
| 197 | +// }, | ||
| 198 | +// cache: true | ||
| 199 | +// }, | ||
| 200 | +// templateResult: function(repo){ | ||
| 201 | +// if (repo.loading) return repo.text; | ||
| 202 | +// var h = '<span>'+repo.text+'</span>'; | ||
| 203 | +// return h; | ||
| 204 | +// }, | ||
| 205 | +// escapeMarkup: function (markup) { return markup; }, | ||
| 206 | +// minimumInputLength: 1, | ||
| 207 | +// templateSelection: function(repo){ | ||
| 208 | +// return repo.text; | ||
| 209 | +// }, | ||
| 210 | +// language: { | ||
| 211 | +// noResults: function(){ | ||
| 212 | +// return '<span style="color:red;font-size: 12px;">没有搜索到线路!</span>'; | ||
| 213 | +// }, | ||
| 214 | +// inputTooShort : function(e) { | ||
| 215 | +// return '<span style="color:gray;font-size: 12px;"><i class="fa fa-search"></i> 输入线路搜索线路</span>'; | ||
| 216 | +// }, | ||
| 217 | +// searching : function() { | ||
| 218 | +// return '<span style="color:gray;font-size: 12px;"> 正在搜索线路...</span>'; | ||
| 219 | +// } | ||
| 220 | +// } | ||
| 221 | +// }); | ||
| 222 | + | ||
| 223 | + $("#query").on("click",jsDoQuery); | ||
| 224 | + | ||
| 225 | + var line = $("#line").val(); | ||
| 226 | + var startDate = $("#startDate").val(); | ||
| 227 | + var endDate = $("#endDate").val(); | ||
| 228 | + var model = $("#model").val(); | ||
| 229 | + var times = $("#times1").val() + "-" + $("#times2").val(); | ||
| 230 | + function jsDoQuery(pagination){ | ||
| 231 | + var params = {}; | ||
| 232 | +// line = $("#line").val(); | ||
| 233 | + startDate = $("#startDate").val(); | ||
| 234 | + endDate = $("#endDate").val(); | ||
| 235 | + model = $("#model").val(); | ||
| 236 | + times = $("#times1").val() + "-" + $("#times2").val(); | ||
| 237 | + params['line'] = line; | ||
| 238 | + params['startDate'] = startDate; | ||
| 239 | + params['endDate'] = endDate; | ||
| 240 | + params['model'] = model; | ||
| 241 | + params['times'] = times; | ||
| 242 | + params['type'] = "query"; | ||
| 243 | + $(".hidden").removeClass("hidden"); | ||
| 244 | + $get('/busInterval/interval', params, function(result){ | ||
| 245 | + // 把数据填充到模版中 | ||
| 246 | + var tbodyHtml = template('list_workDaily',{list:result}); | ||
| 247 | + // 把渲染好的模版html文本追加到表格中 | ||
| 248 | + $('#forms tbody').html(tbodyHtml); | ||
| 249 | + _w_table_rowspan("#forms tbody", 1); | ||
| 250 | + _w_table_rowspan("#forms tbody", 2); | ||
| 251 | + _w_table_rowspan("#forms tbody", 3); | ||
| 252 | + _w_table_rowspan("#forms tbody", 4); | ||
| 253 | + _w_table_rowspan("#forms tbody", 5); | ||
| 254 | + | ||
| 255 | + }); | ||
| 256 | + } | ||
| 257 | + | ||
| 258 | +// $("#export").on("click",function(){ | ||
| 259 | +// $get('/pcpc/workDaily',{line:line,date:date,type:'export'},function(result){ | ||
| 260 | +// window.open("/downloadFile/download?fileName=营运服务日报表"+moment(date).format("YYYYMMDD")); | ||
| 261 | +// }); | ||
| 262 | +// }); | ||
| 263 | + | ||
| 264 | + | ||
| 265 | + $("#line").on("change", function(){ | ||
| 266 | + line = $("#line").val(); | ||
| 267 | + if(line == " ") | ||
| 268 | + line = ""; | ||
| 269 | + updateModel(); | ||
| 270 | + }); | ||
| 271 | + $('#startDate').on("blur", function(){ | ||
| 272 | + startDate = $("#startDate").val(); | ||
| 273 | + endDate = $("#endDate").val(); | ||
| 274 | + updateModel(); | ||
| 275 | + }); | ||
| 276 | + $('#endDate').on("blur", function(){ | ||
| 277 | + startDate = $("#startDate").val(); | ||
| 278 | + endDate = $("#endDate").val(); | ||
| 279 | + updateModel(); | ||
| 280 | + }); | ||
| 281 | + | ||
| 282 | + var flag = 0; | ||
| 283 | + function updateModel(){ | ||
| 284 | + if(flag == 1) | ||
| 285 | + return; | ||
| 286 | + flag = 1; | ||
| 287 | + var treeData = []; | ||
| 288 | + var params = {}; | ||
| 289 | + params['line'] = line; | ||
| 290 | + params['startDate'] = startDate; | ||
| 291 | + params['endDate'] = endDate; | ||
| 292 | + $get('/pcpc/getModel', params, function(result){ | ||
| 293 | + treeData = createTreeData(result); | ||
| 294 | + var options = '<option value="">请选择...</option>'; | ||
| 295 | + $.each(treeData, function(i, g){ | ||
| 296 | + options += '<option value="'+g.id+'">'+g.name+'</option>'; | ||
| 297 | + }); | ||
| 298 | + $('#model').html(options)/* .select2() */; | ||
| 299 | + flag = 0; | ||
| 300 | + }); | ||
| 301 | + } | ||
| 302 | + | ||
| 303 | + | ||
| 304 | + function _w_table_rowspan(_w_table_id, _w_table_colnum){ | ||
| 305 | + _w_table_firsttd = ""; | ||
| 306 | + _w_table_currenttd = ""; | ||
| 307 | + _w_table_SpanNum = 0; | ||
| 308 | + _w_table_Obj = jQuery(_w_table_id + " tr td:nth-child(" + _w_table_colnum + ")"); | ||
| 309 | + _w_table_Obj.each(function(i){ | ||
| 310 | + if(i==0){ | ||
| 311 | + _w_table_firsttd = jQuery(this); | ||
| 312 | + _w_table_SpanNum = 1; | ||
| 313 | + }else{ | ||
| 314 | + _w_table_currenttd = jQuery(this); | ||
| 315 | + if(_w_table_firsttd.text()==_w_table_currenttd.text()){ | ||
| 316 | + _w_table_SpanNum++; | ||
| 317 | + _w_table_currenttd.hide(); //remove(); | ||
| 318 | + _w_table_firsttd.attr("rowSpan",_w_table_SpanNum); | ||
| 319 | + }else{ | ||
| 320 | + _w_table_firsttd = jQuery(this); | ||
| 321 | + _w_table_SpanNum = 1; | ||
| 322 | + } | ||
| 323 | + } | ||
| 324 | + }); | ||
| 325 | + } | ||
| 326 | + | ||
| 327 | + | ||
| 328 | + }); | ||
| 329 | + | ||
| 330 | +</script> | ||
| 331 | +<script type="text/html" id="list_workDaily"> | ||
| 332 | + {{each list as obj i}} | ||
| 333 | + <tr> | ||
| 334 | + <td style='text-align:center;vertical-align:middle;'>{{obj.date}}</td> | ||
| 335 | + <td style='text-align:center;vertical-align:middle;'>{{obj.times}}</td> | ||
| 336 | + <td style='text-align:center;vertical-align:middle;'>{{obj.company}}</td> | ||
| 337 | + <td style='text-align:center;vertical-align:middle;'>{{obj.subCompany}}</td> | ||
| 338 | + <td style='text-align:center;vertical-align:middle;'>{{obj.line}}</td> | ||
| 339 | + <td>{{obj.qdz}}</td> | ||
| 340 | + <td>{{obj.jhInterval}}</td> | ||
| 341 | + <td>{{obj.sjInterval}}</td> | ||
| 342 | + <td>{{obj.deviation}}</td> | ||
| 343 | + </tr> | ||
| 344 | + {{/each}} | ||
| 345 | + {{if list.length == 0}} | ||
| 346 | + <tr> | ||
| 347 | + <td colspan="9"><h6 class="muted">没有找到相关数据</h6></td> | ||
| 348 | + </tr> | ||
| 349 | + {{/if}} | ||
| 350 | +</script> | ||
| 0 | \ No newline at end of file | 351 | \ No newline at end of file |
src/main/resources/static/pages/forms/statement/changetochange.html
| @@ -164,8 +164,8 @@ | @@ -164,8 +164,8 @@ | ||
| 164 | $("#query").on("click",function(){ | 164 | $("#query").on("click",function(){ |
| 165 | line = $("#line").val(); | 165 | line = $("#line").val(); |
| 166 | sel = $("#sel").val(); | 166 | sel = $("#sel").val(); |
| 167 | - var startDate1=$("#startDate").val(); | ||
| 168 | - var endDate1=$("#endDate").val(); | 167 | + var startDate1=$("#startDate").val(); |
| 168 | + var endDate1=$("#endDate").val(); | ||
| 169 | 169 | ||
| 170 | if(startDate1!=''&&endDate1!=''){ | 170 | if(startDate1!=''&&endDate1!=''){ |
| 171 | $post('/mcy_forms/changetochange',{sel:sel,line:line,startDate:$("#startDate").val(),endDate:$("#endDate").val(),type:'query'},function(result){ | 171 | $post('/mcy_forms/changetochange',{sel:sel,line:line,startDate:$("#startDate").val(),endDate:$("#endDate").val(),type:'query'},function(result){ |
| @@ -225,4 +225,4 @@ | @@ -225,4 +225,4 @@ | ||
| 225 | <td colspan="15"><h6 class="muted">没有找到相关数据</h6></td> | 225 | <td colspan="15"><h6 class="muted">没有找到相关数据</h6></td> |
| 226 | </tr> | 226 | </tr> |
| 227 | {{/if}} | 227 | {{/if}} |
| 228 | -</script> | 228 | +</script> |
| 229 | \ No newline at end of file | 229 | \ No newline at end of file |
src/main/resources/static/pages/forms/statement/commandState.html
| @@ -27,19 +27,28 @@ | @@ -27,19 +27,28 @@ | ||
| 27 | <div class="portlet light porttlet-fit bordered"> | 27 | <div class="portlet light porttlet-fit bordered"> |
| 28 | <div class="portlet-title"> | 28 | <div class="portlet-title"> |
| 29 | <form id="history" class="form-inline" action=""> | 29 | <form id="history" class="form-inline" action=""> |
| 30 | - <div style="display: inline-block;"> | 30 | + <div style="display: inline-block; margin-left: 15px;" id="company1"> |
| 31 | + <span class="item-label" style="width: 80px;">公司: </span> | ||
| 32 | + <select class="form-control" name="company" id="company" style="width: 180px;"></select> | ||
| 33 | + </div> | ||
| 34 | + <div style="display: inline-block; margin-left: 22px;" id="subCompany1"> | ||
| 35 | + <span class="item-label" style="width: 80px;">分公司: </span> | ||
| 36 | + <select class="form-control" name="subCompany" id="subCompany" style="width: 180px;"></select> | ||
| 37 | + </div> | ||
| 38 | + <div style="display: inline-block; margin-left: 15px;"> | ||
| 31 | <span class="item-label" style="width: 80px;">线路: </span> | 39 | <span class="item-label" style="width: 80px;">线路: </span> |
| 32 | <select class="form-control" name="line" id="line" style="width: 180px;"></select> | 40 | <select class="form-control" name="line" id="line" style="width: 180px;"></select> |
| 33 | </div> | 41 | </div> |
| 42 | + <div style="margin-top: 10px" /> | ||
| 34 | <div style="display: inline-block;margin-left: 15px;"> | 43 | <div style="display: inline-block;margin-left: 15px;"> |
| 35 | <span class="item-label" style="width: 80px;">时间: </span> | 44 | <span class="item-label" style="width: 80px;">时间: </span> |
| 36 | <input class="form-control" type="text" id="date" style="width: 180px;"/> | 45 | <input class="form-control" type="text" id="date" style="width: 180px;"/> |
| 37 | </div> | 46 | </div> |
| 38 | - <div style="display: inline-block;margin-left: 15px"> | ||
| 39 | - <span class="item-label" style="width: 140px;">内部编码: </span> | 47 | + <div style="display: inline-block;margin-left: 8px"> |
| 48 | + <span class="item-label" style="width: 140px;">内部编码: </span> | ||
| 40 | <select class="form-control" name="code" id="code" style="width: 180px;"></select> | 49 | <select class="form-control" name="code" id="code" style="width: 180px;"></select> |
| 41 | </div> | 50 | </div> |
| 42 | - <div class="form-group"> | 51 | + <div class="form-group" style="margin-left: 9px"> |
| 43 | <input class="btn btn-default" type="button" id="query" value="筛选"/> | 52 | <input class="btn btn-default" type="button" id="query" value="筛选"/> |
| 44 | <!-- <input class="btn btn-default" type="button" id="export" value="导出"/> --> | 53 | <!-- <input class="btn btn-default" type="button" id="export" value="导出"/> --> |
| 45 | </div> | 54 | </div> |
| @@ -64,7 +73,7 @@ | @@ -64,7 +73,7 @@ | ||
| 64 | </tbody> | 73 | </tbody> |
| 65 | </table> | 74 | </table> |
| 66 | <div id="works_hidden" class="hidden"> | 75 | <div id="works_hidden" class="hidden"> |
| 67 | - <span class="item-label" style="width: 80px;">明细: </span> | 76 | + <span class="item-label" style="width: 80px;margin-left: 20px;">明细: </span> |
| 68 | <span class="item-label" style="width: 80px;margin-left: 60px;">日期 </span> | 77 | <span class="item-label" style="width: 80px;margin-left: 60px;">日期 </span> |
| 69 | <span class="item-label" style="width: 80px;" id="date1"></span> | 78 | <span class="item-label" style="width: 80px;" id="date1"></span> |
| 70 | <span class="item-label" style="width: 80px;margin-left: 60px;">线路 </span> | 79 | <span class="item-label" style="width: 80px;margin-left: 60px;">线路 </span> |
| @@ -122,44 +131,46 @@ | @@ -122,44 +131,46 @@ | ||
| 122 | $("#date").val(year + "-0" + month + "-" + day); | 131 | $("#date").val(year + "-0" + month + "-" + day); |
| 123 | } | 132 | } |
| 124 | 133 | ||
| 125 | - $('#line').select2({ | ||
| 126 | - ajax: { | ||
| 127 | - url: '/realSchedule/findLine', | ||
| 128 | - type: 'post', | ||
| 129 | - dataType: 'json', | ||
| 130 | - delay: 150, | ||
| 131 | - data: function(params){ | ||
| 132 | - return{line: params.term}; | ||
| 133 | - }, | ||
| 134 | - processResults: function (data) { | ||
| 135 | - return { | ||
| 136 | - results: data | ||
| 137 | - }; | ||
| 138 | - }, | ||
| 139 | - cache: true | ||
| 140 | - }, | ||
| 141 | - templateResult: function(repo){ | ||
| 142 | - if (repo.loading) return repo.text; | ||
| 143 | - var h = '<span>'+repo.text+'</span>'; | ||
| 144 | - return h; | ||
| 145 | - }, | ||
| 146 | - escapeMarkup: function (markup) { return markup; }, | ||
| 147 | - minimumInputLength: 1, | ||
| 148 | - templateSelection: function(repo){ | ||
| 149 | - return repo.text; | ||
| 150 | - }, | ||
| 151 | - language: { | ||
| 152 | - noResults: function(){ | ||
| 153 | - return '<span style="color:red;font-size: 12px;">没有搜索到线路!</span>'; | ||
| 154 | - }, | ||
| 155 | - inputTooShort : function(e) { | ||
| 156 | - return '<span style="color:gray;font-size: 12px;"><i class="fa fa-search"></i> 输入线路搜索线路</span>'; | ||
| 157 | - }, | ||
| 158 | - searching : function() { | ||
| 159 | - return '<span style="color:gray;font-size: 12px;"> 正在搜索线路...</span>'; | ||
| 160 | - } | 134 | + $.get('/basic/lineCode2Name',function(result){ |
| 135 | + var data=[]; | ||
| 136 | + | ||
| 137 | + for(var code in result){ | ||
| 138 | + data.push({id: code, text: result[code]}); | ||
| 139 | + } | ||
| 140 | + console.log(data); | ||
| 141 | + initPinYinSelect2('#line',data,''); | ||
| 142 | + }) | ||
| 143 | + | ||
| 144 | + var obj = []; | ||
| 145 | + $.get('/user/companyData', function(result){ | ||
| 146 | + obj = result; | ||
| 147 | + var options = ''; | ||
| 148 | + for(var i = 0; i < obj.length; i++){ | ||
| 149 | + options += '<option value="'+obj[i].companyCode+'">'+obj[i].companyName+'</option>'; | ||
| 150 | + } | ||
| 151 | + if(obj.length == 1){ | ||
| 152 | + $('#company1').hide(); | ||
| 153 | + if(obj[0].children.length == 1) | ||
| 154 | + $('#subCompany1').hide(); | ||
| 161 | } | 155 | } |
| 156 | + $('#company').html(options); | ||
| 157 | + updateCompany(); | ||
| 162 | }); | 158 | }); |
| 159 | + $("#company").on("change",updateCompany); | ||
| 160 | + function updateCompany(){ | ||
| 161 | + var company = $('#company').val(); | ||
| 162 | + var options = ''; | ||
| 163 | + for(var i = 0; i < obj.length; i++){ | ||
| 164 | + if(obj[i].companyCode == company){ | ||
| 165 | + var children = obj[i].children; | ||
| 166 | + for(var j = 0; j < children.length; j++){ | ||
| 167 | + options += '<option value="'+children[j].code+'">'+children[j].name+'</option>'; | ||
| 168 | + } | ||
| 169 | + } | ||
| 170 | + } | ||
| 171 | + $('#subCompany').html(options); | ||
| 172 | + } | ||
| 173 | + | ||
| 163 | $('#code').select2({ | 174 | $('#code').select2({ |
| 164 | ajax: { | 175 | ajax: { |
| 165 | url: '/realSchedule/sreachVehic', | 176 | url: '/realSchedule/sreachVehic', |
src/main/resources/static/pages/forms/statement/correctStatis.html
0 → 100644
| 1 | +<style type="text/css"> | ||
| 2 | + .table-bordered { | ||
| 3 | + border: 1px solid; } | ||
| 4 | + .table-bordered > thead > tr > th, | ||
| 5 | + .table-bordered > thead > tr > td, | ||
| 6 | + .table-bordered > tbody > tr > th, | ||
| 7 | + .table-bordered > tbody > tr > td, | ||
| 8 | + .table-bordered > tfoot > tr > th, | ||
| 9 | + .table-bordered > tfoot > tr > td { | ||
| 10 | + border: 1px solid; } | ||
| 11 | + .table-bordered > thead > tr > th, | ||
| 12 | + .table-bordered > thead > tr > td { | ||
| 13 | + border-bottom-width: 2px; } | ||
| 14 | + .table > tbody + tbody { | ||
| 15 | + border-top: 1px solid; } | ||
| 16 | +</style> | ||
| 17 | + | ||
| 18 | +<div class="page-head"> | ||
| 19 | + <div class="page-title"> | ||
| 20 | + <h1>集群调度修正率统计表</h1> | ||
| 21 | + </div> | ||
| 22 | +</div> | ||
| 23 | + | ||
| 24 | +<div class="row"> | ||
| 25 | + <div class="col-md-12"> | ||
| 26 | + <div class="portlet light porttlet-fit bordered"> | ||
| 27 | + <div class="portlet-title"> | ||
| 28 | + <form id="history" class="form-inline" action=""> | ||
| 29 | + <div style="display: inline-block; margin-left: 33px;" id="company1"> | ||
| 30 | + <span class="item-label" style="width: 80px;">公司: </span> | ||
| 31 | + <select class="form-control" name="company" id="company" style="width: 140px;"></select> | ||
| 32 | + </div> | ||
| 33 | + <div style="display: inline-block; margin-left: 24px;" id="subCompany1"> | ||
| 34 | + <span class="item-label" style="width: 80px;">分公司: </span> | ||
| 35 | + <select class="form-control" name="subCompany" id="subCompany" style="width: 140px;"></select> | ||
| 36 | + </div> | ||
| 37 | + <div style="display: inline-block; margin-left: 24px;"> | ||
| 38 | + <span class="item-label" style="width: 80px;">线路: </span> | ||
| 39 | + <select class="form-control" name="line" id="line" style="width: 140px;"></select> | ||
| 40 | + </div> | ||
| 41 | + <div style="margin-top: 10px"></div> | ||
| 42 | + <div style="display: inline-block;margin-left: 5px;"> | ||
| 43 | + <span class="item-label" style="width: 80px;">开始时间: </span> | ||
| 44 | + <input class="form-control" type="text" id="startDate" style="width: 140px;"/> | ||
| 45 | + </div> | ||
| 46 | + <div style="display: inline-block;margin-left: 10px;"> | ||
| 47 | + <span class="item-label" style="width: 80px;">结束时间: </span> | ||
| 48 | + <input class="form-control" type="text" id="endDate" style="width: 140px;"/> | ||
| 49 | + </div> | ||
| 50 | + <div style="display: inline-block;margin-left: 10px;"> | ||
| 51 | + <span class="item-label" style="width: 80px;">时间段: </span> | ||
| 52 | + <input class="form-control" type="text" id="times1" style="width: 60px;"/> | ||
| 53 | + </div> | ||
| 54 | + <div style="display: inline-block;"> | ||
| 55 | + <span class="item-label" style="width: 80px;"> - </span> | ||
| 56 | + <input class="form-control" type="text" id="times2" style="width: 60px;"/> | ||
| 57 | + </div> | ||
| 58 | + <div class="form-group"> | ||
| 59 | + <input class="btn btn-default" type="button" id="query" value="筛选"/> | ||
| 60 | +<!-- <input class="btn btn-default" type="button" id="export" value="导出"/> --> | ||
| 61 | + </div> | ||
| 62 | + </form> | ||
| 63 | + </div> | ||
| 64 | + <div class="portlet-body"> | ||
| 65 | + <div class="table-container" style="margin-top: 10px;overflow:auto;min-width: 906px"> | ||
| 66 | + <table class="table table-bordered table-hover table-checkable" id="forms"> | ||
| 67 | + </table> | ||
| 68 | + <div style="text-align: right;"> | ||
| 69 | + <ul id="pagination" class="pagination"></ul> | ||
| 70 | + </div> | ||
| 71 | + </div> | ||
| 72 | + | ||
| 73 | + <div class="table-container" style="margin-top: 10px;overflow:auto;min-width: 906px"> | ||
| 74 | + <table class="table table-bordered table-hover table-checkable" id="subinfo"> | ||
| 75 | + </table> | ||
| 76 | + <div style="text-align: right;"> | ||
| 77 | + <ul id="pagination" class="pagination"></ul> | ||
| 78 | + </div> | ||
| 79 | + </div> | ||
| 80 | + | ||
| 81 | + <div class="table-container" style="margin-top: 10px;overflow:auto;min-width: 906px"> | ||
| 82 | + <table class="table table-bordered table-hover table-checkable" id="lineinfo"> | ||
| 83 | + </table> | ||
| 84 | + <div style="text-align: right;"> | ||
| 85 | + <ul id="pagination" class="pagination"></ul> | ||
| 86 | + </div> | ||
| 87 | + </div> | ||
| 88 | + | ||
| 89 | + <div class="table-container" style="margin-top: 10px;overflow:auto;min-width: 906px"> | ||
| 90 | + <table class="table table-bordered table-hover table-checkable" id="lines"> | ||
| 91 | + </table> | ||
| 92 | + <div style="text-align: right;"> | ||
| 93 | + <ul id="pagination" class="pagination"></ul> | ||
| 94 | + </div> | ||
| 95 | + </div> | ||
| 96 | + </div> | ||
| 97 | + </div> | ||
| 98 | + </div> | ||
| 99 | +</div> | ||
| 100 | + | ||
| 101 | +<script> | ||
| 102 | + $(function(){ | ||
| 103 | + | ||
| 104 | + | ||
| 105 | + // 关闭左侧栏 | ||
| 106 | + if (!$('body').hasClass('page-sidebar-closed')) | ||
| 107 | + $('.menu-toggler.sidebar-toggler').click(); | ||
| 108 | + | ||
| 109 | + $("#startDate").datetimepicker({ | ||
| 110 | + format : 'YYYY-MM-DD', | ||
| 111 | + locale : 'zh-cn' | ||
| 112 | + }); | ||
| 113 | + $("#endDate").datetimepicker({ | ||
| 114 | + format : 'YYYY-MM-DD', | ||
| 115 | + locale : 'zh-cn' | ||
| 116 | + }); | ||
| 117 | + $("#times1").datetimepicker({ | ||
| 118 | + format : 'HH:mm', | ||
| 119 | + locale : 'zh-cn' | ||
| 120 | + }); | ||
| 121 | + $("#times2").datetimepicker({ | ||
| 122 | + format : 'HH:mm', | ||
| 123 | + locale : 'zh-cn' | ||
| 124 | + }); | ||
| 125 | + | ||
| 126 | + var d = new Date(); | ||
| 127 | + var year = d.getFullYear(); | ||
| 128 | + var month = d.getMonth() + 1; | ||
| 129 | + var day = d.getDate(); | ||
| 130 | + if(month > 9){ | ||
| 131 | + $("#startDate").val(year + "-" + month + "-" + day); | ||
| 132 | + $("#endDate").val(year + "-" + month + "-" + day); | ||
| 133 | + } else { | ||
| 134 | + $("#startDate").val(year + "-0" + month + "-" + day); | ||
| 135 | + $("#endDate").val(year + "-0" + month + "-" + day); | ||
| 136 | + } | ||
| 137 | + $("#times1").val("06:00"); | ||
| 138 | + $("#times2").val("07:00"); | ||
| 139 | + | ||
| 140 | + $.get('/basic/lineCode2Name', function(result){ | ||
| 141 | + var data=[]; | ||
| 142 | + | ||
| 143 | + data.push({id: " ", text: "全部线路"}); | ||
| 144 | + for(var code in result){ | ||
| 145 | + data.push({id: code, text: result[code]}); | ||
| 146 | + } | ||
| 147 | + console.log(data); | ||
| 148 | + initPinYinSelect2('#line',data,''); | ||
| 149 | + | ||
| 150 | + line = ""; | ||
| 151 | + updateModel(); | ||
| 152 | + }); | ||
| 153 | + | ||
| 154 | + var obj = []; | ||
| 155 | + $.get('/user/companyData', function(result){ | ||
| 156 | + obj = result; | ||
| 157 | + var options = ''; | ||
| 158 | + for(var i = 0; i < obj.length; i++){ | ||
| 159 | + options += '<option value="'+obj[i].companyCode+'">'+obj[i].companyName+'</option>'; | ||
| 160 | + } | ||
| 161 | + if(obj.length == 1){ | ||
| 162 | + $('#company1').hide(); | ||
| 163 | + if(obj[0].children.length == 1) | ||
| 164 | + $('#subCompany1').hide(); | ||
| 165 | + } | ||
| 166 | + $('#company').html(options); | ||
| 167 | + updateCompany(); | ||
| 168 | + }); | ||
| 169 | + $("#company").on("change",updateCompany); | ||
| 170 | + function updateCompany(){ | ||
| 171 | + var company = $('#company').val(); | ||
| 172 | + var options = ''; | ||
| 173 | + for(var i = 0; i < obj.length; i++){ | ||
| 174 | + if(obj[i].companyCode == company){ | ||
| 175 | + var children = obj[i].children; | ||
| 176 | + for(var j = 0; j < children.length; j++){ | ||
| 177 | + options += '<option value="'+children[j].code+'">'+children[j].name+'</option>'; | ||
| 178 | + } | ||
| 179 | + } | ||
| 180 | + } | ||
| 181 | + $('#subCompany').html(options); | ||
| 182 | + } | ||
| 183 | + | ||
| 184 | + | ||
| 185 | + $("#query").on("click",jsDoQuery); | ||
| 186 | + | ||
| 187 | + var company; | ||
| 188 | + var subCompany; | ||
| 189 | + var lines; | ||
| 190 | + var line = $("#line").val(); | ||
| 191 | + var startDate = $("#startDate").val(); | ||
| 192 | + var endDate = $("#endDate").val(); | ||
| 193 | + var times = $("#times1").val() + "-" + $("#times2").val(); | ||
| 194 | + function jsDoQuery(pagination){ | ||
| 195 | + var params = {}; | ||
| 196 | +// line = $("#line").val(); | ||
| 197 | + startDate = $("#startDate").val(); | ||
| 198 | + endDate = $("#endDate").val(); | ||
| 199 | + times = $("#times1").val() + "-" + $("#times2").val(); | ||
| 200 | + params['line'] = line; | ||
| 201 | + params['startDate'] = startDate; | ||
| 202 | + params['endDate'] = endDate; | ||
| 203 | + params['times'] = times; | ||
| 204 | + params['type'] = "query"; | ||
| 205 | +// $(".hidden").removeClass("hidden"); | ||
| 206 | + $get('/busInterval/correctStatis', params, function(result){ | ||
| 207 | + // 把数据填充到模版中 | ||
| 208 | + var tbodyHtml = template('list_company',{list:result, type:1}); | ||
| 209 | + // 把渲染好的模版html文本追加到表格中 | ||
| 210 | + $('#forms').html(tbodyHtml); | ||
| 211 | + $('#subinfo').html(""); | ||
| 212 | + $('#lineinfo').html(""); | ||
| 213 | + $("#lines").html(""); | ||
| 214 | + | ||
| 215 | + company = result; | ||
| 216 | + }); | ||
| 217 | + } | ||
| 218 | + | ||
| 219 | + $("#forms").on("click","tbody tr",function(){ | ||
| 220 | + if($(this).children().size() < 2){ | ||
| 221 | + return; | ||
| 222 | + } | ||
| 223 | + var params = {}; | ||
| 224 | + $(this).children().each(function(index){ | ||
| 225 | + params[index] = $(this).text(); | ||
| 226 | + }); | ||
| 227 | + $.each(company, function(i, g){ | ||
| 228 | + if(g.company == params[1]){ | ||
| 229 | + var tbodyHtml = template('list_company',{list:g.workList, type:2}); | ||
| 230 | + $("#subinfo").html(tbodyHtml); | ||
| 231 | + $("#lineinfo").html(""); | ||
| 232 | + $("#lines").html(""); | ||
| 233 | + | ||
| 234 | + subCompany = g.workList; | ||
| 235 | + } | ||
| 236 | + }); | ||
| 237 | + }); | ||
| 238 | + | ||
| 239 | + $("#subinfo").on("click","tbody tr",function(){ | ||
| 240 | + if($(this).children().size() < 2){ | ||
| 241 | + return; | ||
| 242 | + } | ||
| 243 | + var params = {}; | ||
| 244 | + $(this).children().each(function(index){ | ||
| 245 | + params[index] = $(this).text(); | ||
| 246 | + }); | ||
| 247 | + $.each(subCompany, function(i, g){ | ||
| 248 | + if(g.company == params[1] && g.subCompany == params[2]){ | ||
| 249 | + var tbodyHtml = template('list_company',{list:g.workList, type:3}); | ||
| 250 | + $("#lineinfo").html(tbodyHtml); | ||
| 251 | + $("#lines").html(""); | ||
| 252 | + | ||
| 253 | + lines = g.workList; | ||
| 254 | + } | ||
| 255 | + }); | ||
| 256 | + }); | ||
| 257 | + | ||
| 258 | + $("#lineinfo").on("click","tbody tr",function(){ | ||
| 259 | + if($(this).children().size() < 2){ | ||
| 260 | + return; | ||
| 261 | + } | ||
| 262 | + var params = {}; | ||
| 263 | + $(this).children().each(function(index){ | ||
| 264 | + params[index] = $(this).text(); | ||
| 265 | + }); | ||
| 266 | + $.each(lines, function(i, g){ | ||
| 267 | + if(g.company == params[1] && g.subCompany == params[2] && g.line == params[3]){ | ||
| 268 | + var tbodyHtml = template('list_workList',{list:g.workList}); | ||
| 269 | + $("#lines").html(tbodyHtml); | ||
| 270 | + } | ||
| 271 | + }); | ||
| 272 | + }); | ||
| 273 | + | ||
| 274 | + $("#export").on("click", function(){ | ||
| 275 | + $get('/pcpc/workDaily',{line:line,date:date,type:'export'},function(result){ | ||
| 276 | + window.open("/downloadFile/download?fileName=营运服务日报表"+moment(date).format("YYYYMMDD")); | ||
| 277 | + }); | ||
| 278 | + }); | ||
| 279 | + | ||
| 280 | + | ||
| 281 | + $("#line").on("change", function(){ | ||
| 282 | + line = $("#line").val(); | ||
| 283 | + if(line == " ") | ||
| 284 | + line = ""; | ||
| 285 | + updateModel(); | ||
| 286 | + }); | ||
| 287 | + $('#startDate').on("blur", function(){ | ||
| 288 | + startDate = $("#startDate").val(); | ||
| 289 | + endDate = $("#endDate").val(); | ||
| 290 | + updateModel(); | ||
| 291 | + }); | ||
| 292 | + $('#endDate').on("blur", function(){ | ||
| 293 | + startDate = $("#startDate").val(); | ||
| 294 | + endDate = $("#endDate").val(); | ||
| 295 | + updateModel(); | ||
| 296 | + }); | ||
| 297 | + | ||
| 298 | + | ||
| 299 | + }); | ||
| 300 | + | ||
| 301 | +</script> | ||
| 302 | +<script type="text/html" id="list_company"> | ||
| 303 | +<thead> | ||
| 304 | + <tr> | ||
| 305 | + <th class="hidden"></th> | ||
| 306 | + <th rowspan="2" width="120px">日期</th> | ||
| 307 | + <th rowspan="2">公司</th> | ||
| 308 | + {{if type>1}}<th rowspan="2">分公司</th>{{/if}} | ||
| 309 | + {{if type<3}}<th rowspan="2">线路条数</th>{{/if}} | ||
| 310 | + {{if type==3}}<th rowspan="2">线路</th>{{/if}} | ||
| 311 | + <th rowspan="2">实际营运班次</th> | ||
| 312 | + <th colspan="3" align="center">待发调整数</th> | ||
| 313 | + <th rowspan="2">掉线调整数</th> | ||
| 314 | + <th rowspan="2">各类烂班调整数</th> | ||
| 315 | + <th rowspan="2">修正次数汇总</th> | ||
| 316 | + <th rowspan="2">待发调整率</th> | ||
| 317 | + <th rowspan="2">掉线调整率</th> | ||
| 318 | + <th rowspan="2">各类烂班调整率</th> | ||
| 319 | + <th rowspan="2">修正率汇总</th> | ||
| 320 | + </tr> | ||
| 321 | + <tr> | ||
| 322 | + <th class="hidden"></th> | ||
| 323 | + <th>手动调整</th> | ||
| 324 | + <th>自动调整</th> | ||
| 325 | + <th>待发调整合计</th> | ||
| 326 | + </tr> | ||
| 327 | +</thead> | ||
| 328 | +<tbody> | ||
| 329 | + {{each list as obj i}} | ||
| 330 | + <tr> | ||
| 331 | + {{if obj.date=='合计'}} | ||
| 332 | + {{if type==1}}<td colspan="2">{{obj.date}}</td>{{/if}} | ||
| 333 | + {{if type==2}}<td colspan="3">{{obj.date}}</td>{{/if}} | ||
| 334 | + {{if type==3}}<td colspan="4">{{obj.date}}</td>{{/if}} | ||
| 335 | + {{/if}} | ||
| 336 | + {{if obj.date!='合计'}} | ||
| 337 | + <td>{{obj.date}}</td> | ||
| 338 | + | ||
| 339 | + {{/if}} | ||
| 340 | + {{if obj.date!='合计'}}<td>{{obj.company}}</td>{{/if}} | ||
| 341 | + {{if type>1 && obj.date!='合计'}}<td>{{obj.subCompany}}</td>{{/if}} | ||
| 342 | + {{if type<3}}<td>{{obj.lines}}</td>{{/if}} | ||
| 343 | + {{if type==3 && obj.date!='合计'}}<td>{{obj.line}}</td>{{/if}} | ||
| 344 | + <td>{{obj.sjbc}}</td> | ||
| 345 | + <td>{{obj.sddf}}</td> | ||
| 346 | + <td>{{obj.zddf}}</td> | ||
| 347 | + <td>{{obj.dfhj}}</td> | ||
| 348 | + <td>{{obj.dxtz}}</td> | ||
| 349 | + <td>{{obj.lbtz}}</td> | ||
| 350 | + <td>{{obj.correct}}</td> | ||
| 351 | + <td>{{obj.dfbl}}</td> | ||
| 352 | + <td>{{obj.dxbl}}</td> | ||
| 353 | + <td>{{obj.lbbl}}</td> | ||
| 354 | + <td>{{obj.correctbl}}</td> | ||
| 355 | + </tr> | ||
| 356 | + {{/each}} | ||
| 357 | + {{if list.length == 0}} | ||
| 358 | + <tr> | ||
| 359 | + <td colspan="15"><h6 class="muted">没有找到相关数据</h6></td> | ||
| 360 | + </tr> | ||
| 361 | + {{/if}} | ||
| 362 | +</tbody> | ||
| 363 | +</script> | ||
| 364 | +<script type="text/html" id="list_workList"> | ||
| 365 | +<thead> | ||
| 366 | + <tr> | ||
| 367 | + <th colspan="9">修正报表</th> | ||
| 368 | + </tr> | ||
| 369 | + <tr> | ||
| 370 | + <th>路牌</th> | ||
| 371 | + <th>车号</th> | ||
| 372 | + <th>工号</th> | ||
| 373 | + <th>人名</th> | ||
| 374 | + <th>发车时间</th> | ||
| 375 | + <th>结束时间</th> | ||
| 376 | + <th>修改人</th> | ||
| 377 | + <th>修改时间</th> | ||
| 378 | + <th>修改原因</th> | ||
| 379 | + </tr> | ||
| 380 | +</thead> | ||
| 381 | +<tbody> | ||
| 382 | + {{each list as obj i}} | ||
| 383 | + <tr> | ||
| 384 | + <td>{{obj.lpName}}</td> | ||
| 385 | + <td>{{obj.clZbh}}</td> | ||
| 386 | + <td>{{obj.jGh}}</td> | ||
| 387 | + <td>{{obj.jName}}</td> | ||
| 388 | + <td>{{obj.fcsj}}</td> | ||
| 389 | + <td>{{obj.zdsj}}</td> | ||
| 390 | + <td>{{obj.updateBy}}</td> | ||
| 391 | + <td>{{obj.updateDate}}</td> | ||
| 392 | + <td>{{obj.remarks}}</td> | ||
| 393 | + </tr> | ||
| 394 | + {{/each}} | ||
| 395 | + {{if list.length == 0}} | ||
| 396 | + <tr> | ||
| 397 | + <td colspan="15"><h6 class="muted">没有找到相关数据</h6></td> | ||
| 398 | + </tr> | ||
| 399 | + {{/if}} | ||
| 400 | +</tbody> | ||
| 401 | +</script> |
src/main/resources/static/pages/forms/statement/firstAndLastBus.html
| @@ -27,13 +27,21 @@ | @@ -27,13 +27,21 @@ | ||
| 27 | <div class="portlet light porttlet-fit bordered"> | 27 | <div class="portlet light porttlet-fit bordered"> |
| 28 | <div class="portlet-title"> | 28 | <div class="portlet-title"> |
| 29 | <form id="history" class="form-inline" action=""> | 29 | <form id="history" class="form-inline" action=""> |
| 30 | - <div style="display: inline-block;"> | 30 | + <div style="display: inline-block;margin-left: 10px;" id="company1"> |
| 31 | + <span class="item-label" style="width: 80px;">公司: </span> | ||
| 32 | + <select class="form-control" name="company" id="company" style="width: 160px;"></select> | ||
| 33 | + </div> | ||
| 34 | + <div style="display: inline-block;margin-left: 10px;" id="subCompany1"> | ||
| 35 | + <span class="item-label" style="width: 80px;">分公司: </span> | ||
| 36 | + <select class="form-control" name="subCompany" id="subCompany" style="width: 160px;"></select> | ||
| 37 | + </div> | ||
| 38 | + <div style="display: inline-block;margin-left: 10px;"> | ||
| 31 | <span class="item-label" style="width: 80px;">线路: </span> | 39 | <span class="item-label" style="width: 80px;">线路: </span> |
| 32 | - <select class="form-control" name="line" id="line" style="width: 180px;"></select> | 40 | + <select class="form-control" name="line" id="line" style="width: 160px;"></select> |
| 33 | </div> | 41 | </div> |
| 34 | - <div style="display: inline-block;margin-left: 15px;"> | 42 | + <div style="display: inline-block;margin-left: 10px;"> |
| 35 | <span class="item-label" style="width: 80px;">时间: </span> | 43 | <span class="item-label" style="width: 80px;">时间: </span> |
| 36 | - <input class="form-control" type="text" id="date" style="width: 180px;"/> | 44 | + <input class="form-control" type="text" id="date" style="width: 160px;"/> |
| 37 | </div> | 45 | </div> |
| 38 | <div class="form-group"> | 46 | <div class="form-group"> |
| 39 | <input class="btn btn-default" type="button" id="query" value="筛选"/> | 47 | <input class="btn btn-default" type="button" id="query" value="筛选"/> |
| @@ -46,27 +54,29 @@ | @@ -46,27 +54,29 @@ | ||
| 46 | <table class="table table-bordered table-hover table-checkable" id="forms"> | 54 | <table class="table table-bordered table-hover table-checkable" id="forms"> |
| 47 | <thead> | 55 | <thead> |
| 48 | <tr class="hidden"> | 56 | <tr class="hidden"> |
| 49 | - <th width="100px" rowspan="2">日期</th> | ||
| 50 | - <th width="100px" rowspan="2">线路</th> | 57 | + <th rowspan="2">日期</th> |
| 58 | + <th rowspan="2">公司</th> | ||
| 59 | + <th rowspan="2">分公司</th> | ||
| 60 | + <th rowspan="2">线路</th> | ||
| 51 | <th colspan="4">上行首发</th> | 61 | <th colspan="4">上行首发</th> |
| 52 | <th colspan="4">上行末发</th> | 62 | <th colspan="4">上行末发</th> |
| 53 | <th colspan="4">下行首发</th> | 63 | <th colspan="4">下行首发</th> |
| 54 | <th colspan="4">下行末发</th> | 64 | <th colspan="4">下行末发</th> |
| 55 | </tr> | 65 | </tr> |
| 56 | <tr class="hidden"> | 66 | <tr class="hidden"> |
| 57 | - <th width="100px">站点</th> | 67 | + <th>站点</th> |
| 58 | <th>计发</th> | 68 | <th>计发</th> |
| 59 | <th>实发</th> | 69 | <th>实发</th> |
| 60 | <th>快慢</th> | 70 | <th>快慢</th> |
| 61 | - <th width="100px">站点</th> | 71 | + <th>站点</th> |
| 62 | <th>计发</th> | 72 | <th>计发</th> |
| 63 | <th>实发</th> | 73 | <th>实发</th> |
| 64 | <th>快慢</th> | 74 | <th>快慢</th> |
| 65 | - <th width="100px">站点</th> | 75 | + <th>站点</th> |
| 66 | <th>计发</th> | 76 | <th>计发</th> |
| 67 | <th>实发</th> | 77 | <th>实发</th> |
| 68 | <th>快慢</th> | 78 | <th>快慢</th> |
| 69 | - <th width="100px">站点</th> | 79 | + <th>站点</th> |
| 70 | <th>计发</th> | 80 | <th>计发</th> |
| 71 | <th>实发</th> | 81 | <th>实发</th> |
| 72 | <th>快慢</th> | 82 | <th>快慢</th> |
| @@ -107,45 +117,47 @@ | @@ -107,45 +117,47 @@ | ||
| 107 | $("#date").val(year + "-0" + month + "-" + day); | 117 | $("#date").val(year + "-0" + month + "-" + day); |
| 108 | } | 118 | } |
| 109 | 119 | ||
| 110 | - $('#line').select2({ | ||
| 111 | - ajax: { | ||
| 112 | - url: '/realSchedule/findLine', | ||
| 113 | - type: 'post', | ||
| 114 | - dataType: 'json', | ||
| 115 | - delay: 150, | ||
| 116 | - data: function(params){ | ||
| 117 | - return{line: params.term}; | ||
| 118 | - }, | ||
| 119 | - processResults: function (data) { | ||
| 120 | - return { | ||
| 121 | - results: data | ||
| 122 | - }; | ||
| 123 | - }, | ||
| 124 | - cache: true | ||
| 125 | - }, | ||
| 126 | - templateResult: function(repo){ | ||
| 127 | - if (repo.loading) return repo.text; | ||
| 128 | - var h = '<span>'+repo.text+'</span>'; | ||
| 129 | - return h; | ||
| 130 | - }, | ||
| 131 | - escapeMarkup: function (markup) { return markup; }, | ||
| 132 | - minimumInputLength: 1, | ||
| 133 | - templateSelection: function(repo){ | ||
| 134 | - return repo.text; | ||
| 135 | - }, | ||
| 136 | - language: { | ||
| 137 | - noResults: function(){ | ||
| 138 | - return '<span style="color:red;font-size: 12px;">没有搜索到线路!</span>'; | ||
| 139 | - }, | ||
| 140 | - inputTooShort : function(e) { | ||
| 141 | - return '<span style="color:gray;font-size: 12px;"><i class="fa fa-search"></i> 输入线路搜索线路</span>'; | ||
| 142 | - }, | ||
| 143 | - searching : function() { | ||
| 144 | - return '<span style="color:gray;font-size: 12px;"> 正在搜索线路...</span>'; | ||
| 145 | - } | 120 | + $.get('/basic/lineCode2Name',function(result){ |
| 121 | + var data=[]; | ||
| 122 | + | ||
| 123 | + for(var code in result){ | ||
| 124 | + data.push({id: code, text: result[code]}); | ||
| 146 | } | 125 | } |
| 126 | + console.log(data); | ||
| 127 | + initPinYinSelect2('#line',data,''); | ||
| 147 | }); | 128 | }); |
| 148 | 129 | ||
| 130 | + var obj = []; | ||
| 131 | + $.get('/user/companyData', function(result){ | ||
| 132 | + obj = result; | ||
| 133 | + var options = ''; | ||
| 134 | + for(var i = 0; i < obj.length; i++){ | ||
| 135 | + options += '<option value="'+obj[i].companyCode+'">'+obj[i].companyName+'</option>'; | ||
| 136 | + } | ||
| 137 | + if(obj.length == 1){ | ||
| 138 | + $('#company1').hide(); | ||
| 139 | + if(obj[0].children.length == 1) | ||
| 140 | + $('#subCompany1').hide(); | ||
| 141 | + } | ||
| 142 | + $('#company').html(options); | ||
| 143 | + updateCompany(); | ||
| 144 | + }); | ||
| 145 | + $("#company").on("change",updateCompany); | ||
| 146 | + function updateCompany(){ | ||
| 147 | + var company = $('#company').val(); | ||
| 148 | + var options = ''; | ||
| 149 | + for(var i = 0; i < obj.length; i++){ | ||
| 150 | + if(obj[i].companyCode == company){ | ||
| 151 | + var children = obj[i].children; | ||
| 152 | + for(var j = 0; j < children.length; j++){ | ||
| 153 | + options += '<option value="'+children[j].code+'">'+children[j].name+'</option>'; | ||
| 154 | + } | ||
| 155 | + } | ||
| 156 | + } | ||
| 157 | + $('#subCompany').html(options); | ||
| 158 | + } | ||
| 159 | + | ||
| 160 | + | ||
| 149 | $("#query").on("click",jsDoQuery); | 161 | $("#query").on("click",jsDoQuery); |
| 150 | 162 | ||
| 151 | var line = $("#line").val(); | 163 | var line = $("#line").val(); |
| @@ -181,6 +193,8 @@ | @@ -181,6 +193,8 @@ | ||
| 181 | {{each list as obj i}} | 193 | {{each list as obj i}} |
| 182 | <tr> | 194 | <tr> |
| 183 | <td>{{obj.date}}</td> | 195 | <td>{{obj.date}}</td> |
| 196 | + <td>{{obj.company}}</td> | ||
| 197 | + <td>{{obj.subCompany}}</td> | ||
| 184 | <td>{{obj.line}}</td> | 198 | <td>{{obj.line}}</td> |
| 185 | <td>{{obj.qdzFirst0}}</td> | 199 | <td>{{obj.qdzFirst0}}</td> |
| 186 | <td>{{obj.jhfcFirst0}}</td> | 200 | <td>{{obj.jhfcFirst0}}</td> |
| @@ -202,7 +216,7 @@ | @@ -202,7 +216,7 @@ | ||
| 202 | {{/each}} | 216 | {{/each}} |
| 203 | {{if list.length == 0}} | 217 | {{if list.length == 0}} |
| 204 | <tr> | 218 | <tr> |
| 205 | - <td colspan="18"><h6 class="muted">没有找到相关数据</h6></td> | 219 | + <td colspan="20"><h6 class="muted">没有找到相关数据</h6></td> |
| 206 | </tr> | 220 | </tr> |
| 207 | {{/if}} | 221 | {{/if}} |
| 208 | </script> | 222 | </script> |
| 209 | \ No newline at end of file | 223 | \ No newline at end of file |
src/main/resources/static/pages/forms/statement/lbStatuAnaly.html
0 → 100644
| 1 | +<style type="text/css"> | ||
| 2 | + .table-bordered { | ||
| 3 | + border: 1px solid; } | ||
| 4 | + .table-bordered > thead > tr > th, | ||
| 5 | + .table-bordered > thead > tr > td, | ||
| 6 | + .table-bordered > tbody > tr > th, | ||
| 7 | + .table-bordered > tbody > tr > td, | ||
| 8 | + .table-bordered > tfoot > tr > th, | ||
| 9 | + .table-bordered > tfoot > tr > td { | ||
| 10 | + border: 1px solid; } | ||
| 11 | + .table-bordered > thead > tr > th, | ||
| 12 | + .table-bordered > thead > tr > td { | ||
| 13 | + border-bottom-width: 2px; } | ||
| 14 | + .table > tbody + tbody { | ||
| 15 | + border-top: 1px solid; } | ||
| 16 | + #forms > tbody > tr{ | ||
| 17 | + background-color: #FFFFFF; | ||
| 18 | + } | ||
| 19 | +</style> | ||
| 20 | + | ||
| 21 | +<div class="page-head"> | ||
| 22 | + <div class="page-title"> | ||
| 23 | + <h1>烂班情况分析表</h1> | ||
| 24 | + </div> | ||
| 25 | +</div> | ||
| 26 | + | ||
| 27 | +<div class="row"> | ||
| 28 | + <div class="col-md-12"> | ||
| 29 | + <div class="portlet light porttlet-fit bordered"> | ||
| 30 | + <div class="portlet-title"> | ||
| 31 | + <form id="history" class="form-inline" action=""> | ||
| 32 | + <div style="display: inline-block;margin-left: 5px;"> | ||
| 33 | + <span class="item-label" style="width: 80px;">烂班原因: </span> | ||
| 34 | + <input class="form-control" type="checkbox" id="totalLb" style="width: 20px;" checked="true"/>全选 | ||
| 35 | + <input class="form-control" type="checkbox" name="reason" style="width: 20px;" value="0" checked="true"/>路阻 | ||
| 36 | + <input class="form-control" type="checkbox" name="reason" style="width: 20px;" value="1" checked="true"/>吊慢 | ||
| 37 | + <input class="form-control" type="checkbox" name="reason" style="width: 20px;" value="2" checked="true"/>故障 | ||
| 38 | + <input class="form-control" type="checkbox" name="reason" style="width: 20px;" value="3" checked="true"/>纠纷 | ||
| 39 | + <input class="form-control" type="checkbox" name="reason" style="width: 20px;" value="4" checked="true"/>肇事 | ||
| 40 | + <input class="form-control" type="checkbox" name="reason" style="width: 20px;" value="5" checked="true"/>缺人 | ||
| 41 | + <input class="form-control" type="checkbox" name="reason" style="width: 20px;" value="6" checked="true"/>缺车 | ||
| 42 | + <input class="form-control" type="checkbox" name="reason" style="width: 20px;" value="7" checked="true"/>客稀 | ||
| 43 | + <input class="form-control" type="checkbox" name="reason" style="width: 20px;" value="8" checked="true"/>气候 | ||
| 44 | + <input class="form-control" type="checkbox" name="reason" style="width: 20px;" value="9" checked="true"/>外援 | ||
| 45 | + <input class="form-control" type="checkbox" name="reason" style="width: 20px;" value="10" checked="true"/>其他 | ||
| 46 | + </div> | ||
| 47 | + <div style="margin-top: 5px"></div> | ||
| 48 | + <div style="display: inline-block; margin-left: 33px;" id="company1"> | ||
| 49 | + <span class="item-label" style="width: 80px;">公司: </span> | ||
| 50 | + <select class="form-control" name="company" id="company" style="width: 140px;"></select> | ||
| 51 | + </div> | ||
| 52 | + <div style="display: inline-block; margin-left: 24px;" id="subCompany1"> | ||
| 53 | + <span class="item-label" style="width: 80px;">分公司: </span> | ||
| 54 | + <select class="form-control" name="subCompany" id="subCompany" style="width: 140px;"></select> | ||
| 55 | + </div> | ||
| 56 | + <div style="display: inline-block; margin-left: 24px;"> | ||
| 57 | + <span class="item-label" style="width: 80px;">线路: </span> | ||
| 58 | + <select class="form-control" name="line" id="line" style="width: 140px;"></select> | ||
| 59 | + </div> | ||
| 60 | + <div style="display: inline-block; margin-left: 10px"> | ||
| 61 | + <span class="item-label" style="width: 80px;">时刻类型: </span> | ||
| 62 | + <select class="form-control" name="model" id="model" style="width: 165px;"> | ||
| 63 | + <option value="">请选择...</option> | ||
| 64 | + </select> | ||
| 65 | + </div> | ||
| 66 | + <div style="margin-top: 10px"></div> | ||
| 67 | + <div style="display: inline-block;margin-left: 5px;"> | ||
| 68 | + <span class="item-label" style="width: 80px;">开始时间: </span> | ||
| 69 | + <input class="form-control" type="text" id="startDate" style="width: 140px;"/> | ||
| 70 | + </div> | ||
| 71 | + <div style="display: inline-block;margin-left: 10px;"> | ||
| 72 | + <span class="item-label" style="width: 80px;">结束时间: </span> | ||
| 73 | + <input class="form-control" type="text" id="endDate" style="width: 140px;"/> | ||
| 74 | + </div> | ||
| 75 | + <div style="display: inline-block;margin-left: 10px;"> | ||
| 76 | + <span class="item-label" style="width: 80px;">时间段: </span> | ||
| 77 | + <input class="form-control" type="text" id="times1" style="width: 60px;"/> | ||
| 78 | + </div> | ||
| 79 | + <div style="display: inline-block;"> | ||
| 80 | + <span class="item-label" style="width: 80px;"> - </span> | ||
| 81 | + <input class="form-control" type="text" id="times2" style="width: 60px;"/> | ||
| 82 | + </div> | ||
| 83 | + <div class="form-group" style="margin-left: 10px"> | ||
| 84 | + <input class="btn btn-default" type="button" id="query" value="筛选"/> | ||
| 85 | +<!-- <input class="btn btn-default" type="button" id="export" value="导出"/> --> | ||
| 86 | + </div> | ||
| 87 | + </form> | ||
| 88 | + </div> | ||
| 89 | + <div class="portlet-body"> | ||
| 90 | + <div class="table-container" style="margin-top: 10px;overflow:auto;min-width: 906px"> | ||
| 91 | + <table class="table table-bordered table-hover table-checkable" id="forms"> | ||
| 92 | + <thead> | ||
| 93 | + | ||
| 94 | + </thead> | ||
| 95 | + <tbody> | ||
| 96 | + | ||
| 97 | + </tbody> | ||
| 98 | + </table> | ||
| 99 | + <div style="text-align: right;"> | ||
| 100 | + <ul id="pagination" class="pagination"></ul> | ||
| 101 | + </div> | ||
| 102 | + </div> | ||
| 103 | + </div> | ||
| 104 | + </div> | ||
| 105 | + </div> | ||
| 106 | +</div> | ||
| 107 | + | ||
| 108 | +<script> | ||
| 109 | + $(function(){ | ||
| 110 | + | ||
| 111 | + | ||
| 112 | + // 关闭左侧栏 | ||
| 113 | + if (!$('body').hasClass('page-sidebar-closed')) | ||
| 114 | + $('.menu-toggler.sidebar-toggler').click(); | ||
| 115 | + | ||
| 116 | + $("#startDate").datetimepicker({ | ||
| 117 | + format : 'YYYY-MM-DD', | ||
| 118 | + locale : 'zh-cn' | ||
| 119 | + }); | ||
| 120 | + $("#endDate").datetimepicker({ | ||
| 121 | + format : 'YYYY-MM-DD', | ||
| 122 | + locale : 'zh-cn' | ||
| 123 | + }); | ||
| 124 | + $("#times1").datetimepicker({ | ||
| 125 | + format : 'HH:mm', | ||
| 126 | + locale : 'zh-cn' | ||
| 127 | + }); | ||
| 128 | + $("#times2").datetimepicker({ | ||
| 129 | + format : 'HH:mm', | ||
| 130 | + locale : 'zh-cn' | ||
| 131 | + }); | ||
| 132 | + | ||
| 133 | + var d = new Date(); | ||
| 134 | + var year = d.getFullYear(); | ||
| 135 | + var month = d.getMonth() + 1; | ||
| 136 | + var day = d.getDate(); | ||
| 137 | + if(month > 9){ | ||
| 138 | + $("#startDate").val(year + "-" + month + "-" + day); | ||
| 139 | + $("#endDate").val(year + "-" + month + "-" + day); | ||
| 140 | + } else { | ||
| 141 | + $("#startDate").val(year + "-0" + month + "-" + day); | ||
| 142 | + $("#endDate").val(year + "-0" + month + "-" + day); | ||
| 143 | + } | ||
| 144 | + $("#times1").val("06:00"); | ||
| 145 | + $("#times2").val("07:00"); | ||
| 146 | + | ||
| 147 | + $.get('/basic/lineCode2Name', function(result){ | ||
| 148 | + var data=[]; | ||
| 149 | + | ||
| 150 | + data.push({id: " ", text: "全部线路"}); | ||
| 151 | + for(var code in result){ | ||
| 152 | + data.push({id: code, text: result[code]}); | ||
| 153 | + } | ||
| 154 | + console.log(data); | ||
| 155 | + initPinYinSelect2('#line',data,''); | ||
| 156 | + | ||
| 157 | + line = ""; | ||
| 158 | + updateModel(); | ||
| 159 | + }) | ||
| 160 | + | ||
| 161 | + var obj = []; | ||
| 162 | + $.get('/user/companyData', function(result){ | ||
| 163 | + obj = result; | ||
| 164 | + var options = ''; | ||
| 165 | + for(var i = 0; i < obj.length; i++){ | ||
| 166 | + options += '<option value="'+obj[i].companyCode+'">'+obj[i].companyName+'</option>'; | ||
| 167 | + } | ||
| 168 | + if(obj.length == 1){ | ||
| 169 | + $('#company1').hide(); | ||
| 170 | + if(obj[0].children.length == 1) | ||
| 171 | + $('#subCompany1').hide(); | ||
| 172 | + } | ||
| 173 | + $('#company').html(options); | ||
| 174 | + updateCompany(); | ||
| 175 | + }); | ||
| 176 | + | ||
| 177 | + $("#company").on("change",updateCompany); | ||
| 178 | + function updateCompany(){ | ||
| 179 | + var company = $('#company').val(); | ||
| 180 | + var options = ''; | ||
| 181 | + for(var i = 0; i < obj.length; i++){ | ||
| 182 | + if(obj[i].companyCode == company){ | ||
| 183 | + var children = obj[i].children; | ||
| 184 | + for(var j = 0; j < children.length; j++){ | ||
| 185 | + options += '<option value="'+children[j].code+'">'+children[j].name+'</option>'; | ||
| 186 | + } | ||
| 187 | + } | ||
| 188 | + } | ||
| 189 | + $('#subCompany').html(options); | ||
| 190 | + } | ||
| 191 | + | ||
| 192 | + var lb = 0; //标志是否有选择至少一个烂班类型 | ||
| 193 | + $("#totalLb").on("change", function(){ | ||
| 194 | + var reason = $("input[name='reason']"); | ||
| 195 | + var checked = this.checked; | ||
| 196 | + $.each(reason, function(i, g){ | ||
| 197 | + g.checked = checked; | ||
| 198 | + }); | ||
| 199 | + if(checked == true) | ||
| 200 | + lb = 30; | ||
| 201 | + else | ||
| 202 | + lb = 0; | ||
| 203 | + }); | ||
| 204 | + | ||
| 205 | + $("input[name='reason']").on("change", function(){ | ||
| 206 | + var totalLb = $("#totalLb")[0]; | ||
| 207 | + totalLb.checked = true; | ||
| 208 | + lb = 0; | ||
| 209 | + $.each($("input[name='reason']"), function(i, g){ | ||
| 210 | + if(g.checked == false){ | ||
| 211 | + totalLb.checked = false; | ||
| 212 | + }else{ | ||
| 213 | + lb += 3; | ||
| 214 | + } | ||
| 215 | + }); | ||
| 216 | + }); | ||
| 217 | + | ||
| 218 | + $("#query").on("click",jsDoQuery); | ||
| 219 | + | ||
| 220 | + var line = $("#line").val(); | ||
| 221 | + var startDate = $("#startDate").val(); | ||
| 222 | + var endDate = $("#endDate").val(); | ||
| 223 | + var model = $("#model").val(); | ||
| 224 | + var times = $("#times1").val() + "-" + $("#times2").val(); | ||
| 225 | + function jsDoQuery(pagination){ | ||
| 226 | + var reason = $("input[name='reason']"); | ||
| 227 | + var params = {}; | ||
| 228 | +// line = $("#line").val(); | ||
| 229 | + startDate = $("#startDate").val(); | ||
| 230 | + endDate = $("#endDate").val(); | ||
| 231 | + model = $("#model").val(); | ||
| 232 | + times = $("#times1").val() + "-" + $("#times2").val(); | ||
| 233 | + params['line'] = line; | ||
| 234 | + params['startDate'] = startDate; | ||
| 235 | + params['endDate'] = endDate; | ||
| 236 | + params['model'] = model; | ||
| 237 | + params['times'] = times; | ||
| 238 | + params['type'] = "query"; | ||
| 239 | +// $(".hidden").removeClass("hidden"); | ||
| 240 | + $get('/busInterval/lbStatuAnaly', params, function(result){ | ||
| 241 | + // 把数据填充到模版中 | ||
| 242 | + var tbodyHtml = template('list_lbAnaly',{list:result, reason:reason, lb:lb}); | ||
| 243 | + // 把渲染好的模版html文本追加到表格中 | ||
| 244 | + $('#forms').html(tbodyHtml); | ||
| 245 | + _w_table_rowspan("#forms", 1); | ||
| 246 | + _w_table_rowspan("#forms", 2); | ||
| 247 | + _w_table_rowspan("#forms", 3); | ||
| 248 | + _w_table_rowspan("#forms", 4); | ||
| 249 | + _w_table_rowspan("#forms", 5); | ||
| 250 | + }); | ||
| 251 | + } | ||
| 252 | + | ||
| 253 | + $("#export").on("click", function(){ | ||
| 254 | + $get('/pcpc/workDaily',{line:line,date:date,type:'export'},function(result){ | ||
| 255 | + window.open("/downloadFile/download?fileName=营运服务日报表"+moment(date).format("YYYYMMDD")); | ||
| 256 | + }); | ||
| 257 | + }); | ||
| 258 | + | ||
| 259 | + | ||
| 260 | + $("#line").on("change", function(){ | ||
| 261 | + line = $("#line").val(); | ||
| 262 | + if(line == " ") | ||
| 263 | + line = ""; | ||
| 264 | + updateModel(); | ||
| 265 | + }); | ||
| 266 | + $('#startDate').on("blur", function(){ | ||
| 267 | + startDate = $("#startDate").val(); | ||
| 268 | + endDate = $("#endDate").val(); | ||
| 269 | + updateModel(); | ||
| 270 | + }); | ||
| 271 | + $('#endDate').on("blur", function(){ | ||
| 272 | + startDate = $("#startDate").val(); | ||
| 273 | + endDate = $("#endDate").val(); | ||
| 274 | + updateModel(); | ||
| 275 | + }); | ||
| 276 | + | ||
| 277 | + var flag = 0; | ||
| 278 | + function updateModel(){ | ||
| 279 | + if(flag == 1) | ||
| 280 | + return; | ||
| 281 | + flag = 1; | ||
| 282 | + var treeData = []; | ||
| 283 | + var params = {}; | ||
| 284 | + params['line'] = line; | ||
| 285 | + params['startDate'] = startDate; | ||
| 286 | + params['endDate'] = endDate; | ||
| 287 | + $get('/pcpc/getModel', params, function(result){ | ||
| 288 | + treeData = createTreeData(result); | ||
| 289 | + var options = '<option value="">请选择...</option>'; | ||
| 290 | + $.each(treeData, function(i, g){ | ||
| 291 | + options += '<option value="'+g.id+'">'+g.name+'</option>'; | ||
| 292 | + }); | ||
| 293 | + $('#model').html(options)/* .select2() */; | ||
| 294 | + flag = 0; | ||
| 295 | + }); | ||
| 296 | + } | ||
| 297 | + | ||
| 298 | + | ||
| 299 | + function _w_table_rowspan(_w_table_id, _w_table_colnum){ | ||
| 300 | + _w_table_firsttd = ""; | ||
| 301 | + _w_table_currenttd = ""; | ||
| 302 | + _w_table_SpanNum = 0; | ||
| 303 | + _w_table_Obj = jQuery(_w_table_id + " tr td:nth-child(" + _w_table_colnum + ")"); | ||
| 304 | + _w_table_Obj.each(function(i){ | ||
| 305 | + if(i==0){ | ||
| 306 | + _w_table_firsttd = jQuery(this); | ||
| 307 | + _w_table_SpanNum = 1; | ||
| 308 | + }else{ | ||
| 309 | + _w_table_currenttd = jQuery(this); | ||
| 310 | + if(_w_table_firsttd.text()==_w_table_currenttd.text()){ | ||
| 311 | + _w_table_SpanNum++; | ||
| 312 | + _w_table_currenttd.hide(); //remove(); | ||
| 313 | + _w_table_firsttd.attr("rowSpan",_w_table_SpanNum); | ||
| 314 | + }else{ | ||
| 315 | + _w_table_firsttd = jQuery(this); | ||
| 316 | + _w_table_SpanNum = 1; | ||
| 317 | + } | ||
| 318 | + } | ||
| 319 | + }); | ||
| 320 | + } | ||
| 321 | + | ||
| 322 | + | ||
| 323 | + }); | ||
| 324 | + | ||
| 325 | +</script> | ||
| 326 | +<script type="text/html" id="list_lbAnaly"> | ||
| 327 | +<thead> | ||
| 328 | + <tr> | ||
| 329 | + <th class="hidden"></th> | ||
| 330 | + <th rowspan="3">日期</th> | ||
| 331 | + <th rowspan="3">时段</th> | ||
| 332 | + <th rowspan="3">公司</th> | ||
| 333 | + <th rowspan="3">分公司</th> | ||
| 334 | + <th rowspan="3">线路</th> | ||
| 335 | + <th rowspan="2" colspan="3">总班次</th> | ||
| 336 | + <th rowspan="2" colspan="3">总营运公里</th> | ||
| 337 | + {{if lb != 0}} | ||
| 338 | + <th colspan={{lb}}>烂班原因</th> | ||
| 339 | + {{/if}} | ||
| 340 | + </tr> | ||
| 341 | + <tr> | ||
| 342 | + <th class="hidden"></th> | ||
| 343 | + {{if reason[0].checked == true}}<th colspan="3">路阻</th>{{/if}} | ||
| 344 | + {{if reason[1].checked == true}}<th colspan="3">吊慢</th>{{/if}} | ||
| 345 | + {{if reason[2].checked == true}}<th colspan="3">故障</th>{{/if}} | ||
| 346 | + {{if reason[3].checked == true}}<th colspan="3">纠纷</th>{{/if}} | ||
| 347 | + {{if reason[4].checked == true}}<th colspan="3">肇事</th>{{/if}} | ||
| 348 | + {{if reason[5].checked == true}}<th colspan="3">缺人</th>{{/if}} | ||
| 349 | + {{if reason[6].checked == true}}<th colspan="3">缺车</th>{{/if}} | ||
| 350 | + {{if reason[7].checked == true}}<th colspan="3">客稀</th>{{/if}} | ||
| 351 | + {{if reason[8].checked == true}}<th colspan="3">气候</th>{{/if}} | ||
| 352 | + {{if reason[9].checked == true}}<th colspan="3">外援</th>{{/if}} | ||
| 353 | + {{if reason[10].checked == true}}<th colspan="3">其他</th>{{/if}} | ||
| 354 | + </tr> | ||
| 355 | + <tr> | ||
| 356 | + <th class="hidden"></th> | ||
| 357 | + <th>计划</th><th>实际</th><th>百分比</th> | ||
| 358 | + <th>计划</th><th>实际</th><th>百分比</th> | ||
| 359 | + {{if reason[0].checked==true}}<th>烂班班次</th><th>烂班公里</th><th>百分比</th>{{/if}} | ||
| 360 | + {{if reason[1].checked==true}}<th>烂班班次</th><th>烂班公里</th><th>百分比</th>{{/if}} | ||
| 361 | + {{if reason[2].checked==true}}<th>烂班班次</th><th>烂班公里</th><th>百分比</th>{{/if}} | ||
| 362 | + {{if reason[3].checked==true}}<th>烂班班次</th><th>烂班公里</th><th>百分比</th>{{/if}} | ||
| 363 | + {{if reason[4].checked==true}}<th>烂班班次</th><th>烂班公里</th><th>百分比</th>{{/if}} | ||
| 364 | + {{if reason[5].checked==true}}<th>烂班班次</th><th>烂班公里</th><th>百分比</th>{{/if}} | ||
| 365 | + {{if reason[6].checked==true}}<th>烂班班次</th><th>烂班公里</th><th>百分比</th>{{/if}} | ||
| 366 | + {{if reason[7].checked==true}}<th>烂班班次</th><th>烂班公里</th><th>百分比</th>{{/if}} | ||
| 367 | + {{if reason[8].checked==true}}<th>烂班班次</th><th>烂班公里</th><th>百分比</th>{{/if}} | ||
| 368 | + {{if reason[9].checked==true}}<th>烂班班次</th><th>烂班公里</th><th>百分比</th>{{/if}} | ||
| 369 | + {{if reason[10].checked==true}}<th>烂班班次</th><th>烂班公里</th><th>百分比</th>{{/if}} | ||
| 370 | + </tr> | ||
| 371 | +</thead> | ||
| 372 | +<tbody> | ||
| 373 | + {{each list as obj i}} | ||
| 374 | + <tr> | ||
| 375 | + <td>{{obj.date}}</td> | ||
| 376 | + <td>{{obj.times}}</td> | ||
| 377 | + <td>{{obj.company}}</td> | ||
| 378 | + <td>{{obj.subCompany}}</td> | ||
| 379 | + <td>{{obj.line}}</td> | ||
| 380 | + <td>{{obj.jhbc}}</td><td>{{obj.sjbc}}</td><td>{{obj.bcbfb}}</td> | ||
| 381 | + <td>{{obj.jhlc}}</td><td>{{obj.sjlc}}</td><td>{{obj.lcbfb}}</td> | ||
| 382 | + {{if reason[0].checked==true}}<td>{{obj.lzbc}}</td><td>{{obj.lzlc}}</td><td>{{obj.lzbfb}}</td>{{/if}} | ||
| 383 | + {{if reason[1].checked==true}}<td>{{obj.dmbc}}</td><td>{{obj.dmlc}}</td><td>{{obj.dmbfb}}</td>{{/if}} | ||
| 384 | + {{if reason[2].checked==true}}<td>{{obj.gzbc}}</td><td>{{obj.gzlc}}</td><td>{{obj.gzbfb}}</td>{{/if}} | ||
| 385 | + {{if reason[3].checked==true}}<td>{{obj.jfbc}}</td><td>{{obj.jflc}}</td><td>{{obj.jfbfb}}</td>{{/if}} | ||
| 386 | + {{if reason[4].checked==true}}<td>{{obj.zsbc}}</td><td>{{obj.zslc}}</td><td>{{obj.zsbfb}}</td>{{/if}} | ||
| 387 | + {{if reason[5].checked==true}}<td>{{obj.qrbc}}</td><td>{{obj.qrlc}}</td><td>{{obj.qrbfb}}</td>{{/if}} | ||
| 388 | + {{if reason[6].checked==true}}<td>{{obj.qcbc}}</td><td>{{obj.qclc}}</td><td>{{obj.qcbfb}}</td>{{/if}} | ||
| 389 | + {{if reason[7].checked==true}}<td>{{obj.kxbc}}</td><td>{{obj.kxlc}}</td><td>{{obj.kxbfb}}</td>{{/if}} | ||
| 390 | + {{if reason[8].checked==true}}<td>{{obj.qhbc}}</td><td>{{obj.qhlc}}</td><td>{{obj.qhbfb}}</td>{{/if}} | ||
| 391 | + {{if reason[9].checked==true}}<td>{{obj.wybc}}</td><td>{{obj.wylc}}</td><td>{{obj.wybfb}}</td>{{/if}} | ||
| 392 | + {{if reason[10].checked==true}}<td>{{obj.qtbc}}</td><td>{{obj.qtlc}}</td><td>{{obj.qtbfb}}</td>{{/if}} | ||
| 393 | + </tr> | ||
| 394 | + {{/each}} | ||
| 395 | + {{if list.length == 0}} | ||
| 396 | + <tr> | ||
| 397 | + <td colspan="44"><h6 class="muted">没有找到相关数据</h6></td> | ||
| 398 | + </tr> | ||
| 399 | + {{/if}} | ||
| 400 | +</tbody> | ||
| 401 | +</script> | ||
| 0 | \ No newline at end of file | 402 | \ No newline at end of file |
src/main/resources/static/pages/forms/statement/lineTimeAnaly.html
0 → 100644
| 1 | +<style type="text/css"> | ||
| 2 | + .table-bordered { | ||
| 3 | + border: 1px solid; } | ||
| 4 | + .table-bordered > thead > tr > th, | ||
| 5 | + .table-bordered > thead > tr > td, | ||
| 6 | + .table-bordered > tbody > tr > th, | ||
| 7 | + .table-bordered > tbody > tr > td, | ||
| 8 | + .table-bordered > tfoot > tr > th, | ||
| 9 | + .table-bordered > tfoot > tr > td { | ||
| 10 | + border: 1px solid; } | ||
| 11 | + .table-bordered > thead > tr > th, | ||
| 12 | + .table-bordered > thead > tr > td { | ||
| 13 | + border-bottom-width: 2px; } | ||
| 14 | + .table > tbody + tbody { | ||
| 15 | + border-top: 1px solid; } | ||
| 16 | + .merge{ | ||
| 17 | + text-align:center; | ||
| 18 | + vertical-align:middle; | ||
| 19 | + } | ||
| 20 | + #works > tbody > tr{ | ||
| 21 | + background-color: #FFFFFF; | ||
| 22 | + } | ||
| 23 | +</style> | ||
| 24 | + | ||
| 25 | +<div class="page-head"> | ||
| 26 | + <div class="page-title"> | ||
| 27 | + <h1>线路时刻分析</h1> | ||
| 28 | + </div> | ||
| 29 | +</div> | ||
| 30 | + | ||
| 31 | +<div class="row"> | ||
| 32 | + <div class="col-md-12"> | ||
| 33 | + <div class="portlet light porttlet-fit bordered"> | ||
| 34 | + <div class="portlet-title"> | ||
| 35 | + <form id="history" class="form-inline" action=""> | ||
| 36 | + <div style="display: inline-block; margin-left: 33px;" id="company1"> | ||
| 37 | + <span class="item-label" style="width: 80px;">公司: </span> | ||
| 38 | + <select class="form-control" name="company" id="company" style="width: 140px;"></select> | ||
| 39 | + </div> | ||
| 40 | + <div style="display: inline-block; margin-left: 24px;" id="subCompany1"> | ||
| 41 | + <span class="item-label" style="width: 80px;">分公司: </span> | ||
| 42 | + <select class="form-control" name="subCompany" id="subCompany" style="width: 140px;"></select> | ||
| 43 | + </div> | ||
| 44 | + <div style="display: inline-block; margin-left: 24px;"> | ||
| 45 | + <span class="item-label" style="width: 80px;">线路: </span> | ||
| 46 | + <select class="form-control" name="line" id="line" style="width: 140px;"></select> | ||
| 47 | + </div> | ||
| 48 | + <div style="display: inline-block; margin-left: 15px;"> | ||
| 49 | + <span class="item-label" style="width: 80px;">方向: </span> | ||
| 50 | + <select class="form-control" name="upDown" id="upDown" style="width: 140px;"> | ||
| 51 | + <option value="">请先选择线路</option> | ||
| 52 | + </select> | ||
| 53 | + </div> | ||
| 54 | + <div style="display: inline-block; margin-left: 10px"> | ||
| 55 | + <span class="item-label" style="width: 80px;">时刻类型: </span> | ||
| 56 | + <select class="form-control" name="model" id="model" style="width: 165px;"> | ||
| 57 | + <option value="">请选择...</option> | ||
| 58 | + </select> | ||
| 59 | + </div> | ||
| 60 | + <div style="margin-top: 10px"></div> | ||
| 61 | + <div style="display: inline-block;margin-left: 5px;"> | ||
| 62 | + <span class="item-label" style="width: 80px;">开始时间: </span> | ||
| 63 | + <input class="form-control" type="text" id="startDate" style="width: 140px;"/> | ||
| 64 | + </div> | ||
| 65 | + <div style="display: inline-block;margin-left: 10px;"> | ||
| 66 | + <span class="item-label" style="width: 80px;">结束时间: </span> | ||
| 67 | + <input class="form-control" type="text" id="endDate" style="width: 140px;"/> | ||
| 68 | + </div> | ||
| 69 | + <div style="display: inline-block;margin-left: 10px;"> | ||
| 70 | + <span class="item-label" style="width: 80px;">时间段: </span> | ||
| 71 | + <input class="form-control" type="text" id="times1" style="width: 60px;"/> | ||
| 72 | + </div> | ||
| 73 | + <div style="display: inline-block;"> | ||
| 74 | + <span class="item-label" style="width: 80px;"> - </span> | ||
| 75 | + <input class="form-control" type="text" id="times2" style="width: 60px;"/> | ||
| 76 | + </div> | ||
| 77 | + <div class="form-group" style="margin-left: 10px"> | ||
| 78 | + <input class="btn btn-default" type="button" id="query" value="筛选"/> | ||
| 79 | +<!-- <input class="btn btn-default" type="button" id="export" value="导出"/> --> | ||
| 80 | + </div> | ||
| 81 | + </form> | ||
| 82 | + </div> | ||
| 83 | + <div class="portlet-body"> | ||
| 84 | + <div class="row"> | ||
| 85 | + <div class="col-md-4"> | ||
| 86 | + <div class="table-container" style="margin-top: 10px;overflow:auto;min-width: 320px;"> | ||
| 87 | + <table class="table table-bordered table-hover table-checkable" id="forms"> | ||
| 88 | + <thead> | ||
| 89 | + <tr class="hidden"> | ||
| 90 | + <th >公司</th> | ||
| 91 | + <th width="30%">日期分段</th> | ||
| 92 | + <th >时段</th> | ||
| 93 | + <th width="20%">线路</th> | ||
| 94 | + <th >路牌</th> | ||
| 95 | + <th width="20%">站点</th> | ||
| 96 | + <th >计划发车班次数</th> | ||
| 97 | + <th>实际完成班次数</th> | ||
| 98 | + </tr> | ||
| 99 | + </thead> | ||
| 100 | + <tbody> | ||
| 101 | + | ||
| 102 | + </tbody> | ||
| 103 | + </table> | ||
| 104 | + </div> | ||
| 105 | + </div> | ||
| 106 | + <div id="works_hidden" class="hidden"> | ||
| 107 | + <span class="item-label" style="width: 80px;margin-left: 30px;">明细: </span> | ||
| 108 | + <span class="item-label" style="width: 80px;margin-left: 30px;">日期: </span> | ||
| 109 | + <span class="item-label" style="width: 80px;" id="date1"></span> | ||
| 110 | + <span class="item-label" style="width: 80px;margin-left: 40px;">线路: </span> | ||
| 111 | + <span class="item-label" style="width: 80px;" id="line1"></span> | ||
| 112 | + <span class="item-label" style="width: 80px;margin-left: 40px;">路牌: </span> | ||
| 113 | + <span class="item-label" style="width: 80px;" id="lp1"></span> | ||
| 114 | + <span class="item-label" style="width: 80px;margin-left: 40px;">站点: </span> | ||
| 115 | + <span class="item-label" style="width: 80px;" id="station1"></span> | ||
| 116 | + </div> | ||
| 117 | + <div class="col-md-8" id="printArea"> | ||
| 118 | + <table class="table table-bordered table-hover table-checkable" id="works"> | ||
| 119 | + <thead> | ||
| 120 | + <tr class="hidden"> | ||
| 121 | + <th rowspan="2">日期</th> | ||
| 122 | + <th colspan="4">到达时间</th> | ||
| 123 | + <th colspan="4">发车时间</th> | ||
| 124 | + <th colspan="2">误点率</th> | ||
| 125 | + <th colspan="5">运送时间</th> | ||
| 126 | + <th colspan="5">停站时间</th> | ||
| 127 | + </tr> | ||
| 128 | + <tr class="hidden"> | ||
| 129 | + <th>计划</th> | ||
| 130 | + <th>实际</th> | ||
| 131 | + <th>平均提前</th> | ||
| 132 | + <th>平均延误</th> | ||
| 133 | + <th>计划</th> | ||
| 134 | + <th>实际</th> | ||
| 135 | + <th>平均提前</th> | ||
| 136 | + <th>平均延误</th> | ||
| 137 | + <th>快</th> | ||
| 138 | + <th>慢</th> | ||
| 139 | + <th>计划</th> | ||
| 140 | + <th>实际</th> | ||
| 141 | + <th>最快</th> | ||
| 142 | + <th>最慢</th> | ||
| 143 | + <th>平均</th> | ||
| 144 | + <th>计划</th> | ||
| 145 | + <th>实际</th> | ||
| 146 | + <th>最大</th> | ||
| 147 | + <th>最小</th> | ||
| 148 | + <th>平均</th> | ||
| 149 | + </tr> | ||
| 150 | + </thead> | ||
| 151 | + <tbody> | ||
| 152 | + | ||
| 153 | + </tbody> | ||
| 154 | + </table> | ||
| 155 | + </div> | ||
| 156 | + <div style="text-align: right;"> | ||
| 157 | + <ul id="pagination" class="pagination"></ul> | ||
| 158 | + </div> | ||
| 159 | + </div> | ||
| 160 | + </div> | ||
| 161 | + </div> | ||
| 162 | + </div> | ||
| 163 | +</div> | ||
| 164 | + | ||
| 165 | +<script> | ||
| 166 | + $(function(){ | ||
| 167 | + var list; | ||
| 168 | + | ||
| 169 | + // 关闭左侧栏 | ||
| 170 | + if (!$('body').hasClass('page-sidebar-closed')) | ||
| 171 | + $('.menu-toggler.sidebar-toggler').click(); | ||
| 172 | + | ||
| 173 | + $("#startDate").datetimepicker({ | ||
| 174 | + format : 'YYYY-MM-DD', | ||
| 175 | + locale : 'zh-cn' | ||
| 176 | + }); | ||
| 177 | + $("#endDate").datetimepicker({ | ||
| 178 | + format : 'YYYY-MM-DD', | ||
| 179 | + locale : 'zh-cn' | ||
| 180 | + }); | ||
| 181 | + | ||
| 182 | + $("#times1").datetimepicker({ | ||
| 183 | + format : 'HH:mm', | ||
| 184 | + locale : 'zh-cn' | ||
| 185 | + }); | ||
| 186 | + $("#times2").datetimepicker({ | ||
| 187 | + format : 'HH:mm', | ||
| 188 | + locale : 'zh-cn' | ||
| 189 | + }); | ||
| 190 | + | ||
| 191 | + var d = new Date(); | ||
| 192 | + var year = d.getFullYear(); | ||
| 193 | + var month = d.getMonth() + 1; | ||
| 194 | + var day = d.getDate(); | ||
| 195 | + if(month > 9){ | ||
| 196 | + $("#startDate").val(year + "-" + month + "-" + day); | ||
| 197 | + $("#endDate").val(year + "-" + month + "-" + day); | ||
| 198 | + } else { | ||
| 199 | + $("#startDate").val(year + "-0" + month + "-" + day); | ||
| 200 | + $("#endDate").val(year + "-0" + month + "-" + day); | ||
| 201 | + } | ||
| 202 | + $("#times1").val("06:00"); | ||
| 203 | + $("#times2").val("07:00"); | ||
| 204 | + | ||
| 205 | + var obj = []; | ||
| 206 | + $.get('/user/companyData', function(result){ | ||
| 207 | + obj = result; | ||
| 208 | + var options = ''; | ||
| 209 | + for(var i = 0; i < obj.length; i++){ | ||
| 210 | + options += '<option value="'+obj[i].companyCode+'">'+obj[i].companyName+'</option>'; | ||
| 211 | + } | ||
| 212 | + if(obj.length == 1){ | ||
| 213 | + $('#company1').hide(); | ||
| 214 | + if(obj[0].children.length == 1) | ||
| 215 | + $('#subCompany1').hide(); | ||
| 216 | + } | ||
| 217 | + $('#company').html(options); | ||
| 218 | + updateCompany(); | ||
| 219 | + }); | ||
| 220 | + $("#company").on("change",updateCompany); | ||
| 221 | + function updateCompany(){ | ||
| 222 | + var company = $('#company').val(); | ||
| 223 | + var options = ''; | ||
| 224 | + for(var i = 0; i < obj.length; i++){ | ||
| 225 | + if(obj[i].companyCode == company){ | ||
| 226 | + var children = obj[i].children; | ||
| 227 | + for(var j = 0; j < children.length; j++){ | ||
| 228 | + options += '<option value="'+children[j].code+'">'+children[j].name+'</option>'; | ||
| 229 | + } | ||
| 230 | + } | ||
| 231 | + } | ||
| 232 | + $('#subCompany').html(options); | ||
| 233 | + } | ||
| 234 | + | ||
| 235 | + $.get('/basic/lineCode2Name',function(result){ | ||
| 236 | + var data=[]; | ||
| 237 | + | ||
| 238 | + data.push({id: " ", text:"全部路线"}); | ||
| 239 | + for(var code in result){ | ||
| 240 | + data.push({id: code, text: result[code]}); | ||
| 241 | + } | ||
| 242 | + console.log(data); | ||
| 243 | + initPinYinSelect2('#line',data,''); | ||
| 244 | + | ||
| 245 | + line = ""; | ||
| 246 | + updateModel(); | ||
| 247 | + | ||
| 248 | + var params = {}; | ||
| 249 | + params['line'] = line; | ||
| 250 | + $get('/busInterval/getDir', params, function(result){ | ||
| 251 | + dirData = createTreeData(result); | ||
| 252 | + var options = '<option value="">全部方向</option>'; | ||
| 253 | + $.each(dirData, function(i, g){ | ||
| 254 | + options += '<option value="'+g.name+'">'+g.name+'</option>'; | ||
| 255 | + }); | ||
| 256 | + $('#upDown').html(options); | ||
| 257 | + }); | ||
| 258 | + }); | ||
| 259 | + | ||
| 260 | + $("#query").on("click", function (){ | ||
| 261 | + jsDoQuery(); | ||
| 262 | + }); | ||
| 263 | + | ||
| 264 | + var line = $("#line").val(); | ||
| 265 | + var startDate = $("#startDate").val(); | ||
| 266 | + var endDate = $("#endDate").val(); | ||
| 267 | + var model = $("#model").val(); | ||
| 268 | + var times = $("#times1").val() + "-" + $("#times2").val(); | ||
| 269 | + var upDown = $("#upDown").val(); | ||
| 270 | + function jsDoQuery(pagination){ | ||
| 271 | + var params = {}; | ||
| 272 | +// line = $("#line").val(); | ||
| 273 | + startDate = $("#startDate").val(); | ||
| 274 | + endDate = $("#endDate").val(); | ||
| 275 | + model = $("#model").val(); | ||
| 276 | + times = $("#times1").val() + "-" + $("#times2").val(); | ||
| 277 | + upDown = $("#upDown").val(); | ||
| 278 | + params['line'] = line; | ||
| 279 | + params['startDate'] = startDate; | ||
| 280 | + params['endDate'] = endDate; | ||
| 281 | + params['model'] = model; | ||
| 282 | + params['times'] = times; | ||
| 283 | + params['upDown'] = upDown; | ||
| 284 | + params['type'] = "query"; | ||
| 285 | + $("#forms .hidden").removeClass("hidden"); | ||
| 286 | + $get('/busInterval/lineTimeAnaliy', params, function(result){ | ||
| 287 | + // 把数据填充到模版中 | ||
| 288 | + var tbodyHtml = template('list_lineTimeAnaly',{list:result}); | ||
| 289 | + // 把渲染好的模版html文本追加到表格中 | ||
| 290 | + $('#forms tbody').html(tbodyHtml); | ||
| 291 | + | ||
| 292 | + list = result; | ||
| 293 | + }); | ||
| 294 | + | ||
| 295 | + } | ||
| 296 | + | ||
| 297 | + $("#forms tbody").on("click","tr",function(){ | ||
| 298 | + if($(this).children().size() < 2){ | ||
| 299 | + return; | ||
| 300 | + } | ||
| 301 | + var params = {}; | ||
| 302 | + $(this).children().each(function(index){ | ||
| 303 | + if(index != 0){ | ||
| 304 | + params[index] = $(this).text(); | ||
| 305 | + } | ||
| 306 | + }); | ||
| 307 | + $.each(list, function(i, g){ | ||
| 308 | + if(g.line == params[3] && g.lp == params[4]){ | ||
| 309 | + var tbodyHtml = template('list_workList',{list:g}); | ||
| 310 | + $('#works tbody').html(tbodyHtml); | ||
| 311 | + $("#works_hidden").removeClass("hidden"); | ||
| 312 | + $("#works .hidden").removeClass("hidden"); | ||
| 313 | + $("#date1").html(g.dates); | ||
| 314 | + $("#line1").html(g.line); | ||
| 315 | + $("#lp1").html(g.lp); | ||
| 316 | + $("#station1").html(g.station); | ||
| 317 | + } | ||
| 318 | + }); | ||
| 319 | + }); | ||
| 320 | + | ||
| 321 | + | ||
| 322 | +// $("#export").on("click",function(){ | ||
| 323 | +// $get('/pcpc/workDaily',{line:line,date:date,type:'export'},function(result){ | ||
| 324 | +// window.open("/downloadFile/download?fileName=营运服务日报表"+moment(date).format("YYYYMMDD")); | ||
| 325 | +// }); | ||
| 326 | +// }); | ||
| 327 | + | ||
| 328 | + | ||
| 329 | + $("#line").on("change", function(){ | ||
| 330 | + line = $("#line").val(); | ||
| 331 | + if(line == " ") | ||
| 332 | + line = ""; | ||
| 333 | + updateModel(); | ||
| 334 | + var params = {}; | ||
| 335 | + params['line'] = line; | ||
| 336 | + $get('/busInterval/getDir', params, function(result){ | ||
| 337 | + dirData = createTreeData(result); | ||
| 338 | + var options = '<option value="">全部方向</option>'; | ||
| 339 | + $.each(dirData, function(i, g){ | ||
| 340 | + options += '<option value="'+g.name+'">'+g.name+'</option>'; | ||
| 341 | + }); | ||
| 342 | + $('#upDown').html(options); | ||
| 343 | + }); | ||
| 344 | + }); | ||
| 345 | + $('#startDate').on("blur", function(){ | ||
| 346 | + startDate = $("#startDate").val(); | ||
| 347 | + endDate = $("#endDate").val(); | ||
| 348 | + updateModel(); | ||
| 349 | + }); | ||
| 350 | + $('#endDate').on("blur", function(){ | ||
| 351 | + startDate = $("#startDate").val(); | ||
| 352 | + endDate = $("#endDate").val(); | ||
| 353 | + updateModel(); | ||
| 354 | + }); | ||
| 355 | + | ||
| 356 | + var flag = 0; | ||
| 357 | + function updateModel(){ | ||
| 358 | + if(flag == 1) | ||
| 359 | + return; | ||
| 360 | + flag = 1; | ||
| 361 | + var treeData = []; | ||
| 362 | + var params = {}; | ||
| 363 | + params['line'] = line; | ||
| 364 | + params['startDate'] = startDate; | ||
| 365 | + params['endDate'] = endDate; | ||
| 366 | + $get('/pcpc/getModel', params, function(result){ | ||
| 367 | + treeData = createTreeData(result); | ||
| 368 | + var options = '<option value="">请选择...</option>'; | ||
| 369 | + $.each(treeData, function(i, g){ | ||
| 370 | + options += '<option value="'+g.id+'">'+g.name+'</option>'; | ||
| 371 | + }); | ||
| 372 | + $('#model').html(options)/* .select2() */; | ||
| 373 | + flag = 0; | ||
| 374 | + }); | ||
| 375 | + } | ||
| 376 | + | ||
| 377 | + | ||
| 378 | + }); | ||
| 379 | + | ||
| 380 | +</script> | ||
| 381 | +<script type="text/html" id="list_lineTimeAnaly"> | ||
| 382 | + {{each list as obj i}} | ||
| 383 | + <tr> | ||
| 384 | + <td>{{obj.company}}</td> | ||
| 385 | + <td>{{obj.dates}}</td> | ||
| 386 | + <td>{{obj.times}}</td> | ||
| 387 | + <td>{{obj.line}}</td> | ||
| 388 | + <td>{{obj.lp}}</td> | ||
| 389 | + <td>{{obj.station}}</td> | ||
| 390 | + <td>{{obj.jhbc}}</td> | ||
| 391 | + <td>{{obj.sjbc}}</td> | ||
| 392 | + </tr> | ||
| 393 | + {{/each}} | ||
| 394 | + {{if list.length == 0}} | ||
| 395 | + <tr> | ||
| 396 | + <td colspan="8"><h6 class="muted">没有找到相关数据</h6></td> | ||
| 397 | + </tr> | ||
| 398 | + {{/if}} | ||
| 399 | +</script> | ||
| 400 | +<script type="text/html" id="list_workList"> | ||
| 401 | + {{each list.workList as obj i}} | ||
| 402 | + <tr> | ||
| 403 | + <td>{{obj.date}}</td> | ||
| 404 | + <td>{{obj.jhdf}}</td> | ||
| 405 | + <td>{{obj.sjdf}}</td> | ||
| 406 | + {{if i == 0}} | ||
| 407 | + <td rowspan="{{list.workList.length}}" class="merge">{{list.wddf1}}</td> | ||
| 408 | + <td rowspan="{{list.workList.length}}" class="merge">{{list.wddf2}}</td> | ||
| 409 | + {{/if}} | ||
| 410 | + <td>{{obj.jhfc}}</td> | ||
| 411 | + <td>{{obj.sjfc}}</td> | ||
| 412 | + {{if i == 0}} | ||
| 413 | + <td rowspan="{{list.workList.length}}" class="merge">{{list.wdfc1}}</td> | ||
| 414 | + <td rowspan="{{list.workList.length}}" class="merge">{{list.wdfc2}}</td> | ||
| 415 | + {{/if}} | ||
| 416 | + <td>{{obj.kbc}}</td> | ||
| 417 | + <td>{{obj.mbc}}</td> | ||
| 418 | + <td>{{obj.jhys}}</td> | ||
| 419 | + <td>{{obj.sjys}}</td> | ||
| 420 | + <td>{{obj.yssjMin}}</td> | ||
| 421 | + <td>{{obj.yssjMax}}</td> | ||
| 422 | + {{if i == 0}} | ||
| 423 | + <td rowspan="{{list.workList.length}}" class="merge">{{list.pjys}}</td> | ||
| 424 | + {{/if}} | ||
| 425 | + <td>{{obj.jhtz}}</td> | ||
| 426 | + <td>{{obj.sjtz}}</td> | ||
| 427 | + <td>{{obj.tzsjMax}}</td> | ||
| 428 | + <td>{{obj.tzsjMin}}</td> | ||
| 429 | + {{if i == 0}} | ||
| 430 | + <td rowspan="{{list.workList.length}}" class="merge">{{list.pjtz}}</td> | ||
| 431 | + {{/if}} | ||
| 432 | + </tr> | ||
| 433 | + {{/each}} | ||
| 434 | + {{if list.length == 0}} | ||
| 435 | + <tr> | ||
| 436 | + <td colspan="21"><h6 class="muted">没有找到相关数据</h6></td> | ||
| 437 | + </tr> | ||
| 438 | + {{/if}} | ||
| 439 | +</script> | ||
| 0 | \ No newline at end of file | 440 | \ No newline at end of file |
src/main/resources/static/pages/forms/statement/linepassengerflow.html
| 1 | -<style type="text/css"> | ||
| 2 | - .table-bordered { | ||
| 3 | - border: 1px solid; } | ||
| 4 | - .table-bordered > thead > tr > th, | ||
| 5 | - .table-bordered > thead > tr > td, | ||
| 6 | - .table-bordered > tbody > tr > th, | ||
| 7 | - .table-bordered > tbody > tr > td, | ||
| 8 | - .table-bordered > tfoot > tr > th, | ||
| 9 | - .table-bordered > tfoot > tr > td { | ||
| 10 | - border: 1px solid; } | ||
| 11 | - .table-bordered > thead > tr > th, | ||
| 12 | - .table-bordered > thead > tr > td { | ||
| 13 | - border-bottom-width: 2px; } | ||
| 14 | - | ||
| 15 | - .table > tbody + tbody { | ||
| 16 | - border-top: 1px solid; } | ||
| 17 | -</style> | ||
| 18 | - | ||
| 19 | -<div class="page-head"> | ||
| 20 | - <div class="page-title"> | ||
| 21 | - <h1>线路客流量报表</h1> | ||
| 22 | - </div> | ||
| 23 | -</div> | ||
| 24 | - | ||
| 25 | -<div class="row"> | ||
| 26 | - <div class="col-md-12"> | ||
| 27 | - <div class="portlet light porttlet-fit bordered"> | ||
| 28 | - <div class="portlet-title"> | ||
| 29 | - <form class="form-inline" action=""> | ||
| 30 | - <div style="display: inline-block;"> | ||
| 31 | - <span class="item-label" style="width: 80px;">线路: </span> | ||
| 32 | - <select class="form-control" name="line" id="line" style="width: 180px;"></select> | ||
| 33 | - </div> | ||
| 34 | - <div style="display: inline-block;margin-left: 15px;"> | ||
| 35 | - <span class="item-label" style="width: 80px;">时间: </span> | ||
| 36 | - <input class="form-control" type="text" id="date" style="width: 180px;"/> | ||
| 37 | - </div> | ||
| 38 | - <div class="form-group"> | ||
| 39 | - <input class="btn btn-default" type="button" id="query" value="筛选"/> | ||
| 40 | - <input class="btn btn-default" type="button" id="export" value="导出"/> | ||
| 41 | - </div> | ||
| 42 | - </form> | ||
| 43 | - </div> | ||
| 44 | - <div class="portlet-body"> | ||
| 45 | - <div class="table-container" style="margin-top: 10px;overflow:auto;min-width: 906px"> | ||
| 46 | - <table class="table table-bordered table-hover table-checkable" id="forms"> | ||
| 47 | - <thead> | ||
| 48 | - <tr> | ||
| 49 | - <th>序号</th> | ||
| 50 | - <th>站点名称</th> | ||
| 51 | - <th>pos机刷卡金额</th> | ||
| 52 | - <th>投币金额</th> | ||
| 53 | - </tr> | ||
| 54 | - </thead> | ||
| 55 | - <tbody> | ||
| 56 | - | ||
| 57 | - </tbody> | ||
| 58 | - </table> | ||
| 59 | - </div> | ||
| 60 | - </div> | ||
| 61 | - </div> | ||
| 62 | - </div> | ||
| 63 | -</div> | ||
| 64 | - | ||
| 65 | -<script> | ||
| 66 | - $(function(){ | ||
| 67 | - var reqCodeMap = {"0xA1": '请求恢复运营', "0xA2": '申请调档', "0xA3": '出场请求', "0xA5": '进场请求', "0xA7": '加油请求', "0x50": '车辆故障', "0x70": '路阻报告', "0x60": '事故报告', "0x11": '扣证纠纷', "0x12" : '报警'}; | ||
| 68 | - // 关闭左侧栏 | ||
| 69 | - if (!$('body').hasClass('page-sidebar-closed')) | ||
| 70 | - $('.menu-toggler.sidebar-toggler').click(); | ||
| 71 | - | ||
| 72 | - $("#date").datetimepicker({ | ||
| 73 | - format : 'YYYY-MM-DD', | ||
| 74 | - locale : 'zh-cn' | ||
| 75 | - }); | ||
| 76 | - | ||
| 77 | - $.get('/basic/lineCode2Name',function(result){ | ||
| 78 | - var data=[]; | ||
| 79 | - | ||
| 80 | - for(var code in result){ | ||
| 81 | - data.push({id: code, text: result[code]}); | ||
| 82 | - } | ||
| 83 | - console.log(data); | ||
| 84 | - initPinYinSelect2('#line',data,''); | ||
| 85 | - | ||
| 86 | - }) | ||
| 87 | - | ||
| 88 | - $("#query").on("click",function(){ | ||
| 89 | - var line = $("#line").val(); | ||
| 90 | - var date = $("#date").val(); | ||
| 91 | - $post('/mcy_forms/linepasswengerflow',{line:line,date:date},function(result){ | ||
| 92 | - $.each(result, function(i, obj) { | ||
| 93 | - obj.requestType = reqCodeMap[obj.requestType]; | ||
| 94 | - }); | ||
| 95 | - // 把数据填充到模版中 | ||
| 96 | - var tbodyHtml = template('list_linepasswengerflow',{list:result}); | ||
| 97 | - // 把渲染好的模版html文本追加到表格中 | ||
| 98 | - $('#forms tbody').html(tbodyHtml); | ||
| 99 | - }); | ||
| 100 | - }); | ||
| 101 | - }); | ||
| 102 | -</script> | ||
| 103 | -<script type="text/html" id="list_linepasswengerflow"> | ||
| 104 | - {{each list as obj i}} | ||
| 105 | - <tr> | ||
| 106 | - <td>{{i+1}}</td> | ||
| 107 | - <td>{{obj.stationName}}</td> | ||
| 108 | - <td> </td> | ||
| 109 | - <td> </td> | ||
| 110 | - </tr> | ||
| 111 | - {{/each}} | ||
| 112 | - {{if list.length == 0}} | ||
| 113 | - <tr> | ||
| 114 | - <td colspan="6"><h6 class="muted">没有找到相关数据</h6></td> | ||
| 115 | - </tr> | ||
| 116 | - {{/if}} | 1 | +<style type="text/css"> |
| 2 | + .table-bordered { | ||
| 3 | + border: 1px solid; } | ||
| 4 | + .table-bordered > thead > tr > th, | ||
| 5 | + .table-bordered > thead > tr > td, | ||
| 6 | + .table-bordered > tbody > tr > th, | ||
| 7 | + .table-bordered > tbody > tr > td, | ||
| 8 | + .table-bordered > tfoot > tr > th, | ||
| 9 | + .table-bordered > tfoot > tr > td { | ||
| 10 | + border: 1px solid; } | ||
| 11 | + .table-bordered > thead > tr > th, | ||
| 12 | + .table-bordered > thead > tr > td { | ||
| 13 | + border-bottom-width: 2px; } | ||
| 14 | + | ||
| 15 | + .table > tbody + tbody { | ||
| 16 | + border-top: 1px solid; } | ||
| 17 | +</style> | ||
| 18 | + | ||
| 19 | +<div class="page-head"> | ||
| 20 | + <div class="page-title"> | ||
| 21 | + <h1>线路客流量报表</h1> | ||
| 22 | + </div> | ||
| 23 | +</div> | ||
| 24 | + | ||
| 25 | +<div class="row"> | ||
| 26 | + <div class="col-md-12"> | ||
| 27 | + <div class="portlet light porttlet-fit bordered"> | ||
| 28 | + <div class="portlet-title"> | ||
| 29 | + <form class="form-inline" action=""> | ||
| 30 | + <div style="display: inline-block;"> | ||
| 31 | + <span class="item-label" style="width: 80px;">线路: </span> | ||
| 32 | + <select class="form-control" name="line" id="line" style="width: 180px;"></select> | ||
| 33 | + </div> | ||
| 34 | + <div style="display: inline-block;margin-left: 15px;"> | ||
| 35 | + <span class="item-label" style="width: 80px;">时间: </span> | ||
| 36 | + <input class="form-control" type="text" id="date" style="width: 180px;"/> | ||
| 37 | + </div> | ||
| 38 | + <div class="form-group"> | ||
| 39 | + <input class="btn btn-default" type="button" id="query" value="筛选"/> | ||
| 40 | + <input class="btn btn-default" type="button" id="export" value="导出"/> | ||
| 41 | + </div> | ||
| 42 | + </form> | ||
| 43 | + </div> | ||
| 44 | + <div class="portlet-body"> | ||
| 45 | + <div class="table-container" style="margin-top: 10px;overflow:auto;min-width: 906px"> | ||
| 46 | + <table class="table table-bordered table-hover table-checkable" id="forms"> | ||
| 47 | + <thead> | ||
| 48 | + <tr> | ||
| 49 | + <th>序号</th> | ||
| 50 | + <th>站点名称</th> | ||
| 51 | + <th>pos机刷卡金额</th> | ||
| 52 | + <th>投币金额</th> | ||
| 53 | + </tr> | ||
| 54 | + </thead> | ||
| 55 | + <tbody> | ||
| 56 | + | ||
| 57 | + </tbody> | ||
| 58 | + </table> | ||
| 59 | + </div> | ||
| 60 | + </div> | ||
| 61 | + </div> | ||
| 62 | + </div> | ||
| 63 | +</div> | ||
| 64 | + | ||
| 65 | +<script> | ||
| 66 | + $(function(){ | ||
| 67 | + var reqCodeMap = {"0xA1": '请求恢复运营', "0xA2": '申请调档', "0xA3": '出场请求', "0xA5": '进场请求', "0xA7": '加油请求', "0x50": '车辆故障', "0x70": '路阻报告', "0x60": '事故报告', "0x11": '扣证纠纷', "0x12" : '报警'}; | ||
| 68 | + // 关闭左侧栏 | ||
| 69 | + if (!$('body').hasClass('page-sidebar-closed')) | ||
| 70 | + $('.menu-toggler.sidebar-toggler').click(); | ||
| 71 | + | ||
| 72 | + $("#date").datetimepicker({ | ||
| 73 | + format : 'YYYY-MM-DD', | ||
| 74 | + locale : 'zh-cn' | ||
| 75 | + }); | ||
| 76 | + | ||
| 77 | + $.get('/basic/lineCode2Name',function(result){ | ||
| 78 | + var data=[]; | ||
| 79 | + | ||
| 80 | + for(var code in result){ | ||
| 81 | + data.push({id: code, text: result[code]}); | ||
| 82 | + } | ||
| 83 | + console.log(data); | ||
| 84 | + initPinYinSelect2('#line',data,''); | ||
| 85 | + | ||
| 86 | + }) | ||
| 87 | + | ||
| 88 | + $("#query").on("click",function(){ | ||
| 89 | + var line = $("#line").val(); | ||
| 90 | + var date = $("#date").val(); | ||
| 91 | + $post('/mcy_forms/linepasswengerflow',{line:line,date:date},function(result){ | ||
| 92 | + $.each(result, function(i, obj) { | ||
| 93 | + obj.requestType = reqCodeMap[obj.requestType]; | ||
| 94 | + }); | ||
| 95 | + // 把数据填充到模版中 | ||
| 96 | + var tbodyHtml = template('list_linepasswengerflow',{list:result}); | ||
| 97 | + // 把渲染好的模版html文本追加到表格中 | ||
| 98 | + $('#forms tbody').html(tbodyHtml); | ||
| 99 | + }); | ||
| 100 | + }); | ||
| 101 | + }); | ||
| 102 | +</script> | ||
| 103 | +<script type="text/html" id="list_linepasswengerflow"> | ||
| 104 | + {{each list as obj i}} | ||
| 105 | + <tr> | ||
| 106 | + <td>{{i+1}}</td> | ||
| 107 | + <td>{{obj.stationName}}</td> | ||
| 108 | + <td> </td> | ||
| 109 | + <td> </td> | ||
| 110 | + </tr> | ||
| 111 | + {{/each}} | ||
| 112 | + {{if list.length == 0}} | ||
| 113 | + <tr> | ||
| 114 | + <td colspan="6"><h6 class="muted">没有找到相关数据</h6></td> | ||
| 115 | + </tr> | ||
| 116 | + {{/if}} | ||
| 117 | </script> | 117 | </script> |
| 118 | \ No newline at end of file | 118 | \ No newline at end of file |
src/main/resources/static/pages/forms/statement/peopleCarPlan.html
| @@ -27,13 +27,21 @@ | @@ -27,13 +27,21 @@ | ||
| 27 | <div class="portlet light porttlet-fit bordered"> | 27 | <div class="portlet light porttlet-fit bordered"> |
| 28 | <div class="portlet-title"> | 28 | <div class="portlet-title"> |
| 29 | <form id="history" class="form-inline" action=""> | 29 | <form id="history" class="form-inline" action=""> |
| 30 | - <div style="display: inline-block;"> | 30 | + <div style="display: inline-block; margin-left: 10px;" id="company1"> |
| 31 | + <span class="item-label" style="width: 80px;">公司: </span> | ||
| 32 | + <select class="form-control" name="company" id="company" style="width: 160px;"></select> | ||
| 33 | + </div> | ||
| 34 | + <div style="display: inline-block; margin-left: 10px;" id="subCompany1"> | ||
| 35 | + <span class="item-label" style="width: 80px;">分公司: </span> | ||
| 36 | + <select class="form-control" name="subCompany" id="subCompany" style="width: 160px;"></select> | ||
| 37 | + </div> | ||
| 38 | + <div style="display: inline-block; margin-left: 10px;"> | ||
| 31 | <span class="item-label" style="width: 80px;">线路: </span> | 39 | <span class="item-label" style="width: 80px;">线路: </span> |
| 32 | - <select class="form-control" name="line" id="line" style="width: 180px;"></select> | 40 | + <select class="form-control" name="line" id="line" style="width: 160px;"></select> |
| 33 | </div> | 41 | </div> |
| 34 | - <div style="display: inline-block;margin-left: 15px;"> | 42 | + <div style="display: inline-block; margin-left: 10px;"> |
| 35 | <span class="item-label" style="width: 80px;">时间: </span> | 43 | <span class="item-label" style="width: 80px;">时间: </span> |
| 36 | - <input class="form-control" type="text" id="date" style="width: 180px;"/> | 44 | + <input class="form-control" type="text" id="date" style="width: 160px;"/> |
| 37 | </div> | 45 | </div> |
| 38 | <div class="form-group"> | 46 | <div class="form-group"> |
| 39 | <input class="btn btn-default" type="button" id="query" value="筛选"/> | 47 | <input class="btn btn-default" type="button" id="query" value="筛选"/> |
| @@ -90,44 +98,46 @@ | @@ -90,44 +98,46 @@ | ||
| 90 | $("#date").val(year + "-0" + month + "-" + day); | 98 | $("#date").val(year + "-0" + month + "-" + day); |
| 91 | } | 99 | } |
| 92 | 100 | ||
| 93 | - $('#line').select2({ | ||
| 94 | - ajax: { | ||
| 95 | - url: '/realSchedule/findLine', | ||
| 96 | - type: 'post', | ||
| 97 | - dataType: 'json', | ||
| 98 | - delay: 150, | ||
| 99 | - data: function(params){ | ||
| 100 | - return{line: params.term}; | ||
| 101 | - }, | ||
| 102 | - processResults: function (data) { | ||
| 103 | - return { | ||
| 104 | - results: data | ||
| 105 | - }; | ||
| 106 | - }, | ||
| 107 | - cache: true | ||
| 108 | - }, | ||
| 109 | - templateResult: function(repo){ | ||
| 110 | - if (repo.loading) return repo.text; | ||
| 111 | - var h = '<span>'+repo.text+'</span>'; | ||
| 112 | - return h; | ||
| 113 | - }, | ||
| 114 | - escapeMarkup: function (markup) { return markup; }, | ||
| 115 | - minimumInputLength: 1, | ||
| 116 | - templateSelection: function(repo){ | ||
| 117 | - return repo.text; | ||
| 118 | - }, | ||
| 119 | - language: { | ||
| 120 | - noResults: function(){ | ||
| 121 | - return '<span style="color:red;font-size: 12px;">没有搜索到线路!</span>'; | ||
| 122 | - }, | ||
| 123 | - inputTooShort : function(e) { | ||
| 124 | - return '<span style="color:gray;font-size: 12px;"><i class="fa fa-search"></i> 输入线路搜索线路</span>'; | ||
| 125 | - }, | ||
| 126 | - searching : function() { | ||
| 127 | - return '<span style="color:gray;font-size: 12px;"> 正在搜索线路...</span>'; | ||
| 128 | - } | 101 | + $.get('/basic/lineCode2Name',function(result){ |
| 102 | + var data=[]; | ||
| 103 | + | ||
| 104 | + data.push({id: " ", text: "全部线路"}); | ||
| 105 | + for(var code in result){ | ||
| 106 | + data.push({id: code, text: result[code]}); | ||
| 107 | + } | ||
| 108 | + console.log(data); | ||
| 109 | + initPinYinSelect2('#line',data,''); | ||
| 110 | + }); | ||
| 111 | + | ||
| 112 | + var obj = []; | ||
| 113 | + $.get('/user/companyData', function(result){ | ||
| 114 | + obj = result; | ||
| 115 | + var options = ''; | ||
| 116 | + for(var i = 0; i < obj.length; i++){ | ||
| 117 | + options += '<option value="'+obj[i].companyCode+'">'+obj[i].companyName+'</option>'; | ||
| 118 | + } | ||
| 119 | + if(obj.length == 1){ | ||
| 120 | + $('#company1').hide(); | ||
| 121 | + if(obj[0].children.length == 1) | ||
| 122 | + $('#subCompany1').hide(); | ||
| 129 | } | 123 | } |
| 124 | + $('#company').html(options); | ||
| 125 | + updateCompany(); | ||
| 130 | }); | 126 | }); |
| 127 | + $("#company").on("change",updateCompany); | ||
| 128 | + function updateCompany(){ | ||
| 129 | + var company = $('#company').val(); | ||
| 130 | + var options = ''; | ||
| 131 | + for(var i = 0; i < obj.length; i++){ | ||
| 132 | + if(obj[i].companyCode == company){ | ||
| 133 | + var children = obj[i].children; | ||
| 134 | + for(var j = 0; j < children.length; j++){ | ||
| 135 | + options += '<option value="'+children[j].code+'">'+children[j].name+'</option>'; | ||
| 136 | + } | ||
| 137 | + } | ||
| 138 | + } | ||
| 139 | + $('#subCompany').html(options); | ||
| 140 | + } | ||
| 131 | 141 | ||
| 132 | 142 | ||
| 133 | $("#query").on("click",jsDoQuery); | 143 | $("#query").on("click",jsDoQuery); |
| @@ -138,6 +148,8 @@ | @@ -138,6 +148,8 @@ | ||
| 138 | var params = {}; | 148 | var params = {}; |
| 139 | line = $("#line").val(); | 149 | line = $("#line").val(); |
| 140 | date = $("#date").val(); | 150 | date = $("#date").val(); |
| 151 | + if(line == " ") | ||
| 152 | + line = ""; | ||
| 141 | params['line'] = line; | 153 | params['line'] = line; |
| 142 | params['date'] = date; | 154 | params['date'] = date; |
| 143 | params['type'] = "query"; | 155 | params['type'] = "query"; |
src/main/resources/static/pages/forms/statement/scheduleAnaly.html
| @@ -27,21 +27,30 @@ | @@ -27,21 +27,30 @@ | ||
| 27 | <div class="portlet light porttlet-fit bordered"> | 27 | <div class="portlet light porttlet-fit bordered"> |
| 28 | <div class="portlet-title"> | 28 | <div class="portlet-title"> |
| 29 | <form id="history" class="form-inline" action=""> | 29 | <form id="history" class="form-inline" action=""> |
| 30 | - <div style="display: inline-block;"> | 30 | + <div style="display: inline-block;margin-left: 38px;" id="company1"> |
| 31 | + <span class="item-label" style="width: 80px;">公司: </span> | ||
| 32 | + <select class="form-control" name="company" id="company" style="width: 160px;"></select> | ||
| 33 | + </div> | ||
| 34 | + <div style="display: inline-block;margin-left: 24px;" id="subCompany1"> | ||
| 35 | + <span class="item-label" style="width: 80px;">分公司: </span> | ||
| 36 | + <select class="form-control" name="subCompany" id="subCompany" style="width: 160px;"></select> | ||
| 37 | + </div> | ||
| 38 | + <div style="display: inline-block;margin-left: 38px;"> | ||
| 31 | <span class="item-label" style="width: 80px;">线路: </span> | 39 | <span class="item-label" style="width: 80px;">线路: </span> |
| 32 | - <select class="form-control" name="line" id="line" style="width: 180px;"></select> | 40 | + <select class="form-control" name="line" id="line" style="width: 160px;"></select> |
| 33 | </div> | 41 | </div> |
| 34 | - <div style="display: inline-block;margin-left: 15px;"> | 42 | + <div style="margin-top: 10px"></div> |
| 43 | + <div style="display: inline-block;margin-left: 10px;"> | ||
| 35 | <span class="item-label" style="width: 80px;">开始时间: </span> | 44 | <span class="item-label" style="width: 80px;">开始时间: </span> |
| 36 | - <input class="form-control" type="text" id="startDate" style="width: 180px;"/> | 45 | + <input class="form-control" type="text" id="startDate" style="width: 160px;"/> |
| 37 | </div> | 46 | </div> |
| 38 | - <div style="display: inline-block;margin-left: 15px;"> | 47 | + <div style="display: inline-block;margin-left: 10px;"> |
| 39 | <span class="item-label" style="width: 80px;">结束时间: </span> | 48 | <span class="item-label" style="width: 80px;">结束时间: </span> |
| 40 | - <input class="form-control" type="text" id="endDate" style="width: 180px;"/> | 49 | + <input class="form-control" type="text" id="endDate" style="width: 160px;"/> |
| 41 | </div> | 50 | </div> |
| 42 | - <div style="display: inline-block;"> | 51 | + <div style="display: inline-block;margin-left: 10px;"> |
| 43 | <span class="item-label" style="width: 80px;">模板类型: </span> | 52 | <span class="item-label" style="width: 80px;">模板类型: </span> |
| 44 | - <select class="form-control" name="model" id="model" style="width: 180px;"> | 53 | + <select class="form-control" name="model" id="model" style="width: 160px;"> |
| 45 | <option value="">请选择...</option> | 54 | <option value="">请选择...</option> |
| 46 | </select> | 55 | </select> |
| 47 | </div> | 56 | </div> |
| @@ -113,45 +122,51 @@ | @@ -113,45 +122,51 @@ | ||
| 113 | $("#endDate").val(year + "-0" + month + "-" + day); | 122 | $("#endDate").val(year + "-0" + month + "-" + day); |
| 114 | } | 123 | } |
| 115 | 124 | ||
| 116 | - $('#line').select2({ | ||
| 117 | - ajax: { | ||
| 118 | - url: '/realSchedule/findLine', | ||
| 119 | - type: 'post', | ||
| 120 | - dataType: 'json', | ||
| 121 | - delay: 150, | ||
| 122 | - data: function(params){ | ||
| 123 | - return{line: params.term}; | ||
| 124 | - }, | ||
| 125 | - processResults: function (data) { | ||
| 126 | - return { | ||
| 127 | - results: data | ||
| 128 | - }; | ||
| 129 | - }, | ||
| 130 | - cache: true | ||
| 131 | - }, | ||
| 132 | - templateResult: function(repo){ | ||
| 133 | - if (repo.loading) return repo.text; | ||
| 134 | - var h = '<span>'+repo.text+'</span>'; | ||
| 135 | - return h; | ||
| 136 | - }, | ||
| 137 | - escapeMarkup: function (markup) { return markup; }, | ||
| 138 | - minimumInputLength: 1, | ||
| 139 | - templateSelection: function(repo){ | ||
| 140 | - return repo.text; | ||
| 141 | - }, | ||
| 142 | - language: { | ||
| 143 | - noResults: function(){ | ||
| 144 | - return '<span style="color:red;font-size: 12px;">没有搜索到线路!</span>'; | ||
| 145 | - }, | ||
| 146 | - inputTooShort : function(e) { | ||
| 147 | - return '<span style="color:gray;font-size: 12px;"><i class="fa fa-search"></i> 输入线路搜索线路</span>'; | ||
| 148 | - }, | ||
| 149 | - searching : function() { | ||
| 150 | - return '<span style="color:gray;font-size: 12px;"> 正在搜索线路...</span>'; | ||
| 151 | - } | 125 | + $.get('/basic/lineCode2Name',function(result){ |
| 126 | + var data=[]; | ||
| 127 | + | ||
| 128 | + data.push({id:" ", text: "全部线路"}); | ||
| 129 | + for(var code in result){ | ||
| 130 | + data.push({id: code, text: result[code]}); | ||
| 152 | } | 131 | } |
| 132 | + console.log(data); | ||
| 133 | + initPinYinSelect2('#line',data,''); | ||
| 134 | + | ||
| 135 | + line = ""; | ||
| 136 | + updateModel(); | ||
| 153 | }); | 137 | }); |
| 154 | 138 | ||
| 139 | + var obj = []; | ||
| 140 | + $.get('/user/companyData', function(result){ | ||
| 141 | + obj = result; | ||
| 142 | + var options = ''; | ||
| 143 | + for(var i = 0; i < obj.length; i++){ | ||
| 144 | + options += '<option value="'+obj[i].companyCode+'">'+obj[i].companyName+'</option>'; | ||
| 145 | + } | ||
| 146 | + if(obj.length == 1){ | ||
| 147 | + $('#company1').hide(); | ||
| 148 | + if(obj[0].children.length == 1) | ||
| 149 | + $('#subCompany1').hide(); | ||
| 150 | + } | ||
| 151 | + $('#company').html(options); | ||
| 152 | + updateCompany(); | ||
| 153 | + }); | ||
| 154 | + $("#company").on("change",updateCompany); | ||
| 155 | + function updateCompany(){ | ||
| 156 | + var company = $('#company').val(); | ||
| 157 | + var options = ''; | ||
| 158 | + for(var i = 0; i < obj.length; i++){ | ||
| 159 | + if(obj[i].companyCode == company){ | ||
| 160 | + var children = obj[i].children; | ||
| 161 | + for(var j = 0; j < children.length; j++){ | ||
| 162 | + options += '<option value="'+children[j].code+'">'+children[j].name+'</option>'; | ||
| 163 | + } | ||
| 164 | + } | ||
| 165 | + } | ||
| 166 | + $('#subCompany').html(options); | ||
| 167 | + } | ||
| 168 | + | ||
| 169 | + | ||
| 155 | $("#query").on("click", function(){ | 170 | $("#query").on("click", function(){ |
| 156 | page = 0; | 171 | page = 0; |
| 157 | jsDoQuery(true); | 172 | jsDoQuery(true); |
| @@ -163,7 +178,7 @@ | @@ -163,7 +178,7 @@ | ||
| 163 | var model = $("#model").val(); | 178 | var model = $("#model").val(); |
| 164 | function jsDoQuery(pagination){ | 179 | function jsDoQuery(pagination){ |
| 165 | var params = {}; | 180 | var params = {}; |
| 166 | - line = $("#line").val(); | 181 | +// line = $("#line").val(); |
| 167 | startDate = $("#startDate").val(); | 182 | startDate = $("#startDate").val(); |
| 168 | endDate = $("#endDate").val(); | 183 | endDate = $("#endDate").val(); |
| 169 | model = $("#model").val(); | 184 | model = $("#model").val(); |
| @@ -197,6 +212,8 @@ | @@ -197,6 +212,8 @@ | ||
| 197 | 212 | ||
| 198 | $("#line").on("change", function(){ | 213 | $("#line").on("change", function(){ |
| 199 | line = $("#line").val(); | 214 | line = $("#line").val(); |
| 215 | + if(line == " ") | ||
| 216 | + line = ""; | ||
| 200 | updateModel(); | 217 | updateModel(); |
| 201 | }); | 218 | }); |
| 202 | $('#startDate').on("blur", function(){ | 219 | $('#startDate').on("blur", function(){ |
| @@ -232,7 +249,6 @@ | @@ -232,7 +249,6 @@ | ||
| 232 | flag = 0; | 249 | flag = 0; |
| 233 | }); | 250 | }); |
| 234 | } | 251 | } |
| 235 | - updateModel(); | ||
| 236 | 252 | ||
| 237 | 253 | ||
| 238 | function showPagination(data){ | 254 | function showPagination(data){ |