Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
X
xiaomai-cloud-class-web
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
xiaomai-cloud-class
xiaomai-cloud-class-web
Commits
ffaaa96d
Commit
ffaaa96d
authored
May 25, 2021
by
guomingpang
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
feat:外部课程相关模块提交
parent
34887728
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
92 additions
and
62 deletions
+92
-62
src/modules/course-manage/video-course/components/VideoCourseList.jsx
+9
-1
src/modules/course-manage/video-course/index.jsx
+13
-2
src/modules/plan-manage/modal/relatedCourseModal.jsx
+70
-59
No files found.
src/modules/course-manage/video-course/components/VideoCourseList.jsx
View file @
ffaaa96d
...
...
@@ -64,7 +64,15 @@ class VideoCourseList extends React.Component {
return
(
<
div
className=
'record__item'
>
{
/* 上传了封面的话就用上传的封面, 没有的话就取视频的第一帧 */
}
<
img
className=
'course-cover'
src=
{
coverUrl
||
`${scheduleVideoUrl}?x-oss-process=video/snapshot,t_0,m_fast`
}
alt=
''
/>
<
img
className=
'course-cover'
src=
{
coverUrl
||
type
===
'internal'
?
`${scheduleVideoUrl}?x-oss-process=video/snapshot,t_0,m_fast`
:
'https://image.xiaomaiketang.com/xm/mt3ZQRxGKB.png'
}
alt=
''
/>
<
Choose
>
<
When
condition=
{
record
.
courseName
.
length
>
25
}
>
<
Tooltip
title=
{
record
.
courseName
}
>
...
...
src/modules/course-manage/video-course/index.jsx
View file @
ffaaa96d
...
...
@@ -2,7 +2,7 @@
* @Author: 吴文洁
* @Date: 2020-08-05 10:08:06
* @LastEditors: fusanqiasng
* @LastEditTime: 2021-05-25 1
2:00:56
* @LastEditTime: 2021-05-25 1
8:08:10
* @Description: 云课堂-视频课入口页面
* @Copyright: 杭州杰竞科技有限公司 版权所有
*/
...
...
@@ -51,6 +51,12 @@ class VideoCourse extends React.Component {
CourseService
.
videoSchedulePage
(
query
).
then
((
res
)
=>
{
const
{
result
=
{}
}
=
res
||
{}
const
{
records
=
[],
total
=
0
}
=
result
if
(
query
.
size
*
(
query
.
current
-
1
)
>=
Number
(
total
))
{
this
.
handleFetchScheduleList
({
current
:
1
})
return
}
this
.
setState
({
dataSource
:
records
,
totalCount
:
Number
(
total
)
...
...
@@ -58,9 +64,14 @@ class VideoCourse extends React.Component {
})
}
currenTabChange
=
(
currentTabKey
)
=>
{
const
{
query
}
=
this
.
state
this
.
setState
(
{
currentTabKey
currentTabKey
,
query
:
{
...
query
,
current
:
1
}
},
()
=>
{
this
.
handleFetchScheduleList
()
...
...
src/modules/plan-manage/modal/relatedCourseModal.jsx
View file @
ffaaa96d
...
...
@@ -369,6 +369,7 @@ class SelectOperatorModal extends React.Component {
// 请求表头
parseVideoColumns
=
()
=>
{
const
{
videoCourseDivision
}
=
this
.
state
const
columns
=
[
{
title
:
(
...
...
@@ -389,7 +390,16 @@ class SelectOperatorModal extends React.Component {
return
(
<
div
className=
'course-info'
>
{
/* 上传了封面的话就用上传的封面, 没有的话就取视频的第一帧 */
}
<
img
className=
'course-cover'
src=
{
coverUrl
||
`${scheduleVideoUrl}?x-oss-process=video/snapshot,t_0,m_fast`
}
alt=
''
/>
<
img
className=
'course-cover'
src=
{
coverUrl
||
videoCourseDivision
===
'internal'
?
`${scheduleVideoUrl}?x-oss-process=video/snapshot,t_0,m_fast`
:
'https://image.xiaomaiketang.com/xm/mt3ZQRxGKB.png'
}
alt=
''
/>
<
div
className=
'course-name'
>
{
record
.
courseName
}
</
div
>
</
div
>
)
...
...
@@ -685,29 +695,25 @@ class SelectOperatorModal extends React.Component {
<
div
>
<
Tabs
type=
'line'
defaultActiveKey=
'
video
'
defaultActiveKey=
'
live
'
onChange=
{
(
activeKey
)
=>
{
this
.
setState
({
activeKey
:
activeKey
})
}
}
>
<
TabPane
tab=
'视频课'
key=
'video'
>
<
Radio
.
Group
value=
{
videoCourseDivision
}
onChange=
{
this
.
videoCourseDivisionChange
}
style=
{
{
marginBottom
:
8
}
}
>
<
Radio
.
Button
value=
'internal'
>
内部课程
</
Radio
.
Button
>
<
Radio
.
Button
value=
'external'
>
外部课程
</
Radio
.
Button
>
</
Radio
.
Group
>
<
TabPane
tab=
'直播课'
key=
'live'
>
<
div
className=
'search-container'
>
<
Search
value=
{
videoSearchDefalt
}
enterButton=
{
<
span
className=
'icon iconfont'
>

</
span
>
}
placeholder=
'搜索课程名称'
style=
{
{
width
:
200
}
}
onChange=
{
(
e
)
=>
{
this
.
handleChang
Video
CourseName
(
e
.
target
.
value
)
this
.
handleChang
Live
CourseName
(
e
.
target
.
value
)
}
}
onSearch=
{
()
=>
{
this
.
handleFetch
Video
DataList
()
this
.
handleFetch
Live
DataList
()
}
}
/>
</
div
>
<
div
className=
'select-area'
>
<
div
className=
'select-box'
>
<
div
>
...
...
@@ -728,81 +734,77 @@ class SelectOperatorModal extends React.Component {
</
div
>
<
div
>
<
Table
rowKey=
{
(
record
)
=>
record
.
i
d
}
dataSource=
{
videoDataSource
[
videoCourseDivision
]
}
columns=
{
this
.
parse
Video
Columns
()
}
rowKey=
{
(
record
)
=>
record
.
liveCourseI
d
}
dataSource=
{
liveDataSource
}
columns=
{
this
.
parse
Live
Columns
()
}
pagination=
{
false
}
bordered
rowSelection=
{
{
type
:
'checkbox'
,
selectedRowKeys
:
_
.
pluck
(
select
Video
[
videoCourseDivision
],
'i
d'
),
selectedRowKeys
:
_
.
pluck
(
select
Live
,
'liveCourseI
d'
),
onSelect
:
(
record
,
selected
)
=>
{
this
.
select
Video
List
(
record
,
selected
)
this
.
select
Live
List
(
record
,
selected
)
},
onSelectAll
:
(
selected
,
_selectedRows
,
changeRows
)
=>
{
let
_list
=
[]
if
(
selected
)
{
_list
=
_
.
uniq
(
select
Video
[
videoCourseDivision
].
concat
(
changeRows
),
false
,
(
item
)
=>
item
.
i
d
)
_list
=
_
.
uniq
(
select
Live
.
concat
(
changeRows
),
false
,
(
item
)
=>
item
.
liveCourseI
d
)
}
else
{
_list
=
_
.
reject
(
select
Video
[
videoCourseDivision
],
(
item
)
=>
_
.
find
(
changeRows
,
(
data
)
=>
data
.
id
===
item
.
i
d
))
_list
=
_
.
reject
(
select
Live
,
(
item
)
=>
_
.
find
(
changeRows
,
(
data
)
=>
data
.
liveCourseId
===
item
.
liveCourseI
d
))
}
if
(
_list
.
length
+
currentTaskCourseData
.
length
+
select
Live
.
length
+
selectPicture
.
length
>
20
)
{
if
(
_list
.
length
+
currentTaskCourseData
.
length
+
select
Video
.
length
+
selectPicture
.
length
>
20
)
{
message
.
warning
(
'无法继续选择,一个任务最多关联20个课程'
)
const
extraLength
=
_list
.
length
+
currentTaskCourseData
.
length
+
select
Live
.
length
+
selectPicture
.
length
-
20
const
extraLength
=
_list
.
length
+
currentTaskCourseData
.
length
+
select
Video
.
length
+
selectPicture
.
length
-
20
_list
.
splice
(
_list
.
length
-
extraLength
,
extraLength
)
}
this
.
setState
({
selectVideo
:
{
...
selectVideo
,
[
videoCourseDivision
]:
_list
}
})
this
.
setState
({
selectLive
:
_list
})
}
}
}
/>
{
videoDataSource
[
videoCourseDivision
]
.
length
>
0
&&
(
{
liveDataSource
.
length
>
0
&&
(
<
div
className=
'box-footer'
>
<
PageControl
current=
{
videoQuery
[
videoCourseDivision
]
.
current
-
1
}
pageSize=
{
videoSize
[
videoCourseDivision
]
}
current=
{
liveQuery
.
current
-
1
}
pageSize=
{
liveSize
}
size=
'small'
total=
{
videoTotalCount
[
videoCourseDivision
]
}
total=
{
liveTotalCount
}
toPage=
{
(
page
)
=>
{
const
_query
=
{
...
videoQuery
[
videoCourseDivision
],
current
:
page
+
1
}
const
_query
=
{
...
liveQuery
,
current
:
page
+
1
}
this
.
setState
(
{
videoQuery
:
{
...
videoQuery
,
[
videoCourseDivision
]:
_query
}
liveQuery
:
_query
},
()
=>
{
this
.
handleFetch
Video
DataList
()
this
.
handleFetch
Live
DataList
()
}
)
}
}
onShowSizeChange=
{
this
.
onShow
Video
SizeChange
}
onShowSizeChange=
{
this
.
onShow
Live
SizeChange
}
/>
</
div
>
)
}
</
div
>
</
TabPane
>
<
TabPane
tab=
'直播课'
key=
'live'
>
<
TabPane
tab=
'视频课'
key=
'video'
>
<
Radio
.
Group
value=
{
videoCourseDivision
}
onChange=
{
this
.
videoCourseDivisionChange
}
style=
{
{
marginBottom
:
8
}
}
>
<
Radio
.
Button
value=
'internal'
>
内部课程
</
Radio
.
Button
>
<
Radio
.
Button
value=
'external'
>
外部课程
</
Radio
.
Button
>
</
Radio
.
Group
>
<
div
className=
'search-container'
>
<
Search
value=
{
videoSearchDefalt
}
enterButton=
{
<
span
className=
'icon iconfont'
>

</
span
>
}
placeholder=
'搜索课程名称'
style=
{
{
width
:
200
}
}
onChange=
{
(
e
)
=>
{
this
.
handleChang
Live
CourseName
(
e
.
target
.
value
)
this
.
handleChang
Video
CourseName
(
e
.
target
.
value
)
}
}
onSearch=
{
()
=>
{
this
.
handleFetch
Live
DataList
()
this
.
handleFetch
Video
DataList
()
}
}
/>
</
div
>
<
div
className=
'select-area'
>
<
div
className=
'select-box'
>
<
div
>
...
...
@@ -823,52 +825,61 @@ class SelectOperatorModal extends React.Component {
</
div
>
<
div
>
<
Table
rowKey=
{
(
record
)
=>
record
.
liveCourseI
d
}
dataSource=
{
liveDataSource
}
columns=
{
this
.
parse
Live
Columns
()
}
rowKey=
{
(
record
)
=>
record
.
i
d
}
dataSource=
{
videoDataSource
[
videoCourseDivision
]
}
columns=
{
this
.
parse
Video
Columns
()
}
pagination=
{
false
}
bordered
rowSelection=
{
{
type
:
'checkbox'
,
selectedRowKeys
:
_
.
pluck
(
select
Live
,
'liveCourseI
d'
),
selectedRowKeys
:
_
.
pluck
(
select
Video
[
videoCourseDivision
],
'i
d'
),
onSelect
:
(
record
,
selected
)
=>
{
this
.
select
Live
List
(
record
,
selected
)
this
.
select
Video
List
(
record
,
selected
)
},
onSelectAll
:
(
selected
,
_selectedRows
,
changeRows
)
=>
{
let
_list
=
[]
if
(
selected
)
{
_list
=
_
.
uniq
(
select
Live
.
concat
(
changeRows
),
false
,
(
item
)
=>
item
.
liveCourseI
d
)
_list
=
_
.
uniq
(
select
Video
[
videoCourseDivision
].
concat
(
changeRows
),
false
,
(
item
)
=>
item
.
i
d
)
}
else
{
_list
=
_
.
reject
(
select
Live
,
(
item
)
=>
_
.
find
(
changeRows
,
(
data
)
=>
data
.
liveCourseId
===
item
.
liveCourseI
d
))
_list
=
_
.
reject
(
select
Video
[
videoCourseDivision
],
(
item
)
=>
_
.
find
(
changeRows
,
(
data
)
=>
data
.
id
===
item
.
i
d
))
}
if
(
_list
.
length
+
currentTaskCourseData
.
length
+
select
Video
.
length
+
selectPicture
.
length
>
20
)
{
if
(
_list
.
length
+
currentTaskCourseData
.
length
+
select
Live
.
length
+
selectPicture
.
length
>
20
)
{
message
.
warning
(
'无法继续选择,一个任务最多关联20个课程'
)
const
extraLength
=
_list
.
length
+
currentTaskCourseData
.
length
+
select
Video
.
length
+
selectPicture
.
length
-
20
const
extraLength
=
_list
.
length
+
currentTaskCourseData
.
length
+
select
Live
.
length
+
selectPicture
.
length
-
20
_list
.
splice
(
_list
.
length
-
extraLength
,
extraLength
)
}
this
.
setState
({
selectLive
:
_list
})
this
.
setState
({
selectVideo
:
{
...
selectVideo
,
[
videoCourseDivision
]:
_list
}
})
}
}
}
/>
{
liveDataSource
.
length
>
0
&&
(
{
videoDataSource
[
videoCourseDivision
]
.
length
>
0
&&
(
<
div
className=
'box-footer'
>
<
PageControl
current=
{
liveQuery
.
current
-
1
}
pageSize=
{
liveSize
}
current=
{
videoQuery
[
videoCourseDivision
]
.
current
-
1
}
pageSize=
{
videoSize
[
videoCourseDivision
]
}
size=
'small'
total=
{
liveTotalCount
}
total=
{
videoTotalCount
[
videoCourseDivision
]
}
toPage=
{
(
page
)
=>
{
const
_query
=
{
...
liveQuery
,
current
:
page
+
1
}
const
_query
=
{
...
videoQuery
[
videoCourseDivision
],
current
:
page
+
1
}
this
.
setState
(
{
liveQuery
:
_query
videoQuery
:
{
...
videoQuery
,
[
videoCourseDivision
]:
_query
}
},
()
=>
{
this
.
handleFetch
Live
DataList
()
this
.
handleFetch
Video
DataList
()
}
)
}
}
onShowSizeChange=
{
this
.
onShow
Live
SizeChange
}
onShowSizeChange=
{
this
.
onShow
Video
SizeChange
}
/>
</
div
>
)
}
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment