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
f6dd4e5e
Commit
f6dd4e5e
authored
Dec 16, 2020
by
zhangleyuan
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
feat:解决合并代码后的一些冲突
parent
c233f4f6
Hide whitespace changes
Inline
Side-by-side
Showing
10 changed files
with
446 additions
and
350 deletions
+446
-350
src/components/Breadcrumbs.tsx
+4
-3
src/data-source/course/request-api.ts
+14
-4
src/domains/course-domain/CourseService.ts
+13
-3
src/modules/course-manage/AddLive.jsx
+144
-202
src/modules/course-manage/LiveCoursePage.jsx
+2
-43
src/modules/course-manage/components/AddLiveBasic.jsx
+1
-1
src/modules/course-manage/components/AddLiveClass.jsx
+112
-13
src/modules/course-manage/components/AddLiveIntro.jsx
+2
-2
src/modules/course-manage/components/LiveCourseFilter.jsx
+71
-29
src/modules/course-manage/components/LiveCourseList.jsx
+83
-50
No files found.
src/components/Breadcrumbs.tsx
View file @
f6dd4e5e
...
@@ -28,9 +28,10 @@ const Breadcrumbs = (props: BreadcrumbsProps) => {
...
@@ -28,9 +28,10 @@ const Breadcrumbs = (props: BreadcrumbsProps) => {
const
isArray
=
_
.
isArray
(
navList
);
const
isArray
=
_
.
isArray
(
navList
);
return
(
return
(
<
div
className=
"xm-breadCrumb"
>
<
div
className=
"xm-breadCrumb"
>
<
span
onClick=
{
_onClick
}
className=
"back-btn"
/>
<
span
onClick=
{
_onClick
}
className=
"back-btn"
>
<
LeftOutlined
/>
<
LeftOutlined
/>
<
span
className=
"text ml5"
>
{
text
?
text
:
'返回'
}
</
span
>
<
span
className=
"text ml5"
>
{
text
?
text
:
'返回'
}
</
span
>
</
span
>
<
div
className=
"divide"
></
div
>
<
div
className=
"divide"
></
div
>
<
Breadcrumb
>
<
Breadcrumb
>
{
isString
&&
<
Breadcrumb
.
Item
>
{
navList
}
</
Breadcrumb
.
Item
>
}
{
isString
&&
<
Breadcrumb
.
Item
>
{
navList
}
</
Breadcrumb
.
Item
>
}
...
...
src/data-source/course/request-api.ts
View file @
f6dd4e5e
/*
/*
* @Author: wufan
* @Author: wufan
* @Date: 2020-12-12 11:57:10
* @Date: 2020-12-12 11:57:10
* @LastEditors:
wuf
an
* @LastEditors:
zhangleyu
an
* @LastEditTime: 2020-12-16 15:
01:26
* @LastEditTime: 2020-12-16 15:
49:11
* @Description: Description
* @Description: Description
* @@Copyrigh: © 2020 杭州杰竞科技有限公司 版权所有
* @@Copyrigh: © 2020 杭州杰竞科技有限公司 版权所有
*/
*/
...
@@ -34,4 +34,15 @@ export function exportPlayBackCourseData(params: object) {
...
@@ -34,4 +34,15 @@ export function exportPlayBackCourseData(params: object) {
}
}
export
function
fetchPlaybackList
(
params
:
object
)
{
export
function
fetchPlaybackList
(
params
:
object
)
{
return
Service
.
Hades
(
"public/courseCloud/getUserReplayRecordPage"
,
params
);
return
Service
.
Hades
(
"public/courseCloud/getUserReplayRecordPage"
,
params
);
}
}
\ No newline at end of file
export
function
getLiveCloudCourseDetail
(
params
:
object
)
{
return
Service
.
Hades
(
"public/courseCloud/getLiveCloudCourseDetail"
,
params
);
}
export
function
updateLiveCloudCourse
(
params
:
object
)
{
return
Service
.
Hades
(
"public/courseCloud/updateLiveCloudCourse"
,
params
);
}
export
function
delOrRecoverLiveCloudCourse
(
params
:
object
)
{
return
Service
.
Hades
(
"public/courseCloud/delOrRecoverLiveCloudCourse"
,
params
);
}
src/domains/course-domain/CourseService.ts
View file @
f6dd4e5e
/*
/*
* @Author: wufan
* @Author: wufan
* @Date: 2020-11-25 18:25:02
* @Date: 2020-11-25 18:25:02
* @LastEditors:
wuf
an
* @LastEditors:
zhangleyu
an
* @LastEditTime: 2020-12-1
5 14:27:36
* @LastEditTime: 2020-12-1
6 15:50:43
* @Description: Description
* @Description: Description
* @@Copyrigh: © 2020 杭州杰竞科技有限公司 版权所有
* @@Copyrigh: © 2020 杭州杰竞科技有限公司 版权所有
*/
*/
import
{
fetchLecturerData
,
fetchUserData
,
exportStudentCourseData
,
createLiveCloudCourse
,
getLiveCloudCoursePage
,
exportPlayBackCourseData
,
fetchPlaybackList
}
from
'@/data-source/course/request-api'
;
import
{
fetchLecturerData
,
fetchUserData
,
exportStudentCourseData
,
exportPlayBackCourseData
,
fetchPlaybackList
,
createLiveCloudCourse
,
getLiveCloudCoursePage
,
getLiveCloudCourseDetail
,
updateLiveCloudCourse
,
delOrRecoverLiveCloudCourse
}
from
'@/data-source/course/request-api'
;
export
default
class
courseService
{
export
default
class
courseService
{
// 获取讲师上课数据
// 获取讲师上课数据
...
@@ -40,4 +40,13 @@ export default class courseService {
...
@@ -40,4 +40,13 @@ export default class courseService {
return
fetchPlaybackList
(
params
);
return
fetchPlaybackList
(
params
);
}
}
static
getLiveCloudCourseDetail
(
params
:
any
)
{
return
getLiveCloudCourseDetail
(
params
);
}
static
updateLiveCloudCourse
(
params
:
any
)
{
return
updateLiveCloudCourse
(
params
);
}
static
delOrRecoverLiveCloudCourse
(
params
:
any
)
{
return
delOrRecoverLiveCloudCourse
(
params
);
}
}
}
\ No newline at end of file
src/modules/course-manage/AddLive.jsx
View file @
f6dd4e5e
...
@@ -17,7 +17,6 @@ import AddLiveBasic from './components/AddLiveBasic';
...
@@ -17,7 +17,6 @@ import AddLiveBasic from './components/AddLiveBasic';
import
AddLiveClass
from
'./components/AddLiveClass'
;
import
AddLiveClass
from
'./components/AddLiveClass'
;
import
AddLiveIntro
from
'./components/AddLiveIntro'
;
import
AddLiveIntro
from
'./components/AddLiveIntro'
;
import
PreviewCourseModal
from
'./modal/PreviewCourseModal'
;
import
PreviewCourseModal
from
'./modal/PreviewCourseModal'
;
import
LackConsumeStudentModal
from
'./modal/LackConsumeStudentModal'
;
import
CourseService
from
"@/domains/course-domain/CourseService"
;
import
CourseService
from
"@/domains/course-domain/CourseService"
;
import
moment
from
'moment'
;
import
moment
from
'moment'
;
import
User
from
'@/common/js/user'
;
import
User
from
'@/common/js/user'
;
...
@@ -36,8 +35,8 @@ const defaultBasicInfo = {
...
@@ -36,8 +35,8 @@ const defaultBasicInfo = {
};
};
const
defaultClassInfo
=
{
const
defaultClassInfo
=
{
teacherId
:
null
,
teacherId
:
null
,
//讲师的Id
adminId
:
null
,
adminId
:
null
,
//助教的Id
teacherName
:
null
,
teacherName
:
null
,
liveDate
:
null
,
liveDate
:
null
,
timeHorizonStart
:
null
,
timeHorizonStart
:
null
,
...
@@ -45,7 +44,6 @@ const defaultClassInfo = {
...
@@ -45,7 +44,6 @@ const defaultClassInfo = {
calendarTime
:
[],
calendarTime
:
[],
startTime
:
new
Date
().
getTime
()
+
300000
,
startTime
:
new
Date
().
getTime
()
+
300000
,
endTime
:
new
Date
().
getTime
()
+
300000
,
endTime
:
new
Date
().
getTime
()
+
300000
,
applyMode
:
''
};
};
const
defaultIntroInfo
=
{
const
defaultIntroInfo
=
{
...
@@ -55,55 +53,26 @@ const defaultIntroInfo = {
...
@@ -55,55 +53,26 @@ const defaultIntroInfo = {
liveCourseMediaRequests
:
[{
liveCourseMediaRequests
:
[{
mediaType
:
'TEXT'
,
mediaType
:
'TEXT'
,
mediaContent
:
''
,
mediaContent
:
''
,
// key: editBoxKey
}],
}],
}
}
class
AddLive
extends
React
.
Component
{
class
AddLive
extends
React
.
Component
{
constructor
(
props
)
{
constructor
(
props
)
{
super
(
props
);
super
(
props
);
const
id
=
getParameterByName
(
"id"
);
const
id
=
getParameterByName
(
"id"
);
const
type
=
getParameterByName
(
"type"
);
const
type
=
getParameterByName
(
"type"
);
this
.
state
=
{
this
.
state
=
{
id
,
id
,
type
,
type
,
after
:
false
,
isXiaomai
:
false
,
loading
:
false
,
loading
:
false
,
isEdit
:
true
,
isEdit
:
true
,
selectedAssistant
:
[],
// 已经选择的助教数量
// 直播课基本信息
// 直播课基本信息
addLiveBasicInfo
:
{
addLiveBasicInfo
:
{
courseName
:
null
,
// 课程名称
courseName
:
null
,
// 课程名称
coverId
:
null
,
coverId
:
null
,
coverUrl
:
defaultCover
,
coverUrl
:
defaultCover
,
parentCatalogId
:
''
,
parentCatalogId
:
''
,
sonCatalogId
:
''
,
sonCatalogId
:
''
courseCatalogOption
:[
{
value
:
'1'
,
label
:
'Zhejiang'
,
children
:
[
{
value
:
'2'
,
label
:
'Hangzhou'
,
},
],
},
{
value
:
'3'
,
label
:
'Jiangsu'
,
children
:
[
{
value
:
'4'
,
label
:
'Nanjing'
,
}
],
},
]
},
},
// 直播课上课信息
// 直播课上课信息
...
@@ -114,12 +83,6 @@ class AddLive extends React.Component {
...
@@ -114,12 +83,6 @@ class AddLive extends React.Component {
liveDate
:
null
,
liveDate
:
null
,
timeHorizonStart
:
null
,
timeHorizonStart
:
null
,
timeHorizonEnd
:
null
,
timeHorizonEnd
:
null
,
studentList
:
[],
// 不扣课时学员列表
consumeStudentList
:
[],
// 扣课时学员列表
excludeStudentIds
:
[],
// 已经入库的不扣课时学员
excludeConsumeStudentIds
:
[],
// 已经入口的扣课时学员
assistant
:
[],
// 已经选择的助教老师
applyMode
:
''
,
calendarTime
:
[],
// 批量排课
calendarTime
:
[],
// 批量排课
startTime
:
new
Date
().
getTime
()
+
300000
,
// 批量开始时分
startTime
:
new
Date
().
getTime
()
+
300000
,
// 批量开始时分
endTime
:
new
Date
().
getTime
()
+
300000
// 批量结束时分
endTime
:
new
Date
().
getTime
()
+
300000
// 批量结束时分
...
@@ -132,9 +95,7 @@ class AddLive extends React.Component {
...
@@ -132,9 +95,7 @@ class AddLive extends React.Component {
liveCourseMediaRequests
:
[{
liveCourseMediaRequests
:
[{
mediaType
:
'TEXT'
,
mediaType
:
'TEXT'
,
mediaContent
:
''
,
mediaContent
:
''
,
// key: editBoxKey
}]
}],
isAutoSendReport
:
true
},
},
}
}
}
}
...
@@ -143,110 +104,72 @@ class AddLive extends React.Component {
...
@@ -143,110 +104,72 @@ class AddLive extends React.Component {
const
{
type
}
=
this
.
state
;
const
{
type
}
=
this
.
state
;
if
(
type
===
'edit'
)
{
if
(
type
===
'edit'
)
{
this
.
getCourseDetail
();
this
.
getCourseDetail
();
}
else
{
}
}
}
}
getCourseDetail
=
()
=>
{
getCourseDetail
=
()
=>
{
let
{
isEdit
}
=
this
.
state
;
let
{
isEdit
}
=
this
.
state
;
this
.
setState
({
loading
:
true
});
this
.
setState
({
loading
:
true
});
// axios.Apollo('public/businessLive/getCourseDetail', {
CourseService
.
getLiveCloudCourseDetail
({
// liveCourseId: this.state.id
liveCourseId
:
this
.
state
.
id
// }).then((res) => {
}).
then
((
res
)
=>
{
// const {
const
{
// teacherId,
teacherId
,
// studentIds,
courseName
,
// consumeStudentIds,
coverUrl
,
// courseName,
coverId
,
// coverUrl,
startTime
,
// coverId,
endTime
,
// intro,
courseMediaVOS
,
// courseState,
nickname
,
// startTime,
needRecord
,
// endTime,
warmMedia
,
// liveType,
}
=
res
.
result
;
// adminShowVOList,
// channel,
courseMediaVOS
.
map
((
item
)
=>
{
// podium,
item
.
key
=
window
.
random_string
(
16
);
// courseMediaVOS,
return
item
;
// nickname,
})
// needRecord,
// consumeHourNum,
const
addLiveBasicInfo
=
{
// consumeClassTime,
courseName
,
// warmMedia,
coverId
,
// applyMode,
coverUrl
:
coverUrl
||
defaultCover
,
// autoSendReport
};
// } = res.result;
const
liveDate
=
startTime
;
// const studentList = [];
const
timeHorizonStart
=
startTime
;
const
timeHorizonEnd
=
endTime
;
// _.each(studentIds, (item) => {
const
addLiveClassInfo
=
{
// studentList.push({ studentId: item });
liveDate
,
// });
nickname
,
teacherId
,
// const selectedAssistant = _.map(adminShowVOList, (item) => ({
timeHorizonStart
,
// id: item.adminId,
timeHorizonEnd
,
// adminName: item.adminName,
startTime
,
// }));
endTime
,
}
// const assistantId = _.pluck(adminShowVOList, "adminId");
const
liveCourseMediaRequests
=
courseMediaVOS
.
length
?
[...
courseMediaVOS
]
// courseMediaVOS.map((item) => {
:
[{
mediaType
:
'TEXT'
,
mediaContent
:
''
,
key
:
window
.
random_string
(
16
)
},
...
courseMediaVOS
];
// item.key = window.random_string(16);
// return item;
// })
// const addLiveBasicInfo = {
// courseName,
// coverId,
// coverUrl: coverUrl || defaultCover,
// };
// const liveDate = startTime;
// const timeHorizonStart = startTime;
// const timeHorizonEnd = endTime;
// const addLiveClassInfo = {
// liveType,
// liveDate,
// nickname,
// teacherId,
// studentList,
// consumeHourNum,
// consumeClassTime,
// consumeStudentList: consumeStudentIds,
// timeHorizonStart,
// timeHorizonEnd,
// assistant: assistantId,
// excludeStudentIds: studentIds,
// excludeConsumeStudentIds: _.pluck(consumeStudentIds, 'studentId'),
// applyMode
// }
// const liveCourseMediaRequests = courseMediaVOS.length
// ? [...courseMediaVOS]
// : [{ mediaType: 'TEXT', mediaContent: '', key: window.random_string(16) }, ...courseMediaVOS];
// const addLiveIntroInfo = {
const
addLiveIntroInfo
=
{
// liveCourseWarmMedia: warmMedia,
liveCourseWarmMedia
:
warmMedia
,
// needRecord,
needRecord
,
// liveCourseMediaRequests,
liveCourseMediaRequests
,
// isAutoSendReport: !!(autoSendReport === "AUTO")
}
// }
// 晚于开课前30分钟
// // 晚于开课前30分钟
if
(
new
Date
().
getTime
()
>
startTime
-
1800000
)
{
// if(new Date().getTime() > startTime - 1800000) {
isEdit
=
false
// isEdit = false
}
// }
this
.
setState
({
// this.setState({
isEdit
,
// isEdit,
loading
:
false
,
// loading: false,
addLiveIntroInfo
,
// selectedAssistant,
addLiveClassInfo
,
// addLiveIntroInfo,
addLiveBasicInfo
,
// addLiveClassInfo,
});
// addLiveBasicInfo,
})
// after: courseState !== "UN_START",
// isXiaomai: channel === "XIAOMAI",
// });
// })
}
}
// 修改基本信息
// 修改基本信息
...
@@ -319,27 +242,18 @@ class AddLive extends React.Component {
...
@@ -319,27 +242,18 @@ class AddLive extends React.Component {
this
.
handleValidate
(
addLiveBasicInfo
,
addLiveClassInfo
,
addLiveIntroInfo
,
isEdit
).
then
((
res
)
=>
{
this
.
handleValidate
(
addLiveBasicInfo
,
addLiveClassInfo
,
addLiveIntroInfo
,
isEdit
).
then
((
res
)
=>
{
if
(
!
res
)
return
;
if
(
!
res
)
return
;
const
{
type
}
=
this
.
state
;
const
{
type
}
=
this
.
state
;
const
{
courseName
,
coverId
,
coverUrl
,
parentCatalogId
}
=
addLiveBasicInfo
;
const
{
courseName
,
coverId
,
coverUrl
,
parentCatalogId
}
=
addLiveBasicInfo
;
const
{
const
{
podium
,
liveType
,
liveDate
,
liveDate
,
teacherId
,
teacherId
,
adminId
,
adminId
,
assistant
,
studentList
,
consumeHourNum
,
timeHorizonEnd
,
timeHorizonEnd
,
consumeClassTime
,
timeHorizonStart
,
timeHorizonStart
,
consumeStudentList
,
applyMode
,
calendarTime
,
calendarTime
,
}
=
addLiveClassInfo
;
}
=
addLiveClassInfo
;
let
{
startTime
,
endTime
}
=
addLiveClassInfo
;
let
{
startTime
,
endTime
}
=
addLiveClassInfo
;
const
{
liveCourseMediaRequests
,
needRecord
,
liveCourseWarmMedia
,
isAutoSendReport
}
=
addLiveIntroInfo
;
const
{
liveCourseMediaRequests
,
needRecord
,
liveCourseWarmMedia
}
=
addLiveIntroInfo
;
if
(
type
===
'add'
)
{
if
(
type
===
'add'
)
{
startTime
=
startTime
;
startTime
=
startTime
;
endTime
=
endTime
;
endTime
=
endTime
;
...
@@ -350,43 +264,45 @@ class AddLive extends React.Component {
...
@@ -350,43 +264,45 @@ class AddLive extends React.Component {
startTime
=
moment
(
_liveDate
+
' '
+
_timeHorizonStart
).
format
(
'x'
);
startTime
=
moment
(
_liveDate
+
' '
+
_timeHorizonStart
).
format
(
'x'
);
endTime
=
moment
(
_liveDate
+
' '
+
_timeHorizonEnd
).
format
(
'x'
);
endTime
=
moment
(
_liveDate
+
' '
+
_timeHorizonEnd
).
format
(
'x'
);
}
}
const
commonParams
=
{
const
commonParams
=
{
adminIds
:[
adminId
],
adminIds
:[
adminId
],
calendarTime
,
calendarTime
,
categoryId
:
parentCatalogId
,
categoryId
:
parentCatalogId
,
endTime
,
endTime
,
needRecord
,
needRecord
,
operatorId
:
User
.
getUserId
(),
startTime
,
startTime
,
storeId
:
User
.
getUserId
(),
courseName
:
courseName
.
trim
(),
courseName
:
courseName
.
trim
(),
storeId
:
User
.
getStoreId
(),
storeId
:
User
.
getStoreId
(),
teacherId
:
teacherId
,
teacherId
:
teacherId
,
}
}
if
(
type
===
'add'
)
{
if
(
type
===
'add'
)
{
const
params
=
{
const
params
=
{
...
commonParams
,
...
commonParams
,
operatorId
:
User
.
getUserId
(),
}
}
CourseService
.
createLiveCloudCourse
(
params
).
then
((
res
)
=>
{
CourseService
.
createLiveCloudCourse
(
params
).
then
((
res
)
=>
{
if
(
res
.
success
){
if
(
res
.
success
){
message
.
success
(
"新建成功"
);
message
.
success
(
"新建成功"
);
window
.
RCHistory
.
goBack
();
}
}
});
});
}
else
{
}
else
{
const
params
=
{
const
params
=
{
...
commonParams
,
...
commonParams
,
updateUserId
:
User
.
getUserId
(),
liveCourseId
:
id
,
liveCourseId
:
id
,
}
}
if
(
params
.
liveCourseWarmMedia
&&
!
params
.
liveCourseWarmMedia
.
mediaUrl
)
{
// if(params.liveCourseWarmMedia && !params.liveCourseWarmMedia.mediaUrl) {
delete
params
.
liveCourseWarmMedia
// delete params.liveCourseWarmMedia
}
// }
axios
.
Apollo
(
"public/businessLive/updateCourse"
,
params
).
then
((
res
)
=>
{
CourseService
.
updateLiveCloudCourse
(
params
).
then
((
res
)
=>
{
message
.
success
(
"更新成功"
);
if
(
res
.
success
){
this
.
setState
({
loading
:
false
});
message
.
success
(
"更新成功"
);
window
.
RCHistory
.
goBack
();
window
.
RCHistory
.
goBack
();
}
});
});
}
}
})
})
...
@@ -398,7 +314,7 @@ class AddLive extends React.Component {
...
@@ -398,7 +314,7 @@ class AddLive extends React.Component {
console
.
log
(
"addLiveBasicInfo"
,
addLiveBasicInfo
);
console
.
log
(
"addLiveBasicInfo"
,
addLiveBasicInfo
);
const
{
courseName
,
parentCatalogId
}
=
addLiveBasicInfo
;
const
{
courseName
,
parentCatalogId
}
=
addLiveBasicInfo
;
const
{
const
{
liveDate
,
timeHorizonStart
,
timeHorizonEnd
,
teacherId
,
calendarTime
,
consumeStudentList
,
consumeHourNum
,
consumeClassTime
,
applyMode
liveDate
,
timeHorizonStart
,
timeHorizonEnd
,
teacherId
,
calendarTime
}
=
addLiveClassInfo
;
}
=
addLiveClassInfo
;
const
{
liveCourseMediaRequests
}
=
addLiveIntroInfo
;
const
{
liveCourseMediaRequests
}
=
addLiveIntroInfo
;
...
@@ -413,40 +329,73 @@ class AddLive extends React.Component {
...
@@ -413,40 +329,73 @@ class AddLive extends React.Component {
resolve
(
false
);
resolve
(
false
);
return
;
return
;
}
}
const
{
startTime
,
endTime
}
=
addLiveClassInfo
;
if
(
type
===
'add'
)
{
if
(
calendarTime
.
length
===
0
)
{
const
{
startTime
,
endTime
}
=
addLiveClassInfo
;
message
.
warning
(
'请选择上课日期'
);
if
(
calendarTime
.
length
&&
calendarTime
.
length
===
0
)
{
resolve
(
false
);
message
.
warning
(
'请选择上课日期'
);
return
;
resolve
(
false
);
}
else
if
(
startTime
===
endTime
)
{
return
;
message
.
warning
(
'结束时间必须晚于开始时间'
);
}
else
if
(
startTime
===
endTime
)
{
resolve
(
false
);
message
.
warning
(
'结束时间必须晚于开始时间'
);
return
;
resolve
(
false
);
}
return
;
// 若有今日排课 校验当前时间
}
const
currentDay
=
moment
(
currentTime
).
format
(
'YYYY-MM-DD'
);
// 若有今日排课 校验当前时间
const
itemToday
=
_
.
find
(
calendarTime
,
(
item
)
=>
{
const
currentDay
=
moment
(
currentTime
).
format
(
'YYYY-MM-DD'
);
const
itemDay
=
moment
(
item
).
format
(
'YYYY-MM-DD'
);
const
itemToday
=
_
.
find
(
calendarTime
,
(
item
)
=>
{
return
itemDay
===
currentDay
;
const
itemDay
=
moment
(
item
).
format
(
'YYYY-MM-DD'
);
})
return
itemDay
===
currentDay
;
if
(
itemToday
)
{
})
const
itemDay
=
moment
(
itemToday
).
format
(
'YYYY-MM-DD'
);
if
(
itemToday
)
{
const
itemHour
=
moment
(
startTime
).
format
(
'HH:mm'
);
const
itemDay
=
moment
(
itemToday
).
format
(
'YYYY-MM-DD'
);
if
(
itemDay
===
currentDay
)
{
const
itemHour
=
moment
(
startTime
).
format
(
'HH:mm'
);
if
(
moment
(
itemDay
+
' '
+
itemHour
).
format
(
'x'
)
<
currentTime
)
{
if
(
itemDay
===
currentDay
)
{
message
.
warning
(
'开始时间不能早于现在'
);
if
(
moment
(
itemDay
+
' '
+
itemHour
).
format
(
'x'
)
<
currentTime
)
{
resolve
(
false
);
message
.
warning
(
'开始时间不能早于现在'
);
return
;
resolve
(
false
);
return
;
}
}
}
}
}
}
else
{
const
_liveDate
=
moment
(
liveDate
).
format
(
"YYYY-MM-DD"
);
const
_timeHorizonStart
=
moment
(
timeHorizonStart
).
format
(
'HH:mm'
);
const
_timeHorizonEnd
=
moment
(
timeHorizonEnd
).
format
(
'HH:mm'
);
const
startTime
=
moment
(
_liveDate
+
' '
+
_timeHorizonStart
).
format
(
'x'
);
const
endTime
=
moment
(
_liveDate
+
' '
+
_timeHorizonEnd
).
format
(
'x'
);
if
(
!
startTime
||
!
endTime
)
{
message
.
warning
(
'日期不能为空'
);
resolve
(
false
);
return
;
}
else
if
(
!
timeHorizonStart
)
{
message
.
warning
(
'开始时间不能为空'
);
resolve
(
false
);
return
;
}
else
if
(
!
timeHorizonEnd
)
{
message
.
warning
(
'结束时间不能为空'
);
resolve
(
false
);
return
;
}
else
if
(
isEdit
&&
startTime
<
currentTime
)
{
message
.
warning
(
'开始时间不能早于当前时间'
);
resolve
(
false
);
return
;
}
else
if
(
isEdit
&&
endTime
<
currentTime
)
{
message
.
warning
(
'结束时间不能早于当前时间'
);
resolve
(
false
);
return
;
}
else
if
(
isEdit
&&
endTime
<=
startTime
)
{
message
.
warning
(
"结束时间不能早于开始时间"
);
resolve
(
false
);
return
;
}
}
if
(
!
teacherId
){
message
.
warning
(
'上课老师不能为空'
);
resolve
(
false
);
return
;
}
}
resolve
(
true
)
resolve
(
true
)
// if(consumeClassTime > (endTime - startTime) / 60000) {
// message.warning('到课规则时长不能超过排课时长');
// resolve(false);
// return;
// }
// if(!teacherId) {
// if(!teacherId) {
// message.warning('上课老师不能为空');
// message.warning('上课老师不能为空');
// resolve(false);
// resolve(false);
...
@@ -496,6 +445,7 @@ class AddLive extends React.Component {
...
@@ -496,6 +445,7 @@ class AddLive extends React.Component {
// 取消编辑并返回上一级路由
// 取消编辑并返回上一级路由
handleGoBack
=
()
=>
{
handleGoBack
=
()
=>
{
console
.
log
(
'111'
);
// 比较state的addLiveBasicInfo, addLiveClassInfo, addLiveIntroInfo和默认数据是否相等
// 比较state的addLiveBasicInfo, addLiveClassInfo, addLiveIntroInfo和默认数据是否相等
const
{
addLiveBasicInfo
,
addLiveClassInfo
,
addLiveIntroInfo
}
=
this
.
state
;
const
{
addLiveBasicInfo
,
addLiveClassInfo
,
addLiveIntroInfo
}
=
this
.
state
;
if
(
!
_
.
isEqual
(
addLiveBasicInfo
,
defaultBasicInfo
)
||
if
(
!
_
.
isEqual
(
addLiveBasicInfo
,
defaultBasicInfo
)
||
...
@@ -513,7 +463,6 @@ class AddLive extends React.Component {
...
@@ -513,7 +463,6 @@ class AddLive extends React.Component {
}
}
})
})
}
else
{
}
else
{
// 直接返回
window
.
RCHistory
.
goBack
();
window
.
RCHistory
.
goBack
();
}
}
}
}
...
@@ -521,7 +470,7 @@ class AddLive extends React.Component {
...
@@ -521,7 +470,7 @@ class AddLive extends React.Component {
render
()
{
render
()
{
const
{
const
{
id
,
type
,
after
,
isXiaomai
,
selectedAssistant
,
id
,
type
,
addLiveBasicInfo
,
addLiveClassInfo
,
addLiveIntroInfo
,
addLiveBasicInfo
,
addLiveClassInfo
,
addLiveIntroInfo
,
isEdit
isEdit
}
=
this
.
state
;
}
=
this
.
state
;
...
@@ -540,7 +489,6 @@ class AddLive extends React.Component {
...
@@ -540,7 +489,6 @@ class AddLive extends React.Component {
<
div
className=
"basic-info__wrap"
>
<
div
className=
"basic-info__wrap"
>
<
div
className=
"title"
>
基本信息
</
div
>
<
div
className=
"title"
>
基本信息
</
div
>
<
AddLiveBasic
<
AddLiveBasic
liveScene=
"large"
isEdit=
{
isEdit
}
isEdit=
{
isEdit
}
data=
{
addLiveBasicInfo
}
data=
{
addLiveBasicInfo
}
onChange=
{
this
.
handleChangeBasicInfo
}
onChange=
{
this
.
handleChangeBasicInfo
}
...
@@ -550,13 +498,9 @@ class AddLive extends React.Component {
...
@@ -550,13 +498,9 @@ class AddLive extends React.Component {
<
div
className=
"class-info__wrap"
>
<
div
className=
"class-info__wrap"
>
<
div
className=
"title"
>
上课信息
</
div
>
<
div
className=
"title"
>
上课信息
</
div
>
<
AddLiveClass
<
AddLiveClass
liveScene=
"large"
isEdit=
{
isEdit
}
isEdit=
{
isEdit
}
after=
{
after
}
pageType=
{
type
}
pageType=
{
type
}
isXiaomai=
{
isXiaomai
}
data=
{
{...
addLiveClassInfo
,
id
}
}
data=
{
{...
addLiveClassInfo
,
id
}
}
selectedAssistant=
{
selectedAssistant
}
onChange=
{
this
.
handleChangeClassInfo
}
onChange=
{
this
.
handleChangeClassInfo
}
/>
/>
</
div
>
</
div
>
...
@@ -564,10 +508,8 @@ class AddLive extends React.Component {
...
@@ -564,10 +508,8 @@ class AddLive extends React.Component {
<
div
className=
"intro-info__wrap"
>
<
div
className=
"intro-info__wrap"
>
<
div
className=
"title"
>
更多信息
</
div
>
<
div
className=
"title"
>
更多信息
</
div
>
<
AddLiveIntro
<
AddLiveIntro
liveScene=
"large"
isEdit=
{
isEdit
}
isEdit=
{
isEdit
}
data=
{
addLiveIntroInfo
}
data=
{
addLiveIntroInfo
}
isXiaomai=
{
isXiaomai
}
onChange=
{
this
.
handleChangeIntroInfo
}
onChange=
{
this
.
handleChangeIntroInfo
}
/>
/>
</
div
>
</
div
>
...
...
src/modules/course-manage/LiveCoursePage.jsx
View file @
f6dd4e5e
...
@@ -9,13 +9,11 @@ class LiveCoursePage extends React.Component {
...
@@ -9,13 +9,11 @@ class LiveCoursePage extends React.Component {
constructor
(
props
)
{
constructor
(
props
)
{
super
(
props
);
super
(
props
);
// const { instId, teacherId } = window.currentUserInstInfo;
this
.
state
=
{
this
.
state
=
{
courseList
:
[],
// 直播课列表
courseList
:
[],
// 直播课列表
query
:
{
query
:
{
current
:
1
,
current
:
1
,
size
:
10
,
size
:
10
,
storeId
:
User
.
getStoreId
()
},
},
total
:
0
,
total
:
0
,
loading
:
true
,
loading
:
true
,
...
@@ -26,10 +24,9 @@ class LiveCoursePage extends React.Component {
...
@@ -26,10 +24,9 @@ class LiveCoursePage extends React.Component {
}
}
// 获取直播课列表
// 获取直播课列表
handleFetchLiveList
=
(
_query
)
=>
{
handleFetchLiveList
=
(
_query
)
=>
{
const
{
query
}
=
this
.
state
;
const
params
=
{
const
params
=
{
...
query
,
...
_query
,
...
_query
,
storeId
:
User
.
getStoreId
()
};
};
this
.
setState
({
query
:
params
});
this
.
setState
({
query
:
params
});
CourseService
.
getLiveCloudCoursePage
(
params
).
then
((
res
)
=>
{
CourseService
.
getLiveCloudCoursePage
(
params
).
then
((
res
)
=>
{
...
@@ -42,49 +39,11 @@ class LiveCoursePage extends React.Component {
...
@@ -42,49 +39,11 @@ class LiveCoursePage extends React.Component {
this
.
setState
({
loading
:
false
});
this
.
setState
({
loading
:
false
});
});
});
}
}
// handleFetchLiveList= (_query) => {
// const _courseList=[
// {
// applyMode: "ANYONE",
// autoSendReport: "AUTO",
// channel: "XIAOMAI",
// consumeClassTime: 30,
// consumeHourNum: 1,
// courseDocumentCount: 0,
// courseMediaVOS: [],
// courseName: "0988",
// courseState: "EXPIRED",
// createdReport: "INVALID",
// endTime: 1607515751000,
// haveRecord: "NO",
// instId: "1213001850820476929",
// intro: "",
// liveCourseId: "1336612757182279681",
// liveType: "LARGE_CLASS_LIVE",
// needRecord: "YES",
// nickname: "张莹",
// podium: 0,
// quota: 1,
// roomId: 9984,
// startTime: 1607508551000,
// teacherId: "1226497609046880257",
// thirdPartType: "TENCENT",
// whetherRecord: "YES",
// }
// ];
// this.setState({
// courseList: _courseList,
// total:1
// });
// }
render
()
{
render
()
{
const
{
query
,
total
,
courseList
}
=
this
.
state
;
const
{
query
,
total
,
courseList
}
=
this
.
state
;
return
(
return
(
<
div
className=
"page big-live-page"
>
<
div
className=
"page big-live-page"
>
<
div
className=
"content-header"
>
大班直播
</
div
>
<
div
className=
"content-header"
>
直播课
</
div
>
<
div
className=
"box"
>
<
div
className=
"box"
>
<
LiveCourseFilter
<
LiveCourseFilter
onChange=
{
this
.
handleFetchLiveList
}
onChange=
{
this
.
handleFetchLiveList
}
...
...
src/modules/course-manage/components/AddLiveBasic.jsx
View file @
f6dd4e5e
...
@@ -77,7 +77,7 @@ class AddLiveBasic extends React.Component {
...
@@ -77,7 +77,7 @@ class AddLiveBasic extends React.Component {
}
}
render
()
{
render
()
{
const
{
showCutModal
,
imageFile
,
courseCatalogList
}
=
this
.
state
;
const
{
showCutModal
,
imageFile
,
courseCatalogList
}
=
this
.
state
;
const
{
data
,
liveScene
}
=
this
.
props
;
const
{
data
}
=
this
.
props
;
const
{
courseName
,
coverUrl
}
=
data
;
const
{
courseName
,
coverUrl
}
=
data
;
const
fileName
=
''
;
const
fileName
=
''
;
...
...
src/modules/course-manage/components/AddLiveClass.jsx
View file @
f6dd4e5e
...
@@ -7,7 +7,7 @@
...
@@ -7,7 +7,7 @@
*/
*/
import
React
from
'react'
;
import
React
from
'react'
;
import
{
TimePicker
,
Select
,
Spin
,
Tooltip
}
from
'antd'
;
import
{
TimePicker
,
Select
,
Spin
,
Tooltip
,
DatePicker
}
from
'antd'
;
import
{
InfoCircleFilled
}
from
'@ant-design/icons'
;
import
{
InfoCircleFilled
}
from
'@ant-design/icons'
;
import
StoreService
from
"@/domains/store-domain/storeService"
;
import
StoreService
from
"@/domains/store-domain/storeService"
;
...
@@ -124,25 +124,21 @@ class AddLiveClass extends React.Component {
...
@@ -124,25 +124,21 @@ class AddLiveClass extends React.Component {
assistantQuery
assistantQuery
}
=
this
.
state
;
}
=
this
.
state
;
const
{
pageType
,
liveScene
,
data
,
selectedAssistant
,
isXiaomai
,
isEdit
,
after
}
=
this
.
props
;
const
{
pageType
,
data
,
isEdit
}
=
this
.
props
;
const
{
const
{
endTime
,
endTime
,
startTime
,
startTime
,
studentList
,
consumeStudentList
,
calendarTime
,
calendarTime
,
teacherId
,
liveDate
,
timeHorizonStart
,
timeHorizonEnd
}
=
data
;
}
=
data
;
// 已选择的上课学员数量(不扣课时)
console
.
log
(
"teacherId"
,
teacherId
);
const
hasSelectedStu
=
studentList
.
length
;
// 已选择的上课学员数量(扣课时)
const
hasSelectedDeductionStu
=
consumeStudentList
.
length
;
return
(
return
(
<
Spin
spinning=
{
loading
}
>
<
Spin
spinning=
{
loading
}
>
<
div
className=
"add-live__class-info"
>
<
div
className=
"add-live__class-info"
>
<
div
className=
"course"
>
{
/*
<div className="course">
<div className="day">
<div className="day">
<span className="label">
<span className="label">
<span className="require">*</span>
<span className="require">*</span>
...
@@ -192,12 +188,113 @@ class AddLiveClass extends React.Component {
...
@@ -192,12 +188,113 @@ class AddLiveClass extends React.Component {
}}
}}
/>
/>
</div>
</div>
</div> */
}
{
pageType
===
'add'
&&
<
div
className=
"course"
>
<
div
className=
"day"
>
<
span
className=
"label"
>
<
span
className=
"require"
>
*
</
span
>
上课日期
<
Tooltip
overlayStyle=
{
{
maxWidth
:
300
,
zIndex
:
'9999'
}
}
title=
{
<
div
style=
{
{
width
:
'266px'
}
}
>
支持按上课日期批量创建直播课,创建后按“课程名称_日期”命名,例如:
<
br
/>
张三的语文课_9月18日
<
br
/>
张三的语文课_9月19日......
</
div
>
}
>
<
span
className=
"iconfont"
>

</
span
>
</
Tooltip
>
:
</
span
>
<
div
>
<
div
className=
'select-day'
>
已选
<
span
className=
"mark-day"
>
{
isLongArr
(
calendarTime
)
?
calendarTime
.
length
:
0
}
</
span
>
天
</
div
>
<
MultipleDatePicker
selectDateList=
{
calendarTime
}
onSelect=
{
this
.
selectMultiDate
}
canSelectTodayBefore=
{
false
}
/>
</
div
>
</
div
>
<
div
className=
"hour"
id=
"hour"
>
<
span
className=
"label"
><
span
className=
"require"
>
*
</
span
>
上课时间:
</
span
>
<
TimePicker
format=
"HH:mm"
value=
{
startTime
?
moment
(
startTime
)
:
null
}
placeholder=
"开始时间"
style=
{
{
width
:
100
,
minWidth
:
100
}
}
onChange=
{
(
time
)
=>
{
this
.
props
.
onChange
(
'startTime'
,
time
);
}
}
/>
~
<
TimePicker
format=
"HH:mm"
value=
{
endTime
?
moment
(
endTime
)
:
null
}
placeholder=
"结束时间"
style=
{
{
width
:
100
,
minWidth
:
100
}
}
onChange=
{
(
time
)
=>
{
this
.
props
.
onChange
(
'endTime'
,
time
)
}
}
/>
</
div
>
</
div
>
}
{
pageType
===
'edit'
&&
<
div
className=
"time"
id=
"time"
>
<
div
className=
"content"
>
<
span
className=
"label"
><
span
className=
"require"
>
*
</
span
>
上课时间:
</
span
>
<
DatePicker
disabled=
{
!
isEdit
}
format=
"YYYY-MM-DD"
value=
{
liveDate
?
moment
(
Number
(
liveDate
))
:
null
}
style=
{
{
width
:
160
,
minWidth
:
130
,
marginRight
:
10
}
}
placeholder=
"上课日期"
getCalendarContainer=
{
()
=>
document
.
getElementById
(
"time"
)
}
disabledDate=
{
this
.
disabledDate
}
onChange=
{
(
date
)
=>
{
this
.
props
.
onChange
(
'liveDate'
,
date
)
}
}
/>
<
TimePicker
disabled=
{
!
isEdit
}
format=
"HH:mm"
value=
{
timeHorizonStart
?
moment
(
Number
(
timeHorizonStart
))
:
null
}
defaultOpenValue=
{
moment
(
new
Date
().
setHours
(
0
,
0
,
0
,
0
))
}
placeholder=
"开始时间"
style=
{
{
width
:
100
,
minWidth
:
100
,
marginRight
:
10
}
}
getPopupContainer=
{
()
=>
document
.
getElementById
(
"time"
)
}
onChange=
{
(
time
)
=>
{
this
.
props
.
onChange
(
'timeHorizonStart'
,
time
)
}
}
/>
<
TimePicker
disabled=
{
!
isEdit
}
format=
"HH:mm"
value=
{
timeHorizonEnd
?
moment
(
Number
(
timeHorizonEnd
))
:
null
}
defaultOpenValue=
{
moment
(
new
Date
().
setHours
(
0
,
0
,
0
,
0
))
}
placeholder=
"结束时间"
style=
{
{
width
:
100
,
minWidth
:
100
}
}
getPopupContainer=
{
()
=>
document
.
getElementById
(
"time"
)
}
onChange=
{
(
time
)
=>
{
this
.
props
.
onChange
(
'timeHorizonEnd'
,
time
)
}
}
/>
</
div
>
</
div
>
</
div
>
}
<
div
className=
"teacher"
>
<
div
className=
"teacher"
>
<
span
className=
"label"
><
span
className=
"require"
>
*
</
span
>
讲师:
</
span
>
<
span
className=
"label"
><
span
className=
"require"
>
*
</
span
>
讲师:
</
span
>
<
Select
<
Select
placeholder=
"请选择讲师"
placeholder=
"请选择讲师"
style=
{
{
width
:
240
,
marginTop
:
6
}
}
style=
{
{
width
:
240
,
marginTop
:
6
}
}
showSearch
allowClear
value=
{
teacherId
}
filterOption=
{
(
input
,
option
)
=>
option
}
filterOption=
{
(
input
,
option
)
=>
option
}
onPopupScroll=
{
this
.
handleScrollTeacherList
}
onPopupScroll=
{
this
.
handleScrollTeacherList
}
onChange=
{
(
value
)
=>
{
onChange=
{
(
value
)
=>
{
...
@@ -208,7 +305,7 @@ class AddLiveClass extends React.Component {
...
@@ -208,7 +305,7 @@ class AddLiveClass extends React.Component {
this
.
setState
({
this
.
setState
({
teacherQuery
teacherQuery
},
()
=>
{
},
()
=>
{
this
.
handleScroll
TeacherList
()
this
.
get
TeacherList
()
})
})
}
}
}
}
>
>
...
@@ -224,6 +321,8 @@ class AddLiveClass extends React.Component {
...
@@ -224,6 +321,8 @@ class AddLiveClass extends React.Component {
<
Select
<
Select
id=
"assistant"
id=
"assistant"
placeholder=
"请选择助教老师"
placeholder=
"请选择助教老师"
showSearch
allowClear
style=
{
{
width
:
240
,
marginTop
:
6
}
}
style=
{
{
width
:
240
,
marginTop
:
6
}
}
filterOption=
{
(
input
,
option
)
=>
option
}
filterOption=
{
(
input
,
option
)
=>
option
}
onPopupScroll=
{
this
.
handleScrollAssistantList
}
onPopupScroll=
{
this
.
handleScrollAssistantList
}
...
...
src/modules/course-manage/components/AddLiveIntro.jsx
View file @
f6dd4e5e
...
@@ -207,7 +207,7 @@ class AddLiveIntro extends React.Component {
...
@@ -207,7 +207,7 @@ class AddLiveIntro extends React.Component {
}
}
render
()
{
render
()
{
const
{
liveScene
,
liveType
,
isXiaomai
,
isEdit
,
data
:
{
introduction
,
needRecord
,
whetherRecord
,
liveCourseMediaRequests
=
[],
liveCourseWarmMedia
=
{},
isAutoSendReport
}
}
=
this
.
props
;
const
{
liveType
,
isXiaomai
,
isEdit
,
data
:
{
introduction
,
needRecord
,
whetherRecord
,
liveCourseMediaRequests
=
[],
liveCourseWarmMedia
=
{},
isAutoSendReport
}
}
=
this
.
props
;
const
{
showCutModal
,
warmUrl
,
showSelectFileModal
,
diskList
,
imageFile
}
=
this
.
state
const
{
showCutModal
,
warmUrl
,
showSelectFileModal
,
diskList
,
imageFile
}
=
this
.
state
return
(
return
(
<
div
className=
"add-live__intro-info"
>
<
div
className=
"add-live__intro-info"
>
...
@@ -269,7 +269,7 @@ class AddLiveIntro extends React.Component {
...
@@ -269,7 +269,7 @@ class AddLiveIntro extends React.Component {
</
div
>
</
div
>
<
div
className=
"opt-btns"
>
<
div
className=
"opt-btns"
>
<
Button
<
Button
disabled=
{
liveScene
===
'large'
&&
!
isEdit
}
disabled=
{
!
isEdit
}
onClick=
{
()
=>
{
onClick=
{
()
=>
{
this
.
setState
({
this
.
setState
({
showSelectFileModal
:
true
showSelectFileModal
:
true
...
...
src/modules/course-manage/components/LiveCourseFilter.jsx
View file @
f6dd4e5e
...
@@ -13,7 +13,8 @@ import Bus from '@/core/bus';
...
@@ -13,7 +13,8 @@ import Bus from '@/core/bus';
import
TeacherSearchSelect
from
"@/modules/common/TeacherSearchSelect"
;
import
TeacherSearchSelect
from
"@/modules/common/TeacherSearchSelect"
;
import
RangePicker
from
"@/modules/common/DateRangePicker"
;
import
RangePicker
from
"@/modules/common/DateRangePicker"
;
import
moment
from
'moment'
;
import
StoreService
from
"@/domains/store-domain/storeService"
;
import
'./LiveCourseFilter.less'
;
import
'./LiveCourseFilter.less'
;
const
{
Search
}
=
Input
;
const
{
Search
}
=
Input
;
...
@@ -22,31 +23,57 @@ const { Option } = Select;
...
@@ -22,31 +23,57 @@ const { Option } = Select;
const
defaultQuery
=
{
const
defaultQuery
=
{
courseName
:
null
,
courseName
:
null
,
startTime
:
null
,
startTime
:
null
,
teacher
Name
:
null
,
teacher
Id
:
null
,
courseState
:
null
,
courseState
:
null
,
shelfState
:
null
,
shelfState
:
null
,
}
}
const
defaultTeacherQuery
=
{
size
:
10
,
current
:
1
,
nickName
:
null
}
class
LiveCourseFilter
extends
React
.
Component
{
class
LiveCourseFilter
extends
React
.
Component
{
constructor
(
props
)
{
constructor
(
props
)
{
super
(
props
);
super
(
props
);
this
.
state
=
{
this
.
state
=
{
query
:
{...
defaultQuery
},
query
:
{...
defaultQuery
},
teacherQuery
:
defaultTeacherQuery
,
teacherList
:[],
expandFilter
:
false
expandFilter
:
false
}
}
}
}
componentDidMount
()
{
componentWillReceiveProps
(
nextProps
)
{
this
.
getTeacherList
();
const
{
match
:
{
path
}
}
=
nextProps
;
}
const
{
match
:
{
path
:
curPath
}
}
=
this
.
props
;
getTeacherList
(
current
=
1
,
selectList
){
if
(
path
!==
curPath
)
{
const
{
teacherQuery
,
teacherList
}
=
this
.
state
;
this
.
setState
({
const
_query
=
{
query
:
{...
defaultQuery
}
...
teacherQuery
,
})
current
,
size
:
10
};
StoreService
.
getEmployeeList
(
_query
).
then
((
res
)
=>
{
const
{
result
=
{}
}
=
res
;
const
{
records
=
[],
total
=
0
,
hasNext
}
=
result
;
const
list
=
current
>
1
?
teacherList
.
concat
(
records
)
:
records
;
this
.
setState
({
hasNext
,
teacherList
:
list
,
})
});
}
// 滑动加载更多讲师列表
handleScrollTeacherList
=
(
e
)
=>
{
const
{
hasNext
}
=
this
.
state
;
const
container
=
e
.
target
;
const
scrollToBottom
=
container
&&
container
.
scrollHeight
<=
container
.
clientHeight
+
container
.
scrollTop
;
if
(
scrollToBottom
&&
hasNext
)
{
const
{
teacherQuery
}
=
this
.
state
;
this
.
getTeacherList
(
teacherQuery
.
current
+
1
);
}
}
}
}
// 改变搜索条件
// 改变搜索条件
handleChangeQuery
=
(
field
,
value
)
=>
{
handleChangeQuery
=
(
field
,
value
)
=>
{
this
.
setState
({
this
.
setState
({
...
@@ -117,7 +144,7 @@ class LiveCourseFilter extends React.Component {
...
@@ -117,7 +144,7 @@ class LiveCourseFilter extends React.Component {
courseState
,
teacherName
,
teacherId
,
courseState
,
teacherName
,
teacherId
,
shelfState
shelfState
}
=
this
.
state
.
query
;
}
=
this
.
state
.
query
;
const
{
expandFilter
}
=
this
.
state
;
const
{
expandFilter
,
teacherList
,
teacherQuery
}
=
this
.
state
;
const
{
teacherId
:
_teahcerId
}
=
{};
const
{
teacherId
:
_teahcerId
}
=
{};
const
isTeacher
=
!!
_teahcerId
;
// 判断是否是老师身份
const
isTeacher
=
!!
_teahcerId
;
// 判断是否是老师身份
...
@@ -147,20 +174,35 @@ class LiveCourseFilter extends React.Component {
...
@@ -147,20 +174,35 @@ class LiveCourseFilter extends React.Component {
style=
{
{
width
:
"calc(100% - 70px)"
}
}
style=
{
{
width
:
"calc(100% - 70px)"
}
}
/>
/>
</
div
>
</
div
>
<
div
className=
"search-condition__item"
>
{
!
isTeacher
&&
<
span
>
讲师:
</
span
>
<
div
className=
"search-condition__item"
>
<
Select
<
TeacherSearchSelect
placeholder=
"请选择讲师"
id=
"teacher_select"
style=
{
{
width
:
240
,
marginTop
:
6
}
}
ref=
"TeacherSelect"
showSearch
label=
"讲师"
allowClear
placeholder=
"请选择"
filterOption=
{
(
input
,
option
)
=>
option
}
teacherName=
{
teacherName
}
onPopupScroll=
{
this
.
handleScrollTeacherList
}
onSelect=
{
this
.
handleSelectTeacher
}
onChange=
{
(
value
)
=>
{
defaultValue=
{
teacherId
}
this
.
handleChangeQuery
(
'teacherId'
,
value
)
/>
}
}
</
div
>
onSearch=
{
(
value
)
=>
{
}
teacherQuery
.
nickName
=
value
this
.
setState
({
teacherQuery
},
()
=>
{
this
.
getTeacherList
()
})
}
}
>
{
_
.
map
(
teacherList
,
(
item
,
index
)
=>
{
return
(
<
Select
.
Option
value=
{
item
.
userId
}
key=
{
item
.
userId
}
>
{
item
.
nickName
}
</
Select
.
Option
>
);
})
}
</
Select
>
</
div
>
{
expandFilter
&&
{
expandFilter
&&
<
div
className=
"search-condition__item"
>
<
div
className=
"search-condition__item"
>
<
span
className=
"select-status"
>
上课状态:
</
span
>
<
span
className=
"select-status"
>
上课状态:
</
span
>
...
@@ -188,8 +230,8 @@ class LiveCourseFilter extends React.Component {
...
@@ -188,8 +230,8 @@ class LiveCourseFilter extends React.Component {
value=
{
shelfState
}
value=
{
shelfState
}
onChange=
{
(
value
)
=>
{
this
.
handleChangeQuery
(
'shelfState'
,
value
)
}
}
onChange=
{
(
value
)
=>
{
this
.
handleChangeQuery
(
'shelfState'
,
value
)
}
}
>
>
<
Option
value=
"
UN_START
"
>
上架中
</
Option
>
<
Option
value=
"
YES
"
>
上架中
</
Option
>
<
Option
value=
"
STARTING
"
>
未上架
</
Option
>
<
Option
value=
"
NO
"
>
未上架
</
Option
>
</
Select
>
</
Select
>
</
div
>
</
div
>
}
}
...
...
src/modules/course-manage/components/LiveCourseList.jsx
View file @
f6dd4e5e
...
@@ -79,7 +79,6 @@ class LiveCourseList extends React.Component {
...
@@ -79,7 +79,6 @@ class LiveCourseList extends React.Component {
getDownloadVersion
()
{
getDownloadVersion
()
{
}
}
// 显示分享弹窗
// 显示分享弹窗
handleShowShareModal
=
(
item
,
needStr
=
false
)
=>
{
handleShowShareModal
=
(
item
,
needStr
=
false
)
=>
{
const
_appId
=
appId
;
const
_appId
=
appId
;
...
@@ -107,7 +106,15 @@ class LiveCourseList extends React.Component {
...
@@ -107,7 +106,15 @@ class LiveCourseList extends React.Component {
this
.
setState
({
shareLiveModal
})
this
.
setState
({
shareLiveModal
})
}
}
//改变上架状态
changeShelfState
=
(
item
)
=>
{
if
(
item
.
shelfState
===
'NO'
){
item
.
shelfState
=
"YES"
}
else
{
}
}
// 前往上课数据页面
// 前往上课数据页面
handleLinkToClassData
=
(
item
)
=>
{
handleLinkToClassData
=
(
item
)
=>
{
// TODOLIST 确定后端是否是根据liveCourseId 返回数据
// TODOLIST 确定后端是否是根据liveCourseId 返回数据
...
@@ -131,7 +138,7 @@ class LiveCourseList extends React.Component {
...
@@ -131,7 +138,7 @@ class LiveCourseList extends React.Component {
const
columns
=
[
const
columns
=
[
{
{
title
:
"直播课"
,
title
:
"直播课"
,
width
:
"2
0
%"
,
width
:
"2
5
%"
,
key
:
"course"
,
key
:
"course"
,
dataIndex
:
"courseName"
,
dataIndex
:
"courseName"
,
render
:
(
val
,
record
)
=>
{
render
:
(
val
,
record
)
=>
{
...
@@ -139,13 +146,13 @@ class LiveCourseList extends React.Component {
...
@@ -139,13 +146,13 @@ class LiveCourseList extends React.Component {
<
div
className=
"record__item"
>
<
div
className=
"record__item"
>
<
img
className=
"course-cover"
src=
{
'https://image.xiaomaiketang.com/xm/YNfi45JwFA.png'
}
/>
<
img
className=
"course-cover"
src=
{
'https://image.xiaomaiketang.com/xm/YNfi45JwFA.png'
}
/>
<
div
>
<
div
>
<
div
className=
"course-name"
>
课程名称
</
div
>
<
div
className=
"course-name"
>
{
record
.
courseName
}
</
div
>
<
div
>
<
div
>
<
span
className=
"course-time"
>
2020-11-09 10:00~11:00
</
span
>
<
span
className=
"course-time"
>
{
formatDate
(
"YYYY-MM-DD H:i"
,
parseInt
(
record
.
startTime
))
}
~
{
formatDate
(
"H:i"
,
parseInt
(
record
.
endTime
))
}
</
span
>
<
span
>
待开课
</
span
>
<
span
>
{
courseStateShow
[
record
.
courseState
].
title
}
</
span
>
</
div
>
</
div
>
<
div
>
<
div
>
<
span
>
讲师:
吴帆
</
span
>
<
span
>
讲师:
{
record
.
teacherName
}
</
span
>
<
span
>
|
</
span
>
<
span
>
|
</
span
>
<
span
>
助教:周晓
</
span
>
<
span
>
助教:周晓
</
span
>
</
div
>
</
div
>
...
@@ -161,7 +168,7 @@ class LiveCourseList extends React.Component {
...
@@ -161,7 +168,7 @@ class LiveCourseList extends React.Component {
dataIndex
:
"couseCatalog"
,
dataIndex
:
"couseCatalog"
,
render
:
(
val
,
item
)
=>
{
render
:
(
val
,
item
)
=>
{
return
(
return
(
<
div
>
一阶培训
</
div
>
<
div
>
{
item
.
categoryName
}
</
div
>
)
)
},
},
},
},
...
@@ -172,7 +179,7 @@ class LiveCourseList extends React.Component {
...
@@ -172,7 +179,7 @@ class LiveCourseList extends React.Component {
dataIndex
:
"courseware"
,
dataIndex
:
"courseware"
,
render
:
(
val
,
item
)
=>
{
render
:
(
val
,
item
)
=>
{
return
(
return
(
<
span
>
2个
</
span
>
<
span
>
{
item
.
courseDocumentCount
}
</
span
>
);
);
},
},
},
},
...
@@ -185,7 +192,7 @@ class LiveCourseList extends React.Component {
...
@@ -185,7 +192,7 @@ class LiveCourseList extends React.Component {
return
(
return
(
<
span
className=
"iconfont icon"
onClick=
{
()
=>
{
<
span
className=
"iconfont icon"
onClick=
{
()
=>
{
this
.
handleLinkToClassData
(
item
)
this
.
handleLinkToClassData
(
item
)
}
}
>

</
span
>
}
}
>

</
span
>
);
);
},
},
},
},
...
@@ -195,51 +202,74 @@ class LiveCourseList extends React.Component {
...
@@ -195,51 +202,74 @@ class LiveCourseList extends React.Component {
dataIndex
:
"courseware"
,
dataIndex
:
"courseware"
,
render
:
(
val
,
item
,
index
)
=>
{
render
:
(
val
,
item
,
index
)
=>
{
return
(
return
(
<
Switch
defaultChecked
/>
<
Switch
checked=
{
item
.
shelfState
===
"YES"
?
true
:
false
}
onChange=
{
()
=>
this
.
changeShelfState
(
item
)
}
/>
)
)
},
},
},
},
{
{
title
:
"操作"
,
title
:
"操作"
,
width
:
"
20
%"
,
width
:
"
15
%"
,
key
:
"operate"
,
key
:
"operate"
,
dataIndex
:
"operate"
,
dataIndex
:
"operate"
,
render
:
(
val
,
item
)
=>
{
render
:
(
val
,
item
)
=>
{
return
(
return
(
<
div
className=
"operate"
>
<
div
className=
"operate"
>
<
div
{
(
item
.
courseState
===
"UN_START"
||
item
.
courseState
===
"STARTING"
)
&&
key=
"enter_live_room1"
<
div
className=
"operate__item"
key=
"enter_live_room1"
onClick=
{
()
=>
{
this
.
handleEnterLiveRoom
(
item
)
}
}
>
进入直播间
</
div
>
<
span
className=
"operate__item split"
key=
"enter_live_room1_split"
>
|
</
span
>
<
div
key=
"view_play_back"
className=
"operate__item"
>
查看回放
</
div
>
<
span
className=
"operate__item split"
key=
"view_play_back_split"
>
|
</
span
>
<
div
key=
"share"
className=
"operate__item"
className=
"operate__item"
onClick=
{
()
=>
{
this
.
handleShowShareModal
(
item
);
}
}
onClick=
{
()
=>
{
this
.
handleEnterLiveRoom
(
item
)
}
}
>
>
进入直播间
分享
</
div
>
</
div
>
<
span
key=
"split1"
className=
"operate__item split"
>
|
</
span
>
}
<
div
className=
"big-live"
>
{
(
item
.
courseState
===
"FINISH"
)
&&
<
Dropdown
overlay=
{
this
.
renderMoreOperate
(
item
)
}
>
<
span
className=
"more-operate"
>
<>
<
span
className=
"operate-text"
>
更多
</
span
>
<
span
className=
"operate__item split"
key=
"enter_live_room1_split"
>
|
</
span
>
<
span
<
div
className=
"iconfont icon"
key=
"view_play_back"
style=
{
{
color
:
"#FC9C6B"
}
}
className=
"operate__item"
>
查看回放
</
div
>
</>
}
{
item
.
courseState
!==
"EXPIRED"
&&
<>
<
span
className=
"operate__item split"
key=
"view_play_back_split"
>
|
</
span
>
<
div
key=
"share"
className=
"operate__item"
onClick=
{
()
=>
{
this
.
handleShowShareModal
(
item
);
}
}
>
>

分享
</
span
>
</
div
>
</
span
>
</>
</
Dropdown
>
}
</
div
>
{
item
.
courseState
!==
"EXPIRED"
&&
<>
<
span
key=
"split1"
className=
"operate__item split"
>
|
</
span
>
<
div
className=
"big-live"
>
<
Dropdown
overlay=
{
this
.
renderMoreOperate
(
item
)
}
>
<
span
className=
"more-operate"
>
<
span
className=
"operate-text"
>
更多
</
span
>
<
span
className=
"iconfont icon"
style=
{
{
color
:
"#FC9C6B"
}
}
>

</
span
>
</
span
>
</
Dropdown
>
</
div
>
</>
}
{
item
.
courseState
===
"EXPIRED"
&&
<
div
className=
"operate__item"
onClick=
{
this
.
handleDelete
}
>
删除
</
div
>
}
</
div
>
</
div
>
)
)
}
}
...
@@ -253,12 +283,14 @@ class LiveCourseList extends React.Component {
...
@@ -253,12 +283,14 @@ class LiveCourseList extends React.Component {
<
div
className=
"live-course-more-menu"
>
<
div
className=
"live-course-more-menu"
>
<
div
<
div
className=
"operate__item"
className=
"operate__item"
onClick=
{
this
.
toEditCoursePage
(
item
)
}
onClick=
{
()
=>
this
.
toEditCoursePage
(
item
)
}
>
编辑
</
div
>
>
编辑
</
div
>
<
div
{
item
.
courseState
!==
"STARTING"
&&
className=
"operate__item"
<
div
onClick=
{
this
.
handleDelete
}
className=
"operate__item"
>
删除
</
div
>
onClick=
{
this
.
handleDelete
}
>
删除
</
div
>
}
</
div
>
</
div
>
)
)
}
}
...
@@ -276,12 +308,13 @@ class LiveCourseList extends React.Component {
...
@@ -276,12 +308,13 @@ class LiveCourseList extends React.Component {
})
})
}
}
deleteConfirm
=
(
item
)
=>
{
deleteConfirm
=
(
item
)
=>
{
message
.
success
(
"已删除"
);
message
.
success
(
"已删除"
);
}
}
toEditCoursePage
=
(
item
)
=>
{
toEditCoursePage
=
(
item
)
=>
{
//
window.RCHistory.push({
window
.
RCHistory
.
push
({
// pathname: '/create-live-course?type=edit'
,
pathname
:
`/create-live-course?type=edit&id=
${
item
.
liveCourseId
}
`
,
//
})
})
}
}
refreshCourseList
=
()
=>
{
refreshCourseList
=
()
=>
{
this
.
props
.
onChange
(
this
.
props
.
query
);
this
.
props
.
onChange
(
this
.
props
.
query
);
...
...
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