Commit 7c14f866 by zhangleyuan

feat:处理培训计划

parent f1660f92
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
* @Author: wufan * @Author: wufan
* @Date: 2020-12-12 11:57:10 * @Date: 2020-12-12 11:57:10
* @LastEditors: zhangleyuan * @LastEditors: zhangleyuan
* @LastEditTime: 2021-02-28 13:47:38 * @LastEditTime: 2021-03-05 17:20:29
* @Description: Description * @Description: Description
* @@Copyrigh: © 2020 杭州杰竞科技有限公司 版权所有 * @@Copyrigh: © 2020 杭州杰竞科技有限公司 版权所有
*/ */
...@@ -85,3 +85,6 @@ export function videoWatchInfo(params: object) { ...@@ -85,3 +85,6 @@ export function videoWatchInfo(params: object) {
export function videoScheduleBasePage(params: object) { export function videoScheduleBasePage(params: object) {
return Service.Hades("public/hades/videoScheduleBasePage", params); 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
...@@ -2,14 +2,14 @@ ...@@ -2,14 +2,14 @@
* @Author: wufan * @Author: wufan
* @Date: 2020-11-25 18:25:02 * @Date: 2020-11-25 18:25:02
* @LastEditors: zhangleyuan * @LastEditors: zhangleyuan
* @LastEditTime: 2021-02-28 15:15:37 * @LastEditTime: 2021-03-05 17:20:56
* @Description: Description * @Description: Description
* @@Copyrigh: © 2020 杭州杰竞科技有限公司 版权所有 * @@Copyrigh: © 2020 杭州杰竞科技有限公司 版权所有
*/ */
import { import {
fetchLecturerData, fetchUserData, exportStudentCourseData, exportPlayBackCourseData, fetchPlaybackList, createLiveCloudCourse, getLiveCloudCoursePage, fetchLecturerData, fetchUserData, exportStudentCourseData, exportPlayBackCourseData, fetchPlaybackList, createLiveCloudCourse, getLiveCloudCoursePage,
getLiveCloudCourseDetail, updateLiveCloudCourse, turnOnOrOffLiveCloudCourse, delLiveCloudCourse, changeVideoShelfState, createVideoSchedule, delVideoSchedule, 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'; } from '@/data-source/course/request-api';
export default class courseService { export default class courseService {
...@@ -91,4 +91,7 @@ export default class courseService { ...@@ -91,4 +91,7 @@ export default class courseService {
static videoScheduleBasePage(params: any){ static videoScheduleBasePage(params: any){
return videoScheduleBasePage(params); return videoScheduleBasePage(params);
} }
static relatedCourseToPlan(params: any){
return relatedCourseToPlan(params);
}
} }
\ No newline at end of file
...@@ -663,7 +663,8 @@ class LiveCourseList extends React.Component { ...@@ -663,7 +663,8 @@ class LiveCourseList extends React.Component {
} }
handleRelatedModalShow = (item)=>{ handleRelatedModalShow = (item)=>{
this.setState({ this.setState({
RelatedPlanModalVisible:true RelatedPlanModalVisible:true,
selectCourseId:item.liveCourseId
}) })
} }
closeRelatedPlanModalVisible = ()=>{ closeRelatedPlanModalVisible = ()=>{
...@@ -678,7 +679,8 @@ class LiveCourseList extends React.Component { ...@@ -678,7 +679,8 @@ class LiveCourseList extends React.Component {
downloadUrl, url, columns, downloadUrl, url, columns,
openCoursewareModal, openCoursewareModal,
editData, editData,
RelatedPlanModalVisible RelatedPlanModalVisible,
selectCourseId
} = this.state; } = this.state;
const { match } = this.props; const { match } = this.props;
...@@ -733,6 +735,7 @@ class LiveCourseList extends React.Component { ...@@ -733,6 +735,7 @@ class LiveCourseList extends React.Component {
<RelatedPlanModal <RelatedPlanModal
onClose={this.closeRelatedPlanModalVisible} onClose={this.closeRelatedPlanModalVisible}
visible={RelatedPlanModalVisible} visible={RelatedPlanModalVisible}
selectCourseId={selectCourseId}
/> />
} }
<iframe src={url} style={{ display: "none" }} /> <iframe src={url} style={{ display: "none" }} />
......
import React from 'react'; import React from 'react';
import {Table, Modal,Input} from 'antd'; import {Table, Modal,Input} from 'antd';
import { PageControl } from "@/components"; 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 User from '@/common/js/user'
import './RelatedPlanModal.less'; import './RelatedPlanModal.less';
import _ from "underscore"; import _ from "underscore";
...@@ -16,6 +17,7 @@ class RelatedPlanModal extends React.Component { ...@@ -16,6 +17,7 @@ class RelatedPlanModal extends React.Component {
current: 1, current: 1,
}, },
totalCount:0, totalCount:0,
selectPlanList:{},
}; };
} }
componentDidMount() { componentDidMount() {
...@@ -34,12 +36,13 @@ class RelatedPlanModal extends React.Component { ...@@ -34,12 +36,13 @@ class RelatedPlanModal extends React.Component {
const { result = {} } = res ; const { result = {} } = res ;
const { records = [], total = 0 } = result; const { records = [], total = 0 } = result;
this.setState({ this.setState({
dataSource: result, dataSource: records,
// totalCount: Number(total) totalCount: Number(total)
}); });
}); });
} }
handleChangePlanName = (value)=>{ handleChangePlanName = (value)=>{
const {query} = this.state;
query.planName = value; query.planName = value;
query.current = 1; query.current = 1;
this.setState({ this.setState({
...@@ -88,8 +91,51 @@ class RelatedPlanModal extends React.Component { ...@@ -88,8 +91,51 @@ class RelatedPlanModal extends React.Component {
]; ];
return columns; return columns;
} }
selectPlanList = (record,selected,planId) =>{
const { selectPlanList } = this.state;
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.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.state;
const params = {
courseId:this.props.selectCourseId,
relatedPlanList:this.handleSelectPlanListData(selectPlanList),
storeId:User.getStoreId(),
}
CourseService.relatedCourseToPlan(params).then((res) => {
this.props.onClose();
});
}
render() { render() {
const { size,dataSource,totalCount,query,selectOperatorList} = this.state; const { size,dataSource,totalCount,query,selectOperatorList,selectPlanList} = this.state;
const { visible } = this.props; const { visible } = this.props;
return ( return (
<Modal <Modal
...@@ -100,11 +146,21 @@ class RelatedPlanModal extends React.Component { ...@@ -100,11 +146,21 @@ class RelatedPlanModal extends React.Component {
className="related-plan-modal" className="related-plan-modal"
closable={true} closable={true}
width={800} width={800}
onOk={() => this.props.onSelect(selectOperatorList) } onOk={() => this.confirmRelatedPlan() }
closeIcon={<span className="icon iconfont modal-close-icon">&#xe6ef;</span>} closeIcon={<span className="icon iconfont modal-close-icon">&#xe6ef;</span>}
> >
<div className="search-container"> <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">&#xe832;</span>}
/>
</div>
<div className="select-container">
<span className="icon iconfont tip">&#xe6f2;</span>
<span className="text">已选择3个任务</span>
<span className="clear">清空</span>
</div> </div>
<div> <div>
<Table <Table
...@@ -113,19 +169,41 @@ class RelatedPlanModal extends React.Component { ...@@ -113,19 +169,41 @@ class RelatedPlanModal extends React.Component {
dataSource={dataSource} dataSource={dataSource}
columns={this.parsePlanColumns()} columns={this.parsePlanColumns()}
pagination={false} pagination={false}
expandedRowRender={(record,index) => { expandedRowRender={(_record,index) => {
if(!record.taskBaseVOList){ if(!_record.taskBaseVOList){
return 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> return <div>
<Table <Table
rowKey={record => record.taskId}
pagination={false} pagination={false}
dataSource={record.taskBaseVOList} dataSource={_record.taskBaseVOList}
columns={this.parseTaskColumns(index)} columns={this.parseTaskColumns(index)}
className="child-table" className="child-table"
rowSelection={{ 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> </div>
......
.related-plan-modal{ .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
...@@ -340,7 +340,6 @@ class SelectOperatorModal extends React.Component { ...@@ -340,7 +340,6 @@ class SelectOperatorModal extends React.Component {
onSelect: (record, selected) => { onSelect: (record, selected) => {
this.selectVideoList(record, selected); this.selectVideoList(record, selected);
}, },
onSelectAll: (selected, _selectedRows, changeRows) => { onSelectAll: (selected, _selectedRows, changeRows) => {
let _list = []; let _list = [];
if (selected) { if (selected) {
......
import React from 'react'; import React from 'react';
import { withRouter } from "react-router-dom"; import { withRouter } from "react-router-dom";
import { Form, Input, Button, Checkbox ,Select } from 'antd';
class StoreInfo extends React.Component { class StoreInfo extends React.Component {
constructor(props) { constructor(props) {
super(props); super(props);
...@@ -9,6 +10,80 @@ class StoreInfo extends React.Component { ...@@ -9,6 +10,80 @@ class StoreInfo extends React.Component {
render() { render() {
return ( return (
<div className="page"> <div className="page">
<div className="content-header">店铺基本信息</div>
<div className="box">
<div>
<Form>
<Form.Item
label="店铺简称"
name="storeName"
rules={[{ required: true, message: 'Please input your username!' }]}
>
<Input style={{ width: '300px' }}/>
</Form.Item>
<Form.Item
label="店铺名称"
name="storeFullName"
rules={[{ required: true, message: 'Please input your username!' }]}
>
<Input style={{ width: '300px' }}/>
</Form.Item>
<Form.Item
label="店铺logo"
>
<img src=""></img>
</Form.Item>
<Form.Item
label="店铺类型"
name="subjectType"
rules={[{ required: true }]}
>
<Select
placeholder="Select a option and change input text above"
allowClear
style={{ width: '300px' }}
>
<Option value="COMPANY">male</Option>
<Option value="INSTITUTION">female</Option>
<Option value="ELSE">other</Option>
<Option value="TEAM ">other</Option>
</Select>
</Form.Item>
<Form.Item
label="店铺所属行业"
rules={[{ required: true }]}
name="corpIndustry"
>
<Select
placeholder="Select a option and change input text above"
style={{ width: '300px' }}
allowClear
>
<Option value="male">male</Option>
<Option value="female">female</Option>
<Option value="other">other</Option>
</Select>
</Form.Item>
<Form.Item
label="店铺所属子类行业"
rules={[{ required: true }]}
name="corpSubIndustry"
>
<Select
placeholder="Select a option and change input text above"
allowClear
style={{ width: '300px' }}
>
<Option value="male">male</Option>
<Option value="female">female</Option>
<Option value="other">other</Option>
</Select>
</Form.Item>
</Form>
</div>
<div><Button type="primary">更新信息</Button></div>
</div>
</div> </div>
) )
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment