"use strict";
(self["webpackChunk"] = self["webpackChunk"] || []).push([[93260,4977,55523,10014],{
/***/ 80045:
/*!*******************************************************************************************************************!*\
!*** ./node_modules/_@ant-design_icons@5.2.6@@ant-design/icons/es/icons/ExclamationCircleOutlined.js + 1 modules ***!
\*******************************************************************************************************************/
/***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) {
// EXPORTS
__webpack_require__.d(__webpack_exports__, {
Z: function() { return /* binding */ icons_ExclamationCircleOutlined; }
});
// EXTERNAL MODULE: ./node_modules/_@babel_runtime@7.23.2@@babel/runtime/helpers/esm/extends.js
var esm_extends = __webpack_require__(26508);
// EXTERNAL MODULE: ./node_modules/_react@17.0.2@react/index.js
var _react_17_0_2_react = __webpack_require__(59301);
;// CONCATENATED MODULE: ./node_modules/_@ant-design_icons-svg@4.3.1@@ant-design/icons-svg/es/asn/ExclamationCircleOutlined.js
// This icon file is generated automatically.
var ExclamationCircleOutlined = { "icon": { "tag": "svg", "attrs": { "viewBox": "64 64 896 896", "focusable": "false" }, "children": [{ "tag": "path", "attrs": { "d": "M512 64C264.6 64 64 264.6 64 512s200.6 448 448 448 448-200.6 448-448S759.4 64 512 64zm0 820c-205.4 0-372-166.6-372-372s166.6-372 372-372 372 166.6 372 372-166.6 372-372 372z" } }, { "tag": "path", "attrs": { "d": "M464 688a48 48 0 1096 0 48 48 0 10-96 0zm24-112h48c4.4 0 8-3.6 8-8V296c0-4.4-3.6-8-8-8h-48c-4.4 0-8 3.6-8 8v272c0 4.4 3.6 8 8 8z" } }] }, "name": "exclamation-circle", "theme": "outlined" };
/* harmony default export */ var asn_ExclamationCircleOutlined = (ExclamationCircleOutlined);
// EXTERNAL MODULE: ./node_modules/_@ant-design_icons@5.2.6@@ant-design/icons/es/components/AntdIcon.js + 3 modules
var AntdIcon = __webpack_require__(91851);
;// CONCATENATED MODULE: ./node_modules/_@ant-design_icons@5.2.6@@ant-design/icons/es/icons/ExclamationCircleOutlined.js
// GENERATE BY ./scripts/generate.ts
// DON NOT EDIT IT MANUALLY
var ExclamationCircleOutlined_ExclamationCircleOutlined = function ExclamationCircleOutlined(props, ref) {
return /*#__PURE__*/_react_17_0_2_react.createElement(AntdIcon/* default */.Z, (0,esm_extends/* default */.Z)({}, props, {
ref: ref,
icon: asn_ExclamationCircleOutlined
}));
};
if (false) {}
/* harmony default export */ var icons_ExclamationCircleOutlined = (/*#__PURE__*/_react_17_0_2_react.forwardRef(ExclamationCircleOutlined_ExclamationCircleOutlined));
/***/ }),
/***/ 56672:
/*!*********************************!*\
!*** ./src/pages/tasks/util.js ***!
\*********************************/
/***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) {
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */ Ax: function() { return /* binding */ processTreeData; },
/* harmony export */ Ds: function() { return /* binding */ debounce; },
/* harmony export */ KI: function() { return /* binding */ apiPref; },
/* harmony export */ SI: function() { return /* binding */ getTreeData; },
/* harmony export */ f1: function() { return /* binding */ isCompileOk; }
/* harmony export */ });
/* unused harmony export isProd */
/* harmony import */ var _utils_env__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @/utils/env */ 47015);
function isCompileOk(rs) {
var flag = true;
if (rs.length > 0) {
for (var i = 0; i < rs.length; i++) {
if (rs[i].compile_success == 0 || !rs[i].compile_success) {
flag = false;
break;
}
}
} else {
flag = false;
}
return flag;
}
function getTreeData(data) {
var parentKey = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : '';
var result = [];
for (var i = 0; i < data.length; i++) {
var item = data[i];
var key = parentKey ? "".concat(parentKey, "/").concat(item.name) : "".concat(item.name);
result.push({
title: item.name,
isLeaf: item.type === 'tree' ? false : true,
key: key
});
}
return result;
}
function processTreeData(repos, key, newData) {
for (var i = 0; i < repos.length; i++) {
var item = repos[i];
if (item.key === key) {
item.children = newData;
break;
}
if (item.children) {
processTreeData(item.children, key, newData);
}
}
return repos;
}
function debounce(func, wait, immediate) {
var timeout;
return function () {
var context = this,
args = arguments;
var later = function later() {
timeout = null;
if (!immediate) func.apply(context, args);
};
var callNow = immediate && !timeout;
clearTimeout(timeout);
timeout = setTimeout(later, wait);
if (callNow) func.apply(context, args);
};
}
var isProd = true;
var apiPref = _utils_env__WEBPACK_IMPORTED_MODULE_0__/* ["default"] */ .Z.API_SERVER;
// export const isProd =
// window.location.href.indexOf('test-') > 0 ||
// window.location.href.indexOf('localhost') > 0
// ? false
// : true;
// export const apiPref = isProd
// ? 'https://www.educoder.net'
// : 'https://test-newweb.educoder.net';
/***/ }),
/***/ 10902:
/*!**********************************************!*\
!*** ./src/components/AsyncButton/index.tsx ***!
\**********************************************/
/***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) {
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */ Z: function() { return /* binding */ AsyncButton; }
/* harmony export */ });
/* harmony import */ var _root_workspace_ppte5yg23_SJ5m_develop_node_modules_babel_runtime_7_23_2_babel_runtime_helpers_objectSpread2_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./node_modules/_@babel_runtime@7.23.2@@babel/runtime/helpers/objectSpread2.js */ 26801);
/* harmony import */ var _root_workspace_ppte5yg23_SJ5m_develop_node_modules_babel_runtime_7_23_2_babel_runtime_helpers_objectSpread2_js__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_root_workspace_ppte5yg23_SJ5m_develop_node_modules_babel_runtime_7_23_2_babel_runtime_helpers_objectSpread2_js__WEBPACK_IMPORTED_MODULE_0__);
/* harmony import */ var _root_workspace_ppte5yg23_SJ5m_develop_node_modules_babel_runtime_7_23_2_babel_runtime_helpers_regeneratorRuntime_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./node_modules/_@babel_runtime@7.23.2@@babel/runtime/helpers/regeneratorRuntime.js */ 10574);
/* harmony import */ var _root_workspace_ppte5yg23_SJ5m_develop_node_modules_babel_runtime_7_23_2_babel_runtime_helpers_regeneratorRuntime_js__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_root_workspace_ppte5yg23_SJ5m_develop_node_modules_babel_runtime_7_23_2_babel_runtime_helpers_regeneratorRuntime_js__WEBPACK_IMPORTED_MODULE_1__);
/* harmony import */ var _root_workspace_ppte5yg23_SJ5m_develop_node_modules_babel_runtime_7_23_2_babel_runtime_helpers_asyncToGenerator_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./node_modules/_@babel_runtime@7.23.2@@babel/runtime/helpers/asyncToGenerator.js */ 39343);
/* harmony import */ var _root_workspace_ppte5yg23_SJ5m_develop_node_modules_babel_runtime_7_23_2_babel_runtime_helpers_asyncToGenerator_js__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(_root_workspace_ppte5yg23_SJ5m_develop_node_modules_babel_runtime_7_23_2_babel_runtime_helpers_asyncToGenerator_js__WEBPACK_IMPORTED_MODULE_2__);
/* harmony import */ var _root_workspace_ppte5yg23_SJ5m_develop_node_modules_babel_runtime_7_23_2_babel_runtime_helpers_slicedToArray_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./node_modules/_@babel_runtime@7.23.2@@babel/runtime/helpers/slicedToArray.js */ 11006);
/* harmony import */ var _root_workspace_ppte5yg23_SJ5m_develop_node_modules_babel_runtime_7_23_2_babel_runtime_helpers_slicedToArray_js__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__webpack_require__.n(_root_workspace_ppte5yg23_SJ5m_develop_node_modules_babel_runtime_7_23_2_babel_runtime_helpers_slicedToArray_js__WEBPACK_IMPORTED_MODULE_3__);
/* harmony import */ var _root_workspace_ppte5yg23_SJ5m_develop_node_modules_babel_runtime_7_23_2_babel_runtime_helpers_objectWithoutProperties_js__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./node_modules/_@babel_runtime@7.23.2@@babel/runtime/helpers/objectWithoutProperties.js */ 27161);
/* harmony import */ var _root_workspace_ppte5yg23_SJ5m_develop_node_modules_babel_runtime_7_23_2_babel_runtime_helpers_objectWithoutProperties_js__WEBPACK_IMPORTED_MODULE_4___default = /*#__PURE__*/__webpack_require__.n(_root_workspace_ppte5yg23_SJ5m_develop_node_modules_babel_runtime_7_23_2_babel_runtime_helpers_objectWithoutProperties_js__WEBPACK_IMPORTED_MODULE_4__);
/* harmony import */ var antd__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! antd */ 3113);
/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! react */ 59301);
/* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! react/jsx-runtime */ 37712);
var _excluded = ["children"];
var AsyncButton = function AsyncButton(_ref) {
var children = _ref.children,
props = _root_workspace_ppte5yg23_SJ5m_develop_node_modules_babel_runtime_7_23_2_babel_runtime_helpers_objectWithoutProperties_js__WEBPACK_IMPORTED_MODULE_4___default()(_ref, _excluded);
var _useState = (0,react__WEBPACK_IMPORTED_MODULE_5__.useState)(false),
_useState2 = _root_workspace_ppte5yg23_SJ5m_develop_node_modules_babel_runtime_7_23_2_babel_runtime_helpers_slicedToArray_js__WEBPACK_IMPORTED_MODULE_3___default()(_useState, 2),
btnLoading = _useState2[0],
setBtnLoading = _useState2[1];
return /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_6__.jsx)(antd__WEBPACK_IMPORTED_MODULE_7__/* ["default"] */ .ZP, _root_workspace_ppte5yg23_SJ5m_develop_node_modules_babel_runtime_7_23_2_babel_runtime_helpers_objectSpread2_js__WEBPACK_IMPORTED_MODULE_0___default()(_root_workspace_ppte5yg23_SJ5m_develop_node_modules_babel_runtime_7_23_2_babel_runtime_helpers_objectSpread2_js__WEBPACK_IMPORTED_MODULE_0___default()({}, props), {}, {
loading: btnLoading,
onClick: /*#__PURE__*/function () {
var _ref2 = _root_workspace_ppte5yg23_SJ5m_develop_node_modules_babel_runtime_7_23_2_babel_runtime_helpers_asyncToGenerator_js__WEBPACK_IMPORTED_MODULE_2___default()( /*#__PURE__*/_root_workspace_ppte5yg23_SJ5m_develop_node_modules_babel_runtime_7_23_2_babel_runtime_helpers_regeneratorRuntime_js__WEBPACK_IMPORTED_MODULE_1___default()().mark(function _callee(e) {
return _root_workspace_ppte5yg23_SJ5m_develop_node_modules_babel_runtime_7_23_2_babel_runtime_helpers_regeneratorRuntime_js__WEBPACK_IMPORTED_MODULE_1___default()().wrap(function _callee$(_context) {
while (1) switch (_context.prev = _context.next) {
case 0:
_context.prev = 0;
setBtnLoading(true);
_context.next = 4;
return props.onClick(e);
case 4:
setBtnLoading(false);
_context.next = 11;
break;
case 7:
_context.prev = 7;
_context.t0 = _context["catch"](0);
console.error(_context.t0);
setBtnLoading(false);
case 11:
case "end":
return _context.stop();
}
}, _callee, null, [[0, 7]]);
}));
return function (_x) {
return _ref2.apply(this, arguments);
};
}(),
children: children
}));
};
/***/ }),
/***/ 29059:
/*!***********************************************************!*\
!*** ./src/components/DigitalLabel/index.tsx + 1 modules ***!
\***********************************************************/
/***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) {
// EXPORTS
__webpack_require__.d(__webpack_exports__, {
Z: function() { return /* binding */ components_DigitalLabel; }
});
// EXTERNAL MODULE: ./node_modules/_react@17.0.2@react/index.js
var _react_17_0_2_react = __webpack_require__(59301);
;// CONCATENATED MODULE: ./src/components/DigitalLabel/index.less?modules
// extracted by mini-css-extract-plugin
/* harmony default export */ var DigitalLabelmodules = ({"digitalLabel":"digitalLabel___tImKs","active":"active___Ck70Q"});
// EXTERNAL MODULE: ./node_modules/_react@17.0.2@react/jsx-runtime.js
var jsx_runtime = __webpack_require__(37712);
;// CONCATENATED MODULE: ./src/components/DigitalLabel/index.tsx
var DigitalLabel = function DigitalLabel(_ref) {
var number = _ref.number,
active = _ref.active,
className = _ref.className;
return /*#__PURE__*/(0,jsx_runtime.jsx)("div", {
className: "".concat(DigitalLabelmodules.digitalLabel, " ").concat(active ? DigitalLabelmodules.active : '', " ").concat(className),
children: number
});
};
/* harmony default export */ var components_DigitalLabel = (DigitalLabel);
/***/ }),
/***/ 72020:
/*!*****************************************!*\
!*** ./src/components/NoData/index.tsx ***!
\*****************************************/
/***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) {
/* harmony import */ var _root_workspace_ppte5yg23_SJ5m_develop_node_modules_babel_runtime_7_23_2_babel_runtime_helpers_objectSpread2_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./node_modules/_@babel_runtime@7.23.2@@babel/runtime/helpers/objectSpread2.js */ 26801);
/* harmony import */ var _root_workspace_ppte5yg23_SJ5m_develop_node_modules_babel_runtime_7_23_2_babel_runtime_helpers_objectSpread2_js__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_root_workspace_ppte5yg23_SJ5m_develop_node_modules_babel_runtime_7_23_2_babel_runtime_helpers_objectSpread2_js__WEBPACK_IMPORTED_MODULE_0__);
/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! react */ 59301);
/* harmony import */ var _assets_images_icons_nodata_png__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @/assets/images/icons/nodata.png */ 4977);
/* harmony import */ var antd__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! antd */ 3113);
/* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! react/jsx-runtime */ 37712);
var noData = function noData(_ref) {
var img = _ref.img,
_ref$buttonProps = _ref.buttonProps,
buttonProps = _ref$buttonProps === void 0 ? {} : _ref$buttonProps,
_ref$styles = _ref.styles,
styles = _ref$styles === void 0 ? {} : _ref$styles,
customText = _ref.customText,
ButtonText = _ref.ButtonText,
ButtonClick = _ref.ButtonClick,
Buttonclass = _ref.Buttonclass,
ButtonTwo = _ref.ButtonTwo,
imgStyles = _ref.imgStyles,
_ref$loading = _ref.loading,
loading = _ref$loading === void 0 ? false : _ref$loading;
return /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_3__.jsxs)("section", {
className: "tc animated fadeIn",
style: _root_workspace_ppte5yg23_SJ5m_develop_node_modules_babel_runtime_7_23_2_babel_runtime_helpers_objectSpread2_js__WEBPACK_IMPORTED_MODULE_0___default()(_root_workspace_ppte5yg23_SJ5m_develop_node_modules_babel_runtime_7_23_2_babel_runtime_helpers_objectSpread2_js__WEBPACK_IMPORTED_MODULE_0___default()({}, {
color: '#999',
margin: '100px auto',
visibility: loading ? 'hidden' : 'visible'
}), styles),
children: [/*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_3__.jsx)("img", {
src: img || _assets_images_icons_nodata_png__WEBPACK_IMPORTED_MODULE_2__,
style: _root_workspace_ppte5yg23_SJ5m_develop_node_modules_babel_runtime_7_23_2_babel_runtime_helpers_objectSpread2_js__WEBPACK_IMPORTED_MODULE_0___default()({}, imgStyles)
}), /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_3__.jsx)("p", {
className: "mt20 font14",
children: customText || '暂时还没有相关数据哦!'
}), ButtonText && /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_3__.jsx)(antd__WEBPACK_IMPORTED_MODULE_4__/* ["default"] */ .ZP, _root_workspace_ppte5yg23_SJ5m_develop_node_modules_babel_runtime_7_23_2_babel_runtime_helpers_objectSpread2_js__WEBPACK_IMPORTED_MODULE_0___default()(_root_workspace_ppte5yg23_SJ5m_develop_node_modules_babel_runtime_7_23_2_babel_runtime_helpers_objectSpread2_js__WEBPACK_IMPORTED_MODULE_0___default()({
className: Buttonclass,
onClick: ButtonClick
}, buttonProps), {}, {
children: ButtonText
})), ButtonTwo && ButtonTwo]
});
};
/* harmony default export */ __webpack_exports__.Z = (noData);
/***/ }),
/***/ 48058:
/*!*********************************************************!*\
!*** ./src/components/PreviewAll/index.tsx + 1 modules ***!
\*********************************************************/
/***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) {
// EXPORTS
__webpack_require__.d(__webpack_exports__, {
Z: function() { return /* binding */ PreviewAll; }
});
// EXTERNAL MODULE: ./node_modules/_@babel_runtime@7.23.2@@babel/runtime/helpers/objectSpread2.js
var objectSpread2 = __webpack_require__(26801);
var objectSpread2_default = /*#__PURE__*/__webpack_require__.n(objectSpread2);
// EXTERNAL MODULE: ./node_modules/_@babel_runtime@7.23.2@@babel/runtime/helpers/regeneratorRuntime.js
var regeneratorRuntime = __webpack_require__(10574);
var regeneratorRuntime_default = /*#__PURE__*/__webpack_require__.n(regeneratorRuntime);
// EXTERNAL MODULE: ./node_modules/_@babel_runtime@7.23.2@@babel/runtime/helpers/asyncToGenerator.js
var asyncToGenerator = __webpack_require__(39343);
var asyncToGenerator_default = /*#__PURE__*/__webpack_require__.n(asyncToGenerator);
// EXTERNAL MODULE: ./node_modules/_@babel_runtime@7.23.2@@babel/runtime/helpers/slicedToArray.js
var slicedToArray = __webpack_require__(11006);
var slicedToArray_default = /*#__PURE__*/__webpack_require__.n(slicedToArray);
// EXTERNAL MODULE: ./node_modules/_react@17.0.2@react/index.js
var _react_17_0_2_react = __webpack_require__(59301);
;// CONCATENATED MODULE: ./src/components/PreviewAll/index.less?modules
// extracted by mini-css-extract-plugin
/* harmony default export */ var PreviewAllmodules = ({"wrp":"wrp___dq7YK","bgBlack":"bgBlack___ARIUV","monaco":"monaco___VnZC3","darkBlue":"darkBlue___UprA9","close":"close___LKoWu","embed":"embed___hvpEJ"});
// EXTERNAL MODULE: ./node_modules/_antd@5.9.0@antd/es/button/index.js
var es_button = __webpack_require__(3113);
// EXTERNAL MODULE: ./node_modules/_@ant-design_icons@5.2.6@@ant-design/icons/es/icons/ArrowDownOutlined.js + 1 modules
var ArrowDownOutlined = __webpack_require__(98915);
// EXTERNAL MODULE: ./src/components/monaco-editor/index.jsx + 4 modules
var monaco_editor = __webpack_require__(14654);
// EXTERNAL MODULE: ./node_modules/_antd@5.9.0@antd/es/tooltip/index.js + 3 modules
var tooltip = __webpack_require__(6848);
// EXTERNAL MODULE: ./src/utils/util.tsx
var util = __webpack_require__(27291);
// EXTERNAL MODULE: ./src/service/exercise.ts
var exercise = __webpack_require__(6303);
// EXTERNAL MODULE: ./src/components/NoData/index.tsx
var NoData = __webpack_require__(72020);
// EXTERNAL MODULE: ./src/utils/env.ts + 1 modules
var env = __webpack_require__(47015);
// EXTERNAL MODULE: ./node_modules/_react@17.0.2@react/jsx-runtime.js
var jsx_runtime = __webpack_require__(37712);
;// CONCATENATED MODULE: ./src/components/PreviewAll/index.tsx
/* harmony default export */ var PreviewAll = (function (_ref) {
var _data, _data2, _data3, _data4, _data5, _data6;
var _ref$editOffice = _ref.editOffice,
editOffice = _ref$editOffice === void 0 ? 'view' : _ref$editOffice,
data = _ref.data,
theme = _ref.theme,
type = _ref.type,
filename = _ref.filename,
monacoEditor = _ref.monacoEditor,
className = _ref.className,
style = _ref.style,
close = _ref.close,
onClose = _ref.onClose,
hasMask = _ref.hasMask,
disabledDownload = _ref.disabledDownload,
onImgDimensions = _ref.onImgDimensions,
showNodata = _ref.showNodata;
var _useState = (0,_react_17_0_2_react.useState)('https://view.officeapps.live.com/op/view.aspx?src=http://testgs.educoder.net//rails/active_storage/blobs/eyJfcmFpbHMiOnsibWVzc2FnZSI6IkJBaHBCZz09IiwiZXhwIjpudWxsLCJwdXIiOiJibG9iX2lkIn19--03541f6234b93d7ac3b2d84e7eb0e6594a952945/1.ppt'),
_useState2 = slicedToArray_default()(_useState, 2),
src = _useState2[0],
setSrc = _useState2[1];
var _useState3 = (0,_react_17_0_2_react.useState)(""),
_useState4 = slicedToArray_default()(_useState3, 2),
token = _useState4[0],
setToken = _useState4[1];
var _useState5 = (0,_react_17_0_2_react.useState)(),
_useState6 = slicedToArray_default()(_useState5, 2),
officeData = _useState6[0],
setOfficeData = _useState6[1];
var officePath = window.ENV === "build" ? "/react/build" : "";
var apiServer = location.host.startsWith("localhost") ? env/* default */.Z.PROXY_SERVER : env/* default */.Z.API_SERVER;
// let size;
var unit = 1024 * 1024;
var maxSize = 10 * unit;
var closeRef = (0,_react_17_0_2_react.useRef)();
if ((_data = data) !== null && _data !== void 0 && _data.startsWith("/api") && type !== "txt") {
data = env/* default */.Z.API_SERVER + data;
}
// if (type === "office") {
// size = parseUrl(data).filesize
// if (size > maxSize) {
// type = "other"
// }
// }
if (filename) monacoEditor.filename = filename;
(0,_react_17_0_2_react.useEffect)(function () {
var _document$cookie;
var cookies = (_document$cookie = document.cookie) === null || _document$cookie === void 0 || (_document$cookie = _document$cookie.replace(/\s/g, "")) === null || _document$cookie === void 0 ? void 0 : _document$cookie.split(";");
cookies === null || cookies === void 0 || cookies.map(function (item) {
var i = item.split("=");
if (i[0] === '_educoder_session') {
setToken(i[1]);
}
});
}, []);
(0,_react_17_0_2_react.useEffect)(function () {
if (type === "office") getData();
}, [type, data]);
var getData = /*#__PURE__*/function () {
var _ref2 = asyncToGenerator_default()( /*#__PURE__*/regeneratorRuntime_default()().mark(function _callee() {
var _url, _id, res;
return regeneratorRuntime_default()().wrap(function _callee$(_context) {
while (1) switch (_context.prev = _context.next) {
case 0:
console.log("data:", data);
_url = data;
if (!data.startsWith("http")) {
_url = location.origin + _url;
}
_id = new URL(_url).pathname.split("/").pop();
_context.next = 6;
return (0,exercise/* setEcsAttachment */.gJ)({
attachment_id: _id
});
case 6:
res = _context.sent;
setOfficeData(res);
case 8:
case "end":
return _context.stop();
}
}, _callee);
}));
return function getData() {
return _ref2.apply(this, arguments);
};
}();
var handleClick = function handleClick() {
if (data.startsWith("http") || data.startsWith('blob:')) {
handleDown();
return;
}
(0,util/* downloadFile */.Sv)(filename || 'educoder', data, filename);
};
var handleDown = function handleDown() {
(0,util/* downLoadLink */.Nd)(filename || 'educoder', decodeURIComponent(data));
};
return /*#__PURE__*/(0,jsx_runtime.jsxs)("div", {
style: objectSpread2_default()({}, style || {}),
className: "".concat(hasMask && PreviewAllmodules.bgBlack, " ").concat(!!type ? PreviewAllmodules.wrp : "hide"),
children: [close && /*#__PURE__*/(0,jsx_runtime.jsxs)("div", {
className: PreviewAllmodules.close,
ref: closeRef,
children: [!!onImgDimensions && /*#__PURE__*/(0,jsx_runtime.jsx)(tooltip/* default */.Z, {
title: "\u70B9\u51FB\u5BF9\u56FE\u7247\u8FDB\u884C\u6279\u6CE8",
getPopupContainer: function getPopupContainer() {
return closeRef.current;
},
children: /*#__PURE__*/(0,jsx_runtime.jsx)("span", {
onClick: function onClick() {
onClose();
onImgDimensions();
},
children: /*#__PURE__*/(0,jsx_runtime.jsx)("i", {
className: "icon-yulanpizhu"
})
})
}), !disabledDownload && /*#__PURE__*/(0,jsx_runtime.jsx)(tooltip/* default */.Z, {
title: "\u70B9\u51FB\u4E0B\u8F7D\u6B64\u6587\u4EF6",
getPopupContainer: function getPopupContainer() {
return closeRef.current;
},
children: /*#__PURE__*/(0,jsx_runtime.jsx)("span", {
onClick: handleDown,
children: /*#__PURE__*/(0,jsx_runtime.jsx)("i", {
className: "icon-quxiaozhiding"
})
})
}), /*#__PURE__*/(0,jsx_runtime.jsx)(tooltip/* default */.Z, {
title: "\u5173\u95ED",
getPopupContainer: function getPopupContainer() {
return closeRef.current;
},
children: /*#__PURE__*/(0,jsx_runtime.jsx)("span", {
className: "",
onClick: onClose,
children: /*#__PURE__*/(0,jsx_runtime.jsx)("i", {
className: "icon-guanbi1"
})
})
})]
}), /*#__PURE__*/(0,jsx_runtime.jsx)("div", {
className: "".concat(PreviewAllmodules[className], " ").concat(className, " ").concat(PreviewAllmodules.monaco, " ").concat(type === "txt" ? "show" : "hide"),
children: type === "txt" && /*#__PURE__*/(0,jsx_runtime.jsx)(jsx_runtime.Fragment, {
children: /*#__PURE__*/(0,jsx_runtime.jsx)(monaco_editor/* default */.ZP, objectSpread2_default()({}, monacoEditor))
})
}), type === "audio" && /*#__PURE__*/(0,jsx_runtime.jsx)("audio", {
src: "".concat(((_data2 = data) === null || _data2 === void 0 ? void 0 : _data2.indexOf("http://")) > -1 || ((_data3 = data) === null || _data3 === void 0 ? void 0 : _data3.indexOf("https://")) > -1 ? "" : "data:audio/mp3;base64,").concat(data),
autoPlay: true
}), type === "video" && /*#__PURE__*/(0,jsx_runtime.jsx)(jsx_runtime.Fragment, {
children: ((_data4 = data) === null || _data4 === void 0 ? void 0 : _data4.indexOf("http")) > -1 ? /*#__PURE__*/(0,jsx_runtime.jsx)("video", {
controls: true,
src: "".concat(data),
autoPlay: true
}) : /*#__PURE__*/(0,jsx_runtime.jsx)("video", {
controls: true,
src: "data:video/mp4;base64,".concat(data),
autoPlay: true
})
}), type === 'office' && officeData && /*#__PURE__*/(0,jsx_runtime.jsx)("iframe", {
src: "".concat(officePath, "/office.html?key=").concat(officeData.key, "&url=").concat(apiServer + officeData.url, "&callbackUrl=").concat(apiServer + officeData.callbackUrl, "&fileType=").concat(officeData.fileType, "&title=").concat(officeData.title, "&model=").concat(editOffice, "&officeServer=").concat(env/* default */.Z.ONLYOFFICE, "&disabledDownload=").concat(!!disabledDownload)
}), type === 'html' && /*#__PURE__*/(0,jsx_runtime.jsx)("iframe", {
src: data + '&disposition=inline'
}), type === 'pdf' && /*#__PURE__*/(0,jsx_runtime.jsx)("iframe", {
src: "".concat(officePath, "/js/pdfview/index.html?url=").concat(data, "&disabledDownload=").concat(!!disabledDownload)
}) //
, type === "image" && /*#__PURE__*/(0,jsx_runtime.jsx)("img", {
src: "".concat(((_data5 = data) === null || _data5 === void 0 ? void 0 : _data5.indexOf("http://")) > -1 || ((_data6 = data) === null || _data6 === void 0 ? void 0 : _data6.indexOf("https://")) > -1 ? "" : "data:image/png;base64,").concat(data)
}), (type === "other" || type === "download") && /*#__PURE__*/(0,jsx_runtime.jsx)(jsx_runtime.Fragment, {
children: showNodata ? /*#__PURE__*/(0,jsx_runtime.jsx)(NoData/* default */.Z, {
customText: "\u5F53\u524D\u6587\u4EF6\u4E0D\u652F\u6301\u9884\u89C8\uFF0C\u53EF\u70B9\u51FB\u4E0B\u8F7D\u67E5\u770B",
ButtonTwo: /*#__PURE__*/(0,jsx_runtime.jsx)(es_button/* default */.ZP, {
icon: /*#__PURE__*/(0,jsx_runtime.jsx)("i", {
className: "iconfont icon-xiazai4 font14"
}),
type: "primary",
size: 'middle',
onClick: handleClick,
children: "\u4E0B\u8F7D"
})
}) : /*#__PURE__*/(0,jsx_runtime.jsxs)(es_button/* default */.ZP, {
type: "primary",
size: 'middle',
onClick: handleClick,
children: [/*#__PURE__*/(0,jsx_runtime.jsx)(ArrowDownOutlined/* default */.Z, {}), "\u70B9\u51FB\u4E0B\u8F7D"]
})
})]
});
});
/***/ }),
/***/ 76689:
/*!**********************************************************!*\
!*** ./src/components/QuestionEditor/BProgramEditor.tsx ***!
\**********************************************************/
/***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) {
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */ t: function() { return /* binding */ BProgramEditor; }
/* harmony export */ });
/* harmony import */ var _root_workspace_ppte5yg23_SJ5m_develop_node_modules_babel_runtime_7_23_2_babel_runtime_helpers_objectWithoutProperties_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./node_modules/_@babel_runtime@7.23.2@@babel/runtime/helpers/objectWithoutProperties.js */ 27161);
/* harmony import */ var _root_workspace_ppte5yg23_SJ5m_develop_node_modules_babel_runtime_7_23_2_babel_runtime_helpers_objectWithoutProperties_js__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_root_workspace_ppte5yg23_SJ5m_develop_node_modules_babel_runtime_7_23_2_babel_runtime_helpers_objectWithoutProperties_js__WEBPACK_IMPORTED_MODULE_0__);
/* harmony import */ var _root_workspace_ppte5yg23_SJ5m_develop_node_modules_babel_runtime_7_23_2_babel_runtime_helpers_createForOfIteratorHelper_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./node_modules/_@babel_runtime@7.23.2@@babel/runtime/helpers/createForOfIteratorHelper.js */ 98190);
/* harmony import */ var _root_workspace_ppte5yg23_SJ5m_develop_node_modules_babel_runtime_7_23_2_babel_runtime_helpers_createForOfIteratorHelper_js__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_root_workspace_ppte5yg23_SJ5m_develop_node_modules_babel_runtime_7_23_2_babel_runtime_helpers_createForOfIteratorHelper_js__WEBPACK_IMPORTED_MODULE_1__);
/* harmony import */ var _root_workspace_ppte5yg23_SJ5m_develop_node_modules_babel_runtime_7_23_2_babel_runtime_helpers_defineProperty_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./node_modules/_@babel_runtime@7.23.2@@babel/runtime/helpers/defineProperty.js */ 22060);
/* harmony import */ var _root_workspace_ppte5yg23_SJ5m_develop_node_modules_babel_runtime_7_23_2_babel_runtime_helpers_defineProperty_js__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(_root_workspace_ppte5yg23_SJ5m_develop_node_modules_babel_runtime_7_23_2_babel_runtime_helpers_defineProperty_js__WEBPACK_IMPORTED_MODULE_2__);
/* harmony import */ var _root_workspace_ppte5yg23_SJ5m_develop_node_modules_babel_runtime_7_23_2_babel_runtime_helpers_objectSpread2_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./node_modules/_@babel_runtime@7.23.2@@babel/runtime/helpers/objectSpread2.js */ 26801);
/* harmony import */ var _root_workspace_ppte5yg23_SJ5m_develop_node_modules_babel_runtime_7_23_2_babel_runtime_helpers_objectSpread2_js__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__webpack_require__.n(_root_workspace_ppte5yg23_SJ5m_develop_node_modules_babel_runtime_7_23_2_babel_runtime_helpers_objectSpread2_js__WEBPACK_IMPORTED_MODULE_3__);
/* harmony import */ var _root_workspace_ppte5yg23_SJ5m_develop_node_modules_babel_runtime_7_23_2_babel_runtime_helpers_slicedToArray_js__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./node_modules/_@babel_runtime@7.23.2@@babel/runtime/helpers/slicedToArray.js */ 11006);
/* harmony import */ var _root_workspace_ppte5yg23_SJ5m_develop_node_modules_babel_runtime_7_23_2_babel_runtime_helpers_slicedToArray_js__WEBPACK_IMPORTED_MODULE_4___default = /*#__PURE__*/__webpack_require__.n(_root_workspace_ppte5yg23_SJ5m_develop_node_modules_babel_runtime_7_23_2_babel_runtime_helpers_slicedToArray_js__WEBPACK_IMPORTED_MODULE_4__);
/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! react */ 59301);
/* harmony import */ var antd__WEBPACK_IMPORTED_MODULE_11__ = __webpack_require__(/*! antd */ 1056);
/* harmony import */ var antd__WEBPACK_IMPORTED_MODULE_12__ = __webpack_require__(/*! antd */ 78673);
/* harmony import */ var antd__WEBPACK_IMPORTED_MODULE_13__ = __webpack_require__(/*! antd */ 78241);
/* harmony import */ var antd__WEBPACK_IMPORTED_MODULE_14__ = __webpack_require__(/*! antd */ 95237);
/* harmony import */ var antd__WEBPACK_IMPORTED_MODULE_15__ = __webpack_require__(/*! antd */ 43604);
/* harmony import */ var antd__WEBPACK_IMPORTED_MODULE_16__ = __webpack_require__(/*! antd */ 85731);
/* harmony import */ var antd__WEBPACK_IMPORTED_MODULE_17__ = __webpack_require__(/*! antd */ 57809);
/* harmony import */ var antd__WEBPACK_IMPORTED_MODULE_18__ = __webpack_require__(/*! antd */ 5112);
/* harmony import */ var _MdEditorInForm__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ./MdEditorInForm */ 61954);
/* harmony import */ var umi__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! umi */ 66660);
/* harmony import */ var _index_less_modules__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! ./index.less?modules */ 52398);
/* harmony import */ var _Buttonloading__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! ./Buttonloading */ 1949);
/* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(/*! react/jsx-runtime */ 37712);
var _excluded = ["key", "name"];
var TextArea = antd__WEBPACK_IMPORTED_MODULE_11__/* ["default"] */ .Z.TextArea;
var language = [{
title: 'C',
key: 'C'
}, {
title: 'C++',
key: 'C++'
}, {
title: 'Python',
key: 'Python'
}, {
title: 'Java',
key: 'Java'
}, {
title: 'JavaScript',
key: 'JavaScript'
}, {
title: 'Ruby',
key: 'Ruby'
}];
var ReversedSwitch = function ReversedSwitch(_ref) {
var value = _ref.value,
_onChange = _ref.onChange;
//打开为false,关闭为true,即一个特殊的Switch。
return /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_10__.jsx)(antd__WEBPACK_IMPORTED_MODULE_12__/* ["default"] */ .Z, {
checked: value,
onChange: function onChange(checked) {
_onChange(checked);
}
});
};
var NULL_CH = '@▁@';
var NULL_CH1 = '@▁▁@';
var BProgramEditor = function BProgramEditor(_ref2) {
var questionTitlePlaceholder = _ref2.questionTitlePlaceholder,
form = _ref2.form,
_ref2$scoreByBlank = _ref2.scoreByBlank,
scoreByBlank = _ref2$scoreByBlank === void 0 ? false : _ref2$scoreByBlank,
hackidentifier = _ref2.hackidentifier,
answerKey = _ref2.answerKey;
var _useState = (0,react__WEBPACK_IMPORTED_MODULE_5__.useState)(false),
_useState2 = _root_workspace_ppte5yg23_SJ5m_develop_node_modules_babel_runtime_7_23_2_babel_runtime_helpers_slicedToArray_js__WEBPACK_IMPORTED_MODULE_4___default()(_useState, 2),
editAnalysis = _useState2[0],
setEditAnalysis = _useState2[1];
var _useState3 = (0,react__WEBPACK_IMPORTED_MODULE_5__.useState)(false),
_useState4 = _root_workspace_ppte5yg23_SJ5m_develop_node_modules_babel_runtime_7_23_2_babel_runtime_helpers_slicedToArray_js__WEBPACK_IMPORTED_MODULE_4___default()(_useState3, 2),
isloading = _useState4[0],
setloading = _useState4[1];
var param = (0,umi__WEBPACK_IMPORTED_MODULE_7__.useParams)();
var isEdit = param.type === 'edit';
var getChCountBeforeCursor = function getChCountBeforeCursor(cm, cursor) {
var currentLine = cursor.line;
var placeholderCountBefore = 0;
for (var _line = 0; _line < currentLine; _line++) {
placeholderCountBefore += cm.getLine(_line).split(NULL_CH).length - 1;
}
for (var _line2 = 0; _line2 < currentLine; _line2++) {
placeholderCountBefore += cm.getLine(_line2).split(NULL_CH1).length - 1;
}
var currentLineStringBeforeCursor = cm.getLine(currentLine).substring(0, cursor.ch);
placeholderCountBefore += currentLineStringBeforeCursor.split(NULL_CH).length - 1;
placeholderCountBefore += currentLineStringBeforeCursor.split(NULL_CH1).length - 1;
return placeholderCountBefore;
};
var _onCMBeforeChange = function onCMBeforeChange(cm, change, addBlank, removeBlank) {
var rangeText = cm.getRange(change.from, change.to);
var newBlankNum = 0;
change.text.forEach(function (item) {
newBlankNum += item.split(NULL_CH).length - 1;
});
change.text.forEach(function (item) {
newBlankNum += item.split(NULL_CH1).length - 1;
});
if (change.origin === 'setValue') {
//setValue为初始化,此时不需要删除也不需要增加填空项
return;
}
if (rangeText && (rangeText.indexOf(NULL_CH) !== -1 || rangeText.indexOf(NULL_CH1) !== -1)) {
var placeholderCountInRange = rangeText.split(NULL_CH).length - 1 + rangeText.split(NULL_CH1).length - 1;
var placeholderCountBefore = getChCountBeforeCursor(cm, change.from);
console.log("\u5220\u9664".concat(placeholderCountInRange, "\u4E2A\uFF0C \u524D\u9762\u6709").concat(placeholderCountBefore, "\u4E2A\uFF0C\u65B0\u589E").concat(newBlankNum, "\u4E2A"));
if (placeholderCountInRange > 1) {
var indexArray = Array.from({
length: placeholderCountInRange
}, function (item, index) {
return placeholderCountBefore + index;
});
removeBlank(indexArray);
} else {
removeBlank(placeholderCountBefore);
}
} else if (newBlankNum > 0) {
var _placeholderCountBefore = getChCountBeforeCursor(cm, change.from);
console.log("\u65B0\u589E".concat(newBlankNum, "\u4E2A\uFF0C\u4E4B\u524D\u6709").concat(_placeholderCountBefore, "\u4E2A"));
addBlank(newBlankNum, _placeholderCountBefore);
}
};
//新增和删除需要重新设置position,position表示填空的位置
var rewritePosition = function rewritePosition() {
var preAnswerData = form.getFieldValue(answerKey);
form.setFieldsValue(_root_workspace_ppte5yg23_SJ5m_develop_node_modules_babel_runtime_7_23_2_babel_runtime_helpers_defineProperty_js__WEBPACK_IMPORTED_MODULE_2___default()({}, answerKey, preAnswerData === null || preAnswerData === void 0 ? void 0 : preAnswerData.map(function (item, index) {
return _root_workspace_ppte5yg23_SJ5m_develop_node_modules_babel_runtime_7_23_2_babel_runtime_helpers_objectSpread2_js__WEBPACK_IMPORTED_MODULE_3___default()(_root_workspace_ppte5yg23_SJ5m_develop_node_modules_babel_runtime_7_23_2_babel_runtime_helpers_objectSpread2_js__WEBPACK_IMPORTED_MODULE_3___default()({}, item), {}, {
position: index + 1
});
})));
};
var addFnRef = (0,react__WEBPACK_IMPORTED_MODULE_5__.useRef)();
var addBlank = function addBlank(addNum, insertIndex) {
for (var i = 0; i < addNum; i++) {
addFnRef.current({
position: null,
answer_text: ''
}, insertIndex + i);
}
rewritePosition();
};
var removeFnRef = (0,react__WEBPACK_IMPORTED_MODULE_5__.useRef)();
var removeBlank = function removeBlank(deleteIndex) {
removeFnRef.current(deleteIndex);
rewritePosition();
};
var standardAnswersValue = antd__WEBPACK_IMPORTED_MODULE_13__/* ["default"] */ .Z.useWatch(answerKey, form);
return /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_10__.jsxs)("div", {
className: _index_less_modules__WEBPACK_IMPORTED_MODULE_8__/* ["default"] */ .Z.wrap,
children: [/*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_10__.jsx)(antd__WEBPACK_IMPORTED_MODULE_13__/* ["default"] */ .Z.Item, {
label: "\u8BD5\u9898\u63CF\u8FF0",
name: ['hack', 'description'],
style: {
display: "table"
},
className: "w100",
labelCol: {
span: 24
},
rules: [{
required: true
}],
children: /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_10__.jsx)(_MdEditorInForm__WEBPACK_IMPORTED_MODULE_6__/* .MdEditorInForm */ .h, {
scrollId: "name",
watch: true,
height: 140
})
}), /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_10__.jsx)("div", {
className: _index_less_modules__WEBPACK_IMPORTED_MODULE_8__/* ["default"] */ .Z.questionTitleEditorWrap,
children: /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_10__.jsx)(antd__WEBPACK_IMPORTED_MODULE_13__/* ["default"] */ .Z.Item, {
label: "\u7A0B\u5E8F\u4EE3\u7801",
name: ['hack_codes', 'code'],
labelCol: {
span: 24
},
rules: [{
required: true
}],
children: /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_10__.jsx)(_MdEditorInForm__WEBPACK_IMPORTED_MODULE_6__/* .MdEditorInForm */ .h, {
scrollId: "name",
watch: true,
height: 400,
showNullProgramButton: true,
onChange: function onChange(a, b) {
var preAnswerData = form.getFieldValue(answerKey);
console.log('--preAnswerData', preAnswerData, b);
form.setFieldsValue(_root_workspace_ppte5yg23_SJ5m_develop_node_modules_babel_runtime_7_23_2_babel_runtime_helpers_defineProperty_js__WEBPACK_IMPORTED_MODULE_2___default()({}, answerKey, preAnswerData === null || preAnswerData === void 0 ? void 0 : preAnswerData.map(function (item, index) {
var _b$index;
return _root_workspace_ppte5yg23_SJ5m_develop_node_modules_babel_runtime_7_23_2_babel_runtime_helpers_objectSpread2_js__WEBPACK_IMPORTED_MODULE_3___default()(_root_workspace_ppte5yg23_SJ5m_develop_node_modules_babel_runtime_7_23_2_babel_runtime_helpers_objectSpread2_js__WEBPACK_IMPORTED_MODULE_3___default()({}, item), {}, {
position: index + 1,
multi_line: b === null || b === void 0 || (_b$index = b[index]) === null || _b$index === void 0 ? void 0 : _b$index.multiLine
});
})));
},
placeholder: questionTitlePlaceholder,
onCMBeforeChange: function onCMBeforeChange(cm, change) {
_onCMBeforeChange(cm, change, addBlank, removeBlank);
}
})
})
}), /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_10__.jsx)(antd__WEBPACK_IMPORTED_MODULE_13__/* ["default"] */ .Z.List, {
name: answerKey,
rules: [{
validator: function validator(rule, values) {
if ((values === null || values === void 0 ? void 0 : values.length) === 0) {
return Promise.reject(new Error('答案不能为空'));
}
var _iterator = _root_workspace_ppte5yg23_SJ5m_develop_node_modules_babel_runtime_7_23_2_babel_runtime_helpers_createForOfIteratorHelper_js__WEBPACK_IMPORTED_MODULE_1___default()(values),
_step;
try {
for (_iterator.s(); !(_step = _iterator.n()).done;) {
var item = _step.value;
var _ref3 = item || {},
answer_text = _ref3.answer_text;
if ((answer_text === null || answer_text === void 0 ? void 0 : answer_text.length) === 0) {
return Promise.reject(new Error('填空项答案不能为空'));
}
}
} catch (err) {
_iterator.e(err);
} finally {
_iterator.f();
}
return Promise.resolve();
}
}],
children: function children(fields, _ref4, _ref5) {
var add = _ref4.add,
remove = _ref4.remove;
var errors = _ref5.errors;
addFnRef.current = add;
removeFnRef.current = remove;
return /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_10__.jsxs)(react_jsx_runtime__WEBPACK_IMPORTED_MODULE_10__.Fragment, {
children: [/*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_10__.jsx)(antd__WEBPACK_IMPORTED_MODULE_13__/* ["default"] */ .Z.Item, {
label: "\u586B\u7A7A\u9879\u7B54\u6848",
required: true,
labelCol: {
span: 24
}
}), fields.map(function (_ref6, index) {
var _standardAnswersValue, _standardAnswersValue2;
var key = _ref6.key,
name = _ref6.name,
restField = _root_workspace_ppte5yg23_SJ5m_develop_node_modules_babel_runtime_7_23_2_babel_runtime_helpers_objectWithoutProperties_js__WEBPACK_IMPORTED_MODULE_0___default()(_ref6, _excluded);
return /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_10__.jsxs)(antd__WEBPACK_IMPORTED_MODULE_14__/* ["default"] */ .Z, {
className: "mb20",
align: "middle",
wrap: false,
children: [/*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_10__.jsxs)(antd__WEBPACK_IMPORTED_MODULE_15__/* ["default"] */ .Z, {
flex: '0 0 auto',
className: "".concat(_index_less_modules__WEBPACK_IMPORTED_MODULE_8__/* ["default"] */ .Z.blankIndex),
children: ["\u586B\u7A7A\u9879", index + 1]
}), /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_10__.jsx)(antd__WEBPACK_IMPORTED_MODULE_15__/* ["default"] */ .Z, {
flex: 1,
children: /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_10__.jsxs)(antd__WEBPACK_IMPORTED_MODULE_14__/* ["default"] */ .Z, {
align: "top",
justify: "space-between",
wrap: false,
children: [/*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_10__.jsx)(antd__WEBPACK_IMPORTED_MODULE_15__/* ["default"] */ .Z, {
children: /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_10__.jsx)(antd__WEBPACK_IMPORTED_MODULE_13__/* ["default"] */ .Z.Item, _root_workspace_ppte5yg23_SJ5m_develop_node_modules_babel_runtime_7_23_2_babel_runtime_helpers_objectSpread2_js__WEBPACK_IMPORTED_MODULE_3___default()(_root_workspace_ppte5yg23_SJ5m_develop_node_modules_babel_runtime_7_23_2_babel_runtime_helpers_objectSpread2_js__WEBPACK_IMPORTED_MODULE_3___default()({}, restField), {}, {
name: [name, 'answer_text'],
noStyle: true,
children: standardAnswersValue !== null && standardAnswersValue !== void 0 && (_standardAnswersValue = standardAnswersValue[name]) !== null && _standardAnswersValue !== void 0 && _standardAnswersValue.multi_line || standardAnswersValue !== null && standardAnswersValue !== void 0 && (_standardAnswersValue2 = standardAnswersValue[name]) !== null && _standardAnswersValue2 !== void 0 && _standardAnswersValue2.multiLine ? /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_10__.jsx)(TextArea, {
spellCheck: false,
style: {
marginLeft: 10,
width: 550
}
}) : /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_10__.jsx)(antd__WEBPACK_IMPORTED_MODULE_11__/* ["default"] */ .Z, {
style: {
marginLeft: 10,
width: 550
},
className: _index_less_modules__WEBPACK_IMPORTED_MODULE_8__/* ["default"] */ .Z.blankInput
// defaultValue={v}
,
size: "large",
maxLength: 1000,
onBlur: function onBlur(e) {}
})
}))
}), scoreByBlank && /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_10__.jsx)(antd__WEBPACK_IMPORTED_MODULE_15__/* ["default"] */ .Z, {
flex: '224px',
children: /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_10__.jsx)(antd__WEBPACK_IMPORTED_MODULE_13__/* ["default"] */ .Z.Item, _root_workspace_ppte5yg23_SJ5m_develop_node_modules_babel_runtime_7_23_2_babel_runtime_helpers_objectSpread2_js__WEBPACK_IMPORTED_MODULE_3___default()(_root_workspace_ppte5yg23_SJ5m_develop_node_modules_babel_runtime_7_23_2_babel_runtime_helpers_objectSpread2_js__WEBPACK_IMPORTED_MODULE_3___default()({}, restField), {}, {
name: [name, 'score'],
label: "\u5206\u503C",
rules: [{
required: true
}],
children: /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_10__.jsx)(antd__WEBPACK_IMPORTED_MODULE_16__/* ["default"] */ .Z, {
size: "large",
className: _index_less_modules__WEBPACK_IMPORTED_MODULE_8__/* ["default"] */ .Z.blankInput,
min: 0.1,
max: 100,
precision: 1,
style: {
width: '100%'
},
placeholder: "\u6309\u7A7A\u7ED9\u5206\u8BF7\u8F93\u5165\u5206\u503C"
})
}))
})]
})
})]
}, key);
})]
});
}
}), /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_10__.jsx)("div", {
onClick: function onClick() {
return setEditAnalysis(true);
},
children: /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_10__.jsx)(antd__WEBPACK_IMPORTED_MODULE_13__/* ["default"] */ .Z.Item, {
name: ['hack', 'analysis'],
label: "\u9898\u76EE\u89E3\u6790",
labelCol: {
span: 24
},
children: /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_10__.jsx)(_MdEditorInForm__WEBPACK_IMPORTED_MODULE_6__/* .RegularInput */ .x, {
placeholder: "\u8BF7\u7F16\u8F91\u9898\u76EE\u89E3\u6790\uFF08\u975E\u5FC5\u586B\uFF09",
isEdit: editAnalysis
})
})
}), /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_10__.jsx)(antd__WEBPACK_IMPORTED_MODULE_13__/* ["default"] */ .Z.Item, {
label: "\u7F16\u7A0B\u8BED\u8A00",
style: {
marginTop: 30
},
name: ['hack_codes', 'language'],
labelCol: {
span: 24
},
rules: [{
required: true,
message: '请选择编程语言'
}],
children: /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_10__.jsx)(antd__WEBPACK_IMPORTED_MODULE_17__["default"], {
size: "large",
children: language.map(function (item) {
return /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_10__.jsxs)(antd__WEBPACK_IMPORTED_MODULE_17__["default"].Option, {
value: item.key,
children: [" ", item.title]
}, item.title);
})
})
}), /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_10__.jsxs)(antd__WEBPACK_IMPORTED_MODULE_13__/* ["default"] */ .Z.Item, {
label: '最大评测时长(秒)',
style: {
marginTop: 30
},
labelCol: {
span: 24
},
required: true,
children: [/*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_10__.jsx)(antd__WEBPACK_IMPORTED_MODULE_13__/* ["default"] */ .Z.Item, {
name: ['hack', 'time_limit'],
rules: [{
required: true,
message: '请输入单个测试集评测时长限制'
}, {
type: 'number',
min: 3,
message: '最小限制时间是3秒'
}],
noStyle: true,
children: /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_10__.jsx)(antd__WEBPACK_IMPORTED_MODULE_16__/* ["default"] */ .Z, {
precision: 0,
max: 10,
min: 3,
size: "large",
style: {
width: '97%'
}
})
}), /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_10__.jsx)("span", {
className: "ml10 font14",
children: "\u79D2"
})]
}), /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_10__.jsx)(antd__WEBPACK_IMPORTED_MODULE_13__/* ["default"] */ .Z.Item, {
label: "\u586B\u7A7A\u9879\u7B54\u6848\u7684\u7A7A\u683C\u5904\u7406\u65B9\u5F0F",
style: {
marginTop: 30
},
name: ['hack', 'submit_rule'],
labelCol: {
span: 24
},
rules: [{
required: true,
message: '请选择编程语言'
}],
children: /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_10__.jsxs)(antd__WEBPACK_IMPORTED_MODULE_18__/* ["default"].Group */ .ZP.Group, {
children: [/*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_10__.jsx)(antd__WEBPACK_IMPORTED_MODULE_18__/* ["default"] */ .ZP, {
value: 0,
children: "\u4E0D\u5FFD\u7565\u7A7A\u683C"
}), /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_10__.jsx)(antd__WEBPACK_IMPORTED_MODULE_18__/* ["default"] */ .ZP, {
value: 1,
children: "\u5FFD\u7565\u9996\u5C3E\u7A7A\u683C"
}), /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_10__.jsx)(antd__WEBPACK_IMPORTED_MODULE_18__/* ["default"] */ .ZP, {
value: 2,
children: "\u5FFD\u7565\u6240\u6709\u7A7A\u683C"
})]
})
}), /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_10__.jsxs)(antd__WEBPACK_IMPORTED_MODULE_14__/* ["default"] */ .Z, {
align: "middle",
style: {
marginTop: 30
},
children: [/*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_10__.jsx)(antd__WEBPACK_IMPORTED_MODULE_13__/* ["default"] */ .Z.Item, {
name: ['hack', 'allow_student_debug'],
children: /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_10__.jsx)(ReversedSwitch, {})
}), /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_10__.jsx)(antd__WEBPACK_IMPORTED_MODULE_15__/* ["default"] */ .Z, {
className: "ml10",
children: "\u5141\u8BB8\u5B66\u751F\u7B54\u9898\u65F6\u8FDB\u884C\u4EE3\u7801\u8C03\u8BD5"
})]
}), /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_10__.jsx)(antd__WEBPACK_IMPORTED_MODULE_13__/* ["default"] */ .Z.Item, {
label: "\u6D4B\u8BD5\u7528\u4F8B",
required: true
}), /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_10__.jsxs)("div", {
style: {
background: '#F6F7F9',
padding: 15
},
children: [/*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_10__.jsx)(antd__WEBPACK_IMPORTED_MODULE_13__/* ["default"] */ .Z.Item, {
label: "\u8F93\u5165",
labelCol: {
span: 24
},
name: ['hack_sets', 'input'],
children: /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_10__.jsx)(TextArea, {
rows: 4
})
}), /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_10__.jsx)(antd__WEBPACK_IMPORTED_MODULE_13__/* ["default"] */ .Z.Item, {
label: "\u8F93\u51FA",
labelCol: {
span: 24
},
name: ['hack_sets', 'output'],
rules: [{
required: true,
message: '请输入输出内容'
}],
children: /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_10__.jsx)(TextArea, {
rows: 4
})
})]
}), /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_10__.jsx)(_Buttonloading__WEBPACK_IMPORTED_MODULE_9__/* ["default"] */ .Z, {
answerKey: answerKey,
hackidentifier: hackidentifier,
ButtonText: '自测运行',
ButtonProps: {
ghost: true,
icon: /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_10__.jsx)("i", {
className: "iconfont icon-ceshi"
}),
style: {
background: 'rgba(55,173,131,0.05)',
borderRadius: 19,
border: '1px solid #37AD83',
width: 116,
height: 38,
display: 'inline-flex',
fontSize: 14,
alignItems: 'center',
justifyContent: 'center',
marginTop: 20,
cursor: 'pointer',
color: '#37AD83'
}
},
form: form
})]
});
};
/***/ }),
/***/ 1949:
/*!*********************************************************!*\
!*** ./src/components/QuestionEditor/Buttonloading.tsx ***!
\*********************************************************/
/***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) {
/* harmony import */ var _root_workspace_ppte5yg23_SJ5m_develop_node_modules_babel_runtime_7_23_2_babel_runtime_helpers_objectSpread2_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./node_modules/_@babel_runtime@7.23.2@@babel/runtime/helpers/objectSpread2.js */ 26801);
/* harmony import */ var _root_workspace_ppte5yg23_SJ5m_develop_node_modules_babel_runtime_7_23_2_babel_runtime_helpers_objectSpread2_js__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_root_workspace_ppte5yg23_SJ5m_develop_node_modules_babel_runtime_7_23_2_babel_runtime_helpers_objectSpread2_js__WEBPACK_IMPORTED_MODULE_0__);
/* harmony import */ var _root_workspace_ppte5yg23_SJ5m_develop_node_modules_babel_runtime_7_23_2_babel_runtime_helpers_regeneratorRuntime_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./node_modules/_@babel_runtime@7.23.2@@babel/runtime/helpers/regeneratorRuntime.js */ 10574);
/* harmony import */ var _root_workspace_ppte5yg23_SJ5m_develop_node_modules_babel_runtime_7_23_2_babel_runtime_helpers_regeneratorRuntime_js__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_root_workspace_ppte5yg23_SJ5m_develop_node_modules_babel_runtime_7_23_2_babel_runtime_helpers_regeneratorRuntime_js__WEBPACK_IMPORTED_MODULE_1__);
/* harmony import */ var _root_workspace_ppte5yg23_SJ5m_develop_node_modules_babel_runtime_7_23_2_babel_runtime_helpers_asyncToGenerator_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./node_modules/_@babel_runtime@7.23.2@@babel/runtime/helpers/asyncToGenerator.js */ 39343);
/* harmony import */ var _root_workspace_ppte5yg23_SJ5m_develop_node_modules_babel_runtime_7_23_2_babel_runtime_helpers_asyncToGenerator_js__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(_root_workspace_ppte5yg23_SJ5m_develop_node_modules_babel_runtime_7_23_2_babel_runtime_helpers_asyncToGenerator_js__WEBPACK_IMPORTED_MODULE_2__);
/* harmony import */ var _root_workspace_ppte5yg23_SJ5m_develop_node_modules_babel_runtime_7_23_2_babel_runtime_helpers_slicedToArray_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./node_modules/_@babel_runtime@7.23.2@@babel/runtime/helpers/slicedToArray.js */ 11006);
/* harmony import */ var _root_workspace_ppte5yg23_SJ5m_develop_node_modules_babel_runtime_7_23_2_babel_runtime_helpers_slicedToArray_js__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__webpack_require__.n(_root_workspace_ppte5yg23_SJ5m_develop_node_modules_babel_runtime_7_23_2_babel_runtime_helpers_slicedToArray_js__WEBPACK_IMPORTED_MODULE_3__);
/* harmony import */ var umi__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! umi */ 66660);
/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! react */ 59301);
/* harmony import */ var antd__WEBPACK_IMPORTED_MODULE_12__ = __webpack_require__(/*! antd */ 8591);
/* harmony import */ var antd__WEBPACK_IMPORTED_MODULE_13__ = __webpack_require__(/*! antd */ 3113);
/* harmony import */ var antd__WEBPACK_IMPORTED_MODULE_14__ = __webpack_require__(/*! antd */ 43418);
/* harmony import */ var js_base64__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! js-base64 */ 24334);
/* harmony import */ var js_base64__WEBPACK_IMPORTED_MODULE_6___default = /*#__PURE__*/__webpack_require__.n(js_base64__WEBPACK_IMPORTED_MODULE_6__);
/* harmony import */ var _utils_fetch__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! @/utils/fetch */ 97174);
/* harmony import */ var _pages_MyProblem_service__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! @/pages/MyProblem/service */ 1106);
/* harmony import */ var _pages_MyProblem_TestCasePanel__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! @/pages/MyProblem/TestCasePanel */ 75051);
/* harmony import */ var moment__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(/*! moment */ 9498);
/* harmony import */ var moment__WEBPACK_IMPORTED_MODULE_10___default = /*#__PURE__*/__webpack_require__.n(moment__WEBPACK_IMPORTED_MODULE_10__);
/* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_11__ = __webpack_require__(/*! react/jsx-runtime */ 37712);
/**
* @description: 自测运行
* @param {*}
* ButtonProps:按钮部分样式等参数
* ButtonText 按钮文字
* form 表单内容
* answerKey 填空字段
* items 为运行调试字段
* @return {*}
*/
var ButtonLoading = function ButtonLoading(_ref) {
var ButtonProps = _ref.ButtonProps,
ButtonText = _ref.ButtonText,
form = _ref.form,
answerKey = _ref.answerKey,
_ref$hackidentifier = _ref.hackidentifier,
hackidentifier = _ref$hackidentifier === void 0 ? "" : _ref$hackidentifier,
_ref$items = _ref.items,
items = _ref$items === void 0 ? {} : _ref$items;
var _useState = (0,react__WEBPACK_IMPORTED_MODULE_5__.useState)(false),
_useState2 = _root_workspace_ppte5yg23_SJ5m_develop_node_modules_babel_runtime_7_23_2_babel_runtime_helpers_slicedToArray_js__WEBPACK_IMPORTED_MODULE_3___default()(_useState, 2),
isloading = _useState2[0],
setisloading = _useState2[1];
var _useState3 = (0,react__WEBPACK_IMPORTED_MODULE_5__.useState)(''),
_useState4 = _root_workspace_ppte5yg23_SJ5m_develop_node_modules_babel_runtime_7_23_2_babel_runtime_helpers_slicedToArray_js__WEBPACK_IMPORTED_MODULE_3___default()(_useState3, 2),
identifier = _useState4[0],
setidentifier = _useState4[1];
var param = (0,umi__WEBPACK_IMPORTED_MODULE_4__.useParams)();
var _useState5 = (0,react__WEBPACK_IMPORTED_MODULE_5__.useState)({}),
_useState6 = _root_workspace_ppte5yg23_SJ5m_develop_node_modules_babel_runtime_7_23_2_babel_runtime_helpers_slicedToArray_js__WEBPACK_IMPORTED_MODULE_3___default()(_useState5, 2),
modalshow = _useState6[0],
setmodalshow = _useState6[1];
var isEdit = param.type === 'edit';
var type = window.location.href.includes('problemset') ? 1 : 2;
(0,react__WEBPACK_IMPORTED_MODULE_5__.useEffect)(function () {
if (isEdit || hackidentifier) {
setidentifier(hackidentifier || param.id);
}
}, [param]);
(0,react__WEBPACK_IMPORTED_MODULE_5__.useEffect)(function () {
return function () {
sessionStorage.removeItem("projectFill");
};
}, []);
function onUpdateCode(_x, _x2) {
return _onUpdateCode.apply(this, arguments);
}
function _onUpdateCode() {
_onUpdateCode = _root_workspace_ppte5yg23_SJ5m_develop_node_modules_babel_runtime_7_23_2_babel_runtime_helpers_asyncToGenerator_js__WEBPACK_IMPORTED_MODULE_2___default()( /*#__PURE__*/_root_workspace_ppte5yg23_SJ5m_develop_node_modules_babel_runtime_7_23_2_babel_runtime_helpers_regeneratorRuntime_js__WEBPACK_IMPORTED_MODULE_1___default()().mark(function _callee4(re, id) {
var _stats$filter;
var code, stats, codes, response;
return _root_workspace_ppte5yg23_SJ5m_develop_node_modules_babel_runtime_7_23_2_babel_runtime_helpers_regeneratorRuntime_js__WEBPACK_IMPORTED_MODULE_1___default()().wrap(function _callee4$(_context4) {
while (1) switch (_context4.prev = _context4.next) {
case 0:
code = form.getFieldValue("hack_codes");
stats = form.getFieldValue(answerKey);
if (code.code) {
_context4.next = 5;
break;
}
antd__WEBPACK_IMPORTED_MODULE_12__/* ["default"] */ .ZP.info('程序代码不能为空!');
return _context4.abrupt("return");
case 5:
if (code.language) {
_context4.next = 8;
break;
}
antd__WEBPACK_IMPORTED_MODULE_12__/* ["default"] */ .ZP.info('编程语言不能为空!');
return _context4.abrupt("return");
case 8:
if (!(stats.length > 0 && ((_stats$filter = stats.filter(function (item) {
return !item.answer_text;
})) === null || _stats$filter === void 0 ? void 0 : _stats$filter.length) > 0)) {
_context4.next = 11;
break;
}
antd__WEBPACK_IMPORTED_MODULE_12__/* ["default"] */ .ZP.info('填空项不能为空!');
return _context4.abrupt("return");
case 11:
codes = code.code;
if (stats.length > 0) {
stats === null || stats === void 0 || stats.map(function (item) {
if (item.multi_line) {
codes = codes.substring(0, codes.indexOf('@▁▁@')) + item.answer_text + codes.substring(codes.indexOf('@▁▁@') + 4);
} else {
codes = codes.substring(0, codes.indexOf('@▁@')) + item.answer_text + codes.substring(codes.indexOf('@▁@') + 3);
}
});
}
_context4.next = 15;
return (0,_pages_MyProblem_service__WEBPACK_IMPORTED_MODULE_8__/* .updateCode */ .n4)(id, re ? re : {
code: js_base64__WEBPACK_IMPORTED_MODULE_6__.Base64.encode(codes),
language: code.language
});
case 15:
response = _context4.sent;
return _context4.abrupt("return", response);
case 17:
case "end":
return _context4.stop();
}
}, _callee4);
}));
return _onUpdateCode.apply(this, arguments);
}
function onUpdateCodes(_x3, _x4) {
return _onUpdateCodes.apply(this, arguments);
}
function _onUpdateCodes() {
_onUpdateCodes = _root_workspace_ppte5yg23_SJ5m_develop_node_modules_babel_runtime_7_23_2_babel_runtime_helpers_asyncToGenerator_js__WEBPACK_IMPORTED_MODULE_2___default()( /*#__PURE__*/_root_workspace_ppte5yg23_SJ5m_develop_node_modules_babel_runtime_7_23_2_babel_runtime_helpers_regeneratorRuntime_js__WEBPACK_IMPORTED_MODULE_1___default()().mark(function _callee5(re, id) {
var _stats$filter2;
var stats, codes, response;
return _root_workspace_ppte5yg23_SJ5m_develop_node_modules_babel_runtime_7_23_2_babel_runtime_helpers_regeneratorRuntime_js__WEBPACK_IMPORTED_MODULE_1___default()().wrap(function _callee5$(_context5) {
while (1) switch (_context5.prev = _context5.next) {
case 0:
stats = items.userAnswer;
codes = js_base64__WEBPACK_IMPORTED_MODULE_6__.Base64.decode(items.code);
if (!(stats.length > 0 && ((_stats$filter2 = stats.filter(function (item) {
return !item.value;
})) === null || _stats$filter2 === void 0 ? void 0 : _stats$filter2.length) > 0)) {
_context5.next = 5;
break;
}
antd__WEBPACK_IMPORTED_MODULE_12__/* ["default"] */ .ZP.info('填空项不能为空!');
return _context5.abrupt("return");
case 5:
if (stats.length > 0) {
stats === null || stats === void 0 || stats.map(function (item) {
if (item.multi_line) {
codes = codes.substring(0, codes.indexOf('@▁▁@')) + item.value + codes.substring(codes.indexOf('@▁▁@') + 4);
} else {
codes = codes.substring(0, codes.indexOf('@▁@')) + item.value + codes.substring(codes.indexOf('@▁@') + 3);
}
});
}
_context5.next = 8;
return (0,_pages_MyProblem_service__WEBPACK_IMPORTED_MODULE_8__/* .updateCode */ .n4)(id, re ? re : {
code: js_base64__WEBPACK_IMPORTED_MODULE_6__.Base64.encode(codes),
language: items.language
});
case 8:
response = _context5.sent;
return _context5.abrupt("return", response);
case 10:
case "end":
return _context5.stop();
}
}, _callee5);
}));
return _onUpdateCodes.apply(this, arguments);
}
function getTimeStamp() {
return new Date().getTime();
}
return /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_11__.jsxs)("div", {
children: [/*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_11__.jsx)(antd__WEBPACK_IMPORTED_MODULE_13__/* ["default"] */ .ZP, _root_workspace_ppte5yg23_SJ5m_develop_node_modules_babel_runtime_7_23_2_babel_runtime_helpers_objectSpread2_js__WEBPACK_IMPORTED_MODULE_0___default()(_root_workspace_ppte5yg23_SJ5m_develop_node_modules_babel_runtime_7_23_2_babel_runtime_helpers_objectSpread2_js__WEBPACK_IMPORTED_MODULE_0___default()({
loading: isloading
}, ButtonProps), {}, {
onClick: /*#__PURE__*/_root_workspace_ppte5yg23_SJ5m_develop_node_modules_babel_runtime_7_23_2_babel_runtime_helpers_asyncToGenerator_js__WEBPACK_IMPORTED_MODULE_2___default()( /*#__PURE__*/_root_workspace_ppte5yg23_SJ5m_develop_node_modules_babel_runtime_7_23_2_babel_runtime_helpers_regeneratorRuntime_js__WEBPACK_IMPORTED_MODULE_1___default()().mark(function _callee3() {
var _res, _response, executeCode, startTime, aa, res, formValues, _formValues$hack, _res2, _formValues$hack2, res1, response, _executeCode, _startTime;
return _root_workspace_ppte5yg23_SJ5m_develop_node_modules_babel_runtime_7_23_2_babel_runtime_helpers_regeneratorRuntime_js__WEBPACK_IMPORTED_MODULE_1___default()().wrap(function _callee3$(_context3) {
while (1) switch (_context3.prev = _context3.next) {
case 0:
if (!(ButtonText === '运行调试')) {
_context3.next = 20;
break;
}
setisloading(true);
if (!isloading) {
_context3.next = 4;
break;
}
return _context3.abrupt("return");
case 4:
_context3.next = 6;
return (0,_utils_fetch__WEBPACK_IMPORTED_MODULE_7__/* ["default"] */ .ZP)("/api/problems/".concat(identifier, "/start.json"), {
method: 'get'
});
case 6:
_res = _context3.sent;
_context3.next = 9;
return onUpdateCodes(null, _res === null || _res === void 0 ? void 0 : _res.identifier);
case 9:
_response = _context3.sent;
if (!((_response === null || _response === void 0 ? void 0 : _response.status) === 0)) {
_context3.next = 18;
break;
}
executeCode = /*#__PURE__*/function () {
var _ref3 = _root_workspace_ppte5yg23_SJ5m_develop_node_modules_babel_runtime_7_23_2_babel_runtime_helpers_asyncToGenerator_js__WEBPACK_IMPORTED_MODULE_2___default()( /*#__PURE__*/_root_workspace_ppte5yg23_SJ5m_develop_node_modules_babel_runtime_7_23_2_babel_runtime_helpers_regeneratorRuntime_js__WEBPACK_IMPORTED_MODULE_1___default()().mark(function _callee() {
var _yield$getOperationRe, status, message, data, executeTime, isTimeOut;
return _root_workspace_ppte5yg23_SJ5m_develop_node_modules_babel_runtime_7_23_2_babel_runtime_helpers_regeneratorRuntime_js__WEBPACK_IMPORTED_MODULE_1___default()().wrap(function _callee$(_context) {
while (1) switch (_context.prev = _context.next) {
case 0:
_context.next = 2;
return (0,_pages_MyProblem_service__WEBPACK_IMPORTED_MODULE_8__/* .getOperationResult */ .rX)(_res === null || _res === void 0 ? void 0 : _res.identifier, 'submit');
case 2:
_yield$getOperationRe = _context.sent;
status = _yield$getOperationRe.status;
message = _yield$getOperationRe.message;
data = _yield$getOperationRe.data;
executeTime = getTimeStamp();
isTimeOut = executeTime - startTime > 6 * 1000;
if (status !== 0 && !isTimeOut) {
setTimeout(executeCode, 1000);
}
if (!isTimeOut) {
_context.next = 13;
break;
}
antd__WEBPACK_IMPORTED_MODULE_14__/* ["default"] */ .Z.error({
centered: true,
okText: '知道啦',
title: '调试代码超时'
});
setisloading(false);
return _context.abrupt("return");
case 13:
if (status === 0) {
setisloading(false);
// let datas = await Fetch(`/api/myproblems/record_detail.json`, {
// method: 'GET',
// params: {
// id: data?.id
// }
// })
setmodalshow(data);
if (data.status === 2) {
setisloading(false);
antd__WEBPACK_IMPORTED_MODULE_14__/* ["default"] */ .Z.error({
centered: true,
okText: '知道啦',
title: '调试代码超时'
});
}
}
case 14:
case "end":
return _context.stop();
}
}, _callee);
}));
return function executeCode() {
return _ref3.apply(this, arguments);
};
}();
startTime = getTimeStamp();
_context3.next = 15;
return (0,_pages_MyProblem_service__WEBPACK_IMPORTED_MODULE_8__/* .sumbitCode */ .bM)(_res === null || _res === void 0 ? void 0 : _res.identifier, {});
case 15:
executeCode();
_context3.next = 19;
break;
case 18:
setisloading(false);
case 19:
return _context3.abrupt("return");
case 20:
aa = true;
_context3.next = 23;
return form.validateFields().then(function () {
aa = false;
}, function (errInfo) {
var _errInfo$errorFields, _errInfo$errorFields2;
if (errInfo.errorFields[0].name.includes("standard_answers")) {
antd__WEBPACK_IMPORTED_MODULE_12__/* ["default"] */ .ZP.error("填空项答案不能为空");
} else {
antd__WEBPACK_IMPORTED_MODULE_12__/* ["default"] */ .ZP.error(errInfo.errorFields[0].errors[0]);
}
if (((_errInfo$errorFields = errInfo.errorFields) === null || _errInfo$errorFields === void 0 ? void 0 : _errInfo$errorFields.length) === 0) {
aa = false;
}
form.scrollToField(errInfo === null || errInfo === void 0 || (_errInfo$errorFields2 = errInfo.errorFields) === null || _errInfo$errorFields2 === void 0 || (_errInfo$errorFields2 = _errInfo$errorFields2[0]) === null || _errInfo$errorFields2 === void 0 ? void 0 : _errInfo$errorFields2.name, {
behavior: 'smooth',
block: 'center'
});
aa = true;
});
case 23:
if (!aa) {
_context3.next = 25;
break;
}
return _context3.abrupt("return");
case 25:
setisloading(true);
if (!isloading) {
_context3.next = 28;
break;
}
return _context3.abrupt("return");
case 28:
res = '';
formValues = form.getFieldsValue();
if (identifier) {
_context3.next = 39;
break;
}
_context3.next = 33;
return (0,_utils_fetch__WEBPACK_IMPORTED_MODULE_7__/* ["default"] */ .ZP)("/api/problems.json", {
method: 'post',
body: _root_workspace_ppte5yg23_SJ5m_develop_node_modules_babel_runtime_7_23_2_babel_runtime_helpers_objectSpread2_js__WEBPACK_IMPORTED_MODULE_0___default()(_root_workspace_ppte5yg23_SJ5m_develop_node_modules_babel_runtime_7_23_2_babel_runtime_helpers_objectSpread2_js__WEBPACK_IMPORTED_MODULE_0___default()({}, formValues), {}, {
hack: _root_workspace_ppte5yg23_SJ5m_develop_node_modules_babel_runtime_7_23_2_babel_runtime_helpers_objectSpread2_js__WEBPACK_IMPORTED_MODULE_0___default()(_root_workspace_ppte5yg23_SJ5m_develop_node_modules_babel_runtime_7_23_2_babel_runtime_helpers_objectSpread2_js__WEBPACK_IMPORTED_MODULE_0___default()({}, formValues === null || formValues === void 0 ? void 0 : formValues.hack), {}, {
sub_discipline_id: formValues === null || formValues === void 0 || (_formValues$hack = formValues.hack) === null || _formValues$hack === void 0 || (_formValues$hack = _formValues$hack.sub_discipline_id) === null || _formValues$hack === void 0 ? void 0 : _formValues$hack[1],
difficult: formValues.difficulty,
item_banks_group_id: formValues.item_banks_group_id
}),
hack_codes: _root_workspace_ppte5yg23_SJ5m_develop_node_modules_babel_runtime_7_23_2_babel_runtime_helpers_objectSpread2_js__WEBPACK_IMPORTED_MODULE_0___default()(_root_workspace_ppte5yg23_SJ5m_develop_node_modules_babel_runtime_7_23_2_babel_runtime_helpers_objectSpread2_js__WEBPACK_IMPORTED_MODULE_0___default()({}, formValues.hack_codes), {}, {
code: js_base64__WEBPACK_IMPORTED_MODULE_6__.Base64.encode(formValues.hack_codes.code)
}),
hack_sets: [_root_workspace_ppte5yg23_SJ5m_develop_node_modules_babel_runtime_7_23_2_babel_runtime_helpers_objectSpread2_js__WEBPACK_IMPORTED_MODULE_0___default()({}, formValues.hack_sets)],
is_blank: true
})
});
case 33:
res = _context3.sent;
identifier = (_res2 = res) === null || _res2 === void 0 ? void 0 : _res2.identifier;
sessionStorage.projectFill = identifier;
setidentifier(identifier);
_context3.next = 42;
break;
case 39:
_context3.next = 41;
return (0,_utils_fetch__WEBPACK_IMPORTED_MODULE_7__/* ["default"] */ .ZP)("/api/problems/".concat(identifier, ".json"), {
method: 'put',
body: _root_workspace_ppte5yg23_SJ5m_develop_node_modules_babel_runtime_7_23_2_babel_runtime_helpers_objectSpread2_js__WEBPACK_IMPORTED_MODULE_0___default()(_root_workspace_ppte5yg23_SJ5m_develop_node_modules_babel_runtime_7_23_2_babel_runtime_helpers_objectSpread2_js__WEBPACK_IMPORTED_MODULE_0___default()({}, formValues), {}, {
hack: _root_workspace_ppte5yg23_SJ5m_develop_node_modules_babel_runtime_7_23_2_babel_runtime_helpers_objectSpread2_js__WEBPACK_IMPORTED_MODULE_0___default()(_root_workspace_ppte5yg23_SJ5m_develop_node_modules_babel_runtime_7_23_2_babel_runtime_helpers_objectSpread2_js__WEBPACK_IMPORTED_MODULE_0___default()({}, formValues === null || formValues === void 0 ? void 0 : formValues.hack), {}, {
sub_discipline_id: formValues === null || formValues === void 0 || (_formValues$hack2 = formValues.hack) === null || _formValues$hack2 === void 0 || (_formValues$hack2 = _formValues$hack2.sub_discipline_id) === null || _formValues$hack2 === void 0 ? void 0 : _formValues$hack2[1],
difficult: formValues.difficulty,
item_banks_group_id: formValues.item_banks_group_id
}),
hack_codes: _root_workspace_ppte5yg23_SJ5m_develop_node_modules_babel_runtime_7_23_2_babel_runtime_helpers_objectSpread2_js__WEBPACK_IMPORTED_MODULE_0___default()(_root_workspace_ppte5yg23_SJ5m_develop_node_modules_babel_runtime_7_23_2_babel_runtime_helpers_objectSpread2_js__WEBPACK_IMPORTED_MODULE_0___default()({}, formValues.hack_codes), {}, {
code: js_base64__WEBPACK_IMPORTED_MODULE_6__.Base64.encode(formValues.hack_codes.code)
}),
update_hack_sets: [_root_workspace_ppte5yg23_SJ5m_develop_node_modules_babel_runtime_7_23_2_babel_runtime_helpers_objectSpread2_js__WEBPACK_IMPORTED_MODULE_0___default()({}, formValues.hack_sets)],
is_blank: true
})
});
case 41:
res = _context3.sent;
case 42:
_context3.next = 44;
return (0,_utils_fetch__WEBPACK_IMPORTED_MODULE_7__/* ["default"] */ .ZP)("/api/problems/".concat(identifier, "/start.json"), {
method: 'get'
});
case 44:
res1 = _context3.sent;
_context3.next = 47;
return onUpdateCode(null, res1 === null || res1 === void 0 ? void 0 : res1.identifier);
case 47:
response = _context3.sent;
if (!((response === null || response === void 0 ? void 0 : response.status) === 0)) {
_context3.next = 56;
break;
}
_executeCode = /*#__PURE__*/function () {
var _ref4 = _root_workspace_ppte5yg23_SJ5m_develop_node_modules_babel_runtime_7_23_2_babel_runtime_helpers_asyncToGenerator_js__WEBPACK_IMPORTED_MODULE_2___default()( /*#__PURE__*/_root_workspace_ppte5yg23_SJ5m_develop_node_modules_babel_runtime_7_23_2_babel_runtime_helpers_regeneratorRuntime_js__WEBPACK_IMPORTED_MODULE_1___default()().mark(function _callee2() {
var _yield$getOperationRe2, status, message, data, executeTime, isTimeOut;
return _root_workspace_ppte5yg23_SJ5m_develop_node_modules_babel_runtime_7_23_2_babel_runtime_helpers_regeneratorRuntime_js__WEBPACK_IMPORTED_MODULE_1___default()().wrap(function _callee2$(_context2) {
while (1) switch (_context2.prev = _context2.next) {
case 0:
_context2.next = 2;
return (0,_pages_MyProblem_service__WEBPACK_IMPORTED_MODULE_8__/* .getOperationResult */ .rX)(res1 === null || res1 === void 0 ? void 0 : res1.identifier, 'submit');
case 2:
_yield$getOperationRe2 = _context2.sent;
status = _yield$getOperationRe2.status;
message = _yield$getOperationRe2.message;
data = _yield$getOperationRe2.data;
executeTime = getTimeStamp();
isTimeOut = executeTime - _startTime > (formValues.hack.time_limit + 3) * 1000;
if (status !== 0 && !isTimeOut) {
setTimeout(_executeCode, 1000);
}
if (!isTimeOut) {
_context2.next = 13;
break;
}
antd__WEBPACK_IMPORTED_MODULE_14__/* ["default"] */ .Z.error({
centered: true,
okText: '知道啦',
title: '调试代码超时'
});
setisloading(false);
return _context2.abrupt("return");
case 13:
if (status === 0) {
setisloading(false);
setmodalshow(data);
if (data.status === 2) {
setisloading(false);
antd__WEBPACK_IMPORTED_MODULE_14__/* ["default"] */ .Z.error({
centered: true,
okText: '知道啦',
title: '调试代码超时'
});
}
}
case 14:
case "end":
return _context2.stop();
}
}, _callee2);
}));
return function _executeCode() {
return _ref4.apply(this, arguments);
};
}();
_startTime = getTimeStamp();
_context3.next = 53;
return (0,_pages_MyProblem_service__WEBPACK_IMPORTED_MODULE_8__/* .sumbitCode */ .bM)(res1 === null || res1 === void 0 ? void 0 : res1.identifier, {});
case 53:
_executeCode();
_context3.next = 57;
break;
case 56:
setisloading(false);
case 57:
case "end":
return _context3.stop();
}
}, _callee3);
})),
children: ButtonText
})), (modalshow === null || modalshow === void 0 ? void 0 : modalshow.id) && modalshow.status !== 2 && /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_11__.jsx)(antd__WEBPACK_IMPORTED_MODULE_14__/* ["default"] */ .Z, {
open: (modalshow === null || modalshow === void 0 ? void 0 : modalshow.id) && modalshow.status !== 2,
title: "\u8FD0\u884C\u7ED3\u679C",
width: 1100,
footer: false,
onOk: function onOk() {
setmodalshow({});
},
onCancel: function onCancel() {
setmodalshow({});
},
children: /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_11__.jsxs)("div", {
style: {
maxHeight: 600,
overflow: 'auto',
marginBottom: 15
},
children: [/*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_11__.jsxs)("div", {
style: {
marginBottom: 20,
display: 'flex',
justifyContent: 'space-between',
fontSize: 14
},
children: [/*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_11__.jsxs)("div", {
children: [/*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_11__.jsx)("span", {
style: {
color: '#666666'
},
children: "\u72B6\u6001"
}), /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_11__.jsx)("span", {
style: {
marginLeft: 12,
color: modalshow.status !== 0 && '#E30000'
},
children: _pages_MyProblem_TestCasePanel__WEBPACK_IMPORTED_MODULE_9__/* .ExecuteDict */ .Im[modalshow.status]
})]
}), /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_11__.jsxs)("div", {
children: [/*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_11__.jsx)("span", {
style: {
color: '#666666'
},
children: "\u63D0\u4EA4\u65F6\u95F4"
}), /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_11__.jsx)("span", {
style: {
marginLeft: 12
},
children: moment__WEBPACK_IMPORTED_MODULE_10___default()(modalshow.created_at).format('YYYY-MM-DD HH:mm:ss')
})]
}), /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_11__.jsxs)("div", {
children: [/*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_11__.jsx)("span", {
style: {
color: '#666666'
},
children: "\u8BED\u8A00"
}), /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_11__.jsx)("span", {
style: {
marginLeft: 12
},
children: modalshow.language
})]
}), /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_11__.jsxs)("div", {
children: [/*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_11__.jsx)("span", {
style: {
color: '#666666'
},
children: "\u6267\u884C\u7528\u65F6"
}), /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_11__.jsxs)("span", {
style: {
marginLeft: 12
},
children: [modalshow.execute_time, "ms"]
})]
})]
}), /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_11__.jsx)(_pages_MyProblem_TestCasePanel__WEBPACK_IMPORTED_MODULE_9__/* .DetailCommitOut */ .Y4, _root_workspace_ppte5yg23_SJ5m_develop_node_modules_babel_runtime_7_23_2_babel_runtime_helpers_objectSpread2_js__WEBPACK_IMPORTED_MODULE_0___default()({}, modalshow))]
})
})]
});
};
/* harmony default export */ __webpack_exports__.Z = (ButtonLoading);
/***/ }),
/***/ 56191:
/*!****************************************************************!*\
!*** ./src/components/QuestionEditor/ChoiceQuestionEditor.tsx ***!
\****************************************************************/
/***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) {
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */ u: function() { return /* binding */ ChoiceQuestionEditor; }
/* harmony export */ });
/* harmony import */ var _root_workspace_ppte5yg23_SJ5m_develop_node_modules_babel_runtime_7_23_2_babel_runtime_helpers_objectWithoutProperties_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./node_modules/_@babel_runtime@7.23.2@@babel/runtime/helpers/objectWithoutProperties.js */ 27161);
/* harmony import */ var _root_workspace_ppte5yg23_SJ5m_develop_node_modules_babel_runtime_7_23_2_babel_runtime_helpers_objectWithoutProperties_js__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_root_workspace_ppte5yg23_SJ5m_develop_node_modules_babel_runtime_7_23_2_babel_runtime_helpers_objectWithoutProperties_js__WEBPACK_IMPORTED_MODULE_0__);
/* harmony import */ var _root_workspace_ppte5yg23_SJ5m_develop_node_modules_babel_runtime_7_23_2_babel_runtime_helpers_slicedToArray_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./node_modules/_@babel_runtime@7.23.2@@babel/runtime/helpers/slicedToArray.js */ 11006);
/* harmony import */ var _root_workspace_ppte5yg23_SJ5m_develop_node_modules_babel_runtime_7_23_2_babel_runtime_helpers_slicedToArray_js__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_root_workspace_ppte5yg23_SJ5m_develop_node_modules_babel_runtime_7_23_2_babel_runtime_helpers_slicedToArray_js__WEBPACK_IMPORTED_MODULE_1__);
/* harmony import */ var _root_workspace_ppte5yg23_SJ5m_develop_node_modules_babel_runtime_7_23_2_babel_runtime_helpers_defineProperty_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./node_modules/_@babel_runtime@7.23.2@@babel/runtime/helpers/defineProperty.js */ 22060);
/* harmony import */ var _root_workspace_ppte5yg23_SJ5m_develop_node_modules_babel_runtime_7_23_2_babel_runtime_helpers_defineProperty_js__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(_root_workspace_ppte5yg23_SJ5m_develop_node_modules_babel_runtime_7_23_2_babel_runtime_helpers_defineProperty_js__WEBPACK_IMPORTED_MODULE_2__);
/* harmony import */ var _root_workspace_ppte5yg23_SJ5m_develop_node_modules_babel_runtime_7_23_2_babel_runtime_helpers_objectSpread2_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./node_modules/_@babel_runtime@7.23.2@@babel/runtime/helpers/objectSpread2.js */ 26801);
/* harmony import */ var _root_workspace_ppte5yg23_SJ5m_develop_node_modules_babel_runtime_7_23_2_babel_runtime_helpers_objectSpread2_js__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__webpack_require__.n(_root_workspace_ppte5yg23_SJ5m_develop_node_modules_babel_runtime_7_23_2_babel_runtime_helpers_objectSpread2_js__WEBPACK_IMPORTED_MODULE_3__);
/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! react */ 59301);
/* harmony import */ var antd__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! antd */ 95237);
/* harmony import */ var antd__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! antd */ 43604);
/* harmony import */ var antd__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(/*! antd */ 6848);
/* harmony import */ var antd__WEBPACK_IMPORTED_MODULE_13__ = __webpack_require__(/*! antd */ 78241);
/* harmony import */ var _index_less_modules__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ./index.less?modules */ 52398);
/* harmony import */ var _ant_design_icons__WEBPACK_IMPORTED_MODULE_11__ = __webpack_require__(/*! @ant-design/icons */ 71029);
/* harmony import */ var _ant_design_icons__WEBPACK_IMPORTED_MODULE_12__ = __webpack_require__(/*! @ant-design/icons */ 87306);
/* harmony import */ var _MdEditorInForm__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ./MdEditorInForm */ 61954);
/* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! react/jsx-runtime */ 37712);
var _excluded = ["key", "name"];
var tagList = ['A', 'B', 'C', 'D', 'E', 'F', 'G', 'H', 'I', 'J', 'K', 'L', 'M', 'N', 'O', 'P', 'Q', 'R', 'S', 'T', 'U', 'V', 'W', 'X', 'Y', 'Z'];
var ChoiceQuestionItem = function ChoiceQuestionItem(_ref) {
var value = _ref.value,
_onChange = _ref.onChange,
choiceTextKey = _ref.choiceTextKey,
answerKey = _ref.answerKey,
index = _ref.index,
isEdit = _ref.isEdit,
setInputActive = _ref.setInputActive,
form = _ref.form,
choiceOptionsPath = _ref.choiceOptionsPath,
allowChangeMode = _ref.allowChangeMode,
showAddIcon = _ref.showAddIcon,
addItem = _ref.addItem,
deleteItem = _ref.deleteItem;
var isActiveAnswer = (value === null || value === void 0 ? void 0 : value[answerKey]) === 1;
var setAllOptionsToFalse = function setAllOptionsToFalse() {
var options = form.getFieldValue(choiceOptionsPath);
form.setFieldValue(choiceOptionsPath, options.map(function (item) {
return _root_workspace_ppte5yg23_SJ5m_develop_node_modules_babel_runtime_7_23_2_babel_runtime_helpers_objectSpread2_js__WEBPACK_IMPORTED_MODULE_3___default()(_root_workspace_ppte5yg23_SJ5m_develop_node_modules_babel_runtime_7_23_2_babel_runtime_helpers_objectSpread2_js__WEBPACK_IMPORTED_MODULE_3___default()({}, item), {}, _root_workspace_ppte5yg23_SJ5m_develop_node_modules_babel_runtime_7_23_2_babel_runtime_helpers_defineProperty_js__WEBPACK_IMPORTED_MODULE_2___default()({}, answerKey, 0));
}));
};
var setActiveAnswer = function setActiveAnswer() {
if (isActiveAnswer) {
_onChange(_root_workspace_ppte5yg23_SJ5m_develop_node_modules_babel_runtime_7_23_2_babel_runtime_helpers_objectSpread2_js__WEBPACK_IMPORTED_MODULE_3___default()(_root_workspace_ppte5yg23_SJ5m_develop_node_modules_babel_runtime_7_23_2_babel_runtime_helpers_objectSpread2_js__WEBPACK_IMPORTED_MODULE_3___default()({}, value), {}, _root_workspace_ppte5yg23_SJ5m_develop_node_modules_babel_runtime_7_23_2_babel_runtime_helpers_defineProperty_js__WEBPACK_IMPORTED_MODULE_2___default()({}, answerKey, 0)));
} else {
if (!allowChangeMode) {
setAllOptionsToFalse();
}
_onChange(_root_workspace_ppte5yg23_SJ5m_develop_node_modules_babel_runtime_7_23_2_babel_runtime_helpers_objectSpread2_js__WEBPACK_IMPORTED_MODULE_3___default()(_root_workspace_ppte5yg23_SJ5m_develop_node_modules_babel_runtime_7_23_2_babel_runtime_helpers_objectSpread2_js__WEBPACK_IMPORTED_MODULE_3___default()({}, value), {}, _root_workspace_ppte5yg23_SJ5m_develop_node_modules_babel_runtime_7_23_2_babel_runtime_helpers_defineProperty_js__WEBPACK_IMPORTED_MODULE_2___default()({}, answerKey, 1)));
}
};
return /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_7__.jsxs)(antd__WEBPACK_IMPORTED_MODULE_8__/* ["default"] */ .Z, {
className: _index_less_modules__WEBPACK_IMPORTED_MODULE_5__/* ["default"] */ .Z.choiceWrap,
align: "middle",
wrap: false,
children: [/*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_7__.jsx)(antd__WEBPACK_IMPORTED_MODULE_9__/* ["default"] */ .Z, {
onClick: setActiveAnswer,
className: "".concat(_index_less_modules__WEBPACK_IMPORTED_MODULE_5__/* ["default"] */ .Z.choiceIndex, " ").concat(isActiveAnswer ? _index_less_modules__WEBPACK_IMPORTED_MODULE_5__/* ["default"] */ .Z.activeAnswer : ''),
children: tagList[index]
}), /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_7__.jsx)(antd__WEBPACK_IMPORTED_MODULE_9__/* ["default"] */ .Z, {
flex: 1,
className: "".concat(_index_less_modules__WEBPACK_IMPORTED_MODULE_5__/* ["default"] */ .Z.editorWrap, " ml15"),
onClick: setInputActive,
children: /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_7__.jsx)(_MdEditorInForm__WEBPACK_IMPORTED_MODULE_6__/* .RegularInput */ .x, {
height: 155,
placeholder: "\u8BF7\u60A8\u8F93\u5165\u9009\u9879",
isEdit: isEdit,
value: value === null || value === void 0 ? void 0 : value[choiceTextKey],
onChange: function onChange(v) {
_onChange(_root_workspace_ppte5yg23_SJ5m_develop_node_modules_babel_runtime_7_23_2_babel_runtime_helpers_objectSpread2_js__WEBPACK_IMPORTED_MODULE_3___default()(_root_workspace_ppte5yg23_SJ5m_develop_node_modules_babel_runtime_7_23_2_babel_runtime_helpers_objectSpread2_js__WEBPACK_IMPORTED_MODULE_3___default()({}, value), {}, _root_workspace_ppte5yg23_SJ5m_develop_node_modules_babel_runtime_7_23_2_babel_runtime_helpers_defineProperty_js__WEBPACK_IMPORTED_MODULE_2___default()({}, choiceTextKey, v)));
}
})
}), /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_7__.jsx)(antd__WEBPACK_IMPORTED_MODULE_9__/* ["default"] */ .Z, {
flex: '0 0 auto',
className: "ml15",
children: /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_7__.jsx)("div", {
onClick: setActiveAnswer,
className: "".concat(_index_less_modules__WEBPACK_IMPORTED_MODULE_5__/* ["default"] */ .Z.setAnswerBtn, " ").concat(isActiveAnswer ? _index_less_modules__WEBPACK_IMPORTED_MODULE_5__/* ["default"] */ .Z.activeAnswer : ''),
children: isActiveAnswer ? '正确答案' : '设为答案'
})
}), /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_7__.jsxs)(antd__WEBPACK_IMPORTED_MODULE_9__/* ["default"] */ .Z, {
className: _index_less_modules__WEBPACK_IMPORTED_MODULE_5__/* ["default"] */ .Z.actionWrapper,
children: [/*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_7__.jsx)(antd__WEBPACK_IMPORTED_MODULE_10__/* ["default"] */ .Z, {
title: "\u65B0\u589E\u53C2\u8003\u7B54\u6848",
children: /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_7__.jsx)(_ant_design_icons__WEBPACK_IMPORTED_MODULE_11__/* ["default"] */ .Z, {
className: _index_less_modules__WEBPACK_IMPORTED_MODULE_5__/* ["default"] */ .Z.addIcon,
onClick: addItem,
style: {
visibility: showAddIcon ? 'visible' : 'hidden'
}
})
}), /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_7__.jsx)(antd__WEBPACK_IMPORTED_MODULE_10__/* ["default"] */ .Z, {
title: "\u5220\u9664",
children: /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_7__.jsx)(_ant_design_icons__WEBPACK_IMPORTED_MODULE_12__/* ["default"] */ .Z, {
className: _index_less_modules__WEBPACK_IMPORTED_MODULE_5__/* ["default"] */ .Z.deleteIcon,
onClick: deleteItem,
style: {
visibility: index > 1 ? 'visible' : 'hidden'
}
})
})]
})]
});
};
var ChoiceQuestionEditor = function ChoiceQuestionEditor(_ref2) {
var questionTitlePlaceholder = _ref2.questionTitlePlaceholder,
titleKey = _ref2.titleKey,
choiceKey = _ref2.choiceKey,
analysisKey = _ref2.analysisKey,
choiceTextKey = _ref2.choiceTextKey,
answerKey = _ref2.answerKey,
choiceOptionsPath = _ref2.choiceOptionsPath,
_ref2$allowChangeMode = _ref2.allowChangeMode,
allowChangeMode = _ref2$allowChangeMode === void 0 ? true : _ref2$allowChangeMode,
form = _ref2.form,
_ref2$showAnalysis = _ref2.showAnalysis,
showAnalysis = _ref2$showAnalysis === void 0 ? true : _ref2$showAnalysis;
var _useState = (0,react__WEBPACK_IMPORTED_MODULE_4__.useState)(),
_useState2 = _root_workspace_ppte5yg23_SJ5m_develop_node_modules_babel_runtime_7_23_2_babel_runtime_helpers_slicedToArray_js__WEBPACK_IMPORTED_MODULE_1___default()(_useState, 2),
activeEditor = _useState2[0],
setActiveEditor = _useState2[1];
var _useState3 = (0,react__WEBPACK_IMPORTED_MODULE_4__.useState)(false),
_useState4 = _root_workspace_ppte5yg23_SJ5m_develop_node_modules_babel_runtime_7_23_2_babel_runtime_helpers_slicedToArray_js__WEBPACK_IMPORTED_MODULE_1___default()(_useState3, 2),
editAnalysis = _useState4[0],
setEditAnalysis = _useState4[1];
return /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_7__.jsxs)("div", {
className: _index_less_modules__WEBPACK_IMPORTED_MODULE_5__/* ["default"] */ .Z.wrap,
children: [/*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_7__.jsx)("div", {
className: _index_less_modules__WEBPACK_IMPORTED_MODULE_5__/* ["default"] */ .Z.questionTitleEditorWrap,
children: /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_7__.jsx)(antd__WEBPACK_IMPORTED_MODULE_13__/* ["default"] */ .Z.Item, {
label: "\u9898\u5E72",
name: titleKey,
labelCol: {
span: 24
},
rules: [{
required: true
}],
children: /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_7__.jsx)(_MdEditorInForm__WEBPACK_IMPORTED_MODULE_6__/* .MdEditorInForm */ .h, {
scrollId: Array.isArray(titleKey) ? titleKey.join('_') : "".concat(titleKey),
watch: true,
height: 140,
placeholder: questionTitlePlaceholder
})
})
}), /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_7__.jsx)(antd__WEBPACK_IMPORTED_MODULE_13__/* ["default"] */ .Z.Item, {
label: "\u7B54\u6848\u9009\u9879",
required: true,
labelCol: {
span: 24
}
}), /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_7__.jsx)(antd__WEBPACK_IMPORTED_MODULE_13__/* ["default"] */ .Z.List, {
name: choiceKey,
rules: [{
validator: function validator(rule, values) {
var hasAnswer = values.some(function (option) {
return option[answerKey] === 1;
});
var emptyAnswerIndex = values.findIndex(function (option) {
var _option$choiceTextKey;
return ((_option$choiceTextKey = option[choiceTextKey]) === null || _option$choiceTextKey === void 0 ? void 0 : _option$choiceTextKey.length) <= 0;
});
if (emptyAnswerIndex !== -1) {
return Promise.reject(new Error("\u8BF7\u5148\u8F93\u5165".concat(tagList[emptyAnswerIndex], "\u9009\u9879\u7684\u5185\u5BB9")));
}
if (!hasAnswer) {
return Promise.reject(new Error('请设置正确答案'));
}
return Promise.resolve();
}
}],
children: function children(fields, _ref3) {
var add = _ref3.add,
remove = _ref3.remove;
return /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_7__.jsxs)("div", {
id: Array.isArray(choiceOptionsPath) ? choiceOptionsPath.join('_') : "".concat(choiceOptionsPath),
children: [fields.map(function (_ref4, index) {
var key = _ref4.key,
name = _ref4.name,
restField = _root_workspace_ppte5yg23_SJ5m_develop_node_modules_babel_runtime_7_23_2_babel_runtime_helpers_objectWithoutProperties_js__WEBPACK_IMPORTED_MODULE_0___default()(_ref4, _excluded);
var isEdit = activeEditor === key;
var setInputActive = function setInputActive() {
setActiveEditor(key);
};
var showAddIcon = index < 7 && index === fields.length - 1;
var addItem = function addItem() {
var _add;
return add((_add = {}, _root_workspace_ppte5yg23_SJ5m_develop_node_modules_babel_runtime_7_23_2_babel_runtime_helpers_defineProperty_js__WEBPACK_IMPORTED_MODULE_2___default()(_add, choiceTextKey, ''), _root_workspace_ppte5yg23_SJ5m_develop_node_modules_babel_runtime_7_23_2_babel_runtime_helpers_defineProperty_js__WEBPACK_IMPORTED_MODULE_2___default()(_add, answerKey, 0), _add));
};
var deleteItem = function deleteItem() {
return remove(name);
};
return /*#__PURE__*/(0,react__WEBPACK_IMPORTED_MODULE_4__.createElement)(antd__WEBPACK_IMPORTED_MODULE_13__/* ["default"] */ .Z.Item, _root_workspace_ppte5yg23_SJ5m_develop_node_modules_babel_runtime_7_23_2_babel_runtime_helpers_objectSpread2_js__WEBPACK_IMPORTED_MODULE_3___default()(_root_workspace_ppte5yg23_SJ5m_develop_node_modules_babel_runtime_7_23_2_babel_runtime_helpers_objectSpread2_js__WEBPACK_IMPORTED_MODULE_3___default()({}, restField), {}, {
key: key,
name: name,
noStyle: true
}), /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_7__.jsx)(ChoiceQuestionItem, {
choiceTextKey: choiceTextKey,
answerKey: answerKey,
index: index,
isEdit: isEdit,
setInputActive: setInputActive,
form: form,
choiceOptionsPath: choiceOptionsPath,
allowChangeMode: allowChangeMode,
showAddIcon: showAddIcon,
addItem: addItem,
deleteItem: deleteItem
}));
}), fields.length < 8 && /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_7__.jsx)("div", {
className: "".concat(_index_less_modules__WEBPACK_IMPORTED_MODULE_5__/* ["default"] */ .Z.addBtn, " mb30"),
onClick: function onClick() {
var _add2;
return add((_add2 = {}, _root_workspace_ppte5yg23_SJ5m_develop_node_modules_babel_runtime_7_23_2_babel_runtime_helpers_defineProperty_js__WEBPACK_IMPORTED_MODULE_2___default()(_add2, choiceTextKey, ''), _root_workspace_ppte5yg23_SJ5m_develop_node_modules_babel_runtime_7_23_2_babel_runtime_helpers_defineProperty_js__WEBPACK_IMPORTED_MODULE_2___default()(_add2, answerKey, 0), _add2));
},
children: "\u6DFB\u52A0\u9009\u9879"
})]
});
}
}), showAnalysis && /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_7__.jsx)("div", {
onClick: function onClick() {
return setEditAnalysis(true);
},
children: /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_7__.jsx)(antd__WEBPACK_IMPORTED_MODULE_13__/* ["default"] */ .Z.Item, {
name: analysisKey,
label: "\u9898\u76EE\u89E3\u6790",
labelCol: {
span: 24
},
children: /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_7__.jsx)(_MdEditorInForm__WEBPACK_IMPORTED_MODULE_6__/* .RegularInput */ .x, {
placeholder: "\u8BF7\u7F16\u8F91\u9898\u76EE\u89E3\u6790\uFF08\u975E\u5FC5\u586B\uFF09",
isEdit: editAnalysis
})
})
})]
});
};
/***/ }),
/***/ 63424:
/*!********************************************************************!*\
!*** ./src/components/QuestionEditor/CompletionQuestionEditor.tsx ***!
\********************************************************************/
/***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) {
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */ u: function() { return /* binding */ CompletionQuestionEditor; }
/* harmony export */ });
/* harmony import */ var _root_workspace_ppte5yg23_SJ5m_develop_node_modules_babel_runtime_7_23_2_babel_runtime_helpers_objectWithoutProperties_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./node_modules/_@babel_runtime@7.23.2@@babel/runtime/helpers/objectWithoutProperties.js */ 27161);
/* harmony import */ var _root_workspace_ppte5yg23_SJ5m_develop_node_modules_babel_runtime_7_23_2_babel_runtime_helpers_objectWithoutProperties_js__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_root_workspace_ppte5yg23_SJ5m_develop_node_modules_babel_runtime_7_23_2_babel_runtime_helpers_objectWithoutProperties_js__WEBPACK_IMPORTED_MODULE_0__);
/* harmony import */ var _root_workspace_ppte5yg23_SJ5m_develop_node_modules_babel_runtime_7_23_2_babel_runtime_helpers_createForOfIteratorHelper_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./node_modules/_@babel_runtime@7.23.2@@babel/runtime/helpers/createForOfIteratorHelper.js */ 98190);
/* harmony import */ var _root_workspace_ppte5yg23_SJ5m_develop_node_modules_babel_runtime_7_23_2_babel_runtime_helpers_createForOfIteratorHelper_js__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_root_workspace_ppte5yg23_SJ5m_develop_node_modules_babel_runtime_7_23_2_babel_runtime_helpers_createForOfIteratorHelper_js__WEBPACK_IMPORTED_MODULE_1__);
/* harmony import */ var _root_workspace_ppte5yg23_SJ5m_develop_node_modules_babel_runtime_7_23_2_babel_runtime_helpers_defineProperty_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./node_modules/_@babel_runtime@7.23.2@@babel/runtime/helpers/defineProperty.js */ 22060);
/* harmony import */ var _root_workspace_ppte5yg23_SJ5m_develop_node_modules_babel_runtime_7_23_2_babel_runtime_helpers_defineProperty_js__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(_root_workspace_ppte5yg23_SJ5m_develop_node_modules_babel_runtime_7_23_2_babel_runtime_helpers_defineProperty_js__WEBPACK_IMPORTED_MODULE_2__);
/* harmony import */ var _root_workspace_ppte5yg23_SJ5m_develop_node_modules_babel_runtime_7_23_2_babel_runtime_helpers_objectSpread2_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./node_modules/_@babel_runtime@7.23.2@@babel/runtime/helpers/objectSpread2.js */ 26801);
/* harmony import */ var _root_workspace_ppte5yg23_SJ5m_develop_node_modules_babel_runtime_7_23_2_babel_runtime_helpers_objectSpread2_js__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__webpack_require__.n(_root_workspace_ppte5yg23_SJ5m_develop_node_modules_babel_runtime_7_23_2_babel_runtime_helpers_objectSpread2_js__WEBPACK_IMPORTED_MODULE_3__);
/* harmony import */ var _root_workspace_ppte5yg23_SJ5m_develop_node_modules_babel_runtime_7_23_2_babel_runtime_helpers_slicedToArray_js__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./node_modules/_@babel_runtime@7.23.2@@babel/runtime/helpers/slicedToArray.js */ 11006);
/* harmony import */ var _root_workspace_ppte5yg23_SJ5m_develop_node_modules_babel_runtime_7_23_2_babel_runtime_helpers_slicedToArray_js__WEBPACK_IMPORTED_MODULE_4___default = /*#__PURE__*/__webpack_require__.n(_root_workspace_ppte5yg23_SJ5m_develop_node_modules_babel_runtime_7_23_2_babel_runtime_helpers_slicedToArray_js__WEBPACK_IMPORTED_MODULE_4__);
/* harmony import */ var _root_workspace_ppte5yg23_SJ5m_develop_node_modules_babel_runtime_7_23_2_babel_runtime_helpers_toConsumableArray_js__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ./node_modules/_@babel_runtime@7.23.2@@babel/runtime/helpers/toConsumableArray.js */ 93923);
/* harmony import */ var _root_workspace_ppte5yg23_SJ5m_develop_node_modules_babel_runtime_7_23_2_babel_runtime_helpers_toConsumableArray_js__WEBPACK_IMPORTED_MODULE_5___default = /*#__PURE__*/__webpack_require__.n(_root_workspace_ppte5yg23_SJ5m_develop_node_modules_babel_runtime_7_23_2_babel_runtime_helpers_toConsumableArray_js__WEBPACK_IMPORTED_MODULE_5__);
/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! react */ 59301);
/* harmony import */ var antd__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(/*! antd */ 43418);
/* harmony import */ var antd__WEBPACK_IMPORTED_MODULE_11__ = __webpack_require__(/*! antd */ 95237);
/* harmony import */ var antd__WEBPACK_IMPORTED_MODULE_12__ = __webpack_require__(/*! antd */ 43604);
/* harmony import */ var antd__WEBPACK_IMPORTED_MODULE_13__ = __webpack_require__(/*! antd */ 1056);
/* harmony import */ var antd__WEBPACK_IMPORTED_MODULE_14__ = __webpack_require__(/*! antd */ 6848);
/* harmony import */ var antd__WEBPACK_IMPORTED_MODULE_16__ = __webpack_require__(/*! antd */ 78673);
/* harmony import */ var antd__WEBPACK_IMPORTED_MODULE_17__ = __webpack_require__(/*! antd */ 78241);
/* harmony import */ var antd__WEBPACK_IMPORTED_MODULE_18__ = __webpack_require__(/*! antd */ 85731);
/* harmony import */ var _MdEditorInForm__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ./MdEditorInForm */ 61954);
/* harmony import */ var _ant_design_icons__WEBPACK_IMPORTED_MODULE_15__ = __webpack_require__(/*! @ant-design/icons */ 87306);
/* harmony import */ var _index_less_modules__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! ./index.less?modules */ 52398);
/* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! react/jsx-runtime */ 37712);
var _excluded = ["key", "name"];
var BlankEditor = function BlankEditor(_ref) {
var value = _ref.value,
onChange = _ref.onChange;
var handleDelete = function handleDelete(index) {
antd__WEBPACK_IMPORTED_MODULE_10__/* ["default"] */ .Z.confirm({
centered: true,
okText: '确定',
cancelText: '取消',
title: '提示',
content: '确认要删除这个参考答案吗?',
className: _index_less_modules__WEBPACK_IMPORTED_MODULE_8__/* ["default"] */ .Z.modal,
onOk: function onOk() {
var valueCopy = _root_workspace_ppte5yg23_SJ5m_develop_node_modules_babel_runtime_7_23_2_babel_runtime_helpers_toConsumableArray_js__WEBPACK_IMPORTED_MODULE_5___default()(value);
valueCopy.splice(index, 1);
onChange(valueCopy);
}
});
};
var handleAdd = function handleAdd() {
var valueCopy = _root_workspace_ppte5yg23_SJ5m_develop_node_modules_babel_runtime_7_23_2_babel_runtime_helpers_toConsumableArray_js__WEBPACK_IMPORTED_MODULE_5___default()(value);
valueCopy.push('');
onChange(valueCopy);
};
return /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_9__.jsxs)(antd__WEBPACK_IMPORTED_MODULE_11__/* ["default"] */ .Z, {
align: "middle",
className: "ml20",
gutter: [40, 20],
children: [value === null || value === void 0 ? void 0 : value.map(function (v, index) {
return /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_9__.jsxs)(antd__WEBPACK_IMPORTED_MODULE_12__/* ["default"] */ .Z, {
className: _index_less_modules__WEBPACK_IMPORTED_MODULE_8__/* ["default"] */ .Z.blankWrapper,
children: [/*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_9__.jsx)(antd__WEBPACK_IMPORTED_MODULE_13__/* ["default"] */ .Z, {
className: _index_less_modules__WEBPACK_IMPORTED_MODULE_8__/* ["default"] */ .Z.blankInput,
defaultValue: v,
maxLength: 1000,
onBlur: function onBlur(e) {
var valueCopy = _root_workspace_ppte5yg23_SJ5m_develop_node_modules_babel_runtime_7_23_2_babel_runtime_helpers_toConsumableArray_js__WEBPACK_IMPORTED_MODULE_5___default()(value);
var inputTrimValue = e.target.value.trim();
valueCopy[index] = inputTrimValue;
onChange(valueCopy);
}
}), /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_9__.jsx)(antd__WEBPACK_IMPORTED_MODULE_14__/* ["default"] */ .Z, {
title: "\u5220\u9664",
children: /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_9__.jsx)(_ant_design_icons__WEBPACK_IMPORTED_MODULE_15__/* ["default"] */ .Z, {
className: _index_less_modules__WEBPACK_IMPORTED_MODULE_8__/* ["default"] */ .Z.deleteIcon,
style: {
marginLeft: 15,
visibility: index > 0 ? 'visible' : 'hidden'
},
onClick: function onClick() {
return handleDelete(index);
}
})
})]
}, "".concat(v, "_").concat(index));
}), /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_9__.jsx)(antd__WEBPACK_IMPORTED_MODULE_12__/* ["default"] */ .Z, {
children: /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_9__.jsx)("div", {
className: "".concat(_index_less_modules__WEBPACK_IMPORTED_MODULE_8__/* ["default"] */ .Z.addBtn),
onClick: function onClick() {
handleAdd();
},
children: "\u65B0\u589E\u7B54\u6848"
})
})]
});
};
var ReversedSwitch = function ReversedSwitch(_ref2) {
var _ref2$value = _ref2.value,
value = _ref2$value === void 0 ? true : _ref2$value,
_onChange = _ref2.onChange;
//打开为false,关闭为true,即一个特殊的Switch。
return /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_9__.jsx)(antd__WEBPACK_IMPORTED_MODULE_16__/* ["default"] */ .Z, {
checked: !value,
onChange: function onChange(checked) {
_onChange(!checked);
}
});
};
var NULL_CH = '▁';
var CompletionQuestionEditor = function CompletionQuestionEditor(_ref3) {
var questionTitlePlaceholder = _ref3.questionTitlePlaceholder,
form = _ref3.form,
_ref3$scoreByBlank = _ref3.scoreByBlank,
scoreByBlank = _ref3$scoreByBlank === void 0 ? false : _ref3$scoreByBlank,
answerKey = _ref3.answerKey;
var _useState = (0,react__WEBPACK_IMPORTED_MODULE_6__.useState)(false),
_useState2 = _root_workspace_ppte5yg23_SJ5m_develop_node_modules_babel_runtime_7_23_2_babel_runtime_helpers_slicedToArray_js__WEBPACK_IMPORTED_MODULE_4___default()(_useState, 2),
editAnalysis = _useState2[0],
setEditAnalysis = _useState2[1];
var getChCountBeforeCursor = function getChCountBeforeCursor(cm, cursor) {
var currentLine = cursor.line;
var placeholderCountBefore = 0;
for (var _line = 0; _line < currentLine; _line++) {
placeholderCountBefore += cm.getLine(_line).split(NULL_CH).length - 1;
}
var currentLineStringBeforeCursor = cm.getLine(currentLine).substring(0, cursor.ch);
placeholderCountBefore += currentLineStringBeforeCursor.split(NULL_CH).length - 1;
return placeholderCountBefore;
};
var _onCMBeforeChange = function onCMBeforeChange(cm, change, addBlank, removeBlank) {
var rangeText = cm.getRange(change.from, change.to);
var newBlankNum = 0;
change.text.forEach(function (item) {
newBlankNum += item.split(NULL_CH).length - 1;
});
if (change.origin === 'setValue') {
//setValue为初始化,此时不需要删除也不需要增加填空项
return;
}
if (rangeText && rangeText.indexOf(NULL_CH) !== -1) {
var placeholderCountInRange = rangeText.split(NULL_CH).length - 1;
var placeholderCountBefore = getChCountBeforeCursor(cm, change.from);
console.log("\u5220\u9664".concat(placeholderCountInRange, "\u4E2A\uFF0C \u524D\u9762\u6709").concat(placeholderCountBefore, "\u4E2A\uFF0C\u65B0\u589E").concat(newBlankNum, "\u4E2A"));
if (placeholderCountInRange > 1) {
var indexArray = Array.from({
length: placeholderCountInRange
}, function (item, index) {
return placeholderCountBefore + index;
});
removeBlank(indexArray);
} else {
removeBlank(placeholderCountBefore);
}
} else if (newBlankNum > 0) {
var _placeholderCountBefore = getChCountBeforeCursor(cm, change.from);
console.log("\u65B0\u589E".concat(newBlankNum, "\u4E2A\uFF0C\u4E4B\u524D\u6709").concat(_placeholderCountBefore, "\u4E2A"));
addBlank(newBlankNum, _placeholderCountBefore);
}
};
//新增和删除需要重新设置position,position表示填空的位置
var rewritePosition = function rewritePosition() {
var preAnswerData = form.getFieldValue(answerKey);
form.setFieldsValue(_root_workspace_ppte5yg23_SJ5m_develop_node_modules_babel_runtime_7_23_2_babel_runtime_helpers_defineProperty_js__WEBPACK_IMPORTED_MODULE_2___default()({}, answerKey, preAnswerData.map(function (item, index) {
return _root_workspace_ppte5yg23_SJ5m_develop_node_modules_babel_runtime_7_23_2_babel_runtime_helpers_objectSpread2_js__WEBPACK_IMPORTED_MODULE_3___default()(_root_workspace_ppte5yg23_SJ5m_develop_node_modules_babel_runtime_7_23_2_babel_runtime_helpers_objectSpread2_js__WEBPACK_IMPORTED_MODULE_3___default()({}, item), {}, {
position: index + 1
});
})));
};
var addFnRef = (0,react__WEBPACK_IMPORTED_MODULE_6__.useRef)();
var addBlank = function addBlank(addNum, insertIndex) {
for (var i = 0; i < addNum; i++) {
addFnRef.current({
position: null,
answer_text: ['']
}, insertIndex + i);
}
rewritePosition();
};
var removeFnRef = (0,react__WEBPACK_IMPORTED_MODULE_6__.useRef)();
var removeBlank = function removeBlank(deleteIndex) {
removeFnRef.current(deleteIndex);
rewritePosition();
};
var standardAnswersValue = antd__WEBPACK_IMPORTED_MODULE_17__/* ["default"] */ .Z.useWatch(answerKey, form);
return /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_9__.jsxs)("div", {
className: _index_less_modules__WEBPACK_IMPORTED_MODULE_8__/* ["default"] */ .Z.wrap,
children: [/*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_9__.jsx)("div", {
className: _index_less_modules__WEBPACK_IMPORTED_MODULE_8__/* ["default"] */ .Z.questionTitleEditorWrap,
children: /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_9__.jsx)(antd__WEBPACK_IMPORTED_MODULE_17__/* ["default"] */ .Z.Item, {
label: "\u9898\u5E72",
name: "name",
labelCol: {
span: 24
},
rules: [{
required: true
}],
children: /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_9__.jsx)(_MdEditorInForm__WEBPACK_IMPORTED_MODULE_7__/* .MdEditorInForm */ .h, {
scrollId: "name",
watch: true,
height: 140,
placeholder: questionTitlePlaceholder,
showNullButton: true,
onCMBeforeChange: function onCMBeforeChange(cm, change) {
_onCMBeforeChange(cm, change, addBlank, removeBlank);
}
})
})
}), /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_9__.jsx)(antd__WEBPACK_IMPORTED_MODULE_17__/* ["default"] */ .Z.List, {
name: answerKey,
rules: [{
validator: function validator(rule, values) {
if ((values === null || values === void 0 ? void 0 : values.length) === 0) {
return Promise.reject(new Error('答案不能为空'));
}
var _iterator = _root_workspace_ppte5yg23_SJ5m_develop_node_modules_babel_runtime_7_23_2_babel_runtime_helpers_createForOfIteratorHelper_js__WEBPACK_IMPORTED_MODULE_1___default()(values),
_step;
try {
for (_iterator.s(); !(_step = _iterator.n()).done;) {
var item = _step.value;
var _ref4 = item || {},
answer_text = _ref4.answer_text;
if (answer_text !== null && answer_text !== void 0 && answer_text.some(function (text) {
return (text === null || text === void 0 ? void 0 : text.length) === 0;
})) {
return Promise.reject(new Error('填空项答案不能为空'));
}
}
} catch (err) {
_iterator.e(err);
} finally {
_iterator.f();
}
return Promise.resolve();
}
}],
children: function children(fields, _ref5, _ref6) {
var add = _ref5.add,
remove = _ref5.remove;
var errors = _ref6.errors;
addFnRef.current = add;
removeFnRef.current = remove;
return /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_9__.jsxs)(react_jsx_runtime__WEBPACK_IMPORTED_MODULE_9__.Fragment, {
children: [/*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_9__.jsx)(antd__WEBPACK_IMPORTED_MODULE_17__/* ["default"] */ .Z.Item, {
label: "\u7B54\u6848\u9009\u9879",
required: true,
labelCol: {
span: 24
}
}), fields.map(function (_ref7, index) {
var key = _ref7.key,
name = _ref7.name,
restField = _root_workspace_ppte5yg23_SJ5m_develop_node_modules_babel_runtime_7_23_2_babel_runtime_helpers_objectWithoutProperties_js__WEBPACK_IMPORTED_MODULE_0___default()(_ref7, _excluded);
return /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_9__.jsxs)(antd__WEBPACK_IMPORTED_MODULE_11__/* ["default"] */ .Z, {
className: "mb20",
align: "middle",
wrap: false,
children: [/*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_9__.jsxs)(antd__WEBPACK_IMPORTED_MODULE_12__/* ["default"] */ .Z, {
flex: '0 0 auto',
className: "".concat(_index_less_modules__WEBPACK_IMPORTED_MODULE_8__/* ["default"] */ .Z.blankIndex),
children: ["\u586B\u7A7A\u9879", index + 1]
}), /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_9__.jsxs)(antd__WEBPACK_IMPORTED_MODULE_12__/* ["default"] */ .Z, {
flex: 1,
children: [/*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_9__.jsxs)(antd__WEBPACK_IMPORTED_MODULE_11__/* ["default"] */ .Z, {
align: "top",
justify: "space-between",
wrap: false,
children: [/*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_9__.jsx)(antd__WEBPACK_IMPORTED_MODULE_12__/* ["default"] */ .Z, {
children: /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_9__.jsx)(antd__WEBPACK_IMPORTED_MODULE_17__/* ["default"] */ .Z.Item, _root_workspace_ppte5yg23_SJ5m_develop_node_modules_babel_runtime_7_23_2_babel_runtime_helpers_objectSpread2_js__WEBPACK_IMPORTED_MODULE_3___default()(_root_workspace_ppte5yg23_SJ5m_develop_node_modules_babel_runtime_7_23_2_babel_runtime_helpers_objectSpread2_js__WEBPACK_IMPORTED_MODULE_3___default()({}, restField), {}, {
name: [name, 'answer_text'],
noStyle: true,
children: /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_9__.jsx)(BlankEditor, {})
}))
}), scoreByBlank && /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_9__.jsx)(antd__WEBPACK_IMPORTED_MODULE_12__/* ["default"] */ .Z, {
flex: '224px',
children: /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_9__.jsx)(antd__WEBPACK_IMPORTED_MODULE_17__/* ["default"] */ .Z.Item, _root_workspace_ppte5yg23_SJ5m_develop_node_modules_babel_runtime_7_23_2_babel_runtime_helpers_objectSpread2_js__WEBPACK_IMPORTED_MODULE_3___default()(_root_workspace_ppte5yg23_SJ5m_develop_node_modules_babel_runtime_7_23_2_babel_runtime_helpers_objectSpread2_js__WEBPACK_IMPORTED_MODULE_3___default()({}, restField), {}, {
name: [name, 'score'],
label: "\u5206\u503C",
rules: [{
required: true
}],
className: _index_less_modules__WEBPACK_IMPORTED_MODULE_8__/* ["default"] */ .Z.blankInputNumberWrapper,
children: /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_9__.jsx)(antd__WEBPACK_IMPORTED_MODULE_18__/* ["default"] */ .Z, {
className: _index_less_modules__WEBPACK_IMPORTED_MODULE_8__/* ["default"] */ .Z.blankInput,
min: 0.1,
max: 100,
precision: 1,
style: {
width: '100%'
},
placeholder: "\u6309\u7A7A\u7ED9\u5206\u8BF7\u8F93\u5165\u5206\u503C"
})
}))
})]
}), /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_9__.jsx)(antd__WEBPACK_IMPORTED_MODULE_17__/* ["default"] */ .Z.Item, _root_workspace_ppte5yg23_SJ5m_develop_node_modules_babel_runtime_7_23_2_babel_runtime_helpers_objectSpread2_js__WEBPACK_IMPORTED_MODULE_3___default()(_root_workspace_ppte5yg23_SJ5m_develop_node_modules_babel_runtime_7_23_2_babel_runtime_helpers_objectSpread2_js__WEBPACK_IMPORTED_MODULE_3___default()({}, restField), {}, {
name: [name, 'position'],
noStyle: true,
children: /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_9__.jsx)(antd__WEBPACK_IMPORTED_MODULE_13__/* ["default"] */ .Z, {
type: "hidden"
})
}))]
})]
}, key);
})]
});
}
}), (standardAnswersValue === null || standardAnswersValue === void 0 ? void 0 : standardAnswersValue.length) > 1 && /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_9__.jsxs)(antd__WEBPACK_IMPORTED_MODULE_11__/* ["default"] */ .Z, {
align: "middle",
className: (standardAnswersValue === null || standardAnswersValue === void 0 ? void 0 : standardAnswersValue.length) > 1 ? 'mb30' : "".concat(_index_less_modules__WEBPACK_IMPORTED_MODULE_8__/* ["default"] */ .Z.hide),
children: [/*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_9__.jsx)(antd__WEBPACK_IMPORTED_MODULE_17__/* ["default"] */ .Z.Item, {
name: "is_ordered",
children: /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_9__.jsx)(ReversedSwitch, {})
}), /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_9__.jsx)(antd__WEBPACK_IMPORTED_MODULE_12__/* ["default"] */ .Z, {
className: "ml10",
children: "\u5141\u8BB8\u5B66\u751F\u6BCF\u4E2A\u586B\u7A7A\u7684\u7B54\u6848\u4E0E\u6807\u51C6\u7B54\u6848\u7684\u987A\u5E8F\u4E0D\u4E00\u81F4"
})]
}), /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_9__.jsx)("div", {
onClick: function onClick() {
return setEditAnalysis(true);
},
children: /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_9__.jsx)(antd__WEBPACK_IMPORTED_MODULE_17__/* ["default"] */ .Z.Item, {
name: "analysis",
label: "\u9898\u76EE\u89E3\u6790",
labelCol: {
span: 24
},
children: /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_9__.jsx)(_MdEditorInForm__WEBPACK_IMPORTED_MODULE_7__/* .RegularInput */ .x, {
placeholder: "\u8BF7\u7F16\u8F91\u9898\u76EE\u89E3\u6790\uFF08\u975E\u5FC5\u586B\uFF09",
isEdit: editAnalysis
})
})
})]
});
};
/***/ }),
/***/ 99839:
/*!******************************************************************!*\
!*** ./src/components/QuestionEditor/JudgmentQuestionEditor.tsx ***!
\******************************************************************/
/***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) {
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */ Z: function() { return /* binding */ JudgmentQuestionEditor; }
/* harmony export */ });
/* harmony import */ var _root_workspace_ppte5yg23_SJ5m_develop_node_modules_babel_runtime_7_23_2_babel_runtime_helpers_objectWithoutProperties_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./node_modules/_@babel_runtime@7.23.2@@babel/runtime/helpers/objectWithoutProperties.js */ 27161);
/* harmony import */ var _root_workspace_ppte5yg23_SJ5m_develop_node_modules_babel_runtime_7_23_2_babel_runtime_helpers_objectWithoutProperties_js__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_root_workspace_ppte5yg23_SJ5m_develop_node_modules_babel_runtime_7_23_2_babel_runtime_helpers_objectWithoutProperties_js__WEBPACK_IMPORTED_MODULE_0__);
/* harmony import */ var _root_workspace_ppte5yg23_SJ5m_develop_node_modules_babel_runtime_7_23_2_babel_runtime_helpers_slicedToArray_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./node_modules/_@babel_runtime@7.23.2@@babel/runtime/helpers/slicedToArray.js */ 11006);
/* harmony import */ var _root_workspace_ppte5yg23_SJ5m_develop_node_modules_babel_runtime_7_23_2_babel_runtime_helpers_slicedToArray_js__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_root_workspace_ppte5yg23_SJ5m_develop_node_modules_babel_runtime_7_23_2_babel_runtime_helpers_slicedToArray_js__WEBPACK_IMPORTED_MODULE_1__);
/* harmony import */ var _root_workspace_ppte5yg23_SJ5m_develop_node_modules_babel_runtime_7_23_2_babel_runtime_helpers_objectSpread2_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./node_modules/_@babel_runtime@7.23.2@@babel/runtime/helpers/objectSpread2.js */ 26801);
/* harmony import */ var _root_workspace_ppte5yg23_SJ5m_develop_node_modules_babel_runtime_7_23_2_babel_runtime_helpers_objectSpread2_js__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(_root_workspace_ppte5yg23_SJ5m_develop_node_modules_babel_runtime_7_23_2_babel_runtime_helpers_objectSpread2_js__WEBPACK_IMPORTED_MODULE_2__);
/* harmony import */ var _root_workspace_ppte5yg23_SJ5m_develop_node_modules_babel_runtime_7_23_2_babel_runtime_helpers_defineProperty_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./node_modules/_@babel_runtime@7.23.2@@babel/runtime/helpers/defineProperty.js */ 22060);
/* harmony import */ var _root_workspace_ppte5yg23_SJ5m_develop_node_modules_babel_runtime_7_23_2_babel_runtime_helpers_defineProperty_js__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__webpack_require__.n(_root_workspace_ppte5yg23_SJ5m_develop_node_modules_babel_runtime_7_23_2_babel_runtime_helpers_defineProperty_js__WEBPACK_IMPORTED_MODULE_3__);
/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! react */ 59301);
/* harmony import */ var antd__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! antd */ 95237);
/* harmony import */ var antd__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! antd */ 43604);
/* harmony import */ var antd__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(/*! antd */ 78241);
/* harmony import */ var _index_less_modules__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ./index.less?modules */ 52398);
/* harmony import */ var _MdEditorInForm__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ./MdEditorInForm */ 61954);
/* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! react/jsx-runtime */ 37712);
var _excluded = ["key", "name"];
var _tagMap;
var tagMap = (_tagMap = {}, _root_workspace_ppte5yg23_SJ5m_develop_node_modules_babel_runtime_7_23_2_babel_runtime_helpers_defineProperty_js__WEBPACK_IMPORTED_MODULE_3___default()(_tagMap, '正确', 'T'), _root_workspace_ppte5yg23_SJ5m_develop_node_modules_babel_runtime_7_23_2_babel_runtime_helpers_defineProperty_js__WEBPACK_IMPORTED_MODULE_3___default()(_tagMap, '错误', 'F'), _tagMap);
var JudgmentQuestionItem = function JudgmentQuestionItem(_ref) {
var value = _ref.value,
onChange = _ref.onChange,
form = _ref.form;
var isActiveAnswer = (value === null || value === void 0 ? void 0 : value.is_answer) === 1;
var judgementText = value === null || value === void 0 ? void 0 : value.choice_text;
var setActiveAnswer = function setActiveAnswer() {
var formListValue = form.getFieldsValue().choices.map(function (choice) {
return {
choice_text: choice.choice_text,
is_answer: 0
};
});
form.setFieldsValue({
choices: formListValue
});
onChange(_root_workspace_ppte5yg23_SJ5m_develop_node_modules_babel_runtime_7_23_2_babel_runtime_helpers_objectSpread2_js__WEBPACK_IMPORTED_MODULE_2___default()(_root_workspace_ppte5yg23_SJ5m_develop_node_modules_babel_runtime_7_23_2_babel_runtime_helpers_objectSpread2_js__WEBPACK_IMPORTED_MODULE_2___default()({}, value), {}, {
is_answer: 1
}));
};
return /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_7__.jsxs)(antd__WEBPACK_IMPORTED_MODULE_8__/* ["default"] */ .Z, {
className: _index_less_modules__WEBPACK_IMPORTED_MODULE_5__/* ["default"] */ .Z.choiceWrap,
align: "middle",
wrap: false,
children: [/*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_7__.jsx)(antd__WEBPACK_IMPORTED_MODULE_9__/* ["default"] */ .Z, {
onClick: setActiveAnswer,
className: "".concat(_index_less_modules__WEBPACK_IMPORTED_MODULE_5__/* ["default"] */ .Z.choiceIndex, " ").concat(_index_less_modules__WEBPACK_IMPORTED_MODULE_5__/* ["default"] */ .Z.judgementIndex, " ").concat(isActiveAnswer ? _index_less_modules__WEBPACK_IMPORTED_MODULE_5__/* ["default"] */ .Z.activeAnswer : ''),
children: tagMap[judgementText]
}), /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_7__.jsx)(antd__WEBPACK_IMPORTED_MODULE_9__/* ["default"] */ .Z, {
flex: 1,
className: "".concat(_index_less_modules__WEBPACK_IMPORTED_MODULE_5__/* ["default"] */ .Z.editorWrap, " ml15"),
children: /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_7__.jsx)("div", {
className: "".concat(_index_less_modules__WEBPACK_IMPORTED_MODULE_5__/* ["default"] */ .Z.inputBorder, " ").concat(_index_less_modules__WEBPACK_IMPORTED_MODULE_5__/* ["default"] */ .Z.placeholder, " ").concat(isActiveAnswer ? _index_less_modules__WEBPACK_IMPORTED_MODULE_5__/* ["default"] */ .Z.activeJudgementAnswer : ''),
children: judgementText
})
}), /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_7__.jsx)(antd__WEBPACK_IMPORTED_MODULE_9__/* ["default"] */ .Z, {
flex: '0 0 auto',
className: "ml15",
children: /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_7__.jsx)("div", {
onClick: setActiveAnswer,
className: "".concat(_index_less_modules__WEBPACK_IMPORTED_MODULE_5__/* ["default"] */ .Z.setAnswerBtn, " ").concat(isActiveAnswer ? _index_less_modules__WEBPACK_IMPORTED_MODULE_5__/* ["default"] */ .Z.activeAnswer : ''),
children: isActiveAnswer ? '正确答案' : '设为答案'
})
})]
});
};
var JudgmentQuestionEditor = function JudgmentQuestionEditor(_ref2) {
var questionTitlePlaceholder = _ref2.questionTitlePlaceholder,
choiceKey = _ref2.choiceKey,
form = _ref2.form;
var _useState = (0,react__WEBPACK_IMPORTED_MODULE_4__.useState)(false),
_useState2 = _root_workspace_ppte5yg23_SJ5m_develop_node_modules_babel_runtime_7_23_2_babel_runtime_helpers_slicedToArray_js__WEBPACK_IMPORTED_MODULE_1___default()(_useState, 2),
editAnalysis = _useState2[0],
setEditAnalysis = _useState2[1];
return /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_7__.jsxs)("div", {
className: _index_less_modules__WEBPACK_IMPORTED_MODULE_5__/* ["default"] */ .Z.wrap,
children: [/*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_7__.jsx)("div", {
className: _index_less_modules__WEBPACK_IMPORTED_MODULE_5__/* ["default"] */ .Z.questionTitleEditorWrap,
children: /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_7__.jsx)(antd__WEBPACK_IMPORTED_MODULE_10__/* ["default"] */ .Z.Item, {
label: "\u9898\u5E72",
name: "name",
labelCol: {
span: 24
},
rules: [{
required: true
}],
children: /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_7__.jsx)(_MdEditorInForm__WEBPACK_IMPORTED_MODULE_6__/* .MdEditorInForm */ .h, {
scrollId: "name",
watch: true,
height: 140,
placeholder: questionTitlePlaceholder
})
})
}), /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_7__.jsx)(antd__WEBPACK_IMPORTED_MODULE_10__/* ["default"] */ .Z.Item, {
label: "\u7B54\u6848\u9009\u9879",
required: true,
labelCol: {
span: 24
},
children: /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_7__.jsx)(antd__WEBPACK_IMPORTED_MODULE_10__/* ["default"] */ .Z.List, {
name: "choices",
rules: [{
validator: function validator(rule, values) {
var hasAnswer = values.some(function (option) {
return (option === null || option === void 0 ? void 0 : option.is_answer) === 1;
});
if (hasAnswer) {
return Promise.resolve();
}
return Promise.reject(new Error('请设置正确答案'));
}
}],
children: function children(fields) {
return /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_7__.jsx)("div", {
id: "choices",
children: fields.map(function (_ref3) {
var key = _ref3.key,
name = _ref3.name,
restField = _root_workspace_ppte5yg23_SJ5m_develop_node_modules_babel_runtime_7_23_2_babel_runtime_helpers_objectWithoutProperties_js__WEBPACK_IMPORTED_MODULE_0___default()(_ref3, _excluded);
return /*#__PURE__*/(0,react__WEBPACK_IMPORTED_MODULE_4__.createElement)(antd__WEBPACK_IMPORTED_MODULE_10__/* ["default"] */ .Z.Item, _root_workspace_ppte5yg23_SJ5m_develop_node_modules_babel_runtime_7_23_2_babel_runtime_helpers_objectSpread2_js__WEBPACK_IMPORTED_MODULE_2___default()(_root_workspace_ppte5yg23_SJ5m_develop_node_modules_babel_runtime_7_23_2_babel_runtime_helpers_objectSpread2_js__WEBPACK_IMPORTED_MODULE_2___default()({}, restField), {}, {
key: key,
name: name,
noStyle: true
}), /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_7__.jsx)(JudgmentQuestionItem, {
form: form
}));
})
});
}
})
}), /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_7__.jsx)("div", {
onClick: function onClick() {
return setEditAnalysis(true);
},
children: /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_7__.jsx)(antd__WEBPACK_IMPORTED_MODULE_10__/* ["default"] */ .Z.Item, {
name: "analysis",
label: "\u9898\u76EE\u89E3\u6790",
labelCol: {
span: 24
},
children: /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_7__.jsx)(_MdEditorInForm__WEBPACK_IMPORTED_MODULE_6__/* .RegularInput */ .x, {
placeholder: "\u8BF7\u7F16\u8F91\u9898\u76EE\u89E3\u6790\uFF08\u975E\u5FC5\u586B\uFF09",
isEdit: editAnalysis
})
})
})]
});
};
/***/ }),
/***/ 61954:
/*!**********************************************************!*\
!*** ./src/components/QuestionEditor/MdEditorInForm.tsx ***!
\**********************************************************/
/***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) {
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */ h: function() { return /* binding */ MdEditorInForm; },
/* harmony export */ x: function() { return /* binding */ RegularInput; }
/* harmony export */ });
/* harmony import */ var _root_workspace_ppte5yg23_SJ5m_develop_node_modules_babel_runtime_7_23_2_babel_runtime_helpers_objectSpread2_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./node_modules/_@babel_runtime@7.23.2@@babel/runtime/helpers/objectSpread2.js */ 26801);
/* harmony import */ var _root_workspace_ppte5yg23_SJ5m_develop_node_modules_babel_runtime_7_23_2_babel_runtime_helpers_objectSpread2_js__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_root_workspace_ppte5yg23_SJ5m_develop_node_modules_babel_runtime_7_23_2_babel_runtime_helpers_objectSpread2_js__WEBPACK_IMPORTED_MODULE_0__);
/* harmony import */ var _root_workspace_ppte5yg23_SJ5m_develop_node_modules_babel_runtime_7_23_2_babel_runtime_helpers_objectWithoutProperties_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./node_modules/_@babel_runtime@7.23.2@@babel/runtime/helpers/objectWithoutProperties.js */ 27161);
/* harmony import */ var _root_workspace_ppte5yg23_SJ5m_develop_node_modules_babel_runtime_7_23_2_babel_runtime_helpers_objectWithoutProperties_js__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_root_workspace_ppte5yg23_SJ5m_develop_node_modules_babel_runtime_7_23_2_babel_runtime_helpers_objectWithoutProperties_js__WEBPACK_IMPORTED_MODULE_1__);
/* harmony import */ var _components_markdown_editor__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @/components/markdown-editor */ 20755);
/* harmony import */ var _index_less_modules__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./index.less?modules */ 52398);
/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! react */ 59301);
/* harmony import */ var _components_RenderHtml__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! @/components/RenderHtml */ 55523);
/* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! react/jsx-runtime */ 37712);
var _excluded = ["value", "onChange", "scrollId"];
var MdEditorInForm = function MdEditorInForm(_ref) {
var value = _ref.value,
_onChange = _ref.onChange,
scrollId = _ref.scrollId,
props = _root_workspace_ppte5yg23_SJ5m_develop_node_modules_babel_runtime_7_23_2_babel_runtime_helpers_objectWithoutProperties_js__WEBPACK_IMPORTED_MODULE_1___default()(_ref, _excluded);
return /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_6__.jsx)("div", {
id: scrollId || '',
children: /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_6__.jsx)(_components_markdown_editor__WEBPACK_IMPORTED_MODULE_2__/* ["default"] */ .Z, _root_workspace_ppte5yg23_SJ5m_develop_node_modules_babel_runtime_7_23_2_babel_runtime_helpers_objectSpread2_js__WEBPACK_IMPORTED_MODULE_0___default()(_root_workspace_ppte5yg23_SJ5m_develop_node_modules_babel_runtime_7_23_2_babel_runtime_helpers_objectSpread2_js__WEBPACK_IMPORTED_MODULE_0___default()({}, props), {}, {
defaultValue: value,
onChange: function onChange(a, b) {
console.log("a:", a, b);
if (!!(b !== null && b !== void 0 && b.length)) _onChange(a, b);else _onChange(a);
}
}))
});
};
var RegularInput = function RegularInput(_ref2) {
var value = _ref2.value,
onChange = _ref2.onChange,
placeholder = _ref2.placeholder,
_ref2$height = _ref2.height,
height = _ref2$height === void 0 ? 140 : _ref2$height,
isEdit = _ref2.isEdit;
return isEdit ? /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_6__.jsx)(_components_markdown_editor__WEBPACK_IMPORTED_MODULE_2__/* ["default"] */ .Z, {
watch: true,
isFocus: true,
height: height,
placeholder: placeholder,
defaultValue: value,
onChange: onChange
}) : /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_6__.jsx)("div", {
style: {
cursor: 'pointer'
},
children: value ? /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_6__.jsx)(_components_RenderHtml__WEBPACK_IMPORTED_MODULE_5__/* ["default"] */ .Z, {
className: _index_less_modules__WEBPACK_IMPORTED_MODULE_3__/* ["default"] */ .Z.inputBorder,
value: value
}) : /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_6__.jsx)("div", {
className: "".concat(_index_less_modules__WEBPACK_IMPORTED_MODULE_3__/* ["default"] */ .Z.inputBorder, " ").concat(_index_less_modules__WEBPACK_IMPORTED_MODULE_3__/* ["default"] */ .Z.placeholder),
children: placeholder
})
});
};
/***/ }),
/***/ 31988:
/*!********************************************************************!*\
!*** ./src/components/QuestionEditor/SubjectiveQuestionEditor.tsx ***!
\********************************************************************/
/***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) {
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */ W: function() { return /* binding */ SubjectiveQuestionEditor; }
/* harmony export */ });
/* harmony import */ var _root_workspace_ppte5yg23_SJ5m_develop_node_modules_babel_runtime_7_23_2_babel_runtime_helpers_createForOfIteratorHelper_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./node_modules/_@babel_runtime@7.23.2@@babel/runtime/helpers/createForOfIteratorHelper.js */ 98190);
/* harmony import */ var _root_workspace_ppte5yg23_SJ5m_develop_node_modules_babel_runtime_7_23_2_babel_runtime_helpers_createForOfIteratorHelper_js__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_root_workspace_ppte5yg23_SJ5m_develop_node_modules_babel_runtime_7_23_2_babel_runtime_helpers_createForOfIteratorHelper_js__WEBPACK_IMPORTED_MODULE_0__);
/* harmony import */ var _root_workspace_ppte5yg23_SJ5m_develop_node_modules_babel_runtime_7_23_2_babel_runtime_helpers_slicedToArray_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./node_modules/_@babel_runtime@7.23.2@@babel/runtime/helpers/slicedToArray.js */ 11006);
/* harmony import */ var _root_workspace_ppte5yg23_SJ5m_develop_node_modules_babel_runtime_7_23_2_babel_runtime_helpers_slicedToArray_js__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_root_workspace_ppte5yg23_SJ5m_develop_node_modules_babel_runtime_7_23_2_babel_runtime_helpers_slicedToArray_js__WEBPACK_IMPORTED_MODULE_1__);
/* harmony import */ var _root_workspace_ppte5yg23_SJ5m_develop_node_modules_babel_runtime_7_23_2_babel_runtime_helpers_objectSpread2_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./node_modules/_@babel_runtime@7.23.2@@babel/runtime/helpers/objectSpread2.js */ 26801);
/* harmony import */ var _root_workspace_ppte5yg23_SJ5m_develop_node_modules_babel_runtime_7_23_2_babel_runtime_helpers_objectSpread2_js__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(_root_workspace_ppte5yg23_SJ5m_develop_node_modules_babel_runtime_7_23_2_babel_runtime_helpers_objectSpread2_js__WEBPACK_IMPORTED_MODULE_2__);
/* harmony import */ var _root_workspace_ppte5yg23_SJ5m_develop_node_modules_babel_runtime_7_23_2_babel_runtime_helpers_objectWithoutProperties_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./node_modules/_@babel_runtime@7.23.2@@babel/runtime/helpers/objectWithoutProperties.js */ 27161);
/* harmony import */ var _root_workspace_ppte5yg23_SJ5m_develop_node_modules_babel_runtime_7_23_2_babel_runtime_helpers_objectWithoutProperties_js__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__webpack_require__.n(_root_workspace_ppte5yg23_SJ5m_develop_node_modules_babel_runtime_7_23_2_babel_runtime_helpers_objectWithoutProperties_js__WEBPACK_IMPORTED_MODULE_3__);
/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! react */ 59301);
/* harmony import */ var antd__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! antd */ 8591);
/* harmony import */ var antd__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(/*! antd */ 12563);
/* harmony import */ var antd__WEBPACK_IMPORTED_MODULE_11__ = __webpack_require__(/*! antd */ 78241);
/* harmony import */ var antd__WEBPACK_IMPORTED_MODULE_12__ = __webpack_require__(/*! antd */ 78673);
/* harmony import */ var antd__WEBPACK_IMPORTED_MODULE_13__ = __webpack_require__(/*! antd */ 95237);
/* harmony import */ var antd__WEBPACK_IMPORTED_MODULE_14__ = __webpack_require__(/*! antd */ 43604);
/* harmony import */ var antd__WEBPACK_IMPORTED_MODULE_15__ = __webpack_require__(/*! antd */ 6848);
/* harmony import */ var antd__WEBPACK_IMPORTED_MODULE_17__ = __webpack_require__(/*! antd */ 1056);
/* harmony import */ var antd__WEBPACK_IMPORTED_MODULE_18__ = __webpack_require__(/*! antd */ 85731);
/* harmony import */ var _index_less_modules__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ./index.less?modules */ 52398);
/* harmony import */ var _MdEditorInForm__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ./MdEditorInForm */ 61954);
/* harmony import */ var _components_markdown_editor__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! @/components/markdown-editor */ 20755);
/* harmony import */ var _ant_design_icons__WEBPACK_IMPORTED_MODULE_16__ = __webpack_require__(/*! @ant-design/icons */ 98815);
/* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! react/jsx-runtime */ 37712);
var _excluded = ["value", "onChange"],
_excluded2 = ["key", "name"];
var AnswerTextFormItem = function AnswerTextFormItem(_ref) {
var value = _ref.value,
onChange = _ref.onChange,
props = _root_workspace_ppte5yg23_SJ5m_develop_node_modules_babel_runtime_7_23_2_babel_runtime_helpers_objectWithoutProperties_js__WEBPACK_IMPORTED_MODULE_3___default()(_ref, _excluded);
var handleChange = function handleChange(v) {
onChange([v]);
};
return /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_8__.jsx)(_components_markdown_editor__WEBPACK_IMPORTED_MODULE_7__/* ["default"] */ .Z, _root_workspace_ppte5yg23_SJ5m_develop_node_modules_babel_runtime_7_23_2_babel_runtime_helpers_objectSpread2_js__WEBPACK_IMPORTED_MODULE_2___default()(_root_workspace_ppte5yg23_SJ5m_develop_node_modules_babel_runtime_7_23_2_babel_runtime_helpers_objectSpread2_js__WEBPACK_IMPORTED_MODULE_2___default()({}, props), {}, {
defaultValue: value === null || value === void 0 ? void 0 : value[0],
onChange: handleChange
}));
};
var test = function test(str) {
if (!str) {
return false;
}
var containSpecial = new RegExp("[ `~!@#$^&*()={}':;,\\[\\].<>/?~!@#¥……&*()—【】‘;:”“。,、?「」『』_\\+\\-·%《》]|[\\\\/]");
// if (containSpecial.test(str)) {
// message.warning("关键词不能含有特殊字符!")
// return false
// }
if (str === '|') {
antd__WEBPACK_IMPORTED_MODULE_9__/* ["default"] */ .ZP.warning("关键词不能只输入一个“|”字符!");
return false;
}
return true;
};
var KeywordTag = function KeywordTag(_ref2) {
var _ref2$value = _ref2.value,
value = _ref2$value === void 0 ? [] : _ref2$value,
onClose = _ref2.onClose;
return /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_8__.jsx)(antd__WEBPACK_IMPORTED_MODULE_10__/* ["default"] */ .Z, {
closable: true,
onClose: onClose,
className: _index_less_modules__WEBPACK_IMPORTED_MODULE_5__/* ["default"] */ .Z.keywordTag,
children: value === null || value === void 0 ? void 0 : value.join(' 或 ')
});
};
var SubjectiveQuestionEditor = function SubjectiveQuestionEditor(_ref3) {
var questionTitlePlaceholder = _ref3.questionTitlePlaceholder,
form = _ref3.form,
showKeywords = _ref3.showKeywords,
_ref3$isMustKeyWords = _ref3.isMustKeyWords,
isMustKeyWords = _ref3$isMustKeyWords === void 0 ? showKeywords : _ref3$isMustKeyWords;
var _useState = (0,react__WEBPACK_IMPORTED_MODULE_4__.useState)(false),
_useState2 = _root_workspace_ppte5yg23_SJ5m_develop_node_modules_babel_runtime_7_23_2_babel_runtime_helpers_slicedToArray_js__WEBPACK_IMPORTED_MODULE_1___default()(_useState, 2),
editAnalysis = _useState2[0],
setEditAnalysis = _useState2[1];
var _useState3 = (0,react__WEBPACK_IMPORTED_MODULE_4__.useState)(''),
_useState4 = _root_workspace_ppte5yg23_SJ5m_develop_node_modules_babel_runtime_7_23_2_babel_runtime_helpers_slicedToArray_js__WEBPACK_IMPORTED_MODULE_1___default()(_useState3, 2),
keywordsInput = _useState4[0],
setKeywordsInput = _useState4[1];
var useKeywordsValue = antd__WEBPACK_IMPORTED_MODULE_11__/* ["default"] */ .Z.useWatch('use_keywords', form);
var questionScore = antd__WEBPACK_IMPORTED_MODULE_11__/* ["default"] */ .Z.useWatch('question_score', form);
return /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_8__.jsxs)("div", {
className: _index_less_modules__WEBPACK_IMPORTED_MODULE_5__/* ["default"] */ .Z.wrap,
children: [/*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_8__.jsx)("div", {
className: _index_less_modules__WEBPACK_IMPORTED_MODULE_5__/* ["default"] */ .Z.questionTitleEditorWrap,
children: /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_8__.jsx)(antd__WEBPACK_IMPORTED_MODULE_11__/* ["default"] */ .Z.Item, {
label: "\u9898\u5E72",
name: "name",
labelCol: {
span: 24
},
rules: [{
required: true
}],
children: /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_8__.jsx)(_MdEditorInForm__WEBPACK_IMPORTED_MODULE_6__/* .MdEditorInForm */ .h, {
scrollId: "name",
watch: true,
height: 140,
placeholder: questionTitlePlaceholder
})
})
}), /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_8__.jsx)(antd__WEBPACK_IMPORTED_MODULE_11__/* ["default"] */ .Z.Item, {
label: "\u53C2\u8003\u7B54\u6848",
name: "answer_texts",
labelCol: {
span: 24
},
children: /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_8__.jsx)(AnswerTextFormItem, {
watch: true,
height: 140,
placeholder: '请编辑参考答案(非必填)'
})
}), showKeywords && !isMustKeyWords && /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_8__.jsx)(antd__WEBPACK_IMPORTED_MODULE_11__/* ["default"] */ .Z.Item, {
hidden: true,
name: "use_keywords",
valuePropName: "checked",
children: /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_8__.jsx)(antd__WEBPACK_IMPORTED_MODULE_12__/* ["default"] */ .Z, {
defaultChecked: true
})
}), showKeywords && isMustKeyWords && /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_8__.jsxs)(antd__WEBPACK_IMPORTED_MODULE_13__/* ["default"] */ .Z, {
align: "middle",
className: "mb30",
children: [/*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_8__.jsx)(antd__WEBPACK_IMPORTED_MODULE_11__/* ["default"] */ .Z.Item, {
name: "use_keywords",
valuePropName: "checked",
children: /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_8__.jsx)(antd__WEBPACK_IMPORTED_MODULE_12__/* ["default"] */ .Z, {})
}), /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_8__.jsx)(antd__WEBPACK_IMPORTED_MODULE_14__/* ["default"] */ .Z, {
className: "ml10",
children: "\u5F00\u542F\u5173\u952E\u8BCD\u81EA\u52A8\u5224\u5206"
}), /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_8__.jsx)(antd__WEBPACK_IMPORTED_MODULE_14__/* ["default"] */ .Z, {
children: /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_8__.jsx)(antd__WEBPACK_IMPORTED_MODULE_15__/* ["default"] */ .Z, {
placement: "right",
title: "\u9009\u4E2D\u540E\uFF0C\u9700\u8981\u8BBE\u7F6E\u6BCF\u4E2A\u5173\u952E\u8BCD\u7684\u5206\u503C\uFF0C\u7CFB\u7EDF\u4F1A\u6839\u636E\u8BBE\u7F6E\u7684\u5173\u952E\u8BCD\u8FDB\u884C\u81EA\u52A8\u5224\u5206\uFF1B \u6240\u6709\u5173\u952E\u8BCD\u5206\u503C\u4E4B\u548C\u5FC5\u987B\u5C0F\u4E8E\u7B49\u4E8E\u5C0F\u9898\u5206\u503C\u3002",
children: /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_8__.jsx)(_ant_design_icons__WEBPACK_IMPORTED_MODULE_16__/* ["default"] */ .Z, {
style: {
color: '#3061D0',
marginLeft: 6,
cursor: 'pointer'
}
})
})
})]
}), (useKeywordsValue || !isMustKeyWords) && /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_8__.jsx)(antd__WEBPACK_IMPORTED_MODULE_11__/* ["default"] */ .Z.List, {
name: "keywords",
rules: [{
validator: function validator(rule, values) {
if (!isMustKeyWords) {
return Promise.resolve();
}
if (!(values !== null && values !== void 0 && values.length)) {
return Promise.reject(new Error('请输入关键词'));
}
var keywordsScoreSum = values === null || values === void 0 ? void 0 : values.reduce(function (pre, cur) {
return pre + cur.score;
}, 0);
if (keywordsScoreSum > parseFloat(questionScore)) {
return Promise.reject(new Error('所有关键词的分值之和必须小于等于该小题的分值'));
}
return Promise.resolve();
}
}],
children: function children(fields, _ref4) {
var add = _ref4.add,
remove = _ref4.remove;
return /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_8__.jsxs)(react_jsx_runtime__WEBPACK_IMPORTED_MODULE_8__.Fragment, {
children: [/*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_8__.jsx)("div", {
className: "".concat(_index_less_modules__WEBPACK_IMPORTED_MODULE_5__/* ["default"] */ .Z.title, " mb10"),
children: !isMustKeyWords ? /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_8__.jsx)("span", {
style: {
color: "#9096A3"
},
children: "\u5224\u5206\u5173\u952E\u8BCD"
}) : "关键词"
}), /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_8__.jsxs)(antd__WEBPACK_IMPORTED_MODULE_13__/* ["default"] */ .Z, {
align: "middle",
className: "font14 mb30",
children: [/*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_8__.jsx)(antd__WEBPACK_IMPORTED_MODULE_14__/* ["default"] */ .Z, {
flex: 1,
children: /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_8__.jsx)(antd__WEBPACK_IMPORTED_MODULE_17__/* ["default"] */ .Z, {
value: keywordsInput,
onChange: function onChange(e) {
setKeywordsInput(e.target.value);
},
maxLength: 50,
allowClear: true,
onPressEnter: function onPressEnter(e) {
var _e$target, _v$split, _currentKeywordsValue;
var v = "".concat((_e$target = e.target) === null || _e$target === void 0 ? void 0 : _e$target.value).replaceAll(' ', ''); //去除所有的空格,同时空格也不触发非法字符校验了
var keywordArr = v === null || v === void 0 || (_v$split = v.split('|')) === null || _v$split === void 0 ? void 0 : _v$split.filter(function (k) {
return !!k;
});
var currentKeywordsValue = form.getFieldValue('keywords');
var existKeywords = (currentKeywordsValue === null || currentKeywordsValue === void 0 || (_currentKeywordsValue = currentKeywordsValue.map(function (item) {
return item === null || item === void 0 ? void 0 : item.keyword;
})) === null || _currentKeywordsValue === void 0 ? void 0 : _currentKeywordsValue.flat()) || [];
var _iterator = _root_workspace_ppte5yg23_SJ5m_develop_node_modules_babel_runtime_7_23_2_babel_runtime_helpers_createForOfIteratorHelper_js__WEBPACK_IMPORTED_MODULE_0___default()(keywordArr),
_step;
try {
for (_iterator.s(); !(_step = _iterator.n()).done;) {
var word = _step.value;
if (existKeywords.includes(word)) {
antd__WEBPACK_IMPORTED_MODULE_9__/* ["default"] */ .ZP.error('为避免判分错误,请勿设置相同的关键词');
return;
}
}
} catch (err) {
_iterator.e(err);
} finally {
_iterator.f();
}
if (test(v)) {
add({
keyword: keywordArr,
score: 1
});
setKeywordsInput('');
}
},
className: _index_less_modules__WEBPACK_IMPORTED_MODULE_5__/* ["default"] */ .Z.inputBorder,
placeholder: "\u652F\u6301\u8BBE\u7F6E\u591A\u4E2A\u5173\u952E\u8BCD\uFF1B\u5E76\u5217\u5173\u952E\u8BCD\uFF08\u6216\u7684\u5173\u7CFB\uFF09\u8BF7\u7528\u201C|\u201D\u5206\u9694\u5F00"
})
}), /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_8__.jsx)(antd__WEBPACK_IMPORTED_MODULE_14__/* ["default"] */ .Z, {
flex: '148px',
style: {
textAlign: 'right',
color: '#9096A3'
},
children: "\u201C\u56DE\u8F66\u952E\u201D\u4FDD\u5B58\u5173\u952E\u8BCD"
})]
}), fields.map(function (_ref5) {
var key = _ref5.key,
name = _ref5.name,
restField = _root_workspace_ppte5yg23_SJ5m_develop_node_modules_babel_runtime_7_23_2_babel_runtime_helpers_objectWithoutProperties_js__WEBPACK_IMPORTED_MODULE_3___default()(_ref5, _excluded2);
return /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_8__.jsx)(antd__WEBPACK_IMPORTED_MODULE_13__/* ["default"] */ .Z, {
className: "mb20",
style: {
marginRight: 148
},
children: /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_8__.jsx)(antd__WEBPACK_IMPORTED_MODULE_14__/* ["default"] */ .Z, {
flex: 1,
children: /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_8__.jsxs)(antd__WEBPACK_IMPORTED_MODULE_13__/* ["default"] */ .Z, {
align: "middle",
justify: "space-between",
children: [/*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_8__.jsx)(antd__WEBPACK_IMPORTED_MODULE_11__/* ["default"] */ .Z.Item, _root_workspace_ppte5yg23_SJ5m_develop_node_modules_babel_runtime_7_23_2_babel_runtime_helpers_objectSpread2_js__WEBPACK_IMPORTED_MODULE_2___default()(_root_workspace_ppte5yg23_SJ5m_develop_node_modules_babel_runtime_7_23_2_babel_runtime_helpers_objectSpread2_js__WEBPACK_IMPORTED_MODULE_2___default()({}, restField), {}, {
name: [name, "keyword"],
children: /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_8__.jsx)(KeywordTag, {
onClose: function onClose() {
return remove(name);
}
})
})), isMustKeyWords && /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_8__.jsx)(antd__WEBPACK_IMPORTED_MODULE_11__/* ["default"] */ .Z.Item, _root_workspace_ppte5yg23_SJ5m_develop_node_modules_babel_runtime_7_23_2_babel_runtime_helpers_objectSpread2_js__WEBPACK_IMPORTED_MODULE_2___default()(_root_workspace_ppte5yg23_SJ5m_develop_node_modules_babel_runtime_7_23_2_babel_runtime_helpers_objectSpread2_js__WEBPACK_IMPORTED_MODULE_2___default()({}, restField), {}, {
name: [name, "score"],
label: "\u5206\u503C",
rules: [{
required: true
}],
className: _index_less_modules__WEBPACK_IMPORTED_MODULE_5__/* ["default"] */ .Z.blankInputNumberWrapper,
children: /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_8__.jsx)(antd__WEBPACK_IMPORTED_MODULE_18__/* ["default"] */ .Z, {
className: _index_less_modules__WEBPACK_IMPORTED_MODULE_5__/* ["default"] */ .Z.blankInput,
min: 0.1,
max: 100,
precision: 1,
style: {
width: '100%'
},
placeholder: "\u8BF7\u8F93\u5165\u5173\u952E\u8BCD\u5206\u6570"
})
}))]
})
})
}, key);
})]
});
}
}), /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_8__.jsx)("div", {
onClick: function onClick() {
return setEditAnalysis(true);
},
children: /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_8__.jsx)(antd__WEBPACK_IMPORTED_MODULE_11__/* ["default"] */ .Z.Item, {
name: "analysis",
label: "\u9898\u76EE\u89E3\u6790",
labelCol: {
span: 24
},
children: /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_8__.jsx)(_MdEditorInForm__WEBPACK_IMPORTED_MODULE_6__/* .RegularInput */ .x, {
placeholder: "\u8BF7\u7F16\u8F91\u9898\u76EE\u89E3\u6790\uFF08\u975E\u5FC5\u586B\uFF09",
isEdit: editAnalysis
})
})
})]
});
};
/***/ }),
/***/ 55523:
/*!*********************************************************!*\
!*** ./src/components/RenderHtml/index.tsx + 1 modules ***!
\*********************************************************/
/***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) {
// EXPORTS
__webpack_require__.d(__webpack_exports__, {
Z: function() { return /* binding */ RenderHtml; }
});
// EXTERNAL MODULE: ./node_modules/_@babel_runtime@7.23.2@@babel/runtime/helpers/objectSpread2.js
var objectSpread2 = __webpack_require__(26801);
var objectSpread2_default = /*#__PURE__*/__webpack_require__.n(objectSpread2);
// EXTERNAL MODULE: ./node_modules/_@babel_runtime@7.23.2@@babel/runtime/helpers/toConsumableArray.js
var toConsumableArray = __webpack_require__(93923);
var toConsumableArray_default = /*#__PURE__*/__webpack_require__.n(toConsumableArray);
// EXTERNAL MODULE: ./node_modules/_@babel_runtime@7.23.2@@babel/runtime/helpers/createForOfIteratorHelper.js
var createForOfIteratorHelper = __webpack_require__(98190);
var createForOfIteratorHelper_default = /*#__PURE__*/__webpack_require__.n(createForOfIteratorHelper);
// EXTERNAL MODULE: ./node_modules/_@babel_runtime@7.23.2@@babel/runtime/helpers/slicedToArray.js
var slicedToArray = __webpack_require__(11006);
var slicedToArray_default = /*#__PURE__*/__webpack_require__.n(slicedToArray);
// EXTERNAL MODULE: ./node_modules/_react@17.0.2@react/index.js
var _react_17_0_2_react = __webpack_require__(59301);
// EXTERNAL MODULE: ./node_modules/_katex@0.11.1@katex/dist/katex.min.css
var katex_min = __webpack_require__(70657);
// EXTERNAL MODULE: ./node_modules/_marked@2.0.7@marked/lib/marked.js
var marked = __webpack_require__(32834);
var marked_default = /*#__PURE__*/__webpack_require__.n(marked);
// EXTERNAL MODULE: ./node_modules/_marked@2.0.7@marked/src/helpers.js
var helpers = __webpack_require__(11690);
;// CONCATENATED MODULE: ./src/utils/marked.ts
function indentCodeCompensation(raw, text) {
var matchIndentToCode = raw.match(/^(\s+)(?:```)/);
if (matchIndentToCode === null) {
return text;
}
var indentToCode = matchIndentToCode[1];
return text.split('\n').map(function (node) {
var matchIndentInNode = node.match(/^\s+/);
if (matchIndentInNode === null) {
return node;
}
var _matchIndentInNode = slicedToArray_default()(matchIndentInNode, 1),
indentInNode = _matchIndentInNode[0];
if (indentInNode.length >= indentToCode.length) {
return node.slice(indentToCode.length);
}
return node;
}).join('\n');
}
//兼容之前的 ##标题式写法
var toc = [];
var ctx = ["
"];
var renderer = new (marked_default()).Renderer();
var headingRegex = /^ *(#{1,6}) *([^\n]+?) *(?:#+ *)?(?:\n+|$)/;
function cleanToc() {
toc.length = 0;
ctx = [""];
}
var lines = {
overflow: "hidden",
WebkitBoxOrient: "vertical",
display: "-webkit-box",
WebkitLineClamp: 2
};
function buildToc(coll, k, level, ctx) {
if (k >= coll.length || coll[k].level <= level) {
return k;
}
var node = coll[k];
ctx.push("- " + node.text + "");
k++;
var childCtx = [];
k = buildToc(coll, k, node.level, childCtx);
if (childCtx.length > 0) {
ctx.push("
");
childCtx.forEach(function (idm) {
ctx.push(idm);
});
ctx.push("
");
}
ctx.push(" ");
k = buildToc(coll, k, level, ctx);
return k;
}
function getTocContent() {
buildToc(toc, 0, 0, ctx);
ctx.push("
");
return ctx.join("");
}
var tokenizer = {
heading: function heading(src) {
var cap = headingRegex.exec(src);
if (cap) {
return {
type: 'heading',
raw: cap[0],
depth: cap[1].length,
text: cap[2]
};
}
},
fences: function fences(src) {
var cap = this.rules.block.fences.exec(src);
if (cap) {
var raw = cap[0];
var text = indentCodeCompensation(raw, cap[3] || '');
var lang = cap[2] ? cap[2].trim() : cap[2];
if (['latex', 'katex', 'math'].indexOf(lang) >= 0) {
var id = next_id();
var expression = text;
text = id;
math_expressions[id] = {
type: 'block',
expression: expression
};
}
return {
type: 'code',
raw: raw,
lang: lang,
text: text
};
}
}
};
var latexRegex = /(?:\${2})([^\n`]+?)(?:\${2})/gi;
var katex_count = 0;
var next_id = function next_id() {
return "__special_katext_id_".concat(katex_count++, "__");
};
var math_expressions = {};
function getMathExpressions() {
return math_expressions;
}
function resetMathExpressions() {
katex_count = 0;
math_expressions = {};
}
function replace_math_with_ids(text) {
text = text.replace(latexRegex, function (_match, expression) {
var id = next_id();
math_expressions[id] = {
type: 'inline',
expression: expression
};
return id;
});
return text;
}
var original_listitem = renderer.listitem;
renderer.listitem = function (text) {
return original_listitem(replace_math_with_ids(text));
};
var original_paragraph = renderer.paragraph;
renderer.paragraph = function (text) {
return original_paragraph(replace_math_with_ids(text));
};
var original_tablecell = renderer.tablecell;
renderer.tablecell = function (content, flags) {
return original_tablecell(replace_math_with_ids(content), flags);
};
renderer.code = function (code, infostring, escaped) {
var lang = (infostring || '').match(/\S*/)[0];
if (!lang) {
return '
' + (escaped ? code : (0,helpers.escape)(code, true)) + '
';
}
if (['latex', 'katex', 'math'].indexOf(lang) >= 0) {
return "".concat(code, "
");
} else {
return "").concat(escaped ? code : (0,helpers.escape)(code, true), "
\n");
}
};
renderer.heading = function (text, level, raw) {
var anchor = this.options.headerPrefix + raw.toLowerCase().replace(/[^\w\\u4e00-\\u9fa5]]+/g, '-');
toc.push({
anchor: anchor,
level: level,
text: text
});
return '' + text + '';
};
marked_default().setOptions({
silent: true,
gfm: true,
pedantic: false
});
marked_default().use({
tokenizer: tokenizer,
renderer: renderer
});
/* harmony default export */ var utils_marked = ((marked_default()));
// EXTERNAL MODULE: ./node_modules/_code-prettify@0.1.0@code-prettify/src/prettify.js
var prettify = __webpack_require__(64018);
// EXTERNAL MODULE: ./node_modules/_hls.js@1.4.12@hls.js/dist/hls.mjs
var dist_hls = __webpack_require__(36775);
// EXTERNAL MODULE: ./src/utils/env.ts + 1 modules
var env = __webpack_require__(47015);
// EXTERNAL MODULE: ./node_modules/_katex@0.11.1@katex/dist/katex.js
var katex = __webpack_require__(15342);
// EXTERNAL MODULE: ./node_modules/_uuid@8.3.0@uuid/dist/esm-browser/v4.js + 4 modules
var v4 = __webpack_require__(1012);
// EXTERNAL MODULE: ./src/components/PreviewAll/index.tsx + 1 modules
var PreviewAll = __webpack_require__(48058);
// EXTERNAL MODULE: ./node_modules/_react@17.0.2@react/jsx-runtime.js
var jsx_runtime = __webpack_require__(37712);
;// CONCATENATED MODULE: ./src/components/RenderHtml/index.tsx
var ADD_MULTI = '@▁▁@';
var ADD_SINGLE = '@▁@';
var preRegex = /]*>/g;
function _unescape(str) {
var div = document.createElement('div');
div.innerHTML = str;
return div.childNodes.length === 0 ? '' : div.childNodes[0].nodeValue;
}
/* harmony default export */ var RenderHtml = (function (_ref) {
var _ref$value = _ref.value,
value = _ref$value === void 0 ? '' : _ref$value,
className = _ref.className,
showTextOnly = _ref.showTextOnly,
showLines = _ref.showLines,
_ref$style = _ref.style,
style = _ref$style === void 0 ? {} : _ref$style,
_ref$stylesPrev = _ref.stylesPrev,
stylesPrev = _ref$stylesPrev === void 0 ? {} : _ref$stylesPrev,
highlightKeywords = _ref.highlightKeywords,
showProgramFill = _ref.showProgramFill,
isProgramFill = _ref.isProgramFill,
_ref$disabledFill = _ref.disabledFill,
disabledFill = _ref$disabledFill === void 0 ? false : _ref$disabledFill,
programFillValue = _ref.programFillValue,
_ref$onFillChange = _ref.onFillChange,
onFillChange = _ref$onFillChange === void 0 ? function (value) {} : _ref$onFillChange,
_ref$onFillBlur = _ref.onFillBlur,
onFillBlur = _ref$onFillBlur === void 0 ? function () {} : _ref$onFillBlur;
var str = String(value);
var _useState = (0,_react_17_0_2_react.useState)(""),
_useState2 = slicedToArray_default()(_useState, 2),
data = _useState2[0],
setData = _useState2[1];
var _useState3 = (0,_react_17_0_2_react.useState)("office"),
_useState4 = slicedToArray_default()(_useState3, 2),
type = _useState4[0],
setType = _useState4[1];
var _useState5 = (0,_react_17_0_2_react.useState)([]),
_useState6 = slicedToArray_default()(_useState5, 2),
projectValue = _useState6[0],
setProjectValue = _useState6[1];
var classNamesRef = (0,_react_17_0_2_react.useRef)("a" + (0,v4/* default */.Z)());
var formObj = {};
var createInput = function createInput(a, num) {
// const wrap = document.createElement("span")
// wrap.className =
var input = document.createElement(a === ADD_SINGLE ? "input" : "textarea");
input.style.width = "100%";
input.style.height = a === ADD_SINGLE ? "40px" : "151px";
input.rows = 5;
input.spellcheck = false;
input.name = "edu-program-fill";
input.placeholder = "请输入";
input.dataset.id = num;
var key = Object.keys(formObj).length;
formObj[key] = input;
return "").concat(input.outerHTML, "");
};
var formatMD = function formatMD(rs) {
return rs.replace(/([\s\S]+?)<\/style>/gim, function (_, css) {
var _css = css.replace(/(\n|\r)/g, "").split("}");
var arr = [];
_css.map(function (item) {
if (item != '') {
arr.push(".".concat(classNamesRef.current, " ").concat(item));
}
});
return "");
});
};
var html = (0,_react_17_0_2_react.useMemo)(function () {
try {
var reg = /\(\s+\/api\/attachments\/|\(\/api\/attachments\/|\(\/attachments\/download\//g;
var reg2 = /\"\/api\/attachments\/|\"\/attachments\/download\//g;
var reg3 = /\(\s+\/files\/uploads\/|\"\/files\/uploads\//g;
str = str.replace(reg, "(" + env/* default */.Z.API_SERVER + "/api/attachments/").replace(reg2, '"' + env/* default */.Z.API_SERVER + "/api/attachments/").replace(reg3, '"' + env/* default */.Z.API_SERVER + "/files/uploads/").replaceAll("http://video.educoder", "https://video.educoder").replaceAll("http://www.educoder.net/api", "https://data.educoder.net/api").replaceAll("https://www.educoder.net/api", "https://data.educoder.net/api").replace(/\r\n/g, "\n");
// str = str.replace(new RegExp("(?".concat(formatMD(str || ""), "");
}
var rs = utils_marked(str);
rs = formatMD(rs);
var math_expressions = getMathExpressions();
if (str.match(/\[TOC\]/)) {
rs = rs.replace('[TOC]
', getTocContent());
cleanToc();
}
rs = rs.replace(/(__special_katext_id_\d+__)/g, function (_match, capture) {
var _math_expressions$cap = math_expressions[capture],
type = _math_expressions$cap.type,
expression = _math_expressions$cap.expression;
return (0,katex.renderToString)(_unescape(expression) || '', {
displayMode: type === 'block',
throwOnError: false,
output: 'html'
});
});
rs = rs.replace(/▁/g, '▁▁▁');
resetMathExpressions();
// return dompurify.sanitize(rs)
var dom = document.createElement('div');
dom.innerHTML = rs;
if (highlightKeywords) {
var escapedKeywords = highlightKeywords.replace(/[.*+?^${}()|[\]\\]/g, "\\$&");
findKeyword(dom, escapedKeywords);
return dom.innerHTML;
}
if (showTextOnly) {
return dom.innerText;
}
setTimeout(function () {
return onLoad();
}, 500);
return dom.innerHTML;
}, [str, highlightKeywords]);
(0,_react_17_0_2_react.useEffect)(function () {
if (el.current) {
var inputs = el.current.querySelectorAll(["input", "textarea"]);
inputs.forEach(function (input) {
input.oninput = onInput;
input.onblur = onBlur;
});
}
}, [projectValue]);
(0,_react_17_0_2_react.useEffect)(function () {
if (!!(programFillValue !== null && programFillValue !== void 0 && programFillValue.length)) {
var scoreDom = el.current.querySelectorAll(".edu-program-fill-score");
var dom = el.current.querySelectorAll('[name="edu-program-fill"]');
var _iterator = createForOfIteratorHelper_default()(dom.entries()),
_step;
try {
for (_iterator.s(); !(_step = _iterator.n()).done;) {
var _programFillValue$k;
var _step$value = slicedToArray_default()(_step.value, 2),
k = _step$value[0],
i = _step$value[1];
i.value = (_programFillValue$k = programFillValue[k]) === null || _programFillValue$k === void 0 ? void 0 : _programFillValue$k.value;
if (programFillValue[k].type === "warning") {
i.className = "program-fill-warning";
} else if (programFillValue[k].type === "success") {
i.className = "program-fill-success";
} else {
i.className = "";
}
}
} catch (err) {
_iterator.e(err);
} finally {
_iterator.f();
}
var _iterator2 = createForOfIteratorHelper_default()(scoreDom.entries()),
_step2;
try {
for (_iterator2.s(); !(_step2 = _iterator2.n()).done;) {
var _programFillValue$_k, _programFillValue$_k2;
var _step2$value = slicedToArray_default()(_step2.value, 2),
_k = _step2$value[0],
_i = _step2$value[1];
_i.innerHTML = (_programFillValue$_k = programFillValue[_k]) !== null && _programFillValue$_k !== void 0 && _programFillValue$_k.score ? "".concat((_programFillValue$_k2 = programFillValue[_k]) === null || _programFillValue$_k2 === void 0 ? void 0 : _programFillValue$_k2.score, "\u5206") : "";
}
} catch (err) {
_iterator2.e(err);
} finally {
_iterator2.f();
}
setProjectValue(programFillValue);
}
}, [programFillValue]);
var onInput = function onInput(e) {
projectValue[e.target.dataset.id] = projectValue[e.target.dataset.id] || {};
projectValue[e.target.dataset.id]["value"] = e.target.value;
setProjectValue(toConsumableArray_default()(projectValue));
onFillChange(projectValue, e.target.dataset.id);
};
var onBlur = function onBlur(e) {
projectValue[e.target.dataset.id] = projectValue[e.target.dataset.id] || {};
projectValue[e.target.dataset.id]["value"] = e.target.value;
setProjectValue(toConsumableArray_default()(projectValue));
onFillBlur(projectValue, e.target.dataset.id);
};
function findKeyword(node, keyword) {
return node.childNodes.forEach(function (childNode) {
if (childNode.childNodes.length > 0) {
findKeyword(childNode, keyword);
} else if (childNode.nodeName !== "IMG") {
if (childNode.innerHTML) {
var _childNode$innerHTML;
childNode.innerHTML = (_childNode$innerHTML = childNode.innerHTML) === null || _childNode$innerHTML === void 0 ? void 0 : _childNode$innerHTML.replace(new RegExp(keyword, "gi"), '$&');
} else {
var dom = document.createElement("span");
dom.innerHTML = childNode.textContent.replace(new RegExp(keyword, "gi"), '$&');
childNode.replaceWith(dom);
}
}
});
// return dom.childNodes.forEach((node:any) => {
// console.log("nodeLen:",node.childNodes.length)
// if(node.childNodes.length > 0){
// debugger
// // findKeyword(dom.childNodes,keyword)
// }else{
// if(node.nodeName !== "#text"){
// node.innerHTML = node.innerHTML.replaceAll(keyword,`${keyword}`)
// console.log("node:",node,dom,node.nodeName,node.innerHTML,node.childNodes.length)
// debugger
// }
// }
// return node
// });
}
var el = (0,_react_17_0_2_react.useRef)();
lines['WebkitLineClamp'] = showLines;
if (showLines) {
style = objectSpread2_default()(objectSpread2_default()({}, style), lines);
}
function onAncherHandler(e) {
var target = e.target;
if (target.tagName.toUpperCase() === 'A') {
var ancher = target.getAttribute('href');
if (ancher.indexOf("office") > -1) {
e.preventDefault();
setData(ancher);
setType("office");
} else if (ancher.indexOf("application/pdf") > -1) {
e.preventDefault();
setData(ancher);
setType("pdf");
} else if (ancher.indexOf("text/html") > -1) {
e.preventDefault();
setData(ancher);
setType("html");
} else if (ancher.startsWith('#')) {
e.preventDefault();
var viewEl = document.getElementById(ancher.replace('#', ''));
if (viewEl) {
viewEl.scrollIntoView(true);
}
}
}
}
var onLoad = function onLoad() {
var _el$current;
var videoElement = (_el$current = el.current) === null || _el$current === void 0 ? void 0 : _el$current.querySelectorAll('video');
videoElement === null || videoElement === void 0 || videoElement.forEach(function (item) {
item.oncontextmenu = function () {
return false;
};
if (item.src.indexOf('.m3u8') > -1) {
if (item.canPlayType('application/vnd.apple.mpegurl')) {} else if (dist_hls/* default */.Z.isSupported()) {
var hls = new dist_hls/* default */.Z();
hls.loadSource(item.src);
hls.attachMedia(item);
}
}
});
};
(0,_react_17_0_2_react.useEffect)(function () {
if (el.current && html) {
if (html.match(preRegex)) {
window.PR.prettyPrint();
}
}
if (el.current) {
el.current.addEventListener('click', onAncherHandler);
return function () {
var _el$current2;
(_el$current2 = el.current) === null || _el$current2 === void 0 || _el$current2.removeEventListener('click', onAncherHandler);
resetMathExpressions();
cleanToc();
};
}
}, [html, el.current, onAncherHandler]);
return /*#__PURE__*/(0,jsx_runtime.jsxs)(jsx_runtime.Fragment, {
children: [showTextOnly && /*#__PURE__*/(0,jsx_runtime.jsx)("div", {
ref: el,
children: html
}), !showTextOnly && /*#__PURE__*/(0,jsx_runtime.jsx)("div", {
ref: el,
style: objectSpread2_default()({}, style),
className: "".concat(className ? className : '', " ").concat(disabledFill ? "disabled-fill" : "", " markdown-body ").concat(classNamesRef.current),
dangerouslySetInnerHTML: {
__html: html
}
}), /*#__PURE__*/(0,jsx_runtime.jsx)(PreviewAll/* default */.Z, {
close: true,
data: data,
type: !!(data !== null && data !== void 0 && data.length) ? type : "",
style: objectSpread2_default()({}, stylesPrev),
onClose: function onClose() {
return setData("");
}
})]
});
});
/***/ }),
/***/ 16769:
/*!******************************************************!*\
!*** ./src/components/Spinner/index.tsx + 1 modules ***!
\******************************************************/
/***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) {
// EXPORTS
__webpack_require__.d(__webpack_exports__, {
Z: function() { return /* binding */ Spinner; }
});
// EXTERNAL MODULE: ./node_modules/_react@17.0.2@react/index.js
var _react_17_0_2_react = __webpack_require__(59301);
// EXTERNAL MODULE: ./src/.umi-production/exports.ts + 8 modules
var _umi_production_exports = __webpack_require__(66660);
;// CONCATENATED MODULE: ./src/components/Spinner/index.less?modules
// extracted by mini-css-extract-plugin
/* harmony default export */ var Spinnermodules = ({"ldsRing":"ldsRing___mpBZC","idsRingWrapper":"idsRingWrapper___Of9_n","ldsring":"ldsring___o0w2t"});
// EXTERNAL MODULE: ./node_modules/_react@17.0.2@react/jsx-runtime.js
var jsx_runtime = __webpack_require__(37712);
;// CONCATENATED MODULE: ./src/components/Spinner/index.tsx
/* harmony default export */ var Spinner = (function (_ref) {
var message = _ref.message,
className = _ref.className,
children = _ref.children,
_ref$style = _ref.style,
style = _ref$style === void 0 ? {} : _ref$style;
return /*#__PURE__*/(0,jsx_runtime.jsxs)("div", {
className: "".concat(Spinnermodules.idsRingWrapper, " ").concat(className),
children: [/*#__PURE__*/(0,jsx_runtime.jsxs)("div", {
className: Spinnermodules.ldsRing,
children: [/*#__PURE__*/(0,jsx_runtime.jsx)("div", {}), /*#__PURE__*/(0,jsx_runtime.jsx)("div", {}), /*#__PURE__*/(0,jsx_runtime.jsx)("div", {}), /*#__PURE__*/(0,jsx_runtime.jsx)("div", {})]
}), message ? /*#__PURE__*/(0,jsx_runtime.jsx)("p", {
style: style,
children: message
}) : null, /*#__PURE__*/(0,jsx_runtime.jsx)(_umi_production_exports.Outlet, {})]
});
});
/***/ }),
/***/ 95635:
/*!*************************************************************!*\
!*** ./src/components/markdown-editor/code-block/index.tsx ***!
\*************************************************************/
/***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) {
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */ h: function() { return /* binding */ MyCodeMirror; }
/* harmony export */ });
/* harmony import */ var _root_workspace_ppte5yg23_SJ5m_develop_node_modules_babel_runtime_7_23_2_babel_runtime_helpers_objectSpread2_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./node_modules/_@babel_runtime@7.23.2@@babel/runtime/helpers/objectSpread2.js */ 26801);
/* harmony import */ var _root_workspace_ppte5yg23_SJ5m_develop_node_modules_babel_runtime_7_23_2_babel_runtime_helpers_objectSpread2_js__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_root_workspace_ppte5yg23_SJ5m_develop_node_modules_babel_runtime_7_23_2_babel_runtime_helpers_objectSpread2_js__WEBPACK_IMPORTED_MODULE_0__);
/* harmony import */ var _root_workspace_ppte5yg23_SJ5m_develop_node_modules_babel_runtime_7_23_2_babel_runtime_helpers_slicedToArray_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./node_modules/_@babel_runtime@7.23.2@@babel/runtime/helpers/slicedToArray.js */ 11006);
/* harmony import */ var _root_workspace_ppte5yg23_SJ5m_develop_node_modules_babel_runtime_7_23_2_babel_runtime_helpers_slicedToArray_js__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_root_workspace_ppte5yg23_SJ5m_develop_node_modules_babel_runtime_7_23_2_babel_runtime_helpers_slicedToArray_js__WEBPACK_IMPORTED_MODULE_1__);
/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! react */ 59301);
/* harmony import */ var antd__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! antd */ 57809);
/* harmony import */ var antd__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! antd */ 78241);
/* harmony import */ var antd__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! antd */ 3113);
/* harmony import */ var codemirror__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! codemirror */ 89780);
/* harmony import */ var codemirror__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__webpack_require__.n(codemirror__WEBPACK_IMPORTED_MODULE_3__);
/* harmony import */ var codemirror_lib_codemirror_css__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! codemirror/lib/codemirror.css */ 39416);
/* harmony import */ var codemirror_theme_blackboard_css__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! codemirror/theme/blackboard.css */ 23626);
/* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! react/jsx-runtime */ 37712);
var Option = antd__WEBPACK_IMPORTED_MODULE_7__["default"].Option;
//https://github.com/codemirror/CodeMirror/issues/4838
var formItemLayout = {
labelCol: {
span: 4
},
wrapperCol: {
span: 20
}
};
var LanguageDesc = {
asp: ['ASP', 'vbscript'],
actionscript: ['ActionScript(3.0)/Flash/Flex', 'clike'],
bash: ['Bash/Bat', 'shell'],
css: ['CSS', 'css'],
c: ['C', 'clike'],
cpp: ['C++', 'clike'],
csharp: ['C#', 'clike'],
coffeescript: ['CoffeeScript', 'coffeescript'],
d: ['D', 'd'],
dart: ['Dart', 'dart'],
delphi: ['Delphi/Pascal', 'pascal'],
erlang: ['Erlang', 'erlang'],
go: ['Golang', 'go'],
groovy: ['Groovy', 'groovy'],
html: ['HTML', 'text/html'],
java: ['Java', 'clike'],
json: ['JSON', 'text/json'],
javascript: ['Javascript', 'javascript'],
lua: ['Lua', 'lua'],
less: ['LESS', 'css'],
markdown: ['Markdown', 'gfm'],
'objective-c': ['Objective-C', 'clike'],
php: ['PHP', 'php'],
perl: ['Perl', 'perl'],
python: ['Python', 'python'],
r: ['R', 'r'],
rst: ['reStructedText', 'rst'],
ruby: ['Ruby', 'ruby'],
sql: ['SQL', 'sql'],
sass: ['SASS/SCSS', 'sass'],
shell: ['Shell', 'shell'],
scala: ['Scala', 'clike'],
swift: ['Swift', 'clike'],
vb: ['VB/VBScript', 'vb'],
xml: ['XML', 'text/xml'],
yaml: ['YAML', 'yaml']
};
/* harmony default export */ __webpack_exports__.Z = (function (_ref) {
var callback = _ref.callback,
onCancel = _ref.onCancel;
var _useState = (0,react__WEBPACK_IMPORTED_MODULE_2__.useState)('python'),
_useState2 = _root_workspace_ppte5yg23_SJ5m_develop_node_modules_babel_runtime_7_23_2_babel_runtime_helpers_slicedToArray_js__WEBPACK_IMPORTED_MODULE_1___default()(_useState, 2),
mode = _useState2[0],
setMode = _useState2[1];
function onSetMode(value) {
setMode(LanguageDesc[value][1]);
}
function onSubmit(values) {
callback(values);
}
return /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_6__.jsxs)(antd__WEBPACK_IMPORTED_MODULE_8__/* ["default"] */ .Z, _root_workspace_ppte5yg23_SJ5m_develop_node_modules_babel_runtime_7_23_2_babel_runtime_helpers_objectSpread2_js__WEBPACK_IMPORTED_MODULE_0___default()(_root_workspace_ppte5yg23_SJ5m_develop_node_modules_babel_runtime_7_23_2_babel_runtime_helpers_objectSpread2_js__WEBPACK_IMPORTED_MODULE_0___default()({}, formItemLayout), {}, {
className: "code-block-panel",
initialValues: {
language: 'python',
content: ''
},
onFinish: onSubmit,
children: [/*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_6__.jsx)(antd__WEBPACK_IMPORTED_MODULE_8__/* ["default"] */ .Z.Item, {
label: "\u4EE3\u7801\u8BED\u8A00",
name: "language",
children: /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_6__.jsx)(antd__WEBPACK_IMPORTED_MODULE_7__["default"], {
getPopupContainer: function getPopupContainer(trigger) {
return trigger.parentNode;
},
onChange: onSetMode,
children: Object.keys(LanguageDesc).map(function (item) {
return /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_6__.jsx)(Option, {
value: item,
children: LanguageDesc[item][0]
}, item);
})
})
}), /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_6__.jsx)(antd__WEBPACK_IMPORTED_MODULE_8__/* ["default"] */ .Z.Item, {
label: "\u4EE3\u7801\u5185\u5BB9",
name: "content",
rules: [{
required: true,
message: '请输入代码内容'
}],
children: /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_6__.jsx)(MyCodeMirror, {
mode: mode
})
}), /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_6__.jsxs)("div", {
className: "flex-container flex-end",
children: [/*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_6__.jsx)(antd__WEBPACK_IMPORTED_MODULE_9__/* ["default"] */ .ZP, {
type: "primary",
htmlType: "submit",
style: {
marginRight: 10
},
children: "\u786E\u5B9A"
}), /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_6__.jsx)(antd__WEBPACK_IMPORTED_MODULE_9__/* ["default"] */ .ZP, {
type: "ghost",
onClick: onCancel,
children: "\u53D6\u6D88"
})]
})]
}));
});
function MyCodeMirror(_ref2) {
var value = _ref2.value,
onChange = _ref2.onChange,
mode = _ref2.mode,
_ref2$options = _ref2.options,
options = _ref2$options === void 0 ? {} : _ref2$options;
var el = (0,react__WEBPACK_IMPORTED_MODULE_2__.useRef)();
var _useState3 = (0,react__WEBPACK_IMPORTED_MODULE_2__.useState)(),
_useState4 = _root_workspace_ppte5yg23_SJ5m_develop_node_modules_babel_runtime_7_23_2_babel_runtime_helpers_slicedToArray_js__WEBPACK_IMPORTED_MODULE_1___default()(_useState3, 2),
cm = _useState4[0],
setCm = _useState4[1];
(0,react__WEBPACK_IMPORTED_MODULE_2__.useEffect)(function () {
if (cm) {
var onChangeHandler = function onChangeHandler(cm) {
var content = cm.getValue();
onChange && onChange(content);
};
cm.on('change', onChangeHandler);
return function () {
cm.off('change', onChangeHandler);
};
}
}, [cm, onChange]);
(0,react__WEBPACK_IMPORTED_MODULE_2__.useEffect)(function () {
if (cm) {
cm.setOption('mode', mode);
}
}, [cm, mode]);
(0,react__WEBPACK_IMPORTED_MODULE_2__.useEffect)(function () {
if (cm) {
if (value !== cm.getValue() || value === '') {
setTimeout(function () {
cm.setValue(value || '');
}, 300);
}
}
}, [cm, value]);
(0,react__WEBPACK_IMPORTED_MODULE_2__.useEffect)(function () {
if (el.current && !cm) {
var instance = codemirror__WEBPACK_IMPORTED_MODULE_3___default().fromTextArea(el.current, _root_workspace_ppte5yg23_SJ5m_develop_node_modules_babel_runtime_7_23_2_babel_runtime_helpers_objectSpread2_js__WEBPACK_IMPORTED_MODULE_0___default()({
mode: mode,
lineNumbers: true,
lineWrapping: true,
autoCloseBrackets: true,
tabSize: 4,
autofocus: true,
autoCloseTags: true,
matchBrackets: true,
styleActiveLine: true
}, options));
setCm(instance);
}
}, [el.current, cm]);
return /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_6__.jsx)("div", {
className: "my-codemirror-container",
children: /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_6__.jsx)("textarea", {
ref: el
})
});
}
/***/ }),
/***/ 20755:
/*!***************************************************************!*\
!*** ./src/components/markdown-editor/index.tsx + 10 modules ***!
\***************************************************************/
/***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) {
// EXPORTS
__webpack_require__.d(__webpack_exports__, {
Z: function() { return /* binding */ markdown_editor; }
});
// EXTERNAL MODULE: ./node_modules/_@babel_runtime@7.23.2@@babel/runtime/helpers/createForOfIteratorHelper.js
var createForOfIteratorHelper = __webpack_require__(98190);
var createForOfIteratorHelper_default = /*#__PURE__*/__webpack_require__.n(createForOfIteratorHelper);
// EXTERNAL MODULE: ./node_modules/_@babel_runtime@7.23.2@@babel/runtime/helpers/slicedToArray.js
var slicedToArray = __webpack_require__(11006);
var slicedToArray_default = /*#__PURE__*/__webpack_require__.n(slicedToArray);
// EXTERNAL MODULE: ./node_modules/_@babel_runtime@7.23.2@@babel/runtime/helpers/defineProperty.js
var defineProperty = __webpack_require__(22060);
var defineProperty_default = /*#__PURE__*/__webpack_require__.n(defineProperty);
// EXTERNAL MODULE: ./node_modules/_react@17.0.2@react/index.js
var _react_17_0_2_react = __webpack_require__(59301);
// EXTERNAL MODULE: ./node_modules/_codemirror@5.58.2@codemirror/lib/codemirror.js
var codemirror = __webpack_require__(89780);
var codemirror_default = /*#__PURE__*/__webpack_require__.n(codemirror);
// EXTERNAL MODULE: ./node_modules/_resize-observer-polyfill@1.5.1@resize-observer-polyfill/dist/ResizeObserver.es.js
var ResizeObserver_es = __webpack_require__(76374);
// EXTERNAL MODULE: ./node_modules/_codemirror@5.58.2@codemirror/lib/codemirror.css
var lib_codemirror = __webpack_require__(39416);
// EXTERNAL MODULE: ./node_modules/_codemirror@5.58.2@codemirror/addon/edit/closetag.js
var closetag = __webpack_require__(6313);
// EXTERNAL MODULE: ./node_modules/_codemirror@5.58.2@codemirror/addon/edit/closebrackets.js
var closebrackets = __webpack_require__(25717);
// EXTERNAL MODULE: ./node_modules/_codemirror@5.58.2@codemirror/addon/display/placeholder.js
var placeholder = __webpack_require__(99498);
// EXTERNAL MODULE: ./node_modules/_codemirror@5.58.2@codemirror/mode/markdown/markdown.js
var markdown = __webpack_require__(25419);
// EXTERNAL MODULE: ./node_modules/_codemirror@5.58.2@codemirror/mode/stex/stex.js
var stex = __webpack_require__(67549);
;// CONCATENATED MODULE: ./src/components/markdown-editor/index.less
// extracted by mini-css-extract-plugin
// EXTERNAL MODULE: ./src/components/RenderHtml/index.tsx + 1 modules
var RenderHtml = __webpack_require__(55523);
// EXTERNAL MODULE: ./node_modules/_react@17.0.2@react/jsx-runtime.js
var jsx_runtime = __webpack_require__(37712);
;// CONCATENATED MODULE: ./src/components/RenderHtml/stex.tsx
// const latexjs = require('latex-l.js/dist/latex.js');
// import "latex-l.js/dist/css/base.css"
/* harmony default export */ var RenderHtml_stex = (function (_ref) {
var _ref$value = _ref.value,
value = _ref$value === void 0 ? '' : _ref$value,
className = _ref.className,
showTextOnly = _ref.showTextOnly,
showLines = _ref.showLines,
_ref$style = _ref.style,
style = _ref$style === void 0 ? {} : _ref$style;
var html = (0,_react_17_0_2_react.useMemo)(function () {
// try {
// const latex = value || 'This is some text';
// let generator = new latexjs.default.HtmlGenerator({ hyphenate: true })
// let doc = latexjs.default.parse(latex, { generator: generator }).htmlDocument()
// return doc.body.innerHTML
// }catch(e){
// console.log("e:",e)
// return "错误的latex语法,请检查"
// }
return "";
}, [value]);
return /*#__PURE__*/(0,jsx_runtime.jsx)(jsx_runtime.Fragment, {
children: /*#__PURE__*/(0,jsx_runtime.jsx)("div", {
dangerouslySetInnerHTML: {
__html: html
}
})
});
});
// EXTERNAL MODULE: ./node_modules/_@babel_runtime@7.23.2@@babel/runtime/helpers/objectSpread2.js
var objectSpread2 = __webpack_require__(26801);
var objectSpread2_default = /*#__PURE__*/__webpack_require__.n(objectSpread2);
;// CONCATENATED MODULE: ./src/components/markdown-editor/toolbar/index.less
// extracted by mini-css-extract-plugin
;// CONCATENATED MODULE: ./src/components/markdown-editor/css/iconfont.css
// extracted by mini-css-extract-plugin
;// CONCATENATED MODULE: ./src/components/markdown-editor/toolbar/index.tsx
var DEFAULTICONS = [{
title: '粗体',
icon: 'icon-bold',
actionName: 'bold'
}, {
title: '斜体',
icon: 'icon-italic',
actionName: 'italic'
}, '|', {
title: '无序列表',
icon: 'icon-unorder-list',
actionName: 'list-ul'
}, {
title: '有序列表',
icon: 'icon-order-list',
actionName: 'list-ol'
}, '|', {
title: '行内代码',
icon: 'icon-code',
actionName: 'code'
}, {
title: '代码块(多语言风格)',
icon: 'icon-file-code',
actionName: 'code-block'
}, {
title: '链接',
icon: 'icon-link',
actionName: 'link'
}, '|', {
title: '行内公式',
icon: 'icon-sum',
actionName: 'inline-latex'
}, {
title: '多行公式',
icon: 'icon-formula',
actionName: 'latex'
}, '|', {
title: '添加图片',
icon: 'icon-picture',
actionName: 'upload-image'
}, {
title: '表格',
icon: 'icon-table',
actionName: 'add-table'
}, '|', {
title: '换行',
icon: 'icon-minus',
actionName: 'line-break'
}, {
title: '清空',
icon: 'icon-eraser',
actionName: 'eraser'
}];
function AButton(_ref) {
var onActionCallback = _ref.onActionCallback,
title = _ref.title,
icon = _ref.icon,
actionName = _ref.actionName,
_ref$className = _ref.className,
className = _ref$className === void 0 ? '' : _ref$className,
children = _ref.children;
function onAction() {
onActionCallback(actionName);
}
return /*#__PURE__*/(0,jsx_runtime.jsxs)("a", {
title: title,
className: className,
onClick: onAction,
children: [/*#__PURE__*/(0,jsx_runtime.jsx)("i", {
className: "md-iconfont ".concat(icon)
}), children]
});
}
/* harmony default export */ var toolbar = (function (_ref2) {
var watch = _ref2.watch,
showNullButton = _ref2.showNullButton,
showNullProgramButton = _ref2.showNullProgramButton,
onActionCallback = _ref2.onActionCallback,
fullScreen = _ref2.fullScreen,
insertTemp = _ref2.insertTemp,
hidetoolBar = _ref2.hidetoolBar;
var icons = [].concat(DEFAULTICONS, [{
title: "".concat(watch ? '关闭实时预览' : '开启实时预览'),
icon: "".concat(watch ? 'icon-eye-slash' : 'icon-eye'),
actionName: 'trigger-watch'
}]);
return /*#__PURE__*/(0,jsx_runtime.jsxs)("ul", {
className: "markdown-toolbar-container",
children: [!hidetoolBar && icons.map(function (item, index) {
return /*#__PURE__*/(0,jsx_runtime.jsx)("li", {
children: item.actionName ? /*#__PURE__*/(0,jsx_runtime.jsx)(AButton, objectSpread2_default()(objectSpread2_default()({}, item), {}, {
onActionCallback: onActionCallback
})) : /*#__PURE__*/(0,jsx_runtime.jsx)("span", {
className: "v-line"
})
}, index);
}), showNullButton ? /*#__PURE__*/(0,jsx_runtime.jsx)("li", {
children: /*#__PURE__*/(0,jsx_runtime.jsx)(AButton, {
icon: "icon-edit insert-blank",
className: "btn-null",
title: "\u589E\u52A0\u586B\u7A7A",
actionName: "add-null-ch",
onActionCallback: onActionCallback,
children: /*#__PURE__*/(0,jsx_runtime.jsx)("span", {
className: "fill-tip",
children: "\u70B9\u51FB\u63D2\u5165\b\u586B\u7A7A\u9879"
})
})
}) : null, showNullProgramButton ? /*#__PURE__*/(0,jsx_runtime.jsxs)(jsx_runtime.Fragment, {
children: [/*#__PURE__*/(0,jsx_runtime.jsx)("li", {
children: /*#__PURE__*/(0,jsx_runtime.jsx)(AButton, {
icon: "icon-edit insert-blank",
className: "btn-null",
title: "\u589E\u52A0\u586B\u7A7A",
actionName: "add-signal",
onActionCallback: onActionCallback,
children: /*#__PURE__*/(0,jsx_runtime.jsx)("span", {
className: "fill-tip",
children: "\u6DFB\u52A0\u5355\u884C\u586B\u7A7A\u9879"
})
})
}), /*#__PURE__*/(0,jsx_runtime.jsx)("li", {
children: /*#__PURE__*/(0,jsx_runtime.jsx)(AButton, {
icon: "icon-uniE900 insert-blank",
className: "btn-null",
title: "\u589E\u52A0\u586B\u7A7A",
actionName: "add-multiple",
onActionCallback: onActionCallback,
children: /*#__PURE__*/(0,jsx_runtime.jsx)("span", {
className: "fill-tip",
children: "\u6DFB\u52A0\u591A\u884C\u586B\u7A7A\u9879"
})
})
})]
}) : null, insertTemp && /*#__PURE__*/(0,jsx_runtime.jsx)("li", {
children: /*#__PURE__*/(0,jsx_runtime.jsx)(AButton, {
icon: "icon-edit",
className: "btn-null",
title: "\u63D2\u5165\u6A21\u677F",
actionName: "inster-template-".concat(insertTemp),
onActionCallback: onActionCallback,
children: /*#__PURE__*/(0,jsx_runtime.jsx)("span", {
className: "fill-tip",
children: "\u63D2\u5165\u6A21\u677F"
})
})
}), /*#__PURE__*/(0,jsx_runtime.jsx)("li", {
className: "btn-full-screen",
children: /*#__PURE__*/(0,jsx_runtime.jsx)(AButton, {
icon: "".concat(fullScreen ? 'icon-shrink' : 'icon-enlarge'),
title: fullScreen ? '关闭全屏' : '开启全屏',
actionName: "trigger-full-screen",
onActionCallback: onActionCallback
})
})]
});
});
// EXTERNAL MODULE: ./src/components/modal.tsx
var modal = __webpack_require__(44668);
// EXTERNAL MODULE: ./node_modules/_antd@5.9.0@antd/es/form/index.js + 19 modules
var es_form = __webpack_require__(78241);
// EXTERNAL MODULE: ./node_modules/_antd@5.9.0@antd/es/input/index.js + 5 modules
var input = __webpack_require__(1056);
// EXTERNAL MODULE: ./node_modules/_antd@5.9.0@antd/es/button/index.js
var es_button = __webpack_require__(3113);
;// CONCATENATED MODULE: ./src/components/markdown-editor/link/index.tsx
var formItemLayout = {
labelCol: {
span: 4
},
wrapperCol: {
span: 20
}
};
/* harmony default export */ var markdown_editor_link = (function (_ref) {
var callback = _ref.callback,
onCancel = _ref.onCancel;
function onSubmit(values) {
callback(values);
}
return /*#__PURE__*/(0,jsx_runtime.jsxs)(es_form/* default */.Z, objectSpread2_default()(objectSpread2_default()({}, formItemLayout), {}, {
initialValues: {
link: 'http://',
title: ''
},
className: "link-panel",
onFinish: onSubmit,
children: [/*#__PURE__*/(0,jsx_runtime.jsx)(es_form/* default */.Z.Item, {
label: "\u94FE\u63A5\u5730\u5740",
name: "link",
rules: [{
required: true,
message: '请输入链接地址'
}],
children: /*#__PURE__*/(0,jsx_runtime.jsx)(input/* default */.Z, {})
}), /*#__PURE__*/(0,jsx_runtime.jsx)(es_form/* default */.Z.Item, {
label: "\u94FE\u63A5\u6807\u9898",
name: "title",
rules: [{
required: true,
message: '请输入链接标题'
}],
children: /*#__PURE__*/(0,jsx_runtime.jsx)(input/* default */.Z, {})
}), /*#__PURE__*/(0,jsx_runtime.jsxs)("div", {
className: "flex-container flex-end",
children: [/*#__PURE__*/(0,jsx_runtime.jsx)(es_button/* default */.ZP, {
type: "primary",
htmlType: "submit",
style: {
marginRight: 10
},
children: "\u786E\u5B9A"
}), /*#__PURE__*/(0,jsx_runtime.jsx)(es_button/* default */.ZP, {
type: "ghost",
onClick: onCancel,
children: "\u53D6\u6D88"
})]
})]
}));
});
// EXTERNAL MODULE: ./src/components/markdown-editor/code-block/index.tsx
var code_block = __webpack_require__(95635);
// EXTERNAL MODULE: ./node_modules/_antd@5.9.0@antd/es/message/index.js + 4 modules
var message = __webpack_require__(8591);
;// CONCATENATED MODULE: ./src/components/markdown-editor/upload-image/index.less
// extracted by mini-css-extract-plugin
// EXTERNAL MODULE: ./src/pages/tasks/util.js
var util = __webpack_require__(56672);
;// CONCATENATED MODULE: ./src/components/markdown-editor/upload-image/index.tsx
var useForm = es_form/* default */.Z.useForm;
var style = {
width: 280,
marginRight: 10
};
var upload_image_formItemLayout = {
labelCol: {
span: 5
},
wrapperCol: {
span: 19
}
};
/* harmony default export */ var upload_image = (function (_ref) {
var callback = _ref.callback,
onCancel = _ref.onCancel;
var _useForm = useForm(),
_useForm2 = slicedToArray_default()(_useForm, 1),
form = _useForm2[0];
function onSubmit(values) {
callback(values);
}
function onAddUrl(data, file) {
if (data.status === -1) {
message/* default */.ZP.error(data.message);
return;
}
form.setFieldsValue({
src: "/api/attachments/".concat(data.id),
type: file.type
});
}
function onFileChange(e) {
var file = e.target.files[0];
uploadImage(file, onAddUrl);
}
return /*#__PURE__*/(0,jsx_runtime.jsxs)(es_form/* default */.Z, objectSpread2_default()(objectSpread2_default()({
form: form
}, upload_image_formItemLayout), {}, {
className: "upload-image-panel",
onFinish: onSubmit,
style: {
width: 470,
overflow: "hidden"
},
children: [/*#__PURE__*/(0,jsx_runtime.jsx)(es_form/* default */.Z.Item, {
label: "\u56FE\u7247\u5730\u5740",
required: true,
children: /*#__PURE__*/(0,jsx_runtime.jsxs)("div", {
className: "flex-container",
children: [/*#__PURE__*/(0,jsx_runtime.jsx)(es_form/* default */.Z.Item, {
noStyle: true,
name: "src",
rules: [{
required: true,
message: '请输入图片地址'
}],
children: /*#__PURE__*/(0,jsx_runtime.jsx)(input/* default */.Z, {
style: style
})
}), /*#__PURE__*/(0,jsx_runtime.jsx)(UploadButton, {
onFileChange: onFileChange
})]
})
}), /*#__PURE__*/(0,jsx_runtime.jsx)(es_form/* default */.Z.Item, {
label: "\u56FE\u7247\u63CF\u8FF0",
name: "alt"
// rules={[{ required: true, message: '请输入图片描述' }]}
,
children: /*#__PURE__*/(0,jsx_runtime.jsx)(input/* default */.Z, {
style: {
width: 264
}
})
}), /*#__PURE__*/(0,jsx_runtime.jsxs)(es_form/* default */.Z.Item, {
style: {
textAlign: "right"
},
children: [/*#__PURE__*/(0,jsx_runtime.jsx)(es_button/* default */.ZP, {
type: "primary",
htmlType: "submit",
style: {
marginRight: 10
},
children: "\u786E\u5B9A"
}), /*#__PURE__*/(0,jsx_runtime.jsx)(es_button/* default */.ZP, {
type: "default",
onClick: onCancel,
children: "\u53D6\u6D88"
})]
})]
}));
});
function UploadButton(_ref2) {
var onFileChange = _ref2.onFileChange;
return /*#__PURE__*/(0,jsx_runtime.jsxs)("label", {
className: "upload-button",
style: {
cursor: "pointer"
},
children: ["\u672C\u5730\u4E0A\u4F20", /*#__PURE__*/(0,jsx_runtime.jsx)("input", {
type: "file",
onChange: onFileChange
})]
});
}
function uploadImage(file, callback) {
if (!file) {
throw new String('没有文件');
return;
}
var formData = new FormData();
formData.append('editormd-image-file', file);
formData.append('file_param_name', 'editormd-image-file');
formData.append('byxhr', 'true');
var xhr = new window.XMLHttpRequest();
xhr.withCredentials = true;
xhr.addEventListener('load', function (response) {
callback(JSON.parse(response.target.responseText), file);
}, false);
xhr.addEventListener('error', function (error) {
console.error(error);
}, false);
xhr.open('POST', "".concat(util/* apiPref */.KI, "/api/attachments.json"));
xhr.send(formData);
}
// EXTERNAL MODULE: ./node_modules/_antd@5.9.0@antd/es/radio/index.js + 5 modules
var es_radio = __webpack_require__(5112);
// EXTERNAL MODULE: ./node_modules/_antd@5.9.0@antd/es/input-number/index.js + 14 modules
var input_number = __webpack_require__(85731);
;// CONCATENATED MODULE: ./src/components/markdown-editor/add-table-panel/index.tsx
var RadioGroup = es_radio/* default.Group */.ZP.Group;
var add_table_panel_style = {
margin: '0 8px'
};
/* harmony default export */ var add_table_panel = (function (_ref) {
var callback = _ref.callback,
onCancel = _ref.onCancel;
function onSubmit(values) {
callback(values);
}
return /*#__PURE__*/(0,jsx_runtime.jsxs)(es_form/* default */.Z, {
className: "add-table-panel",
initialValues: {
row: 3,
col: 2,
align: 'default'
},
onFinish: onSubmit,
children: [/*#__PURE__*/(0,jsx_runtime.jsxs)("div", {
className: "flex-container",
style: {
alignItems: "baseline"
},
children: [/*#__PURE__*/(0,jsx_runtime.jsx)("span", {
style: add_table_panel_style,
children: "\u5355\u5143\u683C\u6570\uFF1A"
}), /*#__PURE__*/(0,jsx_runtime.jsx)("span", {
style: add_table_panel_style,
children: "\u884C\u6570"
}), /*#__PURE__*/(0,jsx_runtime.jsx)(es_form/* default */.Z.Item, {
name: "row",
rules: [{
required: true,
message: '请输入行数'
}],
children: /*#__PURE__*/(0,jsx_runtime.jsx)(input_number/* default */.Z, {})
}), /*#__PURE__*/(0,jsx_runtime.jsx)("span", {
style: add_table_panel_style,
children: "\u5217\u6570"
}), /*#__PURE__*/(0,jsx_runtime.jsx)(es_form/* default */.Z.Item, {
name: "col",
rules: [{
required: true,
message: '请输入列数'
}],
children: /*#__PURE__*/(0,jsx_runtime.jsx)(input_number/* default */.Z, {})
})]
}), /*#__PURE__*/(0,jsx_runtime.jsxs)("div", {
className: "flex-container",
style: {
marginTop: 12,
alignItems: "baseline"
},
children: [/*#__PURE__*/(0,jsx_runtime.jsx)("span", {
style: add_table_panel_style,
children: "\u5BF9\u9F50\u65B9\u5F0F\uFF1A"
}), /*#__PURE__*/(0,jsx_runtime.jsx)(es_form/* default */.Z.Item, {
name: "align",
children: /*#__PURE__*/(0,jsx_runtime.jsxs)(RadioGroup, {
children: [/*#__PURE__*/(0,jsx_runtime.jsx)(es_radio/* default */.ZP, {
value: "default",
children: /*#__PURE__*/(0,jsx_runtime.jsx)("i", {
className: "fa fa-align-justify"
})
}), /*#__PURE__*/(0,jsx_runtime.jsx)(es_radio/* default */.ZP, {
value: "left",
children: /*#__PURE__*/(0,jsx_runtime.jsx)("i", {
className: "fa fa-align-left"
})
}), /*#__PURE__*/(0,jsx_runtime.jsx)(es_radio/* default */.ZP, {
value: "center",
children: /*#__PURE__*/(0,jsx_runtime.jsx)("i", {
className: "fa fa-align-center"
})
}), /*#__PURE__*/(0,jsx_runtime.jsx)(es_radio/* default */.ZP, {
value: "right",
children: /*#__PURE__*/(0,jsx_runtime.jsx)("i", {
className: "fa fa-align-right"
})
})]
})
})]
}), /*#__PURE__*/(0,jsx_runtime.jsxs)("div", {
className: "flex-container flex-end",
children: [/*#__PURE__*/(0,jsx_runtime.jsx)(es_button/* default */.ZP, {
type: "primary",
htmlType: "submit",
style: {
marginRight: 10
},
children: "\u786E\u5B9A"
}), /*#__PURE__*/(0,jsx_runtime.jsx)(es_button/* default */.ZP, {
type: "ghost",
onClick: onCancel,
children: "\u53D6\u6D88"
})]
})]
});
});
// EXTERNAL MODULE: ./src/utils/env.ts + 1 modules
var env = __webpack_require__(47015);
// EXTERNAL MODULE: ./node_modules/_antd@5.9.0@antd/es/modal/index.js + 16 modules
var es_modal = __webpack_require__(43418);
;// CONCATENATED MODULE: ./src/components/markdown-editor/constant.ts
var LINK = 'link';
var UPLOAD_IMAGE = 'upload-image';
var CODE_BLOCK = 'code-block';
var ADD_TABLE = 'add-table';
var HRLINE = '------------';
var ALIGNSIGN = {
"default": HRLINE,
left: ":".concat(HRLINE),
center: ":".concat(HRLINE, ":"),
right: "".concat(HRLINE, ":")
};
// EXTERNAL MODULE: ./src/components/useInterval.tsx
var useInterval = __webpack_require__(14332);
;// CONCATENATED MODULE: ./src/components/markdown-editor/index.tsx
var _DEFAULTKEYMAP, _TitleDesc;
function noop() {}
var pending = 0;
var StorageTimeTicket = 10000;
var NULL_CH = '▁';
var ADD_MULTI = '@▁▁@';
var ADD_SINGLE = '@▁@';
var TEMP1 = '\n**模板标题**\n模板正文内容,可输入文本内容和粘贴图片等操作'; //课程须知模板
function processSize(size) {
return !/^\d+$/.test(size) ? size : "".concat(size, "px");
}
var isMac = navigator.platform.toUpperCase().indexOf('MAC') >= 0;
var key = isMac ? 'Cmd' : 'Ctrl';
var DEFAULTKEYMAP = (_DEFAULTKEYMAP = {}, defineProperty_default()(_DEFAULTKEYMAP, key + '-B', 'bold'), defineProperty_default()(_DEFAULTKEYMAP, key + '-I', 'italic'), _DEFAULTKEYMAP);
var TitleDesc = (_TitleDesc = {}, defineProperty_default()(_TitleDesc, LINK, '添加链接'), defineProperty_default()(_TitleDesc, CODE_BLOCK, '添加代码块'), defineProperty_default()(_TitleDesc, UPLOAD_IMAGE, '添加图片'), defineProperty_default()(_TitleDesc, ADD_TABLE, '添加表格'), _TitleDesc);
//https://codemirror.net/demo
//The height can be set through CSS (by giving the .CodeMirror class a height property), or by calling the cm's setSize method.
/* harmony default export */ var markdown_editor = (function (_ref) {
var _ref$defaultValue = _ref.defaultValue,
defaultValue = _ref$defaultValue === void 0 ? '' : _ref$defaultValue,
onChange = _ref.onChange,
_ref$width = _ref.width,
width = _ref$width === void 0 ? '100%' : _ref$width,
_ref$height = _ref.height,
height = _ref$height === void 0 ? 400 : _ref$height,
_ref$miniToolbar = _ref.miniToolbar,
miniToolbar = _ref$miniToolbar === void 0 ? false : _ref$miniToolbar,
_ref$isFocus = _ref.isFocus,
isFocus = _ref$isFocus === void 0 ? false : _ref$isFocus,
watch = _ref.watch,
insertTemp = _ref.insertTemp,
_ref$mode = _ref.mode,
mode = _ref$mode === void 0 ? "markdown" : _ref$mode,
_ref$id = _ref.id,
id = _ref$id === void 0 ? 'markdown-editor-id' : _ref$id,
_ref$showResizeBar = _ref.showResizeBar,
showResizeBar = _ref$showResizeBar === void 0 ? false : _ref$showResizeBar,
_ref$noStorage = _ref.noStorage,
noStorage = _ref$noStorage === void 0 ? false : _ref$noStorage,
_ref$showNullButton = _ref.showNullButton,
showNullButton = _ref$showNullButton === void 0 ? false : _ref$showNullButton,
_ref$showNullProgramB = _ref.showNullProgramButton,
showNullProgramButton = _ref$showNullProgramB === void 0 ? false : _ref$showNullProgramB,
_ref$hidetoolBar = _ref.hidetoolBar,
hidetoolBar = _ref$hidetoolBar === void 0 ? false : _ref$hidetoolBar,
_ref$fullScreen = _ref.fullScreen,
fullScreen = _ref$fullScreen === void 0 ? false : _ref$fullScreen,
onBlur = _ref.onBlur,
onCMBeforeChange = _ref.onCMBeforeChange,
onFullScreen = _ref.onFullScreen,
_ref$className = _ref.className,
className = _ref$className === void 0 ? '' : _ref$className,
_ref$disablePaste = _ref.disablePaste,
disablePaste = _ref$disablePaste === void 0 ? false : _ref$disablePaste,
_ref$disabled = _ref.disabled,
disabled = _ref$disabled === void 0 ? false : _ref$disabled,
_ref$disabledFill = _ref.disabledFill,
disabledFill = _ref$disabledFill === void 0 ? false : _ref$disabledFill,
_ref$placeholder = _ref.placeholder,
placeholder = _ref$placeholder === void 0 ? '' : _ref$placeholder,
_ref$values = _ref.values,
values = _ref$values === void 0 ? '' : _ref$values;
var _useState = (0,_react_17_0_2_react.useState)(null),
_useState2 = slicedToArray_default()(_useState, 2),
cm = _useState2[0],
setCm = _useState2[1];
var _useState3 = (0,_react_17_0_2_react.useState)(defaultValue),
_useState4 = slicedToArray_default()(_useState3, 2),
value = _useState4[0],
setValue = _useState4[1];
var _useState5 = (0,_react_17_0_2_react.useState)(watch),
_useState6 = slicedToArray_default()(_useState5, 2),
preview = _useState6[0],
setPreview = _useState6[1];
var _useState7 = (0,_react_17_0_2_react.useState)(fullScreen),
_useState8 = slicedToArray_default()(_useState7, 2),
isFull = _useState8[0],
setIsFull = _useState8[1];
var _useState9 = (0,_react_17_0_2_react.useState)(''),
_useState10 = slicedToArray_default()(_useState9, 2),
action = _useState10[0],
setAction = _useState10[1];
var _useState11 = (0,_react_17_0_2_react.useState)(0),
_useState12 = slicedToArray_default()(_useState11, 2),
lastedUpdateTime = _useState12[0],
setLastedUpdateTime = _useState12[1];
var _useState13 = (0,_react_17_0_2_react.useState)(height),
_useState14 = slicedToArray_default()(_useState13, 2),
h = _useState14[0],
setH = _useState14[1];
var _useState15 = (0,_react_17_0_2_react.useState)(false),
_useState16 = slicedToArray_default()(_useState15, 2),
tip = _useState16[0],
setTip = _useState16[1];
var cmEl = (0,_react_17_0_2_react.useRef)();
var containerEl = (0,_react_17_0_2_react.useRef)();
var resizeBarEl = (0,_react_17_0_2_react.useRef)();
var previewEl = (0,_react_17_0_2_react.useRef)();
// useEffect(() => {
// setValue(defaultValue)
// cm?.setValue(defaultValue)
// },[])
(0,_react_17_0_2_react.useEffect)(function () {
var scrollTop = window.scrollY || window.pageYOffset;
setValue(values);
cm === null || cm === void 0 || cm.setValue(values);
window.scrollTo(0, scrollTop);
}, [values]);
(0,_react_17_0_2_react.useEffect)(function () {
onFullScreen === null || onFullScreen === void 0 || onFullScreen(isFull);
}, [isFull]);
(0,_react_17_0_2_react.useEffect)(function () {
if (cmEl.current) {
var onPaste = function onPaste(_, e) {
if (disablePaste) {
e.preventDefault();
return;
}
var clipboardData = e.clipboardData;
if (clipboardData) {
var types = clipboardData.types.toString();
var items = clipboardData.items;
var officeSix = ["pptm", "pptx", "ppt", "pot", "pps", "ppa", "potx", "ppsx", "ppam", "pptm", "potm", "ppsm", "doc", "docx", "dot", "dotx", "docm", "dotm", "xls", "xlsx", "csv", "xlt", "xla", "xltx", "xlsm", "xltm", "xlam", "xlsb"];
if (types === 'Files' || clipboardData.types.indexOf("Files") > -1) {
e.preventDefault();
if (mode == "stex") return;
try {
var _items$;
var item = items[1];
if (((_items$ = items[0]) === null || _items$ === void 0 ? void 0 : _items$.kind) === 'file') {
item = items[0];
}
var file = item.getAsFile();
var fileSix = file.name.split(".").pop();
// console.log("item:", item, file, item?.type?.match(/^video\//i))
uploadImage(file, function (data) {
if (data.id) {
var _file$type, _file$type2, _file$type3;
if ((file === null || file === void 0 || (_file$type = file.type) === null || _file$type === void 0 ? void 0 : _file$type.indexOf("image")) > -1) {
instance.replaceSelection(".concat(data.content_type, ")"));
} else if ((file === null || file === void 0 || (_file$type2 = file.type) === null || _file$type2 === void 0 ? void 0 : _file$type2.indexOf("video")) > -1) {
instance.replaceSelection(""));
} else if ((file === null || file === void 0 || (_file$type3 = file.type) === null || _file$type3 === void 0 ? void 0 : _file$type3.indexOf("pdf")) > -1) {
instance.replaceSelection("").concat(file.name, ""));
} else if (officeSix.includes(fileSix)) {
instance.replaceSelection("").concat(file.name, ""));
} else {
instance.replaceSelection("[".concat(file.name, "](").concat(env/* default */.Z.API_SERVER, "/api/attachments/").concat(data.id, "?type=").concat(data.content_type, ")"));
}
} else {
if ((data === null || data === void 0 ? void 0 : data.status) === 401) document.location.href = '/user/login';
}
});
} catch (e) {
message/* default */.ZP.warning("请使用chrome浏览器粘贴");
}
return true;
} else {
//toMarkdown ?
// let html = clipboardData.getData('text/html')
return true;
}
}
return true;
};
var instance = codemirror_default().fromTextArea(cmEl.current, {
mode: mode,
// inputStyle: 'contenteditable',
lineNumbers: miniToolbar ? false : true,
lineWrapping: true,
value: defaultValue,
autoCloseTags: true,
autoCloseBrackets: true
});
instance.on("keyup", function (cm, event) {
if (event.keyCode === 8) {
if (cm.getValue() == "") {
instance.setOption("placeholder", placeholder);
} else {
instance.setOption("placeholder", null);
}
}
});
instance.on("keydown", function (cm, event) {
if (event.keyCode === 8) {
var pos = deleteAtSymbol(cm);
if (pos) {
event.preventDefault();
}
}
});
isFocus && instance.focus();
instance.on('paste', onPaste);
if (disabled) {
instance.on("beforeChange", function (instances, change) {
if (change.origin === "paste" || change.origin === "+input") {
change.cancel();
}
});
}
setCm(instance);
return function () {
instance.off('paste', onPaste);
};
}
}, []);
var resizeEditorBodyHeight = (0,_react_17_0_2_react.useCallback)(function () {
if (containerEl.current) {
try {
// let toolH = containerEl.current.getElementsByClassName('markdown-toolbar-container')[0].offsetHeight
// let mdBody = containerEl.current.getElementsByClassName('markdown-editor-body')[0]
// if (!isFull) {
// mdBody.style.height = `${h - toolH}px`
// } else {
// mdBody.style.height = `calc(100vh - ${toolH}px)`
// }
} catch (error) {
console.log(error, '---- to set md editor body height');
}
}
}, [h, containerEl, isFull]);
(0,_react_17_0_2_react.useEffect)(function () {
function onLayout() {
var ro = new ResizeObserver_es/* default */.Z(function (entries) {
var _iterator = createForOfIteratorHelper_default()(entries),
_step;
try {
for (_iterator.s(); !(_step = _iterator.n()).done;) {
var entry = _step.value;
if (entry.target.offsetHeight > 0 || entry.target.offsetWidth > 0) {
resizeEditorBodyHeight();
cm.setSize('100%', '100%');
cm.refresh();
}
}
} catch (err) {
_iterator.e(err);
} finally {
_iterator.f();
}
});
ro.observe(cmEl.current.parentElement);
return ro;
}
if (cm) {
var ro = onLayout();
return function () {
var _cmEl$current, _cmEl$current2;
if ((_cmEl$current = cmEl.current) !== null && _cmEl$current !== void 0 && _cmEl$current.parentElement) ro.unobserve((_cmEl$current2 = cmEl.current) === null || _cmEl$current2 === void 0 ? void 0 : _cmEl$current2.parentElement);
};
}
}, [cm, resizeEditorBodyHeight]);
//keymap
(0,_react_17_0_2_react.useEffect)(function () {
if (cm) {
var keymap = [];
var _loop = function _loop() {
var _Object$entries$_i = slicedToArray_default()(_Object$entries[_i], 2),
k = _Object$entries$_i[0],
value = _Object$entries$_i[1];
var map = defineProperty_default()({}, k, function () {
onActionCallback(value);
});
keymap.push(map);
cm.addKeyMap(map);
};
for (var _i = 0, _Object$entries = Object.entries(DEFAULTKEYMAP); _i < _Object$entries.length; _i++) {
_loop();
}
return function () {
for (var _i2 = 0, _keymap = keymap; _i2 < _keymap.length; _i2++) {
var m = _keymap[_i2];
cm.removeKeyMap(m);
}
};
}
}, [cm]);
(0,_react_17_0_2_react.useEffect)(function () {
if (fullScreen !== isFull) {
setIsFull(fullScreen);
}
}, [fullScreen]);
(0,useInterval/* default */.Z)(function () {
if (!noStorage && lastedUpdateTime > 0) {
var currentTime = new Date().getTime();
var lastedValue = window.sessionStorage.getItem(id);
if (currentTime >= lastedUpdateTime + StorageTimeTicket && (!lastedValue || lastedValue !== value)) {
window.sessionStorage.setItem(id, value);
setTip(true);
}
}
}, StorageTimeTicket);
(0,_react_17_0_2_react.useEffect)(function () {
setPreview(watch);
}, [cm, watch]);
(0,_react_17_0_2_react.useEffect)(function () {
if (cm) {
isFocus && cm.focus();
}
}, [cm, isFocus]);
(0,_react_17_0_2_react.useEffect)(function () {
if (preview && cm) {
var syncScroll = function syncScroll(e) {
var target = e.target;
if (previewEl.current) {
var ratio = target.scrollTop / target.scrollHeight;
previewEl.current.scrollTop = previewEl.current.scrollHeight * ratio;
}
};
var scrollEl = cm.getScrollerElement();
scrollEl.addEventListener('scroll', syncScroll);
return function () {
scrollEl.removeEventListener('scroll', syncScroll);
};
}
}, [cm, preview]);
(0,_react_17_0_2_react.useEffect)(function () {
if (cm && onCMBeforeChange) {
var onChangeHandler = function onChangeHandler(cm, change) {
onCMBeforeChange(cm, change);
};
cm.on('beforeChange', onChangeHandler);
return function () {
cm.off('beforeChange', onChangeHandler);
};
}
}, [cm, onCMBeforeChange]);
(0,_react_17_0_2_react.useEffect)(function () {
if (cm && onBlur) {
var onBlurHandler = function onBlurHandler() {
onBlur(cm.getValue());
};
cm.on('blur', onBlurHandler);
return function () {
cm.off('blur', onBlurHandler);
};
}
}, [cm, onBlur]);
function deleteAtSymbol(cm, change) {
var doc = cm.getDoc();
var cursor = doc.getCursor();
var line = doc.getLine(cursor.line);
var ch = line.charAt(cursor.ch - 1);
var p1 = line.lastIndexOf("@▁@", cursor.ch);
var p2 = line.lastIndexOf("@▁▁@", cursor.ch);
var posStart = p1 > p2 ? p1 : p2;
var n = p1 > p2 ? 3 : 4;
if (ADD_MULTI.indexOf(ch) === -1) return null;
console.log("change1:", change, cm, line, cursor, posStart, p1, p2, ch);
if (posStart >= 0 && cursor.ch - posStart < 5) {
var posEnd = posStart + n;
doc.replaceRange("", {
line: cursor.line,
ch: posStart
}, {
line: cursor.line,
ch: posEnd
});
return {
line: cursor.line,
ch: posEnd
};
}
return null;
}
(0,_react_17_0_2_react.useEffect)(function () {
if (cm) {
var onChangeHandler = function onChangeHandler(cm, change) {
var content = cm.getValue();
setValue(content);
setLastedUpdateTime(new Date().getTime());
cm.getScrollerElement().dispatchEvent(new CustomEvent('scroll'));
if (onChange) {
if (showNullProgramButton) {
onChange(content, formatProgramFill(content));
} else {
onChange(content);
}
}
};
cm.on('change', onChangeHandler);
return function () {
cm.off('change', onChangeHandler);
};
}
}, [cm, onChange]);
(0,_react_17_0_2_react.useEffect)(function () {
if (cm) {
// isFocus && cm.focus()
if (defaultValue === null || defaultValue === undefined) {
cm.setValue('');
setValue('');
} else {
var scrollTop = window.scrollY || window.pageYOffset;
if (defaultValue !== cm.getValue()) {
cm.setValue(defaultValue);
setValue(defaultValue);
cm.setCursor(disabled ? 1 : cm.lineCount(), 0);
window.scrollTo(0, scrollTop);
}
}
}
}, [cm, defaultValue]);
var onActionCallback = (0,_react_17_0_2_react.useCallback)(function (actionName) {
var cursor = cm.getCursor();
var selection = cm.getSelection();
var selectionText = selection.split('\n');
switch (actionName) {
case 'bold':
cm.replaceSelection('**' + selection + '**');
if (selection === '') {
cm.setCursor(cursor.line, cursor.ch + 2);
}
return cm.focus();
case 'italic':
cm.replaceSelection('*' + selection + '*');
if (selection === '') {
cm.setCursor(cursor.line, cursor.ch + 1);
}
return cm.focus();
case 'code':
cm.replaceSelection('`' + selection + '`');
if (selection === '') {
cm.setCursor(cursor.line, cursor.ch + 1);
}
return cm.focus();
case 'inline-latex':
cm.replaceSelection('`$$' + selection + '$$`');
if (selection === '') {
cm.setCursor(cursor.line, cursor.ch + 3);
}
return cm.focus();
case 'latex':
cm.replaceSelection("```latex\n" + selection + "\n```");
cm.setCursor(cursor.line + 1, selection.length + 1);
return cm.focus();
case 'line-break':
cm.replaceSelection('
\n');
return cm.focus();
case 'list-ul':
if (selection === '') {
cm.replaceSelection('- ' + selection);
} else {
cm.replaceSelection(selectionText.map(function (item) {
return item === '' ? '' : "- ".concat(item);
}).join('\n'));
}
return cm.focus();
case 'list-ol':
if (selection === '') {
cm.replaceSelection('1. ' + selection);
} else {
cm.replaceSelection(selectionText.map(function (item, index) {
return item === '' ? '' : "".concat(index + 1, ". ").concat(item);
}).join('\n'));
}
return cm.focus();
case 'add-null-ch':
if (selection === '') {
cm.setCursor(cursor.line, cursor.ch);
}
cm.replaceSelection(NULL_CH);
return cm.focus();
case 'add-signal':
if (selection === '') {
cm.setCursor(cursor.line, cursor.ch);
}
cm.replaceSelection(ADD_SINGLE);
return cm.focus();
case 'add-multiple':
if (selection === '') {
cm.setCursor(cursor.line, cursor.ch);
}
cm.replaceSelection(ADD_MULTI);
return cm.focus();
case 'inster-template-1':
if (selection === '') {
cm.setCursor(cursor.line, cursor.ch);
}
cm.replaceSelection(TEMP1);
return cm.focus();
case 'eraser':
cm.setValue('');
return cm.focus();
case 'trigger-watch':
setPreview(!preview);
return cm.focus();
case 'trigger-full-screen':
setIsFull(!isFull);
return cm.focus();
case LINK:
setAction(LINK);
return;
case CODE_BLOCK:
setAction(CODE_BLOCK);
return;
case UPLOAD_IMAGE:
setAction(UPLOAD_IMAGE);
return;
case ADD_TABLE:
setAction(ADD_TABLE);
return;
default:
throw new Error();
}
}, [cm, preview, isFull]);
var ExecutePluginAction = (0,_react_17_0_2_react.useCallback)(function (values) {
setAction('');
switch (action) {
case LINK:
var title = values.title,
link = values.link;
cm.replaceSelection("[".concat(title, "](").concat(link, ")"));
return cm.focus();
case CODE_BLOCK:
var language = values.language,
content = values.content;
cm.replaceSelection(['```' + language, content, '```'].join('\n'));
return cm.focus();
case UPLOAD_IMAGE:
var src = values.src,
alt = values.alt;
if (alt) {
cm.replaceSelection(".concat(src, " \"").concat(alt, "\" )"));
} else {
cm.replaceSelection(""));
}
return cm.focus();
case ADD_TABLE:
var row = values.row,
col = values.col,
align = values.align;
var table = '\n';
for (var r = 0; r < row; r++) {
var rows = [];
var heads = [];
for (var c = 0; c < col; c++) {
if (r === 1) {
heads.push(ALIGNSIGN[align]);
}
rows.push(' ');
}
if (r === 1) {
table += "| ".concat(heads.join(' | '), " |\n");
}
table += "| ".concat(rows.join(col === 1 ? '' : ' | '), " |\n");
}
cm.replaceSelection(table + '\n');
return cm.focus();
default:
throw new Error();
}
}, [cm, action]);
var PluginEl = (0,_react_17_0_2_react.useMemo)(function () {
switch (action) {
case LINK:
return /*#__PURE__*/(0,jsx_runtime.jsx)(markdown_editor_link, {
callback: ExecutePluginAction,
onCancel: onCancel
});
case CODE_BLOCK:
return /*#__PURE__*/(0,jsx_runtime.jsx)(code_block/* default */.Z, {
callback: ExecutePluginAction,
onCancel: onCancel
});
case UPLOAD_IMAGE:
return /*#__PURE__*/(0,jsx_runtime.jsx)(upload_image, {
callback: ExecutePluginAction,
onCancel: onCancel
});
case ADD_TABLE:
return /*#__PURE__*/(0,jsx_runtime.jsx)(add_table_panel, {
callback: ExecutePluginAction,
onCancel: onCancel
});
default:
return null;
}
}, [action]);
function onCancel() {
setAction('');
}
(0,_react_17_0_2_react.useEffect)(function () {
if (resizeBarEl.current) {
var onMouseDown = function onMouseDown(e) {
dragging = true;
startY = e.pageY;
};
var onMouseUp = function onMouseUp() {
dragging = false;
};
var onMouseMove = function onMouseMove(e) {
if (dragging) {
var delta = e.pageY - startY;
if (delta < 0) {
delta = 0;
}
if (delta > 300) {
delta = 300;
}
var resizeH = height + delta + 'px';
setH(resizeH);
}
};
var resizeBar = resizeBarEl.current;
var dragging = false;
var startY = 0;
resizeBar.addEventListener('mousedown', onMouseDown);
document.addEventListener('mousemove', onMouseMove);
document.addEventListener('mouseup', onMouseUp);
return function () {
resizeBar.removeEventListener('mousedown', onMouseDown);
document.removeEventListener('mousemove', onMouseMove);
document.removeEventListener('mouseup', onMouseUp);
};
}
}, [cm, resizeBarEl]);
(0,_react_17_0_2_react.useEffect)(function () {
setH(height);
}, [height]);
var fixedWidth = processSize(width);
var fixedHeight = processSize(h);
var style = {
width: fixedWidth,
height: fixedHeight
};
var saveTime = (0,_react_17_0_2_react.useMemo)(function () {
if (lastedUpdateTime) {
var d = new Date(lastedUpdateTime);
var _h = d.getHours();
var m = d.getMinutes();
var s = d.getSeconds();
_h = _h < 10 ? '0' + _h : _h;
m = m < 10 ? '0' + m : m;
s = s < 10 ? '0' + s : s;
return "".concat(_h, ":").concat(m, ":").concat(s);
}
return 0;
}, [lastedUpdateTime]);
var formatProgramFill = function formatProgramFill(str) {
var arr = [];
if (showNullProgramButton) {
var num = -1;
str = str.replace(/(@▁▁@|@▁@)/g, function (a, b, c) {
arr.push({
multiLine: !(a === ADD_SINGLE)
});
});
}
return arr;
};
function onCancelStorage() {
window.sessionStorage.removeItem(id);
setTip(false);
setLastedUpdateTime(0);
}
function onReset() {
setTip(false);
setLastedUpdateTime(0);
cm.setValue(window.sessionStorage.getItem(id));
}
return /*#__PURE__*/(0,jsx_runtime.jsxs)(_react_17_0_2_react.Fragment, {
children: [/*#__PURE__*/(0,jsx_runtime.jsx)("div", {
className: "markdown-editor-wrapper",
ref: containerEl,
children: /*#__PURE__*/(0,jsx_runtime.jsxs)("div", {
className: "markdown-editor-container ".concat(className, " ").concat(preview ? 'on-preview' : '', " ").concat(miniToolbar ? 'mini' : '', " ").concat(isFull ? 'full-screen' : ''),
style: style,
children: [/*#__PURE__*/(0,jsx_runtime.jsx)(toolbar, {
insertTemp: insertTemp,
watch: preview,
fullScreen: isFull,
showNullButton: showNullButton,
showNullProgramButton: showNullProgramButton,
onActionCallback: onActionCallback,
hidetoolBar: hidetoolBar
}), /*#__PURE__*/(0,jsx_runtime.jsxs)("div", {
className: "markdown-editor-body",
children: [/*#__PURE__*/(0,jsx_runtime.jsx)("div", {
className: "codemirror-container",
children: /*#__PURE__*/(0,jsx_runtime.jsx)("textarea", {
ref: cmEl,
placeholder: placeholder
})
}), preview ? /*#__PURE__*/(0,jsx_runtime.jsxs)("div", {
ref: previewEl,
className: "preview-container",
children: [mode === "stex" && /*#__PURE__*/(0,jsx_runtime.jsx)(RenderHtml_stex, {
value: value
}), mode !== "stex" && /*#__PURE__*/(0,jsx_runtime.jsx)(RenderHtml/* default */.Z, {
disabledFill: disabledFill,
showProgramFill: showNullProgramButton,
value: value
})]
}) : null]
})]
})
}), showResizeBar ? /*#__PURE__*/(0,jsx_runtime.jsx)("a", {
ref: resizeBarEl,
className: "editor-resize"
}) : null, /*#__PURE__*/(0,jsx_runtime.jsx)(modal/* default */.Z, {
children: TitleDesc[action] ? /*#__PURE__*/(0,jsx_runtime.jsx)(es_modal/* default */.Z, {
centered: true,
title: TitleDesc[action],
open: true,
onCancel: onCancel,
footer: null,
className: "markdown-popup-form",
children: PluginEl
}) : null
})]
});
});
/***/ }),
/***/ 44668:
/*!**********************************!*\
!*** ./src/components/modal.tsx ***!
\**********************************/
/***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) {
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */ Z: function() { return /* binding */ Dialog; }
/* harmony export */ });
/* harmony import */ var _root_workspace_ppte5yg23_SJ5m_develop_node_modules_babel_runtime_7_23_2_babel_runtime_helpers_classCallCheck_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./node_modules/_@babel_runtime@7.23.2@@babel/runtime/helpers/classCallCheck.js */ 94312);
/* harmony import */ var _root_workspace_ppte5yg23_SJ5m_develop_node_modules_babel_runtime_7_23_2_babel_runtime_helpers_classCallCheck_js__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_root_workspace_ppte5yg23_SJ5m_develop_node_modules_babel_runtime_7_23_2_babel_runtime_helpers_classCallCheck_js__WEBPACK_IMPORTED_MODULE_0__);
/* harmony import */ var _root_workspace_ppte5yg23_SJ5m_develop_node_modules_babel_runtime_7_23_2_babel_runtime_helpers_createClass_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./node_modules/_@babel_runtime@7.23.2@@babel/runtime/helpers/createClass.js */ 24127);
/* harmony import */ var _root_workspace_ppte5yg23_SJ5m_develop_node_modules_babel_runtime_7_23_2_babel_runtime_helpers_createClass_js__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_root_workspace_ppte5yg23_SJ5m_develop_node_modules_babel_runtime_7_23_2_babel_runtime_helpers_createClass_js__WEBPACK_IMPORTED_MODULE_1__);
/* harmony import */ var _root_workspace_ppte5yg23_SJ5m_develop_node_modules_babel_runtime_7_23_2_babel_runtime_helpers_inherits_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./node_modules/_@babel_runtime@7.23.2@@babel/runtime/helpers/inherits.js */ 93242);
/* harmony import */ var _root_workspace_ppte5yg23_SJ5m_develop_node_modules_babel_runtime_7_23_2_babel_runtime_helpers_inherits_js__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(_root_workspace_ppte5yg23_SJ5m_develop_node_modules_babel_runtime_7_23_2_babel_runtime_helpers_inherits_js__WEBPACK_IMPORTED_MODULE_2__);
/* harmony import */ var _root_workspace_ppte5yg23_SJ5m_develop_node_modules_babel_runtime_7_23_2_babel_runtime_helpers_createSuper_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./node_modules/_@babel_runtime@7.23.2@@babel/runtime/helpers/createSuper.js */ 10564);
/* harmony import */ var _root_workspace_ppte5yg23_SJ5m_develop_node_modules_babel_runtime_7_23_2_babel_runtime_helpers_createSuper_js__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__webpack_require__.n(_root_workspace_ppte5yg23_SJ5m_develop_node_modules_babel_runtime_7_23_2_babel_runtime_helpers_createSuper_js__WEBPACK_IMPORTED_MODULE_3__);
/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! react */ 59301);
/* harmony import */ var react_dom__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! react-dom */ 4676);
var Dialog = /*#__PURE__*/function (_React$Component) {
_root_workspace_ppte5yg23_SJ5m_develop_node_modules_babel_runtime_7_23_2_babel_runtime_helpers_inherits_js__WEBPACK_IMPORTED_MODULE_2___default()(Dialog, _React$Component);
var _super = _root_workspace_ppte5yg23_SJ5m_develop_node_modules_babel_runtime_7_23_2_babel_runtime_helpers_createSuper_js__WEBPACK_IMPORTED_MODULE_3___default()(Dialog);
function Dialog(props) {
var _this;
_root_workspace_ppte5yg23_SJ5m_develop_node_modules_babel_runtime_7_23_2_babel_runtime_helpers_classCallCheck_js__WEBPACK_IMPORTED_MODULE_0___default()(this, Dialog);
_this = _super.call(this, props);
var doc = window.document;
_this.node = doc.createElement('div');
doc.body.appendChild(_this.node);
return _this;
}
_root_workspace_ppte5yg23_SJ5m_develop_node_modules_babel_runtime_7_23_2_babel_runtime_helpers_createClass_js__WEBPACK_IMPORTED_MODULE_1___default()(Dialog, [{
key: "render",
value: function render() {
var children = this.props.children;
return /*#__PURE__*/(0,react_dom__WEBPACK_IMPORTED_MODULE_5__.createPortal)(children, this.node);
}
}, {
key: "componentWillUnmount",
value: function componentWillUnmount() {
window.document.body.removeChild(this.node);
}
}]);
return Dialog;
}(react__WEBPACK_IMPORTED_MODULE_4__.Component);
/***/ }),
/***/ 14332:
/*!****************************************!*\
!*** ./src/components/useInterval.tsx ***!
\****************************************/
/***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) {
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */ Z: function() { return /* binding */ useInterval; }
/* harmony export */ });
/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! react */ 59301);
function useInterval(callback, delay) {
var savedCallback = (0,react__WEBPACK_IMPORTED_MODULE_0__.useRef)();
// 保存新回调
(0,react__WEBPACK_IMPORTED_MODULE_0__.useEffect)(function () {
savedCallback.current = callback;
});
// 建立 interval
(0,react__WEBPACK_IMPORTED_MODULE_0__.useEffect)(function () {
function tick() {
savedCallback.current();
}
if (delay !== null) {
var id = setInterval(tick, delay);
return function () {
return clearInterval(id);
};
}
}, [delay]);
}
/***/ }),
/***/ 58954:
/*!***************************************************************************************************!*\
!*** ./src/pages/Classrooms/Lists/Exercise/Edit/components/UploadQuestions/index.tsx + 1 modules ***!
\***************************************************************************************************/
/***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) {
// EXPORTS
__webpack_require__.d(__webpack_exports__, {
Z: function() { return /* binding */ components_UploadQuestions; }
});
// EXTERNAL MODULE: ./node_modules/_@babel_runtime@7.23.2@@babel/runtime/helpers/slicedToArray.js
var slicedToArray = __webpack_require__(11006);
var slicedToArray_default = /*#__PURE__*/__webpack_require__.n(slicedToArray);
// EXTERNAL MODULE: ./node_modules/_react@17.0.2@react/index.js
var _react_17_0_2_react = __webpack_require__(59301);
// EXTERNAL MODULE: ./node_modules/_antd@5.9.0@antd/es/modal/index.js + 16 modules
var modal = __webpack_require__(43418);
// EXTERNAL MODULE: ./node_modules/_antd@5.9.0@antd/es/upload/index.js + 24 modules
var upload = __webpack_require__(6557);
// EXTERNAL MODULE: ./node_modules/_antd@5.9.0@antd/es/button/index.js
var es_button = __webpack_require__(3113);
// EXTERNAL MODULE: ./src/utils/env.ts + 1 modules
var env = __webpack_require__(47015);
// EXTERNAL MODULE: ./src/utils/util.tsx
var util = __webpack_require__(27291);
// EXTERNAL MODULE: ./src/.umi-production/exports.ts + 8 modules
var _umi_production_exports = __webpack_require__(66660);
;// CONCATENATED MODULE: ./src/pages/Classrooms/Lists/Exercise/Edit/components/UploadQuestions/index.less?modules
// extracted by mini-css-extract-plugin
/* harmony default export */ var UploadQuestionsmodules = ({"customModal":"customModal___bVzUV","content":"content___oKhZq","upload":"upload___nPxEL","infoText":"infoText___gZEJF","okBtn":"okBtn___CVo2A","fileList":"fileList___tauGN","fileName":"fileName___T_8JX"});
// EXTERNAL MODULE: ./node_modules/_react@17.0.2@react/jsx-runtime.js
var jsx_runtime = __webpack_require__(37712);
;// CONCATENATED MODULE: ./src/pages/Classrooms/Lists/Exercise/Edit/components/UploadQuestions/index.tsx
var UploadQuestions = function UploadQuestions(_ref) {
var visible = _ref.visible,
onOk = _ref.onOk,
onCancel = _ref.onCancel;
var _useState = (0,_react_17_0_2_react.useState)([]),
_useState2 = slicedToArray_default()(_useState, 2),
fileList = _useState2[0],
setFileList = _useState2[1];
var _useState3 = (0,_react_17_0_2_react.useState)(false),
_useState4 = slicedToArray_default()(_useState3, 2),
loading = _useState4[0],
setLoading = _useState4[1];
// const fileList = useRef([])
var params = (0,_umi_production_exports.useParams)();
(0,_react_17_0_2_react.useEffect)(function () {
if (!visible) {
setFileList([]);
setLoading(false);
}
}, [visible]);
var handleOk = function handleOk() {
setLoading(true);
onOk(fileList, function () {
setLoading(false);
});
};
var handleCancel = function handleCancel() {
onCancel();
};
// const handleChange = (info: any) => {
// const newFileList = info?.fileList || [];
// if (newFileList.every((item: any) => item.status !== 'uploading')) {
// setLoading(false)
// } else {
// setLoading(true)
// }
// fileList.current = newFileList
// }
var down = function down() {
var url = "".concat(env/* default */.Z.API_SERVER, "/api/courses/").concat(params.coursesId, "/exercises/down_template");
(0,util/* downLoadLink */.Nd)(null, url);
};
var handleBeforeUpload = function handleBeforeUpload(info) {
var param = {
name: info.name,
uid: info.uid,
file: info
};
setFileList([param]);
return false;
};
var handleRemove = function handleRemove() {
setFileList([]);
};
return /*#__PURE__*/(0,jsx_runtime.jsx)(modal/* default */.Z, {
title: "\u5BFC\u5165\u8BD5\u9898",
open: visible,
onOk: handleOk,
centered: true,
wrapClassName: UploadQuestionsmodules.customModal,
onCancel: handleCancel,
width: 663,
okText: "\u786E\u8BA4",
okButtonProps: {
className: UploadQuestionsmodules.okBtn
},
cancelText: "\u53D6\u6D88",
confirmLoading: loading,
children: /*#__PURE__*/(0,jsx_runtime.jsxs)("div", {
className: UploadQuestionsmodules.content,
children: [/*#__PURE__*/(0,jsx_runtime.jsxs)("aside", {
children: [/*#__PURE__*/(0,jsx_runtime.jsx)("div", {
style: {
fontWeight: 600
},
children: "\u6B65\u9AA41"
}), /*#__PURE__*/(0,jsx_runtime.jsxs)("ul", {
children: [/*#__PURE__*/(0,jsx_runtime.jsxs)("li", {
children: [/*#__PURE__*/(0,jsx_runtime.jsx)("span", {
style: {
color: '#5F6367'
},
children: "\u6839\u636E\u6A21\u677F\u8981\u6C42\u7F16\u8F91\u9700\u8981\u4E0A\u4F20\u7684\u8BD5\u9898"
}), /*#__PURE__*/(0,jsx_runtime.jsx)("span", {
style: {
color: "#0152d9",
cursor: 'pointer',
marginLeft: 20
},
onClick: down,
children: "\u4E0B\u8F7D\u8003\u8BD5\u8BD5\u9898\u6A21\u677F"
}), /*#__PURE__*/(0,jsx_runtime.jsx)("i", {
className: "iconfont icon-xiazai4 ml10",
onClick: down,
style: {
fontSize: 14,
cursor: 'pointer',
color: "#0152d9"
}
})]
}), /*#__PURE__*/(0,jsx_runtime.jsx)("li", {
style: {
color: "#FA6400"
},
className: "mt10",
children: "\u63D0\u793A"
}), /*#__PURE__*/(0,jsx_runtime.jsx)("li", {
className: UploadQuestionsmodules.infoText,
children: "1\u3001\u76EE\u524D\u4EC5\u652F\u6301Excel\u683C\u5F0F\u6A21\u677F\uFF1B "
}), /*#__PURE__*/(0,jsx_runtime.jsx)("li", {
className: UploadQuestionsmodules.infoText,
children: "2\u3001\u4E0D\u652F\u6301\u7EC4\u5408\u9898\u548C\u5B9E\u8BAD\u9898\u5BFC\u5165\uFF1B"
}), /*#__PURE__*/(0,jsx_runtime.jsx)("li", {
className: UploadQuestionsmodules.infoText,
children: "3\u3001\u6BCF\u6B21\u6700\u591A\u5BFC\u5165300\u9898\uFF1B"
}), /*#__PURE__*/(0,jsx_runtime.jsx)("li", {
className: UploadQuestionsmodules.infoText,
children: "4\u3001\u586B\u7A7A\u9898\u5BFC\u5165\u6700\u591A\u652F\u63018\u4E2A\u586B\u7A7A\u9879\u3002"
})]
})]
}), /*#__PURE__*/(0,jsx_runtime.jsxs)("aside", {
style: {
marginTop: 22
},
children: [/*#__PURE__*/(0,jsx_runtime.jsx)("div", {
style: {
fontWeight: 600
},
children: "\u6B65\u9AA42"
}), /*#__PURE__*/(0,jsx_runtime.jsxs)("ul", {
style: {
flex: 1
},
children: [/*#__PURE__*/(0,jsx_runtime.jsx)("li", {
style: {
color: '#5F6367'
},
children: "\u4E0A\u4F20\u7F16\u8F91\u597D\u7684\u8BD5\u9898\u6587\u6863\uFF0C\u786E\u5B9A\u5BFC\u5165"
}), visible && /*#__PURE__*/(0,jsx_runtime.jsx)(upload/* default */.Z, {
action: "".concat(env/* default */.Z.API_SERVER, "/api/attachments.json"),
beforeUpload: handleBeforeUpload,
onRemove: handleRemove,
withCredentials: true,
fileList: fileList,
accept: ".xls,.xlsx",
showUploadList: false,
children: /*#__PURE__*/(0,jsx_runtime.jsx)(es_button/* default */.ZP, {
className: UploadQuestionsmodules.upload,
type: "primary",
icon: /*#__PURE__*/(0,jsx_runtime.jsx)("i", {
className: "iconfont icon-shangchuan3",
style: {
fontSize: 14
}
}),
children: "\u4E0A\u4F20\u6587\u4EF6"
})
}), fileList.map(function (fileItem, index) {
return /*#__PURE__*/(0,jsx_runtime.jsxs)("div", {
className: UploadQuestionsmodules.fileList,
children: [/*#__PURE__*/(0,jsx_runtime.jsx)("span", {
className: UploadQuestionsmodules.fileName,
children: fileItem === null || fileItem === void 0 ? void 0 : fileItem.name
}), /*#__PURE__*/(0,jsx_runtime.jsx)("i", {
className: "iconfont icon-shanchu12",
style: {
color: '#F65160',
fontSize: 16,
cursor: 'pointer'
},
onClick: handleRemove
})]
}, index);
})]
})]
})]
})
});
};
/* harmony default export */ var components_UploadQuestions = (UploadQuestions);
/***/ }),
/***/ 75051:
/*!*****************************************************************!*\
!*** ./src/pages/MyProblem/TestCasePanel/index.tsx + 1 modules ***!
\*****************************************************************/
/***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) {
// EXPORTS
__webpack_require__.d(__webpack_exports__, {
Y4: function() { return /* binding */ DetailCommitOut; },
Im: function() { return /* binding */ ExecuteDict; },
ZP: function() { return /* binding */ TestCasePanel; }
});
// UNUSED EXPORTS: getCommitOut
// EXTERNAL MODULE: ./node_modules/_@babel_runtime@7.23.2@@babel/runtime/helpers/slicedToArray.js
var slicedToArray = __webpack_require__(11006);
var slicedToArray_default = /*#__PURE__*/__webpack_require__.n(slicedToArray);
// EXTERNAL MODULE: ./node_modules/_@babel_runtime@7.23.2@@babel/runtime/helpers/regeneratorRuntime.js
var regeneratorRuntime = __webpack_require__(10574);
var regeneratorRuntime_default = /*#__PURE__*/__webpack_require__.n(regeneratorRuntime);
// EXTERNAL MODULE: ./node_modules/_@babel_runtime@7.23.2@@babel/runtime/helpers/asyncToGenerator.js
var asyncToGenerator = __webpack_require__(39343);
var asyncToGenerator_default = /*#__PURE__*/__webpack_require__.n(asyncToGenerator);
// EXTERNAL MODULE: ./node_modules/_@babel_runtime@7.23.2@@babel/runtime/helpers/objectSpread2.js
var objectSpread2 = __webpack_require__(26801);
var objectSpread2_default = /*#__PURE__*/__webpack_require__.n(objectSpread2);
// EXTERNAL MODULE: ./node_modules/_@babel_runtime@7.23.2@@babel/runtime/helpers/defineProperty.js
var defineProperty = __webpack_require__(22060);
var defineProperty_default = /*#__PURE__*/__webpack_require__.n(defineProperty);
// 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__(1056);
// EXTERNAL MODULE: ./node_modules/_antd@5.9.0@antd/es/button/index.js
var es_button = __webpack_require__(3113);
// EXTERNAL MODULE: ./node_modules/_@ant-design_icons@5.2.6@@ant-design/icons/es/icons/DownOutlined.js + 1 modules
var DownOutlined = __webpack_require__(42884);
// EXTERNAL MODULE: ./node_modules/_@ant-design_icons@5.2.6@@ant-design/icons/es/icons/UpOutlined.js + 1 modules
var UpOutlined = __webpack_require__(20114);
// EXTERNAL MODULE: ./src/pages/MyProblem/interface.ts
var MyProblem_interface = __webpack_require__(86065);
// EXTERNAL MODULE: ./node_modules/_js-base64@2.6.4@js-base64/base64.js
var base64 = __webpack_require__(24334);
;// CONCATENATED MODULE: ./src/pages/MyProblem/TestCasePanel/index.less
// extracted by mini-css-extract-plugin
// EXTERNAL MODULE: ./src/components/Spinner/index.tsx + 1 modules
var Spinner = __webpack_require__(16769);
// EXTERNAL MODULE: ./src/components/RenderHtml/index.tsx + 1 modules
var RenderHtml = __webpack_require__(55523);
// EXTERNAL MODULE: ./src/utils/util.tsx
var util = __webpack_require__(27291);
// EXTERNAL MODULE: ./node_modules/_xterm@4.8.1@xterm/lib/xterm.js
var xterm = __webpack_require__(34376);
// EXTERNAL MODULE: ./src/utils/fetch.ts
var utils_fetch = __webpack_require__(97174);
// EXTERNAL MODULE: ./src/.umi-production/exports.ts + 8 modules
var _umi_production_exports = __webpack_require__(66660);
// EXTERNAL MODULE: ./node_modules/_react@17.0.2@react/jsx-runtime.js
var jsx_runtime = __webpack_require__(37712);
;// CONCATENATED MODULE: ./src/pages/MyProblem/TestCasePanel/index.tsx
var _ExecuteDict;
var TextArea = input/* default */.Z.TextArea;
var initialState = {
visible: false,
tabIndex: '0'
};
var ExecuteDict = (_ExecuteDict = {}, defineProperty_default()(_ExecuteDict, MyProblem_interface/* ExecuteStatus */.h.NOMATCH, '测试用例结果不匹配'), defineProperty_default()(_ExecuteDict, MyProblem_interface/* ExecuteStatus */.h.OK, '调试通过'), defineProperty_default()(_ExecuteDict, 2, '调试超时'), defineProperty_default()(_ExecuteDict, 3, '调试pod失败'), defineProperty_default()(_ExecuteDict, 4, '编译失败'), defineProperty_default()(_ExecuteDict, 5, '执行失败'), _ExecuteDict);
var Types = /*#__PURE__*/function (Types) {
Types[Types["SET_VISIBLE"] = 0] = "SET_VISIBLE";
Types[Types["SET_TABINDEX"] = 1] = "SET_TABINDEX";
return Types;
}(Types || {});
function Reducer(state, action) {
switch (action.type) {
case Types.SET_VISIBLE:
return objectSpread2_default()(objectSpread2_default()({}, state), {}, {
visible: action.payload
});
case Types.SET_TABINDEX:
return objectSpread2_default()(objectSpread2_default()({}, state), {}, {
tabIndex: action.payload
});
default:
throw new Error();
}
}
function DetailCommitOut(debugResult) {
var status = debugResult.status,
error_msg = debugResult.error_msg,
output = debugResult.output,
input = debugResult.input,
expected_output = debugResult.expected_output,
is_file = debugResult.is_file,
input_file_url = debugResult.input_file_url,
output_file_url = debugResult.output_file_url,
expected_output_file_url = debugResult.expected_output_file_url,
setMonacoValue = debugResult.setMonacoValue,
setData = debugResult.setData;
var outputRef = (0,_react_17_0_2_react.useRef)();
var inputRef = (0,_react_17_0_2_react.useRef)();
var expectedOutputRef = (0,_react_17_0_2_react.useRef)();
var rs = null;
var mdStyle = {
minHeight: 150,
marginBottom: 10,
paddingLeft: 24,
background: '#070f19',
color: '#fff'
};
(0,_react_17_0_2_react.useEffect)(function () {
if (output && !is_file && outputRef.current) {
var term = new xterm.Terminal({
fontSize: 14,
letterSpacing: 1,
cols: 83,
rows: 10
});
term.open(outputRef.current);
var actual_output_format = (0,util/* findEndWhitespace */.pp)(base64.Base64.decode(output));
term.write(actual_output_format);
term.setOption('theme', {
background: '#1e1e1e'
});
}
if (input && !is_file && inputRef.current) {
var term2 = new xterm.Terminal({
fontSize: 14,
letterSpacing: 1,
cols: 83,
rows: 10
});
term2.open(inputRef.current);
term2.write((0,util/* findEndWhitespace */.pp)(input));
term2.setOption('theme', {
background: '#1e1e1e'
});
}
if (expected_output && !is_file && expectedOutputRef.current) {
var term3 = new xterm.Terminal({
fontSize: 14,
letterSpacing: 1,
cols: 83,
rows: 10
});
term3.open(expectedOutputRef.current);
term3.write((0,util/* findEndWhitespace */.pp)(base64.Base64.decode(expected_output)));
term3.setOption('theme', {
background: '#1e1e1e'
});
}
}, [output]);
switch (status) {
case MyProblem_interface/* ExecuteStatus */.h.NOMATCH:
rs = /*#__PURE__*/(0,jsx_runtime.jsxs)(jsx_runtime.Fragment, {
children: [/*#__PURE__*/(0,jsx_runtime.jsx)("p", {
className: "c-red",
children: "\u5B9E\u9645\u8F93\u5165\uFF1A"
}), !is_file && /*#__PURE__*/(0,jsx_runtime.jsx)("div", {
ref: inputRef
}), is_file && /*#__PURE__*/(0,jsx_runtime.jsx)("div", {
style: mdStyle,
children: /*#__PURE__*/(0,jsx_runtime.jsx)("a", {
// href={input_file_url}
style: {
fontSize: '16px'
},
onClick: /*#__PURE__*/asyncToGenerator_default()( /*#__PURE__*/regeneratorRuntime_default()().mark(function _callee() {
var res;
return regeneratorRuntime_default()().wrap(function _callee$(_context) {
while (1) switch (_context.prev = _context.next) {
case 0:
_context.next = 2;
return fetch(input_file_url, {
method: "Get",
headers: {
"Content-Type": "application/octet-stream",
"Accept": "*/*"
}
});
case 2:
res = _context.sent;
_context.t0 = setMonacoValue;
_context.next = 6;
return res.text();
case 6:
_context.t1 = _context.sent;
(0, _context.t0)(_context.t1);
setTimeout(function () {
setData(input_file_url);
}, 200);
// download(input_file_url, input)
case 9:
case "end":
return _context.stop();
}
}, _callee);
}))
// download={expected_output}
// target="_blank"
,
children: input
})
}), /*#__PURE__*/(0,jsx_runtime.jsx)("p", {
className: "c-red",
children: "\u5B9E\u9645\u8F93\u51FA\uFF1A"
}), !is_file && /*#__PURE__*/(0,jsx_runtime.jsx)("div", {
ref: outputRef
}), is_file && /*#__PURE__*/(0,jsx_runtime.jsx)("div", {
style: mdStyle,
children: /*#__PURE__*/(0,jsx_runtime.jsx)("a", {
// href={output_file_url}
style: {
fontSize: '16px'
},
onClick: /*#__PURE__*/asyncToGenerator_default()( /*#__PURE__*/regeneratorRuntime_default()().mark(function _callee2() {
var res;
return regeneratorRuntime_default()().wrap(function _callee2$(_context2) {
while (1) switch (_context2.prev = _context2.next) {
case 0:
_context2.next = 2;
return (0,utils_fetch/* default */.ZP)(output_file_url, {
method: "Get",
headers: {
"Content-Type": "application/xml",
"Accept": "*/*"
}
});
case 2:
res = _context2.sent;
setMonacoValue(res);
setTimeout(function () {
setData(output_file_url);
}, 200);
// download(output_file_url, output)
case 5:
case "end":
return _context2.stop();
}
}, _callee2);
}))
// download={expected_output} target="_blank"
,
children: output
})
}), /*#__PURE__*/(0,jsx_runtime.jsx)("p", {
className: "c-red",
children: "\u9884\u671F\u8F93\u51FA\uFF1A"
}), !is_file && /*#__PURE__*/(0,jsx_runtime.jsx)("div", {
ref: expectedOutputRef
}), is_file && /*#__PURE__*/(0,jsx_runtime.jsx)("div", {
style: mdStyle,
children: /*#__PURE__*/(0,jsx_runtime.jsx)("a", {
// href={expected_output_file_url}
style: {
fontSize: '16px'
},
onClick: /*#__PURE__*/asyncToGenerator_default()( /*#__PURE__*/regeneratorRuntime_default()().mark(function _callee3() {
var res;
return regeneratorRuntime_default()().wrap(function _callee3$(_context3) {
while (1) switch (_context3.prev = _context3.next) {
case 0:
_context3.next = 2;
return fetch(expected_output_file_url, {
method: "Get",
headers: {
"Content-Type": "application/octet-stream",
"Accept": "*/*"
}
});
case 2:
res = _context3.sent;
_context3.t0 = setMonacoValue;
_context3.next = 6;
return res.text();
case 6:
_context3.t1 = _context3.sent;
(0, _context3.t0)(_context3.t1);
setTimeout(function () {
setData(expected_output_file_url);
}, 200);
case 9:
case "end":
return _context3.stop();
}
}, _callee3);
}))
// download={expected_output} target="_blank"
,
children: expected_output
})
})]
});
break;
case MyProblem_interface/* ExecuteStatus */.h.EXECUTEFAILURE:
rs = /*#__PURE__*/(0,jsx_runtime.jsxs)(jsx_runtime.Fragment, {
children: [/*#__PURE__*/(0,jsx_runtime.jsxs)("div", {
style: {
border: '1px #F6F7F9 solid'
},
children: [/*#__PURE__*/(0,jsx_runtime.jsx)("p", {
style: {
width: '100%',
height: 40,
background: '#F6F7F9',
lineHeight: '40px',
color: "#666666",
paddingLeft: '12px'
},
children: "\u6700\u540E\u6267\u884C\u7684\u8F93\u5165\uFF1A"
}), !is_file && /*#__PURE__*/(0,jsx_runtime.jsx)(RenderHtml/* default */.Z, {
value: input,
style: mdStyle
}), is_file && /*#__PURE__*/(0,jsx_runtime.jsx)("div", {
style: mdStyle,
children: /*#__PURE__*/(0,jsx_runtime.jsx)("a", {
// href={input_file_url} style={{fontSize:'16px'}} target="_blank"
onClick: function onClick() {
return (0,util/* download */.LR)(input_file_url, input);
},
children: input
})
})]
}), /*#__PURE__*/(0,jsx_runtime.jsxs)("div", {
style: {
border: '1px #F6F7F9 solid',
marginTop: '10px'
},
children: [/*#__PURE__*/(0,jsx_runtime.jsx)("p", {
style: {
width: '100%',
height: 40,
background: '#F6F7F9',
lineHeight: '40px',
color: "#666666",
paddingLeft: '12px'
},
children: "\u6267\u884C\u51FA\u9519\u4FE1\u606F\uFF1A"
}), /*#__PURE__*/(0,jsx_runtime.jsxs)("pre", {
className: "error",
style: {
color: '#E30000',
padding: '0 10px'
},
children: [base64.Base64.decode(error_msg), "111"]
})]
})]
});
break;
case MyProblem_interface/* ExecuteStatus */.h.COMPILEFAILURE:
rs = /*#__PURE__*/(0,jsx_runtime.jsxs)(jsx_runtime.Fragment, {
children: [/*#__PURE__*/(0,jsx_runtime.jsx)("p", {
children: "\u6700\u540E\u6267\u884C\u7684\u8F93\u5165\uFF1A"
}), !is_file && /*#__PURE__*/(0,jsx_runtime.jsx)("div", {
ref: inputRef
}), is_file && /*#__PURE__*/(0,jsx_runtime.jsx)("div", {
style: mdStyle,
children: /*#__PURE__*/(0,jsx_runtime.jsx)("a", {
// href={input_file_url} style={{fontSize:'16px'}} target="_blank"
onClick: function onClick() {
return (0,util/* download */.LR)(input_file_url, input);
},
children: input
})
}), /*#__PURE__*/(0,jsx_runtime.jsx)("p", {
children: "\u6267\u884C\u51FA\u9519\u4FE1\u606F\uFF1A"
}), /*#__PURE__*/(0,jsx_runtime.jsx)("pre", {
className: "error",
children: base64.Base64.decode(error_msg)
})]
});
break;
case MyProblem_interface/* ExecuteStatus */.h.PODFAILURE:
rs = /*#__PURE__*/(0,jsx_runtime.jsx)("p", {
children: "\u521B\u5EFApod\u5931\u8D25\uFF0C\u8BF7\u7A0D\u540E\u91CD\u8BD5"
});
break;
case MyProblem_interface/* ExecuteStatus */.h.TIMEOUT:
rs = /*#__PURE__*/(0,jsx_runtime.jsx)("p", {
children: "\u8BC4\u6D4B\u8D85\u65F6\uFF0C\u8BF7\u7A0D\u540E\u91CD\u8BD5"
});
break;
}
return /*#__PURE__*/(0,jsx_runtime.jsxs)(jsx_runtime.Fragment, {
children: [" ", rs, " "]
});
}
function getCommitOut(debugResult) {
var status = debugResult.status,
error_msg = debugResult.error_msg,
execute_time = debugResult.execute_time,
output = debugResult.output,
input = debugResult.input,
expected_output = debugResult.expected_output,
is_file = debugResult.is_file,
input_file_url = debugResult.input_file_url,
output_file_url = debugResult.output_file_url,
expected_output_file_url = debugResult.expected_output_file_url;
var rs = null;
switch (status) {
case MyProblem_interface/* ExecuteStatus */.h.OK:
rs = /*#__PURE__*/(0,jsx_runtime.jsxs)(jsx_runtime.Fragment, {
children: [/*#__PURE__*/(0,jsx_runtime.jsxs)("p", {
children: ["\u6267\u884C\u7528\u65F6\uFF1A", execute_time / 1000, "\u79D2"]
}), /*#__PURE__*/(0,jsx_runtime.jsx)("p", {
children: "\u6267\u884C\u7ED3\u679C\uFF1A"
}), /*#__PURE__*/(0,jsx_runtime.jsx)("pre", {
children: base64.Base64.decode(output)
})]
});
break;
case MyProblem_interface/* ExecuteStatus */.h.NOMATCH:
rs = /*#__PURE__*/(0,jsx_runtime.jsxs)(jsx_runtime.Fragment, {
children: [/*#__PURE__*/(0,jsx_runtime.jsxs)("p", {
children: ["\u8F93\u5165\uFF1A", /*#__PURE__*/(0,jsx_runtime.jsx)("pre", {
children: input
})]
}), /*#__PURE__*/(0,jsx_runtime.jsxs)("p", {
children: ["\u8F93\u51FA\uFF1A", output && base64.Base64.decode(output)]
}), /*#__PURE__*/(0,jsx_runtime.jsxs)("p", {
children: ["\u9884\u671F\u8F93\u51FA\uFF1A", expected_output && base64.Base64.decode(expected_output)]
})]
});
break;
case MyProblem_interface/* ExecuteStatus */.h.EXECUTEFAILURE:
rs = /*#__PURE__*/(0,jsx_runtime.jsxs)(jsx_runtime.Fragment, {
children: [/*#__PURE__*/(0,jsx_runtime.jsxs)("p", {
children: ["\u6700\u540E\u6267\u884C\u7684\u8F93\u5165\uFF1A", /*#__PURE__*/(0,jsx_runtime.jsx)("pre", {
children: input
})]
}), /*#__PURE__*/(0,jsx_runtime.jsx)("p", {
children: "\u6267\u884C\u51FA\u9519\u4FE1\u606F\uFF1A"
}), /*#__PURE__*/(0,jsx_runtime.jsx)("pre", {
className: "error",
children: base64.Base64.decode(error_msg)
})]
});
break;
case MyProblem_interface/* ExecuteStatus */.h.COMPILEFAILURE:
rs = /*#__PURE__*/(0,jsx_runtime.jsxs)(jsx_runtime.Fragment, {
children: [/*#__PURE__*/(0,jsx_runtime.jsxs)("p", {
children: ["\u6700\u540E\u6267\u884C\u7684\u8F93\u5165\uFF1A", /*#__PURE__*/(0,jsx_runtime.jsx)("pre", {
children: input
})]
}), /*#__PURE__*/(0,jsx_runtime.jsx)("p", {
children: "\u6267\u884C\u51FA\u9519\u4FE1\u606F\uFF1A"
}), /*#__PURE__*/(0,jsx_runtime.jsx)("pre", {
className: "error",
children: base64.Base64.decode(error_msg)
})]
});
break;
case MyProblem_interface/* ExecuteStatus */.h.PODFAILURE:
rs = /*#__PURE__*/(0,jsx_runtime.jsx)("p", {
children: "\u521B\u5EFApod\u5931\u8D25\uFF0C\u8BF7\u7A0D\u540E\u91CD\u8BD5"
});
break;
case MyProblem_interface/* ExecuteStatus */.h.TIMEOUT:
rs = /*#__PURE__*/(0,jsx_runtime.jsx)("p", {
children: "\u8BC4\u6D4B\u8D85\u65F6\uFF0C\u8BF7\u7A0D\u540E\u91CD\u8BD5"
});
break;
}
return /*#__PURE__*/(0,jsx_runtime.jsxs)(jsx_runtime.Fragment, {
children: [" ", rs, " "]
});
}
/* harmony default export */ var TestCasePanel = (function (_ref4) {
var input = _ref4.input,
debuging = _ref4.debuging,
submitting = _ref4.submitting,
executingMessage = _ref4.executingMessage,
debugResult = _ref4.debugResult,
onChangeInput = _ref4.onChangeInput,
onDebugCode = _ref4.onDebugCode,
onSubmitCode = _ref4.onSubmitCode,
hack = _ref4.hack,
user = _ref4.user;
var _useReducer = (0,_react_17_0_2_react.useReducer)(Reducer, initialState),
_useReducer2 = slicedToArray_default()(_useReducer, 2),
state = _useReducer2[0],
dispatch = _useReducer2[1];
var visible = state.visible,
tabIndex = state.tabIndex;
var _useSearchParams = (0,_umi_production_exports.useSearchParams)(),
_useSearchParams2 = slicedToArray_default()(_useSearchParams, 1),
searchParams = _useSearchParams2[0];
function onTabIndexChange(e) {
var id = e.target.id;
dispatch({
type: Types.SET_TABINDEX,
payload: id
});
}
function onTriggerCollapse() {
dispatch({
type: Types.SET_VISIBLE,
payload: !visible
});
}
var executeResult = (0,_react_17_0_2_react.useMemo)(function () {
if (debugResult) {
var status = debugResult.status;
return /*#__PURE__*/(0,jsx_runtime.jsx)(jsx_runtime.Fragment, {
children: getCommitOut(debugResult)
});
}
return null;
}, [debugResult]);
function onDebug() {
dispatch({
type: Types.SET_VISIBLE,
payload: true
});
dispatch({
type: Types.SET_TABINDEX,
payload: '1'
});
onDebugCode();
}
var skip = /*#__PURE__*/function () {
var _ref5 = asyncToGenerator_default()( /*#__PURE__*/regeneratorRuntime_default()().mark(function _callee4(text) {
var res;
return regeneratorRuntime_default()().wrap(function _callee4$(_context4) {
while (1) switch (_context4.prev = _context4.next) {
case 0:
_context4.next = 2;
return (0,utils_fetch/* default */.ZP)("/api/problems/".concat(text, "/start.json"), {
method: 'get',
params: {
hack_user_id: user === null || user === void 0 ? void 0 : user.user_id
}
});
case 2:
res = _context4.sent;
if (res) {
window.location.href = "/myproblems/".concat(res === null || res === void 0 ? void 0 : res.identifier, "?type=1");
}
case 4:
case "end":
return _context4.stop();
}
}, _callee4);
}));
return function skip(_x) {
return _ref5.apply(this, arguments);
};
}();
return /*#__PURE__*/(0,jsx_runtime.jsxs)("div", {
className: "test-case-panel",
children: [/*#__PURE__*/(0,jsx_runtime.jsxs)("div", {
className: "test-case-panel-body ".concat(visible ? 'active' : ''),
children: [/*#__PURE__*/(0,jsx_runtime.jsxs)("ul", {
className: "s-navs",
children: [/*#__PURE__*/(0,jsx_runtime.jsx)("li", {
children: /*#__PURE__*/(0,jsx_runtime.jsx)("a", {
className: tabIndex === '0' ? 'active' : '',
id: "0",
onClick: onTabIndexChange,
children: "\u81EA\u5B9A\u4E49\u6D4B\u8BD5\u7528\u4F8B"
})
}), /*#__PURE__*/(0,jsx_runtime.jsx)("li", {
children: /*#__PURE__*/(0,jsx_runtime.jsx)("a", {
className: tabIndex === '1' ? 'active' : '',
id: "1",
onClick: onTabIndexChange,
children: "\u4EE3\u7801\u6267\u884C\u7ED3\u679C"
})
})]
}), /*#__PURE__*/(0,jsx_runtime.jsx)("div", {
className: "tab-panel-body ".concat(tabIndex === '0' ? '' : 'hide'),
children: /*#__PURE__*/(0,jsx_runtime.jsx)(TextArea, {
placeholder: "\u8BF7\u586B\u5199\u6D4B\u8BD5\u7528\u4F8B\u7684\u8F93\u5165\u503C\uFF0C\u70B9\u51FB\u201C\u8C03\u8BD5\u4EE3\u7801\u201D",
value: input,
onChange: onChangeInput
})
}), /*#__PURE__*/(0,jsx_runtime.jsx)("div", {
className: "tab-panel-body ".concat(tabIndex === '1' ? '' : 'hide'),
children: debuging ? /*#__PURE__*/(0,jsx_runtime.jsx)(Spinner/* default */.Z, {
message: executingMessage
}) : debugResult ? /*#__PURE__*/(0,jsx_runtime.jsxs)("section", {
style: {
height: 200
},
children: [" ", executeResult, " "]
}) : /*#__PURE__*/(0,jsx_runtime.jsx)("p", {
className: "tip",
children: "\u8BF7\u586B\u5199\u6D4B\u8BD5\u7528\u4F8B\u7684\u8F93\u5165\u503C\uFF0C\u70B9\u51FB\u201C\u8C03\u8BD5\u4EE3\u7801\u201D"
})
})]
}), /*#__PURE__*/(0,jsx_runtime.jsx)("a", {
className: "btn-collapse ".concat(visible ? 'up' : ''),
onClick: onTriggerCollapse,
children: visible ? /*#__PURE__*/(0,jsx_runtime.jsx)(DownOutlined/* default */.Z, {}) : /*#__PURE__*/(0,jsx_runtime.jsx)(UpOutlined/* default */.Z, {})
}), /*#__PURE__*/(0,jsx_runtime.jsxs)("footer", {
className: "footer",
children: [/*#__PURE__*/(0,jsx_runtime.jsx)("span", {
children: "\u63A7\u5236\u53F0"
}), /*#__PURE__*/(0,jsx_runtime.jsxs)("div", {
className: "flex-container",
children: [(hack === null || hack === void 0 ? void 0 : hack.is_program) && (hack === null || hack === void 0 ? void 0 : hack.above_question) && /*#__PURE__*/(0,jsx_runtime.jsx)(es_button/* default */.ZP, {
onClick: function onClick() {
return skip(hack === null || hack === void 0 ? void 0 : hack.above_question);
},
id: "oj-prev",
className: "btn-blue",
type: "ghost",
children: "\u4E0A\u4E00\u9898"
}), (hack === null || hack === void 0 ? void 0 : hack.is_program) && (hack === null || hack === void 0 ? void 0 : hack.under_question) && /*#__PURE__*/(0,jsx_runtime.jsx)(es_button/* default */.ZP, {
onClick: function onClick() {
return skip(hack === null || hack === void 0 ? void 0 : hack.under_question);
},
id: "oj-next",
className: "btn-blue",
type: "ghost",
children: "\u4E0B\u4E00\u9898"
}), /*#__PURE__*/(0,jsx_runtime.jsx)(es_button/* default */.ZP, {
className: "btn-green",
type: "ghost",
loading: debuging,
onClick: onDebug,
children: "\u8C03\u8BD5\u4EE3\u7801"
}), searchParams.get("qtype") !== '8' && /*#__PURE__*/(0,jsx_runtime.jsx)(es_button/* default */.ZP, {
type: "primary",
className: "custom-ant-disabled",
loading: submitting,
disabled: submitting,
onClick: function onClick() {
dispatch({
type: Types.SET_VISIBLE,
payload: false
});
// dispatch({
// type: Types.SET_TABINDEX,
// payload: '1'
// })
onSubmitCode();
},
children: "\u8BC4\u6D4B\u5E76\u63D0\u4EA4"
})]
})]
})]
});
});
/***/ }),
/***/ 86065:
/*!******************************************!*\
!*** ./src/pages/MyProblem/interface.ts ***!
\******************************************/
/***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) {
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */ h: function() { return /* binding */ ExecuteStatus; }
/* harmony export */ });
// created_at: "2020-07-09T19:53:54.000+08:00"
// execute_memory: null
// execute_time: 0.269
// id: 872
// language: "C"
// status: 4
var ExecuteStatus = /*#__PURE__*/function (ExecuteStatus) {
ExecuteStatus[ExecuteStatus["NOMATCH"] = -1] = "NOMATCH";
ExecuteStatus[ExecuteStatus["OK"] = 0] = "OK";
ExecuteStatus[ExecuteStatus["TIMEOUT"] = 2] = "TIMEOUT";
ExecuteStatus[ExecuteStatus["PODFAILURE"] = 3] = "PODFAILURE";
ExecuteStatus[ExecuteStatus["COMPILEFAILURE"] = 4] = "COMPILEFAILURE";
ExecuteStatus[ExecuteStatus["EXECUTEFAILURE"] = 5] = "EXECUTEFAILURE";
return ExecuteStatus;
}({});
// "id": "1",
// "status": 2, # -1测试用例结果不匹配; 0: 评测通过; ;2 评测超时;3 创建pod失败; 4 编译失败;5 执行失败
// "error_line": 3, # 错误行数
// "error_msg": "error line 7 input.." , # 报错信息
// "input": "3 4", # 输入
// "output": "7", # 输出
// "execute_time": 3, #执行时间
// "execute_memory": 300, #消耗内存
// "expected_output": "7" # 如果提交模式 会多这个参数
/***/ }),
/***/ 1106:
/*!****************************************!*\
!*** ./src/pages/MyProblem/service.ts ***!
\****************************************/
/***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) {
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */ H7: function() { return /* binding */ resetCode; },
/* harmony export */ MK: function() { return /* binding */ addNotes; },
/* harmony export */ MU: function() { return /* binding */ debugCode; },
/* harmony export */ X6: function() { return /* binding */ getRecordDetail; },
/* harmony export */ bM: function() { return /* binding */ sumbitCode; },
/* harmony export */ fi: function() { return /* binding */ syncCode; },
/* harmony export */ fu: function() { return /* binding */ getProgrammingTopic; },
/* harmony export */ n4: function() { return /* binding */ updateCode; },
/* harmony export */ rX: function() { return /* binding */ getOperationResult; },
/* harmony export */ vl: function() { return /* binding */ triggerPlus; },
/* harmony export */ zO: function() { return /* binding */ getSubmitRecords; }
/* harmony export */ });
/* harmony import */ var _root_workspace_ppte5yg23_SJ5m_develop_node_modules_babel_runtime_7_23_2_babel_runtime_helpers_objectSpread2_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./node_modules/_@babel_runtime@7.23.2@@babel/runtime/helpers/objectSpread2.js */ 26801);
/* harmony import */ var _root_workspace_ppte5yg23_SJ5m_develop_node_modules_babel_runtime_7_23_2_babel_runtime_helpers_objectSpread2_js__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_root_workspace_ppte5yg23_SJ5m_develop_node_modules_babel_runtime_7_23_2_babel_runtime_helpers_objectSpread2_js__WEBPACK_IMPORTED_MODULE_0__);
/* harmony import */ var _utils_fetch_ts__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @/utils/fetch.ts */ 97174);
function getProgrammingTopic(id, params) {
return (0,_utils_fetch_ts__WEBPACK_IMPORTED_MODULE_1__/* .get */ .U2)("myproblems/".concat(id, ".json"), _root_workspace_ppte5yg23_SJ5m_develop_node_modules_babel_runtime_7_23_2_babel_runtime_helpers_objectSpread2_js__WEBPACK_IMPORTED_MODULE_0___default()({
hidePopLogin: true
}, params || {}));
}
function sumbitCode(id, params) {
return (0,_utils_fetch_ts__WEBPACK_IMPORTED_MODULE_1__/* .post */ .v_)("myproblems/".concat(id, "/code_submit.json"), params);
}
function debugCode(id, params) {
return (0,_utils_fetch_ts__WEBPACK_IMPORTED_MODULE_1__/* .post */ .v_)("myproblems/".concat(id, "/code_debug.json"), params);
}
function getSubmitRecords(id, params) {
if (params.language) {
params.language = encodeURIComponent(params.language);
}
return (0,_utils_fetch_ts__WEBPACK_IMPORTED_MODULE_1__/* .get */ .U2)("myproblems/".concat(id, "/submit_records.json"), params);
}
function getRecordDetail(id) {
return (0,_utils_fetch_ts__WEBPACK_IMPORTED_MODULE_1__/* .get */ .U2)("myproblems/record_detail.json", {
id: id
});
}
function getOperationResult(id, mode) {
return (0,_utils_fetch_ts__WEBPACK_IMPORTED_MODULE_1__/* .get */ .U2)("myproblems/".concat(id, "/result.json"), {
mode: mode
});
}
function addNotes(id, params) {
return (0,_utils_fetch_ts__WEBPACK_IMPORTED_MODULE_1__/* .post */ .v_)("myproblems/".concat(id, "/add_notes.json"), params);
}
function resetCode(id) {
return (0,_utils_fetch_ts__WEBPACK_IMPORTED_MODULE_1__/* .post */ .v_)("myproblems/".concat(id, "/restore_initial_code.json"));
}
function syncCode(id) {
return (0,_utils_fetch_ts__WEBPACK_IMPORTED_MODULE_1__/* .post */ .v_)("myproblems/".concat(id, "/sync_code.json"));
}
function updateCode(id, params) {
return (0,_utils_fetch_ts__WEBPACK_IMPORTED_MODULE_1__/* .post */ .v_)("myproblems/".concat(id, "/update_code.json"), params);
}
function triggerPlus(id, params) {
return (0,_utils_fetch_ts__WEBPACK_IMPORTED_MODULE_1__/* .post */ .v_)("discusses/".concat(id, "/plus.json"), params);
}
/***/ }),
/***/ 16934:
/*!****************************************************!*\
!*** ./src/pages/Paperlibrary/Add/TitleEditor.tsx ***!
\****************************************************/
/***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) {
/* harmony import */ var _root_workspace_ppte5yg23_SJ5m_develop_node_modules_babel_runtime_7_23_2_babel_runtime_helpers_regeneratorRuntime_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./node_modules/_@babel_runtime@7.23.2@@babel/runtime/helpers/regeneratorRuntime.js */ 10574);
/* harmony import */ var _root_workspace_ppte5yg23_SJ5m_develop_node_modules_babel_runtime_7_23_2_babel_runtime_helpers_regeneratorRuntime_js__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_root_workspace_ppte5yg23_SJ5m_develop_node_modules_babel_runtime_7_23_2_babel_runtime_helpers_regeneratorRuntime_js__WEBPACK_IMPORTED_MODULE_0__);
/* harmony import */ var _root_workspace_ppte5yg23_SJ5m_develop_node_modules_babel_runtime_7_23_2_babel_runtime_helpers_asyncToGenerator_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./node_modules/_@babel_runtime@7.23.2@@babel/runtime/helpers/asyncToGenerator.js */ 39343);
/* harmony import */ var _root_workspace_ppte5yg23_SJ5m_develop_node_modules_babel_runtime_7_23_2_babel_runtime_helpers_asyncToGenerator_js__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_root_workspace_ppte5yg23_SJ5m_develop_node_modules_babel_runtime_7_23_2_babel_runtime_helpers_asyncToGenerator_js__WEBPACK_IMPORTED_MODULE_1__);
/* harmony import */ var _root_workspace_ppte5yg23_SJ5m_develop_node_modules_babel_runtime_7_23_2_babel_runtime_helpers_slicedToArray_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./node_modules/_@babel_runtime@7.23.2@@babel/runtime/helpers/slicedToArray.js */ 11006);
/* harmony import */ var _root_workspace_ppte5yg23_SJ5m_develop_node_modules_babel_runtime_7_23_2_babel_runtime_helpers_slicedToArray_js__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(_root_workspace_ppte5yg23_SJ5m_develop_node_modules_babel_runtime_7_23_2_babel_runtime_helpers_slicedToArray_js__WEBPACK_IMPORTED_MODULE_2__);
/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! react */ 59301);
/* harmony import */ var antd__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! antd */ 6848);
/* harmony import */ var antd__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! antd */ 1056);
/* harmony import */ var antd__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! antd */ 8591);
/* harmony import */ var _index_less_modules__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./index.less?modules */ 57908);
/* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! react/jsx-runtime */ 37712);
var TitleEditor = function TitleEditor(_ref) {
var defaultValue = _ref.defaultValue,
onFinish = _ref.onFinish;
var _useState = (0,react__WEBPACK_IMPORTED_MODULE_3__.useState)(false),
_useState2 = _root_workspace_ppte5yg23_SJ5m_develop_node_modules_babel_runtime_7_23_2_babel_runtime_helpers_slicedToArray_js__WEBPACK_IMPORTED_MODULE_2___default()(_useState, 2),
isEdit = _useState2[0],
setIsEdit = _useState2[1];
var _useState3 = (0,react__WEBPACK_IMPORTED_MODULE_3__.useState)(defaultValue),
_useState4 = _root_workspace_ppte5yg23_SJ5m_develop_node_modules_babel_runtime_7_23_2_babel_runtime_helpers_slicedToArray_js__WEBPACK_IMPORTED_MODULE_2___default()(_useState3, 2),
value = _useState4[0],
setValue = _useState4[1];
(0,react__WEBPACK_IMPORTED_MODULE_3__.useEffect)(function () {
setValue(defaultValue);
}, [defaultValue]);
return /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_5__.jsx)("div", {
children: !isEdit ? /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_5__.jsxs)("div", {
className: _index_less_modules__WEBPACK_IMPORTED_MODULE_4__/* ["default"] */ .Z.title,
children: [value, /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_5__.jsx)(antd__WEBPACK_IMPORTED_MODULE_6__/* ["default"] */ .Z, {
title: "\u70B9\u51FB\u7F16\u8F91\u8BD5\u5377\u540D\u79F0",
children: /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_5__.jsx)("i", {
className: "".concat(_index_less_modules__WEBPACK_IMPORTED_MODULE_4__/* ["default"] */ .Z.editIcon, " iconfont icon-bianji_Hover"),
onClick: function onClick() {
return setIsEdit(true);
}
})
})]
}) : /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_5__.jsx)(antd__WEBPACK_IMPORTED_MODULE_7__/* ["default"] */ .Z, {
autoFocus: true,
maxLength: 60,
style: {
textAlign: 'center',
marginTop: 20,
marginBottom: 20
},
value: value,
onChange: function onChange(e) {
setValue(e.target.value);
},
onBlur: /*#__PURE__*/_root_workspace_ppte5yg23_SJ5m_develop_node_modules_babel_runtime_7_23_2_babel_runtime_helpers_asyncToGenerator_js__WEBPACK_IMPORTED_MODULE_1___default()( /*#__PURE__*/_root_workspace_ppte5yg23_SJ5m_develop_node_modules_babel_runtime_7_23_2_babel_runtime_helpers_regeneratorRuntime_js__WEBPACK_IMPORTED_MODULE_0___default()().mark(function _callee() {
var _value$replaceAll;
var flag;
return _root_workspace_ppte5yg23_SJ5m_develop_node_modules_babel_runtime_7_23_2_babel_runtime_helpers_regeneratorRuntime_js__WEBPACK_IMPORTED_MODULE_0___default()().wrap(function _callee$(_context) {
while (1) switch (_context.prev = _context.next) {
case 0:
if (!((value === null || value === void 0 || (_value$replaceAll = value.replaceAll(' ', '')) === null || _value$replaceAll === void 0 ? void 0 : _value$replaceAll.length) <= 0)) {
_context.next = 3;
break;
}
antd__WEBPACK_IMPORTED_MODULE_8__/* ["default"] */ .ZP.error('试卷标题不能为空');
return _context.abrupt("return");
case 3:
_context.next = 5;
return onFinish(value);
case 5:
flag = _context.sent;
flag && setIsEdit(false);
case 7:
case "end":
return _context.stop();
}
}, _callee);
})),
onPressEnter: /*#__PURE__*/_root_workspace_ppte5yg23_SJ5m_develop_node_modules_babel_runtime_7_23_2_babel_runtime_helpers_asyncToGenerator_js__WEBPACK_IMPORTED_MODULE_1___default()( /*#__PURE__*/_root_workspace_ppte5yg23_SJ5m_develop_node_modules_babel_runtime_7_23_2_babel_runtime_helpers_regeneratorRuntime_js__WEBPACK_IMPORTED_MODULE_0___default()().mark(function _callee2() {
var _value$replaceAll2;
var flag;
return _root_workspace_ppte5yg23_SJ5m_develop_node_modules_babel_runtime_7_23_2_babel_runtime_helpers_regeneratorRuntime_js__WEBPACK_IMPORTED_MODULE_0___default()().wrap(function _callee2$(_context2) {
while (1) switch (_context2.prev = _context2.next) {
case 0:
if (!((value === null || value === void 0 || (_value$replaceAll2 = value.replaceAll(' ', '')) === null || _value$replaceAll2 === void 0 ? void 0 : _value$replaceAll2.length) <= 0)) {
_context2.next = 3;
break;
}
antd__WEBPACK_IMPORTED_MODULE_8__/* ["default"] */ .ZP.error('试卷标题不能为空');
return _context2.abrupt("return");
case 3:
_context2.next = 5;
return onFinish(value);
case 5:
flag = _context2.sent;
flag && setIsEdit(false);
case 7:
case "end":
return _context2.stop();
}
}, _callee2);
}))
})
});
};
/* harmony default export */ __webpack_exports__.Z = (TitleEditor);
/***/ }),
/***/ 4913:
/*!***********************************************************!*\
!*** ./src/pages/Paperlibrary/Add/index.tsx + 25 modules ***!
\***********************************************************/
/***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) {
// ESM COMPAT FLAG
__webpack_require__.r(__webpack_exports__);
// EXPORTS
__webpack_require__.d(__webpack_exports__, {
"default": function() { return /* binding */ Add; },
useCourseOptions: function() { return /* binding */ useCourseOptions; }
});
// EXTERNAL MODULE: ./node_modules/_@babel_runtime@7.23.2@@babel/runtime/helpers/objectSpread2.js
var objectSpread2 = __webpack_require__(26801);
var objectSpread2_default = /*#__PURE__*/__webpack_require__.n(objectSpread2);
// EXTERNAL MODULE: ./node_modules/_@babel_runtime@7.23.2@@babel/runtime/helpers/createForOfIteratorHelper.js
var createForOfIteratorHelper = __webpack_require__(98190);
var createForOfIteratorHelper_default = /*#__PURE__*/__webpack_require__.n(createForOfIteratorHelper);
// EXTERNAL MODULE: ./node_modules/_@babel_runtime@7.23.2@@babel/runtime/helpers/regeneratorRuntime.js
var regeneratorRuntime = __webpack_require__(10574);
var regeneratorRuntime_default = /*#__PURE__*/__webpack_require__.n(regeneratorRuntime);
// EXTERNAL MODULE: ./node_modules/_@babel_runtime@7.23.2@@babel/runtime/helpers/asyncToGenerator.js
var asyncToGenerator = __webpack_require__(39343);
var asyncToGenerator_default = /*#__PURE__*/__webpack_require__.n(asyncToGenerator);
// EXTERNAL MODULE: ./node_modules/_@babel_runtime@7.23.2@@babel/runtime/helpers/slicedToArray.js
var slicedToArray = __webpack_require__(11006);
var slicedToArray_default = /*#__PURE__*/__webpack_require__.n(slicedToArray);
// EXTERNAL MODULE: ./node_modules/_react@17.0.2@react/index.js
var _react_17_0_2_react = __webpack_require__(59301);
// EXTERNAL MODULE: ./src/.umi-production/exports.ts + 8 modules
var _umi_production_exports = __webpack_require__(66660);
// 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/breadcrumb/index.js + 6 modules
var breadcrumb = __webpack_require__(66104);
// EXTERNAL MODULE: ./node_modules/_antd@5.9.0@antd/es/message/index.js + 4 modules
var message = __webpack_require__(8591);
// EXTERNAL MODULE: ./node_modules/_antd@5.9.0@antd/es/spin/index.js + 1 modules
var spin = __webpack_require__(71418);
// EXTERNAL MODULE: ./node_modules/_antd@5.9.0@antd/es/input/index.js + 5 modules
var input = __webpack_require__(1056);
// EXTERNAL MODULE: ./node_modules/_antd@5.9.0@antd/es/cascader/index.js + 18 modules
var cascader = __webpack_require__(19842);
// EXTERNAL MODULE: ./node_modules/_antd@5.9.0@antd/es/radio/index.js + 5 modules
var es_radio = __webpack_require__(5112);
// EXTERNAL MODULE: ./node_modules/_antd@5.9.0@antd/es/input-number/index.js + 14 modules
var input_number = __webpack_require__(85731);
// EXTERNAL MODULE: ./node_modules/_antd@5.9.0@antd/es/button/index.js
var es_button = __webpack_require__(3113);
// EXTERNAL MODULE: ./src/pages/Paperlibrary/Add/index.less?modules
var Addmodules = __webpack_require__(57908);
// EXTERNAL MODULE: ./src/service/paperlibrary.ts
var paperlibrary = __webpack_require__(34062);
// EXTERNAL MODULE: ./src/models/problemset/util.ts
var util = __webpack_require__(8610);
// EXTERNAL MODULE: ./src/components/AsyncButton/index.tsx
var AsyncButton = __webpack_require__(10902);
// EXTERNAL MODULE: ./node_modules/_antd@5.9.0@antd/es/modal/index.js + 16 modules
var modal = __webpack_require__(43418);
// EXTERNAL MODULE: ./node_modules/_antd@5.9.0@antd/es/menu/index.js + 11 modules
var menu = __webpack_require__(20834);
// EXTERNAL MODULE: ./node_modules/_antd@5.9.0@antd/es/skeleton/index.js + 12 modules
var skeleton = __webpack_require__(59981);
// EXTERNAL MODULE: ./node_modules/_antd@5.9.0@antd/es/dropdown/index.js + 1 modules
var dropdown = __webpack_require__(38854);
;// CONCATENATED MODULE: ./src/pages/Paperlibrary/EditPotin/index.less?modules
// extracted by mini-css-extract-plugin
/* harmony default export */ var EditPotinmodules = ({"flex_box_center":"flex_box_center___gi93l","flex_space_between":"flex_space_between___mWMLA","flex_box_vertical_center":"flex_box_vertical_center___rk4nc","flex_box_center_end":"flex_box_center_end___B8XxF","flex_box_column":"flex_box_column___AX3Vm","moreSpan":"moreSpan___hbStq","bg":"bg___Ya739","title":"title___BC46y","bottomdiv":"bottomdiv___uaPr6","spanBtn":"spanBtn___jjgnA","addQuestionBtn":"addQuestionBtn___qOlYW","saveBtn":"saveBtn___ulgem","left":"left___i8aTX","leftAction":"leftAction___sQkuq","Button":"Button___auxWm","iconWrapper":"iconWrapper___h3H1m","up":"up___tLyCX","down":"down___T5_aj","disabled":"disabled___GRBbF","titleleft":"titleleft___xZGbq","more_style":"more_style___nhWCX","qcount":"qcount___ID7OA","score":"score___T7dbm","qtitle":"qtitle___qJBFd","qcountclick":"qcountclick___m_VKG","right":"right___CBabI","edit":"edit___WHuql","delete":"delete___Pa6db","shixun":"shixun___oObBe","scoreByBlankRadio":"scoreByBlankRadio___r4AWn","modalconfirm":"modalconfirm___Ru9B_","scoremodal":"scoremodal___BdW7P","close":"close___blHYk","content":"content___jlm9o","items":"items___i3TrH","bottom":"bottom___zMQZ6","yes":"yes___lOPY6","no":"no___gtzKI","formcenter":"formcenter___fCxkm","radiogroup":"radiogroup___oXWHc","easy":"easy___ANNVD","medium":"medium___ov7N3","hard":"hard___n4afW","formcenterselect":"formcenterselect___lYa4f","selectitems":"selectitems___c9Pt5","morebottom":"morebottom____I_ev","scoreinput":"scoreinput___O8EhL","titleTooltip":"titleTooltip___CAyYg","exercise_styles":"exercise_styles___u40hG"});
// EXTERNAL MODULE: ./src/utils/util.tsx
var utils_util = __webpack_require__(27291);
// EXTERNAL MODULE: ./src/utils/fetch.ts
var fetch = __webpack_require__(97174);
// EXTERNAL MODULE: ./src/components/NoData/index.tsx
var NoData = __webpack_require__(72020);
// EXTERNAL MODULE: ./node_modules/_@babel_runtime@7.23.2@@babel/runtime/helpers/toConsumableArray.js
var toConsumableArray = __webpack_require__(93923);
var toConsumableArray_default = /*#__PURE__*/__webpack_require__.n(toConsumableArray);
// EXTERNAL MODULE: ./node_modules/_antd@5.9.0@antd/es/tooltip/index.js + 3 modules
var tooltip = __webpack_require__(6848);
// EXTERNAL MODULE: ./node_modules/_react-beautiful-dnd@13.0.0@react-beautiful-dnd/dist/react-beautiful-dnd.esm.js + 27 modules
var react_beautiful_dnd_esm = __webpack_require__(47927);
// EXTERNAL MODULE: ./src/components/RenderHtml/index.tsx + 1 modules
var RenderHtml = __webpack_require__(55523);
// EXTERNAL MODULE: ./node_modules/_react@17.0.2@react/jsx-runtime.js
var jsx_runtime = __webpack_require__(37712);
;// CONCATENATED MODULE: ./src/pages/Paperlibrary/EditPotin/components/LeftItems.tsx
var DragQuestions = function DragQuestions(_ref) {
var Itemid = _ref.Itemid,
setqitem = _ref.setqitem,
qitem = _ref.qitem,
data = _ref.data,
getdata = _ref.getdata,
bigitem = _ref.bigitem,
setBigqitem = _ref.setBigqitem,
isedit = _ref.isedit;
var _useState = (0,_react_17_0_2_react.useState)([]),
_useState2 = slicedToArray_default()(_useState, 2),
list = _useState2[0],
setList = _useState2[1];
var _useState3 = (0,_react_17_0_2_react.useState)(false),
_useState4 = slicedToArray_default()(_useState3, 2),
loading = _useState4[0],
setLoading = _useState4[1];
(0,_react_17_0_2_react.useEffect)(function () {
if (data.length > 0) {
setList(toConsumableArray_default()(data) || []);
}
}, [data]);
var handleDragEnd = /*#__PURE__*/function () {
var _ref2 = asyncToGenerator_default()( /*#__PURE__*/regeneratorRuntime_default()().mark(function _callee(result, list) {
var res;
return regeneratorRuntime_default()().wrap(function _callee$(_context) {
while (1) switch (_context.prev = _context.next) {
case 0:
if (!isedit) {
_context.next = 3;
break;
}
message/* default */.ZP.info('请先保存或取消当前正在编辑的试题。');
return _context.abrupt("return");
case 3:
if (result.destination) {
_context.next = 5;
break;
}
return _context.abrupt("return");
case 5:
setLoading(true);
_context.next = 8;
return (0,fetch/* default */.ZP)("/api/examination_banks/".concat(Itemid, "/examination_banks_item_banks/").concat(list === null || list === void 0 ? void 0 : list[result.source.index].question_id, "/adjust_position.json"), {
method: 'post',
body: {
id: Itemid,
itemid: list === null || list === void 0 ? void 0 : list[result.source.index].question_id,
position: result.destination.index
}
});
case 8:
res = _context.sent;
setLoading(false);
if (res.status === 0) {
getdata({
id: list === null || list === void 0 ? void 0 : list[result.source.index].question_id
});
}
case 11:
case "end":
return _context.stop();
}
}, _callee);
}));
return function handleDragEnd(_x, _x2) {
return _ref2.apply(this, arguments);
};
}();
return /*#__PURE__*/(0,jsx_runtime.jsx)("div", {
children: /*#__PURE__*/(0,jsx_runtime.jsx)(react_beautiful_dnd_esm/* DragDropContext */.Z5, {
onDragEnd: function onDragEnd(result) {
return handleDragEnd(result, list);
},
children: /*#__PURE__*/(0,jsx_runtime.jsx)(react_beautiful_dnd_esm/* Droppable */.bK, {
droppableId: "droppable",
children: function children(provided, snapshot) {
return /*#__PURE__*/(0,jsx_runtime.jsxs)("div", objectSpread2_default()(objectSpread2_default()({
ref: provided.innerRef
}, provided.droppableProps), {}, {
children: [/*#__PURE__*/(0,jsx_runtime.jsx)(spin/* default */.Z, {
spinning: loading,
children: list.map(function (item, k) {
return /*#__PURE__*/(0,jsx_runtime.jsx)(react_beautiful_dnd_esm/* Draggable */._l, {
draggableId: k.toString(),
index: k,
children: function children(provided, snapshot) {
var _item$program_attr, _item$program_attr2;
return /*#__PURE__*/(0,jsx_runtime.jsx)("aside", objectSpread2_default()(objectSpread2_default()(objectSpread2_default()({
ref: provided.innerRef
}, provided.draggableProps), provided.dragHandleProps), {}, {
children: /*#__PURE__*/(0,jsx_runtime.jsx)(tooltip/* default */.Z, {
title: /*#__PURE__*/(0,jsx_runtime.jsx)(RenderHtml/* default */.Z, {
value: (item === null || item === void 0 ? void 0 : item.question_type) === 8 ? item === null || item === void 0 || (_item$program_attr = item.program_attr) === null || _item$program_attr === void 0 ? void 0 : _item$program_attr.description : item.question_title
}),
color: "#fff",
placement: "left",
overlayClassName: EditPotinmodules.titleTooltip,
children: /*#__PURE__*/(0,jsx_runtime.jsxs)("div", {
onClick: function onClick() {
if (isedit) {
message/* default */.ZP.info('请先保存或取消当前正在编辑的试题。');
return;
}
setqitem(objectSpread2_default()(objectSpread2_default()({}, item), {}, {
index: k + 1
}));
setBigqitem(bigitem);
(0,utils_util/* scrollToTop */.k3)();
},
className: "".concat(EditPotinmodules.qcount, " ").concat(item.question_id === (qitem === null || qitem === void 0 ? void 0 : qitem.question_id) ? EditPotinmodules.qcountclick : ''),
children: [/*#__PURE__*/(0,jsx_runtime.jsxs)("span", {
className: EditPotinmodules.score,
children: [item === null || item === void 0 ? void 0 : item.question_score, "\u5206"]
}), /*#__PURE__*/(0,jsx_runtime.jsxs)("span", {
className: EditPotinmodules.qtitle,
children: [k + 1, "\u3001", /*#__PURE__*/(0,jsx_runtime.jsx)(RenderHtml/* default */.Z, {
value: (item === null || item === void 0 ? void 0 : item.question_type) === 8 ? item === null || item === void 0 || (_item$program_attr2 = item.program_attr) === null || _item$program_attr2 === void 0 ? void 0 : _item$program_attr2.description : item.question_title,
showTextOnly: true
})]
})]
})
})
}));
}
}, k);
})
}), provided.placeholder]
}));
}
})
})
});
};
/* harmony default export */ var LeftItems = (DragQuestions);
// EXTERNAL MODULE: ./node_modules/_antd@5.9.0@antd/es/row/index.js
var row = __webpack_require__(95237);
// EXTERNAL MODULE: ./src/components/QuestionEditor/ChoiceQuestionEditor.tsx
var ChoiceQuestionEditor = __webpack_require__(56191);
// EXTERNAL MODULE: ./node_modules/_antd@5.9.0@antd/es/select/index.js
var es_select = __webpack_require__(57809);
// EXTERNAL MODULE: ./node_modules/_antd@5.9.0@antd/es/switch/index.js + 2 modules
var es_switch = __webpack_require__(78673);
// EXTERNAL MODULE: ./node_modules/_@ant-design_icons@5.2.6@@ant-design/icons/es/icons/DownOutlined.js + 1 modules
var DownOutlined = __webpack_require__(42884);
// EXTERNAL MODULE: ./node_modules/_@ant-design_icons@5.2.6@@ant-design/icons/es/icons/UpOutlined.js + 1 modules
var UpOutlined = __webpack_require__(20114);
// EXTERNAL MODULE: ./node_modules/_@ant-design_icons@5.2.6@@ant-design/icons/es/icons/QuestionCircleOutlined.js + 1 modules
var QuestionCircleOutlined = __webpack_require__(98815);
// EXTERNAL MODULE: ./node_modules/_@ant-design_icons@5.2.6@@ant-design/icons/es/icons/ExclamationCircleOutlined.js + 1 modules
var ExclamationCircleOutlined = __webpack_require__(80045);
;// CONCATENATED MODULE: ./src/pages/Paperlibrary/EditPotin/components/MoreSetting.tsx
var AddModal = function AddModal(_ref) {
var _TagDiscipline$tag_di;
var form = _ref.form,
TagDiscipline = _ref.TagDiscipline,
exerciseitem = _ref.exerciseitem,
qitem = _ref.qitem,
getTagData = _ref.getTagData;
var _useState = (0,_react_17_0_2_react.useState)(false),
_useState2 = slicedToArray_default()(_useState, 2),
isshow = _useState2[0],
seetisshow = _useState2[1];
var _useState3 = (0,_react_17_0_2_react.useState)(false),
_useState4 = slicedToArray_default()(_useState3, 2),
showmodal = _useState4[0],
setshowmodal = _useState4[1];
var _useState5 = (0,_react_17_0_2_react.useState)(''),
_useState6 = slicedToArray_default()(_useState5, 2),
values = _useState6[0],
setvalues = _useState6[1];
(0,_react_17_0_2_react.useEffect)(function () {
if (isshow) {
form.setFieldsValue({
difficulty: qitem.difficulty || 2,
// tag_discipline_ids: TagDiscipline?.tag_disciplines?.filter((item: any) => item?.id === qitem.tag_discipline_ids)?.length > 0 ? qitem.tag_discipline_ids : '',
repeat_answer: !qitem.repeat_answer
});
}
}, [isshow]);
return /*#__PURE__*/(0,jsx_runtime.jsxs)("div", {
children: [/*#__PURE__*/(0,jsx_runtime.jsxs)("div", {
onClick: function onClick() {
seetisshow(!isshow);
},
style: {
width: '100%',
textAlign: 'center',
color: "#3061D0",
marginTop: 50,
cursor: 'pointer'
},
children: ["\u66F4\u591A\u8BBE\u7F6E ", !isshow ? /*#__PURE__*/(0,jsx_runtime.jsx)(DownOutlined/* default */.Z, {}) : /*#__PURE__*/(0,jsx_runtime.jsx)(UpOutlined/* default */.Z, {})]
}), /*#__PURE__*/(0,jsx_runtime.jsxs)("div", {
style: {
marginTop: 30,
overflow: 'hidden',
height: isshow ? '100%' : 0
},
children: [/*#__PURE__*/(0,jsx_runtime.jsx)(es_form/* default */.Z.Item, {
className: EditPotinmodules.formcenter,
rules: [{
required: true,
message: '请先选择难度'
}],
label: "\u96BE\u5EA6",
name: "difficulty",
children: /*#__PURE__*/(0,jsx_runtime.jsxs)(es_radio/* default.Group */.ZP.Group, {
className: EditPotinmodules.radiogroup,
children: [/*#__PURE__*/(0,jsx_runtime.jsx)(es_radio/* default.Button */.ZP.Button, {
className: EditPotinmodules.easy,
value: 1,
children: "\u7B80\u5355"
}), /*#__PURE__*/(0,jsx_runtime.jsx)(es_radio/* default.Button */.ZP.Button, {
className: EditPotinmodules.medium,
value: 2,
children: "\u9002\u4E2D"
}), /*#__PURE__*/(0,jsx_runtime.jsx)(es_radio/* default.Button */.ZP.Button, {
className: EditPotinmodules.hard,
value: 3,
children: "\u56F0\u96BE"
})]
})
}), /*#__PURE__*/(0,jsx_runtime.jsx)(es_form/* default */.Z.Item, {
className: EditPotinmodules.formcenterselect,
label: "\u77E5\u8BC6\u70B9",
children: /*#__PURE__*/(0,jsx_runtime.jsxs)("div", {
style: {
display: 'flex',
alignItems: 'center'
},
children: [/*#__PURE__*/(0,jsx_runtime.jsx)(es_form/* default */.Z.Item, {
name: "tag_discipline_ids",
style: {
marginBottom: 12
},
children: /*#__PURE__*/(0,jsx_runtime.jsx)(es_select["default"], {
className: EditPotinmodules.selectitems,
showSearch: true,
listHeight: 200,
dropdownStyle: {
zIndex: 9
},
allowClear: true,
optionFilterProp: "children",
filterOption: function filterOption(input, option) {
return option.key.indexOf(input.toLowerCase()) >= 0;
},
children: TagDiscipline === null || TagDiscipline === void 0 || (_TagDiscipline$tag_di = TagDiscipline.tag_disciplines) === null || _TagDiscipline$tag_di === void 0 ? void 0 : _TagDiscipline$tag_di.map(function (item) {
return /*#__PURE__*/(0,jsx_runtime.jsx)(es_select["default"].Option, {
value: item.id,
children: /*#__PURE__*/(0,jsx_runtime.jsxs)("div", {
style: {
display: 'flex',
justifyContent: 'space-between'
},
children: [/*#__PURE__*/(0,jsx_runtime.jsx)("span", {
style: {
overflow: "hidden",
whiteSpace: "nowrap",
textOverflow: "ellipsis"
},
children: item.name
}), /*#__PURE__*/(0,jsx_runtime.jsx)("span", {
children: item.type === 'personal' ? '(自用)' : ''
})]
})
}, item.name + item.id);
})
})
}), /*#__PURE__*/(0,jsx_runtime.jsxs)("div", {
style: {
marginLeft: 20,
marginTop: '-16px',
lineHeight: '48px',
height: 48,
fontSize: 14
},
children: [/*#__PURE__*/(0,jsx_runtime.jsx)("span", {
children: "\u6CA1\u6709\u5408\u9002\u7684\u77E5\u8BC6\u70B9\uFF1F"
}), /*#__PURE__*/(0,jsx_runtime.jsx)("a", {
onClick: function onClick() {
setshowmodal(true);
},
style: {
marginLeft: 3,
color: '#3061D0'
},
children: "\u65B0\u5EFA\u77E5\u8BC6\u70B9"
})]
})]
})
}), /*#__PURE__*/(0,jsx_runtime.jsx)(es_form/* default */.Z.Item, {
className: EditPotinmodules.formcenterselect,
children: /*#__PURE__*/(0,jsx_runtime.jsxs)("div", {
style: {
display: 'flex',
alignItems: 'center'
},
children: [/*#__PURE__*/(0,jsx_runtime.jsx)(es_form/* default */.Z.Item, {
name: "repeat_answer",
valuePropName: "checked",
children: /*#__PURE__*/(0,jsx_runtime.jsx)(es_switch/* default */.Z, {})
}), /*#__PURE__*/(0,jsx_runtime.jsxs)("div", {
style: {
marginLeft: 10,
marginTop: '-16px',
lineHeight: '40px',
height: 48,
color: '#000000'
},
children: ["\u4E0D\u5141\u8BB8\u5B66\u751F\u91CD\u590D\u7B54\u9898", /*#__PURE__*/(0,jsx_runtime.jsx)(tooltip/* default */.Z, {
placement: "right",
title: "\u9009\u4E2D\u540E\uFF0C\u5B66\u751F\u5FC5\u987B\u4F5C\u7B54\u5B8C\u6210\u624D\u80FD\u8FDB\u5165\u4E0B\u4E00\u9898\uFF0C\u4E14\u8FDB\u5165\u4E0B\u4E00\u9898\u4E4B\u540E\u4E0D\u5141\u8BB8\u518D\u4FEE\u6539\u8BE5\u9898\u7B54\u6848",
children: /*#__PURE__*/(0,jsx_runtime.jsx)(QuestionCircleOutlined/* default */.Z, {
style: {
color: '#3061D0',
marginLeft: 6,
cursor: 'pointer'
}
})
})]
})]
})
})]
}), /*#__PURE__*/(0,jsx_runtime.jsxs)(modal/* default */.Z, {
title: false,
footer: false,
open: showmodal,
width: 640,
centered: true,
closable: false,
className: EditPotinmodules.scoremodal,
children: [/*#__PURE__*/(0,jsx_runtime.jsxs)("div", {
style: {
display: 'flex',
alignItems: 'center'
},
children: [/*#__PURE__*/(0,jsx_runtime.jsx)("div", {
className: EditPotinmodules.title,
children: "\u65B0\u5EFA\u77E5\u8BC6\u70B9"
}), /*#__PURE__*/(0,jsx_runtime.jsx)("span", {
onClick: function onClick() {
return setshowmodal(false);
},
className: EditPotinmodules.close,
children: "X"
})]
}), /*#__PURE__*/(0,jsx_runtime.jsxs)("div", {
children: [/*#__PURE__*/(0,jsx_runtime.jsx)(ExclamationCircleOutlined/* default */.Z, {
style: {
color: '#FF8C29',
marginRight: 10
}
}), "\u65B0\u5EFA\u7684\u77E5\u8BC6\u70B9\u4EC5\u672C\u4EBA\u53EF\u89C1\uFF0C\u5E73\u53F0\u5BA1\u6838\u5217\u5165\u516C\u5F00\u77E5\u8BC6\u70B9\u540E\uFF0C\u5BF9\u6240\u6709\u7528\u6237\u53EF\u89C1\u3002 \u5E73\u53F0\u6709\u6743\u5220\u9664\u4E0D\u5408\u9002\u7684\u77E5\u8BC6\u70B9\uFF0C\u8BF7\u8BA4\u771F\u586B\u5199\u77E5\u8BC6\u70B9\u540D\u79F0\u3002"]
}), /*#__PURE__*/(0,jsx_runtime.jsx)(input/* default */.Z, {
showCount: true,
maxLength: 20,
style: {
marginBottom: 30,
marginTop: 30,
height: 46
},
onChange: function onChange(e) {
setvalues(e.target.value);
},
placeholder: "\u8BF7\u8F93\u5165\u77E5\u8BC6\u70B9\u540D\u79F0"
}), /*#__PURE__*/(0,jsx_runtime.jsxs)("div", {
className: EditPotinmodules.bottom,
children: [/*#__PURE__*/(0,jsx_runtime.jsx)(es_button/* default */.ZP, {
className: EditPotinmodules.no,
onClick: function onClick() {
setshowmodal(false);
},
children: "\u53D6\u6D88"
}), /*#__PURE__*/(0,jsx_runtime.jsx)(es_button/* default */.ZP, {
className: EditPotinmodules.yes,
onClick: /*#__PURE__*/asyncToGenerator_default()( /*#__PURE__*/regeneratorRuntime_default()().mark(function _callee() {
var _exerciseitem$exercis;
var res, _exerciseitem$exercis2;
return regeneratorRuntime_default()().wrap(function _callee$(_context) {
while (1) switch (_context.prev = _context.next) {
case 0:
if (values) {
_context.next = 3;
break;
}
message/* default */.ZP.info('知识点名称不能为空');
return _context.abrupt("return");
case 3:
_context.next = 5;
return (0,fetch/* default */.ZP)("/api/tag_disciplines.json", {
method: 'post',
body: {
name: values,
sub_discipline_id: exerciseitem === null || exerciseitem === void 0 || (_exerciseitem$exercis = exerciseitem.exercise) === null || _exerciseitem$exercis === void 0 ? void 0 : _exerciseitem$exercis.sub_discipline_id
}
});
case 5:
res = _context.sent;
if ((res === null || res === void 0 ? void 0 : res.status) === 0) {
form.setFieldsValue({
knowledge: values
});
getTagData((_exerciseitem$exercis2 = exerciseitem.exercise) === null || _exerciseitem$exercis2 === void 0 ? void 0 : _exerciseitem$exercis2.sub_discipline_id);
}
setshowmodal(false);
case 8:
case "end":
return _context.stop();
}
}, _callee);
})),
children: "\u786E\u8BA4"
})]
})]
})]
});
};
/* harmony default export */ var MoreSetting = (AddModal);
;// CONCATENATED MODULE: ./src/pages/Paperlibrary/EditPotin/components/Questions/SingleEditor.tsx
var SingleEditor_DragQuestions = function DragQuestions(_ref) {
var qitem = _ref.qitem,
setisedit = _ref.setisedit,
TagDiscipline = _ref.TagDiscipline,
exerciseitem = _ref.exerciseitem,
seveeditor = _ref.seveeditor,
deleteitem = _ref.deleteitem,
getTagData = _ref.getTagData,
init = _ref.init;
var _Form$useForm = es_form/* default */.Z.useForm(),
_Form$useForm2 = slicedToArray_default()(_Form$useForm, 1),
form = _Form$useForm2[0];
(0,_react_17_0_2_react.useEffect)(function () {
var _qitem$question_choic;
form.setFieldsValue(objectSpread2_default()(objectSpread2_default()({}, qitem), {}, {
name: qitem === null || qitem === void 0 ? void 0 : qitem.question_title,
choices: qitem === null || qitem === void 0 || (_qitem$question_choic = qitem.question_choices) === null || _qitem$question_choic === void 0 ? void 0 : _qitem$question_choic.map(function (item) {
return objectSpread2_default()(objectSpread2_default()({}, item), {}, {
standard_boolean: item !== null && item !== void 0 && item.standard_boolean ? 1 : 0
});
}),
repeat_answer: !(qitem !== null && qitem !== void 0 && qitem.repeat_answer)
}));
}, [qitem]);
return /*#__PURE__*/(0,jsx_runtime.jsx)("div", {
children: /*#__PURE__*/(0,jsx_runtime.jsxs)(es_form/* default */.Z, {
form: form,
colon: false,
onFinish: function onFinish(values) {
var _values$choices;
var datas = objectSpread2_default()(objectSpread2_default()({}, values), {}, {
item_type: qitem === null || qitem === void 0 ? void 0 : qitem.question_type,
choices: values === null || values === void 0 || (_values$choices = values.choices) === null || _values$choices === void 0 ? void 0 : _values$choices.map(function (item) {
return objectSpread2_default()(objectSpread2_default()({}, item), {}, {
is_answer: item.standard_boolean
});
})
});
seveeditor(objectSpread2_default()(objectSpread2_default()({}, qitem), datas));
},
onFinishFailed: /*#__PURE__*/function () {
var _ref2 = asyncToGenerator_default()( /*#__PURE__*/regeneratorRuntime_default()().mark(function _callee(errInfo) {
var _errInfo$errorFields;
return regeneratorRuntime_default()().wrap(function _callee$(_context) {
while (1) switch (_context.prev = _context.next) {
case 0:
message/* default */.ZP.error(errInfo.errorFields[0].errors[0]);
form.scrollToField(errInfo === null || errInfo === void 0 || (_errInfo$errorFields = errInfo.errorFields) === null || _errInfo$errorFields === void 0 || (_errInfo$errorFields = _errInfo$errorFields[0]) === null || _errInfo$errorFields === void 0 ? void 0 : _errInfo$errorFields.name, {
behavior: 'smooth',
block: 'center'
});
case 2:
case "end":
return _context.stop();
}
}, _callee);
}));
return function (_x) {
return _ref2.apply(this, arguments);
};
}(),
children: [/*#__PURE__*/(0,jsx_runtime.jsxs)("div", {
style: {
display: 'flex',
alignItems: 'center',
marginTop: 20
},
children: [/*#__PURE__*/(0,jsx_runtime.jsxs)("div", {
style: {
flex: 1
},
children: [/*#__PURE__*/(0,jsx_runtime.jsx)("span", {
style: {
display: 'inline-flex',
border: '1px solid #9096A3',
borderRadius: '50%',
width: 10,
height: 10,
marginRight: 5,
background: '#9096A3'
}
}), /*#__PURE__*/(0,jsx_runtime.jsx)("span", {
children: (qitem === null || qitem === void 0 ? void 0 : qitem.question_type) === 1 ? '多选题' : '单选题'
})]
}), !qitem.isadd && /*#__PURE__*/(0,jsx_runtime.jsxs)("span", {
style: {
marginLeft: 20,
marginRight: 20,
color: 'red',
cursor: 'pointer'
},
onClick: function onClick() {
deleteitem();
},
children: [/*#__PURE__*/(0,jsx_runtime.jsx)("i", {
className: "iconfont icon-piliangshanchu3",
style: {
fontSize: 14,
marginRight: 6
}
}), "\u5220\u9664"]
}), /*#__PURE__*/(0,jsx_runtime.jsx)(es_button/* default */.ZP, {
onClick: function onClick() {
if (!qitem.isadd) {
var _qitem$question_choic2;
form.setFieldsValue(objectSpread2_default()(objectSpread2_default()({}, qitem), {}, {
name: qitem === null || qitem === void 0 ? void 0 : qitem.question_title,
choices: qitem === null || qitem === void 0 || (_qitem$question_choic2 = qitem.question_choices) === null || _qitem$question_choic2 === void 0 ? void 0 : _qitem$question_choic2.map(function (item) {
return objectSpread2_default()(objectSpread2_default()({}, item), {}, {
standard_boolean: item !== null && item !== void 0 && item.standard_boolean ? 1 : 0
});
}),
repeat_answer: !(qitem !== null && qitem !== void 0 && qitem.repeat_answer)
}));
setisedit(false);
} else {
setisedit(false);
init();
}
},
children: "\u53D6\u6D88"
}), /*#__PURE__*/(0,jsx_runtime.jsx)(es_button/* default */.ZP, {
className: "ml20",
type: "primary",
onClick: /*#__PURE__*/asyncToGenerator_default()( /*#__PURE__*/regeneratorRuntime_default()().mark(function _callee2() {
return regeneratorRuntime_default()().wrap(function _callee2$(_context2) {
while (1) switch (_context2.prev = _context2.next) {
case 0:
form.submit();
case 1:
case "end":
return _context2.stop();
}
}, _callee2);
})),
children: "\u4FDD\u5B58"
})]
}), /*#__PURE__*/(0,jsx_runtime.jsxs)(row/* default */.Z, {
align: "middle",
children: [/*#__PURE__*/(0,jsx_runtime.jsx)(es_form/* default */.Z.Item, {
className: EditPotinmodules.scoreinput,
name: "question_score",
label: "\u5206\u503C",
rules: [{
required: true,
message: '请输入分值'
}],
children: /*#__PURE__*/(0,jsx_runtime.jsx)(input_number/* default */.Z, {
style: {
width: 150
},
precision: 1,
placeholder: "\u8BF7\u8F93\u5165\u5206\u6570",
max: 100,
min: 0.1
})
}), (qitem === null || qitem === void 0 ? void 0 : qitem.question_type) === 1 && /*#__PURE__*/(0,jsx_runtime.jsx)(es_form/* default */.Z.Item, {
name: "use_blank_score",
noStyle: true,
children: /*#__PURE__*/(0,jsx_runtime.jsx)(es_radio/* default.Group */.ZP.Group, {
className: EditPotinmodules.scoreByBlankRadio,
optionType: "button",
options: [{
label: '全对给分',
value: false
}, {
label: '漏选给分',
value: true
}]
})
}), (qitem === null || qitem === void 0 ? void 0 : qitem.question_type) === 1 && /*#__PURE__*/(0,jsx_runtime.jsx)(tooltip/* default */.Z, {
overlayInnerStyle: {
width: 436
},
title: /*#__PURE__*/(0,jsx_runtime.jsxs)("div", {
children: ["\u5168\u5BF9\u7ED9\u5206\uFF1A\u9009\u4E2D\u7684\u7B54\u6848\u5168\u90E8\u6B63\u786E\u4E14\u672A\u6F0F\u9009\u6B63\u786E\u7B54\u6848\uFF0C\u5219\u83B7\u5F97\u8BE5\u5C0F\u9898\u7684\u5206\u503C\u3002", /*#__PURE__*/(0,jsx_runtime.jsx)("br", {}), "\u6F0F\u9009\u7ED9\u5206\uFF1A\u9009\u4E2D\u7684\u7B54\u6848\u5168\u90E8\u6B63\u786E\u4F46\u6709\u6F0F\u9009\u6B63\u786E\u7B54\u6848\uFF0C\u5219\u83B7\u5F97\u7684\u5206\u503C=\u9009\u4E2D\u7684\u7B54\u6848\u4E2A\u6570 * (\u8BE5\u5C0F\u9898\u5206\u503C / \u6B63\u786E\u7B54\u6848\u7684\u4E2A\u6570)"]
}),
children: /*#__PURE__*/(0,jsx_runtime.jsx)("i", {
className: "icon-tishixiaowenhao font18 ml20 c-3061d0"
})
})]
}), /*#__PURE__*/(0,jsx_runtime.jsx)(ChoiceQuestionEditor/* ChoiceQuestionEditor */.u, {
form: form,
questionTitlePlaceholder: "\u8BF7\u7F16\u8F91\u9009\u62E9\u9898\u9898\u5E72\u5185\u5BB9",
titleKey: "name",
choiceKey: "choices",
analysisKey: "analysis",
choiceOptionsPath: "choices",
choiceTextKey: "choice_text"
// allowChangeMode={qitem?.question_type===1?true:false}
,
answerKey: "standard_boolean"
}), /*#__PURE__*/(0,jsx_runtime.jsx)(MoreSetting, {
getTagData: getTagData,
qitem: qitem,
exerciseitem: exerciseitem,
TagDiscipline: TagDiscipline,
form: form
})]
})
});
};
/* harmony default export */ var SingleEditor = (SingleEditor_DragQuestions);
// EXTERNAL MODULE: ./src/components/QuestionEditor/CompletionQuestionEditor.tsx
var CompletionQuestionEditor = __webpack_require__(63424);
;// CONCATENATED MODULE: ./src/pages/Paperlibrary/EditPotin/components/Questions/CombinationEditor.tsx
var CombinationEditor_DragQuestions = function DragQuestions(_ref) {
var qitem = _ref.qitem,
TagDiscipline = _ref.TagDiscipline,
exerciseitem = _ref.exerciseitem,
setisedit = _ref.setisedit,
seveeditor = _ref.seveeditor,
deleteitem = _ref.deleteitem,
getTagData = _ref.getTagData,
init = _ref.init;
var _Form$useForm = es_form/* default */.Z.useForm(),
_Form$useForm2 = slicedToArray_default()(_Form$useForm, 1),
form = _Form$useForm2[0];
var scoreByBlank = es_form/* default */.Z.useWatch('use_blank_score', form);
(0,_react_17_0_2_react.useEffect)(function () {
form.setFieldsValue(objectSpread2_default()(objectSpread2_default()({}, qitem), {}, {
standard_answers: qitem.standard_answers || [],
name: qitem.question_title,
repeat_answer: !qitem.repeat_answer
}));
}, [qitem]);
return /*#__PURE__*/(0,jsx_runtime.jsx)("div", {
children: /*#__PURE__*/(0,jsx_runtime.jsxs)(es_form/* default */.Z, {
form: form,
colon: false,
onValuesChange: function onValuesChange(values, value) {
if (values !== null && values !== void 0 && values.standard_answers) {
var _form$getFieldValue, _form$getFieldValue2;
var items = ((_form$getFieldValue = form.getFieldValue('standard_answers')) === null || _form$getFieldValue === void 0 ? void 0 : _form$getFieldValue.length) > 0 && ((_form$getFieldValue2 = form.getFieldValue('standard_answers')) === null || _form$getFieldValue2 === void 0 || (_form$getFieldValue2 = _form$getFieldValue2.map(function (item) {
return item.score;
})) === null || _form$getFieldValue2 === void 0 ? void 0 : _form$getFieldValue2.filter(function (item) {
return item;
}));
if ((items === null || items === void 0 ? void 0 : items.length) > 0) {
var _items$reduce;
form.setFieldsValue({
question_score: (items === null || items === void 0 ? void 0 : items.length) > 0 && ((_items$reduce = items.reduce(function (a, b) {
return a + b;
})) === null || _items$reduce === void 0 ? void 0 : _items$reduce.toFixed(1))
});
}
}
},
onFinish: function onFinish(values) {
var _values$standard_answ;
seveeditor(objectSpread2_default()(objectSpread2_default()(objectSpread2_default()({}, qitem), values), {}, {
item_type: qitem === null || qitem === void 0 ? void 0 : qitem.question_type,
standard_answers: (_values$standard_answ = values.standard_answers) === null || _values$standard_answ === void 0 ? void 0 : _values$standard_answ.map(function (item, index) {
return objectSpread2_default()(objectSpread2_default()({}, item), {}, {
position: item.choice_id || index + 1
});
})
// standard_answer: undefined //后端希望只传一个,存和取的字段又不统一
}));
},
onFinishFailed: /*#__PURE__*/function () {
var _ref2 = asyncToGenerator_default()( /*#__PURE__*/regeneratorRuntime_default()().mark(function _callee(errInfo) {
var _errInfo$errorFields;
return regeneratorRuntime_default()().wrap(function _callee$(_context) {
while (1) switch (_context.prev = _context.next) {
case 0:
message/* default */.ZP.error(errInfo.errorFields[0].errors[0]);
form.scrollToField(errInfo === null || errInfo === void 0 || (_errInfo$errorFields = errInfo.errorFields) === null || _errInfo$errorFields === void 0 || (_errInfo$errorFields = _errInfo$errorFields[0]) === null || _errInfo$errorFields === void 0 ? void 0 : _errInfo$errorFields.name, {
behavior: 'smooth',
block: 'center'
});
case 2:
case "end":
return _context.stop();
}
}, _callee);
}));
return function (_x) {
return _ref2.apply(this, arguments);
};
}(),
children: [/*#__PURE__*/(0,jsx_runtime.jsxs)("div", {
style: {
display: 'flex',
alignItems: 'center',
marginTop: 20
},
children: [/*#__PURE__*/(0,jsx_runtime.jsxs)("div", {
style: {
flex: 1
},
children: [/*#__PURE__*/(0,jsx_runtime.jsx)("span", {
style: {
display: 'inline-flex',
border: '1px solid #9096A3',
borderRadius: '50%',
width: 10,
height: 10,
marginRight: 5,
background: '#9096A3'
}
}), /*#__PURE__*/(0,jsx_runtime.jsx)("span", {
children: '填空题'
})]
}), !qitem.isadd && /*#__PURE__*/(0,jsx_runtime.jsxs)("span", {
style: {
marginLeft: 20,
marginRight: 20,
color: 'red',
cursor: 'pointer'
},
onClick: function onClick() {
deleteitem();
},
children: [/*#__PURE__*/(0,jsx_runtime.jsx)("i", {
className: "iconfont icon-piliangshanchu3",
style: {
fontSize: 14,
marginRight: 6
}
}), " \u5220\u9664"]
}), /*#__PURE__*/(0,jsx_runtime.jsx)(es_button/* default */.ZP, {
onClick: function onClick() {
if (!qitem.isadd) {
form.setFieldsValue(objectSpread2_default()(objectSpread2_default()({}, qitem), {}, {
standard_answers: qitem.standard_answers,
name: qitem.question_title,
repeat_answer: !qitem.repeat_answer
}));
setisedit(false);
} else {
setisedit(false);
init();
}
},
children: "\u53D6\u6D88"
}), /*#__PURE__*/(0,jsx_runtime.jsx)(es_button/* default */.ZP, {
className: "ml20",
type: "primary",
onClick: function onClick() {
form.submit();
},
children: "\u4FDD\u5B58"
})]
}), /*#__PURE__*/(0,jsx_runtime.jsxs)(row/* default */.Z, {
align: "middle",
children: [/*#__PURE__*/(0,jsx_runtime.jsx)(es_form/* default */.Z.Item, {
className: EditPotinmodules.scoreinput,
name: "question_score",
label: "\u5206\u503C",
rules: [{
required: true,
message: '请输入分值'
}],
children: /*#__PURE__*/(0,jsx_runtime.jsx)(input_number/* default */.Z, {
style: {
width: 150
},
precision: 1,
placeholder: "\u8BF7\u8F93\u5165\u5206\u6570",
size: 'middle',
disabled: scoreByBlank,
max: 100,
min: 0.1
})
}), /*#__PURE__*/(0,jsx_runtime.jsx)(es_form/* default */.Z.Item, {
name: "use_blank_score",
noStyle: true,
children: /*#__PURE__*/(0,jsx_runtime.jsx)(es_radio/* default.Group */.ZP.Group, {
className: EditPotinmodules.scoreByBlankRadio,
optionType: "button",
options: [{
label: '按空给分',
value: true
}, {
label: '按题给分',
value: false
}]
})
}), /*#__PURE__*/(0,jsx_runtime.jsx)(tooltip/* default */.Z, {
overlayInnerStyle: {
width: 460
},
title: /*#__PURE__*/(0,jsx_runtime.jsxs)("div", {
children: ["\u6309\u7A7A\u7ED9\u5206\uFF1A\u9700\u8981\u5206\u522B\u8BBE\u7F6E\u6BCF\u4E2A\u586B\u7A7A\u9879\u7684\u5206\u503C\uFF0C\u586B\u7A7A\u9879\u7B54\u5BF9\u4E4B\u540E\u5219\u83B7\u5F97\u5BF9\u5E94\u7684\u5206\u503C\u3002", /*#__PURE__*/(0,jsx_runtime.jsx)("br", {}), "\u6309\u9898\u7ED9\u5206\uFF1A\u9700\u8981\u8BBE\u7F6E\u6574\u4E2A\u5C0F\u9898\u7684\u5206\u503C\uFF0C\u7B54\u5BF9\u5168\u90E8\u586B\u7A7A\u9879\u4E4B\u540E\u624D\u80FD\u83B7\u5F97\u8BE5\u5C0F\u9898\u7684\u5206\u503C\u3002"]
}),
children: /*#__PURE__*/(0,jsx_runtime.jsx)("i", {
className: "icon-tishixiaowenhao font18 ml20 c-3061d0"
})
})]
}), /*#__PURE__*/(0,jsx_runtime.jsx)(CompletionQuestionEditor/* CompletionQuestionEditor */.u, {
form: form,
questionTitlePlaceholder: "\u8BF7\u7F16\u8F91\u586B\u7A7A\u9898\u9898\u5E72\u5185\u5BB9",
scoreByBlank: scoreByBlank,
answerKey: "standard_answers"
}), /*#__PURE__*/(0,jsx_runtime.jsx)(MoreSetting, {
getTagData: getTagData,
qitem: qitem,
exerciseitem: exerciseitem,
TagDiscipline: TagDiscipline,
form: form
})]
})
});
};
/* harmony default export */ var CombinationEditor = (CombinationEditor_DragQuestions);
// EXTERNAL MODULE: ./src/components/QuestionEditor/JudgmentQuestionEditor.tsx
var JudgmentQuestionEditor = __webpack_require__(99839);
;// CONCATENATED MODULE: ./src/pages/Paperlibrary/EditPotin/components/Questions/JudgmentQuestionEditor.tsx
var JudgmentQuestionEditor_DragQuestions = function DragQuestions(_ref) {
var qitem = _ref.qitem,
setisedit = _ref.setisedit,
TagDiscipline = _ref.TagDiscipline,
exerciseitem = _ref.exerciseitem,
seveeditor = _ref.seveeditor,
deleteitem = _ref.deleteitem,
getTagData = _ref.getTagData,
init = _ref.init;
var _Form$useForm = es_form/* default */.Z.useForm(),
_Form$useForm2 = slicedToArray_default()(_Form$useForm, 1),
form = _Form$useForm2[0];
(0,_react_17_0_2_react.useEffect)(function () {
var _qitem$question_choic;
form.setFieldsValue(objectSpread2_default()(objectSpread2_default()({}, qitem), {}, {
name: qitem.question_title,
repeat_answer: !qitem.repeat_answer,
choices: qitem === null || qitem === void 0 || (_qitem$question_choic = qitem.question_choices) === null || _qitem$question_choic === void 0 ? void 0 : _qitem$question_choic.map(function (item) {
return objectSpread2_default()(objectSpread2_default()({}, item), {}, {
is_answer: item !== null && item !== void 0 && item.standard_boolean ? 1 : 0
});
})
}));
}, [qitem]);
return /*#__PURE__*/(0,jsx_runtime.jsx)("div", {
children: /*#__PURE__*/(0,jsx_runtime.jsxs)(es_form/* default */.Z, {
form: form,
colon: false,
onFinish: function onFinish(values) {
seveeditor(objectSpread2_default()(objectSpread2_default()({}, qitem), values));
},
onFinishFailed: /*#__PURE__*/function () {
var _ref2 = asyncToGenerator_default()( /*#__PURE__*/regeneratorRuntime_default()().mark(function _callee(errInfo) {
var _errInfo$errorFields;
return regeneratorRuntime_default()().wrap(function _callee$(_context) {
while (1) switch (_context.prev = _context.next) {
case 0:
message/* default */.ZP.error(errInfo.errorFields[0].errors[0]);
form.scrollToField(errInfo === null || errInfo === void 0 || (_errInfo$errorFields = errInfo.errorFields) === null || _errInfo$errorFields === void 0 || (_errInfo$errorFields = _errInfo$errorFields[0]) === null || _errInfo$errorFields === void 0 ? void 0 : _errInfo$errorFields.name, {
behavior: 'smooth',
block: 'center'
});
case 2:
case "end":
return _context.stop();
}
}, _callee);
}));
return function (_x) {
return _ref2.apply(this, arguments);
};
}(),
children: [/*#__PURE__*/(0,jsx_runtime.jsxs)("div", {
style: {
display: 'flex',
alignItems: 'center',
marginTop: 20
},
children: [/*#__PURE__*/(0,jsx_runtime.jsxs)("div", {
style: {
flex: 1
},
children: [/*#__PURE__*/(0,jsx_runtime.jsx)("span", {
style: {
display: 'inline-flex',
border: '1px solid #9096A3',
borderRadius: '50%',
width: 10,
height: 10,
marginRight: 5,
background: '#9096A3'
}
}), /*#__PURE__*/(0,jsx_runtime.jsx)("span", {
children: '判断题'
})]
}), !(qitem !== null && qitem !== void 0 && qitem.isadd) && /*#__PURE__*/(0,jsx_runtime.jsxs)("span", {
style: {
marginLeft: 20,
marginRight: 20,
color: 'red',
cursor: 'pointer'
},
onClick: function onClick() {
deleteitem();
},
children: [/*#__PURE__*/(0,jsx_runtime.jsx)("i", {
className: "iconfont icon-piliangshanchu3",
style: {
fontSize: 14,
marginRight: 6
}
}), "\u5220\u9664"]
}), /*#__PURE__*/(0,jsx_runtime.jsx)(es_button/* default */.ZP, {
onClick: function onClick() {
if (!qitem.isadd) {
var _qitem$question_choic2;
form.setFieldsValue(objectSpread2_default()(objectSpread2_default()({}, qitem), {}, {
name: qitem === null || qitem === void 0 ? void 0 : qitem.question_title,
choices: qitem === null || qitem === void 0 || (_qitem$question_choic2 = qitem.question_choices) === null || _qitem$question_choic2 === void 0 ? void 0 : _qitem$question_choic2.map(function (item) {
return objectSpread2_default()(objectSpread2_default()({}, item), {}, {
is_answer: item !== null && item !== void 0 && item.standard_boolean ? 1 : 0
});
}),
repeat_answer: !(qitem !== null && qitem !== void 0 && qitem.repeat_answer)
}));
setisedit(false);
} else {
setisedit(false);
init();
}
},
children: "\u53D6\u6D88"
}), /*#__PURE__*/(0,jsx_runtime.jsx)(es_button/* default */.ZP, {
className: "ml20",
type: "primary",
onClick: function onClick() {
form.submit();
},
children: "\u4FDD\u5B58"
})]
}), /*#__PURE__*/(0,jsx_runtime.jsx)(es_form/* default */.Z.Item, {
className: EditPotinmodules.scoreinput,
name: "question_score",
label: "\u5206\u503C",
rules: [{
required: true,
message: '请输入分值'
}],
children: /*#__PURE__*/(0,jsx_runtime.jsx)(input_number/* default */.Z, {
style: {
width: 150
},
precision: 1,
placeholder: "\u8BF7\u8F93\u5165\u5206\u6570",
max: 100,
min: 0.1
})
}), /*#__PURE__*/(0,jsx_runtime.jsx)(JudgmentQuestionEditor/* JudgmentQuestionEditor */.Z, {
form: form,
questionTitlePlaceholder: "\u8BF7\u7F16\u8F91\u5224\u65AD\u9898\u9898\u5E72\u5185\u5BB9",
choiceKey: ""
}), /*#__PURE__*/(0,jsx_runtime.jsx)(MoreSetting, {
getTagData: getTagData,
qitem: qitem,
exerciseitem: exerciseitem,
TagDiscipline: TagDiscipline,
form: form
})]
})
});
};
/* harmony default export */ var Questions_JudgmentQuestionEditor = (JudgmentQuestionEditor_DragQuestions);
// EXTERNAL MODULE: ./node_modules/_@babel_runtime@7.23.2@@babel/runtime/helpers/objectWithoutProperties.js
var objectWithoutProperties = __webpack_require__(27161);
var objectWithoutProperties_default = /*#__PURE__*/__webpack_require__.n(objectWithoutProperties);
// EXTERNAL MODULE: ./node_modules/_antd@5.9.0@antd/es/collapse/index.js + 8 modules
var collapse = __webpack_require__(330);
;// CONCATENATED MODULE: ./src/pages/Paperlibrary/EditPotin/components/Questions/QuestionEditor/index.less?modules
// extracted by mini-css-extract-plugin
/* harmony default export */ var QuestionEditormodules = ({"wrap":"wrap___YewKC","deleteIcon":"deleteIcon___AKmkj","keywordTag":"keywordTag___hMKmU","questionTitleEditorWrap":"questionTitleEditorWrap___SpNyf","choiceWrap":"choiceWrap___lDCnP","choiceIndex":"choiceIndex___dabwf","judgementIndex":"judgementIndex___sausK","setAnswerBtn":"setAnswerBtn___moVcF","activeAnswer":"activeAnswer___Cd32c","activeJudgementAnswer":"activeJudgementAnswer___rbuoo","actionWrapper":"actionWrapper___dZuBC","addIcon":"addIcon___A9GtN","inputBorder":"inputBorder___DeyjY","placeholder":"placeholder___dhOmk","blankWrapper":"blankWrapper___vU8Cg","blankInput":"blankInput___Vzre8","blankInputNumberWrapper":"blankInputNumberWrapper___yLeaN","addBtn":"addBtn___LhI0I","blankIndex":"blankIndex___caKgB","baseInputWrapper":"baseInputWrapper___DhjJY","collapseWrapper":"collapseWrapper___btrfP","panelHeader":"panelHeader___xIZ7O","open":"open___IMQhg","close":"close___FTAU3","hide":"hide___GBtJP","scoreByBlankRadio":"scoreByBlankRadio___HAunQ"});
// EXTERNAL MODULE: ./node_modules/_@ant-design_icons@5.2.6@@ant-design/icons/es/icons/MinusCircleOutlined.js + 1 modules
var MinusCircleOutlined = __webpack_require__(87306);
// EXTERNAL MODULE: ./src/components/markdown-editor/index.tsx + 10 modules
var markdown_editor = __webpack_require__(20755);
;// CONCATENATED MODULE: ./src/pages/Paperlibrary/EditPotin/components/Questions/QuestionEditor/MdEditorInForm.tsx
var _excluded = ["value", "onChange", "scrollId"];
var MdEditorInForm = function MdEditorInForm(_ref) {
var value = _ref.value,
_onChange = _ref.onChange,
scrollId = _ref.scrollId,
props = objectWithoutProperties_default()(_ref, _excluded);
return /*#__PURE__*/(0,jsx_runtime.jsx)("div", {
id: scrollId || '',
children: /*#__PURE__*/(0,jsx_runtime.jsx)(markdown_editor/* default */.Z, objectSpread2_default()(objectSpread2_default()({}, props), {}, {
defaultValue: value,
onChange: function onChange(a, b) {
console.log("a:", a, b);
if (!!(b !== null && b !== void 0 && b.length)) _onChange(a, b);else _onChange(a);
}
}))
});
};
var RegularInput = function RegularInput(_ref2) {
var value = _ref2.value,
onChange = _ref2.onChange,
placeholder = _ref2.placeholder,
_ref2$height = _ref2.height,
height = _ref2$height === void 0 ? 140 : _ref2$height,
isEdit = _ref2.isEdit;
return isEdit ? /*#__PURE__*/(0,jsx_runtime.jsx)(markdown_editor/* default */.Z, {
watch: true,
isFocus: true,
height: height,
placeholder: placeholder,
defaultValue: value,
onChange: onChange
}) : /*#__PURE__*/(0,jsx_runtime.jsx)("div", {
style: {
cursor: 'pointer'
},
children: value ? /*#__PURE__*/(0,jsx_runtime.jsx)(RenderHtml/* default */.Z, {
className: QuestionEditormodules.inputBorder,
value: value
}) : /*#__PURE__*/(0,jsx_runtime.jsx)("div", {
className: "".concat(QuestionEditormodules.inputBorder, " ").concat(QuestionEditormodules.placeholder),
children: placeholder
})
});
};
// EXTERNAL MODULE: ./node_modules/_@babel_runtime@7.23.2@@babel/runtime/helpers/defineProperty.js
var defineProperty = __webpack_require__(22060);
var defineProperty_default = /*#__PURE__*/__webpack_require__.n(defineProperty);
// EXTERNAL MODULE: ./node_modules/_antd@5.9.0@antd/es/col/index.js
var col = __webpack_require__(43604);
// EXTERNAL MODULE: ./node_modules/_@ant-design_icons@5.2.6@@ant-design/icons/es/icons/PlusCircleOutlined.js + 1 modules
var PlusCircleOutlined = __webpack_require__(71029);
;// CONCATENATED MODULE: ./src/pages/Paperlibrary/EditPotin/components/Questions/QuestionEditor/ChoiceQuestionEditor.tsx
var ChoiceQuestionEditor_excluded = ["key", "name"];
var tagList = ['A', 'B', 'C', 'D', 'E', 'F', 'G', 'H', 'I', 'J', 'K', 'L', 'M', 'N', 'O', 'P', 'Q', 'R', 'S', 'T', 'U', 'V', 'W', 'X', 'Y', 'Z'];
var ChoiceQuestionItem = function ChoiceQuestionItem(_ref) {
var value = _ref.value,
_onChange = _ref.onChange,
choiceTextKey = _ref.choiceTextKey,
answerKey = _ref.answerKey,
index = _ref.index,
isEdit = _ref.isEdit,
setInputActive = _ref.setInputActive,
form = _ref.form,
choiceOptionsPath = _ref.choiceOptionsPath,
allowChangeMode = _ref.allowChangeMode,
showAddIcon = _ref.showAddIcon,
addItem = _ref.addItem,
deleteItem = _ref.deleteItem;
var isActiveAnswer = (value === null || value === void 0 ? void 0 : value[answerKey]) === 1;
var setAllOptionsToFalse = function setAllOptionsToFalse() {
var options = form.getFieldValue(choiceOptionsPath);
form.setFieldValue(choiceOptionsPath, options.map(function (item) {
return objectSpread2_default()(objectSpread2_default()({}, item), {}, defineProperty_default()({}, answerKey, 0));
}));
};
var setActiveAnswer = function setActiveAnswer() {
if (isActiveAnswer) {
_onChange(objectSpread2_default()(objectSpread2_default()({}, value), {}, defineProperty_default()({}, answerKey, 0)));
} else {
if (!allowChangeMode) {
setAllOptionsToFalse();
}
_onChange(objectSpread2_default()(objectSpread2_default()({}, value), {}, defineProperty_default()({}, answerKey, 1)));
}
};
return /*#__PURE__*/(0,jsx_runtime.jsxs)(row/* default */.Z, {
className: QuestionEditormodules.choiceWrap,
align: "middle",
wrap: false,
children: [/*#__PURE__*/(0,jsx_runtime.jsx)(col/* default */.Z, {
onClick: setActiveAnswer,
className: "".concat(QuestionEditormodules.choiceIndex, " ").concat(isActiveAnswer ? QuestionEditormodules.activeAnswer : ''),
children: tagList[index]
}), /*#__PURE__*/(0,jsx_runtime.jsx)(col/* default */.Z, {
flex: 1,
className: "".concat(QuestionEditormodules.editorWrap, " ml15"),
onClick: setInputActive,
children: /*#__PURE__*/(0,jsx_runtime.jsx)(RegularInput, {
height: 155,
placeholder: "\u8BF7\u60A8\u8F93\u5165\u9009\u9879",
isEdit: isEdit,
value: value === null || value === void 0 ? void 0 : value[choiceTextKey],
onChange: function onChange(v) {
_onChange(objectSpread2_default()(objectSpread2_default()({}, value), {}, defineProperty_default()({}, choiceTextKey, v)));
}
})
}), /*#__PURE__*/(0,jsx_runtime.jsx)(col/* default */.Z, {
flex: '0 0 auto',
className: "ml15",
children: /*#__PURE__*/(0,jsx_runtime.jsx)("div", {
onClick: setActiveAnswer,
className: "".concat(QuestionEditormodules.setAnswerBtn, " ").concat(isActiveAnswer ? QuestionEditormodules.activeAnswer : ''),
children: isActiveAnswer ? '正确答案' : '设为答案'
})
}), /*#__PURE__*/(0,jsx_runtime.jsxs)(col/* default */.Z, {
className: QuestionEditormodules.actionWrapper,
children: [/*#__PURE__*/(0,jsx_runtime.jsx)(tooltip/* default */.Z, {
title: "\u65B0\u589E\u53C2\u8003\u7B54\u6848",
children: /*#__PURE__*/(0,jsx_runtime.jsx)(PlusCircleOutlined/* default */.Z, {
className: QuestionEditormodules.addIcon,
onClick: addItem,
style: {
visibility: showAddIcon ? 'visible' : 'hidden'
}
})
}), /*#__PURE__*/(0,jsx_runtime.jsx)(tooltip/* default */.Z, {
title: "\u5220\u9664",
children: /*#__PURE__*/(0,jsx_runtime.jsx)(MinusCircleOutlined/* default */.Z, {
className: QuestionEditormodules.deleteIcon,
onClick: deleteItem,
style: {
visibility: index > 1 ? 'visible' : 'hidden'
}
})
})]
})]
});
};
var ChoiceQuestionEditor_ChoiceQuestionEditor = function ChoiceQuestionEditor(_ref2) {
var questionTitlePlaceholder = _ref2.questionTitlePlaceholder,
titleKey = _ref2.titleKey,
choiceKey = _ref2.choiceKey,
analysisKey = _ref2.analysisKey,
choiceTextKey = _ref2.choiceTextKey,
answerKey = _ref2.answerKey,
choiceOptionsPath = _ref2.choiceOptionsPath,
_ref2$allowChangeMode = _ref2.allowChangeMode,
allowChangeMode = _ref2$allowChangeMode === void 0 ? true : _ref2$allowChangeMode,
form = _ref2.form,
_ref2$showAnalysis = _ref2.showAnalysis,
showAnalysis = _ref2$showAnalysis === void 0 ? true : _ref2$showAnalysis;
var _useState = (0,_react_17_0_2_react.useState)(),
_useState2 = slicedToArray_default()(_useState, 2),
activeEditor = _useState2[0],
setActiveEditor = _useState2[1];
var _useState3 = (0,_react_17_0_2_react.useState)(false),
_useState4 = slicedToArray_default()(_useState3, 2),
editAnalysis = _useState4[0],
setEditAnalysis = _useState4[1];
return /*#__PURE__*/(0,jsx_runtime.jsxs)("div", {
className: QuestionEditormodules.wrap,
children: [/*#__PURE__*/(0,jsx_runtime.jsx)("div", {
className: QuestionEditormodules.questionTitleEditorWrap,
children: /*#__PURE__*/(0,jsx_runtime.jsx)(es_form/* default */.Z.Item, {
label: "\u9898\u5E72",
name: titleKey,
labelCol: {
span: 24
},
rules: [{
required: true
}],
children: /*#__PURE__*/(0,jsx_runtime.jsx)(MdEditorInForm, {
scrollId: Array.isArray(titleKey) ? titleKey.join('_') : "".concat(titleKey),
watch: true,
height: 140,
placeholder: questionTitlePlaceholder
})
})
}), /*#__PURE__*/(0,jsx_runtime.jsx)(es_form/* default */.Z.Item, {
label: "\u7B54\u6848\u9009\u9879",
required: true,
labelCol: {
span: 24
}
}), /*#__PURE__*/(0,jsx_runtime.jsx)(es_form/* default */.Z.List, {
name: choiceKey,
rules: [{
validator: function validator(rule, values) {
var hasAnswer = values.some(function (option) {
return option[answerKey] === 1;
});
var emptyAnswerIndex = values.findIndex(function (option) {
var _option$choiceTextKey;
return ((_option$choiceTextKey = option[choiceTextKey]) === null || _option$choiceTextKey === void 0 ? void 0 : _option$choiceTextKey.length) <= 0;
});
if (emptyAnswerIndex !== -1) {
return Promise.reject(new Error("\u8BF7\u5148\u8F93\u5165".concat(tagList[emptyAnswerIndex], "\u9009\u9879\u7684\u5185\u5BB9")));
}
if (!hasAnswer) {
return Promise.reject(new Error('请设置正确答案'));
}
return Promise.resolve();
}
}],
children: function children(fields, _ref3) {
var add = _ref3.add,
remove = _ref3.remove;
return /*#__PURE__*/(0,jsx_runtime.jsxs)("div", {
id: Array.isArray(choiceOptionsPath) ? choiceOptionsPath.join('_') : "".concat(choiceOptionsPath),
children: [fields.map(function (_ref4, index) {
var key = _ref4.key,
name = _ref4.name,
restField = objectWithoutProperties_default()(_ref4, ChoiceQuestionEditor_excluded);
var isEdit = activeEditor === key;
var setInputActive = function setInputActive() {
setActiveEditor(key);
};
var showAddIcon = index < 7 && index === fields.length - 1;
var addItem = function addItem() {
var _add;
return add((_add = {}, defineProperty_default()(_add, choiceTextKey, ''), defineProperty_default()(_add, answerKey, 0), _add));
};
var deleteItem = function deleteItem() {
return remove(name);
};
return /*#__PURE__*/(0,_react_17_0_2_react.createElement)(es_form/* default */.Z.Item, objectSpread2_default()(objectSpread2_default()({}, restField), {}, {
key: key,
name: name,
noStyle: true
}), /*#__PURE__*/(0,jsx_runtime.jsx)(ChoiceQuestionItem, {
choiceTextKey: choiceTextKey,
answerKey: answerKey,
index: index,
isEdit: isEdit,
setInputActive: setInputActive,
form: form,
choiceOptionsPath: choiceOptionsPath,
allowChangeMode: allowChangeMode,
showAddIcon: showAddIcon,
addItem: addItem,
deleteItem: deleteItem
}));
}), fields.length < 8 && /*#__PURE__*/(0,jsx_runtime.jsx)("div", {
className: "".concat(QuestionEditormodules.addBtn, " mb30"),
onClick: function onClick() {
var _add2;
return add((_add2 = {}, defineProperty_default()(_add2, choiceTextKey, ''), defineProperty_default()(_add2, answerKey, 0), _add2));
},
children: "\u6DFB\u52A0\u9009\u9879"
})]
});
}
}), showAnalysis && /*#__PURE__*/(0,jsx_runtime.jsx)("div", {
onClick: function onClick() {
return setEditAnalysis(true);
},
children: /*#__PURE__*/(0,jsx_runtime.jsx)(es_form/* default */.Z.Item, {
name: analysisKey,
label: "\u9898\u76EE\u89E3\u6790",
labelCol: {
span: 24
},
children: /*#__PURE__*/(0,jsx_runtime.jsx)(RegularInput, {
placeholder: "\u8BF7\u7F16\u8F91\u9898\u76EE\u89E3\u6790\uFF08\u975E\u5FC5\u586B\uFF09",
isEdit: editAnalysis
})
})
})]
});
};
;// CONCATENATED MODULE: ./src/pages/Paperlibrary/EditPotin/components/Questions/QuestionEditor/CombinationCompletionQuestionEditor.tsx
var CombinationCompletionQuestionEditor_excluded = ["key", "name"];
var BlankEditor = function BlankEditor(_ref) {
var value = _ref.value,
onChange = _ref.onChange;
var handleDelete = function handleDelete(index) {
modal/* default */.Z.confirm({
centered: true,
okText: '确定',
cancelText: '取消',
title: '提示',
content: '确认要删除这个参考答案吗?',
className: QuestionEditormodules.modal,
onOk: function onOk() {
var valueCopy = toConsumableArray_default()(value);
valueCopy.splice(index, 1);
onChange(valueCopy);
}
});
};
var handleAdd = function handleAdd() {
var valueCopy = toConsumableArray_default()(value);
valueCopy.push('');
onChange(valueCopy);
};
return /*#__PURE__*/(0,jsx_runtime.jsxs)(row/* default */.Z, {
align: "middle",
className: "ml20",
gutter: [40, 20],
children: [value === null || value === void 0 ? void 0 : value.map(function (v, index) {
return /*#__PURE__*/(0,jsx_runtime.jsxs)(col/* default */.Z, {
className: QuestionEditormodules.blankWrapper,
children: [/*#__PURE__*/(0,jsx_runtime.jsx)(input/* default */.Z, {
className: QuestionEditormodules.blankInput,
defaultValue: v,
maxLength: 1000,
onBlur: function onBlur(e) {
var valueCopy = toConsumableArray_default()(value);
var inputTrimValue = e.target.value.trim();
valueCopy[index] = inputTrimValue;
onChange(valueCopy);
}
}), /*#__PURE__*/(0,jsx_runtime.jsx)(tooltip/* default */.Z, {
title: "\u5220\u9664",
children: /*#__PURE__*/(0,jsx_runtime.jsx)(MinusCircleOutlined/* default */.Z, {
className: QuestionEditormodules.deleteIcon,
style: {
marginLeft: 15,
visibility: index > 0 ? 'visible' : 'hidden'
},
onClick: function onClick() {
return handleDelete(index);
}
})
})]
}, "".concat(v, "_").concat(index));
}), /*#__PURE__*/(0,jsx_runtime.jsx)(col/* default */.Z, {
children: /*#__PURE__*/(0,jsx_runtime.jsx)("div", {
className: "".concat(QuestionEditormodules.addBtn),
onClick: function onClick() {
handleAdd();
},
children: "\u65B0\u589E\u7B54\u6848"
})
})]
});
};
var ReversedSwitch = function ReversedSwitch(_ref2) {
var _ref2$value = _ref2.value,
value = _ref2$value === void 0 ? true : _ref2$value,
_onChange = _ref2.onChange;
//打开为false,关闭为true,即一个特殊的Switch。
return /*#__PURE__*/(0,jsx_runtime.jsx)(es_switch/* default */.Z, {
checked: !value,
onChange: function onChange(checked) {
_onChange(!checked);
}
});
};
var NULL_CH = '▁';
var CombinationCompletionQuestionEditor_CompletionQuestionEditor = function CompletionQuestionEditor(_ref3) {
var _form$getFieldValue;
var questionTitlePlaceholder = _ref3.questionTitlePlaceholder,
form = _ref3.form,
scoreByBlank = _ref3.scoreByBlank,
answerKey = _ref3.answerKey,
_ref3$titleKey = _ref3.titleKey,
titleKey = _ref3$titleKey === void 0 ? 'name' : _ref3$titleKey,
_ref3$analysisKey = _ref3.analysisKey,
analysisKey = _ref3$analysisKey === void 0 ? 'analysis' : _ref3$analysisKey,
_ref3$isOrdered = _ref3.isOrdered,
isOrdered = _ref3$isOrdered === void 0 ? 'is_ordered' : _ref3$isOrdered;
var _useState = (0,_react_17_0_2_react.useState)(false),
_useState2 = slicedToArray_default()(_useState, 2),
editAnalysis = _useState2[0],
setEditAnalysis = _useState2[1];
var getChCountBeforeCursor = function getChCountBeforeCursor(cm, cursor) {
var currentLine = cursor.line;
var placeholderCountBefore = 0;
for (var _line = 0; _line < currentLine; _line++) {
placeholderCountBefore += cm.getLine(_line).split(NULL_CH).length - 1;
}
var currentLineStringBeforeCursor = cm.getLine(currentLine).substring(0, cursor.ch);
placeholderCountBefore += currentLineStringBeforeCursor.split(NULL_CH).length - 1;
return placeholderCountBefore;
};
var _onCMBeforeChange = function onCMBeforeChange(cm, change, addBlank, removeBlank) {
var rangeText = cm.getRange(change.from, change.to);
var newBlankNum = 0;
change.text.forEach(function (item) {
newBlankNum += item.split(NULL_CH).length - 1;
});
if (change.origin === 'setValue') {
//setValue为初始化,此时不需要删除也不需要增加填空项
return;
}
if (rangeText && rangeText.indexOf(NULL_CH) !== -1) {
var placeholderCountInRange = rangeText.split(NULL_CH).length - 1;
var placeholderCountBefore = getChCountBeforeCursor(cm, change.from);
console.log("\u5220\u9664".concat(placeholderCountInRange, "\u4E2A\uFF0C \u524D\u9762\u6709").concat(placeholderCountBefore, "\u4E2A\uFF0C\u65B0\u589E").concat(newBlankNum, "\u4E2A"));
if (placeholderCountInRange > 1) {
var indexArray = Array.from({
length: placeholderCountInRange
}, function (item, index) {
return placeholderCountBefore + index;
});
removeBlank(indexArray);
} else {
removeBlank(placeholderCountBefore);
}
} else if (newBlankNum > 0) {
var _placeholderCountBefore = getChCountBeforeCursor(cm, change.from);
console.log("\u65B0\u589E".concat(newBlankNum, "\u4E2A\uFF0C\u4E4B\u524D\u6709").concat(_placeholderCountBefore, "\u4E2A"));
addBlank(newBlankNum, _placeholderCountBefore);
}
};
//新增和删除需要重新设置position,position表示填空的位置
var rewritePosition = function rewritePosition() {
var preAnswerData = form.getFieldValue(['sub_item_banks'].concat(toConsumableArray_default()(answerKey)));
form.setFieldValue(['sub_item_banks'].concat(toConsumableArray_default()(answerKey)), preAnswerData === null || preAnswerData === void 0 ? void 0 : preAnswerData.map(function (item, index) {
return objectSpread2_default()(objectSpread2_default()({}, item), {}, {
position: index + 1
});
}));
};
var addFnRef = (0,_react_17_0_2_react.useRef)();
var addBlank = function addBlank(addNum, insertIndex) {
for (var i = 0; i < addNum; i++) {
addFnRef.current({
position: null,
answer_text: ['']
}, insertIndex + i);
}
rewritePosition();
};
var removeFnRef = (0,_react_17_0_2_react.useRef)();
var removeBlank = function removeBlank(deleteIndex) {
removeFnRef.current(deleteIndex);
rewritePosition();
};
// const standardAnswersValue = Form.useWatch(answerKey, form)
var standardAnswersValue = (_form$getFieldValue = form.getFieldValue('sub_item_banks')) === null || _form$getFieldValue === void 0 || (_form$getFieldValue = _form$getFieldValue[answerKey === null || answerKey === void 0 ? void 0 : answerKey[0]]) === null || _form$getFieldValue === void 0 ? void 0 : _form$getFieldValue[answerKey === null || answerKey === void 0 ? void 0 : answerKey[1]];
console.log(form === null || form === void 0 ? void 0 : form.getFieldValue(['sub_item_banks'].concat(toConsumableArray_default()(scoreByBlank))));
return /*#__PURE__*/(0,jsx_runtime.jsxs)("div", {
className: QuestionEditormodules.wrap,
children: [/*#__PURE__*/(0,jsx_runtime.jsx)("div", {
className: QuestionEditormodules.questionTitleEditorWrap,
children: /*#__PURE__*/(0,jsx_runtime.jsx)(es_form/* default */.Z.Item, {
label: "\u9898\u5E72",
name: titleKey,
labelCol: {
span: 24
},
rules: [{
required: true
}],
children: /*#__PURE__*/(0,jsx_runtime.jsx)(MdEditorInForm, {
scrollId: "name",
watch: true,
height: 140,
placeholder: questionTitlePlaceholder,
showNullButton: true,
onCMBeforeChange: function onCMBeforeChange(cm, change) {
_onCMBeforeChange(cm, change, addBlank, removeBlank);
}
})
})
}), /*#__PURE__*/(0,jsx_runtime.jsx)(es_form/* default */.Z.List, {
name: answerKey,
rules: [{
validator: function validator(rule, values) {
if ((values === null || values === void 0 ? void 0 : values.length) === 0) {
return Promise.reject(new Error('答案不能为空'));
}
var _iterator = createForOfIteratorHelper_default()(values),
_step;
try {
for (_iterator.s(); !(_step = _iterator.n()).done;) {
var item = _step.value;
var _ref4 = item || {},
answer_text = _ref4.answer_text;
if (answer_text !== null && answer_text !== void 0 && answer_text.some(function (text) {
return (text === null || text === void 0 ? void 0 : text.length) === 0;
})) {
return Promise.reject(new Error('填空项答案不能为空'));
}
}
} catch (err) {
_iterator.e(err);
} finally {
_iterator.f();
}
return Promise.resolve();
}
}],
children: function children(fields, _ref5, _ref6) {
var add = _ref5.add,
remove = _ref5.remove;
var errors = _ref6.errors;
addFnRef.current = add;
removeFnRef.current = remove;
return /*#__PURE__*/(0,jsx_runtime.jsxs)(jsx_runtime.Fragment, {
children: [/*#__PURE__*/(0,jsx_runtime.jsx)(es_form/* default */.Z.Item, {
label: "\u7B54\u6848\u9009\u9879",
required: true,
labelCol: {
span: 24
}
}), fields.map(function (_ref7, index) {
var key = _ref7.key,
name = _ref7.name,
restField = objectWithoutProperties_default()(_ref7, CombinationCompletionQuestionEditor_excluded);
return /*#__PURE__*/(0,jsx_runtime.jsxs)(row/* default */.Z, {
className: "mb20",
align: "middle",
wrap: false,
children: [/*#__PURE__*/(0,jsx_runtime.jsxs)(col/* default */.Z, {
flex: '0 0 auto',
className: "".concat(QuestionEditormodules.blankIndex),
children: ["\u586B\u7A7A\u9879", index + 1]
}), /*#__PURE__*/(0,jsx_runtime.jsxs)(col/* default */.Z, {
flex: 1,
children: [/*#__PURE__*/(0,jsx_runtime.jsxs)(row/* default */.Z, {
align: "top",
justify: "space-between",
wrap: false,
children: [/*#__PURE__*/(0,jsx_runtime.jsx)(col/* default */.Z, {
children: /*#__PURE__*/(0,jsx_runtime.jsx)(es_form/* default */.Z.Item, objectSpread2_default()(objectSpread2_default()({}, restField), {}, {
name: [name, 'answer_text'],
noStyle: true,
children: /*#__PURE__*/(0,jsx_runtime.jsx)(BlankEditor, {})
}))
}), (form === null || form === void 0 ? void 0 : form.getFieldValue(['sub_item_banks'].concat(toConsumableArray_default()(scoreByBlank)))) && /*#__PURE__*/(0,jsx_runtime.jsx)(col/* default */.Z, {
flex: '224px',
children: /*#__PURE__*/(0,jsx_runtime.jsx)(es_form/* default */.Z.Item, objectSpread2_default()(objectSpread2_default()({}, restField), {}, {
name: [name, 'score'],
label: "\u5206\u503C",
rules: [{
required: true
}],
className: QuestionEditormodules.blankInputNumberWrapper,
children: /*#__PURE__*/(0,jsx_runtime.jsx)(input_number/* default */.Z, {
onChange: function onChange() {
var obj = form === null || form === void 0 ? void 0 : form.getFieldValue(['sub_item_banks', answerKey === null || answerKey === void 0 ? void 0 : answerKey[0], 'standard_answers']);
var count = 0;
for (var i in obj) {
var _obj$i;
if ((_obj$i = obj[i]) !== null && _obj$i !== void 0 && _obj$i.score) {
var _obj$i2;
count += Number((_obj$i2 = obj[i]) === null || _obj$i2 === void 0 ? void 0 : _obj$i2.score);
}
}
form === null || form === void 0 || form.setFieldValue(['sub_item_banks', answerKey === null || answerKey === void 0 ? void 0 : answerKey[0], 'question_score'], count);
},
className: QuestionEditormodules.blankInput,
min: 0.1,
max: 100,
precision: 1,
style: {
width: '100%'
},
placeholder: "\u6309\u7A7A\u7ED9\u5206\u8BF7\u8F93\u5165\u5206\u503C"
})
}))
})]
}), /*#__PURE__*/(0,jsx_runtime.jsx)(es_form/* default */.Z.Item, objectSpread2_default()(objectSpread2_default()({}, restField), {}, {
name: [name, 'position'],
noStyle: true,
children: /*#__PURE__*/(0,jsx_runtime.jsx)(input/* default */.Z, {
type: "hidden"
})
}))]
})]
}, key);
})]
});
}
}), (standardAnswersValue === null || standardAnswersValue === void 0 ? void 0 : standardAnswersValue.length) > 1 && /*#__PURE__*/(0,jsx_runtime.jsxs)(row/* default */.Z, {
align: "middle",
className: (standardAnswersValue === null || standardAnswersValue === void 0 ? void 0 : standardAnswersValue.length) > 1 ? 'mb30' : "".concat(QuestionEditormodules.hide),
children: [/*#__PURE__*/(0,jsx_runtime.jsx)(es_form/* default */.Z.Item, {
name: isOrdered,
children: /*#__PURE__*/(0,jsx_runtime.jsx)(ReversedSwitch, {})
}), /*#__PURE__*/(0,jsx_runtime.jsx)(col/* default */.Z, {
className: "ml10",
children: "\u5141\u8BB8\u5B66\u751F\u6BCF\u4E2A\u586B\u7A7A\u7684\u7B54\u6848\u4E0E\u6807\u51C6\u7B54\u6848\u7684\u987A\u5E8F\u4E0D\u4E00\u81F4"
})]
}), /*#__PURE__*/(0,jsx_runtime.jsx)("div", {
onClick: function onClick() {
return setEditAnalysis(true);
},
children: /*#__PURE__*/(0,jsx_runtime.jsx)(es_form/* default */.Z.Item, {
name: analysisKey,
label: "\u9898\u76EE\u89E3\u6790",
labelCol: {
span: 24
},
children: /*#__PURE__*/(0,jsx_runtime.jsx)(RegularInput, {
placeholder: "\u8BF7\u7F16\u8F91\u9898\u76EE\u89E3\u6790\uFF08\u975E\u5FC5\u586B\uFF09",
isEdit: editAnalysis
})
})
})]
});
};
;// CONCATENATED MODULE: ./src/pages/Paperlibrary/EditPotin/components/Questions/QuestionEditor/CombinationJudgmentQuestionEditor.tsx
var CombinationJudgmentQuestionEditor_excluded = ["key", "name"];
var _tagMap;
var tagMap = (_tagMap = {}, defineProperty_default()(_tagMap, '正确', 'T'), defineProperty_default()(_tagMap, '错误', 'F'), _tagMap);
var JudgmentQuestionItem = function JudgmentQuestionItem(_ref) {
var value = _ref.value,
onChange = _ref.onChange,
form = _ref.form,
choiceKey = _ref.choiceKey;
var isActiveAnswer = (value === null || value === void 0 ? void 0 : value.is_answer) === 1;
var judgementText = value === null || value === void 0 ? void 0 : value.choice_text;
var setActiveAnswer = function setActiveAnswer() {
var _form$getFieldValue;
var formListValue = form === null || form === void 0 || (_form$getFieldValue = form.getFieldValue(['sub_item_banks'].concat(toConsumableArray_default()(choiceKey)))) === null || _form$getFieldValue === void 0 ? void 0 : _form$getFieldValue.map(function (choice) {
return {
choice_text: choice.choice_text,
is_answer: 0
};
});
form === null || form === void 0 || form.setFieldValue(['sub_item_banks'].concat(toConsumableArray_default()(choiceKey)), formListValue);
onChange(objectSpread2_default()(objectSpread2_default()({}, value), {}, {
is_answer: 1
}));
};
return /*#__PURE__*/(0,jsx_runtime.jsxs)(row/* default */.Z, {
className: QuestionEditormodules.choiceWrap,
align: "middle",
wrap: false,
children: [/*#__PURE__*/(0,jsx_runtime.jsx)(col/* default */.Z, {
onClick: setActiveAnswer,
className: "".concat(QuestionEditormodules.choiceIndex, " ").concat(QuestionEditormodules.judgementIndex, " ").concat(isActiveAnswer ? QuestionEditormodules.activeAnswer : ''),
children: tagMap[judgementText]
}), /*#__PURE__*/(0,jsx_runtime.jsx)(col/* default */.Z, {
flex: 1,
className: "".concat(QuestionEditormodules.editorWrap, " ml15"),
children: /*#__PURE__*/(0,jsx_runtime.jsx)("div", {
className: "".concat(QuestionEditormodules.inputBorder, " ").concat(QuestionEditormodules.placeholder, " ").concat(isActiveAnswer ? QuestionEditormodules.activeJudgementAnswer : ''),
children: judgementText
})
}), /*#__PURE__*/(0,jsx_runtime.jsx)(col/* default */.Z, {
flex: '0 0 auto',
className: "ml15",
children: /*#__PURE__*/(0,jsx_runtime.jsx)("div", {
onClick: setActiveAnswer,
className: "".concat(QuestionEditormodules.setAnswerBtn, " ").concat(isActiveAnswer ? QuestionEditormodules.activeAnswer : ''),
children: isActiveAnswer ? '正确答案' : '设为答案'
})
})]
});
};
var CombinationJudgmentQuestionEditor_JudgmentQuestionEditor = function JudgmentQuestionEditor(_ref2) {
var questionTitlePlaceholder = _ref2.questionTitlePlaceholder,
_ref2$choiceKey = _ref2.choiceKey,
choiceKey = _ref2$choiceKey === void 0 ? 'choices' : _ref2$choiceKey,
form = _ref2.form,
_ref2$titleKey = _ref2.titleKey,
titleKey = _ref2$titleKey === void 0 ? 'name' : _ref2$titleKey,
_ref2$analysisKey = _ref2.analysisKey,
analysisKey = _ref2$analysisKey === void 0 ? 'analysis' : _ref2$analysisKey;
var _useState = (0,_react_17_0_2_react.useState)(false),
_useState2 = slicedToArray_default()(_useState, 2),
editAnalysis = _useState2[0],
setEditAnalysis = _useState2[1];
return /*#__PURE__*/(0,jsx_runtime.jsxs)("div", {
className: QuestionEditormodules.wrap,
children: [/*#__PURE__*/(0,jsx_runtime.jsx)("div", {
className: QuestionEditormodules.questionTitleEditorWrap,
children: /*#__PURE__*/(0,jsx_runtime.jsx)(es_form/* default */.Z.Item, {
label: "\u9898\u5E72",
name: titleKey,
labelCol: {
span: 24
},
rules: [{
required: true
}],
children: /*#__PURE__*/(0,jsx_runtime.jsx)(MdEditorInForm, {
scrollId: "name",
watch: true,
height: 140,
placeholder: questionTitlePlaceholder
})
})
}), /*#__PURE__*/(0,jsx_runtime.jsx)(es_form/* default */.Z.Item, {
label: "\u7B54\u6848\u9009\u9879",
required: true,
labelCol: {
span: 24
},
children: /*#__PURE__*/(0,jsx_runtime.jsx)(es_form/* default */.Z.List, {
name: choiceKey,
rules: [{
validator: function validator(rule, values) {
var hasAnswer = values.some(function (option) {
return (option === null || option === void 0 ? void 0 : option.is_answer) === 1;
});
if (hasAnswer) {
return Promise.resolve();
}
return Promise.reject(new Error('请设置正确答案'));
}
}],
children: function children(fields) {
return /*#__PURE__*/(0,jsx_runtime.jsx)("div", {
id: "choices",
children: fields.map(function (_ref3) {
var key = _ref3.key,
name = _ref3.name,
restField = objectWithoutProperties_default()(_ref3, CombinationJudgmentQuestionEditor_excluded);
return /*#__PURE__*/(0,_react_17_0_2_react.createElement)(es_form/* default */.Z.Item, objectSpread2_default()(objectSpread2_default()({}, restField), {}, {
key: key,
name: name,
noStyle: true
}), /*#__PURE__*/(0,jsx_runtime.jsx)(JudgmentQuestionItem, {
form: form,
choiceKey: choiceKey
}));
})
});
}
})
}), /*#__PURE__*/(0,jsx_runtime.jsx)("div", {
onClick: function onClick() {
return setEditAnalysis(true);
},
children: /*#__PURE__*/(0,jsx_runtime.jsx)(es_form/* default */.Z.Item, {
name: analysisKey,
label: "\u9898\u76EE\u89E3\u6790",
labelCol: {
span: 24
},
children: /*#__PURE__*/(0,jsx_runtime.jsx)(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/tag/index.js + 5 modules
var tag = __webpack_require__(12563);
;// CONCATENATED MODULE: ./src/pages/Paperlibrary/EditPotin/components/Questions/QuestionEditor/CombinationSubjectiveQuestionEditor.tsx
var CombinationSubjectiveQuestionEditor_excluded = ["value", "onChange"],
_excluded2 = ["key", "name"];
var AnswerTextFormItem = function AnswerTextFormItem(_ref) {
var value = _ref.value,
onChange = _ref.onChange,
props = objectWithoutProperties_default()(_ref, CombinationSubjectiveQuestionEditor_excluded);
var handleChange = function handleChange(v) {
onChange([v]);
};
return /*#__PURE__*/(0,jsx_runtime.jsx)(markdown_editor/* default */.Z, objectSpread2_default()(objectSpread2_default()({}, props), {}, {
defaultValue: value === null || value === void 0 ? void 0 : value[0],
onChange: handleChange
}));
};
var test = function test(str) {
if (!str) {
return false;
}
var containSpecial = new RegExp("[ `~!@#$^&*()={}':;,\\[\\].<>/?~!@#¥……&*()—【】‘;:”“。,、?「」『』_\\+\\-·%《》]|[\\\\/]");
// if (containSpecial.test(str)) {
// message.warning("关键词不能含有特殊字符!")
// return false
// }
if (str === '|') {
message/* default */.ZP.warning("关键词不能只输入一个“|”字符!");
return false;
}
return true;
};
var KeywordTag = function KeywordTag(_ref2) {
var _ref2$value = _ref2.value,
value = _ref2$value === void 0 ? [] : _ref2$value,
onClose = _ref2.onClose;
return /*#__PURE__*/(0,jsx_runtime.jsx)(tag/* default */.Z, {
closable: true,
onClose: onClose,
className: QuestionEditormodules.keywordTag,
children: value === null || value === void 0 ? void 0 : value.join(' 或 ')
});
};
var SubjectiveQuestionEditor = function SubjectiveQuestionEditor(_ref3) {
var _form$getFieldValue, _form$getFieldValue2;
var questionTitlePlaceholder = _ref3.questionTitlePlaceholder,
form = _ref3.form,
showKeywords = _ref3.showKeywords,
_ref3$isMustKeyWords = _ref3.isMustKeyWords,
isMustKeyWords = _ref3$isMustKeyWords === void 0 ? showKeywords : _ref3$isMustKeyWords,
_ref3$titleKey = _ref3.titleKey,
titleKey = _ref3$titleKey === void 0 ? 'name' : _ref3$titleKey,
_ref3$analysisKey = _ref3.analysisKey,
analysisKey = _ref3$analysisKey === void 0 ? 'analysis' : _ref3$analysisKey,
_ref3$answerTexts = _ref3.answerTexts,
answerTexts = _ref3$answerTexts === void 0 ? 'answer_texts' : _ref3$answerTexts,
_ref3$keywords = _ref3.keywords,
keywords = _ref3$keywords === void 0 ? 'keywords' : _ref3$keywords,
_ref3$useKeywords = _ref3.useKeywords,
useKeywords = _ref3$useKeywords === void 0 ? 'use_keywords' : _ref3$useKeywords,
indexs = _ref3.indexs;
var _useState = (0,_react_17_0_2_react.useState)(false),
_useState2 = slicedToArray_default()(_useState, 2),
editAnalysis = _useState2[0],
setEditAnalysis = _useState2[1];
var _useState3 = (0,_react_17_0_2_react.useState)(''),
_useState4 = slicedToArray_default()(_useState3, 2),
keywordsInput = _useState4[0],
setKeywordsInput = _useState4[1];
// const useKeywordsValue: boolean = Form.useWatch(useKeywords, form);
var useKeywordsValue = (_form$getFieldValue = form.getFieldValue('sub_item_banks')) === null || _form$getFieldValue === void 0 || (_form$getFieldValue = _form$getFieldValue[useKeywords === null || useKeywords === void 0 ? void 0 : useKeywords[0]]) === null || _form$getFieldValue === void 0 ? void 0 : _form$getFieldValue[useKeywords === null || useKeywords === void 0 ? void 0 : useKeywords[1]];
var questionScore = (_form$getFieldValue2 = form.getFieldValue('sub_item_banks')) === null || _form$getFieldValue2 === void 0 || (_form$getFieldValue2 = _form$getFieldValue2[useKeywords === null || useKeywords === void 0 ? void 0 : useKeywords[0]]) === null || _form$getFieldValue2 === void 0 ? void 0 : _form$getFieldValue2.question_score;
// const questionScore: string = Form.useWatch('question_score', form);
return /*#__PURE__*/(0,jsx_runtime.jsxs)("div", {
className: QuestionEditormodules.wrap,
children: [/*#__PURE__*/(0,jsx_runtime.jsx)("div", {
className: QuestionEditormodules.questionTitleEditorWrap,
children: /*#__PURE__*/(0,jsx_runtime.jsx)(es_form/* default */.Z.Item, {
label: "\u9898\u5E72",
name: titleKey,
labelCol: {
span: 24
},
rules: [{
required: true
}],
children: /*#__PURE__*/(0,jsx_runtime.jsx)(MdEditorInForm, {
scrollId: "name",
watch: true,
height: 140,
placeholder: questionTitlePlaceholder
})
})
}), /*#__PURE__*/(0,jsx_runtime.jsx)(es_form/* default */.Z.Item, {
label: "\u53C2\u8003\u7B54\u6848",
name: answerTexts,
labelCol: {
span: 24
},
children: /*#__PURE__*/(0,jsx_runtime.jsx)(AnswerTextFormItem, {
watch: true,
height: 140,
placeholder: '请编辑参考答案(非必填)'
})
}), showKeywords && !isMustKeyWords && /*#__PURE__*/(0,jsx_runtime.jsx)(es_form/* default */.Z.Item, {
hidden: true,
name: useKeywords,
valuePropName: "checked",
children: /*#__PURE__*/(0,jsx_runtime.jsx)(es_switch/* default */.Z, {
defaultChecked: true
})
}), showKeywords && isMustKeyWords && /*#__PURE__*/(0,jsx_runtime.jsxs)(row/* default */.Z, {
align: "middle",
className: "mb30",
children: [/*#__PURE__*/(0,jsx_runtime.jsx)(es_form/* default */.Z.Item, {
name: useKeywords,
valuePropName: "checked",
children: /*#__PURE__*/(0,jsx_runtime.jsx)(es_switch/* default */.Z, {})
}), /*#__PURE__*/(0,jsx_runtime.jsx)(col/* default */.Z, {
className: "ml10",
children: "\u5F00\u542F\u5173\u952E\u8BCD\u81EA\u52A8\u5224\u5206"
}), /*#__PURE__*/(0,jsx_runtime.jsx)(col/* default */.Z, {
children: /*#__PURE__*/(0,jsx_runtime.jsx)(tooltip/* default */.Z, {
placement: "right",
title: "\u9009\u4E2D\u540E\uFF0C\u9700\u8981\u8BBE\u7F6E\u6BCF\u4E2A\u5173\u952E\u8BCD\u7684\u5206\u503C\uFF0C\u7CFB\u7EDF\u4F1A\u6839\u636E\u8BBE\u7F6E\u7684\u5173\u952E\u8BCD\u8FDB\u884C\u81EA\u52A8\u5224\u5206\uFF1B \u6240\u6709\u5173\u952E\u8BCD\u5206\u503C\u4E4B\u548C\u5FC5\u987B\u5C0F\u4E8E\u7B49\u4E8E\u5C0F\u9898\u5206\u503C\u3002",
children: /*#__PURE__*/(0,jsx_runtime.jsx)(QuestionCircleOutlined/* default */.Z, {
style: {
color: '#3061D0',
marginLeft: 6,
cursor: 'pointer'
}
})
})
})]
}), (useKeywordsValue || !isMustKeyWords) && /*#__PURE__*/(0,jsx_runtime.jsx)(es_form/* default */.Z.List, {
name: keywords,
rules: [{
validator: function validator(rule, values) {
if (!isMustKeyWords) {
return Promise.resolve();
}
if (!(values !== null && values !== void 0 && values.length)) {
return Promise.reject(new Error('请输入关键词'));
}
var keywordsScoreSum = values === null || values === void 0 ? void 0 : values.reduce(function (pre, cur) {
return pre + cur.score;
}, 0);
if (keywordsScoreSum > parseFloat(questionScore)) {
return Promise.reject(new Error('所有关键词的分值之和必须小于等于该小题的分值'));
}
return Promise.resolve();
}
}],
children: function children(fields, _ref4) {
var add = _ref4.add,
remove = _ref4.remove;
return /*#__PURE__*/(0,jsx_runtime.jsxs)(jsx_runtime.Fragment, {
children: [/*#__PURE__*/(0,jsx_runtime.jsx)("div", {
className: "".concat(QuestionEditormodules.title, " mb10"),
children: !isMustKeyWords ? /*#__PURE__*/(0,jsx_runtime.jsx)("span", {
style: {
color: "#9096A3"
},
children: "\u5224\u5206\u5173\u952E\u8BCD"
}) : "关键词"
}), /*#__PURE__*/(0,jsx_runtime.jsxs)(row/* default */.Z, {
align: "middle",
className: "font14 mb30",
children: [/*#__PURE__*/(0,jsx_runtime.jsx)(col/* default */.Z, {
flex: 1,
children: /*#__PURE__*/(0,jsx_runtime.jsx)(input/* default */.Z, {
value: keywordsInput,
onChange: function onChange(e) {
setKeywordsInput(e.target.value);
},
maxLength: 50,
allowClear: true,
onPressEnter: function onPressEnter(e) {
var _e$target, _v$split, _currentKeywordsValue;
var v = "".concat((_e$target = e.target) === null || _e$target === void 0 ? void 0 : _e$target.value).replaceAll(' ', ''); //去除所有的空格,同时空格也不触发非法字符校验了
var keywordArr = v === null || v === void 0 || (_v$split = v.split('|')) === null || _v$split === void 0 ? void 0 : _v$split.filter(function (k) {
return !!k;
});
var currentKeywordsValue = form.getFieldValue('keywords');
var existKeywords = (currentKeywordsValue === null || currentKeywordsValue === void 0 || (_currentKeywordsValue = currentKeywordsValue.map(function (item) {
return item === null || item === void 0 ? void 0 : item.keyword;
})) === null || _currentKeywordsValue === void 0 ? void 0 : _currentKeywordsValue.flat()) || [];
var _iterator = createForOfIteratorHelper_default()(keywordArr),
_step;
try {
for (_iterator.s(); !(_step = _iterator.n()).done;) {
var word = _step.value;
if (existKeywords.includes(word)) {
message/* default */.ZP.error('为避免判分错误,请勿设置相同的关键词');
return;
}
}
} catch (err) {
_iterator.e(err);
} finally {
_iterator.f();
}
if (test(v)) {
add({
keyword: keywordArr,
score: 1
});
setKeywordsInput('');
// let obj = form?.getFieldValue(['sub_item_banks', answerTexts?.[0], 'keywords']);
// let count = 0;
// for (let i in obj) {
// count += Number(obj[i]?.score)
// }
// form?.setFieldValue(['sub_item_banks', answerTexts?.[0], 'question_score'], count)
}
},
className: QuestionEditormodules.inputBorder,
placeholder: "\u652F\u6301\u8BBE\u7F6E\u591A\u4E2A\u5173\u952E\u8BCD\uFF1B\u5E76\u5217\u5173\u952E\u8BCD\uFF08\u6216\u7684\u5173\u7CFB\uFF09\u8BF7\u7528\u201C|\u201D\u5206\u9694\u5F00"
})
}), /*#__PURE__*/(0,jsx_runtime.jsx)(col/* default */.Z, {
flex: '148px',
style: {
textAlign: 'right',
color: '#9096A3'
},
children: "\u201C\u56DE\u8F66\u952E\u201D\u4FDD\u5B58\u5173\u952E\u8BCD"
})]
}), fields.map(function (_ref5) {
var key = _ref5.key,
name = _ref5.name,
restField = objectWithoutProperties_default()(_ref5, _excluded2);
return /*#__PURE__*/(0,jsx_runtime.jsx)(row/* default */.Z, {
className: "mb20",
style: {
marginRight: 148
},
children: /*#__PURE__*/(0,jsx_runtime.jsx)(col/* default */.Z, {
flex: 1,
children: /*#__PURE__*/(0,jsx_runtime.jsxs)(row/* default */.Z, {
align: "middle",
justify: "space-between",
children: [/*#__PURE__*/(0,jsx_runtime.jsx)(es_form/* default */.Z.Item, objectSpread2_default()(objectSpread2_default()({}, restField), {}, {
name: [name, "keyword"],
children: /*#__PURE__*/(0,jsx_runtime.jsx)(KeywordTag, {
onClose: function onClose() {
return remove(name);
}
})
})), isMustKeyWords && /*#__PURE__*/(0,jsx_runtime.jsx)(es_form/* default */.Z.Item, objectSpread2_default()(objectSpread2_default()({}, restField), {}, {
name: [name, "score"],
label: "\u5206\u503C",
rules: [{
required: true
}],
className: QuestionEditormodules.blankInputNumberWrapper,
children: /*#__PURE__*/(0,jsx_runtime.jsx)(input_number/* default */.Z
// onChange={() => {
// let obj = form?.getFieldValue(['sub_item_banks', answerTexts?.[0], 'keywords']);
// let count = 0;
// for (let i in obj) {
// count += Number(obj[i]?.score)
// }
// form?.setFieldValue(['sub_item_banks', answerTexts?.[0], 'my_score_add'], count)
// }}
, {
className: QuestionEditormodules.blankInput,
min: 0.1,
max: 100,
precision: 1,
style: {
width: '100%'
},
placeholder: "\u8BF7\u8F93\u5165\u5173\u952E\u8BCD\u5206\u6570"
})
}))]
})
})
}, key);
})]
});
}
}), /*#__PURE__*/(0,jsx_runtime.jsx)("div", {
onClick: function onClick() {
return setEditAnalysis(true);
},
children: /*#__PURE__*/(0,jsx_runtime.jsx)(es_form/* default */.Z.Item, {
name: analysisKey,
label: "\u9898\u76EE\u89E3\u6790",
labelCol: {
span: 24
},
children: /*#__PURE__*/(0,jsx_runtime.jsx)(RegularInput, {
placeholder: "\u8BF7\u7F16\u8F91\u9898\u76EE\u89E3\u6790\uFF08\u975E\u5FC5\u586B\uFF09",
isEdit: editAnalysis
})
})
})]
});
};
;// CONCATENATED MODULE: ./src/pages/Paperlibrary/EditPotin/components/Questions/QuestionEditor/CombinationQuestionEditor.tsx
var CombinationQuestionEditor_excluded = ["key", "name"];
// import type { ChoiceQuestionType } from './types'
var Panel = collapse/* default */.Z.Panel;
var CombinationQuestionEditor = function CombinationQuestionEditor(_ref) {
var questionTitlePlaceholder = _ref.questionTitlePlaceholder,
choiceKey = _ref.choiceKey,
form = _ref.form,
withScore = _ref.withScore;
// const [editAnalysis, setEditAnalysis] = useState(false)
var questionType = [{
type: 0,
name: '单选题'
}, {
type: 1,
name: '多选题'
}, {
type: 2,
name: '判断题'
}, {
type: 3,
name: '填空题'
}, {
type: 4,
name: '简答题'
}, {
type: 5,
name: '实训题'
}, {
type: 6,
name: '编程题'
}, {
type: 7,
name: '组合题'
}, {
type: 8,
name: '程序填空题'
}];
var _useState = (0,_react_17_0_2_react.useState)(),
_useState2 = slicedToArray_default()(_useState, 2),
shuaxin = _useState2[0],
setshuaxin = _useState2[1];
var _useState3 = (0,_react_17_0_2_react.useState)([]),
_useState4 = slicedToArray_default()(_useState3, 2),
activeKey = _useState4[0],
setActiveKey = _useState4[1];
var handleCollapseChange = function handleCollapseChange(keys) {
setActiveKey(keys);
};
return /*#__PURE__*/(0,jsx_runtime.jsxs)("div", {
className: QuestionEditormodules.wrap,
children: [/*#__PURE__*/(0,jsx_runtime.jsx)("div", {
className: QuestionEditormodules.questionTitleEditorWrap,
children: /*#__PURE__*/(0,jsx_runtime.jsx)(es_form/* default */.Z.Item, {
label: "\u9898\u5E72",
name: "name",
labelCol: {
span: 24
},
rules: [{
required: true
}],
children: /*#__PURE__*/(0,jsx_runtime.jsx)(MdEditorInForm, {
scrollId: "name",
watch: true,
height: 140,
placeholder: questionTitlePlaceholder
})
})
}), /*#__PURE__*/(0,jsx_runtime.jsx)(es_form/* default */.Z.Item, {
label: "\u5C0F\u9898",
required: true,
labelCol: {
span: 24
}
}), /*#__PURE__*/(0,jsx_runtime.jsx)(es_form/* default */.Z.List, {
name: "sub_item_banks",
rules: [{
validator: function validator(rule, values) {
if (!values) {
return Promise.reject(new Error('请添加小题'));
}
return Promise.resolve();
}
}],
children: function children(fields, _ref2) {
var add = _ref2.add,
remove = _ref2.remove;
var item_list = form.getFieldValue('sub_item_banks');
return /*#__PURE__*/(0,jsx_runtime.jsxs)(jsx_runtime.Fragment, {
children: [/*#__PURE__*/(0,jsx_runtime.jsx)(collapse/* default */.Z, {
className: fields.length > 0 ? QuestionEditormodules.collapseWrapper : '',
bordered: false,
activeKey: activeKey,
onChange: handleCollapseChange,
expandIcon: function expandIcon(_ref3) {
var isActive = _ref3.isActive;
return /*#__PURE__*/(0,jsx_runtime.jsx)("i", {
className: "iconfont icon-weizhankai ".concat(isActive ? QuestionEditormodules.open : QuestionEditormodules.close),
style: {
fontSize: 14,
transition: 'all .2s'
}
});
},
children: fields.map(function (_ref4, index) {
var _item_list$name, _item_list$name2, _item_list$name3, _item_list$name4, _item_list$name5, _item_list$name6, _item_list$name7, _item_list$name8, _item_list$name9, _item_list$name10, _item_list$name11, _item_list$name12, _item_list$name13, _item_list$name14;
var key = _ref4.key,
name = _ref4.name,
restField = objectWithoutProperties_default()(_ref4, CombinationQuestionEditor_excluded);
return /*#__PURE__*/(0,jsx_runtime.jsx)(Panel, {
className: QuestionEditormodules.panel,
forceRender: true,
header: /*#__PURE__*/(0,jsx_runtime.jsxs)("div", {
className: QuestionEditormodules.panelHeader,
children: ["\u7B2C", index + 1, "\u5C0F\u9898", /*#__PURE__*/(0,jsx_runtime.jsxs)("span", {
children: ["\uFF08", (item_list === null || item_list === void 0 || (_item_list$name = item_list[name]) === null || _item_list$name === void 0 ? void 0 : _item_list$name.question_type) == 0 ? '单选题' : (item_list === null || item_list === void 0 || (_item_list$name2 = item_list[name]) === null || _item_list$name2 === void 0 ? void 0 : _item_list$name2.question_type) == 1 ? '多选题' : (item_list === null || item_list === void 0 || (_item_list$name3 = item_list[name]) === null || _item_list$name3 === void 0 ? void 0 : _item_list$name3.question_type) == 3 ? '填空题' : (item_list === null || item_list === void 0 || (_item_list$name4 = item_list[name]) === null || _item_list$name4 === void 0 ? void 0 : _item_list$name4.question_type) == 2 ? '判断题' : '简答题', "\uFF09"]
})]
}),
extra: /*#__PURE__*/(0,jsx_runtime.jsxs)(row/* default */.Z, {
align: "middle",
onClick: function onClick(e) {
return e.stopPropagation();
},
children: [(item_list === null || item_list === void 0 || (_item_list$name5 = item_list[name]) === null || _item_list$name5 === void 0 ? void 0 : _item_list$name5.question_type) == 3 && /*#__PURE__*/(0,jsx_runtime.jsx)(es_radio/* default.Group */.ZP.Group, {
defaultValue: item_list === null || item_list === void 0 || (_item_list$name6 = item_list[name]) === null || _item_list$name6 === void 0 ? void 0 : _item_list$name6.use_blank_score,
className: EditPotinmodules.scoreByBlankRadio,
style: {
marginRight: 20
},
optionType: "button",
options: [{
label: '按空给分',
value: true
}, {
label: '按题给分',
value: false
}],
onChange: function onChange(e) {
var _e$target, _e$target2;
form === null || form === void 0 || form.setFieldValue(['sub_item_banks', name, 'use_blank_score'], e === null || e === void 0 || (_e$target = e.target) === null || _e$target === void 0 ? void 0 : _e$target.value);
if (e !== null && e !== void 0 && (_e$target2 = e.target) !== null && _e$target2 !== void 0 && _e$target2.value) {
var count = 0;
for (var i in form === null || form === void 0 || (_form$getFieldValue = form.getFieldValue(['sub_item_banks', name])) === null || _form$getFieldValue === void 0 ? void 0 : _form$getFieldValue.standard_answers) {
var _form$getFieldValue, _form$getFieldValue2;
count += Number(form === null || form === void 0 || (_form$getFieldValue2 = form.getFieldValue(['sub_item_banks', name])) === null || _form$getFieldValue2 === void 0 || (_form$getFieldValue2 = _form$getFieldValue2.standard_answers[i]) === null || _form$getFieldValue2 === void 0 ? void 0 : _form$getFieldValue2.score);
}
form === null || form === void 0 || form.setFieldValue(['sub_item_banks', name, 'question_score'], count || '');
}
setshuaxin(new Date());
}
}), withScore && /*#__PURE__*/(0,jsx_runtime.jsx)(es_form/* default */.Z.Item, objectSpread2_default()(objectSpread2_default()({}, restField), {}, {
rules: [{
required: true,
message: '请输入小题分值'
}],
label: "\u5206\u503C",
name: [name, 'question_score'],
className: QuestionEditormodules.blankInputNumberWrapper,
children: /*#__PURE__*/(0,jsx_runtime.jsx)(input_number/* default */.Z, {
disabled: (item_list === null || item_list === void 0 || (_item_list$name7 = item_list[name]) === null || _item_list$name7 === void 0 ? void 0 : _item_list$name7.question_type) == 3 && item_list !== null && item_list !== void 0 && (_item_list$name8 = item_list[name]) !== null && _item_list$name8 !== void 0 && _item_list$name8.use_blank_score ? true : false,
className: QuestionEditormodules.blankInput,
placeholder: "\u8BF7\u8F93\u5165\u5206\u6570",
min: 0.1,
precision: 1,
max: 100,
style: {
width: 150
}
})
})), /*#__PURE__*/(0,jsx_runtime.jsx)(tooltip/* default */.Z, {
title: "\u5220\u9664",
children: /*#__PURE__*/(0,jsx_runtime.jsx)(MinusCircleOutlined/* default */.Z, {
className: "".concat(QuestionEditormodules.deleteIcon, " ml40"),
onClick: function onClick() {
return remove(name);
}
})
})]
}),
children: /*#__PURE__*/(0,jsx_runtime.jsxs)(es_form/* default */.Z.Item, objectSpread2_default()(objectSpread2_default()({}, restField), {}, {
name: name,
children: [((item_list === null || item_list === void 0 || (_item_list$name9 = item_list[name]) === null || _item_list$name9 === void 0 ? void 0 : _item_list$name9.question_type) == 0 || (item_list === null || item_list === void 0 || (_item_list$name10 = item_list[name]) === null || _item_list$name10 === void 0 ? void 0 : _item_list$name10.question_type) == 1) && /*#__PURE__*/(0,jsx_runtime.jsx)(ChoiceQuestionEditor_ChoiceQuestionEditor, {
questionTitlePlaceholder: "\u8BF7\u7F16\u8F91\u9009\u62E9\u9898\u9898\u5E72\u5185\u5BB9",
allowChangeMode: (item_list === null || item_list === void 0 || (_item_list$name11 = item_list[name]) === null || _item_list$name11 === void 0 ? void 0 : _item_list$name11.question_type) == 1 ? true : false,
form: form,
choiceKey: [name, 'choices'],
titleKey: [name, 'name'],
analysisKey: [name, 'analysis'],
choiceOptionsPath: ['sub_item_banks', name, 'choices'],
choiceTextKey: "choice_text",
answerKey: "is_answer"
}), (item_list === null || item_list === void 0 || (_item_list$name12 = item_list[name]) === null || _item_list$name12 === void 0 ? void 0 : _item_list$name12.question_type) == 3 && /*#__PURE__*/(0,jsx_runtime.jsx)(CombinationCompletionQuestionEditor_CompletionQuestionEditor, {
form: form,
questionTitlePlaceholder: "\u8BF7\u7F16\u8F91\u9898\u5E72\u5E76\u8BBE\u7F6E\u586B\u7A7A\u9879",
scoreByBlank: [name, 'use_blank_score'],
titleKey: [name, 'name'],
analysisKey: [name, 'analysis'],
isOrdered: [name, 'is_ordered'],
answerKey: [name, 'standard_answers']
}, shuaxin), (item_list === null || item_list === void 0 || (_item_list$name13 = item_list[name]) === null || _item_list$name13 === void 0 ? void 0 : _item_list$name13.question_type) == 2 && /*#__PURE__*/(0,jsx_runtime.jsx)(CombinationJudgmentQuestionEditor_JudgmentQuestionEditor, {
form: form,
questionTitlePlaceholder: "\u8BF7\u7F16\u8F91\u5224\u65AD\u9898\u9898\u5E72\u5185\u5BB9",
titleKey: [name, 'name'],
analysisKey: [name, 'analysis'],
choiceKey: [name, 'choices']
}), (item_list === null || item_list === void 0 || (_item_list$name14 = item_list[name]) === null || _item_list$name14 === void 0 ? void 0 : _item_list$name14.question_type) == 4 && /*#__PURE__*/(0,jsx_runtime.jsx)(SubjectiveQuestionEditor, {
showKeywords: true,
isMustKeyWords: true,
form: form,
titleKey: [name, 'name'],
analysisKey: [name, 'analysis'],
answerTexts: [name, 'answer_texts'],
useKeywords: [name, 'use_keywords'],
keywords: [name, 'keywords'],
indexs: name,
questionTitlePlaceholder: "\u8BF7\u7F16\u8F91\u7B80\u7B54\u9898\u9898\u5E72\u5185\u5BB9"
}, shuaxin)]
}))
}, name);
})
}), fields.length < 20 && /*#__PURE__*/(0,jsx_runtime.jsx)(dropdown/* default */.Z, {
menu: {
items: [{
label: /*#__PURE__*/(0,jsx_runtime.jsx)("div", {
onClick: function onClick() {
add({
name: '',
choices: Array.from({
length: 4
}, function () {
return {
choice_text: '',
is_answer: 0
};
}),
analysis: '',
question_type: 0,
item_type: 'SINGLE'
});
setActiveKey([fields === null || fields === void 0 ? void 0 : fields.length].concat(toConsumableArray_default()(activeKey)));
},
children: "\u5355\u9009\u9898"
}),
key: '1',
show: true
}, {
label: /*#__PURE__*/(0,jsx_runtime.jsx)("div", {
onClick: function onClick() {
add({
name: '',
choices: Array.from({
length: 4
}, function () {
return {
choice_text: '',
is_answer: 0
};
}),
analysis: '',
question_type: 1,
item_type: 'MULTIPLE'
});
setActiveKey([fields === null || fields === void 0 ? void 0 : fields.length].concat(toConsumableArray_default()(activeKey)));
},
children: "\u591A\u9009\u9898"
}),
key: '2',
show: true
}, {
label: /*#__PURE__*/(0,jsx_runtime.jsx)("div", {
onClick: function onClick() {
add({
name: '',
choices: [{
choice_text: '正确',
is_answer: 0
}, {
choice_text: '错误',
is_answer: 0
}],
analysis: '',
question_type: 2,
item_type: 'JUDGMENT'
});
setActiveKey([fields === null || fields === void 0 ? void 0 : fields.length].concat(toConsumableArray_default()(activeKey)));
},
children: "\u5224\u65AD\u9898"
}),
key: '3',
show: true
}, {
label: /*#__PURE__*/(0,jsx_runtime.jsx)("div", {
onClick: function onClick() {
add({
name: '',
analysis: '',
is_ordered: true,
standard_answers: [],
question_type: 3,
item_type: 'COMPLETION',
use_blank_score: true
});
setActiveKey([fields === null || fields === void 0 ? void 0 : fields.length].concat(toConsumableArray_default()(activeKey)));
},
children: "\u586B\u7A7A\u9898"
}),
key: '4',
show: true
}, {
label: /*#__PURE__*/(0,jsx_runtime.jsx)("div", {
onClick: function onClick() {
add({
name: '',
answer_texts: [],
keywords: [],
use_keywords: false,
analysis: '',
question_type: 4,
item_type: 'SUBJECTIVE'
});
setActiveKey([fields === null || fields === void 0 ? void 0 : fields.length].concat(toConsumableArray_default()(activeKey)));
},
children: "\u7B80\u7B54\u9898"
}),
key: '5',
show: true
}].filter(function (item) {
return item.show;
}).map(function (item) {
return {
label: item.label,
key: item.key
};
})
},
children: /*#__PURE__*/(0,jsx_runtime.jsx)("div", {
className: "".concat(QuestionEditormodules.addBtn),
children: "\u6DFB\u52A0\u5C0F\u9898"
})
})]
});
}
})]
});
};
;// CONCATENATED MODULE: ./src/pages/Paperlibrary/EditPotin/components/Questions/CombinationQuestionEditor.tsx
var CombinationQuestionEditor_DragQuestions = function DragQuestions(_ref) {
var qitem = _ref.qitem,
setisedit = _ref.setisedit,
TagDiscipline = _ref.TagDiscipline,
exerciseitem = _ref.exerciseitem,
seveeditor = _ref.seveeditor,
deleteitem = _ref.deleteitem,
getTagData = _ref.getTagData,
init = _ref.init;
var _Form$useForm = es_form/* default */.Z.useForm(),
_Form$useForm2 = slicedToArray_default()(_Form$useForm, 1),
form = _Form$useForm2[0];
(0,_react_17_0_2_react.useEffect)(function () {
var _qitem$sub_exercise_q;
form.setFieldsValue(objectSpread2_default()(objectSpread2_default()({}, qitem), {}, {
name: qitem.question_title,
sub_item_banks: (_qitem$sub_exercise_q = qitem.sub_exercise_questions) === null || _qitem$sub_exercise_q === void 0 ? void 0 : _qitem$sub_exercise_q.map(function (item) {
var _item$question_choice;
return objectSpread2_default()(objectSpread2_default()({}, item), {}, {
name: item.question_title,
choices: item === null || item === void 0 || (_item$question_choice = item.question_choices) === null || _item$question_choice === void 0 ? void 0 : _item$question_choice.map(function (val) {
return objectSpread2_default()(objectSpread2_default()({}, val), {}, {
is_answer: val !== null && val !== void 0 && val.standard_boolean ? 1 : 0
});
})
});
}),
repeat_answer: !qitem.repeat_answer
}));
}, [qitem]);
return /*#__PURE__*/(0,jsx_runtime.jsx)("div", {
children: /*#__PURE__*/(0,jsx_runtime.jsxs)(es_form/* default */.Z, {
form: form,
colon: false,
onValuesChange: function onValuesChange(values, value) {
if (values !== null && values !== void 0 && values.sub_item_banks) {
var _form$getFieldValue, _form$getFieldValue2;
var items = ((_form$getFieldValue = form.getFieldValue('sub_item_banks')) === null || _form$getFieldValue === void 0 ? void 0 : _form$getFieldValue.length) > 0 && ((_form$getFieldValue2 = form.getFieldValue('sub_item_banks')) === null || _form$getFieldValue2 === void 0 || (_form$getFieldValue2 = _form$getFieldValue2.map(function (item) {
if (item.question_type == 3 && item !== null && item !== void 0 && item.use_blank_score) {
//填空题并且是按空给分
var count = 0;
for (var i in item === null || item === void 0 ? void 0 : item.standard_answers) {
var _item$standard_answer;
count += Number(item === null || item === void 0 || (_item$standard_answer = item.standard_answers[i]) === null || _item$standard_answer === void 0 ? void 0 : _item$standard_answer.score);
}
return count;
} else {
return item.question_score;
}
})) === null || _form$getFieldValue2 === void 0 ? void 0 : _form$getFieldValue2.filter(function (item) {
return item;
}));
if ((items === null || items === void 0 ? void 0 : items.length) > 0) {
form.setFieldsValue({
question_score: parseFloat(items === null || items === void 0 ? void 0 : items.reduce(function (a, b) {
return parseFloat(a) + parseFloat(b);
})).toFixed(1)
});
}
}
},
onFinish: function onFinish(values) {
var _values$sub_item_bank;
seveeditor(objectSpread2_default()(objectSpread2_default()(objectSpread2_default()({}, qitem), values), {}, {
sub_item_banks: values === null || values === void 0 || (_values$sub_item_bank = values.sub_item_banks) === null || _values$sub_item_bank === void 0 ? void 0 : _values$sub_item_bank.map(function (item) {
console.log(item);
return objectSpread2_default()(objectSpread2_default()({}, item), {}, {
item_type: item === null || item === void 0 ? void 0 : item.question_type,
id: (item === null || item === void 0 ? void 0 : item.question_id) || ''
});
})
}));
},
onFinishFailed: /*#__PURE__*/function () {
var _ref2 = asyncToGenerator_default()( /*#__PURE__*/regeneratorRuntime_default()().mark(function _callee(errInfo) {
var _errInfo$errorFields;
return regeneratorRuntime_default()().wrap(function _callee$(_context) {
while (1) switch (_context.prev = _context.next) {
case 0:
message/* default */.ZP.error(errInfo.errorFields[0].errors[0]);
form.scrollToField(errInfo === null || errInfo === void 0 || (_errInfo$errorFields = errInfo.errorFields) === null || _errInfo$errorFields === void 0 || (_errInfo$errorFields = _errInfo$errorFields[0]) === null || _errInfo$errorFields === void 0 ? void 0 : _errInfo$errorFields.name, {
behavior: 'smooth',
block: 'center'
});
case 2:
case "end":
return _context.stop();
}
}, _callee);
}));
return function (_x) {
return _ref2.apply(this, arguments);
};
}(),
children: [/*#__PURE__*/(0,jsx_runtime.jsxs)("div", {
style: {
display: 'flex',
alignItems: 'center',
marginTop: 20
},
children: [/*#__PURE__*/(0,jsx_runtime.jsxs)("div", {
style: {
flex: 1
},
children: [/*#__PURE__*/(0,jsx_runtime.jsx)("span", {
style: {
display: 'inline-flex',
border: '1px solid #9096A3',
borderRadius: '50%',
width: 10,
height: 10,
marginRight: 5,
background: '#9096A3'
}
}), /*#__PURE__*/(0,jsx_runtime.jsx)("span", {
children: '组合题'
})]
}), !qitem.isadd && /*#__PURE__*/(0,jsx_runtime.jsxs)("span", {
style: {
marginLeft: 20,
marginRight: 20,
color: 'red',
cursor: 'pointer'
},
onClick: function onClick() {
deleteitem();
},
children: [/*#__PURE__*/(0,jsx_runtime.jsx)("i", {
className: "iconfont icon-piliangshanchu3",
style: {
fontSize: 14,
marginRight: 6
}
}), "\u5220\u9664"]
}), /*#__PURE__*/(0,jsx_runtime.jsx)(es_button/* default */.ZP, {
onClick: function onClick() {
if (!qitem.isadd) {
var _qitem$question_choic;
form.setFieldsValue(objectSpread2_default()(objectSpread2_default()({}, qitem), {}, {
name: qitem === null || qitem === void 0 ? void 0 : qitem.question_title,
choices: qitem === null || qitem === void 0 || (_qitem$question_choic = qitem.question_choices) === null || _qitem$question_choic === void 0 ? void 0 : _qitem$question_choic.map(function (item) {
return objectSpread2_default()(objectSpread2_default()({}, item), {}, {
standard_boolean: item !== null && item !== void 0 && item.standard_boolean ? 1 : 0
});
}),
repeat_answer: !(qitem !== null && qitem !== void 0 && qitem.repeat_answer)
}));
setisedit(false);
} else {
setisedit(false);
init();
}
},
children: "\u53D6\u6D88"
}), /*#__PURE__*/(0,jsx_runtime.jsx)(es_button/* default */.ZP, {
className: "ml20",
type: "primary",
onClick: function onClick() {
form.submit();
},
children: "\u4FDD\u5B58"
})]
}), /*#__PURE__*/(0,jsx_runtime.jsxs)(row/* default */.Z, {
align: "middle",
children: [/*#__PURE__*/(0,jsx_runtime.jsx)(es_form/* default */.Z.Item, {
className: EditPotinmodules.scoreinput,
name: "question_score",
label: "\u5206\u503C",
rules: [{
required: true,
message: '请输入分值'
}],
children: /*#__PURE__*/(0,jsx_runtime.jsx)(input_number/* default */.Z, {
style: {
width: 150
},
precision: 1,
placeholder: "\u8BF7\u8F93\u5165\u5206\u6570",
disabled: true,
max: 100,
min: 0.1
})
}), /*#__PURE__*/(0,jsx_runtime.jsx)("span", {
className: "c-grey-999 ml5",
children: "\uFF08\u7EC4\u5408\u9898\u5206\u503C\u7B49\u4E8E\u5404\u5C0F\u9898\u5206\u503C\u4E4B\u548C\uFF09"
})]
}), /*#__PURE__*/(0,jsx_runtime.jsx)(CombinationQuestionEditor, {
form: form,
withScore: true,
choiceKey: "",
questionTitlePlaceholder: "\u8BF7\u7F16\u8F91\u7EC4\u5408\u9898\u9898\u5E72\u5185\u5BB9"
}), /*#__PURE__*/(0,jsx_runtime.jsx)(MoreSetting, {
getTagData: getTagData,
qitem: qitem,
exerciseitem: exerciseitem,
TagDiscipline: TagDiscipline,
form: form
})]
})
});
};
/* harmony default export */ var Questions_CombinationQuestionEditor = (CombinationQuestionEditor_DragQuestions);
// EXTERNAL MODULE: ./src/components/QuestionEditor/BProgramEditor.tsx
var BProgramEditor = __webpack_require__(76689);
// EXTERNAL MODULE: ./node_modules/_js-base64@2.6.4@js-base64/base64.js
var base64 = __webpack_require__(24334);
;// CONCATENATED MODULE: ./src/pages/Paperlibrary/EditPotin/components/Questions/BProgramEditor.tsx
var BProgramEditor_DragQuestions = function DragQuestions(_ref) {
var qitem = _ref.qitem,
TagDiscipline = _ref.TagDiscipline,
exerciseitem = _ref.exerciseitem,
setisedit = _ref.setisedit,
seveeditor = _ref.seveeditor,
deleteitem = _ref.deleteitem,
getTagData = _ref.getTagData,
init = _ref.init;
var _Form$useForm = es_form/* default */.Z.useForm(),
_Form$useForm2 = slicedToArray_default()(_Form$useForm, 1),
form = _Form$useForm2[0];
var scoreByBlank = true;
(0,_react_17_0_2_react.useEffect)(function () {
var _qitem$hack, _qitem$program_attr, _qitem$program_attr2, _qitem$hack_sets;
form.setFieldsValue(objectSpread2_default()(objectSpread2_default()({}, qitem), {}, {
standard_answers: qitem.standard_answer,
difficulty: qitem.difficulty,
item_banks_group_id: qitem.item_banks_group_id,
hack: objectSpread2_default()(objectSpread2_default()({}, qitem), {}, {
time_limit: (qitem === null || qitem === void 0 || (_qitem$hack = qitem.hack) === null || _qitem$hack === void 0 ? void 0 : _qitem$hack.time_limit) || 3
}),
hack_codes: {
language: qitem === null || qitem === void 0 || (_qitem$program_attr = qitem.program_attr) === null || _qitem$program_attr === void 0 ? void 0 : _qitem$program_attr.language,
code: base64.Base64.decode((qitem === null || qitem === void 0 || (_qitem$program_attr2 = qitem.program_attr) === null || _qitem$program_attr2 === void 0 ? void 0 : _qitem$program_attr2.code) || '')
},
hack_sets: objectSpread2_default()({}, qitem === null || qitem === void 0 || (_qitem$hack_sets = qitem.hack_sets) === null || _qitem$hack_sets === void 0 ? void 0 : _qitem$hack_sets[0]),
repeat_answer: !qitem.repeat_answer
}));
}, [qitem]);
return /*#__PURE__*/(0,jsx_runtime.jsx)("div", {
children: /*#__PURE__*/(0,jsx_runtime.jsxs)(es_form/* default */.Z, {
form: form,
colon: false,
onValuesChange: function onValuesChange(values, value) {
if (values !== null && values !== void 0 && values.standard_answers) {
var _form$getFieldValue, _form$getFieldValue2;
var items = ((_form$getFieldValue = form.getFieldValue('standard_answers')) === null || _form$getFieldValue === void 0 ? void 0 : _form$getFieldValue.length) > 0 && ((_form$getFieldValue2 = form.getFieldValue('standard_answers')) === null || _form$getFieldValue2 === void 0 || (_form$getFieldValue2 = _form$getFieldValue2.map(function (item) {
return item.score;
})) === null || _form$getFieldValue2 === void 0 ? void 0 : _form$getFieldValue2.filter(function (item) {
return item;
}));
if ((items === null || items === void 0 ? void 0 : items.length) > 0) {
var _items$reduce;
form.setFieldsValue({
question_score: (items === null || items === void 0 ? void 0 : items.length) > 0 && ((_items$reduce = items.reduce(function (a, b) {
return a + b;
})) === null || _items$reduce === void 0 ? void 0 : _items$reduce.toFixed(1))
});
}
}
},
onFinish: function onFinish(values) {
var _values$standard_answ;
seveeditor(objectSpread2_default()(objectSpread2_default()(objectSpread2_default()({}, qitem), values), {}, {
item_type: qitem === null || qitem === void 0 ? void 0 : qitem.question_type,
standard_answers: (_values$standard_answ = values.standard_answers) === null || _values$standard_answ === void 0 ? void 0 : _values$standard_answ.map(function (item, index) {
return objectSpread2_default()(objectSpread2_default()({}, item), {}, {
position: item.choice_id || index + 1
});
}),
standard_answer: undefined //后端希望只传一个,存和取的字段又不统一
}));
},
onFinishFailed: /*#__PURE__*/function () {
var _ref2 = asyncToGenerator_default()( /*#__PURE__*/regeneratorRuntime_default()().mark(function _callee(errInfo) {
var _errInfo$errorFields;
return regeneratorRuntime_default()().wrap(function _callee$(_context) {
while (1) switch (_context.prev = _context.next) {
case 0:
message/* default */.ZP.error(errInfo.errorFields[0].errors[0]);
form.scrollToField(errInfo === null || errInfo === void 0 || (_errInfo$errorFields = errInfo.errorFields) === null || _errInfo$errorFields === void 0 || (_errInfo$errorFields = _errInfo$errorFields[0]) === null || _errInfo$errorFields === void 0 ? void 0 : _errInfo$errorFields.name, {
behavior: 'smooth',
block: 'center'
});
case 2:
case "end":
return _context.stop();
}
}, _callee);
}));
return function (_x) {
return _ref2.apply(this, arguments);
};
}(),
children: [/*#__PURE__*/(0,jsx_runtime.jsxs)("div", {
style: {
display: 'flex',
alignItems: 'center',
marginTop: 20
},
children: [/*#__PURE__*/(0,jsx_runtime.jsxs)("div", {
style: {
flex: 1
},
children: [/*#__PURE__*/(0,jsx_runtime.jsx)("span", {
style: {
display: 'inline-flex',
border: '1px solid #9096A3',
borderRadius: '50%',
width: 10,
height: 10,
marginRight: 5,
background: '#9096A3'
}
}), /*#__PURE__*/(0,jsx_runtime.jsx)("span", {
children: '程序填空题'
})]
}), !qitem.isadd && /*#__PURE__*/(0,jsx_runtime.jsxs)("span", {
style: {
marginLeft: 20,
marginRight: 20,
color: 'red',
cursor: 'pointer'
},
onClick: function onClick() {
deleteitem();
},
children: [/*#__PURE__*/(0,jsx_runtime.jsx)("i", {
className: "iconfont icon-piliangshanchu3",
style: {
fontSize: 14,
marginRight: 6
}
}), " \u5220\u9664"]
}), /*#__PURE__*/(0,jsx_runtime.jsx)(es_button/* default */.ZP, {
onClick: function onClick() {
if (!qitem.isadd) {
var _qitem$program_attr3, _qitem$program_attr4, _qitem$hack_sets2;
form.setFieldsValue(objectSpread2_default()(objectSpread2_default()({}, qitem), {}, {
standard_answers: qitem.standard_answer,
difficulty: qitem.difficult,
item_banks_group_id: qitem.item_banks_group_id,
hack: objectSpread2_default()({}, qitem),
hack_codes: {
language: qitem === null || qitem === void 0 || (_qitem$program_attr3 = qitem.program_attr) === null || _qitem$program_attr3 === void 0 ? void 0 : _qitem$program_attr3.language,
code: base64.Base64.decode(qitem === null || qitem === void 0 || (_qitem$program_attr4 = qitem.program_attr) === null || _qitem$program_attr4 === void 0 ? void 0 : _qitem$program_attr4.code)
},
hack_sets: objectSpread2_default()({}, qitem === null || qitem === void 0 || (_qitem$hack_sets2 = qitem.hack_sets) === null || _qitem$hack_sets2 === void 0 ? void 0 : _qitem$hack_sets2[0]),
repeat_answer: !qitem.repeat_answer
}));
setisedit(false);
} else {
setisedit(false);
init();
}
},
children: "\u53D6\u6D88"
}), /*#__PURE__*/(0,jsx_runtime.jsx)(es_button/* default */.ZP, {
className: "ml20",
type: "primary",
onClick: function onClick() {
form.submit();
},
children: "\u4FDD\u5B58"
})]
}), /*#__PURE__*/(0,jsx_runtime.jsx)(row/* default */.Z, {
align: "middle",
children: /*#__PURE__*/(0,jsx_runtime.jsx)(es_form/* default */.Z.Item, {
className: EditPotinmodules.scoreinput,
name: "question_score",
label: "\u5206\u503C",
rules: [{
required: true,
message: '请输入分值'
}],
children: /*#__PURE__*/(0,jsx_runtime.jsx)(input_number/* default */.Z, {
style: {
width: 150
},
precision: 1,
placeholder: "\u8BF7\u8F93\u5165\u5206\u6570",
size: 'middle',
disabled: true,
max: 100,
min: 0.1
})
})
}), /*#__PURE__*/(0,jsx_runtime.jsx)(BProgramEditor/* BProgramEditor */.t, {
form: form,
questionTitlePlaceholder: "\u8BF7\u7F16\u8F91\u586B\u7A7A\u9898\u9898\u5E72\u5185\u5BB9",
scoreByBlank: scoreByBlank,
hackidentifier: qitem === null || qitem === void 0 ? void 0 : qitem.hack_identifier,
answerKey: "standard_answers"
}), /*#__PURE__*/(0,jsx_runtime.jsx)(MoreSetting, {
getTagData: getTagData,
qitem: qitem,
exerciseitem: exerciseitem,
TagDiscipline: TagDiscipline,
form: form
})]
})
});
};
/* harmony default export */ var Questions_BProgramEditor = (BProgramEditor_DragQuestions);
;// CONCATENATED MODULE: ./src/pages/Paperlibrary/EditPotin/components/Questions/ShixunEditor.tsx
var ShixunEditor_DragQuestions = function DragQuestions(_ref) {
var _qitem$shixun6;
var qitem = _ref.qitem,
setqitem = _ref.setqitem,
setisedit = _ref.setisedit,
TagDiscipline = _ref.TagDiscipline,
exerciseitem = _ref.exerciseitem,
seveeditor = _ref.seveeditor,
deleteitem = _ref.deleteitem;
var _Form$useForm = es_form/* default */.Z.useForm(),
_Form$useForm2 = slicedToArray_default()(_Form$useForm, 1),
form = _Form$useForm2[0];
(0,_react_17_0_2_react.useEffect)(function () {
var _qitem$question_choic, _qitem$shixun;
form.setFieldsValue(objectSpread2_default()(objectSpread2_default()({}, qitem), {}, {
name: qitem === null || qitem === void 0 ? void 0 : qitem.question_title,
choices: qitem === null || qitem === void 0 || (_qitem$question_choic = qitem.question_choices) === null || _qitem$question_choic === void 0 ? void 0 : _qitem$question_choic.map(function (item) {
return objectSpread2_default()(objectSpread2_default()({}, item), {}, {
standard_boolean: item !== null && item !== void 0 && item.standard_boolean ? 1 : 0
});
}),
repeat_answer: !(qitem !== null && qitem !== void 0 && qitem.repeat_answer)
}));
qitem.shixun = qitem === null || qitem === void 0 || (_qitem$shixun = qitem.shixun) === null || _qitem$shixun === void 0 ? void 0 : _qitem$shixun.map(function (item) {
return objectSpread2_default()(objectSpread2_default()({}, item), {}, {
defaultscore: item.challenge_score
});
});
}, []);
return /*#__PURE__*/(0,jsx_runtime.jsxs)("div", {
children: [/*#__PURE__*/(0,jsx_runtime.jsxs)(es_form/* default */.Z, {
form: form,
colon: false,
onFinish: function onFinish(values) {
var _qitem$shixun2, _values$choices;
var datas = objectSpread2_default()(objectSpread2_default()({}, values), {}, {
question_scores: qitem === null || qitem === void 0 || (_qitem$shixun2 = qitem.shixun) === null || _qitem$shixun2 === void 0 ? void 0 : _qitem$shixun2.map(function (item) {
return item.challenge_score;
}),
item_type: qitem === null || qitem === void 0 ? void 0 : qitem.question_type,
choices: values === null || values === void 0 || (_values$choices = values.choices) === null || _values$choices === void 0 ? void 0 : _values$choices.map(function (item) {
return objectSpread2_default()(objectSpread2_default()({}, item), {}, {
is_answer: item.standard_boolean
});
})
});
seveeditor(objectSpread2_default()(objectSpread2_default()({}, qitem), datas));
},
onFinishFailed: /*#__PURE__*/function () {
var _ref2 = asyncToGenerator_default()( /*#__PURE__*/regeneratorRuntime_default()().mark(function _callee(errInfo) {
var _errInfo$errorFields;
return regeneratorRuntime_default()().wrap(function _callee$(_context) {
while (1) switch (_context.prev = _context.next) {
case 0:
message/* default */.ZP.error(errInfo.errorFields[0].errors[0]);
form.scrollToField(errInfo === null || errInfo === void 0 || (_errInfo$errorFields = errInfo.errorFields) === null || _errInfo$errorFields === void 0 || (_errInfo$errorFields = _errInfo$errorFields[0]) === null || _errInfo$errorFields === void 0 ? void 0 : _errInfo$errorFields.name, {
behavior: 'smooth',
block: 'center'
});
case 2:
case "end":
return _context.stop();
}
}, _callee);
}));
return function (_x) {
return _ref2.apply(this, arguments);
};
}(),
children: [/*#__PURE__*/(0,jsx_runtime.jsxs)("div", {
style: {
display: 'flex',
alignItems: 'center',
marginTop: 20
},
children: [/*#__PURE__*/(0,jsx_runtime.jsxs)("div", {
style: {
flex: 1
},
children: [/*#__PURE__*/(0,jsx_runtime.jsx)("span", {
style: {
display: 'inline-flex',
border: '1px solid #9096A3',
borderRadius: '50%',
width: 10,
height: 10,
marginRight: 5,
background: '#9096A3'
}
}), /*#__PURE__*/(0,jsx_runtime.jsx)("span", {
children: "\u5B9E\u8BAD\u9898"
})]
}), /*#__PURE__*/(0,jsx_runtime.jsxs)("span", {
style: {
marginLeft: 20,
marginRight: 20,
color: 'red',
cursor: 'pointer'
},
onClick: function onClick() {
deleteitem();
},
children: [/*#__PURE__*/(0,jsx_runtime.jsx)("i", {
className: "iconfont icon-piliangshanchu3",
style: {
fontSize: 14,
marginRight: 6
}
}), "\u5220\u9664"]
}), /*#__PURE__*/(0,jsx_runtime.jsx)(es_button/* default */.ZP, {
onClick: function onClick() {
var _qitem$question_choic2, _qitem$shixun3;
form.setFieldsValue(objectSpread2_default()(objectSpread2_default()({}, qitem), {}, {
name: qitem === null || qitem === void 0 ? void 0 : qitem.question_title,
choices: qitem === null || qitem === void 0 || (_qitem$question_choic2 = qitem.question_choices) === null || _qitem$question_choic2 === void 0 ? void 0 : _qitem$question_choic2.map(function (item) {
return objectSpread2_default()(objectSpread2_default()({}, item), {}, {
standard_boolean: item !== null && item !== void 0 && item.standard_boolean ? 1 : 0
});
}),
repeat_answer: !(qitem !== null && qitem !== void 0 && qitem.repeat_answer)
}));
qitem.shixun = qitem === null || qitem === void 0 || (_qitem$shixun3 = qitem.shixun) === null || _qitem$shixun3 === void 0 ? void 0 : _qitem$shixun3.map(function (item) {
return objectSpread2_default()(objectSpread2_default()({}, item), {}, {
challenge_score: item.defaultscore
});
});
setqitem(objectSpread2_default()({}, qitem));
setisedit(false);
},
children: "\u53D6\u6D88"
}), /*#__PURE__*/(0,jsx_runtime.jsx)(es_button/* default */.ZP, {
className: "ml20",
type: "primary",
onClick: /*#__PURE__*/asyncToGenerator_default()( /*#__PURE__*/regeneratorRuntime_default()().mark(function _callee2() {
var _qitem$shixun4, _qitem$shixun4$map, _qitem$shixun5;
return regeneratorRuntime_default()().wrap(function _callee2$(_context2) {
while (1) switch (_context2.prev = _context2.next) {
case 0:
if (!((qitem === null || qitem === void 0 || (_qitem$shixun4 = qitem.shixun) === null || _qitem$shixun4 === void 0 || (_qitem$shixun4$map = _qitem$shixun4.map) === null || _qitem$shixun4$map === void 0 ? void 0 : _qitem$shixun4$map.call(_qitem$shixun4, function (item) {
return item.challenge_score;
}).filter(function (item) {
return item;
}).length) < (qitem === null || qitem === void 0 || (_qitem$shixun5 = qitem.shixun) === null || _qitem$shixun5 === void 0 ? void 0 : _qitem$shixun5.length))) {
_context2.next = 3;
break;
}
message/* default */.ZP.info('分数不能为空');
return _context2.abrupt("return");
case 3:
form.submit();
case 4:
case "end":
return _context2.stop();
}
}, _callee2);
})),
children: "\u4FDD\u5B58"
})]
}), /*#__PURE__*/(0,jsx_runtime.jsxs)(row/* default */.Z, {
align: "middle",
children: [/*#__PURE__*/(0,jsx_runtime.jsx)(es_form/* default */.Z.Item, {
className: EditPotinmodules.scoreinput,
name: "question_score",
label: "\u5206\u503C",
rules: [{
required: true,
message: '请输入分值'
}],
children: /*#__PURE__*/(0,jsx_runtime.jsx)(input_number/* default */.Z, {
style: {
width: 150
},
precision: 1,
placeholder: "\u8BF7\u8F93\u5165\u5206\u6570",
disabled: true,
max: 100,
min: 0.1
})
}), /*#__PURE__*/(0,jsx_runtime.jsx)("span", {
className: "c-grey-999 ml5",
children: "\uFF08\u5B9E\u8BAD\u9898\u5206\u503C\u7B49\u4E8E\u5404\u5173\u5361\u5206\u503C\u4E4B\u548C\uFF09"
})]
}), /*#__PURE__*/(0,jsx_runtime.jsx)(es_form/* default */.Z.Item, {
label: "\u9898\u5E72",
name: 'question_title',
labelCol: {
span: 24
},
rules: [{
required: true
}],
children: /*#__PURE__*/(0,jsx_runtime.jsx)(markdown_editor/* default */.Z, {
watch: true,
height: 140,
placeholder: '',
defaultValue: qitem.question_title
})
})]
}), /*#__PURE__*/(0,jsx_runtime.jsx)("div", {
children: /*#__PURE__*/(0,jsx_runtime.jsxs)("p", {
children: [/*#__PURE__*/(0,jsx_runtime.jsx)("span", {
style: {
color: 'red'
},
children: "*"
}), "\u5173\u5361\u540D\u79F0"]
})
}), qitem === null || qitem === void 0 || (_qitem$shixun6 = qitem.shixun) === null || _qitem$shixun6 === void 0 ? void 0 : _qitem$shixun6.map(function (item, index) {
return /*#__PURE__*/(0,jsx_runtime.jsxs)("div", {
style: {
display: 'flex',
marginBottom: 20
},
children: [/*#__PURE__*/(0,jsx_runtime.jsxs)("div", {
style: {
flex: 1
},
children: [index + 1, "\u3001", item.challenge_name]
}), /*#__PURE__*/(0,jsx_runtime.jsxs)("div", {
children: [/*#__PURE__*/(0,jsx_runtime.jsx)("span", {
style: {
color: 'red'
},
children: "*"
}), "\u5206\u503C", /*#__PURE__*/(0,jsx_runtime.jsx)(input_number/* default */.Z, {
precision: 1,
value: item === null || item === void 0 ? void 0 : item.challenge_score,
onChange: function onChange(e) {
var items = JSON.parse(JSON.stringify((qitem === null || qitem === void 0 ? void 0 : qitem.shixun) || []));
items[index].challenge_score = e;
var isEmpty = items.every(function (e) {
return !e.challenge_score;
});
var score = parseFloat(items === null || items === void 0 ? void 0 : items.map(function (item) {
return item.challenge_score;
}).reduce(function (a, b) {
return parseFloat(a || 0) + parseFloat(b || 0);
}));
form.setFieldsValue({
question_score: isEmpty ? '' : score.toFixed(1)
});
setqitem(objectSpread2_default()(objectSpread2_default()({}, qitem), {}, {
shixun: items
}));
},
max: 100,
min: 1,
style: {
marginLeft: 10,
width: 150
},
placeholder: "\u8BF7\u8F93\u5165\u5206\u6570",
size: 'middle'
})]
})]
}, item.challenge_id);
})]
});
};
/* harmony default export */ var ShixunEditor = (ShixunEditor_DragQuestions);
;// CONCATENATED MODULE: ./src/pages/Paperlibrary/EditPotin/components/Saveitem.less?modules
// extracted by mini-css-extract-plugin
/* harmony default export */ var Saveitemmodules = ({"flex_box_center":"flex_box_center___ljmk3","flex_space_between":"flex_space_between___Fy45C","flex_box_vertical_center":"flex_box_vertical_center___SoC1C","flex_box_center_end":"flex_box_center_end___MumBX","flex_box_column":"flex_box_column___cutpt","warp":"warp___w1JUC","indexTag":"indexTag___LPncW","normalWrap":"normalWrap___pEIzs","redio":"redio___I6tXM","redioitem":"redioitem___cS4Gp","redioitemyes":"redioitemyes___JBDmk","title":"title___XAohQ","titleyes":"titleyes____bNQk","yestag":"yestag___zQnb1","checkbox":"checkbox___MHadU","checkboxitem":"checkboxitem___KX7mB","checkboxitemyes":"checkboxitemyes___MpOWf","bottom":"bottom___FkHfO","bottomitem":"bottomitem___AS0Qp","left":"left___U23z1","right":"right___yJVEk","completion":"completion___Bu5G6","content":"content___LySPW","items":"items___ETMq9","simple":"simple___XX5t0","shixunWrapper":"shixunWrapper___w6oIG","shixun":"shixun___ePWKn","score":"score___nGh9k","qtitle":"qtitle___DAMW1","program":"program___Mm1qL","combination":"combination___Sw7S6","qtype":"qtype___Xdl60"});
;// CONCATENATED MODULE: ./src/pages/Paperlibrary/EditPotin/components/SaveItem.tsx
//数组对应值
var tagDotData = ['A.', 'B.', 'C.', 'D.', 'E.', 'F.', 'G.', 'H.', 'I.', 'J.', 'K.', 'L.', 'M.', 'N.', 'O.', 'P.', 'Q.', 'R.', 'S.', 'T.', 'U.', 'V.', 'W.', 'X.', 'Y.', 'Z.'];
var questionType = [{
type: 0,
name: '单选题'
}, {
type: 1,
name: '多选题'
}, {
type: 2,
name: '判断题'
}, {
type: 3,
name: '填空题'
}, {
type: 4,
name: '简答题'
}, {
type: 5,
name: '实训题'
}, {
type: 6,
name: '编程题'
}, {
type: 7,
name: '组合题'
}, {
type: 8,
name: '程序填空题'
}];
var SaveItem_DragQuestions = function DragQuestions(_ref) {
var _qitem$question_choic, _qitem$question_choic2, _qitem$standard_answe, _qitem$answer_texts, _qitem$shixun, _qitem$sub_exercise_q, _qitem$program_attr, _qitem$tag_discipline, _qitem$tag_discipline2;
var qitem = _ref.qitem;
return /*#__PURE__*/(0,jsx_runtime.jsxs)("div", {
className: Saveitemmodules.warp,
children: [((qitem === null || qitem === void 0 ? void 0 : qitem.question_type) === 0 || (qitem === null || qitem === void 0 ? void 0 : qitem.question_type) === 2) && /*#__PURE__*/(0,jsx_runtime.jsx)("div", {
className: Saveitemmodules.normalWrap,
children: qitem === null || qitem === void 0 || (_qitem$question_choic = qitem.question_choices) === null || _qitem$question_choic === void 0 ? void 0 : _qitem$question_choic.map(function (item, index) {
return /*#__PURE__*/(0,jsx_runtime.jsxs)("div", {
className: Saveitemmodules.redio,
children: [!(item !== null && item !== void 0 && item.standard_boolean) && /*#__PURE__*/(0,jsx_runtime.jsx)("span", {
className: Saveitemmodules.redioitem
}), (item === null || item === void 0 ? void 0 : item.standard_boolean) && /*#__PURE__*/(0,jsx_runtime.jsx)("i", {
className: "".concat(Saveitemmodules.redioitemyes, " icon-duigou1")
}), /*#__PURE__*/(0,jsx_runtime.jsx)("span", {
className: "".concat(item !== null && item !== void 0 && item.standard_boolean ? Saveitemmodules.titleyes : Saveitemmodules.title, " ").concat(Saveitemmodules.indexTag),
children: (qitem === null || qitem === void 0 ? void 0 : qitem.question_type) === 0 ? tagDotData[index] : ''
}), /*#__PURE__*/(0,jsx_runtime.jsx)(RenderHtml/* default */.Z, {
className: item !== null && item !== void 0 && item.standard_boolean ? Saveitemmodules.titleyes : Saveitemmodules.title,
value: item === null || item === void 0 ? void 0 : item.choice_text
}), (item === null || item === void 0 ? void 0 : item.standard_boolean) && /*#__PURE__*/(0,jsx_runtime.jsx)("div", {
className: Saveitemmodules.yestag,
children: "\u6B63\u786E\u7B54\u6848"
})]
}, index);
})
}), (qitem === null || qitem === void 0 ? void 0 : qitem.question_type) === 1 && /*#__PURE__*/(0,jsx_runtime.jsx)("div", {
className: Saveitemmodules.normalWrap,
children: qitem === null || qitem === void 0 || (_qitem$question_choic2 = qitem.question_choices) === null || _qitem$question_choic2 === void 0 ? void 0 : _qitem$question_choic2.map(function (item, index) {
return /*#__PURE__*/(0,jsx_runtime.jsxs)("div", {
className: Saveitemmodules.checkbox,
children: [!(item !== null && item !== void 0 && item.standard_boolean) && /*#__PURE__*/(0,jsx_runtime.jsx)("span", {
className: Saveitemmodules.checkboxitem
}), (item === null || item === void 0 ? void 0 : item.standard_boolean) && /*#__PURE__*/(0,jsx_runtime.jsx)("i", {
className: "".concat(Saveitemmodules.checkboxitemyes, " icon-duigou1")
}), /*#__PURE__*/(0,jsx_runtime.jsx)("span", {
className: "".concat(item !== null && item !== void 0 && item.standard_boolean ? Saveitemmodules.titleyes : Saveitemmodules.title, " ").concat(Saveitemmodules.indexTag),
children: tagDotData[index]
}), /*#__PURE__*/(0,jsx_runtime.jsx)(RenderHtml/* default */.Z, {
className: item !== null && item !== void 0 && item.standard_boolean ? Saveitemmodules.titleyes : Saveitemmodules.title,
value: item === null || item === void 0 ? void 0 : item.choice_text
}), (item === null || item === void 0 ? void 0 : item.standard_boolean) && /*#__PURE__*/(0,jsx_runtime.jsx)("div", {
className: Saveitemmodules.yestag,
children: "\u6B63\u786E\u7B54\u6848"
})]
}, index);
})
}), (qitem === null || qitem === void 0 ? void 0 : qitem.question_type) === 3 && /*#__PURE__*/(0,jsx_runtime.jsx)("div", {
className: Saveitemmodules.completion,
children: qitem === null || qitem === void 0 || (_qitem$standard_answe = qitem.standard_answers) === null || _qitem$standard_answe === void 0 ? void 0 : _qitem$standard_answe.map(function (item, index) {
var _item$answer_text;
return /*#__PURE__*/(0,jsx_runtime.jsxs)("div", {
style: {
display: 'flex'
},
children: [/*#__PURE__*/(0,jsx_runtime.jsxs)("span", {
className: Saveitemmodules.title,
children: ["\u586B\u7A7A\u9879", index + 1]
}), /*#__PURE__*/(0,jsx_runtime.jsx)(row/* default */.Z, {
gutter: [30, 20],
className: "".concat(Saveitemmodules.content, " mb20"),
children: (_item$answer_text = item.answer_text) === null || _item$answer_text === void 0 ? void 0 : _item$answer_text.map(function (val, vindex) {
return /*#__PURE__*/(0,jsx_runtime.jsx)(col/* default */.Z, {
children: /*#__PURE__*/(0,jsx_runtime.jsx)("div", {
className: Saveitemmodules.items,
children: val
})
}, vindex);
})
})]
}, index);
})
}), (qitem === null || qitem === void 0 ? void 0 : qitem.question_type) === 4 && /*#__PURE__*/(0,jsx_runtime.jsxs)("div", {
className: Saveitemmodules.simple,
children: [/*#__PURE__*/(0,jsx_runtime.jsx)("span", {
className: Saveitemmodules.title,
children: "\u53C2\u8003\u7B54\u6848"
}), /*#__PURE__*/(0,jsx_runtime.jsx)(RenderHtml/* default */.Z, {
className: Saveitemmodules.content,
value: (qitem === null || qitem === void 0 || (_qitem$answer_texts = qitem.answer_texts) === null || _qitem$answer_texts === void 0 ? void 0 : _qitem$answer_texts[0]) || ''
})]
}), (qitem === null || qitem === void 0 ? void 0 : qitem.question_type) === 5 && /*#__PURE__*/(0,jsx_runtime.jsx)("div", {
className: Saveitemmodules.shixunWrapper,
children: qitem === null || qitem === void 0 || (_qitem$shixun = qitem.shixun) === null || _qitem$shixun === void 0 ? void 0 : _qitem$shixun.map(function (val, vindex) {
return /*#__PURE__*/(0,jsx_runtime.jsxs)("div", {
className: "".concat(Saveitemmodules.shixun, " mb30"),
children: [/*#__PURE__*/(0,jsx_runtime.jsxs)("span", {
className: Saveitemmodules.score,
children: ["\uFF08", val === null || val === void 0 ? void 0 : val.challenge_score, "\u5206\uFF09"]
}), /*#__PURE__*/(0,jsx_runtime.jsxs)("span", {
className: Saveitemmodules.qtitle,
children: [(qitem === null || qitem === void 0 ? void 0 : qitem.index) + "." + (vindex + 1), "\u3001", val === null || val === void 0 ? void 0 : val.challenge_name]
})]
}, vindex);
})
}), (qitem === null || qitem === void 0 ? void 0 : qitem.question_type) === 6 && /*#__PURE__*/(0,jsx_runtime.jsx)("div", {
className: Saveitemmodules.program,
children: /*#__PURE__*/(0,jsx_runtime.jsx)(RenderHtml/* default */.Z, {
className: Saveitemmodules.content,
value: (qitem === null || qitem === void 0 ? void 0 : qitem.description) || '- -'
})
}), (qitem === null || qitem === void 0 ? void 0 : qitem.question_type) === 7 && (qitem === null || qitem === void 0 || (_qitem$sub_exercise_q = qitem.sub_exercise_questions) === null || _qitem$sub_exercise_q === void 0 ? void 0 : _qitem$sub_exercise_q.map(function (val, vndex) {
var _questionType$find, _val$question_choices, _val$question_choices2, _val$standard_answers, _val$answer_texts;
return /*#__PURE__*/(0,jsx_runtime.jsxs)("div", {
children: [/*#__PURE__*/(0,jsx_runtime.jsxs)("div", {
className: Saveitemmodules.combination,
children: [/*#__PURE__*/(0,jsx_runtime.jsxs)("span", {
className: Saveitemmodules.score,
children: [val === null || val === void 0 ? void 0 : val.question_score, "\u5206"]
}), /*#__PURE__*/(0,jsx_runtime.jsx)("span", {
className: Saveitemmodules.qtype,
children: (_questionType$find = questionType.find(function (i) {
return i.type == val.question_type;
})) === null || _questionType$find === void 0 ? void 0 : _questionType$find.name
}), /*#__PURE__*/(0,jsx_runtime.jsxs)("span", {
className: Saveitemmodules.qtitle,
children: [vndex + 1, "\u3001", val === null || val === void 0 ? void 0 : val.question_title]
})]
}), (val.question_type === 0 || val.question_type === 2) && /*#__PURE__*/(0,jsx_runtime.jsx)("div", {
className: Saveitemmodules.warp,
style: {
padding: '20px 58px 0 58px'
},
children: /*#__PURE__*/(0,jsx_runtime.jsx)("div", {
children: val === null || val === void 0 || (_val$question_choices = val.question_choices) === null || _val$question_choices === void 0 ? void 0 : _val$question_choices.map(function (item, index) {
return /*#__PURE__*/(0,jsx_runtime.jsxs)("div", {
className: Saveitemmodules.redio,
children: [!(item !== null && item !== void 0 && item.standard_boolean) && /*#__PURE__*/(0,jsx_runtime.jsx)("span", {
className: Saveitemmodules.redioitem
}), (item === null || item === void 0 ? void 0 : item.standard_boolean) && /*#__PURE__*/(0,jsx_runtime.jsx)("i", {
className: "".concat(Saveitemmodules.redioitemyes, " icon-duigou1")
}), val.question_type === 2 && /*#__PURE__*/(0,jsx_runtime.jsx)("span", {
className: "".concat(item !== null && item !== void 0 && item.standard_boolean ? Saveitemmodules.titleyes : Saveitemmodules.title, " ").concat(Saveitemmodules.indexTag),
children: tagDotData[index]
}), /*#__PURE__*/(0,jsx_runtime.jsx)(RenderHtml/* default */.Z, {
className: item !== null && item !== void 0 && item.standard_boolean ? Saveitemmodules.titleyes : Saveitemmodules.title,
value: item === null || item === void 0 ? void 0 : item.choice_text
}), (item === null || item === void 0 ? void 0 : item.standard_boolean) && /*#__PURE__*/(0,jsx_runtime.jsx)("div", {
className: Saveitemmodules.yestag,
children: "\u6B63\u786E\u7B54\u6848"
})]
}, index);
})
})
}), val.question_type === 1 && /*#__PURE__*/(0,jsx_runtime.jsx)("div", {
className: Saveitemmodules.normalWrap,
children: val === null || val === void 0 || (_val$question_choices2 = val.question_choices) === null || _val$question_choices2 === void 0 ? void 0 : _val$question_choices2.map(function (item, index) {
return /*#__PURE__*/(0,jsx_runtime.jsxs)("div", {
className: Saveitemmodules.checkbox,
children: [!(item !== null && item !== void 0 && item.standard_boolean) && /*#__PURE__*/(0,jsx_runtime.jsx)("span", {
className: Saveitemmodules.checkboxitem
}), (item === null || item === void 0 ? void 0 : item.standard_boolean) && /*#__PURE__*/(0,jsx_runtime.jsx)("i", {
className: "".concat(Saveitemmodules.checkboxitemyes, " icon-duigou1")
}), /*#__PURE__*/(0,jsx_runtime.jsx)("span", {
className: "".concat(item !== null && item !== void 0 && item.standard_boolean ? Saveitemmodules.titleyes : Saveitemmodules.title, " ").concat(Saveitemmodules.indexTag),
children: tagDotData[index]
}), /*#__PURE__*/(0,jsx_runtime.jsx)(RenderHtml/* default */.Z, {
className: item !== null && item !== void 0 && item.standard_boolean ? Saveitemmodules.titleyes : Saveitemmodules.title,
value: item === null || item === void 0 ? void 0 : item.choice_text
}), (item === null || item === void 0 ? void 0 : item.standard_boolean) && /*#__PURE__*/(0,jsx_runtime.jsx)("div", {
className: Saveitemmodules.yestag,
children: "\u6B63\u786E\u7B54\u6848"
})]
}, index);
})
}), val.question_type === 3 && /*#__PURE__*/(0,jsx_runtime.jsx)("div", {
className: Saveitemmodules.completion,
children: val === null || val === void 0 || (_val$standard_answers = val.standard_answers) === null || _val$standard_answers === void 0 ? void 0 : _val$standard_answers.map(function (item, index) {
var _val$standard_answers2, _item$answer_text2;
return /*#__PURE__*/(0,jsx_runtime.jsxs)("div", {
style: {
display: 'flex'
},
children: [/*#__PURE__*/(0,jsx_runtime.jsxs)("span", {
className: Saveitemmodules.title,
children: ["\u586B\u7A7A\u9879", index + 1]
}), /*#__PURE__*/(0,jsx_runtime.jsx)(row/* default */.Z, {
gutter: [30, 20],
className: "".concat(Saveitemmodules.content, " ").concat(index != (val === null || val === void 0 || (_val$standard_answers2 = val.standard_answers) === null || _val$standard_answers2 === void 0 ? void 0 : _val$standard_answers2.length) - 1 && 'mb20'),
children: (_item$answer_text2 = item.answer_text) === null || _item$answer_text2 === void 0 ? void 0 : _item$answer_text2.map(function (i, ikey) {
return /*#__PURE__*/(0,jsx_runtime.jsx)(col/* default */.Z, {
children: /*#__PURE__*/(0,jsx_runtime.jsx)("div", {
className: Saveitemmodules.items,
children: i
})
}, ikey);
})
})]
}, index);
})
}), val.question_type === 4 && /*#__PURE__*/(0,jsx_runtime.jsxs)("div", {
className: Saveitemmodules.simple,
children: [/*#__PURE__*/(0,jsx_runtime.jsx)("span", {
className: Saveitemmodules.title,
children: "\u53C2\u8003\u7B54\u6848"
}), /*#__PURE__*/(0,jsx_runtime.jsx)(RenderHtml/* default */.Z, {
className: Saveitemmodules.content,
value: (val === null || val === void 0 || (_val$answer_texts = val.answer_texts) === null || _val$answer_texts === void 0 ? void 0 : _val$answer_texts[0]) || ''
})]
})]
}, vndex);
})), (qitem === null || qitem === void 0 ? void 0 : qitem.question_type) === 8 && /*#__PURE__*/(0,jsx_runtime.jsx)("div", {
children: /*#__PURE__*/(0,jsx_runtime.jsx)(RenderHtml/* default */.Z, {
disabledFill: true,
className: Saveitemmodules.content,
showProgramFill: true,
value: base64.Base64.decode((qitem === null || qitem === void 0 || (_qitem$program_attr = qitem.program_attr) === null || _qitem$program_attr === void 0 ? void 0 : _qitem$program_attr.code) || '')
})
}), ((qitem === null || qitem === void 0 ? void 0 : qitem.question_type) <= 4 || [6, 8].includes(qitem === null || qitem === void 0 ? void 0 : qitem.question_type)) && /*#__PURE__*/(0,jsx_runtime.jsxs)("div", {
className: Saveitemmodules.bottom,
children: [/*#__PURE__*/(0,jsx_runtime.jsxs)("div", {
className: "".concat(Saveitemmodules.bottomitem, " mb30"),
children: [/*#__PURE__*/(0,jsx_runtime.jsx)("span", {
className: Saveitemmodules.left,
children: "\u89E3\u6790"
}), /*#__PURE__*/(0,jsx_runtime.jsx)(RenderHtml/* default */.Z, {
className: Saveitemmodules.right,
value: (qitem === null || qitem === void 0 ? void 0 : qitem.analysis) || ''
})]
}), /*#__PURE__*/(0,jsx_runtime.jsxs)("div", {
className: "".concat(Saveitemmodules.bottomitem, " mb30"),
children: [/*#__PURE__*/(0,jsx_runtime.jsx)("span", {
className: Saveitemmodules.left,
children: "\u96BE\u5EA6"
}), /*#__PURE__*/(0,jsx_runtime.jsx)("span", {
className: Saveitemmodules.right,
children: (qitem === null || qitem === void 0 ? void 0 : qitem.difficulty) === 1 ? '简单' : (qitem === null || qitem === void 0 ? void 0 : qitem.difficulty) === 2 ? '适中' : '困难'
})]
}), /*#__PURE__*/(0,jsx_runtime.jsxs)("div", {
className: Saveitemmodules.bottomitem,
children: [/*#__PURE__*/(0,jsx_runtime.jsx)("span", {
className: Saveitemmodules.left,
children: "\u77E5\u8BC6\u70B9"
}), /*#__PURE__*/(0,jsx_runtime.jsx)("span", {
className: Saveitemmodules.right,
children: (qitem === null || qitem === void 0 || (_qitem$tag_discipline = qitem.tag_discipline_names) === null || _qitem$tag_discipline === void 0 ? void 0 : _qitem$tag_discipline.length) <= 0 ? '- -' : qitem === null || qitem === void 0 || (_qitem$tag_discipline2 = qitem.tag_discipline_names) === null || _qitem$tag_discipline2 === void 0 ? void 0 : _qitem$tag_discipline2.toString()
})]
})]
})]
});
};
/* harmony default export */ var SaveItem = (SaveItem_DragQuestions);
// EXTERNAL MODULE: ./src/pages/Classrooms/Lists/Exercise/Edit/components/UploadQuestions/index.tsx + 1 modules
var UploadQuestions = __webpack_require__(58954);
// EXTERNAL MODULE: ./src/components/QuestionEditor/SubjectiveQuestionEditor.tsx
var QuestionEditor_SubjectiveQuestionEditor = __webpack_require__(31988);
;// CONCATENATED MODULE: ./src/pages/Paperlibrary/EditPotin/components/Questions/SubjectiveQuestionEditor.tsx
var SubjectiveQuestionEditor_DragQuestions = function DragQuestions(_ref) {
var qitem = _ref.qitem,
setisedit = _ref.setisedit,
TagDiscipline = _ref.TagDiscipline,
exerciseitem = _ref.exerciseitem,
seveeditor = _ref.seveeditor,
deleteitem = _ref.deleteitem,
getTagData = _ref.getTagData,
init = _ref.init;
var _Form$useForm = es_form/* default */.Z.useForm(),
_Form$useForm2 = slicedToArray_default()(_Form$useForm, 1),
form = _Form$useForm2[0];
(0,_react_17_0_2_react.useEffect)(function () {
form.setFieldsValue(objectSpread2_default()(objectSpread2_default()({}, qitem), {}, {
name: qitem.question_title,
answer_texts: qitem.answer_texts,
repeat_answer: !qitem.repeat_answer
}));
}, [qitem]);
return /*#__PURE__*/(0,jsx_runtime.jsx)("div", {
children: /*#__PURE__*/(0,jsx_runtime.jsxs)(es_form/* default */.Z, {
form: form,
colon: false,
onFinish: function onFinish(values) {
seveeditor(objectSpread2_default()(objectSpread2_default()({}, qitem), values));
},
onFinishFailed: /*#__PURE__*/function () {
var _ref2 = asyncToGenerator_default()( /*#__PURE__*/regeneratorRuntime_default()().mark(function _callee(errInfo) {
var _errInfo$errorFields;
return regeneratorRuntime_default()().wrap(function _callee$(_context) {
while (1) switch (_context.prev = _context.next) {
case 0:
message/* default */.ZP.error(errInfo.errorFields[0].errors[0]);
form.scrollToField(errInfo === null || errInfo === void 0 || (_errInfo$errorFields = errInfo.errorFields) === null || _errInfo$errorFields === void 0 || (_errInfo$errorFields = _errInfo$errorFields[0]) === null || _errInfo$errorFields === void 0 ? void 0 : _errInfo$errorFields.name, {
behavior: 'smooth',
block: 'center'
});
case 2:
case "end":
return _context.stop();
}
}, _callee);
}));
return function (_x) {
return _ref2.apply(this, arguments);
};
}(),
children: [/*#__PURE__*/(0,jsx_runtime.jsxs)("div", {
style: {
display: 'flex',
alignItems: 'center',
marginTop: 20
},
children: [/*#__PURE__*/(0,jsx_runtime.jsxs)("div", {
style: {
flex: 1
},
children: [/*#__PURE__*/(0,jsx_runtime.jsx)("span", {
style: {
display: 'inline-flex',
border: '1px solid #9096A3',
borderRadius: '50%',
width: 10,
height: 10,
marginRight: 5,
background: '#9096A3'
}
}), /*#__PURE__*/(0,jsx_runtime.jsx)("span", {
children: '简答题'
})]
}), !(qitem !== null && qitem !== void 0 && qitem.isadd) && /*#__PURE__*/(0,jsx_runtime.jsxs)("span", {
style: {
marginLeft: 20,
marginRight: 20,
color: 'red',
cursor: 'pointer'
},
onClick: function onClick() {
deleteitem();
},
children: [/*#__PURE__*/(0,jsx_runtime.jsx)("i", {
className: "iconfont icon-piliangshanchu3",
style: {
fontSize: 14,
marginRight: 6
}
}), "\u5220\u9664"]
}), /*#__PURE__*/(0,jsx_runtime.jsx)(es_button/* default */.ZP, {
onClick: function onClick() {
if (!qitem.isadd) {
form.setFieldsValue(objectSpread2_default()(objectSpread2_default()({}, qitem), {}, {
name: qitem === null || qitem === void 0 ? void 0 : qitem.question_title,
answer_texts: qitem.answer_texts || [],
repeat_answer: !(qitem !== null && qitem !== void 0 && qitem.repeat_answer)
}));
setisedit(false);
} else {
setisedit(false);
init();
}
},
children: "\u53D6\u6D88"
}), /*#__PURE__*/(0,jsx_runtime.jsx)(es_button/* default */.ZP, {
type: "primary",
className: "ml20",
onClick: function onClick() {
form.submit();
},
children: "\u4FDD\u5B58"
})]
}), /*#__PURE__*/(0,jsx_runtime.jsx)(es_form/* default */.Z.Item, {
className: EditPotinmodules.scoreinput,
name: "question_score",
label: "\u5206\u503C",
rules: [{
required: true,
message: '请输入分值'
}],
children: /*#__PURE__*/(0,jsx_runtime.jsx)(input_number/* default */.Z, {
style: {
width: 150
},
precision: 1,
placeholder: "\u8BF7\u8F93\u5165\u5206\u6570",
max: 100,
min: 0.1
})
}), /*#__PURE__*/(0,jsx_runtime.jsx)(QuestionEditor_SubjectiveQuestionEditor/* SubjectiveQuestionEditor */.W, {
form: form,
showKeywords: true,
questionTitlePlaceholder: "\u8BF7\u7F16\u8F91\u7B80\u7B54\u9898\u9898\u5E72\u5185\u5BB9"
}), /*#__PURE__*/(0,jsx_runtime.jsx)(MoreSetting, {
getTagData: getTagData,
qitem: qitem,
exerciseitem: exerciseitem,
TagDiscipline: TagDiscipline,
form: form
})]
})
});
};
/* harmony default export */ var Questions_SubjectiveQuestionEditor = (SubjectiveQuestionEditor_DragQuestions);
;// CONCATENATED MODULE: ./src/pages/Paperlibrary/EditPotin/components/Setscore.tsx
var SetScore = function SetScore(_ref) {
var _exerciseitem$exercis, _exerciseitem$exercis2;
var setScoreShow = _ref.setScoreShow,
ScoreShow = _ref.ScoreShow,
exerciseitem = _ref.exerciseitem,
getdata = _ref.getdata;
var _useState = (0,_react_17_0_2_react.useState)(false),
_useState2 = slicedToArray_default()(_useState, 2),
isshow = _useState2[0],
setisshow = _useState2[1];
function setscore() {
return _setscore.apply(this, arguments);
}
function _setscore() {
_setscore = asyncToGenerator_default()( /*#__PURE__*/regeneratorRuntime_default()().mark(function _callee() {
var _exerciseitem$exercis4, _exerciseitem$exercis5;
var question_arr, res;
return regeneratorRuntime_default()().wrap(function _callee$(_context) {
while (1) switch (_context.prev = _context.next) {
case 0:
question_arr = exerciseitem === null || exerciseitem === void 0 || (_exerciseitem$exercis4 = exerciseitem.exercise_question_types) === null || _exerciseitem$exercis4 === void 0 || (_exerciseitem$exercis4 = _exerciseitem$exercis4.filter(function (item) {
return item.Singlequestion;
})) === null || _exerciseitem$exercis4 === void 0 ? void 0 : _exerciseitem$exercis4.map(function (item) {
return {
question_type: item.question_type,
score: item.Singlequestion
};
});
_context.next = 3;
return (0,fetch/* default */.ZP)("/api/examination_banks/".concat(exerciseitem === null || exerciseitem === void 0 || (_exerciseitem$exercis5 = exerciseitem.exercise) === null || _exerciseitem$exercis5 === void 0 ? void 0 : _exerciseitem$exercis5.id, "/batch_set_score.json"), {
method: 'POST',
body: {
question_arr: question_arr
}
});
case 3:
res = _context.sent;
if ((res === null || res === void 0 ? void 0 : res.status) === 0) {
getdata();
}
case 5:
case "end":
return _context.stop();
}
}, _callee);
}));
return _setscore.apply(this, arguments);
}
return /*#__PURE__*/(0,jsx_runtime.jsxs)("div", {
children: [ScoreShow && /*#__PURE__*/(0,jsx_runtime.jsxs)(modal/* default */.Z, {
title: false,
footer: false,
open: ScoreShow,
width: 640,
centered: true,
zIndex: 10,
closable: false,
className: EditPotinmodules.scoremodal,
onCancel: function onCancel() {
setScoreShow(false);
},
children: [/*#__PURE__*/(0,jsx_runtime.jsxs)("div", {
style: {
display: 'flex',
alignItems: 'center'
},
children: [/*#__PURE__*/(0,jsx_runtime.jsxs)("div", {
className: EditPotinmodules.title,
children: ["\u6279\u91CF\u8BBE\u7F6E\u5206\u503C", /*#__PURE__*/(0,jsx_runtime.jsxs)("div", {
className: EditPotinmodules.score,
children: ["\u603B\u5206 ", (exerciseitem === null || exerciseitem === void 0 ? void 0 : exerciseitem.exercise_question_types.length) > 0 && (exerciseitem === null || exerciseitem === void 0 || (_exerciseitem$exercis = exerciseitem.exercise_types) === null || _exerciseitem$exercis === void 0 ? void 0 : _exerciseitem$exercis.q_scores)]
})]
}), /*#__PURE__*/(0,jsx_runtime.jsx)("span", {
onClick: function onClick() {
return setScoreShow(false);
},
className: EditPotinmodules.close,
children: "X"
})]
}), /*#__PURE__*/(0,jsx_runtime.jsxs)("div", {
className: EditPotinmodules.content,
children: [/*#__PURE__*/(0,jsx_runtime.jsx)("span", {
children: "\u9898\u578B\u540D\u79F0"
}), /*#__PURE__*/(0,jsx_runtime.jsx)("span", {
children: "\u5C0F\u9898\u603B\u6570"
}), /*#__PURE__*/(0,jsx_runtime.jsx)("span", {
children: "\u9898\u578B\u603B\u5206"
}), /*#__PURE__*/(0,jsx_runtime.jsx)("span", {
children: "\u64CD\u4F5C"
})]
}), exerciseitem === null || exerciseitem === void 0 || (_exerciseitem$exercis2 = exerciseitem.exercise_question_types) === null || _exerciseitem$exercis2 === void 0 || (_exerciseitem$exercis2 = _exerciseitem$exercis2.filter(function (item) {
return item.name !== '实训题' && item.name !== '组合题';
})) === null || _exerciseitem$exercis2 === void 0 ? void 0 : _exerciseitem$exercis2.map(function (item, k) {
var _item$items;
return /*#__PURE__*/(0,jsx_runtime.jsxs)("div", {
className: EditPotinmodules.items,
children: [/*#__PURE__*/(0,jsx_runtime.jsx)("span", {
children: item === null || item === void 0 ? void 0 : item.name
}), /*#__PURE__*/(0,jsx_runtime.jsx)("span", {
children: item === null || item === void 0 || (_item$items = item.items) === null || _item$items === void 0 ? void 0 : _item$items.length
}), /*#__PURE__*/(0,jsx_runtime.jsx)("span", {
children: item === null || item === void 0 ? void 0 : item.score
}), /*#__PURE__*/(0,jsx_runtime.jsxs)("span", {
children: ["\u6BCF\u9898", /*#__PURE__*/(0,jsx_runtime.jsx)(input_number/* default */.Z, {
min: 0.1,
max: 100,
onChange: function onChange(e) {
item.Singlequestion = e;
},
defaultValue: item.Singlequestion,
style: {
width: 90,
height: 38,
margin: '0px 10px',
display: 'flex',
alignItems: 'center'
}
}), "\u5206"]
})]
}, k);
}), /*#__PURE__*/(0,jsx_runtime.jsxs)("div", {
className: EditPotinmodules.bottom,
children: [/*#__PURE__*/(0,jsx_runtime.jsx)(es_button/* default */.ZP, {
className: EditPotinmodules.no,
onClick: function onClick() {
setScoreShow(false);
},
children: "\u53D6\u6D88"
}), /*#__PURE__*/(0,jsx_runtime.jsx)(es_button/* default */.ZP, {
className: EditPotinmodules.yes,
onClick: function onClick() {
var _exerciseitem$exercis3;
if (exerciseitem !== null && exerciseitem !== void 0 && exerciseitem.use_blank_score && exerciseitem !== null && exerciseitem !== void 0 && (_exerciseitem$exercis3 = exerciseitem.exercise_question_types) !== null && _exerciseitem$exercis3 !== void 0 && (_exerciseitem$exercis3 = _exerciseitem$exercis3.filter(function (item) {
return item.name === '填空题';
})) !== null && _exerciseitem$exercis3 !== void 0 && (_exerciseitem$exercis3 = _exerciseitem$exercis3[0]) !== null && _exerciseitem$exercis3 !== void 0 && _exerciseitem$exercis3.Singlequestion) {
setisshow(true);
return;
}
setscore();
setScoreShow(false);
},
children: "\u786E\u8BA4"
})]
})]
}), /*#__PURE__*/(0,jsx_runtime.jsxs)(modal/* default */.Z, {
title: false,
footer: false,
centered: true,
open: isshow,
zIndex: 20,
width: 640,
closable: false,
className: EditPotinmodules.scoremodal,
children: [/*#__PURE__*/(0,jsx_runtime.jsxs)("div", {
style: {
marginTop: 40
},
children: ["\u586B\u7A7A\u9898\u4E2D\u5B58\u5728", /*#__PURE__*/(0,jsx_runtime.jsx)("span", {
style: {
color: '#FA6400'
},
children: "\u6309\u7A7A\u7ED9\u5206"
}), "\u7684\u5C0F\u9898\uFF0C\u82E5\u6279\u91CF\u8BBE\u7F6E\u5206\u503C\u4F1A\u7EDF\u4E00\u5C06\u586B\u7A7A\u9898\u6539\u4E3A\u6309\u9898\u7ED9\u5206"]
}), /*#__PURE__*/(0,jsx_runtime.jsxs)("div", {
className: EditPotinmodules.bottom,
children: [/*#__PURE__*/(0,jsx_runtime.jsx)(es_button/* default */.ZP, {
className: EditPotinmodules.no,
onClick: function onClick() {
setisshow(false);
},
children: "\u53D6\u6D88"
}), /*#__PURE__*/(0,jsx_runtime.jsx)(es_button/* default */.ZP, {
className: EditPotinmodules.yes,
onClick: function onClick() {
setscore();
setisshow(false);
setScoreShow(false);
},
children: "\u786E\u8BA4"
})]
})]
})]
});
};
/* harmony default export */ var Setscore = (SetScore);
// EXTERNAL MODULE: ./node_modules/_antd@5.9.0@antd/es/tabs/index.js + 24 modules
var tabs = __webpack_require__(99313);
// EXTERNAL MODULE: ./node_modules/_antd@5.9.0@antd/es/table/index.js + 85 modules
var table = __webpack_require__(72315);
// EXTERNAL MODULE: ./node_modules/_antd@5.9.0@antd/es/pagination/index.js + 10 modules
var pagination = __webpack_require__(41867);
;// CONCATENATED MODULE: ./src/pages/Paperlibrary/EditPotin/components/AddQuestionsModal/index.less?modules
// extracted by mini-css-extract-plugin
/* harmony default export */ var AddQuestionsModalmodules = ({"flex_box_center":"flex_box_center___kuaVT","flex_space_between":"flex_space_between___exKHH","flex_box_vertical_center":"flex_box_vertical_center___BzvkN","flex_box_center_end":"flex_box_center_end___Ss2DJ","flex_box_column":"flex_box_column___p1LEr","scoremodal":"scoremodal___upTFR","selectWrapper":"selectWrapper___HH3RX","allqingchu":"allqingchu___BFF1D","title":"title___hFasb","score":"score___DXG3o","close":"close___kEIiB","content":"content___Mco8L","items":"items___j98jk","bottom":"bottom___A1n1C","yes":"yes___P1zzb","no":"no___xZqXd","titlecount":"titlecount___fqA9P","add":"add___MqV0R","search":"search___NREgv","searchIcon":"searchIcon___qny3A","tabWrap":"tabWrap___dR18c","previewModal":"previewModal___uSiGS"});
;// CONCATENATED MODULE: ./src/pages/Paperlibrary/EditPotin/components/AddQuestionsModal/Saveitem.less?modules
// extracted by mini-css-extract-plugin
/* harmony default export */ var AddQuestionsModal_Saveitemmodules = ({"flex_box_center":"flex_box_center___nnwwA","flex_space_between":"flex_space_between___cRir9","flex_box_vertical_center":"flex_box_vertical_center___FqTZ8","flex_box_center_end":"flex_box_center_end___WU5_v","flex_box_column":"flex_box_column___QZFa1","warp":"warp___aLZwN","mainPart":"mainPart___OdEo7","shixunbutton":"shixunbutton___Eoa1i","redio":"redio___LJ4js","redioitem":"redioitem___YicCC","redioitemyes":"redioitemyes___lX4Nr","title":"title___pi1jH","titleyes":"titleyes___jiEh7","yestag":"yestag___DLWoP","qcount":"qcount___U9kkL","score":"score___vLK4B","qtitle":"qtitle___kyg0t","checkbox":"checkbox___vjiBw","checkboxitem":"checkboxitem___HW3CP","checkboxitemyes":"checkboxitemyes___kpjek","bottom":"bottom___uG8Zq","bottomitem":"bottomitem___TnJQQ","left":"left___M8WXX","right":"right____dkCI","completion":"completion___H6RmA","content":"content___a2hGC","items":"items___D8mLd","simple":"simple___fQ0OS","shixun":"shixun___nB6Jk","combination":"combination___YrOdz","program":"program___lG0JA"});
;// CONCATENATED MODULE: ./src/pages/Paperlibrary/EditPotin/components/AddQuestionsModal/SaveItem.tsx
//数组对应值
var SaveItem_tagDotData = ['A.', 'B.', 'C.', 'D.', 'E.', 'F.', 'G.', 'H.', 'I.', 'J.', 'K.', 'L.', 'M.', 'N.', 'O.', 'P.', 'Q.', 'R.', 'S.', 'T.', 'U.', 'V.', 'W.', 'X.', 'Y.', 'Z.'];
var AddQuestionsModal_SaveItem_DragQuestions = function DragQuestions(_ref) {
var _qitem$program_attr, _qitem$choices, _qitem$choices2, _qitem$standard_answe, _qitem$answer_texts, _qitem$challenge_name, _qitem$program_attr2, _qitem$sub_item_banks, _qitem$program_attr3;
var qitem = _ref.qitem;
return /*#__PURE__*/(0,jsx_runtime.jsxs)("div", {
className: AddQuestionsModal_Saveitemmodules.warp,
children: [/*#__PURE__*/(0,jsx_runtime.jsxs)("div", {
className: AddQuestionsModal_Saveitemmodules.mainPart,
children: [/*#__PURE__*/(0,jsx_runtime.jsxs)("div", {
className: AddQuestionsModal_Saveitemmodules.qcount,
children: [(qitem === null || qitem === void 0 ? void 0 : qitem.question_type) === 8 && /*#__PURE__*/(0,jsx_runtime.jsx)(RenderHtml/* default */.Z, {
className: AddQuestionsModal_Saveitemmodules.content,
showProgramFill: true,
value: qitem === null || qitem === void 0 || (_qitem$program_attr = qitem.program_attr) === null || _qitem$program_attr === void 0 ? void 0 : _qitem$program_attr.description
}), (qitem === null || qitem === void 0 ? void 0 : qitem.question_type) != 8 && /*#__PURE__*/(0,jsx_runtime.jsx)(RenderHtml/* default */.Z, {
className: AddQuestionsModal_Saveitemmodules.qtitle,
value: (qitem === null || qitem === void 0 ? void 0 : qitem.name) || (qitem === null || qitem === void 0 ? void 0 : qitem.title)
})]
}), ((qitem === null || qitem === void 0 ? void 0 : qitem.question_type) === 0 || (qitem === null || qitem === void 0 ? void 0 : qitem.question_type) === 2) && /*#__PURE__*/(0,jsx_runtime.jsx)("div", {
children: qitem === null || qitem === void 0 || (_qitem$choices = qitem.choices) === null || _qitem$choices === void 0 ? void 0 : _qitem$choices.map(function (item, index) {
return /*#__PURE__*/(0,jsx_runtime.jsxs)("div", {
className: AddQuestionsModal_Saveitemmodules.redio,
children: [!(item !== null && item !== void 0 && item.is_answer) && /*#__PURE__*/(0,jsx_runtime.jsx)("span", {
className: AddQuestionsModal_Saveitemmodules.redioitem
}), (item === null || item === void 0 ? void 0 : item.is_answer) && /*#__PURE__*/(0,jsx_runtime.jsx)("i", {
className: "".concat(AddQuestionsModal_Saveitemmodules.redioitemyes, " icon-duigou1")
}), /*#__PURE__*/(0,jsx_runtime.jsx)(RenderHtml/* default */.Z, {
className: item !== null && item !== void 0 && item.is_answer ? AddQuestionsModal_Saveitemmodules.titleyes : AddQuestionsModal_Saveitemmodules.title,
value: SaveItem_tagDotData[index] + (item === null || item === void 0 ? void 0 : item.choice_text)
}), (item === null || item === void 0 ? void 0 : item.is_answer) && /*#__PURE__*/(0,jsx_runtime.jsx)("div", {
className: AddQuestionsModal_Saveitemmodules.yestag,
children: "\u6B63\u786E\u7B54\u6848"
})]
});
})
}), (qitem === null || qitem === void 0 ? void 0 : qitem.question_type) === 1 && /*#__PURE__*/(0,jsx_runtime.jsx)("div", {
children: qitem === null || qitem === void 0 || (_qitem$choices2 = qitem.choices) === null || _qitem$choices2 === void 0 ? void 0 : _qitem$choices2.map(function (item, index) {
return /*#__PURE__*/(0,jsx_runtime.jsxs)("div", {
className: AddQuestionsModal_Saveitemmodules.checkbox,
children: [!(item !== null && item !== void 0 && item.is_answer) && /*#__PURE__*/(0,jsx_runtime.jsx)("span", {
className: AddQuestionsModal_Saveitemmodules.checkboxitem
}), (item === null || item === void 0 ? void 0 : item.is_answer) && /*#__PURE__*/(0,jsx_runtime.jsx)("i", {
className: "".concat(AddQuestionsModal_Saveitemmodules.checkboxitemyes, " icon-duigou1")
}), /*#__PURE__*/(0,jsx_runtime.jsx)(RenderHtml/* default */.Z, {
className: item !== null && item !== void 0 && item.is_answer ? AddQuestionsModal_Saveitemmodules.titleyes : AddQuestionsModal_Saveitemmodules.title,
value: SaveItem_tagDotData[index] + (item === null || item === void 0 ? void 0 : item.choice_text)
}), (item === null || item === void 0 ? void 0 : item.is_answer) && /*#__PURE__*/(0,jsx_runtime.jsx)("div", {
className: AddQuestionsModal_Saveitemmodules.yestag,
children: "\u6B63\u786E\u7B54\u6848"
})]
});
})
}), (qitem === null || qitem === void 0 ? void 0 : qitem.question_type) === 3 && /*#__PURE__*/(0,jsx_runtime.jsx)("div", {
className: AddQuestionsModal_Saveitemmodules.completion,
children: qitem === null || qitem === void 0 || (_qitem$standard_answe = qitem.standard_answer) === null || _qitem$standard_answe === void 0 ? void 0 : _qitem$standard_answe.map(function (item, index) {
var _item$answer_text;
return /*#__PURE__*/(0,jsx_runtime.jsxs)("div", {
style: {
display: 'flex'
},
children: [/*#__PURE__*/(0,jsx_runtime.jsxs)("span", {
className: AddQuestionsModal_Saveitemmodules.title,
children: ["\u586B\u7A7A\u9879", index + 1]
}), /*#__PURE__*/(0,jsx_runtime.jsx)("div", {
className: AddQuestionsModal_Saveitemmodules.content,
children: item === null || item === void 0 || (_item$answer_text = item.answer_text) === null || _item$answer_text === void 0 ? void 0 : _item$answer_text.map(function (val, vindex) {
return /*#__PURE__*/(0,jsx_runtime.jsx)("div", {
className: AddQuestionsModal_Saveitemmodules.items,
children: val
});
})
})]
});
})
}), (qitem === null || qitem === void 0 ? void 0 : qitem.question_type) === 4 && /*#__PURE__*/(0,jsx_runtime.jsxs)("div", {
className: AddQuestionsModal_Saveitemmodules.simple,
children: [/*#__PURE__*/(0,jsx_runtime.jsx)("span", {
className: AddQuestionsModal_Saveitemmodules.title,
children: "\u53C2\u8003\u7B54\u6848"
}), /*#__PURE__*/(0,jsx_runtime.jsx)(RenderHtml/* default */.Z, {
className: AddQuestionsModal_Saveitemmodules.content,
value: (qitem === null || qitem === void 0 || (_qitem$answer_texts = qitem.answer_texts) === null || _qitem$answer_texts === void 0 ? void 0 : _qitem$answer_texts[0]) || '- -'
})]
}), (qitem === null || qitem === void 0 ? void 0 : qitem.question_type) === 5 && (qitem === null || qitem === void 0 || (_qitem$challenge_name = qitem.challenge_names) === null || _qitem$challenge_name === void 0 ? void 0 : _qitem$challenge_name.map(function (val, vindex) {
return /*#__PURE__*/(0,jsx_runtime.jsx)("div", {
className: AddQuestionsModal_Saveitemmodules.shixun,
children: /*#__PURE__*/(0,jsx_runtime.jsxs)("span", {
className: AddQuestionsModal_Saveitemmodules.qtitle,
children: [/*#__PURE__*/(0,jsx_runtime.jsxs)("span", {
style: {
marginRight: 10
},
children: ["\u7B2C", (0,utils_util/* toChineseNumber */.EM)(vindex + 1), "\u9898"]
}), val]
})
});
})), (qitem === null || qitem === void 0 ? void 0 : qitem.question_type) === 6 && /*#__PURE__*/(0,jsx_runtime.jsx)("div", {
className: AddQuestionsModal_Saveitemmodules.program,
children: /*#__PURE__*/(0,jsx_runtime.jsx)(RenderHtml/* default */.Z, {
className: AddQuestionsModal_Saveitemmodules.content,
value: (qitem === null || qitem === void 0 || (_qitem$program_attr2 = qitem.program_attr) === null || _qitem$program_attr2 === void 0 ? void 0 : _qitem$program_attr2.description) || '- -'
})
}), (qitem === null || qitem === void 0 ? void 0 : qitem.question_type) === 7 && (qitem === null || qitem === void 0 || (_qitem$sub_item_banks = qitem.sub_item_banks) === null || _qitem$sub_item_banks === void 0 ? void 0 : _qitem$sub_item_banks.map(function (val, vndex) {
var _val$choices, _val$choices2, _val$standard_answer, _val$answer_texts;
return /*#__PURE__*/(0,jsx_runtime.jsxs)("div", {
children: [/*#__PURE__*/(0,jsx_runtime.jsx)("div", {
className: AddQuestionsModal_Saveitemmodules.combination,
children: /*#__PURE__*/(0,jsx_runtime.jsx)("span", {
className: AddQuestionsModal_Saveitemmodules.qtitle,
children: val === null || val === void 0 ? void 0 : val.name
})
}), /*#__PURE__*/(0,jsx_runtime.jsx)("div", {
className: AddQuestionsModal_Saveitemmodules.warp,
style: {
padding: '0px',
paddingTop: 20
},
children: /*#__PURE__*/(0,jsx_runtime.jsxs)("div", {
children: [((val === null || val === void 0 ? void 0 : val.item_type) == 'SINGLE' || (val === null || val === void 0 ? void 0 : val.item_type) == 'JUDGMENT') && (val === null || val === void 0 || (_val$choices = val.choices) === null || _val$choices === void 0 ? void 0 : _val$choices.map(function (item, index) {
return /*#__PURE__*/(0,jsx_runtime.jsxs)("div", {
className: AddQuestionsModal_Saveitemmodules.redio,
children: [!(item !== null && item !== void 0 && item.is_answer) && /*#__PURE__*/(0,jsx_runtime.jsx)("span", {
className: AddQuestionsModal_Saveitemmodules.redioitem
}), (item === null || item === void 0 ? void 0 : item.is_answer) && /*#__PURE__*/(0,jsx_runtime.jsx)("i", {
className: "".concat(AddQuestionsModal_Saveitemmodules.redioitemyes, " icon-duigou1")
}), /*#__PURE__*/(0,jsx_runtime.jsx)(RenderHtml/* default */.Z, {
className: item !== null && item !== void 0 && item.is_answer ? AddQuestionsModal_Saveitemmodules.titleyes : AddQuestionsModal_Saveitemmodules.title,
value: SaveItem_tagDotData[index] + (item === null || item === void 0 ? void 0 : item.choice_text)
}), (item === null || item === void 0 ? void 0 : item.is_answer) && /*#__PURE__*/(0,jsx_runtime.jsx)("div", {
className: AddQuestionsModal_Saveitemmodules.yestag,
children: "\u6B63\u786E\u7B54\u6848"
})]
});
})), (val === null || val === void 0 ? void 0 : val.item_type) == 'MULTIPLE' && (val === null || val === void 0 || (_val$choices2 = val.choices) === null || _val$choices2 === void 0 ? void 0 : _val$choices2.map(function (item, index) {
return /*#__PURE__*/(0,jsx_runtime.jsxs)("div", {
className: AddQuestionsModal_Saveitemmodules.checkbox,
children: [!(item !== null && item !== void 0 && item.is_answer) && /*#__PURE__*/(0,jsx_runtime.jsx)("span", {
className: AddQuestionsModal_Saveitemmodules.checkboxitem
}), (item === null || item === void 0 ? void 0 : item.is_answer) && /*#__PURE__*/(0,jsx_runtime.jsx)("i", {
className: "".concat(AddQuestionsModal_Saveitemmodules.checkboxitemyes, " icon-duigou1")
}), /*#__PURE__*/(0,jsx_runtime.jsx)(RenderHtml/* default */.Z, {
className: item !== null && item !== void 0 && item.is_answer ? AddQuestionsModal_Saveitemmodules.titleyes : AddQuestionsModal_Saveitemmodules.title,
value: SaveItem_tagDotData[index] + (item === null || item === void 0 ? void 0 : item.choice_text)
}), (item === null || item === void 0 ? void 0 : item.is_answer) && /*#__PURE__*/(0,jsx_runtime.jsx)("div", {
className: AddQuestionsModal_Saveitemmodules.yestag,
children: "\u6B63\u786E\u7B54\u6848"
})]
});
})), (val === null || val === void 0 ? void 0 : val.item_type) == 'COMPLETION' && /*#__PURE__*/(0,jsx_runtime.jsx)("div", {
className: AddQuestionsModal_Saveitemmodules.completion,
children: val === null || val === void 0 || (_val$standard_answer = val.standard_answer) === null || _val$standard_answer === void 0 ? void 0 : _val$standard_answer.map(function (item, index) {
var _item$answer_text2;
return /*#__PURE__*/(0,jsx_runtime.jsxs)("div", {
style: {
display: 'flex'
},
children: [/*#__PURE__*/(0,jsx_runtime.jsxs)("span", {
className: AddQuestionsModal_Saveitemmodules.title,
children: ["\u586B\u7A7A\u9879", index + 1]
}), /*#__PURE__*/(0,jsx_runtime.jsx)("div", {
className: AddQuestionsModal_Saveitemmodules.content,
children: item === null || item === void 0 || (_item$answer_text2 = item.answer_text) === null || _item$answer_text2 === void 0 ? void 0 : _item$answer_text2.map(function (val, vindex) {
return /*#__PURE__*/(0,jsx_runtime.jsx)("div", {
className: AddQuestionsModal_Saveitemmodules.items,
children: val
});
})
})]
});
})
}), (val === null || val === void 0 ? void 0 : val.item_type) == 'SUBJECTIVE' && /*#__PURE__*/(0,jsx_runtime.jsxs)("div", {
className: AddQuestionsModal_Saveitemmodules.simple,
children: [/*#__PURE__*/(0,jsx_runtime.jsx)("span", {
className: AddQuestionsModal_Saveitemmodules.title,
children: "\u53C2\u8003\u7B54\u6848"
}), /*#__PURE__*/(0,jsx_runtime.jsx)(RenderHtml/* default */.Z, {
className: AddQuestionsModal_Saveitemmodules.content,
value: (val === null || val === void 0 || (_val$answer_texts = val.answer_texts) === null || _val$answer_texts === void 0 ? void 0 : _val$answer_texts[0]) || '- -'
})]
})]
})
})]
});
})), (qitem === null || qitem === void 0 ? void 0 : qitem.question_type) === 8 && /*#__PURE__*/(0,jsx_runtime.jsx)("div", {
children: /*#__PURE__*/(0,jsx_runtime.jsx)(RenderHtml/* default */.Z, {
disabledFill: true,
className: AddQuestionsModal_Saveitemmodules.content,
showProgramFill: true,
value: base64.Base64.decode((qitem === null || qitem === void 0 || (_qitem$program_attr3 = qitem.program_attr) === null || _qitem$program_attr3 === void 0 ? void 0 : _qitem$program_attr3.code) || '')
})
}), (qitem === null || qitem === void 0 ? void 0 : qitem.question_type) === 5 && /*#__PURE__*/(0,jsx_runtime.jsxs)("div", {
style: {
background: '#F6F7F9',
padding: '0px 20px',
height: 46,
lineHeight: '46px',
marginTop: 40,
display: 'flex',
alignItems: 'center'
},
children: [/*#__PURE__*/(0,jsx_runtime.jsxs)("div", {
style: {
flex: 1,
alignItems: 'center',
display: 'flex'
},
children: [/*#__PURE__*/(0,jsx_runtime.jsxs)("div", {
style: {
marginRight: 30
},
children: [/*#__PURE__*/(0,jsx_runtime.jsx)("span", {
style: {
marginRight: 10
},
children: "\u521B\u5EFA\u8005"
}), /*#__PURE__*/(0,jsx_runtime.jsx)("span", {
style: {
color: '#000000'
},
children: (qitem === null || qitem === void 0 ? void 0 : qitem.author_name) || '- -'
})]
}), /*#__PURE__*/(0,jsx_runtime.jsxs)("div", {
style: {
marginRight: 30
},
children: [/*#__PURE__*/(0,jsx_runtime.jsx)("span", {
style: {
marginRight: 10
},
children: "\u6240\u5C5E\u5355\u4F4D"
}), /*#__PURE__*/(0,jsx_runtime.jsx)("span", {
style: {
color: '#000000'
},
children: (qitem === null || qitem === void 0 ? void 0 : qitem.author_school_name) || '- -'
})]
}), /*#__PURE__*/(0,jsx_runtime.jsxs)("div", {
style: {
marginRight: 30
},
children: [/*#__PURE__*/(0,jsx_runtime.jsx)("span", {
style: {
marginRight: 10
},
children: "\u5B66\u4E60\u4EBA\u6570"
}), /*#__PURE__*/(0,jsx_runtime.jsx)("span", {
style: {
color: '#000000'
},
children: (qitem === null || qitem === void 0 ? void 0 : qitem.study_count) || '0'
})]
})]
}), /*#__PURE__*/(0,jsx_runtime.jsxs)("a", {
className: AddQuestionsModal_Saveitemmodules.shixunbutton,
href: "/shixuns/".concat(qitem === null || qitem === void 0 ? void 0 : qitem.identifier, "/challenges?exercise=true"),
target: "_blank",
children: [/*#__PURE__*/(0,jsx_runtime.jsx)("i", {
onClick: function onClick() {},
style: {
marginRight: 20
},
className: "iconfont icon-shixunkecheng mr5 "
}), "\u5B9E\u8BAD\u8BE6\u60C5"]
})]
})]
}), ((qitem === null || qitem === void 0 ? void 0 : qitem.question_type) <= 4 || [6, 8].includes(qitem === null || qitem === void 0 ? void 0 : qitem.question_type)) && /*#__PURE__*/(0,jsx_runtime.jsxs)("div", {
className: AddQuestionsModal_Saveitemmodules.bottom,
children: [/*#__PURE__*/(0,jsx_runtime.jsxs)("div", {
className: AddQuestionsModal_Saveitemmodules.bottomitem,
children: [/*#__PURE__*/(0,jsx_runtime.jsx)("span", {
className: AddQuestionsModal_Saveitemmodules.left,
children: "\u89E3\u6790"
}), /*#__PURE__*/(0,jsx_runtime.jsx)(RenderHtml/* default */.Z, {
className: AddQuestionsModal_Saveitemmodules.right,
value: (qitem === null || qitem === void 0 ? void 0 : qitem.analysis) || ''
})]
}), /*#__PURE__*/(0,jsx_runtime.jsxs)("div", {
className: AddQuestionsModal_Saveitemmodules.bottomitem,
children: [/*#__PURE__*/(0,jsx_runtime.jsx)("span", {
className: AddQuestionsModal_Saveitemmodules.left,
children: "\u96BE\u5EA6"
}), /*#__PURE__*/(0,jsx_runtime.jsx)("span", {
className: AddQuestionsModal_Saveitemmodules.right,
children: (qitem === null || qitem === void 0 ? void 0 : qitem.difficulty) === 1 ? '简单' : (qitem === null || qitem === void 0 ? void 0 : qitem.difficulty) === 2 ? '适中' : '困难'
})]
}), /*#__PURE__*/(0,jsx_runtime.jsxs)("div", {
className: AddQuestionsModal_Saveitemmodules.bottomitem,
children: [/*#__PURE__*/(0,jsx_runtime.jsx)("span", {
className: AddQuestionsModal_Saveitemmodules.left,
children: "\u77E5\u8BC6\u70B9"
}), /*#__PURE__*/(0,jsx_runtime.jsx)("span", {
className: AddQuestionsModal_Saveitemmodules.right,
children: qitem === null || qitem === void 0 ? void 0 : qitem.tag_discipline
})]
})]
})]
});
};
/* harmony default export */ var AddQuestionsModal_SaveItem = (AddQuestionsModal_SaveItem_DragQuestions);
// EXTERNAL MODULE: ./src/assets/images/paper/shengxu.svg
var shengxu = __webpack_require__(39525);
// EXTERNAL MODULE: ./src/assets/images/paper/jiangxu.svg
var jiangxu = __webpack_require__(3442);
;// CONCATENATED MODULE: ./src/pages/Paperlibrary/EditPotin/components/AddQuestionsModal/index.tsx
var AddQuestionsModal_AddModal = function AddModal(_ref) {
var _datas$tag_discipline, _grouplist$share_bank, _grouplist$my_banks_g;
var setScoreShow = _ref.setScoreShow,
ScoreShow = _ref.ScoreShow,
onOk = _ref.onOk,
isshixuns = _ref.isshixuns,
isloadings = _ref.isloadings;
var _useState = (0,_react_17_0_2_react.useState)({
type: '0',
page: 1,
per_page: 10,
updated_at: '',
quotes: ''
}),
_useState2 = slicedToArray_default()(_useState, 2),
param = _useState2[0],
setparam = _useState2[1];
var _useState3 = (0,_react_17_0_2_react.useState)([]),
_useState4 = slicedToArray_default()(_useState3, 2),
courseOptions = _useState4[0],
setcourseOptions = _useState4[1];
var _useState5 = (0,_react_17_0_2_react.useState)([]),
_useState6 = slicedToArray_default()(_useState5, 2),
checkitems = _useState6[0],
setcheckitems = _useState6[1];
var _useState7 = (0,_react_17_0_2_react.useState)([]),
_useState8 = slicedToArray_default()(_useState7, 2),
listitems = _useState8[0],
setlistitems = _useState8[1];
var _useState9 = (0,_react_17_0_2_react.useState)([]),
_useState10 = slicedToArray_default()(_useState9, 2),
datas = _useState10[0],
setdatas = _useState10[1];
var _useState11 = (0,_react_17_0_2_react.useState)(false),
_useState12 = slicedToArray_default()(_useState11, 2),
loading = _useState12[0],
setloading = _useState12[1];
var _Form$useForm = es_form/* default */.Z.useForm(),
_Form$useForm2 = slicedToArray_default()(_Form$useForm, 1),
form = _Form$useForm2[0];
var _useState13 = (0,_react_17_0_2_react.useState)(),
_useState14 = slicedToArray_default()(_useState13, 2),
qitem = _useState14[0],
setqitem = _useState14[1];
var _useState15 = (0,_react_17_0_2_react.useState)(false),
_useState16 = slicedToArray_default()(_useState15, 2),
isshow = _useState16[0],
setisshow = _useState16[1];
var _useState17 = (0,_react_17_0_2_react.useState)(isshixuns),
_useState18 = slicedToArray_default()(_useState17, 2),
isshixun = _useState18[0],
setisshixun = _useState18[1];
var _useState19 = (0,_react_17_0_2_react.useState)([]),
_useState20 = slicedToArray_default()(_useState19, 2),
ShiXunListItems = _useState20[0],
setshixunitems = _useState20[1];
var _useState21 = (0,_react_17_0_2_react.useState)(0),
_useState22 = slicedToArray_default()(_useState21, 2),
addcount = _useState22[0],
setaddcount = _useState22[1];
var _useState23 = (0,_react_17_0_2_react.useState)(true),
_useState24 = slicedToArray_default()(_useState23, 2),
indexi = _useState24[0],
setindexi = _useState24[1];
var _useState25 = (0,_react_17_0_2_react.useState)([]),
_useState26 = slicedToArray_default()(_useState25, 2),
grouplist = _useState26[0],
setgrouplist = _useState26[1];
var typeData = [{
name: "全部",
value: "",
question_type: 0
}, {
name: "编程题",
value: "PROGRAM",
question_type: 6
}, {
name: "单选题",
value: "SINGLE",
question_type: 0
}, {
name: "多选题",
value: "MULTIPLE",
question_type: 1
}, {
name: "判断题",
value: "JUDGMENT",
question_type: 2
}, {
name: "填空题",
value: "COMPLETION",
question_type: 3
}, {
name: "简答题",
value: "SUBJECTIVE",
question_type: 4
}, {
name: "实训题",
value: "SHIXUN",
question_type: 5
}, {
name: "组合题",
value: "COMBINATION",
question_type: 7
}, {
name: "程序填空题",
value: "BPROGRAM",
question_type: 8
}];
var _useState27 = (0,_react_17_0_2_react.useState)([]),
_useState28 = slicedToArray_default()(_useState27, 2),
checkedItemsArr = _useState28[0],
setCheckedItemsArr = _useState28[1];
var selectedShixunId = (0,_react_17_0_2_react.useRef)(new Set());
var selectedQuestionId = (0,_react_17_0_2_react.useRef)(new Set());
var difficultyData = [{
name: "简单",
value: 1
}, {
name: "适中",
value: 2
}, {
name: "困难",
value: 3
}];
var diff = [{
name: '初级',
value: 1
}, {
name: '中级',
value: 2
}, {
name: '中高级',
value: 3
}, {
name: '高级',
value: 4
}];
var _useState29 = (0,_react_17_0_2_react.useState)(false),
_useState30 = slicedToArray_default()(_useState29, 2),
showClearButton = _useState30[0],
setShowClearButton = _useState30[1]; // 新增的变量用于控制是否显示清除筛选条件按钮
var handleClearButtonClick = function handleClearButtonClick() {
form.resetFields();
setShowClearButton(false); // 更新显示清空按钮的状态
form.submit();
};
(0,_react_17_0_2_react.useEffect)(function () {
if (ScoreShow) {
getdatas(param);
getdisciplines();
getwjj();
form.setFieldsValue({
item_type: null,
courseid: '',
tag_discipline_id: null,
difficulty: null,
keyword: null
});
if (indexi && isshixun) {
form.setFieldsValue({
item_type: 'SHIXUN'
});
setindexi(false);
}
}
}, [ScoreShow]);
(0,_react_17_0_2_react.useEffect)(function () {
if (addcount > 0) {
setTimeout(function () {
setaddcount(0);
}, 2000);
}
}, [addcount]);
function getdatas(_x) {
return _getdatas.apply(this, arguments);
}
function _getdatas() {
_getdatas = asyncToGenerator_default()( /*#__PURE__*/regeneratorRuntime_default()().mark(function _callee2(params) {
var _params$courseid, _params$courseid2, res, _params$courseid3, _params$courseid4, ids, shixun_ids, _res;
return regeneratorRuntime_default()().wrap(function _callee2$(_context2) {
while (1) switch (_context2.prev = _context2.next) {
case 0:
setloading(true);
setparam(objectSpread2_default()({}, params));
if (!isshixun) {
_context2.next = 9;
break;
}
_context2.next = 5;
return (0,fetch/* default */.ZP)("/api/shixun_lists.json", {
method: 'get',
params: objectSpread2_default()(objectSpread2_default()({}, params), {}, {
discipline_id: (params === null || params === void 0 || (_params$courseid = params.courseid) === null || _params$courseid === void 0 ? void 0 : _params$courseid[0]) || null,
sub_discipline_id: (params === null || params === void 0 || (_params$courseid2 = params.courseid) === null || _params$courseid2 === void 0 ? void 0 : _params$courseid2[1]) || null,
limit: params.per_page
// ids:listitems
})
});
case 5:
res = _context2.sent;
setdatas(res);
_context2.next = 19;
break;
case 9:
if (!((listitems === null || listitems === void 0 ? void 0 : listitems.length) <= 0 && params.type === '5')) {
_context2.next = 13;
break;
}
setdatas([]);
setloading(false);
return _context2.abrupt("return");
case 13:
ids = params.type === '5' ? listitems === null || listitems === void 0 ? void 0 : listitems.filter(function (item) {
return !ShiXunListItems.includes(item);
}) : null;
shixun_ids = params.type === '5' ? listitems === null || listitems === void 0 ? void 0 : listitems.filter(function (item) {
return ShiXunListItems.includes(item);
}) : null;
_context2.next = 17;
return (0,fetch/* default */.ZP)("/api/item_banks.json", {
method: 'get',
params: objectSpread2_default()(objectSpread2_default()({}, params), {}, {
discipline_id: (params === null || params === void 0 || (_params$courseid3 = params.courseid) === null || _params$courseid3 === void 0 ? void 0 : _params$courseid3[0]) || null,
sub_discipline_id: (params === null || params === void 0 || (_params$courseid4 = params.courseid) === null || _params$courseid4 === void 0 ? void 0 : _params$courseid4[1]) || null,
ids: ids,
shixun_ids: shixun_ids,
type: params.type === '5' ? null : params.type,
clazz: params.type === '3' ? 'ItemBanksGroup' : null
// ids:listitems
})
});
case 17:
_res = _context2.sent;
setdatas(_res);
case 19:
setloading(false);
case 20:
case "end":
return _context2.stop();
}
}, _callee2);
}));
return _getdatas.apply(this, arguments);
}
function getdisciplines() {
return _getdisciplines.apply(this, arguments);
}
function _getdisciplines() {
_getdisciplines = asyncToGenerator_default()( /*#__PURE__*/regeneratorRuntime_default()().mark(function _callee3() {
var res;
return regeneratorRuntime_default()().wrap(function _callee3$(_context3) {
while (1) switch (_context3.prev = _context3.next) {
case 0:
_context3.next = 2;
return (0,fetch/* default */.ZP)("/api/disciplines.json", {
method: 'get',
params: {
source: 'question',
group_id: 0,
group_type: param.type === '5' ? null : param.type,
clazz: 'ItemBanksGroup'
}
});
case 2:
res = _context3.sent;
setcourseOptions((0,util/* formatCourseOptions */.L)(res === null || res === void 0 ? void 0 : res.disciplines));
case 4:
case "end":
return _context3.stop();
}
}, _callee3);
}));
return _getdisciplines.apply(this, arguments);
}
function getwjj() {
return _getwjj.apply(this, arguments);
}
function _getwjj() {
_getwjj = asyncToGenerator_default()( /*#__PURE__*/regeneratorRuntime_default()().mark(function _callee4() {
var res;
return regeneratorRuntime_default()().wrap(function _callee4$(_context4) {
while (1) switch (_context4.prev = _context4.next) {
case 0:
_context4.next = 2;
return (0,fetch/* default */.ZP)("/api/item_banks_groups/all_groups.json", {
method: 'get'
});
case 2:
res = _context4.sent;
if ((res === null || res === void 0 ? void 0 : res.status) === 0) {
setgrouplist(res);
}
case 4:
case "end":
return _context4.stop();
}
}, _callee4);
}));
return _getwjj.apply(this, arguments);
}
function getmy(_x2) {
return _getmy.apply(this, arguments);
}
function _getmy() {
_getmy = asyncToGenerator_default()( /*#__PURE__*/regeneratorRuntime_default()().mark(function _callee5(params) {
var _params$list, _params$list2, _params$courseid5, _params$courseid6;
var ids, shixun_ids, res;
return regeneratorRuntime_default()().wrap(function _callee5$(_context5) {
while (1) switch (_context5.prev = _context5.next) {
case 0:
setloading(true);
ids = (_params$list = params.list) === null || _params$list === void 0 ? void 0 : _params$list.filter(function (item) {
return !ShiXunListItems.includes(item);
});
shixun_ids = (_params$list2 = params.list) === null || _params$list2 === void 0 ? void 0 : _params$list2.filter(function (item) {
return ShiXunListItems.includes(item);
});
if (!(ids.length === 0 && shixun_ids.length === 0)) {
_context5.next = 7;
break;
}
setloading(false);
setdatas([]);
return _context5.abrupt("return");
case 7:
_context5.next = 9;
return (0,fetch/* default */.ZP)("/api/item_banks.json", {
method: 'get',
params: objectSpread2_default()(objectSpread2_default()({}, params), {}, {
discipline_id: (params === null || params === void 0 || (_params$courseid5 = params.courseid) === null || _params$courseid5 === void 0 ? void 0 : _params$courseid5[0]) || null,
sub_discipline_id: (params === null || params === void 0 || (_params$courseid6 = params.courseid) === null || _params$courseid6 === void 0 ? void 0 : _params$courseid6[1]) || null,
ids: ids,
shixun_ids: shixun_ids,
type: params.type === '5' ? null : params.type,
clazz: params.type === '3' ? 'ItemBanksGroup' : null
// ids:listitems
})
});
case 9:
res = _context5.sent;
setloading(false);
setdatas(res);
case 12:
case "end":
return _context5.stop();
}
}, _callee5);
}));
return _getmy.apply(this, arguments);
}
return /*#__PURE__*/(0,jsx_runtime.jsxs)("div", {
children: [/*#__PURE__*/(0,jsx_runtime.jsxs)(modal/* default */.Z, {
title: false,
footer: false,
open: ScoreShow,
width: 1200,
centered: true
// closable={false}
,
className: AddQuestionsModalmodules.scoremodal,
onCancel: function onCancel() {
setScoreShow(false);
},
children: [/*#__PURE__*/(0,jsx_runtime.jsx)("div", {
style: {
display: 'flex',
alignItems: 'center'
},
children: /*#__PURE__*/(0,jsx_runtime.jsx)("div", {
className: AddQuestionsModalmodules.title,
children: "\u9898\u5E93\u9009\u9898"
})
}), /*#__PURE__*/(0,jsx_runtime.jsx)(tabs/* default */.Z, {
className: AddQuestionsModalmodules.tabWrap,
activeKey: param.type,
onChange: function onChange(e) {
param.type = e;
param.page = 1;
param.updated_at = '', param.quotes = '',
// param.item_type = null,
param.courseid = '', param.tag_discipline_id = null, param.difficulty = null, param.keyword = null, param.group_id = null, form.setFieldsValue({
// item_type: null,
courseid: '',
tag_discipline_id: null,
difficulty: null,
keyword: null,
group_id: null
});
setShowClearButton(false);
if (param.type === '5') {
isshixun = false;
setisshixun(false);
}
setparam(objectSpread2_default()({}, param));
getdatas(objectSpread2_default()({}, param));
// setcheckitems([])
// setCheckedItemsArr([])
},
items: [{
label: "\u516C\u5171",
key: '1'
}, {
label: "\u56E2\u961F\u5171\u4EAB",
key: '3'
}, {
label: "\u6536\u85CF\u5939",
key: '2'
}, {
label: "\u6211\u521B\u5EFA\u7684",
key: '0'
}, {
label: /*#__PURE__*/(0,jsx_runtime.jsxs)("div", {
children: ["\u5DF2\u9009", listitems.length > 0 && /*#__PURE__*/(0,jsx_runtime.jsx)("span", {
className: AddQuestionsModalmodules.titlecount,
children: listitems.length
}), addcount > 0 && /*#__PURE__*/(0,jsx_runtime.jsxs)("span", {
className: AddQuestionsModalmodules.add,
children: ["+", addcount]
})]
}),
key: '5'
}]
}), /*#__PURE__*/(0,jsx_runtime.jsxs)(es_form/* default */.Z, {
layout: 'inline',
form: form,
onValuesChange: function onValuesChange(values, items) {
var hasFilter = Object.values(items).some(function (value) {
return value !== null && value !== '' && value !== undefined;
});
var isInputEmpty = items.keyword === '';
setShowClearButton(hasFilter || !isInputEmpty);
param.page = 1;
if ((items === null || items === void 0 ? void 0 : items.item_type) === 'SHIXUN') {
if (param.type === '5') {
setisshixun(false);
} else {
setisshixun(true);
}
if (values.keyword || values.keyword === '') {
return;
}
form.submit();
} else {
if (values !== null && values !== void 0 && values.courseid) {
form.setFieldsValue({
tag_discipline_id: ''
});
}
setisshixun(false);
if (values.keyword || values.keyword === '') {
return;
}
form.submit();
}
},
onFinish: function onFinish(values) {
setparam(objectSpread2_default()(objectSpread2_default()({}, param), values));
getdatas(objectSpread2_default()(objectSpread2_default()({}, param), values));
},
children: [/*#__PURE__*/(0,jsx_runtime.jsx)(es_form/* default */.Z.Item, {
name: "item_type",
children: /*#__PURE__*/(0,jsx_runtime.jsx)(es_select["default"], {
className: AddQuestionsModalmodules.selectWrapper,
placeholder: "\u9898\u578B",
style: {
width: 110
},
size: "middle",
allowClear: true,
children: typeData.map(function (item) {
return /*#__PURE__*/(0,jsx_runtime.jsx)(es_select["default"].Option, {
children: item.name
}, item.value);
})
})
}), /*#__PURE__*/(0,jsx_runtime.jsx)(es_form/* default */.Z.Item, {
name: "courseid",
children: /*#__PURE__*/(0,jsx_runtime.jsx)(cascader/* default */.Z, {
className: AddQuestionsModalmodules.selectWrapper,
style: {
width: 160
},
size: 'middle',
placeholder: "\u65B9\u5411&\u8BFE\u7A0B",
options: courseOptions
})
}), !isshixun && /*#__PURE__*/(0,jsx_runtime.jsx)(es_form/* default */.Z.Item, {
name: "tag_discipline_id",
children: /*#__PURE__*/(0,jsx_runtime.jsx)(es_select["default"], {
className: AddQuestionsModalmodules.selectWrapper,
placeholder: "\u77E5\u8BC6\u70B9",
style: {
width: 160
},
size: "middle",
allowClear: true,
children: datas === null || datas === void 0 || (_datas$tag_discipline = datas.tag_disciplines) === null || _datas$tag_discipline === void 0 ? void 0 : _datas$tag_discipline.map(function (item) {
return /*#__PURE__*/(0,jsx_runtime.jsx)(es_select["default"].Option, {
children: item.name
}, item.id);
})
})
}), /*#__PURE__*/(0,jsx_runtime.jsx)(es_form/* default */.Z.Item, {
name: isshixun ? 'diff' : 'difficulty',
children: /*#__PURE__*/(0,jsx_runtime.jsxs)(es_select["default"], {
className: AddQuestionsModalmodules.selectWrapper,
placeholder: "\u96BE\u5EA6",
style: {
width: 118
},
size: "middle",
allowClear: true,
children: [!isshixun && difficultyData.map(function (item) {
return /*#__PURE__*/(0,jsx_runtime.jsx)(es_select["default"].Option, {
children: item.name
}, item.value);
}), isshixun && diff.map(function (item) {
return /*#__PURE__*/(0,jsx_runtime.jsx)(es_select["default"].Option, {
children: item.name
}, item.value);
})]
})
}), (param.type === '3' || param.type === '0') && !isshixun && /*#__PURE__*/(0,jsx_runtime.jsx)(es_form/* default */.Z.Item, {
name: 'group_id',
children: /*#__PURE__*/(0,jsx_runtime.jsxs)(es_select["default"], {
className: AddQuestionsModalmodules.selectWrapper,
placeholder: "\u6587\u4EF6\u5939",
style: {
width: 118
},
size: "middle",
showSearch: true,
allowClear: true,
filterOption: function filterOption(inputValue, option) {
console.log('---', inputValue, option);
return option.children.toUpperCase().indexOf(inputValue.toUpperCase()) !== -1;
},
children: [/*#__PURE__*/(0,jsx_runtime.jsx)(es_select["default"].Option, {
children: "\u6839\u76EE\u5F55"
}, 0), param.type === '3' && (grouplist === null || grouplist === void 0 || (_grouplist$share_bank = grouplist.share_banks_groups) === null || _grouplist$share_bank === void 0 ? void 0 : _grouplist$share_bank.map(function (item) {
return /*#__PURE__*/(0,jsx_runtime.jsx)(es_select["default"].Option, {
children: item.name
}, item.id);
})), param.type === '0' && (grouplist === null || grouplist === void 0 || (_grouplist$my_banks_g = grouplist.my_banks_groups) === null || _grouplist$my_banks_g === void 0 ? void 0 : _grouplist$my_banks_g.map(function (item) {
return /*#__PURE__*/(0,jsx_runtime.jsx)(es_select["default"].Option, {
children: item.name
}, item.id);
}))]
})
}), showClearButton && /*#__PURE__*/(0,jsx_runtime.jsxs)("span", {
className: AddQuestionsModalmodules.allqingchu,
onClick: handleClearButtonClick,
children: [/*#__PURE__*/(0,jsx_runtime.jsx)("i", {
className: "iconfont icon-guanbi4"
}), /*#__PURE__*/(0,jsx_runtime.jsx)("span", {
children: "\u6E05\u9664\u7B5B\u9009\u6761\u4EF6"
})]
}), /*#__PURE__*/(0,jsx_runtime.jsx)(es_form/* default */.Z.Item, {
style: {
flex: '0 0 auto',
marginRight: 0,
marginLeft: 'auto'
},
name: "keyword",
children: /*#__PURE__*/(0,jsx_runtime.jsx)(input/* default */.Z.Search, {
className: AddQuestionsModalmodules.search,
placeholder: "\u8BF7\u8F93\u5165\u5173\u952E\u8BCD\u641C\u7D22",
allowClear: true,
suffix: /*#__PURE__*/(0,jsx_runtime.jsx)("i", {
className: "iconfont icon-sousuo9 font14 ".concat(AddQuestionsModalmodules.searchIcon),
onClick: function onClick() {
return form.submit();
}
}),
onSearch: function onSearch(value) {
form.submit();
}
})
})]
}), /*#__PURE__*/(0,jsx_runtime.jsxs)("div", {
style: {
background: '#F6F7F9',
display: 'flex',
alignItems: 'center',
marginTop: 18,
height: 40,
paddingLeft: 10,
paddingRight: 20
},
children: [/*#__PURE__*/(0,jsx_runtime.jsxs)("div", {
onClick: function onClick() {
if (param.updated_at === 'asc') {
param.updated_at = 'desc';
} else {
param.updated_at = 'asc';
}
setparam(objectSpread2_default()(objectSpread2_default()({}, param), {}, {
page: 1
}));
getdatas(objectSpread2_default()(objectSpread2_default()({}, param), {}, {
page: 1
}));
},
children: [" ", !param.updated_at ? /*#__PURE__*/(0,jsx_runtime.jsx)("i", {
style: {
fontSize: "14px"
},
className: "iconfont icon-jiangxu mr5 c-light-primary"
}) : /*#__PURE__*/(0,jsx_runtime.jsx)("img", {
src: param.updated_at === 'asc' ? shengxu/* default */.Z : jiangxu/* default */.Z,
style: {
width: "15px",
verticalAlign: "text-bottom"
},
className: "font14 mr5 c-light-primary"
}), "\u6309\u66F4\u65B0\u65F6\u95F4\u6392\u5E8F"]
}), /*#__PURE__*/(0,jsx_runtime.jsxs)("div", {
onClick: function onClick() {
if (param.quotes === 'asc') {
param.quotes = 'desc';
} else {
param.quotes = 'asc';
}
setparam(objectSpread2_default()(objectSpread2_default()({}, param), {}, {
page: 1
}));
getdatas(objectSpread2_default()(objectSpread2_default()({}, param), {}, {
page: 1
}));
},
style: {
marginLeft: 20
},
children: [" ", !param.quotes ? /*#__PURE__*/(0,jsx_runtime.jsx)("i", {
style: {
fontSize: "14px"
},
className: "iconfont icon-jiangxu mr5 c-light-primary"
}) : /*#__PURE__*/(0,jsx_runtime.jsx)("img", {
src: param.quotes === 'asc' ? shengxu/* default */.Z : jiangxu/* default */.Z,
style: {
width: "15px",
verticalAlign: "text-bottom"
},
className: "font14 mr5 c-light-primary"
}), "\u6309\u4F7F\u7528\u6B21\u6570\u6392\u5E8F"]
})]
}), /*#__PURE__*/(0,jsx_runtime.jsx)(table/* default */.Z, {
style: {
marginTop: 2,
marginBottom: 20
},
scroll: {
y: 260
},
dataSource: (datas === null || datas === void 0 ? void 0 : datas.items) || (datas === null || datas === void 0 ? void 0 : datas.shixun_list),
pagination: false,
loading: loading,
rowKey: function rowKey(e) {
return e.id;
},
rowSelection: {
type: 'checkbox',
selectedRowKeys: checkitems,
onSelect: function onSelect(record, selected, selectedRows) {
if (selected) {
if (isshixun) {
setshixunitems([].concat(toConsumableArray_default()(ShiXunListItems), [record.id]));
}
setcheckitems([].concat(toConsumableArray_default()(checkitems), [record.id]));
setCheckedItemsArr([].concat(toConsumableArray_default()(checkedItemsArr), [record]));
//添加
if (record.identifier) {
selectedShixunId.current.add(record.id);
} else {
selectedQuestionId.current.add(record.id);
}
setaddcount(1);
setlistitems([].concat(toConsumableArray_default()(listitems), [record.id]));
//取消选中,则在checkedItemsArr、selectedRowKeys中过滤掉这条数据
} else {
var newData = checkedItemsArr.filter(function (item) {
return item.id !== record.id;
});
setCheckedItemsArr(newData);
var arr = newData.map(function (item) {
return item.id;
});
setcheckitems(toConsumableArray_default()(arr));
//移除
if (record.identifier) {
selectedShixunId.current["delete"](record.id);
} else {
selectedQuestionId.current["delete"](record.id);
}
var list = listitems.filter(function (item) {
return item !== record.id;
});
setlistitems(list);
if (isshixun) {
var list2 = ShiXunListItems.filter(function (item) {
return item !== record.id;
});
setshixunitems(toConsumableArray_default()(list2));
}
if (param.type === '5') {
getmy(objectSpread2_default()(objectSpread2_default()({}, param), {}, {
list: toConsumableArray_default()(list)
}));
return;
}
}
},
onSelectAll: function onSelectAll(selected, selectedRows, changeRows) {
if (!selected) {
var arr = changeRows.map(function (item) {
return item.id;
});
var newArr = checkitems.filter(function (item) {
return !arr.some(function (ele) {
return ele === item;
});
});
var newArr1 = checkedItemsArr.filter(function (item) {
return !arr.some(function (ele) {
return ele === item.id;
});
});
setCheckedItemsArr(newArr1);
setcheckitems(toConsumableArray_default()(newArr));
//批量移除
setlistitems(toConsumableArray_default()(newArr));
if (isshixun) {
var list2 = ShiXunListItems.filter(function (item) {
return !arr.some(function (ele) {
return ele === item.id;
});
});
setshixunitems(toConsumableArray_default()(list2));
}
if (param.type === '5') {
getmy(objectSpread2_default()(objectSpread2_default()({}, param), {}, {
list: toConsumableArray_default()(newArr)
}));
}
var _iterator = createForOfIteratorHelper_default()(arr),
_step;
try {
for (_iterator.s(); !(_step = _iterator.n()).done;) {
var item = _step.value;
if (item.identifier) {
selectedShixunId.current["delete"](item);
} else {
selectedQuestionId.current["delete"](item);
}
}
} catch (err) {
_iterator.e(err);
} finally {
_iterator.f();
}
}
//全选,把由未选中变为选中的数据统一放到setSelectedRowKeys中存储
else {
var arr1 = changeRows.map(function (item) {
return item.id;
}); //过滤出选中数据的唯一值
if (isshixun) {
setshixunitems([].concat(toConsumableArray_default()(ShiXunListItems), toConsumableArray_default()(arr1)));
}
setCheckedItemsArr([].concat(toConsumableArray_default()(checkedItemsArr), toConsumableArray_default()(changeRows)));
setcheckitems([].concat(toConsumableArray_default()(checkitems), toConsumableArray_default()(arr1))); //存储所有选中数据的唯一值,可用于批量删除/新增/修改等操作
//批量加入
setlistitems([].concat(toConsumableArray_default()(listitems), toConsumableArray_default()(arr1)));
var _iterator2 = createForOfIteratorHelper_default()(changeRows),
_step2;
try {
for (_iterator2.s(); !(_step2 = _iterator2.n()).done;) {
var _item = _step2.value;
if (_item.identifier) {
selectedShixunId.current.add(_item.id);
} else {
selectedQuestionId.current.add(_item.id);
}
}
} catch (err) {
_iterator2.e(err);
} finally {
_iterator2.f();
}
}
} // onChange(newSelectedRowKeys, selectedRows) {
// console.log(newSelectedRowKeys);
// console.log(selectedRows);
// if (isshixun) {
// setshixunitems([...ShiXunListItems, ...newSelectedRowKeys])
// }
// setcheckitems(newSelectedRowKeys)
// setCheckedItemsArr(selectedRows)
// },
},
columns: [{
title: '题型',
dataIndex: 'item_type',
key: 'item_type',
render: function render(value, record, index) {
var _typeData$filter;
return /*#__PURE__*/(0,jsx_runtime.jsx)("span", {
children: isshixun || record !== null && record !== void 0 && record.challenge_names ? '实训题' : typeData === null || typeData === void 0 || (_typeData$filter = typeData.filter(function (item) {
return item.value === value;
})) === null || _typeData$filter === void 0 || (_typeData$filter = _typeData$filter[0]) === null || _typeData$filter === void 0 ? void 0 : _typeData$filter.name
});
}
}, {
title: '试题名称',
dataIndex: 'name',
width: isshixun ? '30%' : '60%',
key: 'name',
render: function render(value, record, index) {
var _record$program_attr;
return /*#__PURE__*/(0,jsx_runtime.jsx)(RenderHtml/* default */.Z, {
showLines: 1,
showTextOnly: true,
value: isshixun || record !== null && record !== void 0 && record.challenge_names ? (record === null || record === void 0 ? void 0 : record.title) || value : (record === null || record === void 0 ? void 0 : record.item_type) == "BPROGRAM" ? record === null || record === void 0 || (_record$program_attr = record.program_attr) === null || _record$program_attr === void 0 ? void 0 : _record$program_attr.description : value
}, 1);
}
}, {
title: '创建者',
dataIndex: 'author_name',
key: 'author_name',
hidden: !isshixun,
render: function render(value, record, index) {
var _value$split;
return /*#__PURE__*/(0,jsx_runtime.jsx)("span", {
children: value ? value === null || value === void 0 || (_value$split = value.split('、')) === null || _value$split === void 0 ? void 0 : _value$split[0] : '- -'
});
}
}, {
title: '所属单位',
dataIndex: 'author_school_name',
key: 'author_school_name',
hidden: !isshixun,
render: function render(value, record, index) {
return /*#__PURE__*/(0,jsx_runtime.jsx)("span", {
children: value || '- -'
});
}
}, {
title: '难度',
dataIndex: 'difficulty',
key: 'difficulty',
render: function render(value, record, index) {
var _difficultyData$filte, _difficultyData$filte2;
return /*#__PURE__*/(0,jsx_runtime.jsx)("span", {
children: isshixun || record !== null && record !== void 0 && record.challenge_names ? (record === null || record === void 0 ? void 0 : record.level) || (difficultyData === null || difficultyData === void 0 || (_difficultyData$filte = difficultyData.filter(function (item) {
return item.value === value;
})) === null || _difficultyData$filte === void 0 || (_difficultyData$filte = _difficultyData$filte[0]) === null || _difficultyData$filte === void 0 ? void 0 : _difficultyData$filte.name) : difficultyData === null || difficultyData === void 0 || (_difficultyData$filte2 = difficultyData.filter(function (item) {
return item.value === value;
})) === null || _difficultyData$filte2 === void 0 || (_difficultyData$filte2 = _difficultyData$filte2[0]) === null || _difficultyData$filte2 === void 0 ? void 0 : _difficultyData$filte2.name
});
}
}, {
title: '使用次数',
dataIndex: 'quotes',
key: 'quotes',
render: function render(value, record, index) {
return /*#__PURE__*/(0,jsx_runtime.jsx)("span", {
children: isshixun || record !== null && record !== void 0 && record.challenge_names ? (record === null || record === void 0 ? void 0 : record.study_count) || (record === null || record === void 0 ? void 0 : record.stu_num) : value
});
}
}, {
title: '操作',
dataIndex: 'id',
key: 'item_type',
render: function render(value, record, index) {
return /*#__PURE__*/(0,jsx_runtime.jsx)("div", {
style: {
flex: 1,
textAlign: 'start'
},
children: /*#__PURE__*/(0,jsx_runtime.jsx)("a", {
onClick: function onClick() {
var _typeData$filter2;
setqitem(objectSpread2_default()(objectSpread2_default()({}, record), {}, {
question_type: isshixun || record !== null && record !== void 0 && record.challenge_names ? 5 : typeData === null || typeData === void 0 || (_typeData$filter2 = typeData.filter(function (item) {
return item.value === (record === null || record === void 0 ? void 0 : record.item_type);
})) === null || _typeData$filter2 === void 0 || (_typeData$filter2 = _typeData$filter2[0]) === null || _typeData$filter2 === void 0 ? void 0 : _typeData$filter2.question_type
}));
setisshow(true);
},
children: "\u67E5\u770B"
})
});
}
}].filter(function (item) {
return !item.hidden;
})
}), /*#__PURE__*/(0,jsx_runtime.jsx)(pagination/* default */.Z, {
current: param.page,
total: (datas === null || datas === void 0 ? void 0 : datas.items_count) || (datas === null || datas === void 0 ? void 0 : datas.shixuns_count),
style: {
marginBottom: 20
},
defaultPageSize: param.per_page,
showTotal: function showTotal(e) {
return /*#__PURE__*/(0,jsx_runtime.jsxs)("span", {
children: ["\u5171\xA0", /*#__PURE__*/(0,jsx_runtime.jsx)("span", {
style: {
color: '#165DFF'
},
children: e
}), "\xA0\u6761\u6570\u636E"]
});
},
pageSize: param.per_page,
onChange: function onChange(e, limit) {
param.page = e;
param.per_page = limit;
setparam(objectSpread2_default()({}, param));
getdatas(objectSpread2_default()({}, param));
}
}), /*#__PURE__*/(0,jsx_runtime.jsxs)("div", {
className: AddQuestionsModalmodules.bottom,
children: [/*#__PURE__*/(0,jsx_runtime.jsx)(es_button/* default */.ZP, {
className: AddQuestionsModalmodules.no,
onClick: function onClick() {
setScoreShow(false);
},
children: "\u53D6\u6D88"
}), /*#__PURE__*/(0,jsx_runtime.jsx)(es_button/* default */.ZP, {
loading: isloadings,
style: {
width: isloadings && 75
},
className: AddQuestionsModalmodules.yes,
onClick: /*#__PURE__*/asyncToGenerator_default()( /*#__PURE__*/regeneratorRuntime_default()().mark(function _callee() {
return regeneratorRuntime_default()().wrap(function _callee$(_context) {
while (1) switch (_context.prev = _context.next) {
case 0:
if (!((listitems === null || listitems === void 0 ? void 0 : listitems.length) <= 0)) {
_context.next = 3;
break;
}
message/* default */.ZP.info('当前暂未选择数据');
return _context.abrupt("return");
case 3:
onOk(toConsumableArray_default()(selectedQuestionId.current), toConsumableArray_default()(selectedShixunId.current), true, listitems === null || listitems === void 0 ? void 0 : listitems.length);
case 4:
case "end":
return _context.stop();
}
}, _callee);
})),
children: "\u786E\u8BA4"
})]
})]
}), /*#__PURE__*/(0,jsx_runtime.jsx)(modal/* default */.Z, {
open: isshow,
title: '题目详情',
footer: false,
className: AddQuestionsModalmodules.previewModal,
width: 1000,
centered: true,
onCancel: function onCancel() {
setisshow(false);
},
onOk: function onOk() {
setisshow(false);
},
children: /*#__PURE__*/(0,jsx_runtime.jsx)(AddQuestionsModal_SaveItem, {
qitem: qitem
})
})]
});
};
/* harmony default export */ var AddQuestionsModal = (AddQuestionsModal_AddModal);
// EXTERNAL MODULE: ./src/utils/hooks/useOverflow.ts
var useOverflow = __webpack_require__(67169);
// EXTERNAL MODULE: ./node_modules/_lodash@4.17.21@lodash/lodash.js
var lodash = __webpack_require__(89392);
// EXTERNAL MODULE: ./src/service/paths.ts
var paths = __webpack_require__(42471);
;// CONCATENATED MODULE: ./src/pages/Paperlibrary/EditPotin/index.tsx
// import AddPoints from '@/components/AddPoints';
var EditPotin_questionType = [{
name: '单选题',
id: 0,
count: 'q_singles',
score: 'q_singles_scores',
nameType: "SINGLE"
}, {
name: '多选题',
id: 1,
count: 'q_doubles',
score: 'q_doubles_scores',
nameType: "MULTIPLE"
}, {
name: '判断题',
id: 2,
count: 'q_judges',
score: 'q_judges_scores',
nameType: "JUDGMENT"
}, {
name: '填空题',
id: 3,
count: 'q_nulls',
score: 'q_nulls_scores',
nameType: "COMPLETION"
}, {
name: '简答题',
id: 4,
count: 'q_mains',
score: 'q_mains_scores',
nameType: "SUBJECTIVE"
}, {
name: '实训题',
id: 5,
count: 'q_shixuns',
score: 'q_shixuns_scores',
nameType: "PRACTICAL"
}, {
name: '编程题',
id: 6,
count: 'q_pros',
score: 'q_pros_scores',
nameType: "PROGRAM"
}, {
name: '组合题',
id: 7,
count: 'q_combinations',
score: 'q_combinations_scores',
nameType: "COMBINATION"
}, {
name: '程序填空题',
id: 8,
count: 'q_combinations',
score: 'q_combinations_scores',
nameType: "BPROGRAM"
}];
var AddNewPaper = function AddNewPaper(_ref) {
var _exerciseitem$exercis, _exerciseitem$exercis2, _exerciseitem$exercis3, _qitem$program_attr;
var user = _ref.user,
dispatch = _ref.dispatch,
itemid = _ref.itemid,
setisedits = _ref.setisedits;
var _useState = (0,_react_17_0_2_react.useState)(),
_useState2 = slicedToArray_default()(_useState, 2),
exerciseitem = _useState2[0],
setexerciseitem = _useState2[1];
var _useState3 = (0,_react_17_0_2_react.useState)(false),
_useState4 = slicedToArray_default()(_useState3, 2),
isloading = _useState4[0],
setisloading = _useState4[1]; //防止多次点击
var _useState5 = (0,_react_17_0_2_react.useState)(),
_useState6 = slicedToArray_default()(_useState5, 2),
qitem = _useState6[0],
setqitem = _useState6[1]; //获取id
var _useState7 = (0,_react_17_0_2_react.useState)(),
_useState8 = slicedToArray_default()(_useState7, 2),
score = _useState8[0],
setScore = _useState8[1]; //设置分数
var refScore = (0,_react_17_0_2_react.useRef)();
var scoreId = (0,_react_17_0_2_react.useRef)();
var _useState9 = (0,_react_17_0_2_react.useState)(),
_useState10 = slicedToArray_default()(_useState9, 2),
Bigqitem = _useState10[0],
setBigqitem = _useState10[1]; //获取大题
var _useState11 = (0,_react_17_0_2_react.useState)(false),
_useState12 = slicedToArray_default()(_useState11, 2),
rightloading = _useState12[0],
setrightloading = _useState12[1]; //右侧loading状态
var _useState13 = (0,_react_17_0_2_react.useState)(false),
_useState14 = slicedToArray_default()(_useState13, 2),
isedit = _useState14[0],
setisedit = _useState14[1]; //是否进入编辑状态
var _useState15 = (0,_react_17_0_2_react.useState)(),
_useState16 = slicedToArray_default()(_useState15, 2),
TagDiscipline = _useState16[0],
setTagDiscipline = _useState16[1]; //获取知识点
var _useState17 = (0,_react_17_0_2_react.useState)(false),
_useState18 = slicedToArray_default()(_useState17, 2),
uploadModalVisible = _useState18[0],
setUploadModalVisible = _useState18[1]; //批量导入弹窗
var _useState19 = (0,_react_17_0_2_react.useState)(false),
_useState20 = slicedToArray_default()(_useState19, 2),
ScoreShow = _useState20[0],
setScoreShow = _useState20[1]; //批量设置得分窗口显隐
var _useState21 = (0,_react_17_0_2_react.useState)(false),
_useState22 = slicedToArray_default()(_useState21, 2),
showquestion = _useState22[0],
setshowquestion = _useState22[1]; //题库选题显隐
var _useState23 = (0,_react_17_0_2_react.useState)(false),
_useState24 = slicedToArray_default()(_useState23, 2),
isshixun = _useState24[0],
setisshixun = _useState24[1]; //是否是实训题进入选题
var _useState25 = (0,_react_17_0_2_react.useState)(false),
_useState26 = slicedToArray_default()(_useState25, 2),
isloadings = _useState26[0],
setisloadings = _useState26[1]; //选题loading状态
var _useState27 = (0,_react_17_0_2_react.useState)(false),
_useState28 = slicedToArray_default()(_useState27, 2),
showChange = _useState28[0],
setShowChange = _useState28[1]; //上下移动切换
var _Form$useForm = es_form/* default */.Z.useForm(),
_Form$useForm2 = slicedToArray_default()(_Form$useForm, 1),
form = _Form$useForm2[0];
var _useState29 = (0,_react_17_0_2_react.useState)(false),
_useState30 = slicedToArray_default()(_useState29, 2),
isOpenEditName = _useState30[0],
setIsOpenEditName = _useState30[1];
var rightDiv = (0,_react_17_0_2_react.useRef)(null);
var _useSearchParams = (0,_umi_production_exports.useSearchParams)(),
_useSearchParams2 = slicedToArray_default()(_useSearchParams, 1),
searchParams = _useSearchParams2[0];
(0,_react_17_0_2_react.useEffect)(function () {
init();
dispatch({
type: 'globalSetting/footerToggle',
payload: false
});
}, []);
(0,_react_17_0_2_react.useEffect)(function () {
setisedits(isedit);
}, [isedit]);
(0,_react_17_0_2_react.useEffect)(function () {
if (qitem !== null && qitem !== void 0 && qitem.question_id) {
setScore(qitem === null || qitem === void 0 ? void 0 : qitem.question_score);
scoreId.current = qitem === null || qitem === void 0 ? void 0 : qitem.question_id;
}
}, [qitem === null || qitem === void 0 ? void 0 : qitem.question_id]);
var getTagData = /*#__PURE__*/function () {
var _ref2 = asyncToGenerator_default()( /*#__PURE__*/regeneratorRuntime_default()().mark(function _callee(id) {
var res;
return regeneratorRuntime_default()().wrap(function _callee$(_context) {
while (1) switch (_context.prev = _context.next) {
case 0:
_context.next = 2;
return dispatch({
type: 'newExercisePaper/getTagDiscipline',
payload: {
sub_discipline_id: id
}
});
case 2:
res = _context.sent;
setTagDiscipline(res);
case 4:
case "end":
return _context.stop();
}
}, _callee);
}));
return function getTagData(_x) {
return _ref2.apply(this, arguments);
};
}();
function init() {
return _init.apply(this, arguments);
}
function _init() {
_init = asyncToGenerator_default()( /*#__PURE__*/regeneratorRuntime_default()().mark(function _callee13() {
var _res$exercise3, _res$exercise_questio, _res$exercise_questio2;
var res, _res$exercise4;
return regeneratorRuntime_default()().wrap(function _callee13$(_context13) {
while (1) switch (_context13.prev = _context13.next) {
case 0:
setrightloading(true);
setisloading(true);
_context13.next = 4;
return dispatch({
type: 'newExercisePaper/editExercise',
payload: {
id: itemid
}
});
case 4:
res = _context13.sent;
setrightloading(false);
setisloading(false);
setexerciseitem(res);
if (res !== null && res !== void 0 && (_res$exercise3 = res.exercise) !== null && _res$exercise3 !== void 0 && _res$exercise3.sub_discipline_id) {
getTagData(res === null || res === void 0 || (_res$exercise4 = res.exercise) === null || _res$exercise4 === void 0 ? void 0 : _res$exercise4.sub_discipline_id);
}
//初始化qid为第一题第一个
setqitem(objectSpread2_default()(objectSpread2_default()({}, res === null || res === void 0 || (_res$exercise_questio = res.exercise_question_types) === null || _res$exercise_questio === void 0 || (_res$exercise_questio = _res$exercise_questio[0]) === null || _res$exercise_questio === void 0 || (_res$exercise_questio = _res$exercise_questio.items) === null || _res$exercise_questio === void 0 ? void 0 : _res$exercise_questio[0]), {}, {
index: 1
}));
setBigqitem(objectSpread2_default()(objectSpread2_default()({}, res === null || res === void 0 || (_res$exercise_questio2 = res.exercise_question_types) === null || _res$exercise_questio2 === void 0 ? void 0 : _res$exercise_questio2[0]), {}, {
indexs: 1
}));
case 11:
case "end":
return _context13.stop();
}
}, _callee13);
}));
return _init.apply(this, arguments);
}
function getdatas(_x2) {
return _getdatas.apply(this, arguments);
}
function _getdatas() {
_getdatas = asyncToGenerator_default()( /*#__PURE__*/regeneratorRuntime_default()().mark(function _callee14(params) {
var _res$exercise_questio3, _items$filter, _res$exercise_questio4, _bigitems$filter;
var isLoading,
res,
items,
item,
bigitems,
valitems,
_args14 = arguments;
return regeneratorRuntime_default()().wrap(function _callee14$(_context14) {
while (1) switch (_context14.prev = _context14.next) {
case 0:
isLoading = _args14.length > 1 && _args14[1] !== undefined ? _args14[1] : true;
if (isLoading) {
setrightloading(true);
setisloading(true);
}
_context14.next = 4;
return dispatch({
type: 'newExercisePaper/editExercise',
payload: {
id: itemid
}
});
case 4:
res = _context14.sent;
setexerciseitem(res);
items = [];
res === null || res === void 0 || (_res$exercise_questio3 = res.exercise_question_types) === null || _res$exercise_questio3 === void 0 || _res$exercise_questio3.map(function (item) {
var _item$items;
item === null || item === void 0 || (_item$items = item.items) === null || _item$items === void 0 || _item$items.map(function (val, index) {
items.push(objectSpread2_default()(objectSpread2_default()({}, val), {}, {
index: index + 1
}));
});
});
item = (_items$filter = items.filter(function (val) {
return val.question_id === (params === null || params === void 0 ? void 0 : params.id);
})) === null || _items$filter === void 0 ? void 0 : _items$filter[0];
bigitems = res === null || res === void 0 || (_res$exercise_questio4 = res.exercise_question_types) === null || _res$exercise_questio4 === void 0 ? void 0 : _res$exercise_questio4.map(function (val, index) {
if ((item === null || item === void 0 ? void 0 : item.question_type) === (val === null || val === void 0 ? void 0 : val.question_type)) {
return objectSpread2_default()(objectSpread2_default()({}, val), {}, {
indexs: index + 1
});
}
});
valitems = (_bigitems$filter = bigitems.filter(function (item) {
return item;
})) === null || _bigitems$filter === void 0 ? void 0 : _bigitems$filter[0];
setBigqitem(objectSpread2_default()({}, valitems));
setqitem(objectSpread2_default()({}, item));
setScore(item === null || item === void 0 ? void 0 : item.question_score);
setrightloading(false);
setisloading(false);
case 16:
case "end":
return _context14.stop();
}
}, _callee14);
}));
return _getdatas.apply(this, arguments);
}
function seveeditor(_x3) {
return _seveeditor.apply(this, arguments);
}
function _seveeditor() {
_seveeditor = asyncToGenerator_default()( /*#__PURE__*/regeneratorRuntime_default()().mark(function _callee15(params) {
var _exerciseitem$exercis19;
var datas, bdatas, res;
return regeneratorRuntime_default()().wrap(function _callee15$(_context15) {
while (1) switch (_context15.prev = _context15.next) {
case 0:
datas = objectSpread2_default()(objectSpread2_default()({}, params), {}, {
difficulty: (params === null || params === void 0 ? void 0 : params.difficulty) || 2,
item_type: params.question_type,
sub_discipline_id: exerciseitem === null || exerciseitem === void 0 || (_exerciseitem$exercis19 = exerciseitem.exercise) === null || _exerciseitem$exercis19 === void 0 ? void 0 : _exerciseitem$exercis19.sub_discipline_id,
tag_discipline_ids: [],
repeat_answer: !params.repeat_answer
});
bdatas = {};
if (params.question_type === 8) {
bdatas = objectSpread2_default()(objectSpread2_default()({}, params), {}, {
hack: objectSpread2_default()(objectSpread2_default()({}, params === null || params === void 0 ? void 0 : params.hack), {}, {
difficult: params.difficulty
}),
hack_codes: objectSpread2_default()(objectSpread2_default()({}, params.hack_codes), {}, {
code: base64.Base64.encode(params.hack_codes.code)
}),
hack_sets: [objectSpread2_default()({}, params.hack_sets)],
is_blank: true
});
}
if (params.tag_discipline_ids) {
datas.tag_discipline_ids = Array.isArray(params.tag_discipline_ids) ? params.tag_discipline_ids : [params.tag_discipline_ids];
bdatas.tag_discipline_ids = Array.isArray(params.tag_discipline_ids) ? params.tag_discipline_ids : [params.tag_discipline_ids];
}
if (sessionStorage.projectFill) bdatas.hack_identifier = sessionStorage.projectFill;
_context15.next = 7;
return (0,fetch/* default */.ZP)("/api/examination_banks/".concat(itemid, "/examination_banks_item_banks/create_item_bank.json"), {
method: 'post',
body: params.question_type === 8 ? bdatas : datas
});
case 7:
res = _context15.sent;
if ((res === null || res === void 0 ? void 0 : res.status) === 0) {
setisedit(false);
getdatas(res);
}
(0,utils_util/* scrollToTop */.k3)();
case 10:
case "end":
return _context15.stop();
}
}, _callee15);
}));
return _seveeditor.apply(this, arguments);
}
function sort_question(_x4) {
return _sort_question.apply(this, arguments);
}
function _sort_question() {
_sort_question = asyncToGenerator_default()( /*#__PURE__*/regeneratorRuntime_default()().mark(function _callee16(params) {
var res;
return regeneratorRuntime_default()().wrap(function _callee16$(_context16) {
while (1) switch (_context16.prev = _context16.next) {
case 0:
setisloading(true);
_context16.next = 3;
return (0,fetch/* default */.ZP)("/api/examination_banks/".concat(itemid, "/sort_question_type.json"), {
method: 'post',
body: {
question_type: params
}
});
case 3:
res = _context16.sent;
setisloading(false);
if ((res === null || res === void 0 ? void 0 : res.status) === 0) {
init();
}
case 6:
case "end":
return _context16.stop();
}
}, _callee16);
}));
return _sort_question.apply(this, arguments);
}
var handleOk = /*#__PURE__*/function () {
var _ref3 = asyncToGenerator_default()( /*#__PURE__*/regeneratorRuntime_default()().mark(function _callee2(list, cb) {
var _list$;
var res;
return regeneratorRuntime_default()().wrap(function _callee2$(_context2) {
while (1) switch (_context2.prev = _context2.next) {
case 0:
if (!(list.length === 0)) {
_context2.next = 4;
break;
}
message/* default */.ZP.warning('请上传文件');
cb();
return _context2.abrupt("return");
case 4:
_context2.next = 6;
return (0,paperlibrary/* importItemBanks */.Hb)(itemid, (_list$ = list[0]) === null || _list$ === void 0 ? void 0 : _list$.file);
case 6:
res = _context2.sent;
if (res.status === 0) {
message/* default */.ZP.success("\u6210\u529F\u5BFC\u5165".concat(res === null || res === void 0 ? void 0 : res.success, "\u6761"));
setUploadModalVisible(false);
init();
}
cb();
case 9:
case "end":
return _context2.stop();
}
}, _callee2);
}));
return function handleOk(_x5, _x6) {
return _ref3.apply(this, arguments);
};
}();
var handleScore = /*#__PURE__*/function () {
var _ref4 = asyncToGenerator_default()( /*#__PURE__*/regeneratorRuntime_default()().mark(function _callee3(score, item) {
var res;
return regeneratorRuntime_default()().wrap(function _callee3$(_context3) {
while (1) switch (_context3.prev = _context3.next) {
case 0:
_context3.next = 2;
return (0,paperlibrary/* changeExamScore */.kF)({
score: (0,lodash.round)(score, 1),
question_id: item === null || item === void 0 ? void 0 : item.question_id
});
case 2:
res = _context3.sent;
if (!((res === null || res === void 0 ? void 0 : res.status) === 0)) {
_context3.next = 7;
break;
}
message/* default */.ZP.success('修改成功');
getdatas({
id: scoreId.current
}, false);
return _context3.abrupt("return");
case 7:
if ((res === null || res === void 0 ? void 0 : res.status) === -1) {
setScore(item === null || item === void 0 ? void 0 : item.question_score);
}
case 8:
case "end":
return _context3.stop();
}
}, _callee3);
}));
return function handleScore(_x7, _x8) {
return _ref4.apply(this, arguments);
};
}();
function deleteitem() {
return _deleteitem.apply(this, arguments);
}
function _deleteitem() {
_deleteitem = asyncToGenerator_default()( /*#__PURE__*/regeneratorRuntime_default()().mark(function _callee18() {
return regeneratorRuntime_default()().wrap(function _callee18$(_context18) {
while (1) switch (_context18.prev = _context18.next) {
case 0:
modal/* default */.Z.confirm({
title: '提示',
content: '确定要删除这个试题吗?',
okText: '确定',
centered: true,
className: EditPotinmodules.modalconfirm,
onOk: function () {
var _onOk2 = asyncToGenerator_default()( /*#__PURE__*/regeneratorRuntime_default()().mark(function _callee17() {
var res;
return regeneratorRuntime_default()().wrap(function _callee17$(_context17) {
while (1) switch (_context17.prev = _context17.next) {
case 0:
if (!qitem.question_id) {
_context17.next = 7;
break;
}
_context17.next = 3;
return (0,fetch/* default */.ZP)("/api/examination_banks/".concat(itemid, "/examination_banks_item_banks/").concat(qitem.question_id, ".json"), {
method: 'delete'
});
case 3:
res = _context17.sent;
if ((res === null || res === void 0 ? void 0 : res.status) === 0) {
init();
setisedit(false);
}
_context17.next = 10;
break;
case 7:
setqitem({});
setisedit(false);
init();
case 10:
case "end":
return _context17.stop();
}
}, _callee17);
}));
function onOk() {
return _onOk2.apply(this, arguments);
}
return onOk;
}(),
cancelText: '取消'
});
case 1:
case "end":
return _context18.stop();
}
}, _callee18);
}));
return _deleteitem.apply(this, arguments);
}
var addquestion = /*#__PURE__*/function () {
var _ref5 = asyncToGenerator_default()( /*#__PURE__*/regeneratorRuntime_default()().mark(function _callee4(data) {
var res;
return regeneratorRuntime_default()().wrap(function _callee4$(_context4) {
while (1) switch (_context4.prev = _context4.next) {
case 0:
_context4.next = 2;
return (0,fetch/* default */.ZP)("/api/examination_banks/".concat(itemid, "/examination_banks_item_banks.json"), {
method: 'post',
body: objectSpread2_default()({}, data)
});
case 2:
res = _context4.sent;
return _context4.abrupt("return", res);
case 4:
case "end":
return _context4.stop();
}
}, _callee4);
}));
return function addquestion(_x9) {
return _ref5.apply(this, arguments);
};
}();
var _useOverflow = (0,useOverflow/* useOverflow */.I)(),
overflow = _useOverflow.overflow,
handleMouseEnter = _useOverflow.handleMouseEnter,
handleMouseLeave = _useOverflow.handleMouseLeave;
var sort_question_show = /*#__PURE__*/function () {
var _ref6 = asyncToGenerator_default()( /*#__PURE__*/regeneratorRuntime_default()().mark(function _callee5(params) {
var res, _res$exercise, _res, _res$exercise2;
return regeneratorRuntime_default()().wrap(function _callee5$(_context5) {
while (1) switch (_context5.prev = _context5.next) {
case 0:
setisloading(true);
_context5.next = 3;
return (0,fetch/* default */.ZP)("/api/examination_banks/".concat(itemid, "/sort_question_type.json"), {
method: 'post',
body: {
question_type: params
}
});
case 3:
res = _context5.sent;
setisloading(false);
if (!((res === null || res === void 0 ? void 0 : res.status) === 0)) {
_context5.next = 11;
break;
}
_context5.next = 8;
return dispatch({
type: 'newExercisePaper/editExercise',
payload: {
id: itemid
}
});
case 8:
_res = _context5.sent;
setexerciseitem(_res);
if (_res !== null && _res !== void 0 && (_res$exercise = _res.exercise) !== null && _res$exercise !== void 0 && _res$exercise.sub_discipline_id) {
getTagData(_res === null || _res === void 0 || (_res$exercise2 = _res.exercise) === null || _res$exercise2 === void 0 ? void 0 : _res$exercise2.sub_discipline_id);
}
case 11:
case "end":
return _context5.stop();
}
}, _callee5);
}));
return function sort_question_show(_x10) {
return _ref6.apply(this, arguments);
};
}();
var handleIsEdit = function handleIsEdit() {
if (isedit) {
message/* default */.ZP.info('请先保存或取消当前正在编辑的试题。');
return true;
}
return false;
};
var exportMenu = function exportMenu(values, index) {
return /*#__PURE__*/(0,jsx_runtime.jsxs)(menu/* default */.Z, {
children: [/*#__PURE__*/(0,jsx_runtime.jsx)(menu/* default */.Z.Item, {
disabled: index === 0 ? true : false,
onClick: /*#__PURE__*/asyncToGenerator_default()( /*#__PURE__*/regeneratorRuntime_default()().mark(function _callee6() {
var arr;
return regeneratorRuntime_default()().wrap(function _callee6$(_context6) {
while (1) switch (_context6.prev = _context6.next) {
case 0:
if (!(index === 0)) {
_context6.next = 2;
break;
}
return _context6.abrupt("return");
case 2:
if (!handleIsEdit()) {
_context6.next = 4;
break;
}
return _context6.abrupt("return");
case 4:
arr = (0,utils_util/* moveArray */.rz)(exerciseitem === null || exerciseitem === void 0 ? void 0 : exerciseitem.exercise_question_types, index, index - 1);
_context6.next = 7;
return sort_question_show(arr.map(function (item) {
return item.name;
}));
case 7:
case "end":
return _context6.stop();
}
}, _callee6);
})),
children: /*#__PURE__*/(0,jsx_runtime.jsx)("span", {
className: EditPotinmodules.moreSpan,
children: "\u4E0A\u79FB"
})
}, "1"), /*#__PURE__*/(0,jsx_runtime.jsx)(menu/* default */.Z.Item, {
disabled: index === (exerciseitem === null || exerciseitem === void 0 ? void 0 : exerciseitem.exercise_question_types.length) - 1 ? true : false,
onClick: /*#__PURE__*/asyncToGenerator_default()( /*#__PURE__*/regeneratorRuntime_default()().mark(function _callee7() {
var arr;
return regeneratorRuntime_default()().wrap(function _callee7$(_context7) {
while (1) switch (_context7.prev = _context7.next) {
case 0:
if (!(index === (exerciseitem === null || exerciseitem === void 0 ? void 0 : exerciseitem.exercise_question_types.length) - 1)) {
_context7.next = 2;
break;
}
return _context7.abrupt("return");
case 2:
if (!handleIsEdit()) {
_context7.next = 4;
break;
}
return _context7.abrupt("return");
case 4:
arr = (0,utils_util/* moveArray */.rz)(exerciseitem === null || exerciseitem === void 0 ? void 0 : exerciseitem.exercise_question_types, index, index + 1);
_context7.next = 7;
return sort_question_show(arr.map(function (item) {
return item.name;
}));
case 7:
case "end":
return _context7.stop();
}
}, _callee7);
})),
children: /*#__PURE__*/(0,jsx_runtime.jsx)("span", {
className: EditPotinmodules.moreSpan,
children: "\u4E0B\u79FB"
})
}, "2"), /*#__PURE__*/(0,jsx_runtime.jsx)(menu/* default */.Z.Item, {
onClick: function onClick() {
var _questionType$find;
form.setFieldsValue({
name: values.name,
item_type_en: (_questionType$find = EditPotin_questionType.find(function (item) {
return item.id == values.question_type;
})) === null || _questionType$find === void 0 ? void 0 : _questionType$find.nameType
});
setIsOpenEditName(true);
},
children: /*#__PURE__*/(0,jsx_runtime.jsx)("span", {
className: EditPotinmodules.moreSpan,
children: "\u91CD\u547D\u540D"
})
}, "3")]
});
};
return /*#__PURE__*/(0,jsx_runtime.jsxs)("div", {
children: [/*#__PURE__*/(0,jsx_runtime.jsx)(spin/* default */.Z, {
spinning: rightloading,
children: /*#__PURE__*/(0,jsx_runtime.jsx)("div", {
className: EditPotinmodules.bg,
children: /*#__PURE__*/(0,jsx_runtime.jsxs)("div", {
style: {
textAlign: 'center'
},
children: [(exerciseitem === null || exerciseitem === void 0 || (_exerciseitem$exercis = exerciseitem.exercise_types) === null || _exerciseitem$exercis === void 0 ? void 0 : _exerciseitem$exercis.q_counts) === 0 && !isedit && /*#__PURE__*/(0,jsx_runtime.jsx)(NoData/* default */.Z, {
customText: "\u8FD8\u6CA1\u6709\u8BD5\u9898\uFF0C\u4ECE\u5E95\u90E8\u64CD\u4F5C\u680F\u6765\u6DFB\u52A0\u5427\uFF5E"
}), ((exerciseitem === null || exerciseitem === void 0 || (_exerciseitem$exercis2 = exerciseitem.exercise_types) === null || _exerciseitem$exercis2 === void 0 ? void 0 : _exerciseitem$exercis2.q_counts) > 0 || isedit) && /*#__PURE__*/(0,jsx_runtime.jsxs)("div", {
style: {
marginTop: 20,
borderTop: '1px solid #DCDCDC',
display: 'block',
alignItems: 'stretch'
},
children: [/*#__PURE__*/(0,jsx_runtime.jsx)("div", {
style: {
backgroundColor: '#F6F7F9',
display: "inline-block",
position: "sticky",
top: 0
},
children: /*#__PURE__*/(0,jsx_runtime.jsx)(skeleton/* default */.Z, {
className: EditPotinmodules.left,
active: true,
loading: isloading,
children: /*#__PURE__*/(0,jsx_runtime.jsxs)("div", {
className: EditPotinmodules.left,
children: [/*#__PURE__*/(0,jsx_runtime.jsx)(es_button/* default */.ZP, {
onClick: function onClick() {
if (handleIsEdit()) return;
setScoreShow(true);
},
className: EditPotinmodules.Button,
children: "\u6279\u91CF\u8BBE\u7F6E\u5206\u503C"
}), /*#__PURE__*/(0,jsx_runtime.jsx)("div", {
className: EditPotinmodules.scrollWrapper,
style: {
overflow: overflow
},
onMouseEnter: handleMouseEnter,
onMouseLeave: handleMouseLeave,
children: exerciseitem === null || exerciseitem === void 0 || (_exerciseitem$exercis3 = exerciseitem.exercise_question_types) === null || _exerciseitem$exercis3 === void 0 ? void 0 : _exerciseitem$exercis3.map(function (item, index) {
return /*#__PURE__*/(0,jsx_runtime.jsxs)("div", {
className: "mb30",
children: [/*#__PURE__*/(0,jsx_runtime.jsxs)("div", {
className: EditPotinmodules.title,
children: [/*#__PURE__*/(0,jsx_runtime.jsxs)("div", {
className: EditPotinmodules.titleleft,
children: [/*#__PURE__*/(0,jsx_runtime.jsxs)("span", {
style: {
color: '#000000',
fontWeight: 400,
fontSize: 12
},
children: [" ", (0,utils_util/* toChineseNumber */.EM)(index + 1), "\u3001\u3010", item.name, "\u3011"]
}), /*#__PURE__*/(0,jsx_runtime.jsxs)("span", {
style: {
color: '#464F66',
fontSize: 12
},
children: ["\uFF08", item.count, "\u5C0F\u9898\uFF0C\u5171", item.score, "\u5206\uFF09"]
})]
}), /*#__PURE__*/(0,jsx_runtime.jsx)(dropdown/* default */.Z, {
dropdownRender: function dropdownRender() {
return exportMenu(item, index);
},
placement: "bottomLeft",
children: /*#__PURE__*/(0,jsx_runtime.jsx)("div", {
className: EditPotinmodules.more_style,
children: /*#__PURE__*/(0,jsx_runtime.jsx)("i", {
className: "iconfont icon-sandian font12"
})
})
})]
}), /*#__PURE__*/(0,jsx_runtime.jsx)(LeftItems, {
isedit: isedit,
setBigqitem: setBigqitem,
bigitem: objectSpread2_default()(objectSpread2_default()({}, item), {}, {
indexs: index + 1
}),
setqitem: /*#__PURE__*/function () {
var _ref9 = asyncToGenerator_default()( /*#__PURE__*/regeneratorRuntime_default()().mark(function _callee8(v) {
var _refScore$current;
return regeneratorRuntime_default()().wrap(function _callee8$(_context8) {
while (1) switch (_context8.prev = _context8.next) {
case 0:
(_refScore$current = refScore.current) === null || _refScore$current === void 0 || _refScore$current.blur();
setqitem(v);
case 2:
case "end":
return _context8.stop();
}
}, _callee8);
}));
return function (_x11) {
return _ref9.apply(this, arguments);
};
}(),
qitem: qitem,
Itemid: itemid,
getdata: getdatas,
data: item.items
})]
}, index);
})
})]
})
})
}), /*#__PURE__*/(0,jsx_runtime.jsx)(skeleton/* default */.Z, {
className: EditPotinmodules.right,
active: true,
loading: rightloading,
children: /*#__PURE__*/(0,jsx_runtime.jsxs)("div", {
className: EditPotinmodules.right,
style: qitem !== null && qitem !== void 0 && qitem.isadd ? {
paddingTop: 0
} : {},
ref: rightDiv,
children: [!(qitem !== null && qitem !== void 0 && qitem.isadd) && /*#__PURE__*/(0,jsx_runtime.jsxs)("div", {
className: EditPotinmodules.title,
children: [/*#__PURE__*/(0,jsx_runtime.jsxs)("div", {
style: {
flex: 1
},
children: [/*#__PURE__*/(0,jsx_runtime.jsxs)("span", {
style: {
color: '#000000',
fontWeight: 600,
fontSize: 16
},
children: [" ", (Bigqitem === null || Bigqitem === void 0 ? void 0 : Bigqitem.indexs) && (0,utils_util/* toChineseNumber */.EM)(Bigqitem === null || Bigqitem === void 0 ? void 0 : Bigqitem.indexs), "\u3001\u3010", Bigqitem === null || Bigqitem === void 0 ? void 0 : Bigqitem.name, "\u3011"]
}), /*#__PURE__*/(0,jsx_runtime.jsxs)("span", {
style: {
color: '#464F66',
fontSize: 16,
fontWeight: 400
},
children: ["\uFF08", Bigqitem === null || Bigqitem === void 0 ? void 0 : Bigqitem.count, "\u5C0F\u9898\uFF0C\u5171", Bigqitem === null || Bigqitem === void 0 ? void 0 : Bigqitem.score, "\u5206\uFF09"]
})]
}), /*#__PURE__*/(0,jsx_runtime.jsxs)("div", {
style: {
display: 'flex',
alignItems: 'center'
},
children: [(qitem === null || qitem === void 0 ? void 0 : qitem.question_type) === 5 && !isedit && /*#__PURE__*/(0,jsx_runtime.jsxs)("a", {
className: EditPotinmodules.shixun,
href: "/shixuns/".concat(qitem === null || qitem === void 0 ? void 0 : qitem.shixun_identifier, "/challenges?exercise=true"),
target: "_blank",
children: [/*#__PURE__*/(0,jsx_runtime.jsx)("i", {
onClick: function onClick() {},
style: {
marginRight: 20
},
className: "iconfont icon-shixunkecheng mr5 "
}), "\u5B9E\u8BAD\u8BE6\u60C5"]
}), !isedit && [0, 1, 2, 4, 6].includes(qitem === null || qitem === void 0 ? void 0 : qitem.question_type) && /*#__PURE__*/(0,jsx_runtime.jsx)(es_form/* default */.Z.Item, {
label: "\u5206\u503C",
style: {
margin: '0 20px'
},
required: true,
children: /*#__PURE__*/(0,jsx_runtime.jsx)(input_number/* default */.Z, {
precision: 1,
ref: refScore,
onChange: function onChange(v) {
return setScore(v);
},
value: score,
onBlur: function onBlur(v) {
handleScore(v.target.value, qitem);
}
})
}), !isedit && /*#__PURE__*/(0,jsx_runtime.jsx)("i", {
onClick: function onClick() {
//如果删除直接进行更新
deleteitem();
},
style: {
marginRight: 20
},
className: "".concat(EditPotinmodules["delete"], " iconfont icon-shanchu13 mr5 ")
}), !isedit && /*#__PURE__*/(0,jsx_runtime.jsx)("i", {
onClick: function onClick() {
if ((qitem === null || qitem === void 0 ? void 0 : qitem.question_type) === 6) {
if (searchParams.get('pageType') == 'course') {
if (searchParams.get('updateType') == 'course') {
var _exerciseitem$exercis4;
_umi_production_exports.history.push("/problems/newedit/".concat(qitem === null || qitem === void 0 ? void 0 : qitem.hack_identifier, "?type=exercises&express_id=").concat(exerciseitem === null || exerciseitem === void 0 || (_exerciseitem$exercis4 = exerciseitem.exercise) === null || _exerciseitem$exercis4 === void 0 ? void 0 : _exerciseitem$exercis4.id, "&question_id=").concat(qitem === null || qitem === void 0 ? void 0 : qitem.question_id, "&score=").concat(qitem === null || qitem === void 0 ? void 0 : qitem.question_score, "&exercise=true&callback_url=").concat(location.pathname, "?type=2&pageType=course&updateType=course&courseId=").concat(searchParams.get('courseId'), "&stageId=").concat(searchParams.get('stageId')));
} else {
var _exerciseitem$exercis5;
_umi_production_exports.history.push("/problems/newedit/".concat(qitem === null || qitem === void 0 ? void 0 : qitem.hack_identifier, "?type=exercises&express_id=").concat(exerciseitem === null || exerciseitem === void 0 || (_exerciseitem$exercis5 = exerciseitem.exercise) === null || _exerciseitem$exercis5 === void 0 ? void 0 : _exerciseitem$exercis5.id, "&question_id=").concat(qitem === null || qitem === void 0 ? void 0 : qitem.question_id, "&score=").concat(qitem === null || qitem === void 0 ? void 0 : qitem.question_score, "&exercise=true&callback_url=").concat(location.pathname, "?type=2&pageType=course&courseId=").concat(searchParams.get('courseId'), "&stageId=").concat(searchParams.get('stageId')));
}
} else {
var _exerciseitem$exercis6;
_umi_production_exports.history.push("/problems/newedit/".concat(qitem === null || qitem === void 0 ? void 0 : qitem.hack_identifier, "?type=exercises&express_id=").concat(exerciseitem === null || exerciseitem === void 0 || (_exerciseitem$exercis6 = exerciseitem.exercise) === null || _exerciseitem$exercis6 === void 0 ? void 0 : _exerciseitem$exercis6.id, "&question_id=").concat(qitem === null || qitem === void 0 ? void 0 : qitem.question_id, "&score=").concat(qitem === null || qitem === void 0 ? void 0 : qitem.question_score, "&exercise=true&callback_url=").concat(location.pathname, "$?type=2"));
}
} else {
setisedit(true);
}
},
className: "".concat(EditPotinmodules.edit, " iconfont icon-bianji_Hover mr5 ")
})]
})]
}), !isedit && /*#__PURE__*/(0,jsx_runtime.jsxs)("div", {
children: [/*#__PURE__*/(0,jsx_runtime.jsxs)("div", {
className: EditPotinmodules.qcount,
children: [/*#__PURE__*/(0,jsx_runtime.jsxs)("span", {
className: EditPotinmodules.score,
children: [qitem === null || qitem === void 0 ? void 0 : qitem.question_score, "\u5206"]
}), /*#__PURE__*/(0,jsx_runtime.jsx)(RenderHtml/* default */.Z, {
className: EditPotinmodules.qtitle,
value: (qitem === null || qitem === void 0 ? void 0 : qitem.index) + '、' + "".concat((qitem === null || qitem === void 0 ? void 0 : qitem.question_type) == 8 ? qitem === null || qitem === void 0 || (_qitem$program_attr = qitem.program_attr) === null || _qitem$program_attr === void 0 ? void 0 : _qitem$program_attr.description : qitem === null || qitem === void 0 ? void 0 : qitem.question_title)
})]
}), /*#__PURE__*/(0,jsx_runtime.jsx)(SaveItem, {
TagDiscipline: TagDiscipline,
qitem: qitem
})]
}), isedit && /*#__PURE__*/(0,jsx_runtime.jsxs)("div", {
children: [(qitem === null || qitem === void 0 ? void 0 : qitem.question_type) <= 1 && /*#__PURE__*/(0,jsx_runtime.jsx)(SingleEditor, {
getTagData: getTagData,
deleteitem: deleteitem,
seveeditor: seveeditor,
exerciseitem: exerciseitem,
TagDiscipline: TagDiscipline,
setisedit: setisedit,
qitem: qitem,
init: init
}), (qitem === null || qitem === void 0 ? void 0 : qitem.question_type) === 5 && /*#__PURE__*/(0,jsx_runtime.jsx)(ShixunEditor, {
setqitem: setqitem,
deleteitem: deleteitem,
seveeditor: seveeditor,
exerciseitem: exerciseitem,
TagDiscipline: TagDiscipline,
setisedit: setisedit,
qitem: qitem
}), (qitem === null || qitem === void 0 ? void 0 : qitem.question_type) === 3 && /*#__PURE__*/(0,jsx_runtime.jsx)(CombinationEditor, {
getTagData: getTagData,
deleteitem: deleteitem,
seveeditor: seveeditor,
exerciseitem: exerciseitem,
TagDiscipline: TagDiscipline,
setisedit: setisedit,
qitem: qitem,
init: init
}), (qitem === null || qitem === void 0 ? void 0 : qitem.question_type) === 2 && /*#__PURE__*/(0,jsx_runtime.jsx)(Questions_JudgmentQuestionEditor, {
getTagData: getTagData,
deleteitem: deleteitem,
seveeditor: seveeditor,
exerciseitem: exerciseitem,
TagDiscipline: TagDiscipline,
setisedit: setisedit,
qitem: qitem,
init: init
}), (qitem === null || qitem === void 0 ? void 0 : qitem.question_type) === 4 && /*#__PURE__*/(0,jsx_runtime.jsx)(Questions_SubjectiveQuestionEditor, {
getTagData: getTagData,
deleteitem: deleteitem,
seveeditor: seveeditor,
exerciseitem: exerciseitem,
TagDiscipline: TagDiscipline,
setisedit: setisedit,
qitem: qitem,
init: init
}), (qitem === null || qitem === void 0 ? void 0 : qitem.question_type) === 7 && /*#__PURE__*/(0,jsx_runtime.jsx)(Questions_CombinationQuestionEditor, {
getTagData: getTagData,
deleteitem: deleteitem,
seveeditor: seveeditor,
exerciseitem: exerciseitem,
TagDiscipline: TagDiscipline,
setisedit: setisedit,
qitem: qitem,
init: init
}), (qitem === null || qitem === void 0 ? void 0 : qitem.question_type) === 8 && /*#__PURE__*/(0,jsx_runtime.jsx)(Questions_BProgramEditor, {
getTagData: getTagData,
deleteitem: deleteitem,
seveeditor: seveeditor,
exerciseitem: exerciseitem,
TagDiscipline: TagDiscipline,
setisedit: setisedit,
qitem: qitem,
init: init
})]
})]
})
})]
})]
})
})
}), /*#__PURE__*/(0,jsx_runtime.jsx)("div", {
className: EditPotinmodules.bottomdiv,
children: /*#__PURE__*/(0,jsx_runtime.jsxs)("div", {
style: {
width: 1200,
margin: '0px auto',
display: 'flex',
justifyContent: 'space-between',
alignItems: 'center'
},
children: [/*#__PURE__*/(0,jsx_runtime.jsx)("span", {
className: EditPotinmodules.spanBtn,
onClick: function onClick() {
if (handleIsEdit()) return;
setshowquestion(true);
setisshixun(false);
},
children: "\u9898\u5E93\u9009\u9898"
}), /*#__PURE__*/(0,jsx_runtime.jsx)("span", {
className: EditPotinmodules.spanBtn,
onClick: function onClick() {
if (handleIsEdit()) return;
setUploadModalVisible(true);
},
children: "\u5BFC\u5165\u8BD5\u9898"
}), /*#__PURE__*/(0,jsx_runtime.jsx)("span", {
className: EditPotinmodules.spanBtn,
onClick: /*#__PURE__*/asyncToGenerator_default()( /*#__PURE__*/regeneratorRuntime_default()().mark(function _callee9() {
var res, _user$userInfo;
return regeneratorRuntime_default()().wrap(function _callee9$(_context9) {
while (1) switch (_context9.prev = _context9.next) {
case 0:
if (!handleIsEdit()) {
_context9.next = 2;
break;
}
return _context9.abrupt("return");
case 2:
_context9.next = 4;
return (0,paperlibrary/* generateExerciseId */.JP)(itemid);
case 4:
res = _context9.sent;
if (res.status === 0) {
window.open("/classrooms/coursesId/exercise/".concat(res.exercise_id, "/").concat((_user$userInfo = user.userInfo) === null || _user$userInfo === void 0 ? void 0 : _user$userInfo.login, "/initate_answer"));
}
case 6:
case "end":
return _context9.stop();
}
}, _callee9);
})),
children: "\u6A21\u62DF\u8003\u8BD5"
}), /*#__PURE__*/(0,jsx_runtime.jsx)("span", {
className: EditPotinmodules.spanBtn,
onClick: function onClick() {
if (handleIsEdit()) return;
window.open("/paperlibrary/see/".concat(itemid));
},
children: "\u8BD5\u5377\u9884\u89C8"
}), EditPotin_questionType === null || EditPotin_questionType === void 0 ? void 0 : EditPotin_questionType.map(function (item, k) {
return /*#__PURE__*/(0,jsx_runtime.jsx)(es_button/* default */.ZP, {
className: EditPotinmodules.addQuestionBtn,
type: "primary",
onClick: function onClick() {
if (handleIsEdit()) return;
if (item.id === 5) {
setshowquestion(true);
setisshixun(true);
return;
}
if (item.id === 6) {
// history.push(`/problems/newcreate?difficult=${exerciseitem?.exercise?.difficulty}&sub_discipline_id=${exerciseitem?.exercise?.sub_discipline_id}&express_id=${exerciseitem?.exercise?.id}&callback_url=/paperlibrary/add/${exerciseitem?.exercise?.id}?type=2`)
if (searchParams.get('pageType') == 'course') {
if (searchParams.get('updateType') == 'course') {
var _exerciseitem$exercis7, _exerciseitem$exercis8, _exerciseitem$exercis9, _exerciseitem$exercis10;
_umi_production_exports.history.push("/problems/newcreate?difficult=".concat(exerciseitem === null || exerciseitem === void 0 || (_exerciseitem$exercis7 = exerciseitem.exercise) === null || _exerciseitem$exercis7 === void 0 ? void 0 : _exerciseitem$exercis7.difficulty, "&sub_discipline_id=").concat(exerciseitem === null || exerciseitem === void 0 || (_exerciseitem$exercis8 = exerciseitem.exercise) === null || _exerciseitem$exercis8 === void 0 ? void 0 : _exerciseitem$exercis8.sub_discipline_id, "&express_id=").concat(exerciseitem === null || exerciseitem === void 0 || (_exerciseitem$exercis9 = exerciseitem.exercise) === null || _exerciseitem$exercis9 === void 0 ? void 0 : _exerciseitem$exercis9.id, "&callback_url=/paperlibrary/add/").concat(exerciseitem === null || exerciseitem === void 0 || (_exerciseitem$exercis10 = exerciseitem.exercise) === null || _exerciseitem$exercis10 === void 0 ? void 0 : _exerciseitem$exercis10.id, "?type=2&pageType=course&updateType=course&courseId=").concat(searchParams.get('courseId'), "&stageId=").concat(searchParams.get('stageId')));
} else {
var _exerciseitem$exercis11, _exerciseitem$exercis12, _exerciseitem$exercis13, _exerciseitem$exercis14;
_umi_production_exports.history.push("/problems/newcreate?difficult=".concat(exerciseitem === null || exerciseitem === void 0 || (_exerciseitem$exercis11 = exerciseitem.exercise) === null || _exerciseitem$exercis11 === void 0 ? void 0 : _exerciseitem$exercis11.difficulty, "&sub_discipline_id=").concat(exerciseitem === null || exerciseitem === void 0 || (_exerciseitem$exercis12 = exerciseitem.exercise) === null || _exerciseitem$exercis12 === void 0 ? void 0 : _exerciseitem$exercis12.sub_discipline_id, "&express_id=").concat(exerciseitem === null || exerciseitem === void 0 || (_exerciseitem$exercis13 = exerciseitem.exercise) === null || _exerciseitem$exercis13 === void 0 ? void 0 : _exerciseitem$exercis13.id, "&callback_url=/paperlibrary/add/").concat(exerciseitem === null || exerciseitem === void 0 || (_exerciseitem$exercis14 = exerciseitem.exercise) === null || _exerciseitem$exercis14 === void 0 ? void 0 : _exerciseitem$exercis14.id, "?type=2&pageType=course&courseId=").concat(searchParams.get('courseId'), "&stageId=").concat(searchParams.get('stageId')));
}
} else {
var _exerciseitem$exercis15, _exerciseitem$exercis16, _exerciseitem$exercis17, _exerciseitem$exercis18;
_umi_production_exports.history.push("/problems/newcreate?difficult=".concat(exerciseitem === null || exerciseitem === void 0 || (_exerciseitem$exercis15 = exerciseitem.exercise) === null || _exerciseitem$exercis15 === void 0 ? void 0 : _exerciseitem$exercis15.difficulty, "&sub_discipline_id=").concat(exerciseitem === null || exerciseitem === void 0 || (_exerciseitem$exercis16 = exerciseitem.exercise) === null || _exerciseitem$exercis16 === void 0 ? void 0 : _exerciseitem$exercis16.sub_discipline_id, "&express_id=").concat(exerciseitem === null || exerciseitem === void 0 || (_exerciseitem$exercis17 = exerciseitem.exercise) === null || _exerciseitem$exercis17 === void 0 ? void 0 : _exerciseitem$exercis17.id, "&callback_url=/paperlibrary/add/").concat(exerciseitem === null || exerciseitem === void 0 || (_exerciseitem$exercis18 = exerciseitem.exercise) === null || _exerciseitem$exercis18 === void 0 ? void 0 : _exerciseitem$exercis18.id, "?type=2"));
}
return;
}
setisedit(true);
if (item.id === 2) {
setqitem({
question_type: item.id,
isadd: true,
repeat_answer: true,
choices: [{
choice_text: '正确',
is_answer: 0
}, {
choice_text: '错误',
is_answer: 0
}],
question_choices: [{
choice_text: '正确',
is_answer: 0
}, {
choice_text: '错误',
is_answer: 0
}],
difficulty: 2,
standard_answers: [],
question_score: '',
tag_discipline_ids: '',
question_title: '',
analysis: ''
});
} else {
setqitem({
question_type: item.id,
question_choices: Array.from({
length: 4
}, function () {
return {
choice_text: '',
is_answer: 0
};
}),
standard_answers: [],
repeat_answer: true,
difficulty: 2,
isadd: true,
tag_discipline_ids: '',
question_score: '',
analysis: '',
sub_item_banks: [],
question_title: '',
is_ordered: true,
use_keywords: false,
use_blank_score: true,
keywords: [],
allow_student_debug: false,
submit_rule: 1
});
}
},
children: item.name
}, k);
}), /*#__PURE__*/(0,jsx_runtime.jsxs)("span", {
className: EditPotinmodules.saveBtn,
onClick: function onClick() {
if (searchParams.get('pageType') == 'course') {
if (searchParams.get('updateType') == 'course') {
message/* default */.ZP.info('编辑成功');
_umi_production_exports.history.replace("/paths/".concat(searchParams.get('courseId')));
} else {
if (handleIsEdit()) return;
(0,paths/* batchAddHomeworkToStage */._C)({
id: searchParams.get('stageId'),
subject_id: searchParams.get('courseId'),
homework_type: 'exercise',
examination_bank_ids: [itemid]
}).then(function (res) {
if ((res === null || res === void 0 ? void 0 : res.status) == 0) {
message/* default */.ZP.info('创建成功');
_umi_production_exports.history.replace("/paths/".concat(searchParams.get('courseId')));
}
});
}
} else {
if (handleIsEdit()) return;
message/* default */.ZP.info('创建成功');
window.open("/paperlibrary?defaultActiveKey=0");
}
},
children: [/*#__PURE__*/(0,jsx_runtime.jsx)("i", {
className: "iconfont icon-baocun1",
style: {
fontSize: 15,
marginRight: 5
}
}), "\u4FDD\u5B58\u8BD5\u5377"]
})]
})
}), /*#__PURE__*/(0,jsx_runtime.jsx)(Setscore, {
setScoreShow: setScoreShow,
ScoreShow: ScoreShow,
exerciseitem: exerciseitem,
getdata: init
}), showquestion && /*#__PURE__*/(0,jsx_runtime.jsx)(AddQuestionsModal, {
setScoreShow: setshowquestion,
isshixuns: isshixun,
ScoreShow: showquestion,
isloadings: isloadings,
onOk: /*#__PURE__*/function () {
var _ref11 = asyncToGenerator_default()( /*#__PURE__*/regeneratorRuntime_default()().mark(function _callee11(questionIdArr, shixunIdArr, ischeck_only, listitems_length) {
var params, res;
return regeneratorRuntime_default()().wrap(function _callee11$(_context11) {
while (1) switch (_context11.prev = _context11.next) {
case 0:
setisloadings(true);
params = {
exam_id: itemid,
item_bank_ids: questionIdArr,
shixun_ids: shixunIdArr
};
_context11.next = 4;
return addquestion(objectSpread2_default()(objectSpread2_default()({}, params), {}, {
check_only: ischeck_only
}));
case 4:
res = _context11.sent;
setisloadings(false);
if (!((res === null || res === void 0 ? void 0 : res.status) === 0)) {
_context11.next = 14;
break;
}
_context11.next = 9;
return addquestion(params);
case 9:
setshowquestion(false);
init();
message/* default */.ZP.info('添加成功');
_context11.next = 15;
break;
case 14:
if (res.status === -4) {
modal/* default */.Z.confirm({
title: '提示',
content: "\u5F53\u524D\u5DF2\u9009\u62E9".concat(listitems_length, "\u9053\u8BD5\u9898\uFF0C\u5DF2\u52A0\u5165\u8FC7\u7684\u8BD5\u9898\u5C06\u4E0D\u4F1A\u91CD\u590D\u52A0\u5165"),
onOk: function () {
var _onOk = asyncToGenerator_default()( /*#__PURE__*/regeneratorRuntime_default()().mark(function _callee10() {
return regeneratorRuntime_default()().wrap(function _callee10$(_context10) {
while (1) switch (_context10.prev = _context10.next) {
case 0:
_context10.next = 2;
return addquestion(params);
case 2:
setshowquestion(false);
init();
message/* default */.ZP.info('添加成功');
case 5:
case "end":
return _context10.stop();
}
}, _callee10);
}));
function onOk() {
return _onOk.apply(this, arguments);
}
return onOk;
}()
});
}
case 15:
case "end":
return _context11.stop();
}
}, _callee11);
}));
return function (_x12, _x13, _x14, _x15) {
return _ref11.apply(this, arguments);
};
}()
}), /*#__PURE__*/(0,jsx_runtime.jsx)(UploadQuestions/* default */.Z, {
visible: uploadModalVisible,
onCancel: function onCancel() {
return setUploadModalVisible(false);
},
onOk: handleOk
}), /*#__PURE__*/(0,jsx_runtime.jsx)(modal/* default */.Z, {
centered: true,
title: "\u7F16\u8F91\u9898\u578B\u540D\u79F0",
open: isOpenEditName,
width: 500,
onOk: function onOk() {
return form.submit();
},
onCancel: function onCancel() {
return setIsOpenEditName(false);
},
children: /*#__PURE__*/(0,jsx_runtime.jsxs)(es_form/* default */.Z, {
form: form,
initialValues: {},
onFinish: /*#__PURE__*/function () {
var _ref12 = asyncToGenerator_default()( /*#__PURE__*/regeneratorRuntime_default()().mark(function _callee12(values) {
var res;
return regeneratorRuntime_default()().wrap(function _callee12$(_context12) {
while (1) switch (_context12.prev = _context12.next) {
case 0:
_context12.next = 2;
return (0,paperlibrary/* getEditQuestionTypeAlias */.RK)(objectSpread2_default()({
id: itemid
}, values));
case 2:
res = _context12.sent;
if (res.status == 0) {
message/* default */.ZP.success("修改成功");
init();
setIsOpenEditName(false);
}
case 4:
case "end":
return _context12.stop();
}
}, _callee12);
}));
return function (_x16) {
return _ref12.apply(this, arguments);
};
}(),
children: [/*#__PURE__*/(0,jsx_runtime.jsx)(es_form/* default */.Z.Item, {
style: {
marginBottom: 0
},
name: "name",
rules: [{
required: true,
message: '请输入题型名称'
}, {
whitespace: true,
message: '请勿输入空格'
}],
children: /*#__PURE__*/(0,jsx_runtime.jsx)(input/* default */.Z, {
size: "large",
maxLength: 6,
showCount: true
})
}), /*#__PURE__*/(0,jsx_runtime.jsx)(es_form/* default */.Z.Item, {
hidden: true,
name: "item_type_en",
children: /*#__PURE__*/(0,jsx_runtime.jsx)(input/* default */.Z, {
size: "large"
})
})]
})
})]
});
};
/* harmony default export */ var EditPotin = ((0,_umi_production_exports.connect)(function (_ref13) {
var user = _ref13.user,
dispatch = _ref13.dispatch;
return {
user: user,
dispatch: dispatch
};
})(AddNewPaper));
// EXTERNAL MODULE: ./src/components/DigitalLabel/index.tsx + 1 modules
var DigitalLabel = __webpack_require__(29059);
// EXTERNAL MODULE: ./src/pages/Paperlibrary/Add/TitleEditor.tsx
var TitleEditor = __webpack_require__(16934);
;// CONCATENATED MODULE: ./src/pages/Paperlibrary/Add/index.tsx
// import AddPoints from '@/components/AddPoints';
var useCourseOptions = function useCourseOptions() {
var _useState = (0,_react_17_0_2_react.useState)([]),
_useState2 = slicedToArray_default()(_useState, 2),
courseOptions = _useState2[0],
setCourseOptions = _useState2[1];
(0,_react_17_0_2_react.useEffect)(function () {
var getCourseOptions = /*#__PURE__*/function () {
var _ref = asyncToGenerator_default()( /*#__PURE__*/regeneratorRuntime_default()().mark(function _callee() {
var res;
return regeneratorRuntime_default()().wrap(function _callee$(_context) {
while (1) switch (_context.prev = _context.next) {
case 0:
_context.next = 2;
return (0,paperlibrary/* getDisciplines */.d1)({
source: 'question'
});
case 2:
res = _context.sent;
if (res !== null && res !== void 0 && res.disciplines) {
setCourseOptions((0,util/* formatCourseOptions */.L)(res === null || res === void 0 ? void 0 : res.disciplines));
}
case 4:
case "end":
return _context.stop();
}
}, _callee);
}));
return function getCourseOptions() {
return _ref.apply(this, arguments);
};
}();
getCourseOptions();
}, []);
return courseOptions;
};
var Add_AddNewPaper = function AddNewPaper(_ref2) {
var _newExercisePaper$edi, _newExercisePaper$edi8, _newExercisePaper$edi9, _newExercisePaper$edi10, _newExercisePaper$edi11, _newExercisePaper$edi12;
var user = _ref2.user,
newExercisePaper = _ref2.newExercisePaper,
dispatch = _ref2.dispatch;
var params = (0,_umi_production_exports.useParams)();
var courseOptions = useCourseOptions();
var _Form$useForm = es_form/* default */.Z.useForm(),
_Form$useForm2 = slicedToArray_default()(_Form$useForm, 1),
form = _Form$useForm2[0];
var _useState3 = (0,_react_17_0_2_react.useState)(),
_useState4 = slicedToArray_default()(_useState3, 2),
initValue = _useState4[0],
setInitValue = _useState4[1];
var _useState5 = (0,_react_17_0_2_react.useState)(false),
_useState6 = slicedToArray_default()(_useState5, 2),
loading = _useState6[0],
setLoading = _useState6[1];
var _useState7 = (0,_react_17_0_2_react.useState)(1),
_useState8 = slicedToArray_default()(_useState7, 2),
current = _useState8[0],
setcurrent = _useState8[1];
var _useState9 = (0,_react_17_0_2_react.useState)(''),
_useState10 = slicedToArray_default()(_useState9, 2),
itemid = _useState10[0],
setitemid = _useState10[1];
var _useSearchParams = (0,_umi_production_exports.useSearchParams)(),
_useSearchParams2 = slicedToArray_default()(_useSearchParams, 1),
searchParams = _useSearchParams2[0];
var _useState11 = (0,_react_17_0_2_react.useState)(false),
_useState12 = slicedToArray_default()(_useState11, 2),
isedit = _useState12[0],
setisedit = _useState12[1];
(0,_react_17_0_2_react.useEffect)(function () {
if (searchParams.get('type') === '2') {
setitemid(params.id);
setcurrent(2);
}
}, [searchParams.get('type')]);
(0,_react_17_0_2_react.useEffect)(function () {
if (params.id) {
//处理表单返填逻辑
if (!courseOptions.length) {
return;
}
var getData = /*#__PURE__*/function () {
var _ref3 = asyncToGenerator_default()( /*#__PURE__*/regeneratorRuntime_default()().mark(function _callee2() {
var _res$exercise, _res$exercise2;
var res, subDisciplineId, valueForCascader, _iterator, _step, item, _iterator2, _step2, option, time, formInitValue;
return regeneratorRuntime_default()().wrap(function _callee2$(_context2) {
while (1) switch (_context2.prev = _context2.next) {
case 0:
setLoading(true);
_context2.next = 3;
return (0,paperlibrary/* getExamDetail */.Di)({
id: params.id
});
case 3:
res = _context2.sent;
setLoading(false);
subDisciplineId = res === null || res === void 0 || (_res$exercise = res.exercise) === null || _res$exercise === void 0 ? void 0 : _res$exercise.sub_discipline_id;
valueForCascader = [];
_iterator = createForOfIteratorHelper_default()(courseOptions);
try {
for (_iterator.s(); !(_step = _iterator.n()).done;) {
item = _step.value;
_iterator2 = createForOfIteratorHelper_default()(item.children);
try {
for (_iterator2.s(); !(_step2 = _iterator2.n()).done;) {
option = _step2.value;
if (option.value === subDisciplineId) {
valueForCascader = [item.value, option.value];
}
}
} catch (err) {
_iterator2.e(err);
} finally {
_iterator2.f();
}
}
} catch (err) {
_iterator.e(err);
} finally {
_iterator.f();
}
time = res === null || res === void 0 || (_res$exercise2 = res.exercise) === null || _res$exercise2 === void 0 ? void 0 : _res$exercise2.time;
formInitValue = objectSpread2_default()(objectSpread2_default()({}, res.exercise), {}, {
sub_discipline_id: valueForCascader,
time: time === -1 ? null : time
});
setInitValue(formInitValue);
case 12:
case "end":
return _context2.stop();
}
}, _callee2);
}));
return function getData() {
return _ref3.apply(this, arguments);
};
}();
getData();
} else {
setInitValue({
time: 60,
difficulty: 2
});
}
dispatch({
type: 'globalSetting/footerToggle',
payload: false
});
}, [courseOptions]);
return /*#__PURE__*/(0,jsx_runtime.jsx)("div", {
style: {
background: '#ffffff',
marginTop: -8,
padding: 8,
minHeight: '100vh',
paddingBottom: 64
},
children: /*#__PURE__*/(0,jsx_runtime.jsxs)("section", {
className: "edu-container",
children: [/*#__PURE__*/(0,jsx_runtime.jsx)("section", {
className: "animated fadeIn",
children: /*#__PURE__*/(0,jsx_runtime.jsx)("aside", {
style: {
marginTop: 15
},
children: /*#__PURE__*/(0,jsx_runtime.jsxs)(breadcrumb/* default */.Z, {
separator: ">",
children: [/*#__PURE__*/(0,jsx_runtime.jsx)(breadcrumb/* default */.Z.Item, {
children: /*#__PURE__*/(0,jsx_runtime.jsx)(_umi_production_exports.Link, {
to: "/paperlibrary",
children: "\u8BD5\u5377\u5E93"
})
}), /*#__PURE__*/(0,jsx_runtime.jsx)(breadcrumb/* default */.Z.Item, {
children: "\u4EBA\u5DE5\u7EC4\u5377"
})]
})
})
}), /*#__PURE__*/(0,jsx_runtime.jsxs)("div", {
className: "bg-white",
children: [/*#__PURE__*/(0,jsx_runtime.jsxs)("div", {
style: {
display: 'flex',
justifyContent: 'center',
paddingTop: 20,
alignItems: 'center'
},
children: [/*#__PURE__*/(0,jsx_runtime.jsxs)("div", {
onClick: function onClick() {
if (isedit) {
message/* default */.ZP.info('请先保存或取消当前正在编辑的试题。');
return;
}
setcurrent(1);
},
className: current === 1 ? Addmodules/* default */.Z.selectdiv : Addmodules/* default */.Z.divitem,
children: [/*#__PURE__*/(0,jsx_runtime.jsx)(DigitalLabel/* default */.Z, {
number: 1,
active: current === 1,
className: "mr10"
}), /*#__PURE__*/(0,jsx_runtime.jsx)("span", {
children: "\u8BD5\u5377\u57FA\u7840\u4FE1\u606F"
})]
}), /*#__PURE__*/(0,jsx_runtime.jsx)("div", {
style: {
width: 188,
border: '1px dotted #9096A3',
margin: '0px 30px',
height: 1
}
}), /*#__PURE__*/(0,jsx_runtime.jsxs)("div", {
onClick: function onClick() {
if (!params.id && !itemid) {
message/* default */.ZP.info('请先保存基础信息再新建试题');
return;
}
setcurrent(2);
if (itemid) {
return;
}
setitemid(params.id);
},
className: current !== 1 ? Addmodules/* default */.Z.selectdiv : Addmodules/* default */.Z.divitem,
children: [/*#__PURE__*/(0,jsx_runtime.jsx)(DigitalLabel/* default */.Z, {
number: 2,
active: current !== 1,
className: "mr10"
}), /*#__PURE__*/(0,jsx_runtime.jsx)("span", {
children: "\u7F16\u8F91\u8BD5\u9898"
})]
})]
}), current === 2 && /*#__PURE__*/(0,jsx_runtime.jsxs)("div", {
className: "tc",
children: [/*#__PURE__*/(0,jsx_runtime.jsx)(TitleEditor/* default */.Z, {
defaultValue: newExercisePaper === null || newExercisePaper === void 0 || (_newExercisePaper$edi = newExercisePaper.editData) === null || _newExercisePaper$edi === void 0 || (_newExercisePaper$edi = _newExercisePaper$edi.exercise) === null || _newExercisePaper$edi === void 0 ? void 0 : _newExercisePaper$edi.exercise_name,
onFinish: /*#__PURE__*/function () {
var _ref4 = asyncToGenerator_default()( /*#__PURE__*/regeneratorRuntime_default()().mark(function _callee3(newTitle) {
var _newExercisePaper$edi2, _newExercisePaper$edi3, _newExercisePaper$edi4, _newExercisePaper$edi5, _newExercisePaper$edi6, _newExercisePaper$edi7;
var res;
return regeneratorRuntime_default()().wrap(function _callee3$(_context3) {
while (1) switch (_context3.prev = _context3.next) {
case 0:
if (!(newTitle.trim() === (newExercisePaper === null || newExercisePaper === void 0 || (_newExercisePaper$edi2 = newExercisePaper.editData) === null || _newExercisePaper$edi2 === void 0 || (_newExercisePaper$edi2 = _newExercisePaper$edi2.exercise) === null || _newExercisePaper$edi2 === void 0 ? void 0 : _newExercisePaper$edi2.exercise_name))) {
_context3.next = 2;
break;
}
return _context3.abrupt("return", true);
case 2:
_context3.next = 4;
return (0,paperlibrary/* updateExam */.w0)({
id: "".concat(newExercisePaper === null || newExercisePaper === void 0 || (_newExercisePaper$edi3 = newExercisePaper.editData) === null || _newExercisePaper$edi3 === void 0 || (_newExercisePaper$edi3 = _newExercisePaper$edi3.exercise) === null || _newExercisePaper$edi3 === void 0 ? void 0 : _newExercisePaper$edi3.id),
sub_discipline_id: newExercisePaper === null || newExercisePaper === void 0 || (_newExercisePaper$edi4 = newExercisePaper.editData) === null || _newExercisePaper$edi4 === void 0 || (_newExercisePaper$edi4 = _newExercisePaper$edi4.exercise) === null || _newExercisePaper$edi4 === void 0 ? void 0 : _newExercisePaper$edi4.sub_discipline_id,
time: "".concat(newExercisePaper === null || newExercisePaper === void 0 || (_newExercisePaper$edi5 = newExercisePaper.editData) === null || _newExercisePaper$edi5 === void 0 || (_newExercisePaper$edi5 = _newExercisePaper$edi5.exercise) === null || _newExercisePaper$edi5 === void 0 ? void 0 : _newExercisePaper$edi5.time),
exercise_name: newTitle,
exercise_description: newExercisePaper === null || newExercisePaper === void 0 || (_newExercisePaper$edi6 = newExercisePaper.editData) === null || _newExercisePaper$edi6 === void 0 || (_newExercisePaper$edi6 = _newExercisePaper$edi6.exercise) === null || _newExercisePaper$edi6 === void 0 ? void 0 : _newExercisePaper$edi6.exercise_description,
difficulty: newExercisePaper === null || newExercisePaper === void 0 || (_newExercisePaper$edi7 = newExercisePaper.editData) === null || _newExercisePaper$edi7 === void 0 || (_newExercisePaper$edi7 = _newExercisePaper$edi7.exercise) === null || _newExercisePaper$edi7 === void 0 ? void 0 : _newExercisePaper$edi7.difficulty
});
case 4:
res = _context3.sent;
if (!(res.status === 0)) {
_context3.next = 9;
break;
}
form.setFieldValue('exercise_name', newTitle);
//只是为了切换的时候不显示之前的标题
dispatch({
type: 'newExercisePaper/modifyTitle',
payload: newTitle
});
return _context3.abrupt("return", true);
case 9:
return _context3.abrupt("return", false);
case 10:
case "end":
return _context3.stop();
}
}, _callee3);
}));
return function (_x) {
return _ref4.apply(this, arguments);
};
}()
}), /*#__PURE__*/(0,jsx_runtime.jsxs)("div", {
style: {
fontSize: 14
},
children: [/*#__PURE__*/(0,jsx_runtime.jsxs)("span", {
style: {
color: '#5F6368'
},
children: ["\u7B54\u9898\u65F6\u957F", /*#__PURE__*/(0,jsx_runtime.jsx)("span", {
style: {
color: '#000000',
marginLeft: 8
},
children: newExercisePaper === null || newExercisePaper === void 0 || (_newExercisePaper$edi8 = newExercisePaper.editData) === null || _newExercisePaper$edi8 === void 0 || (_newExercisePaper$edi8 = _newExercisePaper$edi8.exercise) === null || _newExercisePaper$edi8 === void 0 ? void 0 : _newExercisePaper$edi8.time
})]
}), /*#__PURE__*/(0,jsx_runtime.jsxs)("span", {
style: {
margin: '0px 30px',
color: '#5F6368'
},
children: ["\u96BE\u5EA6", /*#__PURE__*/(0,jsx_runtime.jsx)("span", {
style: {
color: '#000000',
marginLeft: 8
},
children: (newExercisePaper === null || newExercisePaper === void 0 || (_newExercisePaper$edi9 = newExercisePaper.editData) === null || _newExercisePaper$edi9 === void 0 || (_newExercisePaper$edi9 = _newExercisePaper$edi9.exercise) === null || _newExercisePaper$edi9 === void 0 ? void 0 : _newExercisePaper$edi9.difficulty) === 1 ? '简单' : (newExercisePaper === null || newExercisePaper === void 0 || (_newExercisePaper$edi10 = newExercisePaper.editData) === null || _newExercisePaper$edi10 === void 0 || (_newExercisePaper$edi10 = _newExercisePaper$edi10.exercise) === null || _newExercisePaper$edi10 === void 0 ? void 0 : _newExercisePaper$edi10.difficulty) === 2 ? '适中' : '困难'
})]
}), /*#__PURE__*/(0,jsx_runtime.jsxs)("span", {
style: {
marginRight: 30,
color: '#5F6368'
},
children: ["\u8BD5\u9898\u603B\u6570", /*#__PURE__*/(0,jsx_runtime.jsx)("span", {
style: {
color: '#000000',
marginLeft: 8
},
children: (newExercisePaper === null || newExercisePaper === void 0 || (_newExercisePaper$edi11 = newExercisePaper.editData) === null || _newExercisePaper$edi11 === void 0 || (_newExercisePaper$edi11 = _newExercisePaper$edi11.exercise_types) === null || _newExercisePaper$edi11 === void 0 ? void 0 : _newExercisePaper$edi11.q_counts) || 0
})]
}), /*#__PURE__*/(0,jsx_runtime.jsxs)("span", {
style: {
color: '#5F6368'
},
children: ["\u603B\u5206", /*#__PURE__*/(0,jsx_runtime.jsx)("span", {
style: {
color: '#000000',
marginLeft: 8
},
children: newExercisePaper === null || newExercisePaper === void 0 || (_newExercisePaper$edi12 = newExercisePaper.editData) === null || _newExercisePaper$edi12 === void 0 || (_newExercisePaper$edi12 = _newExercisePaper$edi12.exercise_types) === null || _newExercisePaper$edi12 === void 0 ? void 0 : _newExercisePaper$edi12.q_scores
})]
})]
})]
})]
}), current === 1 && /*#__PURE__*/(0,jsx_runtime.jsxs)(spin/* default */.Z, {
spinning: loading,
size: 'middle',
style: {
position: 'fixed',
maxHeight: '100vh'
},
className: "mt30",
children: [/*#__PURE__*/(0,jsx_runtime.jsx)("section", {
className: [Addmodules/* default */.Z.bg, 'mt20'].join(' '),
style: {
padding: '30px 120px 300px 120px'
},
children: initValue && /*#__PURE__*/(0,jsx_runtime.jsxs)(es_form/* default */.Z, {
layout: "horizontal",
form: form,
colon: false,
labelCol: {
span: 4
},
wrapperCol: {
span: 20
},
className: Addmodules/* default */.Z.formWrap,
initialValues: initValue,
children: [/*#__PURE__*/(0,jsx_runtime.jsx)(es_form/* default */.Z.Item, {
name: "exercise_name",
label: "\u8BD5\u5377\u540D\u79F0",
className: Addmodules/* default */.Z.baseLineHeight,
rules: [{
required: true,
validator: function validator(_, value) {
var _value$replaceAll;
return (value === null || value === void 0 || (_value$replaceAll = value.replaceAll(' ', '')) === null || _value$replaceAll === void 0 ? void 0 : _value$replaceAll.length) > 0 ? Promise.resolve() : Promise.reject('请填写试卷标题');
}
}],
children: /*#__PURE__*/(0,jsx_runtime.jsx)(input/* default */.Z, {
maxLength: 60,
className: Addmodules/* default */.Z.baseFormItem,
placeholder: "\u8BF7\u8F93\u5165\u8BD5\u5377\u540D\u79F0",
showCount: true
})
}), /*#__PURE__*/(0,jsx_runtime.jsx)(es_form/* default */.Z.Item, {
label: '方向&课程',
name: "sub_discipline_id",
className: Addmodules/* default */.Z.baseLineHeight,
rules: [{
required: true,
message: '请选择课程'
}],
children: /*#__PURE__*/(0,jsx_runtime.jsx)(cascader/* default */.Z, {
className: Addmodules/* default */.Z.baseFormItem,
allowClear: false,
placeholder: "\u8BF7\u9009\u62E9\u65B9\u5411&\u8BFE\u7A0B",
options: courseOptions,
popupClassName: Addmodules/* default */.Z.cascaderPopup,
dropdownMenuColumnStyle: {
padding: '8px 12px',
fontSize: 14
}
})
}), /*#__PURE__*/(0,jsx_runtime.jsx)(es_form/* default */.Z.Item, {
label: "\u96BE\u5EA6",
name: "difficulty",
className: Addmodules/* default */.Z.radioBtnWrapper,
rules: [{
required: true,
message: '请选择难度'
}],
children: /*#__PURE__*/(0,jsx_runtime.jsxs)(es_radio/* default.Group */.ZP.Group, {
className: Addmodules/* default */.Z.radiogroup,
children: [/*#__PURE__*/(0,jsx_runtime.jsx)(es_radio/* default.Button */.ZP.Button, {
className: Addmodules/* default */.Z.easy,
value: 1,
children: "\u7B80\u5355"
}), /*#__PURE__*/(0,jsx_runtime.jsx)(es_radio/* default.Button */.ZP.Button, {
className: Addmodules/* default */.Z.medium,
value: 2,
children: "\u9002\u4E2D"
}), /*#__PURE__*/(0,jsx_runtime.jsx)(es_radio/* default.Button */.ZP.Button, {
className: Addmodules/* default */.Z.hard,
value: 3,
children: "\u56F0\u96BE"
})]
})
}), /*#__PURE__*/(0,jsx_runtime.jsx)(es_form/* default */.Z.Item, {
label: "\u7B54\u9898\u65F6\u957F",
className: Addmodules/* default */.Z.baseLineHeight,
children: /*#__PURE__*/(0,jsx_runtime.jsxs)("div", {
style: {
display: 'flex',
width: '100%'
},
children: [/*#__PURE__*/(0,jsx_runtime.jsx)(es_form/* default */.Z.Item, {
name: "time",
noStyle: true,
children: /*#__PURE__*/(0,jsx_runtime.jsx)(input_number/* default */.Z, {
min: 1,
className: Addmodules/* default */.Z.baseFormItem,
max: 9999,
style: {
width: 220
},
maxLength: 60,
placeholder: "\u8BF7\u586B\u5199\u7B54\u9898\u65F6\u957F"
})
}), /*#__PURE__*/(0,jsx_runtime.jsx)("span", {
style: {
marginLeft: '10px',
width: '40px',
lineHeight: '46px',
fontSize: 14
},
children: "\u5206\u949F"
})]
})
}), /*#__PURE__*/(0,jsx_runtime.jsx)(es_form/* default */.Z.Item, {
label: "\u8BD5\u5377\u987B\u77E5",
name: "exercise_description",
children: /*#__PURE__*/(0,jsx_runtime.jsx)(input/* default */.Z.TextArea, {
rows: 6,
maxLength: 65535,
placeholder: "\u8BF7\u5728\u6B64\u8F93\u5165\u672C\u6B21\u8BD5\u5377\u7B54\u9898\u7684\u76F8\u5173\u8BF4\u660E\uFF0C\u6700\u5927\u9650\u523665535\u4E2A\u5B57\u7B26"
})
})]
})
}), /*#__PURE__*/(0,jsx_runtime.jsxs)("div", {
className: Addmodules/* default */.Z.bottmodiv,
children: [/*#__PURE__*/(0,jsx_runtime.jsx)(es_button/* default */.ZP, {
className: "".concat(Addmodules/* default */.Z.cancelBtn, " mr5"),
type: "primary",
onClick: function onClick() {
if (searchParams.get('pageType') == 'course') {
_umi_production_exports.history.push("/paths/".concat(searchParams.get('courseId')));
} else {
_umi_production_exports.history.push("/paperlibrary");
}
},
children: "\u53D6\u6D88"
}), /*#__PURE__*/(0,jsx_runtime.jsx)(AsyncButton/* AsyncButton */.Z, {
className: "".concat(Addmodules/* default */.Z.confirmBtn, " ml15"),
type: "primary",
onClick: /*#__PURE__*/asyncToGenerator_default()( /*#__PURE__*/regeneratorRuntime_default()().mark(function _callee4() {
var formValue, _res, res, _res$data, _res$data2, _res$data3;
return regeneratorRuntime_default()().wrap(function _callee4$(_context4) {
while (1) switch (_context4.prev = _context4.next) {
case 0:
_context4.next = 2;
return form.validateFields();
case 2:
formValue = form.getFieldsValue(); //调用接口 获取是否要弹窗
formValue['sub_discipline_id'] = formValue['sub_discipline_id'][1];
// formValue['time'] = `${formValue.time}`
if (!params.id) {
_context4.next = 10;
break;
}
_context4.next = 7;
return (0,paperlibrary/* updateExam */.w0)(objectSpread2_default()({
id: params.id
}, formValue));
case 7:
_res = _context4.sent;
if (_res.status === 0) {
setitemid(params.id);
setcurrent(2);
_umi_production_exports.history.replace("/paperlibrary/add/".concat(params.id, "?type=2"));
}
return _context4.abrupt("return");
case 10:
_context4.next = 12;
return (0,paperlibrary/* createExam */.un)(formValue);
case 12:
res = _context4.sent;
if (res.status === 0) {
setitemid(res === null || res === void 0 || (_res$data = res.data) === null || _res$data === void 0 ? void 0 : _res$data.exam_id);
setcurrent(2);
if (searchParams.get('pageType') == 'course') {
_umi_production_exports.history.replace("/paperlibrary/add/".concat(res === null || res === void 0 || (_res$data2 = res.data) === null || _res$data2 === void 0 ? void 0 : _res$data2.exam_id, "?type=2&pageType=course&courseId=").concat(searchParams.get('courseId'), "&stageId=").concat(searchParams.get('stageId')));
} else {
_umi_production_exports.history.replace("/paperlibrary/add/".concat(res === null || res === void 0 || (_res$data3 = res.data) === null || _res$data3 === void 0 ? void 0 : _res$data3.exam_id, "?type=2"));
}
// history.push(`/paperlibrary/edit/${res?.data?.exam_id}?fromadd=1`)
}
case 14:
case "end":
return _context4.stop();
}
}, _callee4);
})),
children: "\u4E0B\u4E00\u6B65"
})]
})]
}), current === 2 && /*#__PURE__*/(0,jsx_runtime.jsx)("div", {
children: /*#__PURE__*/(0,jsx_runtime.jsx)(EditPotin, {
setisedits: setisedit,
itemid: itemid
})
})]
})
});
};
/* harmony default export */ var Add = ((0,_umi_production_exports.connect)(function (_ref6) {
var user = _ref6.user,
newExercisePaper = _ref6.newExercisePaper,
dispatch = _ref6.dispatch;
return {
user: user,
newExercisePaper: newExercisePaper,
dispatch: dispatch
};
})(Add_AddNewPaper));
/***/ }),
/***/ 67169:
/*!****************************************!*\
!*** ./src/utils/hooks/useOverflow.ts ***!
\****************************************/
/***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) {
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */ I: function() { return /* binding */ useOverflow; }
/* harmony export */ });
/* harmony import */ var _root_workspace_ppte5yg23_SJ5m_develop_node_modules_babel_runtime_7_23_2_babel_runtime_helpers_slicedToArray_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./node_modules/_@babel_runtime@7.23.2@@babel/runtime/helpers/slicedToArray.js */ 11006);
/* harmony import */ var _root_workspace_ppte5yg23_SJ5m_develop_node_modules_babel_runtime_7_23_2_babel_runtime_helpers_slicedToArray_js__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_root_workspace_ppte5yg23_SJ5m_develop_node_modules_babel_runtime_7_23_2_babel_runtime_helpers_slicedToArray_js__WEBPACK_IMPORTED_MODULE_0__);
/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! react */ 59301);
var useOverflow = function useOverflow() {
var _useState = (0,react__WEBPACK_IMPORTED_MODULE_1__.useState)('hidden'),
_useState2 = _root_workspace_ppte5yg23_SJ5m_develop_node_modules_babel_runtime_7_23_2_babel_runtime_helpers_slicedToArray_js__WEBPACK_IMPORTED_MODULE_0___default()(_useState, 2),
overflow = _useState2[0],
setOverflow = _useState2[1];
var handleMouseEnter = function handleMouseEnter() {
return setOverflow('auto');
};
var handleMouseLeave = function handleMouseLeave() {
return setOverflow('hidden');
};
return {
overflow: overflow,
handleMouseEnter: handleMouseEnter,
handleMouseLeave: handleMouseLeave
};
};
/***/ }),
/***/ 3442:
/*!*********************************************!*\
!*** ./src/assets/images/paper/jiangxu.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);
function _createForOfIteratorHelper(o, allowArrayLike) { var it = typeof Symbol !== "undefined" && o[Symbol.iterator] || o["@@iterator"]; if (!it) { if (Array.isArray(o) || (it = _unsupportedIterableToArray(o)) || allowArrayLike && o && typeof o.length === "number") { if (it) o = it; var i = 0; var F = function F() {}; return { s: F, n: function n() { if (i >= o.length) return { done: true }; return { done: false, value: o[i++] }; }, e: function e(_e) { throw _e; }, f: F }; } throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); } var normalCompletion = true, didErr = false, err; return { s: function s() { it = it.call(o); }, n: function n() { var step = it.next(); normalCompletion = step.done; return step; }, e: function e(_e2) { didErr = true; err = _e2; }, f: function f() { try { if (!normalCompletion && it["return"] != null) it["return"](); } finally { if (didErr) throw err; } } }; }
function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === "string") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return Array.from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); }
function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) arr2[i] = arr[i]; return arr2; }
var __defProp = Object.defineProperty;
var __getOwnPropSymbols = Object.getOwnPropertySymbols;
var __hasOwnProp = Object.prototype.hasOwnProperty;
var __propIsEnum = Object.prototype.propertyIsEnumerable;
var __defNormalProp = function __defNormalProp(obj, key, value) {
return key in obj ? __defProp(obj, key, {
enumerable: true,
configurable: true,
writable: true,
value: value
}) : obj[key] = value;
};
var __spreadValues = function __spreadValues(a, b) {
for (var prop in b || (b = {})) if (__hasOwnProp.call(b, prop)) __defNormalProp(a, prop, b[prop]);
if (__getOwnPropSymbols) {
var _iterator = _createForOfIteratorHelper(__getOwnPropSymbols(b)),
_step;
try {
for (_iterator.s(); !(_step = _iterator.n()).done;) {
var prop = _step.value;
if (__propIsEnum.call(b, prop)) __defNormalProp(a, prop, b[prop]);
}
} catch (err) {
_iterator.e(err);
} finally {
_iterator.f();
}
}
return a;
};
var SvgJiangxu = function SvgJiangxu(props) {
return /* @__PURE__ */React.createElement("svg", __spreadValues({
className: "jiangxu_svg__icon",
viewBox: "0 0 1024 1024",
xmlns: "http://www.w3.org/2000/svg",
width: 32,
height: 32
}, props), /* @__PURE__ */React.createElement("path", {
d: "M365.714 73.143H1024v73.143H365.714zm0 292.571H1024v73.143H365.714zm0 292.572H1024v73.143H365.714zm0 292.571H1024V1024H365.714v-73.143z",
fill: "#98BDF7"
}), /* @__PURE__ */React.createElement("path", {
d: "m248.686 803.182-65.829 75.922V658.286h-73.143v220.818l-65.828-75.995L0 851.383 146.286 1024 292.57 851.53z",
fill: "#145DFF"
}), /* @__PURE__ */React.createElement("path", {
d: "M146.286 0 0 158.72l43.886 55.223 65.828-75.922v227.693h73.143V138.021l65.829 75.922 43.885-55.223z",
fill: "#98BDF7"
}));
};
/* harmony default export */ __webpack_exports__.Z = ("data:image/svg+xml;base64,PHN2ZyBjbGFzcz0iaWNvbiIgdmlld0JveD0iMCAwIDEwMjQgMTAyNCIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIiB3aWR0aD0iMzIiIGhlaWdodD0iMzIiPjxwYXRoIGQ9Ik0zNjUuNzE0IDczLjE0M0gxMDI0djczLjE0M0gzNjUuNzE0em0wIDI5Mi41NzFIMTAyNHY3My4xNDNIMzY1LjcxNHptMCAyOTIuNTcySDEwMjR2NzMuMTQzSDM2NS43MTR6bTAgMjkyLjU3MUgxMDI0VjEwMjRIMzY1LjcxNHYtNzMuMTQzeiIgZmlsbD0iIzk4QkRGNyIvPjxwYXRoIGQ9Im0yNDguNjg2IDgwMy4xODItNjUuODI5IDc1LjkyMlY2NTguMjg2aC03My4xNDN2MjIwLjgxOGwtNjUuODI4LTc1Ljk5NUwwIDg1MS4zODMgMTQ2LjI4NiAxMDI0IDI5Mi41NyA4NTEuNTN6IiBmaWxsPSIjMTQ1REZGIi8+PHBhdGggZD0iTTE0Ni4yODYgMCAwIDE1OC43Mmw0My44ODYgNTUuMjIzIDY1LjgyOC03NS45MjJ2MjI3LjY5M2g3My4xNDNWMTM4LjAyMWw2NS44MjkgNzUuOTIyIDQzLjg4NS01NS4yMjN6IiBmaWxsPSIjOThCREY3Ii8+PC9zdmc+");
/***/ }),
/***/ 39525:
/*!*********************************************!*\
!*** ./src/assets/images/paper/shengxu.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);
function _createForOfIteratorHelper(o, allowArrayLike) { var it = typeof Symbol !== "undefined" && o[Symbol.iterator] || o["@@iterator"]; if (!it) { if (Array.isArray(o) || (it = _unsupportedIterableToArray(o)) || allowArrayLike && o && typeof o.length === "number") { if (it) o = it; var i = 0; var F = function F() {}; return { s: F, n: function n() { if (i >= o.length) return { done: true }; return { done: false, value: o[i++] }; }, e: function e(_e) { throw _e; }, f: F }; } throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); } var normalCompletion = true, didErr = false, err; return { s: function s() { it = it.call(o); }, n: function n() { var step = it.next(); normalCompletion = step.done; return step; }, e: function e(_e2) { didErr = true; err = _e2; }, f: function f() { try { if (!normalCompletion && it["return"] != null) it["return"](); } finally { if (didErr) throw err; } } }; }
function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === "string") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return Array.from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); }
function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) arr2[i] = arr[i]; return arr2; }
var __defProp = Object.defineProperty;
var __getOwnPropSymbols = Object.getOwnPropertySymbols;
var __hasOwnProp = Object.prototype.hasOwnProperty;
var __propIsEnum = Object.prototype.propertyIsEnumerable;
var __defNormalProp = function __defNormalProp(obj, key, value) {
return key in obj ? __defProp(obj, key, {
enumerable: true,
configurable: true,
writable: true,
value: value
}) : obj[key] = value;
};
var __spreadValues = function __spreadValues(a, b) {
for (var prop in b || (b = {})) if (__hasOwnProp.call(b, prop)) __defNormalProp(a, prop, b[prop]);
if (__getOwnPropSymbols) {
var _iterator = _createForOfIteratorHelper(__getOwnPropSymbols(b)),
_step;
try {
for (_iterator.s(); !(_step = _iterator.n()).done;) {
var prop = _step.value;
if (__propIsEnum.call(b, prop)) __defNormalProp(a, prop, b[prop]);
}
} catch (err) {
_iterator.e(err);
} finally {
_iterator.f();
}
}
return a;
};
var SvgShengxu = function SvgShengxu(props) {
return /* @__PURE__ */React.createElement("svg", __spreadValues({
className: "shengxu_svg__icon",
viewBox: "0 0 1024 1024",
xmlns: "http://www.w3.org/2000/svg",
width: 32,
height: 32
}, props), /* @__PURE__ */React.createElement("path", {
d: "M365.714 73.143H1024v73.143H365.714zm0 292.571H1024v73.143H365.714zm0 292.572H1024v73.143H365.714zm0 292.571H1024V1024H365.714v-73.143zM248.686 803.182l-65.829 75.922V658.286h-73.143v220.818l-65.828-75.995L0 851.383 146.286 1024 292.57 851.53z",
fill: "#98BDF7"
}), /* @__PURE__ */React.createElement("path", {
d: "M146.286 0 0 158.72l43.886 55.223 65.828-75.922v227.693h73.143V138.021l65.829 75.922 43.885-55.223z",
fill: "#145DFF"
}));
};
/* harmony default export */ __webpack_exports__.Z = ("data:image/svg+xml;base64,PHN2ZyBjbGFzcz0iaWNvbiIgdmlld0JveD0iMCAwIDEwMjQgMTAyNCIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIiB3aWR0aD0iMzIiIGhlaWdodD0iMzIiPjxwYXRoIGQ9Ik0zNjUuNzE0IDczLjE0M0gxMDI0djczLjE0M0gzNjUuNzE0em0wIDI5Mi41NzFIMTAyNHY3My4xNDNIMzY1LjcxNHptMCAyOTIuNTcySDEwMjR2NzMuMTQzSDM2NS43MTR6bTAgMjkyLjU3MUgxMDI0VjEwMjRIMzY1LjcxNHYtNzMuMTQzek0yNDguNjg2IDgwMy4xODJsLTY1LjgyOSA3NS45MjJWNjU4LjI4NmgtNzMuMTQzdjIyMC44MThsLTY1LjgyOC03NS45OTVMMCA4NTEuMzgzIDE0Ni4yODYgMTAyNCAyOTIuNTcgODUxLjUzeiIgZmlsbD0iIzk4QkRGNyIvPjxwYXRoIGQ9Ik0xNDYuMjg2IDAgMCAxNTguNzJsNDMuODg2IDU1LjIyMyA2NS44MjgtNzUuOTIydjIyNy42OTNoNzMuMTQzVjEzOC4wMjFsNjUuODI5IDc1LjkyMiA0My44ODUtNTUuMjIzeiIgZmlsbD0iIzE0NURGRiIvPjwvc3ZnPg==");
/***/ }),
/***/ 52398:
/*!**********************************************************!*\
!*** ./src/components/QuestionEditor/index.less?modules ***!
\**********************************************************/
/***/ (function(__unused_webpack_module, __webpack_exports__) {
// extracted by mini-css-extract-plugin
/* harmony default export */ __webpack_exports__.Z = ({"wrap":"wrap___ilWvf","deleteIcon":"deleteIcon___JBDG8","keywordTag":"keywordTag___iieCb","questionTitleEditorWrap":"questionTitleEditorWrap___MHB5s","choiceWrap":"choiceWrap___QFkTc","choiceIndex":"choiceIndex___Mr2YO","judgementIndex":"judgementIndex___fUVWK","setAnswerBtn":"setAnswerBtn___Whox5","activeAnswer":"activeAnswer___fGU6Y","activeJudgementAnswer":"activeJudgementAnswer___wJv8P","actionWrapper":"actionWrapper___ERQ7k","addIcon":"addIcon___L9TE0","inputBorder":"inputBorder___Q5tRE","placeholder":"placeholder___p9sFY","blankWrapper":"blankWrapper___nC45e","blankInput":"blankInput___pEHsx","blankInputNumberWrapper":"blankInputNumberWrapper___uEHb0","addBtn":"addBtn___WR5ZI","blankIndex":"blankIndex___x9Pny","baseInputWrapper":"baseInputWrapper___eVsG7","collapseWrapper":"collapseWrapper___ZTysU","panelHeader":"panelHeader___QSN9g","open":"open___B6FU9","close":"close___QX19r","hide":"hide___mn25n"});
/***/ }),
/***/ 57908:
/*!*******************************************************!*\
!*** ./src/pages/Paperlibrary/Add/index.less?modules ***!
\*******************************************************/
/***/ (function(__unused_webpack_module, __webpack_exports__) {
// extracted by mini-css-extract-plugin
/* harmony default export */ __webpack_exports__.Z = ({"flex_box_center":"flex_box_center___ycN2f","flex_space_between":"flex_space_between___LcS9e","flex_box_vertical_center":"flex_box_vertical_center___uwjPm","flex_box_center_end":"flex_box_center_end___Pc903","flex_box_column":"flex_box_column___AXEdv","bg":"bg___fm2Cw","title":"title___J3MCU","editIcon":"editIcon___i4Zll","titleLeft":"titleLeft___da61c","titleRight":"titleRight___EsdL6","formWrap":"formWrap___YTxC3","baseLineHeight":"baseLineHeight___TprCB","radioBtnWrapper":"radioBtnWrapper___Mt_XG","radiogroup":"radiogroup___EvkWh","easy":"easy___mSxtg","medium":"medium___NIaWN","hard":"hard___mddnD","baseFormItem":"baseFormItem___csbyb","cascaderPopup":"cascaderPopup___BttnF","selectdiv":"selectdiv___TAr4i","divitem":"divitem___iaXB2","bottmodiv":"bottmodiv___bmp6p","cancelBtn":"cancelBtn___Q4ZcL","confirmBtn":"confirmBtn___nRiCD"});
/***/ }),
/***/ 66104:
/*!**************************************************************************!*\
!*** ./node_modules/_antd@5.9.0@antd/es/breadcrumb/index.js + 6 modules ***!
\**************************************************************************/
/***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) {
// EXPORTS
__webpack_require__.d(__webpack_exports__, {
Z: function() { return /* binding */ breadcrumb; }
});
// EXTERNAL MODULE: ./node_modules/_classnames@2.3.2@classnames/index.js
var _classnames_2_3_2_classnames = __webpack_require__(12124);
var _classnames_2_3_2_classnames_default = /*#__PURE__*/__webpack_require__.n(_classnames_2_3_2_classnames);
// EXTERNAL MODULE: ./node_modules/_rc-util@5.38.1@rc-util/es/Children/toArray.js
var toArray = __webpack_require__(45659);
// EXTERNAL MODULE: ./node_modules/_rc-util@5.38.1@rc-util/es/pickAttrs.js
var pickAttrs = __webpack_require__(3286);
// 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/_util/reactNode.js
var reactNode = __webpack_require__(92343);
// EXTERNAL MODULE: ./node_modules/_antd@5.9.0@antd/es/config-provider/context.js
var context = __webpack_require__(36355);
// EXTERNAL MODULE: ./node_modules/_@ant-design_icons@5.2.6@@ant-design/icons/es/icons/DownOutlined.js + 1 modules
var DownOutlined = __webpack_require__(42884);
// EXTERNAL MODULE: ./node_modules/_antd@5.9.0@antd/es/dropdown/dropdown.js
var dropdown = __webpack_require__(91857);
;// CONCATENATED MODULE: ./node_modules/_antd@5.9.0@antd/es/breadcrumb/BreadcrumbSeparator.js
"use client";
const BreadcrumbSeparator = _ref => {
let {
children
} = _ref;
const {
getPrefixCls
} = _react_17_0_2_react.useContext(context/* ConfigContext */.E_);
const prefixCls = getPrefixCls('breadcrumb');
return /*#__PURE__*/_react_17_0_2_react.createElement("li", {
className: `${prefixCls}-separator`,
"aria-hidden": "true"
}, children === '' ? children : children || '/');
};
BreadcrumbSeparator.__ANT_BREADCRUMB_SEPARATOR = true;
/* harmony default export */ var breadcrumb_BreadcrumbSeparator = (BreadcrumbSeparator);
;// CONCATENATED MODULE: ./node_modules/_antd@5.9.0@antd/es/breadcrumb/useItemRender.js
"use client";
var __rest = undefined && undefined.__rest || function (s, e) {
var t = {};
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0) t[p] = s[p];
if (s != null && typeof Object.getOwnPropertySymbols === "function") for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i])) t[p[i]] = s[p[i]];
}
return t;
};
function getBreadcrumbName(route, params) {
if (route.title === undefined || route.title === null) {
return null;
}
const paramsKeys = Object.keys(params).join('|');
return typeof route.title === 'object' ? route.title : String(route.title).replace(new RegExp(`:(${paramsKeys})`, 'g'), (replacement, key) => params[key] || replacement);
}
function renderItem(prefixCls, item, children, href) {
if (children === null || children === undefined) {
return null;
}
const {
className,
onClick
} = item,
restItem = __rest(item, ["className", "onClick"]);
const passedProps = Object.assign(Object.assign({}, (0,pickAttrs/* default */.Z)(restItem, {
data: true,
aria: true
})), {
onClick
});
if (href !== undefined) {
return /*#__PURE__*/_react_17_0_2_react.createElement("a", Object.assign({}, passedProps, {
className: _classnames_2_3_2_classnames_default()(`${prefixCls}-link`, className),
href: href
}), children);
}
return /*#__PURE__*/_react_17_0_2_react.createElement("span", Object.assign({}, passedProps, {
className: _classnames_2_3_2_classnames_default()(`${prefixCls}-link`, className)
}), children);
}
function useItemRender(prefixCls, itemRender) {
const mergedItemRender = (item, params, routes, path, href) => {
if (itemRender) {
return itemRender(item, params, routes, path);
}
const name = getBreadcrumbName(item, params);
return renderItem(prefixCls, item, name, href);
};
return mergedItemRender;
}
;// CONCATENATED MODULE: ./node_modules/_antd@5.9.0@antd/es/breadcrumb/BreadcrumbItem.js
"use client";
var BreadcrumbItem_rest = undefined && undefined.__rest || function (s, e) {
var t = {};
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0) t[p] = s[p];
if (s != null && typeof Object.getOwnPropertySymbols === "function") for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i])) t[p[i]] = s[p[i]];
}
return t;
};
const InternalBreadcrumbItem = props => {
const {
prefixCls,
separator = '/',
children,
menu,
overlay,
dropdownProps,
href
} = props;
// Warning for deprecated usage
if (false) {}
/** If overlay is have Wrap a Dropdown */
const renderBreadcrumbNode = breadcrumbItem => {
if (menu || overlay) {
const mergeDropDownProps = Object.assign({}, dropdownProps);
if (menu) {
const _a = menu || {},
{
items
} = _a,
menuProps = BreadcrumbItem_rest(_a, ["items"]);
mergeDropDownProps.menu = Object.assign(Object.assign({}, menuProps), {
items: items === null || items === void 0 ? void 0 : items.map((_a, index) => {
var {
key,
title,
label,
path
} = _a,
itemProps = BreadcrumbItem_rest(_a, ["key", "title", "label", "path"]);
let mergedLabel = label !== null && label !== void 0 ? label : title;
if (path) {
mergedLabel = /*#__PURE__*/_react_17_0_2_react.createElement("a", {
href: `${href}${path}`
}, mergedLabel);
}
return Object.assign(Object.assign({}, itemProps), {
key: key !== null && key !== void 0 ? key : index,
label: mergedLabel
});
})
});
} else if (overlay) {
mergeDropDownProps.overlay = overlay;
}
return /*#__PURE__*/_react_17_0_2_react.createElement(dropdown/* default */.Z, Object.assign({
placement: "bottom"
}, mergeDropDownProps), /*#__PURE__*/_react_17_0_2_react.createElement("span", {
className: `${prefixCls}-overlay-link`
}, breadcrumbItem, /*#__PURE__*/_react_17_0_2_react.createElement(DownOutlined/* default */.Z, null)));
}
return breadcrumbItem;
};
// wrap to dropDown
const link = renderBreadcrumbNode(children);
if (link !== undefined && link !== null) {
return /*#__PURE__*/_react_17_0_2_react.createElement(_react_17_0_2_react.Fragment, null, /*#__PURE__*/_react_17_0_2_react.createElement("li", null, link), separator && /*#__PURE__*/_react_17_0_2_react.createElement(breadcrumb_BreadcrumbSeparator, null, separator));
}
return null;
};
const BreadcrumbItem = props => {
const {
prefixCls: customizePrefixCls,
children,
href
} = props,
restProps = BreadcrumbItem_rest(props, ["prefixCls", "children", "href"]);
const {
getPrefixCls
} = _react_17_0_2_react.useContext(context/* ConfigContext */.E_);
const prefixCls = getPrefixCls('breadcrumb', customizePrefixCls);
return /*#__PURE__*/_react_17_0_2_react.createElement(InternalBreadcrumbItem, Object.assign({}, restProps, {
prefixCls: prefixCls
}), renderItem(prefixCls, restProps, children, href));
};
BreadcrumbItem.__ANT_BREADCRUMB_ITEM = true;
/* harmony default export */ var breadcrumb_BreadcrumbItem = (BreadcrumbItem);
// EXTERNAL MODULE: ./node_modules/_antd@5.9.0@antd/es/style/index.js
var style = __webpack_require__(17313);
// EXTERNAL MODULE: ./node_modules/_antd@5.9.0@antd/es/theme/util/genComponentStyleHook.js
var genComponentStyleHook = __webpack_require__(83116);
// EXTERNAL MODULE: ./node_modules/_antd@5.9.0@antd/es/theme/util/statistic.js
var statistic = __webpack_require__(37613);
;// CONCATENATED MODULE: ./node_modules/_antd@5.9.0@antd/es/breadcrumb/style/index.js
const genBreadcrumbStyle = token => {
const {
componentCls,
iconCls
} = token;
return {
[componentCls]: Object.assign(Object.assign({}, (0,style/* resetComponent */.Wf)(token)), {
color: token.itemColor,
fontSize: token.fontSize,
[iconCls]: {
fontSize: token.iconFontSize
},
ol: {
display: 'flex',
flexWrap: 'wrap',
margin: 0,
padding: 0,
listStyle: 'none'
},
a: Object.assign({
color: token.linkColor,
transition: `color ${token.motionDurationMid}`,
padding: `0 ${token.paddingXXS}px`,
borderRadius: token.borderRadiusSM,
height: token.lineHeight * token.fontSize,
display: 'inline-block',
marginInline: -token.marginXXS,
'&:hover': {
color: token.linkHoverColor,
backgroundColor: token.colorBgTextHover
}
}, (0,style/* genFocusStyle */.Qy)(token)),
[`li:last-child`]: {
color: token.lastItemColor
},
[`${componentCls}-separator`]: {
marginInline: token.separatorMargin,
color: token.separatorColor
},
[`${componentCls}-link`]: {
[`
> ${iconCls} + span,
> ${iconCls} + a
`]: {
marginInlineStart: token.marginXXS
}
},
[`${componentCls}-overlay-link`]: {
borderRadius: token.borderRadiusSM,
height: token.lineHeight * token.fontSize,
display: 'inline-block',
padding: `0 ${token.paddingXXS}px`,
marginInline: -token.marginXXS,
[`> ${iconCls}`]: {
marginInlineStart: token.marginXXS,
fontSize: token.fontSizeIcon
},
'&:hover': {
color: token.linkHoverColor,
backgroundColor: token.colorBgTextHover,
a: {
color: token.linkHoverColor
}
},
a: {
'&:hover': {
backgroundColor: 'transparent'
}
}
},
// rtl style
[`&${token.componentCls}-rtl`]: {
direction: 'rtl'
}
})
};
};
// ============================== Export ==============================
/* harmony default export */ var breadcrumb_style = ((0,genComponentStyleHook/* default */.Z)('Breadcrumb', token => {
const BreadcrumbToken = (0,statistic/* merge */.TS)(token, {});
return [genBreadcrumbStyle(BreadcrumbToken)];
}, token => ({
itemColor: token.colorTextDescription,
lastItemColor: token.colorText,
iconFontSize: token.fontSize,
linkColor: token.colorTextDescription,
linkHoverColor: token.colorText,
separatorColor: token.colorTextDescription,
separatorMargin: token.marginXS
})));
;// CONCATENATED MODULE: ./node_modules/_antd@5.9.0@antd/es/breadcrumb/useItems.js
var useItems_rest = undefined && undefined.__rest || function (s, e) {
var t = {};
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0) t[p] = s[p];
if (s != null && typeof Object.getOwnPropertySymbols === "function") for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i])) t[p[i]] = s[p[i]];
}
return t;
};
function route2item(route) {
const {
breadcrumbName,
children
} = route,
rest = useItems_rest(route, ["breadcrumbName", "children"]);
const clone = Object.assign({
title: breadcrumbName
}, rest);
if (children) {
clone.menu = {
items: children.map(_a => {
var {
breadcrumbName: itemBreadcrumbName
} = _a,
itemProps = useItems_rest(_a, ["breadcrumbName"]);
return Object.assign(Object.assign({}, itemProps), {
title: itemBreadcrumbName
});
})
};
}
return clone;
}
function useItems(items, routes) {
return (0,_react_17_0_2_react.useMemo)(() => {
if (items) {
return items;
}
if (routes) {
return routes.map(route2item);
}
return null;
}, [items, routes]);
}
;// CONCATENATED MODULE: ./node_modules/_antd@5.9.0@antd/es/breadcrumb/Breadcrumb.js
"use client";
var Breadcrumb_rest = undefined && undefined.__rest || function (s, e) {
var t = {};
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0) t[p] = s[p];
if (s != null && typeof Object.getOwnPropertySymbols === "function") for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i])) t[p[i]] = s[p[i]];
}
return t;
};
const getPath = (params, path) => {
if (path === undefined) {
return path;
}
let mergedPath = (path || '').replace(/^\//, '');
Object.keys(params).forEach(key => {
mergedPath = mergedPath.replace(`:${key}`, params[key]);
});
return mergedPath;
};
const Breadcrumb = props => {
const {
prefixCls: customizePrefixCls,
separator = '/',
style,
className,
rootClassName,
routes: legacyRoutes,
items,
children,
itemRender,
params = {}
} = props,
restProps = Breadcrumb_rest(props, ["prefixCls", "separator", "style", "className", "rootClassName", "routes", "items", "children", "itemRender", "params"]);
const {
getPrefixCls,
direction,
breadcrumb
} = _react_17_0_2_react.useContext(context/* ConfigContext */.E_);
let crumbs;
const prefixCls = getPrefixCls('breadcrumb', customizePrefixCls);
const [wrapSSR, hashId] = breadcrumb_style(prefixCls);
const mergedItems = useItems(items, legacyRoutes);
if (false) {}
const mergedItemRender = useItemRender(prefixCls, itemRender);
if (mergedItems && mergedItems.length > 0) {
// generated by route
const paths = [];
const itemRenderRoutes = items || legacyRoutes;
crumbs = mergedItems.map((item, index) => {
const {
path,
key,
type,
menu,
overlay,
onClick,
className: itemClassName,
separator: itemSeparator,
dropdownProps
} = item;
const mergedPath = getPath(params, path);
if (mergedPath !== undefined) {
paths.push(mergedPath);
}
const mergedKey = key !== null && key !== void 0 ? key : index;
if (type === 'separator') {
return /*#__PURE__*/_react_17_0_2_react.createElement(breadcrumb_BreadcrumbSeparator, {
key: mergedKey
}, itemSeparator);
}
const itemProps = {};
const isLastItem = index === mergedItems.length - 1;
if (menu) {
itemProps.menu = menu;
} else if (overlay) {
itemProps.overlay = overlay;
}
let {
href
} = item;
if (paths.length && mergedPath !== undefined) {
href = `#/${paths.join('/')}`;
}
return /*#__PURE__*/_react_17_0_2_react.createElement(InternalBreadcrumbItem, Object.assign({
key: mergedKey
}, itemProps, (0,pickAttrs/* default */.Z)(item, {
data: true,
aria: true
}), {
className: itemClassName,
dropdownProps: dropdownProps,
href: href,
separator: isLastItem ? '' : separator,
onClick: onClick,
prefixCls: prefixCls
}), mergedItemRender(item, params, itemRenderRoutes, paths, href));
});
} else if (children) {
const childrenLength = (0,toArray/* default */.Z)(children).length;
crumbs = (0,toArray/* default */.Z)(children).map((element, index) => {
if (!element) {
return element;
}
// =================== Warning =====================
if (false) {}
false ? 0 : void 0;
const isLastItem = index === childrenLength - 1;
return (0,reactNode/* cloneElement */.Tm)(element, {
separator: isLastItem ? '' : separator,
key: index
});
});
}
const breadcrumbClassName = _classnames_2_3_2_classnames_default()(prefixCls, breadcrumb === null || breadcrumb === void 0 ? void 0 : breadcrumb.className, {
[`${prefixCls}-rtl`]: direction === 'rtl'
}, className, rootClassName, hashId);
const mergedStyle = Object.assign(Object.assign({}, breadcrumb === null || breadcrumb === void 0 ? void 0 : breadcrumb.style), style);
return wrapSSR( /*#__PURE__*/_react_17_0_2_react.createElement("nav", Object.assign({
className: breadcrumbClassName,
style: mergedStyle
}, restProps), /*#__PURE__*/_react_17_0_2_react.createElement("ol", null, crumbs)));
};
Breadcrumb.Item = breadcrumb_BreadcrumbItem;
Breadcrumb.Separator = breadcrumb_BreadcrumbSeparator;
if (false) {}
/* harmony default export */ var breadcrumb_Breadcrumb = (Breadcrumb);
;// CONCATENATED MODULE: ./node_modules/_antd@5.9.0@antd/es/breadcrumb/index.js
"use client";
/* harmony default export */ var breadcrumb = (breadcrumb_Breadcrumb);
/***/ }),
/***/ 4977:
/*!********************************************!*\
!*** ./src/assets/images/icons/nodata.png ***!
\********************************************/
/***/ (function(module) {
module.exports = "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAMwAAACaCAYAAADl9acYAAAAAXNSR0IArs4c6QAAIABJREFUeF7tXQd4U1Ubfs/NaJtO9kzLahFQEJkiUBBFUFFkCCjiAAVFERT5FREQQQXBBcpysWRP2RtkKRsEOphNodCZdDfjnv85CU2TZt2bhABNDw9PmtzvrO+c957xLQIP0pkz1yrQIEmwwcDzHhTj91klEo7jpcG5zetWUJdmRjmPvTM9GI9JgSGvadOoLE9KJJ5kPp2YXLtZdO1kT8ooz2vigCNelvPYezPEG7z0CDAn4pJqPvJA5A3vdcl/S3LEy3Iee29OeIOX5YDx3nh4VFI5YDxin6DM5YARxKb7g6gcMHd+nMoBc+d57LKGhCQ1ZURBCoVL2nKCO8sBZWW50x1TOWDuLP8FlV4OGEFs8glROWB8wmbPKikHjGf882bucsB4k5t3qKxywNwhxrpRbJkGTOx0ehlA3d9e5VEtzA3ulGe55zmg1QOfrCVo34BgQGvr5rLDRl4RRZG+5NjBESBc4FHw1LlrCAuPsCo0JjKi7J5hYqfTXADBq4byCJLf82Nf3kA3OfD9LgKdgeCzZ4CUTJ1VKQFyKQgpmeMSjiKvQC+oplspN/wOMDcBVFv0Bo+KwYJ4VE50H3Jg7j6CWzkEX74A3MrSgTfeKZpSaBCHcAVn/JunBHlFPDR5BkG9LMjPt7mZLOtbskQADea9wqOW9coqiGHlRPcHBxYcJriQQvB9P+v2cqCwWFxgoOJk6JeTNX4HmJMAHv6xP4/6VXw/+OxNx/bM/pIohdUE9VW/VxwjOHiJYO5A6xolpGSpYW3jIW4w/A8wM+h+UHSY2pvHgzV9NXymeor0wPc7Cf7XzWJ/4Nsm+Ly2LzZx+OwZ3yuVbzhNsPEMwcI3rM8wMikHiURi5gNbbQoKrc84zpjkj2eYzQC6f96DomUd305ctrp8tp5gSk/f1utzlFhUOHYthy9f8D1gdpwnWHiEYOVQ6zNM6QM/AY+CImHnF9YtfwTMCgB9P+5G0SHa9xP3bk2gT9cBU3r6Hjp95nBYNcz3gDlwkRhX843vlfS59PmFHfjFzgC/2pJ1nEEnEIpIAG+834Wia2Ox7PJ8wt0twLz7J8Gsl3zf316zCVYPsz5oe85F1yUcu0YwcQPBjlElZyjL8wsrQeyBn+XxK8DETqefgyACFCPe6kjxfDPfT6C7BpilBLMG+L6/A34h+P1VikCZ60nuTYpzN4AxqznjCqPOMZ1RSp9f2OVLYZH1lbOrNvjVlswIGEAKYOyrj1K82NL3E+huAWbEMnbFSn1+Qzd4AcE3fajPZV6X04D3lnHGM4xOawKFJwLLYiD5H2AoCkHwJQMLA42v090CzJjVBBN7UCh8rN3AgDrqCYq6lX3L6RQ1MGQRhwWvA7UrALbnFzCJjOhG+d2WjFCkUYKZPZpSDIv1PWDGrycY34NCahI0+yxN/Ivg3c4UlUN8VqWxok/XEfRrSdG0tm/rzcoHBv7KYc5AILqqLWDcOb/45RmGEFyhFL8/0Yga33y+Tl9uJhjxOEVIoG9rnrqVKSJSRFb0fb3tG1A81sC39TLRSu85HL57Eaii0Bm3oqEKqZXSJaUURUxTU0Tyuy0ZAc5SYCUbxE+6+x4w3+0kGNiWooqP3/Qz9xB0bUTRsLqI2eEFUlbvA9WBJxv5ltdMit9jFocpLwB1InQIkBEQTmLUHStOBoMBOr24K2+/AwwPHOKArS2iKCY9VzKIg34jyMgTv6f1wpwqL8JLHKgUTLHwjZIxZTKg0V2Bzg2tLzvYBYA75xe/25J1mkEnGAzYyXE40KQmMK23uLeLN8b1j0ME7epTxFTzRmnCy/jzXyCqIny+NVryDzFeKfd+xLcrDOMMO8MMfgx45iFrOZA7AstiTvvVoZ91usM3tClHcLpeZWDmAN8DZtlRgkY1KJr5+BC87hQQLAeebCwcZN6gXH6MgG2P+rfyDmD+WLoV8xZugkIRiNh2TTHghcfRoF4tFBZpkXgpGQ81rmdu9puLOLzwMPBYPR1Cgzw/v7CC/WpLxjrc/jtaT2LApRrhwC+DfA+Y9aeI0dKzbT3vTCChk3r7eaBABzzfTGgO79CtPUmM9b7U2jv9bf3kOyjSlihLcoSg93MdkZ2Th227j2Hoq8/inTeeNzZ+xFIOsTHAsw/pAeL5+cUvAdPuG1pVRnArQgEsGex7wGw7RxAgBTo19M4EEjqtD1wEkrPYm15oDu/QbfkPSM0hHsu8du0/gSnfLkFGVrbThjFLynULJ6FOZHUw2RNbyd/qUJLFHZV+ywr9aksWO4Ou0BK8KueRz/bVq++CUuD+RGbhB3R/0LeAOZEEnFIRvPGYb+vdGw+cvU7w3uOe1dv+mfeRk5svCMUfvz8AA3o9jgkbCJQVgPe7lGTz5MDvj4f+VXs/JH1ip1PmAkHy17u8z42bjl4lxjf9C809m0CCZo4FUVwKsDPOJLz0ZTp6Fdh6jtnWe1bvuCm/4q/tRwQ1/b03e2LIwGfw1RaCkADg425AOvPkYCHZd0cG43dbsk4zaDFgWHiHcG85wjBQoEhnMhAzf5r/Jihkf9/+fjXDtDXqGA108+Eqcy0DYAfwMU95NnEFzVgLovibwK8HCab19qze61s24Pf5K7A5KwB5vHM1CblMij9m/Q87rtc1jsek54CMPIBayGD0BgP0ImUw/gwYFiqjllhHGAcvAkuPcijU8cgv0KGgSGv8LNJqweu1MOh14A3ss+S78W+Dzuo3RsPoTy0YgIjQALFz0C36tBzg570EE3p4NnHFVn5TA0zaSPDzy57Vu2bIS6jF67BDHYBHgnVI0kow+6ZjLyZNm9RD+35jkZINfNO7ZIVhEn+e16NQ6157/OqWjJ1h9n1IXoydTi8AeGD+KzxqinCEsfkswfBJC2HQacXOG7v0B+e9CGXVUK+U5aoQdm5iE3eqh296R/XoDEBu0e3/hcz3FzF+Z292trI91Zgav7N2tKrDrrfFTdgTI4dAl61BipZDDXYINRCMvBrusNvBikAMHT8LTM3/pwElK4xMAuQV6uBuKK4yA5hEVfY8SvmmHCETGyjDtzqbQLHf0KMgaCnWEcaW/whGT1mAHHZP6oW09bueaFy3khdKcl0EO+y+v4xgphs2MWxbs+K46bLCDIoi6+9iVLKY4PbTp8UB5t8h/UB53qimz1aJA9lyLExz7H1vyMCnUa15L/x9EfhtkIk/nh74y9ShPz5JnUGA26qFZIdcTofWqR5xxd5Uip1O9wDoJNYRxs4LBB9PXYxUdaHrGSqAYuWUp9GmSQ0BlN4h8cTq8qVfOGgKStpBeAoJb4DEYPrPsU89b/5e/LvEYPubLCIQX06NEtWpfwa/yA4h0FEgqVCK71OCUeTARdLLfbpg9PAXsfGsBBtOA0uHmKpyV0PZsqFl5lo5QaXWgRqNw4pTHiEYGa2M+KX0yMROpxsA9BDrCGNvAsG4GcuQdMt45eJx+nXsk3iyNbOY9k161wOry8/GqZCr1t4GBA/O3T0Nm7gSDl/89IBRHiU0nRk3CgU3knEmT4pZN51rrjI5TN2oGmCOMP44BKx7B8jINemP8ZRCK2Y5LNXAMrMlS0hSpwKw9TRGME+XHf5ekybEfPCInU7/BDBArCOMw5cIPvt+JRJUGqHj7JRu2rsd0P+JGBuanELTTVpwwO3/cnjFxNcTwMz95hquxud5pd+skIEfR6NJA+F2y6o1S3Fj4xpj/X9lBmK7OsDuChMUKMf+v36AXC4Fc4QxYwew/X0gM8/k5VKvN0BvcF9gfc8CJuGWuh4twgoQnJSBzK+nDP+3eLTsBahJSNL8DdD29kaUAFsDSU4vpVJp3FTETqdzAbwl1hHGySSCCTPX41RimlcmzthBrTCsV1Obss5cJ2hWXQupTIoiHUW+1nRYZkcn5kRbTzlIOQq5hBmimfRu2RwoeU4gl5rAFiI3Odpmb/NRK0zXu+zgKzZtWZWK/VvTxWZzSP/EK5HoEivcxsFQWIBzk8caVxmWmMT+g6thNlfMg/p1xYfv9DXSMEcYEzYAu247wnBXQ9myE/fslixRpf6FUgw2N5bgDChmk6Lw33MMqkqlg8JeVKmn8hRjHI0QIdgbiJynGWhiZ9AZoPhgaEeK50Q4wmDCvwmzt+HwGe8EcH67V1N8MshWV4UBpnlNLQID3Lcn5nkKrZ6iUEex4azEqC08di0BW1XDgsTP+2NHsrH6F+/0m9Xetns1PN9b3IWHPi8XyetXIOPoEeg1WbhYKMGK9CCoiiSoWq0SnuvWzqhLVuyoz+wI411mmi3epZI9Lt2zgElIUht9INtpdDJPMUsSGf59NCFFxc8TknI6AoZ9LqbCmj+V4X33zMAEAOMHtaXoJ0KLVpUJjJuzD3v+vSh+xtnJ0ffxaMwY0dHuCtO8pg6BAcK3LI4axCTai/4hRsBM3kww5DGK6o5vYx32S52pw9QxbEi8k6o2DMeoj2q5VVhqNnB29JsI0TP5M6Dj5Gg7dwmkpVZOsyOMtyg4joDyBhRq3d+Osbru3S2ZSp0LCmf+9ZM5CUY3qBWx3LREUy5RpbkKQOl0FAimvrksPAME08Q6wmD74DGz/8H2A/+5NdClM8U2r4VFE7rZBcwjtXQIkHsOGLbSLP7XBJhvdxD0fJiinhs+pVk5n41IBM/UFryQSHggvpxRooovpsgdFwjoD8MQri3ZIso/XYzm9a2FwDfUAFPxX/AaRYSCeCR/KW7fvQuYJE0RQF3vSQh2UQn3bsOaYXEJSZrPADrJBfP5BceCVx+4LO0r1hGG3gC8//Np/LXrmJjxdUhbv1YE9vzU22eAmbOPBRmieNCNFzvP8/jhaxVSL3vn4M9zBJN/bgSZgJsyplZ0KQ24oSZgq8vmE4V4+9hrkNIS8O5uPhbNOz+CprWpWRhd7Ahj9svMYM871rT38pbM/q2XvelHoeU4bpxBgt+Jjr8MAqfi80NXZEW/H1UEuOMIY/zCRPyxZr9XABMSJMP5pbelahYlsjNMi1p6402Pp8lyhWEhIBpVp2hdV1yp6nwgPAhYvzQF/+zOEpfZCfXgz6LRIMrxKsq0B5YcKsL6UxRFvBygelBdLjhZGMCx/RfTKWMCUGZzbAClvJEmtiGH97oEGLdhzBHGjL4UDyvLOmBUmn9AaamAay7GimAXgdErzG1RlX36k9el+PlgsPFtK9YRxtwtNzBl7havTZoLywYhuJRbSCNgauvBlAg9TQYDjyVHOeOWbOVxoEoo0Mn2JttpNZvOcmhfn0KTXoTr8TlITSnCrRSt8TMvV7gj79KVPDskCo+1tb/rZkLScavzcTlTARBrZUu+MB1coHNHZ8rQXEzvH4T+8yWY9DzQrj6QptFDzzRlPUj37JbM5pZMeCfZK5CNgsPt3PlbEny3LwSlHWEIqWLzcTWGfbFaCKkgml0zeyNaaa3QdqcAs+msSa2k+4OCmmYm2nyWQ98W9idabo4eqSla3EopMn6m3mRgKkJ6KlM6dV5Plz418ES3CjZE7Ar9w2X5UGXbv3bmC1NBAiqBEOf34zFhKlzLq40PuxK0i8qFutBzRdd7FjDx1zSDCKELxA2tmZoyyztqqc9tUdDlDAm+2hUCdxxhHIwrwOAJy5EvIkSCsz78Nq4rnmhpfU/BANOytgEydwQmpSpjQro/b68we+JNArzej4jjKouz0q+luDwGAzWCxnI1Kr0qPfpEZTzXv6pVwUzf6+MVBTiX6vi+hxoKQfUF4AJswWZZGF+UCUN2IsYMaINnbcVd4jp0m/qePcNcvJlTldcaUm5vVN3qnKNM1zUcJm4LhTuOMP65qMWYGWtxJcU76jGT3nwUrz1j7ZnCCBilAbLS96RucIFJtv88ZpLD/HMZSEgFXmkrrqANp2yjEYsroYRar6f44I3zxh9qNwnH8FHWNxBLj2ix6F85SKltmGV9lBrAF6RConCuh8fotCn7MSC2Fob3ELkPddDBexYwrL2JSZqtFPQpdwfHUT7mf+zjTWFwxxHG8St6zPhtCw6cZXcSnqdhLzTF2FethZcMMK2UBki9DBgmbz18mYAJbMUk5shiYBsxORzT5ucZ8PHbcUaC4OpBGDe55AbiShqP9/40gHLOt058UZbxXMPJnQuUKK+DLi8DEs0R/PJBLIIVwjULHPXgnt2SsQbHq7JeIJSYFIi8mNgeeeT6cFRQAItFOsL4L5li0do9WLrLriK06FZ2e7QO5v3PwugcgDcBo9MbsPT2CnMxFcYwdiNFuMhlKjcs/J23AMMEoONHJhj5JA2T44tvS2TTo5cX4kKqY5X9YuYacq9CEhzlMngmr8uGQasFLUpDPcUV/DCiKwrcNBwrrvueBsyKFVTSvG32aQraRPRMdJKBWaa+vSrcqNAo1hEGsyD8Y/1R/LzmjFea1EBZAbtn9rIqywiYSB5Siecey3U6A5YeN23JmCCPORIcK8IWhV0ps1Wpj8hzjyPmsDPN5P+ZNCWInMOXPz9g/PtgohZfbpEZ3SE5TxSGXBUkIa61vPnCDLCzFEuGrOMY1q02Xunq2VS6p7dkrKOJ17N7UAPP1PG9moatCoOBJ9go0hEGe+P+vC4e3yw84JX2VAoLxMmFL9sApnUkD4kXAKPV6bHsuNQIGDb5p28nmCwixmZSJnA5jeCZh1x3NzfpKi7M/xlFGRmo0qoNqnfohPAG1mcH1dUCfDP+sqkwjuCreY2Mf478swiJGa6V3Az518EFVgHhXMu0DYUZ4G8Dhuqy0Sg0EfM+8myHf88DhjEzIUmzAaA9XA+ZcIqR60KRp+XgjiOM3Sdu4s0vtyAkSIrgQCmCg6QIYZ+BMuPf7Dfzs9vP2bPi34ICZTh2szJ6NM41HuyrV7f2G8tWmNZRPCSc5yuMJWCYGcjHawm+7Sv8DPPfdSBfS9C5oWveHhg+GFqNyfRBEhgIeWgY2kz7AZysRDh5KT4fP0y5vZ0lwBdzGoO9FwbOK4S6KMDpCkP1eaD6fCNghCSDNhe8zmTsVznrMD59XIGa7Wx194SUVUxzT2/JihuZmJJThWoNZ0HgNY/EH28MRUY+B7GOMFibcrJzkJuXB3Z1zXHc7U9ivNlh0mX2aXpm/7ekLA57E6R44zHm5slWAs0A0ybKpDDoaWLhHJafMK0wLIm1ujx0iYD56WgrQO3ryuplSN6xzajkqM83+RCr1aUrol95A5zUJIT971QO5n2bZPybXYRNntsYvx4guLJrL1qkbsD2moOQHP6wlUskRkt5PfiCm5AEC/exa9DmgNcVoVL2KQy59RsqhAQg6tPvwAU5U1F0zvH7AjCsC4mqnE6UGpitvsfSJ0IIHb8lmNzIlkCsIwxPJzDLf10NrDtJMNyBjzDvAkaH5SdkbgOGOf5oVAN4sKawnl+YOwspf+81EzPIh9VvgCbvfoDAKlVx9JAai+ZcNz4PVBBE9W+M07uPo9/laeBgknSeC22ObbVeQ06QCRzselivuQhZBNveCX+JGAoyEZEThyE3fkIYNa00yh69UPdF6y2wsJ6ZqO6LLZl5pUlW9wHFMkrh6mTokgdf7QzG5UwpxDrCcFmwAAImPPztIMHorva3RkbA1GEhGoRPDkfVMj/EVoARaabM2vliCxj9QQtJ1GDAtU3rcGPXDmjVWWDfWWJbtHp9BiCwRScU6KQICJRg4VEp4g8ex4tXvrFSpGT0JxXNsKraIEgVFaHLuQ5ZSE1wAeLsEioRFZ5PnAVlTok5hiQwCG1+mAupwr1V5r4CDGNkgkrzEij93Znqi5CB/XafAhduySDWEYaQsl3RFGiB6Tsce4NkgGlbx+WtqatqjM9ZlOAVJ0tWmPeWEvzYX3gYcOY9cuKzsLE1EVK5oagQJ7/4DDlXS67gZTVqI6dlXxwNaIXrJ06j75UZkFhoHbNyK7Zqh2E3usHAlCupDgFhtSAJEmdsxsqJqZSHevmJaHPoC6vm1nvpNdTu7t6R+L4DjAk06t7M+tKuDb+QkQTw00EFTl2XQawjDIHFOyVj6h+frSeY4uC2it1MRVXgIeUIpBLTWcjdxMJArDgpN2/JPlpF8PlzwoPDjl9v0vZ1N2k1apz+ehJyVaZzS3HimUMKIoWUWrusqtDqUTR46308/bUKekghU1QBkbq+PbPXPkNuEog8DAOS5+ABzVEzSWj9GDSf+JVbXbovAcNs+oODFYSjsp8oqCm2gcj06z9BOHJNbjTZ7RDt/oQQWa2ZXEw0ZWY1yYzYGdCYuj5L7AJNwgBlvHRgj3mjnfvtx0YlS/Zcp9dj6wU5nmpiysccdLMYm5UECr3HruHwQ3/P+KPLzcWZ6VOQfdG5xWbVzl0R9fJgEI7DjO0Eu85rQSTuH1lbV45HbmYSzl1OR+2im4g0ZEJpyETdAC26zpnv1tDdt4AptulPNJ1rplMKUY6uFh8PxL5LARDrCMMtLtvJJAYw3qqTlcOCw7JYLUoBwWHZWWvBIYJxz3jeAiZxv7R0AZJ3bIetdT1B7T4voebTPc0VMbe2G08Wur26sII+6JyD5x4JQU6+FkfOp+DA2es4fO4GsvO1qFk5BE3qVEaTupWNn9G1K0AmILT1fQ8YxhhKqfTi9ewBoPQjSiFAxAasOh2AbfGBRr0qMY4wPJ86phLuFmBm7ibo2oSioYAL+uPXgKvpBIMe9VavgctnE5C7fyuyz58Bc2oRVKMWaj7XBxVbWGuELjxMsOxIAYjUtaqMo9Z90CkHz7WwXkoNPMXZy2k4ePYGDvx3HVdSTHIjBqCVn7verJQJwBQzjKnzJyRlPcZJuJ6UxwsAHEoP/joXgA3nAiHWEYa3ps7dAgyTeTwSRdHcuecDYzdXHCN4oBrwaH3v9Fqr55GWmY2ICNe3XWtOEvyy17MVZmRsLnq2dH4bdv5qBt6Ytg3d29TDOAFvhjIFmNLDGp+c1UxCycs8xTu3jcrMJDvi5VhxOghiHWF4Z+rcvRXGGBy2EvCYABB8sZHggycpqoa6f+lgya/MXC20RUUIDXV9gGJueb/d5tkZ5r0OOejd2nldm/+5gkkLDuOzQe3QrY1r2+0yDZjiwbp4PUNJeelKSqlZSX3/ZRkWHVNArCMMbwFm/AaC8c9Qt65rPWkDCw7Lggw9YVLhcprWnCCoH5qKGmHUaC4tl8sgl0kgl7FPqWhdt6upuQiWc1AoXN96MSd849ez62/31YPeeSwHL7Z1DpixvxzA7hNJWP9lL1RmjgtcJL8ADOOBSkWDCqiGaQoYlYn+TZJh/hEF3HGE4YqpQp7/sC0PrzRPhYxPg9yQjmCkoTA/HUV5aZDq0wBZBQQ0my6kKFE028/BGODpOYHBYfPy8qDT6aDT6Y2flolpUxeDhznscAWkfxKzEFNDAbncteIk8xIzYinxSBj1VrtcvPSo4y0Zs0Z96qPVqFpBgcXjnhXEx/saMCZfZNmTQCjTmZCAEC0oUglPU3iOnDEYtCcb16nCrDaN6ZxKU1HK0xOEIOrMDSlmHnDPEYZLzhoKAW0aivLSQXRpCKRp4HTpKMxNAy1KN36XE+cRAHjKIb/pckhk7h967bXz70STao47wWHZ9bZebwJOMYDY38Zrb4vEtKwZeAKMq5IJSDKZFOuPpqFr8yqCNBjYDd3AXwwgnPu+2Qa3zccrjzleNY7G3cR7P+7G8+2jMWaAMH8r9zVg4pKynudA1jmawExnjKf8fwRkAwF+j46MuJSoyupEKdkdnyoh0/e65wjDUX1c3MdA3hUEEO+YL6fU+BwRNUQa07tAM7v5OpNM8LoXg8PqDXrotHrojUDSQafXgXmrKZ3i0uV4vKkwiT2TJ/WcqYWBBLp8PzkieK1NIV5r71iO8/2qE1i2O8542GeHfiHpvgbMRVX2RzzlpwnpKCGEOa76i5dynxCeTriaTvpP2RnqliMMhwC9MBaBBaeFNEcQTU7FvpDWeU0QrVCiCynA7jjHip9Cy3FFxxz/mVYi0//sPD2u5wWgXUOBSmkAXvtVj7R819s3R215ta0Orz/m2FVVnwkbkJyWa7xOZtfKQtJ9DZiEpKzXAfKbkI6W0JAiQrDyZjZ5adyWUM4dRxiO6qOqRVCkLRPXHCfUt2gjhLXw7jmGBYdl18Uf+Tg47K4LBCz0uZh6P1oJnL/p/qH/5dYGvNnBfv5rN7PRb9JGVAoLwoavrC1enQ3gfQ2YC1ey6kil3CV2lhE7S7MKuMIxf4UGuuMIw1FdhszjCLk6XmxTHNLrqRT5TVdAJnNfPaR04cbgsPsIJjzrmbqL2E4evgxsPy+uXubM7+Vfmbss9661X2lDMdhuABRgyc4LmLnmJGKbKfHlW8KNyu5rwLBBS0zSbKBuWGOyWCoj1rrnCMPRZNEX5SLk3ACmVih2PjmkV9WYiso1RHrec1I7i1HJ5Ct3Kjiso6rPXgeY9P6bPsKB2uSRWKSlZbjNy3FjhuOTD5kIzja9891OnEhMxVs9muHVbsL5e98DJu5ydkNOxh934enfhmPsUDl0ZRgCZUS0IwyHWzJmqPPfcATorrk9yKUzZld5DTKlKUCQNxLr98jlJhV/X6ZrmcBXmwnmDBReb2R0CxQWmiOaiG5uj+5dsOyPH23yMd2ybmNWg6nJfDv8cbRpLDzO6H0PGMaN2zYyi8Q6/Ru+Ogw6A8FfIh1hOBs5evE7KLJ3ih5cRxluSR5FWLNxXiuPFeRJ6D53G5KWC3y4gmDhG8IAw7Ssa9Vlpsrup8jaNXHh+A6bAnYcu4bPfjto/H3z1D4IZ5JcgalMAIb1NVGlHkwpmQ1QwRf3H6wPRU6Re44wHPHXcGMTQm7+LJD9rsnU+soIaO2ux1z75Yu163fdStcUuYXA6wsIVg4VBpjMLDUeaOrgAOK6OjNFcvwhVCiluzbh90PYdvQqqlcMxuovSjSkhRRbZgDDOnsxOaczpYaFlEKQp4Sxm0KQlidxyxGGI+Zqs+IRfuUDIbwXTJMWsxghIc79CAsu7C6Ndg0lAAAdVklEQVStMEws88Jsgg3DhQEmSXUdLdt55hLJuIKs/g2x7UvcdrJtWPcxq40q/h2bKfGViAM/K69MAYZ16NKlzHCDlHwBwr0FUKdr7efbQpCs8a4jjMKCfITHDQRH3d97l578qmqTUblWczGYcErLzjDT+/hej63HLA5r32YOCl135dyFeHTuahtsynVOa4qvPv8II4aVyLJOXUzFsG9NW+bXuz+EISK9lJc5wBSz69KNzEheLxlFQVnEIrvmUlN3B+NiuncdYWi1OsjjP0KQznvxIDVVh0Bem1kreCcZg8N2pwhzX4juVkN6zebwx+u8oHr/OXoCPXrZBpsSW/GAvj3wy6yvzdl+WnsKi3aYnKFPHtIBnZu79qBpWWeZBUxxJ69coYE6ae4zlOqfIyBPM59uxc++36/AuZvedYTBJNz6+OkIL3AVn1b40N8K6oawRu8Jz+CCcvImgiEdKKoLF7p7pe4B8zl8148XVO+uPQcwYNAwj+tt0iga/+4t0Z4a8MUms9HY0vE9ECnUHc7tlpR5wFhyfA+l0lqq7L4A/QlAhTmHgnA8We51Rxh5FxejcvZSjwe7uIAk/cOo0nqK18qbsYPghebUGO7Dl+n1Pzh89iwvqN71G7fhzbc/9Lh5LALCzr+PQVMkR2w0Na4u566m49J1tVElRqyDEb8CTDH3LyblPMhTw67fjwZVPXTV+44wspP2oVq6IBU3QRPiprYWwtvOE0QrhGj2PoKO0dSoR+fL9O5SDm/H8oLq/XP5Gowc7R2tic9/XIlNyU2wY5RH1gJGVvklYFjHL6k0Ty85EbhxV6KceNsRRuatS6h1fYTX5mK+IQR5TZcbDb+8kVhw2MY1KFrV8UZpwsv4ZC3BCw8LC0o7/7fF+HRCydnDWS1FOSmQh1S363aX5XtlxGTEBfbCxveAIMFCB/s1+i1gGDsGL9Cvvpgm6eVtRxgZGZmomTQYHNUKn01OKHlIcEG5AfWE+eB2WefKY0DVMCDWO0G5XNZXTMDOTu3qUzxuinDhNH0/cx6+nGYrpS+diflxLkhPgFRRGfIQ+wzq9OxA5DUei5VDgYruObw0V+vXgOn8LR3L85jibUcY6iw1KiV9CLnhpqt5Ieg5DxkOV16PRyKFyTBcFbrxDPNZJj44rKtyXT1nvsYaVqeC4k1OmfoDfpjl2ncYb9CiMOOS0edyUOVoEGM4cuvUuGkrBHdbgIVvALWs4++6arLNc78GTOx0yq6efvS2I4zs7ByEJY1HkNYUactZ4kkg9FwE9JIKMEgijH8bjN/Z36bftCQcudLaeKC6q9KEPd8dB2Tliw8OK6x0x1Q/7SWoGkrRt4XrksZN/Brzfl3skpB59S9IN13hy0KrQxZkK+ANCQ1Do7ePYO5AoIF1DFqX5Zcm8G/AfENfB8Fv3naEkZubi6CkbxCou2yc9CZARJgBwcCRVlgZV3KC0aSmAhwnQYBcYowHI5FIwIN9MjPfkt/shcUQPdq3Mxy5DLDwfQNFBod1t77ifMyxuVxCBdX7wZgJWLzUdXh3Zh7NtmSgPCQBIQgIt+8/qtmw3fj5zep4yDoGregu+TVgOk2nTNl8pbcdYeTnFyA9U2MMDhQYIIFcwoGTSGCgnHHLECTnIJVIMG2H1BjywtcCRBYc9shlgrdEBocVPbtKZVjyDwGLLyqk3mHvjsGa9ZtdV0k4FGZdBa/NM/JbUcX+wSy692z8PDoWAjwpOa3TvwEzjXajHLa0b0DxSXfvnA9cj3AJxfe7TG5bq4aKyeU5bWIqsOkswcguvu3zyuPE6IBDSL2DBr+Hrdv3uOxshVqNkZqwH7q8NCNtYKUG4CS2V2G1OozE7ClvoZOHFx3+DZjptD0F/m4RRTHpOd9OHja4c/cRdHuQGh3r+TKxScuMuXz9kmDRmM/dgKB6+wwYgv0HjrhkS6+Bb2PlbzNQpDbZILEtGdualU4VH3gaX0/92ii89HZSVpY7NQllzvOLfYG7W7d7Nqe3a/NGA1hR7WfQZhKKU0yAN62396wkhTKFyUPa1qVo6KXDvNB62YH/2x0EXzzv/cnjrA07zhPsT4SgepkeGdMnc5V++nE6Phz/PTITmEIlhSykOmQK24M/W3mmzV2Lpxp7f5z9BjCPT6P1DRwuetMRhqsBtnzOnFHEVAMeVvp24hbpmata4lHcFzH9LKZl8TJXn4Cgep98+kWcPmtSknSWVi/7BZNmrsc/G2eC1xVAqqgEeYjtVRjhpPji1wN49qE7x+uYyAi7C4E3XvA+XWFU6Vo1ABsP2MzJwvDlMnjTEYarAbZ8zrYoVUKBR+vduUF01J67YUR2OhmYs49g9suu+9uhy/OIT2DyFedpz/bVWLXtFL77/F3o8zMhCQxHQJh9nZ/RU5diYJc7p95QZgCTnKHLppTaHK3Zm3bwYhkqKIDFg72/VLsabLZFYbYhnRu6nkCuyhL7/G4AJuEWwKT9QsyUWz3WDdeSkl1268zR3ThwLgtDBzyFIo0KnDwYgRH2VfYrP/jCzKTdX3pPZ8ll60wE990Kk5yhi6OU2kSaZx5OBy2UIkDqPUcYAnloJDtwkSC7AHj6Dm4THK4wIoPDiumXI1pVJjBqBcGqYa5fEA+16IxbqaabL2cp+dJJ3MqRoGXL1si7cRKcNAiBFe2vIopqDZemn133kqsyvf38fgTMJkops4WxSUOWSFGoI9joRUcYQhl+SgUkZZK7EtBp3DpgsjhzdqHdckiXlQcMWcReTq4Bw+z5mV2/sxQcrMCVuH+NoQof7DwESf/+aTz4B1WyH8tDHl7zhDpxlwA9A4+7alXAfQcYVYb2V1C8YY8N7y6XQl1AsGoojyD3vZK6zWHm9siDmK9u13u3Mgrtb71GbZCbm+e0mbVq1cDJIyavMK99OAvrfp0IfVEOFJWj7earUKUG9mxZ45WuOzqv2Cv8vgNMcqZuCuXpWHudGb1GipvZxKuOMLwyIn5eSGSDR8AiQDtLDzZ+ALu3rTKSzPrzAMa//xK0OSlQVLHZfd8uhuDQ/p1QKDyPiFCmAaNK17KD3g/2mP/ZXxJcyeAw/xUeNT3UZPXzOe7V7tes2wx6vcFpme3btcaa5SbX2gfP56Dnk62NipiKqo7tB1at+BMPPdjE47a6kr1YVnD/rTAZ+r6U8ivscWnyVgnibnL4sT+P+l6yN/F4NMoLQLXIh2zizpRmy9PduuCP+ab3YE4h8OCjzyMzfrvDMwyjm/rVZPR8vofHHC7TgLmRpetoMFC7Ximm75TgVDJn1G96srHrw6jHnC4vQBAHqipd+zvu/2JP/Dhjsrm8zv0n4sSWHx3KYRjh0DcH44NRnt8sl2nApGTROnqD7oq9kZq1T4IjV0Q7/xc06OVE7nPg6DS2bXL+AqvW4hVEdvnEXEna2bW4uGY4pEGO99ZPPv4YZs3y3DNpmQYM42hyujaBAjbXJxvOcFhxggHGI+UD92dGeU67HDg6/SGAd36GqfHoMNTuULJaFGZexem5T4CTOL7ufCCmAf7dv0EQ11MyrWN6WmYq84C5lqEdyVF8J4hTlkQc+URZUSbMG4PowsVlSEhSO3zlBtm5+alR0UOPD+KaZ5fa0aQryM+3oi/d/ocfaYOCQudxQCeOHYUPRrxpLocZk8U0i8Wt1HSHLQ+Qy3Hj0jFjzE1Xya8Bw4IuJWfoFgJ42RWjip8TQlbVqijtbwz3dw8kfwJM23YdkaXWOOX6tMljMWzIQCuawW9/hJVrNznNt37Fr+jc8VGXI+rXgCnmjipT353w/Es80IIALDAIM56QMFBQSpmkLAUEJzmeX1qrSuBfLrnqQwJ/AkyXJ7sh+bo5ALZdLs+cPgmvDuxj9ezPFesxbETJucZexrfeeAnTv3QdQqTMAyY5TdeZEspcjdjXjfDm5Ka4REDerF1F5tos0Ev1+hNger7QGxfiLzrl3PyfpqJfb+sr4vSMTDR4qCOYy15HSVmrJs4ddx3Dp8wDRpWhvQQKYfGjvTGJCS4rK8nvPDhvt9WfADPwlUE4etx5ROpFv/6A55950mYkn+zxMv45etLpCB/esw5NGjm3Vy77gEnX+lyQIua2xFOM+hNghg8fjp17Djhl2aolc9C1i21A1x9//h3jJn3jNO+EsaPwocWFgT3isg+Y8hXGatzv51uyTz75GGvWb3E66Teu+h0dLYIlFRNfuapCs7bOgzG1a9MCW9ezKI+OU5kHTPkZxnrw72fAfP3VFPy+yK42k7mTOzf+idYt7cfB7PBkH6cmzsz/29ULhxAe5thlT5kHjOV0SUzKfp6CLwkMAnIjJjLcyo3bRZV6Kk8xxpyPIjsmqiQgYkKS5jpAzfauBFzP6Miw9Z5urdzN709bsjmzZ+K7mb84ZdWBnavR9MFGdmm+/XE+Jn7pXOy2cP536NnD8UrkX4BRaSZQSieauUnIphhl+LNWoFJpFlFKSy7yCYmLUYabRyBBpdkISp8pzkMImRitDP/c3QnvaT5/AsyyJQswYcq3Tll29O+NaBht/45HyLZs0Et9MOvbSQ7r8DfArKOUPm/BjSkxkRFWl++JKvUuSvF4CSCwO1oZ0aX4e0KSmmn2fWoBmPXRynAf2ymW9MCfALNt8zqMGD3BKWDOHt2BKKVj36+du/XD8VNnHZZRu2YNnD+xqxwwjAOJKvU1SlHiDYGgT4wywspZb8I19QUQlBhPULokJqqCecVJUKl7g8JkocS0zQiSopURUZ6uFO7m9yfA/HtoL14Z8r5TViWe2Y9qVR2HUftp7kJ84iLGjLNVqsysMKcTk2s3i67t0KXIheTsSlJK0yilJRqVFPVjoiIuW59z1Ew5q8T9EsE3McoI85km4Zq6HgjMvn4IIVRPSJVGtcMy3J30nuTzJ8AkXjiJZ3uXRD+2xzdV/BGEhzsO1JlyMxWNHnncqRDzmymfYuhg+9pS3gKMq/kqZE54pBp85sy1CjRIEmww2BfnKoKC23NEsrzk/IKc/PycRjzTzrudQoLCAi3BwH6mlH6eV5Bjjo3HEUIUitALoDBfpfDU0C+/IM+5gEAIB9ygCVGEXXeUrawpX2bcvIx2jzuPHJ167SQCA5yHZevR9w3s+9uxy9mnn+qMZQtYyFPb5Awwaek3BcUBkEg4jhQY8po2jcpyY8gtprAnuV3kTVCpPwKFOcgkIdgbrYzobJntokrTgKfUKjY4B/RvEBlRAjTT1m4Ppehk0fIxMcoI51KxO9Q3f1phaFEmHmhuNWQ2XNWknHMYpq+YePGytXhnpPkYalNGSEgwkuIOQyq11V721grjjeng0QrjqgGJKs0SSqmF/ynyfUxk+CjLfAlJWR0BYmWFKZVyHevVDPvbmk7zHUBHFv9GCPkzWhkuWOPZVVvFPPcnwFQI5lE1qrlD9jA1/bSkUy7Zl52TiwYPdkBhUZFD2u0blqBta9u6/AcwSZrzFNR8PcxR8mqDqHCm2m9O8Uma/gTUKjY4R0h0A2W4lcbfxWuaQTyhC8yAAbkQHRne2OVI3QECfwIME7pWr9sC+QUFdjkZFhqK5MR/BHH5taEfOtUa+GT0u/hk9Ds2ZfkFYG7coIo8gyabUpiDHUqItGl9ZYjV/WJikmYUBbW66A+RhgfXrEmsLJsuqXIfMlD9mZIVBoZgSXhYaTpBI+chkb8BpknLJ6BKvmGXa1WrVMbFs/sFcXT7rv3o8/Iwh7SO1GT8AjCJydmPUp4/ZMGdwmhleCghRG+11VKpp4HiI4vfNDGRETbG4JRSaaJKk8Ni9ZhBw3HtomuHHRY0Wl4kEgsYL1bt9aJcWVyyCnv1HYBz5+x78K9Zswb27NwqqF16gwGxnZ9Eerr9y01mffnv4QNQKIIElceIfKl0y+q7Y2eY+CTNOwS05NqDkKMxyvDWpTmRqNIsppRanEXIhRgHW60ElYb5I21VXAYFGd4wMtxzTwqCh8dE6G+AGfzW2zhwwPLdV8KwunXqYOtm4VpKX0+bjt//cKxs+cu8n9Gh/WOCR6TMACZRlT2PUr7E0Jtw82KUYUNLcyL+mno3ISi5hiFkV4wy/Al7HEtQZc8F5d8q2ZZx86OVYebvgrnsIaG/Aeaj/43Fhr/smxs3bBiDDWtXCubohbg49OzVzyH9kMGv46MPzXc7LsstO4BJ0hyloC3Nkxt4JzoyYnZpDiRcU8eBwOxTlFK6uGFUhVfscSoxSf02BcwrCgE5Fh0Zbl5xXHLXSwRiAXM/ayuztn88/mv8PM/qrsbMyRbNH8KeLVYSAJdcZnKd/87H26Vr3uxB7NtmrR1d5s8w7LxxUZWdQ0Etzhvk0eja4TaSq4Qko4cFs5iYI9y0Bsqw/9kFTLKmLeWp+cxCQAobKMNszkUuR8xDAn8DzLTv5mDy1B/tcq1d25bYus4+mByxedacBRg7cardxxzH4VrcYSt1/zIPmMuqzKZ6ylnatRpCpPlhNWvWtLr5unmTBmdrNbmWnCOUjIqOCv/eHjdv3LihyNUrspmzjOLnUsI3q6esaL498xALgrL7G2B+W7gcI8fYVw5/PPYxrFvO3DcIT2npGWj4cGfo9Vb3P+YCmMSfSf6LU5kHTPy17FcJ4f8o2Y6R89GR4Taepy+pNNEGShOsAYN+0VERDi2WEpM05yioWf5CKfdaw6gws3xG+LC5T+lvgNmwaQcGDravgNm9a2csX2hfpcUZh/u/+i42b9ttl2T40Ffx1eclm4wyD5jEJM131FoqvyRaGW7tuMqo7pIVSynZa8k1Cr5jw8iKVlJ+y+elb9UIyPfRpbQH3IeCsJz+BphDR46jW0+7x0qj4RczABObNm7ZhZdef89uNmaMxozS/GaFSVSp91KKWAtufBQTGTG9NHcuXtf05w3WUn4CNIiOjHAYhTQhST0agFmHjBDsi1ZGlOiYiR05N+j9DTDxiZfRqoOVzZ+Za/369MD8WfbPI85Yq9Pp0fDhTmDumEondo5hZssRtzWgy/QKw1T5L6o0WZbq+pTiiYZRETYWQolJ2R9Q8DMsGRakDFcoCbGvhwEg/pq6CyEwO7MigKaBMrwCU/l3Y+67lcXfAMNC9tVp1M4ur159uQ9mznBsLemMwWMnTMOsueaduxXp0j9m4ZluJpvCMg2YxCR1fQqY9cDYRA4MC6usDCc2r5KEJDVbKdiKUZzUMZERFZwxWaXSVCwE0i1tbFytSm6hwkkmR4Cxp9rPirnfr5WZM75KymYwGGw99Qr1XmmPnefjEtG2k6UxbgmV5TmmbAMmWd2H8jBLsgjBtWhlhN1wuglJmiWAlTbz+Rg7lwOlmZ2oUl+lFGaLS8Khb3TtCLNFprcBUro8fwMM6z/zYpmaZutc/L23X8eUCZaaTeK437l7Pxw/aWu+3Oyhxvh7h2lIyzZgktRTKGCOY0kI1kUrI+xaICUkqZl715LzB8WumKgIu1J+y2FIVKnXUgqzTT8BvoyOjHBsbCFuDF1SiwWMywLvIoEQXTLWvB49+yAhwcpsydjqYUOHYNT79g/vQrq1bPkqTPj8CxtSdo759/DfCA1lLrcdp/te0p+g0myCRWhx5jGmYVQFu5f4CSpNHCg1S/kJIYuileGDXDE6/lrWBOY5xkxHyOYYZbjZq4yr/J4+90fAvPbGWzh8xFaNf8S772D4OzYaT4JZnJubi/Ydu9gNqTF39kx0irX1qGlZuM8Bc+PGZa86k8jVVzwGwOwRQQLD4CCpxq5LkFxDxXOgCC5mAOEwO5jLdHnlUqAP72KA5FcLxqWHSDPNajiCR8tNwlx9xav2sjo6w9ymTeCobjTR3bpjQlaDvLbddjnrptAV5oPRH2PTZlsPmLVrVv1q7+bf57rJSmO2Zu36TM3LLzArmAVWqo+qD/dD96c6Y1T3CiASx/F1JNpku9t9T9rjLO8d01a+Uw0uL/fucCCoSqPvCYGN9JJS8n5B2nn7ejMCmxpUpUl7TsL9HRHdBVWbD0CYspXRNZA+Lz394IQq91SI4HLACBxUfydTVGs8FpROseUDHZafGufRCtNxOh1nyM+YKFVUMqs86fLSaW7y0U1n5j/teahlLw5eOWC8yMyyXJSiWqMhoLBRGiOUvpaXFueRalLsdPongAGMfwUZl6G4sARtcw4e/XrXNhv7qbvN43sCMGcSUyy1Asw8aRpdw+gcw9FzMcwrLktMnnLaEg4oqjV8DpSzsRSjPAYUpF9Y5gmvOs2gbXke069tm8A9l7enaYNQWXCAhKMNK4ZFdl6yxqHfO0/qdDfvPQEYdxtfns93HIj9xpBm0BVUpgYteH0ReL0W1FAEWXDl/w5+VvEhIS1JSbli98VYnLdGjbr7furWZVGYXDawYlAAgmTSMY8vXn1XXGk56k+ZBYw3ViV7TLvXVipXk1DIRHZGwyYxex47nf4LwJ6xXuK+0cR5CDERjdjzWs8IXsvdvJRTGDDt7HXt9QLtmIJbF34QUcQdJS2zgLmjXPPHwmu2UCj0+SxYr1XiCN8l91a8fT19kXwqBv9Xg975fuHZaw9reZN6YLWqlfYe2rGoRO4motxiwIvI4pS0HDDe4qSflDPrqS5aA6UyAtAR23dz3u52gyffH3vj9HYWrcE0Nyl0lCOjC255dnXtrXaWA8ZbnPSTcna/3PsyBa0LILPLkjWVvN3tyk2emp+fljTEVC5N43j0zU2Ps/KM6u06xZRXDhgx3Cqnxe6Xe12gYKFJSF6XJaudK3qJ5xdRVG3ETNvZJcI5nqPPFt6ME629IL5a4TnKNGAopfLkbIRIDAgBj2BQnUJPiUIqQRD7JNSgAIgCBIGUkkCOIIAHH0gIFwBKAkH5QEogJwRyUCKn4OWEcDJCIQeBnFLIACoFAfOgLQX7TnH7O5UCHAdQCQjhQKkEIKbvAGf8m4DAFAqEEGIcCnLbbMH4m3FDAtDbtj70dtADCmb7w/6B8gB4gBiMfxNiAGW/se8sogLRg0IPYvyvA2D6DqIn7DuFlhJoKeV1BJwWhGophZZQaEG4QhBaSClfxIEr/HbR1mZrli2unp/8X6tcHW92bhJdv/6cLRvW/AIiyweHPIMEubXDkEsI0QqfhibK4KqNXqEA86hxOF9X1B1Zl5mDlHsq3dOASU2lIQYZKuv0usrgSCUJIRUBvgLlSQVKEMGBhPOgEaB8OEDCKBBGYAyJEUKBEAI2ocuTOxw4dfoMzp0/j/j4RJw5+x/i4uJZGBKbotq0boWFf9jGwKSAjgDMwUkuBXIIkA3QbBBOw4GoeVANoVATjmYBXJaB0syWrR79SSaX33rhuef7zpr2P/u+ad3pjBfz3BXAUEq5lCzUNhj0dQmhUQBRArQWBalBCGoAtBqlqAZAuM9QLzKlvCjgzaHDceCgydslc+Eqk8nNoSiYIRn7r9PpUCEiAn/vMxvAepN1BYTgFkBuUYoUApoCEBYcWEUpuSaRSK/UqIBkQghbZX2W7jhgKKWylCx9WwOPdoTQhylIE0IRbemzzGe9La+oTHGA+aWjBIkE9Byl5JSEw6EaFaRHCCFs+3lH0h0FTHK6bjIFhoNtm8pTOQd8wgGiJsBPtSvLrAIPe6vqOw8YguGg5YDx1oCVl+OCA4SoCb1PAcO6Zt6SAe0IpQ9TigcBRANwHhSxfGaUc8A1B1g4s0RC8B8l5JQE9/mWzFF/iw/9hOjrGkCiYKDmQz9AaxKCqpSSagAtP/S7njRllIIUEELZgT+VgqZwIDeMh34JUUlAr1FaRg/9noxm8bUy1esq6+1cK5vORiS8/FrZEy7fmbzOrpUBqgGImhCoCUqulaU8zSBSWbpEh/SqVYmVz+0700rxpd7RM4z45ng3hz3BJSREoadQSDkSZKBQgPIKUAeCS8IHMiElE16aBZeAnICTWQouCYHUJMQ0Ci9vCy6JlIJKOJOAkqNMcGkrwCTMFJdYCCwtBZilBZbsO5NWwiQPoaUFlsQouGQSS8oTkzCzRHAJGIWVtLTgEryOAtpiwSUTWjJhJqi14JKnKCKEFoKgEITLlxDk63laICXIh4Hme0Nw6d3RvzOl/R8AdGoXzom1qQAAAABJRU5ErkJggg==";
/***/ })
}]);