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