Skip to content
项目
群组
代码片段
帮助
当前项目
正在载入...
登录 / 注册
切换导航面板
X
x-learn
项目
项目
详情
活动
周期分析
仓库
仓库
文件
提交
分支
标签
贡献者
图表
比较
统计图
议题
0
议题
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
日程
统计图
Wiki
Wiki
代码片段
代码片段
成员
成员
折叠边栏
关闭边栏
活动
图像
聊天
创建新问题
作业
提交
问题看板
Open sidebar
EzijingWeb
x-learn
Commits
d1cf15c2
提交
d1cf15c2
authored
9月 26, 2021
作者:
王鹏飞
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
feat: 课后资料支持多个文件
上级
10fb0788
隐藏空白字符变更
内嵌
并排
正在显示
4 个修改的文件
包含
13 行增加
和
11 行删除
+13
-11
api.js
src/modules/viewer/api.js
+1
-1
chapterRead.vue
src/modules/viewer/components/read/chapterRead.vue
+1
-7
fileList.vue
src/modules/viewer/components/read/fileList.vue
+10
-2
CourseChapter.vue
src/pages/course/learn/components/CourseChapter.vue
+1
-1
没有找到文件。
src/modules/viewer/api.js
浏览文件 @
d1cf15c2
...
...
@@ -8,7 +8,7 @@ import httpRequest from '@/utils/axios'
export
function
getCourse
(
semesterId
,
courseId
)
{
return
httpRequest
.
get
(
`/api/zy/v2/education/courses/
${
courseId
}
`
).
then
(
response
=>
{
response
.
chapters
=
response
.
chapters
.
filter
(
item
=>
{
item
.
children
=
item
.
children
.
filter
(
child
=>
child
.
type
===
2
)
item
.
children
=
item
.
children
.
filter
(
child
=>
child
.
type
===
2
||
child
.
type
===
4
)
return
item
.
children
.
length
})
return
response
...
...
src/modules/viewer/components/read/chapterRead.vue
浏览文件 @
d1cf15c2
<
template
>
<container
:title=
"chapter.name"
>
<file-list
:files=
"files"
></file-list>
...
...
@@ -32,12 +31,7 @@ export default {
},
computed
:
{
files
()
{
const
reading
=
this
.
chapter
.
reading
const
file
=
{
file_name
:
reading
.
reading_content
,
file_url
:
reading
.
reading_attachment
}
return
[
file
]
return
this
.
chapter
.
reading
?
this
.
chapter
.
reading
.
reading_attachment
:
[]
}
}
}
...
...
src/modules/viewer/components/read/fileList.vue
浏览文件 @
d1cf15c2
<
template
>
<div>
<ul
class=
"file-list"
v-if=
"
f
iles.length"
>
<li
class=
"file-list-item"
v-for=
"file in
f
iles"
:key=
"file.id"
>
<ul
class=
"file-list"
v-if=
"
currentF
iles.length"
>
<li
class=
"file-list-item"
v-for=
"file in
currentF
iles"
:key=
"file.id"
>
<a
:href=
"file.file_url"
target=
"_blank"
>
<i
class=
"el-icon-document"
></i>
<div
class=
"file-list-item__inner"
v-html=
"file.file_name"
></div>
...
...
@@ -28,6 +28,14 @@ export default {
title
:
{
type
:
String
,
default
:
'课程资料'
},
// 文件列表
files
:
{
type
:
Array
,
default
:
()
=>
[]
}
},
computed
:
{
currentFiles
()
{
return
this
.
files
.
map
(
file
=>
{
file
.
file_url
=
file
.
file_url
||
file
.
url
return
file
})
}
}
}
</
script
>
...
...
src/pages/course/learn/components/CourseChapter.vue
浏览文件 @
d1cf15c2
...
...
@@ -64,7 +64,7 @@ export default {
return
`已学
${
value
}
%`
},
handleClick
(
data
)
{
if
(
data
.
type
===
2
)
{
if
(
data
.
type
===
2
||
data
.
type
===
4
)
{
this
.
$router
.
push
({
name
:
'viewerCourseChapter'
,
params
:
{
cid
:
this
.
courseId
,
id
:
data
.
id
}
})
}
},
...
...
编写
预览
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论