|
|
"use strict";
|
|
|
(self["webpackChunk"] = self["webpackChunk"] || []).push([[53247,12768,60696],{
|
|
|
|
|
|
/***/ 23430:
|
|
|
/*!*********************************************************************************!*\
|
|
|
!*** ./node_modules/@ant-design/icons/es/icons/DownloadOutlined.js + 1 modules ***!
|
|
|
\*********************************************************************************/
|
|
|
/***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) {
|
|
|
|
|
|
|
|
|
// EXPORTS
|
|
|
__webpack_require__.d(__webpack_exports__, {
|
|
|
"Z": function() { return /* binding */ icons_DownloadOutlined; }
|
|
|
});
|
|
|
|
|
|
// 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/DownloadOutlined.js
|
|
|
// This icon file is generated automatically.
|
|
|
var DownloadOutlined = { "icon": { "tag": "svg", "attrs": { "viewBox": "64 64 896 896", "focusable": "false" }, "children": [{ "tag": "path", "attrs": { "d": "M505.7 661a8 8 0 0012.6 0l112-141.7c4.1-5.2.4-12.9-6.3-12.9h-74.1V168c0-4.4-3.6-8-8-8h-60c-4.4 0-8 3.6-8 8v338.3H400c-6.7 0-10.4 7.7-6.3 12.9l112 141.8zM878 626h-60c-4.4 0-8 3.6-8 8v154H214V634c0-4.4-3.6-8-8-8h-60c-4.4 0-8 3.6-8 8v198c0 17.7 14.3 32 32 32h684c17.7 0 32-14.3 32-32V634c0-4.4-3.6-8-8-8z" } }] }, "name": "download", "theme": "outlined" };
|
|
|
/* harmony default export */ var asn_DownloadOutlined = (DownloadOutlined);
|
|
|
|
|
|
// 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/DownloadOutlined.js
|
|
|
|
|
|
// GENERATE BY ./scripts/generate.ts
|
|
|
// DON NOT EDIT IT MANUALLY
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
var DownloadOutlined_DownloadOutlined = function DownloadOutlined(props, ref) {
|
|
|
return /*#__PURE__*/react.createElement(AntdIcon/* default */.Z, (0,esm_extends/* default */.Z)({}, props, {
|
|
|
ref: ref,
|
|
|
icon: asn_DownloadOutlined
|
|
|
}));
|
|
|
};
|
|
|
if (false) {}
|
|
|
/* harmony default export */ var icons_DownloadOutlined = (/*#__PURE__*/react.forwardRef(DownloadOutlined_DownloadOutlined));
|
|
|
|
|
|
/***/ }),
|
|
|
|
|
|
/***/ 48559:
|
|
|
/*!**********************************************!*\
|
|
|
!*** ./src/components/AsyncButton/index.tsx ***!
|
|
|
\**********************************************/
|
|
|
/***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) {
|
|
|
|
|
|
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
|
|
|
/* harmony export */ "Z": function() { return /* binding */ AsyncButton; }
|
|
|
/* 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_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_asyncToGenerator_js__WEBPACK_IMPORTED_MODULE_2__ = __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_2___default = /*#__PURE__*/__webpack_require__.n(_root_workspace_ppte5yg23_local_v9_node_modules_babel_runtime_helpers_asyncToGenerator_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 _root_workspace_ppte5yg23_local_v9_node_modules_babel_runtime_helpers_objectWithoutProperties_js__WEBPACK_IMPORTED_MODULE_4__ = __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_4___default = /*#__PURE__*/__webpack_require__.n(_root_workspace_ppte5yg23_local_v9_node_modules_babel_runtime_helpers_objectWithoutProperties_js__WEBPACK_IMPORTED_MODULE_4__);
|
|
|
/* harmony import */ var antd__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! antd */ 71577);
|
|
|
/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! react */ 67294);
|
|
|
/* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! react/jsx-runtime */ 85893);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
var _excluded = ["children"];
|
|
|
|
|
|
|
|
|
|
|
|
var AsyncButton = function AsyncButton(_ref) {
|
|
|
var children = _ref.children,
|
|
|
props = _root_workspace_ppte5yg23_local_v9_node_modules_babel_runtime_helpers_objectWithoutProperties_js__WEBPACK_IMPORTED_MODULE_4___default()(_ref, _excluded);
|
|
|
var _useState = (0,react__WEBPACK_IMPORTED_MODULE_5__.useState)(false),
|
|
|
_useState2 = _root_workspace_ppte5yg23_local_v9_node_modules_babel_runtime_helpers_slicedToArray_js__WEBPACK_IMPORTED_MODULE_3___default()(_useState, 2),
|
|
|
btnLoading = _useState2[0],
|
|
|
setBtnLoading = _useState2[1];
|
|
|
return /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_6__.jsx)(antd__WEBPACK_IMPORTED_MODULE_7__/* ["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()({}, props), {}, {
|
|
|
loading: btnLoading,
|
|
|
onClick: /*#__PURE__*/function () {
|
|
|
var _ref2 = _root_workspace_ppte5yg23_local_v9_node_modules_babel_runtime_helpers_asyncToGenerator_js__WEBPACK_IMPORTED_MODULE_2___default()( /*#__PURE__*/_root_workspace_ppte5yg23_local_v9_node_modules_babel_runtime_helpers_regeneratorRuntime_js__WEBPACK_IMPORTED_MODULE_1___default()().mark(function _callee(e) {
|
|
|
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:
|
|
|
_context.prev = 0;
|
|
|
setBtnLoading(true);
|
|
|
_context.next = 4;
|
|
|
return props.onClick(e);
|
|
|
case 4:
|
|
|
setBtnLoading(false);
|
|
|
_context.next = 11;
|
|
|
break;
|
|
|
case 7:
|
|
|
_context.prev = 7;
|
|
|
_context.t0 = _context["catch"](0);
|
|
|
console.error(_context.t0);
|
|
|
setBtnLoading(false);
|
|
|
case 11:
|
|
|
case "end":
|
|
|
return _context.stop();
|
|
|
}
|
|
|
}, _callee, null, [[0, 7]]);
|
|
|
}));
|
|
|
return function (_x) {
|
|
|
return _ref2.apply(this, arguments);
|
|
|
};
|
|
|
}(),
|
|
|
children: children
|
|
|
}));
|
|
|
};
|
|
|
|
|
|
/***/ }),
|
|
|
|
|
|
/***/ 45983:
|
|
|
/*!**************************************************************************!*\
|
|
|
!*** ./src/components/EcListItems/Problemset/Card/index.tsx + 1 modules ***!
|
|
|
\**************************************************************************/
|
|
|
/***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) {
|
|
|
|
|
|
|
|
|
// EXPORTS
|
|
|
__webpack_require__.d(__webpack_exports__, {
|
|
|
"Z": function() { return /* binding */ Problemset_Card; }
|
|
|
});
|
|
|
|
|
|
// 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/antd/es/radio/index.js + 5 modules
|
|
|
var es_radio = __webpack_require__(78045);
|
|
|
// EXTERNAL MODULE: ./src/components/RenderHtml/index.tsx + 1 modules
|
|
|
var RenderHtml = __webpack_require__(12768);
|
|
|
;// CONCATENATED MODULE: ./src/components/EcListItems/Problemset/Card/index.less?modules
|
|
|
// extracted by mini-css-extract-plugin
|
|
|
/* harmony default export */ var Cardmodules = ({"flexRow":"flexRow____Sm4b","flexColumn":"flexColumn___mQNZs","action":"action___QUVEn","setScore":"setScore___yZ0Yb","delete":"delete___e4taL","content":"content___jR4Y6","titleWrap":"titleWrap___zsXYY","titleNumber":"titleNumber___p60vi","score":"score___DbCHw","titleHtml":"titleHtml___FALbj","answerWrap":"answerWrap___uPjYq","answer":"answer___pfiPk","answerText":"answerText___K3TNr"});
|
|
|
// EXTERNAL MODULE: ./node_modules/js-base64/base64.js
|
|
|
var base64 = __webpack_require__(19575);
|
|
|
// EXTERNAL MODULE: ./node_modules/react/jsx-runtime.js
|
|
|
var jsx_runtime = __webpack_require__(85893);
|
|
|
;// CONCATENATED MODULE: ./src/components/EcListItems/Problemset/Card/index.tsx
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// import Item from '@/pages/Forums/Index/components/Item';
|
|
|
|
|
|
|
|
|
|
|
|
var tagDotList = ['A.', 'B.', 'C.', 'D.', 'E.', 'F.', 'G.', 'H.', 'I.', 'J.', 'K.', 'L.', 'M.', 'N.', 'O.', 'P.', 'Q.', 'R.', 'S.', 'T.', 'U.', 'V.', 'W.', 'X.', 'Y.', 'Z.'];
|
|
|
var Card = function Card(_ref) {
|
|
|
var _data$program_attr3;
|
|
|
var index = _ref.index,
|
|
|
typeName = _ref.typeName,
|
|
|
type = _ref.type,
|
|
|
_ref$data = _ref.data,
|
|
|
data = _ref$data === void 0 ? {} : _ref$data,
|
|
|
inMouseId = _ref.inMouseId,
|
|
|
isshow = _ref.isshow,
|
|
|
_ref$onSetScore = _ref.onSetScore,
|
|
|
onSetScore = _ref$onSetScore === void 0 ? function () {} : _ref$onSetScore,
|
|
|
_ref$onDelete = _ref.onDelete,
|
|
|
onDelete = _ref$onDelete === void 0 ? function () {} : _ref$onDelete,
|
|
|
_ref$onMouseEnter = _ref.onMouseEnter,
|
|
|
_onMouseEnter = _ref$onMouseEnter === void 0 ? function () {} : _ref$onMouseEnter,
|
|
|
_ref$showAnswer = _ref.showAnswer,
|
|
|
showAnswer = _ref$showAnswer === void 0 ? false : _ref$showAnswer;
|
|
|
var _useState = (0,react.useState)(false),
|
|
|
_useState2 = slicedToArray_default()(_useState, 2),
|
|
|
isopen = _useState2[0],
|
|
|
setisopen = _useState2[1];
|
|
|
var renderSingleOrMultiple = function renderSingleOrMultiple() {
|
|
|
var _data$choices;
|
|
|
return /*#__PURE__*/(0,jsx_runtime.jsxs)("div", {
|
|
|
className: Cardmodules.answerWrap,
|
|
|
children: [data === null || data === void 0 ? void 0 : (_data$choices = data.choices) === null || _data$choices === void 0 ? void 0 : _data$choices.map(function (item, index) {
|
|
|
return /*#__PURE__*/(0,jsx_runtime.jsxs)("div", {
|
|
|
className: "".concat(Cardmodules.flexRow, " mt15"),
|
|
|
children: [/*#__PURE__*/(0,jsx_runtime.jsx)("div", {
|
|
|
style: {
|
|
|
lineHeight: '24px',
|
|
|
flexShrink: 0
|
|
|
},
|
|
|
children: tagDotList[index]
|
|
|
}), /*#__PURE__*/(0,jsx_runtime.jsx)("div", {
|
|
|
className: "".concat(Cardmodules.answer, " ml5"),
|
|
|
children: /*#__PURE__*/(0,jsx_runtime.jsx)(RenderHtml/* default */.Z, {
|
|
|
value: item === null || item === void 0 ? void 0 : item.choice_text
|
|
|
})
|
|
|
})]
|
|
|
}, index);
|
|
|
}), showAnswer && /*#__PURE__*/(0,jsx_runtime.jsxs)("div", {
|
|
|
className: "mt10 ".concat(Cardmodules.answerText),
|
|
|
children: ["\u53C2\u8003\u7B54\u6848\uFF1A", data === null || data === void 0 ? void 0 : data.standard_answer_show]
|
|
|
})]
|
|
|
});
|
|
|
};
|
|
|
var renderJudgment = function renderJudgment() {
|
|
|
var _data$choices2;
|
|
|
return /*#__PURE__*/(0,jsx_runtime.jsxs)("div", {
|
|
|
className: Cardmodules.answerWrap,
|
|
|
children: [/*#__PURE__*/(0,jsx_runtime.jsx)("div", {
|
|
|
className: "".concat(Cardmodules.flexRow, " mt15"),
|
|
|
children: data === null || data === void 0 ? void 0 : (_data$choices2 = data.choices) === null || _data$choices2 === void 0 ? void 0 : _data$choices2.map(function (item, index) {
|
|
|
return /*#__PURE__*/(0,jsx_runtime.jsx)(es_radio/* default */.ZP, {
|
|
|
disabled: true,
|
|
|
children: item === null || item === void 0 ? void 0 : item.choice_text
|
|
|
}, index);
|
|
|
})
|
|
|
}), showAnswer && /*#__PURE__*/(0,jsx_runtime.jsxs)("div", {
|
|
|
className: "mt10 ".concat(Cardmodules.answerText),
|
|
|
children: ["\u53C2\u8003\u7B54\u6848\uFF1A", data === null || data === void 0 ? void 0 : data.standard_answer_show]
|
|
|
})]
|
|
|
});
|
|
|
};
|
|
|
var renderProgram = function renderProgram() {
|
|
|
var _data$program_attr;
|
|
|
return /*#__PURE__*/(0,jsx_runtime.jsxs)("div", {
|
|
|
className: Cardmodules.answerWrap,
|
|
|
children: [/*#__PURE__*/(0,jsx_runtime.jsx)("div", {
|
|
|
className: "".concat(Cardmodules.flexRow, " mt15"),
|
|
|
children: /*#__PURE__*/(0,jsx_runtime.jsx)(RenderHtml/* default */.Z, {
|
|
|
value: data === null || data === void 0 ? void 0 : (_data$program_attr = data.program_attr) === null || _data$program_attr === void 0 ? void 0 : _data$program_attr.description
|
|
|
})
|
|
|
}), showAnswer && /*#__PURE__*/(0,jsx_runtime.jsxs)("div", {
|
|
|
className: "mt15",
|
|
|
children: [/*#__PURE__*/(0,jsx_runtime.jsx)("div", {
|
|
|
children: "\u53C2\u8003\u7B54\u6848\uFF1A"
|
|
|
}), /*#__PURE__*/(0,jsx_runtime.jsx)(RenderHtml/* default */.Z, {
|
|
|
value: (data === null || data === void 0 ? void 0 : data.answer_text) || ''
|
|
|
})]
|
|
|
})]
|
|
|
});
|
|
|
};
|
|
|
var renderCompletion = function renderCompletion() {
|
|
|
var _data$standard_answer;
|
|
|
return /*#__PURE__*/(0,jsx_runtime.jsx)("div", {
|
|
|
className: Cardmodules.answerWrap,
|
|
|
children: showAnswer && /*#__PURE__*/(0,jsx_runtime.jsx)("div", {
|
|
|
className: "".concat(Cardmodules.flexColumn, " mt15"),
|
|
|
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, index) {
|
|
|
return /*#__PURE__*/(0,jsx_runtime.jsx)(RenderHtml/* default */.Z, {
|
|
|
value: "\u53C2\u8003\u7B54\u6848\uFF08\u586B\u7A7A".concat(item.position, "\uFF09\uFF1A").concat(item.answer_text.join("、"))
|
|
|
}, index);
|
|
|
})
|
|
|
})
|
|
|
});
|
|
|
};
|
|
|
var renderSubjective = function renderSubjective() {
|
|
|
var _data$answer_texts;
|
|
|
return /*#__PURE__*/(0,jsx_runtime.jsx)("div", {
|
|
|
className: Cardmodules.answerWrap,
|
|
|
children: showAnswer && /*#__PURE__*/(0,jsx_runtime.jsxs)("div", {
|
|
|
className: "mt15",
|
|
|
children: [/*#__PURE__*/(0,jsx_runtime.jsx)("div", {
|
|
|
children: "\u53C2\u8003\u7B54\u6848\uFF1A"
|
|
|
}), /*#__PURE__*/(0,jsx_runtime.jsx)(RenderHtml/* default */.Z, {
|
|
|
value: data === null || data === void 0 ? void 0 : (_data$answer_texts = data.answer_texts) === null || _data$answer_texts === void 0 ? void 0 : _data$answer_texts[0]
|
|
|
})]
|
|
|
})
|
|
|
});
|
|
|
};
|
|
|
var renderBProgram = function renderBProgram() {
|
|
|
var _data$program_attr2, _data$standard_answer2;
|
|
|
return /*#__PURE__*/(0,jsx_runtime.jsxs)("div", {
|
|
|
className: Cardmodules.answerWrap,
|
|
|
style: {
|
|
|
marginTop: 10
|
|
|
},
|
|
|
children: [/*#__PURE__*/(0,jsx_runtime.jsx)(RenderHtml/* default */.Z, {
|
|
|
value: base64.Base64.decode(data === null || data === void 0 ? void 0 : (_data$program_attr2 = data.program_attr) === null || _data$program_attr2 === void 0 ? void 0 : _data$program_attr2.code)
|
|
|
}), showAnswer && /*#__PURE__*/(0,jsx_runtime.jsx)("div", {
|
|
|
className: "".concat(Cardmodules.flexColumn, " mt15"),
|
|
|
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, index) {
|
|
|
return /*#__PURE__*/(0,jsx_runtime.jsx)(RenderHtml/* default */.Z, {
|
|
|
value: "\u53C2\u8003\u7B54\u6848\uFF08\u586B\u7A7A".concat(item.position, "\uFF09\uFF1A").concat(item.answer_text)
|
|
|
}, index);
|
|
|
})
|
|
|
})]
|
|
|
});
|
|
|
};
|
|
|
var renderShixun = function renderShixun() {
|
|
|
var _data$shixun;
|
|
|
return /*#__PURE__*/(0,jsx_runtime.jsxs)("div", {
|
|
|
className: Cardmodules.answerWrap,
|
|
|
children: [/*#__PURE__*/(0,jsx_runtime.jsx)("div", {
|
|
|
className: "mt10",
|
|
|
children: "\u5173\u5361"
|
|
|
}), data === null || data === void 0 ? void 0 : (_data$shixun = data.shixun) === null || _data$shixun === void 0 ? void 0 : _data$shixun.map(function (item, index) {
|
|
|
return /*#__PURE__*/(0,jsx_runtime.jsxs)("div", {
|
|
|
className: "mt10 font14",
|
|
|
children: [index + 1, ". ", item === null || item === void 0 ? void 0 : item.challenge_name]
|
|
|
}, index);
|
|
|
})]
|
|
|
});
|
|
|
};
|
|
|
var renderCombination = function renderCombination() {
|
|
|
var _data$sub_questions;
|
|
|
return /*#__PURE__*/(0,jsx_runtime.jsx)("div", {
|
|
|
className: Cardmodules.answerWrap,
|
|
|
style: {
|
|
|
display: isopen && 'none'
|
|
|
},
|
|
|
children: data === null || data === void 0 ? void 0 : (_data$sub_questions = data.sub_questions) === null || _data$sub_questions === void 0 ? void 0 : _data$sub_questions.map(function (e, i) {
|
|
|
var _e$choices;
|
|
|
var str = "<span style=\"margin-right: 10px\">".concat(index + 1, ".").concat(i + 1, "</span><span>\uFF08\u5355\u9009\u9898\uFF09</span><span class=\"c-grey-999\">\uFF08").concat(e.score, "\u5206\uFF09</span>");
|
|
|
return /*#__PURE__*/(0,jsx_runtime.jsxs)(react.Fragment, {
|
|
|
children: [/*#__PURE__*/(0,jsx_runtime.jsx)("div", {
|
|
|
className: Cardmodules.titleWrap,
|
|
|
style: {
|
|
|
marginTop: 16
|
|
|
},
|
|
|
children: /*#__PURE__*/(0,jsx_runtime.jsx)(RenderHtml/* default */.Z, {
|
|
|
className: Cardmodules.titleHtml,
|
|
|
value: str + e.name
|
|
|
})
|
|
|
}), e === null || e === void 0 ? void 0 : (_e$choices = e.choices) === null || _e$choices === void 0 ? void 0 : _e$choices.map(function (item, index) {
|
|
|
return /*#__PURE__*/(0,jsx_runtime.jsxs)("div", {
|
|
|
className: "".concat(Cardmodules.flexRow, " mt15"),
|
|
|
children: [/*#__PURE__*/(0,jsx_runtime.jsx)("div", {
|
|
|
style: {
|
|
|
lineHeight: '24px',
|
|
|
flexShrink: 0
|
|
|
},
|
|
|
children: tagDotList[index]
|
|
|
}), /*#__PURE__*/(0,jsx_runtime.jsx)("div", {
|
|
|
className: "".concat(Cardmodules.answer, " ml5"),
|
|
|
children: /*#__PURE__*/(0,jsx_runtime.jsx)(RenderHtml/* default */.Z, {
|
|
|
value: item === null || item === void 0 ? void 0 : item.choice_text
|
|
|
})
|
|
|
})]
|
|
|
}, index);
|
|
|
}), showAnswer && /*#__PURE__*/(0,jsx_runtime.jsxs)("div", {
|
|
|
className: "mt10 ".concat(Cardmodules.answerText),
|
|
|
children: ["\u53C2\u8003\u7B54\u6848\uFF1A", e === null || e === void 0 ? void 0 : e.standard_answer_show]
|
|
|
})]
|
|
|
}, e === null || e === void 0 ? void 0 : e.id);
|
|
|
})
|
|
|
});
|
|
|
};
|
|
|
var renderAnswer = function renderAnswer() {
|
|
|
var mapping = {
|
|
|
'SINGLE': renderSingleOrMultiple,
|
|
|
'MULTIPLE': renderSingleOrMultiple,
|
|
|
'JUDGMENT': renderJudgment,
|
|
|
'PROGRAM': renderProgram,
|
|
|
'COMPLETION': renderCompletion,
|
|
|
'SUBJECTIVE': renderSubjective,
|
|
|
'PRACTICAL': renderShixun,
|
|
|
'COMBINATION': renderCombination,
|
|
|
'BPROGRAM': renderBProgram
|
|
|
};
|
|
|
return mapping[type] ? mapping[type]() : null;
|
|
|
};
|
|
|
var getDomString = function getDomString(data, i) {
|
|
|
var _data$sub_questions2;
|
|
|
var str = "<span style=\"margin-right: -10px\">".concat(i + 1, "\u3001</span><span class=\"c-grey-999\">\uFF08").concat((data === null || data === void 0 ? void 0 : data.item_type) === "combination" ? "\u5171".concat(data === null || data === void 0 ? void 0 : (_data$sub_questions2 = data.sub_questions) === null || _data$sub_questions2 === void 0 ? void 0 : _data$sub_questions2.length, "\u5C0F\u9898\uFF0C") : '').concat(data.score, "\u5206\uFF09</span> ");
|
|
|
return str;
|
|
|
};
|
|
|
return /*#__PURE__*/(0,jsx_runtime.jsxs)("div", {
|
|
|
onMouseEnter: function onMouseEnter() {
|
|
|
return _onMouseEnter(data.id);
|
|
|
},
|
|
|
children: [inMouseId === data.id && /*#__PURE__*/(0,jsx_runtime.jsxs)("div", {
|
|
|
className: Cardmodules.action,
|
|
|
children: [/*#__PURE__*/(0,jsx_runtime.jsx)("div", {
|
|
|
className: Cardmodules.setScore,
|
|
|
onClick: function onClick() {
|
|
|
return onSetScore(data.id, typeName, data === null || data === void 0 ? void 0 : data.shixun, data.score, data);
|
|
|
},
|
|
|
children: "\u8BBE\u7F6E\u5F97\u5206"
|
|
|
}), /*#__PURE__*/(0,jsx_runtime.jsx)("div", {
|
|
|
className: Cardmodules["delete"],
|
|
|
onClick: function onClick() {
|
|
|
return onDelete(data.id);
|
|
|
},
|
|
|
children: "\u5220\u9664"
|
|
|
})]
|
|
|
}), /*#__PURE__*/(0,jsx_runtime.jsxs)("div", {
|
|
|
className: Cardmodules.content,
|
|
|
children: [/*#__PURE__*/(0,jsx_runtime.jsxs)("div", {
|
|
|
className: Cardmodules.titleWrap,
|
|
|
style: {
|
|
|
justifyContent: 'space-between'
|
|
|
},
|
|
|
children: [(data === null || data === void 0 ? void 0 : data.item_type) === "bprogram" ? /*#__PURE__*/(0,jsx_runtime.jsx)(RenderHtml/* default */.Z, {
|
|
|
className: Cardmodules.titleHtml,
|
|
|
value: getDomString(data, index) + (data === null || data === void 0 ? void 0 : (_data$program_attr3 = data.program_attr) === null || _data$program_attr3 === void 0 ? void 0 : _data$program_attr3.description)
|
|
|
}) : /*#__PURE__*/(0,jsx_runtime.jsx)(RenderHtml/* default */.Z, {
|
|
|
className: Cardmodules.titleHtml,
|
|
|
value: getDomString(data, index) + ((data === null || data === void 0 ? void 0 : data.item_type) === "combination" ? "\uFF08\u9898\u5E72\uFF09" : '') + (data.name || (data === null || data === void 0 ? void 0 : data.shixun_name))
|
|
|
}), (data === null || data === void 0 ? void 0 : data.item_type) === "combination" && !isshow && /*#__PURE__*/(0,jsx_runtime.jsx)("span", {
|
|
|
onClick: function onClick(e) {
|
|
|
setisopen(!isopen);
|
|
|
},
|
|
|
style: {
|
|
|
textAlign: 'end',
|
|
|
flexShrink: 0
|
|
|
},
|
|
|
children: isopen ? '展开' : '收起'
|
|
|
})]
|
|
|
}), renderAnswer()]
|
|
|
})]
|
|
|
});
|
|
|
};
|
|
|
/* harmony default export */ var Problemset_Card = (Card);
|
|
|
|
|
|
/***/ }),
|
|
|
|
|
|
/***/ 36845:
|
|
|
/*!**********************************************************!*\
|
|
|
!*** ./src/components/FixedButton/index.tsx + 1 modules ***!
|
|
|
\**********************************************************/
|
|
|
/***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) {
|
|
|
|
|
|
|
|
|
// EXPORTS
|
|
|
__webpack_require__.d(__webpack_exports__, {
|
|
|
"t": function() { return /* binding */ FixedButton; }
|
|
|
});
|
|
|
|
|
|
// 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/react/index.js
|
|
|
var react = __webpack_require__(67294);
|
|
|
// EXTERNAL MODULE: ./node_modules/antd/es/button/index.js
|
|
|
var es_button = __webpack_require__(71577);
|
|
|
;// CONCATENATED MODULE: ./src/components/FixedButton/index.less?modules
|
|
|
// extracted by mini-css-extract-plugin
|
|
|
/* harmony default export */ var FixedButtonmodules = ({"buttonFixed":"buttonFixed___vyq30","button":"button___hxmYv","buttonWrap":"buttonWrap___uK8dl"});
|
|
|
// 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/jsx-runtime.js
|
|
|
var jsx_runtime = __webpack_require__(85893);
|
|
|
;// CONCATENATED MODULE: ./src/components/FixedButton/index.tsx
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
var FixedButton = function FixedButton(_ref) {
|
|
|
var _ref$cancelText = _ref.cancelText,
|
|
|
cancelText = _ref$cancelText === void 0 ? '取消' : _ref$cancelText,
|
|
|
_ref$okText = _ref.okText,
|
|
|
okText = _ref$okText === void 0 ? '确定' : _ref$okText,
|
|
|
_ref$loading = _ref.loading,
|
|
|
loading = _ref$loading === void 0 ? false : _ref$loading,
|
|
|
_ref$hasOkBtn = _ref.hasOkBtn,
|
|
|
hasOkBtn = _ref$hasOkBtn === void 0 ? true : _ref$hasOkBtn,
|
|
|
_ref$hasCancelBtn = _ref.hasCancelBtn,
|
|
|
hasCancelBtn = _ref$hasCancelBtn === void 0 ? true : _ref$hasCancelBtn,
|
|
|
_ref$okButtonProps = _ref.okButtonProps,
|
|
|
okButtonProps = _ref$okButtonProps === void 0 ? {} : _ref$okButtonProps,
|
|
|
_ref$onCancel = _ref.onCancel,
|
|
|
onCancel = _ref$onCancel === void 0 ? function () {} : _ref$onCancel,
|
|
|
_ref$onOk = _ref.onOk,
|
|
|
onOk = _ref$onOk === void 0 ? function () {} : _ref$onOk,
|
|
|
_ref$className = _ref.className,
|
|
|
className = _ref$className === void 0 ? '' : _ref$className;
|
|
|
return /*#__PURE__*/(0,jsx_runtime.jsx)("div", {
|
|
|
className: classnames_default()(FixedButtonmodules.buttonFixed, className),
|
|
|
children: /*#__PURE__*/(0,jsx_runtime.jsxs)("div", {
|
|
|
className: FixedButtonmodules.buttonWrap,
|
|
|
children: [hasCancelBtn && /*#__PURE__*/(0,jsx_runtime.jsx)(es_button/* default */.ZP, {
|
|
|
size: "middle",
|
|
|
className: "".concat(FixedButtonmodules.button, " mr20")
|
|
|
// 点击取消的返回
|
|
|
,
|
|
|
onClick: onCancel,
|
|
|
children: cancelText
|
|
|
}), hasOkBtn && /*#__PURE__*/(0,jsx_runtime.jsx)(es_button/* default */.ZP, objectSpread2_default()(objectSpread2_default()({
|
|
|
size: 'middle',
|
|
|
type: "primary",
|
|
|
className: "".concat(FixedButtonmodules.button, " mr20"),
|
|
|
loading: loading,
|
|
|
onClick: onOk
|
|
|
}, okButtonProps), {}, {
|
|
|
children: okText
|
|
|
}))]
|
|
|
})
|
|
|
});
|
|
|
};
|
|
|
|
|
|
/***/ }),
|
|
|
|
|
|
/***/ 82982:
|
|
|
/*!*****************************************!*\
|
|
|
!*** ./src/components/NoData/index.tsx ***!
|
|
|
\*****************************************/
|
|
|
/***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) {
|
|
|
|
|
|
/* 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__) {
|
|
|
|
|
|
|
|
|
// 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__) {
|
|
|
|
|
|
|
|
|
// 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("");
|
|
|
}
|
|
|
})]
|
|
|
});
|
|
|
});
|
|
|
|
|
|
/***/ }),
|
|
|
|
|
|
/***/ 60696:
|
|
|
/*!***************************************************************!*\
|
|
|
!*** ./src/components/ReuseShixunModal/index.tsx + 1 modules ***!
|
|
|
\***************************************************************/
|
|
|
/***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) {
|
|
|
|
|
|
|
|
|
// EXPORTS
|
|
|
__webpack_require__.d(__webpack_exports__, {
|
|
|
"Z": function() { return /* binding */ components_ReuseShixunModal; },
|
|
|
"P": function() { return /* binding */ useReuseModal; }
|
|
|
});
|
|
|
|
|
|
// 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/objectWithoutProperties.js
|
|
|
var objectWithoutProperties = __webpack_require__(70215);
|
|
|
var objectWithoutProperties_default = /*#__PURE__*/__webpack_require__.n(objectWithoutProperties);
|
|
|
// 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/objectSpread2.js
|
|
|
var objectSpread2 = __webpack_require__(42122);
|
|
|
var objectSpread2_default = /*#__PURE__*/__webpack_require__.n(objectSpread2);
|
|
|
// 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);
|
|
|
// EXTERNAL MODULE: ./node_modules/antd/es/form/index.js + 17 modules
|
|
|
var es_form = __webpack_require__(25159);
|
|
|
// EXTERNAL MODULE: ./node_modules/antd/es/modal/index.js + 39 modules
|
|
|
var modal = __webpack_require__(72423);
|
|
|
// EXTERNAL MODULE: ./node_modules/antd/es/radio/index.js + 5 modules
|
|
|
var es_radio = __webpack_require__(78045);
|
|
|
// EXTERNAL MODULE: ./node_modules/antd/es/input/index.js + 5 modules
|
|
|
var input = __webpack_require__(79531);
|
|
|
// EXTERNAL MODULE: ./node_modules/antd/es/table/index.js + 90 modules
|
|
|
var table = __webpack_require__(63889);
|
|
|
;// CONCATENATED MODULE: ./src/components/ReuseShixunModal/index.less?modules
|
|
|
// extracted by mini-css-extract-plugin
|
|
|
/* harmony default export */ var ReuseShixunModalmodules = ({"brief":"brief___LOzpE","contentTitle":"contentTitle___xkdcN","content":"content___Vtri0","tips":"tips___tuAtH","antdTable":"antdTable___s8T2N","tableCell":"tableCell___kN9Fw","antdModal":"antdModal___WVBk3","orangeColor":"orangeColor___ryB2u"});
|
|
|
// EXTERNAL MODULE: ./src/service/shixuns.ts
|
|
|
var shixuns = __webpack_require__(56088);
|
|
|
// EXTERNAL MODULE: ./node_modules/react/jsx-runtime.js
|
|
|
var jsx_runtime = __webpack_require__(85893);
|
|
|
;// CONCATENATED MODULE: ./src/components/ReuseShixunModal/index.tsx
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
var _excluded = ["isImportMultipleCourse"];
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
var StudentInfo = function StudentInfo(_ref) {
|
|
|
var studentNames = _ref.studentNames,
|
|
|
total = _ref.total;
|
|
|
var Map = ['', '一', '两', '三'];
|
|
|
return total > 3 ? /*#__PURE__*/(0,jsx_runtime.jsxs)(jsx_runtime.Fragment, {
|
|
|
children: ["\u8BFE\u5802\u5185\u6709", /*#__PURE__*/(0,jsx_runtime.jsx)("span", {
|
|
|
className: ReuseShixunModalmodules.orangeColor,
|
|
|
children: studentNames === null || studentNames === void 0 ? void 0 : studentNames.join('、')
|
|
|
}), "\u7B49", /*#__PURE__*/(0,jsx_runtime.jsx)("span", {
|
|
|
className: ReuseShixunModalmodules.orangeColor,
|
|
|
children: total
|
|
|
}), "\u540D\u5B66\u751F"]
|
|
|
}) : /*#__PURE__*/(0,jsx_runtime.jsxs)(jsx_runtime.Fragment, {
|
|
|
children: ["\u8BFE\u5802\u5185\u6709", /*#__PURE__*/(0,jsx_runtime.jsx)("span", {
|
|
|
className: ReuseShixunModalmodules.orangeColor,
|
|
|
children: studentNames === null || studentNames === void 0 ? void 0 : studentNames.join('、')
|
|
|
}), Map[total], "\u540D\u5B66\u751F"]
|
|
|
});
|
|
|
};
|
|
|
|
|
|
//根据使用场景区分文案
|
|
|
var generateBrief = function generateBrief(_ref2) {
|
|
|
var used = _ref2.used,
|
|
|
copy = _ref2.copy,
|
|
|
canNotCopy = _ref2.canNotCopy,
|
|
|
studentNames = _ref2.studentNames,
|
|
|
studentCount = _ref2.studentCount,
|
|
|
inPaper = _ref2.inPaper,
|
|
|
_ref2$is_random = _ref2.is_random,
|
|
|
is_random = _ref2$is_random === void 0 ? false : _ref2$is_random,
|
|
|
_ref2$position = _ref2.position,
|
|
|
position = _ref2$position === void 0 ? '' : _ref2$position;
|
|
|
var copyStatusDescribe = function copyStatusDescribe() {
|
|
|
if (copy > 0 && canNotCopy > 0) {
|
|
|
return /*#__PURE__*/(0,jsx_runtime.jsxs)(jsx_runtime.Fragment, {
|
|
|
children: ["\u5176\u4E2D", /*#__PURE__*/(0,jsx_runtime.jsx)("span", {
|
|
|
className: ReuseShixunModalmodules.orangeColor,
|
|
|
children: copy
|
|
|
}), "\u4E2A\u9879\u76EE\u652F\u6301\u590D\u5236\uFF0C", /*#__PURE__*/(0,jsx_runtime.jsx)("span", {
|
|
|
className: ReuseShixunModalmodules.orangeColor,
|
|
|
children: canNotCopy
|
|
|
}), "\u4E2A\u9879\u76EE\u4E0D\u652F\u6301\u590D\u5236"]
|
|
|
});
|
|
|
} else if (copy > 0 && canNotCopy === 0) {
|
|
|
return /*#__PURE__*/(0,jsx_runtime.jsxs)(jsx_runtime.Fragment, {
|
|
|
children: ["\u5176\u4E2D", /*#__PURE__*/(0,jsx_runtime.jsx)("span", {
|
|
|
className: ReuseShixunModalmodules.orangeColor,
|
|
|
children: copy
|
|
|
}), "\u4E2A\u9879\u76EE\u652F\u6301\u590D\u5236"]
|
|
|
});
|
|
|
} else if (copy === 0 && canNotCopy > 0) {
|
|
|
return /*#__PURE__*/(0,jsx_runtime.jsxs)(jsx_runtime.Fragment, {
|
|
|
children: ["\u5176\u4E2D", /*#__PURE__*/(0,jsx_runtime.jsx)("span", {
|
|
|
className: ReuseShixunModalmodules.orangeColor,
|
|
|
children: canNotCopy
|
|
|
}), "\u4E2A\u9879\u76EE\u4E0D\u652F\u6301\u590D\u5236"]
|
|
|
});
|
|
|
}
|
|
|
};
|
|
|
var currentPosition = position || (inPaper ? '试卷' : '课程');
|
|
|
return /*#__PURE__*/(0,jsx_runtime.jsxs)("span", {
|
|
|
children: [/*#__PURE__*/(0,jsx_runtime.jsx)(StudentInfo, {
|
|
|
studentNames: studentNames,
|
|
|
total: studentCount
|
|
|
}), "\u5B66\u4E60\u8FC7", currentPosition, "\u4E2D\u7684", /*#__PURE__*/(0,jsx_runtime.jsx)("span", {
|
|
|
className: ReuseShixunModalmodules.orangeColor,
|
|
|
children: used
|
|
|
}), "\u4E2A\u9879\u76EE\uFF0C", copyStatusDescribe(), "\u3002\u8BF7\u9009\u62E9", is_random ? '' : '是否继续使用和', "\u662F\u5426\u590D\u5236\u4E3A\u65B0\u9879\u76EE\u53D1\u9001\u81F3\u8BFE\u5802\u4E2D\uFF1F"]
|
|
|
});
|
|
|
};
|
|
|
|
|
|
//单个实训时的情况
|
|
|
var ReuseSingleShixunModal = function ReuseSingleShixunModal(_ref3) {
|
|
|
var onCancel = _ref3.onCancel,
|
|
|
onOk = _ref3.onOk,
|
|
|
visible = _ref3.visible,
|
|
|
inPaper = _ref3.inPaper,
|
|
|
renderData = _ref3.renderData,
|
|
|
type = _ref3.type,
|
|
|
_ref3$isMultipleCours = _ref3.isMultipleCourse,
|
|
|
isMultipleCourse = _ref3$isMultipleCours === void 0 ? false : _ref3$isMultipleCours;
|
|
|
var _Form$useForm = es_form/* default.useForm */.Z.useForm(),
|
|
|
_Form$useForm2 = slicedToArray_default()(_Form$useForm, 1),
|
|
|
form = _Form$useForm2[0];
|
|
|
var _useState = (0,react.useState)(1),
|
|
|
_useState2 = slicedToArray_default()(_useState, 2),
|
|
|
radioValue = _useState2[0],
|
|
|
setRadioValue = _useState2[1];
|
|
|
var _useState3 = (0,react.useState)(false),
|
|
|
_useState4 = slicedToArray_default()(_useState3, 2),
|
|
|
confirmLoading = _useState4[0],
|
|
|
setConfirmLoading = _useState4[1];
|
|
|
var canCopy = (0,react.useMemo)(function () {
|
|
|
return (renderData === null || renderData === void 0 ? void 0 : renderData.total_num) === 1 && (renderData === null || renderData === void 0 ? void 0 : renderData.can_copy_num) === 1;
|
|
|
}, [renderData]);
|
|
|
var courseDataList = (0,react.useMemo)(function () {
|
|
|
var _renderData$course_da;
|
|
|
return renderData === null || renderData === void 0 ? void 0 : (_renderData$course_da = renderData.course_data_list) === null || _renderData$course_da === void 0 ? void 0 : _renderData$course_da.filter(function (e) {
|
|
|
return e.is_show;
|
|
|
});
|
|
|
}, [renderData]);
|
|
|
return /*#__PURE__*/(0,jsx_runtime.jsx)(jsx_runtime.Fragment, {
|
|
|
children: canCopy ? /*#__PURE__*/(0,jsx_runtime.jsxs)(modal/* default */.Z, {
|
|
|
centered: true,
|
|
|
closable: true,
|
|
|
open: visible,
|
|
|
destroyOnClose: true,
|
|
|
title: "\u63D0\u793A",
|
|
|
className: ReuseShixunModalmodules.antdModal,
|
|
|
width: 682,
|
|
|
confirmLoading: confirmLoading,
|
|
|
onCancel: onCancel,
|
|
|
onOk: /*#__PURE__*/asyncToGenerator_default()( /*#__PURE__*/regeneratorRuntime_default()().mark(function _callee() {
|
|
|
var data, _renderData$course_da2, param;
|
|
|
return regeneratorRuntime_default()().wrap(function _callee$(_context) {
|
|
|
while (1) switch (_context.prev = _context.next) {
|
|
|
case 0:
|
|
|
setConfirmLoading(true);
|
|
|
data = radioValue;
|
|
|
if (isMultipleCourse) {
|
|
|
param = objectSpread2_default()({}, form.getFieldsValue());
|
|
|
data = renderData === null || renderData === void 0 ? void 0 : (_renderData$course_da2 = renderData.course_data_list) === null || _renderData$course_da2 === void 0 ? void 0 : _renderData$course_da2.map(function (e) {
|
|
|
if (param[e.id] !== undefined) {
|
|
|
return objectSpread2_default()(objectSpread2_default()({}, e), {}, {
|
|
|
is_copy: param[e.id]
|
|
|
});
|
|
|
}
|
|
|
return e;
|
|
|
});
|
|
|
}
|
|
|
_context.next = 5;
|
|
|
return onOk(data);
|
|
|
case 5:
|
|
|
setConfirmLoading(false);
|
|
|
case 6:
|
|
|
case "end":
|
|
|
return _context.stop();
|
|
|
}
|
|
|
}, _callee);
|
|
|
})),
|
|
|
children: [/*#__PURE__*/(0,jsx_runtime.jsx)("div", {
|
|
|
className: ReuseShixunModalmodules.content,
|
|
|
style: {
|
|
|
marginBottom: 20
|
|
|
},
|
|
|
children: isMultipleCourse ? '检测到以下课堂已在教学课堂中使用,请问是否复制成新的实训发送至教学课堂中?' : /*#__PURE__*/(0,jsx_runtime.jsxs)(jsx_runtime.Fragment, {
|
|
|
children: [/*#__PURE__*/(0,jsx_runtime.jsx)(StudentInfo, {
|
|
|
studentNames: renderData === null || renderData === void 0 ? void 0 : renderData.student_names,
|
|
|
total: renderData === null || renderData === void 0 ? void 0 : renderData.student_count
|
|
|
}), "\u5B66\u4E60\u8FC7\u8BE5\u5B9E\u8DF5\u9879\u76EE\u3002\u8BE5\u9879\u76EE\u652F\u6301\u590D\u5236\uFF0C\u8BF7\u9009\u62E9\u662F\u5426\u5C06\u8BE5\u9879\u76EE\u590D\u5236\u4E3A\u65B0\u9879\u76EE\u53D1\u9001\u81F3\u8BFE\u5802\u4E2D\uFF1F"]
|
|
|
})
|
|
|
}), isMultipleCourse ? /*#__PURE__*/(0,jsx_runtime.jsx)(es_form/* default */.Z, {
|
|
|
form: form,
|
|
|
preserve: false,
|
|
|
children: courseDataList === null || courseDataList === void 0 ? void 0 : courseDataList.map(function (item) {
|
|
|
return /*#__PURE__*/(0,jsx_runtime.jsxs)(react.Fragment, {
|
|
|
children: [/*#__PURE__*/(0,jsx_runtime.jsx)("h3", {
|
|
|
className: "ml15 mb5",
|
|
|
children: item.name
|
|
|
}), /*#__PURE__*/(0,jsx_runtime.jsx)(es_form/* default.Item */.Z.Item, {
|
|
|
name: item.id,
|
|
|
initialValue: 1,
|
|
|
children: /*#__PURE__*/(0,jsx_runtime.jsxs)(es_radio/* default.Group */.ZP.Group, {
|
|
|
className: ReuseShixunModalmodules.content,
|
|
|
children: [/*#__PURE__*/(0,jsx_runtime.jsx)(es_radio/* default */.ZP, {
|
|
|
value: 1,
|
|
|
style: {
|
|
|
color: '#464f66'
|
|
|
},
|
|
|
children: "\u590D\u5236\u5B9E\u8BAD"
|
|
|
}), /*#__PURE__*/(0,jsx_runtime.jsx)(es_radio/* default */.ZP, {
|
|
|
value: 0,
|
|
|
style: {
|
|
|
color: '#464f66'
|
|
|
},
|
|
|
children: "\u4E0D\u590D\u5236\u5B9E\u8BAD"
|
|
|
})]
|
|
|
})
|
|
|
})]
|
|
|
}, item.id);
|
|
|
})
|
|
|
}) : /*#__PURE__*/(0,jsx_runtime.jsxs)(es_radio/* default.Group */.ZP.Group, {
|
|
|
value: radioValue,
|
|
|
onChange: function onChange(e) {
|
|
|
return setRadioValue(e.target.value);
|
|
|
},
|
|
|
className: ReuseShixunModalmodules.content,
|
|
|
style: {
|
|
|
marginBottom: 30
|
|
|
},
|
|
|
children: [/*#__PURE__*/(0,jsx_runtime.jsx)(es_radio/* default */.ZP, {
|
|
|
value: 1,
|
|
|
style: {
|
|
|
color: '#464f66'
|
|
|
},
|
|
|
children: "\u590D\u5236"
|
|
|
}), /*#__PURE__*/(0,jsx_runtime.jsx)(es_radio/* default */.ZP, {
|
|
|
value: 0,
|
|
|
style: {
|
|
|
color: '#464f66'
|
|
|
},
|
|
|
children: "\u4E0D\u590D\u5236"
|
|
|
})]
|
|
|
}), /*#__PURE__*/(0,jsx_runtime.jsxs)("div", {
|
|
|
children: [/*#__PURE__*/(0,jsx_runtime.jsx)("div", {
|
|
|
className: ReuseShixunModalmodules.content,
|
|
|
style: {
|
|
|
marginBottom: 10
|
|
|
},
|
|
|
children: "* \u8BF4\u660E\uFF1A"
|
|
|
}), /*#__PURE__*/(0,jsx_runtime.jsx)("div", {
|
|
|
className: ReuseShixunModalmodules.content,
|
|
|
style: {
|
|
|
marginBottom: 20
|
|
|
},
|
|
|
children: "1\u3001\u590D\u5236\uFF1A\u7CFB\u7EDF\u5C06\u590D\u5236\u5E76\u521B\u5EFA\u4E00\u4E2A\u65B0\u7684\u9879\u76EE\u53D1\u9001\u5230\u8BFE\u5802\u4E2D\u4F7F\u7528\uFF08\u4E0D\u4F1A\u590D\u5236\u5B66\u751F\u7684\u6311\u6218\u8BB0\u5F55\uFF09\uFF0C\u65B0\u7684\u9879\u76EE\u652F\u6301\u8FDB\u884C\u7F16\u8F91\u5E76\u4E0E\u539F\u9879\u76EE\u4FE1\u606F\u4E92\u4E0D\u5F71\u54CD\u3002"
|
|
|
}), /*#__PURE__*/(0,jsx_runtime.jsx)("div", {
|
|
|
className: "".concat(ReuseShixunModalmodules.content, " ").concat(ReuseShixunModalmodules.orangeColor),
|
|
|
children: "2\u3001\u4E0D\u590D\u5236\uFF1A\u5F53\u524D\u9879\u76EE\u4F1A\u88AB\u76F4\u63A5\u53D1\u9001\u5230\u8BFE\u5802\u4E2D\u4F7F\u7528\uFF0C\u6311\u6218\u8FC7\u8BE5\u9879\u76EE\u7684\u5B66\u751F\u518D\u6B21\u8FDB\u5165\u9879\u76EE\u5F00\u542F\u6311\u6218\u65F6\uFF0C\u4F1A\u6E05\u7A7A\u4E4B\u524D\u7684\u6311\u6218\u8BB0\u5F55\u3002"
|
|
|
})]
|
|
|
})]
|
|
|
}) : /*#__PURE__*/(0,jsx_runtime.jsx)(modal/* default */.Z, {
|
|
|
centered: true,
|
|
|
closable: true,
|
|
|
destroyOnClose: true,
|
|
|
open: visible,
|
|
|
confirmLoading: confirmLoading,
|
|
|
title: "\u63D0\u793A",
|
|
|
width: 682,
|
|
|
onCancel: onCancel,
|
|
|
onOk: /*#__PURE__*/asyncToGenerator_default()( /*#__PURE__*/regeneratorRuntime_default()().mark(function _callee2() {
|
|
|
var data, _renderData$course_da3, param;
|
|
|
return regeneratorRuntime_default()().wrap(function _callee2$(_context2) {
|
|
|
while (1) switch (_context2.prev = _context2.next) {
|
|
|
case 0:
|
|
|
setConfirmLoading(true);
|
|
|
data = 0;
|
|
|
if (isMultipleCourse) {
|
|
|
param = objectSpread2_default()({}, form.getFieldsValue());
|
|
|
data = renderData === null || renderData === void 0 ? void 0 : (_renderData$course_da3 = renderData.course_data_list) === null || _renderData$course_da3 === void 0 ? void 0 : _renderData$course_da3.map(function (e) {
|
|
|
if (param[e.id] !== undefined) {
|
|
|
return objectSpread2_default()(objectSpread2_default()({}, e), {}, {
|
|
|
is_use: param[e.id]
|
|
|
});
|
|
|
}
|
|
|
return e;
|
|
|
});
|
|
|
}
|
|
|
_context2.next = 5;
|
|
|
return onOk(data);
|
|
|
case 5:
|
|
|
setConfirmLoading(false);
|
|
|
case 6:
|
|
|
case "end":
|
|
|
return _context2.stop();
|
|
|
}
|
|
|
}, _callee2);
|
|
|
})),
|
|
|
children: /*#__PURE__*/(0,jsx_runtime.jsxs)("div", {
|
|
|
className: ReuseShixunModalmodules.content,
|
|
|
children: [/*#__PURE__*/(0,jsx_runtime.jsx)(StudentInfo, {
|
|
|
studentNames: renderData === null || renderData === void 0 ? void 0 : renderData.student_names,
|
|
|
total: renderData === null || renderData === void 0 ? void 0 : renderData.student_count
|
|
|
}), "\u5B66\u4E60\u8FC7\u8BE5\u5B9E\u8DF5\u9879\u76EE\u3002", isMultipleCourse ? /*#__PURE__*/(0,jsx_runtime.jsxs)(es_form/* default */.Z, {
|
|
|
form: form,
|
|
|
preserve: false,
|
|
|
children: [/*#__PURE__*/(0,jsx_runtime.jsx)("h3", {
|
|
|
children: "\u5F53\u524D\u5B9E\u8BAD\u4E0D\u53EF\u590D\u5236\uFF0C\u5DF2\u7ECF\u68C0\u6D4B\u5230\u4EE5\u4E0B\u8BFE\u5802\u5B58\u5728\u8BE5\u5B9E\u8BAD\uFF0C\u540C\u4E00\u5B9E\u8BAD\u5728\u8BFE\u5802\u4E2D\u91CD\u590D\u4F7F\u7528\u65F6\uFF0C\u4F1A\u5BFC\u81F4\u6210\u7EE9\u4E92\u76F8\u5F71\u54CD\uFF0C\u8BF7\u786E\u8BA4\u662F\u5426\u7EE7\u7EED\u4F7F\u7528"
|
|
|
}), courseDataList === null || courseDataList === void 0 ? void 0 : courseDataList.map(function (item) {
|
|
|
return /*#__PURE__*/(0,jsx_runtime.jsxs)(react.Fragment, {
|
|
|
children: [/*#__PURE__*/(0,jsx_runtime.jsx)("h3", {
|
|
|
className: "ml15 mb5",
|
|
|
children: item.name
|
|
|
}), /*#__PURE__*/(0,jsx_runtime.jsx)(es_form/* default.Item */.Z.Item, {
|
|
|
name: item.id,
|
|
|
initialValue: 1,
|
|
|
children: /*#__PURE__*/(0,jsx_runtime.jsxs)(es_radio/* default.Group */.ZP.Group, {
|
|
|
className: ReuseShixunModalmodules.content,
|
|
|
children: [/*#__PURE__*/(0,jsx_runtime.jsx)(es_radio/* default */.ZP, {
|
|
|
value: 1,
|
|
|
style: {
|
|
|
color: '#464f66'
|
|
|
},
|
|
|
children: "\u7EE7\u7EED\u4F7F\u7528"
|
|
|
}), /*#__PURE__*/(0,jsx_runtime.jsx)(es_radio/* default */.ZP, {
|
|
|
value: 0,
|
|
|
style: {
|
|
|
color: '#464f66'
|
|
|
},
|
|
|
children: "\u4E0D\u4F7F\u7528"
|
|
|
})]
|
|
|
})
|
|
|
})]
|
|
|
}, item.id);
|
|
|
})]
|
|
|
}) : /*#__PURE__*/(0,jsx_runtime.jsxs)("div", {
|
|
|
children: ["\u8BE5\u9879\u76EE\u4E0D\u652F\u6301\u590D\u5236\uFF0C\u82E5\u786E\u8BA4\u7EE7\u7EED\u53D1\u9001\uFF0C", /*#__PURE__*/(0,jsx_runtime.jsx)("span", {
|
|
|
className: ReuseShixunModalmodules.orangeColor,
|
|
|
children: "\u5F53\u524D\u9879\u76EE\u4F1A\u88AB\u76F4\u63A5\u53D1\u9001\u5230\u8BFE\u5802\u4E2D\u4F7F\u7528\uFF0C\u6311\u6218\u8FC7\u8BE5\u9879\u76EE\u7684\u5B66\u751F\u518D\u6B21\u8FDB\u5165\u9879\u76EE\u5F00\u542F\u6311\u6218\u65F6\uFF0C\u4F1A\u6E05\u7A7A\u4E4B\u524D\u7684\u6311\u6218\u8BB0\u5F55\u3002"
|
|
|
}), "\uFF08\u5982\u679C\u4E0D\u60F3\u6E05\u7A7A\u5B66\u751F\u4E4B\u524D\u7684\u6311\u6218\u8BB0\u5F55\uFF0C\u5EFA\u8BAE\u53C2\u7167\u8BE5\u5B9E\u8DF5\u9879\u76EE\u7684\u5185\u5BB9\u81EA\u884C\u521B\u5EFA\u4E00\u4E2A\u65B0\u7684\u9879\u76EE\uFF0C\u6216\u8005\u5C1D\u8BD5\u8054\u7CFB\u9879\u76EE\u521B\u5EFA\u4EBA\u5F00\u653E\u672C\u9879\u76EE\u7684\u590D\u5236\u6743\u9650\uFF09\u3002"]
|
|
|
})]
|
|
|
})
|
|
|
})
|
|
|
});
|
|
|
};
|
|
|
var useReuseModal = function useReuseModal() {
|
|
|
var _useState5 = (0,react.useState)(false),
|
|
|
_useState6 = slicedToArray_default()(_useState5, 2),
|
|
|
modalVisible = _useState6[0],
|
|
|
setModalVisible = _useState6[1];
|
|
|
var _useState7 = (0,react.useState)(),
|
|
|
_useState8 = slicedToArray_default()(_useState7, 2),
|
|
|
renderData = _useState8[0],
|
|
|
setRenderData = _useState8[1];
|
|
|
var closeModalFn = function closeModalFn() {
|
|
|
return setModalVisible(false);
|
|
|
};
|
|
|
var showModal = /*#__PURE__*/function () {
|
|
|
var _ref6 = asyncToGenerator_default()( /*#__PURE__*/regeneratorRuntime_default()().mark(function _callee3(reqParams) {
|
|
|
var _reqParams$isImportMu, isImportMultipleCourse, param, res, _res$course_data_list, isModalVisible;
|
|
|
return regeneratorRuntime_default()().wrap(function _callee3$(_context3) {
|
|
|
while (1) switch (_context3.prev = _context3.next) {
|
|
|
case 0:
|
|
|
_reqParams$isImportMu = reqParams.isImportMultipleCourse, isImportMultipleCourse = _reqParams$isImportMu === void 0 ? false : _reqParams$isImportMu, param = objectWithoutProperties_default()(reqParams, _excluded);
|
|
|
_context3.next = 3;
|
|
|
return (0,shixuns/* checkShixunCopy */.Tr)(param);
|
|
|
case 3:
|
|
|
res = _context3.sent;
|
|
|
if (!('status' in res)) {
|
|
|
_context3.next = 6;
|
|
|
break;
|
|
|
}
|
|
|
return _context3.abrupt("return", false);
|
|
|
case 6:
|
|
|
if (!isImportMultipleCourse) {
|
|
|
_context3.next = 13;
|
|
|
break;
|
|
|
}
|
|
|
isModalVisible = res === null || res === void 0 ? void 0 : (_res$course_data_list = res.course_data_list) === null || _res$course_data_list === void 0 ? void 0 : _res$course_data_list.some(function (e) {
|
|
|
return e.is_show;
|
|
|
});
|
|
|
if (!isModalVisible) {
|
|
|
_context3.next = 12;
|
|
|
break;
|
|
|
}
|
|
|
setRenderData(res);
|
|
|
setModalVisible(true);
|
|
|
return _context3.abrupt("return", true);
|
|
|
case 12:
|
|
|
return _context3.abrupt("return", res.course_data_list || []);
|
|
|
case 13:
|
|
|
if (!(res.student_count === 0)) {
|
|
|
_context3.next = 15;
|
|
|
break;
|
|
|
}
|
|
|
return _context3.abrupt("return", false);
|
|
|
case 15:
|
|
|
setRenderData(res);
|
|
|
setModalVisible(true);
|
|
|
return _context3.abrupt("return", true);
|
|
|
case 18:
|
|
|
case "end":
|
|
|
return _context3.stop();
|
|
|
}
|
|
|
}, _callee3);
|
|
|
}));
|
|
|
return function showModal(_x) {
|
|
|
return _ref6.apply(this, arguments);
|
|
|
};
|
|
|
}();
|
|
|
return [modalVisible, closeModalFn, renderData, showModal];
|
|
|
};
|
|
|
|
|
|
//多个实训时的情况
|
|
|
var ReuseMultipleShixunModal = function ReuseMultipleShixunModal(props) {
|
|
|
var _Form$useForm3 = es_form/* default.useForm */.Z.useForm(),
|
|
|
_Form$useForm4 = slicedToArray_default()(_Form$useForm3, 1),
|
|
|
form = _Form$useForm4[0];
|
|
|
var _useState9 = (0,react.useState)(false),
|
|
|
_useState10 = slicedToArray_default()(_useState9, 2),
|
|
|
confirmLoading = _useState10[0],
|
|
|
setConfirmLoading = _useState10[1];
|
|
|
var onCancel = props.onCancel,
|
|
|
onOk = props.onOk,
|
|
|
visible = props.visible,
|
|
|
_props$inPaper = props.inPaper,
|
|
|
inPaper = _props$inPaper === void 0 ? false : _props$inPaper,
|
|
|
renderData = props.renderData,
|
|
|
type = props.type,
|
|
|
_props$isMultipleCour = props.isMultipleCourse,
|
|
|
isMultipleCourse = _props$isMultipleCour === void 0 ? false : _props$isMultipleCour,
|
|
|
position = props.position;
|
|
|
var reproducibleShixunColumns = (0,react.useMemo)(function () {
|
|
|
return inPaper ? [{
|
|
|
title: '实践项目名称',
|
|
|
dataIndex: 'name',
|
|
|
width: 424,
|
|
|
align: 'center',
|
|
|
ellipsis: true,
|
|
|
className: ReuseShixunModalmodules.tableCell,
|
|
|
render: function render(text, record) {
|
|
|
return /*#__PURE__*/(0,jsx_runtime.jsx)("a", {
|
|
|
href: "/shixuns/".concat(record.identifier, "/challenges"),
|
|
|
target: "_blank",
|
|
|
children: text
|
|
|
});
|
|
|
}
|
|
|
}, {
|
|
|
title: '是否复制',
|
|
|
dataIndex: 'is_copy',
|
|
|
align: 'center',
|
|
|
render: function render(value, record) {
|
|
|
return /*#__PURE__*/(0,jsx_runtime.jsxs)(jsx_runtime.Fragment, {
|
|
|
children: [/*#__PURE__*/(0,jsx_runtime.jsx)(es_form/* default.Item */.Z.Item, {
|
|
|
name: ["".concat(type === 'subject' ? record.stage_shixun_id : record.shixun_course_id || record.id), 'is_copy'],
|
|
|
initialValue: 1,
|
|
|
children: /*#__PURE__*/(0,jsx_runtime.jsxs)(es_radio/* default.Group */.ZP.Group, {
|
|
|
children: [/*#__PURE__*/(0,jsx_runtime.jsx)(es_radio/* default */.ZP, {
|
|
|
value: 1,
|
|
|
children: "\u662F"
|
|
|
}), /*#__PURE__*/(0,jsx_runtime.jsx)(es_radio/* default */.ZP, {
|
|
|
value: 0,
|
|
|
children: "\u5426"
|
|
|
})]
|
|
|
})
|
|
|
}), /*#__PURE__*/(0,jsx_runtime.jsx)(es_form/* default.Item */.Z.Item, {
|
|
|
name: ["".concat(type === 'subject' ? record === null || record === void 0 ? void 0 : record.stage_shixun_id : record.shixun_course_id || record.id), 'is_use'],
|
|
|
hidden: true,
|
|
|
initialValue: 1,
|
|
|
children: /*#__PURE__*/(0,jsx_runtime.jsx)(input/* default */.Z, {
|
|
|
type: "hidden"
|
|
|
})
|
|
|
})]
|
|
|
});
|
|
|
}
|
|
|
}] : [{
|
|
|
title: '实践项目名称',
|
|
|
dataIndex: 'name',
|
|
|
width: 424,
|
|
|
align: 'center',
|
|
|
ellipsis: true,
|
|
|
className: ReuseShixunModalmodules.tableCell,
|
|
|
render: function render(text, record) {
|
|
|
return /*#__PURE__*/(0,jsx_runtime.jsx)("a", {
|
|
|
href: "/shixuns/".concat(record.identifier, "/challenges"),
|
|
|
target: "_blank",
|
|
|
children: text
|
|
|
});
|
|
|
}
|
|
|
}, {
|
|
|
title: '是否使用',
|
|
|
dataIndex: 'is_use',
|
|
|
align: 'center',
|
|
|
render: function render(value, record) {
|
|
|
return /*#__PURE__*/(0,jsx_runtime.jsx)(es_form/* default.Item */.Z.Item, {
|
|
|
name: ["".concat(type === 'subject' ? record.stage_shixun_id : record.shixun_course_id || record.id), 'is_use'],
|
|
|
initialValue: 1,
|
|
|
children: /*#__PURE__*/(0,jsx_runtime.jsxs)(es_radio/* default.Group */.ZP.Group, {
|
|
|
children: [/*#__PURE__*/(0,jsx_runtime.jsx)(es_radio/* default */.ZP, {
|
|
|
value: 1,
|
|
|
children: "\u662F"
|
|
|
}), /*#__PURE__*/(0,jsx_runtime.jsx)(es_radio/* default */.ZP, {
|
|
|
value: 0,
|
|
|
children: "\u5426"
|
|
|
})]
|
|
|
})
|
|
|
});
|
|
|
}
|
|
|
}, {
|
|
|
title: '是否复制',
|
|
|
dataIndex: 'is_copy',
|
|
|
align: 'center',
|
|
|
render: function render(value, record) {
|
|
|
return /*#__PURE__*/(0,jsx_runtime.jsx)(es_form/* default.Item */.Z.Item, {
|
|
|
name: ["".concat(type === 'subject' ? record.stage_shixun_id : record.shixun_course_id || record.id), 'is_copy'],
|
|
|
initialValue: 1,
|
|
|
children: /*#__PURE__*/(0,jsx_runtime.jsxs)(es_radio/* default.Group */.ZP.Group, {
|
|
|
children: [/*#__PURE__*/(0,jsx_runtime.jsx)(es_radio/* default */.ZP, {
|
|
|
value: 1,
|
|
|
children: "\u662F"
|
|
|
}), /*#__PURE__*/(0,jsx_runtime.jsx)(es_radio/* default */.ZP, {
|
|
|
value: 0,
|
|
|
children: "\u5426"
|
|
|
})]
|
|
|
})
|
|
|
});
|
|
|
}
|
|
|
}];
|
|
|
}, [inPaper]);
|
|
|
var irreproducibleShixunColumns = (0,react.useMemo)(function () {
|
|
|
return inPaper ? [{
|
|
|
title: '实践项目名称',
|
|
|
dataIndex: 'name',
|
|
|
width: 424,
|
|
|
className: ReuseShixunModalmodules.tableCell,
|
|
|
align: 'center',
|
|
|
ellipsis: true,
|
|
|
render: function render(value, record) {
|
|
|
return /*#__PURE__*/(0,jsx_runtime.jsxs)(jsx_runtime.Fragment, {
|
|
|
children: [/*#__PURE__*/(0,jsx_runtime.jsx)("a", {
|
|
|
href: "/shixuns/".concat(record.identifier, "/challenges"),
|
|
|
target: "_blank",
|
|
|
children: value
|
|
|
}), /*#__PURE__*/(0,jsx_runtime.jsx)(es_form/* default.Item */.Z.Item, {
|
|
|
name: ["".concat(type === 'subject' ? record === null || record === void 0 ? void 0 : record.stage_shixun_id : record.shixun_course_id || record.id), 'is_copy'],
|
|
|
hidden: true,
|
|
|
initialValue: 0,
|
|
|
children: /*#__PURE__*/(0,jsx_runtime.jsx)(input/* default */.Z, {
|
|
|
type: "hidden"
|
|
|
})
|
|
|
}), /*#__PURE__*/(0,jsx_runtime.jsx)(es_form/* default.Item */.Z.Item, {
|
|
|
name: ["".concat(type === 'subject' ? record === null || record === void 0 ? void 0 : record.stage_shixun_id : record.shixun_course_id || record.id), 'is_use'],
|
|
|
hidden: true,
|
|
|
initialValue: 1,
|
|
|
children: /*#__PURE__*/(0,jsx_runtime.jsx)(input/* default */.Z, {
|
|
|
type: "hidden"
|
|
|
})
|
|
|
})]
|
|
|
});
|
|
|
}
|
|
|
}] : [{
|
|
|
title: '实践项目名称',
|
|
|
dataIndex: 'name',
|
|
|
width: 424,
|
|
|
className: ReuseShixunModalmodules.tableCell,
|
|
|
ellipsis: true,
|
|
|
align: 'center',
|
|
|
render: function render(text, record) {
|
|
|
return /*#__PURE__*/(0,jsx_runtime.jsx)("a", {
|
|
|
href: "/shixuns/".concat(record.identifier, "/challenges"),
|
|
|
target: "_blank",
|
|
|
children: text
|
|
|
});
|
|
|
}
|
|
|
}, {
|
|
|
title: '是否使用',
|
|
|
dataIndex: 'is_use',
|
|
|
align: 'center',
|
|
|
render: function render(value, record) {
|
|
|
return /*#__PURE__*/(0,jsx_runtime.jsxs)(jsx_runtime.Fragment, {
|
|
|
children: [/*#__PURE__*/(0,jsx_runtime.jsx)(es_form/* default.Item */.Z.Item, {
|
|
|
name: ["".concat(type === 'subject' ? record === null || record === void 0 ? void 0 : record.stage_shixun_id : record.shixun_course_id || record.id), 'is_use'],
|
|
|
initialValue: 0,
|
|
|
children: /*#__PURE__*/(0,jsx_runtime.jsxs)(es_radio/* default.Group */.ZP.Group, {
|
|
|
children: [/*#__PURE__*/(0,jsx_runtime.jsx)(es_radio/* default */.ZP, {
|
|
|
value: 1,
|
|
|
children: "\u662F"
|
|
|
}), /*#__PURE__*/(0,jsx_runtime.jsx)(es_radio/* default */.ZP, {
|
|
|
value: 0,
|
|
|
children: "\u5426"
|
|
|
})]
|
|
|
})
|
|
|
}), /*#__PURE__*/(0,jsx_runtime.jsx)(es_form/* default.Item */.Z.Item, {
|
|
|
name: ["".concat(type === 'subject' ? record === null || record === void 0 ? void 0 : record.stage_shixun_id : record.shixun_course_id || record.id), 'is_copy'],
|
|
|
hidden: true,
|
|
|
initialValue: 0,
|
|
|
children: /*#__PURE__*/(0,jsx_runtime.jsx)(input/* default */.Z, {
|
|
|
type: "hidden"
|
|
|
})
|
|
|
})]
|
|
|
});
|
|
|
}
|
|
|
}];
|
|
|
}, [inPaper]);
|
|
|
|
|
|
//可以选择多个课堂的时候
|
|
|
if (isMultipleCourse) {
|
|
|
var param = {
|
|
|
title: '课堂名称',
|
|
|
ellipsis: true,
|
|
|
dataIndex: 'course_name',
|
|
|
width: 190,
|
|
|
align: 'center',
|
|
|
className: ReuseShixunModalmodules.tableCell,
|
|
|
render: function render(text, record) {
|
|
|
return /*#__PURE__*/(0,jsx_runtime.jsx)("a", {
|
|
|
href: "/classrooms/".concat(record.course_id),
|
|
|
children: text
|
|
|
});
|
|
|
}
|
|
|
};
|
|
|
reproducibleShixunColumns = [param].concat(toConsumableArray_default()(reproducibleShixunColumns));
|
|
|
irreproducibleShixunColumns = [param].concat(toConsumableArray_default()(irreproducibleShixunColumns));
|
|
|
}
|
|
|
var dynamicBrief = (0,react.useMemo)(function () {
|
|
|
return generateBrief({
|
|
|
used: renderData === null || renderData === void 0 ? void 0 : renderData.repeat_shixun_num,
|
|
|
copy: renderData === null || renderData === void 0 ? void 0 : renderData.can_copy_num,
|
|
|
canNotCopy: renderData === null || renderData === void 0 ? void 0 : renderData.no_copy_num,
|
|
|
studentNames: renderData === null || renderData === void 0 ? void 0 : renderData.student_names,
|
|
|
studentCount: renderData === null || renderData === void 0 ? void 0 : renderData.student_count,
|
|
|
is_random: renderData === null || renderData === void 0 ? void 0 : renderData.is_random,
|
|
|
inPaper: inPaper,
|
|
|
position: position
|
|
|
});
|
|
|
}, [renderData, inPaper, position]);
|
|
|
return /*#__PURE__*/(0,jsx_runtime.jsx)(modal/* default */.Z, {
|
|
|
title: "\u63D0\u793A",
|
|
|
centered: true,
|
|
|
open: visible,
|
|
|
confirmLoading: confirmLoading,
|
|
|
onOk: /*#__PURE__*/asyncToGenerator_default()( /*#__PURE__*/regeneratorRuntime_default()().mark(function _callee4() {
|
|
|
var formValues, ids;
|
|
|
return regeneratorRuntime_default()().wrap(function _callee4$(_context4) {
|
|
|
while (1) switch (_context4.prev = _context4.next) {
|
|
|
case 0:
|
|
|
setConfirmLoading(true);
|
|
|
formValues = form.getFieldsValue();
|
|
|
ids = Object.keys(formValues).map(function (key) {
|
|
|
return {
|
|
|
id: parseInt(key.split('_')[0]),
|
|
|
course_id: parseInt(key.split('_')[1]),
|
|
|
is_use: formValues[key].is_use,
|
|
|
is_copy: formValues[key].is_copy
|
|
|
};
|
|
|
});
|
|
|
_context4.next = 5;
|
|
|
return onOk(ids);
|
|
|
case 5:
|
|
|
setConfirmLoading(false);
|
|
|
case 6:
|
|
|
case "end":
|
|
|
return _context4.stop();
|
|
|
}
|
|
|
}, _callee4);
|
|
|
})),
|
|
|
onCancel: onCancel,
|
|
|
width: 880,
|
|
|
okText: "\u786E\u8BA4",
|
|
|
className: ReuseShixunModalmodules.antdModal,
|
|
|
destroyOnClose: true,
|
|
|
children: /*#__PURE__*/(0,jsx_runtime.jsxs)(es_form/* default */.Z, {
|
|
|
form: form,
|
|
|
preserve: false,
|
|
|
children: [/*#__PURE__*/(0,jsx_runtime.jsx)("div", {
|
|
|
className: ReuseShixunModalmodules.brief,
|
|
|
children: dynamicBrief
|
|
|
}), /*#__PURE__*/(0,jsx_runtime.jsxs)("div", {
|
|
|
style: {
|
|
|
marginBottom: 30
|
|
|
},
|
|
|
children: [/*#__PURE__*/(0,jsx_runtime.jsx)("div", {
|
|
|
style: {
|
|
|
marginBottom: 20
|
|
|
},
|
|
|
children: "* \u8BF4\u660E"
|
|
|
}), /*#__PURE__*/(0,jsx_runtime.jsx)("div", {
|
|
|
style: {
|
|
|
marginBottom: 20
|
|
|
},
|
|
|
children: "1\u3001\u590D\u5236\uFF1A\u7CFB\u7EDF\u5C06\u590D\u5236\u5E76\u521B\u5EFA\u4E00\u4E2A\u65B0\u7684\u9879\u76EE\u53D1\u9001\u5230\u8BFE\u5802\u4E2D\u4F7F\u7528\uFF08\u4E0D\u4F1A\u590D\u5236\u5B66\u751F\u7684\u6311\u6218\u8BB0\u5F55\uFF09\uFF0C\u65B0\u7684\u9879\u76EE\u652F\u6301\u8FDB\u884C\u7F16\u8F91\u5E76\u4E0E\u539F\u9879\u76EE\u4FE1\u606F\u4E92\u4E0D\u5F71\u54CD\u3002"
|
|
|
}), /*#__PURE__*/(0,jsx_runtime.jsx)("div", {
|
|
|
className: ReuseShixunModalmodules.orangeColor,
|
|
|
children: "2\u3001\u4E0D\u590D\u5236\uFF1A\u5F53\u524D\u9879\u76EE\u4F1A\u88AB\u76F4\u63A5\u53D1\u9001\u5230\u8BFE\u5802\u4E2D\u4F7F\u7528\uFF0C\u6311\u6218\u8FC7\u8BE5\u9879\u76EE\u7684\u5B66\u751F\u518D\u6B21\u8FDB\u5165\u9879\u76EE\u5F00\u542F\u6311\u6218\u65F6\uFF0C\u4F1A\u6E05\u7A7A\u4E4B\u524D\u7684\u6311\u6218\u8BB0\u5F55\u3002"
|
|
|
})]
|
|
|
}), (renderData === null || renderData === void 0 ? void 0 : renderData.can_copy_num) > 0 && /*#__PURE__*/(0,jsx_runtime.jsxs)("div", {
|
|
|
children: [/*#__PURE__*/(0,jsx_runtime.jsx)("div", {
|
|
|
className: ReuseShixunModalmodules.contentTitle,
|
|
|
children: "\u652F\u6301\u590D\u5236\u7684\u9879\u76EE"
|
|
|
}), /*#__PURE__*/(0,jsx_runtime.jsx)(table/* default */.Z, {
|
|
|
columns: reproducibleShixunColumns,
|
|
|
className: ReuseShixunModalmodules.antdTable,
|
|
|
dataSource: renderData === null || renderData === void 0 ? void 0 : renderData.can_copy_list,
|
|
|
rowKey: type === 'subject' ? "stage_shixun_id" : 'id',
|
|
|
pagination: false,
|
|
|
scroll: {
|
|
|
y: 240
|
|
|
},
|
|
|
bordered: true
|
|
|
})]
|
|
|
}), (renderData === null || renderData === void 0 ? void 0 : renderData.no_copy_num) > 0 && /*#__PURE__*/(0,jsx_runtime.jsxs)("div", {
|
|
|
children: [/*#__PURE__*/(0,jsx_runtime.jsx)("div", {
|
|
|
className: ReuseShixunModalmodules.contentTitle,
|
|
|
children: "\u4E0D\u652F\u6301\u590D\u5236\u7684\u9879\u76EE"
|
|
|
}), /*#__PURE__*/(0,jsx_runtime.jsx)(table/* default */.Z, {
|
|
|
columns: irreproducibleShixunColumns,
|
|
|
className: ReuseShixunModalmodules.antdTable,
|
|
|
dataSource: renderData === null || renderData === void 0 ? void 0 : renderData.no_copy_list,
|
|
|
rowKey: type === 'subject' ? "stage_shixun_id" : 'id',
|
|
|
pagination: false,
|
|
|
scroll: {
|
|
|
y: 200
|
|
|
},
|
|
|
bordered: true
|
|
|
})]
|
|
|
}), (renderData === null || renderData === void 0 ? void 0 : renderData.no_use_list.length) > 0 && (renderData === null || renderData === void 0 ? void 0 : renderData.no_use_list.map(function (record) {
|
|
|
return /*#__PURE__*/(0,jsx_runtime.jsxs)("div", {
|
|
|
children: [/*#__PURE__*/(0,jsx_runtime.jsx)(es_form/* default.Item */.Z.Item, {
|
|
|
name: ["".concat(type === 'subject' ? record === null || record === void 0 ? void 0 : record.stage_shixun_id : record.shixun_course_id || record.id), 'is_copy'],
|
|
|
hidden: true,
|
|
|
initialValue: 0,
|
|
|
children: /*#__PURE__*/(0,jsx_runtime.jsx)(input/* default */.Z, {
|
|
|
type: "hidden"
|
|
|
})
|
|
|
}), /*#__PURE__*/(0,jsx_runtime.jsx)(es_form/* default.Item */.Z.Item, {
|
|
|
name: ["".concat(type === 'subject' ? record === null || record === void 0 ? void 0 : record.stage_shixun_id : record.shixun_course_id || record.id), 'is_use'],
|
|
|
hidden: true,
|
|
|
initialValue: 1,
|
|
|
children: /*#__PURE__*/(0,jsx_runtime.jsx)(input/* default */.Z, {
|
|
|
type: "hidden"
|
|
|
})
|
|
|
})]
|
|
|
}, type === 'subject' ? record.stage_shixun_id : record.shixun_course_id || record.id);
|
|
|
}))]
|
|
|
})
|
|
|
});
|
|
|
};
|
|
|
var ReuseShixunModal = function ReuseShixunModal(props) {
|
|
|
var modalType = props.modalType;
|
|
|
return modalType === 'multiple' ? /*#__PURE__*/(0,jsx_runtime.jsx)(ReuseMultipleShixunModal, objectSpread2_default()({}, props)) : /*#__PURE__*/(0,jsx_runtime.jsx)(ReuseSingleShixunModal, objectSpread2_default()({}, props));
|
|
|
};
|
|
|
/* harmony default export */ var components_ReuseShixunModal = (ReuseShixunModal);
|
|
|
|
|
|
/***/ }),
|
|
|
|
|
|
/***/ 7570:
|
|
|
/*!**********************************************************!*\
|
|
|
!*** ./src/pages/Paperlibrary/See/index.tsx + 2 modules ***!
|
|
|
\**********************************************************/
|
|
|
/***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) {
|
|
|
|
|
|
// ESM COMPAT FLAG
|
|
|
__webpack_require__.r(__webpack_exports__);
|
|
|
|
|
|
// EXPORTS
|
|
|
__webpack_require__.d(__webpack_exports__, {
|
|
|
"default": function() { return /* binding */ Paperlibrary_See; }
|
|
|
});
|
|
|
|
|
|
// 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/toConsumableArray.js
|
|
|
var toConsumableArray = __webpack_require__(861);
|
|
|
var toConsumableArray_default = /*#__PURE__*/__webpack_require__.n(toConsumableArray);
|
|
|
// 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/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: ./src/.umi-production/exports.ts
|
|
|
var _umi_production_exports = __webpack_require__(88275);
|
|
|
// EXTERNAL MODULE: ./node_modules/antd/es/row/index.js
|
|
|
var row = __webpack_require__(71230);
|
|
|
// EXTERNAL MODULE: ./node_modules/antd/es/breadcrumb/index.js + 6 modules
|
|
|
var breadcrumb = __webpack_require__(85673);
|
|
|
// EXTERNAL MODULE: ./node_modules/antd/es/table/index.js + 90 modules
|
|
|
var table = __webpack_require__(63889);
|
|
|
// EXTERNAL MODULE: ./node_modules/@ant-design/icons/es/icons/DownloadOutlined.js + 1 modules
|
|
|
var DownloadOutlined = __webpack_require__(23430);
|
|
|
// EXTERNAL MODULE: ./src/components/EcListItems/Problemset/Card/index.tsx + 1 modules
|
|
|
var Card = __webpack_require__(45983);
|
|
|
// EXTERNAL MODULE: ./src/components/FixedButton/index.tsx + 1 modules
|
|
|
var FixedButton = __webpack_require__(36845);
|
|
|
;// CONCATENATED MODULE: ./src/pages/Paperlibrary/See/index.less?modules
|
|
|
// extracted by mini-css-extract-plugin
|
|
|
/* harmony default export */ var Seemodules = ({"bg":"bg___vBzoO","wrap":"wrap___rrSkg","title":"title___itgaE","btnWrapper":"btnWrapper___F_tyj","titleForExport":"titleForExport___lhBnq","flexRow":"flexRow___cvXQo","flexColumn":"flexColumn___cTDFf","flexJustifyBetween":"flexJustifyBetween___vy_7r","relative":"relative____B_F8","questionNumber":"questionNumber___V4g28","score":"score___dNKpj","selectTopicButton":"selectTopicButton___NO9DO","line":"line___j553x","dragTip":"dragTip___AaESI","typeActive":"typeActive___dLHVW","mouseTypeActive":"mouseTypeActive___N_Yv8","typeName":"typeName___bdcw3","typeNumber":"typeNumber___B6Fic","typeAction":"typeAction___O3dpz","setScore":"setScore___GA5cK","delete":"delete___O2OvN","modal":"modal___0ENtb","table":"table___ZRr4b","glassSeal":"glassSeal___C7Vpa"});
|
|
|
// EXTERNAL MODULE: ./src/pages/Paperlibrary/components/SendToClassModal.tsx + 6 modules
|
|
|
var SendToClassModal = __webpack_require__(61990);
|
|
|
// EXTERNAL MODULE: ./node_modules/html2pdf.js/dist/html2pdf.js
|
|
|
var html2pdf = __webpack_require__(80599);
|
|
|
var html2pdf_default = /*#__PURE__*/__webpack_require__.n(html2pdf);
|
|
|
// EXTERNAL MODULE: ./node_modules/jszip/dist/jszip.min.js
|
|
|
var jszip_min = __webpack_require__(55733);
|
|
|
var jszip_min_default = /*#__PURE__*/__webpack_require__.n(jszip_min);
|
|
|
;// CONCATENATED MODULE: ./src/pages/Paperlibrary/See/exportPDF.ts
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
var scrollView = function scrollView() {
|
|
|
document.body.scrollIntoView();
|
|
|
};
|
|
|
var removeSurplusCanvas = function removeSurplusCanvas() {
|
|
|
document.querySelectorAll('canvas').forEach(function (item) {
|
|
|
(!item.clientWidth || !item.clientHeight) && item.remove();
|
|
|
});
|
|
|
};
|
|
|
var exportPDF = /*#__PURE__*/function () {
|
|
|
var _ref = asyncToGenerator_default()( /*#__PURE__*/regeneratorRuntime_default()().mark(function _callee2(DOMList, fileTitle) {
|
|
|
var opt, worker, _loop, i, zip;
|
|
|
return regeneratorRuntime_default()().wrap(function _callee2$(_context3) {
|
|
|
while (1) switch (_context3.prev = _context3.next) {
|
|
|
case 0:
|
|
|
scrollView();
|
|
|
removeSurplusCanvas();
|
|
|
opt = {
|
|
|
margin: [0, 1, 0, 0],
|
|
|
html2canvas: {
|
|
|
letterRendering: true,
|
|
|
useCORS: true,
|
|
|
allowTaint: false,
|
|
|
width: 810
|
|
|
},
|
|
|
jsPDF: {
|
|
|
unit: 'in',
|
|
|
format: 'letter',
|
|
|
orientation: 'portrait'
|
|
|
}
|
|
|
};
|
|
|
worker = html2pdf_default()();
|
|
|
_loop = /*#__PURE__*/regeneratorRuntime_default()().mark(function _loop(i) {
|
|
|
return regeneratorRuntime_default()().wrap(function _loop$(_context2) {
|
|
|
while (1) switch (_context2.prev = _context2.next) {
|
|
|
case 0:
|
|
|
_context2.next = 2;
|
|
|
return worker.set(opt).from(DOMList[i]).toContainer().toCanvas().toPdf().get('pdf').then( /*#__PURE__*/function () {
|
|
|
var _ref2 = asyncToGenerator_default()( /*#__PURE__*/regeneratorRuntime_default()().mark(function _callee(pdf) {
|
|
|
return regeneratorRuntime_default()().wrap(function _callee$(_context) {
|
|
|
while (1) switch (_context.prev = _context.next) {
|
|
|
case 0:
|
|
|
if (!(i < DOMList.length - 1)) {
|
|
|
_context.next = 3;
|
|
|
break;
|
|
|
}
|
|
|
_context.next = 3;
|
|
|
return pdf.addPage();
|
|
|
case 3:
|
|
|
case "end":
|
|
|
return _context.stop();
|
|
|
}
|
|
|
}, _callee);
|
|
|
}));
|
|
|
return function (_x3) {
|
|
|
return _ref2.apply(this, arguments);
|
|
|
};
|
|
|
}());
|
|
|
case 2:
|
|
|
case "end":
|
|
|
return _context2.stop();
|
|
|
}
|
|
|
}, _loop);
|
|
|
});
|
|
|
i = 0;
|
|
|
case 6:
|
|
|
if (!(i < DOMList.length)) {
|
|
|
_context3.next = 11;
|
|
|
break;
|
|
|
}
|
|
|
return _context3.delegateYield(_loop(i), "t0", 8);
|
|
|
case 8:
|
|
|
i++;
|
|
|
_context3.next = 6;
|
|
|
break;
|
|
|
case 11:
|
|
|
zip = new (jszip_min_default())();
|
|
|
zip.file("".concat(fileTitle, ".pdf"), worker.output("blob"), {
|
|
|
base64: false
|
|
|
});
|
|
|
zip.generateAsync({
|
|
|
type: "blob"
|
|
|
}).then(function (content) {
|
|
|
var link = document.createElement('a');
|
|
|
link.href = window.URL.createObjectURL(content);
|
|
|
link.download = "".concat(fileTitle, ".zip");
|
|
|
document.body.appendChild(link);
|
|
|
var event = new MouseEvent('click');
|
|
|
link.dispatchEvent(event);
|
|
|
document.body.removeChild(link);
|
|
|
});
|
|
|
case 14:
|
|
|
case "end":
|
|
|
return _context3.stop();
|
|
|
}
|
|
|
}, _callee2);
|
|
|
}));
|
|
|
return function exportPDF(_x, _x2) {
|
|
|
return _ref.apply(this, arguments);
|
|
|
};
|
|
|
}();
|
|
|
// EXTERNAL MODULE: ./src/components/AsyncButton/index.tsx
|
|
|
var AsyncButton = __webpack_require__(48559);
|
|
|
// EXTERNAL MODULE: ./src/service/paperlibrary.ts
|
|
|
var service_paperlibrary = __webpack_require__(24410);
|
|
|
// EXTERNAL MODULE: ./src/utils/constant.ts
|
|
|
var constant = __webpack_require__(12729);
|
|
|
// EXTERNAL MODULE: ./node_modules/react/jsx-runtime.js
|
|
|
var jsx_runtime = __webpack_require__(85893);
|
|
|
;// CONCATENATED MODULE: ./src/pages/Paperlibrary/See/index.tsx
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
var See = function See(_ref) {
|
|
|
var _questionName$find, _questionName$find2, _questionName$find3, _questionName$find4, _questionName$find5, _questionName$find6, _questionName$find7, _questionName$find8, _questionName$find9, _paperlibrary$paperDa, _paperlibrary$paperDa2, _paperlibrary$paperDa3, _paperlibrary$paperDa4;
|
|
|
var newExercisePaper = _ref.newExercisePaper,
|
|
|
_ref$isExportBlank = _ref.isExportBlank,
|
|
|
isExportBlank = _ref$isExportBlank === void 0 ? false : _ref$isExportBlank,
|
|
|
paperlibrary = _ref.paperlibrary,
|
|
|
user = _ref.user,
|
|
|
globalSetting = _ref.globalSetting,
|
|
|
loading = _ref.loading,
|
|
|
dispatch = _ref.dispatch;
|
|
|
var params = (0,_umi_production_exports.useParams)();
|
|
|
var _useSearchParams = (0,_umi_production_exports.useSearchParams)(),
|
|
|
_useSearchParams2 = slicedToArray_default()(_useSearchParams, 1),
|
|
|
searchParams = _useSearchParams2[0];
|
|
|
var _useState = (0,react.useState)(),
|
|
|
_useState2 = slicedToArray_default()(_useState, 2),
|
|
|
defaultActiveKey = _useState2[0],
|
|
|
setDefaultActiveKey = _useState2[1];
|
|
|
var id = (0,react.useRef)();
|
|
|
var _useState3 = (0,react.useState)(),
|
|
|
_useState4 = slicedToArray_default()(_useState3, 2),
|
|
|
headData = _useState4[0],
|
|
|
setHeadData = _useState4[1];
|
|
|
var _useState5 = (0,react.useState)(),
|
|
|
_useState6 = slicedToArray_default()(_useState5, 2),
|
|
|
tableData = _useState6[0],
|
|
|
setTableData = _useState6[1];
|
|
|
var _useState7 = (0,react.useState)([]),
|
|
|
_useState8 = slicedToArray_default()(_useState7, 2),
|
|
|
questionName = _useState8[0],
|
|
|
setQuestionName = _useState8[1];
|
|
|
(0,react.useEffect)(function () {
|
|
|
dispatch({
|
|
|
type: 'globalSetting/footerToggle',
|
|
|
payload: false
|
|
|
});
|
|
|
return function () {
|
|
|
dispatch({
|
|
|
type: 'globalSetting/footerToggle',
|
|
|
payload: true
|
|
|
});
|
|
|
};
|
|
|
}, []);
|
|
|
(0,react.useEffect)(function () {
|
|
|
id.current = params === null || params === void 0 ? void 0 : params.id;
|
|
|
setDefaultActiveKey(searchParams.get("defaultActiveKey"));
|
|
|
getPaperData();
|
|
|
getData();
|
|
|
handleGetQuestionName();
|
|
|
}, []);
|
|
|
console.log('---', paperlibrary);
|
|
|
(0,react.useEffect)(function () {
|
|
|
var _newExercisePaper$exe;
|
|
|
if ((_newExercisePaper$exe = newExercisePaper.exerciseExportHeadData) !== null && _newExercisePaper$exe !== void 0 && _newExercisePaper$exe.title) {
|
|
|
var res = newExercisePaper.exerciseExportHeadData;
|
|
|
setHeadData(objectSpread2_default()({}, res || {}));
|
|
|
var _ref2 = res || {},
|
|
|
table = _ref2.table;
|
|
|
var total_score;
|
|
|
var actual_total_score;
|
|
|
if (table !== null && table !== void 0 && table.total_singles_scores || table !== null && table !== void 0 && table.total_doubles_scores || table !== null && table !== void 0 && table.total_nulls_scores || table !== null && table !== void 0 && table.total_judges_scores || table !== null && table !== void 0 && table.total_pros_scores || table !== null && table !== void 0 && table.total_shixuns_scores || table !== null && table !== void 0 && table.total_mains_scores || table !== null && table !== void 0 && table.total_combination_scores || table !== null && table !== void 0 && table.total_bpros_scores) {
|
|
|
total_score = Number(table === null || table === void 0 ? void 0 : table.total_singles_scores) + Number(table === null || table === void 0 ? void 0 : table.total_doubles_scores) + Number(table === null || table === void 0 ? void 0 : table.total_nulls_scores) + Number(table === null || table === void 0 ? void 0 : table.total_judges_scores) + Number(table === null || table === void 0 ? void 0 : table.total_pros_scores) + Number(table === null || table === void 0 ? void 0 : table.total_shixuns_scores) + Number(table === null || table === void 0 ? void 0 : table.total_mains_scores) + Number(table === null || table === void 0 ? void 0 : table.total_combination_scores) + Number(table === null || table === void 0 ? void 0 : table.total_bpros_scores);
|
|
|
}
|
|
|
if (table !== null && table !== void 0 && table.singles_scores || table !== null && table !== void 0 && table.doubles_scores || table !== null && table !== void 0 && table.nulls_scores || table !== null && table !== void 0 && table.judges_scores || table !== null && table !== void 0 && table.pros_scores || table !== null && table !== void 0 && table.bpros_scores || table !== null && table !== void 0 && table.shixuns_scores || table !== null && table !== void 0 && table.mains_scores || table !== null && table !== void 0 && table.combination_scores) {
|
|
|
actual_total_score = Number(table === null || table === void 0 ? void 0 : table.singles_scores) + Number(table === null || table === void 0 ? void 0 : table.doubles_scores) + Number(table === null || table === void 0 ? void 0 : table.nulls_scores) + Number(table === null || table === void 0 ? void 0 : table.judges_scores) + Number(table === null || table === void 0 ? void 0 : table.pros_scores) + Number(table === null || table === void 0 ? void 0 : table.bpros_scores) + Number(table === null || table === void 0 ? void 0 : table.shixuns_scores) + Number(table === null || table === void 0 ? void 0 : table.mains_scores) + Number(table === null || table === void 0 ? void 0 : table.combination_scores);
|
|
|
}
|
|
|
var data = [{
|
|
|
key: '1',
|
|
|
name: '应得分',
|
|
|
singles_score: table === null || table === void 0 ? void 0 : table.total_singles_scores,
|
|
|
doubles_score: table === null || table === void 0 ? void 0 : table.total_doubles_scores,
|
|
|
nulls_score: table === null || table === void 0 ? void 0 : table.total_nulls_scores,
|
|
|
judges_score: table === null || table === void 0 ? void 0 : table.total_judges_scores,
|
|
|
pros_score: table === null || table === void 0 ? void 0 : table.total_pros_scores,
|
|
|
bpros_score: table === null || table === void 0 ? void 0 : table.total_bpros_scores,
|
|
|
shixuns_score: table === null || table === void 0 ? void 0 : table.total_shixuns_scores,
|
|
|
mains_score: table === null || table === void 0 ? void 0 : table.total_mains_scores,
|
|
|
combinations_score: table === null || table === void 0 ? void 0 : table.total_combination_scores,
|
|
|
total_score: total_score
|
|
|
}, {
|
|
|
key: '2',
|
|
|
name: '实得分',
|
|
|
singles_score: table === null || table === void 0 ? void 0 : table.singles_scores,
|
|
|
doubles_score: table === null || table === void 0 ? void 0 : table.doubles_scores,
|
|
|
nulls_score: table === null || table === void 0 ? void 0 : table.nulls_scores,
|
|
|
judges_score: table === null || table === void 0 ? void 0 : table.judges_scores,
|
|
|
pros_score: table === null || table === void 0 ? void 0 : table.pros_scores,
|
|
|
bpros_score: table === null || table === void 0 ? void 0 : table.bpros_scores,
|
|
|
shixuns_score: table === null || table === void 0 ? void 0 : table.shixuns_scores,
|
|
|
mains_score: table === null || table === void 0 ? void 0 : table.mains_scores,
|
|
|
combinations_score: table === null || table === void 0 ? void 0 : table.combination_scores,
|
|
|
total_score: actual_total_score
|
|
|
}, {
|
|
|
key: '3',
|
|
|
name: '评卷人'
|
|
|
}];
|
|
|
var blankData = [{
|
|
|
key: '1',
|
|
|
name: '应得分',
|
|
|
singles_score: table === null || table === void 0 ? void 0 : table.total_singles_scores,
|
|
|
doubles_score: table === null || table === void 0 ? void 0 : table.total_doubles_scores,
|
|
|
nulls_score: table === null || table === void 0 ? void 0 : table.total_nulls_scores,
|
|
|
judges_score: table === null || table === void 0 ? void 0 : table.total_judges_scores,
|
|
|
pros_score: table === null || table === void 0 ? void 0 : table.total_pros_scores,
|
|
|
bpros_score: table === null || table === void 0 ? void 0 : table.total_bpros_scores,
|
|
|
shixuns_score: table === null || table === void 0 ? void 0 : table.total_shixuns_scores,
|
|
|
mains_score: table === null || table === void 0 ? void 0 : table.total_mains_scores,
|
|
|
combinations_score: table === null || table === void 0 ? void 0 : table.combination_scores,
|
|
|
total_score: total_score
|
|
|
}, {
|
|
|
key: '2',
|
|
|
name: '实得分'
|
|
|
}, {
|
|
|
key: '3',
|
|
|
name: '评卷人'
|
|
|
}];
|
|
|
setTableData(toConsumableArray_default()(isExportBlank ? blankData : data));
|
|
|
}
|
|
|
}, [newExercisePaper.exerciseExportHeadData]);
|
|
|
var handleGetQuestionName = /*#__PURE__*/function () {
|
|
|
var _ref3 = asyncToGenerator_default()( /*#__PURE__*/regeneratorRuntime_default()().mark(function _callee() {
|
|
|
var res;
|
|
|
return regeneratorRuntime_default()().wrap(function _callee$(_context) {
|
|
|
while (1) switch (_context.prev = _context.next) {
|
|
|
case 0:
|
|
|
_context.next = 2;
|
|
|
return (0,service_paperlibrary/* getQuestionTypeAlias */.cV)({
|
|
|
id: params.id
|
|
|
});
|
|
|
case 2:
|
|
|
res = _context.sent;
|
|
|
res.status == 0 && setQuestionName(res.data);
|
|
|
case 4:
|
|
|
case "end":
|
|
|
return _context.stop();
|
|
|
}
|
|
|
}, _callee);
|
|
|
}));
|
|
|
return function handleGetQuestionName() {
|
|
|
return _ref3.apply(this, arguments);
|
|
|
};
|
|
|
}();
|
|
|
var getData = /*#__PURE__*/function () {
|
|
|
var _ref4 = asyncToGenerator_default()( /*#__PURE__*/regeneratorRuntime_default()().mark(function _callee2() {
|
|
|
var res, _ref5, table, total_score, actual_total_score, data, blankData;
|
|
|
return regeneratorRuntime_default()().wrap(function _callee2$(_context2) {
|
|
|
while (1) switch (_context2.prev = _context2.next) {
|
|
|
case 0:
|
|
|
_context2.next = 2;
|
|
|
return (0,service_paperlibrary/* getExerciseHeadInfo */.Dq)(params.id);
|
|
|
case 2:
|
|
|
res = _context2.sent;
|
|
|
console.log(res, "res-----------------");
|
|
|
setHeadData(res || {});
|
|
|
_ref5 = res || {}, table = _ref5.table;
|
|
|
if (table !== null && table !== void 0 && table.total_singles_scores || table !== null && table !== void 0 && table.total_doubles_scores || table !== null && table !== void 0 && table.total_nulls_scores || table !== null && table !== void 0 && table.total_judges_scores || table !== null && table !== void 0 && table.total_pros_scores || table !== null && table !== void 0 && table.total_shixuns_scores || table !== null && table !== void 0 && table.total_mains_scores || table !== null && table !== void 0 && table.total_combination_scores || table !== null && table !== void 0 && table.total_bpros_scores) {
|
|
|
total_score = Number(table === null || table === void 0 ? void 0 : table.total_singles_scores) + Number(table === null || table === void 0 ? void 0 : table.total_doubles_scores) + Number(table === null || table === void 0 ? void 0 : table.total_nulls_scores) + Number(table === null || table === void 0 ? void 0 : table.total_judges_scores) + Number(table === null || table === void 0 ? void 0 : table.total_pros_scores) + Number(table === null || table === void 0 ? void 0 : table.total_shixuns_scores) + Number(table === null || table === void 0 ? void 0 : table.total_mains_scores) + Number(table === null || table === void 0 ? void 0 : table.total_combination_scores) + Number(table === null || table === void 0 ? void 0 : table.total_bpros_scores);
|
|
|
}
|
|
|
if (table !== null && table !== void 0 && table.singles_scores || table !== null && table !== void 0 && table.doubles_scores || table !== null && table !== void 0 && table.nulls_scores || table !== null && table !== void 0 && table.judges_scores || table !== null && table !== void 0 && table.pros_scores || table !== null && table !== void 0 && table.bpros_scores || table !== null && table !== void 0 && table.shixuns_scores || table !== null && table !== void 0 && table.mains_scores || table !== null && table !== void 0 && table.combinations_score) {
|
|
|
actual_total_score = Number(table === null || table === void 0 ? void 0 : table.singles_scores) + Number(table === null || table === void 0 ? void 0 : table.doubles_scores) + Number(table === null || table === void 0 ? void 0 : table.nulls_scores) + Number(table === null || table === void 0 ? void 0 : table.judges_scores) + Number(table === null || table === void 0 ? void 0 : table.pros_scores) + Number(table === null || table === void 0 ? void 0 : table.bpros_scores) + Number(table === null || table === void 0 ? void 0 : table.shixuns_scores) + Number(table === null || table === void 0 ? void 0 : table.mains_scores) + Number(table === null || table === void 0 ? void 0 : table.combinations_score);
|
|
|
}
|
|
|
data = [{
|
|
|
key: '1',
|
|
|
name: '应得分',
|
|
|
singles_score: table === null || table === void 0 ? void 0 : table.total_singles_scores,
|
|
|
doubles_score: table === null || table === void 0 ? void 0 : table.total_doubles_scores,
|
|
|
nulls_score: table === null || table === void 0 ? void 0 : table.total_nulls_scores,
|
|
|
judges_score: table === null || table === void 0 ? void 0 : table.total_judges_scores,
|
|
|
pros_score: table === null || table === void 0 ? void 0 : table.total_pros_scores,
|
|
|
bpros_score: table === null || table === void 0 ? void 0 : table.total_bpros_scores,
|
|
|
shixuns_score: table === null || table === void 0 ? void 0 : table.total_shixuns_scores,
|
|
|
combinations_score: table === null || table === void 0 ? void 0 : table.total_combination_scores,
|
|
|
mains_score: table === null || table === void 0 ? void 0 : table.total_mains_scores,
|
|
|
total_score: total_score
|
|
|
}, {
|
|
|
key: '2',
|
|
|
name: '实得分',
|
|
|
singles_score: table === null || table === void 0 ? void 0 : table.singles_scores,
|
|
|
doubles_score: table === null || table === void 0 ? void 0 : table.doubles_scores,
|
|
|
nulls_score: table === null || table === void 0 ? void 0 : table.nulls_scores,
|
|
|
judges_score: table === null || table === void 0 ? void 0 : table.judges_scores,
|
|
|
pros_score: table === null || table === void 0 ? void 0 : table.pros_scores,
|
|
|
bpros_score: table === null || table === void 0 ? void 0 : table.bpros_scores,
|
|
|
shixuns_score: table === null || table === void 0 ? void 0 : table.shixuns_scores,
|
|
|
mains_score: table === null || table === void 0 ? void 0 : table.mains_scores,
|
|
|
combinations_score: table === null || table === void 0 ? void 0 : table.combination_scores,
|
|
|
total_score: actual_total_score
|
|
|
}, {
|
|
|
key: '3',
|
|
|
name: '评卷人'
|
|
|
}];
|
|
|
blankData = [{
|
|
|
key: '1',
|
|
|
name: '应得分'
|
|
|
}, {
|
|
|
key: '2',
|
|
|
name: '实得分'
|
|
|
}, {
|
|
|
key: '3',
|
|
|
name: '评卷人'
|
|
|
}];
|
|
|
setTableData(isExportBlank ? blankData : data);
|
|
|
case 11:
|
|
|
case "end":
|
|
|
return _context2.stop();
|
|
|
}
|
|
|
}, _callee2);
|
|
|
}));
|
|
|
return function getData() {
|
|
|
return _ref4.apply(this, arguments);
|
|
|
};
|
|
|
}();
|
|
|
var columns = [{
|
|
|
width: '9%',
|
|
|
title: '题型',
|
|
|
align: 'center',
|
|
|
dataIndex: 'name',
|
|
|
render: function render(text) {
|
|
|
return /*#__PURE__*/(0,jsx_runtime.jsx)("a", {
|
|
|
children: text
|
|
|
});
|
|
|
}
|
|
|
}, {
|
|
|
width: '9%',
|
|
|
title: ((_questionName$find = questionName.find(function (item) {
|
|
|
return item.value == constant/* QUESTIONTYPE.0.nameType */.f[0].nameType;
|
|
|
})) === null || _questionName$find === void 0 ? void 0 : _questionName$find.name) || constant/* QUESTIONTYPE.0.name */.f[0].name,
|
|
|
align: 'center',
|
|
|
dataIndex: 'singles_score',
|
|
|
render: function render(text) {
|
|
|
return /*#__PURE__*/(0,jsx_runtime.jsx)("a", {
|
|
|
children: text === '0.0' ? 0 : text
|
|
|
});
|
|
|
}
|
|
|
}, {
|
|
|
width: '9%',
|
|
|
title: ((_questionName$find2 = questionName.find(function (item) {
|
|
|
return item.value == constant/* QUESTIONTYPE.1.nameType */.f[1].nameType;
|
|
|
})) === null || _questionName$find2 === void 0 ? void 0 : _questionName$find2.name) || constant/* QUESTIONTYPE.1.name */.f[1].name,
|
|
|
align: 'center',
|
|
|
dataIndex: 'doubles_score',
|
|
|
render: function render(text) {
|
|
|
return /*#__PURE__*/(0,jsx_runtime.jsx)("a", {
|
|
|
children: text === '0.0' ? 0 : text
|
|
|
});
|
|
|
}
|
|
|
}, {
|
|
|
width: '9%',
|
|
|
title: ((_questionName$find3 = questionName.find(function (item) {
|
|
|
return item.value == constant/* QUESTIONTYPE.3.nameType */.f[3].nameType;
|
|
|
})) === null || _questionName$find3 === void 0 ? void 0 : _questionName$find3.name) || constant/* QUESTIONTYPE.3.name */.f[3].name,
|
|
|
align: 'center',
|
|
|
dataIndex: 'nulls_score',
|
|
|
render: function render(text) {
|
|
|
return /*#__PURE__*/(0,jsx_runtime.jsx)("a", {
|
|
|
children: text === '0.0' ? 0 : text
|
|
|
});
|
|
|
}
|
|
|
}, {
|
|
|
width: '9%',
|
|
|
title: ((_questionName$find4 = questionName.find(function (item) {
|
|
|
return item.value == constant/* QUESTIONTYPE.2.nameType */.f[2].nameType;
|
|
|
})) === null || _questionName$find4 === void 0 ? void 0 : _questionName$find4.name) || constant/* QUESTIONTYPE.2.name */.f[2].name,
|
|
|
align: 'center',
|
|
|
dataIndex: 'judges_score',
|
|
|
render: function render(text) {
|
|
|
return /*#__PURE__*/(0,jsx_runtime.jsx)("a", {
|
|
|
children: text === '0.0' ? 0 : text
|
|
|
});
|
|
|
}
|
|
|
}, {
|
|
|
width: '9%',
|
|
|
title: ((_questionName$find5 = questionName.find(function (item) {
|
|
|
return item.value == constant/* QUESTIONTYPE.6.nameType */.f[6].nameType;
|
|
|
})) === null || _questionName$find5 === void 0 ? void 0 : _questionName$find5.name) || constant/* QUESTIONTYPE.6.name */.f[6].name,
|
|
|
align: 'center',
|
|
|
dataIndex: 'pros_score',
|
|
|
render: function render(text) {
|
|
|
return /*#__PURE__*/(0,jsx_runtime.jsx)("a", {
|
|
|
children: text === '0.0' ? 0 : text
|
|
|
});
|
|
|
}
|
|
|
}, {
|
|
|
width: '9%',
|
|
|
title: ((_questionName$find6 = questionName.find(function (item) {
|
|
|
return item.value == constant/* QUESTIONTYPE.5.nameType */.f[5].nameType;
|
|
|
})) === null || _questionName$find6 === void 0 ? void 0 : _questionName$find6.name) || constant/* QUESTIONTYPE.5.name */.f[5].name,
|
|
|
align: 'center',
|
|
|
dataIndex: 'shixuns_score',
|
|
|
render: function render(text) {
|
|
|
return /*#__PURE__*/(0,jsx_runtime.jsx)("a", {
|
|
|
children: text === '0.0' ? 0 : text
|
|
|
});
|
|
|
}
|
|
|
}, {
|
|
|
width: '9%',
|
|
|
title: ((_questionName$find7 = questionName.find(function (item) {
|
|
|
return item.value == constant/* QUESTIONTYPE.4.nameType */.f[4].nameType;
|
|
|
})) === null || _questionName$find7 === void 0 ? void 0 : _questionName$find7.name) || constant/* QUESTIONTYPE.4.name */.f[4].name,
|
|
|
align: 'center',
|
|
|
dataIndex: 'mains_score',
|
|
|
render: function render(text) {
|
|
|
return /*#__PURE__*/(0,jsx_runtime.jsx)("a", {
|
|
|
children: text === '0.0' ? 0 : text
|
|
|
});
|
|
|
}
|
|
|
}, {
|
|
|
width: '9%',
|
|
|
title: ((_questionName$find8 = questionName.find(function (item) {
|
|
|
return item.value == constant/* QUESTIONTYPE.7.nameType */.f[7].nameType;
|
|
|
})) === null || _questionName$find8 === void 0 ? void 0 : _questionName$find8.name) || constant/* QUESTIONTYPE.7.name */.f[7].name,
|
|
|
align: 'center',
|
|
|
dataIndex: 'combinations_score',
|
|
|
render: function render(text) {
|
|
|
return /*#__PURE__*/(0,jsx_runtime.jsx)("a", {
|
|
|
children: text === '0.0' ? 0 : text
|
|
|
});
|
|
|
}
|
|
|
}, {
|
|
|
width: '10%',
|
|
|
title: ((_questionName$find9 = questionName.find(function (item) {
|
|
|
return item.value == constant/* QUESTIONTYPE.8.nameType */.f[8].nameType;
|
|
|
})) === null || _questionName$find9 === void 0 ? void 0 : _questionName$find9.name) || constant/* QUESTIONTYPE.8.name */.f[8].name,
|
|
|
align: 'center',
|
|
|
dataIndex: 'bpros_score',
|
|
|
render: function render(text) {
|
|
|
return /*#__PURE__*/(0,jsx_runtime.jsx)("a", {
|
|
|
children: text === '0.0' ? 0 : text
|
|
|
});
|
|
|
}
|
|
|
}, {
|
|
|
width: '9%',
|
|
|
title: '总分',
|
|
|
align: 'center',
|
|
|
dataIndex: 'total_score',
|
|
|
render: function render(text) {
|
|
|
return /*#__PURE__*/(0,jsx_runtime.jsx)("a", {
|
|
|
children: text === '0.0' ? 0 : text ? parseFloat(text).toFixed(1) : ''
|
|
|
});
|
|
|
}
|
|
|
}];
|
|
|
var getPaperData = function getPaperData() {
|
|
|
dispatch({
|
|
|
type: 'paperlibrary/getPaperData',
|
|
|
payload: {
|
|
|
id: id.current
|
|
|
}
|
|
|
});
|
|
|
};
|
|
|
var handleDragEnd = /*#__PURE__*/function () {
|
|
|
var _ref6 = asyncToGenerator_default()( /*#__PURE__*/regeneratorRuntime_default()().mark(function _callee3(data, paperItem) {
|
|
|
var itemId, position, res;
|
|
|
return regeneratorRuntime_default()().wrap(function _callee3$(_context3) {
|
|
|
while (1) switch (_context3.prev = _context3.next) {
|
|
|
case 0:
|
|
|
if (!(!data.destination || !data.source)) {
|
|
|
_context3.next = 2;
|
|
|
break;
|
|
|
}
|
|
|
return _context3.abrupt("return");
|
|
|
case 2:
|
|
|
itemId = paperItem.questions[data.source.index].id;
|
|
|
position = data.destination.index + 1;
|
|
|
_context3.next = 6;
|
|
|
return dispatch({
|
|
|
type: 'paperlibrary/adjustPosition',
|
|
|
payload: {
|
|
|
id: id.current,
|
|
|
itemId: itemId,
|
|
|
position: position
|
|
|
}
|
|
|
});
|
|
|
case 6:
|
|
|
res = _context3.sent;
|
|
|
if (!(res.status === -1)) {
|
|
|
_context3.next = 9;
|
|
|
break;
|
|
|
}
|
|
|
return _context3.abrupt("return");
|
|
|
case 9:
|
|
|
getPaperData();
|
|
|
case 10:
|
|
|
case "end":
|
|
|
return _context3.stop();
|
|
|
}
|
|
|
}, _callee3);
|
|
|
}));
|
|
|
return function handleDragEnd(_x, _x2) {
|
|
|
return _ref6.apply(this, arguments);
|
|
|
};
|
|
|
}();
|
|
|
var handleSendToClass = function handleSendToClass() {
|
|
|
dispatch({
|
|
|
type: 'paperlibrary/setActionTabs',
|
|
|
payload: {
|
|
|
key: 'Paperlibrary-SendToClass',
|
|
|
params: {
|
|
|
id: id.current
|
|
|
}
|
|
|
}
|
|
|
});
|
|
|
};
|
|
|
var paperDomRef = (0,react.useRef)();
|
|
|
var _useState9 = (0,react.useState)(false),
|
|
|
_useState10 = slicedToArray_default()(_useState9, 2),
|
|
|
showAnswer = _useState10[0],
|
|
|
setShowAnswer = _useState10[1];
|
|
|
var handleExportPaper = /*#__PURE__*/function () {
|
|
|
var _ref7 = asyncToGenerator_default()( /*#__PURE__*/regeneratorRuntime_default()().mark(function _callee4() {
|
|
|
return regeneratorRuntime_default()().wrap(function _callee4$(_context4) {
|
|
|
while (1) switch (_context4.prev = _context4.next) {
|
|
|
case 0:
|
|
|
setShowAnswer(false);
|
|
|
_context4.next = 3;
|
|
|
return exportPDF(paperDomRef.current.children, '导出试卷');
|
|
|
case 3:
|
|
|
case "end":
|
|
|
return _context4.stop();
|
|
|
}
|
|
|
}, _callee4);
|
|
|
}));
|
|
|
return function handleExportPaper() {
|
|
|
return _ref7.apply(this, arguments);
|
|
|
};
|
|
|
}();
|
|
|
var handleExportPaperWithAnswer = /*#__PURE__*/function () {
|
|
|
var _ref8 = asyncToGenerator_default()( /*#__PURE__*/regeneratorRuntime_default()().mark(function _callee5() {
|
|
|
return regeneratorRuntime_default()().wrap(function _callee5$(_context5) {
|
|
|
while (1) switch (_context5.prev = _context5.next) {
|
|
|
case 0:
|
|
|
setShowAnswer(true);
|
|
|
_context5.next = 3;
|
|
|
return exportPDF(paperDomRef.current.children, '导出试卷');
|
|
|
case 3:
|
|
|
case "end":
|
|
|
return _context5.stop();
|
|
|
}
|
|
|
}, _callee5);
|
|
|
}));
|
|
|
return function handleExportPaperWithAnswer() {
|
|
|
return _ref8.apply(this, arguments);
|
|
|
};
|
|
|
}();
|
|
|
return /*#__PURE__*/(0,jsx_runtime.jsxs)("section", {
|
|
|
className: Seemodules.bg,
|
|
|
children: [/*#__PURE__*/(0,jsx_runtime.jsxs)(row/* default */.Z, {
|
|
|
className: "mt30",
|
|
|
justify: "space-between",
|
|
|
children: [/*#__PURE__*/(0,jsx_runtime.jsxs)(breadcrumb/* default */.Z, {
|
|
|
separator: ">",
|
|
|
children: [/*#__PURE__*/(0,jsx_runtime.jsx)(breadcrumb/* default.Item */.Z.Item, {
|
|
|
href: "/paperlibrary",
|
|
|
children: "\u8BD5\u5377\u5E93"
|
|
|
}), /*#__PURE__*/(0,jsx_runtime.jsx)(breadcrumb/* default.Item */.Z.Item, {
|
|
|
href: "/paperlibrary?defaultActiveKey=".concat(defaultActiveKey),
|
|
|
children: defaultActiveKey === "1" ? "公开" : defaultActiveKey === "2" ? "团队共享" : "我创建的"
|
|
|
}), /*#__PURE__*/(0,jsx_runtime.jsx)(breadcrumb/* default.Item */.Z.Item, {
|
|
|
children: "\u8BD5\u5377\u8BE6\u60C5"
|
|
|
})]
|
|
|
}), /*#__PURE__*/(0,jsx_runtime.jsxs)("div", {
|
|
|
className: Seemodules.btnWrapper,
|
|
|
children: [/*#__PURE__*/(0,jsx_runtime.jsx)(AsyncButton/* AsyncButton */.Z, {
|
|
|
style: {
|
|
|
borderRadius: "16px"
|
|
|
},
|
|
|
type: "primary",
|
|
|
icon: /*#__PURE__*/(0,jsx_runtime.jsx)(DownloadOutlined/* default */.Z, {}),
|
|
|
onClick: handleExportPaperWithAnswer,
|
|
|
children: "\u5BFC\u51FA\u7A7A\u767D\u8BD5\u5377+\u7B54\u6848"
|
|
|
}), /*#__PURE__*/(0,jsx_runtime.jsx)(AsyncButton/* AsyncButton */.Z, {
|
|
|
style: {
|
|
|
borderRadius: "16px"
|
|
|
},
|
|
|
type: "primary",
|
|
|
className: "ml10",
|
|
|
icon: /*#__PURE__*/(0,jsx_runtime.jsx)(DownloadOutlined/* default */.Z, {}),
|
|
|
onClick: handleExportPaper,
|
|
|
children: "\u5BFC\u51FA\u7A7A\u767D\u8BD5\u5377"
|
|
|
})]
|
|
|
})]
|
|
|
}), /*#__PURE__*/(0,jsx_runtime.jsx)("div", {
|
|
|
className: Seemodules.wrap,
|
|
|
ref: paperDomRef,
|
|
|
children: /*#__PURE__*/(0,jsx_runtime.jsxs)("div", {
|
|
|
className: "pt20 pb20",
|
|
|
children: [/*#__PURE__*/(0,jsx_runtime.jsx)("div", {
|
|
|
className: Seemodules.titleForExport,
|
|
|
children: (_paperlibrary$paperDa = paperlibrary.paperData) === null || _paperlibrary$paperDa === void 0 ? void 0 : (_paperlibrary$paperDa2 = _paperlibrary$paperDa.exam) === null || _paperlibrary$paperDa2 === void 0 ? void 0 : _paperlibrary$paperDa2.name
|
|
|
}), /*#__PURE__*/(0,jsx_runtime.jsx)("div", {
|
|
|
style: {
|
|
|
fontSize: "15px",
|
|
|
marginBottom: "12px",
|
|
|
textAlign: "left"
|
|
|
},
|
|
|
children: headData === null || headData === void 0 ? void 0 : headData.exercise_description
|
|
|
}), /*#__PURE__*/(0,jsx_runtime.jsxs)("div", {
|
|
|
style: {
|
|
|
textAlign: "center",
|
|
|
fontSize: "15px"
|
|
|
},
|
|
|
children: ["\u5171:\u3010", headData === null || headData === void 0 ? void 0 : headData.large_counts, "\u5927\u9898\u3011\u3010", headData === null || headData === void 0 ? void 0 : headData.total_count, "\u5C0F\u9898\u3011\u3010 \u6EE1\u5206", headData === null || headData === void 0 ? void 0 : headData.score, "\u5206\u3011 \u8003\u8BD5\u65F6\u95F4\uFF1A\u3010", (headData === null || headData === void 0 ? void 0 : headData.time) > -1 ? "".concat(headData === null || headData === void 0 ? void 0 : headData.time, "\u5206\u949F") : "\u4E0D\u9650", "\u3011"]
|
|
|
}), /*#__PURE__*/(0,jsx_runtime.jsx)(table/* default */.Z, {
|
|
|
style: {
|
|
|
margin: "20px auto"
|
|
|
},
|
|
|
className: Seemodules.table,
|
|
|
columns: columns,
|
|
|
dataSource: toConsumableArray_default()(tableData || []),
|
|
|
bordered: true,
|
|
|
pagination: false
|
|
|
}), (_paperlibrary$paperDa3 = paperlibrary.paperData) === null || _paperlibrary$paperDa3 === void 0 ? void 0 : (_paperlibrary$paperDa4 = _paperlibrary$paperDa3.questionList) === null || _paperlibrary$paperDa4 === void 0 ? void 0 : _paperlibrary$paperDa4.map(function (paperItem, paperKey) {
|
|
|
var _paperItem$questions;
|
|
|
return /*#__PURE__*/(0,jsx_runtime.jsxs)("div", {
|
|
|
className: "".concat(Seemodules.relative, " mt20 mb20"),
|
|
|
children: [/*#__PURE__*/(0,jsx_runtime.jsxs)("div", {
|
|
|
className: Seemodules.typeActive,
|
|
|
children: [/*#__PURE__*/(0,jsx_runtime.jsxs)("span", {
|
|
|
className: Seemodules.typeName,
|
|
|
children: [paperItem.number, "\u3001", paperItem.name]
|
|
|
}), /*#__PURE__*/(0,jsx_runtime.jsxs)("span", {
|
|
|
className: Seemodules.typeNumber,
|
|
|
children: ["\uFF08\u5171", paperItem.questions_count, "\u9898\uFF1B\u5171", paperItem.questions_score, "\u5206\uFF09"]
|
|
|
})]
|
|
|
}), /*#__PURE__*/(0,jsx_runtime.jsx)("div", {
|
|
|
className: "mt20",
|
|
|
children: (_paperItem$questions = paperItem.questions) === null || _paperItem$questions === void 0 ? void 0 : _paperItem$questions.map(function (questionItem, qeustionKey) {
|
|
|
return /*#__PURE__*/(0,jsx_runtime.jsx)("div", {
|
|
|
children: /*#__PURE__*/(0,jsx_runtime.jsx)("div", {
|
|
|
children: /*#__PURE__*/(0,jsx_runtime.jsx)(Card/* default */.Z, {
|
|
|
index: qeustionKey,
|
|
|
typeName: paperItem.name,
|
|
|
type: paperItem.type,
|
|
|
data: questionItem,
|
|
|
showAnswer: showAnswer,
|
|
|
isshow: false
|
|
|
})
|
|
|
})
|
|
|
}, questionItem.id);
|
|
|
})
|
|
|
})]
|
|
|
}, paperKey);
|
|
|
})]
|
|
|
})
|
|
|
}), /*#__PURE__*/(0,jsx_runtime.jsx)(FixedButton/* FixedButton */.t, {
|
|
|
okText: "\u53D1\u9001\u8BFE\u5802",
|
|
|
onCancel: function onCancel() {
|
|
|
return _umi_production_exports.history.push("/paperlibrary?defaultActiveKey=".concat(defaultActiveKey));
|
|
|
},
|
|
|
onOk: handleSendToClass
|
|
|
}), /*#__PURE__*/(0,jsx_runtime.jsx)(SendToClassModal/* default */.Z, {})]
|
|
|
});
|
|
|
};
|
|
|
/* harmony default export */ var Paperlibrary_See = ((0,_umi_production_exports.connect)(function (_ref9) {
|
|
|
var paperlibrary = _ref9.paperlibrary,
|
|
|
user = _ref9.user,
|
|
|
loading = _ref9.loading,
|
|
|
globalSetting = _ref9.globalSetting,
|
|
|
newExercisePaper = _ref9.newExercisePaper;
|
|
|
return {
|
|
|
paperlibrary: paperlibrary,
|
|
|
user: user,
|
|
|
globalSetting: globalSetting,
|
|
|
loading: loading.effects,
|
|
|
newExercisePaper: newExercisePaper
|
|
|
};
|
|
|
})(See));
|
|
|
|
|
|
/***/ })
|
|
|
|
|
|
}]); |