Commit 55d5f7a2 by zhangleyuan

feat:处理视频课的筛选

parent a7764920
...@@ -277,7 +277,7 @@ class LiveCourseList extends React.Component { ...@@ -277,7 +277,7 @@ class LiveCourseList extends React.Component {
width: "9%", width: "9%",
key: "created", key: "created",
dataIndex: "created", dataIndex: "created",
sorted:true, sorter: true,
render: (val, item) => { render: (val, item) => {
return ( return (
<span>{formatDate('YYYY-MM-DD H:i', val)}</span> <span>{formatDate('YYYY-MM-DD H:i', val)}</span>
...@@ -494,7 +494,7 @@ class LiveCourseList extends React.Component { ...@@ -494,7 +494,7 @@ class LiveCourseList extends React.Component {
width: "9%", width: "9%",
key: "created", key: "created",
dataIndex: "created", dataIndex: "created",
sorted:true, sorter: true,
render: (val, item) => { render: (val, item) => {
return ( return (
<span>{formatDate('YYYY-MM-DD H:i', val)}</span> <span>{formatDate('YYYY-MM-DD H:i', val)}</span>
...@@ -695,6 +695,22 @@ class LiveCourseList extends React.Component { ...@@ -695,6 +695,22 @@ class LiveCourseList extends React.Component {
RelatedPlanModalVisible:false RelatedPlanModalVisible:false
},()=>{this.props.onChange();}) },()=>{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() { render() {
const { total, query, courseList, loading} = this.props; const { total, query, courseList, loading} = this.props;
const { current, size } = query; const { current, size } = query;
...@@ -717,6 +733,7 @@ class LiveCourseList extends React.Component { ...@@ -717,6 +733,7 @@ class LiveCourseList extends React.Component {
columns={columns} columns={columns}
loading={loading} loading={loading}
dataSource={courseList} dataSource={courseList}
onChange={this.handleChangeTable}
rowKey={(row) => row.liveCourseId} rowKey={(row) => row.liveCourseId}
/> />
{ total>0 && { total>0 &&
......
...@@ -135,6 +135,15 @@ class RelatedPlanModal extends React.Component { ...@@ -135,6 +135,15 @@ class RelatedPlanModal extends React.Component {
this.props.onConfirm(); this.props.onConfirm();
}); });
} }
getSelectLength = (selectList)=>{
let num = 0;
for(let key in selectList ){
if(selectList[key].taskBaseVOList){
num = num + 1
}
}
return num;
}
render() { render() {
const { size,dataSource,totalCount,query} = this.state; const { size,dataSource,totalCount,query} = this.state;
const { visible,selectPlanList} = this.props; const { visible,selectPlanList} = this.props;
...@@ -160,7 +169,7 @@ class RelatedPlanModal extends React.Component { ...@@ -160,7 +169,7 @@ class RelatedPlanModal extends React.Component {
</div> </div>
<div className="select-container"> <div className="select-container">
<span className="icon iconfont tip">&#xe6f2;</span> <span className="icon iconfont tip">&#xe6f2;</span>
<span className="text">已选择个任务</span> <span className="text">已选择{this.getSelectLength(selectPlanList)}个任务</span>
<span className="clear">清空</span> <span className="clear">清空</span>
</div> </div>
<div> <div>
......
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
* @Author: zhangleyuan * @Author: zhangleyuan
* @Date: 2021-02-20 16:46:46 * @Date: 2021-02-20 16:46:46
* @LastEditors: zhangleyuan * @LastEditors: zhangleyuan
* @LastEditTime: 2021-03-05 10:31:11 * @LastEditTime: 2021-03-08 16:55:56
* @Description: 描述一下 * @Description: 描述一下
* @@Copyrigh: © 2020 杭州杰竞科技有限公司 版权所有 * @@Copyrigh: © 2020 杭州杰竞科技有限公司 版权所有
*/ */
...@@ -162,13 +162,13 @@ function PlanList(props) { ...@@ -162,13 +162,13 @@ function PlanList(props) {
let _order; 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'; } if (columnKey === 'cultureCustomerNum' && order === 'ascend') { _columnKey="CUSTOMER_NUM"; _order = 'SORT_ASC'; }
// 按更新时间降序排序 // 按更新时间降序排序
...@@ -182,7 +182,7 @@ function PlanList(props) { ...@@ -182,7 +182,7 @@ function PlanList(props) {
} }
// 显示分享弹窗 // 显示分享弹窗
function handleShowShareModal(item) { 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 longUrl = htmlUrl
const shareData = { ...item, longUrl }; const shareData = { ...item, longUrl };
const sharePlanModal = ( const sharePlanModal = (
......
...@@ -43,6 +43,7 @@ class SelectOperatorModal extends React.Component { ...@@ -43,6 +43,7 @@ class SelectOperatorModal extends React.Component {
}, },
liveTotalCount:0, liveTotalCount:0,
selectLive:[],//弹窗内已选择的直播课程 selectLive:[],//弹窗内已选择的直播课程
currentCourseListData:[],
currentLiveCourseListData:[], //页面中已关联的直播课程 currentLiveCourseListData:[], //页面中已关联的直播课程
videoDataSource:[], videoDataSource:[],
videoSize:10, videoSize:10,
...@@ -58,23 +59,28 @@ class SelectOperatorModal extends React.Component { ...@@ -58,23 +59,28 @@ class SelectOperatorModal extends React.Component {
componentDidMount() { componentDidMount() {
this.handleFetchLiveDataList(); this.handleFetchLiveDataList();
this.handleFetchVideoDataList(); this.handleFetchVideoDataList();
console.log('courseLisData',this.props.data)
} }
// 获取直播课列表 // 获取直播课列表
handleFetchLiveDataList = () => { handleFetchLiveDataList = () => {
const {liveQuery,liveSize} = this.state; const {liveQuery,liveSize} = this.state;
const { selectedTaskIndex } =this.props; const { selectedTaskIndex } =this.props;
console.log('selectedTaskIndex',selectedTaskIndex); const _data = [...this.props.data];
const currentLiveCourseListData =[...this.props.data[selectedTaskIndex].courseList] let currentLiveCourseListData = [];
const _currentLiveCourseListData = currentLiveCourseListData.map((item,index) => { _data.map((item,index) => {
if(item.liveCourseId){ item.courseList.map((childItem,childIndex)=>{
return item if(childItem.courseType ==="LIVE"){
} currentLiveCourseListData.push(childItem.courseId)
}
return childItem
})
return item
}); });
const params ={ const params ={
...liveQuery, ...liveQuery,
liveSize, liveSize,
// excludeCourseIdList:_.pluck(_currentLiveCourseListData,'courseId') excludeCourseIdList:currentLiveCourseListData
} }
CourseService.getLiveCloudCourseBasePage(params).then((res) => { CourseService.getLiveCloudCourseBasePage(params).then((res) => {
...@@ -92,46 +98,50 @@ class SelectOperatorModal extends React.Component { ...@@ -92,46 +98,50 @@ class SelectOperatorModal extends React.Component {
handleFetchVideoDataList = () => { handleFetchVideoDataList = () => {
const {videoQuery,videoSize,videoTotalCount} = this.state; const {videoQuery,videoSize,videoTotalCount} = this.state;
const { selectedTaskIndex } =this.props; const { selectedTaskIndex } =this.props;
const currentVideoCourseListData =[...this.props.data[selectedTaskIndex].courseList]; const _data = [...this.props.data];
const _currentVideoCourseListData = currentVideoCourseListData.map((item,index) => { let currentVideoCourseListData = [];
if(!item.liveCourseId){ _data.map((item,index) => {
return item item.courseList.map((childItem,childIndex)=>{
} if(childItem.courseType ==="VOICE"){
currentVideoCourseListData.push(childItem.courseId)
}
return childItem
})
return item
}); });
const params ={ const params ={
...videoQuery, ...videoQuery,
videoSize, videoSize,
// excludeCourseIdList:_.pluck(_currentVideoCourseListData,'courseId') excludeCourseIdList:currentVideoCourseListData
} }
CourseService.videoScheduleBasePage(params).then((res) => { CourseService.videoScheduleBasePage(params).then((res) => {
const { result = {} } = res ; const { result = {} } = res ;
const { records = [], total = 0 } = result; const { records = [], total = 0 } = result;
console.log('records',records);
this.setState({ this.setState({
videoDataSource: records, videoDataSource: records,
videoTotalCount: Number(total) videoTotalCount: Number(total),
currentVideoCourseListData
}); });
}); });
} }
// handleChangNickname = (value)=>{ handleChangVideoCourseName = (value)=>{
// const isPhone = (value || '').match(/^\d+$/); const { videoQuery } = this.state;
// const { query } = this.state; videoQuery.courseName = value;
// if(isPhone){ videoQuery.current = 1;
// query.phone = value; this.setState({
// query.nickName = null; videoQuery
// }else{ })
// query.nickName = value; }
// query.phone = null; handleChangLiveCourseName = (value)=>{
// } const { liveQuery } = this.state;
// query.current = 1; liveQuery.courseName = value;
// this.setState({ liveQuery.current = 1;
// query this.setState({
// },()=>{this.handleFetchLiveDataList()}) liveQuery
// } })
}
onShowLiveSizeChange = (current, size) => { onShowLiveSizeChange = (current, size) => {
if (current == size) { if (current == size) {
return return
...@@ -193,7 +203,7 @@ class SelectOperatorModal extends React.Component { ...@@ -193,7 +203,7 @@ class SelectOperatorModal extends React.Component {
dataIndex: 'courseTime', dataIndex: 'courseTime',
render: (val, record) => { render: (val, record) => {
return ( 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 { ...@@ -318,7 +328,7 @@ class SelectOperatorModal extends React.Component {
<Tabs defaultActiveKey="1"> <Tabs defaultActiveKey="1">
<TabPane tab="视频课" key="1"> <TabPane tab="视频课" key="1">
<div className="search-container"> <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>
<div> <div>
<span> <span>
...@@ -371,7 +381,7 @@ class SelectOperatorModal extends React.Component { ...@@ -371,7 +381,7 @@ class SelectOperatorModal extends React.Component {
</TabPane> </TabPane>
<TabPane tab="直播课" key="2"> <TabPane tab="直播课" key="2">
<div className="search-container"> <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>
<div> <div>
<span> <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