Commit 8b6c2062 by yuananting

Merge branch 'feature/yuananting/20210801/task-center' into dev

parents ed4f7e54 14cde938
...@@ -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 11:20:00
* @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';
...@@ -27,6 +27,7 @@ const FormItem = Form.Item; ...@@ -27,6 +27,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;
...@@ -158,7 +159,7 @@ function BasicInfo(props) { ...@@ -158,7 +159,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);
}}> }}>
...@@ -183,7 +184,7 @@ function BasicInfo(props) { ...@@ -183,7 +184,7 @@ function BasicInfo(props) {
}} }}
disabledDate={disabledDate} disabledDate={disabledDate}
disabledTime={disabledRangeTime} disabledTime={disabledRangeTime}
disabled={[type === 'edit' && taskState === 'STARTING', false]} disabled={[type === 'edit' && originTimeType === 'VALIDITY' && taskState === 'STARTING', false]}
value={[startTime ? moment(Number(startTime)) : null, endTime ? moment(Number(endTime)) : null]} value={[startTime ? moment(Number(startTime)) : null, endTime ? moment(Number(endTime)) : null]}
format='YYYY-MM-DD HH:mm' format='YYYY-MM-DD HH:mm'
onChange={(date) => { onChange={(date) => {
......
...@@ -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}`,
}); });
} }
......
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