Commit 810be6fb420bbaf9e53b926450dad14b87ff75c4

Authored by 娄高锋
2 parents 130d36da e968bffb

Merge branch 'minhang' of 192.168.168.201:panzhaov5/bsth_control into minhang

Showing 42 changed files with 1463 additions and 354 deletions
src/main/java/com/bsth/controller/realcontrol/RealMapController.java
... ... @@ -49,6 +49,11 @@ public class RealMapController {
49 49 return realMapService.findRouteByLine(lineCode);
50 50 }
51 51  
  52 + @RequestMapping(value = "/multiRouteByLine")
  53 + public Map<String, Object> multiRouteByLine(@RequestParam String codeStr) {
  54 + return realMapService.multiRouteByLine(codeStr);
  55 + }
  56 +
52 57  
53 58 /**
54 59 * 获取线路的路段路由 和 站点路由信息 (为前端站间距计算提供数据源)
... ...
src/main/java/com/bsth/controller/sys/RealControAuthorityController.java 0 → 100644
  1 +package com.bsth.controller.sys;
  2 +
  3 +import com.bsth.controller.BaseController;
  4 +import com.bsth.entity.sys.RealControAuthority;
  5 +import com.bsth.security.util.SecurityUtils;
  6 +import com.bsth.service.sys.RealControAuthorityService;
  7 +import org.springframework.beans.factory.annotation.Autowired;
  8 +import org.springframework.web.bind.annotation.RequestMapping;
  9 +import org.springframework.web.bind.annotation.RequestParam;
  10 +import org.springframework.web.bind.annotation.RestController;
  11 +
  12 +import javax.servlet.http.HttpServletRequest;
  13 +
  14 +/**
  15 + * Created by panzhao on 2017/2/14.
  16 + */
  17 +@RestController
  18 +@RequestMapping("realControAuthority")
  19 +public class RealControAuthorityController extends BaseController<RealControAuthority, Integer> {
  20 +
  21 + @Autowired
  22 + RealControAuthorityService realControAuthorityService;
  23 +
  24 + @RequestMapping("findByUserId")
  25 + public RealControAuthority findByUserId(@RequestParam Integer userId){
  26 +
  27 + return realControAuthorityService.findByUserId(userId);
  28 + }
  29 +
  30 + @RequestMapping("findByCurrentUser")
  31 + public RealControAuthority findByUserId(HttpServletRequest request){
  32 + return realControAuthorityService.findByUserId(SecurityUtils.getCurrentUser().getId());
  33 + }
  34 +}
