Commit fbe7e744 by guomingpang

Merge branch 'dev' of…

Merge branch 'dev' of ssh://xmgit.ixm5.cn:10022/xiaomai-cloud-class/xiaomai-cloud-class-web into dev
parents a4bfe5ef e62591c3
...@@ -514,6 +514,7 @@ mr0 { ...@@ -514,6 +514,7 @@ mr0 {
// 气泡 // 气泡
.ant-tooltip { .ant-tooltip {
max-width: 280px !important;
.ant-tooltip-content { .ant-tooltip-content {
.ant-tooltip-inner { .ant-tooltip-inner {
padding: 6px 12px !important; padding: 6px 12px !important;
......
...@@ -5,7 +5,6 @@ import './SetEmployeeModal.less' ...@@ -5,7 +5,6 @@ import './SetEmployeeModal.less'
const RadioGroup = Radio.Group; const RadioGroup = Radio.Group;
const tagMap = { const tagMap = {
Cloud_Operator: '运营师',
Cloud_Lecturer: '讲师', Cloud_Lecturer: '讲师',
Cloud_Manager: '管理员', Cloud_Manager: '管理员',
} }
...@@ -105,12 +104,6 @@ export default class SetEmployeeModal extends React.Component { ...@@ -105,12 +104,6 @@ export default class SetEmployeeModal extends React.Component {
}} }}
className="mt5" className="mt5"
> >
<Radio value={"Cloud_Operator"} className="mt-4">
<span style={{ color: "#333" }}>运营师</span>
<p className="radio-tip">
仅可查看/转发培训计划内容,并查看负责的学员学习进度
</p>
</Radio>
<Radio value={"Cloud_Lecturer"} className="mt-4"> <Radio value={"Cloud_Lecturer"} className="mt-4">
<span style={{ color: "#333" }}>讲师</span> <span style={{ color: "#333" }}>讲师</span>
<p className="radio-tip"> <p className="radio-tip">
......
...@@ -64,6 +64,7 @@ ...@@ -64,6 +64,7 @@
font-size: 28px; font-size: 28px;
color: #333; color: #333;
margin-top: 24px; margin-top: 24px;
margin-left: 22px;
} }
.data-footer { .data-footer {
margin-top: 12px; margin-top: 12px;
......
...@@ -41,7 +41,7 @@ function DataInfo(props: any) { ...@@ -41,7 +41,7 @@ function DataInfo(props: any) {
<div className="prog"> <div className="prog">
<Progress type="circle" width={85} percent={parseInt(props.info.finishCustomerNum /(props.info.cultureCustomerNum)*100 as any)} strokeWidth={10} <Progress type="circle" width={85} percent={parseInt(props.info.finishCustomerNum /(props.info.cultureCustomerNum)*100 as any)} strokeWidth={10}
format={percent => <div className='wcl'> format={percent => <div className='wcl'>
{`${(parseInt(props.info.finishCustomerNum /(props.info.cultureCustomerNum)*100 as any))}% `} {`${(parseInt((props.info.finishCustomerNum || 0) /(props.info.cultureCustomerNum || 0)*100 as any))}% `}
<div>完成率</div> <div>完成率</div>
</div>} /> </div>} />
......
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
* @Author: yuananting * @Author: yuananting
* @Date: 2021-07-29 13:57:03 * @Date: 2021-07-29 13:57:03
* @LastEditors: yuananting * @LastEditors: yuananting
* @LastEditTime: 2021-08-16 19:47:41 * @LastEditTime: 2021-08-17 14:50:08
* @Description: 任务中心-培训任务-新建页面 * @Description: 任务中心-培训任务-新建页面
* @Copyrigh: © 2020 杭州杰竞科技有限公司 版权所有 * @Copyrigh: © 2020 杭州杰竞科技有限公司 版权所有
* @@Copyrigh: © 2020 杭州杰竞科技有限公司 版权所有 * @@Copyrigh: © 2020 杭州杰竞科技有限公司 版权所有
...@@ -25,6 +25,7 @@ import $ from 'jquery'; ...@@ -25,6 +25,7 @@ import $ from 'jquery';
function AddTrainTask() { function AddTrainTask() {
const type = getParameterByName('type'); const type = getParameterByName('type');
const taskId = getParameterByName('taskId'); const taskId = getParameterByName('taskId');
const taskState = getParameterByName('taskState');
const defaultCover = 'https://image.xiaomaiketang.com/xm/rEAetaTEh3.png'; const defaultCover = 'https://image.xiaomaiketang.com/xm/rEAetaTEh3.png';
...@@ -74,6 +75,7 @@ function AddTrainTask() { ...@@ -74,6 +75,7 @@ function AddTrainTask() {
}).then((res) => { }).then((res) => {
const { const {
result: { result: {
created,
createId, createId,
taskName, taskName,
courseMediaVOS, courseMediaVOS,
...@@ -117,7 +119,7 @@ function AddTrainTask() { ...@@ -117,7 +119,7 @@ function AddTrainTask() {
coverId, coverId,
helpStoreUserIds: _helpStoreUserIds, helpStoreUserIds: _helpStoreUserIds,
timeType, timeType,
startTime, startTime: timeType === 'FOREVER' ? created : startTime,
endTime, endTime,
learnType, learnType,
}; };
...@@ -273,15 +275,31 @@ function AddTrainTask() { ...@@ -273,15 +275,31 @@ function AddTrainTask() {
// 保存 // 保存
function handleSubmit(issue) { function handleSubmit(issue) {
setStartCheck(true); setStartCheck(true);
const { taskName, assignList } = basicInfo; const { taskName, assignList, timeType, startTime, endTime } = basicInfo;
if (!taskName) { if (!taskName) {
activeStep === 'TRAIN_CONTENT' && setActiveStep('BASIC_INFO'); activeStep === 'TRAIN_CONTENT' && setActiveStep('BASIC_INFO');
return message.warning('请输入培训任务名称'); return message.warning('请输入培训任务名称');
} }
if (timeType === 'VALIDITY') {
if (!startTime) {
return message.warning('请选择开始时间');
}
if (!endTime) {
return message.warning('请选择结束时间');
}
if ((type === 'add' || taskState === 'UN_START') && startTime < new Date().getTime()) {
return message.warning('开始时间不能早于现在');
}
if (!endTime > new Date().getTime()) {
return message.warning('结束时间不能早于现在');
}
}
if (assignList.length === 0) { if (assignList.length === 0) {
activeStep === 'TRAIN_CONTENT' && setActiveStep('BASIC_INFO'); activeStep === 'TRAIN_CONTENT' && setActiveStep('BASIC_INFO');
return message.warning('请选择指派对象'); return message.warning('请选择指派学员');
} }
if (stageList.length === 0) { if (stageList.length === 0) {
activeStep === 'BASIC_INFO' && setActiveStep('TRAIN_CONTENT'); activeStep === 'BASIC_INFO' && setActiveStep('TRAIN_CONTENT');
...@@ -342,13 +360,6 @@ function AddTrainTask() { ...@@ -342,13 +360,6 @@ function AddTrainTask() {
startTime: value && value[0]?.valueOf(), startTime: value && value[0]?.valueOf(),
endTime: value && value[1]?.valueOf(), endTime: value && value[1]?.valueOf(),
}); });
} else if (field === 'timeType' && value === 'FOREVER') {
setBasicInfo({
...basicInfoRef.current,
[field]: value,
startTime: null,
endTime: null,
});
} else { } else {
setBasicInfo({ setBasicInfo({
...basicInfoRef.current, ...basicInfoRef.current,
......
...@@ -2,12 +2,12 @@ ...@@ -2,12 +2,12 @@
* @Author: yuananting * @Author: yuananting
* @Date: 2021-07-29 14:32:24 * @Date: 2021-07-29 14:32:24
* @LastEditors: yuananting * @LastEditors: yuananting
* @LastEditTime: 2021-08-14 10:04:27 * @LastEditTime: 2021-08-17 14:50:30
* @Description: 任务中心-培训任务-新建-基本信息 * @Description: 任务中心-培训任务-新建-基本信息
* @Copyrigh: © 2020 杭州杰竞科技有限公司 版权所有 * @Copyrigh: © 2020 杭州杰竞科技有限公司 版权所有
* @@Copyrigh: © 2020 杭州杰竞科技有限公司 版权所有 * @@Copyrigh: © 2020 杭州杰竞科技有限公司 版权所有
*/ */
import React, { useState } from 'react'; import React, { useEffect, useState } from 'react';
import { Form, Button, Input, Space, DatePicker, Radio, Tag, message, Tooltip } from 'antd'; import { Form, Button, Input, Space, DatePicker, Radio, Tag, message, Tooltip } from 'antd';
import SelectPrepareFileModal from '@/modules/prepare-lesson/modal/SelectPrepareFileModal'; import SelectPrepareFileModal from '@/modules/prepare-lesson/modal/SelectPrepareFileModal';
import Upload from '@/core/upload'; import Upload from '@/core/upload';
...@@ -18,7 +18,6 @@ import './BasicInfo.less'; ...@@ -18,7 +18,6 @@ import './BasicInfo.less';
import ChooseAssignorModal from '../modal/ChooseAssignorModal'; import ChooseAssignorModal from '../modal/ChooseAssignorModal';
import ChooseCollaboratorModal from '../modal/ChooseCollaboratorModal'; import ChooseCollaboratorModal from '../modal/ChooseCollaboratorModal';
import WWOpenDataCom from '@/components/WWOpenDataCom'; import WWOpenDataCom from '@/components/WWOpenDataCom';
import User from '@/common/js/user';
const { RangePicker } = DatePicker; const { RangePicker } = DatePicker;
...@@ -27,6 +26,7 @@ const FormItem = Form.Item; ...@@ -27,6 +26,7 @@ const FormItem = Form.Item;
function BasicInfo(props) { function BasicInfo(props) {
const taskState = getParameterByName('taskState'); const taskState = getParameterByName('taskState');
const type = getParameterByName('type'); const type = getParameterByName('type');
const originTimeType = getParameterByName('timeType');
const { basicInfo, startCheck } = props; const { basicInfo, startCheck } = props;
const { createId, taskName, coverUrl, helpStoreUserIds, timeType, startTime, endTime, learnType, assignList, introduce, loadintroduce } = basicInfo; const { createId, taskName, coverUrl, helpStoreUserIds, timeType, startTime, endTime, learnType, assignList, introduce, loadintroduce } = basicInfo;
...@@ -39,7 +39,7 @@ function BasicInfo(props) { ...@@ -39,7 +39,7 @@ function BasicInfo(props) {
const defaultCover = 'https://image.xiaomaiketang.com/xm/rEAetaTEh3.png'; const defaultCover = 'https://image.xiaomaiketang.com/xm/rEAetaTEh3.png';
const isDefaultCover = coverUrl === defaultCover; const isDefaultCover = coverUrl === defaultCover;
const [assignorModalVisible, setAssignorModalVisible] = useState(false); // 指派对象弹窗显隐 const [assignorModalVisible, setAssignorModalVisible] = useState(false); // 指派学员弹窗显隐
const [collaboratorModalVisible, setCollaboratorModalVisible] = useState(false); // 协同者弹窗显隐 const [collaboratorModalVisible, setCollaboratorModalVisible] = useState(false); // 协同者弹窗显隐
// 使用默认封面图 // 使用默认封面图
...@@ -118,6 +118,25 @@ function BasicInfo(props) { ...@@ -118,6 +118,25 @@ function BasicInfo(props) {
props.onChange('assignList', _assignList); props.onChange('assignList', _assignList);
} }
function checkTime() {
if (!startTime && !endTime) {
return '请选择培训时间';
}
if (!startTime) {
return '请选择开始时间';
}
if (!endTime) {
return '请选择结束时间';
}
if ((type === 'add' || taskState === 'UN_START') && startTime < new Date().getTime()) {
return '开始时间不能早于现在';
}
if (!endTime > new Date().getTime()) {
return '结束时间不能早于现在';
}
return false;
}
return ( return (
<div className='basic-info__form'> <div className='basic-info__form'>
<Form> <Form>
...@@ -158,7 +177,7 @@ function BasicInfo(props) { ...@@ -158,7 +177,7 @@ function BasicInfo(props) {
<div className='duration__wrap'> <div className='duration__wrap'>
<Radio.Group <Radio.Group
value={timeType} value={timeType}
disabled={taskState === 'STARTING'} disabled={originTimeType === 'VALIDITY' && taskState === 'STARTING'}
onChange={(e) => { onChange={(e) => {
props.onChange('timeType', e.target.value); props.onChange('timeType', e.target.value);
}}> }}>
...@@ -170,16 +189,23 @@ function BasicInfo(props) { ...@@ -170,16 +189,23 @@ function BasicInfo(props) {
固定时间段 固定时间段
{timeType === 'VALIDITY' && ( {timeType === 'VALIDITY' && (
<div className='picker-box'> <div className='picker-box'>
<FormItem <FormItem validateStatus={startCheck && checkTime() ? 'error' : ''} help={startCheck && checkTime()}>
validateStatus={startCheck && !startTime && !endTime ? 'error' : ''}
help={startCheck && !startTime && !endTime && '请选择培训时间'}>
<RangePicker <RangePicker
style={{ width: 320 }} style={{ width: 320 }}
showTime={{ defaultValue: [moment().add(10, 'minutes'), moment().add(10, 'minutes')] }} showTime={{ defaultValue: [moment().add(10, 'minutes'), moment().add(10, 'minutes')] }}
ranges={{ ranges={{
7: [moment().add(10, 'minute'), moment().add(6, 'day').endOf('day')], 7: [
1个月: [moment().add(10, 'minute'), moment().add(1, 'month').endOf('day')], type === 'edit' && taskState === 'STARTING' ? moment(startTime) : moment().add(10, 'minute'),
3个月: [moment().add(10, 'minute'), moment().add(3, 'month').endOf('day')], moment().add(6, 'day').endOf('day'),
],
1个月: [
type === 'edit' && taskState === 'STARTING' ? moment(startTime) : moment().add(10, 'minute'),
moment().add(1, 'month').endOf('day'),
],
3个月: [
type === 'edit' && taskState === 'STARTING' ? moment(startTime) : moment().add(10, 'minute'),
moment().add(3, 'month').endOf('day'),
],
}} }}
disabledDate={disabledDate} disabledDate={disabledDate}
disabledTime={disabledRangeTime} disabledTime={disabledRangeTime}
...@@ -226,8 +252,8 @@ function BasicInfo(props) { ...@@ -226,8 +252,8 @@ function BasicInfo(props) {
<FormItem <FormItem
label={ label={
<span> <span>
指派对象 指派学员
<Tooltip title='选择员工协同完成任务指派和督学工作'> <Tooltip title='选择需要培训的人员'>
<i <i
className='icon iconfont' className='icon iconfont'
style={{ style={{
...@@ -244,13 +270,13 @@ function BasicInfo(props) { ...@@ -244,13 +270,13 @@ function BasicInfo(props) {
} }
required required
validateStatus={startCheck && assignList.length === 0 ? 'error' : ''} validateStatus={startCheck && assignList.length === 0 ? 'error' : ''}
help={startCheck && assignList.length === 0 && '请选择指派对象'}> help={startCheck && assignList.length === 0 && '请选择指派学员'}>
<Button <Button
style={{ display: 'block' }} style={{ display: 'block' }}
onClick={() => { onClick={() => {
setAssignorModalVisible(true); setAssignorModalVisible(true);
}}> }}>
添加指派对象 添加指派学员
</Button> </Button>
{assignList.length > 0 && ( {assignList.length > 0 && (
<Space size={'12'} direction={'vertical'} className='select-obj'> <Space size={'12'} direction={'vertical'} className='select-obj'>
...@@ -297,7 +323,7 @@ function BasicInfo(props) { ...@@ -297,7 +323,7 @@ function BasicInfo(props) {
label={ label={
<span> <span>
协同人员 协同人员
<Tooltip title='选择需要培训的人员'> <Tooltip title='选择员工协同完成任务指派和督学工作'>
<i <i
className='icon iconfont' className='icon iconfont'
style={{ style={{
......
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
* @Author: yuananting * @Author: yuananting
* @Date: 2021-08-03 17:05:32 * @Date: 2021-08-03 17:05:32
* @LastEditors: yuananting * @LastEditors: yuananting
* @LastEditTime: 2021-08-16 16:36:59 * @LastEditTime: 2021-08-17 10:55:01
* @Description: 新建培训任务-关联考试抽屉 * @Description: 新建培训任务-关联考试抽屉
* @Copyrigh: © 2020 杭州杰竞科技有限公司 版权所有 * @Copyrigh: © 2020 杭州杰竞科技有限公司 版权所有
* @@Copyrigh: © 2020 杭州杰竞科技有限公司 版权所有 * @@Copyrigh: © 2020 杭州杰竞科技有限公司 版权所有
...@@ -305,10 +305,16 @@ function RelatedExamDrawer(props) { ...@@ -305,10 +305,16 @@ function RelatedExamDrawer(props) {
{showPaperModal && ( {showPaperModal && (
<SelectPaperModal <SelectPaperModal
onSelect={(info) => { onSelect={(info) => {
const contentList = props.stageList.map((item) => { let newContentList = [];
return item.contentList; props.stageList.map((item) => {
if (item.contentList && item.contentList.length > 0) {
item.contentList.map((childItem) => {
newContentList.push(childItem);
}); });
const existedPaperId = contentList.flat().filter((item) => { }
});
console.log('newContentList', newContentList);
const existedPaperId = newContentList.filter((item) => {
return item.paperId === info.paperId; return item.paperId === info.paperId;
}); });
if (existedPaperId.length > 0) { if (existedPaperId.length > 0) {
......
...@@ -70,8 +70,8 @@ function TrainFilter(props) { ...@@ -70,8 +70,8 @@ function TrainFilter(props) {
const _query = _.clone(query); const _query = _.clone(query);
_query.current = 1; _query.current = 1;
if (field === 'createdDate') { if (field === 'createdDate') {
_query.startTime = value && value[0].valueOf(); _query.startTime = value[0]?.startOf('day').valueOf();
_query.endTime = value && value[1].valueOf(); _query.endTime = value[1]?.endOf('day').valueOf();
} else { } else {
_query[field] = value; _query[field] = value;
} }
......
...@@ -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 22:08:57 * @LastEditTime: 2021-08-17 11:14:28
* @Description: 描述一下咯 * @Description: 描述一下咯
* @Copyrigh: © 2020 杭州杰竞科技有限公司 版权所有 * @Copyrigh: © 2020 杭州杰竞科技有限公司 版权所有
*/ */
...@@ -74,7 +74,7 @@ function TrainList(props) { ...@@ -74,7 +74,7 @@ function TrainList(props) {
// 编辑培训任务-跳转新建/编辑页 // 编辑培训任务-跳转新建/编辑页
function editTrainingTask(item) { function editTrainingTask(item) {
window.RCHistory.push({ window.RCHistory.push({
pathname: `/create-train-task?type=edit&taskId=${item.taskId}&taskState=${item.taskState}`, pathname: `/create-train-task?type=edit&taskId=${item.taskId}&taskState=${item.taskState}&timeType=${item.timeType}`,
}); });
} }
......
...@@ -2,8 +2,8 @@ ...@@ -2,8 +2,8 @@
* @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:35:24 * @LastEditTime: 2021-08-17 14:50:50
* @Description: 新建培训任务-选择指派对象 * @Description: 新建培训任务-选择指派学员
* @Copyrigh: © 2020 杭州杰竞科技有限公司 版权所有 * @Copyrigh: © 2020 杭州杰竞科技有限公司 版权所有
* @@Copyrigh: © 2020 杭州杰竞科技有限公司 版权所有 * @@Copyrigh: © 2020 杭州杰竞科技有限公司 版权所有
*/ */
...@@ -36,7 +36,7 @@ function ChooseAssignorModal(props) { ...@@ -36,7 +36,7 @@ function ChooseAssignorModal(props) {
const [dropDownVisible, setDropDownVisible] = useState(false); const [dropDownVisible, setDropDownVisible] = useState(false);
const [structureData, setStructureData] = useState([]); const [structureData, setStructureData] = useState([]);
const [activeKey, setActiveKey] = useState('departMentTab'); const [activeKey, setActiveKey] = useState('departMentTab');
const [checkedAssignorList, setCheckedAssignorList] = useState(props.currentAssignorList || []); // 勾选的指派对象 const [checkedAssignorList, setCheckedAssignorList] = useState(props.currentAssignorList || []); // 勾选的指派学员
const [checkedAssignorKeys, setCheckedAssignorKeys] = useState(props.currentAssignorList.map((item) => item.checkedId) || []); const [checkedAssignorKeys, setCheckedAssignorKeys] = useState(props.currentAssignorList.map((item) => item.checkedId) || []);
const [queryName, setQueryName] = useState(''); // 搜索框内的值 const [queryName, setQueryName] = useState(''); // 搜索框内的值
const [departmentUserVOList, setDepartmentUserVOList] = useState([]); const [departmentUserVOList, setDepartmentUserVOList] = useState([]);
......
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