Auto Submit

dev_local_v9_test4
autosubmit 2 years ago
parent 81b0a78834
commit 0fca896de8

@ -27,7 +27,7 @@
display: block !important;
}
</style><script>if(document.domain !== "www.educoder.net") document.title = '';</script>
<script src="/react/build/umi.7d6609d1.js"></script>
<script src="/react/build/umi.606afa91.js"></script>
<script src="/react/build/js/public.js"></script>
</body>
</html>

@ -40,6 +40,8 @@ var jszip_min = __webpack_require__(86129);
var jszip_min_default = /*#__PURE__*/__webpack_require__.n(jszip_min);
// EXTERNAL MODULE: ./src/utils/fetch.ts
var fetch = __webpack_require__(84087);
// EXTERNAL MODULE: ./src/utils/util.tsx
var util = __webpack_require__(25644);
// EXTERNAL MODULE: ./src/.umi-production/exports.ts
var _umi_production_exports = __webpack_require__(53156);
// EXTERNAL MODULE: ./node_modules/_antd@5.9.0@antd/es/modal/index.js + 26 modules
@ -74,8 +76,6 @@ var DeleteOutlined = __webpack_require__(7892);
var env = __webpack_require__(18765);
// EXTERNAL MODULE: ./src/utils/authority.ts
var authority = __webpack_require__(82522);
// EXTERNAL MODULE: ./src/utils/util.tsx
var util = __webpack_require__(25644);
// 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/ShixunHomeworks/Comment/index.less?modules
@ -1248,10 +1248,11 @@ var _excluded = ["shixunHomeworks", "classroomList", "globalSetting", "loading",
var Comment_ShixunsListPage = function ShixunsListPage(_ref) {
var _shixunWorkReport$shi2, _shixunWorkReport$tar2;
var _classroomList$Assist2, _shixunWorkReport$tar2;
var shixunHomeworks = _ref.shixunHomeworks,
classroomList = _ref.classroomList,
globalSetting = _ref.globalSetting,
@ -1268,76 +1269,66 @@ var Comment_ShixunsListPage = function ShixunsListPage(_ref) {
// checkbox checked储存
var _useState3 = (0,_react_17_0_2_react.useState)([]),
_useState4 = slicedToArray_default()(_useState3, 0);
var _useState5 = (0,_react_17_0_2_react.useState)({
last: false
}),
var _useState5 = (0,_react_17_0_2_react.useState)(),
_useState6 = slicedToArray_default()(_useState5, 2),
nextComment = _useState6[0],
setNextComment = _useState6[1];
var _useState7 = (0,_react_17_0_2_react.useState)({
last: false
}),
_useState8 = slicedToArray_default()(_useState7, 2),
Previous = _useState8[0],
setPrevious = _useState8[1];
chartData = _useState6[0],
setChartData = _useState6[1];
var reportElement = (0,_react_17_0_2_react.useRef)();
var reportElementInfo = (0,_react_17_0_2_react.useRef)();
var _useState7 = (0,_react_17_0_2_react.useState)(false),
_useState8 = slicedToArray_default()(_useState7, 2),
isExportLoading = _useState8[0],
setIsExportLoading = _useState8[1];
var _useState9 = (0,_react_17_0_2_react.useState)(false),
_useState10 = slicedToArray_default()(_useState9, 2),
isExportLoading = _useState10[0],
setIsExportLoading = _useState10[1];
spinning = _useState10[0],
setSpinning = _useState10[1];
var _useState11 = (0,_react_17_0_2_react.useState)(false),
_useState12 = slicedToArray_default()(_useState11, 2),
spinning = _useState12[0],
setSpinning = _useState12[1];
var _useState13 = (0,_react_17_0_2_react.useState)(false),
_useState14 = slicedToArray_default()(_useState13, 2),
autoHeight = _useState14[0],
setAutoHeight = _useState14[1];
autoHeight = _useState12[0],
setAutoHeight = _useState12[1];
var shixunWorkReport = shixunHomeworks.shixunWorkReport;
var _useState15 = (0,_react_17_0_2_react.useState)(),
_useState16 = slicedToArray_default()(_useState15, 2),
datatables = _useState16[0],
setdatatables = _useState16[1];
var _useState13 = (0,_react_17_0_2_react.useState)(),
_useState14 = slicedToArray_default()(_useState13, 2),
datatables = _useState14[0],
setdatatables = _useState14[1];
var hasPower = (0,authority/* isAdmin */.GJ)();
var _useState17 = (0,_react_17_0_2_react.useState)(new (jszip_min_default())()),
var _useState15 = (0,_react_17_0_2_react.useState)(new (jszip_min_default())()),
_useState16 = slicedToArray_default()(_useState15, 2),
zip = _useState16[0],
setZip = _useState16[1];
var _useState17 = (0,_react_17_0_2_react.useState)(0),
_useState18 = slicedToArray_default()(_useState17, 2),
zip = _useState18[0],
setZip = _useState18[1];
var _useState19 = (0,_react_17_0_2_react.useState)(0),
num = _useState18[0],
setNum = _useState18[1];
var _useState19 = (0,_react_17_0_2_react.useState)(false),
_useState20 = slicedToArray_default()(_useState19, 2),
num = _useState20[0],
setNum = _useState20[1];
var _useState21 = (0,_react_17_0_2_react.useState)([]),
isshow = _useState20[0],
setIsshow = _useState20[1];
var _useState21 = (0,_react_17_0_2_react.useState)(false),
_useState22 = slicedToArray_default()(_useState21, 2),
allStudentWorks = _useState22[0],
setAllStudentWorks = _useState22[1];
var _useState23 = (0,_react_17_0_2_react.useState)(false),
isshows = _useState22[0],
setIsshows = _useState22[1];
var _useState23 = (0,_react_17_0_2_react.useState)(""),
_useState24 = slicedToArray_default()(_useState23, 2),
isshow = _useState24[0],
setIsshow = _useState24[1];
score = _useState24[0],
setscore = _useState24[1];
// 判断是否为老师
var _useState25 = (0,_react_17_0_2_react.useState)(false),
_useState26 = slicedToArray_default()(_useState25, 2),
isshows = _useState26[0],
setIsshows = _useState26[1];
var _useState27 = (0,_react_17_0_2_react.useState)(""),
isTeacher = _useState26[0],
setisTeacher = _useState26[1];
// 如果不是老师就禁用输入框:
var _useState27 = (0,_react_17_0_2_react.useState)(true),
_useState28 = slicedToArray_default()(_useState27, 2),
score = _useState28[0],
setscore = _useState28[1];
// 判断是否为老师
var _useState29 = (0,_react_17_0_2_react.useState)(false),
isDisabled = _useState28[0],
setisDisabled = _useState28[1];
var _useState29 = (0,_react_17_0_2_react.useState)(0),
_useState30 = slicedToArray_default()(_useState29, 2),
isTeacher = _useState30[0],
setisTeacher = _useState30[1];
// 如果不是老师就禁用输入框:
var _useState31 = (0,_react_17_0_2_react.useState)(true),
_useState32 = slicedToArray_default()(_useState31, 2),
isDisabled = _useState32[0],
setisDisabled = _useState32[1];
var _useState33 = (0,_react_17_0_2_react.useState)(0),
_useState34 = slicedToArray_default()(_useState33, 2),
last_score = _useState34[0],
setlast_score = _useState34[1];
last_score = _useState30[0],
setlast_score = _useState30[1];
var otherPramsRef = (0,_react_17_0_2_react.useRef)(JSON.parse(sessionStorage['all_student_works_params'] || '{}'));
var nextId = (0,_react_17_0_2_react.useRef)();
// 获取用户信息:
var getUser = /*#__PURE__*/function () {
var _ref2 = asyncToGenerator_default()( /*#__PURE__*/regeneratorRuntime_default()().mark(function _callee() {
@ -1361,11 +1352,17 @@ var Comment_ShixunsListPage = function ShixunsListPage(_ref) {
return _ref2.apply(this, arguments);
};
}();
(0,_react_17_0_2_react.useEffect)(function () {
var _classroomList$Assist;
if ((0,authority/* isAssistant */.Rm)() && classroomList.AssistantObject.practice && !((_classroomList$Assist = classroomList.AssistantObject.practice) !== null && _classroomList$Assist !== void 0 && _classroomList$Assist.can_view)) {
_umi_production_exports.history.replace('/403');
}
}, [(_classroomList$Assist2 = classroomList.AssistantObject.practice) === null || _classroomList$Assist2 === void 0 ? void 0 : _classroomList$Assist2.can_view]);
(0,_react_17_0_2_react.useEffect)(function () {
getUser();
console.log("打印的------", shixunWorkReport);
// 在这里可以判断有没有查过重
nextId.current = shixunWorkReport === null || shixunWorkReport === void 0 ? void 0 : shixunWorkReport.next_student_work_id;
setscore(shixunWorkReport.repeat_minus_score);
}, [shixunWorkReport, user]);
(0,_react_17_0_2_react.useEffect)(function () {
@ -1401,7 +1398,7 @@ var Comment_ShixunsListPage = function ShixunsListPage(_ref) {
});
});
setdatatables(items);
if ((0,authority/* isStudent */.dE)()) dispatch({
if ((0,authority/* isAssistant */.Rm)()) dispatch({
type: 'classroomList/getAssistantPermissions',
payload: {
course_id: params.coursesId
@ -1422,10 +1419,10 @@ var Comment_ShixunsListPage = function ShixunsListPage(_ref) {
// console.log('---',shixunWorkReport?.target_test_sets?.[0]?.targets);
(0,_react_17_0_2_react.useEffect)(function () {
if (shixunHomeworks.actionTabs.key === '导出实训报告' && allStudentWorks.length > 0) {
if (shixunHomeworks.actionTabs.key === '导出实训报告' && (shixunWorkReport === null || shixunWorkReport === void 0 ? void 0 : shixunWorkReport.students_count) > 0) {
exportReport('all');
}
}, [allStudentWorks]);
}, [shixunWorkReport === null || shixunWorkReport === void 0 ? void 0 : shixunWorkReport.students_count]);
(0,_react_17_0_2_react.useEffect)(function () {
setParams(objectSpread2_default()({}, _params));
}, [location.pathname]);
@ -1436,44 +1433,33 @@ var Comment_ShixunsListPage = function ShixunsListPage(_ref) {
return _getData.apply(this, arguments);
} // 解决导出 bug: DOMException: Failed to execute 'drawImage' on 'CanvasRenderingContext2D'
function _getData() {
_getData = asyncToGenerator_default()( /*#__PURE__*/regeneratorRuntime_default()().mark(function _callee14() {
var _res$all_student_work, _res$all_student_work2;
var paylaod, res, key, _res$all_student_work3, _res$all_student_work4;
return regeneratorRuntime_default()().wrap(function _callee14$(_context16) {
while (1) switch (_context16.prev = _context16.next) {
_getData = asyncToGenerator_default()( /*#__PURE__*/regeneratorRuntime_default()().mark(function _callee15() {
return regeneratorRuntime_default()().wrap(function _callee15$(_context17) {
while (1) switch (_context17.prev = _context17.next) {
case 0:
paylaod = JSON.parse(sessionStorage['all_student_works_params'] || '{}');
_context16.next = 3;
return dispatch({
type: 'shixunHomeworks/getAllStudentWorks',
payload: objectSpread2_default()(objectSpread2_default()({}, params), paylaod)
});
case 3:
res = _context16.sent;
otherPramsRef.current = JSON.parse(sessionStorage['all_student_works_params'] || '{}');
// const res = await dispatch({
// type: 'shixunHomeworks/getAllStudentWorks',
// payload: { ...params, ...paylaod },
// })
// setSpinning(false);
setAllStudentWorks(res['all_student_works']);
key = (_res$all_student_work = res['all_student_works']) === null || _res$all_student_work === void 0 ? void 0 : _res$all_student_work.map(function (item) {
return String(item.student_work_id);
}).indexOf(params.homeworkId);
if (key === ((_res$all_student_work2 = res['all_student_works']) === null || _res$all_student_work2 === void 0 ? void 0 : _res$all_student_work2.length) - 1) {
setNextComment({
last: true
});
} else {
setNextComment((_res$all_student_work3 = res['all_student_works']) === null || _res$all_student_work3 === void 0 ? void 0 : _res$all_student_work3[key + 1]);
}
if (key === 0) {
setPrevious({
last: true
});
} else {
setPrevious((_res$all_student_work4 = res['all_student_works']) === null || _res$all_student_work4 === void 0 ? void 0 : _res$all_student_work4[key - 1]);
}
case 8:
// setAllStudentWorks(res['all_student_works'])
// const key = res['all_student_works']?.map((item: any) => String(item.student_work_id)).indexOf(params.homeworkId)
// if (key === res['all_student_works']?.length - 1) {
// setNextComment({ last: true })
// } else {
// setNextComment(res['all_student_works']?.[key + 1])
// }
// if (key === 0) {
// setPrevious({ last: true })
// } else {
// setPrevious(res['all_student_works']?.[key - 1])
// }
case 1:
case "end":
return _context16.stop();
return _context17.stop();
}
}, _callee14);
}, _callee15);
}));
return _getData.apply(this, arguments);
}
@ -1489,84 +1475,111 @@ var Comment_ShixunsListPage = function ShixunsListPage(_ref) {
setAutoHeight(true);
}
};
var getEchartData = /*#__PURE__*/function () {
var _ref3 = asyncToGenerator_default()( /*#__PURE__*/regeneratorRuntime_default()().mark(function _callee2(id) {
var res;
return regeneratorRuntime_default()().wrap(function _callee2$(_context2) {
while (1) switch (_context2.prev = _context2.next) {
case 0:
_context2.next = 2;
return (0,service_shixunHomeworks/* getShixunWorkReportEchart */.t1)({
homeworkId: id || params.homeworkId
});
case 2:
res = _context2.sent;
setChartData(res === null || res === void 0 ? void 0 : res.data);
case 4:
case "end":
return _context2.stop();
}
}, _callee2);
}));
return function getEchartData(_x) {
return _ref3.apply(this, arguments);
};
}();
var exportReport = /*#__PURE__*/function () {
var _ref3 = asyncToGenerator_default()( /*#__PURE__*/regeneratorRuntime_default()().mark(function _callee6(type) {
var _ref4 = asyncToGenerator_default()( /*#__PURE__*/regeneratorRuntime_default()().mark(function _callee7(type) {
var nums, modal, opt, next, _next, _shixunWorkReport$shi, pages, worker, folder, _loop, i, codeF;
return regeneratorRuntime_default()().wrap(function _callee6$(_context8) {
while (1) switch (_context8.prev = _context8.next) {
return regeneratorRuntime_default()().wrap(function _callee7$(_context9) {
while (1) switch (_context9.prev = _context9.next) {
case 0:
_next = function _next3() {
_next = asyncToGenerator_default()( /*#__PURE__*/regeneratorRuntime_default()().mark(function _callee5() {
_next = asyncToGenerator_default()( /*#__PURE__*/regeneratorRuntime_default()().mark(function _callee6(id) {
var res;
return regeneratorRuntime_default()().wrap(function _callee5$(_context7) {
while (1) switch (_context7.prev = _context7.next) {
return regeneratorRuntime_default()().wrap(function _callee6$(_context8) {
while (1) switch (_context8.prev = _context8.next) {
case 0:
_context7.next = 2;
_context8.next = 2;
return getEchartData(id || nextId.current);
case 2:
_context8.next = 4;
return dispatch({
type: 'shixunHomeworks/getShixunWorkReport',
payload: {
homeworkId: allStudentWorks[nums]['student_work_id']
}
payload: objectSpread2_default()({
homeworkId: id || nextId.current
}, otherPramsRef.current || {})
});
case 2:
res = _context7.sent;
case 4:
res = _context8.sent;
nextId.current = res === null || res === void 0 ? void 0 : res.next_student_work_id;
scrollView();
nums++;
setTimeout( /*#__PURE__*/asyncToGenerator_default()( /*#__PURE__*/regeneratorRuntime_default()().mark(function _callee4() {
setTimeout( /*#__PURE__*/asyncToGenerator_default()( /*#__PURE__*/regeneratorRuntime_default()().mark(function _callee5() {
var _res$shixun_detail;
var folders, pages, worker, _loop2, _i, codesF;
return regeneratorRuntime_default()().wrap(function _callee4$(_context6) {
while (1) switch (_context6.prev = _context6.next) {
return regeneratorRuntime_default()().wrap(function _callee5$(_context7) {
while (1) switch (_context7.prev = _context7.next) {
case 0:
handleRemoveSurplusCanvas();
folders = zip.folder("".concat(res === null || res === void 0 ? void 0 : res.username));
folders = zip.folder("".concat(res !== null && res !== void 0 && res.student_id && (res === null || res === void 0 ? void 0 : res.student_id) != '--' ? res.student_id : '').concat(res === null || res === void 0 ? void 0 : res.username));
pages = document.querySelector('#export-all').children;
worker = html2pdf_default()();
_loop2 = /*#__PURE__*/regeneratorRuntime_default()().mark(function _loop2(_i) {
return regeneratorRuntime_default()().wrap(function _loop2$(_context5) {
while (1) switch (_context5.prev = _context5.next) {
return regeneratorRuntime_default()().wrap(function _loop2$(_context6) {
while (1) switch (_context6.prev = _context6.next) {
case 0:
_context5.next = 2;
_context6.next = 2;
return worker.set(opt).from(pages[_i]).toContainer().toCanvas().toPdf().get('pdf').then( /*#__PURE__*/function () {
var _ref6 = asyncToGenerator_default()( /*#__PURE__*/regeneratorRuntime_default()().mark(function _callee3(pdf) {
return regeneratorRuntime_default()().wrap(function _callee3$(_context4) {
while (1) switch (_context4.prev = _context4.next) {
var _ref7 = asyncToGenerator_default()( /*#__PURE__*/regeneratorRuntime_default()().mark(function _callee4(pdf) {
return regeneratorRuntime_default()().wrap(function _callee4$(_context5) {
while (1) switch (_context5.prev = _context5.next) {
case 0:
if (!(_i < pages.length - 1)) {
_context4.next = 3;
_context5.next = 3;
break;
}
_context4.next = 3;
_context5.next = 3;
return pdf.addPage();
case 3:
case "end":
return _context4.stop();
return _context5.stop();
}
}, _callee3);
}, _callee4);
}));
return function (_x3) {
return _ref6.apply(this, arguments);
return function (_x5) {
return _ref7.apply(this, arguments);
};
}());
case 2:
case "end":
return _context5.stop();
return _context6.stop();
}
}, _loop2);
});
_i = 0;
case 6:
if (!(_i < pages.length)) {
_context6.next = 11;
_context7.next = 11;
break;
}
return _context6.delegateYield(_loop2(_i), "t0", 8);
return _context7.delegateYield(_loop2(_i), "t0", 8);
case 8:
_i++;
_context6.next = 6;
_context7.next = 6;
break;
case 11:
folders.file("".concat(allStudentWorks[nums - 1]['student_work_user_name']).concat(nums, ".pdf"), worker.output("blob"));
folders.file("".concat(res !== null && res !== void 0 && res.student_id && (res === null || res === void 0 ? void 0 : res.student_id) != '--' ? res.student_id : '').concat(res === null || res === void 0 ? void 0 : res.username, ".pdf"), worker.output("blob"));
// folder.file(`${shixunWorkReport.username}.pdf`, worker.output("blob"), { base64: false });
codesF = folders.folder("代码文件");
res === null || res === void 0 || (_res$shixun_detail = res.shixun_detail) === null || _res$shixun_detail === void 0 || _res$shixun_detail.map(function (item, index) {
@ -1576,17 +1589,15 @@ var Comment_ShixunsListPage = function ShixunsListPage(_ref) {
codesG.file("".concat(i.filename, ".txt"), i === null || i === void 0 ? void 0 : i.content);
});
});
// zip.file(`${allStudentWorks[nums - 1]['student_work_user_name']}${nums}.pdf`, pdfUrl);
modal.update({
content: /*#__PURE__*/(0,jsx_runtime.jsxs)("div", {
children: ["\u5F53\u524D\u8FDB\u5EA6: ", /*#__PURE__*/(0,jsx_runtime.jsx)("span", {
className: "c-blue",
children: nums
}), "/", allStudentWorks === null || allStudentWorks === void 0 ? void 0 : allStudentWorks.length, /*#__PURE__*/(0,jsx_runtime.jsx)("br", {}), "\u8BF7\u52FF\u5173\u95ED\u6D4F\u89C8\u5668\u7A97\u53E3"]
}), "/", res === null || res === void 0 ? void 0 : res.students_count, /*#__PURE__*/(0,jsx_runtime.jsx)("br", {}), "\u8BF7\u52FF\u5173\u95ED\u6D4F\u89C8\u5668\u7A97\u53E3"]
})
});
if (nums == (allStudentWorks === null || allStudentWorks === void 0 ? void 0 : allStudentWorks.length)) {
if (nums == (res === null || res === void 0 ? void 0 : res.students_count)) {
modal.destroy();
download();
} else {
@ -1594,21 +1605,31 @@ var Comment_ShixunsListPage = function ShixunsListPage(_ref) {
}
case 16:
case "end":
return _context6.stop();
return _context7.stop();
}
}, _callee4);
}, _callee5);
})), 2200);
case 6:
case 9:
case "end":
return _context7.stop();
return _context8.stop();
}
}, _callee5);
}, _callee6);
}));
return _next.apply(this, arguments);
};
next = function _next2() {
next = function _next2(_x3) {
return _next.apply(this, arguments);
};
// if (type === 'all') {
// ExportCourseWorkListShixuns(
// {
// categoryId: params.categoryId,
// coursesId: params.coursesId
// },
// 'shixun_report',
// );
// return
// }
nums = 0;
// if (type !== 'all')
// setIsExportLoading(true)
@ -1625,7 +1646,7 @@ var Comment_ShixunsListPage = function ShixunsListPage(_ref) {
children: ["\u5F53\u524D\u8FDB\u5EA6: ", /*#__PURE__*/(0,jsx_runtime.jsx)("span", {
className: "c-blue",
children: nums + 1
}), "/", type !== 'all' ? 1 : allStudentWorks === null || allStudentWorks === void 0 ? void 0 : allStudentWorks.length, /*#__PURE__*/(0,jsx_runtime.jsx)("br", {}), "\u8BF7\u52FF\u5173\u95ED\u6D4F\u89C8\u5668\u7A97\u53E3"]
}), "/", type !== 'all' ? 1 : shixunWorkReport === null || shixunWorkReport === void 0 ? void 0 : shixunWorkReport.students_count, /*#__PURE__*/(0,jsx_runtime.jsx)("br", {}), "\u8BF7\u52FF\u5173\u95ED\u6D4F\u89C8\u5668\u7A97\u53E3"]
}),
maskClosable: false,
className: Commentmodules.modal,
@ -1633,7 +1654,7 @@ var Comment_ShixunsListPage = function ShixunsListPage(_ref) {
});
opt = {
margin: [0, 0],
filename: "".concat(shixunWorkReport.username, ".pdf"),
filename: "".concat(shixunWorkReport !== null && shixunWorkReport !== void 0 && shixunWorkReport.student_id && (shixunWorkReport === null || shixunWorkReport === void 0 ? void 0 : shixunWorkReport.student_id) != '--' ? shixunWorkReport === null || shixunWorkReport === void 0 ? void 0 : shixunWorkReport.student_id : '').concat(shixunWorkReport.username, ".pdf"),
// image: {
// type: 'jpeg',
// quality: 0.98
@ -1651,8 +1672,8 @@ var Comment_ShixunsListPage = function ShixunsListPage(_ref) {
// unit: 'pt', format: [1200, 800], orientation: 'portrait'
}
};
if (!(type !== 'all' || (allStudentWorks === null || allStudentWorks === void 0 ? void 0 : allStudentWorks.length) < 2)) {
_context8.next = 27;
if (!(type !== 'all' || (shixunWorkReport === null || shixunWorkReport === void 0 ? void 0 : shixunWorkReport.students_count) < 2)) {
_context9.next = 27;
break;
}
handleRemoveSurplusCanvas();
@ -1666,55 +1687,55 @@ var Comment_ShixunsListPage = function ShixunsListPage(_ref) {
// });
pages = reportElementInfo.current.children;
worker = html2pdf_default()();
folder = zip.folder("".concat(shixunWorkReport === null || shixunWorkReport === void 0 ? void 0 : shixunWorkReport.username));
folder = zip.folder("".concat(shixunWorkReport !== null && shixunWorkReport !== void 0 && shixunWorkReport.student_id && (shixunWorkReport === null || shixunWorkReport === void 0 ? void 0 : shixunWorkReport.student_id) != '--' ? shixunWorkReport === null || shixunWorkReport === void 0 ? void 0 : shixunWorkReport.student_id : '').concat(shixunWorkReport === null || shixunWorkReport === void 0 ? void 0 : shixunWorkReport.username));
_loop = /*#__PURE__*/regeneratorRuntime_default()().mark(function _loop(i) {
return regeneratorRuntime_default()().wrap(function _loop$(_context3) {
while (1) switch (_context3.prev = _context3.next) {
return regeneratorRuntime_default()().wrap(function _loop$(_context4) {
while (1) switch (_context4.prev = _context4.next) {
case 0:
_context3.next = 2;
_context4.next = 2;
return worker.set(opt).from(pages[i]).toContainer().toCanvas().toPdf().get('pdf').then( /*#__PURE__*/function () {
var _ref4 = asyncToGenerator_default()( /*#__PURE__*/regeneratorRuntime_default()().mark(function _callee2(pdf) {
return regeneratorRuntime_default()().wrap(function _callee2$(_context2) {
while (1) switch (_context2.prev = _context2.next) {
var _ref5 = asyncToGenerator_default()( /*#__PURE__*/regeneratorRuntime_default()().mark(function _callee3(pdf) {
return regeneratorRuntime_default()().wrap(function _callee3$(_context3) {
while (1) switch (_context3.prev = _context3.next) {
case 0:
if (!(i < pages.length - 1)) {
_context2.next = 3;
_context3.next = 3;
break;
}
_context2.next = 3;
_context3.next = 3;
return pdf.addPage();
case 3:
case "end":
return _context2.stop();
return _context3.stop();
}
}, _callee2);
}, _callee3);
}));
return function (_x2) {
return _ref4.apply(this, arguments);
return function (_x4) {
return _ref5.apply(this, arguments);
};
}());
case 2:
case "end":
return _context3.stop();
return _context4.stop();
}
}, _loop);
});
i = 0;
case 13:
if (!(i < pages.length)) {
_context8.next = 18;
_context9.next = 18;
break;
}
return _context8.delegateYield(_loop(i), "t0", 15);
return _context9.delegateYield(_loop(i), "t0", 15);
case 15:
i++;
_context8.next = 13;
_context9.next = 13;
break;
case 18:
setIsExportLoading(false);
// zip.file(`${shixunWorkReport.username}.pdf`, pdfUrl);
folder.file("".concat(shixunWorkReport.username, ".pdf"), worker.output("blob"), {
folder.file("".concat(shixunWorkReport !== null && shixunWorkReport !== void 0 && shixunWorkReport.student_id && (shixunWorkReport === null || shixunWorkReport === void 0 ? void 0 : shixunWorkReport.student_id) != '--' ? shixunWorkReport === null || shixunWorkReport === void 0 ? void 0 : shixunWorkReport.student_id : '').concat(shixunWorkReport.username, ".pdf"), worker.output("blob"), {
base64: false
});
codeF = folder.folder("代码文件");
@ -1728,17 +1749,17 @@ var Comment_ShixunsListPage = function ShixunsListPage(_ref) {
// worker.save()
modal.destroy();
download();
return _context8.abrupt("return");
return _context9.abrupt("return");
case 27:
next();
next(shixunWorkReport === null || shixunWorkReport === void 0 ? void 0 : shixunWorkReport.first_student_work_id);
case 28:
case "end":
return _context8.stop();
return _context9.stop();
}
}, _callee6);
}, _callee7);
}));
return function exportReport(_x) {
return _ref3.apply(this, arguments);
return function exportReport(_x2) {
return _ref4.apply(this, arguments);
};
}();
var download = function download() {
@ -1762,27 +1783,28 @@ var Comment_ShixunsListPage = function ShixunsListPage(_ref) {
initData();
}, [params.homeworkId]);
var initData = /*#__PURE__*/function () {
var _ref7 = asyncToGenerator_default()( /*#__PURE__*/regeneratorRuntime_default()().mark(function _callee7() {
return regeneratorRuntime_default()().wrap(function _callee7$(_context9) {
while (1) switch (_context9.prev = _context9.next) {
var _ref8 = asyncToGenerator_default()( /*#__PURE__*/regeneratorRuntime_default()().mark(function _callee8() {
return regeneratorRuntime_default()().wrap(function _callee8$(_context10) {
while (1) switch (_context10.prev = _context10.next) {
case 0:
setSpinning(true);
_context9.next = 3;
_context10.next = 2;
return dispatch({
type: 'shixunHomeworks/getShixunWorkReport',
payload: objectSpread2_default()({}, params)
payload: objectSpread2_default()(objectSpread2_default()({}, params), otherPramsRef.current || {})
});
case 3:
setSpinning(false);
case 2:
getEchartData();
// setSpinning(false)
if ((0,authority/* isAdmin */.GJ)()) getData();
case 5:
case 4:
case "end":
return _context9.stop();
return _context10.stop();
}
}, _callee7);
}, _callee8);
}));
return function initData() {
return _ref7.apply(this, arguments);
return _ref8.apply(this, arguments);
};
}();
var columns = [{
@ -1861,20 +1883,20 @@ var Comment_ShixunsListPage = function ShixunsListPage(_ref) {
max: record.game_score_full,
defaultValue: parseFloat(text),
onBlur: ( /*#__PURE__*/function () {
var _ref8 = asyncToGenerator_default()( /*#__PURE__*/regeneratorRuntime_default()().mark(function _callee8(value) {
var _classroomList$Assist;
var _ref9 = asyncToGenerator_default()( /*#__PURE__*/regeneratorRuntime_default()().mark(function _callee9(value) {
var _classroomList$Assist3;
var res;
return regeneratorRuntime_default()().wrap(function _callee8$(_context10) {
while (1) switch (_context10.prev = _context10.next) {
return regeneratorRuntime_default()().wrap(function _callee9$(_context11) {
while (1) switch (_context11.prev = _context11.next) {
case 0:
if (!((0,authority/* isAssistant */.Rm)() && !((_classroomList$Assist = classroomList.AssistantObject.practice) !== null && _classroomList$Assist !== void 0 && _classroomList$Assist.can_appraise))) {
_context10.next = 3;
if (!((0,authority/* isAssistant */.Rm)() && !((_classroomList$Assist3 = classroomList.AssistantObject.practice) !== null && _classroomList$Assist3 !== void 0 && _classroomList$Assist3.can_appraise))) {
_context11.next = 3;
break;
}
message/* default */.ZP.warning('您未获取此权限,需向管理员申请权限才能使用此功能');
return _context10.abrupt("return");
return _context11.abrupt("return");
case 3:
_context10.next = 5;
_context11.next = 5;
return dispatch({
type: "shixunHomeworks/changeScore",
payload: {
@ -1885,11 +1907,11 @@ var Comment_ShixunsListPage = function ShixunsListPage(_ref) {
}
});
case 5:
res = _context10.sent;
_context10.next = 8;
res = _context11.sent;
_context11.next = 8;
return dispatch({
type: 'shixunHomeworks/getShixunWorkReport',
payload: objectSpread2_default()({}, params)
payload: objectSpread2_default()(objectSpread2_default()({}, params), otherPramsRef.current || {})
});
case 8:
if (res.status === 0) {
@ -1897,12 +1919,12 @@ var Comment_ShixunsListPage = function ShixunsListPage(_ref) {
}
case 9:
case "end":
return _context10.stop();
return _context11.stop();
}
}, _callee8);
}, _callee9);
}));
return function (_x4) {
return _ref8.apply(this, arguments);
return function (_x6) {
return _ref9.apply(this, arguments);
};
}())
});
@ -1991,9 +2013,9 @@ var Comment_ShixunsListPage = function ShixunsListPage(_ref) {
});
setTimeout(function () {
if (type === 'next') {
_umi_production_exports.history.push("/classrooms/".concat(params.coursesId, "/shixun_homework/").concat(params.categoryId, "/").concat(nextComment === null || nextComment === void 0 ? void 0 : nextComment.student_work_id, "/comment"));
_umi_production_exports.history.push("/classrooms/".concat(params.coursesId, "/shixun_homework/").concat(params.categoryId, "/").concat(shixunWorkReport === null || shixunWorkReport === void 0 ? void 0 : shixunWorkReport.next_student_work_id, "/comment"));
} else {
_umi_production_exports.history.push("/classrooms/".concat(params.coursesId, "/shixun_homework/").concat(params.categoryId, "/").concat(Previous === null || Previous === void 0 ? void 0 : Previous.student_work_id, "/comment"));
_umi_production_exports.history.push("/classrooms/".concat(params.coursesId, "/shixun_homework/").concat(params.categoryId, "/").concat(shixunWorkReport === null || shixunWorkReport === void 0 ? void 0 : shixunWorkReport.pre_student_work_id, "/comment"));
}
}, 200);
};
@ -2012,12 +2034,12 @@ var Comment_ShixunsListPage = function ShixunsListPage(_ref) {
};
// 输入框失焦后 触发更新分数的接口
var gochange = /*#__PURE__*/function () {
var _ref9 = asyncToGenerator_default()( /*#__PURE__*/regeneratorRuntime_default()().mark(function _callee9() {
var _ref10 = asyncToGenerator_default()( /*#__PURE__*/regeneratorRuntime_default()().mark(function _callee10() {
var res;
return regeneratorRuntime_default()().wrap(function _callee9$(_context11) {
while (1) switch (_context11.prev = _context11.next) {
return regeneratorRuntime_default()().wrap(function _callee10$(_context12) {
while (1) switch (_context12.prev = _context12.next) {
case 0:
_context11.next = 2;
_context12.next = 2;
return (0,fetch/* default */.ZP)("/api/student_works/".concat(shixunWorkReport === null || shixunWorkReport === void 0 ? void 0 : shixunWorkReport.work_id, "/update_repeat_score"), {
method: 'put',
body: {
@ -2025,11 +2047,11 @@ var Comment_ShixunsListPage = function ShixunsListPage(_ref) {
}
});
case 2:
res = _context11.sent;
_context11.next = 5;
res = _context12.sent;
_context12.next = 5;
return dispatch({
type: 'shixunHomeworks/getShixunWorkReport',
payload: objectSpread2_default()({}, params)
payload: objectSpread2_default()(objectSpread2_default()({}, params), otherPramsRef.current || {})
});
case 5:
// console.log("返回数据", res)
@ -2038,12 +2060,12 @@ var Comment_ShixunsListPage = function ShixunsListPage(_ref) {
}
case 6:
case "end":
return _context11.stop();
return _context12.stop();
}
}, _callee9);
}, _callee10);
}));
return function gochange() {
return _ref9.apply(this, arguments);
return _ref10.apply(this, arguments);
};
}();
return /*#__PURE__*/(0,jsx_runtime.jsxs)("section", {
@ -2058,7 +2080,7 @@ var Comment_ShixunsListPage = function ShixunsListPage(_ref) {
paddingBottom: 100
},
children: /*#__PURE__*/(0,jsx_runtime.jsxs)(skeleton/* default */.Z, {
loading: spinning,
loading: loading["shixunHomeworks/getShixunWorkReport"],
active: true,
avatar: {
size: 40
@ -2114,21 +2136,20 @@ var Comment_ShixunsListPage = function ShixunsListPage(_ref) {
}), /*#__PURE__*/(0,jsx_runtime.jsxs)(col/* default */.Z, {
className: Commentmodules.title1_right,
children: [shixunWorkReport.view_tpi && /*#__PURE__*/(0,jsx_runtime.jsxs)(es_button/* default */.ZP, {
onClick: function onClick() {
var _shixunWorkReport$shi2;
(0,util/* openNewWindow */.xg)("/tasks/".concat(shixunWorkReport === null || shixunWorkReport === void 0 || (_shixunWorkReport$shi2 = shixunWorkReport.shixun_detail) === null || _shixunWorkReport$shi2 === void 0 || (_shixunWorkReport$shi2 = _shixunWorkReport$shi2[0]) === null || _shixunWorkReport$shi2 === void 0 ? void 0 : _shixunWorkReport$shi2["game_identifier"]));
},
children: [/*#__PURE__*/(0,jsx_runtime.jsx)("span", {
className: "iconfont icon-yijiandianping mr5"
}), /*#__PURE__*/(0,jsx_runtime.jsx)(_umi_production_exports.Link, {
className: "c-black",
target: "_blank",
to: "/tasks/".concat(shixunWorkReport === null || shixunWorkReport === void 0 || (_shixunWorkReport$shi2 = shixunWorkReport.shixun_detail) === null || _shixunWorkReport$shi2 === void 0 || (_shixunWorkReport$shi2 = _shixunWorkReport$shi2[0]) === null || _shixunWorkReport$shi2 === void 0 ? void 0 : _shixunWorkReport$shi2["game_identifier"]),
children: "\u67E5\u770B\u5B66\u5458\u5B9E\u8BAD"
})]
}), "\u67E5\u770B\u5B66\u5458\u5B9E\u8BAD"]
}), (0,authority/* isAdmin */.GJ)() && shixunWorkReport.homework_end === false && !!shixunWorkReport.myshixun_id && /*#__PURE__*/(0,jsx_runtime.jsxs)(es_button/* default */.ZP, {
className: "ml10",
onClick: /*#__PURE__*/asyncToGenerator_default()( /*#__PURE__*/regeneratorRuntime_default()().mark(function _callee10() {
return regeneratorRuntime_default()().wrap(function _callee10$(_context12) {
while (1) switch (_context12.prev = _context12.next) {
onClick: /*#__PURE__*/asyncToGenerator_default()( /*#__PURE__*/regeneratorRuntime_default()().mark(function _callee11() {
return regeneratorRuntime_default()().wrap(function _callee11$(_context13) {
while (1) switch (_context13.prev = _context13.next) {
case 0:
_context12.next = 2;
_context13.next = 2;
return dispatch({
type: 'shixunHomeworks/setActionTabs',
payload: {
@ -2141,9 +2162,9 @@ var Comment_ShixunsListPage = function ShixunsListPage(_ref) {
});
case 2:
case "end":
return _context12.stop();
return _context13.stop();
}
}, _callee10);
}, _callee11);
})),
children: [/*#__PURE__*/(0,jsx_runtime.jsx)("span", {
className: "iconfont icon-dahuizhongzuo3x mr5"
@ -2157,10 +2178,43 @@ var Comment_ShixunsListPage = function ShixunsListPage(_ref) {
children: [/*#__PURE__*/(0,jsx_runtime.jsx)("span", {
className: "iconfont icon-daochu mr5"
}), "\u5BFC\u51FA\u5B9E\u8BAD\u62A5\u544A"]
}), (0,authority/* isAdmin */.GJ)() && (allStudentWorks === null || allStudentWorks === void 0 ? void 0 : allStudentWorks.length) > 1 && /*#__PURE__*/(0,jsx_runtime.jsxs)(es_button/* default */.ZP, {
}), (0,authority/* isAdmin */.GJ)() && (shixunWorkReport === null || shixunWorkReport === void 0 ? void 0 : shixunWorkReport.students_count) > 1 && /*#__PURE__*/(0,jsx_runtime.jsxs)(es_button/* default */.ZP, {
className: "ml10",
onClick: function onClick() {
return exportReport('all');
es_modal/* default */.Z.confirm({
title: '选择导出方式',
closable: true,
icon: null,
centered: true,
okText: /*#__PURE__*/(0,jsx_runtime.jsx)(Tooltip, {
title: "\u5BFC\u51FA\u65F6\u4E0D\u80FD\u9000\u51FA\u6216\u5173\u95ED\u5BFC\u51FA\u9875\u9762\uFF0C\u53EF\u80FD\u4F1A\u5F71\u54CD\u5176\u4ED6\u64CD\u4F5C",
children: "\u524D\u7AEF\u5BFC\u51FA"
}),
cancelText: /*#__PURE__*/(0,jsx_runtime.jsx)(Tooltip, {
title: "\u751F\u6210\u5BFC\u51FA\u4EFB\u52A1\u540E\u53EF\u5173\u95ED\u9875\u9762\uFF0C\u540E\u53F0\u5BFC\u51FA\u6210\u529F\u540E\u5728\u5386\u53F2\u5BFC\u51FA\u9875\u9762\u81EA\u884C\u4E0B\u8F7D\uFF0C\u4E0D\u5F71\u54CD\u5176\u4ED6\u64CD\u4F5C",
children: "\u540E\u53F0\u5BFC\u51FA"
}),
onOk: function onOk() {
exportReport('all');
},
onCancel: function onCancel() {
// ExportCourseWorkListShixuns(
// {
// categoryId: params.categoryId,
// coursesId: params.coursesId
// },
// 'shixun_report',
// );
},
cancelButtonProps: {
onClick: function onClick() {
ExportCourseWorkListShixuns({
categoryId: params.categoryId,
coursesId: params.coursesId
}, 'shixun_report');
}
}
});
},
children: [/*#__PURE__*/(0,jsx_runtime.jsx)("span", {
className: "iconfont icon-daochu mr5"
@ -2465,9 +2519,9 @@ var Comment_ShixunsListPage = function ShixunsListPage(_ref) {
}), /*#__PURE__*/(0,jsx_runtime.jsx)(col/* default */.Z, {
className: "pr30",
children: (0,authority/* isAdmin */.GJ)() && /*#__PURE__*/(0,jsx_runtime.jsxs)(es_button/* default */.ZP, {
onClick: /*#__PURE__*/asyncToGenerator_default()( /*#__PURE__*/regeneratorRuntime_default()().mark(function _callee12() {
return regeneratorRuntime_default()().wrap(function _callee12$(_context14) {
while (1) switch (_context14.prev = _context14.next) {
onClick: /*#__PURE__*/asyncToGenerator_default()( /*#__PURE__*/regeneratorRuntime_default()().mark(function _callee13() {
return regeneratorRuntime_default()().wrap(function _callee13$(_context15) {
while (1) switch (_context15.prev = _context15.next) {
case 0:
es_modal/* default */.Z.confirm({
centered: true,
@ -2477,38 +2531,38 @@ var Comment_ShixunsListPage = function ShixunsListPage(_ref) {
icon: /*#__PURE__*/(0,jsx_runtime.jsx)(ExclamationCircleOutlined/* default */.Z, {}),
content: '是否确认删除?',
onOk: function onOk() {
return asyncToGenerator_default()( /*#__PURE__*/regeneratorRuntime_default()().mark(function _callee11() {
return asyncToGenerator_default()( /*#__PURE__*/regeneratorRuntime_default()().mark(function _callee12() {
var res;
return regeneratorRuntime_default()().wrap(function _callee11$(_context13) {
while (1) switch (_context13.prev = _context13.next) {
return regeneratorRuntime_default()().wrap(function _callee12$(_context14) {
while (1) switch (_context14.prev = _context14.next) {
case 0:
_context13.next = 2;
_context14.next = 2;
return (0,service_shixunHomeworks/* deleteStudentWorkScoreCommit */.gZ)({
comment_id: shixunWorkReport.comment_id,
homeworkId: params.homeworkId
});
case 2:
res = _context13.sent;
res = _context14.sent;
if (res.status === 0) {
message/* default */.ZP.success("删除成功");
dispatch({
type: 'shixunHomeworks/getShixunWorkReport',
payload: objectSpread2_default()({}, params)
payload: objectSpread2_default()(objectSpread2_default()({}, params), otherPramsRef.current || {})
});
}
case 4:
case "end":
return _context13.stop();
return _context14.stop();
}
}, _callee11);
}, _callee12);
}))();
}
});
case 1:
case "end":
return _context14.stop();
return _context15.stop();
}
}, _callee12);
}, _callee13);
})),
children: [/*#__PURE__*/(0,jsx_runtime.jsx)(DeleteOutlined/* default */.Z, {}), "\u5220\u9664"]
})
@ -2534,6 +2588,8 @@ var Comment_ShixunsListPage = function ShixunsListPage(_ref) {
value: shixunWorkReport.work_comment_hidden
})]
})]
}), (shixunWorkReport === null || shixunWorkReport === void 0 ? void 0 : shixunWorkReport.action_analysis) && /*#__PURE__*/(0,jsx_runtime.jsx)(ShixunPhoto, {
detailData: shixunWorkReport
}), /*#__PURE__*/(0,jsx_runtime.jsx)("h1", {
className: Commentmodules.title,
children: "\u9636\u6BB5\u6210\u7EE9"
@ -2576,7 +2632,9 @@ var Comment_ShixunsListPage = function ShixunsListPage(_ref) {
}), /*#__PURE__*/(0,jsx_runtime.jsx)("h1", {
className: Commentmodules.title,
children: "\u56FE\u5F62\u7EDF\u8BA1"
}), /*#__PURE__*/(0,jsx_runtime.jsx)(EchartStatic, {}), /*#__PURE__*/(0,jsx_runtime.jsx)("h1", {
}), /*#__PURE__*/(0,jsx_runtime.jsx)(EchartStatic, {
data: chartData
}), /*#__PURE__*/(0,jsx_runtime.jsx)("h1", {
className: Commentmodules.title,
children: "\u5B9E\u8BAD\u8BE6\u60C5"
})]
@ -2602,7 +2660,7 @@ var Comment_ShixunsListPage = function ShixunsListPage(_ref) {
className: "tr",
children: [/*#__PURE__*/(0,jsx_runtime.jsx)(es_button/* default */.ZP, {
type: "default",
disabled: Previous === null || Previous === void 0 ? void 0 : Previous.last,
disabled: !(shixunWorkReport !== null && shixunWorkReport !== void 0 && shixunWorkReport.pre_student_work_id),
onClick: function onClick() {
return skip();
},
@ -2613,16 +2671,16 @@ var Comment_ShixunsListPage = function ShixunsListPage(_ref) {
marginLeft: '20px',
marginRight: '20px'
},
disabled: nextComment === null || nextComment === void 0 ? void 0 : nextComment.last,
disabled: !(shixunWorkReport !== null && shixunWorkReport !== void 0 && shixunWorkReport.next_student_work_id),
onClick: function onClick() {
return skip('next');
},
children: "\u4E0B\u4E00\u4E2A"
}), (0,authority/* isAdmin */.GJ)() && /*#__PURE__*/(0,jsx_runtime.jsx)(es_button/* default */.ZP, {
type: "primary",
onClick: /*#__PURE__*/asyncToGenerator_default()( /*#__PURE__*/regeneratorRuntime_default()().mark(function _callee13() {
return regeneratorRuntime_default()().wrap(function _callee13$(_context15) {
while (1) switch (_context15.prev = _context15.next) {
onClick: /*#__PURE__*/asyncToGenerator_default()( /*#__PURE__*/regeneratorRuntime_default()().mark(function _callee14() {
return regeneratorRuntime_default()().wrap(function _callee14$(_context16) {
while (1) switch (_context16.prev = _context16.next) {
case 0:
dispatch({
type: 'shixunHomeworks/setActionTabs',
@ -2636,9 +2694,9 @@ var Comment_ShixunsListPage = function ShixunsListPage(_ref) {
});
case 1:
case "end":
return _context15.stop();
return _context16.stop();
}
}, _callee13);
}, _callee14);
})),
children: "\u70B9\u8BC4\u4F5C\u4E1A"
})]
@ -2784,12 +2842,12 @@ var Comment_ShixunsListPage = function ShixunsListPage(_ref) {
})]
});
};
/* harmony default export */ var Comment = ((0,_umi_production_exports.connect)(function (_ref13) {
var shixunHomeworks = _ref13.shixunHomeworks,
classroomList = _ref13.classroomList,
loading = _ref13.loading,
globalSetting = _ref13.globalSetting,
user = _ref13.user;
/* harmony default export */ var Comment = ((0,_umi_production_exports.connect)(function (_ref14) {
var shixunHomeworks = _ref14.shixunHomeworks,
classroomList = _ref14.classroomList,
loading = _ref14.loading,
globalSetting = _ref14.globalSetting,
user = _ref14.user;
return {
shixunHomeworks: shixunHomeworks,
classroomList: classroomList,

File diff suppressed because one or more lines are too long
Loading…
Cancel
Save