|
|
(self["webpackChunk"] = self["webpackChunk"] || []).push([[12884,11436],{
|
|
|
|
|
|
/***/ 73208:
|
|
|
/*!*****************************************!*\
|
|
|
!*** ./src/components/NoData/index.tsx ***!
|
|
|
\*****************************************/
|
|
|
/***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) {
|
|
|
|
|
|
"use strict";
|
|
|
/* harmony import */ var _root_workspace_ppte5yg23_local_v9_test3_node_modules_babel_runtime_7_23_2_babel_runtime_helpers_objectSpread2_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./node_modules/_@babel_runtime@7.23.2@@babel/runtime/helpers/objectSpread2.js */ 26801);
|
|
|
/* harmony import */ var _root_workspace_ppte5yg23_local_v9_test3_node_modules_babel_runtime_7_23_2_babel_runtime_helpers_objectSpread2_js__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_root_workspace_ppte5yg23_local_v9_test3_node_modules_babel_runtime_7_23_2_babel_runtime_helpers_objectSpread2_js__WEBPACK_IMPORTED_MODULE_0__);
|
|
|
/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! react */ 59301);
|
|
|
/* harmony import */ var _assets_images_icons_nodata_png__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @/assets/images/icons/nodata.png */ 93314);
|
|
|
/* harmony import */ var antd__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! antd */ 3113);
|
|
|
/* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! react/jsx-runtime */ 37712);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
var noData = function noData(_ref) {
|
|
|
var img = _ref.img,
|
|
|
_ref$buttonProps = _ref.buttonProps,
|
|
|
buttonProps = _ref$buttonProps === void 0 ? {} : _ref$buttonProps,
|
|
|
_ref$styles = _ref.styles,
|
|
|
styles = _ref$styles === void 0 ? {} : _ref$styles,
|
|
|
customText = _ref.customText,
|
|
|
ButtonText = _ref.ButtonText,
|
|
|
ButtonClick = _ref.ButtonClick,
|
|
|
Buttonclass = _ref.Buttonclass,
|
|
|
ButtonTwo = _ref.ButtonTwo,
|
|
|
imgStyles = _ref.imgStyles,
|
|
|
_ref$loading = _ref.loading,
|
|
|
loading = _ref$loading === void 0 ? false : _ref$loading;
|
|
|
return /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_3__.jsxs)("section", {
|
|
|
className: "tc animated fadeIn",
|
|
|
style: _root_workspace_ppte5yg23_local_v9_test3_node_modules_babel_runtime_7_23_2_babel_runtime_helpers_objectSpread2_js__WEBPACK_IMPORTED_MODULE_0___default()(_root_workspace_ppte5yg23_local_v9_test3_node_modules_babel_runtime_7_23_2_babel_runtime_helpers_objectSpread2_js__WEBPACK_IMPORTED_MODULE_0___default()({}, {
|
|
|
color: '#999',
|
|
|
margin: '100px auto',
|
|
|
visibility: loading ? 'hidden' : 'visible'
|
|
|
}), styles),
|
|
|
children: [/*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_3__.jsx)("img", {
|
|
|
src: img || _assets_images_icons_nodata_png__WEBPACK_IMPORTED_MODULE_2__,
|
|
|
style: _root_workspace_ppte5yg23_local_v9_test3_node_modules_babel_runtime_7_23_2_babel_runtime_helpers_objectSpread2_js__WEBPACK_IMPORTED_MODULE_0___default()({}, imgStyles)
|
|
|
}), /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_3__.jsx)("p", {
|
|
|
className: "mt20 font14",
|
|
|
children: customText || '暂时还没有相关数据哦!'
|
|
|
}), ButtonText && /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_3__.jsx)(antd__WEBPACK_IMPORTED_MODULE_4__/* ["default"] */ .ZP, _root_workspace_ppte5yg23_local_v9_test3_node_modules_babel_runtime_7_23_2_babel_runtime_helpers_objectSpread2_js__WEBPACK_IMPORTED_MODULE_0___default()(_root_workspace_ppte5yg23_local_v9_test3_node_modules_babel_runtime_7_23_2_babel_runtime_helpers_objectSpread2_js__WEBPACK_IMPORTED_MODULE_0___default()({
|
|
|
className: Buttonclass,
|
|
|
onClick: ButtonClick
|
|
|
}, buttonProps), {}, {
|
|
|
children: ButtonText
|
|
|
})), ButtonTwo && ButtonTwo]
|
|
|
});
|
|
|
};
|
|
|
/* harmony default export */ __webpack_exports__.Z = (noData);
|
|
|
|
|
|
/***/ }),
|
|
|
|
|
|
/***/ 19480:
|
|
|
/*!*********************************************************!*\
|
|
|
!*** ./src/components/PreviewAll/index.tsx + 1 modules ***!
|
|
|
\*********************************************************/
|
|
|
/***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) {
|
|
|
|
|
|
"use strict";
|
|
|
|
|
|
// EXPORTS
|
|
|
__webpack_require__.d(__webpack_exports__, {
|
|
|
Z: function() { return /* binding */ PreviewAll; }
|
|
|
});
|
|
|
|
|
|
// EXTERNAL MODULE: ./node_modules/_@babel_runtime@7.23.2@@babel/runtime/helpers/objectSpread2.js
|
|
|
var objectSpread2 = __webpack_require__(26801);
|
|
|
var objectSpread2_default = /*#__PURE__*/__webpack_require__.n(objectSpread2);
|
|
|
// EXTERNAL MODULE: ./node_modules/_@babel_runtime@7.23.2@@babel/runtime/helpers/regeneratorRuntime.js
|
|
|
var regeneratorRuntime = __webpack_require__(10574);
|
|
|
var regeneratorRuntime_default = /*#__PURE__*/__webpack_require__.n(regeneratorRuntime);
|
|
|
// EXTERNAL MODULE: ./node_modules/_@babel_runtime@7.23.2@@babel/runtime/helpers/asyncToGenerator.js
|
|
|
var asyncToGenerator = __webpack_require__(39343);
|
|
|
var asyncToGenerator_default = /*#__PURE__*/__webpack_require__.n(asyncToGenerator);
|
|
|
// EXTERNAL MODULE: ./node_modules/_@babel_runtime@7.23.2@@babel/runtime/helpers/slicedToArray.js
|
|
|
var slicedToArray = __webpack_require__(11006);
|
|
|
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);
|
|
|
;// CONCATENATED MODULE: ./src/components/PreviewAll/index.less?modules
|
|
|
// extracted by mini-css-extract-plugin
|
|
|
/* harmony default export */ var PreviewAllmodules = ({"wrp":"wrp___dq7YK","bgBlack":"bgBlack___ARIUV","monaco":"monaco___VnZC3","darkBlue":"darkBlue___UprA9","close":"close___LKoWu","embed":"embed___hvpEJ"});
|
|
|
// EXTERNAL MODULE: ./node_modules/_antd@5.9.0@antd/es/button/index.js
|
|
|
var es_button = __webpack_require__(3113);
|
|
|
// EXTERNAL MODULE: ./node_modules/_@ant-design_icons@5.2.6@@ant-design/icons/es/icons/ArrowDownOutlined.js + 1 modules
|
|
|
var ArrowDownOutlined = __webpack_require__(98915);
|
|
|
// EXTERNAL MODULE: ./src/components/monaco-editor/index.jsx + 3 modules
|
|
|
var monaco_editor = __webpack_require__(76329);
|
|
|
// EXTERNAL MODULE: ./node_modules/_antd@5.9.0@antd/es/tooltip/index.js + 3 modules
|
|
|
var tooltip = __webpack_require__(6848);
|
|
|
// EXTERNAL MODULE: ./src/utils/util.tsx
|
|
|
var util = __webpack_require__(22739);
|
|
|
// EXTERNAL MODULE: ./src/service/exercise.ts
|
|
|
var exercise = __webpack_require__(35367);
|
|
|
// EXTERNAL MODULE: ./src/components/NoData/index.tsx
|
|
|
var NoData = __webpack_require__(73208);
|
|
|
// EXTERNAL MODULE: ./src/utils/env.ts + 1 modules
|
|
|
var env = __webpack_require__(78130);
|
|
|
// EXTERNAL MODULE: ./node_modules/_react@17.0.2@react/jsx-runtime.js
|
|
|
var jsx_runtime = __webpack_require__(37712);
|
|
|
;// CONCATENATED MODULE: ./src/components/PreviewAll/index.tsx
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/* harmony default export */ var PreviewAll = (function (_ref) {
|
|
|
var _data, _data2, _data3, _data4, _data5, _data6, _data7;
|
|
|
var _ref$editOffice = _ref.editOffice,
|
|
|
editOffice = _ref$editOffice === void 0 ? 'view' : _ref$editOffice,
|
|
|
data = _ref.data,
|
|
|
theme = _ref.theme,
|
|
|
type = _ref.type,
|
|
|
filename = _ref.filename,
|
|
|
monacoEditor = _ref.monacoEditor,
|
|
|
className = _ref.className,
|
|
|
style = _ref.style,
|
|
|
close = _ref.close,
|
|
|
onClose = _ref.onClose,
|
|
|
hasMask = _ref.hasMask,
|
|
|
disabledDownload = _ref.disabledDownload,
|
|
|
onImgDimensions = _ref.onImgDimensions,
|
|
|
showNodata = _ref.showNodata;
|
|
|
var _useState = (0,_react_17_0_2_react.useState)('https://view.officeapps.live.com/op/view.aspx?src=http://testgs.educoder.net//rails/active_storage/blobs/eyJfcmFpbHMiOnsibWVzc2FnZSI6IkJBaHBCZz09IiwiZXhwIjpudWxsLCJwdXIiOiJibG9iX2lkIn19--03541f6234b93d7ac3b2d84e7eb0e6594a952945/1.ppt'),
|
|
|
_useState2 = slicedToArray_default()(_useState, 2),
|
|
|
src = _useState2[0],
|
|
|
setSrc = _useState2[1];
|
|
|
var _useState3 = (0,_react_17_0_2_react.useState)(""),
|
|
|
_useState4 = slicedToArray_default()(_useState3, 2),
|
|
|
token = _useState4[0],
|
|
|
setToken = _useState4[1];
|
|
|
var _useState5 = (0,_react_17_0_2_react.useState)(),
|
|
|
_useState6 = slicedToArray_default()(_useState5, 2),
|
|
|
officeData = _useState6[0],
|
|
|
setOfficeData = _useState6[1];
|
|
|
var officePath = window.ENV === "build" ? "/react/build" : "";
|
|
|
var apiServer = location.host.startsWith("localhost") ? env/* default */.Z.PROXY_SERVER : env/* default */.Z.API_SERVER;
|
|
|
// let size;
|
|
|
console.log("disabledDownload---", disabledDownload);
|
|
|
var unit = 1024 * 1024;
|
|
|
var maxSize = 10 * unit;
|
|
|
var closeRef = (0,_react_17_0_2_react.useRef)();
|
|
|
if ((_data = data) !== null && _data !== void 0 && _data.startsWith("/api") && type !== "txt") {
|
|
|
data = env/* default */.Z.API_SERVER + data;
|
|
|
}
|
|
|
// if (type === "office") {
|
|
|
// size = parseUrl(data).filesize
|
|
|
// if (size > maxSize) {
|
|
|
// type = "other"
|
|
|
// }
|
|
|
// }
|
|
|
if (filename) monacoEditor.filename = filename;
|
|
|
(0,_react_17_0_2_react.useEffect)(function () {
|
|
|
var _document$cookie;
|
|
|
var cookies = (_document$cookie = document.cookie) === null || _document$cookie === void 0 || (_document$cookie = _document$cookie.replace(/\s/g, "")) === null || _document$cookie === void 0 ? void 0 : _document$cookie.split(";");
|
|
|
cookies === null || cookies === void 0 || cookies.map(function (item) {
|
|
|
var i = item.split("=");
|
|
|
if (i[0] === '_educoder_session') {
|
|
|
setToken(i[1]);
|
|
|
}
|
|
|
});
|
|
|
}, []);
|
|
|
(0,_react_17_0_2_react.useEffect)(function () {
|
|
|
if (type === "office") getData();
|
|
|
}, [type, data]);
|
|
|
var getData = /*#__PURE__*/function () {
|
|
|
var _ref2 = asyncToGenerator_default()( /*#__PURE__*/regeneratorRuntime_default()().mark(function _callee() {
|
|
|
var _url, _id, res;
|
|
|
return regeneratorRuntime_default()().wrap(function _callee$(_context) {
|
|
|
while (1) switch (_context.prev = _context.next) {
|
|
|
case 0:
|
|
|
console.log("data:", data);
|
|
|
_url = data;
|
|
|
if (!data.startsWith("http")) {
|
|
|
_url = location.origin + _url;
|
|
|
}
|
|
|
_id = new URL(_url).pathname.split("/").pop();
|
|
|
_context.next = 6;
|
|
|
return (0,exercise/* setEcsAttachment */.gJ)({
|
|
|
attachment_id: _id
|
|
|
});
|
|
|
case 6:
|
|
|
res = _context.sent;
|
|
|
setOfficeData(res);
|
|
|
case 8:
|
|
|
case "end":
|
|
|
return _context.stop();
|
|
|
}
|
|
|
}, _callee);
|
|
|
}));
|
|
|
return function getData() {
|
|
|
return _ref2.apply(this, arguments);
|
|
|
};
|
|
|
}();
|
|
|
var handleClick = function handleClick() {
|
|
|
if (data.startsWith("http") || data.startsWith('blob:')) {
|
|
|
handleDown();
|
|
|
return;
|
|
|
}
|
|
|
(0,util/* downloadFile */.Sv)(filename || 'educoder', data, filename);
|
|
|
};
|
|
|
var handleDown = function handleDown() {
|
|
|
(0,util/* downLoadLink */.Nd)(filename || 'educoder', decodeURIComponent(data));
|
|
|
};
|
|
|
console.log(data, 'data');
|
|
|
return /*#__PURE__*/(0,jsx_runtime.jsxs)("div", {
|
|
|
style: objectSpread2_default()({}, style || {}),
|
|
|
className: "".concat(hasMask && PreviewAllmodules.bgBlack, " ").concat(!!type ? PreviewAllmodules.wrp : "hide"),
|
|
|
children: [close && /*#__PURE__*/(0,jsx_runtime.jsxs)("div", {
|
|
|
className: PreviewAllmodules.close,
|
|
|
ref: closeRef,
|
|
|
children: [!!onImgDimensions && /*#__PURE__*/(0,jsx_runtime.jsx)(tooltip/* default */.Z, {
|
|
|
title: "\u70B9\u51FB\u5BF9\u56FE\u7247\u8FDB\u884C\u6279\u6CE8",
|
|
|
getPopupContainer: function getPopupContainer() {
|
|
|
return closeRef.current;
|
|
|
},
|
|
|
children: /*#__PURE__*/(0,jsx_runtime.jsx)("span", {
|
|
|
onClick: function onClick() {
|
|
|
onClose();
|
|
|
onImgDimensions();
|
|
|
},
|
|
|
children: /*#__PURE__*/(0,jsx_runtime.jsx)("i", {
|
|
|
className: "icon-yulanpizhu"
|
|
|
})
|
|
|
})
|
|
|
}), !disabledDownload && /*#__PURE__*/(0,jsx_runtime.jsx)(tooltip/* default */.Z, {
|
|
|
title: "\u70B9\u51FB\u4E0B\u8F7D\u6B64\u6587\u4EF6",
|
|
|
getPopupContainer: function getPopupContainer() {
|
|
|
return closeRef.current;
|
|
|
},
|
|
|
children: /*#__PURE__*/(0,jsx_runtime.jsx)("span", {
|
|
|
onClick: handleDown,
|
|
|
children: /*#__PURE__*/(0,jsx_runtime.jsx)("i", {
|
|
|
className: "icon-quxiaozhiding"
|
|
|
})
|
|
|
})
|
|
|
}), /*#__PURE__*/(0,jsx_runtime.jsx)(tooltip/* default */.Z, {
|
|
|
title: "\u5173\u95ED",
|
|
|
getPopupContainer: function getPopupContainer() {
|
|
|
return closeRef.current;
|
|
|
},
|
|
|
children: /*#__PURE__*/(0,jsx_runtime.jsx)("span", {
|
|
|
className: "",
|
|
|
onClick: onClose,
|
|
|
children: /*#__PURE__*/(0,jsx_runtime.jsx)("i", {
|
|
|
className: "icon-guanbi1"
|
|
|
})
|
|
|
})
|
|
|
})]
|
|
|
}), /*#__PURE__*/(0,jsx_runtime.jsx)("div", {
|
|
|
className: "".concat(PreviewAllmodules[className], " ").concat(className, " ").concat(PreviewAllmodules.monaco, " ").concat(type === "txt" ? "show" : "hide"),
|
|
|
children: type === "txt" && /*#__PURE__*/(0,jsx_runtime.jsx)(monaco_editor/* default */.ZP, objectSpread2_default()({}, monacoEditor))
|
|
|
}), type === "audio" && /*#__PURE__*/(0,jsx_runtime.jsx)("audio", {
|
|
|
src: ((_data2 = data) === null || _data2 === void 0 ? void 0 : _data2.indexOf("http")) > -1 || (_data3 = data) !== null && _data3 !== void 0 && _data3.startsWith("/api") ? data : "data:image/png;base64,".concat(data),
|
|
|
autoPlay: true
|
|
|
}), type === "video" && /*#__PURE__*/(0,jsx_runtime.jsx)(jsx_runtime.Fragment, {
|
|
|
children: ((_data4 = data) === null || _data4 === void 0 ? void 0 : _data4.indexOf("http")) > -1 || (_data5 = data) !== null && _data5 !== void 0 && _data5.startsWith("/api") ? /*#__PURE__*/(0,jsx_runtime.jsx)("video", {
|
|
|
controls: true,
|
|
|
src: "".concat(data),
|
|
|
autoPlay: true
|
|
|
}) : /*#__PURE__*/(0,jsx_runtime.jsx)("video", {
|
|
|
controls: true,
|
|
|
src: "data:video/mp4;base64,".concat(data),
|
|
|
autoPlay: true
|
|
|
})
|
|
|
}), type === 'office' && officeData && /*#__PURE__*/(0,jsx_runtime.jsx)("iframe", {
|
|
|
src: "".concat(officePath, "/office.html?key=").concat(officeData.key, "&url=").concat(apiServer + officeData.url, "&callbackUrl=").concat(apiServer + officeData.callbackUrl, "&fileType=").concat(officeData.fileType, "&title=").concat(officeData.title, "&model=").concat(editOffice, "&officeServer=").concat(env/* default */.Z.ONLYOFFICE, "&disabledDownload=").concat(!!disabledDownload)
|
|
|
}), type === 'html' && /*#__PURE__*/(0,jsx_runtime.jsx)("iframe", {
|
|
|
src: data + '&disposition=inline'
|
|
|
}), type === 'pdf' && /*#__PURE__*/(0,jsx_runtime.jsx)("iframe", {
|
|
|
src: "".concat(officePath, "/js/pdfview/index.html?url=").concat(data, "&disabledDownload=").concat(!!disabledDownload)
|
|
|
}) //<embed className={styles.embed + "#toolbar=0"} src={data} />
|
|
|
, type === "image" && /*#__PURE__*/(0,jsx_runtime.jsx)("img", {
|
|
|
src: ((_data6 = data) === null || _data6 === void 0 ? void 0 : _data6.indexOf("http")) > -1 || (_data7 = data) !== null && _data7 !== void 0 && _data7.startsWith("/api") ? data : "data:image/png;base64,".concat(data)
|
|
|
}), (type === "other" || type === "download") && /*#__PURE__*/(0,jsx_runtime.jsx)(jsx_runtime.Fragment, {
|
|
|
children: showNodata ? /*#__PURE__*/(0,jsx_runtime.jsx)(NoData/* default */.Z, {
|
|
|
customText: "\u5F53\u524D\u6587\u4EF6\u4E0D\u652F\u6301\u9884\u89C8\uFF0C\u53EF\u70B9\u51FB\u4E0B\u8F7D\u67E5\u770B",
|
|
|
ButtonTwo: /*#__PURE__*/(0,jsx_runtime.jsx)(es_button/* default */.ZP, {
|
|
|
icon: /*#__PURE__*/(0,jsx_runtime.jsx)("i", {
|
|
|
className: "iconfont icon-xiazai4 font14"
|
|
|
}),
|
|
|
type: "primary",
|
|
|
size: 'middle',
|
|
|
onClick: handleClick,
|
|
|
children: "\u4E0B\u8F7D"
|
|
|
})
|
|
|
}) : /*#__PURE__*/(0,jsx_runtime.jsxs)(es_button/* default */.ZP, {
|
|
|
type: "primary",
|
|
|
size: 'middle',
|
|
|
onClick: handleDown,
|
|
|
children: [/*#__PURE__*/(0,jsx_runtime.jsx)(ArrowDownOutlined/* default */.Z, {}), "\u70B9\u51FB\u4E0B\u8F7D"]
|
|
|
})
|
|
|
// handleClick
|
|
|
})]
|
|
|
});
|
|
|
});
|
|
|
|
|
|
/***/ }),
|
|
|
|
|
|
/***/ 11436:
|
|
|
/*!*********************************************************!*\
|
|
|
!*** ./src/components/RenderHtml/index.tsx + 1 modules ***!
|
|
|
\*********************************************************/
|
|
|
/***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) {
|
|
|
|
|
|
"use strict";
|
|
|
|
|
|
// EXPORTS
|
|
|
__webpack_require__.d(__webpack_exports__, {
|
|
|
Z: function() { return /* binding */ RenderHtml; }
|
|
|
});
|
|
|
|
|
|
// EXTERNAL MODULE: ./node_modules/_@babel_runtime@7.23.2@@babel/runtime/helpers/objectSpread2.js
|
|
|
var objectSpread2 = __webpack_require__(26801);
|
|
|
var objectSpread2_default = /*#__PURE__*/__webpack_require__.n(objectSpread2);
|
|
|
// EXTERNAL MODULE: ./node_modules/_@babel_runtime@7.23.2@@babel/runtime/helpers/toConsumableArray.js
|
|
|
var toConsumableArray = __webpack_require__(93923);
|
|
|
var toConsumableArray_default = /*#__PURE__*/__webpack_require__.n(toConsumableArray);
|
|
|
// EXTERNAL MODULE: ./node_modules/_@babel_runtime@7.23.2@@babel/runtime/helpers/createForOfIteratorHelper.js
|
|
|
var createForOfIteratorHelper = __webpack_require__(98190);
|
|
|
var createForOfIteratorHelper_default = /*#__PURE__*/__webpack_require__.n(createForOfIteratorHelper);
|
|
|
// EXTERNAL MODULE: ./node_modules/_@babel_runtime@7.23.2@@babel/runtime/helpers/slicedToArray.js
|
|
|
var slicedToArray = __webpack_require__(11006);
|
|
|
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/_katex@0.11.1@katex/dist/katex.min.css
|
|
|
var katex_min = __webpack_require__(16622);
|
|
|
// EXTERNAL MODULE: ./node_modules/_marked@2.0.7@marked/lib/marked.js
|
|
|
var marked = __webpack_require__(32834);
|
|
|
var marked_default = /*#__PURE__*/__webpack_require__.n(marked);
|
|
|
// EXTERNAL MODULE: ./node_modules/_marked@2.0.7@marked/src/helpers.js
|
|
|
var helpers = __webpack_require__(11690);
|
|
|
;// CONCATENATED MODULE: ./src/utils/marked.ts
|
|
|
|
|
|
|
|
|
|
|
|
function indentCodeCompensation(raw, text) {
|
|
|
var matchIndentToCode = raw.match(/^(\s+)(?:```)/);
|
|
|
if (matchIndentToCode === null) {
|
|
|
return text;
|
|
|
}
|
|
|
var indentToCode = matchIndentToCode[1];
|
|
|
return text.split('\n').map(function (node) {
|
|
|
var matchIndentInNode = node.match(/^\s+/);
|
|
|
if (matchIndentInNode === null) {
|
|
|
return node;
|
|
|
}
|
|
|
var _matchIndentInNode = slicedToArray_default()(matchIndentInNode, 1),
|
|
|
indentInNode = _matchIndentInNode[0];
|
|
|
if (indentInNode.length >= indentToCode.length) {
|
|
|
return node.slice(indentToCode.length);
|
|
|
}
|
|
|
return node;
|
|
|
}).join('\n');
|
|
|
}
|
|
|
//兼容之前的 ##标题式写法
|
|
|
var toc = [];
|
|
|
var ctx = ["<ul>"];
|
|
|
var renderer = new (marked_default()).Renderer();
|
|
|
var headingRegex = /^ *(#{1,6}) *([^\n]+?) *(?:#+ *)?(?:\n+|$)/;
|
|
|
function cleanToc() {
|
|
|
toc.length = 0;
|
|
|
ctx = ["<ul>"];
|
|
|
}
|
|
|
var lines = {
|
|
|
overflow: "hidden",
|
|
|
WebkitBoxOrient: "vertical",
|
|
|
display: "-webkit-box",
|
|
|
WebkitLineClamp: 2
|
|
|
};
|
|
|
function buildToc(coll, k, level, ctx) {
|
|
|
if (k >= coll.length || coll[k].level <= level) {
|
|
|
return k;
|
|
|
}
|
|
|
var node = coll[k];
|
|
|
ctx.push("<li><a href='#" + node.anchor + "'>" + node.text + "</a>");
|
|
|
k++;
|
|
|
var childCtx = [];
|
|
|
k = buildToc(coll, k, node.level, childCtx);
|
|
|
if (childCtx.length > 0) {
|
|
|
ctx.push("<ul>");
|
|
|
childCtx.forEach(function (idm) {
|
|
|
ctx.push(idm);
|
|
|
});
|
|
|
ctx.push("</ul>");
|
|
|
}
|
|
|
ctx.push("</li>");
|
|
|
k = buildToc(coll, k, level, ctx);
|
|
|
return k;
|
|
|
}
|
|
|
function getTocContent() {
|
|
|
buildToc(toc, 0, 0, ctx);
|
|
|
ctx.push("</ul>");
|
|
|
return ctx.join("");
|
|
|
}
|
|
|
var tokenizer = {
|
|
|
heading: function heading(src) {
|
|
|
var cap = headingRegex.exec(src);
|
|
|
if (cap) {
|
|
|
return {
|
|
|
type: 'heading',
|
|
|
raw: cap[0],
|
|
|
depth: cap[1].length,
|
|
|
text: cap[2]
|
|
|
};
|
|
|
}
|
|
|
},
|
|
|
fences: function fences(src) {
|
|
|
var cap = this.rules.block.fences.exec(src);
|
|
|
if (cap) {
|
|
|
var raw = cap[0];
|
|
|
var text = indentCodeCompensation(raw, cap[3] || '');
|
|
|
var lang = cap[2] ? cap[2].trim() : cap[2];
|
|
|
if (['latex', 'katex', 'math'].indexOf(lang) >= 0) {
|
|
|
var id = next_id();
|
|
|
var expression = text;
|
|
|
text = id;
|
|
|
math_expressions[id] = {
|
|
|
type: 'block',
|
|
|
expression: expression
|
|
|
};
|
|
|
}
|
|
|
return {
|
|
|
type: 'code',
|
|
|
raw: raw,
|
|
|
lang: lang,
|
|
|
text: text
|
|
|
};
|
|
|
}
|
|
|
}
|
|
|
};
|
|
|
var latexRegex = /(?:\${2})([^\n`]+?)(?:\${2})/gi;
|
|
|
var katex_count = 0;
|
|
|
var next_id = function next_id() {
|
|
|
return "__special_katext_id_".concat(katex_count++, "__");
|
|
|
};
|
|
|
var math_expressions = {};
|
|
|
function getMathExpressions() {
|
|
|
return math_expressions;
|
|
|
}
|
|
|
function resetMathExpressions() {
|
|
|
katex_count = 0;
|
|
|
math_expressions = {};
|
|
|
}
|
|
|
function replace_math_with_ids(text) {
|
|
|
text = text.replace(latexRegex, function (_match, expression) {
|
|
|
var id = next_id();
|
|
|
math_expressions[id] = {
|
|
|
type: 'inline',
|
|
|
expression: expression
|
|
|
};
|
|
|
return id;
|
|
|
});
|
|
|
return text;
|
|
|
}
|
|
|
var original_listitem = renderer.listitem;
|
|
|
renderer.listitem = function (text) {
|
|
|
return original_listitem(replace_math_with_ids(text));
|
|
|
};
|
|
|
var original_paragraph = renderer.paragraph;
|
|
|
renderer.paragraph = function (text) {
|
|
|
return original_paragraph(replace_math_with_ids(text));
|
|
|
};
|
|
|
var original_tablecell = renderer.tablecell;
|
|
|
renderer.tablecell = function (content, flags) {
|
|
|
return original_tablecell(replace_math_with_ids(content), flags);
|
|
|
};
|
|
|
renderer.code = function (code, infostring, escaped) {
|
|
|
var lang = (infostring || '').match(/\S*/)[0];
|
|
|
if (!lang) {
|
|
|
return '<pre class="prettyprint linenums"><code>' + (escaped ? code : (0,helpers.escape)(code, true)) + '</code></pre>';
|
|
|
}
|
|
|
if (['latex', 'katex', 'math'].indexOf(lang) >= 0) {
|
|
|
return "<p class='editormd-tex'>".concat(code, "</p>");
|
|
|
} else {
|
|
|
return "<pre class=\"prettyprint linenums\"><code class=\"language-".concat(infostring, "\">").concat(escaped ? code : (0,helpers.escape)(code, true), "</code></pre>\n");
|
|
|
}
|
|
|
};
|
|
|
renderer.heading = function (text, level, raw) {
|
|
|
var anchor = this.options.headerPrefix + raw.toLowerCase().replace(/[^\w\\u4e00-\\u9fa5]]+/g, '-');
|
|
|
toc.push({
|
|
|
anchor: anchor,
|
|
|
level: level,
|
|
|
text: text
|
|
|
});
|
|
|
return '<h' + level + ' id="' + anchor + '">' + text + '</h' + level + '>';
|
|
|
};
|
|
|
marked_default().setOptions({
|
|
|
silent: true,
|
|
|
gfm: true,
|
|
|
pedantic: false
|
|
|
});
|
|
|
marked_default().use({
|
|
|
tokenizer: tokenizer,
|
|
|
renderer: renderer
|
|
|
});
|
|
|
/* harmony default export */ var utils_marked = ((marked_default()));
|
|
|
// EXTERNAL MODULE: ./node_modules/_code-prettify@0.1.0@code-prettify/src/prettify.js
|
|
|
var prettify = __webpack_require__(64018);
|
|
|
// EXTERNAL MODULE: ./node_modules/_hls.js@1.4.13@hls.js/dist/hls.mjs
|
|
|
var dist_hls = __webpack_require__(9029);
|
|
|
// EXTERNAL MODULE: ./src/utils/env.ts + 1 modules
|
|
|
var env = __webpack_require__(78130);
|
|
|
// EXTERNAL MODULE: ./node_modules/_katex@0.11.1@katex/dist/katex.js
|
|
|
var katex = __webpack_require__(15342);
|
|
|
// EXTERNAL MODULE: ./node_modules/_uuid@8.3.0@uuid/dist/esm-browser/v4.js + 4 modules
|
|
|
var v4 = __webpack_require__(1012);
|
|
|
// EXTERNAL MODULE: ./src/components/PreviewAll/index.tsx + 1 modules
|
|
|
var PreviewAll = __webpack_require__(19480);
|
|
|
// EXTERNAL MODULE: ./node_modules/_react@17.0.2@react/jsx-runtime.js
|
|
|
var jsx_runtime = __webpack_require__(37712);
|
|
|
;// CONCATENATED MODULE: ./src/components/RenderHtml/index.tsx
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
var ADD_MULTI = '@▁▁@';
|
|
|
var ADD_SINGLE = '@▁@';
|
|
|
var preRegex = /<pre[^>]*>/g;
|
|
|
function _unescape(str) {
|
|
|
var div = document.createElement('div');
|
|
|
div.innerHTML = str;
|
|
|
return div.childNodes.length === 0 ? '' : div.childNodes[0].nodeValue;
|
|
|
}
|
|
|
/* harmony default export */ var RenderHtml = (function (_ref) {
|
|
|
var _ref$value = _ref.value,
|
|
|
value = _ref$value === void 0 ? '' : _ref$value,
|
|
|
className = _ref.className,
|
|
|
showTextOnly = _ref.showTextOnly,
|
|
|
showLines = _ref.showLines,
|
|
|
_ref$style = _ref.style,
|
|
|
style = _ref$style === void 0 ? {} : _ref$style,
|
|
|
_ref$stylesPrev = _ref.stylesPrev,
|
|
|
stylesPrev = _ref$stylesPrev === void 0 ? {} : _ref$stylesPrev,
|
|
|
highlightKeywords = _ref.highlightKeywords,
|
|
|
showProgramFill = _ref.showProgramFill,
|
|
|
isProgramFill = _ref.isProgramFill,
|
|
|
_ref$disabledFill = _ref.disabledFill,
|
|
|
disabledFill = _ref$disabledFill === void 0 ? false : _ref$disabledFill,
|
|
|
programFillValue = _ref.programFillValue,
|
|
|
_ref$onFillChange = _ref.onFillChange,
|
|
|
onFillChange = _ref$onFillChange === void 0 ? function (value) {} : _ref$onFillChange,
|
|
|
_ref$onFillBlur = _ref.onFillBlur,
|
|
|
onFillBlur = _ref$onFillBlur === void 0 ? function () {} : _ref$onFillBlur;
|
|
|
var str = String(value);
|
|
|
var _useState = (0,_react_17_0_2_react.useState)(""),
|
|
|
_useState2 = slicedToArray_default()(_useState, 2),
|
|
|
data = _useState2[0],
|
|
|
setData = _useState2[1];
|
|
|
var _useState3 = (0,_react_17_0_2_react.useState)("office"),
|
|
|
_useState4 = slicedToArray_default()(_useState3, 2),
|
|
|
type = _useState4[0],
|
|
|
setType = _useState4[1];
|
|
|
var _useState5 = (0,_react_17_0_2_react.useState)([]),
|
|
|
_useState6 = slicedToArray_default()(_useState5, 2),
|
|
|
projectValue = _useState6[0],
|
|
|
setProjectValue = _useState6[1];
|
|
|
var classNamesRef = (0,_react_17_0_2_react.useRef)("a" + (0,v4/* default */.Z)());
|
|
|
var formObj = {};
|
|
|
var createInput = function createInput(a, num) {
|
|
|
// const wrap = document.createElement("span")
|
|
|
// wrap.className =
|
|
|
var input = document.createElement(a === ADD_SINGLE ? "input" : "textarea");
|
|
|
input.style.width = "100%";
|
|
|
input.style.height = a === ADD_SINGLE ? "40px" : "151px";
|
|
|
input.rows = 5;
|
|
|
input.spellcheck = false;
|
|
|
input.name = "edu-program-fill";
|
|
|
input.placeholder = "请输入";
|
|
|
input.dataset.id = num;
|
|
|
var key = Object.keys(formObj).length;
|
|
|
formObj[key] = input;
|
|
|
return "<span class=\"edu-program-fill-wrap ".concat(a === ADD_SINGLE ? "" : "show", "\" style=\"width:").concat(a === ADD_SINGLE ? "200px" : "100%", "\"><span>").concat(input.outerHTML, "<span class=\"edu-program-fill-score\"></span></span></span>");
|
|
|
};
|
|
|
var formatMD = function formatMD(rs) {
|
|
|
return rs.replace(/<style.*?>([\s\S]+?)<\/style>/gim, function (_, css) {
|
|
|
var _css = css.replace(/(\n|\r)/g, "").split("}");
|
|
|
var arr = [];
|
|
|
_css.map(function (item) {
|
|
|
if (item != '') {
|
|
|
arr.push(".".concat(classNamesRef.current, " ").concat(item));
|
|
|
}
|
|
|
});
|
|
|
return "<style>".concat(arr.join("}"), "</style>");
|
|
|
});
|
|
|
};
|
|
|
var html = (0,_react_17_0_2_react.useMemo)(function () {
|
|
|
try {
|
|
|
var reg = /\(\s+\/api\/attachments\/|\(\/api\/attachments\/|\(\/attachments\/download\//g;
|
|
|
var reg2 = /\"\/api\/attachments\/|\"\/attachments\/download\//g;
|
|
|
var reg3 = /\(\s+\/files\/uploads\/|\"\/files\/uploads\//g;
|
|
|
str = str.replace(reg, "(" + env/* default */.Z.API_SERVER + "/api/attachments/").replace(reg2, '"' + env/* default */.Z.API_SERVER + "/api/attachments/").replace(reg3, '"' + env/* default */.Z.API_SERVER + "/files/uploads/").replaceAll("http://video.educoder", "https://video.educoder").replaceAll("http://www.educoder.net/api", "https://data.educoder.net/api").replaceAll("https://www.educoder.net/api", "https://data.educoder.net/api").replace(/\r\n/g, "\n");
|
|
|
// str = str.replace(new RegExp("(?<!\\n)\\n(?!\\n)", "g"), " \n")
|
|
|
} catch (e) {}
|
|
|
;
|
|
|
if (showProgramFill) {
|
|
|
var num = -1;
|
|
|
str = str.replaceAll("<", "<").replaceAll(">", ">").replace(/(@▁▁@|@▁@)/g, function (a, b, c) {
|
|
|
++num;
|
|
|
return createInput(a, num);
|
|
|
});
|
|
|
return "<pre style=\"background:#fff;padding:4px\">".concat(formatMD(str || ""), "</pre>");
|
|
|
}
|
|
|
var rs = utils_marked(str);
|
|
|
rs = formatMD(rs);
|
|
|
var math_expressions = getMathExpressions();
|
|
|
if (str.match(/\[TOC\]/)) {
|
|
|
rs = rs.replace('<p>[TOC]</p>', getTocContent());
|
|
|
cleanToc();
|
|
|
}
|
|
|
rs = rs.replace(/(__special_katext_id_\d+__)/g, function (_match, capture) {
|
|
|
var _math_expressions$cap = math_expressions[capture],
|
|
|
type = _math_expressions$cap.type,
|
|
|
expression = _math_expressions$cap.expression;
|
|
|
return (0,katex.renderToString)(_unescape(expression) || '', {
|
|
|
displayMode: type === 'block',
|
|
|
throwOnError: false,
|
|
|
output: 'html'
|
|
|
});
|
|
|
});
|
|
|
rs = rs.replace(/▁/g, '▁▁▁');
|
|
|
resetMathExpressions();
|
|
|
// return dompurify.sanitize(rs)
|
|
|
var dom = document.createElement('div');
|
|
|
dom.innerHTML = rs;
|
|
|
if (highlightKeywords) {
|
|
|
var escapedKeywords = highlightKeywords.replace(/[.*+?^${}()|[\]\\]/g, "\\$&");
|
|
|
findKeyword(dom, escapedKeywords);
|
|
|
return dom.innerHTML;
|
|
|
}
|
|
|
if (showTextOnly) {
|
|
|
return dom.innerText;
|
|
|
}
|
|
|
setTimeout(function () {
|
|
|
return onLoad();
|
|
|
}, 500);
|
|
|
console.log("dom.innerHTML:", dom.innerHTML);
|
|
|
return dom.innerHTML;
|
|
|
}, [str, highlightKeywords]);
|
|
|
(0,_react_17_0_2_react.useEffect)(function () {
|
|
|
if (el.current) {
|
|
|
var inputs = el.current.querySelectorAll(["input", "textarea"]);
|
|
|
inputs.forEach(function (input) {
|
|
|
input.oninput = onInput;
|
|
|
input.onblur = onBlur;
|
|
|
});
|
|
|
}
|
|
|
}, [projectValue]);
|
|
|
(0,_react_17_0_2_react.useEffect)(function () {
|
|
|
if (!!(programFillValue !== null && programFillValue !== void 0 && programFillValue.length)) {
|
|
|
var scoreDom = el.current.querySelectorAll(".edu-program-fill-score");
|
|
|
var dom = el.current.querySelectorAll('[name="edu-program-fill"]');
|
|
|
var _iterator = createForOfIteratorHelper_default()(dom.entries()),
|
|
|
_step;
|
|
|
try {
|
|
|
for (_iterator.s(); !(_step = _iterator.n()).done;) {
|
|
|
var _programFillValue$k;
|
|
|
var _step$value = slicedToArray_default()(_step.value, 2),
|
|
|
k = _step$value[0],
|
|
|
i = _step$value[1];
|
|
|
i.value = (_programFillValue$k = programFillValue[k]) === null || _programFillValue$k === void 0 ? void 0 : _programFillValue$k.value;
|
|
|
if (programFillValue[k].type === "warning") {
|
|
|
i.className = "program-fill-warning";
|
|
|
} else if (programFillValue[k].type === "success") {
|
|
|
i.className = "program-fill-success";
|
|
|
} else {
|
|
|
i.className = "";
|
|
|
}
|
|
|
}
|
|
|
} catch (err) {
|
|
|
_iterator.e(err);
|
|
|
} finally {
|
|
|
_iterator.f();
|
|
|
}
|
|
|
var _iterator2 = createForOfIteratorHelper_default()(scoreDom.entries()),
|
|
|
_step2;
|
|
|
try {
|
|
|
for (_iterator2.s(); !(_step2 = _iterator2.n()).done;) {
|
|
|
var _programFillValue$_k, _programFillValue$_k2;
|
|
|
var _step2$value = slicedToArray_default()(_step2.value, 2),
|
|
|
_k = _step2$value[0],
|
|
|
_i = _step2$value[1];
|
|
|
_i.innerHTML = (_programFillValue$_k = programFillValue[_k]) !== null && _programFillValue$_k !== void 0 && _programFillValue$_k.score ? "".concat((_programFillValue$_k2 = programFillValue[_k]) === null || _programFillValue$_k2 === void 0 ? void 0 : _programFillValue$_k2.score, "\u5206") : "";
|
|
|
}
|
|
|
} catch (err) {
|
|
|
_iterator2.e(err);
|
|
|
} finally {
|
|
|
_iterator2.f();
|
|
|
}
|
|
|
setProjectValue(programFillValue);
|
|
|
}
|
|
|
}, [programFillValue]);
|
|
|
var onInput = function onInput(e) {
|
|
|
projectValue[e.target.dataset.id] = projectValue[e.target.dataset.id] || {};
|
|
|
projectValue[e.target.dataset.id]["value"] = e.target.value;
|
|
|
setProjectValue(toConsumableArray_default()(projectValue));
|
|
|
onFillChange(projectValue, e.target.dataset.id);
|
|
|
};
|
|
|
var onBlur = function onBlur(e) {
|
|
|
projectValue[e.target.dataset.id] = projectValue[e.target.dataset.id] || {};
|
|
|
projectValue[e.target.dataset.id]["value"] = e.target.value;
|
|
|
setProjectValue(toConsumableArray_default()(projectValue));
|
|
|
onFillBlur(projectValue, e.target.dataset.id);
|
|
|
};
|
|
|
function findKeyword(node, keyword) {
|
|
|
return node.childNodes.forEach(function (childNode) {
|
|
|
if (childNode.childNodes.length > 0) {
|
|
|
findKeyword(childNode, keyword);
|
|
|
} else if (childNode.nodeName !== "IMG") {
|
|
|
if (childNode.innerHTML) {
|
|
|
var _childNode$innerHTML;
|
|
|
childNode.innerHTML = (_childNode$innerHTML = childNode.innerHTML) === null || _childNode$innerHTML === void 0 ? void 0 : _childNode$innerHTML.replace(new RegExp(keyword, "gi"), '<span style="color:#0152d9;background-color:#1890ff33">$&</span>');
|
|
|
} else {
|
|
|
var dom = document.createElement("span");
|
|
|
dom.innerHTML = childNode.textContent.replace(new RegExp(keyword, "gi"), '<span style="color:#0152d9;background-color:#1890ff33">$&</span>');
|
|
|
childNode.replaceWith(dom);
|
|
|
}
|
|
|
}
|
|
|
});
|
|
|
|
|
|
// return dom.childNodes.forEach((node:any) => {
|
|
|
// console.log("nodeLen:",node.childNodes.length)
|
|
|
// if(node.childNodes.length > 0){
|
|
|
// debugger
|
|
|
// // findKeyword(dom.childNodes,keyword)
|
|
|
// }else{
|
|
|
// if(node.nodeName !== "#text"){
|
|
|
// node.innerHTML = node.innerHTML.replaceAll(keyword,`<span class="c-blue">${keyword}</span>`)
|
|
|
// console.log("node:",node,dom,node.nodeName,node.innerHTML,node.childNodes.length)
|
|
|
// debugger
|
|
|
// }
|
|
|
// }
|
|
|
|
|
|
// return node
|
|
|
// });
|
|
|
}
|
|
|
|
|
|
var el = (0,_react_17_0_2_react.useRef)();
|
|
|
lines['WebkitLineClamp'] = showLines;
|
|
|
if (showLines) {
|
|
|
style = objectSpread2_default()(objectSpread2_default()({}, style), lines);
|
|
|
}
|
|
|
function onAncherHandler(e) {
|
|
|
var target = e.target;
|
|
|
if (target.tagName.toUpperCase() === 'A') {
|
|
|
var ancher = target.getAttribute('href');
|
|
|
if (ancher.indexOf("office") > -1) {
|
|
|
e.preventDefault();
|
|
|
setData(ancher);
|
|
|
setType("office");
|
|
|
} else if (ancher.indexOf("application/pdf") > -1) {
|
|
|
e.preventDefault();
|
|
|
setData(ancher);
|
|
|
setType("pdf");
|
|
|
} else if (ancher.indexOf("text/html") > -1) {
|
|
|
e.preventDefault();
|
|
|
setData(ancher);
|
|
|
setType("html");
|
|
|
} else if (ancher.startsWith('#')) {
|
|
|
e.preventDefault();
|
|
|
var viewEl = document.getElementById(ancher.replace('#', ''));
|
|
|
if (viewEl) {
|
|
|
viewEl.scrollIntoView(true);
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
var onLoad = function onLoad() {
|
|
|
var _el$current;
|
|
|
var videoElement = (_el$current = el.current) === null || _el$current === void 0 ? void 0 : _el$current.querySelectorAll('video');
|
|
|
videoElement === null || videoElement === void 0 || videoElement.forEach(function (item) {
|
|
|
item.oncontextmenu = function () {
|
|
|
return false;
|
|
|
};
|
|
|
if (item.src.indexOf('.m3u8') > -1) {
|
|
|
if (item.canPlayType('application/vnd.apple.mpegurl')) {} else if (dist_hls/* default */.Z.isSupported()) {
|
|
|
var hls = new dist_hls/* default */.Z();
|
|
|
hls.loadSource(item.src);
|
|
|
hls.attachMedia(item);
|
|
|
}
|
|
|
}
|
|
|
});
|
|
|
};
|
|
|
(0,_react_17_0_2_react.useEffect)(function () {
|
|
|
if (el.current && html) {
|
|
|
if (html.match(preRegex)) {
|
|
|
window.PR.prettyPrint();
|
|
|
}
|
|
|
}
|
|
|
if (el.current) {
|
|
|
el.current.addEventListener('click', onAncherHandler);
|
|
|
return function () {
|
|
|
var _el$current2;
|
|
|
(_el$current2 = el.current) === null || _el$current2 === void 0 || _el$current2.removeEventListener('click', onAncherHandler);
|
|
|
resetMathExpressions();
|
|
|
cleanToc();
|
|
|
};
|
|
|
}
|
|
|
}, [html, el.current, onAncherHandler]);
|
|
|
return /*#__PURE__*/(0,jsx_runtime.jsxs)(jsx_runtime.Fragment, {
|
|
|
children: [showTextOnly && /*#__PURE__*/(0,jsx_runtime.jsx)("div", {
|
|
|
ref: el,
|
|
|
children: html
|
|
|
}), !showTextOnly && /*#__PURE__*/(0,jsx_runtime.jsx)("div", {
|
|
|
ref: el,
|
|
|
style: objectSpread2_default()({}, style),
|
|
|
className: "".concat(className ? className : '', " ").concat(disabledFill ? "disabled-fill" : "", " markdown-body ").concat(classNamesRef.current),
|
|
|
dangerouslySetInnerHTML: {
|
|
|
__html: html
|
|
|
}
|
|
|
}), /*#__PURE__*/(0,jsx_runtime.jsx)(PreviewAll/* default */.Z, {
|
|
|
close: true,
|
|
|
data: data,
|
|
|
type: !!(data !== null && data !== void 0 && data.length) ? type : "",
|
|
|
style: objectSpread2_default()({}, stylesPrev),
|
|
|
onClose: function onClose() {
|
|
|
return setData("");
|
|
|
}
|
|
|
})]
|
|
|
});
|
|
|
});
|
|
|
|
|
|
/***/ }),
|
|
|
|
|
|
/***/ 95141:
|
|
|
/*!********************************************************************************************************!*\
|
|
|
!*** ./src/pages/Classrooms/Lists/ProgramHomework/Comment/components/ShixunStaticItem.tsx + 1 modules ***!
|
|
|
\********************************************************************************************************/
|
|
|
/***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) {
|
|
|
|
|
|
"use strict";
|
|
|
|
|
|
// EXPORTS
|
|
|
__webpack_require__.d(__webpack_exports__, {
|
|
|
Z: function() { return /* binding */ ShixunStaticItem; }
|
|
|
});
|
|
|
|
|
|
// UNUSED EXPORTS: ShixunsStaticItem
|
|
|
|
|
|
// EXTERNAL MODULE: ./node_modules/_@babel_runtime@7.23.2@@babel/runtime/helpers/regeneratorRuntime.js
|
|
|
var regeneratorRuntime = __webpack_require__(10574);
|
|
|
var regeneratorRuntime_default = /*#__PURE__*/__webpack_require__.n(regeneratorRuntime);
|
|
|
// EXTERNAL MODULE: ./node_modules/_@babel_runtime@7.23.2@@babel/runtime/helpers/asyncToGenerator.js
|
|
|
var asyncToGenerator = __webpack_require__(39343);
|
|
|
var asyncToGenerator_default = /*#__PURE__*/__webpack_require__.n(asyncToGenerator);
|
|
|
// EXTERNAL MODULE: ./node_modules/_@babel_runtime@7.23.2@@babel/runtime/helpers/slicedToArray.js
|
|
|
var slicedToArray = __webpack_require__(11006);
|
|
|
var slicedToArray_default = /*#__PURE__*/__webpack_require__.n(slicedToArray);
|
|
|
// EXTERNAL MODULE: ./node_modules/_@babel_runtime@7.23.2@@babel/runtime/helpers/objectSpread2.js
|
|
|
var objectSpread2 = __webpack_require__(26801);
|
|
|
var objectSpread2_default = /*#__PURE__*/__webpack_require__.n(objectSpread2);
|
|
|
// EXTERNAL MODULE: ./node_modules/_react@17.0.2@react/index.js
|
|
|
var _react_17_0_2_react = __webpack_require__(59301);
|
|
|
// EXTERNAL MODULE: ./node_modules/_antd@5.9.0@antd/es/radio/index.js + 5 modules
|
|
|
var es_radio = __webpack_require__(5112);
|
|
|
// 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/message/index.js + 4 modules
|
|
|
var message = __webpack_require__(8591);
|
|
|
// EXTERNAL MODULE: ./node_modules/_antd@5.9.0@antd/es/modal/index.js + 16 modules
|
|
|
var modal = __webpack_require__(43418);
|
|
|
// EXTERNAL MODULE: ./node_modules/_antd@5.9.0@antd/es/input-number/index.js + 14 modules
|
|
|
var input_number = __webpack_require__(85731);
|
|
|
// 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/divider/index.js + 1 modules
|
|
|
var divider = __webpack_require__(28103);
|
|
|
// EXTERNAL MODULE: ./src/components/monaco-editor/index.jsx + 3 modules
|
|
|
var monaco_editor = __webpack_require__(76329);
|
|
|
;// CONCATENATED MODULE: ./src/pages/Classrooms/Lists/ProgramHomework/Comment/components/ShixunStaticItem.less?modules
|
|
|
// extracted by mini-css-extract-plugin
|
|
|
/* harmony default export */ var ShixunStaticItemmodules = ({"flex_box_center":"flex_box_center___eijRq","flex_space_between":"flex_space_between___R4Vev","flex_box_vertical_center":"flex_box_vertical_center___j8R6g","flex_box_center_end":"flex_box_center_end___eB0cz","flex_box_column":"flex_box_column___b9VdU","md":"md___tcpb2","title":"title___dVHM9"});
|
|
|
// EXTERNAL MODULE: ./src/utils/authority.ts
|
|
|
var authority = __webpack_require__(13186);
|
|
|
// EXTERNAL MODULE: ./node_modules/_js-base64@2.6.4@js-base64/base64.js
|
|
|
var base64 = __webpack_require__(24334);
|
|
|
// EXTERNAL MODULE: ./src/utils/fetch.ts
|
|
|
var fetch = __webpack_require__(91506);
|
|
|
// EXTERNAL MODULE: ./src/.umi-production/exports.ts
|
|
|
var _umi_production_exports = __webpack_require__(45295);
|
|
|
// EXTERNAL MODULE: ./src/components/RenderHtml/index.tsx + 1 modules
|
|
|
var RenderHtml = __webpack_require__(11436);
|
|
|
// EXTERNAL MODULE: ./src/service/shixunHomeworks.ts
|
|
|
var shixunHomeworks = __webpack_require__(3688);
|
|
|
// EXTERNAL MODULE: ./node_modules/_@ant-design_icons@5.2.6@@ant-design/icons/es/icons/ExclamationCircleOutlined.js + 1 modules
|
|
|
var ExclamationCircleOutlined = __webpack_require__(80045);
|
|
|
// EXTERNAL MODULE: ./node_modules/_@ant-design_icons@5.2.6@@ant-design/icons/es/icons/DeleteOutlined.js + 1 modules
|
|
|
var DeleteOutlined = __webpack_require__(47966);
|
|
|
// EXTERNAL MODULE: ./node_modules/_react@17.0.2@react/jsx-runtime.js
|
|
|
var jsx_runtime = __webpack_require__(37712);
|
|
|
;// CONCATENATED MODULE: ./src/pages/Classrooms/Lists/ProgramHomework/Comment/components/ShixunStaticItem.tsx
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
var options = {
|
|
|
selectOnLineNumbers: true,
|
|
|
readOnly: true,
|
|
|
minimap: {
|
|
|
enabled: false
|
|
|
},
|
|
|
scrollBeyondLastLine: false,
|
|
|
enableSplitViewResizing: false,
|
|
|
roundedSelection: false,
|
|
|
renderIndicators: false,
|
|
|
useShadows: false
|
|
|
};
|
|
|
var Types = /*#__PURE__*/function (Types) {
|
|
|
Types[Types["SET_PATH"] = 0] = "SET_PATH";
|
|
|
Types[Types["GET_PASSED_CONTENT"] = 1] = "GET_PASSED_CONTENT";
|
|
|
return Types;
|
|
|
}(Types || {});
|
|
|
function reducer(state, action) {
|
|
|
switch (action.type) {
|
|
|
case Types.SET_PATH:
|
|
|
return _objectSpread(_objectSpread({}, state), {}, {
|
|
|
selectedPath: action.payload
|
|
|
});
|
|
|
case Types.GET_PASSED_CONTENT:
|
|
|
return _objectSpread(_objectSpread({}, state), {}, {
|
|
|
passedContent: action.payload
|
|
|
});
|
|
|
default:
|
|
|
throw new Error();
|
|
|
}
|
|
|
}
|
|
|
var ShixunsStaticItem = function ShixunsStaticItem(_ref) {
|
|
|
var language = _ref.language,
|
|
|
dispatch = _ref.dispatch,
|
|
|
shixunWorkReport = _ref.shixunWorkReport,
|
|
|
v = _ref.v,
|
|
|
languages = _ref.languages,
|
|
|
classroomList = _ref.classroomList,
|
|
|
autoHeight = _ref.autoHeight,
|
|
|
diff_code_count = _ref.diff_code_count,
|
|
|
data = _ref.data;
|
|
|
// const paths = path.split(';').filter(item => !!item)
|
|
|
// const [state, dispatch] = useReducer(reducer, { selectedPath: '123', passedContent: { language: 'python', content: '' } })
|
|
|
// const { selectedPath, passedContent } = state
|
|
|
var _useState = (0,_react_17_0_2_react.useState)(languages === null || languages === void 0 ? void 0 : languages[0]),
|
|
|
_useState2 = slicedToArray_default()(_useState, 2),
|
|
|
item = _useState2[0],
|
|
|
setitem = _useState2[1];
|
|
|
var params = (0,_umi_production_exports.useParams)();
|
|
|
(0,_react_17_0_2_react.useEffect)(function () {
|
|
|
setitem(languages === null || languages === void 0 ? void 0 : languages[0]);
|
|
|
}, []);
|
|
|
(0,_react_17_0_2_react.useEffect)(function () {
|
|
|
var _languages$filter;
|
|
|
// console.log('----',item);
|
|
|
setitem(languages === null || languages === void 0 || (_languages$filter = languages.filter(function (items) {
|
|
|
return items.language === (item === null || item === void 0 ? void 0 : item.language);
|
|
|
})) === null || _languages$filter === void 0 ? void 0 : _languages$filter[0]);
|
|
|
}, [languages]);
|
|
|
|
|
|
// function onChange(value: string) {
|
|
|
// dispatch({
|
|
|
// type: Types.SET_PATH,
|
|
|
// payload: value
|
|
|
// })
|
|
|
// }
|
|
|
|
|
|
// useEffect(() => {
|
|
|
// console.log("path:",path,data)
|
|
|
// async function init() {
|
|
|
// const response = await onPathChange(game_id, selectedPath)
|
|
|
// dispatch({
|
|
|
// type: Types.GET_PASSED_CONTENT,
|
|
|
// payload: response
|
|
|
// })
|
|
|
// }
|
|
|
// // init()
|
|
|
// }, [selectedPath, game_id])
|
|
|
|
|
|
return /*#__PURE__*/(0,jsx_runtime.jsxs)(jsx_runtime.Fragment, {
|
|
|
children: [/*#__PURE__*/(0,jsx_runtime.jsxs)("h2", {
|
|
|
children: [" ", /*#__PURE__*/(0,jsx_runtime.jsxs)("span", {
|
|
|
children: [/*#__PURE__*/(0,jsx_runtime.jsx)("span", {
|
|
|
children: "\u6700\u540E\u901A\u5173\u7684\u4EE3\u7801"
|
|
|
}), (languages === null || languages === void 0 ? void 0 : languages.length) > 1 && /*#__PURE__*/(0,jsx_runtime.jsx)(es_radio/* default.Group */.ZP.Group, {
|
|
|
defaultValue: language,
|
|
|
style: {
|
|
|
marginLeft: 10
|
|
|
},
|
|
|
onChange: function onChange(e) {
|
|
|
var _languages$filter2;
|
|
|
// console.log(languages,languages?.filter((item:any)=>item.language===e.target.value)?.[0]);
|
|
|
|
|
|
setitem(languages === null || languages === void 0 || (_languages$filter2 = languages.filter(function (item) {
|
|
|
return item.language === e.target.value;
|
|
|
})) === null || _languages$filter2 === void 0 ? void 0 : _languages$filter2[0]);
|
|
|
},
|
|
|
children: languages === null || languages === void 0 ? void 0 : languages.map(function (item) {
|
|
|
return /*#__PURE__*/(0,jsx_runtime.jsx)(es_radio/* default */.ZP, {
|
|
|
value: item === null || item === void 0 ? void 0 : item.language,
|
|
|
children: item === null || item === void 0 ? void 0 : item.language
|
|
|
});
|
|
|
})
|
|
|
})]
|
|
|
}), (0,authority/* isAdmin */.GJ)() && shixunWorkReport != 'shixunWorkReport' && /*#__PURE__*/(0,jsx_runtime.jsxs)("span", {
|
|
|
children: [/*#__PURE__*/(0,jsx_runtime.jsxs)("span", {
|
|
|
children: ["\u5F97\u5206 ", item === null || item === void 0 ? void 0 : item.score, "/", item === null || item === void 0 ? void 0 : item.total_score]
|
|
|
}), /*#__PURE__*/(0,jsx_runtime.jsx)(es_button/* default */.ZP, {
|
|
|
style: {
|
|
|
margin: '0px 10px'
|
|
|
},
|
|
|
onClick: function onClick() {
|
|
|
var _classroomList$Assist;
|
|
|
if (!((_classroomList$Assist = classroomList.AssistantObject) !== null && _classroomList$Assist !== void 0 && (_classroomList$Assist = _classroomList$Assist.hack) !== null && _classroomList$Assist !== void 0 && _classroomList$Assist.can_appraise) && (0,authority/* isAssistant */.Rm)()) {
|
|
|
message/* default */.ZP.warning('您未获取此权限,需向管理员申请权限才能使用此功能');
|
|
|
return;
|
|
|
}
|
|
|
var scores = item === null || item === void 0 ? void 0 : item.score;
|
|
|
modal/* default */.Z.confirm({
|
|
|
title: '调分',
|
|
|
content: /*#__PURE__*/(0,jsx_runtime.jsxs)("div", {
|
|
|
children: [/*#__PURE__*/(0,jsx_runtime.jsxs)("p", {
|
|
|
children: ["\u5F97\u5206\uFF1A", item === null || item === void 0 ? void 0 : item.score, "/", item === null || item === void 0 ? void 0 : item.total_score]
|
|
|
}), /*#__PURE__*/(0,jsx_runtime.jsxs)("p", {
|
|
|
children: ["\u8C03\u5206\uFF1A", /*#__PURE__*/(0,jsx_runtime.jsx)(input_number/* default */.Z, {
|
|
|
min: 0,
|
|
|
max: item === null || item === void 0 ? void 0 : item.total_score,
|
|
|
defaultValue: item === null || item === void 0 ? void 0 : item.score,
|
|
|
onChange: function onChange(e) {
|
|
|
scores = e;
|
|
|
}
|
|
|
})]
|
|
|
})]
|
|
|
}),
|
|
|
okText: '确认',
|
|
|
onOk: function () {
|
|
|
var _onOk = asyncToGenerator_default()( /*#__PURE__*/regeneratorRuntime_default()().mark(function _callee() {
|
|
|
var res;
|
|
|
return regeneratorRuntime_default()().wrap(function _callee$(_context) {
|
|
|
while (1) switch (_context.prev = _context.next) {
|
|
|
case 0:
|
|
|
_context.next = 2;
|
|
|
return (0,fetch/* default */.ZP)("/api/courses/".concat(params === null || params === void 0 ? void 0 : params.coursesId, "/homework_commons/update_hack_score"), {
|
|
|
method: 'put',
|
|
|
body: {
|
|
|
course_id: params === null || params === void 0 ? void 0 : params.coursesId,
|
|
|
hack_user_code_id: item === null || item === void 0 ? void 0 : item.hack_user_id,
|
|
|
score: scores
|
|
|
}
|
|
|
});
|
|
|
case 2:
|
|
|
res = _context.sent;
|
|
|
if (res.status === 0) {
|
|
|
message/* default */.ZP.success('调分成功');
|
|
|
dispatch({
|
|
|
type: 'shixunHomeworks/setActionTabs',
|
|
|
payload: {}
|
|
|
});
|
|
|
dispatch({
|
|
|
type: 'shixunHomeworks/getShixunWorkReports',
|
|
|
payload: objectSpread2_default()({}, params)
|
|
|
});
|
|
|
// console.log('----',languages,item);
|
|
|
|
|
|
// setitem(languages?.filter((items:any)=>items.language===item?.language)?.[0])
|
|
|
}
|
|
|
case 4:
|
|
|
case "end":
|
|
|
return _context.stop();
|
|
|
}
|
|
|
}, _callee);
|
|
|
}));
|
|
|
function onOk() {
|
|
|
return _onOk.apply(this, arguments);
|
|
|
}
|
|
|
return onOk;
|
|
|
}(),
|
|
|
cancelText: '取消'
|
|
|
});
|
|
|
},
|
|
|
type: "primary",
|
|
|
children: "\u8C03\u5206"
|
|
|
}), (0,authority/* isAdmin */.GJ)() && shixunWorkReport != 'shixunWorkReport' && /*#__PURE__*/(0,jsx_runtime.jsx)(es_button/* default */.ZP, {
|
|
|
onClick: function onClick() {
|
|
|
var _classroomList$Assist2;
|
|
|
if (!((_classroomList$Assist2 = classroomList.AssistantObject.hack) !== null && _classroomList$Assist2 !== void 0 && _classroomList$Assist2.can_appraise) && (0,authority/* isAssistant */.Rm)()) {
|
|
|
message/* default */.ZP.warning('您未获取此权限,需向管理员申请权限才能使用此功能');
|
|
|
return;
|
|
|
}
|
|
|
dispatch({
|
|
|
type: 'shixunHomeworks/setActionTabs',
|
|
|
payload: {
|
|
|
key: "更改点评",
|
|
|
selectArrs: {
|
|
|
myshixun_identifier: shixunWorkReport.user_id,
|
|
|
type: '1',
|
|
|
language: item === null || item === void 0 ? void 0 : item.language,
|
|
|
v: v,
|
|
|
data: objectSpread2_default()({}, shixunWorkReport)
|
|
|
}
|
|
|
}
|
|
|
});
|
|
|
},
|
|
|
children: "\u70B9\u8BC4\u4EE3\u7801"
|
|
|
})]
|
|
|
})]
|
|
|
}), /*#__PURE__*/(0,jsx_runtime.jsx)(monaco_editor/* default */.ZP, {
|
|
|
height: 300,
|
|
|
language: item === null || item === void 0 ? void 0 : item.language,
|
|
|
value: base64.Base64.decode(item === null || item === void 0 ? void 0 : item.code),
|
|
|
autoHeight: autoHeight,
|
|
|
theme: "default",
|
|
|
options: options
|
|
|
}), ((item === null || item === void 0 ? void 0 : item.comment) || (item === null || item === void 0 ? void 0 : item.hidden_comment)) && /*#__PURE__*/(0,jsx_runtime.jsxs)("div", {
|
|
|
children: [/*#__PURE__*/(0,jsx_runtime.jsxs)(row/* default */.Z, {
|
|
|
align: "middle",
|
|
|
style: {
|
|
|
borderTop: '1px solid #eee'
|
|
|
},
|
|
|
children: [/*#__PURE__*/(0,jsx_runtime.jsx)(col/* default */.Z, {
|
|
|
flex: 1,
|
|
|
children: /*#__PURE__*/(0,jsx_runtime.jsx)("h1", {
|
|
|
className: ShixunStaticItemmodules.title,
|
|
|
children: "\u70B9\u8BC4\u5185\u5BB9"
|
|
|
})
|
|
|
}), /*#__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 _callee3() {
|
|
|
return regeneratorRuntime_default()().wrap(function _callee3$(_context3) {
|
|
|
while (1) switch (_context3.prev = _context3.next) {
|
|
|
case 0:
|
|
|
modal/* default */.Z.confirm({
|
|
|
centered: true,
|
|
|
okText: '确定',
|
|
|
cancelText: '取消',
|
|
|
title: '提示',
|
|
|
icon: /*#__PURE__*/(0,jsx_runtime.jsx)(ExclamationCircleOutlined/* default */.Z, {}),
|
|
|
content: '是否确认删除?',
|
|
|
onOk: function onOk() {
|
|
|
return asyncToGenerator_default()( /*#__PURE__*/regeneratorRuntime_default()().mark(function _callee2() {
|
|
|
var res;
|
|
|
return regeneratorRuntime_default()().wrap(function _callee2$(_context2) {
|
|
|
while (1) switch (_context2.prev = _context2.next) {
|
|
|
case 0:
|
|
|
_context2.next = 2;
|
|
|
return (0,shixunHomeworks/* deleteStudentWorkScoreCommit */.gZ)({
|
|
|
comment_id: item === null || item === void 0 ? void 0 : item.comment_id,
|
|
|
homeworkId: params.homeworkId,
|
|
|
type: 'hack'
|
|
|
});
|
|
|
case 2:
|
|
|
res = _context2.sent;
|
|
|
if (res.status === 0) {
|
|
|
message/* default */.ZP.success("删除成功");
|
|
|
dispatch({
|
|
|
type: 'shixunHomeworks/getShixunWorkReports',
|
|
|
payload: objectSpread2_default()({}, params)
|
|
|
});
|
|
|
}
|
|
|
case 4:
|
|
|
case "end":
|
|
|
return _context2.stop();
|
|
|
}
|
|
|
}, _callee2);
|
|
|
}))();
|
|
|
}
|
|
|
});
|
|
|
case 1:
|
|
|
case "end":
|
|
|
return _context3.stop();
|
|
|
}
|
|
|
}, _callee3);
|
|
|
})),
|
|
|
children: [/*#__PURE__*/(0,jsx_runtime.jsx)(DeleteOutlined/* default */.Z, {}), "\u5220\u9664"]
|
|
|
})
|
|
|
})]
|
|
|
}), /*#__PURE__*/(0,jsx_runtime.jsx)(divider/* default */.Z, {
|
|
|
style: {
|
|
|
margin: 0
|
|
|
}
|
|
|
}), (item === null || item === void 0 ? void 0 : item.comment) && /*#__PURE__*/(0,jsx_runtime.jsxs)("aside", {
|
|
|
className: "pl30 pr30 mt20",
|
|
|
children: [/*#__PURE__*/(0,jsx_runtime.jsx)("span", {
|
|
|
className: "c-light-black font12",
|
|
|
children: "# \u5B66\u751F\u548C\u8BFE\u5802\u8001\u5E08\u53EF\u89C1"
|
|
|
}), /*#__PURE__*/(0,jsx_runtime.jsx)("br", {}), /*#__PURE__*/(0,jsx_runtime.jsx)(RenderHtml/* default */.Z, {
|
|
|
value: item === null || item === void 0 ? void 0 : item.comment
|
|
|
})]
|
|
|
}), (item === null || item === void 0 ? void 0 : item.hidden_comment) && /*#__PURE__*/(0,jsx_runtime.jsxs)("aside", {
|
|
|
className: "pl30 pr30 mt20",
|
|
|
children: [/*#__PURE__*/(0,jsx_runtime.jsx)("span", {
|
|
|
className: "c-light-black font12",
|
|
|
children: "# \u4EC5\u8BFE\u5802\u8001\u5E08\u53EF\u89C1"
|
|
|
}), /*#__PURE__*/(0,jsx_runtime.jsx)("br", {}), /*#__PURE__*/(0,jsx_runtime.jsx)(RenderHtml/* default */.Z, {
|
|
|
value: item === null || item === void 0 ? void 0 : item.hidden_comment
|
|
|
})]
|
|
|
})]
|
|
|
})]
|
|
|
});
|
|
|
};
|
|
|
/* harmony default export */ var ShixunStaticItem = (ShixunsStaticItem);
|
|
|
|
|
|
/***/ }),
|
|
|
|
|
|
/***/ 78101:
|
|
|
/*!**********************************************************************************!*\
|
|
|
!*** ./src/pages/Classrooms/Lists/ProgramHomework/Comment/index.tsx + 3 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 */ Comment; }
|
|
|
});
|
|
|
|
|
|
// EXTERNAL MODULE: ./node_modules/_@babel_runtime@7.23.2@@babel/runtime/helpers/regeneratorRuntime.js
|
|
|
var regeneratorRuntime = __webpack_require__(10574);
|
|
|
var regeneratorRuntime_default = /*#__PURE__*/__webpack_require__.n(regeneratorRuntime);
|
|
|
// EXTERNAL MODULE: ./node_modules/_@babel_runtime@7.23.2@@babel/runtime/helpers/asyncToGenerator.js
|
|
|
var asyncToGenerator = __webpack_require__(39343);
|
|
|
var asyncToGenerator_default = /*#__PURE__*/__webpack_require__.n(asyncToGenerator);
|
|
|
// EXTERNAL MODULE: ./node_modules/_@babel_runtime@7.23.2@@babel/runtime/helpers/objectSpread2.js
|
|
|
var objectSpread2 = __webpack_require__(26801);
|
|
|
var objectSpread2_default = /*#__PURE__*/__webpack_require__.n(objectSpread2);
|
|
|
// EXTERNAL MODULE: ./node_modules/_@babel_runtime@7.23.2@@babel/runtime/helpers/slicedToArray.js
|
|
|
var slicedToArray = __webpack_require__(11006);
|
|
|
var slicedToArray_default = /*#__PURE__*/__webpack_require__.n(slicedToArray);
|
|
|
// EXTERNAL MODULE: ./node_modules/_@babel_runtime@7.23.2@@babel/runtime/helpers/objectWithoutProperties.js
|
|
|
var objectWithoutProperties = __webpack_require__(27161);
|
|
|
var objectWithoutProperties_default = /*#__PURE__*/__webpack_require__.n(objectWithoutProperties);
|
|
|
// EXTERNAL MODULE: ./node_modules/_react@17.0.2@react/index.js
|
|
|
var _react_17_0_2_react = __webpack_require__(59301);
|
|
|
// EXTERNAL MODULE: ./node_modules/_jszip@3.10.1@jszip/dist/jszip.min.js
|
|
|
var jszip_min = __webpack_require__(86129);
|
|
|
var jszip_min_default = /*#__PURE__*/__webpack_require__.n(jszip_min);
|
|
|
// EXTERNAL MODULE: ./src/.umi-production/exports.ts
|
|
|
var _umi_production_exports = __webpack_require__(45295);
|
|
|
// EXTERNAL MODULE: ./node_modules/_antd@5.9.0@antd/es/modal/index.js + 16 modules
|
|
|
var es_modal = __webpack_require__(43418);
|
|
|
// EXTERNAL MODULE: ./node_modules/_antd@5.9.0@antd/es/skeleton/index.js + 12 modules
|
|
|
var skeleton = __webpack_require__(59981);
|
|
|
// EXTERNAL MODULE: ./node_modules/_antd@5.9.0@antd/es/breadcrumb/index.js + 6 modules
|
|
|
var breadcrumb = __webpack_require__(66104);
|
|
|
// 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/button/index.js
|
|
|
var es_button = __webpack_require__(3113);
|
|
|
// EXTERNAL MODULE: ./node_modules/_antd@5.9.0@antd/es/divider/index.js + 1 modules
|
|
|
var divider = __webpack_require__(28103);
|
|
|
// EXTERNAL MODULE: ./node_modules/_antd@5.9.0@antd/es/message/index.js + 4 modules
|
|
|
var message = __webpack_require__(8591);
|
|
|
// EXTERNAL MODULE: ./node_modules/_antd@5.9.0@antd/es/table/index.js + 85 modules
|
|
|
var table = __webpack_require__(72315);
|
|
|
// EXTERNAL MODULE: ./node_modules/_@ant-design_icons@5.2.6@@ant-design/icons/es/icons/ArrowLeftOutlined.js + 1 modules
|
|
|
var ArrowLeftOutlined = __webpack_require__(68742);
|
|
|
// EXTERNAL MODULE: ./node_modules/_@ant-design_icons@5.2.6@@ant-design/icons/es/icons/SolutionOutlined.js + 1 modules
|
|
|
var SolutionOutlined = __webpack_require__(92245);
|
|
|
// EXTERNAL MODULE: ./node_modules/_@ant-design_icons@5.2.6@@ant-design/icons/es/icons/ExclamationCircleOutlined.js + 1 modules
|
|
|
var ExclamationCircleOutlined = __webpack_require__(80045);
|
|
|
// EXTERNAL MODULE: ./node_modules/_@ant-design_icons@5.2.6@@ant-design/icons/es/icons/DeleteOutlined.js + 1 modules
|
|
|
var DeleteOutlined = __webpack_require__(47966);
|
|
|
// EXTERNAL MODULE: ./src/utils/env.ts + 1 modules
|
|
|
var env = __webpack_require__(78130);
|
|
|
// EXTERNAL MODULE: ./src/utils/authority.ts
|
|
|
var authority = __webpack_require__(13186);
|
|
|
// EXTERNAL MODULE: ./src/utils/util.tsx
|
|
|
var util = __webpack_require__(22739);
|
|
|
;// CONCATENATED MODULE: ./src/pages/Classrooms/Lists/ProgramHomework/Comment/index.less?modules
|
|
|
// extracted by mini-css-extract-plugin
|
|
|
/* harmony default export */ var Commentmodules = ({"flex_box_center":"flex_box_center___lb6Eo","flex_space_between":"flex_space_between___J8ZnK","flex_box_vertical_center":"flex_box_vertical_center___zweTs","flex_box_center_end":"flex_box_center_end___CvkW9","flex_box_column":"flex_box_column___ODy_E","title":"title___AD3SJ","export":"export___XBLMD","title1_right":"title1_right___raWIo","userPic":"userPic___OK1Fq","userInfo":"userInfo___wKpvE","listItem":"listItem___VH7Ls","rightInfo":"rightInfo___lI2xY","shixunTitle":"shixunTitle___lvDL9","shixunWrp":"shixunWrp___QXKnz","footerBar":"footerBar___zgEXb","footerBarStatic":"footerBarStatic___SB7gT","exitComment":"exitComment___oC_uA","nextComment":"nextComment___fCJ3l","modal":"modal___v_Shp"});
|
|
|
// EXTERNAL MODULE: ./src/pages/Classrooms/Lists/ProgramHomework/Comment/components/ShixunStaticItem.tsx + 1 modules
|
|
|
var ShixunStaticItem = __webpack_require__(95141);
|
|
|
// EXTERNAL MODULE: ./src/utils/fetch.ts
|
|
|
var fetch = __webpack_require__(91506);
|
|
|
// EXTERNAL MODULE: ./node_modules/_js-base64@2.6.4@js-base64/base64.js
|
|
|
var base64 = __webpack_require__(24334);
|
|
|
// EXTERNAL MODULE: ./node_modules/_react@17.0.2@react/jsx-runtime.js
|
|
|
var jsx_runtime = __webpack_require__(37712);
|
|
|
;// CONCATENATED MODULE: ./src/pages/Classrooms/Lists/ProgramHomework/Comment/components/ShixunStatic.tsx
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
var ShixunsListPage = function ShixunsListPage(_ref) {
|
|
|
var shixunHomeworks = _ref.shixunHomeworks,
|
|
|
autoHeight = _ref.autoHeight,
|
|
|
classroomList = _ref.classroomList,
|
|
|
user = _ref.user,
|
|
|
dispatch = _ref.dispatch;
|
|
|
var shixunWorkReport = shixunHomeworks.shixunWorkReport;
|
|
|
var stage_list = shixunWorkReport.stage_list,
|
|
|
work_id = shixunWorkReport.work_id;
|
|
|
var params = (0,_umi_production_exports.useParams)();
|
|
|
var hasPower = (0,authority/* isAdmin */.GJ)();
|
|
|
var columns = [{
|
|
|
title: '评测次数',
|
|
|
dataIndex: 'query_index',
|
|
|
width: 120
|
|
|
}, {
|
|
|
title: '详细结果',
|
|
|
dataIndex: 'result',
|
|
|
render: function render(text, record, index) {
|
|
|
return base64.Base64.decode(text) || '- -';
|
|
|
}
|
|
|
}];
|
|
|
|
|
|
// async function onChangeScore(index: number, value: any) {
|
|
|
// const { challenge_id } = stage_list[index]
|
|
|
// const res = await dispatch({
|
|
|
// type: "shixunHomeworks/changeScore",
|
|
|
// payload: {
|
|
|
// categoryId: params.homeworkId,
|
|
|
// "type": "report",
|
|
|
// "score": value,
|
|
|
// challenge_id: challenge_id
|
|
|
// }
|
|
|
// })
|
|
|
// await dispatch({
|
|
|
// type: 'shixunHomeworks/getShixunWorkReports',
|
|
|
// payload: { ...params },
|
|
|
// })
|
|
|
// if (res.status === 0) {
|
|
|
// message.success("操作成功")
|
|
|
// }
|
|
|
// }
|
|
|
|
|
|
function onPathChange(game_id, path) {
|
|
|
return (0,fetch/* get */.U2)("student_works/".concat(work_id, "/rep_passed_content.json"), {
|
|
|
path: path,
|
|
|
game_id: game_id
|
|
|
});
|
|
|
}
|
|
|
var datas = (0,util/* arrTrans */.qZ)(5, shixunWorkReport.hack);
|
|
|
return /*#__PURE__*/(0,jsx_runtime.jsx)(_react_17_0_2_react.Fragment, {
|
|
|
children: datas === null || datas === void 0 ? void 0 : datas.map(function (val, key) {
|
|
|
return /*#__PURE__*/(0,jsx_runtime.jsx)("div", {
|
|
|
children: val.map(function (v, k) {
|
|
|
var _v$history;
|
|
|
return /*#__PURE__*/(0,jsx_runtime.jsxs)("aside", {
|
|
|
className: "pl30 pr30",
|
|
|
children: [/*#__PURE__*/(0,jsx_runtime.jsx)("div", {
|
|
|
className: "".concat(Commentmodules.shixunTitle, " mt10"),
|
|
|
children: /*#__PURE__*/(0,jsx_runtime.jsxs)("div", {
|
|
|
style: {
|
|
|
display: 'flex',
|
|
|
width: '100%'
|
|
|
},
|
|
|
children: [/*#__PURE__*/(0,jsx_runtime.jsx)("span", {
|
|
|
className: "fa fa-code "
|
|
|
}), /*#__PURE__*/(0,jsx_runtime.jsxs)("strong", {
|
|
|
style: {
|
|
|
flex: 1
|
|
|
},
|
|
|
className: "c-black",
|
|
|
children: ["\u7B2C", key * 5 + k + 1, "\u9898 ", v.name]
|
|
|
}), v.is_finish && /*#__PURE__*/(0,jsx_runtime.jsxs)(_umi_production_exports.Link, {
|
|
|
style: {
|
|
|
marginLeft: 20
|
|
|
},
|
|
|
onClick: function onClick(e) {
|
|
|
e.preventDefault();
|
|
|
window.open(v === null || v === void 0 ? void 0 : v.url);
|
|
|
localStorage.setItem('program_homework', [params.coursesId, params.categoryId]);
|
|
|
},
|
|
|
to: "".concat(v === null || v === void 0 ? void 0 : v.url),
|
|
|
children: ["\u67E5\u770B\u7B54\u9898\u8BE6\u60C5", '>>']
|
|
|
})]
|
|
|
})
|
|
|
}), /*#__PURE__*/(0,jsx_runtime.jsxs)("div", {
|
|
|
className: "font16 mt10",
|
|
|
children: [v.is_finish === false && "本关暂未通过,无通关代码", v.is_finish && /*#__PURE__*/(0,jsx_runtime.jsx)("aside", {
|
|
|
className: Commentmodules.shixunWrp,
|
|
|
children: /*#__PURE__*/(0,jsx_runtime.jsx)(ShixunStaticItem/* default */.Z, {
|
|
|
classroomList: classroomList,
|
|
|
user: user,
|
|
|
v: v,
|
|
|
shixunWorkReport: shixunWorkReport,
|
|
|
dispatch: dispatch,
|
|
|
autoHeight: autoHeight,
|
|
|
languages: v.languages,
|
|
|
language: v.language,
|
|
|
game_id: v.id,
|
|
|
data: base64.Base64.decode(v.code),
|
|
|
diff_code_count: v.diff_code_count,
|
|
|
onPathChange: onPathChange
|
|
|
})
|
|
|
})]
|
|
|
}), /*#__PURE__*/(0,jsx_runtime.jsx)("aside", {
|
|
|
className: "mt10 font16",
|
|
|
children: (_v$history = v.history) !== null && _v$history !== void 0 && _v$history.length ? /*#__PURE__*/(0,jsx_runtime.jsx)(table/* default */.Z, {
|
|
|
columns: columns,
|
|
|
pagination: {
|
|
|
hideOnSinglePage: true
|
|
|
},
|
|
|
dataSource: v.history
|
|
|
}) : "本关无评测记录"
|
|
|
})]
|
|
|
}, k);
|
|
|
})
|
|
|
}, key);
|
|
|
})
|
|
|
});
|
|
|
};
|
|
|
/* harmony default export */ var ShixunStatic = ((0,_umi_production_exports.connect)(function (_ref2) {
|
|
|
var shixunHomeworks = _ref2.shixunHomeworks,
|
|
|
loading = _ref2.loading,
|
|
|
globalSetting = _ref2.globalSetting,
|
|
|
classroomList = _ref2.classroomList,
|
|
|
user = _ref2.user;
|
|
|
return {
|
|
|
shixunHomeworks: shixunHomeworks,
|
|
|
globalSetting: globalSetting,
|
|
|
loading: loading.effects,
|
|
|
classroomList: classroomList,
|
|
|
user: user
|
|
|
};
|
|
|
})(ShixunsListPage));
|
|
|
// EXTERNAL MODULE: ./node_modules/_antd@5.9.0@antd/es/form/index.js + 19 modules
|
|
|
var es_form = __webpack_require__(78241);
|
|
|
// EXTERNAL MODULE: ./node_modules/_antd@5.9.0@antd/es/input/index.js + 5 modules
|
|
|
var input = __webpack_require__(1056);
|
|
|
;// CONCATENATED MODULE: ./src/pages/Classrooms/Lists/ProgramHomework/Comment/components/ChangeCommit.tsx
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
var _excluded = ["shixunHomeworks", "dispatch"];
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
var DelShixun = function DelShixun(_ref) {
|
|
|
var _shixunHomeworks$acti5, _shixunHomeworks$acti6, _shixunHomeworks$acti7;
|
|
|
var shixunHomeworks = _ref.shixunHomeworks,
|
|
|
dispatch = _ref.dispatch,
|
|
|
props = objectWithoutProperties_default()(_ref, _excluded);
|
|
|
var params = (0,_umi_production_exports.useParams)();
|
|
|
var _useState = (0,_react_17_0_2_react.useState)(false),
|
|
|
_useState2 = slicedToArray_default()(_useState, 2),
|
|
|
showRequired = _useState2[0],
|
|
|
setShowRequired = _useState2[1];
|
|
|
var _Form$useForm = es_form/* default */.Z.useForm(),
|
|
|
_Form$useForm2 = slicedToArray_default()(_Form$useForm, 1),
|
|
|
form = _Form$useForm2[0];
|
|
|
(0,_react_17_0_2_react.useEffect)(function () {
|
|
|
if (shixunHomeworks.actionTabs.key === '更改点评') if (shixunHomeworks.actionTabs.selectArrs.type === '1') {
|
|
|
form.setFieldsValue({
|
|
|
comment: shixunHomeworks.actionTabs.selectArrs.v.comment,
|
|
|
hidden_comment: shixunHomeworks.actionTabs.selectArrs.v.hidden_comment
|
|
|
});
|
|
|
} else {
|
|
|
var _shixunHomeworks$acti, _shixunHomeworks$acti2;
|
|
|
form.setFieldsValue({
|
|
|
comment: (_shixunHomeworks$acti = shixunHomeworks.actionTabs.selectArrs) === null || _shixunHomeworks$acti === void 0 || (_shixunHomeworks$acti = _shixunHomeworks$acti.data) === null || _shixunHomeworks$acti === void 0 || (_shixunHomeworks$acti = _shixunHomeworks$acti.data) === null || _shixunHomeworks$acti === void 0 ? void 0 : _shixunHomeworks$acti.work_comment,
|
|
|
hidden_comment: (_shixunHomeworks$acti2 = shixunHomeworks.actionTabs.selectArrs) === null || _shixunHomeworks$acti2 === void 0 || (_shixunHomeworks$acti2 = _shixunHomeworks$acti2.data) === null || _shixunHomeworks$acti2 === void 0 || (_shixunHomeworks$acti2 = _shixunHomeworks$acti2.data) === null || _shixunHomeworks$acti2 === void 0 ? void 0 : _shixunHomeworks$acti2.work_comment_hidden
|
|
|
});
|
|
|
}
|
|
|
}, [shixunHomeworks.actionTabs.key]);
|
|
|
var quickCommit = /*#__PURE__*/function () {
|
|
|
var _ref2 = asyncToGenerator_default()( /*#__PURE__*/regeneratorRuntime_default()().mark(function _callee() {
|
|
|
var _shixunHomeworks$acti3, _shixunHomeworks$acti4;
|
|
|
var formValue, url, res;
|
|
|
return regeneratorRuntime_default()().wrap(function _callee$(_context) {
|
|
|
while (1) switch (_context.prev = _context.next) {
|
|
|
case 0:
|
|
|
formValue = form.getFieldValue();
|
|
|
url = shixunHomeworks.actionTabs.selectArrs.type === '1' ? "/api/problems/".concat(shixunHomeworks.actionTabs.selectArrs.v.identifier, "/hack_comment.json") : "/api/student_works/".concat(params.homeworkId, "/shixun_work_comment.json");
|
|
|
_context.next = 4;
|
|
|
return (0,fetch/* default */.ZP)(url, {
|
|
|
method: 'post',
|
|
|
body: {
|
|
|
hidden_comment: formValue.hidden_comment,
|
|
|
comment: formValue.comment,
|
|
|
language: (_shixunHomeworks$acti3 = shixunHomeworks.actionTabs.selectArrs) === null || _shixunHomeworks$acti3 === void 0 ? void 0 : _shixunHomeworks$acti3.language,
|
|
|
user_id: (_shixunHomeworks$acti4 = shixunHomeworks.actionTabs.selectArrs) === null || _shixunHomeworks$acti4 === void 0 || (_shixunHomeworks$acti4 = _shixunHomeworks$acti4.data) === null || _shixunHomeworks$acti4 === void 0 || (_shixunHomeworks$acti4 = _shixunHomeworks$acti4.data) === null || _shixunHomeworks$acti4 === void 0 ? void 0 : _shixunHomeworks$acti4.user_id
|
|
|
}
|
|
|
});
|
|
|
case 4:
|
|
|
res = _context.sent;
|
|
|
if (res.status === 0) {
|
|
|
message/* default */.ZP.success('评阅成功');
|
|
|
form.resetFields();
|
|
|
dispatch({
|
|
|
type: 'shixunHomeworks/setActionTabs',
|
|
|
payload: {}
|
|
|
});
|
|
|
dispatch({
|
|
|
type: 'shixunHomeworks/getShixunWorkReports',
|
|
|
payload: objectSpread2_default()({}, params)
|
|
|
});
|
|
|
}
|
|
|
case 6:
|
|
|
case "end":
|
|
|
return _context.stop();
|
|
|
}
|
|
|
}, _callee);
|
|
|
}));
|
|
|
return function quickCommit() {
|
|
|
return _ref2.apply(this, arguments);
|
|
|
};
|
|
|
}();
|
|
|
return /*#__PURE__*/(0,jsx_runtime.jsx)(jsx_runtime.Fragment, {
|
|
|
children: /*#__PURE__*/(0,jsx_runtime.jsxs)(es_modal/* default */.Z, {
|
|
|
centered: true,
|
|
|
title: /*#__PURE__*/(0,jsx_runtime.jsxs)("span", {
|
|
|
children: [((_shixunHomeworks$acti5 = shixunHomeworks.actionTabs.selectArrs) === null || _shixunHomeworks$acti5 === void 0 ? void 0 : _shixunHomeworks$acti5.type) === '1' ? '点评代码' : '更改点评', ((_shixunHomeworks$acti6 = shixunHomeworks.actionTabs.selectArrs) === null || _shixunHomeworks$acti6 === void 0 ? void 0 : _shixunHomeworks$acti6.language) && /*#__PURE__*/(0,jsx_runtime.jsxs)("span", {
|
|
|
style: {
|
|
|
marginLeft: 10,
|
|
|
fontSize: 14
|
|
|
},
|
|
|
children: ["\u4F7F\u7528\u8BED\u8A00\uFF1A", (_shixunHomeworks$acti7 = shixunHomeworks.actionTabs.selectArrs) === null || _shixunHomeworks$acti7 === void 0 ? void 0 : _shixunHomeworks$acti7.language]
|
|
|
})]
|
|
|
}),
|
|
|
open: shixunHomeworks.actionTabs.key === '更改点评' ? true : false,
|
|
|
okText: "\u786E\u5B9A",
|
|
|
cancelText: "\u53D6\u6D88",
|
|
|
onOk: /*#__PURE__*/asyncToGenerator_default()( /*#__PURE__*/regeneratorRuntime_default()().mark(function _callee2() {
|
|
|
var formValue;
|
|
|
return regeneratorRuntime_default()().wrap(function _callee2$(_context2) {
|
|
|
while (1) switch (_context2.prev = _context2.next) {
|
|
|
case 0:
|
|
|
formValue = form.getFieldValue();
|
|
|
if (JSON.stringify(formValue) === '{}' || formValue.hidden_comment === '' && formValue.comment === '') {
|
|
|
setShowRequired(true);
|
|
|
} else {
|
|
|
quickCommit();
|
|
|
}
|
|
|
case 2:
|
|
|
case "end":
|
|
|
return _context2.stop();
|
|
|
}
|
|
|
}, _callee2);
|
|
|
})),
|
|
|
onCancel: function onCancel() {
|
|
|
dispatch({
|
|
|
type: 'shixunHomeworks/setActionTabs',
|
|
|
payload: {}
|
|
|
});
|
|
|
},
|
|
|
children: [/*#__PURE__*/(0,jsx_runtime.jsxs)(es_form/* default */.Z, {
|
|
|
form: form,
|
|
|
onChange: function onChange() {
|
|
|
if (showRequired) setShowRequired(false);
|
|
|
},
|
|
|
children: [/*#__PURE__*/(0,jsx_runtime.jsx)("p", {
|
|
|
children: "\u5B66\u751F\u548C\u8BFE\u5802\u8001\u5E08\u53EF\u89C1"
|
|
|
}), /*#__PURE__*/(0,jsx_runtime.jsx)(es_form/* default */.Z.Item, {
|
|
|
name: "comment",
|
|
|
children: /*#__PURE__*/(0,jsx_runtime.jsx)(input/* default */.Z.TextArea, {
|
|
|
placeholder: "\u8BF7\u8F93\u5165\u8BC4\u9605\u5185\u5BB9",
|
|
|
rows: 8
|
|
|
})
|
|
|
}), /*#__PURE__*/(0,jsx_runtime.jsx)("p", {
|
|
|
children: "\u4EC5\u8BFE\u5802\u8001\u5E08\u53EF\u89C1"
|
|
|
}), /*#__PURE__*/(0,jsx_runtime.jsx)(es_form/* default */.Z.Item, {
|
|
|
name: "hidden_comment",
|
|
|
children: /*#__PURE__*/(0,jsx_runtime.jsx)(input/* default */.Z.TextArea, {
|
|
|
placeholder: "\u8BF7\u8F93\u5165\u8BC4\u9605\u5185\u5BB9",
|
|
|
rows: 8
|
|
|
})
|
|
|
})]
|
|
|
}), showRequired && /*#__PURE__*/(0,jsx_runtime.jsx)("p", {
|
|
|
className: "c-red",
|
|
|
children: "\u8BC4\u9605\u5185\u5BB9\u81F3\u5C11\u6709\u4E00\u4E2A\u4E0D\u4E3A\u7A7A"
|
|
|
})]
|
|
|
})
|
|
|
});
|
|
|
};
|
|
|
/* harmony default export */ var ChangeCommit = ((0,_umi_production_exports.connect)(function (_ref4) {
|
|
|
var shixunHomeworks = _ref4.shixunHomeworks;
|
|
|
return {
|
|
|
shixunHomeworks: shixunHomeworks
|
|
|
};
|
|
|
})(DelShixun));
|
|
|
// EXTERNAL MODULE: ./src/pages/Classrooms/Lists/ProgramHomework/Detail/components/WorkList/components/Redo.tsx
|
|
|
var Redo = __webpack_require__(13422);
|
|
|
// EXTERNAL MODULE: ./src/components/RenderHtml/index.tsx + 1 modules
|
|
|
var RenderHtml = __webpack_require__(11436);
|
|
|
// EXTERNAL MODULE: ./src/service/shixunHomeworks.ts
|
|
|
var service_shixunHomeworks = __webpack_require__(3688);
|
|
|
// EXTERNAL MODULE: ./node_modules/_html2pdf.js@0.10.1@html2pdf.js/dist/html2pdf.js
|
|
|
var html2pdf = __webpack_require__(44425);
|
|
|
var html2pdf_default = /*#__PURE__*/__webpack_require__.n(html2pdf);
|
|
|
;// CONCATENATED MODULE: ./src/pages/Classrooms/Lists/ProgramHomework/Comment/index.tsx
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
var Comment_excluded = ["shixunHomeworks", "globalSetting", "loading", "classroomList", "dispatch"];
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
var Comment_ShixunsListPage = function ShixunsListPage(_ref) {
|
|
|
var _shixunWorkReport$cat, _shixunWorkReport$cat2, _shixunWorkReport$cat3, _shixunWorkReport$cat4, _shixunWorkReport$cat5, _shixunWorkReport$dat, _shixunWorkReport$cat6, _shixunWorkReport$dat2, _shixunWorkReport$dat3, _shixunWorkReport$dat4, _shixunWorkReport$dat5, _shixunWorkReport$dat6, _shixunWorkReport$dat7, _shixunWorkReport$dat8, _shixunWorkReport$dat9, _shixunWorkReport$dat10, _shixunWorkReport$dat11, _shixunWorkReport$dat12, _shixunWorkReport$dat13, _shixunWorkReport$dat14, _shixunWorkReport$dat15, _shixunWorkReport$dat16, _shixunWorkReport$dat17, _shixunWorkReport$dat18, _shixunWorkReport$dat19, _shixunWorkReport$dat21, _shixunWorkReport$dat22, _shixunWorkReport$dat23, _shixunWorkReport$dat24, _shixunWorkReport$dat25, _shixunWorkReport$dat26;
|
|
|
var shixunHomeworks = _ref.shixunHomeworks,
|
|
|
globalSetting = _ref.globalSetting,
|
|
|
loading = _ref.loading,
|
|
|
classroomList = _ref.classroomList,
|
|
|
dispatch = _ref.dispatch,
|
|
|
props = objectWithoutProperties_default()(_ref, Comment_excluded);
|
|
|
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 _params = (0,_umi_production_exports.useParams)();
|
|
|
var location = (0,_umi_production_exports.useLocation)();
|
|
|
// 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
|
|
|
}),
|
|
|
_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];
|
|
|
var reportElement = (0,_react_17_0_2_react.useRef)();
|
|
|
var reportElementInfo = (0,_react_17_0_2_react.useRef)();
|
|
|
var _useState9 = (0,_react_17_0_2_react.useState)(false),
|
|
|
_useState10 = slicedToArray_default()(_useState9, 2),
|
|
|
isExportLoading = _useState10[0],
|
|
|
setIsExportLoading = _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];
|
|
|
var shixunWorkReport = shixunHomeworks.shixunWorkReport;
|
|
|
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)([]),
|
|
|
_useState18 = slicedToArray_default()(_useState17, 2),
|
|
|
allStudentWorks = _useState18[0],
|
|
|
setAllStudentWorks = _useState18[1];
|
|
|
var _useState19 = (0,_react_17_0_2_react.useState)(false),
|
|
|
_useState20 = slicedToArray_default()(_useState19, 2),
|
|
|
isshow = _useState20[0],
|
|
|
setIsshow = _useState20[1];
|
|
|
var _useState21 = (0,_react_17_0_2_react.useState)(false),
|
|
|
_useState22 = slicedToArray_default()(_useState21, 2),
|
|
|
isshows = _useState22[0],
|
|
|
setIsshows = _useState22[1];
|
|
|
(0,_react_17_0_2_react.useEffect)(function () {
|
|
|
dispatch({
|
|
|
type: 'globalSetting/footerToggle',
|
|
|
payload: false
|
|
|
});
|
|
|
dispatch({
|
|
|
type: 'classroomList/getAssistantPermissions',
|
|
|
payload: {
|
|
|
course_id: params.coursesId
|
|
|
}
|
|
|
});
|
|
|
return function () {
|
|
|
dispatch({
|
|
|
type: 'globalSetting/footerToggle',
|
|
|
payload: true
|
|
|
});
|
|
|
};
|
|
|
}, []);
|
|
|
(0,_react_17_0_2_react.useEffect)(function () {
|
|
|
if (shixunHomeworks.actionTabs.key === '导出实训报告' && allStudentWorks.length > 0) {
|
|
|
exportReport('all');
|
|
|
}
|
|
|
}, [allStudentWorks]);
|
|
|
(0,_react_17_0_2_react.useEffect)(function () {
|
|
|
setParams(objectSpread2_default()({}, _params));
|
|
|
}, [location.pathname]);
|
|
|
var scrollView = function scrollView() {
|
|
|
document.body.scrollIntoView();
|
|
|
};
|
|
|
function getData() {
|
|
|
return _getData.apply(this, arguments);
|
|
|
} // 解决导出 bug: DOMException: Failed to execute 'drawImage' on 'CanvasRenderingContext2D'
|
|
|
function _getData() {
|
|
|
_getData = asyncToGenerator_default()( /*#__PURE__*/regeneratorRuntime_default()().mark(function _callee10() {
|
|
|
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 _callee10$(_context12) {
|
|
|
while (1) switch (_context12.prev = _context12.next) {
|
|
|
case 0:
|
|
|
paylaod = JSON.parse(sessionStorage['all_student_works_params'] || '{}');
|
|
|
_context12.next = 3;
|
|
|
return dispatch({
|
|
|
type: 'shixunHomeworks/getAllStudentWorks',
|
|
|
payload: objectSpread2_default()(objectSpread2_default()({}, params), paylaod)
|
|
|
});
|
|
|
case 3:
|
|
|
res = _context12.sent;
|
|
|
// 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.user_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:
|
|
|
case "end":
|
|
|
return _context12.stop();
|
|
|
}
|
|
|
}, _callee10);
|
|
|
}));
|
|
|
return _getData.apply(this, arguments);
|
|
|
}
|
|
|
var handleRemoveSurplusCanvas = function handleRemoveSurplusCanvas() {
|
|
|
document.querySelectorAll('canvas').forEach(function (item) {
|
|
|
(!item.clientWidth || !item.clientHeight) && item.remove();
|
|
|
});
|
|
|
};
|
|
|
var setMonocoHeight = function setMonocoHeight() {
|
|
|
if (reportElement.current.offsetHeight > 62000) {
|
|
|
setAutoHeight(false);
|
|
|
} else {
|
|
|
setAutoHeight(true);
|
|
|
}
|
|
|
};
|
|
|
var exportReport = /*#__PURE__*/function () {
|
|
|
var _ref2 = asyncToGenerator_default()( /*#__PURE__*/regeneratorRuntime_default()().mark(function _callee5(type) {
|
|
|
var nums, modal, opt, next, _next, _shixunWorkReport$shi, pages, worker, folder, _loop, i, codeF;
|
|
|
return regeneratorRuntime_default()().wrap(function _callee5$(_context7) {
|
|
|
while (1) switch (_context7.prev = _context7.next) {
|
|
|
case 0:
|
|
|
_next = function _next3() {
|
|
|
_next = asyncToGenerator_default()( /*#__PURE__*/regeneratorRuntime_default()().mark(function _callee4() {
|
|
|
var res;
|
|
|
return regeneratorRuntime_default()().wrap(function _callee4$(_context6) {
|
|
|
while (1) switch (_context6.prev = _context6.next) {
|
|
|
case 0:
|
|
|
_context6.next = 2;
|
|
|
return dispatch({
|
|
|
type: 'shixunHomeworks/getShixunWorkReports',
|
|
|
payload: {
|
|
|
homeworkId: allStudentWorks[nums]['user_id']
|
|
|
}
|
|
|
});
|
|
|
case 2:
|
|
|
res = _context6.sent;
|
|
|
scrollView();
|
|
|
nums++;
|
|
|
setTimeout( /*#__PURE__*/asyncToGenerator_default()( /*#__PURE__*/regeneratorRuntime_default()().mark(function _callee3() {
|
|
|
var _res$shixun_detail;
|
|
|
var folders, pages, worker, _loop2, _i, codesF;
|
|
|
return regeneratorRuntime_default()().wrap(function _callee3$(_context5) {
|
|
|
while (1) switch (_context5.prev = _context5.next) {
|
|
|
case 0:
|
|
|
handleRemoveSurplusCanvas();
|
|
|
folders = zip.folder("".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$(_context4) {
|
|
|
while (1) switch (_context4.prev = _context4.next) {
|
|
|
case 0:
|
|
|
_context4.next = 2;
|
|
|
return worker.set(opt).from(pages[_i]).toContainer().toCanvas().toPdf().get('pdf').then( /*#__PURE__*/function () {
|
|
|
var _ref5 = asyncToGenerator_default()( /*#__PURE__*/regeneratorRuntime_default()().mark(function _callee2(pdf) {
|
|
|
return regeneratorRuntime_default()().wrap(function _callee2$(_context3) {
|
|
|
while (1) switch (_context3.prev = _context3.next) {
|
|
|
case 0:
|
|
|
if (!(_i < pages.length - 1)) {
|
|
|
_context3.next = 3;
|
|
|
break;
|
|
|
}
|
|
|
_context3.next = 3;
|
|
|
return pdf.addPage();
|
|
|
case 3:
|
|
|
case "end":
|
|
|
return _context3.stop();
|
|
|
}
|
|
|
}, _callee2);
|
|
|
}));
|
|
|
return function (_x3) {
|
|
|
return _ref5.apply(this, arguments);
|
|
|
};
|
|
|
}());
|
|
|
case 2:
|
|
|
case "end":
|
|
|
return _context4.stop();
|
|
|
}
|
|
|
}, _loop2);
|
|
|
});
|
|
|
_i = 0;
|
|
|
case 6:
|
|
|
if (!(_i < pages.length)) {
|
|
|
_context5.next = 11;
|
|
|
break;
|
|
|
}
|
|
|
return _context5.delegateYield(_loop2(_i), "t0", 8);
|
|
|
case 8:
|
|
|
_i++;
|
|
|
_context5.next = 6;
|
|
|
break;
|
|
|
case 11:
|
|
|
folders.file("".concat(allStudentWorks[nums - 1]['student_work_user_name']).concat(nums, ".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) {
|
|
|
var _item$game_codes2;
|
|
|
var codesG = codesF.folder("\u7B2C".concat(index + 1, "\u5173-").concat(item.subject, "-").concat(item.id));
|
|
|
item === null || item === void 0 || (_item$game_codes2 = item.game_codes) === null || _item$game_codes2 === void 0 || _item$game_codes2.map(function (i) {
|
|
|
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"]
|
|
|
})
|
|
|
});
|
|
|
if (nums == (allStudentWorks === null || allStudentWorks === void 0 ? void 0 : allStudentWorks.length)) {
|
|
|
modal.destroy();
|
|
|
download();
|
|
|
} else {
|
|
|
next();
|
|
|
}
|
|
|
case 16:
|
|
|
case "end":
|
|
|
return _context5.stop();
|
|
|
}
|
|
|
}, _callee3);
|
|
|
})), 2200);
|
|
|
case 6:
|
|
|
case "end":
|
|
|
return _context6.stop();
|
|
|
}
|
|
|
}, _callee4);
|
|
|
}));
|
|
|
return _next.apply(this, arguments);
|
|
|
};
|
|
|
next = function _next2() {
|
|
|
return _next.apply(this, arguments);
|
|
|
};
|
|
|
nums = 0;
|
|
|
// if (type !== 'all')
|
|
|
// setIsExportLoading(true)
|
|
|
// else
|
|
|
modal = es_modal/* default */.Z.info({
|
|
|
width: 460,
|
|
|
title: /*#__PURE__*/(0,jsx_runtime.jsxs)("div", {
|
|
|
children: ["\u6B63\u5728\u5BFC\u51FA\u5B9E\u8BAD\u62A5\u544A,", /*#__PURE__*/(0,jsx_runtime.jsx)("span", {
|
|
|
className: "c-red",
|
|
|
children: "\u8BF7\u52FF\u5173\u95ED\u6216\u64CD\u4F5C\u5F53\u524D\u6D4F\u89C8\u5668\u7A97\u53E3"
|
|
|
})]
|
|
|
}),
|
|
|
content: /*#__PURE__*/(0,jsx_runtime.jsxs)("div", {
|
|
|
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"]
|
|
|
}),
|
|
|
maskClosable: false,
|
|
|
className: Commentmodules.modal,
|
|
|
onOk: function onOk() {}
|
|
|
});
|
|
|
opt = {
|
|
|
margin: [0, 0],
|
|
|
filename: "".concat(shixunWorkReport.username, ".pdf"),
|
|
|
// image: {
|
|
|
// type: 'jpeg',
|
|
|
// quality: 0.98
|
|
|
// },
|
|
|
html2canvas: {
|
|
|
// dpi: 192,
|
|
|
// scale:2,
|
|
|
useCORS: true,
|
|
|
letterRendering: true
|
|
|
},
|
|
|
jsPDF: {
|
|
|
unit: 'mm',
|
|
|
format: 'a4',
|
|
|
orientation: 'landscape'
|
|
|
// unit: 'pt', format: [1200, 800], orientation: 'portrait'
|
|
|
}
|
|
|
};
|
|
|
if (!(type !== 'all' || (allStudentWorks === null || allStudentWorks === void 0 ? void 0 : allStudentWorks.length) < 2)) {
|
|
|
_context7.next = 27;
|
|
|
break;
|
|
|
}
|
|
|
handleRemoveSurplusCanvas();
|
|
|
scrollView();
|
|
|
|
|
|
// await new Promise(function (resolve, reject) {
|
|
|
// setMonocoHeight()
|
|
|
// setTimeout(function () {
|
|
|
// resolve('');
|
|
|
// }, 1500);
|
|
|
// });
|
|
|
pages = reportElementInfo.current.children;
|
|
|
worker = html2pdf_default()();
|
|
|
folder = zip.folder("".concat(shixunWorkReport === null || shixunWorkReport === void 0 ? void 0 : shixunWorkReport.username));
|
|
|
_loop = /*#__PURE__*/regeneratorRuntime_default()().mark(function _loop(i) {
|
|
|
return regeneratorRuntime_default()().wrap(function _loop$(_context2) {
|
|
|
while (1) switch (_context2.prev = _context2.next) {
|
|
|
case 0:
|
|
|
_context2.next = 2;
|
|
|
return worker.set(opt).from(pages[i]).toContainer().toCanvas().toPdf().get('pdf').then( /*#__PURE__*/function () {
|
|
|
var _ref3 = asyncToGenerator_default()( /*#__PURE__*/regeneratorRuntime_default()().mark(function _callee(pdf) {
|
|
|
return regeneratorRuntime_default()().wrap(function _callee$(_context) {
|
|
|
while (1) switch (_context.prev = _context.next) {
|
|
|
case 0:
|
|
|
if (!(i < pages.length - 1)) {
|
|
|
_context.next = 3;
|
|
|
break;
|
|
|
}
|
|
|
_context.next = 3;
|
|
|
return pdf.addPage();
|
|
|
case 3:
|
|
|
case "end":
|
|
|
return _context.stop();
|
|
|
}
|
|
|
}, _callee);
|
|
|
}));
|
|
|
return function (_x2) {
|
|
|
return _ref3.apply(this, arguments);
|
|
|
};
|
|
|
}());
|
|
|
case 2:
|
|
|
case "end":
|
|
|
return _context2.stop();
|
|
|
}
|
|
|
}, _loop);
|
|
|
});
|
|
|
i = 0;
|
|
|
case 13:
|
|
|
if (!(i < pages.length)) {
|
|
|
_context7.next = 18;
|
|
|
break;
|
|
|
}
|
|
|
return _context7.delegateYield(_loop(i), "t0", 15);
|
|
|
case 15:
|
|
|
i++;
|
|
|
_context7.next = 13;
|
|
|
break;
|
|
|
case 18:
|
|
|
setIsExportLoading(false);
|
|
|
|
|
|
// zip.file(`${shixunWorkReport.username}.pdf`, pdfUrl);
|
|
|
folder.file("".concat(shixunWorkReport.username, ".pdf"), worker.output("blob"), {
|
|
|
base64: false
|
|
|
});
|
|
|
codeF = folder.folder("代码文件");
|
|
|
shixunWorkReport === null || shixunWorkReport === void 0 || (_shixunWorkReport$shi = shixunWorkReport.shixun_detail) === null || _shixunWorkReport$shi === void 0 || _shixunWorkReport$shi.map(function (item, index) {
|
|
|
var _item$game_codes;
|
|
|
var codesG = codeF.folder("\u7B2C".concat(index + 1, "\u5173-").concat(item.subject, "-").concat(item.id));
|
|
|
item === null || item === void 0 || (_item$game_codes = item.game_codes) === null || _item$game_codes === void 0 || _item$game_codes.map(function (i) {
|
|
|
codesG.file("".concat(i.filename, ".txt"), i === null || i === void 0 ? void 0 : i.content);
|
|
|
});
|
|
|
});
|
|
|
// worker.save()
|
|
|
modal.destroy();
|
|
|
download();
|
|
|
return _context7.abrupt("return");
|
|
|
case 27:
|
|
|
next();
|
|
|
case 28:
|
|
|
case "end":
|
|
|
return _context7.stop();
|
|
|
}
|
|
|
}, _callee5);
|
|
|
}));
|
|
|
return function exportReport(_x) {
|
|
|
return _ref2.apply(this, arguments);
|
|
|
};
|
|
|
}();
|
|
|
var download = function download() {
|
|
|
zip.generateAsync({
|
|
|
type: "blob"
|
|
|
}).then(function (content) {
|
|
|
var link = document.createElement('a');
|
|
|
link.href = window.URL.createObjectURL(content);
|
|
|
link.download = shixunWorkReport.course_name + '.zip';
|
|
|
//此写法兼容可火狐浏览器
|
|
|
document.body.appendChild(link);
|
|
|
var evt = document.createEvent("MouseEvents");
|
|
|
evt.initEvent("click", false, false);
|
|
|
link.dispatchEvent(evt);
|
|
|
document.body.removeChild(link);
|
|
|
setZip(new (jszip_min_default())());
|
|
|
});
|
|
|
setAutoHeight(false);
|
|
|
};
|
|
|
(0,_react_17_0_2_react.useEffect)(function () {
|
|
|
initData();
|
|
|
}, [params.homeworkId]);
|
|
|
var initData = /*#__PURE__*/function () {
|
|
|
var _ref6 = asyncToGenerator_default()( /*#__PURE__*/regeneratorRuntime_default()().mark(function _callee6() {
|
|
|
return regeneratorRuntime_default()().wrap(function _callee6$(_context8) {
|
|
|
while (1) switch (_context8.prev = _context8.next) {
|
|
|
case 0:
|
|
|
setSpinning(true);
|
|
|
_context8.next = 3;
|
|
|
return dispatch({
|
|
|
type: 'shixunHomeworks/getShixunWorkReports',
|
|
|
payload: objectSpread2_default()({}, params)
|
|
|
});
|
|
|
case 3:
|
|
|
setSpinning(false);
|
|
|
if ((0,authority/* isAdmin */.GJ)()) getData();
|
|
|
case 5:
|
|
|
case "end":
|
|
|
return _context8.stop();
|
|
|
}
|
|
|
}, _callee6);
|
|
|
}));
|
|
|
return function initData() {
|
|
|
return _ref6.apply(this, arguments);
|
|
|
};
|
|
|
}();
|
|
|
var columns = [{
|
|
|
title: '题号',
|
|
|
dataIndex: 'name',
|
|
|
render: function render(text, record, index) {
|
|
|
return index + 1;
|
|
|
}
|
|
|
}, {
|
|
|
title: '题目名称',
|
|
|
dataIndex: 'name',
|
|
|
ellipsis: true,
|
|
|
width: '30%'
|
|
|
}, {
|
|
|
title: '完成时间',
|
|
|
dataIndex: 'finish_time',
|
|
|
width: '200px',
|
|
|
render: function render(text, record, index) {
|
|
|
var _record$subitem;
|
|
|
return /*#__PURE__*/(0,jsx_runtime.jsxs)("div", {
|
|
|
children: [/*#__PURE__*/(0,jsx_runtime.jsx)("p", {
|
|
|
children: text || '- -'
|
|
|
}), record === null || record === void 0 || (_record$subitem = record.subitem) === null || _record$subitem === void 0 || (_record$subitem = _record$subitem.map(function (item) {
|
|
|
return item.finish_time;
|
|
|
})) === null || _record$subitem === void 0 ? void 0 : _record$subitem.map(function (ite) {
|
|
|
return /*#__PURE__*/(0,jsx_runtime.jsx)("p", {
|
|
|
children: ite || '- -'
|
|
|
});
|
|
|
})]
|
|
|
});
|
|
|
}
|
|
|
}, {
|
|
|
title: '评测次数',
|
|
|
dataIndex: 'submit_count',
|
|
|
render: function render(text, record, index) {
|
|
|
var _record$subitem2;
|
|
|
return /*#__PURE__*/(0,jsx_runtime.jsxs)("div", {
|
|
|
children: [/*#__PURE__*/(0,jsx_runtime.jsx)("p", {
|
|
|
children: text || '- -'
|
|
|
}), record === null || record === void 0 || (_record$subitem2 = record.subitem) === null || _record$subitem2 === void 0 || (_record$subitem2 = _record$subitem2.map(function (item) {
|
|
|
return item.submit_count;
|
|
|
})) === null || _record$subitem2 === void 0 ? void 0 : _record$subitem2.map(function (ite) {
|
|
|
return /*#__PURE__*/(0,jsx_runtime.jsx)("p", {
|
|
|
children: ite || '- -'
|
|
|
});
|
|
|
})]
|
|
|
});
|
|
|
}
|
|
|
}, {
|
|
|
title: '运行时间(ms)',
|
|
|
dataIndex: 'run_time',
|
|
|
render: function render(text, record, index) {
|
|
|
var _record$subitem3;
|
|
|
return /*#__PURE__*/(0,jsx_runtime.jsxs)("div", {
|
|
|
children: [/*#__PURE__*/(0,jsx_runtime.jsx)("p", {
|
|
|
children: text || '- -'
|
|
|
}), record === null || record === void 0 || (_record$subitem3 = record.subitem) === null || _record$subitem3 === void 0 || (_record$subitem3 = _record$subitem3.map(function (item) {
|
|
|
return item.run_time;
|
|
|
})) === null || _record$subitem3 === void 0 ? void 0 : _record$subitem3.map(function (ite) {
|
|
|
return /*#__PURE__*/(0,jsx_runtime.jsx)("p", {
|
|
|
children: ite || '- -'
|
|
|
});
|
|
|
})]
|
|
|
});
|
|
|
}
|
|
|
}, {
|
|
|
title: '内存(kb)',
|
|
|
dataIndex: 'memory',
|
|
|
render: function render(text, record, index) {
|
|
|
var _record$subitem4;
|
|
|
return /*#__PURE__*/(0,jsx_runtime.jsxs)("div", {
|
|
|
children: [/*#__PURE__*/(0,jsx_runtime.jsx)("p", {
|
|
|
children: text || '- -'
|
|
|
}), record === null || record === void 0 || (_record$subitem4 = record.subitem) === null || _record$subitem4 === void 0 || (_record$subitem4 = _record$subitem4.map(function (item) {
|
|
|
return item.memory;
|
|
|
})) === null || _record$subitem4 === void 0 ? void 0 : _record$subitem4.map(function (ite) {
|
|
|
return /*#__PURE__*/(0,jsx_runtime.jsx)("p", {
|
|
|
children: ite || '- -'
|
|
|
});
|
|
|
})]
|
|
|
});
|
|
|
}
|
|
|
}, {
|
|
|
title: '使用语言',
|
|
|
dataIndex: 'language',
|
|
|
// render: (text: number) => (toTimeFormat(text))
|
|
|
render: function render(text, record, index) {
|
|
|
var _record$subitem5;
|
|
|
return /*#__PURE__*/(0,jsx_runtime.jsxs)("div", {
|
|
|
children: [/*#__PURE__*/(0,jsx_runtime.jsx)("p", {
|
|
|
children: text || '- -'
|
|
|
}), record === null || record === void 0 || (_record$subitem5 = record.subitem) === null || _record$subitem5 === void 0 || (_record$subitem5 = _record$subitem5.map(function (item) {
|
|
|
return item.language;
|
|
|
})) === null || _record$subitem5 === void 0 ? void 0 : _record$subitem5.map(function (ite) {
|
|
|
return /*#__PURE__*/(0,jsx_runtime.jsx)("p", {
|
|
|
children: ite || '- -'
|
|
|
});
|
|
|
})]
|
|
|
});
|
|
|
}
|
|
|
}, {
|
|
|
title: '得分',
|
|
|
dataIndex: 'score',
|
|
|
// render: (text: number) => (toTimeFormat(text))
|
|
|
render: function render(text, record, index) {
|
|
|
return /*#__PURE__*/(0,jsx_runtime.jsx)("div", {
|
|
|
children: /*#__PURE__*/(0,jsx_runtime.jsx)("p", {
|
|
|
children: text || '- -'
|
|
|
})
|
|
|
});
|
|
|
}
|
|
|
}, {
|
|
|
title: '排名',
|
|
|
dataIndex: 'rank',
|
|
|
render: function render(text, record, index) {
|
|
|
var _record$subitem6;
|
|
|
return /*#__PURE__*/(0,jsx_runtime.jsxs)("div", {
|
|
|
children: [/*#__PURE__*/(0,jsx_runtime.jsx)("p", {
|
|
|
children: text || '- -'
|
|
|
}), record === null || record === void 0 || (_record$subitem6 = record.subitem) === null || _record$subitem6 === void 0 || (_record$subitem6 = _record$subitem6.map(function (item) {
|
|
|
return item.rank;
|
|
|
})) === null || _record$subitem6 === void 0 ? void 0 : _record$subitem6.map(function (ite) {
|
|
|
return /*#__PURE__*/(0,jsx_runtime.jsx)("p", {
|
|
|
children: ite || '- -'
|
|
|
});
|
|
|
})]
|
|
|
});
|
|
|
}
|
|
|
}];
|
|
|
var skip = function skip(type) {
|
|
|
dispatch({
|
|
|
type: 'shixunHomeworks/setActionTabs',
|
|
|
payload: {
|
|
|
key: '',
|
|
|
type: 2
|
|
|
}
|
|
|
});
|
|
|
setTimeout(function () {
|
|
|
if (type === 'next') {
|
|
|
_umi_production_exports.history.push("/classrooms/".concat(params.coursesId, "/program_homework/").concat(params.categoryId, "/").concat(nextComment === null || nextComment === void 0 ? void 0 : nextComment.student_work_id, "/").concat(nextComment === null || nextComment === void 0 ? void 0 : nextComment.user_id, "/comment"));
|
|
|
} else {
|
|
|
_umi_production_exports.history.push("/classrooms/".concat(params.coursesId, "/program_homework/").concat(params.categoryId, "/").concat(nextComment === null || nextComment === void 0 ? void 0 : nextComment.student_work_id, "/").concat(Previous === null || Previous === void 0 ? void 0 : Previous.user_id, "/comment"));
|
|
|
}
|
|
|
}, 200);
|
|
|
};
|
|
|
return /*#__PURE__*/(0,jsx_runtime.jsxs)("section", {
|
|
|
className: "bg-fafafa",
|
|
|
style: {
|
|
|
position: "sticky",
|
|
|
top: 0
|
|
|
},
|
|
|
children: [/*#__PURE__*/(0,jsx_runtime.jsx)("div", {
|
|
|
className: "edu-container mt10",
|
|
|
style: {
|
|
|
paddingBottom: 100
|
|
|
},
|
|
|
children: /*#__PURE__*/(0,jsx_runtime.jsxs)(skeleton/* default */.Z, {
|
|
|
loading: spinning,
|
|
|
active: true,
|
|
|
avatar: {
|
|
|
size: 40
|
|
|
},
|
|
|
paragraph: {
|
|
|
rows: 5
|
|
|
},
|
|
|
children: [/*#__PURE__*/(0,jsx_runtime.jsxs)("div", {
|
|
|
className: "edu-container",
|
|
|
children: [(shixunWorkReport === null || shixunWorkReport === void 0 || (_shixunWorkReport$cat = shixunWorkReport.category) === null || _shixunWorkReport$cat === void 0 ? void 0 : _shixunWorkReport$cat.course_id) && /*#__PURE__*/(0,jsx_runtime.jsxs)("section", {
|
|
|
className: "animated fadeIn",
|
|
|
children: [/*#__PURE__*/(0,jsx_runtime.jsx)("aside", {
|
|
|
className: "",
|
|
|
children: (shixunWorkReport === null || shixunWorkReport === void 0 ? void 0 : shixunWorkReport.category) && /*#__PURE__*/(0,jsx_runtime.jsxs)(breadcrumb/* default */.Z, {
|
|
|
separator: ">",
|
|
|
children: [/*#__PURE__*/(0,jsx_runtime.jsx)(breadcrumb/* default */.Z.Item, {
|
|
|
children: /*#__PURE__*/(0,jsx_runtime.jsx)(_umi_production_exports.Link, {
|
|
|
to: "/classrooms/".concat(shixunWorkReport === null || shixunWorkReport === void 0 || (_shixunWorkReport$cat2 = shixunWorkReport.category) === null || _shixunWorkReport$cat2 === void 0 ? void 0 : _shixunWorkReport$cat2.course_id, "/program_homework"),
|
|
|
children: shixunWorkReport === null || shixunWorkReport === void 0 || (_shixunWorkReport$cat3 = shixunWorkReport.category) === null || _shixunWorkReport$cat3 === void 0 ? void 0 : _shixunWorkReport$cat3.course_name
|
|
|
})
|
|
|
}), /*#__PURE__*/(0,jsx_runtime.jsx)(breadcrumb/* default */.Z.Item, {
|
|
|
children: /*#__PURE__*/(0,jsx_runtime.jsx)(_umi_production_exports.Link, {
|
|
|
to: "/classrooms/".concat(shixunWorkReport === null || shixunWorkReport === void 0 || (_shixunWorkReport$cat4 = shixunWorkReport.category) === null || _shixunWorkReport$cat4 === void 0 ? void 0 : _shixunWorkReport$cat4.course_id, "/program_homework"),
|
|
|
children: shixunWorkReport.category.category_name
|
|
|
})
|
|
|
}), /*#__PURE__*/(0,jsx_runtime.jsx)(breadcrumb/* default */.Z.Item, {
|
|
|
children: /*#__PURE__*/(0,jsx_runtime.jsx)(_umi_production_exports.Link, {
|
|
|
to: "/classrooms/".concat(shixunWorkReport === null || shixunWorkReport === void 0 || (_shixunWorkReport$cat5 = shixunWorkReport.category) === null || _shixunWorkReport$cat5 === void 0 ? void 0 : _shixunWorkReport$cat5.course_id, "/program_homework/").concat(params === null || params === void 0 ? void 0 : params.categoryId, "/detail"),
|
|
|
children: "\u4F5C\u4E1A\u8BE6\u60C5"
|
|
|
})
|
|
|
}), /*#__PURE__*/(0,jsx_runtime.jsx)(breadcrumb/* default */.Z.Item, {
|
|
|
children: shixunWorkReport === null || shixunWorkReport === void 0 || (_shixunWorkReport$dat = shixunWorkReport.data) === null || _shixunWorkReport$dat === void 0 ? void 0 : _shixunWorkReport$dat.user_name
|
|
|
})]
|
|
|
})
|
|
|
}), /*#__PURE__*/(0,jsx_runtime.jsx)("aside", {
|
|
|
className: [Commentmodules.title1, 'mt20'].join(' '),
|
|
|
children: /*#__PURE__*/(0,jsx_runtime.jsx)(row/* default */.Z, {
|
|
|
align: "middle",
|
|
|
children: /*#__PURE__*/(0,jsx_runtime.jsxs)(col/* default */.Z, {
|
|
|
flex: 1,
|
|
|
children: [/*#__PURE__*/(0,jsx_runtime.jsx)(_umi_production_exports.Link, {
|
|
|
to: "/classrooms/".concat(params.coursesId, "/program_homework/").concat(params === null || params === void 0 ? void 0 : params.categoryId, "/detail"),
|
|
|
children: /*#__PURE__*/(0,jsx_runtime.jsx)(ArrowLeftOutlined/* default */.Z, {
|
|
|
className: "font16 c-black"
|
|
|
})
|
|
|
}), /*#__PURE__*/(0,jsx_runtime.jsx)("strong", {
|
|
|
className: "font20 ml5",
|
|
|
children: shixunWorkReport === null || shixunWorkReport === void 0 || (_shixunWorkReport$cat6 = shixunWorkReport.category) === null || _shixunWorkReport$cat6 === void 0 ? void 0 : _shixunWorkReport$cat6.homework_name
|
|
|
}), /*#__PURE__*/(0,jsx_runtime.jsx)(util/* StatusClassroomsTags */.VV, {
|
|
|
temporary: true,
|
|
|
status: shixunWorkReport.homework_status
|
|
|
})]
|
|
|
})
|
|
|
})
|
|
|
})]
|
|
|
}), /*#__PURE__*/(0,jsx_runtime.jsx)("aside", {
|
|
|
className: "mt30 relative"
|
|
|
})]
|
|
|
}), /*#__PURE__*/(0,jsx_runtime.jsx)("aside", {
|
|
|
className: "edu-container bg-white",
|
|
|
ref: reportElement,
|
|
|
children: /*#__PURE__*/(0,jsx_runtime.jsxs)("div", {
|
|
|
id: "export-all",
|
|
|
ref: reportElementInfo,
|
|
|
children: [/*#__PURE__*/(0,jsx_runtime.jsxs)("div", {
|
|
|
id: "export-all-1",
|
|
|
children: [/*#__PURE__*/(0,jsx_runtime.jsxs)("div", {
|
|
|
className: Commentmodules.title,
|
|
|
children: [/*#__PURE__*/(0,jsx_runtime.jsx)("h1", {
|
|
|
children: "\u603B\u4F53\u8BC4\u4EF7"
|
|
|
}), /*#__PURE__*/(0,jsx_runtime.jsx)("div", {
|
|
|
children: (0,authority/* isAdmin */.GJ)() && /*#__PURE__*/(0,jsx_runtime.jsxs)(es_button/* default */.ZP, {
|
|
|
className: "mr20",
|
|
|
type: "primary",
|
|
|
onClick: function onClick() {
|
|
|
dispatch({
|
|
|
type: 'shixunHomeworks/setActionTabs',
|
|
|
payload: {
|
|
|
key: "更改点评",
|
|
|
selectArrs: {
|
|
|
myshixun_identifier: shixunWorkReport.user_id,
|
|
|
data: objectSpread2_default()({}, shixunWorkReport)
|
|
|
}
|
|
|
}
|
|
|
});
|
|
|
},
|
|
|
children: [/*#__PURE__*/(0,jsx_runtime.jsx)(SolutionOutlined/* default */.Z, {}), shixunWorkReport !== null && shixunWorkReport !== void 0 && (_shixunWorkReport$dat2 = shixunWorkReport.data) !== null && _shixunWorkReport$dat2 !== void 0 && _shixunWorkReport$dat2.has_comment ? "更改点评" : "点评作业"]
|
|
|
})
|
|
|
})]
|
|
|
}), /*#__PURE__*/(0,jsx_runtime.jsx)(divider/* default */.Z, {
|
|
|
style: {
|
|
|
marginTop: 0
|
|
|
}
|
|
|
}), /*#__PURE__*/(0,jsx_runtime.jsxs)(row/* default */.Z, {
|
|
|
className: "pl30 pr30",
|
|
|
children: [/*#__PURE__*/(0,jsx_runtime.jsx)(col/* default */.Z, {
|
|
|
children: /*#__PURE__*/(0,jsx_runtime.jsx)("img", {
|
|
|
className: Commentmodules.userPic,
|
|
|
src: "".concat(env/* default */.Z.IMG_SERVER, "/images/").concat(shixunWorkReport === null || shixunWorkReport === void 0 || (_shixunWorkReport$dat3 = shixunWorkReport.data) === null || _shixunWorkReport$dat3 === void 0 ? void 0 : _shixunWorkReport$dat3.image_url),
|
|
|
alt: shixunWorkReport === null || shixunWorkReport === void 0 || (_shixunWorkReport$dat4 = shixunWorkReport.data) === null || _shixunWorkReport$dat4 === void 0 ? void 0 : _shixunWorkReport$dat4.username
|
|
|
})
|
|
|
}), /*#__PURE__*/(0,jsx_runtime.jsxs)(col/* default */.Z, {
|
|
|
children: [/*#__PURE__*/(0,jsx_runtime.jsx)("span", {
|
|
|
className: "font16 ml40",
|
|
|
children: shixunWorkReport === null || shixunWorkReport === void 0 || (_shixunWorkReport$dat5 = shixunWorkReport.data) === null || _shixunWorkReport$dat5 === void 0 ? void 0 : _shixunWorkReport$dat5.user_name
|
|
|
}), /*#__PURE__*/(0,jsx_runtime.jsx)(util/* HomeWorkDetailStatus */.UQ, {
|
|
|
status: shixunWorkReport === null || shixunWorkReport === void 0 || (_shixunWorkReport$dat6 = shixunWorkReport.data) === null || _shixunWorkReport$dat6 === void 0 ? void 0 : _shixunWorkReport$dat6.compelete_status
|
|
|
}), /*#__PURE__*/(0,jsx_runtime.jsxs)("ul", {
|
|
|
className: Commentmodules.userInfo,
|
|
|
children: [/*#__PURE__*/(0,jsx_runtime.jsxs)("li", {
|
|
|
children: ["\u5B66\u53F7\uFF1A", (shixunWorkReport === null || shixunWorkReport === void 0 || (_shixunWorkReport$dat7 = shixunWorkReport.data) === null || _shixunWorkReport$dat7 === void 0 ? void 0 : _shixunWorkReport$dat7.student_id) || '--']
|
|
|
}), /*#__PURE__*/(0,jsx_runtime.jsxs)("li", {
|
|
|
children: ["\u5206\u73ED\uFF1A", (shixunWorkReport === null || shixunWorkReport === void 0 || (_shixunWorkReport$dat8 = shixunWorkReport.data) === null || _shixunWorkReport$dat8 === void 0 ? void 0 : _shixunWorkReport$dat8.course_group) || '--']
|
|
|
}), /*#__PURE__*/(0,jsx_runtime.jsx)("br", {}), /*#__PURE__*/(0,jsx_runtime.jsxs)("li", {
|
|
|
children: ["\u622A\u6B62\u524D\u5B8C\u6210\u5237\u9898\uFF1A", /*#__PURE__*/(0,jsx_runtime.jsx)("span", {
|
|
|
className: "c-red",
|
|
|
children: shixunWorkReport === null || shixunWorkReport === void 0 || (_shixunWorkReport$dat9 = shixunWorkReport.data) === null || _shixunWorkReport$dat9 === void 0 ? void 0 : _shixunWorkReport$dat9.finish_do
|
|
|
})]
|
|
|
}), /*#__PURE__*/(0,jsx_runtime.jsxs)("li", {
|
|
|
children: ["\u6700\u65B0\u5B8C\u6210\u5237\u9898\uFF1A", /*#__PURE__*/(0,jsx_runtime.jsx)("span", {
|
|
|
className: "c-red",
|
|
|
children: (shixunWorkReport === null || shixunWorkReport === void 0 || (_shixunWorkReport$dat10 = shixunWorkReport.data) === null || _shixunWorkReport$dat10 === void 0 ? void 0 : _shixunWorkReport$dat10.latest_do) || '-'
|
|
|
})]
|
|
|
})]
|
|
|
})]
|
|
|
}), /*#__PURE__*/(0,jsx_runtime.jsxs)("ul", {
|
|
|
className: [Commentmodules.listItem, 'mt10'].join(' '),
|
|
|
children: [/*#__PURE__*/(0,jsx_runtime.jsxs)("li", {
|
|
|
children: [/*#__PURE__*/(0,jsx_runtime.jsx)("strong", {
|
|
|
children: "\u5B8C\u6210\u65F6\u95F4"
|
|
|
}), /*#__PURE__*/(0,jsx_runtime.jsx)("div", {
|
|
|
className: "c-light-black mt20",
|
|
|
children: (shixunWorkReport === null || shixunWorkReport === void 0 ? void 0 : shixunWorkReport.data) && (shixunWorkReport === null || shixunWorkReport === void 0 || (_shixunWorkReport$dat11 = shixunWorkReport.data) === null || _shixunWorkReport$dat11 === void 0 ? void 0 : _shixunWorkReport$dat11.finish_time)
|
|
|
})]
|
|
|
}), /*#__PURE__*/(0,jsx_runtime.jsxs)("li", {
|
|
|
children: [/*#__PURE__*/(0,jsx_runtime.jsxs)("strong", {
|
|
|
children: ["\u5B8C\u6210\u65F6\u957F", /*#__PURE__*/(0,jsx_runtime.jsx)("i", {
|
|
|
onClick: function onClick(e) {
|
|
|
e.stopPropagation();
|
|
|
e.preventDefault();
|
|
|
setIsshows(true);
|
|
|
},
|
|
|
style: {
|
|
|
marginLeft: 4,
|
|
|
display: 'none',
|
|
|
color: '#145DFF',
|
|
|
fontSize: 16,
|
|
|
cursor: 'pointer'
|
|
|
},
|
|
|
className: "iconfont icon-tishixiaowenhao"
|
|
|
})]
|
|
|
}), /*#__PURE__*/(0,jsx_runtime.jsx)("div", {
|
|
|
className: "c-light-black mt20",
|
|
|
children: shixunWorkReport === null || shixunWorkReport === void 0 || (_shixunWorkReport$dat12 = shixunWorkReport.data) === null || _shixunWorkReport$dat12 === void 0 ? void 0 : _shixunWorkReport$dat12.finish_time_long
|
|
|
})]
|
|
|
}), /*#__PURE__*/(0,jsx_runtime.jsxs)("li", {
|
|
|
children: [/*#__PURE__*/(0,jsx_runtime.jsx)("strong", {
|
|
|
children: "\u8BC4\u6D4B\u6B21\u6570"
|
|
|
}), /*#__PURE__*/(0,jsx_runtime.jsx)("div", {
|
|
|
className: "mt20",
|
|
|
children: shixunWorkReport === null || shixunWorkReport === void 0 || (_shixunWorkReport$dat13 = shixunWorkReport.data) === null || _shixunWorkReport$dat13 === void 0 ? void 0 : _shixunWorkReport$dat13.submit_count
|
|
|
})]
|
|
|
}), /*#__PURE__*/(0,jsx_runtime.jsxs)("li", {
|
|
|
children: [/*#__PURE__*/(0,jsx_runtime.jsx)("strong", {
|
|
|
children: "\u901A\u8FC7\u7387"
|
|
|
}), /*#__PURE__*/(0,jsx_runtime.jsx)("div", {
|
|
|
className: "mt20",
|
|
|
children: /*#__PURE__*/(0,jsx_runtime.jsx)("span", {
|
|
|
children: (shixunWorkReport === null || shixunWorkReport === void 0 || (_shixunWorkReport$dat14 = shixunWorkReport.data) === null || _shixunWorkReport$dat14 === void 0 ? void 0 : _shixunWorkReport$dat14.pass_rate) || '- -'
|
|
|
})
|
|
|
})]
|
|
|
}), /*#__PURE__*/(0,jsx_runtime.jsxs)("li", {
|
|
|
children: [/*#__PURE__*/(0,jsx_runtime.jsx)("strong", {
|
|
|
children: "\u5F97\u5206"
|
|
|
}), /*#__PURE__*/(0,jsx_runtime.jsx)("div", {
|
|
|
className: "mt20",
|
|
|
children: /*#__PURE__*/(0,jsx_runtime.jsx)("span", {
|
|
|
className: "c-orange",
|
|
|
children: shixunWorkReport === null || shixunWorkReport === void 0 || (_shixunWorkReport$dat15 = shixunWorkReport.data) === null || _shixunWorkReport$dat15 === void 0 ? void 0 : _shixunWorkReport$dat15.score
|
|
|
})
|
|
|
})]
|
|
|
}), /*#__PURE__*/(0,jsx_runtime.jsxs)("li", {
|
|
|
children: [/*#__PURE__*/(0,jsx_runtime.jsx)("strong", {
|
|
|
children: "\u7EC3\u4E60\u603B\u6392\u540D"
|
|
|
}), /*#__PURE__*/(0,jsx_runtime.jsx)("div", {
|
|
|
className: "mt20",
|
|
|
children: /*#__PURE__*/(0,jsx_runtime.jsx)("span", {
|
|
|
className: "c-orange",
|
|
|
children: shixunWorkReport === null || shixunWorkReport === void 0 || (_shixunWorkReport$dat16 = shixunWorkReport.data) === null || _shixunWorkReport$dat16 === void 0 ? void 0 : _shixunWorkReport$dat16.total_rank
|
|
|
})
|
|
|
})]
|
|
|
}), /*#__PURE__*/(0,jsx_runtime.jsxs)("li", {
|
|
|
children: [/*#__PURE__*/(0,jsx_runtime.jsx)("strong", {
|
|
|
children: "\u5206\u73ED\u6392\u540D"
|
|
|
}), /*#__PURE__*/(0,jsx_runtime.jsx)("div", {
|
|
|
className: "mt20",
|
|
|
children: /*#__PURE__*/(0,jsx_runtime.jsx)("span", {
|
|
|
className: "c-orange",
|
|
|
children: shixunWorkReport === null || shixunWorkReport === void 0 || (_shixunWorkReport$dat17 = shixunWorkReport.data) === null || _shixunWorkReport$dat17 === void 0 ? void 0 : _shixunWorkReport$dat17.class_rank
|
|
|
})
|
|
|
})]
|
|
|
})]
|
|
|
})]
|
|
|
}), /*#__PURE__*/(0,jsx_runtime.jsx)(divider/* default */.Z, {
|
|
|
style: {
|
|
|
margin: 0
|
|
|
}
|
|
|
}), ((shixunWorkReport === null || shixunWorkReport === void 0 || (_shixunWorkReport$dat18 = shixunWorkReport.data) === null || _shixunWorkReport$dat18 === void 0 ? void 0 : _shixunWorkReport$dat18.work_comment_hidden) || (shixunWorkReport === null || shixunWorkReport === void 0 || (_shixunWorkReport$dat19 = shixunWorkReport.data) === null || _shixunWorkReport$dat19 === void 0 ? void 0 : _shixunWorkReport$dat19.work_comment)) && /*#__PURE__*/(0,jsx_runtime.jsxs)("div", {
|
|
|
children: [/*#__PURE__*/(0,jsx_runtime.jsxs)(row/* default */.Z, {
|
|
|
align: "middle",
|
|
|
children: [/*#__PURE__*/(0,jsx_runtime.jsx)(col/* default */.Z, {
|
|
|
flex: 1,
|
|
|
children: /*#__PURE__*/(0,jsx_runtime.jsx)("h1", {
|
|
|
className: Commentmodules.title,
|
|
|
children: "\u70B9\u8BC4\u5185\u5BB9"
|
|
|
})
|
|
|
}), /*#__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 _callee8() {
|
|
|
return regeneratorRuntime_default()().wrap(function _callee8$(_context10) {
|
|
|
while (1) switch (_context10.prev = _context10.next) {
|
|
|
case 0:
|
|
|
es_modal/* default */.Z.confirm({
|
|
|
centered: true,
|
|
|
okText: '确定',
|
|
|
cancelText: '取消',
|
|
|
title: '提示',
|
|
|
icon: /*#__PURE__*/(0,jsx_runtime.jsx)(ExclamationCircleOutlined/* default */.Z, {}),
|
|
|
content: '是否确认删除?',
|
|
|
onOk: function onOk() {
|
|
|
return asyncToGenerator_default()( /*#__PURE__*/regeneratorRuntime_default()().mark(function _callee7() {
|
|
|
var _shixunWorkReport$dat20;
|
|
|
var res;
|
|
|
return regeneratorRuntime_default()().wrap(function _callee7$(_context9) {
|
|
|
while (1) switch (_context9.prev = _context9.next) {
|
|
|
case 0:
|
|
|
_context9.next = 2;
|
|
|
return (0,service_shixunHomeworks/* deleteStudentWorkScoreCommit */.gZ)({
|
|
|
comment_id: shixunWorkReport === null || shixunWorkReport === void 0 || (_shixunWorkReport$dat20 = shixunWorkReport.data) === null || _shixunWorkReport$dat20 === void 0 ? void 0 : _shixunWorkReport$dat20.comment_id,
|
|
|
homeworkId: params.homeworkId
|
|
|
});
|
|
|
case 2:
|
|
|
res = _context9.sent;
|
|
|
if (res.status === 0) {
|
|
|
message/* default */.ZP.success("删除成功");
|
|
|
dispatch({
|
|
|
type: 'shixunHomeworks/getShixunWorkReports',
|
|
|
payload: objectSpread2_default()({}, params)
|
|
|
});
|
|
|
}
|
|
|
case 4:
|
|
|
case "end":
|
|
|
return _context9.stop();
|
|
|
}
|
|
|
}, _callee7);
|
|
|
}))();
|
|
|
}
|
|
|
});
|
|
|
case 1:
|
|
|
case "end":
|
|
|
return _context10.stop();
|
|
|
}
|
|
|
}, _callee8);
|
|
|
})),
|
|
|
children: [/*#__PURE__*/(0,jsx_runtime.jsx)(DeleteOutlined/* default */.Z, {}), "\u5220\u9664"]
|
|
|
})
|
|
|
})]
|
|
|
}), /*#__PURE__*/(0,jsx_runtime.jsx)(divider/* default */.Z, {
|
|
|
style: {
|
|
|
margin: 0
|
|
|
}
|
|
|
}), (shixunWorkReport === null || shixunWorkReport === void 0 || (_shixunWorkReport$dat21 = shixunWorkReport.data) === null || _shixunWorkReport$dat21 === void 0 ? void 0 : _shixunWorkReport$dat21.work_comment) && /*#__PURE__*/(0,jsx_runtime.jsxs)("aside", {
|
|
|
className: "pl30 pr30 mt20",
|
|
|
children: [/*#__PURE__*/(0,jsx_runtime.jsx)("span", {
|
|
|
className: "c-light-black font12",
|
|
|
children: "# \u5B66\u751F\u548C\u8BFE\u5802\u8001\u5E08\u53EF\u89C1"
|
|
|
}), /*#__PURE__*/(0,jsx_runtime.jsx)("br", {}), /*#__PURE__*/(0,jsx_runtime.jsx)(RenderHtml/* default */.Z, {
|
|
|
value: shixunWorkReport === null || shixunWorkReport === void 0 || (_shixunWorkReport$dat22 = shixunWorkReport.data) === null || _shixunWorkReport$dat22 === void 0 ? void 0 : _shixunWorkReport$dat22.work_comment
|
|
|
})]
|
|
|
}), (shixunWorkReport === null || shixunWorkReport === void 0 || (_shixunWorkReport$dat23 = shixunWorkReport.data) === null || _shixunWorkReport$dat23 === void 0 ? void 0 : _shixunWorkReport$dat23.work_comment_hidden) && /*#__PURE__*/(0,jsx_runtime.jsxs)("aside", {
|
|
|
className: "pl30 pr30 mt20",
|
|
|
children: [/*#__PURE__*/(0,jsx_runtime.jsx)("span", {
|
|
|
className: "c-light-black font12",
|
|
|
children: "# \u4EC5\u8BFE\u5802\u8001\u5E08\u53EF\u89C1"
|
|
|
}), /*#__PURE__*/(0,jsx_runtime.jsx)("br", {}), /*#__PURE__*/(0,jsx_runtime.jsx)(RenderHtml/* default */.Z, {
|
|
|
value: shixunWorkReport === null || shixunWorkReport === void 0 || (_shixunWorkReport$dat24 = shixunWorkReport.data) === null || _shixunWorkReport$dat24 === void 0 ? void 0 : _shixunWorkReport$dat24.work_comment_hidden
|
|
|
})]
|
|
|
})]
|
|
|
}), /*#__PURE__*/(0,jsx_runtime.jsx)("h1", {
|
|
|
className: Commentmodules.title,
|
|
|
children: "\u9636\u6BB5\u6210\u7EE9"
|
|
|
}), /*#__PURE__*/(0,jsx_runtime.jsx)("aside", {
|
|
|
className: "pl30 pr30",
|
|
|
children: /*#__PURE__*/(0,jsx_runtime.jsx)(table/* default */.Z, {
|
|
|
dataSource: shixunWorkReport === null || shixunWorkReport === void 0 ? void 0 : shixunWorkReport.hack,
|
|
|
pagination: false,
|
|
|
columns: columns
|
|
|
})
|
|
|
}), (shixunWorkReport === null || shixunWorkReport === void 0 || (_shixunWorkReport$dat25 = shixunWorkReport.data) === null || _shixunWorkReport$dat25 === void 0 ? void 0 : _shixunWorkReport$dat25.work_description) && /*#__PURE__*/(0,jsx_runtime.jsxs)(jsx_runtime.Fragment, {
|
|
|
children: [/*#__PURE__*/(0,jsx_runtime.jsx)("h1", {
|
|
|
className: Commentmodules.title,
|
|
|
children: "\u4E2A\u4EBA\u603B\u7ED3"
|
|
|
}), /*#__PURE__*/(0,jsx_runtime.jsx)("aside", {
|
|
|
className: "pl30 pr30",
|
|
|
children: /*#__PURE__*/(0,jsx_runtime.jsx)(RenderHtml/* default */.Z, {
|
|
|
value: shixunWorkReport === null || shixunWorkReport === void 0 || (_shixunWorkReport$dat26 = shixunWorkReport.data) === null || _shixunWorkReport$dat26 === void 0 ? void 0 : _shixunWorkReport$dat26.work_description
|
|
|
})
|
|
|
})]
|
|
|
}), /*#__PURE__*/(0,jsx_runtime.jsx)("h1", {
|
|
|
className: Commentmodules.title,
|
|
|
children: "\u5237\u9898\u8BE6\u60C5"
|
|
|
})]
|
|
|
}), /*#__PURE__*/(0,jsx_runtime.jsx)(ShixunStatic, {
|
|
|
autoHeight: autoHeight
|
|
|
})]
|
|
|
})
|
|
|
}), (0,authority/* isAdmin */.GJ)() && /*#__PURE__*/(0,jsx_runtime.jsx)("aside", {
|
|
|
className: "".concat(Commentmodules.footerBar, " ").concat(isExportLoading ? Commentmodules.footerBarStatic : ''),
|
|
|
children: /*#__PURE__*/(0,jsx_runtime.jsx)("aside", {
|
|
|
className: "edu-container",
|
|
|
children: /*#__PURE__*/(0,jsx_runtime.jsxs)(row/* default */.Z, {
|
|
|
align: "middle",
|
|
|
children: [/*#__PURE__*/(0,jsx_runtime.jsx)(col/* default */.Z, {
|
|
|
flex: "1",
|
|
|
children: /*#__PURE__*/(0,jsx_runtime.jsx)(_umi_production_exports.Link, {
|
|
|
className: Commentmodules.exitComment,
|
|
|
to: "/classrooms/".concat(params.coursesId, "/program_homework/").concat(params.categoryId, "/detail"),
|
|
|
children: "\u8FD4\u56DE\u5217\u8868"
|
|
|
})
|
|
|
}), /*#__PURE__*/(0,jsx_runtime.jsx)(col/* default */.Z, {
|
|
|
flex: "1",
|
|
|
className: "tr",
|
|
|
children: (0,authority/* isAdmin */.GJ)() && /*#__PURE__*/(0,jsx_runtime.jsx)(es_button/* default */.ZP, {
|
|
|
type: "primary",
|
|
|
onClick: /*#__PURE__*/asyncToGenerator_default()( /*#__PURE__*/regeneratorRuntime_default()().mark(function _callee9() {
|
|
|
var _classroomList$Assist;
|
|
|
return regeneratorRuntime_default()().wrap(function _callee9$(_context11) {
|
|
|
while (1) switch (_context11.prev = _context11.next) {
|
|
|
case 0:
|
|
|
if (!(!((_classroomList$Assist = classroomList.AssistantObject.hack) !== null && _classroomList$Assist !== void 0 && _classroomList$Assist.can_appraise) && (0,authority/* isAssistant */.Rm)())) {
|
|
|
_context11.next = 3;
|
|
|
break;
|
|
|
}
|
|
|
message/* default */.ZP.warning('您未获取此权限,需向管理员申请权限才能使用此功能');
|
|
|
return _context11.abrupt("return");
|
|
|
case 3:
|
|
|
dispatch({
|
|
|
type: 'shixunHomeworks/setActionTabs',
|
|
|
payload: {
|
|
|
key: "更改点评",
|
|
|
selectArrs: {
|
|
|
myshixun_identifier: shixunWorkReport.user_id,
|
|
|
data: objectSpread2_default()({}, shixunWorkReport)
|
|
|
}
|
|
|
}
|
|
|
});
|
|
|
case 4:
|
|
|
case "end":
|
|
|
return _context11.stop();
|
|
|
}
|
|
|
}, _callee9);
|
|
|
})),
|
|
|
children: "\u70B9\u8BC4\u4F5C\u4E1A"
|
|
|
})
|
|
|
})]
|
|
|
})
|
|
|
})
|
|
|
})]
|
|
|
})
|
|
|
}), /*#__PURE__*/(0,jsx_runtime.jsx)(ChangeCommit, {}), /*#__PURE__*/(0,jsx_runtime.jsx)(Redo/* default */.Z, {}), /*#__PURE__*/(0,jsx_runtime.jsxs)(es_modal/* default */.Z, {
|
|
|
open: isshow,
|
|
|
width: 860,
|
|
|
centered: true,
|
|
|
onCancel: function onCancel() {
|
|
|
setIsshow(false);
|
|
|
},
|
|
|
title: "\u8BA1\u65F6\u89C4\u5219\u8BF4\u660E",
|
|
|
footer: null,
|
|
|
children: [/*#__PURE__*/(0,jsx_runtime.jsxs)("div", {
|
|
|
style: {
|
|
|
color: '#333333',
|
|
|
fontWeight: 400
|
|
|
},
|
|
|
children: [/*#__PURE__*/(0,jsx_runtime.jsx)("span", {
|
|
|
style: {
|
|
|
fontWeight: 500
|
|
|
},
|
|
|
children: "1\u3001\u9875\u9762\u505C\u7559\u65F6\u957F"
|
|
|
}), /*#__PURE__*/(0,jsx_runtime.jsx)("br", {}), /*#__PURE__*/(0,jsx_runtime.jsx)("span", {
|
|
|
children: "\u5B66\u751F\u8FDB\u5165\u5173\u5361\u7684\u7B54\u9898\u9875\u9762\u5F00\u59CB\u8BA1\u65F6\uFF0C\u76F4\u81F3\u5B66\u751F\u5173\u5361\u8BC4\u6D4B\u901A\u8FC7\uFF0C\u5219\u8BA1\u65F6\u7ED3\u675F\uFF1B"
|
|
|
}), /*#__PURE__*/(0,jsx_runtime.jsx)("br", {}), /*#__PURE__*/(0,jsx_runtime.jsx)("span", {
|
|
|
children: " \u5B66\u751F\u8FDB\u5165\u5173\u5361\u7684\u7B54\u9898\u9875\u9762\u5F00\u59CB\u8BA1\u65F6\uFF0C\u82E5\u5B66\u751F\u5173\u95ED/\u9000\u51FA\u7B54\u9898\u9875\u9762\uFF0C\u5219\u8BA1\u65F6\u6682\u505C\uFF0C\u518D\u6B21\u8FDB\u5165\u7B54\u9898\u9875\u9762\u65F6\u5F00\u59CB\u7D2F\u8BA1\u8BA1\u65F6\u76F4\u81F3\u8BC4\u6D4B\u901A\u8FC7\uFF0C\u5219\u8BA1\u65F6\u7ED3\u675F\uFF1B"
|
|
|
}), /*#__PURE__*/(0,jsx_runtime.jsx)("span", {
|
|
|
style: {
|
|
|
color: '#FA6400',
|
|
|
display: 'flex',
|
|
|
height: 34,
|
|
|
alignItems: 'center'
|
|
|
},
|
|
|
children: " \u53EF\u80FD\u4F1A\u9020\u6210\u65F6\u957F\u8BC4\u4F30\u4E0E\u5B9E\u9645\u505A\u9898\u80FD\u529B\u4E0D\u7B26\u7684\u60C5\u51B5 "
|
|
|
}), /*#__PURE__*/(0,jsx_runtime.jsx)("span", {
|
|
|
children: "a\u3001\u5B66\u751F\u8FDB\u5165\u5173\u5361\u770B\u5B8C\u9898\u540E\uFF0C\u9000\u51FA\u7B54\u9898\u9875\u9762\u5B8C\u6210\u4EE3\u7801\u8BBE\u8BA1\uFF0C\u518D\u590D\u5236\u8FDB\u5E73\u53F0\u7B54\u9898\u9875\u9762\u8FDB\u884C\u8BC4\u6D4B\uFF0C\u65E0\u6CD5\u8BC4\u4F30\u5B66\u751F\u7684\u5B66\u4E60\u548C\u601D\u8003\u65F6\u95F4\u3002"
|
|
|
})]
|
|
|
}), /*#__PURE__*/(0,jsx_runtime.jsxs)("div", {
|
|
|
style: {
|
|
|
color: '#333333',
|
|
|
marginTop: 20,
|
|
|
fontWeight: 400
|
|
|
},
|
|
|
children: [/*#__PURE__*/(0,jsx_runtime.jsx)("span", {
|
|
|
style: {
|
|
|
fontWeight: 500
|
|
|
},
|
|
|
children: "2\u3001\u5173\u5361\u603B\u8017\u65F6"
|
|
|
}), /*#__PURE__*/(0,jsx_runtime.jsx)("br", {}), /*#__PURE__*/(0,jsx_runtime.jsx)("span", {
|
|
|
style: {},
|
|
|
children: "\u5B66\u751F\u7B2C\u4E00\u6B21\u8FDB\u5165\u5173\u5361\u7B54\u9898\u9875\u9762\u5F00\u59CB\u8BA1\u65F6\uFF0C\u76F4\u81F3\u8BE5\u5173\u5361\u8BC4\u6D4B\u901A\u8FC7\uFF0C\u5219\u8BA1\u65F6\u7ED3\u675F\u3002 "
|
|
|
}), /*#__PURE__*/(0,jsx_runtime.jsx)("br", {}), /*#__PURE__*/(0,jsx_runtime.jsx)("span", {
|
|
|
children: " \u53E6\uFF0C\u5373\u4F7F\u5173\u5361\u95EF\u5173\u8FC7\u7A0B\u4E2D\uFF0C\u5B66\u751F\u9000\u51FA/\u5173\u95ED\u7B54\u9898\u9875\u9762\uFF0C\u4E5F\u5C06\u6301\u7EED\u8BA1\u65F6\uFF0C\u76F4\u81F3\u8BE5\u5173\u5361\u901A\u8FC7\u3002"
|
|
|
}), /*#__PURE__*/(0,jsx_runtime.jsx)("span", {
|
|
|
style: {
|
|
|
color: '#FA6400',
|
|
|
display: 'flex',
|
|
|
height: 44,
|
|
|
paddingTop: 10
|
|
|
},
|
|
|
children: " \u53EF\u80FD\u4F1A\u9020\u6210\u65F6\u957F\u8BC4\u4F30\u4E0E\u5B9E\u9645\u505A\u9898\u80FD\u529B\u4E0D\u7B26\u7684\u60C5\u51B5 "
|
|
|
}), /*#__PURE__*/(0,jsx_runtime.jsx)("span", {
|
|
|
children: "a\u3001\u5B66\u751F\u4ECE\u5176\u4ED6\u540C\u5B66\u5904\u770B\u5230\u9898\u76EE\u540E\uFF0C\u5B8C\u6210\u4EE3\u7801\u8BBE\u8BA1\uFF0C\u518D\u8FDB\u5165\u5173\u5361\u7B54\u9898\u9875\u9762\uFF0C\u5C06\u5DF2\u5B8C\u6210\u7684\u4EE3\u7801\u590D\u5236\u81F3\u5E73\u53F0\u8FDB\u884C\u8BC4\u6D4B\uFF1B"
|
|
|
}), /*#__PURE__*/(0,jsx_runtime.jsx)("br", {}), /*#__PURE__*/(0,jsx_runtime.jsx)("span", {
|
|
|
children: "b\u3001\u5B66\u751F\u7B2C\u4E00\u6B21\u6253\u5F00\u5173\u5361\u540E\uFF0C\u56E0\u4E3A\u67D0\u79CD\u539F\u56E0\u79BB\u5F00\u9875\u9762\uFF0C\u65F6\u9694\u591A\u65E5\u624D\u518D\u6B21\u8FDB\u5165\u5E73\u53F0\u95EF\u5173\uFF0C\u5C31\u4F1A\u5BFC\u81F4\u5B66\u751F\u5173\u5361\u603B\u8017\u65F6\u8FC7\u957F\uFF1B"
|
|
|
})]
|
|
|
}), /*#__PURE__*/(0,jsx_runtime.jsxs)("div", {
|
|
|
style: {
|
|
|
color: '#333333',
|
|
|
marginTop: 20,
|
|
|
fontWeight: 400
|
|
|
},
|
|
|
children: [/*#__PURE__*/(0,jsx_runtime.jsx)("span", {
|
|
|
style: {
|
|
|
fontWeight: 500
|
|
|
},
|
|
|
children: "3\u3001\u4F5C\u4E1A\u901A\u5173\u65F6\u957F"
|
|
|
}), /*#__PURE__*/(0,jsx_runtime.jsx)("br", {}), /*#__PURE__*/(0,jsx_runtime.jsx)("span", {
|
|
|
style: {},
|
|
|
children: "\u4ECE\u8001\u5E08\u53D1\u5E03\u7684\u5B9E\u8BAD\u4F5C\u4E1A\u5F00\u59CB\u65F6\u95F4\uFF0C\u5F00\u59CB\u8BA1\u65F6\uFF0C\u76F4\u81F3\u5B66\u751F\u5B9E\u8BAD\u901A\u5173\uFF08\u5305\u62EC\u8FDF\u4EA4\u901A\u5173\uFF09\uFF0C\u7ED3\u675F\u8BA1\u65F6\u3002\u5982\u679C\u5B66\u751F\u672A\u901A\u5173\uFF0C\u5219\u8BE5\u751F\u7684\u95EF\u5173\u8017\u65F6\u4E3A\u8001\u5E08\u8BBE\u7F6E\u7684\u5B9E\u8BAD\u5F00\u59CB\u65F6\u95F4\u81F3\u5B9E\u8BAD\u622A\u6B62\u65F6\u95F4\uFF0C\u5982\u679C\u8001\u5E08\u5F00\u542F\u4E86\u8865\u4EA4\uFF0C\u5219\u8BE5\u751F\u7684\u95EF\u5173\u8017\u65F6\u4E3A\u5B9E\u8BAD\u5F00\u59CB\u65F6\u95F4\u81F3\u5B9E\u8BAD\u8865\u4EA4\u622A\u6B62\u65F6\u95F4\u3002"
|
|
|
})]
|
|
|
}), /*#__PURE__*/(0,jsx_runtime.jsxs)("div", {
|
|
|
style: {
|
|
|
color: '#333333',
|
|
|
marginTop: 20,
|
|
|
fontWeight: 400
|
|
|
},
|
|
|
children: [/*#__PURE__*/(0,jsx_runtime.jsx)("span", {
|
|
|
style: {
|
|
|
fontWeight: 500
|
|
|
},
|
|
|
children: "\u89C4\u5219\u76EE\u7684"
|
|
|
}), /*#__PURE__*/(0,jsx_runtime.jsx)("br", {}), /*#__PURE__*/(0,jsx_runtime.jsx)("span", {
|
|
|
style: {},
|
|
|
children: "\u9F13\u52B1\u5B66\u751F\u5728\u5B9E\u8BAD\u4F5C\u4E1A\u53D1\u5E03\u7684\u7B2C\u4E00\u65F6\u95F4\uFF0C\u7ACB\u5373\u767B\u5F55\u5E73\u53F0\u5B8C\u6210\u5B9E\u8BAD\u4F5C\u4E1A\u7684\u901A\u5173\u3002"
|
|
|
})]
|
|
|
})]
|
|
|
}), /*#__PURE__*/(0,jsx_runtime.jsx)(es_modal/* default */.Z, {
|
|
|
open: isshows,
|
|
|
title: "\u5B9E\u8BAD\u603B\u8017\u65F6\u8BF4\u660E",
|
|
|
centered: true,
|
|
|
footer: null,
|
|
|
onCancel: function onCancel() {
|
|
|
setIsshows(false);
|
|
|
},
|
|
|
width: 600,
|
|
|
children: /*#__PURE__*/(0,jsx_runtime.jsxs)("div", {
|
|
|
style: {
|
|
|
fontWeight: 400,
|
|
|
color: '#333333'
|
|
|
},
|
|
|
children: [/*#__PURE__*/(0,jsx_runtime.jsxs)("div", {
|
|
|
children: ["1\u3001\u5F53\u8BA1\u65F6\u89C4\u5219\u4E3A\u201C", /*#__PURE__*/(0,jsx_runtime.jsx)("span", {
|
|
|
style: {
|
|
|
color: '#145DFF'
|
|
|
},
|
|
|
children: "\u9875\u9762\u505C\u7559\u65F6\u957F"
|
|
|
}), "\u201D\u65F6\uFF0C\u5B9E\u8BAD\u603B\u8017\u65F6\u4E3A\u6240\u6709\u5173\u5361\u8017\u65F6\u76F8\u52A0\u4E4B\u548C\uFF1B"]
|
|
|
}), /*#__PURE__*/(0,jsx_runtime.jsxs)("div", {
|
|
|
style: {
|
|
|
margin: '20px 0px'
|
|
|
},
|
|
|
children: ["2\u3001\u5F53\u8BA1\u65F6\u89C4\u5219\u4E3A\u201C", /*#__PURE__*/(0,jsx_runtime.jsx)("span", {
|
|
|
style: {
|
|
|
color: '#145DFF'
|
|
|
},
|
|
|
children: "\u5173\u5361\u603B\u8017\u65F6"
|
|
|
}), "\u201D\u65F6\uFF0C\u5B9E\u8BAD\u603B\u8017\u65F6\u4E3A\u6240\u6709\u5173\u5361\u8017\u65F6\u76F8\u52A0\u4E4B\u548C\uFF1B"]
|
|
|
}), /*#__PURE__*/(0,jsx_runtime.jsxs)("div", {
|
|
|
children: ["3\u3001\u5F53\u8BA1\u65F6\u89C4\u5219\u4E3A\u201C", /*#__PURE__*/(0,jsx_runtime.jsx)("span", {
|
|
|
style: {
|
|
|
color: '#145DFF'
|
|
|
},
|
|
|
children: "\u4F5C\u4E1A\u901A\u5173\u65F6\u957F"
|
|
|
}), "\u201D\u65F6\uFF0C\u5B9E\u8BAD\u603B\u8017\u65F6\u4E3A\u5B9E\u8BAD\u53D1\u5E03\u65F6\u95F4\u81F3\u5B9E\u8BAD\u901A\u5173\u65F6\u95F4\uFF0C\u5F53\u5B66\u751F\u672A\u901A\u5173\u65F6\uFF0C\u5B9E\u8BAD\u603B\u8017\u65F6\u4E3A\u5B9E\u8BAD\u53D1\u5E03\u65F6\u95F4\u81F3\u5B9E\u8BAD\u622A\u6B62\u65F6\u95F4\u3002"]
|
|
|
})]
|
|
|
})
|
|
|
})]
|
|
|
});
|
|
|
};
|
|
|
/* harmony default export */ var Comment = ((0,_umi_production_exports.connect)(function (_ref9) {
|
|
|
var shixunHomeworks = _ref9.shixunHomeworks,
|
|
|
loading = _ref9.loading,
|
|
|
globalSetting = _ref9.globalSetting,
|
|
|
classroomList = _ref9.classroomList;
|
|
|
return {
|
|
|
shixunHomeworks: shixunHomeworks,
|
|
|
globalSetting: globalSetting,
|
|
|
loading: loading.effects,
|
|
|
classroomList: classroomList
|
|
|
};
|
|
|
})(Comment_ShixunsListPage));
|
|
|
|
|
|
/***/ }),
|
|
|
|
|
|
/***/ 13422:
|
|
|
/*!***************************************************************************************************!*\
|
|
|
!*** ./src/pages/Classrooms/Lists/ProgramHomework/Detail/components/WorkList/components/Redo.tsx ***!
|
|
|
\***************************************************************************************************/
|
|
|
/***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) {
|
|
|
|
|
|
"use strict";
|
|
|
/* harmony import */ var _root_workspace_ppte5yg23_local_v9_test3_node_modules_babel_runtime_7_23_2_babel_runtime_helpers_regeneratorRuntime_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./node_modules/_@babel_runtime@7.23.2@@babel/runtime/helpers/regeneratorRuntime.js */ 10574);
|
|
|
/* harmony import */ var _root_workspace_ppte5yg23_local_v9_test3_node_modules_babel_runtime_7_23_2_babel_runtime_helpers_regeneratorRuntime_js__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_root_workspace_ppte5yg23_local_v9_test3_node_modules_babel_runtime_7_23_2_babel_runtime_helpers_regeneratorRuntime_js__WEBPACK_IMPORTED_MODULE_0__);
|
|
|
/* harmony import */ var _root_workspace_ppte5yg23_local_v9_test3_node_modules_babel_runtime_7_23_2_babel_runtime_helpers_objectSpread2_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./node_modules/_@babel_runtime@7.23.2@@babel/runtime/helpers/objectSpread2.js */ 26801);
|
|
|
/* harmony import */ var _root_workspace_ppte5yg23_local_v9_test3_node_modules_babel_runtime_7_23_2_babel_runtime_helpers_objectSpread2_js__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_root_workspace_ppte5yg23_local_v9_test3_node_modules_babel_runtime_7_23_2_babel_runtime_helpers_objectSpread2_js__WEBPACK_IMPORTED_MODULE_1__);
|
|
|
/* harmony import */ var _root_workspace_ppte5yg23_local_v9_test3_node_modules_babel_runtime_7_23_2_babel_runtime_helpers_asyncToGenerator_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./node_modules/_@babel_runtime@7.23.2@@babel/runtime/helpers/asyncToGenerator.js */ 39343);
|
|
|
/* harmony import */ var _root_workspace_ppte5yg23_local_v9_test3_node_modules_babel_runtime_7_23_2_babel_runtime_helpers_asyncToGenerator_js__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(_root_workspace_ppte5yg23_local_v9_test3_node_modules_babel_runtime_7_23_2_babel_runtime_helpers_asyncToGenerator_js__WEBPACK_IMPORTED_MODULE_2__);
|
|
|
/* harmony import */ var _root_workspace_ppte5yg23_local_v9_test3_node_modules_babel_runtime_7_23_2_babel_runtime_helpers_objectWithoutProperties_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./node_modules/_@babel_runtime@7.23.2@@babel/runtime/helpers/objectWithoutProperties.js */ 27161);
|
|
|
/* harmony import */ var _root_workspace_ppte5yg23_local_v9_test3_node_modules_babel_runtime_7_23_2_babel_runtime_helpers_objectWithoutProperties_js__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__webpack_require__.n(_root_workspace_ppte5yg23_local_v9_test3_node_modules_babel_runtime_7_23_2_babel_runtime_helpers_objectWithoutProperties_js__WEBPACK_IMPORTED_MODULE_3__);
|
|
|
/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! react */ 59301);
|
|
|
/* harmony import */ var antd__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! antd */ 43418);
|
|
|
/* harmony import */ var antd__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! antd */ 8591);
|
|
|
/* harmony import */ var _utils_fetch__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! @/utils/fetch */ 91506);
|
|
|
/* harmony import */ var umi__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! umi */ 45295);
|
|
|
/* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! react/jsx-runtime */ 37712);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
var _excluded = ["shixunHomeworks", "dispatch"];
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
var DelShixun = function DelShixun(_ref) {
|
|
|
var shixunHomeworks = _ref.shixunHomeworks,
|
|
|
dispatch = _ref.dispatch,
|
|
|
props = _root_workspace_ppte5yg23_local_v9_test3_node_modules_babel_runtime_7_23_2_babel_runtime_helpers_objectWithoutProperties_js__WEBPACK_IMPORTED_MODULE_3___default()(_ref, _excluded);
|
|
|
var params = (0,umi__WEBPACK_IMPORTED_MODULE_6__.useParams)();
|
|
|
return /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_7__.jsxs)(antd__WEBPACK_IMPORTED_MODULE_8__/* ["default"] */ .Z, {
|
|
|
centered: true,
|
|
|
title: "\u63D0\u793A",
|
|
|
open: shixunHomeworks.actionTabs.key === '打回重做' ? true : false,
|
|
|
okText: "\u786E\u5B9A",
|
|
|
cancelText: "\u53D6\u6D88",
|
|
|
onOk: /*#__PURE__*/_root_workspace_ppte5yg23_local_v9_test3_node_modules_babel_runtime_7_23_2_babel_runtime_helpers_asyncToGenerator_js__WEBPACK_IMPORTED_MODULE_2___default()( /*#__PURE__*/_root_workspace_ppte5yg23_local_v9_test3_node_modules_babel_runtime_7_23_2_babel_runtime_helpers_regeneratorRuntime_js__WEBPACK_IMPORTED_MODULE_0___default()().mark(function _callee() {
|
|
|
var res;
|
|
|
return _root_workspace_ppte5yg23_local_v9_test3_node_modules_babel_runtime_7_23_2_babel_runtime_helpers_regeneratorRuntime_js__WEBPACK_IMPORTED_MODULE_0___default()().wrap(function _callee$(_context) {
|
|
|
while (1) switch (_context.prev = _context.next) {
|
|
|
case 0:
|
|
|
_context.next = 2;
|
|
|
return (0,_utils_fetch__WEBPACK_IMPORTED_MODULE_5__/* ["default"] */ .ZP)("/api/myshixuns/".concat(shixunHomeworks.actionTabs.selectArrs.myshixun_identifier, "/reset_my_game.json"), {
|
|
|
method: 'GET',
|
|
|
params: {
|
|
|
course_id: params.coursesId
|
|
|
}
|
|
|
});
|
|
|
case 2:
|
|
|
res = _context.sent;
|
|
|
if (res.shixun_identifier) {
|
|
|
antd__WEBPACK_IMPORTED_MODULE_9__/* ["default"] */ .ZP.success('操作成功');
|
|
|
dispatch({
|
|
|
type: 'shixunHomeworks/setActionTabs',
|
|
|
payload: {}
|
|
|
});
|
|
|
dispatch({
|
|
|
type: 'shixunHomeworks/getWorkList',
|
|
|
payload: _root_workspace_ppte5yg23_local_v9_test3_node_modules_babel_runtime_7_23_2_babel_runtime_helpers_objectSpread2_js__WEBPACK_IMPORTED_MODULE_1___default()({}, shixunHomeworks.actionTabs.params)
|
|
|
});
|
|
|
}
|
|
|
case 4:
|
|
|
case "end":
|
|
|
return _context.stop();
|
|
|
}
|
|
|
}, _callee);
|
|
|
})),
|
|
|
onCancel: function onCancel() {
|
|
|
dispatch({
|
|
|
type: 'shixunHomeworks/setActionTabs',
|
|
|
payload: {}
|
|
|
});
|
|
|
},
|
|
|
children: [/*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_7__.jsx)("p", {
|
|
|
children: "\u8BE5\u4F5C\u4E1A\u5C06\u88AB\u6253\u56DE\u91CD\u505A\uFF0C\u5B66\u751F\u5B9E\u8BAD\u8BB0\u5F55\u5C06\u88AB\u6E05\u7A7A!"
|
|
|
}), /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_7__.jsx)("p", {
|
|
|
children: "\u786E\u5B9A\u6253\u56DE?"
|
|
|
})]
|
|
|
});
|
|
|
};
|
|
|
/* harmony default export */ __webpack_exports__.Z = ((0,umi__WEBPACK_IMPORTED_MODULE_6__.connect)(function (_ref3) {
|
|
|
var shixunHomeworks = _ref3.shixunHomeworks;
|
|
|
return {
|
|
|
shixunHomeworks: shixunHomeworks
|
|
|
};
|
|
|
})(DelShixun));
|
|
|
|
|
|
/***/ }),
|
|
|
|
|
|
/***/ 24334:
|
|
|
/*!***********************************************************!*\
|
|
|
!*** ./node_modules/_js-base64@2.6.4@js-base64/base64.js ***!
|
|
|
\***********************************************************/
|
|
|
/***/ (function(module, exports, __webpack_require__) {
|
|
|
|
|
|
var __WEBPACK_AMD_DEFINE_ARRAY__, __WEBPACK_AMD_DEFINE_RESULT__;/*
|
|
|
* base64.js
|
|
|
*
|
|
|
* Licensed under the BSD 3-Clause License.
|
|
|
* http://opensource.org/licenses/BSD-3-Clause
|
|
|
*
|
|
|
* References:
|
|
|
* http://en.wikipedia.org/wiki/Base64
|
|
|
*/
|
|
|
;(function (global, factory) {
|
|
|
true
|
|
|
? module.exports = factory(global)
|
|
|
: 0
|
|
|
}((
|
|
|
typeof self !== 'undefined' ? self
|
|
|
: typeof window !== 'undefined' ? window
|
|
|
: typeof __webpack_require__.g !== 'undefined' ? __webpack_require__.g
|
|
|
: this
|
|
|
), function(global) {
|
|
|
'use strict';
|
|
|
// existing version for noConflict()
|
|
|
global = global || {};
|
|
|
var _Base64 = global.Base64;
|
|
|
var version = "2.6.4";
|
|
|
// constants
|
|
|
var b64chars
|
|
|
= 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/';
|
|
|
var b64tab = function(bin) {
|
|
|
var t = {};
|
|
|
for (var i = 0, l = bin.length; i < l; i++) t[bin.charAt(i)] = i;
|
|
|
return t;
|
|
|
}(b64chars);
|
|
|
var fromCharCode = String.fromCharCode;
|
|
|
// encoder stuff
|
|
|
var cb_utob = function(c) {
|
|
|
if (c.length < 2) {
|
|
|
var cc = c.charCodeAt(0);
|
|
|
return cc < 0x80 ? c
|
|
|
: cc < 0x800 ? (fromCharCode(0xc0 | (cc >>> 6))
|
|
|
+ fromCharCode(0x80 | (cc & 0x3f)))
|
|
|
: (fromCharCode(0xe0 | ((cc >>> 12) & 0x0f))
|
|
|
+ fromCharCode(0x80 | ((cc >>> 6) & 0x3f))
|
|
|
+ fromCharCode(0x80 | ( cc & 0x3f)));
|
|
|
} else {
|
|
|
var cc = 0x10000
|
|
|
+ (c.charCodeAt(0) - 0xD800) * 0x400
|
|
|
+ (c.charCodeAt(1) - 0xDC00);
|
|
|
return (fromCharCode(0xf0 | ((cc >>> 18) & 0x07))
|
|
|
+ fromCharCode(0x80 | ((cc >>> 12) & 0x3f))
|
|
|
+ fromCharCode(0x80 | ((cc >>> 6) & 0x3f))
|
|
|
+ fromCharCode(0x80 | ( cc & 0x3f)));
|
|
|
}
|
|
|
};
|
|
|
var re_utob = /[\uD800-\uDBFF][\uDC00-\uDFFFF]|[^\x00-\x7F]/g;
|
|
|
var utob = function(u) {
|
|
|
return u.replace(re_utob, cb_utob);
|
|
|
};
|
|
|
var cb_encode = function(ccc) {
|
|
|
var padlen = [0, 2, 1][ccc.length % 3],
|
|
|
ord = ccc.charCodeAt(0) << 16
|
|
|
| ((ccc.length > 1 ? ccc.charCodeAt(1) : 0) << 8)
|
|
|
| ((ccc.length > 2 ? ccc.charCodeAt(2) : 0)),
|
|
|
chars = [
|
|
|
b64chars.charAt( ord >>> 18),
|
|
|
b64chars.charAt((ord >>> 12) & 63),
|
|
|
padlen >= 2 ? '=' : b64chars.charAt((ord >>> 6) & 63),
|
|
|
padlen >= 1 ? '=' : b64chars.charAt(ord & 63)
|
|
|
];
|
|
|
return chars.join('');
|
|
|
};
|
|
|
var btoa = global.btoa && typeof global.btoa == 'function'
|
|
|
? function(b){ return global.btoa(b) } : function(b) {
|
|
|
if (b.match(/[^\x00-\xFF]/)) throw new RangeError(
|
|
|
'The string contains invalid characters.'
|
|
|
);
|
|
|
return b.replace(/[\s\S]{1,3}/g, cb_encode);
|
|
|
};
|
|
|
var _encode = function(u) {
|
|
|
return btoa(utob(String(u)));
|
|
|
};
|
|
|
var mkUriSafe = function (b64) {
|
|
|
return b64.replace(/[+\/]/g, function(m0) {
|
|
|
return m0 == '+' ? '-' : '_';
|
|
|
}).replace(/=/g, '');
|
|
|
};
|
|
|
var encode = function(u, urisafe) {
|
|
|
return urisafe ? mkUriSafe(_encode(u)) : _encode(u);
|
|
|
};
|
|
|
var encodeURI = function(u) { return encode(u, true) };
|
|
|
var fromUint8Array;
|
|
|
if (global.Uint8Array) fromUint8Array = function(a, urisafe) {
|
|
|
// return btoa(fromCharCode.apply(null, a));
|
|
|
var b64 = '';
|
|
|
for (var i = 0, l = a.length; i < l; i += 3) {
|
|
|
var a0 = a[i], a1 = a[i+1], a2 = a[i+2];
|
|
|
var ord = a0 << 16 | a1 << 8 | a2;
|
|
|
b64 += b64chars.charAt( ord >>> 18)
|
|
|
+ b64chars.charAt((ord >>> 12) & 63)
|
|
|
+ ( typeof a1 != 'undefined'
|
|
|
? b64chars.charAt((ord >>> 6) & 63) : '=')
|
|
|
+ ( typeof a2 != 'undefined'
|
|
|
? b64chars.charAt( ord & 63) : '=');
|
|
|
}
|
|
|
return urisafe ? mkUriSafe(b64) : b64;
|
|
|
};
|
|
|
// decoder stuff
|
|
|
var re_btou = /[\xC0-\xDF][\x80-\xBF]|[\xE0-\xEF][\x80-\xBF]{2}|[\xF0-\xF7][\x80-\xBF]{3}/g;
|
|
|
var cb_btou = function(cccc) {
|
|
|
switch(cccc.length) {
|
|
|
case 4:
|
|
|
var cp = ((0x07 & cccc.charCodeAt(0)) << 18)
|
|
|
| ((0x3f & cccc.charCodeAt(1)) << 12)
|
|
|
| ((0x3f & cccc.charCodeAt(2)) << 6)
|
|
|
| (0x3f & cccc.charCodeAt(3)),
|
|
|
offset = cp - 0x10000;
|
|
|
return (fromCharCode((offset >>> 10) + 0xD800)
|
|
|
+ fromCharCode((offset & 0x3FF) + 0xDC00));
|
|
|
case 3:
|
|
|
return fromCharCode(
|
|
|
((0x0f & cccc.charCodeAt(0)) << 12)
|
|
|
| ((0x3f & cccc.charCodeAt(1)) << 6)
|
|
|
| (0x3f & cccc.charCodeAt(2))
|
|
|
);
|
|
|
default:
|
|
|
return fromCharCode(
|
|
|
((0x1f & cccc.charCodeAt(0)) << 6)
|
|
|
| (0x3f & cccc.charCodeAt(1))
|
|
|
);
|
|
|
}
|
|
|
};
|
|
|
var btou = function(b) {
|
|
|
return b.replace(re_btou, cb_btou);
|
|
|
};
|
|
|
var cb_decode = function(cccc) {
|
|
|
var len = cccc.length,
|
|
|
padlen = len % 4,
|
|
|
n = (len > 0 ? b64tab[cccc.charAt(0)] << 18 : 0)
|
|
|
| (len > 1 ? b64tab[cccc.charAt(1)] << 12 : 0)
|
|
|
| (len > 2 ? b64tab[cccc.charAt(2)] << 6 : 0)
|
|
|
| (len > 3 ? b64tab[cccc.charAt(3)] : 0),
|
|
|
chars = [
|
|
|
fromCharCode( n >>> 16),
|
|
|
fromCharCode((n >>> 8) & 0xff),
|
|
|
fromCharCode( n & 0xff)
|
|
|
];
|
|
|
chars.length -= [0, 0, 2, 1][padlen];
|
|
|
return chars.join('');
|
|
|
};
|
|
|
var _atob = global.atob && typeof global.atob == 'function'
|
|
|
? function(a){ return global.atob(a) } : function(a){
|
|
|
return a.replace(/\S{1,4}/g, cb_decode);
|
|
|
};
|
|
|
var atob = function(a) {
|
|
|
return _atob(String(a).replace(/[^A-Za-z0-9\+\/]/g, ''));
|
|
|
};
|
|
|
var _decode = function(a) { return btou(_atob(a)) };
|
|
|
var _fromURI = function(a) {
|
|
|
return String(a).replace(/[-_]/g, function(m0) {
|
|
|
return m0 == '-' ? '+' : '/'
|
|
|
}).replace(/[^A-Za-z0-9\+\/]/g, '');
|
|
|
};
|
|
|
var decode = function(a){
|
|
|
return _decode(_fromURI(a));
|
|
|
};
|
|
|
var toUint8Array;
|
|
|
if (global.Uint8Array) toUint8Array = function(a) {
|
|
|
return Uint8Array.from(atob(_fromURI(a)), function(c) {
|
|
|
return c.charCodeAt(0);
|
|
|
});
|
|
|
};
|
|
|
var noConflict = function() {
|
|
|
var Base64 = global.Base64;
|
|
|
global.Base64 = _Base64;
|
|
|
return Base64;
|
|
|
};
|
|
|
// export Base64
|
|
|
global.Base64 = {
|
|
|
VERSION: version,
|
|
|
atob: atob,
|
|
|
btoa: btoa,
|
|
|
fromBase64: decode,
|
|
|
toBase64: encode,
|
|
|
utob: utob,
|
|
|
encode: encode,
|
|
|
encodeURI: encodeURI,
|
|
|
btou: btou,
|
|
|
decode: decode,
|
|
|
noConflict: noConflict,
|
|
|
fromUint8Array: fromUint8Array,
|
|
|
toUint8Array: toUint8Array
|
|
|
};
|
|
|
// if ES5 is available, make Base64.extendString() available
|
|
|
if (typeof Object.defineProperty === 'function') {
|
|
|
var noEnum = function(v){
|
|
|
return {value:v,enumerable:false,writable:true,configurable:true};
|
|
|
};
|
|
|
global.Base64.extendString = function () {
|
|
|
Object.defineProperty(
|
|
|
String.prototype, 'fromBase64', noEnum(function () {
|
|
|
return decode(this)
|
|
|
}));
|
|
|
Object.defineProperty(
|
|
|
String.prototype, 'toBase64', noEnum(function (urisafe) {
|
|
|
return encode(this, urisafe)
|
|
|
}));
|
|
|
Object.defineProperty(
|
|
|
String.prototype, 'toBase64URI', noEnum(function () {
|
|
|
return encode(this, true)
|
|
|
}));
|
|
|
};
|
|
|
}
|
|
|
//
|
|
|
// export Base64 to the namespace
|
|
|
//
|
|
|
if (global['Meteor']) { // Meteor.js
|
|
|
Base64 = global.Base64;
|
|
|
}
|
|
|
// module.exports and AMD are mutually exclusive.
|
|
|
// module.exports has precedence.
|
|
|
if ( true && module.exports) {
|
|
|
module.exports.Base64 = global.Base64;
|
|
|
}
|
|
|
else if (true) {
|
|
|
// AMD. Register as an anonymous module.
|
|
|
!(__WEBPACK_AMD_DEFINE_ARRAY__ = [], __WEBPACK_AMD_DEFINE_RESULT__ = (function(){ return global.Base64 }).apply(exports, __WEBPACK_AMD_DEFINE_ARRAY__),
|
|
|
__WEBPACK_AMD_DEFINE_RESULT__ !== undefined && (module.exports = __WEBPACK_AMD_DEFINE_RESULT__));
|
|
|
}
|
|
|
// that's it!
|
|
|
return {Base64: global.Base64}
|
|
|
}));
|
|
|
|
|
|
|
|
|
/***/ })
|
|
|
|
|
|
}]); |