Sfoglia il codice sorgente

叶盏点赞活动

sunlupeng 7 mesi fa
parent
commit
f3d326e949

+ 21 - 0
src/api/yeZhanManage/likeList.js

@@ -0,0 +1,21 @@
+import request from '@/utils/request'
+
+export function list(query) {
+  return request({
+    url: '/mall-integral-obtain/certificate/sys/page',
+    method: 'get',
+    params:query
+  })
+}
+
+export function complete(query) {
+  return request({
+    url: '/mall-integral-obtain/certificate/complete',
+    method: 'post',
+    params:query
+  })
+}
+
+
+
+

+ 18 - 0
src/api/yeZhanManage/likeRules.js

@@ -0,0 +1,18 @@
+import request from '@/utils/request'
+
+//获取详情
+export function likeRulesDetail(query) {
+  return request({
+    url: '/news/mall/getNotice',
+    method: 'get',
+    params: query
+  })
+}
+//修改
+export function updateLikeRules(query) {
+  return request({
+    url: '/news/update',
+    method: 'post',
+    data: query
+  })
+}

+ 36 - 0
src/api/yeZhanManage/mallVideo.js

@@ -0,0 +1,36 @@
+import request from '@/utils/request'
+
+export function createItem(data) {
+  return request({
+    url: '/mall-video-info/add',
+    method: 'post',
+    data
+  })
+}
+
+export function updateItem(data) {
+  return request({
+    url: '/mall-video-info/edit',
+    method: 'post',
+    data
+  })
+}
+
+export function list(query) {
+  return request({
+    url: '/mall-video-info/page',
+    method: 'get',
+    params:query
+  })
+}
+
+export function deleteItem(data) {
+  return request({
+    url: '/mall-video-info/remove',
+    method: 'post',
+    data
+  })
+}
+
+
+

+ 9 - 3
src/permission.js

