Commit 55d5f7a2 by zhangleyuan

feat:处理视频课的筛选

parent a7764920
......@@ -277,7 +277,7 @@ class LiveCourseList extends React.Component {
width: "9%",
key: "created",
dataIndex: "created",
sorted:true,
sorter: 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",
sorted:true,
sorter: 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 &&
......
......@@ -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">&#xe6f2;</span>
<span className="text">已选择个任务</span>
<span className="text">已选择{this.getSelectLength(selectPlanList)}个任务</span>
<span className="clear">清空</span>
</div>
<div>
......
......@@ -2,7 +2,7 @@
* @Author: zhangleyuan
* @Date: 2021-02-20 16:46:46
* @LastEditors: zhangleyuan
* @LastEditTime: 2021-03-05 10:31:11
* @LastEditTime: 2021-03-08 16:55:56
* @Description: 描述一下
* @@Copyrigh: © 2020 杭州杰竞科技有限公司 版权所有
*/
......@@ -162,13 +162,13 @@ function PlanList(props) {
let _order;
// 按创建时间升序排序
if (columnKey === 'created' && order === 'ascend') {_columnKey="UPDATED"; _order = 'SORT_ASC'; }
if (columnKey === 'created' && order === 'ascend') {_columnKey="CREATED"; _order = 'SORT_ASC'; }
// 按创建时间降序排序
if (columnKey === 'created' && order === 'descend') { _columnKey="UPDATED"; _order = 'SORT_DESC';}
if (columnKey === 'created' && order === 'descend') { _columnKey="CREATED"; _order = 'SORT_DESC';}
// 按更新时间升序排序
if (columnKey === 'updated' && order === 'ascend') { _columnKey="CREATED"; _order = 'SORT_ASC'; }
if (columnKey === 'updated' && order === 'ascend') { _columnKey="UPDATED"; _order = 'SORT_ASC'; }
// 按更新时间降序排序
if (columnKey === 'updated' && order === 'descend') { _columnKey="CREATED"; _order = 'SORT_DESC'; }
if (columnKey === 'updated' && order === 'descend') { _columnKey="UPDATED"; _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}?storeId=${User.getStoreId()}&storeUserId=${User.getStoreUserId()}`;
const htmlUrl = `${LIVE_SHARE}training_plan_detail/${item.planId}?id=${User.getStoreId()}&storeUserId=${User.getStoreUserId()}`;
const longUrl = htmlUrl
const shareData = { ...item, longUrl };
const sharePlanModal = (
......
......@@ -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>
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment