Commit dc7d7fd5 by yuananting

fix:培训计划编辑简介丢失问题

parent 19003b31
......@@ -2,7 +2,7 @@
* @Author: zhangleyuan
* @Date: 2021-02-20 16:13:39
* @LastEditors: yuananting
* @LastEditTime: 2021-07-08 10:52:05
* @LastEditTime: 2021-07-18 13:33:22
* @Description: 描述一下
* @@Copyrigh: © 2020 杭州杰竞科技有限公司 版权所有
*/
......@@ -42,6 +42,7 @@ function AddPlan() {
const [hasGetDetail, setHasGetDetail] = useState(false);
const [submitDisabled, setSubmitDisabled] = useState(false);
const [editorTextLength, setEditorTextLength] = useState(0);
const [loadintroduce, setLoadintroduce] = useState(false);
useEffect(() => {
if (type === 'edit') {
......@@ -78,6 +79,7 @@ function AddPlan() {
let coverId;
let coverUrl;
let instro;
let hasIntro = false;
courseMediaVOS.map((item) => {
switch (item.contentType) {
case 'COVER':
......@@ -85,6 +87,7 @@ function AddPlan() {
coverUrl = item.mediaUrl;
break;
case 'INTRO':
hasIntro = true;
instro = item.mediaContent;
break;
default:
......@@ -114,6 +117,7 @@ function AddPlan() {
percentCompletePicture,
});
setHasGetDetail(true);
setLoadintroduce(hasIntro);
});
}
function handleChangeBasicInfo(field, value, option) {
......@@ -282,7 +286,7 @@ function AddPlan() {
<div className='add-plan-page__form'>
<div className='basic-info__wrap'>
<div className='title'>基本信息</div>
<BasicInfo data={basicData} onChange={handleChangeBasicInfo} />
<BasicInfo data={{ ...basicData, loadintroduce, id}} onChange={handleChangeBasicInfo} />
</div>
<div className='basic-info__wrap'>
<div className='title'>培训任务</div>
......
/*
* @Author: yuananting
* @Date: 2021-07-05 10:48:08
* @LastEditors: Please set LastEditors
* @LastEditTime: 2021-07-18 10:14:26
* @LastEditors: yuananting
* @LastEditTime: 2021-07-18 13:32:16
* @Description: 描述一下咯
* @Copyrigh: © 2020 杭州杰竞科技有限公司 版权所有
* @@Copyrigh: © 2020 杭州杰竞科技有限公司 版权所有
......@@ -134,13 +134,13 @@ class BasicInfo extends React.Component {
};
changeIntro = (value) => {
this.props.onChange('introduce', value);
this.props.onChange('instro', value);
};
render() {
const { operatorModalVisible, showSelectFileModal, visible, imageFile } = this.state;
const { data } = this.props;
const { planName, coverUrl, introduce, enableState, operateType, selectOperatorList, percentCompleteLive, percentCompleteVideo, percentCompletePicture } =
const { planName, coverUrl, instro, enableState, operateType, selectOperatorList, percentCompleteLive, percentCompleteVideo, percentCompletePicture, loadintroduce, id } =
data;
// 当前是否使用的是默认图片
const isDefaultCover = coverUrl === defaultCover;
......@@ -183,25 +183,17 @@ class BasicInfo extends React.Component {
</div>
<div className='introduction'>
<span className='label'>简介:</span>
{/* <TextArea
placeholder='请输入培训计划简介'
maxLength={200}
style={{ width: '552px', height: '110px' }}
className='instro-textarea'
value={instro}
onChange={(e) => this.props.onChange('instro', e.target.value)}
/> */}
<GraphicsEditor
{(!id || loadintroduce) && (<GraphicsEditor
id='intro'
isIntro={true}
maxLimit={1000}
detail={{
content: introduce,
content: instro,
}}
onChange={(val) => {
this.changeIntro(val);
}}
/>
/>)}
</div>
<div className='wether-use'>
<span className='label'>是否启用:</span>
......
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