index.blade.php 3.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124
  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. margin-bottom:10px;
  33. border-radius: 8px;
  34. }
  35. .con .setting .block .title{
  36. font-size:18px;
  37. margin-bottom:15px;
  38. display:flex;
  39. align-items:center;
  40. }
  41. .el-form-item__label{
  42. margin-right:30px;
  43. }
  44. .confirm-btn{
  45. width: calc(100% - 266px);
  46. position:fixed;
  47. bottom:0;
  48. right:0;
  49. margin-right:10px;
  50. line-height:63px;
  51. background-color: #ffffff;
  52. box-shadow: 0px 8px 23px 1px
  53. rgba(51, 51, 51, 0.3);
  54. background-color:#fff;
  55. text-align:center;
  56. }
  57. b{
  58. font-size:14px;
  59. }
  60. </style>
  61. <div id='re_content' >
  62. @include('layouts.newTabs')
  63. <div class="con">
  64. <div class="setting">
  65. <div class="block">
  66. <div class="title"><span style="width: 4px;height: 18px;background-color: #29ba9c;margin-right:15px;display:inline-block;"></span><b>基础设置</b></div>
  67. <el-form ref="form" :model="form" label-width="15%">
  68. <el-form-item label="是否开启数据库查询缓存">
  69. <template>
  70. <el-switch
  71. v-model="form.select.open"
  72. active-value= "1"
  73. inactive-value="0"
  74. >
  75. </el-switch>
  76. </template>
  77. </el-form-item>
  78. </div>
  79. <div class="confirm-btn">
  80. <el-button type="primary" @click="submit">提交</el-button>
  81. </div>
  82. </el-form>
  83. </div>
  84. </div>
  85. </div>
  86. <script>
  87. var vm = new Vue({
  88. el: "#re_content",
  89. delimiters: ['[[', ']]'],
  90. data() {
  91. let is_open = {!! $set['select']['open'] ?: '0'!!}
  92. return {
  93. activeName: 'first',
  94. form:{
  95. select:{
  96. open: String(is_open)
  97. },
  98. },
  99. }
  100. },
  101. mounted () {
  102. },
  103. methods: {
  104. submit() {
  105. let loading = this.$loading({target:document.querySelector(".content"),background: 'rgba(0, 0, 0, 0)'});
  106. this.$http.post('{!! yzWebFullUrl('setting.cache.index') !!}',{'cache':this.form}).then(function (response){
  107. if (response.data.result) {
  108. this.$message({message: response.data.msg,type: 'success'});
  109. }
  110. else {
  111. this.$message({message: response.data.msg,type: 'error'});
  112. }
  113. loading.close();
  114. location.reload();
  115. },function (response) {
  116. this.$message({message: response.data.msg,type: 'error'});
  117. })
  118. },
  119. },
  120. });
  121. </script>
  122. @endsection