index.blade.php 2.4 KB

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