commerce_academy.blade.php 12 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238
  1. @extends('layouts.base')
  2. @section('title', '商学院管理')
  3. @section('content')
  4. <link rel="stylesheet" href="{{resource_get('plugins/aggregation-cps/static/index.css')}}">
  5. <style>
  6. .edit-i{display:none;}
  7. .el-table_1_column_2:hover .edit-i{font-weight:900;padding:0;margin:0;display:inline-block;}
  8. .el-tabs__item,.is-top{font-size:16px}
  9. .el-tabs__active-bar { height: 3px;}
  10. .list-title{display:flex;width:100%;background:#f9f9f9;padding:15px 10px;font-weight:900;border:1px solid #e9e9e9;}
  11. .list-title .list-title-1{display:flex;align-items:center;justify-content: center;}
  12. .list-info{display:flex ;padding: 10px;justify-content: left;background:#f9f9f9;}
  13. .list-con{display:flex;width:100%;font-size:12px;font-weight:500;align-items: stretch;border-bottom: 1px solid rgb(233, 233, 233);}
  14. .list-con-goods{display:flex;align-items:center;justify-content: center;box-sizing:border-box;padding-left:10px;border-top:1px solid #e9e9e9;min-height:90px}
  15. .list-con-goods-text{min-height:70px;overflow:hidden;flex:1;display: flex;flex-direction: column;justify-content: space-between;}
  16. .list-con-goods-price{border-right:1px solid #e9e9e9;border-left:1px solid #e9e9e9;min-width:150px;min-height:90px;text-align: left;padding:20px;display: flex;flex-direction: column;}
  17. .list-con-goods-title{font-size:14px;line-height:20px;text-overflow: -o-ellipsis-lastline;overflow: hidden;text-overflow: ellipsis;display: -webkit-box;-webkit-line-clamp: 2;line-clamp: 2;-webkit-box-orient: vertical;}
  18. .list-con-goods-option{font-size:12px;color:#999}
  19. .list-con-member-info{display:flex;padding:0 2px;flex-direction: column;flex:1;min-width: 120px;line-height:28px;justify-content: center;text-align:left;font-size:14px;border-top:1px solid #e9e9e9;border-right:1px solid #e9e9e9;}
  20. .list-member{padding: 10px;font-size: 12px;font-weight: 500;}
  21. .list-num{flex:3;display:flex;align-items:center;border-right:1px solid #e9e9e9;justify-content: center;}
  22. .list-gen{display:flex;align-items:center;justify-content: center;line-height:28px;}
  23. .list-gen-txt{flex:1;border-right:1px solid #e9e9e9;border-bottom:1px solid #e9e9e9;align-items:center;justify-content: center;display:flex;}
  24. .list-opt{flex:1;display:flex;align-items:center;border-left:1px solid #e9e9e9;justify-content: center;}
  25. /* 导航 */
  26. .el-radio-button .el-radio-button__inner,.el-radio-button:first-child .el-radio-button__inner {border-radius: 4px 4px 4px 4px;border-left: 0px;}
  27. .el-radio-button__inner{border:0;}
  28. .el-radio-button:last-child .el-radio-button__inner {border-radius: 4px 4px 4px 4px;}
  29. </style>
  30. <div class="all">
  31. <div id="app" v-cloak>
  32. <div class="vue-crumbs">
  33. {!! (defined('CPS_PLUGIN_NAME') ? CPS_PLUGIN_NAME : '聚合CPS') !!} > 商学院管理
  34. </div>
  35. <div class="vue-head">
  36. <div class="vue-main-title" style="margin-bottom:20px">
  37. <div class="vue-main-title-left"></div>
  38. <div class="vue-main-title-content">商学院管理</div>
  39. <div class="vue-main-title-button">
  40. <el-button type="primary" plain icon="el-icon-plus" size="small" @click="addModal">添加栏目</el-button>
  41. </div>
  42. </div>
  43. <div class="vue-search">
  44. <el-form :inline="true" :model="search_form" class="demo-form-inline">
  45. <el-form-item label="">
  46. <el-input v-model="search_form.title" placeholder="栏目名称"></el-input>
  47. </el-form-item>
  48. <el-form-item label="">
  49. <el-button type="primary" @click="search(1)">搜索</el-button>
  50. </el-form-item>
  51. </el-form>
  52. </div>
  53. </div>
  54. <div class="vue-main">
  55. <div class="vue-main-form">
  56. <div class="vue-main-title" style="margin-bottom:20px">
  57. <div class="vue-main-title-left"></div>
  58. <div class="vue-main-title-content" style="flex:0 0 90px">栏目列表</div>
  59. <div class="" style="text-align:left;font-size:12px;color:#999">
  60. <span>栏目数量:[[total]]</span>&nbsp;&nbsp;&nbsp;
  61. </div>
  62. <div class="vue-main-title-button">
  63. </div>
  64. </div>
  65. <el-table :data="list" style="width: 100%">
  66. <el-table-column label="排序" align="center" prop="sort" width="70">
  67. </el-table-column>
  68. <el-table-column label="栏目ID" align="center" prop="id" width="70">
  69. </el-table-column>
  70. <el-table-column label="栏目名称" align="center" prop="title" >
  71. </el-table-column>
  72. <el-table-column label="是否显示" align="center" width="80">
  73. <template slot-scope="scope">
  74. <div>
  75. <el-tooltip placement="top">
  76. <div slot="content">[[scope.row.is_show==1?'显示':'隐藏']]</div>
  77. <el-switch v-model="scope.row.is_show" @change="changeHide(scope.row.id,scope.row.is_show)" :active-value="1" :inactive-value="0"></el-switch>
  78. </el-tooltip>
  79. </div>
  80. </template>
  81. </el-table-column>
  82. <el-table-column label="内容数量" align="center" prop="number" width="80">
  83. </el-table-column>
  84. <el-table-column label="操作" align="center" >
  85. <template slot-scope="scope">
  86. <div>
  87. <el-button type="primary" @click="editChild(scope.row)">编辑</el-button>
  88. <el-button type="primary" @click="content(scope.row)">查看内容</el-button>
  89. <el-button type="primary" @click="del(scope.row.id,scope.row)">删除</el-button>
  90. </div>
  91. </template>
  92. </el-table-column>
  93. </el-table>
  94. </div>
  95. </div>
  96. <!-- 分页 -->
  97. <div class="vue-page" v-if="total>0">
  98. <el-row>
  99. <el-col align="right">
  100. <el-pagination layout="prev, pager, next,jumper" @current-change="search" :total="total"
  101. :page-size="per_page" :current-page="current_page" background
  102. ></el-pagination>
  103. </el-col>
  104. </el-row>
  105. </div>
  106. </div>
  107. </div>
  108. <script>
  109. var app = new Vue({
  110. el: "#app",
  111. delimiters: ['[[', ']]'],
  112. name: 'test',
  113. data() {
  114. return {
  115. list:[],
  116. search_form:{
  117. title:'',
  118. },
  119. // 统计
  120. total: 0,
  121. rules: {},
  122. current_page:1,
  123. per_page:1,
  124. }
  125. },
  126. created() {
  127. },
  128. mounted() {
  129. this.getData(1);
  130. },
  131. methods: {
  132. getData(page) {
  133. let json = {
  134. page:page,
  135. title:this.search_form.title,
  136. };
  137. let loading = this.$loading({target:document.querySelector(".content"),background: 'rgba(0, 0, 0, 0)'});
  138. this.$http.post('{!! yzWebFullUrl('plugin.aggregation-cps.admin.commerce-academy.get-column-list') !!}',json).then(function(response) {
  139. if (response.data.result) {
  140. this.list = response.data.data.data;
  141. this.current_page=response.data.data.current_page;
  142. this.total=response.data.data.total;
  143. this.per_page=response.data.data.per_page;
  144. loading.close();
  145. } else {
  146. this.$message({
  147. message: response.data.msg,
  148. type: 'error'
  149. });
  150. }
  151. loading.close();
  152. }, function(response) {
  153. this.$message({
  154. message: response.data.msg,
  155. type: 'error'
  156. });
  157. loading.close();
  158. });
  159. },
  160. search(val) {
  161. this.getData(val);
  162. },
  163. // 编辑
  164. editChild(item) {
  165. let link = `{!! yzWebFullUrl('plugin.aggregation-cps.admin.commerce-academy.add-column') !!}`+`&id=`+item.id;
  166. window.location.href = link;
  167. },
  168. del(id,index) {
  169. this.$confirm('确定删除吗', '提示', {confirmButtonText: '确定',cancelButtonText: '取消',type: 'warning'}).then(() => {
  170. let loading = this.$loading({target:document.querySelector(".content"),background: 'rgba(0, 0, 0, 0)'});
  171. this.$http.post('{!! yzWebFullUrl('plugin.aggregation-cps.admin.commerce-academy.delete-column') !!}',{id:id}).then(function (response) {
  172. if (response.data.result) {
  173. this.list.splice(index,1);
  174. this.$message({type: 'success',message: '删除成功!'});
  175. }
  176. else{
  177. this.$message({type: 'error',message: response.data.msg});
  178. }
  179. loading.close();
  180. this.search(this.current_page)
  181. },function (response) {
  182. this.$message({type: 'error',message: response.data.msg});
  183. loading.close();
  184. }
  185. );
  186. }).catch(() => {
  187. this.$message({type: 'info',message: '已取消删除'});
  188. });
  189. },
  190. // 设置显不显示
  191. changeHide(id,is_show) {
  192. let json = {
  193. id:id,
  194. is_show:is_show,
  195. }
  196. let url = `{!! yzWebFullUrl('plugin.aggregation-cps.admin.commerce-academy.is-show-column') !!}`;
  197. console.log(json);
  198. let loading = this.$loading({target:document.querySelector(".content"),background: 'rgba(0, 0, 0, 0)'});
  199. this.$http.post(url,json).then(function (response) {
  200. if (response.data.result) {
  201. this.$message({type: 'success',message: '操作成功!'});
  202. }
  203. else{
  204. this.$message({type: 'error',message: response.data.msg});
  205. }
  206. loading.close();
  207. this.search(this.current_page);
  208. },function (response) {
  209. this.$message({type: 'error',message: response.data.msg});
  210. loading.close();
  211. })
  212. },
  213. // 添加
  214. addModal() {
  215. let link = `{!! yzWebFullUrl('plugin.aggregation-cps.admin.commerce-academy.add-column') !!}`;
  216. console.log(link);
  217. window.location.href = link;
  218. },
  219. content(item) {
  220. let link = `{!! yzWebFullUrl('plugin.aggregation-cps.admin.commerce-academy.content') !!}`+`&academy_id=`+item.id;
  221. console.log(link);
  222. window.location.href = link;
  223. },
  224. },
  225. })
  226. </script>
  227. @endsection