Commit e4c08b4174b966948af84290f4fc044555b82ed0
1 parent
12c008eb
update
Showing
2 changed files
with
22 additions
and
1 deletions
src/main/resources/static/pages/forms/statement/firstAndLastBus_delay.html
| ... | ... | @@ -220,7 +220,13 @@ |
| 220 | 220 | $("#sumMap tr").addClass("hidden"); |
| 221 | 221 | $get('/pcpc/firstAndLastBus_sum', params, function(result){ |
| 222 | 222 | // 把数据填充到模版中 |
| 223 | - var tbodyHtml = template('list_firstAndLastBus_delay',{list:result[result.length - 1].map}); | |
| 223 | + var list; | |
| 224 | + if(result.length - 1 > 0){ | |
| 225 | + list = result[result.length - 1].map; | |
| 226 | + } else { | |
| 227 | + list = result; | |
| 228 | + } | |
| 229 | + var tbodyHtml = template('list_firstAndLastBus_delay',{list:list}); | |
| 224 | 230 | // 把渲染好的模版html文本追加到表格中 |
| 225 | 231 | $('#forms tbody').html(tbodyHtml); |
| 226 | 232 | |
| ... | ... | @@ -262,4 +268,9 @@ |
| 262 | 268 | <td>{{obj.remarks1}}</td> |
| 263 | 269 | </tr> |
| 264 | 270 | {{/each}} |
| 271 | + {{if list.length == 0}} | |
| 272 | + <tr> | |
| 273 | + <td colspan="20"><h6 class="muted">没有相关数据</h6></td> | |
| 274 | + </tr> | |
| 275 | + {{/if}} | |
| 265 | 276 | </script> |
| 266 | 277 | \ No newline at end of file | ... | ... |
src/main/resources/static/pages/forms/statement/firstAndLastBus_sum.html
| ... | ... | @@ -434,6 +434,11 @@ |
| 434 | 434 | {{/if}} |
| 435 | 435 | </tr> |
| 436 | 436 | {{/each}} |
| 437 | + {{if list.length == 0}} | |
| 438 | + <tr> | |
| 439 | + <td colspan="20"><h6 class="muted">没有相关数据</h6></td> | |
| 440 | + </tr> | |
| 441 | + {{/if}} | |
| 437 | 442 | </script> |
| 438 | 443 | <script type="text/html" id="list_sumMaps"> |
| 439 | 444 | {{each list as obj i}} |
| ... | ... | @@ -449,4 +454,9 @@ |
| 449 | 454 | <td>{{obj.remarks1}}</td> |
| 450 | 455 | </tr> |
| 451 | 456 | {{/each}} |
| 457 | + {{if list.length == 0}} | |
| 458 | + <tr> | |
| 459 | + <td colspan="20"><h6 class="muted">没有相关数据</h6></td> | |
| 460 | + </tr> | |
| 461 | + {{/if}} | |
| 452 | 462 | </script> |
| 453 | 463 | \ No newline at end of file | ... | ... |