cron_log.blade.php 5.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171
  1. @extends('layouts.base')
  2. @section('content')
  3. @section('title', trans('失败队列重试'))
  4. <style>
  5. .panel{
  6. margin-bottom:10px!important;
  7. padding-left: 20px;
  8. border-radius: 10px;
  9. }
  10. .panel .active a {
  11. background-color: #29ba9c!important;
  12. border-radius: 18px!important;
  13. color:#fff;
  14. }
  15. .panel a{
  16. border:none!important;
  17. background-color:#fff!important;
  18. }
  19. .content{
  20. background: #eff3f6;
  21. padding: 10px!important;
  22. }
  23. .con{
  24. padding-bottom:20px;
  25. border-radius: 8px;
  26. min-height:100vh;
  27. background-color:#fff;
  28. position:relative;
  29. }
  30. .con .setting .block{
  31. padding:10px;
  32. background-color:#fff;
  33. border-radius: 8px;
  34. margin-bottom:10px;
  35. }
  36. .con .setting .block .title{
  37. font-size:18px;
  38. margin-bottom:15px;
  39. display:flex;
  40. align-items:center;
  41. }
  42. .el-form-item{
  43. padding-left:300px;
  44. margin-bottom:10px!important;
  45. }
  46. .el-form-item__label{
  47. margin-right:30px;
  48. }
  49. .confirm-btn{
  50. width: 100%;
  51. position:absolute;
  52. bottom:0;
  53. left:0;
  54. line-height:63px;
  55. background-color: #ffffff;
  56. box-shadow: 0px 8px 23px 1px
  57. rgba(51, 51, 51, 0.3);
  58. background-color:#fff;
  59. text-align:center;
  60. }
  61. b{
  62. font-size:14px;
  63. }
  64. </style>
  65. <div id='re_content' >
  66. @include('layouts.newTabs')
  67. <template>
  68. <div class="workOrder" >
  69. <div class="table_box" style="padding-left:10px;padding-top:10px;">
  70. <el-button size="mini" style=" float:right" @click="catchInfo(0,1)">一键重试</el-button>
  71. <el-table :data="list" style="width: 100%">
  72. <el-table-column prop="queue_id" label="ID(ID号唯一,重试后仍存在请联系客服)" width="350">
  73. </el-table-column>
  74. <el-table-column prop="payload" label="任务" width="450":show-overflow-tooltip="true" >
  75. </el-table-column>
  76. <el-table-column prop="exception" label="错误信息" width="450" :show-overflow-tooltip="true">
  77. </el-table-column>
  78. <el-table-column prop="failed_at" label="失败时间">
  79. </el-table-column>
  80. <el-table-column prop="address" label="操作">
  81. <template slot-scope="scope">
  82. <el-button size="mini" @click="catchInfo(scope.row.id,1)">重试</el-button>
  83. <el-button size="mini" @click="catchInfo(scope.row.id,2)">忽略</el-button>
  84. </template>
  85. </el-table-column>
  86. </el-table>
  87. </div>
  88. <div class="pageclass" style="margin-top: 20px;">
  89. <el-pagination
  90. align="center"
  91. @current-change="handleCurrentChange"
  92. :current-page.sync="currentPage"
  93. :page-size="PageSize"
  94. layout="total, prev, pager, next,jumper"
  95. :total="total">
  96. </el-pagination>
  97. </div>
  98. </div>
  99. </template>
  100. </div>
  101. <script>
  102. var vm = new Vue({
  103. el: "#re_content",
  104. delimiters: ['[[', ']]'],
  105. data() {
  106. return {
  107. list: [],
  108. currentPage:1,//当前页
  109. total:0,//总条数
  110. PageSize:10,//每页显示多少条
  111. }
  112. },
  113. mounted() {
  114. this.getData(1);
  115. },
  116. methods: {
  117. getData(page) {
  118. let loading = this.$loading({target:document.querySelector(".content"),background: 'rgba(0, 0, 0, 0)'});
  119. this.$http.post('{!! yzWebFullUrl('setting.cron_log.index') !!}', {page:page}).then(function(response) {
  120. if (response.data.result) {
  121. console.log(response.data.data.data)
  122. this.list = response.data.data.data;
  123. this.current_page=response.data.data.current_page;
  124. this.total=response.data.data.total;
  125. this.per_page=response.data.data.per_page;
  126. loading.close();
  127. } else {
  128. this.$message({
  129. message: response.data.msg,
  130. type: 'error'
  131. });
  132. }
  133. loading.close();
  134. }, function(response) {
  135. this.$message({
  136. message: response.data.msg,
  137. type: 'error'
  138. });
  139. loading.close();
  140. });
  141. },
  142. handleCurrentChange(val) {
  143. this.getData(val)
  144. },
  145. catchInfo(id,type) {
  146. let info = '重试';
  147. if (type == 2) {
  148. info = '忽略';
  149. }
  150. this.$confirm('是否确定'+info+'?', '提示', {confirmButtonText: '确定',cancelButtonText: '取消',type: 'warning'}).then(() => {
  151. this.$http.post('{!! yzWebFullUrl('setting.cron_log.submit') !!}', {id:id,type:type}).then(function(response) {
  152. if (response.data.result) {
  153. this.$message({message: response.data.msg, type: 'success'});
  154. } else {
  155. this.$message({message: response.data.msg, type: 'error'});
  156. }
  157. this.getData(1);
  158. },function (response) {
  159. this.$message({message: response.data.msg,type: 'error'});
  160. })
  161. })
  162. }
  163. },
  164. });
  165. </script>
  166. @endsection