|
|
@@ -349,6 +349,18 @@
|
|
|
<el-dropdown-item @click.native="handleAudit(scope.row)">
|
|
|
<i class="el-icon-service"></i> 审核
|
|
|
</el-dropdown-item>
|
|
|
+ <el-dropdown-item
|
|
|
+ v-if="scope.row.status != 2"
|
|
|
+ @click.native="handleRoomPassword(scope.row)">
|
|
|
+ <i class="el-icon-service"></i> 房间密码
|
|
|
+ </el-dropdown-item>
|
|
|
+<!-- <el-dropdown-item -->
|
|
|
+<!-- @click.native="handleExportComments(scope.row)"-->
|
|
|
+<!-- :disabled="exportingComments[scope.row.liveId]"-->
|
|
|
+<!-- v-hasPermi="['live:liveMsg:export']"-->
|
|
|
+<!-- >-->
|
|
|
+<!-- <i class="el-icon-download"></i> 导出评论-->
|
|
|
+<!-- </el-dropdown-item>-->
|
|
|
</el-dropdown-menu>
|
|
|
</el-dropdown>
|
|
|
<!-- <el-button-->
|
|
|
@@ -581,9 +593,10 @@
|
|
|
plain
|
|
|
size="mini"
|
|
|
@click="addUserTag(scope.row,scope.$index)"
|
|
|
- v-hasPermi="['qw:externalContact:addTag']"
|
|
|
+
|
|
|
>选择标签</el-button>
|
|
|
</template>
|
|
|
+<!-- v-hasPermi="['qw:externalContact:addTag']"-->
|
|
|
</el-table-column>
|
|
|
<el-table-column label="操作" width="100">
|
|
|
<template slot-scope="scope">
|
|
|
@@ -663,6 +676,38 @@
|
|
|
<el-button @click="addTagCancel">取 消</el-button>
|
|
|
</div>
|
|
|
</el-dialog>
|
|
|
+
|
|
|
+ <!-- 设置房间密码对话框 -->
|
|
|
+ <el-dialog
|
|
|
+ title="设置房间密码"
|
|
|
+ :visible.sync="roomPasswordDialog.open"
|
|
|
+ width="500px"
|
|
|
+ append-to-body
|
|
|
+ class="simple-dialog"
|
|
|
+ >
|
|
|
+ <el-form ref="roomPasswordForm" :model="roomPasswordForm" :rules="roomPasswordRules" label-width="100px">
|
|
|
+ <el-form-item label="直播ID">
|
|
|
+ <el-input v-model="roomPasswordForm.liveId" disabled />
|
|
|
+ </el-form-item>
|
|
|
+ <el-form-item label="直播名称">
|
|
|
+ <el-input v-model="roomPasswordForm.liveName" disabled />
|
|
|
+ </el-form-item>
|
|
|
+ <el-form-item label="房间密码" prop="roomPassword">
|
|
|
+ <el-input
|
|
|
+ v-model="roomPasswordForm.roomPassword"
|
|
|
+ placeholder="请输入房间密码(留空表示无密码)"
|
|
|
+ clearable
|
|
|
+ maxlength="20"
|
|
|
+ show-word-limit
|
|
|
+ />
|
|
|
+ <div class="form-tip">提示:设置密码后,用户进入直播间需要输入密码</div>
|
|
|
+ </el-form-item>
|
|
|
+ </el-form>
|
|
|
+ <div slot="footer" class="dialog-footer">
|
|
|
+ <el-button type="primary" @click="submitRoomPassword">确 定</el-button>
|
|
|
+ <el-button @click="roomPasswordDialog.open = false">取 消</el-button>
|
|
|
+ </div>
|
|
|
+ </el-dialog>
|
|
|
</div>
|
|
|
</template>
|
|
|
|
|
|
@@ -686,6 +731,7 @@ import {
|
|
|
getTagsListByCorpId,
|
|
|
clearLiveCache,
|
|
|
} from "@/api/live/live";
|
|
|
+import { exportLiveMsgComments } from "@/api/live/liveMsg";
|
|
|
import Editor from "@/components/Editor/wang";
|
|
|
import user from "@/store/modules/user";
|
|
|
import VideoUpload from "@/components/LiveVideoUpload/single.vue";
|
|
|
@@ -811,6 +857,24 @@ export default {
|
|
|
name:null,
|
|
|
corpId:null,
|
|
|
},
|
|
|
+ // 导出评论状态:key为liveId,value为是否正在导出
|
|
|
+ exportingComments: {},
|
|
|
+ // 房间密码弹窗
|
|
|
+ roomPasswordDialog: {
|
|
|
+ open: false
|
|
|
+ },
|
|
|
+ // 房间密码表单
|
|
|
+ roomPasswordForm: {
|
|
|
+ liveId: null,
|
|
|
+ liveName: null,
|
|
|
+ roomPassword: null
|
|
|
+ },
|
|
|
+ // 房间密码表单校验
|
|
|
+ roomPasswordRules: {
|
|
|
+ roomPassword: [
|
|
|
+ { max: 20, message: '密码长度不能超过20个字符', trigger: 'blur' }
|
|
|
+ ]
|
|
|
+ }
|
|
|
};
|
|
|
},
|
|
|
created() {
|
|
|
@@ -1241,6 +1305,39 @@ export default {
|
|
|
handleImgError(e) {
|
|
|
e.target.src = this.defaultImg;
|
|
|
},
|
|
|
+ // 设置房间密码
|
|
|
+ handleRoomPassword(row){
|
|
|
+ this.roomPasswordForm.liveId = row.liveId
|
|
|
+ this.roomPasswordForm.liveName = row.liveName
|
|
|
+ this.roomPasswordForm.roomPassword = row.roomPassword || ''
|
|
|
+ this.roomPasswordForm.startTime = row.startTime || ''
|
|
|
+ this.roomPasswordDialog.open = true
|
|
|
+ },
|
|
|
+ // 提交房间密码
|
|
|
+ submitRoomPassword() {
|
|
|
+ this.$refs['roomPasswordForm'].validate(valid => {
|
|
|
+ if (valid) {
|
|
|
+ const params = {
|
|
|
+ liveId: this.roomPasswordForm.liveId,
|
|
|
+ roomPassword: this.roomPasswordForm.roomPassword || '',
|
|
|
+ startTime: this.roomPasswordForm.startTime || '',
|
|
|
+ }
|
|
|
+
|
|
|
+ updateLive(params).then(response => {
|
|
|
+ if (response.code === 200) {
|
|
|
+ this.$message.success('房间密码设置成功')
|
|
|
+ this.roomPasswordDialog.open = false
|
|
|
+ this.getList()
|
|
|
+ } else {
|
|
|
+ this.$message.error(response.msg || '设置失败')
|
|
|
+ }
|
|
|
+ }).catch(error => {
|
|
|
+ console.error('设置房间密码失败:', error)
|
|
|
+ this.$message.error('设置失败,请稍后重试')
|
|
|
+ })
|
|
|
+ }
|
|
|
+ })
|
|
|
+ },
|
|
|
handleAudit(row) {
|
|
|
this.$alert("是否审核通过?", "审核", {
|
|
|
confirmButtonText: "同意",
|
|
|
@@ -1434,6 +1531,52 @@ export default {
|
|
|
this.lastCheckTagRow = null;
|
|
|
this.currentCheck = null;
|
|
|
this.currentCheckTagIndex = null;
|
|
|
+ },
|
|
|
+ /** 导出评论按钮操作 */
|
|
|
+ handleExportComments(row) {
|
|
|
+ const liveId = row.liveId;
|
|
|
+ // 检查是否正在导出
|
|
|
+ if (this.exportingComments[liveId]) {
|
|
|
+ this.$message.warning("正在导出中,请勿重复操作");
|
|
|
+ return;
|
|
|
+ }
|
|
|
+
|
|
|
+ // 检查是否有其他直播间正在导出
|
|
|
+ const hasExporting = Object.values(this.exportingComments).some(status => status === true);
|
|
|
+ if (hasExporting) {
|
|
|
+ this.$message.warning("当前已有导出任务进行中,请等待完成后再试");
|
|
|
+ return;
|
|
|
+ }
|
|
|
+
|
|
|
+ this.$confirm('是否确认导出该直播间的评论数据?', "提示", {
|
|
|
+ confirmButtonText: "确定",
|
|
|
+ cancelButtonText: "取消",
|
|
|
+ type: "info"
|
|
|
+ }).then(() => {
|
|
|
+ // 设置导出状态
|
|
|
+ this.$set(this.exportingComments, liveId, true);
|
|
|
+
|
|
|
+ exportLiveMsgComments(liveId).then(response => {
|
|
|
+ // 创建blob对象
|
|
|
+ const blob = new Blob([response], { type: 'application/vnd.ms-excel' });
|
|
|
+ // 创建下载链接
|
|
|
+ const url = window.URL.createObjectURL(blob);
|
|
|
+ const link = document.createElement('a');
|
|
|
+ link.href = url;
|
|
|
+ link.setAttribute('download', `直播评论_${row.liveName || liveId}_${new Date().getTime()}.xlsx`);
|
|
|
+ document.body.appendChild(link);
|
|
|
+ link.click();
|
|
|
+ document.body.removeChild(link);
|
|
|
+ window.URL.revokeObjectURL(url);
|
|
|
+
|
|
|
+ this.$message.success("导出成功");
|
|
|
+ }).catch(error => {
|
|
|
+ this.$message.error(error.msg || "导出失败");
|
|
|
+ }).finally(() => {
|
|
|
+ // 清除导出状态
|
|
|
+ this.$set(this.exportingComments, liveId, false);
|
|
|
+ });
|
|
|
+ }).catch(() => {});
|
|
|
}
|
|
|
|
|
|
},
|