Commit b8ebbf41c7376d21dcfab63d4492d48609862cd8
1 parent
d2634043
Signed-off-by: YRF <YRF@DESKTOP-UNV37O6>
Showing
21 changed files
with
126 additions
and
19 deletions
src/main/resources/static/pages/base/carpark/add.html
| ... | ... | @@ -325,7 +325,7 @@ |
| 325 | 325 | <a href="javascript:;" class="btn btn-outline green button-next"> 下一步 |
| 326 | 326 | <i class="fa fa-angle-right"></i> |
| 327 | 327 | </a> |
| 328 | - <a href="javascript:;" class="btn green button-submit" style="display: none;"> 提交 | |
| 328 | + <a href="javascript:;" class="btn green button-submit" style="display: none;" id="submintBtn"> 提交 | |
| 329 | 329 | <i class="fa fa-check"></i> |
| 330 | 330 | </a> |
| 331 | 331 | </div> | ... | ... |
src/main/resources/static/pages/base/carpark/js/add-form-wizard.js
| ... | ... | @@ -91,6 +91,8 @@ var FormWizard = function() { |
| 91 | 91 | * 默认:default (native) form submit;当表单通过验证,提交表单。回调函数有个默认参数form |
| 92 | 92 | */ |
| 93 | 93 | submitHandler : function(f) { |
| 94 | + // 防止用户多次提交 | |
| 95 | + $("#submintBtn").addClass("disabled"); | |
| 94 | 96 | // 表单序列化 |
| 95 | 97 | var params = form.serializeJSON(); |
| 96 | 98 | if(params.shapesType=='圆形') |
| ... | ... | @@ -109,6 +111,7 @@ var FormWizard = function() { |
| 109 | 111 | // 返回list.html页面 |
| 110 | 112 | loadPage('/pages/base/carpark/list.html'); |
| 111 | 113 | }); |
| 114 | + $("#submintBtn").removeClass("disabled"); | |
| 112 | 115 | } |
| 113 | 116 | }); |
| 114 | 117 | $.validator.addMethod("alnum", function(value, element) { | ... | ... |
src/main/resources/static/pages/base/company/add.html
| ... | ... | @@ -89,7 +89,7 @@ |
| 89 | 89 | <div class="form-actions"> |
| 90 | 90 | <div class="row"> |
| 91 | 91 | <div class="col-md-offset-3 col-md-4"> |
| 92 | - <button type="submit" class="btn green" ><i class="fa fa-check"></i> 提交</button> | |
| 92 | + <button type="submit" class="btn green" id="submintBtn"><i class="fa fa-check"></i> 提交</button> | |
| 93 | 93 | <a type="button" class="btn default" href="list.html" data-pjax><i class="fa fa-times"></i> 取消</a> |
| 94 | 94 | </div> |
| 95 | 95 | </div> | ... | ... |
src/main/resources/static/pages/base/company/js/comp-add-form.js
| ... | ... | @@ -139,6 +139,8 @@ $(function(){ |
| 139 | 139 | }); |
| 140 | 140 | // 提交 |
| 141 | 141 | function submit() { |
| 142 | + // 防止用户多次提交 | |
| 143 | + $("#submintBtn").addClass("disabled"); | |
| 142 | 144 | // 添加数据 |
| 143 | 145 | $post('/business', params, function(result) { |
| 144 | 146 | // 如果返回结果不为空 |
| ... | ... | @@ -155,6 +157,7 @@ $(function(){ |
| 155 | 157 | // 返回list.html页面 |
| 156 | 158 | loadPage('list.html'); |
| 157 | 159 | }); |
| 160 | + $("#submintBtn").removeClass("disabled"); | |
| 158 | 161 | } |
| 159 | 162 | } |
| 160 | 163 | }); | ... | ... |
src/main/resources/static/pages/base/interval/add.html
| ... | ... | @@ -80,7 +80,7 @@ |
| 80 | 80 | <div class="form-actions"> |
| 81 | 81 | <div class="row"> |
| 82 | 82 | <div class="col-md-offset-5 col-md-7"> |
| 83 | - <button type="submit" class="btn green" ><i class="fa fa-check"></i> 提交</button> | |
| 83 | + <button type="submit" class="btn green" id="submintBtn"><i class="fa fa-check"></i> 提交</button> | |
| 84 | 84 | <a type="button" class="btn default" href="list.html" data-pjax><i class="fa fa-times"></i> 取消</a> |
| 85 | 85 | </div> |
| 86 | 86 | </div> | ... | ... |
src/main/resources/static/pages/base/interval/js/interval-add-form.js
| ... | ... | @@ -108,6 +108,8 @@ $(function(){ |
| 108 | 108 | submit(); |
| 109 | 109 | // 提交 |
| 110 | 110 | function submit() { |
| 111 | + // 防止用户多次提交 | |
| 112 | + $("#submintBtn").addClass("disabled"); | |
| 111 | 113 | // 添加数据 |
| 112 | 114 | $post('/interval', params, function(result) { |
| 113 | 115 | // 如果返回结果不为空 |
| ... | ... | @@ -125,6 +127,7 @@ $(function(){ |
| 125 | 127 | //loadPage('list.html'); |
| 126 | 128 | window.location.href = 'list.html'; |
| 127 | 129 | }); |
| 130 | + $("#submintBtn").removeClass("disabled"); | |
| 128 | 131 | } |
| 129 | 132 | } |
| 130 | 133 | }); | ... | ... |
src/main/resources/static/pages/base/line/add.html
| ... | ... | @@ -487,7 +487,7 @@ |
| 487 | 487 | <div class="form-actions"> |
| 488 | 488 | <div class="row"> |
| 489 | 489 | <div class="col-md-offset-5 col-md-7"> |
| 490 | - <button type="submit" class="btn green" ><i class="fa fa-check"></i> 提交</button> | |
| 490 | + <button type="submit" class="btn green" id="submintBtn"><i class="fa fa-check"></i> 提交</button> | |
| 491 | 491 | <a type="button" class="btn default" href="list.html" data-pjax><i class="fa fa-times"></i> 取消</a> |
| 492 | 492 | </div> |
| 493 | 493 | </div> | ... | ... |
src/main/resources/static/pages/base/line/js/line-add-form.js
src/main/resources/static/pages/base/line/js/map.js
| ... | ... | @@ -43,6 +43,85 @@ var WorldsBMapLine = function () { |
| 43 | 43 | |
| 44 | 44 | //启用键盘上下左右键移动地图 |
| 45 | 45 | mapBValue.enableKeyboard(); |
| 46 | + | |
| 47 | +// var transit = new BMap.DrivingRoute(mapBValue, { | |
| 48 | +// renderOptions: { | |
| 49 | +// map: mapBValue, | |
| 50 | +// panel: "r-result", | |
| 51 | +// enableDragging : true //起终点可进行拖拽 | |
| 52 | +// },opts:{ | |
| 53 | +// onSearchComplete (){ | |
| 54 | +// | |
| 55 | +// } | |
| 56 | +// } | |
| 57 | +// }); | |
| 58 | +// | |
| 59 | + | |
| 60 | + // 获取路段几何图形坐标集合. | |
| 61 | + function getSectionListPlonly(stationsPoint,cb) { | |
| 62 | + var len = stationsPoint.length; | |
| 63 | + var sectionList = []; | |
| 64 | + (function(){ | |
| 65 | + if (!arguments.callee.count) { | |
| 66 | + arguments.callee.count = 0; | |
| 67 | + } | |
| 68 | + arguments.callee.count++; | |
| 69 | + var index = parseInt(arguments.callee.count) - 1; | |
| 70 | + if (index >= len-1 ) { | |
| 71 | + cb && cb(sectionList); | |
| 72 | + return; | |
| 73 | + } | |
| 74 | + var f = arguments.callee; | |
| 75 | + var poiOne = new BMap.Point(stationsPoint[index].potion.lng,stationsPoint[index].potion.lat); | |
| 76 | + var poiTwo = new BMap.Point(stationsPoint[index+1].potion.lng,stationsPoint[index+1].potion.lat); | |
| 77 | + var transit = new BMap.DrivingRoute(mapB, {renderOptions: {map: mapB,enableDragging : true},onPolylinesSet: searchPolylinesSet}); | |
| 78 | + function searchPolylinesSet(results){ | |
| 79 | + if (transit.getStatus() != BMAP_STATUS_SUCCESS){ | |
| 80 | + }else { | |
| 81 | + debugger | |
| 82 | + var sectionArrayList = []; | |
| 83 | + for (i = 0; i < results.length; i++){ | |
| 84 | + sectionArrayList = sectionArrayList.concat(results[i].getPolyline().getPath()); | |
| 85 | + } | |
| 86 | + sectionList = sectionArrayList; | |
| 87 | + } | |
| 88 | + f(); | |
| 89 | + } | |
| 90 | + transit.search(poiOne,poiTwo); | |
| 91 | + })(); | |
| 92 | + } | |
| 93 | + | |
| 94 | + function longAndtime(spoi,point){ | |
| 95 | + var output=""; | |
| 96 | + var searchComplete = function (results){ | |
| 97 | + debugger | |
| 98 | + if (transit.getStatus() != BMAP_STATUS_SUCCESS){ return ;} | |
| 99 | + var plan = results.getPlan(0); | |
| 100 | + output += plan.getDuration(true) + "\n"; //获取时间 | |
| 101 | + output += "总路程为:" ; | |
| 102 | + output += plan.getDistance(true) + "\n"; //获取距离 | |
| 103 | + console.log(output); | |
| 104 | + } | |
| 105 | + var transit = new BMap.DrivingRoute(mapBValue, | |
| 106 | + {renderOptions: | |
| 107 | + {map: mapBValue,panel:"result",enableDragging : true }, | |
| 108 | + | |
| 109 | + onSearchComplete: searchComplete, | |
| 110 | + onPolylinesSet: function(array){ | |
| 111 | + debugger | |
| 112 | + points = array[0].vr; | |
| 113 | + } | |
| 114 | + }); | |
| 115 | + transit.search(spoi, point); | |
| 116 | + } | |
| 117 | +// longAndtime(new BMap.Point(121.652092,31.216818),new BMap.Point(121.636453,31.217296)); | |
| 118 | + longAndtime("世纪大道","东昌路"); | |
| 119 | + | |
| 120 | +// transit.setLocation(mapBValue) | |
| 121 | +//// transit.search("唐镇","唐陆路"); | |
| 122 | +// var a = transit.onSearchComplete(); | |
| 123 | +// debugger | |
| 124 | +// var b = mapBValue.onSearchComplete(); | |
| 46 | 125 | |
| 47 | 126 | return mapBValue; |
| 48 | 127 | }, | ... | ... |
src/main/resources/static/pages/base/lineinformation/add.html
| ... | ... | @@ -583,7 +583,7 @@ |
| 583 | 583 | <div class="form-actions"> |
| 584 | 584 | <div class="row"> |
| 585 | 585 | <div class="col-md-offset-5 col-md-7"> |
| 586 | - <button type="submit" class="btn green" ><i class="fa fa-check"></i> 提交</button> | |
| 586 | + <button type="submit" class="btn green" id="submintBtn"><i class="fa fa-check"></i> 提交</button> | |
| 587 | 587 | <a type="button" class="btn default lineinformation_back" href="lineinformation.html" data-pjax><i class="fa fa-times"></i> 取消</a> |
| 588 | 588 | </div> |
| 589 | 589 | </div> | ... | ... |
src/main/resources/static/pages/base/lineinformation/js/lineinformation-add-form.js
| ... | ... | @@ -198,11 +198,13 @@ $(function(){ |
| 198 | 198 | error.hide(); |
| 199 | 199 | |
| 200 | 200 | var params = form.serializeJSON(); |
| 201 | + // 防止用户多次提交 | |
| 202 | + $("#submintBtn").addClass("disabled"); | |
| 201 | 203 | |
| 202 | 204 | if (params.line) { |
| 203 | 205 | |
| 204 | 206 | // 添加数据 |
| 205 | - $post('/lineInformation', params, function(result) { | |
| 207 | + $post('/lineInformation1', params, function(result) { | |
| 206 | 208 | |
| 207 | 209 | // 如果返回结果不为空 |
| 208 | 210 | if(result){ |
| ... | ... | @@ -226,6 +228,7 @@ $(function(){ |
| 226 | 228 | }); |
| 227 | 229 | |
| 228 | 230 | } |
| 231 | + $("#submintBtn").removeClass("disabled"); | |
| 229 | 232 | } |
| 230 | 233 | }); |
| 231 | 234 | ... | ... |
src/main/resources/static/pages/base/lineversions/add.html
| ... | ... | @@ -129,7 +129,7 @@ |
| 129 | 129 | <div class="form-actions"> |
| 130 | 130 | <div class="row"> |
| 131 | 131 | <div class="col-md-offset-5 col-md-7"> |
| 132 | - <button type="submit" class="btn green" ><i class="fa fa-check"></i> 提交</button> | |
| 132 | + <button type="submit" class="btn green" id="submintBtn"><i class="fa fa-check"></i> 提交</button> | |
| 133 | 133 | <a type="button" class="btn default" href="list.html" data-pjax><i class="fa fa-times"></i> 取消</a> |
| 134 | 134 | </div> |
| 135 | 135 | </div> | ... | ... |
src/main/resources/static/pages/base/lineversions/js/lineversions-add-from.js
| ... | ... | @@ -195,6 +195,8 @@ |
| 195 | 195 | submit(); |
| 196 | 196 | // 提交 |
| 197 | 197 | function submit() { |
| 198 | + // 防止用户多次提交 | |
| 199 | + $("#submintBtn").addClass("disabled"); | |
| 198 | 200 | // 添加数据 |
| 199 | 201 | $post('/lineVersions/add', params, function(result) { |
| 200 | 202 | // 如果返回结果不为空 |
| ... | ... | @@ -211,6 +213,7 @@ |
| 211 | 213 | // 返回list.html页面 |
| 212 | 214 | loadPage('list.html'); |
| 213 | 215 | }); |
| 216 | + $("#submintBtn").removeClass("disabled"); | |
| 214 | 217 | } |
| 215 | 218 | } |
| 216 | 219 | }); | ... | ... |
src/main/resources/static/pages/base/roadspeed/add.html
| ... | ... | @@ -251,7 +251,7 @@ |
| 251 | 251 | <a href="javascript:;" class="btn btn-outline green button-next"> 下一步 |
| 252 | 252 | <i class="fa fa-angle-right"></i> |
| 253 | 253 | </a> |
| 254 | - <a href="javascript:;" class="btn green button-submit" style="display: none;"> 提交 | |
| 254 | + <a href="javascript:;" class="btn green button-submit" style="display: none;" id="submintBtn"> 提交 | |
| 255 | 255 | <i class="fa fa-check"></i> |
| 256 | 256 | </a> |
| 257 | 257 | </div> | ... | ... |
src/main/resources/static/pages/base/roadspeed/js/add-form-wizard.js
| ... | ... | @@ -76,6 +76,9 @@ var FormWizard = function() { |
| 76 | 76 | * 默认:default (native) form submit;当表单通过验证,提交表单。回调函数有个默认参数form. |
| 77 | 77 | */ |
| 78 | 78 | submitHandler : function(f) { |
| 79 | + // 防止用户多次提交 | |
| 80 | + $("#submintBtn").addClass("disabled"); | |
| 81 | + debugger | |
| 79 | 82 | var params = form.serializeJSON();// 表单序列化. |
| 80 | 83 | if(params.roadVector=='') { |
| 81 | 84 | layer.msg('路段几何图形为空~请先在路段位置步骤中绘制出线路走向!'); |
| ... | ... | @@ -90,6 +93,7 @@ var FormWizard = function() { |
| 90 | 93 | } |
| 91 | 94 | loadPage('list.html');// 返回list.html页面. |
| 92 | 95 | }); |
| 96 | + $("#submintBtn").removeClass("disabled"); | |
| 93 | 97 | } |
| 94 | 98 | }); |
| 95 | 99 | ... | ... |
src/main/resources/static/pages/base/roadspeed/js/add-vmap-world.js
| ... | ... | @@ -63,11 +63,11 @@ var SectionVmapWorlds = function() { |
| 63 | 63 | marker.setAnimation(BMAP_ANIMATION_BOUNCE); |
| 64 | 64 | }else { |
| 65 | 65 | // 弹出添加成功提示消息 |
| 66 | - layer.msg('无法获取停车场【'+Address+'】地理位置!'); | |
| 66 | + layer.msg('无法获取【'+Address+'】地理位置!'); | |
| 67 | 67 | } |
| 68 | 68 | }else { |
| 69 | 69 | // 弹出添加成功提示消息 |
| 70 | - layer.msg('无法获取停车场【'+Address+'】地理位置!'); | |
| 70 | + layer.msg('无法获取【'+Address+'】地理位置!'); | |
| 71 | 71 | } |
| 72 | 72 | }); |
| 73 | 73 | // 根据检索词发起检索。 | ... | ... |
src/main/resources/static/pages/base/section/add.html
| ... | ... | @@ -376,7 +376,7 @@ |
| 376 | 376 | <a href="javascript:;" class="btn btn-outline green button-next"> 下一步 |
| 377 | 377 | <i class="fa fa-angle-right"></i> |
| 378 | 378 | </a> |
| 379 | - <a href="javascript:;" class="btn green button-submit" style="display: none;"> 提交 | |
| 379 | + <a href="javascript:;" class="btn green button-submit" style="display: none;" id="submintBtn"> 提交 | |
| 380 | 380 | <i class="fa fa-check"></i> |
| 381 | 381 | </a> |
| 382 | 382 | </div> | ... | ... |
src/main/resources/static/pages/base/section/js/add-form-wizard.js
| ... | ... | @@ -81,6 +81,8 @@ var FormWizard = function() { |
| 81 | 81 | * 默认:default (native) form submit;当表单通过验证,提交表单。回调函数有个默认参数form. |
| 82 | 82 | */ |
| 83 | 83 | submitHandler : function(f) { |
| 84 | + // 防止用户多次提交 | |
| 85 | + $("#submintBtn").addClass("disabled"); | |
| 84 | 86 | var params = form.serializeJSON();// 表单序列化. |
| 85 | 87 | if(params.bsectionVector=='') { |
| 86 | 88 | layer.msg('路段几何图形为空~请先在路段位置步骤中绘制出线路走向!'); |
| ... | ... | @@ -95,6 +97,7 @@ var FormWizard = function() { |
| 95 | 97 | } |
| 96 | 98 | loadPage('list.html');// 返回list.html页面. |
| 97 | 99 | }); |
| 100 | + $("#submintBtn").removeClass("disabled"); | |
| 98 | 101 | } |
| 99 | 102 | }); |
| 100 | 103 | |
| ... | ... | @@ -151,8 +154,8 @@ var FormWizard = function() { |
| 151 | 154 | var stationStartValue = $('#stationStartInput').val(); |
| 152 | 155 | var stationEndValue = $('#stationEndInput').val(); |
| 153 | 156 | var paramsStationsArray = []; |
| 154 | - paramsStationsArray[0] = stationStartValue+'公交车站'; | |
| 155 | - paramsStationsArray[1]= stationEndValue+'公交车站'; | |
| 157 | + paramsStationsArray[0] = stationStartValue; | |
| 158 | + paramsStationsArray[1]= stationEndValue; | |
| 156 | 159 | $('#sectionNameInput').val(stationStartValue + '至' + stationEndValue ); |
| 157 | 160 | if(baseResValue == 0) { |
| 158 | 161 | $('.leftUtils').hide(); |
| ... | ... | @@ -166,8 +169,8 @@ var FormWizard = function() { |
| 166 | 169 | }); |
| 167 | 170 | }); |
| 168 | 171 | }else if(baseResValue ==1) { |
| 169 | - SectionVmapWorlds.localSearchFromAdreesToPoint(stationStartValue+'公交车站'); | |
| 170 | - SectionVmapWorlds.localSearchFromAdreesToPoint(stationEndValue+'公交车站'); | |
| 172 | + SectionVmapWorlds.localSearchFromAdreesToPoint(stationStartValue); | |
| 173 | + SectionVmapWorlds.localSearchFromAdreesToPoint(stationEndValue); | |
| 171 | 174 | // SectionVmapWorlds.drawingManagerOpen(); |
| 172 | 175 | } |
| 173 | 176 | $('html,body').animate({scrollTop: ($('#form-wizard-info').offset().top-5) + "px"},500); | ... | ... |
src/main/resources/static/pages/base/section/js/add-vmap-world.js
| ... | ... | @@ -63,11 +63,11 @@ var SectionVmapWorlds = function() { |
| 63 | 63 | marker.setAnimation(BMAP_ANIMATION_BOUNCE); |
| 64 | 64 | }else { |
| 65 | 65 | // 弹出添加成功提示消息 |
| 66 | - layer.msg('无法获取停车场【'+Address+'】地理位置!'); | |
| 66 | + layer.msg('无法获取【'+Address+'】地理位置!'); | |
| 67 | 67 | } |
| 68 | 68 | }else { |
| 69 | 69 | // 弹出添加成功提示消息 |
| 70 | - layer.msg('无法获取停车场【'+Address+'】地理位置!'); | |
| 70 | + layer.msg('无法获取【'+Address+'】地理位置!'); | |
| 71 | 71 | } |
| 72 | 72 | }); |
| 73 | 73 | // 根据检索词发起检索。 |
| ... | ... | @@ -174,7 +174,7 @@ var SectionVmapWorlds = function() { |
| 174 | 174 | var f = arguments.callee; |
| 175 | 175 | var poiOne = new BMap.Point(stationsPoint[index].potion.lng,stationsPoint[index].potion.lat); |
| 176 | 176 | var poiTwo = new BMap.Point(stationsPoint[index+1].potion.lng,stationsPoint[index+1].potion.lat); |
| 177 | - var transit = new BMap.DrivingRoute(mapB, {renderOptions: {map: mapB},onPolylinesSet: searchPolylinesSet}); | |
| 177 | + var transit = new BMap.DrivingRoute(mapB, {renderOptions: {map: mapB,enableDragging : true},onPolylinesSet: searchPolylinesSet}); | |
| 178 | 178 | function searchPolylinesSet(results){ |
| 179 | 179 | if (transit.getStatus() != BMAP_STATUS_SUCCESS){ |
| 180 | 180 | }else { | ... | ... |
src/main/resources/static/pages/base/station/add.html
| ... | ... | @@ -425,7 +425,7 @@ |
| 425 | 425 | <a href="javascript:;" class="btn btn-outline green button-next"> 下一步 |
| 426 | 426 | <i class="fa fa-angle-right"></i> |
| 427 | 427 | </a> |
| 428 | - <a href="javascript:;" class="btn green button-submit" style="display: none;"> 提交 | |
| 428 | + <a href="javascript:;" class="btn green button-submit" style="display: none;" id="submintBtn"> 提交 | |
| 429 | 429 | <i class="fa fa-check"></i> |
| 430 | 430 | </a> |
| 431 | 431 | </div> | ... | ... |
src/main/resources/static/pages/base/station/js/add-form-wizard.js
| ... | ... | @@ -90,6 +90,8 @@ var FormWizard = function() { |
| 90 | 90 | * 默认:default (native) form submit;当表单通过验证,提交表单。回调函数有个默认参数form |
| 91 | 91 | */ |
| 92 | 92 | submitHandler : function(f) { |
| 93 | + // 防止用户多次提交 | |
| 94 | + $("#submintBtn").addClass("disabled"); | |
| 93 | 95 | // 表单序列化 |
| 94 | 96 | var params = form.serializeJSON(); |
| 95 | 97 | if(params.shapesType=='圆形') |
| ... | ... | @@ -108,6 +110,7 @@ var FormWizard = function() { |
| 108 | 110 | // 返回list.html页面 |
| 109 | 111 | loadPage('list.html'); |
| 110 | 112 | }); |
| 113 | + $("#submintBtn").removeClass("disabled"); | |
| 111 | 114 | } |
| 112 | 115 | }); |
| 113 | 116 | // 当站点类型为中途站或者终点站时,上一站点为必填项! | ... | ... |