template_table_view.blade.php 1.1 KB

1234567891011121314151617181920212223242526272829303132333435
  1. <style>
  2. .layui-table th {
  3. color: #666;
  4. text-align: right;
  5. background-color: #f2f2f2;
  6. }
  7. </style>
  8. <div @if(request()->ajax()) style="padding:10px 20px;" @endif>
  9. @if(isset($title) && $title)
  10. <h2>{{ $title }}
  11. @if(!request()->ajax())
  12. <button class="layui-btn layui-btn-primary layui-layer-close" style="position:relative;" type="button"
  13. onclick="javascript:history.go(-1);">返回
  14. </button>
  15. @endif
  16. </h2>
  17. <hr>
  18. @endif
  19. <table class="layui-table">
  20. @foreach($columns as $key => $column)
  21. <tr>
  22. <th style="width: 200px;">{{ $column['name'] }}</th>
  23. <td>{!! isset($column['value']) ? $column['value']($items[$key]) : $items[$key] !!}</td>
  24. </tr>
  25. @endforeach
  26. </table>
  27. @if(!request()->ajax())
  28. <hr>
  29. <button class="layui-btn layui-btn-primary layui-layer-close" style="position:relative;" type="button"
  30. onclick="javascript:history.go(-1);">返回
  31. </button>
  32. @endif
  33. </div>