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
9fd879ea
Commit
9fd879ea
authored
Mar 08, 2021
by
zhangleyuan
Browse files
Options
Browse Files
Download
Plain Diff
feat:解决合并代码后的冲突
parents
382f2c1c
a7764920
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
14 changed files
with
493 additions
and
99 deletions
+493
-99
src/data-source/course/request-api.ts
+5
-1
src/data-source/store/request-apis.ts
+9
-2
src/domains/course-domain/CourseService.ts
+6
-2
src/domains/store-domain/constants.ts
+28
-2
src/domains/store-domain/storeService.ts
+11
-3
src/modules/course-manage/components/LiveCourseList.jsx
+49
-8
src/modules/course-manage/modal/RelatedPlanModal.jsx
+91
-12
src/modules/course-manage/modal/RelatedPlanModal.less
+124
-0
src/modules/course-manage/video-course/AddVideoCourse.jsx
+0
-0
src/modules/course-manage/video-course/components/VideoCourseList.jsx
+74
-6
src/modules/plan-manage/AddPlan.jsx
+6
-1
src/modules/plan-manage/components/TrainingTask.jsx
+90
-61
src/modules/plan-manage/modal/relatedCourseModal.jsx
+0
-1
src/modules/store-manage/StoreInfo.jsx
+0
-0
No files found.
src/data-source/course/request-api.ts
View file @
9fd879ea
...
...
@@ -2,7 +2,7 @@
* @Author: wufan
* @Date: 2020-12-12 11:57:10
* @LastEditors: zhangleyuan
* @LastEditTime: 2021-0
2-28 13:47:38
* @LastEditTime: 2021-0
3-05 17:20:29
* @Description: Description
* @@Copyrigh: © 2020 杭州杰竞科技有限公司 版权所有
*/
...
...
@@ -84,4 +84,7 @@ export function videoWatchInfo(params: object) {
}
export
function
videoScheduleBasePage
(
params
:
object
)
{
return
Service
.
Hades
(
"public/hades/videoScheduleBasePage"
,
params
);
}
export
function
relatedCourseToPlan
(
params
:
object
)
{
return
Service
.
Hades
(
"public/hades/relatedCourseToPlan"
,
params
);
}
\ No newline at end of file
src/data-source/store/request-apis.ts
View file @
9fd879ea
/*
* @Author: wufan
* @Date: 2020-11-25 18:25:02
* @LastEditors:
wuf
an
* @LastEditTime: 2021-0
1-11 19:38:50
* @LastEditors:
zhangleyu
an
* @LastEditTime: 2021-0
3-08 11:47:58
* @Description: Description
* @@Copyrigh: © 2020 杭州杰竞科技有限公司 版权所有
*/
...
...
@@ -68,3 +68,9 @@ export function delCourseCategory(params: object) {
export
function
getStoreUserBasicPage
(
params
:
object
)
{
return
Service
.
Hades
(
"public/hades/getStoreUserBasicPage"
,
params
);
}
export
function
updateStoreMessage
(
params
:
object
)
{
return
Service
.
Hades
(
"public/hades/updateStoreMessage"
,
params
);
}
export
function
getStoreDetail
(
params
:
object
)
{
return
Service
.
Hades
(
"public/hades/getStoreDetail"
,
params
);
}
\ No newline at end of file
src/domains/course-domain/CourseService.ts
View file @
9fd879ea
...
...
@@ -2,14 +2,14 @@
* @Author: wufan
* @Date: 2020-11-25 18:25:02
* @LastEditors: zhangleyuan
* @LastEditTime: 2021-0
2-28 15:15:37
* @LastEditTime: 2021-0
3-05 17:20:56
* @Description: Description
* @@Copyrigh: © 2020 杭州杰竞科技有限公司 版权所有
*/
import
{
fetchLecturerData
,
fetchUserData
,
exportStudentCourseData
,
exportPlayBackCourseData
,
fetchPlaybackList
,
createLiveCloudCourse
,
getLiveCloudCoursePage
,
getLiveCloudCourseDetail
,
updateLiveCloudCourse
,
turnOnOrOffLiveCloudCourse
,
delLiveCloudCourse
,
changeVideoShelfState
,
createVideoSchedule
,
delVideoSchedule
,
editVideoSchedule
,
userWatchInfo
,
videoSchedulePage
,
videoScheduleDetail
,
videoWatchInfo
,
getQrcode
,
getLiveCloudCourseBasePage
,
videoScheduleBasePage
editVideoSchedule
,
userWatchInfo
,
videoSchedulePage
,
videoScheduleDetail
,
videoWatchInfo
,
getQrcode
,
getLiveCloudCourseBasePage
,
videoScheduleBasePage
,
relatedCourseToPlan
}
from
'@/data-source/course/request-api'
;
export
default
class
courseService
{
...
...
@@ -91,4 +91,7 @@ export default class courseService {
static
videoScheduleBasePage
(
params
:
any
){
return
videoScheduleBasePage
(
params
);
}
static
relatedCourseToPlan
(
params
:
any
){
return
relatedCourseToPlan
(
params
);
}
}
\ No newline at end of file
src/domains/store-domain/constants.ts
View file @
9fd879ea
/*
* @Author: zhangleyuan
* @Date: 2021-01-19 11:27:56
* @LastEditors: zhangleyuan
* @LastEditTime: 2021-03-08 10:36:04
* @Description: 描述一下
* @@Copyrigh: © 2020 杭州杰竞科技有限公司 版权所有
*/
export
const
storeRoleEnum
=
{
"0"
:
"店铺管理员"
,
"1"
:
"管理员"
,
"2"
:
"普通讲师"
};
\ No newline at end of file
};
export
const
industryList
=
[
"IT服务"
,
"制造业"
,
"批发/零售"
,
"生活服务"
,
"文化/体育/娱乐业"
,
"建筑/房地产"
,
"教育"
,
"运输/物流/仓储"
,
"医疗"
,
"政府"
,
"金融"
,
"能源/采矿"
,
"农林渔牧"
,
"其他行业"
];
export
const
childIndustryList
=
{
"IT服务"
:[
"计算机软件/硬件/信息服务"
,
"互联网和相关服务"
,
"其他"
],
"制造业"
:[
"机械/电子"
,
"服装/纺织"
,
"汽车"
,
"金属制品"
,
"家具/家纺"
,
"重工制造"
,
"家电/数码"
,
"橡胶/塑料"
,
"日用品/化妆品"
,
"化学原料制品"
,
"文教/工美/体育/娱乐用品"
,
"烟酒/茶"
,
"非金属矿物"
,
"其他"
],
"批发/零售"
:[
"批发"
,
"零售"
,
"超市/便利店/百货商场"
,
"进出口"
,
"其他"
],
"生活服务"
:[
"餐饮"
,
"居民服务"
,
"租赁和商务服务"
,
"酒店/住宿"
,
"其他"
],
"文化/体育/娱乐业"
:[
"文化/体育"
,
"娱乐/旅游"
,
"新闻传媒"
,
"其他"
],
"建筑/房地产"
:[
"建筑业"
,
"建材装修"
,
"房地产"
,
"其他"
],
"教育"
:[
"学前教育"
,
"初中等教育"
,
"高等教育"
,
"培训机构"
,
"其他"
],
"运输/物流/仓储"
:[
"物流/仓储"
,
"道路/铁路运输"
,
"邮政/快递"
,
"航空运输"
,
"水上运输"
,
"其他"
],
"医疗"
:[
"医院/医疗机构"
,
"医疗器械"
,
"医药制造"
,
"医药流通"
,
"其他"
],
"政府"
:[
"党政机关"
,
"国家权利/行政机构"
,
"检察院/法院/公安"
,
"民政/人社/交通/卫生"
,
"发改委/经信委/商务局/统计局"
,
"国土/规划"
,
"税务/海关/工商/环保/物价/药品"
,
"政协/民主党派"
,
"地方政府"
,
"其他"
],
"金融"
:[
"保险"
,
"银行"
,
"证券/投资/基金"
,
"其他"
],
"能源/采矿"
:[
"电力/热力/燃气/水供应业"
,
"石油/天然气"
,
"煤炭"
,
"有色金属"
,
"钢铁"
,
"其他"
],
"农林渔牧"
:[
"农林渔牧"
],
"其他行业"
:[
"科学研究和技术服务业"
,
"社会组织"
,
"水利和环境管理"
,
"国际组织"
,
"其他"
]
}
\ No newline at end of file
src/domains/store-domain/storeService.ts
View file @
9fd879ea
...
...
@@ -2,11 +2,13 @@
* @Author: wufan
* @Date: 2020-11-25 18:25:02
* @LastEditors: zhangleyuan
* @LastEditTime: 202
0-12-23 16:54:10
* @LastEditTime: 202
1-03-08 11:48:43
* @Description: Description
* @@Copyrigh: © 2020 杭州杰竞科技有限公司 版权所有
*/
import
{
getEmployeeList
,
getUserList
,
getStoreDecorationList
,
getStoreRole
,
addEmployee
,
editEmployee
,
deleteEmployee
,
getCourseCatalogList
,
getAllSonCategory
,
addCourseCategory
,
delCourseCategory
,
editCourseCategory
,
deleteStoreDecorationList
,
addStoreBanner
,
editStoreBanner
,
moveBannerSequence
,
getStoreUserBasicPage
}
from
'@/data-source/store/request-apis'
;
import
{
getEmployeeList
,
getUserList
,
getStoreDecorationList
,
getStoreRole
,
addEmployee
,
editEmployee
,
deleteEmployee
,
getCourseCatalogList
,
getAllSonCategory
,
addCourseCategory
,
delCourseCategory
,
editCourseCategory
,
deleteStoreDecorationList
,
addStoreBanner
,
editStoreBanner
,
moveBannerSequence
,
getStoreUserBasicPage
,
updateStoreMessage
,
getStoreDetail
}
from
'@/data-source/store/request-apis'
;
export
default
class
StoreService
{
// 获取员工列表
...
...
@@ -81,5 +83,10 @@ export default class StoreService {
static
delCourseCategory
(
params
:
any
)
{
return
delCourseCategory
(
params
);
}
static
updateStoreMessage
(
params
:
any
)
{
return
updateStoreMessage
(
params
);
}
static
getStoreDetail
(
params
:
any
)
{
return
getStoreDetail
(
params
);
}
}
\ No newline at end of file
src/modules/course-manage/components/LiveCourseList.jsx
View file @
9fd879ea
...
...
@@ -15,7 +15,7 @@ import DownloadLiveModal from '@/components/DownloadLiveModal';
import
ManageCoursewareModal
from
'../modal/ManageCoursewareModal'
;
import
ShareLiveModal
from
'../modal/ShareLiveModal'
;
import
RelatedPlanModal
from
'../modal/RelatedPlanModal'
;
import
'./LiveCourseList.less'
;
import
{
QuestionCircleOutlined
}
from
'@ant-design/icons'
;
...
...
@@ -57,7 +57,8 @@ class LiveCourseList extends React.Component {
columns
:
[],
openDownloadModal
:
false
,
url
:
''
,
RelatedPlanModalVisible
:
false
RelatedPlanModalVisible
:
false
,
selectPlanList
:{}
}
}
componentWillMount
(){
...
...
@@ -537,7 +538,7 @@ class LiveCourseList extends React.Component {
renderMoreOperate
=
(
item
)
=>
{
return
(
<
div
className=
"live-course-more-menu"
>
<
div
<
div
className=
"operate__item"
onClick=
{
()
=>
this
.
handleRelatedModalShow
(
item
)
}
>
关联培训计划
</
div
>
...
...
@@ -661,14 +662,49 @@ class LiveCourseList extends React.Component {
}
window
.
open
(
htmlUrl
);
}
handleRelatedModalShow
=
(
item
)
handleRelatedModalShow
=
(
item
)
=>
{
const
selectPlanList
=
{};
if
(
item
.
relatedPlanList
){
item
.
relatedPlanList
.
map
((
item
,
index
)
=>
{
selectPlanList
[
item
.
planId
]
=
{}
selectPlanList
[
item
.
planId
].
planId
=
item
.
planId
;
selectPlanList
[
item
.
planId
].
taskBaseVOList
=
[{
taskId
:
item
.
taskId
}];
return
item
})
}
this
.
setState
({
RelatedPlanModalVisible
:
true
,
selectCourseId
:
item
.
liveCourseId
,
selectPlanList
:
selectPlanList
})
}
closeRelatedPlanModalVisible
=
()
=>
{
this
.
setState
({
RelatedPlanModalVisible
:
false
})
}
onChangeSelectPlanList
=
(
selectPlanList
)
=>
{
this
.
setState
({
selectPlanList
:
selectPlanList
})
}
onConfirmSelectPlanList
=
()
=>
{
this
.
setState
({
RelatedPlanModalVisible
:
false
},()
=>
{
this
.
props
.
onChange
();})
}
render
()
{
const
{
total
,
query
,
courseList
,
loading
}
=
this
.
props
;
const
{
current
,
size
}
=
query
;
const
{
openDownloadModal
,
downloadUrl
,
url
,
columns
,
openCoursewareModal
,
editData
editData
,
RelatedPlanModalVisible
,
selectCourseId
,
selectPlanList
}
=
this
.
state
;
const
{
match
}
=
this
.
props
;
...
...
@@ -720,10 +756,15 @@ class LiveCourseList extends React.Component {
/>
)
}
{
RelatedPlanModalVisible
&&
<
RelatedPlanModal
/>
<
RelatedPlanModal
onClose=
{
this
.
closeRelatedPlanModalVisible
}
visible=
{
RelatedPlanModalVisible
}
selectCourseId=
{
selectCourseId
}
selectPlanList=
{
selectPlanList
}
onChange=
{
this
.
onChangeSelectPlanList
}
onConfirm=
{
this
.
onConfirmSelectPlanList
}
/>
}
<
iframe
src=
{
url
}
style=
{
{
display
:
"none"
}
}
/>
<
Route
path=
{
`${match.url}/live-course-data`
}
component=
{
DataList
}
/>
</
div
>
...
...
src/modules/course-manage/modal/RelatedPlanModal.jsx
View file @
9fd879ea
import
React
from
'react'
;
import
{
Table
,
Modal
,
Input
}
from
'antd'
;
import
{
PageControl
}
from
"@/components"
;
import
PlanService
from
'@/domains/plan-domain/planService'
import
CourseService
from
"@/domains/course-domain/CourseService"
;
import
PlanService
from
"@/domains/plan-domain/planService"
;
import
User
from
'@/common/js/user'
import
'./
SelectOperator
Modal.less'
;
import
'./
RelatedPlan
Modal.less'
;
import
_
from
"underscore"
;
const
{
Search
}
=
Input
;
class
RelatedPlanModal
extends
React
.
Component
{
...
...
@@ -16,12 +17,13 @@ class RelatedPlanModal extends React.Component {
current
:
1
,
},
totalCount
:
0
,
selectPlanList
:{},
};
}
componentDidMount
()
{
this
.
handleFetchDataList
();
}
// 获取培训计划列表
handleFetchDataList
=
()
=>
{
const
{
query
,
size
,
totalCount
}
=
this
.
state
...
...
@@ -40,6 +42,7 @@ class RelatedPlanModal extends React.Component {
});
}
handleChangePlanName
=
(
value
)
=>
{
const
{
query
}
=
this
.
state
;
query
.
planName
=
value
;
query
.
current
=
1
;
this
.
setState
({
...
...
@@ -88,9 +91,53 @@ class RelatedPlanModal extends React.Component {
];
return
columns
;
}
selectPlanList
=
(
record
,
selected
,
planId
)
=>
{
const
{
selectPlanList
}
=
this
.
props
;
let
_selectPlanList
=
{...
selectPlanList
};
if
(
selected
)
{
if
(
!
_selectPlanList
[
planId
]){
_selectPlanList
[
planId
]
=
{}
}
_selectPlanList
[
planId
].
taskBaseVOList
=
[];
_selectPlanList
[
planId
].
planId
=
planId
;
_selectPlanList
[
planId
].
taskBaseVOList
.
push
(
record
);
}
else
{
if
(
!
_selectPlanList
[
planId
]){
_selectPlanList
[
planId
]
=
{}
}
_selectPlanList
[
planId
].
taskBaseVOList
=
[];
_selectPlanList
[
planId
].
planId
=
planId
;
}
this
.
props
.
onChange
(
_selectPlanList
);
// this.setState({selectPlanList:_selectPlanList});
}
handleSelectPlanListData
(
selectPlanList
){
let
_selectPlanList
=
[];
for
(
let
key
in
selectPlanList
){
let
item
=
{};
if
(
selectPlanList
[
key
].
taskBaseVOList
){
item
.
planId
=
selectPlanList
[
key
].
planId
;
item
.
taskId
=
selectPlanList
[
key
].
taskBaseVOList
[
0
].
taskId
;
}
_selectPlanList
.
push
(
item
)
}
return
_selectPlanList
;
}
confirmRelatedPlan
=
()
=>
{
const
{
selectPlanList
}
=
this
.
props
;
const
params
=
{
courseId
:
this
.
props
.
selectCourseId
,
relatedPlanList
:
this
.
handleSelectPlanListData
(
selectPlanList
),
storeId
:
User
.
getStoreId
(),
}
CourseService
.
relatedCourseToPlan
(
params
).
then
((
res
)
=>
{
this
.
props
.
onConfirm
();
});
}
render
()
{
const
{
size
,
dataSource
,
totalCount
,
query
,
selectOperatorList
}
=
this
.
state
;
const
{
visible
}
=
this
.
props
;
const
{
size
,
dataSource
,
totalCount
,
query
}
=
this
.
state
;
const
{
visible
,
selectPlanList
}
=
this
.
props
;
return
(
<
Modal
title=
"关联培训计划"
...
...
@@ -100,11 +147,21 @@ class RelatedPlanModal extends React.Component {
className=
"related-plan-modal"
closable=
{
true
}
width=
{
800
}
onOk=
{
()
=>
this
.
props
.
onSelect
(
selectOperatorList
)
}
onOk=
{
()
=>
this
.
confirmRelatedPlan
(
)
}
closeIcon=
{
<
span
className=
"icon iconfont modal-close-icon"
>

</
span
>
}
>
<
div
className=
"search-container"
>
<
Search
placeholder=
"搜索培训计划名称"
style=
{
{
width
:
200
}
}
onChange=
{
(
e
)
=>
{
this
.
handleChangePlanName
(
e
.
target
.
value
)}
}
onSearch=
{
()
=>
{
this
.
handleFetchDataList
()}
}
/>
<
Search
placeholder=
"搜索培训计划名称"
style=
{
{
width
:
207
}
}
onChange=
{
(
e
)
=>
{
this
.
handleChangePlanName
(
e
.
target
.
value
)}
}
onSearch=
{
()
=>
{
this
.
handleFetchDataList
()}
}
enterButton=
{
<
span
className=
"icon iconfont"
>

</
span
>
}
/>
</
div
>
<
div
className=
"select-container"
>
<
span
className=
"icon iconfont tip"
>

</
span
>
<
span
className=
"text"
>
已选择个任务
</
span
>
<
span
className=
"clear"
>
清空
</
span
>
</
div
>
<
div
>
<
Table
...
...
@@ -113,19 +170,41 @@ class RelatedPlanModal extends React.Component {
dataSource=
{
dataSource
}
columns=
{
this
.
parsePlanColumns
()
}
pagination=
{
false
}
expandedRowRender=
{
(
record
,
index
)
=>
{
if
(
!
record
.
taskBaseVOList
){
expandedRowRender=
{
(
_
record
,
index
)
=>
{
if
(
!
_
record
.
taskBaseVOList
){
return
}
if
(
record
.
taskBaseVOList
.
length
!==
0
){
if
(
_record
.
taskBaseVOList
.
length
!==
0
){
const
selectPlan
=
selectPlanList
[
_record
.
planId
]
let
taskBaseVOList
=
[];
if
(
selectPlan
){
taskBaseVOList
=
selectPlan
.
taskBaseVOList
;
}
console
.
log
(
'taskBaseVOList'
,
taskBaseVOList
);
return
<
div
>
<
Table
rowKey=
{
record
=>
record
.
taskId
}
pagination=
{
false
}
dataSource=
{
record
.
taskBaseVOList
}
dataSource=
{
_
record
.
taskBaseVOList
}
columns=
{
this
.
parseTaskColumns
(
index
)
}
className=
"child-table"
rowSelection=
{
{
type
:
'checkbox'
type
:
'checkbox'
,
selectedRowKeys
:
_
.
pluck
(
taskBaseVOList
,
'taskId'
),
onSelect
:
(
record
,
selected
)
=>
{
this
.
selectPlanList
(
record
,
selected
,
_record
.
planId
);
},
onSelectAll
:
(
selected
,
_selectedRows
,
changeRows
)
=>
{
// let _list = [];
// if (selected)
{
// _list = _.uniq(selectVideo.concat(changeRows), false, (item) => item.id);
//
}
else
{
// _list = _.reject(selectVideo, (item) => _.find(changeRows, (data) => data.id === item.id));
//
}
// this.setState(
{
selectVideo
:
_list
});
},
}
}
/>
</
div
>
...
...
src/modules/course-manage/modal/RelatedPlanModal.less
View file @
9fd879ea
.related-plan-modal{
.search-container{
margin-bottom:16px;
}
.select-container{
margin-bottom:12px;
background: #FFF4DD;
border-radius: 4px;
padding:6px 16px;
width: 207px;
height: 32px;
.tip{
font-size:14px;
color:#FF9D14;
margin-right:8px;
}
.text{
font-size:14px;
color:#666;
margin-right:30px;
}
.clear{
color:#5289FA;
font-size:14px;
}
}
.plan-table{
.taskName{
color:#666666;
font-size:14px;
}
.task-learn-percentage{
color:#666666;
font-size:14px;
}
.course-info{
margin-left:57px;
.course-type{
font-size:11px;
color:#666666;
padding:1px 8px;
border: 1px solid #999999;
margin-right:4px;
border-radius: 2px;
}
.course-name{
color:#666666;
font-size:14px;
margin-right:8px;
}
.tip{
font-size:14px;
color:#FF4F4F;
margin-right:2px;
}
.course-state{
color:#999;
font-size:14px;
}
}
.ant-table-content{
border:1px solid #e8e8e8;
tr{
td{
border:none;
}
.child-table{
.ant-table-content{
border:none;
thead{
display:none;
}
tbody tr td{
border-bottom:none;
}
}
}
}
.odd-row{
background:transparent;
td{
background: #FFF;
}
& + .ant-table-expanded-row{
background:transparent;
td{
background: #FFF;
}
}
&:hover{
& + .ant-table-expanded-row{
background:transparent;
td{
background: #F3f6fa !important;
}
}
}
}
.even-row{
background:transparent;
td{
background: #FAFAFA;
}
& + .ant-table-expanded-row{
background:transparent;
td{
background: #FAFAFA;
}
}
&:hover{
& + .ant-table-expanded-row{
background:transparent;
td{
background: #F3f6fa !important;
}
}
}
}
}
}
}
\ No newline at end of file
src/modules/course-manage/video-course/AddVideoCourse.jsx
View file @
9fd879ea
This diff is collapsed.
Click to expand it.
src/modules/course-manage/video-course/components/VideoCourseList.jsx
View file @
9fd879ea
...
...
@@ -2,7 +2,7 @@
* @Author: 吴文洁
* @Date: 2020-08-05 10:12:45
* @LastEditors: zhangleyuan
* @LastEditTime: 2021-0
2-01 16:34:11
* @LastEditTime: 2021-0
3-08 15:07:16
* @Description: 视频课-列表模块
* @Copyright: 杭州杰竞科技有限公司 版权所有
*/
...
...
@@ -17,21 +17,23 @@ import { appId, shareUrl, LIVE_SHARE } from '@/domains/course-domain/constants';
import
ShareLiveModal
from
'@/modules/course-manage/modal/ShareLiveModal'
;
import
WatchDataModal
from
'../modal/WatchDataModal'
import
CourseService
from
"@/domains/course-domain/CourseService"
;
import
RelatedPlanModal
from
'../../modal/RelatedPlanModal'
;
import
User
from
'@/common/js/user'
import
'./VideoCourseList.less'
;
const
ENV
=
process
.
env
.
DEPLOY_ENV
||
'dev'
;
const
userRole
=
User
.
getUserRole
();
class
VideoCourseList
extends
React
.
Component
{
constructor
(
props
)
{
super
(
props
);
this
.
state
=
{
id
:
''
,
// 视频课ID
studentIds
:[]
studentIds
:[],
RelatedPlanModalVisible
:
false
,
selectPlanList
:{}
}
}
...
...
@@ -166,6 +168,25 @@ class VideoCourseList extends React.Component {
}
},
{
title
:
'关联项'
,
width
:
200
,
key
:
"planList"
,
dataIndex
:
"planList"
,
render
:
(
val
,
record
)
=>
{
return
(
<
span
>
{
record
.
relatedPlanList
?
record
.
relatedPlanList
.
map
((
item
,
index
)
=>
{
return
<
span
>
{
item
.
planName
}
{
(
index
<
record
.
relatedPlanList
.
length
-
1
)
&&
(<
span
>
、
</
span
>)
}
</
span
>
})
:
<
span
></
span
>
}
</
span
>
)
}
},
{
title
:
'操作'
,
key
:
'operate'
,
dataIndex
:
'operate'
,
...
...
@@ -200,6 +221,12 @@ class VideoCourseList extends React.Component {
renderMoreOperate
=
(
item
)
=>
{
return
(
<
div
className=
"live-course-more-menu"
>
{
(
userRole
===
"CloudManager"
||
userRole
===
"StoreManager"
)
&&
<
div
className=
"operate__item"
onClick=
{
()
=>
this
.
handleRelatedModalShow
(
item
)
}
>
关联培训计划
</
div
>
}
<
div
className=
"operate__item"
onClick=
{
()
=>
{
...
...
@@ -237,6 +264,7 @@ class VideoCourseList extends React.Component {
}
})
}
// 删除视频课
handleDeleteVideoCourse
=
(
scheduleId
)
=>
{
Modal
.
confirm
({
...
...
@@ -314,12 +342,42 @@ class VideoCourseList extends React.Component {
};
this
.
props
.
onChange
(
_query
);
}
handleRelatedModalShow
=
(
item
)
=>
{
const
selectPlanList
=
{};
if
(
item
.
relatedPlanList
){
item
.
relatedPlanList
.
map
((
item
,
index
)
=>
{
selectPlanList
[
item
.
planId
]
=
{}
selectPlanList
[
item
.
planId
].
planId
=
item
.
planId
;
selectPlanList
[
item
.
planId
].
taskBaseVOList
=
[{
taskId
:
item
.
taskId
}];
return
item
})
}
this
.
setState
({
RelatedPlanModalVisible
:
true
,
selectCourseId
:
item
.
id
,
selectPlanList
:
selectPlanList
})
}
closeRelatedPlanModalVisible
=
()
=>
{
this
.
setState
({
RelatedPlanModalVisible
:
false
})
}
onChangeSelectPlanList
=
(
selectPlanList
)
=>
{
this
.
setState
({
selectPlanList
:
selectPlanList
})
}
onConfirmSelectPlanList
=
()
=>
{
this
.
setState
({
RelatedPlanModalVisible
:
false
},()
=>
{
this
.
props
.
onChange
();})
}
render
()
{
const
{
dataSource
=
[],
totalCount
,
query
}
=
this
.
props
;
const
{
current
,
size
}
=
query
;
const
{
RelatedPlanModalVisible
,
selectPlanList
,
selectCourseId
}
=
this
.
state
;
return
(
<
div
className=
"video-course-list"
>
<
Table
...
...
@@ -344,6 +402,16 @@ class VideoCourseList extends React.Component {
}
}
/>
</
div
>
{
RelatedPlanModalVisible
&&
<
RelatedPlanModal
onClose=
{
this
.
closeRelatedPlanModalVisible
}
visible=
{
RelatedPlanModalVisible
}
selectCourseId=
{
selectCourseId
}
selectPlanList=
{
selectPlanList
}
onChange=
{
this
.
onChangeSelectPlanList
}
onConfirm=
{
this
.
onConfirmSelectPlanList
}
/>
}
{
this
.
state
.
shareLiveModal
}
{
this
.
state
.
watchDataModal
}
</
div
>
...
...
src/modules/plan-manage/AddPlan.jsx
View file @
9fd879ea
...
...
@@ -212,7 +212,12 @@ function AddPlan() {
</
div
>
<
div
className=
"basic-info__wrap"
>
<
div
className=
"title"
>
培训任务
</
div
>
<
TrainingTask
data=
{
taskList
}
onChange=
{
handleChangeTaskInfo
}
/>
{
(
type
===
'edit'
&&
taskList
.
length
>
0
)
&&
<
TrainingTask
data=
{
taskList
}
onChange=
{
handleChangeTaskInfo
}
/>
}
{
type
===
'add'
&&
<
TrainingTask
data=
{
taskList
}
onChange=
{
handleChangeTaskInfo
}
/>
}
</
div
>
</
div
>
</
div
>
...
...
src/modules/plan-manage/components/TrainingTask.jsx
View file @
9fd879ea
...
...
@@ -21,23 +21,31 @@ const DragHandle = sortableHandle(() => (
<
span
>
移动
</
span
>
</
span
>
));
const
SortableItem
=
sortableElement
(
props
=>
<
tr
{
...
props
}
/>);
const
SortableItem
=
sortableElement
(
props
=>
<
tr
{
...
props
}
/>);
const
SortableContainer
=
sortableContainer
(
props
=>
<
tbody
{
...
props
}
/>);
class
TrainingTask
extends
React
.
Component
{
constructor
(
props
)
{
super
(
props
);
this
.
state
=
{
dataSource
:
[]
,
dataSource
:
this
.
props
.
data
,
selectedTaskIndex
:
0
,
relatedCourseModalVisible
:
false
};
}
componentDidMount
(){
componentWillMount
(){
// if (this.props.data) {
// const newData = [...this.props.data];
// this.setState({
// dataSource:newData,
// })
// }
}
console
.
log
(
'data'
,
this
.
props
.
data
);
componentWillReceiveProps
(
nextProps
)
{
}
parseTaskColumns
=
()
=>
{
const
columns
=
[
{
...
...
@@ -64,8 +72,7 @@ class TrainingTask extends React.Component {
:
<
span
>
{
val
}
</
span
>
}
</
div
>
)
}
...
...
@@ -81,7 +88,7 @@ class TrainingTask extends React.Component {
<
DragHandle
/>
<
span
className=
"operate__item"
>
<
span
className=
"icon iconfont"
>

</
span
>
<
span
onClick=
{
(
e
)
=>
{
const
{
data
}
=
this
.
props
;
record
.
type
=
"input"
;
this
.
props
.
onChange
(
data
);
}
}
>
重命名
</
span
>
<
span
onClick=
{
(
e
)
=>
{
const
{
data
Source
}
=
this
.
state
;
record
.
type
=
"input"
;
this
.
setState
({
dataSource
})
}
}
>
重命名
</
span
>
</
span
>
<
span
className=
"operate__item"
onClick=
{
()
=>
{
this
.
handleDeleteTask
(
index
)}
}
>
<
span
className=
"icon iconfont"
>

</
span
>
...
...
@@ -134,7 +141,7 @@ class TrainingTask extends React.Component {
<
DragHandle
/>
<
span
className=
"operate__item"
>
<
span
className=
"icon iconfont"
>

</
span
>
<
span
onClick=
{
(
e
)
=>
{
const
{
data
}
=
this
.
props
;
record
.
type
=
"input"
;
this
.
props
.
onChange
(
data
);
}
}
>
重命名
</
span
>
<
span
onClick=
{
(
e
)
=>
{
const
{
data
Source
}
=
this
.
state
;
record
.
type
=
"input"
;
this
.
setState
({
dataSource
})
}
}
>
重命名
</
span
>
</
span
>
<
span
className=
"operate__item"
onClick=
{
()
=>
{
this
.
handleDeleteCourse
(
parentIndex
,
index
)}
}
>
<
span
className=
"icon iconfont"
>

</
span
>
...
...
@@ -148,88 +155,107 @@ class TrainingTask extends React.Component {
return
coursecolumns
}
// onSortEnd = ({ oldIndex, newIndex }) => {
// const { dataSource } = this.state;
// if (oldIndex !== newIndex) {
// const newData = arrayMove([].concat(dataSource), oldIndex, newIndex).filter(el => !!el);
// console.log('Sorted items: ', newData);
// this.setState({ dataSource: newData });
// }
// };
onSortEnd
=
({
oldIndex
,
newIndex
})
=>
{
const
{
dataSource
}
=
this
.
state
;
console
.
log
(
"oldIndex"
,
oldIndex
);
console
.
log
(
"newIndex"
,
newIndex
);
if
(
oldIndex
!==
newIndex
)
{
const
newData
=
arrayMove
([].
concat
(
dataSource
),
oldIndex
,
newIndex
).
filter
(
el
=>
!!
el
);
this
.
setState
({
dataSource
:
newData
});
}
};
//
DraggableContainer = props => (
//
<SortableContainer
//
useDragHandle
//
disableAutoscroll
//
helperClass="row-dragging"
//
onSortEnd={this.onSortEnd}
//
{...props}
//
/>
//
);
DraggableContainer
=
props
=>
(
<
SortableContainer
useDragHandle
disableAutoscroll
helperClass=
"row-dragging"
onSortEnd=
{
this
.
onSortEnd
}
{
...
props
}
/>
);
//
DraggableBodyRow = ({ className, style, ...restProps }) => {
//
const { dataSource } = this.state;
//
// function findIndex base on Table rowKey props and should always be a right array index
//
const index = dataSource.findIndex(x => x.index === restProps['data-row-key']);
//
return <SortableItem className={className} index={index} {...restProps} style={style}/>;
//
};
DraggableBodyRow
=
({
className
,
style
,
...
restProps
})
=>
{
const
{
dataSource
}
=
this
.
state
;
// function findIndex base on Table rowKey props and should always be a right array index
const
index
=
dataSource
.
findIndex
(
x
=>
x
.
index
===
restProps
[
'data-row-key'
]);
return
<
SortableItem
className=
{
className
}
index=
{
index
}
{
...
restProps
}
style=
{
style
}
/>;
};
addTask
=
()
=>
{
const
{
data
}
=
this
.
props
;
const
{
data
Source
}
=
this
.
state
;
const
taskObj
=
{
taskName
:
''
,
index
:
data
.
length
,
index
:
data
Source
.
length
,
type
:
'input'
,
courseList
:[
]
}
const
newData
=
[...
data
,
taskObj
];
this
.
props
.
onChange
(
newData
);
const
newData
=
[...
dataSource
,
taskObj
];
this
.
setState
({
dataSource
:
newData
},()
=>
{
this
.
props
.
onChange
(
newData
);})
}
handleRenameTaskName
=
(
e
,
record
)
=>
{
const
{
value
}
=
e
.
target
;
const
{
data
}
=
this
.
props
;
const
{
data
Source
}
=
this
.
state
;
record
.
taskName
=
value
;
this
.
props
.
onChange
(
data
);
this
.
setState
({
dataSource
,
},()
=>
{
this
.
props
.
onChange
(
dataSource
);})
}
handleTaskNameBlur
=
(
e
,
record
)
=>
{
const
{
value
}
=
e
.
target
;
const
{
data
}
=
this
.
props
;
const
{
dataSource
}
=
this
.
state
;
if
(
value
){
record
.
type
=
"text"
;
this
.
props
.
onChange
(
data
);
this
.
setState
({
dataSource
,
},()
=>
{
this
.
props
.
onChange
(
dataSource
);})
}
}
handleRenameCourseName
=
(
e
,
record
)
=>
{
const
{
value
}
=
e
.
target
;
const
{
data
}
=
this
.
props
;
const
{
data
Source
}
=
this
.
state
;
record
.
courseName
=
value
;
this
.
props
.
onChange
(
data
);
this
.
setState
({
dataSource
,
},()
=>
{
this
.
props
.
onChange
(
dataSource
);})
}
handleCourseNameBlur
=
(
e
,
record
)
=>
{
const
{
value
}
=
e
.
target
;
const
{
data
}
=
this
.
props
;
const
{
data
Source
}
=
this
.
state
;
if
(
value
){
record
.
type
=
"text"
;
this
.
setState
({
data
});
this
.
setState
({
dataSource
,
},()
=>
{
this
.
props
.
onChange
(
dataSource
);})
}
}
handleDeleteTask
=
(
index
)
=>
{
const
{
data
}
=
this
.
props
;
const
newData
=
[...
data
];
const
{
data
Source
}
=
this
.
state
;
const
newData
=
[...
data
Source
];
newData
.
splice
(
index
,
1
);
this
.
props
.
onChange
(
newData
);
this
.
setState
({
dataSource
:
newData
,
},()
=>
{
this
.
props
.
onChange
(
newData
);})
}
handleDeleteCourse
=
(
parentIndex
,
index
)
=>
{
const
{
data
}
=
this
.
props
;
const
newData
=
[...
data
];
const
{
data
Source
}
=
this
.
state
;
const
newData
=
[...
data
Source
];
const
selectData
=
[...
newData
[
parentIndex
].
courseList
]
selectData
.
splice
(
index
,
1
)
newData
[
parentIndex
].
courseList
=
selectData
;
this
.
props
.
onChange
(
newData
);
this
.
setState
({
dataSource
:
newData
,
},()
=>
{
this
.
props
.
onChange
(
newData
);})
}
showRelatedCourseModal
=
(
index
)
=>
{
...
...
@@ -245,13 +271,14 @@ class TrainingTask extends React.Component {
}
confirmSelectCourse
=
(
selectList
)
=>
{
const
{
selectedTaskIndex
}
=
this
.
state
;
const
{
data
}
=
this
.
props
const
newData
=
[...
data
];
const
{
data
Source
}
=
this
.
state
const
newData
=
[...
data
Source
];
const
selectData
=
[...
newData
[
selectedTaskIndex
].
courseList
]
const
_selectData
=
[...
selectData
,...
selectList
];
newData
[
selectedTaskIndex
].
courseList
=
_selectData
;
this
.
setState
({
relatedCourseModalVisible
:
false
,
dataSource
:
newData
,
},()
=>
{
this
.
props
.
onChange
(
newData
);
})
...
...
@@ -259,12 +286,15 @@ class TrainingTask extends React.Component {
render
()
{
const
{
dataSource
,
selectedTaskIndex
,
relatedCourseModalVisible
}
=
this
.
state
;
console
.
log
(
"dataSource"
,
dataSource
);
const
{
data
}
=
this
.
props
;
return
(
<
div
className=
"training-task"
>
<
Table
pagination=
{
false
}
dataSource=
{
data
}
dataSource=
{
data
Source
}
columns=
{
this
.
parseTaskColumns
()
}
rowKey=
"index"
expandedRowRender=
{
(
record
,
index
)
=>
{
...
...
@@ -274,7 +304,7 @@ class TrainingTask extends React.Component {
pagination=
{
false
}
dataSource=
{
record
.
courseList
}
columns=
{
this
.
parseCoursecolumns
(
index
)
}
rowKey=
"index"
//
rowKey="index"
// components=
{{
// body:
{
// wrapper: this.DraggableContainer,
...
...
@@ -287,20 +317,19 @@ class TrainingTask extends React.Component {
}
else
{
return
<
div
><
Button
onClick=
{
()
=>
{
this
.
showRelatedCourseModal
(
index
)}
}
><
span
>
+
</
span
><
span
>
关联课程
</
span
></
Button
></
div
>;
}
}
}
//
components={{
//
body: {
//
wrapper: this.DraggableContainer,
//
row: this.DraggableBodyRow,
//
},
//
}}
components=
{
{
body
:
{
wrapper
:
this
.
DraggableContainer
,
row
:
this
.
DraggableBodyRow
,
},
}
}
/>
<
div
><
Button
onClick=
{
()
=>
this
.
addTask
()
}
><
span
>
+
</
span
><
span
>
添加任务
</
span
></
Button
></
div
>
{
relatedCourseModalVisible
&&
<
RelatedCourseModal
selectedTaskIndex=
{
selectedTaskIndex
}
data=
{
data
}
data=
{
data
Source
}
visible=
{
relatedCourseModalVisible
}
onClose=
{
this
.
closeRelatedCourseModal
}
onSelect=
{
this
.
confirmSelectCourse
}
...
...
src/modules/plan-manage/modal/relatedCourseModal.jsx
View file @
9fd879ea
...
...
@@ -340,7 +340,6 @@ class SelectOperatorModal extends React.Component {
onSelect
:
(
record
,
selected
)
=>
{
this
.
selectVideoList
(
record
,
selected
);
},
onSelectAll
:
(
selected
,
_selectedRows
,
changeRows
)
=>
{
let
_list
=
[];
if
(
selected
)
{
...
...
src/modules/store-manage/StoreInfo.jsx
View file @
9fd879ea
This diff is collapsed.
Click to expand it.
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