New file |
| | |
| | | |
| | | package com.stylefeng.guns.modular.system.controller.specialTrain; |
| | | |
| | | import com.alibaba.fastjson.JSON; |
| | | import com.alibaba.fastjson.JSONArray; |
| | | import com.alibaba.fastjson.JSONObject; |
| | | import com.baomidou.mybatisplus.mapper.EntityWrapper; |
| | | import com.baomidou.mybatisplus.plugins.Page; |
| | | import com.stylefeng.guns.core.base.controller.BaseController; |
| | | import com.stylefeng.guns.core.common.constant.factory.PageFactory; |
| | | import com.stylefeng.guns.core.log.LogObjectHolder; |
| | | import com.stylefeng.guns.core.shiro.ShiroKit; |
| | | import com.stylefeng.guns.core.util.SinataUtil; |
| | | import com.stylefeng.guns.modular.system.model.*; |
| | | import com.stylefeng.guns.modular.system.service.*; |
| | | import com.stylefeng.guns.modular.system.util.ResultUtil; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.stereotype.Controller; |
| | | import org.springframework.ui.Model; |
| | | import org.springframework.web.bind.annotation.PathVariable; |
| | | import org.springframework.web.bind.annotation.RequestMapping; |
| | | import org.springframework.web.bind.annotation.RequestParam; |
| | | import org.springframework.web.bind.annotation.ResponseBody; |
| | | |
| | | import java.text.SimpleDateFormat; |
| | | import java.util.ArrayList; |
| | | import java.util.Date; |
| | | import java.util.List; |
| | | import java.util.Map; |
| | | |
| | | /** |
| | | * 跨城线路管理控制器 |
| | | * |
| | | * @author fengshuonan |
| | | * @Date 2020-09-15 16:17:29 |
| | | */ |
| | | @Controller |
| | | @RequestMapping("/airLine") |
| | | public class AirLineController extends BaseController { |
| | | |
| | | private String PREFIX = "/system/airLine/"; |
| | | |
| | | @Autowired |
| | | private ITLineService tLineService; |
| | | |
| | | @Autowired |
| | | private ITSiteService itSiteService; |
| | | |
| | | @Autowired |
| | | private ITServerCarmodelService itServerCarmodelService; |
| | | |
| | | @Autowired |
| | | private ITLineSiteService itLineSiteService; |
| | | |
| | | @Autowired |
| | | private ITLinePriceService itLinePriceService; |
| | | |
| | | @Autowired |
| | | private ITLineShiftService itLineShiftService; |
| | | |
| | | @Autowired |
| | | private ITCompanyService itCompanyService; |
| | | |
| | | @Autowired |
| | | private ITLineCompanyService itLineCompanyService; |
| | | |
| | | /** |
| | | * 跳转到跨城站点管理首页 |
| | | */ |
| | | @RequestMapping("") |
| | | public String index() { |
| | | return PREFIX + "airLine.html"; |
| | | } |
| | | |
| | | /** |
| | | * 跳转到添加跨城站点管理 |
| | | */ |
| | | @RequestMapping("/airLine_add") |
| | | public String tLineAdd(Model model) { |
| | | //站点 |
| | | List<TSite> siteList = itSiteService.selectList(new EntityWrapper<TSite>().eq("state", 1).eq("type",2)); |
| | | model.addAttribute("siteList",siteList); |
| | | //跨城车型 |
| | | List<TServerCarmodel> carmodelList = itServerCarmodelService.selectList(new EntityWrapper<TServerCarmodel>().eq("type", 2).eq("state", 1)); |
| | | model.addAttribute("carmodelList",carmodelList); |
| | | return PREFIX + "airLine_add.html"; |
| | | } |
| | | |
| | | /** |
| | | * 分配企业页面 |
| | | */ |
| | | @RequestMapping("/airLine_addCompany/{tLineId}") |
| | | public String airLine_addCompany(@PathVariable Integer tLineId,Model model) { |
| | | TLine tLine = tLineService.selectById(tLineId); |
| | | model.addAttribute("tLine",tLine); |
| | | //查询所有企业 |
| | | List<TCompany> companyList = itCompanyService.selectList(new EntityWrapper<TCompany>().last(" where not FIND_IN_SET(state,'1') and not FIND_IN_SET(flag,'3')")); |
| | | model.addAttribute("companyList",companyList); |
| | | //查询已分配企业 |
| | | List<Map<String, Object>> lineCompanyList = tLineService.getLineCompanyList(tLineId); |
| | | model.addAttribute("lineCompanyList",lineCompanyList); |
| | | return PREFIX + "airLine_addCompany.html"; |
| | | } |
| | | |
| | | /** |
| | | * 跳转到修改跨城站点管理 |
| | | */ |
| | | @RequestMapping("/airLine_update/{tLineId}") |
| | | public String tLineUpdate(@PathVariable Integer tLineId, Model model) { |
| | | TLine tLine = tLineService.selectById(tLineId); |
| | | model.addAttribute("item",tLine); |
| | | LogObjectHolder.me().set(tLine); |
| | | |
| | | //查找站点起点+终点 |
| | | TLineSite start = itLineSiteService.selectOne(new EntityWrapper<TLineSite>().eq("lineId", tLineId).eq("type", 1)); |
| | | model.addAttribute("start",start); |
| | | TLineSite end = itLineSiteService.selectOne(new EntityWrapper<TLineSite>().eq("lineId", tLineId).eq("type", 2)); |
| | | model.addAttribute("end",end); |
| | | //站点 |
| | | List<TSite> siteList = itSiteService.selectList(new EntityWrapper<TSite>().eq("state", 1)); |
| | | model.addAttribute("siteList",siteList); |
| | | //跨城车型 |
| | | List<TServerCarmodel> carmodelList = itServerCarmodelService.selectList(new EntityWrapper<TServerCarmodel>().eq("type", 2).eq("state", 1)); |
| | | model.addAttribute("carmodelList",carmodelList); |
| | | //查询所有站点 |
| | | List<Map<String, Object>> linePriceList = tLineService.getLinePriceList(tLineId); |
| | | model.addAttribute("linePriceList",linePriceList); |
| | | //查询所有班次 |
| | | List<TLineShift> lineShiftList = itLineShiftService.selectList(new EntityWrapper<TLineShift>().eq("lineId", tLineId).last(" and not FIND_IN_SET(state,'3')")); |
| | | model.addAttribute("lineShiftList",lineShiftList); |
| | | return PREFIX + "airLine_edit.html"; |
| | | } |
| | | |
| | | /** |
| | | * 获取机场线路管理 |
| | | */ |
| | | @RequestMapping(value = "/list") |
| | | @ResponseBody |
| | | public Object list(String insertTime,String name,String insertUser,String modelStr,Integer state) { |
| | | String beginTime = null; |
| | | String endTime = null; |
| | | if (SinataUtil.isNotEmpty(insertTime)){ |
| | | String[] timeArray = insertTime.split(" - "); |
| | | beginTime = timeArray[0]; |
| | | endTime = timeArray[1]; |
| | | } |
| | | Page<Map<String, Object>> page = new PageFactory<Map<String, Object>>().defaultPage(); |
| | | if (ShiroKit.getUser().getRoleType() != 1){ |
| | | page.setRecords(null); |
| | | }else{ |
| | | page.setRecords(tLineService.getLineList(page,beginTime,endTime,name,insertUser,modelStr,state,2)); |
| | | } |
| | | return super.packForBT(page); |
| | | } |
| | | |
| | | /** |
| | | * 新增机场线路 |
| | | */ |
| | | @RequestMapping(value = "/add") |
| | | @ResponseBody |
| | | public ResultUtil add(TLine tLine,Integer startSiteId,Integer endSiteId,@RequestParam String subArr,@RequestParam String shuArr) { |
| | | String name = tLine.getName(); |
| | | name = name.replaceAll("& lt;", "<"); |
| | | name = name.replaceAll("& gt;", ">"); |
| | | name = name.replaceAll("& #40;", "("); |
| | | name = name.replaceAll("& #41;", ")"); |
| | | tLine.setName(name); |
| | | tLine.setState(1); |
| | | tLine.setType(2); |
| | | tLine.setInsertTime(new Date()); |
| | | tLine.setInsertUserId(ShiroKit.getUser().getId()); |
| | | tLineService.insert(tLine); |
| | | |
| | | //添加线路站点起点+终点 |
| | | TLineSite start = new TLineSite(); |
| | | start.setLineId(tLine.getId()); |
| | | start.setSiteId(startSiteId); |
| | | start.setType(1); |
| | | itLineSiteService.insert(start); |
| | | TLineSite end = new TLineSite(); |
| | | end.setLineId(tLine.getId()); |
| | | end.setSiteId(endSiteId); |
| | | end.setType(2); |
| | | itLineSiteService.insert(end); |
| | | |
| | | //添加价格设置 |
| | | addPrice(tLine.getId(), subArr); |
| | | |
| | | //添加班次设置 |
| | | return addShift(tLine.getId(), shuArr); |
| | | } |
| | | |
| | | /** |
| | | * 添加线路班次 |
| | | * @param lineId |
| | | * @param shuArr |
| | | */ |
| | | private ResultUtil addShift(Integer lineId, @RequestParam String shuArr) { |
| | | try { |
| | | JSONArray jsonArray1 = JSON.parseArray(shuArr); |
| | | int size1 = jsonArray1.size(); |
| | | SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss"); |
| | | List<String> list = new ArrayList<>(); |
| | | for (int i = 0; i < size1; i++) { |
| | | List<TLineShift> tLineShifts = itLineShiftService.selectList(new EntityWrapper<TLineShift>().eq("lineId", lineId).ne("state", 3).orderBy("startTime")); |
| | | JSONObject jsonObject = jsonArray1.getJSONObject(i); |
| | | TLineShift shift = new TLineShift(); |
| | | shift.setLineId(lineId); |
| | | String shiftTime = jsonObject.getString("shiftTime"); |
| | | String startTime = null; |
| | | String endTime = null; |
| | | if (SinataUtil.isNotEmpty(shiftTime)){ |
| | | String[] timeArray = shiftTime.split(" - "); |
| | | startTime = timeArray[0]; |
| | | endTime = timeArray[1]; |
| | | } |
| | | Date s1 = sdf.parse("2020-11-11 " + startTime + ":00"); |
| | | Date e1 = sdf.parse("2020-11-11 " + endTime + ":00"); |
| | | boolean b = false; |
| | | for(TLineShift lineShift : tLineShifts){ |
| | | Date s2 = sdf.parse("2020-11-11 " + lineShift.getStartTime() + ":00"); |
| | | Date e2 = sdf.parse("2020-11-11 " + lineShift.getEndTime() + ":00"); |
| | | if(s2.getTime() <= s1.getTime() && e1.getTime() <= e2.getTime()){ |
| | | list.add(startTime + " - " + endTime); |
| | | b = true; |
| | | break; |
| | | } |
| | | if(s1.getTime() <= s2.getTime() && s1.getTime() <= e2.getTime() && e1.getTime() >= s2.getTime()){ |
| | | list.add(startTime + " - " + endTime); |
| | | b = true; |
| | | break; |
| | | } |
| | | if(s1.getTime() >= s2.getTime() && s1.getTime() <= e2.getTime() && e1.getTime() >= e2.getTime()){ |
| | | list.add(startTime + " - " + endTime); |
| | | b = true; |
| | | break; |
| | | } |
| | | } |
| | | if(b){ |
| | | continue; |
| | | } |
| | | shift.setStartTime(startTime); |
| | | shift.setEndTime(endTime); |
| | | shift.setCarNum(jsonObject.getInteger("carNum")); |
| | | shift.setInsertTime(new Date()); |
| | | shift.setAddTime(jsonObject.getString("time2")); |
| | | shift.setState(1); |
| | | itLineShiftService.insert(shift); |
| | | } |
| | | if(list.size() > 0){ |
| | | return ResultUtil.error("【" + JSON.toJSONString(list) + "】时间段与现存时间段重合,添加失败!"); |
| | | } |
| | | return ResultUtil.success(); |
| | | }catch (Exception e){ |
| | | e.printStackTrace(); |
| | | return ResultUtil.runErr(); |
| | | } |
| | | } |
| | | |
| | | /** |
| | | * 添加线路价格 |
| | | * @param lineId |
| | | * @param subArr |
| | | */ |
| | | private void addPrice(Integer lineId, @RequestParam String subArr) { |
| | | JSONArray jsonArray = JSON.parseArray(subArr); |
| | | int size = jsonArray.size(); |
| | | for (int i = 0; i < size; i++) { |
| | | JSONObject jsonObject = jsonArray.getJSONObject(i); |
| | | TLinePrice price = new TLinePrice(); |
| | | price.setLineId(lineId); |
| | | price.setServerCarModelId(jsonObject.getInteger("serverModelId")); |
| | | price.setType(jsonObject.getInteger("type")); |
| | | price.setContent(jsonObject.getString("content")); |
| | | price.setContentStr(jsonObject.getString("contentStr")); |
| | | price.setState(1); |
| | | price.setInsertTime(new Date()); |
| | | price.setAddTime(jsonObject.getString("time")); |
| | | itLinePriceService.insert(price); |
| | | } |
| | | } |
| | | |
| | | /** |
| | | * 操作跨城站点管理 |
| | | * optType 1=删除 2=冻结 3=解冻 |
| | | */ |
| | | @RequestMapping(value = "/opt") |
| | | @ResponseBody |
| | | public Object opt(@RequestParam Integer tLineId,@RequestParam Integer optType) { |
| | | TLine tLine = tLineService.selectById(tLineId); |
| | | if (1 == optType){ |
| | | tLine.setState(3); |
| | | }else if (2 == optType){ |
| | | tLine.setState(2); |
| | | }else if (3 == optType){ |
| | | tLine.setState(1); |
| | | } |
| | | tLineService.updateById(tLine); |
| | | return SUCCESS_TIP; |
| | | } |
| | | |
| | | /** |
| | | * 分配企业操作 |
| | | */ |
| | | @RequestMapping(value = "/addCompany") |
| | | @ResponseBody |
| | | public Object addCompany(Integer lineId,@RequestParam String comArr) { |
| | | //删除分配企业 |
| | | itLineCompanyService.delete(new EntityWrapper<TLineCompany>().eq("lineId",lineId)); |
| | | //添加企业 |
| | | if (SinataUtil.isNotEmpty(comArr)){ |
| | | JSONArray jsonArray = JSON.parseArray(comArr); |
| | | int size = jsonArray.size(); |
| | | for (int i = 0; i < size; i++) { |
| | | JSONObject jsonObject = jsonArray.getJSONObject(i); |
| | | TLineCompany lineCompany = new TLineCompany(); |
| | | lineCompany.setLineId(lineId); |
| | | lineCompany.setCompanyId(jsonObject.getInteger("companyId")); |
| | | lineCompany.setInsertTime(new Date()); |
| | | lineCompany.setInsertUserId(ShiroKit.getUser().getId()); |
| | | itLineCompanyService.insert(lineCompany); |
| | | } |
| | | } |
| | | return SUCCESS_TIP; |
| | | } |
| | | /** |
| | | * 修改跨城站点管理 |
| | | */ |
| | | @RequestMapping(value = "/update") |
| | | @ResponseBody |
| | | public ResultUtil update(TLine tLine,Integer startSiteId,Integer endSiteId,@RequestParam String subArr,@RequestParam String shuArr) { |
| | | String name = tLine.getName(); |
| | | name = name.replaceAll("& lt;", "<"); |
| | | name = name.replaceAll("& gt;", ">"); |
| | | name = name.replaceAll("& #40;", "("); |
| | | name = name.replaceAll("& #41;", ")"); |
| | | tLine.setName(name); |
| | | tLineService.updateById(tLine); |
| | | |
| | | //修改站点起点 |
| | | TLineSite start = itLineSiteService.selectOne(new EntityWrapper<TLineSite>().eq("lineId", tLine.getId()).eq("type", 1)); |
| | | if (SinataUtil.isNotEmpty(start)){ |
| | | if (start.getSiteId().intValue() != startSiteId.intValue()){ |
| | | start.setSiteId(startSiteId); |
| | | itLineSiteService.updateById(start); |
| | | } |
| | | }else{ |
| | | start = new TLineSite(); |
| | | start.setLineId(tLine.getId()); |
| | | start.setSiteId(startSiteId); |
| | | start.setType(1); |
| | | itLineSiteService.insert(start); |
| | | } |
| | | //修改站点终点 |
| | | TLineSite end = itLineSiteService.selectOne(new EntityWrapper<TLineSite>().eq("lineId", tLine.getId()).eq("type", 2)); |
| | | if (SinataUtil.isNotEmpty(end)){ |
| | | if (end.getSiteId().intValue() != endSiteId.intValue()){ |
| | | end.setSiteId(endSiteId); |
| | | itLineSiteService.updateById(end); |
| | | } |
| | | }else{ |
| | | end = new TLineSite(); |
| | | end.setLineId(tLine.getId()); |
| | | end.setSiteId(endSiteId); |
| | | end.setType(2); |
| | | itLineSiteService.insert(end); |
| | | } |
| | | |
| | | //删除线路价格 |
| | | itLinePriceService.delete(new EntityWrapper<TLinePrice>().eq("lineId",tLine.getId())); |
| | | //添加价格设置 |
| | | addPrice(tLine.getId(), subArr); |
| | | //删除线路班次 |
| | | itLineShiftService.delete(new EntityWrapper<TLineShift>().eq("lineId",tLine.getId())); |
| | | //添加班次设置 |
| | | return addShift(tLine.getId(), shuArr); |
| | | |
| | | } |
| | | |
| | | } |
New file |
| | |
| | | package com.stylefeng.guns.modular.system.controller.specialTrain; |
| | | |
| | | import com.alibaba.fastjson.JSON; |
| | | import com.alibaba.fastjson.JSONArray; |
| | | import com.alibaba.fastjson.JSONObject; |
| | | import com.baomidou.mybatisplus.mapper.EntityWrapper; |
| | | import com.baomidou.mybatisplus.plugins.Page; |
| | | import com.stylefeng.guns.core.base.controller.BaseController; |
| | | import com.stylefeng.guns.core.common.constant.factory.PageFactory; |
| | | import com.stylefeng.guns.core.log.LogObjectHolder; |
| | | import com.stylefeng.guns.core.shiro.ShiroKit; |
| | | import com.stylefeng.guns.core.util.SinataUtil; |
| | | import com.stylefeng.guns.modular.system.model.TLocation; |
| | | import com.stylefeng.guns.modular.system.model.TRegion; |
| | | import com.stylefeng.guns.modular.system.model.TSite; |
| | | import com.stylefeng.guns.modular.system.service.ITLocationService; |
| | | import com.stylefeng.guns.modular.system.service.ITRegionService; |
| | | import com.stylefeng.guns.modular.system.service.ITSiteService; |
| | | import com.stylefeng.guns.modular.system.util.GDMapElectricFenceUtil; |
| | | import com.stylefeng.guns.modular.system.util.ResultUtil; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.stereotype.Controller; |
| | | import org.springframework.ui.Model; |
| | | import org.springframework.web.bind.annotation.PathVariable; |
| | | import org.springframework.web.bind.annotation.RequestMapping; |
| | | import org.springframework.web.bind.annotation.RequestParam; |
| | | import org.springframework.web.bind.annotation.ResponseBody; |
| | | |
| | | import java.util.ArrayList; |
| | | import java.util.Date; |
| | | import java.util.List; |
| | | import java.util.Map; |
| | | |
| | | /** |
| | | * 机场站点管理控制器 |
| | | */ |
| | | @Controller |
| | | @RequestMapping("/airSite") |
| | | public class AirSiteController extends BaseController { |
| | | |
| | | private String PREFIX = "/system/airSite/"; |
| | | |
| | | @Autowired |
| | | private ITSiteService tSiteService; |
| | | |
| | | @Autowired |
| | | private ITRegionService tRegionService; |
| | | |
| | | @Autowired |
| | | private ITLocationService itLocationService; |
| | | |
| | | @Autowired |
| | | private GDMapElectricFenceUtil gdMapElectricFenceUtil; |
| | | |
| | | |
| | | |
| | | /** |
| | | * 跳转到跨城站点管理首页 |
| | | */ |
| | | @RequestMapping("") |
| | | public String index() { |
| | | return PREFIX + "airSite.html"; |
| | | } |
| | | |
| | | /** |
| | | * 跳转到添加景区站点管理 |
| | | */ |
| | | @RequestMapping("/airSite_add") |
| | | public String tSiteAdd(Model model) { |
| | | //省 |
| | | List<TRegion> provinceList = tRegionService.selectList(new EntityWrapper<TRegion>().eq("parent_id", 0)); |
| | | model.addAttribute("provinceList",provinceList); |
| | | return PREFIX + "airSite_add.html"; |
| | | } |
| | | |
| | | /** |
| | | * 跳转到修改景区站点管理 |
| | | */ |
| | | @RequestMapping("/airSite_update/{tSiteId}") |
| | | public String tSiteUpdate(@PathVariable Integer tSiteId, Model model) { |
| | | TSite tSite = tSiteService.selectById(tSiteId); |
| | | model.addAttribute("item",tSite); |
| | | LogObjectHolder.me().set(tSite); |
| | | |
| | | //省 |
| | | List<TRegion> provinceList = tRegionService.selectList(new EntityWrapper<TRegion>().eq("parent_id", 0)); |
| | | model.addAttribute("provinceList",provinceList); |
| | | |
| | | TRegion province = tRegionService.selectOne(new EntityWrapper<TRegion>().eq("code", tSite.getProvinceCode())); |
| | | //市 |
| | | List<TRegion> cityList = tRegionService.selectList(new EntityWrapper<TRegion>().eq("parent_id", province.getId())); |
| | | model.addAttribute("cityList",cityList); |
| | | |
| | | if (SinataUtil.isNotEmpty(tSite.getCityCode())){ |
| | | TRegion city = tRegionService.selectOne(new EntityWrapper<TRegion>().eq("code", tSite.getCityCode())); |
| | | //区 |
| | | List<TRegion> areaList = tRegionService.selectList(new EntityWrapper<TRegion>().eq("parent_id", city.getId())); |
| | | model.addAttribute("areaList",areaList); |
| | | }else{ |
| | | model.addAttribute("areaList",null); |
| | | } |
| | | |
| | | //查询所有的站点区域 |
| | | List<TLocation> locationList = itLocationService.selectList(new EntityWrapper<TLocation>().eq("siteId", tSite.getId()).ne("state", 3)); |
| | | model.addAttribute("locationList",locationList); |
| | | model.addAttribute("disabled","disabled"); |
| | | |
| | | Integer type = itLocationService.selectList(new EntityWrapper<TLocation>().eq("siteId", tSite.getId())).get(0).getType(); |
| | | model.addAttribute("type1", type == 1 ? "block" : "none"); |
| | | model.addAttribute("type2", type == 1 ? "none" : "block"); |
| | | model.addAttribute("checked1", type == 1 ? "checked" : ""); |
| | | model.addAttribute("checked2", type == 1 ? "" : "checked"); |
| | | return PREFIX + "airSite_edit.html"; |
| | | } |
| | | |
| | | /** |
| | | * 获取景区站点管理列表 |
| | | */ |
| | | @RequestMapping(value = "/list") |
| | | @ResponseBody |
| | | public Object list(String insertTime,String name,String insertUser,String city,Integer state) { |
| | | String beginTime = null; |
| | | String endTime = null; |
| | | if (SinataUtil.isNotEmpty(insertTime)){ |
| | | String[] timeArray = insertTime.split(" - "); |
| | | beginTime = timeArray[0]; |
| | | endTime = timeArray[1]; |
| | | } |
| | | Page<Map<String, Object>> page = new PageFactory<Map<String, Object>>().defaultPage(); |
| | | if (ShiroKit.getUser().getRoleType() != 1){ |
| | | page.setRecords(null); |
| | | }else{ |
| | | page.setRecords(tSiteService.getSiteList(page,beginTime,endTime,name,insertUser,city,state,2)); |
| | | } |
| | | return super.packForBT(page); |
| | | } |
| | | |
| | | /** |
| | | * 新增跨城站点管理 |
| | | */ |
| | | @RequestMapping(value = "/add") |
| | | @ResponseBody |
| | | public Object add(TSite tSite,@RequestParam String subArr) { |
| | | tSite.setInsertTime(new Date()); |
| | | tSite.setInsertUserId(ShiroKit.getUser().getId()); |
| | | tSite.setState(1); |
| | | tSite.setType(2); |
| | | tSiteService.insert(tSite); |
| | | |
| | | //添加站点区域 |
| | | addLocation(subArr,tSite.getId()); |
| | | return ResultUtil.success(); |
| | | } |
| | | |
| | | /** |
| | | * 添加站点区域 |
| | | * @param subArr |
| | | * @param id |
| | | */ |
| | | public void addLocation(String subArr,Integer id){ |
| | | JSONArray jsonArray = JSON.parseArray(subArr); |
| | | int size = jsonArray.size(); |
| | | for (int i = 0; i < size; i++){ |
| | | JSONObject jsonObject = jsonArray.getJSONObject(i); |
| | | TLocation location = new TLocation(); |
| | | location.setSiteId(id); |
| | | location.setName(jsonObject.getString("name")); |
| | | location.setInsertTime(new Date()); |
| | | location.setAddTime(jsonObject.getString("time")); |
| | | location.setState(1); |
| | | location.setUpdateTime(new Date()); |
| | | Integer type = jsonObject.getInteger("areaType"); |
| | | location.setType(type); |
| | | if (1 == type){ |
| | | if (SinataUtil.isNotEmpty(jsonObject.getString("provinceCode"))){ |
| | | location.setProvince(jsonObject.getString("province")); |
| | | location.setProvinceCode(jsonObject.getString("provinceCode")); |
| | | } |
| | | if (SinataUtil.isNotEmpty(jsonObject.getString("cityCode"))){ |
| | | location.setCity(jsonObject.getString("city")); |
| | | location.setCityCode(jsonObject.getString("cityCode")); |
| | | } |
| | | if (SinataUtil.isNotEmpty(jsonObject.getString("districtCode"))){ |
| | | location.setDistrict(jsonObject.getString("district")); |
| | | location.setDistrictCode(jsonObject.getString("districtCode")); |
| | | } |
| | | }else if (2 == type){ |
| | | String coordinate = jsonObject.getString("coordinate"); |
| | | coordinate = coordinate.substring(0, coordinate.length() - 1); |
| | | location.setCoordinate(coordinate); |
| | | } |
| | | itLocationService.insert(location); |
| | | |
| | | if(type == 2){ |
| | | List<String> fence = gdMapElectricFenceUtil.createFence(location.getId().toString(), location.getCoordinate()); |
| | | TLocation location1 = itLocationService.selectById(location.getId()); |
| | | String s = ""; |
| | | for(String gid : fence){ |
| | | s += gid + "_"; |
| | | } |
| | | location1.setGid(s.substring(0, s.length() - 1)); |
| | | location1.setUpdateTime(new Date()); |
| | | itLocationService.updateById(location1); |
| | | } |
| | | } |
| | | } |
| | | |
| | | /** |
| | | * 操作跨城站点管理 |
| | | * optType 1=删除 2=冻结 3=解冻 |
| | | */ |
| | | @RequestMapping(value = "/opt") |
| | | @ResponseBody |
| | | public Object opt(@RequestParam Integer tSiteId,@RequestParam Integer optType) { |
| | | TSite tSite = tSiteService.selectById(tSiteId); |
| | | if (1 == optType){ |
| | | tSite.setState(3); |
| | | }else if (2 == optType){ |
| | | tSite.setState(2); |
| | | }else if (3 == optType){ |
| | | tSite.setState(1); |
| | | } |
| | | tSiteService.updateById(tSite); |
| | | return SUCCESS_TIP; |
| | | } |
| | | |
| | | /** |
| | | * 修改跨城站点管理 |
| | | */ |
| | | @RequestMapping(value = "/update") |
| | | @ResponseBody |
| | | public Object update(TSite tSite,@RequestParam String subArr) { |
| | | tSiteService.updateById(tSite); |
| | | |
| | | //删除站点区域 |
| | | JSONArray jsonArray = JSON.parseArray(subArr); |
| | | List<TLocation> siteId = itLocationService.selectList(new EntityWrapper<TLocation>().eq("siteId", tSite.getId())); |
| | | List<TLocation> del = new ArrayList<>(); |
| | | List<Object> add = new ArrayList<>(); |
| | | for(TLocation location : siteId){ |
| | | boolean b = true; |
| | | for(int i = 0; i < jsonArray.size(); i++){ |
| | | if(jsonArray.getJSONObject(i).getIntValue("id") == location.getId()){ |
| | | b = false; |
| | | } |
| | | } |
| | | if(b){ |
| | | del.add(location); |
| | | continue; |
| | | } |
| | | } |
| | | for(int i = 0; i < jsonArray.size(); i++){ |
| | | if(jsonArray.getJSONObject(i).getInteger("id") == null){ |
| | | add.add(jsonArray.get(i)); |
| | | } |
| | | } |
| | | for(TLocation location : del){ |
| | | if(location.getType() == 2){ |
| | | String[] s = location.getGid().split("_"); |
| | | for(String gid : s){ |
| | | gdMapElectricFenceUtil.deleteElectricFenc(gid); |
| | | } |
| | | } |
| | | itLocationService.deleteById(location.getId()); |
| | | } |
| | | |
| | | //添加站点区域 |
| | | addLocation(JSON.toJSONString(add),tSite.getId()); |
| | | return SUCCESS_TIP; |
| | | } |
| | | |
| | | /** |
| | | * 跨城站点管理详情 |
| | | */ |
| | | @RequestMapping(value = "/detail/{tSiteId}") |
| | | @ResponseBody |
| | | public Object detail(@PathVariable("tSiteId") Integer tSiteId) { |
| | | return tSiteService.selectById(tSiteId); |
| | | } |
| | | } |
| | |
| | | @RequestMapping("/tLine_add") |
| | | public String tLineAdd(Model model) { |
| | | //站点 |
| | | List<TSite> siteList = itSiteService.selectList(new EntityWrapper<TSite>().eq("state", 1)); |
| | | List<TSite> siteList = itSiteService.selectList(new EntityWrapper<TSite>().eq("state", 1).eq("type",1)); |
| | | model.addAttribute("siteList",siteList); |
| | | //跨城车型 |
| | | List<TServerCarmodel> carmodelList = itServerCarmodelService.selectList(new EntityWrapper<TServerCarmodel>().eq("type", 2).eq("state", 1)); |
| | |
| | | if (ShiroKit.getUser().getRoleType() != 1){ |
| | | page.setRecords(null); |
| | | }else{ |
| | | page.setRecords(tLineService.getLineList(page,beginTime,endTime,name,insertUser,modelStr,state)); |
| | | page.setRecords(tLineService.getLineList(page,beginTime,endTime,name,insertUser,modelStr,state,1)); |
| | | } |
| | | return super.packForBT(page); |
| | | } |
| | |
| | | tLine.setName(name); |
| | | tLine.setState(1); |
| | | tLine.setInsertTime(new Date()); |
| | | tLine.setType(1); |
| | | tLine.setInsertUserId(ShiroKit.getUser().getId()); |
| | | tLineService.insert(tLine); |
| | | |
| | |
| | | |
| | | |
| | | /** |
| | | * 跳转到跨城站点管理首页 |
| | | * 跳转到景区站点管理首页 |
| | | */ |
| | | @RequestMapping("") |
| | | public String index() { |
| | |
| | | } |
| | | |
| | | /** |
| | | * 跳转到添加跨城站点管理 |
| | | * 跳转到添加景区站点管理 |
| | | */ |
| | | @RequestMapping("/tSite_add") |
| | | public String tSiteAdd(Model model) { |
| | |
| | | } |
| | | |
| | | /** |
| | | * 跳转到修改跨城站点管理 |
| | | * 跳转到修改景区站点管理 |
| | | */ |
| | | @RequestMapping("/tSite_update/{tSiteId}") |
| | | public String tSiteUpdate(@PathVariable Integer tSiteId, Model model) { |
| | |
| | | } |
| | | |
| | | /** |
| | | * 获取跨城站点管理列表 |
| | | * 获取景区站点管理列表 |
| | | */ |
| | | @RequestMapping(value = "/list") |
| | | @ResponseBody |
| | |
| | | if (ShiroKit.getUser().getRoleType() != 1){ |
| | | page.setRecords(null); |
| | | }else{ |
| | | page.setRecords(tSiteService.getSiteList(page,beginTime,endTime,name,insertUser,city,state)); |
| | | page.setRecords(tSiteService.getSiteList(page,beginTime,endTime,name,insertUser,city,state,1)); |
| | | } |
| | | return super.packForBT(page); |
| | | } |
| | |
| | | tSite.setInsertTime(new Date()); |
| | | tSite.setInsertUserId(ShiroKit.getUser().getId()); |
| | | tSite.setState(1); |
| | | tSite.setType(1); |
| | | tSiteService.insert(tSite); |
| | | |
| | | //添加站点区域 |
| | |
| | | @Param("name") String name, |
| | | @Param("insertUser") String insertUser, |
| | | @Param("modelStr") String modelStr, |
| | | @Param("state") Integer state); |
| | | @Param("state") Integer state, |
| | | @Param("type") Integer type); |
| | | |
| | | /** |
| | | * 根据线路ID查询线路价格 |
| | |
| | | @Param("name") String name, |
| | | @Param("insertUser") String insertUser, |
| | | @Param("city") String city, |
| | | @Param("state") Integer state); |
| | | @Param("state") Integer state, |
| | | @Param("type") Integer type); |
| | | |
| | | |
| | | List<TSite> query(@Param("provinceCode") String provinceCode, @Param("cityCode")String cityCode, |
| | |
| | | LEFT JOIN (SELECT COUNT(id) as num,lineId FROM t_line_company GROUP BY lineId) as lc on lc.lineId = ll.id |
| | | ) as o |
| | | <where> |
| | | o.state != 3 |
| | | o.state != 3 and o.type = #{type} |
| | | <if test="beginTime != null and beginTime != '' and endTime != null and endTime != ''"> |
| | | AND (o.insertTime between CONCAT(#{beginTime},' 00:00:00') and CONCAT(#{endTime},' 23:59:59')) |
| | | </if> |
| | |
| | | LEFT JOIN sys_user as uu on uu.id = ss.insertUserId |
| | | LEFT JOIN (SELECT COUNT(a.id) as num,siteId FROM t_line_site a left join t_line b on (a.lineId = b.id) where b.state != 3 GROUP BY a.siteId) as ls on ls.siteId = ss.id) as o |
| | | <where> |
| | | o.state != 3 |
| | | o.state != 3 and o.type = #{type} |
| | | <if test="beginTime != null and beginTime != '' and endTime != null and endTime != ''"> |
| | | AND (o.insertTime between CONCAT(#{beginTime},' 00:00:00') and CONCAT(#{endTime},' 23:59:59')) |
| | | </if> |
| | |
| | | */ |
| | | private Integer insertUserId; |
| | | |
| | | /** |
| | | * 类型 1景区 2机场 |
| | | */ |
| | | private Integer type; |
| | | |
| | | public Integer getType() { |
| | | return type; |
| | | } |
| | | |
| | | public void setType(Integer type) { |
| | | this.type = type; |
| | | } |
| | | |
| | | public Integer getInsertUserId() { |
| | | return insertUserId; |
| | | } |
| | |
| | | */ |
| | | private Integer insertUserId; |
| | | |
| | | /** |
| | | * 1景区 2机场 |
| | | */ |
| | | private Integer type; |
| | | |
| | | public Integer getType() { |
| | | return type; |
| | | } |
| | | |
| | | public void setType(Integer type) { |
| | | this.type = type; |
| | | } |
| | | |
| | | public Integer getId() { |
| | | return id; |
| | |
| | | @Param("name") String name, |
| | | @Param("insertUser") String insertUser, |
| | | @Param("modelStr") String modelStr, |
| | | @Param("state") Integer state); |
| | | @Param("state") Integer state, |
| | | @Param("type") Integer type); |
| | | |
| | | /** |
| | | * 根据线路ID查询线路价格 |
| | |
| | | @Param("name") String name, |
| | | @Param("insertUser") String insertUser, |
| | | @Param("city") String city, |
| | | @Param("state") Integer state); |
| | | @Param("state") Integer state, |
| | | @Param("type") Integer type); |
| | | |
| | | |
| | | |
| | |
| | | public class TLineServiceImpl extends ServiceImpl<TLineMapper, TLine> implements ITLineService { |
| | | |
| | | @Override |
| | | public List<Map<String, Object>> getLineList(Page<Map<String, Object>> page, String beginTime, String endTime, String name, String insertUser, String modelStr, Integer state) { |
| | | return this.baseMapper.getLineList(page, beginTime, endTime, name, insertUser, modelStr, state); |
| | | public List<Map<String, Object>> getLineList(Page<Map<String, Object>> page, String beginTime, String endTime, String name, String insertUser, String modelStr, Integer state,Integer type) { |
| | | return this.baseMapper.getLineList(page, beginTime, endTime, name, insertUser, modelStr, state,type); |
| | | } |
| | | |
| | | @Override |
| | |
| | | private TSiteMapper siteMapper; |
| | | |
| | | @Override |
| | | public List<Map<String, Object>> getSiteList(Page<Map<String, Object>> page, String beginTime, String endTime, String name, String insertUser, String city, Integer state) { |
| | | return this.baseMapper.getSiteList(page, beginTime, endTime, name, insertUser, city, state); |
| | | public List<Map<String, Object>> getSiteList(Page<Map<String, Object>> page, String beginTime, String endTime, String name, String insertUser, String city, Integer state,Integer type) { |
| | | return this.baseMapper.getSiteList(page, beginTime, endTime, name, insertUser, city, state,type); |
| | | } |
| | | |
| | | @Override |
New file |
| | |
| | | @layout("/common/_container.html"){ |
| | | <div class="row"> |
| | | <div class="col-sm-12"> |
| | | <div class="ibox float-e-margins"> |
| | | <div class="ibox-title"> |
| | | <h5>机场线路管理</h5> |
| | | </div> |
| | | <div class="ibox-content"> |
| | | <div class="row row-lg"> |
| | | <div class="col-sm-12"> |
| | | <div class="row"> |
| | | <div class="col-sm-3"> |
| | | <#TimeCon id="insertTime" name="添加时间" isTime="false"/> |
| | | </div> |
| | | <div class="col-sm-3"> |
| | | <#NameCon id="name" name="线路名称" /> |
| | | </div> |
| | | <div class="col-sm-3"> |
| | | <#NameCon id="insertUser" name="创建者" /> |
| | | </div> |
| | | <div class="col-sm-3"> |
| | | <#NameCon id="modelStr" name="关联车型" /> |
| | | </div> |
| | | <div class="col-sm-3"> |
| | | <#SelectCon id="state" name="状态" > |
| | | <option value="">全部</option> |
| | | <option value="1">正常</option> |
| | | <option value="2">冻结</option> |
| | | </#SelectCon> |
| | | </div> |
| | | <div class="col-sm-3"> |
| | | <#button name="搜索" icon="fa-search" clickFun="TLine.search()"/> |
| | | <#button name="重置" icon="fa-trash" clickFun="TLine.resetSearch()" space="true"/> |
| | | </div> |
| | | </div> |
| | | <div class="hidden-xs" id="TLineTableToolbar" role="group"> |
| | | @if(shiro.hasPermission("/airLine/add")){ |
| | | <#button name="添加" icon="fa-plus" clickFun="TLine.openAddTLine()"/> |
| | | @} |
| | | @if(shiro.hasPermission("/airLine/update")){ |
| | | <#button name="编辑" icon="fa-edit" clickFun="TLine.openTLineDetail()" space="true"/> |
| | | @} |
| | | @if(shiro.hasPermission("/airLine/delete")){ |
| | | <#button name="删除" icon="fa-remove" clickFun="TLine.opt(1)" space="true"/> |
| | | @} |
| | | @if(shiro.hasPermission("/airLine/freeze")){ |
| | | <#button name="冻结" icon="fa-remove" clickFun="TLine.opt(2)" space="true"/> |
| | | @} |
| | | @if(shiro.hasPermission("/airLine/thaw")){ |
| | | <#button name="解冻" icon="fa-remove" clickFun="TLine.opt(3)" space="true"/> |
| | | @} |
| | | @if(shiro.hasPermission("/airLine/addCompany")){ |
| | | <#button name="分配企业" icon="fa-plus" clickFun="TLine.addCompany()" space="true"/> |
| | | @} |
| | | </div> |
| | | <#table id="TLineTable"/> |
| | | </div> |
| | | </div> |
| | | </div> |
| | | </div> |
| | | </div> |
| | | </div> |
| | | <script src="${ctxPath}/static/modular/system/airLine/airLine.js"></script> |
| | | <script> |
| | | laydate.render({ |
| | | elem: '#insertTime' |
| | | ,range: true |
| | | }); |
| | | </script> |
| | | @} |
New file |
| | |
| | | @layout("/common/_container.html"){ |
| | | <style> |
| | | .newWidth, .single-line{ |
| | | max-width:150px !important;display: initial !important; |
| | | } |
| | | .newWidth1, .single-line{ |
| | | max-width:200px !important;display: initial !important; |
| | | } |
| | | </style> |
| | | <div class="ibox float-e-margins"> |
| | | <div class="ibox-content"> |
| | | <div class="form-horizontal" id="lineInfoForm"> |
| | | <div class="row" style="margin-top: 15px;"> |
| | | <div class="col-sm-4"> |
| | | <h2 style="font-weight: 700;">基础设置</h2> |
| | | </div> |
| | | </div> |
| | | <div class="row"> |
| | | <div class="col-sm-11"> |
| | | <div class="form-group"> |
| | | <label class="col-sm-2 control-label">线路名称:</label> |
| | | <div class="col-sm-5"> |
| | | <input type="text" class="form-control" id="name" name="name"> |
| | | </div> |
| | | </div> |
| | | <div class="form-group"> |
| | | <label class="col-sm-2 control-label">起点:</label> |
| | | <div class="col-sm-2"> |
| | | <select class="form-control" id="startSiteId" > |
| | | <option value="">选择站点</option> |
| | | @for(obj in siteList){ |
| | | <option value="${obj.id}">${obj.name}</option> |
| | | @} |
| | | </select> |
| | | </div> |
| | | </div> |
| | | <div class="form-group"> |
| | | <label class="col-sm-2 control-label">终点:</label> |
| | | <div class="col-sm-2"> |
| | | <select class="form-control" id="endSiteId" > |
| | | <option value="">选择站点</option> |
| | | @for(obj in siteList){ |
| | | <option value="${obj.id}">${obj.name}</option> |
| | | @} |
| | | </select> |
| | | </div> |
| | | </div> |
| | | <div class="form-group"> |
| | | <label class="col-sm-2 control-label">司机申请限制:</label> |
| | | <div class="col-sm-6"> |
| | | 司机申请班次的最小时间间隔为 <input type="text" oninput="checkIsMinute(this)" class="form-control newWidth" id="shiftInterval" name="shiftInterval"> 分钟 |
| | | </div> |
| | | </div> |
| | | <div class="form-group"> |
| | | <label class="col-sm-2 control-label">抽成比例:</label> |
| | | <div class="col-sm-6"> |
| | | <input type="text" oninput="checkIsBiLi(this)" class="form-control newWidth" id="rakeRate" name="rakeRate"> % |
| | | </div> |
| | | </div> |
| | | </div> |
| | | </div> |
| | | |
| | | <div class="row" style="margin-top: 30px;"> |
| | | <div class="col-sm-4"> |
| | | <h2 style="font-weight: 700;">价格设置</h2> |
| | | </div> |
| | | </div> |
| | | |
| | | <div class="row"> |
| | | <div class="col-sm-11"> |
| | | <div class="form-group"> |
| | | <label class="col-sm-2 control-label">选择车型:</label> |
| | | <div class="col-sm-2"> |
| | | <select class="form-control" id="serverModelId" > |
| | | <option value="">选择车型</option> |
| | | @for(obj in carmodelList){ |
| | | <option value="${obj.id}">${obj.name}</option> |
| | | @} |
| | | </select> |
| | | </div> |
| | | </div> |
| | | <div class="form-group"> |
| | | <label class="col-sm-2 control-label">选择车型:</label> |
| | | <div class="col-sm-2" style="display: flex;align-items: center;"> |
| | | <div class="radio radio-info radio-inline"> |
| | | <input type="radio" id="type1" value="1" name="type" checked="" onclick="TLineInfoDlg.typeClick(1)"> |
| | | <label for="type1"> 固定计价 </label> |
| | | </div> |
| | | <div class="radio radio-success radio-inline"> |
| | | <input type="radio" id="type2" value="2" name="type" onclick="TLineInfoDlg.typeClick(2)"> |
| | | <label for="type2"> 浮动计价 </label> |
| | | </div> |
| | | </div> |
| | | </div> |
| | | |
| | | <div class="form-group" id="fixedDiv"> |
| | | <label class="col-sm-2 control-label">固定计价:</label> |
| | | <div class="col-sm-10"> |
| | | 单人价格: <input type="text" oninput="checkIsYuan(this)" name="num1" id="num1" class="form-control newWidth" /> 元; |
| | | 包车价格: <input type="text" oninput="checkIsYuan(this)" name="num2" id="num2" class="form-control newWidth" /> 元;<br><br> |
| | | 五座系数: <input type="text" oninput="checkIsXiShu(this)" name="num3" id="num3" class="form-control newWidth" /> ; |
| | | 七座系数: <input type="text" oninput="checkIsXiShu(this)" name="num4" id="num4" class="form-control newWidth" /> ; |
| | | </div> |
| | | </div> |
| | | |
| | | <div class="form-group" id="floatDiv" style="display: none;"> |
| | | <label class="col-sm-2 control-label">浮动计价:</label> |
| | | <div class="col-sm-10"> |
| | | 参考价格: <input type="text" oninput="checkIsYuan(this)" name="num11" id="num11" class="form-control newWidth" /> 元; |
| | | 参考里程: <input type="text" oninput="checkIsYuan(this)" name="num12" id="num12" class="form-control newWidth" /> 公里;<br><br> |
| | | 保底价: <input type="text" oninput="checkIsYuan(this)" name="num13" id="num13" class="form-control newWidth" /> 元; |
| | | 超出参考里程优惠系数: <input type="text" oninput="checkIsXiShu1(this)" name="num14" id="num14" class="form-control newWidth" /> ;<br><br> |
| | | 低于参考里程优惠系数: <input type="text" oninput="checkIsXiShu(this)" name="num15" id="num15" class="form-control newWidth" /> ; |
| | | 包车系数: <input type="text" oninput="checkIsXiShu(this)" name="num16" id="num16" class="form-control newWidth" /> ;<br><br> |
| | | 五座系数: <input type="text" oninput="checkIsXiShu(this)" name="num17" id="num17" class="form-control newWidth" /> ; |
| | | 七座系数: <input type="text" oninput="checkIsXiShu(this)" name="num18" id="num18" class="form-control newWidth" /> ;<br><br> |
| | | </div> |
| | | </div> |
| | | |
| | | <div class="form-group"> |
| | | <label class="col-sm-2 control-label"></label> |
| | | <div class="col-sm-10"> |
| | | <#button btnCss="info" name="添加" id="ensure" icon="fa-check" clickFun="TLineInfoDlg.addPrice()"/> |
| | | </div> |
| | | </div> |
| | | |
| | | <div class="form-group"> |
| | | <label class="col-sm-2 control-label">已添加价格</label> |
| | | <div class="col-sm-6"> |
| | | <div style="height: 200px; border: 1px solid #e5e6e7;overflow-y: auto;"> |
| | | <table class="table table-striped table-bordered table-hover table-condensed"> |
| | | <thead> |
| | | <tr> |
| | | <th style="width: 300px;text-align: center;">添加时间</th> |
| | | <th style="width: 300px;text-align: center;">车型名称</th> |
| | | <th style="width: 300px;text-align: center;">价格设置</th> |
| | | <th style="width: 100px;text-align: center;">操作</th> |
| | | </tr> |
| | | </thead> |
| | | <tbody id="priceValue"> |
| | | |
| | | </tbody> |
| | | </table> |
| | | </div> |
| | | </div> |
| | | </div> |
| | | </div> |
| | | </div> |
| | | |
| | | <div class="row" style="margin-top: 30px;"> |
| | | <div class="col-sm-4"> |
| | | <h2 style="font-weight: 700;">班次设置</h2> |
| | | </div> |
| | | </div> |
| | | <div class="row"> |
| | | <div class="col-sm-11"> |
| | | <div class="form-group"> |
| | | <label class="col-sm-2 control-label">班次时间:</label> |
| | | <div class="col-sm-2"> |
| | | <input type="text" name="shiftTime" id="shiftTime" class="form-control" placeholder="选择时间"/> |
| | | </div> |
| | | <label class="col-sm-1 control-label">车次数:</label> |
| | | <div class="col-sm-2"> |
| | | <input type="text" name="carNum" id="carNum" class="form-control" /> |
| | | </div> |
| | | <div class="col-sm-2"> |
| | | <#button btnCss="info" name="添加" id="ensure" icon="fa-check" clickFun="TLineInfoDlg.addShift()"/> |
| | | </div> |
| | | </div> |
| | | <div class="form-group"> |
| | | <label class="col-sm-2 control-label">已添加班次</label> |
| | | <div class="col-sm-6"> |
| | | <div style="height: 200px; border: 1px solid #e5e6e7;overflow-y: auto;"> |
| | | <table class="table table-striped table-bordered table-hover table-condensed"> |
| | | <thead> |
| | | <tr> |
| | | <th style="width: 300px;text-align: center;">添加时间</th> |
| | | <th style="width: 300px;text-align: center;">班次时间</th> |
| | | <th style="width: 300px;text-align: center;">车次数</th> |
| | | <th style="width: 100px;text-align: center;">操作</th> |
| | | </tr> |
| | | </thead> |
| | | <tbody id="shiftValue"> |
| | | |
| | | </tbody> |
| | | </table> |
| | | </div> |
| | | </div> |
| | | </div> |
| | | </div> |
| | | </div> |
| | | |
| | | |
| | | |
| | | |
| | | <div class="row btn-group-m-t"> |
| | | <div class="col-sm-10 col-sm-offset-5"> |
| | | <#button btnCss="info" name="提交" id="ensure" icon="fa-check" clickFun="TLineInfoDlg.addSubmit()"/> |
| | | <#button btnCss="danger" name="取消" id="cancel" icon="fa-eraser" clickFun="TLineInfoDlg.close()"/> |
| | | </div> |
| | | </div> |
| | | </div> |
| | | |
| | | </div> |
| | | </div> |
| | | <script src="${ctxPath}/static/modular/system/airLine/airLine_info.js"></script> |
| | | <script type="text/javascript"> |
| | | laydate.render({ |
| | | elem: '#shiftTime' |
| | | ,type: 'time' |
| | | ,range: '-' |
| | | ,format: 'HH:mm' |
| | | }); |
| | | var regDouble = /^(0|[1-9]\d{0,2})(\.\d{1,2})?$/; |
| | | var regXiShu = /^(0(\.\d{1,2})?|1?)$/; |
| | | var regXiShu1 = /^([1-9]{1,})(\.\d{1,2})?$/; |
| | | var regBiLi = /^([0-9]{1,2}$)|(^[0-9]{1,2}\.[0-9]{1,2}$)|100$/; |
| | | var regInt = /^[0-9]{0,3}$/; |
| | | function checkIsYuan(obj){ |
| | | var num = $(obj).val(); |
| | | if(!regDouble.test(num)){ |
| | | layer.msg("【元】输入框不能超过3位数,保留两位小数"); |
| | | } |
| | | } |
| | | function checkIsXiShu1(obj){ |
| | | var num = $(obj).val(); |
| | | if(!regXiShu1.test(num)){ |
| | | layer.msg("【系数】输入框大于1,保留两位小数"); |
| | | } |
| | | } |
| | | function checkIsXiShu(obj){ |
| | | var num = $(obj).val(); |
| | | if(!regXiShu.test(num)){ |
| | | layer.msg("【系数】输入框大于0小于1,保留两位小数"); |
| | | } |
| | | } |
| | | function checkIsBiLi(obj){ |
| | | var num = $(obj).val(); |
| | | if(!regBiLi.test(num)){ |
| | | layer.msg("【比例】输入框大于等于0小于100"); |
| | | } |
| | | } |
| | | function checkIsMinute(obj){ |
| | | var num = $(obj).val(); |
| | | if(!regInt.test(num)){ |
| | | layer.msg("【分钟】输入框不能超过3位数"); |
| | | } |
| | | } |
| | | |
| | | </script> |
| | | @} |
New file |
| | |
| | | @layout("/common/_container.html"){ |
| | | <div class="ibox float-e-margins"> |
| | | <div class="ibox-content"> |
| | | <div class="form-horizontal" id="lineInfoForm"> |
| | | <div class="row"> |
| | | <input type="hidden" id="lineId" name="lineId" value="${tLine.id}"> |
| | | <div class="col-sm-11"> |
| | | <div class="form-group"> |
| | | <label class="col-sm-2 control-label">线路名称:</label> |
| | | <div class="col-sm-9"> |
| | | <label class="control-label" id="name" name="name">${tLine.name}</label> |
| | | </div> |
| | | </div> |
| | | <div class="form-group"> |
| | | <label class="col-sm-2 control-label">选择企业:</label> |
| | | <div class="col-sm-2"> |
| | | <select class="form-control" id="companyId" > |
| | | <option value="">选择企业</option> |
| | | @for(obj in companyList){ |
| | | <option value="${obj.id}">${obj.name}</option> |
| | | @} |
| | | </select> |
| | | </div> |
| | | <div class="col-sm-2"> |
| | | <#button btnCss="info" name="添加" id="ensure" icon="fa-check" clickFun="TLineInfoDlg.addCompany()"/> |
| | | </div> |
| | | </div> |
| | | <div class="form-group"> |
| | | <label class="col-sm-2 control-label">已分配企业</label> |
| | | <div class="col-sm-6"> |
| | | <div style="height: 200px; border: 1px solid #e5e6e7;overflow-y: auto;"> |
| | | <table class="table table-striped table-bordered table-hover table-condensed"> |
| | | <thead> |
| | | <tr> |
| | | <th style="width: 300px;text-align: center;">公司名称</th> |
| | | <th style="width: 100px;text-align: center;">操作</th> |
| | | </tr> |
| | | </thead> |
| | | <tbody id="companyValue"> |
| | | @for(obj in lineCompanyList!){ |
| | | <tr class="companyValueClass"> |
| | | <td style="text-align: center;"><input type="hidden" id="companyIdValue" name="companyIdValue" value="${obj.companyId}">${obj.companyName}</td> |
| | | <td style="text-align: center;"><button onclick="deleteSub(this)">移除</button></td> |
| | | </tr> |
| | | @} |
| | | </tbody> |
| | | </table> |
| | | </div> |
| | | </div> |
| | | </div> |
| | | </div> |
| | | </div> |
| | | |
| | | <div class="row btn-group-m-t"> |
| | | <div class="col-sm-10 col-sm-offset-5"> |
| | | <#button btnCss="info" name="提交" id="ensure" icon="fa-check" clickFun="TLineInfoDlg.addCompanySubmit()"/> |
| | | <#button btnCss="danger" name="取消" id="cancel" icon="fa-eraser" clickFun="TLineInfoDlg.close()"/> |
| | | </div> |
| | | </div> |
| | | </div> |
| | | |
| | | </div> |
| | | </div> |
| | | <script src="${ctxPath}/static/modular/system/airLine/airLine_info.js"></script> |
| | | @} |
New file |
| | |
| | | @layout("/common/_container.html"){ |
| | | <style> |
| | | .newWidth, .single-line{ |
| | | max-width:150px !important;display: initial !important; |
| | | } |
| | | .newWidth1, .single-line{ |
| | | max-width:200px !important;display: initial !important; |
| | | } |
| | | </style> |
| | | <div class="ibox float-e-margins"> |
| | | <div class="ibox-content"> |
| | | <div class="form-horizontal" id="lineInfoForm"> |
| | | <div class="row" style="margin-top: 15px;"> |
| | | <div class="col-sm-4"> |
| | | <h2 style="font-weight: 700;">基础设置</h2> |
| | | </div> |
| | | </div> |
| | | <input type="hidden" id="id" name="id" value="${item.id}"> |
| | | <div class="row"> |
| | | <div class="col-sm-11"> |
| | | <div class="form-group"> |
| | | <label class="col-sm-2 control-label">线路名称:</label> |
| | | <div class="col-sm-5"> |
| | | <input type="text" class="form-control" id="name" name="name" value="${item.name}"> |
| | | </div> |
| | | </div> |
| | | <div class="form-group"> |
| | | <label class="col-sm-2 control-label">起点:</label> |
| | | <div class="col-sm-2"> |
| | | <select class="form-control" id="startSiteId" > |
| | | <option value="">选择站点</option> |
| | | @for(obj in siteList){ |
| | | <option value="${obj.id}" ${obj.id == start.siteId ? 'selected=selected' : ''}>${obj.name}</option> |
| | | @} |
| | | </select> |
| | | </div> |
| | | </div> |
| | | <div class="form-group"> |
| | | <label class="col-sm-2 control-label">终点:</label> |
| | | <div class="col-sm-2"> |
| | | <select class="form-control" id="endSiteId" > |
| | | <option value="">选择站点</option> |
| | | @for(obj in siteList){ |
| | | <option value="${obj.id}" ${obj.id == end.siteId ? 'selected=selected' : ''}>${obj.name}</option> |
| | | @} |
| | | </select> |
| | | </div> |
| | | </div> |
| | | <div class="form-group"> |
| | | <label class="col-sm-2 control-label">司机申请限制:</label> |
| | | <div class="col-sm-6"> |
| | | 司机申请班次的最小时间间隔为 <input type="text" oninput="checkIsMinute(this)" class="form-control newWidth" id="shiftInterval" name="shiftInterval" value="${item.shiftInterval}" > 分钟 |
| | | </div> |
| | | </div> |
| | | <div class="form-group"> |
| | | <label class="col-sm-2 control-label">抽成比例:</label> |
| | | <div class="col-sm-6"> |
| | | <input type="text" oninput="checkIsBiLi(this)" class="form-control newWidth" id="rakeRate" name="rakeRate" value="${item.rakeRate}"> % |
| | | </div> |
| | | </div> |
| | | </div> |
| | | </div> |
| | | |
| | | <div class="row" style="margin-top: 30px;"> |
| | | <div class="col-sm-4"> |
| | | <h2 style="font-weight: 700;">价格设置</h2> |
| | | </div> |
| | | </div> |
| | | <div class="row"> |
| | | <div class="col-sm-11"> |
| | | <div class="form-group"> |
| | | <label class="col-sm-2 control-label">选择车型:</label> |
| | | <div class="col-sm-2"> |
| | | <select class="form-control" id="serverModelId" > |
| | | <option value="">选择车型</option> |
| | | @for(obj in carmodelList){ |
| | | <option value="${obj.id}">${obj.name}</option> |
| | | @} |
| | | </select> |
| | | </div> |
| | | </div> |
| | | <div class="form-group"> |
| | | <label class="col-sm-2 control-label">选择车型:</label> |
| | | <div class="col-sm-2" style="display: flex;align-items: center;"> |
| | | <div class="radio radio-info radio-inline"> |
| | | <input type="radio" id="type1" value="1" name="type" checked="" onclick="TLineInfoDlg.typeClick(1)"> |
| | | <label for="type1"> 固定计价 </label> |
| | | </div> |
| | | <div class="radio radio-success radio-inline"> |
| | | <input type="radio" id="type2" value="2" name="type" onclick="TLineInfoDlg.typeClick(2)"> |
| | | <label for="type2"> 浮动计价 </label> |
| | | </div> |
| | | </div> |
| | | </div> |
| | | |
| | | <div class="form-group" id="fixedDiv"> |
| | | <label class="col-sm-2 control-label">固定计价:</label> |
| | | <div class="col-sm-10"> |
| | | 单人价格: <input type="text" oninput="checkIsYuan(this)" name="num1" id="num1" class="form-control newWidth" /> 元; |
| | | 包车价格: <input type="text" oninput="checkIsYuan(this)" name="num2" id="num2" class="form-control newWidth" /> 元;<br><br> |
| | | 五座系数: <input type="text" oninput="checkIsXiShu(this)" name="num3" id="num3" class="form-control newWidth" /> ; |
| | | 七座系数: <input type="text" oninput="checkIsXiShu(this)" name="num4" id="num4" class="form-control newWidth" /> ; |
| | | </div> |
| | | </div> |
| | | |
| | | <div class="form-group" id="floatDiv" style="display: none;"> |
| | | <label class="col-sm-2 control-label">浮动计价:</label> |
| | | <div class="col-sm-10"> |
| | | 参考价格: <input type="text" oninput="checkIsYuan(this)" name="num11" id="num11" class="form-control newWidth" /> 元; |
| | | 参考里程: <input type="text" oninput="checkIsYuan(this)" name="num12" id="num12" class="form-control newWidth" /> 公里;<br><br> |
| | | 保底价: <input type="text" oninput="checkIsYuan(this)" name="num13" id="num13" class="form-control newWidth" /> 元; |
| | | 超出参考里程优惠系数: <input type="text" oninput="checkIsXiShu1(this)" name="num14" id="num14" class="form-control newWidth" /> ;<br><br> |
| | | 低于参考里程优惠系数: <input type="text" oninput="checkIsXiShu(this)" name="num15" id="num15" class="form-control newWidth" /> ; |
| | | 包车系数: <input type="text" oninput="checkIsXiShu(this)" name="num16" id="num16" class="form-control newWidth" /> ;<br><br> |
| | | 五座系数: <input type="text" oninput="checkIsXiShu(this)" name="num17" id="num17" class="form-control newWidth" /> ; |
| | | 七座系数: <input type="text" oninput="checkIsXiShu(this)" name="num18" id="num18" class="form-control newWidth" /> ;<br><br> |
| | | </div> |
| | | </div> |
| | | |
| | | <div class="form-group"> |
| | | <label class="col-sm-2 control-label"></label> |
| | | <div class="col-sm-10"> |
| | | <#button btnCss="info" name="添加" id="ensure" icon="fa-check" clickFun="TLineInfoDlg.addPrice()"/> |
| | | </div> |
| | | </div> |
| | | |
| | | <div class="form-group"> |
| | | <label class="col-sm-2 control-label">已添加价格</label> |
| | | <div class="col-sm-6"> |
| | | <div style="height: 200px; border: 1px solid #e5e6e7;overflow-y: auto;"> |
| | | <table class="table table-striped table-bordered table-hover table-condensed"> |
| | | <thead> |
| | | <tr> |
| | | <th style="width: 300px;text-align: center;">添加时间</th> |
| | | <th style="width: 300px;text-align: center;">车型名称</th> |
| | | <th style="width: 300px;text-align: center;">价格设置</th> |
| | | <th style="width: 100px;text-align: center;">操作</th> |
| | | </tr> |
| | | </thead> |
| | | <tbody id="priceValue"> |
| | | @for(obj in linePriceList!){ |
| | | <tr class="typeValueClass"> |
| | | <td style="text-align: center;"><input type="hidden" id="timeValue" name="timeValue" value="${obj.addTime}">${obj.addTime}</td> |
| | | <td style="text-align: center;"><input type="hidden" id="serverModelIdValue" name="serverModelIdValue" value="${obj.serverCarModelId}">${obj.name}</td> |
| | | <td style="text-align: center;"><input type="hidden" id="typeValue" name="typeValue" value="${obj.type}"> |
| | | <input type="hidden" id="contentValue" name="contentValue" value='${obj.content}'> |
| | | <input type="hidden" id="contentStrValue" name="contentStrValue" value="${obj.contentStr}">${obj.contentStr}</td> |
| | | <td style="text-align: center;"><button onclick="deleteSub(this)">移除</button></td> |
| | | </tr> |
| | | @} |
| | | </tbody> |
| | | </table> |
| | | </div> |
| | | </div> |
| | | </div> |
| | | </div> |
| | | </div> |
| | | |
| | | <div class="row" style="margin-top: 30px;"> |
| | | <div class="col-sm-4"> |
| | | <h2 style="font-weight: 700;">班次设置</h2> |
| | | </div> |
| | | </div> |
| | | <div class="row"> |
| | | <div class="col-sm-11"> |
| | | <div class="form-group"> |
| | | <label class="col-sm-2 control-label">班次时间:</label> |
| | | <div class="col-sm-2"> |
| | | <input type="text" name="shiftTime" id="shiftTime" class="form-control" placeholder="选择时间"/> |
| | | </div> |
| | | <label class="col-sm-1 control-label">车次数:</label> |
| | | <div class="col-sm-2"> |
| | | <input type="text" name="carNum" id="carNum" class="form-control" /> |
| | | </div> |
| | | <div class="col-sm-2"> |
| | | <#button btnCss="info" name="添加" id="ensure" icon="fa-check" clickFun="TLineInfoDlg.addShift()"/> |
| | | </div> |
| | | </div> |
| | | <div class="form-group"> |
| | | <label class="col-sm-2 control-label">已添加班次</label> |
| | | <div class="col-sm-6"> |
| | | <div style="height: 200px; border: 1px solid #e5e6e7;overflow-y: auto;"> |
| | | <table class="table table-striped table-bordered table-hover table-condensed"> |
| | | <thead> |
| | | <tr> |
| | | <th style="width: 300px;text-align: center;">添加时间</th> |
| | | <th style="width: 300px;text-align: center;">班次时间</th> |
| | | <th style="width: 300px;text-align: center;">车次数</th> |
| | | <th style="width: 100px;text-align: center;">操作</th> |
| | | </tr> |
| | | </thead> |
| | | <tbody id="shiftValue"> |
| | | @for(obj in lineShiftList!){ |
| | | <tr class="shiftValueClass"> |
| | | <td style="text-align: center;"><input type="hidden" id="time2Value" name="time2Value" value="${obj.addTime}">${obj.addTime}</td> |
| | | <td style="text-align: center;"><input type="hidden" id="shiftTimeValue" name="shiftTimeValue" value="${obj.startTime} - ${obj.endTime}">${obj.startTime} - ${obj.endTime}</td> |
| | | <td style="text-align: center;"><input type="hidden" id="carNumValue" name="carNumValue" value="${obj.carNum}">${obj.carNum}</td> |
| | | <td style="text-align: center;"><button onclick="deleteSub(this)">移除</button></td> |
| | | </tr> |
| | | @} |
| | | </tbody> |
| | | </table> |
| | | </div> |
| | | </div> |
| | | </div> |
| | | </div> |
| | | </div> |
| | | |
| | | |
| | | <div class="row btn-group-m-t"> |
| | | <div class="col-sm-10 col-sm-offset-5"> |
| | | <#button btnCss="info" name="提交" id="ensure" icon="fa-check" clickFun="TLineInfoDlg.editSubmit()"/> |
| | | <#button btnCss="danger" name="取消" id="cancel" icon="fa-eraser" clickFun="TLineInfoDlg.close()"/> |
| | | </div> |
| | | </div> |
| | | </div> |
| | | |
| | | </div> |
| | | </div> |
| | | <script src="${ctxPath}/static/modular/system/airLine/airLine_info.js"></script> |
| | | <script type="text/javascript"> |
| | | laydate.render({ |
| | | elem: '#shiftTime' |
| | | ,type: 'time' |
| | | ,range: '-' |
| | | ,format: 'HH:mm' |
| | | }); |
| | | var regDouble = /^(([1-9]{1}\d*)|(0{1}))(\.\d{0,2})?$/; |
| | | var regXiShu = /^(0(\.\d{1,2})?)$/; |
| | | var regXiShu1 = /^([1-9]{1,})(\.\d{1,2})?$/; |
| | | var regBiLi = /^([0-9]{1,2}$)|(^[0-9]{1,2}\.[0-9]{1,2}$)|100$/; |
| | | var regInt = /^[0-9]{0,3}$/; |
| | | function checkIsYuan(obj){ |
| | | var num = $(obj).val(); |
| | | if(!regDouble.test(num)){ |
| | | layer.msg("【元】输入框不能超过3位数,保留两位小数"); |
| | | } |
| | | } |
| | | function checkIsXiShu1(obj){ |
| | | var num = $(obj).val(); |
| | | if(!regXiShu1.test(num)){ |
| | | layer.msg("【系数】输入框大于1,保留两位小数"); |
| | | } |
| | | } |
| | | function checkIsXiShu(obj){ |
| | | var num = $(obj).val(); |
| | | if(!regXiShu.test(num)){ |
| | | layer.msg("【系数】输入框大于0小于1,保留两位小数"); |
| | | } |
| | | } |
| | | function checkIsBiLi(obj){ |
| | | var num = $(obj).val(); |
| | | if(!regBiLi.test(num)){ |
| | | layer.msg("【比例】输入框大于等于0小于100"); |
| | | } |
| | | } |
| | | function checkIsMinute(obj){ |
| | | var num = $(obj).val(); |
| | | if(!regInt.test(num)){ |
| | | layer.msg("【分钟】输入框不能超过3位数"); |
| | | } |
| | | } |
| | | |
| | | </script> |
| | | @} |
New file |
| | |
| | | @layout("/common/_container.html"){ |
| | | <div class="row"> |
| | | <div class="col-sm-12"> |
| | | <div class="ibox float-e-margins"> |
| | | <div class="ibox-title"> |
| | | <h5>景区站点管理</h5> |
| | | </div> |
| | | <div class="ibox-content"> |
| | | <div class="row row-lg"> |
| | | <div class="col-sm-12"> |
| | | <div class="row"> |
| | | <div class="col-sm-3"> |
| | | <#TimeCon id="insertTime" name="添加时间" isTime="false"/> |
| | | </div> |
| | | <div class="col-sm-3"> |
| | | <#NameCon id="name" name="站点名称" /> |
| | | </div> |
| | | <div class="col-sm-3"> |
| | | <#NameCon id="insertUser" name="创建者" /> |
| | | </div> |
| | | <div class="col-sm-3"> |
| | | <#NameCon id="city" name="所属城市" /> |
| | | </div> |
| | | <div class="col-sm-3"> |
| | | <#SelectCon id="state" name="状态" > |
| | | <option value="">全部</option> |
| | | <option value="1">正常</option> |
| | | <option value="2">冻结</option> |
| | | </#SelectCon> |
| | | </div> |
| | | <div class="col-sm-3"> |
| | | <#button name="搜索" icon="fa-search" clickFun="TSite.search()"/> |
| | | <#button name="重置" icon="fa-trash" clickFun="TSite.resetSearch()" space="true"/> |
| | | </div> |
| | | </div> |
| | | <div class="hidden-xs" id="TSiteTableToolbar" role="group"> |
| | | @if(shiro.hasPermission("/airSite/airAdd")){ |
| | | <#button name="添加" icon="fa-plus" clickFun="TSite.openAddTSite()"/> |
| | | @} |
| | | @if(shiro.hasPermission("/tSite/airUpdate")){ |
| | | <#button name="编辑" icon="fa-edit" clickFun="TSite.openTSiteDetail()" space="true"/> |
| | | @} |
| | | @if(shiro.hasPermission("/tSite/airDelete")){ |
| | | <#button name="删除" icon="fa-remove" clickFun="TSite.opt(1)" space="true"/> |
| | | @} |
| | | @if(shiro.hasPermission("/tSite/airFreeze")){ |
| | | <#button name="冻结" icon="fa-remove" clickFun="TSite.opt(2)" space="true"/> |
| | | @} |
| | | @if(shiro.hasPermission("/tSite/airThaw")){ |
| | | <#button name="解冻" icon="fa-remove" clickFun="TSite.opt(3)" space="true"/> |
| | | @} |
| | | </div> |
| | | <#table id="TSiteTable"/> |
| | | </div> |
| | | </div> |
| | | </div> |
| | | </div> |
| | | </div> |
| | | </div> |
| | | <script src="${ctxPath}/static/modular/system/airSite/airSite.js"></script> |
| | | <script> |
| | | laydate.render({ |
| | | elem: '#insertTime' |
| | | ,range: true |
| | | }); |
| | | </script> |
| | | @} |
New file |
| | |
| | | @layout("/common/_container.html"){ |
| | | <div class="ibox float-e-margins"> |
| | | <div class="ibox-content"> |
| | | <div class="form-horizontal" id="siteInfoForm"> |
| | | <div class="row"> |
| | | <div class="col-sm-12"> |
| | | <div class=""> |
| | | <h3 style="margin-left: 100px;">站点信息</h3> |
| | | </div> |
| | | <div class="form-group"> |
| | | <label class="col-sm-2 control-label">站点名称:</label> |
| | | <div class="col-sm-6"> |
| | | <input type="text" class="form-control" id="name" name="name"> |
| | | </div> |
| | | </div> |
| | | <div class="form-group"> |
| | | <label class="col-sm-2 control-label">所属城市:</label> |
| | | <div class="col-sm-2"> |
| | | <select class="form-control" id="provinceCode" onchange="TSiteInfoDlg.provinceChange(this)"> |
| | | <option value="">选择省</option> |
| | | @for(obj in provinceList){ |
| | | <option value="${obj.code}">${obj.name}</option> |
| | | @} |
| | | </select> |
| | | </div> |
| | | <div class="col-sm-2"> |
| | | <select class="form-control" id="cityCode" onchange="TSiteInfoDlg.cityChange(this)"> |
| | | <option value="">选择市</option> |
| | | </select> |
| | | </div> |
| | | <div class="col-sm-2"> |
| | | <select class="form-control" id="districtCode"> |
| | | <option value="">选择区</option> |
| | | </select> |
| | | </div> |
| | | </div> |
| | | |
| | | <div class=""> |
| | | <h3 style="margin-left: 100px;margin-top: 70px;">站点区域</h3> |
| | | </div> |
| | | <div class="form-group"> |
| | | <label class="col-sm-2 control-label">区域名称:</label> |
| | | <div class="col-sm-2"> |
| | | <input type="text" class="form-control" id="areaName" name="areaName"> |
| | | </div> |
| | | <label class="col-sm-1 control-label">类型:</label> |
| | | <div class="col-sm-2" style="display: flex;align-items: center;"> |
| | | <div class="radio radio-info radio-inline"> |
| | | <input type="radio" id="areaType1" value="1" name="areaType" checked="" onclick="TSiteInfoDlg.areaTypeClick(1)"> |
| | | <label for="areaType1"> 行政区域 </label> |
| | | </div> |
| | | <div class="radio radio-success radio-inline"> |
| | | <input type="radio" id="areaType2" value="2" name="areaType" onclick="TSiteInfoDlg.areaTypeClick(2)"> |
| | | <label for="areaType2"> 电子围栏 </label> |
| | | </div> |
| | | </div> |
| | | <div class="col-sm-2"> |
| | | <#button btnCss="info" name="添加" id="ensure" icon="fa-check" clickFun="TSiteInfoDlg.addArea()"/> |
| | | </div> |
| | | </div> |
| | | <div class="form-group" id="areaType1Div"> |
| | | <label class="col-sm-2 control-label">行政区域:</label> |
| | | <div class="col-sm-2"> |
| | | <select class="form-control" id="provinceCode1" onchange="TSiteInfoDlg.provinceChange1(this)"> |
| | | <option value="">选择省</option> |
| | | @for(obj in provinceList){ |
| | | <option value="${obj.code}">${obj.name}</option> |
| | | @} |
| | | </select> |
| | | </div> |
| | | <div class="col-sm-2"> |
| | | <select class="form-control" id="cityCode1" onchange="TSiteInfoDlg.cityChange1(this)"> |
| | | <option value="">选择市</option> |
| | | </select> |
| | | </div> |
| | | <div class="col-sm-2"> |
| | | <select class="form-control" id="districtCode1"> |
| | | <option value="">选择区</option> |
| | | </select> |
| | | </div> |
| | | </div> |
| | | <div class="form-group" id="areaType2Div" style="display: none;"> |
| | | <label class="col-sm-2 control-label">电子围栏:</label> |
| | | <div class="col-sm-8"> |
| | | <div id="container" style="height: 350px;width: 1000px;"></div> |
| | | <div class='info' style="margin-top:10px;position: absolute; z-index: 999; left: 20px; width: 450px;">操作说明:圆和矩形通过拖拽来绘制,其他覆盖物通过点击来绘制</div> |
| | | <div class="input-card" style='margin-top:28px;width: 100rem; z-index: 999; bottom: 20px;'> |
| | | <div class="input-item"> |
| | | <!--<input type="radio" name='func' checked="" value='marker'><span class="input-text">画点</span>--> |
| | | <!--<input type="radio" name='func' value='polyline'><span class="input-text">画折线</span> --> |
| | | <input type="radio" name='func' value='polygon'><span class="input-text" style='width:5rem;'>画多边形</span> |
| | | <!--<input type="radio" name='func' value='rectangle'><span class="input-text" style='width:5rem;'>画矩形</span> --> |
| | | <input type="radio" name='func' value='circle'><span class="input-text" style='width:5rem;'>画圆</span> |
| | | </div> |
| | | <div class="input-item"> |
| | | <input id="clear" type="button" class="btn" value="清除" /> |
| | | <input id="close" type="button" class="btn" value="关闭绘图" /> |
| | | <input type="button" class="btn" value="开始编辑" onclick="editAll()" /> |
| | | <input type="button" class="btn" value="结束编辑" onclick="closeEdit()" /> |
| | | </div> |
| | | </div> |
| | | </div> |
| | | <div class="col-sm-2"> |
| | | <div class="form-group"> |
| | | <label style='color:grey'>行政区边界查询</label> |
| | | <div class="input-group"> |
| | | <div class="input-group-btn"> |
| | | <button data-toggle="dropdown" class="btn btn-white dropdown-toggle" |
| | | type="button">行政级别 |
| | | </button> |
| | | </div> |
| | | <select id="level" class="form-control"> |
| | | <option value="district">区</option> |
| | | <option value="city">市</option> |
| | | <option value="province">省</option> |
| | | </select> |
| | | |
| | | </div> |
| | | </div> |
| | | <div class="form-group"> |
| | | <div class="input-group"> |
| | | <div class="input-group-btn"> |
| | | <button data-toggle="dropdown" class="btn btn-white dropdown-toggle" |
| | | type="button">名称/adcode |
| | | </button> |
| | | </div> |
| | | <input id='district' class="layui-input form-control" type="text" value=''> |
| | | </div> |
| | | </div> |
| | | <input id="find" type="button" class="btn btn-primary btn-sm" value="查询" /> |
| | | </div> |
| | | </div> |
| | | |
| | | <div class="form-group"> |
| | | <label class="col-sm-2 control-label">已添加区域</label> |
| | | <div class="col-sm-6"> |
| | | <div style="height: 200px; border: 1px solid #e5e6e7;overflow-y: auto;"> |
| | | <table class="table table-striped table-bordered table-hover table-condensed"> |
| | | <thead> |
| | | <tr> |
| | | <th style="width: 300px;text-align: center;">添加时间</th> |
| | | <th style="width: 300px;text-align: center;">区域名称</th> |
| | | <th style="width: 100px;text-align: center;">操作</th> |
| | | </tr> |
| | | </thead> |
| | | <tbody id="areaValue"> |
| | | |
| | | </tbody> |
| | | </table> |
| | | </div> |
| | | </div> |
| | | </div> |
| | | |
| | | </div> |
| | | </div> |
| | | |
| | | <div class="row btn-group-m-t"> |
| | | <div class="col-sm-10 col-sm-offset-5"> |
| | | <#button btnCss="info" name="提交" id="ensure" icon="fa-check" clickFun="TSiteInfoDlg.addSubmit()"/> |
| | | <#button btnCss="danger" name="取消" id="cancel" icon="fa-eraser" clickFun="TSiteInfoDlg.close()"/> |
| | | </div> |
| | | </div> |
| | | </div> |
| | | |
| | | </div> |
| | | </div> |
| | | <script src="https://webapi.amap.com/maps?v=1.4.15&key=d868ee8a0084a4a1b4271d8030e32fba&plugin=AMap.MouseTool,AMap.DistrictSearch,AMap.PolyEditor,AMap.RectangleEditor,AMap.CircleEditor"></script> |
| | | <script src="${ctxPath}/static/modular/system/airSite/electricFence.js"></script> |
| | | <script src="${ctxPath}/static/modular/system/airSite/airSite_info.js"></script> |
| | | @} |
New file |
| | |
| | | @layout("/common/_container.html"){ |
| | | <div class="ibox float-e-margins"> |
| | | <div class="ibox-content"> |
| | | <div class="form-horizontal" id="siteInfoForm"> |
| | | <input type="hidden" id="id" name="id" value="${item.id}"> |
| | | <div class="row"> |
| | | <div class="col-sm-12"> |
| | | <div class=""> |
| | | <h3 style="margin-left: 100px;">站点信息</h3> |
| | | </div> |
| | | <div class="form-group"> |
| | | <label class="col-sm-2 control-label">站点名称:</label> |
| | | <div class="col-sm-6"> |
| | | <input type="text" class="form-control" id="name" name="name" value="${item.name}"> |
| | | </div> |
| | | </div> |
| | | <div class="form-group"> |
| | | <label class="col-sm-2 control-label">所属城市:</label> |
| | | <div class="col-sm-2"> |
| | | <select class="form-control" id="provinceCode" onchange="TSiteInfoDlg.provinceChange(this)"> |
| | | <option value="">选择省</option> |
| | | @for(obj in provinceList){ |
| | | <option value="${obj.code}" ${obj.code == item.provinceCode ? 'selected=selected' : ''}>${obj.name}</option> |
| | | @} |
| | | </select> |
| | | </div> |
| | | <div class="col-sm-2"> |
| | | <select class="form-control" id="cityCode" onchange="TSiteInfoDlg.cityChange(this)"> |
| | | <option value="">选择市</option> |
| | | @for(obj in cityList){ |
| | | <option value="${obj.code}" ${obj.code == item.cityCode ? 'selected=selected' : ''}>${obj.name}</option> |
| | | @} |
| | | </select> |
| | | </div> |
| | | <div class="col-sm-2"> |
| | | <select class="form-control" id="districtCode"> |
| | | <option value="">选择区</option> |
| | | @for(obj in areaList){ |
| | | <option value="${obj.code}" ${obj.code == item.districtCode ? 'selected=selected' : ''}>${obj.name}</option> |
| | | @} |
| | | </select> |
| | | </div> |
| | | </div> |
| | | |
| | | <div class=""> |
| | | <h3 style="margin-left: 100px;margin-top: 70px;">站点区域</h3> |
| | | </div> |
| | | <div class="form-group"> |
| | | <label class="col-sm-2 control-label">区域名称:</label> |
| | | <div class="col-sm-2"> |
| | | <input type="text" class="form-control" id="areaName" name="areaName"> |
| | | </div> |
| | | <label class="col-sm-1 control-label">类型:</label> |
| | | <div class="col-sm-2" style="display: flex;align-items: center;"> |
| | | <div class="radio radio-info radio-inline"> |
| | | <input type="radio" id="areaType1" value="1" name="areaType" ${checked1} disabled onclick="TSiteInfoDlg.areaTypeClick(1)"> |
| | | <label for="areaType1"> 行政区域 </label> |
| | | </div> |
| | | <div class="radio radio-success radio-inline"> |
| | | <input type="radio" id="areaType2" value="2" name="areaType" ${checked2} disabled onclick="TSiteInfoDlg.areaTypeClick(2)"> |
| | | <label for="areaType2"> 电子围栏 </label> |
| | | </div> |
| | | </div> |
| | | <div class="col-sm-2"> |
| | | <#button btnCss="info" name="添加" id="ensure" icon="fa-check" clickFun="TSiteInfoDlg.addArea()"/> |
| | | </div> |
| | | </div> |
| | | <div class="form-group" id="areaType1Div" style="display: ${type1};"> |
| | | <label class="col-sm-2 control-label">行政区域:</label> |
| | | <div class="col-sm-2"> |
| | | <select class="form-control" id="provinceCode1" onchange="TSiteInfoDlg.provinceChange1(this)"> |
| | | <option value="">选择省</option> |
| | | @for(obj in provinceList){ |
| | | <option value="${obj.code}">${obj.name}</option> |
| | | @} |
| | | </select> |
| | | </div> |
| | | <div class="col-sm-2"> |
| | | <select class="form-control" id="cityCode1" onchange="TSiteInfoDlg.cityChange1(this)"> |
| | | <option value="">选择市</option> |
| | | </select> |
| | | </div> |
| | | <div class="col-sm-2"> |
| | | <select class="form-control" id="districtCode1"> |
| | | <option value="">选择区</option> |
| | | </select> |
| | | </div> |
| | | </div> |
| | | <div class="form-group" id="areaType2Div" style="display: ${type2};"> |
| | | <label class="col-sm-2 control-label">电子围栏:</label> |
| | | <div class="col-sm-8"> |
| | | <div id="container" style="height: 350px;width: 1000px;"></div> |
| | | <div class='info' style="margin-top:10px;position: absolute; z-index: 999; left: 20px; width: 450px;">操作说明:圆和矩形通过拖拽来绘制,其他覆盖物通过点击来绘制</div> |
| | | <div class="input-card" style='margin-top:28px;width: 100rem; z-index: 999; bottom: 20px;'> |
| | | <div class="input-item"> |
| | | <!--<input type="radio" name='func' checked="" value='marker'><span class="input-text">画点</span>--> |
| | | <!--<input type="radio" name='func' value='polyline'><span class="input-text">画折线</span> --> |
| | | <input type="radio" name='func' value='polygon'><span class="input-text" style='width:5rem;'>画多边形</span> |
| | | <!--<input type="radio" name='func' value='rectangle'><span class="input-text" style='width:5rem;'>画矩形</span> --> |
| | | <input type="radio" name='func' value='circle'><span class="input-text" style='width:5rem;'>画圆</span> |
| | | </div> |
| | | <div class="input-item"> |
| | | <input id="clear" type="button" class="btn" value="清除" /> |
| | | <input id="close" type="button" class="btn" value="关闭绘图" /> |
| | | <input type="button" class="btn" value="开始编辑" onclick="editAll()" /> |
| | | <input type="button" class="btn" value="结束编辑" onclick="closeEdit()" /> |
| | | </div> |
| | | </div> |
| | | </div> |
| | | <div class="col-sm-2"> |
| | | <div class="form-group"> |
| | | <label style='color:grey'>行政区边界查询</label> |
| | | <div class="input-group"> |
| | | <div class="input-group-btn"> |
| | | <button data-toggle="dropdown" class="btn btn-white dropdown-toggle" |
| | | type="button">行政级别 |
| | | </button> |
| | | </div> |
| | | <select id="level" class="form-control"> |
| | | <option value="district">区</option> |
| | | <option value="city">市</option> |
| | | <option value="province">省</option> |
| | | </select> |
| | | |
| | | </div> |
| | | </div> |
| | | <div class="form-group"> |
| | | <div class="input-group"> |
| | | <div class="input-group-btn"> |
| | | <button data-toggle="dropdown" class="btn btn-white dropdown-toggle" |
| | | type="button">名称/adcode |
| | | </button> |
| | | </div> |
| | | <input id='district' class="layui-input form-control" type="text" value=''> |
| | | </div> |
| | | </div> |
| | | <input id="find" type="button" class="btn btn-primary btn-sm" value="查询" /> |
| | | </div> |
| | | </div> |
| | | <div class="form-group"> |
| | | <label class="col-sm-2 control-label">已添加区域</label> |
| | | <div class="col-sm-6"> |
| | | <div style="height: 200px; border: 1px solid #e5e6e7;overflow-y: auto;"> |
| | | <table class="table table-striped table-bordered table-hover table-condensed"> |
| | | <thead> |
| | | <tr> |
| | | <th style="width: 300px;text-align: center;">添加时间</th> |
| | | <th style="width: 300px;text-align: center;">区域名称</th> |
| | | <th style="width: 100px;text-align: center;">操作</th> |
| | | </tr> |
| | | </thead> |
| | | <tbody id="areaValue"> |
| | | @for(obj in locationList!){ |
| | | <tr class="areaValueClass"> |
| | | <td style="text-align: center;"><input type="hidden" id="areaType1" name="areaType1" value="${obj.type}"> |
| | | <input type="hidden" id="time" name="time" value="${obj.addTime}">${obj.addTime}</td> |
| | | <td style="text-align: center;"> |
| | | <input type="hidden" id="id" name="id" value="${obj.id}"> |
| | | <input type="hidden" id="name" name="name" value="${obj.name}"> |
| | | <input type="hidden" id="provinceCode1" name="provinceCode1" value="${obj.provinceCode}"> |
| | | <input type="hidden" id="province1" name="province1" value="${obj.province}"> |
| | | <input type="hidden" id="cityCode1" name="cityCode1" value="${obj.cityCode}"> |
| | | <input type="hidden" id="city1" name="city1" value="${obj.city}"> |
| | | <input type="hidden" id="districtCode1" name="districtCode1" value="${obj.districtCode}"> |
| | | <input type="hidden" id="district1" name="district1" value="${obj.district}"> |
| | | <input type="hidden" id="coordinate1" name="coordinate1" value="${obj.coordinate}"> |
| | | ${obj.name}</td> |
| | | <td style="text-align: center;"><button onclick="deleteSub(this)">移除</button></td> |
| | | </tr> |
| | | @} |
| | | </tbody> |
| | | </table> |
| | | </div> |
| | | </div> |
| | | </div> |
| | | |
| | | </div> |
| | | </div> |
| | | |
| | | <div class="row btn-group-m-t"> |
| | | <div class="col-sm-10 col-sm-offset-5"> |
| | | <#button btnCss="info" name="提交" id="ensure" icon="fa-check" clickFun="TSiteInfoDlg.editSubmit()"/> |
| | | <#button btnCss="danger" name="取消" id="cancel" icon="fa-eraser" clickFun="TSiteInfoDlg.close()"/> |
| | | </div> |
| | | </div> |
| | | </div> |
| | | |
| | | </div> |
| | | </div> |
| | | <script src="https://webapi.amap.com/maps?v=1.4.15&key=d868ee8a0084a4a1b4271d8030e32fba&plugin=AMap.MouseTool,AMap.DistrictSearch,AMap.PolyEditor,AMap.RectangleEditor,AMap.CircleEditor"></script> |
| | | <script src="${ctxPath}/static/modular/system/airSite/electricFence.js"></script> |
| | | <script src="${ctxPath}/static/modular/system/airSite/airSite_info.js"></script> |
| | | @} |
| | |
| | | <div class="col-sm-12"> |
| | | <div class="ibox float-e-margins"> |
| | | <div class="ibox-title"> |
| | | <h5>跨城站点管理</h5> |
| | | <h5>景区站点管理</h5> |
| | | </div> |
| | | <div class="ibox-content"> |
| | | <div class="row row-lg"> |
New file |
| | |
| | | /** |
| | | * 跨城站点管理管理初始化 |
| | | */ |
| | | var TLine = { |
| | | id: "TLineTable", //表格id |
| | | seItem: null, //选中的条目 |
| | | table: null, |
| | | layerIndex: -1 |
| | | }; |
| | | |
| | | /** |
| | | * 初始化表格的列 |
| | | */ |
| | | TLine.initColumn = function () { |
| | | return [ |
| | | {field: 'selectItem', radio: true}, |
| | | {title: '主键', field: 'id', visible: false, align: 'center', valign: 'middle'}, |
| | | {title: '添加时间', field: 'insertTime', visible: true, align: 'center', valign: 'middle',width:'10%', |
| | | formatter: function (value, row) { |
| | | var btn = ""; |
| | | if(row.insertTime != '' && row.insertTime != null) { |
| | | var time = row.insertTime.replace(" ",'<br>'); |
| | | btn = ['<p class="toolTip" style="overflow:hidden;white-space:nowrap;text-overflow:ellipsis;" title="' + row.insertTime + '" onfocus="TUser.tooltip()">' + time + '</p>'] |
| | | } |
| | | return btn; |
| | | } |
| | | }, |
| | | {title: '线路名称', field: 'name', visible: true, align: 'center', valign: 'middle', |
| | | formatter: function (value, row) { |
| | | var btn = ""; |
| | | if(row.name != '' && row.name != null) { |
| | | btn = ['<p class="toolTip" style="overflow:hidden;white-space:nowrap;text-overflow:ellipsis;" title="' + row.name + '" onfocus="TUser.tooltip()">' + row.name+ '</p>'] |
| | | } |
| | | return btn; |
| | | } |
| | | }, |
| | | {title: '关联车型', field: 'modelStr', visible: true, align: 'center', valign: 'middle', |
| | | formatter: function (value, row) { |
| | | var btn = ""; |
| | | if(row.modelStr != '' && row.modelStr != null) { |
| | | btn = ['<p class="toolTip" style="overflow:hidden;white-space:nowrap;text-overflow:ellipsis;" title="' + row.modelStr + '" onfocus="TUser.tooltip()">' + row.modelStr+ '</p>'] |
| | | } |
| | | return btn; |
| | | } |
| | | }, |
| | | {title: '班次数', field: 'shiftNum', visible: true, align: 'center', valign: 'middle', |
| | | formatter: function (value, row) { |
| | | var btn = ""; |
| | | if(row.shiftNum != '' && row.shiftNum != null) { |
| | | btn = ['<p class="toolTip" style="overflow:hidden;white-space:nowrap;text-overflow:ellipsis;" title="' + row.shiftNum + '" onfocus="TUser.tooltip()">' + row.shiftNum+ '</p>'] |
| | | } |
| | | return btn; |
| | | } |
| | | }, |
| | | {title: '关联企业数', field: 'companyNum', visible: true, align: 'center', valign: 'middle', |
| | | formatter: function (value, row) { |
| | | var btn = ""; |
| | | if(row.companyNum != '' && row.companyNum != null) { |
| | | btn = ['<p class="toolTip" style="overflow:hidden;white-space:nowrap;text-overflow:ellipsis;" title="' + row.companyNum + '" onfocus="TUser.tooltip()">' + row.companyNum+ '</p>'] |
| | | } |
| | | return btn; |
| | | } |
| | | }, |
| | | {title: '申请班次间隔时间', field: 'shiftInterval', visible: true, align: 'center', valign: 'middle', |
| | | formatter: function (value, row) { |
| | | var btn = ""; |
| | | if(row.shiftInterval != '' && row.shiftInterval != null) { |
| | | btn = ['<p class="toolTip" style="overflow:hidden;white-space:nowrap;text-overflow:ellipsis;" title="' + row.shiftInterval + '分钟" onfocus="TUser.tooltip()">' + row.shiftInterval+ '分钟</p>'] |
| | | } |
| | | return btn; |
| | | } |
| | | }, |
| | | {title: '状态', field: 'state', visible: true, align: 'center', valign: 'middle', |
| | | formatter: function (value, row) { |
| | | var btn = ""; |
| | | if(row.state != '' && row.state != null) { |
| | | if (row.state == 1){ |
| | | btn = ['<p class="toolTip" style="overflow:hidden;white-space:nowrap;text-overflow:ellipsis;" title="正常" onfocus="TUser.tooltip()">正常</p>'] |
| | | } else if (row.state == 2){ |
| | | btn = ['<p class="toolTip" style="overflow:hidden;white-space:nowrap;text-overflow:ellipsis;color: red;" title="冻结" onfocus="TUser.tooltip()">冻结</p>'] |
| | | } |
| | | } |
| | | return btn; |
| | | } |
| | | } |
| | | ]; |
| | | }; |
| | | |
| | | /** |
| | | * 检查是否选中 |
| | | */ |
| | | TLine.check = function () { |
| | | var selected = $('#' + this.id).bootstrapTable('getSelections'); |
| | | if(selected.length == 0){ |
| | | Feng.info("请先选中表格中的某一记录!"); |
| | | return false; |
| | | }else{ |
| | | TLine.seItem = selected[0]; |
| | | return true; |
| | | } |
| | | }; |
| | | |
| | | /** |
| | | * 添加跨城线路 |
| | | */ |
| | | TLine.openAddTLine = function () { |
| | | var index = layer.open({ |
| | | type: 2, |
| | | title: '添加跨城线路', |
| | | area: ['100%', '100%'], //宽高 |
| | | fix: false, //不固定 |
| | | maxmin: true, |
| | | content: Feng.ctxPath + '/airLine/airLine_add' |
| | | }); |
| | | this.layerIndex = index; |
| | | }; |
| | | |
| | | /** |
| | | * 编辑跨城线路 |
| | | */ |
| | | TLine.openTLineDetail = function () { |
| | | if (this.check()) { |
| | | var index = layer.open({ |
| | | type: 2, |
| | | title: '编辑跨城线路', |
| | | area: ['100%', '100%'], //宽高 |
| | | fix: false, //不固定 |
| | | maxmin: true, |
| | | content: Feng.ctxPath + '/airLine/airLine_update/' + TLine.seItem.id |
| | | }); |
| | | this.layerIndex = index; |
| | | } |
| | | }; |
| | | /** |
| | | * 分配企业 |
| | | */ |
| | | TLine.addCompany = function () { |
| | | if (this.check()) { |
| | | var index = layer.open({ |
| | | type: 2, |
| | | title: '分配企业', |
| | | area: ['100%', '100%'], //宽高 |
| | | fix: false, //不固定 |
| | | maxmin: true, |
| | | content: Feng.ctxPath + '/airLine/airLine_addCompany/' + TLine.seItem.id |
| | | }); |
| | | this.layerIndex = index; |
| | | } |
| | | }; |
| | | |
| | | /** |
| | | * 删除跨城站点管理 |
| | | */ |
| | | TLine.opt = function (type) { |
| | | if (this.check()) { |
| | | var name = TLine.seItem.name; |
| | | if (name == "" || name == null || name == undefined) { |
| | | name = "该线路"; |
| | | } else { |
| | | name = "【" + name + "】"; |
| | | } |
| | | var str = ""; |
| | | var text = "请谨慎操作!"; |
| | | var title = "请谨慎操作!"; |
| | | if (1 == type){ |
| | | str = "删除"; |
| | | title = "您是否确认删除"+name+"?"; |
| | | text = "请谨慎操作,删除后数据无法恢复!"; |
| | | } else if (2 == type){ |
| | | str = "冻结"; |
| | | title = "您是否确认冻结"+name+"?"; |
| | | } else if (3 == type){ |
| | | str = "解冻"; |
| | | title = "您是否确认解冻"+name+"?"; |
| | | } |
| | | if (1 == type){ |
| | | if (TLine.seItem.companyNum != "" && TLine.seItem.companyNum != null && TLine.seItem.companyNum > 0) { |
| | | swal("删除失败", "该线路还有关联企业!", "warning"); |
| | | return; |
| | | } |
| | | } |
| | | if(2 == type){ |
| | | if (TLine.seItem.state != 1) { |
| | | swal("冻结失败", "【正常】状态下才能执行此操作!", "warning"); |
| | | return; |
| | | } |
| | | } |
| | | if (3 == type){ |
| | | if (TLine.seItem.state != 2){ |
| | | swal("解冻失败", "【冻结】状态下才能执行此操作!", "warning"); |
| | | return; |
| | | } |
| | | } |
| | | |
| | | swal({ |
| | | title: title, |
| | | text: text, |
| | | type: "warning", |
| | | showCancelButton: true, |
| | | confirmButtonColor: "#DD6B55", |
| | | confirmButtonText: str, |
| | | closeOnConfirm: true |
| | | }, function () { |
| | | var ajax = new $ax(Feng.ctxPath + "/airLine/opt", function (data) { |
| | | swal(str+"成功", "您已经"+str+"了" + name + "。", "success"); |
| | | TLine.table.refresh(); |
| | | }, function (data) { |
| | | swal(str+"失败", data.responseJSON.message + "!", "warning"); |
| | | }); |
| | | ajax.set("tLineId",TLine.seItem.id); |
| | | ajax.set("optType", type); |
| | | ajax.start(); |
| | | }); |
| | | } |
| | | }; |
| | | |
| | | /** |
| | | * 查询跨城站点管理列表 |
| | | */ |
| | | TLine.search = function () { |
| | | var queryData = {}; |
| | | queryData['insertTime'] = $("#insertTime").val(); |
| | | queryData['name'] = $("#name").val(); |
| | | queryData['insertUser'] = $("#insertUser").val(); |
| | | queryData['modelStr'] = $("#modelStr").val(); |
| | | queryData['state'] = $("#state").val(); |
| | | TLine.table.refresh({query: queryData}); |
| | | }; |
| | | |
| | | TLine.resetSearch = function () { |
| | | $("#insertTime").val(""); |
| | | $("#name").val(""); |
| | | $("#insertUser").val(""); |
| | | $("#modelStr").val(""); |
| | | $("#state").val(""); |
| | | TLine.search(); |
| | | }; |
| | | |
| | | $(function () { |
| | | var defaultColunms = TLine.initColumn(); |
| | | var table = new BSTable(TLine.id, "/airLine/list", defaultColunms); |
| | | table.setPaginationType("server"); |
| | | TLine.table = table.init(); |
| | | }); |
New file |
| | |
| | | /** |
| | | * 初始化跨城站点管理详情对话框 |
| | | */ |
| | | var TLineInfoDlg = { |
| | | tLineInfoData : {}, |
| | | validateFields: { |
| | | name: { |
| | | validators: { |
| | | notEmpty: { |
| | | message: '线路名称不能为空' |
| | | } |
| | | } |
| | | }, |
| | | startSiteId: { |
| | | validators: { |
| | | notEmpty: { |
| | | message: '请选择起点' |
| | | } |
| | | } |
| | | }, |
| | | endSiteId: { |
| | | validators: { |
| | | notEmpty: { |
| | | message: '请选择终点' |
| | | } |
| | | } |
| | | }, |
| | | shiftInterval: { |
| | | validators: { |
| | | notEmpty: { |
| | | message: '司机申请限制分钟数不能为空' |
| | | }, |
| | | regexp: { |
| | | regexp: /^[0-9]{0,3}$/, |
| | | message: '司机申请限制分钟数格式不正确' |
| | | } |
| | | } |
| | | }, |
| | | rakeRate: { |
| | | validators: { |
| | | notEmpty: { |
| | | message: '抽成比例不能为空' |
| | | }, |
| | | regexp: { |
| | | regexp: /^([0-9]{1,2}$)|(^[0-9]{1,2}\.[0-9]{1,2}$)|100$/, |
| | | message: '抽成比例格式不正确' |
| | | } |
| | | } |
| | | }, |
| | | } |
| | | }; |
| | | |
| | | /** |
| | | * 验证数据是否为空 |
| | | */ |
| | | TLineInfoDlg.validate = function () { |
| | | $('#lineInfoForm').data("bootstrapValidator").resetForm(); |
| | | $('#lineInfoForm').bootstrapValidator('validate'); |
| | | return $("#lineInfoForm").data('bootstrapValidator').isValid(); |
| | | }; |
| | | |
| | | /** |
| | | * 清除数据 |
| | | */ |
| | | TLineInfoDlg.clearData = function() { |
| | | this.tLineInfoData = {}; |
| | | } |
| | | |
| | | /** |
| | | * 设置对话框中的数据 |
| | | * |
| | | * @param key 数据的名称 |
| | | * @param val 数据的具体值 |
| | | */ |
| | | TLineInfoDlg.set = function(key, val) { |
| | | this.tLineInfoData[key] = (typeof val == "undefined") ? $("#" + key).val() : val; |
| | | return this; |
| | | } |
| | | |
| | | /** |
| | | * 设置对话框中的数据 |
| | | * |
| | | * @param key 数据的名称 |
| | | * @param val 数据的具体值 |
| | | */ |
| | | TLineInfoDlg.get = function(key) { |
| | | return $("#" + key).val(); |
| | | } |
| | | |
| | | /** |
| | | * 关闭此对话框 |
| | | */ |
| | | TLineInfoDlg.close = function() { |
| | | parent.layer.close(window.parent.TLine.layerIndex); |
| | | } |
| | | |
| | | /** |
| | | * 收集数据 |
| | | */ |
| | | TLineInfoDlg.collectData = function() { |
| | | this |
| | | .set('id') |
| | | .set('name') |
| | | .set('shiftInterval') |
| | | .set('rakeRate') |
| | | .set('state') |
| | | .set('insertTime'); |
| | | } |
| | | |
| | | /** |
| | | * 提交添加 |
| | | */ |
| | | TLineInfoDlg.addSubmit = function() { |
| | | |
| | | this.clearData(); |
| | | this.collectData(); |
| | | if(!this.validate()){ |
| | | return ; |
| | | } |
| | | var startSiteId = $("#startSiteId").val(); |
| | | var endSiteId = $("#endSiteId").val(); |
| | | |
| | | var subArr=[]; |
| | | $(".typeValueClass").each(function () { |
| | | subArr.push({ |
| | | serverModelId:$(this).find("input[name*='serverModelIdValue']").val(), |
| | | type:$(this).find("input[name*='typeValue']").val(), |
| | | time:$(this).find("input[name*='timeValue']").val(), |
| | | content:$(this).find("input[name*='contentValue']").val(), |
| | | contentStr:$(this).find("input[name*='contentStrValue']").val(), |
| | | }) |
| | | }); |
| | | if(subArr.length <= 0){ |
| | | Feng.error("请至少设置一条价格设置"); |
| | | return; |
| | | } |
| | | var shuArr=[]; |
| | | $(".shiftValueClass").each(function () { |
| | | shuArr.push({ |
| | | shiftTime:$(this).find("input[name*='shiftTimeValue']").val(), |
| | | carNum:$(this).find("input[name*='carNumValue']").val(), |
| | | time2:$(this).find("input[name*='time2Value']").val(), |
| | | }) |
| | | }) |
| | | if(shuArr.length <= 0){ |
| | | Feng.error("请至少设置一条班次设置"); |
| | | return; |
| | | } |
| | | |
| | | //提交信息 |
| | | var ajax = new $ax(Feng.ctxPath + "/airLine/add", function(data){ |
| | | if(data.status == 200){ |
| | | Feng.success("添加成功!"); |
| | | window.parent.TLine.table.refresh(); |
| | | TLineInfoDlg.close(); |
| | | }else{ |
| | | Feng.error(data.msg); |
| | | } |
| | | },function(data){ |
| | | Feng.error("添加失败!" + data.responseJSON.message + "!"); |
| | | }); |
| | | ajax.set(this.tLineInfoData); |
| | | ajax.set("startSiteId",startSiteId); |
| | | ajax.set("endSiteId",endSiteId); |
| | | ajax.set("subArr",JSON.stringify(subArr)); |
| | | ajax.set("shuArr",JSON.stringify(shuArr)); |
| | | ajax.start(); |
| | | } |
| | | |
| | | /** |
| | | * 提交修改 |
| | | */ |
| | | TLineInfoDlg.editSubmit = function() { |
| | | |
| | | this.clearData(); |
| | | this.collectData(); |
| | | if(!this.validate()){ |
| | | return ; |
| | | } |
| | | |
| | | var startSiteId = $("#startSiteId").val(); |
| | | var endSiteId = $("#endSiteId").val(); |
| | | |
| | | var subArr=[]; |
| | | $(".typeValueClass").each(function () { |
| | | subArr.push({ |
| | | serverModelId:$(this).find("input[name*='serverModelIdValue']").val(), |
| | | type:$(this).find("input[name*='typeValue']").val(), |
| | | time:$(this).find("input[name*='timeValue']").val(), |
| | | content:$(this).find("input[name*='contentValue']").val(), |
| | | contentStr:$(this).find("input[name*='contentStrValue']").val(), |
| | | }) |
| | | }); |
| | | if(subArr.length <= 0){ |
| | | Feng.error("请至少设置一条价格设置"); |
| | | return; |
| | | } |
| | | var shuArr=[]; |
| | | $(".shiftValueClass").each(function () { |
| | | shuArr.push({ |
| | | shiftTime:$(this).find("input[name*='shiftTimeValue']").val(), |
| | | carNum:$(this).find("input[name*='carNumValue']").val(), |
| | | time2:$(this).find("input[name*='time2Value']").val(), |
| | | }) |
| | | }) |
| | | if(shuArr.length <= 0){ |
| | | Feng.error("请至少设置一条班次设置"); |
| | | return; |
| | | } |
| | | //提交信息 |
| | | var ajax = new $ax(Feng.ctxPath + "/airLine/update", function(data){ |
| | | if(data.status == 200){ |
| | | Feng.success("修改成功!"); |
| | | window.parent.TLine.table.refresh(); |
| | | TLineInfoDlg.close(); |
| | | }else{ |
| | | Feng.error(data.msg); |
| | | } |
| | | },function(data){ |
| | | Feng.error("修改失败!" + data.responseJSON.message + "!"); |
| | | }); |
| | | ajax.set(this.tLineInfoData); |
| | | ajax.set("startSiteId",startSiteId); |
| | | ajax.set("endSiteId",endSiteId); |
| | | ajax.set("subArr",JSON.stringify(subArr)); |
| | | ajax.set("shuArr",JSON.stringify(shuArr)); |
| | | ajax.start(); |
| | | } |
| | | |
| | | //添加公司提交 |
| | | TLineInfoDlg.addCompanySubmit = function(){ |
| | | var comArr=[]; |
| | | $(".companyValueClass").each(function () { |
| | | comArr.push({ |
| | | companyId:$(this).find("input[name*='companyIdValue']").val(), |
| | | }) |
| | | }) |
| | | /*if(comArr.length <= 0){ |
| | | Feng.error("请至少添加一个企业"); |
| | | return; |
| | | }*/ |
| | | //提交信息 |
| | | var ajax = new $ax(Feng.ctxPath + "/airLine/addCompany", function(data){ |
| | | Feng.success("操作成功!"); |
| | | window.parent.TLine.table.refresh(); |
| | | TLineInfoDlg.close(); |
| | | },function(data){ |
| | | Feng.error("操作失败!" + data.responseJSON.message + "!"); |
| | | }); |
| | | ajax.set("lineId",$("#lineId").val()); |
| | | ajax.set("comArr",JSON.stringify(comArr)); |
| | | ajax.start(); |
| | | } |
| | | |
| | | $(function() { |
| | | Feng.initValidator("lineInfoForm", TLineInfoDlg.validateFields); |
| | | }); |
| | | |
| | | /** |
| | | * 计价方式改变时 |
| | | * @param e |
| | | */ |
| | | TLineInfoDlg.typeClick = function (e) { |
| | | if (1 == e){ |
| | | $("#fixedDiv").show(); |
| | | $("#floatDiv").hide(); |
| | | } else if (2 == e){ |
| | | $("#floatDiv").show(); |
| | | $("#fixedDiv").hide(); |
| | | } |
| | | } |
| | | |
| | | /** |
| | | * 添加价格 |
| | | */ |
| | | TLineInfoDlg.addPrice = function () { |
| | | var serverModelId = $("#serverModelId").val(); |
| | | var serverModelText = $("#serverModelId option:selected").text(); |
| | | if ("" == serverModelId){ |
| | | Feng.info("请选择车型"); |
| | | return; |
| | | } |
| | | var type = $("input[name='type']:checked").val(); |
| | | var content = ''; |
| | | var contentStr = ""; |
| | | if (1 == type){ |
| | | var num1 = $("#num1").val(); |
| | | var num2 = $("#num2").val(); |
| | | var num3 = $("#num3").val(); |
| | | var num4 = $("#num4").val(); |
| | | if(!regDouble.test(num1) || !regDouble.test(num2) || !regXiShu.test(num3) || !regXiShu.test(num4)){ |
| | | Feng.info("固定计价格式不正确!"); |
| | | return; |
| | | } |
| | | content = '{"num1":"'+num1+'","num2":"'+num2+'","num3":"'+num3+'","num4":"'+num4+'"}'; |
| | | contentStr = "单人价格:"+num1+";包车价格:"+num2+";五座系数:"+num3+";七座系数:"+num4+";"; |
| | | } else if (2 == type){ |
| | | var num11 = $("#num11").val(); |
| | | var num12 = $("#num12").val(); |
| | | var num13 = $("#num13").val(); |
| | | var num14 = $("#num14").val(); |
| | | var num15 = $("#num15").val(); |
| | | var num16 = $("#num16").val(); |
| | | var num17 = $("#num17").val(); |
| | | var num18 = $("#num18").val(); |
| | | if(!regDouble.test(num11) || !regDouble.test(num12) || !regDouble.test(num13) || !regXiShu1.test(num14) || !regXiShu.test(num15) || !regXiShu.test(num16) || !regXiShu.test(num17) || !regXiShu.test(num18)){ |
| | | Feng.info("浮动计价格式不正确!"); |
| | | return; |
| | | } |
| | | content = '{"num1":"'+num11+'","num2":"'+num12+'","num3":"'+num13+'","num4":"'+num14+'","num5":"'+num15+'","num6":"'+num16+'","num7":"'+num17+'","num8":"'+num18+'"}'; |
| | | contentStr = "参考价格:"+num11+";参考里程:"+num12+";保底价:"+num13+";超出参考里程优惠系数:"+num14+";低于参考里程优惠系数:"+num15+";包车系数:"+num16+";五座系数:"+num17+";七座系数:"+num18+";"; |
| | | } |
| | | |
| | | var subArr=[]; |
| | | $(".typeValueClass").each(function () { |
| | | subArr.push({ |
| | | serverModelId:$(this).find("input[name*='serverModelIdValue']").val(), |
| | | type:$(this).find("input[name*='typeValue']").val(), |
| | | time:$(this).find("input[name*='timeValue']").val(), |
| | | content:$(this).find("input[name*='contentValue']").val(), |
| | | contentStr:$(this).find("input[name*='contentStrValue']").val(), |
| | | }) |
| | | }); |
| | | //判断车型是否存在 |
| | | for(var i=0;i<subArr.length;i++){ |
| | | var serverModelIdValue = subArr[i].serverModelId; |
| | | if (serverModelIdValue == serverModelId) { |
| | | Feng.info("车型已存在,请重新选择"); |
| | | return; |
| | | } |
| | | } |
| | | //封装数据 |
| | | var str = '<tr class="typeValueClass">' + |
| | | '<td style="text-align: center;"><input type="hidden" id="timeValue" name="timeValue" value="'+getNowFormatDate()+'">' + getNowFormatDate() + '</td>' + |
| | | '<td style="text-align: center;"><input type="hidden" id="serverModelIdValue" name="serverModelIdValue" value="'+serverModelId+'">'+serverModelText+'</td>' + |
| | | '<td style="text-align: center;"><input type="hidden" id="typeValue" name="typeValue" value="'+type+'">' + |
| | | ' <input type="hidden" id="contentValue" name="contentValue" value='+content+'>' + |
| | | ' <input type="hidden" id="contentStrValue" name="contentStrValue" value="'+contentStr+'">'+contentStr+'</td>' + |
| | | '<td style="text-align: center;"><button onclick="deleteSub(this)">移除</button></td></tr>'; |
| | | $("#priceValue").append(str); |
| | | //清除数据 |
| | | $("#serverModelId").val(""); |
| | | if (1 == type){ |
| | | $("#num1").val(""); |
| | | $("#num2").val(""); |
| | | $("#num3").val(""); |
| | | $("#num4").val(""); |
| | | } else if (2 == type){ |
| | | $("#num11").val(""); |
| | | $("#num12").val(""); |
| | | $("#num13").val(""); |
| | | $("#num14").val(""); |
| | | $("#num15").val(""); |
| | | $("#num16").val(""); |
| | | $("#num17").val(""); |
| | | $("#num18").val(""); |
| | | } |
| | | } |
| | | |
| | | /** |
| | | * 添加班次 |
| | | */ |
| | | TLineInfoDlg.addShift = function () { |
| | | var shiftTime = $("#shiftTime").val(); |
| | | if ("" == shiftTime){ |
| | | Feng.info("请选择班次时间区间"); |
| | | return; |
| | | } |
| | | var carNum = $("#carNum").val(); |
| | | if ("" == carNum){ |
| | | Feng.info("请填写车次数"); |
| | | return; |
| | | }else if (!regInt.test(carNum)){ |
| | | Feng.info("车次数格式不正确"); |
| | | return; |
| | | } |
| | | |
| | | var shuArr=[]; |
| | | $(".shiftValueClass").each(function () { |
| | | shuArr.push({ |
| | | shiftTime:$(this).find("input[name*='shiftTimeValue']").val(), |
| | | carNum:$(this).find("input[name*='carNumValue']").val(), |
| | | time2:$(this).find("input[name*='time2Value']").val(), |
| | | }) |
| | | }) |
| | | |
| | | //判断时间是否存在 |
| | | for(var i=0;i<shuArr.length;i++){ |
| | | var shiftTimeValue = shuArr[i].shiftTime; |
| | | if (shiftTimeValue == shiftTime) { |
| | | Feng.info("班次时间已存在,请重新选择"); |
| | | return; |
| | | } |
| | | } |
| | | //封装数据 |
| | | var str = '<tr class="shiftValueClass">' + |
| | | '<td style="text-align: center;"><input type="hidden" id="time2Value" name="time2Value" value="'+getNowFormatDate()+'">' + getNowFormatDate() + '</td>' + |
| | | '<td style="text-align: center;"><input type="hidden" id="shiftTimeValue" name="shiftTimeValue" value="'+shiftTime+'">'+shiftTime+'</td>' + |
| | | '<td style="text-align: center;"><input type="hidden" id="carNumValue" name="carNumValue" value="'+carNum+'">'+carNum+'</td>' + |
| | | '<td style="text-align: center;"><button onclick="deleteSub(this)">移除</button></td></tr>'; |
| | | $("#shiftValue").append(str); |
| | | //清除数据 |
| | | $("#shiftTime").val(""); |
| | | $("#carNum").val(""); |
| | | } |
| | | |
| | | /** |
| | | * 添加公司 |
| | | */ |
| | | TLineInfoDlg.addCompany = function () { |
| | | var companyId = $("#companyId").val(); |
| | | var companyText = $("#companyId option:selected").text(); |
| | | if ("" == companyId){ |
| | | Feng.info("请选择企业"); |
| | | return; |
| | | } |
| | | var comArr=[]; |
| | | $(".companyValueClass").each(function () { |
| | | comArr.push({ |
| | | companyId:$(this).find("input[name*='companyIdValue']").val(), |
| | | }) |
| | | }) |
| | | //判断公司是否存在 |
| | | for(var i=0;i<comArr.length;i++){ |
| | | var companyIdValue = comArr[i].companyId; |
| | | if (companyIdValue == companyId) { |
| | | Feng.info("企业已存在,请重新选择"); |
| | | return; |
| | | } |
| | | } |
| | | //封装数据 |
| | | var str = '<tr class="companyValueClass">' + |
| | | '<td style="text-align: center;"><input type="hidden" id="companyIdValue" name="companyIdValue" value="'+companyId+'">'+companyText+'</td>' + |
| | | '<td style="text-align: center;"><button onclick="deleteSub(this)">移除</button></td></tr>'; |
| | | $("#companyValue").append(str); |
| | | //清除数据 |
| | | $("#companyId").val(""); |
| | | |
| | | } |
| | | |
| | | function deleteSub(e) { |
| | | $(e).parent().parent().remove(); |
| | | } |
New file |
| | |
| | | /** |
| | | * 跨城站点管理管理初始化 |
| | | */ |
| | | var TSite = { |
| | | id: "TSiteTable", //表格id |
| | | seItem: null, //选中的条目 |
| | | table: null, |
| | | layerIndex: -1 |
| | | }; |
| | | |
| | | /** |
| | | * 初始化表格的列 |
| | | */ |
| | | TSite.initColumn = function () { |
| | | return [ |
| | | {field: 'selectItem', radio: true}, |
| | | {title: '主键ID', field: 'id', visible: false, align: 'center', valign: 'middle'}, |
| | | {title: '添加时间', field: 'insertTime', visible: true, align: 'center', valign: 'middle',width:'20%', |
| | | formatter: function (value, row) { |
| | | var btn = ""; |
| | | if(row.insertTime != '' && row.insertTime != null) { |
| | | var time = row.insertTime.replace(" ",'<br>'); |
| | | btn = ['<p class="toolTip" style="overflow:hidden;white-space:nowrap;text-overflow:ellipsis;" title="' + row.insertTime + '" onfocus="TUser.tooltip()">' + row.insertTime + '</p>'] |
| | | } |
| | | return btn; |
| | | } |
| | | }, |
| | | {title: '站点名称', field: 'name', visible: true, align: 'center', valign: 'middle', |
| | | formatter: function (value, row) { |
| | | var btn = ""; |
| | | if(row.name != '' && row.name != null) { |
| | | btn = ['<p class="toolTip" style="overflow:hidden;white-space:nowrap;text-overflow:ellipsis;" title="' + row.name + '" onfocus="TUser.tooltip()">' + row.name + '</p>'] |
| | | } |
| | | return btn; |
| | | } |
| | | }, |
| | | {title: '添加人ID', field: 'insertUserId', visible: false, align: 'center', valign: 'middle'}, |
| | | {title: '创建者', field: 'insertUser', visible: true, align: 'center', valign: 'middle', |
| | | formatter: function (value, row) { |
| | | var btn = ""; |
| | | if(row.insertUser != '' && row.insertUser != null) { |
| | | btn = ['<p class="toolTip" style="overflow:hidden;white-space:nowrap;text-overflow:ellipsis;" title="' + row.insertUser + '" onfocus="TUser.tooltip()">' + row.insertUser + '</p>'] |
| | | } |
| | | return btn; |
| | | } |
| | | }, |
| | | {title: '所属城市', field: 'province', visible: true, align: 'center', valign: 'middle', |
| | | formatter: function (value, row) { |
| | | var btn = ""; |
| | | if(row.province != '' && row.province != null) { |
| | | var str = ""; |
| | | if ("" != row.province && undefined != row.province){ |
| | | str = str + row.province+"-"; |
| | | } |
| | | if ("" != row.city && undefined != row.city){ |
| | | str = str + row.city+"-"; |
| | | } |
| | | if ("" != row.district && undefined != row.district){ |
| | | str = str + row.district+"-"; |
| | | } |
| | | str = str.substring(0,str.length-1); |
| | | btn = ['<p class="toolTip" style="overflow:hidden;white-space:nowrap;text-overflow:ellipsis;" title="'+ str +'" onfocus="TUser.tooltip()">' + str + '</p>'] |
| | | } |
| | | return btn; |
| | | } |
| | | }, |
| | | {title: '关联线路', field: 'lineNum', visible: true, align: 'center', valign: 'middle', |
| | | formatter: function (value, row) { |
| | | var btn = ""; |
| | | if(row.lineNum != '' && row.lineNum != null) { |
| | | btn = ['<p class="toolTip" style="overflow:hidden;white-space:nowrap;text-overflow:ellipsis;" title="' + row.lineNum + '" onfocus="TUser.tooltip()">' + row.lineNum + '</p>'] |
| | | } |
| | | return btn; |
| | | } |
| | | }, |
| | | {title: '状态', field: 'state', visible: true, align: 'center', valign: 'middle', |
| | | formatter: function (value, row) { |
| | | var btn = ""; |
| | | if(row.state != '' && row.state != null) { |
| | | if(row.state == 1){ |
| | | btn = ['<p class="toolTip" style="overflow:hidden;white-space:nowrap;text-overflow:ellipsis;" title="正常" onfocus="TUser.tooltip()">正常</p>'] |
| | | }else if(row.state == 2){ |
| | | btn = ['<p class="toolTip" style="overflow:hidden;white-space:nowrap;text-overflow:ellipsis;color: red;" title="冻结" onfocus="TUser.tooltip()">冻结</p>'] |
| | | } |
| | | } |
| | | return btn; |
| | | } |
| | | } |
| | | ]; |
| | | }; |
| | | |
| | | /** |
| | | * 检查是否选中 |
| | | */ |
| | | TSite.check = function () { |
| | | var selected = $('#' + this.id).bootstrapTable('getSelections'); |
| | | if(selected.length == 0){ |
| | | Feng.info("请先选中表格中的某一记录!"); |
| | | return false; |
| | | }else{ |
| | | TSite.seItem = selected[0]; |
| | | return true; |
| | | } |
| | | }; |
| | | |
| | | /** |
| | | * 点击添加跨城站点管理 |
| | | */ |
| | | TSite.openAddTSite = function () { |
| | | var index = layer.open({ |
| | | type: 2, |
| | | title: '添加跨城站点', |
| | | area: ['100%', '100%'], //宽高 |
| | | fix: false, //不固定 |
| | | maxmin: true, |
| | | content: Feng.ctxPath + '/airSite/airSite_add' |
| | | }); |
| | | this.layerIndex = index; |
| | | }; |
| | | |
| | | /** |
| | | * 打开查看跨城站点管理详情 |
| | | */ |
| | | TSite.openTSiteDetail = function () { |
| | | if (this.check()) { |
| | | var index = layer.open({ |
| | | type: 2, |
| | | title: '编辑跨城站点', |
| | | area: ['100%', '100%'], //宽高 |
| | | fix: false, //不固定 |
| | | maxmin: true, |
| | | content: Feng.ctxPath + '/airSite/airSite_update/' + TSite.seItem.id |
| | | }); |
| | | this.layerIndex = index; |
| | | } |
| | | }; |
| | | |
| | | /** |
| | | * 操作跨城站点管理 |
| | | */ |
| | | TSite.opt = function (type) { |
| | | if (this.check()) { |
| | | var name = TSite.seItem.name; |
| | | if (name == "" || name == null || name == undefined) { |
| | | name = "该站点"; |
| | | } else { |
| | | name = "【" + name + "】"; |
| | | } |
| | | var str = ""; |
| | | var text = "请谨慎操作!"; |
| | | var title = "请谨慎操作!"; |
| | | if (1 == type){ |
| | | str = "删除"; |
| | | title = "您是否确认删除"+name+"?"; |
| | | text = "请谨慎操作,删除后数据无法恢复!"; |
| | | } else if (2 == type){ |
| | | str = "冻结"; |
| | | title = "您是否确认冻结"+name+"?"; |
| | | } else if (3 == type){ |
| | | str = "解冻"; |
| | | title = "您是否确认解冻"+name+"?"; |
| | | } |
| | | if (1 == type){ |
| | | if (TSite.seItem.lineNum != "" && TSite.seItem.lineNum != null && TSite.seItem.lineNum > 0) { |
| | | swal("删除失败", "该站点还有关联线路!", "warning"); |
| | | return; |
| | | } |
| | | } |
| | | if(2 == type){ |
| | | if (TSite.seItem.state != 1) { |
| | | swal("冻结失败", "【正常】状态下才能执行此操作!", "warning"); |
| | | return; |
| | | } |
| | | } |
| | | if (3 == type){ |
| | | if (TSite.seItem.state != 2){ |
| | | swal("解冻失败", "【冻结】状态下才能执行此操作!", "warning"); |
| | | return; |
| | | } |
| | | } |
| | | |
| | | swal({ |
| | | title: title, |
| | | text: text, |
| | | type: "warning", |
| | | showCancelButton: true, |
| | | confirmButtonColor: "#DD6B55", |
| | | confirmButtonText: str, |
| | | closeOnConfirm: true |
| | | }, function () { |
| | | var ajax = new $ax(Feng.ctxPath + "/airSite/opt", function (data) { |
| | | swal(str+"成功", "您已经"+str+"了" + name + "。", "success"); |
| | | TSite.table.refresh(); |
| | | }, function (data) { |
| | | swal(str+"失败", data.responseJSON.message + "!", "warning"); |
| | | }); |
| | | ajax.set("tSiteId",TSite.seItem.id); |
| | | ajax.set("optType", type); |
| | | ajax.start(); |
| | | }); |
| | | } |
| | | }; |
| | | |
| | | /** |
| | | * 查询跨城站点管理列表 |
| | | */ |
| | | TSite.search = function () { |
| | | var queryData = {}; |
| | | queryData['insertTime'] = $("#insertTime").val(); |
| | | queryData['name'] = $("#name").val(); |
| | | queryData['insertUser'] = $("#insertUser").val(); |
| | | queryData['city'] = $("#city").val(); |
| | | queryData['state'] = $("#state").val(); |
| | | TSite.table.refresh({query: queryData}); |
| | | }; |
| | | |
| | | TSite.resetSearch = function () { |
| | | $("#insertTime").val(""); |
| | | $("#name").val(""); |
| | | $("#insertUser").val(""); |
| | | $("#city").val(""); |
| | | $("#state").val(""); |
| | | TSite.search(); |
| | | }; |
| | | |
| | | $(function () { |
| | | var defaultColunms = TSite.initColumn(); |
| | | var table = new BSTable(TSite.id, "/airSite/list", defaultColunms); |
| | | table.setPaginationType("server"); |
| | | TSite.table = table.init(); |
| | | }); |
New file |
| | |
| | | /** |
| | | * 初始化跨城站点管理详情对话框 |
| | | */ |
| | | var TSiteInfoDlg = { |
| | | tSiteInfoData : {}, |
| | | validateFields: { |
| | | name: { |
| | | validators: { |
| | | notEmpty: { |
| | | message: '站点名称不能为空' |
| | | } |
| | | } |
| | | }, |
| | | provinceCode: { |
| | | validators: { |
| | | notEmpty: { |
| | | message: '请选择站点所属省' |
| | | } |
| | | } |
| | | }, |
| | | } |
| | | }; |
| | | |
| | | /** |
| | | * 验证数据是否为空 |
| | | */ |
| | | TSiteInfoDlg.validate = function () { |
| | | $('#siteInfoForm').data("bootstrapValidator").resetForm(); |
| | | $('#siteInfoForm').bootstrapValidator('validate'); |
| | | return $("#siteInfoForm").data('bootstrapValidator').isValid(); |
| | | }; |
| | | |
| | | |
| | | /** |
| | | * 清除数据 |
| | | */ |
| | | TSiteInfoDlg.clearData = function() { |
| | | this.tSiteInfoData = {}; |
| | | } |
| | | |
| | | /** |
| | | * 设置对话框中的数据 |
| | | * |
| | | * @param key 数据的名称 |
| | | * @param val 数据的具体值 |
| | | */ |
| | | TSiteInfoDlg.set = function(key, val) { |
| | | this.tSiteInfoData[key] = (typeof val == "undefined") ? $("#" + key).val() : val; |
| | | return this; |
| | | } |
| | | |
| | | /** |
| | | * 设置对话框中的数据 |
| | | * |
| | | * @param key 数据的名称 |
| | | * @param val 数据的具体值 |
| | | */ |
| | | TSiteInfoDlg.get = function(key) { |
| | | return $("#" + key).val(); |
| | | } |
| | | |
| | | /** |
| | | * 关闭此对话框 |
| | | */ |
| | | TSiteInfoDlg.close = function() { |
| | | parent.layer.close(window.parent.TSite.layerIndex); |
| | | } |
| | | |
| | | /** |
| | | * 收集数据 |
| | | */ |
| | | TSiteInfoDlg.collectData = function() { |
| | | this |
| | | .set('id') |
| | | .set('name') |
| | | .set('province') |
| | | .set('provinceCode') |
| | | .set('city') |
| | | .set('cityCode') |
| | | .set('district') |
| | | .set('districtCode') |
| | | .set('state') |
| | | .set('insertTime') |
| | | .set('insertUserId'); |
| | | } |
| | | |
| | | /** |
| | | * 提交添加 |
| | | */ |
| | | TSiteInfoDlg.addSubmit = function() { |
| | | |
| | | this.clearData(); |
| | | this.collectData(); |
| | | if(!this.validate()){ |
| | | return ; |
| | | } |
| | | var name = $("#name").val(); |
| | | var provinceCode = $("#provinceCode").val(); |
| | | var cityCode = $("#cityCode").val(); |
| | | var districtCode = $("#districtCode").val(); |
| | | if ("" == provinceCode){ |
| | | Feng.error("请选择所属城市"); |
| | | return; |
| | | } |
| | | var subArr=[]; |
| | | $(".areaValueClass").each(function () { |
| | | subArr.push({ |
| | | id:$(this).find("input[name*='id']").val(), |
| | | areaType:$(this).find("input[name*='areaType1']").val(), |
| | | time:$(this).find("input[name*='time']").val(), |
| | | name:$(this).find("input[name*='name']").val(), |
| | | province:$(this).find("input[name*='province1']").val(), |
| | | provinceCode:$(this).find("input[name*='provinceCode1']").val(), |
| | | city:$(this).find("input[name*='city1']").val(), |
| | | cityCode:$(this).find("input[name*='cityCode1']").val(), |
| | | district:$(this).find("input[name*='district1']").val(), |
| | | districtCode:$(this).find("input[name*='districtCode1']").val(), |
| | | coordinate:$(this).find("input[name*='coordinate1']").val(), |
| | | }) |
| | | }); |
| | | if(subArr.length <= 0){ |
| | | Feng.error("请至少填写一条站点区域"); |
| | | return; |
| | | } |
| | | //提交信息 |
| | | var ajax = new $ax(Feng.ctxPath + "/airSite/add", function(data){ |
| | | if(data.status == 200){ |
| | | Feng.success("添加成功!"); |
| | | window.parent.TSite.table.refresh(); |
| | | TSiteInfoDlg.close(); |
| | | }else{ |
| | | Feng.error(data.msg); |
| | | } |
| | | },function(data){ |
| | | Feng.error("添加失败!" + data.responseJSON.message + "!"); |
| | | }); |
| | | ajax.set("name",name); |
| | | ajax.set("provinceCode",provinceCode); |
| | | ajax.set("province",$("#provinceCode option:selected").text()); |
| | | if ("" != cityCode && null != cityCode && undefined != cityCode){ |
| | | ajax.set("cityCode",cityCode); |
| | | ajax.set("city",$("#cityCode option:selected").text()); |
| | | } |
| | | if ("" != districtCode && null != districtCode && undefined != districtCode){ |
| | | ajax.set("districtCode",$("#districtCode").val()); |
| | | ajax.set("district",$("#districtCode option:selected").text()); |
| | | } |
| | | ajax.set("subArr",JSON.stringify(subArr)); |
| | | ajax.start(); |
| | | } |
| | | |
| | | /** |
| | | * 提交修改 |
| | | */ |
| | | TSiteInfoDlg.editSubmit = function() { |
| | | |
| | | this.clearData(); |
| | | this.collectData(); |
| | | if(!this.validate()){ |
| | | return ; |
| | | } |
| | | var name = $("#name").val(); |
| | | var provinceCode = $("#provinceCode").val(); |
| | | var cityCode = $("#cityCode").val(); |
| | | var districtCode = $("#districtCode").val(); |
| | | if ("" == provinceCode){ |
| | | Feng.error("请选择所属城市"); |
| | | return; |
| | | } |
| | | var subArr=[]; |
| | | $(".areaValueClass").each(function () { |
| | | subArr.push({ |
| | | id:$(this).find("input[name*='id']").val(), |
| | | areaType:$(this).find("input[name*='areaType1']").val(), |
| | | time:$(this).find("input[name*='time']").val(), |
| | | name:$(this).find("input[name*='name']").val(), |
| | | province:$(this).find("input[name*='province1']").val(), |
| | | provinceCode:$(this).find("input[name*='provinceCode1']").val(), |
| | | city:$(this).find("input[name*='city1']").val(), |
| | | cityCode:$(this).find("input[name*='cityCode1']").val(), |
| | | district:$(this).find("input[name*='district1']").val(), |
| | | districtCode:$(this).find("input[name*='districtCode1']").val(), |
| | | coordinate:$(this).find("input[name*='coordinate1']").val(), |
| | | }) |
| | | }); |
| | | if(subArr.length <= 0){ |
| | | Feng.error("请至少填写一条站点区域"); |
| | | return; |
| | | } |
| | | //提交信息 |
| | | var ajax = new $ax(Feng.ctxPath + "/airSite/update", function(data){ |
| | | Feng.success("修改成功!"); |
| | | window.parent.TSite.table.refresh(); |
| | | TSiteInfoDlg.close(); |
| | | },function(data){ |
| | | Feng.error("修改失败!" + data.responseJSON.message + "!"); |
| | | }); |
| | | ajax.set("id",$("#id").val()); |
| | | ajax.set("name",name); |
| | | ajax.set("provinceCode",provinceCode); |
| | | ajax.set("province",$("#provinceCode option:selected").text()); |
| | | if ("" != cityCode && null != cityCode && undefined != cityCode){ |
| | | ajax.set("cityCode",cityCode); |
| | | ajax.set("city",$("#cityCode option:selected").text()); |
| | | } |
| | | if ("" != districtCode && null != districtCode && undefined != districtCode){ |
| | | ajax.set("districtCode",$("#districtCode").val()); |
| | | ajax.set("district",$("#districtCode option:selected").text()); |
| | | } |
| | | ajax.set("subArr",JSON.stringify(subArr)); |
| | | ajax.start(); |
| | | } |
| | | |
| | | $(function() { |
| | | Feng.initValidator("siteInfoForm", TSiteInfoDlg.validateFields); |
| | | }); |
| | | |
| | | |
| | | //省改变 |
| | | TSiteInfoDlg.provinceChange = function (e) { |
| | | var provinceCode=$(e).val(); |
| | | var ajax = new $ax(Feng.ctxPath + "/tCompany/change", function(data){ |
| | | if(data!=null){ |
| | | var content='<option value="">选择市</option>'; |
| | | $.each(data, function(k,v) { |
| | | content += "<option value='"+v.code+"'>"+v.name+"</option>"; |
| | | }); |
| | | $("#cityCode").empty().append(content); |
| | | $("#districtCode").empty().append('<option value="">选择区</option>'); |
| | | } |
| | | }); |
| | | ajax.set("code",provinceCode); |
| | | ajax.start(); |
| | | } |
| | | //市改变 |
| | | TSiteInfoDlg.cityChange = function (e) { |
| | | var cityCode=$(e).val(); |
| | | var ajax = new $ax(Feng.ctxPath + "/tCompany/change", function(data){ |
| | | if(data!=null){ |
| | | var content='<option value="">选择区</option>'; |
| | | $.each(data, function(k,v) { |
| | | content += "<option value='"+v.code+"'>"+v.name+"</option>"; |
| | | }); |
| | | $("#districtCode").empty().append(content); |
| | | } |
| | | }); |
| | | ajax.set("code",cityCode); |
| | | ajax.start(); |
| | | } |
| | | /** |
| | | * 类型改变执行 |
| | | * @param e |
| | | */ |
| | | TSiteInfoDlg.areaTypeClick = function (e) { |
| | | if (1 == e){//行政区域 |
| | | $("#areaType1Div").show(); |
| | | $("#areaType2Div").hide(); |
| | | } else if (2 == e){ |
| | | $("#areaType2Div").show(); |
| | | $("#areaType1Div").hide(); |
| | | } |
| | | } |
| | | |
| | | //站点区域省改变 |
| | | TSiteInfoDlg.provinceChange1 = function (e) { |
| | | var provinceCode=$(e).val(); |
| | | var ajax = new $ax(Feng.ctxPath + "/tCompany/change", function(data){ |
| | | if(data!=null){ |
| | | var content='<option value="">选择市</option>'; |
| | | $.each(data, function(k,v) { |
| | | content += "<option value='"+v.code+"'>"+v.name+"</option>"; |
| | | }); |
| | | $("#cityCode1").empty().append(content); |
| | | $("#districtCode1").empty().append('<option value="">选择区</option>'); |
| | | } |
| | | }); |
| | | ajax.set("code",provinceCode); |
| | | ajax.start(); |
| | | } |
| | | //站点区域市改变 |
| | | TSiteInfoDlg.cityChange1 = function (e) { |
| | | var cityCode=$(e).val(); |
| | | var ajax = new $ax(Feng.ctxPath + "/tCompany/change", function(data){ |
| | | if(data!=null){ |
| | | var content='<option value="">选择区</option>'; |
| | | $.each(data, function(k,v) { |
| | | content += "<option value='"+v.code+"'>"+v.name+"</option>"; |
| | | }); |
| | | $("#districtCode1").empty().append(content); |
| | | } |
| | | }); |
| | | ajax.set("code",cityCode); |
| | | ajax.start(); |
| | | } |
| | | |
| | | /** |
| | | * 添加区域 |
| | | */ |
| | | TSiteInfoDlg.addArea = function () { |
| | | var areaName = $("#areaName").val(); |
| | | if ("" == areaName || null == areaName){ |
| | | Feng.error("区域名称不能为空"); |
| | | return; |
| | | } |
| | | var areaType = $("input[name='areaType']:checked").val(); |
| | | var b = false; |
| | | $(".areaValueClass").each(function () { |
| | | var areaType1 = $(this).find("input[name*='areaType1']").val(); |
| | | if(areaType != areaType1){ |
| | | b = true; |
| | | return |
| | | } |
| | | }); |
| | | if(b){ |
| | | Feng.error("电子围栏和行政区域不能混合使用"); |
| | | return; |
| | | } |
| | | |
| | | if (1 == areaType){ |
| | | var provinceCode1 = $("#provinceCode1").val(); |
| | | var province1 = $("#provinceCode1 option:selected").text(); |
| | | var cityCode1 = $("#cityCode1").val(); |
| | | var city1 = $("#cityCode1 option:selected").text(); |
| | | var districtCode1 = $("#districtCode1").val(); |
| | | var district1 = $("#districtCode1 option:selected").text(); |
| | | if ("" == provinceCode1){ |
| | | Feng.error("请选择行政区域所属省"); |
| | | return; |
| | | } |
| | | }else if (2 == areaType) { |
| | | if("" == coordinate){ |
| | | Feng.error('请在地图上规划区域'); |
| | | return; |
| | | } |
| | | } |
| | | var subArr=[]; |
| | | $(".areaValueClass").each(function () { |
| | | subArr.push({ |
| | | areaType:$(this).find("input[name*='areaType1']").val(), |
| | | time:$(this).find("input[name*='time']").val(), |
| | | name:$(this).find("input[name*='name']").val(), |
| | | province:$(this).find("input[name*='province1']").val(), |
| | | provinceCode:$(this).find("input[name*='provinceCode1']").val(), |
| | | city:$(this).find("input[name*='city1']").val(), |
| | | cityCode:$(this).find("input[name*='cityCode1']").val(), |
| | | district:$(this).find("input[name*='district1']").val(), |
| | | districtCode:$(this).find("input[name*='districtCode1']").val(), |
| | | coordinate:$(this).find("input[name*='coordinate1']").val(), |
| | | }) |
| | | }); |
| | | var str = '<tr class="areaValueClass">' + |
| | | // '<td>' + (subArr.length+1) + '</td>' + |
| | | '<td style="text-align: center;">' + |
| | | '<input type="hidden" id="areaType1" name="areaType1" value="'+areaType+'">' + |
| | | '<input type="hidden" id="time" name="time" value="'+getNowFormatDate()+'">' + getNowFormatDate() + '</td>' + |
| | | |
| | | '<td style="text-align: center;">' + |
| | | '<input type="hidden" id="name" name="name" value="'+areaName+'">' + |
| | | '<input type="hidden" id="provinceCode1" name="provinceCode1" value="'+provinceCode1+'">' + |
| | | '<input type="hidden" id="province1" name="province1" value="'+province1+'">' + |
| | | '<input type="hidden" id="cityCode1" name="cityCode1" value="'+cityCode1+'">' + |
| | | '<input type="hidden" id="city1" name="city1" value="'+city1+'">' + |
| | | '<input type="hidden" id="districtCode1" name="districtCode1" value="'+districtCode1+'">' + |
| | | '<input type="hidden" id="district1" name="district1" value="'+district1+'">' + |
| | | '<input type="hidden" id="coordinate1" name="coordinate1" value="'+coordinate+'">' + areaName + '</td>' + |
| | | |
| | | '<td style="text-align: center;"><button onclick="deleteSub(this)">移除</button></td></tr>'; |
| | | $("#areaValue").append(str); |
| | | |
| | | //清除电子围栏数据 |
| | | $("#clear").click(); |
| | | } |
| | | //删除数据 |
| | | function deleteSub(e) { |
| | | $(e).parent().parent().remove(); |
| | | } |
New file |
| | |
| | | var map = new AMap.Map('container',{ |
| | | resizeEnable: true, |
| | | zoom:10 |
| | | }); |
| | | |
| | | |
| | | var value = ""; |
| | | map.getCity( |
| | | callback=function (result) { |
| | | value = result.city; |
| | | drawBounds(); |
| | | } |
| | | ); |
| | | |
| | | |
| | | var mouseTool = new AMap.MouseTool(map); |
| | | //监听draw事件可获取画好的覆盖物 |
| | | var overlays = []; |
| | | var name = null; |
| | | var coordinate = '';//存储坐标 |
| | | var objs = {//存储各种类型的覆盖物对象 |
| | | "polyline":[], |
| | | "polygon":[], |
| | | "rectangle":[], |
| | | "circle":[] |
| | | }; |
| | | var editors = []; |
| | | mouseTool.on('draw',function(e){ |
| | | overlays.push(e.obj); |
| | | console.log(e.obj.getPath()); |
| | | |
| | | switch (name) { |
| | | case 'polyline':{//折线图 |
| | | var polyline = e.obj.getPath(); |
| | | getCoordinate(polyline); |
| | | objs.polyline.push(e.obj); |
| | | break; |
| | | } |
| | | case 'polygon':{//多边形 |
| | | var polygon = e.obj.getPath(); |
| | | getCoordinate(polygon); |
| | | objs.polygon.push(e.obj); |
| | | break; |
| | | } |
| | | case 'rectangle':{//矩形 |
| | | var rectangle = e.obj.getPath(); |
| | | getCoordinate(rectangle); |
| | | objs.rectangle.push(e.obj); |
| | | break; |
| | | } |
| | | case 'circle':{//圆形 |
| | | var center = e.obj.getCenter(); |
| | | var radius = e.obj.getRadius(); |
| | | if(radius > 5000){ |
| | | Feng.error("创建电子围栏失败,圆半径不能大于5000米"); |
| | | return; |
| | | } |
| | | coordinate += center.lng + ',' + center.lat + ';' + radius + "_"; |
| | | objs.circle.push(e.obj); |
| | | break; |
| | | } |
| | | } |
| | | console.log(coordinate); |
| | | }) |
| | | |
| | | |
| | | var district = null; |
| | | var polygons=[]; |
| | | function drawBounds() { |
| | | if(value == ''){ |
| | | value = '北京市'; |
| | | } |
| | | |
| | | //加载行政区划插件 |
| | | if(!district){ |
| | | //实例化DistrictSearch |
| | | var opts = { |
| | | subdistrict: 0, //获取边界不需要返回下级行政区 |
| | | extensions: 'all', //返回行政区边界坐标组等具体信息 |
| | | level: 'district' //查询行政级别为 市 |
| | | }; |
| | | district = new AMap.DistrictSearch(opts); |
| | | } |
| | | //行政区查询 |
| | | district.setLevel(document.getElementById('level').value) |
| | | district.search(value, function(status, result) { |
| | | map.remove(polygons)//清除上次结果 |
| | | polygons = []; |
| | | var bounds = result.districtList[0].boundaries; |
| | | if (bounds) { |
| | | for (var i = 0, l = bounds.length; i < l; i++) { |
| | | //生成行政区划polygon |
| | | var polygon = new AMap.Polygon({ |
| | | strokeWeight: 1, |
| | | path: bounds[i], |
| | | fillOpacity: 0.4, |
| | | fillColor: '#80d8ff', |
| | | strokeColor: '#0091ea' |
| | | }); |
| | | polygons.push(polygon); |
| | | } |
| | | } |
| | | map.add(polygons) |
| | | map.setFitView(polygons);//视口自适应 |
| | | }); |
| | | } |
| | | |
| | | document.getElementById('find').onclick = function () { |
| | | value = document.getElementById('district').value; |
| | | if(value == ''){ |
| | | value = "北京市"; |
| | | } |
| | | drawBounds() |
| | | }; |
| | | document.getElementById('district').onkeydown = function(e) { |
| | | if (e.keyCode === 13) { |
| | | value = document.getElementById('district').value; |
| | | if(value == ''){ |
| | | value = "北京市"; |
| | | } |
| | | drawBounds(); |
| | | return false; |
| | | } |
| | | return true; |
| | | }; |
| | | |
| | | |
| | | |
| | | |
| | | //处理坐标结果 |
| | | function getCoordinate(arr){ |
| | | var str = ''; |
| | | for(var i = 0; i < arr.length; i++){ |
| | | var lng = arr[i].lng; |
| | | var lat = arr[i].lat; |
| | | str += lng + ',' + lat + ';'; |
| | | } |
| | | coordinate += str.substring(0, str.length - 1) + "_"; |
| | | } |
| | | |
| | | |
| | | function draw(type){ |
| | | switch(type){ |
| | | case 'marker':{ |
| | | mouseTool.marker({ |
| | | //同Marker的Option设置 |
| | | }); |
| | | break; |
| | | } |
| | | case 'polyline':{ |
| | | mouseTool.polyline({ |
| | | strokeColor:'#80d8ff' |
| | | //同Polyline的Option设置 |
| | | }); |
| | | break; |
| | | } |
| | | case 'polygon':{ |
| | | mouseTool.polygon({ |
| | | fillColor:'#00b0ff', |
| | | strokeColor:'#80d8ff' |
| | | //同Polygon的Option设置 |
| | | }); |
| | | break; |
| | | } |
| | | case 'rectangle':{ |
| | | mouseTool.rectangle({ |
| | | fillColor:'#00b0ff', |
| | | strokeColor:'#80d8ff' |
| | | //同Polygon的Option设置 |
| | | }); |
| | | break; |
| | | } |
| | | case 'circle':{ |
| | | mouseTool.circle({ |
| | | fillColor:'#00b0ff', |
| | | strokeColor:'#80d8ff' |
| | | //同Circle的Option设置 |
| | | }); |
| | | break; |
| | | } |
| | | } |
| | | } |
| | | var radios = document.getElementsByName('func'); |
| | | for(var i=0;i<radios.length;i+=1){ |
| | | radios[i].onchange = function(e){ |
| | | draw(e.target.value) |
| | | name = e.target.value; |
| | | } |
| | | } |
| | | // draw('marker') |
| | | |
| | | document.getElementById('clear').onclick = function(){ |
| | | map.remove(overlays) |
| | | overlays = []; |
| | | coordinate = ''; |
| | | objs.circle = []; |
| | | objs.rectangle = []; |
| | | objs.polygon = []; |
| | | objs.polyline = []; |
| | | closeEdit(); |
| | | } |
| | | document.getElementById('close').onclick = function(){ |
| | | mouseTool.close()//关闭,并清除覆盖物 |
| | | for(var i=0;i<radios.length;i+=1){ |
| | | radios[i].checked = false; |
| | | } |
| | | closeEdit(); |
| | | } |
| | | |
| | | |
| | | //点击提交处理函数 |
| | | function submitCoordinate(){ |
| | | var name = $('#addressName').val(); |
| | | if('' == name){ |
| | | Feng.error('请填写地址名称'); |
| | | return; |
| | | } |
| | | if('' == coordinate){ |
| | | Feng.error('请在地图上规划区域'); |
| | | return; |
| | | } |
| | | coordinate = coordinate.substring(0, coordinate.length - 1); |
| | | |
| | | } |
| | | |
| | | function editAll() { |
| | | coordinate = ''; |
| | | editors = []; |
| | | //折线 |
| | | for(var i in objs.polyline){ |
| | | var polyline = objs.polyline[i]; |
| | | var polyEditor = new AMap.PolyEditor(map, polyline) |
| | | polyEditor.on('addnode', function(event) { |
| | | // log.info('触发事件:addnode') |
| | | }) |
| | | |
| | | polyEditor.on('adjust', function(event) { |
| | | // log.info('触发事件:adjust') |
| | | }) |
| | | |
| | | polyEditor.on('removenode', function(event) { |
| | | // log.info('触发事件:removenode') |
| | | }) |
| | | |
| | | polyEditor.on('end', function(e) { |
| | | var polyline = e.target.getPath(); |
| | | getCoordinate(polyline); |
| | | }) |
| | | editors.push(polyEditor); |
| | | polyEditor.open(); |
| | | } |
| | | |
| | | //多边形 |
| | | for(var i in objs.polygon){ |
| | | var polygon = objs.polygon[i]; |
| | | var polyEditor = new AMap.PolyEditor(map, polygon) |
| | | |
| | | polyEditor.on('addnode', function(event) { |
| | | // log.info('触发事件:addnode') |
| | | }) |
| | | |
| | | polyEditor.on('adjust', function(event) { |
| | | // log.info('触发事件:adjust') |
| | | }) |
| | | |
| | | polyEditor.on('removenode', function(event) { |
| | | // log.info('触发事件:removenode') |
| | | }) |
| | | |
| | | polyEditor.on('end', function(e) { |
| | | var polygon = e.target.getPath(); |
| | | getCoordinate(polygon); |
| | | }) |
| | | editors.push(polyEditor); |
| | | polyEditor.open(); |
| | | } |
| | | |
| | | |
| | | //矩形 |
| | | for(var i in objs.rectangle){ |
| | | var rectangle = objs.rectangle[i]; |
| | | var rectangleEditor = new AMap.RectangleEditor(map, rectangle) |
| | | |
| | | rectangleEditor.on('adjust', function(event) { |
| | | // log.info('触发事件:adjust') |
| | | }) |
| | | |
| | | rectangleEditor.on('end', function(e) { |
| | | var polygon = e.target.getPath(); |
| | | getCoordinate(polygon); |
| | | }) |
| | | editors.push(rectangleEditor); |
| | | rectangleEditor.open(); |
| | | } |
| | | |
| | | //圆形 |
| | | for(var i in objs.circle){ |
| | | var circle = objs.circle[i]; |
| | | var circleEditor = new AMap.CircleEditor(map, circle) |
| | | |
| | | circleEditor.on('move', function(event) { |
| | | // log.info('触发事件:move') |
| | | }) |
| | | |
| | | circleEditor.on('adjust', function(e) { |
| | | var radius = e.target.getRadius(); |
| | | if(radius > 5000){ |
| | | Feng.error("创建电子围栏失败,圆半径不能大于5000米"); |
| | | return; |
| | | } |
| | | }) |
| | | |
| | | circleEditor.on('end', function(e) { |
| | | var center = e.target.getCenter(); |
| | | var radius = e.target.getRadius(); |
| | | coordinate += center.lng + ',' + center.lat + ';' + radius + "_"; |
| | | }) |
| | | editors.push(circleEditor); |
| | | circleEditor.open(); |
| | | } |
| | | } |
| | | |
| | | |
| | | function closeEdit() { |
| | | for(var i in editors){ |
| | | var editor = editors[i]; |
| | | editor.close(); |
| | | } |
| | | } |