| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238 |
- @extends('layouts.base')
- @section('title', '商学院管理')
- @section('content')
- <link rel="stylesheet" href="{{resource_get('plugins/aggregation-cps/static/index.css')}}">
- <style>
- .edit-i{display:none;}
- .el-table_1_column_2:hover .edit-i{font-weight:900;padding:0;margin:0;display:inline-block;}
- .el-tabs__item,.is-top{font-size:16px}
- .el-tabs__active-bar { height: 3px;}
- .list-title{display:flex;width:100%;background:#f9f9f9;padding:15px 10px;font-weight:900;border:1px solid #e9e9e9;}
- .list-title .list-title-1{display:flex;align-items:center;justify-content: center;}
- .list-info{display:flex ;padding: 10px;justify-content: left;background:#f9f9f9;}
- .list-con{display:flex;width:100%;font-size:12px;font-weight:500;align-items: stretch;border-bottom: 1px solid rgb(233, 233, 233);}
- .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}
- .list-con-goods-text{min-height:70px;overflow:hidden;flex:1;display: flex;flex-direction: column;justify-content: space-between;}
- .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;}
- .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;}
- .list-con-goods-option{font-size:12px;color:#999}
- .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;}
- .list-member{padding: 10px;font-size: 12px;font-weight: 500;}
- .list-num{flex:3;display:flex;align-items:center;border-right:1px solid #e9e9e9;justify-content: center;}
- .list-gen{display:flex;align-items:center;justify-content: center;line-height:28px;}
- .list-gen-txt{flex:1;border-right:1px solid #e9e9e9;border-bottom:1px solid #e9e9e9;align-items:center;justify-content: center;display:flex;}
- .list-opt{flex:1;display:flex;align-items:center;border-left:1px solid #e9e9e9;justify-content: center;}
- /* 导航 */
- .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;}
- .el-radio-button__inner{border:0;}
- .el-radio-button:last-child .el-radio-button__inner {border-radius: 4px 4px 4px 4px;}
- </style>
- <div class="all">
- <div id="app" v-cloak>
- <div class="vue-crumbs">
- {!! (defined('CPS_PLUGIN_NAME') ? CPS_PLUGIN_NAME : '聚合CPS') !!} > 商学院管理
- </div>
- <div class="vue-head">
- <div class="vue-main-title" style="margin-bottom:20px">
- <div class="vue-main-title-left"></div>
- <div class="vue-main-title-content">商学院管理</div>
- <div class="vue-main-title-button">
- <el-button type="primary" plain icon="el-icon-plus" size="small" @click="addModal">添加栏目</el-button>
- </div>
- </div>
- <div class="vue-search">
- <el-form :inline="true" :model="search_form" class="demo-form-inline">
- <el-form-item label="">
- <el-input v-model="search_form.title" placeholder="栏目名称"></el-input>
- </el-form-item>
- <el-form-item label="">
- <el-button type="primary" @click="search(1)">搜索</el-button>
- </el-form-item>
- </el-form>
- </div>
- </div>
- <div class="vue-main">
- <div class="vue-main-form">
- <div class="vue-main-title" style="margin-bottom:20px">
- <div class="vue-main-title-left"></div>
- <div class="vue-main-title-content" style="flex:0 0 90px">栏目列表</div>
- <div class="" style="text-align:left;font-size:12px;color:#999">
- <span>栏目数量:[[total]]</span>
- </div>
- <div class="vue-main-title-button">
- </div>
- </div>
- <el-table :data="list" style="width: 100%">
- <el-table-column label="排序" align="center" prop="sort" width="70">
- </el-table-column>
- <el-table-column label="栏目ID" align="center" prop="id" width="70">
- </el-table-column>
- <el-table-column label="栏目名称" align="center" prop="title" >
- </el-table-column>
- <el-table-column label="是否显示" align="center" width="80">
- <template slot-scope="scope">
- <div>
- <el-tooltip placement="top">
- <div slot="content">[[scope.row.is_show==1?'显示':'隐藏']]</div>
- <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>
- </el-tooltip>
- </div>
- </template>
- </el-table-column>
- <el-table-column label="内容数量" align="center" prop="number" width="80">
- </el-table-column>
- <el-table-column label="操作" align="center" >
- <template slot-scope="scope">
- <div>
- <el-button type="primary" @click="editChild(scope.row)">编辑</el-button>
- <el-button type="primary" @click="content(scope.row)">查看内容</el-button>
- <el-button type="primary" @click="del(scope.row.id,scope.row)">删除</el-button>
- </div>
- </template>
- </el-table-column>
- </el-table>
- </div>
- </div>
- <!-- 分页 -->
- <div class="vue-page" v-if="total>0">
- <el-row>
- <el-col align="right">
- <el-pagination layout="prev, pager, next,jumper" @current-change="search" :total="total"
- :page-size="per_page" :current-page="current_page" background
- ></el-pagination>
- </el-col>
- </el-row>
- </div>
- </div>
- </div>
- <script>
- var app = new Vue({
- el: "#app",
- delimiters: ['[[', ']]'],
- name: 'test',
- data() {
- return {
- list:[],
- search_form:{
- title:'',
- },
- // 统计
- total: 0,
- rules: {},
- current_page:1,
- per_page:1,
- }
- },
- created() {
- },
- mounted() {
- this.getData(1);
- },
- methods: {
- getData(page) {
- let json = {
- page:page,
- title:this.search_form.title,
- };
- let loading = this.$loading({target:document.querySelector(".content"),background: 'rgba(0, 0, 0, 0)'});
- this.$http.post('{!! yzWebFullUrl('plugin.aggregation-cps.admin.commerce-academy.get-column-list') !!}',json).then(function(response) {
- if (response.data.result) {
- this.list = response.data.data.data;
- this.current_page=response.data.data.current_page;
- this.total=response.data.data.total;
- this.per_page=response.data.data.per_page;
- loading.close();
- } else {
- this.$message({
- message: response.data.msg,
- type: 'error'
- });
- }
- loading.close();
- }, function(response) {
- this.$message({
- message: response.data.msg,
- type: 'error'
- });
- loading.close();
- });
- },
- search(val) {
- this.getData(val);
- },
- // 编辑
- editChild(item) {
- let link = `{!! yzWebFullUrl('plugin.aggregation-cps.admin.commerce-academy.add-column') !!}`+`&id=`+item.id;
- window.location.href = link;
- },
- del(id,index) {
- this.$confirm('确定删除吗', '提示', {confirmButtonText: '确定',cancelButtonText: '取消',type: 'warning'}).then(() => {
- let loading = this.$loading({target:document.querySelector(".content"),background: 'rgba(0, 0, 0, 0)'});
- this.$http.post('{!! yzWebFullUrl('plugin.aggregation-cps.admin.commerce-academy.delete-column') !!}',{id:id}).then(function (response) {
- if (response.data.result) {
- this.list.splice(index,1);
- this.$message({type: 'success',message: '删除成功!'});
- }
- else{
- this.$message({type: 'error',message: response.data.msg});
- }
- loading.close();
- this.search(this.current_page)
- },function (response) {
- this.$message({type: 'error',message: response.data.msg});
- loading.close();
- }
- );
- }).catch(() => {
- this.$message({type: 'info',message: '已取消删除'});
- });
- },
- // 设置显不显示
- changeHide(id,is_show) {
- let json = {
- id:id,
- is_show:is_show,
- }
- let url = `{!! yzWebFullUrl('plugin.aggregation-cps.admin.commerce-academy.is-show-column') !!}`;
- console.log(json);
- let loading = this.$loading({target:document.querySelector(".content"),background: 'rgba(0, 0, 0, 0)'});
- this.$http.post(url,json).then(function (response) {
- if (response.data.result) {
- this.$message({type: 'success',message: '操作成功!'});
- }
- else{
- this.$message({type: 'error',message: response.data.msg});
- }
- loading.close();
- this.search(this.current_page);
- },function (response) {
- this.$message({type: 'error',message: response.data.msg});
- loading.close();
- })
- },
- // 添加
- addModal() {
- let link = `{!! yzWebFullUrl('plugin.aggregation-cps.admin.commerce-academy.add-column') !!}`;
- console.log(link);
- window.location.href = link;
- },
- content(item) {
- let link = `{!! yzWebFullUrl('plugin.aggregation-cps.admin.commerce-academy.content') !!}`+`&academy_id=`+item.id;
- console.log(link);
- window.location.href = link;
- },
- },
- })
- </script>
- @endsection
|