Skip to content
项目
群组
代码片段
帮助
当前项目
正在载入...
登录 / 注册
切换导航面板
S
saas-learn
项目
项目
详情
活动
周期分析
仓库
仓库
文件
提交
分支
标签
贡献者
图表
比较
统计图
议题
0
议题
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
日程
统计图
Wiki
Wiki
代码片段
代码片段
成员
成员
折叠边栏
关闭边栏
活动
图像
聊天
创建新问题
作业
提交
问题看板
Open sidebar
EzijingWeb
saas-learn
Commits
6f2daa4a
提交
6f2daa4a
authored
8月 15, 2022
作者:
王鹏飞
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
chore: update
上级
afd5bdf2
隐藏空白字符变更
内嵌
并排
正在显示
10 个修改的文件
包含
51 行增加
和
16 行删除
+51
-16
CourseListItem.vue
src/modules/course/components/CourseListItem.vue
+1
-1
CourseListSearch.vue
src/modules/course/components/CourseListSearch.vue
+1
-1
CourseViewChapter.vue
src/modules/course/components/CourseViewChapter.vue
+8
-3
CourseViewMaterial.vue
src/modules/course/components/CourseViewMaterial.vue
+3
-1
CourseViewMaterialListItem.vue
src/modules/course/components/CourseViewMaterialListItem.vue
+2
-3
CoursePlayer.vue
src/modules/course/views/CoursePlayer.vue
+2
-1
CourseView.vue
src/modules/course/views/CourseView.vue
+1
-1
types.ts
src/modules/favorites/types.ts
+2
-2
Index.vue
src/modules/favorites/views/Index.vue
+30
-3
types.ts
src/types.ts
+1
-0
没有找到文件。
src/modules/course/components/CourseListItem.vue
浏览文件 @
6f2daa4a
...
@@ -59,7 +59,7 @@ function handleTop(data: CourseListItemType) {
...
@@ -59,7 +59,7 @@ function handleTop(data: CourseListItemType) {
<img
:src=
"data.cover"
/><span
class=
"course-item__type"
>
{{
electiveTypeText
}}
</span>
<img
:src=
"data.cover"
/><span
class=
"course-item__type"
>
{{
electiveTypeText
}}
</span>
</div>
</div>
<div
class=
"course-item-main"
>
<div
class=
"course-item-main"
>
<h2
class=
"course-item__name"
>
{{
data
.
name
}}
</h2>
<h2
class=
"course-item__name"
>
{{
data
.
course_alias_name
||
data
.
name
}}
</h2>
</div>
</div>
</div>
</div>
<div
class=
"course-item-progress"
>
<div
class=
"course-item-progress"
>
...
...
src/modules/course/components/CourseListSearch.vue
浏览文件 @
6f2daa4a
...
@@ -79,7 +79,7 @@ const filterList = computed(() => {
...
@@ -79,7 +79,7 @@ const filterList = computed(() => {
>
>
<template
#
default=
"
{ item }">
<template
#
default=
"
{ item }">
<div
class=
"search-course-item"
>
<div
class=
"search-course-item"
>
<h4
class=
"search-course-item__name"
v-html=
"searchHighlight(item.name)"
></h4>
<h4
class=
"search-course-item__name"
v-html=
"searchHighlight(item.
course_alias_name || item.
name)"
></h4>
<div
class=
"search-course-chapters"
v-if=
"item.chapters?.length"
>
<div
class=
"search-course-chapters"
v-if=
"item.chapters?.length"
>
<div
class=
"search-course-chapter-item"
v-for=
"chapter in item.chapters"
:key=
"chapter.id"
>
<div
class=
"search-course-chapter-item"
v-for=
"chapter in item.chapters"
:key=
"chapter.id"
>
<p
class=
"search-course-chapter-item__name"
v-html=
"searchHighlight(chapter.name)"
></p>
<p
class=
"search-course-chapter-item__name"
v-html=
"searchHighlight(chapter.name)"
></p>
...
...
src/modules/course/components/CourseViewChapter.vue
浏览文件 @
6f2daa4a
...
@@ -107,8 +107,13 @@ function downloadFile(data: CourseResourceType) {
...
@@ -107,8 +107,13 @@ function downloadFile(data: CourseResourceType) {
function
targetUrl
(
resource
:
CourseResourceType
,
section
:
CourseSectionType
,
chapter
:
CourseChapterType
)
{
function
targetUrl
(
resource
:
CourseResourceType
,
section
:
CourseSectionType
,
chapter
:
CourseChapterType
)
{
if
(
resource
.
resource_type
===
3
||
resource
.
resource_type
===
9
)
{
if
(
resource
.
resource_type
===
3
||
resource
.
resource_type
===
9
)
{
return
`/course/exam?course_id=
${
courseId
}
&semester_id=
${
semesterId
}
&paper_id=
${
resource
.
resource_id
}
&type=2&paper_title=
${
resource
.
name
}
`
return
`/course/exam?course_id=
${
courseId
}
&semester_id=
${
semesterId
}
&paper_id=
${
resource
.
resource_id
}
&type=2&paper_title=
${
resource
.
name
}
`
}
else
if
(
resource
.
resource_type
===
2
)
{
return
`/course/player?course_id=
${
courseId
}
&chapter_id=
${
chapter
.
id
}
§ion_id=
${
section
.
id
}
&resource_id=
${
resource
.
resource_id
}
&semester_id=
${
semesterId
}
&paper_title=
${
resource
.
name
}
`
}
else
if
(
resource
.
resource_type
===
6
)
{
return
resource
.
info
.
join_url
}
else
{
return
`/preview?course_id=
${
courseId
}
&semester_id=
${
semesterId
}
&resource_id=
${
resource
.
resource_id
}
&resource_type=
${
resource
.
resource_type
}
&url=
${
resource
.
info
?.
url
}
`
}
}
return
`/course/player?course_id=
${
courseId
}
&chapter_id=
${
chapter
.
id
}
§ion_id=
${
section
.
id
}
&resource_id=
${
resource
.
resource_id
}
&semester_id=
${
semesterId
}
&paper_title=
${
resource
.
name
}
`
}
}
</
script
>
</
script
>
<
template
>
<
template
>
...
@@ -127,10 +132,10 @@ function targetUrl(resource: CourseResourceType, section: CourseSectionType, cha
...
@@ -127,10 +132,10 @@ function targetUrl(resource: CourseResourceType, section: CourseSectionType, cha
<ul>
<ul>
<li
class=
"course-resource-item"
v-for=
"resource in section.resources"
:key=
"resource.id"
>
<li
class=
"course-resource-item"
v-for=
"resource in section.resources"
:key=
"resource.id"
>
<p>
<p>
<
router-link
:to
=
"targetUrl(resource, section, item)"
target=
"_blank"
>
<
a
:href
=
"targetUrl(resource, section, item)"
target=
"_blank"
>
<ResourceIcon
:resourceType=
"resource.resource_type"
:info=
"resource.info"
/>
<ResourceIcon
:resourceType=
"resource.resource_type"
:info=
"resource.info"
/>
{{ resource.name }}
{{ resource.name }}
</
router-link
>
</
a
>
</p>
</p>
<router-link
<router-link
:to=
"`/course/exam/result?course_id=${courseId}&semester_id=${semesterId}&paper_id=${resource.resource_id}&type=2&paper_title=${resource.name}`"
:to=
"`/course/exam/result?course_id=${courseId}&semester_id=${semesterId}&paper_id=${resource.resource_id}&type=2&paper_title=${resource.name}`"
...
...
src/modules/course/components/CourseViewMaterial.vue
浏览文件 @
6f2daa4a
...
@@ -10,7 +10,9 @@ const semesterId = $ref(query.semester_id as string)
...
@@ -10,7 +10,9 @@ const semesterId = $ref(query.semester_id as string)
let
list
=
$ref
<
CourseResourceType
[]
>
([])
let
list
=
$ref
<
CourseResourceType
[]
>
([])
function
fetchList
()
{
function
fetchList
()
{
getCourseMaterialList
({
course_id
:
courseId
,
semester_id
:
semesterId
}).
then
(
res
=>
{
getCourseMaterialList
({
course_id
:
courseId
,
semester_id
:
semesterId
}).
then
(
res
=>
{
list
=
res
.
data
.
items
list
=
res
.
data
.
items
.
map
((
item
:
CourseResourceType
)
=>
{
return
{
...
item
,
resource_type
:
4
}
})
})
})
}
}
onMounted
(()
=>
{
onMounted
(()
=>
{
...
...
src/modules/course/components/CourseViewMaterialListItem.vue
浏览文件 @
6f2daa4a
...
@@ -38,15 +38,14 @@ function canCollection(type: number) {
...
@@ -38,15 +38,14 @@ function canCollection(type: number) {
// 收藏/取消收藏
// 收藏/取消收藏
function
toggleCollection
(
data
:
CourseResourceType
)
{
function
toggleCollection
(
data
:
CourseResourceType
)
{
// 资源类型: 1章节,2视频,3作业,4其他,6腾讯会议,9考试,10课件,11教案
// 资源类型: 1章节,2视频,3作业,4其他,6腾讯会议,9考试,10课件,11教案
// 收藏类型: 1其他, 2视频,3课件,4教案,5作业,6帖子
// 收藏类型: 1其他, 2视频,3课件,4教案,5作业,6帖子, 7课程资料
const
typeMap
:
Record
<
number
,
number
>
=
{
4
:
1
,
2
:
2
,
10
:
3
,
11
:
4
,
3
:
5
,
9
:
5
}
collectionResource
({
collectionResource
({
course_id
:
courseId
,
course_id
:
courseId
,
semester_id
:
semesterId
,
semester_id
:
semesterId
,
chapter_id
:
chapterId
,
chapter_id
:
chapterId
,
section_id
:
sectionId
,
section_id
:
sectionId
,
source_id
:
data
.
resource_id
,
source_id
:
data
.
resource_id
,
type
:
typeMap
[
data
.
resource_type
]
,
type
:
7
,
status
:
data
.
collection_count
?
0
:
1
status
:
data
.
collection_count
?
0
:
1
}).
then
(()
=>
{
}).
then
(()
=>
{
data
.
collection_count
=
data
.
collection_count
?
0
:
1
data
.
collection_count
=
data
.
collection_count
?
0
:
1
...
...
src/modules/course/views/CoursePlayer.vue
浏览文件 @
6f2daa4a
...
@@ -20,6 +20,7 @@ watchEffect(() => {
...
@@ -20,6 +20,7 @@ watchEffect(() => {
})
})
const
detail
=
reactive
<
{
const
detail
=
reactive
<
{
course_alias_name
:
string
course_name
:
string
course_name
:
string
coursewares
:
CourseResourceType
[]
coursewares
:
CourseResourceType
[]
exams
:
CourseResourceType
[]
exams
:
CourseResourceType
[]
...
@@ -81,7 +82,7 @@ function toggleSidebar() {
...
@@ -81,7 +82,7 @@ function toggleSidebar() {
<
template
>
<
template
>
<div
class=
"course-player"
>
<div
class=
"course-player"
>
<div
class=
"course-player-hd"
>
<div
class=
"course-player-hd"
>
<h1
class=
"course-player-main__title"
>
{{
detail
.
course_name
}}
</h1>
<h1
class=
"course-player-main__title"
>
{{
detail
.
course_
alias_name
||
detail
.
course_
name
}}
</h1>
</div>
</div>
<div
class=
"course-player-bd"
>
<div
class=
"course-player-bd"
>
<div
class=
"course-player-main"
v-loading=
"loading"
>
<div
class=
"course-player-main"
v-loading=
"loading"
>
...
...
src/modules/course/views/CourseView.vue
浏览文件 @
6f2daa4a
...
@@ -71,7 +71,7 @@ function showInfo(title: string, content: string) {
...
@@ -71,7 +71,7 @@ function showInfo(title: string, content: string) {
<div
class=
"course-view"
v-loading=
"loading"
>
<div
class=
"course-view"
v-loading=
"loading"
>
<section
class=
"course-view-hd"
>
<section
class=
"course-view-hd"
>
<div
class=
"course-info"
>
<div
class=
"course-info"
>
<h1>
{{
detail
.
name
}}
</h1>
<h1>
{{
detail
.
course_alias_name
||
detail
.
name
}}
</h1>
<ul>
<ul>
<li>
{{
electiveTypeText
}}
</li>
<li>
{{
electiveTypeText
}}
</li>
<li>
{{
detail
.
credit
}}
学分
</li>
<li>
{{
detail
.
credit
}}
学分
</li>
...
...
src/modules/favorites/types.ts
浏览文件 @
6f2daa4a
...
@@ -13,7 +13,7 @@ export interface CollectionType {
...
@@ -13,7 +13,7 @@ export interface CollectionType {
type
:
number
type
:
number
resource_type
:
number
resource_type
:
number
can_download
:
number
can_download
:
number
course
:
Pick
<
CourseType
,
'id'
|
'name'
|
'course_id'
>
course
:
Pick
<
CourseType
,
'id'
|
'name'
|
'course_
alias_name'
|
'course_
id'
>
chapter
:
Pick
<
ChapterType
,
'id'
|
'name'
>
chapter
:
Pick
<
ChapterType
,
'id'
|
'name'
>
}
}
...
@@ -22,4 +22,4 @@ export interface CollectionSemesterType {
...
@@ -22,4 +22,4 @@ export interface CollectionSemesterType {
name
:
string
name
:
string
}
}
export
type
AllCourseType
=
Pick
<
CourseType
,
'id'
|
'name'
|
'course_id'
|
'cover'
|
'semester'
>
export
type
AllCourseType
=
Pick
<
CourseType
,
'id'
|
'name'
|
'course_
alias_name'
|
'course_
id'
|
'cover'
|
'semester'
>
src/modules/favorites/views/Index.vue
浏览文件 @
6f2daa4a
...
@@ -100,11 +100,33 @@ function downloadFile(data: CollectionType) {
...
@@ -100,11 +100,33 @@ function downloadFile(data: CollectionType) {
}
}
})
})
}
}
// 课程详情
function
genCourseViewUrl
(
item
:
CollectionType
)
{
return
`/course/view?course_id=
${
item
.
course_id
}
&semester_id=
${
item
.
semester_id
}
&chapter_id=
${
item
.
chapter_id
}
§ion_id=
${
item
.
section_id
}
`
}
// 课程播放页
function
genCoursePlayerUrl
(
item
:
CollectionType
)
{
return
`/course/player?course_id=
${
item
.
course_id
}
&chapter_id=
${
item
.
chapter_id
}
§ion_id=
${
item
.
section_id
}
&resource_id=
${
item
.
source_id
}
&semester_id=
${
item
.
semester_id
}
`
}
// 文件预览
function
genPreviewUrl
(
item
:
CollectionType
)
{
return
`/preview?course_id=
${
item
.
course_id
}
&semester_id=
${
item
.
semester_id
}
&resource_id=
${
item
.
info
?.
id
}
&
resource_type
=
$
{
item
.
resource_type
}
&
url
=
$
{
item
.
info
?.
url
}
`
}
function targetUrl(item: CollectionType) {
function targetUrl(item: CollectionType) {
if (item.type === 5) {
if (item.type === 5) {
return `
/
course
/
exam
?
course_id
=
$
{
item
.
course_id
}
&
semester_id
=
$
{
item
.
semester_id
}
&
paper_id
=
$
{
item
.
info
.
id
}
&
type
=
2
&
paper_title
=
$
{
item
.
info
.
paper_title
}
`
return `
/
course
/
exam
?
course_id
=
$
{
item
.
course_id
}
&
semester_id
=
$
{
item
.
semester_id
}
&
paper_id
=
$
{
item
.
info
.
id
}
&
type
=
2
&
paper_title
=
$
{
item
.
info
.
paper_title
}
`
} else if (item.type === 2) {
return genCoursePlayerUrl(item)
} else {
return genPreviewUrl(item)
}
}
function targetUrl2(item: CollectionType) {
if (item.type === 7) {
return genCourseViewUrl(item)
} else {
return genCoursePlayerUrl(item)
}
}
return
`/course/player?course_id=
${
item
.
course_id
}
&chapter_id=
${
item
.
chapter_id
}
§ion_id=
${
item
.
section_id
}
&resource_id=
${
item
.
source_id
}
&semester_id=
${
item
.
semester_id
}
`
}
}
</
script
>
</
script
>
...
@@ -114,7 +136,7 @@ function targetUrl(item: CollectionType) {
...
@@ -114,7 +136,7 @@ function targetUrl(item: CollectionType) {
<el-tab-pane
v-for=
"item in tabs"
:label=
"item.label"
:name=
"item.value"
:key=
"item.value"
></el-tab-pane>
<el-tab-pane
v-for=
"item in tabs"
:label=
"item.label"
:name=
"item.value"
:key=
"item.value"
></el-tab-pane>
</el-tabs>
</el-tabs>
<el-select
v-model=
"courseActive"
placeholder=
"所属课程"
@
change=
"handleCourseChange"
clearable
value-key=
"id"
>
<el-select
v-model=
"courseActive"
placeholder=
"所属课程"
@
change=
"handleCourseChange"
clearable
value-key=
"id"
>
<el-option
v-for=
"item in courseList"
:key=
"item.id"
:label=
"item.name"
:value=
"item"
/>
<el-option
v-for=
"item in courseList"
:key=
"item.id"
:label=
"item.
course_alias_name || item.
name"
:value=
"item"
/>
</el-select>
</el-select>
<ul
v-if=
"list.length"
>
<ul
v-if=
"list.length"
>
<li
class=
"collection-item"
v-for=
"item in list"
:key=
"item.id"
>
<li
class=
"collection-item"
v-for=
"item in list"
:key=
"item.id"
>
...
@@ -124,7 +146,12 @@ function targetUrl(item: CollectionType) {
...
@@ -124,7 +146,12 @@ function targetUrl(item: CollectionType) {
{{
item
.
info
.
name
||
item
.
info
.
paper_title
}}
{{
item
.
info
.
name
||
item
.
info
.
paper_title
}}
</router-link>
</router-link>
</p>
</p>
<p>
{{
item
.
course
.
name
}}
/
{{
item
.
chapter
.
name
}}
</p>
<p>
<router-link
:to=
"targetUrl2(item)"
target=
"_blank"
>
{{
item
.
course
.
course_alias_name
||
item
.
course
.
name
}}
<template
v-if=
"item.type !== 7"
>
/
{{
item
.
chapter
.
name
}}
</
template
>
</router-link>
</p>
<div
class=
"collection-item-aside"
>
<div
class=
"collection-item-aside"
>
<div
class=
"video-duration"
v-if=
"item.type === 2"
>
<div
class=
"video-duration"
v-if=
"item.type === 2"
>
{{ formatDuration(item.info.length) }}
{{ formatDuration(item.info.length) }}
...
...
src/types.ts
浏览文件 @
6f2daa4a
...
@@ -33,6 +33,7 @@ export interface CourseType {
...
@@ -33,6 +33,7 @@ export interface CourseType {
is_top
:
number
is_top
:
number
lecturers
?:
LecturerType
[]
lecturers
?:
LecturerType
[]
name
:
string
name
:
string
course_alias_name
:
string
online_type
:
number
online_type
:
number
previous_preparation
:
string
previous_preparation
:
string
represent
:
string
represent
:
string
...
...
编写
预览
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论