Commit 973b17d838fb3dd47038b7fe88eb2b6247f1fdae

Authored by YRF
1 parent ec19ee5c

站点修改页面修改

src/main/resources/static/pages/base/station/js/station-list-edit.js
... ... @@ -16,9 +16,6 @@
16 16 $('#lineNameInput').val(no[1]);
17 17 // 获取站点对象信息
18 18 var editStation = {};
19   - /*PositionsPublicFunctions.getStationRouteInfo(id,function(r) {
20   - editStation = r;
21   - });*/
22 19 $.ajax({
23 20 url: "/stationroute/findStationRouteInfo", //请求地址
24 21 type: "Get",
... ... @@ -29,74 +26,77 @@
29 26 editStation = result[0];
30 27 }
31 28 });
32   - // 初始化表单值
33   - PositionsPublicFunctions.setListEditFrom(editStation);
34   - var initzdlyP = {'lineCode_eq':editStation.stationRouteLIneCode,'destroy_eq':0,'directions_eq':editStation.stationRoutedirections};
35   - initSelect(initzdlyP);
  29 + setTimeout(function(){
  30 + // 初始化表单值
  31 + PositionsPublicFunctions.setListEditFrom(editStation);
  32 +
  33 + var initzdlyP = {'lineCode_eq':editStation.stationRouteLIneCode,'destroy_eq':0,'directions_eq':editStation.stationRoutedirections};
  34 + initSelect(initzdlyP);
  35 +
  36 + // 编辑表单元素
  37 + var form = $('#list_edit_station_form');
  38 + // 获取错误提示元素
  39 + var error = $('.alert-danger', form);
  40 + // 提交数据按钮事件
  41 + $('#editStationButton').on('click', function() {
  42 + // 表单提交
  43 + form.submit();
  44 + });
  45 + // 表单验证
  46 + form.validate({
  47 + errorElement : 'span',
  48 + errorClass : 'help-block help-block-error',
  49 + focusInvalid : false,
  50 + rules : {
  51 + 'stationName' : {required : true},// 站点路由名称 必填项
  52 + 'stationCod': {required : true,},// 站点编码 必填项
  53 + 'directions' : {required : true,dirIs : true},// 站点方向 必填项 必填项
  54 + 'stationRouteCode' : {isStart : true},// 站点序号
  55 + 'bJwpoints' : {required : true},// 经纬度坐标点 必填项
  56 + 'shapesType' : {required : true},// 几何图形类型 必填项
  57 + 'radius' : {required : true},// 圆形半径 必填项
  58 + 'destroy' : {required : true},// 是否撤销 必填项
  59 + 'toTime' : {number : true},// 到站时间 必须输入合法的数字(负数,小数)。
  60 + 'distances' : {number : true},// 到站距离 // 到站距离
  61 + 'descriptions' : {maxlength: 150}// 描述与说明 最大长度
  62 + },
  63 + invalidHandler : function(event, validator) {
  64 + error.show();
  65 + App.scrollTo(error, -200);
  66 + },
  67 + highlight : function(element) {
  68 + $(element).closest('.form-group').addClass('has-error');
  69 + },
  70 + unhighlight : function(element) {
  71 + $(element).closest('.form-group').removeClass('has-error');
  72 + },
  73 + success : function(label) {
  74 + label.closest('.form-group').removeClass('has-error');
  75 + },
  76 + submitHandler : function(f) {
  77 + error.hide();
  78 + var params = form.serializeJSON();
  79 + /*if(params.shapesType=='圆形')
  80 + params.shapesType = 'r';
  81 + else if(params.shapesType=='多边形')
  82 + params.shapesType = 'd';*/
  83 + if(params.stationRouteCode=='请选择...')
  84 + params.stationRouteCode='';
  85 + PositionsPublicFunctions.stationUpdate(params,function(resuntDate) {
  86 + if(resuntDate.status=='SUCCESS') {
  87 + // 弹出添加成功提示消息
  88 + layer.msg('修改成功...');
  89 + }else {
  90 + // 弹出添加失败提示消息
  91 + layer.msg('修改失败...');
  92 + }
  93 + //返回站点信息页面
  94 + loadPage('list.html');
  95 + });
  96 + }
  97 + });
  98 + },500);
