set.blade.php 3.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124
  1. @extends('layouts.base')
  2. @section('title', '基础设置')
  3. @section('content')
  4. <style>
  5. .content{
  6. background: #f5f5f5;
  7. padding: 10px!important;
  8. }
  9. .con{
  10. padding-bottom:40px;
  11. position:relative;
  12. border-radius: 8px;
  13. min-height:100vh;
  14. background:#fff;
  15. }
  16. .con .setting .block{
  17. padding:20px;
  18. padding-left:10px;
  19. background-color:#fff;
  20. border-radius: 8px;
  21. }
  22. .con .setting .block .title{
  23. font-size:18px;
  24. margin-bottom:15px;
  25. display:flex;
  26. align-items:center;
  27. }
  28. .confirm-btn{
  29. width: calc(100% - 266px);
  30. position:fixed;
  31. bottom:0;
  32. right:0;
  33. margin-right:10px;
  34. line-height:63px;
  35. background-color: #ffffff;
  36. box-shadow: 0px 8px 23px 1px
  37. rgba(51, 51, 51, 0.3);
  38. background-color:#fff;
  39. text-align:center;
  40. }
  41. b{
  42. font-size:14px;
  43. }
  44. input[type=file]{
  45. display:none;
  46. }
  47. </style>
  48. <div id="all">
  49. <div class="con">
  50. <div class="setting">
  51. <el-form ref="form" :model="form" label-width="15%" >
  52. <div class="block">
  53. <div class="title"><span style="width: 4px;height: 18px;background-color: #29ba9c;margin-right:15px;display:inline-block;"></span><b>基础设置</b></div>
  54. <el-form-item label="插件开启">
  55. <template>
  56. <el-switch
  57. v-model="form.is_open"
  58. :active-value="1"
  59. :inactive-value="0"
  60. >
  61. </el-switch>
  62. </template>
  63. </el-form-item>
  64. <el-form-item label="类型">
  65. <el-checkbox-group v-model="form.msg_type" style="margin-top:4px;">
  66. <el-checkbox v-for="(item,index) in msg_type" :key="index" :label="item.id">[[item.name]]</el-checkbox>
  67. </el-checkbox-group>
  68. </el-form-item>
  69. </div>
  70. <div class="confirm-btn">
  71. <el-button type="primary" @click="submitForm">提交</el-button>
  72. </div>
  73. </el-form>
  74. </div>
  75. </div>
  76. </div>
  77. <script>
  78. let setData = {!! json_encode($set)?:'{}' !!};
  79. let msgType = {!! json_encode($msgType)?:'{}' !!};
  80. var app = new Vue({
  81. el:"#all",
  82. delimiters: ['[[', ']]'],
  83. name: 'test',
  84. data() {
  85. return{
  86. msg_type:msgType,
  87. form:{
  88. is_open:setData.is_open,
  89. msg_type:setData.msg_type,
  90. },
  91. }
  92. },
  93. created() {
  94. },
  95. mounted() {
  96. },
  97. methods: {
  98. submitForm() {
  99. let loading = this.$loading({target:document.querySelector(".content"),background: 'rgba(0, 0, 0, 0)'});
  100. this.$http.post('{!! yzWebFullUrl('plugin.instation-message.admin.set.index') !!}',{'set':this.form}).then(response => {
  101. if (response.data.result) {
  102. this.$message({type: 'success',message: '操作成功!'});
  103. } else {
  104. this.$message({message: response.data.msg,type: 'error'});
  105. }
  106. loading.close();
  107. location.reload();
  108. },response => {
  109. loading.close();
  110. });
  111. },
  112. },
  113. })
  114. </script>
  115. @endsection