Commit fd3041ba by yuananting

fix:培训计划文案调整,编辑器文本长度字段修改

parent 81eb1a9c
......@@ -114,9 +114,9 @@ class AddLive extends React.Component {
if (type === 'edit') {
this.getCourseDetail();
}
Bus.bind('editorLimit', (textLength) => {
Bus.bind('editorLimit', (editorTextLength) => {
this.setState({
textLength,
editorTextLength,
});
});
}
......@@ -284,7 +284,7 @@ class AddLive extends React.Component {
});
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 = moment(liveDate).format('YYYY-MM-DD');
const _timeHorizonStart = moment(timeHorizonStart).format('HH:mm');
......@@ -301,7 +301,7 @@ class AddLive extends React.Component {
});
return;
}
this.handleValidate(addLiveBasicInfo, addLiveClassInfo, addLiveIntroInfo, isEdit).then((res) => {
this.handleValidate(addLiveBasicInfo, addLiveClassInfo, addLiveIntroInfo, isEdit, editorTextLength).then((res) => {
if (!res) return;
Upload.uploadTextToOSS(
addLiveIntroInfo.introduce,
......@@ -393,9 +393,9 @@ class AddLive extends React.Component {
}
};
handleValidate = (addLiveBasicInfo, addLiveClassInfo, addLiveIntroInfo, isEdit) => {
handleValidate = (addLiveBasicInfo, addLiveClassInfo, addLiveIntroInfo, isEdit, editorTextLength) => {
return new Promise((resolve) => {
const { type, textLength } = this.state;
const { type } = this.state;
const { courseName, categoryId } = addLiveBasicInfo;
const { liveDate, timeHorizonStart, timeHorizonEnd, teacherId, calendarTime } = addLiveClassInfo;
const { liveCourseMediaRequests } = addLiveIntroInfo;
......@@ -480,7 +480,7 @@ class AddLive extends React.Component {
return;
}
if (textLength > 1000) {
if (editorTextLength > 1000) {
message.warning('课程简介超过字数限定');
resolve(false);
return;
......
......@@ -2,7 +2,7 @@
* @Author: 吴文洁
* @Date: 2020-08-05 10:07:47
* @LastEditors: yuananting
* @LastEditTime: 2021-07-06 18:26:14
* @LastEditTime: 2021-07-07 14:49:24
* @Description: 图文课新增/编辑页
* @Copyright: 杭州杰竞科技有限公司 版权所有
*/
......@@ -73,9 +73,9 @@ class AddGraphicsCourse extends React.Component {
if (pageType === 'edit') {
this.handleFetchScheudleDetail(id);
}
Bus.bind('editorLimit', (textLength, editorType) => {
Bus.bind('editorLimit', (editorTextLength, editorType) => {
this.setState({
[editorType]: textLength,
[editorType]: editorTextLength,
});
});
}
......
......@@ -2,7 +2,7 @@
* @Author: 吴文洁
* @Date: 2020-08-05 10:07:47
* @LastEditors: yuananting
* @LastEditTime: 2021-07-07 10:55:41
* @LastEditTime: 2021-07-07 14:51:41
* @Description: 线下课新增/编辑页
* @Copyright: 杭州杰竞科技有限公司 版权所有
*/
......@@ -98,9 +98,9 @@ class AddOfflineCourse extends React.Component {
if (pageType === 'edit') {
this.handleFetchScheudleDetail(courseId);
}
Bus.bind('editorLimit', (textLength) => {
Bus.bind('editorLimit', (editorTextLength) => {
this.setState({
textLength,
editorTextLength,
});
});
}
......@@ -500,6 +500,7 @@ class AddOfflineCourse extends React.Component {
signOutEndTimeNum,
signOutEndTimeUnit,
// isMore,
editorTextLength,
} = this.state;
let coverObj = {
......@@ -532,6 +533,7 @@ class AddOfflineCourse extends React.Component {
startTime,
endTime,
calendarTime,
editorTextLength,
// isMore,
};
......@@ -603,7 +605,6 @@ class AddOfflineCourse extends React.Component {
};
handleValidate = (data) => {
const { textLength } = this.state;
return new Promise((resolve) => {
if (!data.courseName) {
message.warning('请输入课程名称');
......@@ -647,7 +648,7 @@ class AddOfflineCourse extends React.Component {
} else if (data.whetherSetSignOut === 'YES' && ((data.signOutType === 'START_LATER' && !data.signOutStartTimeNum) || !data.signOutEndTimeNum)) {
message.warning('请输入签退时间');
resolve(false);
} else if (textLength > 1000) {
} else if (data.editorTextLength > 1000) {
message.warning('课程简介超过字数限定');
resolve(false);
} else {
......
......@@ -2,7 +2,7 @@
* @Author: 吴文洁
* @Date: 2020-08-05 10:07:47
* @LastEditors: yuananting
* @LastEditTime: 2021-07-07 12:05:07
* @LastEditTime: 2021-07-07 15:01:40
* @Description: 线上课新增/编辑页
* @Copyright: 杭州杰竞科技有限公司 版权所有
*/
......@@ -94,9 +94,9 @@ class AddVideoCourse extends React.Component {
if (pageType === 'edit') {
this.handleFetchScheudleDetail(id)
}
Bus.bind('editorLimit', (textLength) => {
Bus.bind('editorLimit', (editorTextLength) => {
this.setState({
textLength,
editorTextLength,
});
});
}
......@@ -402,7 +402,7 @@ class AddVideoCourse extends React.Component {
whetherVisitorsJoin,
introduce,
courseChapterList,
textLength,
editorTextLength,
} = this.state
const commonParams = {
......@@ -420,7 +420,7 @@ class AddVideoCourse extends React.Component {
courseChapterList
}
// 校验必填字段:课程名称, 课程视频
this.handleValidate(courseName, courseChapterList, categoryId, scheduleMedia, textLength).then((res) => {
this.handleValidate(courseName, courseChapterList, categoryId, scheduleMedia, editorTextLength).then((res) => {
if (!res) return
Upload.uploadTextToOSS(introduce, `${randomString()}.txt`, (introduceId) => {
this.submitRemote({ id, pageType, commonParams: { ...commonParams, introduceId } })
......@@ -452,7 +452,7 @@ class AddVideoCourse extends React.Component {
}
}
handleValidate = (courseName, courseChapterList, categoryId, scheduleMedia, textLength) => {
handleValidate = (courseName, courseChapterList, categoryId, scheduleMedia, editorTextLength) => {
return new Promise((resolve) => {
if (!courseName) {
message.warning('请输入课程名称')
......@@ -469,7 +469,7 @@ class AddVideoCourse extends React.Component {
resolve(false)
return false
}
if (textLength > 1000) {
if (editorTextLength > 1000) {
message.warning('课程简介超过字数限定');
resolve(false);
return;
......
......@@ -2,7 +2,7 @@
* @Author: yuananting
* @Date: 2021-07-05 10:48:08
* @LastEditors: yuananting
* @LastEditTime: 2021-07-06 19:49:14
* @LastEditTime: 2021-07-07 15:00:20
* @Description: 描述一下咯
* @Copyrigh: © 2020 杭州杰竞科技有限公司 版权所有
* @@Copyrigh: © 2020 杭州杰竞科技有限公司 版权所有
......@@ -260,7 +260,7 @@ class BasicInfo extends React.Component {
</div>
</div>
<div className='introduction'>
<span className='label'>课程简介:</span>
<span className='label'>简介:</span>
{/* <TextArea
placeholder='请输入培训计划简介'
maxLength={200}
......
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