Commit 228a199d2e6b7beef2be40c2502146acd19baf13
Merge branch 'minhang' of http://222.66.0.204:8090/panzhaov5/bsth_control into minhang
Showing
3 changed files
with
24 additions
and
27 deletions
src/main/resources/static/pages/base/interval/edit.html
| ... | ... | @@ -49,7 +49,7 @@ |
| 49 | 49 | <div class="col-md-12" style="margin-top:10px"> |
| 50 | 50 | <label class="control-label col-md-5"> 间隔等级 :</label> |
| 51 | 51 | <div class="col-md-4"> |
| 52 | - <input type="text" class="form-control" name="level" id="levelInput" placeholder="间隔等级"> | |
| 52 | + <input type="text" class="form-control" name="level" id="levelInput" placeholder="间隔等级" readonly> | |
| 53 | 53 | </div> |
| 54 | 54 | </div> |
| 55 | 55 | ... | ... |
src/main/resources/static/pages/base/interval/js/interval-list-table.js
| ... | ... | @@ -114,6 +114,25 @@ |
| 114 | 114 | // 把数据填充到模版中 |
| 115 | 115 | var tbodyHtml = template('interval_list_temp',{list:result.content}); |
| 116 | 116 | $('#datatable_interval tbody').html(tbodyHtml); |
| 117 | + /** | |
| 118 | + * 绑定删除事件。 | |
| 119 | + */ | |
| 120 | + $(".delete").click(function(){ | |
| 121 | + var intervalId = $(this).data('id'); | |
| 122 | + layer.confirm('是否要删除间隔信息?', { | |
| 123 | + btn: ['确定','取消'] //按钮 | |
| 124 | + }, function(){ | |
| 125 | + $.ajax({ | |
| 126 | + url: '/interval/' + intervalId, | |
| 127 | + type: 'DELETE', | |
| 128 | + success: function(result) { | |
| 129 | + window.location.href = 'list.html'; | |
| 130 | + } | |
| 131 | + }); | |
| 132 | + }, function(){ | |
| 133 | + }); | |
| 134 | + }); | |
| 135 | + | |
| 117 | 136 | // 是重新分页且返回数据长度大于0 |
| 118 | 137 | if(isPon && result.content.length > 0){ |
| 119 | 138 | // 重新分页 |
| ... | ... | @@ -154,4 +173,5 @@ |
| 154 | 173 | } |
| 155 | 174 | }); |
| 156 | 175 | } |
| 176 | + | |
| 157 | 177 | })(); |
| 158 | 178 | \ No newline at end of file | ... | ... |
src/main/resources/static/pages/base/interval/list.html
| ... | ... | @@ -25,7 +25,7 @@ |
| 25 | 25 | <span class="caption-subject font-dark sbold uppercase">间隔信息</span> |
| 26 | 26 | </div> |
| 27 | 27 | <div class="actions"> |
| 28 | - <div class="btn-group btn-group-devided" data-toggle="buttons"> | |
| 28 | + <div class="btn-group btn-group-devided" data-toggle="buttons" style="display:none"> | |
| 29 | 29 | <a class="btn btn-circle blue" href="add.html" data-pjax><i class="fa fa-plus"></i> 添加间隔信息</a> |
| 30 | 30 | </div> |
| 31 | 31 | </div> |
| ... | ... | @@ -36,7 +36,6 @@ |
| 36 | 36 | <thead> |
| 37 | 37 | <tr role="row" class="heading"> |
| 38 | 38 | <th >序号</th> |
| 39 | - <th >间隔ID</th> | |
| 40 | 39 | <th >间隔等级</th> |
| 41 | 40 | <th >高峰间隔时间</th> |
| 42 | 41 | <th >低谷间隔时间</th> |
| ... | ... | @@ -47,7 +46,6 @@ |
| 47 | 46 | <td></td> |
| 48 | 47 | <td></td> |
| 49 | 48 | <td></td> |
| 50 | - <td></td> | |
| 51 | 49 | <td> |
| 52 | 50 | <button class="btn btn-sm green btn-outline filter-submit margin-bottom" > |
| 53 | 51 | <i class="fa fa-search"></i> 搜索 |
| ... | ... | @@ -76,9 +74,6 @@ |
| 76 | 74 | {{(list.page*10)+(i+1)}} |
| 77 | 75 | </td> |
| 78 | 76 | <td> |
| 79 | - {{obj.id}} | |
| 80 | - </td> | |
| 81 | - <td> | |
| 82 | 77 | {{obj.level}} |
| 83 | 78 | </td> |
| 84 | 79 | <td> |
| ... | ... | @@ -89,7 +84,7 @@ |
| 89 | 84 | </td> |
| 90 | 85 | <td> |
| 91 | 86 | <a href="edit.html?no={{obj.id}}" class="btn btn-info btn-sm" data-pjax> 修改 </a> |
| 92 | - <a class="btn btn-danger btn-sm" onclick="del({{obj.id}})"> 删除</a> | |
| 87 | + <a class="btn btn-danger btn-sm delete" data-id={{obj.id}}> 删除</a> | |
| 93 | 88 | </td> |
| 94 | 89 | </tr> |
| 95 | 90 | {{/each}} |
| ... | ... | @@ -99,22 +94,4 @@ |
| 99 | 94 | </tr> |
| 100 | 95 | {{/if}} |
| 101 | 96 | </script> |
| 102 | -<!-- <script src="/pages/base/line/js/tipso.js"></script> --> | |
| 103 | -<!-- 线路信息片段JS模块 --> | |
| 104 | -<script src="/pages/base/interval/js/interval-list-table.js"></script> | |
| 105 | -<script> | |
| 106 | - function del(intervalId){ | |
| 107 | - layer.confirm('确定要删除间隔信息吗?', { | |
| 108 | - btn: ['确定','取消'] //按钮 | |
| 109 | - }, function(){ | |
| 110 | - $.ajax({ | |
| 111 | - url: '/interval/' + intervalId, | |
| 112 | - type: 'DELETE', | |
| 113 | - success: function(result) { | |
| 114 | - window.location.href = 'list.html'; | |
| 115 | - } | |
| 116 | - }); | |
| 117 | - }, function(){ | |
| 118 | - }); | |
| 119 | - } | |
| 120 | -</script> | |
| 121 | 97 | \ No newline at end of file |
| 98 | +<script src="/pages/base/interval/js/interval-list-table.js"></script> | |
| 122 | 99 | \ No newline at end of file | ... | ... |