Browse Source

更新了全新mylist,和看课记录的权限

xw 1 day ago
parent
commit
2bc6901bab

+ 3 - 3
src/views/course/courseWatchLog/index.vue

@@ -310,7 +310,7 @@
           @click="handleExport"
           v-hasPermi="['course:courseWatchLog:export']"
         >导出</el-button>
-        <el-col :span="1.5" v-if="queryParams.sendType == 2">
+        <el-col :span="1.5"  v-if="queryParams.sendType == 2">
           <el-button
             type="primary"
             plain
@@ -329,7 +329,7 @@
           >批量移除标签</el-button>
         </el-col>
       </el-col>
-      <el-col :span="1.5"  v-if="queryParams.sendType == 2">
+      <el-col :span="1.5">
         <el-button
           type="success"
           plain
@@ -340,7 +340,7 @@
         >批量修改备注
         </el-button>
       </el-col>
-      <el-col :span="1.5" v-if="queryParams.sendType == 2">
+      <el-col :span="1.5">
         <el-button
           type="success"
           plain

+ 93 - 24
src/views/course/courseWatchLog/watchLog.vue

@@ -70,7 +70,7 @@
       </el-form-item>
       <el-form-item label="课程" prop="courseId">
         <el-select filterable v-model="queryParams.courseId" placeholder="请选择课程" clearable size="small"
-                   @change="courseChange(queryParams.courseId)">
+                   @change="handleCourseChange">
           <el-option
             v-for="dict in courseLists"
             :key="dict.dictValue"
@@ -79,8 +79,22 @@
           />
         </el-select>
       </el-form-item>
+      <!-- 营期:仅在会员方式(sendType=1)时显示 -->
+      <el-form-item label="营期" prop="periodId" v-if="queryParams.sendType == 1">
+        <el-select filterable v-model="queryParams.periodId" placeholder="请选择营期" clearable size="small"
+                   @change="handlePeriodChange" :disabled="!queryParams.courseId">
+          <el-option
+            v-for="dict in periodList"
+            :key="dict.dictValue"
+            :label="dict.dictLabel"
+            :value="dict.dictValue"
+          />
+        </el-select>
+      </el-form-item>
+      <!-- 小节:会员方式依赖营期,企微方式依赖课程 -->
       <el-form-item label="小节" prop="videoId">
-        <el-select filterable v-model="queryParams.videoId" placeholder="请选择小节" clearable size="small">
+        <el-select filterable v-model="queryParams.videoId" placeholder="请选择小节" clearable size="small"
+                   :disabled="queryParams.sendType == 1 ? !queryParams.periodId : !queryParams.courseId">
           <el-option
             v-for="dict in videoList"
             :key="dict.dictValue"
@@ -291,7 +305,7 @@
           >批量移除标签</el-button>
         </el-col>
       </el-col>
-      <el-col :span="1.5" v-if="queryParams.sendType == 2">
+      <el-col :span="1.5" >
         <el-button
           type="success"
           plain
@@ -302,7 +316,7 @@
         >批量修改备注
         </el-button>
       </el-col>
-      <el-col :span="1.5" v-if="queryParams.sendType == 2">
+      <el-col :span="1.5" >
         <el-button
           type="success"
           plain
@@ -669,7 +683,7 @@ import {
   myListCourseWatchLog,
   updateCourseWatchLog
 } from "@/api/course/courseWatchLog";
-import {courseList, qwCourseList, myListCourseRedPacketLog, videoList, qwVideoList} from '@/api/course/courseRedPacketLog'
+import {courseList, qwCourseList, myListCourseRedPacketLog, videoList, qwVideoList, periodList} from '@/api/course/courseRedPacketLog'
 import {myListLogs} from "@/api/course/courseAnswerlogs";
 import {getMyQwUserList} from "@/api/qw/user";
 import {searchTags} from "../../../api/qw/tag";
@@ -731,6 +745,7 @@ export default {
         }
       },
       courseLists: [],
+      periodList: [],  // 营期列表
       videoList: [],
       myQwUserList: [],
       logTypeOptions: [],
