index.blade.php 2.2 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758
  1. @extends('layouts.app')
  2. @section('title')查询-自定义字段@endsection
  3. @section('content')
  4. <div class="container-fluid">
  5. <div class="card">
  6. <div class="card-body">
  7. @if(Session::has('successTip'))
  8. <div class="alert alert-success h1">{{Session::get('successTip')}}</div>
  9. @endif
  10. <table class="table table-striped table-sm" id="list">
  11. <tr>
  12. <th>ID</th>
  13. <th>目标字段</th>
  14. <th>字段显示名</th>
  15. <th>对应权限</th>
  16. <th>货主</th>
  17. <th>创建时间</th>
  18. <th>操作</th>
  19. </tr>
  20. <tr v-for="customField in customFields">
  21. <td class="text-muted">@{{customField.id}}</td>
  22. <td class="text-muted">@{{customField.field}}</td>
  23. <td>@{{customField.present_name}}</td>
  24. <td>@{{customField.authority_name}}</td>
  25. <td>@{{customField.owner_name}}</td>
  26. <td class="text-muted">@{{customField.created_at}}</td>
  27. <td>
  28. @can('自定义字段-编辑')
  29. <button class="btn btn-sm btn-outline-primary" @click="edit(customField.id)">改</button> @endcan
  30. </td>
  31. </tr>
  32. </table>
  33. {{$customFields->links()}}
  34. </div>
  35. </div>
  36. </div>
  37. @endsection
  38. @section('lastScript')
  39. <script>
  40. new Vue({
  41. el:"#list",
  42. data:{
  43. customFields:[
  44. @foreach( $customFields as $customField )
  45. {id:'{{$customField->id}}',name:'{{$customField->name}}',code:'{{$customField->code}}',created_at:'{{$customField->created_at}}'},
  46. @endforeach
  47. ],
  48. },
  49. methods:{
  50. edit:function(id){
  51. location.href = "{{url('rejected/customField')}}/"+id+"/edit";
  52. },
  53. }
  54. });
  55. </script>
  56. @endsection