36 99  
37   - // 编辑表单元素
38   - var form = $('#list_edit_station_form');
39   - // 获取错误提示元素
40   - var error = $('.alert-danger', form);
41   - // 提交数据按钮事件
42   - $('#editStationButton').on('click', function() {
43   - // 表单提交
44   - form.submit();
45   - });
46   - // 表单验证
47   - form.validate({
48   - errorElement : 'span',
49   - errorClass : 'help-block help-block-error',
50   - focusInvalid : false,
51   - rules : {
52   - 'stationName' : {required : true},// 站点路由名称 必填项
53   - 'stationCod': {required : true,},// 站点编码 必填项
54   - 'directions' : {required : true,dirIs : true},// 站点方向 必填项 必填项
55   - 'stationRouteCode' : {isStart : true},// 站点序号
56   - 'stationMark' : {required : true},// 站点类型 必填项
57   - 'bJwpoints' : {required : true},// 经纬度坐标点 必填项
58   - 'shapesType' : {required : true},// 几何图形类型 必填项
59   - 'radius' : {required : true},// 圆形半径 必填项
60   - 'destroy' : {required : true},// 是否撤销 必填项
61   - 'toTime' : {number : true},// 到站时间 必须输入合法的数字(负数,小数)。
62   - 'distances' : {number : true},// 到站距离 // 到站距离
63   - 'descriptions' : {maxlength: 150}// 描述与说明 最大长度
64   - },
65   - invalidHandler : function(event, validator) {
66   - error.show();
67   - App.scrollTo(error, -200);
68   - },
69   - highlight : function(element) {
70   - $(element).closest('.form-group').addClass('has-error');
71   - },
72   - unhighlight : function(element) {
73   - $(element).closest('.form-group').removeClass('has-error');
74   - },
75   - success : function(label) {
76   - label.closest('.form-group').removeClass('has-error');
77   - },
78   - submitHandler : function(f) {
79   - error.hide();
80   - var params = form.serializeJSON();
81   - /*if(params.shapesType=='圆形')
82   - params.shapesType = 'r';
83   - else if(params.shapesType=='多边形')
84   - params.shapesType = 'd';*/
85   - if(params.stationRouteCode=='请选择...')
86   - params.stationRouteCode='';
87   - PositionsPublicFunctions.stationUpdate(params,function(resuntDate) {
88   - if(resuntDate.status=='SUCCESS') {
89   - // 弹出添加成功提示消息
90   - layer.msg('修改成功...');
91   - }else {
92   - // 弹出添加失败提示消息
93   - layer.msg('修改失败...');
94   - }
95   - //返回站点信息页面
96   - loadPage('list.html');
97   - });
98   - }
99   - });
100 100 // 站点序号值改变事件
101 101 $('#stationrouteSelect').on('change',function() {
102 102 var stationRValue = $('#stationrouteSelect').val();
... ...
src/main/resources/static/pages/base/station/js/station-positions-function.js
... ... @@ -154,12 +154,12 @@ var PositionsPublicFunctions = function () {
154 154 $('#descriptionsTextarea').val(stationObj.stationRouteDescriptions);
155 155 },
156 156 setListEditFrom : function(stationObj) {
157   - // 图形坐标点集合(百度坐标)
  157 + // WGS坐标点图形集合
158 158 $('#bPolygonGridInput').val(stationObj.stationBPolyonGrid);
159 159 // 百度地图经纬度坐标中心点
160 160 $('#bJwpointsInput').val(stationObj.stationJwpoints);
161   - // WGS坐标点图形集合
162   - $('#bPolygonGridInput').val(stationObj.stationGPloyonGrid);
  161 + // 图形坐标点集合(百度坐标)
  162 +// $('#bPolygonGridInput').val(stationObj.stationGPloyonGrid);
163 163 // 城建坐标x
164 164 $('#xInput').val(stationObj.stationGlonx);
165 165 // 城建坐标y
... ... @@ -169,14 +169,11 @@ var PositionsPublicFunctions = function () {
169 169 // 获取半径元素,并添加值
170 170 $('#radiusInput').val(stationObj.stationRadius);
171 171 // 线路ID
172   - $('#stationRouteLineInput').val(stationObj.stationRouteLIneCode);
  172 + $('#stationRouteLineInput').val(stationObj.stationRouteLine);
173 173 // 站点编码
174 174 $('#stationCodInput').val(stationObj.stationCode);
175   -
176 175 // 线路编码
177   - $('#lineCodeInput').val(stationObj.stationRouteCode);
178   - /*// 线路名称
179   - $('#lineNameInput').val();*/
  176 + $('#lineCodeInput').val(stationObj.stationRouteLIneCode);
180 177 // 站点ID
181 178 $('#StationCodeInput').val(stationObj.stationRouteStation);
182 179 // 站点路由ID
... ...
src/main/resources/static/pages/base/station/list_edit.html
... ... @@ -81,7 +81,6 @@
81 81 </label>
82 82 <div class="col-md-4">
83 83 <input type="text" class="form-control" name="lineName" id="lineNameInput" placeholder="线路名称" readonly="readonly" />
84   - <span class="help-block"> 例如 :浦东88路 </span>
85 84 </div>
86 85 </div>
87 86 <!-- 线路名称 (* 必填项) END -->
... ... @@ -157,7 +156,7 @@
157 156 <!-- 站点序号 -->
158 157 <div class="col-md-6">
159 158 <label class="control-label col-md-5">
160   - <span class="required"> * </span>上一站点&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;:
  159 + <span class="required"> </span>上一站点&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;:
161 160 </label>
162 161 <div class="col-md-4">
163 162 <select name="stationRouteCode" class="form-control" id="stationrouteSelect" style="width:100%"></select>
... ... @@ -205,7 +204,7 @@
205 204 <div class="form-group">
206 205 <!-- 道路编码-->
207 206 <div class="col-md-6">
208   - <label class="control-label col-md-5"><span class="required"> * </span>
  207 + <label class="control-label col-md-5"><span class="required"> </span>
209 208 道路编码&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;:
210 209 </label>
211 210 <div class="col-md-4">
... ... @@ -215,7 +214,7 @@
215 214  
216 215 <!-- 到站时间 -->
217 216 <div class="col-md-6">
218   - <label class="control-label col-md-5"><span class="required"> * </span>
  217 + <label class="control-label col-md-5"><span class="required"></span>
219 218 到站时间 &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;: </label>
220 219 <div class="col-md-4">
221 220 <input type="text" class="form-control" name="toTime" id="toTimeInput" placeholder="到站时间">
... ... @@ -229,7 +228,7 @@
229 228 <div class="form-group">
230 229 <!-- 到站距离 -->
231 230 <div class="col-md-6">
232   - <label class="control-label col-md-5"><span class="required"> * </span>
  231 + <label class="control-label col-md-5"><span class="required"> </span>
233 232 到站距离&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;:</label>
234 233 <div class="col-md-4">
235 234 <input type="text" class="form-control" name="distances" id="distancesInput" placeholder="到站距离">
... ... @@ -239,10 +238,10 @@
239 238  
240 239 <!-- 版本号 -->
241 240 <div class="col-md-6">
242   - <label class="control-label col-md-5"><span class="required"> * </span> 版本号&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;:
  241 + <label class="control-label col-md-5"><span class="required"> </span> 版本号&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;:
243 242 </label>
244 243 <div class="col-md-4">
245   - <input type="text" class="form-control" name="versions" value='1' Readonly>
  244 + <input type="text" class="form-control" name="versions" >
246 245 </div>
247 246 </div>
248 247 </div>
... ... @@ -252,7 +251,7 @@
252 251 <div class="form-group">
253 252 <!-- 描述/说明 -->
254 253 <div class="col-md-6">
255   - <label class="control-label col-md-5"><span class="required"> * </span>描述/说明&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;:
  254 + <label class="control-label col-md-5"><span class="required"></span>描述/说明&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;:
256 255 </label>
257 256 <div class="col-md-4">
258 257 <textarea class="form-control" rows="3" name="descriptions" id="descriptionsTextarea" placeholder="描述/说明"></textarea>
... ...