... ...
src/main/java/com/bsth/data/gpsdata/GpsEntity.java
... ... @@ -88,6 +88,9 @@ public class GpsEntity {
88 88 /** 越界距离 */
89 89 private double outOfBoundDistance;
90 90  
  91 + /** gps是否有效 设备端发送的状态 */
  92 + private int valid;
  93 +
91 94 public Integer getCompanyCode() {
92 95 return companyCode;
93 96 }
... ... @@ -280,4 +283,12 @@ public class GpsEntity {
280 283 public void setOutOfBoundDistance(double outOfBoundDistance) {
281 284 this.outOfBoundDistance = outOfBoundDistance;
282 285 }
  286 +
  287 + public int getValid() {
  288 + return valid;
  289 + }
  290 +
  291 + public void setValid(int valid) {
  292 + this.valid = valid;
  293 + }
283 294 }
... ...
src/main/java/com/bsth/data/gpsdata/GpsRealData.java
... ... @@ -52,7 +52,7 @@ public class GpsRealData implements CommandLineRunner {
52 52 public void run(String... arg0) throws Exception {
53 53 logger.info("gpsDataLoader,20,5");
54 54 //定时从网关获取GPS数据
55   - //Application.mainServices.scheduleWithFixedDelay(gpsDataLoader, 20, 5, TimeUnit.SECONDS);
  55 + //Application.mainServices.scheduleWithFixedDelay(gpsDataLoader, 20, 15, TimeUnit.SECONDS);
56 56 //定时扫描掉离线
57 57  
58 58 }
... ...
src/main/java/com/bsth/entity/sys/RealControAuthority.java 0 → 100644
  1 +package com.bsth.entity.sys;
  2 +
  3 +import javax.persistence.*;
  4 +
  5 +/**
  6 + * 线调权限配置
  7 + * Created by panzhao on 2017/2/14.
  8 + */
  9 +@Entity
  10 +@Table(name = "bsth_c_real_control_authority")
  11 +public class RealControAuthority {
  12 +
  13 + @Id
  14 + private Integer userId;
  15 +
  16 + /**
  17 + * 可调度的线路 , 分隔多个
  18 + */
  19 + private String lineCodeStr;
  20 +
  21 + /**
  22 + * 调度模式 0: 监控模式 1:主调模式
  23 + */
  24 + private int pattern;
  25 +
  26 + public Integer getUserId() {
  27 + return userId;
  28 + }
  29 +
  30 + public void setUserId(Integer userId) {
  31 + this.userId = userId;
  32 + }
  33 +
  34 + public String getLineCodeStr() {
  35 + return lineCodeStr;
  36 + }
  37 +
  38 + public void setLineCodeStr(String lineCodeStr) {
  39 + this.lineCodeStr = lineCodeStr;
  40 + }
  41 +
  42 + public int getPattern() {
  43 + return pattern;
  44 + }
  45 +
  46 + public void setPattern(int pattern) {
  47 + this.pattern = pattern;
  48 + }
  49 +}
... ...
src/main/java/com/bsth/entity/sys/UserLine.java
1 1 package com.bsth.entity.sys;
2 2  
3   -import javax.persistence.Entity;
4   -import javax.persistence.GeneratedValue;
5   -import javax.persistence.GenerationType;
6   -import javax.persistence.Id;
7   -import javax.persistence.ManyToOne;
8   -import javax.persistence.Table;
9   -
10 3 import com.bsth.entity.Line;
11 4  
  5 +import javax.persistence.*;
  6 +
12 7 /**
13 8 *
14 9 * @ClassName: Line(用户线路分配实体类)
... ... @@ -20,6 +15,8 @@ import com.bsth.entity.Line;
20 15 * @Date 2016年8月26日 09:03:33
21 16 *
22 17 * @Version 公交调度系统BS版 0.1
  18 + *
  19 + * PS:这个类缺少主调监控模式的配置,暂不使用
23 20 *
24 21 */
25 22  
... ...
src/main/java/com/bsth/repository/sys/RealControAuthorityRepository.java 0 → 100644
  1 +package com.bsth.repository.sys;
  2 +
  3 +import com.bsth.entity.sys.RealControAuthority;
  4 +import com.bsth.repository.BaseRepository;
  5 +import org.springframework.data.jpa.repository.Query;
  6 +import org.springframework.stereotype.Repository;
  7 +
  8 +/**
  9 + * Created by panzhao on 2017/2/14.
  10 + */
  11 +@Repository
  12 +public interface RealControAuthorityRepository extends BaseRepository<RealControAuthority, Integer>{
  13 +
  14 + @Query("select t from RealControAuthority t where t.userId=?1")
  15 + RealControAuthority findByUserId(Integer userId);
  16 +}
... ...
src/main/java/com/bsth/service/realcontrol/RealMapService.java
... ... @@ -15,4 +15,6 @@ public interface RealMapService {
15 15 Map<String,Object> findRouteAndStationByLine(String lineCode);
16 16  
17 17 Map<String,Object> multiSectionRoute(String codeIdx);
  18 +
  19 + Map<String,Object> multiRouteByLine(String codeStr);
18 20 }
... ...
src/main/java/com/bsth/service/realcontrol/impl/RealMapServiceImpl.java
... ... @@ -159,6 +159,17 @@ public class RealMapServiceImpl implements RealMapService {
159 159 return rs;
160 160 }
161 161  
  162 + @Override
  163 + public Map<String, Object> multiRouteByLine(String codeStr) {
  164 + List<String> codeArray = Splitter.on(",").splitToList(codeStr);
  165 + Map<String, Object> rs = new HashMap<>();
  166 +
  167 + for(String code : codeArray){
  168 + rs.put(code + "_route" ,findRouteByLine(code));
  169 + }
  170 + return rs;
  171 + }
  172 +
162 173 /**
163 174 * wgs 坐标数组转 百度
164 175 *
... ...
src/main/java/com/bsth/service/sys/RealControAuthorityService.java 0 → 100644
  1 +package com.bsth.service.sys;
  2 +
  3 +import com.bsth.entity.sys.RealControAuthority;
  4 +import com.bsth.service.BaseService;
  5 +
  6 +/**
  7 + * Created by panzhao on 2017/2/14.
  8 + */
  9 +public interface RealControAuthorityService extends BaseService<RealControAuthority, Integer> {
  10 + RealControAuthority findByUserId(Integer userId);
  11 +}
... ...
src/main/java/com/bsth/service/sys/impl/RealControAuthorityServiceImpl.java 0 → 100644
  1 +package com.bsth.service.sys.impl;
  2 +
  3 +import com.bsth.entity.sys.RealControAuthority;
  4 +import com.bsth.repository.sys.RealControAuthorityRepository;
  5 +import com.bsth.service.impl.BaseServiceImpl;
  6 +import com.bsth.service.sys.RealControAuthorityService;
  7 +import org.springframework.beans.factory.annotation.Autowired;
  8 +import org.springframework.stereotype.Service;
  9 +
  10 +/**
  11 + * Created by panzhao on 2017/2/14.
  12 + */
  13 +@Service
  14 +public class RealControAuthorityServiceImpl extends BaseServiceImpl<RealControAuthority, Integer> implements RealControAuthorityService {
  15 +
  16 + @Autowired
  17 + RealControAuthorityRepository realControAuthorityRepository;
  18 +
  19 + @Override
  20 + public RealControAuthority findByUserId(Integer userId) {
  21 + return realControAuthorityRepository.findByUserId(userId);
  22 + }
  23 +}
... ...
src/main/resources/static/assets/js/common.js
... ... @@ -119,6 +119,8 @@ function initPinYinSelect2(selector, data, cb){
119 119 $(selector).select2({
120 120 data: data,
121 121 matcher: oldMatcher(function(term, text, item){
  122 + if(!item.id)
  123 + return;
122 124 var upTerm = term.toUpperCase();
123 125 if(item.fullChars.indexOf(upTerm) != -1
124 126 || item.camelChars.indexOf(upTerm) != -1)
... ...
src/main/resources/static/index.html
... ... @@ -289,6 +289,11 @@
289 289 {{/each}}
290 290  
291 291 </script>
  292 +<script>
  293 + delete window.require;
  294 + delete window.exports;
  295 + delete window.module;
  296 +</script>
292 297 <!-- jQuery -->
293 298 <script src="/metronic_v4.5.4/plugins/jquery.min.js" data-exclude=1></script>
294 299 <!-- bootstrap -->
... ...
src/main/resources/static/login.html
... ... @@ -220,6 +220,11 @@ h3.logo-text{
220 220 <div class="login-footer"> © 2016 上海巴士拓华科技发展有限公司 Some Rights Reserved </div>
221 221 </div>
222 222  
  223 +<script>
  224 + delete window.require;
  225 + delete window.exports;
  226 + delete window.module;
  227 +</script>
223 228 <!-- jQuery -->
224 229 <script src="/metronic_v4.5.4/plugins/jquery.min.js" ></script>
225 230 <script src="/assets/plugins/jsencrypt.min.js" ></script>
... ... @@ -228,7 +233,7 @@ window.onload=function(){
228 233 var body=document.getElementsByTagName("body")[0];
229 234 if(typeof body.style.WebkitAnimation=="undefined")
230 235 $('.warn-note').fadeIn();
231   -}
  236 +};
232 237 !function(){
233 238 var form = $('#loginPanel form')
234 239 ,nameInput = $('input[name=userName]', form)
... ...
src/main/resources/static/pages/control/lineallot/allot.html
... ... @@ -112,10 +112,10 @@
112 112 margin-bottom: 3px;
113 113 }
114 114  
115   - /** 闵行没有分公司,直接隐藏 */
  115 + /** 闵行没有分公司,直接隐藏
116 116 .company, .sub-company {
117 117 display: none !important;
118   - }
  118 + } */
119 119 </style>
120 120  
121 121 <div class="page-head">
... ... @@ -138,6 +138,8 @@
138 138 class="caption-subject font-green bold uppercase">选择线路</span>
139 139 </div>
140 140 </div>
  141 + <div class="alert alert-info">
  142 + <strong>ps</strong> 可选择的线路,进入后是监控还是主调模式。可在 权限管理-> 用户管理里 进行配置。 </div>
141 143 <div class="portlet-body">
142 144 <div class="row" style="margin-bottom: 30px;">
143 145 <div class="col-md-8 col-sm-12 col-md-offset-2" style="text-align: center;">
... ... @@ -162,11 +164,11 @@
162 164 <div class="selected-body"></div>
163 165  
164 166 <div class="lb_panel">
165   - <a href="javascript:;" class="btn btn-lg blue gotoControl red" data-status=1>
166   - <i class="fa fa-power-off"></i> 主调模式 </a>
  167 + <a href="javascript:;" class="btn btn-lg blue gotoControl" data-status=1>
  168 + <i class="fa fa-power-off"></i> 进入线路调度 </a>
167 169  
168   - <a href="javascript:;" id="monitor" class="btn btn-lg grey gotoControl" data-status=0>
169   - <i class="fa fa-tv"></i> 监控模式 </a>
  170 + <!--<a href="javascript:;" id="monitor" class="btn btn-lg grey gotoControl" data-status=0>
  171 + <i class="fa fa-tv"></i> 监控模式 </a>-->
170 172 &nbsp;
171 173 <a href="javascript:;" id="resetBtn" style="left: 120px;color: #3598DC;">
172 174 <i class="fa fa-history"></i> 重置</a>
... ... @@ -184,15 +186,13 @@
184 186 </div>
185 187  
186 188 <script id="line_select_cont_temp" type="text/html">
187   - {{each data as obj company}}
188   - <h3 class="company">{{company}}</h3>
189   - {{each data[company] as subObj subCompany}}
190   - <h5 class="sub-company" style="font-family: 仿宋;">{{company}}_{{subCompany}}</h5>
191   - {{each data[company][subCompany] as line i}}
  189 + {{each list as line i}}
192 190 <div class="line" name="line_{{line.lineCode}}" data-id={{line.lineCode}}>{{line.name}}</div>
193 191 {{/each}}
194   - {{/each}}
195   - {{/each}}
  192 +
  193 + {{if list.length == 0}}
  194 + <span style="color: #ff4444;font-family: 微软雅黑;"><i class="fa fa-question-circle"></i> 当前用户没有可调度的线路</span>
  195 + {{/if}}
196 196 </script>
197 197 <script src="/assets/js/eventproxy.js"></script>
198 198 <script>
... ... @@ -213,64 +213,58 @@
213 213 var lineIds = {};
214 214  
215 215 var storage = window.localStorage;
216   -
  216 + //线调权限
  217 + var auth;
217 218 $get('/line/all', {destroy_eq: 0}, function (allLine) {
218   - $('#searchLineInput').focus();
219   - //按公司分组
220   - var companyJson = groupData(allLine, 'company');
221   - //按分公司分组
222   - for (var company in companyJson) {
223   - companyJson[company] = groupData(companyJson[company], 'brancheCompany');
224   - }
  219 + //用户分配的线路
  220 + $.get('/realControAuthority/findByCurrentUser', function (t) {
  221 + auth = t;
  222 + var newArray = [], authArray = [];
  223 +
  224 + try{
  225 + authArray = t.lineCodeStr.split(',');
  226 + }catch (e){}
  227 +
  228 + $.each(allLine, function () {
  229 + if (this.lineCode && authArray.indexOf(this.lineCode) != -1) {
  230 + newArray.push(this);
  231 + }
  232 + });
225 233  
226   - var htmlStr = template('line_select_cont_temp', {data: companyJson});
227   - $('.line-select-body').html(htmlStr)
228   - .slimscroll({//滚动条
229   - height: '270px'
230   - });
231   -
232   - //替换公司编码
233   - /* var gsmap = {};
234   - $get('/business/all', null, function(array){
235   - $.each(array, function(i, gs){
236   - var k = gs.upCode + '_' + gs.businessCode;
237   - if(gs.upCode === '88'){
238   - k = gs.businessCode;
239   - }
240   - gsmap[k] = gs.businessName;
241   - });
242   -
243   - $.each($('.company,.sub-company'), function(j , e){
244   - var k = $(e).text();
245   - gsmap[k] && $(e).text(gsmap[k]);
246   - })
247   - }); */
248   -
249   - //映射
250   - $.each(allLine, function (s, line) {
251   - camelChars[pinyin.getCamelChars(line.name)] = line.lineCode;
252   - fullChars[pinyin.getFullChars(line.name).toUpperCase()] = line.lineCode;
253   - zhChars[line.name] = line.lineCode;
254   - lineIdMap[line.lineCode] = line;
255   -
256   - lineIds[line.lineCode] = line.name;
257   - });
258   - //合并映射
259   - $.extend(allChars, camelChars, fullChars, zhChars);
260   -
261   - //线路选中事件
262   - $('.line-select-body .line').on('click', function () {
263   - if ($(this).hasClass('active')) {
264   - $(this).removeClass('active');
265   - $('.selected-body .line[name=' + $(this).attr('name') + ']').remove();
266   - }
267   - else {
268   - $(this).addClass('active');
269   - $('.selected-body').append($(this).clone());
270   - }
  234 + var htmlStr = template('line_select_cont_temp', {list: newArray});
  235 + $('.line-select-body').html(htmlStr)
  236 + .slimscroll({//滚动条
  237 + height: '270px'
  238 + });
  239 +
  240 + //映射
  241 + $.each(allLine, function (s, line) {
  242 + camelChars[pinyin.getCamelChars(line.name)] = line.lineCode;
  243 + fullChars[pinyin.getFullChars(line.name).toUpperCase()] = line.lineCode;
  244 + zhChars[line.name] = line.lineCode;
  245 + lineIdMap[line.lineCode] = line;
  246 +
  247 + lineIds[line.lineCode] = line.name;
  248 + });
  249 + //合并映射
  250 + $.extend(allChars, camelChars, fullChars, zhChars);
  251 +
  252 + //线路选中事件
  253 + $('.line-select-body .line').on('click', function () {
  254 + if ($(this).hasClass('active')) {
  255 + $(this).removeClass('active');
  256 + $('.selected-body .line[name=' + $(this).attr('name') + ']').remove();
  257 + }
  258 + else {
  259 + $(this).addClass('active');
  260 + $('.selected-body').append($(this).clone());
  261 + }
  262 + });
  263 +
  264 + storage.setItem('lineIds', JSON.stringify(lineIds));
271 265 });
272 266  
273   - storage.setItem('lineIds', JSON.stringify(lineIds));
  267 + $('#searchLineInput').focus();
274 268 });
275 269  
276 270 //搜索框事件
... ... @@ -304,9 +298,9 @@
304 298 });
305 299 storage.setItem('lineControlItems', JSON.stringify(lsData));
306 300  
307   - var operationMode = $(this).data('status');
  301 + //ar operationMode = $(this).data('status');
308 302 //监控模式还是主调模式
309   - storage.setItem('operationMode', operationMode);
  303 + storage.setItem('operationMode', auth.pattern);
310 304  
311 305 var ep = new EventProxy();
312 306 //缓存车辆自编号和设备号对照
... ...
src/main/resources/static/pages/permission/user/controlAllot.html 0 → 100644
  1 +<div id="pageRealControlAllotWrap" style="overflow: hidden;padding: 15px 15px 0;">
  2 +
  3 + <style>
  4 + #pageRealControlAllotWrap span.line-item {
  5 + background: #efefef;
  6 + padding: 4px 11px;
  7 + margin: 0 3px 11px 8px;
  8 + box-shadow: 0px 1px 3px 0 rgba(71, 69, 69, 0.2), 1px 2px 3px 0 rgba(96, 94, 94, 0.19);
  9 + position: relative;
  10 + border: 1px solid #c5c0c0;
  11 + display: inline-block;
  12 + }
  13 +
  14 + #pageRealControlAllotWrap .remove-icon {
  15 + position: absolute;
  16 + right: -5px;
  17 + top: -5px;
  18 + color: #ffffff;
  19 + background: #ff4646;
  20 + border-radius: 99px;
  21 + font-size: 12px;
  22 + cursor: pointer;
  23 + padding: 0px 1px;
  24 + }
  25 +
  26 + .select2-container {
  27 + z-index: 99891017;
  28 + }
  29 + </style>
  30 +
  31 + <h4>
  32 + mky001/ 系统管理员
  33 + </h4>
  34 +
  35 + <div style="border: 1px solid #cccbcb;height: 190px;position: relative;">
  36 + <span style="display: block;margin: 10px;color: grey;">已分配的线路</span>
  37 +
  38 + <div class="line-list" style="height: 110px;">
  39 + </div>
  40 +
  41 + <div style="padding-left: 8px;">
  42 + <div style="display: inline-block;">
  43 + <select name="lineSelect" style="width: 160px;">
  44 + <option value="">请选择线路...</option>
  45 + </select>
  46 + </div>
  47 +
  48 + <button disabled type="button" id="addLineItemBtn" class="btn blue btn-sm" style="margin-top: -10px;"><i
  49 + class="fa fa-plus"></i> 添加线路
  50 + </button>
  51 + </div>
  52 + </div>
  53 +
  54 + <div style="margin-top: 15px;">
  55 + <form class="form-horizontal">
  56 + <div class="form-group" style="width: 50%;">
  57 + <label class="col-md-5 control-label">系统运行模式</label>
  58 + <div class="col-md-7">
  59 + <select class="form-control" name="pattern">
  60 + <option value="0">监控模式</option>
  61 + <option value="1">主调模式</option>
  62 + </select>
  63 + </div>
  64 + </div>
  65 + </form>
  66 + </div>
  67 +
  68 + <button class="btn blue btn-block" id="saveBtn"><i class="fa fa-check"></i> 保存</button>
  69 + <script>
  70 + !function () {
  71 + var wrap = '#pageRealControlAllotWrap'
  72 + , lineSelect = $('select[name=lineSelect]', wrap)
  73 + , addBtn = $('#addLineItemBtn', wrap);
  74 +
  75 + var userId;
  76 + var codeNameMap = {};
  77 + $(wrap).on('init', function (e, id) {
  78 + e.stopPropagation();
  79 + userId = id;
  80 +
  81 + $.get('/line/all', {'destroy_eq': 0}, function (rs) {
  82 + var data = [];
  83 + $.each(rs, function () {
  84 + data.push({
  85 + id: this.lineCode,
  86 + text: this.name
  87 + });
  88 + codeNameMap[this.lineCode] = this.name;
  89 + });
  90 +
  91 + initPinYinSelect2(lineSelect, data);
  92 +
  93 + $.get('/realControAuthority/findByUserId', {userId: userId}, function (t) {
  94 + if(!t || !t.lineCodeStr)
  95 + return;
  96 + var lineArray = t.lineCodeStr.split(',');
  97 + var htmlStr = '';
  98 + $.each(lineArray, function (i, code) {
  99 + if(!code)
  100 + return;
  101 + htmlStr += '<span class="line-item" data-id="'+code+'"><i class="fa fa-remove remove-icon"></i>'+codeNameMap[code]+'</span>';
  102 + });
  103 +
  104 + $('.line-list', wrap).html(htmlStr);
  105 +
  106 + $('select[name=pattern]', wrap).val(t.pattern);
  107 + });
  108 + });
  109 + });
  110 +
  111 + lineSelect.on('change', function () {
  112 + if ($(this).val() == '') {
  113 + addBtn.attr('disabled', 'disabled');
  114 + }
  115 + else {
  116 + addBtn.removeAttr('disabled');
  117 + }
  118 + });
  119 +
  120 + addBtn.on('click', function () {
  121 + var code = lineSelect.val(),
  122 + name = codeNameMap[code];
  123 +
  124 + if($('.line-list .line-item[data-id='+code+']').length > 0){
  125 + alert(name + '已分配,无法重复操作!');
  126 + return;
  127 + }
  128 + $('.line-list', wrap).append('<span class="line-item" data-id="'+code+'"><i class="fa fa-remove remove-icon"></i>'+name+'</span>');
  129 + });
  130 +
  131 + $(wrap).on('click', '.remove-icon', function () {
  132 + $(this).parent().remove();
  133 + });
  134 +
  135 + //保存
  136 + $('#saveBtn', wrap).on('click', function () {
  137 + var data = $('form', wrap).serializeJSON();
  138 + var lineCodeStr = '';
  139 + $('.line-list .line-item', wrap).each(function () {
  140 + lineCodeStr += ($(this).data('id') + ',');
  141 + });
  142 +
  143 + data.lineCodeStr = lineCodeStr;
  144 +
  145 + if(!userId){
  146 + alert('无法获取到用户ID');
  147 + return;
  148 + }
  149 +
  150 + data.userId = userId;
  151 +
  152 + $.post('/realControAuthority', data, function (rs) {
  153 + alert('保存成功!');
  154 + });
  155 + });
  156 + }();
  157 + </script>
  158 +</div>
0 159 \ No newline at end of file
... ...
src/main/resources/static/pages/permission/user/list.html
... ... @@ -21,29 +21,7 @@
21 21 </div>
22 22 <div class="actions">
23 23 <a class="btn btn-circle blue" href="add.html" data-pjax><i class="fa fa-plus"></i> 添加用户</a>
24   - <!-- <button type="button" class="btn btn-circle red" disabled="disabled" id="removeButton"><i class="fa fa-trash"></i> 删除用户</button> -->
25   - <div class="btn-group">
26   - <a class="btn red btn-outline btn-circle" href="javascript:;"
27   - data-toggle="dropdown"> <i class="fa fa-share"></i> <span
28   - class="hidden-xs"> 系统工具 </span> <i class="fa fa-angle-down"></i>
29   - </a>
30   - <ul class="dropdown-menu pull-right" id="datatable_ajax_tools">
31   - <li><a href="javascript:;" data-action="0"
32   - class="tool-action"> <i class="fa fa-print"></i> 打印
33   - </a></li>
34   - <li><a href="javascript:;" data-action="1"
35   - class="tool-action"> <i class="fa fa-copy"></i> 复制
36   - </a></li>
37   - <li><a href="javascript:;" data-action="3"
38   - class="tool-action"> <i class="fa fa-file-excel-o"></i>
39   - 导出Excel
40   - </a></li>
41   - <li class="divider"></li>
42   - <li><a href="javascript:;" data-action="5"
43   - class="tool-action"> <i class="fa fa-refresh"></i> 刷新数据
44   - </a></li>
45   - </ul>
46   - </div>
  24 +
47 25 </div>
48 26 </div>
49 27 <div class="portlet-body">
... ... @@ -134,6 +112,7 @@
134 112 </td>
135 113 <td>
136 114 <a class="btn btn-sm blue btn-outline" href="edit.html?no={{obj.id}}" data-pjax><i class="fa fa-edit"></i> 编辑</a>
  115 + <button type="button" class="btn btn-sm line_allot_btn" data-id="{{obj.id}}">线调线路分配</button>
137 116 </td>
138 117 </tr>
139 118 {{/each}}
... ... @@ -150,7 +129,7 @@ $(function(){
150 129 var icheckOptions = {
151 130 checkboxClass: 'icheckbox_flat-blue',
152 131 increaseArea: '20%'
153   - }
  132 + };
154 133  
155 134 jsDoQuery(null,true);
156 135  
... ... @@ -204,6 +183,8 @@ $(function(){
204 183 showPagination(data);
205 184 }
206 185 layer.close(i);
  186 +
  187 + $('.line_allot_btn').on('click', openAllotWindow);
207 188 });
208 189 }
209 190  
... ... @@ -244,6 +225,22 @@ $(function(){
244 225 });
245 226 }
246 227  
  228 + function openAllotWindow() {
  229 + var id = $(this).data('id');
  230 + $.get('/pages/permission/user/controlAllot.html', function (content) {
  231 + layer.open({
  232 + type: 1,
  233 + area: ['600px', '395px'],
  234 + content: content,
  235 + title: '线路调度权限分配',
  236 + shift: 5,
  237 + scrollbar: false,
  238 + success: function () {
  239 + $('#pageRealControlAllotWrap').trigger('init', id);
  240 + }
  241 + });
  242 + });
  243 + }
247 244  
248 245 //删除
249 246 $('#removeButton').on('click', function(){
... ... @@ -259,7 +256,6 @@ $(function(){
259 256 });
260 257 //改变状态
261 258 function changeEnabled(id,enabled){
262   - debugger
263 259 $get('/user/changeEnabled',{id:id,enabled:enabled},function(result){
264 260 jsDoQuery(null, true);
265 261 })
... ...
src/main/resources/static/pages/scheduleApp/module/common/dts2/ttinfotable/saTimeTable.js
1 1 /**
2 2 * saTimeTable指令,时刻表显示指令,excel表格形式,支持菜单,事件处理。
3 3 * name(必须),控件的名字
  4 + * celldbclickFn,单元格双击事件
4 5 * ds,外部数据源
5 6 *
6 7 * TODO:优化开发中
7 8 *
8 9 */
9   -angular.module('ScheduleApp').directive('saTimetable', ['$compile',
10   - function($compile) {
  10 +angular.module('ScheduleApp').directive('saTimetable', ['$compile', '$window',
  11 + function($compile, $window) {
11 12 return {
12 13 restrict: 'E',
13 14 templateUrl: '/pages/scheduleApp/module/common/dts2/ttinfotable/saTimeTableTemplate.html',
14 15 scope: { // 独立作用域
15 16 // 注意:数据暂时从外部ngModel里获取,以后内部自己处理
16   - ds: "=ngModel"
  17 + ds: "=ngModel",
  18 + celldbclickFn: "&celldbclick"
17 19  
18 20 // TODO:
19 21  
... ... @@ -39,10 +41,19 @@ angular.module(&#39;ScheduleApp&#39;).directive(&#39;saTimetable&#39;, [&#39;$compile&#39;,
39 41 if (!$attr_name) {
40 42 throw new Error("saTimeTable指令 name属性required");
41 43 }
  44 + var $attr_celldbclick = tAttrs["celldbclick"]; // 单元格双击事件名
42 45  
43 46 // 内部controlAs名字
44 47 var ctrlAs = '$saTimeTableCtrl';
45 48  
  49 + // 当前选中的cell
  50 + var startRowIndex = undefined;
  51 + var startColIndex = undefined;
  52 + var shiftKey = false; // shift键是否被按住
  53 + var ctrlKey = false; // ctrl是否被按住
  54 + // shift选中的cell
  55 + var shiftCells = [];
  56 +
46 57 // TODO:
47 58  
48 59 return {
... ... @@ -57,11 +68,20 @@ angular.module(&#39;ScheduleApp&#39;).directive(&#39;saTimetable&#39;, [&#39;$compile&#39;,
57 68  
58 69 // ------------------- dom事件处理function -----------------//
59 70 scope[ctrlAs].$$cell_click = function(rowindex, colindex, cell) {
60   - if (cell.ttdid) {
61   - //alert(rowindex + "-" + colindex);
  71 + console.log("click " + "row=" + rowindex + ",col=" + colindex);
  72 +
  73 + if (cell.ttdid) { // 是班次的单元格才能操作
62 74 cell.sel = !cell.sel;
63 75 }
64   - // TODO:
  76 +
  77 + };
  78 + scope[ctrlAs].$$cell_dbclick = function(rowindex, colindex, cell) {
  79 + if (cell.ttdid) { // 是班次的单元格才能操作
  80 + if ($attr_celldbclick) {
  81 + // 注意调用方法
  82 + scope[ctrlAs].celldbclickFn()(rowindex, colindex);
  83 + }
  84 + }
65 85 };
66 86  
67 87 // ------------------- 监控function ------------------//
... ...
src/main/resources/static/pages/scheduleApp/module/common/dts2/ttinfotable/saTimeTableTemplate.html
... ... @@ -301,6 +301,7 @@
301 301 <dd ng-repeat="cell in info track by $index"
302 302 ng-init="colIndex = $index"
303 303 ng-click="$saTimeTableCtrl.$$cell_click(rowIndex, colIndex, cell)"
  304 + ng-dblclick="$saTimeTableCtrl.$$cell_dbclick(rowIndex, colIndex, cell)"
304 305 ng-class="{lpName: !cell.ttdid, active: cell.sel}"
305 306 >
306 307 {{cell.fcsj}}
... ...
src/main/resources/static/pages/scheduleApp/module/common/prj-common-directive.js
... ... @@ -3662,19 +3662,21 @@ angular.module(&#39;ScheduleApp&#39;).directive(&#39;saBcgroup&#39;, [
3662 3662 /**
3663 3663 * saTimeTable指令,时刻表显示指令,excel表格形式,支持菜单,事件处理。
3664 3664 * name(必须),控件的名字
  3665 + * celldbclickFn,单元格双击事件
3665 3666 * ds,外部数据源
3666 3667 *
3667 3668 * TODO:优化开发中
3668 3669 *
3669 3670 */
3670   -angular.module('ScheduleApp').directive('saTimetable', ['$compile',
3671   - function($compile) {
  3671 +angular.module('ScheduleApp').directive('saTimetable', ['$compile', '$window',
  3672 + function($compile, $window) {
3672 3673 return {
3673 3674 restrict: 'E',
3674 3675 templateUrl: '/pages/scheduleApp/module/common/dts2/ttinfotable/saTimeTableTemplate.html',
3675 3676 scope: { // 独立作用域
3676 3677 // 注意:数据暂时从外部ngModel里获取,以后内部自己处理
3677   - ds: "=ngModel"
  3678 + ds: "=ngModel",
  3679 + celldbclickFn: "&celldbclick"
3678 3680  
3679 3681 // TODO:
3680 3682  
... ... @@ -3700,10 +3702,19 @@ angular.module(&#39;ScheduleApp&#39;).directive(&#39;saTimetable&#39;, [&#39;$compile&#39;,
3700 3702 if (!$attr_name) {
3701 3703 throw new Error("saTimeTable指令 name属性required");
3702 3704 }
  3705 + var $attr_celldbclick = tAttrs["celldbclick"]; // 单元格双击事件名
3703 3706  
3704 3707 // 内部controlAs名字
3705 3708 var ctrlAs = '$saTimeTableCtrl';
3706 3709  
  3710 + // 当前选中的cell
  3711 + var startRowIndex = undefined;
  3712 + var startColIndex = undefined;
  3713 + var shiftKey = false; // shift键是否被按住
  3714 + var ctrlKey = false; // ctrl是否被按住
  3715 + // shift选中的cell
  3716 + var shiftCells = [];
  3717 +
3707 3718 // TODO:
3708 3719  
3709 3720 return {
... ... @@ -3718,11 +3729,20 @@ angular.module(&#39;ScheduleApp&#39;).directive(&#39;saTimetable&#39;, [&#39;$compile&#39;,
3718 3729  
3719 3730 // ------------------- dom事件处理function -----------------//
3720 3731 scope[ctrlAs].$$cell_click = function(rowindex, colindex, cell) {
3721   - if (cell.ttdid) {
3722   - //alert(rowindex + "-" + colindex);
  3732 + console.log("click " + "row=" + rowindex + ",col=" + colindex);
  3733 +
  3734 + if (cell.ttdid) { // 是班次的单元格才能操作
3723 3735 cell.sel = !cell.sel;
3724 3736 }
3725   - // TODO:
  3737 +
  3738 + };
  3739 + scope[ctrlAs].$$cell_dbclick = function(rowindex, colindex, cell) {
  3740 + if (cell.ttdid) { // 是班次的单元格才能操作
  3741 + if ($attr_celldbclick) {
  3742 + // 注意调用方法
  3743 + scope[ctrlAs].celldbclickFn()(rowindex, colindex);
  3744 + }
  3745 + }
3726 3746 };
3727 3747  
3728 3748 // ------------------- 监控function ------------------//
... ...
src/main/resources/static/pages/scheduleApp/module/core/ttInfoManage/detailedit/edit3.html
... ... @@ -75,7 +75,7 @@
75 75 <div class="portlet-body">
76 76 <!--<div ng-view></div>-->
77 77 <div style="height: {{ctrl.ttHeight}}px;">
78   - <sa-Timetable name="tt" ng-model="ctrl.editInfo" ng-model-options="{ getterSetter: true }">
  78 + <sa-Timetable name="tt" ng-model="ctrl.editInfo" ng-model-options="{ getterSetter: true }" celldbclick="ctrl.singleEditBcDetail">
79 79  
80 80 </sa-Timetable>
81 81 </div>
... ...
src/main/resources/static/pages/scheduleApp/module/core/ttInfoManage/detailedit/timeTableDetailManage_old.js
... ... @@ -229,35 +229,17 @@ angular.module(&#39;ScheduleApp&#39;).controller(
229 229 /**
230 230 * 单独修改班次明细。
231 231 */
232   - self.singleEditBcDetail = function() {
233   - var id = null;
234   - if (self.editInfo &&
235   - self.editInfo.detailInfos &&
236   - self.editInfo.detailInfos.length > 0) { // 找出第一个被选中的就可以了
237   - for (var i = 0; i < self.editInfo.detailInfos.length; i++) {
238   - for (var j = 0; j < self.editInfo.detailInfos[i].length; j++) {
239   - if (self.editInfo.detailInfos[i][j].sel) {
240   - id = self.editInfo.detailInfos[i][j].ttdid;
241   - break;
242   - }
243   - }
244   - if (id) {
245   - break;
246   - }
  232 + self.singleEditBcDetail = function(r, c) {
  233 + var id = self.editInfo.detailInfos[r][c].ttdid;
  234 + $state.go('ttInfoDetailManage_detail_edit',
  235 + {
  236 + id: id,
  237 + xlid: self.xlid,
  238 + ttid: self.ttid,
  239 + xlname: self.xlname,
  240 + ttname: self.ttname
247 241 }
248   - }
249   - if (!id) {
250   - alert("请选择具体班次!");
251   - } else {
252   - $state.go('ttInfoDetailManage_detail_edit',
253   - {
254   - id: id,
255   - xlid: self.xlid,
256   - ttid: self.ttid,
257   - xlname: self.xlname,
258   - ttname: self.ttname
259   - });
260   - }
  242 + );
261 243 };
262 244  
263 245 // 批量修改
... ...
src/main/resources/static/real_control_v2/assets/imgs/icon/minus.png 0 → 100644

119 Bytes

src/main/resources/static/real_control_v2/assets/imgs/icon/remove.png 0 → 100644

269 Bytes

src/main/resources/static/real_control_v2/assets/plugins/uikit-2.27.1/components/sortable.gradient.min.css 0 → 100644
  1 +/*! UIkit 2.27.1 | http://www.getuikit.com | (c) 2014 YOOtheme | MIT License */
  2 +.uk-sortable{position:relative}.uk-sortable>*{touch-action:none}.uk-sortable a,.uk-sortable img{-webkit-touch-callout:none}.uk-sortable>:last-child{margin-bottom:0}.uk-sortable-dragged{position:absolute;z-index:1050;pointer-events:none}.uk-sortable-placeholder{opacity:0}.uk-sortable-empty{min-height:30px}.uk-sortable-handle{touch-action:none}.uk-sortable-handle:hover{cursor:move}.uk-sortable-moving,.uk-sortable-moving *{cursor:move}.uk-sortable-moving iframe{pointer-events:none}
0 3 \ No newline at end of file
... ...
src/main/resources/static/real_control_v2/assets/plugins/uikit-2.27.1/components/sortable.min.js 0 → 100644
  1 +/*! UIkit 2.27.1 | http://www.getuikit.com | (c) 2014 YOOtheme | MIT License */
  2 +!function(t){var e;window.UIkit&&(e=t(UIkit)),"function"==typeof define&&define.amd&&define("uikit-sortable",["uikit"],function(){return e||t(UIkit)})}(function(t){"use strict";function e(e){e=t.$(e);do{if(e.data("sortable"))return e;e=t.$(e).parent()}while(e.length);return e}function o(t,e){var o=t.parentNode;if(e.parentNode!=o)return!1;for(var n=t.previousSibling;n&&9!==n.nodeType;){if(n===e)return!0;n=n.previousSibling}return!1}function n(t,e){var o=e;if(o==t)return null;for(;o;){if(o.parentNode===t)return o;if(o=o.parentNode,!o||!o.ownerDocument||11===o.nodeType)break}return null}function s(t){t.stopPropagation&&t.stopPropagation(),t.preventDefault&&t.preventDefault(),t.returnValue=!1}var a,r,i,l,d,h,u,p,c,g,f,m="ontouchstart"in window||"MSGesture"in window||window.DocumentTouch&&document instanceof DocumentTouch,v=m?"MSGesture"in window?"pointerdown":"touchstart":"mousedown",b=m?"MSGesture"in window?"pointermove":"touchmove":"mousemove",C=m?"MSGesture"in window?"pointerup":"touchend":"mouseup";return t.component("sortable",{defaults:{animation:150,threshold:10,childClass:"uk-sortable-item",placeholderClass:"uk-sortable-placeholder",overClass:"uk-sortable-over",draggingClass:"uk-sortable-dragged",dragMovingClass:"uk-sortable-moving",baseClass:"uk-sortable",noDragClass:"uk-sortable-nodrag",emptyClass:"uk-sortable-empty",dragCustomClass:"",handleClass:!1,group:!1,stop:function(){},start:function(){},change:function(){}},boot:function(){t.ready(function(e){t.$("[data-uk-sortable]",e).each(function(){var e=t.$(this);e.data("sortable")||t.sortable(e,t.Utils.options(e.attr("data-uk-sortable")))})}),t.$html.on(b,function(e){if(u){var o=e.originalEvent.targetTouches?e.originalEvent.targetTouches[0]:e;(Math.abs(o.pageX-u.pos.x)>u.threshold||Math.abs(o.pageY-u.pos.y)>u.threshold)&&u.apply(o)}if(a){d||(d=!0,a.show(),a.$current.addClass(a.$sortable.options.placeholderClass),a.$sortable.element.children().addClass(a.$sortable.options.childClass),t.$html.addClass(a.$sortable.options.dragMovingClass));var n=a.data("mouse-offset"),s=e.originalEvent.touches&&e.originalEvent.touches[0]||e.originalEvent,r=parseInt(s.pageX,10)+n.left,i=parseInt(s.pageY,10)+n.top;if(a.css({left:r,top:i}),i+a.height()/3>document.body.offsetHeight)return;i<t.$win.scrollTop()?t.$win.scrollTop(t.$win.scrollTop()-Math.ceil(a.height()/3)):i+a.height()/3>window.innerHeight+t.$win.scrollTop()&&t.$win.scrollTop(t.$win.scrollTop()+Math.ceil(a.height()/3))}}),t.$html.on(C,function(t){if(u=h=!1,!r||!a)return r=a=null,void 0;var o=e(r),n=a.$sortable,s={type:t.type};o[0]&&n.dragDrop(s,n.element),n.dragEnd(s,n.element)})},init:function(){function e(){m&&f.touches&&f.touches.length?h.addEventListener(b,y,!1):(h.addEventListener("mouseover",$,!1),h.addEventListener("mouseout",w,!1))}function o(){m&&f.touches&&f.touches.length?h.removeEventListener(b,y,!1):(h.removeEventListener("mouseover",$,!1),h.removeEventListener("mouseout",w,!1))}function a(t){r&&d.dragMove(t,d)}function l(e){return function(o){var s,a,r;f=o,o&&(s=o.touches&&o.touches[0]||o,a=s.target||o.target,m&&document.elementFromPoint&&(a=document.elementFromPoint(s.pageX-document.body.scrollLeft,s.pageY-document.body.scrollTop)),g=t.$(a)),t.$(a).hasClass("."+d.options.childClass)?e.apply(a,[o]):a!==h&&(r=n(h,a),r&&e.apply(r,[o]))}}var d=this,h=this.element[0];p=[],this.checkEmptyList(),this.element.data("sortable-group",this.options.group?this.options.group:t.Utils.uid("sortable-group"));var u=l(function(e){if(!e.data||!e.data.sortable){var o=t.$(e.target),n=o.is("a[href]")?o:o.parents("a[href]");if(!o.is(":input")){if(d.options.handleClass){var s=o.hasClass(d.options.handleClass)?o:o.closest("."+d.options.handleClass,d.element);if(!s.length)return}return e.preventDefault(),n.length&&n.one("click",function(t){t.preventDefault()}).one(C,function(){c||(n.trigger("click"),m&&n.attr("href").trim()&&(location.href=n.attr("href")))}),e.data=e.data||{},e.data.sortable=h,d.dragStart(e,this)}}}),$=l(t.Utils.debounce(function(t){return d.dragEnter(t,this)}),40),w=l(function(){var e=d.dragenterData(this);d.dragenterData(this,e-1),d.dragenterData(this)||(t.$(this).removeClass(d.options.overClass),d.dragenterData(this,!1))}),y=l(function(t){return r&&r!==this&&i!==this?(d.element.children().removeClass(d.options.overClass),i=this,d.moveElementNextTo(r,this),s(t)):!0});this.addDragHandlers=e,this.removeDragHandlers=o,window.addEventListener(b,a,!1),h.addEventListener(v,u,!1)},dragStart:function(e,o){c=!1,d=!1,l=!1;var n=this,s=t.$(e.target);if(!(!m&&2==e.button||s.is("."+n.options.noDragClass)||s.closest("."+n.options.noDragClass).length||s.is(":input"))){r=o,a&&a.remove();var i=t.$(r),h=i.offset(),p=e.touches&&e.touches[0]||e;u={pos:{x:p.pageX,y:p.pageY},threshold:n.options.handleClass?1:n.options.threshold,apply:function(){a=t.$('<div class="'+[n.options.draggingClass,n.options.dragCustomClass].join(" ")+'"></div>').css({display:"none",top:h.top,left:h.left,width:i.width(),height:i.height(),padding:i.css("padding")}).data({"mouse-offset":{left:h.left-parseInt(p.pageX,10),top:h.top-parseInt(p.pageY,10)},origin:n.element,index:i.index()}).append(i.html()).appendTo("body"),a.$current=i,a.$sortable=n,i.data({"start-list":i.parent(),"start-index":i.index(),"sortable-group":n.options.group}),n.addDragHandlers(),n.options.start(this,r),n.trigger("start.uk.sortable",[n,r,a]),c=!0,u=!1}}}},dragMove:function(e){g=t.$(document.elementFromPoint(e.pageX-(document.body.scrollLeft||document.scrollLeft||0),e.pageY-(document.body.scrollTop||document.documentElement.scrollTop||0)));var o,n=g.closest("."+this.options.baseClass),s=n.data("sortable-group"),a=t.$(r),i=a.parent(),l=a.data("sortable-group");n[0]!==i[0]&&void 0!==l&&s===l&&(n.data("sortable").addDragHandlers(),p.push(n),n.children().addClass(this.options.childClass),n.children().length>0?(o=g.closest("."+this.options.childClass),o.length?o.before(a):n.append(a)):g.append(a),UIkit.$doc.trigger("mouseover")),this.checkEmptyList(),this.checkEmptyList(i)},dragEnter:function(e,o){if(!r||r===o)return!0;var n=this.dragenterData(o);if(this.dragenterData(o,n+1),0===n){var s=t.$(o).parent(),a=t.$(r).data("start-list");if(s[0]!==a[0]){var i=s.data("sortable-group"),l=t.$(r).data("sortable-group");if((i||l)&&i!=l)return!1}t.$(o).addClass(this.options.overClass),this.moveElementNextTo(r,o)}return!1},dragEnd:function(e,o){var n=this;r&&(this.options.stop(o),this.trigger("stop.uk.sortable",[this])),r=null,i=null,p.push(this.element),p.forEach(function(e){t.$(e).children().each(function(){1===this.nodeType&&(t.$(this).removeClass(n.options.overClass).removeClass(n.options.placeholderClass).removeClass(n.options.childClass),n.dragenterData(this,!1))})}),p=[],t.$html.removeClass(this.options.dragMovingClass),this.removeDragHandlers(),a&&(a.remove(),a=null)},dragDrop:function(t){"drop"===t.type&&(t.stopPropagation&&t.stopPropagation(),t.preventDefault&&t.preventDefault()),this.triggerChangeEvents()},triggerChangeEvents:function(){if(r){var e=t.$(r),o=a.data("origin"),n=e.closest("."+this.options.baseClass),s=[],i=t.$(r);o[0]===n[0]&&a.data("index")!=e.index()?s.push({sortable:this,mode:"moved"}):o[0]!=n[0]&&s.push({sortable:t.$(n).data("sortable"),mode:"added"},{sortable:t.$(o).data("sortable"),mode:"removed"}),s.forEach(function(t){t.sortable&&t.sortable.element.trigger("change.uk.sortable",[t.sortable,i,t.mode])})}},dragenterData:function(e,o){return e=t.$(e),1==arguments.length?parseInt(e.data("child-dragenter"),10)||0:(o?e.data("child-dragenter",Math.max(0,o)):e.removeData("child-dragenter"),void 0)},moveElementNextTo:function(e,n){l=!0;var s=this,a=t.$(e).parent().css("min-height",""),r=o(e,n)?n:n.nextSibling,i=a.children(),d=i.length;return s.options.animation?(a.css("min-height",a.height()),i.stop().each(function(){var e=t.$(this),o=e.position();o.width=e.width(),e.data("offset-before",o)}),n.parentNode.insertBefore(e,r),t.Utils.checkDisplay(s.element.parent()),i=a.children().each(function(){var e=t.$(this);e.data("offset-after",e.position())}).each(function(){var e=t.$(this),o=e.data("offset-before");e.css({position:"absolute",top:o.top,left:o.left,"min-width":o.width})}),i.each(function(){var e=t.$(this),o=(e.data("offset-before"),e.data("offset-after"));e.css("pointer-events","none").width(),setTimeout(function(){e.animate({top:o.top,left:o.left},s.options.animation,function(){e.css({position:"",top:"",left:"","min-width":"","pointer-events":""}).removeClass(s.options.overClass).removeData("child-dragenter"),d--,d||(a.css("min-height",""),t.Utils.checkDisplay(s.element.parent()))})},0)}),void 0):(n.parentNode.insertBefore(e,r),t.Utils.checkDisplay(s.element.parent()),void 0)},serialize:function(){var e,o,n=[];return this.element.children().each(function(s,a){e={};for(var r,i,l=0;l<a.attributes.length;l++)o=a.attributes[l],0===o.name.indexOf("data-")&&(r=o.name.substr(5),i=t.Utils.str2json(o.value),e[r]=i||"false"==o.value||"0"==o.value?i:o.value);n.push(e)}),n},checkEmptyList:function(e){e=e?t.$(e):this.element,this.options.emptyClass&&e[e.children().length?"removeClass":"addClass"](this.options.emptyClass)}}),t.sortable});
0 3 \ No newline at end of file
... ...
src/main/resources/static/real_control_v2/css/electron.css 0 → 100644
  1 +/** 在electron 环境下特定的css样式 */
  2 +
  3 +.north{
  4 + height: 160px !important;
  5 +}
  6 +
  7 +.north-toolbar{
  8 + width: 582px !important;
  9 +}
  10 +
  11 +.north>div.uk-grid.uk-grid-match{
  12 + margin-top: 35px;
  13 +}
  14 +
  15 +
  16 +.main-container {
  17 + height: calc(100% - 160px) !important;
  18 +}
  19 +
  20 +.uk-navbar-content .icon-item{
  21 + display: inline-block;
  22 + margin: 6px 3px 7px 0;
  23 + font-size: 16px;
  24 + vertical-align: middle;
  25 + padding: 5px;
  26 + cursor: pointer;
  27 +}
  28 +
  29 +.uk-navbar-content .icon-item:hover{
  30 + box-shadow: 0 4px 7px 0 rgba(0, 0, 0, 0.2), 0 3px 2px 0 rgba(0, 0, 0, 0.19);
  31 +}
  32 +
... ...
src/main/resources/static/real_control_v2/css/home.css
... ... @@ -245,14 +245,14 @@ span.signal-state-outbounds{
245 245 color: #d42727;
246 246 padding: 2px 3px;
247 247 border-radius: 3px;
248   - font-size: 11px;
  248 + font-size: 12px;
249 249 }
250 250  
251 251 span.signal-state-speed-limit{
252 252 color: red;
253 253 padding: 2px 3px;
254 254 border-radius: 3px;
255   - font-size: 11px;
  255 + font-size: 12px;
256 256 }
257 257  
258 258 .home-svg-edit-icon{
... ...
src/main/resources/static/real_control_v2/css/main.css
... ... @@ -711,61 +711,6 @@ li.map-panel {
711 711 width: 33%;
712 712 }
713 713  
714   -/*
715   -#schedule-lp_change-modal .sch-list {
716   - margin-top: 25px;
717   -}
718   -
719   -#schedule-lp_change-modal .sch-list .sch-item dl {
720   - font-size: 0;
721   - border-bottom: 1px solid #e1dbdb;
722   - margin: 7px 0;
723   -}
724   -
725   -#schedule-lp_change-modal .sch-list .sch-item dl dd {
726   - font-size: 14px;
727   - display: inline-block;
728   - line-height: 35px;
729   - text-align: center;
730   - border-right: 1px dashed #e1dbdb;
731   -}
732   -
733   -#schedule-lp_change-modal .sch-list .sch-item dl dd:nth-of-type(1) {
734   - width: 33%;
735   -}
736   -
737   -#schedule-lp_change-modal .sch-list .sch-item dl dd:nth-of-type(2) {
738   - width: 33%;
739   -}
740   -
741   -#schedule-lp_change-modal .sch-list .sch-item dl dd:nth-of-type(3) {
742   - width: 17%;
743   -}
744   -
745   -#schedule-lp_change-modal .sch-list .sch-item dl dd:nth-of-type(4) {
746   - width: 15%;
747   - border-right:0;
748   -}
749   -
750   -
751   -#schedule-lp_change-modal .sch-list .sch-item.reverse dl dd:nth-of-type(1) {
752   - width: 15%;
753   -}
754   -
755   -#schedule-lp_change-modal .sch-list .sch-item.reverse dl dd:nth-of-type(2) {
756   - width: 17%;
757   -}
758   -
759   -#schedule-lp_change-modal .sch-list .sch-item.reverse dl dd:nth-of-type(3) {
760   - width: 33%;
761   -}
762   -
763   -#schedule-lp_change-modal .sch-list .sch-item.reverse dl dd:nth-of-type(4) {
764   - width: 33%;
765   - border-right:0;
766   -}*/
767   -
768   -
769 714 #schedule-lp_change-modal .sch-list dl dd {
770 715 font-size: 14px;
771 716 }
... ... @@ -791,7 +736,6 @@ li.map-panel {
791 736 width: 15%;
792 737 }
793 738  
794   -
795 739 #schedule-lp_change-modal .sch-list.reverse dl dt:nth-of-type(1), #schedule-lp_change-modal .sch-list.reverse dl dd:nth-of-type(1) {
796 740 width: 9%;
797 741 border-left: 1px solid #dedede;
... ... @@ -812,3 +756,32 @@ li.map-panel {
812 756 #schedule-lp_change-modal .sch-list.reverse dl dt:nth-of-type(5), #schedule-lp_change-modal .sch-list.reverse dl dd:nth-of-type(5) {
813 757 width: 30%;
814 758 }
  759 +
  760 +#schedule-lp_change-modal .ct_table.sch-list .ct_table_body dl.active {
  761 + background: #b9d2ff;
  762 +}
  763 +
  764 +#schedule-lp_change-modal .ct_table.sch-list .ct_table_body dl.active dd {
  765 + border-top: 1px solid #b9d2ff;
  766 +}
  767 +
  768 +#schedule-lp_change-modal .ct_table.sch-list dl.active input[type=checkbox] {
  769 + border: none;
  770 +}
  771 +
  772 +#schedule-lp_change-modal .ct_table.sch-list.reverse .ct_table_body dl.active {
  773 + background: #ffe2b9;
  774 +}
  775 +
  776 +#schedule-lp_change-modal .ct_table.sch-list.reverse .ct_table_body dl.active dd {
  777 + border-top: 1px solid #ffe2b9;
  778 +}
  779 +
  780 +#cache_data_manage-modal .uk-table td{
  781 + vertical-align: bottom;
  782 +}
  783 +
  784 +#cache_data_manage-modal .uk-table td,
  785 +#cache_data_manage-modal .uk-table th{
  786 + padding: 8px 8px 6px;
  787 +}
815 788 \ No newline at end of file
... ...
src/main/resources/static/real_control_v2/electron/lineSelect.html 0 → 100644
  1 +<!DOCTYPE html>
  2 +<html lang="zh">
  3 +<head>
  4 + <meta name="renderer" content="webkit"/>
  5 + <meta charset="utf-8"/>
  6 + <title>选择线路</title>
  7 + <link rel="stylesheet" href="/real_control_v2/assets/plugins/uikit-2.27.1/css/uikit.gradient.min.css"/>
  8 + <link rel="stylesheet"
  9 + href="/real_control_v2/assets/plugins/uikit-2.27.1/components/form-advanced.gradient.min.css"/>
  10 +
  11 + <link rel="stylesheet"
  12 + href="/real_control_v2/assets/plugins/uikit-2.27.1/components/sortable.gradient.min.css"/>
  13 +
  14 + <style type="text/css">
  15 +
  16 + ::-webkit-scrollbar {
  17 + width: 16px;
  18 + height: 16px;
  19 + }
  20 +
  21 + ::-webkit-scrollbar-track, ::-webkit-scrollbar-thumb {
  22 + border-radius: 999px;
  23 + border: 5px solid transparent;
  24 + }
  25 +
  26 + ::-webkit-scrollbar-track {
  27 + box-shadow: 1px 1px 5px rgba(0, 0, 0, .2) inset;
  28 + }
  29 +
  30 + ::-webkit-scrollbar-thumb {
  31 + min-height: 20px;
  32 + background-clip: content-box;
  33 + box-shadow: 0 0 0 5px rgba(0, 0, 0, .2) inset;
  34 + }
  35 +
  36 + ::-webkit-scrollbar-corner {
  37 + background: transparent;
  38 + }
  39 +
  40 + input[type="checkbox"] {
  41 + vertical-align: bottom;
  42 + }
  43 +
  44 + .line-btn-list {
  45 + padding: 0 15px 15px 15px;
  46 + height: 180px;
  47 + overflow: auto;
  48 + }
  49 +
  50 + .line-btn-list-selected {
  51 + padding: 0 15px 15px 15px;
  52 + height: 35px;
  53 + overflow: auto;
  54 + }
  55 +
  56 + .line-btn-list span.line-item {
  57 + border: 1px solid #e0dfdf;
  58 + padding: 4px 9px;
  59 + margin: 5px;
  60 + -webkit-user-select: none;
  61 + user-select: none;
  62 + display: inline-block;
  63 + cursor: default;
  64 + transition: all .1s;
  65 + }
  66 +
  67 + .line-btn-list span.line-item.active {
  68 + background: #5E96D2;
  69 + border: 1px solid #5E96D2;
  70 + box-shadow: 0px 3px 4px 0 rgba(111, 172, 237, 0.3), 0px 3px 5px 0 rgba(111, 172, 237, 0.3);
  71 + color: #ffffff;
  72 + }
  73 +
  74 + input.i-cbox[type=checkbox] {
  75 + vertical-align: middle;
  76 + margin-top: -3px;
  77 + }
  78 +
  79 + .line-btn-list span.line-item.active input.i-cbox[type=checkbox] {
  80 + border: 0;
  81 + }
  82 +
  83 + .line-btn-list span.line-item.active input.i-cbox[type=checkbox]:checked:before {
  84 + color: #86f78b;
  85 + }
  86 +
  87 + .uk-panel-title {
  88 + text-indent: 15px;
  89 + }
  90 +
  91 + .line-btn-list-selected span.line-item {
  92 + padding: 4px 9px;
  93 + margin: 2px;
  94 + color: #fff;
  95 + background: #5e96d2;
  96 + box-shadow: 0px 3px 4px 0 rgba(111, 172, 237, 0.3), 0px 3px 5px 0 rgba(111, 172, 237, 0.3);
  97 + user-select: none;
  98 + display: inline-block;
  99 + cursor: move;
  100 + border-radius: 5px;
  101 + }
  102 +
  103 + #lineSearchInput {
  104 + width: 300px;
  105 + box-shadow: 0px 3px 4px 0 rgba(217, 226, 235, 0.3), 0px 3px 5px 0 rgba(200, 217, 236, 0.3);
  106 + height: 35px;
  107 + }
  108 +
  109 + #submitBtn{
  110 + border-radius: 0;
  111 + border-color: #00aff2;
  112 + transition: all .3s;
  113 + }
  114 +
  115 + #submitBtn:disabled{
  116 + border-color: #ebe9e9;
  117 + }
  118 + </style>
  119 +</head>
  120 +
  121 +<body>
  122 +<div class="wrapper ng-scope">
  123 + <div class="dialog dialog-shadow">
  124 + <form class="uk-form" style="width: 100%;">
  125 + <div class="uk-grid">
  126 +
  127 + <div class="uk-width-medium-1-1">
  128 + <div class="uk-panel uk-panel-divider">
  129 + <div class="uk-form-row">
  130 + <div class="uk-form-icon" style="margin: 15px;">
  131 + <i class="uk-icon-search"></i>
  132 + <input type="text" placeholder="搜索线路..." id="lineSearchInput">
  133 + </div>
  134 + </div>
  135 + <h3 class="uk-panel-title">待选择的线路</h3>
  136 + <div class="line-btn-list">
  137 + </div>
  138 + </div>
  139 + <div class="uk-panel uk-panel-divider">
  140 + <h3 class="uk-panel-title">已选择的线路</h3>
  141 + <div class="line-btn-list-selected uk-sortable" data-uk-sortable data-uk-observe>
  142 + </div>
  143 + <button disabled class="uk-button uk-button-primary uk-button-large uk-width-1-1" type="button" id="submitBtn">确定
  144 + </button>
  145 + </div>
  146 + </div>
  147 +
  148 + </div>
  149 + </form>
  150 +
  151 + </div>
  152 +</div>
  153 +
  154 +<script>
  155 + delete window.exports;
  156 + delete window.module;
  157 +</script>
  158 +<!-- jQuery -->
  159 +<script src="/metronic_v4.5.4/plugins/jquery.min.js"></script>
  160 +<script src="/real_control_v2/assets/plugins/uikit-2.27.1/uikit.min.js"></script>
  161 +<script src="/real_control_v2/assets/plugins/uikit-2.27.1/components/sortable.min.js"></script>
  162 +<script src="/assets/plugins/pinyin.js"></script>
  163 +<script src="/real_control_v2/js/common.js"></script>
  164 +
  165 +<!-- EventProxy -->
  166 +<script src="/assets/js/eventproxy.js"></script>
  167 +<script>
  168 + if (typeof(process) == 'undefined' || !process) {
  169 + alert('不支持当前环境!!');
  170 + }
  171 +
  172 + const ipcMain = require('electron').ipcRenderer
  173 +
  174 + !function () {
  175 + var all = {};
  176 + //线路编码映射
  177 + var lineIdMap = {};
  178 + var storage = window.localStorage;
  179 +
  180 + var auth;
  181 + gb_common.$get('/line/all', {destroy_eq: 0}, function (list) {
  182 +
  183 + //用户分配的线路
  184 + $.get('/realControAuthority/findByCurrentUser', function (t) {
  185 + auth = t;
  186 + var newArray = [], authArray = t.lineCodeStr.split(',');
  187 +
  188 + $.each(list, function () {
  189 + if (this.lineCode && authArray.indexOf(this.lineCode) != -1) {
  190 + newArray.push(this);
  191 + }
  192 + });
  193 +
  194 + var htmlStr = '';
  195 + $.each(newArray, function () {
  196 + htmlStr += '<span class="line-item" data-name="' + this.name + '" data-code="' + this.lineCode + '">' +
  197 + ' <input class="i-cbox" type="checkbox"> ' + this.name +
  198 + '</span>';
  199 +
  200 + //拼音首字母
  201 + this.camelChars = pinyin.getCamelChars(this.name);
  202 + //全拼
  203 + this.fullChars = pinyin.getFullChars(this.name).toUpperCase();
  204 +
  205 + lineIdMap[this.lineCode] = this;
  206 + });
  207 + all = list;
  208 +
  209 + $('.line-btn-list').html(htmlStr);
  210 +
  211 + $('.line-btn-list .line-item').on('click', function () {
  212 + var box = $(this).find('input[type=checkbox]')[0];
  213 + if ($(this).hasClass('active')) {
  214 + $(this).removeClass('active');
  215 + box.checked = false;
  216 +
  217 + removeSelected(this);
  218 + }
  219 + else {
  220 + $(this).addClass('active');
  221 + box.checked = true;
  222 +
  223 + addSelected(this);
  224 + }
  225 + });
  226 + });
  227 + });
  228 +
  229 +
  230 + $('#lineSearchInput').on('input', function () {
  231 + var t = $(this).val().toUpperCase();
  232 + if (!t) {
  233 + $('.line-btn-list .line-item').show();
  234 + return;
  235 + }
  236 +
  237 + var rs = [];
  238 + $.each(all, function () {
  239 + if (this.camelChars.indexOf(t) != -1
  240 + || this.fullChars.indexOf(t) != -1
  241 + || this.name.indexOf(t) != -1) {
  242 + rs.push(this.lineCode);
  243 + }
  244 + });
  245 +
  246 + $('.line-btn-list .line-item').hide().each(function () {
  247 + var code = $(this).data('code') + '';
  248 + if (rs.indexOf(code) != -1)
  249 + $(this).show();
  250 + });
  251 + });
  252 +
  253 + function addSelected(that) {
  254 + $('.line-btn-list-selected').append('<span class="line-item" data-code="' + $(that).data('code') + '">' + $(that).data('name') + '</span>');
  255 +
  256 + $('#submitBtn').removeAttr('disabled');
  257 + }
  258 +
  259 + function removeSelected(that) {
  260 + var code = $(that).data('code');
  261 + $('.line-btn-list-selected .line-item[data-code='+code+']').remove();
  262 +
  263 + if($('.line-btn-list-selected .line-item').length == 0){
  264 + $('#submitBtn').attr('disabled', 'disabled');
  265 + }
  266 + }
  267 +
  268 + function error(rs) {
  269 + return rs.status == 'ERROR' || rs.status == 500;
  270 + }
  271 +
  272 + /**
  273 + * 确定
  274 + */
  275 + $('#submitBtn').on('click', function () {
  276 + var ep = EventProxy.create('car2DeviceId', 'routes', 'checkLineConfig', function () {
  277 + ipcMain.send('webPageGotoControl');
  278 + });
  279 +
  280 + var lsData = [], codeStr='', code;
  281 + $('.line-btn-list-selected .line-item').each(function () {
  282 + code = $(this).data('code');
  283 + lsData.push(lineIdMap[code]);
  284 + codeStr += (code + ',');
  285 + });
  286 + //将选择的线路信息写入localstorage
  287 + storage.setItem('lineControlItems', JSON.stringify(lsData));
  288 +
  289 + //缓存车辆自编号和设备号对照
  290 + $.get('/gps/Car2DeviceId', function (rs) {
  291 + storage.setItem('car2DeviceId', JSON.stringify(rs));
  292 + ep.emitLater('car2DeviceId');
  293 + });
  294 +
  295 + //监控模式还是主调模式
  296 + storage.setItem('operationMode', auth.pattern);
  297 +
  298 + //缓存线路路由
  299 + codeStr = codeStr.substr(0, codeStr.length - 1);
  300 + $.get('/realMap/multiRouteByLine', {codeStr: codeStr}, function (rs) {
  301 + for(var key in rs){
  302 + storage.setItem(key, JSON.stringify(rs[key]));
  303 + }
  304 + ep.emitLater('routes');
  305 + });
  306 +
  307 + //检查线路配置信息
  308 + $.ajax({
  309 + url: '/lineConfig/check',
  310 + traditional: true,
  311 + data: {codeArray: codeStr.split(',')},
  312 + method: 'POST',
  313 + success: function (rs) {
  314 + if (rs.status == 0){
  315 + ep.emitLater('checkLineConfig');
  316 + }
  317 + else if (rs.status == 1){
  318 + initLineConfig(rs.not, function () {
  319 + ep.emitLater('checkLineConfig');
  320 + });
  321 + }
  322 + }
  323 + });
  324 + });
  325 +
  326 +
  327 + function initLineConfig(arr, cb) {
  328 + var i = 0;
  329 + (function () {
  330 + if (i >= arr.length) {
  331 + cb && cb();
  332 + return;
  333 + }
  334 + var f = arguments.callee
  335 + , lineCode = arr[i];
  336 +
  337 + $.post('/lineConfig/init/' + lineCode, function (rs) {
  338 + if (rs == 1) {
  339 + i++;
  340 + f();
  341 + }
  342 + });
  343 + })();
  344 + }
  345 + }();
  346 +</script>
  347 +</body>
  348 +</html>
0 349 \ No newline at end of file
... ...
src/main/resources/static/real_control_v2/electron/login.html 0 → 100644
  1 +<!DOCTYPE html>
  2 +<html lang="zh">
  3 +<head>
  4 + <meta name="renderer" content="webkit"/>
  5 + <meta charset="utf-8"/>
  6 + <title>登录</title>
  7 + <link rel="stylesheet" href="/real_control_v2/assets/plugins/uikit-2.27.1/css/uikit.gradient.min.css"/>
  8 +
  9 + <style type="text/css">
  10 + body {
  11 + overflow: hidden;
  12 + }
  13 +
  14 + hr {
  15 + margin: 20px 0;
  16 + border: 0;
  17 + border-top: 1px solid #eee;
  18 + border-bottom: 0;
  19 + }
  20 +
  21 + .uk-form-icon, input {
  22 + width: 100%;
  23 + }
  24 +
  25 + input {
  26 + height: 48px;
  27 + }
  28 +
  29 + input:focus{
  30 + box-shadow: 0 8px 17px 0 rgba(0, 0, 0, 0.2), 0 6px 20px 0 rgba(0, 0, 0, 0.19);
  31 + }
  32 +
  33 + #loginPanel{
  34 + background: linear-gradient(to bottom, #ffffff, #b5c0c7, #3b4044);
  35 + }
  36 +
  37 + </style>
  38 +</head>
  39 +
  40 +<body>
  41 +<div class="wrapper ng-scope">
  42 + <div id="loginPanel" class="dialog dialog-shadow">
  43 + <div class="uk-grid">
  44 + <div class="uk-width-5-10">
  45 + </div>
  46 + <div class="uk-width-5-10">
  47 + <div class="uk-panel" style="padding: 56px 25px 36px 0;">
  48 + <form class="uk-form">
  49 + <div class="uk-form-row">
  50 + <div class="uk-form-icon">
  51 + <i class="uk-icon-user"></i>
  52 + <input autofocus class="uk-form-large" name="userName" type="text" placeholder="输入用户名">
  53 + </div>
  54 + </div>
  55 +
  56 + <div class="uk-form-row">
  57 + <div class="uk-form-icon">
  58 + <i class="uk-icon-key"></i>
  59 + <input class="uk-form-large" name="password" type="password" placeholder="输入密码">
  60 + </div>
  61 + </div>
  62 +
  63 + <br>
  64 + <br>
  65 + <div class="uk-form-row">
  66 + <button id="loginBtn" class="uk-button uk-button-primary uk-button-large uk-width-1-1"
  67 + >登录
  68 + </button>
  69 + </div>
  70 + </form>
  71 + </div>
  72 + </div>
  73 + </div>
  74 + </div>
  75 +</div>
  76 +
  77 +<script>
  78 + delete window.exports;
  79 + delete window.module;
  80 +</script>
  81 +<!-- jQuery -->
  82 +<script src="/metronic_v4.5.4/plugins/jquery.min.js"></script>
  83 +<script src="/real_control_v2/assets/plugins/uikit-2.27.1/uikit.min.js"></script>
  84 +<script src="/assets/plugins/jsencrypt.min.js"></script>
  85 +<script>
  86 + //if() process
  87 + if(typeof(process)=='undefined' || !process){
  88 + alert('不支持当前环境!!');
  89 + }
  90 +
  91 + const ipcMain = require('electron').ipcRenderer
  92 +
  93 + !function () {
  94 + var form = $('#loginPanel form')
  95 + , nameInput = $('input[name=userName]', form)
  96 + , pwdInput = $('input[name=password]', form);
  97 +
  98 + var keys;
  99 + $('#loginBtn').on('click', function (e) {
  100 + e.stopPropagation();
  101 + try {
  102 + var userName = nameInput.val()
  103 + , pwd = pwdInput.val();
  104 +
  105 + if(!userName || $.trim(userName)==''){
  106 + alert('请输入用户名!!');
  107 + return false;
  108 + }
  109 +
  110 + if(!pwd || $.trim(pwd)==''){
  111 + alert('请输入密码!!');
  112 + return false;
  113 + }
  114 +
  115 + //获取keys
  116 + $.get('/user/login/jCryptionKey?t=' + Math.random(), function (data) {
  117 + keys = data.publickey;
  118 +
  119 + //RSA加密
  120 + var encrypt = new JSEncrypt();
  121 + encrypt.setPublicKey(keys);
  122 + userName = encrypt.encrypt(userName);
  123 + pwd = encrypt.encrypt(pwd);
  124 + //登录
  125 + login(userName, pwd);
  126 + });
  127 + }
  128 + catch (e) {
  129 + console.log(e);
  130 + }
  131 +
  132 + return false;
  133 + });
  134 +
  135 +
  136 + function login(userName, pwd) {
  137 + var params = {
  138 + userName: userName,
  139 + password: pwd
  140 + };
  141 + $.post('/user/login', params
  142 + , function (rs) {
  143 + if (error(rs)) {
  144 + $('#loginBtn').removeAttr('disabled');
  145 + alert(rs.msg);
  146 + }
  147 + else {
  148 + ipcMain.send('webPageLoginSuccess');
  149 + }
  150 + });
  151 + }
  152 +
  153 + function error(rs) {
  154 + return rs.status == 'ERROR' || rs.status == 500;
  155 + }
  156 +
  157 + }();
  158 +</script>
  159 +</body>
  160 +</html>
0 161 \ No newline at end of file
... ...
src/main/resources/static/real_control_v2/fragments/line_schedule/context_menu/lp_change.html
... ... @@ -68,25 +68,25 @@
68 68  
69 69 <script id="schedule-lp_change-list-temp" type="text/html">
70 70 {{if order == 0}}
71   - {{each array as sch i}}
72   - <dl>
73   - <dd><input type="checkbox"></dd>
74   - <dd>{{sch.jGh}}/{{sch.jName}}</dd>
75   - <dd>{{sch.clZbh}}</dd>
76   - <dd>{{sch.lpName}}</dd>
77   - <dd>{{sch.dfsj}}</dd>
78   - </dl>
79   - {{/each}}
  71 + {{each array as sch i}}
  72 + <dl>
  73 + <dd><input type="checkbox"></dd>
  74 + <dd>{{sch.jGh}}/{{sch.jName}}</dd>
  75 + <dd>{{sch.clZbh}}</dd>
  76 + <dd>{{sch.lpName}}</dd>
  77 + <dd>{{sch.dfsj}}</dd>
  78 + </dl>
  79 + {{/each}}
80 80 {{else if order == 1}}
81   - {{each array as sch i}}
82   - <dl>
83   - <dd><input type="checkbox"></dd>
84   - <dd>{{sch.dfsj}}</dd>
85   - <dd>{{sch.lpName}}</dd>
86   - <dd>{{sch.clZbh}}</dd>
87   - <dd>{{sch.jGh}}/{{sch.jName}}</dd>
88   - </dl>
89   - {{/each}}
  81 + {{each array as sch i}}
  82 + <dl>
  83 + <dd><input type="checkbox"></dd>
  84 + <dd>{{sch.dfsj}}</dd>
  85 + <dd>{{sch.lpName}}</dd>
  86 + <dd>{{sch.clZbh}}</dd>
  87 + <dd>{{sch.jGh}}/{{sch.jName}}</dd>
  88 + </dl>
  89 + {{/each}}
90 90 {{/if}}
91 91 </script>
92 92  
... ... @@ -102,15 +102,15 @@
102 102 //线路切换事件
103 103 $('[name=lineSelect]', modal).on('change', function () {
104 104 var order = $(this).data('order')
105   - ,lineCode = $(this).val();
  105 + , lineCode = $(this).val();
106 106  
107 107 var array = gb_common.get_vals(gb_schedule_table.findScheduleByLine(lineCode));
108 108 //按路牌分组
109 109 list[order] = gb_common.groupBy(array, 'lpName');
110 110 //设置路牌下拉框
111   - var lpSelect = $(this).next('select'), ops='';
  111 + var lpSelect = $(this).next('select'), ops = '';
112 112 $.each(gb_common.get_keys(list[order]), function (i, lp) {
113   - ops += '<option value="'+lp+'">'+lp+'</option>';
  113 + ops += '<option value="' + lp + '">' + lp + '</option>';
114 114 });
115 115 lpSelect.html(ops);
116 116 });
... ... @@ -118,7 +118,7 @@
118 118 //路牌切换事件
119 119 $('[name=lpName]', modal).on('change', function () {
120 120 var order = $(this).data('order')
121   - ,lp = $(this).val();
  121 + , lp = $(this).val();
122 122  
123 123 var htmlStr = template('schedule-lp_change-list-temp', {array: list[order][lp], order: order});
124 124 $('.sch-list .ct_table_body', modal).eq(order).html(htmlStr);
... ... @@ -131,7 +131,43 @@
131 131 lineOps += '<option value="' + this.lineCode + '">' + this.name + '</option>';
132 132 });
133 133 $('[name=lineSelect]', modal).html(lineOps);
  134 +
  135 + //左默认线路路牌
  136 + $('[name=lineSelect]:eq(0)', modal).val(sch.xlBm).trigger('change');
  137 + //左默认路牌
  138 + $('[name=lpName]:eq(0)', modal).val(sch.lpName).trigger('change');
134 139 });
  140 +
  141 + //选中事件
  142 + $(modal).on('click', '.sch-list input[type=checkbox]', function (e) {
  143 + e.stopPropagation();
  144 + var dl = $(this).parents('dl');
  145 + if (this.checked)
  146 + activeDl(dl);
  147 + else
  148 + cancelActiveDl(dl);
  149 + });
  150 +
  151 + $(modal).on('click', '.sch-list dl', function (e) {
  152 + e.stopPropagation();
  153 + var cbox = $(this).find('input[type=checkbox]')[0];
  154 + if (!$(this).hasClass('active')) {
  155 + activeDl($(this));
  156 + cbox.checked = true;
  157 + }
  158 + else {
  159 + cancelActiveDl($(this));
  160 + cbox.checked = false;
  161 + }
  162 + });
  163 +
  164 + function activeDl(dl) {
  165 + dl.addClass('active');
  166 + }
  167 +
  168 + function cancelActiveDl(dl) {
  169 + dl.removeClass('active');
  170 + }
135 171 })();
136 172 </script>
137 173 </div>
... ...
src/main/resources/static/real_control_v2/fragments/north/nav/cache_data/list.html 0 → 100644
  1 +<div class="uk-modal" id="cache_data_manage-modal">
  2 + <div class="uk-modal-dialog" style="width: 620px;">
  3 + <a href="" class="uk-modal-close uk-close"></a>
  4 + <h2>缓存数据管理</h2>
  5 +
  6 + <div class="uk-overflow-container">
  7 + <table class="uk-table">
  8 + <caption>对照数据列表</caption>
  9 + <tbody>
  10 + <tr>
  11 + <td><strong>车辆信息</strong></td>
  12 + <td>车辆自编号和设备号对照数据</td>
  13 + <td>
  14 + <div class="uk-button-group" style="margin-top: 2px;">
  15 + <button data-type="nbbm2DeviceId" class="uk-button uk-button-primary show-data"><i class="uk-icon-search"></i> 查看</button>
  16 + <button class="uk-button"><i class="uk-icon-refresh"></i> 刷新数据</button>
  17 + </div>
  18 + </td>
  19 + </tr>
  20 + <tr>
  21 + <td><strong>人员信息</strong></td>
  22 + <td>人员工号和姓名对照数据</td>
  23 + <td>
  24 + <div class="uk-button-group" style="margin-top: 2px;">
  25 + <button data-type="work2Name" class="uk-button uk-button-primary show-data"><i class="uk-icon-search"></i> 查看</button>
  26 + <button class="uk-button"><i class="uk-icon-refresh"></i> 刷新数据</button>
  27 + </div>
  28 + </td>
  29 + </tr>
  30 + </tbody>
  31 + </table>
  32 + </div>
  33 + </div>
  34 +
  35 + <script>
  36 + (function () {
  37 + var modal = '#cache_data_manage-modal';
  38 + $(modal).on('init', function (e, data) {
  39 + e.stopPropagation();
  40 +
  41 +
  42 + });
  43 +
  44 + var showDetailData = {
  45 + nbbm2DeviceId: function () {
  46 + open_modal('/real_control_v2/fragments/north/nav/cache_data/nbbm_deviceid.html', {}, {bgclose: false, modal: false})
  47 + }
  48 + };
  49 +
  50 + $('.show-data', modal).on('click', function () {
  51 + var type = $(this).data('type');
  52 + if(type)
  53 + showDetailData[type]();
  54 + });
  55 + })();
  56 + </script>
  57 +</div>
0 58 \ No newline at end of file
... ...
src/main/resources/static/real_control_v2/fragments/north/nav/cache_data/nbbm_deviceid.html 0 → 100644
  1 +<div class="uk-modal" id="cache_data_nbbm_deviceid-modal">
  2 + <div class="uk-modal-dialog" style="width: 480px;">
  3 + <a href="" class="uk-modal-close uk-close"></a>
  4 + <h3>车辆自编号和设备号对照数据</h3>
  5 + <div>
  6 +
  7 + <table class="uk-table">
  8 + <thead>
  9 + <tr>
  10 + <th>自编号</th>
  11 + <th>设备号</th>
  12 + </tr>
  13 + </thead>
  14 + <tbody>
  15 + <tr>
  16 + <td>W2b-023</td>
  17 + <td>559L0028</td>
  18 + </tr>
  19 + </tbody>
  20 + </table>
  21 +
  22 + </div>
  23 + </div>
  24 +
  25 + <script>
  26 + (function () {
  27 + var modal = '#cache_data_nbbm_deviceid-modal';
  28 +
  29 +
  30 + })();
  31 + </script>
  32 +</div>
0 33 \ No newline at end of file
... ...
src/main/resources/static/real_control_v2/fragments/north/toolbar.html
... ... @@ -63,4 +63,73 @@
63 63 </nav>
64 64 </div>
65 65 </script>
  66 +
  67 + <script id="north-toolbar-electron-temp" type="text/html">
  68 + <div class="uk-margin" id="north_toolbar_panel">
  69 + <nav class="uk-navbar">
  70 + <a class="uk-navbar-brand" >
  71 + <span><i class="uk-icon-user"></i> <span id="north_toolbar_user">{{user.userName}}</span>,在线</span><i class="uk-icon-ellipsis-v"></i>
  72 + </a>
  73 + <ul class="uk-navbar-nav">
  74 + {{each list as obj i}}
  75 + <li class="uk-parent " data-uk-dropdown="{{if obj.columns}}{pos:'top-right'}{{/if}}" aria-haspopup="true" aria-expanded="false">
  76 + <a>{{obj.text}} <i class="uk-icon-caret-down"></i></a>
  77 + {{if obj.children != null}}
  78 + <div class="uk-dropdown uk-dropdown-navbar uk-dropdown-bottom" style="top: 40px; left: 0px;">
  79 + <ul class="uk-nav uk-nav-navbar">
  80 + {{each obj.children as c j}}
  81 + {{if c.header}}
  82 + <li class="uk-nav-header">{{c.text}}</li>
  83 +
  84 + {{else if c.divider}}
  85 + <li class="uk-nav-divider"></li>
  86 + {{else}}
  87 + <li class="event"><a data-event="{{c.event}}">{{c.text}}</a></li>
  88 + {{/if}}
  89 + {{/each}}
  90 + </ul>
  91 + </div>
  92 + {{else if obj.columns}}
  93 + <div class="uk-dropdown {{obj.clazz}}">
  94 + <div class="uk-grid uk-dropdown-grid">
  95 + {{each obj.grid as cls s}}
  96 + <div class="{{obj.cls_class}}">
  97 + <ul class="uk-nav uk-nav-dropdown uk-panel">
  98 + {{each cls as c z}}
  99 + {{if c.header}}
  100 + <li class="uk-nav-header">{{c.text}}</li>
  101 +
  102 + {{else if c.divider}}
  103 + <li class="uk-nav-divider"></li>
  104 + {{else}}
  105 + <li class="event">
  106 + <a data-event="{{c.event}}">
  107 + {{if c.icon != null}}
  108 + <i class="{{c.icon}}"></i>
  109 + {{/if}}
  110 + {{c.text}}</a>
  111 + </li>
  112 + {{/if}}
  113 + {{/each}}
  114 + </ul>
  115 + </div>
  116 + {{/each}}
  117 + </div>
  118 + </div>
  119 + {{/if}}
  120 + </li>
  121 + {{/each}}
  122 + </ul>
  123 + <div class="uk-navbar-content uk-navbar-flip uk-hidden-small">
  124 + <div class="icon-item" id="mnavbarIconBtnMIN" data-uk-tooltip="{pos:'bottom'}" title="最小化">
  125 + <img src="/real_control_v2/assets/imgs/icon/minus.png">
  126 + </div>
  127 + &nbsp;&nbsp;
  128 + <div class="icon-item" id="mnavbarIconBtnCLOSE" data-uk-tooltip="{pos:'bottom'}" title="退出系统">
  129 + <img src="/real_control_v2/assets/imgs/icon/remove.png">
  130 + </div>
  131 + </div>
  132 + </nav>
  133 + </div>
  134 + </script>
66 135 </div>
... ...
src/main/resources/static/real_control_v2/js/common.js
... ... @@ -82,8 +82,7 @@ var gb_common = (function () {
82 82 function successHandle(json, handle) {
83 83 var status = json.status;
84 84 if (status == 407) {
85   - //alert('被注销的登录');
86   - location.href = '/';
  85 + location.href = '/real_control_v2/login.html';
87 86 return;
88 87 }
89 88  
... ...
src/main/resources/static/real_control_v2/js/data/json/north_toolbar.json
... ... @@ -16,6 +16,11 @@
16 16 "id": 1.52,
17 17 "text": "历史班次维护",
18 18 "event": "history_sch_maintain"
  19 + },
  20 + {
  21 + "id": 1.53,
  22 + "text": "缓存数据管理",
  23 + "event": "cache_data_manage"
19 24 }
20 25 ],
21 26 [
... ... @@ -90,6 +95,11 @@
90 95 "text": "系统设置",
91 96 "children": [
92 97 {
  98 + "id": 3.1,
  99 + "text": "线路配置",
  100 + "event": "line_config"
  101 + }
  102 + ,{
93 103 "id": 3.2,
94 104 "text": "TTS",
95 105 "event": "tts_config"
... ...
src/main/resources/static/real_control_v2/js/line_schedule/context_menu.js
... ... @@ -169,8 +169,7 @@ var gb_schedule_context_menu = (function () {
169 169 },
170 170 'sep3': '---------',
171 171 'lp_change': {
172   - name: '路牌对调',
173   - disabled: true
  172 + name: '路牌对调'
174 173 }
175 174 }
176 175 });
... ...
src/main/resources/static/real_control_v2/js/main.js
1   -
2 1 /* main js */
3 2 var gb_main_ep = new EventProxy(),
4 3 res_load_ep = EventProxy.create('load_data_basic', 'load_tab', 'load_home_layout', 'load_home_line_panel', function () {
... ...
src/main/resources/static/real_control_v2/js/north/toolbar.js
... ... @@ -19,8 +19,23 @@ var gb_northToolbar = (function () {
19 19 });
20 20  
21 21 var ep = EventProxy.create("template", "data", "user", function (temp, data, user) {
  22 + var tempId = '#north-toolbar-temp';
  23 +
  24 + //electron环境
  25 + if(isElectron){
  26 + tempId = '#north-toolbar-electron-temp';
  27 + //最小化
  28 + $(document).on('click', '#mnavbarIconBtnMIN', function () {
  29 + ipcMain.send('webPageMainWindowMinimize');
  30 + });
  31 + //关闭
  32 + $(document).on('click', '#mnavbarIconBtnCLOSE', function () {
  33 + ipcMain.send('webPageMainWindowClose');
  34 + });
  35 + }
  36 +
22 37 currentUser = user;
23   - var t = $('#north-toolbar-temp', temp).html()
  38 + var t = $(tempId, temp).html()
24 39 , htmlStr = template.render(t)({list: data, user: currentUser});
25 40 $('.north .north-toolbar').html(htmlStr);
26 41  
... ... @@ -80,6 +95,9 @@ var gb_northToolbar = (function () {
80 95 },
81 96 line_config: function () {
82 97 open_modal('/real_control_v2/fragments/north/nav/line_config/line_config.html', {}, modal_opts);
  98 + },
  99 + cache_data_manage: function () {
  100 + open_modal('/real_control_v2/fragments/north/nav/cache_data/list.html', {}, modal_opts);
83 101 }
84 102 };
85 103  
... ...
src/main/resources/static/real_control_v2/js/utils/svg_chart.js
... ... @@ -45,7 +45,7 @@ var gb_svg_chart = (function () {
45 45 len = data.length;
46 46  
47 47 var w = get_width(wrap),
48   - h = get_height(wrap)
  48 + h = parseInt(get_height(wrap))
49 49 //x scale
50 50 ,
51 51 xScale = d3.scale.linear().range([x_padd, w - x_padd]).domain([0, len - 1]),
... ... @@ -82,7 +82,8 @@ var gb_svg_chart = (function () {
82 82 .classed({
83 83 'line-chart': true
84 84 }).attr('data-code', lineCode)
85   - .attr('onselectstart', 'return false');
  85 + .attr('onselectstart', 'return false')
  86 + .style('height', h);
86 87  
87 88 //add item g
88 89 var items = svg.selectAll('g.item').data(data)
... ...
src/main/resources/static/real_control_v2/main.html
... ... @@ -5,149 +5,179 @@
5 5 <meta charset="UTF-8">
6 6 <title>线路调度 v2.0</title>
7 7 <!-- uikit core style-->
8   - <link rel="stylesheet" href="/real_control_v2/assets/plugins/uikit-2.27.1/css/uikit.gradient.min.css" />
9   - <link rel="stylesheet" href="/real_control_v2/assets/plugins/uikit-2.27.1/components/notify.gradient.min.css" />
10   - <link rel="stylesheet" href="/real_control_v2/assets/plugins/uikit-2.27.1/components/tooltip.gradient.min.css" />
11   - <link rel="stylesheet" href="/real_control_v2/assets/plugins/uikit-2.27.1/components/autocomplete.gradient.min.css" />
12   - <link rel="stylesheet" href="/real_control_v2/assets/plugins/uikit-2.27.1/components/accordion.gradient.min.css" />
  8 + <link rel="stylesheet" href="/real_control_v2/assets/plugins/uikit-2.27.1/css/uikit.gradient.min.css"/>
  9 + <link rel="stylesheet" href="/real_control_v2/assets/plugins/uikit-2.27.1/components/notify.gradient.min.css"/>
  10 + <link rel="stylesheet" href="/real_control_v2/assets/plugins/uikit-2.27.1/components/tooltip.gradient.min.css"/>
  11 + <link rel="stylesheet"
  12 + href="/real_control_v2/assets/plugins/uikit-2.27.1/components/autocomplete.gradient.min.css"/>
  13 + <link rel="stylesheet" href="/real_control_v2/assets/plugins/uikit-2.27.1/components/accordion.gradient.min.css"/>
13 14  
14 15 <!-- main style -->
15   - <link rel="stylesheet" href="/real_control_v2/css/main.css" />
  16 + <link rel="stylesheet" href="/real_control_v2/css/main.css"/>
16 17 <!-- north style -->
17   - <link rel="stylesheet" href="/real_control_v2/css/north.css" />
  18 + <link rel="stylesheet" href="/real_control_v2/css/north.css"/>
18 19 <!-- home style -->
19   - <link rel="stylesheet" href="/real_control_v2/css/home.css" />
  20 + <link rel="stylesheet" href="/real_control_v2/css/home.css"/>
20 21 <!-- line style -->
21   - <link rel="stylesheet" href="/real_control_v2/css/line_schedule.css" />
22   - <link rel="stylesheet" href="/real_control_v2/css/sch_autocomp_result.css" />
  22 + <link rel="stylesheet" href="/real_control_v2/css/line_schedule.css"/>
  23 + <link rel="stylesheet" href="/real_control_v2/css/sch_autocomp_result.css"/>
23 24 <!-- custom table -->
24   - <link rel="stylesheet" href="/real_control_v2/css/ct_table.css" />
  25 + <link rel="stylesheet" href="/real_control_v2/css/ct_table.css"/>
25 26 <!-- jquery contextMenu style -->
26   - <link rel="stylesheet" href="/real_control_v2/assets/css/jquery.contextMenu.min.css" />
  27 + <link rel="stylesheet" href="/real_control_v2/assets/css/jquery.contextMenu.min.css"/>
27 28 <!-- formvalidation style -->
28   - <link rel="stylesheet" href="/real_control_v2/assets/plugins/formvalidation/formValidation.min.css" />
  29 + <link rel="stylesheet" href="/real_control_v2/assets/plugins/formvalidation/formValidation.min.css"/>
29 30 <!-- js tree -->
30   - <link rel="stylesheet" href="/real_control_v2/assets/plugins/jstree/default/style.min.css" />
  31 + <link rel="stylesheet" href="/real_control_v2/assets/plugins/jstree/default/style.min.css"/>
31 32 <!-- tooltip css-->
32   - <link rel="stylesheet" href="/real_control_v2/assets/plugins/qtip/jquery.qtip.min.css" />
  33 + <link rel="stylesheet" href="/real_control_v2/assets/plugins/qtip/jquery.qtip.min.css"/>
33 34  
34   - <link rel="stylesheet" href="/real_control_v2/css/pace.css" />
  35 + <link rel="stylesheet" href="/real_control_v2/css/pace.css"/>
35 36 </head>
36 37  
37 38 <body>
38   - <div class="north uk-width-1-1 uk-panel-box">
39   - <div class="uk-grid uk-grid-match">
40   - <div class="uk-width-4-10">
41   - <div class="uk-panel">
42   - <h2 class="north-logo">
  39 +<div class="north uk-width-1-1 uk-panel-box">
  40 + <div class="uk-grid uk-grid-match">
  41 + <div class="uk-width-4-10">
  42 + <div class="uk-panel">
  43 + <h2 class="north-logo">
43 44 <i class="uk-icon-life-ring"></i> 闵行公交线路调度
44   - </h2>
45   - </div>
46   - </div>
47   - <div class="uk-width-6-10">
48   - <div class="uk-panel uk-width north-toolbar"></div>
  45 + </h2>
49 46 </div>
50 47 </div>
51   - <div class="north-tabs"></div>
  48 + <div class="uk-width-6-10">
  49 + <div class="uk-panel uk-width north-toolbar"></div>
  50 + </div>
52 51 </div>
  52 + <div class="north-tabs"></div>
  53 +</div>
53 54  
54   - <div class="main-container">
55   - <div class="load-panel">
56   - <i class="uk-icon-spinner uk-icon-spin"></i>
57   - 正在加载数据
58   - </div>
  55 +<div class="main-container">
  56 + <div class="load-panel">
  57 + <i class="uk-icon-spinner uk-icon-spin"></i>
  58 + 正在加载数据
59 59 </div>
  60 +</div>
60 61  
61   - <!-- 地图相关 -->
62   - <script src="http://api.map.baidu.com/api?v=2.0&ak=IGGrr4UjwIYzatoCRFKEL8sT" ></script>
63   - <script src="http://api.map.baidu.com/library/TrafficControl/1.4/src/TrafficControl_min.js"></script>
64   - <script src="/assets/js/baidu//MarkerClusterer.js"></script>
65   - <script src="/assets/js/TransGPS.js" ></script>
66   - <!-- 高德 -->
67   - <script src="http://webapi.amap.com/maps?v=1.3&key=16cb1c5043847e09ef9edafdd77befda" ></script>
68   - <!-- jquery -->
69   - <script src="/real_control_v2/assets/js/jquery.min.js"></script>
70   - <!-- jquery actual -->
71   - <script src="/real_control_v2/assets/js/jquery.actual.min.js"></script>
72   - <!-- jquery.serializejson JSON序列化插件 -->
73   - <script src="/assets/plugins/jquery.serializejson.js"></script>
74   - <!-- moment.js 日期处理类库 -->
75   - <script src="/assets/plugins/moment-with-locales.js"></script>
76   - <!-- common js -->
77   - <script src="/real_control_v2/js/common.js"></script>
78   - <!-- art-template 模版引擎 -->
79   - <script src="/assets/plugins/template.js"></script>
80   - <!-- d3 -->
81   - <script src="/assets/js/d3.min.js"></script>
82   - <!-- EventProxy -->
83   - <script src="/assets/js/eventproxy.js"></script>
84   - <!-- uikit core -->
85   - <script src="/real_control_v2/assets/plugins/uikit-2.27.1/uikit.min.js"></script>
86   - <script src="/real_control_v2/assets/plugins/uikit-2.27.1/components/notify.min.js"></script>
87   - <script src="/real_control_v2/assets/plugins/uikit-2.27.1/components/pagination.min.js"></script>
88   - <script src="/real_control_v2/assets/plugins/uikit-2.27.1/components/tooltip.min.js"></script>
89   - <script src="/real_control_v2/assets/plugins/uikit-2.27.1/components/autocomplete.min.js"></script>
90   - <script src="/real_control_v2/assets/plugins/uikit-2.27.1/components/accordion.min.js"></script>
91   - <script src="/real_control_v2/assets/plugins/uikit-2.27.1/components/timepicker.min.js"></script>
92   -
93   - <!-- jquery contextMenu -->
94   - <script src="/real_control_v2/assets/js/jquery.contextMenu.min.js"></script>
95   - <script src="/real_control_v2/assets/js/jquery.ui.position.min.js"></script>
96   - <!-- formvalidation- -->
97   - <script src="/real_control_v2/assets/plugins/formvalidation/formValidation.min.js"></script>
98   - <script src="/real_control_v2/assets/plugins/formvalidation/zh_CN.js"></script>
99   - <script src="/real_control_v2/assets/plugins/formvalidation/uikit.min.js"></script>
100   - <!-- js tree -->
101   - <script src="/real_control_v2/assets/plugins/jstree/jstree.min.js"></script>
102   - <!-- simple pinyin -->
103   - <script src="/assets/plugins/pinyin.js"></script>
104   - <!-- qtip -->
105   - <script src="/real_control_v2/assets/plugins/qtip/jquery.qtip.min.js"></script>
106   -
107   - <!-- main js -->
108   - <script src="/real_control_v2/js/main.js"></script>
109   - <!-- 数据 -->
110   - <script src="/real_control_v2/js/data/data_basic.js"></script>
111   - <script src="/real_control_v2/js/data/data_gps.js"></script>
112   - <script src="/real_control_v2/js/data/gps_abnormal.js"></script>
113   - <!-- 线路模拟图 -->
114   - <script src="/real_control_v2/js/utils/svg_chart.js"></script>
115   - <script src="/real_control_v2/js/utils/svg_data_convert.js"></script>
116   - <script src="/real_control_v2/js/utils/svg_chart_tooltip.js"></script>
117   - <script src="/real_control_v2/js/utils/svg_chart_map.js"></script>
118   -
119   - <!-- custom table js -->
120   - <script src="/real_control_v2/js/utils/ct_table.js"></script>
121   - <!-- north js -->
122   - <script src="/real_control_v2/js/north/toolbar.js"></script>
123   - <script src="/real_control_v2/js/north/tabs.js"></script>
124   - <!-- home js -->
125   - <script src="/real_control_v2/js/home/layout.js"></script>
126   - <script src="/real_control_v2/js/home/line_panel.js"></script>
127   - <script src="/real_control_v2/js/home/context_menu.js"></script>
128   - <!-- line schedule js -->
129   - <script src="/real_control_v2/js/line_schedule/legend.js"></script>
130   - <script src="/real_control_v2/js/line_schedule/layout.js"></script>
131   - <script src="/real_control_v2/js/line_schedule/sch_table.js"></script>
132   - <script src="/real_control_v2/js/line_schedule/context_menu.js"></script>
133   - <script src="/real_control_v2/js/line_schedule/dbclick.js"></script>
134   - <script src="/real_control_v2/js/line_schedule/search.js"></script>
135   -
136   - <!-- 字典相关 -->
137   - <script src="/assets/js/dictionary.js"></script>
138   - <!-- websocket -->
139   - <script src="/assets/js/sockjs.min.js"></script>
140   - <script src="/real_control_v2/js/websocket/sch_websocket.js"></script>
141   - <!-- tts -->
142   - <script src="/real_control_v2/js/utils/tts.js"></script>
143   -
144   - <!-- echart -->
145   - <script src="/real_control_v2/assets/echarts-3/echarts.js"></script>
146   - <!-- Geolib -->
147   - <script src="/real_control_v2/geolib/geolib.js"></script>
148   -
149   - <script src="/real_control_v2/js/signal_state/signal_state.js"></script>
150   - <script src="/real_control_v2/js/utils/dispatch_pattern.js"></script>
  62 +<script>
  63 + delete window.exports;
  64 + delete window.module;
  65 +
  66 + var ipcMain;
  67 + //是否处于electron环境下
  68 + var isElectron = (function () {
  69 + try {
  70 + if (process.versions.electron)
  71 + return true;
  72 + else
  73 + return false;
  74 + }
  75 + catch (e) {
  76 + return false;
  77 + }
  78 + })();
  79 +
  80 + if (isElectron) {
  81 + var link = document.createElement("link");
  82 + link.type = "text/css";
  83 + link.rel = "stylesheet";
  84 + link.href = "/real_control_v2/css/electron.css";
  85 + document.getElementsByTagName("head")[0].appendChild(link);
  86 +
  87 + ipcMain = require('electron').ipcRenderer;
  88 + }
  89 +</script>
  90 +
  91 +<!-- 地图相关 -->
  92 +<script src="http://api.map.baidu.com/api?v=2.0&ak=IGGrr4UjwIYzatoCRFKEL8sT"></script>
  93 +<script src="http://api.map.baidu.com/library/TrafficControl/1.4/src/TrafficControl_min.js"></script>
  94 +<script src="/assets/js/baidu//MarkerClusterer.js"></script>
  95 +<script src="/assets/js/TransGPS.js"></script>
  96 +<!-- 高德 -->
  97 +<script src="http://webapi.amap.com/maps?v=1.3&key=16cb1c5043847e09ef9edafdd77befda"></script>
  98 +<!-- jquery -->
  99 +<script src="/real_control_v2/assets/js/jquery.min.js"></script>
  100 +<!-- jquery actual -->
  101 +<script src="/real_control_v2/assets/js/jquery.actual.min.js"></script>
  102 +<!-- jquery.serializejson JSON序列化插件 -->
  103 +<script src="/assets/plugins/jquery.serializejson.js"></script>
  104 +<!-- moment.js 日期处理类库 -->
  105 +<script src="/assets/plugins/moment-with-locales.js"></script>
  106 +<!-- common js -->
  107 +<script src="/real_control_v2/js/common.js"></script>
  108 +<!-- art-template 模版引擎 -->
  109 +<script src="/assets/plugins/template.js"></script>
  110 +<!-- d3 -->
  111 +<script src="/assets/js/d3.min.js"></script>
  112 +<!-- EventProxy -->
  113 +<script src="/assets/js/eventproxy.js"></script>
  114 +<!-- main js -->
  115 +<script src="/real_control_v2/js/main.js"></script>
  116 +<!-- uikit core -->
  117 +<script src="/real_control_v2/assets/plugins/uikit-2.27.1/uikit.min.js"></script>
  118 +<script src="/real_control_v2/assets/plugins/uikit-2.27.1/components/notify.min.js"></script>
  119 +<script src="/real_control_v2/assets/plugins/uikit-2.27.1/components/pagination.min.js"></script>
  120 +<script src="/real_control_v2/assets/plugins/uikit-2.27.1/components/tooltip.min.js"></script>
  121 +<script src="/real_control_v2/assets/plugins/uikit-2.27.1/components/autocomplete.min.js"></script>
  122 +<script src="/real_control_v2/assets/plugins/uikit-2.27.1/components/accordion.min.js"></script>
  123 +<script src="/real_control_v2/assets/plugins/uikit-2.27.1/components/timepicker.min.js"></script>
  124 +
  125 +<!-- jquery contextMenu -->
  126 +<script src="/real_control_v2/assets/js/jquery.contextMenu.min.js"></script>
  127 +<script src="/real_control_v2/assets/js/jquery.ui.position.min.js"></script>
  128 +<!-- formvalidation- -->
  129 +<script src="/real_control_v2/assets/plugins/formvalidation/formValidation.min.js"></script>
  130 +<script src="/real_control_v2/assets/plugins/formvalidation/zh_CN.js"></script>
  131 +<script src="/real_control_v2/assets/plugins/formvalidation/uikit.min.js"></script>
  132 +<!-- js tree -->
  133 +<script src="/real_control_v2/assets/plugins/jstree/jstree.min.js"></script>
  134 +<!-- simple pinyin -->
  135 +<script src="/assets/plugins/pinyin.js"></script>
  136 +<!-- qtip -->
  137 +<script src="/real_control_v2/assets/plugins/qtip/jquery.qtip.min.js"></script>
  138 +
  139 +<!-- 数据 -->
  140 +<script src="/real_control_v2/js/data/data_basic.js"></script>
  141 +<script src="/real_control_v2/js/data/data_gps.js"></script>
  142 +<script src="/real_control_v2/js/data/gps_abnormal.js"></script>
  143 +<!-- 线路模拟图 -->
  144 +<script src="/real_control_v2/js/utils/svg_chart.js"></script>
  145 +<script src="/real_control_v2/js/utils/svg_data_convert.js"></script>
  146 +<script src="/real_control_v2/js/utils/svg_chart_tooltip.js"></script>
  147 +<script src="/real_control_v2/js/utils/svg_chart_map.js"></script>
  148 +
  149 +<!-- custom table js -->
  150 +<script src="/real_control_v2/js/utils/ct_table.js"></script>
  151 +<!-- north js -->
  152 +<script src="/real_control_v2/js/north/toolbar.js"></script>
  153 +<script src="/real_control_v2/js/north/tabs.js"></script>
  154 +<!-- home js -->
  155 +<script src="/real_control_v2/js/home/layout.js"></script>
  156 +<script src="/real_control_v2/js/home/line_panel.js"></script>
  157 +<script src="/real_control_v2/js/home/context_menu.js"></script>
  158 +<!-- line schedule js -->
  159 +<script src="/real_control_v2/js/line_schedule/legend.js"></script>
  160 +<script src="/real_control_v2/js/line_schedule/layout.js"></script>
  161 +<script src="/real_control_v2/js/line_schedule/sch_table.js"></script>
  162 +<script src="/real_control_v2/js/line_schedule/context_menu.js"></script>
  163 +<script src="/real_control_v2/js/line_schedule/dbclick.js"></script>
  164 +<script src="/real_control_v2/js/line_schedule/search.js"></script>
  165 +
  166 +<!-- 字典相关 -->
  167 +<script src="/assets/js/dictionary.js"></script>
  168 +<!-- websocket -->
  169 +<script src="/assets/js/sockjs.min.js"></script>
  170 +<script src="/real_control_v2/js/websocket/sch_websocket.js"></script>
  171 +<!-- tts -->
  172 +<script src="/real_control_v2/js/utils/tts.js"></script>
  173 +
  174 +<!-- echart -->
  175 +<script src="/real_control_v2/assets/echarts-3/echarts.js"></script>
  176 +<!-- Geolib -->
  177 +<script src="/real_control_v2/geolib/geolib.js"></script>
  178 +
  179 +<script src="/real_control_v2/js/signal_state/signal_state.js"></script>
  180 +<script src="/real_control_v2/js/utils/dispatch_pattern.js"></script>
151 181 </body>
152 182  
153 183 </html>
... ...