"use strict"; (self["webpackChunk"] = self["webpackChunk"] || []).push([[963],{ /***/ 7577: /*!********************************************!*\ !*** ./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 */ 59301); var __defProp = Object.defineProperty; var __getOwnPropSymbols = Object.getOwnPropertySymbols; var __hasOwnProp = Object.prototype.hasOwnProperty; var __propIsEnum = Object.prototype.propertyIsEnumerable; var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value; var __spreadValues = (a, b) => { for (var prop in b || (b = {})) if (__hasOwnProp.call(b, prop)) __defNormalProp(a, prop, b[prop]); if (__getOwnPropSymbols) for (var prop of __getOwnPropSymbols(b)) { if (__propIsEnum.call(b, prop)) __defNormalProp(a, prop, b[prop]); } return a; }; const SvgJinshi = (props) => /* @__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+"); /***/ }), /***/ 16800: /*!**********************************************!*\ !*** ./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 antd__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! antd */ 3113); /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! react */ 59301); var __defProp = Object.defineProperty; var __defProps = Object.defineProperties; var __getOwnPropDescs = Object.getOwnPropertyDescriptors; var __getOwnPropSymbols = Object.getOwnPropertySymbols; var __hasOwnProp = Object.prototype.hasOwnProperty; var __propIsEnum = Object.prototype.propertyIsEnumerable; var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value; var __spreadValues = (a, b) => { for (var prop in b || (b = {})) if (__hasOwnProp.call(b, prop)) __defNormalProp(a, prop, b[prop]); if (__getOwnPropSymbols) for (var prop of __getOwnPropSymbols(b)) { if (__propIsEnum.call(b, prop)) __defNormalProp(a, prop, b[prop]); } return a; }; var __spreadProps = (a, b) => __defProps(a, __getOwnPropDescs(b)); var __objRest = (source, exclude) => { var target = {}; for (var prop in source) if (__hasOwnProp.call(source, prop) && exclude.indexOf(prop) < 0) target[prop] = source[prop]; if (source != null && __getOwnPropSymbols) for (var prop of __getOwnPropSymbols(source)) { if (exclude.indexOf(prop) < 0 && __propIsEnum.call(source, prop)) target[prop] = source[prop]; } return target; }; var __async = (__this, __arguments, generator) => { return new Promise((resolve, reject) => { var fulfilled = (value) => { try { step(generator.next(value)); } catch (e) { reject(e); } }; var rejected = (value) => { try { step(generator.throw(value)); } catch (e) { reject(e); } }; var step = (x) => x.done ? resolve(x.value) : Promise.resolve(x.value).then(fulfilled, rejected); step((generator = generator.apply(__this, __arguments)).next()); }); }; const AsyncButton = (_a) => { var _b = _a, { children } = _b, props = __objRest(_b, ["children"]); const [btnLoading, setBtnLoading] = (0,react__WEBPACK_IMPORTED_MODULE_0__.useState)(false); return /* @__PURE__ */ react__WEBPACK_IMPORTED_MODULE_0__.createElement(antd__WEBPACK_IMPORTED_MODULE_1__/* ["default"] */ .ZP, __spreadProps(__spreadValues({}, props), { loading: btnLoading, onClick: (e) => __async(void 0, null, function* () { try { setBtnLoading(true); yield props.onClick(e); setBtnLoading(false); } catch (error) { console.error(error); setBtnLoading(false); } }) }), children); }; /***/ }), /***/ 77954: /*!*********************************************************************!*\ !*** ./src/components/Editor/NullChildEditor/index.jsx + 1 modules ***! \*********************************************************************/ /***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) { // EXPORTS __webpack_require__.d(__webpack_exports__, { Z: function() { return /* binding */ Editor_NullChildEditor; } }); // EXTERNAL MODULE: ./node_modules/_react@17.0.2@react/index.js var _react_17_0_2_react = __webpack_require__(59301); // EXTERNAL MODULE: ./node_modules/_antd@5.9.0@antd/es/input/index.js + 5 modules var input = __webpack_require__(98135); // EXTERNAL MODULE: ./node_modules/_antd@5.9.0@antd/es/tag/index.js + 5 modules var es_tag = __webpack_require__(12563); // EXTERNAL MODULE: ./node_modules/_antd@5.9.0@antd/es/message/index.js + 4 modules var message = __webpack_require__(8591); ;// CONCATENATED MODULE: ./src/components/Editor/NullChildEditor/index.less?modules // extracted by mini-css-extract-plugin /* harmony default export */ var NullChildEditormodules = ({"flex":"flex___eLcnP","flex1":"flex1___yUTT7","color666":"color666___TiUhG","error":"error___gTTtv","deleteIcon":"deleteIcon___mnZW1","addIcon":"addIcon___JC5NS"}); // EXTERNAL MODULE: ./node_modules/_@ant-design_icons@5.3.7@@ant-design/icons/es/icons/PlusOutlined.js + 1 modules var PlusOutlined = __webpack_require__(22415); ;// CONCATENATED MODULE: ./src/components/Editor/NullChildEditor/index.jsx const { TextArea } = input["default"]; class NullChildEditor extends _react_17_0_2_react.Component { constructor(props) { super(props); this.state = { inputVisible: false, EditInputIndex: -1 }; } // componentDidMount() { // // console.log(`${this.props.index}----`,this.props,e); // if (this.props.answers[0].length <= 0) { // this.setState({ // EditInputIndex: 0, // }); // } // } render() { let { index, onAnswerChange, addChildAnswer, exerciseIsPublish, answers, activeOptionErrorIndex, flex = "0 0 1000px" } = this.props; console.log("----", answers); let { inputVisible, EditInputIndex } = this.state; return /* @__PURE__ */ _react_17_0_2_react.createElement("div", { className: NullChildEditormodules.flex }, /* @__PURE__ */ _react_17_0_2_react.createElement( "div", { className: `${NullChildEditormodules.color666} mb5 mt6`, style: { flex: "0 0 90px" } }, "\u7B54\u6848(\u586B\u7A7A", index + 1, "):" ), /* @__PURE__ */ _react_17_0_2_react.createElement("div", { style: { border: "1px solid #f6f6f6", flex: 1, padding: 10 } }, answers == null ? void 0 : answers.map((tag, itemIndex) => { return /* @__PURE__ */ _react_17_0_2_react.createElement(_react_17_0_2_react.Fragment, null, EditInputIndex !== itemIndex ? (tag == null ? void 0 : tag.length) > 0 ? /* @__PURE__ */ _react_17_0_2_react.createElement( es_tag["default"], { className: "edit-tag", key: tag, closable: true, onClose: (e) => { e.preventDefault(); if ((answers == null ? void 0 : answers.length) === 1 && itemIndex === 0) { this.props.deleteChildAnswermain(index, itemIndex); } else { this.props.deleteChildAnswer(index, itemIndex); } } }, /* @__PURE__ */ _react_17_0_2_react.createElement( "span", { onDoubleClick: (e) => { this.setState({ EditInputIndex: itemIndex }); e.preventDefault(); } }, tag ) ) : /* @__PURE__ */ _react_17_0_2_react.createElement( input["default"], { defaultValue: tag, style: { width: 78, marginRight: 8, height: 24, verticalAlign: "top" }, onBlur: (e) => { if (e.target.value.replaceAll(" ", "").length <= 0) { message/* default */.ZP.info("\u5185\u5BB9\u4E0D\u80FD\u4E3A\u7EAF\u7A7A\u683C"); return; } onAnswerChange(index, itemIndex, e.target.value); this.setState({ EditInputIndex: -1, inputVisible: false }); } } ) : /* @__PURE__ */ _react_17_0_2_react.createElement( input["default"], { defaultValue: tag, style: { width: 78, marginRight: 8, height: 24, verticalAlign: "top" }, onBlur: (e) => { if (e.target.value.replaceAll(" ", "").length <= 0) { message/* default */.ZP.info("\u5185\u5BB9\u4E0D\u80FD\u4E3A\u7EAF\u7A7A\u683C"); return; } onAnswerChange(index, itemIndex, e.target.value); this.setState({ EditInputIndex: -1, inputVisible: false }); } } )); }), !inputVisible && /* @__PURE__ */ _react_17_0_2_react.createElement( es_tag["default"], { className: "site-tag-plus", onClick: () => { addChildAnswer(index); this.setState({ inputVisible: true }); } }, /* @__PURE__ */ _react_17_0_2_react.createElement(PlusOutlined/* default */.Z, null), " \u65B0\u589E\u7B54\u6848" ))); } } /* harmony default export */ var Editor_NullChildEditor = (NullChildEditor); /***/ }), /***/ 85607: /*!************************************************!*\ !*** ./src/components/Editor/NullMDEditor.jsx ***! \************************************************/ /***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) { /* harmony export */ __webpack_require__.d(__webpack_exports__, { /* harmony export */ Z: function() { return /* binding */ NullMDEditor; } /* harmony export */ }); /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! react */ 59301); /* harmony import */ var _markdown_editor__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../markdown-editor */ 96180); var __defProp = Object.defineProperty; var __defProps = Object.defineProperties; var __getOwnPropDescs = Object.getOwnPropertyDescriptors; var __getOwnPropSymbols = Object.getOwnPropertySymbols; var __hasOwnProp = Object.prototype.hasOwnProperty; var __propIsEnum = Object.prototype.propertyIsEnumerable; var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value; var __spreadValues = (a, b) => { for (var prop in b || (b = {})) if (__hasOwnProp.call(b, prop)) __defNormalProp(a, prop, b[prop]); if (__getOwnPropSymbols) for (var prop of __getOwnPropSymbols(b)) { if (__propIsEnum.call(b, prop)) __defNormalProp(a, prop, b[prop]); } return a; }; var __spreadProps = (a, b) => __defProps(a, __getOwnPropDescs(b)); var __publicField = (obj, key, value) => { __defNormalProp(obj, typeof key !== "symbol" ? key + "" : key, value); return value; }; const NULL_CH = "\u2581"; class NullMDEditor extends react__WEBPACK_IMPORTED_MODULE_0__.Component { constructor() { super(...arguments); __publicField(this, "getChCountBeforeCursor", (cm, cursor) => { const currentLine = cursor.line; let placeholderCountBefore = 0; for (let _line = 0; _line < currentLine; _line++) { placeholderCountBefore += cm.getLine(_line).split(NULL_CH).length - 1; } const currentLineStringBeforeCursor = cm.getLine(currentLine).substring(0, cursor.ch); placeholderCountBefore += currentLineStringBeforeCursor.split(NULL_CH).length - 1; return placeholderCountBefore; }); __publicField(this, "onCMBeforeChange", (cm, change) => { const rangeText = cm.getRange(change.from, change.to); let totalPlaceholderCount = 0; change.text.forEach((item) => { totalPlaceholderCount += item.split(NULL_CH).length - 1; }); if (rangeText && rangeText.indexOf(NULL_CH) != -1) { const placeholderCountInRange = rangeText.split(NULL_CH).length - 1; const placeholderCountBefore = this.getChCountBeforeCursor( cm, change.from ); console.log( `\u5220\u9664${placeholderCountInRange}\u4E2A\uFF0C \u4E4B\u524D\u6709${placeholderCountBefore}\u4E2A\uFF0C\u65B0\u589E${totalPlaceholderCount}\u4E2A` ); if (this.props.deleteEmptyDisabled) { change.cancel(); } else { this.props.onPlaceholderChange && this.props.onPlaceholderChange( placeholderCountBefore, placeholderCountInRange, totalPlaceholderCount ); } } else if (totalPlaceholderCount) { const placeholderCountBefore = this.getChCountBeforeCursor( cm, change.from ); console.log( `\u65B0\u589E${totalPlaceholderCount}\u4E2A\uFF0C\u4E4B\u524D\u6709${placeholderCountBefore}\u4E2A` ); this.props.onPlaceholderChange && this.props.onPlaceholderChange( placeholderCountBefore, 0, totalPlaceholderCount ); } }); } render() { return /* @__PURE__ */ react__WEBPACK_IMPORTED_MODULE_0__.createElement( _markdown_editor__WEBPACK_IMPORTED_MODULE_1__/* ["default"] */ .Z, __spreadProps(__spreadValues({}, this.props), { onCMBeforeChange: this.onCMBeforeChange }) ); } } /***/ }), /***/ 89296: /*!************************************************************************************************!*\ !*** ./src/pages/Paperlibrary/Random/AddAndEdit/components/StepPreview/index.tsx + 19 modules ***! \************************************************************************************************/ /***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) { // EXPORTS __webpack_require__.d(__webpack_exports__, { Z: function() { return /* binding */ StepPreview; } }); // EXTERNAL MODULE: ./node_modules/_react@17.0.2@react/index.js var _react_17_0_2_react = __webpack_require__(59301); ;// 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","modalColumn":"modalColumn___I_tK_","modalRow":"modalRow___lyw_U","sup":"sup___HSz3Z","popover":"popover___kE8aI"}); // EXTERNAL MODULE: ./node_modules/_antd@5.9.0@antd/es/form/index.js + 19 modules var es_form = __webpack_require__(78241); // EXTERNAL MODULE: ./node_modules/_antd@5.9.0@antd/es/tooltip/index.js + 3 modules var tooltip = __webpack_require__(6848); // EXTERNAL MODULE: ./node_modules/_antd@5.9.0@antd/es/modal/index.js + 16 modules var es_modal = __webpack_require__(43418); // EXTERNAL MODULE: ./node_modules/_antd@5.9.0@antd/es/input-number/index.js + 14 modules var input_number = __webpack_require__(54449); // EXTERNAL MODULE: ./node_modules/_antd@5.9.0@antd/es/message/index.js + 4 modules var es_message = __webpack_require__(8591); // EXTERNAL MODULE: ./node_modules/_antd@5.9.0@antd/es/input/index.js + 5 modules var input = __webpack_require__(98135); // EXTERNAL MODULE: ./node_modules/_antd@5.9.0@antd/es/divider/index.js + 1 modules var divider = __webpack_require__(28103); // EXTERNAL MODULE: ./node_modules/_antd@5.9.0@antd/es/button/index.js var es_button = __webpack_require__(3113); // EXTERNAL MODULE: ./node_modules/_antd@5.9.0@antd/es/pagination/index.js + 10 modules var pagination = __webpack_require__(53864); // EXTERNAL MODULE: ./node_modules/_antd@5.9.0@antd/es/row/index.js var row = __webpack_require__(95237); // EXTERNAL MODULE: ./node_modules/_antd@5.9.0@antd/es/popover/index.js var popover = __webpack_require__(60324); ;// CONCATENATED MODULE: ./src/assets/images/paper/zhong.svg var __defProp = Object.defineProperty; var __getOwnPropSymbols = Object.getOwnPropertySymbols; var __hasOwnProp = Object.prototype.hasOwnProperty; var __propIsEnum = Object.prototype.propertyIsEnumerable; var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value; var __spreadValues = (a, b) => { for (var prop in b || (b = {})) if (__hasOwnProp.call(b, prop)) __defNormalProp(a, prop, b[prop]); if (__getOwnPropSymbols) for (var prop of __getOwnPropSymbols(b)) { if (__propIsEnum.call(b, prop)) __defNormalProp(a, prop, b[prop]); } return a; }; const SvgZhong = (props) => /* @__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 var RenderHtml = __webpack_require__(16921); // EXTERNAL MODULE: ./src/.umi-production/exports.ts + 15 modules var _umi_production_exports = __webpack_require__(67866); // EXTERNAL MODULE: ./src/utils/util.tsx var util = __webpack_require__(13462); // EXTERNAL MODULE: ./src/utils/fetch.ts var fetch = __webpack_require__(51165); ;// CONCATENATED MODULE: ./src/assets/images/paper/xixi.svg var xixi_defProp = Object.defineProperty; var xixi_getOwnPropSymbols = Object.getOwnPropertySymbols; var xixi_hasOwnProp = Object.prototype.hasOwnProperty; var xixi_propIsEnum = Object.prototype.propertyIsEnumerable; var xixi_defNormalProp = (obj, key, value) => key in obj ? xixi_defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value; var xixi_spreadValues = (a, b) => { for (var prop in b || (b = {})) if (xixi_hasOwnProp.call(b, prop)) xixi_defNormalProp(a, prop, b[prop]); if (xixi_getOwnPropSymbols) for (var prop of xixi_getOwnPropSymbols(b)) { if (xixi_propIsEnum.call(b, prop)) xixi_defNormalProp(a, prop, b[prop]); } return a; }; const SvgXixi = (props) => /* @__PURE__ */ React.createElement("svg", xixi_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 */ var xixi = ("data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMzQiIGhlaWdodD0iMzQiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyI+PGcgZmlsbD0ibm9uZSIgZmlsbC1ydWxlPSJldmVub2RkIj48cmVjdCB3aWR0aD0iMzQiIGhlaWdodD0iMzQiIHJ4PSIxMCIgZmlsbD0iI0VBRjNGNCIvPjxwYXRoIGQ9Ik0yNS45MDUgMTUuMzdhLjc3NS43NzUgMCAwIDAtLjYyNi0uNTI5bC00LjgxNC0uNy0yLjE1Mi00LjM2MmEuNzc2Ljc3NiAwIDAgMC0xLjM5MiAwbC0yLjE1MyA0LjM2My00LjgxNC42OTlhLjc3NS43NzUgMCAwIDAtLjQzIDEuMzIzbDMuNDg0IDMuMzk2LS44MjMgNC43OTRhLjc3Ny43NzcgMCAwIDAgMS4xMjYuODE4bDQuMzA2LTIuMjY0IDQuMzA1IDIuMjY0YS43NzguNzc4IDAgMCAwIC44MTctLjA1OS43NzcuNzc3IDAgMCAwIC4zMS0uNzU5bC0uODIzLTQuNzk0IDMuNDgzLTMuMzk2YS43NzcuNzc3IDAgMCAwIC4xOTYtLjc5NVoiIGZpbGw9IiMyMUMwQTYiIGZpbGwtcnVsZT0ibm9uemVybyIvPjwvZz48L3N2Zz4="); ;// CONCATENATED MODULE: ./src/assets/images/paper/bi.svg var bi_defProp = Object.defineProperty; var bi_getOwnPropSymbols = Object.getOwnPropertySymbols; var bi_hasOwnProp = Object.prototype.hasOwnProperty; var bi_propIsEnum = Object.prototype.propertyIsEnumerable; var bi_defNormalProp = (obj, key, value) => key in obj ? bi_defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value; var bi_spreadValues = (a, b) => { for (var prop in b || (b = {})) if (bi_hasOwnProp.call(b, prop)) bi_defNormalProp(a, prop, b[prop]); if (bi_getOwnPropSymbols) for (var prop of bi_getOwnPropSymbols(b)) { if (bi_propIsEnum.call(b, prop)) bi_defNormalProp(a, prop, b[prop]); } return a; }; const SvgBi = (props) => /* @__PURE__ */ React.createElement("svg", bi_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 */ var bi = ("data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMzQiIGhlaWdodD0iMzQiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyI+PGcgZmlsbD0ibm9uZSIgZmlsbC1ydWxlPSJldmVub2RkIj48cmVjdCBmaWxsPSIjRTdGM0ZGIiB3aWR0aD0iMzQiIGhlaWdodD0iMzQiIHJ4PSIxMCIvPjxnIGZpbGw9IiM0QzZGRkYiIGZpbGwtcnVsZT0ibm9uemVybyI+PHBhdGggZD0ibTIzLjcxOSAxMy4zMjUtNC4wOTgtMy45NGMtLjA5Ny0uMTMtLjIyNS0uMTYyLS4zNTUtLjE2Mi0uMTI5IDAtLjI1OC4wNjQtLjM4Ny4xNjFsLTcuNTUgNy43NTNjLS4wNjUuMDY1LS4wOTguMTYyLS4xMy4yMjdsLTEuMDMyIDUuNDI3Yy0uMDMzLjE5NC4wMzIuMzIzLjE2LjQ4NC4xMy4xMy4yMjcuMTYyLjM4OS4xNjJoLjA5Nmw0Ljc3Ni0xLjA5OWMuMDk3LS4wMzIuMTk0LS4wNjQuMjU4LS4xNjFsNy44NDEtOC4xMDhjLjE5NC0uMTYyLjE5NC0uNTE3LjAzMy0uNzQ0aC0uMDAxWm0tOC4xIDguMDQ0YS41MzQuNTM0IDAgMCAxLS4zODYuMTYyLjU2LjU2IDAgMCAxLS4zODgtLjE2MmwtMy0yLjgxYy0uMjI2LS4xOTQtLjIyNi0uNTE3LS4wMzMtLjc0My4xOTQtLjIyNy41MTctLjIyNy43NDMtLjAzM2wzIDIuODExYy4yNTkuMjI2LjI5MS41NS4wNjUuNzc2Wk0xNyAyMi45Mmg2Ljg0NHYxLjA1NUgxN3oiLz48L2c+PC9nPjwvc3ZnPg=="); // EXTERNAL MODULE: ./src/assets/images/paper/jinshi.svg var jinshi = __webpack_require__(7577); // EXTERNAL MODULE: ./node_modules/_antd@5.9.0@antd/es/checkbox/index.js + 3 modules var es_checkbox = __webpack_require__(24905); // EXTERNAL MODULE: ./src/components/markdown-editor/index.tsx + 15 modules var markdown_editor = __webpack_require__(96180); // EXTERNAL MODULE: ./src/components/Editor/NullMDEditor.jsx var NullMDEditor = __webpack_require__(85607); // EXTERNAL MODULE: ./src/components/Editor/NullChildEditor/index.jsx + 1 modules var NullChildEditor = __webpack_require__(77954); ;// 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","collapseWrapper":"collapseWrapper___sQyVD","panelHeader":"panelHeader___Ivicf","open":"open___aEOQE","close":"close___z4P5H"}); ;// CONCATENATED MODULE: ./src/pages/Paperlibrary/Random/AddAndEdit/components/StepPreview/components/CompletionEditor/index.tsx /* provided dependency */ var CompletionEditor_React = __webpack_require__(/*! react */ 59301); var CompletionEditor_defProp = Object.defineProperty; var __defProps = Object.defineProperties; var __getOwnPropDescs = Object.getOwnPropertyDescriptors; var CompletionEditor_getOwnPropSymbols = Object.getOwnPropertySymbols; var CompletionEditor_hasOwnProp = Object.prototype.hasOwnProperty; var CompletionEditor_propIsEnum = Object.prototype.propertyIsEnumerable; var CompletionEditor_defNormalProp = (obj, key, value) => key in obj ? CompletionEditor_defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value; var CompletionEditor_spreadValues = (a, b) => { for (var prop in b || (b = {})) if (CompletionEditor_hasOwnProp.call(b, prop)) CompletionEditor_defNormalProp(a, prop, b[prop]); if (CompletionEditor_getOwnPropSymbols) for (var prop of CompletionEditor_getOwnPropSymbols(b)) { if (CompletionEditor_propIsEnum.call(b, prop)) CompletionEditor_defNormalProp(a, prop, b[prop]); } return a; }; var __spreadProps = (a, b) => __defProps(a, __getOwnPropDescs(b)); var __objRest = (source, exclude) => { var target = {}; for (var prop in source) if (CompletionEditor_hasOwnProp.call(source, prop) && exclude.indexOf(prop) < 0) target[prop] = source[prop]; if (source != null && CompletionEditor_getOwnPropSymbols) for (var prop of CompletionEditor_getOwnPropSymbols(source)) { if (exclude.indexOf(prop) < 0 && CompletionEditor_propIsEnum.call(source, prop)) target[prop] = source[prop]; } return target; }; const 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" ])); const CompletionEditor = (_a, ref) => { var _b = _a, { globalSetting, loading, dispatch, isEdit, editData } = _b, props = __objRest(_b, [ "globalSetting", "loading", "dispatch", "isEdit", "editData" ]); const [title, setTitle] = (0,_react_17_0_2_react.useState)(""); const [analysis, setAnalysis] = (0,_react_17_0_2_react.useState)(""); const [answerList, setAnswerList] = (0,_react_17_0_2_react.useState)([]); const [activeOptionErrorIndex, setActiveOptionErrorIndex] = (0,_react_17_0_2_react.useState)(""); const [checked, setChecked] = (0,_react_17_0_2_react.useState)(); const [firstSetAnswerFlag, setFirstSetAnswerFlag] = (0,_react_17_0_2_react.useState)(false); const [formValue, setFormValue] = (0,_react_17_0_2_react.useState)({}); (0,_react_17_0_2_react.useEffect)(() => { if (!editData || !isEdit) { return; } setTitle(editData == null ? void 0 : editData.name); setAnalysis(editData == null ? void 0 : editData.analysis); setChecked(editData == null ? void 0 : editData.is_ordered); setFormValue(editData); setFirstSetAnswerFlag(true); }, [editData]); (0,_react_17_0_2_react.useEffect)(() => { if (!firstSetAnswerFlag) { return; } const answer = editData == null ? void 0 : editData.standard_answer.map((item) => item.answer_text); setAnswerList(answer); setFirstSetAnswerFlag(false); }, [firstSetAnswerFlag]); (0,_react_17_0_2_react.useImperativeHandle)(ref, () => ({ onSave, Clear })); const onSave = () => { let answerArray = []; let isEmpty = false; if (!title) { es_message/* default */.ZP.info("\u8BF7\u60A8\u8F93\u5165\u9898\u5E72"); return false; } answerList.forEach((answers, index) => { answerArray.push({ position: index + 1, answer_text: [] }); answers.forEach((item, itemIndex) => { answerArray[index].answer_text.push(item); if (!item || !(0,util/* validateLength */.eR)(item, 1e4)) { setActiveOptionErrorIndex(`${index}-${itemIndex}`); es_message/* default */.ZP.info(!item ? `\u7B54\u6848\uFF1A\u4E0D\u80FD\u4E3A\u7A7A` : "\u7B54\u6848\u4E0D\u80FD\u8D85\u8FC710000\u5B57\u7B26"); isEmpty = true; } }); }); if (isEmpty) { return false; } if ((answerArray == null ? void 0 : answerArray.length) > 20) { es_message/* default */.ZP.warning("\u586B\u7A7A\u9898\u6807\u51C6\u7B54\u6848\u4E0D\u80FD\u4E3A\u7A7A/\u4E0D\u80FD\u8D85\u8FC720\u4E2A\uFF01"); return false; } return { name: title, analysis, standard_answers: answerArray, is_ordered: checked, downcase: formValue == null ? void 0 : formValue.downcase, no_space: formValue == null ? void 0 : formValue.no_space }; }; const Clear = () => { setTitle(""); setAnalysis(""); setAnswerList([]); setChecked(false); }; const handlePlaceholderChange = (placeholderCountBefore, placeholderCountInRange, totalPlaceholderCount) => { const newStandardAnswers = answerList.slice(); if (placeholderCountInRange) { newStandardAnswers.splice( placeholderCountBefore, placeholderCountInRange ); } if (totalPlaceholderCount) { for (let i = 0; i < totalPlaceholderCount; i++) { newStandardAnswers.splice(placeholderCountBefore + i, 0, [""]); } } setAnswerList(newStandardAnswers); }; const handleAnswerChange = (index, itemIndex, val) => { setActiveOptionErrorIndex(""); let newStandardAnswers = answerList.slice(); newStandardAnswers[index][itemIndex] = val; setAnswerList(newStandardAnswers); }; const handleAddChildAnswer = (index) => { let newStandardAnswers = answerList.slice(); newStandardAnswers[index] = [...newStandardAnswers[index], ...[""]]; setAnswerList(newStandardAnswers); }; const handleDeleteChildAnswer = (index, childIndex) => { let newStandardAnswers = answerList.slice(); if (!newStandardAnswers[index][childIndex]) { newStandardAnswers[index] = newStandardAnswers[index].filter((_, key) => key !== childIndex); setAnswerList(newStandardAnswers); return; } es_modal["default"].confirm({ centered: true, okText: "\u786E\u5B9A", cancelText: "\u53D6\u6D88", title: "\u63D0\u793A", content: "\u786E\u8BA4\u8981\u5220\u9664\u8FD9\u4E2A\u53C2\u8003\u7B54\u6848\u5417\uFF1F", className: editormodules.modal, onOk: () => { newStandardAnswers[index] = newStandardAnswers[index].filter((_, key) => key !== childIndex); setAnswerList(newStandardAnswers); } }); }; const handleDeleteChildAnswermain = (index) => { es_modal["default"].confirm({ centered: true, okText: "\u786E\u5B9A", cancelText: "\u53D6\u6D88", title: "\u63D0\u793A", content: "\u786E\u8BA4\u8981\u5220\u9664\u8FD9\u4E2A\u53C2\u8003\u7B54\u6848\u5417\uFF1F", className: editormodules.modal, onOk: () => { let newStandardAnswers = answerList.slice(); newStandardAnswers = answerList.filter((_, key) => index !== key); setAnswerList(newStandardAnswers); } }); }; return /* @__PURE__ */ CompletionEditor_React.createElement("section", { className: editormodules.wrap }, /* @__PURE__ */ CompletionEditor_React.createElement("p", { className: editormodules.titleWrap }, /* @__PURE__ */ CompletionEditor_React.createElement("span", { className: editormodules.required }, "*"), /* @__PURE__ */ CompletionEditor_React.createElement("span", { className: editormodules.title }, "\u9898\u5E72\uFF1A")), /* @__PURE__ */ CompletionEditor_React.createElement("div", null, /* @__PURE__ */ CompletionEditor_React.createElement( NullMDEditor/* default */.Z, { id: `completion-question-tittle`, placeholder: "\u8BF7\u60A8\u8F93\u5165\u9898\u76EE", height: 155, defaultValue: title, onChange: (value) => setTitle(value), showNullButton: true, onPlaceholderChange: handlePlaceholderChange } )), /* @__PURE__ */ CompletionEditor_React.createElement("div", { className: "mt20" }, answerList.map((answers, index) => { return /* @__PURE__ */ CompletionEditor_React.createElement( NullChildEditor/* default */.Z, { key: index, answers, index, flex: 1, is_md: true, activeOptionErrorIndex, onAnswerChange: handleAnswerChange, addChildAnswer: handleAddChildAnswer, deleteChildAnswer: handleDeleteChildAnswer, deleteChildAnswermain: handleDeleteChildAnswermain } ); })), /* @__PURE__ */ CompletionEditor_React.createElement("div", null, /* @__PURE__ */ CompletionEditor_React.createElement( es_checkbox["default"], { className: `${editormodules.color333} font14 mt20`, checked: formValue.downcase, onChange: (e) => setFormValue(__spreadProps(CompletionEditor_spreadValues({}, formValue), { downcase: e.target.checked })) }, "\u5224\u5206\u65F6\u5FFD\u7565\u7B54\u6848\u4E2D\u7684\u5B57\u6BCD\u5927\u5C0F\u5199" )), /* @__PURE__ */ CompletionEditor_React.createElement("div", null, /* @__PURE__ */ CompletionEditor_React.createElement( es_checkbox["default"], { className: `${editormodules.color333} font14 mt20`, checked: formValue.no_space, onChange: (e) => setFormValue(__spreadProps(CompletionEditor_spreadValues({}, formValue), { no_space: e.target.checked })) }, "\u5224\u5206\u65F6\u5FFD\u7565\u7B54\u6848\u4E2D\u7684\u7A7A\u683C" )), /* @__PURE__ */ CompletionEditor_React.createElement("div", { className: "mt20" }, (answerList == null ? void 0 : answerList.length) > 1 && /* @__PURE__ */ CompletionEditor_React.createElement("span", null, /* @__PURE__ */ CompletionEditor_React.createElement( es_checkbox["default"], { checked, onChange: (e) => setChecked(e.target.checked), className: `${editormodules.color333} font14` }, "\u591A\u4E2A\u586B\u7A7A\u7684\u7B54\u6848\u6709\u987A\u5E8F\u8981\u6C42" ), /* @__PURE__ */ CompletionEditor_React.createElement("span", { className: `${editormodules.color999} font12` }, "\uFF08\u9009\u4E2D\uFF0C\u6BCF\u4E2A\u586B\u7A7A\u7684\u7B54\u6848\u987A\u5E8F\u5FC5\u987B\u4E0E\u53C2\u8003\u7B54\u6848\u4E00\u81F4\uFF09"))), /* @__PURE__ */ CompletionEditor_React.createElement("p", { className: editormodules.titleWrap }, /* @__PURE__ */ CompletionEditor_React.createElement("span", { className: editormodules.title }, "\u9898\u76EE\u89E3\u6790\uFF1A")), /* @__PURE__ */ CompletionEditor_React.createElement( markdown_editor/* default */.Z, { id: "single-question-answer", watch: true, height: 155, placeholder: "\u8BF7\u60A8\u8F93\u5165\u9898\u76EE\u89E3\u6790", defaultValue: analysis, onChange: (value) => setAnalysis(value) } )); }; /* harmony default export */ var components_CompletionEditor = ((0,_umi_production_exports.connect)( ({ loading, globalSetting }) => ({ globalSetting, loading: loading.effects }), null, null, { forwardRef: true } )((0,_react_17_0_2_react.forwardRef)(CompletionEditor))); // EXTERNAL MODULE: ./node_modules/_antd@5.9.0@antd/es/radio/index.js + 5 modules var es_radio = __webpack_require__(5112); ;// CONCATENATED MODULE: ./src/pages/Paperlibrary/Random/AddAndEdit/components/StepPreview/components/JudgmentEditor/index.tsx var JudgmentEditor_getOwnPropSymbols = Object.getOwnPropertySymbols; var JudgmentEditor_hasOwnProp = Object.prototype.hasOwnProperty; var JudgmentEditor_propIsEnum = Object.prototype.propertyIsEnumerable; var JudgmentEditor_objRest = (source, exclude) => { var target = {}; for (var prop in source) if (JudgmentEditor_hasOwnProp.call(source, prop) && exclude.indexOf(prop) < 0) target[prop] = source[prop]; if (source != null && JudgmentEditor_getOwnPropSymbols) for (var prop of JudgmentEditor_getOwnPropSymbols(source)) { if (exclude.indexOf(prop) < 0 && JudgmentEditor_propIsEnum.call(source, prop)) target[prop] = source[prop]; } return target; }; const 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" ])); const JudgmentEditor = (_a, ref) => { var _b = _a, { globalSetting, loading, editData, dispatch, onRef = () => { }, isEdit } = _b, props = JudgmentEditor_objRest(_b, [ "globalSetting", "loading", "editData", "dispatch", "onRef", "isEdit" ]); const [activeAnswer, setActiveAnswer] = (0,_react_17_0_2_react.useState)(); const [title, setTitle] = (0,_react_17_0_2_react.useState)(""); const [analysis, setAnalysis] = (0,_react_17_0_2_react.useState)(""); (0,_react_17_0_2_react.useEffect)(() => { if (!editData || !isEdit) { return; } setTitle(editData == null ? void 0 : editData.name); setAnalysis(editData == null ? void 0 : editData.analysis); const answer = editData == null ? void 0 : editData.choices.find((item) => item.is_answer); setActiveAnswer(answer.choice_text === "\u6B63\u786E" ? "0" : "1"); }, [editData]); (0,_react_17_0_2_react.useImperativeHandle)(ref, () => ({ onSave, Clear })); const onSave = () => { if (!title) { es_message/* default */.ZP.info("\u8BF7\u60A8\u8F93\u5165\u9898\u5E72"); return false; } if (!activeAnswer) { es_message/* default */.ZP.info("\u8BF7\u5148\u70B9\u51FB\u9009\u62E9\u672C\u9009\u62E9\u9898\u7684\u6B63\u786E\u9009\u9879"); return false; } const choices = [ { choice_text: "\u6B63\u786E", is_answer: activeAnswer === "0" ? 1 : 0 }, { choice_text: "\u9519\u8BEF", is_answer: activeAnswer === "1" ? 1 : 0 } ]; return { name: title, choices, analysis }; }; const Clear = () => { setTitle(""); setAnalysis(""); setActiveAnswer(""); }; return /* @__PURE__ */ _react_17_0_2_react.createElement("section", { className: editormodules.wrap }, /* @__PURE__ */ _react_17_0_2_react.createElement("p", { className: editormodules.titleWrap }, /* @__PURE__ */ _react_17_0_2_react.createElement("span", { className: editormodules.required }, "*"), /* @__PURE__ */ _react_17_0_2_react.createElement("span", { className: editormodules.title }, "\u9898\u5E72\uFF1A")), /* @__PURE__ */ _react_17_0_2_react.createElement( markdown_editor/* default */.Z, { id: "single-question-title", watch: true, height: 155, placeholder: "\u8BF7\u60A8\u8F93\u5165\u9898\u5E72", defaultValue: title, onChange: (value) => setTitle(value) } ), /* @__PURE__ */ _react_17_0_2_react.createElement("p", { className: editormodules.titleWrap }, /* @__PURE__ */ _react_17_0_2_react.createElement("span", { className: editormodules.required }, "*"), /* @__PURE__ */ _react_17_0_2_react.createElement("span", { className: editormodules.title }, "\u7B54\u6848\u9009\u9879\uFF1A", /* @__PURE__ */ _react_17_0_2_react.createElement("span", { className: editormodules.colorGray }, "\u70B9\u51FB\u9009\u9879\u53EF\u8BBE\u7F6E\u6B63\u786E\u7B54\u6848"))), /* @__PURE__ */ _react_17_0_2_react.createElement(es_radio/* default.Group */.ZP.Group, { buttonStyle: "solid", value: activeAnswer, onChange: (e) => setActiveAnswer(e.target.value) }, /* @__PURE__ */ _react_17_0_2_react.createElement(es_radio/* default.Button */.ZP.Button, { value: "0", className: `${editormodules.radio} mr40` }, "\u6B63\u786E"), /* @__PURE__ */ _react_17_0_2_react.createElement(es_radio/* default.Button */.ZP.Button, { value: "1", className: editormodules.radio }, "\u9519\u8BEF")), /* @__PURE__ */ _react_17_0_2_react.createElement("p", { className: editormodules.titleWrap }, /* @__PURE__ */ _react_17_0_2_react.createElement("span", { className: editormodules.title }, "\u9898\u76EE\u89E3\u6790\uFF1A")), /* @__PURE__ */ _react_17_0_2_react.createElement( markdown_editor/* default */.Z, { id: "single-question-answer", watch: true, height: 155, placeholder: "\u8BF7\u60A8\u8F93\u5165\u9898\u76EE\u89E3\u6790", defaultValue: analysis, onChange: (value) => setAnalysis(value) } )); }; /* harmony default export */ var components_JudgmentEditor = ((0,_umi_production_exports.connect)( ({ loading, globalSetting }) => ({ globalSetting, loading: loading.effects }), null, null, { forwardRef: true } )((0,_react_17_0_2_react.forwardRef)(JudgmentEditor))); ;// CONCATENATED MODULE: ./src/pages/Paperlibrary/Random/AddAndEdit/components/StepPreview/components/ShixunEditor/index.tsx var ShixunEditor_getOwnPropSymbols = Object.getOwnPropertySymbols; var ShixunEditor_hasOwnProp = Object.prototype.hasOwnProperty; var ShixunEditor_propIsEnum = Object.prototype.propertyIsEnumerable; var ShixunEditor_objRest = (source, exclude) => { var target = {}; for (var prop in source) if (ShixunEditor_hasOwnProp.call(source, prop) && exclude.indexOf(prop) < 0) target[prop] = source[prop]; if (source != null && ShixunEditor_getOwnPropSymbols) for (var prop of ShixunEditor_getOwnPropSymbols(source)) { if (exclude.indexOf(prop) < 0 && ShixunEditor_propIsEnum.call(source, prop)) target[prop] = source[prop]; } return target; }; const ShixunEditor_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" ])); const ShixunEditor = (_a, ref) => { var _b = _a, { globalSetting, loading, editData, dispatch, onRef = () => { }, isEdit } = _b, props = ShixunEditor_objRest(_b, [ "globalSetting", "loading", "editData", "dispatch", "onRef", "isEdit" ]); const [scores, setScores] = (0,_react_17_0_2_react.useState)([]); (0,_react_17_0_2_react.useEffect)(() => { var _a2; if (!editData || !isEdit) { return; } const temp = (_a2 = editData == null ? void 0 : editData.shixun) == null ? void 0 : _a2.challenges.map((item) => { return { id: item == null ? void 0 : item.id, score: item.score }; }); setScores(temp); }, [editData]); (0,_react_17_0_2_react.useImperativeHandle)(ref, () => ({ onSave, Clear })); const onSave = () => { return { challenges: [...scores] }; }; const Clear = () => { setScores([]); }; console.log("editData--", editData); const renderPractical = (items) => { var _a2, _b2; return /* @__PURE__ */ _react_17_0_2_react.createElement("div", null, (_b2 = (_a2 = items == null ? void 0 : items.shixun) == null ? void 0 : _a2.challenges) == null ? void 0 : _b2.map((item, index) => { var _a3; return /* @__PURE__ */ _react_17_0_2_react.createElement("div", { className: "c-grey-666 font14 ml25", style: { display: "flex", alignItems: "center", justifyContent: "space-between", marginBottom: "15px" } }, /* @__PURE__ */ _react_17_0_2_react.createElement("div", null, /* @__PURE__ */ _react_17_0_2_react.createElement("span", { className: "mr5" }, "\u7B2C", index + 1, "\u5173"), /* @__PURE__ */ _react_17_0_2_react.createElement(tooltip/* default */.Z, { key: index, title: item == null ? void 0 : item.challenge_name }, /* @__PURE__ */ _react_17_0_2_react.createElement("span", null, (0,util/* cutName */.Pq)(item == null ? void 0 : item.challenge_name, 44)))), /* @__PURE__ */ _react_17_0_2_react.createElement("p", { style: { marginBottom: 0 } }, /* @__PURE__ */ _react_17_0_2_react.createElement("span", { className: editormodules.required }, "*"), /* @__PURE__ */ _react_17_0_2_react.createElement("span", { className: editormodules.title }, "\u5206\u503C\uFF1A"), /* @__PURE__ */ _react_17_0_2_react.createElement( input_number/* default */.Z, { precision: 1, min: 1, max: 100, className: editormodules.baseFormItem, style: { width: 176 }, value: (_a3 = scores.find((sitem) => sitem.id === item.id)) == null ? void 0 : _a3.score, onChange: (value) => { scores.find((sitem) => sitem.id === item.id).score = value; setScores([...scores]); } } ))); }), /* @__PURE__ */ _react_17_0_2_react.createElement("div", { style: { clear: "both" } })); }; return /* @__PURE__ */ _react_17_0_2_react.createElement("section", { className: editormodules.wrap }, /* @__PURE__ */ _react_17_0_2_react.createElement(RenderHtml/* default */.Z, { style: { paddingRight: 10 }, className: editormodules.titleHtml, value: `${editData == null ? void 0 : editData.position}\u3001${editData == null ? void 0 : editData.name}` }), /* @__PURE__ */ _react_17_0_2_react.createElement("p", { style: { marginBottom: "10px", marginTop: "25px" } }, /* @__PURE__ */ _react_17_0_2_react.createElement("span", { className: editormodules.required }, "*"), /* @__PURE__ */ _react_17_0_2_react.createElement("span", { className: editormodules.title }, "\u5173\u5361")), renderPractical(editData)); }; /* harmony default export */ var components_ShixunEditor = ((0,_umi_production_exports.connect)( ({ loading, globalSetting }) => ({ globalSetting, loading: loading.effects }), null, null, { forwardRef: true } )((0,_react_17_0_2_react.forwardRef)(ShixunEditor))); ;// CONCATENATED MODULE: ./src/pages/Paperlibrary/Random/AddAndEdit/components/StepPreview/components/MultipleEditor/index.tsx var MultipleEditor_getOwnPropSymbols = Object.getOwnPropertySymbols; var MultipleEditor_hasOwnProp = Object.prototype.hasOwnProperty; var MultipleEditor_propIsEnum = Object.prototype.propertyIsEnumerable; var MultipleEditor_objRest = (source, exclude) => { var target = {}; for (var prop in source) if (MultipleEditor_hasOwnProp.call(source, prop) && exclude.indexOf(prop) < 0) target[prop] = source[prop]; if (source != null && MultipleEditor_getOwnPropSymbols) for (var prop of MultipleEditor_getOwnPropSymbols(source)) { if (exclude.indexOf(prop) < 0 && MultipleEditor_propIsEnum.call(source, prop)) target[prop] = source[prop]; } return target; }; const 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" ]; const MultipleEditor = (_a, ref) => { var _b = _a, { editData, globalSetting, loading, dispatch, onRef = () => { }, isEdit } = _b, props = MultipleEditor_objRest(_b, [ "editData", "globalSetting", "loading", "dispatch", "onRef", "isEdit" ]); const [questionChoiceList, setQuestionChoiceList] = (0,_react_17_0_2_react.useState)([]); const [activeEditor, setActiveEditor] = (0,_react_17_0_2_react.useState)(); const [activeAnswer, setActiveAnswer] = (0,_react_17_0_2_react.useState)([]); const [title, setTitle] = (0,_react_17_0_2_react.useState)(""); const [analysis, setAnalysis] = (0,_react_17_0_2_react.useState)(""); (0,_react_17_0_2_react.useEffect)(() => { setQuestionChoiceList(["", "", "", ""]); }, []); (0,_react_17_0_2_react.useEffect)(() => { if (!editData || !isEdit) { return; } setTitle(editData == null ? void 0 : editData.name); setAnalysis(editData == null ? void 0 : editData.analysis); setQuestionChoiceList(editData == null ? void 0 : editData.choices.map((item) => item.choice_text)); const answerIndexs = []; editData == null ? void 0 : editData.choices.map((item, index) => { if (item.is_answer) { answerIndexs.push(index); } }); setActiveAnswer(answerIndexs); }, [editData]); (0,_react_17_0_2_react.useImperativeHandle)(ref, () => ({ onSave, Clear })); const onSave = () => { if (!title) { es_message/* default */.ZP.info("\u8BF7\u60A8\u8F93\u5165\u9898\u5E72"); return false; } const findNotAnswerIndex = questionChoiceList.findIndex((item) => !item); if (findNotAnswerIndex > -1) { es_message/* default */.ZP.info(`\u8BF7\u5148\u8F93\u5165 ${MultipleEditor_tagList[findNotAnswerIndex]} \u9009\u9879\u7684\u5185\u5BB9`); return false; } if (!activeAnswer.length) { es_message/* default */.ZP.info("\u8BF7\u8BBE\u7F6E\u672C\u9898\u7684\u6B63\u786E\u7B54\u6848\uFF0C\u70B9\u51FB\u9009\u9879A/B...\u5373\u53EF\u5B8C\u6210\u8BBE\u7F6E"); return false; } if (activeAnswer.length < 2) { es_message/* default */.ZP.info("\u591A\u9009\u9898\u6700\u5C0F\u6B63\u786E\u9009\u9879\u4E3A2\u4E2A"); return false; } const choices = questionChoiceList.map((item, index) => { return { choice_text: item, is_answer: activeAnswer.includes(index) ? 1 : 0 }; }); return { name: title, choices, analysis }; }; const Clear = () => { setQuestionChoiceList(["", "", "", ""]); setTitle(""); setAnalysis(""); setActiveAnswer(""); }; return /* @__PURE__ */ _react_17_0_2_react.createElement("section", { className: editormodules.wrap }, /* @__PURE__ */ _react_17_0_2_react.createElement("p", { className: editormodules.titleWrap }, /* @__PURE__ */ _react_17_0_2_react.createElement("span", { className: editormodules.required }, "*"), /* @__PURE__ */ _react_17_0_2_react.createElement("span", { className: editormodules.title }, "\u9898\u5E72\uFF1A")), /* @__PURE__ */ _react_17_0_2_react.createElement( markdown_editor/* default */.Z, { id: "single-question-title", watch: true, height: 155, placeholder: "\u8BF7\u60A8\u8F93\u5165\u9898\u5E72", defaultValue: title, onChange: (value) => setTitle(value) } ), /* @__PURE__ */ _react_17_0_2_react.createElement("p", { className: editormodules.titleWrap }, /* @__PURE__ */ _react_17_0_2_react.createElement("span", { className: editormodules.required }, "*"), /* @__PURE__ */ _react_17_0_2_react.createElement("span", { className: editormodules.title }, "\u7B54\u6848\u9009\u9879\uFF1A", /* @__PURE__ */ _react_17_0_2_react.createElement("span", { className: editormodules.colorGray }, "\u70B9\u51FB\u9009\u9879\u53EF\u8BBE\u7F6E\u6B63\u786E\u7B54\u6848"))), questionChoiceList.map((item, index) => { return /* @__PURE__ */ _react_17_0_2_react.createElement("div", { className: editormodules.choiceWrap, key: index }, /* @__PURE__ */ _react_17_0_2_react.createElement(tooltip/* default */.Z, { title: "\u70B9\u51FB\u8BBE\u7F6E\u4E3A\u6807\u51C6\u7B54\u6848", placement: "left" }, /* @__PURE__ */ _react_17_0_2_react.createElement( "div", { className: `${editormodules.answer} ${activeAnswer.includes(index) ? editormodules.activeAnswer : ""}`, onClick: () => { if (activeAnswer.includes(index)) { setActiveAnswer(activeAnswer.filter((item2) => item2 !== index)); } else { setActiveAnswer([...activeAnswer, index]); } } }, MultipleEditor_tagList[index] )), /* @__PURE__ */ _react_17_0_2_react.createElement("div", { className: editormodules.editorWrap }, activeEditor === index ? /* @__PURE__ */ _react_17_0_2_react.createElement( markdown_editor/* default */.Z, { id: `single-question-option-${index}`, watch: true, height: 155, placeholder: "\u8BF7\u60A8\u8F93\u5165\u9009\u9879", defaultValue: item, onChange: (value) => { questionChoiceList[index] = value; setQuestionChoiceList(questionChoiceList); } } ) : /* @__PURE__ */ _react_17_0_2_react.createElement("div", { className: editormodules.htmlWrap, onClick: () => setActiveEditor(index) }, /* @__PURE__ */ _react_17_0_2_react.createElement(RenderHtml/* default */.Z, { value: item }))), index > 1 && /* @__PURE__ */ _react_17_0_2_react.createElement(tooltip/* default */.Z, { title: "\u5220\u9664" }, /* @__PURE__ */ _react_17_0_2_react.createElement( "i", { className: `${editormodules.deleteIcon} iconfont icon-htmal5icon19`, onClick: () => { setQuestionChoiceList(questionChoiceList.filter((_, key) => key !== index)); if (activeAnswer.includes(index)) { setActiveAnswer(activeAnswer.filter((item2) => item2 !== index)); } else { setActiveAnswer([...activeAnswer, index]); } } } )), index < 7 && index === questionChoiceList.length - 1 && /* @__PURE__ */ _react_17_0_2_react.createElement(tooltip/* default */.Z, { title: "\u65B0\u589E\u53C2\u8003\u7B54\u6848" }, /* @__PURE__ */ _react_17_0_2_react.createElement( "i", { className: `${editormodules.addIcon} iconfont icon-roundaddfill ml6`, onClick: () => setQuestionChoiceList([...questionChoiceList, ""]) } ))); }), /* @__PURE__ */ _react_17_0_2_react.createElement("p", { className: editormodules.titleWrap }, /* @__PURE__ */ _react_17_0_2_react.createElement("span", { className: editormodules.title }, "\u9898\u76EE\u89E3\u6790\uFF1A")), /* @__PURE__ */ _react_17_0_2_react.createElement( markdown_editor/* default */.Z, { id: "single-question-answer", watch: true, height: 155, placeholder: "\u8BF7\u60A8\u8F93\u5165\u9898\u76EE\u89E3\u6790", defaultValue: analysis, onChange: (value) => setAnalysis(value) } )); }; /* harmony default export */ var components_MultipleEditor = ((0,_umi_production_exports.connect)( ({ loading, globalSetting }) => ({ globalSetting, loading: loading.effects }), null, null, { forwardRef: true } )((0,_react_17_0_2_react.forwardRef)(MultipleEditor))); ;// CONCATENATED MODULE: ./src/pages/Paperlibrary/Random/AddAndEdit/components/StepPreview/components/SingleEditor/index.tsx var SingleEditor_getOwnPropSymbols = Object.getOwnPropertySymbols; var SingleEditor_hasOwnProp = Object.prototype.hasOwnProperty; var SingleEditor_propIsEnum = Object.prototype.propertyIsEnumerable; var SingleEditor_objRest = (source, exclude) => { var target = {}; for (var prop in source) if (SingleEditor_hasOwnProp.call(source, prop) && exclude.indexOf(prop) < 0) target[prop] = source[prop]; if (source != null && SingleEditor_getOwnPropSymbols) for (var prop of SingleEditor_getOwnPropSymbols(source)) { if (exclude.indexOf(prop) < 0 && SingleEditor_propIsEnum.call(source, prop)) target[prop] = source[prop]; } return target; }; const 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" ]; const SingleEditor = (_a, ref) => { var _b = _a, { editData, globalSetting, loading, dispatch, onRef = () => { }, isEdit } = _b, props = SingleEditor_objRest(_b, [ "editData", "globalSetting", "loading", "dispatch", "onRef", "isEdit" ]); const [questionChoiceList, setQuestionChoiceList] = (0,_react_17_0_2_react.useState)([]); const [activeEditor, setActiveEditor] = (0,_react_17_0_2_react.useState)(); const [activeAnswer, setActiveAnswer] = (0,_react_17_0_2_react.useState)(); const [title, setTitle] = (0,_react_17_0_2_react.useState)(""); const [analysis, setAnalysis] = (0,_react_17_0_2_react.useState)(""); (0,_react_17_0_2_react.useEffect)(() => { setQuestionChoiceList(["", "", "", ""]); }, []); (0,_react_17_0_2_react.useEffect)(() => { if (!editData || !isEdit) { return; } setTitle(editData == null ? void 0 : editData.name); setAnalysis(editData == null ? void 0 : editData.analysis); setQuestionChoiceList(editData == null ? void 0 : editData.choices.map((item) => item.choice_text)); setActiveAnswer(editData == null ? void 0 : editData.choices.findIndex((item) => item.is_answer)); }, [editData]); (0,_react_17_0_2_react.useImperativeHandle)(ref, () => ({ onSave, Clear })); const onSave = () => { if (!title) { es_message/* default */.ZP.info("\u8BF7\u60A8\u8F93\u5165\u9898\u5E72"); return false; } const findNotAnswerIndex = questionChoiceList.findIndex((item) => !item); if (findNotAnswerIndex > -1) { es_message/* default */.ZP.info(`\u8BF7\u5148\u8F93\u5165 ${SingleEditor_tagList[findNotAnswerIndex]} \u9009\u9879\u7684\u5185\u5BB9`); return false; } console.log("activeAnswer: ", activeAnswer); if (!(typeof activeAnswer === "number")) { es_message/* default */.ZP.info("\u8BF7\u8BBE\u7F6E\u672C\u9898\u7684\u6B63\u786E\u7B54\u6848\uFF0C\u70B9\u51FB\u9009\u9879A/B...\u5373\u53EF\u5B8C\u6210\u8BBE\u7F6E"); return false; } const choices = questionChoiceList.map((item, index) => { return { choice_text: item, is_answer: activeAnswer === index ? 1 : 0 }; }); return { name: title, choices, analysis }; }; const Clear = () => { setQuestionChoiceList(["", "", "", ""]); setTitle(""); setAnalysis(""); setActiveAnswer(""); }; return /* @__PURE__ */ _react_17_0_2_react.createElement("section", { className: editormodules.wrap }, /* @__PURE__ */ _react_17_0_2_react.createElement("p", { className: editormodules.titleWrap }, /* @__PURE__ */ _react_17_0_2_react.createElement("span", { className: editormodules.required }, "*"), /* @__PURE__ */ _react_17_0_2_react.createElement("span", { className: editormodules.title }, "\u9898\u5E72\uFF1A")), /* @__PURE__ */ _react_17_0_2_react.createElement( markdown_editor/* default */.Z, { id: "single-question-title", watch: true, height: 155, placeholder: "\u8BF7\u60A8\u8F93\u5165\u9898\u5E72", defaultValue: title, onChange: (value) => setTitle(value) } ), /* @__PURE__ */ _react_17_0_2_react.createElement("p", { className: editormodules.titleWrap }, /* @__PURE__ */ _react_17_0_2_react.createElement("span", { className: editormodules.required }, "*"), /* @__PURE__ */ _react_17_0_2_react.createElement("span", { className: editormodules.title }, "\u7B54\u6848\u9009\u9879\uFF1A", /* @__PURE__ */ _react_17_0_2_react.createElement("span", { className: editormodules.colorGray }, "\u70B9\u51FB\u9009\u9879\u53EF\u8BBE\u7F6E\u6B63\u786E\u7B54\u6848"))), questionChoiceList.map((item, index) => { return /* @__PURE__ */ _react_17_0_2_react.createElement("div", { className: editormodules.choiceWrap, key: index }, /* @__PURE__ */ _react_17_0_2_react.createElement(tooltip/* default */.Z, { title: "\u70B9\u51FB\u8BBE\u7F6E\u4E3A\u6807\u51C6\u7B54\u6848", placement: "left" }, /* @__PURE__ */ _react_17_0_2_react.createElement( "div", { className: `${editormodules.answer} ${activeAnswer === index ? editormodules.activeAnswer : ""}`, onClick: () => setActiveAnswer(index) }, SingleEditor_tagList[index] )), /* @__PURE__ */ _react_17_0_2_react.createElement("div", { className: editormodules.editorWrap }, activeEditor === index ? /* @__PURE__ */ _react_17_0_2_react.createElement( markdown_editor/* default */.Z, { id: `single-question-option-${index}`, watch: true, height: 155, isFocus: true, placeholder: "\u8BF7\u60A8\u8F93\u5165\u9009\u9879", defaultValue: item, onChange: (value) => { questionChoiceList[index] = value; setQuestionChoiceList(questionChoiceList); } } ) : /* @__PURE__ */ _react_17_0_2_react.createElement("div", { className: editormodules.htmlWrap, onClick: () => setActiveEditor(index) }, /* @__PURE__ */ _react_17_0_2_react.createElement(RenderHtml/* default */.Z, { value: item }))), index > 1 && /* @__PURE__ */ _react_17_0_2_react.createElement(tooltip/* default */.Z, { title: "\u5220\u9664" }, /* @__PURE__ */ _react_17_0_2_react.createElement( "i", { className: `${editormodules.deleteIcon} iconfont icon-htmal5icon19`, onClick: () => { setQuestionChoiceList(questionChoiceList.filter((_, key) => key !== index)); if (index === activeAnswer) { setActiveAnswer(null); } } } )), index < 7 && index === questionChoiceList.length - 1 && /* @__PURE__ */ _react_17_0_2_react.createElement(tooltip/* default */.Z, { title: "\u65B0\u589E\u53C2\u8003\u7B54\u6848" }, /* @__PURE__ */ _react_17_0_2_react.createElement( "i", { className: `${editormodules.addIcon} iconfont icon-roundaddfill ml6`, onClick: () => setQuestionChoiceList([...questionChoiceList, ""]) } ))); }), /* @__PURE__ */ _react_17_0_2_react.createElement("p", { className: editormodules.titleWrap }, /* @__PURE__ */ _react_17_0_2_react.createElement("span", { className: editormodules.title }, "\u9898\u76EE\u89E3\u6790\uFF1A")), /* @__PURE__ */ _react_17_0_2_react.createElement( markdown_editor/* default */.Z, { id: "single-question-answer", watch: true, height: 155, placeholder: "\u8BF7\u60A8\u8F93\u5165\u9898\u76EE\u89E3\u6790", defaultValue: analysis, onChange: (value) => setAnalysis(value) } )); }; /* harmony default export */ var components_SingleEditor = ((0,_umi_production_exports.connect)( ({ loading, globalSetting }) => ({ globalSetting, loading: loading.effects }), null, null, { forwardRef: true } )((0,_react_17_0_2_react.forwardRef)(SingleEditor))); ;// CONCATENATED MODULE: ./src/pages/Paperlibrary/Random/AddAndEdit/components/StepPreview/components/SubjectiveEditor/index.tsx var SubjectiveEditor_getOwnPropSymbols = Object.getOwnPropertySymbols; var SubjectiveEditor_hasOwnProp = Object.prototype.hasOwnProperty; var SubjectiveEditor_propIsEnum = Object.prototype.propertyIsEnumerable; var SubjectiveEditor_objRest = (source, exclude) => { var target = {}; for (var prop in source) if (SubjectiveEditor_hasOwnProp.call(source, prop) && exclude.indexOf(prop) < 0) target[prop] = source[prop]; if (source != null && SubjectiveEditor_getOwnPropSymbols) for (var prop of SubjectiveEditor_getOwnPropSymbols(source)) { if (exclude.indexOf(prop) < 0 && SubjectiveEditor_propIsEnum.call(source, prop)) target[prop] = source[prop]; } return target; }; const 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" ])); const SubjectiveEditor = (_a, ref) => { var _b = _a, { editData, globalSetting, loading, dispatch, onRef = () => { }, isEdit } = _b, props = SubjectiveEditor_objRest(_b, [ "editData", "globalSetting", "loading", "dispatch", "onRef", "isEdit" ]); const [title, setTitle] = (0,_react_17_0_2_react.useState)(""); const [analysis, setAnalysis] = (0,_react_17_0_2_react.useState)(""); const [answer, setAnswer] = (0,_react_17_0_2_react.useState)(""); (0,_react_17_0_2_react.useEffect)(() => { var _a2; if (!editData || !isEdit) { return; } setTitle(editData == null ? void 0 : editData.name); setAnalysis(editData == null ? void 0 : editData.analysis); setAnswer((_a2 = editData == null ? void 0 : editData.answer_texts) == null ? void 0 : _a2[0]); }, [editData]); (0,_react_17_0_2_react.useImperativeHandle)(ref, () => ({ onSave, Clear })); const onSave = () => { if (!title) { es_message/* default */.ZP.info("\u8BF7\u60A8\u8F93\u5165\u9898\u5E72"); return false; } if (!answer) { es_message/* default */.ZP.info("\u8BF7\u60A8\u8F93\u5165\u53C2\u8003\u7B54\u6848"); return false; } return { name: title, answer_texts: [answer], analysis }; }; const Clear = () => { setTitle(""); setAnalysis(""); setAnswer(""); }; return /* @__PURE__ */ _react_17_0_2_react.createElement("section", { className: editormodules.wrap }, /* @__PURE__ */ _react_17_0_2_react.createElement("p", { className: editormodules.titleWrap }, /* @__PURE__ */ _react_17_0_2_react.createElement("span", { className: editormodules.required }, "*"), /* @__PURE__ */ _react_17_0_2_react.createElement("span", { className: editormodules.title }, "\u9898\u5E72\uFF1A")), /* @__PURE__ */ _react_17_0_2_react.createElement( markdown_editor/* default */.Z, { id: "single-question-title", watch: true, height: 155, placeholder: "\u8BF7\u60A8\u8F93\u5165\u9898\u5E72", defaultValue: title, onChange: (value) => setTitle(value) } ), /* @__PURE__ */ _react_17_0_2_react.createElement("p", { className: editormodules.titleWrap }, /* @__PURE__ */ _react_17_0_2_react.createElement("span", { className: editormodules.title }, "\u53C2\u8003\u7B54\u6848\uFF1A")), /* @__PURE__ */ _react_17_0_2_react.createElement( 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: (value) => setAnswer(value) } ), /* @__PURE__ */ _react_17_0_2_react.createElement("p", { className: editormodules.titleWrap }, /* @__PURE__ */ _react_17_0_2_react.createElement("span", { className: editormodules.title }, "\u9898\u76EE\u89E3\u6790\uFF1A")), /* @__PURE__ */ _react_17_0_2_react.createElement( markdown_editor/* default */.Z, { id: "single-question-answer", watch: true, height: 155, placeholder: "\u8BF7\u60A8\u8F93\u5165\u9898\u76EE\u89E3\u6790", defaultValue: analysis, onChange: (value) => setAnalysis(value) } )); }; /* harmony default export */ var components_SubjectiveEditor = ((0,_umi_production_exports.connect)( ({ loading, globalSetting }) => ({ globalSetting, loading: loading.effects }), null, null, { forwardRef: true } )((0,_react_17_0_2_react.forwardRef)(SubjectiveEditor))); // EXTERNAL MODULE: ./node_modules/_antd@5.9.0@antd/es/collapse/index.js + 8 modules var collapse = __webpack_require__(36381); // EXTERNAL MODULE: ./node_modules/_antd@5.9.0@antd/es/col/index.js var col = __webpack_require__(43604); ;// CONCATENATED MODULE: ./src/pages/Paperlibrary/Random/AddAndEdit/components/StepPreview/components/CombinationEditor/CombinationEdit/index.less?modules // extracted by mini-css-extract-plugin /* harmony default export */ var CombinationEditmodules = ({"wrap":"wrap___Cc0gS","deleteIcon":"deleteIcon___ebwMv","keywordTag":"keywordTag___lUfL5","questionTitleEditorWrap":"questionTitleEditorWrap___u9UgK","choiceWrap":"choiceWrap___VHsr3","choiceIndex":"choiceIndex___rsj9r","judgementIndex":"judgementIndex___fMm6E","setAnswerBtn":"setAnswerBtn___krVC9","activeAnswer":"activeAnswer___WiYo2","activeJudgementAnswer":"activeJudgementAnswer___M6iww","actionWrapper":"actionWrapper___oKI8_","addIcon":"addIcon___eMbGP","inputBorder":"inputBorder___ob_6x","placeholder":"placeholder___Vkwr4","blankWrapper":"blankWrapper____MZQ5","blankInput":"blankInput___ephwY","blankInputNumberWrapper":"blankInputNumberWrapper___C1UJS","addBtn":"addBtn___qRBpJ","blankIndex":"blankIndex___QsKgf","baseInputWrapper":"baseInputWrapper___juqCB","collapseWrapper":"collapseWrapper___kAXJ0","panelHeader":"panelHeader___hLTSe","open":"open___wWDjf","close":"close___XPTJ0","hide":"hide___VytUy"}); // EXTERNAL MODULE: ./node_modules/_@ant-design_icons@5.3.7@@ant-design/icons/es/icons/PlusCircleOutlined.js + 1 modules var PlusCircleOutlined = __webpack_require__(57703); // EXTERNAL MODULE: ./node_modules/_@ant-design_icons@5.3.7@@ant-design/icons/es/icons/MinusCircleOutlined.js + 1 modules var MinusCircleOutlined = __webpack_require__(78091); ;// CONCATENATED MODULE: ./src/pages/Paperlibrary/Random/AddAndEdit/components/StepPreview/components/CombinationEditor/CombinationEdit/MdEditorInForm.tsx var MdEditorInForm_defProp = Object.defineProperty; var MdEditorInForm_defProps = Object.defineProperties; var MdEditorInForm_getOwnPropDescs = Object.getOwnPropertyDescriptors; var MdEditorInForm_getOwnPropSymbols = Object.getOwnPropertySymbols; var MdEditorInForm_hasOwnProp = Object.prototype.hasOwnProperty; var MdEditorInForm_propIsEnum = Object.prototype.propertyIsEnumerable; var MdEditorInForm_defNormalProp = (obj, key, value) => key in obj ? MdEditorInForm_defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value; var MdEditorInForm_spreadValues = (a, b) => { for (var prop in b || (b = {})) if (MdEditorInForm_hasOwnProp.call(b, prop)) MdEditorInForm_defNormalProp(a, prop, b[prop]); if (MdEditorInForm_getOwnPropSymbols) for (var prop of MdEditorInForm_getOwnPropSymbols(b)) { if (MdEditorInForm_propIsEnum.call(b, prop)) MdEditorInForm_defNormalProp(a, prop, b[prop]); } return a; }; var MdEditorInForm_spreadProps = (a, b) => MdEditorInForm_defProps(a, MdEditorInForm_getOwnPropDescs(b)); var MdEditorInForm_objRest = (source, exclude) => { var target = {}; for (var prop in source) if (MdEditorInForm_hasOwnProp.call(source, prop) && exclude.indexOf(prop) < 0) target[prop] = source[prop]; if (source != null && MdEditorInForm_getOwnPropSymbols) for (var prop of MdEditorInForm_getOwnPropSymbols(source)) { if (exclude.indexOf(prop) < 0 && MdEditorInForm_propIsEnum.call(source, prop)) target[prop] = source[prop]; } return target; }; const MdEditorInForm = (_a) => { var _b = _a, { value, onChange, scrollId } = _b, props = MdEditorInForm_objRest(_b, ["value", "onChange", "scrollId"]); return /* @__PURE__ */ _react_17_0_2_react.createElement("div", { id: scrollId || "" }, /* @__PURE__ */ _react_17_0_2_react.createElement( markdown_editor/* default */.Z, MdEditorInForm_spreadProps(MdEditorInForm_spreadValues({}, props), { defaultValue: value, onChange: (a, b) => { if (!!(b == null ? void 0 : b.length)) onChange(a, b); else onChange(a); } }) )); }; const RegularInput = ({ value, onChange, placeholder, height = 140, isEdit }) => { return isEdit ? /* @__PURE__ */ _react_17_0_2_react.createElement( markdown_editor/* default */.Z, { watch: true, isFocus: true, height, placeholder, defaultValue: value, onChange } ) : /* @__PURE__ */ _react_17_0_2_react.createElement("div", { style: { cursor: "pointer" } }, value ? /* @__PURE__ */ _react_17_0_2_react.createElement(RenderHtml/* default */.Z, { className: CombinationEditmodules.inputBorder, value }) : /* @__PURE__ */ _react_17_0_2_react.createElement("div", { className: `${CombinationEditmodules.inputBorder} ${CombinationEditmodules.placeholder}` }, placeholder)); }; ;// CONCATENATED MODULE: ./src/pages/Paperlibrary/Random/AddAndEdit/components/StepPreview/components/CombinationEditor/CombinationEdit/ChoiceQuestionEditor.tsx var ChoiceQuestionEditor_defProp = Object.defineProperty; var ChoiceQuestionEditor_defProps = Object.defineProperties; var ChoiceQuestionEditor_getOwnPropDescs = Object.getOwnPropertyDescriptors; var ChoiceQuestionEditor_getOwnPropSymbols = Object.getOwnPropertySymbols; var ChoiceQuestionEditor_hasOwnProp = Object.prototype.hasOwnProperty; var ChoiceQuestionEditor_propIsEnum = Object.prototype.propertyIsEnumerable; var ChoiceQuestionEditor_defNormalProp = (obj, key, value) => key in obj ? ChoiceQuestionEditor_defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value; var ChoiceQuestionEditor_spreadValues = (a, b) => { for (var prop in b || (b = {})) if (ChoiceQuestionEditor_hasOwnProp.call(b, prop)) ChoiceQuestionEditor_defNormalProp(a, prop, b[prop]); if (ChoiceQuestionEditor_getOwnPropSymbols) for (var prop of ChoiceQuestionEditor_getOwnPropSymbols(b)) { if (ChoiceQuestionEditor_propIsEnum.call(b, prop)) ChoiceQuestionEditor_defNormalProp(a, prop, b[prop]); } return a; }; var ChoiceQuestionEditor_spreadProps = (a, b) => ChoiceQuestionEditor_defProps(a, ChoiceQuestionEditor_getOwnPropDescs(b)); var ChoiceQuestionEditor_objRest = (source, exclude) => { var target = {}; for (var prop in source) if (ChoiceQuestionEditor_hasOwnProp.call(source, prop) && exclude.indexOf(prop) < 0) target[prop] = source[prop]; if (source != null && ChoiceQuestionEditor_getOwnPropSymbols) for (var prop of ChoiceQuestionEditor_getOwnPropSymbols(source)) { if (exclude.indexOf(prop) < 0 && ChoiceQuestionEditor_propIsEnum.call(source, prop)) target[prop] = source[prop]; } return target; }; const ChoiceQuestionEditor_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" ]; const ChoiceQuestionItem = ({ value, onChange, choiceTextKey, answerKey, index, isEdit, setInputActive, form, choiceOptionsPath, allowChangeMode, showAddIcon, addItem, deleteItem }) => { const isActiveAnswer = (value == null ? void 0 : value[answerKey]) === true; const setAllOptionsToFalse = () => { const options = form.getFieldValue(choiceOptionsPath); form.setFieldValue(choiceOptionsPath, options.map((item) => ChoiceQuestionEditor_spreadProps(ChoiceQuestionEditor_spreadValues({}, item), { [answerKey]: false }))); }; const setActiveAnswer = () => { if (isActiveAnswer) { onChange(ChoiceQuestionEditor_spreadProps(ChoiceQuestionEditor_spreadValues({}, value), { [answerKey]: false })); } else { if (!allowChangeMode) { setAllOptionsToFalse(); } onChange(ChoiceQuestionEditor_spreadProps(ChoiceQuestionEditor_spreadValues({}, value), { [answerKey]: true })); } }; return /* @__PURE__ */ _react_17_0_2_react.createElement(row/* default */.Z, { className: CombinationEditmodules.choiceWrap, align: "middle", wrap: false }, /* @__PURE__ */ _react_17_0_2_react.createElement(col/* default */.Z, { onClick: setActiveAnswer, className: `${CombinationEditmodules.choiceIndex} ${isActiveAnswer ? CombinationEditmodules.activeAnswer : ""}` }, ChoiceQuestionEditor_tagList[index]), /* @__PURE__ */ _react_17_0_2_react.createElement(col/* default */.Z, { flex: 1, className: `${CombinationEditmodules.editorWrap} ml15`, onClick: setInputActive }, /* @__PURE__ */ _react_17_0_2_react.createElement(RegularInput, { height: 155, placeholder: "\u8BF7\u60A8\u8F93\u5165\u9009\u9879", isEdit, value: value == null ? void 0 : value[choiceTextKey], onChange: (v) => { onChange(ChoiceQuestionEditor_spreadProps(ChoiceQuestionEditor_spreadValues({}, value), { [choiceTextKey]: v })); } })), /* @__PURE__ */ _react_17_0_2_react.createElement( col/* default */.Z, { flex: "0 0 auto", className: "ml15" }, /* @__PURE__ */ _react_17_0_2_react.createElement( "div", { onClick: setActiveAnswer, className: `${CombinationEditmodules.setAnswerBtn} ${isActiveAnswer ? CombinationEditmodules.activeAnswer : ""}` }, isActiveAnswer ? "\u6B63\u786E\u7B54\u6848" : "\u8BBE\u4E3A\u7B54\u6848" ) ), /* @__PURE__ */ _react_17_0_2_react.createElement(col/* default */.Z, { className: CombinationEditmodules.actionWrapper }, /* @__PURE__ */ _react_17_0_2_react.createElement(tooltip/* default */.Z, { title: "\u65B0\u589E\u53C2\u8003\u7B54\u6848" }, /* @__PURE__ */ _react_17_0_2_react.createElement( PlusCircleOutlined/* default */.Z, { className: CombinationEditmodules.addIcon, onClick: addItem, style: { visibility: showAddIcon ? "visible" : "hidden" } } )), /* @__PURE__ */ _react_17_0_2_react.createElement(tooltip/* default */.Z, { title: "\u5220\u9664" }, /* @__PURE__ */ _react_17_0_2_react.createElement( MinusCircleOutlined/* default */.Z, { className: CombinationEditmodules.deleteIcon, onClick: deleteItem, style: { visibility: index > 1 ? "visible" : "hidden" } } )))); }; const ChoiceQuestionEditor = ({ questionTitlePlaceholder, titleKey, choiceKey, analysisKey, choiceTextKey, answerKey, choiceOptionsPath, allowChangeMode = true, form, showAnalysis = true }) => { const [activeEditor, setActiveEditor] = (0,_react_17_0_2_react.useState)(); const [editAnalysis, setEditAnalysis] = (0,_react_17_0_2_react.useState)(false); return /* @__PURE__ */ _react_17_0_2_react.createElement("div", { className: CombinationEditmodules.wrap }, /* @__PURE__ */ _react_17_0_2_react.createElement("div", { className: CombinationEditmodules.questionTitleEditorWrap }, /* @__PURE__ */ _react_17_0_2_react.createElement(es_form["default"].Item, { label: "\u9898\u5E72", name: titleKey, labelCol: { span: 24 }, rules: [{ required: true }] }, /* @__PURE__ */ _react_17_0_2_react.createElement( MdEditorInForm, { scrollId: Array.isArray(titleKey) ? titleKey.join("_") : `${titleKey}`, watch: true, height: 140, placeholder: questionTitlePlaceholder } ))), /* @__PURE__ */ _react_17_0_2_react.createElement(es_form["default"].Item, { label: "\u7B54\u6848\u9009\u9879", required: true, labelCol: { span: 24 } }), /* @__PURE__ */ _react_17_0_2_react.createElement( es_form["default"].List, { name: choiceKey, rules: [{ validator(rule, values) { const hasAnswer = values.some((option) => option[answerKey] === 1); const emptyAnswerIndex = values.findIndex((option) => { var _a; return ((_a = option[choiceTextKey]) == null ? void 0 : _a.length) <= 0; }); if (emptyAnswerIndex !== -1) { return Promise.reject(new Error(`\u8BF7\u5148\u8F93\u5165${ChoiceQuestionEditor_tagList[emptyAnswerIndex]}\u9009\u9879\u7684\u5185\u5BB9`)); } if (!hasAnswer) { return Promise.reject(new Error("\u8BF7\u8BBE\u7F6E\u6B63\u786E\u7B54\u6848")); } return Promise.resolve(); } }] }, (fields, { add, remove }) => /* @__PURE__ */ _react_17_0_2_react.createElement("div", { id: Array.isArray(choiceOptionsPath) ? choiceOptionsPath.join("_") : `${choiceOptionsPath}` }, fields.map((_a, index) => { var _b = _a, { key, name } = _b, restField = ChoiceQuestionEditor_objRest(_b, ["key", "name"]); const isEdit = activeEditor === key; const setInputActive = () => { setActiveEditor(key); }; const showAddIcon = index < 7 && index === fields.length - 1; const addItem = () => add({ [choiceTextKey]: "", [answerKey]: 0 }); const deleteItem = () => remove(name); return /* @__PURE__ */ _react_17_0_2_react.createElement(es_form["default"].Item, ChoiceQuestionEditor_spreadProps(ChoiceQuestionEditor_spreadValues({}, restField), { key, name, noStyle: true }), /* @__PURE__ */ _react_17_0_2_react.createElement( ChoiceQuestionItem, { choiceTextKey, answerKey, index, isEdit, setInputActive, form, choiceOptionsPath, allowChangeMode, showAddIcon, addItem, deleteItem } )); }), fields.length < 8 && /* @__PURE__ */ _react_17_0_2_react.createElement("div", { className: `${CombinationEditmodules.addBtn} mb30`, onClick: () => add({ [choiceTextKey]: "", [answerKey]: 0 }) }, "\u6DFB\u52A0\u9009\u9879")) ), showAnalysis && /* @__PURE__ */ _react_17_0_2_react.createElement("div", { onClick: () => setEditAnalysis(true) }, /* @__PURE__ */ _react_17_0_2_react.createElement(es_form["default"].Item, { name: analysisKey, label: "\u9898\u76EE\u89E3\u6790", labelCol: { span: 24 } }, /* @__PURE__ */ _react_17_0_2_react.createElement(RegularInput, { placeholder: "\u8BF7\u7F16\u8F91\u9898\u76EE\u89E3\u6790\uFF08\u975E\u5FC5\u586B\uFF09", isEdit: editAnalysis })))); }; // EXTERNAL MODULE: ./node_modules/_antd@5.9.0@antd/es/switch/index.js + 2 modules var es_switch = __webpack_require__(78673); ;// CONCATENATED MODULE: ./src/pages/Paperlibrary/Random/AddAndEdit/components/StepPreview/components/CombinationEditor/CombinationEdit/CombinationCompletionQuestionEditor.tsx /* provided dependency */ var CombinationCompletionQuestionEditor_React = __webpack_require__(/*! react */ 59301); var CombinationCompletionQuestionEditor_defProp = Object.defineProperty; var CombinationCompletionQuestionEditor_defProps = Object.defineProperties; var CombinationCompletionQuestionEditor_getOwnPropDescs = Object.getOwnPropertyDescriptors; var CombinationCompletionQuestionEditor_getOwnPropSymbols = Object.getOwnPropertySymbols; var CombinationCompletionQuestionEditor_hasOwnProp = Object.prototype.hasOwnProperty; var CombinationCompletionQuestionEditor_propIsEnum = Object.prototype.propertyIsEnumerable; var CombinationCompletionQuestionEditor_defNormalProp = (obj, key, value) => key in obj ? CombinationCompletionQuestionEditor_defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value; var CombinationCompletionQuestionEditor_spreadValues = (a, b) => { for (var prop in b || (b = {})) if (CombinationCompletionQuestionEditor_hasOwnProp.call(b, prop)) CombinationCompletionQuestionEditor_defNormalProp(a, prop, b[prop]); if (CombinationCompletionQuestionEditor_getOwnPropSymbols) for (var prop of CombinationCompletionQuestionEditor_getOwnPropSymbols(b)) { if (CombinationCompletionQuestionEditor_propIsEnum.call(b, prop)) CombinationCompletionQuestionEditor_defNormalProp(a, prop, b[prop]); } return a; }; var CombinationCompletionQuestionEditor_spreadProps = (a, b) => CombinationCompletionQuestionEditor_defProps(a, CombinationCompletionQuestionEditor_getOwnPropDescs(b)); var CombinationCompletionQuestionEditor_objRest = (source, exclude) => { var target = {}; for (var prop in source) if (CombinationCompletionQuestionEditor_hasOwnProp.call(source, prop) && exclude.indexOf(prop) < 0) target[prop] = source[prop]; if (source != null && CombinationCompletionQuestionEditor_getOwnPropSymbols) for (var prop of CombinationCompletionQuestionEditor_getOwnPropSymbols(source)) { if (exclude.indexOf(prop) < 0 && CombinationCompletionQuestionEditor_propIsEnum.call(source, prop)) target[prop] = source[prop]; } return target; }; const BlankEditor = ({ value, onChange }) => { const handleDelete = (index) => { es_modal["default"].confirm({ centered: true, okText: "\u786E\u5B9A", cancelText: "\u53D6\u6D88", title: "\u63D0\u793A", content: "\u786E\u8BA4\u8981\u5220\u9664\u8FD9\u4E2A\u53C2\u8003\u7B54\u6848\u5417\uFF1F", className: CombinationEditmodules.modal, onOk: () => { const valueCopy = [...value]; valueCopy.splice(index, 1); onChange(valueCopy); } }); }; const handleAdd = () => { const valueCopy = [...value]; valueCopy.push(""); onChange(valueCopy); }; return /* @__PURE__ */ CombinationCompletionQuestionEditor_React.createElement(row/* default */.Z, { align: "middle", className: "ml20", gutter: [40, 20] }, value == null ? void 0 : value.map((v, index) => { return /* @__PURE__ */ CombinationCompletionQuestionEditor_React.createElement(col/* default */.Z, { key: `${v}_${index}`, className: CombinationEditmodules.blankWrapper }, /* @__PURE__ */ CombinationCompletionQuestionEditor_React.createElement( input["default"], { className: CombinationEditmodules.blankInput, defaultValue: v, maxLength: 1e3, onBlur: (e) => { const valueCopy = [...value]; const inputTrimValue = e.target.value.trim(); valueCopy[index] = inputTrimValue; onChange(valueCopy); } } ), /* @__PURE__ */ CombinationCompletionQuestionEditor_React.createElement(tooltip/* default */.Z, { title: "\u5220\u9664" }, /* @__PURE__ */ CombinationCompletionQuestionEditor_React.createElement( MinusCircleOutlined/* default */.Z, { className: CombinationEditmodules.deleteIcon, style: { marginLeft: 15, visibility: index > 0 ? "visible" : "hidden" }, onClick: () => handleDelete(index) } ))); }), /* @__PURE__ */ CombinationCompletionQuestionEditor_React.createElement(col/* default */.Z, null, /* @__PURE__ */ CombinationCompletionQuestionEditor_React.createElement("div", { className: `${CombinationEditmodules.addBtn}`, onClick: () => { handleAdd(); } }, "\u65B0\u589E\u7B54\u6848"))); }; const ReversedSwitch = ({ value = true, onChange }) => { return /* @__PURE__ */ CombinationCompletionQuestionEditor_React.createElement( es_switch/* default */.Z, { checked: !value, onChange: (checked) => { onChange(!checked); } } ); }; const NULL_CH = "\u2581"; const CompletionQuestionEditor = ({ questionTitlePlaceholder, form, name, scoreByBlank = false, answerKey, titleKey = "name", analysisKey = "analysis", isOrdered = "is_ordered" }) => { var _a, _b; const [editAnalysis, setEditAnalysis] = (0,_react_17_0_2_react.useState)(false); const getChCountBeforeCursor = (cm, cursor) => { const currentLine = cursor.line; let placeholderCountBefore = 0; for (let _line = 0; _line < currentLine; _line++) { placeholderCountBefore += cm.getLine(_line).split(NULL_CH).length - 1; } const currentLineStringBeforeCursor = cm.getLine(currentLine).substring(0, cursor.ch); placeholderCountBefore += currentLineStringBeforeCursor.split(NULL_CH).length - 1; return placeholderCountBefore; }; const onCMBeforeChange = (cm, change, addBlank2, removeBlank2) => { const rangeText = cm.getRange(change.from, change.to); let newBlankNum = 0; change.text.forEach((item) => { newBlankNum += item.split(NULL_CH).length - 1; }); if (change.origin === "setValue") { return; } if (rangeText && rangeText.indexOf(NULL_CH) !== -1) { const placeholderCountInRange = rangeText.split(NULL_CH).length - 1; const placeholderCountBefore = getChCountBeforeCursor( cm, change.from ); console.log( `\u5220\u9664${placeholderCountInRange}\u4E2A\uFF0C \u524D\u9762\u6709${placeholderCountBefore}\u4E2A\uFF0C\u65B0\u589E${newBlankNum}\u4E2A` ); if (placeholderCountInRange > 1) { const indexArray = Array.from({ length: placeholderCountInRange }, (item, index) => placeholderCountBefore + index); removeBlank2(indexArray); } else { removeBlank2(placeholderCountBefore); } } else if (newBlankNum > 0) { const placeholderCountBefore = getChCountBeforeCursor( cm, change.from ); console.log( `\u65B0\u589E${newBlankNum}\u4E2A\uFF0C\u4E4B\u524D\u6709${placeholderCountBefore}\u4E2A` ); addBlank2(newBlankNum, placeholderCountBefore); } }; const rewritePosition = () => { const preAnswerData = form.getFieldValue(["sub_item_banks", ...answerKey]); form.setFieldValue( ["sub_item_banks", ...answerKey], preAnswerData == null ? void 0 : preAnswerData.map((item, index) => CombinationCompletionQuestionEditor_spreadProps(CombinationCompletionQuestionEditor_spreadValues({}, item), { position: index + 1 })) ); }; const addFnRef = (0,_react_17_0_2_react.useRef)(); const addBlank = (addNum, insertIndex) => { for (let i = 0; i < addNum; i++) { addFnRef.current({ position: null, answer_text: [""] }, insertIndex + i); } rewritePosition(); }; const removeFnRef = (0,_react_17_0_2_react.useRef)(); const removeBlank = (deleteIndex) => { removeFnRef.current(deleteIndex); rewritePosition(); }; const standardAnswersValue = (_b = (_a = form.getFieldValue("sub_item_banks")) == null ? void 0 : _a[answerKey == null ? void 0 : answerKey[0]]) == null ? void 0 : _b[answerKey == null ? void 0 : answerKey[1]]; return /* @__PURE__ */ CombinationCompletionQuestionEditor_React.createElement("div", { className: CombinationEditmodules.wrap }, /* @__PURE__ */ CombinationCompletionQuestionEditor_React.createElement("div", { className: CombinationEditmodules.questionTitleEditorWrap }, /* @__PURE__ */ CombinationCompletionQuestionEditor_React.createElement(es_form["default"].Item, { label: "\u9898\u5E72", name: titleKey, labelCol: { span: 24 }, rules: [{ required: true }] }, /* @__PURE__ */ CombinationCompletionQuestionEditor_React.createElement( MdEditorInForm, { scrollId: "name", watch: true, height: 140, placeholder: questionTitlePlaceholder, showNullButton: true, onCMBeforeChange: (cm, change) => { onCMBeforeChange(cm, change, addBlank, removeBlank); } } ))), /* @__PURE__ */ CombinationCompletionQuestionEditor_React.createElement( es_form["default"].List, { name: answerKey, rules: [{ validator(rule, values) { if ((values == null ? void 0 : values.length) === 0) { return Promise.reject(new Error("\u7B54\u6848\u4E0D\u80FD\u4E3A\u7A7A")); } for (const item of values) { const { answer_text } = item || {}; if (answer_text == null ? void 0 : answer_text.some((text) => (text == null ? void 0 : text.length) === 0)) { return Promise.reject(new Error("\u586B\u7A7A\u9879\u7B54\u6848\u4E0D\u80FD\u4E3A\u7A7A")); } } return Promise.resolve(); } }] }, (fields, { add, remove }, { errors }) => { addFnRef.current = add; removeFnRef.current = remove; return /* @__PURE__ */ CombinationCompletionQuestionEditor_React.createElement(CombinationCompletionQuestionEditor_React.Fragment, null, /* @__PURE__ */ CombinationCompletionQuestionEditor_React.createElement(es_form["default"].Item, { label: "\u7B54\u6848\u9009\u9879", required: true, labelCol: { span: 24 } }), fields.map((_a2, index) => { var _b2 = _a2, { key, name: name2 } = _b2, restField = CombinationCompletionQuestionEditor_objRest(_b2, ["key", "name"]); return /* @__PURE__ */ CombinationCompletionQuestionEditor_React.createElement(row/* default */.Z, { className: `mb20`, key, align: "middle", wrap: false }, /* @__PURE__ */ CombinationCompletionQuestionEditor_React.createElement(col/* default */.Z, { flex: "0 0 auto", className: `${CombinationEditmodules.blankIndex}` }, "\u586B\u7A7A\u9879", index + 1), /* @__PURE__ */ CombinationCompletionQuestionEditor_React.createElement(col/* default */.Z, { flex: 1 }, /* @__PURE__ */ CombinationCompletionQuestionEditor_React.createElement(row/* default */.Z, { align: "top", justify: "space-between", wrap: false }, /* @__PURE__ */ CombinationCompletionQuestionEditor_React.createElement(col/* default */.Z, null, /* @__PURE__ */ CombinationCompletionQuestionEditor_React.createElement(es_form["default"].Item, CombinationCompletionQuestionEditor_spreadProps(CombinationCompletionQuestionEditor_spreadValues({}, restField), { name: [name2, "answer_text"], noStyle: true }), /* @__PURE__ */ CombinationCompletionQuestionEditor_React.createElement(BlankEditor, null)))), /* @__PURE__ */ CombinationCompletionQuestionEditor_React.createElement(es_form["default"].Item, CombinationCompletionQuestionEditor_spreadProps(CombinationCompletionQuestionEditor_spreadValues({}, restField), { name: [name2, "position"], noStyle: true }), /* @__PURE__ */ CombinationCompletionQuestionEditor_React.createElement(input["default"], { type: "hidden" })))); })); } ), /* @__PURE__ */ CombinationCompletionQuestionEditor_React.createElement(row/* default */.Z, { align: "middle" }, /* @__PURE__ */ CombinationCompletionQuestionEditor_React.createElement(es_form["default"].Item, { name: [name, "downcase"], valuePropName: "checked" }, /* @__PURE__ */ CombinationCompletionQuestionEditor_React.createElement(es_switch/* default */.Z, null)), /* @__PURE__ */ CombinationCompletionQuestionEditor_React.createElement(col/* default */.Z, { className: "ml10" }, "\u5224\u5206\u65F6\u5FFD\u7565\u7B54\u6848\u4E2D\u7684\u5B57\u6BCD\u5927\u5C0F\u5199")), /* @__PURE__ */ CombinationCompletionQuestionEditor_React.createElement(row/* default */.Z, { align: "middle" }, /* @__PURE__ */ CombinationCompletionQuestionEditor_React.createElement(es_form["default"].Item, { name: [name, "no_space"], valuePropName: "checked" }, /* @__PURE__ */ CombinationCompletionQuestionEditor_React.createElement(es_switch/* default */.Z, null)), /* @__PURE__ */ CombinationCompletionQuestionEditor_React.createElement(col/* default */.Z, { className: "ml10" }, "\u5224\u5206\u65F6\u5FFD\u7565\u7B54\u6848\u4E2D\u7684\u7A7A\u683C")), (standardAnswersValue == null ? void 0 : standardAnswersValue.length) > 1 && /* @__PURE__ */ CombinationCompletionQuestionEditor_React.createElement( row/* default */.Z, { align: "middle", className: (standardAnswersValue == null ? void 0 : standardAnswersValue.length) > 1 ? "mb30" : `${CombinationEditmodules.hide}` }, /* @__PURE__ */ CombinationCompletionQuestionEditor_React.createElement(es_form["default"].Item, { name: isOrdered }, /* @__PURE__ */ CombinationCompletionQuestionEditor_React.createElement(ReversedSwitch, null)), /* @__PURE__ */ CombinationCompletionQuestionEditor_React.createElement(col/* default */.Z, { className: "ml10" }, "\u5141\u8BB8\u5B66\u751F\u6BCF\u4E2A\u586B\u7A7A\u7684\u7B54\u6848\u4E0E\u6807\u51C6\u7B54\u6848\u7684\u987A\u5E8F\u4E0D\u4E00\u81F4") ), /* @__PURE__ */ CombinationCompletionQuestionEditor_React.createElement("div", { onClick: () => setEditAnalysis(true) }, /* @__PURE__ */ CombinationCompletionQuestionEditor_React.createElement(es_form["default"].Item, { name: analysisKey, label: "\u9898\u76EE\u89E3\u6790", labelCol: { span: 24 } }, /* @__PURE__ */ CombinationCompletionQuestionEditor_React.createElement(RegularInput, { placeholder: "\u8BF7\u7F16\u8F91\u9898\u76EE\u89E3\u6790\uFF08\u975E\u5FC5\u586B\uFF09", isEdit: editAnalysis })))); }; ;// CONCATENATED MODULE: ./src/pages/Paperlibrary/Random/AddAndEdit/components/StepPreview/components/CombinationEditor/CombinationEdit/CombinationJudgmentQuestionEditor.tsx var CombinationJudgmentQuestionEditor_defProp = Object.defineProperty; var CombinationJudgmentQuestionEditor_defProps = Object.defineProperties; var CombinationJudgmentQuestionEditor_getOwnPropDescs = Object.getOwnPropertyDescriptors; var CombinationJudgmentQuestionEditor_getOwnPropSymbols = Object.getOwnPropertySymbols; var CombinationJudgmentQuestionEditor_hasOwnProp = Object.prototype.hasOwnProperty; var CombinationJudgmentQuestionEditor_propIsEnum = Object.prototype.propertyIsEnumerable; var CombinationJudgmentQuestionEditor_defNormalProp = (obj, key, value) => key in obj ? CombinationJudgmentQuestionEditor_defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value; var CombinationJudgmentQuestionEditor_spreadValues = (a, b) => { for (var prop in b || (b = {})) if (CombinationJudgmentQuestionEditor_hasOwnProp.call(b, prop)) CombinationJudgmentQuestionEditor_defNormalProp(a, prop, b[prop]); if (CombinationJudgmentQuestionEditor_getOwnPropSymbols) for (var prop of CombinationJudgmentQuestionEditor_getOwnPropSymbols(b)) { if (CombinationJudgmentQuestionEditor_propIsEnum.call(b, prop)) CombinationJudgmentQuestionEditor_defNormalProp(a, prop, b[prop]); } return a; }; var CombinationJudgmentQuestionEditor_spreadProps = (a, b) => CombinationJudgmentQuestionEditor_defProps(a, CombinationJudgmentQuestionEditor_getOwnPropDescs(b)); var CombinationJudgmentQuestionEditor_objRest = (source, exclude) => { var target = {}; for (var prop in source) if (CombinationJudgmentQuestionEditor_hasOwnProp.call(source, prop) && exclude.indexOf(prop) < 0) target[prop] = source[prop]; if (source != null && CombinationJudgmentQuestionEditor_getOwnPropSymbols) for (var prop of CombinationJudgmentQuestionEditor_getOwnPropSymbols(source)) { if (exclude.indexOf(prop) < 0 && CombinationJudgmentQuestionEditor_propIsEnum.call(source, prop)) target[prop] = source[prop]; } return target; }; const tagMap = { ["\u6B63\u786E"]: "T", ["\u9519\u8BEF"]: "F" }; const JudgmentQuestionItem = ({ value, onChange, form, choiceKey }) => { const isActiveAnswer = (value == null ? void 0 : value.is_answer) === true; const judgementText = value == null ? void 0 : value.choice_text; const setActiveAnswer = () => { var _a; const formListValue = (_a = form == null ? void 0 : form.getFieldValue(["sub_item_banks", ...choiceKey])) == null ? void 0 : _a.map((choice) => ({ choice_text: choice == null ? void 0 : choice.choice_text, is_answer: false })); form == null ? void 0 : form.setFieldValue(["sub_item_banks", ...choiceKey], formListValue); onChange(CombinationJudgmentQuestionEditor_spreadProps(CombinationJudgmentQuestionEditor_spreadValues({}, value), { is_answer: true })); }; return /* @__PURE__ */ _react_17_0_2_react.createElement(row/* default */.Z, { className: CombinationEditmodules.choiceWrap, align: "middle", wrap: false }, /* @__PURE__ */ _react_17_0_2_react.createElement(col/* default */.Z, { onClick: setActiveAnswer, className: `${CombinationEditmodules.choiceIndex} ${CombinationEditmodules.judgementIndex} ${isActiveAnswer ? CombinationEditmodules.activeAnswer : ""}` }, tagMap[judgementText]), /* @__PURE__ */ _react_17_0_2_react.createElement(col/* default */.Z, { flex: 1, className: `${CombinationEditmodules.editorWrap} ml15` }, /* @__PURE__ */ _react_17_0_2_react.createElement("div", { className: `${CombinationEditmodules.inputBorder} ${CombinationEditmodules.placeholder} ${isActiveAnswer ? CombinationEditmodules.activeJudgementAnswer : ""}` }, judgementText)), /* @__PURE__ */ _react_17_0_2_react.createElement( col/* default */.Z, { flex: "0 0 auto", className: "ml15" }, /* @__PURE__ */ _react_17_0_2_react.createElement( "div", { onClick: setActiveAnswer, className: `${CombinationEditmodules.setAnswerBtn} ${isActiveAnswer ? CombinationEditmodules.activeAnswer : ""}` }, isActiveAnswer ? "\u6B63\u786E\u7B54\u6848" : "\u8BBE\u4E3A\u7B54\u6848" ) )); }; const JudgmentQuestionEditor = ({ questionTitlePlaceholder, choiceKey = "choices", form, titleKey = "name", analysisKey = "analysis" }) => { const [editAnalysis, setEditAnalysis] = (0,_react_17_0_2_react.useState)(false); return /* @__PURE__ */ _react_17_0_2_react.createElement("div", { className: CombinationEditmodules.wrap }, /* @__PURE__ */ _react_17_0_2_react.createElement("div", { className: CombinationEditmodules.questionTitleEditorWrap }, /* @__PURE__ */ _react_17_0_2_react.createElement(es_form["default"].Item, { label: "\u9898\u5E72", name: titleKey, labelCol: { span: 24 }, rules: [{ required: true }] }, /* @__PURE__ */ _react_17_0_2_react.createElement( MdEditorInForm, { scrollId: "name", watch: true, height: 140, placeholder: questionTitlePlaceholder } ))), /* @__PURE__ */ _react_17_0_2_react.createElement(es_form["default"].Item, { label: "\u7B54\u6848\u9009\u9879", required: true, labelCol: { span: 24 } }, /* @__PURE__ */ _react_17_0_2_react.createElement( es_form["default"].List, { name: choiceKey, rules: [{ validator(rule, values) { const hasAnswer = values.some((option) => (option == null ? void 0 : option.is_answer) === true); if (hasAnswer) { return Promise.resolve(); } return Promise.reject(new Error("\u8BF7\u8BBE\u7F6E\u6B63\u786E\u7B54\u6848")); } }] }, (fields) => /* @__PURE__ */ _react_17_0_2_react.createElement("div", { id: "choices" }, fields.map((_a) => { var _b = _a, { key, name } = _b, restField = CombinationJudgmentQuestionEditor_objRest(_b, ["key", "name"]); return /* @__PURE__ */ _react_17_0_2_react.createElement(es_form["default"].Item, CombinationJudgmentQuestionEditor_spreadProps(CombinationJudgmentQuestionEditor_spreadValues({}, restField), { key, name, noStyle: true }), /* @__PURE__ */ _react_17_0_2_react.createElement(JudgmentQuestionItem, { form, choiceKey })); })) )), /* @__PURE__ */ _react_17_0_2_react.createElement("div", { onClick: () => setEditAnalysis(true) }, /* @__PURE__ */ _react_17_0_2_react.createElement(es_form["default"].Item, { name: analysisKey, label: "\u9898\u76EE\u89E3\u6790", labelCol: { span: 24 } }, /* @__PURE__ */ _react_17_0_2_react.createElement(RegularInput, { placeholder: "\u8BF7\u7F16\u8F91\u9898\u76EE\u89E3\u6790\uFF08\u975E\u5FC5\u586B\uFF09", isEdit: editAnalysis })))); }; ;// CONCATENATED MODULE: ./src/pages/Paperlibrary/Random/AddAndEdit/components/StepPreview/components/CombinationEditor/CombinationEdit/CombinationSubjectiveQuestionEditor.tsx var CombinationSubjectiveQuestionEditor_defProp = Object.defineProperty; var CombinationSubjectiveQuestionEditor_defProps = Object.defineProperties; var CombinationSubjectiveQuestionEditor_getOwnPropDescs = Object.getOwnPropertyDescriptors; var CombinationSubjectiveQuestionEditor_getOwnPropSymbols = Object.getOwnPropertySymbols; var CombinationSubjectiveQuestionEditor_hasOwnProp = Object.prototype.hasOwnProperty; var CombinationSubjectiveQuestionEditor_propIsEnum = Object.prototype.propertyIsEnumerable; var CombinationSubjectiveQuestionEditor_defNormalProp = (obj, key, value) => key in obj ? CombinationSubjectiveQuestionEditor_defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value; var CombinationSubjectiveQuestionEditor_spreadValues = (a, b) => { for (var prop in b || (b = {})) if (CombinationSubjectiveQuestionEditor_hasOwnProp.call(b, prop)) CombinationSubjectiveQuestionEditor_defNormalProp(a, prop, b[prop]); if (CombinationSubjectiveQuestionEditor_getOwnPropSymbols) for (var prop of CombinationSubjectiveQuestionEditor_getOwnPropSymbols(b)) { if (CombinationSubjectiveQuestionEditor_propIsEnum.call(b, prop)) CombinationSubjectiveQuestionEditor_defNormalProp(a, prop, b[prop]); } return a; }; var CombinationSubjectiveQuestionEditor_spreadProps = (a, b) => CombinationSubjectiveQuestionEditor_defProps(a, CombinationSubjectiveQuestionEditor_getOwnPropDescs(b)); var CombinationSubjectiveQuestionEditor_objRest = (source, exclude) => { var target = {}; for (var prop in source) if (CombinationSubjectiveQuestionEditor_hasOwnProp.call(source, prop) && exclude.indexOf(prop) < 0) target[prop] = source[prop]; if (source != null && CombinationSubjectiveQuestionEditor_getOwnPropSymbols) for (var prop of CombinationSubjectiveQuestionEditor_getOwnPropSymbols(source)) { if (exclude.indexOf(prop) < 0 && CombinationSubjectiveQuestionEditor_propIsEnum.call(source, prop)) target[prop] = source[prop]; } return target; }; const AnswerTextFormItem = (_a) => { var _b = _a, { value, onChange } = _b, props = CombinationSubjectiveQuestionEditor_objRest(_b, ["value", "onChange"]); const handleChange = (v) => { onChange([v]); }; return /* @__PURE__ */ _react_17_0_2_react.createElement( markdown_editor/* default */.Z, CombinationSubjectiveQuestionEditor_spreadProps(CombinationSubjectiveQuestionEditor_spreadValues({}, props), { defaultValue: value == null ? void 0 : value[0], onChange: handleChange }) ); }; const test = (str) => { if (!str) { return false; } let containSpecial = new RegExp("[ `~!@#$^&*()={}':;,\\[\\].<>/?~\uFF01@#\uFFE5\u2026\u2026&*\uFF08\uFF09\u2014\u3010\u3011\u2018\uFF1B\uFF1A\u201D\u201C\u3002\uFF0C\u3001\uFF1F\u300C\u300D\u300E\u300F_\\+\\-\xB7%\u300A\u300B]|[\\\\/]"); if (str === "|") { message.warning("\u5173\u952E\u8BCD\u4E0D\u80FD\u53EA\u8F93\u5165\u4E00\u4E2A\u201C|\u201D\u5B57\u7B26\uFF01"); return false; } return true; }; const KeywordTag = ({ value = [], onClose }) => { return /* @__PURE__ */ React.createElement(Tag, { closable: true, onClose, className: styles.keywordTag }, value == null ? void 0 : value.join(" \u6216 ")); }; const SubjectiveQuestionEditor = ({ questionTitlePlaceholder, form, showKeywords, isMustKeyWords = showKeywords, titleKey = "name", analysisKey = "analysis", answerTexts = "answer_texts", keywords = "keywords", useKeywords = "use_keywords", indexs }) => { const [editAnalysis, setEditAnalysis] = (0,_react_17_0_2_react.useState)(false); const [keywordsInput, setKeywordsInput] = (0,_react_17_0_2_react.useState)(""); const [useKeywordsValue, setuseKeywordsValue] = (0,_react_17_0_2_react.useState)(false); const questionScore = es_form["default"].useWatch("question_score", form); return /* @__PURE__ */ _react_17_0_2_react.createElement("div", { className: CombinationEditmodules.wrap }, /* @__PURE__ */ _react_17_0_2_react.createElement("div", { className: CombinationEditmodules.questionTitleEditorWrap }, /* @__PURE__ */ _react_17_0_2_react.createElement(es_form["default"].Item, { label: "\u9898\u5E72", name: titleKey, labelCol: { span: 24 }, rules: [{ required: true }] }, /* @__PURE__ */ _react_17_0_2_react.createElement( MdEditorInForm, { scrollId: "name", watch: true, height: 140, placeholder: questionTitlePlaceholder } ))), /* @__PURE__ */ _react_17_0_2_react.createElement(es_form["default"].Item, { label: "\u53C2\u8003\u7B54\u6848", name: answerTexts, labelCol: { span: 24 } }, /* @__PURE__ */ _react_17_0_2_react.createElement( AnswerTextFormItem, { watch: true, height: 140, placeholder: "\u8BF7\u7F16\u8F91\u53C2\u8003\u7B54\u6848\uFF08\u975E\u5FC5\u586B\uFF09" } )), showKeywords && !isMustKeyWords && /* @__PURE__ */ _react_17_0_2_react.createElement(es_form["default"].Item, { hidden: true, name: useKeywords, valuePropName: "checked" }, /* @__PURE__ */ _react_17_0_2_react.createElement(es_switch/* default */.Z, { defaultChecked: true })), /* @__PURE__ */ _react_17_0_2_react.createElement("div", { onClick: () => setEditAnalysis(true) }, /* @__PURE__ */ _react_17_0_2_react.createElement(es_form["default"].Item, { name: analysisKey, label: "\u9898\u76EE\u89E3\u6790", labelCol: { span: 24 } }, /* @__PURE__ */ _react_17_0_2_react.createElement(RegularInput, { placeholder: "\u8BF7\u7F16\u8F91\u9898\u76EE\u89E3\u6790\uFF08\u975E\u5FC5\u586B\uFF09", isEdit: editAnalysis })))); }; ;// CONCATENATED MODULE: ./src/pages/Paperlibrary/Random/AddAndEdit/components/StepPreview/components/CombinationEditor/index.tsx /* provided dependency */ var CombinationEditor_React = __webpack_require__(/*! react */ 59301); var CombinationEditor_defProp = Object.defineProperty; var CombinationEditor_defProps = Object.defineProperties; var CombinationEditor_getOwnPropDescs = Object.getOwnPropertyDescriptors; var CombinationEditor_getOwnPropSymbols = Object.getOwnPropertySymbols; var CombinationEditor_hasOwnProp = Object.prototype.hasOwnProperty; var CombinationEditor_propIsEnum = Object.prototype.propertyIsEnumerable; var CombinationEditor_defNormalProp = (obj, key, value) => key in obj ? CombinationEditor_defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value; var CombinationEditor_spreadValues = (a, b) => { for (var prop in b || (b = {})) if (CombinationEditor_hasOwnProp.call(b, prop)) CombinationEditor_defNormalProp(a, prop, b[prop]); if (CombinationEditor_getOwnPropSymbols) for (var prop of CombinationEditor_getOwnPropSymbols(b)) { if (CombinationEditor_propIsEnum.call(b, prop)) CombinationEditor_defNormalProp(a, prop, b[prop]); } return a; }; var CombinationEditor_spreadProps = (a, b) => CombinationEditor_defProps(a, CombinationEditor_getOwnPropDescs(b)); var CombinationEditor_objRest = (source, exclude) => { var target = {}; for (var prop in source) if (CombinationEditor_hasOwnProp.call(source, prop) && exclude.indexOf(prop) < 0) target[prop] = source[prop]; if (source != null && CombinationEditor_getOwnPropSymbols) for (var prop of CombinationEditor_getOwnPropSymbols(source)) { if (exclude.indexOf(prop) < 0 && CombinationEditor_propIsEnum.call(source, prop)) target[prop] = source[prop]; } return target; }; const { Panel } = collapse["default"]; const CombinationEditor_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" ])); const CombinationEditor = (_a, ref) => { var _b = _a, { globalSetting, loading, dispatch, editData, onRef = () => { }, isEdit } = _b, props = CombinationEditor_objRest(_b, [ "globalSetting", "loading", "dispatch", "editData", "onRef", "isEdit" ]); const [name, setName] = (0,_react_17_0_2_react.useState)(""); const [questionList, setQuestionList] = (0,_react_17_0_2_react.useState)([]); const [form] = es_form["default"].useForm(); (0,_react_17_0_2_react.useEffect)(() => { if (!editData || !isEdit) { return; } setName(editData == null ? void 0 : editData.name); setQuestionList(editData == null ? void 0 : editData.sub_item_banks); form.setFieldsValue(CombinationEditor_spreadValues({}, editData)); }, [editData]); (0,_react_17_0_2_react.useEffect)(() => { setQuestionList(form.getFieldValue("sub_item_banks")); }, [es_form["default"].useWatch("sub_item_banks", form)]); (0,_react_17_0_2_react.useImperativeHandle)(ref, () => ({ onSave, Clear })); const onSave = () => { if (!name) { es_message/* default */.ZP.info("\u8BF7\u60A8\u8F93\u5165\u9898\u5E72"); return false; } const sub_item_banks = questionList.map((e) => { return CombinationEditor_spreadValues({ id: e.id > 1 ? e.id : null }, e); }); return { name, sub_item_banks }; }; const Clear = () => { setName(""); setQuestionList([]); }; const questionType_new = { single: "\u5355\u9009\u9898", multiple: "\u591A\u9009\u9898", judgement: "\u5224\u65AD\u9898", completion: "\u586B\u7A7A\u9898", subjective: "\u7B80\u7B54\u9898", practical: "\u5B9E\u8BAD\u9898", program: "\u7F16\u7A0B\u9898", bprogram: "\u7A0B\u5E8F\u586B\u7A7A\u9898", combination: "\u7EC4\u5408\u9898" }; return /* @__PURE__ */ CombinationEditor_React.createElement("section", { className: editormodules.wrap }, /* @__PURE__ */ CombinationEditor_React.createElement("p", { className: editormodules.titleWrap }, /* @__PURE__ */ CombinationEditor_React.createElement("span", { className: editormodules.required }, "*"), /* @__PURE__ */ CombinationEditor_React.createElement("span", { className: editormodules.title }, "\u9898\u5E72\uFF1A")), /* @__PURE__ */ CombinationEditor_React.createElement( markdown_editor/* default */.Z, { id: "combination-question-title", watch: true, height: 155, placeholder: "\u8BF7\u60A8\u8F93\u5165\u9898\u5E72", defaultValue: name, onChange: (value) => setName(value) } ), /* @__PURE__ */ CombinationEditor_React.createElement( es_form["default"], { form, autoComplete: "off" }, /* @__PURE__ */ CombinationEditor_React.createElement(es_form["default"].List, { name: "sub_item_banks", rules: [{ validator(rule, values) { if (!values) { return Promise.reject(new Error("\u8BF7\u6DFB\u52A0\u5C0F\u9898")); } return Promise.resolve(); } }] }, (fields, { add, remove }) => { const item_list = form.getFieldValue("sub_item_banks"); return /* @__PURE__ */ CombinationEditor_React.createElement(CombinationEditor_React.Fragment, null, /* @__PURE__ */ CombinationEditor_React.createElement( collapse["default"], { className: fields.length > 0 ? editormodules.collapseWrapper : "", bordered: false, expandIcon: ({ isActive }) => /* @__PURE__ */ CombinationEditor_React.createElement("i", { className: `iconfont icon-weizhankai ${isActive ? editormodules.open : editormodules.close}`, style: { fontSize: 14, transition: "all .2s" } }) }, fields.map((_a2, index) => { var _b2 = _a2, { key, name: name2 } = _b2, restField = CombinationEditor_objRest(_b2, ["key", "name"]); var _a3, _b3, _c, _d, _e, _f, _g; return /* @__PURE__ */ CombinationEditor_React.createElement( Panel, { className: editormodules.panel, forceRender: true, header: /* @__PURE__ */ CombinationEditor_React.createElement("div", { className: editormodules.panelHeader }, "\u7B2C", index + 1, "\u5C0F\u9898", /* @__PURE__ */ CombinationEditor_React.createElement("span", null, "\uFF08", questionType_new[(_a3 = item_list == null ? void 0 : item_list[name2]) == null ? void 0 : _a3.item_type], "\uFF09")), key }, /* @__PURE__ */ CombinationEditor_React.createElement( es_form["default"].Item, CombinationEditor_spreadProps(CombinationEditor_spreadValues({}, restField), { name: name2 }), (((_b3 = item_list == null ? void 0 : item_list[name2]) == null ? void 0 : _b3.item_type) == "single" || ((_c = item_list == null ? void 0 : item_list[name2]) == null ? void 0 : _c.item_type) == "multiple") && /* @__PURE__ */ CombinationEditor_React.createElement( ChoiceQuestionEditor, { questionTitlePlaceholder: "\u8BF7\u7F16\u8F91\u9009\u62E9\u9898\u9898\u5E72\u5185\u5BB9", allowChangeMode: ((_d = item_list == null ? void 0 : item_list[name2]) == null ? void 0 : _d.item_type) == "single" ? false : true, form, choiceKey: [name2, "choices"], titleKey: [name2, "name"], analysisKey: [name2, "analysis"], choiceOptionsPath: ["sub_item_banks", name2, "choices"], choiceTextKey: "choice_text", answerKey: "is_answer" } ), ((_e = item_list == null ? void 0 : item_list[name2]) == null ? void 0 : _e.item_type) == "completion" && /* @__PURE__ */ CombinationEditor_React.createElement( CompletionQuestionEditor, { form, name: name2, questionTitlePlaceholder: "\u8BF7\u7F16\u8F91\u9898\u5E72\u5E76\u8BBE\u7F6E\u586B\u7A7A\u9879", scoreByBlank: true, titleKey: [name2, "name"], analysisKey: [name2, "analysis"], isOrdered: [name2, "is_ordered"], answerKey: [name2, "standard_answer"] } ), ((_f = item_list == null ? void 0 : item_list[name2]) == null ? void 0 : _f.item_type) == "judgement" && /* @__PURE__ */ CombinationEditor_React.createElement( JudgmentQuestionEditor, { form, questionTitlePlaceholder: "\u8BF7\u7F16\u8F91\u5224\u65AD\u9898\u9898\u5E72\u5185\u5BB9", titleKey: [name2, "name"], analysisKey: [name2, "analysis"], choiceKey: [name2, "choices"] } ), ((_g = item_list == null ? void 0 : item_list[name2]) == null ? void 0 : _g.item_type) == "subjective" && /* @__PURE__ */ CombinationEditor_React.createElement( SubjectiveQuestionEditor, { showKeywords: true, form, titleKey: [name2, "name"], analysisKey: [name2, "analysis"], answerTexts: [name2, "answer_texts"], useKeywords: [name2, "use_keywords"], keywords: [name2, "keywords"], indexs: name2, questionTitlePlaceholder: "\u8BF7\u7F16\u8F91\u7B80\u7B54\u9898\u9898\u5E72\u5185\u5BB9" } ) ) ); }) )); }) )); }; /* harmony default export */ var components_CombinationEditor = ((0,_umi_production_exports.connect)( ({ loading, globalSetting }) => ({ globalSetting, loading: loading.effects }), null, null, { forwardRef: true } )((0,_react_17_0_2_react.forwardRef)(CombinationEditor))); // EXTERNAL MODULE: ./src/components/AsyncButton/index.tsx var AsyncButton = __webpack_require__(16800); ;// CONCATENATED MODULE: ./src/pages/Paperlibrary/Random/AddAndEdit/components/StepPreview/components/ExchangeModal.tsx const ExchangeModal = ({ visible, onCancel, onRandomExchange, selectFromProblemSet, questionParams }) => { return /* @__PURE__ */ _react_17_0_2_react.createElement( es_modal["default"], { title: "\u8BF7\u9009\u62E9\u66FF\u6362\u65B9\u5F0F", open: visible, onCancel, centered: true, maskClosable: true, footer: null }, /* @__PURE__ */ _react_17_0_2_react.createElement(row/* default */.Z, { justify: "center", className: "pb20" }, /* @__PURE__ */ _react_17_0_2_react.createElement(AsyncButton/* AsyncButton */.Z, { onClick: onRandomExchange }, "\u968F\u673A\u66F4\u6362"), (questionParams == null ? void 0 : questionParams.type) !== "PRACTICAL" && /* @__PURE__ */ _react_17_0_2_react.createElement(es_button/* default */.ZP, { style: { marginLeft: 24 }, onClick: selectFromProblemSet }, "\u4ECE\u9898\u5E93\u4E2D\u9009\u62E9")) ); }; /* harmony default export */ var components_ExchangeModal = (ExchangeModal); // EXTERNAL MODULE: ./src/components/ui-customization/index.tsx + 34 modules var ui_customization = __webpack_require__(26324); // EXTERNAL MODULE: ./src/components/QuestionEditor/index.tsx + 4 modules var QuestionEditor = __webpack_require__(10086); // EXTERNAL MODULE: ./node_modules/_js-base64@2.6.4@js-base64/base64.js var base64 = __webpack_require__(24334); ;// CONCATENATED MODULE: ./src/pages/Paperlibrary/Random/AddAndEdit/components/StepPreview/index.tsx var StepPreview_defProp = Object.defineProperty; var StepPreview_defProps = Object.defineProperties; var StepPreview_getOwnPropDescs = Object.getOwnPropertyDescriptors; var StepPreview_getOwnPropSymbols = Object.getOwnPropertySymbols; var StepPreview_hasOwnProp = Object.prototype.hasOwnProperty; var StepPreview_propIsEnum = Object.prototype.propertyIsEnumerable; var StepPreview_defNormalProp = (obj, key, value) => key in obj ? StepPreview_defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value; var StepPreview_spreadValues = (a, b) => { for (var prop in b || (b = {})) if (StepPreview_hasOwnProp.call(b, prop)) StepPreview_defNormalProp(a, prop, b[prop]); if (StepPreview_getOwnPropSymbols) for (var prop of StepPreview_getOwnPropSymbols(b)) { if (StepPreview_propIsEnum.call(b, prop)) StepPreview_defNormalProp(a, prop, b[prop]); } return a; }; var StepPreview_spreadProps = (a, b) => StepPreview_defProps(a, StepPreview_getOwnPropDescs(b)); var __async = (__this, __arguments, generator) => { return new Promise((resolve, reject) => { var fulfilled = (value) => { try { step(generator.next(value)); } catch (e) { reject(e); } }; var rejected = (value) => { try { step(generator.throw(value)); } catch (e) { reject(e); } }; var step = (x) => x.done ? resolve(x.value) : Promise.resolve(x.value).then(fulfilled, rejected); step((generator = generator.apply(__this, __arguments)).next()); }); }; const Page = ({ data, submit, //保存的方法 预览编辑两种 goBack, loading, onTypeScore, editPreview = false, onSkipExamination, selectValue, onExchange }) => { var _a, _b, _c, _d, _e, _f, _g, _h, _i, _j, _k; const childrenRef = (0,_react_17_0_2_react.useRef)(); const [editId, setEditId] = (0,_react_17_0_2_react.useState)(null); const [tooltipVisible, setTooltipVisible] = (0,_react_17_0_2_react.useState)(false); const [exchangeModalVisible, setExchangeModalVisible] = (0,_react_17_0_2_react.useState)(false); const exchangeQuestionParams = (0,_react_17_0_2_react.useRef)(); const [form] = es_form["default"].useForm(); const params = (0,_umi_production_exports.useParams)(); const [iscover, setcover] = (0,_react_17_0_2_react.useState)(false); (0,_react_17_0_2_react.useEffect)(() => { setTooltipVisible(true); }, []); (0,_react_17_0_2_react.useEffect)(() => { if (!editPreview) { (0,util/* setDocumentTitle */.Dk)("\u8BD5\u5377\u9884\u89C8"); } }, [editPreview]); const difficulty = ["\u5BB9\u6613", "\u7B80\u5355", "\u9002\u4E2D", "\u56F0\u96BE"]; const 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" ]; const questionType = { SINGLE: "\u5355\u9009\u9898", MULTIPLE: "\u591A\u9009\u9898", JUDGMENT: "\u5224\u65AD\u9898", COMPLETION: "\u586B\u7A7A\u9898", SUBJECTIVE: "\u7B80\u7B54\u9898", PRACTICAL: "\u5B9E\u8BAD\u9898", PROGRAM: "\u7F16\u7A0B\u9898", BPROGRAM: "\u7A0B\u5E8F\u586B\u7A7A\u9898", COMBINATION: "\u7EC4\u5408\u9898" }; const questionType_new = { single: "\u5355\u9009\u9898", multiple: "\u591A\u9009\u9898", judgement: "\u5224\u65AD\u9898", completion: "\u586B\u7A7A\u9898", subjective: "\u7B80\u7B54\u9898", practical: "\u5B9E\u8BAD\u9898", program: "\u7F16\u7A0B\u9898", bprogram: "\u7A0B\u5E8F\u586B\u7A7A\u9898", combination: "\u7EC4\u5408\u9898" }; const renderQs = (item) => { var _a2; const answer = []; return /* @__PURE__ */ _react_17_0_2_react.createElement(_react_17_0_2_react.Fragment, null, /* @__PURE__ */ _react_17_0_2_react.createElement("aside", { className: StepPreviewmodules.single }, (_a2 = item == null ? void 0 : item.choices) == null ? void 0 : _a2.map((e, i) => { if (e.is_answer) { answer.push(End[i]); } return /* @__PURE__ */ _react_17_0_2_react.createElement("ul", { key: i }, /* @__PURE__ */ _react_17_0_2_react.createElement("li", null, End[i], "\u3001"), /* @__PURE__ */ _react_17_0_2_react.createElement("li", null, /* @__PURE__ */ _react_17_0_2_react.createElement(RenderHtml/* default */.Z, { value: e.choice_text }))); })), /* @__PURE__ */ _react_17_0_2_react.createElement("div", { className: StepPreviewmodules.analysis }, /* @__PURE__ */ _react_17_0_2_react.createElement("div", null, "\u6B63\u786E\u7B54\u6848\uFF1A", answer.join(""), /* @__PURE__ */ _react_17_0_2_react.createElement("span", { className: "ml30" }, "\u96BE\u5EA6\uFF1A", difficulty[item.difficulty])), /* @__PURE__ */ _react_17_0_2_react.createElement("aside", null, /* @__PURE__ */ _react_17_0_2_react.createElement("span", { className: StepPreviewmodules.text }, "\u89E3\u6790:"), /* @__PURE__ */ _react_17_0_2_react.createElement(RenderHtml/* default */.Z, { value: item.analysis ? item.analysis : "\u6682\u65E0\u89E3\u6790" })), /* @__PURE__ */ _react_17_0_2_react.createElement("ul", null, /* @__PURE__ */ _react_17_0_2_react.createElement("li", null, /* @__PURE__ */ _react_17_0_2_react.createElement("span", { style: { color: "#007AFF", marginRight: 10 } }, "\u65B9\u5411&\u8BFE\u7A0B:"), `${(item == null ? void 0 : item.discipline_name) || "--"}/${item == null ? void 0 : item.sub_discipline_name}`), /* @__PURE__ */ _react_17_0_2_react.createElement(tooltip/* default */.Z, { title: item == null ? void 0 : item.tag_discipline_name }, /* @__PURE__ */ _react_17_0_2_react.createElement("li", { style: { maxWidth: "400px", overflow: "hidden", whiteSpace: "nowrap", textOverflow: "ellipsis" } }, /* @__PURE__ */ _react_17_0_2_react.createElement("span", { style: { color: "#5AB891", marginRight: 10 } }, "\u77E5\u8BC6\u70B9:"), item == null ? void 0 : item.tag_discipline_name))))); }; const renderCompletion = (item, items) => { var _a2; const answer = (_a2 = item == null ? void 0 : item.standard_answer) == null ? void 0 : _a2.map((k, index) => { var _a3; return /* @__PURE__ */ _react_17_0_2_react.createElement("div", { key: index }, `\u7B54\u6848\uFF08\u586B\u7A7A${k == null ? void 0 : k.position}\uFF09\uFF1A${(_a3 = k == null ? void 0 : k.answer_text) == null ? void 0 : _a3.join("\u3001")}`); }); return /* @__PURE__ */ _react_17_0_2_react.createElement(_react_17_0_2_react.Fragment, null, /* @__PURE__ */ _react_17_0_2_react.createElement("div", { className: StepPreviewmodules.analysis }, /* @__PURE__ */ _react_17_0_2_react.createElement("div", { style: { display: "flex" } }, /* @__PURE__ */ _react_17_0_2_react.createElement("div", null, "\u6B63\u786E\u7B54\u6848\uFF1A"), /* @__PURE__ */ _react_17_0_2_react.createElement("div", null, answer)), /* @__PURE__ */ _react_17_0_2_react.createElement("aside", null, /* @__PURE__ */ _react_17_0_2_react.createElement("span", { className: StepPreviewmodules.text }, "\u89E3\u6790:"), /* @__PURE__ */ _react_17_0_2_react.createElement(RenderHtml/* default */.Z, { value: item.analysis ? item.analysis : "\u6682\u65E0\u89E3\u6790" })), /* @__PURE__ */ _react_17_0_2_react.createElement("ul", null, /* @__PURE__ */ _react_17_0_2_react.createElement("li", null, /* @__PURE__ */ _react_17_0_2_react.createElement("span", { style: { color: "#007AFF", marginRight: 10 } }, "\u65B9\u5411&\u8BFE\u7A0B:"), items ? `${(items == null ? void 0 : items.discipline_name) || "--"}/${items == null ? void 0 : items.sub_discipline_name}` : `${(item == null ? void 0 : item.discipline_name) || "--"}/${item == null ? void 0 : item.sub_discipline_name}`), /* @__PURE__ */ _react_17_0_2_react.createElement(tooltip/* default */.Z, { title: items ? items == null ? void 0 : items.tag_discipline_name : item == null ? void 0 : item.tag_discipline_name }, /* @__PURE__ */ _react_17_0_2_react.createElement("li", { style: { maxWidth: "400px", overflow: "hidden", whiteSpace: "nowrap", textOverflow: "ellipsis" } }, /* @__PURE__ */ _react_17_0_2_react.createElement("span", { style: { color: "#5AB891", marginRight: 10 } }, "\u77E5\u8BC6\u70B9:"), items ? items == null ? void 0 : items.tag_discipline_name : item == null ? void 0 : item.tag_discipline_name))))); }; const renderBProgram = (item) => { var _a2; const answer = (_a2 = item == null ? void 0 : item.standard_answer) == null ? void 0 : _a2.map((k, index) => { return /* @__PURE__ */ _react_17_0_2_react.createElement("div", { key: index }, `\u7B54\u6848\uFF08\u586B\u7A7A${(k == null ? void 0 : k.position) || (k == null ? void 0 : k.exercise_choice_id)}\uFF09\uFF1A${k == null ? void 0 : k.answer_text}`); }); return /* @__PURE__ */ _react_17_0_2_react.createElement(_react_17_0_2_react.Fragment, null, /* @__PURE__ */ _react_17_0_2_react.createElement("div", { className: StepPreviewmodules.analysis }, /* @__PURE__ */ _react_17_0_2_react.createElement("div", { style: { display: "flex" } }, /* @__PURE__ */ _react_17_0_2_react.createElement("div", null, "\u6B63\u786E\u7B54\u6848\uFF1A"), /* @__PURE__ */ _react_17_0_2_react.createElement("div", null, answer)), /* @__PURE__ */ _react_17_0_2_react.createElement("aside", null, /* @__PURE__ */ _react_17_0_2_react.createElement("span", { className: StepPreviewmodules.text }, "\u89E3\u6790:"), /* @__PURE__ */ _react_17_0_2_react.createElement(RenderHtml/* default */.Z, { value: item.analysis ? item.analysis : "\u6682\u65E0\u89E3\u6790" })), /* @__PURE__ */ _react_17_0_2_react.createElement("ul", null, /* @__PURE__ */ _react_17_0_2_react.createElement("li", null, /* @__PURE__ */ _react_17_0_2_react.createElement("span", { style: { color: "#007AFF", marginRight: 10 } }, "\u65B9\u5411&\u8BFE\u7A0B:"), `${(item == null ? void 0 : item.discipline_name) || "--"}/${item == null ? void 0 : item.sub_discipline_name}`), /* @__PURE__ */ _react_17_0_2_react.createElement(tooltip/* default */.Z, { title: item == null ? void 0 : item.tag_discipline_name }, /* @__PURE__ */ _react_17_0_2_react.createElement("li", { style: { maxWidth: "400px", overflow: "hidden", whiteSpace: "nowrap", textOverflow: "ellipsis" } }, /* @__PURE__ */ _react_17_0_2_react.createElement("span", { style: { color: "#5AB891", marginRight: 10 } }, "\u77E5\u8BC6\u70B9:"), item == null ? void 0 : item.tag_discipline_name))))); }; const renderSubjective = (item, items) => { var _a2; return /* @__PURE__ */ _react_17_0_2_react.createElement("div", { className: StepPreviewmodules.analysis }, /* @__PURE__ */ _react_17_0_2_react.createElement("div", null, "\u6B63\u786E\u7B54\u6848\uFF1A", (_a2 = item == null ? void 0 : item.answer_texts) == null ? void 0 : _a2[0]), /* @__PURE__ */ _react_17_0_2_react.createElement("aside", null, /* @__PURE__ */ _react_17_0_2_react.createElement("span", { className: StepPreviewmodules.text }, "\u89E3\u6790:"), /* @__PURE__ */ _react_17_0_2_react.createElement(RenderHtml/* default */.Z, { value: item.analysis ? item.analysis : "\u6682\u65E0\u89E3\u6790" })), /* @__PURE__ */ _react_17_0_2_react.createElement("ul", null, /* @__PURE__ */ _react_17_0_2_react.createElement("li", null, /* @__PURE__ */ _react_17_0_2_react.createElement("span", { style: { color: "#007AFF", marginRight: 10 } }, "\u65B9\u5411&\u8BFE\u7A0B:"), items ? `${(items == null ? void 0 : items.discipline_name) || "--"}/${items == null ? void 0 : items.sub_discipline_name}` : `${(item == null ? void 0 : item.discipline_name) || "--"}/${item == null ? void 0 : item.sub_discipline_name}`), /* @__PURE__ */ _react_17_0_2_react.createElement(tooltip/* default */.Z, { title: items ? items == null ? void 0 : items.tag_discipline_name : item == null ? void 0 : item.tag_discipline_name }, /* @__PURE__ */ _react_17_0_2_react.createElement("li", { style: { maxWidth: "400px", overflow: "hidden", whiteSpace: "nowrap", textOverflow: "ellipsis" } }, /* @__PURE__ */ _react_17_0_2_react.createElement("span", { style: { color: "#5AB891", marginRight: 10 } }, "\u77E5\u8BC6\u70B9:"), items ? items == null ? void 0 : items.tag_discipline_name : item == null ? void 0 : item.tag_discipline_name)))); }; const renderProgram = (item) => { var _a2, _b2; return /* @__PURE__ */ _react_17_0_2_react.createElement("div", { className: StepPreviewmodules.analysis }, /* @__PURE__ */ _react_17_0_2_react.createElement("aside", null, /* @__PURE__ */ _react_17_0_2_react.createElement("span", { className: StepPreviewmodules.text }, "\u9884\u671F\u8F93\u51FA:"), /* @__PURE__ */ _react_17_0_2_react.createElement(RenderHtml/* default */.Z, { value: (_a2 = item == null ? void 0 : item.program_attr) == null ? void 0 : _a2.description })), /* @__PURE__ */ _react_17_0_2_react.createElement("div", { style: { marginTop: 20 } }, "\u6B63\u786E\u7B54\u6848\uFF1A", ((_b2 = item == null ? void 0 : item.program_attr) == null ? void 0 : _b2.answer_text) || "--"), /* @__PURE__ */ _react_17_0_2_react.createElement("aside", null, /* @__PURE__ */ _react_17_0_2_react.createElement("span", { className: StepPreviewmodules.text }, "\u89E3\u6790:"), /* @__PURE__ */ _react_17_0_2_react.createElement(RenderHtml/* default */.Z, { value: item.analysis ? item.analysis : "\u6682\u65E0\u89E3\u6790" })), /* @__PURE__ */ _react_17_0_2_react.createElement("ul", null, /* @__PURE__ */ _react_17_0_2_react.createElement("li", null, /* @__PURE__ */ _react_17_0_2_react.createElement("span", { style: { color: "#007AFF", marginRight: 10 } }, "\u65B9\u5411&\u8BFE\u7A0B:"), `${(item == null ? void 0 : item.discipline_name) || "--"}/${item == null ? void 0 : item.sub_discipline_name}`), /* @__PURE__ */ _react_17_0_2_react.createElement(tooltip/* default */.Z, { title: item == null ? void 0 : item.tag_discipline_name }, /* @__PURE__ */ _react_17_0_2_react.createElement("li", { style: { maxWidth: "400px", overflow: "hidden", whiteSpace: "nowrap", textOverflow: "ellipsis" } }, /* @__PURE__ */ _react_17_0_2_react.createElement("span", { style: { color: "#5AB891", marginRight: 10 } }, "\u77E5\u8BC6\u70B9:"), item == null ? void 0 : item.tag_discipline_name)))); }; const renderCombination = (items, jndex) => { var _a2; return /* @__PURE__ */ _react_17_0_2_react.createElement("div", null, (_a2 = items == null ? void 0 : items.sub_item_banks) == null ? void 0 : _a2.map((item, index) => { var _a3; const answer = []; return /* @__PURE__ */ _react_17_0_2_react.createElement(_react_17_0_2_react.Fragment, null, /* @__PURE__ */ _react_17_0_2_react.createElement("div", { style: { marginLeft: 25, fontSize: "16px", color: "#333", paddingTop: "15px" } }, jndex + 1 + "." + (index + 1), "\uFF08", questionType[item.item_type] || questionType_new[item.item_type], "\uFF09", item.name), (item.item_type == "SINGLE" || item.item_type == "MULTIPLE" || item.item_type == "JUDGMENT" || item.item_type == "single" || item.item_type == "multiple" || item.item_type == "judgement") && /* @__PURE__ */ _react_17_0_2_react.createElement(_react_17_0_2_react.Fragment, null, /* @__PURE__ */ _react_17_0_2_react.createElement("aside", { className: StepPreviewmodules.single }, (_a3 = item == null ? void 0 : item.choices) == null ? void 0 : _a3.map((e, i) => { if (e.is_answer) { answer.push(End[i]); } return /* @__PURE__ */ _react_17_0_2_react.createElement("ul", { key: i }, /* @__PURE__ */ _react_17_0_2_react.createElement("li", null, End[i], "\u3001"), /* @__PURE__ */ _react_17_0_2_react.createElement("li", null, /* @__PURE__ */ _react_17_0_2_react.createElement(RenderHtml/* default */.Z, { value: e.choice_text }))); })), /* @__PURE__ */ _react_17_0_2_react.createElement("div", { className: StepPreviewmodules.analysis }, /* @__PURE__ */ _react_17_0_2_react.createElement("div", null, "\u6B63\u786E\u7B54\u6848\uFF1A", answer.join(""), /* @__PURE__ */ _react_17_0_2_react.createElement("span", { className: "ml30" }, "\u96BE\u5EA6\uFF1A", difficulty[item.difficulty])), /* @__PURE__ */ _react_17_0_2_react.createElement("aside", null, /* @__PURE__ */ _react_17_0_2_react.createElement("span", { className: StepPreviewmodules.text }, "\u89E3\u6790:"), /* @__PURE__ */ _react_17_0_2_react.createElement(RenderHtml/* default */.Z, { value: item.analysis ? item.analysis : "\u6682\u65E0\u89E3\u6790" })), /* @__PURE__ */ _react_17_0_2_react.createElement("ul", null, /* @__PURE__ */ _react_17_0_2_react.createElement("li", null, /* @__PURE__ */ _react_17_0_2_react.createElement("span", { style: { color: "#007AFF", marginRight: 10 } }, "\u65B9\u5411&\u8BFE\u7A0B:"), `${(items == null ? void 0 : items.discipline_name) || "--"}/${items == null ? void 0 : items.sub_discipline_name}`), /* @__PURE__ */ _react_17_0_2_react.createElement(tooltip/* default */.Z, { title: items == null ? void 0 : items.tag_discipline_name }, /* @__PURE__ */ _react_17_0_2_react.createElement("li", { style: { maxWidth: "400px", overflow: "hidden", whiteSpace: "nowrap", textOverflow: "ellipsis" } }, /* @__PURE__ */ _react_17_0_2_react.createElement("span", { style: { color: "#5AB891", marginRight: 10 } }, "\u77E5\u8BC6\u70B9:"), items == null ? void 0 : items.tag_discipline_name))))), (item.item_type == "COMPLETION" || item.item_type == "completion") && renderCompletion(item, items), (item.item_type == "SUBJECTIVE" || item.item_type == "subjective") && renderSubjective(item, items)); })); }; const renderPractical = (items) => { var _a2, _b2, _c2; return /* @__PURE__ */ _react_17_0_2_react.createElement("div", { style: { marginTop: "12px" } }, (_b2 = (_a2 = items == null ? void 0 : items.shixun) == null ? void 0 : _a2.challenges) == null ? void 0 : _b2.map((item, index) => { return /* @__PURE__ */ _react_17_0_2_react.createElement("div", { className: "c-grey-666 font14 mb10 ml25", style: { display: "flex", alignItems: "center", justifyContent: "space-between" } }, /* @__PURE__ */ _react_17_0_2_react.createElement("div", null, /* @__PURE__ */ _react_17_0_2_react.createElement("span", { className: "mr5" }, "\u7B2C", index + 1, "\u5173"), /* @__PURE__ */ _react_17_0_2_react.createElement(tooltip/* default */.Z, { key: index, title: item == null ? void 0 : item.challenge_name }, /* @__PURE__ */ _react_17_0_2_react.createElement("span", null, (0,util/* cutName */.Pq)(item == null ? void 0 : item.challenge_name, 44)))), editPreview && /* @__PURE__ */ _react_17_0_2_react.createElement("div", null, "\u5206\u503C\uFF1A", item.score, "\u5206")); }), /* @__PURE__ */ _react_17_0_2_react.createElement(_umi_production_exports.Link, { style: { float: "right" }, target: "_blank", to: `/shixuns/${(_c2 = items == null ? void 0 : items.shixun) == null ? void 0 : _c2.identifier}/challenges` }, "\u5B9E\u8BAD\u8BE6\u60C5"), /* @__PURE__ */ _react_17_0_2_react.createElement("div", { style: { clear: "both" } })); }; const handleSetScore = (item) => { let score = item.questions_score / item.questions_count; es_modal["default"].confirm({ icon: null, centered: true, title: "\u5206\u6570\u8BBE\u7F6E", content: /* @__PURE__ */ _react_17_0_2_react.createElement("div", { className: StepPreviewmodules.modalColumn }, /* @__PURE__ */ _react_17_0_2_react.createElement("div", { className: StepPreviewmodules.modalRow, style: { justifyContent: "flex-start" } }, /* @__PURE__ */ _react_17_0_2_react.createElement("sup", { className: StepPreviewmodules.sup }, "*"), /* @__PURE__ */ _react_17_0_2_react.createElement("span", null, item == null ? void 0 : item.name, "\uFF1A"), /* @__PURE__ */ _react_17_0_2_react.createElement(input_number/* default */.Z, { min: 0, precision: 1, defaultValue: score, onChange: (value) => { score = value; } }), /* @__PURE__ */ _react_17_0_2_react.createElement("span", { className: "ml5" }, "\u5206/\u9898"))), okText: "\u786E\u8BA4", cancelText: "\u53D6\u6D88", onOk: () => __async(void 0, null, function* () { var _a2; if (!score) { es_message/* default */.ZP.warning("\u5206\u6570\u4E0D\u80FD\u4E3A\u7A7A\u6216\u4E3A0"); return Promise.reject(); } const param = { type: item == null ? void 0 : item.type, score, scoreTotal: Number((_a2 = score * item.questions_count) == null ? void 0 : _a2.toFixed(1)) }; onTypeScore(param); }) }); }; const handleSave = () => { let name = ""; es_modal["default"].confirm({ icon: null, centered: true, title: "\u4FDD\u5B58\u8BD5\u5377", content: /* @__PURE__ */ _react_17_0_2_react.createElement("div", { className: StepPreviewmodules.modalColumn }, /* @__PURE__ */ _react_17_0_2_react.createElement("div", { style: { color: "#676A6C", display: "flex", alignItems: "center" }, className: "font14 mt20" }, /* @__PURE__ */ _react_17_0_2_react.createElement("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__ */ _react_17_0_2_react.createElement("div", { className: StepPreviewmodules.modalRow, style: { marginTop: 20 } }, /* @__PURE__ */ _react_17_0_2_react.createElement("sup", { className: StepPreviewmodules.sup }, "*"), /* @__PURE__ */ _react_17_0_2_react.createElement("span", { style: { flexShrink: 0 } }, "\u8BD5\u5377\u540D\u79F0\uFF1A"), /* @__PURE__ */ _react_17_0_2_react.createElement(input["default"], { placeholder: "\u8BF7\u8F93\u5165\u8BD5\u5377\u540D\u79F0", min: 0, maxLength: 60, defaultValue: name, onChange: (e) => { name = e.target.value; } }))), okText: "\u786E\u8BA4", cancelText: "\u53D6\u6D88", onOk: () => __async(void 0, null, function* () { var _a2; if (!name) { es_message/* default */.ZP.warning("\u8BD5\u5377\u540D\u79F0\u4E0D\u80FD\u4E3A\u7A7A"); return Promise.reject(); } const item_bank_ids = []; const item_bank_scores = []; const combination_item_banks = []; const shixun_ids = []; (_a2 = data == null ? void 0 : data.questionList) == null ? void 0 : _a2.forEach((item) => { var _a3; (_a3 = item.questions) == null ? void 0 : _a3.forEach((e) => { let s = item.questions_score / item.questions_count; s = s && s.toFixed(1); if (item.type === "COMBINATION") { combination_item_banks.push({ id: e.id, sub_item_bank_ids: e.sub_item_banks.map((item2) => item2.id) }); } if (item.type === "PRACTICAL") { shixun_ids.push(e.id); } else { item_bank_ids.push(e.id); item_bank_scores.push(s); } }); }); console.log("-----", combination_item_banks); const params2 = { item_bank_ids, item_bank_scores, name, combination_item_banks, shixun_ids }; yield submit(params2); }) }); }; const handleOnlyOne = (id, type, index, item) => { var _a2; const currentUrl = `${location.pathname}${location.search}`; const ids = (_a2 = item.questions) == null ? void 0 : _a2.map((k) => k == null ? void 0 : k.id); if (currentUrl.includes("exercise")) { exchangeQuestionParams.current = { id, ids, type, index }; setExchangeModalVisible(true); } else { let modal = es_modal["default"].confirm({ icon: null, centered: true, title: "\u6E29\u99A8\u63D0\u793A", content: `\u786E\u8BA4\u8981\u66F4\u6362\u8BE5\u8BD5\u9898\u5417\uFF1F`, cancelButtonProps: { disabled: false }, maskClosable: true, keyboard: false, okText: "\u786E\u8BA4", cancelText: "\u53D6\u6D88", onOk: () => __async(void 0, null, function* () { modal.update({ cancelButtonProps: { disabled: true } }); yield onExchange({ single_question_id: id, seleted_item_bank_ids: ids }, { type, index }); modal.update({ cancelButtonProps: { disabled: false } }); es_message/* default */.ZP.success(`\u5DF2\u91CD\u65B0\u968F\u673A\u751F\u6210\u8BD5\u9898`); }) }); } }; const handleOnlyType = (item) => { var _a2; const ids = (_a2 = item.questions) == null ? void 0 : _a2.map((k) => k == null ? void 0 : k.id); const typeName = item.name; let modal = es_modal["default"].confirm({ icon: null, centered: true, title: "\u6E29\u99A8\u63D0\u793A", content: `\u786E\u8BA4\u66F4\u6362${typeName}\u4E2D\u7684\u6240\u6709\u8BD5\u9898\u5417\uFF1F`, cancelButtonProps: { disabled: false }, maskClosable: false, keyboard: false, okText: "\u786E\u8BA4", cancelText: "\u53D6\u6D88", onOk: () => __async(void 0, null, function* () { modal.update({ cancelButtonProps: { disabled: true } }); yield onExchange({ seleted_item_bank_ids: ids }, { type: item.type }); modal.update({ cancelButtonProps: { disabled: false } }); es_message/* default */.ZP.success(`\u5DF2\u91CD\u65B0\u968F\u673A\u751F\u6210${typeName}\u8BD5\u9898`); }) }); }; const handleAllType = () => { let modal = es_modal["default"].confirm({ icon: null, centered: true, title: "\u6E29\u99A8\u63D0\u793A", content: `\u786E\u8BA4\u66F4\u6362\u9884\u89C8\u4E2D\u7684\u6240\u6709\u8BD5\u9898\u5417\uFF1F`, cancelButtonProps: { disabled: false }, maskClosable: false, keyboard: false, okText: "\u786E\u8BA4", cancelText: "\u53D6\u6D88", onOk: () => __async(void 0, null, function* () { modal.update({ cancelButtonProps: { disabled: true } }); yield onExchange(); modal.update({ cancelButtonProps: { disabled: false } }); es_message/* default */.ZP.success("\u5DF2\u91CD\u65B0\u968F\u673A\u751F\u6210\u6574\u5F20\u8BD5\u9898"); }) }); }; const handleSelectChange = (key) => { console.log(key, "key"); onSkipExamination(key - 1); }; const renderSubject = (v, type) => { var _a2, _b2; if (type === "SINGLE") { return /* @__PURE__ */ _react_17_0_2_react.createElement(_react_17_0_2_react.Fragment, null, /* @__PURE__ */ _react_17_0_2_react.createElement(components_SingleEditor, { ref: childrenRef, editData: v, isEdit: true }), /* @__PURE__ */ _react_17_0_2_react.createElement(divider/* default */.Z, null)); } if (type === "MULTIPLE") { return /* @__PURE__ */ _react_17_0_2_react.createElement(_react_17_0_2_react.Fragment, null, /* @__PURE__ */ _react_17_0_2_react.createElement(components_MultipleEditor, { ref: childrenRef, editData: v, isEdit: true }), /* @__PURE__ */ _react_17_0_2_react.createElement(divider/* default */.Z, null)); } if (type === "JUDGMENT") { return /* @__PURE__ */ _react_17_0_2_react.createElement(_react_17_0_2_react.Fragment, null, /* @__PURE__ */ _react_17_0_2_react.createElement(components_JudgmentEditor, { ref: childrenRef, editData: v, isEdit: true }), /* @__PURE__ */ _react_17_0_2_react.createElement(divider/* default */.Z, null)); } if (type === "COMPLETION") { return /* @__PURE__ */ _react_17_0_2_react.createElement(_react_17_0_2_react.Fragment, null, /* @__PURE__ */ _react_17_0_2_react.createElement(components_CompletionEditor, { ref: childrenRef, editData: v, isEdit: true }), /* @__PURE__ */ _react_17_0_2_react.createElement(divider/* default */.Z, null)); } if (type === "SUBJECTIVE") { return /* @__PURE__ */ _react_17_0_2_react.createElement(_react_17_0_2_react.Fragment, null, /* @__PURE__ */ _react_17_0_2_react.createElement(components_SubjectiveEditor, { ref: childrenRef, editData: v, isEdit: true }), /* @__PURE__ */ _react_17_0_2_react.createElement(divider/* default */.Z, null)); } if (type === "COMBINATION") { return /* @__PURE__ */ _react_17_0_2_react.createElement(_react_17_0_2_react.Fragment, null, /* @__PURE__ */ _react_17_0_2_react.createElement(components_CombinationEditor, { ref: childrenRef, editData: v, isEdit: true }), /* @__PURE__ */ _react_17_0_2_react.createElement(divider/* default */.Z, null)); } if (type === "BPROGRAM") { return /* @__PURE__ */ _react_17_0_2_react.createElement(_react_17_0_2_react.Fragment, null, /* @__PURE__ */ _react_17_0_2_react.createElement( es_form["default"], { form, style: { marginTop: 20 }, onFinishFailed: (errInfo) => { var _a3, _b3; if (errInfo.errorFields[0].name.includes("standard_answers")) { es_message/* default */.ZP.error("\u586B\u7A7A\u9879\u7B54\u6848\u4E0D\u80FD\u4E3A\u7A7A"); } else { es_message/* default */.ZP.error(errInfo.errorFields[0].errors[0]); } form.scrollToField((_b3 = (_a3 = errInfo == null ? void 0 : errInfo.errorFields) == null ? void 0 : _a3[0]) == null ? void 0 : _b3.name, { behavior: "smooth", block: "center" }); }, onFinish: (values) => __async(void 0, null, function* () { var _a3; let body = StepPreview_spreadProps(StepPreview_spreadValues({ question_score: v.score }, values), { question_type: 8, hack: StepPreview_spreadProps(StepPreview_spreadValues({}, values.hack), { difficult: v.program_attr.difficult }), hack_codes: StepPreview_spreadProps(StepPreview_spreadValues({}, values.hack_codes), { code: base64.Base64.encode((_a3 = values.hack_codes) == null ? void 0 : _a3.code) }) }); if (iscover) { body.is_cover = 1; } const res = yield (0,fetch/* default */.ZP)(`/api/exercise_questions/${v.id}.json`, { method: "put", body }); if ((res == null ? void 0 : res.status) === 0) { es_message/* default */.ZP.success("\u7F16\u8F91\u6210\u529F"); handleSelectChange(selectValue + 1); } setEditId(null); }) }, /* @__PURE__ */ _react_17_0_2_react.createElement( QuestionEditor/* BProgramEditor */.tc, { form, questionTitlePlaceholder: "\u8BF7\u7F16\u8F91\u9898\u5E72\u5E76\u8BBE\u7F6E\u586B\u7A7A\u9879", scoreByBlank: false, hackidentifier: (_a2 = v == null ? void 0 : v.program_attr) == null ? void 0 : _a2.identifier, answerKey: "standard_answers" } ), /* @__PURE__ */ _react_17_0_2_react.createElement(divider/* default */.Z, null) )); } if (type === "PROGRAM") { _umi_production_exports.history.push(`/problems/${(_b2 = v == null ? void 0 : v.program_attr) == null ? void 0 : _b2.identifier}/edit?type=exercises&express_id=${params.categoryId}&question_id=${v == null ? void 0 : v.id}&score=${v == null ? void 0 : v.score}&callback_url=${location.pathname}&select=${selectValue}&exercise=true`); } if (type === "PRACTICAL") { return /* @__PURE__ */ _react_17_0_2_react.createElement(_react_17_0_2_react.Fragment, null, /* @__PURE__ */ _react_17_0_2_react.createElement(components_ShixunEditor, { ref: childrenRef, editData: v, isEdit: true }), /* @__PURE__ */ _react_17_0_2_react.createElement(divider/* default */.Z, null)); } }; const handleEditSave = (type, param, isok) => __async(void 0, null, function* () { var _a2, _b2, _c2, _d2; const editorData = yield (_a2 = childrenRef.current) == null ? void 0 : _a2.onSave(); if (!editorData) { return; } const body = { question_score: param.score, analysis: editorData.analysis }; if (isok) { body.is_cover = 1; } if (type === "SINGLE" || type === "MULTIPLE" || type === "JUDGMENT") { const question_choices = []; const standard_answers = []; body.question_type = type === "JUDGMENT" ? 2 : 1; body.question_title = editorData == null ? void 0 : editorData.name; (_b2 = editorData == null ? void 0 : editorData.choices) == null ? void 0 : _b2.forEach((e, i) => { question_choices.push(e.choice_text); if (e == null ? 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 ? void 0 : editorData.name; body.question_type = 3; const standard_answers = []; (_c2 = editorData == null ? void 0 : editorData.standard_answers) == null ? void 0 : _c2.forEach((e, i) => { standard_answers.push({ choice_id: e.position, answer_text: e.answer_text }); }); body.standard_answers = standard_answers; body.downcase = editorData == null ? void 0 : editorData.downcase; body.no_space = editorData == null ? void 0 : editorData.no_space; } if (type === "SUBJECTIVE") { console.log("editorData"); console.log(editorData); body.question_title = editorData == null ? void 0 : editorData.name; body.question_type = 4; body.answer_texts = editorData == null ? void 0 : editorData.answer_texts; } if (type === "COMBINATION") { body.question_title = editorData == null ? void 0 : editorData.name; body.question_type = 7; body.sub_questions = (_d2 = editorData == null ? void 0 : editorData.sub_item_banks) == null ? void 0 : _d2.map((e, i) => { var _a3, _b3, _c3; if ((e == null ? void 0 : e.item_type) == "single" || (e == null ? void 0 : e.item_type) == "judgement" || (e == null ? void 0 : e.item_type) == "multiple") { const question_choices = []; const standard_answers = []; (_a3 = e == null ? void 0 : e.choices) == null ? void 0 : _a3.forEach((e2, i2) => { question_choices.push(e2.choice_text); if (e2 == null ? void 0 : e2.is_answer) { standard_answers.push(i2 + 1); } }); return { id: e.id, question_id: e.id, question_title: e.name, difficulty: e.difficulty, question_type: (e == null ? void 0 : e.item_type) == "single" ? 0 : (e == null ? void 0 : e.item_type) == "multiple" ? 1 : 2, question_choices, standard_answers, analysis: e.analysis }; } else if ((e == null ? void 0 : e.item_type) == "completion") { const standard_answers = []; (_b3 = e == null ? void 0 : e.standard_answer) == null ? void 0 : _b3.forEach((e2, i2) => { standard_answers.push({ choice_id: e2.position, answer_text: e2.answer_text, score: e2.score }); }); return { id: e.id, question_id: e.id, is_ordered: e.is_ordered, question_title: e.name, difficulty: e.difficulty, question_type: 3, standard_answers, analysis: e.analysis, downcase: e == null ? void 0 : e.downcase, no_space: e == null ? void 0 : e.no_space }; } else if ((e == null ? void 0 : e.item_type) == "subjective") { return { id: e.id, question_id: e.id, question_title: e.name, question_type: 4, difficulty: e.difficulty, answer_texts: (_c3 = e == null ? void 0 : e.answer_texts) == null ? void 0 : _c3[0], analysis: e.analysis }; } }); delete body.analysis; } const res = type !== "PRACTICAL" ? yield (0,fetch/* default */.ZP)(`/api/exercise_questions/${param.id}.json`, { method: "put", body }) : yield (0,fetch/* default */.ZP)(`/api/exercise_questions/${param.id}/update_shixun_score.json`, { method: "post", body: StepPreview_spreadValues({}, editorData) }); if ((res == null ? void 0 : res.status) === 0) { es_message/* default */.ZP.success("\u7F16\u8F91\u6210\u529F"); handleSelectChange(selectValue + 1); setEditId(null); } }); const updatePaper = () => __async(void 0, null, function* () { (0,_umi_production_exports.getDvaApp)()._store.dispatch({ type: "globalSetting/setGlobalLoading", payload: { show: true, text: "\u6B63\u5728\u66F4\u65B0\u8BD5\u5377\uFF0C\u8BF7\u7A0D\u540E..." } }); let res = yield (0,fetch/* default */.ZP)(`/api/exercises/${params.categoryId}/sync_random_question.json`, { method: "post" }); if (res.status === 0) { yield onSkipExamination(selectValue); es_message/* default */.ZP.success("\u66F4\u65B0\u6210\u529F"); } (0,_umi_production_exports.getDvaApp)()._store.dispatch({ type: "globalSetting/setGlobalLoading", payload: { show: false } }); }); const score_total = (_a = data == null ? void 0 : data.questionList) == null ? void 0 : _a.reduce((a, b) => a + Number(b.questions_score), 0); const disabled = editPreview && ((_b = data == null ? void 0 : data.exam) == null ? void 0 : _b.exercise_status) !== 1; return /* @__PURE__ */ _react_17_0_2_react.createElement("section", { className: StepPreviewmodules.wrap }, /* @__PURE__ */ _react_17_0_2_react.createElement( "div", { id: "id_left_preview", className: StepPreviewmodules.left, onMouseEnter: (e) => { const dom = document.getElementById("id_left_preview"); dom.style.overflowY = "auto"; }, onMouseLeave: (e) => { const dom = document.getElementById("id_left_preview"); dom.style.overflowY = "hidden"; } }, /* @__PURE__ */ _react_17_0_2_react.createElement("div", { className: StepPreviewmodules.title }, /* @__PURE__ */ _react_17_0_2_react.createElement("div", { className: "body-overflow-initial" }, /* @__PURE__ */ _react_17_0_2_react.createElement("b", null), /* @__PURE__ */ _react_17_0_2_react.createElement("span", null, "\u7B54\u9898\u5361"))), /* @__PURE__ */ _react_17_0_2_react.createElement("div", { className: StepPreviewmodules.total }, /* @__PURE__ */ _react_17_0_2_react.createElement("div", null, /* @__PURE__ */ _react_17_0_2_react.createElement("img", { src: xixi }), /* @__PURE__ */ _react_17_0_2_react.createElement("span", null, "\u9898\u6570(\u9053)"), /* @__PURE__ */ _react_17_0_2_react.createElement("aside", null, data == null ? void 0 : data.all_questions_count)), /* @__PURE__ */ _react_17_0_2_react.createElement("div", { className: "mr30 ml30" }, /* @__PURE__ */ _react_17_0_2_react.createElement("img", { src: bi }), /* @__PURE__ */ _react_17_0_2_react.createElement("span", null, "\u603B\u5206(\u5206)"), /* @__PURE__ */ _react_17_0_2_react.createElement("aside", null, score_total && score_total.toFixed(1))), /* @__PURE__ */ _react_17_0_2_react.createElement("div", null, /* @__PURE__ */ _react_17_0_2_react.createElement("img", { src: zhong }), /* @__PURE__ */ _react_17_0_2_react.createElement("span", null, "\u65F6\u957F(\u5206)"), /* @__PURE__ */ _react_17_0_2_react.createElement("aside", null, ((_c = data == null ? void 0 : data.exam) == null ? void 0 : _c.time) === -1 || ((_d = data == null ? void 0 : data.exam) == null ? void 0 : _d.time) === null ? "\u4E0D\u9650" : (_e = data == null ? void 0 : data.exam) == null ? void 0 : _e.time))), (_f = data == null ? void 0 : data.questionList) == null ? void 0 : _f.map((e, index) => { var _a2; return /* @__PURE__ */ _react_17_0_2_react.createElement("div", { className: StepPreviewmodules.list, key: index }, /* @__PURE__ */ _react_17_0_2_react.createElement("div", { className: StepPreviewmodules.name }, /* @__PURE__ */ _react_17_0_2_react.createElement("b", null), /* @__PURE__ */ _react_17_0_2_react.createElement("span", null, e.name)), /* @__PURE__ */ _react_17_0_2_react.createElement("aside", null, /* @__PURE__ */ _react_17_0_2_react.createElement("div", null, "\u5171", /* @__PURE__ */ _react_17_0_2_react.createElement("span", { className: StepPreviewmodules.b }, e.questions_count), "\u9898 ", /* @__PURE__ */ _react_17_0_2_react.createElement("span", { className: StepPreviewmodules.l }, "|"), "\u5171", /* @__PURE__ */ _react_17_0_2_react.createElement("span", { className: StepPreviewmodules.r }, e.questions_score), "\u5206"), /* @__PURE__ */ _react_17_0_2_react.createElement("div", { className: StepPreviewmodules.answerSheet }, (_a2 = e == null ? void 0 : e.questions) == null ? void 0 : _a2.map((k, i) => /* @__PURE__ */ _react_17_0_2_react.createElement("div", { onClick: () => { const anchorName = `Anchor_${k == null ? void 0 : k.id}`; let anchorElement = document.getElementById(anchorName); if (anchorElement) { setTimeout(() => anchorElement.scrollIntoView({ block: "center", behavior: "smooth" })); } }, key: k == null ? void 0 : k.id, className: StepPreviewmodules.tag }, i + 1))))); }) ), /* @__PURE__ */ _react_17_0_2_react.createElement("div", { className: StepPreviewmodules.right }, /* @__PURE__ */ _react_17_0_2_react.createElement("div", { className: StepPreviewmodules.examName, id: "examName" }, /* @__PURE__ */ _react_17_0_2_react.createElement("div", { className: StepPreviewmodules.name }, /* @__PURE__ */ _react_17_0_2_react.createElement(tooltip/* default */.Z, { title: (_g = data == null ? void 0 : data.exam) == null ? void 0 : _g.name, getPopupContainer: (trigger) => trigger.parentNode }, /* @__PURE__ */ _react_17_0_2_react.createElement("span", { className: StepPreviewmodules.t }, (_h = data == null ? void 0 : data.exam) == null ? void 0 : _h.name))), editPreview && ((_i = data == null ? void 0 : data.exam) == null ? void 0 : _i.exercise_status) === 1 && /* @__PURE__ */ _react_17_0_2_react.createElement(ui_customization/* CustomButton */.op, { openLoading: true, shape: "default", onClick: () => { es_modal["default"].confirm({ title: "\u63D0\u793A", content: "\u786E\u8BA4\u6839\u636E\u6700\u65B0\u7684\u968F\u673A\u7EC4\u5377\u62BD\u9898\u89C4\u5219\u91CD\u65B0\u751F\u6210\u8BD5\u5377\u5417\uFF1F", onOk: () => { updatePaper(); } }); }, type: "primary" }, "\u66F4\u65B0\u8BD5\u5377"), !editPreview && /* @__PURE__ */ _react_17_0_2_react.createElement(es_button/* default */.ZP, { onClick: handleAllType, type: "primary" }, "\u968F\u673A\u66F4\u6362")), /* @__PURE__ */ _react_17_0_2_react.createElement("div", { className: StepPreviewmodules.topWarp }, (_j = data == null ? void 0 : data.questionList) == null ? void 0 : _j.map((e, index) => { var _a2, _b2; return /* @__PURE__ */ _react_17_0_2_react.createElement(_react_17_0_2_react.Fragment, { key: index }, /* @__PURE__ */ _react_17_0_2_react.createElement("div", { className: StepPreviewmodules.head, style: index === 0 ? { border: 0, marginTop: -16 } : {} }, /* @__PURE__ */ _react_17_0_2_react.createElement("div", { className: StepPreviewmodules.name }, /* @__PURE__ */ _react_17_0_2_react.createElement("b", null), /* @__PURE__ */ _react_17_0_2_react.createElement("span", null, e.name)), /* @__PURE__ */ _react_17_0_2_react.createElement("div", { className: StepPreviewmodules.so }, "\u5171", /* @__PURE__ */ _react_17_0_2_react.createElement("span", { className: StepPreviewmodules.b }, e.questions_count, " "), "\u9898 ", e.type === "COMBINATION" && `\uFF08\u5305\u542B${(_a2 = e == null ? void 0 : e.questions) == null ? void 0 : _a2.map((item) => { var _a3; return (_a3 = item == null ? void 0 : item.sub_item_banks) == null ? void 0 : _a3.length; }).reduce((x, y) => x + y)}\u5C0F\u9898\uFF09`, /* @__PURE__ */ _react_17_0_2_react.createElement("span", { className: StepPreviewmodules.l }, "|"), "\u5171", /* @__PURE__ */ _react_17_0_2_react.createElement("span", { className: StepPreviewmodules.r }, e.questions_score), "\u5206"), !editPreview && /* @__PURE__ */ _react_17_0_2_react.createElement("div", { className: StepPreviewmodules.btn }, /* @__PURE__ */ _react_17_0_2_react.createElement(es_button/* default */.ZP, { onClick: () => { handleSetScore(e); }, type: "primary", ghost: true, className: "mr20" }, "\u8BBE\u7F6E\u5F97\u5206"), /* @__PURE__ */ _react_17_0_2_react.createElement(es_button/* default */.ZP, { onClick: () => handleOnlyType(e), type: "primary", ghost: true }, "\u968F\u673A\u66F4\u6362"))), (_b2 = e == null ? void 0 : e.questions) == null ? void 0 : _b2.map((k, i) => { var _a3, _b3; if (editId === (k == null ? void 0 : k.id)) { return /* @__PURE__ */ _react_17_0_2_react.createElement("div", { id: `Anchor_${k == null ? void 0 : k.id}`, className: StepPreviewmodules.content, style: { padding: 0, marginTop: 24 }, key: k == null ? void 0 : k.id }, /* @__PURE__ */ _react_17_0_2_react.createElement("div", { style: { float: "right", marginTop: `${(e == null ? void 0 : e.type) === "PRACTICAL" ? "-2px" : "-6px"}` } }, /* @__PURE__ */ _react_17_0_2_react.createElement(es_button/* default */.ZP, { onClick: () => setEditId(null), className: "mr20", type: "primary", ghost: true }, "\u53D6\u6D88"), /* @__PURE__ */ _react_17_0_2_react.createElement(es_button/* default */.ZP, { onClick: () => { if ((k == null ? void 0 : k.is_my) === 1) { es_modal["default"].confirm({ title: "\u63D0\u793A", content: "\u6B64\u9898\u76EE\u5DF2\u5B58\u5728\u4E8E\u8BD5\u9898\u5E93\uFF0C\u662F\u5426\u5C06\u4FEE\u6539\u540E\u7684\u9898\u76EE\u8986\u76D6\u8BD5\u9898\u5E93\u7684\u539F\u9898\uFF1F", okText: "\u8986\u76D6\u539F\u9898", cancelText: "\u4E0D\u8986\u76D6", keyboard: false, onOk: () => __async(void 0, null, function* () { if (e.type === "BPROGRAM") { setcover(true); form.submit(); } else { handleEditSave(e == null ? void 0 : e.type, k, true); } }), onCancel: () => __async(void 0, null, function* () { if (e.type === "BPROGRAM") { setcover(false); form.submit(); } else { handleEditSave(e == null ? void 0 : e.type, k, false); } }) }); } else { if (e.type === "BPROGRAM") { setcover(false); form.submit(); } else { handleEditSave(e == null ? void 0 : e.type, k, false); } } }, type: "primary" }, "\u4FDD\u5B58")), renderSubject(k, e.type)); } return /* @__PURE__ */ _react_17_0_2_react.createElement("div", { id: `Anchor_${k == null ? void 0 : k.id}`, className: StepPreviewmodules.content, key: k == null ? void 0 : k.id }, /* @__PURE__ */ _react_17_0_2_react.createElement("div", { className: StepPreviewmodules.titleWrap }, (k == null ? void 0 : k.item_type) === "bprogram" ? /* @__PURE__ */ _react_17_0_2_react.createElement(RenderHtml/* default */.Z, { style: { paddingRight: 10 }, value: i + 1 + "\u3001" + ((_a3 = k == null ? void 0 : k.program_attr) == null ? void 0 : _a3.description) }) : /* @__PURE__ */ _react_17_0_2_react.createElement(RenderHtml/* default */.Z, { style: { paddingRight: 10 }, className: StepPreviewmodules.titleHtml, value: i + 1 + `\u3001${(k == null ? void 0 : k.item_type) === "combination" ? "\uFF08\u9898\u5E72\uFF09" : ""}` + (k == null ? void 0 : k.name) }), editPreview && /* @__PURE__ */ _react_17_0_2_react.createElement(es_button/* default */.ZP, { disabled, onClick: () => { var _a4, _b4, _c2; if (editId) { es_message/* default */.ZP.warning("\u5148\u4FDD\u5B58\u6216\u53D6\u6D88\u5F53\u524D\u6B63\u5728\u7F16\u8F91\u7684\u8BD5\u9898"); return; } form.setFieldsValue({ standard_answers: k == null ? void 0 : k.standard_answer, hack: StepPreview_spreadValues(StepPreview_spreadValues({}, k), k == null ? void 0 : k.program_attr), hack_codes: StepPreview_spreadProps(StepPreview_spreadValues({}, k == null ? void 0 : k.program_attr), { code: base64.Base64.decode(((_a4 = k == null ? void 0 : k.program_attr) == null ? void 0 : _a4.code) || "") }), hack_sets: StepPreview_spreadValues({}, (_b4 = k == null ? void 0 : k.hack_sets) == null ? void 0 : _b4[0]) }); if ((k == null ? void 0 : k.item_type) == "program") { _umi_production_exports.history.push(`/problems/newedit/${(_c2 = k == null ? void 0 : k.program_attr) == null ? void 0 : _c2.identifier}?type=exercises&express_id=${params.categoryId}&question_id=${k == null ? void 0 : k.id}&score=${k == null ? void 0 : k.score}&exercise=true&callback_url=/classrooms/${params.coursesId}/exercise/${params.categoryId}/detail?random=true`); } else { setEditId(k == null ? void 0 : k.id); } }, type: "primary", className: "mr20", style: { marginLeft: "auto" }, ghost: true }, "\u7F16\u8F91"), /* @__PURE__ */ _react_17_0_2_react.createElement(es_button/* default */.ZP, { disabled, onClick: () => handleOnlyOne(k == null ? void 0 : k.id, e.type, i, e), type: "primary", ghost: true }, "\u6362\u4E00\u9898")), (k == null ? void 0 : k.item_type) === "bprogram" && /* @__PURE__ */ _react_17_0_2_react.createElement(RenderHtml/* default */.Z, { style: { paddingRight: 10, paddingLeft: 25 }, showProgramFill: true, disabledFill: true, className: StepPreviewmodules.titleHtml, value: base64.Base64.decode(((_b3 = k == null ? void 0 : k.program_attr) == null ? void 0 : _b3.code) || "") }), (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 === "BPROGRAM" && renderBProgram(k), e.type === "COMBINATION" && renderCombination(k, i), e.type === "PRACTICAL" && renderPractical(k), /* @__PURE__ */ _react_17_0_2_react.createElement("div", null)); })); }))), editPreview ? /* @__PURE__ */ _react_17_0_2_react.createElement(ui_customization/* FixedBottom */.vr, null, /* @__PURE__ */ _react_17_0_2_react.createElement( pagination/* default */.Z, { showTotal: util/* showTotal */.rU, total: (_k = data == null ? void 0 : data.exam) == null ? void 0 : _k.total_num, pageSize: 1, current: selectValue + 1, showSizeChanger: false, onChange: handleSelectChange, showQuickJumper: false, hideOnSinglePage: false } )) : /* @__PURE__ */ _react_17_0_2_react.createElement( ui_customization/* FixedBottom */.vr, { LeftContent: /* @__PURE__ */ _react_17_0_2_react.createElement( ui_customization/* CustomButton */.op, { onClick: goBack, shape: "default", style: { height: 38, background: "#fff", boxShadow: "none" } }, "\u8FD4\u56DE" ), RightContent: /* @__PURE__ */ _react_17_0_2_react.createElement(row/* default */.Z, { align: "middle" }, /* @__PURE__ */ _react_17_0_2_react.createElement(popover/* default */.Z, { color: "#55575D", overlayClassName: StepPreviewmodules.popover, open: tooltipVisible, getPopupContainer: (trigger) => trigger == null ? 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" }, /* @__PURE__ */ _react_17_0_2_react.createElement( ui_customization/* CustomButton */.op, { onMouseEnter: () => setTooltipVisible(true), onMouseLeave: () => setTooltipVisible(false), onClick: () => handleSave(), shape: "default", style: { height: 38, background: "#fff", boxShadow: "none" } }, "\u4FDD\u5B58" )), /* @__PURE__ */ _react_17_0_2_react.createElement(ui_customization/* CustomButton */.op, { shape: "default", type: "primary", onClick: () => submit(), style: { height: 38, marginLeft: 20 } }, "\u63D0\u4EA4")) } ), /* @__PURE__ */ _react_17_0_2_react.createElement( components_ExchangeModal, { visible: exchangeModalVisible, questionParams: exchangeQuestionParams.current, onRandomExchange: () => __async(void 0, null, function* () { const changeParams = exchangeQuestionParams.current; yield onExchange({ single_question_id: changeParams.id, seleted_item_bank_ids: changeParams.ids }, { type: changeParams.type, index: changeParams.index }); setExchangeModalVisible(false); }), selectFromProblemSet: () => { const changeParams = exchangeQuestionParams.current; const currentUrl = `${location.pathname}${location.search}`; if (currentUrl.includes("exercise")) { _umi_production_exports.history.push(`/paperlibrary/exchangequestion?type=exercise&qid=${changeParams.id}&qtype=${changeParams.type}&exerciseid=${params.categoryId}&from=${currentUrl}`); } }, onCancel: () => { setExchangeModalVisible(false); } } )); }; /* harmony default export */ var StepPreview = (Page); /***/ }) }]);