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
fd3041ba
Commit
fd3041ba
authored
Jul 07, 2021
by
yuananting
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix:培训计划文案调整,编辑器文本长度字段修改
parent
81eb1a9c
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
147 additions
and
136 deletions
+147
-136
src/modules/course-manage/AddLive.jsx
+7
-7
src/modules/course-manage/graphics-course/AddGraphicsCourse.jsx
+3
-3
src/modules/course-manage/offline-course/AddOfflineCourse.jsx
+6
-5
src/modules/course-manage/video-course/AddVideoCourse.jsx
+7
-7
src/modules/plan-manage/AddPlan.jsx
+122
-112
src/modules/plan-manage/components/BasicInfo.jsx
+2
-2
No files found.
src/modules/course-manage/AddLive.jsx
View file @
fd3041ba
...
@@ -114,9 +114,9 @@ class AddLive extends React.Component {
...
@@ -114,9 +114,9 @@ class AddLive extends React.Component {
if
(
type
===
'edit'
)
{
if
(
type
===
'edit'
)
{
this
.
getCourseDetail
();
this
.
getCourseDetail
();
}
}
Bus
.
bind
(
'editorLimit'
,
(
t
extLength
)
=>
{
Bus
.
bind
(
'editorLimit'
,
(
editorT
extLength
)
=>
{
this
.
setState
({
this
.
setState
({
t
extLength
,
editorT
extLength
,
});
});
});
});
}
}
...
@@ -284,7 +284,7 @@ class AddLive extends React.Component {
...
@@ -284,7 +284,7 @@ class AddLive extends React.Component {
});
});
return
;
return
;
}
}
const
{
addLiveBasicInfo
,
addLiveClassInfo
,
addLiveIntroInfo
,
id
,
isEdit
,
type
}
=
this
.
state
;
const
{
addLiveBasicInfo
,
addLiveClassInfo
,
addLiveIntroInfo
,
id
,
isEdit
,
type
,
editorTextLength
}
=
this
.
state
;
const
{
liveDate
,
timeHorizonStart
}
=
addLiveClassInfo
;
const
{
liveDate
,
timeHorizonStart
}
=
addLiveClassInfo
;
const
_liveDate
=
moment
(
liveDate
).
format
(
'YYYY-MM-DD'
);
const
_liveDate
=
moment
(
liveDate
).
format
(
'YYYY-MM-DD'
);
const
_timeHorizonStart
=
moment
(
timeHorizonStart
).
format
(
'HH:mm'
);
const
_timeHorizonStart
=
moment
(
timeHorizonStart
).
format
(
'HH:mm'
);
...
@@ -301,7 +301,7 @@ class AddLive extends React.Component {
...
@@ -301,7 +301,7 @@ class AddLive extends React.Component {
});
});
return
;
return
;
}
}
this
.
handleValidate
(
addLiveBasicInfo
,
addLiveClassInfo
,
addLiveIntroInfo
,
isEdit
).
then
((
res
)
=>
{
this
.
handleValidate
(
addLiveBasicInfo
,
addLiveClassInfo
,
addLiveIntroInfo
,
isEdit
,
editorTextLength
).
then
((
res
)
=>
{
if
(
!
res
)
return
;
if
(
!
res
)
return
;
Upload
.
uploadTextToOSS
(
Upload
.
uploadTextToOSS
(
addLiveIntroInfo
.
introduce
,
addLiveIntroInfo
.
introduce
,
...
@@ -393,9 +393,9 @@ class AddLive extends React.Component {
...
@@ -393,9 +393,9 @@ class AddLive extends React.Component {
}
}
};
};
handleValidate
=
(
addLiveBasicInfo
,
addLiveClassInfo
,
addLiveIntroInfo
,
isEdit
)
=>
{
handleValidate
=
(
addLiveBasicInfo
,
addLiveClassInfo
,
addLiveIntroInfo
,
isEdit
,
editorTextLength
)
=>
{
return
new
Promise
((
resolve
)
=>
{
return
new
Promise
((
resolve
)
=>
{
const
{
type
,
textLength
}
=
this
.
state
;
const
{
type
}
=
this
.
state
;
const
{
courseName
,
categoryId
}
=
addLiveBasicInfo
;
const
{
courseName
,
categoryId
}
=
addLiveBasicInfo
;
const
{
liveDate
,
timeHorizonStart
,
timeHorizonEnd
,
teacherId
,
calendarTime
}
=
addLiveClassInfo
;
const
{
liveDate
,
timeHorizonStart
,
timeHorizonEnd
,
teacherId
,
calendarTime
}
=
addLiveClassInfo
;
const
{
liveCourseMediaRequests
}
=
addLiveIntroInfo
;
const
{
liveCourseMediaRequests
}
=
addLiveIntroInfo
;
...
@@ -480,7 +480,7 @@ class AddLive extends React.Component {
...
@@ -480,7 +480,7 @@ class AddLive extends React.Component {
return
;
return
;
}
}
if
(
t
extLength
>
1000
)
{
if
(
editorT
extLength
>
1000
)
{
message
.
warning
(
'课程简介超过字数限定'
);
message
.
warning
(
'课程简介超过字数限定'
);
resolve
(
false
);
resolve
(
false
);
return
;
return
;
...
...
src/modules/course-manage/graphics-course/AddGraphicsCourse.jsx
View file @
fd3041ba
...
@@ -2,7 +2,7 @@
...
@@ -2,7 +2,7 @@
* @Author: 吴文洁
* @Author: 吴文洁
* @Date: 2020-08-05 10:07:47
* @Date: 2020-08-05 10:07:47
* @LastEditors: yuananting
* @LastEditors: yuananting
* @LastEditTime: 2021-07-0
6 18:26:1
4
* @LastEditTime: 2021-07-0
7 14:49:2
4
* @Description: 图文课新增/编辑页
* @Description: 图文课新增/编辑页
* @Copyright: 杭州杰竞科技有限公司 版权所有
* @Copyright: 杭州杰竞科技有限公司 版权所有
*/
*/
...
@@ -73,9 +73,9 @@ class AddGraphicsCourse extends React.Component {
...
@@ -73,9 +73,9 @@ class AddGraphicsCourse extends React.Component {
if
(
pageType
===
'edit'
)
{
if
(
pageType
===
'edit'
)
{
this
.
handleFetchScheudleDetail
(
id
);
this
.
handleFetchScheudleDetail
(
id
);
}
}
Bus
.
bind
(
'editorLimit'
,
(
t
extLength
,
editorType
)
=>
{
Bus
.
bind
(
'editorLimit'
,
(
editorT
extLength
,
editorType
)
=>
{
this
.
setState
({
this
.
setState
({
[
editorType
]:
t
extLength
,
[
editorType
]:
editorT
extLength
,
});
});
});
});
}
}
...
...
src/modules/course-manage/offline-course/AddOfflineCourse.jsx
View file @
fd3041ba
...
@@ -2,7 +2,7 @@
...
@@ -2,7 +2,7 @@
* @Author: 吴文洁
* @Author: 吴文洁
* @Date: 2020-08-05 10:07:47
* @Date: 2020-08-05 10:07:47
* @LastEditors: yuananting
* @LastEditors: yuananting
* @LastEditTime: 2021-07-07 1
0:55
:41
* @LastEditTime: 2021-07-07 1
4:51
:41
* @Description: 线下课新增/编辑页
* @Description: 线下课新增/编辑页
* @Copyright: 杭州杰竞科技有限公司 版权所有
* @Copyright: 杭州杰竞科技有限公司 版权所有
*/
*/
...
@@ -98,9 +98,9 @@ class AddOfflineCourse extends React.Component {
...
@@ -98,9 +98,9 @@ class AddOfflineCourse extends React.Component {
if
(
pageType
===
'edit'
)
{
if
(
pageType
===
'edit'
)
{
this
.
handleFetchScheudleDetail
(
courseId
);
this
.
handleFetchScheudleDetail
(
courseId
);
}
}
Bus
.
bind
(
'editorLimit'
,
(
t
extLength
)
=>
{
Bus
.
bind
(
'editorLimit'
,
(
editorT
extLength
)
=>
{
this
.
setState
({
this
.
setState
({
t
extLength
,
editorT
extLength
,
});
});
});
});
}
}
...
@@ -500,6 +500,7 @@ class AddOfflineCourse extends React.Component {
...
@@ -500,6 +500,7 @@ class AddOfflineCourse extends React.Component {
signOutEndTimeNum
,
signOutEndTimeNum
,
signOutEndTimeUnit
,
signOutEndTimeUnit
,
// isMore,
// isMore,
editorTextLength
,
}
=
this
.
state
;
}
=
this
.
state
;
let
coverObj
=
{
let
coverObj
=
{
...
@@ -532,6 +533,7 @@ class AddOfflineCourse extends React.Component {
...
@@ -532,6 +533,7 @@ class AddOfflineCourse extends React.Component {
startTime
,
startTime
,
endTime
,
endTime
,
calendarTime
,
calendarTime
,
editorTextLength
,
// isMore,
// isMore,
};
};
...
@@ -603,7 +605,6 @@ class AddOfflineCourse extends React.Component {
...
@@ -603,7 +605,6 @@ class AddOfflineCourse extends React.Component {
};
};
handleValidate
=
(
data
)
=>
{
handleValidate
=
(
data
)
=>
{
const
{
textLength
}
=
this
.
state
;
return
new
Promise
((
resolve
)
=>
{
return
new
Promise
((
resolve
)
=>
{
if
(
!
data
.
courseName
)
{
if
(
!
data
.
courseName
)
{
message
.
warning
(
'请输入课程名称'
);
message
.
warning
(
'请输入课程名称'
);
...
@@ -647,7 +648,7 @@ class AddOfflineCourse extends React.Component {
...
@@ -647,7 +648,7 @@ class AddOfflineCourse extends React.Component {
}
else
if
(
data
.
whetherSetSignOut
===
'YES'
&&
((
data
.
signOutType
===
'START_LATER'
&&
!
data
.
signOutStartTimeNum
)
||
!
data
.
signOutEndTimeNum
))
{
}
else
if
(
data
.
whetherSetSignOut
===
'YES'
&&
((
data
.
signOutType
===
'START_LATER'
&&
!
data
.
signOutStartTimeNum
)
||
!
data
.
signOutEndTimeNum
))
{
message
.
warning
(
'请输入签退时间'
);
message
.
warning
(
'请输入签退时间'
);
resolve
(
false
);
resolve
(
false
);
}
else
if
(
t
extLength
>
1000
)
{
}
else
if
(
data
.
editorT
extLength
>
1000
)
{
message
.
warning
(
'课程简介超过字数限定'
);
message
.
warning
(
'课程简介超过字数限定'
);
resolve
(
false
);
resolve
(
false
);
}
else
{
}
else
{
...
...
src/modules/course-manage/video-course/AddVideoCourse.jsx
View file @
fd3041ba
...
@@ -2,7 +2,7 @@
...
@@ -2,7 +2,7 @@
* @Author: 吴文洁
* @Author: 吴文洁
* @Date: 2020-08-05 10:07:47
* @Date: 2020-08-05 10:07:47
* @LastEditors: yuananting
* @LastEditors: yuananting
* @LastEditTime: 2021-07-07 1
2:05:07
* @LastEditTime: 2021-07-07 1
5:01:40
* @Description: 线上课新增/编辑页
* @Description: 线上课新增/编辑页
* @Copyright: 杭州杰竞科技有限公司 版权所有
* @Copyright: 杭州杰竞科技有限公司 版权所有
*/
*/
...
@@ -94,9 +94,9 @@ class AddVideoCourse extends React.Component {
...
@@ -94,9 +94,9 @@ class AddVideoCourse extends React.Component {
if
(
pageType
===
'edit'
)
{
if
(
pageType
===
'edit'
)
{
this
.
handleFetchScheudleDetail
(
id
)
this
.
handleFetchScheudleDetail
(
id
)
}
}
Bus
.
bind
(
'editorLimit'
,
(
t
extLength
)
=>
{
Bus
.
bind
(
'editorLimit'
,
(
editorT
extLength
)
=>
{
this
.
setState
({
this
.
setState
({
t
extLength
,
editorT
extLength
,
});
});
});
});
}
}
...
@@ -402,7 +402,7 @@ class AddVideoCourse extends React.Component {
...
@@ -402,7 +402,7 @@ class AddVideoCourse extends React.Component {
whetherVisitorsJoin
,
whetherVisitorsJoin
,
introduce
,
introduce
,
courseChapterList
,
courseChapterList
,
t
extLength
,
editorT
extLength
,
}
=
this
.
state
}
=
this
.
state
const
commonParams
=
{
const
commonParams
=
{
...
@@ -420,7 +420,7 @@ class AddVideoCourse extends React.Component {
...
@@ -420,7 +420,7 @@ class AddVideoCourse extends React.Component {
courseChapterList
courseChapterList
}
}
// 校验必填字段:课程名称, 课程视频
// 校验必填字段:课程名称, 课程视频
this
.
handleValidate
(
courseName
,
courseChapterList
,
categoryId
,
scheduleMedia
,
t
extLength
).
then
((
res
)
=>
{
this
.
handleValidate
(
courseName
,
courseChapterList
,
categoryId
,
scheduleMedia
,
editorT
extLength
).
then
((
res
)
=>
{
if
(
!
res
)
return
if
(
!
res
)
return
Upload
.
uploadTextToOSS
(
introduce
,
`
${
randomString
()}
.txt`
,
(
introduceId
)
=>
{
Upload
.
uploadTextToOSS
(
introduce
,
`
${
randomString
()}
.txt`
,
(
introduceId
)
=>
{
this
.
submitRemote
({
id
,
pageType
,
commonParams
:
{
...
commonParams
,
introduceId
}
})
this
.
submitRemote
({
id
,
pageType
,
commonParams
:
{
...
commonParams
,
introduceId
}
})
...
@@ -452,7 +452,7 @@ class AddVideoCourse extends React.Component {
...
@@ -452,7 +452,7 @@ class AddVideoCourse extends React.Component {
}
}
}
}
handleValidate
=
(
courseName
,
courseChapterList
,
categoryId
,
scheduleMedia
,
t
extLength
)
=>
{
handleValidate
=
(
courseName
,
courseChapterList
,
categoryId
,
scheduleMedia
,
editorT
extLength
)
=>
{
return
new
Promise
((
resolve
)
=>
{
return
new
Promise
((
resolve
)
=>
{
if
(
!
courseName
)
{
if
(
!
courseName
)
{
message
.
warning
(
'请输入课程名称'
)
message
.
warning
(
'请输入课程名称'
)
...
@@ -469,7 +469,7 @@ class AddVideoCourse extends React.Component {
...
@@ -469,7 +469,7 @@ class AddVideoCourse extends React.Component {
resolve
(
false
)
resolve
(
false
)
return
false
return
false
}
}
if
(
t
extLength
>
1000
)
{
if
(
editorT
extLength
>
1000
)
{
message
.
warning
(
'课程简介超过字数限定'
);
message
.
warning
(
'课程简介超过字数限定'
);
resolve
(
false
);
resolve
(
false
);
return
;
return
;
...
...
src/modules/plan-manage/AddPlan.jsx
View file @
fd3041ba
/*
/*
* @Author: zhangleyuan
* @Author: zhangleyuan
* @Date: 2021-02-20 16:13:39
* @Date: 2021-02-20 16:13:39
* @LastEditors:
wufan
* @LastEditors:
yuananting
* @LastEditTime: 2021-0
5-30 20:39:16
* @LastEditTime: 2021-0
7-07 14:59:59
* @Description: 描述一下
* @Description: 描述一下
* @@Copyrigh: © 2020 杭州杰竞科技有限公司 版权所有
* @@Copyrigh: © 2020 杭州杰竞科技有限公司 版权所有
*/
*/
import
React
,
{
useEffect
,
useState
}
from
'react'
import
React
,
{
useEffect
,
useState
}
from
'react'
;
import
{
Button
,
message
,
Modal
}
from
'antd'
import
{
Button
,
message
,
Modal
}
from
'antd'
;
import
ShowTips
from
'@/components/ShowTips'
import
ShowTips
from
'@/components/ShowTips'
;
import
Breadcrumbs
from
'@/components/Breadcrumbs'
import
Breadcrumbs
from
'@/components/Breadcrumbs'
;
import
BasicInfo
from
'./components/BasicInfo'
import
BasicInfo
from
'./components/BasicInfo'
;
import
TrainingTask
from
'./components/TrainingTask'
import
TrainingTask
from
'./components/TrainingTask'
;
import
ExpiredCourseList
from
'./components/ExpiredCourseList'
import
ExpiredCourseList
from
'./components/ExpiredCourseList'
;
import
PlanService
from
'@/domains/plan-domain/planService'
import
PlanService
from
'@/domains/plan-domain/planService'
;
import
User
from
'@/common/js/user'
import
User
from
'@/common/js/user'
;
import
_
from
'underscore'
import
_
from
'underscore'
;
import
'./AddPlan.less'
import
'./AddPlan.less'
;
import
bus
from
'@/core/bus'
;
const
defaultCover
=
'https://image.xiaomaiketang.com/xm/rEAetaTEh3.png'
;
const
defaultCover
=
'https://image.xiaomaiketang.com/xm/rEAetaTEh3.png'
;
const
defaultBasicData
=
{
const
defaultBasicData
=
{
planName
:
''
,
planName
:
''
,
...
@@ -28,35 +29,39 @@ const defaultBasicData = {
...
@@ -28,35 +29,39 @@ const defaultBasicData = {
operateType
:
'All_Operate'
,
operateType
:
'All_Operate'
,
percentCompleteLive
:
80
,
percentCompleteLive
:
80
,
percentCompleteVideo
:
80
,
percentCompleteVideo
:
80
,
percentCompletePicture
:
100
percentCompletePicture
:
100
,
}
}
;
const
defaultTaskList
=
[]
const
defaultTaskList
=
[]
;
function
AddPlan
()
{
function
AddPlan
()
{
const
id
=
getParameterByName
(
'id'
)
const
id
=
getParameterByName
(
'id'
);
const
type
=
getParameterByName
(
'type'
)
const
type
=
getParameterByName
(
'type'
);
const
[
basicData
,
setBasicData
]
=
useState
(
defaultBasicData
)
const
[
basicData
,
setBasicData
]
=
useState
(
defaultBasicData
);
const
[
taskList
,
setTaskList
]
=
useState
(
defaultTaskList
)
const
[
taskList
,
setTaskList
]
=
useState
(
defaultTaskList
);
const
[
expiredCourseList
,
setExpiredCourseList
]
=
useState
([])
const
[
expiredCourseList
,
setExpiredCourseList
]
=
useState
([]);
const
[
hasGetDetail
,
setHasGetDetail
]
=
useState
(
false
)
const
[
hasGetDetail
,
setHasGetDetail
]
=
useState
(
false
);
const
[
submitDisabled
,
setSubmitDisabled
]
=
useState
(
false
)
const
[
editorTextLength
,
setEditorTextLength
]
=
useState
(
0
);
useEffect
(()
=>
{
useEffect
(()
=>
{
if
(
type
===
'edit'
)
{
if
(
type
===
'edit'
)
{
getPlanDetail
()
getPlanDetail
()
;
getPlanCustomerState
()
getPlanCustomerState
()
;
}
}
},
id
)
Bus
.
bind
(
'editorLimit'
,
(
editorTextLength
)
=>
{
setEditorTextLength
(
editorTextLength
);
});
},
id
);
function
getPlanCustomerState
()
{
function
getPlanCustomerState
()
{
PlanService
.
getTrainingCourseAutoCancel
({
PlanService
.
getTrainingCourseAutoCancel
({
planId
:
id
planId
:
id
,
}).
then
((
res
)
=>
{
}).
then
((
res
)
=>
{
const
expiredCourseList
=
res
.
result
const
expiredCourseList
=
res
.
result
;
setExpiredCourseList
(
expiredCourseList
)
setExpiredCourseList
(
expiredCourseList
)
;
})
})
;
}
}
function
getPlanDetail
()
{
function
getPlanDetail
()
{
PlanService
.
getTrainingPlanDetail
({
PlanService
.
getTrainingPlanDetail
({
planId
:
id
planId
:
id
,
}).
then
((
res
)
=>
{
}).
then
((
res
)
=>
{
const
{
const
{
planName
,
planName
,
...
@@ -67,34 +72,34 @@ function AddPlan() {
...
@@ -67,34 +72,34 @@ function AddPlan() {
percentCompleteVideo
,
percentCompleteVideo
,
percentCompletePicture
,
percentCompletePicture
,
courseMediaVOS
,
courseMediaVOS
,
trainingTaskList
trainingTaskList
,
}
=
res
.
result
}
=
res
.
result
;
let
coverId
let
coverId
;
let
coverUrl
let
coverUrl
;
let
instro
let
instro
;
courseMediaVOS
.
map
((
item
)
=>
{
courseMediaVOS
.
map
((
item
)
=>
{
switch
(
item
.
contentType
)
{
switch
(
item
.
contentType
)
{
case
'COVER'
:
case
'COVER'
:
coverId
=
item
.
mediaContent
coverId
=
item
.
mediaContent
;
coverUrl
=
item
.
mediaUrl
coverUrl
=
item
.
mediaUrl
;
break
break
;
case
'INTRO'
:
case
'INTRO'
:
instro
=
item
.
mediaContent
instro
=
item
.
mediaContent
;
break
break
;
default
:
default
:
break
break
;
}
}
return
item
return
item
;
})
})
;
let
_selectOperatorList
=
[]
let
_selectOperatorList
=
[]
;
if
(
operateIds
)
{
if
(
operateIds
)
{
_selectOperatorList
=
operateIds
.
map
((
item
,
index
)
=>
{
_selectOperatorList
=
operateIds
.
map
((
item
,
index
)
=>
{
let
_item
=
{}
let
_item
=
{}
;
_item
.
id
=
item
_item
.
id
=
item
;
return
_item
return
_item
;
})
})
;
}
}
setTaskList
(
trainingTaskList
)
setTaskList
(
trainingTaskList
)
;
setBasicData
({
setBasicData
({
planName
,
planName
,
coverUrl
:
coverUrl
||
defaultCover
,
coverUrl
:
coverUrl
||
defaultCover
,
...
@@ -105,20 +110,20 @@ function AddPlan() {
...
@@ -105,20 +110,20 @@ function AddPlan() {
operateType
,
operateType
,
percentCompleteLive
,
percentCompleteLive
,
percentCompleteVideo
,
percentCompleteVideo
,
percentCompletePicture
percentCompletePicture
,
})
})
;
setHasGetDetail
(
true
)
setHasGetDetail
(
true
)
;
})
})
;
}
}
function
handleChangeBasicInfo
(
field
,
value
,
option
)
{
function
handleChangeBasicInfo
(
field
,
value
,
option
)
{
setBasicData
({
setBasicData
({
...
basicData
,
...
basicData
,
[
field
]:
value
[
field
]:
value
,
})
})
;
}
}
function
handleChangeTaskInfo
(
value
)
{
function
handleChangeTaskInfo
(
value
)
{
setTaskList
(
value
)
setTaskList
(
value
)
;
}
}
function
submitInfo
()
{
function
submitInfo
()
{
...
@@ -132,37 +137,37 @@ function AddPlan() {
...
@@ -132,37 +137,37 @@ function AddPlan() {
percentCompleteVideo
,
percentCompleteVideo
,
percentCompletePicture
,
percentCompletePicture
,
coverId
,
coverId
,
coverUrl
coverUrl
,
}
=
basicData
}
=
basicData
;
let
input
=
/^
[\s]
*$/
let
input
=
/^
[\s]
*$/
;
if
(
!
planName
||
input
.
test
(
planName
))
{
if
(
!
planName
||
input
.
test
(
planName
))
{
message
.
warning
(
'请输入的培训计划名称'
)
message
.
warning
(
'请输入的培训计划名称'
)
;
return
return
;
}
}
if
(
operateType
===
'Assign_Operate'
&&
selectOperatorList
.
length
===
0
)
{
if
(
operateType
===
'Assign_Operate'
&&
selectOperatorList
.
length
===
0
)
{
message
.
warning
(
'请选择指定运营师'
)
message
.
warning
(
'请选择指定运营师'
)
;
return
return
;
}
}
if
(
!
percentCompleteLive
&&
percentCompleteLive
!==
0
)
{
if
(
!
percentCompleteLive
&&
percentCompleteLive
!==
0
)
{
message
.
warning
(
'请输入完成标准'
)
message
.
warning
(
'请输入完成标准'
)
;
return
return
;
}
}
if
(
!
percentCompleteVideo
&&
percentCompleteVideo
!==
0
)
{
if
(
!
percentCompleteVideo
&&
percentCompleteVideo
!==
0
)
{
message
.
warning
(
'请输入完成标准'
)
message
.
warning
(
'请输入完成标准'
)
;
return
return
;
}
}
if
(
!
percentCompletePicture
&&
percentCompletePicture
!==
0
)
{
if
(
!
percentCompletePicture
&&
percentCompletePicture
!==
0
)
{
message
.
warning
(
'请输入完成标准'
)
message
.
warning
(
'请输入完成标准'
)
;
return
return
;
}
}
if
(
taskList
.
length
===
0
)
{
if
(
taskList
.
length
===
0
)
{
message
.
warning
(
'请输入培训计划内容'
)
message
.
warning
(
'请输入培训计划内容'
)
;
return
return
;
}
}
for
(
let
i
=
0
;
i
<
taskList
.
length
;
i
++
)
{
for
(
let
i
=
0
;
i
<
taskList
.
length
;
i
++
)
{
if
(
input
.
test
(
taskList
[
i
].
taskName
))
{
if
(
input
.
test
(
taskList
[
i
].
taskName
))
{
message
.
warning
(
'培训任务名称不能为空'
)
message
.
warning
(
'培训任务名称不能为空'
)
;
return
false
return
false
;
}
}
if
(
taskList
[
i
].
courseList
.
length
===
0
)
{
if
(
taskList
[
i
].
courseList
.
length
===
0
)
{
Modal
.
confirm
({
Modal
.
confirm
({
...
@@ -170,28 +175,33 @@ function AddPlan() {
...
@@ -170,28 +175,33 @@ function AddPlan() {
content
:
'每个任务下至少关联一个课程'
,
content
:
'每个任务下至少关联一个课程'
,
okText
:
'确定'
,
okText
:
'确定'
,
cancelText
:
'取消'
,
cancelText
:
'取消'
,
icon
:
<
span
className=
'icon iconfont default-confirm-icon'
>

</
span
>
icon
:
<
span
className=
'icon iconfont default-confirm-icon'
>

</
span
>
,
})
})
;
return
false
return
false
;
}
}
}
}
let
scheduleMediaRequests
=
[]
if
(
editorTextLength
>
1000
)
{
message
.
warning
(
'简介超过字数限定'
);
return
;
}
let
scheduleMediaRequests
=
[];
let
coverObj
=
{
let
coverObj
=
{
contentType
:
'COVER'
,
contentType
:
'COVER'
,
mediaContent
:
coverId
,
mediaContent
:
coverId
,
mediaType
:
'PICTURE'
,
mediaType
:
'PICTURE'
,
mediaUrl
:
coverUrl
mediaUrl
:
coverUrl
,
}
}
;
if
(
coverId
)
{
if
(
coverId
)
{
scheduleMediaRequests
=
[...
scheduleMediaRequests
,
coverObj
]
scheduleMediaRequests
=
[...
scheduleMediaRequests
,
coverObj
]
;
}
}
let
instroObj
=
{
let
instroObj
=
{
contentType
:
'INTRO'
,
contentType
:
'INTRO'
,
mediaType
:
'TEXT'
,
mediaType
:
'TEXT'
,
mediaContent
:
instro
mediaContent
:
instro
,
}
}
;
if
(
instro
)
{
if
(
instro
)
{
scheduleMediaRequests
=
[...
scheduleMediaRequests
,
instroObj
]
scheduleMediaRequests
=
[...
scheduleMediaRequests
,
instroObj
]
;
}
}
const
params
=
{
const
params
=
{
...
@@ -205,43 +215,43 @@ function AddPlan() {
...
@@ -205,43 +215,43 @@ function AddPlan() {
planName
,
planName
,
scheduleMediaRequests
,
scheduleMediaRequests
,
storeId
:
User
.
getStoreId
(),
storeId
:
User
.
getStoreId
(),
trainingTaskList
:
handleSubmitTaskData
(
taskList
)
trainingTaskList
:
handleSubmitTaskData
(
taskList
)
,
}
}
;
if
(
type
===
'add'
)
{
if
(
type
===
'add'
)
{
PlanService
.
createTrainingPlan
(
params
).
then
((
res
)
=>
{
PlanService
.
createTrainingPlan
(
params
).
then
((
res
)
=>
{
if
(
res
.
success
)
{
if
(
res
.
success
)
{
message
.
success
(
'新建成功'
)
message
.
success
(
'新建成功'
)
;
setSubmitDisabled
(
true
)
setSubmitDisabled
(
true
)
;
window
.
RCHistory
.
goBack
()
window
.
RCHistory
.
goBack
()
;
}
}
})
})
;
}
else
{
}
else
{
const
_params
=
{
const
_params
=
{
...
params
,
...
params
,
id
id
,
}
}
;
PlanService
.
updateTrainingPlan
(
_params
).
then
((
res
)
=>
{
PlanService
.
updateTrainingPlan
(
_params
).
then
((
res
)
=>
{
if
(
res
.
success
)
{
if
(
res
.
success
)
{
message
.
success
(
'更新成功'
)
message
.
success
(
'更新成功'
)
;
window
.
RCHistory
.
goBack
()
window
.
RCHistory
.
goBack
()
;
}
}
})
})
;
}
}
}
}
function
handleSubmitTaskData
(
taskData
)
{
function
handleSubmitTaskData
(
taskData
)
{
return
taskData
.
map
((
item
,
index
)
=>
{
return
taskData
.
map
((
item
,
index
)
=>
{
let
_item
=
{}
let
_item
=
{}
;
_item
.
taskId
=
item
.
taskId
_item
.
taskId
=
item
.
taskId
;
_item
.
taskName
=
item
.
taskName
_item
.
taskName
=
item
.
taskName
;
_item
.
courseList
=
item
.
courseList
.
map
((
childItem
,
index
)
=>
{
_item
.
courseList
=
item
.
courseList
.
map
((
childItem
,
index
)
=>
{
let
_childItem
=
{}
let
_childItem
=
{}
;
_childItem
.
courseId
=
childItem
.
courseId
_childItem
.
courseId
=
childItem
.
courseId
;
_childItem
.
courseName
=
childItem
.
courseName
_childItem
.
courseName
=
childItem
.
courseName
;
_childItem
.
courseType
=
childItem
.
courseType
_childItem
.
courseType
=
childItem
.
courseType
;
return
_childItem
return
_childItem
;
})
})
;
return
_item
return
_item
;
})
})
;
}
}
// 取消编辑并返回上一级路由
// 取消编辑并返回上一级路由
function
handleGoBack
()
{
function
handleGoBack
()
{
...
@@ -253,11 +263,11 @@ function AddPlan() {
...
@@ -253,11 +263,11 @@ function AddPlan() {
cancelText
:
'留在本页'
,
cancelText
:
'留在本页'
,
icon
:
<
span
className=
'icon iconfont default-confirm-icon'
>

</
span
>,
icon
:
<
span
className=
'icon iconfont default-confirm-icon'
>

</
span
>,
onOk
:
()
=>
{
onOk
:
()
=>
{
window
.
RCHistory
.
goBack
()
window
.
RCHistory
.
goBack
()
;
}
}
,
})
})
;
}
else
{
}
else
{
window
.
RCHistory
.
goBack
()
window
.
RCHistory
.
goBack
()
;
}
}
}
}
...
@@ -293,6 +303,6 @@ function AddPlan() {
...
@@ -293,6 +303,6 @@ function AddPlan() {
</
Button
>
</
Button
>
</
div
>
</
div
>
</
div
>
</
div
>
)
)
;
}
}
export
default
AddPlan
export
default
AddPlan
;
src/modules/plan-manage/components/BasicInfo.jsx
View file @
fd3041ba
...
@@ -2,7 +2,7 @@
...
@@ -2,7 +2,7 @@
* @Author: yuananting
* @Author: yuananting
* @Date: 2021-07-05 10:48:08
* @Date: 2021-07-05 10:48:08
* @LastEditors: yuananting
* @LastEditors: yuananting
* @LastEditTime: 2021-07-0
6 19:49:14
* @LastEditTime: 2021-07-0
7 15:00:20
* @Description: 描述一下咯
* @Description: 描述一下咯
* @Copyrigh: © 2020 杭州杰竞科技有限公司 版权所有
* @Copyrigh: © 2020 杭州杰竞科技有限公司 版权所有
* @@Copyrigh: © 2020 杭州杰竞科技有限公司 版权所有
* @@Copyrigh: © 2020 杭州杰竞科技有限公司 版权所有
...
@@ -260,7 +260,7 @@ class BasicInfo extends React.Component {
...
@@ -260,7 +260,7 @@ class BasicInfo extends React.Component {
</
div
>
</
div
>
</
div
>
</
div
>
<
div
className=
'introduction'
>
<
div
className=
'introduction'
>
<
span
className=
'label'
>
课程
简介:
</
span
>
<
span
className=
'label'
>
简介:
</
span
>
{
/* <TextArea
{
/* <TextArea
placeholder='请输入培训计划简介'
placeholder='请输入培训计划简介'
maxLength={200}
maxLength={200}
...
...
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