Commit 86f627b1bb4952fc67f08d1a5317cce7b26488d4

Authored by 李强
1 parent 1106efac

线路信息与线路标准信息页面修改

src/main/java/com/bsth/entity/Line.java
... ... @@ -7,6 +7,7 @@ import javax.persistence.Entity;
7 7 import javax.persistence.GeneratedValue;
8 8 import javax.persistence.GenerationType;
9 9 import javax.persistence.Id;
  10 +import javax.persistence.OneToMany;
10 11 import javax.persistence.OneToOne;
11 12 import javax.persistence.Table;
12 13  
... ... @@ -140,10 +141,6 @@ public class Line {
140 141 // 修改日期
141 142 @Column(name = "update_date", columnDefinition = "TIMESTAMP DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP")
142 143 private Date updateDate;
143   -
144   - // 线路标准信息
145   - @OneToOne
146   - private LineInformation lineInformation;
147 144  
148 145 public Integer getId() {
149 146 return id;
... ... @@ -424,12 +421,4 @@ public class Line {
424 421 public void setUpdateDate(Date updateDate) {
425 422 this.updateDate = updateDate;
426 423 }
427   -
428   - public LineInformation getLineInformation() {
429   - return lineInformation;
430   - }
431   -
432   - public void setLineInformation(LineInformation lineInformation) {
433   - this.lineInformation = lineInformation;
434   - }
435 424 }
... ...
src/main/java/com/bsth/entity/LineInformation.java
... ... @@ -7,6 +7,7 @@ import javax.persistence.Entity;
7 7 import javax.persistence.GeneratedValue;
8 8 import javax.persistence.GenerationType;
9 9 import javax.persistence.Id;
  10 +import javax.persistence.ManyToOne;
10 11 import javax.persistence.Table;
11 12  
12 13 /**
... ... @@ -158,6 +159,9 @@ public class LineInformation {
158 159 @Column(name = "update_date", columnDefinition = "timestamp DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP")
159 160 private Date updateDate;
160 161  
  162 + @ManyToOne
  163 + private Line line;
  164 +
161 165 public Integer getId() {
162 166 return id;
163 167 }
... ... @@ -500,5 +504,13 @@ public class LineInformation {
500 504  
501 505 public void setUpdateDate(Date updateDate) {
502 506 this.updateDate = updateDate;
503   - }
  507 + }
  508 +
  509 + public Line getLine() {
  510 + return line;
  511 + }
  512 +
  513 + public void setLine(Line line) {
  514 + this.line = line;
  515 + }
504 516 }
... ...
src/main/resources/static/pages/base/line/details.html
... ... @@ -19,6 +19,11 @@
19 19 <i class="fa fa-info-circle font-dark"></i>
20 20 <span class="caption-subject font-dark sbold uppercase">线路详情</span>
21 21 </div>
  22 + <div class="actions">
  23 + <div class="btn-group btn-group-devided" data-toggle="buttons">
  24 + <a class="btn btn-circle blue" href="list.html" data-pjax><i class="fa fa-reply"></i> 返回</a>
  25 + </div>
  26 + </div>
22 27 </div>
23 28 <div class="portlet-body">
24 29 <div class="table-container" style="margin-top: 10px">
... ...
src/main/resources/static/pages/base/line/js/line-list-table.js
... ... @@ -122,6 +122,8 @@
122 122 }
123 123 });
124 124 page = 0;
  125 +
  126 + console.log(params);
125 127 loadTableDate(params,true);
126 128 });
127 129  
... ...
src/main/resources/static/pages/base/line/list.html
... ... @@ -44,19 +44,19 @@
44 44 <tr role="row" class="filter">
45 45 <td></td>
46 46 <td>
47   - <input type="text" class="form-control form-filter input-sm" name="lineCode">
  47 + <input type="text" class="form-control form-filter input-sm" name="lineCode_eq">
48 48 </td>
49 49 <td>
50   - <input type="text" class="form-control form-filter input-sm" name="name">
  50 + <input type="text" class="form-control form-filter input-sm" name="name_like">
51 51 </td>
52 52 <td>
53   - <select name="company" class="form-control" id="companySelect"></select>
  53 + <select name="company_eq" class="form-control" id="companySelect"></select>
54 54 </td>
55 55 <td>
56   - <select name="brancheCompany" class="form-control" id="brancheCompanySelect"></select>
  56 + <select name="brancheCompany_eq" class="form-control" id="brancheCompanySelect"></select>
57 57 </td>
58 58 <td>
59   - <select name="nature" class="form-control" id="natureSelect">
  59 + <select name="nature_like" class="form-control" id="natureSelect">
60 60 <option value="">请选择...</option>
61 61 <option value="lj">路救</option>
62 62 <option value="bc">备车</option>
... ... @@ -71,7 +71,7 @@
71 71 </select>
72 72 </td>
73 73 <td>
74   - <select name="level" class="form-control" id="levelSelect">
  74 + <select name="level_eq" class="form-control" id="levelSelect">
75 75 <option value="">请选择...</option>
76 76 <option value="1">一级线路</option>
77 77 <option value="2">二级线路</option>
... ... @@ -79,10 +79,10 @@
79 79 </select>
80 80 </td>
81 81 <td>
82   - <input type="text" class="form-control form-filter input-sm" name="shanghaiLinecode">
  82 + <input type="text" class="form-control form-filter input-sm" name="shanghaiLinecode_eq">
83 83 </td>
84 84 <td>
85   - <select class="form-control form-filter " name="destroy">
  85 + <select class="form-control form-filter " name="destroy_eq">
86 86 <option value="">请选择...</option>
87 87 <option value="1">运营</option>
88 88 <option value="0">撤销</option>
... ... @@ -142,7 +142,7 @@
142 142 {{obj.destroy}}
143 143 </td>
144 144 <td>
145   - <a href="lineinformation/lineinformation.html?lineId={{obj.id}}" class="btn default blue-stripe btn-sm" data-pjax> 查看 </a>
  145 + <a href="/pages/base/lineinformation/list.html?lineId={{obj.id}}" class="btn default blue-stripe btn-sm" data-pjax> 查看 </a>
146 146 </td>
147 147 <td>
148 148 <a href="details.html?lineId={{obj.id}}" class="btn default blue-stripe btn-sm" data-pjax> 详细 </a>
... ... @@ -156,4 +156,4 @@
156 156 </tr>
157 157 {{/if}}
158 158 </script>
159   -<script src="/pages/base/line/js/line-list-table.js"></script>
160 159 \ No newline at end of file
  160 +<script src="/pages/base/line/js/line-list-table.js"></script>
... ...
src/main/resources/static/pages/base/line/lineinformation/lineinformation_add.html renamed to src/main/resources/static/pages/base/lineinformation/add.html
... ... @@ -50,7 +50,7 @@
50 50 <option value="zc">正常</option>
51 51 <option value="qj">区间</option>
52 52 <option value="fk">放空</option>
53   - </select>
  53 + </select>
54 54 </div>
55 55 </div>
56 56  
... ... @@ -389,4 +389,4 @@
389 389 </form>
390 390 </div>
391 391 </div>
392   -<script src="/pages/base/line/js/lineinformation-add-form.js"></script>
393 392 \ No newline at end of file
  393 +<script src="/pages/base/lineinformation/js/lineinformation-add-form.js"></script>
394 394 \ No newline at end of file
... ...
src/main/resources/static/pages/base/line/js/lineinformation-add-form.js renamed to src/main/resources/static/pages/base/lineinformation/js/lineinformation-add-form.js
... ... @@ -5,10 +5,22 @@ $(function(){
5 5  
6 6 if(lineId) {
7 7  
8   - $('.lineinformation_back').attr('href','/pages/base/line/lineinformation/lineinformation.html?lineId='+lineId);
  8 + $('.lineinformation_back').attr('href','/pages/base/lineinformation/list.html?lineId='+lineId);
9 9  
10 10 $('#lineIdInput').val(lineId);
11 11  
  12 + // 早高峰开始时间
  13 + $('#earlyStartTimeInput').val('06:31');
  14 +
  15 + // 早高峰结束时间
  16 + $('#earlyEndTimeInput').val('08:30');
  17 +
  18 + // 晚高峰开始时间
  19 + $('#lateStartTimeInput').val('16:01');
  20 +
  21 + // 晚高峰结束时间
  22 + $('#lateEndTimeInput').val('18:30');
  23 +
12 24 // 日期控件
13 25 $('#earlyStartTimeInput').datetimepicker({
14 26  
... ... @@ -443,7 +455,7 @@ $(function(){
443 455 btn : [ '返回' ],icon: 3, title:'提示'
444 456 }, function(index){
445 457 layer.close(index);
446   - loadPage('lineinformation.html');
  458 + loadPage('/pages/base/lineinformation/list.html?lineId='+lineId);
447 459 });
448 460 }
449 461  
... ...
src/main/resources/static/pages/base/line/js/lineinformation-list-table.js renamed to src/main/resources/static/pages/base/lineinformation/js/lineinformation-list-table.js
... ... @@ -3,30 +3,31 @@ $(function(){
3 3 // 获取参数ID
4 4 var lineId = $.url().param('lineId');
5 5  
  6 + // 如果不为空
6 7 if(lineId) {
7 8  
8   - $('#lineinformation_add').attr('href','lineinformation_add.html?lineId='+lineId);
  9 + $('#lineinformation_add').attr('href','add.html?lineId='+lineId);
9 10  
10   - $.get('/line',{id_eq:lineId},function(result){
  11 + $get('/lineInformation',{'line.id_eq':lineId},function(result) {
11 12  
12   - if(result) {
  13 + var len = result.content.length;
  14 +
  15 + var tbodyHtml;
  16 +
  17 + if(len>0) {
13 18  
14   - var tbodyHtml;
  19 + // 先一个线路对应一个线路标准
  20 + $('#lineinformation_add').hide();
15 21  
16   - if(result.lineInformation) {
17   -
18   - tbodyHtml = template('lineinformation_table_temp',{list:result.content});
19   -
20   - } else {
21   -
22   - tbodyHtml = '<tr><td colspan=9><h6 class="muted">没有找到相关数据</h6></td></tr>'
23   -
24   - }
  22 + tbodyHtml = template('lineinformation_table_temp',{list : result.content});
25 23  
26   - $('#datatable_lineinformation tbody').html(tbodyHtml);
  24 + } else {
27 25  
  26 + tbodyHtml = '<tr><td colspan=9><h6 class="muted">没有找到相关数据</h6></td></tr>'
28 27 }
29   -
  28 +
  29 + $('#datatable_lineinformation tbody').html(tbodyHtml);
  30 +
30 31 });
31 32  
32 33  
... ... @@ -37,7 +38,7 @@ $(function(){
37 38 btn : [ '返回' ],icon: 3, title:'提示'
38 39 }, function(index){
39 40 layer.close(index);
40   - loadPage('list.html');
  41 + loadPage('/pages/base/line/list.html');
41 42 });
42 43 }
43 44  
... ...
src/main/resources/static/pages/base/line/lineinformation/lineinformation.html renamed to src/main/resources/static/pages/base/lineinformation/list.html
... ... @@ -21,7 +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="lineinformation_add.html" id="lineinformation_add" data-pjax><i class="fa fa-plus"></i> 添加线路标准信息</a>
  24 + <a class="btn btn-circle blue" href="add.html" id="lineinformation_add" data-pjax><i class="fa fa-plus"></i> 添加线路标准信息</a>
  25 + </div>
  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>
25 28 </div>
26 29 </div>
27 30 </div>
... ... @@ -40,6 +43,7 @@
40 43 <th width="10%">下行行驶时间</th>
41 44 <th width="15%">操作</th>
42 45 </tr>
  46 + <!--
43 47 <tr role="row" class="filter">
44 48 <td></td>
45 49 <td>
... ... @@ -49,11 +53,12 @@
49 53 <input type="text" class="form-control form-filter input-sm" name="name">
50 54 </td>
51 55 <td>
52   - <select class="form-control form-filter " name="destroy">
53   - <option value="">请选择...</option>
54   - <option value="1">运营</option>
55   - <option value="0">撤销</option>
56   - </select>
  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>
57 62 </td>
58 63 <td>
59 64 <input type="text" class="form-control form-filter input-sm" name="name">
... ... @@ -77,6 +82,7 @@
77 82 </button>
78 83 </td>
79 84 </tr>
  85 + -->
80 86 </thead>
81 87 <tbody></tbody>
82 88 </table>
... ... @@ -92,34 +98,34 @@
92 98 {{each list as obj i }}
93 99 <tr>
94 100 <td style="vertical-align: middle;">
95   - <input type="checkbox" class="group-checkable icheck" data-id="{{obj.lineInformation.id}}">
  101 + <input type="checkbox" class="group-checkable icheck" data-id="{{obj.id}}">
96 102 </td>
97 103 <td>
98   - {{obj.lineCode}}
  104 + {{obj.line.lineCode}}
99 105 </td>
100 106 <td>
101   - {{obj.name}}
  107 + {{obj.line.name}}
102 108 </td>
103 109 <td>
104   - {{obj.lineInformation.type}}
  110 + {{obj.type}}
105 111 </td>
106 112 <td>
107   - {{obj.lineInformation.upMileage}}
  113 + {{obj.upMileage}}
108 114 </td>
109 115 <td>
110   - {{obj.lineInformation.downMileage}}
  116 + {{obj.downMileage}}
111 117 </td>
112 118 <td>
113   - {{obj.lineInformation.upTravelTime}}
  119 + {{obj.upTravelTime}}
114 120 </td>
115 121 <td>
116   - {{obj.lineInformation.downTravelTime}}
  122 + {{obj.downTravelTime}}
117 123 </td>
118 124 <td>
119   - <a href="details.html?lineId={{obj.lineInformation.id}}" class="btn default blue-stripe btn-sm" data-pjax> 详细 </a>
120   - <a href="edit.html?lineId={{obj.lineInformation.id}}" class="btn default blue-stripe btn-sm" data-pjax> 修改 </a>
  125 + <a href="details.html?lineId={{obj.id}}" class="btn default blue-stripe btn-sm" data-pjax> 详细 </a>
  126 + <a href="edit.html?lineId={{obj.id}}" class="btn default blue-stripe btn-sm" data-pjax> 修改 </a>
121 127 </td>
122 128 </tr>
123 129 {{/each}}
124 130 </script>
125   -<script src="/pages/base/line/js/lineinformation-list-table.js"></script>
126 131 \ No newline at end of file
  132 +<script src="/pages/base/lineinformation/js/lineinformation-list-table.js"></script>
127 133 \ No newline at end of file
... ...