Skip to content
项目
群组
代码片段
帮助
当前项目
正在载入...
登录 / 注册
切换导航面板
S
saas-lab
项目
项目
详情
活动
周期分析
仓库
仓库
文件
提交
分支
标签
贡献者
图表
比较
统计图
议题
0
议题
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
日程
统计图
Wiki
Wiki
代码片段
代码片段
成员
成员
折叠边栏
关闭边栏
活动
图像
聊天
创建新问题
作业
提交
问题看板
Open sidebar
EzijingWeb
saas-lab
Commits
c0c04465
提交
c0c04465
authored
7月 01, 2024
作者:
王鹏飞
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
types: fix types
上级
4365eecc
隐藏空白字符变更
内嵌
并排
正在显示
4 个修改的文件
包含
42 行增加
和
10 行删除
+42
-10
api.ts
src/modules/admin/lab/dashboard/api.ts
+1
-1
History.vue
src/modules/admin/lab/dashboard/components/History.vue
+6
-5
Live.vue
src/modules/admin/lab/dashboard/components/Live.vue
+5
-4
types.ts
src/modules/admin/lab/dashboard/types.ts
+30
-0
没有找到文件。
src/modules/admin/lab/dashboard/api.ts
浏览文件 @
c0c04465
import
httpRequest
from
'@/utils/axios'
// 获取实验列表
export
function
getExperimentList
(
params
:
{
page
:
number
;
'per-page'
:
number
})
{
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
浏览文件 @
c0c04465
<
script
setup
lang=
"ts"
>
import
type
{
ExperimentItem
}
from
'../types'
import
AppList
from
'@/components/base/AppList.vue'
import
{
getExperimentList
}
from
'../api'
import
{
useAppConfig
}
from
'@/composables/useAppConfig'
...
...
@@ -6,7 +7,7 @@ const appConfig = useAppConfig()
const
appList
=
ref
<
InstanceType
<
typeof
AppList
>
|
null
>
(
null
)
const
list
=
ref
([])
const
list
=
ref
<
ExperimentItem
[]
>
([])
async
function
fetchInfo
()
{
const
res
=
await
getExperimentList
()
list
.
value
=
res
.
data
.
items
...
...
@@ -23,7 +24,7 @@ const listOptions = computed(() => {
return
{
remote
:
{
httpRequest
:
getExperimentList
,
callback
(
data
)
{
callback
(
data
:
any
)
{
return
{
total
:
data
.
total
,
list
:
data
.
items
}
}
},
...
...
@@ -35,21 +36,21 @@ const listOptions = computed(() => {
{
label
:
'指导老师'
,
prop
:
'teachers'
,
computed
({
row
})
{
computed
({
row
}
:
{
row
:
ExperimentItem
}
)
{
return
row
.
teachers
.
map
(
item
=>
item
.
name
).
join
(
','
)
}
},
{
label
:
'班级名称'
,
prop
:
'student.specialty_name'
,
computed
({
row
})
{
computed
({
row
}
:
{
row
:
ExperimentItem
}
)
{
return
row
.
classes
.
map
(
item
=>
item
.
name
).
join
(
','
)
}
},
{
label
:
'班级人数'
,
prop
:
'student.class_name'
,
computed
({
row
})
{
computed
({
row
}
:
{
row
:
ExperimentItem
}
)
{
return
row
.
classes
.
map
(
item
=>
item
.
student_total
).
join
(
','
)
}
},
...
...
src/modules/admin/lab/dashboard/components/Live.vue
浏览文件 @
c0c04465
<
script
setup
lang=
"ts"
>
import
type
{
ExperimentItem
}
from
'../types'
import
AppList
from
'@/components/base/AppList.vue'
import
{
getExperimentList
}
from
'../api'
import
{
useAppConfig
}
from
'@/composables/useAppConfig'
...
...
@@ -6,7 +7,7 @@ const appConfig = useAppConfig()
const
appList
=
ref
<
InstanceType
<
typeof
AppList
>
|
null
>
(
null
)
const
list
=
ref
([])
const
list
=
ref
<
ExperimentItem
[]
>
([])
async
function
fetchInfo
()
{
const
res
=
await
getExperimentList
()
list
.
value
=
res
.
data
.
items
...
...
@@ -37,21 +38,21 @@ const listOptions = computed(() => {
{
label
:
'指导老师'
,
prop
:
'teachers'
,
computed
({
row
})
{
computed
({
row
}
:
{
row
:
ExperimentItem
}
)
{
return
row
.
teachers
.
map
(
item
=>
item
.
name
).
join
(
','
)
}
},
{
label
:
'班级名称'
,
prop
:
'student.specialty_name'
,
computed
({
row
})
{
computed
({
row
}
:
{
row
:
ExperimentItem
}
)
{
return
row
.
classes
.
map
(
item
=>
item
.
name
).
join
(
','
)
}
},
{
label
:
'班级人数'
,
prop
:
'student.class_name'
,
computed
({
row
})
{
computed
({
row
}
:
{
row
:
ExperimentItem
}
)
{
return
row
.
classes
.
map
(
item
=>
item
.
student_total
).
join
(
','
)
}
},
...
...
src/modules/admin/lab/dashboard/types.ts
0 → 100644
浏览文件 @
c0c04465
export
interface
OrgItem
{
department_name
:
string
project_id
:
string
project_name
:
string
}
export
interface
ClassItem
{
id
:
string
name
:
string
student_total
:
string
}
export
interface
TeacherItem
{
id
:
string
name
:
string
}
export
interface
ExperimentItem
{
id
:
string
name
:
string
time
:
string
org
:
OrgItem
classes
:
ClassItem
[]
course_name
:
string
teachers
:
TeacherItem
[]
current_use_user_count
:
string
current_member_count
:
string
current_tag_count
:
string
current_group_count
:
string
}
编写
预览
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论