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
55d5f7a2
Commit
55d5f7a2
authored
Mar 08, 2021
by
zhangleyuan
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
feat:处理视频课的筛选
parent
a7764920
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
80 additions
and
44 deletions
+80
-44
src/modules/course-manage/components/LiveCourseList.jsx
+19
-2
src/modules/course-manage/modal/RelatedPlanModal.jsx
+10
-1
src/modules/plan-manage/components/PlanList.jsx
+6
-6
src/modules/plan-manage/modal/relatedCourseModal.jsx
+45
-35
No files found.
src/modules/course-manage/components/LiveCourseList.jsx
View file @
55d5f7a2
...
...
@@ -277,7 +277,7 @@ class LiveCourseList extends React.Component {
width
:
"9%"
,
key
:
"created"
,
dataIndex
:
"created"
,
sorte
d
:
true
,
sorte
r
:
true
,
render
:
(
val
,
item
)
=>
{
return
(
<
span
>
{
formatDate
(
'YYYY-MM-DD H:i'
,
val
)
}
</
span
>
...
...
@@ -494,7 +494,7 @@ class LiveCourseList extends React.Component {
width
:
"9%"
,
key
:
"created"
,
dataIndex
:
"created"
,
sorte
d
:
true
,
sorte
r
:
true
,
render
:
(
val
,
item
)
=>
{
return
(
<
span
>
{
formatDate
(
'YYYY-MM-DD H:i'
,
val
)
}
</
span
>
...
...
@@ -695,6 +695,22 @@ class LiveCourseList extends React.Component {
RelatedPlanModalVisible
:
false
},()
=>
{
this
.
props
.
onChange
();})
}
handleChangeTable
=
(
pagination
,
filters
,
sorter
)
=>
{
const
{
columnKey
,
order
}
=
sorter
;
const
{
query
}
=
this
.
props
;
let
_columnKey
;
let
_order
;
// 按创建时间升序排序
if
(
columnKey
===
'created'
&&
order
===
'ascend'
)
{
_columnKey
=
"CREATED"
;
_order
=
'SORT_ASC'
;
}
// 按创建时间降序排序
if
(
columnKey
===
'created'
&&
order
===
'descend'
)
{
_columnKey
=
"CREATED"
;
_order
=
'SORT_DESC'
;}
const
_query
=
{
...
query
,
sortMap
:{}
};
_query
.
sortMap
[
_columnKey
]
=
_order
;
this
.
props
.
onChange
(
_query
);
}
render
()
{
const
{
total
,
query
,
courseList
,
loading
}
=
this
.
props
;
const
{
current
,
size
}
=
query
;
...
...
@@ -717,6 +733,7 @@ class LiveCourseList extends React.Component {
columns=
{
columns
}
loading=
{
loading
}
dataSource=
{
courseList
}
onChange=
{
this
.
handleChangeTable
}
rowKey=
{
(
row
)
=>
row
.
liveCourseId
}
/>
{
total
>
0
&&
...
...
src/modules/course-manage/modal/RelatedPlanModal.jsx
View file @
55d5f7a2
...
...
@@ -135,6 +135,15 @@ class RelatedPlanModal extends React.Component {
this
.
props
.
onConfirm
();
});
}
getSelectLength
=
(
selectList
)
=>
{
let
num
=
0
;
for
(
let
key
in
selectList
){
if
(
selectList
[
key
].
taskBaseVOList
){
num
=
num
+
1
}
}
return
num
;
}
render
()
{
const
{
size
,
dataSource
,
totalCount
,
query
}
=
this
.
state
;
const
{
visible
,
selectPlanList
}
=
this
.
props
;
...
...
@@ -160,7 +169,7 @@ class RelatedPlanModal extends React.Component {
</
div
>
<
div
className=
"select-container"
>
<
span
className=
"icon iconfont tip"
>

</
span
>
<
span
className=
"text"
>
已选择个任务
</
span
>
<
span
className=
"text"
>
已选择
{
this
.
getSelectLength
(
selectPlanList
)
}
个任务
</
span
>
<
span
className=
"clear"
>
清空
</
span
>
</
div
>
<
div
>
...
...
src/modules/plan-manage/components/PlanList.jsx
View file @
55d5f7a2
...
...
@@ -2,7 +2,7 @@
* @Author: zhangleyuan
* @Date: 2021-02-20 16:46:46
* @LastEditors: zhangleyuan
* @LastEditTime: 2021-03-0
5 10:31:11
* @LastEditTime: 2021-03-0
8 16:55:56
* @Description: 描述一下
* @@Copyrigh: © 2020 杭州杰竞科技有限公司 版权所有
*/
...
...
@@ -162,13 +162,13 @@ function PlanList(props) {
let
_order
;
// 按创建时间升序排序
if
(
columnKey
===
'created'
&&
order
===
'ascend'
)
{
_columnKey
=
"
UPD
ATED"
;
_order
=
'SORT_ASC'
;
}
if
(
columnKey
===
'created'
&&
order
===
'ascend'
)
{
_columnKey
=
"
CRE
ATED"
;
_order
=
'SORT_ASC'
;
}
// 按创建时间降序排序
if
(
columnKey
===
'created'
&&
order
===
'descend'
)
{
_columnKey
=
"
UPD
ATED"
;
_order
=
'SORT_DESC'
;}
if
(
columnKey
===
'created'
&&
order
===
'descend'
)
{
_columnKey
=
"
CRE
ATED"
;
_order
=
'SORT_DESC'
;}
// 按更新时间升序排序
if
(
columnKey
===
'updated'
&&
order
===
'ascend'
)
{
_columnKey
=
"
CRE
ATED"
;
_order
=
'SORT_ASC'
;
}
if
(
columnKey
===
'updated'
&&
order
===
'ascend'
)
{
_columnKey
=
"
UPD
ATED"
;
_order
=
'SORT_ASC'
;
}
// 按更新时间降序排序
if
(
columnKey
===
'updated'
&&
order
===
'descend'
)
{
_columnKey
=
"
CRE
ATED"
;
_order
=
'SORT_DESC'
;
}
if
(
columnKey
===
'updated'
&&
order
===
'descend'
)
{
_columnKey
=
"
UPD
ATED"
;
_order
=
'SORT_DESC'
;
}
// 按更新时间升序排序
if
(
columnKey
===
'cultureCustomerNum'
&&
order
===
'ascend'
)
{
_columnKey
=
"CUSTOMER_NUM"
;
_order
=
'SORT_ASC'
;
}
// 按更新时间降序排序
...
...
@@ -182,7 +182,7 @@ function PlanList(props) {
}
// 显示分享弹窗
function
handleShowShareModal
(
item
)
{
const
htmlUrl
=
`
${
LIVE_SHARE
}
training_plan_detail/
${
item
.
planId
}
?
storeI
d=
${
User
.
getStoreId
()}
&storeUserId=
${
User
.
getStoreUserId
()}
`
;
const
htmlUrl
=
`
${
LIVE_SHARE
}
training_plan_detail/
${
item
.
planId
}
?
i
d=
${
User
.
getStoreId
()}
&storeUserId=
${
User
.
getStoreUserId
()}
`
;
const
longUrl
=
htmlUrl
const
shareData
=
{
...
item
,
longUrl
};
const
sharePlanModal
=
(
...
...
src/modules/plan-manage/modal/relatedCourseModal.jsx
View file @
55d5f7a2
...
...
@@ -43,6 +43,7 @@ class SelectOperatorModal extends React.Component {
},
liveTotalCount
:
0
,
selectLive
:[],
//弹窗内已选择的直播课程
currentCourseListData
:[],
currentLiveCourseListData
:[],
//页面中已关联的直播课程
videoDataSource
:[],
videoSize
:
10
,
...
...
@@ -58,23 +59,28 @@ class SelectOperatorModal extends React.Component {
componentDidMount
()
{
this
.
handleFetchLiveDataList
();
this
.
handleFetchVideoDataList
();
console
.
log
(
'courseLisData'
,
this
.
props
.
data
)
}
// 获取直播课列表
handleFetchLiveDataList
=
()
=>
{
const
{
liveQuery
,
liveSize
}
=
this
.
state
;
const
{
selectedTaskIndex
}
=
this
.
props
;
console
.
log
(
'selectedTaskIndex'
,
selectedTaskIndex
);
const
currentLiveCourseListData
=
[...
this
.
props
.
data
[
selectedTaskIndex
].
courseList
]
const
_currentLiveCourseListData
=
currentLiveCourseListData
.
map
((
item
,
index
)
=>
{
if
(
item
.
liveCourseId
){
return
item
}
const
_data
=
[...
this
.
props
.
data
];
let
currentLiveCourseListData
=
[];
_data
.
map
((
item
,
index
)
=>
{
item
.
courseList
.
map
((
childItem
,
childIndex
)
=>
{
if
(
childItem
.
courseType
===
"LIVE"
){
currentLiveCourseListData
.
push
(
childItem
.
courseId
)
}
return
childItem
})
return
item
});
const
params
=
{
...
liveQuery
,
liveSize
,
// excludeCourseIdList:_.pluck(_currentLiveCourseListData,'courseId')
excludeCourseIdList
:
currentLiveCourseListData
}
CourseService
.
getLiveCloudCourseBasePage
(
params
).
then
((
res
)
=>
{
...
...
@@ -92,46 +98,50 @@ class SelectOperatorModal extends React.Component {
handleFetchVideoDataList
=
()
=>
{
const
{
videoQuery
,
videoSize
,
videoTotalCount
}
=
this
.
state
;
const
{
selectedTaskIndex
}
=
this
.
props
;
const
currentVideoCourseListData
=
[...
this
.
props
.
data
[
selectedTaskIndex
].
courseList
];
const
_currentVideoCourseListData
=
currentVideoCourseListData
.
map
((
item
,
index
)
=>
{
if
(
!
item
.
liveCourseId
){
return
item
}
const
_data
=
[...
this
.
props
.
data
];
let
currentVideoCourseListData
=
[];
_data
.
map
((
item
,
index
)
=>
{
item
.
courseList
.
map
((
childItem
,
childIndex
)
=>
{
if
(
childItem
.
courseType
===
"VOICE"
){
currentVideoCourseListData
.
push
(
childItem
.
courseId
)
}
return
childItem
})
return
item
});
const
params
=
{
...
videoQuery
,
videoSize
,
// excludeCourseIdList:_.pluck(_currentVideoCourseListData,'courseId')
excludeCourseIdList
:
currentVideoCourseListData
}
CourseService
.
videoScheduleBasePage
(
params
).
then
((
res
)
=>
{
const
{
result
=
{}
}
=
res
;
const
{
records
=
[],
total
=
0
}
=
result
;
console
.
log
(
'records'
,
records
);
this
.
setState
({
videoDataSource
:
records
,
videoTotalCount
:
Number
(
total
)
videoTotalCount
:
Number
(
total
),
currentVideoCourseListData
});
});
}
// handleChangNickname = (value)=>{
// const isPhone = (value || '').match(/^\d+$/);
// const { query } = this.state;
// if(isPhone){
// query.phone = value;
// query.nickName = null;
// }else{
// query.nickName = value;
// query.phone = null;
// }
// query.current = 1;
// this.setState({
// query
// },()=>{this.handleFetchLiveDataList()})
// }
handleChangVideoCourseName
=
(
value
)
=>
{
const
{
videoQuery
}
=
this
.
state
;
videoQuery
.
courseName
=
value
;
videoQuery
.
current
=
1
;
this
.
setState
({
videoQuery
})
}
handleChangLiveCourseName
=
(
value
)
=>
{
const
{
liveQuery
}
=
this
.
state
;
liveQuery
.
courseName
=
value
;
liveQuery
.
current
=
1
;
this
.
setState
({
liveQuery
})
}
onShowLiveSizeChange
=
(
current
,
size
)
=>
{
if
(
current
==
size
)
{
return
...
...
@@ -193,7 +203,7 @@ class SelectOperatorModal extends React.Component {
dataIndex
:
'courseTime'
,
render
:
(
val
,
record
)
=>
{
return
(
<
span
>
{
formatDate
(
'YYYY-MM-DD H:i'
,
record
.
startTime
)
-
formatDate
(
'YYYY-MM-DD H:i'
,
record
.
endTime
)
}
</
span
>
<
span
>
{
formatDate
(
'YYYY-MM-DD H:i'
,
record
.
startTime
)
}
~
{
formatDate
(
'YYYY-MM-DD H:i'
,
record
.
endTime
)
}
</
span
>
)
}
}
...
...
@@ -318,7 +328,7 @@ class SelectOperatorModal extends React.Component {
<
Tabs
defaultActiveKey=
"1"
>
<
TabPane
tab=
"视频课"
key=
"1"
>
<
div
className=
"search-container"
>
<
Search
placeholder=
"搜索课程名称"
style=
{
{
width
:
200
}
}
/>
<
Search
placeholder=
"搜索课程名称"
style=
{
{
width
:
200
}
}
onChange=
{
(
e
)
=>
{
this
.
handleChangVideoCourseName
(
e
.
target
.
value
)}
}
onSearch=
{
()
=>
{
this
.
handleFetchVideoDataList
()}
}
/>
</
div
>
<
div
>
<
span
>
...
...
@@ -371,7 +381,7 @@ class SelectOperatorModal extends React.Component {
</
TabPane
>
<
TabPane
tab=
"直播课"
key=
"2"
>
<
div
className=
"search-container"
>
<
Search
placeholder=
"搜索课程名称"
style=
{
{
width
:
200
}
}
/>
<
Search
placeholder=
"搜索课程名称"
style=
{
{
width
:
200
}
}
onChange=
{
(
e
)
=>
{
this
.
handleChangLiveCourseName
(
e
.
target
.
value
)}
}
onSearch=
{
()
=>
{
this
.
handleFetchLiveDataList
()}
}
/>
</
div
>
<
div
>
<
span
>
...
...
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