Commit bbd08ba01c6a94a334568d01ab281bca8f4e25de

Authored by 李强
1 parent be7393a9

基础信息线路标准功能完善

src/main/java/com/bsth/entity/LineInformation.java
... ... @@ -131,7 +131,7 @@ public class LineInformation {
131 131 private Integer lagStation;
132 132  
133 133 // 越站
134   - private Integer Skip;
  134 + private Integer skip;
135 135  
136 136 // 超速
137 137 private Integer speeding;
... ... @@ -435,11 +435,11 @@ public class LineInformation {
435 435 }
436 436  
437 437 public Integer getSkip() {
438   - return Skip;
  438 + return skip;
439 439 }
440 440  
441 441 public void setSkip(Integer skip) {
442   - Skip = skip;
  442 + this.skip = skip;
443 443 }
444 444  
445 445 public Integer getSpeeding() {
... ...
src/main/resources/static/pages/base/lineinformation/add.html
... ... @@ -56,9 +56,7 @@
56 56  
57 57 <!-- 标准总里程 -->
58 58 <div class="form-group">
59   - <label class="control-label col-md-3">
60   - <span class="required"> * </span>标准总里程:
61   - </label>
  59 + <label class="control-label col-md-3">标准总里程:</label>
62 60 <div class="col-md-4">
63 61 <input type="text" class="form-control" name="totalMileage" id="totalMileageInput" placeholder="标准总里程">
64 62 <span class="help-block"> 单位:公里 </span>
... ... @@ -76,9 +74,7 @@
76 74  
77 75 <!-- 上行里程 -->
78 76 <div class="form-group">
79   - <label class="control-label col-md-3">
80   - <span class="required"> * </span>上行里程:
81   - </label>
  77 + <label class="control-label col-md-3">上行里程:</label>
82 78 <div class="col-md-4">
83 79 <input type="text" class="form-control" name="upMileage" id="upMileageInput" placeholder="上行里程">
84 80 <span class="help-block"> 单位:公里 </span>
... ... @@ -87,9 +83,7 @@
87 83  
88 84 <!-- 下行里程 -->
89 85 <div class="form-group">
90   - <label class="control-label col-md-3">
91   - <span class="required"> * </span>下行里程:
92   - </label>
  86 + <label class="control-label col-md-3">下行里程: </label>
93 87 <div class="col-md-4">
94 88 <input type="text" class="form-control" name="downMileage" id="downMileageInput" placeholder="下行里程">
95 89 <span class="help-block"> 单位:公里 </span>
... ... @@ -342,7 +336,7 @@
342 336 <div class="form-group">
343 337 <label class="control-label col-md-3"> 越站: </label>
344 338 <div class="col-md-4">
345   - <input type="text" class="form-control" name="Skip" id="SkipInput" placeholder="越站">
  339 + <input type="text" class="form-control" name="skip" id="skipInput" placeholder="越站">
346 340 </div>
347 341 </div>
348 342  
... ...
src/main/resources/static/pages/base/lineinformation/details.html
... ... @@ -20,11 +20,6 @@
20 20 <i class="icon-equalizer font-red-sunglo"></i>
21 21 <span class="caption-subject font-red-sunglo bold uppercase">线路标准信息详情</span>
22 22 </div>
23   - <div class="actions">
24   - <div class="btn-group btn-group-devided" data-toggle="buttons">
25   - <a class="btn btn-circle back-up blue" href="/pages/base/lineinformation/list.html" data-pjax><i class="fa fa-reply"></i> 返回</a>
26   - </div>
27   - </div>
28 23 </div>
29 24  
30 25 <!-- 表单 -->
... ... @@ -348,7 +343,7 @@
348 343 <div class="form-group">
349 344 <label class="control-label col-md-3"> 越站: </label>
350 345 <div class="col-md-4">
351   - <input type="text" class="form-control" name="Skip" id="SkipInput" placeholder="越站">
  346 + <input type="text" class="form-control" name="skip" id="skipInput" placeholder="越站">
352 347 </div>
353 348 </div>
354 349  
... ... @@ -384,6 +379,13 @@
384 379 </div>
385 380 </div>
386 381 </div>
  382 + <div class="form-actions">
  383 + <div class="row">
  384 + <div class="col-md-offset-3 col-md-4">
  385 + <a type="button" class="btn default back-up" href="/pages/base/lineinformation/list.html" style="margin-left: 35%;" data-pjax><i class="fa fa-reply"></i> 返回</a>
  386 + </div>
  387 + </div>
  388 + </div>
387 389 </form>
388 390 </div>
389 391 </div>
... ...
src/main/resources/static/pages/base/lineinformation/edit.html
... ... @@ -18,7 +18,7 @@
18 18 <div class="portlet-title">
19 19 <div class="caption">
20 20 <i class="icon-equalizer font-red-sunglo"></i>
21   - <span class="caption-subject font-red-sunglo bold uppercase">添加线路标准信息</span>
  21 + <span class="caption-subject font-red-sunglo bold uppercase">修改线路标准信息</span>
22 22 </div>
23 23 </div>
24 24  
... ... @@ -40,6 +40,9 @@
40 40 <!-- 线路信息ID -->
41 41 <input type="hidden" name="id" id="lineinformationId">
42 42  
  43 + <!-- 线路信息ID -->
  44 + <input type="hidden" name="line" id="lineIdInput">
  45 +
43 46 <!-- 线路标准信息类型 -->
44 47 <div class="form-group">
45 48 <label class="control-label col-md-3">
... ... @@ -343,7 +346,7 @@
343 346 <div class="form-group">
344 347 <label class="control-label col-md-3"> 越站: </label>
345 348 <div class="col-md-4">
346   - <input type="text" class="form-control" name="Skip" id="SkipInput" placeholder="越站">
  349 + <input type="text" class="form-control" name="skip" id="skipInput" placeholder="越站">
347 350 </div>
348 351 </div>
349 352  
... ...
src/main/resources/static/pages/base/lineinformation/js/lineinformation-add-form.js
1 1 $(function(){
2 2  
3 3 // 获取参数ID
4   - var lineId = $.url().param('lineId');
  4 + var lineId = $.url().param('no');
5 5  
6 6 if(lineId) {
7 7  
8   - $('.lineinformation_back').attr('href','/pages/base/lineinformation/list.html?lineId='+lineId);
  8 + $('.lineinformation_back').attr('href','/pages/base/lineinformation/list.html?no='+lineId);
9 9  
10 10 $('#lineIdInput').val(lineId);
11 11  
... ... @@ -86,9 +86,6 @@ $(function(){
86 86 // 标准总里程
87 87 'totalMileage' : {
88 88  
89   - //必填项
90   - required:true,
91   -
92 89 // 必须输入合法的数字(负数,小数)。
93 90 number : true,
94 91  
... ... @@ -105,9 +102,6 @@ $(function(){
105 102 // 上行里程
106 103 'upMileage' : {
107 104  
108   - //必填项
109   - required:true,
110   -
111 105 // 必须输入合法的数字(负数,小数)。
112 106 number : true
113 107  
... ... @@ -116,9 +110,6 @@ $(function(){
116 110 // 下行里程
117 111 'downMileage' : {
118 112  
119   - //必填项
120   - required:true,
121   -
122 113 // 必须输入合法的数字(负数,小数)。
123 114 number : true
124 115  
... ... @@ -428,7 +419,7 @@ $(function(){
428 419 }
429 420  
430 421 // 返回list.html页面
431   - loadPage('lineinformation.html?lineId='+lineId);
  422 + loadPage('/pages/base/lineinformation/list.html?no='+lineId);
432 423 });
433 424  
434 425 }
... ...
src/main/resources/static/pages/base/lineinformation/js/lineinformation-details-form.js
1 1 $(function() {
2 2  
3   - var lineinformationId = $.url().param('lineinformationId');
  3 + // 获取参数值
  4 + var noStr = $.url().param('no');
4 5  
5   - var lineId = $.url().param('lineId');
  6 + // 线路标准ID
  7 + var lineinformationId = '';
6 8  
7   - if(lineinformationId && lineId) {
  9 + // 线路ID
  10 + var lineId = '';
  11 +
  12 + // 如果参数值不为空
  13 + if(noStr) {
  14 +
  15 + // 切割参数值
  16 + var noArray = noStr.split('_');
  17 +
  18 + // 赋值线路标准ID
  19 + lineinformationId = noArray[0];
  20 +
  21 + // 赋值线路ID
  22 + lineId = noArray[1];
8 23  
9 24 // 根据ID查询详细信息
10 25 $get('/lineInformation/' + lineinformationId ,null, function(result){
11 26  
12   - console.log(result);
13   -
14   - $('.back-up').attr('href','/pages/base/lineinformation/list.html?lineId='+lineId);
  27 + // 获取返回元素并修改url地址
  28 + $('.back-up').attr('href','/pages/base/lineinformation/list.html?no='+lineId);
15 29  
  30 + // 获取表单元素下的元素设置属性值Disabled
16 31 $('input,select,textarea','#lineinformation_details_form').attr('Disabled','Disabled');
17 32  
18 33 // 如果不为空
19 34 if(result) {
20 35  
  36 + // 获取表单元素下的元素并设置值
21 37 putFormData(result, '#lineinformation_details_form');
22 38  
  39 + // 获取线路标注类型设置值
23 40 $('#typeInput').val(result.type);
24 41  
25 42 }
... ... @@ -29,11 +46,14 @@ $(function() {
29 46 } else {
30 47  
31 48 // 缺少ID
32   - layer.confirm('【ID缺失,请点击返回,重新进行查看线路标准信息详情操作】', {
33   - btn : [ '返回' ],icon: 3, title:'提示'
34   - }, function(index){
  49 + layer.confirm('【ID缺失,请点击返回,重新进行查看线路标准信息详情操作】', {btn : [ '返回' ],icon: 3, title:'提示'}, function(index){
  50 +
  51 + // 关闭弹出层
35 52 layer.close(index);
  53 +
  54 + // 返回list页面
36 55 loadPage('/pages/base/lineinformation/list.html');
  56 +
37 57 });
38 58  
39 59 }
... ...
src/main/resources/static/pages/base/lineinformation/js/lineinformation-edit-form.js
1 1 $(function() {
2 2  
3   - // 获取参数ID
4   - var lineinformationId = $.url().param('lineinformationId');
  3 + // 获取参数值
  4 + var noStr = $.url().param('no');
5 5  
6   - // 获取参数ID
7   - var lineId = $.url().param('lineId');
  6 + // 定义线路标准信息ID
  7 + var lineinformationId = '';
8 8  
9   - if(lineinformationId && lineId) {
  9 + // 定义线路ID
  10 + var lineId = '';
  11 +
  12 + // 如果参数值不为空
  13 + if(noStr) {
  14 +
  15 + // 切割参数值
  16 + var noArray = noStr.split('_');
  17 +
  18 + // 赋值线路标准ID
  19 + lineinformationId = noArray[0];
  20 +
  21 + // 赋值线路ID
  22 + lineId = noArray[1];
10 23  
11   - $('.back-up').attr('href','/pages/base/lineinformation/list.html?lineId='+lineId);
  24 + // 获取返回元素并修改url
  25 + $('.back-up').attr('href','/pages/base/lineinformation/list.html?no='+lineId);
12 26  
  27 + // 获取线路标准ID并设值
13 28 $('#lineinformationId').val(lineinformationId);
14 29  
15 30 // 根据ID查询详细信息
16 31 $get('/lineInformation/' + lineinformationId ,null, function(result){
17 32  
18   - console.log(result);
19   -
20 33 // 如果不为空
21 34 if(result) {
22 35  
  36 + // 获取线路标准类型并设值
23 37 $('#typeInput').val(result.type);
24 38  
  39 + // 获取表单元素下的元素并设值
25 40 putFormData(result, '#lineinformation_edit_form');
26 41  
  42 + // 获取线路ID元素并设值
  43 + $('#lineIdInput').val(lineId);
  44 +
27 45 }
28 46  
29 47 });
30 48  
31   - // 日期控件
  49 + // 早高峰开始时间(日期控件)
32 50 $('#earlyStartTimeInput').datetimepicker({
33 51  
  52 + // 格式
34 53 format : 'HH:mm',
35 54  
  55 + // 语言
36 56 locale: 'zh-cn',
37 57 });
38 58  
39   - // 日期控件
  59 + // 早高峰结束时间(日期控件)
40 60 $('#earlyEndTimeInput').datetimepicker({
41 61  
  62 + // 格式
42 63 format : 'HH:mm',
43 64  
44   - locale: 'zh-cn'
  65 + // 语言
  66 + locale: 'zh-cn',
45 67  
46 68 });
47 69  
48   - // 日期控件
  70 + // 晚高峰开始时间(日期控件)
49 71 $('#lateStartTimeInput').datetimepicker({
50 72  
  73 + // 格式
51 74 format : 'HH:mm',
52 75  
53   - locale: 'zh-cn'
  76 + // 语言
  77 + locale: 'zh-cn',
54 78  
55 79 });
56 80  
57   - // 日期控件
  81 + // 晚高峰结束时间(日期控件)
58 82 $('#lateEndTimeInput').datetimepicker({
59 83  
  84 + // 格式
60 85 format : 'HH:mm',
61 86  
62   - locale: 'zh-cn'
  87 + // 语言
  88 + locale: 'zh-cn',
63 89  
64 90 });
65 91  
66 92 // 定义表单
67   - var form = $('#lineinformation_add_form');
  93 + var form = $('#lineinformation_edit_form');
68 94  
69 95 // 定义表单异常
70 96 var error = $('.alert-danger',form);
... ... @@ -424,18 +450,19 @@ $(function() {
424 450 if(result.status=='SUCCESS') {
425 451  
426 452 // 弹出添加成功提示消息
427   - layer.msg('添加成功...');
  453 + layer.msg('修改成功...');
428 454  
429 455 } else if(result.status=='ERROR') {
430 456  
431 457 // 弹出添加失败提示消息
432   - layer.msg('添加失败...');
  458 + layer.msg('修改失败...');
433 459  
434 460 }
435 461 }
436 462  
437 463 // 返回list.html页面
438   - loadPage('lineinformation.html?lineId='+lineId);
  464 + loadPage('/pages/base/lineinformation/list.html?no='+lineId);
  465 +
439 466 });
440 467  
441 468 }
... ... @@ -451,18 +478,22 @@ $(function() {
451 478 // 手机正则表达式
452 479 var dateStr = /^(?:(?:0?|1)\d|2[0-3]):[0-5]\d$/;
453 480  
454   - return this.optional(element) || dateStr.test(value);
  481 + return this.optional(element) || dateStr.test(value);
  482 +
455 483 }, "请正确填写您的时间格式");
456 484  
457 485  
458 486 } else {
459 487  
460 488 // 缺少ID
461   - layer.confirm('【ID缺失,请点击返回,重新进行修改操作】', {
462   - btn : [ '返回' ],icon: 3, title:'提示'
463   - }, function(index){
  489 + layer.confirm('【ID缺失,请点击返回,重新进行修改操作】', {btn : [ '返回' ],icon: 3, title:'提示'}, function(index){
  490 +
  491 + // 关闭弹出层
464 492 layer.close(index);
  493 +
  494 + // 返回list页面
465 495 loadPage('/pages/base/lineinformation/list.html?lineId='+lineId);
  496 +
466 497 });
467 498  
468 499 }
... ...
src/main/resources/static/pages/base/lineinformation/js/lineinformation-list-table.js
... ... @@ -6,26 +6,33 @@ $(function(){
6 6 // 如果不为空
7 7 if(lineId) {
8 8  
9   - $('#lineinformation_add').attr('href','add.html?lineId='+lineId);
  9 + // 获取返回元素修改url
  10 + $('#lineinformation_add').attr('href','/pages/base/lineinformation/add.html?no='+lineId);
10 11  
  12 + // 根据线路标准ID查询详情
11 13 $get('/lineInformation',{'line.id_eq':lineId},function(result) {
12 14  
  15 + // 返回值长度
13 16 var len = result.content.length;
14 17  
15   - var tbodyHtml;
  18 + // html文本
  19 + var tbodyHtml = '';
16 20  
  21 + // 判断长度
17 22 if(len>0) {
18 23  
19 24 // 先一个线路对应一个线路标准
20 25 $('#lineinformation_add').hide();
21 26  
  27 + // 模版
22 28 tbodyHtml = template('lineinformation_table_temp',{list : result.content});
23 29  
24 30 } else {
25 31  
26 32 tbodyHtml = '<tr><td colspan=9><h6 class="muted">没有找到相关数据</h6></td></tr>'
27 33 }
28   -
  34 +
  35 + // 获取表格元素并插入htnl代码
29 36 $('#datatable_lineinformation tbody').html(tbodyHtml);
30 37  
31 38 });
... ... @@ -34,11 +41,14 @@ $(function(){
34 41 } else {
35 42  
36 43 // 缺少ID
37   - layer.confirm('【ID缺失,请点击返回,重新进行查看线路标准信息操作】', {
38   - btn : [ '返回' ],icon: 3, title:'提示'
39   - }, function(index){
  44 + layer.confirm('【ID缺失,请点击返回,重新进行查看线路标准信息操作】', {btn : [ '返回' ],icon: 3, title:'提示'}, function(index){
  45 +
  46 + // 关闭弹出层
40 47 layer.close(index);
  48 +
  49 + // 返回list页面
41 50 loadPage('/pages/base/line/list.html');
  51 +
42 52 });
43 53 }
44 54  
... ...
src/main/resources/static/pages/base/lineinformation/list.html
... ... @@ -21,10 +21,10 @@
21 21 </div>
22 22 <div class="actions">
23 23 <div class="btn-group btn-group-devided" data-toggle="buttons">
24   - <a class="btn btn-circle blue" href="add.html" id="lineinformation_add" data-pjax><i class="fa fa-plus"></i> 添加线路标准信息</a>
  24 + <a class="btn btn-circle blue" href="/pages/base/lineinformation/add.html" id="lineinformation_add" data-pjax><i class="fa fa-plus"></i> 添加线路标准信息</a>
25 25 </div>
26 26 <div class="btn-group btn-group-devided" data-toggle="buttons">
27   - <a class="btn btn-circle blue" href="/pages/base/line/list.html" data-pjax><i class="fa fa-reply"></i> 返回</a>
  27 + <a class="btn btn-circle default" href="/pages/base/line/list.html" style="float: right;padding: 4px 23px;" data-pjax><i class="fa fa-reply"></i> 返回</a>
28 28 </div>
29 29 </div>
30 30 </div>
... ... @@ -43,46 +43,6 @@
43 43 <th width="10%">下行行驶时间</th>
44 44 <th width="15%">操作</th>
45 45 </tr>
46   - <!--
47   - <tr role="row" class="filter">
48   - <td></td>
49   - <td>
50   - <input type="text" class="form-control form-filter input-sm" name="lineCode">
51   - </td>
52   - <td>
53   - <input type="text" class="form-control form-filter input-sm" name="name">
54   - </td>
55   - <td>
56   - <select name="type" class="form-control" id="typeInput">
57   - <option value="">请选择...</option>
58   - <option value="zc">正常</option>
59   - <option value="qj">区间</option>
60   - <option value="fk">放空</option>
61   - </select>
62   - </td>
63   - <td>
64   - <input type="text" class="form-control form-filter input-sm" name="name">
65   - </td>
66   - <td>
67   - <input type="text" class="form-control form-filter input-sm" name="name">
68   - </td>
69   - <td>
70   - <input type="text" class="form-control form-filter input-sm" name="name">
71   - </td>
72   - <td>
73   - <input type="text" class="form-control form-filter input-sm" name="name">
74   - </td>
75   - <td>
76   - <button class="btn btn-sm green btn-outline filter-submit margin-bottom" >
77   - <i class="fa fa-search"></i> 搜索
78   - </button>
79   -
80   - <button class="btn btn-sm red btn-outline filter-cancel">
81   - <i class="fa fa-times"></i> 重置
82   - </button>
83   - </td>
84   - </tr>
85   - -->
86 46 </thead>
87 47 <tbody></tbody>
88 48 </table>
... ... @@ -122,8 +82,8 @@
122 82 {{obj.downTravelTime}}
123 83 </td>
124 84 <td>
125   - <a href="details.html?lineinformationId={{obj.id}}&lineId={{obj.line.id}}" class="btn default blue-stripe btn-sm" data-pjax> 详细 </a>
126   - <a href="edit.html?lineinformationId={{obj.id}}&lineId={{obj.line.id}}" class="btn default blue-stripe btn-sm" data-pjax> 修改 </a>
  85 + <a href="details.html?no={{obj.id}}_{{obj.line.id}}" class="btn default blue-stripe btn-sm" data-pjax> 详细 </a>
  86 + <a href="edit.html?no={{obj.id}}_{{obj.line.id}}" class="btn default blue-stripe btn-sm" data-pjax> 修改 </a>
127 87 </td>
128 88 </tr>
129 89 {{/each}}
... ...