Skip to content
项目
群组
代码片段
帮助
当前项目
正在载入...
登录 / 注册
切换导航面板
S
saas-lab
项目
项目
详情
活动
周期分析
仓库
仓库
文件
提交
分支
标签
贡献者
图表
比较
统计图
议题
0
议题
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
日程
统计图
Wiki
Wiki
代码片段
代码片段
成员
成员
折叠边栏
关闭边栏
活动
图像
聊天
创建新问题
作业
提交
问题看板
Open sidebar
EzijingWeb
saas-lab
Commits
f87ab374
提交
f87ab374
authored
11月 21, 2024
作者:
lhh
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
修改问题
上级
37f1ea21
显示空白字符变更
内嵌
并排
正在显示
2 个修改的文件
包含
39 行增加
和
4 行删除
+39
-4
ViewLiveDialog.vue
...modules/admin/contest/check/components/ViewLiveDialog.vue
+34
-3
Index.vue
src/modules/admin/contest/check/views/Index.vue
+5
-1
没有找到文件。
src/modules/admin/contest/check/components/ViewLiveDialog.vue
浏览文件 @
f87ab374
...
...
@@ -14,8 +14,8 @@ const listOptions = $computed(() => {
remote
:
{
httpRequest
:
getLiveList
,
params
:
{
experiment_id
:
props
.
data
.
eid
,
student_id
:
props
.
data
.
sid
experiment_id
:
props
.
data
?
.
eid
,
student_id
:
props
.
data
?
.
sid
},
callback
(
res
:
any
)
{
return
{
list
:
res
.
items
}
...
...
@@ -26,7 +26,13 @@ const listOptions = $computed(() => {
{
label
:
'选手姓名'
,
prop
:
'student_name'
},
{
label
:
'商品名称'
,
prop
:
'live_commodity.title'
},
{
label
:
'直播时长'
,
prop
:
'live_duration'
},
{
label
:
'文件大小(M)'
,
prop
:
'live_video_size'
},
{
label
:
'文件大小(M)'
,
prop
:
'live_video_size'
,
computed
({
row
}:
{
row
:
any
})
{
return
convertBytes
(
row
.
live_video_size
,
'MB'
)
}
},
{
label
:
'上传时间'
,
prop
:
'live_end_time'
},
{
label
:
'操作'
,
slots
:
'table-x'
,
width
:
130
}
]
...
...
@@ -37,6 +43,31 @@ const handleViewLive = function (row: any) {
`https://saas-dml-pro.ezijing.com/one/live/test/view?experiment_id=
${
props
.
data
.
eid
}
&id=
${
row
.
live_practice_id
}
&record_id=
${
row
.
id
}
&student_id=
${
props
.
data
.
sid
}
`
)
}
/**
* 将字节转换为指定单位
* @param {number} bytes - 字节数
* @param {string} unit - 转换目标单位 ('KB', 'MB', 'GB', 'TB')
* @param {number} [decimalPlaces=2] - 保留的小数位数
* @returns {number} - 转换后的值
*/
function
convertBytes
(
bytes
:
any
,
unit
:
any
,
decimalPlaces
=
2
)
{
const
units
:
any
=
{
KB
:
1024
,
MB
:
1024
*
1024
,
GB
:
1024
*
1024
*
1024
,
TB
:
1024
*
1024
*
1024
*
1024
}
if
(
!
units
[
unit
])
{
throw
new
Error
(
"无效的单位,请选择 'KB', 'MB', 'GB', 或 'TB'"
)
}
const
result
=
bytes
/
units
[
unit
]
return
parseFloat
(
result
.
toFixed
(
decimalPlaces
))
}
console
.
log
(
convertBytes
(
1048576
,
'MB'
),
'convertBytes(1048576,'
)
</
script
>
<
template
>
...
...
src/modules/admin/contest/check/views/Index.vue
浏览文件 @
f87ab374
...
...
@@ -120,7 +120,7 @@ const listOptions = $computed(() => {
// return getModuleStatus(row, 5)
// }
// },
{
label
:
'操作'
,
slots
:
'table-x'
,
width
:
1
3
0
}
{
label
:
'操作'
,
slots
:
'table-x'
,
width
:
1
4
0
}
]
}
})
...
...
@@ -234,9 +234,12 @@ const handleViewLive = function (row: any) {
>
评分
</el-button
>
<br
/>
<template
v-if=
"row.competition_report_count !== '0'"
>
<el-button
text
type=
"primary"
@
click=
"handleViewReport(row)"
v-if=
"row.competition_report_count !== '0'"
>
查看报告
</el-button
><br
/>
</
template
>
<
template
v-if=
"row.competition_competitor_pictures && row.competition_competitor_pictures?.pictures"
>
<el-button
text
type=
"primary"
...
...
@@ -245,6 +248,7 @@ const handleViewLive = function (row: any) {
>
查看截图
</el-button
>
<br
/>
</
template
>
<el-button
text
type=
"primary"
...
...
编写
预览
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论