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
70a0c2b1
Commit
70a0c2b1
authored
Dec 10, 2020
by
zhangleyuan
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
feat:处理课程管理列表页的显示
parent
a34e604f
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
77 additions
and
98 deletions
+77
-98
src/modules/course-manage/LiveCoursePage.jsx
+41
-6
src/modules/course-manage/components/LiveCourseList.jsx
+36
-92
No files found.
src/modules/course-manage/LiveCoursePage.jsx
View file @
70a0c2b1
import
React
from
'react'
;
import
LiveCourseFilter
from
'./components/LiveCourseFilter'
;
import
LiveCourseOpt
from
'./components/LiveCourseOpt'
;
//
import LiveCourseList from './components/LiveCourseList';
import
LiveCourseList
from
'./components/LiveCourseList'
;
class
LiveCoursePage
extends
React
.
Component
{
...
...
@@ -20,9 +20,9 @@ class LiveCoursePage extends React.Component {
loading
:
true
,
}
}
//
componentWillMount() {
//
this.handleFetchLiveList();
//
}
componentWillMount
()
{
this
.
handleFetchLiveList
();
}
// // 获取直播课列表
// handleFetchLiveList = (_query) => {
// const { query } = this.state;
...
...
@@ -47,6 +47,41 @@ class LiveCoursePage extends React.Component {
// this.setState({ loading: false });
// });
// }
handleFetchLiveList
()
{
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
()
{
const
{
query
,
total
,
courseList
}
=
this
.
state
;
...
...
@@ -58,12 +93,12 @@ class LiveCoursePage extends React.Component {
onChange=
{
this
.
handleFetchLiveList
}
/>
<
LiveCourseOpt
/>
{
/*
<LiveCourseList
<
LiveCourseList
query=
{
query
}
total=
{
total
}
courseList=
{
courseList
}
onChange=
{
this
.
handleFetchLiveList
}
/>
*/
}
/>
</
div
>
</
div
>
)
...
...
src/modules/course-manage/components/LiveCourseList.jsx
View file @
70a0c2b1
...
...
@@ -9,28 +9,25 @@
import
React
from
'react'
;
import
{
Table
,
Modal
,
Tooltip
,
Badge
,
message
,
Dropdown
,
Button
}
from
'antd'
;
import
Bus
from
'@/core/bus'
;
import
User
from
"@/core/user"
;
import
User_t
from
"@/teacher/core/user"
;
//
import Bus from '@/core/bus';
//
import User from "@/core/user";
//
import User_t from "@/teacher/core/user";
import
{
PageControl
}
from
"@/components"
;
// import { LIVE_SHARE_MAP } from '@/common/constants/academic/cloudClass';
import
DownloadLiveModal
from
'@/components/DownloadLiveModal'
;
//
import DownloadLiveModal from '@/components/DownloadLiveModal';
import
LiveStudentListModal
from
'../modal/LiveStudentListModal'
;
import
CheckBalanceModal
from
'../modal/CheckBalanceModal'
;
import
StartLiveModal
from
'../modal/StartLiveModal'
;
import
ClassRecordModal
from
'../modal/ClassRecordModal'
;
import
PlayBackRecordModal
from
'../modal/PlayBackRecordModal'
;
import
ManageCoursewareModal
from
'../modal/ManageCoursewareModal'
;
import
ShareLiveModal
from
'../modal/ShareLiveModal'
;
import
AccountChargeModal
from
'../modal/AccountChargeModal'
;
import
SelectStudent
from
'../modal/select-student'
;
//
import LiveStudentListModal from '../modal/LiveStudentListModal';
//
import CheckBalanceModal from '../modal/CheckBalanceModal';
//
import StartLiveModal from '../modal/StartLiveModal';
//
import ClassRecordModal from '../modal/ClassRecordModal';
//
import PlayBackRecordModal from '../modal/PlayBackRecordModal';
//
import ManageCoursewareModal from '../modal/ManageCoursewareModal';
//
import ShareLiveModal from '../modal/ShareLiveModal';
//
import AccountChargeModal from '../modal/AccountChargeModal';
//
import SelectStudent from '../modal/select-student';
import
'./LiveCourseList.less'
;
const
{
teacherId
,
instId
,
adminId
,
adminName
,
name
}
=
window
.
currentUserInstInfo
;
const
isTeacher
=
!!
teacherId
;
const
courseStateShow
=
{
UN_START
:
{
code
:
1
,
...
...
@@ -53,32 +50,19 @@ const courseStateShow = {
color
:
"#CCCCCC"
,
},
};
const
ENV
=
process
.
env
.
DEPLOY_ENV
||
'dev'
;
class
LiveCourseList
extends
React
.
Component
{
constructor
(
props
)
{
super
(
props
);
this
.
state
=
{
url
:
''
,
editData
:
{},
columns
:
[],
isXiaoMai
:
false
,
downloadUrl
:
null
,
openCoursewareModal
:
false
,
currentTeacherId
:
teacherId
}
}
componentWillMount
()
{
componentWillMount
(){
this
.
parseColumns
();
}
componentDidMount
()
{
}
// 获取直播间类型
handleCheckLiveVersion
=
()
=>
{
...
...
@@ -95,22 +79,16 @@ class LiveCourseList extends React.Component {
parseColumns
=
()
=>
{
const
menu
=
(
item
)
=>
(
<
div
className=
"live-course-more-menu"
>
<
div
>
上课记录
</
div
>
<
div
onClick=
{
()
=>
{
this
.
handleShow
Class
Modal
(
item
);
this
.
handleShow
Repeat
Modal
(
item
);
}
}
>
上课
记录
回放
记录
</
div
>
{
item
.
haveRecord
===
'YES'
&&
<
div
onClick=
{
()
=>
{
this
.
handleShowRepeatModal
(
item
);
}
}
>
回放记录
</
div
>
}
</
div
>
);
const
columns
=
[
...
...
@@ -120,11 +98,10 @@ class LiveCourseList extends React.Component {
key
:
"courseName"
,
dataIndex
:
"courseName"
,
render
:
(
val
,
record
)
=>
{
const
{
coverUrl
=
'https://image.xiaomaiketang.com/xm/YNfi45JwFA.png'
}
=
record
;
return
(
<
div
className=
"record__item"
>
<
img
className=
"course-cover"
src=
{
coverUrl
}
/>
<
span
className=
"course-name"
>
{
val
}
</
span
>
<
img
className=
"course-cover"
src=
{
'https://image.xiaomaiketang.com/xm/YNfi45JwFA.png'
}
/>
<
span
className=
"course-name"
>
课程名称
</
span
>
</
div
>
)
...
...
@@ -146,7 +123,7 @@ class LiveCourseList extends React.Component {
dataIndex
:
"nickname"
,
},
{
title
:
(
window
.
NewVersion
&&
isXiaoMai
)
?
'学员管理'
:
'学员人数
'
,
title
:
'学员管理
'
,
width
:
"9%"
,
key
:
"quota"
,
dataIndex
:
"quota"
,
...
...
@@ -154,11 +131,8 @@ class LiveCourseList extends React.Component {
return
(
<
span
className=
"operate-text"
onClick=
{
()
=>
{
this
.
handleLinkToClassData
(
item
)
}
}
>
{
`${val}人`
}
3人
</
span
>
);
},
...
...
@@ -168,21 +142,13 @@ class LiveCourseList extends React.Component {
width
:
"7%"
,
dataIndex
:
"courseware"
,
render
:
(
val
,
item
,
index
)
=>
{
return
item
.
channel
===
"XIAOMAI"
?
(
return
(
<
span
className=
"operate-text"
onClick=
{
()
=>
{
this
.
setState
({
editData
:
item
,
openCoursewareModal
:
true
,
});
}
}
>
{
item
.
courseDocumentCount
||
0
}
个
2
个
</
span
>
)
:
(
<
span
style=
{
{
color
:
"#999"
}
}
>
暂不支持
</
span
>
);
)
},
},
{
...
...
@@ -191,15 +157,10 @@ class LiveCourseList extends React.Component {
key
:
"courseState"
,
dataIndex
:
"courseState"
,
render
:
(
val
,
item
)
=>
{
const
{
currentTeacherId
}
=
this
.
state
;
const
teacherPermission
=
item
.
teacherId
===
currentTeacherId
;
return
(
<
div
className=
"course-status"
>
<
Badge
className=
"badge"
color=
{
courseStateShow
[
val
].
color
}
text=
{
courseStateShow
[
val
].
title
}
status=
{
val
==
'STARTING'
?
'processing'
:
undefined
}
/>
</
div
>
);
...
...
@@ -211,35 +172,28 @@ class LiveCourseList extends React.Component {
key
:
"operate"
,
dataIndex
:
"operate"
,
render
:
(
val
,
item
)
=>
{
return
(
<
div
className=
"operate"
>
<
div
key=
"enter_live_room1"
className=
"operate__item"
onClick=
{
()
=>
{
this
.
handleCheckPreEnterLiveRoom
(
item
,
teacherPermission
?
1
:
2
)
}
}
>
进入直播间
</
div
>
<
span
className=
"operate__item split"
key=
"enter_live_room1_split"
>
|
</
span
>
<
div
key=
"view_play_back"
className=
"operate__item"
onClick=
{
()
=>
{
this
.
handleStartPlayBack
(
item
);
}
}
>
查看回放
</
div
>
,
>
查看回放
</
div
>
<
span
className=
"operate__item split"
key=
"view_play_back_split"
>
|
</
span
>
<
div
key=
"share"
className=
"operate__item"
onClick=
{
()
=>
{
this
.
handleShowShareModal
(
item
);
}
}
>
分享
</
div
>
,
</
div
>
<
span
key=
"split1"
className=
"operate__item split"
>
|
</
span
>
<
div
className=
"big-live"
>
<
Dropdown
overlay=
{
this
.
renderMoreOperate
(
item
,
isXiaoMai
,
otherPermission
,
isInteractive
)
}
>
<
Dropdown
>
<
span
className=
"more-operate"
>
<
span
className=
"operate-text"
>
更多
</
span
>
<
span
...
...
@@ -256,25 +210,21 @@ class LiveCourseList extends React.Component {
}
}
];
this
.
setState
({
columns
})
}
renderMoreOperate
=
(
item
,
isXiaoMai
,
otherPermission
,
isInteractive
)
=>
{
renderMoreOperate
=
(
item
)
=>
{
return
(
<
div
className=
"live-course-more-menu"
>
<
div
className=
"operate__item"
onClick=
{
()
=>
this
.
handleRemindClass
(
item
)
}
>
群发通知
</
div
>
<
div
className=
"operate__item"
onClick=
{
()
=>
this
.
handleEditLiveClass
(
item
,
isInteractive
)
}
>
编辑
</
div
>
<
div
className=
"operate__item"
onClick=
{
()
=>
this
.
handleDeleteLiveClass
(
item
.
liveCourseId
)
}
>
删除
</
div
>
</
div
>
)
}
...
...
@@ -285,14 +235,11 @@ class LiveCourseList extends React.Component {
<
div
className=
"live-course-more-menu"
>
<
div
className=
"operate__item"
onClick=
{
()
=>
this
.
handleShowSelectStuModal
(
item
,
'DEDUCTION'
)
}
>
添加扣课时的学员
</
div
>
<
div
className=
"operate__item"
onClick=
{
()
=>
this
.
handleShowSelectStuModal
(
item
)
}
>
添加不扣课时的学员
</
div
>
...
...
@@ -303,14 +250,11 @@ class LiveCourseList extends React.Component {
render
()
{
const
{
total
,
query
,
courseList
,
loading
,
type
}
=
this
.
props
;
const
{
total
,
query
,
courseList
,
loading
}
=
this
.
props
;
console
.
log
(
"courseList"
,
courseList
);
const
{
current
,
size
}
=
query
;
const
{
openCoursewareModal
,
openDownloadModal
,
editData
,
downloadUrl
,
url
,
columns
,
}
=
this
.
state
;
const
{
columns
}
=
this
.
state
;
return
(
<
div
className=
"live-course-list"
>
<
Table
...
...
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