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
ca32bda3
Commit
ca32bda3
authored
May 25, 2021
by
guomingpang
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
feat:外部课程相关模块提交
parent
741bd6ee
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
100 additions
and
84 deletions
+100
-84
src/modules/course-manage/video-course/components/VideoCourseList.jsx
+3
-3
src/modules/knowledge-base/modal/AddCourse.jsx
+94
-79
src/modules/plan-manage/modal/relatedCourseModal.jsx
+3
-2
No files found.
src/modules/course-manage/video-course/components/VideoCourseList.jsx
View file @
ca32bda3
...
...
@@ -61,15 +61,15 @@ class VideoCourseList extends React.Component {
fixed
:
'left'
,
render
:
(
val
,
record
)
=>
{
const
{
coverUrl
,
scheduleVideoUrl
}
=
record
console
.
log
(
'coverUrl'
,
coverUrl
)
return
(
<
div
className=
'record__item'
>
{
/* 上传了封面的话就用上传的封面, 没有的话就取视频的第一帧 */
}
<
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'
coverUrl
||
(
type
===
'internal'
?
`${scheduleVideoUrl}?x-oss-process=video/snapshot,t_0,m_fast`
:
'https://image.xiaomaiketang.com/xm/mt3ZQRxGKB.png'
)
}
alt=
''
/>
...
...
src/modules/knowledge-base/modal/AddCourse.jsx
View file @
ca32bda3
...
...
@@ -3,7 +3,11 @@
* @Author: zangsuyun
* @Date: 2021-03-13 09:54:26
* @LastEditors: fusanqiasng
* @LastEditTime: 2021-05-25 11:49:22
<<<<<<< HEAD
* @LastEditTime: 2021-05-28 13:18:39
=======
* @LastEditTime: 2021-05-25 21:48:22
>>>>>>> beb2d0f (featru:外部课程冒烟测试bug修复)
* @Copyright: © 2020 杭州杰竞科技有限公司 版权所有
*/
...
...
@@ -25,23 +29,23 @@ const courseStateShow = {
UN_START
:
{
code
:
1
,
title
:
'待开课'
,
color
:
'#FFB714'
color
:
'#FFB714'
,
},
STARTING
:
{
code
:
2
,
title
:
'上课中'
,
color
:
'#238FFF'
color
:
'#238FFF'
,
},
FINISH
:
{
code
:
3
,
title
:
'已完成'
,
color
:
'#3BBDAA'
color
:
'#3BBDAA'
,
},
EXPIRED
:
{
code
:
4
,
title
:
'未成功开课'
,
color
:
'#999'
}
color
:
'#999'
,
}
,
}
class
AddCourse
extends
React
.
Component
{
...
...
@@ -55,7 +59,7 @@ class AddCourse extends React.Component {
excludeUsed
:
true
,
courseType
:
'LIVE'
,
storeId
:
User
.
getStoreId
(),
toRefKnowledgeCategoryId
:
this
.
props
.
categoryId
toRefKnowledgeCategoryId
:
this
.
props
.
categoryId
,
},
liveTotalCount
:
0
,
selectLive
:
[],
//弹窗内已选择的直播课程
...
...
@@ -63,21 +67,21 @@ class AddCourse extends React.Component {
videoCourseDivision
:
'internal'
,
videoDataSource
:
{
external
:
[],
internal
:
[]
internal
:
[]
,
},
videoSize
:
{
external
:
10
,
internal
:
10
internal
:
10
,
},
videoSearchDefalt
:
{
external
:
{
categoryId
:
''
,
courseName
:
''
courseName
:
''
,
},
internal
:
{
categoryId
:
''
,
courseName
:
''
}
courseName
:
''
,
}
,
},
videoQuery
:
{
...
...
@@ -88,7 +92,7 @@ class AddCourse extends React.Component {
courseType
:
'VOICE'
,
excludeUsed
:
true
,
storeId
:
User
.
getStoreId
(),
toRefKnowledgeCategoryId
:
this
.
props
.
categoryId
toRefKnowledgeCategoryId
:
this
.
props
.
categoryId
,
},
internal
:
{
categoryId
:
''
,
...
...
@@ -97,20 +101,20 @@ class AddCourse extends React.Component {
courseType
:
'VOICE'
,
excludeUsed
:
true
,
storeId
:
User
.
getStoreId
(),
toRefKnowledgeCategoryId
:
this
.
props
.
categoryId
}
toRefKnowledgeCategoryId
:
this
.
props
.
categoryId
,
}
,
},
videoTotalCount
:
{
external
:
0
,
internal
:
0
internal
:
0
,
},
selectVideo
:
{
external
:
[],
internal
:
[]
internal
:
[]
,
},
//弹窗内已选择的视频课程
currentVideoCourseListData
:
{
external
:
[],
internal
:
[]
internal
:
[]
,
},
//页面中已关联的视频课程
pictureDataSource
:
[],
...
...
@@ -120,12 +124,12 @@ class AddCourse extends React.Component {
excludeUsed
:
true
,
courseType
:
'PICTURE'
,
storeId
:
User
.
getStoreId
(),
toRefKnowledgeCategoryId
:
this
.
props
.
categoryId
toRefKnowledgeCategoryId
:
this
.
props
.
categoryId
,
},
pictureTotalCount
:
0
,
selectPicture
:
[],
//弹窗内已选择的图文课程
categoryList
:
[],
//内部分类列表
categoryListExternal
:
[]
//外部分类列表
categoryListExternal
:
[]
,
//外部分类列表
}
}
componentDidMount
()
{
...
...
@@ -139,25 +143,25 @@ class AddCourse extends React.Component {
queryCategoryTree
=
(
categoryName
)
=>
{
let
query
=
{
storeId
:
User
.
getStoreId
(),
withCount
:
false
withCount
:
false
,
}
let
queryInternal
=
{
bizType
:
'QUESTION'
,
source
:
2
,
tenantId
:
User
.
getStoreId
(),
userId
:
User
.
getStoreUserId
(),
count
:
false
count
:
false
,
}
AidToolService
.
queryExternalCategoryTree
(
queryInternal
).
then
((
res
)
=>
{
const
{
categoryList
=
[]
}
=
res
.
result
this
.
setState
({
categoryListExternal
:
this
.
renderTreeNodes
(
categoryList
)
categoryListExternal
:
this
.
renderTreeNodes
(
categoryList
)
,
})
})
KnowledgeAPI
.
getCategoryTree
(
query
).
then
((
res
)
=>
{
const
{
categoryList
=
[]
}
=
res
.
result
this
.
setState
({
categoryList
:
this
.
renderTreeNodes
(
categoryList
)
categoryList
:
this
.
renderTreeNodes
(
categoryList
)
,
})
})
}
...
...
@@ -187,7 +191,7 @@ class AddCourse extends React.Component {
const
params
=
{
...
liveQuery
,
size
:
liveSize
size
:
liveSize
,
}
// CourseService.getLiveCloudCoursePage(params).then((res) => {
...
...
@@ -196,7 +200,7 @@ class AddCourse extends React.Component {
const
{
records
=
[],
total
=
0
}
=
result
this
.
setState
({
liveDataSource
:
records
,
liveTotalCount
:
Number
(
total
)
liveTotalCount
:
Number
(
total
)
,
})
})
}
...
...
@@ -208,7 +212,7 @@ class AddCourse extends React.Component {
const
params
=
{
...
videoQuery
[
videoCourseDivision
],
size
:
videoSize
[
videoCourseDivision
],
courseDivision
:
videoCourseDivision
===
'internal'
?
'INTERNAL'
:
'EXTERNAL'
courseDivision
:
videoCourseDivision
===
'internal'
?
'INTERNAL'
:
'EXTERNAL'
,
}
// CourseService.videoSchedulePage(query).then((res) => {
...
...
@@ -218,12 +222,12 @@ class AddCourse extends React.Component {
this
.
setState
({
videoDataSource
:
{
...
videoDataSource
,
[
videoCourseDivision
]:
records
[
videoCourseDivision
]:
records
,
},
videoTotalCount
:
{
...
videoTotalCount
,
[
videoCourseDivision
]:
Number
(
total
)
}
[
videoCourseDivision
]:
Number
(
total
)
,
}
,
})
})
}
...
...
@@ -234,7 +238,7 @@ class AddCourse extends React.Component {
const
params
=
{
...
pictureQuery
,
size
:
pictureSize
size
:
pictureSize
,
}
// CourseService.pictureSchedulePage(query).then((res) => {
...
...
@@ -243,7 +247,7 @@ class AddCourse extends React.Component {
const
{
records
=
[],
total
=
0
}
=
result
this
.
setState
({
pictureDataSource
:
records
,
pictureTotalCount
:
Number
(
total
)
pictureTotalCount
:
Number
(
total
)
,
})
})
}
...
...
@@ -254,7 +258,7 @@ class AddCourse extends React.Component {
}
this
.
setState
(
{
liveSize
:
size
liveSize
:
size
,
},
()
=>
{
this
.
handleFetchLiveList
()
...
...
@@ -268,7 +272,7 @@ class AddCourse extends React.Component {
}
this
.
setState
(
{
videoSize
:
size
videoSize
:
size
,
},
()
=>
{
this
.
handleFetchVideoList
()
...
...
@@ -282,7 +286,7 @@ class AddCourse extends React.Component {
}
this
.
setState
(
{
pictureSize
:
size
pictureSize
:
size
,
},
()
=>
{
this
.
handleFetchPictureList
()
...
...
@@ -303,7 +307,7 @@ class AddCourse extends React.Component {
marginLeft
:
'5px'
,
cursor
:
'pointer'
,
color
:
'#bfbfbf'
,
fontSize
:
'14px'
fontSize
:
'14px'
,
}
}
>

</
i
>
...
...
@@ -340,7 +344,7 @@ class AddCourse extends React.Component {
className=
'course-status'
style=
{
{
color
:
courseStateShow
[
record
.
courseState
].
color
,
border
:
`1px solid ${courseStateShow[record.courseState].color}`
border
:
`1px solid ${courseStateShow[record.courseState].color}`
,
}
}
>
{
courseStateShow
[
record
.
courseState
].
title
}
</
span
>
...
...
@@ -348,7 +352,7 @@ class AddCourse extends React.Component {
</
div
>
</
div
>
)
}
}
,
},
{
title
:
'上课时间'
,
...
...
@@ -362,7 +366,7 @@ class AddCourse extends React.Component {
{
formatDate
(
'H:i'
,
parseInt
(
item
.
startTime
))
}
~
{
formatDate
(
'H:i'
,
parseInt
(
item
.
endTime
))
}
</
span
>
)
}
}
,
},
{
...
...
@@ -377,8 +381,8 @@ class AddCourse extends React.Component {
{
record
.
categoryTwoName
?
`-${record.categoryTwoName}`
:
''
}
</
div
>
)
}
}
}
,
}
,
]
return
columns
...
...
@@ -397,7 +401,7 @@ class AddCourse extends React.Component {
marginLeft
:
'5px'
,
cursor
:
'pointer'
,
color
:
'#bfbfbf'
,
fontSize
:
'14px'
fontSize
:
'14px'
,
}
}
>

