소스 검색

feat:会员看课代码迁移和调整

caoliqin 1 주 전
부모
커밋
2839437062

+ 38 - 0
.env.prod-fby

@@ -0,0 +1,38 @@
+# 页面标题
+VUE_APP_TITLE =互联网医院管理系统
+# 公司名称
+COMPANY_NAME =福本源
+# ICP备案号
+ICP_RECORD =蜀ICP备2023036719号
+# ICP网站访问地址
+ICP_URL =https://beian.miit.gov.cn
+# 网站LOG
+VUE_APP_LOG_URL =@/assets/logo/fby_logo.png
+# 存储桶配置
+VUE_APP_OBS_ACCESS_KEY_ID = K2UTJGIN7UTZJR2XMXYG
+# 存储桶配置
+VUE_APP_OBS_SECRET_ACCESS_KEY = sbyeNJLbcYmH6copxeFP9pAoksM4NIT9Zw4x0SRX
+# 存储桶配置
+VUE_APP_OBS_SERVER = https://obs.cn-north-4.myhuaweicloud.com
+# 存储桶配置
+VUE_APP_OBS_BUCKET = fby-hw079058881
+# 存储桶配置
+VUE_APP_COS_BUCKET = fby-1323137866
+# 存储桶配置
+VUE_APP_COS_REGION = ap-chongqing
+# 线路一地址
+VUE_APP_VIDEO_LINE_1 = https://fbytcpv.ylrzcloud.com
+# 线路二地址
+VUE_APP_VIDEO_LINE_2 = https://fbyobs.ylrztop.com
+# 生产环境配置
+ENV = 'production'
+
+# FS管理系统/开发环境
+VUE_APP_BASE_API = '/prod-api'
+
+#默认 1、会员 2、企微
+VUE_APP_COURSE_DEFAULT = 1
+
+# 路由懒加载
+VUE_CLI_BABEL_TRANSPILE_MODULES = true
+

+ 1 - 0
package.json

@@ -31,6 +31,7 @@
     "build:prod-cqxzt": "vue-cli-service build --mode prod-cqxzt",
     "build:prod-bjyjb": "vue-cli-service build --mode prod-bjyjb",
     "build:prod-bjczwh": "vue-cli-service build --mode prod-bjczwh",
+    "build:prod-fby": "vue-cli-service build --mode prod-fby",
     "preview": "node build/index.js --preview",
     "lint": "eslint --ext .js,.vue src"
   },

+ 71 - 0
src/api/course/userWatchCourseStatistics.js

@@ -0,0 +1,71 @@
+import request from '@/utils/request'
+
+// 查询会员看课统计-按课程统计列表
+export function listUserWatchCourseStatistics(query) {
+  return request({
+    url: '/course/userWatchCourseStatistics/list',
+    method: 'get',
+    params: query
+  })
+}
+
+// 查询会员看课统计-按课程统计详细
+export function getUserWatchCourseStatistics(id) {
+  return request({
+    url: '/course/userWatchCourseStatistics/' + id,
+    method: 'get'
+  })
+}
+
+// 新增会员看课统计-按课程统计
+export function addUserWatchCourseStatistics(data) {
+  return request({
+    url: '/course/userWatchCourseStatistics',
+    method: 'post',
+    data: data
+  })
+}
+
+// 修改会员看课统计-按课程统计
+export function updateUserWatchCourseStatistics(data) {
+  return request({
+    url: '/course/userWatchCourseStatistics',
+    method: 'put',
+    data: data
+  })
+}
+
+// 删除会员看课统计-按课程统计
+export function delUserWatchCourseStatistics(id) {
+  return request({
+    url: '/course/userWatchCourseStatistics/' + id,
+    method: 'delete'
+  })
+}
+
+// 导出会员看课统计-按课程统计
+export function exportUserWatchCourseStatistics(query) {
+  return request({
+    url: '/course/userWatchCourseStatistics/export',
+    method: 'get',
+    params: query
+  })
+}
+
+// 查询会员看课统计-按课程统计列表
+export function listUserWatchCourseStatisticsTotal(query) {
+  return request({
+    url: '/course/userWatchCourseStatistics/listTotal',
+    method: 'get',
+    params: query
+  })
+}
+
+// 导出会员看课统计-按课程统计汇总
+export function exportUserWatchCourseStatisticsTotal(query) {
+  return request({
+    url: '/course/userWatchCourseStatistics/exportTotal',
+    method: 'get',
+    params: query
+  })
+}

+ 53 - 0
src/api/course/userWatchStatistics.js

@@ -0,0 +1,53 @@
+import request from '@/utils/request'
+
+// 查询会员看课统计-按营期统计列表
+export function listUserWatchStatistics(query) {
+  return request({
+    url: '/course/userWatchStatistics/list',
+    method: 'get',
+    params: query
+  })
+}
+
+// 查询会员看课统计-按营期统计详细
+export function getUserWatchStatistics(id) {
+  return request({
+    url: '/course/userWatchStatistics/' + id,
+    method: 'get'
+  })
+}
+
+// 新增会员看课统计-按营期统计
+export function addUserWatchStatistics(data) {
+  return request({
+    url: '/course/userWatchStatistics',
+    method: 'post',
+    data: data
+  })
+}
+
+// 修改会员看课统计-按营期统计
+export function updateUserWatchStatistics(data) {
+  return request({
+    url: '/course/userWatchStatistics',
+    method: 'put',
+    data: data
+  })
+}
+
+// 删除会员看课统计-按营期统计
+export function delUserWatchStatistics(id) {
+  return request({
+    url: '/course/userWatchStatistics/' + id,
+    method: 'delete'
+  })
+}
+
+// 导出会员看课统计-按营期统计
+export function exportUserWatchStatistics(query) {
+  return request({
+    url: '/course/userWatchStatistics/export',
+    method: 'get',
+    params: query
+  })
+}

+ 53 - 0
src/api/his/userOnlineState.js

@@ -0,0 +1,53 @@
+import request from '@/utils/request'
+
+// 查询用户上线情况列表
+export function listUserOnlineState(query) {
+  return request({
+    url: '/store/userOnlineState/list',
+    method: 'get',
+    params: query
+  })
+}
+
+// 查询用户上线情况详细
+export function getUserOnlineState(userId) {
+  return request({
+    url: '/store/userOnlineState/' + userId,
+    method: 'get'
+  })
+}
+
+// 新增用户上线情况
+export function addUserOnlineState(data) {
+  return request({
+    url: '/store/userOnlineState',
+    method: 'post',
+    data: data
+  })
+}
+
+// 修改用户上线情况
+export function updateUserOnlineState(data) {
+  return request({
+    url: '/store/userOnlineState',
+    method: 'put',
+    data: data
+  })
+}
+
+// 删除用户上线情况
+export function delUserOnlineState(userId) {
+  return request({
+    url: '/store/userOnlineState/' + userId,
+    method: 'delete'
+  })
+}
+
+// 导出用户上线情况
+export function exportUserOnlineState(query) {
+  return request({
+    url: '/store/userOnlineState/export',
+    method: 'get',
+    params: query
+  })
+}

BIN
src/assets/logo/fby_logo.png


+ 3 - 4
src/views/course/userCoursePeriod/batchRedPacket.vue

@@ -24,7 +24,7 @@
         align="center"
       />
       <el-table-column
-        label="金额(0.1-0.3元)"
+        label="金额"
         align="center"
         width="200"
       >
@@ -32,7 +32,6 @@
           <el-input-number
             v-model="scope.row.amount"
             :min="0.1"
-            :max="0.3"
             :precision="2"
             :step="0.01"
             size="small"