@@ -832,6 +847,7 @@ export default {
         companyUserId: null,
         companyId: null,
         courseId: null,
+        periodId: null,  // 营期ID
         sTime: null,
         eTime: null,
         upSTime:null,
@@ -906,10 +922,12 @@ export default {
       this.queryParams.corpId = null;
       this.queryParams.project = null;
       this.queryParams.courseId = null;
+      this.queryParams.periodId = null;
       this.queryParams.videoId = null;
 
-      // 清空课程和视频列表
+      // 清空课程、营期和视频列表
       this.courseLists = [];
+      this.periodList = [];
       this.videoList = [];
 
       // 重新加载课程列表
@@ -953,29 +971,72 @@ export default {
       if (!dates || dates.length < 2) return '';
       return dates.map(date => date.format('YYYY-MM-DD')).join(' ~ ');
     },
-    courseChange(row) {
+    /**
+     * 课程变更处理
+     * sendType=1(会员): 加载营期列表,清空营期和小节
+     * sendType=2(企微): 直接加载小节列表,清空小节
+     */
+    handleCourseChange(courseId) {
+      // 清空下级选择和列表
+      this.queryParams.periodId = null;
       this.queryParams.videoId = null;
-      if (row === '') {
-        this.videoList = [];
-        return
+      this.periodList = [];
+      this.videoList = [];
+
+      if (courseId) {
+        if (this.queryParams.sendType == 1) {
+          // 会员方式:加载营期列表(三级联动:课程->营期->小节)
+          this.loadPeriodList(courseId);
+        } else if (this.queryParams.sendType == 2) {
+          // 企微方式:直接加载小节列表(二级联动:课程->小节)
+          this.loadQwVideoList(courseId);
+        }
       }
-      
-      // 根据sendType调用不同的接口
-      if (this.queryParams.sendType == 2) {
-        // 企微方式:调用qwVideoList
-        this.loadQwVideoList(row);
-      } else {
-        // 会员方式:调用videoList
-        videoList(row).then(response => {
-          this.videoList = response.list || [];
-        }).catch(error => {
-          console.error('加载视频列表失败:', error);
-          this.$message.error('加载视频列表失败');
-          this.videoList = [];
-        });
+    },
+
+    /**
+     * 营期变更处理
+     * 当营期改变时,清空小节的选择和列表
+     */
+    handlePeriodChange(periodId) {
+      // 清空下级选择和列表
+      this.queryParams.videoId = null;
+      this.videoList = [];
+
+      // 如果选择了营期,加载视频列表
+      if (periodId) {
+        this.loadVideoList(periodId);
       }
     },
 
+    /**
+     * 加载营期列表
+     * @param {Number} courseId - 课程ID
+     */
+    loadPeriodList(courseId) {
+      periodList({ courseId: courseId }).then(response => {
+        this.periodList = response.data || [];
+      }).catch(error => {
+        console.error('加载营期列表失败:', error);
+        this.$message.error('加载营期列表失败');
+        this.periodList = [];
+      });
+    },
+
+    /**
+     * 加载视频列表(通过营期ID)
+     * @param {Number} periodId - 营期ID
+     */
+    loadVideoList(periodId) {
+      videoList(periodId).then(response => {
+        this.videoList = response.list || [];
+      }).catch(error => {
+        console.error('加载视频列表失败:', error);
+        this.$message.error('加载视频列表失败');
+        this.videoList = [];
+      });
+    },
+
     /**
      * 加载课程列表
      * 根据sendType加载不同的课程列表
@@ -1264,6 +1325,14 @@ export default {
       this.queryParams.isVip = null; // 重置 isVip 状态
       this.queryParams.qwUserId = null; // 重置 qwUserId
       this.queryParams.externalUserName=null;
+      
+      // 重置三级联动相关数据
+      this.queryParams.courseId = null;
+      this.queryParams.periodId = null;
+      this.queryParams.videoId = null;
+      this.periodList = [];
+      this.videoList = [];
+      
       // 重置SOP搜索
       this.handleSopClear();
       // 统一重置日历组件

+ 3 - 2
src/views/member/mylist.vue

@@ -325,7 +325,7 @@
 </template>
 
 <script>
-import { myListUser, getUser, addUser, updateUser, delUser, exportUser, auditUser } from "@/api/user/fsUser";
+import { listUser, getUser, addUser, updateUser, delUser, exportUser, auditUser } from "@/api/user/fsUser";
 import {transferUser} from "@/api/users/user";
 import {getUserList} from "@/api/company/companyUser";
 import userDetails from '@/views/store/components/userDetails.vue';
@@ -333,6 +333,7 @@ import userCoursePeriod from '../../components/course/userCoursePeriod.vue'
 export default {
   name: "FsUser",
   components: {userDetails,userCoursePeriod},
+  dicts: ['user_status', 'sys_course_project'],
   data() {
     return {
 
@@ -502,7 +503,7 @@ export default {
         this.queryParams.registerEndTime = null;
       }
 
-      myListUser(this.queryParams).then(response => {
+      listUser(this.queryParams).then(response => {
         console.log('我的会员列表查询结果:', response);
         this.userList = response.rows;
         this.total = response.total;