Commit 46284d23efa2fbd8bdda35f439687c9a13a2cb2e

Authored by 李强
1 parent d7fda2e7

bsthlq <2519941818@qq.com>

src/main/resources/static/pages/base/timesmodel/gantt.html
@@ -71,6 +71,11 @@ @@ -71,6 +71,11 @@
71 </a> 71 </a>
72 </li> 72 </li>
73 <li> 73 <li>
  74 + <a href="javascript:" class="tool-action editlp">
  75 + <i class="fa fa-pencil"></i>&nbsp;修改路牌
  76 + </a>
  77 + </li>
  78 + <li>
74 <a href="javascript:" class="tool-action addlp"> 79 <a href="javascript:" class="tool-action addlp">
75 <i class="fa fa-plus"></i>&nbsp;添加路牌 80 <i class="fa fa-plus"></i>&nbsp;添加路牌
76 </a> 81 </a>
src/main/resources/static/pages/base/timesmodel/js/base-fun.js
@@ -58,7 +58,7 @@ var BaseFun = function() { @@ -58,7 +58,7 @@ var BaseFun = function() {
58 var array = new Array(); 58 var array = new Array();
59 if(len>0) { 59 if(len>0) {
60 for(var y = 0; y<len; y++) { 60 for(var y = 0; y<len; y++) {
61 - array.push({lp:null,lpNo:y+1,lpName:y+1,lpType:'普通路牌'});//添加一个路牌对象 61 + array.push({lp:null,lpNo:y+1, parent :y+1, lpName:y+1,lpType:'普通路牌'});//添加一个路牌对象
62 }; 62 };
63 } 63 }
64 return array; 64 return array;
@@ -348,8 +348,16 @@ var BaseFun = function() { @@ -348,8 +348,16 @@ var BaseFun = function() {
348 // 遍历班次数. 348 // 遍历班次数.
349 for(var i =0 ; i <jsonArray.length; i++) { 349 for(var i =0 ; i <jsonArray.length; i++) {
350 // 判断当期遍历的班次是否属于当前的路牌. 350 // 判断当期遍历的班次是否属于当前的路牌.
351 - if(jsonArray[i].lpNo == lpNo) 351 + if(jsonArray[i].lpNo == lpNo) {
  352 + jsonArray[i].lpName = bxrclist[x].type + '_' + lpNo ;
352 lpbc.push(jsonArray[i]); 353 lpbc.push(jsonArray[i]);
  354 + }
  355 +
  356 + }
  357 + for(var l = 0 ; l <cara.length;l++ ) {
  358 + if(cara[l].lpNo == lpNo) {
  359 + cara[l].lpName = bxrclist[x].type + '_' + lpNo ;
  360 + }
353 } 361 }
354 // 按照发车序号顺序排序. 362 // 按照发车序号顺序排序.
355 lpbc.sort(function(a,b){return b.fcno-a.fcno}); 363 lpbc.sort(function(a,b){return b.fcno-a.fcno});
@@ -376,8 +384,10 @@ var BaseFun = function() { @@ -376,8 +384,10 @@ var BaseFun = function() {
376 // 遍历班次数. 384 // 遍历班次数.
377 for(var x =0 ; x <jar.length; x++) { 385 for(var x =0 ; x <jar.length; x++) {
378 // 判断当期遍历的班次是否属于当前的路牌. 386 // 判断当期遍历的班次是否属于当前的路牌.
379 - if(jar[x].lpNo == lpNo_) 387 + if(jar[x].lpNo == lpNo_) {
  388 + delete jar[x].fcint;
380 lpbc_.push(jar[x]); 389 lpbc_.push(jar[x]);
  390 + }
381 } 391 }
382 // 按照发车序号顺序排序. 392 // 按照发车序号顺序排序.
383 lpbc_.sort(function(a,b){return a.fcno-b.fcno}); 393 lpbc_.sort(function(a,b){return a.fcno-b.fcno});
@@ -521,7 +531,7 @@ var BaseFun = function() { @@ -521,7 +531,7 @@ var BaseFun = function() {
521 var fcno = 0,dxfno = 0,stas = false; 531 var fcno = 0,dxfno = 0,stas = false;
522 for(var b = 0 ; b < bc.length;b++) { 532 for(var b = 0 ; b < bc.length;b++) {
523 var fxdm = baseF.dirDmToIndex(bc[b].xlDir); 533 var fxdm = baseF.dirDmToIndex(bc[b].xlDir);
524 - var car = {'lp':bc[b].lp, 'lpNo':bc[b].lpNo, 'lpName':bc[b].lpName, 'lpType':bc[b].lpType}; 534 + var car = {'lp':bc[b].lp, 'lpNo':bc[b].lpNo, 'lpName':bc[b].lpName, 'lpType':bc[b].lpType };
525 if(b==0) { 535 if(b==0) {
526 var dqbcfcsj = baseF.getDateTime(bc[b].fcsj); 536 var dqbcfcsj = baseF.getDateTime(bc[b].fcsj);
527 result.push(baseF.getbcObj( 537 result.push(baseF.getbcObj(
src/main/resources/static/pages/base/timesmodel/js/d3.relationshipgraph.js
@@ -245,17 +245,46 @@ $(&#39;.aboutread&#39;).on(&#39;click&#39;,function() { @@ -245,17 +245,46 @@ $(&#39;.aboutread&#39;).on(&#39;click&#39;,function() {
245 layer.closeAll(); 245 layer.closeAll();
246 // 执行选择框关闭函数. 246 // 执行选择框关闭函数.
247 RelationshipGraph.gClose(); 247 RelationshipGraph.gClose();
248 - // 执行均匀发车间隙函数. 248 + // 执行调整班次函数.
249 RelationshipGraph.aboutread(); 249 RelationshipGraph.aboutread();
250 }); 250 });
251 }else { 251 }else {
252 - // 执行均匀发车间隙函数 252 + // 执行调整班次函数
253 RelationshipGraph.aboutread(); 253 RelationshipGraph.aboutread();
254 } 254 }
255 }); 255 });
256 /************************************************************************************************************************************************/ 256 /************************************************************************************************************************************************/
257 257
258 /** 258 /**
  259 + * @description : (TODO) 修改路牌点击事件
  260 + *
  261 + * @status OK.
  262 + ************************************************************************************************************************************************/
  263 +$('.editlp').on('click',function() {
  264 + // 判断选择框是否存在.
  265 + if(RelationshipGraph.getFlagIndex()>0) {
  266 + // 关闭所有提示弹出层.
  267 + layer.closeAll();
  268 + layer.confirm('您正处于【批量班次操作】过程中...是否确定退出当前操作进行【修改路牌】!', {
  269 + btn : [ '确认提示并提交', '取消' ]
  270 + },function () {
  271 + // 关闭所有提示弹出层.
  272 + layer.closeAll();
  273 + // 执行选择框关闭函数.
  274 + RelationshipGraph.gClose();
  275 + // 执行修改路牌函数.
  276 + RelationshipGraph.editlpEvents();
  277 + });
  278 + }else {
  279 + // 执行修改路牌函数
  280 + RelationshipGraph.editlpEvents();
  281 + }
  282 +});
  283 +/************************************************************************************************************************************************/
  284 +
  285 +
  286 +
  287 +/**
259 * @description : (TODO) 监听保存数据事件. 288 * @description : (TODO) 监听保存数据事件.
260 * 289 *
261 * @status OK. 290 * @status OK.
@@ -438,7 +467,7 @@ var createTooltip = function createTooltip(self) { @@ -438,7 +467,7 @@ var createTooltip = function createTooltip(self) {
438 count = keys.length, 467 count = keys.length,
439 rows = []; 468 rows = [];
440 var showKeys = self.configuration.showKeys; 469 var showKeys = self.configuration.showKeys;
441 - var hiddenKeys = ['_PRIVATE_' ,'PARENTCOLOR', 'SETNODECOLOR', 'SETNODESTROKECOLOR','lpNo','lpName','lp','lpType', 470 + var hiddenKeys = ['_PRIVATE_' ,'PARENTCOLOR', 'SETNODECOLOR', 'SETNODESTROKECOLOR','lpNo','parent','lp','lpType',
442 'jhlc','tcc','ttinfo','xl','isfb','qdz','zdz','isSwitchXl','bz','bcs',/*'fcno'*/]; 471 'jhlc','tcc','ttinfo','xl','isfb','qdz','zdz','isSwitchXl','bz','bcs',/*'fcno'*/];
443 while (count--) { 472 while (count--) {
444 var element = keys[count]; 473 var element = keys[count];
@@ -459,7 +488,7 @@ var createTooltip = function createTooltip(self) { @@ -459,7 +488,7 @@ var createTooltip = function createTooltip(self) {
459 changeKey = '停息时间:'; 488 changeKey = '停息时间:';
460 else if(element=='xlDir') 489 else if(element=='xlDir')
461 changeKey = '行驶方向:'; 490 changeKey = '行驶方向:';
462 - else if(element=='parent') 491 + else if(element=='lpName')
463 changeKey = '当前路牌:'; 492 changeKey = '当前路牌:';
464 else if(element=='bcType') 493 else if(element=='bcType')
465 changeKey = '班次类型:'; 494 changeKey = '班次类型:';
@@ -607,7 +636,6 @@ var RelationshipGraph = function () { @@ -607,7 +636,6 @@ var RelationshipGraph = function () {
607 .attr('height', this.configuration.height + this.configuration.heightMargin) 636 .attr('height', this.configuration.height + this.configuration.heightMargin)
608 .attr('style', 'display: block') 637 .attr('style', 'display: block')
609 .append('g').attr("class", "gantt-chart"); 638 .append('g').attr("class", "gantt-chart");
610 -  
611 // 创建时间线性区域 639 // 创建时间线性区域
612 var x = d3.time 640 var x = d3.time
613 .scale() 641 .scale()
@@ -1197,6 +1225,7 @@ var RelationshipGraph = function () { @@ -1197,6 +1225,7 @@ var RelationshipGraph = function () {
1197 $_GlobalGraph.configuration.taskTypes.push({'lp':null,'lpName':len+1,'lpNo':len+1,'lpType':'普通路牌'}); 1225 $_GlobalGraph.configuration.taskTypes.push({'lp':null,'lpName':len+1,'lpNo':len+1,'lpType':'普通路牌'});
1198 // 添加路牌编码 1226 // 添加路牌编码
1199 $_GlobalGraph.configuration.lpNoA.push(len+1); 1227 $_GlobalGraph.configuration.lpNoA.push(len+1);
  1228 + $_GlobalGraph.configuration.lpNameA.push(len+1);
1200 // 修改图形高度 1229 // 修改图形高度
1201 $_GlobalGraph.configuration.height = $_GlobalGraph.configuration.lpNoA.length*60 + 240; 1230 $_GlobalGraph.configuration.height = $_GlobalGraph.configuration.lpNoA.length*60 + 240;
1202 // 修改初始化图形时间轴开始时间 1231 // 修改初始化图形时间轴开始时间
@@ -1374,6 +1403,15 @@ var RelationshipGraph = function () { @@ -1374,6 +1403,15 @@ var RelationshipGraph = function () {
1374 } 1403 }
1375 1404
1376 }, { 1405 }, {
  1406 + key : 'editlpEvents',
  1407 + value : function() {
  1408 + // 弹出层mobal页面
  1409 + $.get('/pages/base/timesmodel/editlp.html', function(m){
  1410 + $(pjaxContainer).append(m);
  1411 + $('#editlp_mobal').trigger('editlpMobal.show',[$_GlobalGraph,BaseFun]);
  1412 + });
  1413 + }
  1414 + }, {
1377 key : 'checkAdd', 1415 key : 'checkAdd',
1378 value : function checkAdd() { 1416 value : function checkAdd() {
1379 var xl = $_GlobalGraph.configuration.dataMap.map.lineName.split('_'); 1417 var xl = $_GlobalGraph.configuration.dataMap.map.lineName.split('_');
@@ -1520,7 +1558,8 @@ var RelationshipGraph = function () { @@ -1520,7 +1558,8 @@ var RelationshipGraph = function () {
1520 * */ 1558 * */
1521 key : 'setYValue', 1559 key : 'setYValue',
1522 value : function setYValue(obj) { 1560 value : function setYValue(obj) {
1523 - return $_GlobalGraph.configuration.y(obj.parent) + $_GlobalGraph.configuration.offsetY; 1561 + /*return $_GlobalGraph.configuration.y(obj.parent) + $_GlobalGraph.configuration.offsetY;*/
  1562 + return $_GlobalGraph.configuration.y(obj.lpName) + $_GlobalGraph.configuration.offsetY;
1524 } 1563 }
1525 }, { 1564 }, {
1526 /** 1565 /**
@@ -1747,7 +1786,8 @@ var RelationshipGraph = function () { @@ -1747,7 +1786,8 @@ var RelationshipGraph = function () {
1747 * */ 1786 * */
1748 key : 'setCirclecyV', 1787 key : 'setCirclecyV',
1749 value : function setCirclecyV(obj) { 1788 value : function setCirclecyV(obj) {
1750 - return $_GlobalGraph.configuration.y(obj.parent) + $_GlobalGraph.configuration.offsetY + 12; 1789 + /*return $_GlobalGraph.configuration.y(obj.parent) + $_GlobalGraph.configuration.offsetY + 12;*/
  1790 + return $_GlobalGraph.configuration.y(obj.lpName) + $_GlobalGraph.configuration.offsetY + 12;
1751 } 1791 }
1752 }, { 1792 }, {
1753 /** 1793 /**
@@ -1902,7 +1942,9 @@ var RelationshipGraph = function () { @@ -1902,7 +1942,9 @@ var RelationshipGraph = function () {
1902 * */ 1942 * */
1903 key : 'setText04YV', 1943 key : 'setText04YV',
1904 value : function setText04YV(obj) { 1944 value : function setText04YV(obj) {
1905 - return $_GlobalGraph.configuration.y(obj.parent) + $_GlobalGraph.configuration.offsetY + 16; 1945 + /*return $_GlobalGraph.configuration.y(obj.parent) + $_GlobalGraph.configuration.offsetY + 16;*/
  1946 + return $_GlobalGraph.configuration.y(obj.lpName) +$_GlobalGraph.configuration.offsetY + 16;
  1947 +
1906 } 1948 }
1907 }, { 1949 }, {
1908 /** 1950 /**
src/main/resources/static/pages/base/timesmodel/js/gantt.js
@@ -378,7 +378,7 @@ @@ -378,7 +378,7 @@
378 ra.push(arr[i].lpNo); 378 ra.push(arr[i].lpNo);
379 name.push(arr[i].lpName); 379 name.push(arr[i].lpName);
380 } 380 }
381 - return {'lpNoA':ra,'lpNameA':name}; 381 + return {'lpNoA':ra,'lpNameA':name,};
382 } 382 }
383 /** 383 /**
384 * @description : (TODO) 获取甘特图参数配置信息. 384 * @description : (TODO) 获取甘特图参数配置信息.