Commit 87dec267 by yuananting

fix:修复新建培训任务高级设置数据问题

parent f7cf0109
......@@ -22,9 +22,15 @@ import TaskCenterService from '@/domains/task-center-domain/TaskCenterService';
import Bus from '@/core/bus';
import $ from 'jquery';
const defaultCover = 'https://image.xiaomaiketang.com/xm/rEAetaTEh3.png';
const DEFAULT_BASIC_INFO = {
function AddTrainTask() {
const type = getParameterByName('type');
const taskId = getParameterByName('taskId');
const defaultCover = 'https://image.xiaomaiketang.com/xm/rEAetaTEh3.png';
const DEFAULT_BASIC_INFO = {
taskName: '', // 培训任务名称
coverUrl: defaultCover,
coverId: null,
......@@ -36,25 +42,21 @@ const DEFAULT_BASIC_INFO = {
assignList: [], // 指派列表-assignId assignType
introduce: null, // 培训目的
loadintroduce: false,
};
};
const DEFAULT_STAGE_LIST = [
const DEFAULT_STAGE_LIST = [
{
stageName: '阶段一',
contentList: [],
check: false,
},
];
];
const DEFAULT_FINISH_STANDARD = {
const DEFAULT_FINISH_STANDARD = {
percentCompleteLive: 80,
percentCompleteVideo: 80, // 线上课完成百分比
percentCompletePicture: 80, // 图文课完成百分比
};
function AddTrainTask() {
const type = getParameterByName('type');
const taskId = getParameterByName('taskId');
};
const [activeStep, setActiveStep] = useState('BASIC_INFO');
const [basicInfo, setBasicInfo] = useState(DEFAULT_BASIC_INFO);
......@@ -72,8 +74,6 @@ function AddTrainTask() {
if (type === 'edit') {
initTaskData();
getTrainingCourseAutoCancel();
}
}, []);
// 编辑回显数据详情
function initTaskData() {
......@@ -157,6 +157,9 @@ function AddTrainTask() {
setExpiredCourseList(res.result);
});
}
}
}, [taskId, type]);
// 获取培训目的内容
function getTextDetail(key, info) {
if (info.mediaType === 'RESOURCE_ID') {
......@@ -193,7 +196,6 @@ function AddTrainTask() {
<Button type='primary' onClick={() => setActiveStep('TRAIN_CONTENT')}>
下一步
</Button>
{/* disabled={submitDisabled} */}
</div>
</When>
<Otherwise>
......@@ -204,7 +206,6 @@ function AddTrainTask() {
<Button type='primary' onClick={() => handleSubmit('YES')}>
保存并发布
</Button>
{/* disabled={submitDisabled} */}
</div>
</Otherwise>
</Choose>
......@@ -387,7 +388,7 @@ function AddTrainTask() {
return (
<div className='page add-train-task'>
<Breadcrumbs navList={type == 'add' ? '新建培训任务' : '编辑培训任务'} goBack={handleGoBack} />
<Breadcrumbs navList={type === 'add' ? '新建培训任务' : '编辑培训任务'} goBack={handleGoBack} />
<div className='box'>
<div className='show-tips'>
<ShowTips message='请遵守国家相关规定,切勿上传低俗色情、暴力恐怖、谣言诈骗、侵权盗版等相关内容,小麦企学院保有依据国家规定及平台规则进行处理的权利' />
......
......@@ -23,6 +23,7 @@
}
.finish-standard__warp {
margin-top: 24px;
margin-bottom: 60px;
.module-title {
height: 22px;
......
......@@ -441,7 +441,7 @@ function TrainList(props) {
props.onChange(_query);
}
function handleCreatePlan() {
function handleCreateTask() {
window.RCHistory.push({
pathname: '/create-train-task?type=add',
});
......@@ -451,7 +451,7 @@ function TrainList(props) {
<div className='train-list-page'>
<div className='header-line'>
{(User.getUserRole() === 'CloudManager' || User.getUserRole() === 'StoreManager') && (
<Button type='primary' className='mr12' onClick={handleCreatePlan}>
<Button type='primary' className='mr12' onClick={handleCreateTask}>
新建培训任务
</Button>
)}
......
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