|
@@ -33,6 +33,9 @@
|
|
|
<el-table-column label="上传时间" align="center" prop="createTime" />
|
|
<el-table-column label="上传时间" align="center" prop="createTime" />
|
|
|
<el-table-column label="默认红包" align="center" prop="redPacketMoney" />
|
|
<el-table-column label="默认红包" align="center" prop="redPacketMoney" />
|
|
|
<el-table-column label="公司红包" align="center" prop="companyRedPacketMoney" />
|
|
<el-table-column label="公司红包" align="center" prop="companyRedPacketMoney" />
|
|
|
|
|
+ <el-table-column label="标签组名称" align="center" prop="tagGroupName" />
|
|
|
|
|
+ <el-table-column label="看课标签" align="center" prop="watchingTagName" />
|
|
|
|
|
+ <el-table-column label="完课标签" align="center" prop="watchedTagName" />
|
|
|
|
|
|
|
|
<el-table-column label="操作" align="center" class-name="small-padding fixed-width">
|
|
<el-table-column label="操作" align="center" class-name="small-padding fixed-width">
|
|
|
<template slot-scope="scope">
|
|
<template slot-scope="scope">
|
|
@@ -49,12 +52,10 @@
|
|
|
@click="updateMoney(scope.row)"
|
|
@click="updateMoney(scope.row)"
|
|
|
>设置红包金额</el-button>
|
|
>设置红包金额</el-button>
|
|
|
|
|
|
|
|
-<!-- <el-button-->
|
|
|
|
|
-<!-- size="mini"-->
|
|
|
|
|
-<!-- type="text"-->
|
|
|
|
|
-<!-- @click="openDialog(scope.row)"-->
|
|
|
|
|
-<!-- v-hasPermi="['course:courseLink:create']"-->
|
|
|
|
|
-<!-- >生成应急短链</el-button>-->
|
|
|
|
|
|
|
+ <el-button size="mini"
|
|
|
|
|
+ type="text" @click="openTagDialog(scope.row)">
|
|
|
|
|
+ 绑定看课标签
|
|
|
|
|
+ </el-button>
|
|
|
</template>
|
|
</template>
|
|
|
</el-table-column>
|
|
</el-table-column>
|
|
|
</el-table>
|
|
</el-table>
|
|
@@ -72,6 +73,7 @@
|
|
|
:visible.sync="open" append-to-body>
|
|
:visible.sync="open" append-to-body>
|
|
|
<userCourseVideoDetails ref="userCourseVideoDetails" />
|
|
<userCourseVideoDetails ref="userCourseVideoDetails" />
|
|
|
</el-drawer>
|
|
</el-drawer>
|
|
|
|
|
+
|
|
|
<el-dialog title="设置红包金额" :visible.sync="moneyOpen" width="600px" append-to-body>
|
|
<el-dialog title="设置红包金额" :visible.sync="moneyOpen" width="600px" append-to-body>
|
|
|
<el-form ref="form" label-width="100px">
|
|
<el-form ref="form" label-width="100px">
|
|
|
<el-form-item label="红包金额" prop="corpId">
|
|
<el-form-item label="红包金额" prop="corpId">
|
|
@@ -108,34 +110,107 @@
|
|
|
<el-button type="primary" @click="confirm">确认</el-button>
|
|
<el-button type="primary" @click="confirm">确认</el-button>
|
|
|
</div>
|
|
</div>
|
|
|
</el-dialog>
|
|
</el-dialog>
|
|
|
-<!-- <el-dialog title="设置红包金额" :visible.sync="moneyOpen" width="600px" append-to-body>-->
|
|
|
|
|
-<!-- <el-form ref="form" label-width="100px">-->
|
|
|
|
|
-<!-- <el-form-item label="红包金额" prop="corpId">-->
|
|
|
|
|
-<!-- <el-input-number v-model="redPacketMoneyForm.redPacketMoney" :min="0.1" :max="200" :step="0.1" ></el-input-number>-->
|
|
|
|
|
-<!-- </el-form-item>-->
|
|
|
|
|
-<!-- </el-form>-->
|
|
|
|
|
-<!-- <div slot="footer" class="dialog-footer">-->
|
|
|
|
|
-<!-- <el-button @click="cancel">取 消</el-button>-->
|
|
|
|
|
-<!-- </div>-->
|
|
|
|
|
-<!-- </el-dialog>-->
|
|
|
|
|
|
|
+
|
|
|
|
|
+ <!-- 弹框 -->
|
|
|
|
|
+ <el-dialog
|
|
|
|
|
+ title="绑定看课标签"
|
|
|
|
|
+ :visible.sync="tagDialogVisible"
|
|
|
|
|
+ width="500px"
|
|
|
|
|
+ @closed="resetDialog"
|
|
|
|
|
+ append-to-body
|
|
|
|
|
+ >
|
|
|
|
|
+ <el-form :model="tagDialog" label-width="120px">
|
|
|
|
|
+ <!-- 标签组选择 -->
|
|
|
|
|
+ <el-form-item label="标签组" required>
|
|
|
|
|
+ <el-select
|
|
|
|
|
+ v-model="tagDialog.groupId"
|
|
|
|
|
+ placeholder="请选择标签组"
|
|
|
|
|
+ @change="onGroupChange"
|
|
|
|
|
+ filterable
|
|
|
|
|
+ >
|
|
|
|
|
+ <el-option
|
|
|
|
|
+ v-for="group in tagGroups"
|
|
|
|
|
+ :key="group.groupId"
|
|
|
|
|
+ :label="group.name"
|
|
|
|
|
+ :value="group.groupId"
|
|
|
|
|
+ />
|
|
|
|
|
+ </el-select>
|
|
|
|
|
+ </el-form-item>
|
|
|
|
|
+ <!-- 看课标签选择 -->
|
|
|
|
|
+ <el-form-item label="看课标签" required>
|
|
|
|
|
+ <el-select
|
|
|
|
|
+ v-model="tagDialog.watchTagId"
|
|
|
|
|
+ placeholder="请选择看课标签"
|
|
|
|
|
+ :disabled="!tagDialog.groupId"
|
|
|
|
|
+ @change="handleWatchingChange"
|
|
|
|
|
+ filterable
|
|
|
|
|
+ >
|
|
|
|
|
+ <el-option
|
|
|
|
|
+ v-for="tag in tagsInGroup"
|
|
|
|
|
+ :key="tag.tagId"
|
|
|
|
|
+ :label="tag.name"
|
|
|
|
|
+ :value="tag.tagId"
|
|
|
|
|
+ />
|
|
|
|
|
+ </el-select>
|
|
|
|
|
+ </el-form-item>
|
|
|
|
|
+ <!-- 完课标签选择 -->
|
|
|
|
|
+ <el-form-item label="完课标签" required>
|
|
|
|
|
+ <el-select
|
|
|
|
|
+ v-model="tagDialog.finishTagId"
|
|
|
|
|
+ placeholder="请选择完课标签"
|
|
|
|
|
+ :disabled="!tagDialog.groupId"
|
|
|
|
|
+ @change="handleWatchedChange"
|
|
|
|
|
+ filterable>
|
|
|
|
|
+ <el-option
|
|
|
|
|
+ v-for="tag in tagsInGroup"
|
|
|
|
|
+ :key="tag.tagId"
|
|
|
|
|
+ :label="tag.name"
|
|
|
|
|
+ :value="tag.tagId"
|
|
|
|
|
+ />
|
|
|
|
|
+ </el-select>
|
|
|
|
|
+ </el-form-item>
|
|
|
|
|
+ </el-form>
|
|
|
|
|
+ <span slot="footer" class="dialog-footer">
|
|
|
|
|
+ <el-button @click="cancelDialog">取消</el-button>
|
|
|
|
|
+ <el-button type="primary" @click="submitTagBinding">确定</el-button>
|
|
|
|
|
+ </span>
|
|
|
|
|
+ </el-dialog>
|
|
|
</div>
|
|
</div>
|
|
|
</template>
|
|
</template>
|
|
|
|
|
|
|
|
<script>
|
|
<script>
|
|
|
-import { updatePacketMoney,getSort,getVideoListByCourseId,delUserCourseVideo,getUserCourseVideo,addUserCourseVideo,updateUserCourseVideo } from "@/api/course/userCourseVideo";
|
|
|
|
|
|
|
+import {getVideoListByCourseId, updatePacketMoney, updateUserCourseVideoUpdate} from "@/api/course/userCourseVideo";
|
|
|
import userCourseVideoDetails from '../../components/course/userCourseVideoDetails.vue';
|
|
import userCourseVideoDetails from '../../components/course/userCourseVideoDetails.vue';
|
|
|
-import { createLinkUrl } from "@/api/course/sopCourseLink";
|
|
|
|
|
-import { userList } from "@/api/qw/user";
|
|
|
|
|
|
|
+import {createLinkUrl} from "@/api/course/sopCourseLink";
|
|
|
|
|
+import {listTagGroup} from "@/api/qw/tagGroup";
|
|
|
|
|
|
|
|
-import request from '@/utils/request'
|
|
|
|
|
-
|
|
|
|
|
- export default {
|
|
|
|
|
|
|
+export default {
|
|
|
name: "userCourseCatalog",
|
|
name: "userCourseCatalog",
|
|
|
components: {
|
|
components: {
|
|
|
userCourseVideoDetails
|
|
userCourseVideoDetails
|
|
|
},
|
|
},
|
|
|
|
|
+ props: {
|
|
|
|
|
+ video: {
|
|
|
|
|
+ type: Object,
|
|
|
|
|
+ required: true,
|
|
|
|
|
+ },
|
|
|
|
|
+ },
|
|
|
data() {
|
|
data() {
|
|
|
return {
|
|
return {
|
|
|
|
|
+ currentRow: null,
|
|
|
|
|
+ // 假设这里有当前课程小节的数据传入,里面含id等
|
|
|
|
|
+ tagDialogVisible: false,
|
|
|
|
|
+ tagGroups: [],
|
|
|
|
|
+ tagsInGroup: [],
|
|
|
|
|
+ tagDialog: {
|
|
|
|
|
+ videoId: null,
|
|
|
|
|
+ groupId: null,
|
|
|
|
|
+ watchTagId: null,
|
|
|
|
|
+ finishTagId: null,
|
|
|
|
|
+ tgId: null,
|
|
|
|
|
+ watchingTgId: null,
|
|
|
|
|
+ watchedTgId: null
|
|
|
|
|
+ },
|
|
|
linkForm:{
|
|
linkForm:{
|
|
|
days:null,
|
|
days:null,
|
|
|
courseId:null,
|
|
courseId:null,
|
|
@@ -218,6 +293,90 @@ import request from '@/utils/request'
|
|
|
});
|
|
});
|
|
|
},
|
|
},
|
|
|
methods: {
|
|
methods: {
|
|
|
|
|
+ handleWatchingChange(tagId){
|
|
|
|
|
+ this.tagDialog.watchingTgId = this.tagsInGroup.find(e => e.tagId === tagId)?.id;
|
|
|
|
|
+ },
|
|
|
|
|
+ handleWatchedChange(tagId){
|
|
|
|
|
+ this.tagDialog.watchedTgId = this.tagsInGroup.find(e => e.tagId === tagId)?.id;
|
|
|
|
|
+ },
|
|
|
|
|
+ openTagDialog(row) {
|
|
|
|
|
+ this.currentRow = row;
|
|
|
|
|
+ this.tagDialogVisible = true;
|
|
|
|
|
+ this.tagDialog.videoId = row.videoId;
|
|
|
|
|
+ this.tagDialog.groupId = this.currentRow.tagGroupId;
|
|
|
|
|
+ this.tagDialog.watchTagId = this.currentRow.watchingTagId;
|
|
|
|
|
+ this.tagDialog.finishTagId = this.currentRow.watchedTagId;
|
|
|
|
|
+
|
|
|
|
|
+
|
|
|
|
|
+ // 查询所有的标签组
|
|
|
|
|
+ listTagGroup({
|
|
|
|
|
+ pageNum: 1,
|
|
|
|
|
+ pageSize: 1000
|
|
|
|
|
+ }).then((res) => {
|
|
|
|
|
+ if(res.code === 200) {
|
|
|
|
|
+ this.tagGroups = res.rows;
|
|
|
|
|
+
|
|
|
|
|
+ let tagGroup = this.tagGroups.find(e=>e.groupId === this.currentRow.tagGroupId);
|
|
|
|
|
+ this.tagsInGroup = tagGroup.tag || [];
|
|
|
|
|
+ }
|
|
|
|
|
+ });
|
|
|
|
|
+ },
|
|
|
|
|
+ updateTagsInGroup(groupId) {
|
|
|
|
|
+ let tagGroup = this.tagGroups.find(e=> e.groupId === groupId);
|
|
|
|
|
+
|
|
|
|
|
+ this.tagsInGroup = tagGroup.tag || [];
|
|
|
|
|
+ // 切换组时清空标签选择
|
|
|
|
|
+ this.tagDialog.watchTagId = null;
|
|
|
|
|
+ this.tagDialog.finishTagId = null;
|
|
|
|
|
+ this.tagDialog.tgId = tagGroup.id;
|
|
|
|
|
+ },
|
|
|
|
|
+ onGroupChange(groupId) {
|
|
|
|
|
+ this.updateTagsInGroup(groupId);
|
|
|
|
|
+ },
|
|
|
|
|
+ cancelDialog() {
|
|
|
|
|
+ this.tagDialogVisible = false;
|
|
|
|
|
+ this.resetDialog();
|
|
|
|
|
+ },
|
|
|
|
|
+ resetDialog() {
|
|
|
|
|
+ this.tagDialog = {
|
|
|
|
|
+ videoId: null,
|
|
|
|
|
+ groupId: null,
|
|
|
|
|
+ watchTagId: null,
|
|
|
|
|
+ finishTagId: null,
|
|
|
|
|
+ };
|
|
|
|
|
+ this.tagGroups = [];
|
|
|
|
|
+ this.tagsInGroup = [];
|
|
|
|
|
+ },
|
|
|
|
|
+ submitTagBinding() {
|
|
|
|
|
+ // 使用表单校验
|
|
|
|
|
+ if(!this.tagDialog.groupId){
|
|
|
|
|
+ this.$message.warning("标签组必选!");
|
|
|
|
|
+ return;
|
|
|
|
|
+ }
|
|
|
|
|
+ if(!this.tagDialog.watchTagId){
|
|
|
|
|
+ this.$message.warning("看课标签必选!");
|
|
|
|
|
+ return;
|
|
|
|
|
+ }
|
|
|
|
|
+ if(!this.tagDialog.finishTagId){
|
|
|
|
|
+ this.$message.warning("完课标签必选!");
|
|
|
|
|
+ return;
|
|
|
|
|
+ }
|
|
|
|
|
+ this.currentRow.tagGroupId = this.tagDialog.groupId;
|
|
|
|
|
+ this.currentRow.watchingTagId = this.tagDialog.watchTagId;
|
|
|
|
|
+ this.currentRow.watchedTagId = this.tagDialog.finishTagId;
|
|
|
|
|
+
|
|
|
|
|
+ this.currentRow.watchingTgId = this.tagDialog.watchingTgId;
|
|
|
|
|
+ this.currentRow.watchedTgId = this.tagDialog.watchedTgId;
|
|
|
|
|
+ this.currentRow.tgId = this.tagDialog.tgId;
|
|
|
|
|
+
|
|
|
|
|
+ updateUserCourseVideoUpdate(this.currentRow).then(res=>{
|
|
|
|
|
+ this.$message.success("绑定成功");
|
|
|
|
|
+ this.resetDialog();
|
|
|
|
|
+ this.currentRow = null;
|
|
|
|
|
+ this.tagDialogVisible = false;
|
|
|
|
|
+ this.getList();
|
|
|
|
|
+ })
|
|
|
|
|
+ },
|
|
|
// 打开弹框
|
|
// 打开弹框
|
|
|
openDialog(row) {
|
|
openDialog(row) {
|
|
|
this.linkForm.courseId = row.courseId;
|
|
this.linkForm.courseId = row.courseId;
|