config.blade.php 7.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157
  1. @extends('base.base')
  2. @section('base')
  3. <!-- 内容区域 -->
  4. <div class="main-panel">
  5. <div class="content-wrapper">
  6. <div class="page-header">
  7. <h3 class="page-title">
  8. <span class="page-title-icon bg-gradient-primary text-white mr-2">
  9. <i class="mdi mdi-settings"></i>
  10. </span>
  11. {{ __('auto.配置') }}
  12. </h3>
  13. <nav aria-label="breadcrumb">
  14. <ol class="breadcrumb">
  15. <li class="breadcrumb-item"><a href="#">{{ __('auto.配置管理') }}</a></li>
  16. <li class="breadcrumb-item active" aria-current="page">{{ __('auto.配置列表') }}</li>
  17. </ol>
  18. </nav>
  19. </div>
  20. <div class="row">
  21. <div class="col-lg-12 grid-margin stretch-card">
  22. <div class="card">
  23. <div class="card-body">
  24. <h4 class="card-title">{{ __('auto.配置列表') }}</h4>
  25. <div class="col-lg-9" style="float: left;padding: 0;">
  26. <button type="button" class="btn btn-sm btn-gradient-success btn-icon-text" onclick="add()">
  27. <i class="mdi mdi-plus btn-icon-prepend"></i>
  28. {{ __('auto.添加配置') }}
  29. </button>
  30. </div>
  31. <div class="col-lg-3" style="float: right">
  32. <form action="">
  33. <div class="form-group" >
  34. <div class="input-group col-xs-3">
  35. <input type="text" name="wd" class="form-control file-upload-info" placeholder="{{ __('auto.请输入关键字') }}" value="{{ $wd }}">
  36. <span class="input-group-append">
  37. <button class=" btn btn-sm btn-gradient-primary" type="submit"><i class="mdi mdi-account-search btn-icon-prepend"></i>
  38. {{ __('auto.搜索') }}
  39. </button>
  40. </span>
  41. </div>
  42. </div>
  43. </form>
  44. </div>
  45. <table class="table table-bordered">
  46. <thead>
  47. <tr>
  48. <th width="10%">{{ __('auto.配置描述') }}</th>
  49. <th width="10%">{{ __('auto.配置类型') }}</th>
  50. <th width="10%">key</th>
  51. <th width="25%">value</th>
  52. <th width="10%">{{ __('auto.创建时间') }}</th>
  53. <th width="10%">{{ __('auto.更新时间') }}</th>
  54. <th width="15%">{{ __('auto.操作') }}</th>
  55. </tr>
  56. </thead>
  57. <tbody>
  58. @foreach($list as $k=>$v)
  59. <tr>
  60. <td>{{ $v->name }}</td>
  61. <td>
  62. @if($v->type == "string")
  63. {{ __('auto.字符串') }}
  64. @elseif($v->type == "image")
  65. {{ __('auto.图片') }}
  66. @else
  67. {{ __('auto.富文本') }}
  68. @endif
  69. </td>
  70. <td>{{ $v->config_key }}</td>
  71. <td @if($v->type != "image") class="len" @endif>
  72. @if($v->type == "image")
  73. <div>
  74. <img src="{{ $v->config_value }}" class="config-img" alt="">
  75. </div>
  76. @else
  77. {{ $v->config_value }}
  78. @endif
  79. </td>
  80. <td>{{ $v->created_at }}</td>
  81. <td>{{ $v->updated_at }}</td>
  82. <td>
  83. <button type="button" class="btn btn-sm btn-gradient-dark btn-icon-text" onclick="update({{ $v->id }})">
  84. {{ __('auto.修改') }}
  85. <i class="mdi mdi-file-check btn-icon-append"></i>
  86. </button>
  87. <button type="button" class="btn btn-sm btn-gradient-danger btn-icon-text" onclick="del({{ $v->id }})">
  88. <i class="mdi mdi-delete btn-icon-prepend"></i>
  89. {{ __('auto.删除') }}
  90. </button>
  91. </td>
  92. </tr>
  93. @endforeach
  94. </tbody>
  95. </table>
  96. <div class="box-footer clearfix">
  97. {{ __('auto.总共') }} <b>{{ $list->appends(["wd"=>$wd])->total() }}</b> {{ __('auto.条,分为') }}<b>{{ $list->lastPage() }}</b>{{ __('auto.页') }}
  98. {!! $list->links() !!}
  99. </div>
  100. </div>
  101. </div>
  102. </div>
  103. </div>
  104. </div>
  105. </div>
  106. <script>
  107. $(function(){
  108. cutStr(50);
  109. });
  110. function add(){
  111. var page = layer.open({
  112. type: 2,
  113. title: '{{ __('auto.添加配置') }}',
  114. shadeClose: true,
  115. shade: 0.8,
  116. area: ['70%', '90%'],
  117. content: '/admin/config/add'
  118. });
  119. }
  120. function update(id){
  121. var page = layer.open({
  122. type: 2,
  123. title: '{{ __('auto.修改配置') }}',
  124. shadeClose: true,
  125. shade: 0.8,
  126. area: ['70%', '90%'],
  127. content: '/admin/config/update/'+id
  128. });
  129. }
  130. function del(id){
  131. myConfirm("{{ __('auto.删除操作不可逆,是否继续') }}?",function(){
  132. myRequest("/admin/config/del/"+id,"post",{},function(res){
  133. layer.msg(res.msg)
  134. setTimeout(function(){
  135. window.location.reload();
  136. },1500)
  137. });
  138. });
  139. }
  140. $('.menu-switch').click(function(){
  141. id = $(this).attr('id');
  142. state = $(this).attr('state');
  143. console.log(id)
  144. console.log(state)
  145. if(state == "on"){
  146. $('.pid-'+id).hide();
  147. $(this).attr("state","off")
  148. $(this).removeClass('mdi-menu-down').addClass('mdi-menu-right');
  149. }else{
  150. $('.pid-'+id).show();
  151. $(this).attr("state","on")
  152. $(this).removeClass('mdi-menu-right').addClass('mdi-menu-down');
  153. }
  154. })
  155. </script>
  156. @endsection