Skip to content
项目
群组
代码片段
帮助
当前项目
正在载入...
登录 / 注册
切换导航面板
C
center-live
项目
项目
详情
活动
周期分析
仓库
仓库
文件
提交
分支
标签
贡献者
图表
比较
统计图
议题
0
议题
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
日程
统计图
Wiki
Wiki
代码片段
代码片段
成员
成员
折叠边栏
关闭边栏
活动
图像
聊天
创建新问题
作业
提交
问题看板
Open sidebar
EzijingWeb
center-live
Commits
35439386
提交
35439386
authored
12月 21, 2022
作者:
王鹏飞
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
chore: 优化视频下载
上级
ae3099bd
全部展开
隐藏空白字符变更
内嵌
并排
正在显示
3 个修改的文件
包含
102 行增加
和
0 行删除
+102
-0
common.js
src/api/common.js
+7
-0
DownloadVideo.vue
src/components/TableHandles/DownloadVideo.vue
+95
-0
index.vue
src/components/TableHandles/index.vue
+0
-0
没有找到文件。
src/api/common.js
浏览文件 @
35439386
...
@@ -93,3 +93,10 @@ export function getSignature() {
...
@@ -93,3 +93,10 @@ export function getSignature() {
export
function
getMeetingCount
(
params
)
{
export
function
getMeetingCount
(
params
)
{
return
httpRequest
.
get
(
'/api/live/admin/v3/tencent/meeting/count'
,
{
params
})
return
httpRequest
.
get
(
'/api/live/admin/v3/tencent/meeting/count'
,
{
params
})
}
}
/**
* 获取会议回放详情列表
*/
export
function
getMeetingRecords
(
params
)
{
return
httpRequest
.
get
(
`/api/live/admin/v3/tencent/meeting/
${
params
.
meeting_id
}
/records`
,
{
params
})
}
src/components/TableHandles/DownloadVideo.vue
0 → 100644
浏览文件 @
35439386
<
template
>
<el-dialog
title=
"下载"
v-bind=
"$attrs"
v-on=
"$listeners"
>
<el-alert
type=
"info"
show-icon
:closable=
"false"
>
<template
#
title
>
已选择
<span
style=
"color:#409eff;padding:0 5px;"
>
{{
multipleSelection
.
length
}}
</span
>
项
<el-button
type=
"text"
:disabled=
"!multipleSelection.length"
@
click=
"handleBatchDownload"
style=
"margin-left: 10px;"
>
批量下载
</el-button
>
</
template
>
</el-alert>
<el-table
:data=
"list"
@
selection-change=
"handleSelectionChange"
>
<el-table-column
type=
"selection"
width=
"55"
/>
<el-table-column
label=
"开始时间"
prop=
"record_start_time"
></el-table-column>
<el-table-column
label=
"结束时间"
prop=
"record_end_time"
></el-table-column>
<el-table-column
label=
"大小"
prop=
"record_size"
></el-table-column>
<el-table-column
label=
"操作"
width=
"100"
>
<
template
#
default=
"{row}"
>
<el-button
type=
"text"
@
click=
"handleDownload(row)"
>
下载
</el-button>
</
template
>
</el-table-column>
</el-table>
</el-dialog>
</template>
<
script
>
import
{
getMeetingRecords
,
getMeetingRecordAddr
}
from
'@/api/common'
export
default
{
props
:
{
data
:
Object
},
data
()
{
return
{
list
:
[],
multipleSelection
:
[]
}
},
methods
:
{
handleSelectionChange
(
val
)
{
this
.
multipleSelection
=
val
},
fetchList
()
{
getMeetingRecords
({
meeting_id
:
this
.
data
.
meeting_id
,
sub_meeting_id
:
this
.
data
.
sub_meeting_id
}).
then
(
res
=>
{
if
(
res
.
code
===
0
)
{
this
.
list
=
res
.
data
.
items
||
[]
}
else
{
this
.
$message
.
error
(
res
.
message
)
}
})
},
// 下载
handleDownload
(
row
)
{
const
params
=
{
meeting_id
:
this
.
data
.
meeting_id
,
record_file_ids
:
[].
concat
(
row
.
record_file_id
)
}
this
.
fetchDownloadInfo
(
params
)
},
// 批量下载
handleBatchDownload
()
{
const
params
=
{
meeting_id
:
this
.
data
.
meeting_id
,
record_file_ids
:
this
.
multipleSelection
.
map
(
item
=>
item
.
record_file_id
)
}
this
.
fetchDownloadInfo
(
params
)
},
fetchDownloadInfo
(
params
)
{
getMeetingRecordAddr
(
params
).
then
(
res
=>
{
const
files
=
res
.
data
.
files
||
[]
files
.
forEach
((
file
,
index
)
=>
{
setTimeout
(()
=>
{
this
.
funDownload
(
file
.
download_address
,
file
.
download_address
)
},
index
*
1000
)
})
})
},
funDownload
(
fileUrl
,
fileName
)
{
const
elink
=
document
.
createElement
(
'a'
)
// 创建一个a标签
elink
.
download
=
fileName
// 设置a标签的下载属性
elink
.
style
.
display
=
'none'
// 将a标签设置为隐藏
elink
.
href
=
fileUrl
// 把之前处理好的地址赋给a标签的href
document
.
body
.
appendChild
(
elink
)
// 将a标签添加到body中
elink
.
click
()
// 执行a标签的点击方法
// URL.revokeObjectURL(elink.href) // 下载完成释放URL 对象
document
.
body
.
removeChild
(
elink
)
// 移除a标签
}
},
mounted
()
{
this
.
fetchList
()
}
}
</
script
>
src/components/TableHandles/index.vue
浏览文件 @
35439386
差异被折叠。
点击展开。
编写
预览
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论