|
|
@@ -111,6 +111,7 @@
|
|
|
<el-table-column label="视频地址" prop="videoUrl" >
|
|
|
<template slot-scope="scope">
|
|
|
<el-tooltip
|
|
|
+ v-if="scope.row.videoUrl"
|
|
|
:content="scope.row.videoUrl"
|
|
|
placement="top"
|
|
|
effect="dark"
|
|
|
@@ -129,6 +130,7 @@
|
|
|
<i class="el-icon-external-link video-url-icon"></i>
|
|
|
</a>
|
|
|
</el-tooltip>
|
|
|
+ <span v-else>-</span>
|
|
|
</template>
|
|
|
</el-table-column>
|
|
|
<!-- <el-table-column label="操作" prop="videoUrl" >-->
|
|
|
@@ -223,21 +225,28 @@ export default {
|
|
|
},
|
|
|
methods: {
|
|
|
getLiveVideo() {
|
|
|
+ this.videoList = [];
|
|
|
+ if (!this.liveId) {
|
|
|
+ return;
|
|
|
+ }
|
|
|
getLiveVideoByLiveId(this.liveId).then(res => {
|
|
|
- let dataEntity =
|
|
|
- {
|
|
|
- duration: "00:00",
|
|
|
- status: "回放中",
|
|
|
- updateTime: "2025-09-08 14:28:24",
|
|
|
- };
|
|
|
-
|
|
|
- //将秒数转为时分秒
|
|
|
- dataEntity.duration = this.convertSeconds(res.data.duration);
|
|
|
- dataEntity.updateTime = res.data.updateTime;
|
|
|
- dataEntity.videoUrl = res.data.videoUrl;
|
|
|
- dataEntity.videoName = this.extractFileName(dataEntity.videoUrl)
|
|
|
-
|
|
|
- this.videoList.push(dataEntity);
|
|
|
+ const raw = res && res.data;
|
|
|
+ if (!raw) {
|
|
|
+ return;
|
|
|
+ }
|
|
|
+ // 接口可能返回单条对象或数组
|
|
|
+ const list = Array.isArray(raw) ? raw : [raw];
|
|
|
+ this.videoList = list
|
|
|
+ .filter(item => item && item.videoUrl)
|
|
|
+ .map(item => ({
|
|
|
+ duration: this.convertSeconds(item.duration),
|
|
|
+ status: "回放中",
|
|
|
+ updateTime: item.updateTime || "",
|
|
|
+ videoUrl: item.videoUrl,
|
|
|
+ videoName: this.extractFileName(item.videoUrl),
|
|
|
+ }));
|
|
|
+ }).catch(() => {
|
|
|
+ this.videoList = [];
|
|
|
});
|
|
|
},
|
|
|
/**
|
|
|
@@ -286,12 +295,13 @@ export default {
|
|
|
getLive() {
|
|
|
getLive(this.liveId).then(res => {
|
|
|
this.liveInfo = res.data;
|
|
|
- if(res.data.liveConfig){
|
|
|
+ if (res.data.liveConfig) {
|
|
|
this.replayForm = JSON.parse(res.data.liveConfig);
|
|
|
- this.getLiveVideo();
|
|
|
- }else{
|
|
|
+ } else {
|
|
|
this.resetForm();
|
|
|
}
|
|
|
+ // 无论回放开关开/关,都展示回放视频内容
|
|
|
+ this.getLiveVideo();
|
|
|
this.loading = false;
|
|
|
});
|
|
|
},
|