|
|
@@ -58,6 +58,10 @@
|
|
|
type="text" @click="openTagDialog(scope.row)">
|
|
|
绑定看课标签
|
|
|
</el-button>
|
|
|
+ <el-button size="mini"
|
|
|
+ type="text" v-if="projectFrom === 'hzyy'" @click="openDialog(scope.row)">
|
|
|
+ 复制看课链接
|
|
|
+ </el-button>
|
|
|
</template>
|
|
|
</el-table-column>
|
|
|
</el-table>
|
|
|
@@ -92,20 +96,24 @@
|
|
|
title="生成链接"
|
|
|
:visible.sync="dialogVisible"
|
|
|
width="400px"
|
|
|
- @close="resetForm"
|
|
|
+ @close="resetRoomForm"
|
|
|
append-to-body>
|
|
|
- <div>
|
|
|
- <p style="color: gray;">不传默认以系统参数为准</p>
|
|
|
- <el-form :model="linkForm" label-width="120px">
|
|
|
- <el-form-item label="链接有效时长(天)">
|
|
|
- <el-input
|
|
|
- v-model="linkForm.days"
|
|
|
- placeholder="请输入有效时长"
|
|
|
- type="number"
|
|
|
- ></el-input>
|
|
|
- </el-form-item>
|
|
|
- </el-form>
|
|
|
- </div>
|
|
|
+ <el-form :model="roomLinkForm" label-width="120px">
|
|
|
+ <!-- 新增下拉框 -->
|
|
|
+ <el-form-item label="销售企微选择">
|
|
|
+ <el-select
|
|
|
+ v-model="roomLinkForm.qwUserId"
|
|
|
+ placeholder="请选择销售企微"
|
|
|
+ style="width: 100%">
|
|
|
+ <el-option
|
|
|
+ v-for="item in qwUserList"
|
|
|
+ :key="item.id"
|
|
|
+ :label="formatOptionLabel(item)"
|
|
|
+ :value="item.id">
|
|
|
+ </el-option>
|
|
|
+ </el-select>
|
|
|
+ </el-form-item>
|
|
|
+ </el-form>
|
|
|
<div slot="footer" class="dialog-footer">
|
|
|
<el-button @click="dialogVisible = false">取消</el-button>
|
|
|
<el-button type="primary" @click="confirm">确认</el-button>
|
|
|
@@ -125,7 +133,7 @@
|
|
|
<script>
|
|
|
import {getVideoListByCourseId, updatePacketMoney, updateUserCourseVideoUpdate} from "@/api/course/userCourseVideo";
|
|
|
import userCourseVideoDetails from '../../components/course/userCourseVideoDetails.vue';
|
|
|
-import {createLinkUrl} from "@/api/course/sopCourseLink";
|
|
|
+import {createLinkUrl, createRoomLinkUrl, queryQwIds} from "@/api/course/sopCourseLink";
|
|
|
import AutoTagDialog from "@/views/components/tag/AutoTagDialog.vue";
|
|
|
import {addTag, updateTag} from "@/api/tag/api";
|
|
|
|
|
|
@@ -151,6 +159,7 @@ export default {
|
|
|
tagDialogTitle: "",
|
|
|
tagDialogFormData: null,
|
|
|
currentVideoId:null,
|
|
|
+ projectFrom:process.env.VUE_APP_PROJECT_FROM,
|
|
|
tagDialog: {
|
|
|
videoId: null,
|
|
|
groupId: null,
|
|
|
@@ -165,6 +174,14 @@ export default {
|
|
|
courseId:null,
|
|
|
videoId:null
|
|
|
},
|
|
|
+ roomLinkForm:{
|
|
|
+ courseId:null,
|
|
|
+ videoId:null,
|
|
|
+ qwUserId:null,
|
|
|
+ qwUserName:null,
|
|
|
+ corpId:null,
|
|
|
+ title:null,
|
|
|
+ },
|
|
|
dialogVisible: false, // 控制弹框显示
|
|
|
//短链
|
|
|
sortLink:'',
|
|
|
@@ -204,6 +221,9 @@ export default {
|
|
|
fileId: '',
|
|
|
courseName:null,
|
|
|
userCourseVideoList:[],
|
|
|
+
|
|
|
+ fetchingQwIds: false,
|
|
|
+ qwUserList:[],
|
|
|
total: 0,
|
|
|
queryParams: {
|
|
|
pageNum: 1,
|
|
|
@@ -242,7 +262,9 @@ export default {
|
|
|
});
|
|
|
},
|
|
|
methods: {
|
|
|
-
|
|
|
+ formatOptionLabel(item) {
|
|
|
+ return item.corpName ? `${item.qwUserName} (${item.corpName})` : item.qwUserName;
|
|
|
+ },
|
|
|
closeTagDialog(){
|
|
|
this.tagDialogVisible = false;
|
|
|
},
|
|
|
@@ -274,17 +296,52 @@ export default {
|
|
|
},
|
|
|
// 打开弹框
|
|
|
openDialog(row) {
|
|
|
- this.linkForm.courseId = row.courseId;
|
|
|
- this.linkForm.videoId = row.videoId;
|
|
|
+ if (!this.fetchingQwIds) {
|
|
|
+ this.fetchingQwIds = true;
|
|
|
+ queryQwIds().then(response => {
|
|
|
+ if (response.code === 200){
|
|
|
+ this.qwUserList = response.list;
|
|
|
+ }
|
|
|
+ }).finally(() => {
|
|
|
+ this.fetchingQwIds = false;
|
|
|
+ // 在请求完成后再显示弹框
|
|
|
+ this.showDialog(row);
|
|
|
+ });
|
|
|
+ } else {
|
|
|
+ // 如果已经在请求中,直接显示弹框
|
|
|
+ this.showDialog(row);
|
|
|
+ }
|
|
|
+ },
|
|
|
+ // 新增方法:显示弹框
|
|
|
+ showDialog(row) {
|
|
|
+ this.roomLinkForm.courseId = row.courseId;
|
|
|
+ this.roomLinkForm.videoId = row.videoId;
|
|
|
+ this.roomLinkForm.title = row.title;
|
|
|
+
|
|
|
this.dialogVisible = true;
|
|
|
},
|
|
|
// 确认按钮操作
|
|
|
confirm() {
|
|
|
- if (!this.linkForm.days) {
|
|
|
- this.$message.error("请输入有效时长!");
|
|
|
+ if (!this.roomLinkForm.qwUserId) {
|
|
|
+ this.$message.error("请选择销售企微!");
|
|
|
return;
|
|
|
}
|
|
|
- this.handleCreateLink();
|
|
|
+ // 获取选中的用户信息
|
|
|
+ const selectedUser = this.qwUserList.find(user => user.id === this.roomLinkForm.qwUserId);
|
|
|
+ if (selectedUser) {
|
|
|
+ // 将用户信息填充到表单中
|
|
|
+ this.roomLinkForm.qwUserName = selectedUser.qwUserName;
|
|
|
+ this.roomLinkForm.corpId = selectedUser.corpId;
|
|
|
+ console.log(this.roomLinkForm);
|
|
|
+ // 调用创建链接的API
|
|
|
+ createRoomLinkUrl(this.roomLinkForm).then(response => {
|
|
|
+ if (response.code === 200){
|
|
|
+ this.msgSuccess("创建成功");
|
|
|
+ this.copyLink(response.link);
|
|
|
+ console.log(response.link);
|
|
|
+ }
|
|
|
+ });
|
|
|
+ }
|
|
|
|
|
|
// 关闭弹框
|
|
|
this.dialogVisible = false;
|
|
|
@@ -297,6 +354,14 @@ export default {
|
|
|
videoId:null
|
|
|
}
|
|
|
},
|
|
|
+
|
|
|
+ resetRoomForm() {
|
|
|
+ this.roomLinkForm={
|
|
|
+ courseId:null,
|
|
|
+ videoId:null,
|
|
|
+ qwUserId:null,
|
|
|
+ }
|
|
|
+ },
|
|
|
handleCreateLink(){
|
|
|
createLinkUrl(this.linkForm).then(response => {
|
|
|
if (response.code === 200){
|