You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
NewEduCoderBuild/p__Classrooms__Lists__Stati...

1003 lines
37 KiB

(self["webpackChunk"] = self["webpackChunk"] || []).push([[630],{
/***/ 73646:
/*!**************************************************************************************!*\
!*** ./src/pages/Classrooms/Lists/Statistics/CourseStatistics/index.tsx + 2 modules ***!
\**************************************************************************************/
/***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) {
"use strict";
// ESM COMPAT FLAG
__webpack_require__.r(__webpack_exports__);
// EXPORTS
__webpack_require__.d(__webpack_exports__, {
"default": function() { return /* binding */ CourseStatistics; }
});
// EXTERNAL MODULE: ./node_modules/_@babel_runtime@7.23.6@@babel/runtime/helpers/regeneratorRuntime.js
var regeneratorRuntime = __webpack_require__(7557);
var regeneratorRuntime_default = /*#__PURE__*/__webpack_require__.n(regeneratorRuntime);
// EXTERNAL MODULE: ./node_modules/_@babel_runtime@7.23.6@@babel/runtime/helpers/toConsumableArray.js
var toConsumableArray = __webpack_require__(37205);
var toConsumableArray_default = /*#__PURE__*/__webpack_require__.n(toConsumableArray);
// EXTERNAL MODULE: ./node_modules/_@babel_runtime@7.23.6@@babel/runtime/helpers/objectSpread2.js
var objectSpread2 = __webpack_require__(82242);
var objectSpread2_default = /*#__PURE__*/__webpack_require__.n(objectSpread2);
// EXTERNAL MODULE: ./node_modules/_@babel_runtime@7.23.6@@babel/runtime/helpers/asyncToGenerator.js
var asyncToGenerator = __webpack_require__(41498);
var asyncToGenerator_default = /*#__PURE__*/__webpack_require__.n(asyncToGenerator);
// EXTERNAL MODULE: ./node_modules/_@babel_runtime@7.23.6@@babel/runtime/helpers/slicedToArray.js
var slicedToArray = __webpack_require__(79800);
var slicedToArray_default = /*#__PURE__*/__webpack_require__.n(slicedToArray);
// EXTERNAL MODULE: ./node_modules/_react@17.0.2@react/index.js
var _react_17_0_2_react = __webpack_require__(59301);
// EXTERNAL MODULE: ./node_modules/_dayjs@1.11.13@dayjs/dayjs.min.js
var dayjs_min = __webpack_require__(61186);
var dayjs_min_default = /*#__PURE__*/__webpack_require__.n(dayjs_min);
// EXTERNAL MODULE: ./src/.umi-production/exports.ts
var _umi_production_exports = __webpack_require__(65363);
// EXTERNAL MODULE: ./node_modules/_antd@5.9.0@antd/es/menu/index.js + 11 modules
var menu = __webpack_require__(20834);
// EXTERNAL MODULE: ./node_modules/_antd@5.9.0@antd/es/checkbox/index.js + 3 modules
var es_checkbox = __webpack_require__(24905);
// EXTERNAL MODULE: ./node_modules/_antd@5.9.0@antd/es/button/index.js
var es_button = __webpack_require__(3113);
// EXTERNAL MODULE: ./node_modules/_antd@5.9.0@antd/es/progress/index.js + 13 modules
var progress = __webpack_require__(93948);
// EXTERNAL MODULE: ./node_modules/_antd@5.9.0@antd/es/select/index.js
var es_select = __webpack_require__(57809);
// EXTERNAL MODULE: ./node_modules/_antd@5.9.0@antd/es/table/index.js + 85 modules
var table = __webpack_require__(61998);
// EXTERNAL MODULE: ./src/components/NoData/index.tsx
var NoData = __webpack_require__(13261);
// EXTERNAL MODULE: ./node_modules/_echarts-for-react@2.0.16@echarts-for-react/lib/index.js
var lib = __webpack_require__(42441);
;// CONCATENATED MODULE: ./src/pages/Classrooms/Lists/Statistics/CourseStatistics/index.less?modules
// extracted by mini-css-extract-plugin
/* harmony default export */ var CourseStatisticsmodules = ({"flex_box_center":"flex_box_center___oN0_S","flex_space_between":"flex_space_between___VocC2","flex_box_vertical_center":"flex_box_vertical_center___B92LK","flex_box_center_end":"flex_box_center_end___g1IcT","flex_box_column":"flex_box_column___mthMO","bg":"bg___jIkIe","containerTitle":"containerTitle___YJIiZ","subTitle":"subTitle___h9V3M","subTag":"subTag___CQs2m","subText":"subText___GPMvm","pieWrap":"pieWrap___SWSQF","pieContainer":"pieContainer___AVuwI","tipWrap":"tipWrap___oKk7w","pieTip":"pieTip___lrUrC"});
;// CONCATENATED MODULE: ./src/pages/Classrooms/Lists/Statistics/CourseStatistics/data.tsx
function generateRandomNumbers(length) {
var numbers = new Set();
while (numbers.size < length) {
var num = Math.floor(Math.random() * (5200 - 2200)) + 2200;
numbers.add(num);
}
return Array.from(numbers);
}
var getDateNum = function getDateNum(dayLength) {
var currentDate = dayjs_min_default()();
var preDates = Array.from({
length: dayLength
}, function (_, i) {
return currentDate.clone().subtract(i + 1, 'days').format('YYYY-MM-DD');
}).reverse(); // 反转数组,使得日期从最新到最旧
return {
data: preDates,
value: generateRandomNumbers(dayLength)
};
};
var studentData = [{
user_name: '学生1',
student_id: '20240103',
course_group_name: '一班',
course_rate: '90%',
report_rate: '40%',
shixun_rate: '80%'
}, {
user_name: '王小二',
student_id: '20240105',
course_group_name: '一班',
course_rate: '60%',
report_rate: '90%',
shixun_rate: '70%'
}, {
user_name: '学生2',
student_id: '20240106',
course_group_name: '二班',
course_rate: '80%',
report_rate: '70%',
shixun_rate: '80%'
}];
// EXTERNAL MODULE: ./src/components/ui-customization/index.tsx + 32 modules
var ui_customization = __webpack_require__(78764);
// EXTERNAL MODULE: ./node_modules/_react-infinite-scroller@1.2.4@react-infinite-scroller/index.js
var _react_infinite_scroller_1_2_4_react_infinite_scroller = __webpack_require__(26724);
var _react_infinite_scroller_1_2_4_react_infinite_scroller_default = /*#__PURE__*/__webpack_require__.n(_react_infinite_scroller_1_2_4_react_infinite_scroller);
// EXTERNAL MODULE: ./node_modules/_react@17.0.2@react/jsx-runtime.js
var jsx_runtime = __webpack_require__(37712);
;// CONCATENATED MODULE: ./src/pages/Classrooms/Lists/Statistics/CourseStatistics/index.tsx
dayjs_min_default().locale('zh-cn');
var ShixunsListPage = function ShixunsListPage(_ref) {
var classroomList = _ref.classroomList,
globalSetting = _ref.globalSetting,
video = _ref.video,
loading = _ref.loading,
dispatch = _ref.dispatch,
teachers = _ref.teachers;
var detailCourseGroupsList = classroomList.detailCourseGroupsList;
var _useState = (0,_react_17_0_2_react.useState)({
duration: 7,
limit: 10,
page: 1,
keywords: ''
}),
_useState2 = slicedToArray_default()(_useState, 2),
params = _useState2[0],
setParams = _useState2[1];
var _useState3 = (0,_react_17_0_2_react.useState)({
data: [],
value: []
}),
_useState4 = slicedToArray_default()(_useState3, 2),
dateNum = _useState4[0],
setDateNum = _useState4[1];
var _useState5 = (0,_react_17_0_2_react.useState)([]),
_useState6 = slicedToArray_default()(_useState5, 2),
studentList = _useState6[0],
setStudentList = _useState6[1];
var _useState7 = (0,_react_17_0_2_react.useState)(true),
_useState8 = slicedToArray_default()(_useState7, 2),
hasMore = _useState8[0],
setHasmore = _useState8[1];
var _useState9 = (0,_react_17_0_2_react.useState)(false),
_useState10 = slicedToArray_default()(_useState9, 2),
isLoading = _useState10[0],
setIsLoading = _useState10[1];
var _useState11 = (0,_react_17_0_2_react.useState)(1),
_useState12 = slicedToArray_default()(_useState11, 2),
page = _useState12[0],
setPage = _useState12[1];
var _useState13 = (0,_react_17_0_2_react.useState)([]),
_useState14 = slicedToArray_default()(_useState13, 2),
selectArrs = _useState14[0],
setSelectArrs = _useState14[1];
var _useState15 = (0,_react_17_0_2_react.useState)([]),
_useState16 = slicedToArray_default()(_useState15, 2),
tableData = _useState16[0],
setTableData = _useState16[1];
var _useState17 = (0,_react_17_0_2_react.useState)('1'),
_useState18 = slicedToArray_default()(_useState17, 2),
tabIndex = _useState18[0],
setTabIndex = _useState18[1];
var _useState19 = (0,_react_17_0_2_react.useState)(false),
_useState20 = slicedToArray_default()(_useState19, 2),
submenuVisible = _useState20[0],
setSubmenuVisible = _useState20[1];
var renderFormatVal = function renderFormatVal(percent, desc) {
return /*#__PURE__*/(0,jsx_runtime.jsxs)("div", {
children: [/*#__PURE__*/(0,jsx_runtime.jsxs)("div", {
style: {
fontWeight: '700',
fontSize: '20px',
color: '#2C3A58',
marginBottom: '6px'
},
children: [percent, "%"]
}), /*#__PURE__*/(0,jsx_runtime.jsx)("div", {
style: {
fontWeight: '400',
fontSize: '12px',
color: '#434D6C'
},
children: desc
})]
});
};
var overViewOptions = [{
percent: 35,
formatVal: renderFormatVal(35, '课程进度'),
strokeColor: '#77CD9B'
}, {
percent: 50,
formatVal: renderFormatVal(50, '报告提交率'),
strokeColor: '#5FB6F2'
}, {
percent: 75,
formatVal: renderFormatVal(75, '报告批改率'),
strokeColor: '#6C96F3'
}, {
percent: 60,
formatVal: renderFormatVal(60, '报告及格率'),
strokeColor: '#F6D783'
}, {
percent: 15,
formatVal: renderFormatVal(15, '运行环境数'),
strokeColor: '#FDA672'
}];
var options1 = {
grid: {
left: '5%',
right: '5%',
top: '12%',
bottom: '16%'
},
xAxis: {
name: '日期',
type: 'category',
data: dateNum.data,
axisTick: {
show: false // 隐藏 Y 轴刻度线
},
axisLabel: {
rotate: 45 // 倾斜45度
}
},
tooltip: {
trigger: 'item',
formatter: function formatter(params) {
return "".concat(params === null || params === void 0 ? void 0 : params.name, "<br/> \u4E0A\u7EBF\u5B66\u751F\u6570\uFF1A").concat(params === null || params === void 0 ? void 0 : params.value, "\u4EBA");
}
},
yAxis: {
name: '学生数',
nameLocation: 'end',
// 'start' 或 'middle' 或 'end'
// nameGap: 42, // Y 轴名称与轴线的距离
nameTextStyle: {
padding: [0, 50, 10, 0] // 调整 Y 轴名称的左边距,单位为像素
},
// rotate: 10, // 可选,设置旋转角度
type: 'value',
splitLine: {
show: true,
lineStyle: {
type: 'dotted' // 设置为虚线
}
},
axisLine: {
show: false // 隐藏 Y 轴坐标线
},
axisTick: {
show: false // 隐藏 Y 轴刻度线
}
},
legend: {
data: ['当日上线学生数'],
orient: 'horizontal',
// 图例方向
top: '0',
right: '0'
},
series: [{
name: '当日上线学生数',
data: dateNum.value,
type: 'line',
symbolSize: 6,
// 数据点大小
lineStyle: {
color: '#498FEA',
// 设置折线颜色
shadowColor: 'rgba(66,93,142,0.5)',
// 阴影颜色
shadowBlur: 6,
// 阴影模糊度
shadowOffsetX: 0,
// 阴影偏移X
shadowOffsetY: 6 // 阴影偏移Y
},
itemStyle: {
color: '#498FEA' // 设置数据点颜色
}
}]
};
var handleChange = function handleChange(v) {
var res = getDateNum(v);
dateNum.data = res.data;
dateNum.value = res.value;
setDateNum(dateNum);
};
(0,_react_17_0_2_react.useEffect)(function () {
handleChange(7);
setStudentList(studentData);
}, []);
var columns = [{
title: '序号',
dataIndex: 'index',
key: 'index',
render: function render(a, b, i) {
return params.limit * (params.page - 1) + i + 1;
}
}, {
title: '姓名',
ellipsis: true,
dataIndex: 'user_name',
key: 'user_name'
}, {
title: '学号',
ellipsis: true,
dataIndex: 'student_id',
key: 'student_id'
}, {
title: '分班',
ellipsis: true,
dataIndex: 'course_group_name',
key: 'course_group_name'
}, {
title: '课程完成进度',
ellipsis: true,
dataIndex: 'course_rate',
key: 'course_rate'
}, {
title: '报告提交进度',
dataIndex: 'report_rate',
key: 'report_rate'
}, {
title: '实验报告合格率',
dataIndex: 'shixun_rate',
key: 'shixun_rate'
}];
var handleInfiniteOnLoad = /*#__PURE__*/function () {
var _ref2 = asyncToGenerator_default()( /*#__PURE__*/regeneratorRuntime_default()().mark(function _callee() {
var _res$course_groups, res, items;
return regeneratorRuntime_default()().wrap(function _callee$(_context) {
while (1) switch (_context.prev = _context.next) {
case 0:
if (!(hasMore && !isLoading)) {
_context.next = 10;
break;
}
setIsLoading(true);
setPage(page + 1);
_context.next = 5;
return dispatch({
type: 'classroomList/getCourseGroupsList',
payload: objectSpread2_default()(objectSpread2_default()({}, params), {}, {
page: page
})
});
case 5:
res = _context.sent;
items = toConsumableArray_default()(res.course_groups);
if (((_res$course_groups = res.course_groups) === null || _res$course_groups === void 0 ? void 0 : _res$course_groups.length) < 20) {
setHasmore(false);
items.push({
id: 0,
name: '未分班'
});
}
setIsLoading(false);
setTableData([].concat(toConsumableArray_default()(tableData), toConsumableArray_default()(items)));
case 10:
case "end":
return _context.stop();
}
}, _callee);
}));
return function handleInfiniteOnLoad() {
return _ref2.apply(this, arguments);
};
}();
var submenu = /*#__PURE__*/(0,jsx_runtime.jsxs)("section", {
className: CourseStatisticsmodules.dropmenu,
children: [/*#__PURE__*/(0,jsx_runtime.jsx)("div", {
style: {
maxHeight: 200,
overflow: 'auto'
},
children: /*#__PURE__*/(0,jsx_runtime.jsx)((_react_infinite_scroller_1_2_4_react_infinite_scroller_default()), {
initialLoad: false,
pageStart: 1,
threshold: 20,
loadMore: function loadMore(page) {
handleInfiniteOnLoad();
},
hasMore: hasMore,
useWindow: false,
children: /*#__PURE__*/(0,jsx_runtime.jsx)(menu/* default */.Z, {
style: {
width: 240,
zIndex: 10
},
children: detailCourseGroupsList.group_count > 0 && tableData.map(function (item, key) {
return /*#__PURE__*/(0,jsx_runtime.jsx)(menu/* default */.Z.Item, {
children: /*#__PURE__*/(0,jsx_runtime.jsx)(es_checkbox/* default */.Z, {
checked: selectArrs.includes(item.id),
value: item.id,
onChange: function onChange(e) {
var key = selectArrs.indexOf(item.id);
if (selectArrs.indexOf(item.id) > -1) {
setSelectArrs(selectArrs.filter(function (val) {
return val !== item.id;
}));
} else {
setSelectArrs(selectArrs.concat(item.id));
}
},
children: item.name
})
}, item.id);
})
})
})
}), /*#__PURE__*/(0,jsx_runtime.jsx)("aside", {
className: CourseStatisticsmodules.bg,
children: /*#__PURE__*/(0,jsx_runtime.jsxs)("div", {
children: [/*#__PURE__*/(0,jsx_runtime.jsx)(es_button/* default */.ZP, {
type: "link",
onClick: /*#__PURE__*/asyncToGenerator_default()( /*#__PURE__*/regeneratorRuntime_default()().mark(function _callee2() {
return regeneratorRuntime_default()().wrap(function _callee2$(_context2) {
while (1) switch (_context2.prev = _context2.next) {
case 0:
// if (selectArrs == '') {
// message.error('请选择你要操作的任务');
// return null;
// }
params.group_ids = selectArrs;
params.page = 1;
if (tabIndex == 1) {
dispatch({
type: 'classroomList/getCourseWorkscore',
payload: objectSpread2_default()({}, params)
});
} else {
dispatch({
type: 'classroomList/getCourseActscore',
payload: objectSpread2_default()({}, params)
});
}
case 3:
case "end":
return _context2.stop();
}
}, _callee2);
})),
children: "\u786E\u5B9A"
}), /*#__PURE__*/(0,jsx_runtime.jsx)(es_button/* default */.ZP, {
type: "link",
onClick: function onClick() {
setSelectArrs([]);
},
children: "\u91CD\u7F6E"
})]
})
})]
});
return /*#__PURE__*/(0,jsx_runtime.jsx)("section", {
children: /*#__PURE__*/(0,jsx_runtime.jsxs)("aside", {
className: CourseStatisticsmodules.bg,
children: [/*#__PURE__*/(0,jsx_runtime.jsx)("div", {
className: CourseStatisticsmodules.containerTitle,
children: /*#__PURE__*/(0,jsx_runtime.jsx)("div", {
className: "font16",
children: "\u8BFE\u7A0B\u5206\u6790"
})
}), /*#__PURE__*/(0,jsx_runtime.jsxs)("div", {
children: [/*#__PURE__*/(0,jsx_runtime.jsxs)("div", {
className: CourseStatisticsmodules.subTitle,
children: [/*#__PURE__*/(0,jsx_runtime.jsx)("span", {
className: CourseStatisticsmodules.subTag
}), /*#__PURE__*/(0,jsx_runtime.jsx)("span", {
className: CourseStatisticsmodules.subText,
children: "\u6570\u636E\u6982\u89C8"
})]
}), /*#__PURE__*/(0,jsx_runtime.jsx)("div", {
className: CourseStatisticsmodules.pieWrap,
children: overViewOptions.map(function (item, index) {
return /*#__PURE__*/(0,jsx_runtime.jsxs)("div", {
className: CourseStatisticsmodules.pieContainer,
style: {
marginLeft: index % 3 === 1 ? '30px' : '0px',
marginRight: index % 3 === 1 ? '30px' : '0px'
},
children: [/*#__PURE__*/(0,jsx_runtime.jsx)("div", {
children: /*#__PURE__*/(0,jsx_runtime.jsx)(progress/* default */.Z, {
type: "circle",
strokeWidth: 16,
percent: item.percent,
format: function format() {
return item.formatVal;
},
strokeColor: item.strokeColor
})
}), /*#__PURE__*/(0,jsx_runtime.jsxs)("div", {
className: CourseStatisticsmodules.tipWrap,
children: [/*#__PURE__*/(0,jsx_runtime.jsxs)("div", {
className: "mb20",
style: {
display: 'flex',
alignItems: 'center'
},
children: [/*#__PURE__*/(0,jsx_runtime.jsx)("span", {
className: CourseStatisticsmodules.pieTip,
style: {
background: item.strokeColor
}
}), /*#__PURE__*/(0,jsx_runtime.jsx)("span", {
style: {
color: '#70727E',
fontSize: '12px',
marginRight: '12px'
},
children: "\u5DF2\u5B8C\u6210"
}), /*#__PURE__*/(0,jsx_runtime.jsxs)("span", {
style: {
fontSize: '16px',
fontWeight: 700,
color: '#2C3A58'
},
children: [item.percent, "%"]
})]
}), /*#__PURE__*/(0,jsx_runtime.jsxs)("div", {
style: {
display: 'flex',
alignItems: 'center'
},
children: [/*#__PURE__*/(0,jsx_runtime.jsx)("span", {
className: CourseStatisticsmodules.pieTip
}), /*#__PURE__*/(0,jsx_runtime.jsx)("span", {
style: {
color: '#70727E',
fontSize: '12px',
marginRight: '12px'
},
children: "\u672A\u5B8C\u6210"
}), /*#__PURE__*/(0,jsx_runtime.jsxs)("span", {
style: {
fontSize: '16px',
fontWeight: 700,
color: '#2C3A58'
},
children: [100 - item.percent, "%"]
})]
})]
})]
}, index);
})
})]
}), /*#__PURE__*/(0,jsx_runtime.jsxs)("div", {
children: [/*#__PURE__*/(0,jsx_runtime.jsxs)("div", {
style: {
display: 'flex',
alignItems: 'center',
justifyContent: 'space-between'
},
children: [/*#__PURE__*/(0,jsx_runtime.jsxs)("div", {
className: CourseStatisticsmodules.subTitle,
children: [/*#__PURE__*/(0,jsx_runtime.jsx)("span", {
className: CourseStatisticsmodules.subTag
}), /*#__PURE__*/(0,jsx_runtime.jsx)("span", {
className: CourseStatisticsmodules.subText,
children: "\u65E5\u4E0A\u7EBF\u5B66\u751F\u6570"
})]
}), /*#__PURE__*/(0,jsx_runtime.jsx)("div", {
children: /*#__PURE__*/(0,jsx_runtime.jsx)(es_select["default"], {
placement: "bottomLeft",
onChange: function onChange(v) {
params.duration = v;
setParams(objectSpread2_default()({}, params));
handleChange(v);
},
value: params.duration,
style: {
width: 100
},
options: [{
label: '近7天',
value: 7
}, {
label: '近15天',
value: 15
}]
})
})]
}), /*#__PURE__*/(0,jsx_runtime.jsx)("div", {
children: /*#__PURE__*/(0,jsx_runtime.jsx)(lib/* default */.Z, {
option: options1,
style: {
height: 350,
width: 856
},
opts: {
renderer: 'svg'
} // use svg to render the chart.
})
})]
}), /*#__PURE__*/(0,jsx_runtime.jsxs)("div", {
className: "mt30",
children: [/*#__PURE__*/(0,jsx_runtime.jsxs)("div", {
style: {
display: 'flex',
alignItems: 'center',
justifyContent: 'space-between',
marginBottom: '20px'
},
children: [/*#__PURE__*/(0,jsx_runtime.jsxs)("div", {
className: CourseStatisticsmodules.subTitle,
style: {
marginTop: '0px',
marginBottom: '0px'
},
children: [/*#__PURE__*/(0,jsx_runtime.jsx)("span", {
className: CourseStatisticsmodules.subTag
}), /*#__PURE__*/(0,jsx_runtime.jsx)("span", {
className: CourseStatisticsmodules.subText,
children: "\u8BFE\u7A0B\u8FDB\u5EA6\u8BE6\u60C5"
})]
}), /*#__PURE__*/(0,jsx_runtime.jsx)("div", {
children: /*#__PURE__*/(0,jsx_runtime.jsx)(ui_customization/* CustomInput */.t7, {
style: {
width: 280,
marginLeft: 20
},
placeholder: "\u8BF7\u8F93\u5165\u59D3\u540D/\u5B66\u53F7\u8FDB\u884C\u641C\u7D22",
value: params.keywords,
onChange: function onChange(e) {
var decodeE = decodeURIComponent(e);
params.keywords = e;
setParams(objectSpread2_default()({}, params));
var temp = studentData.filter(function (item) {
return item.user_name.includes(decodeE) || item.student_id.includes(e);
});
setStudentList(temp);
}
})
})]
}), /*#__PURE__*/(0,jsx_runtime.jsxs)("div", {
children: [(studentList === null || studentList === void 0 ? void 0 : studentList.length) === 0 && /*#__PURE__*/(0,jsx_runtime.jsx)(NoData/* default */.Z, {}), (studentList === null || studentList === void 0 ? void 0 : studentList.length) > 0 && /*#__PURE__*/(0,jsx_runtime.jsx)("aside", {
children: /*#__PURE__*/(0,jsx_runtime.jsx)(table/* default */.Z, {
dataSource: studentList,
pagination: false,
columns: columns,
scroll: {
x: 'max-content'
}
})
})]
})]
})]
})
});
};
/* harmony default export */ var CourseStatistics = ((0,_umi_production_exports.connect)(function (_ref4) {
var classroomList = _ref4.classroomList,
loading = _ref4.loading,
globalSetting = _ref4.globalSetting,
teachers = _ref4.teachers,
video = _ref4.video;
return {
classroomList: classroomList,
globalSetting: globalSetting,
loading: loading,
teachers: teachers,
video: video
};
})(ShixunsListPage));
/***/ }),
/***/ 51581:
/*!****************************************************************************************************!*\
!*** ./node_modules/_react-infinite-scroller@1.2.4@react-infinite-scroller/dist/InfiniteScroll.js ***!
\****************************************************************************************************/
/***/ (function(module, exports, __webpack_require__) {
"use strict";
Object.defineProperty(exports, "__esModule", ({
value: true
}));
var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();
var _react = __webpack_require__(/*! react */ 59301);
var _react2 = _interopRequireDefault(_react);
var _propTypes = __webpack_require__(/*! prop-types */ 12708);
var _propTypes2 = _interopRequireDefault(_propTypes);
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
function _objectWithoutProperties(obj, keys) { var target = {}; for (var i in obj) { if (keys.indexOf(i) >= 0) continue; if (!Object.prototype.hasOwnProperty.call(obj, i)) continue; target[i] = obj[i]; } return target; }
function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; }
function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; }
var InfiniteScroll = function (_Component) {
_inherits(InfiniteScroll, _Component);
function InfiniteScroll(props) {
_classCallCheck(this, InfiniteScroll);
var _this = _possibleConstructorReturn(this, (InfiniteScroll.__proto__ || Object.getPrototypeOf(InfiniteScroll)).call(this, props));
_this.scrollListener = _this.scrollListener.bind(_this);
_this.eventListenerOptions = _this.eventListenerOptions.bind(_this);
_this.mousewheelListener = _this.mousewheelListener.bind(_this);
return _this;
}
_createClass(InfiniteScroll, [{
key: 'componentDidMount',
value: function componentDidMount() {
this.pageLoaded = this.props.pageStart;
this.options = this.eventListenerOptions();
this.attachScrollListener();
}
}, {
key: 'componentDidUpdate',
value: function componentDidUpdate() {
if (this.props.isReverse && this.loadMore) {
var parentElement = this.getParentElement(this.scrollComponent);
parentElement.scrollTop = parentElement.scrollHeight - this.beforeScrollHeight + this.beforeScrollTop;
this.loadMore = false;
}
this.attachScrollListener();
}
}, {
key: 'componentWillUnmount',
value: function componentWillUnmount() {
this.detachScrollListener();
this.detachMousewheelListener();
}
}, {
key: 'isPassiveSupported',
value: function isPassiveSupported() {
var passive = false;
var testOptions = {
get passive() {
passive = true;
}
};
try {
document.addEventListener('test', null, testOptions);
document.removeEventListener('test', null, testOptions);
} catch (e) {
// ignore
}
return passive;
}
}, {
key: 'eventListenerOptions',
value: function eventListenerOptions() {
var options = this.props.useCapture;
if (this.isPassiveSupported()) {
options = {
useCapture: this.props.useCapture,
passive: true
};
}
return options;
}
// Set a defaut loader for all your `InfiniteScroll` components
}, {
key: 'setDefaultLoader',
value: function setDefaultLoader(loader) {
this.defaultLoader = loader;
}
}, {
key: 'detachMousewheelListener',
value: function detachMousewheelListener() {
var scrollEl = window;
if (this.props.useWindow === false) {
scrollEl = this.scrollComponent.parentNode;
}
scrollEl.removeEventListener('mousewheel', this.mousewheelListener, this.options ? this.options : this.props.useCapture);
}
}, {
key: 'detachScrollListener',
value: function detachScrollListener() {
var scrollEl = window;
if (this.props.useWindow === false) {
scrollEl = this.getParentElement(this.scrollComponent);
}
scrollEl.removeEventListener('scroll', this.scrollListener, this.options ? this.options : this.props.useCapture);
scrollEl.removeEventListener('resize', this.scrollListener, this.options ? this.options : this.props.useCapture);
}
}, {
key: 'getParentElement',
value: function getParentElement(el) {
var scrollParent = this.props.getScrollParent && this.props.getScrollParent();
if (scrollParent != null) {
return scrollParent;
}
return el && el.parentNode;
}
}, {
key: 'filterProps',
value: function filterProps(props) {
return props;
}
}, {
key: 'attachScrollListener',
value: function attachScrollListener() {
var parentElement = this.getParentElement(this.scrollComponent);
if (!this.props.hasMore || !parentElement) {
return;
}
var scrollEl = window;
if (this.props.useWindow === false) {
scrollEl = parentElement;
}
scrollEl.addEventListener('mousewheel', this.mousewheelListener, this.options ? this.options : this.props.useCapture);
scrollEl.addEventListener('scroll', this.scrollListener, this.options ? this.options : this.props.useCapture);
scrollEl.addEventListener('resize', this.scrollListener, this.options ? this.options : this.props.useCapture);
if (this.props.initialLoad) {
this.scrollListener();
}
}
}, {
key: 'mousewheelListener',
value: function mousewheelListener(e) {
// Prevents Chrome hangups
// See: https://stackoverflow.com/questions/47524205/random-high-content-download-time-in-chrome/47684257#47684257
if (e.deltaY === 1 && !this.isPassiveSupported()) {
e.preventDefault();
}
}
}, {
key: 'scrollListener',
value: function scrollListener() {
var el = this.scrollComponent;
var scrollEl = window;
var parentNode = this.getParentElement(el);
var offset = void 0;
if (this.props.useWindow) {
var doc = document.documentElement || document.body.parentNode || document.body;
var scrollTop = scrollEl.pageYOffset !== undefined ? scrollEl.pageYOffset : doc.scrollTop;
if (this.props.isReverse) {
offset = scrollTop;
} else {
offset = this.calculateOffset(el, scrollTop);
}
} else if (this.props.isReverse) {
offset = parentNode.scrollTop;
} else {
offset = el.scrollHeight - parentNode.scrollTop - parentNode.clientHeight;
}
// Here we make sure the element is visible as well as checking the offset
if (offset < Number(this.props.threshold) && el && el.offsetParent !== null) {
this.detachScrollListener();
this.beforeScrollHeight = parentNode.scrollHeight;
this.beforeScrollTop = parentNode.scrollTop;
// Call loadMore after detachScrollListener to allow for non-async loadMore functions
if (typeof this.props.loadMore === 'function') {
this.props.loadMore(this.pageLoaded += 1);
this.loadMore = true;
}
}
}
}, {
key: 'calculateOffset',
value: function calculateOffset(el, scrollTop) {
if (!el) {
return 0;
}
return this.calculateTopPosition(el) + (el.offsetHeight - scrollTop - window.innerHeight);
}
}, {
key: 'calculateTopPosition',
value: function calculateTopPosition(el) {
if (!el) {
return 0;
}
return el.offsetTop + this.calculateTopPosition(el.offsetParent);
}
}, {
key: 'render',
value: function render() {
var _this2 = this;
var renderProps = this.filterProps(this.props);
var children = renderProps.children,
element = renderProps.element,
hasMore = renderProps.hasMore,
initialLoad = renderProps.initialLoad,
isReverse = renderProps.isReverse,
loader = renderProps.loader,
loadMore = renderProps.loadMore,
pageStart = renderProps.pageStart,
ref = renderProps.ref,
threshold = renderProps.threshold,
useCapture = renderProps.useCapture,
useWindow = renderProps.useWindow,
getScrollParent = renderProps.getScrollParent,
props = _objectWithoutProperties(renderProps, ['children', 'element', 'hasMore', 'initialLoad', 'isReverse', 'loader', 'loadMore', 'pageStart', 'ref', 'threshold', 'useCapture', 'useWindow', 'getScrollParent']);
props.ref = function (node) {
_this2.scrollComponent = node;
if (ref) {
ref(node);
}
};
var childrenArray = [children];
if (hasMore) {
if (loader) {
isReverse ? childrenArray.unshift(loader) : childrenArray.push(loader);
} else if (this.defaultLoader) {
isReverse ? childrenArray.unshift(this.defaultLoader) : childrenArray.push(this.defaultLoader);
}
}
return _react2.default.createElement(element, props, childrenArray);
}
}]);
return InfiniteScroll;
}(_react.Component);
InfiniteScroll.propTypes = {
children: _propTypes2.default.node.isRequired,
element: _propTypes2.default.node,
hasMore: _propTypes2.default.bool,
initialLoad: _propTypes2.default.bool,
isReverse: _propTypes2.default.bool,
loader: _propTypes2.default.node,
loadMore: _propTypes2.default.func.isRequired,
pageStart: _propTypes2.default.number,
ref: _propTypes2.default.func,
getScrollParent: _propTypes2.default.func,
threshold: _propTypes2.default.number,
useCapture: _propTypes2.default.bool,
useWindow: _propTypes2.default.bool
};
InfiniteScroll.defaultProps = {
element: 'div',
hasMore: false,
initialLoad: true,
pageStart: 0,
ref: null,
threshold: 250,
useWindow: true,
isReverse: false,
useCapture: false,
loader: null,
getScrollParent: null
};
exports["default"] = InfiniteScroll;
module.exports = exports['default'];
/***/ }),
/***/ 26724:
/*!**************************************************************************************!*\
!*** ./node_modules/_react-infinite-scroller@1.2.4@react-infinite-scroller/index.js ***!
\**************************************************************************************/
/***/ (function(module, __unused_webpack_exports, __webpack_require__) {
module.exports = __webpack_require__(/*! ./dist/InfiniteScroll */ 51581)
/***/ })
}]);