Ver código fonte

报纸管理列表及创建页面

natasha 1 ano atrás
pai
commit
49dca1ae83

+ 2 - 2
src/components/NavMenu.vue

@@ -49,7 +49,7 @@ export default {
             node:[
                 {
                     title:'报纸管理',
-                    index:'flow_manage',
+                    index:'newspaper_manage',
                 },
                 {
                     title:'画刊管理',
@@ -93,7 +93,7 @@ export default {
             index:'organize_manage'
         },
         {
-            title:'人员管理',
+            title:'系统用户',
             icon:'contacts-line',
             index:'people_manage'
         },

+ 10 - 0
src/router/index.js

@@ -94,6 +94,16 @@ export const constantRoutes = [{
         component: () =>
             import ('@/views/content_manage/course_manage/CreateRecorded.vue')
     },
+    {
+        path: '/newspaper_manage',
+        component: () =>
+            import ('@/views/newspaper_manage/index.vue')
+    },
+    {
+        path: '/createNewspaper',
+        component: () =>
+            import ('@/views/newspaper_manage/CreateNewspaper.vue')
+    },
     // 404 page must be placed at the end !!!
     { path: '*', redirect: '/', hidden: true }
 ]

+ 1 - 1
src/views/content_manage/course_manage/LiveCourse.vue

@@ -435,7 +435,7 @@ export default {
         let list = this.studyList
         if(row.study){
             for(let i=0;i<list.length;i++){
-                if(row.type===list[i].value){
+                if(row.study===list[i].value){
                     studyCn = list[i].label
                 }
             }

+ 0 - 6
src/views/login.vue

@@ -24,12 +24,6 @@
                         </i>
                     </el-input>
                 </el-form-item>
-                <el-form-item label="账号类型" prop="type">
-                    <el-radio-group v-model="loginPwdForm.type">
-                        <el-radio label="USER">普通用户</el-radio>
-                        <el-radio label="ADMIN">管理员</el-radio>
-                    </el-radio-group>
-                </el-form-item>
                 <el-form-item prop="userAgreeCheck" class="userAgree-box">
                     <el-checkbox-group v-model="loginPwdForm.userAgreeCheck">
                         <el-checkbox label="1" name="userAgreeCheck"><a @click.prevent="lookUserAgreement">阅读并同意《用户协议》</a></el-checkbox>

+ 200 - 0
src/views/newspaper_manage/CreateNewspaper.vue

@@ -0,0 +1,200 @@
+<template>
+  <div class="manage-root personnel-create">
+    <Header />
+    <div class="manage-root-contain">
+        <nav-menu class="manage-root-contain-left" :activeMenuIndex="activeMenuIndex"></nav-menu>
+        <div class="manage-root-contain-right">
+            <breadcrumb :breadcrumbList="breadcrumbList" class="breadcrumb-box"></breadcrumb>
+            <div class="create-top">
+                <div class="common-title-box">
+                    <h3>{{id?'编辑报纸':'创建报纸'}}</h3>
+                    <div class="btn-box">
+                        <el-button size="small" @click="handleStep('-')" :disabled="stepIndex===0">上一步</el-button>
+                        <el-button type="primary" size="small" @click="handleStep('+')" :disabled="stepIndex===2">下一步</el-button>
+                    </div>
+                </div>
+                <el-steps :active="stepIndex" align-center>
+                    <el-step title="报纸信息" description="填写报纸基本信息">
+                        <svg-icon icon-class="dot" slot="icon" class="svg-dot"></svg-icon>
+                    </el-step>
+                    <el-step title="添加内容" description="为报纸添加内容">
+                        <svg-icon icon-class="dot" slot="icon" class="svg-dot"></svg-icon>
+                    </el-step>
+                    <el-step :title="id?'完成编辑':'完成创建'" :description="id?'报纸编辑完成':'报纸创建完成'">
+                        <svg-icon icon-class="dot" slot="icon" class="svg-dot"></svg-icon>
+                    </el-step>
+                </el-steps>
+            </div>
+            <div class="create-bottom">
+                <template v-if="stepIndex===0"></template>
+                <div class="step-div-1" v-if="stepIndex===1">
+                    
+                </div>
+                <div v-if="stepIndex===2">
+                    <el-result icon="success" :subTitle="id?'报纸编辑成功':'报纸创建成功'">
+                        <template slot="extra">
+                            <el-button size="small" @click="handleback">返回列表</el-button>
+                            <el-button type="primary" size="small" @click="handleCreate">继续创建</el-button>
+                        </template>
+                    </el-result>
+                </div>
+            </div>
+        </div>
+    </div>
+  </div>
+</template>
+
+<script>
+//这里可以导入其它文件(比如:组件,工具js,第三方插件js,json文件,图片文件等等)
+//例如:import 《组件名称》from ‘《组件路径》';
+import Header from "../../components/Header.vue";
+import NavMenu from "../../components/NavMenu.vue"
+import Breadcrumb from '../../components/Breadcrumb.vue';
+
+export default {
+  //import引入的组件需要注入到对象中才能使用
+  components: { Header, NavMenu, Breadcrumb },
+  props: {},
+  data() {
+    return {
+        activeMenuIndex: "newspaper_manage",
+        breadcrumbList:[
+            {
+                icon:'file-list-line',
+                url:'',
+                text:''
+            },
+            {
+                icon:'',
+                url:'',
+                notLink: true,
+                text:'内容管理'
+            },
+            {
+                icon:'',
+                url:'',
+                text:'报纸管理'
+            }
+        ],
+        id:this.$route.query.id?this.$route.query.id:'',
+        stepIndex:0, // 步骤索引
+    }
+  },
+  //计算属性 类似于data概念
+  computed: {
+    
+  },
+  //监控data中数据变化
+  watch: {
+    
+  },
+  //方法集合
+  methods: {
+    // 上一步下一步
+    handleStep(type){
+        if(type=='-'){
+            if(this.stepIndex>0) this.stepIndex--
+        }else{
+            if(this.stepIndex<2) this.stepIndex++
+        }
+    },
+    // 返回列表
+    handleback(){
+        this.$router.push({
+            path: "/newspaper_manage",
+            query: {
+                
+            },
+        });
+    },
+    //继续创建
+    handleCreate(){
+        this.$router.replace('/createNewspaper')
+        location.reload()
+    }
+  },
+  //生命周期 - 创建完成(可以访问当前this实例)
+  created() {
+    let obj = {
+        icon:'',
+        url:'',
+        text:'创建报纸'
+    }
+    if(this.id){
+        obj.text = '编辑报纸'
+    }
+    this.breadcrumbList.push(obj)
+  },
+  //生命周期 - 挂载完成(可以访问DOM元素)
+  mounted() {
+
+  },
+  //生命周期-创建之前
+  beforeCreated() { },
+  //生命周期-挂载之前
+  beforeMount() { },
+  //生命周期-更新之前
+  beforUpdate() { },
+  //生命周期-更新之后
+  updated() { },
+  //生命周期-销毁之前
+  beforeDestory() { },
+  //生命周期-销毁完成
+  destoryed() { },
+  //如果页面有keep-alive缓存功能,这个函数会触发
+  activated() { }
+}
+</script>
+<style lang="scss" scoped>
+/* @import url(); 引入css类 */
+.create-top{
+    background: #FFFFFF;
+    border-radius: 4px;
+    padding: 24px;
+    .common-title-box{
+        margin-bottom: 4px;
+    }
+}
+.create-bottom{
+    padding: 40px 40px;
+    margin-top: 16px;
+    background: #FFFFFF;
+    border-radius: 4px;
+    height: calc(100vh - 292px);
+    overflow: auto;
+    .tips{
+        margin: 0;
+        color: #86909C;
+        font-size: 12px;
+        line-height: 20px;
+    }
+    .step-table{
+        border: 1px solid #E5E6EB;
+        border-collapse: collapse;
+        font-size: 14px;
+        line-height: 22px;
+        color: #1D2129;
+        text-align: center;
+        margin-bottom: 24px;
+        &-header{
+            background: #F7F8FA;
+            width: 120px !important;
+            color: #86909C;
+            font-weight: 500;
+        }
+        td{
+            height: 40px;
+            width: 260px;
+            border: 1px solid #E5E6EB;
+            &.td1{
+                width: 130px;
+            }
+        }
+        .step-cascader{
+            width: 250px;
+            height: 32px;
+            line-height: 32px;
+        }
+    }
+}
+</style>

+ 487 - 0
src/views/newspaper_manage/index.vue

@@ -0,0 +1,487 @@
+<template>
+  <div class="manage-root organize-manage">
+    <Header />
+    <div class="manage-root-contain">
+        <nav-menu class="manage-root-contain-left" :activeMenuIndex="activeMenuIndex"></nav-menu>
+        <div class="manage-root-contain-right personnel-manage-right">
+            <breadcrumb :breadcrumbList="breadcrumbList" class="breadcrumb-box"></breadcrumb>
+            <div class="personal-inner">
+                <div class="common-title-box">
+                    <h3>报纸管理</h3>
+                    <div class="btn-box">
+                        <el-button type="primary" size="small" @click="handleEdit">创建报纸</el-button>
+                    </div>
+                </div>
+                <div class="search-box">
+                    <div class="search-item">
+                        <label>搜索</label>
+                        <el-input
+                            placeholder="输入搜索内容"
+                            v-model="searchInput">
+                            <i slot="suffix" class="el-input__icon el-icon-search" @click="getList" style="cursor: pointer;"></i>
+                        </el-input>
+                    </div>
+                    <div class="search-item">
+                        <label>状态</label>
+                        <el-select v-model="searchStatus" @change="getList" placeholder="请选择">
+                            <el-option
+                                v-for="item in searchStatusList"
+                                :key="item.value"
+                                :label="item.label"
+                                :value="item.value">
+                            </el-option>
+                        </el-select>
+                    </div>
+                    <div class="search-item">
+                        <label>年份</label>
+                        <el-select v-model="searchYear" @change="getList" placeholder="请选择">
+                            <el-option
+                                v-for="item in 10"
+                                :key="item+2013"
+                                :label="item+2013"
+                                :value="item+2013">
+                            </el-option>
+                        </el-select>
+                    </div>
+                    <div class="search-item">
+                        <label>学段</label>
+                        <el-select v-model="searchStudy" @change="getList" placeholder="请选择">
+                            <el-option
+                                v-for="item in studyList"
+                                :key="item.value"
+                                :label="item.label"
+                                :value="item.value">
+                            </el-option>
+                        </el-select>
+                    </div>
+                </div>
+                <el-table
+                    class="search-table"
+                    :data="tableData"
+                    style="width: 100%"
+                    :max-height="tableHeight">
+                    <el-table-column
+                        type="index"
+                        label="#"
+                        sortable
+                        width="56">
+                    </el-table-column>
+                    <el-table-column
+                        prop="name"
+                        label="名称"
+                        sortable
+                        min-width="226">
+                    </el-table-column>
+                    <el-table-column
+                        prop="periods"
+                        label="期数"
+                        width="84">
+                    </el-table-column>
+                    <el-table-column
+                        prop="study"
+                        label="学段"
+                        width="72">
+                        <template slot-scope="scope">
+                            {{formatterStudy(scope.row)}}
+                        </template>
+                    </el-table-column>
+                    <el-table-column
+                        prop="status"
+                        label="状态"
+                        width="104" >
+                        <template slot-scope="scope">
+                            <div class="status-box">
+                                <span :style="{background:statusList[scope.row.status].bg}"></span>
+                                <b :style="{color:statusList[scope.row.status].color}">{{statusList[scope.row.status].text}}</b>
+                            </div>
+                        </template>
+                    </el-table-column>
+                    <el-table-column
+                        prop="creator"
+                        label="创建人"
+                        width="88">
+                    </el-table-column>
+                    <el-table-column
+                        prop="createData"
+                        label="创建时间"
+                        width="144" >
+                    </el-table-column>
+                    <el-table-column
+                        prop="updator"
+                        label="最近编辑"
+                        min-width="96">
+                    </el-table-column>
+                    <el-table-column
+                        prop="expirationDate"
+                        label="最近编辑时间"
+                        width="144">
+                    </el-table-column>
+                    <el-table-column
+                        fixed="right"
+                        label="操作"
+                        width="220">
+                        <template slot-scope="scope">
+                            <el-button
+                                @click.native.prevent="handleEdit(scope.row)"
+                                type="text"
+                                size="small"
+                                class="primary-btn">
+                                信息
+                            </el-button>
+                            <el-button
+                                @click.native.prevent="handlePerson(scope.row)"
+                                type="text"
+                                size="small"
+                                class="primary-btn">
+                                编辑
+                            </el-button>
+                            <el-button
+                                @click.native.prevent="handleUp(scope.row, scope.$index)"
+                                type="text"
+                                size="small"
+                                class="primary-btn"
+                                v-if="scope.row.status==='0'">
+                                审核
+                            </el-button>
+                            <el-button
+                                @click.native.prevent="handleUp(scope.row, scope.$index)"
+                                type="text"
+                                size="small"
+                                class="primary-btn"
+                                v-if="scope.row.status==='0'">
+                                上架
+                            </el-button>
+                            <el-button
+                                @click.native.prevent="handleUp(scope.row, scope.$index)"
+                                type="text"
+                                size="small"
+                                class="red-btn"
+                                v-else-if="scope.row.status==='1'">
+                                下架
+                            </el-button>
+                            <el-button
+                                @click.native.prevent="handleDelete(scope.row, scope.$index)"
+                                type="text"
+                                size="small"
+                                class="red-btn">
+                                删除
+                            </el-button>
+                        </template>
+                    </el-table-column>
+                </el-table>
+                <el-pagination
+                    background
+                    @size-change="handleSizeChange"
+                    @current-change="handleCurrentChange"
+                    :current-page="pageNumber"
+                    :page-sizes="[10, 20, 30, 40]"
+                    :page-size="pageSize"
+                    layout="total, prev, pager, next, sizes, jumper"
+                    :total="tableData.length">
+                </el-pagination>
+            </div>
+        </div>
+    </div>
+  </div>
+</template>
+
+<script>
+//这里可以导入其它文件(比如:组件,工具js,第三方插件js,json文件,图片文件等等)
+//例如:import 《组件名称》from ‘《组件路径》';
+import Header from "../../components/Header.vue";
+import NavMenu from "../../components/NavMenu.vue"
+import Breadcrumb from '../../components/Breadcrumb.vue';
+import {
+  provinceAndCityData
+} from "element-china-area-data";
+
+export default {
+  //import引入的组件需要注入到对象中才能使用
+  components: { Header, NavMenu, Breadcrumb },
+  props: {},
+  data() {
+    //这里存放数据
+    return {
+        provinceAndCityData,
+        activeMenuIndex: "newspaper_manage",
+        breadcrumbList:[
+            {
+                icon:'file-list-line',
+                url:'',
+                text:''
+            },
+            {
+                icon:'',
+                url:'',
+                notLink: true,
+                text:'内容管理'
+            },
+            {
+                icon:'',
+                url:'',
+                text:'报纸管理'
+            }
+        ],
+        searchInput: '',
+        searchStudy: '',
+        searchStatus: '',
+        searchYear: '', 
+        searchArea:[],
+        typeList:[
+            {
+                value:'',
+                label:'全部'
+            },
+            {
+                value:'0',
+                label:'小学'
+            },
+            {
+                value:'1',
+                label:'初中'
+            },
+            {
+                value:'2',
+                label:'高中'
+            },
+            {
+                value:'3',
+                label:'大学'
+            }
+        ],
+        studyList:[
+            {
+                value:'',
+                label:'全部'
+            },
+            {
+                value:'0',
+                label:'初一'
+            },
+            {
+                value:'1',
+                label:'初二'
+            },
+            {
+                value:'2',
+                label:'初三'
+            },
+            {
+                value:'3',
+                label:'高一'
+            }
+        ],
+        searchStatusList:[
+            {
+                value:'',
+                label:'全部'
+            },
+            {
+                value:'1',
+                label:'已上架'
+            },
+            {
+                value:'0',
+                label:'未上架'
+            }
+        ],
+        statusList:{
+            '1':{
+                text:'已上架',
+                bg:'#165DFF',
+                color:''
+            },
+            '0':{
+                text:'未上架',
+                bg:'#F53F3F',
+                color:'#F53F3F'
+            }
+        },
+        tableData:[
+            {
+                id:'1',
+                name:'第 987 期 Teens Senior 2',
+                periods:'40',
+                study:'0',
+                status:'1',
+                creator:'何家洪',
+                createData:'2018-02-03',
+                updator:'周志伟',
+                expirationDate:'2018-02-03'
+            },
+            {
+                id:'2',
+                name:'第 804 期 Teens Senior 3',
+                periods:'986',
+                study:'3',
+                status:'1',
+                creator:'赵志军',
+                createData:'2018-02-03',
+                updator:'李浩东',
+                expirationDate:'2018-02-03'
+            },
+            {
+                id:'3',
+                name:'983期',
+                periods:'982-988',
+                study:'2',
+                status:'0',
+                creator:'何家洪',
+                admin:'周志伟',
+                createData:'2018-02-03',
+                updator:'张三',
+                expirationDate:'2018-02-03'
+            },
+        ],
+        pageSize: window.localStorage.getItem('pageSize')?Number(window.localStorage.getItem('pageSize')):10, 
+        pageNumber: window.localStorage.getItem('pageNumber')?Number(window.localStorage.getItem('pageNumber')):1,
+        tableHeight: "" // 表格高度
+    }
+  },
+  //计算属性 类似于data概念
+  computed: {
+    
+  },
+  //监控data中数据变化
+  watch: {},
+  //方法集合
+  methods: {
+    // 查询列表
+    getList(){
+    },
+    // 处理学段
+    formatterStudy(row){
+        let studyCn = ''
+        let list = this.studyList
+        if(row.study){
+            for(let i=0;i<list.length;i++){
+                if(row.study===list[i].value){
+                    studyCn = list[i].label
+                }
+            }
+        }else{
+            studyCn = '未知'
+        }
+        return studyCn
+    },
+    // 创建机构或者编辑信息
+    handleEdit(row){
+        // 根据登录用户判断当前用户是不是超管 在table里加上disabled
+
+        // 点击时记录页码和每页条数
+        window.localStorage.setItem('pageSize',this.pageSize)
+        window.localStorage.setItem('pageNumber',this.pageNumber)
+        this.$router.push({
+            path: "/createNewspaper",
+            query: {
+                id: row?row.id:''
+            },
+        });
+    },
+    // 人员管理
+    handlePerson(row){
+        window.localStorage.setItem('pageSize',this.pageSize)
+        window.localStorage.setItem('pageNumber',this.pageNumber)
+        this.$router.push({
+            path: "/createNewspaper",
+            query: {
+                id: row?row.id:''
+            },
+        });
+    },
+    // 停用 启用
+    handleUp(row, index) {
+      let Mname = "book-book_manager-SetPublishStatusForBook";
+      let updataData = JSON.parse(JSON.stringify(row));
+      let data = {
+        book_id: row.id
+      };
+      if (row.publish_status == 0) {
+        // 下架状态
+        data.publish_status = 1;
+        updataData.publish_status = 1;
+      } else if (row.publish_status == 1) {
+        data.publish_status = 0;
+        updataData.publish_status = 0;
+      }
+    //   getContent(Mname, data).then(res => {
+    //     this.$message.success("操作成功");
+    //     this.$set(this.tableData, index, updataData);
+    //   });
+    },
+    // 删除
+    handleDelete(row){
+        this.$confirm('确定删除吗?', '提示', {
+          confirmButtonText: '确定',
+          cancelButtonText: '取消',
+          type: 'warning'
+        }).then(() => {
+          this.$message({
+            type: 'success',
+            message: '删除成功!'
+          });
+        }).catch(() => {
+          this.$message({
+            type: 'info',
+            message: '已取消删除'
+          });          
+        });
+    },
+    handleSizeChange(val) {
+        this.pageSize = val
+    },
+    handleCurrentChange(val) {
+        this.pageNumber = val
+    },
+    //计算table高度(动态设置table高度)
+    getTableHeight() {
+      let tableH = 370; //距离页面下方的高度
+      let tableHeightDetil = window.innerHeight - tableH;
+      if (tableHeightDetil <= 300) {
+        this.tableHeight = 300;
+      } else {
+        this.tableHeight = window.innerHeight - tableH;
+      }
+    },
+  },
+  //生命周期 - 创建完成(可以访问当前this实例)
+  created() {
+    this.getTableHeight();
+  },
+  //生命周期 - 挂载完成(可以访问DOM元素)
+  mounted() {
+
+  },
+  //生命周期-创建之前
+  beforeCreated() { },
+  //生命周期-挂载之前
+  beforeMount() { },
+  //生命周期-更新之前
+  beforUpdate() { },
+  //生命周期-更新之后
+  updated() { },
+  //生命周期-销毁之前
+  beforeDestory() { },
+  //生命周期-销毁完成
+  destoryed() { },
+  //如果页面有keep-alive缓存功能,这个函数会触发
+  activated() { }
+}
+</script>
+<style lang="scss" scoped>
+/* @import url(); 引入css类 */
+
+</style>
+<style lang="scss">
+.organize-manage{
+    .el-cascader{
+        width: 160px;
+        height: 32px;
+        line-height: 32px;
+        .el-input{
+            width: 100%;
+            height: 32px;
+        }
+    }
+}
+</style>

+ 2 - 2
src/views/people_manage/CreatePerson.vue

@@ -94,7 +94,7 @@
                     <table class="step-table">
                         <tr>
                             <td rowspan="2" class="step-table-header">管理权限</td>
-                            <td>人员管理</td>
+                            <td>系统用户</td>
                             <td>机构管理</td>
                         </tr>
                         <tr>
@@ -254,7 +254,7 @@ export default {
             {
                 icon:'',
                 url:'/people_manage',
-                text:'人员管理'
+                text:'系统用户'
             }
         ],
         id:this.$route.query.id?this.$route.query.id:'',

+ 1 - 1
src/views/people_manage/index.vue

@@ -174,7 +174,7 @@ export default {
             {
                 icon:'',
                 url:'',
-                text:'人员管理'
+                text:'系统用户'
             }
         ],
         searchInput: '',