list.blade.php 8.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210
  1. @extends('layouts.base')
  2. @section('title', '自定义模板管理')
  3. @section('content')
  4. <style>
  5. .panel{
  6. margin-bottom:10px!important;
  7. border-radius: 10px;
  8. padding-left: 20px;
  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. position:relative;
  25. border-radius: 8px;
  26. min-height:100vh;
  27. }
  28. .con .setting .block{
  29. padding:10px;
  30. background-color:#fff;
  31. border-radius: 8px;
  32. }
  33. .con .setting .block .title{
  34. font-size:18px;
  35. margin-bottom:15px;
  36. display:flex;
  37. align-items:center;
  38. justify-content:space-between;
  39. }
  40. .confirm-btn{
  41. width: 100%;
  42. position:absolute;
  43. bottom:0;
  44. left:0;
  45. line-height:63px;
  46. background-color: #ffffff;
  47. box-shadow: 0px 8px 23px 1px
  48. rgba(51, 51, 51, 0.3);
  49. background-color:#fff;
  50. text-align:center;
  51. }
  52. .add{
  53. width: 154px;
  54. height: 36px;
  55. border-radius: 4px;
  56. border: solid 1px #29ba9c;
  57. color:#29ba9c;
  58. display:flex;
  59. align-items:center;
  60. justify-content:center;
  61. }
  62. b{
  63. font-size:14px;
  64. }
  65. .el-table--border::after, .el-table--group::after, .el-table::before{
  66. background-color:#fff;
  67. }
  68. </style>
  69. <div id='re_content' >
  70. @include('layouts.newTabs')
  71. <div class="con">
  72. <div class="setting">
  73. <div class="block">
  74. <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></div>
  75. <el-input style="width:15%;margin-right:16px;" v-model="keyword" placeholder="请输入模板名称" ></el-input><el-button type="primary" @click="search">搜索</el-button>
  76. </div>
  77. <div style="background: #eff3f6;width:100%;height:15px;"></div>
  78. <div class="block">
  79. <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>自定义模板列表([[page_total]])</b></div><a @click="toAdd"><el-button type="primary" size="mini" >添加新模板</el-button></a></div>
  80. </div>
  81. <el-table
  82. :data="tableData"
  83. style="width: 100%;padding:0 10px;"
  84. >
  85. <el-table-column
  86. prop="title"
  87. align="center"
  88. label="模板名称"
  89. >
  90. </el-table-column>
  91. <el-table-column
  92. align="center"
  93. label="操作"
  94. >
  95. <template slot-scope="scope" >
  96. <a style="color:#999;margin-right:20px;" :href="'{{ yzWebFullUrl('setting.diy-temp.edit', array('id' => '')) }}'+[[scope.row.id]]"><i class="iconfont icon-ht_operation_edit" style="font-size:16px;margin-right:35px;"></i></a>
  97. <a style="color:#999"><i class="iconfont icon-ht_operation_delete" style="font-size:16px;" @click="del(scope, tableData)"></i></a>
  98. </template>
  99. </el-table-column>
  100. </el-table>
  101. </template>
  102. <el-row style="background-color:#fff;">
  103. <el-col :span="24" align="center" migra style="padding:15px 5% 15px 0" v-loading="loading">
  104. <el-pagination background @current-change="currentChange"
  105. layout="prev, pager, next"
  106. :page-size="page_size" :current-page="current_page" :total="page_total"></el-pagination>
  107. </el-col>
  108. </el-row>
  109. </div>
  110. </div>
  111. </div>
  112. <script>
  113. var vm = new Vue({
  114. el: "#re_content",
  115. delimiters: ['[[', ']]'],
  116. data() {
  117. return {
  118. keyword:'',
  119. list:[],
  120. tableData:[],
  121. loading:false,
  122. search_loading:false,
  123. all_loading:false,
  124. page_total:0,
  125. page_size:0,
  126. current_page:0,
  127. keyword:'',
  128. real_search_form:{},
  129. activeName: 'one',
  130. multipleSelection:[]
  131. }
  132. },
  133. mounted () {
  134. this.search()
  135. },
  136. methods: {
  137. toAdd(){
  138. window.location.href='{!! yzWebFullUrl('setting.diy-temp.add') !!}'
  139. },
  140. search() {
  141. this.search_loading = true;
  142. this.$http.post('{!! yzWebFullUrl('setting.diy-temp.index') !!}',{keyword:this.keyword}
  143. ).then(function (response) {
  144. if (response.data.result){
  145. let datas = response.data.data.list;
  146. this.tableData=datas.data
  147. this.page_total = datas.total;
  148. this.page_size = datas.per_page;
  149. this.current_page = datas.current_page;
  150. this.loading = false;
  151. this.real_search_form=Object.assign({},this.search_form);
  152. }
  153. else {
  154. this.$message({message: response.data.msg,type: 'error'});
  155. }
  156. this.search_loading = false;
  157. },function (response) {
  158. this.search_loading = false;
  159. this.$message({message: response.data.msg,type: 'error'});
  160. }
  161. );
  162. },
  163. currentChange(val) {
  164. this.loading = true;
  165. this.$http.post('{!! yzWebFullUrl('setting.diy-temp.index') !!}',{page:val,keyword:this.keyword}).then(function (response){
  166. if (response.data.result){
  167. let datas = response.data.data.list;
  168. this.tableData=datas.data
  169. this.page_total = datas.total;
  170. this.page_size = datas.per_page;
  171. this.current_page = datas.current_page;
  172. this.loading = false;
  173. } else {
  174. this.$message({message: response.data.msg,type: 'error'});
  175. }
  176. },function (response) {
  177. console.log(response);
  178. this.loading = false;
  179. }
  180. );
  181. },
  182. del(scope,rows){
  183. rows.splice(scope.$index, 1);
  184. let json={
  185. id:scope.row.id
  186. }
  187. this.$http.post('{!! yzWebFullUrl('setting.diy-temp.del') !!}',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. },
  200. },
  201. });
  202. </script>
  203. @endsection