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
3de96d01
Commit
3de96d01
authored
Mar 10, 2021
by
zhangleyuan
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
feat:修改课程的数量限制
parent
caba870f
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
12 additions
and
11 deletions
+12
-11
src/modules/plan-manage/components/TrainingTask.jsx
+2
-2
src/modules/plan-manage/modal/relatedCourseModal.jsx
+10
-9
No files found.
src/modules/plan-manage/components/TrainingTask.jsx
View file @
3de96d01
...
@@ -2,7 +2,7 @@
...
@@ -2,7 +2,7 @@
* @Author: zhangleyuan
* @Author: zhangleyuan
* @Date: 2021-02-20 16:45:51
* @Date: 2021-02-20 16:45:51
* @LastEditors: zhangleyuan
* @LastEditors: zhangleyuan
* @LastEditTime: 2021-03-
09 19:54:25
* @LastEditTime: 2021-03-
10 10:35:50
* @Description: 描述一下
* @Description: 描述一下
* @@Copyrigh: © 2020 杭州杰竞科技有限公司 版权所有
* @@Copyrigh: © 2020 杭州杰竞科技有限公司 版权所有
*/
*/
...
@@ -258,7 +258,7 @@ class TrainingTask extends React.Component {
...
@@ -258,7 +258,7 @@ class TrainingTask extends React.Component {
taskName
:
''
,
taskName
:
''
,
index
:
dataSource
.
length
,
index
:
dataSource
.
length
,
type
:
'input'
,
type
:
'input'
,
open
:
fals
e
,
open
:
tru
e
,
courseList
:[
courseList
:[
]
]
}
}
...
...
src/modules/plan-manage/modal/relatedCourseModal.jsx
View file @
3de96d01
...
@@ -53,14 +53,15 @@ class SelectOperatorModal extends React.Component {
...
@@ -53,14 +53,15 @@ class SelectOperatorModal extends React.Component {
videoTotalCount
:
0
,
videoTotalCount
:
0
,
selectVideo
:[],
//弹窗内已选择的视频课程
selectVideo
:[],
//弹窗内已选择的视频课程
currentVideoCourseListData
:[],
//页面中已关联的视频课程
currentVideoCourseListData
:[],
//页面中已关联的视频课程
activeKey
:
'video'
activeKey
:
'video'
,
currentTaskCourseData
:
this
.
props
.
data
[
this
.
props
.
selectedTaskIndex
].
courseList
||
[]
}
}
}
}
componentDidMount
()
{
componentDidMount
()
{
this
.
handleFetchLiveDataList
();
this
.
handleFetchLiveDataList
();
this
.
handleFetchVideoDataList
();
this
.
handleFetchVideoDataList
();
console
.
log
(
'courseLisData'
,
this
.
props
.
data
)
}
}
// 获取直播课列表
// 获取直播课列表
...
@@ -269,14 +270,14 @@ class SelectOperatorModal extends React.Component {
...
@@ -269,14 +270,14 @@ class SelectOperatorModal extends React.Component {
return
columns
;
return
columns
;
}
}
selectLiveList
=
(
record
,
selected
)
=>
{
selectLiveList
=
(
record
,
selected
)
=>
{
const
{
selectVideo
,
current
VideoCourseListData
,
currentLiveCourseList
Data
,
selectLive
}
=
this
.
state
;
const
{
selectVideo
,
current
TaskCourse
Data
,
selectLive
}
=
this
.
state
;
let
_list
=
[];
let
_list
=
[];
if
(
selected
||
!
_
.
find
(
selectLive
,
(
item
)
=>
item
.
liveCourseId
==
record
.
liveCourseId
))
{
if
(
selected
||
!
_
.
find
(
selectLive
,
(
item
)
=>
item
.
liveCourseId
==
record
.
liveCourseId
))
{
_list
=
_
.
uniq
(
selectLive
.
concat
([
record
]),
false
,
(
item
)
=>
item
.
liveCourseId
);
_list
=
_
.
uniq
(
selectLive
.
concat
([
record
]),
false
,
(
item
)
=>
item
.
liveCourseId
);
}
else
{
}
else
{
_list
=
_
.
reject
(
selectLive
,
(
item
)
=>
item
.
liveCourseId
===
record
.
liveCourseId
);
_list
=
_
.
reject
(
selectLive
,
(
item
)
=>
item
.
liveCourseId
===
record
.
liveCourseId
);
}
}
if
(
_list
.
length
+
current
VideoCourseListData
.
length
+
currentLiveCourseList
Data
.
length
+
selectVideo
.
length
>
20
){
if
(
_list
.
length
+
current
TaskCourse
Data
.
length
+
selectVideo
.
length
>
20
){
message
.
warning
(
'无法继续选择,一个任务最多关联20个课程'
);
message
.
warning
(
'无法继续选择,一个任务最多关联20个课程'
);
return
;
return
;
}
}
...
@@ -284,14 +285,14 @@ class SelectOperatorModal extends React.Component {
...
@@ -284,14 +285,14 @@ class SelectOperatorModal extends React.Component {
}
}
selectVideoList
=
(
record
,
selected
)
=>
{
selectVideoList
=
(
record
,
selected
)
=>
{
const
{
selectVideo
,
current
VideoCourseListData
,
currentLiveCourseList
Data
,
selectLive
}
=
this
.
state
;
const
{
selectVideo
,
current
TaskCourse
Data
,
selectLive
}
=
this
.
state
;
let
_list
=
[];
let
_list
=
[];
if
(
selected
||
!
_
.
find
(
selectVideo
,
(
item
)
=>
item
.
id
==
record
.
id
))
{
if
(
selected
||
!
_
.
find
(
selectVideo
,
(
item
)
=>
item
.
id
==
record
.
id
))
{
_list
=
_
.
uniq
(
selectVideo
.
concat
([
record
]),
false
,
(
item
)
=>
item
.
id
);
_list
=
_
.
uniq
(
selectVideo
.
concat
([
record
]),
false
,
(
item
)
=>
item
.
id
);
}
else
{
}
else
{
_list
=
_
.
reject
(
selectVideo
,
(
item
)
=>
item
.
id
===
record
.
id
);
_list
=
_
.
reject
(
selectVideo
,
(
item
)
=>
item
.
id
===
record
.
id
);
}
}
if
(
_list
.
length
+
current
VideoCourseListData
.
length
+
currentLiveCourseList
Data
.
length
+
selectLive
.
length
>
20
){
if
(
_list
.
length
+
current
TaskCourse
Data
.
length
+
selectLive
.
length
>
20
){
message
.
warning
(
'无法继续选择,一个任务最多关联20个课程'
);
message
.
warning
(
'无法继续选择,一个任务最多关联20个课程'
);
return
;
return
;
}
}
...
@@ -325,7 +326,7 @@ class SelectOperatorModal extends React.Component {
...
@@ -325,7 +326,7 @@ class SelectOperatorModal extends React.Component {
}
}
render
()
{
render
()
{
const
{
visible
}
=
this
.
props
;
const
{
visible
}
=
this
.
props
;
const
{
liveDataSource
,
liveSize
,
liveQuery
,
liveTotalCount
,
selectLive
,
currentLiveCourseListData
,
videoDataSource
,
videoSize
,
videoQuery
,
videoTotalCount
,
selectVideo
,
currentVideoCourseList
Data
,
activeKey
}
=
this
.
state
;
const
{
liveDataSource
,
liveSize
,
liveQuery
,
liveTotalCount
,
selectLive
,
videoDataSource
,
videoSize
,
videoQuery
,
videoTotalCount
,
selectVideo
,
currentTaskCourse
Data
,
activeKey
}
=
this
.
state
;
return
(
return
(
<
Modal
<
Modal
...
@@ -369,7 +370,7 @@ class SelectOperatorModal extends React.Component {
...
@@ -369,7 +370,7 @@ class SelectOperatorModal extends React.Component {
<
span
>
已选择
{
selectVideo
.
length
+
selectLive
.
length
}
个
</
span
>
<
span
>
已选择
{
selectVideo
.
length
+
selectLive
.
length
}
个
</
span
>
<
span
onClick=
{
this
.
clearSelectCourse
}
>
清空
</
span
>
<
span
onClick=
{
this
.
clearSelectCourse
}
>
清空
</
span
>
</
span
>
</
span
>
<
span
>
该任务已关联
{
current
VideoCourseListData
.
length
+
currentLiveCourseListData
.
length
}
个课程,可继续选择
{
20
-
(
currentVideoCourseListData
.
length
+
currentLiveCourseListData
.
length
)
}
个
</
span
>
<
span
>
该任务已关联
{
current
TaskCourseData
.
length
}
个课程,可继续选择
{
20
-
currentTaskCourseData
.
length
}
个
</
span
>
</
div
>
</
div
>
<
div
>
<
div
>
<
Table
<
Table
...
@@ -422,7 +423,7 @@ class SelectOperatorModal extends React.Component {
...
@@ -422,7 +423,7 @@ class SelectOperatorModal extends React.Component {
<
span
>
已选择
{
selectVideo
.
length
+
selectLive
.
length
}
个
</
span
>
<
span
>
已选择
{
selectVideo
.
length
+
selectLive
.
length
}
个
</
span
>
<
span
onClick=
{
this
.
clearSelectCourse
}
>
清空
</
span
>
<
span
onClick=
{
this
.
clearSelectCourse
}
>
清空
</
span
>
</
span
>
</
span
>
<
span
>
该任务已关联
{
current
VideoCourseListData
.
length
+
currentLiveCourseListData
.
length
}
个课程,可继续选择
{
20
-
(
currentVideoCourseListData
.
length
+
currentLiveCourseListData
.
length
)
}
个
</
span
>
<
span
>
该任务已关联
{
current
TaskCourseData
.
length
}
个课程,可继续选择
{
20
-
currentTaskCourseData
.
length
}
个
</
span
>
</
div
>
</
div
>
<
div
>
<
div
>
<
Table
<
Table
...
...
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