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__Video...

452 lines
19 KiB

"use strict";
(self["webpackChunk"] = self["webpackChunk"] || []).push([[64217],{
/***/ 31740:
/*!***************************************************************************!*\
!*** ./src/pages/Classrooms/Lists/Video/Statistics/index.tsx + 2 modules ***!
\***************************************************************************/
/***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) {
// ESM COMPAT FLAG
__webpack_require__.r(__webpack_exports__);
// EXPORTS
__webpack_require__.d(__webpack_exports__, {
"default": function() { return /* binding */ Statistics; }
});
// 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/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: ./src/utils/fetch.ts
var fetch = __webpack_require__(49105);
// EXTERNAL MODULE: ./src/utils/util.tsx
var util = __webpack_require__(27876);
// EXTERNAL MODULE: ./src/.umi-production/exports.ts
var _umi_production_exports = __webpack_require__(80608);
// EXTERNAL MODULE: ./node_modules/_antd@5.9.0@antd/es/row/index.js
var row = __webpack_require__(95237);
// EXTERNAL MODULE: ./node_modules/_antd@5.9.0@antd/es/col/index.js
var col = __webpack_require__(43604);
// EXTERNAL MODULE: ./node_modules/_antd@5.9.0@antd/es/table/index.js + 85 modules
var table = __webpack_require__(51945);
// EXTERNAL MODULE: ./node_modules/_antd@5.9.0@antd/es/pagination/index.js + 10 modules
var pagination = __webpack_require__(86859);
// EXTERNAL MODULE: ./node_modules/_@ant-design_icons@5.4.0@@ant-design/icons/es/icons/LeftOutlined.js + 1 modules
var LeftOutlined = __webpack_require__(40578);
;// CONCATENATED MODULE: ./src/pages/Classrooms/Lists/Video/Statistics/index.less?modules
// extracted by mini-css-extract-plugin
/* harmony default export */ var Statisticsmodules = ({"flex_box_center":"flex_box_center___OtxZ1","flex_space_between":"flex_space_between___Iv0vg","flex_box_vertical_center":"flex_box_vertical_center___lRjIl","flex_box_center_end":"flex_box_center_end___RZyEa","flex_box_column":"flex_box_column___tnIy3","title":"title___BVf_l","statisticsWrp":"statisticsWrp___AFSeR","statistics":"statistics___VhLdy","infoWrp":"infoWrp___v6ya3","divwidth":"divwidth___QoNXd","table_caozuo":"table_caozuo___JPF0b","change_button":"change_button___C7wgN","button_no":"button_no___HL5ih","button_active":"button_active___zXAgk","caozuo_button":"caozuo_button___R4kUc","button_img":"button_img___H7JFl","studentListTable":"studentListTable___xqGFG"});
;// CONCATENATED MODULE: ./src/assets/images/daochu.png
var daochu_namespaceObject = "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABoAAAAcCAYAAAB/E6/TAAAAAXNSR0IArs4c6QAAAtpJREFUSEu1lm9oTWEcx7+/57rbLLWE9oJQxPy7O2erSXmhRHlDEnnjxTkXS/6k1ChFWMv2Bomku3PLG3snEl5IvDB/yr3nXCEWa01ZQ8SV7e7u+WqzLbu7f3Yuztvn+/t+zvP8vr/nHEERj2m5x+JR46SfUvEjHtUattcnIs3x1tDxydYXDQJZKoJjccc4NRnYpEG1lrdyUKFKaakkdBOBwDBA5KjrVDcVghUEmba3EUQzwapcZgrqcCwaaskHywuqsRKWFkZAqvwm0gcVrIq3Lu3KpcsJMq2OWZAfHSQq8h6LSL9ANsed0O2idmTaXphkZKQP7wFcFeCJKHyh5h0SQUBSCtwSixo3i+6RYXtnQB4UyK1yKd3+0Kn6PhZvy+sXoVCprW4kdL0QZDgzuUSm5Q0l61AgWDb72eXFn/7UGZaXVKJ2QOGtJpdn8xBQBwVPnkaqO/ODwq5Not51jJWZRsbOxKYpDHxIM/0ob1BEkuUlWNB+qbo3547q9r6akfrZf911jNXZ3rgmnNintT4/3CeFTRD5OKrTohQG040g1quArI1Fqu/ljbcZ9i5WlE5puH9xWTITZlreAYLnRNAVd4z5E9bDicPU+rSIWhd3Qnezgjbs7yj9OZgK9mk1sz81sLCiLPA40+hbX3qPJluKBpm2ewRE49gVUyBSRYMM2+sGOWf0HhNhd95BZCAZc1Zc8310pu32kpgF4KsbNaZPZkayaczMHtXufjGXg+mlo2KSbb+vHaEIe/yD5E1QwRqgbBsXBsP2ekBW+jfMXSFAO5S6kQl6jhzT/TdwEWkjuX0s3kPffwIn/sY0a61IEuS0MVDdLndRKo3X/xw0YjhuYA3bi4E0/wdsHKjGSjRo6Ob/DjLDL+dRD3QCLPgP4fdlJtx1pu21k1zl16iQfiIo7O6gxpVChX7XBWpNPBp6MO6oaizvLIF6gmV+DXNE/F3J1JK6pxeWfP4Fq1RgLKZBv/kAAAAASUVORK5CYII=";
// EXTERNAL MODULE: ./src/utils/export.ts
var utils_export = __webpack_require__(80427);
// EXTERNAL MODULE: ./node_modules/_react@17.0.2@react/jsx-runtime.js
var jsx_runtime = __webpack_require__(37712);
;// CONCATENATED MODULE: ./src/pages/Classrooms/Lists/Video/Statistics/index.tsx
var ShixunsListPage = function ShixunsListPage(_ref) {
var video = _ref.video,
globalSetting = _ref.globalSetting,
loading = _ref.loading,
dispatch = _ref.dispatch;
var _useState = (0,_react_17_0_2_react.useState)(objectSpread2_default()({}, (0,_umi_production_exports.useParams)())),
_useState2 = slicedToArray_default()(_useState, 2),
params = _useState2[0],
setParams = _useState2[1];
var _useSearchParams = (0,_umi_production_exports.useSearchParams)(),
_useSearchParams2 = slicedToArray_default()(_useSearchParams, 1),
searchParams = _useSearchParams2[0];
var location = (0,_umi_production_exports.useLocation)();
var _useState3 = (0,_react_17_0_2_react.useState)({}),
_useState4 = slicedToArray_default()(_useState3, 2),
sortObj = _useState4[0],
setSortObj = _useState4[1];
var _useState5 = (0,_react_17_0_2_react.useState)(''),
_useState6 = slicedToArray_default()(_useState5, 2),
studentIdSort = _useState6[0],
setStudentIdSort = _useState6[1];
var _useState7 = (0,_react_17_0_2_react.useState)('a'),
_useState8 = slicedToArray_default()(_useState7, 2),
type = _useState8[0],
setType = _useState8[1];
var _useState9 = (0,_react_17_0_2_react.useState)(),
_useState10 = slicedToArray_default()(_useState9, 2),
StudentList = _useState10[0],
setStudentList = _useState10[1];
var _useState11 = (0,_react_17_0_2_react.useState)(),
_useState12 = slicedToArray_default()(_useState11, 2),
page = _useState12[0],
setPage = _useState12[1];
var videoStatisticsList = video.videoStatisticsList,
videoStatistics = video.videoStatistics;
params['category'] = searchParams.get("category_id");
(0,_react_17_0_2_react.useEffect)(function () {
dispatch({
type: 'video/getVideoStatisticsList',
payload: objectSpread2_default()({}, params)
});
dispatch({
type: 'video/getVideoStatistics',
payload: objectSpread2_default()(objectSpread2_default()({}, params), {}, {
all: true
})
});
}, [params.coursesId]);
var columns = [{
title: '序号',
dataIndex: 'name',
render: function render(text, record, index) {
return index + 1;
}
}, {
title: '视频名称',
dataIndex: 'title'
}, {
title: '观看人数',
dataIndex: 'people_num',
sortOrder: sortObj['people_num'],
sortDirections: ['descend', 'ascend'],
sorter: function sorter(a, b) {
return a.people_num - b.people_num;
},
render: function render(text) {
return text || '--';
}
}, {
title: '观看时长',
dataIndex: 'total_time',
sortOrder: sortObj['total_time'],
sortDirections: ['descend', 'ascend'],
sorter: function sorter(a, b) {
return a.total_time - b.total_time;
},
render: function render(text) {
return /*#__PURE__*/(0,jsx_runtime.jsx)("span", {
children: text && text !== '--' ? (0,util/* toTimeFormat */.li)(text) : "--"
});
}
}, {
title: '发布人',
dataIndex: 'user_name'
}, {
title: '操作',
dataInex: 'action',
render: function render(text, record) {
return /*#__PURE__*/(0,jsx_runtime.jsx)("div", {
children: /*#__PURE__*/(0,jsx_runtime.jsx)(_umi_production_exports.Link, {
to: "/classrooms/".concat(params.coursesId, "/video/").concat(params.categoryId, "/statistics/").concat(record.id),
className: "c-blue",
children: "\u8BE6\u60C5"
})
});
}
}];
var columns_student = [{
title: '姓名',
dataIndex: 'user_name',
align: "center",
fixed: 'left',
render: function render(text, record, index) {
return /*#__PURE__*/(0,jsx_runtime.jsx)("span", {
children: text
});
}
}, {
title: '学号',
dataIndex: 'student_id',
align: "center"
}, {
title: '学习视频数',
align: "center",
dataIndex: 'num',
render: function render(text) {
return /*#__PURE__*/(0,jsx_runtime.jsx)("span", {
className: "c-black",
children: text
});
}
}, {
title: '班级',
align: 'center',
dataIndex: 'course_group_name'
}, {
title: '累计学习时长',
align: "center",
dataIndex: 'total_duration',
render: function render(text) {
return /*#__PURE__*/(0,jsx_runtime.jsx)("span", {
className: "c-black",
children: (0,util/* toTimeFormat */.li)(parseInt(text)) || '--'
});
}
}, {
title: '平均学习完成度',
align: "center",
dataIndex: 'rate',
render: function render(text, record) {
return /*#__PURE__*/(0,jsx_runtime.jsx)("span", {
className: "c-black",
children: text ? text + "%" : '0%'
});
}
}, {
title: '开始学习时间',
align: "center",
dataIndex: 'start_at',
render: function render(text, record) {
return /*#__PURE__*/(0,jsx_runtime.jsx)("span", {
className: "c-black",
children: text || '--'
});
}
}, {
title: '最后学习时间',
align: "center",
dataIndex: 'end_at',
render: function render(text, record) {
return /*#__PURE__*/(0,jsx_runtime.jsx)("span", {
className: "c-black",
children: text || '--'
});
}
}, {
title: '操作',
align: "center",
fixed: 'right',
dataIndex: 'course_group_name',
render: function render(text, record) {
return /*#__PURE__*/(0,jsx_runtime.jsx)(_umi_production_exports.Link, {
to: "/classrooms/".concat(params === null || params === void 0 ? void 0 : params.coursesId, "/video_statistics/").concat(params === null || params === void 0 ? void 0 : params.categoryId, "/Student/").concat(record === null || record === void 0 ? void 0 : record.user_id),
children: "\u8BE6\u60C5"
});
}
}];
var getStudentList = function getStudentList(pageNum) {
setPage(pageNum);
(0,fetch/* default */.ZP)("/api/courses/".concat(params === null || params === void 0 ? void 0 : params.coursesId, "/video_study_statics.json"), {
method: 'get',
params: {
page: pageNum,
per_page: 10,
course_id: params === null || params === void 0 ? void 0 : params.coursesId,
course_group_id: -1
}
}).then(function (result) {
if (result) {
setStudentList(result);
}
});
};
return /*#__PURE__*/(0,jsx_runtime.jsxs)("section", {
className: Statisticsmodules.bg,
children: [/*#__PURE__*/(0,jsx_runtime.jsxs)("aside", {
className: Statisticsmodules.statisticsWrp,
children: [/*#__PURE__*/(0,jsx_runtime.jsxs)(row/* default */.Z, {
justify: "space-between",
className: "mt10 mb20",
children: [/*#__PURE__*/(0,jsx_runtime.jsxs)(col/* default */.Z, {
span: "16",
children: [/*#__PURE__*/(0,jsx_runtime.jsx)(LeftOutlined/* default */.Z, {
className: "current mr10 font16",
onClick: function onClick() {
return _umi_production_exports.history.back();
}
}), /*#__PURE__*/(0,jsx_runtime.jsx)("strong", {
className: "font16",
children: "\u89C6\u9891\u7EDF\u8BA1\u603B\u89C8"
})]
}), /*#__PURE__*/(0,jsx_runtime.jsxs)(col/* default */.Z, {
span: "8",
className: "c-light-black tr",
children: ["\u64AD\u653E\u6570\u636E\u4ECE ", videoStatistics.begin_at, " \u5F00\u59CB\u7EDF\u8BA1"]
})]
}), /*#__PURE__*/(0,jsx_runtime.jsxs)(row/* default */.Z, {
justify: "space-between",
className: Statisticsmodules.statistics,
children: [/*#__PURE__*/(0,jsx_runtime.jsxs)(col/* default */.Z, {
span: "7",
children: [/*#__PURE__*/(0,jsx_runtime.jsx)("span", {
children: "\u89C2\u770B\u4EBA\u6570 \uFF08\u4EBA\uFF09"
}), /*#__PURE__*/(0,jsx_runtime.jsx)("br", {}), /*#__PURE__*/(0,jsx_runtime.jsx)("strong", {
title: videoStatistics.num,
className: Statisticsmodules.divwidth,
children: videoStatistics.num
})]
}), /*#__PURE__*/(0,jsx_runtime.jsxs)(col/* default */.Z, {
span: "7",
children: [/*#__PURE__*/(0,jsx_runtime.jsx)("span", {
children: "\u89C2\u770B\u603B\u4EBA\u6B21 \uFF08\u6B21\uFF09"
}), /*#__PURE__*/(0,jsx_runtime.jsx)("br", {}), /*#__PURE__*/(0,jsx_runtime.jsx)("strong", {
title: videoStatistics.freq,
className: Statisticsmodules.divwidth,
children: videoStatistics.freq
})]
}), /*#__PURE__*/(0,jsx_runtime.jsxs)(col/* default */.Z, {
span: "7",
children: [/*#__PURE__*/(0,jsx_runtime.jsx)("span", {
children: "\u603B\u89C2\u770B\u65F6\u957F \uFF08\u65F6\uFF09"
}), /*#__PURE__*/(0,jsx_runtime.jsx)("br", {}), /*#__PURE__*/(0,jsx_runtime.jsx)("strong", {
title: videoStatistics.total_duration ? (0,util/* toTimeFormat */.li)(videoStatistics.total_duration) : "--",
className: Statisticsmodules.divwidth,
children: videoStatistics.total_duration ? (0,util/* toTimeFormat */.li)(videoStatistics.total_duration) : "--"
})]
})]
})]
}), /*#__PURE__*/(0,jsx_runtime.jsxs)("aside", {
className: Statisticsmodules.infoWrp,
children: [/*#__PURE__*/(0,jsx_runtime.jsx)("div", {
children: /*#__PURE__*/(0,jsx_runtime.jsx)("strong", {
className: "font16",
children: "\u7EDF\u8BA1\u5217\u8868"
})
}), /*#__PURE__*/(0,jsx_runtime.jsxs)("div", {
className: Statisticsmodules.table_caozuo,
children: [/*#__PURE__*/(0,jsx_runtime.jsx)("div", {
className: Statisticsmodules.change_button,
children: type === 'a' ? /*#__PURE__*/(0,jsx_runtime.jsxs)("div", {
style: {
display: 'flex'
},
children: [/*#__PURE__*/(0,jsx_runtime.jsx)("div", {
className: Statisticsmodules.button_active,
children: "\u89C6\u9891\u7EF4\u5EA6"
}), /*#__PURE__*/(0,jsx_runtime.jsx)("div", {
className: Statisticsmodules.button_no,
onClick: function onClick() {
setType('b');
getStudentList(1);
},
children: "\u5B66\u751F\u7EF4\u5EA6"
})]
}) : /*#__PURE__*/(0,jsx_runtime.jsxs)("div", {
style: {
display: 'flex'
},
children: [/*#__PURE__*/(0,jsx_runtime.jsx)("div", {
className: Statisticsmodules.button_no,
onClick: function onClick() {
setType('a');
},
children: "\u89C6\u9891\u7EF4\u5EA6"
}), /*#__PURE__*/(0,jsx_runtime.jsx)("div", {
className: Statisticsmodules.button_active,
children: "\u5B66\u751F\u7EF4\u5EA6"
})]
})
}), /*#__PURE__*/(0,jsx_runtime.jsxs)("div", {
className: Statisticsmodules.caozuo_button,
children: [/*#__PURE__*/(0,jsx_runtime.jsx)("img", {
src: daochu_namespaceObject,
className: Statisticsmodules.button_img
}), /*#__PURE__*/(0,jsx_runtime.jsx)("div", {
onClick: function onClick() {
(0,utils_export/* ExportVideoStudy */.c6)({
coursesId: params === null || params === void 0 ? void 0 : params.coursesId,
course_group_id: -1
});
},
children: "\u5BFC\u51FA\u6570\u636E"
})]
})]
}), type == 'a' && /*#__PURE__*/(0,jsx_runtime.jsx)(table/* default */.Z, {
className: "mt10",
loading: loading['video/getVideoStatisticsList'],
hideOnSinglePage: true,
pagination: false,
dataSource: videoStatisticsList.videos,
columns: columns,
onChange: function onChange(a, b, c) {
sortObj = {};
if (c.order === undefined) {
sortObj[c.field] = 'descend';
switch (c.field) {
case 'student_id':
setStudentIdSort('descend');
params['order'] = c.field + '-desc';
break;
}
} else {
params['order'] = c.field + '-' + c.order.replace("end", "");
sortObj[c.field] = c.order;
}
setSortObj(objectSpread2_default()({}, sortObj));
dispatch({
type: 'video/getVideoStatisticsList',
payload: objectSpread2_default()({}, params)
});
}
}), type == 'b' && /*#__PURE__*/(0,jsx_runtime.jsxs)("aside", {
children: [/*#__PURE__*/(0,jsx_runtime.jsx)(table/* default */.Z, {
dataSource: StudentList === null || StudentList === void 0 ? void 0 : StudentList.student,
pagination: false,
columns: columns_student,
className: Statisticsmodules.studentListTable,
scroll: {
x: 'max-content'
}
}), /*#__PURE__*/(0,jsx_runtime.jsx)("aside", {
className: "tc mb50 mt30 mb20",
children: /*#__PURE__*/(0,jsx_runtime.jsx)(pagination/* default */.Z, {
hideOnSinglePage: true,
showSizeChanger: false,
onChange: function onChange(current, pageSize) {
getStudentList(current);
},
current: page || 1,
defaultPageSize: 10,
total: StudentList === null || StudentList === void 0 ? void 0 : StudentList.count
})
})]
})]
}), /*#__PURE__*/(0,jsx_runtime.jsx)("aside", {
className: "tc mb50 mt30",
children: /*#__PURE__*/(0,jsx_runtime.jsx)(pagination/* default */.Z, {
showSizeChanger: false,
onChange: function onChange(page) {
params.page = page;
dispatch({
type: 'video/getVideoStatisticsList',
payload: objectSpread2_default()({}, params)
});
},
defaultCurrent: 1,
current: params.page || 1,
pageSize: 20,
hideOnSinglePage: true,
total: videoStatisticsList === null || videoStatisticsList === void 0 ? void 0 : videoStatisticsList.count
})
})]
});
};
/* harmony default export */ var Statistics = ((0,_umi_production_exports.connect)(function (_ref2) {
var video = _ref2.video,
loading = _ref2.loading,
globalSetting = _ref2.globalSetting;
return {
video: video,
globalSetting: globalSetting,
loading: loading.effects
};
})(ShixunsListPage));
/***/ })
}]);