Commit 7c14f866 by zhangleyuan

feat:处理培训计划

parent f1660f92
......@@ -2,7 +2,7 @@
* @Author: wufan
* @Date: 2020-12-12 11:57:10
* @LastEditors: zhangleyuan
* @LastEditTime: 2021-02-28 13:47:38
* @LastEditTime: 2021-03-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
......@@ -2,14 +2,14 @@
* @Author: wufan
* @Date: 2020-11-25 18:25:02
* @LastEditors: zhangleyuan
* @LastEditTime: 2021-02-28 15:15:37
* @LastEditTime: 2021-03-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
......@@ -663,7 +663,8 @@ class LiveCourseList extends React.Component {
}
handleRelatedModalShow = (item)=>{
this.setState({
RelatedPlanModalVisible:true
RelatedPlanModalVisible:true,
selectCourseId:item.liveCourseId
})
}
closeRelatedPlanModalVisible = ()=>{
......@@ -678,7 +679,8 @@ class LiveCourseList extends React.Component {
downloadUrl, url, columns,
openCoursewareModal,
editData,
RelatedPlanModalVisible
RelatedPlanModalVisible,
selectCourseId
} = this.state;
const { match } = this.props;
......@@ -733,6 +735,7 @@ class LiveCourseList extends React.Component {
<RelatedPlanModal
onClose={this.closeRelatedPlanModalVisible}
visible={RelatedPlanModalVisible}
selectCourseId={selectCourseId}
/>
}
<iframe src={url} style={{ display: "none" }} />
......
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 './RelatedPlanModal.less';
import _ from "underscore";
......@@ -16,6 +17,7 @@ class RelatedPlanModal extends React.Component {
current: 1,
},
totalCount:0,
selectPlanList:{},
};
}
componentDidMount() {
......@@ -34,12 +36,13 @@ class RelatedPlanModal extends React.Component {
const { result = {} } = res ;
const { records = [], total = 0 } = result;
this.setState({
dataSource: result,
// totalCount: Number(total)
dataSource: records,
totalCount: Number(total)
});
});
}
handleChangePlanName = (value)=>{
const {query} = this.state;
query.planName = value;
query.current = 1;
this.setState({
......@@ -88,8 +91,51 @@ class RelatedPlanModal extends React.Component {
];
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() {
const { size,dataSource,totalCount,query,selectOperatorList} = this.state;
const { size,dataSource,totalCount,query,selectOperatorList,selectPlanList} = this.state;
const { visible } = this.props;
return (
<Modal
......@@ -100,11 +146,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">&#xe6ef;</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">&#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>
<Table
......@@ -113,19 +169,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>
......
.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 {
onSelect: (record, selected) => {
this.selectVideoList(record, selected);
},
onSelectAll: (selected, _selectedRows, changeRows) => {
let _list = [];
if (selected) {
......
import React from 'react';
import { withRouter } from "react-router-dom";
import { Form, Input, Button, Checkbox ,Select } from 'antd';
class StoreInfo extends React.Component {
constructor(props) {
super(props);
......@@ -9,7 +10,81 @@ class StoreInfo extends React.Component {
render() {
return (
<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>
)
}
......
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