Commit 1c2df4a3190b4a95d221743b471587cd932f9b79

Authored by 王通
1 parent c47a2f4b

1.选择站点生成线路路由顺序问题解决

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