@@ -96,9 +95,9 @@ export default {
     // 保存
     handleSave() {
       // 验证金额范围
-      const invalidItems = this.tableData.filter(item => item.amount < 0.1 || item.amount > 0.3);
+      const invalidItems = this.tableData.filter(item => item.amount < 0.1);
       if (invalidItems.length > 0) {
-        this.$message.error('红包金额需要在0.1元至0.3元之间');
+        this.$message.error('红包金额需要大于等于0.1元');
         return;
       }
 

+ 25 - 9
src/views/course/userCoursePeriod/index.vue

@@ -165,6 +165,7 @@
           <el-table-column label="营期名称" align="center" prop="periodName" />
           <el-table-column label="公司名称" align="center" prop="companyName" />
           <el-table-column label="营期状态" align="center" prop="periodStatus" width="100" :formatter="periodStatusFormatter" />
+          <el-table-column label="营期线" align="center" prop="periodLine" width="180" />
           <el-table-column label="开营开始时间" align="center" prop="periodStartingTime" width="180" />
           <el-table-column label="开营结束时间" align="center" prop="periodEndTime" width="180" />
           <el-table-column label="创建时间" align="center" prop="createTime" width="180" />
@@ -249,12 +250,12 @@
         <el-form-item label="课程LOGO" prop="courseLogo">
           <image-upload v-model="form.courseLogo" :limit="1" />
         </el-form-item>
-        <el-form-item label="红包发放方式" prop="redPacketGrantMethod">
-          <el-radio-group v-model="form.redPacketGrantMethod">
-            <el-radio :label="1" >按课程</el-radio>
-            <el-radio :label="2" >按营期</el-radio>
-          </el-radio-group>
-        </el-form-item>
+<!--        <el-form-item label="红包发放方式" prop="redPacketGrantMethod">-->
+<!--          <el-radio-group v-model="form.redPacketGrantMethod">-->
+<!--            <el-radio :label="1" >按课程</el-radio>-->
+<!--            <el-radio :label="2" >按营期</el-radio>-->
+<!--          </el-radio-group>-->
+<!--        </el-form-item>-->
         <el-form-item label="营期类型" prop="periodType">
           <el-radio-group v-model="form.periodType">
             <el-radio :label="1" >多课程</el-radio>
@@ -291,6 +292,21 @@
           >
           </el-date-picker>
         </el-form-item>
+        <el-form-item prop="periodLine">
+          <span slot="label">
+            营期线
+            <el-tooltip content="营期首次播放课程的日期" placement="top">
+              <i class="el-icon-question" style="margin-left: 5px; color: #909399; cursor: help;"></i>
+            </el-tooltip>
+          </span>
+          <el-date-picker
+            v-model="form.periodLine"
+            type="date"
+            placeholder="请选择营期线"
+            value-format="yyyy-MM-dd"
+            :clearable="true">
+          </el-date-picker>
+        </el-form-item>
       </el-form>
       <div class="drawer-footer">
         <el-button type="primary" @click="submitForm">确 定</el-button>
@@ -704,9 +720,9 @@ export default {
         courseStyle: [
           { required: true, message: '课程风格不能为空', trigger: 'change' }
         ],
-        redPacketGrantMethod: [
-          { required: true, message: '红包发放方式不能为空', trigger: 'change' }
-        ],
+        // redPacketGrantMethod: [
+        //   { required: true, message: '红包发放方式不能为空', trigger: 'change' }
+        // ],
         periodType: [
           { required: true, message: '营期类型不能为空', trigger: 'change' }
         ],

+ 6 - 9
src/views/course/userCoursePeriod/redPacket.vue

@@ -27,12 +27,11 @@
         <el-table-column label="课程" prop="courseName" align="center" />
         <el-table-column label="小节" prop="videoName" align="center" />
         <el-table-column label="营期日期" prop="dayDate" align="center"/>
-        <el-table-column label="红包金额(0.0-0.3元)" width="200px" align="center">
+        <el-table-column label="红包金额" width="200px" align="center">
           <template slot-scope="scope">
             <el-input-number
               v-model="scope.row.amount"
-              :min="0.0"
-              :max="0.3"
+              :min="0.1"
               :precision="2"
               :step="0.01"
               size="small"
@@ -129,27 +128,25 @@ export default {
         periodId: this.periodId,
         companyId: this.currentCompany.companyId
       }).then(response => {
-        console.log("-----------",JSON.stringify(response.data))  
         this.redPacketList = (response.data || []).map(item => ({
           ...item,
-          // amount: item.amount || 0.1
-          amount:item.amount ?? 0.1
+          amount: item.amount || 0.1
         }));
       });
     },
     // 保存红包金额
     handleSave() {
       // 筛选出有金额的项目
-      const validAmountItems = this.redPacketList.filter(item => item.amount >= 0);
+      const validAmountItems = this.redPacketList.filter(item => item.amount > 0);
       if (validAmountItems.length === 0) {
         this.$message.warning('请至少设置一个红包金额');
         return;
       }
 
       // 验证金额范围
-      const invalidItems = validAmountItems.filter(item => item.amount < 0.0 || item.amount > 0.3);
+      const invalidItems = validAmountItems.filter(item => item.amount < 0.1);
       if (invalidItems.length > 0) {
-        this.$message.error('红包金额需要在0.0元至0.3元之间');
+        this.$message.error('红包金额需要大于等于0.1元');
         return;
       }
 

+ 390 - 0
src/views/course/userWatchCourseStatistics/index.vue

@@ -0,0 +1,390 @@
+<template>
+  <div class="app-container">
+    <el-form :model="queryParams" ref="queryForm" :inline="true" v-show="showSearch" label-width="68px">
+
+      <el-form-item label="营期名称" prop="periodName">
+        <el-input
+          v-model="queryParams.periodName"
+          placeholder="请输入营期名称"
+          clearable
+          size="small"
+          @keyup.enter.native="handleQuery"
+        />
+      </el-form-item>
+      <el-form-item label="营期线" prop="periodStartingTime">
+        <el-date-picker clearable size="small"
+                        v-model="queryParams.periodStartingTime"
+                        type="date"
+                        value-format="yyyy-MM-dd"
+                        placeholder="选择营期线">
+        </el-date-picker>
+      </el-form-item>
+      <el-form-item label="播出时间" prop="courseStartDateTime">
+        <el-date-picker clearable size="small"
+                        v-model="queryParams.courseStartDateTime"
+                        type="date"
+                        value-format="yyyy-MM-dd"
+                        placeholder="选择课程开始日期">
+        </el-date-picker>
+      </el-form-item>
+      <el-form-item label="课程名称" prop="courseName">
+        <el-input
+          v-model="queryParams.courseName"
+          placeholder="请输入课程名称"
+          clearable
+          size="small"
+          @keyup.enter.native="handleQuery"
+        />
+      </el-form-item>
+
+      <el-form-item label="销售公司" prop="companyName">
+        <el-input
+          v-model="queryParams.companyName"
+          placeholder="请输入销售公司名称"
+          clearable
+          size="small"
+          @keyup.enter.native="handleQuery"
+        />
+      </el-form-item>
+
+      <el-form-item label="所属销售" prop="companyUserName">
+        <el-input
+          v-model="queryParams.companyUserName"
+          placeholder="请输入销售名称"
+          clearable
+          size="small"
+          @keyup.enter.native="handleQuery"
+        />
+      </el-form-item>
+
+      <el-form-item>
+        <el-button type="primary" icon="el-icon-search" size="mini" @click="handleQuery">搜索</el-button>
+        <el-button icon="el-icon-refresh" size="mini" @click="resetQuery">重置</el-button>
+      </el-form-item>
+    </el-form>
+
+    <el-row :gutter="10" class="mb8">
+      <el-col :span="1.5">
+        <el-button
+          type="warning"
+          plain
+          icon="el-icon-download"
+          size="mini"
+          :loading="exportLoading"
+          @click="handleExport"
+          v-hasPermi="['course:userWatchCourseStatistics:export']"
+        >导出</el-button>
+      </el-col>
+      <right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar>
+    </el-row>
+
+    <el-table border v-loading="loading" :data="userWatchCourseStatisticsList" @selection-change="handleSelectionChange">
+      <el-table-column type="selection" width="55" align="center" />
+      <el-table-column label="营期名称" align="center" prop="periodName" />
+      <el-table-column label="营期线" align="center" prop="periodStartingTime" />
+      <el-table-column label="播出时间" align="center" prop="courseStartDateTime" />
+      <el-table-column label="课程名称" align="center" prop="courseName" />
+      <el-table-column label="视频小节" align="center" prop="videoTitle" />
+      <el-table-column label="销售公司" align="center" prop="companyName" />
+      <el-table-column label="所属销售" align="center" prop="companyUserName" />
+      <el-table-column label="新增会员" align="center" prop="newUserNum" />
+      <el-table-column label="会员数量" align="center" prop="userNum" />
+      <el-table-column label="观看人数" align="center" prop="watchNum" />
+      <el-table-column label="上线率" align="center" prop="onlineRatePercent" />
+      <el-table-column label="完播人数" align="center" prop="completeWatchNum" />
+      <el-table-column label="完播率" align="center" prop="completeWatchRatePercent" />
+      <el-table-column label="答题人数" align="center" prop="answerNum" />
+      <el-table-column label="正确人数" align="center" prop="answerRightNum" />
+      <el-table-column label="正确率" align="center" prop="answerRightRatePercent" />
+      <el-table-column label="红包领取个数" align="center" prop="redPacketNum" />
+      <el-table-column label="红包领取总额" align="center" prop="redPacketAmount" />
+    </el-table>
+
+    <pagination
+      v-show="total>0"
+      :total="total"
+      :page.sync="queryParams.pageNum"
+      :limit.sync="queryParams.pageSize"
+      @pagination="getList"
+    />
+
+    <!-- 添加或修改会员看课统计-按课程统计对话框 -->
+    <el-dialog :title="title" :visible.sync="open" width="500px" append-to-body>
+      <el-form ref="form" :model="form" :rules="rules" label-width="80px">
+        <el-form-item label="营期id" prop="periodId">
+          <el-input v-model="form.periodId" placeholder="请输入营期id" />
+        </el-form-item>
+        <el-form-item label="营期名称" prop="periodName">
+          <el-input v-model="form.periodName" placeholder="请输入营期名称" />
+        </el-form-item>
+        <el-form-item label="课程id" prop="courseId">
+          <el-input v-model="form.courseId" placeholder="请输入课程id" />
+        </el-form-item>
+        <el-form-item label="课程名称" prop="courseName">
+          <el-input v-model="form.courseName" placeholder="请输入课程名称" />
+        </el-form-item>
+        <el-form-item label="视频id" prop="videoId">
+          <el-input v-model="form.videoId" placeholder="请输入视频id" />
+        </el-form-item>
+        <el-form-item label="视频标题" prop="videoTitle">
+          <el-input v-model="form.videoTitle" placeholder="请输入视频标题" />
+        </el-form-item>
+        <el-form-item label="销售公司id" prop="companyId">
+          <el-input v-model="form.companyId" placeholder="请输入销售公司id" />
+        </el-form-item>
+        <el-form-item label="销售公司名称" prop="companyName">
+          <el-input v-model="form.companyName" placeholder="请输入销售公司名称" />
+        </el-form-item>
+        <el-form-item label="销售id" prop="companyUserId">
+          <el-input v-model="form.companyUserId" placeholder="请输入销售id" />
+        </el-form-item>
+        <el-form-item label="课程开始日期" prop="courseStartDateTime">
+          <el-date-picker clearable size="small"
+            v-model="form.courseStartDateTime"
+            type="date"
+            value-format="yyyy-MM-dd"
+            placeholder="选择课程开始日期">
+          </el-date-picker>
+        </el-form-item>
+        <el-form-item label="销售名称" prop="companyUserName">
+          <el-input v-model="form.companyUserName" placeholder="请输入销售名称" />
+        </el-form-item>
+        <el-form-item label="营期开始日期" prop="periodStartingTime">
+          <el-date-picker clearable size="small"
+            v-model="form.periodStartingTime"
+            type="date"
+            value-format="yyyy-MM-dd"
+            placeholder="选择营期开始日期">
+          </el-date-picker>
+        </el-form-item>
+        <el-form-item label="新增会员数量" prop="newUserNum">
+          <el-input v-model="form.newUserNum" placeholder="请输入新增会员数量" />
+        </el-form-item>
+        <el-form-item label="会员数量" prop="userNum">
+          <el-input v-model="form.userNum" placeholder="请输入会员数量" />
+        </el-form-item>
+        <el-form-item label="观看人数" prop="watchNum">
+          <el-input v-model="form.watchNum" placeholder="请输入观看人数" />
+        </el-form-item>
+        <el-form-item label="完播人数" prop="completeWatchNum">
+          <el-input v-model="form.completeWatchNum" placeholder="请输入完播人数" />
+        </el-form-item>
+        <el-form-item label="完播率" prop="completeWatchRate">
+          <el-input v-model="form.completeWatchRate" placeholder="请输入完播率" />
+        </el-form-item>
+        <el-form-item label="答题人数" prop="answerNum">
+          <el-input v-model="form.answerNum" placeholder="请输入答题人数" />
+        </el-form-item>
+        <el-form-item label="答题正确人数" prop="answerRightNum">
+          <el-input v-model="form.answerRightNum" placeholder="请输入答题正确人数" />
+        </el-form-item>
+        <el-form-item label="答题正确率" prop="answerRightRate">
+          <el-input v-model="form.answerRightRate" placeholder="请输入答题正确率" />
+        </el-form-item>
+        <el-form-item label="红包领取个数" prop="redPacketNum">
+          <el-input v-model="form.redPacketNum" placeholder="请输入红包领取数量" />
+        </el-form-item>
+        <el-form-item label="红包领取总额" prop="redPacketAmount">
+          <el-input v-model="form.redPacketAmount" placeholder="请输入红包领取总额" />
+        </el-form-item>
+      </el-form>
+      <div slot="footer" class="dialog-footer">
+        <el-button type="primary" @click="submitForm">确 定</el-button>
+        <el-button @click="cancel">取 消</el-button>
+      </div>
+    </el-dialog>
+  </div>
+</template>
+
+<script>
+import { listUserWatchCourseStatistics, getUserWatchCourseStatistics, delUserWatchCourseStatistics, addUserWatchCourseStatistics, updateUserWatchCourseStatistics, exportUserWatchCourseStatistics } from "@/api/course/userWatchCourseStatistics";
+
+export default {
+  name: "UserWatchCourseStatistics",
+  data() {
+    return {
+      // 遮罩层
+      loading: true,
+      // 导出遮罩层
+      exportLoading: false,
+      // 选中数组
+      ids: [],
+      // 非单个禁用
+      single: true,
+      // 非多个禁用
+      multiple: true,
+      // 显示搜索条件
+      showSearch: true,
+      // 总条数
+      total: 0,
+      // 会员看课统计-按课程统计表格数据
+      userWatchCourseStatisticsList: [],
+      // 弹出层标题
+      title: "",
+      // 是否显示弹出层
+      open: false,
+      // 查询参数
+      queryParams: {
+        pageNum: 1,
+        pageSize: 10,
+        periodId: null,
+        periodName: null,
+        courseId: null,
+        courseName: null,
+        videoId: null,
+        videoTitle: null,
+        companyId: null,
+        companyName: null,
+        companyUserId: null,
+        courseStartDateTime: null,
+        companyUserName: null,
+        periodStartingTime: null,
+        newUserNum: null,
+        userNum: null,
+        watchNum: null,
+        completeWatchNum: null,
+        completeWatchRate: null,
+        answerNum: null,
+        answerRightNum: null,
+        answerRightRate: null,
+        redPacketNum: null,
+        redPacketAmount: null
+      },
+      // 表单参数
+      form: {},
+      // 表单校验
+      rules: {
+      }
+    };
+  },
+  created() {
+    this.getList();
+  },
+  methods: {
+    /** 查询会员看课统计-按课程统计列表 */
+    getList() {
+      this.loading = true;
+      listUserWatchCourseStatistics(this.queryParams).then(response => {
+        this.userWatchCourseStatisticsList = response.rows;
+        this.total = response.total;
+        this.loading = false;
+      });
+    },
+    // 取消按钮
+    cancel() {
+      this.open = false;
+      this.reset();
+    },
+    // 表单重置
+    reset() {
+      this.form = {
+        id: null,
+        periodId: null,
+        periodName: null,
+        courseId: null,
+        courseName: null,
+        videoId: null,
+        videoTitle: null,
+        companyId: null,
+        companyName: null,
+        companyUserId: null,
+        courseStartDateTime: null,
+        companyUserName: null,
+        periodStartingTime: null,
+        newUserNum: null,
+        userNum: null,
+        watchNum: null,
+        completeWatchNum: null,
+        completeWatchRate: null,
+        answerNum: null,
+        answerRightNum: null,
+        answerRightRate: null,
+        redPacketNum: null,
+        redPacketAmount: null
+      };
+      this.resetForm("form");
+    },
+    /** 搜索按钮操作 */
+    handleQuery() {
+      this.queryParams.pageNum = 1;
+      this.getList();
+    },
+    /** 重置按钮操作 */
+    resetQuery() {
+      this.resetForm("queryForm");
+      this.handleQuery();
+    },
+    // 多选框选中数据
+    handleSelectionChange(selection) {
+      this.ids = selection.map(item => item.id)
+      this.single = selection.length!==1
+      this.multiple = !selection.length
+    },
+    /** 新增按钮操作 */
+    handleAdd() {
+      this.reset();
+      this.open = true;
+      this.title = "添加会员看课统计-按课程统计";
+    },
+    /** 修改按钮操作 */
+    handleUpdate(row) {
+      this.reset();
+      const id = row.id || this.ids
+      getUserWatchCourseStatistics(id).then(response => {
+        this.form = response.data;
+        this.open = true;
+        this.title = "修改会员看课统计-按课程统计";
+      });
+    },
+    /** 提交按钮 */
+    submitForm() {
+      this.$refs["form"].validate(valid => {
+        if (valid) {
+          if (this.form.id != null) {
+            updateUserWatchCourseStatistics(this.form).then(response => {
+              this.msgSuccess("修改成功");
+              this.open = false;
+              this.getList();
+            });
+          } else {
+            addUserWatchCourseStatistics(this.form).then(response => {
+              this.msgSuccess("新增成功");
+              this.open = false;
+              this.getList();
+            });
+          }
+        }
+      });
+    },
+    /** 删除按钮操作 */
+    handleDelete(row) {
+      const ids = row.id || this.ids;
+      this.$confirm('是否确认删除会员看课统计-按课程统计编号为"' + ids + '"的数据项?', "警告", {
+          confirmButtonText: "确定",
+          cancelButtonText: "取消",
+          type: "warning"
+        }).then(function() {
+          return delUserWatchCourseStatistics(ids);
+        }).then(() => {
+          this.getList();
+          this.msgSuccess("删除成功");
+        }).catch(() => {});
+    },
+    /** 导出按钮操作 */
+    handleExport() {
+      const queryParams = this.queryParams;
+      this.$confirm('是否确认导出当前数据项?', "警告", {
+          confirmButtonText: "确定",
+          cancelButtonText: "取消",
+          type: "warning"
+        }).then(() => {
+          this.exportLoading = true;
+          return exportUserWatchCourseStatistics(queryParams);
+        }).then(response => {
+          this.download(response.msg);
+          this.exportLoading = false;
+        }).catch(() => {});
+    }
+  }
+};
+</script>

+ 394 - 0
src/views/course/userWatchCourseTotalStatistics/index.vue

@@ -0,0 +1,394 @@
+<template>
+  <div class="app-container">
+    <el-form :model="queryParams" ref="queryForm" :inline="true" v-show="showSearch" label-width="68px">
+
+      <el-form-item label="营期名称" prop="periodName">
+        <el-input
+          v-model="queryParams.periodName"
+          placeholder="请输入营期名称"
+          clearable
+          size="small"
+          @keyup.enter.native="handleQuery"
+        />
+      </el-form-item>
+      <el-form-item label="营期线" prop="periodStartingTime">
+        <el-date-picker clearable size="small"
+                        v-model="queryParams.periodStartingTime"
+                        type="date"
+                        value-format="yyyy-MM-dd"
+                        placeholder="选择营期线">
+        </el-date-picker>
+      </el-form-item>
+      <el-form-item label="播出时间" prop="courseStartDateTime">
+        <el-date-picker clearable size="small"
+                        v-model="queryParams.courseStartDateTime"
+                        type="date"
+                        value-format="yyyy-MM-dd"
+                        placeholder="选择课程开始日期">
+        </el-date-picker>
+      </el-form-item>
+      <el-form-item label="课程名称" prop="courseName">
+        <el-input
+          v-model="queryParams.courseName"
+          placeholder="请输入课程名称"
+          clearable
+          size="small"
+          @keyup.enter.native="handleQuery"
+        />
+      </el-form-item>
+      <el-form-item label="视频小节" prop="videoTitle">
+        <el-input
+          v-model="queryParams.videoTitle"
+          placeholder="请输入视频标题"
+          clearable
+          size="small"
+          @keyup.enter.native="handleQuery"
+        />
+      </el-form-item>
+
+      <el-form-item label="销售公司" prop="companyName">
+        <el-input
+          v-model="queryParams.companyName"
+          placeholder="请输入销售公司名称"
+          clearable
+          size="small"
+          @keyup.enter.native="handleQuery"
+        />
+      </el-form-item>
+
+<!--      <el-form-item label="所属销售" prop="companyUserName">-->
+<!--        <el-input-->
+<!--          v-model="queryParams.companyUserName"-->
+<!--          placeholder="请输入销售名称"-->
+<!--          clearable-->
+<!--          size="small"-->
+<!--          @keyup.enter.native="handleQuery"-->
+<!--        />-->
+<!--      </el-form-item>-->
+
+      <el-form-item>
+        <el-button type="primary" icon="el-icon-search" size="mini" @click="handleQuery">搜索</el-button>
+        <el-button icon="el-icon-refresh" size="mini" @click="resetQuery">重置</el-button>
+      </el-form-item>
+    </el-form>
+
+    <el-row :gutter="10" class="mb8">
+      <el-col :span="1.5">
+        <el-button
+          type="warning"
+          plain
+          icon="el-icon-download"
+          size="mini"
+          :loading="exportLoading"
+          @click="handleExport"
+        >导出</el-button>
+      </el-col>
+      <right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar>
+    </el-row>
+
+    <el-table border v-loading="loading" :data="userWatchCourseStatisticsList" @selection-change="handleSelectionChange">
+      <el-table-column type="selection" width="55" align="center" />
+      <el-table-column label="营期名称" align="center" prop="periodName" />
+      <el-table-column label="营期线" align="center" prop="periodStartingTime" />
+      <el-table-column label="播出时间" align="center" prop="courseStartDateTime" />
+      <el-table-column label="课程名称" align="center" prop="courseName" />
+      <el-table-column label="视频小节" align="center" prop="videoTitle" />
+      <el-table-column label="销售公司" align="center" prop="companyName" />
+<!--      <el-table-column label="所属销售" align="center" prop="companyUserName" />-->
+      <el-table-column label="新增会员" align="center" prop="newUserNum" />
+      <el-table-column label="会员数量" align="center" prop="userNum" />
+      <el-table-column label="观看人数" align="center" prop="watchNum" />
+      <el-table-column label="上线率" align="center" prop="onlineRatePercent" />
+      <el-table-column label="完播人数" align="center" prop="completeWatchNum" />
+      <el-table-column label="完播率" align="center" prop="completeWatchRatePercent" />
+      <el-table-column label="红包领取个数" align="center" prop="redPacketNum" />
+    </el-table>
+
+    <pagination
+      v-show="total>0"
+      :total="total"
+      :page.sync="queryParams.pageNum"
+      :limit.sync="queryParams.pageSize"
+      @pagination="getList"
+    />
+
+    <!-- 添加或修改会员看课统计-按课程统计对话框 -->
+    <el-dialog :title="title" :visible.sync="open" width="500px" append-to-body>
+      <el-form ref="form" :model="form" :rules="rules" label-width="80px">
+        <el-form-item label="营期id" prop="periodId">
+          <el-input v-model="form.periodId" placeholder="请输入营期id" />
+        </el-form-item>
+        <el-form-item label="营期名称" prop="periodName">
+          <el-input v-model="form.periodName" placeholder="请输入营期名称" />
+        </el-form-item>
+        <el-form-item label="课程id" prop="courseId">
+          <el-input v-model="form.courseId" placeholder="请输入课程id" />
+        </el-form-item>
+        <el-form-item label="课程名称" prop="courseName">
+          <el-input v-model="form.courseName" placeholder="请输入课程名称" />
+        </el-form-item>
+        <el-form-item label="视频id" prop="videoId">
+          <el-input v-model="form.videoId" placeholder="请输入视频id" />
+        </el-form-item>
+        <el-form-item label="视频标题" prop="videoTitle">
+          <el-input v-model="form.videoTitle" placeholder="请输入视频标题" />
+        </el-form-item>
+        <el-form-item label="销售公司id" prop="companyId">
+          <el-input v-model="form.companyId" placeholder="请输入销售公司id" />
+        </el-form-item>
+        <el-form-item label="销售公司名称" prop="companyName">
+          <el-input v-model="form.companyName" placeholder="请输入销售公司名称" />
+        </el-form-item>
+        <el-form-item label="销售id" prop="companyUserId">
+          <el-input v-model="form.companyUserId" placeholder="请输入销售id" />
+        </el-form-item>
+        <el-form-item label="课程开始日期" prop="courseStartDateTime">
+          <el-date-picker clearable size="small"
+            v-model="form.courseStartDateTime"
+            type="date"
+            value-format="yyyy-MM-dd"
+            placeholder="选择课程开始日期">
+          </el-date-picker>
+        </el-form-item>
+        <el-form-item label="销售名称" prop="companyUserName">
+          <el-input v-model="form.companyUserName" placeholder="请输入销售名称" />
+        </el-form-item>
+        <el-form-item label="营期开始日期" prop="periodStartingTime">
+          <el-date-picker clearable size="small"
+            v-model="form.periodStartingTime"
+            type="date"
+            value-format="yyyy-MM-dd"
+            placeholder="选择营期开始日期">
+          </el-date-picker>
+        </el-form-item>
+        <el-form-item label="新增会员数量" prop="newUserNum">
+          <el-input v-model="form.newUserNum" placeholder="请输入新增会员数量" />
+        </el-form-item>
+        <el-form-item label="会员数量" prop="userNum">
+          <el-input v-model="form.userNum" placeholder="请输入会员数量" />
+        </el-form-item>
+        <el-form-item label="观看人数" prop="watchNum">
+          <el-input v-model="form.watchNum" placeholder="请输入观看人数" />
+        </el-form-item>
+        <el-form-item label="完播人数" prop="completeWatchNum">
+          <el-input v-model="form.completeWatchNum" placeholder="请输入完播人数" />
+        </el-form-item>
+        <el-form-item label="完播率" prop="completeWatchRate">
+          <el-input v-model="form.completeWatchRate" placeholder="请输入完播率" />
+        </el-form-item>
+        <el-form-item label="答题人数" prop="answerNum">
+          <el-input v-model="form.answerNum" placeholder="请输入答题人数" />
+        </el-form-item>
+        <el-form-item label="答题正确人数" prop="answerRightNum">
+          <el-input v-model="form.answerRightNum" placeholder="请输入答题正确人数" />
+        </el-form-item>
+        <el-form-item label="答题正确率" prop="answerRightRate">
+          <el-input v-model="form.answerRightRate" placeholder="请输入答题正确率" />
+        </el-form-item>
+        <el-form-item label="红包领取个数" prop="redPacketNum">
+          <el-input v-model="form.redPacketNum" placeholder="请输入红包领取数量" />
+        </el-form-item>
+        <el-form-item label="红包领取总额" prop="redPacketAmount">
+          <el-input v-model="form.redPacketAmount" placeholder="请输入红包领取总额" />
+        </el-form-item>
+      </el-form>
+      <div slot="footer" class="dialog-footer">
+        <el-button type="primary" @click="submitForm">确 定</el-button>
+        <el-button @click="cancel">取 消</el-button>
+      </div>
+    </el-dialog>
+  </div>
+</template>
+
+<script>
+import { listUserWatchCourseStatisticsTotal, getUserWatchCourseStatistics, delUserWatchCourseStatistics, addUserWatchCourseStatistics, updateUserWatchCourseStatistics, exportUserWatchCourseStatisticsTotal } from "@/api/course/userWatchCourseStatistics";
+
+export default {
+  name: "UserWatchCourseStatistics",
+  data() {
+    return {
+      // 遮罩层
+      loading: true,
+      // 导出遮罩层
+      exportLoading: false,
+      // 选中数组
+      ids: [],
+      // 非单个禁用
+      single: true,
+      // 非多个禁用
+      multiple: true,
+      // 显示搜索条件
+      showSearch: true,
+      // 总条数
+      total: 0,
+      // 会员看课统计-按课程统计表格数据
+      userWatchCourseStatisticsList: [],
+      // 弹出层标题
+      title: "",
+      // 是否显示弹出层
+      open: false,
+      // 查询参数
+      queryParams: {
+        pageNum: 1,
+        pageSize: 10,
+        periodId: null,
+        periodName: null,
+        courseId: null,
+        courseName: null,
+        videoId: null,
+        videoTitle: null,
+        companyId: null,
+        companyName: null,
+        companyUserId: null,
+        courseStartDateTime: null,
+        companyUserName: null,
+        periodStartingTime: null,
+        newUserNum: null,
+        userNum: null,
+        watchNum: null,
+        completeWatchNum: null,
+        completeWatchRate: null,
+        answerNum: null,
+        answerRightNum: null,
+        answerRightRate: null,
+        redPacketNum: null,
+        redPacketAmount: null
+      },
+      // 表单参数
+      form: {},
+      // 表单校验
+      rules: {
+      }
+    };
+  },
+  created() {
+    this.getList();
+  },
+  methods: {
+    /** 查询会员看课统计-按课程统计列表 */
+    getList() {
+      this.loading = true;
+      listUserWatchCourseStatisticsTotal(this.queryParams).then(response => {
+        this.userWatchCourseStatisticsList = response.rows;
+        this.total = response.total;
+        this.loading = false;
+      });
+    },
+    // 取消按钮
+    cancel() {
+      this.open = false;
+      this.reset();
+    },
+    // 表单重置
+    reset() {
+      this.form = {
+        id: null,
+        periodId: null,
+        periodName: null,
+        courseId: null,
+        courseName: null,
+        videoId: null,
+        videoTitle: null,
+        companyId: null,
+        companyName: null,
+        companyUserId: null,
+        courseStartDateTime: null,
+        companyUserName: null,
+        periodStartingTime: null,
+        newUserNum: null,
+        userNum: null,
+        watchNum: null,
+        completeWatchNum: null,
+        completeWatchRate: null,
+        answerNum: null,
+        answerRightNum: null,
+        answerRightRate: null,
+        redPacketNum: null,
+        redPacketAmount: null
+      };
+      this.resetForm("form");
+    },
+    /** 搜索按钮操作 */
+    handleQuery() {
+      this.queryParams.pageNum = 1;
+      this.getList();
+    },
+    /** 重置按钮操作 */
+    resetQuery() {
+      this.resetForm("queryForm");
+      this.handleQuery();
+    },
+    // 多选框选中数据
+    handleSelectionChange(selection) {
+      this.ids = selection.map(item => item.id)
+      this.single = selection.length!==1
+      this.multiple = !selection.length
+    },
+    /** 新增按钮操作 */
+    handleAdd() {
+      this.reset();
+      this.open = true;
+      this.title = "添加会员看课统计-按课程统计";
+    },
+    /** 修改按钮操作 */
+    handleUpdate(row) {
+      this.reset();
+      const id = row.id || this.ids
+      getUserWatchCourseStatistics(id).then(response => {
+        this.form = response.data;
+        this.open = true;
+        this.title = "修改会员看课统计-按课程统计";
+      });
+    },
+    /** 提交按钮 */
+    submitForm() {
+      this.$refs["form"].validate(valid => {
+        if (valid) {
+          if (this.form.id != null) {
+            updateUserWatchCourseStatistics(this.form).then(response => {
+              this.msgSuccess("修改成功");
+              this.open = false;
+              this.getList();
+            });
+          } else {
+            addUserWatchCourseStatistics(this.form).then(response => {
+              this.msgSuccess("新增成功");
+              this.open = false;
+              this.getList();
+            });
+          }
+        }
+      });
+    },
+    /** 删除按钮操作 */
+    handleDelete(row) {
+      const ids = row.id || this.ids;
+      this.$confirm('是否确认删除会员看课统计-按课程统计编号为"' + ids + '"的数据项?', "警告", {
+          confirmButtonText: "确定",
+          cancelButtonText: "取消",
+          type: "warning"
+        }).then(function() {
+          return delUserWatchCourseStatistics(ids);
+        }).then(() => {
+          this.getList();
+          this.msgSuccess("删除成功");
+        }).catch(() => {});
+    },
+    /** 导出按钮操作 */
+    handleExport() {
+      const queryParams = this.queryParams;
+      this.$confirm('是否确认导出当前数据项?', "警告", {
+          confirmButtonText: "确定",
+          cancelButtonText: "取消",
+          type: "warning"
+        }).then(() => {
+          this.exportLoading = true;
+          return exportUserWatchCourseStatisticsTotal(queryParams);
+        }).then(response => {
+          this.download(response.msg);
+          this.exportLoading = false;
+        }).catch(() => {});
+    }
+  }
+};
+</script>

+ 286 - 0
src/views/course/userWatchStatistics/index.vue

@@ -0,0 +1,286 @@
+<template>
+  <div class="app-container">
+    <el-form :model="queryParams" ref="queryForm" :inline="true" v-show="showSearch" label-width="68px">
+
+      <el-form-item label="营期名称" prop="periodName">
+        <el-input
+          v-model="queryParams.periodName"
+          placeholder="请输入营期名称"
+          clearable
+          size="small"
+          @keyup.enter.native="handleQuery"
+        />
+      </el-form-item>
+      <el-form-item label="营期线" prop="periodStartingTime">
+        <el-date-picker clearable size="small"
+          v-model="queryParams.periodStartingTime"
+          type="date"
+          value-format="yyyy-MM-dd"
+          placeholder="选择营期线">
+        </el-date-picker>
+      </el-form-item>
+
+      <el-form-item label="销售公司" prop="companyName">
+        <el-input
+          v-model="queryParams.companyName"
+          placeholder="请输入销售公司名称"
+          clearable
+          size="small"
+          @keyup.enter.native="handleQuery"
+        />
+      </el-form-item>
+
+
+      <el-form-item>
+        <el-button type="primary" icon="el-icon-search" size="mini" @click="handleQuery">搜索</el-button>
+        <el-button icon="el-icon-refresh" size="mini" @click="resetQuery">重置</el-button>
+      </el-form-item>
+    </el-form>
+
+    <el-row :gutter="10" class="mb8">
+      <el-col :span="1.5">
+        <el-button
+          type="warning"
+          plain
+          icon="el-icon-download"
+          size="mini"
+          :loading="exportLoading"
+          @click="handleExport"
+          v-hasPermi="['course:userWatchStatistics:export']"
+        >导出</el-button>
+      </el-col>
+      <right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar>
+    </el-row>
+
+    <el-table border v-loading="loading" :data="userWatchStatisticsList" @selection-change="handleSelectionChange">
+      <el-table-column type="selection" width="55" align="center" />
+      <el-table-column label="营期名称" align="center" prop="periodName" />
+      <el-table-column label="营期线" align="center" prop="periodStartingTime" width="180">
+        <template slot-scope="scope">
+          <span>{{ parseTime(scope.row.periodStartingTime, '{y}-{m}-{d}') }}</span>
+        </template>
+      </el-table-column>
+      <el-table-column label="销售公司" align="center" prop="companyName" />
+      <el-table-column label="新增会员" align="center" prop="newUserNum" />
+      <el-table-column label="会员数量" align="center" prop="userNum" />
+      <el-table-column label="观看人数" align="center" prop="watchNum" />
+      <el-table-column label="上线率" align="center" prop="onlineRatePercent" />
+      <el-table-column label="完播人数" align="center" prop="completeWatchNum" />
+      <el-table-column label="完播率" align="center" prop="completeWatchRatePercent" />
+
+    </el-table>
+
+    <pagination
+      v-show="total>0"
+      :total="total"
+      :page.sync="queryParams.pageNum"
+      :limit.sync="queryParams.pageSize"
+      @pagination="getList"
+    />
+
+    <!-- 添加或修改会员看课统计-按营期统计对话框 -->
+    <el-dialog :title="title" :visible.sync="open" width="500px" append-to-body>
+      <el-form ref="form" :model="form" :rules="rules" label-width="80px">
+        <el-form-item label="营期id" prop="periodId">
+          <el-input v-model="form.periodId" placeholder="请输入营期id" />
+        </el-form-item>
+        <el-form-item label="营期名称" prop="periodName">
+          <el-input v-model="form.periodName" placeholder="请输入营期名称" />
+        </el-form-item>
+        <el-form-item label="营期开始日期" prop="periodStartingTime">
+          <el-date-picker clearable size="small"
+            v-model="form.periodStartingTime"
+            type="date"
+            value-format="yyyy-MM-dd"
+            placeholder="选择营期开始日期">
+          </el-date-picker>
+        </el-form-item>
+        <el-form-item label="新增会员数量" prop="newUserNum">
+          <el-input v-model="form.newUserNum" placeholder="请输入新增会员数量" />
+        </el-form-item>
+        <el-form-item label="会员数量" prop="userNum">
+          <el-input v-model="form.userNum" placeholder="请输入会员数量" />
+        </el-form-item>
+        <el-form-item label="观看人数" prop="watchNum">
+          <el-input v-model="form.watchNum" placeholder="请输入观看人数" />
+        </el-form-item>
+        <el-form-item label="完播人数" prop="completeWatchNum">
+          <el-input v-model="form.completeWatchNum" placeholder="请输入完播人数" />
+        </el-form-item>
+        <el-form-item label="完播率" prop="completeWatchRate">
+          <el-input v-model="form.completeWatchRate" placeholder="请输入完播率" />
+        </el-form-item>
+      </el-form>
+      <div slot="footer" class="dialog-footer">
+        <el-button type="primary" @click="submitForm">确 定</el-button>
+        <el-button @click="cancel">取 消</el-button>
+      </div>
+    </el-dialog>
+  </div>
+</template>
+
+<script>
+import { listUserWatchStatistics, getUserWatchStatistics, delUserWatchStatistics, addUserWatchStatistics, updateUserWatchStatistics, exportUserWatchStatistics } from "@/api/course/userWatchStatistics";
+
+export default {
+  name: "UserWatchStatistics",
+  data() {
+    return {
+      // 遮罩层
+      loading: true,
+      // 导出遮罩层
+      exportLoading: false,
+      // 选中数组
+      ids: [],
+      // 非单个禁用
+      single: true,
+      // 非多个禁用
+      multiple: true,
+      // 显示搜索条件
+      showSearch: true,
+      // 总条数
+      total: 0,
+      // 会员看课统计-按营期统计表格数据
+      userWatchStatisticsList: [],
+      // 弹出层标题
+      title: "",
+      // 是否显示弹出层
+      open: false,
+      // 查询参数
+      queryParams: {
+        pageNum: 1,
+        pageSize: 10,
+        periodId: null,
+        periodName: null,
+        periodStartingTime: null,
+        companyName: null,
+        newUserNum: null,
+        userNum: null,
+        watchNum: null,
+        completeWatchNum: null,
+        completeWatchRate: null
+      },
+      // 表单参数
+      form: {},
+      // 表单校验
+      rules: {
+      }
+    };
+  },
+  created() {
+    this.getList();
+  },
+  methods: {
+    /** 查询会员看课统计-按营期统计列表 */
+    getList() {
+      this.loading = true;
+      listUserWatchStatistics(this.queryParams).then(response => {
+        this.userWatchStatisticsList = response.rows;
+        this.total = response.total;
+        this.loading = false;
+      });
+    },
+    // 取消按钮
+    cancel() {
+      this.open = false;
+      this.reset();
+    },
+    // 表单重置
+    reset() {
+      this.form = {
+        id: null,
+        periodId: null,
+        periodName: null,
+        periodStartingTime: null,
+        newUserNum: null,
+        userNum: null,
+        watchNum: null,
+        completeWatchNum: null,
+        completeWatchRate: null
+      };
+      this.resetForm("form");
+    },
+    /** 搜索按钮操作 */
+    handleQuery() {
+      this.queryParams.pageNum = 1;
+      this.getList();
+    },
+    /** 重置按钮操作 */
+    resetQuery() {
+      this.resetForm("queryForm");
+      this.handleQuery();
+    },
+    // 多选框选中数据
+    handleSelectionChange(selection) {
+      this.ids = selection.map(item => item.id)
+      this.single = selection.length!==1
+      this.multiple = !selection.length
+    },
+    /** 新增按钮操作 */
+    handleAdd() {
+      this.reset();
+      this.open = true;
+      this.title = "添加会员看课统计-按营期统计";
+    },
+    /** 修改按钮操作 */
+    handleUpdate(row) {
+      this.reset();
+      const id = row.id || this.ids
+      getUserWatchStatistics(id).then(response => {
+        this.form = response.data;
+        this.open = true;
+        this.title = "修改会员看课统计-按营期统计";
+      });
+    },
+    /** 提交按钮 */
+    submitForm() {
+      this.$refs["form"].validate(valid => {
+        if (valid) {
+          if (this.form.id != null) {
+            updateUserWatchStatistics(this.form).then(response => {
+              this.msgSuccess("修改成功");
+              this.open = false;
+              this.getList();
+            });
+          } else {
+            addUserWatchStatistics(this.form).then(response => {
+              this.msgSuccess("新增成功");
+              this.open = false;
+              this.getList();
+            });
+          }
+        }
+      });
+    },
+    /** 删除按钮操作 */
+    handleDelete(row) {
+      const ids = row.id || this.ids;
+      this.$confirm('是否确认删除会员看课统计-按营期统计编号为"' + ids + '"的数据项?', "警告", {
+          confirmButtonText: "确定",
+          cancelButtonText: "取消",
+          type: "warning"
+        }).then(function() {
+          return delUserWatchStatistics(ids);
+        }).then(() => {
+          this.getList();
+          this.msgSuccess("删除成功");
+        }).catch(() => {});
+    },
+    /** 导出按钮操作 */
+    handleExport() {
+      const queryParams = this.queryParams;
+      this.$confirm('是否确认导出当前数据项?', "警告", {
+          confirmButtonText: "确定",
+          cancelButtonText: "取消",
+          type: "warning"
+        }).then(() => {
+          this.exportLoading = true;
+          return exportUserWatchStatistics(queryParams);
+        }).then(response => {
+          this.download(response.msg);
+          this.exportLoading = false;
+        }).catch(() => {});
+    }
+  }
+};
+</script>

+ 3 - 2
src/views/his/user/index.vue

@@ -353,7 +353,8 @@ export default {
         sTime:null,
         eTime:null,
         isBuy:null,
-        source:null
+        source:null,
+        companyName: null,
       },
       // 表单参数
       form: {},
@@ -566,7 +567,7 @@ export default {
     /** 导出按钮操作 */
     handleExport() {
       const queryParams = this.queryParams;
-      this.$confirm('是否确认导出所有用户数据项?', "警告", {
+      this.$confirm('是否确认导出当前用户数据项?', "警告", {
           confirmButtonText: "确定",
           cancelButtonText: "取消",
           type: "warning"

+ 400 - 0
src/views/his/userOnlineState/index.vue

@@ -0,0 +1,400 @@
+<template>
+  <div class="app-container">
+    <el-form :model="queryParams" ref="queryForm" :inline="true" v-show="showSearch" label-width="68px">
+      <el-form-item label="用户昵称" prop="nickname">
+        <el-input
+          v-model="queryParams.nickname"
+          placeholder="请输入用户昵称"
+          clearable
+          size="small"
+          @keyup.enter.native="handleQuery"
+        />
+      </el-form-item>
+      <el-form-item label="手机号码" prop="phone">
+        <el-input
+          v-model="queryParams.phone"
+          placeholder="请输入手机号码"
+          clearable
+          size="small"
+          @keyup.enter.native="handleQuery"
+        />
+      </el-form-item>
+      <el-form-item label="所属公司" prop="companyName">
+        <el-input
+          v-model="queryParams.companyName"
+          placeholder="请输入所属公司"
+          clearable
+          size="small"
+          @keyup.enter.native="handleQuery"
+        />
+      </el-form-item>
+      <el-form-item label="所属销售" prop="companyUserNickName">
+        <el-input
+          v-model="queryParams.companyUserName"
+          placeholder="请输入所属销售"
+          clearable
+          size="small"
+          @keyup.enter.native="handleQuery"
+        />
+      </el-form-item>
+      <el-form-item>
+        <el-button type="primary" icon="el-icon-search" size="mini" @click="handleQuery">搜索</el-button>
+        <el-button icon="el-icon-refresh" size="mini" @click="resetQuery">重置</el-button>
+      </el-form-item>
+
+    </el-form>
+
+    <el-row :gutter="10" class="mb8">
+<!--      <el-col :span="1.5">-->
+<!--        <el-button-->
+<!--          type="primary"-->
+<!--          plain-->
+<!--          icon="el-icon-plus"-->
+<!--          size="mini"-->
+<!--          @click="handleAdd"-->
+<!--          v-hasPermi="['store:userOnlineState:add']"-->
+<!--        >新增</el-button>-->
+<!--      </el-col>-->
+<!--      <el-col :span="1.5">-->
+<!--        <el-button-->
+<!--          type="success"-->
+<!--          plain-->
+<!--          icon="el-icon-edit"-->
+<!--          size="mini"-->
+<!--          :disabled="single"-->
+<!--          @click="handleUpdate"-->
+<!--          v-hasPermi="['store:userOnlineState:edit']"-->
+<!--        >修改</el-button>-->
+<!--      </el-col>-->
+<!--      <el-col :span="1.5">-->
+<!--        <el-button-->
+<!--          type="danger"-->
+<!--          plain-->
+<!--          icon="el-icon-delete"-->
+<!--          size="mini"-->
+<!--          :disabled="multiple"-->
+<!--          @click="handleDelete"-->
+<!--          v-hasPermi="['store:userOnlineState:remove']"-->
+<!--        >删除</el-button>-->
+<!--      </el-col>-->
+      <el-col :span="1.5">
+        <el-button
+          type="warning"
+          plain
+          icon="el-icon-download"
+          size="mini"
+          :loading="exportLoading"
+          @click="handleExport"
+          v-hasPermi="['store:userOnlineState:export']"
+        >导出</el-button>
+      </el-col>
+      <right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar>
+    </el-row>
+
+    <el-table border v-loading="loading" :data="userOnlineStateList" @selection-change="handleSelectionChange">
+      <el-table-column type="selection" width="55" align="center" />
+      <el-table-column label="用户id" align="center" prop="userId" />
+      <el-table-column label="用户昵称" align="center" prop="nickname" />
+      <el-table-column label="用户头像" align="center" width="80">
+        <template slot-scope="scope">
+          <el-popover
+            placement="right"
+            title=""
+            trigger="hover"
+          >
+            <img slot="reference" :src="scope.row.avatar" width="50" >
+            <img :src="scope.row.avatar" style="max-width: 120px;">
+          </el-popover>
+        </template>
+      </el-table-column>
+      <el-table-column label="手机号码" align="center" prop="phone" />
+      <el-table-column label="注册时间" align="center" prop="createTime" />
+      <el-table-column label="用户状态" align="center" prop="status">
+        <template slot-scope="scope">
+          <el-tag prop="status"  v-if="scope.row.status === 1" type="success">正常</el-tag>
+          <el-tag prop="status"  v-if="scope.row.status === 0" type="warning">禁用</el-tag>
+        </template>
+      </el-table-column>
+      <el-table-column label="所属公司" align="center" prop="companyName" />
+      <el-table-column label="所属销售" align="center" prop="companyUserName" />
+      <el-table-column label="上线状态" align="center" prop="onlineStatus">
+      <template slot-scope="scope">
+        <el-tag prop="onlineStatus"  v-if="scope.row.onlineStatus === 1" type="success">已上线</el-tag>
+        <el-tag prop="onlineStatus"  v-if="scope.row.onlineStatus === 2" type="primary">未上线</el-tag>
+      </template>
+      </el-table-column>
+<!--      <el-table-column label="上线时间" align="center" prop="onlineTime" width="180">-->
+<!--        <template slot-scope="scope">-->
+<!--          <span>{{ parseTime(scope.row.onlineTime, '{y}-{m}-{d}') }}</span>-->
+<!--        </template>-->
+<!--      </el-table-column>-->
+<!--      <el-table-column label="看课数量" align="center" prop="watchCourseCount" />-->
+<!--      <el-table-column label="参与营期数量" align="center" prop="partCourseCount" />-->
+<!--      <el-table-column label="最后一次看课时间" align="center" prop="lastWatchDate" width="180">-->
+<!--        <template slot-scope="scope">-->
+<!--          <span>{{ parseTime(scope.row.lastWatchDate, '{y}-{m}-{d}') }}</span>-->
+<!--        </template>-->
+<!--      </el-table-column>-->
+<!--      <el-table-column label="操作" align="center" class-name="small-padding fixed-width">-->
+<!--        <template slot-scope="scope">-->
+<!--          <el-button-->
+<!--            size="mini"-->
+<!--            type="text"-->
+<!--            icon="el-icon-edit"-->
+<!--            @click="handleUpdate(scope.row)"-->
+<!--            v-hasPermi="['store:userOnlineState:edit']"-->
+<!--          >修改</el-button>-->
+<!--          <el-button-->
+<!--            size="mini"-->
+<!--            type="text"-->
+<!--            icon="el-icon-delete"-->
+<!--            @click="handleDelete(scope.row)"-->
+<!--            v-hasPermi="['store:userOnlineState:remove']"-->
+<!--          >删除</el-button>-->
+<!--        </template>-->
+<!--      </el-table-column>-->
+    </el-table>
+
+    <pagination
+      v-show="total>0"
+      :total="total"
+      :page.sync="queryParams.pageNum"
+      :limit.sync="queryParams.pageSize"
+      @pagination="getList"
+    />
+
+<!--    &lt;!&ndash; 添加或修改用户上线情况对话框 &ndash;&gt;-->
+<!--    <el-dialog :title="title" :visible.sync="open" width="500px" append-to-body>-->
+<!--      <el-form ref="form" :model="form" :rules="rules" label-width="80px">-->
+<!--        <el-form-item label="用户昵称" prop="nickname">-->
+<!--          <el-input v-model="form.nickname" placeholder="请输入用户昵称" />-->
+<!--        </el-form-item>-->
+<!--        <el-form-item label="用户头像" prop="avatar">-->
+<!--          <el-input v-model="form.avatar" placeholder="请输入用户头像" />-->
+<!--        </el-form-item>-->
+<!--        <el-form-item label="微信小程序OPENID" prop="maOpenId">-->
+<!--          <el-input v-model="form.maOpenId" placeholder="请输入微信小程序OPENID" />-->
+<!--        </el-form-item>-->
+<!--        <el-form-item label="微信公众号OPENID" prop="mpOpenId">-->
+<!--          <el-input v-model="form.mpOpenId" placeholder="请输入微信公众号OPENID" />-->
+<!--        </el-form-item>-->
+<!--        <el-form-item label="关联ID" prop="unionId">-->
+<!--          <el-input v-model="form.unionId" placeholder="请输入关联ID" />-->
+<!--        </el-form-item>-->
+<!--        <el-form-item label="公司id" prop="companyId">-->
+<!--          <el-input v-model="form.companyId" placeholder="请输入公司id" />-->
+<!--        </el-form-item>-->
+<!--        <el-form-item label="销售id" prop="companyUserId">-->
+<!--          <el-input v-model="form.companyUserId" placeholder="请输入销售id" />-->
+<!--        </el-form-item>-->
+<!--        <el-form-item label="上线状态,1-已上线;2-未上线">-->
+<!--          <el-radio-group v-model="form.onlineStatus">-->
+<!--            <el-radio label="1">请选择字典生成</el-radio>-->
+<!--          </el-radio-group>-->
+<!--        </el-form-item>-->
+<!--        <el-form-item label="上线时间" prop="onlineTime">-->
+<!--          <el-date-picker clearable size="small"-->
+<!--            v-model="form.onlineTime"-->
+<!--            type="date"-->
+<!--            value-format="yyyy-MM-dd"-->
+<!--            placeholder="选择上线时间">-->
+<!--          </el-date-picker>-->
+<!--        </el-form-item>-->
+<!--        <el-form-item label="看课数量" prop="watchCourseCount">-->
+<!--          <el-input v-model="form.watchCourseCount" placeholder="请输入看课数量" />-->
+<!--        </el-form-item>-->
+<!--        <el-form-item label="参与营期数量" prop="partCourseCount">-->
+<!--          <el-input v-model="form.partCourseCount" placeholder="请输入参与营期数量" />-->
+<!--        </el-form-item>-->
+<!--        <el-form-item label="最后一次看课时间" prop="lastWatchDate">-->
+<!--          <el-date-picker clearable size="small"-->
+<!--            v-model="form.lastWatchDate"-->
+<!--            type="date"-->
+<!--            value-format="yyyy-MM-dd"-->
+<!--            placeholder="选择最后一次看课时间">-->
+<!--          </el-date-picker>-->
+<!--        </el-form-item>-->
+<!--      </el-form>-->
+<!--      <div slot="footer" class="dialog-footer">-->
+<!--        <el-button type="primary" @click="submitForm">确 定</el-button>-->
+<!--        <el-button @click="cancel">取 消</el-button>-->
+<!--      </div>-->
+<!--    </el-dialog>-->
+  </div>
+</template>
+
+<script>
+import { listUserOnlineState, getUserOnlineState, delUserOnlineState, addUserOnlineState, updateUserOnlineState, exportUserOnlineState } from "@/api/his/userOnlineState";
+
+export default {
+  name: "UserOnlineState",
+  data() {
+    return {
+      // 遮罩层
+      loading: true,
+      // 导出遮罩层
+      exportLoading: false,
+      // 选中数组
+      ids: [],
+      // 非单个禁用
+      single: true,
+      // 非多个禁用
+      multiple: true,
+      // 显示搜索条件
+      showSearch: true,
+      // 总条数
+      total: 0,
+      // 用户上线情况表格数据
+      userOnlineStateList: [],
+      // 弹出层标题
+      title: "",
+      // 是否显示弹出层
+      open: false,
+      // 查询参数
+      queryParams: {
+        pageNum: 1,
+        pageSize: 10,
+        nickname: null,
+        avatar: null,
+        phone: null,
+        maOpenId: null,
+        mpOpenId: null,
+        unionId: null,
+        companyId: null,
+        companyUserId: null,
+        onlineStatus: null,
+        onlineTime: null,
+        watchCourseCount: null,
+        partCourseCount: null,
+        lastWatchDate: null
+      },
+      // 表单参数
+      form: {},
+      // 表单校验
+      rules: {
+      }
+    };
+  },
+  created() {
+    this.getList();
+  },
+  methods: {
+    /** 查询用户上线情况列表 */
+    getList() {
+      this.loading = true;
+      listUserOnlineState(this.queryParams).then(response => {
+        this.userOnlineStateList = response.rows;
+        this.total = response.total;
+        this.loading = false;
+      });
+    },
+    // 取消按钮
+    cancel() {
+      this.open = false;
+      this.reset();
+    },
+    // 表单重置
+    reset() {
+      this.form = {
+        userId: null,
+        nickname: null,
+        avatar: null,
+        phone: null,
+        createTime: null,
+        maOpenId: null,
+        mpOpenId: null,
+        unionId: null,
+        companyId: null,
+        companyUserId: null,
+        onlineStatus: 0,
+        onlineTime: null,
+        watchCourseCount: null,
+        partCourseCount: null,
+        lastWatchDate: null
+      };
+      this.resetForm("form");
+    },
+    /** 搜索按钮操作 */
+    handleQuery() {
+      this.queryParams.pageNum = 1;
+      this.getList();
+    },
+    /** 重置按钮操作 */
+    resetQuery() {
+      this.resetForm("queryForm");
+      this.handleQuery();
+    },
+    // 多选框选中数据
+    handleSelectionChange(selection) {
+      this.ids = selection.map(item => item.userId)
+      this.single = selection.length!==1
+      this.multiple = !selection.length
+    },
+    /** 新增按钮操作 */
+    handleAdd() {
+      this.reset();
+      this.open = true;
+      this.title = "添加用户上线情况";
+    },
+    /** 修改按钮操作 */
+    handleUpdate(row) {
+      this.reset();
+      const userId = row.userId || this.ids
+      getUserOnlineState(userId).then(response => {
+        this.form = response.data;
+        this.open = true;
+        this.title = "修改用户上线情况";
+      });
+    },
+    /** 提交按钮 */
+    submitForm() {
+      this.$refs["form"].validate(valid => {
+        if (valid) {
+          if (this.form.userId != null) {
+            updateUserOnlineState(this.form).then(response => {
+              this.msgSuccess("修改成功");
+              this.open = false;
+              this.getList();
+            });
+          } else {
+            addUserOnlineState(this.form).then(response => {
+              this.msgSuccess("新增成功");
+              this.open = false;
+              this.getList();
+            });
+          }
+        }
+      });
+    },
+    /** 删除按钮操作 */
+    handleDelete(row) {
+      const userIds = row.userId || this.ids;
+      this.$confirm('是否确认删除用户上线情况编号为"' + userIds + '"的数据项?', "警告", {
+          confirmButtonText: "确定",
+          cancelButtonText: "取消",
+          type: "warning"
+        }).then(function() {
+          return delUserOnlineState(userIds);
+        }).then(() => {
+          this.getList();
+          this.msgSuccess("删除成功");
+        }).catch(() => {});
+    },
+    /** 导出按钮操作 */
+    handleExport() {
+      const queryParams = this.queryParams;
+      this.$confirm('是否确认导出所有用户上线情况数据项?', "警告", {
+          confirmButtonText: "确定",
+          cancelButtonText: "取消",
+          type: "warning"
+        }).then(() => {
+          this.exportLoading = true;
+          return exportUserOnlineState(queryParams);
+        }).then(response => {
+          this.download(response.msg);
+          this.exportLoading = false;
+        }).catch(() => {});
+    }
+  }
+};
+</script>

+ 12 - 11
src/views/user/darkRoom/index.vue

@@ -43,16 +43,17 @@
           </el-popover>
         </template>
       </el-table-column>
+      <el-table-column label="手机号码" align="center" prop="phone" width="160px"/>
       <el-table-column label="注册时间" align="center" prop="createTime" width="160px"/>
-      <el-table-column label="看课数量" align="center" prop="watchCourseCount" />
-      <el-table-column label="缺课数量" align="center" prop="missCourseCount" />
-      <el-table-column label="缺课状态" align="center" prop="missCourseStatus">
-        <template slot-scope="scope">
-          <el-tag effect="dark" type="danger"  v-if="scope.row.missCourseStatus === 1">已缺课</el-tag>
-          <el-tag effect="dark" type="success" v-else>未缺课</el-tag>
-        </template>
-      </el-table-column>
-      <el-table-column label="参与营期数量" align="center" prop="partCourseCount" width="100px"/>
+<!--      <el-table-column label="看课数量" align="center" prop="watchCourseCount" />-->
+<!--      <el-table-column label="缺课数量" align="center" prop="missCourseCount" />-->
+<!--      <el-table-column label="缺课状态" align="center" prop="missCourseStatus">-->
+<!--        <template slot-scope="scope">-->
+<!--          <el-tag effect="dark" type="danger"  v-if="scope.row.missCourseStatus === 1">已缺课</el-tag>-->
+<!--          <el-tag effect="dark" type="success" v-else>未缺课</el-tag>-->
+<!--        </template>-->
+<!--      </el-table-column>-->
+<!--      <el-table-column label="参与营期数量" align="center" prop="partCourseCount" width="100px"/>-->
       <el-table-column label="最后一次看课时间" align="center" prop="lastWatchDate"  width="160px"/>
       <el-table-column label="用户状态" align="center" prop="courseCountStatus">
         <template slot-scope="scope">
@@ -61,8 +62,8 @@
           <el-tag effect="dark" type="danger"  v-else>未看</el-tag>
         </template>
       </el-table-column>
-      <el-table-column label="停课天数" align="center" prop="stopWatchDays" />
-      <el-table-column label="完播时间" align="center" prop="completeWatchDate" width="160px"/>
+<!--      <el-table-column label="停课天数" align="center" prop="stopWatchDays" />-->
+<!--      <el-table-column label="完播时间" align="center" prop="completeWatchDate" width="160px"/>-->
       <el-table-column label="标签名称" align="center" prop="tag" />
       <el-table-column label="所属销售名称" align="center" prop="companyUserNickName" width="120px"/>
       <el-table-column label="备注" align="center" prop="remark" />