slide-list.blade.php 7.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215
  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"><div style="display:flex;align-items:center;"><span style="width: 4px;height:18px;background-color: #29ba9c;margin-right:15px;display:inline-block;"></span><b>幻灯片列表</b><span></div><a><el-button type="primary" @click="addBlock">添加幻灯片</el-button></a></div>
  87. </div>
  88. <template>
  89. <el-table
  90. :data="tableData"
  91. style="width: 100%;padding:0 10px;">
  92. <el-table-column
  93. prop="id"
  94. align="center"
  95. label="ID"
  96. width="180">
  97. </el-table-column>
  98. <el-table-column
  99. prop="display_order"
  100. align="center"
  101. label="显示顺序"
  102. width="180">
  103. </el-table-column>
  104. <el-table-column
  105. prop="slide_name"
  106. align="center"
  107. label="标题"
  108. label="180">
  109. </el-table-column>
  110. <el-table-column
  111. prop="link"
  112. align="center"
  113. label="链接"
  114. label="180">
  115. </el-table-column>
  116. <el-table-column
  117. align="center"
  118. label="状态"
  119. label="180">
  120. <template slot-scope="scope" >
  121. <div v-if="scope.row.enabled==1" style="color:#139933;">
  122. 显示
  123. </div>
  124. <div v-if="scope.row.enabled==0" style="color:#ff1532;">
  125. 隐藏
  126. </div>
  127. </template>
  128. </el-table-column>
  129. <el-table-column
  130. align="center"
  131. label="操作"
  132. label="180">
  133. <template slot-scope="scope" >
  134. <a style="color:#999" :href="'{{ yzWebFullUrl('setting.slide.edit', array('id' => '')) }}'+[[scope.row.id]]"><i class="iconfont icon-ht_operation_edit" style="font-size:16px;margin-right:35px;" ></i></a>
  135. <a style="color:#999"><i class="iconfont icon-ht_operation_delete" style="font-size:16px;" @click="del(scope, tableData)"></i></a>
  136. </template>
  137. </el-table-column>
  138. </el-table>
  139. </template>
  140. </div>
  141. </div>
  142. </div>
  143. <script>
  144. var vm = new Vue({
  145. el: "#re_content",
  146. delimiters: ['[[', ']]'],
  147. data() {
  148. return {
  149. activeName: 'one',
  150. tableData: [{
  151. id: '',
  152. display_order: '',
  153. slide_name: '',
  154. link:'',
  155. enabled:'',
  156. }]
  157. }
  158. },
  159. mounted () {
  160. this.getData();
  161. },
  162. methods: {
  163. addBlock(){
  164. window.location.href = "{!! yzWebFullUrl('setting.slide.create') !!} "
  165. },
  166. getData(){
  167. this.$http.post('{!! yzWebFullUrl('setting.slide.index')!!}').then(function (response){
  168. if (response.data.result) {
  169. this.tableData=response.data.data
  170. }else {
  171. this.$message({message: response.data.msg,type: 'error'});
  172. }
  173. },function (response) {
  174. this.$message({message: response.data.msg,type: 'error'});
  175. })
  176. },
  177. del(scope,rows){
  178. this.$confirm('是否删除幻灯片?', '提示', {
  179. confirmButtonText: '确定',
  180. cancelButtonText: '取消',
  181. type: 'warning'
  182. }).then(() => {
  183. rows.splice(scope.$index, 1);
  184. let json={
  185. id:scope.row.id
  186. }
  187. this.$http.post('{!! yzWebFullUrl('setting.slide.deleted') !!}',json).then(function (response){
  188. if (response.data.result) {
  189. this.$message({message:"删除成功!",type:"success"});
  190. this.loading = false;
  191. }else {
  192. this.$message({message: response.data.msg,type: 'error'});
  193. }
  194. },function (response) {
  195. console.log(response);
  196. this.loading = false;
  197. }
  198. );
  199. }).catch(() => {
  200. this.$message({
  201. type: 'info',
  202. message: '已取消删除'
  203. });
  204. });
  205. },
  206. },
  207. });
  208. </script>
  209. @endsection()