Commit 1c2df4a3190b4a95d221743b471587cd932f9b79
1 parent
c47a2f4b
1.选择站点生成线路路由顺序问题解决
Showing
1 changed file
with
9 additions
and
4 deletions
src/main/resources/static/pages/base/stationroute/station_select_generate.html
| ... | ... | @@ -24,7 +24,7 @@ |
| 24 | 24 | </div> |
| 25 | 25 | </div> |
| 26 | 26 | <script type="text/javascript"> |
| 27 | - var properties = RoutesOperation.getProperties(); | |
| 27 | + var properties = RoutesOperation.getProperties(), stationIds = new Array(); | |
| 28 | 28 | |
| 29 | 29 | $get('/station/all', {}, function(stations){ |
| 30 | 30 | if (!stations || stations.length == 0) return; |
| ... | ... | @@ -34,6 +34,7 @@ |
| 34 | 34 | opts.push('<option value="', station.id, '" title="', station.passLines, '">', station.stationName, '[', station.id, ']', '</option>'); |
| 35 | 35 | } |
| 36 | 36 | $('#stationSelect').html(opts.join('')).multiSelect({ |
| 37 | + keepOrder: true, | |
| 37 | 38 | selectableHeader: "<input type='text' class='search-input' autocomplete='off' placeholder='未选择'>", |
| 38 | 39 | selectionHeader: "<input type='text' class='search-input' autocomplete='off' placeholder='已选择'>", |
| 39 | 40 | afterInit: function(ms){ |
| ... | ... | @@ -59,11 +60,15 @@ |
| 59 | 60 | } |
| 60 | 61 | }); |
| 61 | 62 | }, |
| 62 | - afterSelect: function(){ | |
| 63 | + afterSelect: function(value){ | |
| 64 | + stationIds.push(value[0]); | |
| 63 | 65 | this.qs1.cache(); |
| 64 | 66 | this.qs2.cache(); |
| 65 | 67 | }, |
| 66 | - afterDeselect: function(){ | |
| 68 | + afterDeselect: function(value){ | |
| 69 | + stationIds = stationIds.filter(function(item) { | |
| 70 | + return item !== value[0]; | |
| 71 | + }); | |
| 67 | 72 | this.qs1.cache(); |
| 68 | 73 | this.qs2.cache(); |
| 69 | 74 | } |
| ... | ... | @@ -104,7 +109,7 @@ |
| 104 | 109 | }, |
| 105 | 110 | submitHandler : function(f) { |
| 106 | 111 | error.hide(); |
| 107 | - var stationIds = $('#stationSelect').val(); | |
| 112 | + debugger | |
| 108 | 113 | if (!stationIds || stationIds.length == 0) { |
| 109 | 114 | layer.msg('请选择对应的站点'); |
| 110 | 115 | return; | ... | ... |