Commit 46284d23efa2fbd8bdda35f439687c9a13a2cb2e
1 parent
d7fda2e7
bsthlq <2519941818@qq.com>
Showing
4 changed files
with
70 additions
and
13 deletions
src/main/resources/static/pages/base/timesmodel/gantt.html
| ... | ... | @@ -71,6 +71,11 @@ |
| 71 | 71 | </a> |
| 72 | 72 | </li> |
| 73 | 73 | <li> |
| 74 | + <a href="javascript:" class="tool-action editlp"> | |
| 75 | + <i class="fa fa-pencil"></i> 修改路牌 | |
| 76 | + </a> | |
| 77 | + </li> | |
| 78 | + <li> | |
| 74 | 79 | <a href="javascript:" class="tool-action addlp"> |
| 75 | 80 | <i class="fa fa-plus"></i> 添加路牌 |
| 76 | 81 | </a> | ... | ... |
src/main/resources/static/pages/base/timesmodel/js/base-fun.js
| ... | ... | @@ -58,7 +58,7 @@ var BaseFun = function() { |
| 58 | 58 | var array = new Array(); |
| 59 | 59 | if(len>0) { |
| 60 | 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 | 64 | return array; |
| ... | ... | @@ -348,8 +348,16 @@ var BaseFun = function() { |
| 348 | 348 | // 遍历班次数. |
| 349 | 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 | 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 | 363 | lpbc.sort(function(a,b){return b.fcno-a.fcno}); |
| ... | ... | @@ -376,8 +384,10 @@ var BaseFun = function() { |
| 376 | 384 | // 遍历班次数. |
| 377 | 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 | 389 | lpbc_.push(jar[x]); |
| 390 | + } | |
| 381 | 391 | } |
| 382 | 392 | // 按照发车序号顺序排序. |
| 383 | 393 | lpbc_.sort(function(a,b){return a.fcno-b.fcno}); |
| ... | ... | @@ -521,7 +531,7 @@ var BaseFun = function() { |
| 521 | 531 | var fcno = 0,dxfno = 0,stas = false; |
| 522 | 532 | for(var b = 0 ; b < bc.length;b++) { |
| 523 | 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 | 535 | if(b==0) { |
| 526 | 536 | var dqbcfcsj = baseF.getDateTime(bc[b].fcsj); |
| 527 | 537 | result.push(baseF.getbcObj( | ... | ... |
src/main/resources/static/pages/base/timesmodel/js/d3.relationshipgraph.js
| ... | ... | @@ -245,17 +245,46 @@ $('.aboutread').on('click',function() { |
| 245 | 245 | layer.closeAll(); |
| 246 | 246 | // 执行选择框关闭函数. |
| 247 | 247 | RelationshipGraph.gClose(); |
| 248 | - // 执行均匀发车间隙函数. | |
| 248 | + // 执行调整班次函数. | |
| 249 | 249 | RelationshipGraph.aboutread(); |
| 250 | 250 | }); |
| 251 | 251 | }else { |
| 252 | - // 执行均匀发车间隙函数 | |
| 252 | + // 执行调整班次函数 | |
| 253 | 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 | 288 | * @description : (TODO) 监听保存数据事件. |
| 260 | 289 | * |
| 261 | 290 | * @status OK. |
| ... | ... | @@ -438,7 +467,7 @@ var createTooltip = function createTooltip(self) { |
| 438 | 467 | count = keys.length, |
| 439 | 468 | rows = []; |
| 440 | 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 | 471 | 'jhlc','tcc','ttinfo','xl','isfb','qdz','zdz','isSwitchXl','bz','bcs',/*'fcno'*/]; |
| 443 | 472 | while (count--) { |
| 444 | 473 | var element = keys[count]; |
| ... | ... | @@ -459,7 +488,7 @@ var createTooltip = function createTooltip(self) { |
| 459 | 488 | changeKey = '停息时间:'; |
| 460 | 489 | else if(element=='xlDir') |
| 461 | 490 | changeKey = '行驶方向:'; |
| 462 | - else if(element=='parent') | |
| 491 | + else if(element=='lpName') | |
| 463 | 492 | changeKey = '当前路牌:'; |
| 464 | 493 | else if(element=='bcType') |
| 465 | 494 | changeKey = '班次类型:'; |
| ... | ... | @@ -607,7 +636,6 @@ var RelationshipGraph = function () { |
| 607 | 636 | .attr('height', this.configuration.height + this.configuration.heightMargin) |
| 608 | 637 | .attr('style', 'display: block') |
| 609 | 638 | .append('g').attr("class", "gantt-chart"); |
| 610 | - | |
| 611 | 639 | // 创建时间线性区域 |
| 612 | 640 | var x = d3.time |
| 613 | 641 | .scale() |
| ... | ... | @@ -1197,6 +1225,7 @@ var RelationshipGraph = function () { |
| 1197 | 1225 | $_GlobalGraph.configuration.taskTypes.push({'lp':null,'lpName':len+1,'lpNo':len+1,'lpType':'普通路牌'}); |
| 1198 | 1226 | // 添加路牌编码 |
| 1199 | 1227 | $_GlobalGraph.configuration.lpNoA.push(len+1); |
| 1228 | + $_GlobalGraph.configuration.lpNameA.push(len+1); | |
| 1200 | 1229 | // 修改图形高度 |
| 1201 | 1230 | $_GlobalGraph.configuration.height = $_GlobalGraph.configuration.lpNoA.length*60 + 240; |
| 1202 | 1231 | // 修改初始化图形时间轴开始时间 |
| ... | ... | @@ -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 | 1415 | key : 'checkAdd', |
| 1378 | 1416 | value : function checkAdd() { |
| 1379 | 1417 | var xl = $_GlobalGraph.configuration.dataMap.map.lineName.split('_'); |
| ... | ... | @@ -1520,7 +1558,8 @@ var RelationshipGraph = function () { |
| 1520 | 1558 | * */ |
| 1521 | 1559 | key : 'setYValue', |
| 1522 | 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 | 1786 | * */ |
| 1748 | 1787 | key : 'setCirclecyV', |
| 1749 | 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 | 1942 | * */ |
| 1903 | 1943 | key : 'setText04YV', |
| 1904 | 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