Skip to content
项目
群组
代码片段
帮助
当前项目
正在载入...
登录 / 注册
切换导航面板
S
saas-lab
项目
项目
详情
活动
周期分析
仓库
仓库
文件
提交
分支
标签
贡献者
图表
比较
统计图
议题
0
议题
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
日程
统计图
Wiki
Wiki
代码片段
代码片段
成员
成员
折叠边栏
关闭边栏
活动
图像
聊天
创建新问题
作业
提交
问题看板
Open sidebar
EzijingWeb
saas-lab
Commits
904ff7ae
提交
904ff7ae
authored
8月 25, 2022
作者:
王鹏飞
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
chore: update
上级
1ff6e7fe
隐藏空白字符变更
内嵌
并排
正在显示
11 个修改的文件
包含
163 行增加
和
80 行删除
+163
-80
Header.vue
src/components/layout/Header.vue
+15
-4
StudentGroupDialog.vue
...admin/system/experiment/components/StudentGroupDialog.vue
+14
-2
Group.vue
src/modules/admin/system/experiment/views/Group.vue
+15
-2
Index.vue
src/modules/admin/system/experiment/views/Index.vue
+8
-4
View.vue
src/modules/admin/system/experiment/views/View.vue
+24
-4
api.ts
src/modules/home/api.ts
+5
-0
StudentHome.vue
src/modules/home/components/StudentHome.vue
+7
-9
types.ts
src/modules/home/types.ts
+14
-0
Index.vue
src/modules/student/lab/views/Index.vue
+24
-19
menu.ts
src/stores/menu.ts
+36
-35
axios.ts
src/utils/axios.ts
+1
-1
没有找到文件。
src/components/layout/Header.vue
浏览文件 @
904ff7ae
...
...
@@ -32,7 +32,7 @@ const defaultActive = computed(() => {
})
const
logout
=
async
()
=>
{
await
userStore
.
logout
()
location
.
href
=
`
${
import
.
meta
.
env
.
VITE_LOGIN_URL
}
?rd=
${
encodeURIComponent
(
location
.
href
)}
`
location
.
href
=
`
${
import
.
meta
.
env
.
VITE_LOGIN_URL
}
?rd=
${
encodeURIComponent
(
location
.
origin
)}
`
}
</
script
>
...
...
@@ -47,15 +47,26 @@ const logout = async () => {
<div
class=
"app-header-nav"
>
<el-menu
mode=
"horizontal"
router
:default-active=
"defaultActive"
>
<template
v-for=
"item in menus"
:key=
"item.path"
>
<el-sub-menu
:index=
"item.path"
:popper-offset=
"0"
popper-class=
"sub-menu-popper"
v-if=
"item.children"
>
<el-sub-menu
:index=
"item.path"
:popper-offset=
"0"
popper-class=
"sub-menu-popper"
v-permission=
"item.tag"
v-if=
"item.children"
>
<template
#
title
>
{{
item
.
name
}}
</
template
>
<el-menu-item
:index=
"subitem.path"
v-for=
"subitem in item.children"
:key=
"subitem.path"
>
<el-menu-item
:index=
"subitem.path"
v-for=
"subitem in item.children"
:key=
"subitem.path"
v-permission=
"subitem.tag"
>
{{ subitem.name }}
</el-menu-item>
</el-sub-menu>
<el-menu-item
:index=
"item.path"
v-else
>
<el-menu-item
:index=
"item.path"
v-
permission=
"item.tag"
v-
else
>
{{ item.name }}
</el-menu-item>
</template>
...
...
src/modules/admin/system/experiment/components/StudentGroupDialog.vue
浏览文件 @
904ff7ae
...
...
@@ -46,11 +46,23 @@ function handleRefetch() {
</el-descriptions>
<AppList
v-bind=
"listOptions"
ref=
"appList"
>
<template
#
header-buttons
>
<el-button
type=
"primary"
round
:icon=
"CirclePlus"
@
click=
"dialogVisible = true"
>
新增分组
</el-button>
<el-button
type=
"primary"
round
:icon=
"CirclePlus"
@
click=
"dialogVisible = true"
v-permission=
"'v1-backend-experiment-team-add'"
>
新增分组
</el-button
>
</
template
>
<
template
#
table-x=
"{ row }"
>
<el-button
type=
"primary"
link
>
<router-link
:to=
"`/admin/system/experiment/group/$
{row.id}`" target="_blank">小组成员
</router-link>
<router-link
:to=
"`/admin/system/experiment/group/$
{row.id}`"
target="_blank"
v-permission="'v1-backend-experiment-team-view'"
>小组成员
</router-link
>
</el-button>
</
template
>
</AppList>
...
...
src/modules/admin/system/experiment/views/Group.vue
浏览文件 @
904ff7ae
...
...
@@ -71,10 +71,23 @@ function handleRemoveStudent(row: StudentItem) {
</el-descriptions>
<AppList
v-bind=
"listOptions"
ref=
"appList"
>
<template
#
header-buttons
>
<el-button
type=
"primary"
round
:icon=
"CirclePlus"
@
click=
"selectStudentVisible = true"
>
添加小组成员
</el-button>
<el-button
type=
"primary"
round
:icon=
"CirclePlus"
@
click=
"selectStudentVisible = true"
v-permission=
"'v1-backend-experiment-team-add-student'"
>
添加小组成员
</el-button
>
</
template
>
<
template
#
table-x=
"{ row }"
>
<el-button
type=
"primary"
round
@
click=
"handleRemoveStudent(row)"
>
移除
</el-button>
<el-button
type=
"primary"
round
@
click=
"handleRemoveStudent(row)"
v-permission=
"'v1-backend-experiment-team-add-student'"
>
移除
</el-button
>
</
template
>
</AppList>
</AppCard>
...
...
src/modules/admin/system/experiment/views/Index.vue
浏览文件 @
904ff7ae
...
...
@@ -60,17 +60,21 @@ function onUpdateSuccess() {
<AppCard
title=
"实验管理"
>
<AppList
v-bind=
"listOptions"
ref=
"appList"
>
<template
#
header-buttons
>
<el-button
type=
"primary"
:icon=
"CirclePlus"
@
click=
"handleAdd"
>
新增实验
</el-button>
<el-button
type=
"primary"
:icon=
"CirclePlus"
v-permission=
"'v1-backend-experiment-create'"
@
click=
"handleAdd"
>
新增实验
</el-button
>
</
template
>
<
template
#
table-x=
"{ row }: { row: ExperimentItem }"
>
<el-button
type=
"primary"
round
>
<el-button
type=
"primary"
round
v-permission=
"'v1-backend-experiment-view'"
>
<router-link
:to=
"`/admin/system/experiment/$
{row.id}`" target="_blank">查看
</router-link>
</el-button>
<el-button
type=
"primary"
round
>
<el-button
type=
"primary"
round
v-permission=
"'v1-backend-experiment-view'"
>
<router-link
:to=
"`/admin/system/experiment/$
{row.id}`" target="_blank">关联班级与分组
</router-link>
</el-button>
<el-button
type=
"primary"
round
@
click=
"handleUpdate(row)"
>
编辑
</el-button>
<el-button
type=
"primary"
round
@
click=
"handleUpdate(row)"
v-permission=
"'v1-backend-experiment-update'"
>
编辑
</el-button
>
</
template
>
</AppList>
</AppCard>
...
...
src/modules/admin/system/experiment/views/View.vue
浏览文件 @
904ff7ae
...
...
@@ -81,12 +81,32 @@ function handleRemoveClass(row: ClassItem) {
</el-descriptions>
<AppList
v-bind=
"listOptions"
ref=
"appList"
>
<template
#
header-buttons
>
<el-button
type=
"primary"
:icon=
"CirclePlus"
@
click=
"selectClassVisible = true"
>
关联班级
</el-button>
<el-button
type=
"primary"
:icon=
"CirclePlus"
@
click=
"selectClassVisible = true"
v-permission=
"'v1-backend-experiment-class-add'"
>
关联班级
</el-button
>
</
template
>
<
template
#
table-x=
"{ row }"
>
<el-button
type=
"primary"
round
@
click=
"handleViewStudent(row)"
>
查看学生
</el-button>
<el-button
type=
"primary"
round
@
click=
"handleStudentGroup(row)"
>
学生分组
</el-button>
<el-button
type=
"primary"
round
@
click=
"handleRemoveClass(row)"
>
移除
</el-button>
<el-button
type=
"primary"
round
@
click=
"handleViewStudent(row)"
v-permission=
"'v1-backend-experiment-class-students'"
>
查看学生
</el-button
>
<el-button
type=
"primary"
round
@
click=
"handleStudentGroup(row)"
v-permission=
"'v1-backend-experiment-class-teams'"
>
学生分组
</el-button
>
<el-button
type=
"primary"
round
@
click=
"handleRemoveClass(row)"
v-permission=
"'v1-backend-experiment-class-add'"
>
移除
</el-button
>
</
template
>
</AppList>
</AppCard>
...
...
src/modules/home/api.ts
浏览文件 @
904ff7ae
...
...
@@ -9,3 +9,8 @@ export function getTopInfo() {
export
function
getExperimentList
()
{
return
httpRequest
.
get
(
'/api/lab/v1/teacher/index/index'
)
}
// 获取课程列表
export
function
getCourseList
()
{
return
httpRequest
.
get
(
'/api/lab/v1/student/course/all'
)
}
src/modules/home/components/StudentHome.vue
浏览文件 @
904ff7ae
<
script
setup
lang=
"ts"
>
import
type
{
ExperimentItem
}
from
'../types'
import
{
get
Experiment
List
}
from
'../api'
import
type
{
CourseType
}
from
'../types'
import
{
get
Course
List
}
from
'../api'
const
router
=
useRouter
()
let
list
=
$ref
<
ExperimentItem
[]
>
([])
let
list
=
$ref
<
CourseType
[]
>
([])
function
fetchList
()
{
get
Experiment
List
().
then
(
res
=>
{
get
Course
List
().
then
(
res
=>
{
list
=
res
.
data
.
list
})
}
...
...
@@ -14,9 +14,7 @@ onMounted(() => {
})
function
handleChange
(
id
:
string
,
type
:
number
)
{
if
(
type
===
1
)
{
router
.
push
({
path
:
'/admin/lab/book'
,
query
:
{
experiment_id
:
id
}
})
}
else
if
(
type
===
2
)
{
router
.
push
({
path
:
'/admin/lab/video'
,
query
:
{
experiment_id
:
id
}
})
router
.
push
({
path
:
'/student/lab'
,
query
:
{
course_id
:
id
}
})
}
}
</
script
>
...
...
@@ -27,7 +25,7 @@ function handleChange(id: string, type: number) {
<el-select
size=
"large"
placeholder=
"我的实验课程"
@
change=
"handleChange($event, 1)"
>
<el-option
v-for=
"item in list"
:key=
"item.id"
:label=
"item.name"
:value=
"item.id"
></el-option>
</el-select>
<el-select
size=
"large"
placeholder=
"我的陪练项目"
@
change=
"handleChange($event, 2)"
>
<
!--
<
el-select
size=
"large"
placeholder=
"我的陪练项目"
@
change=
"handleChange($event, 2)"
>
<el-option
v-for=
"item in list"
:key=
"item.id"
:label=
"item.name"
:value=
"item.id"
></el-option>
</el-select>
<el-select
size=
"large"
placeholder=
"我的大赛项目"
@
change=
"handleChange($event, 3)"
>
...
...
@@ -35,7 +33,7 @@ function handleChange(id: string, type: number) {
</el-select>
<el-select
size=
"large"
placeholder=
"我的大赛成绩"
@
change=
"handleChange($event, 4)"
>
<el-option
v-for=
"item in list"
:key=
"item.id"
:label=
"item.name"
:value=
"item.id"
></el-option>
</el-select>
</el-select>
-->
</div>
</
template
>
...
...
src/modules/home/types.ts
浏览文件 @
904ff7ae
...
...
@@ -2,3 +2,17 @@ export interface ExperimentItem {
id
:
string
name
:
string
}
export
interface
CourseType
{
id
:
string
name
:
string
cover
:
string
experiments
:
ExperimentType
[]
}
export
interface
ExperimentType
{
id
:
string
name
:
string
course_id
:
string
organ_id
:
string
}
src/modules/student/lab/views/Index.vue
浏览文件 @
904ff7ae
<
script
setup
lang=
"ts"
>
import
type
{
CourseType
,
ExperimentRecord
}
from
'../types'
import
{
HomeFilled
,
Select
,
UploadFilled
,
FullScreen
}
from
'@element-plus/icons-vue'
import
{
HomeFilled
}
from
'@element-plus/icons-vue'
import
{
useGetCourseList
}
from
'../composables/useGetCourseList'
import
{
upload
}
from
'@/utils/upload'
import
{
getExperimentRecord
,
uploadExperimentPicture
,
submitExperimentRecord
}
from
'../api'
...
...
@@ -12,16 +12,19 @@ const Discuss = defineAsyncComponent(() => import('../components/Discuss.vue'))
const
Result
=
defineAsyncComponent
(()
=>
import
(
'../components/Result.vue'
))
const
ReportDialog
=
defineAsyncComponent
(()
=>
import
(
'../components/ReportDialog.vue'
))
const
route
=
useRoute
()
// 左侧
const
form
=
reactive
<
{
course
?:
CourseType
;
experiment_id
:
string
}
>
({
course
:
undefined
,
experiment_id
:
'
6965149866569760768
'
const
form
=
reactive
<
{
course
_id
:
string
;
experiment_id
:
string
}
>
({
course
_id
:
(
route
.
query
.
course_id
as
string
)
||
''
,
experiment_id
:
''
})
// 课程列表
const
{
courses
}
=
useGetCourseList
()
// 实验列表
const
experimentList
=
$computed
(()
=>
{
return
form
.
course
?.
experiments
||
[]
const
course
=
courses
.
value
.
find
((
item
:
CourseType
)
=>
item
.
id
===
form
.
course_id
)
return
course
?.
experiments
||
[]
})
let
detail
=
$ref
<
ExperimentRecord
>
()
provide
(
'detail'
,
$$
(
detail
))
...
...
@@ -104,8 +107,8 @@ function handleSubmit() {
<div
class=
"lab-left"
>
<el-form
:model=
"form"
label-suffix=
":"
hide-required-asterisk
>
<el-form-item
label=
"请选择课程"
>
<el-select
v
alue-key=
"id"
v-model=
"form.course
"
style=
"width: 100%"
>
<el-option
v-for=
"item in courses"
:key=
"item.id"
:label=
"item.name"
:value=
"item"
></el-option>
<el-select
v
-model=
"form.course_id
"
style=
"width: 100%"
>
<el-option
v-for=
"item in courses"
:key=
"item.id"
:label=
"item.name"
:value=
"item
.id
"
></el-option>
</el-select>
</el-form-item>
<el-form-item
label=
"请选择实验"
prop=
"experiment_id"
>
...
...
@@ -136,16 +139,9 @@ function handleSubmit() {
>
返回首页
</el-button
>
<div>
<el-button
type=
"primary"
:icon=
"Select"
:disabled=
"disabled"
@
click=
"handleSubmit"
>
提交
</el-button>
<el-button
type=
"primary"
:icon=
"UploadFilled"
:disabled=
"disabled"
@
click=
"reportDialogVisible = true"
>
上传报告
</el-button
>
<el-button
type=
"primary"
:icon=
"FullScreen"
:disabled=
"disabled"
:loading=
"screenshotLoading"
@
click=
"handleCapture"
<el-button
type=
"primary"
:disabled=
"disabled"
@
click=
"handleSubmit"
>
提交
</el-button>
<el-button
type=
"primary"
:disabled=
"disabled"
@
click=
"reportDialogVisible = true"
>
上传报告
</el-button>
<el-button
type=
"primary"
:disabled=
"disabled"
:loading=
"screenshotLoading"
@
click=
"handleCapture"
>
截图
</el-button
>
</div>
...
...
@@ -174,15 +170,24 @@ function handleSubmit() {
.lab-left
{
display
:
flex
;
flex-direction
:
column
;
width
:
5
00px
;
width
:
4
00px
;
padding
:
20px
;
background-color
:
rgba
(
45
,
48
,
55
,
1
)
;
background-color
:
#e1e4eb
;
border-radius
:
6px
;
box-sizing
:
border-box
;
.el-tabs
{
flex
:
1
;
border
:
0
;
overflow
:
hidden
;
}
:deep
(
.el-tabs__header
)
{
background-color
:
#e1e4eb
;
}
:deep
(
.el-tabs__item
)
{
padding
:
0
14px
!
important
;
border
:
0
;
border-radius
:
6px
6px
0px
0px
;
}
:deep
(
.el-tabs__content
)
{
height
:
calc
(
100%
-
40px
);
box-sizing
:
border-box
;
...
...
src/stores/menu.ts
浏览文件 @
904ff7ae
import
type
{
IMenuItem
}
from
'@/types'
import
{
defineStore
}
from
'pinia'
import
{
Notebook
,
VideoCamera
,
ChatSquare
,
Finished
,
ScaleToOriginal
}
from
'@element-plus/icons-vue'
import
{
useUserStore
}
from
'@/stores/user'
interface
State
{
...
...
@@ -13,68 +12,70 @@ const studentMenus: IMenuItem[] = [
{
name
:
'智能营销'
,
path
:
'/student/lab'
},
{
name
:
'智能陪练'
,
path
:
'/student/ai'
},
{
name
:
'成绩分析'
,
path
:
'/admin/contest/score'
},
{
name
:
'技能大赛'
,
path
:
'/student/contest'
}
// {
// name: '智能陪练',
// path: '/student/ai'
// },
// {
// name: '成绩分析',
// path: '/admin/contest/score'
// },
// {
// name: '技能大赛',
// path: '/student/contest'
// }
]
// 教师、管理员菜单
const
adminMenus
:
IMenuItem
[]
=
[
{
name
:
'智能营销'
,
path
:
'/admin/lab'
,
tag
:
'v1-teacher'
,
children
:
[
{
icon
:
markRaw
(
Notebook
),
name
:
'实验指导书管理'
,
path
:
'/admin/lab/book'
path
:
'/admin/lab/book'
,
tag
:
'v1-teacher-book'
},
{
icon
:
markRaw
(
VideoCamera
),
name
:
'实验操作视频管理'
,
path
:
'/admin/lab/video'
path
:
'/admin/lab/video'
,
tag
:
'v1-teacher-video'
},
{
icon
:
markRaw
(
ChatSquare
),
name
:
'实验讨论交流'
,
path
:
'/admin/lab/discuss'
path
:
'/admin/lab/discuss'
,
tag
:
'v1-teacher-discussion'
},
{
icon
:
markRaw
(
Finished
),
name
:
'实验成绩管理'
,
path
:
'/admin/lab/record'
path
:
'/admin/lab/record'
,
tag
:
'v1-teacher-record'
}
]
},
{
name
:
'智能陪练'
,
path
:
'/admin/ai'
},
{
name
:
'成绩分析'
,
path
:
'/admin/contest/score'
},
{
name
:
'技能大赛'
,
path
:
'/admin/contest'
},
//
{
//
name: '智能陪练',
//
path: '/admin/ai'
//
},
//
{
//
name: '成绩分析',
//
path: '/admin/contest/score'
//
},
//
{
//
name: '技能大赛',
//
path: '/admin/contest'
//
},
{
name
:
'系统管理'
,
path
:
'/admin/system'
,
tag
:
'v1-backend-experiment'
,
children
:
[
{
icon
:
markRaw
(
ScaleToOriginal
),
name
:
'实验管理'
,
path
:
'/admin/system/experiment'
path
:
'/admin/system/experiment'
,
tag
:
'v1-backend-experiment'
}
]
}
...
...
src/utils/axios.ts
浏览文件 @
904ff7ae
...
...
@@ -51,7 +51,7 @@ httpRequest.interceptors.response.use(
// 未登录
if
(
status
===
403
)
{
location
.
href
=
`
${
import
.
meta
.
env
.
VITE_LOGIN_URL
}
?rd=
${
encodeURIComponent
(
location
.
href
)}
`
}
else
if
(
status
===
402
)
{
}
else
if
(
status
===
40
1
||
status
===
40
2
)
{
// 未授权
router
.
push
(
'/401'
)
}
else
{
...
...
编写
预览
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论