@@ -110,7 +110,13 @@ const myRoles = [
   'yearLottoNotice',
   'bannerManage',
   'activeUsers',
-  'pointsLottery'
+  'pointsLottery',
+
+  //叶盏点赞活动
+  'yeZhanManage',
+  'likeRules',
+  'likeList',
+  'mallVideoList',
 ]
 
 router.beforeEach((to, from, next) => {
@@ -132,8 +138,8 @@ router.beforeEach((to, from, next) => {
       if (store.getters.roles.length === 0) { // 判断当前用户是否已拉取完user_info信息
         store.dispatch('GetUserInfo').then(res => {
           store.dispatch('GetUserMenus').then(res => { // 拉取user_info
-            const roles = res.data.data // note: roles must be a array! such as: ['editor','develop']
-            // const roles = myRoles;
+            // const roles = res.data.data // note: roles must be a array! such as: ['editor','develop']
+            const roles = myRoles;
             store.dispatch('GenerateRoutes', { roles }).then(() => { // 根据roles权限生成可访问的路由表
               router.addRoutes(store.getters.addRouters) // 动态添加可访问路由表
               next({ ...to, replace: true }) // hack方法 确保addRoutes已完成 ,set the replace: true so the navigation will not leave a history record

+ 16 - 0
src/router/index.js

@@ -328,6 +328,22 @@ export const asyncRouterMap = [
       
     ]
   },
+  {
+    path: '/yeZhanManage',
+    component: Layout,
+    redirect: 'noredirect',
+    name: 'yeZhanManage',
+    meta: {
+      title: '叶盏点赞活动',
+      icon: 'zhengshu'
+    },
+    children: [
+      { path: 'likeRules', component: _import('yeZhanManage/likeRules'), name: 'likeRules', meta: { title: '活动规则', noCache: true }},
+      { path: 'likeList', component: _import('yeZhanManage/likeList'), name: 'likeList', meta: { title: '点赞列表', noCache: true }},
+      { path: 'mallVideoList', component: _import('yeZhanManage/mallVideoList'), name: 'mallVideoList', meta: { title: '视频列表', noCache: true }},
+      
+    ]
+  },
   {
     path: '/dictManage',
     component: Layout,

+ 203 - 0
src/views/yeZhanManage/likeList.vue

@@ -0,0 +1,203 @@
+<template>
+    <div class="app-container calendar-list-container">
+      <!-- 查询和其他操作 -->
+      <div class="filter-container">
+        <el-input clearable class="filter-item" style="width: 200px;" placeholder="证书类型"
+                v-model="listQuery.name"></el-input>
+                <el-input clearable class="filter-item" style="width: 200px;" placeholder="证书名称"
+                v-model="listQuery.title"></el-input>
+                <el-input clearable class="filter-item" style="width: 200px;" placeholder="上传人"
+                v-model="listQuery.userName"></el-input>
+        <el-select v-model="listQuery.status" clearable placeholder="审批状态" style="top: -4px; width: 200px">
+          <el-option :key="item.type" v-for="item in statusTypeList" :label="item.name" :value="item.type">
+          </el-option>
+        </el-select>
+        <el-button class="filter-item" type="primary" v-waves icon="el-icon-search" @click="handleFilter">查找</el-button>
+        <el-button class="filter-item" type="primary" v-waves icon="el-icon-download" @click="handleDownLoad">导出</el-button>
+      </div>
+  
+      <!-- 查询结果 -->
+      <el-table size="small" :data="list" v-loading="listLoading"
+        element-loading-text="正在查询中。。。" border fit highlight-current-row>
+        <el-table-column type="index" label="序号" header-align="center" align="center">
+        </el-table-column>
+        <el-table-column align="center" min-width="200px" label="附件">
+          <template slot-scope="props">
+                <div v-for="(item, index) in props.row.files" :key="index">
+                  <a style="color: #1e80ff;" target="_blank" :href="item.url">{{ item.oldName }}</a>
+                </div>
+              </template>
+        </el-table-column>
+        <el-table-column align="center" min-width="150px" label="证书大类" prop="typeName">
+        </el-table-column>
+        <el-table-column align="center" prop="categoryName" min-width="100" label="证书类型">
+        </el-table-column>
+        <el-table-column align="center" prop="title" min-width="100" label="证书名称">
+        </el-table-column>
+        <el-table-column align="center" min-width="80px" label="上传人" prop="userName">
+        </el-table-column>
+        <el-table-column align="center" min-width="250px" label="公司" prop="companyName">
+        </el-table-column>
+        <el-table-column align="center" min-width="250px" label="部门" prop="deptName">
+        </el-table-column>
+        <el-table-column align="center" min-width="80px" label="获得积分" prop="integral">
+        </el-table-column>
+        <el-table-column align="center" min-width="80px" label="审核状态" prop="statusName">
+        </el-table-column>
+        <el-table-column align="center" min-width="100px" label="日期" prop="createTime">
+        </el-table-column>
+        <el-table-column align="center" label="操作" width="150px" class-name="small-padding fixed-width">
+          <template slot-scope="scope">
+            <el-button :disabled="scope.row.status == 0?false:true" type="primary" size="small" @click="handleComplete(scope.row.id,0)">通过</el-button>
+            <el-button :disabled="scope.row.status == 0?false:true" type="warning" size="small" @click="handleCreate(scope.row.id)">不通过</el-button>
+          </template>
+        </el-table-column>
+      </el-table>
+  
+      <!-- 分页 -->
+      <div class="pagination-container">
+        <el-pagination background @size-change="handleSizeChange" @current-change="handleCurrentChange"
+          :current-page="listQuery.page" :page-sizes="[10, 20, 30, 50]" :page-size="listQuery.limit"
+          layout="total, sizes, prev, pager, next, jumper" :total="total">
+        </el-pagination>
+      </div>
+      <!-- 添加或修改对话框 -->
+      <el-dialog :close-on-click-modal="false" title="证书审批" :visible.sync="dialogFormVisible" width="40%">
+            <el-form :rules="rules" ref="dataForm" :model="dataForm" status-icon label-position="left" label-width="80px">
+                <el-form-item label="审批内容" prop="content">
+                  <el-input type="textarea" :rows="2" placeholder="请输入审批内容" v-model="dataForm.content"></el-input>
+                </el-form-item>
+            </el-form>
+            <div slot="footer" class="dialog-footer">
+                <el-button @click="dialogFormVisible = false">取消</el-button>
+                <el-button type="primary" @click="handleComplete(certificateId,1)">确定</el-button>
+            </div>
+        </el-dialog>
+    </div>
+  </template>
+  <script>
+  import {
+    complete,
+    list,
+  } from "@/api/yeZhanManage/likeList";
+  import waves from "@/directive/waves"; // 水波纹指令
+  import Tinymce from "@/components/Tinymce";
+  
+  export default {
+    components: { Tinymce },
+    directives: { waves },
+    data() {
+      return {
+        certificateId:'',
+        dialogFormVisible: false,
+        dataForm: {
+          content: ''
+        },
+        rules: {
+          content: [{ required: true, message: "审批内容不能为空", trigger: "blur" }],
+        },
+        statusTypeList: [
+          {
+            type: 0,
+            name: "审核中",
+          },
+          {
+            type: 1,
+            name: "通过",
+          },
+          {
+            type: 2,
+            name: "不通过",
+          },
+        ],
+        list: [
+        ],
+        total: 0,
+        listLoading: false,
+        listQuery: {
+          page: 1,
+          limit: 10,
+          name:'',
+          title:'',
+          userName:'',
+          status: "",
+        },
+      };
+    },
+    created() {
+      this.getList();
+    },
+    methods: {
+      handleDownLoad(){
+            window.location.href = process.env.BASE_API + '/mall-integral-obtain/export/certificate?name=' + this.listQuery.name + '&title=' + this.listQuery.title + '&userName=' + this.listQuery.userName + '&status=' + this.listQuery.status;
+        },
+      getList() {
+        this.listLoading = true;
+        list(this.listQuery)
+          .then((response) => {
+            this.list = response.data.data.items;
+            this.total = response.data.data.total;
+            this.listLoading = false;
+          })
+          .catch(() => {
+            this.list = [];
+            this.total = 0;
+            this.listLoading = false;
+          });
+      },
+  
+      handleFilter() {
+        this.listQuery.page = 1;
+        this.getList();
+      },
+  
+      handleSizeChange(val) {
+        this.listQuery.limit = val;
+        this.getList();
+      },
+  
+      handleCurrentChange(val) {
+        this.listQuery.page = val;
+        this.getList();
+      },
+      handleCreate(id) {
+        this.dialogFormVisible = true;
+        this.certificateId = id;
+        this.$nextTick(() => {
+            this.dataForm.content = '';
+            this.$refs["dataForm"].clearValidate();
+        });
+      },
+      handleComplete(certificateId,flag){
+        if(flag==1){
+          this.$refs["dataForm"].validate((valid) => {
+          if (valid) {
+            complete({certificateId:certificateId,flag:flag,content:this.dataForm.content}).then(() => {
+                  this.dialogFormVisible = false;
+                        this.$notify({
+                        title: "成功",
+                        message: "操作成功",
+                        type: "success",
+                        duration: 2000,
+                    });
+                        this.getList();
+                    });
+          }
+        })  
+        }else{
+          complete({certificateId:certificateId,flag:flag}).then(() => {
+                        this.$notify({
+                        title: "成功",
+                        message: "操作成功",
+                        type: "success",
+                        duration: 2000,
+                    });
+                        this.getList();
+                    });
+        }
+        
+      }
+      
+    },
+  };
+  </script>

+ 85 - 0
src/views/yeZhanManage/likeRules.vue

@@ -0,0 +1,85 @@
+<template>
+    <div class="app-container calendar-list-container" style="padding-bottom: 80px;">
+        <el-form :rules="rules" ref="dataForm" :model="dataForm" status-icon label-position="left" label-width="100px" style='width: 85%; margin-left:50px;'>
+         <el-form-item  label="标题" prop="title">
+              <el-input v-model="dataForm.title"></el-input>
+            </el-form-item>
+            <el-form-item
+              style="width: 100%"
+              label="内容"
+              prop="content"
+            >
+              <tinymce v-model="dataForm.content" ref="tinymce"></tinymce>
+            </el-form-item>
+  
+        </el-form>
+        <el-button style="float: right;margin-right: 120px;" type="primary" @click="updateData">修改</el-button>
+    
+        
+    </div>
+   
+  </template>
+  
+  <style>
+    
+  </style>
+  
+  
+  <script>
+   import {likeRulesDetail, updateLikeRules} from "@/api/yeZhanManage/likeRules";
+    import waves from "@/directive/waves"; // 水波纹指令
+    import Tinymce from '@/components/Tinymce'
+    export default {
+    components: { Tinymce },
+    directives: { waves },
+    data() {
+      return {
+        dataForm: {
+          type:'trainrule',
+          title: '',
+          content: "",
+        },
+        dialogFormVisible: false,
+        rules: {
+            title: [{ required: true, message: "标题不能为空", trigger: "blur" }],
+            content: [{ required: true, message: "规则不能为空", trigger: "blur" }],
+        },
+      }
+    },
+    created() {
+        this.getDetail();
+    },
+    methods: {
+    
+      getDetail() {
+          this.loading = true
+          likeRulesDetail({noticeType:'trainrule'}).then(response => {
+            this.dataForm.title = response.data.data.title;
+            this.dataForm.content = response.data.data.content;
+            this.dataForm.id = response.data.data.id;
+            this.loading = false;
+          }).catch(() => {})
+      },
+      updateData() {
+        this.$refs['dataForm'].validate((valid) => {
+          if (valid) {
+            this.loading = true;
+            updateLikeRules(this.dataForm).then(() => {
+              this.loading = false;
+                this.$notify({
+                  title: '成功',
+                  message: '更新成功',
+                  type: 'success',
+                  duration: 2000
+                })
+                this.getDetail()
+              }) 
+          }
+        })
+      },
+  
+      
+    }
+  }
+  </script>
+  

+ 249 - 0
src/views/yeZhanManage/mallVideoList.vue

@@ -0,0 +1,249 @@
+<template>
+    <div class="app-container calendar-list-container">
+  
+      <!-- 查询和其他操作 -->
+      <div class="filter-container">
+        <el-input clearable class="filter-item" style="width: 200px;" placeholder="请输入平台名称" v-model="listQuery.platformName"></el-input>
+        <el-input clearable class="filter-item" style="width: 200px;" placeholder="请输入视频系列" v-model="listQuery.videoSeries"></el-input>
+        <el-input clearable class="filter-item" style="width: 200px;" placeholder="请输入视频名称" v-model="listQuery.accountName"></el-input>
+        <el-button class="filter-item" type="primary" v-waves icon="el-icon-search" @click="handleFilter">查找</el-button>
+        <el-button class="filter-item" type="primary" @click="handleCreate" icon="el-icon-edit">添加</el-button>
+        <el-button class="filter-item" type="primary" v-waves icon="el-icon-download" @click="handleDownLoad">导出</el-button>
+      </div>
+  
+      <!-- 查询结果 -->
+      <el-table
+        size="small"
+        :data="list"
+        v-loading="listLoading"
+        element-loading-text="正在查询中。。。"
+        border
+        fit
+        highlight-current-row
+      >
+        <el-table-column type="index" label="序号" header-align="center" align="center">
+        </el-table-column>
+        <el-table-column align="center" min-width="100px" label="平台" prop="platformName">
+        </el-table-column>
+        <el-table-column align="center" min-width="100px" label="账号名称" prop="accountName">
+        </el-table-column>
+        <el-table-column align="center" min-width="100px" label="视频系列" prop="videoSeries">
+        </el-table-column>
+        <el-table-column align="center" min-width="100px" label="第几集" prop="episodeNumber">
+        </el-table-column>
+        <el-table-column align="center" min-width="100px" label="视频名称" prop="videoName">
+        </el-table-column>
+        <el-table-column align="center" label="操作" width="240px" class-name="small-padding fixed-width">
+          <template slot-scope="scope">
+            <el-button
+              type="primary"
+              size="small"
+              @click="handleUpdate(scope.row, false)"
+              >编辑</el-button
+            >
+            <el-button type="danger" size="mini"  @click="handleDelete(scope.row,-1)">删除</el-button>
+          </template>
+        </el-table-column>
+      </el-table>
+  
+      <!-- 分页 -->
+      <div class="pagination-container">
+        <el-pagination background @size-change="handleSizeChange" @current-change="handleCurrentChange" :current-page="listQuery.page"
+          :page-sizes="[10,20,30,50]" :page-size="listQuery.limit" layout="total, sizes, prev, pager, next, jumper" :total="total">
+        </el-pagination>
+      </div>
+  
+      <!-- 添加或修改对话框 -->
+      <el-dialog
+      :close-on-click-modal="false"
+        :title="textMap[dialogStatus]"
+        :visible.sync="dialogFormVisible"
+        width="35%"
+      >
+        <el-form :rules="rules" ref="dataForm" :model="dataForm" status-icon label-position="left" label-width="80px">
+          <el-form-item  label="平台" prop="platformName">
+            <el-input style="width: 350px" v-model="dataForm.platformName"></el-input>
+          </el-form-item>
+          <el-form-item  label="账号名称" prop="accountName">
+            <el-input style="width: 350px" v-model="dataForm.accountName"></el-input>
+          </el-form-item>
+          <el-form-item  label="视频系列" prop="videoSeries">
+            <el-input style="width: 350px" v-model="dataForm.videoSeries"></el-input>
+          </el-form-item>
+          <el-form-item  label="第几集" prop="episodeNumber">
+            <el-input style="width: 350px" v-model="dataForm.episodeNumber"></el-input>
+          </el-form-item>
+          <el-form-item  label="视频名称" prop="videoName">
+            <el-input style="width: 350px" v-model="dataForm.videoName"></el-input>
+          </el-form-item>
+        </el-form>
+        <div slot="footer" class="dialog-footer">
+          <el-button @click="dialogFormVisible = false">取消</el-button>
+          <el-button v-if="dialogStatus == 'create'" type="primary" @click="createData">确定</el-button>
+          <el-button v-else type="primary" @click="updateData">确定</el-button>
+        </div>
+      </el-dialog>
+  
+    </div>
+  </template>
+  <script>
+    import {list, createItem, updateItem, deleteItem } from "@/api/yeZhanManage/mallVideo";
+    import waves from "@/directive/waves"; // 水波纹指令
+    import Tinymce from '@/components/Tinymce'
+  
+  export default {
+    components: { Tinymce },
+    directives: { waves },
+    data() {
+      return {
+        list: [],
+        total: 0,
+        listLoading: false,
+        listQuery: {
+          page: 1,
+          limit: 10,
+          platformName: '',
+          videoSeries: '',
+          accountName: '',
+        },
+        dataForm: {
+          platformName: undefined,
+          accountName: undefined,
+          videoSeries: undefined,
+          episodeNumber: undefined,
+          videoName: undefined,
+        },
+        dialogFormVisible: false,
+        dialogStatus: '',
+        textMap: {
+          update: "编辑",
+          create: "创建",
+        },
+        rules: {
+          platformName: [{ required: true, message: "平台不能为空", trigger: "blur" }],
+          videoSeries: [{ required: true, message: "视频系列不能为空", trigger: "blur" }],
+          accountName: [{ required: true, message: "视频名称不能为空", trigger: "blur" }],
+        },
+      }
+    },
+    created() {
+        this.getList();
+    },
+    methods: {
+      handleDownLoad(){
+            window.location.href = process.env.BASE_API + '/mall-video-info/export/videoInfoList?platformName=' + this.listQuery.platformName + '&accountName=' + this.listQuery.accountName + '&videoSeries=' + this.listQuery.videoSeries;
+        },
+      resetForm() {
+        this.dataForm = {
+          platformName: undefined,
+          accountName: undefined,
+          videoSeries: undefined,
+          episodeNumber: undefined,
+          videoName: undefined,
+        };
+      },
+      handleCreate() {
+        this.resetForm();
+        this.dialogFormVisible = true;
+        this.dialogStatus = "create";
+        this.$nextTick(() => {
+          this.$refs["dataForm"].clearValidate();
+        });
+      },
+      createData() {
+        this.$refs["dataForm"].validate((valid) => {
+          if (valid) {
+            createItem(this.dataForm)
+                  .then(() => {
+                    this.getList();
+                    this.dialogFormVisible = false;
+  
+                    this.$notify({
+                      title: "成功",
+                      message: "创建成功",
+                      type: "success",
+                      duration: 2000,
+                    });
+                    this.getList()
+                  })
+          }
+        });
+      },
+      getList() {
+        this.listLoading = true
+        list(this.listQuery).then(response => {
+          this.list = response.data.data.items
+          this.total = response.data.data.total
+          this.listLoading = false
+        }).catch(() => {
+          this.list = []
+          this.total = 0
+          this.listLoading = false
+        })
+      },
+  
+      handleFilter() {
+        this.listQuery.page = 1
+        this.getList()
+      },
+  
+      handleSizeChange(val) {
+        this.listQuery.limit = val
+        this.getList()
+      },
+  
+      handleCurrentChange(val) {
+        this.listQuery.page = val
+        this.getList()
+      },
+  
+      handleUpdate(row) {
+        this.dataForm = Object.assign({}, row);
+        this.dialogStatus = 'update'
+        this.dialogFormVisible = true
+        this.$nextTick(() => {
+          this.$refs['dataForm'].clearValidate()
+        })
+      },
+  
+      updateData() {
+        this.$refs['dataForm'].validate((valid) => {
+          if (valid) {
+            updateItem(this.dataForm).then(() => {
+                this.dialogFormVisible = false
+                this.$notify({
+                  title: '成功',
+                  message: '更新成功',
+                  type: 'success',
+                  duration: 2000
+                })
+                this.getList()
+              })
+            
+          }
+        })
+      },
+      handleDelete(row, index) {
+        this.$confirm('确认删除吗?', '提示', {
+          confirmButtonText: '确定',
+          cancelButtonText: '取消',
+          type: 'warning'
+        }).then(() => {
+          deleteItem({ id: row.id }).then(response => {
+            this.$notify({
+              title: '成功',
+              message: '删除成功',
+              type: 'success',
+              duration: 2000
+            })
+            this.getList()
+          })
+        }).catch(() => {
+  
+        })
+  
+      },
+    }
+  }
+  </script>
+