Commit b777a34e by wufan

feat:开始联调上课数据

parent 522a961c
...@@ -2,10 +2,17 @@ ...@@ -2,10 +2,17 @@
* @Author: wufan * @Author: wufan
* @Date: 2020-12-12 11:57:10 * @Date: 2020-12-12 11:57:10
* @LastEditors: wufan * @LastEditors: wufan
* @LastEditTime: 2020-12-12 14:32:44 * @LastEditTime: 2020-12-14 18:05:23
* @Description: Description * @Description: Description
* @@Copyrigh: © 2020 杭州杰竞科技有限公司 版权所有 * @@Copyrigh: © 2020 杭州杰竞科技有限公司 版权所有
*/ */
import Service from "@/common/js/service"; import Service from "@/common/js/service";
export function fetchLecturerData(params: object) {
return Service.Hades("public/courseCloud/queryTeacherVisitData", params);
}
export function fetchUserData(params: object) {
return Service.Hades("public/courseCloud/queryStudentVisitData", params);
}
\ No newline at end of file
/*
* @Author: wufan
* @Date: 2020-11-25 18:25:02
* @LastEditors: wufan
* @LastEditTime: 2020-12-14 18:08:07
* @Description: Description
* @@Copyrigh: © 2020 杭州杰竞科技有限公司 版权所有
*/
import { fetchLecturerData, fetchUserData } from '@/data-source/course/request-api';
export default class StoreService {
// 获取讲师上课数据
static fetchLecturerData(params: any) {
return fetchLecturerData(params);
}
// 获取用户上课数据
static fetchUserData(params: any) {
return fetchUserData(params);
}
}
\ No newline at end of file
...@@ -15,6 +15,7 @@ import { ...@@ -15,6 +15,7 @@ import {
import dealTimeDuration from "../utils/dealTimeDuration"; import dealTimeDuration from "../utils/dealTimeDuration";
import { PageControl } from "@/components"; import { PageControl } from "@/components";
import Bus from "@/core/bus"; import Bus from "@/core/bus";
import CourseService from "@/domains/course-domain/CourseService";
import "./DataList.less"; import "./DataList.less";
class DataList extends React.Component { class DataList extends React.Component {
...@@ -36,17 +37,19 @@ class DataList extends React.Component { ...@@ -36,17 +37,19 @@ class DataList extends React.Component {
current: 1, current: 1,
size: 10, // 添加扣课时学员弹窗回填所需 当前接口返回全部列表 size: 10, // 添加扣课时学员弹窗回填所需 当前接口返回全部列表
total: 0, total: 0,
loading: false loading: false,
liveCourseId: courseId,
phone
}; };
} }
componentDidMount() { componentDidMount() {
// this.fetchCourseInfo(); // this.fetchCourseInfo();
// this.fetchTeacherData(); // this.fetchLecturerData();
// this.fetchStudentData(); // this.fetchUserData();
} }
// 获取课程信息 // 获取课程信息
fetchCourseInfo() { fetchCourseInfo() {
// axios // axios
...@@ -62,7 +65,7 @@ class DataList extends React.Component { ...@@ -62,7 +65,7 @@ class DataList extends React.Component {
// }); // });
} }
// 获取学员上课数据 // 获取学员上课数据
fetchStudentData = (current = 1) => { fetchUserData = (current = 1) => {
this.setState({ loading: true }); this.setState({ loading: true });
const { courseId, size, nameOrPhone, liveSignState } = this.state; const { courseId, size, nameOrPhone, liveSignState } = this.state;
const params = { const params = {
...@@ -75,6 +78,22 @@ class DataList extends React.Component { ...@@ -75,6 +78,22 @@ class DataList extends React.Component {
if (!params.liveSignState) { if (!params.liveSignState) {
delete params.liveSignState; delete params.liveSignState;
} }
CourseService.getEmployeeList(_query).then((res) => {
if (res.result) {
const { records = [], current, size, total } = res.result;
records.forEach((item) => {
item.edit = false;
item.courseBag = [];
});
this.setState({
studentData: records,
current,
size,
total,
loading: false,
});
}
});
// window.axios // window.axios
// .Apollo("public/businessLive/queryStudentVisitData", params) // .Apollo("public/businessLive/queryStudentVisitData", params)
// .then((res) => { // .then((res) => {
...@@ -96,7 +115,18 @@ class DataList extends React.Component { ...@@ -96,7 +115,18 @@ class DataList extends React.Component {
// }); // });
}; };
// 获取老师上课数据 // 获取老师上课数据
fetchTeacherData = () => { fetchLecturerData = () => {
CourseService.getEmployeeList(_query).then((res) => {
if (res.result) {
const teacherData = [res.result];
this.setState(
{
teacherData,
}
);
}
});
// window.axios // window.axios
// .Apollo('public/businessLive/queryTeacherVisitData', { liveCourseId: this.state.courseId }) // .Apollo('public/businessLive/queryTeacherVisitData', { liveCourseId: this.state.courseId })
// .then((res) => { // .then((res) => {
...@@ -387,7 +417,7 @@ class DataList extends React.Component { ...@@ -387,7 +417,7 @@ class DataList extends React.Component {
pageSize={size} pageSize={size}
total={total} total={total}
toPage={(page) => { toPage={(page) => {
this.fetchStudentData(page + 1); this.fetchUserData(page + 1);
}} }}
/> />
</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