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
658b3bf3
Commit
658b3bf3
authored
Aug 13, 2021
by
yuananting
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
feat:培训目的信息回显联调
parent
8eb4c61c
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
70 additions
and
30 deletions
+70
-30
src/modules/task-center/data-center/components/WholeData.jsx
+3
-3
src/modules/task-center/train-task/AddTrainTask.jsx
+61
-21
src/modules/task-center/train-task/components/BasicInfo.jsx
+6
-6
No files found.
src/modules/task-center/data-center/components/WholeData.jsx
View file @
658b3bf3
...
@@ -2,7 +2,7 @@
...
@@ -2,7 +2,7 @@
* @Author: yuananting
* @Author: yuananting
* @Date: 2021-08-05 11:26:25
* @Date: 2021-08-05 11:26:25
* @LastEditors: yuananting
* @LastEditors: yuananting
* @LastEditTime: 2021-08-1
2 21:12:08
* @LastEditTime: 2021-08-1
3 10:57:19
* @Description: 个人学习详情-全部tab页
* @Description: 个人学习详情-全部tab页
* @Copyrigh: © 2020 杭州杰竞科技有限公司 版权所有
* @Copyrigh: © 2020 杭州杰竞科技有限公司 版权所有
* @@Copyrigh: © 2020 杭州杰竞科技有限公司 版权所有
* @@Copyrigh: © 2020 杭州杰竞科技有限公司 版权所有
...
@@ -94,9 +94,9 @@ function WholeData(props) {
...
@@ -94,9 +94,9 @@ function WholeData(props) {
stageCustomerList
.
map
((
item
,
index
)
=>
{
stageCustomerList
.
map
((
item
,
index
)
=>
{
return
(
return
(
<
Panel
header=
{
renderStageInfo
(
item
,
index
)
}
key=
{
index
}
>
<
Panel
header=
{
renderStageInfo
(
item
,
index
)
}
key=
{
index
}
>
{
/* {item.course
VOList.map((contentItem, contentIndex) => {
{
item
.
content
VOList
.
map
((
contentItem
,
contentIndex
)
=>
{
return
renderContentInfo
(
contentItem
,
contentIndex
,
index
);
return
renderContentInfo
(
contentItem
,
contentIndex
,
index
);
})} */
}
})
}
</
Panel
>
</
Panel
>
);
);
})
}
})
}
...
...
src/modules/task-center/train-task/AddTrainTask.jsx
View file @
658b3bf3
...
@@ -2,7 +2,7 @@
...
@@ -2,7 +2,7 @@
* @Author: yuananting
* @Author: yuananting
* @Date: 2021-07-29 13:57:03
* @Date: 2021-07-29 13:57:03
* @LastEditors: yuananting
* @LastEditors: yuananting
* @LastEditTime: 2021-08-1
2 13:37:23
* @LastEditTime: 2021-08-1
3 15:11:56
* @Description: 任务中心-培训任务-新建页面
* @Description: 任务中心-培训任务-新建页面
* @Copyrigh: © 2020 杭州杰竞科技有限公司 版权所有
* @Copyrigh: © 2020 杭州杰竞科技有限公司 版权所有
* @@Copyrigh: © 2020 杭州杰竞科技有限公司 版权所有
* @@Copyrigh: © 2020 杭州杰竞科技有限公司 版权所有
...
@@ -20,6 +20,7 @@ import Upload from '@/core/upload';
...
@@ -20,6 +20,7 @@ import Upload from '@/core/upload';
import
{
randomString
}
from
'@/domains/basic-domain/utils'
;
import
{
randomString
}
from
'@/domains/basic-domain/utils'
;
import
TaskCenterService
from
'@/domains/task-center-domain/TaskCenterService'
;
import
TaskCenterService
from
'@/domains/task-center-domain/TaskCenterService'
;
import
Bus
from
'@/core/bus'
;
import
Bus
from
'@/core/bus'
;
import
$
from
'jquery'
;
const
defaultCover
=
'https://image.xiaomaiketang.com/xm/rEAetaTEh3.png'
;
const
defaultCover
=
'https://image.xiaomaiketang.com/xm/rEAetaTEh3.png'
;
...
@@ -34,6 +35,7 @@ const DEFAULT_BASIC_INFO = {
...
@@ -34,6 +35,7 @@ const DEFAULT_BASIC_INFO = {
learnType
:
'FREEDOM'
,
// 学习模式,默认自由学习
learnType
:
'FREEDOM'
,
// 学习模式,默认自由学习
assignList
:
[],
// 指派列表-assignId assignType
assignList
:
[],
// 指派列表-assignId assignType
introduce
:
null
,
// 培训目的
introduce
:
null
,
// 培训目的
loadintroduce
:
false
,
};
};
const
DEFAULT_STAGE_LIST
=
[
const
DEFAULT_STAGE_LIST
=
[
...
@@ -67,6 +69,12 @@ function AddTrainTask() {
...
@@ -67,6 +69,12 @@ function AddTrainTask() {
useEffect
(()
=>
{
useEffect
(()
=>
{
if
(
type
===
'edit'
)
{
if
(
type
===
'edit'
)
{
initTaskData
();
}
},
[]);
// 编辑回显数据详情
function
initTaskData
()
{
TaskCenterService
.
getTrainingTaskDetail
({
TaskCenterService
.
getTrainingTaskDetail
({
taskId
,
taskId
,
}).
then
((
res
)
=>
{
}).
then
((
res
)
=>
{
...
@@ -112,13 +120,6 @@ function AddTrainTask() {
...
@@ -112,13 +120,6 @@ function AddTrainTask() {
startTime
,
startTime
,
endTime
,
endTime
,
learnType
,
learnType
,
// introduce: null, // 培训目的
};
const
ITEM_FINISH_STANDARD
=
{
percentCompleteLive
,
percentCompletePicture
,
percentCompleteVideo
,
};
};
const
_stageList
=
trainingStageList
.
map
((
item
)
=>
{
const
_stageList
=
trainingStageList
.
map
((
item
)
=>
{
...
@@ -127,12 +128,37 @@ function AddTrainTask() {
...
@@ -127,12 +128,37 @@ function AddTrainTask() {
return
item
;
return
item
;
});
});
setBasicInfo
(
ITEM_BASIC_INFO
);
const
introduceInfo
=
courseMediaVOS
.
filter
((
item
)
=>
item
.
contentType
===
'INTRO'
)[
0
];
setFinishStandard
(
ITEM_FINISH_STANDARD
);
setBasicInfo
({
...
basicInfoRef
.
current
,
...
ITEM_BASIC_INFO
,
loadintroduce
:
!
introduceInfo
});
setFinishStandard
({
percentCompleteLive
,
percentCompletePicture
,
percentCompleteVideo
,
});
setStageList
(
_stageList
);
setStageList
(
_stageList
);
introduceInfo
&&
getTextDetail
(
'introduce'
,
introduceInfo
.
mediaUrl
);
});
}
// 获取培训目的内容
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
renderFooter
()
{
function
renderFooter
()
{
...
@@ -169,6 +195,24 @@ function AddTrainTask() {
...
@@ -169,6 +195,24 @@ function AddTrainTask() {
const
{
percentCompleteLive
,
percentCompletePicture
,
percentCompleteVideo
}
=
finishStandard
;
const
{
percentCompleteLive
,
percentCompletePicture
,
percentCompleteVideo
}
=
finishStandard
;
let
_scheduleMediaRequests
=
[];
if
(
coverId
)
{
_scheduleMediaRequests
.
push
({
contentType
:
'COVER'
,
mediaContent
:
coverId
,
mediaType
:
'PICTURE'
,
});
}
if
(
introduceId
)
{
_scheduleMediaRequests
.
push
({
contentType
:
'INTRO'
,
mediaContent
:
introduceId
,
mediaType
:
'RESOURCE_ID'
,
});
}
const
_stageList
=
stageList
.
map
((
item
,
index
)
=>
{
const
_stageList
=
stageList
.
map
((
item
,
index
)
=>
{
delete
item
.
contentVOList
;
delete
item
.
contentVOList
;
delete
item
.
check
;
delete
item
.
check
;
...
@@ -196,16 +240,7 @@ function AddTrainTask() {
...
@@ -196,16 +240,7 @@ function AddTrainTask() {
helpStoreUserIds
:
_helpStoreUserIds
,
// 协同者集合
helpStoreUserIds
:
_helpStoreUserIds
,
// 协同者集合
issueState
:
issue
,
// 是否发布
issueState
:
issue
,
// 是否发布
learnType
,
// 学习模式
learnType
,
// 学习模式
scheduleMediaRequests
:
coverId
scheduleMediaRequests
:
_scheduleMediaRequests
,
?
[
{
contentType
:
'COVER'
,
mediaContent
:
coverId
,
mediaType
:
'PICTURE'
,
mediaUrl
:
coverUrl
,
},
]
:
[],
startTime
,
startTime
,
storeId
:
User
.
getStoreId
(),
storeId
:
User
.
getStoreId
(),
taskName
,
taskName
,
...
@@ -262,6 +297,8 @@ function AddTrainTask() {
...
@@ -262,6 +297,8 @@ function AddTrainTask() {
if
(
percentCompleteLive
===
''
||
percentCompleteVideo
===
''
||
percentCompletePicture
===
''
)
{
if
(
percentCompleteLive
===
''
||
percentCompleteVideo
===
''
||
percentCompletePicture
===
''
)
{
return
message
.
warning
(
'请输入完成标准'
);
return
message
.
warning
(
'请输入完成标准'
);
}
}
if
(
basicInfo
.
introduce
)
{
Upload
.
uploadTextToOSS
(
Upload
.
uploadTextToOSS
(
basicInfo
.
introduce
,
basicInfo
.
introduce
,
`
${
randomString
()}
.txt`
,
`
${
randomString
()}
.txt`
,
...
@@ -270,6 +307,9 @@ function AddTrainTask() {
...
@@ -270,6 +307,9 @@ function AddTrainTask() {
},
},
()
=>
message
.
warning
(
'上传培训目的失败'
)
()
=>
message
.
warning
(
'上传培训目的失败'
)
);
);
}
else
{
submitRemote
(
null
,
issue
);
}
}
}
// 返回、取消
// 返回、取消
...
...
src/modules/task-center/train-task/components/BasicInfo.jsx
View file @
658b3bf3
...
@@ -2,7 +2,7 @@
...
@@ -2,7 +2,7 @@
* @Author: yuananting
* @Author: yuananting
* @Date: 2021-07-29 14:32:24
* @Date: 2021-07-29 14:32:24
* @LastEditors: yuananting
* @LastEditors: yuananting
* @LastEditTime: 2021-08-1
2 15:51:24
* @LastEditTime: 2021-08-1
3 15:09:56
* @Description: 任务中心-培训任务-新建-基本信息
* @Description: 任务中心-培训任务-新建-基本信息
* @Copyrigh: © 2020 杭州杰竞科技有限公司 版权所有
* @Copyrigh: © 2020 杭州杰竞科技有限公司 版权所有
* @@Copyrigh: © 2020 杭州杰竞科技有限公司 版权所有
* @@Copyrigh: © 2020 杭州杰竞科技有限公司 版权所有
...
@@ -28,8 +28,7 @@ function BasicInfo(props) {
...
@@ -28,8 +28,7 @@ function BasicInfo(props) {
const
type
=
getParameterByName
(
'type'
);
const
type
=
getParameterByName
(
'type'
);
const
{
basicInfo
,
startCheck
}
=
props
;
const
{
basicInfo
,
startCheck
}
=
props
;
const
{
taskName
,
coverUrl
,
helpStoreUserIds
,
timeType
,
startTime
,
endTime
,
learnType
,
assignList
,
introduce
}
=
basicInfo
;
const
{
taskName
,
coverUrl
,
helpStoreUserIds
,
timeType
,
startTime
,
endTime
,
learnType
,
assignList
,
introduce
,
loadintroduce
}
=
basicInfo
;
console
.
log
(
assignList
);
const
depAssignList
=
assignList
.
filter
((
item
)
=>
[
0
,
1
].
includes
(
item
.
depLevel
));
const
depAssignList
=
assignList
.
filter
((
item
)
=>
[
0
,
1
].
includes
(
item
.
depLevel
));
const
userAssignList
=
assignList
.
filter
((
item
)
=>
!
[
0
,
1
].
includes
(
item
.
depLevel
));
const
userAssignList
=
assignList
.
filter
((
item
)
=>
!
[
0
,
1
].
includes
(
item
.
depLevel
));
const
[
imageFile
,
setImageFile
]
=
useState
(
null
);
// 需要被截取的图片
const
[
imageFile
,
setImageFile
]
=
useState
(
null
);
// 需要被截取的图片
...
@@ -242,9 +241,8 @@ function BasicInfo(props) {
...
@@ -242,9 +241,8 @@ function BasicInfo(props) {
</
span
>
</
span
>
}
}
required
required
// validateStatus={startCheck && assignList.length === 0 ? 'error' : ''}
validateStatus=
{
startCheck
&&
assignList
.
length
===
0
?
'error'
:
''
}
// help={startCheck && assignList.length === 0 && '请选择培训时间'}>
help=
{
startCheck
&&
assignList
.
length
===
0
&&
'请选择培训时间'
}
>
>
<
Button
<
Button
style=
{
{
display
:
'block'
}
}
style=
{
{
display
:
'block'
}
}
onClick=
{
()
=>
{
onClick=
{
()
=>
{
...
@@ -324,6 +322,7 @@ function BasicInfo(props) {
...
@@ -324,6 +322,7 @@ function BasicInfo(props) {
)
}
)
}
</
FormItem
>
</
FormItem
>
<
FormItem
label=
'培训目的'
>
<
FormItem
label=
'培训目的'
>
{
(
type
===
'add'
||
loadintroduce
)
&&
(
<
GraphicsEditor
<
GraphicsEditor
maxLimit=
{
1000
}
maxLimit=
{
1000
}
id=
'intro'
id=
'intro'
...
@@ -336,6 +335,7 @@ function BasicInfo(props) {
...
@@ -336,6 +335,7 @@ function BasicInfo(props) {
props
.
onChange
(
'introduce'
,
val
);
props
.
onChange
(
'introduce'
,
val
);
}
}
}
}
/>
/>
)
}
</
FormItem
>
</
FormItem
>
</
Form
>
</
Form
>
{
showSelectFileModal
&&
(
{
showSelectFileModal
&&
(
...
...
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