Commit be363bc7bce8364f6dce55ec58b08132ae01c701
1 parent
ae6c249c
线调v2 bug修复 11.1
Showing
8 changed files
with
46 additions
and
13 deletions
src/main/resources/static/real_control_v2/fragments/line_schedule/context_menu/add_temp_sch.html
| @@ -118,7 +118,7 @@ | @@ -118,7 +118,7 @@ | ||
| 118 | <script> | 118 | <script> |
| 119 | (function() { | 119 | (function() { |
| 120 | var modal = '#schedule-addsch-modal', | 120 | var modal = '#schedule-addsch-modal', |
| 121 | - sch, stationRoutes, parks; | 121 | + sch, stationRoutes, parks, information; |
| 122 | $(modal).on('init', function(e, data) { | 122 | $(modal).on('init', function(e, data) { |
| 123 | sch = data.sch; | 123 | sch = data.sch; |
| 124 | var formHtml = template('schedule-addsch-form-temp', sch); | 124 | var formHtml = template('schedule-addsch-form-temp', sch); |
| @@ -146,6 +146,8 @@ | @@ -146,6 +146,8 @@ | ||
| 146 | $.get('/basic/parks', function(rs){ | 146 | $.get('/basic/parks', function(rs){ |
| 147 | parks=rs; | 147 | parks=rs; |
| 148 | }); | 148 | }); |
| 149 | + //线路标准 | ||
| 150 | + information=gb_data_basic.getLineInformation(sch.xlBm); | ||
| 149 | 151 | ||
| 150 | //submit | 152 | //submit |
| 151 | var f = $('form', modal).formValidation(gb_form_validation_opts); | 153 | var f = $('form', modal).formValidation(gb_form_validation_opts); |
| @@ -194,12 +196,12 @@ | @@ -194,12 +196,12 @@ | ||
| 194 | var qdz=$('[name=qdzCode]', f),zdz=$('[name=zdzCode]', f); | 196 | var qdz=$('[name=qdzCode]', f),zdz=$('[name=zdzCode]', f); |
| 195 | switch (bcType_e.val()) { | 197 | switch (bcType_e.val()) { |
| 196 | case 'out': | 198 | case 'out': |
| 197 | - qdz.html(park_opts); | 199 | + qdz.html(park_opts).val(information.carPark); |
| 198 | zdz.html(opts); | 200 | zdz.html(opts); |
| 199 | break; | 201 | break; |
| 200 | case 'in': | 202 | case 'in': |
| 201 | qdz.html(opts); | 203 | qdz.html(opts); |
| 202 | - zdz.html(park_opts); | 204 | + zdz.html(park_opts).val(information.carPark); |
| 203 | break; | 205 | break; |
| 204 | default: | 206 | default: |
| 205 | qdz.html(opts); | 207 | qdz.html(opts); |
src/main/resources/static/real_control_v2/fragments/line_schedule/context_menu/sub_task/add_sub_task_other.html
| @@ -124,7 +124,7 @@ | @@ -124,7 +124,7 @@ | ||
| 124 | <script> | 124 | <script> |
| 125 | (function() { | 125 | (function() { |
| 126 | var modal = '#add-sub-task-other-modal', | 126 | var modal = '#add-sub-task-other-modal', |
| 127 | - sch, stationRoutes, parks; | 127 | + sch, stationRoutes, parks, information; |
| 128 | var adjustExps = ['配车', '保养', '故障', '肇事', '路阻', '纠纷', '缺人', '客稀', '缺车', '气候', '援外', '吊慢', '抽减', '其他']; | 128 | var adjustExps = ['配车', '保养', '故障', '肇事', '路阻', '纠纷', '缺人', '客稀', '缺车', '气候', '援外', '吊慢', '抽减', '其他']; |
| 129 | $(modal).on('init', function(e, data) { | 129 | $(modal).on('init', function(e, data) { |
| 130 | sch = data.sch; | 130 | sch = data.sch; |
| @@ -153,6 +153,8 @@ | @@ -153,6 +153,8 @@ | ||
| 153 | $.get('/basic/parks', function(rs){ | 153 | $.get('/basic/parks', function(rs){ |
| 154 | parks=rs; | 154 | parks=rs; |
| 155 | }); | 155 | }); |
| 156 | + //线路标准 | ||
| 157 | + information=gb_data_basic.getLineInformation(sch.xlBm); | ||
| 156 | 158 | ||
| 157 | //submit | 159 | //submit |
| 158 | var f = $('form', modal).formValidation(gb_form_validation_opts); | 160 | var f = $('form', modal).formValidation(gb_form_validation_opts); |
| @@ -185,12 +187,12 @@ | @@ -185,12 +187,12 @@ | ||
| 185 | var qdz=$('[name=startStation]', f),zdz=$('[name=endStation]', f); | 187 | var qdz=$('[name=startStation]', f),zdz=$('[name=endStation]', f); |
| 186 | switch ($(this).val()) { | 188 | switch ($(this).val()) { |
| 187 | case '3'://出场 | 189 | case '3'://出场 |
| 188 | - qdz.html(park_opts); | 190 | + qdz.html(park_opts).val(information.carPark); |
| 189 | zdz.html(opts); | 191 | zdz.html(opts); |
| 190 | break; | 192 | break; |
| 191 | case '2'://进场 | 193 | case '2'://进场 |
| 192 | qdz.html(opts); | 194 | qdz.html(opts); |
| 193 | - zdz.html(park_opts); | 195 | + zdz.html(park_opts).val(information.carPark); |
| 194 | break; | 196 | break; |
| 195 | default: | 197 | default: |
| 196 | qdz.html(opts); | 198 | qdz.html(opts); |
src/main/resources/static/real_control_v2/fragments/line_schedule/sch_table.html
| 1 | <div> | 1 | <div> |
| 2 | <script id="line-schedule-table-temp" type="text/html"> | 2 | <script id="line-schedule-table-temp" type="text/html"> |
| 3 | <div class="schedule-wrap {{if dir==0}}up{{else}}down{{/if}}"> | 3 | <div class="schedule-wrap {{if dir==0}}up{{else}}down{{/if}}"> |
| 4 | - <h3 class="header-title">上行/江月路地铁站</h3> | 4 | + <h3 class="header-title"> |
| 5 | + {{if dir==0}} | ||
| 6 | + 上行/{{line.startStationName}} | ||
| 7 | + {{else}} | ||
| 8 | + 下行/{{line.endStationName}} | ||
| 9 | + {{/if}} | ||
| 10 | + </h3> | ||
| 5 | <div class="schedule-body"> | 11 | <div class="schedule-body"> |
| 6 | <div class="ct_table_wrap"> | 12 | <div class="ct_table_wrap"> |
| 7 | <div class="ct_table line-schedule-table"> | 13 | <div class="ct_table line-schedule-table"> |
src/main/resources/static/real_control_v2/fragments/north/toolbar.html
| @@ -3,7 +3,7 @@ | @@ -3,7 +3,7 @@ | ||
| 3 | <div class="uk-margin" id="north_toolbar_panel"> | 3 | <div class="uk-margin" id="north_toolbar_panel"> |
| 4 | <nav class="uk-navbar"> | 4 | <nav class="uk-navbar"> |
| 5 | <a class="uk-navbar-brand" > | 5 | <a class="uk-navbar-brand" > |
| 6 | - <span><i class="uk-icon-user"></i> admin3,在线</span><i class="uk-icon-ellipsis-v"></i> | 6 | + <span><i class="uk-icon-user"></i> <span id="north_toolbar_user">{{user.userName}}</span>,在线</span><i class="uk-icon-ellipsis-v"></i> |
| 7 | </a> | 7 | </a> |
| 8 | <ul class="uk-navbar-nav"> | 8 | <ul class="uk-navbar-nav"> |
| 9 | {{each list as obj i}} | 9 | {{each list as obj i}} |
src/main/resources/static/real_control_v2/js/data/data_basic.js
| @@ -2,10 +2,11 @@ | @@ -2,10 +2,11 @@ | ||
| 2 | 2 | ||
| 3 | var gb_data_basic = (function() { | 3 | var gb_data_basic = (function() { |
| 4 | 4 | ||
| 5 | - var stationRoutes,lineCode2NameAll; | ||
| 6 | - var ep = EventProxy.create("stationRoutes", "lineCode2Name", function(routes, code2Name) { | 5 | + var stationRoutes,lineCode2NameAll,lineInformations; |
| 6 | + var ep = EventProxy.create("stationRoutes", "lineCode2Name", "lineInformations", function(routes, code2Name, informations) { | ||
| 7 | stationRoutes = routes; | 7 | stationRoutes = routes; |
| 8 | lineCode2NameAll = code2Name; | 8 | lineCode2NameAll = code2Name; |
| 9 | + lineInformations = informations; | ||
| 9 | gb_main_ep.emitLater('data-basic'); | 10 | gb_main_ep.emitLater('data-basic'); |
| 10 | }); | 11 | }); |
| 11 | 12 | ||
| @@ -30,6 +31,16 @@ var gb_data_basic = (function() { | @@ -30,6 +31,16 @@ var gb_data_basic = (function() { | ||
| 30 | ep.emit('stationRoutes', gb_common.groupBy(list, 'lineCode')); | 31 | ep.emit('stationRoutes', gb_common.groupBy(list, 'lineCode')); |
| 31 | }); | 32 | }); |
| 32 | 33 | ||
| 34 | + //线路标准信息 | ||
| 35 | + gb_common.$get('/lineInformation/line/multi', {lineCodes: line_idx}, function(rs){ | ||
| 36 | + var informations={}; | ||
| 37 | + $.each(rs, function(){ | ||
| 38 | + informations[this.line.lineCode] = this; | ||
| 39 | + delete this['line']; | ||
| 40 | + }); | ||
| 41 | + ep.emit('lineInformations', informations); | ||
| 42 | + }); | ||
| 43 | + | ||
| 33 | //line code to name | 44 | //line code to name |
| 34 | $.get('/basic/lineCode2Name', function(rs){ | 45 | $.get('/basic/lineCode2Name', function(rs){ |
| 35 | ep.emit('lineCode2Name', rs); | 46 | ep.emit('lineCode2Name', rs); |
| @@ -52,6 +63,9 @@ var gb_data_basic = (function() { | @@ -52,6 +63,9 @@ var gb_data_basic = (function() { | ||
| 52 | return null; | 63 | return null; |
| 53 | } | 64 | } |
| 54 | 65 | ||
| 66 | + var getLineInformation=function(lineCode){ | ||
| 67 | + return lineInformations[lineCode]; | ||
| 68 | + } | ||
| 55 | //文件载入完毕 | 69 | //文件载入完毕 |
| 56 | res_load_ep.emitLater('load_data_basic'); | 70 | res_load_ep.emitLater('load_data_basic'); |
| 57 | 71 | ||
| @@ -59,6 +73,7 @@ var gb_data_basic = (function() { | @@ -59,6 +73,7 @@ var gb_data_basic = (function() { | ||
| 59 | activeLines: activeLines, | 73 | activeLines: activeLines, |
| 60 | line_idx: line_idx, | 74 | line_idx: line_idx, |
| 61 | codeToLine: codeToLine, | 75 | codeToLine: codeToLine, |
| 76 | + getLineInformation: getLineInformation, | ||
| 62 | stationRoutes: function(lineCode){return stationRoutes[lineCode]}, | 77 | stationRoutes: function(lineCode){return stationRoutes[lineCode]}, |
| 63 | findLineByCodes: findLineByCodes, | 78 | findLineByCodes: findLineByCodes, |
| 64 | lineCode2NameAll: function(){return lineCode2NameAll}, | 79 | lineCode2NameAll: function(){return lineCode2NameAll}, |
src/main/resources/static/real_control_v2/js/line_schedule/sch_table.js
| @@ -47,6 +47,7 @@ var gb_schedule_table = (function() { | @@ -47,6 +47,7 @@ var gb_schedule_table = (function() { | ||
| 47 | for (var upDown in dirData) { | 47 | for (var upDown in dirData) { |
| 48 | htmlStr = temps['line-schedule-table-temp']({ | 48 | htmlStr = temps['line-schedule-table-temp']({ |
| 49 | dir: upDown, | 49 | dir: upDown, |
| 50 | + line: gb_data_basic.codeToLine[lineCode], | ||
| 50 | list: dirData[upDown] | 51 | list: dirData[upDown] |
| 51 | }); | 52 | }); |
| 52 | 53 |
src/main/resources/static/real_control_v2/js/main.js
| @@ -22,7 +22,7 @@ var gb_main_ep = new EventProxy(), | @@ -22,7 +22,7 @@ var gb_main_ep = new EventProxy(), | ||
| 22 | gb_home_line_panel.init(g_emit('gps-time-refresh')); | 22 | gb_home_line_panel.init(g_emit('gps-time-refresh')); |
| 23 | }); | 23 | }); |
| 24 | 24 | ||
| 25 | - //start fixed time refresh | 25 | + //start fixed time refresh gps |
| 26 | eq.once('gps-time-refresh', function() { | 26 | eq.once('gps-time-refresh', function() { |
| 27 | gb_data_gps.fixedTimeRefresh(); | 27 | gb_data_gps.fixedTimeRefresh(); |
| 28 | g_emit('line-schedule-layout')(); | 28 | g_emit('line-schedule-layout')(); |
src/main/resources/static/real_control_v2/js/north/toolbar.js
| @@ -3,6 +3,7 @@ | @@ -3,6 +3,7 @@ | ||
| 3 | var gb_northToolbar = (function() { | 3 | var gb_northToolbar = (function() { |
| 4 | 4 | ||
| 5 | var modal_opts={center: true,bgclose: false}; | 5 | var modal_opts={center: true,bgclose: false}; |
| 6 | + var currentUser; | ||
| 6 | 7 | ||
| 7 | $.get('/real_control_v2/fragments/north/toolbar.html', function(temp){ | 8 | $.get('/real_control_v2/fragments/north/toolbar.html', function(temp){ |
| 8 | ep.emit("template", temp); | 9 | ep.emit("template", temp); |
| @@ -12,9 +13,15 @@ var gb_northToolbar = (function() { | @@ -12,9 +13,15 @@ var gb_northToolbar = (function() { | ||
| 12 | ep.emit("data", data); | 13 | ep.emit("data", data); |
| 13 | }); | 14 | }); |
| 14 | 15 | ||
| 15 | - var ep = EventProxy.create("template", "data", function (temp, data) { | 16 | + //当前用户信息 |
| 17 | + $.get('/user/currentUser', function(user){ | ||
| 18 | + ep.emit("user", user); | ||
| 19 | + }); | ||
| 20 | + | ||
| 21 | + var ep = EventProxy.create("template", "data", "user" , function (temp, data, user) { | ||
| 22 | + currentUser=user; | ||
| 16 | var t = $('#north-toolbar-temp', temp).html() | 23 | var t = $('#north-toolbar-temp', temp).html() |
| 17 | - ,htmlStr = template.render(t)({list: data}); | 24 | + ,htmlStr = template.render(t)({list: data, user: currentUser}); |
| 18 | $('.north .north-toolbar').html(htmlStr); | 25 | $('.north .north-toolbar').html(htmlStr); |
| 19 | 26 | ||
| 20 | //exit | 27 | //exit |