You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
4776 lines
295 KiB
4776 lines
295 KiB
"use strict";
|
|
(self["webpackChunk"] = self["webpackChunk"] || []).push([[3260],{
|
|
|
|
/***/ 89293:
|
|
/*!*******************************************************!*\
|
|
!*** ./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"});
|
|
|
|
/***/ }),
|
|
|
|
/***/ 5135:
|
|
/*!*********************************************!*\
|
|
!*** ./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);
|
|
var __defProp = Object.defineProperty;
|
|
var __getOwnPropSymbols = Object.getOwnPropertySymbols;
|
|
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
var __propIsEnum = Object.prototype.propertyIsEnumerable;
|
|
var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
|
|
var __spreadValues = (a, b) => {
|
|
for (var prop in b || (b = {}))
|
|
if (__hasOwnProp.call(b, prop))
|
|
__defNormalProp(a, prop, b[prop]);
|
|
if (__getOwnPropSymbols)
|
|
for (var prop of __getOwnPropSymbols(b)) {
|
|
if (__propIsEnum.call(b, prop))
|
|
__defNormalProp(a, prop, b[prop]);
|
|
}
|
|
return a;
|
|
};
|
|
|
|
const SvgJiangxu = (props) => /* @__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+");
|
|
|
|
|
|
/***/ }),
|
|
|
|
/***/ 60113:
|
|
/*!*********************************************!*\
|
|
!*** ./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);
|
|
var __defProp = Object.defineProperty;
|
|
var __getOwnPropSymbols = Object.getOwnPropertySymbols;
|
|
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
var __propIsEnum = Object.prototype.propertyIsEnumerable;
|
|
var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
|
|
var __spreadValues = (a, b) => {
|
|
for (var prop in b || (b = {}))
|
|
if (__hasOwnProp.call(b, prop))
|
|
__defNormalProp(a, prop, b[prop]);
|
|
if (__getOwnPropSymbols)
|
|
for (var prop of __getOwnPropSymbols(b)) {
|
|
if (__propIsEnum.call(b, prop))
|
|
__defNormalProp(a, prop, b[prop]);
|
|
}
|
|
return a;
|
|
};
|
|
|
|
const SvgShengxu = (props) => /* @__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==");
|
|
|
|
|
|
/***/ }),
|
|
|
|
/***/ 16800:
|
|
/*!**********************************************!*\
|
|
!*** ./src/components/AsyncButton/index.tsx ***!
|
|
\**********************************************/
|
|
/***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) {
|
|
|
|
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
|
|
/* harmony export */ Z: function() { return /* binding */ AsyncButton; }
|
|
/* harmony export */ });
|
|
/* harmony import */ var antd__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! antd */ 3113);
|
|
/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! react */ 59301);
|
|
var __defProp = Object.defineProperty;
|
|
var __defProps = Object.defineProperties;
|
|
var __getOwnPropDescs = Object.getOwnPropertyDescriptors;
|
|
var __getOwnPropSymbols = Object.getOwnPropertySymbols;
|
|
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
var __propIsEnum = Object.prototype.propertyIsEnumerable;
|
|
var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
|
|
var __spreadValues = (a, b) => {
|
|
for (var prop in b || (b = {}))
|
|
if (__hasOwnProp.call(b, prop))
|
|
__defNormalProp(a, prop, b[prop]);
|
|
if (__getOwnPropSymbols)
|
|
for (var prop of __getOwnPropSymbols(b)) {
|
|
if (__propIsEnum.call(b, prop))
|
|
__defNormalProp(a, prop, b[prop]);
|
|
}
|
|
return a;
|
|
};
|
|
var __spreadProps = (a, b) => __defProps(a, __getOwnPropDescs(b));
|
|
var __objRest = (source, exclude) => {
|
|
var target = {};
|
|
for (var prop in source)
|
|
if (__hasOwnProp.call(source, prop) && exclude.indexOf(prop) < 0)
|
|
target[prop] = source[prop];
|
|
if (source != null && __getOwnPropSymbols)
|
|
for (var prop of __getOwnPropSymbols(source)) {
|
|
if (exclude.indexOf(prop) < 0 && __propIsEnum.call(source, prop))
|
|
target[prop] = source[prop];
|
|
}
|
|
return target;
|
|
};
|
|
var __async = (__this, __arguments, generator) => {
|
|
return new Promise((resolve, reject) => {
|
|
var fulfilled = (value) => {
|
|
try {
|
|
step(generator.next(value));
|
|
} catch (e) {
|
|
reject(e);
|
|
}
|
|
};
|
|
var rejected = (value) => {
|
|
try {
|
|
step(generator.throw(value));
|
|
} catch (e) {
|
|
reject(e);
|
|
}
|
|
};
|
|
var step = (x) => x.done ? resolve(x.value) : Promise.resolve(x.value).then(fulfilled, rejected);
|
|
step((generator = generator.apply(__this, __arguments)).next());
|
|
});
|
|
};
|
|
|
|
|
|
const AsyncButton = (_a) => {
|
|
var _b = _a, { children } = _b, props = __objRest(_b, ["children"]);
|
|
const [btnLoading, setBtnLoading] = (0,react__WEBPACK_IMPORTED_MODULE_0__.useState)(false);
|
|
return /* @__PURE__ */ react__WEBPACK_IMPORTED_MODULE_0__.createElement(antd__WEBPACK_IMPORTED_MODULE_1__/* ["default"] */ .ZP, __spreadProps(__spreadValues({}, props), { loading: btnLoading, onClick: (e) => __async(void 0, null, function* () {
|
|
try {
|
|
setBtnLoading(true);
|
|
yield props.onClick(e);
|
|
setBtnLoading(false);
|
|
} catch (error) {
|
|
console.error(error);
|
|
setBtnLoading(false);
|
|
}
|
|
}) }), children);
|
|
};
|
|
|
|
|
|
/***/ }),
|
|
|
|
/***/ 26415:
|
|
/*!***********************************************************!*\
|
|
!*** ./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"});
|
|
;// CONCATENATED MODULE: ./src/components/DigitalLabel/index.tsx
|
|
|
|
|
|
const DigitalLabel = ({ number, active, className }) => {
|
|
return /* @__PURE__ */ _react_17_0_2_react.createElement("div", { className: `${DigitalLabelmodules.digitalLabel} ${active ? DigitalLabelmodules.active : ""} ${className}` }, number);
|
|
};
|
|
/* harmony default export */ var components_DigitalLabel = (DigitalLabel);
|
|
|
|
|
|
/***/ }),
|
|
|
|
/***/ 86396:
|
|
/*!***********************************************************!*\
|
|
!*** ./src/components/QuestionText/index.tsx + 1 modules ***!
|
|
\***********************************************************/
|
|
/***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) {
|
|
|
|
|
|
// EXPORTS
|
|
__webpack_require__.d(__webpack_exports__, {
|
|
Z: function() { return /* binding */ components_QuestionText; }
|
|
});
|
|
|
|
;// CONCATENATED MODULE: ./src/components/QuestionText/index.less?modules
|
|
// extracted by mini-css-extract-plugin
|
|
/* harmony default export */ var QuestionTextmodules = ({"text":"text___bQulM","sup":"sup___rX_Y3"});
|
|
// EXTERNAL MODULE: ./node_modules/_antd@5.9.0@antd/es/form/index.js + 19 modules
|
|
var es_form = __webpack_require__(78241);
|
|
;// CONCATENATED MODULE: ./src/components/QuestionText/index.tsx
|
|
/* provided dependency */ var React = __webpack_require__(/*! react */ 59301);
|
|
|
|
|
|
const QuestionText = ({ text, name = "question_score" }) => {
|
|
const Text = ({ value }) => {
|
|
return /* @__PURE__ */ React.createElement("div", { className: QuestionTextmodules.text }, /* @__PURE__ */ React.createElement("span", { className: QuestionTextmodules.sup }, "*"), /* @__PURE__ */ React.createElement("span", { className: "mr10" }, "\u5206\u503C"), /* @__PURE__ */ React.createElement("span", null, value || "--"), /* @__PURE__ */ React.createElement("span", { className: "c-grey-999" }, text));
|
|
};
|
|
return /* @__PURE__ */ React.createElement(es_form["default"].Item, { noStyle: true, name }, /* @__PURE__ */ React.createElement(Text, null));
|
|
};
|
|
/* harmony default export */ var components_QuestionText = (QuestionText);
|
|
|
|
|
|
/***/ }),
|
|
|
|
/***/ 80156:
|
|
/*!***************************************************************************************************!*\
|
|
!*** ./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/_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__(46651);
|
|
// 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__(21873);
|
|
// EXTERNAL MODULE: ./src/utils/util.tsx
|
|
var util = __webpack_require__(13462);
|
|
// EXTERNAL MODULE: ./src/.umi-production/exports.ts + 15 modules
|
|
var _umi_production_exports = __webpack_require__(67866);
|
|
;// 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"});
|
|
;// CONCATENATED MODULE: ./src/pages/Classrooms/Lists/Exercise/Edit/components/UploadQuestions/index.tsx
|
|
|
|
|
|
|
|
|
|
|
|
|
|
const UploadQuestions = ({ visible, onOk, onCancel }) => {
|
|
const [fileList, setFileList] = (0,_react_17_0_2_react.useState)([]);
|
|
const [loading, setLoading] = (0,_react_17_0_2_react.useState)(false);
|
|
const params = (0,_umi_production_exports.useParams)();
|
|
(0,_react_17_0_2_react.useEffect)(() => {
|
|
if (!visible) {
|
|
setFileList([]);
|
|
setLoading(false);
|
|
}
|
|
}, [visible]);
|
|
const handleOk = () => {
|
|
setLoading(true);
|
|
onOk(fileList, () => {
|
|
setLoading(false);
|
|
});
|
|
};
|
|
const handleCancel = () => {
|
|
onCancel();
|
|
};
|
|
const down = () => {
|
|
const url = `${env/* default */.Z.API_SERVER}/api/courses/${params.coursesId}/exercises/down_template`;
|
|
(0,util/* downLoadLink */.Nd)(null, url);
|
|
};
|
|
const handleBeforeUpload = (info) => {
|
|
const param = { name: info.name, uid: info.uid, file: info };
|
|
setFileList([param]);
|
|
return false;
|
|
};
|
|
const handleRemove = () => {
|
|
setFileList([]);
|
|
};
|
|
return /* @__PURE__ */ _react_17_0_2_react.createElement(
|
|
modal["default"],
|
|
{
|
|
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
|
|
},
|
|
/* @__PURE__ */ _react_17_0_2_react.createElement("div", { className: UploadQuestionsmodules.content }, /* @__PURE__ */ _react_17_0_2_react.createElement("aside", null, /* @__PURE__ */ _react_17_0_2_react.createElement("div", { style: { fontWeight: 600 } }, "\u6B65\u9AA41"), /* @__PURE__ */ _react_17_0_2_react.createElement("ul", null, /* @__PURE__ */ _react_17_0_2_react.createElement("li", null, /* @__PURE__ */ _react_17_0_2_react.createElement("span", { style: { color: "#5F6367" } }, "\u6839\u636E\u6A21\u677F\u8981\u6C42\u7F16\u8F91\u9700\u8981\u4E0A\u4F20\u7684\u8BD5\u9898"), /* @__PURE__ */ _react_17_0_2_react.createElement("span", { style: { color: "#0152d9", cursor: "pointer", marginLeft: 20 }, onClick: down }, "\u4E0B\u8F7D\u8003\u8BD5\u8BD5\u9898\u6A21\u677F"), /* @__PURE__ */ _react_17_0_2_react.createElement("i", { className: "iconfont icon-xiazai4 ml10", onClick: down, style: { fontSize: 14, cursor: "pointer", color: "#0152d9" } })), /* @__PURE__ */ _react_17_0_2_react.createElement("li", { style: { color: "#FA6400" }, className: "mt10" }, "\u63D0\u793A"), /* @__PURE__ */ _react_17_0_2_react.createElement("li", { className: UploadQuestionsmodules.infoText }, "1\u3001\u76EE\u524D\u4EC5\u652F\u6301Excel\u683C\u5F0F\u6A21\u677F\uFF1B "), /* @__PURE__ */ _react_17_0_2_react.createElement("li", { className: UploadQuestionsmodules.infoText }, "2\u3001\u4E0D\u652F\u6301\u7EC4\u5408\u9898\u548C\u5B9E\u8BAD\u9898\u5BFC\u5165\uFF1B"), /* @__PURE__ */ _react_17_0_2_react.createElement("li", { className: UploadQuestionsmodules.infoText }, "3\u3001\u6BCF\u6B21\u6700\u591A\u5BFC\u5165300\u9898\uFF1B"), /* @__PURE__ */ _react_17_0_2_react.createElement("li", { className: UploadQuestionsmodules.infoText }, "4\u3001\u586B\u7A7A\u9898\u5BFC\u5165\u6700\u591A\u652F\u63018\u4E2A\u586B\u7A7A\u9879\u3002"))), /* @__PURE__ */ _react_17_0_2_react.createElement("aside", { style: { marginTop: 22 } }, /* @__PURE__ */ _react_17_0_2_react.createElement("div", { style: { fontWeight: 600 } }, "\u6B65\u9AA42"), /* @__PURE__ */ _react_17_0_2_react.createElement("ul", { style: { flex: 1 } }, /* @__PURE__ */ _react_17_0_2_react.createElement("li", { style: { color: "#5F6367" } }, "\u4E0A\u4F20\u7F16\u8F91\u597D\u7684\u8BD5\u9898\u6587\u6863\uFF0C\u786E\u5B9A\u5BFC\u5165"), visible && /* @__PURE__ */ _react_17_0_2_react.createElement(
|
|
upload["default"],
|
|
{
|
|
action: `${env/* default */.Z.API_SERVER}/api/attachments.json`,
|
|
beforeUpload: handleBeforeUpload,
|
|
onRemove: handleRemove,
|
|
withCredentials: true,
|
|
fileList,
|
|
accept: ".xls,.xlsx",
|
|
showUploadList: false
|
|
},
|
|
/* @__PURE__ */ _react_17_0_2_react.createElement(es_button/* default */.ZP, { className: UploadQuestionsmodules.upload, type: "primary", icon: /* @__PURE__ */ _react_17_0_2_react.createElement("i", { className: "iconfont icon-shangchuan3", style: { fontSize: 14 } }) }, "\u4E0A\u4F20\u6587\u4EF6")
|
|
), fileList.map((fileItem, index) => /* @__PURE__ */ _react_17_0_2_react.createElement("div", { key: index, className: UploadQuestionsmodules.fileList }, /* @__PURE__ */ _react_17_0_2_react.createElement("span", { className: UploadQuestionsmodules.fileName }, fileItem == null ? void 0 : fileItem.name), /* @__PURE__ */ _react_17_0_2_react.createElement("i", { className: "iconfont icon-shanchu12", style: { color: "#F65160", fontSize: 16, cursor: "pointer" }, onClick: handleRemove }))))))
|
|
);
|
|
};
|
|
/* harmony default export */ var components_UploadQuestions = (UploadQuestions);
|
|
|
|
|
|
/***/ }),
|
|
|
|
/***/ 78573:
|
|
/*!****************************************************!*\
|
|
!*** ./src/pages/Paperlibrary/Add/TitleEditor.tsx ***!
|
|
\****************************************************/
|
|
/***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) {
|
|
|
|
/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! react */ 59301);
|
|
/* harmony import */ var antd__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! antd */ 6848);
|
|
/* harmony import */ var antd__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! antd */ 98135);
|
|
/* harmony import */ var antd__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! antd */ 8591);
|
|
/* harmony import */ var _index_less_modules__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./index.less?modules */ 89293);
|
|
/* provided dependency */ var React = __webpack_require__(/*! react */ 59301);
|
|
var __async = (__this, __arguments, generator) => {
|
|
return new Promise((resolve, reject) => {
|
|
var fulfilled = (value) => {
|
|
try {
|
|
step(generator.next(value));
|
|
} catch (e) {
|
|
reject(e);
|
|
}
|
|
};
|
|
var rejected = (value) => {
|
|
try {
|
|
step(generator.throw(value));
|
|
} catch (e) {
|
|
reject(e);
|
|
}
|
|
};
|
|
var step = (x) => x.done ? resolve(x.value) : Promise.resolve(x.value).then(fulfilled, rejected);
|
|
step((generator = generator.apply(__this, __arguments)).next());
|
|
});
|
|
};
|
|
|
|
|
|
|
|
const TitleEditor = ({ defaultValue, onFinish }) => {
|
|
const [isEdit, setIsEdit] = (0,react__WEBPACK_IMPORTED_MODULE_0__.useState)(false);
|
|
const [value, setValue] = (0,react__WEBPACK_IMPORTED_MODULE_0__.useState)(defaultValue);
|
|
(0,react__WEBPACK_IMPORTED_MODULE_0__.useEffect)(() => {
|
|
setValue(defaultValue);
|
|
}, [defaultValue]);
|
|
return /* @__PURE__ */ React.createElement("div", null, !isEdit ? /* @__PURE__ */ React.createElement("div", { className: _index_less_modules__WEBPACK_IMPORTED_MODULE_1__/* ["default"] */ .Z.title }, value, /* @__PURE__ */ React.createElement(antd__WEBPACK_IMPORTED_MODULE_2__/* ["default"] */ .Z, { title: "\u7F16\u8F91\u8BD5\u5377\u540D\u79F0" }, /* @__PURE__ */ React.createElement("i", { className: `${_index_less_modules__WEBPACK_IMPORTED_MODULE_1__/* ["default"] */ .Z.editIcon} iconfont icon-bianji_Hover`, onClick: () => setIsEdit(true) }))) : /* @__PURE__ */ React.createElement(
|
|
antd__WEBPACK_IMPORTED_MODULE_3__["default"],
|
|
{
|
|
autoFocus: true,
|
|
maxLength: 60,
|
|
style: { textAlign: "center", marginTop: 20, marginBottom: 20 },
|
|
value,
|
|
onChange: (e) => {
|
|
setValue(e.target.value);
|
|
},
|
|
onBlur: () => __async(void 0, null, function* () {
|
|
var _a;
|
|
if (((_a = value == null ? void 0 : value.replaceAll(" ", "")) == null ? void 0 : _a.length) <= 0) {
|
|
antd__WEBPACK_IMPORTED_MODULE_4__/* ["default"] */ .ZP.error("\u8BD5\u5377\u6807\u9898\u4E0D\u80FD\u4E3A\u7A7A");
|
|
return;
|
|
}
|
|
const flag = yield onFinish(value);
|
|
flag && setIsEdit(false);
|
|
}),
|
|
onPressEnter: () => __async(void 0, null, function* () {
|
|
var _a;
|
|
if (((_a = value == null ? void 0 : value.replaceAll(" ", "")) == null ? void 0 : _a.length) <= 0) {
|
|
antd__WEBPACK_IMPORTED_MODULE_4__/* ["default"] */ .ZP.error("\u8BD5\u5377\u6807\u9898\u4E0D\u80FD\u4E3A\u7A7A");
|
|
return;
|
|
}
|
|
const flag = yield onFinish(value);
|
|
flag && setIsEdit(false);
|
|
})
|
|
}
|
|
));
|
|
};
|
|
/* harmony default export */ __webpack_exports__.Z = (TitleEditor);
|
|
|
|
|
|
/***/ }),
|
|
|
|
/***/ 76542:
|
|
/*!***********************************************************!*\
|
|
!*** ./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/_react@17.0.2@react/index.js
|
|
var _react_17_0_2_react = __webpack_require__(59301);
|
|
// EXTERNAL MODULE: ./src/.umi-production/exports.ts + 15 modules
|
|
var _umi_production_exports = __webpack_require__(67866);
|
|
// 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__(98135);
|
|
// 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__(54449);
|
|
// 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__(89293);
|
|
// EXTERNAL MODULE: ./src/service/paperlibrary.ts
|
|
var paperlibrary = __webpack_require__(6587);
|
|
// EXTERNAL MODULE: ./src/models/problemset/util.ts
|
|
var util = __webpack_require__(87884);
|
|
// EXTERNAL MODULE: ./src/components/AsyncButton/index.tsx
|
|
var AsyncButton = __webpack_require__(16800);
|
|
// 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__(56511);
|
|
// EXTERNAL MODULE: ./node_modules/_antd@5.9.0@antd/es/dropdown/index.js + 1 modules
|
|
var dropdown = __webpack_require__(38854);
|
|
// EXTERNAL MODULE: ./node_modules/_antd@5.9.0@antd/es/tooltip/index.js + 3 modules
|
|
var tooltip = __webpack_require__(6848);
|
|
;// 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__(13462);
|
|
// EXTERNAL MODULE: ./src/utils/fetch.ts
|
|
var fetch = __webpack_require__(51165);
|
|
// EXTERNAL MODULE: ./src/components/NoData/index.tsx
|
|
var NoData = __webpack_require__(87526);
|
|
// 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__(47766);
|
|
// EXTERNAL MODULE: ./src/components/RenderHtml/index.tsx
|
|
var RenderHtml = __webpack_require__(16921);
|
|
;// CONCATENATED MODULE: ./src/pages/Paperlibrary/EditPotin/components/LeftItems.tsx
|
|
/* provided dependency */ var React = __webpack_require__(/*! react */ 59301);
|
|
var __defProp = Object.defineProperty;
|
|
var __defProps = Object.defineProperties;
|
|
var __getOwnPropDescs = Object.getOwnPropertyDescriptors;
|
|
var __getOwnPropSymbols = Object.getOwnPropertySymbols;
|
|
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
var __propIsEnum = Object.prototype.propertyIsEnumerable;
|
|
var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
|
|
var __spreadValues = (a, b) => {
|
|
for (var prop in b || (b = {}))
|
|
if (__hasOwnProp.call(b, prop))
|
|
__defNormalProp(a, prop, b[prop]);
|
|
if (__getOwnPropSymbols)
|
|
for (var prop of __getOwnPropSymbols(b)) {
|
|
if (__propIsEnum.call(b, prop))
|
|
__defNormalProp(a, prop, b[prop]);
|
|
}
|
|
return a;
|
|
};
|
|
var __spreadProps = (a, b) => __defProps(a, __getOwnPropDescs(b));
|
|
var __async = (__this, __arguments, generator) => {
|
|
return new Promise((resolve, reject) => {
|
|
var fulfilled = (value) => {
|
|
try {
|
|
step(generator.next(value));
|
|
} catch (e) {
|
|
reject(e);
|
|
}
|
|
};
|
|
var rejected = (value) => {
|
|
try {
|
|
step(generator.throw(value));
|
|
} catch (e) {
|
|
reject(e);
|
|
}
|
|
};
|
|
var step = (x) => x.done ? resolve(x.value) : Promise.resolve(x.value).then(fulfilled, rejected);
|
|
step((generator = generator.apply(__this, __arguments)).next());
|
|
});
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
const DragQuestions = ({ Itemid, setqitem, qitem, data, getdata, bigitem, setBigqitem, isedit }) => {
|
|
const [list, setList] = (0,_react_17_0_2_react.useState)([]);
|
|
const [loading, setLoading] = (0,_react_17_0_2_react.useState)(false);
|
|
(0,_react_17_0_2_react.useEffect)(() => {
|
|
if (data.length > 0) {
|
|
setList([...data]);
|
|
}
|
|
}, [data]);
|
|
const handleDragEnd = (result, list2) => __async(void 0, null, function* () {
|
|
if (isedit) {
|
|
message/* default */.ZP.info("\u8BF7\u5148\u4FDD\u5B58\u6216\u53D6\u6D88\u5F53\u524D\u6B63\u5728\u7F16\u8F91\u7684\u8BD5\u9898\u3002");
|
|
return;
|
|
}
|
|
if (!result.destination) {
|
|
return;
|
|
}
|
|
setLoading(true);
|
|
let res = yield (0,fetch/* default */.ZP)(`/api/examination_banks/${Itemid}/examination_banks_item_banks/${list2 == null ? void 0 : list2[result.source.index].question_id}/adjust_position.json`, {
|
|
method: "post",
|
|
body: {
|
|
id: Itemid,
|
|
itemid: list2 == null ? void 0 : list2[result.source.index].question_id,
|
|
position: result.destination.index
|
|
}
|
|
});
|
|
setLoading(false);
|
|
if (res.status === 0) {
|
|
getdata({ id: list2 == null ? void 0 : list2[result.source.index].question_id });
|
|
}
|
|
});
|
|
return /* @__PURE__ */ React.createElement("div", null, /* @__PURE__ */ React.createElement(react_beautiful_dnd_esm/* DragDropContext */.Z5, { onDragEnd: (result) => handleDragEnd(result, list) }, /* @__PURE__ */ React.createElement(react_beautiful_dnd_esm/* Droppable */.bK, { droppableId: "droppable" }, (provided, snapshot) => {
|
|
return /* @__PURE__ */ React.createElement(
|
|
"div",
|
|
__spreadValues({
|
|
ref: provided.innerRef
|
|
}, provided.droppableProps),
|
|
/* @__PURE__ */ React.createElement(spin/* default */.Z, { spinning: loading }, list.map((item, k) => {
|
|
return /* @__PURE__ */ React.createElement(
|
|
react_beautiful_dnd_esm/* Draggable */._l,
|
|
{
|
|
key: k,
|
|
draggableId: k.toString(),
|
|
index: k
|
|
},
|
|
(provided2, snapshot2) => {
|
|
var _a, _b;
|
|
return /* @__PURE__ */ React.createElement(
|
|
"aside",
|
|
__spreadValues(__spreadValues({
|
|
ref: provided2.innerRef
|
|
}, provided2.draggableProps), provided2.dragHandleProps),
|
|
/* @__PURE__ */ React.createElement(tooltip/* default */.Z, { title: /* @__PURE__ */ React.createElement(RenderHtml/* default */.Z, { value: (item == null ? void 0 : item.question_type) === 8 ? (_a = item == null ? void 0 : item.program_attr) == null ? void 0 : _a.description : item.question_title }), color: "#fff", placement: "left", overlayClassName: EditPotinmodules.titleTooltip }, /* @__PURE__ */ React.createElement("div", { onClick: () => {
|
|
if (isedit) {
|
|
message/* default */.ZP.info("\u8BF7\u5148\u4FDD\u5B58\u6216\u53D6\u6D88\u5F53\u524D\u6B63\u5728\u7F16\u8F91\u7684\u8BD5\u9898\u3002");
|
|
return;
|
|
}
|
|
setqitem(__spreadProps(__spreadValues({}, item), { index: k + 1 }));
|
|
setBigqitem(bigitem);
|
|
(0,utils_util/* domScrollToTop */.Vf)("#question-scroll-id");
|
|
}, className: `${EditPotinmodules.qcount} ${item.question_id === (qitem == null ? void 0 : qitem.question_id) ? EditPotinmodules.qcountclick : ""}` }, /* @__PURE__ */ React.createElement("span", { className: EditPotinmodules.score }, item == null ? void 0 : item.question_score, "\u5206"), /* @__PURE__ */ React.createElement("span", { className: EditPotinmodules.qtitle }, k + 1, "\u3001", /* @__PURE__ */ React.createElement(RenderHtml/* default */.Z, { value: (item == null ? void 0 : item.question_type) === 8 ? (_b = item == null ? void 0 : item.program_attr) == null ? void 0 : _b.description : item.question_title, showTextOnly: true }))))
|
|
);
|
|
}
|
|
);
|
|
})),
|
|
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__(13866);
|
|
// 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.3.7@@ant-design/icons/es/icons/QuestionCircleOutlined.js + 1 modules
|
|
var QuestionCircleOutlined = __webpack_require__(85699);
|
|
// EXTERNAL MODULE: ./node_modules/_@ant-design_icons@5.3.7@@ant-design/icons/es/icons/ExclamationCircleOutlined.js + 1 modules
|
|
var ExclamationCircleOutlined = __webpack_require__(88289);
|
|
;// CONCATENATED MODULE: ./src/pages/Paperlibrary/EditPotin/components/MoreSetting.tsx
|
|
/* provided dependency */ var MoreSetting_React = __webpack_require__(/*! react */ 59301);
|
|
var MoreSetting_async = (__this, __arguments, generator) => {
|
|
return new Promise((resolve, reject) => {
|
|
var fulfilled = (value) => {
|
|
try {
|
|
step(generator.next(value));
|
|
} catch (e) {
|
|
reject(e);
|
|
}
|
|
};
|
|
var rejected = (value) => {
|
|
try {
|
|
step(generator.throw(value));
|
|
} catch (e) {
|
|
reject(e);
|
|
}
|
|
};
|
|
var step = (x) => x.done ? resolve(x.value) : Promise.resolve(x.value).then(fulfilled, rejected);
|
|
step((generator = generator.apply(__this, __arguments)).next());
|
|
});
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
const AddModal = ({ form, TagDiscipline, exerciseitem, qitem, getTagData }) => {
|
|
var _a;
|
|
const [isshow, seetisshow] = (0,_react_17_0_2_react.useState)(true);
|
|
const [showmodal, setshowmodal] = (0,_react_17_0_2_react.useState)(false);
|
|
const [values, setvalues] = (0,_react_17_0_2_react.useState)("");
|
|
(0,_react_17_0_2_react.useEffect)(() => {
|
|
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
|
|
});
|
|
}, []);
|
|
return /* @__PURE__ */ MoreSetting_React.createElement("div", null, /* @__PURE__ */ MoreSetting_React.createElement("div", { style: { marginTop: 30, overflow: "hidden", height: isshow ? "100%" : 0 } }, /* @__PURE__ */ MoreSetting_React.createElement(es_form["default"].Item, { className: EditPotinmodules.formcenter, rules: [{
|
|
required: true,
|
|
message: "\u8BF7\u5148\u9009\u62E9\u96BE\u5EA6"
|
|
}], label: "\u96BE\u5EA6", name: "difficulty" }, /* @__PURE__ */ MoreSetting_React.createElement(es_radio/* default.Group */.ZP.Group, { className: EditPotinmodules.radiogroup }, /* @__PURE__ */ MoreSetting_React.createElement(es_radio/* default.Button */.ZP.Button, { className: EditPotinmodules.easy, value: 1 }, "\u7B80\u5355"), /* @__PURE__ */ MoreSetting_React.createElement(es_radio/* default.Button */.ZP.Button, { className: EditPotinmodules.medium, value: 2 }, "\u9002\u4E2D"), /* @__PURE__ */ MoreSetting_React.createElement(es_radio/* default.Button */.ZP.Button, { className: EditPotinmodules.hard, value: 3 }, "\u56F0\u96BE"))), /* @__PURE__ */ MoreSetting_React.createElement(es_form["default"].Item, { className: EditPotinmodules.formcenterselect, label: "\u77E5\u8BC6\u70B9" }, /* @__PURE__ */ MoreSetting_React.createElement("div", { style: { display: "flex", alignItems: "center" } }, /* @__PURE__ */ MoreSetting_React.createElement(es_form["default"].Item, { name: "tag_discipline_ids", style: { marginBottom: 12 } }, /* @__PURE__ */ MoreSetting_React.createElement(
|
|
es_select["default"],
|
|
{
|
|
className: EditPotinmodules.selectitems,
|
|
showSearch: true,
|
|
mode: "multiple",
|
|
placeholder: "\u8BF7\u9009\u62E9\u77E5\u8BC6\u70B9\uFF0C\u652F\u6301\u9009\u62E9\u591A\u4E2A",
|
|
listHeight: 200,
|
|
dropdownStyle: {
|
|
zIndex: 9
|
|
},
|
|
allowClear: true,
|
|
optionFilterProp: "children",
|
|
filterOption: (input, option) => option.key.indexOf(input.toLowerCase()) >= 0
|
|
},
|
|
(_a = TagDiscipline == null ? void 0 : TagDiscipline.tag_disciplines) == null ? void 0 : _a.map((item) => /* @__PURE__ */ MoreSetting_React.createElement(es_select["default"].Option, { key: item.name + item.id, value: item.id }, /* @__PURE__ */ MoreSetting_React.createElement("div", { style: { display: "flex", alignItems: "center" } }, /* @__PURE__ */ MoreSetting_React.createElement("span", { style: { overflow: "hidden", whiteSpace: "nowrap", textOverflow: "ellipsis" } }, item.name), (item == null ? void 0 : item.type) === "personal" && /* @__PURE__ */ MoreSetting_React.createElement("div", { style: { marginLeft: "5px", border: "1px solid #24C074", color: "#24C074", padding: "0 4px", borderRadius: "2px", fontSize: "12px", height: "20px", lineHeight: "20px" } }, "\u81EA\u7528"))))
|
|
)), /* @__PURE__ */ MoreSetting_React.createElement("div", { style: { marginLeft: 20, marginTop: "-16px", lineHeight: "48px", height: 48, fontSize: 14 } }, /* @__PURE__ */ MoreSetting_React.createElement("span", null, "\u6CA1\u6709\u5408\u9002\u7684\u77E5\u8BC6\u70B9\uFF1F"), /* @__PURE__ */ MoreSetting_React.createElement("a", { onClick: () => {
|
|
setshowmodal(true);
|
|
}, style: { marginLeft: 3, color: "#3061D0" } }, "\u65B0\u5EFA\u77E5\u8BC6\u70B9")))), /* @__PURE__ */ MoreSetting_React.createElement(es_form["default"].Item, { className: EditPotinmodules.formcenterselect }, /* @__PURE__ */ MoreSetting_React.createElement("div", { style: { display: "flex", alignItems: "center" } }, /* @__PURE__ */ MoreSetting_React.createElement(es_form["default"].Item, { name: "repeat_answer", valuePropName: "checked" }, /* @__PURE__ */ MoreSetting_React.createElement(es_switch/* default */.Z, null)), /* @__PURE__ */ MoreSetting_React.createElement("div", { style: { marginLeft: 10, marginTop: "-16px", lineHeight: "40px", height: 48, color: "#000000" } }, "\u4E0D\u5141\u8BB8\u5B66\u751F\u91CD\u590D\u7B54\u9898", /* @__PURE__ */ MoreSetting_React.createElement(
|
|
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"
|
|
},
|
|
/* @__PURE__ */ MoreSetting_React.createElement(QuestionCircleOutlined/* default */.Z, { style: { color: "#3061D0", marginLeft: 6, cursor: "pointer" } })
|
|
))))), /* @__PURE__ */ MoreSetting_React.createElement(
|
|
modal["default"],
|
|
{
|
|
title: false,
|
|
footer: false,
|
|
open: showmodal,
|
|
width: 640,
|
|
centered: true,
|
|
closable: false,
|
|
className: EditPotinmodules.scoremodal
|
|
},
|
|
/* @__PURE__ */ MoreSetting_React.createElement("div", { style: { display: "flex", alignItems: "center" } }, /* @__PURE__ */ MoreSetting_React.createElement("div", { className: EditPotinmodules.title }, "\u65B0\u5EFA\u77E5\u8BC6\u70B9"), /* @__PURE__ */ MoreSetting_React.createElement("span", { onClick: () => setshowmodal(false), className: EditPotinmodules.close }, "X")),
|
|
/* @__PURE__ */ MoreSetting_React.createElement("div", null, /* @__PURE__ */ MoreSetting_React.createElement(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__ */ MoreSetting_React.createElement(input["default"], { showCount: true, maxLength: 20, style: { marginBottom: 30, marginTop: 30, height: 46 }, onChange: (e) => {
|
|
setvalues(e.target.value);
|
|
}, placeholder: "\u8BF7\u8F93\u5165\u77E5\u8BC6\u70B9\u540D\u79F0" }),
|
|
/* @__PURE__ */ MoreSetting_React.createElement("div", { className: EditPotinmodules.bottom }, /* @__PURE__ */ MoreSetting_React.createElement(es_button/* default */.ZP, { className: EditPotinmodules.no, onClick: () => {
|
|
setshowmodal(false);
|
|
} }, "\u53D6\u6D88"), /* @__PURE__ */ MoreSetting_React.createElement(es_button/* default */.ZP, { className: EditPotinmodules.yes, onClick: () => MoreSetting_async(void 0, null, function* () {
|
|
var _a2, _b;
|
|
if (!values) {
|
|
message/* default */.ZP.info("\u77E5\u8BC6\u70B9\u540D\u79F0\u4E0D\u80FD\u4E3A\u7A7A");
|
|
return;
|
|
}
|
|
const res = yield (0,fetch/* default */.ZP)(
|
|
`/api/tag_disciplines.json`,
|
|
{
|
|
method: "post",
|
|
body: {
|
|
name: values,
|
|
sub_discipline_id: (_a2 = exerciseitem == null ? void 0 : exerciseitem.exercise) == null ? void 0 : _a2.sub_discipline_id
|
|
}
|
|
}
|
|
);
|
|
if ((res == null ? void 0 : res.status) === 0) {
|
|
form.setFieldsValue({
|
|
knowledge: values,
|
|
tag_discipline_ids: [...form.getFieldValue("tag_discipline_ids"), res == null ? void 0 : res.tag_discipline_id]
|
|
});
|
|
getTagData((_b = exerciseitem.exercise) == null ? void 0 : _b.sub_discipline_id);
|
|
}
|
|
setshowmodal(false);
|
|
}) }, "\u786E\u8BA4"))
|
|
));
|
|
};
|
|
/* harmony default export */ var MoreSetting = (AddModal);
|
|
|
|
;// CONCATENATED MODULE: ./src/pages/Paperlibrary/EditPotin/components/Questions/SingleEditor.tsx
|
|
/* provided dependency */ var SingleEditor_React = __webpack_require__(/*! react */ 59301);
|
|
var SingleEditor_defProp = Object.defineProperty;
|
|
var SingleEditor_defProps = Object.defineProperties;
|
|
var SingleEditor_getOwnPropDescs = Object.getOwnPropertyDescriptors;
|
|
var SingleEditor_getOwnPropSymbols = Object.getOwnPropertySymbols;
|
|
var SingleEditor_hasOwnProp = Object.prototype.hasOwnProperty;
|
|
var SingleEditor_propIsEnum = Object.prototype.propertyIsEnumerable;
|
|
var SingleEditor_defNormalProp = (obj, key, value) => key in obj ? SingleEditor_defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
|
|
var SingleEditor_spreadValues = (a, b) => {
|
|
for (var prop in b || (b = {}))
|
|
if (SingleEditor_hasOwnProp.call(b, prop))
|
|
SingleEditor_defNormalProp(a, prop, b[prop]);
|
|
if (SingleEditor_getOwnPropSymbols)
|
|
for (var prop of SingleEditor_getOwnPropSymbols(b)) {
|
|
if (SingleEditor_propIsEnum.call(b, prop))
|
|
SingleEditor_defNormalProp(a, prop, b[prop]);
|
|
}
|
|
return a;
|
|
};
|
|
var SingleEditor_spreadProps = (a, b) => SingleEditor_defProps(a, SingleEditor_getOwnPropDescs(b));
|
|
var SingleEditor_async = (__this, __arguments, generator) => {
|
|
return new Promise((resolve, reject) => {
|
|
var fulfilled = (value) => {
|
|
try {
|
|
step(generator.next(value));
|
|
} catch (e) {
|
|
reject(e);
|
|
}
|
|
};
|
|
var rejected = (value) => {
|
|
try {
|
|
step(generator.throw(value));
|
|
} catch (e) {
|
|
reject(e);
|
|
}
|
|
};
|
|
var step = (x) => x.done ? resolve(x.value) : Promise.resolve(x.value).then(fulfilled, rejected);
|
|
step((generator = generator.apply(__this, __arguments)).next());
|
|
});
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
const SingleEditor_DragQuestions = ({ qitem, setisedit, TagDiscipline, exerciseitem, seveeditor, deleteitem, getTagData, init }) => {
|
|
const [form] = es_form["default"].useForm();
|
|
(0,_react_17_0_2_react.useEffect)(() => {
|
|
var _a;
|
|
form.setFieldsValue(SingleEditor_spreadProps(SingleEditor_spreadValues({}, qitem), {
|
|
name: qitem == null ? void 0 : qitem.question_title,
|
|
choices: (_a = qitem == null ? void 0 : qitem.question_choices) == null ? void 0 : _a.map((item) => {
|
|
return SingleEditor_spreadProps(SingleEditor_spreadValues({}, item), { standard_boolean: (item == null ? void 0 : item.standard_boolean) ? 1 : 0 });
|
|
}),
|
|
repeat_answer: !(qitem == null ? void 0 : qitem.repeat_answer)
|
|
}));
|
|
}, [qitem]);
|
|
return /* @__PURE__ */ SingleEditor_React.createElement("div", null, /* @__PURE__ */ SingleEditor_React.createElement(
|
|
es_form["default"],
|
|
{
|
|
form,
|
|
colon: false,
|
|
onFinish: (values) => {
|
|
var _a;
|
|
let datas = SingleEditor_spreadProps(SingleEditor_spreadValues({}, values), {
|
|
item_type: qitem == null ? void 0 : qitem.question_type,
|
|
choices: (_a = values == null ? void 0 : values.choices) == null ? void 0 : _a.map((item) => {
|
|
return SingleEditor_spreadProps(SingleEditor_spreadValues({}, item), {
|
|
is_answer: item.standard_boolean
|
|
});
|
|
})
|
|
});
|
|
seveeditor(SingleEditor_spreadValues(SingleEditor_spreadValues({}, qitem), datas));
|
|
},
|
|
onFinishFailed: (errInfo) => SingleEditor_async(void 0, null, function* () {
|
|
var _a, _b;
|
|
message/* default */.ZP.error(errInfo.errorFields[0].errors[0]);
|
|
form.scrollToField((_b = (_a = errInfo == null ? void 0 : errInfo.errorFields) == null ? void 0 : _a[0]) == null ? void 0 : _b.name, { behavior: "smooth", block: "center" });
|
|
})
|
|
},
|
|
/* @__PURE__ */ SingleEditor_React.createElement("div", { style: { display: "flex", alignItems: "center" } }, /* @__PURE__ */ SingleEditor_React.createElement("div", { style: { flex: 1 } }, /* @__PURE__ */ SingleEditor_React.createElement("span", { style: { display: "inline-flex", border: "1px solid #9096A3", borderRadius: "50%", width: 10, height: 10, marginRight: 5, background: "#9096A3" } }), /* @__PURE__ */ SingleEditor_React.createElement("span", null, (qitem == null ? void 0 : qitem.question_type) === 1 ? "\u591A\u9009\u9898" : "\u5355\u9009\u9898")), !qitem.isadd && /* @__PURE__ */ SingleEditor_React.createElement("span", { style: { marginLeft: 20, marginRight: 20, color: "red", cursor: "pointer" }, onClick: () => {
|
|
deleteitem();
|
|
} }, /* @__PURE__ */ SingleEditor_React.createElement("i", { className: "iconfont icon-piliangshanchu3", style: { fontSize: 14, marginRight: 6 } }), "\u5220\u9664"), /* @__PURE__ */ SingleEditor_React.createElement(es_button/* default */.ZP, { onClick: () => {
|
|
var _a;
|
|
if (!qitem.isadd) {
|
|
form.setFieldsValue(SingleEditor_spreadProps(SingleEditor_spreadValues({}, qitem), {
|
|
name: qitem == null ? void 0 : qitem.question_title,
|
|
choices: (_a = qitem == null ? void 0 : qitem.question_choices) == null ? void 0 : _a.map((item) => {
|
|
return SingleEditor_spreadProps(SingleEditor_spreadValues({}, item), { standard_boolean: (item == null ? void 0 : item.standard_boolean) ? 1 : 0 });
|
|
}),
|
|
repeat_answer: !(qitem == null ? void 0 : qitem.repeat_answer)
|
|
}));
|
|
setisedit(false);
|
|
} else {
|
|
setisedit(false);
|
|
init();
|
|
}
|
|
} }, "\u53D6\u6D88"), /* @__PURE__ */ SingleEditor_React.createElement(es_button/* default */.ZP, { className: "ml20", type: "primary", onClick: () => SingleEditor_async(void 0, null, function* () {
|
|
form.submit();
|
|
}) }, "\u4FDD\u5B58")),
|
|
/* @__PURE__ */ SingleEditor_React.createElement("div", { style: { maxHeight: "70vh", overflowY: "auto", marginTop: "10px", paddingRight: "5px" } }, /* @__PURE__ */ SingleEditor_React.createElement(row/* default */.Z, { align: "middle" }, /* @__PURE__ */ SingleEditor_React.createElement(es_form["default"].Item, { className: EditPotinmodules.scoreinput, name: "question_score", label: "\u5206\u503C", rules: [{
|
|
required: true,
|
|
message: "\u8BF7\u8F93\u5165\u5206\u503C"
|
|
}] }, /* @__PURE__ */ SingleEditor_React.createElement(input_number/* default */.Z, { onBlur: (e) => {
|
|
e.target.value === "0" && message/* default */.ZP.error("\u5206\u503C\u5FC5\u987B\u5927\u4E8E0\u4E14\u5C0F\u4E8E\u7B49\u4E8E100");
|
|
}, style: { width: 150 }, precision: 1, placeholder: "\u8BF7\u8F93\u5165\u5206\u503C", max: 100, min: 0.1 }))), /* @__PURE__ */ SingleEditor_React.createElement(
|
|
ChoiceQuestionEditor/* ChoiceQuestionEditor */.u,
|
|
{
|
|
form,
|
|
questionTitlePlaceholder: "\u8BF7\u7F16\u8F91\u9009\u62E9\u9898\u9898\u5E72\u5185\u5BB9",
|
|
titleKey: "name",
|
|
choiceKey: "choices",
|
|
analysisKey: "analysis",
|
|
choiceOptionsPath: "choices",
|
|
choiceTextKey: "choice_text",
|
|
answerKey: "standard_boolean"
|
|
}
|
|
), /* @__PURE__ */ SingleEditor_React.createElement(MoreSetting, { getTagData, qitem, exerciseitem, TagDiscipline, form }))
|
|
));
|
|
};
|
|
/* harmony default export */ var SingleEditor = (SingleEditor_DragQuestions);
|
|
|
|
// EXTERNAL MODULE: ./src/components/QuestionEditor/CompletionQuestionEditor.tsx
|
|
var CompletionQuestionEditor = __webpack_require__(60151);
|
|
// EXTERNAL MODULE: ./src/components/QuestionText/index.tsx + 1 modules
|
|
var QuestionText = __webpack_require__(86396);
|
|
;// CONCATENATED MODULE: ./src/pages/Paperlibrary/EditPotin/components/Questions/CombinationEditor.tsx
|
|
/* provided dependency */ var CombinationEditor_React = __webpack_require__(/*! react */ 59301);
|
|
var CombinationEditor_defProp = Object.defineProperty;
|
|
var CombinationEditor_defProps = Object.defineProperties;
|
|
var CombinationEditor_getOwnPropDescs = Object.getOwnPropertyDescriptors;
|
|
var CombinationEditor_getOwnPropSymbols = Object.getOwnPropertySymbols;
|
|
var CombinationEditor_hasOwnProp = Object.prototype.hasOwnProperty;
|
|
var CombinationEditor_propIsEnum = Object.prototype.propertyIsEnumerable;
|
|
var CombinationEditor_defNormalProp = (obj, key, value) => key in obj ? CombinationEditor_defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
|
|
var CombinationEditor_spreadValues = (a, b) => {
|
|
for (var prop in b || (b = {}))
|
|
if (CombinationEditor_hasOwnProp.call(b, prop))
|
|
CombinationEditor_defNormalProp(a, prop, b[prop]);
|
|
if (CombinationEditor_getOwnPropSymbols)
|
|
for (var prop of CombinationEditor_getOwnPropSymbols(b)) {
|
|
if (CombinationEditor_propIsEnum.call(b, prop))
|
|
CombinationEditor_defNormalProp(a, prop, b[prop]);
|
|
}
|
|
return a;
|
|
};
|
|
var CombinationEditor_spreadProps = (a, b) => CombinationEditor_defProps(a, CombinationEditor_getOwnPropDescs(b));
|
|
var CombinationEditor_async = (__this, __arguments, generator) => {
|
|
return new Promise((resolve, reject) => {
|
|
var fulfilled = (value) => {
|
|
try {
|
|
step(generator.next(value));
|
|
} catch (e) {
|
|
reject(e);
|
|
}
|
|
};
|
|
var rejected = (value) => {
|
|
try {
|
|
step(generator.throw(value));
|
|
} catch (e) {
|
|
reject(e);
|
|
}
|
|
};
|
|
var step = (x) => x.done ? resolve(x.value) : Promise.resolve(x.value).then(fulfilled, rejected);
|
|
step((generator = generator.apply(__this, __arguments)).next());
|
|
});
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
const CombinationEditor_DragQuestions = ({ qitem, TagDiscipline, exerciseitem, setisedit, seveeditor, deleteitem, getTagData, init }) => {
|
|
const [form] = es_form["default"].useForm();
|
|
const scoreByBlank = es_form["default"].useWatch("use_blank_score", form);
|
|
(0,_react_17_0_2_react.useEffect)(() => {
|
|
form.setFieldsValue(CombinationEditor_spreadProps(CombinationEditor_spreadValues({}, qitem), {
|
|
standard_answers: qitem.standard_answers || [],
|
|
name: qitem.question_title,
|
|
repeat_answer: !qitem.repeat_answer
|
|
}));
|
|
}, [qitem]);
|
|
return /* @__PURE__ */ CombinationEditor_React.createElement("div", null, /* @__PURE__ */ CombinationEditor_React.createElement(
|
|
es_form["default"],
|
|
{
|
|
form,
|
|
colon: false,
|
|
onValuesChange: (values, value) => {
|
|
var _a, _b, _c, _d;
|
|
if ((values == null ? void 0 : values.standard_answers) || (values == null ? void 0 : values.use_blank_score)) {
|
|
let items = ((_a = form.getFieldValue("standard_answers")) == null ? void 0 : _a.length) > 0 && ((_c = (_b = form.getFieldValue("standard_answers")) == null ? void 0 : _b.map((item) => item.score)) == null ? void 0 : _c.filter((item) => item));
|
|
if ((items == null ? void 0 : items.length) > 0) {
|
|
form.setFieldsValue({
|
|
question_score: (items == null ? void 0 : items.length) > 0 && ((_d = items.reduce((a, b) => a + b)) == null ? void 0 : _d.toFixed(1))
|
|
});
|
|
}
|
|
}
|
|
},
|
|
onFinish: (values) => {
|
|
var _a;
|
|
seveeditor(CombinationEditor_spreadProps(CombinationEditor_spreadValues(CombinationEditor_spreadValues({}, qitem), values), {
|
|
item_type: qitem == null ? void 0 : qitem.question_type,
|
|
standard_answers: (_a = values.standard_answers) == null ? void 0 : _a.map((item, index) => {
|
|
return CombinationEditor_spreadProps(CombinationEditor_spreadValues({}, item), {
|
|
position: item.choice_id || index + 1
|
|
});
|
|
})
|
|
// standard_answer: undefined //后端希望只传一个,存和取的字段又不统一
|
|
}));
|
|
},
|
|
onFinishFailed: (errInfo) => CombinationEditor_async(void 0, null, function* () {
|
|
var _a, _b;
|
|
if (errInfo.errorFields[0].errors[0] === "\u8BF7\u5148\u5728\u9898\u5E72\u4E2D\u63D2\u5165\u586B\u7A7A\u9879") {
|
|
(0,utils_util/* addJumping */.pE)();
|
|
}
|
|
message/* default */.ZP.error(errInfo.errorFields[0].errors[0]);
|
|
form.scrollToField((_b = (_a = errInfo == null ? void 0 : errInfo.errorFields) == null ? void 0 : _a[0]) == null ? void 0 : _b.name, { behavior: "smooth", block: "center" });
|
|
})
|
|
},
|
|
/* @__PURE__ */ CombinationEditor_React.createElement("div", { style: { display: "flex", alignItems: "center" } }, /* @__PURE__ */ CombinationEditor_React.createElement("div", { style: { flex: 1 } }, /* @__PURE__ */ CombinationEditor_React.createElement("span", { style: { display: "inline-flex", border: "1px solid #9096A3", borderRadius: "50%", width: 10, height: 10, marginRight: 5, background: "#9096A3" } }), /* @__PURE__ */ CombinationEditor_React.createElement("span", null, "\u586B\u7A7A\u9898")), !qitem.isadd && /* @__PURE__ */ CombinationEditor_React.createElement("span", { style: { marginLeft: 20, marginRight: 20, color: "red", cursor: "pointer" }, onClick: () => {
|
|
deleteitem();
|
|
} }, /* @__PURE__ */ CombinationEditor_React.createElement("i", { className: "iconfont icon-piliangshanchu3", style: { fontSize: 14, marginRight: 6 } }), " \u5220\u9664"), /* @__PURE__ */ CombinationEditor_React.createElement(
|
|
es_button/* default */.ZP,
|
|
{
|
|
onClick: () => {
|
|
if (!qitem.isadd) {
|
|
form.setFieldsValue(CombinationEditor_spreadProps(CombinationEditor_spreadValues({}, qitem), {
|
|
standard_answers: qitem.standard_answers,
|
|
name: qitem.question_title,
|
|
repeat_answer: !qitem.repeat_answer
|
|
}));
|
|
setisedit(false);
|
|
} else {
|
|
setisedit(false);
|
|
init();
|
|
}
|
|
}
|
|
},
|
|
"\u53D6\u6D88"
|
|
), /* @__PURE__ */ CombinationEditor_React.createElement(es_button/* default */.ZP, { className: "ml20", type: "primary", onClick: () => {
|
|
form.submit();
|
|
} }, "\u4FDD\u5B58")),
|
|
/* @__PURE__ */ CombinationEditor_React.createElement("div", { style: { maxHeight: "70vh", overflowY: "auto", marginTop: "10px", paddingRight: "5px" } }, /* @__PURE__ */ CombinationEditor_React.createElement(row/* default */.Z, { align: "middle" }, scoreByBlank ? /* @__PURE__ */ CombinationEditor_React.createElement(QuestionText/* default */.Z, { text: "\uFF08\u5C0F\u9898\u5206\u503C\u7B49\u4E8E\u5404\u586B\u7A7A\u9879\u5206\u503C\u4E4B\u548C\uFF09" }) : /* @__PURE__ */ CombinationEditor_React.createElement(es_form["default"].Item, { key: 2, className: EditPotinmodules.scoreinput, name: "question_score", label: "\u5206\u503C", rules: [{
|
|
required: true,
|
|
message: "\u8BF7\u8F93\u5165\u5206\u503C"
|
|
}] }, /* @__PURE__ */ CombinationEditor_React.createElement(input_number/* default */.Z, { onBlur: (e) => {
|
|
e.target.value === "0" && message/* default */.ZP.error("\u5206\u503C\u5FC5\u987B\u5927\u4E8E0\u4E14\u5C0F\u4E8E\u7B49\u4E8E100");
|
|
}, style: { width: 150 }, precision: 1, placeholder: "\u8BF7\u8F93\u5165\u5206\u503C", size: "middle", max: 100, min: 0.1 })), /* @__PURE__ */ CombinationEditor_React.createElement(es_form["default"].Item, { name: "use_blank_score", noStyle: true }, /* @__PURE__ */ CombinationEditor_React.createElement(
|
|
es_radio/* default.Group */.ZP.Group,
|
|
{
|
|
className: EditPotinmodules.scoreByBlankRadio,
|
|
optionType: "button",
|
|
options: [
|
|
{ label: "\u6309\u7A7A\u7ED9\u5206", value: true },
|
|
{ label: "\u6309\u9898\u7ED9\u5206", value: false }
|
|
]
|
|
}
|
|
)), /* @__PURE__ */ CombinationEditor_React.createElement(tooltip/* default */.Z, { overlayInnerStyle: { width: 460 }, title: /* @__PURE__ */ CombinationEditor_React.createElement("div", null, "\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__ */ CombinationEditor_React.createElement("br", null), "\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") }, /* @__PURE__ */ CombinationEditor_React.createElement("i", { className: "icon-tishixiaowenhao font18 ml20 c-3061d0" }))), /* @__PURE__ */ CombinationEditor_React.createElement(
|
|
CompletionQuestionEditor/* CompletionQuestionEditor */.u,
|
|
{
|
|
form,
|
|
questionTitlePlaceholder: "\u8BF7\u7F16\u8F91\u586B\u7A7A\u9898\u9898\u5E72\u5185\u5BB9",
|
|
scoreByBlank,
|
|
answerKey: "standard_answers"
|
|
}
|
|
), /* @__PURE__ */ CombinationEditor_React.createElement(MoreSetting, { getTagData, qitem, exerciseitem, TagDiscipline, form }))
|
|
));
|
|
};
|
|
/* harmony default export */ var CombinationEditor = (CombinationEditor_DragQuestions);
|
|
|
|
// EXTERNAL MODULE: ./src/components/QuestionEditor/JudgmentQuestionEditor.tsx
|
|
var JudgmentQuestionEditor = __webpack_require__(27522);
|
|
;// CONCATENATED MODULE: ./src/pages/Paperlibrary/EditPotin/components/Questions/JudgmentQuestionEditor.tsx
|
|
/* provided dependency */ var JudgmentQuestionEditor_React = __webpack_require__(/*! react */ 59301);
|
|
var JudgmentQuestionEditor_defProp = Object.defineProperty;
|
|
var JudgmentQuestionEditor_defProps = Object.defineProperties;
|
|
var JudgmentQuestionEditor_getOwnPropDescs = Object.getOwnPropertyDescriptors;
|
|
var JudgmentQuestionEditor_getOwnPropSymbols = Object.getOwnPropertySymbols;
|
|
var JudgmentQuestionEditor_hasOwnProp = Object.prototype.hasOwnProperty;
|
|
var JudgmentQuestionEditor_propIsEnum = Object.prototype.propertyIsEnumerable;
|
|
var JudgmentQuestionEditor_defNormalProp = (obj, key, value) => key in obj ? JudgmentQuestionEditor_defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
|
|
var JudgmentQuestionEditor_spreadValues = (a, b) => {
|
|
for (var prop in b || (b = {}))
|
|
if (JudgmentQuestionEditor_hasOwnProp.call(b, prop))
|
|
JudgmentQuestionEditor_defNormalProp(a, prop, b[prop]);
|
|
if (JudgmentQuestionEditor_getOwnPropSymbols)
|
|
for (var prop of JudgmentQuestionEditor_getOwnPropSymbols(b)) {
|
|
if (JudgmentQuestionEditor_propIsEnum.call(b, prop))
|
|
JudgmentQuestionEditor_defNormalProp(a, prop, b[prop]);
|
|
}
|
|
return a;
|
|
};
|
|
var JudgmentQuestionEditor_spreadProps = (a, b) => JudgmentQuestionEditor_defProps(a, JudgmentQuestionEditor_getOwnPropDescs(b));
|
|
var JudgmentQuestionEditor_async = (__this, __arguments, generator) => {
|
|
return new Promise((resolve, reject) => {
|
|
var fulfilled = (value) => {
|
|
try {
|
|
step(generator.next(value));
|
|
} catch (e) {
|
|
reject(e);
|
|
}
|
|
};
|
|
var rejected = (value) => {
|
|
try {
|
|
step(generator.throw(value));
|
|
} catch (e) {
|
|
reject(e);
|
|
}
|
|
};
|
|
var step = (x) => x.done ? resolve(x.value) : Promise.resolve(x.value).then(fulfilled, rejected);
|
|
step((generator = generator.apply(__this, __arguments)).next());
|
|
});
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
const JudgmentQuestionEditor_DragQuestions = ({ qitem, setisedit, TagDiscipline, exerciseitem, seveeditor, deleteitem, getTagData, init }) => {
|
|
const [form] = es_form["default"].useForm();
|
|
(0,_react_17_0_2_react.useEffect)(() => {
|
|
var _a;
|
|
form.setFieldsValue(JudgmentQuestionEditor_spreadProps(JudgmentQuestionEditor_spreadValues({}, qitem), {
|
|
name: qitem.question_title,
|
|
repeat_answer: !qitem.repeat_answer,
|
|
choices: (_a = qitem == null ? void 0 : qitem.question_choices) == null ? void 0 : _a.map((item) => {
|
|
return JudgmentQuestionEditor_spreadProps(JudgmentQuestionEditor_spreadValues({}, item), { is_answer: (item == null ? void 0 : item.standard_boolean) ? 1 : 0 });
|
|
})
|
|
}));
|
|
}, [qitem]);
|
|
return /* @__PURE__ */ JudgmentQuestionEditor_React.createElement("div", null, /* @__PURE__ */ JudgmentQuestionEditor_React.createElement(
|
|
es_form["default"],
|
|
{
|
|
form,
|
|
colon: false,
|
|
onFinish: (values) => {
|
|
seveeditor(JudgmentQuestionEditor_spreadValues(JudgmentQuestionEditor_spreadValues({}, qitem), values));
|
|
},
|
|
onFinishFailed: (errInfo) => JudgmentQuestionEditor_async(void 0, null, function* () {
|
|
var _a, _b;
|
|
message/* default */.ZP.error(errInfo.errorFields[0].errors[0]);
|
|
form.scrollToField((_b = (_a = errInfo == null ? void 0 : errInfo.errorFields) == null ? void 0 : _a[0]) == null ? void 0 : _b.name, { behavior: "smooth", block: "center" });
|
|
})
|
|
},
|
|
/* @__PURE__ */ JudgmentQuestionEditor_React.createElement("div", { style: { display: "flex", alignItems: "center" } }, /* @__PURE__ */ JudgmentQuestionEditor_React.createElement("div", { style: { flex: 1 } }, /* @__PURE__ */ JudgmentQuestionEditor_React.createElement("span", { style: { display: "inline-flex", border: "1px solid #9096A3", borderRadius: "50%", width: 10, height: 10, marginRight: 5, background: "#9096A3" } }), /* @__PURE__ */ JudgmentQuestionEditor_React.createElement("span", null, "\u5224\u65AD\u9898")), !(qitem == null ? void 0 : qitem.isadd) && /* @__PURE__ */ JudgmentQuestionEditor_React.createElement("span", { style: { marginLeft: 20, marginRight: 20, color: "red", cursor: "pointer" }, onClick: () => {
|
|
deleteitem();
|
|
} }, /* @__PURE__ */ JudgmentQuestionEditor_React.createElement("i", { className: "iconfont icon-piliangshanchu3", style: { fontSize: 14, marginRight: 6 } }), "\u5220\u9664"), /* @__PURE__ */ JudgmentQuestionEditor_React.createElement(es_button/* default */.ZP, { onClick: () => {
|
|
var _a;
|
|
if (!qitem.isadd) {
|
|
form.setFieldsValue(JudgmentQuestionEditor_spreadProps(JudgmentQuestionEditor_spreadValues({}, qitem), {
|
|
name: qitem == null ? void 0 : qitem.question_title,
|
|
choices: (_a = qitem == null ? void 0 : qitem.question_choices) == null ? void 0 : _a.map((item) => {
|
|
return JudgmentQuestionEditor_spreadProps(JudgmentQuestionEditor_spreadValues({}, item), { is_answer: (item == null ? void 0 : item.standard_boolean) ? 1 : 0 });
|
|
}),
|
|
repeat_answer: !(qitem == null ? void 0 : qitem.repeat_answer)
|
|
}));
|
|
setisedit(false);
|
|
} else {
|
|
setisedit(false);
|
|
init();
|
|
}
|
|
} }, "\u53D6\u6D88"), /* @__PURE__ */ JudgmentQuestionEditor_React.createElement(es_button/* default */.ZP, { className: "ml20", type: "primary", onClick: () => {
|
|
form.submit();
|
|
} }, "\u4FDD\u5B58")),
|
|
/* @__PURE__ */ JudgmentQuestionEditor_React.createElement("div", { style: { maxHeight: "70vh", overflowY: "auto", marginTop: "10px", paddingRight: "5px" } }, /* @__PURE__ */ JudgmentQuestionEditor_React.createElement(es_form["default"].Item, { className: EditPotinmodules.scoreinput, name: "question_score", label: "\u5206\u503C", rules: [{
|
|
required: true,
|
|
message: "\u8BF7\u8F93\u5165\u5206\u503C"
|
|
}] }, /* @__PURE__ */ JudgmentQuestionEditor_React.createElement(input_number/* default */.Z, { onBlur: (e) => {
|
|
e.target.value === "0" && message/* default */.ZP.error("\u5206\u503C\u5FC5\u987B\u5927\u4E8E0\u4E14\u5C0F\u4E8E\u7B49\u4E8E100");
|
|
}, style: { width: 150 }, precision: 1, placeholder: "\u8BF7\u8F93\u5165\u5206\u503C", max: 100, min: 0.1 })), /* @__PURE__ */ JudgmentQuestionEditor_React.createElement(
|
|
JudgmentQuestionEditor/* JudgmentQuestionEditor */.Z,
|
|
{
|
|
form,
|
|
questionTitlePlaceholder: "\u8BF7\u7F16\u8F91\u5224\u65AD\u9898\u9898\u5E72\u5185\u5BB9",
|
|
choiceKey: ""
|
|
}
|
|
), /* @__PURE__ */ JudgmentQuestionEditor_React.createElement(MoreSetting, { getTagData, qitem, exerciseitem, TagDiscipline, form }))
|
|
));
|
|
};
|
|
/* harmony default export */ var Questions_JudgmentQuestionEditor = (JudgmentQuestionEditor_DragQuestions);
|
|
|
|
// EXTERNAL MODULE: ./node_modules/_antd@5.9.0@antd/es/collapse/index.js + 8 modules
|
|
var collapse = __webpack_require__(36381);
|
|
;// 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.3.7@@ant-design/icons/es/icons/MinusCircleOutlined.js + 1 modules
|
|
var MinusCircleOutlined = __webpack_require__(78091);
|
|
// EXTERNAL MODULE: ./src/components/markdown-editor/index.tsx + 15 modules
|
|
var markdown_editor = __webpack_require__(96180);
|
|
;// CONCATENATED MODULE: ./src/pages/Paperlibrary/EditPotin/components/Questions/QuestionEditor/MdEditorInForm.tsx
|
|
var MdEditorInForm_defProp = Object.defineProperty;
|
|
var MdEditorInForm_defProps = Object.defineProperties;
|
|
var MdEditorInForm_getOwnPropDescs = Object.getOwnPropertyDescriptors;
|
|
var MdEditorInForm_getOwnPropSymbols = Object.getOwnPropertySymbols;
|
|
var MdEditorInForm_hasOwnProp = Object.prototype.hasOwnProperty;
|
|
var MdEditorInForm_propIsEnum = Object.prototype.propertyIsEnumerable;
|
|
var MdEditorInForm_defNormalProp = (obj, key, value) => key in obj ? MdEditorInForm_defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
|
|
var MdEditorInForm_spreadValues = (a, b) => {
|
|
for (var prop in b || (b = {}))
|
|
if (MdEditorInForm_hasOwnProp.call(b, prop))
|
|
MdEditorInForm_defNormalProp(a, prop, b[prop]);
|
|
if (MdEditorInForm_getOwnPropSymbols)
|
|
for (var prop of MdEditorInForm_getOwnPropSymbols(b)) {
|
|
if (MdEditorInForm_propIsEnum.call(b, prop))
|
|
MdEditorInForm_defNormalProp(a, prop, b[prop]);
|
|
}
|
|
return a;
|
|
};
|
|
var MdEditorInForm_spreadProps = (a, b) => MdEditorInForm_defProps(a, MdEditorInForm_getOwnPropDescs(b));
|
|
var __objRest = (source, exclude) => {
|
|
var target = {};
|
|
for (var prop in source)
|
|
if (MdEditorInForm_hasOwnProp.call(source, prop) && exclude.indexOf(prop) < 0)
|
|
target[prop] = source[prop];
|
|
if (source != null && MdEditorInForm_getOwnPropSymbols)
|
|
for (var prop of MdEditorInForm_getOwnPropSymbols(source)) {
|
|
if (exclude.indexOf(prop) < 0 && MdEditorInForm_propIsEnum.call(source, prop))
|
|
target[prop] = source[prop];
|
|
}
|
|
return target;
|
|
};
|
|
|
|
|
|
|
|
|
|
const MdEditorInForm = (_a) => {
|
|
var _b = _a, { value, onChange, scrollId } = _b, props = __objRest(_b, ["value", "onChange", "scrollId"]);
|
|
return /* @__PURE__ */ _react_17_0_2_react.createElement("div", { id: scrollId || "" }, /* @__PURE__ */ _react_17_0_2_react.createElement(
|
|
markdown_editor/* default */.Z,
|
|
MdEditorInForm_spreadProps(MdEditorInForm_spreadValues({}, props), {
|
|
defaultValue: value,
|
|
onChange: (a, b) => {
|
|
console.log("a:", a, b);
|
|
if (!!(b == null ? void 0 : b.length))
|
|
onChange(a, b);
|
|
else
|
|
onChange(a);
|
|
}
|
|
})
|
|
));
|
|
};
|
|
const RegularInput = ({ value, onChange, placeholder, height = 140, isEdit }) => {
|
|
return isEdit ? /* @__PURE__ */ _react_17_0_2_react.createElement(
|
|
markdown_editor/* default */.Z,
|
|
{
|
|
watch: true,
|
|
isFocus: true,
|
|
height,
|
|
placeholder,
|
|
defaultValue: value,
|
|
onChange
|
|
}
|
|
) : /* @__PURE__ */ _react_17_0_2_react.createElement("div", { style: { cursor: "pointer" } }, value ? /* @__PURE__ */ _react_17_0_2_react.createElement(RenderHtml/* default */.Z, { className: QuestionEditormodules.inputBorder, value }) : /* @__PURE__ */ _react_17_0_2_react.createElement("div", { className: `${QuestionEditormodules.inputBorder} ${QuestionEditormodules.placeholder}` }, placeholder));
|
|
};
|
|
|
|
|
|
// 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.3.7@@ant-design/icons/es/icons/PlusCircleOutlined.js + 1 modules
|
|
var PlusCircleOutlined = __webpack_require__(57703);
|
|
;// CONCATENATED MODULE: ./src/pages/Paperlibrary/EditPotin/components/Questions/QuestionEditor/ChoiceQuestionEditor.tsx
|
|
var ChoiceQuestionEditor_defProp = Object.defineProperty;
|
|
var ChoiceQuestionEditor_defProps = Object.defineProperties;
|
|
var ChoiceQuestionEditor_getOwnPropDescs = Object.getOwnPropertyDescriptors;
|
|
var ChoiceQuestionEditor_getOwnPropSymbols = Object.getOwnPropertySymbols;
|
|
var ChoiceQuestionEditor_hasOwnProp = Object.prototype.hasOwnProperty;
|
|
var ChoiceQuestionEditor_propIsEnum = Object.prototype.propertyIsEnumerable;
|
|
var ChoiceQuestionEditor_defNormalProp = (obj, key, value) => key in obj ? ChoiceQuestionEditor_defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
|
|
var ChoiceQuestionEditor_spreadValues = (a, b) => {
|
|
for (var prop in b || (b = {}))
|
|
if (ChoiceQuestionEditor_hasOwnProp.call(b, prop))
|
|
ChoiceQuestionEditor_defNormalProp(a, prop, b[prop]);
|
|
if (ChoiceQuestionEditor_getOwnPropSymbols)
|
|
for (var prop of ChoiceQuestionEditor_getOwnPropSymbols(b)) {
|
|
if (ChoiceQuestionEditor_propIsEnum.call(b, prop))
|
|
ChoiceQuestionEditor_defNormalProp(a, prop, b[prop]);
|
|
}
|
|
return a;
|
|
};
|
|
var ChoiceQuestionEditor_spreadProps = (a, b) => ChoiceQuestionEditor_defProps(a, ChoiceQuestionEditor_getOwnPropDescs(b));
|
|
var ChoiceQuestionEditor_objRest = (source, exclude) => {
|
|
var target = {};
|
|
for (var prop in source)
|
|
if (ChoiceQuestionEditor_hasOwnProp.call(source, prop) && exclude.indexOf(prop) < 0)
|
|
target[prop] = source[prop];
|
|
if (source != null && ChoiceQuestionEditor_getOwnPropSymbols)
|
|
for (var prop of ChoiceQuestionEditor_getOwnPropSymbols(source)) {
|
|
if (exclude.indexOf(prop) < 0 && ChoiceQuestionEditor_propIsEnum.call(source, prop))
|
|
target[prop] = source[prop];
|
|
}
|
|
return target;
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
const tagList = [
|
|
"A",
|
|
"B",
|
|
"C",
|
|
"D",
|
|
"E",
|
|
"F",
|
|
"G",
|
|
"H",
|
|
"I",
|
|
"J",
|
|
"K",
|
|
"L",
|
|
"M",
|
|
"N",
|
|
"O",
|
|
"P",
|
|
"Q",
|
|
"R",
|
|
"S",
|
|
"T",
|
|
"U",
|
|
"V",
|
|
"W",
|
|
"X",
|
|
"Y",
|
|
"Z"
|
|
];
|
|
const ChoiceQuestionItem = ({
|
|
value,
|
|
onChange,
|
|
choiceTextKey,
|
|
answerKey,
|
|
index,
|
|
isEdit,
|
|
setInputActive,
|
|
form,
|
|
choiceOptionsPath,
|
|
allowChangeMode,
|
|
showAddIcon,
|
|
addItem,
|
|
deleteItem
|
|
}) => {
|
|
const isActiveAnswer = (value == null ? void 0 : value[answerKey]) === 1;
|
|
const setAllOptionsToFalse = () => {
|
|
const options = form.getFieldValue(choiceOptionsPath);
|
|
form.setFieldValue(choiceOptionsPath, options.map((item) => ChoiceQuestionEditor_spreadProps(ChoiceQuestionEditor_spreadValues({}, item), { [answerKey]: 0 })));
|
|
};
|
|
const setActiveAnswer = () => {
|
|
if (isActiveAnswer) {
|
|
onChange(ChoiceQuestionEditor_spreadProps(ChoiceQuestionEditor_spreadValues({}, value), { [answerKey]: 0 }));
|
|
} else {
|
|
if (!allowChangeMode) {
|
|
setAllOptionsToFalse();
|
|
}
|
|
onChange(ChoiceQuestionEditor_spreadProps(ChoiceQuestionEditor_spreadValues({}, value), { [answerKey]: 1 }));
|
|
}
|
|
};
|
|
return /* @__PURE__ */ _react_17_0_2_react.createElement(row/* default */.Z, { className: QuestionEditormodules.choiceWrap, align: "middle", wrap: false }, /* @__PURE__ */ _react_17_0_2_react.createElement(col/* default */.Z, { onClick: setActiveAnswer, className: `${QuestionEditormodules.choiceIndex} ${isActiveAnswer ? QuestionEditormodules.activeAnswer : ""}` }, tagList[index]), /* @__PURE__ */ _react_17_0_2_react.createElement(col/* default */.Z, { flex: 1, className: `${QuestionEditormodules.editorWrap} ml15`, onClick: setInputActive }, /* @__PURE__ */ _react_17_0_2_react.createElement(RegularInput, { height: 155, placeholder: "\u8BF7\u60A8\u8F93\u5165\u9009\u9879", isEdit, value: value == null ? void 0 : value[choiceTextKey], onChange: (v) => {
|
|
onChange(ChoiceQuestionEditor_spreadProps(ChoiceQuestionEditor_spreadValues({}, value), { [choiceTextKey]: v }));
|
|
} })), /* @__PURE__ */ _react_17_0_2_react.createElement(
|
|
col/* default */.Z,
|
|
{
|
|
flex: "0 0 auto",
|
|
className: "ml15"
|
|
},
|
|
/* @__PURE__ */ _react_17_0_2_react.createElement(
|
|
"div",
|
|
{
|
|
onClick: setActiveAnswer,
|
|
className: `${QuestionEditormodules.setAnswerBtn} ${isActiveAnswer ? QuestionEditormodules.activeAnswer : ""}`
|
|
},
|
|
isActiveAnswer ? "\u6B63\u786E\u7B54\u6848" : "\u8BBE\u4E3A\u7B54\u6848"
|
|
)
|
|
), /* @__PURE__ */ _react_17_0_2_react.createElement(col/* default */.Z, { className: QuestionEditormodules.actionWrapper }, /* @__PURE__ */ _react_17_0_2_react.createElement(tooltip/* default */.Z, { title: "\u65B0\u589E\u53C2\u8003\u7B54\u6848" }, /* @__PURE__ */ _react_17_0_2_react.createElement(
|
|
PlusCircleOutlined/* default */.Z,
|
|
{
|
|
className: QuestionEditormodules.addIcon,
|
|
onClick: addItem,
|
|
style: { visibility: showAddIcon ? "visible" : "hidden" }
|
|
}
|
|
)), /* @__PURE__ */ _react_17_0_2_react.createElement(tooltip/* default */.Z, { title: "\u5220\u9664" }, /* @__PURE__ */ _react_17_0_2_react.createElement(
|
|
MinusCircleOutlined/* default */.Z,
|
|
{
|
|
className: QuestionEditormodules.deleteIcon,
|
|
onClick: deleteItem,
|
|
style: { visibility: index > 1 ? "visible" : "hidden" }
|
|
}
|
|
))));
|
|
};
|
|
const ChoiceQuestionEditor_ChoiceQuestionEditor = ({
|
|
questionTitlePlaceholder,
|
|
titleKey,
|
|
choiceKey,
|
|
analysisKey,
|
|
choiceTextKey,
|
|
answerKey,
|
|
choiceOptionsPath,
|
|
allowChangeMode = true,
|
|
form,
|
|
showAnalysis = true
|
|
}) => {
|
|
const [activeEditor, setActiveEditor] = (0,_react_17_0_2_react.useState)();
|
|
const [editAnalysis, setEditAnalysis] = (0,_react_17_0_2_react.useState)(false);
|
|
return /* @__PURE__ */ _react_17_0_2_react.createElement("div", { className: QuestionEditormodules.wrap }, /* @__PURE__ */ _react_17_0_2_react.createElement("div", { className: QuestionEditormodules.questionTitleEditorWrap }, /* @__PURE__ */ _react_17_0_2_react.createElement(es_form["default"].Item, { label: "\u9898\u5E72", name: titleKey, labelCol: { span: 24 }, rules: [{ required: true }] }, /* @__PURE__ */ _react_17_0_2_react.createElement(
|
|
MdEditorInForm,
|
|
{
|
|
scrollId: Array.isArray(titleKey) ? titleKey.join("_") : `${titleKey}`,
|
|
watch: true,
|
|
height: 140,
|
|
placeholder: questionTitlePlaceholder
|
|
}
|
|
))), /* @__PURE__ */ _react_17_0_2_react.createElement(es_form["default"].Item, { label: "\u7B54\u6848\u9009\u9879", required: true, labelCol: { span: 24 } }), /* @__PURE__ */ _react_17_0_2_react.createElement(
|
|
es_form["default"].List,
|
|
{
|
|
name: choiceKey,
|
|
rules: [{
|
|
validator(rule, values) {
|
|
const hasAnswer = values.some((option) => option[answerKey] === 1);
|
|
const emptyAnswerIndex = values.findIndex((option) => {
|
|
var _a;
|
|
return ((_a = option[choiceTextKey]) == null ? void 0 : _a.length) <= 0;
|
|
});
|
|
if (emptyAnswerIndex !== -1) {
|
|
return Promise.reject(new Error(`\u8BF7\u5148\u8F93\u5165${tagList[emptyAnswerIndex]}\u9009\u9879\u7684\u5185\u5BB9`));
|
|
}
|
|
if (!hasAnswer) {
|
|
return Promise.reject(new Error("\u8BF7\u8BBE\u7F6E\u6B63\u786E\u7B54\u6848"));
|
|
}
|
|
return Promise.resolve();
|
|
}
|
|
}]
|
|
},
|
|
(fields, { add, remove }) => /* @__PURE__ */ _react_17_0_2_react.createElement("div", { id: Array.isArray(choiceOptionsPath) ? choiceOptionsPath.join("_") : `${choiceOptionsPath}` }, fields.map((_a, index) => {
|
|
var _b = _a, { key, name } = _b, restField = ChoiceQuestionEditor_objRest(_b, ["key", "name"]);
|
|
const isEdit = activeEditor === key;
|
|
const setInputActive = () => {
|
|
setActiveEditor(key);
|
|
};
|
|
const showAddIcon = index < 7 && index === fields.length - 1;
|
|
const addItem = () => add({ [choiceTextKey]: "", [answerKey]: 0 });
|
|
const deleteItem = () => remove(name);
|
|
return /* @__PURE__ */ _react_17_0_2_react.createElement(es_form["default"].Item, ChoiceQuestionEditor_spreadProps(ChoiceQuestionEditor_spreadValues({}, restField), { key, name, noStyle: true }), /* @__PURE__ */ _react_17_0_2_react.createElement(
|
|
ChoiceQuestionItem,
|
|
{
|
|
choiceTextKey,
|
|
answerKey,
|
|
index,
|
|
isEdit,
|
|
setInputActive,
|
|
form,
|
|
choiceOptionsPath,
|
|
allowChangeMode,
|
|
showAddIcon,
|
|
addItem,
|
|
deleteItem
|
|
}
|
|
));
|
|
}), fields.length < 8 && /* @__PURE__ */ _react_17_0_2_react.createElement("div", { className: `${QuestionEditormodules.addBtn} mb30`, onClick: () => add({ [choiceTextKey]: "", [answerKey]: 0 }) }, "\u6DFB\u52A0\u9009\u9879"))
|
|
), showAnalysis && /* @__PURE__ */ _react_17_0_2_react.createElement("div", { onClick: () => setEditAnalysis(true) }, /* @__PURE__ */ _react_17_0_2_react.createElement(es_form["default"].Item, { name: analysisKey, label: "\u9898\u76EE\u89E3\u6790", labelCol: { span: 24 } }, /* @__PURE__ */ _react_17_0_2_react.createElement(RegularInput, { placeholder: "\u8BF7\u7F16\u8F91\u9898\u76EE\u89E3\u6790\uFF08\u975E\u5FC5\u586B\uFF09", isEdit: editAnalysis }))));
|
|
};
|
|
|
|
|
|
;// CONCATENATED MODULE: ./src/pages/Paperlibrary/EditPotin/components/Questions/QuestionEditor/CombinationCompletionQuestionEditor.tsx
|
|
/* provided dependency */ var CombinationCompletionQuestionEditor_React = __webpack_require__(/*! react */ 59301);
|
|
var CombinationCompletionQuestionEditor_defProp = Object.defineProperty;
|
|
var CombinationCompletionQuestionEditor_defProps = Object.defineProperties;
|
|
var CombinationCompletionQuestionEditor_getOwnPropDescs = Object.getOwnPropertyDescriptors;
|
|
var CombinationCompletionQuestionEditor_getOwnPropSymbols = Object.getOwnPropertySymbols;
|
|
var CombinationCompletionQuestionEditor_hasOwnProp = Object.prototype.hasOwnProperty;
|
|
var CombinationCompletionQuestionEditor_propIsEnum = Object.prototype.propertyIsEnumerable;
|
|
var CombinationCompletionQuestionEditor_defNormalProp = (obj, key, value) => key in obj ? CombinationCompletionQuestionEditor_defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
|
|
var CombinationCompletionQuestionEditor_spreadValues = (a, b) => {
|
|
for (var prop in b || (b = {}))
|
|
if (CombinationCompletionQuestionEditor_hasOwnProp.call(b, prop))
|
|
CombinationCompletionQuestionEditor_defNormalProp(a, prop, b[prop]);
|
|
if (CombinationCompletionQuestionEditor_getOwnPropSymbols)
|
|
for (var prop of CombinationCompletionQuestionEditor_getOwnPropSymbols(b)) {
|
|
if (CombinationCompletionQuestionEditor_propIsEnum.call(b, prop))
|
|
CombinationCompletionQuestionEditor_defNormalProp(a, prop, b[prop]);
|
|
}
|
|
return a;
|
|
};
|
|
var CombinationCompletionQuestionEditor_spreadProps = (a, b) => CombinationCompletionQuestionEditor_defProps(a, CombinationCompletionQuestionEditor_getOwnPropDescs(b));
|
|
var CombinationCompletionQuestionEditor_objRest = (source, exclude) => {
|
|
var target = {};
|
|
for (var prop in source)
|
|
if (CombinationCompletionQuestionEditor_hasOwnProp.call(source, prop) && exclude.indexOf(prop) < 0)
|
|
target[prop] = source[prop];
|
|
if (source != null && CombinationCompletionQuestionEditor_getOwnPropSymbols)
|
|
for (var prop of CombinationCompletionQuestionEditor_getOwnPropSymbols(source)) {
|
|
if (exclude.indexOf(prop) < 0 && CombinationCompletionQuestionEditor_propIsEnum.call(source, prop))
|
|
target[prop] = source[prop];
|
|
}
|
|
return target;
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
const BlankEditor = ({ value, onChange }) => {
|
|
const handleDelete = (index) => {
|
|
modal["default"].confirm({
|
|
centered: true,
|
|
okText: "\u786E\u5B9A",
|
|
cancelText: "\u53D6\u6D88",
|
|
title: "\u63D0\u793A",
|
|
content: "\u786E\u8BA4\u8981\u5220\u9664\u8FD9\u4E2A\u53C2\u8003\u7B54\u6848\u5417\uFF1F",
|
|
className: QuestionEditormodules.modal,
|
|
onOk: () => {
|
|
const valueCopy = [...value];
|
|
valueCopy.splice(index, 1);
|
|
onChange(valueCopy);
|
|
}
|
|
});
|
|
};
|
|
const handleAdd = () => {
|
|
const valueCopy = [...value];
|
|
valueCopy.push("");
|
|
onChange(valueCopy);
|
|
};
|
|
return /* @__PURE__ */ CombinationCompletionQuestionEditor_React.createElement(row/* default */.Z, { className: "ml20" }, /* @__PURE__ */ CombinationCompletionQuestionEditor_React.createElement(col/* default */.Z, { flex: 1 }, value == null ? void 0 : value.map((v, index) => {
|
|
return /* @__PURE__ */ CombinationCompletionQuestionEditor_React.createElement(row/* default */.Z, { key: `${v}_${index}`, align: "middle", className: "mb20" }, /* @__PURE__ */ CombinationCompletionQuestionEditor_React.createElement(
|
|
input["default"].TextArea,
|
|
{
|
|
style: { flex: 1, minHeight: 44 },
|
|
defaultValue: v,
|
|
autoSize: { maxRows: 3 },
|
|
maxLength: 1e3,
|
|
onBlur: (e) => {
|
|
const valueCopy = [...value];
|
|
const inputTrimValue = e.target.value.trim();
|
|
valueCopy[index] = inputTrimValue;
|
|
onChange(valueCopy);
|
|
}
|
|
}
|
|
), /* @__PURE__ */ CombinationCompletionQuestionEditor_React.createElement(tooltip/* default */.Z, { title: "\u5220\u9664" }, /* @__PURE__ */ CombinationCompletionQuestionEditor_React.createElement(
|
|
MinusCircleOutlined/* default */.Z,
|
|
{
|
|
className: QuestionEditormodules.deleteIcon,
|
|
style: { marginLeft: 15, visibility: index > 0 ? "visible" : "hidden" },
|
|
onClick: () => handleDelete(index)
|
|
}
|
|
)));
|
|
})), /* @__PURE__ */ CombinationCompletionQuestionEditor_React.createElement(col/* default */.Z, null, /* @__PURE__ */ CombinationCompletionQuestionEditor_React.createElement("div", { className: `${QuestionEditormodules.addBtn}`, onClick: () => {
|
|
handleAdd();
|
|
} }, "\u65B0\u589E\u7B54\u6848")));
|
|
};
|
|
const ReversedSwitch = ({ value = true, onChange }) => {
|
|
return /* @__PURE__ */ CombinationCompletionQuestionEditor_React.createElement(
|
|
es_switch/* default */.Z,
|
|
{
|
|
checked: !value,
|
|
onChange: (checked) => {
|
|
onChange(!checked);
|
|
}
|
|
}
|
|
);
|
|
};
|
|
const NULL_CH = "\u2581";
|
|
const CombinationCompletionQuestionEditor_CompletionQuestionEditor = ({
|
|
questionTitlePlaceholder,
|
|
form,
|
|
name,
|
|
scoreByBlank,
|
|
answerKey,
|
|
titleKey = "name",
|
|
analysisKey = "analysis",
|
|
isOrdered = "is_ordered"
|
|
}) => {
|
|
var _a, _b;
|
|
const [editAnalysis, setEditAnalysis] = (0,_react_17_0_2_react.useState)(false);
|
|
const getChCountBeforeCursor = (cm, cursor) => {
|
|
const currentLine = cursor.line;
|
|
let placeholderCountBefore = 0;
|
|
for (let _line = 0; _line < currentLine; _line++) {
|
|
placeholderCountBefore += cm.getLine(_line).split(NULL_CH).length - 1;
|
|
}
|
|
const currentLineStringBeforeCursor = cm.getLine(currentLine).substring(0, cursor.ch);
|
|
placeholderCountBefore += currentLineStringBeforeCursor.split(NULL_CH).length - 1;
|
|
return placeholderCountBefore;
|
|
};
|
|
const onCMBeforeChange = (cm, change, addBlank2, removeBlank2) => {
|
|
const rangeText = cm.getRange(change.from, change.to);
|
|
let newBlankNum = 0;
|
|
change.text.forEach((item) => {
|
|
newBlankNum += item.split(NULL_CH).length - 1;
|
|
});
|
|
if (change.origin === "setValue") {
|
|
return;
|
|
}
|
|
if (rangeText && rangeText.indexOf(NULL_CH) !== -1) {
|
|
const placeholderCountInRange = rangeText.split(NULL_CH).length - 1;
|
|
const placeholderCountBefore = getChCountBeforeCursor(
|
|
cm,
|
|
change.from
|
|
);
|
|
console.log(
|
|
`\u5220\u9664${placeholderCountInRange}\u4E2A\uFF0C \u524D\u9762\u6709${placeholderCountBefore}\u4E2A\uFF0C\u65B0\u589E${newBlankNum}\u4E2A`
|
|
);
|
|
if (placeholderCountInRange > 1) {
|
|
const indexArray = Array.from({ length: placeholderCountInRange }, (item, index) => placeholderCountBefore + index);
|
|
removeBlank2(indexArray);
|
|
} else {
|
|
removeBlank2(placeholderCountBefore);
|
|
}
|
|
} else if (newBlankNum > 0) {
|
|
const placeholderCountBefore = getChCountBeforeCursor(
|
|
cm,
|
|
change.from
|
|
);
|
|
console.log(
|
|
`\u65B0\u589E${newBlankNum}\u4E2A\uFF0C\u4E4B\u524D\u6709${placeholderCountBefore}\u4E2A`
|
|
);
|
|
addBlank2(newBlankNum, placeholderCountBefore);
|
|
}
|
|
};
|
|
const rewritePosition = () => {
|
|
const preAnswerData = form.getFieldValue(["sub_item_banks", ...answerKey]);
|
|
form.setFieldValue(
|
|
["sub_item_banks", ...answerKey],
|
|
preAnswerData == null ? void 0 : preAnswerData.map((item, index) => CombinationCompletionQuestionEditor_spreadProps(CombinationCompletionQuestionEditor_spreadValues({}, item), { position: index + 1 }))
|
|
);
|
|
};
|
|
const addFnRef = (0,_react_17_0_2_react.useRef)();
|
|
const addBlank = (addNum, insertIndex) => {
|
|
for (let i = 0; i < addNum; i++) {
|
|
addFnRef.current({ position: null, answer_text: [""] }, insertIndex + i);
|
|
}
|
|
rewritePosition();
|
|
};
|
|
const removeFnRef = (0,_react_17_0_2_react.useRef)();
|
|
const removeBlank = (deleteIndex) => {
|
|
removeFnRef.current(deleteIndex);
|
|
rewritePosition();
|
|
};
|
|
const standardAnswersValue = (_b = (_a = form.getFieldValue("sub_item_banks")) == null ? void 0 : _a[answerKey == null ? void 0 : answerKey[0]]) == null ? void 0 : _b[answerKey == null ? void 0 : answerKey[1]];
|
|
console.log(form == null ? void 0 : form.getFieldValue(["sub_item_banks", ...scoreByBlank]));
|
|
return /* @__PURE__ */ CombinationCompletionQuestionEditor_React.createElement("div", { className: QuestionEditormodules.wrap }, /* @__PURE__ */ CombinationCompletionQuestionEditor_React.createElement("div", { className: QuestionEditormodules.questionTitleEditorWrap }, /* @__PURE__ */ CombinationCompletionQuestionEditor_React.createElement(es_form["default"].Item, { label: "\u9898\u5E72", name: titleKey, labelCol: { span: 24 }, rules: [{ required: true }] }, /* @__PURE__ */ CombinationCompletionQuestionEditor_React.createElement(
|
|
MdEditorInForm,
|
|
{
|
|
scrollId: "name",
|
|
watch: true,
|
|
height: 140,
|
|
placeholder: questionTitlePlaceholder,
|
|
showNullButton: true,
|
|
onCMBeforeChange: (cm, change) => {
|
|
onCMBeforeChange(cm, change, addBlank, removeBlank);
|
|
}
|
|
}
|
|
))), /* @__PURE__ */ CombinationCompletionQuestionEditor_React.createElement(
|
|
es_form["default"].List,
|
|
{
|
|
name: answerKey,
|
|
rules: [{
|
|
validator(rule, values) {
|
|
if ((values == null ? void 0 : values.length) === 0) {
|
|
return Promise.reject(new Error("\u8BF7\u5148\u5728\u9898\u5E72\u4E2D\u63D2\u5165\u586B\u7A7A\u9879"));
|
|
}
|
|
for (const item of values) {
|
|
const { answer_text } = item || {};
|
|
if (answer_text == null ? void 0 : answer_text.some((text) => (text == null ? void 0 : text.length) === 0)) {
|
|
return Promise.reject(new Error("\u586B\u7A7A\u9879\u7B54\u6848\u4E0D\u80FD\u4E3A\u7A7A"));
|
|
}
|
|
}
|
|
return Promise.resolve();
|
|
}
|
|
}]
|
|
},
|
|
(fields, { add, remove }, { errors }) => {
|
|
addFnRef.current = add;
|
|
removeFnRef.current = remove;
|
|
return /* @__PURE__ */ CombinationCompletionQuestionEditor_React.createElement(CombinationCompletionQuestionEditor_React.Fragment, null, /* @__PURE__ */ CombinationCompletionQuestionEditor_React.createElement(es_form["default"].Item, { label: /* @__PURE__ */ CombinationCompletionQuestionEditor_React.createElement("span", null, "\u586B\u7A7A\u9879\u7B54\u6848", !(fields == null ? void 0 : fields.length) && /* @__PURE__ */ CombinationCompletionQuestionEditor_React.createElement("span", { style: { color: "#E99237" } }, "\uFF08\u8BF7\u5148\u5728\u9898\u5E72\u4E2D\u63D2\u5165\u586B\u7A7A\u9879\uFF09")), required: true, labelCol: { span: 24 } }), fields.map((_a2, index) => {
|
|
var _b2 = _a2, { key, name: name2 } = _b2, restField = CombinationCompletionQuestionEditor_objRest(_b2, ["key", "name"]);
|
|
return /* @__PURE__ */ CombinationCompletionQuestionEditor_React.createElement(row/* default */.Z, { className: `mb20`, key, align: "top" }, /* @__PURE__ */ CombinationCompletionQuestionEditor_React.createElement(col/* default */.Z, { flex: "0 0 auto", className: `${QuestionEditormodules.blankIndex} pt5` }, "\u586B\u7A7A\u9879", index + 1), /* @__PURE__ */ CombinationCompletionQuestionEditor_React.createElement(col/* default */.Z, { flex: 1 }, /* @__PURE__ */ CombinationCompletionQuestionEditor_React.createElement(row/* default */.Z, { align: "top", justify: "space-between" }, /* @__PURE__ */ CombinationCompletionQuestionEditor_React.createElement(col/* default */.Z, { flex: 1 }, /* @__PURE__ */ CombinationCompletionQuestionEditor_React.createElement(es_form["default"].Item, CombinationCompletionQuestionEditor_spreadProps(CombinationCompletionQuestionEditor_spreadValues({}, restField), { name: [name2, "answer_text"], noStyle: true }), /* @__PURE__ */ CombinationCompletionQuestionEditor_React.createElement(BlankEditor, null))), (form == null ? void 0 : form.getFieldValue(["sub_item_banks", ...scoreByBlank])) && /* @__PURE__ */ CombinationCompletionQuestionEditor_React.createElement(col/* default */.Z, { flex: "224px", style: { margin: "-7px 0 0 20px" } }, /* @__PURE__ */ CombinationCompletionQuestionEditor_React.createElement(es_form["default"].Item, CombinationCompletionQuestionEditor_spreadProps(CombinationCompletionQuestionEditor_spreadValues({}, restField), { name: [name2, "score"], label: "\u5206\u503C", rules: [{ required: true }], className: QuestionEditormodules.blankInputNumberWrapper }), /* @__PURE__ */ CombinationCompletionQuestionEditor_React.createElement(input_number/* default */.Z, { onChange: () => {
|
|
var _a3, _b3;
|
|
let obj = form == null ? void 0 : form.getFieldValue(["sub_item_banks", answerKey == null ? void 0 : answerKey[0], "standard_answers"]);
|
|
let count = 0;
|
|
for (let i in obj) {
|
|
if ((_a3 = obj[i]) == null ? void 0 : _a3.score) {
|
|
count += Number((_b3 = obj[i]) == null ? void 0 : _b3.score);
|
|
}
|
|
}
|
|
form == null ? void 0 : form.setFieldValue(["sub_item_banks", answerKey == null ? void 0 : answerKey[0], "question_score"], count);
|
|
}, className: QuestionEditormodules.blankInput, min: 0.1, max: 100, precision: 1, style: { width: "100%" }, placeholder: "\u8BF7\u8F93\u5165\u5206\u503C" })))), /* @__PURE__ */ CombinationCompletionQuestionEditor_React.createElement(es_form["default"].Item, CombinationCompletionQuestionEditor_spreadProps(CombinationCompletionQuestionEditor_spreadValues({}, restField), { name: [name2, "position"], noStyle: true }), /* @__PURE__ */ CombinationCompletionQuestionEditor_React.createElement(input["default"], { type: "hidden" }))));
|
|
}));
|
|
}
|
|
), /* @__PURE__ */ CombinationCompletionQuestionEditor_React.createElement(row/* default */.Z, { align: "middle" }, /* @__PURE__ */ CombinationCompletionQuestionEditor_React.createElement(es_form["default"].Item, { name: [name, "downcase"], valuePropName: "checked" }, /* @__PURE__ */ CombinationCompletionQuestionEditor_React.createElement(es_switch/* default */.Z, null)), /* @__PURE__ */ CombinationCompletionQuestionEditor_React.createElement(col/* default */.Z, { className: "ml10" }, "\u5224\u5206\u65F6\u5FFD\u7565\u7B54\u6848\u4E2D\u7684\u5B57\u6BCD\u5927\u5C0F\u5199")), /* @__PURE__ */ CombinationCompletionQuestionEditor_React.createElement(row/* default */.Z, { align: "middle" }, /* @__PURE__ */ CombinationCompletionQuestionEditor_React.createElement(es_form["default"].Item, { name: [name, "no_space"], valuePropName: "checked" }, /* @__PURE__ */ CombinationCompletionQuestionEditor_React.createElement(es_switch/* default */.Z, null)), /* @__PURE__ */ CombinationCompletionQuestionEditor_React.createElement(col/* default */.Z, { className: "ml10" }, "\u5224\u5206\u65F6\u5FFD\u7565\u7B54\u6848\u4E2D\u7684\u7A7A\u683C")), (standardAnswersValue == null ? void 0 : standardAnswersValue.length) > 1 && /* @__PURE__ */ CombinationCompletionQuestionEditor_React.createElement(
|
|
row/* default */.Z,
|
|
{
|
|
align: "middle",
|
|
className: (standardAnswersValue == null ? void 0 : standardAnswersValue.length) > 1 ? "mb30" : `${QuestionEditormodules.hide}`
|
|
},
|
|
/* @__PURE__ */ CombinationCompletionQuestionEditor_React.createElement(es_form["default"].Item, { name: isOrdered }, /* @__PURE__ */ CombinationCompletionQuestionEditor_React.createElement(ReversedSwitch, null)),
|
|
/* @__PURE__ */ CombinationCompletionQuestionEditor_React.createElement(col/* default */.Z, { className: "ml10" }, "\u5141\u8BB8\u5B66\u751F\u6BCF\u4E2A\u586B\u7A7A\u7684\u7B54\u6848\u4E0E\u6807\u51C6\u7B54\u6848\u7684\u987A\u5E8F\u4E0D\u4E00\u81F4")
|
|
), /* @__PURE__ */ CombinationCompletionQuestionEditor_React.createElement("div", { onClick: () => setEditAnalysis(true) }, /* @__PURE__ */ CombinationCompletionQuestionEditor_React.createElement(es_form["default"].Item, { name: analysisKey, label: "\u9898\u76EE\u89E3\u6790", labelCol: { span: 24 } }, /* @__PURE__ */ CombinationCompletionQuestionEditor_React.createElement(RegularInput, { placeholder: "\u8BF7\u7F16\u8F91\u9898\u76EE\u89E3\u6790\uFF08\u975E\u5FC5\u586B\uFF09", isEdit: editAnalysis }))));
|
|
};
|
|
|
|
|
|
;// CONCATENATED MODULE: ./src/pages/Paperlibrary/EditPotin/components/Questions/QuestionEditor/CombinationJudgmentQuestionEditor.tsx
|
|
var CombinationJudgmentQuestionEditor_defProp = Object.defineProperty;
|
|
var CombinationJudgmentQuestionEditor_defProps = Object.defineProperties;
|
|
var CombinationJudgmentQuestionEditor_getOwnPropDescs = Object.getOwnPropertyDescriptors;
|
|
var CombinationJudgmentQuestionEditor_getOwnPropSymbols = Object.getOwnPropertySymbols;
|
|
var CombinationJudgmentQuestionEditor_hasOwnProp = Object.prototype.hasOwnProperty;
|
|
var CombinationJudgmentQuestionEditor_propIsEnum = Object.prototype.propertyIsEnumerable;
|
|
var CombinationJudgmentQuestionEditor_defNormalProp = (obj, key, value) => key in obj ? CombinationJudgmentQuestionEditor_defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
|
|
var CombinationJudgmentQuestionEditor_spreadValues = (a, b) => {
|
|
for (var prop in b || (b = {}))
|
|
if (CombinationJudgmentQuestionEditor_hasOwnProp.call(b, prop))
|
|
CombinationJudgmentQuestionEditor_defNormalProp(a, prop, b[prop]);
|
|
if (CombinationJudgmentQuestionEditor_getOwnPropSymbols)
|
|
for (var prop of CombinationJudgmentQuestionEditor_getOwnPropSymbols(b)) {
|
|
if (CombinationJudgmentQuestionEditor_propIsEnum.call(b, prop))
|
|
CombinationJudgmentQuestionEditor_defNormalProp(a, prop, b[prop]);
|
|
}
|
|
return a;
|
|
};
|
|
var CombinationJudgmentQuestionEditor_spreadProps = (a, b) => CombinationJudgmentQuestionEditor_defProps(a, CombinationJudgmentQuestionEditor_getOwnPropDescs(b));
|
|
var CombinationJudgmentQuestionEditor_objRest = (source, exclude) => {
|
|
var target = {};
|
|
for (var prop in source)
|
|
if (CombinationJudgmentQuestionEditor_hasOwnProp.call(source, prop) && exclude.indexOf(prop) < 0)
|
|
target[prop] = source[prop];
|
|
if (source != null && CombinationJudgmentQuestionEditor_getOwnPropSymbols)
|
|
for (var prop of CombinationJudgmentQuestionEditor_getOwnPropSymbols(source)) {
|
|
if (exclude.indexOf(prop) < 0 && CombinationJudgmentQuestionEditor_propIsEnum.call(source, prop))
|
|
target[prop] = source[prop];
|
|
}
|
|
return target;
|
|
};
|
|
|
|
|
|
|
|
|
|
const tagMap = {
|
|
["\u6B63\u786E"]: "T",
|
|
["\u9519\u8BEF"]: "F"
|
|
};
|
|
const JudgmentQuestionItem = ({ value, onChange, form, choiceKey }) => {
|
|
const isActiveAnswer = (value == null ? void 0 : value.is_answer) === 1;
|
|
const judgementText = value == null ? void 0 : value.choice_text;
|
|
const setActiveAnswer = () => {
|
|
var _a;
|
|
const formListValue = (_a = form == null ? void 0 : form.getFieldValue(["sub_item_banks", ...choiceKey])) == null ? void 0 : _a.map((choice) => ({ choice_text: choice.choice_text, is_answer: 0 }));
|
|
form == null ? void 0 : form.setFieldValue(["sub_item_banks", ...choiceKey], formListValue);
|
|
onChange(CombinationJudgmentQuestionEditor_spreadProps(CombinationJudgmentQuestionEditor_spreadValues({}, value), { is_answer: 1 }));
|
|
};
|
|
return /* @__PURE__ */ _react_17_0_2_react.createElement(row/* default */.Z, { className: QuestionEditormodules.choiceWrap, align: "middle", wrap: false }, /* @__PURE__ */ _react_17_0_2_react.createElement(col/* default */.Z, { onClick: setActiveAnswer, className: `${QuestionEditormodules.choiceIndex} ${QuestionEditormodules.judgementIndex} ${isActiveAnswer ? QuestionEditormodules.activeAnswer : ""}` }, tagMap[judgementText]), /* @__PURE__ */ _react_17_0_2_react.createElement(col/* default */.Z, { flex: 1, className: `${QuestionEditormodules.editorWrap} ml15` }, /* @__PURE__ */ _react_17_0_2_react.createElement("div", { className: `${QuestionEditormodules.inputBorder} ${QuestionEditormodules.placeholder} ${isActiveAnswer ? QuestionEditormodules.activeJudgementAnswer : ""}` }, judgementText)), /* @__PURE__ */ _react_17_0_2_react.createElement(
|
|
col/* default */.Z,
|
|
{
|
|
flex: "0 0 auto",
|
|
className: "ml15"
|
|
},
|
|
/* @__PURE__ */ _react_17_0_2_react.createElement(
|
|
"div",
|
|
{
|
|
onClick: setActiveAnswer,
|
|
className: `${QuestionEditormodules.setAnswerBtn} ${isActiveAnswer ? QuestionEditormodules.activeAnswer : ""}`
|
|
},
|
|
isActiveAnswer ? "\u6B63\u786E\u7B54\u6848" : "\u8BBE\u4E3A\u7B54\u6848"
|
|
)
|
|
));
|
|
};
|
|
const CombinationJudgmentQuestionEditor_JudgmentQuestionEditor = ({
|
|
questionTitlePlaceholder,
|
|
choiceKey = "choices",
|
|
form,
|
|
titleKey = "name",
|
|
analysisKey = "analysis"
|
|
}) => {
|
|
const [editAnalysis, setEditAnalysis] = (0,_react_17_0_2_react.useState)(false);
|
|
return /* @__PURE__ */ _react_17_0_2_react.createElement("div", { className: QuestionEditormodules.wrap }, /* @__PURE__ */ _react_17_0_2_react.createElement("div", { className: QuestionEditormodules.questionTitleEditorWrap }, /* @__PURE__ */ _react_17_0_2_react.createElement(es_form["default"].Item, { label: "\u9898\u5E72", name: titleKey, labelCol: { span: 24 }, rules: [{ required: true }] }, /* @__PURE__ */ _react_17_0_2_react.createElement(
|
|
MdEditorInForm,
|
|
{
|
|
scrollId: "name",
|
|
watch: true,
|
|
height: 140,
|
|
placeholder: questionTitlePlaceholder
|
|
}
|
|
))), /* @__PURE__ */ _react_17_0_2_react.createElement(es_form["default"].Item, { label: "\u7B54\u6848\u9009\u9879", required: true, labelCol: { span: 24 } }, /* @__PURE__ */ _react_17_0_2_react.createElement(
|
|
es_form["default"].List,
|
|
{
|
|
name: choiceKey,
|
|
rules: [{
|
|
validator(rule, values) {
|
|
const hasAnswer = values.some((option) => (option == null ? void 0 : option.is_answer) === 1);
|
|
if (hasAnswer) {
|
|
return Promise.resolve();
|
|
}
|
|
return Promise.reject(new Error("\u8BF7\u8BBE\u7F6E\u6B63\u786E\u7B54\u6848"));
|
|
}
|
|
}]
|
|
},
|
|
(fields) => /* @__PURE__ */ _react_17_0_2_react.createElement("div", { id: "choices" }, fields.map((_a) => {
|
|
var _b = _a, { key, name } = _b, restField = CombinationJudgmentQuestionEditor_objRest(_b, ["key", "name"]);
|
|
return /* @__PURE__ */ _react_17_0_2_react.createElement(es_form["default"].Item, CombinationJudgmentQuestionEditor_spreadProps(CombinationJudgmentQuestionEditor_spreadValues({}, restField), { key, name, noStyle: true }), /* @__PURE__ */ _react_17_0_2_react.createElement(JudgmentQuestionItem, { form, choiceKey }));
|
|
}))
|
|
)), /* @__PURE__ */ _react_17_0_2_react.createElement("div", { onClick: () => setEditAnalysis(true) }, /* @__PURE__ */ _react_17_0_2_react.createElement(es_form["default"].Item, { name: analysisKey, label: "\u9898\u76EE\u89E3\u6790", labelCol: { span: 24 } }, /* @__PURE__ */ _react_17_0_2_react.createElement(RegularInput, { placeholder: "\u8BF7\u7F16\u8F91\u9898\u76EE\u89E3\u6790\uFF08\u975E\u5FC5\u586B\uFF09", isEdit: editAnalysis }))));
|
|
};
|
|
|
|
|
|
// 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_defProp = Object.defineProperty;
|
|
var CombinationSubjectiveQuestionEditor_defProps = Object.defineProperties;
|
|
var CombinationSubjectiveQuestionEditor_getOwnPropDescs = Object.getOwnPropertyDescriptors;
|
|
var CombinationSubjectiveQuestionEditor_getOwnPropSymbols = Object.getOwnPropertySymbols;
|
|
var CombinationSubjectiveQuestionEditor_hasOwnProp = Object.prototype.hasOwnProperty;
|
|
var CombinationSubjectiveQuestionEditor_propIsEnum = Object.prototype.propertyIsEnumerable;
|
|
var CombinationSubjectiveQuestionEditor_defNormalProp = (obj, key, value) => key in obj ? CombinationSubjectiveQuestionEditor_defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
|
|
var CombinationSubjectiveQuestionEditor_spreadValues = (a, b) => {
|
|
for (var prop in b || (b = {}))
|
|
if (CombinationSubjectiveQuestionEditor_hasOwnProp.call(b, prop))
|
|
CombinationSubjectiveQuestionEditor_defNormalProp(a, prop, b[prop]);
|
|
if (CombinationSubjectiveQuestionEditor_getOwnPropSymbols)
|
|
for (var prop of CombinationSubjectiveQuestionEditor_getOwnPropSymbols(b)) {
|
|
if (CombinationSubjectiveQuestionEditor_propIsEnum.call(b, prop))
|
|
CombinationSubjectiveQuestionEditor_defNormalProp(a, prop, b[prop]);
|
|
}
|
|
return a;
|
|
};
|
|
var CombinationSubjectiveQuestionEditor_spreadProps = (a, b) => CombinationSubjectiveQuestionEditor_defProps(a, CombinationSubjectiveQuestionEditor_getOwnPropDescs(b));
|
|
var CombinationSubjectiveQuestionEditor_objRest = (source, exclude) => {
|
|
var target = {};
|
|
for (var prop in source)
|
|
if (CombinationSubjectiveQuestionEditor_hasOwnProp.call(source, prop) && exclude.indexOf(prop) < 0)
|
|
target[prop] = source[prop];
|
|
if (source != null && CombinationSubjectiveQuestionEditor_getOwnPropSymbols)
|
|
for (var prop of CombinationSubjectiveQuestionEditor_getOwnPropSymbols(source)) {
|
|
if (exclude.indexOf(prop) < 0 && CombinationSubjectiveQuestionEditor_propIsEnum.call(source, prop))
|
|
target[prop] = source[prop];
|
|
}
|
|
return target;
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
|
|
const AnswerTextFormItem = (_a) => {
|
|
var _b = _a, { value, onChange } = _b, props = CombinationSubjectiveQuestionEditor_objRest(_b, ["value", "onChange"]);
|
|
const handleChange = (v) => {
|
|
onChange([v]);
|
|
};
|
|
return /* @__PURE__ */ _react_17_0_2_react.createElement(
|
|
markdown_editor/* default */.Z,
|
|
CombinationSubjectiveQuestionEditor_spreadProps(CombinationSubjectiveQuestionEditor_spreadValues({}, props), {
|
|
defaultValue: value == null ? void 0 : value[0],
|
|
onChange: handleChange
|
|
})
|
|
);
|
|
};
|
|
const test = (str) => {
|
|
if (!str) {
|
|
return false;
|
|
}
|
|
if (/^s*$/.test(str) || str.trim() === "") {
|
|
message/* default */.ZP.warning("\u5173\u952E\u8BCD\u4E0D\u80FD\u5168\u4E3A\u7A7A\u683C");
|
|
return;
|
|
}
|
|
let containSpecial = new RegExp("[ `~!@#$^&*()={}':;,\\[\\].<>/?~\uFF01@#\uFFE5\u2026\u2026&*\uFF08\uFF09\u2014\u3010\u3011\u2018\uFF1B\uFF1A\u201D\u201C\u3002\uFF0C\u3001\uFF1F\u300C\u300D\u300E\u300F_\\+\\-\xB7%\u300A\u300B]|[\\\\/]");
|
|
if (str === "|") {
|
|
message/* default */.ZP.warning("\u5173\u952E\u8BCD\u4E0D\u80FD\u53EA\u8F93\u5165\u4E00\u4E2A\u201C|\u201D\u5B57\u7B26\uFF01");
|
|
return false;
|
|
}
|
|
return true;
|
|
};
|
|
const KeywordTag = ({ value = [], onClose }) => {
|
|
return /* @__PURE__ */ _react_17_0_2_react.createElement(tag["default"], { closable: true, onClose, className: QuestionEditormodules.keywordTag }, /* @__PURE__ */ _react_17_0_2_react.createElement("pre", { style: { margin: "0px", whiteSpace: "pre-wrap" } }, value.join(" \u6216 ")));
|
|
};
|
|
const SubjectiveQuestionEditor = ({
|
|
questionTitlePlaceholder,
|
|
form,
|
|
showKeywords,
|
|
isMustKeyWords = showKeywords,
|
|
titleKey = "name",
|
|
analysisKey = "analysis",
|
|
answerTexts = "answer_texts",
|
|
keywords = "keywords",
|
|
useKeywords = "use_keywords",
|
|
indexs
|
|
}) => {
|
|
var _a, _b, _c, _d;
|
|
const [editAnalysis, setEditAnalysis] = (0,_react_17_0_2_react.useState)(false);
|
|
const [keywordsInput, setKeywordsInput] = (0,_react_17_0_2_react.useState)("");
|
|
const useKeywordsValue = (_b = (_a = form.getFieldValue("sub_item_banks")) == null ? void 0 : _a[useKeywords == null ? void 0 : useKeywords[0]]) == null ? void 0 : _b[useKeywords == null ? void 0 : useKeywords[1]];
|
|
const questionScore = (_d = (_c = form.getFieldValue("sub_item_banks")) == null ? void 0 : _c[useKeywords == null ? void 0 : useKeywords[0]]) == null ? void 0 : _d.question_score;
|
|
return /* @__PURE__ */ _react_17_0_2_react.createElement("div", { className: QuestionEditormodules.wrap }, /* @__PURE__ */ _react_17_0_2_react.createElement("div", { className: QuestionEditormodules.questionTitleEditorWrap }, /* @__PURE__ */ _react_17_0_2_react.createElement(es_form["default"].Item, { label: "\u9898\u5E72", name: titleKey, labelCol: { span: 24 }, rules: [{ required: true }] }, /* @__PURE__ */ _react_17_0_2_react.createElement(
|
|
MdEditorInForm,
|
|
{
|
|
scrollId: "name",
|
|
watch: true,
|
|
height: 140,
|
|
placeholder: questionTitlePlaceholder
|
|
}
|
|
))), /* @__PURE__ */ _react_17_0_2_react.createElement(es_form["default"].Item, { label: "\u53C2\u8003\u7B54\u6848", name: answerTexts, labelCol: { span: 24 } }, /* @__PURE__ */ _react_17_0_2_react.createElement(
|
|
AnswerTextFormItem,
|
|
{
|
|
watch: true,
|
|
height: 140,
|
|
placeholder: "\u8BF7\u7F16\u8F91\u53C2\u8003\u7B54\u6848\uFF08\u975E\u5FC5\u586B\uFF09"
|
|
}
|
|
)), showKeywords && !isMustKeyWords && /* @__PURE__ */ _react_17_0_2_react.createElement(es_form["default"].Item, { hidden: true, name: useKeywords, valuePropName: "checked" }, /* @__PURE__ */ _react_17_0_2_react.createElement(es_switch/* default */.Z, { defaultChecked: true })), showKeywords && isMustKeyWords && /* @__PURE__ */ _react_17_0_2_react.createElement(row/* default */.Z, { align: "middle", className: "mb30" }, /* @__PURE__ */ _react_17_0_2_react.createElement(es_form["default"].Item, { name: useKeywords, valuePropName: "checked" }, /* @__PURE__ */ _react_17_0_2_react.createElement(es_switch/* default */.Z, null)), /* @__PURE__ */ _react_17_0_2_react.createElement(col/* default */.Z, { className: "ml10" }, "\u5F00\u542F\u5173\u952E\u8BCD\u81EA\u52A8\u5224\u5206"), /* @__PURE__ */ _react_17_0_2_react.createElement(col/* default */.Z, null, /* @__PURE__ */ _react_17_0_2_react.createElement(
|
|
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"
|
|
},
|
|
/* @__PURE__ */ _react_17_0_2_react.createElement(QuestionCircleOutlined/* default */.Z, { style: { color: "#3061D0", marginLeft: 6, cursor: "pointer" } })
|
|
))), (useKeywordsValue || !isMustKeyWords) && /* @__PURE__ */ _react_17_0_2_react.createElement(es_form["default"].List, { name: keywords, rules: [{
|
|
validator(rule, values) {
|
|
if (!isMustKeyWords) {
|
|
return Promise.resolve();
|
|
}
|
|
if (!(values == null ? void 0 : values.length)) {
|
|
return Promise.reject(new Error("\u8BF7\u8F93\u5165\u5173\u952E\u8BCD"));
|
|
}
|
|
const keywordsScoreSum = values == null ? void 0 : values.reduce((pre, cur) => pre + cur.score, 0);
|
|
if (keywordsScoreSum > parseFloat(questionScore)) {
|
|
return Promise.reject(new Error("\u6240\u6709\u5173\u952E\u8BCD\u7684\u5206\u503C\u4E4B\u548C\u5FC5\u987B\u5C0F\u4E8E\u7B49\u4E8E\u8BE5\u5C0F\u9898\u7684\u5206\u503C"));
|
|
}
|
|
return Promise.resolve();
|
|
}
|
|
}] }, (fields, { add, remove }) => /* @__PURE__ */ _react_17_0_2_react.createElement(_react_17_0_2_react.Fragment, null, /* @__PURE__ */ _react_17_0_2_react.createElement("div", { className: `${QuestionEditormodules.title} mb10` }, !isMustKeyWords ? /* @__PURE__ */ _react_17_0_2_react.createElement("span", { style: { color: "#9096A3" } }, "\u5224\u5206\u5173\u952E\u8BCD") : "\u5173\u952E\u8BCD"), /* @__PURE__ */ _react_17_0_2_react.createElement(row/* default */.Z, { align: "middle", className: "font14 mb30" }, /* @__PURE__ */ _react_17_0_2_react.createElement(col/* default */.Z, { flex: 1 }, /* @__PURE__ */ _react_17_0_2_react.createElement(
|
|
input["default"],
|
|
{
|
|
value: keywordsInput,
|
|
onChange: (e) => {
|
|
setKeywordsInput(e.target.value);
|
|
},
|
|
maxLength: 50,
|
|
allowClear: true,
|
|
onPressEnter: (e) => {
|
|
var _a2, _b2, _c2, _d2;
|
|
const v = `${(_a2 = e.target) == null ? void 0 : _a2.value}`;
|
|
const keywordArr = (_c2 = (_b2 = v == null ? void 0 : v.split("|")) == null ? void 0 : _b2.filter((k) => !!k)) == null ? void 0 : _c2.map((item) => item.trim());
|
|
const currentKeywordsValue = form.getFieldValue(["sub_item_banks", ...keywords]);
|
|
const existKeywords = ((_d2 = currentKeywordsValue == null ? void 0 : currentKeywordsValue.map((item) => item == null ? void 0 : item.keyword)) == null ? void 0 : _d2.flat()) || [];
|
|
for (const word of keywordArr) {
|
|
if (existKeywords.includes(word)) {
|
|
message/* default */.ZP.error("\u4E3A\u907F\u514D\u5224\u5206\u9519\u8BEF\uFF0C\u8BF7\u52FF\u8BBE\u7F6E\u76F8\u540C\u7684\u5173\u952E\u8BCD");
|
|
return;
|
|
}
|
|
}
|
|
if (test(v)) {
|
|
add({ keyword: keywordArr, score: 1 });
|
|
setKeywordsInput("");
|
|
}
|
|
},
|
|
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__ */ _react_17_0_2_react.createElement(col/* default */.Z, { flex: "148px", style: { textAlign: "right", color: "#9096A3" } }, "\u201C\u56DE\u8F66\u952E\u201D\u4FDD\u5B58\u5173\u952E\u8BCD")), fields.map((_a2) => {
|
|
var _b2 = _a2, { key, name } = _b2, restField = CombinationSubjectiveQuestionEditor_objRest(_b2, ["key", "name"]);
|
|
return /* @__PURE__ */ _react_17_0_2_react.createElement(row/* default */.Z, { key, className: "mb20", style: { marginRight: 148 } }, /* @__PURE__ */ _react_17_0_2_react.createElement(col/* default */.Z, { flex: 1 }, /* @__PURE__ */ _react_17_0_2_react.createElement(row/* default */.Z, { align: "middle", justify: "space-between" }, /* @__PURE__ */ _react_17_0_2_react.createElement(es_form["default"].Item, CombinationSubjectiveQuestionEditor_spreadProps(CombinationSubjectiveQuestionEditor_spreadValues({}, restField), { name: [name, "keyword"] }), /* @__PURE__ */ _react_17_0_2_react.createElement(KeywordTag, { onClose: () => remove(name) })), isMustKeyWords && /* @__PURE__ */ _react_17_0_2_react.createElement(es_form["default"].Item, CombinationSubjectiveQuestionEditor_spreadProps(CombinationSubjectiveQuestionEditor_spreadValues({}, restField), { name: [name, "score"], label: "\u5206\u503C", rules: [{ required: true }], className: QuestionEditormodules.blankInputNumberWrapper }), /* @__PURE__ */ _react_17_0_2_react.createElement(
|
|
input_number/* default */.Z,
|
|
{
|
|
className: QuestionEditormodules.blankInput,
|
|
min: 0.1,
|
|
max: 100,
|
|
precision: 1,
|
|
style: { width: "100%" },
|
|
placeholder: "\u8BF7\u8F93\u5165\u5173\u952E\u8BCD\u5206\u6570"
|
|
}
|
|
)))));
|
|
}))), /* @__PURE__ */ _react_17_0_2_react.createElement("div", { onClick: () => setEditAnalysis(true) }, /* @__PURE__ */ _react_17_0_2_react.createElement(es_form["default"].Item, { name: analysisKey, label: "\u9898\u76EE\u89E3\u6790", labelCol: { span: 24 } }, /* @__PURE__ */ _react_17_0_2_react.createElement(RegularInput, { placeholder: "\u8BF7\u7F16\u8F91\u9898\u76EE\u89E3\u6790\uFF08\u975E\u5FC5\u586B\uFF09", isEdit: editAnalysis }))));
|
|
};
|
|
|
|
|
|
;// CONCATENATED MODULE: ./src/pages/Paperlibrary/EditPotin/components/Questions/QuestionEditor/CombinationQuestionEditor.tsx
|
|
/* provided dependency */ var CombinationQuestionEditor_React = __webpack_require__(/*! react */ 59301);
|
|
var CombinationQuestionEditor_defProp = Object.defineProperty;
|
|
var CombinationQuestionEditor_defProps = Object.defineProperties;
|
|
var CombinationQuestionEditor_getOwnPropDescs = Object.getOwnPropertyDescriptors;
|
|
var CombinationQuestionEditor_getOwnPropSymbols = Object.getOwnPropertySymbols;
|
|
var CombinationQuestionEditor_hasOwnProp = Object.prototype.hasOwnProperty;
|
|
var CombinationQuestionEditor_propIsEnum = Object.prototype.propertyIsEnumerable;
|
|
var CombinationQuestionEditor_defNormalProp = (obj, key, value) => key in obj ? CombinationQuestionEditor_defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
|
|
var CombinationQuestionEditor_spreadValues = (a, b) => {
|
|
for (var prop in b || (b = {}))
|
|
if (CombinationQuestionEditor_hasOwnProp.call(b, prop))
|
|
CombinationQuestionEditor_defNormalProp(a, prop, b[prop]);
|
|
if (CombinationQuestionEditor_getOwnPropSymbols)
|
|
for (var prop of CombinationQuestionEditor_getOwnPropSymbols(b)) {
|
|
if (CombinationQuestionEditor_propIsEnum.call(b, prop))
|
|
CombinationQuestionEditor_defNormalProp(a, prop, b[prop]);
|
|
}
|
|
return a;
|
|
};
|
|
var CombinationQuestionEditor_spreadProps = (a, b) => CombinationQuestionEditor_defProps(a, CombinationQuestionEditor_getOwnPropDescs(b));
|
|
var CombinationQuestionEditor_objRest = (source, exclude) => {
|
|
var target = {};
|
|
for (var prop in source)
|
|
if (CombinationQuestionEditor_hasOwnProp.call(source, prop) && exclude.indexOf(prop) < 0)
|
|
target[prop] = source[prop];
|
|
if (source != null && CombinationQuestionEditor_getOwnPropSymbols)
|
|
for (var prop of CombinationQuestionEditor_getOwnPropSymbols(source)) {
|
|
if (exclude.indexOf(prop) < 0 && CombinationQuestionEditor_propIsEnum.call(source, prop))
|
|
target[prop] = source[prop];
|
|
}
|
|
return target;
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
const { Panel } = collapse["default"];
|
|
const CombinationQuestionEditor = ({
|
|
questionTitlePlaceholder,
|
|
choiceKey,
|
|
form,
|
|
withScore
|
|
}) => {
|
|
const questionType = [
|
|
{ type: 0, name: "\u5355\u9009\u9898" },
|
|
{ type: 1, name: "\u591A\u9009\u9898" },
|
|
{ type: 2, name: "\u5224\u65AD\u9898" },
|
|
{ type: 3, name: "\u586B\u7A7A\u9898" },
|
|
{ type: 4, name: "\u7B80\u7B54\u9898" },
|
|
{ type: 5, name: "\u5B9E\u8BAD\u9898" },
|
|
{ type: 6, name: "\u7F16\u7A0B\u9898" },
|
|
{ type: 7, name: "\u7EC4\u5408\u9898" },
|
|
{ type: 8, name: "\u7A0B\u5E8F\u586B\u7A7A\u9898" }
|
|
];
|
|
const [shuaxin, setshuaxin] = (0,_react_17_0_2_react.useState)();
|
|
const [activeKey, setActiveKey] = (0,_react_17_0_2_react.useState)([]);
|
|
const handleCollapseChange = (keys) => {
|
|
setActiveKey(keys);
|
|
};
|
|
const Text = ({ value }) => {
|
|
return /* @__PURE__ */ CombinationQuestionEditor_React.createElement("div", { style: { width: 150, paddingLeft: 11 } }, value);
|
|
};
|
|
return /* @__PURE__ */ CombinationQuestionEditor_React.createElement("div", { className: QuestionEditormodules.wrap }, /* @__PURE__ */ CombinationQuestionEditor_React.createElement("div", { className: QuestionEditormodules.questionTitleEditorWrap }, /* @__PURE__ */ CombinationQuestionEditor_React.createElement(es_form["default"].Item, { label: "\u9898\u5E72", name: "name", labelCol: { span: 24 }, rules: [{ required: true }] }, /* @__PURE__ */ CombinationQuestionEditor_React.createElement(
|
|
MdEditorInForm,
|
|
{
|
|
scrollId: "name",
|
|
watch: true,
|
|
height: 140,
|
|
placeholder: questionTitlePlaceholder
|
|
}
|
|
))), /* @__PURE__ */ CombinationQuestionEditor_React.createElement(es_form["default"].Item, { label: "\u5C0F\u9898", required: true, labelCol: { span: 24 } }), /* @__PURE__ */ CombinationQuestionEditor_React.createElement(es_form["default"].List, { name: "sub_item_banks", rules: [{
|
|
validator(rule, values) {
|
|
if (!values) {
|
|
return Promise.reject(new Error("\u8BF7\u6DFB\u52A0\u5C0F\u9898"));
|
|
}
|
|
return Promise.resolve();
|
|
}
|
|
}] }, (fields, { add, remove, move }) => {
|
|
const item_list = form.getFieldValue("sub_item_banks");
|
|
return /* @__PURE__ */ CombinationQuestionEditor_React.createElement(CombinationQuestionEditor_React.Fragment, null, /* @__PURE__ */ CombinationQuestionEditor_React.createElement(
|
|
collapse["default"],
|
|
{
|
|
className: fields.length > 0 ? QuestionEditormodules.collapseWrapper : "",
|
|
bordered: false,
|
|
activeKey,
|
|
onChange: handleCollapseChange,
|
|
expandIcon: ({ isActive }) => /* @__PURE__ */ CombinationQuestionEditor_React.createElement("i", { className: `iconfont icon-weizhankai ${isActive ? QuestionEditormodules.open : QuestionEditormodules.close}`, style: { fontSize: 14, transition: "all .2s" } })
|
|
},
|
|
fields.map((_a, index) => {
|
|
var _b = _a, { key, name } = _b, restField = CombinationQuestionEditor_objRest(_b, ["key", "name"]);
|
|
var _a2, _b2, _c, _d, _e, _f, _g, _h, _i, _j, _k, _l, _m, _n;
|
|
return /* @__PURE__ */ CombinationQuestionEditor_React.createElement(
|
|
Panel,
|
|
{
|
|
className: QuestionEditormodules.panel,
|
|
forceRender: true,
|
|
header: /* @__PURE__ */ CombinationQuestionEditor_React.createElement("div", { className: QuestionEditormodules.panelHeader }, "\u7B2C", index + 1, "\u5C0F\u9898", /* @__PURE__ */ CombinationQuestionEditor_React.createElement("span", null, "\uFF08", ((_a2 = item_list == null ? void 0 : item_list[name]) == null ? void 0 : _a2.question_type) == 0 ? "\u5355\u9009\u9898" : ((_b2 = item_list == null ? void 0 : item_list[name]) == null ? void 0 : _b2.question_type) == 1 ? "\u591A\u9009\u9898" : ((_c = item_list == null ? void 0 : item_list[name]) == null ? void 0 : _c.question_type) == 3 ? "\u586B\u7A7A\u9898" : ((_d = item_list == null ? void 0 : item_list[name]) == null ? void 0 : _d.question_type) == 2 ? "\u5224\u65AD\u9898" : "\u7B80\u7B54\u9898", "\uFF09")),
|
|
key: name,
|
|
extra: /* @__PURE__ */ CombinationQuestionEditor_React.createElement(row/* default */.Z, { align: "middle", onClick: (e) => e.stopPropagation() }, ((_e = item_list == null ? void 0 : item_list[name]) == null ? void 0 : _e.question_type) == 3 && /* @__PURE__ */ CombinationQuestionEditor_React.createElement(CombinationQuestionEditor_React.Fragment, null, /* @__PURE__ */ CombinationQuestionEditor_React.createElement(
|
|
es_radio/* default.Group */.ZP.Group,
|
|
{
|
|
defaultValue: (_f = item_list == null ? void 0 : item_list[name]) == null ? void 0 : _f.use_blank_score,
|
|
className: EditPotinmodules.scoreByBlankRadio,
|
|
style: { marginRight: 20 },
|
|
optionType: "button",
|
|
options: [
|
|
{ label: "\u6309\u7A7A\u7ED9\u5206", value: true },
|
|
{ label: "\u6309\u9898\u7ED9\u5206", value: false }
|
|
],
|
|
onChange: (e) => {
|
|
var _a3, _b3, _c2, _d2, _e2;
|
|
form == null ? void 0 : form.setFieldValue(["sub_item_banks", name, "use_blank_score"], (_a3 = e == null ? void 0 : e.target) == null ? void 0 : _a3.value);
|
|
if ((_b3 = e == null ? void 0 : e.target) == null ? void 0 : _b3.value) {
|
|
let count = 0;
|
|
for (let i in (_c2 = form == null ? void 0 : form.getFieldValue(["sub_item_banks", name])) == null ? void 0 : _c2.standard_answers) {
|
|
count += Number((_e2 = (_d2 = form == null ? void 0 : form.getFieldValue(["sub_item_banks", name])) == null ? void 0 : _d2.standard_answers[i]) == null ? void 0 : _e2.score);
|
|
}
|
|
form == null ? void 0 : form.setFieldValue(["sub_item_banks", name, "question_score"], count || "");
|
|
}
|
|
setshuaxin(/* @__PURE__ */ new Date());
|
|
}
|
|
}
|
|
), /* @__PURE__ */ CombinationQuestionEditor_React.createElement(tooltip/* default */.Z, { overlayInnerStyle: { width: 460 }, title: /* @__PURE__ */ CombinationQuestionEditor_React.createElement("div", null, "\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__ */ CombinationQuestionEditor_React.createElement("br", null), "\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") }, /* @__PURE__ */ CombinationQuestionEditor_React.createElement("i", { className: "icon-tishixiaowenhao font18 mr25 c-3061d0" }))), withScore && /* @__PURE__ */ CombinationQuestionEditor_React.createElement(es_form["default"].Item, CombinationQuestionEditor_spreadProps(CombinationQuestionEditor_spreadValues({}, restField), { rules: [{ required: true, message: "\u8BF7\u8F93\u5165\u5C0F\u9898\u5206\u503C" }], label: "\u5206\u503C", name: [name, "question_score"], className: QuestionEditormodules.blankInputNumberWrapper }), ((_g = item_list == null ? void 0 : item_list[name]) == null ? void 0 : _g.question_type) == 3 && ((_h = item_list == null ? void 0 : item_list[name]) == null ? void 0 : _h.use_blank_score) ? /* @__PURE__ */ CombinationQuestionEditor_React.createElement(Text, null) : /* @__PURE__ */ CombinationQuestionEditor_React.createElement(input_number/* default */.Z, { className: QuestionEditormodules.blankInput, placeholder: "\u8BF7\u8F93\u5165\u5206\u6570", min: 0.1, precision: 1, max: 100, style: { width: 150 } })), /* @__PURE__ */ CombinationQuestionEditor_React.createElement(row/* default */.Z, { align: "middle", className: "pl40", style: { width: 82 } }, index !== 0 && /* @__PURE__ */ CombinationQuestionEditor_React.createElement("div", { onClick: () => {
|
|
var _a3;
|
|
move(index, index - 1);
|
|
const formSetting = (_a3 = form.getFieldValue("sub_item_banks")) == null ? void 0 : _a3.map((e, i) => {
|
|
fields.map((fe, fi) => {
|
|
if (i === fi)
|
|
e.q_position = Number(fe.name) + 1;
|
|
});
|
|
return e;
|
|
});
|
|
form.setFieldValue("sub_item_banks", formSetting);
|
|
} }, /* @__PURE__ */ CombinationQuestionEditor_React.createElement(tooltip/* default */.Z, { title: "\u4E0A\u79FB" }, /* @__PURE__ */ CombinationQuestionEditor_React.createElement("i", { className: "iconfont icon-shangyi3 c-grey-999 primary-hover" }))), index < fields.length - 1 && /* @__PURE__ */ CombinationQuestionEditor_React.createElement(
|
|
"div",
|
|
{
|
|
onClick: () => {
|
|
var _a3;
|
|
move(index, index + 1);
|
|
const formSetting = (_a3 = form.getFieldValue("sub_item_banks")) == null ? void 0 : _a3.map((e, i) => {
|
|
fields.map((fe, fi) => {
|
|
if (i === fi)
|
|
e.q_position = Number(fe.name) + 1;
|
|
});
|
|
return e;
|
|
});
|
|
form.setFieldValue("sub_item_banks", formSetting);
|
|
},
|
|
className: index === 0 ? "" : "ml10"
|
|
},
|
|
/* @__PURE__ */ CombinationQuestionEditor_React.createElement(tooltip/* default */.Z, { title: "\u4E0B\u79FB" }, /* @__PURE__ */ CombinationQuestionEditor_React.createElement("i", { className: "iconfont icon-xiayi3 c-grey-999 primary-hover" }))
|
|
)), /* @__PURE__ */ CombinationQuestionEditor_React.createElement(tooltip/* default */.Z, { title: "\u5220\u9664" }, /* @__PURE__ */ CombinationQuestionEditor_React.createElement(
|
|
MinusCircleOutlined/* default */.Z,
|
|
{
|
|
className: `${QuestionEditormodules.deleteIcon} ml40`,
|
|
onClick: () => remove(name)
|
|
}
|
|
)))
|
|
},
|
|
/* @__PURE__ */ CombinationQuestionEditor_React.createElement(
|
|
es_form["default"].Item,
|
|
CombinationQuestionEditor_spreadProps(CombinationQuestionEditor_spreadValues({}, restField), {
|
|
name
|
|
}),
|
|
(((_i = item_list == null ? void 0 : item_list[name]) == null ? void 0 : _i.question_type) == 0 || ((_j = item_list == null ? void 0 : item_list[name]) == null ? void 0 : _j.question_type) == 1) && /* @__PURE__ */ CombinationQuestionEditor_React.createElement(
|
|
ChoiceQuestionEditor_ChoiceQuestionEditor,
|
|
{
|
|
questionTitlePlaceholder: "\u8BF7\u7F16\u8F91\u9009\u62E9\u9898\u9898\u5E72\u5185\u5BB9",
|
|
allowChangeMode: ((_k = item_list == null ? void 0 : item_list[name]) == null ? void 0 : _k.question_type) == 1 ? true : false,
|
|
form,
|
|
choiceKey: [name, "choices"],
|
|
titleKey: [name, "name"],
|
|
analysisKey: [name, "analysis"],
|
|
choiceOptionsPath: ["sub_item_banks", name, "choices"],
|
|
choiceTextKey: "choice_text",
|
|
answerKey: "is_answer"
|
|
}
|
|
),
|
|
((_l = item_list == null ? void 0 : item_list[name]) == null ? void 0 : _l.question_type) == 3 && /* @__PURE__ */ CombinationQuestionEditor_React.createElement(
|
|
CombinationCompletionQuestionEditor_CompletionQuestionEditor,
|
|
{
|
|
form,
|
|
questionTitlePlaceholder: "\u8BF7\u7F16\u8F91\u9898\u5E72\u5E76\u8BBE\u7F6E\u586B\u7A7A\u9879",
|
|
name,
|
|
scoreByBlank: [name, "use_blank_score"],
|
|
titleKey: [name, "name"],
|
|
analysisKey: [name, "analysis"],
|
|
isOrdered: [name, "is_ordered"],
|
|
answerKey: [name, "standard_answers"],
|
|
key: shuaxin
|
|
}
|
|
),
|
|
((_m = item_list == null ? void 0 : item_list[name]) == null ? void 0 : _m.question_type) == 2 && /* @__PURE__ */ CombinationQuestionEditor_React.createElement(
|
|
CombinationJudgmentQuestionEditor_JudgmentQuestionEditor,
|
|
{
|
|
form,
|
|
questionTitlePlaceholder: "\u8BF7\u7F16\u8F91\u5224\u65AD\u9898\u9898\u5E72\u5185\u5BB9",
|
|
titleKey: [name, "name"],
|
|
analysisKey: [name, "analysis"],
|
|
choiceKey: [name, "choices"]
|
|
}
|
|
),
|
|
((_n = item_list == null ? void 0 : item_list[name]) == null ? void 0 : _n.question_type) == 4 && /* @__PURE__ */ CombinationQuestionEditor_React.createElement(
|
|
SubjectiveQuestionEditor,
|
|
{
|
|
showKeywords: true,
|
|
isMustKeyWords: true,
|
|
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",
|
|
key: shuaxin
|
|
}
|
|
)
|
|
)
|
|
);
|
|
})
|
|
), fields.length < 20 && /* @__PURE__ */ CombinationQuestionEditor_React.createElement(
|
|
dropdown/* default */.Z,
|
|
{
|
|
menu: {
|
|
items: [
|
|
{
|
|
label: /* @__PURE__ */ CombinationQuestionEditor_React.createElement("div", { onClick: () => {
|
|
add({
|
|
name: "",
|
|
choices: Array.from({ length: 4 }, () => ({ choice_text: "", is_answer: 0 })),
|
|
analysis: "",
|
|
question_type: 0,
|
|
item_type: "SINGLE"
|
|
});
|
|
setActiveKey([fields == null ? void 0 : fields.length, ...activeKey]);
|
|
} }, "\u5355\u9009\u9898"),
|
|
key: "1",
|
|
show: true
|
|
},
|
|
{
|
|
label: /* @__PURE__ */ CombinationQuestionEditor_React.createElement("div", { onClick: () => {
|
|
add({
|
|
name: "",
|
|
choices: Array.from({ length: 4 }, () => ({ choice_text: "", is_answer: 0 })),
|
|
analysis: "",
|
|
question_type: 1,
|
|
item_type: "MULTIPLE"
|
|
});
|
|
setActiveKey([fields == null ? void 0 : fields.length, ...activeKey]);
|
|
} }, "\u591A\u9009\u9898"),
|
|
key: "2",
|
|
show: true
|
|
},
|
|
{
|
|
label: /* @__PURE__ */ CombinationQuestionEditor_React.createElement("div", { onClick: () => {
|
|
add({
|
|
name: "",
|
|
choices: [{ choice_text: "\u6B63\u786E", is_answer: 0 }, { choice_text: "\u9519\u8BEF", is_answer: 0 }],
|
|
analysis: "",
|
|
question_type: 2,
|
|
item_type: "JUDGMENT"
|
|
});
|
|
setActiveKey([fields == null ? void 0 : fields.length, ...activeKey]);
|
|
} }, "\u5224\u65AD\u9898"),
|
|
key: "3",
|
|
show: true
|
|
},
|
|
{
|
|
label: /* @__PURE__ */ CombinationQuestionEditor_React.createElement("div", { onClick: () => {
|
|
add({
|
|
name: "",
|
|
analysis: "",
|
|
is_ordered: true,
|
|
standard_answers: [],
|
|
question_type: 3,
|
|
item_type: "COMPLETION",
|
|
use_blank_score: true,
|
|
downcase: true,
|
|
no_space: true
|
|
});
|
|
setActiveKey([fields == null ? void 0 : fields.length, ...activeKey]);
|
|
} }, "\u586B\u7A7A\u9898"),
|
|
key: "4",
|
|
show: true
|
|
},
|
|
{
|
|
label: /* @__PURE__ */ CombinationQuestionEditor_React.createElement("div", { onClick: () => {
|
|
add({
|
|
name: "",
|
|
answer_texts: [],
|
|
keywords: [],
|
|
use_keywords: false,
|
|
analysis: "",
|
|
question_type: 4,
|
|
item_type: "SUBJECTIVE"
|
|
});
|
|
setActiveKey([fields == null ? void 0 : fields.length, ...activeKey]);
|
|
} }, "\u7B80\u7B54\u9898"),
|
|
key: "5",
|
|
show: true
|
|
}
|
|
].filter((item) => item.show).map((item) => ({ label: item.label, key: item.key }))
|
|
}
|
|
},
|
|
/* @__PURE__ */ CombinationQuestionEditor_React.createElement("div", { className: `${QuestionEditormodules.addBtn}` }, "\u6DFB\u52A0\u5C0F\u9898")
|
|
));
|
|
}));
|
|
};
|
|
|
|
|
|
;// CONCATENATED MODULE: ./src/pages/Paperlibrary/EditPotin/components/Questions/CombinationQuestionEditor.tsx
|
|
/* provided dependency */ var Questions_CombinationQuestionEditor_React = __webpack_require__(/*! react */ 59301);
|
|
var Questions_CombinationQuestionEditor_defProp = Object.defineProperty;
|
|
var Questions_CombinationQuestionEditor_defProps = Object.defineProperties;
|
|
var Questions_CombinationQuestionEditor_getOwnPropDescs = Object.getOwnPropertyDescriptors;
|
|
var Questions_CombinationQuestionEditor_getOwnPropSymbols = Object.getOwnPropertySymbols;
|
|
var Questions_CombinationQuestionEditor_hasOwnProp = Object.prototype.hasOwnProperty;
|
|
var Questions_CombinationQuestionEditor_propIsEnum = Object.prototype.propertyIsEnumerable;
|
|
var Questions_CombinationQuestionEditor_defNormalProp = (obj, key, value) => key in obj ? Questions_CombinationQuestionEditor_defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
|
|
var Questions_CombinationQuestionEditor_spreadValues = (a, b) => {
|
|
for (var prop in b || (b = {}))
|
|
if (Questions_CombinationQuestionEditor_hasOwnProp.call(b, prop))
|
|
Questions_CombinationQuestionEditor_defNormalProp(a, prop, b[prop]);
|
|
if (Questions_CombinationQuestionEditor_getOwnPropSymbols)
|
|
for (var prop of Questions_CombinationQuestionEditor_getOwnPropSymbols(b)) {
|
|
if (Questions_CombinationQuestionEditor_propIsEnum.call(b, prop))
|
|
Questions_CombinationQuestionEditor_defNormalProp(a, prop, b[prop]);
|
|
}
|
|
return a;
|
|
};
|
|
var Questions_CombinationQuestionEditor_spreadProps = (a, b) => Questions_CombinationQuestionEditor_defProps(a, Questions_CombinationQuestionEditor_getOwnPropDescs(b));
|
|
var CombinationQuestionEditor_async = (__this, __arguments, generator) => {
|
|
return new Promise((resolve, reject) => {
|
|
var fulfilled = (value) => {
|
|
try {
|
|
step(generator.next(value));
|
|
} catch (e) {
|
|
reject(e);
|
|
}
|
|
};
|
|
var rejected = (value) => {
|
|
try {
|
|
step(generator.throw(value));
|
|
} catch (e) {
|
|
reject(e);
|
|
}
|
|
};
|
|
var step = (x) => x.done ? resolve(x.value) : Promise.resolve(x.value).then(fulfilled, rejected);
|
|
step((generator = generator.apply(__this, __arguments)).next());
|
|
});
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
const CombinationQuestionEditor_DragQuestions = ({ qitem, setisedit, TagDiscipline, exerciseitem, seveeditor, deleteitem, getTagData, init }) => {
|
|
const [form] = es_form["default"].useForm();
|
|
(0,_react_17_0_2_react.useEffect)(() => {
|
|
var _a;
|
|
form.setFieldsValue(Questions_CombinationQuestionEditor_spreadProps(Questions_CombinationQuestionEditor_spreadValues({}, qitem), {
|
|
name: qitem.question_title,
|
|
sub_item_banks: (_a = qitem.sub_exercise_questions) == null ? void 0 : _a.map((item) => {
|
|
var _a2;
|
|
return Questions_CombinationQuestionEditor_spreadProps(Questions_CombinationQuestionEditor_spreadValues({}, item), {
|
|
name: item.question_title,
|
|
choices: (_a2 = item == null ? void 0 : item.question_choices) == null ? void 0 : _a2.map((val) => {
|
|
return Questions_CombinationQuestionEditor_spreadProps(Questions_CombinationQuestionEditor_spreadValues({}, val), { is_answer: (val == null ? void 0 : val.standard_boolean) ? 1 : 0 });
|
|
})
|
|
});
|
|
}),
|
|
repeat_answer: !qitem.repeat_answer
|
|
}));
|
|
}, [qitem]);
|
|
return /* @__PURE__ */ Questions_CombinationQuestionEditor_React.createElement("div", null, /* @__PURE__ */ Questions_CombinationQuestionEditor_React.createElement(
|
|
es_form["default"],
|
|
{
|
|
form,
|
|
colon: false,
|
|
onValuesChange: (values, value) => {
|
|
var _a, _b, _c;
|
|
if (values == null ? void 0 : values.sub_item_banks) {
|
|
let items = ((_a = form.getFieldValue("sub_item_banks")) == null ? void 0 : _a.length) > 0 && ((_c = (_b = form.getFieldValue("sub_item_banks")) == null ? void 0 : _b.map((item) => {
|
|
var _a2;
|
|
if (item.question_type == 3 && (item == null ? void 0 : item.use_blank_score)) {
|
|
let count = 0;
|
|
for (let i in item == null ? void 0 : item.standard_answers) {
|
|
count += Number((_a2 = item == null ? void 0 : item.standard_answers[i]) == null ? void 0 : _a2.score);
|
|
}
|
|
return count;
|
|
} else {
|
|
return item.question_score;
|
|
}
|
|
})) == null ? void 0 : _c.filter((item) => item));
|
|
if ((items == null ? void 0 : items.length) > 0) {
|
|
form.setFieldsValue({
|
|
question_score: parseFloat(items == null ? void 0 : items.reduce((a, b) => parseFloat(a) + parseFloat(b))).toFixed(1)
|
|
});
|
|
}
|
|
}
|
|
},
|
|
onFinish: (values) => {
|
|
var _a;
|
|
seveeditor(Questions_CombinationQuestionEditor_spreadProps(Questions_CombinationQuestionEditor_spreadValues(Questions_CombinationQuestionEditor_spreadValues({}, qitem), values), {
|
|
sub_item_banks: (_a = values == null ? void 0 : values.sub_item_banks) == null ? void 0 : _a.map((item) => {
|
|
console.log(item);
|
|
return Questions_CombinationQuestionEditor_spreadProps(Questions_CombinationQuestionEditor_spreadValues({}, item), {
|
|
item_type: item == null ? void 0 : item.question_type,
|
|
id: (item == null ? void 0 : item.question_id) || ""
|
|
});
|
|
})
|
|
}));
|
|
},
|
|
onFinishFailed: (errInfo) => CombinationQuestionEditor_async(void 0, null, function* () {
|
|
var _a, _b;
|
|
message/* default */.ZP.error(errInfo.errorFields[0].errors[0]);
|
|
form.scrollToField((_b = (_a = errInfo == null ? void 0 : errInfo.errorFields) == null ? void 0 : _a[0]) == null ? void 0 : _b.name, { behavior: "smooth", block: "center" });
|
|
})
|
|
},
|
|
/* @__PURE__ */ Questions_CombinationQuestionEditor_React.createElement("div", { style: { display: "flex", alignItems: "center" } }, /* @__PURE__ */ Questions_CombinationQuestionEditor_React.createElement("div", { style: { flex: 1 } }, /* @__PURE__ */ Questions_CombinationQuestionEditor_React.createElement("span", { style: { display: "inline-flex", border: "1px solid #9096A3", borderRadius: "50%", width: 10, height: 10, marginRight: 5, background: "#9096A3" } }), /* @__PURE__ */ Questions_CombinationQuestionEditor_React.createElement("span", null, "\u7EC4\u5408\u9898")), !qitem.isadd && /* @__PURE__ */ Questions_CombinationQuestionEditor_React.createElement("span", { style: { marginLeft: 20, marginRight: 20, color: "red", cursor: "pointer" }, onClick: () => {
|
|
deleteitem();
|
|
} }, /* @__PURE__ */ Questions_CombinationQuestionEditor_React.createElement("i", { className: "iconfont icon-piliangshanchu3", style: { fontSize: 14, marginRight: 6 } }), "\u5220\u9664"), /* @__PURE__ */ Questions_CombinationQuestionEditor_React.createElement(es_button/* default */.ZP, { onClick: () => {
|
|
var _a;
|
|
if (!qitem.isadd) {
|
|
form.setFieldsValue(Questions_CombinationQuestionEditor_spreadProps(Questions_CombinationQuestionEditor_spreadValues({}, qitem), {
|
|
name: qitem == null ? void 0 : qitem.question_title,
|
|
choices: (_a = qitem == null ? void 0 : qitem.question_choices) == null ? void 0 : _a.map((item) => {
|
|
return Questions_CombinationQuestionEditor_spreadProps(Questions_CombinationQuestionEditor_spreadValues({}, item), { standard_boolean: (item == null ? void 0 : item.standard_boolean) ? 1 : 0 });
|
|
}),
|
|
repeat_answer: !(qitem == null ? void 0 : qitem.repeat_answer)
|
|
}));
|
|
setisedit(false);
|
|
} else {
|
|
setisedit(false);
|
|
init();
|
|
}
|
|
} }, "\u53D6\u6D88"), /* @__PURE__ */ Questions_CombinationQuestionEditor_React.createElement(es_button/* default */.ZP, { className: "ml20", type: "primary", onClick: () => {
|
|
form.submit();
|
|
} }, "\u4FDD\u5B58")),
|
|
/* @__PURE__ */ Questions_CombinationQuestionEditor_React.createElement("div", { style: { maxHeight: "70vh", overflowY: "auto", marginTop: "10px", paddingRight: "5px" } }, /* @__PURE__ */ Questions_CombinationQuestionEditor_React.createElement(QuestionText/* default */.Z, { text: "\uFF08\u7EC4\u5408\u9898\u5206\u503C\u7B49\u4E8E\u5404\u5C0F\u9898\u5206\u503C\u4E4B\u548C\uFF09" }), /* @__PURE__ */ Questions_CombinationQuestionEditor_React.createElement(
|
|
CombinationQuestionEditor,
|
|
{
|
|
form,
|
|
withScore: true,
|
|
choiceKey: "",
|
|
questionTitlePlaceholder: "\u8BF7\u7F16\u8F91\u7EC4\u5408\u9898\u9898\u5E72\u5185\u5BB9"
|
|
}
|
|
), /* @__PURE__ */ Questions_CombinationQuestionEditor_React.createElement(MoreSetting, { getTagData, qitem, exerciseitem, TagDiscipline, form }))
|
|
));
|
|
};
|
|
/* harmony default export */ var Questions_CombinationQuestionEditor = (CombinationQuestionEditor_DragQuestions);
|
|
|
|
// EXTERNAL MODULE: ./src/components/QuestionEditor/BProgramEditor.tsx + 2 modules
|
|
var BProgramEditor = __webpack_require__(49270);
|
|
// 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
|
|
/* provided dependency */ var BProgramEditor_React = __webpack_require__(/*! react */ 59301);
|
|
var BProgramEditor_defProp = Object.defineProperty;
|
|
var BProgramEditor_defProps = Object.defineProperties;
|
|
var BProgramEditor_getOwnPropDescs = Object.getOwnPropertyDescriptors;
|
|
var BProgramEditor_getOwnPropSymbols = Object.getOwnPropertySymbols;
|
|
var BProgramEditor_hasOwnProp = Object.prototype.hasOwnProperty;
|
|
var BProgramEditor_propIsEnum = Object.prototype.propertyIsEnumerable;
|
|
var BProgramEditor_defNormalProp = (obj, key, value) => key in obj ? BProgramEditor_defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
|
|
var BProgramEditor_spreadValues = (a, b) => {
|
|
for (var prop in b || (b = {}))
|
|
if (BProgramEditor_hasOwnProp.call(b, prop))
|
|
BProgramEditor_defNormalProp(a, prop, b[prop]);
|
|
if (BProgramEditor_getOwnPropSymbols)
|
|
for (var prop of BProgramEditor_getOwnPropSymbols(b)) {
|
|
if (BProgramEditor_propIsEnum.call(b, prop))
|
|
BProgramEditor_defNormalProp(a, prop, b[prop]);
|
|
}
|
|
return a;
|
|
};
|
|
var BProgramEditor_spreadProps = (a, b) => BProgramEditor_defProps(a, BProgramEditor_getOwnPropDescs(b));
|
|
var BProgramEditor_async = (__this, __arguments, generator) => {
|
|
return new Promise((resolve, reject) => {
|
|
var fulfilled = (value) => {
|
|
try {
|
|
step(generator.next(value));
|
|
} catch (e) {
|
|
reject(e);
|
|
}
|
|
};
|
|
var rejected = (value) => {
|
|
try {
|
|
step(generator.throw(value));
|
|
} catch (e) {
|
|
reject(e);
|
|
}
|
|
};
|
|
var step = (x) => x.done ? resolve(x.value) : Promise.resolve(x.value).then(fulfilled, rejected);
|
|
step((generator = generator.apply(__this, __arguments)).next());
|
|
});
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
|
|
const BProgramEditor_DragQuestions = ({ qitem, TagDiscipline, exerciseitem, setisedit, seveeditor, deleteitem, getTagData, init }) => {
|
|
const [form] = es_form["default"].useForm();
|
|
const scoreByBlank = true;
|
|
(0,_react_17_0_2_react.useEffect)(() => {
|
|
var _a, _b, _c;
|
|
form.setFieldsValue(BProgramEditor_spreadProps(BProgramEditor_spreadValues({}, qitem), {
|
|
standard_answers: qitem.standard_answer,
|
|
difficulty: qitem.difficulty,
|
|
item_banks_group_id: qitem.item_banks_group_id,
|
|
hack: BProgramEditor_spreadProps(BProgramEditor_spreadValues({}, qitem), {
|
|
time_limit: (qitem == null ? void 0 : qitem.time_limit) || 3
|
|
}),
|
|
hack_codes: {
|
|
language: (_a = qitem == null ? void 0 : qitem.program_attr) == null ? void 0 : _a.language,
|
|
code: base64.Base64.decode(((_b = qitem == null ? void 0 : qitem.program_attr) == null ? void 0 : _b.code) || "")
|
|
},
|
|
hack_sets: BProgramEditor_spreadValues({}, (_c = qitem == null ? void 0 : qitem.hack_sets) == null ? void 0 : _c[0]),
|
|
repeat_answer: !qitem.repeat_answer
|
|
}));
|
|
}, [qitem]);
|
|
return /* @__PURE__ */ BProgramEditor_React.createElement("div", null, /* @__PURE__ */ BProgramEditor_React.createElement(
|
|
es_form["default"],
|
|
{
|
|
form,
|
|
colon: false,
|
|
onValuesChange: (values, value) => {
|
|
var _a, _b, _c, _d;
|
|
if (values == null ? void 0 : values.standard_answers) {
|
|
let items = ((_a = form.getFieldValue("standard_answers")) == null ? void 0 : _a.length) > 0 && ((_c = (_b = form.getFieldValue("standard_answers")) == null ? void 0 : _b.map((item) => item.score)) == null ? void 0 : _c.filter((item) => item));
|
|
if ((items == null ? void 0 : items.length) > 0) {
|
|
form.setFieldsValue({
|
|
question_score: (items == null ? void 0 : items.length) > 0 && ((_d = items.reduce((a, b) => a + b)) == null ? void 0 : _d.toFixed(1))
|
|
});
|
|
}
|
|
}
|
|
},
|
|
onFinish: (values) => {
|
|
var _a;
|
|
seveeditor(BProgramEditor_spreadProps(BProgramEditor_spreadValues(BProgramEditor_spreadValues({}, qitem), values), {
|
|
item_type: qitem == null ? void 0 : qitem.question_type,
|
|
standard_answers: (_a = values.standard_answers) == null ? void 0 : _a.map((item, index) => {
|
|
return BProgramEditor_spreadProps(BProgramEditor_spreadValues({}, item), {
|
|
position: index + 1
|
|
});
|
|
}),
|
|
standard_answer: void 0
|
|
//后端希望只传一个,存和取的字段又不统一
|
|
}));
|
|
},
|
|
onFinishFailed: (errInfo) => BProgramEditor_async(void 0, null, function* () {
|
|
var _a, _b;
|
|
message/* default */.ZP.error(errInfo.errorFields[0].errors[0]);
|
|
form.scrollToField((_b = (_a = errInfo == null ? void 0 : errInfo.errorFields) == null ? void 0 : _a[0]) == null ? void 0 : _b.name, { behavior: "smooth", block: "center" });
|
|
})
|
|
},
|
|
/* @__PURE__ */ BProgramEditor_React.createElement("div", { style: { display: "flex", alignItems: "center" } }, /* @__PURE__ */ BProgramEditor_React.createElement("div", { style: { flex: 1 } }, /* @__PURE__ */ BProgramEditor_React.createElement("span", { style: { display: "inline-flex", border: "1px solid #9096A3", borderRadius: "50%", width: 10, height: 10, marginRight: 5, background: "#9096A3" } }), /* @__PURE__ */ BProgramEditor_React.createElement("span", null, "\u7A0B\u5E8F\u586B\u7A7A\u9898")), !qitem.isadd && /* @__PURE__ */ BProgramEditor_React.createElement("span", { style: { marginLeft: 20, marginRight: 20, color: "red", cursor: "pointer" }, onClick: () => {
|
|
deleteitem();
|
|
} }, /* @__PURE__ */ BProgramEditor_React.createElement("i", { className: "iconfont icon-piliangshanchu3", style: { fontSize: 14, marginRight: 6 } }), " \u5220\u9664"), /* @__PURE__ */ BProgramEditor_React.createElement(
|
|
es_button/* default */.ZP,
|
|
{
|
|
onClick: () => {
|
|
var _a, _b, _c;
|
|
if (!qitem.isadd) {
|
|
form.setFieldsValue(BProgramEditor_spreadProps(BProgramEditor_spreadValues({}, qitem), {
|
|
standard_answers: qitem.standard_answer,
|
|
difficulty: qitem.difficult,
|
|
item_banks_group_id: qitem.item_banks_group_id,
|
|
hack: BProgramEditor_spreadValues({}, qitem),
|
|
hack_codes: {
|
|
language: (_a = qitem == null ? void 0 : qitem.program_attr) == null ? void 0 : _a.language,
|
|
code: base64.Base64.decode((_b = qitem == null ? void 0 : qitem.program_attr) == null ? void 0 : _b.code)
|
|
},
|
|
hack_sets: BProgramEditor_spreadValues({}, (_c = qitem == null ? void 0 : qitem.hack_sets) == null ? void 0 : _c[0]),
|
|
repeat_answer: !qitem.repeat_answer
|
|
}));
|
|
setisedit(false);
|
|
} else {
|
|
setisedit(false);
|
|
init();
|
|
}
|
|
}
|
|
},
|
|
"\u53D6\u6D88"
|
|
), /* @__PURE__ */ BProgramEditor_React.createElement(es_button/* default */.ZP, { className: "ml20", type: "primary", onClick: () => {
|
|
form.submit();
|
|
} }, "\u4FDD\u5B58")),
|
|
/* @__PURE__ */ BProgramEditor_React.createElement("div", { style: { maxHeight: "70vh", overflowY: "auto", marginTop: "10px", paddingRight: "5px" } }, /* @__PURE__ */ BProgramEditor_React.createElement(QuestionText/* default */.Z, { text: "\uFF08\u5C0F\u9898\u5206\u503C\u7B49\u4E8E\u5404\u586B\u7A7A\u9879\u5206\u503C\u4E4B\u548C\uFF09" }), /* @__PURE__ */ BProgramEditor_React.createElement(
|
|
BProgramEditor/* BProgramEditor */.t,
|
|
{
|
|
form,
|
|
questionTitlePlaceholder: "\u8BF7\u7F16\u8F91\u7A0B\u5E8F\u586B\u7A7A\u9898\u9898\u5E72\u5185\u5BB9",
|
|
scoreByBlank,
|
|
hackidentifier: qitem == null ? void 0 : qitem.hack_identifier,
|
|
answerKey: "standard_answers"
|
|
}
|
|
), /* @__PURE__ */ BProgramEditor_React.createElement(MoreSetting, { getTagData, qitem, exerciseitem, TagDiscipline, form }))
|
|
));
|
|
};
|
|
/* harmony default export */ var Questions_BProgramEditor = (BProgramEditor_DragQuestions);
|
|
|
|
;// CONCATENATED MODULE: ./src/pages/Paperlibrary/EditPotin/components/Questions/ShixunEditor.tsx
|
|
/* provided dependency */ var ShixunEditor_React = __webpack_require__(/*! react */ 59301);
|
|
var ShixunEditor_defProp = Object.defineProperty;
|
|
var ShixunEditor_defProps = Object.defineProperties;
|
|
var ShixunEditor_getOwnPropDescs = Object.getOwnPropertyDescriptors;
|
|
var ShixunEditor_getOwnPropSymbols = Object.getOwnPropertySymbols;
|
|
var ShixunEditor_hasOwnProp = Object.prototype.hasOwnProperty;
|
|
var ShixunEditor_propIsEnum = Object.prototype.propertyIsEnumerable;
|
|
var ShixunEditor_defNormalProp = (obj, key, value) => key in obj ? ShixunEditor_defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
|
|
var ShixunEditor_spreadValues = (a, b) => {
|
|
for (var prop in b || (b = {}))
|
|
if (ShixunEditor_hasOwnProp.call(b, prop))
|
|
ShixunEditor_defNormalProp(a, prop, b[prop]);
|
|
if (ShixunEditor_getOwnPropSymbols)
|
|
for (var prop of ShixunEditor_getOwnPropSymbols(b)) {
|
|
if (ShixunEditor_propIsEnum.call(b, prop))
|
|
ShixunEditor_defNormalProp(a, prop, b[prop]);
|
|
}
|
|
return a;
|
|
};
|
|
var ShixunEditor_spreadProps = (a, b) => ShixunEditor_defProps(a, ShixunEditor_getOwnPropDescs(b));
|
|
var ShixunEditor_async = (__this, __arguments, generator) => {
|
|
return new Promise((resolve, reject) => {
|
|
var fulfilled = (value) => {
|
|
try {
|
|
step(generator.next(value));
|
|
} catch (e) {
|
|
reject(e);
|
|
}
|
|
};
|
|
var rejected = (value) => {
|
|
try {
|
|
step(generator.throw(value));
|
|
} catch (e) {
|
|
reject(e);
|
|
}
|
|
};
|
|
var step = (x) => x.done ? resolve(x.value) : Promise.resolve(x.value).then(fulfilled, rejected);
|
|
step((generator = generator.apply(__this, __arguments)).next());
|
|
});
|
|
};
|
|
|
|
|
|
|
|
|
|
const ShixunEditor_DragQuestions = ({ qitem, setqitem, setisedit, TagDiscipline, exerciseitem, seveeditor, deleteitem }) => {
|
|
var _a;
|
|
const [form] = es_form["default"].useForm();
|
|
(0,_react_17_0_2_react.useEffect)(() => {
|
|
var _a2, _b;
|
|
form.setFieldsValue(ShixunEditor_spreadProps(ShixunEditor_spreadValues({}, qitem), {
|
|
name: qitem == null ? void 0 : qitem.question_title,
|
|
choices: (_a2 = qitem == null ? void 0 : qitem.question_choices) == null ? void 0 : _a2.map((item) => {
|
|
return ShixunEditor_spreadProps(ShixunEditor_spreadValues({}, item), { standard_boolean: (item == null ? void 0 : item.standard_boolean) ? 1 : 0 });
|
|
}),
|
|
repeat_answer: !(qitem == null ? void 0 : qitem.repeat_answer)
|
|
}));
|
|
qitem.shixun = (_b = qitem == null ? void 0 : qitem.shixun) == null ? void 0 : _b.map((item) => {
|
|
return ShixunEditor_spreadProps(ShixunEditor_spreadValues({}, item), {
|
|
defaultscore: item.challenge_score
|
|
});
|
|
});
|
|
}, []);
|
|
return /* @__PURE__ */ ShixunEditor_React.createElement("div", null, /* @__PURE__ */ ShixunEditor_React.createElement(
|
|
es_form["default"],
|
|
{
|
|
form,
|
|
colon: false,
|
|
onFinish: (values) => {
|
|
var _a2, _b;
|
|
let datas = ShixunEditor_spreadProps(ShixunEditor_spreadValues({}, values), {
|
|
question_scores: (_a2 = qitem == null ? void 0 : qitem.shixun) == null ? void 0 : _a2.map((item) => item.challenge_score),
|
|
item_type: qitem == null ? void 0 : qitem.question_type,
|
|
choices: (_b = values == null ? void 0 : values.choices) == null ? void 0 : _b.map((item) => {
|
|
return ShixunEditor_spreadProps(ShixunEditor_spreadValues({}, item), {
|
|
is_answer: item.standard_boolean
|
|
});
|
|
})
|
|
});
|
|
seveeditor(ShixunEditor_spreadValues(ShixunEditor_spreadValues({}, qitem), datas));
|
|
},
|
|
onFinishFailed: (errInfo) => ShixunEditor_async(void 0, null, function* () {
|
|
var _a2, _b;
|
|
message/* default */.ZP.error(errInfo.errorFields[0].errors[0]);
|
|
form.scrollToField((_b = (_a2 = errInfo == null ? void 0 : errInfo.errorFields) == null ? void 0 : _a2[0]) == null ? void 0 : _b.name, { behavior: "smooth", block: "center" });
|
|
})
|
|
},
|
|
/* @__PURE__ */ ShixunEditor_React.createElement("div", { style: { display: "flex", alignItems: "center" } }, /* @__PURE__ */ ShixunEditor_React.createElement("div", { style: { flex: 1 } }, /* @__PURE__ */ ShixunEditor_React.createElement("span", { style: { display: "inline-flex", border: "1px solid #9096A3", borderRadius: "50%", width: 10, height: 10, marginRight: 5, background: "#9096A3" } }), /* @__PURE__ */ ShixunEditor_React.createElement("span", null, "\u5B9E\u8BAD\u9898")), /* @__PURE__ */ ShixunEditor_React.createElement("span", { style: { marginLeft: 20, marginRight: 20, color: "red", cursor: "pointer" }, onClick: () => {
|
|
deleteitem();
|
|
} }, /* @__PURE__ */ ShixunEditor_React.createElement("i", { className: "iconfont icon-piliangshanchu3", style: { fontSize: 14, marginRight: 6 } }), "\u5220\u9664"), /* @__PURE__ */ ShixunEditor_React.createElement(es_button/* default */.ZP, { onClick: () => {
|
|
var _a2, _b;
|
|
form.setFieldsValue(ShixunEditor_spreadProps(ShixunEditor_spreadValues({}, qitem), {
|
|
name: qitem == null ? void 0 : qitem.question_title,
|
|
choices: (_a2 = qitem == null ? void 0 : qitem.question_choices) == null ? void 0 : _a2.map((item) => {
|
|
return ShixunEditor_spreadProps(ShixunEditor_spreadValues({}, item), { standard_boolean: (item == null ? void 0 : item.standard_boolean) ? 1 : 0 });
|
|
}),
|
|
repeat_answer: !(qitem == null ? void 0 : qitem.repeat_answer)
|
|
}));
|
|
qitem.shixun = (_b = qitem == null ? void 0 : qitem.shixun) == null ? void 0 : _b.map((item) => {
|
|
return ShixunEditor_spreadProps(ShixunEditor_spreadValues({}, item), {
|
|
challenge_score: item.defaultscore
|
|
});
|
|
});
|
|
setqitem(ShixunEditor_spreadValues({}, qitem));
|
|
setisedit(false);
|
|
} }, "\u53D6\u6D88"), /* @__PURE__ */ ShixunEditor_React.createElement(es_button/* default */.ZP, { className: "ml20", type: "primary", onClick: () => ShixunEditor_async(void 0, null, function* () {
|
|
var _a2, _b, _c;
|
|
if (((_b = (_a2 = qitem == null ? void 0 : qitem.shixun) == null ? void 0 : _a2.map) == null ? void 0 : _b.call(_a2, (item) => item.challenge_score).filter((item) => item).length) < ((_c = qitem == null ? void 0 : qitem.shixun) == null ? void 0 : _c.length)) {
|
|
message/* default */.ZP.info("\u5206\u6570\u4E0D\u80FD\u4E3A\u7A7A");
|
|
return;
|
|
}
|
|
form.submit();
|
|
}) }, "\u4FDD\u5B58")),
|
|
/* @__PURE__ */ ShixunEditor_React.createElement(QuestionText/* default */.Z, { text: "\uFF08\u5B9E\u8BAD\u9898\u5206\u503C\u7B49\u4E8E\u5404\u5173\u5361\u5206\u503C\u4E4B\u548C\uFF09" }),
|
|
/* @__PURE__ */ ShixunEditor_React.createElement(es_form["default"].Item, { label: "\u9898\u5E72", name: "question_title", labelCol: { span: 24 }, rules: [{ required: true }] }, /* @__PURE__ */ ShixunEditor_React.createElement(
|
|
markdown_editor/* default */.Z,
|
|
{
|
|
watch: true,
|
|
height: 140,
|
|
placeholder: "",
|
|
defaultValue: qitem.question_title
|
|
}
|
|
))
|
|
), /* @__PURE__ */ ShixunEditor_React.createElement(row/* default */.Z, { style: { marginBottom: 15 }, align: "middle", justify: "space-between" }, /* @__PURE__ */ ShixunEditor_React.createElement("div", null, /* @__PURE__ */ ShixunEditor_React.createElement("span", { style: { color: "red" } }, "*"), "\u5173\u5361\u540D\u79F0"), /* @__PURE__ */ ShixunEditor_React.createElement("a", { href: `/shixuns/${qitem == null ? void 0 : qitem.shixun_identifier}/challenges?exercise=true`, target: "_blank" }, /* @__PURE__ */ ShixunEditor_React.createElement("i", { onClick: () => {
|
|
}, className: `iconfont icon-shixunkecheng font14 mr5` }), "\u5B9E\u8BAD\u8BE6\u60C5")), (_a = qitem == null ? void 0 : qitem.shixun) == null ? void 0 : _a.map((item, index) => /* @__PURE__ */ ShixunEditor_React.createElement("div", { key: item.challenge_id, style: { display: "flex", marginBottom: 20 } }, /* @__PURE__ */ ShixunEditor_React.createElement("div", { style: { flex: 1 } }, index + 1, "\u3001", item.challenge_name), /* @__PURE__ */ ShixunEditor_React.createElement("div", null, /* @__PURE__ */ ShixunEditor_React.createElement("span", { style: { color: "red" } }, "*"), "\u5206\u503C", /* @__PURE__ */ ShixunEditor_React.createElement(input_number/* default */.Z, { precision: 1, value: item == null ? void 0 : item.challenge_score, onChange: (e) => {
|
|
const items = JSON.parse(JSON.stringify((qitem == null ? void 0 : qitem.shixun) || []));
|
|
items[index].challenge_score = e;
|
|
const isEmpty = items.every((e2) => !e2.challenge_score);
|
|
const score = parseFloat(items == null ? void 0 : items.map((item2) => item2.challenge_score).reduce((a, b) => parseFloat(a || 0) + parseFloat(b || 0)));
|
|
form.setFieldsValue({
|
|
question_score: isEmpty ? "" : score.toFixed(1)
|
|
});
|
|
setqitem(ShixunEditor_spreadProps(ShixunEditor_spreadValues({}, qitem), { shixun: items }));
|
|
}, max: 100, min: 1, style: { marginLeft: 10, width: 150 }, placeholder: "\u8BF7\u8F93\u5165\u5206\u503C", size: "middle" })))));
|
|
};
|
|
/* 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"});
|
|
// EXTERNAL MODULE: ./src/components/MathsLatexKeybords/index.tsx
|
|
var MathsLatexKeybords = __webpack_require__(14233);
|
|
;// CONCATENATED MODULE: ./src/pages/Paperlibrary/EditPotin/components/SaveItem.tsx
|
|
/* provided dependency */ var SaveItem_React = __webpack_require__(/*! react */ 59301);
|
|
|
|
|
|
|
|
|
|
|
|
const tagDotData = [
|
|
"A\uFF0E",
|
|
"B\uFF0E",
|
|
"C\uFF0E",
|
|
"D\uFF0E",
|
|
"E\uFF0E",
|
|
"F\uFF0E",
|
|
"G\uFF0E",
|
|
"H\uFF0E",
|
|
"I\uFF0E",
|
|
"J\uFF0E",
|
|
"K\uFF0E",
|
|
"L\uFF0E",
|
|
"M\uFF0E",
|
|
"N\uFF0E",
|
|
"O\uFF0E",
|
|
"P\uFF0E",
|
|
"Q\uFF0E",
|
|
"R\uFF0E",
|
|
"S\uFF0E",
|
|
"T\uFF0E",
|
|
"U\uFF0E",
|
|
"V\uFF0E",
|
|
"W\uFF0E",
|
|
"X\uFF0E",
|
|
"Y\uFF0E",
|
|
"Z\uFF0E"
|
|
];
|
|
const questionType = [
|
|
{ type: 0, name: "\u5355\u9009\u9898" },
|
|
{ type: 1, name: "\u591A\u9009\u9898" },
|
|
{ type: 2, name: "\u5224\u65AD\u9898" },
|
|
{ type: 3, name: "\u586B\u7A7A\u9898" },
|
|
{ type: 4, name: "\u7B80\u7B54\u9898" },
|
|
{ type: 5, name: "\u5B9E\u8BAD\u9898" },
|
|
{ type: 6, name: "\u7F16\u7A0B\u9898" },
|
|
{ type: 7, name: "\u7EC4\u5408\u9898" },
|
|
{ type: 8, name: "\u7A0B\u5E8F\u586B\u7A7A\u9898" }
|
|
];
|
|
const SaveItem_DragQuestions = ({ qitem }) => {
|
|
var _a, _b, _c, _d, _e, _f, _g, _h, _i, _j, _k, _l, _m, _n, _o, _p;
|
|
return /* @__PURE__ */ SaveItem_React.createElement("div", { className: Saveitemmodules.warp }, ((qitem == null ? void 0 : qitem.question_type) === 0 || (qitem == null ? void 0 : qitem.question_type) === 2) && /* @__PURE__ */ SaveItem_React.createElement("div", { className: Saveitemmodules.normalWrap }, (_a = qitem == null ? void 0 : qitem.question_choices) == null ? void 0 : _a.map((item, index) => /* @__PURE__ */ SaveItem_React.createElement("div", { className: Saveitemmodules.redio, key: index }, !(item == null ? void 0 : item.standard_boolean) && /* @__PURE__ */ SaveItem_React.createElement("span", { className: Saveitemmodules.redioitem }), (item == null ? void 0 : item.standard_boolean) && /* @__PURE__ */ SaveItem_React.createElement("i", { className: `${Saveitemmodules.redioitemyes} icon-duigou1` }), /* @__PURE__ */ SaveItem_React.createElement("span", { className: `${(item == null ? void 0 : item.standard_boolean) ? Saveitemmodules.titleyes : Saveitemmodules.title} ${Saveitemmodules.indexTag}` }, (qitem == null ? void 0 : qitem.question_type) === 0 ? tagDotData[index] : ""), /* @__PURE__ */ SaveItem_React.createElement(RenderHtml/* default */.Z, { className: (item == null ? void 0 : item.standard_boolean) ? Saveitemmodules.titleyes : Saveitemmodules.title, value: item == null ? void 0 : item.choice_text }), (item == null ? void 0 : item.standard_boolean) && /* @__PURE__ */ SaveItem_React.createElement("div", { className: Saveitemmodules.yestag }, "\u6B63\u786E\u7B54\u6848")))), (qitem == null ? void 0 : qitem.question_type) === 1 && /* @__PURE__ */ SaveItem_React.createElement("div", { className: Saveitemmodules.normalWrap }, (_b = qitem == null ? void 0 : qitem.question_choices) == null ? void 0 : _b.map((item, index) => /* @__PURE__ */ SaveItem_React.createElement("div", { className: Saveitemmodules.checkbox, key: index }, !(item == null ? void 0 : item.standard_boolean) && /* @__PURE__ */ SaveItem_React.createElement("span", { className: Saveitemmodules.checkboxitem }), (item == null ? void 0 : item.standard_boolean) && /* @__PURE__ */ SaveItem_React.createElement("i", { className: `${Saveitemmodules.checkboxitemyes} icon-duigou1` }), /* @__PURE__ */ SaveItem_React.createElement("span", { className: `${(item == null ? void 0 : item.standard_boolean) ? Saveitemmodules.titleyes : Saveitemmodules.title} ${Saveitemmodules.indexTag}` }, tagDotData[index]), /* @__PURE__ */ SaveItem_React.createElement(RenderHtml/* default */.Z, { className: (item == null ? void 0 : item.standard_boolean) ? Saveitemmodules.titleyes : Saveitemmodules.title, value: item == null ? void 0 : item.choice_text }), (item == null ? void 0 : item.standard_boolean) && /* @__PURE__ */ SaveItem_React.createElement("div", { className: Saveitemmodules.yestag }, "\u6B63\u786E\u7B54\u6848")))), (qitem == null ? void 0 : qitem.question_type) === 3 && /* @__PURE__ */ SaveItem_React.createElement("div", { className: Saveitemmodules.completion }, (_c = qitem == null ? void 0 : qitem.standard_answers) == null ? void 0 : _c.map((item, index) => {
|
|
var _a2;
|
|
return /* @__PURE__ */ SaveItem_React.createElement(row/* default */.Z, { align: "top" }, /* @__PURE__ */ SaveItem_React.createElement("span", { className: Saveitemmodules.title }, "\u586B\u7A7A\u9879", index + 1), /* @__PURE__ */ SaveItem_React.createElement("div", { className: Saveitemmodules.content }, (_a2 = item.answer_text) == null ? void 0 : _a2.map((val, vindex) => /* @__PURE__ */ SaveItem_React.createElement("div", { key: vindex, className: Saveitemmodules.items, style: (item == null ? void 0 : item.model) === 2 ? { border: 0, padding: 0 } : {} }, (item == null ? void 0 : item.model) === 1 ? /* @__PURE__ */ SaveItem_React.createElement("pre", { className: "mb0" }, val) : /* @__PURE__ */ SaveItem_React.createElement(MathsLatexKeybords/* default */.Z, { value: val, disabled: true })))));
|
|
})), (qitem == null ? void 0 : qitem.question_type) === 4 && /* @__PURE__ */ SaveItem_React.createElement("div", { className: Saveitemmodules.simple }, /* @__PURE__ */ SaveItem_React.createElement("div", { className: Saveitemmodules.title }, "\u53C2\u8003\u7B54\u6848"), /* @__PURE__ */ SaveItem_React.createElement("div", { className: "mt10", style: { fontSize: "16px" } }, ((_d = qitem == null ? void 0 : qitem.answer_texts) == null ? void 0 : _d[0]) ? /* @__PURE__ */ SaveItem_React.createElement(RenderHtml/* default */.Z, { className: Saveitemmodules.content, value: (_e = qitem == null ? void 0 : qitem.answer_texts) == null ? void 0 : _e[0] }) : /* @__PURE__ */ SaveItem_React.createElement("div", { style: { color: "#C1C1C1" } }, "\u6682\u672A\u8BBE\u7F6E~")), /* @__PURE__ */ SaveItem_React.createElement("div", { className: "mt20 " }, /* @__PURE__ */ SaveItem_React.createElement("span", { className: Saveitemmodules.title, style: { color: "#3061D0" } }, "\u5224\u5206\u65B9\u5F0F"), /* @__PURE__ */ SaveItem_React.createElement("span", { style: { color: "#000", marginLeft: 10, fontSize: "16px" } }, (qitem == null ? void 0 : qitem.use_keywords) ? "\u5173\u952E\u8BCD\u81EA\u52A8\u5224\u5206" : "\u624B\u52A8\u5224\u5206"))), (qitem == null ? void 0 : qitem.question_type) === 5 && /* @__PURE__ */ SaveItem_React.createElement("div", { className: Saveitemmodules.shixunWrapper }, (_f = qitem == null ? void 0 : qitem.shixun) == null ? void 0 : _f.map((val, vindex) => /* @__PURE__ */ SaveItem_React.createElement("div", { key: vindex, className: `${Saveitemmodules.shixun} mb30` }, /* @__PURE__ */ SaveItem_React.createElement("span", { className: Saveitemmodules.score }, "\uFF08", val == null ? void 0 : val.challenge_score, "\u5206\uFF09"), /* @__PURE__ */ SaveItem_React.createElement("span", { className: Saveitemmodules.qtitle }, (qitem == null ? void 0 : qitem.index) + "." + (vindex + 1), "\u3001", val == null ? void 0 : val.challenge_name)))), (qitem == null ? void 0 : qitem.question_type) === 6 && /* @__PURE__ */ SaveItem_React.createElement("div", { className: Saveitemmodules.program }, /* @__PURE__ */ SaveItem_React.createElement(RenderHtml/* default */.Z, { className: Saveitemmodules.content, value: (qitem == null ? void 0 : qitem.description) || "- -" })), (qitem == null ? void 0 : qitem.question_type) === 7 && ((_g = qitem == null ? void 0 : qitem.sub_exercise_questions) == null ? void 0 : _g.map(
|
|
(val, vndex) => {
|
|
var _a2, _b2, _c2, _d2, _e2, _f2;
|
|
return /* @__PURE__ */ SaveItem_React.createElement("div", { key: vndex }, /* @__PURE__ */ SaveItem_React.createElement("div", { className: Saveitemmodules.combination }, /* @__PURE__ */ SaveItem_React.createElement("span", { className: Saveitemmodules.score }, val == null ? void 0 : val.question_score, "\u5206"), /* @__PURE__ */ SaveItem_React.createElement("span", { className: Saveitemmodules.qtype }, (_a2 = questionType.find((i) => i.type == val.question_type)) == null ? void 0 : _a2.name), /* @__PURE__ */ SaveItem_React.createElement("span", { className: Saveitemmodules.qtitle }, vndex + 1, "\u3001", val == null ? void 0 : val.question_title)), (val.question_type === 0 || val.question_type === 2) && /* @__PURE__ */ SaveItem_React.createElement("div", { className: Saveitemmodules.warp, style: { padding: "20px 58px 0 58px" } }, /* @__PURE__ */ SaveItem_React.createElement("div", null, (_b2 = val == null ? void 0 : val.question_choices) == null ? void 0 : _b2.map((item, index) => /* @__PURE__ */ SaveItem_React.createElement("div", { className: Saveitemmodules.redio, key: index }, !(item == null ? void 0 : item.standard_boolean) && /* @__PURE__ */ SaveItem_React.createElement("span", { className: Saveitemmodules.redioitem }), (item == null ? void 0 : item.standard_boolean) && /* @__PURE__ */ SaveItem_React.createElement("i", { className: `${Saveitemmodules.redioitemyes} icon-duigou1` }), /* @__PURE__ */ SaveItem_React.createElement("span", { className: `${(item == null ? void 0 : item.standard_boolean) ? Saveitemmodules.titleyes : Saveitemmodules.title} ${Saveitemmodules.indexTag}` }, tagDotData[index]), /* @__PURE__ */ SaveItem_React.createElement(RenderHtml/* default */.Z, { className: (item == null ? void 0 : item.standard_boolean) ? Saveitemmodules.titleyes : Saveitemmodules.title, value: item == null ? void 0 : item.choice_text }), (item == null ? void 0 : item.standard_boolean) && /* @__PURE__ */ SaveItem_React.createElement("div", { className: Saveitemmodules.yestag }, "\u6B63\u786E\u7B54\u6848"))))), val.question_type === 1 && /* @__PURE__ */ SaveItem_React.createElement("div", { className: Saveitemmodules.normalWrap }, (_c2 = val == null ? void 0 : val.question_choices) == null ? void 0 : _c2.map((item, index) => /* @__PURE__ */ SaveItem_React.createElement("div", { className: Saveitemmodules.checkbox, key: index }, !(item == null ? void 0 : item.standard_boolean) && /* @__PURE__ */ SaveItem_React.createElement("span", { className: Saveitemmodules.checkboxitem }), (item == null ? void 0 : item.standard_boolean) && /* @__PURE__ */ SaveItem_React.createElement("i", { className: `${Saveitemmodules.checkboxitemyes} icon-duigou1` }), /* @__PURE__ */ SaveItem_React.createElement("span", { className: `${(item == null ? void 0 : item.standard_boolean) ? Saveitemmodules.titleyes : Saveitemmodules.title} ${Saveitemmodules.indexTag}` }, tagDotData[index]), /* @__PURE__ */ SaveItem_React.createElement(RenderHtml/* default */.Z, { className: (item == null ? void 0 : item.standard_boolean) ? Saveitemmodules.titleyes : Saveitemmodules.title, value: item == null ? void 0 : item.choice_text }), (item == null ? void 0 : item.standard_boolean) && /* @__PURE__ */ SaveItem_React.createElement("div", { className: Saveitemmodules.yestag }, "\u6B63\u786E\u7B54\u6848")))), val.question_type === 3 && /* @__PURE__ */ SaveItem_React.createElement("div", { className: Saveitemmodules.completion }, (_d2 = val == null ? void 0 : val.standard_answers) == null ? void 0 : _d2.map((item, index) => {
|
|
var _a3;
|
|
return /* @__PURE__ */ SaveItem_React.createElement(row/* default */.Z, { align: "top" }, /* @__PURE__ */ SaveItem_React.createElement("span", { className: Saveitemmodules.title }, "\u586B\u7A7A\u9879", index + 1), /* @__PURE__ */ SaveItem_React.createElement("div", { className: Saveitemmodules.content }, (_a3 = item.answer_text) == null ? void 0 : _a3.map((val2, vindex) => /* @__PURE__ */ SaveItem_React.createElement("div", { key: vindex, className: Saveitemmodules.items }, /* @__PURE__ */ SaveItem_React.createElement("pre", { className: "mb0" }, val2)))));
|
|
})), val.question_type === 4 && /* @__PURE__ */ SaveItem_React.createElement("div", { className: Saveitemmodules.simple }, /* @__PURE__ */ SaveItem_React.createElement("div", { className: Saveitemmodules.title }, "\u53C2\u8003\u7B54\u6848"), /* @__PURE__ */ SaveItem_React.createElement("div", { className: "mt10", style: { fontSize: "16px" } }, ((_e2 = val == null ? void 0 : val.answer_texts) == null ? void 0 : _e2[0]) ? /* @__PURE__ */ SaveItem_React.createElement(RenderHtml/* default */.Z, { className: Saveitemmodules.content, value: (_f2 = val == null ? void 0 : val.answer_texts) == null ? void 0 : _f2[0] }) : /* @__PURE__ */ SaveItem_React.createElement("div", { style: { color: "#C1C1C1" } }, "\u6682\u672A\u8BBE\u7F6E~")), /* @__PURE__ */ SaveItem_React.createElement("div", { className: "mt20 " }, /* @__PURE__ */ SaveItem_React.createElement("span", { className: Saveitemmodules.title, style: { color: "#3061D0" } }, "\u5224\u5206\u65B9\u5F0F"), /* @__PURE__ */ SaveItem_React.createElement("span", { style: { color: "#000", marginLeft: 10, fontSize: "16px" } }, (qitem == null ? void 0 : qitem.use_keywords) ? "\u5173\u952E\u8BCD\u81EA\u52A8\u5224\u5206" : "\u624B\u52A8\u5224\u5206"))));
|
|
}
|
|
)), (qitem == null ? void 0 : qitem.question_type) === 8 && /* @__PURE__ */ SaveItem_React.createElement("div", null, /* @__PURE__ */ SaveItem_React.createElement(RenderHtml/* default */.Z, { disabledFill: true, className: Saveitemmodules.content, showProgramFill: true, value: base64.Base64.decode(((_h = qitem == null ? void 0 : qitem.program_attr) == null ? void 0 : _h.code) || "") })), ((qitem == null ? void 0 : qitem.question_type) <= 4 || [6, 8].includes(qitem == null ? void 0 : qitem.question_type)) && /* @__PURE__ */ SaveItem_React.createElement("div", { className: Saveitemmodules.bottom }, /* @__PURE__ */ SaveItem_React.createElement("div", { className: `${Saveitemmodules.bottomitem} mb30` }, /* @__PURE__ */ SaveItem_React.createElement("span", { className: Saveitemmodules.left }, "\u89E3\u6790"), /* @__PURE__ */ SaveItem_React.createElement("span", { className: Saveitemmodules.right }, (qitem == null ? void 0 : qitem.analysis) ? /* @__PURE__ */ SaveItem_React.createElement(RenderHtml/* default */.Z, { value: qitem == null ? void 0 : qitem.analysis }) : /* @__PURE__ */ SaveItem_React.createElement("span", { style: { color: "#C1C1C1" } }, "\u6682\u672A\u8BBE\u7F6E~"))), /* @__PURE__ */ SaveItem_React.createElement("div", { className: `${Saveitemmodules.bottomitem} mb30` }, /* @__PURE__ */ SaveItem_React.createElement("span", { className: Saveitemmodules.left }, "\u96BE\u5EA6"), /* @__PURE__ */ SaveItem_React.createElement("span", { className: Saveitemmodules.right }, (qitem == null ? void 0 : qitem.difficulty) === 1 ? "\u7B80\u5355" : (qitem == null ? void 0 : qitem.difficulty) === 2 ? "\u9002\u4E2D" : "\u56F0\u96BE")), /* @__PURE__ */ SaveItem_React.createElement("div", { className: Saveitemmodules.bottomitem }, /* @__PURE__ */ SaveItem_React.createElement("span", { className: Saveitemmodules.left }, "\u77E5\u8BC6\u70B9"), /* @__PURE__ */ SaveItem_React.createElement(
|
|
tooltip/* default */.Z,
|
|
{
|
|
title: ((_i = qitem == null ? void 0 : qitem.tag_discipline_names) == null ? void 0 : _i.length) <= 0 ? "\u6682\u672A\u8BBE\u7F6E~" : ((_j = qitem == null ? void 0 : qitem.tag_discipline_names) == null ? void 0 : _j.length) == 1 && ["-"].includes(qitem == null ? void 0 : qitem.tag_discipline_names[0]) ? "\u6682\u672A\u8BBE\u7F6E~" : (_l = (_k = qitem == null ? void 0 : qitem.tag_discipline_names) == null ? void 0 : _k.join("\uFF1B")) == null ? void 0 : _l.toString()
|
|
},
|
|
/* @__PURE__ */ SaveItem_React.createElement("span", { className: Saveitemmodules.right }, ((_m = qitem == null ? void 0 : qitem.tag_discipline_names) == null ? void 0 : _m.length) <= 0 ? /* @__PURE__ */ SaveItem_React.createElement("span", { style: { color: "#C1C1C1" } }, "\u6682\u672A\u8BBE\u7F6E~") : ((_n = qitem == null ? void 0 : qitem.tag_discipline_names) == null ? void 0 : _n.length) == 1 && ["-"].includes(qitem == null ? void 0 : qitem.tag_discipline_names[0]) ? /* @__PURE__ */ SaveItem_React.createElement("span", { style: { color: "#C1C1C1" } }, "\u6682\u672A\u8BBE\u7F6E~") : (_p = (_o = qitem == null ? void 0 : qitem.tag_discipline_names) == null ? void 0 : _o.join("\uFF1B")) == null ? void 0 : _p.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__(80156);
|
|
// EXTERNAL MODULE: ./src/components/QuestionEditor/SubjectiveQuestionEditor.tsx
|
|
var QuestionEditor_SubjectiveQuestionEditor = __webpack_require__(87546);
|
|
;// CONCATENATED MODULE: ./src/pages/Paperlibrary/EditPotin/components/Questions/SubjectiveQuestionEditor.tsx
|
|
/* provided dependency */ var SubjectiveQuestionEditor_React = __webpack_require__(/*! react */ 59301);
|
|
var SubjectiveQuestionEditor_defProp = Object.defineProperty;
|
|
var SubjectiveQuestionEditor_defProps = Object.defineProperties;
|
|
var SubjectiveQuestionEditor_getOwnPropDescs = Object.getOwnPropertyDescriptors;
|
|
var SubjectiveQuestionEditor_getOwnPropSymbols = Object.getOwnPropertySymbols;
|
|
var SubjectiveQuestionEditor_hasOwnProp = Object.prototype.hasOwnProperty;
|
|
var SubjectiveQuestionEditor_propIsEnum = Object.prototype.propertyIsEnumerable;
|
|
var SubjectiveQuestionEditor_defNormalProp = (obj, key, value) => key in obj ? SubjectiveQuestionEditor_defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
|
|
var SubjectiveQuestionEditor_spreadValues = (a, b) => {
|
|
for (var prop in b || (b = {}))
|
|
if (SubjectiveQuestionEditor_hasOwnProp.call(b, prop))
|
|
SubjectiveQuestionEditor_defNormalProp(a, prop, b[prop]);
|
|
if (SubjectiveQuestionEditor_getOwnPropSymbols)
|
|
for (var prop of SubjectiveQuestionEditor_getOwnPropSymbols(b)) {
|
|
if (SubjectiveQuestionEditor_propIsEnum.call(b, prop))
|
|
SubjectiveQuestionEditor_defNormalProp(a, prop, b[prop]);
|
|
}
|
|
return a;
|
|
};
|
|
var SubjectiveQuestionEditor_spreadProps = (a, b) => SubjectiveQuestionEditor_defProps(a, SubjectiveQuestionEditor_getOwnPropDescs(b));
|
|
var SubjectiveQuestionEditor_async = (__this, __arguments, generator) => {
|
|
return new Promise((resolve, reject) => {
|
|
var fulfilled = (value) => {
|
|
try {
|
|
step(generator.next(value));
|
|
} catch (e) {
|
|
reject(e);
|
|
}
|
|
};
|
|
var rejected = (value) => {
|
|
try {
|
|
step(generator.throw(value));
|
|
} catch (e) {
|
|
reject(e);
|
|
}
|
|
};
|
|
var step = (x) => x.done ? resolve(x.value) : Promise.resolve(x.value).then(fulfilled, rejected);
|
|
step((generator = generator.apply(__this, __arguments)).next());
|
|
});
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
const SubjectiveQuestionEditor_DragQuestions = ({ qitem, setisedit, TagDiscipline, exerciseitem, seveeditor, deleteitem, getTagData, init }) => {
|
|
const [form] = es_form["default"].useForm();
|
|
(0,_react_17_0_2_react.useEffect)(() => {
|
|
form.setFieldsValue(SubjectiveQuestionEditor_spreadProps(SubjectiveQuestionEditor_spreadValues({}, qitem), {
|
|
name: qitem.question_title,
|
|
answer_texts: qitem.answer_texts,
|
|
repeat_answer: !qitem.repeat_answer
|
|
}));
|
|
}, [qitem]);
|
|
return /* @__PURE__ */ SubjectiveQuestionEditor_React.createElement("div", null, /* @__PURE__ */ SubjectiveQuestionEditor_React.createElement(
|
|
es_form["default"],
|
|
{
|
|
form,
|
|
colon: false,
|
|
onFinish: (values) => {
|
|
seveeditor(SubjectiveQuestionEditor_spreadValues(SubjectiveQuestionEditor_spreadValues({}, qitem), values));
|
|
},
|
|
onFinishFailed: (errInfo) => SubjectiveQuestionEditor_async(void 0, null, function* () {
|
|
var _a, _b;
|
|
message/* default */.ZP.error(errInfo.errorFields[0].errors[0]);
|
|
form.scrollToField((_b = (_a = errInfo == null ? void 0 : errInfo.errorFields) == null ? void 0 : _a[0]) == null ? void 0 : _b.name, { behavior: "smooth", block: "center" });
|
|
})
|
|
},
|
|
/* @__PURE__ */ SubjectiveQuestionEditor_React.createElement("div", { style: { display: "flex", alignItems: "center" } }, /* @__PURE__ */ SubjectiveQuestionEditor_React.createElement("div", { style: { flex: 1 } }, /* @__PURE__ */ SubjectiveQuestionEditor_React.createElement("span", { style: { display: "inline-flex", border: "1px solid #9096A3", borderRadius: "50%", width: 10, height: 10, marginRight: 5, background: "#9096A3" } }), /* @__PURE__ */ SubjectiveQuestionEditor_React.createElement("span", null, "\u7B80\u7B54\u9898")), !(qitem == null ? void 0 : qitem.isadd) && /* @__PURE__ */ SubjectiveQuestionEditor_React.createElement("span", { style: { marginLeft: 20, marginRight: 20, color: "red", cursor: "pointer" }, onClick: () => {
|
|
deleteitem();
|
|
} }, /* @__PURE__ */ SubjectiveQuestionEditor_React.createElement("i", { className: "iconfont icon-piliangshanchu3", style: { fontSize: 14, marginRight: 6 } }), "\u5220\u9664"), /* @__PURE__ */ SubjectiveQuestionEditor_React.createElement(es_button/* default */.ZP, { onClick: () => {
|
|
if (!qitem.isadd) {
|
|
form.setFieldsValue(SubjectiveQuestionEditor_spreadProps(SubjectiveQuestionEditor_spreadValues({}, qitem), {
|
|
name: qitem == null ? void 0 : qitem.question_title,
|
|
answer_texts: qitem.answer_texts || [],
|
|
repeat_answer: !(qitem == null ? void 0 : qitem.repeat_answer)
|
|
}));
|
|
setisedit(false);
|
|
} else {
|
|
setisedit(false);
|
|
init();
|
|
}
|
|
} }, "\u53D6\u6D88"), /* @__PURE__ */ SubjectiveQuestionEditor_React.createElement(es_button/* default */.ZP, { type: "primary", className: "ml20", onClick: () => {
|
|
form.submit();
|
|
} }, "\u4FDD\u5B58")),
|
|
/* @__PURE__ */ SubjectiveQuestionEditor_React.createElement("div", { style: { maxHeight: "70vh", overflowY: "auto", marginTop: "10px", paddingRight: "5px" } }, /* @__PURE__ */ SubjectiveQuestionEditor_React.createElement(es_form["default"].Item, { className: EditPotinmodules.scoreinput, name: "question_score", label: "\u5206\u503C", rules: [{
|
|
required: true,
|
|
message: "\u8BF7\u8F93\u5165\u5206\u503C"
|
|
}] }, /* @__PURE__ */ SubjectiveQuestionEditor_React.createElement(input_number/* default */.Z, { onBlur: (e) => {
|
|
e.target.value === "0" && message/* default */.ZP.error("\u5206\u503C\u5FC5\u987B\u5927\u4E8E0\u4E14\u5C0F\u4E8E\u7B49\u4E8E100");
|
|
}, style: { width: 150 }, precision: 1, placeholder: "\u8BF7\u8F93\u5165\u5206\u503C", max: 100, min: 0.1 })), /* @__PURE__ */ SubjectiveQuestionEditor_React.createElement(
|
|
QuestionEditor_SubjectiveQuestionEditor/* SubjectiveQuestionEditor */.W,
|
|
{
|
|
form,
|
|
showKeywords: true,
|
|
questionTitlePlaceholder: "\u8BF7\u7F16\u8F91\u7B80\u7B54\u9898\u9898\u5E72\u5185\u5BB9"
|
|
}
|
|
), /* @__PURE__ */ SubjectiveQuestionEditor_React.createElement(MoreSetting, { getTagData, qitem, exerciseitem, TagDiscipline, form }))
|
|
));
|
|
};
|
|
/* harmony default export */ var Questions_SubjectiveQuestionEditor = (SubjectiveQuestionEditor_DragQuestions);
|
|
|
|
;// CONCATENATED MODULE: ./src/pages/Paperlibrary/EditPotin/components/Setscore.tsx
|
|
var Setscore_async = (__this, __arguments, generator) => {
|
|
return new Promise((resolve, reject) => {
|
|
var fulfilled = (value) => {
|
|
try {
|
|
step(generator.next(value));
|
|
} catch (e) {
|
|
reject(e);
|
|
}
|
|
};
|
|
var rejected = (value) => {
|
|
try {
|
|
step(generator.throw(value));
|
|
} catch (e) {
|
|
reject(e);
|
|
}
|
|
};
|
|
var step = (x) => x.done ? resolve(x.value) : Promise.resolve(x.value).then(fulfilled, rejected);
|
|
step((generator = generator.apply(__this, __arguments)).next());
|
|
});
|
|
};
|
|
|
|
|
|
|
|
|
|
const SetScore = ({ setScoreShow, ScoreShow, exerciseitem, getdata }) => {
|
|
var _a, _b, _c;
|
|
const [isshow, setisshow] = (0,_react_17_0_2_react.useState)(false);
|
|
function setscore() {
|
|
return Setscore_async(this, null, function* () {
|
|
var _a2, _b2, _c2;
|
|
let question_arr = (_b2 = (_a2 = exerciseitem == null ? void 0 : exerciseitem.exercise_question_types) == null ? void 0 : _a2.filter((item) => item.Singlequestion)) == null ? void 0 : _b2.map((item) => {
|
|
return {
|
|
question_type: item.question_type,
|
|
score: item.Singlequestion
|
|
};
|
|
});
|
|
let res = yield (0,fetch/* default */.ZP)(`/api/examination_banks/${(_c2 = exerciseitem == null ? void 0 : exerciseitem.exercise) == null ? void 0 : _c2.id}/batch_set_score.json`, {
|
|
method: "POST",
|
|
body: {
|
|
question_arr
|
|
}
|
|
});
|
|
if ((res == null ? void 0 : res.status) === 0) {
|
|
getdata();
|
|
}
|
|
});
|
|
}
|
|
return /* @__PURE__ */ _react_17_0_2_react.createElement("div", null, ScoreShow && /* @__PURE__ */ _react_17_0_2_react.createElement(
|
|
modal["default"],
|
|
{
|
|
title: false,
|
|
footer: false,
|
|
open: ScoreShow,
|
|
width: 640,
|
|
centered: true,
|
|
zIndex: 10,
|
|
closable: false,
|
|
className: EditPotinmodules.scoremodal,
|
|
onCancel: () => {
|
|
setScoreShow(false);
|
|
}
|
|
},
|
|
/* @__PURE__ */ _react_17_0_2_react.createElement("div", { style: { display: "flex", alignItems: "center" } }, /* @__PURE__ */ _react_17_0_2_react.createElement("div", { className: EditPotinmodules.title }, "\u6279\u91CF\u8BBE\u7F6E\u5206\u503C", /* @__PURE__ */ _react_17_0_2_react.createElement("div", { className: EditPotinmodules.score }, "\u603B\u5206 ", (exerciseitem == null ? void 0 : exerciseitem.exercise_question_types.length) > 0 && ((_a = exerciseitem == null ? void 0 : exerciseitem.exercise_types) == null ? void 0 : _a.q_scores))), /* @__PURE__ */ _react_17_0_2_react.createElement("span", { onClick: () => setScoreShow(false), className: EditPotinmodules.close }, "X")),
|
|
/* @__PURE__ */ _react_17_0_2_react.createElement("div", { className: EditPotinmodules.content }, /* @__PURE__ */ _react_17_0_2_react.createElement("span", null, "\u9898\u578B\u540D\u79F0"), /* @__PURE__ */ _react_17_0_2_react.createElement("span", null, "\u5C0F\u9898\u603B\u6570"), /* @__PURE__ */ _react_17_0_2_react.createElement("span", null, "\u9898\u578B\u603B\u5206"), /* @__PURE__ */ _react_17_0_2_react.createElement("span", null, "\u64CD\u4F5C")),
|
|
(_c = (_b = exerciseitem == null ? void 0 : exerciseitem.exercise_question_types) == null ? void 0 : _b.filter((item) => item.name !== "\u5B9E\u8BAD\u9898" && item.name !== "\u7EC4\u5408\u9898")) == null ? void 0 : _c.map((item, k) => {
|
|
var _a2;
|
|
return /* @__PURE__ */ _react_17_0_2_react.createElement("div", { key: k, className: EditPotinmodules.items }, /* @__PURE__ */ _react_17_0_2_react.createElement("span", null, item == null ? void 0 : item.name), /* @__PURE__ */ _react_17_0_2_react.createElement("span", null, (_a2 = item == null ? void 0 : item.items) == null ? void 0 : _a2.length), /* @__PURE__ */ _react_17_0_2_react.createElement("span", null, item == null ? void 0 : item.score), /* @__PURE__ */ _react_17_0_2_react.createElement("span", null, "\u6BCF\u9898", /* @__PURE__ */ _react_17_0_2_react.createElement(input_number/* default */.Z, { min: 0.1, max: 100, onChange: (e) => {
|
|
item.Singlequestion = e;
|
|
}, defaultValue: item.Singlequestion, style: { width: 90, height: 38, margin: "0px 10px", display: "flex", alignItems: "center" } }), "\u5206"));
|
|
}),
|
|
/* @__PURE__ */ _react_17_0_2_react.createElement("div", { className: EditPotinmodules.bottom }, /* @__PURE__ */ _react_17_0_2_react.createElement(es_button/* default */.ZP, { className: EditPotinmodules.no, onClick: () => {
|
|
setScoreShow(false);
|
|
} }, "\u53D6\u6D88"), /* @__PURE__ */ _react_17_0_2_react.createElement(es_button/* default */.ZP, { className: EditPotinmodules.yes, onClick: () => {
|
|
var _a2, _b2, _c2;
|
|
if ((exerciseitem == null ? void 0 : exerciseitem.use_blank_score) && ((_c2 = (_b2 = (_a2 = exerciseitem == null ? void 0 : exerciseitem.exercise_question_types) == null ? void 0 : _a2.filter((item) => item.name === "\u586B\u7A7A\u9898")) == null ? void 0 : _b2[0]) == null ? void 0 : _c2.Singlequestion)) {
|
|
setisshow(true);
|
|
return;
|
|
}
|
|
setscore();
|
|
setScoreShow(false);
|
|
} }, "\u786E\u8BA4"))
|
|
), /* @__PURE__ */ _react_17_0_2_react.createElement(
|
|
modal["default"],
|
|
{
|
|
title: false,
|
|
footer: false,
|
|
centered: true,
|
|
open: isshow,
|
|
zIndex: 20,
|
|
width: 640,
|
|
closable: false,
|
|
className: EditPotinmodules.scoremodal
|
|
},
|
|
/* @__PURE__ */ _react_17_0_2_react.createElement("div", { style: { marginTop: 40 } }, "\u586B\u7A7A\u9898\u4E2D\u5B58\u5728", /* @__PURE__ */ _react_17_0_2_react.createElement("span", { style: { color: "#FA6400" } }, "\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__ */ _react_17_0_2_react.createElement("div", { className: EditPotinmodules.bottom }, /* @__PURE__ */ _react_17_0_2_react.createElement(es_button/* default */.ZP, { className: EditPotinmodules.no, onClick: () => {
|
|
setisshow(false);
|
|
} }, "\u53D6\u6D88"), /* @__PURE__ */ _react_17_0_2_react.createElement(es_button/* default */.ZP, { className: EditPotinmodules.yes, onClick: () => {
|
|
setscore();
|
|
setisshow(false);
|
|
setScoreShow(false);
|
|
} }, "\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__(14491);
|
|
// EXTERNAL MODULE: ./node_modules/_antd@5.9.0@antd/es/pagination/index.js + 10 modules
|
|
var pagination = __webpack_require__(53864);
|
|
;// 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","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
|
|
|
|
|
|
|
|
|
|
|
|
const SaveItem_tagDotData = [
|
|
"A\uFF0E",
|
|
"B\uFF0E",
|
|
"C\uFF0E",
|
|
"D\uFF0E",
|
|
"E\uFF0E",
|
|
"F\uFF0E",
|
|
"G\uFF0E",
|
|
"H\uFF0E",
|
|
"I\uFF0E",
|
|
"J\uFF0E",
|
|
"K\uFF0E",
|
|
"L\uFF0E",
|
|
"M\uFF0E",
|
|
"N\uFF0E",
|
|
"O\uFF0E",
|
|
"P\uFF0E",
|
|
"Q\uFF0E",
|
|
"R\uFF0E",
|
|
"S\uFF0E",
|
|
"T\uFF0E",
|
|
"U\uFF0E",
|
|
"V\uFF0E",
|
|
"W\uFF0E",
|
|
"X\uFF0E",
|
|
"Y\uFF0E",
|
|
"Z\uFF0E"
|
|
];
|
|
const AddQuestionsModal_SaveItem_DragQuestions = ({ qitem }) => {
|
|
var _a, _b, _c, _d, _e, _f, _g, _h, _i, _j;
|
|
return /* @__PURE__ */ _react_17_0_2_react.createElement("div", { className: AddQuestionsModal_Saveitemmodules.warp }, /* @__PURE__ */ _react_17_0_2_react.createElement("div", { className: AddQuestionsModal_Saveitemmodules.mainPart }, /* @__PURE__ */ _react_17_0_2_react.createElement("div", { className: AddQuestionsModal_Saveitemmodules.qcount }, (qitem == null ? void 0 : qitem.question_type) === 8 && /* @__PURE__ */ _react_17_0_2_react.createElement(RenderHtml/* default */.Z, { className: AddQuestionsModal_Saveitemmodules.content, showProgramFill: true, value: (_a = qitem == null ? void 0 : qitem.program_attr) == null ? void 0 : _a.description }), (qitem == null ? void 0 : qitem.question_type) != 8 && /* @__PURE__ */ _react_17_0_2_react.createElement(RenderHtml/* default */.Z, { className: AddQuestionsModal_Saveitemmodules.qtitle, value: (qitem == null ? void 0 : qitem.name) || (qitem == null ? void 0 : qitem.title) })), ((qitem == null ? void 0 : qitem.question_type) === 0 || (qitem == null ? void 0 : qitem.question_type) === 2) && /* @__PURE__ */ _react_17_0_2_react.createElement("div", null, (_b = qitem == null ? void 0 : qitem.choices) == null ? void 0 : _b.map((item, index) => /* @__PURE__ */ _react_17_0_2_react.createElement("div", { className: AddQuestionsModal_Saveitemmodules.redio }, !(item == null ? void 0 : item.is_answer) && /* @__PURE__ */ _react_17_0_2_react.createElement("span", { className: AddQuestionsModal_Saveitemmodules.redioitem }), (item == null ? void 0 : item.is_answer) && /* @__PURE__ */ _react_17_0_2_react.createElement("i", { className: `${AddQuestionsModal_Saveitemmodules.redioitemyes} icon-duigou1` }), /* @__PURE__ */ _react_17_0_2_react.createElement(RenderHtml/* default */.Z, { className: (item == null ? void 0 : item.is_answer) ? AddQuestionsModal_Saveitemmodules.titleyes : AddQuestionsModal_Saveitemmodules.title, value: SaveItem_tagDotData[index] + (item == null ? void 0 : item.choice_text) }), (item == null ? void 0 : item.is_answer) && /* @__PURE__ */ _react_17_0_2_react.createElement("div", { className: AddQuestionsModal_Saveitemmodules.yestag }, "\u6B63\u786E\u7B54\u6848")))), (qitem == null ? void 0 : qitem.question_type) === 1 && /* @__PURE__ */ _react_17_0_2_react.createElement("div", null, (_c = qitem == null ? void 0 : qitem.choices) == null ? void 0 : _c.map((item, index) => /* @__PURE__ */ _react_17_0_2_react.createElement("div", { className: AddQuestionsModal_Saveitemmodules.checkbox }, !(item == null ? void 0 : item.is_answer) && /* @__PURE__ */ _react_17_0_2_react.createElement("span", { className: AddQuestionsModal_Saveitemmodules.checkboxitem }), (item == null ? void 0 : item.is_answer) && /* @__PURE__ */ _react_17_0_2_react.createElement("i", { className: `${AddQuestionsModal_Saveitemmodules.checkboxitemyes} icon-duigou1` }), /* @__PURE__ */ _react_17_0_2_react.createElement(RenderHtml/* default */.Z, { className: (item == null ? void 0 : item.is_answer) ? AddQuestionsModal_Saveitemmodules.titleyes : AddQuestionsModal_Saveitemmodules.title, value: SaveItem_tagDotData[index] + (item == null ? void 0 : item.choice_text) }), (item == null ? void 0 : item.is_answer) && /* @__PURE__ */ _react_17_0_2_react.createElement("div", { className: AddQuestionsModal_Saveitemmodules.yestag }, "\u6B63\u786E\u7B54\u6848")))), (qitem == null ? void 0 : qitem.question_type) === 3 && /* @__PURE__ */ _react_17_0_2_react.createElement("div", { className: AddQuestionsModal_Saveitemmodules.completion }, (_d = qitem == null ? void 0 : qitem.standard_answer) == null ? void 0 : _d.map((item, index) => {
|
|
var _a2;
|
|
return /* @__PURE__ */ _react_17_0_2_react.createElement("div", { style: { display: "flex" } }, /* @__PURE__ */ _react_17_0_2_react.createElement("span", { className: AddQuestionsModal_Saveitemmodules.title }, "\u586B\u7A7A\u9879", index + 1), /* @__PURE__ */ _react_17_0_2_react.createElement("div", { className: AddQuestionsModal_Saveitemmodules.content }, (_a2 = item == null ? void 0 : item.answer_text) == null ? void 0 : _a2.map((val, vindex) => /* @__PURE__ */ _react_17_0_2_react.createElement("div", { className: AddQuestionsModal_Saveitemmodules.items }, val))));
|
|
})), (qitem == null ? void 0 : qitem.question_type) === 4 && /* @__PURE__ */ _react_17_0_2_react.createElement("div", { className: AddQuestionsModal_Saveitemmodules.simple }, /* @__PURE__ */ _react_17_0_2_react.createElement("div", { className: AddQuestionsModal_Saveitemmodules.title }, "\u53C2\u8003\u7B54\u6848"), /* @__PURE__ */ _react_17_0_2_react.createElement("div", { className: "mt10", style: { fontSize: "16px" } }, ((_e = qitem == null ? void 0 : qitem.answer_texts) == null ? void 0 : _e[0]) ? /* @__PURE__ */ _react_17_0_2_react.createElement(RenderHtml/* default */.Z, { className: AddQuestionsModal_Saveitemmodules.content, value: (_f = qitem == null ? void 0 : qitem.answer_texts) == null ? void 0 : _f[0] }) : /* @__PURE__ */ _react_17_0_2_react.createElement("div", { style: { color: "#C1C1C1" } }, "\u6682\u672A\u8BBE\u7F6E~"))), (qitem == null ? void 0 : qitem.question_type) === 5 && ((_g = qitem == null ? void 0 : qitem.challenge_names) == null ? void 0 : _g.map((val, vindex) => /* @__PURE__ */ _react_17_0_2_react.createElement("div", { className: AddQuestionsModal_Saveitemmodules.shixun }, /* @__PURE__ */ _react_17_0_2_react.createElement("span", { className: AddQuestionsModal_Saveitemmodules.qtitle }, /* @__PURE__ */ _react_17_0_2_react.createElement("span", { style: { marginRight: 10 } }, "\u7B2C", (0,utils_util/* toChineseNumber */.EM)(vindex + 1), "\u9898"), val)))), (qitem == null ? void 0 : qitem.question_type) === 6 && /* @__PURE__ */ _react_17_0_2_react.createElement("div", { className: AddQuestionsModal_Saveitemmodules.program }, /* @__PURE__ */ _react_17_0_2_react.createElement(RenderHtml/* default */.Z, { className: AddQuestionsModal_Saveitemmodules.content, value: ((_h = qitem == null ? void 0 : qitem.program_attr) == null ? void 0 : _h.description) || "- -" })), (qitem == null ? void 0 : qitem.question_type) === 7 && ((_i = qitem == null ? void 0 : qitem.sub_item_banks) == null ? void 0 : _i.map(
|
|
(val, vndex) => {
|
|
var _a2, _b2, _c2, _d2, _e2;
|
|
return /* @__PURE__ */ _react_17_0_2_react.createElement("div", null, /* @__PURE__ */ _react_17_0_2_react.createElement("div", { className: AddQuestionsModal_Saveitemmodules.combination }, /* @__PURE__ */ _react_17_0_2_react.createElement("span", { className: AddQuestionsModal_Saveitemmodules.qtitle }, val == null ? void 0 : val.name)), /* @__PURE__ */ _react_17_0_2_react.createElement("div", { className: AddQuestionsModal_Saveitemmodules.warp, style: { padding: "0px", paddingTop: 20 } }, /* @__PURE__ */ _react_17_0_2_react.createElement("div", null, ((val == null ? void 0 : val.item_type) == "SINGLE" || (val == null ? void 0 : val.item_type) == "JUDGMENT") && ((_a2 = val == null ? void 0 : val.choices) == null ? void 0 : _a2.map((item, index) => /* @__PURE__ */ _react_17_0_2_react.createElement("div", { className: AddQuestionsModal_Saveitemmodules.redio }, !(item == null ? void 0 : item.is_answer) && /* @__PURE__ */ _react_17_0_2_react.createElement("span", { className: AddQuestionsModal_Saveitemmodules.redioitem }), (item == null ? void 0 : item.is_answer) && /* @__PURE__ */ _react_17_0_2_react.createElement("i", { className: `${AddQuestionsModal_Saveitemmodules.redioitemyes} icon-duigou1` }), /* @__PURE__ */ _react_17_0_2_react.createElement(RenderHtml/* default */.Z, { className: (item == null ? void 0 : item.is_answer) ? AddQuestionsModal_Saveitemmodules.titleyes : AddQuestionsModal_Saveitemmodules.title, value: SaveItem_tagDotData[index] + (item == null ? void 0 : item.choice_text) }), (item == null ? void 0 : item.is_answer) && /* @__PURE__ */ _react_17_0_2_react.createElement("div", { className: AddQuestionsModal_Saveitemmodules.yestag }, "\u6B63\u786E\u7B54\u6848")))), (val == null ? void 0 : val.item_type) == "MULTIPLE" && ((_b2 = val == null ? void 0 : val.choices) == null ? void 0 : _b2.map((item, index) => /* @__PURE__ */ _react_17_0_2_react.createElement("div", { className: AddQuestionsModal_Saveitemmodules.checkbox }, !(item == null ? void 0 : item.is_answer) && /* @__PURE__ */ _react_17_0_2_react.createElement("span", { className: AddQuestionsModal_Saveitemmodules.checkboxitem }), (item == null ? void 0 : item.is_answer) && /* @__PURE__ */ _react_17_0_2_react.createElement("i", { className: `${AddQuestionsModal_Saveitemmodules.checkboxitemyes} icon-duigou1` }), /* @__PURE__ */ _react_17_0_2_react.createElement(RenderHtml/* default */.Z, { className: (item == null ? void 0 : item.is_answer) ? AddQuestionsModal_Saveitemmodules.titleyes : AddQuestionsModal_Saveitemmodules.title, value: SaveItem_tagDotData[index] + (item == null ? void 0 : item.choice_text) }), (item == null ? void 0 : item.is_answer) && /* @__PURE__ */ _react_17_0_2_react.createElement("div", { className: AddQuestionsModal_Saveitemmodules.yestag }, "\u6B63\u786E\u7B54\u6848")))), (val == null ? void 0 : val.item_type) == "COMPLETION" && /* @__PURE__ */ _react_17_0_2_react.createElement("div", { className: AddQuestionsModal_Saveitemmodules.completion }, (_c2 = val == null ? void 0 : val.standard_answer) == null ? void 0 : _c2.map((item, index) => {
|
|
var _a3;
|
|
return /* @__PURE__ */ _react_17_0_2_react.createElement("div", { style: { display: "flex" } }, /* @__PURE__ */ _react_17_0_2_react.createElement("span", { className: AddQuestionsModal_Saveitemmodules.title }, "\u586B\u7A7A\u9879", index + 1), /* @__PURE__ */ _react_17_0_2_react.createElement("div", { className: AddQuestionsModal_Saveitemmodules.content }, (_a3 = item == null ? void 0 : item.answer_text) == null ? void 0 : _a3.map((val2, vindex) => /* @__PURE__ */ _react_17_0_2_react.createElement("div", { className: AddQuestionsModal_Saveitemmodules.items }, val2))));
|
|
})), (val == null ? void 0 : val.item_type) == "SUBJECTIVE" && /* @__PURE__ */ _react_17_0_2_react.createElement("div", { className: AddQuestionsModal_Saveitemmodules.simple }, /* @__PURE__ */ _react_17_0_2_react.createElement("div", { className: AddQuestionsModal_Saveitemmodules.title }, "\u53C2\u8003\u7B54\u6848"), /* @__PURE__ */ _react_17_0_2_react.createElement("div", { className: "mt10", style: { fontSize: "16px" } }, ((_d2 = val == null ? void 0 : val.answer_texts) == null ? void 0 : _d2[0]) ? /* @__PURE__ */ _react_17_0_2_react.createElement(RenderHtml/* default */.Z, { className: AddQuestionsModal_Saveitemmodules.content, value: (_e2 = val == null ? void 0 : val.answer_texts) == null ? void 0 : _e2[0] }) : /* @__PURE__ */ _react_17_0_2_react.createElement("div", { style: { color: "#C1C1C1" } }, "\u6682\u672A\u8BBE\u7F6E~"))))));
|
|
}
|
|
)), (qitem == null ? void 0 : qitem.question_type) === 8 && /* @__PURE__ */ _react_17_0_2_react.createElement("div", null, /* @__PURE__ */ _react_17_0_2_react.createElement(RenderHtml/* default */.Z, { disabledFill: true, className: AddQuestionsModal_Saveitemmodules.content, showProgramFill: true, value: base64.Base64.decode(((_j = qitem == null ? void 0 : qitem.program_attr) == null ? void 0 : _j.code) || "") })), (qitem == null ? void 0 : qitem.question_type) === 5 && /* @__PURE__ */ _react_17_0_2_react.createElement("div", { style: { background: "#F6F7F9", padding: "0px 20px", height: 46, lineHeight: "46px", marginTop: 40, display: "flex", alignItems: "center" } }, /* @__PURE__ */ _react_17_0_2_react.createElement("div", { style: { flex: 1, alignItems: "center", display: "flex" } }, /* @__PURE__ */ _react_17_0_2_react.createElement("div", { style: { marginRight: 30 } }, /* @__PURE__ */ _react_17_0_2_react.createElement("span", { style: { marginRight: 10 } }, "\u521B\u5EFA\u8005"), /* @__PURE__ */ _react_17_0_2_react.createElement("span", { style: { color: "#000000" } }, (qitem == null ? void 0 : qitem.author_name) || "- -")), /* @__PURE__ */ _react_17_0_2_react.createElement("div", { style: { marginRight: 30 } }, /* @__PURE__ */ _react_17_0_2_react.createElement("span", { style: { marginRight: 10 } }, "\u6240\u5C5E\u5355\u4F4D"), /* @__PURE__ */ _react_17_0_2_react.createElement("span", { style: { color: "#000000" } }, (qitem == null ? void 0 : qitem.author_school_name) || "- -")), /* @__PURE__ */ _react_17_0_2_react.createElement("div", { style: { marginRight: 30 } }, /* @__PURE__ */ _react_17_0_2_react.createElement("span", { style: { marginRight: 10 } }, "\u5B66\u4E60\u4EBA\u6570"), /* @__PURE__ */ _react_17_0_2_react.createElement("span", { style: { color: "#000000" } }, (qitem == null ? void 0 : qitem.study_count) || "0"))), /* @__PURE__ */ _react_17_0_2_react.createElement("a", { className: AddQuestionsModal_Saveitemmodules.shixunbutton, href: `/shixuns/${qitem == null ? void 0 : qitem.identifier}/challenges?exercise=true`, target: "_blank" }, /* @__PURE__ */ _react_17_0_2_react.createElement("i", { onClick: () => {
|
|
}, style: { marginRight: 20 }, className: `iconfont icon-shixunkecheng mr5 ` }), "\u5B9E\u8BAD\u8BE6\u60C5"))), ((qitem == null ? void 0 : qitem.question_type) <= 4 || [6, 8].includes(qitem == null ? void 0 : qitem.question_type)) && /* @__PURE__ */ _react_17_0_2_react.createElement("div", { className: AddQuestionsModal_Saveitemmodules.bottom }, /* @__PURE__ */ _react_17_0_2_react.createElement("div", { className: AddQuestionsModal_Saveitemmodules.bottomitem }, /* @__PURE__ */ _react_17_0_2_react.createElement("span", { className: AddQuestionsModal_Saveitemmodules.left }, "\u89E3\u6790"), /* @__PURE__ */ _react_17_0_2_react.createElement("span", { className: AddQuestionsModal_Saveitemmodules.right }, (qitem == null ? void 0 : qitem.analysis) ? /* @__PURE__ */ _react_17_0_2_react.createElement(RenderHtml/* default */.Z, { value: qitem == null ? void 0 : qitem.analysis }) : /* @__PURE__ */ _react_17_0_2_react.createElement("span", { style: { color: "#C1C1C1" } }, "\u6682\u672A\u8BBE\u7F6E~"))), /* @__PURE__ */ _react_17_0_2_react.createElement("div", { className: AddQuestionsModal_Saveitemmodules.bottomitem }, /* @__PURE__ */ _react_17_0_2_react.createElement("span", { className: AddQuestionsModal_Saveitemmodules.left }, "\u96BE\u5EA6"), /* @__PURE__ */ _react_17_0_2_react.createElement("span", { className: AddQuestionsModal_Saveitemmodules.right }, (qitem == null ? void 0 : qitem.difficulty) === 1 ? "\u7B80\u5355" : (qitem == null ? void 0 : qitem.difficulty) === 2 ? "\u9002\u4E2D" : "\u56F0\u96BE")), /* @__PURE__ */ _react_17_0_2_react.createElement("div", { className: AddQuestionsModal_Saveitemmodules.bottomitem }, /* @__PURE__ */ _react_17_0_2_react.createElement("span", { className: AddQuestionsModal_Saveitemmodules.left }, "\u77E5\u8BC6\u70B9"), /* @__PURE__ */ _react_17_0_2_react.createElement("span", { className: AddQuestionsModal_Saveitemmodules.right }, (qitem == null ? void 0 : qitem.tag_discipline) ? qitem == null ? void 0 : qitem.tag_discipline : /* @__PURE__ */ _react_17_0_2_react.createElement("span", { style: { color: "#C1C1C1" } }, "\u6682\u672A\u8BBE\u7F6E~")))));
|
|
};
|
|
/* harmony default export */ var AddQuestionsModal_SaveItem = (AddQuestionsModal_SaveItem_DragQuestions);
|
|
|
|
// EXTERNAL MODULE: ./src/assets/images/paper/shengxu.svg
|
|
var shengxu = __webpack_require__(60113);
|
|
// EXTERNAL MODULE: ./src/assets/images/paper/jiangxu.svg
|
|
var jiangxu = __webpack_require__(5135);
|
|
;// CONCATENATED MODULE: ./src/pages/Paperlibrary/EditPotin/components/AddQuestionsModal/index.tsx
|
|
/* provided dependency */ var AddQuestionsModal_React = __webpack_require__(/*! react */ 59301);
|
|
var AddQuestionsModal_defProp = Object.defineProperty;
|
|
var AddQuestionsModal_defProps = Object.defineProperties;
|
|
var AddQuestionsModal_getOwnPropDescs = Object.getOwnPropertyDescriptors;
|
|
var AddQuestionsModal_getOwnPropSymbols = Object.getOwnPropertySymbols;
|
|
var AddQuestionsModal_hasOwnProp = Object.prototype.hasOwnProperty;
|
|
var AddQuestionsModal_propIsEnum = Object.prototype.propertyIsEnumerable;
|
|
var AddQuestionsModal_defNormalProp = (obj, key, value) => key in obj ? AddQuestionsModal_defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
|
|
var AddQuestionsModal_spreadValues = (a, b) => {
|
|
for (var prop in b || (b = {}))
|
|
if (AddQuestionsModal_hasOwnProp.call(b, prop))
|
|
AddQuestionsModal_defNormalProp(a, prop, b[prop]);
|
|
if (AddQuestionsModal_getOwnPropSymbols)
|
|
for (var prop of AddQuestionsModal_getOwnPropSymbols(b)) {
|
|
if (AddQuestionsModal_propIsEnum.call(b, prop))
|
|
AddQuestionsModal_defNormalProp(a, prop, b[prop]);
|
|
}
|
|
return a;
|
|
};
|
|
var AddQuestionsModal_spreadProps = (a, b) => AddQuestionsModal_defProps(a, AddQuestionsModal_getOwnPropDescs(b));
|
|
var AddQuestionsModal_async = (__this, __arguments, generator) => {
|
|
return new Promise((resolve, reject) => {
|
|
var fulfilled = (value) => {
|
|
try {
|
|
step(generator.next(value));
|
|
} catch (e) {
|
|
reject(e);
|
|
}
|
|
};
|
|
var rejected = (value) => {
|
|
try {
|
|
step(generator.throw(value));
|
|
} catch (e) {
|
|
reject(e);
|
|
}
|
|
};
|
|
var step = (x) => x.done ? resolve(x.value) : Promise.resolve(x.value).then(fulfilled, rejected);
|
|
step((generator = generator.apply(__this, __arguments)).next());
|
|
});
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
const AddQuestionsModal_AddModal = ({ setScoreShow, ScoreShow, onOk, isshixuns, isloadings, dispatch, shixunsDetail }) => {
|
|
var _a, _b, _c;
|
|
let [param, setparam] = (0,_react_17_0_2_react.useState)({
|
|
type: "0",
|
|
page: 1,
|
|
per_page: 10,
|
|
updated_at: "",
|
|
quotes: ""
|
|
// item_type: 'SINGLE',
|
|
});
|
|
let [courseOptions, setcourseOptions] = (0,_react_17_0_2_react.useState)([]);
|
|
let [checkitems, setcheckitems] = (0,_react_17_0_2_react.useState)([]);
|
|
let [listitems, setlistitems] = (0,_react_17_0_2_react.useState)([]);
|
|
let [datas, setdatas] = (0,_react_17_0_2_react.useState)([]);
|
|
const [loading, setloading] = (0,_react_17_0_2_react.useState)(false);
|
|
const [form] = es_form["default"].useForm();
|
|
const [qitem, setqitem] = (0,_react_17_0_2_react.useState)();
|
|
const [isshow, setisshow] = (0,_react_17_0_2_react.useState)(false);
|
|
let [isshixun, setisshixun] = (0,_react_17_0_2_react.useState)(isshixuns);
|
|
const [ShiXunListItems, setshixunitems] = (0,_react_17_0_2_react.useState)([]);
|
|
const [addcount, setaddcount] = (0,_react_17_0_2_react.useState)(0);
|
|
const [indexi, setindexi] = (0,_react_17_0_2_react.useState)(true);
|
|
const [grouplist, setgrouplist] = (0,_react_17_0_2_react.useState)([]);
|
|
const typeData = [
|
|
{ name: "\u5168\u90E8", value: "", question_type: 0 },
|
|
{ name: "\u5355\u9009\u9898", value: "SINGLE", question_type: 0 },
|
|
{ name: "\u591A\u9009\u9898", value: "MULTIPLE", question_type: 1 },
|
|
{ name: "\u5224\u65AD\u9898", value: "JUDGMENT", question_type: 2 },
|
|
{ name: "\u586B\u7A7A\u9898", value: "COMPLETION", question_type: 3 },
|
|
{ name: "\u7B80\u7B54\u9898", value: "SUBJECTIVE", question_type: 4 },
|
|
{ name: "\u5B9E\u8BAD\u9898", value: "SHIXUN", question_type: 5 },
|
|
{ name: "\u7F16\u7A0B\u9898", value: "PROGRAM", question_type: 6 },
|
|
{ name: "\u7EC4\u5408\u9898", value: "COMBINATION", question_type: 7 },
|
|
{ name: "\u7A0B\u5E8F\u586B\u7A7A\u9898", value: "BPROGRAM", question_type: 8 }
|
|
];
|
|
const [checkedItemsArr, setCheckedItemsArr] = (0,_react_17_0_2_react.useState)([]);
|
|
const selectedShixunId = (0,_react_17_0_2_react.useRef)(/* @__PURE__ */ new Set());
|
|
const selectedQuestionId = (0,_react_17_0_2_react.useRef)(/* @__PURE__ */ new Set());
|
|
const difficultyData = [
|
|
{ name: "\u7B80\u5355", value: 1 },
|
|
{ name: "\u9002\u4E2D", value: 2 },
|
|
{ name: "\u56F0\u96BE", value: 3 }
|
|
];
|
|
const diff = [
|
|
{ name: "\u521D\u7EA7", value: 1 },
|
|
{ name: "\u4E2D\u7EA7", value: 2 },
|
|
{ name: "\u4E2D\u9AD8\u7EA7", value: 3 },
|
|
{ name: "\u9AD8\u7EA7", value: 4 }
|
|
];
|
|
const shixunStatus = [
|
|
{ name: "\u672A\u53D1\u5E03", value: "unpublish" },
|
|
{ name: "\u9759\u9ED8\u53D1\u5E03", value: "silent_publish" },
|
|
{ name: "\u516C\u5F00\u53D1\u5E03", value: "public_publish" }
|
|
];
|
|
const [showClearButton, setShowClearButton] = (0,_react_17_0_2_react.useState)(false);
|
|
const handleClearButtonClick = () => {
|
|
form.resetFields();
|
|
isshixun = false;
|
|
setisshixun(false);
|
|
setShowClearButton(false);
|
|
form.submit();
|
|
};
|
|
(0,_react_17_0_2_react.useEffect)(() => {
|
|
if (ScoreShow) {
|
|
form.setFieldsValue({
|
|
item_type: "",
|
|
courseid: "",
|
|
tag_discipline_id: null,
|
|
difficulty: null,
|
|
keyword: null
|
|
});
|
|
if (indexi && isshixun) {
|
|
form.setFieldsValue({
|
|
item_type: "SHIXUN"
|
|
});
|
|
param.item_type = "SHIXUN";
|
|
setparam(AddQuestionsModal_spreadValues({}, param));
|
|
setindexi(false);
|
|
}
|
|
getdatas(param);
|
|
getdisciplines();
|
|
getwjj();
|
|
}
|
|
}, [ScoreShow]);
|
|
(0,_react_17_0_2_react.useEffect)(() => {
|
|
if (addcount > 0) {
|
|
setTimeout(() => {
|
|
setaddcount(0);
|
|
}, 2e3);
|
|
}
|
|
}, [addcount]);
|
|
function getdatas(params) {
|
|
return AddQuestionsModal_async(this, null, function* () {
|
|
var _a2, _b2;
|
|
setloading(true);
|
|
setparam(AddQuestionsModal_spreadValues({}, params));
|
|
if ((listitems == null ? void 0 : listitems.length) <= 0 && params.type === "5") {
|
|
setdatas([]);
|
|
setloading(false);
|
|
return;
|
|
}
|
|
let ids = params.type === "5" ? listitems == null ? void 0 : listitems.filter((item) => !ShiXunListItems.includes(item)) : null;
|
|
let shixun_ids = params.type === "5" ? listitems == null ? void 0 : listitems.filter((item) => ShiXunListItems.includes(item)) : null;
|
|
let res = yield (0,fetch/* default */.ZP)(`/api/item_banks.json`, {
|
|
method: "get",
|
|
params: AddQuestionsModal_spreadProps(AddQuestionsModal_spreadValues({}, params), {
|
|
discipline_id: ((_a2 = params == null ? void 0 : params.courseid) == null ? void 0 : _a2[0]) || null,
|
|
sub_discipline_id: ((_b2 = params == null ? void 0 : params.courseid) == null ? void 0 : _b2[1]) || null,
|
|
ids,
|
|
shixun_ids,
|
|
include_shixuns: true,
|
|
keyword: params.keyword ? encodeURIComponent(params.keyword) : params.keyword,
|
|
type: params.type === "5" ? null : params.type,
|
|
clazz: params.type === "3" ? "ItemBanksGroup" : null
|
|
// ids:listitems
|
|
})
|
|
});
|
|
setdatas(res);
|
|
setloading(false);
|
|
});
|
|
}
|
|
function getdisciplines() {
|
|
return AddQuestionsModal_async(this, null, function* () {
|
|
let res = yield (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"
|
|
}
|
|
});
|
|
setcourseOptions((0,util/* formatCourseOptions */.L)(res == null ? void 0 : res.disciplines));
|
|
});
|
|
}
|
|
function getwjj() {
|
|
return AddQuestionsModal_async(this, null, function* () {
|
|
let res = yield (0,fetch/* default */.ZP)(`/api/item_banks_groups/all_groups.json`, {
|
|
method: "get"
|
|
});
|
|
if ((res == null ? void 0 : res.status) === 0) {
|
|
setgrouplist(res);
|
|
}
|
|
});
|
|
}
|
|
function getmy(params) {
|
|
return AddQuestionsModal_async(this, null, function* () {
|
|
var _a2, _b2, _c2, _d;
|
|
setloading(true);
|
|
let ids = (_a2 = params.list) == null ? void 0 : _a2.filter((item) => !ShiXunListItems.includes(item));
|
|
let shixun_ids = (_b2 = params.list) == null ? void 0 : _b2.filter((item) => ShiXunListItems.includes(item));
|
|
if (ids.length === 0 && shixun_ids.length === 0) {
|
|
setloading(false);
|
|
setdatas([]);
|
|
return;
|
|
}
|
|
let res = yield (0,fetch/* default */.ZP)(`/api/item_banks.json`, {
|
|
method: "get",
|
|
params: AddQuestionsModal_spreadProps(AddQuestionsModal_spreadValues({}, params), {
|
|
discipline_id: ((_c2 = params == null ? void 0 : params.courseid) == null ? void 0 : _c2[0]) || null,
|
|
sub_discipline_id: ((_d = params == null ? void 0 : params.courseid) == null ? void 0 : _d[1]) || null,
|
|
ids,
|
|
shixun_ids,
|
|
type: params.type === "5" ? null : params.type,
|
|
clazz: params.type === "3" ? "ItemBanksGroup" : null
|
|
// ids:listitems
|
|
})
|
|
});
|
|
setloading(false);
|
|
setdatas(res);
|
|
});
|
|
}
|
|
const handleRelease = (identifier) => AddQuestionsModal_async(void 0, null, function* () {
|
|
const res = yield dispatch({
|
|
type: "shixunsDetail/release",
|
|
payload: { id: identifier }
|
|
});
|
|
let tagPosition = res == null ? void 0 : res.tag_position;
|
|
let evaluationSetPosition = (res == null ? void 0 : res.evaluation_set_position) || [];
|
|
let publishBoxStatus = res.status;
|
|
if (publishBoxStatus === 0) {
|
|
message/* default */.ZP.success("\u53D1\u5E03\u6210\u529F");
|
|
getdatas(param);
|
|
return true;
|
|
} else if (publishBoxStatus === 2) {
|
|
message/* default */.ZP.error(`\u7B2C${evaluationSetPosition.join(",")}\u5173\u5C1A\u672A\u5B8C\u6210\uFF0C\u65E0\u6CD5\u7533\u8BF7\u53D1\u5E03`);
|
|
} else if (publishBoxStatus === 3) {
|
|
message/* default */.ZP.error(`\u6BCF\u4E00\u4E2A\u5173\u5361\u81F3\u5C11\u9700\u8981\u4E00\u4E2A\u6280\u80FD\u6807\u7B7E, \u7B2C${tagPosition.join(",")}\u5173\u5C1A\u672A\u8BBE\u7F6E\u6280\u80FD\u6807\u7B7E\uFF0C\u8BF7\u8865\u5145`);
|
|
} else {
|
|
message/* default */.ZP.error("\u5C1A\u672A\u521B\u5EFA\u4EFB\u52A1\u7684\u5B9E\u8BAD\uFF0C\u4E0D\u80FD\u7533\u8BF7\u53D1\u5E03");
|
|
}
|
|
return false;
|
|
});
|
|
const tootlipName = (record) => {
|
|
return (record == null ? void 0 : record.shixun_tag_num) === 1 ? "\u672A\u53D1\u5E03\u7684\u5B9E\u8DF5\u9879\u76EE\u4E0D\u80FD\u88AB\u9009\u7528\uFF0C\u8BF7\u5148\u8FDB\u884C\u53D1\u5E03" : "";
|
|
};
|
|
return /* @__PURE__ */ AddQuestionsModal_React.createElement("div", null, /* @__PURE__ */ AddQuestionsModal_React.createElement(
|
|
modal["default"],
|
|
{
|
|
title: false,
|
|
footer: false,
|
|
open: ScoreShow,
|
|
width: 1200,
|
|
centered: true,
|
|
className: AddQuestionsModalmodules.scoremodal,
|
|
onCancel: () => {
|
|
setScoreShow(false);
|
|
}
|
|
},
|
|
/* @__PURE__ */ AddQuestionsModal_React.createElement("div", { style: { display: "flex", alignItems: "center" } }, /* @__PURE__ */ AddQuestionsModal_React.createElement("div", { className: AddQuestionsModalmodules.title }, "\u9898\u5E93\u9009\u9898")),
|
|
/* @__PURE__ */ AddQuestionsModal_React.createElement(
|
|
tabs["default"],
|
|
{
|
|
className: AddQuestionsModalmodules.tabWrap,
|
|
activeKey: param.type,
|
|
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
|
|
});
|
|
if ((param == null ? void 0 : param.item_type) === "SHIXUN" && param.type !== "5") {
|
|
isshixun = true;
|
|
setisshixun(true);
|
|
}
|
|
setShowClearButton(false);
|
|
if (param.type === "5") {
|
|
isshixun = false;
|
|
setisshixun(false);
|
|
}
|
|
setparam(AddQuestionsModal_spreadValues({}, param));
|
|
getdatas(AddQuestionsModal_spreadValues({}, param));
|
|
},
|
|
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__ */ AddQuestionsModal_React.createElement("div", null, "\u5DF2\u9009", listitems.length > 0 && /* @__PURE__ */ AddQuestionsModal_React.createElement("span", { className: AddQuestionsModalmodules.titlecount }, listitems.length), addcount > 0 && /* @__PURE__ */ AddQuestionsModal_React.createElement("span", { className: AddQuestionsModalmodules.add }, "+", addcount)),
|
|
key: "5"
|
|
}
|
|
]
|
|
}
|
|
),
|
|
/* @__PURE__ */ AddQuestionsModal_React.createElement(
|
|
es_form["default"],
|
|
{
|
|
layout: "inline",
|
|
form,
|
|
onValuesChange: (values, items) => {
|
|
const hasFilter = Object.values(items).some((value) => value !== null && value !== "" && value !== void 0);
|
|
const isInputEmpty = items.keyword === "";
|
|
setShowClearButton(hasFilter || !isInputEmpty);
|
|
param.page = 1;
|
|
if ((items == null ? 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 ? void 0 : values.courseid) {
|
|
form.setFieldsValue({
|
|
tag_discipline_id: ""
|
|
});
|
|
}
|
|
setisshixun(false);
|
|
if (values.keyword || values.keyword === "") {
|
|
return;
|
|
}
|
|
form.submit();
|
|
}
|
|
},
|
|
onFinish: (values) => {
|
|
setparam(AddQuestionsModal_spreadValues(AddQuestionsModal_spreadValues({}, param), values));
|
|
getdatas(AddQuestionsModal_spreadValues(AddQuestionsModal_spreadValues({}, param), values));
|
|
}
|
|
},
|
|
/* @__PURE__ */ AddQuestionsModal_React.createElement(es_form["default"].Item, { name: "item_type" }, /* @__PURE__ */ AddQuestionsModal_React.createElement(
|
|
es_select["default"],
|
|
{
|
|
className: AddQuestionsModalmodules.selectWrapper,
|
|
placeholder: "\u9898\u578B",
|
|
style: { width: 110 },
|
|
size: "middle"
|
|
},
|
|
typeData.map((item) => /* @__PURE__ */ AddQuestionsModal_React.createElement(es_select["default"].Option, { key: item.value }, item.name))
|
|
)),
|
|
/* @__PURE__ */ AddQuestionsModal_React.createElement(es_form["default"].Item, { name: "courseid" }, /* @__PURE__ */ AddQuestionsModal_React.createElement(
|
|
cascader/* default */.Z,
|
|
{
|
|
className: AddQuestionsModalmodules.selectWrapper,
|
|
style: { width: 160 },
|
|
size: "middle",
|
|
placeholder: "\u65B9\u5411&\u8BFE\u7A0B",
|
|
options: courseOptions
|
|
}
|
|
)),
|
|
!isshixun && /* @__PURE__ */ AddQuestionsModal_React.createElement(es_form["default"].Item, { name: "tag_discipline_id" }, /* @__PURE__ */ AddQuestionsModal_React.createElement(
|
|
es_select["default"],
|
|
{
|
|
className: AddQuestionsModalmodules.selectWrapper,
|
|
placeholder: "\u77E5\u8BC6\u70B9",
|
|
style: { width: 160 },
|
|
size: "middle",
|
|
allowClear: true
|
|
},
|
|
(_a = datas == null ? void 0 : datas.tag_disciplines) == null ? void 0 : _a.map((item) => /* @__PURE__ */ AddQuestionsModal_React.createElement(es_select["default"].Option, { key: item.id }, item.name))
|
|
)),
|
|
/* @__PURE__ */ AddQuestionsModal_React.createElement(es_form["default"].Item, { name: isshixun ? "diff" : "difficulty" }, /* @__PURE__ */ AddQuestionsModal_React.createElement(
|
|
es_select["default"],
|
|
{
|
|
className: AddQuestionsModalmodules.selectWrapper,
|
|
placeholder: "\u96BE\u5EA6",
|
|
style: { width: 118 },
|
|
size: "middle",
|
|
allowClear: true
|
|
},
|
|
!isshixun && difficultyData.map((item) => /* @__PURE__ */ AddQuestionsModal_React.createElement(es_select["default"].Option, { key: item.value }, item.name)),
|
|
isshixun && diff.map((item) => /* @__PURE__ */ AddQuestionsModal_React.createElement(es_select["default"].Option, { key: item.value }, item.name))
|
|
)),
|
|
isshixun && /* @__PURE__ */ AddQuestionsModal_React.createElement(es_form["default"].Item, { name: "shixun_publish_status" }, /* @__PURE__ */ AddQuestionsModal_React.createElement(
|
|
es_select["default"],
|
|
{
|
|
className: AddQuestionsModalmodules.selectWrapper,
|
|
placeholder: "\u5168\u90E8\u72B6\u6001",
|
|
style: { width: 118 },
|
|
size: "middle",
|
|
allowClear: true
|
|
},
|
|
shixunStatus.map((item) => /* @__PURE__ */ AddQuestionsModal_React.createElement(es_select["default"].Option, { key: item.value }, item.name))
|
|
)),
|
|
(param.type === "3" || param.type === "0") && !isshixun && /* @__PURE__ */ AddQuestionsModal_React.createElement(es_form["default"].Item, { name: "group_id" }, /* @__PURE__ */ AddQuestionsModal_React.createElement(
|
|
es_select["default"],
|
|
{
|
|
className: AddQuestionsModalmodules.selectWrapper,
|
|
placeholder: "\u6587\u4EF6\u5939",
|
|
style: { width: 118 },
|
|
size: "middle",
|
|
showSearch: true,
|
|
allowClear: true,
|
|
filterOption: (inputValue, option) => {
|
|
console.log("---", inputValue, option);
|
|
return option.children.toUpperCase().indexOf(inputValue.toUpperCase()) !== -1;
|
|
}
|
|
},
|
|
/* @__PURE__ */ AddQuestionsModal_React.createElement(es_select["default"].Option, { key: 0 }, "\u6839\u76EE\u5F55"),
|
|
param.type === "3" && ((_b = grouplist == null ? void 0 : grouplist.share_banks_groups) == null ? void 0 : _b.map((item) => /* @__PURE__ */ AddQuestionsModal_React.createElement(es_select["default"].Option, { key: item.id }, item.name))),
|
|
param.type === "0" && ((_c = grouplist == null ? void 0 : grouplist.my_banks_groups) == null ? void 0 : _c.map((item) => /* @__PURE__ */ AddQuestionsModal_React.createElement(es_select["default"].Option, { key: item.id }, item.name)))
|
|
)),
|
|
showClearButton && /* @__PURE__ */ AddQuestionsModal_React.createElement("span", { className: AddQuestionsModalmodules.allqingchu, onClick: handleClearButtonClick }, /* @__PURE__ */ AddQuestionsModal_React.createElement("i", { className: "iconfont icon-guanbi4" }), /* @__PURE__ */ AddQuestionsModal_React.createElement("span", null, "\u6E05\u9664\u7B5B\u9009\u6761\u4EF6")),
|
|
/* @__PURE__ */ AddQuestionsModal_React.createElement(es_form["default"].Item, { style: { flex: "0 0 auto", marginRight: 0, marginLeft: "auto" }, name: "keyword" }, /* @__PURE__ */ AddQuestionsModal_React.createElement(
|
|
input["default"].Search,
|
|
{
|
|
className: AddQuestionsModalmodules.search,
|
|
placeholder: "\u8BF7\u8F93\u5165\u5173\u952E\u8BCD\u641C\u7D22",
|
|
allowClear: true,
|
|
suffix: /* @__PURE__ */ AddQuestionsModal_React.createElement("i", { className: `iconfont icon-sousuo9 font14 ${AddQuestionsModalmodules.searchIcon}`, onClick: () => form.submit() }),
|
|
onSearch: (value) => {
|
|
form.submit();
|
|
}
|
|
}
|
|
))
|
|
),
|
|
/* @__PURE__ */ AddQuestionsModal_React.createElement("div", { style: { background: "#F6F7F9", display: "flex", alignItems: "center", marginTop: 18, height: 40, paddingLeft: 10, paddingRight: 20 } }, /* @__PURE__ */ AddQuestionsModal_React.createElement("div", { onClick: () => {
|
|
if (param.updated_at === "asc") {
|
|
param.updated_at = "desc";
|
|
} else {
|
|
param.updated_at = "asc";
|
|
}
|
|
setparam(AddQuestionsModal_spreadProps(AddQuestionsModal_spreadValues({}, param), { page: 1 }));
|
|
getdatas(AddQuestionsModal_spreadProps(AddQuestionsModal_spreadValues({}, param), { page: 1 }));
|
|
} }, " ", !param.updated_at ? /* @__PURE__ */ AddQuestionsModal_React.createElement(
|
|
"i",
|
|
{
|
|
style: { fontSize: "14px" },
|
|
className: `iconfont icon-jiangxu mr5 c-light-primary`
|
|
}
|
|
) : /* @__PURE__ */ AddQuestionsModal_React.createElement(
|
|
"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__ */ AddQuestionsModal_React.createElement("div", { onClick: () => {
|
|
if (param.quotes === "asc") {
|
|
param.quotes = "desc";
|
|
} else {
|
|
param.quotes = "asc";
|
|
}
|
|
setparam(AddQuestionsModal_spreadProps(AddQuestionsModal_spreadValues({}, param), { page: 1 }));
|
|
getdatas(AddQuestionsModal_spreadProps(AddQuestionsModal_spreadValues({}, param), { page: 1 }));
|
|
}, style: { marginLeft: 20 } }, " ", !param.quotes ? /* @__PURE__ */ AddQuestionsModal_React.createElement(
|
|
"i",
|
|
{
|
|
style: { fontSize: "14px" },
|
|
className: `iconfont icon-jiangxu mr5 c-light-primary`
|
|
}
|
|
) : /* @__PURE__ */ AddQuestionsModal_React.createElement(
|
|
"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__ */ AddQuestionsModal_React.createElement(
|
|
table["default"],
|
|
{
|
|
style: { marginTop: 2, marginBottom: 20 },
|
|
scroll: {
|
|
y: 260
|
|
},
|
|
dataSource: (datas == null ? void 0 : datas.items) || (datas == null ? void 0 : datas.shixun_list),
|
|
pagination: false,
|
|
loading,
|
|
rowKey: (e) => e.id,
|
|
rowSelection: {
|
|
type: "checkbox",
|
|
selectedRowKeys: checkitems,
|
|
getCheckboxProps: (record) => ({
|
|
disabled: record.shixun_tag_num === 1
|
|
}),
|
|
onSelect(record, selected, selectedRows) {
|
|
if (selected) {
|
|
if (isshixun) {
|
|
setshixunitems([...ShiXunListItems, record.id]);
|
|
}
|
|
setcheckitems([...checkitems, record.id]);
|
|
setCheckedItemsArr([...checkedItemsArr, record]);
|
|
if (record.identifier) {
|
|
selectedShixunId.current.add(record.id);
|
|
} else {
|
|
selectedQuestionId.current.add(record.id);
|
|
}
|
|
setaddcount(1);
|
|
setlistitems([...listitems, record.id]);
|
|
} else {
|
|
const newData = checkedItemsArr.filter((item) => item.id !== record.id);
|
|
setCheckedItemsArr(newData);
|
|
const arr = newData.map((item) => {
|
|
return item.id;
|
|
});
|
|
setcheckitems([...arr]);
|
|
if (record.identifier) {
|
|
selectedShixunId.current.delete(record.id);
|
|
} else {
|
|
selectedQuestionId.current.delete(record.id);
|
|
}
|
|
let list = listitems.filter((item) => item !== record.id);
|
|
setlistitems(list);
|
|
if (isshixun) {
|
|
let list2 = ShiXunListItems.filter((item) => item !== record.id);
|
|
setshixunitems([...list2]);
|
|
}
|
|
if (param.type === "5") {
|
|
getmy(AddQuestionsModal_spreadProps(AddQuestionsModal_spreadValues({}, param), { list: [...list] }));
|
|
return;
|
|
}
|
|
}
|
|
},
|
|
onSelectAll(selected, selectedRows, changeRows) {
|
|
if (!selected) {
|
|
const arr = changeRows.map((item) => item.id);
|
|
const newArr = checkitems.filter((item) => !arr.some((ele) => ele === item));
|
|
const newArr1 = checkedItemsArr.filter((item) => !arr.some((ele) => ele === item.id));
|
|
setCheckedItemsArr(newArr1);
|
|
setcheckitems([...newArr]);
|
|
setlistitems([...newArr]);
|
|
if (isshixun) {
|
|
let list2 = ShiXunListItems.filter((item) => !arr.some((ele) => ele === item.id));
|
|
setshixunitems([...list2]);
|
|
}
|
|
if (param.type === "5") {
|
|
getmy(AddQuestionsModal_spreadProps(AddQuestionsModal_spreadValues({}, param), { list: [...newArr] }));
|
|
}
|
|
for (const item of arr) {
|
|
if (item.identifier) {
|
|
selectedShixunId.current.delete(item);
|
|
} else {
|
|
selectedQuestionId.current.delete(item);
|
|
}
|
|
}
|
|
} else {
|
|
const arr1 = changeRows.map((item) => item.id);
|
|
if (isshixun) {
|
|
setshixunitems([...ShiXunListItems, ...arr1]);
|
|
}
|
|
setCheckedItemsArr([...checkedItemsArr, ...changeRows]);
|
|
setcheckitems([...checkitems, ...arr1]);
|
|
setlistitems([...listitems, ...arr1]);
|
|
for (const item of changeRows) {
|
|
if (item.identifier) {
|
|
selectedShixunId.current.add(item.id);
|
|
} else {
|
|
selectedQuestionId.current.add(item.id);
|
|
}
|
|
}
|
|
}
|
|
}
|
|
},
|
|
columns: [
|
|
{
|
|
title: "\u9898\u578B",
|
|
dataIndex: "item_type",
|
|
key: "item_type",
|
|
render: (value, record, index) => {
|
|
var _a2, _b2;
|
|
return /* @__PURE__ */ AddQuestionsModal_React.createElement(tooltip/* default */.Z, { title: tootlipName(record) }, /* @__PURE__ */ AddQuestionsModal_React.createElement("div", null, isshixun || (record == null ? void 0 : record.challenge_names) ? "\u5B9E\u8BAD\u9898" : (_b2 = (_a2 = typeData == null ? void 0 : typeData.filter((item) => item.value === value)) == null ? void 0 : _a2[0]) == null ? void 0 : _b2.name));
|
|
}
|
|
},
|
|
{
|
|
title: "\u8BD5\u9898\u540D\u79F0",
|
|
dataIndex: "name",
|
|
width: isshixun ? "30%" : "60%",
|
|
key: "name",
|
|
render: (value, record, index) => {
|
|
var _a2;
|
|
return /* @__PURE__ */ AddQuestionsModal_React.createElement(tooltip/* default */.Z, { title: tootlipName(record) }, /* @__PURE__ */ AddQuestionsModal_React.createElement("span", null, /* @__PURE__ */ AddQuestionsModal_React.createElement(RenderHtml/* default */.Z, { key: 1, showLines: 1, showTextOnly: true, value: isshixun || (record == null ? void 0 : record.challenge_names) ? (record == null ? void 0 : record.title) || value === null ? "--" : value : (record == null ? void 0 : record.item_type) == "BPROGRAM" ? (_a2 = record == null ? void 0 : record.program_attr) == null ? void 0 : _a2.description : value })));
|
|
}
|
|
},
|
|
{
|
|
title: "\u521B\u5EFA\u8005",
|
|
dataIndex: "author_name",
|
|
key: "author_name",
|
|
hidden: !isshixun,
|
|
render: (value, record, index) => {
|
|
var _a2;
|
|
return /* @__PURE__ */ AddQuestionsModal_React.createElement(tooltip/* default */.Z, { title: tootlipName(record) }, /* @__PURE__ */ AddQuestionsModal_React.createElement("span", null, value ? (_a2 = value == null ? void 0 : value.split("\u3001")) == null ? void 0 : _a2[0] : "- -"));
|
|
}
|
|
},
|
|
{
|
|
title: "\u6240\u5C5E\u5355\u4F4D",
|
|
dataIndex: "author_school_name",
|
|
key: "author_school_name",
|
|
hidden: !isshixun,
|
|
render: (value, record, index) => {
|
|
return /* @__PURE__ */ AddQuestionsModal_React.createElement(tooltip/* default */.Z, { title: tootlipName(record) }, /* @__PURE__ */ AddQuestionsModal_React.createElement("span", null, value || "- -"));
|
|
}
|
|
},
|
|
{
|
|
title: "\u96BE\u5EA6",
|
|
dataIndex: "difficulty",
|
|
key: "difficulty",
|
|
render: (value, record, index) => {
|
|
var _a2, _b2, _c2, _d;
|
|
return /* @__PURE__ */ AddQuestionsModal_React.createElement(tooltip/* default */.Z, { title: tootlipName(record) }, /* @__PURE__ */ AddQuestionsModal_React.createElement("div", null, isshixun || (record == null ? void 0 : record.challenge_names) ? (record == null ? void 0 : record.level) || ((_b2 = (_a2 = difficultyData == null ? void 0 : difficultyData.filter((item) => item.value === value)) == null ? void 0 : _a2[0]) == null ? void 0 : _b2.name) : (_d = (_c2 = difficultyData == null ? void 0 : difficultyData.filter((item) => item.value === value)) == null ? void 0 : _c2[0]) == null ? void 0 : _d.name));
|
|
}
|
|
},
|
|
{
|
|
title: "\u5173\u5361\u6570\u91CF",
|
|
dataIndex: "challenges_count",
|
|
key: "challenges_count",
|
|
hidden: !isshixun,
|
|
render: (value, record, index) => {
|
|
return /* @__PURE__ */ AddQuestionsModal_React.createElement(tooltip/* default */.Z, { title: tootlipName(record) }, /* @__PURE__ */ AddQuestionsModal_React.createElement("div", null, value || "- -"));
|
|
}
|
|
},
|
|
{
|
|
title: "\u4F7F\u7528\u6B21\u6570",
|
|
dataIndex: "quotes",
|
|
key: "quotes",
|
|
render: (value, record, index) => {
|
|
return /* @__PURE__ */ AddQuestionsModal_React.createElement(tooltip/* default */.Z, { title: tootlipName(record) }, /* @__PURE__ */ AddQuestionsModal_React.createElement("div", null, isshixun || (record == null ? void 0 : record.challenge_names) ? (record == null ? void 0 : record.study_count) || (record == null ? void 0 : record.stu_num) : value));
|
|
}
|
|
},
|
|
{
|
|
title: /* @__PURE__ */ AddQuestionsModal_React.createElement("span", null, "\u53D1\u5E03\u72B6\u6001 ", /* @__PURE__ */ AddQuestionsModal_React.createElement(tooltip/* default */.Z, { title: "\u672A\u53D1\u5E03\u7684\u5B9E\u8DF5\u9879\u76EE\u4E0D\u80FD\u88AB\u9009\u7528" }, /* @__PURE__ */ AddQuestionsModal_React.createElement(QuestionCircleOutlined/* default */.Z, null))),
|
|
dataIndex: "shixun_tag_num_name",
|
|
key: "shixun_tag_num_name",
|
|
hidden: !isshixun,
|
|
render: (value, record, index) => {
|
|
return /* @__PURE__ */ AddQuestionsModal_React.createElement(tooltip/* default */.Z, { title: tootlipName(record) }, /* @__PURE__ */ AddQuestionsModal_React.createElement("div", null, value || "- -"));
|
|
}
|
|
},
|
|
{
|
|
title: "\u64CD\u4F5C",
|
|
dataIndex: "id",
|
|
key: "item_type",
|
|
render: (value, record, index) => {
|
|
return /* @__PURE__ */ AddQuestionsModal_React.createElement(tooltip/* default */.Z, { title: tootlipName(record) }, /* @__PURE__ */ AddQuestionsModal_React.createElement("div", { style: { flex: 1, textAlign: "start" } }, /* @__PURE__ */ AddQuestionsModal_React.createElement("a", { onClick: () => {
|
|
var _a2, _b2;
|
|
setqitem(AddQuestionsModal_spreadProps(AddQuestionsModal_spreadValues({}, record), { question_type: isshixun || (record == null ? void 0 : record.challenge_names) ? 5 : (_b2 = (_a2 = typeData == null ? void 0 : typeData.filter((item) => item.value === (record == null ? void 0 : record.item_type))) == null ? void 0 : _a2[0]) == null ? void 0 : _b2.question_type }));
|
|
setisshow(true);
|
|
} }, "\u67E5\u770B"), (record == null ? void 0 : record.shixun_tag_num) === 1 && /* @__PURE__ */ AddQuestionsModal_React.createElement("a", { style: { marginLeft: 10 }, onClick: () => {
|
|
modal["default"].confirm({
|
|
title: "\u63D0\u793A",
|
|
icon: null,
|
|
centered: true,
|
|
width: 400,
|
|
content: /* @__PURE__ */ AddQuestionsModal_React.createElement("div", null, "\u662F\u5426\u786E\u5B9A\u53D1\u5E03", /* @__PURE__ */ AddQuestionsModal_React.createElement("span", { style: { cursor: "pointer", color: "#3061D0" }, onClick: () => {
|
|
window.open(`/shixuns/${record == null ? void 0 : record.identifier}/challenges`);
|
|
} }, (record == null ? void 0 : record.shixun_name) || "--"), "\uFF1F"),
|
|
onOk: () => AddQuestionsModal_async(void 0, null, function* () {
|
|
if (!handleRelease(record == null ? void 0 : record.identifier)) {
|
|
return new Promise((resolve, reject) => {
|
|
reject();
|
|
});
|
|
}
|
|
})
|
|
});
|
|
} }, "\u53D1\u5E03")));
|
|
}
|
|
}
|
|
].filter((item) => !item.hidden)
|
|
}
|
|
),
|
|
/* @__PURE__ */ AddQuestionsModal_React.createElement(
|
|
pagination/* default */.Z,
|
|
{
|
|
current: param.page,
|
|
total: (datas == null ? void 0 : datas.items_count) || (datas == null ? void 0 : datas.shixuns_count),
|
|
style: { marginBottom: 20 },
|
|
defaultPageSize: param.per_page,
|
|
showTotal: (e) => /* @__PURE__ */ AddQuestionsModal_React.createElement("span", null, "\u5171\xA0", /* @__PURE__ */ AddQuestionsModal_React.createElement("span", { style: { color: "#165DFF" } }, e), "\xA0\u6761\u6570\u636E"),
|
|
pageSize: param.per_page,
|
|
onChange: (e, limit) => {
|
|
param.page = e;
|
|
param.per_page = limit;
|
|
setparam(AddQuestionsModal_spreadValues({}, param));
|
|
getdatas(AddQuestionsModal_spreadValues({}, param));
|
|
}
|
|
}
|
|
),
|
|
/* @__PURE__ */ AddQuestionsModal_React.createElement("div", { className: AddQuestionsModalmodules.bottom }, /* @__PURE__ */ AddQuestionsModal_React.createElement(es_button/* default */.ZP, { className: AddQuestionsModalmodules.no, onClick: () => {
|
|
setScoreShow(false);
|
|
} }, "\u53D6\u6D88"), /* @__PURE__ */ AddQuestionsModal_React.createElement(es_button/* default */.ZP, { loading: isloadings, style: { width: isloadings && 75 }, className: AddQuestionsModalmodules.yes, onClick: () => AddQuestionsModal_async(void 0, null, function* () {
|
|
if ((listitems == null ? void 0 : listitems.length) <= 0) {
|
|
message/* default */.ZP.info("\u5F53\u524D\u6682\u672A\u9009\u62E9\u6570\u636E");
|
|
return;
|
|
}
|
|
onOk([...selectedQuestionId.current], [...selectedShixunId.current], true, listitems == null ? void 0 : listitems.length);
|
|
}) }, "\u786E\u8BA4"))
|
|
), /* @__PURE__ */ AddQuestionsModal_React.createElement(
|
|
modal["default"],
|
|
{
|
|
open: isshow,
|
|
title: "\u9898\u76EE\u8BE6\u60C5",
|
|
footer: false,
|
|
className: AddQuestionsModalmodules.previewModal,
|
|
width: 1e3,
|
|
centered: true,
|
|
onCancel: () => {
|
|
setisshow(false);
|
|
},
|
|
onOk: () => {
|
|
setisshow(false);
|
|
}
|
|
},
|
|
/* @__PURE__ */ AddQuestionsModal_React.createElement(AddQuestionsModal_SaveItem, { qitem })
|
|
));
|
|
};
|
|
/* harmony default export */ var AddQuestionsModal = ((0,_umi_production_exports.connect)(
|
|
({
|
|
shixunsDetail
|
|
}) => ({
|
|
shixunsDetail
|
|
})
|
|
)(AddQuestionsModal_AddModal));
|
|
|
|
// EXTERNAL MODULE: ./src/utils/hooks/useOverflow.ts
|
|
var useOverflow = __webpack_require__(24239);
|
|
// 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__(19254);
|
|
;// CONCATENATED MODULE: ./src/pages/Paperlibrary/EditPotin/index.tsx
|
|
/* provided dependency */ var EditPotin_React = __webpack_require__(/*! react */ 59301);
|
|
var EditPotin_defProp = Object.defineProperty;
|
|
var EditPotin_defProps = Object.defineProperties;
|
|
var EditPotin_getOwnPropDescs = Object.getOwnPropertyDescriptors;
|
|
var EditPotin_getOwnPropSymbols = Object.getOwnPropertySymbols;
|
|
var EditPotin_hasOwnProp = Object.prototype.hasOwnProperty;
|
|
var EditPotin_propIsEnum = Object.prototype.propertyIsEnumerable;
|
|
var EditPotin_defNormalProp = (obj, key, value) => key in obj ? EditPotin_defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
|
|
var EditPotin_spreadValues = (a, b) => {
|
|
for (var prop in b || (b = {}))
|
|
if (EditPotin_hasOwnProp.call(b, prop))
|
|
EditPotin_defNormalProp(a, prop, b[prop]);
|
|
if (EditPotin_getOwnPropSymbols)
|
|
for (var prop of EditPotin_getOwnPropSymbols(b)) {
|
|
if (EditPotin_propIsEnum.call(b, prop))
|
|
EditPotin_defNormalProp(a, prop, b[prop]);
|
|
}
|
|
return a;
|
|
};
|
|
var EditPotin_spreadProps = (a, b) => EditPotin_defProps(a, EditPotin_getOwnPropDescs(b));
|
|
var EditPotin_async = (__this, __arguments, generator) => {
|
|
return new Promise((resolve, reject) => {
|
|
var fulfilled = (value) => {
|
|
try {
|
|
step(generator.next(value));
|
|
} catch (e) {
|
|
reject(e);
|
|
}
|
|
};
|
|
var rejected = (value) => {
|
|
try {
|
|
step(generator.throw(value));
|
|
} catch (e) {
|
|
reject(e);
|
|
}
|
|
};
|
|
var step = (x) => x.done ? resolve(x.value) : Promise.resolve(x.value).then(fulfilled, rejected);
|
|
step((generator = generator.apply(__this, __arguments)).next());
|
|
});
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
const EditPotin_questionType = [
|
|
{
|
|
name: "\u5355\u9009\u9898",
|
|
id: 0,
|
|
count: "q_singles",
|
|
score: "q_singles_scores",
|
|
nameType: "SINGLE"
|
|
},
|
|
{
|
|
name: "\u591A\u9009\u9898",
|
|
id: 1,
|
|
count: "q_doubles",
|
|
score: "q_doubles_scores",
|
|
nameType: "MULTIPLE"
|
|
},
|
|
{
|
|
name: "\u5224\u65AD\u9898",
|
|
id: 2,
|
|
count: "q_judges",
|
|
score: "q_judges_scores",
|
|
nameType: "JUDGMENT"
|
|
},
|
|
{
|
|
name: "\u586B\u7A7A\u9898",
|
|
id: 3,
|
|
count: "q_nulls",
|
|
score: "q_nulls_scores",
|
|
nameType: "COMPLETION"
|
|
},
|
|
{
|
|
name: "\u7B80\u7B54\u9898",
|
|
id: 4,
|
|
count: "q_mains",
|
|
score: "q_mains_scores",
|
|
nameType: "SUBJECTIVE"
|
|
},
|
|
{
|
|
name: "\u5B9E\u8BAD\u9898",
|
|
id: 5,
|
|
count: "q_shixuns",
|
|
score: "q_shixuns_scores",
|
|
nameType: "PRACTICAL"
|
|
},
|
|
{
|
|
name: "\u7F16\u7A0B\u9898",
|
|
id: 6,
|
|
count: "q_pros",
|
|
score: "q_pros_scores",
|
|
nameType: "PROGRAM"
|
|
},
|
|
{
|
|
name: "\u7EC4\u5408\u9898",
|
|
id: 7,
|
|
count: "q_combinations",
|
|
score: "q_combinations_scores",
|
|
nameType: "COMBINATION"
|
|
},
|
|
{
|
|
name: "\u7A0B\u5E8F\u586B\u7A7A\u9898",
|
|
id: 8,
|
|
count: "q_combinations",
|
|
score: "q_combinations_scores",
|
|
nameType: "BPROGRAM"
|
|
}
|
|
];
|
|
const AddNewPaper = ({
|
|
user,
|
|
dispatch,
|
|
itemid,
|
|
setisedits
|
|
}) => {
|
|
var _a, _b, _c, _d;
|
|
const [exerciseitem, setexerciseitem] = (0,_react_17_0_2_react.useState)();
|
|
const [isloading, setisloading] = (0,_react_17_0_2_react.useState)(false);
|
|
const [qitem, setqitem] = (0,_react_17_0_2_react.useState)();
|
|
const [score, setScore] = (0,_react_17_0_2_react.useState)();
|
|
const refScore = (0,_react_17_0_2_react.useRef)();
|
|
const scoreId = (0,_react_17_0_2_react.useRef)();
|
|
const [Bigqitem, setBigqitem] = (0,_react_17_0_2_react.useState)();
|
|
const [rightloading, setrightloading] = (0,_react_17_0_2_react.useState)(false);
|
|
const [isedit, setisedit] = (0,_react_17_0_2_react.useState)(false);
|
|
const [TagDiscipline, setTagDiscipline] = (0,_react_17_0_2_react.useState)();
|
|
const [uploadModalVisible, setUploadModalVisible] = (0,_react_17_0_2_react.useState)(false);
|
|
const [ScoreShow, setScoreShow] = (0,_react_17_0_2_react.useState)(false);
|
|
const [showquestion, setshowquestion] = (0,_react_17_0_2_react.useState)(false);
|
|
const [isshixun, setisshixun] = (0,_react_17_0_2_react.useState)(false);
|
|
const [isloadings, setisloadings] = (0,_react_17_0_2_react.useState)(false);
|
|
const [showChange, setShowChange] = (0,_react_17_0_2_react.useState)(false);
|
|
const [form] = es_form["default"].useForm();
|
|
const [isOpenEditName, setIsOpenEditName] = (0,_react_17_0_2_react.useState)(false);
|
|
const rightDiv = (0,_react_17_0_2_react.useRef)(null);
|
|
const [searchParams] = (0,_umi_production_exports.useSearchParams)();
|
|
(0,_react_17_0_2_react.useEffect)(() => {
|
|
init();
|
|
dispatch({
|
|
type: "globalSetting/footerToggle",
|
|
payload: false
|
|
});
|
|
}, []);
|
|
(0,_react_17_0_2_react.useEffect)(() => {
|
|
setisedits(isedit);
|
|
}, [isedit]);
|
|
(0,_react_17_0_2_react.useEffect)(() => {
|
|
if (qitem == null ? void 0 : qitem.question_id) {
|
|
setScore(qitem == null ? void 0 : qitem.question_score);
|
|
scoreId.current = qitem == null ? void 0 : qitem.question_id;
|
|
}
|
|
}, [qitem == null ? void 0 : qitem.question_id]);
|
|
const getTagData = (id) => EditPotin_async(void 0, null, function* () {
|
|
let res = yield dispatch({
|
|
type: "newExercisePaper/getTagDiscipline",
|
|
payload: { sub_discipline_id: id }
|
|
});
|
|
setTagDiscipline(res);
|
|
});
|
|
function init() {
|
|
return EditPotin_async(this, null, function* () {
|
|
var _a2, _b2, _c2, _d2, _e, _f;
|
|
setrightloading(true);
|
|
setisloading(true);
|
|
const res = yield dispatch({
|
|
type: "newExercisePaper/editExercise",
|
|
payload: { id: itemid }
|
|
});
|
|
setrightloading(false);
|
|
setisloading(false);
|
|
setexerciseitem(res);
|
|
if ((_a2 = res == null ? void 0 : res.exercise) == null ? void 0 : _a2.sub_discipline_id) {
|
|
getTagData((_b2 = res == null ? void 0 : res.exercise) == null ? void 0 : _b2.sub_discipline_id);
|
|
}
|
|
setqitem(EditPotin_spreadProps(EditPotin_spreadValues({}, (_e = (_d2 = (_c2 = res == null ? void 0 : res.exercise_question_types) == null ? void 0 : _c2[0]) == null ? void 0 : _d2.items) == null ? void 0 : _e[0]), { index: 1 }));
|
|
setBigqitem(EditPotin_spreadProps(EditPotin_spreadValues({}, (_f = res == null ? void 0 : res.exercise_question_types) == null ? void 0 : _f[0]), { indexs: 1 }));
|
|
});
|
|
}
|
|
function getdatas(params, isLoading = true) {
|
|
return EditPotin_async(this, null, function* () {
|
|
var _a2, _b2, _c2, _d2;
|
|
if (isLoading) {
|
|
setrightloading(true);
|
|
setisloading(true);
|
|
}
|
|
const res = yield dispatch({
|
|
type: "newExercisePaper/editExercise",
|
|
payload: { id: itemid }
|
|
});
|
|
setexerciseitem(res);
|
|
let items = [];
|
|
(_a2 = res == null ? void 0 : res.exercise_question_types) == null ? void 0 : _a2.map((item2) => {
|
|
var _a3;
|
|
(_a3 = item2 == null ? void 0 : item2.items) == null ? void 0 : _a3.map((val, index) => {
|
|
items.push(EditPotin_spreadProps(EditPotin_spreadValues({}, val), { index: index + 1 }));
|
|
});
|
|
});
|
|
let item = (_b2 = items.filter((val) => val.question_id === (params == null ? void 0 : params.id))) == null ? void 0 : _b2[0];
|
|
let bigitems = (_c2 = res == null ? void 0 : res.exercise_question_types) == null ? void 0 : _c2.map((val, index) => {
|
|
if ((item == null ? void 0 : item.question_type) === (val == null ? void 0 : val.question_type)) {
|
|
return EditPotin_spreadProps(EditPotin_spreadValues({}, val), { indexs: index + 1 });
|
|
}
|
|
});
|
|
let valitems = (_d2 = bigitems.filter((item2) => item2)) == null ? void 0 : _d2[0];
|
|
setBigqitem(EditPotin_spreadValues({}, valitems));
|
|
setqitem(EditPotin_spreadValues({}, item));
|
|
setScore(item == null ? void 0 : item.question_score);
|
|
setrightloading(false);
|
|
setisloading(false);
|
|
});
|
|
}
|
|
function seveeditor(params) {
|
|
return EditPotin_async(this, null, function* () {
|
|
var _a2;
|
|
let datas = EditPotin_spreadProps(EditPotin_spreadValues({}, params), {
|
|
difficulty: (params == null ? void 0 : params.difficulty) || 2,
|
|
item_type: params.question_type,
|
|
sub_discipline_id: (_a2 = exerciseitem == null ? void 0 : exerciseitem.exercise) == null ? void 0 : _a2.sub_discipline_id,
|
|
tag_discipline_ids: [],
|
|
repeat_answer: !params.repeat_answer
|
|
});
|
|
let bdatas = {};
|
|
if (params.question_type === 8) {
|
|
bdatas = EditPotin_spreadProps(EditPotin_spreadValues({}, params), {
|
|
hack: EditPotin_spreadProps(EditPotin_spreadValues({}, params == null ? void 0 : params.hack), {
|
|
difficult: params.difficulty
|
|
}),
|
|
hack_codes: EditPotin_spreadProps(EditPotin_spreadValues({}, params.hack_codes), {
|
|
code: base64.Base64.encode(params.hack_codes.code)
|
|
}),
|
|
hack_sets: [EditPotin_spreadValues({}, 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;
|
|
let res = yield (0,fetch/* default */.ZP)(`/api/examination_banks/${itemid}/examination_banks_item_banks/create_item_bank.json`, {
|
|
method: "post",
|
|
body: params.question_type === 8 ? bdatas : datas
|
|
});
|
|
if ((res == null ? void 0 : res.status) === 0) {
|
|
setisedit(false);
|
|
getdatas(res);
|
|
}
|
|
(0,utils_util/* domScrollToTop */.Vf)("#question-scroll-id");
|
|
});
|
|
}
|
|
function sort_question(params) {
|
|
return EditPotin_async(this, null, function* () {
|
|
setisloading(true);
|
|
let res = yield (0,fetch/* default */.ZP)(`/api/examination_banks/${itemid}/sort_question_type.json`, {
|
|
method: "post",
|
|
body: {
|
|
question_type: params
|
|
}
|
|
});
|
|
setisloading(false);
|
|
if ((res == null ? void 0 : res.status) === 0) {
|
|
init();
|
|
}
|
|
});
|
|
}
|
|
const handleOk = (list, cb) => EditPotin_async(void 0, null, function* () {
|
|
var _a2;
|
|
if (list.length === 0) {
|
|
message/* default */.ZP.warning("\u8BF7\u4E0A\u4F20\u6587\u4EF6");
|
|
cb();
|
|
return;
|
|
}
|
|
const res = yield (0,paperlibrary/* importItemBanks */.Hb)(itemid, (_a2 = list[0]) == null ? void 0 : _a2.file);
|
|
if (res.status === 0) {
|
|
message/* default */.ZP.success(`\u6210\u529F\u5BFC\u5165${res == null ? void 0 : res.success}\u6761`);
|
|
setUploadModalVisible(false);
|
|
init();
|
|
}
|
|
cb();
|
|
});
|
|
const handleScore = (score2, item) => EditPotin_async(void 0, null, function* () {
|
|
const res = yield (0,paperlibrary/* changeExamScore */.kF)({ score: (0,lodash.round)(score2, 1), question_id: item == null ? void 0 : item.question_id });
|
|
if ((res == null ? void 0 : res.status) === 0) {
|
|
message/* default */.ZP.success("\u4FEE\u6539\u6210\u529F");
|
|
getdatas({ id: scoreId.current }, false);
|
|
return;
|
|
}
|
|
if ((res == null ? void 0 : res.status) === -1) {
|
|
setScore(item == null ? void 0 : item.question_score);
|
|
}
|
|
});
|
|
function deleteitem() {
|
|
return EditPotin_async(this, null, function* () {
|
|
modal["default"].confirm({
|
|
title: "\u63D0\u793A",
|
|
content: "\u786E\u5B9A\u8981\u5220\u9664\u8FD9\u4E2A\u8BD5\u9898\u5417\uFF1F",
|
|
okText: "\u786E\u5B9A",
|
|
centered: true,
|
|
className: EditPotinmodules.modalconfirm,
|
|
onOk: () => EditPotin_async(this, null, function* () {
|
|
if (qitem.question_id) {
|
|
let res = yield (0,fetch/* default */.ZP)(`/api/examination_banks/${itemid}/examination_banks_item_banks/${qitem.question_id}.json`, {
|
|
method: "delete"
|
|
});
|
|
if ((res == null ? void 0 : res.status) === 0) {
|
|
init();
|
|
setisedit(false);
|
|
}
|
|
} else {
|
|
setqitem({});
|
|
setisedit(false);
|
|
init();
|
|
}
|
|
}),
|
|
cancelText: "\u53D6\u6D88"
|
|
});
|
|
});
|
|
}
|
|
const addquestion = (data) => EditPotin_async(void 0, null, function* () {
|
|
let res = yield (0,fetch/* default */.ZP)(`/api/examination_banks/${itemid}/examination_banks_item_banks.json`, {
|
|
method: "post",
|
|
body: EditPotin_spreadValues({}, data)
|
|
});
|
|
return res;
|
|
});
|
|
const { overflow, handleMouseEnter, handleMouseLeave } = (0,useOverflow/* useOverflow */.I)();
|
|
const sort_question_show = (params) => EditPotin_async(void 0, null, function* () {
|
|
var _a2, _b2;
|
|
setisloading(true);
|
|
let res = yield (0,fetch/* default */.ZP)(`/api/examination_banks/${itemid}/sort_question_type.json`, {
|
|
method: "post",
|
|
body: {
|
|
question_type: params
|
|
}
|
|
});
|
|
setisloading(false);
|
|
if ((res == null ? void 0 : res.status) === 0) {
|
|
const res2 = yield dispatch({
|
|
type: "newExercisePaper/editExercise",
|
|
payload: { id: itemid }
|
|
});
|
|
setexerciseitem(res2);
|
|
if ((_a2 = res2 == null ? void 0 : res2.exercise) == null ? void 0 : _a2.sub_discipline_id) {
|
|
getTagData((_b2 = res2 == null ? void 0 : res2.exercise) == null ? void 0 : _b2.sub_discipline_id);
|
|
}
|
|
}
|
|
});
|
|
const handleIsEdit = () => {
|
|
if (isedit) {
|
|
message/* default */.ZP.info("\u8BF7\u5148\u4FDD\u5B58\u6216\u53D6\u6D88\u5F53\u524D\u6B63\u5728\u7F16\u8F91\u7684\u8BD5\u9898\u3002");
|
|
return true;
|
|
}
|
|
return false;
|
|
};
|
|
const exportMenu = (values, index) => /* @__PURE__ */ EditPotin_React.createElement(menu["default"], null, /* @__PURE__ */ EditPotin_React.createElement(menu["default"].Item, { key: "0", onClick: () => newQuestion(values == null ? void 0 : values.question_type) }, /* @__PURE__ */ EditPotin_React.createElement("span", { className: EditPotinmodules.moreSpan }, "\u65B0\u589E")), /* @__PURE__ */ EditPotin_React.createElement(
|
|
menu["default"].Item,
|
|
{
|
|
key: "1",
|
|
disabled: index === 0 ? true : false,
|
|
onClick: () => EditPotin_async(void 0, null, function* () {
|
|
if (index === 0) {
|
|
return;
|
|
}
|
|
if (handleIsEdit())
|
|
return;
|
|
let arr = (0,utils_util/* moveArray */.rz)(exerciseitem == null ? void 0 : exerciseitem.exercise_question_types, index, index - 1);
|
|
yield sort_question_show(arr.map((item) => item.name));
|
|
})
|
|
},
|
|
/* @__PURE__ */ EditPotin_React.createElement("span", { className: EditPotinmodules.moreSpan }, "\u4E0A\u79FB")
|
|
), /* @__PURE__ */ EditPotin_React.createElement(
|
|
menu["default"].Item,
|
|
{
|
|
key: "2",
|
|
disabled: index === (exerciseitem == null ? void 0 : exerciseitem.exercise_question_types.length) - 1 ? true : false,
|
|
onClick: () => EditPotin_async(void 0, null, function* () {
|
|
if (index === (exerciseitem == null ? void 0 : exerciseitem.exercise_question_types.length) - 1) {
|
|
return;
|
|
}
|
|
if (handleIsEdit())
|
|
return;
|
|
let arr = (0,utils_util/* moveArray */.rz)(exerciseitem == null ? void 0 : exerciseitem.exercise_question_types, index, index + 1);
|
|
yield sort_question_show(arr.map((item) => item.name));
|
|
})
|
|
},
|
|
/* @__PURE__ */ EditPotin_React.createElement("span", { className: EditPotinmodules.moreSpan }, "\u4E0B\u79FB")
|
|
), /* @__PURE__ */ EditPotin_React.createElement(menu["default"].Item, { key: "3", onClick: () => {
|
|
var _a2;
|
|
form.setFieldsValue({ name: values.name, item_type_en: (_a2 = EditPotin_questionType.find((item) => item.id == values.question_type)) == null ? void 0 : _a2.nameType });
|
|
setIsOpenEditName(true);
|
|
} }, /* @__PURE__ */ EditPotin_React.createElement("span", { className: EditPotinmodules.moreSpan }, "\u91CD\u547D\u540D")));
|
|
const newQuestion = (id) => {
|
|
var _a2, _b2, _c2, _d2, _e, _f, _g, _h, _i, _j, _k, _l;
|
|
if (handleIsEdit())
|
|
return;
|
|
if (id === 5) {
|
|
setshowquestion(true);
|
|
setisshixun(true);
|
|
return;
|
|
}
|
|
if (id === 6) {
|
|
if (searchParams.get("pageType") == "course") {
|
|
if (searchParams.get("updateType") == "course") {
|
|
_umi_production_exports.history.push(`/problems/newcreate?difficult=${(_a2 = exerciseitem == null ? void 0 : exerciseitem.exercise) == null ? void 0 : _a2.difficulty}&sub_discipline_id=${(_b2 = exerciseitem == null ? void 0 : exerciseitem.exercise) == null ? void 0 : _b2.sub_discipline_id}&express_id=${(_c2 = exerciseitem == null ? void 0 : exerciseitem.exercise) == null ? void 0 : _c2.id}&callback_url=/paperlibrary/add/${(_d2 = exerciseitem == null ? void 0 : exerciseitem.exercise) == null ? void 0 : _d2.id}?type=2&pageType=course&updateType=course&courseId=${searchParams.get("courseId")}&stageId=${searchParams.get("stageId")}`);
|
|
} else {
|
|
_umi_production_exports.history.push(`/problems/newcreate?difficult=${(_e = exerciseitem == null ? void 0 : exerciseitem.exercise) == null ? void 0 : _e.difficulty}&sub_discipline_id=${(_f = exerciseitem == null ? void 0 : exerciseitem.exercise) == null ? void 0 : _f.sub_discipline_id}&express_id=${(_g = exerciseitem == null ? void 0 : exerciseitem.exercise) == null ? void 0 : _g.id}&callback_url=/paperlibrary/add/${(_h = exerciseitem == null ? void 0 : exerciseitem.exercise) == null ? void 0 : _h.id}?type=2&pageType=course&courseId=${searchParams.get("courseId")}&stageId=${searchParams.get("stageId")}`);
|
|
}
|
|
} else {
|
|
_umi_production_exports.history.push(`/problems/newcreate?difficult=${(_i = exerciseitem == null ? void 0 : exerciseitem.exercise) == null ? void 0 : _i.difficulty}&sub_discipline_id=${(_j = exerciseitem == null ? void 0 : exerciseitem.exercise) == null ? void 0 : _j.sub_discipline_id}&express_id=${(_k = exerciseitem == null ? void 0 : exerciseitem.exercise) == null ? void 0 : _k.id}&callback_url=/paperlibrary/add/${(_l = exerciseitem == null ? void 0 : exerciseitem.exercise) == null ? void 0 : _l.id}?type=2`);
|
|
}
|
|
return;
|
|
}
|
|
setisedit(true);
|
|
if (id === 2) {
|
|
setqitem({
|
|
question_type: id,
|
|
isadd: true,
|
|
repeat_answer: true,
|
|
choices: [{ choice_text: "\u6B63\u786E", is_answer: 0 }, { choice_text: "\u9519\u8BEF", is_answer: 0 }],
|
|
question_choices: [{ choice_text: "\u6B63\u786E", is_answer: 0 }, { choice_text: "\u9519\u8BEF", is_answer: 0 }],
|
|
difficulty: 2,
|
|
standard_answers: [],
|
|
question_score: "",
|
|
tag_discipline_ids: [],
|
|
question_title: "",
|
|
analysis: ""
|
|
});
|
|
} else {
|
|
setqitem({
|
|
question_type: id,
|
|
question_choices: Array.from({ length: 4 }, () => ({ 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,
|
|
downcase: true,
|
|
no_space: true
|
|
});
|
|
}
|
|
};
|
|
return /* @__PURE__ */ EditPotin_React.createElement("div", null, /* @__PURE__ */ EditPotin_React.createElement(spin/* default */.Z, { spinning: rightloading }, /* @__PURE__ */ EditPotin_React.createElement("div", { className: EditPotinmodules.bg }, /* @__PURE__ */ EditPotin_React.createElement("div", { style: { textAlign: "center" } }, ((_a = exerciseitem == null ? void 0 : exerciseitem.exercise_types) == null ? void 0 : _a.q_counts) === 0 && !isedit && /* @__PURE__ */ EditPotin_React.createElement(NoData/* default */.Z, { customText: "\u8FD8\u6CA1\u6709\u8BD5\u9898\uFF0C\u4ECE\u5E95\u90E8\u64CD\u4F5C\u680F\u6765\u6DFB\u52A0\u5427\uFF5E" }), (((_b = exerciseitem == null ? void 0 : exerciseitem.exercise_types) == null ? void 0 : _b.q_counts) > 0 || isedit) && /* @__PURE__ */ EditPotin_React.createElement("div", { style: { marginTop: 20, borderTop: "1px solid #DCDCDC", display: "block", alignItems: "stretch" } }, /* @__PURE__ */ EditPotin_React.createElement("div", { style: { backgroundColor: "#F6F7F9", display: "inline-block", position: "sticky", top: 0 } }, /* @__PURE__ */ EditPotin_React.createElement(skeleton/* default */.Z, { className: EditPotinmodules.left, active: true, loading: isloading }, /* @__PURE__ */ EditPotin_React.createElement("div", { className: EditPotinmodules.left }, /* @__PURE__ */ EditPotin_React.createElement("div", { className: EditPotinmodules.leftAction }, /* @__PURE__ */ EditPotin_React.createElement(es_button/* default */.ZP, { onClick: () => {
|
|
if (handleIsEdit())
|
|
return;
|
|
setScoreShow(true);
|
|
}, className: EditPotinmodules.Button }, "\u6279\u91CF\u8BBE\u7F6E\u5206\u503C")), /* @__PURE__ */ EditPotin_React.createElement(
|
|
"div",
|
|
{
|
|
className: EditPotinmodules.scrollWrapper,
|
|
style: { overflow },
|
|
onMouseEnter: handleMouseEnter,
|
|
onMouseLeave: handleMouseLeave
|
|
},
|
|
(_c = exerciseitem == null ? void 0 : exerciseitem.exercise_question_types) == null ? void 0 : _c.map(
|
|
(item, index) => /* @__PURE__ */ EditPotin_React.createElement("div", { key: index, className: "mb30" }, /* @__PURE__ */ EditPotin_React.createElement("div", { className: EditPotinmodules.title }, /* @__PURE__ */ EditPotin_React.createElement("div", { className: EditPotinmodules.titleleft }, /* @__PURE__ */ EditPotin_React.createElement("span", { style: { color: "#000000", fontWeight: 400, fontSize: 12 } }, " ", (0,utils_util/* toChineseNumber */.EM)(index + 1), "\u3001\u3010", item.name, "\u3011"), /* @__PURE__ */ EditPotin_React.createElement("span", { style: { color: "#464F66", fontSize: 12 } }, "\uFF08", item.count, "\u5C0F\u9898\uFF0C\u5171", item.score, "\u5206\uFF09")), /* @__PURE__ */ EditPotin_React.createElement(dropdown/* default */.Z, { dropdownRender: () => exportMenu(item, index), placement: "bottomLeft" }, /* @__PURE__ */ EditPotin_React.createElement("div", { className: EditPotinmodules.more_style }, /* @__PURE__ */ EditPotin_React.createElement("i", { className: `iconfont icon-sandian font12` })))), /* @__PURE__ */ EditPotin_React.createElement(
|
|
LeftItems,
|
|
{
|
|
isedit,
|
|
setBigqitem,
|
|
bigitem: EditPotin_spreadProps(EditPotin_spreadValues({}, item), { indexs: index + 1 }),
|
|
setqitem: (v) => EditPotin_async(void 0, null, function* () {
|
|
var _a2;
|
|
(_a2 = refScore.current) == null ? void 0 : _a2.blur();
|
|
setqitem(v);
|
|
}),
|
|
qitem,
|
|
Itemid: itemid,
|
|
getdata: getdatas,
|
|
data: item.items
|
|
}
|
|
))
|
|
)
|
|
)))), /* @__PURE__ */ EditPotin_React.createElement(skeleton/* default */.Z, { className: EditPotinmodules.right, active: true, loading: rightloading }, /* @__PURE__ */ EditPotin_React.createElement("div", { id: "question-scroll-id", className: EditPotinmodules.right, ref: rightDiv }, !(qitem == null ? void 0 : qitem.isadd) && /* @__PURE__ */ EditPotin_React.createElement("div", { className: EditPotinmodules.title }, !isedit && /* @__PURE__ */ EditPotin_React.createElement("div", { style: { flex: 1 } }, /* @__PURE__ */ EditPotin_React.createElement("span", { style: { color: "#000000", fontWeight: 600, fontSize: 16 } }, " ", (Bigqitem == null ? void 0 : Bigqitem.indexs) && (0,utils_util/* toChineseNumber */.EM)(Bigqitem == null ? void 0 : Bigqitem.indexs), "\u3001\u3010", Bigqitem == null ? void 0 : Bigqitem.name, "\u3011"), /* @__PURE__ */ EditPotin_React.createElement(tooltip/* default */.Z, { title: "\u7F16\u8F91\u9898\u578B\u540D\u79F0" }, /* @__PURE__ */ EditPotin_React.createElement("i", { className: `${EditPotinmodules.edit} iconfont icon-bianji_Hover mr5 ml5 font18`, onClick: () => {
|
|
var _a2;
|
|
form.setFieldsValue({ name: Bigqitem.name, item_type_en: (_a2 = EditPotin_questionType.find((item) => item.id == Bigqitem.question_type)) == null ? void 0 : _a2.nameType });
|
|
setIsOpenEditName(true);
|
|
} })), /* @__PURE__ */ EditPotin_React.createElement("span", { style: { color: "#464F66", fontSize: 16, fontWeight: 400 } }, "\uFF08", Bigqitem == null ? void 0 : Bigqitem.count, "\u5C0F\u9898\uFF0C\u5171", Bigqitem == null ? void 0 : Bigqitem.score, "\u5206\uFF09")), /* @__PURE__ */ EditPotin_React.createElement("div", { style: { display: "flex", alignItems: "center" } }, (qitem == null ? void 0 : qitem.question_type) === 5 && !isedit && /* @__PURE__ */ EditPotin_React.createElement("a", { className: EditPotinmodules.shixun, href: `/shixuns/${qitem == null ? void 0 : qitem.shixun_identifier}/challenges?exercise=true`, target: "_blank" }, /* @__PURE__ */ EditPotin_React.createElement("i", { onClick: () => {
|
|
}, style: { marginRight: 20 }, className: `iconfont icon-shixunkecheng mr5 ` }), "\u5B9E\u8BAD\u8BE6\u60C5"), !isedit && [0, 1, 2, 4, 6].includes(qitem == null ? void 0 : qitem.question_type) && /* @__PURE__ */ EditPotin_React.createElement(es_form["default"].Item, { label: "\u5206\u503C", style: { margin: "0 20px" }, required: true }, /* @__PURE__ */ EditPotin_React.createElement(input_number/* default */.Z, { precision: 1, ref: refScore, onChange: (v) => setScore(v), value: score, onBlur: (v) => {
|
|
handleScore(v.target.value, qitem);
|
|
} })), !isedit && /* @__PURE__ */ EditPotin_React.createElement(tooltip/* default */.Z, { title: "\u5220\u9664" }, /* @__PURE__ */ EditPotin_React.createElement("i", { onClick: () => {
|
|
deleteitem();
|
|
}, style: { marginRight: 20 }, className: `${EditPotinmodules.delete} iconfont icon-shanchu13 mr5 ` })), !isedit && /* @__PURE__ */ EditPotin_React.createElement(tooltip/* default */.Z, { title: "\u7F16\u8F91\u8BD5\u9898" }, /* @__PURE__ */ EditPotin_React.createElement("i", { onClick: () => {
|
|
var _a2, _b2, _c2;
|
|
if ((qitem == null ? void 0 : qitem.question_type) === 6) {
|
|
if (searchParams.get("pageType") == "course") {
|
|
if (searchParams.get("updateType") == "course") {
|
|
_umi_production_exports.history.push(`/problems/newedit/${qitem == null ? void 0 : qitem.hack_identifier}?type=exercises&express_id=${(_a2 = exerciseitem == null ? void 0 : exerciseitem.exercise) == null ? void 0 : _a2.id}&question_id=${qitem == null ? void 0 : qitem.question_id}&score=${qitem == null ? void 0 : qitem.question_score}&exercise=true&callback_url=${location.pathname}?type=2&pageType=course&updateType=course&courseId=${searchParams.get("courseId")}&stageId=${searchParams.get("stageId")}`);
|
|
} else {
|
|
_umi_production_exports.history.push(`/problems/newedit/${qitem == null ? void 0 : qitem.hack_identifier}?type=exercises&express_id=${(_b2 = exerciseitem == null ? void 0 : exerciseitem.exercise) == null ? void 0 : _b2.id}&question_id=${qitem == null ? void 0 : qitem.question_id}&score=${qitem == null ? void 0 : qitem.question_score}&exercise=true&callback_url=${location.pathname}?type=2&pageType=course&courseId=${searchParams.get("courseId")}&stageId=${searchParams.get("stageId")}`);
|
|
}
|
|
} else {
|
|
_umi_production_exports.history.push(`/problems/newedit/${qitem == null ? void 0 : qitem.hack_identifier}?type=exercises&express_id=${(_c2 = exerciseitem == null ? void 0 : exerciseitem.exercise) == null ? void 0 : _c2.id}&question_id=${qitem == null ? void 0 : qitem.question_id}&score=${qitem == null ? void 0 : qitem.question_score}&exercise=true&callback_url=${location.pathname}$?type=2`);
|
|
}
|
|
} else {
|
|
setisedit(true);
|
|
}
|
|
}, className: `${EditPotinmodules.edit} iconfont icon-bianji_Hover mr5 ` })))), !isedit && /* @__PURE__ */ EditPotin_React.createElement("div", null, /* @__PURE__ */ EditPotin_React.createElement("div", { className: EditPotinmodules.qcount }, /* @__PURE__ */ EditPotin_React.createElement("span", { className: EditPotinmodules.score }, qitem == null ? void 0 : qitem.question_score, "\u5206"), /* @__PURE__ */ EditPotin_React.createElement(RenderHtml/* default */.Z, { className: EditPotinmodules.qtitle, value: (qitem == null ? void 0 : qitem.index) + `\u3001${(qitem == null ? void 0 : qitem.question_type) == 8 ? (_d = qitem == null ? void 0 : qitem.program_attr) == null ? void 0 : _d.description : qitem == null ? void 0 : qitem.question_title}` })), /* @__PURE__ */ EditPotin_React.createElement(SaveItem, { TagDiscipline, qitem })), isedit && /* @__PURE__ */ EditPotin_React.createElement("div", null, (qitem == null ? void 0 : qitem.question_type) <= 1 && /* @__PURE__ */ EditPotin_React.createElement(SingleEditor, { getTagData, deleteitem, seveeditor, exerciseitem, TagDiscipline, setisedit, qitem, init }), (qitem == null ? void 0 : qitem.question_type) === 5 && /* @__PURE__ */ EditPotin_React.createElement(ShixunEditor, { setqitem, deleteitem, seveeditor, exerciseitem, TagDiscipline, setisedit, qitem }), (qitem == null ? void 0 : qitem.question_type) === 3 && /* @__PURE__ */ EditPotin_React.createElement(CombinationEditor, { getTagData, deleteitem, seveeditor, exerciseitem, TagDiscipline, setisedit, qitem, init }), (qitem == null ? void 0 : qitem.question_type) === 2 && /* @__PURE__ */ EditPotin_React.createElement(Questions_JudgmentQuestionEditor, { getTagData, deleteitem, seveeditor, exerciseitem, TagDiscipline, setisedit, qitem, init }), (qitem == null ? void 0 : qitem.question_type) === 4 && /* @__PURE__ */ EditPotin_React.createElement(Questions_SubjectiveQuestionEditor, { getTagData, deleteitem, seveeditor, exerciseitem, TagDiscipline, setisedit, qitem, init }), (qitem == null ? void 0 : qitem.question_type) === 7 && /* @__PURE__ */ EditPotin_React.createElement(Questions_CombinationQuestionEditor, { getTagData, deleteitem, seveeditor, exerciseitem, TagDiscipline, setisedit, qitem, init }), (qitem == null ? void 0 : qitem.question_type) === 8 && /* @__PURE__ */ EditPotin_React.createElement(Questions_BProgramEditor, { getTagData, deleteitem, seveeditor, exerciseitem, TagDiscipline, setisedit, qitem, init })))))))), /* @__PURE__ */ EditPotin_React.createElement("div", { className: EditPotinmodules.bottomdiv }, /* @__PURE__ */ EditPotin_React.createElement("div", { style: { width: 1200, margin: "0px auto", display: "flex", justifyContent: "space-between", alignItems: "center" } }, /* @__PURE__ */ EditPotin_React.createElement("span", { className: EditPotinmodules.spanBtn, onClick: () => {
|
|
if (handleIsEdit())
|
|
return;
|
|
setshowquestion(true);
|
|
setisshixun(false);
|
|
} }, "\u9898\u5E93\u9009\u9898"), /* @__PURE__ */ EditPotin_React.createElement("span", { className: EditPotinmodules.spanBtn, onClick: () => {
|
|
if (handleIsEdit())
|
|
return;
|
|
setUploadModalVisible(true);
|
|
} }, "\u5BFC\u5165\u8BD5\u9898"), /* @__PURE__ */ EditPotin_React.createElement("span", { className: EditPotinmodules.spanBtn, onClick: () => EditPotin_async(void 0, null, function* () {
|
|
var _a2;
|
|
if (handleIsEdit())
|
|
return;
|
|
const res = yield (0,paperlibrary/* generateExerciseId */.JP)(itemid);
|
|
if (res.status === 0) {
|
|
window.open(
|
|
`/classrooms/coursesId/exercise/${res.exercise_id}/${(_a2 = user.userInfo) == null ? void 0 : _a2.login}/initate_answer`
|
|
);
|
|
}
|
|
}) }, "\u6A21\u62DF\u8003\u8BD5"), /* @__PURE__ */ EditPotin_React.createElement("span", { className: EditPotinmodules.spanBtn, onClick: () => {
|
|
if (handleIsEdit())
|
|
return;
|
|
window.open(`/paperlibrary/see/${itemid}`);
|
|
} }, "\u8BD5\u5377\u9884\u89C8"), EditPotin_questionType == null ? void 0 : EditPotin_questionType.map((item, k) => /* @__PURE__ */ EditPotin_React.createElement(es_button/* default */.ZP, { key: k, className: EditPotinmodules.addQuestionBtn, type: "primary", onClick: () => {
|
|
newQuestion(item.id);
|
|
} }, item.name)), /* @__PURE__ */ EditPotin_React.createElement("span", { className: EditPotinmodules.saveBtn, onClick: () => {
|
|
if (searchParams.get("pageType") == "course") {
|
|
if (searchParams.get("updateType") == "course") {
|
|
message/* default */.ZP.info("\u7F16\u8F91\u6210\u529F");
|
|
_umi_production_exports.history.replace(`/paths/${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((res) => {
|
|
if ((res == null ? void 0 : res.status) == 0) {
|
|
message/* default */.ZP.info("\u521B\u5EFA\u6210\u529F");
|
|
_umi_production_exports.history.replace(`/paths/${searchParams.get("courseId")}`);
|
|
}
|
|
});
|
|
}
|
|
} else {
|
|
if (handleIsEdit())
|
|
return;
|
|
message/* default */.ZP.info("\u521B\u5EFA\u6210\u529F");
|
|
_umi_production_exports.history.push(`/paperlibrary?defaultActiveKey=0`);
|
|
}
|
|
} }, /* @__PURE__ */ EditPotin_React.createElement("i", { className: "iconfont icon-baocun1", style: { fontSize: 15, marginRight: 5 } }), "\u4FDD\u5B58\u8BD5\u5377"))), /* @__PURE__ */ EditPotin_React.createElement(
|
|
Setscore,
|
|
{
|
|
setScoreShow,
|
|
ScoreShow,
|
|
exerciseitem,
|
|
getdata: init
|
|
}
|
|
), showquestion && /* @__PURE__ */ EditPotin_React.createElement(
|
|
AddQuestionsModal,
|
|
{
|
|
setScoreShow: setshowquestion,
|
|
isshixuns: isshixun,
|
|
ScoreShow: showquestion,
|
|
isloadings,
|
|
onOk: (questionIdArr, shixunIdArr, ischeck_only, listitems_length) => EditPotin_async(void 0, null, function* () {
|
|
setisloadings(true);
|
|
let params = {
|
|
exam_id: itemid,
|
|
item_bank_ids: questionIdArr,
|
|
shixun_ids: shixunIdArr
|
|
};
|
|
let res = yield addquestion(EditPotin_spreadProps(EditPotin_spreadValues({}, params), { check_only: ischeck_only }));
|
|
setisloadings(false);
|
|
if ((res == null ? void 0 : res.status) === 0) {
|
|
yield addquestion(params);
|
|
setshowquestion(false);
|
|
init();
|
|
message/* default */.ZP.info("\u6DFB\u52A0\u6210\u529F");
|
|
} else if (res.status === -4) {
|
|
modal["default"].confirm({
|
|
title: "\u63D0\u793A",
|
|
content: `\u5F53\u524D\u5DF2\u9009\u62E9${listitems_length}\u9053\u8BD5\u9898\uFF0C\u5DF2\u52A0\u5165\u8FC7\u7684\u8BD5\u9898\u5C06\u4E0D\u4F1A\u91CD\u590D\u52A0\u5165`,
|
|
onOk: () => EditPotin_async(void 0, null, function* () {
|
|
yield addquestion(params);
|
|
setshowquestion(false);
|
|
init();
|
|
message/* default */.ZP.info("\u6DFB\u52A0\u6210\u529F");
|
|
})
|
|
});
|
|
}
|
|
})
|
|
}
|
|
), /* @__PURE__ */ EditPotin_React.createElement(
|
|
UploadQuestions/* default */.Z,
|
|
{
|
|
visible: uploadModalVisible,
|
|
onCancel: () => setUploadModalVisible(false),
|
|
onOk: handleOk
|
|
}
|
|
), /* @__PURE__ */ EditPotin_React.createElement(
|
|
modal["default"],
|
|
{
|
|
centered: true,
|
|
title: "\u7F16\u8F91\u9898\u578B\u540D\u79F0",
|
|
open: isOpenEditName,
|
|
width: 500,
|
|
onOk: () => form.submit(),
|
|
onCancel: () => setIsOpenEditName(false)
|
|
},
|
|
/* @__PURE__ */ EditPotin_React.createElement(es_form["default"], { form, initialValues: {}, onFinish: (values) => EditPotin_async(void 0, null, function* () {
|
|
const res = yield (0,paperlibrary/* getEditQuestionTypeAlias */.RK)(EditPotin_spreadValues({ id: itemid }, values));
|
|
if (res.status == 0) {
|
|
message/* default */.ZP.success("\u4FEE\u6539\u6210\u529F");
|
|
init();
|
|
setIsOpenEditName(false);
|
|
}
|
|
}) }, /* @__PURE__ */ EditPotin_React.createElement(es_form["default"].Item, { style: { marginBottom: 0 }, name: "name", rules: [
|
|
{ required: true, message: "\u8BF7\u8F93\u5165\u9898\u578B\u540D\u79F0" },
|
|
{ whitespace: true, message: "\u8BF7\u52FF\u8F93\u5165\u7A7A\u683C" },
|
|
{
|
|
validator(rule, values) {
|
|
var _a2, _b2, _c2, _d2;
|
|
const question_type = (_a2 = EditPotin_questionType == null ? void 0 : EditPotin_questionType.find((item) => item.nameType == form.getFieldValue("item_type_en"))) == null ? void 0 : _a2.id;
|
|
if ((_d2 = (_c2 = (_b2 = exerciseitem == null ? void 0 : exerciseitem.exercise_question_types) == null ? void 0 : _b2.filter((item) => item.question_type != question_type)) == null ? void 0 : _c2.map((item) => item == null ? void 0 : item.name)) == null ? void 0 : _d2.includes(values)) {
|
|
return Promise.reject(new Error("\u9898\u578B\u540D\u79F0\u5DF2\u5B58\u5728\uFF0C\u8BF7\u52FF\u8BBE\u7F6E\u76F8\u540C\u7684\u9898\u578B\u540D\u79F0"));
|
|
}
|
|
return Promise.resolve();
|
|
}
|
|
}
|
|
] }, /* @__PURE__ */ EditPotin_React.createElement(input["default"], { size: "large", maxLength: 10, showCount: true })), /* @__PURE__ */ EditPotin_React.createElement(es_form["default"].Item, { hidden: true, name: "item_type_en" }, /* @__PURE__ */ EditPotin_React.createElement(input["default"], { size: "large" })))
|
|
));
|
|
};
|
|
/* harmony default export */ var EditPotin = ((0,_umi_production_exports.connect)(
|
|
({
|
|
user,
|
|
dispatch
|
|
}) => ({
|
|
user,
|
|
dispatch
|
|
})
|
|
)(AddNewPaper));
|
|
|
|
// EXTERNAL MODULE: ./src/components/DigitalLabel/index.tsx + 1 modules
|
|
var DigitalLabel = __webpack_require__(26415);
|
|
// EXTERNAL MODULE: ./src/pages/Paperlibrary/Add/TitleEditor.tsx
|
|
var TitleEditor = __webpack_require__(78573);
|
|
;// CONCATENATED MODULE: ./src/pages/Paperlibrary/Add/index.tsx
|
|
/* provided dependency */ var Add_React = __webpack_require__(/*! react */ 59301);
|
|
var Add_defProp = Object.defineProperty;
|
|
var Add_defProps = Object.defineProperties;
|
|
var Add_getOwnPropDescs = Object.getOwnPropertyDescriptors;
|
|
var Add_getOwnPropSymbols = Object.getOwnPropertySymbols;
|
|
var Add_hasOwnProp = Object.prototype.hasOwnProperty;
|
|
var Add_propIsEnum = Object.prototype.propertyIsEnumerable;
|
|
var Add_defNormalProp = (obj, key, value) => key in obj ? Add_defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
|
|
var Add_spreadValues = (a, b) => {
|
|
for (var prop in b || (b = {}))
|
|
if (Add_hasOwnProp.call(b, prop))
|
|
Add_defNormalProp(a, prop, b[prop]);
|
|
if (Add_getOwnPropSymbols)
|
|
for (var prop of Add_getOwnPropSymbols(b)) {
|
|
if (Add_propIsEnum.call(b, prop))
|
|
Add_defNormalProp(a, prop, b[prop]);
|
|
}
|
|
return a;
|
|
};
|
|
var Add_spreadProps = (a, b) => Add_defProps(a, Add_getOwnPropDescs(b));
|
|
var Add_async = (__this, __arguments, generator) => {
|
|
return new Promise((resolve, reject) => {
|
|
var fulfilled = (value) => {
|
|
try {
|
|
step(generator.next(value));
|
|
} catch (e) {
|
|
reject(e);
|
|
}
|
|
};
|
|
var rejected = (value) => {
|
|
try {
|
|
step(generator.throw(value));
|
|
} catch (e) {
|
|
reject(e);
|
|
}
|
|
};
|
|
var step = (x) => x.done ? resolve(x.value) : Promise.resolve(x.value).then(fulfilled, rejected);
|
|
step((generator = generator.apply(__this, __arguments)).next());
|
|
});
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
const useCourseOptions = () => {
|
|
const [courseOptions, setCourseOptions] = (0,_react_17_0_2_react.useState)([]);
|
|
(0,_react_17_0_2_react.useEffect)(() => {
|
|
const getCourseOptions = () => Add_async(void 0, null, function* () {
|
|
const res = yield (0,paperlibrary/* getDisciplines */.d1)({ source: "question" });
|
|
if (res == null ? void 0 : res.disciplines) {
|
|
setCourseOptions((0,util/* formatCourseOptions */.L)(res == null ? void 0 : res.disciplines));
|
|
}
|
|
});
|
|
getCourseOptions();
|
|
}, []);
|
|
return courseOptions;
|
|
};
|
|
const Add_AddNewPaper = ({
|
|
user,
|
|
newExercisePaper,
|
|
dispatch
|
|
}) => {
|
|
var _a, _b, _c, _d, _e, _f, _g, _h, _i, _j, _k, _l;
|
|
const params = (0,_umi_production_exports.useParams)();
|
|
const courseOptions = useCourseOptions();
|
|
const [form] = es_form["default"].useForm();
|
|
const [initValue, setInitValue] = (0,_react_17_0_2_react.useState)();
|
|
const [loading, setLoading] = (0,_react_17_0_2_react.useState)(false);
|
|
const [current, setcurrent] = (0,_react_17_0_2_react.useState)(1);
|
|
const [itemid, setitemid] = (0,_react_17_0_2_react.useState)("");
|
|
const [searchParams] = (0,_umi_production_exports.useSearchParams)();
|
|
const [isedit, setisedit] = (0,_react_17_0_2_react.useState)(false);
|
|
(0,_react_17_0_2_react.useEffect)(() => {
|
|
if (searchParams.get("type") === "2") {
|
|
setitemid(params.id);
|
|
setcurrent(2);
|
|
}
|
|
}, [searchParams.get("type")]);
|
|
(0,_react_17_0_2_react.useEffect)(() => {
|
|
if (params.id) {
|
|
if (!courseOptions.length) {
|
|
return;
|
|
}
|
|
const getData = () => Add_async(void 0, null, function* () {
|
|
var _a2, _b2;
|
|
setLoading(true);
|
|
const res = yield (0,paperlibrary/* getExamDetail */.Di)({ id: params.id });
|
|
setLoading(false);
|
|
const subDisciplineId = (_a2 = res == null ? void 0 : res.exercise) == null ? void 0 : _a2.sub_discipline_id;
|
|
let valueForCascader = [];
|
|
for (const item of courseOptions) {
|
|
for (const option of item.children) {
|
|
if (option.value === subDisciplineId) {
|
|
valueForCascader = [item.value, option.value];
|
|
}
|
|
}
|
|
}
|
|
const time = (_b2 = res == null ? void 0 : res.exercise) == null ? void 0 : _b2.time;
|
|
const formInitValue = Add_spreadProps(Add_spreadValues({}, res.exercise), { sub_discipline_id: valueForCascader, time: time === -1 ? null : time });
|
|
setInitValue(formInitValue);
|
|
});
|
|
getData();
|
|
} else {
|
|
setInitValue({
|
|
time: 60,
|
|
difficulty: 2
|
|
});
|
|
}
|
|
dispatch({
|
|
type: "globalSetting/footerToggle",
|
|
payload: false
|
|
});
|
|
}, [courseOptions]);
|
|
return /* @__PURE__ */ Add_React.createElement("div", { style: { background: "#ffffff", marginTop: -8, padding: 8, minHeight: "100vh", paddingBottom: 64 } }, /* @__PURE__ */ Add_React.createElement("section", { className: "edu-container" }, /* @__PURE__ */ Add_React.createElement("section", { className: "animated fadeIn" }, /* @__PURE__ */ Add_React.createElement("aside", { style: { marginTop: 15 } }, /* @__PURE__ */ Add_React.createElement(breadcrumb/* default */.Z, { separator: ">" }, /* @__PURE__ */ Add_React.createElement(breadcrumb/* default */.Z.Item, null, /* @__PURE__ */ Add_React.createElement(_umi_production_exports.Link, { to: `/paperlibrary` }, "\u8BD5\u5377\u5E93")), /* @__PURE__ */ Add_React.createElement(breadcrumb/* default */.Z.Item, null, "\u4EBA\u5DE5\u7EC4\u5377")))), /* @__PURE__ */ Add_React.createElement("div", { className: "bg-white" }, /* @__PURE__ */ Add_React.createElement("div", { style: { display: "flex", justifyContent: "center", paddingTop: 20, alignItems: "center" } }, /* @__PURE__ */ Add_React.createElement("div", { onClick: () => {
|
|
if (isedit) {
|
|
message/* default */.ZP.info("\u8BF7\u5148\u4FDD\u5B58\u6216\u53D6\u6D88\u5F53\u524D\u6B63\u5728\u7F16\u8F91\u7684\u8BD5\u9898\u3002");
|
|
return;
|
|
}
|
|
setcurrent(1);
|
|
}, className: current === 1 ? Addmodules/* default */.Z.selectdiv : Addmodules/* default */.Z.divitem }, /* @__PURE__ */ Add_React.createElement(DigitalLabel/* default */.Z, { number: 1, active: current === 1, className: "mr10" }), /* @__PURE__ */ Add_React.createElement("span", null, "\u8BD5\u5377\u57FA\u7840\u4FE1\u606F")), /* @__PURE__ */ Add_React.createElement("div", { style: { width: 188, border: "1px dotted #9096A3", margin: "0px 30px", height: 1 } }), /* @__PURE__ */ Add_React.createElement("div", { onClick: () => {
|
|
if (!params.id && !itemid) {
|
|
message/* default */.ZP.info("\u8BF7\u5148\u4FDD\u5B58\u57FA\u7840\u4FE1\u606F\u518D\u65B0\u5EFA\u8BD5\u9898");
|
|
return;
|
|
}
|
|
setcurrent(2);
|
|
if (itemid) {
|
|
return;
|
|
}
|
|
setitemid(params.id);
|
|
}, className: current !== 1 ? Addmodules/* default */.Z.selectdiv : Addmodules/* default */.Z.divitem }, /* @__PURE__ */ Add_React.createElement(DigitalLabel/* default */.Z, { number: 2, active: current !== 1, className: "mr10" }), /* @__PURE__ */ Add_React.createElement("span", null, "\u7F16\u8F91\u8BD5\u9898"))), current === 2 && /* @__PURE__ */ Add_React.createElement("div", { className: "tc" }, /* @__PURE__ */ Add_React.createElement(
|
|
TitleEditor/* default */.Z,
|
|
{
|
|
defaultValue: (_b = (_a = newExercisePaper == null ? void 0 : newExercisePaper.editData) == null ? void 0 : _a.exercise) == null ? void 0 : _b.exercise_name,
|
|
onFinish: (newTitle) => Add_async(void 0, null, function* () {
|
|
var _a2, _b2, _c2, _d2, _e2, _f2, _g2, _h2, _i2, _j2, _k2, _l2;
|
|
if (newTitle.trim() === ((_b2 = (_a2 = newExercisePaper == null ? void 0 : newExercisePaper.editData) == null ? void 0 : _a2.exercise) == null ? void 0 : _b2.exercise_name)) {
|
|
return true;
|
|
}
|
|
const res = yield (0,paperlibrary/* updateExam */.w0)({
|
|
id: `${(_d2 = (_c2 = newExercisePaper == null ? void 0 : newExercisePaper.editData) == null ? void 0 : _c2.exercise) == null ? void 0 : _d2.id}`,
|
|
sub_discipline_id: (_f2 = (_e2 = newExercisePaper == null ? void 0 : newExercisePaper.editData) == null ? void 0 : _e2.exercise) == null ? void 0 : _f2.sub_discipline_id,
|
|
time: `${(_h2 = (_g2 = newExercisePaper == null ? void 0 : newExercisePaper.editData) == null ? void 0 : _g2.exercise) == null ? void 0 : _h2.time}`,
|
|
exercise_name: newTitle,
|
|
exercise_description: (_j2 = (_i2 = newExercisePaper == null ? void 0 : newExercisePaper.editData) == null ? void 0 : _i2.exercise) == null ? void 0 : _j2.exercise_description,
|
|
difficulty: (_l2 = (_k2 = newExercisePaper == null ? void 0 : newExercisePaper.editData) == null ? void 0 : _k2.exercise) == null ? void 0 : _l2.difficulty
|
|
});
|
|
if (res.status === 0) {
|
|
form.setFieldValue("exercise_name", newTitle);
|
|
dispatch({
|
|
type: "newExercisePaper/modifyTitle",
|
|
payload: newTitle
|
|
});
|
|
return true;
|
|
}
|
|
return false;
|
|
})
|
|
}
|
|
), /* @__PURE__ */ Add_React.createElement("div", { style: { fontSize: 14 } }, /* @__PURE__ */ Add_React.createElement("span", { style: { color: "#5F6368" } }, "\u7B54\u9898\u65F6\u957F", /* @__PURE__ */ Add_React.createElement("span", { style: { color: "#000000", marginLeft: 8 } }, (_d = (_c = newExercisePaper == null ? void 0 : newExercisePaper.editData) == null ? void 0 : _c.exercise) == null ? void 0 : _d.time)), /* @__PURE__ */ Add_React.createElement("span", { style: { margin: "0px 30px", color: "#5F6368" } }, "\u96BE\u5EA6", /* @__PURE__ */ Add_React.createElement("span", { style: { color: "#000000", marginLeft: 8 } }, ((_f = (_e = newExercisePaper == null ? void 0 : newExercisePaper.editData) == null ? void 0 : _e.exercise) == null ? void 0 : _f.difficulty) === 1 ? "\u7B80\u5355" : ((_h = (_g = newExercisePaper == null ? void 0 : newExercisePaper.editData) == null ? void 0 : _g.exercise) == null ? void 0 : _h.difficulty) === 2 ? "\u9002\u4E2D" : "\u56F0\u96BE")), /* @__PURE__ */ Add_React.createElement("span", { style: { marginRight: 30, color: "#5F6368" } }, "\u8BD5\u9898\u603B\u6570", /* @__PURE__ */ Add_React.createElement("span", { style: { color: "#000000", marginLeft: 8 } }, ((_j = (_i = newExercisePaper == null ? void 0 : newExercisePaper.editData) == null ? void 0 : _i.exercise_types) == null ? void 0 : _j.q_counts) || 0)), /* @__PURE__ */ Add_React.createElement("span", { style: { color: "#5F6368" } }, "\u603B\u5206", /* @__PURE__ */ Add_React.createElement("span", { style: { color: "#000000", marginLeft: 8 } }, (_l = (_k = newExercisePaper == null ? void 0 : newExercisePaper.editData) == null ? void 0 : _k.exercise_types) == null ? void 0 : _l.q_scores))))), current === 1 && /* @__PURE__ */ Add_React.createElement(
|
|
spin/* default */.Z,
|
|
{
|
|
spinning: loading,
|
|
size: "middle",
|
|
style: {
|
|
position: "fixed",
|
|
maxHeight: "100vh"
|
|
},
|
|
className: "mt30"
|
|
},
|
|
/* @__PURE__ */ Add_React.createElement(
|
|
"section",
|
|
{
|
|
className: [Addmodules/* default */.Z.bg, "mt20"].join(
|
|
" "
|
|
),
|
|
style: { padding: "30px 120px 300px 120px" }
|
|
},
|
|
initValue && /* @__PURE__ */ Add_React.createElement(
|
|
es_form["default"],
|
|
{
|
|
layout: "horizontal",
|
|
form,
|
|
colon: false,
|
|
labelCol: { span: 4 },
|
|
wrapperCol: { span: 20 },
|
|
className: Addmodules/* default */.Z.formWrap,
|
|
initialValues: initValue
|
|
},
|
|
/* @__PURE__ */ Add_React.createElement(
|
|
es_form["default"].Item,
|
|
{
|
|
name: "exercise_name",
|
|
label: "\u8BD5\u5377\u540D\u79F0",
|
|
className: Addmodules/* default */.Z.baseLineHeight,
|
|
rules: [
|
|
{
|
|
required: true,
|
|
validator: (_, value) => {
|
|
var _a2;
|
|
return ((_a2 = value == null ? void 0 : value.replaceAll(" ", "")) == null ? void 0 : _a2.length) > 0 ? Promise.resolve() : Promise.reject("\u8BF7\u8F93\u5165\u8BD5\u5377\u540D\u79F0");
|
|
}
|
|
}
|
|
]
|
|
},
|
|
/* @__PURE__ */ Add_React.createElement(input["default"], { maxLength: 60, className: Addmodules/* default */.Z.baseFormItem, placeholder: "\u8BF7\u8F93\u5165\u8BD5\u5377\u540D\u79F0", showCount: true })
|
|
),
|
|
/* @__PURE__ */ Add_React.createElement(
|
|
es_form["default"].Item,
|
|
{
|
|
label: "\u65B9\u5411&\u8BFE\u7A0B",
|
|
name: "sub_discipline_id",
|
|
className: Addmodules/* default */.Z.baseLineHeight,
|
|
rules: [{ required: true, message: "\u8BF7\u9009\u62E9\u65B9\u5411&\u8BFE\u7A0B" }]
|
|
},
|
|
/* @__PURE__ */ Add_React.createElement(
|
|
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__ */ Add_React.createElement(
|
|
es_form["default"].Item,
|
|
{
|
|
label: "\u96BE\u5EA6",
|
|
name: "difficulty",
|
|
className: Addmodules/* default */.Z.radioBtnWrapper,
|
|
rules: [{ required: true, message: "\u8BF7\u9009\u62E9\u96BE\u5EA6" }]
|
|
},
|
|
/* @__PURE__ */ Add_React.createElement(es_radio/* default.Group */.ZP.Group, { className: Addmodules/* default */.Z.radiogroup }, /* @__PURE__ */ Add_React.createElement(es_radio/* default.Button */.ZP.Button, { className: Addmodules/* default */.Z.easy, value: 1 }, "\u7B80\u5355"), /* @__PURE__ */ Add_React.createElement(es_radio/* default.Button */.ZP.Button, { className: Addmodules/* default */.Z.medium, value: 2 }, "\u9002\u4E2D"), /* @__PURE__ */ Add_React.createElement(es_radio/* default.Button */.ZP.Button, { className: Addmodules/* default */.Z.hard, value: 3 }, "\u56F0\u96BE"))
|
|
),
|
|
/* @__PURE__ */ Add_React.createElement(es_form["default"].Item, { label: "\u7B54\u9898\u65F6\u957F", className: Addmodules/* default */.Z.baseLineHeight }, /* @__PURE__ */ Add_React.createElement("div", { style: { display: "flex", width: "100%" } }, /* @__PURE__ */ Add_React.createElement(es_form["default"].Item, { name: "time", noStyle: true }, /* @__PURE__ */ Add_React.createElement(
|
|
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__ */ Add_React.createElement(
|
|
"span",
|
|
{
|
|
style: {
|
|
marginLeft: "10px",
|
|
width: "40px",
|
|
lineHeight: "46px",
|
|
fontSize: 14
|
|
}
|
|
},
|
|
"\u5206\u949F"
|
|
))),
|
|
/* @__PURE__ */ Add_React.createElement(es_form["default"].Item, { label: "\u8BD5\u5377\u987B\u77E5", name: "exercise_description" }, /* @__PURE__ */ Add_React.createElement(
|
|
input["default"].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__ */ Add_React.createElement("div", { className: Addmodules/* default */.Z.bottmodiv }, /* @__PURE__ */ Add_React.createElement(
|
|
es_button/* default */.ZP,
|
|
{
|
|
className: `${Addmodules/* default */.Z.cancelBtn} mr5`,
|
|
type: "primary",
|
|
onClick: () => {
|
|
if (searchParams.get("pageType") == "course") {
|
|
_umi_production_exports.history.push(`/paths/${searchParams.get("courseId")}`);
|
|
} else {
|
|
_umi_production_exports.history.push(`/paperlibrary`);
|
|
}
|
|
}
|
|
},
|
|
"\u53D6\u6D88"
|
|
), /* @__PURE__ */ Add_React.createElement(
|
|
AsyncButton/* AsyncButton */.Z,
|
|
{
|
|
className: `${Addmodules/* default */.Z.confirmBtn} ml15`,
|
|
type: "primary",
|
|
onClick: () => Add_async(void 0, null, function* () {
|
|
var _a2, _b2, _c2;
|
|
yield form.validateFields();
|
|
const formValue = form.getFieldsValue();
|
|
formValue["sub_discipline_id"] = formValue["sub_discipline_id"][1];
|
|
if (params.id) {
|
|
const res2 = yield (0,paperlibrary/* updateExam */.w0)(Add_spreadValues({ id: params.id }, formValue));
|
|
if (res2.status === 0) {
|
|
setitemid(params.id);
|
|
setcurrent(2);
|
|
_umi_production_exports.history.replace(`/paperlibrary/add/${params.id}?type=2`);
|
|
}
|
|
return;
|
|
}
|
|
const res = yield (0,paperlibrary/* createExam */.un)(formValue);
|
|
if (res.status === 0) {
|
|
setitemid((_a2 = res == null ? void 0 : res.data) == null ? void 0 : _a2.exam_id);
|
|
setcurrent(2);
|
|
if (searchParams.get("pageType") == "course") {
|
|
_umi_production_exports.history.replace(`/paperlibrary/add/${(_b2 = res == null ? void 0 : res.data) == null ? void 0 : _b2.exam_id}?type=2&pageType=course&courseId=${searchParams.get("courseId")}&stageId=${searchParams.get("stageId")}`);
|
|
} else {
|
|
_umi_production_exports.history.replace(`/paperlibrary/add/${(_c2 = res == null ? void 0 : res.data) == null ? void 0 : _c2.exam_id}?type=2`);
|
|
}
|
|
}
|
|
})
|
|
},
|
|
"\u4E0B\u4E00\u6B65"
|
|
))
|
|
), current === 2 && /* @__PURE__ */ Add_React.createElement("div", null, /* @__PURE__ */ Add_React.createElement(EditPotin, { setisedits: setisedit, itemid }))));
|
|
};
|
|
/* harmony default export */ var Add = ((0,_umi_production_exports.connect)(
|
|
({
|
|
user,
|
|
newExercisePaper,
|
|
dispatch
|
|
}) => ({
|
|
user,
|
|
newExercisePaper,
|
|
dispatch
|
|
})
|
|
)(Add_AddNewPaper));
|
|
|
|
|
|
/***/ }),
|
|
|
|
/***/ 24239:
|
|
/*!****************************************!*\
|
|
!*** ./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 react__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! react */ 59301);
|
|
|
|
const useOverflow = () => {
|
|
const [overflow, setOverflow] = (0,react__WEBPACK_IMPORTED_MODULE_0__.useState)("hidden");
|
|
const handleMouseEnter = () => setOverflow("auto");
|
|
const handleMouseLeave = () => setOverflow("hidden");
|
|
return {
|
|
overflow,
|
|
handleMouseEnter,
|
|
handleMouseLeave
|
|
};
|
|
};
|
|
|
|
|
|
/***/ })
|
|
|
|
}]); |