queue.blade.php 4.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158
  1. @extends('layouts.base')
  2. @section('title', '队列设置')
  3. @section('content')
  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. position:relative;
  26. min-height:100vh;
  27. background-color:#fff;
  28. border-radius: 8px;
  29. }
  30. .con .setting .block{
  31. padding:10px;
  32. background-color:#fff;
  33. border-radius: 8px;
  34. }
  35. .con .setting .block .title{
  36. display:flex;
  37. align-items:center;
  38. margin-bottom:15px;
  39. }
  40. .confirm-btn{
  41. width: calc(100% - 266px);
  42. position:fixed;
  43. bottom:0;
  44. right:0;
  45. margin-right:10px;
  46. line-height:63px;
  47. background-color: #ffffff;
  48. box-shadow: 0px 8px 23px 1px
  49. rgba(51, 51, 51, 0.3);
  50. background-color:#fff;
  51. text-align:center;
  52. }
  53. b{
  54. font-size:14px;
  55. }
  56. </style>
  57. <div id='re_content' >
  58. @include('layouts.newTabs')
  59. <div class="con">
  60. <div class="setting">
  61. <div class="block">
  62. <div class="title"><span style="width: 4px;height: 18px;background-color: #29ba9c;margin-right:15px;display:inline-block;"></span><b>队列设置</b></div>
  63. <el-form ref="form" :model="form" label-width="15%">
  64. <el-form-item label="队列执行错误消息" prop="service_type">
  65. <el-radio v-model="form.receive_message" :label="0">开启</el-radio>
  66. <el-radio v-model="form.receive_message" :label="1">关闭</el-radio>
  67. </el-form-item>
  68. <el-form-item label="普通队列进程数">
  69. <el-input placeholder=""
  70. v-model="form.default"
  71. style="width: 70%">
  72. </el-input>
  73. </el-form-item>
  74. <el-form-item label="微信消息队列进程数">
  75. <el-input placeholder=""
  76. v-model="form.message"
  77. style="width: 70%">
  78. </el-input>
  79. </el-form-item>
  80. <el-form-item label="订单队列进程数">
  81. <el-input placeholder=""
  82. v-model="form.order"
  83. style="width: 70%">
  84. </el-input>
  85. </el-form-item>
  86. </el-form>
  87. </div>
  88. </div>
  89. <div class="confirm-btn">
  90. <el-button type="primary" @click="onSubmit">提交</el-button>
  91. </div>
  92. </div>
  93. </div>
  94. <script>
  95. var app = new Vue({
  96. el: '#re_content',
  97. delimiters: ['[[', ']]'],
  98. data() {
  99. // 默认数据
  100. let temp = JSON.parse('{!! $setting !!}');
  101. if (!temp || temp.length === 0) {
  102. temp = {
  103. }
  104. }
  105. return {
  106. form: temp,
  107. loading: false,
  108. formLoading: false,
  109. centerDialogVisible: false,
  110. }
  111. },
  112. mounted: function () {
  113. console.log(this.form)
  114. },
  115. methods: {
  116. onSubmit() {
  117. let loading = this.$loading({target:document.querySelector(".content"),background: 'rgba(0, 0, 0, 0)'});
  118. if (this.formLoading) {
  119. return;
  120. }
  121. this.formLoading = true;
  122. this.$refs.form.validate((valid) => {
  123. console.log(valid)
  124. });
  125. this.$http.post("{!! yzWebUrl('siteSetting.store.queue') !!}", {'setting': this.form}).then(response => {
  126. //console.log(response.data);
  127. // return;
  128. if (response.data.result) {
  129. this.$message({
  130. message: response.data.msg,
  131. type: 'success'
  132. });
  133. } else {
  134. this.$message({
  135. message: response.data.msg,
  136. type: 'error'
  137. });
  138. }
  139. this.formLoading = false;
  140. loading.close();
  141. location.reload();
  142. }, response => {
  143. console.log(response);
  144. });
  145. },
  146. }
  147. });
  148. </script>
  149. @endsection