list.blade.php 8.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220
  1. @extends('layouts.base')
  2. @section('content')
  3. <style>
  4. .panel{
  5. margin-bottom:10px!important;
  6. padding-left: 20px;
  7. border-radius: 10px;
  8. }
  9. .panel .active a {
  10. background-color: #29ba9c!important;
  11. border-radius: 18px!important;
  12. color:#fff;
  13. }
  14. .panel a{
  15. border:none!important;
  16. background-color:#fff!important;
  17. }
  18. .content{
  19. background: #eff3f6;
  20. padding: 10px!important;
  21. }
  22. .con{
  23. padding-bottom:20px;
  24. position:relative;
  25. border-radius: 8px;
  26. min-height:100vh;
  27. background-color:#fff;
  28. }
  29. .con .setting .block{
  30. padding:10px;
  31. background-color:#fff;
  32. border-radius: 8px;
  33. }
  34. .con .setting .block .title{
  35. font-size:18px;
  36. margin-bottom:15px;
  37. display:flex;
  38. align-items:center;
  39. justify-content:space-between;
  40. }
  41. .el-form-item{
  42. padding-left:300px;
  43. margin-bottom:10px!important;
  44. }
  45. .confirm-btn{
  46. width: calc(100% - 266px);
  47. position:fixed;
  48. bottom:0;
  49. right:0;
  50. margin-right:10px;
  51. line-height:63px;
  52. background-color: #ffffff;
  53. box-shadow: 0px 8px 23px 1px
  54. rgba(51, 51, 51, 0.3);
  55. background-color:#fff;
  56. text-align:center;
  57. }
  58. .el-form-item__label{
  59. margin-right:30px;
  60. }
  61. .add{
  62. width: 154px;
  63. font-size:16px;
  64. height: 36px;
  65. border-radius: 4px;
  66. border: solid 1px #29ba9c;
  67. color:#29ba9c;
  68. display:flex;
  69. align-items:center;
  70. justify-content:center;
  71. }
  72. b{
  73. font-size:14px;
  74. }
  75. .el-table--border::after, .el-table--group::after, .el-table::before{
  76. background-color:#fff;
  77. }
  78. </style>
  79. <div id='re_content' >
  80. <template>
  81. </template>
  82. @include('layouts.newTabs')
  83. <div class="con">
  84. <div class="setting">
  85. <div class="block">
  86. <div class="title">
  87. <div style="display:flex;align-items:center;">
  88. <span style="width: 4px;height:18px;background-color: #29ba9c;margin-right:15px;display:inline-block;"></span><b>幻灯片列表</b>
  89. </div>
  90. <a><el-button type="primary" @click="addBlock">添加幻灯片</el-button></a>
  91. </div>
  92. </div>
  93. <template>
  94. <el-table
  95. :data="tableData"
  96. style="width: 100%;padding:0 10px;">
  97. <el-table-column
  98. prop="id"
  99. align="center"
  100. label="ID"
  101. width="180">
  102. </el-table-column>
  103. <el-table-column
  104. prop="display_order"
  105. align="center"
  106. label="显示顺序"
  107. width="180">
  108. </el-table-column>
  109. <el-table-column
  110. prop="name"
  111. align="center"
  112. label="标题"
  113. label="180">
  114. </el-table-column>
  115. <el-table-column
  116. prop="link"
  117. align="center"
  118. label="链接"
  119. label="180">
  120. </el-table-column>
  121. <el-table-column
  122. align="center"
  123. label="状态"
  124. label="180">
  125. <template slot-scope="scope" >
  126. <div v-if="scope.row.is_open==1" style="color:#139933;">
  127. 显示
  128. </div>
  129. <div v-if="scope.row.is_open==0" style="color:#ff1532;">
  130. 隐藏
  131. </div>
  132. </template>
  133. </el-table-column>
  134. <el-table-column
  135. align="center"
  136. label="操作"
  137. label="180">
  138. <template slot-scope="scope" >
  139. <a style="color:#999" :href="'{{ yzWebFullUrl('plugin.reserve-simple.admin.carousel.edit', array('id' => '')) }}'+[[scope.row.id]]"><i class="iconfont icon-ht_operation_edit" style="font-size:16px;margin-right:35px;" ></i></a>
  140. <a style="color:#999"><i class="iconfont icon-ht_operation_delete" style="font-size:16px;" @click="del(scope, tableData)"></i></a>
  141. </template>
  142. </el-table-column>
  143. </el-table>
  144. </template>
  145. </div>
  146. </div>
  147. </div>
  148. <script>
  149. var vm = new Vue({
  150. el: "#re_content",
  151. delimiters: ['[[', ']]'],
  152. data() {
  153. return {
  154. activeName: 'one',
  155. tableData: [{
  156. id: '',
  157. display_order: '',
  158. slide_name: '',
  159. link:'',
  160. enabled:'',
  161. }]
  162. }
  163. },
  164. mounted () {
  165. this.getData();
  166. },
  167. methods: {
  168. addBlock(){
  169. window.location.href = "{!! yzWebFullUrl('plugin.reserve-simple.admin.carousel.create') !!} "
  170. },
  171. getData(){
  172. this.$http.post('{!! yzWebFullUrl('plugin.reserve-simple.admin.carousel.index')!!}').then(function (response){
  173. if (response.data.result) {
  174. this.tableData=response.data.data
  175. }else {
  176. this.$message({message: response.data.msg,type: 'error'});
  177. }
  178. },function (response) {
  179. this.$message({message: response.data.msg,type: 'error'});
  180. })
  181. },
  182. del(scope,rows){
  183. this.$confirm('是否删除幻灯片?', '提示', {
  184. confirmButtonText: '确定',
  185. cancelButtonText: '取消',
  186. type: 'warning'
  187. }).then(() => {
  188. rows.splice(scope.$index, 1);
  189. let json={
  190. id:scope.row.id
  191. }
  192. this.$http.post('{!! yzWebFullUrl('plugin.reserve-simple.admin.carousel.deleted') !!}',json).then(function (response){
  193. if (response.data.result) {
  194. this.$message({message:"删除成功!",type:"success"});
  195. this.loading = false;
  196. }else {
  197. this.$message({message: response.data.msg,type: 'error'});
  198. }
  199. },function (response) {
  200. console.log(response);
  201. this.loading = false;
  202. }
  203. );
  204. }).catch(() => {
  205. this.$message({
  206. type: 'info',
  207. message: '已取消删除'
  208. });
  209. });
  210. },
  211. },
  212. });
  213. </script>
  214. @endsection()