Skip to content
项目
群组
代码片段
帮助
当前项目
正在载入...
登录 / 注册
切换导航面板
S
saas-dml
项目
项目
详情
活动
周期分析
仓库
仓库
文件
提交
分支
标签
贡献者
图表
比较
统计图
议题
0
议题
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
日程
统计图
Wiki
Wiki
代码片段
代码片段
成员
成员
折叠边栏
关闭边栏
活动
图像
聊天
创建新问题
作业
提交
问题看板
Open sidebar
EzijingWeb
saas-dml
Commits
4af39641
提交
4af39641
authored
11月 23, 2024
作者:
haodaking
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
feat:直播记录增加上传
上级
f50064cc
隐藏空白字符变更
内嵌
并排
正在显示
2 个修改的文件
包含
37 行增加
和
3 行删除
+37
-3
Live.vue
src/modules/live/test/components/Live.vue
+4
-1
RecordDialog.vue
src/modules/live/test/components/RecordDialog.vue
+33
-2
没有找到文件。
src/modules/live/test/components/Live.vue
浏览文件 @
4af39641
...
@@ -75,6 +75,7 @@ const {
...
@@ -75,6 +75,7 @@ const {
send
(
jsonData
)
send
(
jsonData
)
},
},
onStop
:
(
blob
)
=>
{
onStop
:
(
blob
)
=>
{
if
(
enabled
.
value
)
return
props
.
onStop
&&
props
.
onStop
(
blob
)
props
.
onStop
&&
props
.
onStop
(
blob
)
handleUpdateRecord
({
live_video_size
:
blob
.
size
.
toString
()
})
handleUpdateRecord
({
live_video_size
:
blob
.
size
.
toString
()
})
// 保存录像到本地
// 保存录像到本地
...
@@ -107,7 +108,9 @@ const handleUpdateRecord = async (params) => {
...
@@ -107,7 +108,9 @@ const handleUpdateRecord = async (params) => {
live_video_addres
:
fileUrl
.
value
,
live_video_addres
:
fileUrl
.
value
,
live_info
:
JSON
.
stringify
({
messages
:
messages
.
value
,
stats
}),
live_info
:
JSON
.
stringify
({
messages
:
messages
.
value
,
stats
}),
}
}
const
res
=
await
saveTestRecord
({
...
defaultParams
,
...
params
})
const
requestParams
=
{
...
defaultParams
,
...
params
}
if
(
!
requestParams
.
live_practice_id
)
return
const
res
=
await
saveTestRecord
(
requestParams
)
recordId
.
value
=
res
?.
data
.
id
recordId
.
value
=
res
?.
data
.
id
}
}
...
...
src/modules/live/test/components/RecordDialog.vue
浏览文件 @
4af39641
<
script
setup
>
<
script
setup
>
import
{
getRecordList
}
from
'../api'
import
{
ElMessage
}
from
'element-plus'
import
{
useFileDialog
}
from
'@vueuse/core'
import
{
upload
}
from
'@/utils/upload'
import
{
getRecordList
,
saveTestRecord
,
getRecord
}
from
'../api'
const
props
=
defineProps
([
'data'
])
const
props
=
defineProps
([
'data'
])
function
formatDuration
(
seconds
)
{
function
formatDuration
(
seconds
)
{
...
@@ -38,16 +41,44 @@ const listOptions = {
...
@@ -38,16 +41,44 @@ const listOptions = {
{
label
:
'操作'
,
slots
:
'table-x'
,
width
:
100
},
{
label
:
'操作'
,
slots
:
'table-x'
,
width
:
100
},
],
],
}
}
// 上传视频
const
uploading
=
ref
(
false
)
const
handleUpload
=
(
row
)
=>
{
const
dialog
=
useFileDialog
()
dialog
.
open
({
accept
:
'video/*'
})
dialog
.
onChange
(
async
([
file
])
=>
{
uploading
.
value
=
true
try
{
const
res
=
await
upload
(
file
)
const
recordRes
=
await
getRecord
({
id
:
row
.
id
})
const
record
=
recordRes
.
data
.
detail
await
saveTestRecord
({
...
record
,
live_practice_id
:
row
.
id
,
live_video_addres
:
res
,
live_video_size
:
file
.
size
.
toString
(),
})
ElMessage
.
success
(
'上传成功'
)
}
catch
(
error
)
{
console
.
error
(
error
)
ElMessage
.
error
(
'上传失败'
)
}
finally
{
uploading
.
value
=
false
}
})
}
</
script
>
</
script
>
<
template
>
<
template
>
<el-dialog
title=
"查看历史直播场次"
>
<el-dialog
title=
"查看历史直播场次"
width=
"800px"
>
<AppList
v-bind=
"listOptions"
ref=
"appList"
>
<AppList
v-bind=
"listOptions"
ref=
"appList"
>
<template
#
table-x=
"
{ row }">
<template
#
table-x=
"
{ row }">
<el-button
text
type=
"primary"
>
<el-button
text
type=
"primary"
>
<router-link
:to=
"
{ path: 'test/view', query: { ...$route.query, id: data.id, record_id: row.id } }"
<router-link
:to=
"
{ path: 'test/view', query: { ...$route.query, id: data.id, record_id: row.id } }"
>查看
</router-link
>查看
</router-link
>
>
<el-button
type=
"primary"
text
:disabled=
"uploading"
@
click=
"handleUpload(row)"
>
上传
</el-button>
</el-button>
</el-button>
</
template
>
</
template
>
</AppList>
</AppList>
...
...
编写
预览
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论