Commit 3f74ea5d by yuananting

fix:解决合并代码的冲突

parents e8ae7a18 5ed3f210
...@@ -77,7 +77,6 @@ class LiveCourseList extends React.Component { ...@@ -77,7 +77,6 @@ class LiveCourseList extends React.Component {
const htmlUrl = `${LIVE_SHARE}live_detail/${liveCourseId}?id=${User.getStoreId()}`; const htmlUrl = `${LIVE_SHARE}live_detail/${liveCourseId}?id=${User.getStoreId()}`;
const longUrl = htmlUrl; const longUrl = htmlUrl;
console.log('htmlUrl', htmlUrl, longUrl);
const shareData = { ...item, longUrl }; const shareData = { ...item, longUrl };
const shareLiveModal = ( const shareLiveModal = (
...@@ -928,15 +927,14 @@ class LiveCourseList extends React.Component { ...@@ -928,15 +927,14 @@ class LiveCourseList extends React.Component {
handleRelatedModalShow = (item) => { handleRelatedModalShow = (item) => {
const selectPlanList = {}; const selectPlanList = {};
if (item.relatedPlanList) { if (item.relatedPlanList) {
item.relatedPlanList.map((item, index) => { item.relatedPlanList.map((childItem, index) => {
selectPlanList[item.taskId] = {}; selectPlanList[childItem.taskId] = {};
selectPlanList[item.taskId].taskId = item.taskId; selectPlanList[childItem.taskId].taskId = childItem.taskId;
selectPlanList[item.taskId].taskBaseVOList = [{ taskId: item.taskId }]; selectPlanList[childItem.taskId].taskBaseVOList = [{ stageId: childItem.stageId }];
return item; return item;
}); });
} }
console.log('selectPlanList:', selectPlanList);
this.setState({ this.setState({
RelatedPlanModalVisible: true, RelatedPlanModalVisible: true,
selectCourseId: item.liveCourseId, selectCourseId: item.liveCourseId,
...@@ -949,6 +947,7 @@ class LiveCourseList extends React.Component { ...@@ -949,6 +947,7 @@ class LiveCourseList extends React.Component {
}); });
}; };
onChangeSelectPlanList = (selectPlanList) => { onChangeSelectPlanList = (selectPlanList) => {
console.log('selectPlanList', selectPlanList);
this.setState({ this.setState({
selectPlanList: selectPlanList, selectPlanList: selectPlanList,
}); });
......
/* /*
* @Author: 吴文洁 * @Author: 吴文洁
* @Date: 2020-08-05 10:12:45 * @Date: 2020-08-05 10:12:45
* @LastEditors: wufan * @LastEditors: yuananting
* @LastEditTime: 2021-08-06 17:42:37 * @LastEditTime: 2021-08-16 23:34:03
* @Description: 线上课-列表模块 * @Description: 线上课-列表模块
* @Copyright: 杭州杰竞科技有限公司 版权所有 * @Copyright: 杭州杰竞科技有限公司 版权所有
*/ */
...@@ -194,7 +194,7 @@ class GraphicsCourseList extends React.Component { ...@@ -194,7 +194,7 @@ class GraphicsCourseList extends React.Component {
<Tooltip title={this.handlePlanName(record.relatedPlanList)} placement='top' arrowPointAtCenter> <Tooltip title={this.handlePlanName(record.relatedPlanList)} placement='top' arrowPointAtCenter>
{record.relatedPlanList.map((item, index) => { {record.relatedPlanList.map((item, index) => {
return ( return (
<span key={item.planId}> <span key={item.taskId}>
{item.planName} {index < record.relatedPlanList.length - 1 && <span></span>}{' '} {item.planName} {index < record.relatedPlanList.length - 1 && <span></span>}{' '}
</span> </span>
); );
...@@ -245,10 +245,10 @@ class GraphicsCourseList extends React.Component { ...@@ -245,10 +245,10 @@ class GraphicsCourseList extends React.Component {
handleRelatedModalShow = (item) => { handleRelatedModalShow = (item) => {
const selectPlanList = {}; const selectPlanList = {};
if (item.relatedPlanList) { if (item.relatedPlanList) {
item.relatedPlanList.map((item, index) => { item.relatedPlanList.map((childItem, index) => {
selectPlanList[item.planId] = {}; selectPlanList[childItem.taskId] = {};
selectPlanList[item.planId].planId = item.planId; selectPlanList[childItem.taskId].taskId = childItem.taskId;
selectPlanList[item.planId].taskBaseVOList = [{ taskId: item.taskId }]; selectPlanList[childItem.taskId].taskBaseVOList = [{ stageId: childItem.stageId }];
return item; return item;
}); });
} }
...@@ -408,22 +408,7 @@ class GraphicsCourseList extends React.Component { ...@@ -408,22 +408,7 @@ class GraphicsCourseList extends React.Component {
}; };
this.props.onChange(_query); this.props.onChange(_query);
}; };
handleRelatedModalShow = (item) => {
const selectPlanList = {};
if (item.relatedPlanList) {
item.relatedPlanList.map((item, index) => {
selectPlanList[item.planId] = {};
selectPlanList[item.planId].planId = item.planId;
selectPlanList[item.planId].taskBaseVOList = [{ taskId: item.taskId }];
return item;
});
}
this.setState({
RelatedPlanModalVisible: true,
selectCourseId: item.id,
selectPlanList: selectPlanList,
});
};
closeRelatedPlanModalVisible = () => { closeRelatedPlanModalVisible = () => {
this.setState({ this.setState({
RelatedPlanModalVisible: false, RelatedPlanModalVisible: false,
...@@ -487,16 +472,6 @@ class GraphicsCourseList extends React.Component { ...@@ -487,16 +472,6 @@ class GraphicsCourseList extends React.Component {
onConfirm={this.onConfirmSelectPlanList} onConfirm={this.onConfirmSelectPlanList}
/> />
)} )}
{RelatedPlanModalVisible && (
<RelatedPlanModal
onClose={this.closeRelatedPlanModalVisible}
visible={RelatedPlanModalVisible}
selectCourseId={selectCourseId}
selectPlanList={selectPlanList}
onChange={this.onChangeSelectPlanList}
onConfirm={this.onConfirmSelectPlanList}
/>
)}
{this.state.shareLiveModal} {this.state.shareLiveModal}
{this.state.watchDataModal} {this.state.watchDataModal}
</div> </div>
......
...@@ -123,9 +123,8 @@ class RelatedPlanModal extends React.Component { ...@@ -123,9 +123,8 @@ class RelatedPlanModal extends React.Component {
} }
_selectPlanList[taskId].taskBaseVOList = []; _selectPlanList[taskId].taskBaseVOList = [];
_selectPlanList[taskId].taskId = taskId; _selectPlanList[taskId].taskId = taskId;
_selectPlanList[taskId].taskBaseVOList.push(record); _selectPlanList[taskId].taskBaseVOList.push({ ...record, stageId: record.taskId });
} else { } else {
console.log(_selectPlanList[taskId]);
if (!_selectPlanList[taskId]) { if (!_selectPlanList[taskId]) {
_selectPlanList[taskId] = {}; _selectPlanList[taskId] = {};
} }
...@@ -141,7 +140,7 @@ class RelatedPlanModal extends React.Component { ...@@ -141,7 +140,7 @@ class RelatedPlanModal extends React.Component {
if (selectPlanList[key].taskBaseVOList) { if (selectPlanList[key].taskBaseVOList) {
item.taskId = selectPlanList[key].taskId; item.taskId = selectPlanList[key].taskId;
if (selectPlanList[key].taskBaseVOList[0]) { if (selectPlanList[key].taskBaseVOList[0]) {
item.stageId = selectPlanList[key].taskBaseVOList[0].taskId; item.stageId = selectPlanList[key].taskBaseVOList[0].stageId;
} }
} }
if (item.stageId) { if (item.stageId) {
...@@ -177,7 +176,6 @@ class RelatedPlanModal extends React.Component { ...@@ -177,7 +176,6 @@ class RelatedPlanModal extends React.Component {
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;
console.log('selectPlanListselectPlanListselectPlanListselectPlanListselectPlanList', selectPlanList);
return ( return (
<Modal <Modal
title='关联培训任务' title='关联培训任务'
...@@ -237,8 +235,6 @@ class RelatedPlanModal extends React.Component { ...@@ -237,8 +235,6 @@ class RelatedPlanModal extends React.Component {
taskBaseVOList = selectPlan.taskBaseVOList; taskBaseVOList = selectPlan.taskBaseVOList;
} }
console.log('selectPlan==============taskBaseVOList:', taskBaseVOList);
return ( return (
<div> <div>
<XMTable <XMTable
...@@ -253,7 +249,7 @@ class RelatedPlanModal extends React.Component { ...@@ -253,7 +249,7 @@ class RelatedPlanModal extends React.Component {
className='child-table' className='child-table'
rowSelection={{ rowSelection={{
type: 'checkbox', type: 'checkbox',
selectedRowKeys: _.pluck(taskBaseVOList, 'taskId'), selectedRowKeys: _.pluck(taskBaseVOList, 'stageId'),
onSelect: (record, selected) => { onSelect: (record, selected) => {
this.selectPlanList(record, selected, _record.taskId); this.selectPlanList(record, selected, _record.taskId);
}, },
......
import React from 'react' import React from 'react';
import { Modal, message, Tooltip, Switch, Dropdown } from 'antd' import { Modal, message, Tooltip, Switch, Dropdown } from 'antd';
import _ from 'underscore' import _ from 'underscore';
import { PageControl } from '@/components' import { PageControl } from '@/components';
import { LIVE_SHARE } from '@/domains/course-domain/constants' import { LIVE_SHARE } from '@/domains/course-domain/constants';
import { Route, withRouter } from 'react-router-dom' import { Route, withRouter } from 'react-router-dom';
import ShareLiveModal from '@/modules/course-manage/modal/ShareLiveModal' import ShareLiveModal from '@/modules/course-manage/modal/ShareLiveModal';
import CourseService from '@/domains/course-domain/CourseService' import CourseService from '@/domains/course-domain/CourseService';
import RelatedPlanModal from '../../modal/RelatedPlanModal' import RelatedPlanModal from '../../modal/RelatedPlanModal';
import User from '@/common/js/user' import User from '@/common/js/user';
import VideoCourseDetail from '../VideoCourseDetail' import VideoCourseDetail from '../VideoCourseDetail';
import WatchData from './WatchData' import WatchData from './WatchData';
import { XMTable } from '@/components' import { XMTable } from '@/components';
import college from '@/common/lottie/college' import college from '@/common/lottie/college';
import './VideoCourseList.less' import './VideoCourseList.less';
class VideoCourseList extends React.Component { class VideoCourseList extends React.Component {
constructor(props) { constructor(props) {
super(props) super(props);
this.state = { this.state = {
id: '', // 视频课ID id: '', // 视频课ID
studentIds: [], studentIds: [],
...@@ -24,36 +24,36 @@ class VideoCourseList extends React.Component { ...@@ -24,36 +24,36 @@ class VideoCourseList extends React.Component {
selectPlanList: {}, selectPlanList: {},
ShelfLoading: false, ShelfLoading: false,
// dataSource: [], // dataSource: [],
} };
} }
componentDidMount() { componentDidMount() {
const videoCourseItem = localStorage.getItem('videoCourseItem') const videoCourseItem = localStorage.getItem('videoCourseItem');
if (videoCourseItem) { if (videoCourseItem) {
const _videoCourseItem = JSON.parse(videoCourseItem) const _videoCourseItem = JSON.parse(videoCourseItem);
this.handleShowShareModal(_videoCourseItem, true) this.handleShowShareModal(_videoCourseItem, true);
} }
} }
// 跳转课程详情页 // 跳转课程详情页
handleLinkToCourseDetail = (courseId) => { handleLinkToCourseDetail = (courseId) => {
const { match } = this.props const { match } = this.props;
window.RCHistory.push(`${match.url}/video-course-detail?courseId=${courseId}`) window.RCHistory.push(`${match.url}/video-course-detail?courseId=${courseId}`);
} };
// 观看数据弹窗 // 观看数据弹窗
handleShowWatchDataModal = (item) => { handleShowWatchDataModal = (item) => {
const { match } = this.props const { match } = this.props;
window.RCHistory.push({ window.RCHistory.push({
pathname: `${match.url}/course-data?courseName=${item.courseName}&courseId=${item.id}`, pathname: `${match.url}/course-data?courseName=${item.courseName}&courseId=${item.id}`,
}) });
} };
// 请求表头 // 请求表头
parseColumns = () => { parseColumns = () => {
const { type } = this.props const { type } = this.props;
const { ShelfLoading } = this.state const { ShelfLoading } = this.state;
const columns = [ const columns = [
{ {
title: '线上课', title: '线上课',
...@@ -62,7 +62,7 @@ class VideoCourseList extends React.Component { ...@@ -62,7 +62,7 @@ class VideoCourseList extends React.Component {
width: 321, width: 321,
fixed: 'left', fixed: 'left',
render: (val, record) => { render: (val, record) => {
const { coverUrl } = record const { coverUrl } = record;
return ( return (
<div className='record__item'> <div className='record__item'>
<img className='course-cover' src={coverUrl || 'https://image.xiaomaiketang.com/xm/TwtGPQGE4K.png'} alt='封面图' /> <img className='course-cover' src={coverUrl || 'https://image.xiaomaiketang.com/xm/TwtGPQGE4K.png'} alt='封面图' />
...@@ -77,7 +77,7 @@ class VideoCourseList extends React.Component { ...@@ -77,7 +77,7 @@ class VideoCourseList extends React.Component {
</Otherwise> </Otherwise>
</Choose> </Choose>
</div> </div>
) );
}, },
}, },
{ {
...@@ -97,7 +97,7 @@ class VideoCourseList extends React.Component { ...@@ -97,7 +97,7 @@ class VideoCourseList extends React.Component {
dataIndex: 'categoryName', dataIndex: 'categoryName',
width: 150, width: 150,
render: (val, record) => { render: (val, record) => {
return <div className='record__item'>{record.categorySonName}</div> return <div className='record__item'>{record.categorySonName}</div>;
}, },
}, },
{ {
...@@ -108,7 +108,7 @@ class VideoCourseList extends React.Component { ...@@ -108,7 +108,7 @@ class VideoCourseList extends React.Component {
width: 100, width: 100,
align: 'right', align: 'right',
render: (val, item) => { render: (val, item) => {
return <div onClick={() => this.handleLinkToCourseDetail(item.id)}>{val || 1}</div> return <div onClick={() => this.handleLinkToCourseDetail(item.id)}>{val || 1}</div>;
}, },
}, },
{ {
...@@ -140,10 +140,10 @@ class VideoCourseList extends React.Component { ...@@ -140,10 +140,10 @@ class VideoCourseList extends React.Component {
checked={item.shelfState === 'YES'} checked={item.shelfState === 'YES'}
defaultChecked={item.shelfState} defaultChecked={item.shelfState}
onClick={(checked) => { onClick={(checked) => {
this.changeShelfState(checked, item, index) this.changeShelfState(checked, item, index);
}} }}
/> />
) );
}, },
}, },
{ {
...@@ -157,7 +157,7 @@ class VideoCourseList extends React.Component { ...@@ -157,7 +157,7 @@ class VideoCourseList extends React.Component {
<div className='watchUserCount' onClick={() => this.handleShowWatchDataModal(item)}> <div className='watchUserCount' onClick={() => this.handleShowWatchDataModal(item)}>
{val || 0} {val || 0}
</div> </div>
) );
}, },
}, },
{ {
...@@ -174,7 +174,7 @@ class VideoCourseList extends React.Component { ...@@ -174,7 +174,7 @@ class VideoCourseList extends React.Component {
</Tooltip> </Tooltip>
)} )}
</div> </div>
) );
}, },
}, },
{ {
...@@ -184,7 +184,7 @@ class VideoCourseList extends React.Component { ...@@ -184,7 +184,7 @@ class VideoCourseList extends React.Component {
dataIndex: 'created', dataIndex: 'created',
sorter: true, sorter: true,
render: (val) => { render: (val) => {
return window.formatDate('YYYY-MM-DD H:i', val) return window.formatDate('YYYY-MM-DD H:i', val);
}, },
}, },
{ {
...@@ -194,7 +194,7 @@ class VideoCourseList extends React.Component { ...@@ -194,7 +194,7 @@ class VideoCourseList extends React.Component {
dataIndex: 'updated', dataIndex: 'updated',
sorter: true, sorter: true,
render: (val) => { render: (val) => {
return window.formatDate('YYYY-MM-DD H:i', val) return window.formatDate('YYYY-MM-DD H:i', val);
}, },
}, },
{ {
...@@ -210,10 +210,10 @@ class VideoCourseList extends React.Component { ...@@ -210,10 +210,10 @@ class VideoCourseList extends React.Component {
<Tooltip title={this.handlePlanName(record.relatedPlanList)} placement='top' arrowPointAtCenter> <Tooltip title={this.handlePlanName(record.relatedPlanList)} placement='top' arrowPointAtCenter>
{record.relatedPlanList.map((item, index) => { {record.relatedPlanList.map((item, index) => {
return ( return (
<span key={item.planId}> <span key={item.taskId}>
{item.planName} {index < record.relatedPlanList.length - 1 && <span></span>} {item.planName} {index < record.relatedPlanList.length - 1 && <span></span>}
</span> </span>
) );
})} })}
</Tooltip> </Tooltip>
</When> </When>
...@@ -222,7 +222,7 @@ class VideoCourseList extends React.Component { ...@@ -222,7 +222,7 @@ class VideoCourseList extends React.Component {
</Otherwise> </Otherwise>
</Choose> </Choose>
</div> </div>
) );
}, },
}, },
{ {
...@@ -249,17 +249,17 @@ class VideoCourseList extends React.Component { ...@@ -249,17 +249,17 @@ class VideoCourseList extends React.Component {
</span> </span>
</Dropdown> </Dropdown>
</div> </div>
) );
}, },
}, },
] ];
type !== 'internal' && columns.splice(5, 1) type !== 'internal' && columns.splice(5, 1);
return columns return columns;
} };
renderMoreOperate = (item) => { renderMoreOperate = (item) => {
const { type } = this.props const { type } = this.props;
return ( return (
<div className='live-course-more-menu'> <div className='live-course-more-menu'>
<If condition={type !== 'internal'}> <If condition={type !== 'internal'}>
...@@ -276,7 +276,7 @@ class VideoCourseList extends React.Component { ...@@ -276,7 +276,7 @@ class VideoCourseList extends React.Component {
<div <div
className='operate__item' className='operate__item'
onClick={() => { onClick={() => {
window.RCHistory.push(`/create-video-course?type=edit&id=${item.id}`) window.RCHistory.push(`/create-video-course?type=edit&id=${item.id}`);
}}> }}>
编辑 编辑
</div> </div>
...@@ -285,41 +285,41 @@ class VideoCourseList extends React.Component { ...@@ -285,41 +285,41 @@ class VideoCourseList extends React.Component {
</div> </div>
</If> </If>
</div> </div>
) );
} };
handlePlanName = (planArray) => { handlePlanName = (planArray) => {
let planStr = '' let planStr = '';
planArray.forEach((item, index) => { planArray.forEach((item, index) => {
if (index < planArray.length - 1) { if (index < planArray.length - 1) {
planStr = planStr + item.planName + '、' planStr = planStr + item.planName + '、';
} else { } else {
planStr = planStr + item.planName planStr = planStr + item.planName;
} }
}) });
return planStr return planStr;
} };
//改变上架状态 //改变上架状态
changeShelfState = (checked, item, index) => { changeShelfState = (checked, item, index) => {
let _shelfState = checked ? 'YES' : 'NO' let _shelfState = checked ? 'YES' : 'NO';
if (checked) { if (checked) {
_shelfState = 'YES' _shelfState = 'YES';
} else { } else {
_shelfState = 'NO' _shelfState = 'NO';
} }
const params = { const params = {
courseId: item.id, courseId: item.id,
shelfState: _shelfState, shelfState: _shelfState,
} };
CourseService.changeVideoShelfState(params).then(() => { CourseService.changeVideoShelfState(params).then(() => {
if (_shelfState === 'YES') { if (_shelfState === 'YES') {
message.success('已开启展示') message.success('已开启展示');
} else { } else {
message.success('已取消展示') message.success('已取消展示');
} }
this.props.changeShelfState(index, _shelfState) this.props.changeShelfState(index, _shelfState);
}) });
} };
// 删除线上课 // 删除线上课
handleDeleteVideoCourse = (scheduleId) => { handleDeleteVideoCourse = (scheduleId) => {
...@@ -334,28 +334,28 @@ class VideoCourseList extends React.Component { ...@@ -334,28 +334,28 @@ class VideoCourseList extends React.Component {
const param = { const param = {
courseId: scheduleId, courseId: scheduleId,
storeId: User.getStoreId(), storeId: User.getStoreId(),
} };
CourseService.delVideoSchedule(param).then(() => { CourseService.delVideoSchedule(param).then(() => {
message.success('删除成功') message.success('删除成功');
this.props.onChange() this.props.onChange();
}) });
}, },
}) });
} };
// 显示分享弹窗 // 显示分享弹窗
handleShowShareModal = (record, needStr = false) => { handleShowShareModal = (record, needStr = false) => {
const { type } = this.props const { type } = this.props;
const { id, scheduleVideoUrl, chapterNum } = record const { id, scheduleVideoUrl, chapterNum } = record;
const htmlUrl = chapterNum > 1 ? `${LIVE_SHARE}course_detail/${id}?id=${User.getStoreId()}` : `${LIVE_SHARE}video_detail/${id}?id=${User.getStoreId()}` const htmlUrl = chapterNum > 1 ? `${LIVE_SHARE}course_detail/${id}?id=${User.getStoreId()}` : `${LIVE_SHARE}video_detail/${id}?id=${User.getStoreId()}`;
const longUrl = htmlUrl const longUrl = htmlUrl;
const { coverUrl, courseName } = record const { coverUrl, courseName } = record;
const shareData = { const shareData = {
longUrl, longUrl,
coverUrl, coverUrl,
scheduleVideoUrl, scheduleVideoUrl,
courseName, courseName,
} };
const shareLiveModal = ( const shareLiveModal = (
<ShareLiveModal <ShareLiveModal
...@@ -367,82 +367,82 @@ class VideoCourseList extends React.Component { ...@@ -367,82 +367,82 @@ class VideoCourseList extends React.Component {
close={() => { close={() => {
this.setState({ this.setState({
shareLiveModal: null, shareLiveModal: null,
}) });
localStorage.setItem('videoCourseItem', '') localStorage.setItem('videoCourseItem', '');
}} }}
/> />
) );
this.setState({ shareLiveModal }) this.setState({ shareLiveModal });
} };
handleChangeTable = (pagination, filters, sorter) => { handleChangeTable = (pagination, filters, sorter) => {
const { columnKey, order } = sorter const { columnKey, order } = sorter;
const { query } = this.props const { query } = this.props;
let { order: _order } = query let { order: _order } = query;
// 按创建时间升序排序 // 按创建时间升序排序
if (columnKey === 'created' && order === 'ascend') { if (columnKey === 'created' && order === 'ascend') {
_order = 'CREATED_ASC' _order = 'CREATED_ASC';
} }
// 按创建时间降序排序 // 按创建时间降序排序
if (columnKey === 'created' && order === 'descend') { if (columnKey === 'created' && order === 'descend') {
_order = 'CREATED_DESC' _order = 'CREATED_DESC';
} }
// 按更新时间升序排序 // 按更新时间升序排序
if (columnKey === 'updated' && order === 'ascend') { if (columnKey === 'updated' && order === 'ascend') {
_order = 'UPDATED_ASC' _order = 'UPDATED_ASC';
} }
// 按更新时间降序排序 // 按更新时间降序排序
if (columnKey === 'updated' && order === 'descend') { if (columnKey === 'updated' && order === 'descend') {
_order = 'UPDATED_DESC' _order = 'UPDATED_DESC';
} }
const _query = { const _query = {
...query, ...query,
orderEnum: _order, orderEnum: _order,
} };
this.props.onChange(_query) this.props.onChange(_query);
} };
handleRelatedModalShow = (item) => { handleRelatedModalShow = (item) => {
const selectPlanList = {} const selectPlanList = {};
if (item.relatedPlanList) { if (item.relatedPlanList) {
item.relatedPlanList.map((item, index) => { item.relatedPlanList.map((childItem, index) => {
selectPlanList[item.planId] = {} selectPlanList[childItem.taskId] = {};
selectPlanList[item.planId].planId = item.planId selectPlanList[childItem.taskId].taskId = childItem.taskId;
selectPlanList[item.planId].taskBaseVOList = [{ taskId: item.taskId }] selectPlanList[childItem.taskId].taskBaseVOList = [{ stageId: childItem.stageId }];
return item return item;
}) });
} }
this.setState({ this.setState({
RelatedPlanModalVisible: true, RelatedPlanModalVisible: true,
selectCourseId: item.id, selectCourseId: item.id,
selectPlanList: selectPlanList, selectPlanList: selectPlanList,
}) });
} };
closeRelatedPlanModalVisible = () => { closeRelatedPlanModalVisible = () => {
this.setState({ this.setState({
RelatedPlanModalVisible: false, RelatedPlanModalVisible: false,
}) });
} };
onChangeSelectPlanList = (selectPlanList) => { onChangeSelectPlanList = (selectPlanList) => {
this.setState({ this.setState({
selectPlanList: selectPlanList, selectPlanList: selectPlanList,
}) });
} };
onConfirmSelectPlanList = () => { onConfirmSelectPlanList = () => {
this.setState( this.setState(
{ {
RelatedPlanModalVisible: false, RelatedPlanModalVisible: false,
}, },
() => { () => {
this.props.onChange() this.props.onChange();
} }
) );
} };
render() { render() {
const { dataSource = [], totalCount, query, type, match } = this.props const { dataSource = [], totalCount, query, type, match } = this.props;
const { current, size } = query const { current, size } = query;
const { RelatedPlanModalVisible, selectPlanList, selectCourseId } = this.state const { RelatedPlanModalVisible, selectPlanList, selectCourseId } = this.state;
return ( return (
<div className={`video-course-list ${type !== 'internal' ? 'video-course-list-mt' : ''}`}> <div className={`video-course-list ${type !== 'internal' ? 'video-course-list-mt' : ''}`}>
<XMTable <XMTable
...@@ -466,8 +466,8 @@ class VideoCourseList extends React.Component { ...@@ -466,8 +466,8 @@ class VideoCourseList extends React.Component {
pageSize={size} pageSize={size}
total={totalCount} total={totalCount}
toPage={(page) => { toPage={(page) => {
const _query = { ...query, current: page + 1 } const _query = { ...query, current: page + 1 };
this.props.onChange(_query) this.props.onChange(_query);
}} }}
/> />
</div> </div>
...@@ -486,8 +486,8 @@ class VideoCourseList extends React.Component { ...@@ -486,8 +486,8 @@ class VideoCourseList extends React.Component {
<Route path={`${match.url}/video-course-detail`} component={VideoCourseDetail} /> <Route path={`${match.url}/video-course-detail`} component={VideoCourseDetail} />
<Route path={`${match.url}/course-data`} component={WatchData} /> <Route path={`${match.url}/course-data`} component={WatchData} />
</div> </div>
) );
} }
} }
export default withRouter(VideoCourseList) export default withRouter(VideoCourseList);
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