|
|
(self["webpackChunk"] = self["webpackChunk"] || []).push([[48431,48358,88511,12768,66390],{
|
|
|
|
|
|
/***/ 82826:
|
|
|
/*!**********************************************************************************!*\
|
|
|
!*** ./node_modules/@ant-design/icons/es/icons/ArrowLeftOutlined.js + 1 modules ***!
|
|
|
\**********************************************************************************/
|
|
|
/***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) {
|
|
|
|
|
|
"use strict";
|
|
|
|
|
|
// EXPORTS
|
|
|
__webpack_require__.d(__webpack_exports__, {
|
|
|
"Z": function() { return /* binding */ icons_ArrowLeftOutlined; }
|
|
|
});
|
|
|
|
|
|
// EXTERNAL MODULE: ./node_modules/@babel/runtime/helpers/esm/extends.js
|
|
|
var esm_extends = __webpack_require__(87462);
|
|
|
// EXTERNAL MODULE: ./node_modules/react/index.js
|
|
|
var react = __webpack_require__(67294);
|
|
|
;// CONCATENATED MODULE: ./node_modules/@ant-design/icons-svg/es/asn/ArrowLeftOutlined.js
|
|
|
// This icon file is generated automatically.
|
|
|
var ArrowLeftOutlined = { "icon": { "tag": "svg", "attrs": { "viewBox": "64 64 896 896", "focusable": "false" }, "children": [{ "tag": "path", "attrs": { "d": "M872 474H286.9l350.2-304c5.6-4.9 2.2-14-5.2-14h-88.5c-3.9 0-7.6 1.4-10.5 3.9L155 487.8a31.96 31.96 0 000 48.3L535.1 866c1.5 1.3 3.3 2 5.2 2h91.5c7.4 0 10.8-9.2 5.2-14L286.9 550H872c4.4 0 8-3.6 8-8v-60c0-4.4-3.6-8-8-8z" } }] }, "name": "arrow-left", "theme": "outlined" };
|
|
|
/* harmony default export */ var asn_ArrowLeftOutlined = (ArrowLeftOutlined);
|
|
|
|
|
|
// EXTERNAL MODULE: ./node_modules/@ant-design/icons/es/components/AntdIcon.js + 8 modules
|
|
|
var AntdIcon = __webpack_require__(74643);
|
|
|
;// CONCATENATED MODULE: ./node_modules/@ant-design/icons/es/icons/ArrowLeftOutlined.js
|
|
|
|
|
|
// GENERATE BY ./scripts/generate.ts
|
|
|
// DON NOT EDIT IT MANUALLY
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
var ArrowLeftOutlined_ArrowLeftOutlined = function ArrowLeftOutlined(props, ref) {
|
|
|
return /*#__PURE__*/react.createElement(AntdIcon/* default */.Z, (0,esm_extends/* default */.Z)({}, props, {
|
|
|
ref: ref,
|
|
|
icon: asn_ArrowLeftOutlined
|
|
|
}));
|
|
|
};
|
|
|
if (false) {}
|
|
|
/* harmony default export */ var icons_ArrowLeftOutlined = (/*#__PURE__*/react.forwardRef(ArrowLeftOutlined_ArrowLeftOutlined));
|
|
|
|
|
|
/***/ }),
|
|
|
|
|
|
/***/ 95604:
|
|
|
/*!*******************************************************************************************!*\
|
|
|
!*** ./node_modules/@ant-design/icons/es/icons/DeliveredProcedureOutlined.js + 1 modules ***!
|
|
|
\*******************************************************************************************/
|
|
|
/***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) {
|
|
|
|
|
|
"use strict";
|
|
|
|
|
|
// EXPORTS
|
|
|
__webpack_require__.d(__webpack_exports__, {
|
|
|
"Z": function() { return /* binding */ icons_DeliveredProcedureOutlined; }
|
|
|
});
|
|
|
|
|
|
// EXTERNAL MODULE: ./node_modules/@babel/runtime/helpers/esm/extends.js
|
|
|
var esm_extends = __webpack_require__(87462);
|
|
|
// EXTERNAL MODULE: ./node_modules/react/index.js
|
|
|
var react = __webpack_require__(67294);
|
|
|
;// CONCATENATED MODULE: ./node_modules/@ant-design/icons-svg/es/asn/DeliveredProcedureOutlined.js
|
|
|
// This icon file is generated automatically.
|
|
|
var DeliveredProcedureOutlined = { "icon": { "tag": "svg", "attrs": { "viewBox": "64 64 896 896", "focusable": "false" }, "children": [{ "tag": "defs", "attrs": {}, "children": [{ "tag": "style", "attrs": {} }] }, { "tag": "path", "attrs": { "d": "M632 698.3l141.9-112a8 8 0 000-12.6L632 461.7c-5.3-4.2-13-.4-13 6.3v76H295c-4.4 0-8 3.6-8 8v56c0 4.4 3.6 8 8 8h324v76c0 6.7 7.8 10.4 13 6.3zm261.3-405L730.7 130.7c-7.5-7.5-16.7-13-26.7-16V112H144c-17.7 0-32 14.3-32 32v278c0 4.4 3.6 8 8 8h56c4.4 0 8-3.6 8-8V184h136v136c0 17.7 14.3 32 32 32h320c17.7 0 32-14.3 32-32V205.8l136 136V422c0 4.4 3.6 8 8 8h56c4.4 0 8-3.6 8-8v-83.5c0-17-6.7-33.2-18.7-45.2zM640 288H384V184h256v104zm264 436h-56c-4.4 0-8 3.6-8 8v108H184V732c0-4.4-3.6-8-8-8h-56c-4.4 0-8 3.6-8 8v148c0 17.7 14.3 32 32 32h736c17.7 0 32-14.3 32-32V732c0-4.4-3.6-8-8-8z" } }] }, "name": "delivered-procedure", "theme": "outlined" };
|
|
|
/* harmony default export */ var asn_DeliveredProcedureOutlined = (DeliveredProcedureOutlined);
|
|
|
|
|
|
// EXTERNAL MODULE: ./node_modules/@ant-design/icons/es/components/AntdIcon.js + 8 modules
|
|
|
var AntdIcon = __webpack_require__(74643);
|
|
|
;// CONCATENATED MODULE: ./node_modules/@ant-design/icons/es/icons/DeliveredProcedureOutlined.js
|
|
|
|
|
|
// GENERATE BY ./scripts/generate.ts
|
|
|
// DON NOT EDIT IT MANUALLY
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
var DeliveredProcedureOutlined_DeliveredProcedureOutlined = function DeliveredProcedureOutlined(props, ref) {
|
|
|
return /*#__PURE__*/react.createElement(AntdIcon/* default */.Z, (0,esm_extends/* default */.Z)({}, props, {
|
|
|
ref: ref,
|
|
|
icon: asn_DeliveredProcedureOutlined
|
|
|
}));
|
|
|
};
|
|
|
if (false) {}
|
|
|
/* harmony default export */ var icons_DeliveredProcedureOutlined = (/*#__PURE__*/react.forwardRef(DeliveredProcedureOutlined_DeliveredProcedureOutlined));
|
|
|
|
|
|
/***/ }),
|
|
|
|
|
|
/***/ 24969:
|
|
|
/*!*****************************************************************************!*\
|
|
|
!*** ./node_modules/@ant-design/icons/es/icons/PlusOutlined.js + 1 modules ***!
|
|
|
\*****************************************************************************/
|
|
|
/***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) {
|
|
|
|
|
|
"use strict";
|
|
|
|
|
|
// EXPORTS
|
|
|
__webpack_require__.d(__webpack_exports__, {
|
|
|
"Z": function() { return /* binding */ icons_PlusOutlined; }
|
|
|
});
|
|
|
|
|
|
// EXTERNAL MODULE: ./node_modules/@babel/runtime/helpers/esm/extends.js
|
|
|
var esm_extends = __webpack_require__(87462);
|
|
|
// EXTERNAL MODULE: ./node_modules/react/index.js
|
|
|
var react = __webpack_require__(67294);
|
|
|
;// CONCATENATED MODULE: ./node_modules/@ant-design/icons-svg/es/asn/PlusOutlined.js
|
|
|
// This icon file is generated automatically.
|
|
|
var PlusOutlined = { "icon": { "tag": "svg", "attrs": { "viewBox": "64 64 896 896", "focusable": "false" }, "children": [{ "tag": "defs", "attrs": {}, "children": [{ "tag": "style", "attrs": {} }] }, { "tag": "path", "attrs": { "d": "M482 152h60q8 0 8 8v704q0 8-8 8h-60q-8 0-8-8V160q0-8 8-8z" } }, { "tag": "path", "attrs": { "d": "M176 474h672q8 0 8 8v60q0 8-8 8H176q-8 0-8-8v-60q0-8 8-8z" } }] }, "name": "plus", "theme": "outlined" };
|
|
|
/* harmony default export */ var asn_PlusOutlined = (PlusOutlined);
|
|
|
|
|
|
// EXTERNAL MODULE: ./node_modules/@ant-design/icons/es/components/AntdIcon.js + 8 modules
|
|
|
var AntdIcon = __webpack_require__(74643);
|
|
|
;// CONCATENATED MODULE: ./node_modules/@ant-design/icons/es/icons/PlusOutlined.js
|
|
|
|
|
|
// GENERATE BY ./scripts/generate.ts
|
|
|
// DON NOT EDIT IT MANUALLY
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
var PlusOutlined_PlusOutlined = function PlusOutlined(props, ref) {
|
|
|
return /*#__PURE__*/react.createElement(AntdIcon/* default */.Z, (0,esm_extends/* default */.Z)({}, props, {
|
|
|
ref: ref,
|
|
|
icon: asn_PlusOutlined
|
|
|
}));
|
|
|
};
|
|
|
if (false) {}
|
|
|
/* harmony default export */ var icons_PlusOutlined = (/*#__PURE__*/react.forwardRef(PlusOutlined_PlusOutlined));
|
|
|
|
|
|
/***/ }),
|
|
|
|
|
|
/***/ 33160:
|
|
|
/*!*******************************************************************************!*\
|
|
|
!*** ./node_modules/@ant-design/icons/es/icons/ReloadOutlined.js + 1 modules ***!
|
|
|
\*******************************************************************************/
|
|
|
/***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) {
|
|
|
|
|
|
"use strict";
|
|
|
|
|
|
// EXPORTS
|
|
|
__webpack_require__.d(__webpack_exports__, {
|
|
|
"Z": function() { return /* binding */ icons_ReloadOutlined; }
|
|
|
});
|
|
|
|
|
|
// EXTERNAL MODULE: ./node_modules/@babel/runtime/helpers/esm/extends.js
|
|
|
var esm_extends = __webpack_require__(87462);
|
|
|
// EXTERNAL MODULE: ./node_modules/react/index.js
|
|
|
var react = __webpack_require__(67294);
|
|
|
;// CONCATENATED MODULE: ./node_modules/@ant-design/icons-svg/es/asn/ReloadOutlined.js
|
|
|
// This icon file is generated automatically.
|
|
|
var ReloadOutlined = { "icon": { "tag": "svg", "attrs": { "viewBox": "64 64 896 896", "focusable": "false" }, "children": [{ "tag": "path", "attrs": { "d": "M909.1 209.3l-56.4 44.1C775.8 155.1 656.2 92 521.9 92 290 92 102.3 279.5 102 511.5 101.7 743.7 289.8 932 521.9 932c181.3 0 335.8-115 394.6-276.1 1.5-4.2-.7-8.9-4.9-10.3l-56.7-19.5a8 8 0 00-10.1 4.8c-1.8 5-3.8 10-5.9 14.9-17.3 41-42.1 77.8-73.7 109.4A344.77 344.77 0 01655.9 829c-42.3 17.9-87.4 27-133.8 27-46.5 0-91.5-9.1-133.8-27A341.5 341.5 0 01279 755.2a342.16 342.16 0 01-73.7-109.4c-17.9-42.4-27-87.4-27-133.9s9.1-91.5 27-133.9c17.3-41 42.1-77.8 73.7-109.4 31.6-31.6 68.4-56.4 109.3-73.8 42.3-17.9 87.4-27 133.8-27 46.5 0 91.5 9.1 133.8 27a341.5 341.5 0 01109.3 73.8c9.9 9.9 19.2 20.4 27.8 31.4l-60.2 47a8 8 0 003 14.1l175.6 43c5 1.2 9.9-2.6 9.9-7.7l.8-180.9c-.1-6.6-7.8-10.3-13-6.2z" } }] }, "name": "reload", "theme": "outlined" };
|
|
|
/* harmony default export */ var asn_ReloadOutlined = (ReloadOutlined);
|
|
|
|
|
|
// EXTERNAL MODULE: ./node_modules/@ant-design/icons/es/components/AntdIcon.js + 8 modules
|
|
|
var AntdIcon = __webpack_require__(74643);
|
|
|
;// CONCATENATED MODULE: ./node_modules/@ant-design/icons/es/icons/ReloadOutlined.js
|
|
|
|
|
|
// GENERATE BY ./scripts/generate.ts
|
|
|
// DON NOT EDIT IT MANUALLY
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
var ReloadOutlined_ReloadOutlined = function ReloadOutlined(props, ref) {
|
|
|
return /*#__PURE__*/react.createElement(AntdIcon/* default */.Z, (0,esm_extends/* default */.Z)({}, props, {
|
|
|
ref: ref,
|
|
|
icon: asn_ReloadOutlined
|
|
|
}));
|
|
|
};
|
|
|
if (false) {}
|
|
|
/* harmony default export */ var icons_ReloadOutlined = (/*#__PURE__*/react.forwardRef(ReloadOutlined_ReloadOutlined));
|
|
|
|
|
|
/***/ }),
|
|
|
|
|
|
/***/ 42952:
|
|
|
/*!********************************************************************************!*\
|
|
|
!*** ./node_modules/@ant-design/icons/es/icons/SettingOutlined.js + 1 modules ***!
|
|
|
\********************************************************************************/
|
|
|
/***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) {
|
|
|
|
|
|
"use strict";
|
|
|
|
|
|
// EXPORTS
|
|
|
__webpack_require__.d(__webpack_exports__, {
|
|
|
"Z": function() { return /* binding */ icons_SettingOutlined; }
|
|
|
});
|
|
|
|
|
|
// EXTERNAL MODULE: ./node_modules/@babel/runtime/helpers/esm/extends.js
|
|
|
var esm_extends = __webpack_require__(87462);
|
|
|
// EXTERNAL MODULE: ./node_modules/react/index.js
|
|
|
var react = __webpack_require__(67294);
|
|
|
;// CONCATENATED MODULE: ./node_modules/@ant-design/icons-svg/es/asn/SettingOutlined.js
|
|
|
// This icon file is generated automatically.
|
|
|
var SettingOutlined = { "icon": { "tag": "svg", "attrs": { "viewBox": "64 64 896 896", "focusable": "false" }, "children": [{ "tag": "path", "attrs": { "d": "M924.8 625.7l-65.5-56c3.1-19 4.7-38.4 4.7-57.8s-1.6-38.8-4.7-57.8l65.5-56a32.03 32.03 0 009.3-35.2l-.9-2.6a443.74 443.74 0 00-79.7-137.9l-1.8-2.1a32.12 32.12 0 00-35.1-9.5l-81.3 28.9c-30-24.6-63.5-44-99.7-57.6l-15.7-85a32.05 32.05 0 00-25.8-25.7l-2.7-.5c-52.1-9.4-106.9-9.4-159 0l-2.7.5a32.05 32.05 0 00-25.8 25.7l-15.8 85.4a351.86 351.86 0 00-99 57.4l-81.9-29.1a32 32 0 00-35.1 9.5l-1.8 2.1a446.02 446.02 0 00-79.7 137.9l-.9 2.6c-4.5 12.5-.8 26.5 9.3 35.2l66.3 56.6c-3.1 18.8-4.6 38-4.6 57.1 0 19.2 1.5 38.4 4.6 57.1L99 625.5a32.03 32.03 0 00-9.3 35.2l.9 2.6c18.1 50.4 44.9 96.9 79.7 137.9l1.8 2.1a32.12 32.12 0 0035.1 9.5l81.9-29.1c29.8 24.5 63.1 43.9 99 57.4l15.8 85.4a32.05 32.05 0 0025.8 25.7l2.7.5a449.4 449.4 0 00159 0l2.7-.5a32.05 32.05 0 0025.8-25.7l15.7-85a350 350 0 0099.7-57.6l81.3 28.9a32 32 0 0035.1-9.5l1.8-2.1c34.8-41.1 61.6-87.5 79.7-137.9l.9-2.6c4.5-12.3.8-26.3-9.3-35zM788.3 465.9c2.5 15.1 3.8 30.6 3.8 46.1s-1.3 31-3.8 46.1l-6.6 40.1 74.7 63.9a370.03 370.03 0 01-42.6 73.6L721 702.8l-31.4 25.8c-23.9 19.6-50.5 35-79.3 45.8l-38.1 14.3-17.9 97a377.5 377.5 0 01-85 0l-17.9-97.2-37.8-14.5c-28.5-10.8-55-26.2-78.7-45.7l-31.4-25.9-93.4 33.2c-17-22.9-31.2-47.6-42.6-73.6l75.5-64.5-6.5-40c-2.4-14.9-3.7-30.3-3.7-45.5 0-15.3 1.2-30.6 3.7-45.5l6.5-40-75.5-64.5c11.3-26.1 25.6-50.7 42.6-73.6l93.4 33.2 31.4-25.9c23.7-19.5 50.2-34.9 78.7-45.7l37.9-14.3 17.9-97.2c28.1-3.2 56.8-3.2 85 0l17.9 97 38.1 14.3c28.7 10.8 55.4 26.2 79.3 45.8l31.4 25.8 92.8-32.9c17 22.9 31.2 47.6 42.6 73.6L781.8 426l6.5 39.9zM512 326c-97.2 0-176 78.8-176 176s78.8 176 176 176 176-78.8 176-176-78.8-176-176-176zm79.2 255.2A111.6 111.6 0 01512 614c-29.9 0-58-11.7-79.2-32.8A111.6 111.6 0 01400 502c0-29.9 11.7-58 32.8-79.2C454 401.6 482.1 390 512 390c29.9 0 58 11.6 79.2 32.8A111.6 111.6 0 01624 502c0 29.9-11.7 58-32.8 79.2z" } }] }, "name": "setting", "theme": "outlined" };
|
|
|
/* harmony default export */ var asn_SettingOutlined = (SettingOutlined);
|
|
|
|
|
|
// EXTERNAL MODULE: ./node_modules/@ant-design/icons/es/components/AntdIcon.js + 8 modules
|
|
|
var AntdIcon = __webpack_require__(74643);
|
|
|
;// CONCATENATED MODULE: ./node_modules/@ant-design/icons/es/icons/SettingOutlined.js
|
|
|
|
|
|
// GENERATE BY ./scripts/generate.ts
|
|
|
// DON NOT EDIT IT MANUALLY
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
var SettingOutlined_SettingOutlined = function SettingOutlined(props, ref) {
|
|
|
return /*#__PURE__*/react.createElement(AntdIcon/* default */.Z, (0,esm_extends/* default */.Z)({}, props, {
|
|
|
ref: ref,
|
|
|
icon: asn_SettingOutlined
|
|
|
}));
|
|
|
};
|
|
|
if (false) {}
|
|
|
/* harmony default export */ var icons_SettingOutlined = (/*#__PURE__*/react.forwardRef(SettingOutlined_SettingOutlined));
|
|
|
|
|
|
/***/ }),
|
|
|
|
|
|
/***/ 96403:
|
|
|
/*!*********************************!*\
|
|
|
!*** ./src/pages/tasks/util.js ***!
|
|
|
\*********************************/
|
|
|
/***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) {
|
|
|
|
|
|
"use strict";
|
|
|
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
|
|
|
/* harmony export */ "Ax": function() { return /* binding */ processTreeData; },
|
|
|
/* harmony export */ "Ds": function() { return /* binding */ debounce; },
|
|
|
/* harmony export */ "KI": function() { return /* binding */ apiPref; },
|
|
|
/* harmony export */ "SI": function() { return /* binding */ getTreeData; },
|
|
|
/* harmony export */ "f1": function() { return /* binding */ isCompileOk; }
|
|
|
/* harmony export */ });
|
|
|
/* unused harmony export isProd */
|
|
|
/* harmony import */ var _utils_env__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @/utils/env */ 59758);
|
|
|
|
|
|
function isCompileOk(rs) {
|
|
|
var flag = true;
|
|
|
if (rs.length > 0) {
|
|
|
for (var i = 0; i < rs.length; i++) {
|
|
|
if (rs[i].compile_success == 0 || !rs[i].compile_success) {
|
|
|
flag = false;
|
|
|
break;
|
|
|
}
|
|
|
}
|
|
|
} else {
|
|
|
flag = false;
|
|
|
}
|
|
|
return flag;
|
|
|
}
|
|
|
function getTreeData(data) {
|
|
|
var parentKey = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : '';
|
|
|
var result = [];
|
|
|
for (var i = 0; i < data.length; i++) {
|
|
|
var item = data[i];
|
|
|
var key = parentKey ? "".concat(parentKey, "/").concat(item.name) : "".concat(item.name);
|
|
|
result.push({
|
|
|
title: item.name,
|
|
|
isLeaf: item.type === 'tree' ? false : true,
|
|
|
key: key
|
|
|
});
|
|
|
}
|
|
|
return result;
|
|
|
}
|
|
|
function processTreeData(repos, key, newData) {
|
|
|
for (var i = 0; i < repos.length; i++) {
|
|
|
var item = repos[i];
|
|
|
if (item.key === key) {
|
|
|
item.children = newData;
|
|
|
break;
|
|
|
}
|
|
|
if (item.children) {
|
|
|
processTreeData(item.children, key, newData);
|
|
|
}
|
|
|
}
|
|
|
return repos;
|
|
|
}
|
|
|
function debounce(func, wait, immediate) {
|
|
|
var timeout;
|
|
|
return function () {
|
|
|
var context = this,
|
|
|
args = arguments;
|
|
|
var later = function later() {
|
|
|
timeout = null;
|
|
|
if (!immediate) func.apply(context, args);
|
|
|
};
|
|
|
var callNow = immediate && !timeout;
|
|
|
clearTimeout(timeout);
|
|
|
timeout = setTimeout(later, wait);
|
|
|
if (callNow) func.apply(context, args);
|
|
|
};
|
|
|
}
|
|
|
var isProd = true;
|
|
|
var apiPref = _utils_env__WEBPACK_IMPORTED_MODULE_0__/* ["default"].API_SERVER */ .Z.API_SERVER;
|
|
|
// export const isProd =
|
|
|
// window.location.href.indexOf('test-') > 0 ||
|
|
|
// window.location.href.indexOf('localhost') > 0
|
|
|
// ? false
|
|
|
// : true;
|
|
|
|
|
|
// export const apiPref = isProd
|
|
|
// ? 'https://www.educoder.net'
|
|
|
// : 'https://test-newweb.educoder.net';
|
|
|
|
|
|
/***/ }),
|
|
|
|
|
|
/***/ 82982:
|
|
|
/*!*****************************************!*\
|
|
|
!*** ./src/components/NoData/index.tsx ***!
|
|
|
\*****************************************/
|
|
|
/***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) {
|
|
|
|
|
|
"use strict";
|
|
|
/* harmony import */ var _root_workspace_ppte5yg23_local_v9_node_modules_babel_runtime_helpers_objectSpread2_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./node_modules/@babel/runtime/helpers/objectSpread2.js */ 42122);
|
|
|
/* harmony import */ var _root_workspace_ppte5yg23_local_v9_node_modules_babel_runtime_helpers_objectSpread2_js__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_root_workspace_ppte5yg23_local_v9_node_modules_babel_runtime_helpers_objectSpread2_js__WEBPACK_IMPORTED_MODULE_0__);
|
|
|
/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! react */ 67294);
|
|
|
/* harmony import */ var _assets_images_icons_nodata_png__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @/assets/images/icons/nodata.png */ 4977);
|
|
|
/* harmony import */ var antd__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! antd */ 71577);
|
|
|
/* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! react/jsx-runtime */ 85893);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
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_node_modules_babel_runtime_helpers_objectSpread2_js__WEBPACK_IMPORTED_MODULE_0___default()(_root_workspace_ppte5yg23_local_v9_node_modules_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_node_modules_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_node_modules_babel_runtime_helpers_objectSpread2_js__WEBPACK_IMPORTED_MODULE_0___default()(_root_workspace_ppte5yg23_local_v9_node_modules_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);
|
|
|
|
|
|
/***/ }),
|
|
|
|
|
|
/***/ 36579:
|
|
|
/*!*********************************************************!*\
|
|
|
!*** ./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/helpers/objectSpread2.js
|
|
|
var objectSpread2 = __webpack_require__(42122);
|
|
|
var objectSpread2_default = /*#__PURE__*/__webpack_require__.n(objectSpread2);
|
|
|
// EXTERNAL MODULE: ./node_modules/@babel/runtime/helpers/regeneratorRuntime.js
|
|
|
var regeneratorRuntime = __webpack_require__(17061);
|
|
|
var regeneratorRuntime_default = /*#__PURE__*/__webpack_require__.n(regeneratorRuntime);
|
|
|
// EXTERNAL MODULE: ./node_modules/@babel/runtime/helpers/asyncToGenerator.js
|
|
|
var asyncToGenerator = __webpack_require__(17156);
|
|
|
var asyncToGenerator_default = /*#__PURE__*/__webpack_require__.n(asyncToGenerator);
|
|
|
// EXTERNAL MODULE: ./node_modules/@babel/runtime/helpers/slicedToArray.js
|
|
|
var slicedToArray = __webpack_require__(27424);
|
|
|
var slicedToArray_default = /*#__PURE__*/__webpack_require__.n(slicedToArray);
|
|
|
// EXTERNAL MODULE: ./node_modules/react/index.js
|
|
|
var react = __webpack_require__(67294);
|
|
|
;// 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/es/button/index.js
|
|
|
var es_button = __webpack_require__(71577);
|
|
|
// EXTERNAL MODULE: ./node_modules/@ant-design/icons/es/icons/ArrowDownOutlined.js + 1 modules
|
|
|
var ArrowDownOutlined = __webpack_require__(77171);
|
|
|
// EXTERNAL MODULE: ./src/components/monaco-editor/index.jsx + 3 modules
|
|
|
var monaco_editor = __webpack_require__(8691);
|
|
|
// EXTERNAL MODULE: ./node_modules/antd/es/tooltip/index.js + 3 modules
|
|
|
var tooltip = __webpack_require__(83062);
|
|
|
// EXTERNAL MODULE: ./src/utils/util.tsx
|
|
|
var util = __webpack_require__(29427);
|
|
|
// EXTERNAL MODULE: ./src/service/exercise.ts
|
|
|
var exercise = __webpack_require__(51412);
|
|
|
// EXTERNAL MODULE: ./src/components/NoData/index.tsx
|
|
|
var NoData = __webpack_require__(82982);
|
|
|
// EXTERNAL MODULE: ./src/utils/env.ts + 1 modules
|
|
|
var env = __webpack_require__(59758);
|
|
|
// EXTERNAL MODULE: ./node_modules/react/jsx-runtime.js
|
|
|
var jsx_runtime = __webpack_require__(85893);
|
|
|
;// 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.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.useState)(""),
|
|
|
_useState4 = slicedToArray_default()(_useState3, 2),
|
|
|
token = _useState4[0],
|
|
|
setToken = _useState4[1];
|
|
|
var _useState5 = (0,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.PROXY_SERVER */.Z.PROXY_SERVER : env/* default.API_SERVER */.Z.API_SERVER;
|
|
|
// let size;
|
|
|
console.log("disabledDownload---", disabledDownload);
|
|
|
var unit = 1024 * 1024;
|
|
|
var maxSize = 10 * unit;
|
|
|
var closeRef = (0,react.useRef)();
|
|
|
if ((_data = data) !== null && _data !== void 0 && _data.startsWith("/api") && type !== "txt") {
|
|
|
data = env/* default.API_SERVER */.Z.API_SERVER + data;
|
|
|
}
|
|
|
// if (type === "office") {
|
|
|
// size = parseUrl(data).filesize
|
|
|
// if (size > maxSize) {
|
|
|
// type = "other"
|
|
|
// }
|
|
|
// }
|
|
|
if (filename) monacoEditor.filename = filename;
|
|
|
(0,react.useEffect)(function () {
|
|
|
var _document$cookie, _document$cookie$repl;
|
|
|
var cookies = (_document$cookie = document.cookie) === null || _document$cookie === void 0 ? void 0 : (_document$cookie$repl = _document$cookie.replace(/\s/g, "")) === null || _document$cookie$repl === void 0 ? void 0 : _document$cookie$repl.split(";");
|
|
|
cookies === null || cookies === void 0 ? void 0 : cookies.map(function (item) {
|
|
|
var i = item.split("=");
|
|
|
if (i[0] === '_educoder_session') {
|
|
|
setToken(i[1]);
|
|
|
}
|
|
|
});
|
|
|
}, []);
|
|
|
(0,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.ONLYOFFICE */.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: handleClick,
|
|
|
children: [/*#__PURE__*/(0,jsx_runtime.jsx)(ArrowDownOutlined/* default */.Z, {}), "\u70B9\u51FB\u4E0B\u8F7D"]
|
|
|
})
|
|
|
})]
|
|
|
});
|
|
|
});
|
|
|
|
|
|
/***/ }),
|
|
|
|
|
|
/***/ 12768:
|
|
|
/*!*********************************************************!*\
|
|
|
!*** ./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/helpers/objectSpread2.js
|
|
|
var objectSpread2 = __webpack_require__(42122);
|
|
|
var objectSpread2_default = /*#__PURE__*/__webpack_require__.n(objectSpread2);
|
|
|
// EXTERNAL MODULE: ./node_modules/@babel/runtime/helpers/toConsumableArray.js
|
|
|
var toConsumableArray = __webpack_require__(861);
|
|
|
var toConsumableArray_default = /*#__PURE__*/__webpack_require__.n(toConsumableArray);
|
|
|
// EXTERNAL MODULE: ./node_modules/@babel/runtime/helpers/createForOfIteratorHelper.js
|
|
|
var createForOfIteratorHelper = __webpack_require__(74704);
|
|
|
var createForOfIteratorHelper_default = /*#__PURE__*/__webpack_require__.n(createForOfIteratorHelper);
|
|
|
// EXTERNAL MODULE: ./node_modules/@babel/runtime/helpers/slicedToArray.js
|
|
|
var slicedToArray = __webpack_require__(27424);
|
|
|
var slicedToArray_default = /*#__PURE__*/__webpack_require__.n(slicedToArray);
|
|
|
// EXTERNAL MODULE: ./node_modules/react/index.js
|
|
|
var react = __webpack_require__(67294);
|
|
|
// EXTERNAL MODULE: ./node_modules/katex/dist/katex.min.css
|
|
|
var katex_min = __webpack_require__(81897);
|
|
|
// EXTERNAL MODULE: ./node_modules/marked/lib/marked.js
|
|
|
var marked = __webpack_require__(47084);
|
|
|
var marked_default = /*#__PURE__*/__webpack_require__.n(marked);
|
|
|
// EXTERNAL MODULE: ./node_modules/marked/src/helpers.js
|
|
|
var helpers = __webpack_require__(90621);
|
|
|
;// 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/src/prettify.js
|
|
|
var prettify = __webpack_require__(11771);
|
|
|
// EXTERNAL MODULE: ./node_modules/hls.js/dist/hls.js
|
|
|
var dist_hls = __webpack_require__(67631);
|
|
|
var hls_default = /*#__PURE__*/__webpack_require__.n(dist_hls);
|
|
|
// EXTERNAL MODULE: ./src/utils/env.ts + 1 modules
|
|
|
var env = __webpack_require__(59758);
|
|
|
// EXTERNAL MODULE: ./node_modules/katex/dist/katex.js
|
|
|
var katex = __webpack_require__(20527);
|
|
|
// EXTERNAL MODULE: ./node_modules/uuid/dist/esm-browser/v4.js + 4 modules
|
|
|
var v4 = __webpack_require__(25934);
|
|
|
// EXTERNAL MODULE: ./src/components/PreviewAll/index.tsx + 1 modules
|
|
|
var PreviewAll = __webpack_require__(36579);
|
|
|
// EXTERNAL MODULE: ./node_modules/react/jsx-runtime.js
|
|
|
var jsx_runtime = __webpack_require__(85893);
|
|
|
;// 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.useState)(""),
|
|
|
_useState2 = slicedToArray_default()(_useState, 2),
|
|
|
data = _useState2[0],
|
|
|
setData = _useState2[1];
|
|
|
var _useState3 = (0,react.useState)("office"),
|
|
|
_useState4 = slicedToArray_default()(_useState3, 2),
|
|
|
type = _useState4[0],
|
|
|
setType = _useState4[1];
|
|
|
var _useState5 = (0,react.useState)([]),
|
|
|
_useState6 = slicedToArray_default()(_useState5, 2),
|
|
|
projectValue = _useState6[0],
|
|
|
setProjectValue = _useState6[1];
|
|
|
var classNamesRef = (0,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.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.API_SERVER */.Z.API_SERVER + "/api/attachments/").replace(reg2, '"' + env/* default.API_SERVER */.Z.API_SERVER + "/api/attachments/").replace(reg3, '"' + env/* default.API_SERVER */.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.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.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.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.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 ? 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 (hls_default().isSupported()) {
|
|
|
var hls = new (hls_default())();
|
|
|
hls.loadSource(item.src);
|
|
|
hls.attachMedia(item);
|
|
|
}
|
|
|
}
|
|
|
});
|
|
|
};
|
|
|
(0,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 ? 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("");
|
|
|
}
|
|
|
})]
|
|
|
});
|
|
|
});
|
|
|
|
|
|
/***/ }),
|
|
|
|
|
|
/***/ 97501:
|
|
|
/*!*************************************************************!*\
|
|
|
!*** ./src/components/markdown-editor/code-block/index.tsx ***!
|
|
|
\*************************************************************/
|
|
|
/***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) {
|
|
|
|
|
|
"use strict";
|
|
|
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
|
|
|
/* harmony export */ "h": function() { return /* binding */ MyCodeMirror; }
|
|
|
/* harmony export */ });
|
|
|
/* harmony import */ var _root_workspace_ppte5yg23_local_v9_node_modules_babel_runtime_helpers_objectSpread2_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./node_modules/@babel/runtime/helpers/objectSpread2.js */ 42122);
|
|
|
/* harmony import */ var _root_workspace_ppte5yg23_local_v9_node_modules_babel_runtime_helpers_objectSpread2_js__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_root_workspace_ppte5yg23_local_v9_node_modules_babel_runtime_helpers_objectSpread2_js__WEBPACK_IMPORTED_MODULE_0__);
|
|
|
/* harmony import */ var _root_workspace_ppte5yg23_local_v9_node_modules_babel_runtime_helpers_slicedToArray_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./node_modules/@babel/runtime/helpers/slicedToArray.js */ 27424);
|
|
|
/* harmony import */ var _root_workspace_ppte5yg23_local_v9_node_modules_babel_runtime_helpers_slicedToArray_js__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_root_workspace_ppte5yg23_local_v9_node_modules_babel_runtime_helpers_slicedToArray_js__WEBPACK_IMPORTED_MODULE_1__);
|
|
|
/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! react */ 67294);
|
|
|
/* harmony import */ var antd__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! antd */ 79035);
|
|
|
/* harmony import */ var antd__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! antd */ 25159);
|
|
|
/* harmony import */ var antd__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! antd */ 71577);
|
|
|
/* harmony import */ var codemirror__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! codemirror */ 4631);
|
|
|
/* harmony import */ var codemirror__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__webpack_require__.n(codemirror__WEBPACK_IMPORTED_MODULE_3__);
|
|
|
/* harmony import */ var codemirror_lib_codemirror_css__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! codemirror/lib/codemirror.css */ 71749);
|
|
|
/* harmony import */ var codemirror_theme_blackboard_css__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! codemirror/theme/blackboard.css */ 30483);
|
|
|
/* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! react/jsx-runtime */ 85893);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
var Option = antd__WEBPACK_IMPORTED_MODULE_7__/* ["default"].Option */ .Z.Option;
|
|
|
|
|
|
//https://github.com/codemirror/CodeMirror/issues/4838
|
|
|
var formItemLayout = {
|
|
|
labelCol: {
|
|
|
span: 4
|
|
|
},
|
|
|
wrapperCol: {
|
|
|
span: 20
|
|
|
}
|
|
|
};
|
|
|
var LanguageDesc = {
|
|
|
asp: ['ASP', 'vbscript'],
|
|
|
actionscript: ['ActionScript(3.0)/Flash/Flex', 'clike'],
|
|
|
bash: ['Bash/Bat', 'shell'],
|
|
|
css: ['CSS', 'css'],
|
|
|
c: ['C', 'clike'],
|
|
|
cpp: ['C++', 'clike'],
|
|
|
csharp: ['C#', 'clike'],
|
|
|
coffeescript: ['CoffeeScript', 'coffeescript'],
|
|
|
d: ['D', 'd'],
|
|
|
dart: ['Dart', 'dart'],
|
|
|
delphi: ['Delphi/Pascal', 'pascal'],
|
|
|
erlang: ['Erlang', 'erlang'],
|
|
|
go: ['Golang', 'go'],
|
|
|
groovy: ['Groovy', 'groovy'],
|
|
|
html: ['HTML', 'text/html'],
|
|
|
java: ['Java', 'clike'],
|
|
|
json: ['JSON', 'text/json'],
|
|
|
javascript: ['Javascript', 'javascript'],
|
|
|
lua: ['Lua', 'lua'],
|
|
|
less: ['LESS', 'css'],
|
|
|
markdown: ['Markdown', 'gfm'],
|
|
|
'objective-c': ['Objective-C', 'clike'],
|
|
|
php: ['PHP', 'php'],
|
|
|
perl: ['Perl', 'perl'],
|
|
|
python: ['Python', 'python'],
|
|
|
r: ['R', 'r'],
|
|
|
rst: ['reStructedText', 'rst'],
|
|
|
ruby: ['Ruby', 'ruby'],
|
|
|
sql: ['SQL', 'sql'],
|
|
|
sass: ['SASS/SCSS', 'sass'],
|
|
|
shell: ['Shell', 'shell'],
|
|
|
scala: ['Scala', 'clike'],
|
|
|
swift: ['Swift', 'clike'],
|
|
|
vb: ['VB/VBScript', 'vb'],
|
|
|
xml: ['XML', 'text/xml'],
|
|
|
yaml: ['YAML', 'yaml']
|
|
|
};
|
|
|
/* harmony default export */ __webpack_exports__["Z"] = (function (_ref) {
|
|
|
var callback = _ref.callback,
|
|
|
onCancel = _ref.onCancel;
|
|
|
var _useState = (0,react__WEBPACK_IMPORTED_MODULE_2__.useState)('python'),
|
|
|
_useState2 = _root_workspace_ppte5yg23_local_v9_node_modules_babel_runtime_helpers_slicedToArray_js__WEBPACK_IMPORTED_MODULE_1___default()(_useState, 2),
|
|
|
mode = _useState2[0],
|
|
|
setMode = _useState2[1];
|
|
|
function onSetMode(value) {
|
|
|
setMode(LanguageDesc[value][1]);
|
|
|
}
|
|
|
function onSubmit(values) {
|
|
|
callback(values);
|
|
|
}
|
|
|
return /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_6__.jsxs)(antd__WEBPACK_IMPORTED_MODULE_8__/* ["default"] */ .Z, _root_workspace_ppte5yg23_local_v9_node_modules_babel_runtime_helpers_objectSpread2_js__WEBPACK_IMPORTED_MODULE_0___default()(_root_workspace_ppte5yg23_local_v9_node_modules_babel_runtime_helpers_objectSpread2_js__WEBPACK_IMPORTED_MODULE_0___default()({}, formItemLayout), {}, {
|
|
|
className: "code-block-panel",
|
|
|
initialValues: {
|
|
|
language: 'python',
|
|
|
content: ''
|
|
|
},
|
|
|
onFinish: onSubmit,
|
|
|
children: [/*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_6__.jsx)(antd__WEBPACK_IMPORTED_MODULE_8__/* ["default"].Item */ .Z.Item, {
|
|
|
label: "\u4EE3\u7801\u8BED\u8A00",
|
|
|
name: "language",
|
|
|
children: /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_6__.jsx)(antd__WEBPACK_IMPORTED_MODULE_7__/* ["default"] */ .Z, {
|
|
|
getPopupContainer: function getPopupContainer(trigger) {
|
|
|
return trigger.parentNode;
|
|
|
},
|
|
|
onChange: onSetMode,
|
|
|
children: Object.keys(LanguageDesc).map(function (item) {
|
|
|
return /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_6__.jsx)(Option, {
|
|
|
value: item,
|
|
|
children: LanguageDesc[item][0]
|
|
|
}, item);
|
|
|
})
|
|
|
})
|
|
|
}), /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_6__.jsx)(antd__WEBPACK_IMPORTED_MODULE_8__/* ["default"].Item */ .Z.Item, {
|
|
|
label: "\u4EE3\u7801\u5185\u5BB9",
|
|
|
name: "content",
|
|
|
rules: [{
|
|
|
required: true,
|
|
|
message: '请输入代码内容'
|
|
|
}],
|
|
|
children: /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_6__.jsx)(MyCodeMirror, {
|
|
|
mode: mode
|
|
|
})
|
|
|
}), /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_6__.jsxs)("div", {
|
|
|
className: "flex-container flex-end",
|
|
|
children: [/*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_6__.jsx)(antd__WEBPACK_IMPORTED_MODULE_9__/* ["default"] */ .ZP, {
|
|
|
type: "primary",
|
|
|
htmlType: "submit",
|
|
|
style: {
|
|
|
marginRight: 10
|
|
|
},
|
|
|
children: "\u786E\u5B9A"
|
|
|
}), /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_6__.jsx)(antd__WEBPACK_IMPORTED_MODULE_9__/* ["default"] */ .ZP, {
|
|
|
type: "ghost",
|
|
|
onClick: onCancel,
|
|
|
children: "\u53D6\u6D88"
|
|
|
})]
|
|
|
})]
|
|
|
}));
|
|
|
});
|
|
|
function MyCodeMirror(_ref2) {
|
|
|
var value = _ref2.value,
|
|
|
onChange = _ref2.onChange,
|
|
|
mode = _ref2.mode,
|
|
|
_ref2$options = _ref2.options,
|
|
|
options = _ref2$options === void 0 ? {} : _ref2$options;
|
|
|
var el = (0,react__WEBPACK_IMPORTED_MODULE_2__.useRef)();
|
|
|
var _useState3 = (0,react__WEBPACK_IMPORTED_MODULE_2__.useState)(),
|
|
|
_useState4 = _root_workspace_ppte5yg23_local_v9_node_modules_babel_runtime_helpers_slicedToArray_js__WEBPACK_IMPORTED_MODULE_1___default()(_useState3, 2),
|
|
|
cm = _useState4[0],
|
|
|
setCm = _useState4[1];
|
|
|
(0,react__WEBPACK_IMPORTED_MODULE_2__.useEffect)(function () {
|
|
|
if (cm) {
|
|
|
var onChangeHandler = function onChangeHandler(cm) {
|
|
|
var content = cm.getValue();
|
|
|
onChange && onChange(content);
|
|
|
};
|
|
|
cm.on('change', onChangeHandler);
|
|
|
return function () {
|
|
|
cm.off('change', onChangeHandler);
|
|
|
};
|
|
|
}
|
|
|
}, [cm, onChange]);
|
|
|
(0,react__WEBPACK_IMPORTED_MODULE_2__.useEffect)(function () {
|
|
|
if (cm) {
|
|
|
cm.setOption('mode', mode);
|
|
|
}
|
|
|
}, [cm, mode]);
|
|
|
(0,react__WEBPACK_IMPORTED_MODULE_2__.useEffect)(function () {
|
|
|
if (cm) {
|
|
|
if (value !== cm.getValue() || value === '') {
|
|
|
setTimeout(function () {
|
|
|
cm.setValue(value || '');
|
|
|
}, 300);
|
|
|
}
|
|
|
}
|
|
|
}, [cm, value]);
|
|
|
(0,react__WEBPACK_IMPORTED_MODULE_2__.useEffect)(function () {
|
|
|
if (el.current && !cm) {
|
|
|
var instance = codemirror__WEBPACK_IMPORTED_MODULE_3___default().fromTextArea(el.current, _root_workspace_ppte5yg23_local_v9_node_modules_babel_runtime_helpers_objectSpread2_js__WEBPACK_IMPORTED_MODULE_0___default()({
|
|
|
mode: mode,
|
|
|
lineNumbers: true,
|
|
|
lineWrapping: true,
|
|
|
autoCloseBrackets: true,
|
|
|
tabSize: 4,
|
|
|
autofocus: true,
|
|
|
autoCloseTags: true,
|
|
|
matchBrackets: true,
|
|
|
styleActiveLine: true
|
|
|
}, options));
|
|
|
setCm(instance);
|
|
|
}
|
|
|
}, [el.current, cm]);
|
|
|
return /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_6__.jsx)("div", {
|
|
|
className: "my-codemirror-container",
|
|
|
children: /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_6__.jsx)("textarea", {
|
|
|
ref: el
|
|
|
})
|
|
|
});
|
|
|
}
|
|
|
|
|
|
/***/ }),
|
|
|
|
|
|
/***/ 55373:
|
|
|
/*!***************************************************************!*\
|
|
|
!*** ./src/components/markdown-editor/index.tsx + 10 modules ***!
|
|
|
\***************************************************************/
|
|
|
/***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) {
|
|
|
|
|
|
"use strict";
|
|
|
|
|
|
// EXPORTS
|
|
|
__webpack_require__.d(__webpack_exports__, {
|
|
|
"Z": function() { return /* binding */ markdown_editor; }
|
|
|
});
|
|
|
|
|
|
// EXTERNAL MODULE: ./node_modules/@babel/runtime/helpers/createForOfIteratorHelper.js
|
|
|
var createForOfIteratorHelper = __webpack_require__(74704);
|
|
|
var createForOfIteratorHelper_default = /*#__PURE__*/__webpack_require__.n(createForOfIteratorHelper);
|
|
|
// EXTERNAL MODULE: ./node_modules/@babel/runtime/helpers/regeneratorRuntime.js
|
|
|
var regeneratorRuntime = __webpack_require__(17061);
|
|
|
var regeneratorRuntime_default = /*#__PURE__*/__webpack_require__.n(regeneratorRuntime);
|
|
|
// EXTERNAL MODULE: ./node_modules/@babel/runtime/helpers/asyncToGenerator.js
|
|
|
var asyncToGenerator = __webpack_require__(17156);
|
|
|
var asyncToGenerator_default = /*#__PURE__*/__webpack_require__.n(asyncToGenerator);
|
|
|
// EXTERNAL MODULE: ./node_modules/@babel/runtime/helpers/slicedToArray.js
|
|
|
var slicedToArray = __webpack_require__(27424);
|
|
|
var slicedToArray_default = /*#__PURE__*/__webpack_require__.n(slicedToArray);
|
|
|
// EXTERNAL MODULE: ./node_modules/@babel/runtime/helpers/defineProperty.js
|
|
|
var defineProperty = __webpack_require__(38416);
|
|
|
var defineProperty_default = /*#__PURE__*/__webpack_require__.n(defineProperty);
|
|
|
// EXTERNAL MODULE: ./node_modules/react/index.js
|
|
|
var react = __webpack_require__(67294);
|
|
|
// EXTERNAL MODULE: ./node_modules/codemirror/lib/codemirror.js
|
|
|
var codemirror = __webpack_require__(4631);
|
|
|
var codemirror_default = /*#__PURE__*/__webpack_require__.n(codemirror);
|
|
|
// EXTERNAL MODULE: ./node_modules/resize-observer-polyfill/dist/ResizeObserver.es.js
|
|
|
var ResizeObserver_es = __webpack_require__(91033);
|
|
|
// EXTERNAL MODULE: ./node_modules/codemirror/lib/codemirror.css
|
|
|
var lib_codemirror = __webpack_require__(71749);
|
|
|
// EXTERNAL MODULE: ./node_modules/codemirror/addon/edit/closetag.js
|
|
|
var closetag = __webpack_require__(57341);
|
|
|
// EXTERNAL MODULE: ./node_modules/codemirror/addon/edit/closebrackets.js
|
|
|
var closebrackets = __webpack_require__(82801);
|
|
|
// EXTERNAL MODULE: ./node_modules/codemirror/addon/display/placeholder.js
|
|
|
var placeholder = __webpack_require__(88386);
|
|
|
// EXTERNAL MODULE: ./node_modules/codemirror/mode/markdown/markdown.js
|
|
|
var markdown = __webpack_require__(49047);
|
|
|
// EXTERNAL MODULE: ./node_modules/codemirror/mode/stex/stex.js
|
|
|
var stex = __webpack_require__(80785);
|
|
|
;// CONCATENATED MODULE: ./src/components/markdown-editor/index.less
|
|
|
// extracted by mini-css-extract-plugin
|
|
|
|
|
|
// EXTERNAL MODULE: ./src/components/RenderHtml/index.tsx + 1 modules
|
|
|
var RenderHtml = __webpack_require__(12768);
|
|
|
// EXTERNAL MODULE: ./node_modules/react/jsx-runtime.js
|
|
|
var jsx_runtime = __webpack_require__(85893);
|
|
|
;// CONCATENATED MODULE: ./src/components/RenderHtml/stex.tsx
|
|
|
|
|
|
// const latexjs = require('latex-l.js/dist/latex.js');
|
|
|
// import "latex-l.js/dist/css/base.css"
|
|
|
|
|
|
|
|
|
/* harmony default export */ var RenderHtml_stex = (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;
|
|
|
var html = (0,react.useMemo)(function () {
|
|
|
// try {
|
|
|
// const latex = value || 'This is some text';
|
|
|
// let generator = new latexjs.default.HtmlGenerator({ hyphenate: true })
|
|
|
// let doc = latexjs.default.parse(latex, { generator: generator }).htmlDocument()
|
|
|
// return doc.body.innerHTML
|
|
|
// }catch(e){
|
|
|
// console.log("e:",e)
|
|
|
// return "错误的latex语法,请检查"
|
|
|
// }
|
|
|
return "";
|
|
|
}, [value]);
|
|
|
return /*#__PURE__*/(0,jsx_runtime.jsx)(jsx_runtime.Fragment, {
|
|
|
children: /*#__PURE__*/(0,jsx_runtime.jsx)("div", {
|
|
|
dangerouslySetInnerHTML: {
|
|
|
__html: html
|
|
|
}
|
|
|
})
|
|
|
});
|
|
|
});
|
|
|
// EXTERNAL MODULE: ./node_modules/@babel/runtime/helpers/objectSpread2.js
|
|
|
var objectSpread2 = __webpack_require__(42122);
|
|
|
var objectSpread2_default = /*#__PURE__*/__webpack_require__.n(objectSpread2);
|
|
|
;// CONCATENATED MODULE: ./src/components/markdown-editor/toolbar/index.less
|
|
|
// extracted by mini-css-extract-plugin
|
|
|
|
|
|
;// CONCATENATED MODULE: ./src/components/markdown-editor/css/iconfont.css
|
|
|
// extracted by mini-css-extract-plugin
|
|
|
|
|
|
;// CONCATENATED MODULE: ./src/components/markdown-editor/toolbar/index.tsx
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
var DEFAULTICONS = [{
|
|
|
title: '粗体',
|
|
|
icon: 'icon-bold',
|
|
|
actionName: 'bold'
|
|
|
}, {
|
|
|
title: '斜体',
|
|
|
icon: 'icon-italic',
|
|
|
actionName: 'italic'
|
|
|
}, '|', {
|
|
|
title: '无序列表',
|
|
|
icon: 'icon-unorder-list',
|
|
|
actionName: 'list-ul'
|
|
|
}, {
|
|
|
title: '有序列表',
|
|
|
icon: 'icon-order-list',
|
|
|
actionName: 'list-ol'
|
|
|
}, '|', {
|
|
|
title: '行内代码',
|
|
|
icon: 'icon-code',
|
|
|
actionName: 'code'
|
|
|
}, {
|
|
|
title: '代码块(多语言风格)',
|
|
|
icon: 'icon-file-code',
|
|
|
actionName: 'code-block'
|
|
|
}, {
|
|
|
title: '链接',
|
|
|
icon: 'icon-link',
|
|
|
actionName: 'link'
|
|
|
}, '|', {
|
|
|
title: '行内公式',
|
|
|
icon: 'icon-sum',
|
|
|
actionName: 'inline-latex'
|
|
|
}, {
|
|
|
title: '多行公式',
|
|
|
icon: 'icon-formula',
|
|
|
actionName: 'latex'
|
|
|
}, '|', {
|
|
|
title: '添加图片',
|
|
|
icon: 'icon-picture',
|
|
|
actionName: 'upload-image'
|
|
|
}, {
|
|
|
title: '表格',
|
|
|
icon: 'icon-table',
|
|
|
actionName: 'add-table'
|
|
|
}, '|', {
|
|
|
title: '换行',
|
|
|
icon: 'icon-minus',
|
|
|
actionName: 'line-break'
|
|
|
}, {
|
|
|
title: '清空',
|
|
|
icon: 'icon-eraser',
|
|
|
actionName: 'eraser'
|
|
|
}];
|
|
|
function AButton(_ref) {
|
|
|
var onActionCallback = _ref.onActionCallback,
|
|
|
title = _ref.title,
|
|
|
icon = _ref.icon,
|
|
|
actionName = _ref.actionName,
|
|
|
_ref$className = _ref.className,
|
|
|
className = _ref$className === void 0 ? '' : _ref$className,
|
|
|
children = _ref.children;
|
|
|
function onAction() {
|
|
|
onActionCallback(actionName);
|
|
|
}
|
|
|
return /*#__PURE__*/(0,jsx_runtime.jsxs)("a", {
|
|
|
title: title,
|
|
|
className: className,
|
|
|
onClick: onAction,
|
|
|
children: [/*#__PURE__*/(0,jsx_runtime.jsx)("i", {
|
|
|
className: "md-iconfont ".concat(icon)
|
|
|
}), children]
|
|
|
});
|
|
|
}
|
|
|
/* harmony default export */ var toolbar = (function (_ref2) {
|
|
|
var watch = _ref2.watch,
|
|
|
showNullButton = _ref2.showNullButton,
|
|
|
showNullProgramButton = _ref2.showNullProgramButton,
|
|
|
onActionCallback = _ref2.onActionCallback,
|
|
|
fullScreen = _ref2.fullScreen,
|
|
|
insertTemp = _ref2.insertTemp,
|
|
|
hidetoolBar = _ref2.hidetoolBar;
|
|
|
var icons = [].concat(DEFAULTICONS, [{
|
|
|
title: "".concat(watch ? '关闭实时预览' : '开启实时预览'),
|
|
|
icon: "".concat(watch ? 'icon-eye-slash' : 'icon-eye'),
|
|
|
actionName: 'trigger-watch'
|
|
|
}]);
|
|
|
return /*#__PURE__*/(0,jsx_runtime.jsxs)("ul", {
|
|
|
className: "markdown-toolbar-container",
|
|
|
children: [!hidetoolBar && icons.map(function (item, index) {
|
|
|
return /*#__PURE__*/(0,jsx_runtime.jsx)("li", {
|
|
|
children: item.actionName ? /*#__PURE__*/(0,jsx_runtime.jsx)(AButton, objectSpread2_default()(objectSpread2_default()({}, item), {}, {
|
|
|
onActionCallback: onActionCallback
|
|
|
})) : /*#__PURE__*/(0,jsx_runtime.jsx)("span", {
|
|
|
className: "v-line"
|
|
|
})
|
|
|
}, index);
|
|
|
}), showNullButton ? /*#__PURE__*/(0,jsx_runtime.jsx)("li", {
|
|
|
children: /*#__PURE__*/(0,jsx_runtime.jsx)(AButton, {
|
|
|
icon: "icon-edit insert-blank",
|
|
|
className: "btn-null",
|
|
|
title: "\u589E\u52A0\u586B\u7A7A",
|
|
|
actionName: "add-null-ch",
|
|
|
onActionCallback: onActionCallback,
|
|
|
children: /*#__PURE__*/(0,jsx_runtime.jsx)("span", {
|
|
|
className: "fill-tip",
|
|
|
children: "\u70B9\u51FB\u63D2\u5165\b\u586B\u7A7A\u9879"
|
|
|
})
|
|
|
})
|
|
|
}) : null, showNullProgramButton ? /*#__PURE__*/(0,jsx_runtime.jsxs)(jsx_runtime.Fragment, {
|
|
|
children: [/*#__PURE__*/(0,jsx_runtime.jsx)("li", {
|
|
|
children: /*#__PURE__*/(0,jsx_runtime.jsx)(AButton, {
|
|
|
icon: "icon-edit insert-blank",
|
|
|
className: "btn-null",
|
|
|
title: "\u589E\u52A0\u586B\u7A7A",
|
|
|
actionName: "add-signal",
|
|
|
onActionCallback: onActionCallback,
|
|
|
children: /*#__PURE__*/(0,jsx_runtime.jsx)("span", {
|
|
|
className: "fill-tip",
|
|
|
children: "\u6DFB\u52A0\u5355\u884C\u586B\u7A7A\u9879"
|
|
|
})
|
|
|
})
|
|
|
}), /*#__PURE__*/(0,jsx_runtime.jsx)("li", {
|
|
|
children: /*#__PURE__*/(0,jsx_runtime.jsx)(AButton, {
|
|
|
icon: "icon-uniE900 insert-blank",
|
|
|
className: "btn-null",
|
|
|
title: "\u589E\u52A0\u586B\u7A7A",
|
|
|
actionName: "add-multiple",
|
|
|
onActionCallback: onActionCallback,
|
|
|
children: /*#__PURE__*/(0,jsx_runtime.jsx)("span", {
|
|
|
className: "fill-tip",
|
|
|
children: "\u6DFB\u52A0\u591A\u884C\u586B\u7A7A\u9879"
|
|
|
})
|
|
|
})
|
|
|
})]
|
|
|
}) : null, insertTemp && /*#__PURE__*/(0,jsx_runtime.jsx)("li", {
|
|
|
children: /*#__PURE__*/(0,jsx_runtime.jsx)(AButton, {
|
|
|
icon: "icon-edit",
|
|
|
className: "btn-null",
|
|
|
title: "\u63D2\u5165\u6A21\u677F",
|
|
|
actionName: "inster-template-".concat(insertTemp),
|
|
|
onActionCallback: onActionCallback,
|
|
|
children: /*#__PURE__*/(0,jsx_runtime.jsx)("span", {
|
|
|
className: "fill-tip",
|
|
|
children: "\u63D2\u5165\u6A21\u677F"
|
|
|
})
|
|
|
})
|
|
|
}), /*#__PURE__*/(0,jsx_runtime.jsx)("li", {
|
|
|
className: "btn-full-screen",
|
|
|
children: /*#__PURE__*/(0,jsx_runtime.jsx)(AButton, {
|
|
|
icon: "".concat(fullScreen ? 'icon-shrink' : 'icon-enlarge'),
|
|
|
title: fullScreen ? '关闭全屏' : '开启全屏',
|
|
|
actionName: "trigger-full-screen",
|
|
|
onActionCallback: onActionCallback
|
|
|
})
|
|
|
})]
|
|
|
});
|
|
|
});
|
|
|
// EXTERNAL MODULE: ./src/components/modal.tsx
|
|
|
var modal = __webpack_require__(12264);
|
|
|
// EXTERNAL MODULE: ./node_modules/antd/es/form/index.js + 17 modules
|
|
|
var es_form = __webpack_require__(25159);
|
|
|
// EXTERNAL MODULE: ./node_modules/antd/es/input/index.js + 5 modules
|
|
|
var input = __webpack_require__(79531);
|
|
|
// EXTERNAL MODULE: ./node_modules/antd/es/button/index.js
|
|
|
var es_button = __webpack_require__(71577);
|
|
|
;// CONCATENATED MODULE: ./src/components/markdown-editor/link/index.tsx
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
var formItemLayout = {
|
|
|
labelCol: {
|
|
|
span: 4
|
|
|
},
|
|
|
wrapperCol: {
|
|
|
span: 20
|
|
|
}
|
|
|
};
|
|
|
/* harmony default export */ var markdown_editor_link = (function (_ref) {
|
|
|
var callback = _ref.callback,
|
|
|
onCancel = _ref.onCancel;
|
|
|
function onSubmit(values) {
|
|
|
callback(values);
|
|
|
}
|
|
|
return /*#__PURE__*/(0,jsx_runtime.jsxs)(es_form/* default */.Z, objectSpread2_default()(objectSpread2_default()({}, formItemLayout), {}, {
|
|
|
initialValues: {
|
|
|
link: 'http://',
|
|
|
title: ''
|
|
|
},
|
|
|
className: "link-panel",
|
|
|
onFinish: onSubmit,
|
|
|
children: [/*#__PURE__*/(0,jsx_runtime.jsx)(es_form/* default.Item */.Z.Item, {
|
|
|
label: "\u94FE\u63A5\u5730\u5740",
|
|
|
name: "link",
|
|
|
rules: [{
|
|
|
required: true,
|
|
|
message: '请输入链接地址'
|
|
|
}],
|
|
|
children: /*#__PURE__*/(0,jsx_runtime.jsx)(input/* default */.Z, {})
|
|
|
}), /*#__PURE__*/(0,jsx_runtime.jsx)(es_form/* default.Item */.Z.Item, {
|
|
|
label: "\u94FE\u63A5\u6807\u9898",
|
|
|
name: "title",
|
|
|
rules: [{
|
|
|
required: true,
|
|
|
message: '请输入链接标题'
|
|
|
}],
|
|
|
children: /*#__PURE__*/(0,jsx_runtime.jsx)(input/* default */.Z, {})
|
|
|
}), /*#__PURE__*/(0,jsx_runtime.jsxs)("div", {
|
|
|
className: "flex-container flex-end",
|
|
|
children: [/*#__PURE__*/(0,jsx_runtime.jsx)(es_button/* default */.ZP, {
|
|
|
type: "primary",
|
|
|
htmlType: "submit",
|
|
|
style: {
|
|
|
marginRight: 10
|
|
|
},
|
|
|
children: "\u786E\u5B9A"
|
|
|
}), /*#__PURE__*/(0,jsx_runtime.jsx)(es_button/* default */.ZP, {
|
|
|
type: "ghost",
|
|
|
onClick: onCancel,
|
|
|
children: "\u53D6\u6D88"
|
|
|
})]
|
|
|
})]
|
|
|
}));
|
|
|
});
|
|
|
// EXTERNAL MODULE: ./src/components/markdown-editor/code-block/index.tsx
|
|
|
var code_block = __webpack_require__(97501);
|
|
|
// EXTERNAL MODULE: ./node_modules/antd/es/message/index.js + 4 modules
|
|
|
var message = __webpack_require__(2453);
|
|
|
;// CONCATENATED MODULE: ./src/components/markdown-editor/upload-image/index.less
|
|
|
// extracted by mini-css-extract-plugin
|
|
|
|
|
|
// EXTERNAL MODULE: ./src/pages/tasks/util.js
|
|
|
var util = __webpack_require__(96403);
|
|
|
;// CONCATENATED MODULE: ./src/components/markdown-editor/upload-image/index.tsx
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
var useForm = es_form/* default.useForm */.Z.useForm;
|
|
|
var style = {
|
|
|
width: 280,
|
|
|
marginRight: 10
|
|
|
};
|
|
|
var upload_image_formItemLayout = {
|
|
|
labelCol: {
|
|
|
span: 5
|
|
|
},
|
|
|
wrapperCol: {
|
|
|
span: 19
|
|
|
}
|
|
|
};
|
|
|
/* harmony default export */ var upload_image = (function (_ref) {
|
|
|
var callback = _ref.callback,
|
|
|
onCancel = _ref.onCancel;
|
|
|
var _useForm = useForm(),
|
|
|
_useForm2 = slicedToArray_default()(_useForm, 1),
|
|
|
form = _useForm2[0];
|
|
|
var nameRef = (0,react.useRef)();
|
|
|
function onSubmit(values) {
|
|
|
callback(objectSpread2_default()(objectSpread2_default()({}, values), {}, {
|
|
|
name: nameRef.current
|
|
|
}));
|
|
|
}
|
|
|
function onAddUrl(data, file) {
|
|
|
if (data.status === -1) {
|
|
|
message/* default.error */.ZP.error(data.message);
|
|
|
return;
|
|
|
}
|
|
|
form.setFieldsValue({
|
|
|
src: "/api/attachments/".concat(data.id),
|
|
|
type: file.type
|
|
|
});
|
|
|
}
|
|
|
function onFileChange(e) {
|
|
|
var file = e.target.files[0];
|
|
|
nameRef.current = file.name;
|
|
|
uploadImage(file, onAddUrl);
|
|
|
}
|
|
|
return /*#__PURE__*/(0,jsx_runtime.jsxs)(es_form/* default */.Z, objectSpread2_default()(objectSpread2_default()({
|
|
|
form: form
|
|
|
}, upload_image_formItemLayout), {}, {
|
|
|
className: "upload-image-panel",
|
|
|
onFinish: onSubmit,
|
|
|
style: {
|
|
|
width: 470,
|
|
|
overflow: "hidden"
|
|
|
},
|
|
|
children: [/*#__PURE__*/(0,jsx_runtime.jsx)(es_form/* default.Item */.Z.Item, {
|
|
|
label: "\u56FE\u7247\u5730\u5740",
|
|
|
required: true,
|
|
|
children: /*#__PURE__*/(0,jsx_runtime.jsxs)("div", {
|
|
|
className: "flex-container",
|
|
|
children: [/*#__PURE__*/(0,jsx_runtime.jsx)(es_form/* default.Item */.Z.Item, {
|
|
|
noStyle: true,
|
|
|
name: "src",
|
|
|
rules: [{
|
|
|
required: true,
|
|
|
message: '请输入文件地址'
|
|
|
}],
|
|
|
children: /*#__PURE__*/(0,jsx_runtime.jsx)(input/* default */.Z, {
|
|
|
style: style
|
|
|
})
|
|
|
}), /*#__PURE__*/(0,jsx_runtime.jsx)(UploadButton, {
|
|
|
onFileChange: onFileChange
|
|
|
})]
|
|
|
})
|
|
|
}), /*#__PURE__*/(0,jsx_runtime.jsx)(es_form/* default.Item */.Z.Item, {
|
|
|
label: "\u56FE\u7247\u63CF\u8FF0",
|
|
|
name: "alt"
|
|
|
// rules={[{ required: true, message: '请输入图片描述' }]}
|
|
|
,
|
|
|
children: /*#__PURE__*/(0,jsx_runtime.jsx)(input/* default */.Z, {
|
|
|
style: {
|
|
|
width: 264
|
|
|
}
|
|
|
})
|
|
|
}), /*#__PURE__*/(0,jsx_runtime.jsxs)(es_form/* default.Item */.Z.Item, {
|
|
|
style: {
|
|
|
textAlign: "right"
|
|
|
},
|
|
|
children: [/*#__PURE__*/(0,jsx_runtime.jsx)(es_button/* default */.ZP, {
|
|
|
type: "primary",
|
|
|
htmlType: "submit",
|
|
|
style: {
|
|
|
marginRight: 10
|
|
|
},
|
|
|
children: "\u786E\u5B9A"
|
|
|
}), /*#__PURE__*/(0,jsx_runtime.jsx)(es_button/* default */.ZP, {
|
|
|
type: "default",
|
|
|
onClick: onCancel,
|
|
|
children: "\u53D6\u6D88"
|
|
|
})]
|
|
|
})]
|
|
|
}));
|
|
|
});
|
|
|
function UploadButton(_ref2) {
|
|
|
var onFileChange = _ref2.onFileChange;
|
|
|
return /*#__PURE__*/(0,jsx_runtime.jsxs)("label", {
|
|
|
className: "upload-button",
|
|
|
style: {
|
|
|
cursor: "pointer"
|
|
|
},
|
|
|
children: ["\u672C\u5730\u4E0A\u4F20", /*#__PURE__*/(0,jsx_runtime.jsx)("input", {
|
|
|
type: "file",
|
|
|
onChange: onFileChange
|
|
|
})]
|
|
|
});
|
|
|
}
|
|
|
function uploadImage(file, callback) {
|
|
|
if (!file) {
|
|
|
throw new String('没有文件');
|
|
|
return;
|
|
|
}
|
|
|
var formData = new FormData();
|
|
|
formData.append('editormd-image-file', file);
|
|
|
formData.append('file_param_name', 'editormd-image-file');
|
|
|
formData.append('byxhr', 'true');
|
|
|
var xhr = new window.XMLHttpRequest();
|
|
|
xhr.withCredentials = true;
|
|
|
xhr.addEventListener('load', function (response) {
|
|
|
callback(JSON.parse(response.target.responseText), file);
|
|
|
}, false);
|
|
|
xhr.addEventListener('error', function (error) {
|
|
|
console.error(error);
|
|
|
}, false);
|
|
|
xhr.open('POST', "".concat(util/* apiPref */.KI, "/api/attachments.json"));
|
|
|
xhr.send(formData);
|
|
|
}
|
|
|
// EXTERNAL MODULE: ./node_modules/antd/es/radio/index.js + 5 modules
|
|
|
var es_radio = __webpack_require__(78045);
|
|
|
// EXTERNAL MODULE: ./node_modules/antd/es/input-number/index.js + 21 modules
|
|
|
var input_number = __webpack_require__(31795);
|
|
|
;// CONCATENATED MODULE: ./src/components/markdown-editor/add-table-panel/index.tsx
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
var RadioGroup = es_radio/* default.Group */.ZP.Group;
|
|
|
var add_table_panel_style = {
|
|
|
margin: '0 8px'
|
|
|
};
|
|
|
/* harmony default export */ var add_table_panel = (function (_ref) {
|
|
|
var callback = _ref.callback,
|
|
|
onCancel = _ref.onCancel;
|
|
|
function onSubmit(values) {
|
|
|
callback(values);
|
|
|
}
|
|
|
return /*#__PURE__*/(0,jsx_runtime.jsxs)(es_form/* default */.Z, {
|
|
|
className: "add-table-panel",
|
|
|
initialValues: {
|
|
|
row: 3,
|
|
|
col: 2,
|
|
|
align: 'default'
|
|
|
},
|
|
|
onFinish: onSubmit,
|
|
|
children: [/*#__PURE__*/(0,jsx_runtime.jsxs)("div", {
|
|
|
className: "flex-container",
|
|
|
style: {
|
|
|
alignItems: "baseline"
|
|
|
},
|
|
|
children: [/*#__PURE__*/(0,jsx_runtime.jsx)("span", {
|
|
|
style: add_table_panel_style,
|
|
|
children: "\u5355\u5143\u683C\u6570\uFF1A"
|
|
|
}), /*#__PURE__*/(0,jsx_runtime.jsx)("span", {
|
|
|
style: add_table_panel_style,
|
|
|
children: "\u884C\u6570"
|
|
|
}), /*#__PURE__*/(0,jsx_runtime.jsx)(es_form/* default.Item */.Z.Item, {
|
|
|
name: "row",
|
|
|
rules: [{
|
|
|
required: true,
|
|
|
message: '请输入行数'
|
|
|
}],
|
|
|
children: /*#__PURE__*/(0,jsx_runtime.jsx)(input_number/* default */.Z, {})
|
|
|
}), /*#__PURE__*/(0,jsx_runtime.jsx)("span", {
|
|
|
style: add_table_panel_style,
|
|
|
children: "\u5217\u6570"
|
|
|
}), /*#__PURE__*/(0,jsx_runtime.jsx)(es_form/* default.Item */.Z.Item, {
|
|
|
name: "col",
|
|
|
rules: [{
|
|
|
required: true,
|
|
|
message: '请输入列数'
|
|
|
}],
|
|
|
children: /*#__PURE__*/(0,jsx_runtime.jsx)(input_number/* default */.Z, {})
|
|
|
})]
|
|
|
}), /*#__PURE__*/(0,jsx_runtime.jsxs)("div", {
|
|
|
className: "flex-container",
|
|
|
style: {
|
|
|
marginTop: 12,
|
|
|
alignItems: "baseline"
|
|
|
},
|
|
|
children: [/*#__PURE__*/(0,jsx_runtime.jsx)("span", {
|
|
|
style: add_table_panel_style,
|
|
|
children: "\u5BF9\u9F50\u65B9\u5F0F\uFF1A"
|
|
|
}), /*#__PURE__*/(0,jsx_runtime.jsx)(es_form/* default.Item */.Z.Item, {
|
|
|
name: "align",
|
|
|
children: /*#__PURE__*/(0,jsx_runtime.jsxs)(RadioGroup, {
|
|
|
children: [/*#__PURE__*/(0,jsx_runtime.jsx)(es_radio/* default */.ZP, {
|
|
|
value: "default",
|
|
|
children: /*#__PURE__*/(0,jsx_runtime.jsx)("i", {
|
|
|
className: "fa fa-align-justify"
|
|
|
})
|
|
|
}), /*#__PURE__*/(0,jsx_runtime.jsx)(es_radio/* default */.ZP, {
|
|
|
value: "left",
|
|
|
children: /*#__PURE__*/(0,jsx_runtime.jsx)("i", {
|
|
|
className: "fa fa-align-left"
|
|
|
})
|
|
|
}), /*#__PURE__*/(0,jsx_runtime.jsx)(es_radio/* default */.ZP, {
|
|
|
value: "center",
|
|
|
children: /*#__PURE__*/(0,jsx_runtime.jsx)("i", {
|
|
|
className: "fa fa-align-center"
|
|
|
})
|
|
|
}), /*#__PURE__*/(0,jsx_runtime.jsx)(es_radio/* default */.ZP, {
|
|
|
value: "right",
|
|
|
children: /*#__PURE__*/(0,jsx_runtime.jsx)("i", {
|
|
|
className: "fa fa-align-right"
|
|
|
})
|
|
|
})]
|
|
|
})
|
|
|
})]
|
|
|
}), /*#__PURE__*/(0,jsx_runtime.jsxs)("div", {
|
|
|
className: "flex-container flex-end",
|
|
|
children: [/*#__PURE__*/(0,jsx_runtime.jsx)(es_button/* default */.ZP, {
|
|
|
type: "primary",
|
|
|
htmlType: "submit",
|
|
|
style: {
|
|
|
marginRight: 10
|
|
|
},
|
|
|
children: "\u786E\u5B9A"
|
|
|
}), /*#__PURE__*/(0,jsx_runtime.jsx)(es_button/* default */.ZP, {
|
|
|
type: "ghost",
|
|
|
onClick: onCancel,
|
|
|
children: "\u53D6\u6D88"
|
|
|
})]
|
|
|
})]
|
|
|
});
|
|
|
});
|
|
|
// EXTERNAL MODULE: ./src/utils/env.ts + 1 modules
|
|
|
var env = __webpack_require__(59758);
|
|
|
// EXTERNAL MODULE: ./src/utils/fetch.ts
|
|
|
var fetch = __webpack_require__(84519);
|
|
|
// EXTERNAL MODULE: ./node_modules/uuid/dist/esm-browser/v4.js + 4 modules
|
|
|
var v4 = __webpack_require__(25934);
|
|
|
// EXTERNAL MODULE: ./node_modules/antd/es/modal/index.js + 39 modules
|
|
|
var es_modal = __webpack_require__(72423);
|
|
|
;// CONCATENATED MODULE: ./src/components/markdown-editor/constant.ts
|
|
|
var LINK = 'link';
|
|
|
var UPLOAD_IMAGE = 'upload-image';
|
|
|
var CODE_BLOCK = 'code-block';
|
|
|
var ADD_TABLE = 'add-table';
|
|
|
var HRLINE = '------------';
|
|
|
var ALIGNSIGN = {
|
|
|
"default": HRLINE,
|
|
|
left: ":".concat(HRLINE),
|
|
|
center: ":".concat(HRLINE, ":"),
|
|
|
right: "".concat(HRLINE, ":")
|
|
|
};
|
|
|
// EXTERNAL MODULE: ./src/components/useInterval.tsx
|
|
|
var useInterval = __webpack_require__(61891);
|
|
|
;// CONCATENATED MODULE: ./src/components/markdown-editor/index.tsx
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
var _DEFAULTKEYMAP, _TitleDesc;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
function noop() {}
|
|
|
var pending = 0;
|
|
|
var StorageTimeTicket = 10000;
|
|
|
var NULL_CH = '▁';
|
|
|
var ADD_MULTI = '@▁▁@';
|
|
|
var ADD_SINGLE = '@▁@';
|
|
|
var TEMP1 = '\n**模板标题**\n模板正文内容,可输入文本内容和粘贴图片等操作'; //课程须知模板
|
|
|
function processSize(size) {
|
|
|
return !/^\d+$/.test(size) ? size : "".concat(size, "px");
|
|
|
}
|
|
|
var isMac = navigator.platform.toUpperCase().indexOf('MAC') >= 0;
|
|
|
var key = isMac ? 'Cmd' : 'Ctrl';
|
|
|
var officeSix = ["pptm", "pptx", "ppt", "pot", "pps", "ppa", "potx", "ppsx", "ppam", "pptm", "potm", "ppsm", "doc", "docx", "dot", "dotx", "docm", "dotm", "xls", "xlsx", "csv", "xlt", "xla", "xltx", "xlsm", "xltm", "xlam", "xlsb"];
|
|
|
var DEFAULTKEYMAP = (_DEFAULTKEYMAP = {}, defineProperty_default()(_DEFAULTKEYMAP, key + '-B', 'bold'), defineProperty_default()(_DEFAULTKEYMAP, key + '-I', 'italic'), _DEFAULTKEYMAP);
|
|
|
var TitleDesc = (_TitleDesc = {}, defineProperty_default()(_TitleDesc, LINK, '添加链接'), defineProperty_default()(_TitleDesc, CODE_BLOCK, '添加代码块'), defineProperty_default()(_TitleDesc, UPLOAD_IMAGE, '添加文件'), defineProperty_default()(_TitleDesc, ADD_TABLE, '添加表格'), _TitleDesc);
|
|
|
|
|
|
//https://codemirror.net/demo
|
|
|
//The height can be set through CSS (by giving the .CodeMirror class a height property), or by calling the cm's setSize method.
|
|
|
/* harmony default export */ var markdown_editor = (function (_ref) {
|
|
|
var _ref$defaultValue = _ref.defaultValue,
|
|
|
defaultValue = _ref$defaultValue === void 0 ? '' : _ref$defaultValue,
|
|
|
onChange = _ref.onChange,
|
|
|
_ref$width = _ref.width,
|
|
|
width = _ref$width === void 0 ? '100%' : _ref$width,
|
|
|
_ref$height = _ref.height,
|
|
|
height = _ref$height === void 0 ? 400 : _ref$height,
|
|
|
_ref$miniToolbar = _ref.miniToolbar,
|
|
|
miniToolbar = _ref$miniToolbar === void 0 ? false : _ref$miniToolbar,
|
|
|
_ref$isFocus = _ref.isFocus,
|
|
|
isFocus = _ref$isFocus === void 0 ? false : _ref$isFocus,
|
|
|
watch = _ref.watch,
|
|
|
insertTemp = _ref.insertTemp,
|
|
|
_ref$mode = _ref.mode,
|
|
|
mode = _ref$mode === void 0 ? "markdown" : _ref$mode,
|
|
|
_ref$id = _ref.id,
|
|
|
id = _ref$id === void 0 ? 'markdown-editor-id' : _ref$id,
|
|
|
_ref$showResizeBar = _ref.showResizeBar,
|
|
|
showResizeBar = _ref$showResizeBar === void 0 ? false : _ref$showResizeBar,
|
|
|
_ref$noStorage = _ref.noStorage,
|
|
|
noStorage = _ref$noStorage === void 0 ? false : _ref$noStorage,
|
|
|
_ref$showNullButton = _ref.showNullButton,
|
|
|
showNullButton = _ref$showNullButton === void 0 ? false : _ref$showNullButton,
|
|
|
_ref$showNullProgramB = _ref.showNullProgramButton,
|
|
|
showNullProgramButton = _ref$showNullProgramB === void 0 ? false : _ref$showNullProgramB,
|
|
|
_ref$hidetoolBar = _ref.hidetoolBar,
|
|
|
hidetoolBar = _ref$hidetoolBar === void 0 ? false : _ref$hidetoolBar,
|
|
|
_ref$fullScreen = _ref.fullScreen,
|
|
|
fullScreen = _ref$fullScreen === void 0 ? false : _ref$fullScreen,
|
|
|
onBlur = _ref.onBlur,
|
|
|
onCMBeforeChange = _ref.onCMBeforeChange,
|
|
|
onFullScreen = _ref.onFullScreen,
|
|
|
_ref$className = _ref.className,
|
|
|
className = _ref$className === void 0 ? '' : _ref$className,
|
|
|
_ref$disablePaste = _ref.disablePaste,
|
|
|
disablePaste = _ref$disablePaste === void 0 ? false : _ref$disablePaste,
|
|
|
_ref$disabled = _ref.disabled,
|
|
|
disabled = _ref$disabled === void 0 ? false : _ref$disabled,
|
|
|
_ref$disabledFill = _ref.disabledFill,
|
|
|
disabledFill = _ref$disabledFill === void 0 ? false : _ref$disabledFill,
|
|
|
_ref$placeholder = _ref.placeholder,
|
|
|
placeholder = _ref$placeholder === void 0 ? '' : _ref$placeholder,
|
|
|
_ref$values = _ref.values,
|
|
|
values = _ref$values === void 0 ? '' : _ref$values;
|
|
|
var _useState = (0,react.useState)(null),
|
|
|
_useState2 = slicedToArray_default()(_useState, 2),
|
|
|
cm = _useState2[0],
|
|
|
setCm = _useState2[1];
|
|
|
var _useState3 = (0,react.useState)(defaultValue),
|
|
|
_useState4 = slicedToArray_default()(_useState3, 2),
|
|
|
value = _useState4[0],
|
|
|
setValue = _useState4[1];
|
|
|
var _useState5 = (0,react.useState)(watch),
|
|
|
_useState6 = slicedToArray_default()(_useState5, 2),
|
|
|
preview = _useState6[0],
|
|
|
setPreview = _useState6[1];
|
|
|
var _useState7 = (0,react.useState)(fullScreen),
|
|
|
_useState8 = slicedToArray_default()(_useState7, 2),
|
|
|
isFull = _useState8[0],
|
|
|
setIsFull = _useState8[1];
|
|
|
var _useState9 = (0,react.useState)(''),
|
|
|
_useState10 = slicedToArray_default()(_useState9, 2),
|
|
|
action = _useState10[0],
|
|
|
setAction = _useState10[1];
|
|
|
var _useState11 = (0,react.useState)(0),
|
|
|
_useState12 = slicedToArray_default()(_useState11, 2),
|
|
|
lastedUpdateTime = _useState12[0],
|
|
|
setLastedUpdateTime = _useState12[1];
|
|
|
var _useState13 = (0,react.useState)(height),
|
|
|
_useState14 = slicedToArray_default()(_useState13, 2),
|
|
|
h = _useState14[0],
|
|
|
setH = _useState14[1];
|
|
|
var _useState15 = (0,react.useState)(false),
|
|
|
_useState16 = slicedToArray_default()(_useState15, 2),
|
|
|
tip = _useState16[0],
|
|
|
setTip = _useState16[1];
|
|
|
var uuidRef = (0,react.useRef)((0,v4/* default */.Z)());
|
|
|
var openPhoneRef = (0,react.useRef)(false);
|
|
|
var timer = (0,react.useRef)();
|
|
|
var cmEl = (0,react.useRef)();
|
|
|
var containerEl = (0,react.useRef)();
|
|
|
var resizeBarEl = (0,react.useRef)();
|
|
|
var previewEl = (0,react.useRef)();
|
|
|
var checkFiles = /*#__PURE__*/function () {
|
|
|
var _ref2 = asyncToGenerator_default()( /*#__PURE__*/regeneratorRuntime_default()().mark(function _callee() {
|
|
|
var _res$attachments;
|
|
|
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/attachments/distinct_hash_val.json", {
|
|
|
method: "post",
|
|
|
body: {
|
|
|
hash_val: uuidRef.current
|
|
|
}
|
|
|
});
|
|
|
case 2:
|
|
|
res = _context.sent;
|
|
|
if (!!(res !== null && res !== void 0 && (_res$attachments = res.attachments) !== null && _res$attachments !== void 0 && _res$attachments.length)) {
|
|
|
console.log("cm:", cm, cmEl);
|
|
|
res.attachments.map(function (item) {
|
|
|
if (item.content_type.indexOf("image") > -1) {
|
|
|
cm.replaceSelection(".concat(item.content_type, ")"));
|
|
|
} else if (item.content_type.indexOf("video") > -1) {
|
|
|
cm.replaceSelection("<video width=\"100%\" controls src=\"".concat(env/* default.API_SERVER */.Z.API_SERVER, "/api/attachments/").concat(data.id, "\"></video>"));
|
|
|
} else if (item.content_type.indexOf("pdf") > -1) {
|
|
|
cm.replaceSelection("<a href=\"".concat(env/* default.API_SERVER */.Z.API_SERVER, "/api/attachments/").concat(item.id, "?type=").concat(item.content_type, "&disposition=inline\" target=\"_blank\">").concat(item.name, "</a>"));
|
|
|
} else {
|
|
|
cm.replaceSelection("[".concat(item.name, "](").concat(env/* default.API_SERVER */.Z.API_SERVER, "/api/attachments/").concat(item.id, "?type=").concat(item.content_type, ")"));
|
|
|
}
|
|
|
});
|
|
|
}
|
|
|
case 4:
|
|
|
case "end":
|
|
|
return _context.stop();
|
|
|
}
|
|
|
}, _callee);
|
|
|
}));
|
|
|
return function checkFiles() {
|
|
|
return _ref2.apply(this, arguments);
|
|
|
};
|
|
|
}();
|
|
|
|
|
|
// useEffect(() => {
|
|
|
// setValue(defaultValue)
|
|
|
// cm?.setValue(defaultValue)
|
|
|
// },[])
|
|
|
(0,react.useEffect)(function () {
|
|
|
var scrollTop = window.scrollY || window.pageYOffset;
|
|
|
setValue(values);
|
|
|
cm === null || cm === void 0 ? void 0 : cm.setValue(values);
|
|
|
window.scrollTo(0, scrollTop);
|
|
|
}, [values]);
|
|
|
(0,react.useEffect)(function () {
|
|
|
onFullScreen === null || onFullScreen === void 0 ? void 0 : onFullScreen(isFull);
|
|
|
}, [isFull]);
|
|
|
(0,react.useEffect)(function () {
|
|
|
if (cmEl.current) {
|
|
|
var onPaste = function onPaste(_, e) {
|
|
|
if (disablePaste) {
|
|
|
e.preventDefault();
|
|
|
return;
|
|
|
}
|
|
|
var clipboardData = e.clipboardData;
|
|
|
if (clipboardData) {
|
|
|
var types = clipboardData.types.toString();
|
|
|
var items = clipboardData.items;
|
|
|
if (types === 'Files' || clipboardData.types.indexOf("Files") > -1) {
|
|
|
e.preventDefault();
|
|
|
if (mode == "stex") return;
|
|
|
try {
|
|
|
var _items$;
|
|
|
var item = items[1];
|
|
|
if (((_items$ = items[0]) === null || _items$ === void 0 ? void 0 : _items$.kind) === 'file') {
|
|
|
item = items[0];
|
|
|
}
|
|
|
var file = item.getAsFile();
|
|
|
var fileSix = file.name.split(".").pop();
|
|
|
// console.log("item:", item, file, item?.type?.match(/^video\//i))
|
|
|
uploadImage(file, function (data) {
|
|
|
if (data.id) {
|
|
|
var _file$type, _file$type2, _file$type3;
|
|
|
if ((file === null || file === void 0 ? void 0 : (_file$type = file.type) === null || _file$type === void 0 ? void 0 : _file$type.indexOf("image")) > -1) {
|
|
|
instance.replaceSelection(".concat(data.content_type, ")"));
|
|
|
} else if ((file === null || file === void 0 ? void 0 : (_file$type2 = file.type) === null || _file$type2 === void 0 ? void 0 : _file$type2.indexOf("video")) > -1) {
|
|
|
instance.replaceSelection("<video width=\"100%\" controls src=\"".concat(env/* default.API_SERVER */.Z.API_SERVER, "/api/attachments/").concat(data.id, "\"></video>"));
|
|
|
} else if ((file === null || file === void 0 ? void 0 : (_file$type3 = file.type) === null || _file$type3 === void 0 ? void 0 : _file$type3.indexOf("pdf")) > -1) {
|
|
|
instance.replaceSelection("<a href=\"".concat(env/* default.API_SERVER */.Z.API_SERVER, "/api/attachments/").concat(data.id, "?type=").concat(file.type, "&disposition=inline\" target=\"_blank\">").concat(file.name, "</a>"));
|
|
|
} else if (officeSix.includes(fileSix)) {
|
|
|
instance.replaceSelection("<a href=\"".concat(env/* default.API_SERVER */.Z.API_SERVER, "/api/attachments/").concat(data.id, "?type=office&disposition=inline\" target=\"_blank\">").concat(file.name, "</a>"));
|
|
|
} else {
|
|
|
instance.replaceSelection("[".concat(file.name, "](").concat(env/* default.API_SERVER */.Z.API_SERVER, "/api/attachments/").concat(data.id, "?type=").concat(data.content_type, ")"));
|
|
|
}
|
|
|
} else {
|
|
|
if ((data === null || data === void 0 ? void 0 : data.status) === 401) document.location.href = '/user/login';
|
|
|
}
|
|
|
});
|
|
|
} catch (e) {
|
|
|
message/* default.warning */.ZP.warning("请使用chrome浏览器粘贴");
|
|
|
}
|
|
|
return true;
|
|
|
} else {
|
|
|
//toMarkdown ?
|
|
|
// let html = clipboardData.getData('text/html')
|
|
|
return true;
|
|
|
}
|
|
|
}
|
|
|
return true;
|
|
|
};
|
|
|
var instance = codemirror_default().fromTextArea(cmEl.current, {
|
|
|
mode: mode,
|
|
|
// inputStyle: 'contenteditable',
|
|
|
lineNumbers: miniToolbar ? false : true,
|
|
|
lineWrapping: true,
|
|
|
value: defaultValue,
|
|
|
autoCloseTags: true,
|
|
|
autoCloseBrackets: true
|
|
|
});
|
|
|
instance.on("keyup", function (cm, event) {
|
|
|
if (event.keyCode === 8) {
|
|
|
if (cm.getValue() == "") {
|
|
|
instance.setOption("placeholder", placeholder);
|
|
|
} else {
|
|
|
instance.setOption("placeholder", null);
|
|
|
}
|
|
|
}
|
|
|
});
|
|
|
instance.on("keydown", function (cm, event) {
|
|
|
if (event.keyCode === 8) {
|
|
|
var pos = deleteAtSymbol(cm);
|
|
|
if (pos) {
|
|
|
event.preventDefault();
|
|
|
}
|
|
|
}
|
|
|
});
|
|
|
isFocus && instance.focus();
|
|
|
instance.on('paste', onPaste);
|
|
|
instance.on('dragleave', function (data, e) {
|
|
|
containerEl.current.classList.remove("mouse-hover-md");
|
|
|
});
|
|
|
instance.on('dragover', function (data, e) {
|
|
|
containerEl.current.classList.add("mouse-hover-md");
|
|
|
});
|
|
|
instance.on('drop', function (data, e) {
|
|
|
containerEl.current.classList.add("mouse-hover-md");
|
|
|
// var file;
|
|
|
var files;
|
|
|
// Check if files were dropped
|
|
|
files = e.dataTransfer.files;
|
|
|
if (files.length > 0) {
|
|
|
e.preventDefault();
|
|
|
e.stopPropagation();
|
|
|
// file = files[0];
|
|
|
// alert('File: ' + file.name);
|
|
|
// return false;
|
|
|
var _loop = function _loop() {
|
|
|
var file = files[i];
|
|
|
var fileSix = file.name.split(".").pop();
|
|
|
uploadImage(file, function (data) {
|
|
|
if (data.id) {
|
|
|
var _file$type4, _file$type5, _file$type6;
|
|
|
if ((file === null || file === void 0 ? void 0 : (_file$type4 = file.type) === null || _file$type4 === void 0 ? void 0 : _file$type4.indexOf("image")) > -1) {
|
|
|
instance.replaceSelection(".concat(data.content_type, ")"));
|
|
|
} else if ((file === null || file === void 0 ? void 0 : (_file$type5 = file.type) === null || _file$type5 === void 0 ? void 0 : _file$type5.indexOf("video")) > -1) {
|
|
|
instance.replaceSelection("<video width=\"100%\" controls src=\"".concat(env/* default.API_SERVER */.Z.API_SERVER, "/api/attachments/").concat(data.id, "\"></video>"));
|
|
|
} else if ((file === null || file === void 0 ? void 0 : (_file$type6 = file.type) === null || _file$type6 === void 0 ? void 0 : _file$type6.indexOf("pdf")) > -1) {
|
|
|
instance.replaceSelection("<a href=\"".concat(env/* default.API_SERVER */.Z.API_SERVER, "/api/attachments/").concat(data.id, "?type=").concat(file.type, "&disposition=inline\" target=\"_blank\">").concat(file.name, "</a>"));
|
|
|
} else if (officeSix.includes(fileSix)) {
|
|
|
instance.replaceSelection("<a href=\"".concat(env/* default.API_SERVER */.Z.API_SERVER, "/api/attachments/").concat(data.id, "?type=office&disposition=inline\" target=\"_blank\">").concat(file.name, "</a>"));
|
|
|
} else {
|
|
|
instance.replaceSelection("[".concat(file.name, "](").concat(env/* default.API_SERVER */.Z.API_SERVER, "/api/attachments/").concat(data.id, "?type=").concat(data.content_type, ")"));
|
|
|
}
|
|
|
} else {
|
|
|
if ((data === null || data === void 0 ? void 0 : data.status) === 401) document.location.href = '/user/login';
|
|
|
}
|
|
|
});
|
|
|
};
|
|
|
for (var i = 0; i < files.length; i++) {
|
|
|
_loop();
|
|
|
}
|
|
|
// files.map((file:any) => {
|
|
|
|
|
|
// })
|
|
|
}
|
|
|
});
|
|
|
|
|
|
if (disabled) {
|
|
|
instance.on("beforeChange", function (instances, change) {
|
|
|
if (change.origin === "paste" || change.origin === "+input") {
|
|
|
change.cancel();
|
|
|
}
|
|
|
});
|
|
|
}
|
|
|
setCm(instance);
|
|
|
return function () {
|
|
|
instance.off('paste', onPaste);
|
|
|
};
|
|
|
}
|
|
|
}, []);
|
|
|
var resizeEditorBodyHeight = (0,react.useCallback)(function () {
|
|
|
if (containerEl.current) {
|
|
|
try {
|
|
|
// let toolH = containerEl.current.getElementsByClassName('markdown-toolbar-container')[0].offsetHeight
|
|
|
// let mdBody = containerEl.current.getElementsByClassName('markdown-editor-body')[0]
|
|
|
// if (!isFull) {
|
|
|
// mdBody.style.height = `${h - toolH}px`
|
|
|
// } else {
|
|
|
// mdBody.style.height = `calc(100vh - ${toolH}px)`
|
|
|
// }
|
|
|
} catch (error) {
|
|
|
console.log(error, '---- to set md editor body height');
|
|
|
}
|
|
|
}
|
|
|
}, [h, containerEl, isFull]);
|
|
|
(0,react.useEffect)(function () {
|
|
|
function onLayout() {
|
|
|
var ro = new ResizeObserver_es/* default */.Z(function (entries) {
|
|
|
var _iterator = createForOfIteratorHelper_default()(entries),
|
|
|
_step;
|
|
|
try {
|
|
|
for (_iterator.s(); !(_step = _iterator.n()).done;) {
|
|
|
var entry = _step.value;
|
|
|
if (entry.target.offsetHeight > 0 || entry.target.offsetWidth > 0) {
|
|
|
resizeEditorBodyHeight();
|
|
|
cm.setSize('100%', '100%');
|
|
|
cm.refresh();
|
|
|
}
|
|
|
}
|
|
|
} catch (err) {
|
|
|
_iterator.e(err);
|
|
|
} finally {
|
|
|
_iterator.f();
|
|
|
}
|
|
|
});
|
|
|
ro.observe(cmEl.current.parentElement);
|
|
|
return ro;
|
|
|
}
|
|
|
if (cm) {
|
|
|
var ro = onLayout();
|
|
|
return function () {
|
|
|
var _cmEl$current, _cmEl$current2;
|
|
|
if ((_cmEl$current = cmEl.current) !== null && _cmEl$current !== void 0 && _cmEl$current.parentElement) ro.unobserve((_cmEl$current2 = cmEl.current) === null || _cmEl$current2 === void 0 ? void 0 : _cmEl$current2.parentElement);
|
|
|
};
|
|
|
}
|
|
|
}, [cm, resizeEditorBodyHeight]);
|
|
|
|
|
|
//keymap
|
|
|
(0,react.useEffect)(function () {
|
|
|
if (cm) {
|
|
|
var keymap = [];
|
|
|
var _loop2 = function _loop2() {
|
|
|
var _Object$entries$_i = slicedToArray_default()(_Object$entries[_i], 2),
|
|
|
k = _Object$entries$_i[0],
|
|
|
value = _Object$entries$_i[1];
|
|
|
var map = defineProperty_default()({}, k, function () {
|
|
|
onActionCallback(value);
|
|
|
});
|
|
|
keymap.push(map);
|
|
|
cm.addKeyMap(map);
|
|
|
};
|
|
|
for (var _i = 0, _Object$entries = Object.entries(DEFAULTKEYMAP); _i < _Object$entries.length; _i++) {
|
|
|
_loop2();
|
|
|
}
|
|
|
timer.current = setInterval(function () {
|
|
|
if (openPhoneRef.current) {
|
|
|
checkFiles();
|
|
|
}
|
|
|
}, 4000);
|
|
|
return function () {
|
|
|
clearInterval(timer.current);
|
|
|
for (var _i2 = 0, _keymap = keymap; _i2 < _keymap.length; _i2++) {
|
|
|
var m = _keymap[_i2];
|
|
|
cm.removeKeyMap(m);
|
|
|
}
|
|
|
};
|
|
|
}
|
|
|
}, [cm]);
|
|
|
(0,react.useEffect)(function () {
|
|
|
if (fullScreen !== isFull) {
|
|
|
setIsFull(fullScreen);
|
|
|
}
|
|
|
}, [fullScreen]);
|
|
|
(0,useInterval/* default */.Z)(function () {
|
|
|
if (!noStorage && lastedUpdateTime > 0) {
|
|
|
var currentTime = new Date().getTime();
|
|
|
var lastedValue = window.sessionStorage.getItem(id);
|
|
|
if (currentTime >= lastedUpdateTime + StorageTimeTicket && (!lastedValue || lastedValue !== value)) {
|
|
|
window.sessionStorage.setItem(id, value);
|
|
|
setTip(true);
|
|
|
}
|
|
|
}
|
|
|
}, StorageTimeTicket);
|
|
|
(0,react.useEffect)(function () {
|
|
|
setPreview(watch);
|
|
|
}, [cm, watch]);
|
|
|
(0,react.useEffect)(function () {
|
|
|
if (cm) {
|
|
|
isFocus && cm.focus();
|
|
|
}
|
|
|
}, [cm, isFocus]);
|
|
|
(0,react.useEffect)(function () {
|
|
|
if (preview && cm) {
|
|
|
var syncScroll = function syncScroll(e) {
|
|
|
var target = e.target;
|
|
|
if (previewEl.current) {
|
|
|
var ratio = target.scrollTop / target.scrollHeight;
|
|
|
previewEl.current.scrollTop = previewEl.current.scrollHeight * ratio;
|
|
|
}
|
|
|
};
|
|
|
var scrollEl = cm.getScrollerElement();
|
|
|
scrollEl.addEventListener('scroll', syncScroll);
|
|
|
return function () {
|
|
|
scrollEl.removeEventListener('scroll', syncScroll);
|
|
|
};
|
|
|
}
|
|
|
}, [cm, preview]);
|
|
|
(0,react.useEffect)(function () {
|
|
|
if (cm && onCMBeforeChange) {
|
|
|
var onChangeHandler = function onChangeHandler(cm, change) {
|
|
|
onCMBeforeChange(cm, change);
|
|
|
};
|
|
|
cm.on('beforeChange', onChangeHandler);
|
|
|
return function () {
|
|
|
cm.off('beforeChange', onChangeHandler);
|
|
|
};
|
|
|
}
|
|
|
}, [cm, onCMBeforeChange]);
|
|
|
(0,react.useEffect)(function () {
|
|
|
if (cm && onBlur) {
|
|
|
var onBlurHandler = function onBlurHandler() {
|
|
|
onBlur(cm.getValue());
|
|
|
};
|
|
|
cm.on('blur', onBlurHandler);
|
|
|
return function () {
|
|
|
cm.off('blur', onBlurHandler);
|
|
|
};
|
|
|
}
|
|
|
}, [cm, onBlur]);
|
|
|
function deleteAtSymbol(cm, change) {
|
|
|
var doc = cm.getDoc();
|
|
|
var cursor = doc.getCursor();
|
|
|
var line = doc.getLine(cursor.line);
|
|
|
var ch = line.charAt(cursor.ch - 1);
|
|
|
var p1 = line.lastIndexOf("@▁@", cursor.ch);
|
|
|
var p2 = line.lastIndexOf("@▁▁@", cursor.ch);
|
|
|
var posStart = p1 > p2 ? p1 : p2;
|
|
|
var n = p1 > p2 ? 3 : 4;
|
|
|
if (ADD_MULTI.indexOf(ch) === -1) return null;
|
|
|
console.log("change1:", change, cm, line, cursor, posStart, p1, p2, ch);
|
|
|
if (posStart >= 0 && cursor.ch - posStart < 5) {
|
|
|
var posEnd = posStart + n;
|
|
|
doc.replaceRange("", {
|
|
|
line: cursor.line,
|
|
|
ch: posStart
|
|
|
}, {
|
|
|
line: cursor.line,
|
|
|
ch: posEnd
|
|
|
});
|
|
|
return {
|
|
|
line: cursor.line,
|
|
|
ch: posEnd
|
|
|
};
|
|
|
}
|
|
|
return null;
|
|
|
}
|
|
|
(0,react.useEffect)(function () {
|
|
|
if (cm) {
|
|
|
var onChangeHandler = function onChangeHandler(cm, change) {
|
|
|
var content = cm.getValue();
|
|
|
setValue(content);
|
|
|
setLastedUpdateTime(new Date().getTime());
|
|
|
cm.getScrollerElement().dispatchEvent(new CustomEvent('scroll'));
|
|
|
if (onChange) {
|
|
|
if (showNullProgramButton) {
|
|
|
onChange(content, formatProgramFill(content));
|
|
|
} else {
|
|
|
onChange(content);
|
|
|
}
|
|
|
}
|
|
|
};
|
|
|
cm.on('change', onChangeHandler);
|
|
|
return function () {
|
|
|
cm.off('change', onChangeHandler);
|
|
|
};
|
|
|
}
|
|
|
}, [cm, onChange]);
|
|
|
(0,react.useEffect)(function () {
|
|
|
if (cm) {
|
|
|
// isFocus && cm.focus()
|
|
|
if (defaultValue === null || defaultValue === undefined) {
|
|
|
cm.setValue('');
|
|
|
setValue('');
|
|
|
} else {
|
|
|
var scrollTop = window.scrollY || window.pageYOffset;
|
|
|
if (defaultValue !== cm.getValue()) {
|
|
|
cm.setValue(defaultValue);
|
|
|
setValue(defaultValue);
|
|
|
cm.setCursor(disabled ? 1 : cm.lineCount(), 0);
|
|
|
window.scrollTo(0, scrollTop);
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
}, [cm, defaultValue]);
|
|
|
var onActionCallback = (0,react.useCallback)(function (actionName) {
|
|
|
var cursor = cm.getCursor();
|
|
|
var selection = cm.getSelection();
|
|
|
var selectionText = selection.split('\n');
|
|
|
switch (actionName) {
|
|
|
case 'bold':
|
|
|
cm.replaceSelection('**' + selection + '**');
|
|
|
if (selection === '') {
|
|
|
cm.setCursor(cursor.line, cursor.ch + 2);
|
|
|
}
|
|
|
return cm.focus();
|
|
|
case 'italic':
|
|
|
cm.replaceSelection('*' + selection + '*');
|
|
|
if (selection === '') {
|
|
|
cm.setCursor(cursor.line, cursor.ch + 1);
|
|
|
}
|
|
|
return cm.focus();
|
|
|
case 'code':
|
|
|
cm.replaceSelection('`' + selection + '`');
|
|
|
if (selection === '') {
|
|
|
cm.setCursor(cursor.line, cursor.ch + 1);
|
|
|
}
|
|
|
return cm.focus();
|
|
|
case 'inline-latex':
|
|
|
cm.replaceSelection('`$$' + selection + '$$`');
|
|
|
if (selection === '') {
|
|
|
cm.setCursor(cursor.line, cursor.ch + 3);
|
|
|
}
|
|
|
return cm.focus();
|
|
|
case 'latex':
|
|
|
cm.replaceSelection("```latex\n" + selection + "\n```");
|
|
|
cm.setCursor(cursor.line + 1, selection.length + 1);
|
|
|
return cm.focus();
|
|
|
case 'line-break':
|
|
|
cm.replaceSelection('<br/>\n');
|
|
|
return cm.focus();
|
|
|
case 'list-ul':
|
|
|
if (selection === '') {
|
|
|
cm.replaceSelection('- ' + selection);
|
|
|
} else {
|
|
|
cm.replaceSelection(selectionText.map(function (item) {
|
|
|
return item === '' ? '' : "- ".concat(item);
|
|
|
}).join('\n'));
|
|
|
}
|
|
|
return cm.focus();
|
|
|
case 'list-ol':
|
|
|
if (selection === '') {
|
|
|
cm.replaceSelection('1. ' + selection);
|
|
|
} else {
|
|
|
cm.replaceSelection(selectionText.map(function (item, index) {
|
|
|
return item === '' ? '' : "".concat(index + 1, ". ").concat(item);
|
|
|
}).join('\n'));
|
|
|
}
|
|
|
return cm.focus();
|
|
|
case 'add-null-ch':
|
|
|
if (selection === '') {
|
|
|
cm.setCursor(cursor.line, cursor.ch);
|
|
|
}
|
|
|
cm.replaceSelection(NULL_CH);
|
|
|
return cm.focus();
|
|
|
case 'add-signal':
|
|
|
if (selection === '') {
|
|
|
cm.setCursor(cursor.line, cursor.ch);
|
|
|
}
|
|
|
cm.replaceSelection(ADD_SINGLE);
|
|
|
return cm.focus();
|
|
|
case 'add-multiple':
|
|
|
if (selection === '') {
|
|
|
cm.setCursor(cursor.line, cursor.ch);
|
|
|
}
|
|
|
cm.replaceSelection(ADD_MULTI);
|
|
|
return cm.focus();
|
|
|
case 'inster-template-1':
|
|
|
if (selection === '') {
|
|
|
cm.setCursor(cursor.line, cursor.ch);
|
|
|
}
|
|
|
cm.replaceSelection(TEMP1);
|
|
|
return cm.focus();
|
|
|
case 'eraser':
|
|
|
cm.setValue('');
|
|
|
return cm.focus();
|
|
|
case 'trigger-watch':
|
|
|
setPreview(!preview);
|
|
|
return cm.focus();
|
|
|
case 'trigger-full-screen':
|
|
|
setIsFull(!isFull);
|
|
|
return cm.focus();
|
|
|
case LINK:
|
|
|
setAction(LINK);
|
|
|
return;
|
|
|
case CODE_BLOCK:
|
|
|
setAction(CODE_BLOCK);
|
|
|
return;
|
|
|
case UPLOAD_IMAGE:
|
|
|
setAction(UPLOAD_IMAGE);
|
|
|
return;
|
|
|
case ADD_TABLE:
|
|
|
setAction(ADD_TABLE);
|
|
|
return;
|
|
|
default:
|
|
|
throw new Error();
|
|
|
}
|
|
|
}, [cm, preview, isFull]);
|
|
|
var ExecutePluginAction = (0,react.useCallback)(function (values) {
|
|
|
setAction('');
|
|
|
switch (action) {
|
|
|
case LINK:
|
|
|
var title = values.title,
|
|
|
link = values.link;
|
|
|
cm.replaceSelection("[".concat(title, "](").concat(link, ")"));
|
|
|
return cm.focus();
|
|
|
case CODE_BLOCK:
|
|
|
var language = values.language,
|
|
|
content = values.content;
|
|
|
cm.replaceSelection(['```' + language, content, '```'].join('\n'));
|
|
|
return cm.focus();
|
|
|
case UPLOAD_IMAGE:
|
|
|
var src = values.src,
|
|
|
alt = values.alt;
|
|
|
if (alt) {
|
|
|
cm.replaceSelection(".concat(src, " \"").concat(alt, "\" )"));
|
|
|
} else {
|
|
|
cm.replaceSelection(""));
|
|
|
}
|
|
|
return cm.focus();
|
|
|
case ADD_TABLE:
|
|
|
var row = values.row,
|
|
|
col = values.col,
|
|
|
align = values.align;
|
|
|
var table = '\n';
|
|
|
for (var r = 0; r < row; r++) {
|
|
|
var rows = [];
|
|
|
var heads = [];
|
|
|
for (var c = 0; c < col; c++) {
|
|
|
if (r === 1) {
|
|
|
heads.push(ALIGNSIGN[align]);
|
|
|
}
|
|
|
rows.push(' ');
|
|
|
}
|
|
|
if (r === 1) {
|
|
|
table += "| ".concat(heads.join(' | '), " |\n");
|
|
|
}
|
|
|
table += "| ".concat(rows.join(col === 1 ? '' : ' | '), " |\n");
|
|
|
}
|
|
|
cm.replaceSelection(table + '\n');
|
|
|
return cm.focus();
|
|
|
default:
|
|
|
throw new Error();
|
|
|
}
|
|
|
}, [cm, action]);
|
|
|
var PluginEl = (0,react.useMemo)(function () {
|
|
|
switch (action) {
|
|
|
case LINK:
|
|
|
return /*#__PURE__*/(0,jsx_runtime.jsx)(markdown_editor_link, {
|
|
|
callback: ExecutePluginAction,
|
|
|
onCancel: onCancel
|
|
|
});
|
|
|
case CODE_BLOCK:
|
|
|
return /*#__PURE__*/(0,jsx_runtime.jsx)(code_block/* default */.Z, {
|
|
|
callback: ExecutePluginAction,
|
|
|
onCancel: onCancel
|
|
|
});
|
|
|
case UPLOAD_IMAGE:
|
|
|
return /*#__PURE__*/(0,jsx_runtime.jsx)(upload_image, {
|
|
|
callback: ExecutePluginAction,
|
|
|
onCancel: onCancel
|
|
|
});
|
|
|
case ADD_TABLE:
|
|
|
return /*#__PURE__*/(0,jsx_runtime.jsx)(add_table_panel, {
|
|
|
callback: ExecutePluginAction,
|
|
|
onCancel: onCancel
|
|
|
});
|
|
|
default:
|
|
|
return null;
|
|
|
}
|
|
|
}, [action]);
|
|
|
function onCancel() {
|
|
|
setAction('');
|
|
|
}
|
|
|
(0,react.useEffect)(function () {
|
|
|
if (resizeBarEl.current) {
|
|
|
var onMouseDown = function onMouseDown(e) {
|
|
|
dragging = true;
|
|
|
startY = e.pageY;
|
|
|
};
|
|
|
var onMouseUp = function onMouseUp() {
|
|
|
dragging = false;
|
|
|
};
|
|
|
var onMouseMove = function onMouseMove(e) {
|
|
|
if (dragging) {
|
|
|
var delta = e.pageY - startY;
|
|
|
if (delta < 0) {
|
|
|
delta = 0;
|
|
|
}
|
|
|
if (delta > 300) {
|
|
|
delta = 300;
|
|
|
}
|
|
|
var resizeH = height + delta + 'px';
|
|
|
setH(resizeH);
|
|
|
}
|
|
|
};
|
|
|
var resizeBar = resizeBarEl.current;
|
|
|
var dragging = false;
|
|
|
var startY = 0;
|
|
|
resizeBar.addEventListener('mousedown', onMouseDown);
|
|
|
document.addEventListener('mousemove', onMouseMove);
|
|
|
document.addEventListener('mouseup', onMouseUp);
|
|
|
return function () {
|
|
|
resizeBar.removeEventListener('mousedown', onMouseDown);
|
|
|
document.removeEventListener('mousemove', onMouseMove);
|
|
|
document.removeEventListener('mouseup', onMouseUp);
|
|
|
};
|
|
|
}
|
|
|
}, [cm, resizeBarEl]);
|
|
|
(0,react.useEffect)(function () {
|
|
|
setH(height);
|
|
|
}, [height]);
|
|
|
var fixedWidth = processSize(width);
|
|
|
var fixedHeight = processSize(h);
|
|
|
var style = {
|
|
|
width: fixedWidth,
|
|
|
height: fixedHeight
|
|
|
};
|
|
|
var saveTime = (0,react.useMemo)(function () {
|
|
|
if (lastedUpdateTime) {
|
|
|
var d = new Date(lastedUpdateTime);
|
|
|
var _h = d.getHours();
|
|
|
var m = d.getMinutes();
|
|
|
var s = d.getSeconds();
|
|
|
_h = _h < 10 ? '0' + _h : _h;
|
|
|
m = m < 10 ? '0' + m : m;
|
|
|
s = s < 10 ? '0' + s : s;
|
|
|
return "".concat(_h, ":").concat(m, ":").concat(s);
|
|
|
}
|
|
|
return 0;
|
|
|
}, [lastedUpdateTime]);
|
|
|
var formatProgramFill = function formatProgramFill(str) {
|
|
|
var arr = [];
|
|
|
if (showNullProgramButton) {
|
|
|
var num = -1;
|
|
|
str = str.replace(/(@▁▁@|@▁@)/g, function (a, b, c) {
|
|
|
arr.push({
|
|
|
multiLine: !(a === ADD_SINGLE)
|
|
|
});
|
|
|
});
|
|
|
}
|
|
|
return arr;
|
|
|
};
|
|
|
function onCancelStorage() {
|
|
|
window.sessionStorage.removeItem(id);
|
|
|
setTip(false);
|
|
|
setLastedUpdateTime(0);
|
|
|
}
|
|
|
function onReset() {
|
|
|
setTip(false);
|
|
|
setLastedUpdateTime(0);
|
|
|
cm.setValue(window.sessionStorage.getItem(id));
|
|
|
}
|
|
|
function setValues(a, b) {
|
|
|
var content = cm.getValue();
|
|
|
content = content.replace(a, b);
|
|
|
setValue(content);
|
|
|
cm === null || cm === void 0 ? void 0 : cm.setValue(content);
|
|
|
}
|
|
|
return /*#__PURE__*/(0,jsx_runtime.jsxs)(react.Fragment, {
|
|
|
children: [/*#__PURE__*/(0,jsx_runtime.jsx)("div", {
|
|
|
className: "markdown-editor-wrapper",
|
|
|
ref: containerEl,
|
|
|
children: /*#__PURE__*/(0,jsx_runtime.jsxs)("div", {
|
|
|
className: "markdown-editor-container ".concat(className, " ").concat(preview ? 'on-preview' : '', " ").concat(miniToolbar ? 'mini' : '', " ").concat(isFull ? 'full-screen' : ''),
|
|
|
style: style,
|
|
|
children: [/*#__PURE__*/(0,jsx_runtime.jsx)(toolbar, {
|
|
|
insertTemp: insertTemp,
|
|
|
watch: preview,
|
|
|
fullScreen: isFull,
|
|
|
showNullButton: showNullButton,
|
|
|
showNullProgramButton: showNullProgramButton,
|
|
|
onActionCallback: onActionCallback,
|
|
|
hidetoolBar: hidetoolBar,
|
|
|
uuid: uuidRef.current,
|
|
|
setOpenPhones: function setOpenPhones() {
|
|
|
openPhoneRef.current = true;
|
|
|
}
|
|
|
}), /*#__PURE__*/(0,jsx_runtime.jsxs)("div", {
|
|
|
className: "markdown-editor-body",
|
|
|
children: [/*#__PURE__*/(0,jsx_runtime.jsx)("div", {
|
|
|
className: "codemirror-container",
|
|
|
children: /*#__PURE__*/(0,jsx_runtime.jsx)("textarea", {
|
|
|
ref: cmEl,
|
|
|
placeholder: placeholder
|
|
|
})
|
|
|
}), preview ? /*#__PURE__*/(0,jsx_runtime.jsxs)("div", {
|
|
|
ref: previewEl,
|
|
|
className: "preview-container",
|
|
|
children: [mode === "stex" && /*#__PURE__*/(0,jsx_runtime.jsx)(RenderHtml_stex, {
|
|
|
value: value
|
|
|
}), mode !== "stex" && /*#__PURE__*/(0,jsx_runtime.jsx)(RenderHtml/* default */.Z, {
|
|
|
disabledFill: disabledFill,
|
|
|
showProgramFill: showNullProgramButton,
|
|
|
value: value
|
|
|
})]
|
|
|
}) : null]
|
|
|
})]
|
|
|
})
|
|
|
}), showResizeBar ? /*#__PURE__*/(0,jsx_runtime.jsx)("a", {
|
|
|
ref: resizeBarEl,
|
|
|
className: "editor-resize"
|
|
|
}) : null, /*#__PURE__*/(0,jsx_runtime.jsx)(modal/* default */.Z, {
|
|
|
children: TitleDesc[action] ? /*#__PURE__*/(0,jsx_runtime.jsx)(es_modal/* default */.Z, {
|
|
|
centered: true,
|
|
|
title: TitleDesc[action],
|
|
|
open: true,
|
|
|
onCancel: onCancel,
|
|
|
footer: null,
|
|
|
className: "markdown-popup-form",
|
|
|
children: PluginEl
|
|
|
}) : null
|
|
|
})]
|
|
|
});
|
|
|
});
|
|
|
|
|
|
/***/ }),
|
|
|
|
|
|
/***/ 12264:
|
|
|
/*!**********************************!*\
|
|
|
!*** ./src/components/modal.tsx ***!
|
|
|
\**********************************/
|
|
|
/***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) {
|
|
|
|
|
|
"use strict";
|
|
|
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
|
|
|
/* harmony export */ "Z": function() { return /* binding */ Dialog; }
|
|
|
/* harmony export */ });
|
|
|
/* harmony import */ var _root_workspace_ppte5yg23_local_v9_node_modules_babel_runtime_helpers_classCallCheck_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./node_modules/@babel/runtime/helpers/classCallCheck.js */ 56690);
|
|
|
/* harmony import */ var _root_workspace_ppte5yg23_local_v9_node_modules_babel_runtime_helpers_classCallCheck_js__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_root_workspace_ppte5yg23_local_v9_node_modules_babel_runtime_helpers_classCallCheck_js__WEBPACK_IMPORTED_MODULE_0__);
|
|
|
/* harmony import */ var _root_workspace_ppte5yg23_local_v9_node_modules_babel_runtime_helpers_createClass_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./node_modules/@babel/runtime/helpers/createClass.js */ 89728);
|
|
|
/* harmony import */ var _root_workspace_ppte5yg23_local_v9_node_modules_babel_runtime_helpers_createClass_js__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_root_workspace_ppte5yg23_local_v9_node_modules_babel_runtime_helpers_createClass_js__WEBPACK_IMPORTED_MODULE_1__);
|
|
|
/* harmony import */ var _root_workspace_ppte5yg23_local_v9_node_modules_babel_runtime_helpers_inherits_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./node_modules/@babel/runtime/helpers/inherits.js */ 61655);
|
|
|
/* harmony import */ var _root_workspace_ppte5yg23_local_v9_node_modules_babel_runtime_helpers_inherits_js__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(_root_workspace_ppte5yg23_local_v9_node_modules_babel_runtime_helpers_inherits_js__WEBPACK_IMPORTED_MODULE_2__);
|
|
|
/* harmony import */ var _root_workspace_ppte5yg23_local_v9_node_modules_babel_runtime_helpers_createSuper_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./node_modules/@babel/runtime/helpers/createSuper.js */ 26389);
|
|
|
/* harmony import */ var _root_workspace_ppte5yg23_local_v9_node_modules_babel_runtime_helpers_createSuper_js__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__webpack_require__.n(_root_workspace_ppte5yg23_local_v9_node_modules_babel_runtime_helpers_createSuper_js__WEBPACK_IMPORTED_MODULE_3__);
|
|
|
/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! react */ 67294);
|
|
|
/* harmony import */ var react_dom__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! react-dom */ 73935);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
var Dialog = /*#__PURE__*/function (_React$Component) {
|
|
|
_root_workspace_ppte5yg23_local_v9_node_modules_babel_runtime_helpers_inherits_js__WEBPACK_IMPORTED_MODULE_2___default()(Dialog, _React$Component);
|
|
|
var _super = _root_workspace_ppte5yg23_local_v9_node_modules_babel_runtime_helpers_createSuper_js__WEBPACK_IMPORTED_MODULE_3___default()(Dialog);
|
|
|
function Dialog(props) {
|
|
|
var _this;
|
|
|
_root_workspace_ppte5yg23_local_v9_node_modules_babel_runtime_helpers_classCallCheck_js__WEBPACK_IMPORTED_MODULE_0___default()(this, Dialog);
|
|
|
_this = _super.call(this, props);
|
|
|
var doc = window.document;
|
|
|
_this.node = doc.createElement('div');
|
|
|
doc.body.appendChild(_this.node);
|
|
|
return _this;
|
|
|
}
|
|
|
_root_workspace_ppte5yg23_local_v9_node_modules_babel_runtime_helpers_createClass_js__WEBPACK_IMPORTED_MODULE_1___default()(Dialog, [{
|
|
|
key: "render",
|
|
|
value: function render() {
|
|
|
var children = this.props.children;
|
|
|
return /*#__PURE__*/(0,react_dom__WEBPACK_IMPORTED_MODULE_5__.createPortal)(children, this.node);
|
|
|
}
|
|
|
}, {
|
|
|
key: "componentWillUnmount",
|
|
|
value: function componentWillUnmount() {
|
|
|
window.document.body.removeChild(this.node);
|
|
|
}
|
|
|
}]);
|
|
|
return Dialog;
|
|
|
}(react__WEBPACK_IMPORTED_MODULE_4__.Component);
|
|
|
|
|
|
|
|
|
/***/ }),
|
|
|
|
|
|
/***/ 61891:
|
|
|
/*!****************************************!*\
|
|
|
!*** ./src/components/useInterval.tsx ***!
|
|
|
\****************************************/
|
|
|
/***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) {
|
|
|
|
|
|
"use strict";
|
|
|
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
|
|
|
/* harmony export */ "Z": function() { return /* binding */ useInterval; }
|
|
|
/* harmony export */ });
|
|
|
/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! react */ 67294);
|
|
|
|
|
|
function useInterval(callback, delay) {
|
|
|
var savedCallback = (0,react__WEBPACK_IMPORTED_MODULE_0__.useRef)();
|
|
|
|
|
|
// 保存新回调
|
|
|
(0,react__WEBPACK_IMPORTED_MODULE_0__.useEffect)(function () {
|
|
|
savedCallback.current = callback;
|
|
|
});
|
|
|
|
|
|
// 建立 interval
|
|
|
(0,react__WEBPACK_IMPORTED_MODULE_0__.useEffect)(function () {
|
|
|
function tick() {
|
|
|
savedCallback.current();
|
|
|
}
|
|
|
if (delay !== null) {
|
|
|
var id = setInterval(tick, delay);
|
|
|
return function () {
|
|
|
return clearInterval(id);
|
|
|
};
|
|
|
}
|
|
|
}, [delay]);
|
|
|
}
|
|
|
|
|
|
/***/ }),
|
|
|
|
|
|
/***/ 45437:
|
|
|
/*!**************************************************************!*\
|
|
|
!*** ./src/pages/Classrooms/Lists/Exercise/Export/index.tsx ***!
|
|
|
\**************************************************************/
|
|
|
/***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) {
|
|
|
|
|
|
"use strict";
|
|
|
__webpack_require__.r(__webpack_exports__);
|
|
|
/* harmony import */ var _root_workspace_ppte5yg23_local_v9_node_modules_babel_runtime_helpers_createForOfIteratorHelper_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./node_modules/@babel/runtime/helpers/createForOfIteratorHelper.js */ 74704);
|
|
|
/* harmony import */ var _root_workspace_ppte5yg23_local_v9_node_modules_babel_runtime_helpers_createForOfIteratorHelper_js__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_root_workspace_ppte5yg23_local_v9_node_modules_babel_runtime_helpers_createForOfIteratorHelper_js__WEBPACK_IMPORTED_MODULE_0__);
|
|
|
/* harmony import */ var _root_workspace_ppte5yg23_local_v9_node_modules_babel_runtime_helpers_regeneratorRuntime_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./node_modules/@babel/runtime/helpers/regeneratorRuntime.js */ 17061);
|
|
|
/* harmony import */ var _root_workspace_ppte5yg23_local_v9_node_modules_babel_runtime_helpers_regeneratorRuntime_js__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_root_workspace_ppte5yg23_local_v9_node_modules_babel_runtime_helpers_regeneratorRuntime_js__WEBPACK_IMPORTED_MODULE_1__);
|
|
|
/* harmony import */ var _root_workspace_ppte5yg23_local_v9_node_modules_babel_runtime_helpers_objectSpread2_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./node_modules/@babel/runtime/helpers/objectSpread2.js */ 42122);
|
|
|
/* harmony import */ var _root_workspace_ppte5yg23_local_v9_node_modules_babel_runtime_helpers_objectSpread2_js__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(_root_workspace_ppte5yg23_local_v9_node_modules_babel_runtime_helpers_objectSpread2_js__WEBPACK_IMPORTED_MODULE_2__);
|
|
|
/* harmony import */ var _root_workspace_ppte5yg23_local_v9_node_modules_babel_runtime_helpers_asyncToGenerator_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./node_modules/@babel/runtime/helpers/asyncToGenerator.js */ 17156);
|
|
|
/* harmony import */ var _root_workspace_ppte5yg23_local_v9_node_modules_babel_runtime_helpers_asyncToGenerator_js__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__webpack_require__.n(_root_workspace_ppte5yg23_local_v9_node_modules_babel_runtime_helpers_asyncToGenerator_js__WEBPACK_IMPORTED_MODULE_3__);
|
|
|
/* harmony import */ var _root_workspace_ppte5yg23_local_v9_node_modules_babel_runtime_helpers_slicedToArray_js__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./node_modules/@babel/runtime/helpers/slicedToArray.js */ 27424);
|
|
|
/* harmony import */ var _root_workspace_ppte5yg23_local_v9_node_modules_babel_runtime_helpers_slicedToArray_js__WEBPACK_IMPORTED_MODULE_4___default = /*#__PURE__*/__webpack_require__.n(_root_workspace_ppte5yg23_local_v9_node_modules_babel_runtime_helpers_slicedToArray_js__WEBPACK_IMPORTED_MODULE_4__);
|
|
|
/* harmony import */ var _root_workspace_ppte5yg23_local_v9_node_modules_babel_runtime_helpers_objectWithoutProperties_js__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ./node_modules/@babel/runtime/helpers/objectWithoutProperties.js */ 70215);
|
|
|
/* harmony import */ var _root_workspace_ppte5yg23_local_v9_node_modules_babel_runtime_helpers_objectWithoutProperties_js__WEBPACK_IMPORTED_MODULE_5___default = /*#__PURE__*/__webpack_require__.n(_root_workspace_ppte5yg23_local_v9_node_modules_babel_runtime_helpers_objectWithoutProperties_js__WEBPACK_IMPORTED_MODULE_5__);
|
|
|
/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! react */ 67294);
|
|
|
/* harmony import */ var umi__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! umi */ 88275);
|
|
|
/* harmony import */ var antd__WEBPACK_IMPORTED_MODULE_23__ = __webpack_require__(/*! antd */ 79531);
|
|
|
/* harmony import */ var antd__WEBPACK_IMPORTED_MODULE_24__ = __webpack_require__(/*! antd */ 72423);
|
|
|
/* harmony import */ var antd__WEBPACK_IMPORTED_MODULE_25__ = __webpack_require__(/*! antd */ 71230);
|
|
|
/* harmony import */ var antd__WEBPACK_IMPORTED_MODULE_26__ = __webpack_require__(/*! antd */ 15746);
|
|
|
/* harmony import */ var antd__WEBPACK_IMPORTED_MODULE_27__ = __webpack_require__(/*! antd */ 78045);
|
|
|
/* harmony import */ var antd__WEBPACK_IMPORTED_MODULE_28__ = __webpack_require__(/*! antd */ 84567);
|
|
|
/* harmony import */ var antd__WEBPACK_IMPORTED_MODULE_29__ = __webpack_require__(/*! antd */ 96074);
|
|
|
/* harmony import */ var antd__WEBPACK_IMPORTED_MODULE_30__ = __webpack_require__(/*! antd */ 85673);
|
|
|
/* harmony import */ var antd__WEBPACK_IMPORTED_MODULE_32__ = __webpack_require__(/*! antd */ 85418);
|
|
|
/* harmony import */ var antd__WEBPACK_IMPORTED_MODULE_33__ = __webpack_require__(/*! antd */ 71577);
|
|
|
/* harmony import */ var antd__WEBPACK_IMPORTED_MODULE_38__ = __webpack_require__(/*! antd */ 83338);
|
|
|
/* harmony import */ var jszip__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! jszip */ 55733);
|
|
|
/* harmony import */ var jszip__WEBPACK_IMPORTED_MODULE_8___default = /*#__PURE__*/__webpack_require__.n(jszip__WEBPACK_IMPORTED_MODULE_8__);
|
|
|
/* harmony import */ var _ant_design_icons__WEBPACK_IMPORTED_MODULE_31__ = __webpack_require__(/*! @ant-design/icons */ 82826);
|
|
|
/* harmony import */ var _ant_design_icons__WEBPACK_IMPORTED_MODULE_34__ = __webpack_require__(/*! @ant-design/icons */ 23430);
|
|
|
/* harmony import */ var _ant_design_icons__WEBPACK_IMPORTED_MODULE_35__ = __webpack_require__(/*! @ant-design/icons */ 95604);
|
|
|
/* harmony import */ var _ant_design_icons__WEBPACK_IMPORTED_MODULE_36__ = __webpack_require__(/*! @ant-design/icons */ 39398);
|
|
|
/* harmony import */ var _ant_design_icons__WEBPACK_IMPORTED_MODULE_37__ = __webpack_require__(/*! @ant-design/icons */ 42952);
|
|
|
/* harmony import */ var _index_less_modules__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! ./index.less?modules */ 24549);
|
|
|
/* harmony import */ var _components_RenderHtml__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(/*! @/components/RenderHtml */ 12768);
|
|
|
/* harmony import */ var _utils_util__WEBPACK_IMPORTED_MODULE_11__ = __webpack_require__(/*! @/utils/util */ 29427);
|
|
|
/* harmony import */ var _Review_component_Fill__WEBPACK_IMPORTED_MODULE_12__ = __webpack_require__(/*! ../Review/component/Fill */ 19637);
|
|
|
/* harmony import */ var _Review_component_Shixun__WEBPACK_IMPORTED_MODULE_13__ = __webpack_require__(/*! ../Review/component/Shixun */ 64198);
|
|
|
/* harmony import */ var _Review_component_Program__WEBPACK_IMPORTED_MODULE_14__ = __webpack_require__(/*! ../Review/component/Program */ 8788);
|
|
|
/* harmony import */ var _components_Head__WEBPACK_IMPORTED_MODULE_15__ = __webpack_require__(/*! ./components/Head */ 21066);
|
|
|
/* harmony import */ var moment__WEBPACK_IMPORTED_MODULE_16__ = __webpack_require__(/*! moment */ 94699);
|
|
|
/* harmony import */ var moment__WEBPACK_IMPORTED_MODULE_16___default = /*#__PURE__*/__webpack_require__.n(moment__WEBPACK_IMPORTED_MODULE_16__);
|
|
|
/* harmony import */ var html2pdf_js__WEBPACK_IMPORTED_MODULE_17__ = __webpack_require__(/*! html2pdf.js */ 80599);
|
|
|
/* harmony import */ var html2pdf_js__WEBPACK_IMPORTED_MODULE_17___default = /*#__PURE__*/__webpack_require__.n(html2pdf_js__WEBPACK_IMPORTED_MODULE_17__);
|
|
|
/* harmony import */ var _utils_authority__WEBPACK_IMPORTED_MODULE_18__ = __webpack_require__(/*! @/utils/authority */ 7);
|
|
|
/* harmony import */ var _utils_enum__WEBPACK_IMPORTED_MODULE_19__ = __webpack_require__(/*! @/utils/enum */ 70960);
|
|
|
/* harmony import */ var _pages_Classrooms_Lists_Exercise_Review_component_AnswerComments__WEBPACK_IMPORTED_MODULE_20__ = __webpack_require__(/*! @/pages/Classrooms/Lists/Exercise/Review/component/AnswerComments */ 37537);
|
|
|
/* harmony import */ var js_base64__WEBPACK_IMPORTED_MODULE_21__ = __webpack_require__(/*! js-base64 */ 19575);
|
|
|
/* harmony import */ var js_base64__WEBPACK_IMPORTED_MODULE_21___default = /*#__PURE__*/__webpack_require__.n(js_base64__WEBPACK_IMPORTED_MODULE_21__);
|
|
|
/* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_22__ = __webpack_require__(/*! react/jsx-runtime */ 85893);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
var _excluded = ["exercise", "globalSetting", "loading", "user", "dispatch"];
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
var PageCount = 30;
|
|
|
var TextArea = antd__WEBPACK_IMPORTED_MODULE_23__/* ["default"].TextArea */ .Z.TextArea;
|
|
|
var questionType = (/* unused pure expression or super */ null && (['单选题', '多选题', '判断题', '填空题', '简答题', '实训题', '编程题']));
|
|
|
var Export = function Export(_ref) {
|
|
|
var _userInfo$course, _exportData$exercise3, _exportData$exercise_2, _exportData$exercise4, _exportData$exercise5, _exportData$exercise6, _exportData$exercise7, _exportData$exercise8;
|
|
|
var exercise = _ref.exercise,
|
|
|
globalSetting = _ref.globalSetting,
|
|
|
loading = _ref.loading,
|
|
|
user = _ref.user,
|
|
|
dispatch = _ref.dispatch,
|
|
|
props = _root_workspace_ppte5yg23_local_v9_node_modules_babel_runtime_helpers_objectWithoutProperties_js__WEBPACK_IMPORTED_MODULE_5___default()(_ref, _excluded);
|
|
|
var params = (0,umi__WEBPACK_IMPORTED_MODULE_7__.useParams)();
|
|
|
var userInfo = user.userInfo;
|
|
|
var _useState = (0,react__WEBPACK_IMPORTED_MODULE_6__.useState)({}),
|
|
|
_useState2 = _root_workspace_ppte5yg23_local_v9_node_modules_babel_runtime_helpers_slicedToArray_js__WEBPACK_IMPORTED_MODULE_4___default()(_useState, 2),
|
|
|
changeScoreData = _useState2[0],
|
|
|
setChangeScoreData = _useState2[1];
|
|
|
var exportElement = (0,react__WEBPACK_IMPORTED_MODULE_6__.useRef)();
|
|
|
var isExportBlank = (0,react__WEBPACK_IMPORTED_MODULE_6__.useRef)(false);
|
|
|
var _useState3 = (0,react__WEBPACK_IMPORTED_MODULE_6__.useState)(false),
|
|
|
_useState4 = _root_workspace_ppte5yg23_local_v9_node_modules_babel_runtime_helpers_slicedToArray_js__WEBPACK_IMPORTED_MODULE_4___default()(_useState3, 2),
|
|
|
isLoading = _useState4[0],
|
|
|
setIsLoading = _useState4[1];
|
|
|
var _useState5 = (0,react__WEBPACK_IMPORTED_MODULE_6__.useState)({}),
|
|
|
_useState6 = _root_workspace_ppte5yg23_local_v9_node_modules_babel_runtime_helpers_slicedToArray_js__WEBPACK_IMPORTED_MODULE_4___default()(_useState5, 2),
|
|
|
exportData = _useState6[0],
|
|
|
setExportData = _useState6[1];
|
|
|
var _useState7 = (0,react__WEBPACK_IMPORTED_MODULE_6__.useState)(new (jszip__WEBPACK_IMPORTED_MODULE_8___default())()),
|
|
|
_useState8 = _root_workspace_ppte5yg23_local_v9_node_modules_babel_runtime_helpers_slicedToArray_js__WEBPACK_IMPORTED_MODULE_4___default()(_useState7, 2),
|
|
|
zip = _useState8[0],
|
|
|
setZip = _useState8[1];
|
|
|
var _useState9 = (0,react__WEBPACK_IMPORTED_MODULE_6__.useState)([]),
|
|
|
_useState10 = _root_workspace_ppte5yg23_local_v9_node_modules_babel_runtime_helpers_slicedToArray_js__WEBPACK_IMPORTED_MODULE_4___default()(_useState9, 2),
|
|
|
allStudents = _useState10[0],
|
|
|
setAllStudents = _useState10[1];
|
|
|
var _useState11 = (0,react__WEBPACK_IMPORTED_MODULE_6__.useState)(false),
|
|
|
_useState12 = _root_workspace_ppte5yg23_local_v9_node_modules_babel_runtime_helpers_slicedToArray_js__WEBPACK_IMPORTED_MODULE_4___default()(_useState11, 2),
|
|
|
autoHeight = _useState12[0],
|
|
|
setAutoHeight = _useState12[1];
|
|
|
var _useState13 = (0,react__WEBPACK_IMPORTED_MODULE_6__.useState)(false),
|
|
|
_useState14 = _root_workspace_ppte5yg23_local_v9_node_modules_babel_runtime_helpers_slicedToArray_js__WEBPACK_IMPORTED_MODULE_4___default()(_useState13, 2),
|
|
|
isshowanswer = _useState14[0],
|
|
|
setisshowanswer = _useState14[1]; //导出空白试卷加答案时显示答案
|
|
|
var _useState15 = (0,react__WEBPACK_IMPORTED_MODULE_6__.useState)(false),
|
|
|
_useState16 = _root_workspace_ppte5yg23_local_v9_node_modules_babel_runtime_helpers_slicedToArray_js__WEBPACK_IMPORTED_MODULE_4___default()(_useState15, 2),
|
|
|
userScoreVisible = _useState16[0],
|
|
|
setUserScoreVisible = _useState16[1]; //导出所有学生试卷时需要显示学生得分
|
|
|
var _useState17 = (0,react__WEBPACK_IMPORTED_MODULE_6__.useState)(false),
|
|
|
_useState18 = _root_workspace_ppte5yg23_local_v9_node_modules_babel_runtime_helpers_slicedToArray_js__WEBPACK_IMPORTED_MODULE_4___default()(_useState17, 2),
|
|
|
userCommentVisible = _useState18[0],
|
|
|
setUserCommentVisible = _useState18[1]; //导出所有学生试卷时需要显示评语
|
|
|
var _useState19 = (0,react__WEBPACK_IMPORTED_MODULE_6__.useState)(false),
|
|
|
_useState20 = _root_workspace_ppte5yg23_local_v9_node_modules_babel_runtime_helpers_slicedToArray_js__WEBPACK_IMPORTED_MODULE_4___default()(_useState19, 2),
|
|
|
newuserCommentVisible = _useState20[0],
|
|
|
setnewUserCommentVisible = _useState20[1]; //导出所有学生试卷时只需求最新的
|
|
|
var _useState21 = (0,react__WEBPACK_IMPORTED_MODULE_6__.useState)(false),
|
|
|
_useState22 = _root_workspace_ppte5yg23_local_v9_node_modules_babel_runtime_helpers_slicedToArray_js__WEBPACK_IMPORTED_MODULE_4___default()(_useState21, 2),
|
|
|
ismodal = _useState22[0],
|
|
|
setismodal = _useState22[1];
|
|
|
(0,react__WEBPACK_IMPORTED_MODULE_6__.useEffect)(function () {
|
|
|
if (userInfo !== null && userInfo !== void 0 && userInfo.login) {
|
|
|
getData();
|
|
|
}
|
|
|
try {
|
|
|
setAllStudents(JSON.parse(localStorage.total_exercise_users));
|
|
|
} catch (e) {}
|
|
|
}, [params.userId, params.coursesId, params.exerciseId, userInfo]);
|
|
|
var handleRemoveSurplusCanvas = function handleRemoveSurplusCanvas() {
|
|
|
document.querySelectorAll('canvas').forEach(function (item) {
|
|
|
(!item.clientWidth || !item.clientHeight) && item.remove();
|
|
|
});
|
|
|
};
|
|
|
var scrollView = function scrollView() {
|
|
|
document.body.scrollIntoView();
|
|
|
};
|
|
|
var randomQuestion = function randomQuestion(res) {
|
|
|
var _res$exercise_answer_, _res$exercise, _res$exercise2;
|
|
|
var random_id = res === null || res === void 0 ? void 0 : (_res$exercise_answer_ = res.exercise_answer_user) === null || _res$exercise_answer_ === void 0 ? void 0 : _res$exercise_answer_.user_id;
|
|
|
if (res !== null && res !== void 0 && (_res$exercise = res.exercise) !== null && _res$exercise !== void 0 && _res$exercise.question_random || res !== null && res !== void 0 && (_res$exercise2 = res.exercise) !== null && _res$exercise2 !== void 0 && _res$exercise2.choice_random) {
|
|
|
var _res$exercise_questio;
|
|
|
var _key = 1;
|
|
|
res.exercise.question_random = res === null || res === void 0 ? void 0 : (_res$exercise_questio = res.exercise_question_types) === null || _res$exercise_questio === void 0 ? void 0 : _res$exercise_questio.map(function (item) {
|
|
|
var _res$exercise3, _res$exercise4;
|
|
|
if (res !== null && res !== void 0 && (_res$exercise3 = res.exercise) !== null && _res$exercise3 !== void 0 && _res$exercise3.choice_random) {
|
|
|
if (item.question_type === 0 || item.question_type === 1) {
|
|
|
item.items.map(function (i) {
|
|
|
i.question_choices = (0,_utils_util__WEBPACK_IMPORTED_MODULE_11__/* .randomArray */ .M2)(i.question_choices, random_id);
|
|
|
return i;
|
|
|
});
|
|
|
}
|
|
|
if (item.question_type === 7) {
|
|
|
item.items.forEach(function (i) {
|
|
|
i.sub_exercise_questions.forEach(function (k) {
|
|
|
k.question_choices = (0,_utils_util__WEBPACK_IMPORTED_MODULE_11__/* .randomArray */ .M2)(k.question_choices, random_id);
|
|
|
});
|
|
|
});
|
|
|
}
|
|
|
}
|
|
|
if (res !== null && res !== void 0 && (_res$exercise4 = res.exercise) !== null && _res$exercise4 !== void 0 && _res$exercise4.question_random) {
|
|
|
item.items = (0,_utils_util__WEBPACK_IMPORTED_MODULE_11__/* .randomArray */ .M2)(item.items, random_id);
|
|
|
}
|
|
|
item.items.map(function (i) {
|
|
|
i.question_num = _key;
|
|
|
_key++;
|
|
|
return i;
|
|
|
});
|
|
|
return item;
|
|
|
});
|
|
|
}
|
|
|
};
|
|
|
var getData = /*#__PURE__*/function () {
|
|
|
var _ref2 = _root_workspace_ppte5yg23_local_v9_node_modules_babel_runtime_helpers_asyncToGenerator_js__WEBPACK_IMPORTED_MODULE_3___default()( /*#__PURE__*/_root_workspace_ppte5yg23_local_v9_node_modules_babel_runtime_helpers_regeneratorRuntime_js__WEBPACK_IMPORTED_MODULE_1___default()().mark(function _callee() {
|
|
|
var res;
|
|
|
return _root_workspace_ppte5yg23_local_v9_node_modules_babel_runtime_helpers_regeneratorRuntime_js__WEBPACK_IMPORTED_MODULE_1___default()().wrap(function _callee$(_context) {
|
|
|
while (1) switch (_context.prev = _context.next) {
|
|
|
case 0:
|
|
|
dispatch({
|
|
|
type: "exercise/getExerciseExportHeadData",
|
|
|
payload: {
|
|
|
id: params.exerciseId || params.categoryId,
|
|
|
identify: params.userId || null
|
|
|
}
|
|
|
});
|
|
|
if (!params.userId) {
|
|
|
_context.next = 9;
|
|
|
break;
|
|
|
}
|
|
|
_context.next = 4;
|
|
|
return dispatch({
|
|
|
type: "exercise/getReviewExercise",
|
|
|
payload: {
|
|
|
exerciseId: params.exerciseId,
|
|
|
login: params.userId
|
|
|
}
|
|
|
});
|
|
|
case 4:
|
|
|
res = _context.sent;
|
|
|
randomQuestion(res);
|
|
|
isExportBlank.current = false;
|
|
|
_context.next = 13;
|
|
|
break;
|
|
|
case 9:
|
|
|
_context.next = 11;
|
|
|
return dispatch({
|
|
|
type: 'exercise/editExercise',
|
|
|
payload: {
|
|
|
coursesId: params.coursesId,
|
|
|
categoryId: params.exerciseId
|
|
|
}
|
|
|
});
|
|
|
case 11:
|
|
|
res = _context.sent;
|
|
|
isExportBlank.current = true;
|
|
|
case 13:
|
|
|
setExportData(_root_workspace_ppte5yg23_local_v9_node_modules_babel_runtime_helpers_objectSpread2_js__WEBPACK_IMPORTED_MODULE_2___default()({}, res || {}));
|
|
|
setTimeout(function () {
|
|
|
var nbPages = 1;
|
|
|
var sourceHtml = document.getElementById("export-id-all");
|
|
|
var max_page_height = 860; //Is the max size of page i want. in px
|
|
|
var current_page_height = 0; //
|
|
|
|
|
|
// let dom = Array.from(document.getElementById("export-all").children);
|
|
|
// dom.map((item, key) => {
|
|
|
// current_page_height += item.scrollHeight
|
|
|
// if (max_page_height <= current_page_height) {
|
|
|
// current_page_height = item.scrollHeight;
|
|
|
// ++nbPages;
|
|
|
// let li = document.createElement("li")
|
|
|
// li.className = 'html2pdf__page-break'
|
|
|
// li.innerHTML = ' '
|
|
|
// document.getElementById("export-all").insertBefore(li, item)
|
|
|
// }
|
|
|
// })
|
|
|
}, 1500);
|
|
|
case 15:
|
|
|
case "end":
|
|
|
return _context.stop();
|
|
|
}
|
|
|
}, _callee);
|
|
|
}));
|
|
|
return function getData() {
|
|
|
return _ref2.apply(this, arguments);
|
|
|
};
|
|
|
}();
|
|
|
var download = function download() {
|
|
|
zip.generateAsync({
|
|
|
type: "blob"
|
|
|
}).then(function (content) {
|
|
|
var _exportData$exercise, _exercise$exerciseExp, _exportData$exercise2;
|
|
|
var link = document.createElement('a');
|
|
|
link.href = window.URL.createObjectURL(content);
|
|
|
link.download = Object.keys(zip.files).length > 1 ? (exportData === null || exportData === void 0 ? void 0 : (_exportData$exercise = exportData.exercise) === null || _exportData$exercise === void 0 ? void 0 : _exportData$exercise.exercise_name) + '.zip' : ((exercise === null || exercise === void 0 ? void 0 : (_exercise$exerciseExp = exercise.exerciseExportHeadData) === null || _exercise$exerciseExp === void 0 ? void 0 : _exercise$exerciseExp.user) || (exportData === null || exportData === void 0 ? void 0 : (_exportData$exercise2 = exportData.exercise) === null || _exportData$exercise2 === void 0 ? void 0 : _exportData$exercise2.exercise_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__WEBPACK_IMPORTED_MODULE_8___default())());
|
|
|
});
|
|
|
setisshowanswer(false);
|
|
|
setUserCommentVisible(false);
|
|
|
setUserScoreVisible(false);
|
|
|
setAutoHeight(false);
|
|
|
};
|
|
|
var exportReport = /*#__PURE__*/function () {
|
|
|
var _ref3 = _root_workspace_ppte5yg23_local_v9_node_modules_babel_runtime_helpers_asyncToGenerator_js__WEBPACK_IMPORTED_MODULE_3___default()( /*#__PURE__*/_root_workspace_ppte5yg23_local_v9_node_modules_babel_runtime_helpers_regeneratorRuntime_js__WEBPACK_IMPORTED_MODULE_1___default()().mark(function _callee6(type) {
|
|
|
var _exercise$exerciseExp2;
|
|
|
var nums, modal, pages, title, _exercise$exerciseExp3, _exercise$exerciseExp4, opt, worker, _loop, i, next, _next;
|
|
|
return _root_workspace_ppte5yg23_local_v9_node_modules_babel_runtime_helpers_regeneratorRuntime_js__WEBPACK_IMPORTED_MODULE_1___default()().wrap(function _callee6$(_context8) {
|
|
|
while (1) switch (_context8.prev = _context8.next) {
|
|
|
case 0:
|
|
|
_next = function _next3() {
|
|
|
_next = _root_workspace_ppte5yg23_local_v9_node_modules_babel_runtime_helpers_asyncToGenerator_js__WEBPACK_IMPORTED_MODULE_3___default()( /*#__PURE__*/_root_workspace_ppte5yg23_local_v9_node_modules_babel_runtime_helpers_regeneratorRuntime_js__WEBPACK_IMPORTED_MODULE_1___default()().mark(function _callee5() {
|
|
|
var res;
|
|
|
return _root_workspace_ppte5yg23_local_v9_node_modules_babel_runtime_helpers_regeneratorRuntime_js__WEBPACK_IMPORTED_MODULE_1___default()().wrap(function _callee5$(_context7) {
|
|
|
while (1) switch (_context7.prev = _context7.next) {
|
|
|
case 0:
|
|
|
nums++;
|
|
|
isExportBlank.current = false;
|
|
|
scrollView();
|
|
|
_context7.next = 5;
|
|
|
return dispatch({
|
|
|
type: "exercise/getExerciseExportHeadData",
|
|
|
payload: {
|
|
|
id: params.exerciseId || params.categoryId,
|
|
|
identify: allStudents[nums - 1]['user_login']
|
|
|
}
|
|
|
});
|
|
|
case 5:
|
|
|
_context7.next = 7;
|
|
|
return dispatch({
|
|
|
type: "exercise/getReviewExercise",
|
|
|
payload: {
|
|
|
exerciseId: params.exerciseId,
|
|
|
login: allStudents[nums - 1]['user_login']
|
|
|
}
|
|
|
});
|
|
|
case 7:
|
|
|
res = _context7.sent;
|
|
|
randomQuestion(res);
|
|
|
setExportData(_root_workspace_ppte5yg23_local_v9_node_modules_babel_runtime_helpers_objectSpread2_js__WEBPACK_IMPORTED_MODULE_2___default()({}, res || {}));
|
|
|
setTimeout( /*#__PURE__*/_root_workspace_ppte5yg23_local_v9_node_modules_babel_runtime_helpers_asyncToGenerator_js__WEBPACK_IMPORTED_MODULE_3___default()( /*#__PURE__*/_root_workspace_ppte5yg23_local_v9_node_modules_babel_runtime_helpers_regeneratorRuntime_js__WEBPACK_IMPORTED_MODULE_1___default()().mark(function _callee4() {
|
|
|
var worker, _loop2, _i;
|
|
|
return _root_workspace_ppte5yg23_local_v9_node_modules_babel_runtime_helpers_regeneratorRuntime_js__WEBPACK_IMPORTED_MODULE_1___default()().wrap(function _callee4$(_context6) {
|
|
|
while (1) switch (_context6.prev = _context6.next) {
|
|
|
case 0:
|
|
|
handleRemoveSurplusCanvas();
|
|
|
// const pdfUrl = await html2pdf()
|
|
|
// .from(document.getElementById("export-all"))
|
|
|
// .set(opt)
|
|
|
// // .toPdf()
|
|
|
// .output('blob')
|
|
|
// setIsLoading(false)
|
|
|
worker = html2pdf_js__WEBPACK_IMPORTED_MODULE_17___default()();
|
|
|
_loop2 = /*#__PURE__*/_root_workspace_ppte5yg23_local_v9_node_modules_babel_runtime_helpers_regeneratorRuntime_js__WEBPACK_IMPORTED_MODULE_1___default()().mark(function _loop2(_i) {
|
|
|
return _root_workspace_ppte5yg23_local_v9_node_modules_babel_runtime_helpers_regeneratorRuntime_js__WEBPACK_IMPORTED_MODULE_1___default()().wrap(function _loop2$(_context5) {
|
|
|
while (1) switch (_context5.prev = _context5.next) {
|
|
|
case 0:
|
|
|
_context5.next = 2;
|
|
|
return worker.set(opt).from(pages[_i]).toContainer().toCanvas().toPdf().get('pdf').then( /*#__PURE__*/function () {
|
|
|
var _ref6 = _root_workspace_ppte5yg23_local_v9_node_modules_babel_runtime_helpers_asyncToGenerator_js__WEBPACK_IMPORTED_MODULE_3___default()( /*#__PURE__*/_root_workspace_ppte5yg23_local_v9_node_modules_babel_runtime_helpers_regeneratorRuntime_js__WEBPACK_IMPORTED_MODULE_1___default()().mark(function _callee3(pdf) {
|
|
|
return _root_workspace_ppte5yg23_local_v9_node_modules_babel_runtime_helpers_regeneratorRuntime_js__WEBPACK_IMPORTED_MODULE_1___default()().wrap(function _callee3$(_context4) {
|
|
|
while (1) switch (_context4.prev = _context4.next) {
|
|
|
case 0:
|
|
|
if (!(_i < pages.length - 1)) {
|
|
|
_context4.next = 3;
|
|
|
break;
|
|
|
}
|
|
|
_context4.next = 3;
|
|
|
return pdf.addPage();
|
|
|
case 3:
|
|
|
case "end":
|
|
|
return _context4.stop();
|
|
|
}
|
|
|
}, _callee3);
|
|
|
}));
|
|
|
return function (_x3) {
|
|
|
return _ref6.apply(this, arguments);
|
|
|
};
|
|
|
}());
|
|
|
case 2:
|
|
|
case "end":
|
|
|
return _context5.stop();
|
|
|
}
|
|
|
}, _loop2);
|
|
|
});
|
|
|
_i = 0;
|
|
|
case 4:
|
|
|
if (!(_i < pages.length)) {
|
|
|
_context6.next = 9;
|
|
|
break;
|
|
|
}
|
|
|
return _context6.delegateYield(_loop2(_i), "t0", 6);
|
|
|
case 6:
|
|
|
_i++;
|
|
|
_context6.next = 4;
|
|
|
break;
|
|
|
case 9:
|
|
|
zip.file("".concat(allStudents[nums - 1]['user_name'], "-").concat(moment__WEBPACK_IMPORTED_MODULE_16___default()().format('YYYY-MM-DD HH:mm:ss'), ".pdf"), worker.output("blob"));
|
|
|
modal.update({
|
|
|
content: /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_22__.jsxs)("div", {
|
|
|
children: ["\u5F53\u524D\u8FDB\u5EA6: ", /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_22__.jsx)("span", {
|
|
|
className: "c-blue",
|
|
|
children: nums + 1
|
|
|
}), "/", allStudents === null || allStudents === void 0 ? void 0 : allStudents.length]
|
|
|
})
|
|
|
});
|
|
|
if (nums == (allStudents === null || allStudents === void 0 ? void 0 : allStudents.length)) {
|
|
|
modal.destroy();
|
|
|
setIsLoading(false);
|
|
|
download();
|
|
|
} else {
|
|
|
next();
|
|
|
}
|
|
|
case 12:
|
|
|
case "end":
|
|
|
return _context6.stop();
|
|
|
}
|
|
|
}, _callee4);
|
|
|
})), 2600);
|
|
|
case 11:
|
|
|
case "end":
|
|
|
return _context7.stop();
|
|
|
}
|
|
|
}, _callee5);
|
|
|
}));
|
|
|
return _next.apply(this, arguments);
|
|
|
};
|
|
|
next = function _next2() {
|
|
|
return _next.apply(this, arguments);
|
|
|
};
|
|
|
if (type === "all") {
|
|
|
isExportBlank.current = false;
|
|
|
} else if (!params.userId) {
|
|
|
isExportBlank.current = true;
|
|
|
}
|
|
|
scrollView();
|
|
|
setAutoHeight(true);
|
|
|
nums = 0;
|
|
|
if (type !== 'all') setIsLoading(true);
|
|
|
// else
|
|
|
modal = antd__WEBPACK_IMPORTED_MODULE_24__/* ["default"].info */ .Z.info({
|
|
|
width: 460,
|
|
|
title: /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_22__.jsxs)("div", {
|
|
|
children: ["\u6B63\u5728\u5BFC\u51FA\u8BD5\u5377,", /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_22__.jsx)("span", {
|
|
|
className: "c-red",
|
|
|
children: "\u8BF7\u52FF\u5173\u95ED\u6216\u64CD\u4F5C\u5F53\u524D\u6D4F\u89C8\u5668\u7A97\u53E3"
|
|
|
})]
|
|
|
}),
|
|
|
content: type === 'all' ? /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_22__.jsxs)("div", {
|
|
|
children: ["\u5F53\u524D\u8FDB\u5EA6: ", /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_22__.jsx)("span", {
|
|
|
className: "c-blue",
|
|
|
children: nums + 1
|
|
|
}), "/", allStudents === null || allStudents === void 0 ? void 0 : allStudents.length]
|
|
|
}) : null,
|
|
|
maskClosable: false,
|
|
|
className: _index_less_modules__WEBPACK_IMPORTED_MODULE_9__/* ["default"].modal */ .Z.modal,
|
|
|
onOk: function onOk() {}
|
|
|
});
|
|
|
handleRemoveSurplusCanvas();
|
|
|
_context8.next = 11;
|
|
|
return new Promise(function (resolve, reject) {
|
|
|
setTimeout(function () {
|
|
|
resolve('');
|
|
|
}, 1000);
|
|
|
});
|
|
|
case 11:
|
|
|
// const opt = {
|
|
|
// // margin: [10, 10],
|
|
|
// html2canvas: { letterRendering: true, useCORS: true, allowTaint: false },
|
|
|
// // filename: 'test.pdf',
|
|
|
// // enableLinks: false,
|
|
|
// jsPDF: { unit: 'in', format: 'letter', orientation: 'portrait' }
|
|
|
// // pagebreak: { mode: ['avoid-all', 'css', 'legacy'] },
|
|
|
// // image: { type: 'jpeg', quality: 0.98 }
|
|
|
// }
|
|
|
// let title = `${moment().format('YYYY-MM-DD HH:mm:ss')}`;
|
|
|
// if (exercise.exerciseExportHeadData?.user) {
|
|
|
// title = `${exercise.exerciseExportHeadData?.student_id || ''}${exercise.exerciseExportHeadData?.user}`
|
|
|
// }
|
|
|
// const pdfUrl = await html2pdf()
|
|
|
// .from(document.getElementById("export-all"))
|
|
|
// .set(opt)
|
|
|
// // .toPdf()
|
|
|
// .output('blob')
|
|
|
// setIsLoading(false)
|
|
|
// if (type !== 'all')
|
|
|
// zip.file(`${title}-${moment().format('YYYY-MM-DD HH:mm:ss')}.pdf`, pdfUrl);
|
|
|
// if (type !== 'all') {
|
|
|
// modal.destroy()
|
|
|
// download()
|
|
|
// return;
|
|
|
// }
|
|
|
pages = exportElement.current.children;
|
|
|
title = "".concat(moment__WEBPACK_IMPORTED_MODULE_16___default()().format('YYYY-MM-DD HH:mm:ss'));
|
|
|
if ((_exercise$exerciseExp2 = exercise.exerciseExportHeadData) !== null && _exercise$exerciseExp2 !== void 0 && _exercise$exerciseExp2.user) {
|
|
|
title = "".concat(((_exercise$exerciseExp3 = exercise.exerciseExportHeadData) === null || _exercise$exerciseExp3 === void 0 ? void 0 : _exercise$exerciseExp3.student_id) || '').concat((_exercise$exerciseExp4 = exercise.exerciseExportHeadData) === null || _exercise$exerciseExp4 === void 0 ? void 0 : _exercise$exerciseExp4.user);
|
|
|
}
|
|
|
opt = {
|
|
|
html2canvas: {
|
|
|
letterRendering: true,
|
|
|
useCORS: true,
|
|
|
allowTaint: false
|
|
|
},
|
|
|
jsPDF: {
|
|
|
unit: 'in',
|
|
|
format: 'letter',
|
|
|
orientation: 'portrait'
|
|
|
},
|
|
|
pagebreak: {
|
|
|
mode: ['avoid-all']
|
|
|
}
|
|
|
};
|
|
|
worker = html2pdf_js__WEBPACK_IMPORTED_MODULE_17___default()();
|
|
|
_loop = /*#__PURE__*/_root_workspace_ppte5yg23_local_v9_node_modules_babel_runtime_helpers_regeneratorRuntime_js__WEBPACK_IMPORTED_MODULE_1___default()().mark(function _loop(i) {
|
|
|
return _root_workspace_ppte5yg23_local_v9_node_modules_babel_runtime_helpers_regeneratorRuntime_js__WEBPACK_IMPORTED_MODULE_1___default()().wrap(function _loop$(_context3) {
|
|
|
while (1) switch (_context3.prev = _context3.next) {
|
|
|
case 0:
|
|
|
_context3.next = 2;
|
|
|
return worker.set(opt).from(pages[i]).toContainer().toCanvas().toPdf().get('pdf').then( /*#__PURE__*/function () {
|
|
|
var _ref4 = _root_workspace_ppte5yg23_local_v9_node_modules_babel_runtime_helpers_asyncToGenerator_js__WEBPACK_IMPORTED_MODULE_3___default()( /*#__PURE__*/_root_workspace_ppte5yg23_local_v9_node_modules_babel_runtime_helpers_regeneratorRuntime_js__WEBPACK_IMPORTED_MODULE_1___default()().mark(function _callee2(pdf) {
|
|
|
return _root_workspace_ppte5yg23_local_v9_node_modules_babel_runtime_helpers_regeneratorRuntime_js__WEBPACK_IMPORTED_MODULE_1___default()().wrap(function _callee2$(_context2) {
|
|
|
while (1) switch (_context2.prev = _context2.next) {
|
|
|
case 0:
|
|
|
if (!(i < pages.length - 1)) {
|
|
|
_context2.next = 3;
|
|
|
break;
|
|
|
}
|
|
|
_context2.next = 3;
|
|
|
return pdf.addPage();
|
|
|
case 3:
|
|
|
case "end":
|
|
|
return _context2.stop();
|
|
|
}
|
|
|
}, _callee2);
|
|
|
}));
|
|
|
return function (_x2) {
|
|
|
return _ref4.apply(this, arguments);
|
|
|
};
|
|
|
}());
|
|
|
case 2:
|
|
|
case "end":
|
|
|
return _context3.stop();
|
|
|
}
|
|
|
}, _loop);
|
|
|
});
|
|
|
i = 0;
|
|
|
case 18:
|
|
|
if (!(i < pages.length)) {
|
|
|
_context8.next = 23;
|
|
|
break;
|
|
|
}
|
|
|
return _context8.delegateYield(_loop(i), "t0", 20);
|
|
|
case 20:
|
|
|
i++;
|
|
|
_context8.next = 18;
|
|
|
break;
|
|
|
case 23:
|
|
|
if (!!(allStudents !== null && allStudents !== void 0 && allStudents.length) && type === 'all') {
|
|
|
next();
|
|
|
} else {
|
|
|
// zip.file(`${shixunWorkReport.username}.pdf`, pdfUrl);
|
|
|
zip.file("".concat(title, ".pdf"), worker.output("blob"), {
|
|
|
base64: false
|
|
|
});
|
|
|
// worker.save()
|
|
|
modal.destroy();
|
|
|
setIsLoading(false);
|
|
|
download();
|
|
|
}
|
|
|
// openNewWindow(pdfUrl)
|
|
|
case 24:
|
|
|
case "end":
|
|
|
return _context8.stop();
|
|
|
}
|
|
|
}, _callee6);
|
|
|
}));
|
|
|
return function exportReport(_x) {
|
|
|
return _ref3.apply(this, arguments);
|
|
|
};
|
|
|
}();
|
|
|
var setPdfFooter = function setPdfFooter(pdf) {
|
|
|
var totalPages = pdf.internal.getNumberOfPages();
|
|
|
for (var pageNumber = 1; pageNumber <= totalPages; pageNumber += 1) {
|
|
|
pdf.setPage(pageNumber);
|
|
|
pdf.setFontSize(9);
|
|
|
pdf.setTextColor('#6a6a6a');
|
|
|
pdf.text("".concat(pageNumber, " / ").concat(totalPages), pdf.internal.pageSize.getWidth() - 20, pdf.internal.pageSize.getHeight() - 6);
|
|
|
}
|
|
|
};
|
|
|
var renderQuestion = function renderQuestion(item, i) {
|
|
|
var _item$question_choice, _item$question_choice2, _item$question_choice3, _changeScoreData$item, _item$user_answer4, _item$user_answer_lig, _item$user_answer5, _item$sub_exercise_qu, _item$program_attr, _item$standard_answer, _item$standard_answer2, _item$standard_answer3, _item$standard_answer4;
|
|
|
return /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_22__.jsxs)(react_jsx_runtime__WEBPACK_IMPORTED_MODULE_22__.Fragment, {
|
|
|
children: [/*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_22__.jsxs)("div", {
|
|
|
style: {
|
|
|
display: 'flex'
|
|
|
},
|
|
|
className: _index_less_modules__WEBPACK_IMPORTED_MODULE_9__/* ["default"].programTitle */ .Z.programTitle,
|
|
|
children: [/*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_22__.jsxs)("span", {
|
|
|
style: {
|
|
|
flexShrink: 0
|
|
|
},
|
|
|
className: "font18",
|
|
|
children: [i, "."]
|
|
|
}), /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_22__.jsx)(_components_RenderHtml__WEBPACK_IMPORTED_MODULE_10__/* ["default"] */ .Z, {
|
|
|
value: item.question_title
|
|
|
}), /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_22__.jsxs)("span", {
|
|
|
style: {
|
|
|
flexShrink: 0
|
|
|
},
|
|
|
className: "font16",
|
|
|
children: ["\uFF08", (item === null || item === void 0 ? void 0 : item.question_type) === 7 ? "\u5171".concat(item === null || item === void 0 ? void 0 : item.sub_q_count, "\u5C0F\u9898") : '', " ", item.question_score, "\u5206\uFF09"]
|
|
|
})]
|
|
|
}),
|
|
|
// 单选题
|
|
|
item.question_type === _utils_enum__WEBPACK_IMPORTED_MODULE_19__/* .QuestionType.Single */ .c.Single && /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_22__.jsx)(react_jsx_runtime__WEBPACK_IMPORTED_MODULE_22__.Fragment, {
|
|
|
children: (_item$question_choice = item.question_choices) === null || _item$question_choice === void 0 ? void 0 : _item$question_choice.map(function (val, key) {
|
|
|
var _item$user_answer;
|
|
|
return /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_22__.jsxs)(antd__WEBPACK_IMPORTED_MODULE_25__/* ["default"] */ .Z, {
|
|
|
children: [/*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_22__.jsx)(antd__WEBPACK_IMPORTED_MODULE_26__/* ["default"] */ .Z, {
|
|
|
flex: "25px",
|
|
|
children: /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_22__.jsx)("div", {
|
|
|
style: {
|
|
|
width: 25,
|
|
|
overflow: "hidden"
|
|
|
},
|
|
|
children: /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_22__.jsx)(antd__WEBPACK_IMPORTED_MODULE_27__/* ["default"] */ .ZP, {
|
|
|
checked: (_item$user_answer = item.user_answer) === null || _item$user_answer === void 0 ? void 0 : _item$user_answer.includes(val.choice_id),
|
|
|
style: {
|
|
|
width: 25
|
|
|
}
|
|
|
})
|
|
|
})
|
|
|
}), /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_22__.jsx)(antd__WEBPACK_IMPORTED_MODULE_26__/* ["default"] */ .Z, {
|
|
|
flex: "1",
|
|
|
children: /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_22__.jsx)(_components_RenderHtml__WEBPACK_IMPORTED_MODULE_10__/* ["default"] */ .Z, {
|
|
|
value: val.choice_text || ""
|
|
|
})
|
|
|
})]
|
|
|
}, key);
|
|
|
})
|
|
|
}),
|
|
|
// 多选题
|
|
|
item.question_type === _utils_enum__WEBPACK_IMPORTED_MODULE_19__/* .QuestionType.Multiple */ .c.Multiple && /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_22__.jsx)(react_jsx_runtime__WEBPACK_IMPORTED_MODULE_22__.Fragment, {
|
|
|
children: (_item$question_choice2 = item.question_choices) === null || _item$question_choice2 === void 0 ? void 0 : _item$question_choice2.map(function (val, key) {
|
|
|
var _item$user_answer2;
|
|
|
return /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_22__.jsxs)(antd__WEBPACK_IMPORTED_MODULE_25__/* ["default"] */ .Z, {
|
|
|
children: [/*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_22__.jsx)(antd__WEBPACK_IMPORTED_MODULE_26__/* ["default"] */ .Z, {
|
|
|
flex: "25px",
|
|
|
children: /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_22__.jsx)("div", {
|
|
|
style: {
|
|
|
width: 25,
|
|
|
overflow: "hidden"
|
|
|
},
|
|
|
children: /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_22__.jsx)(antd__WEBPACK_IMPORTED_MODULE_28__/* ["default"] */ .Z, {
|
|
|
checked: (_item$user_answer2 = item.user_answer) === null || _item$user_answer2 === void 0 ? void 0 : _item$user_answer2.includes(val.choice_id),
|
|
|
style: {
|
|
|
width: 25
|
|
|
}
|
|
|
})
|
|
|
})
|
|
|
}), /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_22__.jsx)(antd__WEBPACK_IMPORTED_MODULE_26__/* ["default"] */ .Z, {
|
|
|
flex: "1",
|
|
|
children: /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_22__.jsx)(_components_RenderHtml__WEBPACK_IMPORTED_MODULE_10__/* ["default"] */ .Z, {
|
|
|
value: val.choice_text || ""
|
|
|
})
|
|
|
})]
|
|
|
}, key);
|
|
|
// return <div className=""><Checkbox checked={item.user_answer?.includes(val.choice_id)}>
|
|
|
// {val.choice_text}
|
|
|
// </Checkbox></div>
|
|
|
})
|
|
|
}),
|
|
|
// 判断题
|
|
|
item.question_type === _utils_enum__WEBPACK_IMPORTED_MODULE_19__/* .QuestionType.Judge */ .c.Judge && /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_22__.jsx)("div", {
|
|
|
className: _index_less_modules__WEBPACK_IMPORTED_MODULE_9__/* ["default"].flexRow */ .Z.flexRow,
|
|
|
children: (_item$question_choice3 = item.question_choices) === null || _item$question_choice3 === void 0 ? void 0 : _item$question_choice3.map(function (val, key) {
|
|
|
var _item$user_answer3;
|
|
|
return /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_22__.jsxs)(antd__WEBPACK_IMPORTED_MODULE_25__/* ["default"] */ .Z, {
|
|
|
children: [/*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_22__.jsx)(antd__WEBPACK_IMPORTED_MODULE_26__/* ["default"] */ .Z, {
|
|
|
flex: "25px",
|
|
|
children: /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_22__.jsx)("div", {
|
|
|
style: {
|
|
|
width: 25,
|
|
|
overflow: "hidden"
|
|
|
},
|
|
|
children: /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_22__.jsx)(antd__WEBPACK_IMPORTED_MODULE_27__/* ["default"] */ .ZP, {
|
|
|
checked: (_item$user_answer3 = item.user_answer) === null || _item$user_answer3 === void 0 ? void 0 : _item$user_answer3.includes(val.choice_id),
|
|
|
style: {
|
|
|
width: 25
|
|
|
}
|
|
|
})
|
|
|
})
|
|
|
}), /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_22__.jsx)(antd__WEBPACK_IMPORTED_MODULE_26__/* ["default"] */ .Z, {
|
|
|
flex: "1",
|
|
|
children: val.choice_text
|
|
|
})]
|
|
|
}, key);
|
|
|
// return <div className=""><Radio checked={item.user_answer?.includes(val.choice_id)}>
|
|
|
// {val.choice_text}
|
|
|
// </Radio></div>
|
|
|
})
|
|
|
}), item.question_type === _utils_enum__WEBPACK_IMPORTED_MODULE_19__/* .QuestionType.Fill */ .c.Fill && !isExportBlank.current && /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_22__.jsx)(_Review_component_Fill__WEBPACK_IMPORTED_MODULE_12__/* ["default"] */ .Z, {
|
|
|
item: item,
|
|
|
answerData: exportData,
|
|
|
changeScoreData: changeScoreData,
|
|
|
textValue: (_changeScoreData$item = changeScoreData[item.q_position]) === null || _changeScoreData$item === void 0 ? void 0 : _changeScoreData$item.text,
|
|
|
textOnChange: function textOnChange(value) {
|
|
|
changeScoreData[item.q_position].text = value;
|
|
|
setChangeScoreData(_root_workspace_ppte5yg23_local_v9_node_modules_babel_runtime_helpers_objectSpread2_js__WEBPACK_IMPORTED_MODULE_2___default()({}, changeScoreData));
|
|
|
},
|
|
|
seeAnswerVisible: false
|
|
|
}), item.question_type === _utils_enum__WEBPACK_IMPORTED_MODULE_19__/* .QuestionType.Shixun */ .c.Shixun && /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_22__.jsx)(_Review_component_Shixun__WEBPACK_IMPORTED_MODULE_13__/* ["default"] */ .Z, {
|
|
|
item: item,
|
|
|
answerData: exportData,
|
|
|
hasChangeScore: false,
|
|
|
autoHeight: autoHeight
|
|
|
}), item.question_type === _utils_enum__WEBPACK_IMPORTED_MODULE_19__/* .QuestionType.Subjective */ .c.Subjective && item !== null && item !== void 0 && (_item$user_answer4 = item.user_answer) !== null && _item$user_answer4 !== void 0 && _item$user_answer4[0] ? /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_22__.jsxs)("div", {
|
|
|
className: _index_less_modules__WEBPACK_IMPORTED_MODULE_9__/* ["default"].simpleBg */ .Z.simpleBg,
|
|
|
children: [/*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_22__.jsx)("aside", {
|
|
|
className: "font14 c-light-primary mb5",
|
|
|
children: "\u5B66\u751F\u7B54\u9898"
|
|
|
}), /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_22__.jsx)("div", {
|
|
|
children: userCommentVisible ? /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_22__.jsx)(_components_RenderHtml__WEBPACK_IMPORTED_MODULE_10__/* ["default"] */ .Z, {
|
|
|
value: item === null || item === void 0 ? void 0 : (_item$user_answer_lig = item.user_answer_light) === null || _item$user_answer_lig === void 0 ? void 0 : _item$user_answer_lig[0]
|
|
|
}) : /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_22__.jsx)(_components_RenderHtml__WEBPACK_IMPORTED_MODULE_10__/* ["default"] */ .Z, {
|
|
|
value: item === null || item === void 0 ? void 0 : (_item$user_answer5 = item.user_answer) === null || _item$user_answer5 === void 0 ? void 0 : _item$user_answer5[0]
|
|
|
})
|
|
|
})]
|
|
|
}) : null, item.question_type === _utils_enum__WEBPACK_IMPORTED_MODULE_19__/* .QuestionType.Program */ .c.Program && /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_22__.jsx)(_Review_component_Program__WEBPACK_IMPORTED_MODULE_14__/* ["default"] */ .Z, {
|
|
|
item: item,
|
|
|
answerData: exportData,
|
|
|
autoHeight: autoHeight
|
|
|
}), item.question_type === _utils_enum__WEBPACK_IMPORTED_MODULE_19__/* .QuestionType.Combine */ .c.Combine && /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_22__.jsx)(react_jsx_runtime__WEBPACK_IMPORTED_MODULE_22__.Fragment, {
|
|
|
children: (_item$sub_exercise_qu = item.sub_exercise_questions) === null || _item$sub_exercise_qu === void 0 ? void 0 : _item$sub_exercise_qu.map(function (val, key) {
|
|
|
var _val$question_choices, _val$standard_answer;
|
|
|
return /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_22__.jsxs)("div", {
|
|
|
style: {
|
|
|
marginLeft: 10
|
|
|
},
|
|
|
children: [/*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_22__.jsxs)("span", {
|
|
|
style: {
|
|
|
fontSize: '16px'
|
|
|
},
|
|
|
children: [i, ".", key + 1, "\uFF08\u5355\u9009\u9898\uFF09", val === null || val === void 0 ? void 0 : val.question_title, "\uFF08", val === null || val === void 0 ? void 0 : val.question_score, "\u5206\uFF09"]
|
|
|
}), (_val$question_choices = val.question_choices) === null || _val$question_choices === void 0 ? void 0 : _val$question_choices.map(function (vals, keys) {
|
|
|
var _val$user_answer;
|
|
|
return /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_22__.jsxs)(antd__WEBPACK_IMPORTED_MODULE_25__/* ["default"] */ .Z, {
|
|
|
children: [/*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_22__.jsx)(antd__WEBPACK_IMPORTED_MODULE_26__/* ["default"] */ .Z, {
|
|
|
flex: "25px",
|
|
|
children: /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_22__.jsx)("div", {
|
|
|
style: {
|
|
|
width: 25,
|
|
|
overflow: "hidden"
|
|
|
},
|
|
|
children: /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_22__.jsx)(antd__WEBPACK_IMPORTED_MODULE_27__/* ["default"] */ .ZP, {
|
|
|
checked: (_val$user_answer = val.user_answer) === null || _val$user_answer === void 0 ? void 0 : _val$user_answer.includes(vals.choice_id),
|
|
|
style: {
|
|
|
width: 25
|
|
|
}
|
|
|
})
|
|
|
})
|
|
|
}), /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_22__.jsx)(antd__WEBPACK_IMPORTED_MODULE_26__/* ["default"] */ .Z, {
|
|
|
flex: "1",
|
|
|
children: /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_22__.jsx)(_components_RenderHtml__WEBPACK_IMPORTED_MODULE_10__/* ["default"] */ .Z, {
|
|
|
value: vals.choice_text || ""
|
|
|
})
|
|
|
})]
|
|
|
}, keys);
|
|
|
}), (val === null || val === void 0 ? void 0 : val.standard_answer_show) && isshowanswer && /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_22__.jsxs)("span", {
|
|
|
className: "font16 ",
|
|
|
children: ["\u6B63\u786E\u7B54\u6848\uFF1A", val === null || val === void 0 ? void 0 : val.standard_answer_show]
|
|
|
}), ((val === null || val === void 0 ? void 0 : val.standard_answer_show) || (val === null || val === void 0 ? void 0 : (_val$standard_answer = val.standard_answer) === null || _val$standard_answer === void 0 ? void 0 : _val$standard_answer.length) > 0) && isshowanswer && /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_22__.jsxs)(antd__WEBPACK_IMPORTED_MODULE_25__/* ["default"] */ .Z, {
|
|
|
style: {
|
|
|
marginTop: 14
|
|
|
},
|
|
|
children: [/*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_22__.jsx)("span", {
|
|
|
className: "font16 ",
|
|
|
children: "\u89E3\u6790\uFF1A"
|
|
|
}), /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_22__.jsx)(_components_RenderHtml__WEBPACK_IMPORTED_MODULE_10__/* ["default"] */ .Z, {
|
|
|
className: _index_less_modules__WEBPACK_IMPORTED_MODULE_9__/* ["default"].renderHtml */ .Z.renderHtml,
|
|
|
value: (val === null || val === void 0 ? void 0 : val.analysis) || '暂无解析'
|
|
|
})]
|
|
|
})]
|
|
|
});
|
|
|
})
|
|
|
}), item.question_type === 8 && /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_22__.jsx)(react_jsx_runtime__WEBPACK_IMPORTED_MODULE_22__.Fragment, {
|
|
|
children: /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_22__.jsx)("div", {
|
|
|
style: {
|
|
|
padding: "20px 30px"
|
|
|
},
|
|
|
children: /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_22__.jsx)(_components_RenderHtml__WEBPACK_IMPORTED_MODULE_10__/* ["default"] */ .Z, {
|
|
|
showProgramFill: true,
|
|
|
disabledFill: true,
|
|
|
value: js_base64__WEBPACK_IMPORTED_MODULE_21__.Base64.decode((item === null || item === void 0 ? void 0 : (_item$program_attr = item.program_attr) === null || _item$program_attr === void 0 ? void 0 : _item$program_attr.code) || '')
|
|
|
})
|
|
|
})
|
|
|
}), isshowanswer && /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_22__.jsxs)("div", {
|
|
|
style: {
|
|
|
marginTop: 10
|
|
|
},
|
|
|
children: [(item === null || item === void 0 ? void 0 : item.question_type) < 3 && (item === null || item === void 0 ? void 0 : item.standard_answer_show) && /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_22__.jsxs)("span", {
|
|
|
className: "font16 ",
|
|
|
children: ["\u6B63\u786E\u7B54\u6848\uFF1A", item === null || item === void 0 ? void 0 : item.standard_answer_show]
|
|
|
}), !!(item !== null && item !== void 0 && (_item$standard_answer = item.standard_answer) !== null && _item$standard_answer !== void 0 && _item$standard_answer.length) && isshowanswer && (item === null || item === void 0 ? void 0 : item.question_type) === 3 && /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_22__.jsx)("div", {
|
|
|
children: item === null || item === void 0 ? void 0 : (_item$standard_answer2 = item.standard_answer) === null || _item$standard_answer2 === void 0 ? void 0 : _item$standard_answer2.map(function (answer, index) {
|
|
|
return /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_22__.jsxs)("div", {
|
|
|
children: [/*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_22__.jsxs)("span", {
|
|
|
children: ["\u53C2\u8003\u7B54\u6848\uFF1A\uFF08\u586B\u7A7A", index + 1, "\uFF09:"]
|
|
|
}), /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_22__.jsx)("div", {
|
|
|
children: /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_22__.jsx)(TextArea, {
|
|
|
autoSize: true,
|
|
|
disabled: true,
|
|
|
value: answer === null || answer === void 0 ? void 0 : answer.answer_text[0]
|
|
|
})
|
|
|
})]
|
|
|
});
|
|
|
})
|
|
|
}), (item === null || item === void 0 ? void 0 : item.standard_answer) && (item === null || item === void 0 ? void 0 : item.question_type) === 4 && /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_22__.jsxs)("div", {
|
|
|
children: [/*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_22__.jsx)("p", {
|
|
|
className: "mt10 mb0",
|
|
|
children: "\u53C2\u8003\u7B54\u6848\uFF1A"
|
|
|
}), /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_22__.jsx)("div", {
|
|
|
style: {
|
|
|
border: "1px solid #eee",
|
|
|
background: "#f5f5f5",
|
|
|
borderRadius: 4,
|
|
|
padding: 5
|
|
|
},
|
|
|
children: /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_22__.jsx)(_components_RenderHtml__WEBPACK_IMPORTED_MODULE_10__/* ["default"] */ .Z, {
|
|
|
value: item === null || item === void 0 ? void 0 : (_item$standard_answer3 = item.standard_answer) === null || _item$standard_answer3 === void 0 ? void 0 : _item$standard_answer3[0]
|
|
|
})
|
|
|
})]
|
|
|
}), (item === null || item === void 0 ? void 0 : item.answer_text) && (item === null || item === void 0 ? void 0 : item.question_type) === 6 && /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_22__.jsxs)("div", {
|
|
|
children: [/*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_22__.jsx)("p", {
|
|
|
className: "mt10 mb0",
|
|
|
children: "\u53C2\u8003\u7B54\u6848\uFF1A"
|
|
|
}), /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_22__.jsx)("div", {
|
|
|
style: {
|
|
|
border: "1px solid #eee",
|
|
|
background: "#f5f5f5",
|
|
|
borderRadius: 4,
|
|
|
padding: 5
|
|
|
},
|
|
|
children: /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_22__.jsx)(_components_RenderHtml__WEBPACK_IMPORTED_MODULE_10__/* ["default"] */ .Z, {
|
|
|
value: item === null || item === void 0 ? void 0 : item.answer_text
|
|
|
})
|
|
|
})]
|
|
|
}), (item === null || item === void 0 ? void 0 : item.question_type) <= 4 && ((item === null || item === void 0 ? void 0 : item.standard_answer_show) || (item === null || item === void 0 ? void 0 : (_item$standard_answer4 = item.standard_answer) === null || _item$standard_answer4 === void 0 ? void 0 : _item$standard_answer4.length) > 0) && /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_22__.jsxs)(antd__WEBPACK_IMPORTED_MODULE_25__/* ["default"] */ .Z, {
|
|
|
style: {
|
|
|
marginTop: 14
|
|
|
},
|
|
|
children: [/*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_22__.jsx)("span", {
|
|
|
className: "font16 ",
|
|
|
children: "\u89E3\u6790\uFF1A"
|
|
|
}), /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_22__.jsx)(_components_RenderHtml__WEBPACK_IMPORTED_MODULE_10__/* ["default"] */ .Z, {
|
|
|
className: _index_less_modules__WEBPACK_IMPORTED_MODULE_9__/* ["default"].renderHtml */ .Z.renderHtml,
|
|
|
value: (item === null || item === void 0 ? void 0 : item.analysis) || '暂无解析'
|
|
|
})]
|
|
|
})]
|
|
|
}), userScoreVisible && !Number.isNaN(parseFloat(item === null || item === void 0 ? void 0 : item.user_score)) && (item === null || item === void 0 ? void 0 : item.question_type) !== _utils_enum__WEBPACK_IMPORTED_MODULE_19__/* .QuestionType.Shixun */ .c.Shixun && /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_22__.jsxs)("span", {
|
|
|
children: [/*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_22__.jsx)("span", {
|
|
|
style: {
|
|
|
color: '#0152d9'
|
|
|
},
|
|
|
children: "\u5B66\u751F\u5F97\u5206\uFF1A"
|
|
|
}), item === null || item === void 0 ? void 0 : item.user_score, "\u5206"]
|
|
|
}), (item === null || item === void 0 ? void 0 : item.answer_comments) && userCommentVisible && /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_22__.jsx)(_pages_Classrooms_Lists_Exercise_Review_component_AnswerComments__WEBPACK_IMPORTED_MODULE_20__/* ["default"] */ .Z, {
|
|
|
newuserCommentVisible: newuserCommentVisible,
|
|
|
list: item === null || item === void 0 ? void 0 : item.answer_comments
|
|
|
}), /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_22__.jsx)(antd__WEBPACK_IMPORTED_MODULE_29__/* ["default"] */ .Z, {
|
|
|
style: isExportBlank.current ? {
|
|
|
marginTop: 30
|
|
|
} : {}
|
|
|
})]
|
|
|
});
|
|
|
};
|
|
|
|
|
|
//转换中文
|
|
|
var toChinesNum = function toChinesNum(num) {
|
|
|
var changeNum = ['零', '一', '二', '三', '四', '五', '六', '七', '八', '九']; //changeNum[0] = "零"
|
|
|
var unit = ["", "十", "百", "千", "万"];
|
|
|
num = parseInt(num);
|
|
|
var getWan = function getWan(temp) {
|
|
|
var strArr = temp.toString().split("").reverse();
|
|
|
var newNum = "";
|
|
|
for (var i = 0; i < strArr.length; i++) {
|
|
|
newNum = (i == 0 && strArr[i] == 0 ? "" : i > 0 && strArr[i] == 0 && strArr[i - 1] == 0 ? "" : changeNum[strArr[i]] + (strArr[i] == 0 ? unit[0] : unit[i])) + newNum;
|
|
|
}
|
|
|
return newNum;
|
|
|
};
|
|
|
var overWan = Math.floor(num / 10000);
|
|
|
var noWan = num % 10000;
|
|
|
if (noWan.toString().length < 4) noWan = "0" + noWan;
|
|
|
return overWan ? getWan(overWan) + "万" + getWan(noWan) : getWan(num);
|
|
|
};
|
|
|
var renderDom = function renderDom(er, key, index) {
|
|
|
if (er.category) {
|
|
|
return /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_22__.jsxs)("div", {
|
|
|
children: [/*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_22__.jsxs)("div", {
|
|
|
children: [/*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_22__.jsxs)("span", {
|
|
|
className: "font16 c-light-primary",
|
|
|
children: [toChinesNum(er === null || er === void 0 ? void 0 : er.category), "\u3001", er.name]
|
|
|
}), /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_22__.jsxs)("span", {
|
|
|
className: "c-grey-999",
|
|
|
children: ["\uFF08\u5171", er.count, "\u9898\uFF0C", (er === null || er === void 0 ? void 0 : er.question_type) === 7 ? "\u5305\u542B".concat(er === null || er === void 0 ? void 0 : er.sub_count, "\u5C0F\u9898\uFF1B") : '', "\u5171", er.score, "\u5206\uFF09"]
|
|
|
})]
|
|
|
}), renderQuestion(er.questionDetail, key)]
|
|
|
});
|
|
|
} else {
|
|
|
return renderQuestion(er.questionDetail, key);
|
|
|
}
|
|
|
};
|
|
|
var renderClassifyQuestion = (0,react__WEBPACK_IMPORTED_MODULE_6__.useCallback)(function () {
|
|
|
var _exercise$exerciseExp5, _exercise$exerciseExp6, _Array, _Array$fill, _Array$fill$map, _exportData$exercise_;
|
|
|
var step = (exercise === null || exercise === void 0 ? void 0 : (_exercise$exerciseExp5 = exercise.exerciseExportHeadData) === null || _exercise$exerciseExp5 === void 0 ? void 0 : (_exercise$exerciseExp6 = _exercise$exerciseExp5.exercise_header) === null || _exercise$exerciseExp6 === void 0 ? void 0 : _exercise$exerciseExp6.export_page_num) || 40;
|
|
|
var newData = [];
|
|
|
var questionIndex = 1; //小题题号
|
|
|
var _iterator = _root_workspace_ppte5yg23_local_v9_node_modules_babel_runtime_helpers_createForOfIteratorHelper_js__WEBPACK_IMPORTED_MODULE_0___default()((exportData === null || exportData === void 0 ? void 0 : (_exportData$exercise_ = exportData.exercise_question_types) === null || _exportData$exercise_ === void 0 ? void 0 : _exportData$exercise_.entries()) || []),
|
|
|
_step;
|
|
|
try {
|
|
|
var _loop3 = function _loop3() {
|
|
|
var _step$value = _root_workspace_ppte5yg23_local_v9_node_modules_babel_runtime_helpers_slicedToArray_js__WEBPACK_IMPORTED_MODULE_4___default()(_step.value, 2),
|
|
|
categoryIndex = _step$value[0],
|
|
|
questionItem = _step$value[1];
|
|
|
questionItem.items.forEach(function (question, index) {
|
|
|
if (index === 0) {
|
|
|
newData.push(_root_workspace_ppte5yg23_local_v9_node_modules_babel_runtime_helpers_objectSpread2_js__WEBPACK_IMPORTED_MODULE_2___default()(_root_workspace_ppte5yg23_local_v9_node_modules_babel_runtime_helpers_objectSpread2_js__WEBPACK_IMPORTED_MODULE_2___default()({}, questionItem), {}, {
|
|
|
items: null,
|
|
|
category: categoryIndex + 1,
|
|
|
questionDetail: question,
|
|
|
questionIndex: questionIndex
|
|
|
}));
|
|
|
} else {
|
|
|
newData.push({
|
|
|
questionDetail: question,
|
|
|
questionIndex: questionIndex
|
|
|
});
|
|
|
}
|
|
|
questionIndex++;
|
|
|
});
|
|
|
};
|
|
|
for (_iterator.s(); !(_step = _iterator.n()).done;) {
|
|
|
_loop3();
|
|
|
}
|
|
|
} catch (err) {
|
|
|
_iterator.e(err);
|
|
|
} finally {
|
|
|
_iterator.f();
|
|
|
}
|
|
|
if (newData !== null && newData !== void 0 && newData.length) return (_Array = new Array(Math.ceil((newData === null || newData === void 0 ? void 0 : newData.length) / step))) === null || _Array === void 0 ? void 0 : (_Array$fill = _Array.fill([])) === null || _Array$fill === void 0 ? void 0 : (_Array$fill$map = _Array$fill.map(function (item, key) {
|
|
|
return newData.slice(key * step, key * step + step);
|
|
|
})) === null || _Array$fill$map === void 0 ? void 0 : _Array$fill$map.map(function (i, k) {
|
|
|
return /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_22__.jsxs)("div", {
|
|
|
className: "pl60 pr30",
|
|
|
style: {
|
|
|
minHeight: k === 0 ? 1000 : "auto"
|
|
|
},
|
|
|
children: [k === 0 && /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_22__.jsxs)(react_jsx_runtime__WEBPACK_IMPORTED_MODULE_22__.Fragment, {
|
|
|
children: [/*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_22__.jsx)(_components_Head__WEBPACK_IMPORTED_MODULE_15__/* ["default"] */ .Z, {
|
|
|
isExportBlank: isExportBlank.current
|
|
|
}), /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_22__.jsx)(antd__WEBPACK_IMPORTED_MODULE_29__/* ["default"] */ .Z, {
|
|
|
className: _index_less_modules__WEBPACK_IMPORTED_MODULE_9__/* ["default"].divider */ .Z.divider
|
|
|
})]
|
|
|
}), i === null || i === void 0 ? void 0 : i.map(function (item, index) {
|
|
|
return renderDom(item, item.questionIndex, index);
|
|
|
})]
|
|
|
}, k);
|
|
|
});
|
|
|
return null;
|
|
|
}, [exportData, exercise, autoHeight]);
|
|
|
var _useState23 = (0,react__WEBPACK_IMPORTED_MODULE_6__.useState)({
|
|
|
num: 1
|
|
|
}),
|
|
|
_useState24 = _root_workspace_ppte5yg23_local_v9_node_modules_babel_runtime_helpers_slicedToArray_js__WEBPACK_IMPORTED_MODULE_4___default()(_useState23, 2),
|
|
|
paginationParams = _useState24[0],
|
|
|
setPaginationParams = _useState24[1];
|
|
|
return /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_22__.jsxs)("section", {
|
|
|
className: "edu-container",
|
|
|
children: [/*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_22__.jsxs)("section", {
|
|
|
className: "animated fadeIn",
|
|
|
children: [/*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_22__.jsx)("aside", {
|
|
|
className: "mt10",
|
|
|
children: userInfo && /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_22__.jsxs)(antd__WEBPACK_IMPORTED_MODULE_30__/* ["default"] */ .Z, {
|
|
|
separator: ">",
|
|
|
children: [/*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_22__.jsx)(antd__WEBPACK_IMPORTED_MODULE_30__/* ["default"].Item */ .Z.Item, {
|
|
|
children: /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_22__.jsx)(umi__WEBPACK_IMPORTED_MODULE_7__.Link, {
|
|
|
to: "/classrooms/".concat(params.coursesId, "/exercise"),
|
|
|
children: userInfo === null || userInfo === void 0 ? void 0 : (_userInfo$course = userInfo.course) === null || _userInfo$course === void 0 ? void 0 : _userInfo$course.course_name
|
|
|
})
|
|
|
}), /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_22__.jsx)(antd__WEBPACK_IMPORTED_MODULE_30__/* ["default"].Item */ .Z.Item, {
|
|
|
children: /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_22__.jsx)(umi__WEBPACK_IMPORTED_MODULE_7__.Link, {
|
|
|
to: "/classrooms/".concat(params.coursesId, "/exercise"),
|
|
|
children: "\u8BD5\u5377\u5217\u8868"
|
|
|
})
|
|
|
}), /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_22__.jsx)(antd__WEBPACK_IMPORTED_MODULE_30__/* ["default"].Item */ .Z.Item, {
|
|
|
children: /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_22__.jsx)(umi__WEBPACK_IMPORTED_MODULE_7__.Link, {
|
|
|
to: "/classrooms/".concat(params.coursesId, "/exercise/").concat(exportData === null || exportData === void 0 ? void 0 : (_exportData$exercise3 = exportData.exercise) === null || _exportData$exercise3 === void 0 ? void 0 : _exportData$exercise3.id, "/detail"),
|
|
|
children: "\u8BD5\u5377\u8BE6\u60C5"
|
|
|
})
|
|
|
}), /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_22__.jsx)(antd__WEBPACK_IMPORTED_MODULE_30__/* ["default"].Item */ .Z.Item, {
|
|
|
children: (exportData === null || exportData === void 0 ? void 0 : (_exportData$exercise_2 = exportData.exercise_answer_user) === null || _exportData$exercise_2 === void 0 ? void 0 : _exportData$exercise_2.user_name) || (exportData === null || exportData === void 0 ? void 0 : (_exportData$exercise4 = exportData.exercise) === null || _exportData$exercise4 === void 0 ? void 0 : _exportData$exercise4.exercise_name)
|
|
|
})]
|
|
|
})
|
|
|
}), /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_22__.jsx)("aside", {
|
|
|
className: [_index_less_modules__WEBPACK_IMPORTED_MODULE_9__/* ["default"].title */ .Z.title, 'mt20'].join(' '),
|
|
|
children: /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_22__.jsxs)(antd__WEBPACK_IMPORTED_MODULE_25__/* ["default"] */ .Z, {
|
|
|
style: {
|
|
|
width: "100%"
|
|
|
},
|
|
|
children: [/*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_22__.jsxs)(antd__WEBPACK_IMPORTED_MODULE_26__/* ["default"] */ .Z, {
|
|
|
flex: "1",
|
|
|
style: {
|
|
|
lineHeight: '24px'
|
|
|
},
|
|
|
children: [/*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_22__.jsx)(umi__WEBPACK_IMPORTED_MODULE_7__.Link, {
|
|
|
to: "/classrooms/".concat(params.coursesId, "/exercise/").concat(exportData === null || exportData === void 0 ? void 0 : (_exportData$exercise5 = exportData.exercise) === null || _exportData$exercise5 === void 0 ? void 0 : _exportData$exercise5.id, "/detail"),
|
|
|
children: /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_22__.jsx)(_ant_design_icons__WEBPACK_IMPORTED_MODULE_31__/* ["default"] */ .Z, {
|
|
|
className: "font16 c-black"
|
|
|
})
|
|
|
}), (0,_utils_util__WEBPACK_IMPORTED_MODULE_11__/* .exerciseTips */ .vB)((_exportData$exercise6 = exportData.exercise) === null || _exportData$exercise6 === void 0 ? void 0 : _exportData$exercise6.exercise_status), /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_22__.jsx)("strong", {
|
|
|
className: "font20 ml5",
|
|
|
children: exportData === null || exportData === void 0 ? void 0 : (_exportData$exercise7 = exportData.exercise) === null || _exportData$exercise7 === void 0 ? void 0 : _exportData$exercise7.exercise_name
|
|
|
})]
|
|
|
}), /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_22__.jsx)(antd__WEBPACK_IMPORTED_MODULE_26__/* ["default"] */ .Z, {
|
|
|
children: /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_22__.jsx)(antd__WEBPACK_IMPORTED_MODULE_32__/* ["default"] */ .Z, {
|
|
|
menu: {
|
|
|
items: [{
|
|
|
label: /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_22__.jsxs)(antd__WEBPACK_IMPORTED_MODULE_33__/* ["default"] */ .ZP, {
|
|
|
type: "text",
|
|
|
onClick: function onClick() {
|
|
|
setisshowanswer(true);
|
|
|
setTimeout(function () {
|
|
|
exportReport("");
|
|
|
}, 500);
|
|
|
},
|
|
|
children: [/*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_22__.jsx)(_ant_design_icons__WEBPACK_IMPORTED_MODULE_34__/* ["default"] */ .Z, {}), "\u5BFC\u51FA\u7A7A\u767D\u8BD5\u5377+\u7B54\u6848"]
|
|
|
}),
|
|
|
key: '1',
|
|
|
show: true
|
|
|
}, {
|
|
|
label: /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_22__.jsxs)(antd__WEBPACK_IMPORTED_MODULE_33__/* ["default"] */ .ZP, {
|
|
|
type: "text",
|
|
|
onClick: function onClick() {
|
|
|
return exportReport("");
|
|
|
},
|
|
|
children: [/*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_22__.jsx)(_ant_design_icons__WEBPACK_IMPORTED_MODULE_34__/* ["default"] */ .Z, {}), "\u5BFC\u51FA\u7A7A\u767D\u8BD5\u5377"]
|
|
|
}),
|
|
|
key: '2',
|
|
|
show: true
|
|
|
}, {
|
|
|
label: /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_22__.jsxs)(antd__WEBPACK_IMPORTED_MODULE_33__/* ["default"] */ .ZP, {
|
|
|
type: "text",
|
|
|
onClick: function onClick() {
|
|
|
setismodal(true);
|
|
|
},
|
|
|
children: [/*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_22__.jsx)(_ant_design_icons__WEBPACK_IMPORTED_MODULE_34__/* ["default"] */ .Z, {}), "\u5BFC\u51FA\u6240\u6709\u5B66\u751F\u8BD5\u5377"]
|
|
|
}),
|
|
|
key: '3',
|
|
|
show: (0,_utils_authority__WEBPACK_IMPORTED_MODULE_18__/* .isAdmin */ .GJ)()
|
|
|
}].filter(function (item) {
|
|
|
return item.show;
|
|
|
}).map(function (item) {
|
|
|
return {
|
|
|
label: item.label,
|
|
|
key: item.key
|
|
|
};
|
|
|
})
|
|
|
},
|
|
|
children: /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_22__.jsxs)(antd__WEBPACK_IMPORTED_MODULE_33__/* ["default"] */ .ZP, {
|
|
|
className: _index_less_modules__WEBPACK_IMPORTED_MODULE_9__/* ["default"].exportBtn */ .Z.exportBtn,
|
|
|
children: [/*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_22__.jsx)(_ant_design_icons__WEBPACK_IMPORTED_MODULE_35__/* ["default"] */ .Z, {}), "\u5BFC\u51FA", /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_22__.jsx)(_ant_design_icons__WEBPACK_IMPORTED_MODULE_36__/* ["default"] */ .Z, {})]
|
|
|
})
|
|
|
})
|
|
|
}), /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_22__.jsx)(antd__WEBPACK_IMPORTED_MODULE_26__/* ["default"] */ .Z, {
|
|
|
className: "ml20",
|
|
|
children: /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_22__.jsx)(antd__WEBPACK_IMPORTED_MODULE_33__/* ["default"] */ .ZP, {
|
|
|
icon: /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_22__.jsx)(_ant_design_icons__WEBPACK_IMPORTED_MODULE_37__/* ["default"] */ .Z, {}),
|
|
|
className: _index_less_modules__WEBPACK_IMPORTED_MODULE_9__/* ["default"].exportBtn */ .Z.exportBtn,
|
|
|
onClick: function onClick() {
|
|
|
dispatch({
|
|
|
type: 'exercise/setActionTabs',
|
|
|
payload: {
|
|
|
key: 'exportSetting'
|
|
|
}
|
|
|
});
|
|
|
},
|
|
|
children: "\u5BFC\u51FA\u8BBE\u7F6E"
|
|
|
})
|
|
|
}), /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_22__.jsx)(antd__WEBPACK_IMPORTED_MODULE_26__/* ["default"] */ .Z, {})]
|
|
|
})
|
|
|
})]
|
|
|
}), /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_22__.jsxs)(antd__WEBPACK_IMPORTED_MODULE_24__/* ["default"] */ .Z, {
|
|
|
title: '导出试卷选择'
|
|
|
// okText='是'
|
|
|
,
|
|
|
open: ismodal
|
|
|
// cancelText="否"
|
|
|
,
|
|
|
footer: /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_22__.jsxs)("div", {
|
|
|
children: [/*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_22__.jsx)(antd__WEBPACK_IMPORTED_MODULE_33__/* ["default"] */ .ZP, {
|
|
|
type: "primary",
|
|
|
onClick: function onClick() {
|
|
|
setUserCommentVisible(true);
|
|
|
setUserScoreVisible(true);
|
|
|
setismodal(false);
|
|
|
exportReport("all");
|
|
|
},
|
|
|
children: "\u662F"
|
|
|
}), /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_22__.jsx)(antd__WEBPACK_IMPORTED_MODULE_33__/* ["default"] */ .ZP, {
|
|
|
onClick: function onClick() {
|
|
|
setUserScoreVisible(true);
|
|
|
setismodal(false);
|
|
|
exportReport("all");
|
|
|
},
|
|
|
children: "\u5426"
|
|
|
})]
|
|
|
}),
|
|
|
onCancel: function onCancel() {
|
|
|
return setismodal(false);
|
|
|
},
|
|
|
children: ["\u662F\u5426\u8FDE\u540C\u8BC4\u9605\u6559\u5E08\u3001\u6559\u5E08\u8BC4\u8BED\u4E00\u8D77\u5BFC\u51FA\uFF1F", /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_22__.jsx)("p", {
|
|
|
style: {
|
|
|
display: 'flex',
|
|
|
alignItems: "center"
|
|
|
},
|
|
|
children: /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_22__.jsx)(antd__WEBPACK_IMPORTED_MODULE_28__/* ["default"] */ .Z, {
|
|
|
style: {
|
|
|
fontSize: 14
|
|
|
},
|
|
|
onChange: function onChange(e) {
|
|
|
setnewUserCommentVisible(e.target.checked);
|
|
|
},
|
|
|
children: "\u53EA\u5BFC\u51FA\u6700\u65B0\u7684\u8BC4\u9605\u8BB0\u5F55"
|
|
|
})
|
|
|
})]
|
|
|
}), /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_22__.jsxs)("div", {
|
|
|
className: "".concat(_index_less_modules__WEBPACK_IMPORTED_MODULE_9__/* ["default"].bg */ .Z.bg, " pt30 mt20"),
|
|
|
children: [(exportData === null || exportData === void 0 ? void 0 : (_exportData$exercise8 = exportData.exercise) === null || _exportData$exercise8 === void 0 ? void 0 : _exportData$exercise8.is_random) && /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_22__.jsx)(antd__WEBPACK_IMPORTED_MODULE_38__/* ["default"] */ .Z, {
|
|
|
className: "".concat(_index_less_modules__WEBPACK_IMPORTED_MODULE_9__/* ["default"].paginationWrapper */ .Z.paginationWrapper),
|
|
|
showTotal: function showTotal(total) {
|
|
|
return /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_22__.jsxs)("span", {
|
|
|
className: _index_less_modules__WEBPACK_IMPORTED_MODULE_9__/* ["default"].totalText */ .Z.totalText,
|
|
|
style: {
|
|
|
marginLeft: 20
|
|
|
},
|
|
|
children: ["\u5171\u8BA1", /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_22__.jsx)("span", {
|
|
|
className: _index_less_modules__WEBPACK_IMPORTED_MODULE_9__/* ["default"].num */ .Z.num,
|
|
|
children: total
|
|
|
}), "\u4EFD\u8BD5\u5377"]
|
|
|
});
|
|
|
},
|
|
|
total: exportData === null || exportData === void 0 ? void 0 : exportData.exercise_count,
|
|
|
pageSize: 1,
|
|
|
current: paginationParams.num,
|
|
|
showSizeChanger: false,
|
|
|
onChange: /*#__PURE__*/function () {
|
|
|
var _ref7 = _root_workspace_ppte5yg23_local_v9_node_modules_babel_runtime_helpers_asyncToGenerator_js__WEBPACK_IMPORTED_MODULE_3___default()( /*#__PURE__*/_root_workspace_ppte5yg23_local_v9_node_modules_babel_runtime_helpers_regeneratorRuntime_js__WEBPACK_IMPORTED_MODULE_1___default()().mark(function _callee7(page) {
|
|
|
var res;
|
|
|
return _root_workspace_ppte5yg23_local_v9_node_modules_babel_runtime_helpers_regeneratorRuntime_js__WEBPACK_IMPORTED_MODULE_1___default()().wrap(function _callee7$(_context9) {
|
|
|
while (1) switch (_context9.prev = _context9.next) {
|
|
|
case 0:
|
|
|
setPaginationParams({
|
|
|
num: page
|
|
|
});
|
|
|
_context9.next = 3;
|
|
|
return dispatch({
|
|
|
type: 'exercise/editExercise',
|
|
|
payload: {
|
|
|
coursesId: params.coursesId,
|
|
|
categoryId: params.exerciseId,
|
|
|
num: page - 1
|
|
|
}
|
|
|
});
|
|
|
case 3:
|
|
|
res = _context9.sent;
|
|
|
setExportData(res);
|
|
|
case 5:
|
|
|
case "end":
|
|
|
return _context9.stop();
|
|
|
}
|
|
|
}, _callee7);
|
|
|
}));
|
|
|
return function (_x4) {
|
|
|
return _ref7.apply(this, arguments);
|
|
|
};
|
|
|
}(),
|
|
|
showQuickJumper: true,
|
|
|
hideOnSinglePage: false
|
|
|
}), /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_22__.jsx)("section", {
|
|
|
id: "export-all",
|
|
|
className: [_index_less_modules__WEBPACK_IMPORTED_MODULE_9__/* ["default"].bg */ .Z.bg, 'pt30', 'pb30', 'mt20', 'mb20', 'relative'].join(' '),
|
|
|
ref: exportElement,
|
|
|
children: renderClassifyQuestion()
|
|
|
})]
|
|
|
})]
|
|
|
});
|
|
|
};
|
|
|
/* harmony default export */ __webpack_exports__["default"] = ((0,umi__WEBPACK_IMPORTED_MODULE_7__.connect)(function (_ref8) {
|
|
|
var exercise = _ref8.exercise,
|
|
|
loading = _ref8.loading,
|
|
|
user = _ref8.user,
|
|
|
globalSetting = _ref8.globalSetting;
|
|
|
return {
|
|
|
exercise: exercise,
|
|
|
globalSetting: globalSetting,
|
|
|
user: user,
|
|
|
loading: loading.effects
|
|
|
};
|
|
|
})(Export));
|
|
|
|
|
|
/***/ }),
|
|
|
|
|
|
/***/ 37537:
|
|
|
/*!***************************************************************************************************!*\
|
|
|
!*** ./src/pages/Classrooms/Lists/Exercise/Review/component/AnswerComments/index.tsx + 1 modules ***!
|
|
|
\***************************************************************************************************/
|
|
|
/***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) {
|
|
|
|
|
|
"use strict";
|
|
|
|
|
|
// EXPORTS
|
|
|
__webpack_require__.d(__webpack_exports__, {
|
|
|
"Z": function() { return /* binding */ component_AnswerComments; }
|
|
|
});
|
|
|
|
|
|
// EXTERNAL MODULE: ./node_modules/react/index.js
|
|
|
var react = __webpack_require__(67294);
|
|
|
;// CONCATENATED MODULE: ./src/pages/Classrooms/Lists/Exercise/Review/component/AnswerComments/index.less?modules
|
|
|
// extracted by mini-css-extract-plugin
|
|
|
/* harmony default export */ var AnswerCommentsmodules = ({"flex_box_center":"flex_box_center___hzSR8","flex_space_between":"flex_space_between___Mscip","flex_box_vertical_center":"flex_box_vertical_center___Uckau","flex_box_center_end":"flex_box_center_end___Kw1tf","flex_box_column":"flex_box_column___udgQE","comments":"comments___He0El","line":"line___P3zVB"});
|
|
|
// EXTERNAL MODULE: ./node_modules/antd/es/row/index.js
|
|
|
var row = __webpack_require__(71230);
|
|
|
// EXTERNAL MODULE: ./src/utils/env.ts + 1 modules
|
|
|
var env = __webpack_require__(59758);
|
|
|
// EXTERNAL MODULE: ./node_modules/@umijs/plugins/node_modules/dayjs/dayjs.min.js
|
|
|
var dayjs_min = __webpack_require__(94699);
|
|
|
var dayjs_min_default = /*#__PURE__*/__webpack_require__.n(dayjs_min);
|
|
|
// EXTERNAL MODULE: ./node_modules/react/jsx-runtime.js
|
|
|
var jsx_runtime = __webpack_require__(85893);
|
|
|
;// CONCATENATED MODULE: ./src/pages/Classrooms/Lists/Exercise/Review/component/AnswerComments/index.tsx
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
var AnswerComments = function AnswerComments(_ref) {
|
|
|
var list = _ref.list,
|
|
|
_ref$hideScore = _ref.hideScore,
|
|
|
hideScore = _ref$hideScore === void 0 ? false : _ref$hideScore,
|
|
|
newuserCommentVisible = _ref.newuserCommentVisible;
|
|
|
console.log('xxxx', list);
|
|
|
return /*#__PURE__*/(0,jsx_runtime.jsx)("div", {
|
|
|
children: list === null || list === void 0 ? void 0 : list.map(function (v) {
|
|
|
var _v$user, _v$user2, _v$user3, _v$comments;
|
|
|
return /*#__PURE__*/(0,jsx_runtime.jsxs)("div", {
|
|
|
className: "mt20",
|
|
|
children: [/*#__PURE__*/(0,jsx_runtime.jsxs)(row/* default */.Z, {
|
|
|
align: "middle",
|
|
|
children: [/*#__PURE__*/(0,jsx_runtime.jsx)("img", {
|
|
|
src: env/* default.API_SERVER */.Z.API_SERVER + '/images/' + (v === null || v === void 0 ? void 0 : (_v$user2 = v.user) === null || _v$user2 === void 0 ? void 0 : _v$user2.image_url),
|
|
|
width: "40",
|
|
|
style: {
|
|
|
borderRadius: 40
|
|
|
}
|
|
|
}), /*#__PURE__*/(0,jsx_runtime.jsx)("span", {
|
|
|
className: "ml10 font16",
|
|
|
children: v === null || v === void 0 ? void 0 : (_v$user3 = v.user) === null || _v$user3 === void 0 ? void 0 : _v$user3.name
|
|
|
})]
|
|
|
}, v === null || v === void 0 ? void 0 : (_v$user = v.user) === null || _v$user === void 0 ? void 0 : _v$user.user_id), /*#__PURE__*/(0,jsx_runtime.jsx)("div", {
|
|
|
className: AnswerCommentsmodules.comments,
|
|
|
children: v === null || v === void 0 ? void 0 : (_v$comments = v.comments) === null || _v$comments === void 0 ? void 0 : _v$comments.map(function (e, i) {
|
|
|
if (newuserCommentVisible && e.question_type !== 5) {
|
|
|
if (i === 0) {
|
|
|
var _v$user4, _v$comments2;
|
|
|
return /*#__PURE__*/(0,jsx_runtime.jsxs)("div", {
|
|
|
children: [/*#__PURE__*/(0,jsx_runtime.jsxs)(row/* default */.Z, {
|
|
|
align: "middle",
|
|
|
justify: "space-between",
|
|
|
children: [!!e.shixun_chanllge_position && /*#__PURE__*/(0,jsx_runtime.jsxs)("div", {
|
|
|
style: {
|
|
|
flexShrink: 0,
|
|
|
marginRight: 10
|
|
|
},
|
|
|
children: ["\u7B2C", e.shixun_chanllge_position, "\u5173"]
|
|
|
}), !hideScore && /*#__PURE__*/(0,jsx_runtime.jsxs)("div", {
|
|
|
style: {
|
|
|
flex: 1
|
|
|
},
|
|
|
children: ["\u539F\u59CB\u5F97\u5206", e === null || e === void 0 ? void 0 : e.origin_score, "\u5206\uFF0C\u4FEE\u6B63\u4E3A", /*#__PURE__*/(0,jsx_runtime.jsx)("span", {
|
|
|
className: "c-light-primary",
|
|
|
children: e === null || e === void 0 ? void 0 : e.score
|
|
|
}), "\u5206"]
|
|
|
}), /*#__PURE__*/(0,jsx_runtime.jsx)("div", {
|
|
|
style: {
|
|
|
flexShrink: 0
|
|
|
},
|
|
|
children: dayjs_min_default()(e.updated_at).format('YYYY-MM-DD HH:mm')
|
|
|
})]
|
|
|
}), !!e.comment && /*#__PURE__*/(0,jsx_runtime.jsxs)("div", {
|
|
|
children: ["\u8BC4\u8BED\uFF1A", /*#__PURE__*/(0,jsx_runtime.jsx)("span", {
|
|
|
className: "c-light-primary",
|
|
|
children: e.comment
|
|
|
})]
|
|
|
}), (v === null || v === void 0 ? void 0 : (_v$comments2 = v.comments) === null || _v$comments2 === void 0 ? void 0 : _v$comments2.length) - 1 > i && /*#__PURE__*/(0,jsx_runtime.jsx)("div", {
|
|
|
className: AnswerCommentsmodules.line
|
|
|
})]
|
|
|
}, (v === null || v === void 0 ? void 0 : (_v$user4 = v.user) === null || _v$user4 === void 0 ? void 0 : _v$user4.user_id) + '-' + i);
|
|
|
}
|
|
|
} else {
|
|
|
var _v$user5, _e$comment, _v$comments3;
|
|
|
return /*#__PURE__*/(0,jsx_runtime.jsxs)("div", {
|
|
|
children: [/*#__PURE__*/(0,jsx_runtime.jsxs)(row/* default */.Z, {
|
|
|
align: "middle",
|
|
|
justify: "space-between",
|
|
|
children: [!!e.shixun_chanllge_position && /*#__PURE__*/(0,jsx_runtime.jsxs)("div", {
|
|
|
style: {
|
|
|
flexShrink: 0,
|
|
|
marginRight: 10
|
|
|
},
|
|
|
children: ["\u7B2C", e.shixun_chanllge_position, "\u5173"]
|
|
|
}), !hideScore && /*#__PURE__*/(0,jsx_runtime.jsxs)("div", {
|
|
|
style: {
|
|
|
flex: 1
|
|
|
},
|
|
|
children: ["\u539F\u59CB\u5F97\u5206", e === null || e === void 0 ? void 0 : e.origin_score, "\u5206\uFF0C\u4FEE\u6B63\u4E3A", /*#__PURE__*/(0,jsx_runtime.jsx)("span", {
|
|
|
className: "c-light-primary",
|
|
|
children: e === null || e === void 0 ? void 0 : e.score
|
|
|
}), "\u5206"]
|
|
|
}), /*#__PURE__*/(0,jsx_runtime.jsx)("div", {
|
|
|
style: {
|
|
|
flexShrink: 0
|
|
|
},
|
|
|
children: dayjs_min_default()(e.updated_at).format('YYYY-MM-DD HH:mm')
|
|
|
})]
|
|
|
}), !!e.comment && /*#__PURE__*/(0,jsx_runtime.jsxs)("div", {
|
|
|
className: "flex-wrp",
|
|
|
children: [/*#__PURE__*/(0,jsx_runtime.jsx)("span", {
|
|
|
children: "\u8BC4\u8BED\uFF1A"
|
|
|
}), /*#__PURE__*/(0,jsx_runtime.jsx)("span", {
|
|
|
className: "c-light-primary flex1",
|
|
|
dangerouslySetInnerHTML: {
|
|
|
__html: ((_e$comment = e.comment) === null || _e$comment === void 0 ? void 0 : _e$comment.replace(/\n/g, "<br/>")) || ""
|
|
|
}
|
|
|
})]
|
|
|
}), (v === null || v === void 0 ? void 0 : (_v$comments3 = v.comments) === null || _v$comments3 === void 0 ? void 0 : _v$comments3.length) - 1 > i && /*#__PURE__*/(0,jsx_runtime.jsx)("div", {
|
|
|
className: AnswerCommentsmodules.line
|
|
|
})]
|
|
|
}, (v === null || v === void 0 ? void 0 : (_v$user5 = v.user) === null || _v$user5 === void 0 ? void 0 : _v$user5.user_id) + '-' + i);
|
|
|
}
|
|
|
})
|
|
|
})]
|
|
|
});
|
|
|
})
|
|
|
});
|
|
|
};
|
|
|
/* harmony default export */ var component_AnswerComments = (AnswerComments);
|
|
|
|
|
|
/***/ }),
|
|
|
|
|
|
/***/ 19637:
|
|
|
/*!***********************************************************************!*\
|
|
|
!*** ./src/pages/Classrooms/Lists/Exercise/Review/component/Fill.tsx ***!
|
|
|
\***********************************************************************/
|
|
|
/***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) {
|
|
|
|
|
|
"use strict";
|
|
|
/* harmony import */ var _root_workspace_ppte5yg23_local_v9_node_modules_babel_runtime_helpers_objectSpread2_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./node_modules/@babel/runtime/helpers/objectSpread2.js */ 42122);
|
|
|
/* harmony import */ var _root_workspace_ppte5yg23_local_v9_node_modules_babel_runtime_helpers_objectSpread2_js__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_root_workspace_ppte5yg23_local_v9_node_modules_babel_runtime_helpers_objectSpread2_js__WEBPACK_IMPORTED_MODULE_0__);
|
|
|
/* harmony import */ var _root_workspace_ppte5yg23_local_v9_node_modules_babel_runtime_helpers_slicedToArray_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./node_modules/@babel/runtime/helpers/slicedToArray.js */ 27424);
|
|
|
/* harmony import */ var _root_workspace_ppte5yg23_local_v9_node_modules_babel_runtime_helpers_slicedToArray_js__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_root_workspace_ppte5yg23_local_v9_node_modules_babel_runtime_helpers_slicedToArray_js__WEBPACK_IMPORTED_MODULE_1__);
|
|
|
/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! react */ 67294);
|
|
|
/* harmony import */ var _components_RenderHtml__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! @/components/RenderHtml */ 12768);
|
|
|
/* harmony import */ var antd__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! antd */ 79531);
|
|
|
/* harmony import */ var _SeeAnswer__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./SeeAnswer */ 18707);
|
|
|
/* harmony import */ var _index_less_modules__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ./index.less?modules */ 1446);
|
|
|
/* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! react/jsx-runtime */ 85893);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
var TextArea = antd__WEBPACK_IMPORTED_MODULE_7__/* ["default"].TextArea */ .Z.TextArea;
|
|
|
var Fill = function Fill(_ref) {
|
|
|
var item = _ref.item,
|
|
|
answerData = _ref.answerData,
|
|
|
changeScoreData = _ref.changeScoreData,
|
|
|
textValue = _ref.textValue,
|
|
|
_ref$textOnChange = _ref.textOnChange,
|
|
|
textOnChange = _ref$textOnChange === void 0 ? function () {} : _ref$textOnChange,
|
|
|
_ref$seeAnswerVisible = _ref.seeAnswerVisible,
|
|
|
seeAnswerVisible = _ref$seeAnswerVisible === void 0 ? true : _ref$seeAnswerVisible;
|
|
|
var _useState = (0,react__WEBPACK_IMPORTED_MODULE_2__.useState)([]),
|
|
|
_useState2 = _root_workspace_ppte5yg23_local_v9_node_modules_babel_runtime_helpers_slicedToArray_js__WEBPACK_IMPORTED_MODULE_1___default()(_useState, 2),
|
|
|
userAnswer = _useState2[0],
|
|
|
setUserAnswer = _useState2[1];
|
|
|
var _useState3 = (0,react__WEBPACK_IMPORTED_MODULE_2__.useState)(false),
|
|
|
_useState4 = _root_workspace_ppte5yg23_local_v9_node_modules_babel_runtime_helpers_slicedToArray_js__WEBPACK_IMPORTED_MODULE_1___default()(_useState3, 2),
|
|
|
showEdit = _useState4[0],
|
|
|
setShowEdit = _useState4[1];
|
|
|
(0,react__WEBPACK_IMPORTED_MODULE_2__.useEffect)(function () {
|
|
|
if (changeScoreData !== null && changeScoreData !== void 0 && changeScoreData[item.q_position]) {
|
|
|
!showEdit && setShowEdit(true);
|
|
|
} else {
|
|
|
showEdit && setShowEdit(false);
|
|
|
}
|
|
|
}, [changeScoreData === null || changeScoreData === void 0 ? void 0 : changeScoreData[item === null || item === void 0 ? void 0 : item.q_position]]);
|
|
|
(0,react__WEBPACK_IMPORTED_MODULE_2__.useEffect)(function () {
|
|
|
console.log("item=====", item, answerData, changeScoreData, "#37AD83;");
|
|
|
var data = [];
|
|
|
var _loop = function _loop(i) {
|
|
|
var _item$user_answer;
|
|
|
var param = (item === null || item === void 0 ? void 0 : (_item$user_answer = item.user_answer) === null || _item$user_answer === void 0 ? void 0 : _item$user_answer.find(function (e) {
|
|
|
return e.choice_id === i + 1;
|
|
|
})) || {
|
|
|
choice_id: i + 1,
|
|
|
answer_text: ''
|
|
|
};
|
|
|
data.push(_root_workspace_ppte5yg23_local_v9_node_modules_babel_runtime_helpers_objectSpread2_js__WEBPACK_IMPORTED_MODULE_0___default()({}, param));
|
|
|
};
|
|
|
for (var i = 0; i < (item === null || item === void 0 ? void 0 : item.multi_count); i++) {
|
|
|
_loop(i);
|
|
|
}
|
|
|
setUserAnswer(data);
|
|
|
}, [item === null || item === void 0 ? void 0 : item.user_answer]);
|
|
|
return /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_6__.jsxs)("div", {
|
|
|
className: _index_less_modules__WEBPACK_IMPORTED_MODULE_5__/* ["default"].fillBg */ .Z.fillBg,
|
|
|
children: [/*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_6__.jsx)("aside", {
|
|
|
className: "font14 c-light-primary mb5",
|
|
|
children: "\u5B66\u751F\u7B54\u9898"
|
|
|
}), userAnswer === null || userAnswer === void 0 ? void 0 : userAnswer.map(function (answer, index) {
|
|
|
var _item$standard_answer, _item$standard_answer2, _item$standard_answer3;
|
|
|
return /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_6__.jsxs)("div", {
|
|
|
children: [/*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_6__.jsxs)("span", {
|
|
|
children: ["\u7B54\u6848(\u586B\u7A7A", index + 1, "):"]
|
|
|
}), /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_6__.jsx)("div", {
|
|
|
children: item.question_type == 3 ? /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_6__.jsx)("span", {
|
|
|
style: {
|
|
|
color: (item === null || item === void 0 ? void 0 : (_item$standard_answer = item.standard_answer) === null || _item$standard_answer === void 0 ? void 0 : (_item$standard_answer2 = _item$standard_answer[index]) === null || _item$standard_answer2 === void 0 ? void 0 : (_item$standard_answer3 = _item$standard_answer2.answer_text) === null || _item$standard_answer3 === void 0 ? void 0 : _item$standard_answer3[0]) == (answer === null || answer === void 0 ? void 0 : answer.answer_text) ? "#37AD83" : "#E30000"
|
|
|
},
|
|
|
children: answer === null || answer === void 0 ? void 0 : answer.answer_text
|
|
|
}) : /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_6__.jsx)(_components_RenderHtml__WEBPACK_IMPORTED_MODULE_3__/* ["default"] */ .Z, {
|
|
|
value: answer === null || answer === void 0 ? void 0 : answer.answer_text
|
|
|
})
|
|
|
})]
|
|
|
});
|
|
|
}), seeAnswerVisible && /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_6__.jsx)(_SeeAnswer__WEBPACK_IMPORTED_MODULE_4__/* .SeeAnswer */ .u, {
|
|
|
data: item
|
|
|
})]
|
|
|
});
|
|
|
};
|
|
|
/* harmony default export */ __webpack_exports__["Z"] = (Fill);
|
|
|
|
|
|
/***/ }),
|
|
|
|
|
|
/***/ 8788:
|
|
|
/*!**************************************************************************!*\
|
|
|
!*** ./src/pages/Classrooms/Lists/Exercise/Review/component/Program.tsx ***!
|
|
|
\**************************************************************************/
|
|
|
/***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) {
|
|
|
|
|
|
"use strict";
|
|
|
/* harmony import */ var _root_workspace_ppte5yg23_local_v9_node_modules_babel_runtime_helpers_slicedToArray_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./node_modules/@babel/runtime/helpers/slicedToArray.js */ 27424);
|
|
|
/* harmony import */ var _root_workspace_ppte5yg23_local_v9_node_modules_babel_runtime_helpers_slicedToArray_js__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_root_workspace_ppte5yg23_local_v9_node_modules_babel_runtime_helpers_slicedToArray_js__WEBPACK_IMPORTED_MODULE_0__);
|
|
|
/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! react */ 67294);
|
|
|
/* harmony import */ var _components_RenderHtml__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @/components/RenderHtml */ 12768);
|
|
|
/* harmony import */ var moment__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! moment */ 94699);
|
|
|
/* harmony import */ var moment__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__webpack_require__.n(moment__WEBPACK_IMPORTED_MODULE_3__);
|
|
|
/* harmony import */ var antd__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! antd */ 63889);
|
|
|
/* harmony import */ var _components_monaco_editor__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! @/components/monaco-editor */ 8691);
|
|
|
/* harmony import */ var js_base64__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! js-base64 */ 19575);
|
|
|
/* harmony import */ var js_base64__WEBPACK_IMPORTED_MODULE_5___default = /*#__PURE__*/__webpack_require__.n(js_base64__WEBPACK_IMPORTED_MODULE_5__);
|
|
|
/* harmony import */ var _index_less_modules__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ../index.less?modules */ 37729);
|
|
|
/* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! react/jsx-runtime */ 85893);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
var Program = function Program(_ref) {
|
|
|
var _answerData$exercise, _answerData$exercise2, _answerData$exercise3, _answerData$exercise4, _item$user_answer;
|
|
|
var item = _ref.item,
|
|
|
answerData = _ref.answerData,
|
|
|
autoHeight = _ref.autoHeight;
|
|
|
var _useState = (0,react__WEBPACK_IMPORTED_MODULE_1__.useState)([]),
|
|
|
_useState2 = _root_workspace_ppte5yg23_local_v9_node_modules_babel_runtime_helpers_slicedToArray_js__WEBPACK_IMPORTED_MODULE_0___default()(_useState, 2),
|
|
|
data = _useState2[0],
|
|
|
setData = _useState2[1];
|
|
|
(0,react__WEBPACK_IMPORTED_MODULE_1__.useEffect)(function () {
|
|
|
var _item$evaluate_codes;
|
|
|
if ((item === null || item === void 0 ? void 0 : (_item$evaluate_codes = item.evaluate_codes) === null || _item$evaluate_codes === void 0 ? void 0 : _item$evaluate_codes.length) > 0) {
|
|
|
var _item$evaluate_codes2;
|
|
|
setData(item === null || item === void 0 ? void 0 : (_item$evaluate_codes2 = item.evaluate_codes) === null || _item$evaluate_codes2 === void 0 ? void 0 : _item$evaluate_codes2.map(function (code, index) {
|
|
|
return {
|
|
|
key: index + 1,
|
|
|
error_msg: code !== null && code !== void 0 && code.error_msg ? js_base64__WEBPACK_IMPORTED_MODULE_5__.Base64.decode(code === null || code === void 0 ? void 0 : code.error_msg) : '',
|
|
|
created_at: code.created_at
|
|
|
};
|
|
|
}));
|
|
|
} else {
|
|
|
setData([{
|
|
|
key: "--",
|
|
|
error_msg: "--"
|
|
|
}]);
|
|
|
}
|
|
|
}, [item === null || item === void 0 ? void 0 : item.evaluate_codes]);
|
|
|
var columns = [{
|
|
|
title: '评测序号',
|
|
|
dataIndex: 'key',
|
|
|
width: "127px",
|
|
|
key: 'key',
|
|
|
align: 'center',
|
|
|
render: function render(text, record) {
|
|
|
return /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_7__.jsx)("span", {
|
|
|
children: record.key
|
|
|
});
|
|
|
}
|
|
|
}, {
|
|
|
title: '评测时间',
|
|
|
dataIndex: 'created_at',
|
|
|
key: 'created_at',
|
|
|
align: 'center',
|
|
|
width: 200,
|
|
|
render: function render(text, record) {
|
|
|
return /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_7__.jsx)("span", {
|
|
|
children: record.created_at ? moment__WEBPACK_IMPORTED_MODULE_3___default()(record.created_at).format('YYYY-MM-DD HH:mm') : "--"
|
|
|
});
|
|
|
}
|
|
|
}, {
|
|
|
title: '评测结果',
|
|
|
dataIndex: 'error_msg',
|
|
|
key: 'error_msg',
|
|
|
align: 'center',
|
|
|
render: function render(text, record) {
|
|
|
var _record$error_msg;
|
|
|
return /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_7__.jsx)("span", {
|
|
|
children: record.error_msg ? ((_record$error_msg = record.error_msg) === null || _record$error_msg === void 0 ? void 0 : _record$error_msg.length) > 1000 ? record.error_msg.substring(0, 1000) + "..." : record.error_msg : "--"
|
|
|
});
|
|
|
}
|
|
|
}];
|
|
|
var options = {
|
|
|
selectOnLineNumbers: true,
|
|
|
readOnly: true,
|
|
|
minimap: {
|
|
|
enabled: false
|
|
|
},
|
|
|
scrollBeyondLastLine: false
|
|
|
};
|
|
|
return /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_7__.jsxs)(react_jsx_runtime__WEBPACK_IMPORTED_MODULE_7__.Fragment, {
|
|
|
children: [/*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_7__.jsx)("div", {
|
|
|
className: "mt15 mb15",
|
|
|
children: /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_7__.jsx)(_components_RenderHtml__WEBPACK_IMPORTED_MODULE_2__/* ["default"] */ .Z, {
|
|
|
value: item === null || item === void 0 ? void 0 : item.description
|
|
|
})
|
|
|
}), (!!(answerData !== null && answerData !== void 0 && (_answerData$exercise = answerData.exercise) !== null && _answerData$exercise !== void 0 && _answerData$exercise.student_commit_status) && (answerData === null || answerData === void 0 ? void 0 : (_answerData$exercise2 = answerData.exercise) === null || _answerData$exercise2 === void 0 ? void 0 : _answerData$exercise2.student_commit_status) !== 0 || !!(answerData !== null && answerData !== void 0 && (_answerData$exercise3 = answerData.exercise) !== null && _answerData$exercise3 !== void 0 && _answerData$exercise3.user_exercise_status) && (answerData === null || answerData === void 0 ? void 0 : (_answerData$exercise4 = answerData.exercise) === null || _answerData$exercise4 === void 0 ? void 0 : _answerData$exercise4.user_exercise_status) !== 0) && /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_7__.jsx)(antd__WEBPACK_IMPORTED_MODULE_8__/* ["default"] */ .Z, {
|
|
|
className: "mt5",
|
|
|
bordered: true,
|
|
|
dataSource: data,
|
|
|
columns: columns,
|
|
|
pagination: false
|
|
|
}), !!(item !== null && item !== void 0 && (_item$user_answer = item.user_answer) !== null && _item$user_answer !== void 0 && _item$user_answer.length) && (item === null || item === void 0 ? void 0 : item.passed_code) && /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_7__.jsxs)("aside", {
|
|
|
className: _index_less_modules__WEBPACK_IMPORTED_MODULE_6__/* ["default"].shixunWrp */ .Z.shixunWrp,
|
|
|
children: [/*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_7__.jsx)("h3", {
|
|
|
children: "\u7B2C\u4E00\u6B21\u8BC4\u6D4B\u901A\u8FC7\u7684\u4EE3\u7801\uFF08\u672A\u901A\u5173\u5219\u4E3A\u6700\u540E\u4E00\u6B21\u63D0\u4EA4\u8BC4\u6D4B\u7684\u4EE3\u7801\uFF09"
|
|
|
}), /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_7__.jsx)(_components_monaco_editor__WEBPACK_IMPORTED_MODULE_4__/* ["default"] */ .ZP, {
|
|
|
style: {
|
|
|
border: '1px solid #ccc'
|
|
|
},
|
|
|
height: 300,
|
|
|
language: "python",
|
|
|
theme: "vs-light",
|
|
|
value: item !== null && item !== void 0 && item.passed_code ? js_base64__WEBPACK_IMPORTED_MODULE_5__.Base64.decode(item === null || item === void 0 ? void 0 : item.passed_code) : "",
|
|
|
autoHeight: autoHeight,
|
|
|
options: options
|
|
|
})]
|
|
|
})]
|
|
|
});
|
|
|
};
|
|
|
/* harmony default export */ __webpack_exports__["Z"] = (Program);
|
|
|
|
|
|
/***/ }),
|
|
|
|
|
|
/***/ 18707:
|
|
|
/*!****************************************************************************!*\
|
|
|
!*** ./src/pages/Classrooms/Lists/Exercise/Review/component/SeeAnswer.tsx ***!
|
|
|
\****************************************************************************/
|
|
|
/***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) {
|
|
|
|
|
|
"use strict";
|
|
|
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
|
|
|
/* harmony export */ "u": function() { return /* binding */ SeeAnswer; }
|
|
|
/* harmony export */ });
|
|
|
/* harmony import */ var _root_workspace_ppte5yg23_local_v9_node_modules_babel_runtime_helpers_slicedToArray_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./node_modules/@babel/runtime/helpers/slicedToArray.js */ 27424);
|
|
|
/* harmony import */ var _root_workspace_ppte5yg23_local_v9_node_modules_babel_runtime_helpers_slicedToArray_js__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_root_workspace_ppte5yg23_local_v9_node_modules_babel_runtime_helpers_slicedToArray_js__WEBPACK_IMPORTED_MODULE_0__);
|
|
|
/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! react */ 67294);
|
|
|
/* harmony import */ var antd__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! antd */ 71230);
|
|
|
/* harmony import */ var antd__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! antd */ 15746);
|
|
|
/* harmony import */ var _components_RenderHtml__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @/components/RenderHtml */ 12768);
|
|
|
/* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! react/jsx-runtime */ 85893);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
var SeeAnswer = function SeeAnswer(_ref) {
|
|
|
var data = _ref.data;
|
|
|
var _useState = (0,react__WEBPACK_IMPORTED_MODULE_1__.useState)(false),
|
|
|
_useState2 = _root_workspace_ppte5yg23_local_v9_node_modules_babel_runtime_helpers_slicedToArray_js__WEBPACK_IMPORTED_MODULE_0___default()(_useState, 2),
|
|
|
show = _useState2[0],
|
|
|
setShow = _useState2[1];
|
|
|
var renderDom = function renderDom() {
|
|
|
var _data$standard_answer, _data$standard_answer2, _data$standard_answer3;
|
|
|
switch (data.question_type) {
|
|
|
case 3:
|
|
|
return /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_3__.jsxs)("aside", {
|
|
|
className: "mt20",
|
|
|
children: [/*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_3__.jsx)("span", {
|
|
|
style: {
|
|
|
cursor: "pointer"
|
|
|
},
|
|
|
className: "font14 c-blue current",
|
|
|
onClick: function onClick() {
|
|
|
setShow(!show);
|
|
|
},
|
|
|
children: show ? "隐藏参考答案" : "查看参考答案"
|
|
|
}), show && /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_3__.jsx)("div", {
|
|
|
children: data === null || data === void 0 ? void 0 : (_data$standard_answer = data.standard_answer) === null || _data$standard_answer === void 0 ? void 0 : _data$standard_answer.map(function (item, key) {
|
|
|
var _item$answer_text;
|
|
|
return /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_3__.jsxs)(antd__WEBPACK_IMPORTED_MODULE_4__/* ["default"] */ .Z, {
|
|
|
style: {
|
|
|
alignItems: 'baseline'
|
|
|
},
|
|
|
className: "mr20",
|
|
|
children: [/*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_3__.jsx)(antd__WEBPACK_IMPORTED_MODULE_5__/* ["default"] */ .Z, {
|
|
|
flex: "50px",
|
|
|
children: /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_3__.jsxs)("span", {
|
|
|
className: "mt10",
|
|
|
children: ["\u586B\u7A7A", item.choice_id, ":"]
|
|
|
})
|
|
|
}), /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_3__.jsx)(antd__WEBPACK_IMPORTED_MODULE_5__/* ["default"] */ .Z, {
|
|
|
flex: 1,
|
|
|
children: item === null || item === void 0 ? void 0 : (_item$answer_text = item.answer_text) === null || _item$answer_text === void 0 ? void 0 : _item$answer_text.map(function (val, key) {
|
|
|
return /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_3__.jsx)("div", {
|
|
|
children: val
|
|
|
});
|
|
|
})
|
|
|
})]
|
|
|
});
|
|
|
})
|
|
|
})]
|
|
|
});
|
|
|
break;
|
|
|
case 8:
|
|
|
return /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_3__.jsxs)("aside", {
|
|
|
className: "mt20",
|
|
|
children: [/*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_3__.jsx)("span", {
|
|
|
style: {
|
|
|
cursor: "pointer"
|
|
|
},
|
|
|
className: "font14 c-blue current",
|
|
|
onClick: function onClick() {
|
|
|
setShow(!show);
|
|
|
},
|
|
|
children: show ? "隐藏参考答案" : "查看参考答案"
|
|
|
}), show && /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_3__.jsx)("div", {
|
|
|
children: data === null || data === void 0 ? void 0 : (_data$standard_answer2 = data.standard_answer) === null || _data$standard_answer2 === void 0 ? void 0 : _data$standard_answer2.map(function (item, key) {
|
|
|
return /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_3__.jsxs)(antd__WEBPACK_IMPORTED_MODULE_4__/* ["default"] */ .Z, {
|
|
|
style: {
|
|
|
alignItems: 'baseline'
|
|
|
},
|
|
|
className: "mr20",
|
|
|
children: [/*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_3__.jsx)(antd__WEBPACK_IMPORTED_MODULE_5__/* ["default"] */ .Z, {
|
|
|
flex: "50px",
|
|
|
children: /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_3__.jsxs)("span", {
|
|
|
className: "mt10",
|
|
|
children: ["\u586B\u7A7A", item.choice_id, ":"]
|
|
|
})
|
|
|
}), /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_3__.jsx)(antd__WEBPACK_IMPORTED_MODULE_5__/* ["default"] */ .Z, {
|
|
|
flex: 1,
|
|
|
children: /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_3__.jsx)("div", {
|
|
|
children: item === null || item === void 0 ? void 0 : item.answer_text
|
|
|
})
|
|
|
})]
|
|
|
});
|
|
|
})
|
|
|
})]
|
|
|
});
|
|
|
break;
|
|
|
case 4:
|
|
|
return /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_3__.jsxs)("aside", {
|
|
|
className: "mt20",
|
|
|
children: [/*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_3__.jsx)("span", {
|
|
|
style: {
|
|
|
cursor: "pointer"
|
|
|
},
|
|
|
className: "font14 c-blue current",
|
|
|
onClick: function onClick() {
|
|
|
setShow(!show);
|
|
|
},
|
|
|
children: show ? "隐藏参考答案" : "查看参考答案"
|
|
|
}), show && /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_3__.jsx)("div", {
|
|
|
children: /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_3__.jsx)(_components_RenderHtml__WEBPACK_IMPORTED_MODULE_2__/* ["default"] */ .Z, {
|
|
|
value: data === null || data === void 0 ? void 0 : (_data$standard_answer3 = data.standard_answer) === null || _data$standard_answer3 === void 0 ? void 0 : _data$standard_answer3.join(" ")
|
|
|
})
|
|
|
})]
|
|
|
});
|
|
|
break;
|
|
|
}
|
|
|
};
|
|
|
return /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_3__.jsx)("section", {
|
|
|
children: renderDom()
|
|
|
});
|
|
|
};
|
|
|
|
|
|
/***/ }),
|
|
|
|
|
|
/***/ 64198:
|
|
|
/*!*************************************************************************!*\
|
|
|
!*** ./src/pages/Classrooms/Lists/Exercise/Review/component/Shixun.tsx ***!
|
|
|
\*************************************************************************/
|
|
|
/***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) {
|
|
|
|
|
|
"use strict";
|
|
|
/* harmony import */ var _root_workspace_ppte5yg23_local_v9_node_modules_babel_runtime_helpers_regeneratorRuntime_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./node_modules/@babel/runtime/helpers/regeneratorRuntime.js */ 17061);
|
|
|
/* harmony import */ var _root_workspace_ppte5yg23_local_v9_node_modules_babel_runtime_helpers_regeneratorRuntime_js__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_root_workspace_ppte5yg23_local_v9_node_modules_babel_runtime_helpers_regeneratorRuntime_js__WEBPACK_IMPORTED_MODULE_0__);
|
|
|
/* harmony import */ var _root_workspace_ppte5yg23_local_v9_node_modules_babel_runtime_helpers_asyncToGenerator_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./node_modules/@babel/runtime/helpers/asyncToGenerator.js */ 17156);
|
|
|
/* harmony import */ var _root_workspace_ppte5yg23_local_v9_node_modules_babel_runtime_helpers_asyncToGenerator_js__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_root_workspace_ppte5yg23_local_v9_node_modules_babel_runtime_helpers_asyncToGenerator_js__WEBPACK_IMPORTED_MODULE_1__);
|
|
|
/* harmony import */ var _root_workspace_ppte5yg23_local_v9_node_modules_babel_runtime_helpers_objectSpread2_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./node_modules/@babel/runtime/helpers/objectSpread2.js */ 42122);
|
|
|
/* harmony import */ var _root_workspace_ppte5yg23_local_v9_node_modules_babel_runtime_helpers_objectSpread2_js__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(_root_workspace_ppte5yg23_local_v9_node_modules_babel_runtime_helpers_objectSpread2_js__WEBPACK_IMPORTED_MODULE_2__);
|
|
|
/* harmony import */ var _root_workspace_ppte5yg23_local_v9_node_modules_babel_runtime_helpers_slicedToArray_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./node_modules/@babel/runtime/helpers/slicedToArray.js */ 27424);
|
|
|
/* harmony import */ var _root_workspace_ppte5yg23_local_v9_node_modules_babel_runtime_helpers_slicedToArray_js__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__webpack_require__.n(_root_workspace_ppte5yg23_local_v9_node_modules_babel_runtime_helpers_slicedToArray_js__WEBPACK_IMPORTED_MODULE_3__);
|
|
|
/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! react */ 67294);
|
|
|
/* harmony import */ var _components_RenderHtml__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! @/components/RenderHtml */ 12768);
|
|
|
/* harmony import */ var _utils_authority__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! @/utils/authority */ 7);
|
|
|
/* harmony import */ var antd__WEBPACK_IMPORTED_MODULE_12__ = __webpack_require__(/*! antd */ 83062);
|
|
|
/* harmony import */ var antd__WEBPACK_IMPORTED_MODULE_13__ = __webpack_require__(/*! antd */ 31795);
|
|
|
/* harmony import */ var antd__WEBPACK_IMPORTED_MODULE_14__ = __webpack_require__(/*! antd */ 2453);
|
|
|
/* harmony import */ var antd__WEBPACK_IMPORTED_MODULE_15__ = __webpack_require__(/*! antd */ 63889);
|
|
|
/* harmony import */ var moment__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! moment */ 94699);
|
|
|
/* harmony import */ var moment__WEBPACK_IMPORTED_MODULE_7___default = /*#__PURE__*/__webpack_require__.n(moment__WEBPACK_IMPORTED_MODULE_7__);
|
|
|
/* harmony import */ var umi__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! umi */ 88275);
|
|
|
/* harmony import */ var _components_monaco_editor__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! @/components/monaco-editor */ 8691);
|
|
|
/* harmony import */ var _index_less_modules__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(/*! ./index.less?modules */ 1446);
|
|
|
/* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_11__ = __webpack_require__(/*! react/jsx-runtime */ 85893);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
var Shixun = function Shixun(_ref) {
|
|
|
var _answerData$exercise, _answerData$exercise2, _item$shixun;
|
|
|
var item = _ref.item,
|
|
|
answerData = _ref.answerData,
|
|
|
_ref$hasChangeScore = _ref.hasChangeScore,
|
|
|
hasChangeScore = _ref$hasChangeScore === void 0 ? true : _ref$hasChangeScore,
|
|
|
autoHeight = _ref.autoHeight,
|
|
|
_ref$saveChangeScore = _ref.saveChangeScore,
|
|
|
saveChangeScore = _ref$saveChangeScore === void 0 ? function () {} : _ref$saveChangeScore;
|
|
|
var _useState = (0,react__WEBPACK_IMPORTED_MODULE_4__.useState)([]),
|
|
|
_useState2 = _root_workspace_ppte5yg23_local_v9_node_modules_babel_runtime_helpers_slicedToArray_js__WEBPACK_IMPORTED_MODULE_3___default()(_useState, 2),
|
|
|
data = _useState2[0],
|
|
|
setData = _useState2[1];
|
|
|
var _useState3 = (0,react__WEBPACK_IMPORTED_MODULE_4__.useState)([]),
|
|
|
_useState4 = _root_workspace_ppte5yg23_local_v9_node_modules_babel_runtime_helpers_slicedToArray_js__WEBPACK_IMPORTED_MODULE_3___default()(_useState3, 2),
|
|
|
challengeData = _useState4[0],
|
|
|
setChallengeData = _useState4[1];
|
|
|
(0,react__WEBPACK_IMPORTED_MODULE_4__.useEffect)(function () {
|
|
|
var _item$shixun_details;
|
|
|
if (!(item !== null && item !== void 0 && (_item$shixun_details = item.shixun_details) !== null && _item$shixun_details !== void 0 && _item$shixun_details.length)) {
|
|
|
return;
|
|
|
}
|
|
|
var shixun = [];
|
|
|
var challenge = [];
|
|
|
for (var i = 0; i < (item === null || item === void 0 ? void 0 : (_item$shixun_details2 = item.shixun_details) === null || _item$shixun_details2 === void 0 ? void 0 : _item$shixun_details2.length); i++) {
|
|
|
var _item$shixun_details2, _item$shixun_details7, _item$shixun_details8;
|
|
|
for (var j = 0; j < (item === null || item === void 0 ? void 0 : item.shixun_details[i].stage_list.length); j++) {
|
|
|
var _item$shixun_details3, _item$shixun_details4, _item$shixun_details5, _item$shixun_details6, _item$shixun_details$;
|
|
|
var shixunItem = item === null || item === void 0 ? void 0 : item.shixun_details[i].stage_list[j];
|
|
|
shixun.push(_root_workspace_ppte5yg23_local_v9_node_modules_babel_runtime_helpers_objectSpread2_js__WEBPACK_IMPORTED_MODULE_2___default()(_root_workspace_ppte5yg23_local_v9_node_modules_babel_runtime_helpers_objectSpread2_js__WEBPACK_IMPORTED_MODULE_2___default()({}, shixunItem), {
|
|
|
operation: item === null || item === void 0 ? void 0 : (_item$shixun_details3 = item.shixun_details) === null || _item$shixun_details3 === void 0 ? void 0 : (_item$shixun_details4 = _item$shixun_details3[i]) === null || _item$shixun_details4 === void 0 ? void 0 : (_item$shixun_details5 = _item$shixun_details4.shixun_detail) === null || _item$shixun_details5 === void 0 ? void 0 : (_item$shixun_details6 = _item$shixun_details5[0]) === null || _item$shixun_details6 === void 0 ? void 0 : _item$shixun_details6.game_identifier,
|
|
|
shixun_challenge_id: item === null || item === void 0 ? void 0 : (_item$shixun_details$ = item.shixun_details[i]) === null || _item$shixun_details$ === void 0 ? void 0 : _item$shixun_details$.shixun_challenge_id
|
|
|
}));
|
|
|
}
|
|
|
if (item !== null && item !== void 0 && (_item$shixun_details7 = item.shixun_details) !== null && _item$shixun_details7 !== void 0 && (_item$shixun_details8 = _item$shixun_details7[i]) !== null && _item$shixun_details8 !== void 0 && _item$shixun_details8.shixun_detail) {
|
|
|
var _item$shixun_details9, _item$shixun_details10, _item$shixun_details11;
|
|
|
challenge.push(item === null || item === void 0 ? void 0 : (_item$shixun_details9 = item.shixun_details) === null || _item$shixun_details9 === void 0 ? void 0 : (_item$shixun_details10 = _item$shixun_details9[i]) === null || _item$shixun_details10 === void 0 ? void 0 : (_item$shixun_details11 = _item$shixun_details10.shixun_detail) === null || _item$shixun_details11 === void 0 ? void 0 : _item$shixun_details11[0]);
|
|
|
}
|
|
|
}
|
|
|
setChallengeData(challenge);
|
|
|
setData([].concat(shixun));
|
|
|
}, [item === null || item === void 0 ? void 0 : item.shixun_details]);
|
|
|
var columns = [{
|
|
|
title: "关卡",
|
|
|
dataIndex: "position",
|
|
|
key: "position",
|
|
|
align: 'center'
|
|
|
}, {
|
|
|
title: "任务名称",
|
|
|
dataIndex: "name",
|
|
|
key: "name",
|
|
|
align: 'center',
|
|
|
ellipsis: true,
|
|
|
width: 260,
|
|
|
render: function render(name) {
|
|
|
return /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_11__.jsx)(antd__WEBPACK_IMPORTED_MODULE_12__/* ["default"] */ .Z, {
|
|
|
title: name,
|
|
|
children: /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_11__.jsx)("span", {
|
|
|
className: "overflowHidden1",
|
|
|
style: {
|
|
|
maxWidth: "400px"
|
|
|
},
|
|
|
title: name && name.length > 25 ? name : "",
|
|
|
children: name
|
|
|
})
|
|
|
});
|
|
|
}
|
|
|
}, {
|
|
|
title: "评测次数",
|
|
|
dataIndex: "evaluate_count",
|
|
|
key: "evaluate_count",
|
|
|
align: 'center',
|
|
|
render: function render(testCount, item) {
|
|
|
return /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_11__.jsx)("span", {
|
|
|
children: item.evaluate_count ? item.evaluate_count : /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_11__.jsx)("span", {
|
|
|
className: "color-grey-9",
|
|
|
children: "--"
|
|
|
})
|
|
|
});
|
|
|
}
|
|
|
}, {
|
|
|
title: "完成时间",
|
|
|
key: "finished_time",
|
|
|
dataIndex: "finished_time",
|
|
|
align: 'center',
|
|
|
render: function render(endTime, item) {
|
|
|
var timeOver = false;
|
|
|
if (item.finished_time && answerData !== null && answerData !== void 0 && answerData.exercise && answerData !== null && answerData !== void 0 && answerData.exercise_answer_user) {
|
|
|
// issue#29511 exercise.time -1没有设置答题的时间限制,则比较完成时间和试卷截至时间
|
|
|
if ((answerData === null || answerData === void 0 ? void 0 : answerData.exercise.time) === -1) {
|
|
|
timeOver = moment__WEBPACK_IMPORTED_MODULE_7___default()(answerData === null || answerData === void 0 ? void 0 : answerData.exercise.end_time).isBefore(item.finished_time);
|
|
|
} else {
|
|
|
timeOver = moment__WEBPACK_IMPORTED_MODULE_7___default()(answerData === null || answerData === void 0 ? void 0 : answerData.exercise_answer_user.start_at).add(answerData === null || answerData === void 0 ? void 0 : answerData.exercise.time, "m").isBefore(item.finished_time);
|
|
|
}
|
|
|
}
|
|
|
return /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_11__.jsxs)("span", {
|
|
|
children: [item.finished_time || /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_11__.jsx)("span", {
|
|
|
className: "c-grey-999",
|
|
|
children: "--"
|
|
|
}), /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_11__.jsx)("span", {
|
|
|
className: "c-orange-ff9 ",
|
|
|
children: timeOver ? "(已超时)" : ""
|
|
|
})]
|
|
|
});
|
|
|
}
|
|
|
}, {
|
|
|
title: "耗时",
|
|
|
dataIndex: "time_consuming",
|
|
|
key: "time_consuming",
|
|
|
align: 'center',
|
|
|
render: function render(time, item) {
|
|
|
return /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_11__.jsx)("span", {
|
|
|
children: item.time_consuming || /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_11__.jsx)("span", {
|
|
|
className: "color-grey-9",
|
|
|
children: "--"
|
|
|
})
|
|
|
});
|
|
|
}
|
|
|
}, {
|
|
|
title: "查看答案",
|
|
|
dataIndex: "view_answer",
|
|
|
key: "view_answer",
|
|
|
align: 'center',
|
|
|
render: function render(exp, item) {
|
|
|
return /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_11__.jsx)("span", {
|
|
|
children: item.view_answer ? "已查看" : "未查看"
|
|
|
});
|
|
|
}
|
|
|
},
|
|
|
// {
|
|
|
// title: "经验值",
|
|
|
// dataIndex: "experience",
|
|
|
// key: "experience",
|
|
|
// align: 'center',
|
|
|
// render: (exp: any, item: any) => {
|
|
|
// return (
|
|
|
// <span>
|
|
|
// <span className="c-green">{item.myself_experience}</span>/
|
|
|
// {item.experience}
|
|
|
// </span>
|
|
|
// );
|
|
|
// },
|
|
|
// },
|
|
|
{
|
|
|
title: "得分/满分",
|
|
|
dataIndex: "user_score",
|
|
|
key: "user_score",
|
|
|
align: 'center',
|
|
|
render: function render(exp, item) {
|
|
|
return /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_11__.jsxs)("span", {
|
|
|
children: [/*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_11__.jsx)("span", {
|
|
|
className: "c-orange",
|
|
|
children: item.user_score
|
|
|
}), "/", item.game_score]
|
|
|
});
|
|
|
}
|
|
|
}, hasChangeScore && {
|
|
|
title: "调分",
|
|
|
dataIndex: "user_score",
|
|
|
key: "user_score",
|
|
|
align: 'center',
|
|
|
render: function render(value, data, index) {
|
|
|
return /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_11__.jsx)(antd__WEBPACK_IMPORTED_MODULE_13__/* ["default"] */ .Z, {
|
|
|
min: 0,
|
|
|
max: Number(data.game_score),
|
|
|
defaultValue: value,
|
|
|
onBlur: /*#__PURE__*/function () {
|
|
|
var _ref2 = _root_workspace_ppte5yg23_local_v9_node_modules_babel_runtime_helpers_asyncToGenerator_js__WEBPACK_IMPORTED_MODULE_1___default()( /*#__PURE__*/_root_workspace_ppte5yg23_local_v9_node_modules_babel_runtime_helpers_regeneratorRuntime_js__WEBPACK_IMPORTED_MODULE_0___default()().mark(function _callee(e) {
|
|
|
var res;
|
|
|
return _root_workspace_ppte5yg23_local_v9_node_modules_babel_runtime_helpers_regeneratorRuntime_js__WEBPACK_IMPORTED_MODULE_0___default()().wrap(function _callee$(_context) {
|
|
|
while (1) switch (_context.prev = _context.next) {
|
|
|
case 0:
|
|
|
if (!(e.target.value != value)) {
|
|
|
_context.next = 6;
|
|
|
break;
|
|
|
}
|
|
|
_context.next = 3;
|
|
|
return saveChangeScore(_root_workspace_ppte5yg23_local_v9_node_modules_babel_runtime_helpers_objectSpread2_js__WEBPACK_IMPORTED_MODULE_2___default()(_root_workspace_ppte5yg23_local_v9_node_modules_babel_runtime_helpers_objectSpread2_js__WEBPACK_IMPORTED_MODULE_2___default()({}, item), {
|
|
|
shixun_challenge_id: data.shixun_challenge_id,
|
|
|
shixunScore: e.target.value
|
|
|
}));
|
|
|
case 3:
|
|
|
res = _context.sent;
|
|
|
console.log('res: ', res);
|
|
|
if (res !== null && res !== void 0 && res.question_comments) {
|
|
|
antd__WEBPACK_IMPORTED_MODULE_14__/* ["default"].success */ .ZP.success("已修改当前评分");
|
|
|
}
|
|
|
case 6:
|
|
|
case "end":
|
|
|
return _context.stop();
|
|
|
}
|
|
|
}, _callee);
|
|
|
}));
|
|
|
return function (_x) {
|
|
|
return _ref2.apply(this, arguments);
|
|
|
};
|
|
|
}()
|
|
|
});
|
|
|
}
|
|
|
}].filter(function (x) {
|
|
|
return !!x;
|
|
|
});
|
|
|
var outputColumns = [{
|
|
|
title: '评测次数',
|
|
|
dataIndex: 'key',
|
|
|
width: "127px",
|
|
|
key: 'key',
|
|
|
align: 'center',
|
|
|
render: function render(text, record) {
|
|
|
return /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_11__.jsx)("span", {
|
|
|
children: record.key
|
|
|
});
|
|
|
}
|
|
|
}, {
|
|
|
title: '详细信息',
|
|
|
dataIndex: 'error_msg',
|
|
|
key: 'error_msg',
|
|
|
align: 'center',
|
|
|
render: function render(text, record) {
|
|
|
return /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_11__.jsx)("span", {
|
|
|
children: record.error_msg ? record.error_msg : "--"
|
|
|
});
|
|
|
}
|
|
|
}, {
|
|
|
title: '评测时间',
|
|
|
dataIndex: 'updated_at',
|
|
|
key: 'updated_at',
|
|
|
align: 'center',
|
|
|
width: 200,
|
|
|
render: function render(text, record) {
|
|
|
return /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_11__.jsx)("span", {
|
|
|
children: record.updated_at ? record.updated_at : "--"
|
|
|
});
|
|
|
}
|
|
|
}];
|
|
|
var options = {
|
|
|
selectOnLineNumbers: true,
|
|
|
readOnly: true,
|
|
|
minimap: {
|
|
|
enabled: false
|
|
|
},
|
|
|
scrollBeyondLastLine: false
|
|
|
};
|
|
|
return /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_11__.jsxs)(react_jsx_runtime__WEBPACK_IMPORTED_MODULE_11__.Fragment, {
|
|
|
children: [((answerData === null || answerData === void 0 ? void 0 : (_answerData$exercise = answerData.exercise) === null || _answerData$exercise === void 0 ? void 0 : _answerData$exercise.student_commit_status) !== 0 || (answerData === null || answerData === void 0 ? void 0 : (_answerData$exercise2 = answerData.exercise) === null || _answerData$exercise2 === void 0 ? void 0 : _answerData$exercise2.user_exercise_status) !== 0) && /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_11__.jsxs)("div", {
|
|
|
className: "mt15",
|
|
|
children: [/*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_11__.jsx)("p", {
|
|
|
className: "font16 c-grey-666",
|
|
|
children: "\u9636\u6BB5\u6210\u7EE9"
|
|
|
}), !!(data !== null && data !== void 0 && data.length) && /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_11__.jsx)(antd__WEBPACK_IMPORTED_MODULE_15__/* ["default"] */ .Z, {
|
|
|
columns: columns,
|
|
|
dataSource: data,
|
|
|
pagination: false
|
|
|
})]
|
|
|
}), !!(challengeData !== null && challengeData !== void 0 && challengeData.length) && /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_11__.jsxs)(react_jsx_runtime__WEBPACK_IMPORTED_MODULE_11__.Fragment, {
|
|
|
children: [/*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_11__.jsx)("p", {
|
|
|
className: "font16 c-grey-666 mt10",
|
|
|
children: "\u5B9E\u8BAD\u8BE6\u60C5"
|
|
|
}), challengeData === null || challengeData === void 0 ? void 0 : challengeData.map(function (chanllenge, index) {
|
|
|
var _chanllenge$outputs;
|
|
|
return /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_11__.jsxs)(react_jsx_runtime__WEBPACK_IMPORTED_MODULE_11__.Fragment, {
|
|
|
children: [/*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_11__.jsxs)("div", {
|
|
|
className: "mt5",
|
|
|
children: [/*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_11__.jsxs)("span", {
|
|
|
className: "font16 mr15",
|
|
|
children: [" \u7B2C", chanllenge.position, "\u5173"]
|
|
|
}), /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_11__.jsx)(umi__WEBPACK_IMPORTED_MODULE_8__.Link, {
|
|
|
className: "current c-black font16",
|
|
|
to: "/tasks/".concat(chanllenge.game_identifier),
|
|
|
children: chanllenge.name
|
|
|
})]
|
|
|
}), !!(chanllenge !== null && chanllenge !== void 0 && (_chanllenge$outputs = chanllenge.outputs) !== null && _chanllenge$outputs !== void 0 && _chanllenge$outputs.length) && /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_11__.jsx)(antd__WEBPACK_IMPORTED_MODULE_15__/* ["default"] */ .Z, {
|
|
|
bordered: true,
|
|
|
dataSource: chanllenge.outputs.map(function (out) {
|
|
|
return {
|
|
|
key: out.position,
|
|
|
error_msg: out.output_detail,
|
|
|
updated_at: out.updated_at
|
|
|
};
|
|
|
}),
|
|
|
columns: outputColumns,
|
|
|
pagination: false
|
|
|
}), (chanllenge === null || chanllenge === void 0 ? void 0 : chanllenge.st) === 0 && chanllenge.passed_code && /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_11__.jsxs)("div", {
|
|
|
className: _index_less_modules__WEBPACK_IMPORTED_MODULE_10__/* ["default"].shixunWrp */ .Z.shixunWrp,
|
|
|
children: [/*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_11__.jsxs)("h2", {
|
|
|
children: ["\u6700\u540E\u4E00\u6B21\u901A\u5173\u7684\u4EE3\u7801\uFF08\u672A\u901A\u5173\u5219\u4E3A\u6700\u540E\u4E00\u6B21\u63D0\u4EA4\u8BC4\u6D4B\u7684\u4EE3\u7801\uFF09", /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_11__.jsx)("span", {
|
|
|
className: "c-light-black",
|
|
|
children: chanllenge.path
|
|
|
})]
|
|
|
}), /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_11__.jsx)(_components_monaco_editor__WEBPACK_IMPORTED_MODULE_9__/* ["default"] */ .ZP, {
|
|
|
height: 300,
|
|
|
autoHeight: autoHeight,
|
|
|
language: "python",
|
|
|
theme: "default",
|
|
|
value: chanllenge.passed_code,
|
|
|
options: options
|
|
|
})]
|
|
|
})]
|
|
|
});
|
|
|
})]
|
|
|
}), (0,_utils_authority__WEBPACK_IMPORTED_MODULE_6__/* .isStudent */ .dE)() && /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_11__.jsx)(_components_RenderHtml__WEBPACK_IMPORTED_MODULE_5__/* ["default"] */ .Z, {
|
|
|
className: "c-grey-999 mt20 mb20",
|
|
|
value: item === null || item === void 0 ? void 0 : item.question_title
|
|
|
}), item === null || item === void 0 ? void 0 : (_item$shixun = item.shixun) === null || _item$shixun === void 0 ? void 0 : _item$shixun.map(function (shixun, index) {
|
|
|
return /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_11__.jsxs)("p", {
|
|
|
className: "font16 c-grey-666 mb5",
|
|
|
children: [/*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_11__.jsxs)("span", {
|
|
|
className: "mr20",
|
|
|
children: ["\u7B2C", shixun === null || shixun === void 0 ? void 0 : shixun.challenge_position, "\u5173 ", shixun === null || shixun === void 0 ? void 0 : shixun.challenge_name]
|
|
|
}), /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_11__.jsxs)("span", {
|
|
|
children: [shixun === null || shixun === void 0 ? void 0 : shixun.challenge_score, "\u5206"]
|
|
|
})]
|
|
|
});
|
|
|
}), /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_11__.jsx)("div", {
|
|
|
className: "mb15"
|
|
|
})]
|
|
|
});
|
|
|
};
|
|
|
/* harmony default export */ __webpack_exports__["Z"] = (Shixun);
|
|
|
|
|
|
/***/ }),
|
|
|
|
|
|
/***/ 70960:
|
|
|
/*!***************************!*\
|
|
|
!*** ./src/utils/enum.ts ***!
|
|
|
\***************************/
|
|
|
/***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) {
|
|
|
|
|
|
"use strict";
|
|
|
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
|
|
|
/* harmony export */ "c": function() { return /* binding */ QuestionType; }
|
|
|
/* harmony export */ });
|
|
|
/* unused harmony export PageType */
|
|
|
var PageType = /*#__PURE__*/function (PageType) {
|
|
|
PageType["FirstPage"] = "firstPage";
|
|
|
PageType["PrevPage"] = "prevPage";
|
|
|
PageType["NextPage"] = "nextPage";
|
|
|
return PageType;
|
|
|
}({});
|
|
|
var QuestionType = /*#__PURE__*/function (QuestionType) {
|
|
|
QuestionType[QuestionType["Single"] = 0] = "Single";
|
|
|
QuestionType[QuestionType["Multiple"] = 1] = "Multiple";
|
|
|
QuestionType[QuestionType["Judge"] = 2] = "Judge";
|
|
|
QuestionType[QuestionType["Fill"] = 3] = "Fill";
|
|
|
QuestionType[QuestionType["Subjective"] = 4] = "Subjective";
|
|
|
QuestionType[QuestionType["Shixun"] = 5] = "Shixun";
|
|
|
QuestionType[QuestionType["Program"] = 6] = "Program";
|
|
|
QuestionType[QuestionType["Combine"] = 7] = "Combine";
|
|
|
return QuestionType;
|
|
|
}({});
|
|
|
|
|
|
/***/ }),
|
|
|
|
|
|
/***/ 24549:
|
|
|
/*!***********************************************************************!*\
|
|
|
!*** ./src/pages/Classrooms/Lists/Exercise/Export/index.less?modules ***!
|
|
|
\***********************************************************************/
|
|
|
/***/ (function(__unused_webpack_module, __webpack_exports__) {
|
|
|
|
|
|
"use strict";
|
|
|
// extracted by mini-css-extract-plugin
|
|
|
/* harmony default export */ __webpack_exports__["Z"] = ({"flex_box_center":"flex_box_center___GW1u0","flex_space_between":"flex_space_between___XhK9z","flex_box_vertical_center":"flex_box_vertical_center___NKIbp","flex_box_center_end":"flex_box_center_end___V3qhT","flex_box_column":"flex_box_column___b4G29","bg":"bg___exMJB","paginationWrapper":"paginationWrapper___ROsRI","totalText":"totalText___PGE6D","num":"num___jLrBF","title":"title___yiXeD","questionIcons":"questionIcons___v75Tz","green":"green___HRGef","orange":"orange___tdW4E","greenTip":"greenTip___f2SpQ","redTip":"redTip___jc8UE","orangeTip":"orangeTip___VMO_s","flexRow":"flexRow___Jshv2","simpleWrap":"simpleWrap___ul6oi","divider":"divider___Of_8z","modal":"modal___oAD7F","programTitle":"programTitle___ybswa","simpleBg":"simpleBg___yLrQy","exportBtn":"exportBtn___x5fcE"});
|
|
|
|
|
|
/***/ }),
|
|
|
|
|
|
/***/ 1446:
|
|
|
/*!*********************************************************************************!*\
|
|
|
!*** ./src/pages/Classrooms/Lists/Exercise/Review/component/index.less?modules ***!
|
|
|
\*********************************************************************************/
|
|
|
/***/ (function(__unused_webpack_module, __webpack_exports__) {
|
|
|
|
|
|
"use strict";
|
|
|
// extracted by mini-css-extract-plugin
|
|
|
/* harmony default export */ __webpack_exports__["Z"] = ({"flex_box_center":"flex_box_center___VAUts","flex_space_between":"flex_space_between___gx5ZV","flex_box_vertical_center":"flex_box_vertical_center___HV_tL","flex_box_center_end":"flex_box_center_end___fVsIw","flex_box_column":"flex_box_column___F5DHk","shixunWrp":"shixunWrp___pinaF","s":"s___mtpV4","fillComment":"fillComment___WEgkI","commentContent":"commentContent___v_Ebo","commentText":"commentText___fyDle","simpleWrap":"simpleWrap___uwIie","fillBg":"fillBg___iyMsm","simpleBg":"simpleBg___UqElF","lookCode":"lookCode___xKifS"});
|
|
|
|
|
|
/***/ }),
|
|
|
|
|
|
/***/ 37729:
|
|
|
/*!***********************************************************************!*\
|
|
|
!*** ./src/pages/Classrooms/Lists/Exercise/Review/index.less?modules ***!
|
|
|
\***********************************************************************/
|
|
|
/***/ (function(__unused_webpack_module, __webpack_exports__) {
|
|
|
|
|
|
"use strict";
|
|
|
// extracted by mini-css-extract-plugin
|
|
|
/* harmony default export */ __webpack_exports__["Z"] = ({"flex_box_center":"flex_box_center___D6Qly","flex_space_between":"flex_space_between___ZA98O","flex_box_vertical_center":"flex_box_vertical_center___aST6E","flex_box_center_end":"flex_box_center_end___kJ_eQ","flex_box_column":"flex_box_column___ZOkyZ","bg":"bg___rbSyL","circularBlue":"circularBlue___qvnla","circularRed":"circularRed___jo0FU","circularOrange":"circularOrange___GteY7","circularGreen":"circularGreen___PW_tz","circularGrey":"circularGrey___Nt7Wc","title":"title___Volf5","questionIcons":"questionIcons___MIxzq","grey":"grey___XquYB","green":"green___sjsXt","blue":"blue___Jwa9H","orange":"orange___cGfa7","red":"red___NensB","greenTip":"greenTip___lDmky","redTip":"redTip___Yp9nM","cccTip":"cccTip___Uzudc","orangeTip":"orangeTip___gA104","flexRow":"flexRow___GsOMs","simpleWrap":"simpleWrap___jppmP","userPhoto":"userPhoto___LUsoO","CCCIcons":"CCCIcons___STbxr","buttonFixed":"buttonFixed___aUnd3","progress":"progress___w_inO","typeTitle":"typeTitle___i1hJu","answerResult":"answerResult___kLknn","questionsInfo":"questionsInfo___spnx1","leftBar":"leftBar___AjrjB","greenBg":"greenBg___nlTOV","blueBg":"blueBg___nYACT","redBg":"redBg___WTgtT","orangeBg":"orangeBg___mMAXu","greyBg":"greyBg___eAdgQ","commentText":"commentText___smAVm","full":"full____Rgkm","answerInfo":"answerInfo___iSSvg","listType":"listType___fUHyn","userInfo":"userInfo___sc77e","userImg":"userImg___mL2tk","userInfoTitle":"userInfoTitle___U2d5B","userInfoValue":"userInfoValue___DBOCD","status":"status___yZSrO","result":"result___TOeTF","evaluate":"evaluate___CJGFj","analysis":"analysis___NuY61","userInfoModel":"userInfoModel___jHeA_","width":"width___UtVF4","Title":"Title___BfkeS","Value":"Value___sj9SB","userInfoModelbody":"userInfoModelbody___nQNbP","answerError":"answerError___kJTJu"});
|
|
|
|
|
|
/***/ }),
|
|
|
|
|
|
/***/ 85673:
|
|
|
/*!**************************************************************!*\
|
|
|
!*** ./node_modules/antd/es/breadcrumb/index.js + 6 modules ***!
|
|
|
\**************************************************************/
|
|
|
/***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) {
|
|
|
|
|
|
"use strict";
|
|
|
|
|
|
// EXPORTS
|
|
|
__webpack_require__.d(__webpack_exports__, {
|
|
|
"Z": function() { return /* binding */ breadcrumb; }
|
|
|
});
|
|
|
|
|
|
// EXTERNAL MODULE: ./node_modules/classnames/index.js
|
|
|
var classnames = __webpack_require__(94184);
|
|
|
var classnames_default = /*#__PURE__*/__webpack_require__.n(classnames);
|
|
|
// EXTERNAL MODULE: ./node_modules/antd/node_modules/rc-util/es/Children/toArray.js
|
|
|
var toArray = __webpack_require__(37419);
|
|
|
// EXTERNAL MODULE: ./node_modules/antd/node_modules/rc-util/es/pickAttrs.js
|
|
|
var pickAttrs = __webpack_require__(1337);
|
|
|
// EXTERNAL MODULE: ./node_modules/react/index.js
|
|
|
var react = __webpack_require__(67294);
|
|
|
// EXTERNAL MODULE: ./node_modules/antd/es/_util/reactNode.js
|
|
|
var reactNode = __webpack_require__(96159);
|
|
|
// EXTERNAL MODULE: ./node_modules/antd/es/config-provider/context.js
|
|
|
var context = __webpack_require__(53124);
|
|
|
// EXTERNAL MODULE: ./node_modules/@ant-design/icons/es/icons/DownOutlined.js + 1 modules
|
|
|
var DownOutlined = __webpack_require__(80882);
|
|
|
// EXTERNAL MODULE: ./node_modules/antd/es/dropdown/dropdown.js + 9 modules
|
|
|
var dropdown = __webpack_require__(35874);
|
|
|
;// CONCATENATED MODULE: ./node_modules/antd/es/breadcrumb/BreadcrumbSeparator.js
|
|
|
|
|
|
|
|
|
const BreadcrumbSeparator = _ref => {
|
|
|
let {
|
|
|
children
|
|
|
} = _ref;
|
|
|
const {
|
|
|
getPrefixCls
|
|
|
} = react.useContext(context/* ConfigContext */.E_);
|
|
|
const prefixCls = getPrefixCls('breadcrumb');
|
|
|
return /*#__PURE__*/react.createElement("li", {
|
|
|
className: `${prefixCls}-separator`,
|
|
|
"aria-hidden": "true"
|
|
|
}, children === '' ? children : children || '/');
|
|
|
};
|
|
|
BreadcrumbSeparator.__ANT_BREADCRUMB_SEPARATOR = true;
|
|
|
/* harmony default export */ var breadcrumb_BreadcrumbSeparator = (BreadcrumbSeparator);
|
|
|
;// CONCATENATED MODULE: ./node_modules/antd/es/breadcrumb/useItemRender.js
|
|
|
var __rest = undefined && undefined.__rest || function (s, e) {
|
|
|
var t = {};
|
|
|
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0) t[p] = s[p];
|
|
|
if (s != null && typeof Object.getOwnPropertySymbols === "function") for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
|
|
|
if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i])) t[p[i]] = s[p[i]];
|
|
|
}
|
|
|
return t;
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
function getBreadcrumbName(route, params) {
|
|
|
if (route.title === undefined || route.title === null) {
|
|
|
return null;
|
|
|
}
|
|
|
const paramsKeys = Object.keys(params).join('|');
|
|
|
return typeof route.title === 'object' ? route.title : String(route.title).replace(new RegExp(`:(${paramsKeys})`, 'g'), (replacement, key) => params[key] || replacement);
|
|
|
}
|
|
|
function renderItem(prefixCls, item, children, href) {
|
|
|
if (children === null || children === undefined) {
|
|
|
return null;
|
|
|
}
|
|
|
const {
|
|
|
className,
|
|
|
onClick
|
|
|
} = item,
|
|
|
restItem = __rest(item, ["className", "onClick"]);
|
|
|
const passedProps = Object.assign(Object.assign({}, (0,pickAttrs/* default */.Z)(restItem, {
|
|
|
data: true,
|
|
|
aria: true
|
|
|
})), {
|
|
|
onClick
|
|
|
});
|
|
|
if (href !== undefined) {
|
|
|
return /*#__PURE__*/react.createElement("a", Object.assign({}, passedProps, {
|
|
|
className: classnames_default()(`${prefixCls}-link`, className),
|
|
|
href: href
|
|
|
}), children);
|
|
|
}
|
|
|
return /*#__PURE__*/react.createElement("span", Object.assign({}, passedProps, {
|
|
|
className: classnames_default()(`${prefixCls}-link`, className)
|
|
|
}), children);
|
|
|
}
|
|
|
function useItemRender(prefixCls, itemRender) {
|
|
|
const mergedItemRender = (item, params, routes, path, href) => {
|
|
|
if (itemRender) {
|
|
|
return itemRender(item, params, routes, path);
|
|
|
}
|
|
|
const name = getBreadcrumbName(item, params);
|
|
|
return renderItem(prefixCls, item, name, href);
|
|
|
};
|
|
|
return mergedItemRender;
|
|
|
}
|
|
|
;// CONCATENATED MODULE: ./node_modules/antd/es/breadcrumb/BreadcrumbItem.js
|
|
|
var BreadcrumbItem_rest = undefined && undefined.__rest || function (s, e) {
|
|
|
var t = {};
|
|
|
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0) t[p] = s[p];
|
|
|
if (s != null && typeof Object.getOwnPropertySymbols === "function") for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
|
|
|
if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i])) t[p[i]] = s[p[i]];
|
|
|
}
|
|
|
return t;
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
const InternalBreadcrumbItem = props => {
|
|
|
const {
|
|
|
prefixCls,
|
|
|
separator = '/',
|
|
|
children,
|
|
|
menu,
|
|
|
overlay,
|
|
|
dropdownProps,
|
|
|
href
|
|
|
} = props;
|
|
|
// Warning for deprecated usage
|
|
|
if (false) {}
|
|
|
/** If overlay is have Wrap a Dropdown */
|
|
|
const renderBreadcrumbNode = breadcrumbItem => {
|
|
|
if (menu || overlay) {
|
|
|
const mergeDropDownProps = Object.assign({}, dropdownProps);
|
|
|
if (menu) {
|
|
|
const _a = menu || {},
|
|
|
{
|
|
|
items
|
|
|
} = _a,
|
|
|
menuProps = BreadcrumbItem_rest(_a, ["items"]);
|
|
|
mergeDropDownProps.menu = Object.assign(Object.assign({}, menuProps), {
|
|
|
items: items === null || items === void 0 ? void 0 : items.map((_a, index) => {
|
|
|
var {
|
|
|
key,
|
|
|
title,
|
|
|
label,
|
|
|
path
|
|
|
} = _a,
|
|
|
itemProps = BreadcrumbItem_rest(_a, ["key", "title", "label", "path"]);
|
|
|
let mergedLabel = label !== null && label !== void 0 ? label : title;
|
|
|
if (path) {
|
|
|
mergedLabel = /*#__PURE__*/react.createElement("a", {
|
|
|
href: `${href}${path}`
|
|
|
}, mergedLabel);
|
|
|
}
|
|
|
return Object.assign(Object.assign({}, itemProps), {
|
|
|
key: key !== null && key !== void 0 ? key : index,
|
|
|
label: mergedLabel
|
|
|
});
|
|
|
})
|
|
|
});
|
|
|
} else if (overlay) {
|
|
|
mergeDropDownProps.overlay = overlay;
|
|
|
}
|
|
|
return /*#__PURE__*/react.createElement(dropdown/* default */.Z, Object.assign({
|
|
|
placement: "bottom"
|
|
|
}, mergeDropDownProps), /*#__PURE__*/react.createElement("span", {
|
|
|
className: `${prefixCls}-overlay-link`
|
|
|
}, breadcrumbItem, /*#__PURE__*/react.createElement(DownOutlined/* default */.Z, null)));
|
|
|
}
|
|
|
return breadcrumbItem;
|
|
|
};
|
|
|
// wrap to dropDown
|
|
|
const link = renderBreadcrumbNode(children);
|
|
|
if (link !== undefined && link !== null) {
|
|
|
return /*#__PURE__*/react.createElement(react.Fragment, null, /*#__PURE__*/react.createElement("li", null, link), separator && /*#__PURE__*/react.createElement(breadcrumb_BreadcrumbSeparator, null, separator));
|
|
|
}
|
|
|
return null;
|
|
|
};
|
|
|
const BreadcrumbItem = props => {
|
|
|
const {
|
|
|
prefixCls: customizePrefixCls,
|
|
|
children,
|
|
|
href
|
|
|
} = props,
|
|
|
restProps = BreadcrumbItem_rest(props, ["prefixCls", "children", "href"]);
|
|
|
const {
|
|
|
getPrefixCls
|
|
|
} = react.useContext(context/* ConfigContext */.E_);
|
|
|
const prefixCls = getPrefixCls('breadcrumb', customizePrefixCls);
|
|
|
return /*#__PURE__*/react.createElement(InternalBreadcrumbItem, Object.assign({}, restProps, {
|
|
|
prefixCls: prefixCls
|
|
|
}), renderItem(prefixCls, restProps, children, href));
|
|
|
};
|
|
|
BreadcrumbItem.__ANT_BREADCRUMB_ITEM = true;
|
|
|
/* harmony default export */ var breadcrumb_BreadcrumbItem = (BreadcrumbItem);
|
|
|
// EXTERNAL MODULE: ./node_modules/antd/es/style/index.js
|
|
|
var style = __webpack_require__(14747);
|
|
|
// EXTERNAL MODULE: ./node_modules/antd/es/theme/util/genComponentStyleHook.js
|
|
|
var genComponentStyleHook = __webpack_require__(67968);
|
|
|
// EXTERNAL MODULE: ./node_modules/antd/es/theme/util/statistic.js
|
|
|
var statistic = __webpack_require__(45503);
|
|
|
;// CONCATENATED MODULE: ./node_modules/antd/es/breadcrumb/style/index.js
|
|
|
|
|
|
|
|
|
const genBreadcrumbStyle = token => {
|
|
|
const {
|
|
|
componentCls,
|
|
|
iconCls
|
|
|
} = token;
|
|
|
return {
|
|
|
[componentCls]: Object.assign(Object.assign({}, (0,style/* resetComponent */.Wf)(token)), {
|
|
|
color: token.itemColor,
|
|
|
fontSize: token.fontSize,
|
|
|
[iconCls]: {
|
|
|
fontSize: token.iconFontSize
|
|
|
},
|
|
|
ol: {
|
|
|
display: 'flex',
|
|
|
flexWrap: 'wrap',
|
|
|
margin: 0,
|
|
|
padding: 0,
|
|
|
listStyle: 'none'
|
|
|
},
|
|
|
a: Object.assign({
|
|
|
color: token.linkColor,
|
|
|
transition: `color ${token.motionDurationMid}`,
|
|
|
padding: `0 ${token.paddingXXS}px`,
|
|
|
borderRadius: token.borderRadiusSM,
|
|
|
height: token.lineHeight * token.fontSize,
|
|
|
display: 'inline-block',
|
|
|
marginInline: -token.marginXXS,
|
|
|
'&:hover': {
|
|
|
color: token.linkHoverColor,
|
|
|
backgroundColor: token.colorBgTextHover
|
|
|
}
|
|
|
}, (0,style/* genFocusStyle */.Qy)(token)),
|
|
|
[`li:last-child`]: {
|
|
|
color: token.lastItemColor
|
|
|
},
|
|
|
[`${componentCls}-separator`]: {
|
|
|
marginInline: token.separatorMargin,
|
|
|
color: token.separatorColor
|
|
|
},
|
|
|
[`${componentCls}-link`]: {
|
|
|
[`
|
|
|
> ${iconCls} + span,
|
|
|
> ${iconCls} + a
|
|
|
`]: {
|
|
|
marginInlineStart: token.marginXXS
|
|
|
}
|
|
|
},
|
|
|
[`${componentCls}-overlay-link`]: {
|
|
|
borderRadius: token.borderRadiusSM,
|
|
|
height: token.lineHeight * token.fontSize,
|
|
|
display: 'inline-block',
|
|
|
padding: `0 ${token.paddingXXS}px`,
|
|
|
marginInline: -token.marginXXS,
|
|
|
[`> ${iconCls}`]: {
|
|
|
marginInlineStart: token.marginXXS,
|
|
|
fontSize: token.fontSizeIcon
|
|
|
},
|
|
|
'&:hover': {
|
|
|
color: token.linkHoverColor,
|
|
|
backgroundColor: token.colorBgTextHover,
|
|
|
a: {
|
|
|
color: token.linkHoverColor
|
|
|
}
|
|
|
},
|
|
|
a: {
|
|
|
'&:hover': {
|
|
|
backgroundColor: 'transparent'
|
|
|
}
|
|
|
}
|
|
|
},
|
|
|
// rtl style
|
|
|
[`&${token.componentCls}-rtl`]: {
|
|
|
direction: 'rtl'
|
|
|
}
|
|
|
})
|
|
|
};
|
|
|
};
|
|
|
// ============================== Export ==============================
|
|
|
/* harmony default export */ var breadcrumb_style = ((0,genComponentStyleHook/* default */.Z)('Breadcrumb', token => {
|
|
|
const BreadcrumbToken = (0,statistic/* merge */.TS)(token, {});
|
|
|
return [genBreadcrumbStyle(BreadcrumbToken)];
|
|
|
}, token => ({
|
|
|
itemColor: token.colorTextDescription,
|
|
|
lastItemColor: token.colorText,
|
|
|
iconFontSize: token.fontSize,
|
|
|
linkColor: token.colorTextDescription,
|
|
|
linkHoverColor: token.colorText,
|
|
|
separatorColor: token.colorTextDescription,
|
|
|
separatorMargin: token.marginXS
|
|
|
})));
|
|
|
;// CONCATENATED MODULE: ./node_modules/antd/es/breadcrumb/useItems.js
|
|
|
var useItems_rest = undefined && undefined.__rest || function (s, e) {
|
|
|
var t = {};
|
|
|
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0) t[p] = s[p];
|
|
|
if (s != null && typeof Object.getOwnPropertySymbols === "function") for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
|
|
|
if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i])) t[p[i]] = s[p[i]];
|
|
|
}
|
|
|
return t;
|
|
|
};
|
|
|
|
|
|
function route2item(route) {
|
|
|
const {
|
|
|
breadcrumbName,
|
|
|
children
|
|
|
} = route,
|
|
|
rest = useItems_rest(route, ["breadcrumbName", "children"]);
|
|
|
const clone = Object.assign({
|
|
|
title: breadcrumbName
|
|
|
}, rest);
|
|
|
if (children) {
|
|
|
clone.menu = {
|
|
|
items: children.map(_a => {
|
|
|
var {
|
|
|
breadcrumbName: itemBreadcrumbName
|
|
|
} = _a,
|
|
|
itemProps = useItems_rest(_a, ["breadcrumbName"]);
|
|
|
return Object.assign(Object.assign({}, itemProps), {
|
|
|
title: itemBreadcrumbName
|
|
|
});
|
|
|
})
|
|
|
};
|
|
|
}
|
|
|
return clone;
|
|
|
}
|
|
|
function useItems(items, routes) {
|
|
|
return (0,react.useMemo)(() => {
|
|
|
if (items) {
|
|
|
return items;
|
|
|
}
|
|
|
if (routes) {
|
|
|
return routes.map(route2item);
|
|
|
}
|
|
|
return null;
|
|
|
}, [items, routes]);
|
|
|
}
|
|
|
;// CONCATENATED MODULE: ./node_modules/antd/es/breadcrumb/Breadcrumb.js
|
|
|
var Breadcrumb_rest = undefined && undefined.__rest || function (s, e) {
|
|
|
var t = {};
|
|
|
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0) t[p] = s[p];
|
|
|
if (s != null && typeof Object.getOwnPropertySymbols === "function") for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
|
|
|
if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i])) t[p[i]] = s[p[i]];
|
|
|
}
|
|
|
return t;
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
const getPath = (params, path) => {
|
|
|
if (path === undefined) {
|
|
|
return path;
|
|
|
}
|
|
|
let mergedPath = (path || '').replace(/^\//, '');
|
|
|
Object.keys(params).forEach(key => {
|
|
|
mergedPath = mergedPath.replace(`:${key}`, params[key]);
|
|
|
});
|
|
|
return mergedPath;
|
|
|
};
|
|
|
const Breadcrumb = props => {
|
|
|
const {
|
|
|
prefixCls: customizePrefixCls,
|
|
|
separator = '/',
|
|
|
style,
|
|
|
className,
|
|
|
rootClassName,
|
|
|
routes: legacyRoutes,
|
|
|
items,
|
|
|
children,
|
|
|
itemRender,
|
|
|
params = {}
|
|
|
} = props,
|
|
|
restProps = Breadcrumb_rest(props, ["prefixCls", "separator", "style", "className", "rootClassName", "routes", "items", "children", "itemRender", "params"]);
|
|
|
const {
|
|
|
getPrefixCls,
|
|
|
direction,
|
|
|
breadcrumb
|
|
|
} = react.useContext(context/* ConfigContext */.E_);
|
|
|
let crumbs;
|
|
|
const prefixCls = getPrefixCls('breadcrumb', customizePrefixCls);
|
|
|
const [wrapSSR, hashId] = breadcrumb_style(prefixCls);
|
|
|
const mergedItems = useItems(items, legacyRoutes);
|
|
|
if (false) {}
|
|
|
const mergedItemRender = useItemRender(prefixCls, itemRender);
|
|
|
if (mergedItems && mergedItems.length > 0) {
|
|
|
// generated by route
|
|
|
const paths = [];
|
|
|
const itemRenderRoutes = items || legacyRoutes;
|
|
|
crumbs = mergedItems.map((item, index) => {
|
|
|
const {
|
|
|
path,
|
|
|
key,
|
|
|
type,
|
|
|
menu,
|
|
|
overlay,
|
|
|
onClick,
|
|
|
className: itemClassName,
|
|
|
separator: itemSeparator,
|
|
|
dropdownProps
|
|
|
} = item;
|
|
|
const mergedPath = getPath(params, path);
|
|
|
if (mergedPath !== undefined) {
|
|
|
paths.push(mergedPath);
|
|
|
}
|
|
|
const mergedKey = key !== null && key !== void 0 ? key : index;
|
|
|
if (type === 'separator') {
|
|
|
return /*#__PURE__*/react.createElement(breadcrumb_BreadcrumbSeparator, {
|
|
|
key: mergedKey
|
|
|
}, itemSeparator);
|
|
|
}
|
|
|
const itemProps = {};
|
|
|
const isLastItem = index === mergedItems.length - 1;
|
|
|
if (menu) {
|
|
|
itemProps.menu = menu;
|
|
|
} else if (overlay) {
|
|
|
itemProps.overlay = overlay;
|
|
|
}
|
|
|
let {
|
|
|
href
|
|
|
} = item;
|
|
|
if (paths.length && mergedPath !== undefined) {
|
|
|
href = `#/${paths.join('/')}`;
|
|
|
}
|
|
|
return /*#__PURE__*/react.createElement(InternalBreadcrumbItem, Object.assign({
|
|
|
key: mergedKey
|
|
|
}, itemProps, (0,pickAttrs/* default */.Z)(item, {
|
|
|
data: true,
|
|
|
aria: true
|
|
|
}), {
|
|
|
className: itemClassName,
|
|
|
dropdownProps: dropdownProps,
|
|
|
href: href,
|
|
|
separator: isLastItem ? '' : separator,
|
|
|
onClick: onClick,
|
|
|
prefixCls: prefixCls
|
|
|
}), mergedItemRender(item, params, itemRenderRoutes, paths, href));
|
|
|
});
|
|
|
} else if (children) {
|
|
|
const childrenLength = (0,toArray/* default */.Z)(children).length;
|
|
|
crumbs = (0,toArray/* default */.Z)(children).map((element, index) => {
|
|
|
if (!element) {
|
|
|
return element;
|
|
|
}
|
|
|
// =================== Warning =====================
|
|
|
if (false) {}
|
|
|
false ? 0 : void 0;
|
|
|
const isLastItem = index === childrenLength - 1;
|
|
|
return (0,reactNode/* cloneElement */.Tm)(element, {
|
|
|
separator: isLastItem ? '' : separator,
|
|
|
key: index
|
|
|
});
|
|
|
});
|
|
|
}
|
|
|
const breadcrumbClassName = classnames_default()(prefixCls, breadcrumb === null || breadcrumb === void 0 ? void 0 : breadcrumb.className, {
|
|
|
[`${prefixCls}-rtl`]: direction === 'rtl'
|
|
|
}, className, rootClassName, hashId);
|
|
|
const mergedStyle = Object.assign(Object.assign({}, breadcrumb === null || breadcrumb === void 0 ? void 0 : breadcrumb.style), style);
|
|
|
return wrapSSR( /*#__PURE__*/react.createElement("nav", Object.assign({
|
|
|
className: breadcrumbClassName,
|
|
|
style: mergedStyle
|
|
|
}, restProps), /*#__PURE__*/react.createElement("ol", null, crumbs)));
|
|
|
};
|
|
|
Breadcrumb.Item = breadcrumb_BreadcrumbItem;
|
|
|
Breadcrumb.Separator = breadcrumb_BreadcrumbSeparator;
|
|
|
if (false) {}
|
|
|
/* harmony default export */ var breadcrumb_Breadcrumb = (Breadcrumb);
|
|
|
;// CONCATENATED MODULE: ./node_modules/antd/es/breadcrumb/index.js
|
|
|
'use client';
|
|
|
|
|
|
|
|
|
/* harmony default export */ var breadcrumb = (breadcrumb_Breadcrumb);
|
|
|
|
|
|
/***/ }),
|
|
|
|
|
|
/***/ 96074:
|
|
|
/*!***********************************************************!*\
|
|
|
!*** ./node_modules/antd/es/divider/index.js + 1 modules ***!
|
|
|
\***********************************************************/
|
|
|
/***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) {
|
|
|
|
|
|
"use strict";
|
|
|
|
|
|
// EXPORTS
|
|
|
__webpack_require__.d(__webpack_exports__, {
|
|
|
"Z": function() { return /* binding */ divider; }
|
|
|
});
|
|
|
|
|
|
// EXTERNAL MODULE: ./node_modules/classnames/index.js
|
|
|
var classnames = __webpack_require__(94184);
|
|
|
var classnames_default = /*#__PURE__*/__webpack_require__.n(classnames);
|
|
|
// EXTERNAL MODULE: ./node_modules/react/index.js
|
|
|
var react = __webpack_require__(67294);
|
|
|
// EXTERNAL MODULE: ./node_modules/antd/es/config-provider/context.js
|
|
|
var context = __webpack_require__(53124);
|
|
|
// EXTERNAL MODULE: ./node_modules/antd/es/style/index.js
|
|
|
var style = __webpack_require__(14747);
|
|
|
// EXTERNAL MODULE: ./node_modules/antd/es/theme/util/genComponentStyleHook.js
|
|
|
var genComponentStyleHook = __webpack_require__(67968);
|
|
|
// EXTERNAL MODULE: ./node_modules/antd/es/theme/util/statistic.js
|
|
|
var statistic = __webpack_require__(45503);
|
|
|
;// CONCATENATED MODULE: ./node_modules/antd/es/divider/style/index.js
|
|
|
|
|
|
|
|
|
// ============================== Shared ==============================
|
|
|
const genSharedDividerStyle = token => {
|
|
|
const {
|
|
|
componentCls,
|
|
|
sizePaddingEdgeHorizontal,
|
|
|
colorSplit,
|
|
|
lineWidth
|
|
|
} = token;
|
|
|
return {
|
|
|
[componentCls]: Object.assign(Object.assign({}, (0,style/* resetComponent */.Wf)(token)), {
|
|
|
borderBlockStart: `${lineWidth}px solid ${colorSplit}`,
|
|
|
// vertical
|
|
|
'&-vertical': {
|
|
|
position: 'relative',
|
|
|
top: '-0.06em',
|
|
|
display: 'inline-block',
|
|
|
height: '0.9em',
|
|
|
margin: `0 ${token.dividerVerticalGutterMargin}px`,
|
|
|
verticalAlign: 'middle',
|
|
|
borderTop: 0,
|
|
|
borderInlineStart: `${lineWidth}px solid ${colorSplit}`
|
|
|
},
|
|
|
'&-horizontal': {
|
|
|
display: 'flex',
|
|
|
clear: 'both',
|
|
|
width: '100%',
|
|
|
minWidth: '100%',
|
|
|
margin: `${token.dividerHorizontalGutterMargin}px 0`
|
|
|
},
|
|
|
[`&-horizontal${componentCls}-with-text`]: {
|
|
|
display: 'flex',
|
|
|
alignItems: 'center',
|
|
|
margin: `${token.dividerHorizontalWithTextGutterMargin}px 0`,
|
|
|
color: token.colorTextHeading,
|
|
|
fontWeight: 500,
|
|
|
fontSize: token.fontSizeLG,
|
|
|
whiteSpace: 'nowrap',
|
|
|
textAlign: 'center',
|
|
|
borderBlockStart: `0 ${colorSplit}`,
|
|
|
'&::before, &::after': {
|
|
|
position: 'relative',
|
|
|
width: '50%',
|
|
|
borderBlockStart: `${lineWidth}px solid transparent`,
|
|
|
// Chrome not accept `inherit` in `border-top`
|
|
|
borderBlockStartColor: 'inherit',
|
|
|
borderBlockEnd: 0,
|
|
|
transform: 'translateY(50%)',
|
|
|
content: "''"
|
|
|
}
|
|
|
},
|
|
|
[`&-horizontal${componentCls}-with-text-left`]: {
|
|
|
'&::before': {
|
|
|
width: '5%'
|
|
|
},
|
|
|
'&::after': {
|
|
|
width: '95%'
|
|
|
}
|
|
|
},
|
|
|
[`&-horizontal${componentCls}-with-text-right`]: {
|
|
|
'&::before': {
|
|
|
width: '95%'
|
|
|
},
|
|
|
'&::after': {
|
|
|
width: '5%'
|
|
|
}
|
|
|
},
|
|
|
[`${componentCls}-inner-text`]: {
|
|
|
display: 'inline-block',
|
|
|
padding: '0 1em'
|
|
|
},
|
|
|
'&-dashed': {
|
|
|
background: 'none',
|
|
|
borderColor: colorSplit,
|
|
|
borderStyle: 'dashed',
|
|
|
borderWidth: `${lineWidth}px 0 0`
|
|
|
},
|
|
|
[`&-horizontal${componentCls}-with-text${componentCls}-dashed`]: {
|
|
|
'&::before, &::after': {
|
|
|
borderStyle: 'dashed none none'
|
|
|
}
|
|
|
},
|
|
|
[`&-vertical${componentCls}-dashed`]: {
|
|
|
borderInlineStartWidth: lineWidth,
|
|
|
borderInlineEnd: 0,
|
|
|
borderBlockStart: 0,
|
|
|
borderBlockEnd: 0
|
|
|
},
|
|
|
[`&-plain${componentCls}-with-text`]: {
|
|
|
color: token.colorText,
|
|
|
fontWeight: 'normal',
|
|
|
fontSize: token.fontSize
|
|
|
},
|
|
|
[`&-horizontal${componentCls}-with-text-left${componentCls}-no-default-orientation-margin-left`]: {
|
|
|
'&::before': {
|
|
|
width: 0
|
|
|
},
|
|
|
'&::after': {
|
|
|
width: '100%'
|
|
|
},
|
|
|
[`${componentCls}-inner-text`]: {
|
|
|
paddingInlineStart: sizePaddingEdgeHorizontal
|
|
|
}
|
|
|
},
|
|
|
[`&-horizontal${componentCls}-with-text-right${componentCls}-no-default-orientation-margin-right`]: {
|
|
|
'&::before': {
|
|
|
width: '100%'
|
|
|
},
|
|
|
'&::after': {
|
|
|
width: 0
|
|
|
},
|
|
|
[`${componentCls}-inner-text`]: {
|
|
|
paddingInlineEnd: sizePaddingEdgeHorizontal
|
|
|
}
|
|
|
}
|
|
|
})
|
|
|
};
|
|
|
};
|
|
|
// ============================== Export ==============================
|
|
|
/* harmony default export */ var divider_style = ((0,genComponentStyleHook/* default */.Z)('Divider', token => {
|
|
|
const dividerToken = (0,statistic/* merge */.TS)(token, {
|
|
|
dividerVerticalGutterMargin: token.marginXS,
|
|
|
dividerHorizontalWithTextGutterMargin: token.margin,
|
|
|
dividerHorizontalGutterMargin: token.marginLG
|
|
|
});
|
|
|
return [genSharedDividerStyle(dividerToken)];
|
|
|
}, {
|
|
|
sizePaddingEdgeHorizontal: 0
|
|
|
}));
|
|
|
;// CONCATENATED MODULE: ./node_modules/antd/es/divider/index.js
|
|
|
'use client';
|
|
|
|
|
|
var __rest = undefined && undefined.__rest || function (s, e) {
|
|
|
var t = {};
|
|
|
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0) t[p] = s[p];
|
|
|
if (s != null && typeof Object.getOwnPropertySymbols === "function") for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
|
|
|
if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i])) t[p[i]] = s[p[i]];
|
|
|
}
|
|
|
return t;
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
const Divider = props => {
|
|
|
const {
|
|
|
getPrefixCls,
|
|
|
direction,
|
|
|
divider
|
|
|
} = react.useContext(context/* ConfigContext */.E_);
|
|
|
const {
|
|
|
prefixCls: customizePrefixCls,
|
|
|
type = 'horizontal',
|
|
|
orientation = 'center',
|
|
|
orientationMargin,
|
|
|
className,
|
|
|
rootClassName,
|
|
|
children,
|
|
|
dashed,
|
|
|
plain,
|
|
|
style
|
|
|
} = props,
|
|
|
restProps = __rest(props, ["prefixCls", "type", "orientation", "orientationMargin", "className", "rootClassName", "children", "dashed", "plain", "style"]);
|
|
|
const prefixCls = getPrefixCls('divider', customizePrefixCls);
|
|
|
const [wrapSSR, hashId] = divider_style(prefixCls);
|
|
|
const orientationPrefix = orientation.length > 0 ? `-${orientation}` : orientation;
|
|
|
const hasChildren = !!children;
|
|
|
const hasCustomMarginLeft = orientation === 'left' && orientationMargin != null;
|
|
|
const hasCustomMarginRight = orientation === 'right' && orientationMargin != null;
|
|
|
const classString = classnames_default()(prefixCls, divider === null || divider === void 0 ? void 0 : divider.className, hashId, `${prefixCls}-${type}`, {
|
|
|
[`${prefixCls}-with-text`]: hasChildren,
|
|
|
[`${prefixCls}-with-text${orientationPrefix}`]: hasChildren,
|
|
|
[`${prefixCls}-dashed`]: !!dashed,
|
|
|
[`${prefixCls}-plain`]: !!plain,
|
|
|
[`${prefixCls}-rtl`]: direction === 'rtl',
|
|
|
[`${prefixCls}-no-default-orientation-margin-left`]: hasCustomMarginLeft,
|
|
|
[`${prefixCls}-no-default-orientation-margin-right`]: hasCustomMarginRight
|
|
|
}, className, rootClassName);
|
|
|
const memoizedOrientationMargin = react.useMemo(() => {
|
|
|
if (typeof orientationMargin === 'number') {
|
|
|
return orientationMargin;
|
|
|
}
|
|
|
if (/^\d+$/.test(orientationMargin)) {
|
|
|
return Number(orientationMargin);
|
|
|
}
|
|
|
return orientationMargin;
|
|
|
}, [orientationMargin]);
|
|
|
const innerStyle = Object.assign(Object.assign({}, hasCustomMarginLeft && {
|
|
|
marginLeft: memoizedOrientationMargin
|
|
|
}), hasCustomMarginRight && {
|
|
|
marginRight: memoizedOrientationMargin
|
|
|
});
|
|
|
// Warning children not work in vertical mode
|
|
|
if (false) {}
|
|
|
return wrapSSR( /*#__PURE__*/react.createElement("div", Object.assign({
|
|
|
className: classString,
|
|
|
style: Object.assign(Object.assign({}, divider === null || divider === void 0 ? void 0 : divider.style), style)
|
|
|
}, restProps, {
|
|
|
role: "separator"
|
|
|
}), children && type !== 'vertical' && /*#__PURE__*/react.createElement("span", {
|
|
|
className: `${prefixCls}-inner-text`,
|
|
|
style: innerStyle
|
|
|
}, children)));
|
|
|
};
|
|
|
if (false) {}
|
|
|
/* harmony default export */ var divider = (Divider);
|
|
|
|
|
|
/***/ }),
|
|
|
|
|
|
/***/ 19575:
|
|
|
/*!******************************************!*\
|
|
|
!*** ./node_modules/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}
|
|
|
}));
|
|
|
|
|
|
|
|
|
/***/ })
|
|
|
|
|
|
}]); |