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
e9664081
Commit
e9664081
authored
Aug 16, 2021
by
yuananting
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'feature/yuananting/20210801/task-center' into dev
parents
e812659a
c54209d0
Show whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
90 additions
and
88 deletions
+90
-88
src/modules/task-center/data-center/components/CourseTable.tsx
+49
-56
src/modules/task-center/train-task/AddTrainTask.jsx
+1
-11
src/modules/task-center/train-task/components/ExpiredCourseList.jsx
+31
-9
src/modules/task-center/train-task/components/RelatedCourseDrawer.jsx
+5
-3
src/modules/task-center/train-task/components/TrainContent.jsx
+4
-9
No files found.
src/modules/task-center/data-center/components/CourseTable.tsx
View file @
e9664081
/*
* @Author: yuananting
* @Date: 2021-08-16 17:35:15
* @LastEditors: yuananting
* @LastEditTime: 2021-08-16 19:54:39
* @Description: 描述一下咯
* @Copyrigh: © 2020 杭州杰竞科技有限公司 版权所有
* @@Copyrigh: © 2020 杭州杰竞科技有限公司 版权所有
*/
import
React
,
{
useEffect
,
useState
}
from
'react'
;
import
{
withRouter
}
from
"react-router-dom"
;
import
RichText
from
'@/components/RichText'
import
{
withRouter
}
from
'react-router-dom'
;
import
RichText
from
'@/components/RichText'
;
import
ExpiredCourseList
from
'../../train-task/components/ExpiredCourseList'
;
import
ENUM
from
'../../enum'
;
import
'./course.less'
import
'./course.less'
;
function
CourseTable
(
props
:
any
)
{
const
IndexText
=
[
'一'
,
'二'
,
'三'
,
'四'
,
'五'
,
'六'
,
'七'
,
'八'
,
'九'
,
'十'
]
const
IndexText
=
[
'一'
,
'二'
,
'三'
,
'四'
,
'五'
,
'六'
,
'七'
,
'八'
,
'九'
,
'十'
];
const
[
list
,
setList
]
=
useState
<
any
[]
>
([]);
useEffect
(()
=>
{
console
.
log
(
props
.
info
,
'rtyuio'
)
setList
(
props
.
info
.
trainingStageList
||
[])
},
[
props
.
info
.
trainingStageList
])
console
.
log
(
props
.
info
,
'rtyuio'
);
setList
(
props
.
info
.
trainingStageList
||
[]);
},
[
props
.
info
.
trainingStageList
]);
return
<
div
className=
"courseTabContent"
>
<
div
className=
"tips"
>
return
(
<
div
className=
'courseTabContent'
>
<
div
className=
'tips'
>
{
`培训目的:`
}
<
RichText
url=
{
props
.
info
?.
intro
?.
mediaUrl
}
/>
</
div
>
<
div
className=
"coursecontent"
>
{
list
?.
map
((
item
:
any
,
index
:
number
)
=>
{
return
<
div
className=
"task"
>
<
div
className=
"title"
onClick=
{
()
=>
{
<
div
className=
'coursecontent'
>
{
list
?.
map
((
item
:
any
,
index
:
number
)
=>
{
return
(
<
div
className=
'task'
>
<
div
className=
'title'
onClick=
{
()
=>
{
const
_list
=
[...
list
];
_list
[
index
].
open
=
!
_list
[
index
].
open
;
setList
(
_list
)
setList
(
_list
);
}
}
>
{
item
.
open
?
<
span
className=
"icon iconfont open"
>

</
span
>
:
<
span
className=
"icon iconfont"
>

</
span
>
}
{
`${IndexText[index]}、 `
}
{
item
.
open
?
<
span
className=
'icon iconfont open'
>

</
span
>
:
<
span
className=
'icon iconfont'
>

</
span
>
}
{
`${IndexText[index]}、 `
}
{
item
.
stageName
}
</
div
>
{
item
.
open
&&
<
div
className=
"taskItemList"
>
{
item
.
contentVOList
.
map
((
_item
:
any
,
_index
:
number
)
=>
{
return
<
div
className=
{
_index
==
item
.
contentVOList
.
length
-
1
?
"item noBorder"
:
"item"
}
>
<
div
className=
"name"
>
{
item
.
open
&&
(
<
div
className=
'taskItemList'
>
{
item
.
contentVOList
.
map
((
_item
:
any
,
_index
:
number
)
=>
{
return
(
<
div
className=
{
_index
==
item
.
contentVOList
.
length
-
1
?
'item noBorder'
:
'item'
}
>
<
div
className=
'name'
>
<
img
className=
'type-option-icon'
src=
{
ENUM
.
LearningContentIcon
[
_item
.
courseType
||
_item
.
contentType
]
}
/>
<
span
style=
{
{
marginRight
:
4
}
}
>
{
`${index + 1}.${_index + 1}`
}
</
span
>
{
_item
.
contentName
}
{
(
_item
.
courseType
==
'LIVE'
)
&&
<
span
className=
'desc'
>
{
ENUM
.
courseStateShow
[
_item
.
courseState
].
title
}
</
span
>
}
{
_item
.
courseType
==
'VOICE'
&&
<
span
className=
'desc'
>
{
`(共${_item.courseChapterNum}节)`
}
</
span
>
}
{
_item
.
contentName
}
{
_item
.
courseType
==
'LIVE'
&&
<
span
className=
'desc'
>
{
ENUM
.
courseStateShow
[
_item
.
courseState
].
title
}
</
span
>
}
{
_item
.
courseType
==
'VOICE'
&&
<
span
className=
'desc'
>
{
`(共${_item.courseChapterNum}节)`
}
</
span
>
}
</
div
>
</
div
>
})
}
);
})
}
</
div
>
}
)
}
</
div
>
})
}
);
})
}
</
div
>
<
div
className=
"expired"
>
<
div
className=
"title"
>
失效课程
</
div
>
<
div
className=
'expired'
>
<
div
className=
'title'
>
失效课程
</
div
>
<
div
className=
"list"
>
<
ExpiredCourseList
expiredCourseList=
{
list
}
/>
<
div
className=
'list'
>
<
ExpiredCourseList
/>
</
div
>
</
div
>
</
div
>
);
}
export
default
withRouter
(
CourseTable
)
\ No newline at end of file
export
default
withRouter
(
CourseTable
);
src/modules/task-center/train-task/AddTrainTask.jsx
View file @
e9664081
...
...
@@ -2,7 +2,7 @@
* @Author: yuananting
* @Date: 2021-07-29 13:57:03
* @LastEditors: yuananting
* @LastEditTime: 2021-08-16 1
7:03:17
* @LastEditTime: 2021-08-16 1
9:47:41
* @Description: 任务中心-培训任务-新建页面
* @Copyrigh: © 2020 杭州杰竞科技有限公司 版权所有
* @@Copyrigh: © 2020 杭州杰竞科技有限公司 版权所有
...
...
@@ -56,7 +56,6 @@ function AddTrainTask() {
const
[
percentCompleteLive
,
setPercentCompleteLive
]
=
useState
(
80
);
// 完成百分比
const
[
percentCompleteVideo
,
setPercentCompleteVideo
]
=
useState
(
80
);
// 完成百分比
const
[
percentCompletePicture
,
setPercentCompletePicture
]
=
useState
(
80
);
// 完成百分比
const
[
expiredCourseList
,
setExpiredCourseList
]
=
useState
([]);
// 失效课程
const
[
startCheck
,
setStartCheck
]
=
useState
(
false
);
// 是否启动校验
const
basicInfoRef
=
useRef
(
null
);
...
...
@@ -67,7 +66,6 @@ function AddTrainTask() {
useEffect
(()
=>
{
if
(
type
===
'edit'
)
{
initTaskData
();
getTrainingCourseAutoCancel
();
// 编辑回显数据详情
function
initTaskData
()
{
...
...
@@ -141,13 +139,6 @@ function AddTrainTask() {
introduceInfo
&&
getTextDetail
(
'introduce'
,
introduceInfo
);
});
}
// 获取培训任务失效的课程
function
getTrainingCourseAutoCancel
()
{
TaskCenterService
.
getTrainingCourseAutoCancel
({
taskId
}).
then
((
res
)
=>
{
setExpiredCourseList
(
res
.
result
);
});
}
}
},
[
taskId
,
type
]);
...
...
@@ -415,7 +406,6 @@ function AddTrainTask() {
<
TrainContent
stageList=
{
stageList
}
basicInfo=
{
basicInfo
}
expiredCourseList=
{
expiredCourseList
}
startCheck=
{
startCheck
}
percentCompleteLive=
{
percentCompleteLive
}
percentCompleteVideo=
{
percentCompleteVideo
}
...
...
src/modules/task-center/train-task/components/ExpiredCourseList.jsx
View file @
e9664081
...
...
@@ -2,44 +2,64 @@
* @Author: yuananting
* @Date: 2021-08-03 10:47:59
* @LastEditors: yuananting
* @LastEditTime: 2021-08-1
4 17:35:0
4
* @LastEditTime: 2021-08-1
6 19:48:4
4
* @Description: 编辑培训任务-失效课程
* @Copyrigh: © 2020 杭州杰竞科技有限公司 版权所有
* @@Copyrigh: © 2020 杭州杰竞科技有限公司 版权所有
*/
import
React
from
'react'
;
import
React
,
{
useState
,
useEffect
}
from
'react'
;
import
{
List
,
message
,
Modal
}
from
'antd'
;
import
'./ExpiredCourseList.less'
;
import
ENUM
from
'../../enum'
;
import
moment
from
'moment'
;
import
TaskCenterService
from
'@/domains/task-center-domain/TaskCenterService'
;
function
ExpiredCourseList
(
props
)
{
function
ExpiredCourseList
()
{
const
taskId
=
window
.
getParameterByName
(
'taskId'
);
const
type
=
window
.
getParameterByName
(
'type'
);
const
[
expiredCourseList
,
setExpiredCourseList
]
=
useState
([]);
// 失效课程
useEffect
(()
=>
{
if
(
type
===
'edit'
)
{
getTrainingCourseAutoCancel
();
}
},
[]);
// 获取培训任务失效的课程
function
getTrainingCourseAutoCancel
()
{
TaskCenterService
.
getTrainingCourseAutoCancel
({
taskId
}).
then
((
res
)
=>
{
setExpiredCourseList
(
res
.
result
);
});
}
// 移除未成功开课课程
function
deLExpiredCourse
(
contentId
)
{
Modal
.
confirm
({
content
:
'你确定要删除该数据内容吗?'
,
okText
:
'
取消
'
,
cancelText
:
'
确定
'
,
okText
:
'
确定
'
,
cancelText
:
'
取消
'
,
icon
:
<
span
className=
'icon iconfont default-confirm-icon'
>

</
span
>,
onOk
:
()
=>
{
const
params
=
{
taskId
:
window
.
getParameterByName
(
'taskId'
)
,
contentId
:
[
contentId
],
taskId
,
contentId
List
:
[
contentId
],
};
TaskCenterService
.
de
LExpiredCourse
(
params
).
then
((
res
)
=>
{
TaskCenterService
.
de
lTaskCancelContent
(
params
).
then
((
res
)
=>
{
message
.
success
(
'删除成功'
);
getTrainingCourseAutoCancel
();
});
},
});
}
return
(
<
div
>
{
expiredCourseList
.
length
>
0
&&
(
<
div
className=
'expired-list-page'
>
<
div
className=
'tip'
>
为了不影响学员学习,「未成功开课」的课程已从任务中移出,具体课程如下所示:
</
div
>
<
List
dataSource=
{
props
.
expiredCourseList
}
dataSource=
{
expiredCourseList
}
renderItem=
{
(
item
)
=>
(
<
List
.
Item
>
<
div
className=
'item-detail'
>
...
...
@@ -67,6 +87,8 @@ function ExpiredCourseList(props) {
)
}
/>
</
div
>
)
}
</
div
>
);
}
...
...
src/modules/task-center/train-task/components/RelatedCourseDrawer.jsx
View file @
e9664081
...
...
@@ -2,7 +2,7 @@
* @Author: yuananting
* @Date: 2021-08-01 17:28:30
* @LastEditors: yuananting
* @LastEditTime: 2021-08-1
4 15:41:33
* @LastEditTime: 2021-08-1
6 19:53:06
* @Description: 新建培训任务-关联课程抽屉
* @Copyrigh: © 2020 杭州杰竞科技有限公司 版权所有
* @@Copyrigh: © 2020 杭州杰竞科技有限公司 版权所有
...
...
@@ -126,11 +126,13 @@ class RelatedCourseDrawer extends Component {
handleFetchVideoDataList
=
()
=>
{
const
{
videoQuery
,
videoSize
,
videoDataSource
,
videoTotalCount
,
videoCourseDivision
}
=
this
.
state
;
const
_data
=
[...
this
.
props
.
data
];
console
.
log
(
'_data'
,
_data
);
let
currentVideoCourseListData
=
[];
_data
.
map
((
item
,
index
)
=>
{
item
.
contentList
.
map
((
childItem
,
childIndex
)
=>
{
console
.
log
(
'childItem'
,
childItem
);
if
(
childItem
.
courseType
===
'VOICE'
)
{
currentVideoCourseListData
.
push
(
childItem
.
co
urse
Id
);
currentVideoCourseListData
.
push
(
childItem
.
co
ntent
Id
);
}
return
childItem
;
});
...
...
@@ -168,7 +170,7 @@ class RelatedCourseDrawer extends Component {
_data
.
map
((
item
,
index
)
=>
{
item
.
contentList
.
map
((
childItem
,
childIndex
)
=>
{
if
(
childItem
.
courseType
===
'PICTURE'
)
{
currentPictureCourseListData
.
push
(
childItem
.
co
urse
Id
);
currentPictureCourseListData
.
push
(
childItem
.
co
ntent
Id
);
}
return
childItem
;
});
...
...
src/modules/task-center/train-task/components/TrainContent.jsx
View file @
e9664081
...
...
@@ -2,7 +2,7 @@
* @Author: yuananting
* @Date: 2021-07-30 16:33:58
* @LastEditors: yuananting
* @LastEditTime: 2021-08-16 1
7:06
:01
* @LastEditTime: 2021-08-16 1
9:50
:01
* @Description: 任务中心-培训任务-新建-培训内容
* @Copyrigh: © 2020 杭州杰竞科技有限公司 版权所有
* @@Copyrigh: © 2020 杭州杰竞科技有限公司 版权所有
...
...
@@ -58,7 +58,6 @@ class TrainContent extends Component {
showCourseDrawer
:
false
,
showExamDrawer
:
false
,
selectedStageIndex
:
0
,
expiredCourseList
:
props
.
expiredCourseList
,
// 失效课程
showStandardDetail
:
false
,
// 是否展开高级设置
};
}
...
...
@@ -451,7 +450,6 @@ class TrainContent extends Component {
stageList
,
showCourseDrawer
,
showExamDrawer
,
expiredCourseList
,
showStandardDetail
,
basicInfo
,
selectedStageIndex
,
...
...
@@ -485,12 +483,9 @@ class TrainContent extends Component {
)
}
{
showExamDrawer
&&
<
RelatedExamDrawer
basicInfo=
{
basicInfo
}
stageList=
{
stageList
}
onClose=
{
this
.
onCloseExamDrawer
}
onSave=
{
this
.
confirmCreateExam
}
/>
}
</
div
>
{
window
.
getParameterByName
(
'type'
)
===
'edit'
&&
expiredCourseList
.
length
>
0
&&
(
<
div
className=
'expired-info__wrap'
>
<
div
className=
'module-title'
>
失效课程
</
div
>
<
ExpiredCourseList
expiredCourseList=
{
expiredCourseList
}
/>
</
div
>
)
}
<
ExpiredCourseList
/>
<
div
className=
'finish-standard__warp'
>
<
div
className=
'module-title'
...
...
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