Commit 86f627b1bb4952fc67f08d1a5317cce7b26488d4
1 parent
1106efac
线路信息与线路标准信息页面修改
Showing
9 changed files
with
87 additions
and
60 deletions
src/main/java/com/bsth/entity/Line.java
| @@ -7,6 +7,7 @@ import javax.persistence.Entity; | @@ -7,6 +7,7 @@ import javax.persistence.Entity; | ||
| 7 | import javax.persistence.GeneratedValue; | 7 | import javax.persistence.GeneratedValue; |
| 8 | import javax.persistence.GenerationType; | 8 | import javax.persistence.GenerationType; |
| 9 | import javax.persistence.Id; | 9 | import javax.persistence.Id; |
| 10 | +import javax.persistence.OneToMany; | ||
| 10 | import javax.persistence.OneToOne; | 11 | import javax.persistence.OneToOne; |
| 11 | import javax.persistence.Table; | 12 | import javax.persistence.Table; |
| 12 | 13 | ||
| @@ -140,10 +141,6 @@ public class Line { | @@ -140,10 +141,6 @@ public class Line { | ||
| 140 | // 修改日期 | 141 | // 修改日期 |
| 141 | @Column(name = "update_date", columnDefinition = "TIMESTAMP DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP") | 142 | @Column(name = "update_date", columnDefinition = "TIMESTAMP DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP") |
| 142 | private Date updateDate; | 143 | private Date updateDate; |
| 143 | - | ||
| 144 | - // 线路标准信息 | ||
| 145 | - @OneToOne | ||
| 146 | - private LineInformation lineInformation; | ||
| 147 | 144 | ||
| 148 | public Integer getId() { | 145 | public Integer getId() { |
| 149 | return id; | 146 | return id; |
| @@ -424,12 +421,4 @@ public class Line { | @@ -424,12 +421,4 @@ public class Line { | ||
| 424 | public void setUpdateDate(Date updateDate) { | 421 | public void setUpdateDate(Date updateDate) { |
| 425 | this.updateDate = updateDate; | 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,6 +7,7 @@ import javax.persistence.Entity; | ||
| 7 | import javax.persistence.GeneratedValue; | 7 | import javax.persistence.GeneratedValue; |
| 8 | import javax.persistence.GenerationType; | 8 | import javax.persistence.GenerationType; |
| 9 | import javax.persistence.Id; | 9 | import javax.persistence.Id; |
| 10 | +import javax.persistence.ManyToOne; | ||
| 10 | import javax.persistence.Table; | 11 | import javax.persistence.Table; |
| 11 | 12 | ||
| 12 | /** | 13 | /** |
| @@ -158,6 +159,9 @@ public class LineInformation { | @@ -158,6 +159,9 @@ public class LineInformation { | ||
| 158 | @Column(name = "update_date", columnDefinition = "timestamp DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP") | 159 | @Column(name = "update_date", columnDefinition = "timestamp DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP") |
| 159 | private Date updateDate; | 160 | private Date updateDate; |
| 160 | 161 | ||
| 162 | + @ManyToOne | ||
| 163 | + private Line line; | ||
| 164 | + | ||
| 161 | public Integer getId() { | 165 | public Integer getId() { |
| 162 | return id; | 166 | return id; |
| 163 | } | 167 | } |
| @@ -500,5 +504,13 @@ public class LineInformation { | @@ -500,5 +504,13 @@ public class LineInformation { | ||
| 500 | 504 | ||
| 501 | public void setUpdateDate(Date updateDate) { | 505 | public void setUpdateDate(Date updateDate) { |
| 502 | this.updateDate = updateDate; | 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,6 +19,11 @@ | ||
| 19 | <i class="fa fa-info-circle font-dark"></i> | 19 | <i class="fa fa-info-circle font-dark"></i> |
| 20 | <span class="caption-subject font-dark sbold uppercase">线路详情</span> | 20 | <span class="caption-subject font-dark sbold uppercase">线路详情</span> |
| 21 | </div> | 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 | </div> | 27 | </div> |
| 23 | <div class="portlet-body"> | 28 | <div class="portlet-body"> |
| 24 | <div class="table-container" style="margin-top: 10px"> | 29 | <div class="table-container" style="margin-top: 10px"> |
src/main/resources/static/pages/base/line/js/line-list-table.js
src/main/resources/static/pages/base/line/list.html
| @@ -44,19 +44,19 @@ | @@ -44,19 +44,19 @@ | ||
| 44 | <tr role="row" class="filter"> | 44 | <tr role="row" class="filter"> |
| 45 | <td></td> | 45 | <td></td> |
| 46 | <td> | 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 | </td> | 48 | </td> |
| 49 | <td> | 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 | </td> | 51 | </td> |
| 52 | <td> | 52 | <td> |
| 53 | - <select name="company" class="form-control" id="companySelect"></select> | 53 | + <select name="company_eq" class="form-control" id="companySelect"></select> |
| 54 | </td> | 54 | </td> |
| 55 | <td> | 55 | <td> |
| 56 | - <select name="brancheCompany" class="form-control" id="brancheCompanySelect"></select> | 56 | + <select name="brancheCompany_eq" class="form-control" id="brancheCompanySelect"></select> |
| 57 | </td> | 57 | </td> |
| 58 | <td> | 58 | <td> |
| 59 | - <select name="nature" class="form-control" id="natureSelect"> | 59 | + <select name="nature_like" class="form-control" id="natureSelect"> |
| 60 | <option value="">请选择...</option> | 60 | <option value="">请选择...</option> |
| 61 | <option value="lj">路救</option> | 61 | <option value="lj">路救</option> |
| 62 | <option value="bc">备车</option> | 62 | <option value="bc">备车</option> |
| @@ -71,7 +71,7 @@ | @@ -71,7 +71,7 @@ | ||
| 71 | </select> | 71 | </select> |
| 72 | </td> | 72 | </td> |
| 73 | <td> | 73 | <td> |
| 74 | - <select name="level" class="form-control" id="levelSelect"> | 74 | + <select name="level_eq" class="form-control" id="levelSelect"> |
| 75 | <option value="">请选择...</option> | 75 | <option value="">请选择...</option> |
| 76 | <option value="1">一级线路</option> | 76 | <option value="1">一级线路</option> |
| 77 | <option value="2">二级线路</option> | 77 | <option value="2">二级线路</option> |
| @@ -79,10 +79,10 @@ | @@ -79,10 +79,10 @@ | ||
| 79 | </select> | 79 | </select> |
| 80 | </td> | 80 | </td> |
| 81 | <td> | 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 | </td> | 83 | </td> |
| 84 | <td> | 84 | <td> |
| 85 | - <select class="form-control form-filter " name="destroy"> | 85 | + <select class="form-control form-filter " name="destroy_eq"> |
| 86 | <option value="">请选择...</option> | 86 | <option value="">请选择...</option> |
| 87 | <option value="1">运营</option> | 87 | <option value="1">运营</option> |
| 88 | <option value="0">撤销</option> | 88 | <option value="0">撤销</option> |
| @@ -142,7 +142,7 @@ | @@ -142,7 +142,7 @@ | ||
| 142 | {{obj.destroy}} | 142 | {{obj.destroy}} |
| 143 | </td> | 143 | </td> |
| 144 | <td> | 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 | </td> | 146 | </td> |
| 147 | <td> | 147 | <td> |
| 148 | <a href="details.html?lineId={{obj.id}}" class="btn default blue-stripe btn-sm" data-pjax> 详细 </a> | 148 | <a href="details.html?lineId={{obj.id}}" class="btn default blue-stripe btn-sm" data-pjax> 详细 </a> |
| @@ -156,4 +156,4 @@ | @@ -156,4 +156,4 @@ | ||
| 156 | </tr> | 156 | </tr> |
| 157 | {{/if}} | 157 | {{/if}} |
| 158 | </script> | 158 | </script> |
| 159 | -<script src="/pages/base/line/js/line-list-table.js"></script> | ||
| 160 | \ No newline at end of file | 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,7 +50,7 @@ | ||
| 50 | <option value="zc">正常</option> | 50 | <option value="zc">正常</option> |
| 51 | <option value="qj">区间</option> | 51 | <option value="qj">区间</option> |
| 52 | <option value="fk">放空</option> | 52 | <option value="fk">放空</option> |
| 53 | - </select> | 53 | + </select> |
| 54 | </div> | 54 | </div> |
| 55 | </div> | 55 | </div> |
| 56 | 56 | ||
| @@ -389,4 +389,4 @@ | @@ -389,4 +389,4 @@ | ||
| 389 | </form> | 389 | </form> |
| 390 | </div> | 390 | </div> |
| 391 | </div> | 391 | </div> |
| 392 | -<script src="/pages/base/line/js/lineinformation-add-form.js"></script> | ||
| 393 | \ No newline at end of file | 392 | \ No newline at end of file |
| 393 | +<script src="/pages/base/lineinformation/js/lineinformation-add-form.js"></script> | ||
| 394 | \ No newline at end of file | 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,10 +5,22 @@ $(function(){ | ||
| 5 | 5 | ||
| 6 | if(lineId) { | 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 | $('#lineIdInput').val(lineId); | 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 | $('#earlyStartTimeInput').datetimepicker({ | 25 | $('#earlyStartTimeInput').datetimepicker({ |
| 14 | 26 | ||
| @@ -443,7 +455,7 @@ $(function(){ | @@ -443,7 +455,7 @@ $(function(){ | ||
| 443 | btn : [ '返回' ],icon: 3, title:'提示' | 455 | btn : [ '返回' ],icon: 3, title:'提示' |
| 444 | }, function(index){ | 456 | }, function(index){ |
| 445 | layer.close(index); | 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,30 +3,31 @@ $(function(){ | ||
| 3 | // 获取参数ID | 3 | // 获取参数ID |
| 4 | var lineId = $.url().param('lineId'); | 4 | var lineId = $.url().param('lineId'); |
| 5 | 5 | ||
| 6 | + // 如果不为空 | ||
| 6 | if(lineId) { | 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,7 +38,7 @@ $(function(){ | ||
| 37 | btn : [ '返回' ],icon: 3, title:'提示' | 38 | btn : [ '返回' ],icon: 3, title:'提示' |
| 38 | }, function(index){ | 39 | }, function(index){ |
| 39 | layer.close(index); | 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,7 +21,10 @@ | ||
| 21 | </div> | 21 | </div> |
| 22 | <div class="actions"> | 22 | <div class="actions"> |
| 23 | <div class="btn-group btn-group-devided" data-toggle="buttons"> | 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 | </div> | 28 | </div> |
| 26 | </div> | 29 | </div> |
| 27 | </div> | 30 | </div> |
| @@ -40,6 +43,7 @@ | @@ -40,6 +43,7 @@ | ||
| 40 | <th width="10%">下行行驶时间</th> | 43 | <th width="10%">下行行驶时间</th> |
| 41 | <th width="15%">操作</th> | 44 | <th width="15%">操作</th> |
| 42 | </tr> | 45 | </tr> |
| 46 | + <!-- | ||
| 43 | <tr role="row" class="filter"> | 47 | <tr role="row" class="filter"> |
| 44 | <td></td> | 48 | <td></td> |
| 45 | <td> | 49 | <td> |
| @@ -49,11 +53,12 @@ | @@ -49,11 +53,12 @@ | ||
| 49 | <input type="text" class="form-control form-filter input-sm" name="name"> | 53 | <input type="text" class="form-control form-filter input-sm" name="name"> |
| 50 | </td> | 54 | </td> |
| 51 | <td> | 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 | </td> | 62 | </td> |
| 58 | <td> | 63 | <td> |
| 59 | <input type="text" class="form-control form-filter input-sm" name="name"> | 64 | <input type="text" class="form-control form-filter input-sm" name="name"> |
| @@ -77,6 +82,7 @@ | @@ -77,6 +82,7 @@ | ||
| 77 | </button> | 82 | </button> |
| 78 | </td> | 83 | </td> |
| 79 | </tr> | 84 | </tr> |
| 85 | + --> | ||
| 80 | </thead> | 86 | </thead> |
| 81 | <tbody></tbody> | 87 | <tbody></tbody> |
| 82 | </table> | 88 | </table> |
| @@ -92,34 +98,34 @@ | @@ -92,34 +98,34 @@ | ||
| 92 | {{each list as obj i }} | 98 | {{each list as obj i }} |
| 93 | <tr> | 99 | <tr> |
| 94 | <td style="vertical-align: middle;"> | 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 | </td> | 102 | </td> |
| 97 | <td> | 103 | <td> |
| 98 | - {{obj.lineCode}} | 104 | + {{obj.line.lineCode}} |
| 99 | </td> | 105 | </td> |
| 100 | <td> | 106 | <td> |
| 101 | - {{obj.name}} | 107 | + {{obj.line.name}} |
| 102 | </td> | 108 | </td> |
| 103 | <td> | 109 | <td> |
| 104 | - {{obj.lineInformation.type}} | 110 | + {{obj.type}} |
| 105 | </td> | 111 | </td> |
| 106 | <td> | 112 | <td> |
| 107 | - {{obj.lineInformation.upMileage}} | 113 | + {{obj.upMileage}} |
| 108 | </td> | 114 | </td> |
| 109 | <td> | 115 | <td> |
| 110 | - {{obj.lineInformation.downMileage}} | 116 | + {{obj.downMileage}} |
| 111 | </td> | 117 | </td> |
| 112 | <td> | 118 | <td> |
| 113 | - {{obj.lineInformation.upTravelTime}} | 119 | + {{obj.upTravelTime}} |
| 114 | </td> | 120 | </td> |
| 115 | <td> | 121 | <td> |
| 116 | - {{obj.lineInformation.downTravelTime}} | 122 | + {{obj.downTravelTime}} |
| 117 | </td> | 123 | </td> |
| 118 | <td> | 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 | </td> | 127 | </td> |
| 122 | </tr> | 128 | </tr> |
| 123 | {{/each}} | 129 | {{/each}} |
| 124 | </script> | 130 | </script> |
| 125 | -<script src="/pages/base/line/js/lineinformation-list-table.js"></script> | ||
| 126 | \ No newline at end of file | 131 | \ No newline at end of file |
| 132 | +<script src="/pages/base/lineinformation/js/lineinformation-list-table.js"></script> | ||
| 127 | \ No newline at end of file | 133 | \ No newline at end of file |