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
c7a05140
Commit
c7a05140
authored
Aug 14, 2021
by
zhujian
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'feature/yuananting/20210801/task-center' into dev
parents
dcb8ae84
706de926
Hide whitespace changes
Inline
Side-by-side
Showing
8 changed files
with
95 additions
and
81 deletions
+95
-81
src/data-source/taskCenter/request-apis.ts
+5
-1
src/domains/task-center-domain/TaskCenterService.ts
+7
-1
src/modules/task-center/data-center/components/DataInfo.tsx
+1
-1
src/modules/task-center/train-task/AddTrainTask.jsx
+59
-25
src/modules/task-center/train-task/components/BasicInfo.jsx
+2
-2
src/modules/task-center/train-task/components/RelatedCourseDrawer.less
+12
-47
src/modules/task-center/train-task/components/TrainContent.jsx
+2
-2
src/modules/task-center/train-task/components/TrainList.jsx
+7
-2
No files found.
src/data-source/taskCenter/request-apis.ts
View file @
c7a05140
...
...
@@ -2,7 +2,7 @@
* @Author: yuananting
* @Date: 2021-08-06 17:35:35
* @LastEditors: yuananting
* @LastEditTime: 2021-08-1
3 18:06:35
* @LastEditTime: 2021-08-1
4 09:51:12
* @Description: 任务中心接口
* @Copyrigh: © 2020 杭州杰竞科技有限公司 版权所有
* @@Copyrigh: © 2020 杭州杰竞科技有限公司 版权所有
...
...
@@ -48,3 +48,7 @@ export function getTaskCustomerDetail(params: object) {
export
function
updateTrainingTaskAssign
(
params
:
object
)
{
return
Service
.
Hades
(
'public/hades/updateTrainingTaskAssign'
,
params
);
}
export
function
getTrainingCourseAutoCancel
(
params
:
object
)
{
return
Service
.
Hades
(
'public/hades/getTrainingCourseAutoCancel'
,
params
);
}
src/domains/task-center-domain/TaskCenterService.ts
View file @
c7a05140
...
...
@@ -2,7 +2,7 @@
* @Author: yuananting
* @Date: 2021-08-06 17:32:41
* @LastEditors: yuananting
* @LastEditTime: 2021-08-1
3 18:07:06
* @LastEditTime: 2021-08-1
4 09:52:00
* @Description: 任务中心-培训任务接口
* @Copyrigh: © 2020 杭州杰竞科技有限公司 版权所有
* @@Copyrigh: © 2020 杭州杰竞科技有限公司 版权所有
...
...
@@ -18,6 +18,7 @@ import {
updateTrainingTask
,
getTaskCustomerDetail
,
updateTrainingTaskAssign
,
getTrainingCourseAutoCancel
,
}
from
'@/data-source/taskCenter/request-apis'
;
export
default
class
TaskCenterService
{
...
...
@@ -70,4 +71,9 @@ export default class TaskCenterService {
static
updateTrainingTaskAssign
(
params
:
any
)
{
return
updateTrainingTaskAssign
(
params
);
}
// 获取培训任务失效的课程
static
getTrainingCourseAutoCancel
(
params
:
any
)
{
return
getTrainingCourseAutoCancel
(
params
);
}
}
src/modules/task-center/data-center/components/DataInfo.tsx
View file @
c7a05140
...
...
@@ -43,7 +43,7 @@ function DataInfo(props: any) {
</
div
>
<
div
className=
"num"
>
<
div
className=
"item"
>
{
`指派人数:${props.info.cultureCustomerNum}`
}
</
div
>
<
div
className=
"item"
>
{
`学习人数:${props.info.
culture
CustomerNum}`
}
</
div
>
<
div
className=
"item"
>
{
`学习人数:${props.info.
learning
CustomerNum}`
}
</
div
>
<
div
className=
"item"
>
{
`完成人数:${props.info.finishCustomerNum}`
}
</
div
>
</
div
>
</
div
>
...
...
src/modules/task-center/train-task/AddTrainTask.jsx
View file @
c7a05140
...
...
@@ -2,7 +2,7 @@
* @Author: yuananting
* @Date: 2021-07-29 13:57:03
* @LastEditors: yuananting
* @LastEditTime: 2021-08-1
3 19:37:07
* @LastEditTime: 2021-08-1
4 14:30:11
* @Description: 任务中心-培训任务-新建页面
* @Copyrigh: © 2020 杭州杰竞科技有限公司 版权所有
* @@Copyrigh: © 2020 杭州杰竞科技有限公司 版权所有
...
...
@@ -60,6 +60,7 @@ function AddTrainTask() {
const
[
basicInfo
,
setBasicInfo
]
=
useState
(
DEFAULT_BASIC_INFO
);
const
[
stageList
,
setStageList
]
=
useState
(
DEFAULT_STAGE_LIST
);
const
[
finishStandard
,
setFinishStandard
]
=
useState
(
DEFAULT_FINISH_STANDARD
);
// 完成百分比
const
[
expiredCourseList
,
setExpiredCourseList
]
=
useState
([]);
// 失效课程
const
[
startCheck
,
setStartCheck
]
=
useState
(
false
);
// 是否启动校验
const
basicInfoRef
=
useRef
(
null
);
...
...
@@ -70,6 +71,7 @@ function AddTrainTask() {
useEffect
(()
=>
{
if
(
type
===
'edit'
)
{
initTaskData
();
getTrainingCourseAutoCancel
();
}
},
[]);
...
...
@@ -96,12 +98,14 @@ function AddTrainTask() {
},
}
=
res
;
const
_assignList
=
assignList
.
map
((
item
)
=>
{
item
.
checkedId
=
item
.
assignId
;
item
.
checkedName
=
item
.
assignName
;
item
.
checkedType
=
item
.
assignType
;
return
item
;
});
const
_assignList
=
assignList
?
assignList
.
map
((
item
)
=>
{
item
.
checkedId
=
item
.
assignId
;
item
.
checkedName
=
item
.
assignName
;
item
.
checkedType
=
item
.
assignType
;
return
item
;
})
:
[];
const
coverInfo
=
courseMediaVOS
.
filter
((
item
)
=>
item
.
contentType
===
'COVER'
)[
0
];
const
coverUrl
=
coverInfo
?
coverInfo
.
mediaUrl
:
defaultCover
;
...
...
@@ -143,26 +147,40 @@ function AddTrainTask() {
setStageList
(
_stageList
);
introduceInfo
&&
getTextDetail
(
'introduce'
,
introduceInfo
.
mediaUrl
);
introduceInfo
&&
getTextDetail
(
'introduce'
,
introduceInfo
);
});
}
// 获取培训目的内容
function
getTextDetail
(
key
,
url
)
{
$
.
ajax
({
data
:
{},
type
:
'GET'
,
url
,
contentType
:
'application/x-www-form-urlencoded; charset=UTF-8'
,
success
:
(
res
)
=>
{
setBasicInfo
({
...
basicInfoRef
.
current
,
[
key
]:
res
,
[
`load
${
key
}
`
]:
true
,
});
},
// 获取培训任务失效的课程
function
getTrainingCourseAutoCancel
()
{
TaskCenterService
.
getTrainingCourseAutoCancel
({
taskId
}).
then
((
res
)
=>
{
setExpiredCourseList
(
res
.
result
);
});
}
// 获取培训目的内容
function
getTextDetail
(
key
,
info
)
{
if
(
info
.
mediaType
===
'RESOURCE_ID'
)
{
$
.
ajax
({
data
:
{},
type
:
'GET'
,
url
:
info
.
mediaUrl
,
contentType
:
'application/x-www-form-urlencoded; charset=UTF-8'
,
success
:
(
res
)
=>
{
setBasicInfo
({
...
basicInfoRef
.
current
,
[
key
]:
res
,
[
`load
${
key
}
`
]:
true
,
});
},
});
}
else
if
(
info
.
mediaType
===
'TEXT'
)
{
setBasicInfo
({
...
basicInfoRef
.
current
,
[
key
]:
info
.
mediaContent
,
[
`load
${
key
}
`
]:
true
,
});
}
}
// 渲染底部操作按钮
function
renderFooter
()
{
...
...
@@ -233,7 +251,7 @@ function AddTrainTask() {
const
_assignList
=
assignList
.
map
((
item
)
=>
{
return
{
assignId
:
item
.
checkedId
,
assignType
:
item
.
assign
Type
,
assignType
:
item
.
checked
Type
,
};
});
...
...
@@ -278,27 +296,33 @@ function AddTrainTask() {
const
{
percentCompleteLive
,
percentCompleteVideo
,
percentCompletePicture
}
=
finishStandard
;
if
(
!
taskName
)
{
activeStep
===
'TRAIN_CONTENT'
&&
setActiveStep
(
'BASIC_INFO'
);
return
message
.
warning
(
'请输入培训任务名称'
);
}
if
(
assignList
.
length
===
0
)
{
activeStep
===
'TRAIN_CONTENT'
&&
setActiveStep
(
'BASIC_INFO'
);
return
message
.
warning
(
'请选择指派对象'
);
}
if
(
stageList
.
length
===
0
)
{
activeStep
===
'BASIC_INFO'
&&
setActiveStep
(
'TRAIN_CONTENT'
);
return
message
.
warning
(
'请添加阶段'
);
}
const
stageNameEmpty
=
stageList
.
filter
((
item
)
=>
!
item
.
stageName
);
if
(
stageNameEmpty
.
length
>
0
)
{
activeStep
===
'BASIC_INFO'
&&
setActiveStep
(
'TRAIN_CONTENT'
);
return
message
.
warning
(
'请输入阶段名称'
);
}
const
stageNameArr
=
stageList
.
map
((
item
)
=>
item
.
stageName
);
const
stageNameSet
=
new
Set
(
stageNameArr
);
if
(
stageNameSet
.
size
!==
stageNameArr
.
length
)
{
activeStep
===
'BASIC_INFO'
&&
setActiveStep
(
'TRAIN_CONTENT'
);
return
message
.
warning
(
'阶段名称不能重复'
);
}
if
(
percentCompleteLive
===
''
||
percentCompleteVideo
===
''
||
percentCompletePicture
===
''
)
{
activeStep
===
'BASIC_INFO'
&&
setActiveStep
(
'TRAIN_CONTENT'
);
return
message
.
warning
(
'请输入完成标准'
);
}
...
...
@@ -309,7 +333,10 @@ function AddTrainTask() {
(
introduceId
)
=>
{
submitRemote
(
introduceId
,
issue
);
},
()
=>
message
.
warning
(
'上传培训目的失败'
)
()
=>
{
activeStep
===
'TRAIN_CONTENT'
&&
setActiveStep
(
'BASIC_INFO'
);
message
.
warning
(
'上传培训目的失败'
);
}
);
}
else
{
submitRemote
(
null
,
issue
);
...
...
@@ -384,7 +411,14 @@ function AddTrainTask() {
</
div
>
{
activeStep
===
'BASIC_INFO'
&&
<
BasicInfo
basicInfo=
{
basicInfo
}
startCheck=
{
startCheck
}
onChange=
{
handleChangeBasicInfo
}
/>
}
{
activeStep
===
'TRAIN_CONTENT'
&&
(
<
TrainContent
stageList=
{
stageList
}
basicInfo=
{
basicInfo
}
startCheck=
{
startCheck
}
finishStandard=
{
finishStandard
}
onChange=
{
handleChangeStageInfo
}
/>
<
TrainContent
stageList=
{
stageList
}
basicInfo=
{
basicInfo
}
expiredCourseList=
{
expiredCourseList
}
startCheck=
{
startCheck
}
finishStandard=
{
finishStandard
}
onChange=
{
handleChangeStageInfo
}
/>
)
}
</
div
>
{
renderFooter
()
}
...
...
src/modules/task-center/train-task/components/BasicInfo.jsx
View file @
c7a05140
...
...
@@ -2,7 +2,7 @@
* @Author: yuananting
* @Date: 2021-07-29 14:32:24
* @LastEditors: yuananting
* @LastEditTime: 2021-08-1
3 19:38:30
* @LastEditTime: 2021-08-1
4 10:04:27
* @Description: 任务中心-培训任务-新建-基本信息
* @Copyrigh: © 2020 杭州杰竞科技有限公司 版权所有
* @@Copyrigh: © 2020 杭州杰竞科技有限公司 版权所有
...
...
@@ -105,7 +105,7 @@ function BasicInfo(props) {
function
confirmAddAssignor
(
data
)
{
props
.
onChange
(
'assignList'
,
data
);
props
.
onClose
(
);
setAssignorModalVisible
(
false
);
}
function
removeSelectedCollaborator
(
tag
)
{
...
...
src/modules/task-center/train-task/components/RelatedCourseDrawer.less
View file @
c7a05140
...
...
@@ -36,46 +36,6 @@
}
.clear-btn {
text-align: right;
color: #2966ff;
font-size: 14px;
}
}
.related-box {
padding: 6px 16px;
background: #e9efff;
border-radius: 4px;
flex: 1;
color: #666666;
font-size: 14px;
}
}
.search-container {
margin-bottom: 16px;
}
.select-area {
margin-bottom: 12px;
display: flex;
justify-content: space-between;
.select-box {
display: inline-box;
width: 186px;
background: #e9efff;
border-radius: 4px;
padding: 6px 16px;
margin-right: 8px;
display: flex;
justify-content: space-between;
.tip-icon {
color: #2966ff;
font-size: 14px;
margin-right: 4px;
}
.select-num {
color: #666666;
font-size: 14px;
}
.clear-btn {
text-align: right;
color: #5289fa;
font-size: 14px;
}
...
...
@@ -89,6 +49,7 @@
font-size: 14px;
}
}
.course-info {
display: flex;
align-items: center;
...
...
@@ -111,13 +72,17 @@
-webkit-box-orient: vertical;
width: 180px;
}
.course-status {
font-size: 12px;
line-height: 18px;
display: inline-block;
border-radius: 2px;
padding: 0 8px;
margin-top: 8px;
.course-state {
* {
vertical-align: middle;
display: inline-block;
}
.status-point {
width: 6px;
height: 6px;
border-radius: 50%;
margin-right: 4px;
}
}
}
...
...
src/modules/task-center/train-task/components/TrainContent.jsx
View file @
c7a05140
...
...
@@ -2,7 +2,7 @@
* @Author: yuananting
* @Date: 2021-07-30 16:33:58
* @LastEditors: yuananting
* @LastEditTime: 2021-08-1
1 13:33
:44
* @LastEditTime: 2021-08-1
4 10:10
:44
* @Description: 任务中心-培训任务-新建-培训内容
* @Copyrigh: © 2020 杭州杰竞科技有限公司 版权所有
* @@Copyrigh: © 2020 杭州杰竞科技有限公司 版权所有
...
...
@@ -59,7 +59,7 @@ class TrainContent extends Component {
showCourseDrawer
:
false
,
showExamDrawer
:
false
,
selectedStageIndex
:
0
,
expiredCourseList
:
[]
,
// 失效课程
expiredCourseList
:
props
.
expiredCourseList
,
// 失效课程
showStandardDetail
:
false
,
// 是否展开高级设置
};
}
...
...
src/modules/task-center/train-task/components/TrainList.jsx
View file @
c7a05140
...
...
@@ -2,7 +2,7 @@
* @Author: yuananting
* @Date: 2021-07-28 14:56:52
* @LastEditors: yuananting
* @LastEditTime: 2021-08-1
3 18:30:47
* @LastEditTime: 2021-08-1
4 10:48:01
* @Description: 描述一下咯
* @Copyrigh: © 2020 杭州杰竞科技有限公司 版权所有
*/
...
...
@@ -372,6 +372,7 @@ function TrainList(props) {
const
_query
=
{
...
props
.
query
,
[
field
]:
value
,
current
:
1
,
};
props
.
onChange
(
_query
);
}
...
...
@@ -486,7 +487,11 @@ function TrainList(props) {
pageSize=
{
size
}
total=
{
totalCount
}
toPage=
{
(
page
)
=>
{
handleChangeQuery
(
'current'
,
page
+
1
);
const
_query
=
{
...
props
.
query
,
current
:
page
+
1
,
};
props
.
onChange
(
_query
);
}
}
showSizeChanger=
{
false
}
/>
...
...
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