Commit 471a280f by zhangleyuan

feat:联调创建直播页的接口

parent b777a34e
......@@ -21,6 +21,7 @@
"@typescript-eslint/parser": "^2.10.0",
"ali-oss": "^6.12.0",
"antd": "^4.8.5",
"array-move": "^3.0.1",
"axios": "^0.20.0",
"babel-eslint": "10.1.0",
"babel-jest": "^24.9.0",
......
......@@ -8,14 +8,13 @@
import React from 'react';
import { Input, Button, message ,Cascader } from 'antd';
import UploadOss from "@/core/upload";
import { ImgCutModalNew } from '@/components';
import StoreService from "@/domains/store-domain/storeService";
import './AddLiveBasic.less';
const defaultCover = 'https://image.xiaomaiketang.com/xm/YNfi45JwFA.png';
const fieldNames = { label: 'categoryName', value: 'id', children: 'sonCategoryList' };
class AddLiveBasic extends React.Component {
constructor(props) {
......@@ -27,28 +26,18 @@ class AddLiveBasic extends React.Component {
}
}
componentWillUnmount() {
this.getCourseCatalogList()
}
componentDidMount(){
this.getCourseCatalogList();
}
getCourseCatalogList = ()=>{
// StoreService.getCourseCatalogList({current:1,size:1000}).then((res) => {
// });
StoreService.getCourseCatalogList({current:1,size:1000}).then((res) => {
this.setState({
courseCatalogList:res.result.records
})
});
}
handleCatalogListData = (listData)=>{
// listData.map((item,index) => {
// item.key = item.id;
// if(item.sonCategoryList){
// item.sonCategoryList.map((_item:any,_index:any) =>{
// _item.type = "child";
// _item.key=_item.id
// return _item
// });
// }
// return item
// })
// return listData
}
// 上传封面图
handleShowImgCutModal = (event) => {
const imageFile = event.target.files[0];
......@@ -87,9 +76,9 @@ class AddLiveBasic extends React.Component {
}
}
render() {
const { showCutModal, imageFile } = this.state;
const { showCutModal, imageFile,courseCatalogList} = this.state;
const { data, liveScene } = this.props;
const { courseName, coverUrl , courseCatalogOption} = data;
const { courseName, coverUrl} = data;
const fileName = '';
// 当前是否使用的是默认图片
......@@ -144,7 +133,7 @@ class AddLiveBasic extends React.Component {
</div>
<div className="course-catalog">
<span className="label"><span className="require">*</span>课程分类:</span>
<Cascader options={courseCatalogOption} displayRender={ label => label.join('-')} onChange={this.catalogChange} style={{ width: 240 }} placeholder="请选择课程分类" />
<Cascader options={courseCatalogList} displayRender={ label => label.join('-')} fieldNames={fieldNames} onChange={this.catalogChange} style={{ width: 240 }} placeholder="请选择课程分类" />
</div>
<ImgCutModalNew
title="裁剪"
......
......@@ -9,7 +9,7 @@
import React from 'react';
import {TimePicker, Select, Spin, Tooltip } from 'antd';
import {InfoCircleFilled} from '@ant-design/icons';
import StoreService from "@/domains/store-domain/storeService";
// import TeacherSelectV5 from "@/modules/classManage_V5/classDetail/TeacherSelectV5";
......@@ -29,17 +29,44 @@ class AddLiveClass extends React.Component {
this.state = {
loading: false,
hasNext: false,
isUltimateEdition: false, // 是否是旗舰版
query: defaultQuery,
teacherQuery: defaultQuery,
teacherList:[],
assistantList: [], // 助教老师列表
_assistantList: [],
addLiveType: props.addLiveType
}
}
componentWillMount() {
componentDidMount() {
this.getTeacherList();
this.getAssistantList();
}
getTeacherList(current = 1, selectList){
const { teacherQuery,} = this.state;
const idList = selectList ? selectList : [];
const _query = {
...teacherQuery,
current,
idList,
size: idList.length <= 10 ? 10 : idList.length + 10
};
StoreService.getEmployeeList( _query).then((res) => {
// const { result = {} } = res;
// const { records = [], total = 0, hasNext } = result;
// const list = current > 1 ? assistantList.concat(records) : records;
// const _assistantList = _.uniq(
// selectedAssistant.concat(
// _.reject(list, (item) => item.id === teacherId)
// ),
// false,
// (item) => item.id
// );
// this.setState({
// hasNext,
// assistantList: list,
// _assistantList: _assistantList
// })
});
}
// 获取助教老师列表
getAssistantList = (current = 1, selectList) => {
// const { query, assistantList } = this.state;
......
/*
* @Author: wufan
* @Date: 2020-11-30 10:47:38
* @LastEditors: wufan
* @LastEditTime: 2020-12-14 14:16:15
* @LastEditors: zhangleyuan
* @LastEditTime: 2020-12-14 18:24:09
* @Description: 员工管理页面
* @@Copyrigh: © 2020 杭州杰竞科技有限公司 版权所有
*/
......
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