</
i
>
...
...
@@ -412,7 +416,18 @@ class AddCourse extends React.Component {
return
(
<
div
className=
'record__item'
>
{
/* 上传了封面的话就用上传的封面, 没有的话就取视频的第一帧 */
}
<
img
className=
'course-cover'
src=
{
coverUrl
||
`${mediaCourseUrl}?x-oss-process=video/snapshot,t_0,m_fast`
}
alt=
''
/>
<
img
className=
'course-cover'
src=
{
coverUrl
||
(
videoCourseDivision
===
'internal'
?
`${mediaCourseUrl}?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
}
>
...
...
@@ -425,7 +440,7 @@ class AddCourse extends React.Component {
</
Choose
>
</
div
>
)
}
}
,
},
{
title
:
'课程时长'
,
...
...
@@ -434,7 +449,7 @@ class AddCourse extends React.Component {
dataIndex
:
'videoDuration'
,
render
:
(
text
,
item
)
=>
{
return
<
span
>
{
text
?
dealTimeDuration
(
text
)
:
'-'
}
</
span
>
}
}
,
},
{
...
...
@@ -448,8 +463,8 @@ class AddCourse extends React.Component {
{
record
.
categoryTwoName
?
`-${record.categoryTwoName}`
:
''
}
</
div
>
)
}
}
}
,
}
,
]
return
columns
}
...
...
@@ -467,7 +482,7 @@ class AddCourse extends React.Component {
marginLeft
:
'5px'
,
cursor
:
'pointer'
,
color
:
'#bfbfbf'
,
fontSize
:
'14px'
fontSize
:
'14px'
,
}
}
>

</
i
>
...
...
@@ -495,7 +510,7 @@ class AddCourse extends React.Component {
</
Choose
>
</
div
>
)
}
}
,
},
{
title
:
'课程分类'
,
...
...
@@ -508,8 +523,8 @@ class AddCourse extends React.Component {
{
record
.
categoryTwoName
?
`-${record.categoryTwoName}`
:
''
}
</
div
>
)
}
}
}
,
}
,
]
return
columns
}
...
...
@@ -540,8 +555,8 @@ class AddCourse extends React.Component {
this
.
setState
({
selectVideo
:
{
...
selectVideo
,
[
videoCourseDivision
]:
_list
}
[
videoCourseDivision
]:
_list
,
}
,
})
}
...
...
@@ -569,7 +584,7 @@ class AddCourse extends React.Component {
this
.
setState
(
{
videoQuery
,
videoSearchDefalt
videoSearchDefalt
,
},
()
=>
{
this
.
handleFetchVideoList
()
...
...
@@ -581,7 +596,7 @@ class AddCourse extends React.Component {
const
{
videoSearchDefalt
,
videoCourseDivision
}
=
this
.
state
videoSearchDefalt
[
videoCourseDivision
].
courseName
=
e
.
target
.
value
this
.
setState
({
videoSearchDefalt
videoSearchDefalt
,
})
}
...
...
@@ -591,7 +606,7 @@ class AddCourse extends React.Component {
liveQuery
.
current
=
1
this
.
setState
(
{
liveQuery
liveQuery
,
},
()
=>
{
this
.
handleFetchLiveList
()
...
...
@@ -605,7 +620,7 @@ class AddCourse extends React.Component {
pictureQuery
.
current
=
1
this
.
setState
(
{
pictureQuery
pictureQuery
,
},
()
=>
{
this
.
handleFetchPictureList
()
...
...
@@ -621,7 +636,7 @@ class AddCourse extends React.Component {
refIds
:
_
.
pluck
(
selectVideo
,
'id'
),
storeId
:
User
.
getStoreId
(),
type
:
'VOICE'
,
createId
:
User
.
getStoreUserId
()
createId
:
User
.
getStoreUserId
()
,
})
}
if
(
selectLive
.
length
)
{
...
...
@@ -630,7 +645,7 @@ class AddCourse extends React.Component {
refIds
:
_
.
pluck
(
selectLive
,
'liveCourseId'
),
storeId
:
User
.
getStoreId
(),
type
:
'LIVE'
,
createId
:
User
.
getStoreUserId
()
createId
:
User
.
getStoreUserId
()
,
})
}
if
(
selectPicture
.
length
)
{
...
...
@@ -639,7 +654,7 @@ class AddCourse extends React.Component {
refIds
:
_
.
pluck
(
selectPicture
,
'id'
),
storeId
:
User
.
getStoreId
(),
type
:
'PICTURE'
,
createId
:
User
.
getStoreUserId
()
createId
:
User
.
getStoreUserId
()
,
})
}
...
...
@@ -661,9 +676,9 @@ class AddCourse extends React.Component {
...
videoSearchDefalt
,
[
e
.
target
.
value
]:
{
courseName
:
videoQuery
[
e
.
target
.
value
].
courseName
,
categoryId
:
videoQuery
[
e
.
target
.
value
].
categoryId
}
}
categoryId
:
videoQuery
[
e
.
target
.
value
].
categoryId
,
}
,
}
,
},
()
=>
{
this
.
handleFetchVideoList
()
...
...
@@ -703,7 +718,7 @@ class AddCourse extends React.Component {
selectPicture
,
videoSearchDefalt
,
categoryList
,
categoryListExternal
categoryListExternal
,
}
=
this
.
state
const
LiveSelection
=
{
...
...
@@ -717,7 +732,7 @@ class AddCourse extends React.Component {
_list
=
_
.
reject
(
selectLive
,
(
item
)
=>
_
.
find
(
changeRows
,
(
data
)
=>
data
.
liveCourseId
===
item
.
liveCourseId
))
}
this
.
setState
({
selectLive
:
_list
})
}
}
,
}
const
VideoSelection
=
{
...
...
@@ -733,10 +748,10 @@ class AddCourse extends React.Component {
this
.
setState
({
selectVideo
:
{
...
selectVideo
,
[
videoCourseDivision
]:
_list
}
[
videoCourseDivision
]:
_list
,
}
,
})
}
}
,
}
const
PictureSelection
=
{
...
...
@@ -751,7 +766,7 @@ class AddCourse extends React.Component {
_list
=
_
.
reject
(
selectPicture
,
(
item
)
=>
_
.
find
(
changeRows
,
(
data
)
=>
data
.
id
===
item
.
id
))
}
this
.
setState
({
selectPicture
:
_list
})
}
}
,
}
return
(
...
...
@@ -800,10 +815,10 @@ class AddCourse extends React.Component {
this
.
setState
({
selectVideo
:
{
internal
:
[],
external
:
[]
external
:
[]
,
},
selectLive
:
[],
selectPicture
:
[]
selectPicture
:
[]
,
})
}
}
/>
...
...
@@ -832,8 +847,8 @@ class AddCourse extends React.Component {
{
videoQuery
:
{
...
videoQuery
,
[
videoCourseDivision
]:
_query
}
[
videoCourseDivision
]:
_query
,
}
,
},
()
=>
{
this
.
handleFetchVideoList
()
...
...
@@ -882,10 +897,10 @@ class AddCourse extends React.Component {
this
.
setState
({
selectVideo
:
{
internal
:
[],
external
:
[]
external
:
[]
,
},
selectLive
:
[],
selectPicture
:
[]
selectPicture
:
[]
,
})
}
}
/>
...
...
@@ -910,7 +925,7 @@ class AddCourse extends React.Component {
const
_query
=
{
...
liveQuery
,
current
:
page
+
1
}
this
.
setState
(
{
liveQuery
:
_query
liveQuery
:
_query
,
},
()
=>
{
this
.
handleFetchLiveList
()
...
...
@@ -959,10 +974,10 @@ class AddCourse extends React.Component {
this
.
setState
({
selectVideo
:
{
internal
:
[],
external
:
[]
external
:
[]
,
},
selectLive
:
[],
selectPicture
:
[]
selectPicture
:
[]
,
})
}
}
/>
...
...
@@ -987,7 +1002,7 @@ class AddCourse extends React.Component {
const
_query
=
{
...
pictureQuery
,
current
:
page
+
1
}
this
.
setState
(
{
pictureQuery
:
_query
pictureQuery
:
_query
,
},
()
=>
{
this
.
handleFetchPictureList
()
...
...
src/modules/plan-manage/modal/relatedCourseModal.jsx
View file @
ca32bda3
...
...
@@ -393,9 +393,10 @@ class SelectOperatorModal extends React.Component {
<
img
className=
'course-cover'
src=
{
coverUrl
||
videoCourseDivision
===
'internal'
coverUrl
||
(
videoCourseDivision
===
'internal'
?
`${scheduleVideoUrl}?x-oss-process=video/snapshot,t_0,m_fast`
:
'https://image.xiaomaiketang.com/xm/mt3ZQRxGKB.png'
:
'https://image.xiaomaiketang.com/xm/mt3ZQRxGKB.png'
)
}
alt=
''
/>
...
...
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