Commit fd3041ba by yuananting

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

parent 81eb1a9c
...@@ -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', (textLength) => { Bus.bind('editorLimit', (editorTextLength) => {
this.setState({ this.setState({
textLength, editorTextLength,
}); });
}); });
} }
...@@ -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 (textLength > 1000) { if (editorTextLength > 1000) {
message.warning('课程简介超过字数限定'); message.warning('课程简介超过字数限定');
resolve(false); resolve(false);
return; return;
......
...@@ -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-06 18:26:14 * @LastEditTime: 2021-07-07 14:49:24
* @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', (textLength, editorType) => { Bus.bind('editorLimit', (editorTextLength, editorType) => {
this.setState({ this.setState({
[editorType]: textLength, [editorType]: editorTextLength,
}); });
}); });
} }
......
...@@ -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 10:55:41 * @LastEditTime: 2021-07-07 14: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', (textLength) => { Bus.bind('editorLimit', (editorTextLength) => {
this.setState({ this.setState({
textLength, editorTextLength,
}); });
}); });
} }
...@@ -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 (textLength > 1000) { } else if (data.editorTextLength > 1000) {
message.warning('课程简介超过字数限定'); message.warning('课程简介超过字数限定');
resolve(false); resolve(false);
} else { } else {
......
...@@ -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 12:05:07 * @LastEditTime: 2021-07-07 15: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', (textLength) => { Bus.bind('editorLimit', (editorTextLength) => {
this.setState({ this.setState({
textLength, editorTextLength,
}); });
}); });
} }
...@@ -402,7 +402,7 @@ class AddVideoCourse extends React.Component { ...@@ -402,7 +402,7 @@ class AddVideoCourse extends React.Component {
whetherVisitorsJoin, whetherVisitorsJoin,
introduce, introduce,
courseChapterList, courseChapterList,
textLength, editorTextLength,
} = 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, textLength).then((res) => { this.handleValidate(courseName, courseChapterList, categoryId, scheduleMedia, editorTextLength).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, textLength) => { handleValidate = (courseName, courseChapterList, categoryId, scheduleMedia, editorTextLength) => {
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 (textLength > 1000) { if (editorTextLength > 1000) {
message.warning('课程简介超过字数限定'); message.warning('课程简介超过字数限定');
resolve(false); resolve(false);
return; return;
......
...@@ -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-06 19:49:14 * @LastEditTime: 2021-07-07 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}
......
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