Commit e8ae7a18 by zhujian

fix:rtyuiop

parents d8339d76 3999cd76
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
* @Author: yuananting * @Author: yuananting
* @Date: 2021-08-06 17:35:35 * @Date: 2021-08-06 17:35:35
* @LastEditors: yuananting * @LastEditors: yuananting
* @LastEditTime: 2021-08-14 15:15:07 * @LastEditTime: 2021-08-16 20:52:16
* @Description: 任务中心接口 * @Description: 任务中心接口
* @Copyrigh: © 2020 杭州杰竞科技有限公司 版权所有 * @Copyrigh: © 2020 杭州杰竞科技有限公司 版权所有
* @@Copyrigh: © 2020 杭州杰竞科技有限公司 版权所有 * @@Copyrigh: © 2020 杭州杰竞科技有限公司 版权所有
...@@ -56,3 +56,11 @@ export function getTrainingCourseAutoCancel(params: object) { ...@@ -56,3 +56,11 @@ export function getTrainingCourseAutoCancel(params: object) {
export function delTaskCancelContent(params: object) { export function delTaskCancelContent(params: object) {
return Service.Hades('public/hades/delTaskCancelContent', params); return Service.Hades('public/hades/delTaskCancelContent', params);
} }
export function getStoreTaskAll(params: object) {
return Service.Hades('public/hades/getStoreTaskAll', params);
}
export function relatedCourseToTask(params: object) {
return Service.Hades('public/hades/relatedCourseToTask', params);
}
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
* @Author: yuananting * @Author: yuananting
* @Date: 2021-08-06 17:32:41 * @Date: 2021-08-06 17:32:41
* @LastEditors: yuananting * @LastEditors: yuananting
* @LastEditTime: 2021-08-14 15:16:12 * @LastEditTime: 2021-08-16 20:56:36
* @Description: 任务中心-培训任务接口 * @Description: 任务中心-培训任务接口
* @Copyrigh: © 2020 杭州杰竞科技有限公司 版权所有 * @Copyrigh: © 2020 杭州杰竞科技有限公司 版权所有
* @@Copyrigh: © 2020 杭州杰竞科技有限公司 版权所有 * @@Copyrigh: © 2020 杭州杰竞科技有限公司 版权所有
...@@ -20,6 +20,8 @@ import { ...@@ -20,6 +20,8 @@ import {
updateTrainingTaskAssign, updateTrainingTaskAssign,
getTrainingCourseAutoCancel, getTrainingCourseAutoCancel,
delTaskCancelContent, delTaskCancelContent,
getStoreTaskAll,
relatedCourseToTask,
} from '@/data-source/taskCenter/request-apis'; } from '@/data-source/taskCenter/request-apis';
export default class TaskCenterService { export default class TaskCenterService {
...@@ -82,4 +84,14 @@ export default class TaskCenterService { ...@@ -82,4 +84,14 @@ export default class TaskCenterService {
static delTaskCancelContent(params: any) { static delTaskCancelContent(params: any) {
return delTaskCancelContent(params); return delTaskCancelContent(params);
} }
// 获取培训任务学习基本信息
static getStoreTaskAll(params: any) {
return getStoreTaskAll(params);
}
// 课程关联培训任务
static relatedCourseToTask(params: any) {
return relatedCourseToTask(params);
}
} }
...@@ -28,7 +28,7 @@ import Bus from '@/core/bus'; ...@@ -28,7 +28,7 @@ import Bus from '@/core/bus';
import './LiveCourseList.less'; import './LiveCourseList.less';
import { brandLiveName } from '@/domains/brand/constants'; import { brandLiveName } from '@/domains/brand/constants';
const { confirm } = Modal const { confirm } = Modal;
const courseStateShow = { const courseStateShow = {
UN_START: { UN_START: {
code: 1, code: 1,
...@@ -50,20 +50,20 @@ const courseStateShow = { ...@@ -50,20 +50,20 @@ const courseStateShow = {
title: '未成功开课', title: '未成功开课',
color: '#999', color: '#999',
}, },
} };
class LiveCourseList extends React.Component { class LiveCourseList extends React.Component {
constructor(props) { constructor(props) {
super(props) super(props);
this.state = { this.state = {
columns: [], columns: [],
openDownloadModal: false, openDownloadModal: false,
url: '', url: '',
RelatedPlanModalVisible: false, RelatedPlanModalVisible: false,
selectPlanList: {}, selectPlanList: {},
} };
} }
componentWillMount() { componentWillMount() {
this.parseColumns() this.parseColumns();
} }
componentDidMount() { componentDidMount() {
this.getDownloadVersion() this.getDownloadVersion()
...@@ -73,13 +73,13 @@ class LiveCourseList extends React.Component { ...@@ -73,13 +73,13 @@ class LiveCourseList extends React.Component {
} }
// 显示分享弹窗 // 显示分享弹窗
handleShowShareModal = (item, needStr = false) => { handleShowShareModal = (item, needStr = false) => {
const { liveCourseId } = item const { liveCourseId } = item;
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) console.log('htmlUrl', htmlUrl, longUrl);
const shareData = { ...item, longUrl } const shareData = { ...item, longUrl };
const shareLiveModal = ( const shareLiveModal = (
<ShareLiveModal <ShareLiveModal
needStr={needStr} needStr={needStr}
...@@ -89,33 +89,33 @@ class LiveCourseList extends React.Component { ...@@ -89,33 +89,33 @@ class LiveCourseList extends React.Component {
close={() => { close={() => {
this.setState({ this.setState({
shareLiveModal: null, shareLiveModal: null,
}) });
localStorage.setItem('largeLiveCourseItem', '') localStorage.setItem('largeLiveCourseItem', '');
}} }}
/> />
) );
this.setState({ shareLiveModal }) this.setState({ shareLiveModal });
} };
//改变上架状态 //改变上架状态
changeShelfState = (index, item, checked) => { changeShelfState = (index, item, checked) => {
let _shelfState = checked ? 'YES' : 'NO' let _shelfState = checked ? 'YES' : 'NO';
const params = { const params = {
liveCourseId: item.liveCourseId, liveCourseId: item.liveCourseId,
shelfState: _shelfState, shelfState: _shelfState,
} };
CourseService.turnOnOrOffLiveCloudCourse(params).then((res) => { CourseService.turnOnOrOffLiveCloudCourse(params).then((res) => {
if (res.success) { if (res.success) {
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);
}
})
} }
});
};
// 前往上课数据页面 // 前往上课数据页面
handleLinkToClassData = (item) => { handleLinkToClassData = (item) => {
...@@ -126,8 +126,8 @@ class LiveCourseList extends React.Component { ...@@ -126,8 +126,8 @@ class LiveCourseList extends React.Component {
}); });
}; };
parseColumns = () => { parseColumns = () => {
let columns let columns;
const userRole = User.getUserRole() const userRole = User.getUserRole();
if (userRole !== 'CloudLecturer') { if (userRole !== 'CloudLecturer') {
columns = [ columns = [
{ {
...@@ -137,15 +137,15 @@ class LiveCourseList extends React.Component { ...@@ -137,15 +137,15 @@ class LiveCourseList extends React.Component {
fixed: 'left', fixed: 'left',
dataIndex: 'courseName', dataIndex: 'courseName',
render: (val, record) => { render: (val, record) => {
let hasCover = false let hasCover = false;
return ( return (
<div className='record__item'> <div className='record__item'>
{record.courseMediaVOS.map((item, index) => { {record.courseMediaVOS.map((item, index) => {
if (item.contentType === 'COVER') { if (item.contentType === 'COVER') {
hasCover = true hasCover = true;
return <img key={item.mediaContent + index} className='course-cover' src={item.mediaUrl} alt='' /> return <img key={item.mediaContent + index} className='course-cover' src={item.mediaUrl} alt='' />;
} else { } else {
return null return null;
} }
})} })}
{!hasCover && <img className='course-cover' src={'https://image.xiaomaiketang.com/xm/Yip2YtFDwH.png'} alt='' />} {!hasCover && <img className='course-cover' src={'https://image.xiaomaiketang.com/xm/Yip2YtFDwH.png'} alt='' />}
...@@ -191,7 +191,7 @@ class LiveCourseList extends React.Component { ...@@ -191,7 +191,7 @@ class LiveCourseList extends React.Component {
<span key={item.adminId + index}> <span key={item.adminId + index}>
{item.adminName} {index < record.admins.length - 1 && <span></span>}{' '} {item.adminName} {index < record.admins.length - 1 && <span></span>}{' '}
</span> </span>
) );
})} })}
</span> </span>
</Tooltip> </Tooltip>
...@@ -204,7 +204,7 @@ class LiveCourseList extends React.Component { ...@@ -204,7 +204,7 @@ class LiveCourseList extends React.Component {
<span> <span>
{item.adminName} {index < record.admins.length - 1 && <span></span>}{' '} {item.adminName} {index < record.admins.length - 1 && <span></span>}{' '}
</span> </span>
) );
})} })}
</span> </span>
</Otherwise> </Otherwise>
...@@ -213,7 +213,7 @@ class LiveCourseList extends React.Component { ...@@ -213,7 +213,7 @@ class LiveCourseList extends React.Component {
</div> </div>
</div> </div>
</div> </div>
) );
}, },
}, },
{ {
...@@ -244,7 +244,7 @@ class LiveCourseList extends React.Component { ...@@ -244,7 +244,7 @@ class LiveCourseList extends React.Component {
key: 'couseCatalog', key: 'couseCatalog',
dataIndex: 'couseCatalog', dataIndex: 'couseCatalog',
render: (val, item) => { render: (val, item) => {
return <div className='categoryName'>{item.categorySonName}</div> return <div className='categoryName'>{item.categorySonName}</div>;
}, },
}, },
{ {
...@@ -260,11 +260,11 @@ class LiveCourseList extends React.Component { ...@@ -260,11 +260,11 @@ class LiveCourseList extends React.Component {
this.setState({ this.setState({
editData: item, editData: item,
openCoursewareModal: true, openCoursewareModal: true,
}) });
}}> }}>
{item.courseDocumentCount} {item.courseDocumentCount}
</span> </span>
) );
}, },
}, },
{ {
...@@ -277,11 +277,11 @@ class LiveCourseList extends React.Component { ...@@ -277,11 +277,11 @@ class LiveCourseList extends React.Component {
<span <span
className='iconfont icon quota-icon' className='iconfont icon quota-icon'
onClick={() => { onClick={() => {
this.handleLinkToClassData(item) this.handleLinkToClassData(item);
}}> }}>
&#xe7d6; &#xe7d6;
</span> </span>
) );
}, },
}, },
{ {
...@@ -313,7 +313,7 @@ class LiveCourseList extends React.Component { ...@@ -313,7 +313,7 @@ class LiveCourseList extends React.Component {
defaultChecked={item.shelfState === 'YES' ? true : false} defaultChecked={item.shelfState === 'YES' ? true : false}
onChange={(checked) => this.changeShelfState(index, item, checked)} onChange={(checked) => this.changeShelfState(index, item, checked)}
/> />
) );
}, },
}, },
{ {
...@@ -324,7 +324,7 @@ class LiveCourseList extends React.Component { ...@@ -324,7 +324,7 @@ class LiveCourseList extends React.Component {
sorter: true, sorter: true,
render: (val, item) => { render: (val, item) => {
// -29000:与后端约定 在初始化学院时,创建时间(标志位-29000)默认展示为'-' // -29000:与后端约定 在初始化学院时,创建时间(标志位-29000)默认展示为'-'
return <span style={{ whiteSpace: 'nowrap' }}>{val === -29000 ? '-' : window.formatDate('YYYY-MM-DD H:i', val)}</span> return <span style={{ whiteSpace: 'nowrap' }}>{val === -29000 ? '-' : window.formatDate('YYYY-MM-DD H:i', val)}</span>;
}, },
}, },
{ {
...@@ -343,7 +343,7 @@ class LiveCourseList extends React.Component { ...@@ -343,7 +343,7 @@ class LiveCourseList extends React.Component {
<span key={index}> <span key={index}>
{item.planName} {index < record.relatedPlanList.length - 1 && <span></span>}{' '} {item.planName} {index < record.relatedPlanList.length - 1 && <span></span>}{' '}
</span> </span>
) );
})} })}
</Tooltip> </Tooltip>
</When> </When>
...@@ -352,7 +352,7 @@ class LiveCourseList extends React.Component { ...@@ -352,7 +352,7 @@ class LiveCourseList extends React.Component {
</Otherwise> </Otherwise>
</Choose> </Choose>
</div> </div>
) );
}, },
}, },
{ {
...@@ -426,7 +426,7 @@ class LiveCourseList extends React.Component { ...@@ -426,7 +426,7 @@ class LiveCourseList extends React.Component {
key='share' key='share'
className='operate__item' className='operate__item'
onClick={() => { onClick={() => {
this.handleShowShareModal(item) this.handleShowShareModal(item);
}}> }}>
分享 分享
</div> </div>
...@@ -456,10 +456,10 @@ class LiveCourseList extends React.Component { ...@@ -456,10 +456,10 @@ class LiveCourseList extends React.Component {
</div> </div>
)} )}
</div> </div>
) );
}, },
}, },
] ];
} else { } else {
columns = [ columns = [
{ {
...@@ -468,13 +468,13 @@ class LiveCourseList extends React.Component { ...@@ -468,13 +468,13 @@ class LiveCourseList extends React.Component {
key: 'course', key: 'course',
dataIndex: 'courseName', dataIndex: 'courseName',
render: (val, record) => { render: (val, record) => {
let hasCover = false let hasCover = false;
return ( return (
<div className='record__item'> <div className='record__item'>
{record.courseMediaVOS.map((item, index) => { {record.courseMediaVOS.map((item, index) => {
if (item.contentType === 'COVER') { if (item.contentType === 'COVER') {
hasCover = true hasCover = true;
return <img className='course-cover' src={item.mediaUrl} alt='' /> return <img className='course-cover' src={item.mediaUrl} alt='' />;
} }
})} })}
{!hasCover && <img className='course-cover' src={'https://image.xiaomaiketang.com/xm/Yip2YtFDwH.png'} alt='' />} {!hasCover && <img className='course-cover' src={'https://image.xiaomaiketang.com/xm/Yip2YtFDwH.png'} alt='' />}
...@@ -519,7 +519,7 @@ class LiveCourseList extends React.Component { ...@@ -519,7 +519,7 @@ class LiveCourseList extends React.Component {
<span> <span>
{item.adminName} {index < record.admins.length - 1 && <span></span>}{' '} {item.adminName} {index < record.admins.length - 1 && <span></span>}{' '}
</span> </span>
) );
})} })}
</span> </span>
</Tooltip> </Tooltip>
...@@ -532,7 +532,7 @@ class LiveCourseList extends React.Component { ...@@ -532,7 +532,7 @@ class LiveCourseList extends React.Component {
<span> <span>
{item.adminName} {index < record.admins.length - 1 && <span></span>}{' '} {item.adminName} {index < record.admins.length - 1 && <span></span>}{' '}
</span> </span>
) );
})} })}
</span> </span>
</Otherwise> </Otherwise>
...@@ -541,7 +541,7 @@ class LiveCourseList extends React.Component { ...@@ -541,7 +541,7 @@ class LiveCourseList extends React.Component {
</div> </div>
</div> </div>
</div> </div>
) );
}, },
}, },
{ {
...@@ -550,7 +550,7 @@ class LiveCourseList extends React.Component { ...@@ -550,7 +550,7 @@ class LiveCourseList extends React.Component {
key: 'couseCatalog', key: 'couseCatalog',
dataIndex: 'couseCatalog', dataIndex: 'couseCatalog',
render: (val, item) => { render: (val, item) => {
return <div className='categoryName'>{item.categorySonName}</div> return <div className='categoryName'>{item.categorySonName}</div>;
}, },
}, },
{ {
...@@ -566,11 +566,11 @@ class LiveCourseList extends React.Component { ...@@ -566,11 +566,11 @@ class LiveCourseList extends React.Component {
this.setState({ this.setState({
editData: item, editData: item,
openCoursewareModal: true, openCoursewareModal: true,
}) });
}}> }}>
{item.courseDocumentCount} {item.courseDocumentCount}
</span> </span>
) );
}, },
}, },
{ {
...@@ -583,11 +583,11 @@ class LiveCourseList extends React.Component { ...@@ -583,11 +583,11 @@ class LiveCourseList extends React.Component {
<span <span
className='iconfont icon quota-icon' className='iconfont icon quota-icon'
onClick={() => { onClick={() => {
this.handleLinkToClassData(item) this.handleLinkToClassData(item);
}}> }}>
&#xe7d6; &#xe7d6;
</span> </span>
) );
}, },
}, },
{ {
...@@ -597,7 +597,7 @@ class LiveCourseList extends React.Component { ...@@ -597,7 +597,7 @@ class LiveCourseList extends React.Component {
dataIndex: 'created', dataIndex: 'created',
sorter: true, sorter: true,
render: (val, item) => { render: (val, item) => {
return <span>{window.formatDate('YYYY-MM-DD H:i', val)}</span> return <span>{window.formatDate('YYYY-MM-DD H:i', val)}</span>;
}, },
}, },
{ {
...@@ -616,7 +616,7 @@ class LiveCourseList extends React.Component { ...@@ -616,7 +616,7 @@ class LiveCourseList extends React.Component {
<span> <span>
{item.planName} {index < record.relatedPlanList.length - 1 && <span></span>}{' '} {item.planName} {index < record.relatedPlanList.length - 1 && <span></span>}{' '}
</span> </span>
) );
})} })}
</Tooltip> </Tooltip>
</When> </When>
...@@ -625,36 +625,36 @@ class LiveCourseList extends React.Component { ...@@ -625,36 +625,36 @@ class LiveCourseList extends React.Component {
</Otherwise> </Otherwise>
</Choose> </Choose>
</div> </div>
) );
}, },
}, },
] ];
}
this.setState({ columns })
} }
this.setState({ columns });
};
handleAdminName = (adminArray) => { handleAdminName = (adminArray) => {
let adminStr = '' let adminStr = '';
adminArray.forEach((item, index) => { adminArray.forEach((item, index) => {
if (index < adminArray.length - 1) { if (index < adminArray.length - 1) {
adminStr = adminStr + item.adminName + '、' adminStr = adminStr + item.adminName + '、';
} else { } else {
adminStr = adminStr + item.adminName adminStr = adminStr + item.adminName;
}
})
return adminStr
} }
});
return adminStr;
};
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;
};
renderMoreOperate = (item) => { renderMoreOperate = (item) => {
let now = new Date().getTime() let now = new Date().getTime()
...@@ -746,10 +746,10 @@ class LiveCourseList extends React.Component { ...@@ -746,10 +746,10 @@ class LiveCourseList extends React.Component {
width: 440, width: 440,
height: 188, height: 188,
onOk: () => { onOk: () => {
this.deleteConfirm(record) this.deleteConfirm(record);
}, },
}) });
} };
deleteConfirm = (item) => { deleteConfirm = (item) => {
const params = { const params = {
liveCourseId: item.liveCourseId, liveCourseId: item.liveCourseId,
...@@ -785,8 +785,8 @@ class LiveCourseList extends React.Component { ...@@ -785,8 +785,8 @@ class LiveCourseList extends React.Component {
}; };
refreshCourseList = () => { refreshCourseList = () => {
this.props.onChange(this.props.query) this.props.onChange(this.props.query);
} };
//进入直播间 //进入直播间
handleEnterLiveRoom = (item) => { handleEnterLiveRoom = (item) => {
if (item.thirdPartType === "WECHAT") { if (item.thirdPartType === "WECHAT") {
...@@ -844,48 +844,48 @@ class LiveCourseList extends React.Component { ...@@ -844,48 +844,48 @@ class LiveCourseList extends React.Component {
&#xe834; &#xe834;
</span> </span>
), ),
}) });
} else { } else {
CourseService.getLiveCloudCourseDetail({ CourseService.getLiveCloudCourseDetail({
liveCourseId: item.liveCourseId, liveCourseId: item.liveCourseId,
}).then((res) => { }).then((res) => {
const url = `xmqx://liveCourseId=${item.liveCourseId}` const url = `xmqx://liveCourseId=${item.liveCourseId}`;
if (res.result.courseState === 'FINISH') { if (res.result.courseState === 'FINISH') {
Modal.warning({ Modal.warning({
title: '刷新页面', title: '刷新页面',
icon: <QuestionCircleOutlined />, icon: <QuestionCircleOutlined />,
content: '课次已结束,请刷新一下', content: '课次已结束,请刷新一下',
onOk: () => { onOk: () => {
this.refreshCourseList() this.refreshCourseList();
}, },
}) });
} else { } else {
this.setState({ url, openDownloadModal: true }) this.setState({ url, openDownloadModal: true });
}
})
} }
});
} }
};
onShowSizeChange = (current, size) => { onShowSizeChange = (current, size) => {
if (current === size) { if (current === size) {
return return;
}
let _query = this.props.query
_query.size = size
this.props.onChange(_query)
} }
let _query = this.props.query;
_query.size = size;
this.props.onChange(_query);
};
getDownloadVersion() { getDownloadVersion() {
const isMac = /macintosh|mac os x/i.test(navigator.userAgent) const isMac = /macintosh|mac os x/i.test(navigator.userAgent);
// 判断学员系统 // 判断学员系统
let platform let platform;
if (!isMac) { if (!isMac) {
platform = 1 platform = 1;
} else { } else {
platform = 4 platform = 4;
} }
BaseService.getLastedVersion({ model: 5, platform }).then((res) => { BaseService.getLastedVersion({ model: 5, platform }).then((res) => {
const { result = {} } = res const { result = {} } = res;
this.setState({ downloadUrl: result.releaseUrl }) this.setState({ downloadUrl: result.releaseUrl });
}) });
} }
handleViewPlayBack = (item) => { handleViewPlayBack = (item) => {
if (item.thirdPartType === "WECHAT") { if (item.thirdPartType === "WECHAT") {
...@@ -917,78 +917,79 @@ class LiveCourseList extends React.Component { ...@@ -917,78 +917,79 @@ class LiveCourseList extends React.Component {
} }
let htmlUrl; let htmlUrl;
if (item.teacherId === User.getUserId()) { if (item.teacherId === User.getUserId()) {
htmlUrl = `${LIVE_SHARE}replay/${item.liveCourseId}?teacherId=${User.getUserId()}&id=${User.getStoreId()}` htmlUrl = `${LIVE_SHARE}replay/${item.liveCourseId}?teacherId=${User.getUserId()}&id=${User.getStoreId()}`;
} else if (_.pluck(item.admins, 'adminId').includes(User.getUserId())) { } else if (_.pluck(item.admins, 'adminId').includes(User.getUserId())) {
htmlUrl = `${LIVE_SHARE}replay/${item.liveCourseId}?userId=${User.getUserId()}&id=${User.getStoreId()}` htmlUrl = `${LIVE_SHARE}replay/${item.liveCourseId}?userId=${User.getUserId()}&id=${User.getStoreId()}`;
} else { } else {
htmlUrl = `${LIVE_SHARE}replay/${item.liveCourseId}?id=${User.getStoreId()}` htmlUrl = `${LIVE_SHARE}replay/${item.liveCourseId}?id=${User.getStoreId()}`;
}
window.open(htmlUrl)
} }
window.open(htmlUrl);
};
handleRelatedModalShow = (item) => { handleRelatedModalShow = (item) => {
const selectPlanList = {} const selectPlanList = {};
if (item.relatedPlanList) { if (item.relatedPlanList) {
item.relatedPlanList.map((item, index) => { item.relatedPlanList.map((item, index) => {
selectPlanList[item.planId] = {} selectPlanList[item.taskId] = {};
selectPlanList[item.planId].planId = item.planId selectPlanList[item.taskId].taskId = item.taskId;
selectPlanList[item.planId].taskBaseVOList = [{ taskId: item.taskId }] selectPlanList[item.taskId].taskBaseVOList = [{ taskId: item.taskId }];
return item return item;
}) });
} }
console.log('selectPlanList:', selectPlanList);
this.setState({ this.setState({
RelatedPlanModalVisible: true, RelatedPlanModalVisible: true,
selectCourseId: item.liveCourseId, selectCourseId: item.liveCourseId,
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();
}
)
} }
);
};
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 _columnKey let _columnKey;
let _order let _order;
// 按创建时间升序排序 // 按创建时间升序排序
if (columnKey === 'created' && order === 'ascend') { if (columnKey === 'created' && order === 'ascend') {
_columnKey = 'CREATED' _columnKey = 'CREATED';
_order = 'SORT_ASC' _order = 'SORT_ASC';
} }
// 按创建时间降序排序 // 按创建时间降序排序
if (columnKey === 'created' && order === 'descend') { if (columnKey === 'created' && order === 'descend') {
_columnKey = 'CREATED' _columnKey = 'CREATED';
_order = 'SORT_DESC' _order = 'SORT_DESC';
} }
const _query = { const _query = {
...query, ...query,
sortMap: {}, sortMap: {},
} };
_query.sortMap[_columnKey] = _order _query.sortMap[_columnKey] = _order;
this.props.onChange(_query) 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;
const { openDownloadModal, downloadUrl, url, columns, openCoursewareModal, editData, RelatedPlanModalVisible, selectCourseId, selectPlanList } = this.state const { openDownloadModal, downloadUrl, url, columns, openCoursewareModal, editData, RelatedPlanModalVisible, selectCourseId, selectPlanList } = this.state;
const { match } = this.props const { match } = this.props;
return ( return (
<div className='live-course-list'> <div className='live-course-list'>
...@@ -1014,8 +1015,8 @@ class LiveCourseList extends React.Component { ...@@ -1014,8 +1015,8 @@ class LiveCourseList extends React.Component {
pageSize={size} pageSize={size}
total={parseInt(total)} total={parseInt(total)}
toPage={(page) => { toPage={(page) => {
const _query = { ...query, current: page + 1 } const _query = { ...query, current: page + 1 };
this.props.onChange(_query) this.props.onChange(_query);
}} }}
onShowSizeChange={this.onShowSizeChange} onShowSizeChange={this.onShowSizeChange}
/> />
...@@ -1026,8 +1027,8 @@ class LiveCourseList extends React.Component { ...@@ -1026,8 +1027,8 @@ class LiveCourseList extends React.Component {
<ManageCoursewareModal <ManageCoursewareModal
data={editData} data={editData}
onCancel={() => { onCancel={() => {
this.props.onChange() this.props.onChange();
this.setState({ openCoursewareModal: false }) this.setState({ openCoursewareModal: false });
}} }}
/> />
)} )}
...@@ -1038,7 +1039,7 @@ class LiveCourseList extends React.Component { ...@@ -1038,7 +1039,7 @@ class LiveCourseList extends React.Component {
this.setState({ this.setState({
url: '', url: '',
openDownloadModal: false, openDownloadModal: false,
}) });
}} }}
/> />
)} )}
...@@ -1055,8 +1056,8 @@ class LiveCourseList extends React.Component { ...@@ -1055,8 +1056,8 @@ class LiveCourseList extends React.Component {
<iframe src={url} style={{ display: 'none' }} title='navigation' /> <iframe src={url} style={{ display: 'none' }} title='navigation' />
<Route path={`${match.url}/live-course-data`} component={DataList} /> <Route path={`${match.url}/live-course-data`} component={DataList} />
</div> </div>
) );
} }
} }
export default withRouter(LiveCourseList) export default withRouter(LiveCourseList);
...@@ -2,7 +2,7 @@ import User from '@/common/js/user'; ...@@ -2,7 +2,7 @@ import User from '@/common/js/user';
import college from '@/common/lottie/college'; import college from '@/common/lottie/college';
import { PageControl, XMTable } from '@/components'; import { PageControl, XMTable } from '@/components';
import CourseService from '@/domains/course-domain/CourseService'; import CourseService from '@/domains/course-domain/CourseService';
import PlanService from '@/domains/plan-domain/planService'; import TaskCenterService from '@/domains/task-center-domain/TaskCenterService';
import { Input, Modal, Tooltip } from 'antd'; import { Input, Modal, Tooltip } from 'antd';
import React from 'react'; import React from 'react';
import _ from 'underscore'; import _ from 'underscore';
...@@ -33,7 +33,7 @@ class RelatedPlanModal extends React.Component { ...@@ -33,7 +33,7 @@ class RelatedPlanModal extends React.Component {
size, size,
storeId: User.getStoreId(), storeId: User.getStoreId(),
}; };
PlanService.getStorePlanAll(params).then((res) => { TaskCenterService.getStoreTaskAll(params).then((res) => {
const { result = {} } = res; const { result = {} } = res;
const { records = [], total = 0 } = result; const { records = [], total = 0 } = result;
this.setState({ this.setState({
...@@ -66,20 +66,24 @@ class RelatedPlanModal extends React.Component { ...@@ -66,20 +66,24 @@ class RelatedPlanModal extends React.Component {
}; };
renderTitle = () => { renderTitle = () => {
return <div className="tip-title"> return (
<div className='tip-title'>
<p>为了不影响学员学习,系统已对数据进行筛选</p> <p>为了不影响学员学习,系统已对数据进行筛选</p>
<p>1、课程不能直接关联「已发布」的培训任务筛选;</p> <p>1、课程不能直接关联「已发布」的培训任务筛选;</p>
<p>2、一个课程不能重复出现在同一培训任务中</p> <p>2、一个课程不能重复出现在同一培训任务中</p>
</div> </div>
} );
};
renderTableTitle = ()=> { renderTableTitle = () => {
return <div> return (
<Tooltip title={this.renderTitle()} overlayClassName="table-title-tooltip"> <div>
<Tooltip title={this.renderTitle()} overlayClassName='table-title-tooltip'>
培训任务<span className='icon iconfont table-title'>&#xe6f2;</span> 培训任务<span className='icon iconfont table-title'>&#xe6f2;</span>
</Tooltip> </Tooltip>
</div> </div>
} );
};
// 请求表头 // 请求表头
parsePlanColumns = () => { parsePlanColumns = () => {
...@@ -89,9 +93,7 @@ class RelatedPlanModal extends React.Component { ...@@ -89,9 +93,7 @@ class RelatedPlanModal extends React.Component {
key: 'planName', key: 'planName',
dataIndex: 'planName', dataIndex: 'planName',
render: (val, record) => { render: (val, record) => {
return <span>{val} return <span>{val}</span>;
</span>;
}, },
}, },
]; ];
...@@ -111,38 +113,38 @@ class RelatedPlanModal extends React.Component { ...@@ -111,38 +113,38 @@ class RelatedPlanModal extends React.Component {
]; ];
return columns; return columns;
}; };
selectPlanList = (record, selected, planId) => { selectPlanList = (record, selected, taskId) => {
const { selectPlanList } = this.props; const { selectPlanList } = this.props;
let _selectPlanList = { ...selectPlanList }; let _selectPlanList = { ...selectPlanList };
if (selected) { if (selected) {
if (!_selectPlanList[planId]) { if (!_selectPlanList[taskId]) {
_selectPlanList[planId] = {}; _selectPlanList[taskId] = {};
} }
_selectPlanList[planId].taskBaseVOList = []; _selectPlanList[taskId].taskBaseVOList = [];
_selectPlanList[planId].planId = planId; _selectPlanList[taskId].taskId = taskId;
_selectPlanList[planId].taskBaseVOList.push(record); _selectPlanList[taskId].taskBaseVOList.push(record);
} else { } else {
if (!_selectPlanList[planId]) { console.log(_selectPlanList[taskId]);
_selectPlanList[planId] = {}; if (!_selectPlanList[taskId]) {
_selectPlanList[taskId] = {};
} }
_selectPlanList[planId].taskBaseVOList = []; _selectPlanList[taskId].taskBaseVOList = [];
_selectPlanList[planId].planId = planId; _selectPlanList[taskId].taskId = taskId;
} }
this.props.onChange(_selectPlanList); this.props.onChange(_selectPlanList);
// this.setState({selectPlanList:_selectPlanList});
}; };
handleSelectPlanListData(selectPlanList) { handleSelectPlanListData(selectPlanList) {
let _selectPlanList = []; let _selectPlanList = [];
for (let key in selectPlanList) { for (let key in selectPlanList) {
let item = {}; let item = {};
if (selectPlanList[key].taskBaseVOList) { if (selectPlanList[key].taskBaseVOList) {
item.planId = selectPlanList[key].planId; item.taskId = selectPlanList[key].taskId;
if (selectPlanList[key].taskBaseVOList[0]) { if (selectPlanList[key].taskBaseVOList[0]) {
item.taskId = selectPlanList[key].taskBaseVOList[0].taskId; item.stageId = selectPlanList[key].taskBaseVOList[0].taskId;
} }
} }
if (item.taskId) { if (item.stageId) {
_selectPlanList.push(item); _selectPlanList.push(item);
} }
} }
...@@ -152,10 +154,10 @@ class RelatedPlanModal extends React.Component { ...@@ -152,10 +154,10 @@ class RelatedPlanModal extends React.Component {
const { selectPlanList } = this.props; const { selectPlanList } = this.props;
const params = { const params = {
courseId: this.props.selectCourseId, courseId: this.props.selectCourseId,
relatedPlanList: this.handleSelectPlanListData(selectPlanList), relatedTaskList: this.handleSelectPlanListData(selectPlanList),
storeId: User.getStoreId(), storeId: User.getStoreId(),
}; };
CourseService.relatedCourseToPlan(params).then((res) => { TaskCenterService.relatedCourseToTask(params).then((res) => {
this.props.onConfirm(); this.props.onConfirm();
}); });
}; };
...@@ -175,6 +177,7 @@ class RelatedPlanModal extends React.Component { ...@@ -175,6 +177,7 @@ 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='关联培训任务'
...@@ -218,7 +221,7 @@ class RelatedPlanModal extends React.Component { ...@@ -218,7 +221,7 @@ class RelatedPlanModal extends React.Component {
image: college, image: college,
description: '暂无数据', description: '暂无数据',
}} }}
rowKey={(record) => record.planId} rowKey={(record) => record.taskId}
className='plan-table' className='plan-table'
dataSource={dataSource} dataSource={dataSource}
columns={this.parsePlanColumns()} columns={this.parsePlanColumns()}
...@@ -228,12 +231,14 @@ class RelatedPlanModal extends React.Component { ...@@ -228,12 +231,14 @@ class RelatedPlanModal extends React.Component {
return; return;
} }
if (_record.taskBaseVOList.length !== 0) { if (_record.taskBaseVOList.length !== 0) {
const selectPlan = selectPlanList[_record.planId]; const selectPlan = selectPlanList[_record.taskId];
let taskBaseVOList = []; let taskBaseVOList = [];
if (selectPlan) { if (selectPlan) {
taskBaseVOList = selectPlan.taskBaseVOList; taskBaseVOList = selectPlan.taskBaseVOList;
} }
console.log('selectPlan==============taskBaseVOList:', taskBaseVOList);
return ( return (
<div> <div>
<XMTable <XMTable
...@@ -250,7 +255,7 @@ class RelatedPlanModal extends React.Component { ...@@ -250,7 +255,7 @@ class RelatedPlanModal extends React.Component {
type: 'checkbox', type: 'checkbox',
selectedRowKeys: _.pluck(taskBaseVOList, 'taskId'), selectedRowKeys: _.pluck(taskBaseVOList, 'taskId'),
onSelect: (record, selected) => { onSelect: (record, selected) => {
this.selectPlanList(record, selected, _record.planId); this.selectPlanList(record, selected, _record.taskId);
}, },
onSelectAll: (selected, _selectedRows, changeRows) => {}, onSelectAll: (selected, _selectedRows, changeRows) => {},
}} }}
......
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
* @Author: yuananting * @Author: yuananting
* @Date: 2021-08-16 17:35:15 * @Date: 2021-08-16 17:35:15
* @LastEditors: yuananting * @LastEditors: yuananting
* @LastEditTime: 2021-08-16 19:54:39 * @LastEditTime: 2021-08-16 22:06:40
* @Description: 描述一下咯 * @Description: 描述一下咯
* @Copyrigh: © 2020 杭州杰竞科技有限公司 版权所有 * @Copyrigh: © 2020 杭州杰竞科技有限公司 版权所有
* @@Copyrigh: © 2020 杭州杰竞科技有限公司 版权所有 * @@Copyrigh: © 2020 杭州杰竞科技有限公司 版权所有
...@@ -15,10 +15,10 @@ import ENUM from '../../enum'; ...@@ -15,10 +15,10 @@ import ENUM from '../../enum';
import './course.less'; import './course.less';
function CourseTable(props: any) { function CourseTable(props: any) {
const taskId = props.match.params.taskId.replace(/\?.+/, '');
const IndexText = ['一', '二', '三', '四', '五', '六', '七', '八', '九', '十']; const IndexText = ['一', '二', '三', '四', '五', '六', '七', '八', '九', '十'];
const [list, setList] = useState<any[]>([]); const [list, setList] = useState<any[]>([]);
useEffect(() => { useEffect(() => {
console.log(props.info, 'rtyuio');
setList(props.info.trainingStageList || []); setList(props.info.trainingStageList || []);
}, [props.info.trainingStageList]); }, [props.info.trainingStageList]);
...@@ -68,11 +68,7 @@ function CourseTable(props: any) { ...@@ -68,11 +68,7 @@ function CourseTable(props: any) {
})} })}
</div> </div>
<div className='expired'> <div className='expired'>
<div className='title'>失效课程</div> <ExpiredCourseList taskId={taskId} />
<div className='list'>
<ExpiredCourseList />
</div>
</div> </div>
</div> </div>
); );
......
...@@ -42,7 +42,7 @@ ...@@ -42,7 +42,7 @@
text-align: center; text-align: center;
margin-left: 24px; margin-left: 24px;
position: relative; position: relative;
top: 4px; top: 2px;
height: 20px; height: 20px;
} }
} }
......
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
* @Author: yuananting * @Author: yuananting
* @Date: 2021-08-03 10:47:59 * @Date: 2021-08-03 10:47:59
* @LastEditors: yuananting * @LastEditors: yuananting
* @LastEditTime: 2021-08-16 19:48:44 * @LastEditTime: 2021-08-16 22:04:31
* @Description: 编辑培训任务-失效课程 * @Description: 编辑培训任务-失效课程
* @Copyrigh: © 2020 杭州杰竞科技有限公司 版权所有 * @Copyrigh: © 2020 杭州杰竞科技有限公司 版权所有
* @@Copyrigh: © 2020 杭州杰竞科技有限公司 版权所有 * @@Copyrigh: © 2020 杭州杰竞科技有限公司 版权所有
...@@ -14,20 +14,16 @@ import ENUM from '../../enum'; ...@@ -14,20 +14,16 @@ import ENUM from '../../enum';
import moment from 'moment'; import moment from 'moment';
import TaskCenterService from '@/domains/task-center-domain/TaskCenterService'; import TaskCenterService from '@/domains/task-center-domain/TaskCenterService';
function ExpiredCourseList() { function ExpiredCourseList(props) {
const taskId = window.getParameterByName('taskId');
const type = window.getParameterByName('type');
const [expiredCourseList, setExpiredCourseList] = useState([]); // 失效课程 const [expiredCourseList, setExpiredCourseList] = useState([]); // 失效课程
useEffect(() => { useEffect(() => {
if (type === 'edit') {
getTrainingCourseAutoCancel(); getTrainingCourseAutoCancel();
}
}, []); }, []);
// 获取培训任务失效的课程 // 获取培训任务失效的课程
function getTrainingCourseAutoCancel() { function getTrainingCourseAutoCancel() {
TaskCenterService.getTrainingCourseAutoCancel({ taskId }).then((res) => { TaskCenterService.getTrainingCourseAutoCancel({ taskId: props.taskId }).then((res) => {
setExpiredCourseList(res.result); setExpiredCourseList(res.result);
}); });
} }
......
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
* @Author: yuananting * @Author: yuananting
* @Date: 2021-07-30 16:33:58 * @Date: 2021-07-30 16:33:58
* @LastEditors: yuananting * @LastEditors: yuananting
* @LastEditTime: 2021-08-16 19:50:01 * @LastEditTime: 2021-08-16 22:10:08
* @Description: 任务中心-培训任务-新建-培训内容 * @Description: 任务中心-培训任务-新建-培训内容
* @Copyrigh: © 2020 杭州杰竞科技有限公司 版权所有 * @Copyrigh: © 2020 杭州杰竞科技有限公司 版权所有
* @@Copyrigh: © 2020 杭州杰竞科技有限公司 版权所有 * @@Copyrigh: © 2020 杭州杰竞科技有限公司 版权所有
...@@ -58,11 +58,12 @@ class TrainContent extends Component { ...@@ -58,11 +58,12 @@ class TrainContent extends Component {
showCourseDrawer: false, showCourseDrawer: false,
showExamDrawer: false, showExamDrawer: false,
selectedStageIndex: 0, selectedStageIndex: 0,
type: window.getParameterByName('type'),
showStandardDetail: false, // 是否展开高级设置 showStandardDetail: false, // 是否展开高级设置
}; };
} }
componentDidMount() {} componentDidMount() { }
setTrianTypeOption = (index) => { setTrianTypeOption = (index) => {
return ( return (
...@@ -460,6 +461,8 @@ class TrainContent extends Component { ...@@ -460,6 +461,8 @@ class TrainContent extends Component {
const { startCheck } = this.props; const { startCheck } = this.props;
const taskId = window.getParameterByName('taskId');
return ( return (
<div className='train-content-page'> <div className='train-content-page'>
<div className='train-content__warp'> <div className='train-content__warp'>
...@@ -484,7 +487,10 @@ class TrainContent extends Component { ...@@ -484,7 +487,10 @@ class TrainContent extends Component {
{showExamDrawer && <RelatedExamDrawer basicInfo={basicInfo} stageList={stageList} onClose={this.onCloseExamDrawer} onSave={this.confirmCreateExam} />} {showExamDrawer && <RelatedExamDrawer basicInfo={basicInfo} stageList={stageList} onClose={this.onCloseExamDrawer} onSave={this.confirmCreateExam} />}
</div> </div>
<ExpiredCourseList /> {
this.state.type === 'edit' && <ExpiredCourseList taskId={taskId} />
}
<div className='finish-standard__warp'> <div className='finish-standard__warp'>
<div <div
......
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
* @Author: yuananting * @Author: yuananting
* @Date: 2021-07-28 14:56:52 * @Date: 2021-07-28 14:56:52
* @LastEditors: yuananting * @LastEditors: yuananting
* @LastEditTime: 2021-08-16 09:57:42 * @LastEditTime: 2021-08-16 22:08:57
* @Description: 描述一下咯 * @Description: 描述一下咯
* @Copyrigh: © 2020 杭州杰竞科技有限公司 版权所有 * @Copyrigh: © 2020 杭州杰竞科技有限公司 版权所有
*/ */
...@@ -235,7 +235,6 @@ function TrainList(props) { ...@@ -235,7 +235,6 @@ function TrainList(props) {
width: '12%', width: '12%',
key: 'cultureCustomerNum', key: 'cultureCustomerNum',
dataIndex: 'cultureCustomerNum', dataIndex: 'cultureCustomerNum',
sorter: true,
render: (val, record) => { render: (val, record) => {
return ( return (
<Tooltip <Tooltip
...@@ -279,7 +278,6 @@ function TrainList(props) { ...@@ -279,7 +278,6 @@ function TrainList(props) {
width: '11.5%', width: '11.5%',
key: 'finishPercent', key: 'finishPercent',
dataIndex: 'finishPercent', dataIndex: 'finishPercent',
sorter: true,
render: (val) => { render: (val) => {
return <span>{val}%</span>; return <span>{val}%</span>;
}, },
...@@ -387,28 +385,6 @@ function TrainList(props) { ...@@ -387,28 +385,6 @@ function TrainList(props) {
let _columnKey; let _columnKey;
let _order; let _order;
if (columnKey == 'cultureCustomerNum' && order === 'ascend') {
// 按学习人数升序排序
_columnKey = 'CUSTOMER_NUM';
_order = 'SORT_ASC';
}
if (columnKey == 'cultureCustomerNum' && order === 'descend') {
// 按学习人数降序排序
_columnKey = 'CUSTOMER_NUM';
_order = 'SORT_DESC';
}
if (columnKey == 'finishPercent' && order === 'ascend') {
// 按完成率升序排序
_columnKey = 'FINISH_PERCENT';
_order = 'SORT_ASC';
}
if (columnKey == 'finishPercent' && order === 'descend') {
// 按完成率降序排序
_columnKey = 'FINISH_PERCENT';
_order = 'SORT_DESC';
}
if (columnKey === 'created' && order === 'ascend') { if (columnKey === 'created' && order === 'ascend') {
// 按创建时间升序排序 // 按创建时间升序排序
_columnKey = 'CREATED'; _columnKey = 'CREATED';
......
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
* @Author: yuananting * @Author: yuananting
* @Date: 2021-08-05 17:09:36 * @Date: 2021-08-05 17:09:36
* @LastEditors: yuananting * @LastEditors: yuananting
* @LastEditTime: 2021-08-16 20:30:31 * @LastEditTime: 2021-08-16 20:35:24
* @Description: 新建培训任务-选择指派对象 * @Description: 新建培训任务-选择指派对象
* @Copyrigh: © 2020 杭州杰竞科技有限公司 版权所有 * @Copyrigh: © 2020 杭州杰竞科技有限公司 版权所有
* @@Copyrigh: © 2020 杭州杰竞科技有限公司 版权所有 * @@Copyrigh: © 2020 杭州杰竞科技有限公司 版权所有
...@@ -56,6 +56,9 @@ function ChooseAssignorModal(props) { ...@@ -56,6 +56,9 @@ function ChooseAssignorModal(props) {
useEffect(() => { useEffect(() => {
setQueryName(''); // 切换tab时搜索置空 setQueryName(''); // 切换tab时搜索置空
setDepartmentUserVOList([]);
setDepartmentVOList([]);
setSubLevelDepartmentVOList([]);
setStructureData([]); setStructureData([]);
getStructureData(); getStructureData();
}, [activeKey]); }, [activeKey]);
......
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