Skip to content
项目
群组
代码片段
帮助
当前项目
正在载入...
登录 / 注册
切换导航面板
X
x-training-admin
项目
项目
详情
活动
周期分析
仓库
仓库
文件
提交
分支
标签
贡献者
图表
比较
统计图
议题
0
议题
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
日程
统计图
Wiki
Wiki
代码片段
代码片段
成员
成员
折叠边栏
关闭边栏
活动
图像
聊天
创建新问题
作业
提交
问题看板
Open sidebar
EzijingWeb
x-training-admin
Commits
71bd322b
提交
71bd322b
authored
3月 14, 2021
作者:
wangyizheng
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
排行榜
上级
698f8ce9
显示空白字符变更
内嵌
并排
正在显示
6 个修改的文件
包含
483 行增加
和
1 行删除
+483
-1
statistics-v3.js
src/api/statistics-v3.js
+33
-0
aside.vue
src/components/layout/aside.vue
+17
-0
case_rank_records.vue
src/pages/v3/statistics/case_rank_records.vue
+211
-0
case_ranks.vue
src/pages/v3/statistics/case_ranks.vue
+192
-0
routes.js
src/router/routes.js
+4
-1
common.js
src/utils/common.js
+26
-0
没有找到文件。
src/api/statistics-v3.js
0 → 100644
浏览文件 @
71bd322b
import
httpRequest
from
'@/utils/axios'
// 获取案例成绩记录
export
function
caseRankRecords
(
params
=
{})
{
var
headers
=
{
'Content-Type'
:
'application/json'
}
return
httpRequest
.
get
(
'/api/opera/v3/admin/training/case-rank-records'
,
{
params
},
{
headers
})
}
// 获取案例训练排行榜
export
function
caseRanks
(
params
=
{})
{
var
headers
=
{
'Content-Type'
:
'application/json'
}
return
httpRequest
.
get
(
'/api/opera/v3/admin/training/rank/case-training'
,
{
params
},
{
headers
})
}
// 同步案例排行榜中用户的数据
export
function
syncCaseRankRecords
(
data
=
{})
{
var
headers
=
{
'Content-Type'
:
'application/json'
}
return
httpRequest
.
put
(
'/api/opera/v3/admin/training/rank/sync/case-rank-records'
,
data
,
{
headers
})
}
// 刷新排行榜
export
function
refreshCaseRank
(
data
=
{})
{
var
headers
=
{
'Content-Type'
:
'application/json'
}
return
httpRequest
.
post
(
'/api/opera/v3/admin/training/refresh-case-rank'
,
data
,
{
headers
})
}
src/components/layout/aside.vue
浏览文件 @
71bd322b
...
...
@@ -49,6 +49,23 @@ export default {
title
:
'用户使用配置管理'
,
icon
:
''
,
path
:
'/training/useruseconfigs'
},
{
title
:
'统计管理'
,
icon
:
''
,
path
:
'/training/statistics'
,
children
:
[
{
title
:
'成绩记录'
,
icon
:
''
,
path
:
'/training/case-rank-records'
},
{
title
:
'成绩排行榜'
,
icon
:
''
,
path
:
'/training/case-ranks'
}
]
}
// {
// title: '案例背景编辑[一期]',
...
...
src/pages/v3/statistics/case_rank_records.vue
0 → 100644
浏览文件 @
71bd322b
<
template
>
<div>
<div>
<el-card
class=
"box-card"
>
<el-breadcrumb
separator-class=
"el-icon-arrow-right"
>
<el-breadcrumb-item
:to=
"
{ path: '/' }">首页
</el-breadcrumb-item>
<el-breadcrumb-item>
成绩记录
</el-breadcrumb-item>
</el-breadcrumb>
</el-card>
</div>
<div>
<el-card
class=
"box-card"
>
<div>
<el-input
placeholder=
"请输入sso_Id"
prefix-icon=
"el-icon-search"
v-model=
"sso_id"
size=
"mini"
style=
"width: 20%"
></el-input>
<el-input
placeholder=
"请输入用户真实姓名"
prefix-icon=
"el-icon-search"
v-model=
"username"
size=
"mini"
style=
"width: 20%"
></el-input>
<el-input
placeholder=
"请输入学校"
prefix-icon=
"el-icon-search"
v-model=
"school"
size=
"mini"
style=
"width: 20%"
></el-input>
<el-input
placeholder=
"请输入案例id"
prefix-icon=
"el-icon-search"
v-model=
"case_id"
size=
"mini"
style=
"width: 20%"
></el-input>
<el-date-picker
size=
"mini"
v-model=
"date"
type=
"datetimerange"
range-separator=
"至"
start-placeholder=
"开始日期"
end-placeholder=
"结束日期"
value-format=
"yyyy-MM-dd HH:mm:ss"
>
</el-date-picker>
<el-button
size=
"mini"
icon=
"el-icon-search"
@
click=
"list(
{ page: currentPage, limit: limit })" style="margin-left: 2%">搜 索
</el-button>
<el-button
type=
"primary"
size=
"mini"
icon=
"el-icon-refresh"
@
click=
"refresh"
>
刷 新
</el-button>
<el-button
type=
"primary"
size=
"mini"
icon=
"el-icon-refresh"
@
click=
"dialogFormVisible = true"
>
同步学员记录
</el-button>
</div>
</el-card>
</div>
<div>
<el-card
class=
"box-card"
>
<el-table
:data=
"tableData"
border
stripe
size=
"mini"
class=
"table-list"
style=
"width: 100%"
>
<el-table-column
fixed
prop=
"id"
width=
"150px"
label=
"ID"
>
</el-table-column>
<el-table-column
prop=
"sso_id"
width=
"150px"
label=
"sso_id"
>
</el-table-column>
<el-table-column
prop=
"username"
width=
"150px"
label=
"用户真实姓名"
>
</el-table-column>
<el-table-column
prop=
"school"
width=
"150px"
label=
"学校"
>
</el-table-column>
<el-table-column
prop=
"case_id"
width=
"150px"
label=
"案例id"
>
</el-table-column>
<el-table-column
label=
"创建时间"
>
<template
slot-scope=
"scope"
>
<i
class=
"el-icon-time"
></i>
<span
style=
"margin-left: 10px"
>
{{
scope
.
row
.
created_at
}}
</span>
</
template
>
</el-table-column>
<el-table-column
label=
"更新时间"
>
<
template
slot-scope=
"scope"
>
<i
class=
"el-icon-time"
></i>
<span
style=
"margin-left: 10px"
>
{{
scope
.
row
.
updated_at
}}
</span>
</
template
>
</el-table-column>
</el-table>
<div
class=
"block"
>
<el-pagination
@
size-change=
"handleSizeChange"
@
current-change=
"handleCurrentChange"
:current-page=
"currentPage"
:page-sizes=
"[10, 20, 30, 50, 100]"
:page-size=
"limit"
layout=
"total, sizes, prev, pager, next, jumper"
:total=
"totalPage"
>
</el-pagination>
</div>
</el-card>
</div>
<div>
<el-dialog
title=
"同步同步学员记录"
:visible
.
sync=
"dialogFormVisible"
>
<el-form
size=
"mini"
:model=
"refreshFromData"
>
<el-form-item
label=
"sso_id"
:label-width=
"formLabelWidth"
>
<el-input
v-model=
"refreshFromData.sso_id"
autocomplete=
"off"
></el-input>
</el-form-item>
<el-form-item
label=
"用户真实姓名"
:label-width=
"formLabelWidth"
>
<el-input
v-model=
"refreshFromData.realname"
autocomplete=
"off"
></el-input>
</el-form-item>
<el-form-item
label=
"学校"
:label-width=
"formLabelWidth"
>
<el-input
v-model=
"refreshFromData.school"
autocomplete=
"off"
></el-input>
</el-form-item>
</el-form>
<div
slot=
"footer"
class=
"dialog-footer"
>
<el-button
size=
"mini"
@
click=
"dialogFormVisible = false"
>
取 消
</el-button>
<el-button
size=
"mini"
type=
"primary"
@
click=
"refreshMemberRecord"
>
确 定
</el-button>
</div>
</el-dialog>
</div>
</div>
</template>
<
script
>
import
*
as
statisticsApi
from
'@/api/statistics-v3'
export
default
{
name
:
'case_rank_records'
,
data
()
{
return
{
currentPage
:
1
,
totalPage
:
0
,
limit
:
10
,
sso_id
:
''
,
username
:
''
,
school
:
''
,
case_id
:
''
,
date
:
[],
tableData
:
[],
dialogFormVisible
:
false
,
formLabelWidth
:
'100px'
,
refreshFromData
:
{
sso_id
:
''
,
school
:
''
,
realname
:
''
}
}
},
mounted
()
{
this
.
list
()
},
methods
:
{
handleSizeChange
(
val
)
{
this
.
list
({
page
:
this
.
currentPage
,
limit
:
val
})
},
handleCurrentChange
(
val
)
{
this
.
list
({
page
:
val
,
limit
:
this
.
limit
})
},
list
(
params
=
{
page
:
this
.
currentPage
,
limit
:
this
.
limit
})
{
var
quryData
=
{}
if
(
this
.
date
.
length
>
0
)
{
quryData
.
start_time
=
this
.
date
[
0
]
quryData
.
end_time
=
this
.
date
[
1
]
}
if
(
this
.
sso_id
)
{
quryData
.
sso_id
=
this
.
sso_id
}
if
(
this
.
case_id
)
{
quryData
.
case_id
=
this
.
case_id
}
if
(
this
.
username
)
{
quryData
.
username
=
this
.
username
}
if
(
this
.
school
)
{
quryData
.
school
=
this
.
school
}
quryData
.
page
=
params
.
page
quryData
.
limit
=
params
.
limit
statisticsApi
.
caseRankRecords
(
quryData
).
then
(
res
=>
{
const
rLoading
=
this
.
openLoading
(
'.table-list'
)
if
(
res
.
code
!==
0
)
{
this
.
$message
.
error
(
res
.
message
)
rLoading
.
close
()
return
false
}
this
.
tableData
=
res
.
data
.
data
this
.
currentPage
=
res
.
data
.
current_page
this
.
totalPage
=
res
.
data
.
total
rLoading
.
close
()
return
true
})
},
refresh
()
{
this
.
sso_id
=
''
this
.
case_id
=
''
this
.
username
=
''
this
.
school
=
''
this
.
date
=
[]
this
.
list
({
page
:
1
,
limit
:
this
.
limit
})
},
refreshMemberRecord
()
{
statisticsApi
.
syncCaseRankRecords
(
this
.
refreshFromData
).
then
(
res
=>
{
if
(
res
.
code
!==
0
)
{
this
.
$message
.
error
(
res
.
message
)
return
false
}
this
.
dialogFormVisible
=
false
this
.
$message
.
success
(
res
.
message
)
this
.
list
({
page
:
this
.
currentPage
,
limit
:
this
.
limit
})
return
true
})
}
}
}
</
script
>
<
style
>
</
style
>
src/pages/v3/statistics/case_ranks.vue
0 → 100644
浏览文件 @
71bd322b
<
template
>
<div>
<div>
<el-card
class=
"box-card"
>
<el-breadcrumb
separator-class=
"el-icon-arrow-right"
>
<el-breadcrumb-item
:to=
"
{ path: '/' }">首页
</el-breadcrumb-item>
<el-breadcrumb-item>
排行榜
</el-breadcrumb-item>
</el-breadcrumb>
</el-card>
</div>
<div>
<el-card
class=
"box-card"
>
<el-select
size=
"mini"
v-model=
"type"
@
change=
"checkType"
placeholder=
"请选择分类"
>
<el-option
v-for=
"typeItem in typeList"
:key=
"typeItem.key"
:label=
"typeItem.label"
:value=
"typeItem.key"
>
</el-option>
</el-select>
<el-input
v-if=
"schoolHidden === false"
placeholder=
"请输入学校"
prefix-icon=
"el-icon-search"
v-model=
"school"
size=
"mini"
style=
"width: 20%"
></el-input>
<el-input
v-if=
"ssoIdHidden === false"
placeholder=
"请输入sso_id"
prefix-icon=
"el-icon-search"
v-model=
"sso_id"
size=
"mini"
style=
"width: 20%"
></el-input>
<el-button
size=
"mini"
icon=
"el-icon-search"
@
click=
"list(
{ start, stop })" style="margin-left: 2%">搜 索
</el-button>
<el-button
type=
"primary"
size=
"mini"
icon=
"el-icon-refresh"
@
click=
"refresh"
>
刷 新
</el-button>
<el-button
type=
"primary"
size=
"mini"
icon=
"el-icon-refresh"
@
click=
"refreshCaseRank()"
>
同步全局排行榜数据
</el-button>
</el-card>
</div>
<div>
<el-card
class=
"box-card"
>
<el-table
:data=
"tableData"
border
stripe
size=
"mini"
class=
"table-list"
style=
"width: 100%"
>
<el-table-column
fixed
prop=
"rank"
width=
"150px"
label=
"排名"
>
</el-table-column>
<el-table-column
prop=
"sso_id"
width=
"150px"
label=
"sso_id"
>
</el-table-column>
<el-table-column
prop=
"username"
width=
"150px"
label=
"用户真实姓名"
>
</el-table-column>
<el-table-column
label=
"学校"
v-if=
"type === 10 || type === 11 || type === 20 || type === 21"
>
<template
slot-scope=
"scope"
>
<span
style=
"margin-left: 10px"
>
{{
scope
.
row
.
school
}}
</span>
</
template
>
</el-table-column>
<el-table-column
label=
"分数"
v-if=
"type === 10 || type === 20 || type === 30"
>
<
template
slot-scope=
"scope"
>
<span
style=
"margin-left: 10px"
>
{{
scope
.
row
.
score
}}
</span>
</
template
>
</el-table-column>
<el-table-column
label=
"次数"
v-if=
"type === 11 || type === 21 || type === 31"
>
<
template
slot-scope=
"scope"
>
<span
style=
"margin-left: 10px"
>
{{
scope
.
row
.
times
}}
</span>
</
template
>
</el-table-column>
<el-table-column
label=
"日期"
v-if=
"type === 10 || type === 11 || type === 20 || type === 21 || type === 30"
>
<
template
slot-scope=
"scope"
>
<i
class=
"el-icon-time"
></i>
<span
style=
"margin-left: 10px"
>
{{
scope
.
row
.
created_at
}}
</span>
</
template
>
</el-table-column>
<el-table-column
label=
"日期"
v-if=
"type === 31"
>
<
template
slot-scope=
"scope"
>
<i
class=
"el-icon-time"
></i>
<span
style=
"margin-left: 10px"
>
{{
formateDataIndex
(
scope
.
row
.
date_index
)
}}
</span>
</
template
>
</el-table-column>
</el-table>
</el-card>
</div>
</div>
</template>
<
script
>
import
*
as
statisticsApi
from
'@/api/statistics-v3'
import
*
as
common
from
'@/utils/common'
export
default
{
name
:
'case_ranks'
,
data
()
{
return
{
type
:
10
,
school
:
''
,
sso_id
:
''
,
typeList
:
[
{
key
:
10
,
label
:
'全局-分数排行榜'
},
{
key
:
11
,
label
:
'全局-次数排行榜'
},
{
key
:
20
,
label
:
'校内-分数排行榜'
},
{
key
:
21
,
label
:
'校内-次数排行榜'
},
{
key
:
30
,
label
:
'个人-分数排行榜'
},
{
key
:
31
,
label
:
'个人-次数排行榜'
}
],
schoolHidden
:
true
,
ssoIdHidden
:
true
,
start
:
0
,
stop
:
9
,
tableData
:
[]
}
},
mounted
()
{
this
.
list
({
start
:
this
.
start
,
stop
:
this
.
stop
})
},
methods
:
{
checkType
(
val
)
{
this
.
tableData
=
[]
if
(
val
===
10
||
val
===
11
)
{
this
.
ssoIdHidden
=
true
this
.
schoolHidden
=
true
this
.
sso_id
=
''
this
.
school
=
''
}
if
(
val
===
20
||
val
===
21
)
{
this
.
schoolHidden
=
false
this
.
ssoIdHidden
=
true
this
.
sso_id
=
''
}
if
(
val
===
30
||
val
===
31
)
{
this
.
ssoIdHidden
=
false
this
.
schoolHidden
=
true
this
.
school
=
''
}
},
list
(
params
=
{
start
:
this
.
start
,
stop
:
this
.
stop
})
{
var
queryData
=
{}
queryData
.
type
=
this
.
type
queryData
.
start
=
params
.
start
queryData
.
stop
=
params
.
stop
if
(
this
.
type
===
20
||
this
.
type
===
21
)
{
queryData
.
school
=
this
.
school
}
if
(
this
.
type
===
30
||
this
.
type
===
31
)
{
queryData
.
sso_id
=
this
.
sso_id
}
statisticsApi
.
caseRanks
(
queryData
).
then
(
res
=>
{
const
rLoading
=
this
.
openLoading
(
'.table-list'
)
if
(
res
.
code
!==
0
)
{
this
.
$message
.
error
(
res
.
message
)
rLoading
.
close
()
return
false
}
if
(
!
(
res
.
data
instanceof
Array
))
{
this
.
tableData
=
[]
rLoading
.
close
()
return
true
}
this
.
tableData
=
res
.
data
rLoading
.
close
()
return
true
})
},
formateDataIndex
(
dateIndex
)
{
return
common
.
timestampToTime
(
dateIndex
)
},
refresh
()
{
this
.
type
=
10
this
.
tableData
=
[]
this
.
sso_id
=
''
this
.
school
=
''
this
.
ssoIdHidden
=
true
this
.
schoolHidden
=
true
this
.
list
({
start
:
this
.
start
,
stop
:
this
.
stop
})
},
refreshCaseRank
()
{
statisticsApi
.
refreshCaseRank
().
then
(
res
=>
{
if
(
res
.
code
!==
0
)
{
this
.
$message
.
error
(
res
.
message
)
return
false
}
this
.
$message
.
success
(
'同步全局排行榜数据成功'
)
this
.
refresh
()
return
true
})
}
}
}
</
script
>
<
style
>
</
style
>
src/router/routes.js
浏览文件 @
71bd322b
...
...
@@ -24,7 +24,10 @@ const userGroup = [
{
path
:
'/training/reachschemes'
,
name
:
'reach_schemes'
,
component
:
()
=>
import
(
'@/pages/v2/reachschemes/index'
)
},
{
path
:
'/training/reachschemes/update'
,
name
:
'reach_schemes_update'
,
component
:
()
=>
import
(
'@/pages/v2/reachschemes/update'
)
},
{
path
:
'/training/useruseconfigs'
,
name
:
'useruseconfigs'
,
component
:
()
=>
import
(
'@/pages/v2/useruseconfigs/index'
)
},
{
path
:
'/training/useruseconfigs/update'
,
name
:
'useruseconfigs_update'
,
component
:
()
=>
import
(
'@/pages/v2/useruseconfigs/update'
)
}
{
path
:
'/training/useruseconfigs/update'
,
name
:
'useruseconfigs_update'
,
component
:
()
=>
import
(
'@/pages/v2/useruseconfigs/update'
)
},
/* v3.1 */
{
path
:
'/training/case-rank-records'
,
name
:
'case_rank_records'
,
component
:
()
=>
import
(
'@/pages/v3/statistics/case_rank_records'
)
},
{
path
:
'/training/case-ranks'
,
name
:
'case_rank'
,
component
:
()
=>
import
(
'@/pages/v3/statistics/case_ranks'
)
}
]
export
default
[
...
...
src/utils/common.js
0 → 100644
浏览文件 @
71bd322b
export
function
timestampToTime
(
timestamp
)
{
var
date
=
new
Date
(
timestamp
*
1000
)
var
Y
=
date
.
getFullYear
()
+
'-'
var
M
=
(
date
.
getMonth
()
+
1
<
10
?
'00'
+
(
date
.
getMonth
()
+
1
)
:
date
.
getMonth
()
+
1
)
+
'-'
var
D
=
date
.
getDate
()
+
' '
var
h
=
''
if
(
date
.
getHours
()
<
10
)
{
h
=
'0'
+
date
.
getHours
()
+
':'
}
else
{
h
=
date
.
getHours
()
+
':'
}
var
m
=
''
if
(
date
.
getMinutes
()
<
10
)
{
m
=
'0'
+
date
.
getMinutes
()
+
':'
}
else
{
m
=
date
.
getMinutes
()
+
':'
}
var
s
=
''
if
(
date
.
getSeconds
()
<
10
)
{
s
=
'0'
+
date
.
getSeconds
()
}
else
{
s
=
date
.
getSeconds
()
}
return
Y
+
M
+
D
+
h
+
m
+
s
}
编写
预览
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论