Skip to content
项目
群组
代码片段
帮助
当前项目
正在载入...
登录 / 注册
切换导航面板
X
x-learn
项目
项目
详情
活动
周期分析
仓库
仓库
文件
提交
分支
标签
贡献者
图表
比较
统计图
议题
0
议题
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
日程
统计图
Wiki
Wiki
代码片段
代码片段
成员
成员
折叠边栏
关闭边栏
活动
图像
聊天
创建新问题
作业
提交
问题看板
Open sidebar
EzijingWeb
x-learn
Commits
10c4fab5
提交
10c4fab5
authored
10月 22, 2021
作者:
lihuihui
浏览文件
操作
浏览文件
下载
差异文件
Merge branch 'master' of
https://gitlab.ezijing.com/ezijing/x-learn
上级
ed8e8b29
c398be02
显示空白字符变更
内嵌
并排
正在显示
3 个修改的文件
包含
49 行增加
和
24 行删除
+49
-24
CourseChapter.vue
src/pages/course/learn/components/CourseChapter.vue
+1
-1
item.vue
src/pages/course/learn/item.vue
+39
-22
index.vue
src/pages/exam/testExam/index.vue
+9
-1
没有找到文件。
src/pages/course/learn/components/CourseChapter.vue
浏览文件 @
10c4fab5
...
@@ -80,7 +80,7 @@ export default {
...
@@ -80,7 +80,7 @@ export default {
const
path
=
type
===
3
?
'/course/chapter/result'
:
'/course/exam/chapter'
const
path
=
type
===
3
?
'/course/chapter/result'
:
'/course/exam/chapter'
this
.
$router
.
push
({
this
.
$router
.
push
({
path
:
path
,
path
:
path
,
query
:
{
course_id
:
this
.
courseId
,
chapter_id
:
data
.
id
,
type
}
query
:
{
course_id
:
this
.
courseId
,
chapter_id
:
data
.
id
,
type
,
exam_id
:
data
.
resource_id
}
})
})
},
},
handleDownload
(
item
)
{
handleDownload
(
item
)
{
...
...
src/pages/course/learn/item.vue
浏览文件 @
10c4fab5
...
@@ -25,13 +25,23 @@
...
@@ -25,13 +25,23 @@
<el-tab-pane
lazy
label=
"课程内容"
>
<el-tab-pane
lazy
label=
"课程内容"
>
<course-chapter
:courseId=
"courseId"
:showProgress=
"true"
:data=
"detail.chapters"
></course-chapter>
<course-chapter
:courseId=
"courseId"
:showProgress=
"true"
:data=
"detail.chapters"
></course-chapter>
</el-tab-pane>
</el-tab-pane>
<el-tab-pane
v-if=
"examList.length"
lazy
label=
"
课后
习题"
>
<el-tab-pane
v-if=
"examList.length"
lazy
label=
"
全部
习题"
>
<ul
class=
"exam-list"
>
<ul
class=
"exam-list"
>
<li
v-for=
"item in examList"
:key=
"item.id"
>
<li
v-for=
"item in examList"
:key=
"item.id"
>
<router-link
<div
class=
"name"
>
:to=
"
{ path: '/course/exam/chapter', query: { course_id: courseId, chapter_id: item.id,exam_id: item.resource_id } }"
{{
item
.
name
}}
>
{{
item
.
name
}}
</router-link
</div>
>
<div
class=
"buttons"
>
<el-button
round
size=
"mini"
v-if=
"item.status === 100"
@
click=
"toExamPage(item, 1)"
>
测试
</el-button>
<el-button
round
size=
"mini"
v-if=
"[0, 3].includes(item.status)"
@
click=
"toExamPage(item, 2)"
>
继续测试
</el-button>
<template
v-if=
"[1, 2].includes(item.status)"
>
<el-button
round
size=
"mini"
@
click=
"toExamPage(item, 3)"
>
报告
</el-button>
</
template
>
</div>
</li>
</li>
</ul>
</ul>
</el-tab-pane>
</el-tab-pane>
...
@@ -68,8 +78,7 @@ export default {
...
@@ -68,8 +78,7 @@ export default {
return
{
return
{
tabActive
:
0
,
tabActive
:
0
,
loaded
:
false
,
loaded
:
false
,
detail
:
{},
detail
:
{}
examList
:
[]
}
}
},
},
computed
:
{
computed
:
{
...
@@ -81,9 +90,13 @@ export default {
...
@@ -81,9 +90,13 @@ export default {
},
},
// 扁平化章节数据
// 扁平化章节数据
flatChapters
()
{
flatChapters
()
{
if
(
this
.
detail
.
chapters
&&
this
.
detail
.
chapters
.
length
)
{
return
this
.
detail
.
chapters
.
reduce
((
result
,
item
)
=>
{
return
this
.
detail
.
chapters
.
reduce
((
result
,
item
)
=>
{
return
result
.
concat
(
item
.
children
)
return
result
.
concat
(
item
.
children
)
},
[])
},
[])
}
else
{
return
[]
}
},
},
// 最新的视频
// 最新的视频
latestVideo
()
{
latestVideo
()
{
...
@@ -92,6 +105,9 @@ export default {
...
@@ -92,6 +105,9 @@ export default {
}
else
{
}
else
{
return
this
.
flatChapters
.
length
?
this
.
flatChapters
[
0
]
:
null
return
this
.
flatChapters
.
length
?
this
.
flatChapters
[
0
]
:
null
}
}
},
examList
()
{
return
this
.
flatChapters
.
filter
(
item
=>
item
.
type
===
9
)
}
}
},
},
methods
:
{
methods
:
{
...
@@ -101,18 +117,6 @@ export default {
...
@@ -101,18 +117,6 @@ export default {
api
api
.
getCourse
(
this
.
courseId
)
.
getCourse
(
this
.
courseId
)
.
then
(
response
=>
{
.
then
(
response
=>
{
if
(
response
.
chapters
.
length
)
{
const
examList
=
[]
response
.
chapters
.
forEach
(
item
=>
{
item
.
children
.
forEach
((
it
,
index
)
=>
{
if
(
it
.
type
===
9
)
{
examList
.
push
(
it
)
item
.
children
.
splice
(
index
,
1
)
}
})
})
this
.
examList
=
examList
}
if
(
response
.
files
&&
response
.
files
.
length
)
{
if
(
response
.
files
&&
response
.
files
.
length
)
{
response
.
chapters
.
push
({
response
.
chapters
.
push
({
id
:
'1'
,
id
:
'1'
,
...
@@ -120,7 +124,6 @@ export default {
...
@@ -120,7 +124,6 @@ export default {
children
:
response
.
files
children
:
response
.
files
})
})
}
}
console
.
log
(
response
)
this
.
detail
=
response
this
.
detail
=
response
})
})
.
finally
(()
=>
{
.
finally
(()
=>
{
...
@@ -133,6 +136,13 @@ export default {
...
@@ -133,6 +136,13 @@ export default {
},
},
onChapterClick
(
data
)
{
onChapterClick
(
data
)
{
this
.
$router
.
push
({
name
:
'viewerCourseChapter'
,
params
:
{
cid
:
this
.
courseId
,
id
:
data
.
id
}
})
this
.
$router
.
push
({
name
:
'viewerCourseChapter'
,
params
:
{
cid
:
this
.
courseId
,
id
:
data
.
id
}
})
},
toExamPage
(
data
,
type
)
{
const
path
=
type
===
3
?
'/course/chapter/result'
:
'/course/exam/chapter'
this
.
$router
.
push
({
path
:
path
,
query
:
{
course_id
:
this
.
courseId
,
chapter_id
:
data
.
id
,
type
,
exam_id
:
data
.
resource_id
}
})
}
}
},
},
beforeMount
()
{
beforeMount
()
{
...
@@ -204,12 +214,19 @@ export default {
...
@@ -204,12 +214,19 @@ export default {
margin-left
:
20px
;
margin-left
:
20px
;
width
:
300px
;
width
:
300px
;
}
}
.exam-list
li
{
.exam-list
{
li
{
display
:
flex
;
padding
:
5px
0
;
padding
:
5px
0
;
line-height
:
22px
;
cursor
:
pointer
;
cursor
:
pointer
;
color
:
#666
;
&
:hover
{
&
:hover
{
color
:
#c01540
;
color
:
#c01540
;
}
}
.name
{
flex
:
1
;
overflow
:
hidden
;
}
}
}
}
</
style
>
</
style
>
src/pages/exam/testExam/index.vue
浏览文件 @
10c4fab5
<
template
>
<
template
>
<app-container
title=
"模拟考试"
>
<app-container
title=
"模拟考试"
>
<template
#
header-right
>
<el-select
v-model=
"courseId"
@
change=
"getExamList"
placeholder=
"请选择课程"
clearable
style=
"width:300px"
>
<el-option
v-for=
"item in courses"
:key=
"item.id"
:label=
"item.course_name"
:value=
"item.id"
></el-option>
</el-select>
</
template
>
<div
class=
"exam-list"
>
<div
class=
"exam-list"
>
<
template
v-for=
"item in examList"
>
<
template
v-for=
"item in examList"
>
<el-card
shadow=
"hover"
class=
"exam-item"
:key=
"item.id"
@
click
.
native=
"startExam(item)"
>
<el-card
shadow=
"hover"
class=
"exam-item"
:key=
"item.id"
@
click
.
native=
"startExam(item)"
>
...
@@ -23,6 +28,8 @@ export default {
...
@@ -23,6 +28,8 @@ export default {
components
:
{
AppContainer
},
components
:
{
AppContainer
},
data
()
{
data
()
{
return
{
return
{
courseId
:
''
,
courses
:
[],
examList
:
[]
examList
:
[]
}
}
},
},
...
@@ -31,9 +38,10 @@ export default {
...
@@ -31,9 +38,10 @@ export default {
},
},
methods
:
{
methods
:
{
getExamList
()
{
getExamList
()
{
api
.
getExamList
().
then
(
response
=>
{
api
.
getExamList
(
{
course_id
:
this
.
courseId
}
).
then
(
response
=>
{
// 考试状态(0,3:已缓存,1:已提交,2:已评阅,100:未做)
// 考试状态(0,3:已缓存,1:已提交,2:已评阅,100:未做)
this
.
examList
=
response
.
papers
this
.
examList
=
response
.
papers
this
.
courses
=
response
.
courses
})
})
},
},
startExam
(
item
)
{
startExam
(
item
)
{
...
...
编写
预览
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论