You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
NewEduCoderBuild/20139.async.js

3124 lines
139 KiB

This file contains ambiguous Unicode characters!

This file contains ambiguous Unicode characters that may be confused with others in your current locale. If your use case is intentional and legitimate, you can safely ignore this warning. Use the Escape button to highlight these characters.

"use strict";
(self["webpackChunk"] = self["webpackChunk"] || []).push([[20139],{
/***/ 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_SJ5m_develop_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_SJ5m_develop_node_modules_babel_runtime_helpers_objectSpread2_js__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_root_workspace_ppte5yg23_SJ5m_develop_node_modules_babel_runtime_helpers_objectSpread2_js__WEBPACK_IMPORTED_MODULE_0__);
/* harmony import */ var antd_es_button_style__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! antd/es/button/style */ 29913);
/* harmony import */ var antd_es_button__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! antd/es/button */ 71577);
/* harmony import */ var _root_workspace_ppte5yg23_SJ5m_develop_node_modules_babel_runtime_helpers_regeneratorRuntime_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./node_modules/@babel/runtime/helpers/regeneratorRuntime.js */ 17061);
/* harmony import */ var _root_workspace_ppte5yg23_SJ5m_develop_node_modules_babel_runtime_helpers_regeneratorRuntime_js__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(_root_workspace_ppte5yg23_SJ5m_develop_node_modules_babel_runtime_helpers_regeneratorRuntime_js__WEBPACK_IMPORTED_MODULE_2__);
/* harmony import */ var _root_workspace_ppte5yg23_SJ5m_develop_node_modules_babel_runtime_helpers_asyncToGenerator_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./node_modules/@babel/runtime/helpers/asyncToGenerator.js */ 17156);
/* harmony import */ var _root_workspace_ppte5yg23_SJ5m_develop_node_modules_babel_runtime_helpers_asyncToGenerator_js__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__webpack_require__.n(_root_workspace_ppte5yg23_SJ5m_develop_node_modules_babel_runtime_helpers_asyncToGenerator_js__WEBPACK_IMPORTED_MODULE_3__);
/* harmony import */ var _root_workspace_ppte5yg23_SJ5m_develop_node_modules_babel_runtime_helpers_slicedToArray_js__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./node_modules/@babel/runtime/helpers/slicedToArray.js */ 27424);
/* harmony import */ var _root_workspace_ppte5yg23_SJ5m_develop_node_modules_babel_runtime_helpers_slicedToArray_js__WEBPACK_IMPORTED_MODULE_4___default = /*#__PURE__*/__webpack_require__.n(_root_workspace_ppte5yg23_SJ5m_develop_node_modules_babel_runtime_helpers_slicedToArray_js__WEBPACK_IMPORTED_MODULE_4__);
/* harmony import */ var _root_workspace_ppte5yg23_SJ5m_develop_node_modules_babel_runtime_helpers_objectWithoutProperties_js__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ./node_modules/@babel/runtime/helpers/objectWithoutProperties.js */ 70215);
/* harmony import */ var _root_workspace_ppte5yg23_SJ5m_develop_node_modules_babel_runtime_helpers_objectWithoutProperties_js__WEBPACK_IMPORTED_MODULE_5___default = /*#__PURE__*/__webpack_require__.n(_root_workspace_ppte5yg23_SJ5m_develop_node_modules_babel_runtime_helpers_objectWithoutProperties_js__WEBPACK_IMPORTED_MODULE_5__);
/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! react */ 67294);
/* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! react/jsx-runtime */ 85893);
var _excluded = ["children"];
var AsyncButton = function AsyncButton(_ref) {
var children = _ref.children,
props = _root_workspace_ppte5yg23_SJ5m_develop_node_modules_babel_runtime_helpers_objectWithoutProperties_js__WEBPACK_IMPORTED_MODULE_5___default()(_ref, _excluded);
var _useState = (0,react__WEBPACK_IMPORTED_MODULE_6__.useState)(false),
_useState2 = _root_workspace_ppte5yg23_SJ5m_develop_node_modules_babel_runtime_helpers_slicedToArray_js__WEBPACK_IMPORTED_MODULE_4___default()(_useState, 2),
btnLoading = _useState2[0],
setBtnLoading = _useState2[1];
return /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_7__.jsx)(antd_es_button__WEBPACK_IMPORTED_MODULE_8__/* ["default"] */ .Z, _root_workspace_ppte5yg23_SJ5m_develop_node_modules_babel_runtime_helpers_objectSpread2_js__WEBPACK_IMPORTED_MODULE_0___default()(_root_workspace_ppte5yg23_SJ5m_develop_node_modules_babel_runtime_helpers_objectSpread2_js__WEBPACK_IMPORTED_MODULE_0___default()({}, props), {}, {
loading: btnLoading,
onClick: /*#__PURE__*/function () {
var _ref2 = _root_workspace_ppte5yg23_SJ5m_develop_node_modules_babel_runtime_helpers_asyncToGenerator_js__WEBPACK_IMPORTED_MODULE_3___default()( /*#__PURE__*/_root_workspace_ppte5yg23_SJ5m_develop_node_modules_babel_runtime_helpers_regeneratorRuntime_js__WEBPACK_IMPORTED_MODULE_2___default()().mark(function _callee(e) {
return _root_workspace_ppte5yg23_SJ5m_develop_node_modules_babel_runtime_helpers_regeneratorRuntime_js__WEBPACK_IMPORTED_MODULE_2___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 = 10;
break;
case 7:
_context.prev = 7;
_context.t0 = _context["catch"](0);
setBtnLoading(false);
case 10:
case "end":
return _context.stop();
}
}, _callee, null, [[0, 7]]);
}));
return function (_x) {
return _ref2.apply(this, arguments);
};
}(),
children: children
}));
};
/***/ }),
/***/ 59992:
/*!************************************************************************************************!*\
!*** ./src/pages/Paperlibrary/Random/AddAndEdit/components/StepPreview/index.tsx + 10 modules ***!
\************************************************************************************************/
/***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) {
// EXPORTS
__webpack_require__.d(__webpack_exports__, {
"Z": function() { return /* binding */ StepPreview; }
});
// EXTERNAL MODULE: ./node_modules/antd/es/pagination/style/index.js + 1 modules
var style = __webpack_require__(14182);
// EXTERNAL MODULE: ./node_modules/antd/es/pagination/index.js + 10 modules
var pagination = __webpack_require__(260);
// EXTERNAL MODULE: ./node_modules/antd/es/tooltip/style/index.js + 1 modules
var tooltip_style = __webpack_require__(38390);
// EXTERNAL MODULE: ./node_modules/antd/es/tooltip/index.js + 3 modules
var tooltip = __webpack_require__(84908);
// EXTERNAL MODULE: ./node_modules/antd/es/divider/style/index.js + 1 modules
var divider_style = __webpack_require__(98541);
// EXTERNAL MODULE: ./node_modules/antd/es/divider/index.js
var divider = __webpack_require__(27049);
// EXTERNAL MODULE: ./node_modules/antd/es/popover/style/index.js + 1 modules
var popover_style = __webpack_require__(63942);
// EXTERNAL MODULE: ./node_modules/antd/es/popover/index.js
var popover = __webpack_require__(55241);
// EXTERNAL MODULE: ./node_modules/antd/es/button/style/index.js + 1 modules
var button_style = __webpack_require__(29913);
// EXTERNAL MODULE: ./node_modules/antd/es/button/index.js
var es_button = __webpack_require__(71577);
// EXTERNAL MODULE: ./node_modules/antd/es/input/style/index.js + 1 modules
var input_style = __webpack_require__(69463);
// EXTERNAL MODULE: ./node_modules/antd/es/input/index.js + 5 modules
var input = __webpack_require__(75008);
// 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/antd/es/message/style/index.js + 1 modules
var message_style = __webpack_require__(14934);
// EXTERNAL MODULE: ./node_modules/antd/es/message/index.js + 1 modules
var message = __webpack_require__(12461);
// 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/antd/es/input-number/style/index.js + 1 modules
var input_number_style = __webpack_require__(25359);
// EXTERNAL MODULE: ./node_modules/antd/es/input-number/index.js + 9 modules
var input_number = __webpack_require__(87799);
// EXTERNAL MODULE: ./node_modules/antd/es/modal/style/index.js + 1 modules
var modal_style = __webpack_require__(35611);
// EXTERNAL MODULE: ./node_modules/antd/es/modal/index.js + 7 modules
var es_modal = __webpack_require__(85402);
// 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/pages/Paperlibrary/Random/AddAndEdit/components/StepPreview/index.less?modules
// extracted by mini-css-extract-plugin
/* harmony default export */ var StepPreviewmodules = ({"flex_box_center":"flex_box_center___bZaL5","flex_space_between":"flex_space_between___oaJSq","flex_box_vertical_center":"flex_box_vertical_center____hsuP","flex_box_center_end":"flex_box_center_end___ZYbPQ","flex_box_column":"flex_box_column___nE_62","wrap":"wrap___ulhwR","left":"left___kyWln","title":"title___jsO1D","total":"total___GEhiU","list":"list___u9dBZ","name":"name___Wxggs","b":"b___Y15YO","r":"r___mKQoe","l":"l___uelFD","tag":"tag___Mpkbg","right":"right___mQ3dU","examName":"examName___Na1r8","t":"t___IgCWK","num":"num___CXI8j","topWarp":"topWarp___Kicpu","head":"head___jx3W8","so":"so___qYW7F","btn":"btn___EMJDz","content":"content___sHGsV","titleWrap":"titleWrap___I__GR","single":"single___K5iv9","analysis":"analysis___NoAuR","text":"text___xESW2","btnsElse":"btnsElse___FPu2o","btnsWrap":"btnsWrap___GNs1j","btns":"btns___dsNVj","modalColumn":"modalColumn___I_tK_","modalRow":"modalRow___lyw_U","sup":"sup___HSz3Z","popover":"popover___kE8aI"});
;// CONCATENATED MODULE: ./src/assets/images/paper/zhong.svg
function _createForOfIteratorHelper(o, allowArrayLike) { var it = typeof Symbol !== "undefined" && o[Symbol.iterator] || o["@@iterator"]; if (!it) { if (Array.isArray(o) || (it = _unsupportedIterableToArray(o)) || allowArrayLike && o && typeof o.length === "number") { if (it) o = it; var i = 0; var F = function F() {}; return { s: F, n: function n() { if (i >= o.length) return { done: true }; return { done: false, value: o[i++] }; }, e: function e(_e) { throw _e; }, f: F }; } throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); } var normalCompletion = true, didErr = false, err; return { s: function s() { it = it.call(o); }, n: function n() { var step = it.next(); normalCompletion = step.done; return step; }, e: function e(_e2) { didErr = true; err = _e2; }, f: function f() { try { if (!normalCompletion && it["return"] != null) it["return"](); } finally { if (didErr) throw err; } } }; }
function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === "string") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return Array.from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); }
function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) arr2[i] = arr[i]; return arr2; }
var __defProp = Object.defineProperty;
var __getOwnPropSymbols = Object.getOwnPropertySymbols;
var __hasOwnProp = Object.prototype.hasOwnProperty;
var __propIsEnum = Object.prototype.propertyIsEnumerable;
var __defNormalProp = function __defNormalProp(obj, key, value) {
return key in obj ? __defProp(obj, key, {
enumerable: true,
configurable: true,
writable: true,
value: value
}) : obj[key] = value;
};
var __spreadValues = function __spreadValues(a, b) {
for (var prop in b || (b = {})) if (__hasOwnProp.call(b, prop)) __defNormalProp(a, prop, b[prop]);
if (__getOwnPropSymbols) {
var _iterator = _createForOfIteratorHelper(__getOwnPropSymbols(b)),
_step;
try {
for (_iterator.s(); !(_step = _iterator.n()).done;) {
var prop = _step.value;
if (__propIsEnum.call(b, prop)) __defNormalProp(a, prop, b[prop]);
}
} catch (err) {
_iterator.e(err);
} finally {
_iterator.f();
}
}
return a;
};
var SvgZhong = function SvgZhong(props) {
return /* @__PURE__ */React.createElement("svg", __spreadValues({
width: 34,
height: 34,
xmlns: "http://www.w3.org/2000/svg"
}, props), /* @__PURE__ */React.createElement("title", null, "\u7F16\u7EC4 6"), /* @__PURE__ */React.createElement("g", {
fill: "none",
fillRule: "evenodd"
}, /* @__PURE__ */React.createElement("rect", {
fill: "#E4E6FD",
width: 34,
height: 34,
rx: 10
}), /* @__PURE__ */React.createElement("g", {
fillRule: "nonzero"
}, /* @__PURE__ */React.createElement("path", {
d: "M13.808 11.448a.558.558 0 0 1 0 .788l-1.564 1.565a.558.558 0 1 1-.789-.79l1.564-1.563a.558.558 0 0 1 .79 0Zm9.882 2.462a.558.558 0 0 1-.789 0l-1.564-1.563a.558.558 0 1 1 .789-.789l1.564 1.564a.556.556 0 0 1 0 .788Z",
fill: "#6678EB"
}), /* @__PURE__ */React.createElement("path", {
d: "M21.753 21.707a5.937 5.937 0 1 0-8.58.015l-.937.936a.558.558 0 1 0 .789.788l.995-.994a5.91 5.91 0 0 0 3.436 1.095c1.287 0 2.48-.41 3.452-1.106l.992.992a.558.558 0 1 0 .789-.789l-.936-.937Z",
fill: "#6678EB"
}), /* @__PURE__ */React.createElement("path", {
d: "m20.858 18.95-3.024-1.745v-2.054a.558.558 0 1 0-1.117 0v2.351c0 .064.011.126.031.184a.551.551 0 0 0 .258.33l3.293 1.9a.557.557 0 0 0 .559-.966Z",
fill: "#FFF"
}))));
};
/* harmony default export */ var zhong = ("data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMzQiIGhlaWdodD0iMzQiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyI+PGcgZmlsbD0ibm9uZSIgZmlsbC1ydWxlPSJldmVub2RkIj48cmVjdCBmaWxsPSIjRTRFNkZEIiB3aWR0aD0iMzQiIGhlaWdodD0iMzQiIHJ4PSIxMCIvPjxnIGZpbGwtcnVsZT0ibm9uemVybyI+PHBhdGggZD0iTTEzLjgwOCAxMS40NDhhLjU1OC41NTggMCAwIDEgMCAuNzg4bC0xLjU2NCAxLjU2NWEuNTU4LjU1OCAwIDEgMS0uNzg5LS43OWwxLjU2NC0xLjU2M2EuNTU4LjU1OCAwIDAgMSAuNzkgMFptOS44ODIgMi40NjJhLjU1OC41NTggMCAwIDEtLjc4OSAwbC0xLjU2NC0xLjU2M2EuNTU4LjU1OCAwIDEgMSAuNzg5LS43ODlsMS41NjQgMS41NjRhLjU1Ni41NTYgMCAwIDEgMCAuNzg4WiIgZmlsbD0iIzY2NzhFQiIvPjxwYXRoIGQ9Ik0yMS43NTMgMjEuNzA3YTUuOTM3IDUuOTM3IDAgMSAwLTguNTguMDE1bC0uOTM3LjkzNmEuNTU4LjU1OCAwIDEgMCAuNzg5Ljc4OGwuOTk1LS45OTRhNS45MSA1LjkxIDAgMCAwIDMuNDM2IDEuMDk1YzEuMjg3IDAgMi40OC0uNDEgMy40NTItMS4xMDZsLjk5Mi45OTJhLjU1OC41NTggMCAxIDAgLjc4OS0uNzg5bC0uOTM2LS45MzdaIiBmaWxsPSIjNjY3OEVCIi8+PHBhdGggZD0ibTIwLjg1OCAxOC45NS0zLjAyNC0xLjc0NXYtMi4wNTRhLjU1OC41NTggMCAxIDAtMS4xMTcgMHYyLjM1MWMwIC4wNjQuMDExLjEyNi4wMzEuMTg0YS41NTEuNTUxIDAgMCAwIC4yNTguMzNsMy4yOTMgMS45YS41NTcuNTU3IDAgMCAwIC41NTktLjk2NloiIGZpbGw9IiNGRkYiLz48L2c+PC9nPjwvc3ZnPg==");
// EXTERNAL MODULE: ./src/components/RenderHtml/index.tsx + 1 modules
var RenderHtml = __webpack_require__(12768);
// EXTERNAL MODULE: ./src/.umi-production/exports.ts + 8 modules
var _umi_production_exports = __webpack_require__(89214);
// EXTERNAL MODULE: ./src/utils/fetch.ts
var fetch = __webpack_require__(84519);
// EXTERNAL MODULE: ./src/assets/images/paper/xixi.svg
var xixi = __webpack_require__(81930);
// EXTERNAL MODULE: ./src/assets/images/paper/bi.svg
var bi = __webpack_require__(48601);
// EXTERNAL MODULE: ./node_modules/lodash/lodash.js
var lodash = __webpack_require__(96486);
// EXTERNAL MODULE: ./src/assets/images/paper/jinshi.svg
var jinshi = __webpack_require__(56606);
// EXTERNAL MODULE: ./node_modules/antd/es/checkbox/style/index.js + 1 modules
var checkbox_style = __webpack_require__(82000);
// EXTERNAL MODULE: ./node_modules/antd/es/checkbox/index.js + 2 modules
var es_checkbox = __webpack_require__(32808);
// 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: ./src/components/markdown-editor/index.tsx + 10 modules
var markdown_editor = __webpack_require__(55373);
// EXTERNAL MODULE: ./src/components/Editor/NullMDEditor.js
var NullMDEditor = __webpack_require__(37863);
// EXTERNAL MODULE: ./src/components/Editor/NullChildEditor/index.jsx + 1 modules
var NullChildEditor = __webpack_require__(2977);
// EXTERNAL MODULE: ./src/utils/util.tsx
var util = __webpack_require__(29427);
;// CONCATENATED MODULE: ./src/pages/Paperlibrary/Random/AddAndEdit/components/StepPreview/components/editor.less?modules
// extracted by mini-css-extract-plugin
/* harmony default export */ var editormodules = ({"wrap":"wrap___OIoOI","modal":"modal___Z3hfU","titleWrap":"titleWrap___aK3oG","required":"required___NHoO7","title":"title___uxb1R","colorGray":"colorGray___O8YPg","choiceWrap":"choiceWrap___t51sb","answer":"answer___vsBnh","activeAnswer":"activeAnswer___AJN4p","deleteIcon":"deleteIcon___WvOJZ","addIcon":"addIcon___UyeIs","editorWrap":"editorWrap___uqcFU","htmlWrap":"htmlWrap___GcBNL","radio":"radio___e8qQ5","color333":"color333___PLzVK","color999":"color999___v3EY0","fold":"fold___OfvPe","head":"head___EejYX"});
// EXTERNAL MODULE: ./node_modules/react/jsx-runtime.js
var jsx_runtime = __webpack_require__(85893);
;// CONCATENATED MODULE: ./src/pages/Paperlibrary/Random/AddAndEdit/components/StepPreview/components/CompletionEditor/index.tsx
var _excluded = ["globalSetting", "loading", "dispatch", "isEdit", "editData"];
var tagList = (/* unused pure expression or super */ null && (['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 CompletionEditor = function CompletionEditor(_ref, ref) {
var globalSetting = _ref.globalSetting,
loading = _ref.loading,
dispatch = _ref.dispatch,
isEdit = _ref.isEdit,
editData = _ref.editData,
props = objectWithoutProperties_default()(_ref, _excluded);
var _useState = (0,react.useState)(''),
_useState2 = slicedToArray_default()(_useState, 2),
title = _useState2[0],
setTitle = _useState2[1];
var _useState3 = (0,react.useState)(''),
_useState4 = slicedToArray_default()(_useState3, 2),
analysis = _useState4[0],
setAnalysis = _useState4[1];
var _useState5 = (0,react.useState)([]),
_useState6 = slicedToArray_default()(_useState5, 2),
answerList = _useState6[0],
setAnswerList = _useState6[1];
var _useState7 = (0,react.useState)(''),
_useState8 = slicedToArray_default()(_useState7, 2),
activeOptionErrorIndex = _useState8[0],
setActiveOptionErrorIndex = _useState8[1];
var _useState9 = (0,react.useState)(),
_useState10 = slicedToArray_default()(_useState9, 2),
checked = _useState10[0],
setChecked = _useState10[1];
var _useState11 = (0,react.useState)(false),
_useState12 = slicedToArray_default()(_useState11, 2),
firstSetAnswerFlag = _useState12[0],
setFirstSetAnswerFlag = _useState12[1];
(0,react.useEffect)(function () {
if (!editData || !isEdit) {
return;
}
setTitle(editData === null || editData === void 0 ? void 0 : editData.name);
setAnalysis(editData === null || editData === void 0 ? void 0 : editData.analysis);
setChecked(editData === null || editData === void 0 ? void 0 : editData.is_ordered);
setFirstSetAnswerFlag(true);
}, [editData]);
(0,react.useEffect)(function () {
if (!firstSetAnswerFlag) {
return;
}
var answer = editData === null || editData === void 0 ? void 0 : editData.standard_answer.map(function (item) {
return item.answer_text;
});
setAnswerList(answer);
setFirstSetAnswerFlag(false);
}, [firstSetAnswerFlag]);
(0,react.useImperativeHandle)(ref, function () {
return {
onSave: onSave,
Clear: Clear
};
});
var onSave = function onSave() {
var answerArray = [];
var isEmpty = false;
if (!title) {
message/* default.info */.ZP.info("请您输入题干");
return false;
}
answerList.forEach(function (answers, index) {
answerArray.push({
position: index + 1,
answer_text: []
});
answers.forEach(function (item, itemIndex) {
answerArray[index].answer_text.push(item);
if (!item || !(0,util/* validateLength */.eR)(item, 10000)) {
setActiveOptionErrorIndex("".concat(index, "-").concat(itemIndex));
message/* default.info */.ZP.info(!item ? "\u7B54\u6848\uFF1A\u4E0D\u80FD\u4E3A\u7A7A" : "答案不能超过10000字符");
isEmpty = true;
}
});
});
if (isEmpty) {
return false;
}
if ((answerArray === null || answerArray === void 0 ? void 0 : answerArray.length) > 20) {
message/* default.warn */.ZP.warn('填空题标准答案不能为空/不能超过20个');
return false;
}
return {
name: title,
analysis: analysis,
standard_answers: answerArray,
is_ordered: checked
};
};
//清空数值
var Clear = function Clear() {
setTitle('');
setAnalysis('');
setAnswerList([]);
setChecked(false);
};
var handlePlaceholderChange = function handlePlaceholderChange(placeholderCountBefore, placeholderCountInRange, totalPlaceholderCount) {
var newStandardAnswers = answerList.slice();
if (placeholderCountInRange) {
newStandardAnswers.splice(placeholderCountBefore, placeholderCountInRange);
}
if (totalPlaceholderCount) {
for (var i = 0; i < totalPlaceholderCount; i++) {
newStandardAnswers.splice(placeholderCountBefore + i, 0, [""]);
}
}
setAnswerList(newStandardAnswers);
};
var handleAnswerChange = function handleAnswerChange(index, itemIndex, val) {
setActiveOptionErrorIndex('');
var newStandardAnswers = answerList.slice();
newStandardAnswers[index][itemIndex] = val;
setAnswerList(newStandardAnswers);
};
var handleAddChildAnswer = function handleAddChildAnswer(index) {
var newStandardAnswers = answerList.slice();
newStandardAnswers[index] = [].concat(toConsumableArray_default()(newStandardAnswers[index]), ['']);
setAnswerList(newStandardAnswers);
};
var handleDeleteChildAnswer = function handleDeleteChildAnswer(index, childIndex) {
var newStandardAnswers = answerList.slice();
if (!newStandardAnswers[index][childIndex]) {
newStandardAnswers[index] = newStandardAnswers[index].filter(function (_, key) {
return key !== childIndex;
});
setAnswerList(newStandardAnswers);
return;
}
es_modal/* default.confirm */.Z.confirm({
centered: true,
okText: '确定',
cancelText: '取消',
title: '提示',
content: '确认要删除这个参考答案吗?',
className: editormodules.modal,
onOk: function onOk() {
newStandardAnswers[index] = newStandardAnswers[index].filter(function (_, key) {
return key !== childIndex;
});
setAnswerList(newStandardAnswers);
}
});
};
var handleDeleteChildAnswermain = function handleDeleteChildAnswermain(index) {
es_modal/* default.confirm */.Z.confirm({
centered: true,
okText: '确定',
cancelText: '取消',
title: '提示',
content: '确认要删除这个参考答案吗?',
className: editormodules.modal,
onOk: function onOk() {
var newStandardAnswers = answerList.slice();
newStandardAnswers = answerList.filter(function (_, key) {
return index !== key;
});
setAnswerList(newStandardAnswers);
}
});
};
return /*#__PURE__*/(0,jsx_runtime.jsxs)("section", {
className: editormodules.wrap,
children: [/*#__PURE__*/(0,jsx_runtime.jsxs)("p", {
className: editormodules.titleWrap,
children: [/*#__PURE__*/(0,jsx_runtime.jsx)("span", {
className: editormodules.required,
children: "*"
}), /*#__PURE__*/(0,jsx_runtime.jsx)("span", {
className: editormodules.title,
children: "\u9898\u5E72\uFF1A"
})]
}), /*#__PURE__*/(0,jsx_runtime.jsx)("div", {
children: /*#__PURE__*/(0,jsx_runtime.jsx)(NullMDEditor/* default */.Z, {
id: "completion-question-tittle",
placeholder: "\u8BF7\u60A8\u8F93\u5165\u9898\u76EE",
height: 155,
defaultValue: title,
onChange: function onChange(value) {
return setTitle(value);
},
showNullButton: true,
onPlaceholderChange: handlePlaceholderChange
})
}), /*#__PURE__*/(0,jsx_runtime.jsx)("div", {
className: "mt20",
children: answerList.map(function (answers, index) {
return /*#__PURE__*/(0,jsx_runtime.jsx)(NullChildEditor/* default */.Z, {
answers: answers,
index: index,
flex: 1,
is_md: true,
activeOptionErrorIndex: activeOptionErrorIndex,
onAnswerChange: handleAnswerChange,
addChildAnswer: handleAddChildAnswer,
deleteChildAnswer: handleDeleteChildAnswer,
deleteChildAnswermain: handleDeleteChildAnswermain
}, index);
})
}), /*#__PURE__*/(0,jsx_runtime.jsx)("div", {
className: "mt20",
children: answerList.length > 1 && /*#__PURE__*/(0,jsx_runtime.jsxs)("span", {
children: [/*#__PURE__*/(0,jsx_runtime.jsx)(es_checkbox/* default */.Z, {
checked: checked,
onChange: function onChange(e) {
return setChecked(e.target.checked);
},
className: "".concat(editormodules.color333, " font14"),
children: "\u591A\u4E2A\u586B\u7A7A\u7684\u7B54\u6848\u6709\u987A\u5E8F\u8981\u6C42"
}), /*#__PURE__*/(0,jsx_runtime.jsx)("span", {
className: "".concat(editormodules.color999, " font12"),
children: "\uFF08\u9009\u4E2D\uFF0C\u6BCF\u4E2A\u586B\u7A7A\u7684\u7B54\u6848\u987A\u5E8F\u5FC5\u987B\u4E0E\u53C2\u8003\u7B54\u6848\u4E00\u81F4\uFF09"
})]
})
}), /*#__PURE__*/(0,jsx_runtime.jsx)("p", {
className: editormodules.titleWrap,
children: /*#__PURE__*/(0,jsx_runtime.jsx)("span", {
className: editormodules.title,
children: "\u9898\u76EE\u89E3\u6790\uFF1A"
})
}), /*#__PURE__*/(0,jsx_runtime.jsx)(markdown_editor/* default */.Z, {
id: "single-question-answer",
watch: true,
height: 155,
placeholder: "\u8BF7\u60A8\u8F93\u5165\u9898\u76EE\u89E3\u6790",
defaultValue: analysis,
onChange: function onChange(value) {
return setAnalysis(value);
}
})]
});
};
/* harmony default export */ var components_CompletionEditor = ((0,_umi_production_exports.connect)(function (_ref2) {
var loading = _ref2.loading,
globalSetting = _ref2.globalSetting;
return {
globalSetting: globalSetting,
loading: loading.effects
};
}, null, null, {
forwardRef: true
})( /*#__PURE__*/(0,react.forwardRef)(CompletionEditor)));
// EXTERNAL MODULE: ./node_modules/antd/es/radio/style/index.js + 1 modules
var radio_style = __webpack_require__(83822);
// EXTERNAL MODULE: ./node_modules/antd/es/radio/index.js + 4 modules
var es_radio = __webpack_require__(29924);
;// CONCATENATED MODULE: ./src/pages/Paperlibrary/Random/AddAndEdit/components/StepPreview/components/JudgmentEditor/index.tsx
var JudgmentEditor_excluded = ["globalSetting", "loading", "editData", "dispatch", "onRef", "isEdit"];
var JudgmentEditor_tagList = (/* unused pure expression or super */ null && (['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 JudgmentEditor = function JudgmentEditor(_ref, ref) {
var globalSetting = _ref.globalSetting,
loading = _ref.loading,
editData = _ref.editData,
dispatch = _ref.dispatch,
_ref$onRef = _ref.onRef,
onRef = _ref$onRef === void 0 ? function () {} : _ref$onRef,
isEdit = _ref.isEdit,
props = objectWithoutProperties_default()(_ref, JudgmentEditor_excluded);
var _useState = (0,react.useState)(),
_useState2 = slicedToArray_default()(_useState, 2),
activeAnswer = _useState2[0],
setActiveAnswer = _useState2[1];
var _useState3 = (0,react.useState)(''),
_useState4 = slicedToArray_default()(_useState3, 2),
title = _useState4[0],
setTitle = _useState4[1];
var _useState5 = (0,react.useState)(''),
_useState6 = slicedToArray_default()(_useState5, 2),
analysis = _useState6[0],
setAnalysis = _useState6[1];
(0,react.useEffect)(function () {
if (!editData || !isEdit) {
return;
}
setTitle(editData === null || editData === void 0 ? void 0 : editData.name);
setAnalysis(editData === null || editData === void 0 ? void 0 : editData.analysis);
var answer = editData === null || editData === void 0 ? void 0 : editData.choices.find(function (item) {
return item.is_answer;
});
setActiveAnswer(answer.choice_text === '正确' ? '0' : '1');
}, [editData]);
(0,react.useImperativeHandle)(ref, function () {
return {
onSave: onSave,
Clear: Clear
};
});
var onSave = function onSave() {
if (!title) {
message/* default.info */.ZP.info("请您输入题干");
return false;
}
if (!activeAnswer) {
message/* default.info */.ZP.info("请先点击选择本选择题的正确选项");
return false;
}
var choices = [{
choice_text: "正确",
is_answer: activeAnswer === "0" ? 1 : 0
}, {
choice_text: "错误",
is_answer: activeAnswer === "1" ? 1 : 0
}];
return {
name: title,
choices: choices,
analysis: analysis
};
};
//清空数值
var Clear = function Clear() {
setTitle('');
setAnalysis('');
setActiveAnswer('');
};
return /*#__PURE__*/(0,jsx_runtime.jsxs)("section", {
className: editormodules.wrap,
children: [/*#__PURE__*/(0,jsx_runtime.jsxs)("p", {
className: editormodules.titleWrap,
children: [/*#__PURE__*/(0,jsx_runtime.jsx)("span", {
className: editormodules.required,
children: "*"
}), /*#__PURE__*/(0,jsx_runtime.jsx)("span", {
className: editormodules.title,
children: "\u9898\u5E72\uFF1A"
})]
}), /*#__PURE__*/(0,jsx_runtime.jsx)(markdown_editor/* default */.Z, {
id: "single-question-title",
watch: true,
height: 155,
placeholder: "\u8BF7\u60A8\u8F93\u5165\u9898\u5E72",
defaultValue: title,
onChange: function onChange(value) {
return setTitle(value);
}
}), /*#__PURE__*/(0,jsx_runtime.jsxs)("p", {
className: editormodules.titleWrap,
children: [/*#__PURE__*/(0,jsx_runtime.jsx)("span", {
className: editormodules.required,
children: "*"
}), /*#__PURE__*/(0,jsx_runtime.jsxs)("span", {
className: editormodules.title,
children: ["\u7B54\u6848\u9009\u9879\uFF1A", /*#__PURE__*/(0,jsx_runtime.jsx)("span", {
className: editormodules.colorGray,
children: "\u70B9\u51FB\u9009\u9879\u53EF\u8BBE\u7F6E\u6B63\u786E\u7B54\u6848"
})]
})]
}), /*#__PURE__*/(0,jsx_runtime.jsxs)(es_radio/* default.Group */.ZP.Group, {
buttonStyle: "solid",
value: activeAnswer,
onChange: function onChange(e) {
return setActiveAnswer(e.target.value);
},
children: [/*#__PURE__*/(0,jsx_runtime.jsx)(es_radio/* default.Button */.ZP.Button, {
value: "0",
className: "".concat(editormodules.radio, " mr40"),
children: "\u6B63\u786E"
}), /*#__PURE__*/(0,jsx_runtime.jsx)(es_radio/* default.Button */.ZP.Button, {
value: "1",
className: editormodules.radio,
children: "\u9519\u8BEF"
})]
}), /*#__PURE__*/(0,jsx_runtime.jsx)("p", {
className: editormodules.titleWrap,
children: /*#__PURE__*/(0,jsx_runtime.jsx)("span", {
className: editormodules.title,
children: "\u9898\u76EE\u89E3\u6790\uFF1A"
})
}), /*#__PURE__*/(0,jsx_runtime.jsx)(markdown_editor/* default */.Z, {
id: "single-question-answer",
watch: true,
height: 155,
placeholder: "\u8BF7\u60A8\u8F93\u5165\u9898\u76EE\u89E3\u6790",
defaultValue: analysis,
onChange: function onChange(value) {
return setAnalysis(value);
}
})]
});
};
/* harmony default export */ var components_JudgmentEditor = ((0,_umi_production_exports.connect)(function (_ref2) {
var loading = _ref2.loading,
globalSetting = _ref2.globalSetting;
return {
globalSetting: globalSetting,
loading: loading.effects
};
}, null, null, {
forwardRef: true
})( /*#__PURE__*/(0,react.forwardRef)(JudgmentEditor)));
;// CONCATENATED MODULE: ./src/pages/Paperlibrary/Random/AddAndEdit/components/StepPreview/components/MultipleEditor/index.tsx
var MultipleEditor_excluded = ["editData", "globalSetting", "loading", "dispatch", "onRef", "isEdit"];
var MultipleEditor_tagList = ['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 MultipleEditor = function MultipleEditor(_ref, ref) {
var editData = _ref.editData,
globalSetting = _ref.globalSetting,
loading = _ref.loading,
dispatch = _ref.dispatch,
_ref$onRef = _ref.onRef,
onRef = _ref$onRef === void 0 ? function () {} : _ref$onRef,
isEdit = _ref.isEdit,
props = objectWithoutProperties_default()(_ref, MultipleEditor_excluded);
var _useState = (0,react.useState)([]),
_useState2 = slicedToArray_default()(_useState, 2),
questionChoiceList = _useState2[0],
setQuestionChoiceList = _useState2[1];
var _useState3 = (0,react.useState)(),
_useState4 = slicedToArray_default()(_useState3, 2),
activeEditor = _useState4[0],
setActiveEditor = _useState4[1];
var _useState5 = (0,react.useState)([]),
_useState6 = slicedToArray_default()(_useState5, 2),
activeAnswer = _useState6[0],
setActiveAnswer = _useState6[1];
var _useState7 = (0,react.useState)(''),
_useState8 = slicedToArray_default()(_useState7, 2),
title = _useState8[0],
setTitle = _useState8[1];
var _useState9 = (0,react.useState)(''),
_useState10 = slicedToArray_default()(_useState9, 2),
analysis = _useState10[0],
setAnalysis = _useState10[1];
(0,react.useEffect)(function () {
setQuestionChoiceList(['', '', '', '']);
}, []);
(0,react.useEffect)(function () {
if (!editData || !isEdit) {
return;
}
setTitle(editData === null || editData === void 0 ? void 0 : editData.name);
setAnalysis(editData === null || editData === void 0 ? void 0 : editData.analysis);
setQuestionChoiceList(editData === null || editData === void 0 ? void 0 : editData.choices.map(function (item) {
return item.choice_text;
}));
var answerIndexs = [];
editData === null || editData === void 0 ? void 0 : editData.choices.map(function (item, index) {
if (item.is_answer) {
answerIndexs.push(index);
}
});
setActiveAnswer(answerIndexs);
}, [editData]);
(0,react.useImperativeHandle)(ref, function () {
return {
onSave: onSave,
Clear: Clear
};
});
var onSave = function onSave() {
if (!title) {
message/* default.info */.ZP.info("请您输入题干");
return false;
}
var findNotAnswerIndex = questionChoiceList.findIndex(function (item) {
return !item;
});
if (findNotAnswerIndex > -1) {
message/* default.info */.ZP.info("\u8BF7\u5148\u8F93\u5165 ".concat(MultipleEditor_tagList[findNotAnswerIndex], " \u9009\u9879\u7684\u5185\u5BB9"));
return false;
}
if (!activeAnswer.length) {
message/* default.info */.ZP.info("请设置本题的正确答案点击选项A/B...即可完成设置");
return false;
}
if (activeAnswer.length < 2) {
message/* default.info */.ZP.info("多选题最小正确选项为2个");
return false;
}
var choices = questionChoiceList.map(function (item, index) {
return {
choice_text: item,
is_answer: activeAnswer.includes(index) ? 1 : 0
};
});
return {
name: title,
choices: choices,
analysis: analysis
};
};
//清空数值
var Clear = function Clear() {
setQuestionChoiceList(['', '', '', '']);
setTitle('');
setAnalysis('');
setActiveAnswer('');
};
return /*#__PURE__*/(0,jsx_runtime.jsxs)("section", {
className: editormodules.wrap,
children: [/*#__PURE__*/(0,jsx_runtime.jsxs)("p", {
className: editormodules.titleWrap,
children: [/*#__PURE__*/(0,jsx_runtime.jsx)("span", {
className: editormodules.required,
children: "*"
}), /*#__PURE__*/(0,jsx_runtime.jsx)("span", {
className: editormodules.title,
children: "\u9898\u5E72\uFF1A"
})]
}), /*#__PURE__*/(0,jsx_runtime.jsx)(markdown_editor/* default */.Z, {
id: "single-question-title",
watch: true,
height: 155,
placeholder: "\u8BF7\u60A8\u8F93\u5165\u9898\u5E72",
defaultValue: title,
onChange: function onChange(value) {
return setTitle(value);
}
}), /*#__PURE__*/(0,jsx_runtime.jsxs)("p", {
className: editormodules.titleWrap,
children: [/*#__PURE__*/(0,jsx_runtime.jsx)("span", {
className: editormodules.required,
children: "*"
}), /*#__PURE__*/(0,jsx_runtime.jsxs)("span", {
className: editormodules.title,
children: ["\u7B54\u6848\u9009\u9879\uFF1A", /*#__PURE__*/(0,jsx_runtime.jsx)("span", {
className: editormodules.colorGray,
children: "\u70B9\u51FB\u9009\u9879\u53EF\u8BBE\u7F6E\u6B63\u786E\u7B54\u6848"
})]
})]
}), questionChoiceList.map(function (item, index) {
return /*#__PURE__*/(0,jsx_runtime.jsxs)("div", {
className: editormodules.choiceWrap,
children: [/*#__PURE__*/(0,jsx_runtime.jsx)(tooltip/* default */.Z, {
title: "\u70B9\u51FB\u8BBE\u7F6E\u4E3A\u6807\u51C6\u7B54\u6848",
placement: "left",
children: /*#__PURE__*/(0,jsx_runtime.jsx)("div", {
className: "".concat(editormodules.answer, " ").concat(activeAnswer.includes(index) ? editormodules.activeAnswer : ''),
onClick: function onClick() {
if (activeAnswer.includes(index)) {
setActiveAnswer(activeAnswer.filter(function (item) {
return item !== index;
}));
} else {
setActiveAnswer([].concat(toConsumableArray_default()(activeAnswer), [index]));
}
},
children: MultipleEditor_tagList[index]
})
}), /*#__PURE__*/(0,jsx_runtime.jsx)("div", {
className: editormodules.editorWrap,
children: activeEditor === index ? /*#__PURE__*/(0,jsx_runtime.jsx)(markdown_editor/* default */.Z, {
id: "single-question-option-".concat(index),
watch: true,
height: 155,
placeholder: "\u8BF7\u60A8\u8F93\u5165\u9009\u9879",
defaultValue: item,
onChange: function onChange(value) {
questionChoiceList[index] = value;
setQuestionChoiceList(questionChoiceList);
}
}) : /*#__PURE__*/(0,jsx_runtime.jsx)("div", {
className: editormodules.htmlWrap,
onClick: function onClick() {
return setActiveEditor(index);
},
children: /*#__PURE__*/(0,jsx_runtime.jsx)(RenderHtml/* default */.Z, {
value: item
})
})
}), index > 1 && /*#__PURE__*/(0,jsx_runtime.jsx)(tooltip/* default */.Z, {
title: "\u5220\u9664",
children: /*#__PURE__*/(0,jsx_runtime.jsx)("i", {
className: "".concat(editormodules.deleteIcon, " iconfont icon-htmal5icon19"),
onClick: function onClick() {
setQuestionChoiceList(questionChoiceList.filter(function (_, key) {
return key !== index;
}));
if (activeAnswer.includes(index)) {
setActiveAnswer(activeAnswer.filter(function (item) {
return item !== index;
}));
} else {
setActiveAnswer([].concat(toConsumableArray_default()(activeAnswer), [index]));
}
}
})
}), index < 7 && index === questionChoiceList.length - 1 && /*#__PURE__*/(0,jsx_runtime.jsx)(tooltip/* default */.Z, {
title: "\u65B0\u589E\u53C2\u8003\u7B54\u6848",
children: /*#__PURE__*/(0,jsx_runtime.jsx)("i", {
className: "".concat(editormodules.addIcon, " iconfont icon-roundaddfill ml6"),
onClick: function onClick() {
return setQuestionChoiceList([].concat(toConsumableArray_default()(questionChoiceList), ['']));
}
})
})]
}, index);
}), /*#__PURE__*/(0,jsx_runtime.jsx)("p", {
className: editormodules.titleWrap,
children: /*#__PURE__*/(0,jsx_runtime.jsx)("span", {
className: editormodules.title,
children: "\u9898\u76EE\u89E3\u6790\uFF1A"
})
}), /*#__PURE__*/(0,jsx_runtime.jsx)(markdown_editor/* default */.Z, {
id: "single-question-answer",
watch: true,
height: 155,
placeholder: "\u8BF7\u60A8\u8F93\u5165\u9898\u76EE\u89E3\u6790",
defaultValue: analysis,
onChange: function onChange(value) {
return setAnalysis(value);
}
})]
});
};
/* harmony default export */ var components_MultipleEditor = ((0,_umi_production_exports.connect)(function (_ref2) {
var loading = _ref2.loading,
globalSetting = _ref2.globalSetting;
return {
globalSetting: globalSetting,
loading: loading.effects
};
}, null, null, {
forwardRef: true
})( /*#__PURE__*/(0,react.forwardRef)(MultipleEditor)));
;// CONCATENATED MODULE: ./src/pages/Paperlibrary/Random/AddAndEdit/components/StepPreview/components/SingleEditor/index.tsx
var SingleEditor_excluded = ["editData", "globalSetting", "loading", "dispatch", "onRef", "isEdit"];
var SingleEditor_tagList = ['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 SingleEditor = function SingleEditor(_ref, ref) {
var editData = _ref.editData,
globalSetting = _ref.globalSetting,
loading = _ref.loading,
dispatch = _ref.dispatch,
_ref$onRef = _ref.onRef,
onRef = _ref$onRef === void 0 ? function () {} : _ref$onRef,
isEdit = _ref.isEdit,
props = objectWithoutProperties_default()(_ref, SingleEditor_excluded);
var _useState = (0,react.useState)([]),
_useState2 = slicedToArray_default()(_useState, 2),
questionChoiceList = _useState2[0],
setQuestionChoiceList = _useState2[1];
var _useState3 = (0,react.useState)(),
_useState4 = slicedToArray_default()(_useState3, 2),
activeEditor = _useState4[0],
setActiveEditor = _useState4[1];
var _useState5 = (0,react.useState)(),
_useState6 = slicedToArray_default()(_useState5, 2),
activeAnswer = _useState6[0],
setActiveAnswer = _useState6[1];
var _useState7 = (0,react.useState)(''),
_useState8 = slicedToArray_default()(_useState7, 2),
title = _useState8[0],
setTitle = _useState8[1];
var _useState9 = (0,react.useState)(''),
_useState10 = slicedToArray_default()(_useState9, 2),
analysis = _useState10[0],
setAnalysis = _useState10[1];
(0,react.useEffect)(function () {
setQuestionChoiceList(['', '', '', '']);
}, []);
(0,react.useEffect)(function () {
if (!editData || !isEdit) {
return;
}
setTitle(editData === null || editData === void 0 ? void 0 : editData.name);
setAnalysis(editData === null || editData === void 0 ? void 0 : editData.analysis);
setQuestionChoiceList(editData === null || editData === void 0 ? void 0 : editData.choices.map(function (item) {
return item.choice_text;
}));
setActiveAnswer(editData === null || editData === void 0 ? void 0 : editData.choices.findIndex(function (item) {
return item.is_answer;
}));
}, [editData]);
(0,react.useImperativeHandle)(ref, function () {
return {
onSave: onSave,
Clear: Clear
};
});
var onSave = function onSave() {
if (!title) {
message/* default.info */.ZP.info("请您输入题干");
return false;
}
var findNotAnswerIndex = questionChoiceList.findIndex(function (item) {
return !item;
});
if (findNotAnswerIndex > -1) {
message/* default.info */.ZP.info("\u8BF7\u5148\u8F93\u5165 ".concat(SingleEditor_tagList[findNotAnswerIndex], " \u9009\u9879\u7684\u5185\u5BB9"));
return false;
}
console.log("activeAnswer: ", activeAnswer);
if (!(typeof activeAnswer === "number")) {
message/* default.info */.ZP.info("请设置本题的正确答案点击选项A/B...即可完成设置");
return false;
}
var choices = questionChoiceList.map(function (item, index) {
return {
choice_text: item,
is_answer: activeAnswer === index ? 1 : 0
};
});
return {
name: title,
choices: choices,
analysis: analysis
};
};
//清空数值
var Clear = function Clear() {
setQuestionChoiceList(['', '', '', '']);
setTitle('');
setAnalysis('');
setActiveAnswer('');
};
return /*#__PURE__*/(0,jsx_runtime.jsxs)("section", {
className: editormodules.wrap,
children: [/*#__PURE__*/(0,jsx_runtime.jsxs)("p", {
className: editormodules.titleWrap,
children: [/*#__PURE__*/(0,jsx_runtime.jsx)("span", {
className: editormodules.required,
children: "*"
}), /*#__PURE__*/(0,jsx_runtime.jsx)("span", {
className: editormodules.title,
children: "\u9898\u5E72\uFF1A"
})]
}), /*#__PURE__*/(0,jsx_runtime.jsx)(markdown_editor/* default */.Z, {
id: "single-question-title",
watch: true,
height: 155,
placeholder: "\u8BF7\u60A8\u8F93\u5165\u9898\u5E72",
defaultValue: title,
onChange: function onChange(value) {
return setTitle(value);
}
}), /*#__PURE__*/(0,jsx_runtime.jsxs)("p", {
className: editormodules.titleWrap,
children: [/*#__PURE__*/(0,jsx_runtime.jsx)("span", {
className: editormodules.required,
children: "*"
}), /*#__PURE__*/(0,jsx_runtime.jsxs)("span", {
className: editormodules.title,
children: ["\u7B54\u6848\u9009\u9879\uFF1A", /*#__PURE__*/(0,jsx_runtime.jsx)("span", {
className: editormodules.colorGray,
children: "\u70B9\u51FB\u9009\u9879\u53EF\u8BBE\u7F6E\u6B63\u786E\u7B54\u6848"
})]
})]
}), questionChoiceList.map(function (item, index) {
return /*#__PURE__*/(0,jsx_runtime.jsxs)("div", {
className: editormodules.choiceWrap,
children: [/*#__PURE__*/(0,jsx_runtime.jsx)(tooltip/* default */.Z, {
title: "\u70B9\u51FB\u8BBE\u7F6E\u4E3A\u6807\u51C6\u7B54\u6848",
placement: "left",
children: /*#__PURE__*/(0,jsx_runtime.jsx)("div", {
className: "".concat(editormodules.answer, " ").concat(activeAnswer === index ? editormodules.activeAnswer : ''),
onClick: function onClick() {
return setActiveAnswer(index);
},
children: SingleEditor_tagList[index]
})
}), /*#__PURE__*/(0,jsx_runtime.jsx)("div", {
className: editormodules.editorWrap,
children: activeEditor === index ? /*#__PURE__*/(0,jsx_runtime.jsx)(markdown_editor/* default */.Z, {
id: "single-question-option-".concat(index),
watch: true,
height: 155,
isFocus: true,
placeholder: "\u8BF7\u60A8\u8F93\u5165\u9009\u9879",
defaultValue: item,
onChange: function onChange(value) {
questionChoiceList[index] = value;
setQuestionChoiceList(questionChoiceList);
}
}) : /*#__PURE__*/(0,jsx_runtime.jsx)("div", {
className: editormodules.htmlWrap,
onClick: function onClick() {
return setActiveEditor(index);
},
children: /*#__PURE__*/(0,jsx_runtime.jsx)(RenderHtml/* default */.Z, {
value: item
})
})
}), index > 1 && /*#__PURE__*/(0,jsx_runtime.jsx)(tooltip/* default */.Z, {
title: "\u5220\u9664",
children: /*#__PURE__*/(0,jsx_runtime.jsx)("i", {
className: "".concat(editormodules.deleteIcon, " iconfont icon-htmal5icon19"),
onClick: function onClick() {
setQuestionChoiceList(questionChoiceList.filter(function (_, key) {
return key !== index;
}));
if (index === activeAnswer) {
setActiveAnswer(null);
}
}
})
}), index < 7 && index === questionChoiceList.length - 1 && /*#__PURE__*/(0,jsx_runtime.jsx)(tooltip/* default */.Z, {
title: "\u65B0\u589E\u53C2\u8003\u7B54\u6848",
children: /*#__PURE__*/(0,jsx_runtime.jsx)("i", {
className: "".concat(editormodules.addIcon, " iconfont icon-roundaddfill ml6"),
onClick: function onClick() {
return setQuestionChoiceList([].concat(toConsumableArray_default()(questionChoiceList), ['']));
}
})
})]
}, index);
}), /*#__PURE__*/(0,jsx_runtime.jsx)("p", {
className: editormodules.titleWrap,
children: /*#__PURE__*/(0,jsx_runtime.jsx)("span", {
className: editormodules.title,
children: "\u9898\u76EE\u89E3\u6790\uFF1A"
})
}), /*#__PURE__*/(0,jsx_runtime.jsx)(markdown_editor/* default */.Z, {
id: "single-question-answer",
watch: true,
height: 155,
placeholder: "\u8BF7\u60A8\u8F93\u5165\u9898\u76EE\u89E3\u6790",
defaultValue: analysis,
onChange: function onChange(value) {
return setAnalysis(value);
}
})]
});
};
/* harmony default export */ var components_SingleEditor = ((0,_umi_production_exports.connect)(function (_ref2) {
var loading = _ref2.loading,
globalSetting = _ref2.globalSetting;
return {
globalSetting: globalSetting,
loading: loading.effects
};
}, null, null, {
forwardRef: true
})( /*#__PURE__*/(0,react.forwardRef)(SingleEditor)));
;// CONCATENATED MODULE: ./src/pages/Paperlibrary/Random/AddAndEdit/components/StepPreview/components/SubjectiveEditor/index.tsx
var SubjectiveEditor_excluded = ["editData", "globalSetting", "loading", "dispatch", "onRef", "isEdit"];
var SubjectiveEditor_tagList = (/* unused pure expression or super */ null && (['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 SubjectiveEditor = function SubjectiveEditor(_ref, ref) {
var editData = _ref.editData,
globalSetting = _ref.globalSetting,
loading = _ref.loading,
dispatch = _ref.dispatch,
_ref$onRef = _ref.onRef,
onRef = _ref$onRef === void 0 ? function () {} : _ref$onRef,
isEdit = _ref.isEdit,
props = objectWithoutProperties_default()(_ref, SubjectiveEditor_excluded);
var _useState = (0,react.useState)(''),
_useState2 = slicedToArray_default()(_useState, 2),
title = _useState2[0],
setTitle = _useState2[1];
var _useState3 = (0,react.useState)(''),
_useState4 = slicedToArray_default()(_useState3, 2),
analysis = _useState4[0],
setAnalysis = _useState4[1];
var _useState5 = (0,react.useState)(''),
_useState6 = slicedToArray_default()(_useState5, 2),
answer = _useState6[0],
setAnswer = _useState6[1];
(0,react.useEffect)(function () {
var _editData$answer_text;
if (!editData || !isEdit) {
return;
}
setTitle(editData === null || editData === void 0 ? void 0 : editData.name);
setAnalysis(editData === null || editData === void 0 ? void 0 : editData.analysis);
setAnswer(editData === null || editData === void 0 ? void 0 : (_editData$answer_text = editData.answer_texts) === null || _editData$answer_text === void 0 ? void 0 : _editData$answer_text[0]);
}, [editData]);
(0,react.useImperativeHandle)(ref, function () {
return {
onSave: onSave,
Clear: Clear
};
});
var onSave = function onSave() {
if (!title) {
message/* default.info */.ZP.info("请您输入题干");
return false;
}
if (!answer) {
message/* default.info */.ZP.info("请您输入参考答案");
return false;
}
return {
name: title,
answer_texts: [answer],
analysis: analysis
};
};
//清空数值
var Clear = function Clear() {
setTitle('');
setAnalysis('');
setAnswer('');
};
return /*#__PURE__*/(0,jsx_runtime.jsxs)("section", {
className: editormodules.wrap,
children: [/*#__PURE__*/(0,jsx_runtime.jsxs)("p", {
className: editormodules.titleWrap,
children: [/*#__PURE__*/(0,jsx_runtime.jsx)("span", {
className: editormodules.required,
children: "*"
}), /*#__PURE__*/(0,jsx_runtime.jsx)("span", {
className: editormodules.title,
children: "\u9898\u5E72\uFF1A"
})]
}), /*#__PURE__*/(0,jsx_runtime.jsx)(markdown_editor/* default */.Z, {
id: "single-question-title",
watch: true,
height: 155,
placeholder: "\u8BF7\u60A8\u8F93\u5165\u9898\u5E72",
defaultValue: title,
onChange: function onChange(value) {
return setTitle(value);
}
}), /*#__PURE__*/(0,jsx_runtime.jsx)("p", {
className: editormodules.titleWrap,
children: /*#__PURE__*/(0,jsx_runtime.jsx)("span", {
className: editormodules.title,
children: "\u53C2\u8003\u7B54\u6848\uFF1A"
})
}), /*#__PURE__*/(0,jsx_runtime.jsx)(markdown_editor/* default */.Z, {
id: "single-question-reference-answer",
watch: true,
height: 155,
placeholder: "\u8BF7\u60A8\u8F93\u5165\u53C2\u8003\u7B54\u6848",
defaultValue: answer,
onChange: function onChange(value) {
return setAnswer(value);
}
}), /*#__PURE__*/(0,jsx_runtime.jsx)("p", {
className: editormodules.titleWrap,
children: /*#__PURE__*/(0,jsx_runtime.jsx)("span", {
className: editormodules.title,
children: "\u9898\u76EE\u89E3\u6790\uFF1A"
})
}), /*#__PURE__*/(0,jsx_runtime.jsx)(markdown_editor/* default */.Z, {
id: "single-question-answer",
watch: true,
height: 155,
placeholder: "\u8BF7\u60A8\u8F93\u5165\u9898\u76EE\u89E3\u6790",
defaultValue: analysis,
onChange: function onChange(value) {
return setAnalysis(value);
}
})]
});
};
/* harmony default export */ var components_SubjectiveEditor = ((0,_umi_production_exports.connect)(function (_ref2) {
var loading = _ref2.loading,
globalSetting = _ref2.globalSetting;
return {
globalSetting: globalSetting,
loading: loading.effects
};
}, null, null, {
forwardRef: true
})( /*#__PURE__*/(0,react.forwardRef)(SubjectiveEditor)));
// EXTERNAL MODULE: ./node_modules/@babel/runtime/helpers/objectSpread2.js
var objectSpread2 = __webpack_require__(42122);
var objectSpread2_default = /*#__PURE__*/__webpack_require__.n(objectSpread2);
;// CONCATENATED MODULE: ./src/pages/Paperlibrary/Random/AddAndEdit/components/StepPreview/components/CombinationEditor/index.tsx
var CombinationEditor_excluded = ["globalSetting", "loading", "dispatch", "editData", "onRef", "isEdit"];
var CombinationEditor_tagList = ['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 CombinationEditor = function CombinationEditor(_ref, ref) {
var globalSetting = _ref.globalSetting,
loading = _ref.loading,
dispatch = _ref.dispatch,
editData = _ref.editData,
_ref$onRef = _ref.onRef,
onRef = _ref$onRef === void 0 ? function () {} : _ref$onRef,
isEdit = _ref.isEdit,
props = objectWithoutProperties_default()(_ref, CombinationEditor_excluded);
var _useState = (0,react.useState)(''),
_useState2 = slicedToArray_default()(_useState, 2),
name = _useState2[0],
setName = _useState2[1];
var _useState3 = (0,react.useState)([]),
_useState4 = slicedToArray_default()(_useState3, 2),
questionList = _useState4[0],
setQuestionList = _useState4[1];
console.log(questionList);
(0,react.useEffect)(function () {
var _editData$sub_item_ba;
if (!editData || !isEdit) {
return;
}
setName(editData === null || editData === void 0 ? void 0 : editData.name);
var list = editData === null || editData === void 0 ? void 0 : (_editData$sub_item_ba = editData.sub_item_banks) === null || _editData$sub_item_ba === void 0 ? void 0 : _editData$sub_item_ba.map(function (k) {
var _k$choices, _ref2, _k$choices2;
return objectSpread2_default()(objectSpread2_default()({}, k), {}, {
id: k.id,
open: false,
qusList: k === null || k === void 0 ? void 0 : (_k$choices = k.choices) === null || _k$choices === void 0 ? void 0 : _k$choices.map(function (e) {
return e.choice_text;
}),
activeQusEditor: null,
qusAnswer: (_ref2 = [k === null || k === void 0 ? void 0 : (_k$choices2 = k.choices) === null || _k$choices2 === void 0 ? void 0 : _k$choices2.findIndex(function (e) {
return e.is_answer;
})]) === null || _ref2 === void 0 ? void 0 : _ref2.filter(function (k) {
return k !== -1;
})
});
});
setQuestionList(list);
}, [editData]);
(0,react.useImperativeHandle)(ref, function () {
return {
onSave: onSave,
Clear: Clear
};
});
var onSave = function onSave() {
if (!name) {
message/* default.info */.ZP.info("请您输入题干");
return false;
}
if (questionList.length === 0) {
message/* default.info */.ZP.info("请您添加小题");
return false;
}
for (var i = 0; i < questionList.length; i++) {
var _param$qusList;
var param = questionList[i];
if (!(param !== null && param !== void 0 && param.name)) {
message/* default.info */.ZP.info("\u8BF7\u60A8\u8F93\u5165\u7B2C".concat(i + 1, "\u5C0F\u9898\u9898\u5E72"));
return false;
}
var findNotAnswerIndex = param === null || param === void 0 ? void 0 : (_param$qusList = param.qusList) === null || _param$qusList === void 0 ? void 0 : _param$qusList.findIndex(function (item) {
return !item;
});
if (findNotAnswerIndex > -1) {
message/* default.info */.ZP.info("\u8BF7\u5148\u8F93\u5165\u7B2C".concat(i + 1, "\u5C0F\u9898").concat(CombinationEditor_tagList[findNotAnswerIndex], "\u9009\u9879\u7684\u5185\u5BB9"));
return false;
}
if (!(param !== null && param !== void 0 && param.qusAnswer.length)) {
message/* default.info */.ZP.info("\u8BF7\u8BBE\u7F6E\u7B2C".concat(i + 1, "\u5C0F\u9898\u7684\u6B63\u786E\u7B54\u6848\uFF0C\u70B9\u51FB\u9009\u9879A/B...\u5373\u53EF\u5B8C\u6210\u8BBE\u7F6E"));
return false;
}
}
var sub_item_banks = questionList.map(function (e) {
return {
id: e.id > 1 ? e.id : null,
name: e.name,
item_type: e.item_type,
analysis: e.analysis,
choices: e.qusList.map(function (h, i) {
return {
choice_text: h,
is_answer: e.qusAnswer[0] === i ? 1 : 0
};
})
};
});
return {
name: name,
sub_item_banks: sub_item_banks
};
};
//清空数值
var Clear = function Clear() {
setName('');
setQuestionList([]);
};
var handleAdd = function handleAdd() {
var param = {
id: Math.random(),
item_type: 'SINGLE',
open: false,
name: '',
qusList: ['', '', '', ''],
activeQusEditor: null,
qusAnswer: [],
analysis: ''
};
setQuestionList(questionList.concat(param));
};
var handleQuestionList = function handleQuestionList(type, i, value) {
var cloneQuestionList = (0,lodash.cloneDeep)(questionList);
if (type === 'open') {
cloneQuestionList[i].open = !cloneQuestionList[i].open;
}
if (type === 'delete') {
cloneQuestionList.splice(i, 1);
}
if (type === 'value') {
cloneQuestionList[i].name = value;
}
if (type === 'answer') {
cloneQuestionList[i].qusAnswer = [value];
}
if (type === 'edit') {
cloneQuestionList[i].activeQusEditor = value;
}
if (type === 'details') {
cloneQuestionList[i].qusList[cloneQuestionList[i].activeQusEditor] = value;
}
if (type === 'addQus') {
cloneQuestionList[i].qusList = cloneQuestionList[i].qusList.concat('');
}
if (type === 'deleteQus') {
var _cloneQuestionList$i$;
cloneQuestionList[i].qusList = cloneQuestionList[i].qusList.filter(function (_, c) {
return c !== value;
});
cloneQuestionList[i].qusAnswer = (_cloneQuestionList$i$ = cloneQuestionList[i].qusAnswer) === null || _cloneQuestionList$i$ === void 0 ? void 0 : _cloneQuestionList$i$.filter(function (k) {
return k !== value;
});
}
if (type === 'analysis') {
cloneQuestionList[i].analysis = value;
}
setQuestionList(cloneQuestionList);
};
return /*#__PURE__*/(0,jsx_runtime.jsxs)("section", {
className: editormodules.wrap,
children: [/*#__PURE__*/(0,jsx_runtime.jsxs)("p", {
className: editormodules.titleWrap,
children: [/*#__PURE__*/(0,jsx_runtime.jsx)("span", {
className: editormodules.required,
children: "*"
}), /*#__PURE__*/(0,jsx_runtime.jsx)("span", {
className: editormodules.title,
children: "\u9898\u5E72\uFF1A"
})]
}), /*#__PURE__*/(0,jsx_runtime.jsx)(markdown_editor/* default */.Z, {
id: "combination-question-title",
watch: true,
height: 155,
placeholder: "\u8BF7\u60A8\u8F93\u5165\u9898\u5E72",
defaultValue: name,
onChange: function onChange(value) {
return setName(value);
}
}), questionList === null || questionList === void 0 ? void 0 : questionList.map(function (e, j) {
var _e$qusList;
return /*#__PURE__*/(0,jsx_runtime.jsxs)("div", {
className: editormodules.fold,
children: [/*#__PURE__*/(0,jsx_runtime.jsxs)("div", {
onClick: function onClick() {
return handleQuestionList('open', j);
},
className: editormodules.head,
children: [/*#__PURE__*/(0,jsx_runtime.jsx)("i", {
className: "iconfont icon-sanjiaoxing",
style: {
transform: e.open ? 'initial' : 'rotate(270deg) translate(2px, 4px)'
}
}), /*#__PURE__*/(0,jsx_runtime.jsxs)("span", {
children: ["\u7B2C", j + 1, "\u5C0F\u9898\uFF08\u5355\u9009\u9898\uFF09"]
}), /*#__PURE__*/(0,jsx_runtime.jsx)("b", {
style: {
visibility: 'hidden'
},
onClick: function onClick(e) {
e.stopPropagation();
handleQuestionList('delete', j);
},
className: "iconfont icon-shanchu8"
})]
}), /*#__PURE__*/(0,jsx_runtime.jsxs)("div", {
className: "mb10",
style: {
display: e.open ? 'block' : 'none'
},
children: [/*#__PURE__*/(0,jsx_runtime.jsx)(markdown_editor/* default */.Z, {
watch: true,
height: 155,
placeholder: "\u8BF7\u60A8\u8F93\u5165\u9898\u5E72",
defaultValue: e === null || e === void 0 ? void 0 : e.name,
onChange: function onChange(value) {
return handleQuestionList('value', j, value);
}
}), /*#__PURE__*/(0,jsx_runtime.jsxs)("p", {
className: editormodules.titleWrap,
children: [/*#__PURE__*/(0,jsx_runtime.jsx)("span", {
className: editormodules.required,
children: "*"
}), /*#__PURE__*/(0,jsx_runtime.jsxs)("span", {
className: editormodules.title,
children: ["\u7B54\u6848\u9009\u9879\uFF1A", /*#__PURE__*/(0,jsx_runtime.jsx)("span", {
className: editormodules.colorGray,
children: "\u70B9\u51FB\u9009\u9879\u53EF\u8BBE\u7F6E\u6B63\u786E\u7B54\u6848"
})]
})]
}), e === null || e === void 0 ? void 0 : (_e$qusList = e.qusList) === null || _e$qusList === void 0 ? void 0 : _e$qusList.map(function (item, index) {
var _e$qusAnswer, _e$qusList2;
return /*#__PURE__*/(0,jsx_runtime.jsxs)("div", {
className: editormodules.choiceWrap,
children: [/*#__PURE__*/(0,jsx_runtime.jsx)(tooltip/* default */.Z, {
title: "\u70B9\u51FB\u8BBE\u7F6E\u4E3A\u6807\u51C6\u7B54\u6848",
placement: "left",
children: /*#__PURE__*/(0,jsx_runtime.jsx)("div", {
className: "".concat(editormodules.answer, " ").concat(e !== null && e !== void 0 && (_e$qusAnswer = e.qusAnswer) !== null && _e$qusAnswer !== void 0 && _e$qusAnswer.includes(index) ? editormodules.activeAnswer : ''),
onClick: function onClick() {
return handleQuestionList('answer', j, index);
},
children: CombinationEditor_tagList[index]
})
}), /*#__PURE__*/(0,jsx_runtime.jsx)("div", {
className: editormodules.editorWrap,
children: (e === null || e === void 0 ? void 0 : e.activeQusEditor) === index ? /*#__PURE__*/(0,jsx_runtime.jsx)(markdown_editor/* default */.Z, {
id: "single-question-option-".concat(index),
watch: true,
height: 155,
isFocus: true,
placeholder: "\u8BF7\u60A8\u8F93\u5165\u9009\u9879",
defaultValue: item,
onChange: function onChange(value) {
return handleQuestionList('details', j, value);
}
}) : /*#__PURE__*/(0,jsx_runtime.jsx)("div", {
className: editormodules.htmlWrap,
onClick: function onClick() {
return handleQuestionList('edit', j, index);
},
children: /*#__PURE__*/(0,jsx_runtime.jsx)(RenderHtml/* default */.Z, {
value: item
})
})
}), index > 1 && /*#__PURE__*/(0,jsx_runtime.jsx)(tooltip/* default */.Z, {
title: "\u5220\u9664",
children: /*#__PURE__*/(0,jsx_runtime.jsx)("i", {
className: "".concat(editormodules.deleteIcon, " iconfont icon-htmal5icon19"),
onClick: function onClick() {
return handleQuestionList('deleteQus', j, index);
}
})
}), index < 7 && index === (e === null || e === void 0 ? void 0 : (_e$qusList2 = e.qusList) === null || _e$qusList2 === void 0 ? void 0 : _e$qusList2.length) - 1 && /*#__PURE__*/(0,jsx_runtime.jsx)(tooltip/* default */.Z, {
title: "\u65B0\u589E\u53C2\u8003\u7B54\u6848",
children: /*#__PURE__*/(0,jsx_runtime.jsx)("i", {
className: "".concat(editormodules.addIcon, " iconfont icon-roundaddfill ml6"),
onClick: function onClick() {
return handleQuestionList('addQus', j);
}
})
})]
}, index);
}), /*#__PURE__*/(0,jsx_runtime.jsx)("p", {
className: "mb10 mt10",
children: /*#__PURE__*/(0,jsx_runtime.jsx)("span", {
className: editormodules.title,
children: "\u9898\u76EE\u89E3\u6790\uFF1A"
})
}), /*#__PURE__*/(0,jsx_runtime.jsx)(markdown_editor/* default */.Z, {
id: "single-question-answer",
watch: true,
height: 155,
placeholder: "\u8BF7\u60A8\u8F93\u5165\u9898\u76EE\u89E3\u6790",
defaultValue: e.analysis,
onChange: function onChange(value) {
return handleQuestionList('analysis', j, value);
}
})]
})]
}, e.id);
})]
});
};
/* harmony default export */ var components_CombinationEditor = ((0,_umi_production_exports.connect)(function (_ref3) {
var loading = _ref3.loading,
globalSetting = _ref3.globalSetting;
return {
globalSetting: globalSetting,
loading: loading.effects
};
}, null, null, {
forwardRef: true
})( /*#__PURE__*/(0,react.forwardRef)(CombinationEditor)));
// EXTERNAL MODULE: ./node_modules/antd/es/row/style/index.js
var row_style = __webpack_require__(13062);
// EXTERNAL MODULE: ./node_modules/antd/es/row/index.js
var row = __webpack_require__(71230);
// EXTERNAL MODULE: ./src/components/AsyncButton/index.tsx
var AsyncButton = __webpack_require__(48559);
;// CONCATENATED MODULE: ./src/pages/Paperlibrary/Random/AddAndEdit/components/StepPreview/components/ExchangeModal.tsx
var ExchangeModal = function ExchangeModal(_ref) {
var visible = _ref.visible,
onCancel = _ref.onCancel,
onRandomExchange = _ref.onRandomExchange,
selectFromProblemSet = _ref.selectFromProblemSet;
return /*#__PURE__*/(0,jsx_runtime.jsx)(es_modal/* default */.Z, {
title: "\u8BF7\u9009\u62E9\u66FF\u6362\u65B9\u5F0F",
open: visible,
onCancel: onCancel,
centered: true,
maskClosable: true,
footer: null,
children: /*#__PURE__*/(0,jsx_runtime.jsxs)(row/* default */.Z, {
justify: "center",
children: [/*#__PURE__*/(0,jsx_runtime.jsx)(AsyncButton/* AsyncButton */.Z, {
onClick: onRandomExchange,
children: "\u968F\u673A\u66F4\u6362"
}), /*#__PURE__*/(0,jsx_runtime.jsx)(es_button/* default */.Z, {
style: {
marginLeft: 24
},
onClick: selectFromProblemSet,
children: "\u4ECE\u9898\u5E93\u4E2D\u9009\u62E9"
})]
})
});
};
/* harmony default export */ var components_ExchangeModal = (ExchangeModal);
;// CONCATENATED MODULE: ./src/pages/Paperlibrary/Random/AddAndEdit/components/StepPreview/index.tsx
var Page = function Page(_ref) {
var _data$questionList2, _data$exam3, _data$exam4, _data$questionList3, _data$exam5, _data$exam6, _data$exam7, _data$questionList4;
var data = _ref.data,
submit = _ref.submit,
goBack = _ref.goBack,
loading = _ref.loading,
onTypeScore = _ref.onTypeScore,
_ref$editPreview = _ref.editPreview,
editPreview = _ref$editPreview === void 0 ? false : _ref$editPreview,
onSkipExamination = _ref.onSkipExamination,
selectValue = _ref.selectValue,
onExchange = _ref.onExchange;
var childrenRef = (0,react.useRef)();
var throttleHandleScroll = (0,react.useRef)((0,lodash.debounce)(function () {
return handleScroll();
}, 100, {
leading: true,
trailing: true
}));
var _useState = (0,react.useState)(null),
_useState2 = slicedToArray_default()(_useState, 2),
editId = _useState2[0],
setEditId = _useState2[1];
var _useState3 = (0,react.useState)(false),
_useState4 = slicedToArray_default()(_useState3, 2),
tooltipVisible = _useState4[0],
setTooltipVisible = _useState4[1];
var _useState5 = (0,react.useState)(false),
_useState6 = slicedToArray_default()(_useState5, 2),
exchangeModalVisible = _useState6[0],
setExchangeModalVisible = _useState6[1];
var exchangeQuestionParams = (0,react.useRef)();
var params = (0,_umi_production_exports.useParams)();
(0,react.useEffect)(function () {
window.addEventListener("scroll", throttleHandleScroll === null || throttleHandleScroll === void 0 ? void 0 : throttleHandleScroll.current);
return function () {
window.removeEventListener("scroll", throttleHandleScroll === null || throttleHandleScroll === void 0 ? void 0 : throttleHandleScroll.current);
};
}, []);
(0,react.useEffect)(function () {
setTooltipVisible(true);
}, []);
(0,react.useEffect)(function () {
var _document$getElementB, _document$getElementB2, _document$getElementB3, _document$getElementB4;
var dom = (_document$getElementB = document.getElementById('examName')) === null || _document$getElementB === void 0 ? void 0 : (_document$getElementB2 = _document$getElementB.getElementsByClassName('ant-pagination-options-quick-jumper')) === null || _document$getElementB2 === void 0 ? void 0 : (_document$getElementB3 = _document$getElementB2[0]) === null || _document$getElementB3 === void 0 ? void 0 : (_document$getElementB4 = _document$getElementB3.childNodes) === null || _document$getElementB4 === void 0 ? void 0 : _document$getElementB4[2];
if (dom) {
dom.nodeValue = '份';
}
}, [data]);
var parser = function parser(v) {
var num = parseInt(v);
return isNaN(num) ? '' : num;
};
//滚动条在Y轴上的滚动距离
function getScrollTop() {
var scrollTop = 0,
bodyScrollTop = 0,
documentScrollTop = 0;
if (document.body) {
bodyScrollTop = document.body.scrollTop;
}
if (document.documentElement) {
documentScrollTop = document.documentElement.scrollTop;
}
scrollTop = bodyScrollTop - documentScrollTop > 0 ? bodyScrollTop : documentScrollTop;
return scrollTop;
}
//文档的总高度
function getScrollHeight() {
var scrollHeight = 0,
bodyScrollHeight = 0,
documentScrollHeight = 0;
if (document.body) {
bodyScrollHeight = document.body.scrollHeight;
}
if (document.documentElement) {
documentScrollHeight = document.documentElement.scrollHeight;
}
scrollHeight = bodyScrollHeight - documentScrollHeight > 0 ? bodyScrollHeight : documentScrollHeight;
return scrollHeight;
}
//浏览器视口的高度
function getWindowHeight() {
var windowHeight = 0;
if (document.compatMode == "CSS1Compat") {
windowHeight = document.documentElement.clientHeight;
} else {
windowHeight = document.body.clientHeight;
}
return windowHeight;
}
var handleScroll = function handleScroll() {
var dom = document.getElementById('preview_btns');
var domElse = document.getElementById('preview_btns_else');
if (getScrollTop() + getWindowHeight() >= getScrollHeight() - 68) {
dom.style.visibility = 'hidden';
domElse.style.visibility = 'visible';
} else {
dom.style.visibility = 'visible';
domElse.style.visibility = 'hidden';
}
};
//容易占位置用
var difficulty = ['容易', '简单', '适中', '困难'];
var renderQs = function renderQs(item) {
var _item$choices;
var answer = [];
return /*#__PURE__*/(0,jsx_runtime.jsxs)(react.Fragment, {
children: [/*#__PURE__*/(0,jsx_runtime.jsx)("aside", {
className: StepPreviewmodules.single,
children: item === null || item === void 0 ? void 0 : (_item$choices = item.choices) === null || _item$choices === void 0 ? void 0 : _item$choices.map(function (e, i) {
if (e.is_answer) {
answer.push(End[i]);
}
return /*#__PURE__*/(0,jsx_runtime.jsxs)("ul", {
children: [/*#__PURE__*/(0,jsx_runtime.jsxs)("li", {
children: [End[i], "\u3001"]
}), /*#__PURE__*/(0,jsx_runtime.jsx)("li", {
children: /*#__PURE__*/(0,jsx_runtime.jsx)(RenderHtml/* default */.Z, {
value: e.choice_text
})
})]
}, i);
})
}), /*#__PURE__*/(0,jsx_runtime.jsxs)("div", {
className: StepPreviewmodules.analysis,
children: [/*#__PURE__*/(0,jsx_runtime.jsxs)("div", {
children: ["\u6B63\u786E\u7B54\u6848\uFF1A", answer.join(''), /*#__PURE__*/(0,jsx_runtime.jsxs)("span", {
className: "ml30",
children: ["\u96BE\u5EA6\uFF1A", difficulty[item.difficulty]]
})]
}), /*#__PURE__*/(0,jsx_runtime.jsxs)("aside", {
children: [/*#__PURE__*/(0,jsx_runtime.jsx)("span", {
className: StepPreviewmodules.text,
children: "\u89E3\u6790:"
}), /*#__PURE__*/(0,jsx_runtime.jsx)(RenderHtml/* default */.Z, {
value: item.analysis ? item.analysis : '暂无解析'
})]
}), /*#__PURE__*/(0,jsx_runtime.jsxs)("ul", {
children: [/*#__PURE__*/(0,jsx_runtime.jsxs)("li", {
children: [/*#__PURE__*/(0,jsx_runtime.jsx)("span", {
style: {
color: '#007AFF',
marginRight: 10
},
children: '方向&课程:'
}), "".concat(item === null || item === void 0 ? void 0 : item.discipline_name, "/").concat(item === null || item === void 0 ? void 0 : item.sub_discipline_name)]
}), /*#__PURE__*/(0,jsx_runtime.jsxs)("li", {
children: [/*#__PURE__*/(0,jsx_runtime.jsx)("span", {
style: {
color: '#5AB891',
marginRight: 10
},
children: '知识点:'
}), item === null || item === void 0 ? void 0 : item.tag_discipline_name]
})]
})]
})]
});
};
var renderCompletion = function renderCompletion(item) {
var _item$standard_answer;
var answer = item === null || item === void 0 ? void 0 : (_item$standard_answer = item.standard_answer) === null || _item$standard_answer === void 0 ? void 0 : _item$standard_answer.map(function (k) {
var _k$answer_text;
return "\u7B54\u6848\uFF08\u586B\u7A7A".concat(k.position, "\uFF09\uFF1A").concat(k === null || k === void 0 ? void 0 : (_k$answer_text = k.answer_text) === null || _k$answer_text === void 0 ? void 0 : _k$answer_text.join("、"));
});
return /*#__PURE__*/(0,jsx_runtime.jsx)(react.Fragment, {
children: /*#__PURE__*/(0,jsx_runtime.jsxs)("div", {
className: StepPreviewmodules.analysis,
children: [/*#__PURE__*/(0,jsx_runtime.jsxs)("div", {
children: ["\u6B63\u786E\u7B54\u6848\uFF1A", answer]
}), /*#__PURE__*/(0,jsx_runtime.jsxs)("aside", {
children: [/*#__PURE__*/(0,jsx_runtime.jsx)("span", {
className: StepPreviewmodules.text,
children: "\u89E3\u6790:"
}), /*#__PURE__*/(0,jsx_runtime.jsx)(RenderHtml/* default */.Z, {
value: item.analysis ? item.analysis : '暂无解析'
})]
}), /*#__PURE__*/(0,jsx_runtime.jsxs)("ul", {
children: [/*#__PURE__*/(0,jsx_runtime.jsxs)("li", {
children: [/*#__PURE__*/(0,jsx_runtime.jsx)("span", {
style: {
color: '#007AFF',
marginRight: 10
},
children: '方向&课程:'
}), "".concat(item === null || item === void 0 ? void 0 : item.discipline_name, "/").concat(item === null || item === void 0 ? void 0 : item.sub_discipline_name)]
}), /*#__PURE__*/(0,jsx_runtime.jsxs)("li", {
children: [/*#__PURE__*/(0,jsx_runtime.jsx)("span", {
style: {
color: '#5AB891',
marginRight: 10
},
children: '知识点:'
}), item === null || item === void 0 ? void 0 : item.tag_discipline_name]
})]
})]
})
});
};
var renderSubjective = function renderSubjective(item) {
var _item$answer_texts;
return /*#__PURE__*/(0,jsx_runtime.jsxs)("div", {
className: StepPreviewmodules.analysis,
children: [/*#__PURE__*/(0,jsx_runtime.jsxs)("div", {
children: ["\u6B63\u786E\u7B54\u6848\uFF1A", item === null || item === void 0 ? void 0 : (_item$answer_texts = item.answer_texts) === null || _item$answer_texts === void 0 ? void 0 : _item$answer_texts[0]]
}), /*#__PURE__*/(0,jsx_runtime.jsxs)("aside", {
children: [/*#__PURE__*/(0,jsx_runtime.jsx)("span", {
className: StepPreviewmodules.text,
children: "\u89E3\u6790:"
}), /*#__PURE__*/(0,jsx_runtime.jsx)(RenderHtml/* default */.Z, {
value: item.analysis ? item.analysis : '暂无解析'
})]
}), /*#__PURE__*/(0,jsx_runtime.jsxs)("ul", {
children: [/*#__PURE__*/(0,jsx_runtime.jsxs)("li", {
children: [/*#__PURE__*/(0,jsx_runtime.jsx)("span", {
style: {
color: '#007AFF',
marginRight: 10
},
children: '方向&课程:'
}), "".concat(item === null || item === void 0 ? void 0 : item.discipline_name, "/").concat(item === null || item === void 0 ? void 0 : item.sub_discipline_name)]
}), /*#__PURE__*/(0,jsx_runtime.jsxs)("li", {
children: [/*#__PURE__*/(0,jsx_runtime.jsx)("span", {
style: {
color: '#5AB891',
marginRight: 10
},
children: '知识点:'
}), item === null || item === void 0 ? void 0 : item.tag_discipline_name]
})]
})]
});
};
var renderProgram = function renderProgram(item) {
var _item$program_attr;
return /*#__PURE__*/(0,jsx_runtime.jsxs)("div", {
className: StepPreviewmodules.analysis,
children: [/*#__PURE__*/(0,jsx_runtime.jsxs)("aside", {
children: [/*#__PURE__*/(0,jsx_runtime.jsx)("span", {
className: StepPreviewmodules.text,
children: "\u9884\u671F\u8F93\u51FA:"
}), /*#__PURE__*/(0,jsx_runtime.jsx)(RenderHtml/* default */.Z, {
value: item === null || item === void 0 ? void 0 : (_item$program_attr = item.program_attr) === null || _item$program_attr === void 0 ? void 0 : _item$program_attr.description
})]
}), /*#__PURE__*/(0,jsx_runtime.jsxs)("ul", {
children: [/*#__PURE__*/(0,jsx_runtime.jsxs)("li", {
children: [/*#__PURE__*/(0,jsx_runtime.jsx)("span", {
style: {
color: '#007AFF',
marginRight: 10
},
children: '方向&课程:'
}), "".concat(item === null || item === void 0 ? void 0 : item.discipline_name, "/").concat(item === null || item === void 0 ? void 0 : item.sub_discipline_name)]
}), /*#__PURE__*/(0,jsx_runtime.jsxs)("li", {
children: [/*#__PURE__*/(0,jsx_runtime.jsx)("span", {
style: {
color: '#5AB891',
marginRight: 10
},
children: '知识点:'
}), item === null || item === void 0 ? void 0 : item.tag_discipline_name]
})]
})]
});
};
var renderCombination = function renderCombination(items, jndex) {
var _items$sub_item_banks;
return /*#__PURE__*/(0,jsx_runtime.jsx)("div", {
children: items === null || items === void 0 ? void 0 : (_items$sub_item_banks = items.sub_item_banks) === null || _items$sub_item_banks === void 0 ? void 0 : _items$sub_item_banks.map(function (item, index) {
var _item$choices2;
var answer = [];
return /*#__PURE__*/(0,jsx_runtime.jsxs)(react.Fragment, {
children: [/*#__PURE__*/(0,jsx_runtime.jsxs)("div", {
style: {
marginLeft: 25,
fontSize: '16px',
color: '#333'
},
children: [jndex + 1 + '.' + (index + 1), "\uFF08\u5355\u9009\u9898\uFF09", item.name]
}), /*#__PURE__*/(0,jsx_runtime.jsx)("aside", {
className: StepPreviewmodules.single,
children: item === null || item === void 0 ? void 0 : (_item$choices2 = item.choices) === null || _item$choices2 === void 0 ? void 0 : _item$choices2.map(function (e, i) {
if (e.is_answer) {
answer.push(End[i]);
}
return /*#__PURE__*/(0,jsx_runtime.jsxs)("ul", {
children: [/*#__PURE__*/(0,jsx_runtime.jsxs)("li", {
children: [End[i], "\u3001"]
}), /*#__PURE__*/(0,jsx_runtime.jsx)("li", {
children: /*#__PURE__*/(0,jsx_runtime.jsx)(RenderHtml/* default */.Z, {
value: e.choice_text
})
})]
}, i);
})
}), /*#__PURE__*/(0,jsx_runtime.jsxs)("div", {
className: StepPreviewmodules.analysis,
children: [/*#__PURE__*/(0,jsx_runtime.jsxs)("div", {
children: ["\u6B63\u786E\u7B54\u6848\uFF1A", answer.join(''), /*#__PURE__*/(0,jsx_runtime.jsxs)("span", {
className: "ml30",
children: ["\u96BE\u5EA6\uFF1A", difficulty[item.difficulty]]
})]
}), /*#__PURE__*/(0,jsx_runtime.jsxs)("aside", {
children: [/*#__PURE__*/(0,jsx_runtime.jsx)("span", {
className: StepPreviewmodules.text,
children: "\u89E3\u6790:"
}), /*#__PURE__*/(0,jsx_runtime.jsx)(RenderHtml/* default */.Z, {
value: item.analysis ? item.analysis : '暂无解析'
})]
}), /*#__PURE__*/(0,jsx_runtime.jsxs)("ul", {
children: [/*#__PURE__*/(0,jsx_runtime.jsxs)("li", {
children: [/*#__PURE__*/(0,jsx_runtime.jsx)("span", {
style: {
color: '#007AFF',
marginRight: 10
},
children: '方向&课程:'
}), "".concat(items === null || items === void 0 ? void 0 : items.discipline_name, "/").concat(items === null || items === void 0 ? void 0 : items.sub_discipline_name)]
}), /*#__PURE__*/(0,jsx_runtime.jsxs)("li", {
children: [/*#__PURE__*/(0,jsx_runtime.jsx)("span", {
style: {
color: '#5AB891',
marginRight: 10
},
children: '知识点:'
}), items === null || items === void 0 ? void 0 : items.tag_discipline_name]
})]
})]
})]
});
})
});
// return <div className={styles.analysis}>
// <aside>
// <span className={styles.text}>预期输出:</span>
// <RenderHtml value={item?.program_attr?.description} />
// </aside>
// <ul>
// <li><span style={{ color: '#007AFF', marginRight: 10 }}>{'方向&课程:'}</span>{`${item?.discipline_name}/${item?.sub_discipline_name}`}</li>
// <li><span style={{ color: '#5AB891', marginRight: 10 }}>{'知识点:'}</span>{item?.tag_discipline_name}</li>
// </ul>
// </div>
};
var End = ['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 handleSetScore = function handleSetScore(item) {
var _item$questions;
var items = [];
item === null || item === void 0 ? void 0 : (_item$questions = item.questions) === null || _item$questions === void 0 ? void 0 : _item$questions.map(function (item) {
var _item$sub_item_banks;
return item === null || item === void 0 ? void 0 : (_item$sub_item_banks = item.sub_item_banks) === null || _item$sub_item_banks === void 0 ? void 0 : _item$sub_item_banks.map(function (ite) {
items.push(ite);
});
});
var score = 0;
if (item.type === 'COMBINATION') {
score = item.questions_score / items.length;
} else {
score = item.questions_score / item.questions_count;
}
es_modal/* default.confirm */.Z.confirm({
icon: null,
className: 'custom-modal-divider',
centered: true,
title: '分数设置',
content: /*#__PURE__*/(0,jsx_runtime.jsx)("div", {
className: StepPreviewmodules.modalColumn,
children: /*#__PURE__*/(0,jsx_runtime.jsxs)("div", {
className: StepPreviewmodules.modalRow,
style: {
justifyContent: 'flex-start'
},
children: [/*#__PURE__*/(0,jsx_runtime.jsx)("sup", {
className: StepPreviewmodules.sup,
children: "*"
}), /*#__PURE__*/(0,jsx_runtime.jsxs)("span", {
children: [item === null || item === void 0 ? void 0 : item.name, (item === null || item === void 0 ? void 0 : item.type) === 'COMBINATION' && '中的每小题', "\uFF1A"]
}), /*#__PURE__*/(0,jsx_runtime.jsx)(input_number/* default */.Z, {
min: 1,
parser: parser,
defaultValue: score,
onChange: function onChange(value) {
score = value;
}
}), /*#__PURE__*/(0,jsx_runtime.jsx)("span", {
className: "ml5",
children: "\u5206/\u9898"
})]
})
}),
okText: '确认',
cancelText: '取消',
onOk: function () {
var _onOk = asyncToGenerator_default()( /*#__PURE__*/regeneratorRuntime_default()().mark(function _callee() {
var param, _param;
return regeneratorRuntime_default()().wrap(function _callee$(_context) {
while (1) switch (_context.prev = _context.next) {
case 0:
if (score) {
_context.next = 3;
break;
}
message/* default.warn */.ZP.warn('分数不能为空或为0');
return _context.abrupt("return", Promise.reject());
case 3:
if (item.type === 'COMBINATION') {
param = {
type: item === null || item === void 0 ? void 0 : item.type,
score: score,
scoreTotal: score * (items === null || items === void 0 ? void 0 : items.length)
};
onTypeScore(param);
} else {
_param = {
type: item === null || item === void 0 ? void 0 : item.type,
score: score,
scoreTotal: score * item.questions_count
};
onTypeScore(_param);
}
case 4:
case "end":
return _context.stop();
}
}, _callee);
}));
function onOk() {
return _onOk.apply(this, arguments);
}
return onOk;
}()
});
};
var handleSave = function handleSave() {
var name = '';
es_modal/* default.confirm */.Z.confirm({
icon: null,
className: 'custom-modal-divider',
centered: true,
title: '保存试卷',
content: /*#__PURE__*/(0,jsx_runtime.jsxs)("div", {
className: StepPreviewmodules.modalColumn,
children: [/*#__PURE__*/(0,jsx_runtime.jsxs)("div", {
style: {
color: '#676A6C',
display: 'flex',
alignItems: 'center'
},
className: "font14 mt20",
children: [/*#__PURE__*/(0,jsx_runtime.jsx)("img", {
style: {
marginRight: 5
},
src: jinshi/* default */.Z
}), "\u4FDD\u5B58\u540E\u5355\u72EC\u751F\u6210\u4E00\u4EFD\u4EBA\u5DE5\u7EC4\u5377\u7C7B\u578B\u7684\u56FA\u5B9A\u8BD5\u5377\u3002"]
}), /*#__PURE__*/(0,jsx_runtime.jsxs)("div", {
className: StepPreviewmodules.modalRow,
style: {
marginTop: 20
},
children: [/*#__PURE__*/(0,jsx_runtime.jsx)("sup", {
className: StepPreviewmodules.sup,
children: "*"
}), /*#__PURE__*/(0,jsx_runtime.jsx)("span", {
style: {
flexShrink: 0
},
children: "\u8BD5\u5377\u540D\u79F0\uFF1A"
}), /*#__PURE__*/(0,jsx_runtime.jsx)(input/* default */.Z, {
placeholder: "\u8BF7\u8F93\u5165\u8BD5\u5377\u540D\u79F0",
min: 0,
maxLength: 60,
defaultValue: name,
onChange: function onChange(e) {
name = e.target.value;
}
})]
})]
}),
okText: '确认',
cancelText: '取消',
onOk: function () {
var _onOk2 = asyncToGenerator_default()( /*#__PURE__*/regeneratorRuntime_default()().mark(function _callee2() {
var _data$questionList;
var item_bank_ids, item_bank_scores, combination_item_banks, params;
return regeneratorRuntime_default()().wrap(function _callee2$(_context2) {
while (1) switch (_context2.prev = _context2.next) {
case 0:
if (name) {
_context2.next = 3;
break;
}
message/* default.warn */.ZP.warn('试卷名称不能为空');
return _context2.abrupt("return", Promise.reject());
case 3:
item_bank_ids = [];
item_bank_scores = [];
combination_item_banks = [];
data === null || data === void 0 ? void 0 : (_data$questionList = data.questionList) === null || _data$questionList === void 0 ? void 0 : _data$questionList.forEach(function (item) {
var _item$questions2;
(_item$questions2 = item.questions) === null || _item$questions2 === void 0 ? void 0 : _item$questions2.forEach(function (e) {
item_bank_ids.push(e.id);
item_bank_scores.push(item.questions_score / item.questions_count);
if (item.type === 'COMBINATION') {
combination_item_banks.push({
id: e.id,
sub_item_bank_ids: e.sub_item_banks.map(function (item) {
return item.id;
})
});
}
});
});
console.log('-----', combination_item_banks);
params = {
item_bank_ids: item_bank_ids,
item_bank_scores: item_bank_scores,
name: name,
combination_item_banks: combination_item_banks
};
_context2.next = 11;
return submit(params);
case 11:
case "end":
return _context2.stop();
}
}, _callee2);
}));
function onOk() {
return _onOk2.apply(this, arguments);
}
return onOk;
}()
});
};
var handleOnlyOne = function handleOnlyOne(id, type, index, item) {
var _item$questions3;
var currentUrl = "".concat(location.pathname).concat(location.search);
var ids = (_item$questions3 = item.questions) === null || _item$questions3 === void 0 ? void 0 : _item$questions3.map(function (k) {
return k.id;
});
if (currentUrl.includes('exercise')) {
exchangeQuestionParams.current = {
id: id,
ids: ids,
type: type,
index: index
};
setExchangeModalVisible(true);
} else {
var modal = es_modal/* default.confirm */.Z.confirm({
icon: null,
className: 'custom-modal-divider',
centered: true,
title: '温馨提示',
content: "\u786E\u8BA4\u8981\u66F4\u6362\u8BE5\u8BD5\u9898\u5417\uFF1F",
cancelButtonProps: {
disabled: false
},
maskClosable: true,
keyboard: false,
okText: '确认',
cancelText: '取消',
onOk: function () {
var _onOk3 = asyncToGenerator_default()( /*#__PURE__*/regeneratorRuntime_default()().mark(function _callee3() {
return regeneratorRuntime_default()().wrap(function _callee3$(_context3) {
while (1) switch (_context3.prev = _context3.next) {
case 0:
modal.update({
cancelButtonProps: {
disabled: true
}
});
_context3.next = 3;
return onExchange({
single_question_id: id,
seleted_item_bank_ids: ids
}, {
type: type,
index: index
});
case 3:
modal.update({
cancelButtonProps: {
disabled: false
}
});
message/* default.success */.ZP.success("\u5DF2\u91CD\u65B0\u968F\u673A\u751F\u6210\u8BD5\u9898");
case 5:
case "end":
return _context3.stop();
}
}, _callee3);
}));
function onOk() {
return _onOk3.apply(this, arguments);
}
return onOk;
}()
});
}
};
var handleOnlyType = function handleOnlyType(item) {
var _item$questions4;
var ids = (_item$questions4 = item.questions) === null || _item$questions4 === void 0 ? void 0 : _item$questions4.map(function (k) {
return k.id;
});
var typeName = item.name;
var modal = es_modal/* default.confirm */.Z.confirm({
icon: null,
className: 'custom-modal-divider',
centered: true,
title: '温馨提示',
content: "\u786E\u8BA4\u66F4\u6362".concat(typeName, "\u4E2D\u7684\u6240\u6709\u8BD5\u9898\u5417\uFF1F"),
cancelButtonProps: {
disabled: false
},
maskClosable: false,
keyboard: false,
okText: '确认',
cancelText: '取消',
onOk: function () {
var _onOk4 = asyncToGenerator_default()( /*#__PURE__*/regeneratorRuntime_default()().mark(function _callee4() {
return regeneratorRuntime_default()().wrap(function _callee4$(_context4) {
while (1) switch (_context4.prev = _context4.next) {
case 0:
modal.update({
cancelButtonProps: {
disabled: true
}
});
_context4.next = 3;
return onExchange({
seleted_item_bank_ids: ids
}, {
type: item.type
});
case 3:
modal.update({
cancelButtonProps: {
disabled: false
}
});
message/* default.success */.ZP.success("\u5DF2\u91CD\u65B0\u968F\u673A\u751F\u6210".concat(typeName, "\u8BD5\u9898"));
case 5:
case "end":
return _context4.stop();
}
}, _callee4);
}));
function onOk() {
return _onOk4.apply(this, arguments);
}
return onOk;
}()
});
};
var handleAllType = function handleAllType() {
var modal = es_modal/* default.confirm */.Z.confirm({
icon: null,
className: 'custom-modal-divider',
centered: true,
title: '温馨提示',
content: "\u786E\u8BA4\u66F4\u6362\u9884\u89C8\u4E2D\u7684\u6240\u6709\u8BD5\u9898\u5417\uFF1F",
cancelButtonProps: {
disabled: false
},
maskClosable: false,
keyboard: false,
okText: '确认',
cancelText: '取消',
onOk: function () {
var _onOk5 = asyncToGenerator_default()( /*#__PURE__*/regeneratorRuntime_default()().mark(function _callee5() {
return regeneratorRuntime_default()().wrap(function _callee5$(_context5) {
while (1) switch (_context5.prev = _context5.next) {
case 0:
modal.update({
cancelButtonProps: {
disabled: true
}
});
_context5.next = 3;
return onExchange();
case 3:
modal.update({
cancelButtonProps: {
disabled: false
}
});
message/* default.success */.ZP.success('已重新随机生成整张试题');
case 5:
case "end":
return _context5.stop();
}
}, _callee5);
}));
function onOk() {
return _onOk5.apply(this, arguments);
}
return onOk;
}()
});
};
var handleSelectChange = function handleSelectChange(key) {
console.log(key, 'key');
onSkipExamination(key - 1);
};
var renderBtns = function renderBtns() {
return /*#__PURE__*/(0,jsx_runtime.jsxs)(react.Fragment, {
children: [/*#__PURE__*/(0,jsx_runtime.jsx)(popover/* default */.Z, {
color: "#55575D",
overlayClassName: StepPreviewmodules.popover,
open: tooltipVisible,
getPopupContainer: function getPopupContainer(trigger) {
return trigger === null || trigger === void 0 ? void 0 : trigger.parentNode;
},
content: "\u5982\u60A8\u5BF9\u6B64\u4EFD\u8BD5\u9898\u6EE1\u610F\uFF0C\u53EF\u5C06\u6B64\u4EFD\u8BD5\u9898\u4FDD\u5B58\u4E3A\u56FA\u5B9A\u8BD5\u5377",
children: /*#__PURE__*/(0,jsx_runtime.jsx)(es_button/* default */.Z, {
onMouseEnter: function onMouseEnter() {
return setTooltipVisible(true);
},
onMouseLeave: function onMouseLeave() {
return setTooltipVisible(false);
},
onClick: function onClick() {
handleSave();
},
children: "\u4FDD\u5B58"
})
}), /*#__PURE__*/(0,jsx_runtime.jsx)(es_button/* default */.Z, {
onClick: function onClick() {
document.body.scrollIntoView();
goBack();
},
children: "\u8FD4\u56DE"
}), /*#__PURE__*/(0,jsx_runtime.jsx)(es_button/* default */.Z, {
loading: loading,
onClick: function onClick() {
return submit();
},
type: "primary",
children: "\u63D0\u4EA4"
})]
});
};
var renderEditBtns = function renderEditBtns() {
var _data$exam;
return /*#__PURE__*/(0,jsx_runtime.jsxs)(react.Fragment, {
children: [/*#__PURE__*/(0,jsx_runtime.jsx)(es_button/* default */.Z, {
onClick: goBack,
children: "\u8FD4\u56DE"
}), selectValue > 0 && /*#__PURE__*/(0,jsx_runtime.jsx)(es_button/* default */.Z, {
onClick: function onClick() {
return handleSelectChange(selectValue);
},
type: "primary",
children: "\u4E0A\u4E00\u4EFD"
}), selectValue < (data === null || data === void 0 ? void 0 : (_data$exam = data.exam) === null || _data$exam === void 0 ? void 0 : _data$exam.total_num) - 1 && /*#__PURE__*/(0,jsx_runtime.jsx)(es_button/* default */.Z, {
onClick: function onClick() {
return handleSelectChange(selectValue + 2);
},
children: "\u4E0B\u4E00\u4EFD"
})]
});
};
var renderSubject = function renderSubject(v, type) {
if (type === 'SINGLE') {
return /*#__PURE__*/(0,jsx_runtime.jsxs)(jsx_runtime.Fragment, {
children: [/*#__PURE__*/(0,jsx_runtime.jsx)(components_SingleEditor, {
ref: childrenRef,
editData: v,
isEdit: true
}), /*#__PURE__*/(0,jsx_runtime.jsx)(divider/* default */.Z, {})]
});
}
if (type === 'MULTIPLE') {
return /*#__PURE__*/(0,jsx_runtime.jsxs)(jsx_runtime.Fragment, {
children: [/*#__PURE__*/(0,jsx_runtime.jsx)(components_MultipleEditor, {
ref: childrenRef,
editData: v,
isEdit: true
}), /*#__PURE__*/(0,jsx_runtime.jsx)(divider/* default */.Z, {})]
});
}
if (type === 'JUDGMENT') {
return /*#__PURE__*/(0,jsx_runtime.jsxs)(jsx_runtime.Fragment, {
children: [/*#__PURE__*/(0,jsx_runtime.jsx)(components_JudgmentEditor, {
ref: childrenRef,
editData: v,
isEdit: true
}), /*#__PURE__*/(0,jsx_runtime.jsx)(divider/* default */.Z, {})]
});
}
if (type === 'COMPLETION') {
return /*#__PURE__*/(0,jsx_runtime.jsxs)(jsx_runtime.Fragment, {
children: [/*#__PURE__*/(0,jsx_runtime.jsx)(components_CompletionEditor, {
ref: childrenRef,
editData: v,
isEdit: true
}), /*#__PURE__*/(0,jsx_runtime.jsx)(divider/* default */.Z, {})]
});
}
if (type === 'SUBJECTIVE') {
return /*#__PURE__*/(0,jsx_runtime.jsxs)(jsx_runtime.Fragment, {
children: [/*#__PURE__*/(0,jsx_runtime.jsx)(components_SubjectiveEditor, {
ref: childrenRef,
editData: v,
isEdit: true
}), /*#__PURE__*/(0,jsx_runtime.jsx)(divider/* default */.Z, {})]
});
}
if (type === 'COMBINATION') {
return /*#__PURE__*/(0,jsx_runtime.jsxs)(jsx_runtime.Fragment, {
children: [/*#__PURE__*/(0,jsx_runtime.jsx)(components_CombinationEditor, {
ref: childrenRef,
editData: v,
isEdit: true
}), /*#__PURE__*/(0,jsx_runtime.jsx)(divider/* default */.Z, {})]
});
}
if (type === 'PROGRAM') {
var _v$program_attr;
_umi_production_exports.history.push("/problems/".concat(v === null || v === void 0 ? void 0 : (_v$program_attr = v.program_attr) === null || _v$program_attr === void 0 ? void 0 : _v$program_attr.identifier, "/edit?type=exercises&express_id=").concat(params.categoryId, "&question_id=").concat(v === null || v === void 0 ? void 0 : v.id, "&score=").concat(v === null || v === void 0 ? void 0 : v.score, "&callback_url=").concat(location.pathname, "&select=").concat(selectValue, "&exercise=true"));
}
};
var handleEditSave = /*#__PURE__*/function () {
var _ref2 = asyncToGenerator_default()( /*#__PURE__*/regeneratorRuntime_default()().mark(function _callee6(type, param) {
var _childrenRef$current;
var editorData, body, _editorData$choices, question_choices, standard_answers, _editorData$standard_, _standard_answers, _editorData$sub_item_, res;
return regeneratorRuntime_default()().wrap(function _callee6$(_context6) {
while (1) switch (_context6.prev = _context6.next) {
case 0:
_context6.next = 2;
return (_childrenRef$current = childrenRef.current) === null || _childrenRef$current === void 0 ? void 0 : _childrenRef$current.onSave();
case 2:
editorData = _context6.sent;
if (editorData) {
_context6.next = 5;
break;
}
return _context6.abrupt("return");
case 5:
body = {
question_score: param.score,
analysis: editorData.analysis
};
if (type === 'SINGLE' || type === 'MULTIPLE' || type === 'JUDGMENT') {
question_choices = [];
standard_answers = [];
body.question_type = type === 'JUDGMENT' ? 2 : 1;
body.question_title = editorData === null || editorData === void 0 ? void 0 : editorData.name;
editorData === null || editorData === void 0 ? void 0 : (_editorData$choices = editorData.choices) === null || _editorData$choices === void 0 ? void 0 : _editorData$choices.forEach(function (e, i) {
question_choices.push(e.choice_text);
if (e !== null && e !== void 0 && e.is_answer) {
standard_answers.push(i + 1);
}
});
body.question_choices = question_choices;
body.standard_answers = standard_answers;
}
if (type === 'COMPLETION') {
body.is_ordered = editorData.is_ordered;
body.question_title = editorData === null || editorData === void 0 ? void 0 : editorData.name;
body.question_type = 3;
_standard_answers = [];
editorData === null || editorData === void 0 ? void 0 : (_editorData$standard_ = editorData.standard_answers) === null || _editorData$standard_ === void 0 ? void 0 : _editorData$standard_.forEach(function (e, i) {
_standard_answers.push({
choice_id: e.position,
answer_text: e.answer_text
});
});
body.standard_answers = _standard_answers;
}
if (type === 'SUBJECTIVE') {
body.question_title = editorData === null || editorData === void 0 ? void 0 : editorData.name;
body.question_type = 3;
body.standard_answers = editorData === null || editorData === void 0 ? void 0 : editorData.answer_texts;
}
if (type === 'COMBINATION') {
body.question_title = editorData === null || editorData === void 0 ? void 0 : editorData.name;
body.question_type = 7;
body.sub_questions = editorData === null || editorData === void 0 ? void 0 : (_editorData$sub_item_ = editorData.sub_item_banks) === null || _editorData$sub_item_ === void 0 ? void 0 : _editorData$sub_item_.map(function (e, i) {
return {
id: e.id,
question_title: e.name,
question_type: 1,
question_choices: e.choices.map(function (k) {
return k.choice_text;
}),
standard_answers: [e.choices.findIndex(function (k) {
return k.is_answer;
}) + 1],
analysis: e.analysis
};
});
delete body.analysis;
}
_context6.next = 12;
return (0,fetch/* default */.ZP)("/api/exercise_questions/".concat(param.id, ".json"), {
method: 'put',
body: body
});
case 12:
res = _context6.sent;
if ((res === null || res === void 0 ? void 0 : res.status) === 0) {
message/* default.success */.ZP.success('编辑成功');
handleSelectChange(selectValue + 1);
}
setEditId(null);
case 15:
case "end":
return _context6.stop();
}
}, _callee6);
}));
return function handleEditSave(_x, _x2) {
return _ref2.apply(this, arguments);
};
}();
var renderOption = function renderOption() {
var item = [];
for (var i = 0; i < (data === null || data === void 0 ? void 0 : (_data$exam2 = data.exam) === null || _data$exam2 === void 0 ? void 0 : _data$exam2.total_num); i++) {
var _data$exam2;
item.push({});
}
return item;
};
var score_total = data === null || data === void 0 ? void 0 : (_data$questionList2 = data.questionList) === null || _data$questionList2 === void 0 ? void 0 : _data$questionList2.reduce(function (a, b) {
return a + b.questions_score;
}, 0);
var disabled = editPreview && (data === null || data === void 0 ? void 0 : (_data$exam3 = data.exam) === null || _data$exam3 === void 0 ? void 0 : _data$exam3.exercise_status) !== 1;
return /*#__PURE__*/(0,jsx_runtime.jsxs)("section", {
className: StepPreviewmodules.wrap,
children: [/*#__PURE__*/(0,jsx_runtime.jsxs)("div", {
id: "id_left_preview",
className: StepPreviewmodules.left,
onMouseEnter: function onMouseEnter(e) {
var dom = document.getElementById('id_left_preview');
dom.style.overflowY = 'auto';
},
onMouseLeave: function onMouseLeave(e) {
var dom = document.getElementById('id_left_preview');
dom.style.overflowY = 'hidden';
},
children: [/*#__PURE__*/(0,jsx_runtime.jsx)("div", {
className: StepPreviewmodules.title,
children: /*#__PURE__*/(0,jsx_runtime.jsxs)("div", {
children: [/*#__PURE__*/(0,jsx_runtime.jsx)("b", {}), /*#__PURE__*/(0,jsx_runtime.jsx)("span", {
children: "\u7B54\u9898\u5361"
})]
})
}), /*#__PURE__*/(0,jsx_runtime.jsxs)("div", {
className: StepPreviewmodules.total,
children: [/*#__PURE__*/(0,jsx_runtime.jsxs)("div", {
children: [/*#__PURE__*/(0,jsx_runtime.jsx)("img", {
src: xixi/* default */.Z
}), /*#__PURE__*/(0,jsx_runtime.jsx)("span", {
children: "\u9898\u6570(\u9053)"
}), /*#__PURE__*/(0,jsx_runtime.jsx)("aside", {
children: data === null || data === void 0 ? void 0 : data.all_questions_count
})]
}), /*#__PURE__*/(0,jsx_runtime.jsxs)("div", {
className: "mr30 ml30",
children: [/*#__PURE__*/(0,jsx_runtime.jsx)("img", {
src: bi/* default */.Z
}), /*#__PURE__*/(0,jsx_runtime.jsx)("span", {
children: "\u603B\u5206(\u5206)"
}), /*#__PURE__*/(0,jsx_runtime.jsx)("aside", {
children: score_total
})]
}), /*#__PURE__*/(0,jsx_runtime.jsxs)("div", {
children: [/*#__PURE__*/(0,jsx_runtime.jsx)("img", {
src: zhong
}), /*#__PURE__*/(0,jsx_runtime.jsx)("span", {
children: "\u65F6\u957F(\u5206)"
}), /*#__PURE__*/(0,jsx_runtime.jsx)("aside", {
children: data === null || data === void 0 ? void 0 : (_data$exam4 = data.exam) === null || _data$exam4 === void 0 ? void 0 : _data$exam4.time
})]
})]
}), data === null || data === void 0 ? void 0 : (_data$questionList3 = data.questionList) === null || _data$questionList3 === void 0 ? void 0 : _data$questionList3.map(function (e, index) {
var _e$questions;
return /*#__PURE__*/(0,jsx_runtime.jsxs)("div", {
className: StepPreviewmodules.list,
children: [/*#__PURE__*/(0,jsx_runtime.jsxs)("div", {
className: StepPreviewmodules.name,
children: [/*#__PURE__*/(0,jsx_runtime.jsx)("b", {}), /*#__PURE__*/(0,jsx_runtime.jsx)("span", {
children: e.name
})]
}), /*#__PURE__*/(0,jsx_runtime.jsxs)("aside", {
children: [/*#__PURE__*/(0,jsx_runtime.jsxs)("div", {
children: ["\u5171", /*#__PURE__*/(0,jsx_runtime.jsx)("span", {
className: StepPreviewmodules.b,
children: e.questions_count
}), "\u9898 ", /*#__PURE__*/(0,jsx_runtime.jsx)("span", {
className: StepPreviewmodules.l,
children: "|"
}), "\u5171", /*#__PURE__*/(0,jsx_runtime.jsx)("span", {
className: StepPreviewmodules.r,
children: e.questions_score
}), "\u5206"]
}), /*#__PURE__*/(0,jsx_runtime.jsx)("div", {
className: StepPreviewmodules.answerSheet,
children: e === null || e === void 0 ? void 0 : (_e$questions = e.questions) === null || _e$questions === void 0 ? void 0 : _e$questions.map(function (k, i) {
return /*#__PURE__*/(0,jsx_runtime.jsx)("div", {
onClick: function onClick() {
var anchorName = "Anchor_".concat(k.id);
var anchorElement = document.getElementById(anchorName);
if (anchorElement) {
setTimeout(function () {
return anchorElement.scrollIntoView({
block: "center",
behavior: "smooth"
});
});
}
},
className: StepPreviewmodules.tag,
children: i + 1
}, k.id);
})
})]
})]
}, index);
})]
}), /*#__PURE__*/(0,jsx_runtime.jsxs)("div", {
className: StepPreviewmodules.right,
children: [/*#__PURE__*/(0,jsx_runtime.jsxs)("div", {
className: StepPreviewmodules.examName,
id: "examName",
children: [/*#__PURE__*/(0,jsx_runtime.jsx)("div", {
className: StepPreviewmodules.name,
children: /*#__PURE__*/(0,jsx_runtime.jsx)(tooltip/* default */.Z, {
title: data === null || data === void 0 ? void 0 : (_data$exam5 = data.exam) === null || _data$exam5 === void 0 ? void 0 : _data$exam5.name,
getPopupContainer: function getPopupContainer(trigger) {
return trigger.parentNode;
},
children: /*#__PURE__*/(0,jsx_runtime.jsx)("span", {
className: StepPreviewmodules.t,
children: data === null || data === void 0 ? void 0 : (_data$exam6 = data.exam) === null || _data$exam6 === void 0 ? void 0 : _data$exam6.name
})
})
}), editPreview ? /*#__PURE__*/(0,jsx_runtime.jsx)(pagination/* default */.Z, {
showTotal: function showTotal(total) {
return /*#__PURE__*/(0,jsx_runtime.jsxs)("span", {
style: {
color: '#656F87',
fontSize: 14
},
children: ["\u5171\u8BA1", /*#__PURE__*/(0,jsx_runtime.jsx)("span", {
className: "c-light-primary",
children: total
}), "\u4EFD\u8BD5\u5377"]
});
},
total: data === null || data === void 0 ? void 0 : (_data$exam7 = data.exam) === null || _data$exam7 === void 0 ? void 0 : _data$exam7.total_num,
pageSize: 1,
current: selectValue + 1,
showSizeChanger: false,
onChange: handleSelectChange,
showQuickJumper: true,
hideOnSinglePage: false
}) : /*#__PURE__*/(0,jsx_runtime.jsx)(es_button/* default */.Z, {
onClick: handleAllType,
type: "primary",
children: "\u968F\u673A\u66F4\u6362"
})]
}), /*#__PURE__*/(0,jsx_runtime.jsx)("div", {
className: StepPreviewmodules.topWarp,
children: data === null || data === void 0 ? void 0 : (_data$questionList4 = data.questionList) === null || _data$questionList4 === void 0 ? void 0 : _data$questionList4.map(function (e, index) {
var _e$questions2, _e$questions3;
return /*#__PURE__*/(0,jsx_runtime.jsxs)(react.Fragment, {
children: [/*#__PURE__*/(0,jsx_runtime.jsxs)("div", {
className: StepPreviewmodules.head,
style: index === 0 ? {
border: 0,
marginTop: -16
} : {},
children: [/*#__PURE__*/(0,jsx_runtime.jsxs)("div", {
className: StepPreviewmodules.name,
children: [/*#__PURE__*/(0,jsx_runtime.jsx)("b", {}), /*#__PURE__*/(0,jsx_runtime.jsx)("span", {
children: e.name
})]
}), /*#__PURE__*/(0,jsx_runtime.jsxs)("div", {
className: StepPreviewmodules.so,
children: ["\u5171", /*#__PURE__*/(0,jsx_runtime.jsxs)("span", {
className: StepPreviewmodules.b,
children: [e.questions_count, " "]
}), "\u9898 ", e.type === 'COMBINATION' && "\uFF08\u5305\u542B".concat(e === null || e === void 0 ? void 0 : (_e$questions2 = e.questions) === null || _e$questions2 === void 0 ? void 0 : _e$questions2.map(function (item) {
var _item$sub_item_banks2;
return item === null || item === void 0 ? void 0 : (_item$sub_item_banks2 = item.sub_item_banks) === null || _item$sub_item_banks2 === void 0 ? void 0 : _item$sub_item_banks2.length;
}).reduce(function (x, y) {
return x + y;
}), "\u5C0F\u9898\uFF09"), /*#__PURE__*/(0,jsx_runtime.jsx)("span", {
className: StepPreviewmodules.l,
children: "|"
}), "\u5171", /*#__PURE__*/(0,jsx_runtime.jsx)("span", {
className: StepPreviewmodules.r,
children: e.questions_score
}), "\u5206"]
}), !editPreview && /*#__PURE__*/(0,jsx_runtime.jsxs)("div", {
className: StepPreviewmodules.btn,
children: [/*#__PURE__*/(0,jsx_runtime.jsx)(es_button/* default */.Z, {
onClick: function onClick() {
handleSetScore(e);
},
type: "primary",
ghost: true,
className: "mr20",
children: "\u8BBE\u7F6E\u5F97\u5206"
}), /*#__PURE__*/(0,jsx_runtime.jsx)(es_button/* default */.Z, {
onClick: function onClick() {
return handleOnlyType(e);
},
type: "primary",
ghost: true,
children: "\u968F\u673A\u66F4\u6362"
})]
})]
}), e === null || e === void 0 ? void 0 : (_e$questions3 = e.questions) === null || _e$questions3 === void 0 ? void 0 : _e$questions3.map(function (k, i) {
if (editId === k.id) {
return /*#__PURE__*/(0,jsx_runtime.jsxs)("div", {
id: "Anchor_".concat(k.id),
className: StepPreviewmodules.content,
style: {
padding: 0,
marginTop: 10
},
children: [/*#__PURE__*/(0,jsx_runtime.jsxs)("div", {
style: {
"float": 'right',
marginTop: -6
},
children: [/*#__PURE__*/(0,jsx_runtime.jsx)(es_button/* default */.Z, {
onClick: function onClick() {
return setEditId(null);
},
className: "mr20",
type: "primary",
ghost: true,
children: "\u53D6\u6D88"
}), /*#__PURE__*/(0,jsx_runtime.jsx)(es_button/* default */.Z, {
onClick: function onClick() {
return handleEditSave(e === null || e === void 0 ? void 0 : e.type, k);
},
type: "primary",
children: "\u4FDD\u5B58"
})]
}), renderSubject(k, e.type)]
}, k.id);
}
return /*#__PURE__*/(0,jsx_runtime.jsxs)("div", {
id: "Anchor_".concat(k.id),
className: StepPreviewmodules.content,
children: [/*#__PURE__*/(0,jsx_runtime.jsxs)("div", {
className: StepPreviewmodules.titleWrap,
children: [/*#__PURE__*/(0,jsx_runtime.jsx)(RenderHtml/* default */.Z, {
style: {
paddingRight: 10
},
className: StepPreviewmodules.titleHtml,
value: i + 1 + '、' + "".concat((k === null || k === void 0 ? void 0 : k.item_type) === "combination" ? '(题干)' : '') + k.name
}), editPreview && /*#__PURE__*/(0,jsx_runtime.jsx)(es_button/* default */.Z, {
disabled: disabled,
onClick: function onClick() {
if (editId) {
message/* default.warn */.ZP.warn('先保存或取消当前正在编辑的试题');
return;
}
setEditId(k.id);
},
type: "primary",
className: "mr20",
style: {
marginLeft: 'auto'
},
ghost: true,
children: "\u7F16\u8F91"
}), /*#__PURE__*/(0,jsx_runtime.jsx)(es_button/* default */.Z, {
disabled: disabled,
onClick: function onClick() {
return handleOnlyOne(k.id, e.type, i, e);
},
type: "primary",
ghost: true,
children: "\u6362\u4E00\u9898"
})]
}), (e.type === 'SINGLE' || e.type === "JUDGMENT" || e.type === "MULTIPLE") && renderQs(k), e.type === "COMPLETION" && renderCompletion(k), e.type === "SUBJECTIVE" && renderSubjective(k), e.type === "PROGRAM" && renderProgram(k), e.type === "COMBINATION" && renderCombination(k, i), /*#__PURE__*/(0,jsx_runtime.jsx)("div", {})]
}, k.id);
})]
}, index);
})
}), /*#__PURE__*/(0,jsx_runtime.jsx)("div", {
className: StepPreviewmodules.btnsElse,
id: "preview_btns_else",
children: editPreview ? renderEditBtns() : renderBtns()
}), /*#__PURE__*/(0,jsx_runtime.jsx)("div", {
className: StepPreviewmodules.btnsWrap,
id: "preview_btns",
children: /*#__PURE__*/(0,jsx_runtime.jsx)("div", {
className: StepPreviewmodules.btns,
children: editPreview ? renderEditBtns() : renderBtns()
})
})]
}), /*#__PURE__*/(0,jsx_runtime.jsx)(components_ExchangeModal, {
visible: exchangeModalVisible,
onRandomExchange: /*#__PURE__*/asyncToGenerator_default()( /*#__PURE__*/regeneratorRuntime_default()().mark(function _callee7() {
var changeParams;
return regeneratorRuntime_default()().wrap(function _callee7$(_context7) {
while (1) switch (_context7.prev = _context7.next) {
case 0:
changeParams = exchangeQuestionParams.current;
_context7.next = 3;
return onExchange({
single_question_id: changeParams.id,
seleted_item_bank_ids: changeParams.ids
}, {
type: changeParams.type,
index: changeParams.index
});
case 3:
setExchangeModalVisible(false);
case 4:
case "end":
return _context7.stop();
}
}, _callee7);
})),
selectFromProblemSet: function selectFromProblemSet() {
var changeParams = exchangeQuestionParams.current;
var currentUrl = "".concat(location.pathname).concat(location.search);
if (currentUrl.includes('exercise')) {
//只支持教学课堂换一题
_umi_production_exports.history.push("/paperlibrary/exchangequestion?type=exercise&qid=".concat(changeParams.id, "&qtype=").concat(changeParams.type, "&exerciseid=").concat(params.categoryId, "&from=").concat(currentUrl));
}
},
onCancel: function onCancel() {
setExchangeModalVisible(false);
}
})]
});
};
/* harmony default export */ var StepPreview = (Page);
/***/ }),
/***/ 48601:
/*!****************************************!*\
!*** ./src/assets/images/paper/bi.svg ***!
\****************************************/
/***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) {
/* unused harmony export ReactComponent */
/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! react */ 67294);
function _createForOfIteratorHelper(o, allowArrayLike) { var it = typeof Symbol !== "undefined" && o[Symbol.iterator] || o["@@iterator"]; if (!it) { if (Array.isArray(o) || (it = _unsupportedIterableToArray(o)) || allowArrayLike && o && typeof o.length === "number") { if (it) o = it; var i = 0; var F = function F() {}; return { s: F, n: function n() { if (i >= o.length) return { done: true }; return { done: false, value: o[i++] }; }, e: function e(_e) { throw _e; }, f: F }; } throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); } var normalCompletion = true, didErr = false, err; return { s: function s() { it = it.call(o); }, n: function n() { var step = it.next(); normalCompletion = step.done; return step; }, e: function e(_e2) { didErr = true; err = _e2; }, f: function f() { try { if (!normalCompletion && it["return"] != null) it["return"](); } finally { if (didErr) throw err; } } }; }
function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === "string") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return Array.from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); }
function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) arr2[i] = arr[i]; return arr2; }
var __defProp = Object.defineProperty;
var __getOwnPropSymbols = Object.getOwnPropertySymbols;
var __hasOwnProp = Object.prototype.hasOwnProperty;
var __propIsEnum = Object.prototype.propertyIsEnumerable;
var __defNormalProp = function __defNormalProp(obj, key, value) {
return key in obj ? __defProp(obj, key, {
enumerable: true,
configurable: true,
writable: true,
value: value
}) : obj[key] = value;
};
var __spreadValues = function __spreadValues(a, b) {
for (var prop in b || (b = {})) if (__hasOwnProp.call(b, prop)) __defNormalProp(a, prop, b[prop]);
if (__getOwnPropSymbols) {
var _iterator = _createForOfIteratorHelper(__getOwnPropSymbols(b)),
_step;
try {
for (_iterator.s(); !(_step = _iterator.n()).done;) {
var prop = _step.value;
if (__propIsEnum.call(b, prop)) __defNormalProp(a, prop, b[prop]);
}
} catch (err) {
_iterator.e(err);
} finally {
_iterator.f();
}
}
return a;
};
var SvgBi = function SvgBi(props) {
return /* @__PURE__ */React.createElement("svg", __spreadValues({
width: 34,
height: 34,
xmlns: "http://www.w3.org/2000/svg"
}, props), /* @__PURE__ */React.createElement("title", null, "\u9898\u76EE"), /* @__PURE__ */React.createElement("g", {
fill: "none",
fillRule: "evenodd"
}, /* @__PURE__ */React.createElement("rect", {
fill: "#E7F3FF",
width: 34,
height: 34,
rx: 10
}), /* @__PURE__ */React.createElement("g", {
fill: "#4C6FFF",
fillRule: "nonzero"
}, /* @__PURE__ */React.createElement("path", {
d: "m23.719 13.325-4.098-3.94c-.097-.13-.225-.162-.355-.162-.129 0-.258.064-.387.161l-7.55 7.753c-.065.065-.098.162-.13.227l-1.032 5.427c-.033.194.032.323.16.484.13.13.227.162.389.162h.096l4.776-1.099c.097-.032.194-.064.258-.161l7.841-8.108c.194-.162.194-.517.033-.744h-.001Zm-8.1 8.044a.534.534 0 0 1-.386.162.56.56 0 0 1-.388-.162l-3-2.81c-.226-.194-.226-.517-.033-.743.194-.227.517-.227.743-.033l3 2.811c.259.226.291.55.065.776ZM17 22.92h6.844v1.055H17z"
}))));
};
/* harmony default export */ __webpack_exports__["Z"] = ("data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMzQiIGhlaWdodD0iMzQiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyI+PGcgZmlsbD0ibm9uZSIgZmlsbC1ydWxlPSJldmVub2RkIj48cmVjdCBmaWxsPSIjRTdGM0ZGIiB3aWR0aD0iMzQiIGhlaWdodD0iMzQiIHJ4PSIxMCIvPjxnIGZpbGw9IiM0QzZGRkYiIGZpbGwtcnVsZT0ibm9uemVybyI+PHBhdGggZD0ibTIzLjcxOSAxMy4zMjUtNC4wOTgtMy45NGMtLjA5Ny0uMTMtLjIyNS0uMTYyLS4zNTUtLjE2Mi0uMTI5IDAtLjI1OC4wNjQtLjM4Ny4xNjFsLTcuNTUgNy43NTNjLS4wNjUuMDY1LS4wOTguMTYyLS4xMy4yMjdsLTEuMDMyIDUuNDI3Yy0uMDMzLjE5NC4wMzIuMzIzLjE2LjQ4NC4xMy4xMy4yMjcuMTYyLjM4OS4xNjJoLjA5Nmw0Ljc3Ni0xLjA5OWMuMDk3LS4wMzIuMTk0LS4wNjQuMjU4LS4xNjFsNy44NDEtOC4xMDhjLjE5NC0uMTYyLjE5NC0uNTE3LjAzMy0uNzQ0aC0uMDAxWm0tOC4xIDguMDQ0YS41MzQuNTM0IDAgMCAxLS4zODYuMTYyLjU2LjU2IDAgMCAxLS4zODgtLjE2MmwtMy0yLjgxYy0uMjI2LS4xOTQtLjIyNi0uNTE3LS4wMzMtLjc0My4xOTQtLjIyNy41MTctLjIyNy43NDMtLjAzM2wzIDIuODExYy4yNTkuMjI2LjI5MS41NS4wNjUuNzc2Wk0xNyAyMi45Mmg2Ljg0NHYxLjA1NUgxN3oiLz48L2c+PC9nPjwvc3ZnPg==");
/***/ }),
/***/ 56606:
/*!********************************************!*\
!*** ./src/assets/images/paper/jinshi.svg ***!
\********************************************/
/***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) {
/* unused harmony export ReactComponent */
/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! react */ 67294);
function _createForOfIteratorHelper(o, allowArrayLike) { var it = typeof Symbol !== "undefined" && o[Symbol.iterator] || o["@@iterator"]; if (!it) { if (Array.isArray(o) || (it = _unsupportedIterableToArray(o)) || allowArrayLike && o && typeof o.length === "number") { if (it) o = it; var i = 0; var F = function F() {}; return { s: F, n: function n() { if (i >= o.length) return { done: true }; return { done: false, value: o[i++] }; }, e: function e(_e) { throw _e; }, f: F }; } throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); } var normalCompletion = true, didErr = false, err; return { s: function s() { it = it.call(o); }, n: function n() { var step = it.next(); normalCompletion = step.done; return step; }, e: function e(_e2) { didErr = true; err = _e2; }, f: function f() { try { if (!normalCompletion && it["return"] != null) it["return"](); } finally { if (didErr) throw err; } } }; }
function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === "string") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return Array.from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); }
function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) arr2[i] = arr[i]; return arr2; }
var __defProp = Object.defineProperty;
var __getOwnPropSymbols = Object.getOwnPropertySymbols;
var __hasOwnProp = Object.prototype.hasOwnProperty;
var __propIsEnum = Object.prototype.propertyIsEnumerable;
var __defNormalProp = function __defNormalProp(obj, key, value) {
return key in obj ? __defProp(obj, key, {
enumerable: true,
configurable: true,
writable: true,
value: value
}) : obj[key] = value;
};
var __spreadValues = function __spreadValues(a, b) {
for (var prop in b || (b = {})) if (__hasOwnProp.call(b, prop)) __defNormalProp(a, prop, b[prop]);
if (__getOwnPropSymbols) {
var _iterator = _createForOfIteratorHelper(__getOwnPropSymbols(b)),
_step;
try {
for (_iterator.s(); !(_step = _iterator.n()).done;) {
var prop = _step.value;
if (__propIsEnum.call(b, prop)) __defNormalProp(a, prop, b[prop]);
}
} catch (err) {
_iterator.e(err);
} finally {
_iterator.f();
}
}
return a;
};
var SvgJinshi = function SvgJinshi(props) {
return /* @__PURE__ */React.createElement("svg", __spreadValues({
width: 14,
height: 14,
xmlns: "http://www.w3.org/2000/svg"
}, props), /* @__PURE__ */React.createElement("title", null, "\u7F16\u7EC4 18"), /* @__PURE__ */React.createElement("g", {
fill: "none",
fillRule: "evenodd"
}, /* @__PURE__ */React.createElement("circle", {
fill: "#FCB041",
cx: 7,
cy: 7,
r: 7
}), /* @__PURE__ */React.createElement("path", {
d: "M7.531 9.638a.616.616 0 1 1-1.231 0v-.02a.616.616 0 1 1 1.231 0v.02Zm0-2.25a.616.616 0 1 1-1.231 0V4.117a.616.616 0 1 1 1.231 0v3.273Z",
fill: "#FFF",
fillRule: "nonzero"
})));
};
/* harmony default export */ __webpack_exports__["Z"] = ("data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMTQiIGhlaWdodD0iMTQiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyI+PGcgZmlsbD0ibm9uZSIgZmlsbC1ydWxlPSJldmVub2RkIj48Y2lyY2xlIGZpbGw9IiNGQ0IwNDEiIGN4PSI3IiBjeT0iNyIgcj0iNyIvPjxwYXRoIGQ9Ik03LjUzMSA5LjYzOGEuNjE2LjYxNiAwIDEgMS0xLjIzMSAwdi0uMDJhLjYxNi42MTYgMCAxIDEgMS4yMzEgMHYuMDJabTAtMi4yNWEuNjE2LjYxNiAwIDEgMS0xLjIzMSAwVjQuMTE3YS42MTYuNjE2IDAgMSAxIDEuMjMxIDB2My4yNzNaIiBmaWxsPSIjRkZGIiBmaWxsLXJ1bGU9Im5vbnplcm8iLz48L2c+PC9zdmc+");
/***/ }),
/***/ 81930:
/*!******************************************!*\
!*** ./src/assets/images/paper/xixi.svg ***!
\******************************************/
/***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) {
/* unused harmony export ReactComponent */
/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! react */ 67294);
function _createForOfIteratorHelper(o, allowArrayLike) { var it = typeof Symbol !== "undefined" && o[Symbol.iterator] || o["@@iterator"]; if (!it) { if (Array.isArray(o) || (it = _unsupportedIterableToArray(o)) || allowArrayLike && o && typeof o.length === "number") { if (it) o = it; var i = 0; var F = function F() {}; return { s: F, n: function n() { if (i >= o.length) return { done: true }; return { done: false, value: o[i++] }; }, e: function e(_e) { throw _e; }, f: F }; } throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); } var normalCompletion = true, didErr = false, err; return { s: function s() { it = it.call(o); }, n: function n() { var step = it.next(); normalCompletion = step.done; return step; }, e: function e(_e2) { didErr = true; err = _e2; }, f: function f() { try { if (!normalCompletion && it["return"] != null) it["return"](); } finally { if (didErr) throw err; } } }; }
function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === "string") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return Array.from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); }
function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) arr2[i] = arr[i]; return arr2; }
var __defProp = Object.defineProperty;
var __getOwnPropSymbols = Object.getOwnPropertySymbols;
var __hasOwnProp = Object.prototype.hasOwnProperty;
var __propIsEnum = Object.prototype.propertyIsEnumerable;
var __defNormalProp = function __defNormalProp(obj, key, value) {
return key in obj ? __defProp(obj, key, {
enumerable: true,
configurable: true,
writable: true,
value: value
}) : obj[key] = value;
};
var __spreadValues = function __spreadValues(a, b) {
for (var prop in b || (b = {})) if (__hasOwnProp.call(b, prop)) __defNormalProp(a, prop, b[prop]);
if (__getOwnPropSymbols) {
var _iterator = _createForOfIteratorHelper(__getOwnPropSymbols(b)),
_step;
try {
for (_iterator.s(); !(_step = _iterator.n()).done;) {
var prop = _step.value;
if (__propIsEnum.call(b, prop)) __defNormalProp(a, prop, b[prop]);
}
} catch (err) {
_iterator.e(err);
} finally {
_iterator.f();
}
}
return a;
};
var SvgXixi = function SvgXixi(props) {
return /* @__PURE__ */React.createElement("svg", __spreadValues({
width: 34,
height: 34,
xmlns: "http://www.w3.org/2000/svg"
}, props), /* @__PURE__ */React.createElement("title", null, "\u7F16\u7EC4 12"), /* @__PURE__ */React.createElement("g", {
fill: "none",
fillRule: "evenodd"
}, /* @__PURE__ */React.createElement("rect", {
width: 34,
height: 34,
rx: 10,
fill: "#EAF3F4"
}), /* @__PURE__ */React.createElement("path", {
d: "M25.905 15.37a.775.775 0 0 0-.626-.529l-4.814-.7-2.152-4.362a.776.776 0 0 0-1.392 0l-2.153 4.363-4.814.699a.775.775 0 0 0-.43 1.323l3.484 3.396-.823 4.794a.777.777 0 0 0 1.126.818l4.306-2.264 4.305 2.264a.778.778 0 0 0 .817-.059.777.777 0 0 0 .31-.759l-.823-4.794 3.483-3.396a.777.777 0 0 0 .196-.795Z",
fill: "#21C0A6",
fillRule: "nonzero"
})));
};
/* harmony default export */ __webpack_exports__["Z"] = ("data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMzQiIGhlaWdodD0iMzQiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyI+PGcgZmlsbD0ibm9uZSIgZmlsbC1ydWxlPSJldmVub2RkIj48cmVjdCB3aWR0aD0iMzQiIGhlaWdodD0iMzQiIHJ4PSIxMCIgZmlsbD0iI0VBRjNGNCIvPjxwYXRoIGQ9Ik0yNS45MDUgMTUuMzdhLjc3NS43NzUgMCAwIDAtLjYyNi0uNTI5bC00LjgxNC0uNy0yLjE1Mi00LjM2MmEuNzc2Ljc3NiAwIDAgMC0xLjM5MiAwbC0yLjE1MyA0LjM2My00LjgxNC42OTlhLjc3NS43NzUgMCAwIDAtLjQzIDEuMzIzbDMuNDg0IDMuMzk2LS44MjMgNC43OTRhLjc3Ny43NzcgMCAwIDAgMS4xMjYuODE4bDQuMzA2LTIuMjY0IDQuMzA1IDIuMjY0YS43NzguNzc4IDAgMCAwIC44MTctLjA1OS43NzcuNzc3IDAgMCAwIC4zMS0uNzU5bC0uODIzLTQuNzk0IDMuNDgzLTMuMzk2YS43NzcuNzc3IDAgMCAwIC4xOTYtLjc5NVoiIGZpbGw9IiMyMUMwQTYiIGZpbGwtcnVsZT0ibm9uemVybyIvPjwvZz48L3N2Zz4=");
/***/ })
}]);