Commit e8ae7a18 by zhujian

fix:rtyuiop

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