Skip to content
项目
群组
代码片段
帮助
当前项目
正在载入...
登录 / 注册
切换导航面板
S
saas-lab
项目
项目
详情
活动
周期分析
仓库
仓库
文件
提交
分支
标签
贡献者
图表
比较
统计图
议题
0
议题
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
日程
统计图
Wiki
Wiki
代码片段
代码片段
成员
成员
折叠边栏
关闭边栏
活动
图像
聊天
创建新问题
作业
提交
问题看板
Open sidebar
EzijingWeb
saas-lab
Commits
4365eecc
提交
4365eecc
authored
6月 28, 2024
作者:
王鹏飞
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
chore: 新增实验监控
上级
27bd8efa
隐藏空白字符变更
内嵌
并排
正在显示
6 个修改的文件
包含
319 行增加
和
1 行删除
+319
-1
api.ts
src/modules/admin/lab/dashboard/api.ts
+6
-0
History.vue
src/modules/admin/lab/dashboard/components/History.vue
+142
-0
Live.vue
src/modules/admin/lab/dashboard/components/Live.vue
+145
-0
index.ts
src/modules/admin/lab/dashboard/index.ts
+10
-0
Index.vue
src/modules/admin/lab/dashboard/views/Index.vue
+14
-0
menu.ts
src/stores/menu.ts
+2
-1
没有找到文件。
src/modules/admin/lab/dashboard/api.ts
0 → 100644
浏览文件 @
4365eecc
import
httpRequest
from
'@/utils/axios'
// 获取实验列表
export
function
getExperimentList
(
params
:
{
page
:
number
;
'per-page'
:
number
})
{
return
httpRequest
.
get
(
'/api/resource/v1/backend/experiment/monitor-experiments'
,
{
params
})
}
src/modules/admin/lab/dashboard/components/History.vue
0 → 100644
浏览文件 @
4365eecc
<
script
setup
lang=
"ts"
>
import
AppList
from
'@/components/base/AppList.vue'
import
{
getExperimentList
}
from
'../api'
import
{
useAppConfig
}
from
'@/composables/useAppConfig'
const
appConfig
=
useAppConfig
()
const
appList
=
ref
<
InstanceType
<
typeof
AppList
>
|
null
>
(
null
)
const
list
=
ref
([])
async
function
fetchInfo
()
{
const
res
=
await
getExperimentList
()
list
.
value
=
res
.
data
.
items
}
onMounted
(()
=>
{
fetchInfo
()
})
const
dmlURL
=
computed
(()
=>
{
return
appConfig
.
dmlURL
||
import
.
meta
.
env
.
VITE_DML_URL
})
// 实验列表
const
listOptions
=
computed
(()
=>
{
return
{
remote
:
{
httpRequest
:
getExperimentList
,
callback
(
data
)
{
return
{
total
:
data
.
total
,
list
:
data
.
items
}
}
},
columns
:
[
{
label
:
'序号'
,
type
:
'index'
,
width
:
60
},
{
label
:
'所属机构'
,
prop
:
'org.department_name'
},
{
label
:
'实验课程名称'
,
prop
:
'course_name'
},
{
label
:
'实验名称'
,
prop
:
'name'
},
{
label
:
'指导老师'
,
prop
:
'teachers'
,
computed
({
row
})
{
return
row
.
teachers
.
map
(
item
=>
item
.
name
).
join
(
','
)
}
},
{
label
:
'班级名称'
,
prop
:
'student.specialty_name'
,
computed
({
row
})
{
return
row
.
classes
.
map
(
item
=>
item
.
name
).
join
(
','
)
}
},
{
label
:
'班级人数'
,
prop
:
'student.class_name'
,
computed
({
row
})
{
return
row
.
classes
.
map
(
item
=>
item
.
student_total
).
join
(
','
)
}
},
{
label
:
'使用人数'
,
prop
:
'current_use_user_count'
},
{
label
:
'用户数据量'
,
prop
:
'current_member_count'
},
{
label
:
'标签数据量'
,
prop
:
'current_tag_count'
},
{
label
:
'群组数据量'
,
prop
:
'current_group_count'
},
{
label
:
'实验使用时间'
,
prop
:
'time'
},
{
label
:
'操作'
,
slots
:
'table-x'
}
]
}
})
</
script
>
<
template
>
<AppCard>
<ul
class=
"statistics"
>
<template
v-for=
"(item, index) in list"
:key=
"item.id"
>
<el-popover
:width=
"340"
trigger=
"hover"
v-if=
"index
<
5
"
>
<el-form
label-suffix=
":"
class=
"statistics-form"
>
<el-form-item
label=
"实验名称"
>
{{
item
.
name
}}
</el-form-item>
<el-form-item
label=
"班级人数"
>
{{
item
.
classes
.
map
(
item
=>
item
.
student_total
).
join
(
','
)
}}
人
</el-form-item>
<el-form-item
label=
"使用人数"
>
{{
item
.
current_use_user_count
}}
人
</el-form-item>
</el-form>
<template
#
reference
>
<li>
<h6>
<span>
Top
{{
index
+
1
}}
</span>
</h6>
<p>
{{
item
.
name
}}
</p>
</li>
</
template
>
</el-popover>
</template>
</ul>
<h2
class=
"h2-title"
>
实验列表
</h2>
<AppList
border
v-bind=
"listOptions"
ref=
"appList"
>
<
template
#
table-x=
"{ row }"
>
<el-button
type=
"primary"
><a
:href=
"`$
{dmlURL}?experiment_id=${row.id}`" target="_blank">查看
</a></el-button>
</
template
>
</AppList>
</AppCard>
</template>
<
style
lang=
"scss"
scoped
>
.statistics
{
display
:
flex
;
align-items
:
center
;
justify-content
:
space-evenly
;
margin
:
90px
0
;
li
{
width
:
212px
;
height
:
212px
;
background-color
:
rgba
(
247
,
247
,
247
,
1
);
border-radius
:
50%
;
display
:
flex
;
flex-direction
:
column
;
align-items
:
center
;
justify-content
:
center
;
h6
{
color
:
rgba
(
178
,
15
,
60
,
1
);
span
{
font-size
:
18px
;
}
}
p
{
margin-top
:
20px
;
font-size
:
18px
;
color
:
rgba
(
96
,
96
,
96
,
1
);
text-align
:
center
;
}
}
}
.statistics-form
{
:deep
(
.el-form-item
)
{
margin-bottom
:
0
;
}
:deep
(
.el-form-item__content
)
{
font-size
:
18px
;
color
:
var
(
--
main-color
);
}
}
.h2-title
{
padding-left
:
5px
;
font-size
:
18px
;
font-weight
:
500
;
line-height
:
1
;
margin
:
20px
0
;
border-left
:
3px
solid
#aa1941
;
}
</
style
>
src/modules/admin/lab/dashboard/components/Live.vue
0 → 100644
浏览文件 @
4365eecc
<
script
setup
lang=
"ts"
>
import
AppList
from
'@/components/base/AppList.vue'
import
{
getExperimentList
}
from
'../api'
import
{
useAppConfig
}
from
'@/composables/useAppConfig'
const
appConfig
=
useAppConfig
()
const
appList
=
ref
<
InstanceType
<
typeof
AppList
>
|
null
>
(
null
)
const
list
=
ref
([])
async
function
fetchInfo
()
{
const
res
=
await
getExperimentList
()
list
.
value
=
res
.
data
.
items
}
let
timer
:
null
|
number
=
null
onMounted
(()
=>
{
fetchInfo
()
timer
=
setInterval
(()
=>
{
fetchInfo
()
},
5000
)
})
onUnmounted
(()
=>
{
timer
&&
clearInterval
(
timer
)
})
const
dmlURL
=
computed
(()
=>
{
return
appConfig
.
dmlURL
||
import
.
meta
.
env
.
VITE_DML_URL
})
// 实验列表
const
listOptions
=
computed
(()
=>
{
return
{
data
:
list
.
value
,
columns
:
[
{
label
:
'序号'
,
type
:
'index'
,
width
:
60
},
{
label
:
'所属机构'
,
prop
:
'org.department_name'
},
{
label
:
'实验课程名称'
,
prop
:
'course_name'
},
{
label
:
'实验名称'
,
prop
:
'name'
},
{
label
:
'指导老师'
,
prop
:
'teachers'
,
computed
({
row
})
{
return
row
.
teachers
.
map
(
item
=>
item
.
name
).
join
(
','
)
}
},
{
label
:
'班级名称'
,
prop
:
'student.specialty_name'
,
computed
({
row
})
{
return
row
.
classes
.
map
(
item
=>
item
.
name
).
join
(
','
)
}
},
{
label
:
'班级人数'
,
prop
:
'student.class_name'
,
computed
({
row
})
{
return
row
.
classes
.
map
(
item
=>
item
.
student_total
).
join
(
','
)
}
},
{
label
:
'正在使用人数'
,
prop
:
'current_use_user_count'
},
{
label
:
'用户数据量'
,
prop
:
'current_member_count'
},
{
label
:
'标签数据量'
,
prop
:
'current_tag_count'
},
{
label
:
'群组数据量'
,
prop
:
'current_group_count'
},
{
label
:
'实验使用时间'
,
prop
:
'time'
},
{
label
:
'操作'
,
slots
:
'table-x'
}
]
}
})
</
script
>
<
template
>
<AppCard>
<ul
class=
"statistics"
>
<template
v-for=
"(item, index) in list"
:key=
"item.id"
>
<el-popover
:width=
"340"
trigger=
"hover"
v-if=
"index
<
5
"
>
<el-form
label-suffix=
":"
class=
"statistics-form"
>
<el-form-item
label=
"实验名称"
>
{{
item
.
name
}}
</el-form-item>
<el-form-item
label=
"班级人数"
>
{{
item
.
classes
.
map
(
item
=>
item
.
student_total
).
join
(
','
)
}}
人
</el-form-item>
<el-form-item
label=
"正在使用人数"
>
{{
item
.
current_use_user_count
}}
人
</el-form-item>
</el-form>
<template
#
reference
>
<li>
<h6>
<span>
Top
{{
index
+
1
}}
</span>
</h6>
<p>
{{
item
.
name
}}
</p>
</li>
</
template
>
</el-popover>
</template>
</ul>
<h2
class=
"h2-title"
>
实验列表
</h2>
<AppList
border
v-bind=
"listOptions"
ref=
"appList"
>
<
template
#
table-x=
"{ row }"
>
<el-button
type=
"primary"
><a
:href=
"`$
{dmlURL}?experiment_id=${row.id}`" target="_blank">查看
</a></el-button>
</
template
>
</AppList>
</AppCard>
</template>
<
style
lang=
"scss"
scoped
>
.statistics
{
display
:
flex
;
align-items
:
center
;
justify-content
:
space-evenly
;
margin
:
90px
0
;
li
{
width
:
212px
;
height
:
212px
;
background-color
:
rgba
(
247
,
247
,
247
,
1
);
border-radius
:
50%
;
display
:
flex
;
flex-direction
:
column
;
align-items
:
center
;
justify-content
:
center
;
h6
{
color
:
rgba
(
178
,
15
,
60
,
1
);
span
{
font-size
:
18px
;
}
}
p
{
margin-top
:
20px
;
font-size
:
18px
;
color
:
rgba
(
96
,
96
,
96
,
1
);
text-align
:
center
;
}
}
}
.statistics-form
{
:deep
(
.el-form-item
)
{
margin-bottom
:
0
;
}
:deep
(
.el-form-item__content
)
{
font-size
:
18px
;
color
:
var
(
--
main-color
);
}
}
.h2-title
{
padding-left
:
5px
;
font-size
:
18px
;
font-weight
:
500
;
line-height
:
1
;
margin
:
20px
0
;
border-left
:
3px
solid
#aa1941
;
}
</
style
>
src/modules/admin/lab/dashboard/index.ts
0 → 100644
浏览文件 @
4365eecc
import
type
{
RouteRecordRaw
}
from
'vue-router'
import
AppLayout
from
'@/components/layout/Index.vue'
export
const
routes
:
Array
<
RouteRecordRaw
>
=
[
{
path
:
'/admin/lab/dashboard'
,
component
:
AppLayout
,
children
:
[{
path
:
''
,
component
:
()
=>
import
(
'./views/Index.vue'
)
}]
}
]
src/modules/admin/lab/dashboard/views/Index.vue
0 → 100644
浏览文件 @
4365eecc
<
script
setup
lang=
"ts"
>
import
Live
from
'../components/Live.vue'
import
History
from
'../components/History.vue'
const
activeRadio
=
ref
(
'1'
)
</
script
>
<
template
>
<el-radio-group
v-model=
"activeRadio"
style=
"margin-bottom: 10px"
>
<el-radio-button
label=
"1"
>
实时监控
</el-radio-button>
<el-radio-button
label=
"2"
>
历史监控
</el-radio-button>
</el-radio-group>
<Live
v-if=
"activeRadio === '1'"
></Live>
<History
v-else
></History>
</
template
>
src/stores/menu.ts
浏览文件 @
4365eecc
...
@@ -29,7 +29,8 @@ const adminMenus: IMenuItem[] = [
...
@@ -29,7 +29,8 @@ const adminMenus: IMenuItem[] = [
{
name
:
'实验指导书管理'
,
path
:
'/admin/lab/book'
,
tag
:
'v1-teacher-book'
},
{
name
:
'实验指导书管理'
,
path
:
'/admin/lab/book'
,
tag
:
'v1-teacher-book'
},
{
name
:
'实验操作视频管理'
,
path
:
'/admin/lab/video'
,
tag
:
'v1-teacher-video'
},
{
name
:
'实验操作视频管理'
,
path
:
'/admin/lab/video'
,
tag
:
'v1-teacher-video'
},
{
name
:
'实验讨论交流'
,
path
:
'/admin/lab/discuss'
,
tag
:
'v1-teacher-discussion'
},
{
name
:
'实验讨论交流'
,
path
:
'/admin/lab/discuss'
,
tag
:
'v1-teacher-discussion'
},
{
name
:
'实验成绩管理'
,
path
:
'/admin/lab/score'
,
tag
:
'v1-teacher-record'
}
{
name
:
'实验成绩管理'
,
path
:
'/admin/lab/score'
,
tag
:
'v1-teacher-record'
},
{
name
:
'实验监控'
,
path
:
'/admin/lab/dashboard'
}
]
]
},
},
{
{
...
...
编写
预览
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论