system.blade.php 6.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147
  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-wrench"></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. <table class="table table-bordered">
  26. <thead>
  27. <tr>
  28. <th>{{ __('auto.功能名称') }}</th>
  29. <th>{{ __('auto.弹出状态') }}</th>
  30. <th>{{ __('auto.修改发布内容') }}</th>
  31. <th>{{ __('auto.上次发布时间') }}</th>
  32. <th>{{ __('auto.弹出功能总开关') }}</th>
  33. </tr>
  34. </thead>
  35. <tbody>
  36. @foreach($list as $val)
  37. <tr>
  38. <td style="width: 7%">{{$val->StatusTip}}</td>
  39. <td style="width: 15%"></td>
  40. <td style="width: 15%">
  41. <div>
  42. <div>
  43. <textarea class="form-control" name="message" rows="4"
  44. disabled="disabled"
  45. style="float: left;width: 80%">{{$val->StatusString}}</textarea>
  46. </div>
  47. <div>
  48. <button class="btn btn-sm btn-gradient-dark"
  49. style="float: right;width: 20%;margin-top: 30px"
  50. onclick="updateFunc('{{$val->StatusName}}')">{{ __('auto.修改') }}
  51. </button>
  52. </div>
  53. </div>
  54. </td>
  55. <td style="width: 15%"></td>
  56. <td style="width: 15%">
  57. @if ($val->StatusValue == '1')
  58. {{ __('auto.已开启') }}
  59. <button class="btn btn-sm btn-gradient-dark"
  60. onclick="updateStatusFunc('{{$val->StatusName}}',2)">
  61. {{ __('auto.关闭') }}
  62. </button>
  63. @else
  64. {{ __('auto.已关闭') }}
  65. <button class="btn btn-sm btn-gradient-dark"
  66. onclick="updateStatusFunc('{{$val->StatusName}}',1)">
  67. {{ __('auto.开启') }}
  68. </button>
  69. @endif
  70. </td>
  71. </tr>
  72. @endforeach
  73. </tbody>
  74. </table>
  75. </div>
  76. </div>
  77. </div>
  78. </div>
  79. </div>
  80. </div>
  81. <script>
  82. function updateStatusFunc(StatusName, statusVal) {
  83. myConfirm("{{ __('auto.操作不可逆,是否继续') }}?", function () {
  84. myRequest('/admin/system/update_status', 'post', {StatusName,statusVal}, function (response) {
  85. layer.msg(response.msg)
  86. setTimeout(function () {
  87. window.location.reload();
  88. }, 1500)
  89. })
  90. })
  91. }
  92. function updateFunc(StatusName) {
  93. switch (StatusName) {
  94. case 'SUSPENSION_NOTICE':
  95. publicView('{{ __('auto.停服维护公告') }}', ['50%', '60%'], '/admin/system/add?StatusName='+StatusName)
  96. break;
  97. case 'HN_SC_NOTICE':
  98. publicView('{{ __('auto.跑马灯') }}', ['50%', '60%'], '/admin/system/add?StatusName='+StatusName)
  99. break;
  100. }
  101. }
  102. function add() {
  103. var page = layer.open({
  104. type: 2,
  105. title: '{{ __('auto.添加菜单') }}',
  106. shadeClose: true,
  107. shade: 0.8,
  108. area: ['70%', '90%'],
  109. content: '/admin/system/add'
  110. });
  111. }
  112. function publicView(title, area, content) {
  113. var page = layer.open({
  114. type: 2,
  115. title: title,
  116. shadeClose: true,
  117. shade: 0.8,
  118. area: area,
  119. content: content
  120. });
  121. }
  122. $('.menu-switch').click(function () {
  123. id = $(this).attr('id');
  124. state = $(this).attr('state');
  125. console.log(id)
  126. console.log(state)
  127. if (state == "on") {
  128. $('.pid-' + id).hide();
  129. $(this).attr("state", "off")
  130. $(this).removeClass('mdi-menu-down').addClass('mdi-menu-right');
  131. } else {
  132. $('.pid-' + id).show();
  133. $(this).attr("state", "on")
  134. $(this).removeClass('mdi-menu-right').addClass('mdi-menu-down');
  135. }
  136. })
  137. </script>
  138. @endsection