Skip to content
项目
群组
代码片段
帮助
当前项目
正在载入...
登录 / 注册
切换导航面板
S
saas-lab
项目
项目
详情
活动
周期分析
仓库
仓库
文件
提交
分支
标签
贡献者
图表
比较
统计图
议题
0
议题
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
日程
统计图
Wiki
Wiki
代码片段
代码片段
成员
成员
折叠边栏
关闭边栏
活动
图像
聊天
创建新问题
作业
提交
问题看板
Open sidebar
EzijingWeb
saas-lab
Commits
9cfd786c
提交
9cfd786c
authored
9月 13, 2023
作者:
王鹏飞
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
chore: 大赛监控页面性能优化
上级
f450256c
隐藏空白字符变更
内嵌
并排
正在显示
1 个修改的文件
包含
98 行增加
和
114 行删除
+98
-114
Index.vue
src/modules/admin/contest/dashboard/views/Index.vue
+98
-114
没有找到文件。
src/modules/admin/contest/dashboard/views/Index.vue
浏览文件 @
9cfd786c
...
@@ -66,6 +66,15 @@ async function fetchStatistics(competition_id: string, platform_key = 'career_da
...
@@ -66,6 +66,15 @@ async function fetchStatistics(competition_id: string, platform_key = 'career_da
}
}
const
competitorsList
=
ref
([])
const
competitorsList
=
ref
([])
const
competitorsTableData
=
computed
(()
=>
{
return
competitorsList
.
value
.
map
((
row
:
any
)
=>
{
const
commit_time
=
dayjs
.
unix
(
row
.
commit_time
).
format
(
'YYYY-MM-DD HH:mm:ss'
)
const
timestamp
=
(
row
.
commit_time
*
1000
||
Date
.
now
())
-
row
.
start_answer_time
*
1000
const
dur
=
dayjs
.
duration
(
timestamp
)
const
answer_time
=
dur
.
hours
()
===
0
?
dur
.
format
(
"m[']s"
)
:
dur
.
format
(
"H[h]m[']s"
)
return
{
...
row
,
commit_time
,
answer_time
}
})
})
async
function
fetchCompetitors
(
competition_id
:
string
,
platform_key
=
'career_data_analysis'
)
{
async
function
fetchCompetitors
(
competition_id
:
string
,
platform_key
=
'career_data_analysis'
)
{
const
res
=
await
getCompetitionCompetitors
({
competition_id
,
platform_key
})
const
res
=
await
getCompetitionCompetitors
({
competition_id
,
platform_key
})
competitorsList
.
value
=
res
.
data
.
items
competitorsList
.
value
=
res
.
data
.
items
...
@@ -75,123 +84,98 @@ watchEffect(() => {
...
@@ -75,123 +84,98 @@ watchEffect(() => {
fetchInfo
()
fetchInfo
()
})
})
// 已提交选手
// 已提交选手
const
submittedListOptions
=
computed
(()
=>
{
const
submittedListOptions
=
{
return
{
columns
:
[
columns
:
[
{
label
:
'序号'
,
type
:
'index'
,
width
:
60
},
{
label
:
'序号'
,
type
:
'index'
,
width
:
60
},
{
label
:
'选手姓名'
,
prop
:
'student.name'
},
{
label
:
'选手姓名'
,
prop
:
'student.name'
},
{
label
:
'参赛ID'
,
prop
:
'login_id'
},
{
label
:
'参赛ID'
,
prop
:
'login_id'
},
{
label
:
'所在学校'
,
prop
:
'student.organ_name'
},
{
label
:
'所在学校'
,
prop
:
'student.organ_name'
},
{
label
:
'所在专业'
,
prop
:
'student.specialty_name'
},
{
label
:
'所在专业'
,
prop
:
'student.specialty_name'
},
{
label
:
'所在班级'
,
prop
:
'student.class_name'
},
{
label
:
'所在班级'
,
prop
:
'student.class_name'
},
{
label
:
'提交时间'
,
prop
:
'commit_time'
},
{
{
label
:
'作答用时'
,
prop
:
'answer_time'
}
label
:
'提交时间'
,
]
prop
:
'commit_time'
,
}
computed
({
row
}:
{
row
:
any
})
{
const
submittedLis
=
computed
(()
=>
{
return
dayjs
.
unix
(
row
.
commit_time
).
format
(
'YYYY-MM-DD HH:mm:ss'
)
return
competitorsTableData
.
value
.
filter
((
item
:
any
)
=>
item
.
commit_status
==
3
)
}
},
{
label
:
'作答用时'
,
prop
:
'commit_time'
,
computed
({
row
}:
{
row
:
any
})
{
const
timestamp
=
(
row
.
commit_time
*
1000
||
useNow
().
value
.
getTime
())
-
row
.
start_answer_time
*
1000
const
duration
=
dayjs
.
duration
(
timestamp
)
return
duration
.
hours
()
===
0
?
duration
.
format
(
"m[']s"
)
:
duration
.
format
(
"H[h]m[']s"
)
}
}
],
data
:
competitorsList
.
value
.
filter
((
item
:
any
)
=>
item
.
commit_status
==
3
)
}
})
})
// 正在作答选手
// 正在作答选手
const
answeringListOptions
=
computed
(()
=>
{
const
answeringListOptions
=
{
return
{
columns
:
[
columns
:
[
{
label
:
'序号'
,
type
:
'index'
,
width
:
60
},
{
label
:
'序号'
,
type
:
'index'
,
width
:
60
},
{
label
:
'选手姓名'
,
prop
:
'student.name'
},
{
label
:
'选手姓名'
,
prop
:
'student.name'
},
{
label
:
'参赛ID'
,
prop
:
'login_id'
},
{
label
:
'参赛ID'
,
prop
:
'login_id'
},
{
label
:
'所在学校'
,
prop
:
'student.organ_name'
},
{
label
:
'所在学校'
,
prop
:
'student.organ_name'
},
{
label
:
'所在专业'
,
prop
:
'student.specialty_name'
},
{
label
:
'所在专业'
,
prop
:
'student.specialty_name'
},
{
label
:
'所在班级'
,
prop
:
'student.class_name'
},
{
label
:
'所在班级'
,
prop
:
'student.class_name'
},
{
{
label
:
'提交时间'
,
label
:
'提交时间'
,
prop
:
'commit_time'
prop
:
'commit_time'
,
},
computed
({
row
}:
{
row
:
any
})
{
{
return
dayjs
.
unix
(
row
.
commit_time
).
format
(
'YYYY-MM-DD HH:mm:ss'
)
label
:
'作答用时'
,
}
prop
:
'answer_time'
},
}
{
]
label
:
'作答用时'
,
}
prop
:
'commit_time'
,
const
answeringList
=
computed
(()
=>
{
computed
({
row
}:
{
row
:
any
})
{
return
competitorsTableData
.
value
.
filter
((
item
:
any
)
=>
item
.
commit_status
==
2
||
item
.
commit_status
==
4
)
const
timestamp
=
(
row
.
commit_time
*
1000
||
useNow
().
value
.
getTime
())
-
row
.
start_answer_time
*
1000
const
duration
=
dayjs
.
duration
(
timestamp
)
return
duration
.
hours
()
===
0
?
duration
.
format
(
"m[']s"
)
:
duration
.
format
(
"H[h]m[']s"
)
}
}
],
data
:
competitorsList
.
value
.
filter
((
item
:
any
)
=>
item
.
commit_status
==
2
||
item
.
commit_status
==
4
)
}
})
})
// 选手答题情况
// 选手答题情况
const
listOptions
=
computed
(()
=>
{
const
listOptions
=
{
return
{
columns
:
[
columns
:
[
{
label
:
'序号'
,
type
:
'index'
,
width
:
60
},
{
label
:
'序号'
,
type
:
'index'
,
width
:
60
},
{
label
:
'选手姓名'
,
prop
:
'student.name'
},
{
label
:
'选手姓名'
,
prop
:
'student.name'
},
{
label
:
'参赛ID'
,
prop
:
'login_id'
},
{
label
:
'参赛ID'
,
prop
:
'login_id'
},
{
label
:
'性别'
,
prop
:
'student.gender'
},
{
label
:
'性别'
,
prop
:
'student.gender'
},
{
label
:
'所在学校'
,
prop
:
'student.organ_name'
},
{
label
:
'所在学校'
,
prop
:
'student.organ_name'
},
{
label
:
'所在专业'
,
prop
:
'student.specialty_name'
},
{
label
:
'所在专业'
,
prop
:
'student.specialty_name'
},
{
label
:
'所在班级'
,
prop
:
'student.class_name'
},
{
label
:
'所在班级'
,
prop
:
'student.class_name'
},
{
{
label
:
'模块一'
,
label
:
'模块一'
,
prop
:
'module_1'
,
prop
:
'module_1'
,
computed
({
row
}:
{
row
:
any
})
{
computed
({
row
}:
{
row
:
any
})
{
return
getModuleStatus
(
row
,
0
)
return
getModuleStatus
(
row
,
0
)
}
},
{
label
:
'模块二'
,
prop
:
'module_2'
,
computed
({
row
}:
{
row
:
any
})
{
return
getModuleStatus
(
row
,
1
)
}
},
{
label
:
'模块三'
,
prop
:
'module_3'
,
computed
({
row
}:
{
row
:
any
})
{
return
getModuleStatus
(
row
,
2
)
}
},
{
label
:
'模块四'
,
prop
:
'module_4'
,
computed
({
row
}:
{
row
:
any
})
{
return
getModuleStatus
(
row
,
3
)
}
},
{
label
:
'模块五'
,
prop
:
'module_5'
,
computed
({
row
}:
{
row
:
any
})
{
return
getModuleStatus
(
row
,
4
)
}
},
{
label
:
'模块六'
,
prop
:
'module_6'
,
computed
({
row
}:
{
row
:
any
})
{
return
getModuleStatus
(
row
,
5
)
}
}
}
],
},
data
:
competitorsList
.
value
{
}
label
:
'模块二'
,
})
prop
:
'module_2'
,
computed
({
row
}:
{
row
:
any
})
{
return
getModuleStatus
(
row
,
1
)
}
},
{
label
:
'模块三'
,
prop
:
'module_3'
,
computed
({
row
}:
{
row
:
any
})
{
return
getModuleStatus
(
row
,
2
)
}
},
{
label
:
'模块四'
,
prop
:
'module_4'
,
computed
({
row
}:
{
row
:
any
})
{
return
getModuleStatus
(
row
,
3
)
}
},
{
label
:
'模块五'
,
prop
:
'module_5'
,
computed
({
row
}:
{
row
:
any
})
{
return
getModuleStatus
(
row
,
4
)
}
},
{
label
:
'模块六'
,
prop
:
'module_6'
,
computed
({
row
}:
{
row
:
any
})
{
return
getModuleStatus
(
row
,
5
)
}
}
]
}
function
getModuleStatus
(
row
:
any
,
index
:
number
)
{
function
getModuleStatus
(
row
:
any
,
index
:
number
)
{
try
{
try
{
const
[
first
]
=
JSON
.
parse
(
row
.
module_status_data
)
||
[]
const
[
first
]
=
JSON
.
parse
(
row
.
module_status_data
)
||
[]
...
@@ -245,15 +229,15 @@ function getModuleStatus(row: any, index: number) {
...
@@ -245,15 +229,15 @@ function getModuleStatus(row: any, index: number) {
<el-row
:gutter=
"20"
>
<el-row
:gutter=
"20"
>
<el-col
:span=
"12"
>
<el-col
:span=
"12"
>
<h2
class=
"h2-title"
>
已提交选手
</h2>
<h2
class=
"h2-title"
>
已提交选手
</h2>
<AppList
border
v-bind=
"submittedListOptions"
ref=
"appList"
></AppList
<AppList
border
v-bind=
"submittedListOptions"
:data=
"submittedLis"
ref=
"appList"
></AppList
></el-col>
></el-col>
<el-col
:span=
"12"
>
<el-col
:span=
"12"
>
<h2
class=
"h2-title"
>
正在作答选手
</h2>
<h2
class=
"h2-title"
>
正在作答选手
</h2>
<AppList
border
v-bind=
"answeringListOptions"
ref=
"appList"
></AppList
<AppList
border
v-bind=
"answeringListOptions"
:data=
"answeringList"
ref=
"appList"
></AppList
></el-col>
></el-col>
</el-row>
</el-row>
<h2
class=
"h2-title"
>
选手答题情况
</h2>
<h2
class=
"h2-title"
>
选手答题情况
</h2>
<AppList
border
v-bind=
"listOptions"
ref=
"appList"
></AppList>
<AppList
border
v-bind=
"listOptions"
:data=
"competitorsTableData"
ref=
"appList"
></AppList>
</AppCard>
</AppCard>
</
template
>
</
template
>
...
...
编写
预览
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论