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