Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
X
xiaomai-cloud-class-web
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
xiaomai-cloud-class
xiaomai-cloud-class-web
Commits
9aa63802
Commit
9aa63802
authored
Aug 17, 2021
by
yuananting
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'feature/yuananting/20210801/task-center' into dev
parents
a7add138
caba2f94
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
40 additions
and
7 deletions
+40
-7
src/modules/task-center/train-task/AddTrainTask.jsx
+19
-2
src/modules/task-center/train-task/components/BasicInfo.jsx
+21
-5
No files found.
src/modules/task-center/train-task/AddTrainTask.jsx
View file @
9aa63802
...
...
@@ -2,7 +2,7 @@
* @Author: yuananting
* @Date: 2021-07-29 13:57:03
* @LastEditors: yuananting
* @LastEditTime: 2021-08-17 1
2:39:38
* @LastEditTime: 2021-08-17 1
4:30:50
* @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'
;
...
...
@@ -274,12 +275,28 @@ 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
(
'请选择指派对象'
);
...
...
src/modules/task-center/train-task/components/BasicInfo.jsx
View file @
9aa63802
...
...
@@ -2,7 +2,7 @@
* @Author: yuananting
* @Date: 2021-07-29 14:32:24
* @LastEditors: yuananting
* @LastEditTime: 2021-08-17 1
3:56:11
* @LastEditTime: 2021-08-17 1
4:30:56
* @Description: 任务中心-培训任务-新建-基本信息
* @Copyrigh: © 2020 杭州杰竞科技有限公司 版权所有
* @@Copyrigh: © 2020 杭州杰竞科技有限公司 版权所有
...
...
@@ -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
;
...
...
@@ -119,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
>
...
...
@@ -171,9 +189,7 @@ 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'
)]
}
}
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment