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
c61b1b68
Commit
c61b1b68
authored
Jun 28, 2021
by
maolipeng
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix:XMQXY-397
parent
f7b12473
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
31 additions
and
25 deletions
+31
-25
src/modules/course-manage/components/LiveCourseList.jsx
+20
-17
src/modules/course-manage/graphics-course/components/GraphicsCourseList.jsx
+11
-8
No files found.
src/modules/course-manage/components/LiveCourseList.jsx
View file @
c61b1b68
...
@@ -97,23 +97,23 @@ class LiveCourseList extends React.Component {
...
@@ -97,23 +97,23 @@ class LiveCourseList extends React.Component {
}
}
//改变上架状态
//改变上架状态
changeShelfState
=
(
index
,
item
)
=>
{
changeShelfState
=
(
index
,
item
,
checked
)
=>
{
let
_shelfState
=
item
.
shelfState
;
let
_shelfState
=
checked
?
"YES"
:
"NO"
if
(
_shelfState
===
'NO'
)
{
// if (_shelfState === 'NO') {
_shelfState
=
'YES'
;
// _shelfState = 'YES';
// } else {
// _shelfState = 'NO';
// }
const
params
=
{
liveCourseId
:
item
.
liveCourseId
,
shelfState
:
_shelfState
,
};
CourseService
.
turnOnOrOffLiveCloudCourse
(
params
).
then
((
res
)
=>
{
if
(
res
.
success
)
{
if
(
_shelfState
===
'YES'
)
{
message
.
success
(
'已开启展示'
);
}
else
{
}
else
{
_shelfState
=
'NO'
;
message
.
success
(
'已取消展示'
);
}
const
params
=
{
"liveCourseId"
:
item
.
liveCourseId
,
"shelfState"
:
_shelfState
}
CourseService
.
turnOnOrOffLiveCloudCourse
(
params
).
then
((
res
)
=>
{
if
(
res
.
success
){
if
(
_shelfState
===
"YES"
){
message
.
success
(
"已开启展示"
);
}
else
{
message
.
success
(
"已取消展示"
);
}
}
this
.
props
.
changeShelfState
(
index
,
_shelfState
)
this
.
props
.
changeShelfState
(
index
,
_shelfState
)
}
}
...
@@ -267,7 +267,10 @@ class LiveCourseList extends React.Component {
...
@@ -267,7 +267,10 @@ class LiveCourseList extends React.Component {
key
:
"shelfState"
,
key
:
"shelfState"
,
dataIndex
:
"shelfState"
,
dataIndex
:
"shelfState"
,
render
:
(
val
,
item
,
index
)
=>
{
render
:
(
val
,
item
,
index
)
=>
{
return
<
Switch
defaultChecked=
{
item
.
shelfState
===
'YES'
?
true
:
false
}
onChange=
{
()
=>
this
.
changeShelfState
(
index
,
item
)
}
/>;
return
<
Switch
checked=
{
item
.
shelfState
===
"YES"
}
defaultChecked=
{
item
.
shelfState
===
'YES'
?
true
:
false
}
onChange=
{
(
checked
)
=>
this
.
changeShelfState
(
index
,
item
,
checked
)
}
/>;
},
},
},
},
{
{
...
...
src/modules/course-manage/graphics-course/components/GraphicsCourseList.jsx
View file @
c61b1b68
...
@@ -143,7 +143,10 @@ class GraphicsCourseList extends React.Component {
...
@@ -143,7 +143,10 @@ class GraphicsCourseList extends React.Component {
dataIndex
:
"courseware"
,
dataIndex
:
"courseware"
,
render
:
(
val
,
item
,
index
)
=>
{
render
:
(
val
,
item
,
index
)
=>
{
return
(
return
(
<
Switch
defaultChecked=
{
item
.
shelfState
===
"YES"
?
true
:
false
}
onChange=
{
()
=>
this
.
changeShelfState
(
index
,
item
)
}
/>
<
Switch
checked=
{
item
.
shelfState
===
"YES"
}
defaultChecked=
{
item
.
shelfState
===
"YES"
?
true
:
false
}
onChange=
{
(
checked
)
=>
this
.
changeShelfState
(
index
,
item
,
checked
)
}
/>
)
)
},
},
},
},
...
@@ -296,13 +299,13 @@ class GraphicsCourseList extends React.Component {
...
@@ -296,13 +299,13 @@ class GraphicsCourseList extends React.Component {
)
)
}
}
//改变上架状态
//改变上架状态
changeShelfState
=
(
index
,
item
)
=>
{
changeShelfState
=
(
index
,
item
,
checked
)
=>
{
let
_shelfState
=
item
.
shelfState
let
_shelfState
=
checked
?
"YES"
:
"NO"
if
(
_shelfState
===
'NO'
){
//
if(_shelfState==='NO'){
_shelfState
=
"YES"
;
//
_shelfState = "YES";
}
else
{
//
}else{
_shelfState
=
"NO"
//
_shelfState = "NO"
}
//
}
const
params
=
{
const
params
=
{
courseId
:
item
.
id
,
courseId
:
item
.
id
,
shelfState
:
_shelfState
shelfState
:
_shelfState
...
...
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