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.
923 lines
51 KiB
923 lines
51 KiB
"use strict";
|
|
(self["webpackChunk"] = self["webpackChunk"] || []).push([[3247],{
|
|
|
|
/***/ 36647:
|
|
/*!**********************************************!*\
|
|
!*** ./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);
|
|
};
|
|
|
|
|
|
/***/ }),
|
|
|
|
/***/ 10001:
|
|
/*!**************************************************************************!*\
|
|
!*** ./src/components/EcListItems/Problemset/Card/index.tsx + 1 modules ***!
|
|
\**************************************************************************/
|
|
/***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) {
|
|
|
|
|
|
// EXPORTS
|
|
__webpack_require__.d(__webpack_exports__, {
|
|
Z: function() { return /* binding */ Problemset_Card; }
|
|
});
|
|
|
|
// EXTERNAL MODULE: ./node_modules/_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/radio/index.js + 5 modules
|
|
var es_radio = __webpack_require__(5112);
|
|
// EXTERNAL MODULE: ./src/components/RenderHtml/index.tsx + 1 modules
|
|
var RenderHtml = __webpack_require__(12586);
|
|
;// CONCATENATED MODULE: ./src/components/EcListItems/Problemset/Card/index.less?modules
|
|
// extracted by mini-css-extract-plugin
|
|
/* harmony default export */ var Cardmodules = ({"flexRow":"flexRow____Sm4b","flexColumn":"flexColumn___mQNZs","action":"action___QUVEn","setScore":"setScore___yZ0Yb","delete":"delete___e4taL","content":"content___jR4Y6","titleWrap":"titleWrap___zsXYY","titleNumber":"titleNumber___p60vi","score":"score___DbCHw","titleHtml":"titleHtml___FALbj","answerWrap":"answerWrap___uPjYq","answer":"answer___pfiPk","answerText":"answerText___K3TNr"});
|
|
// EXTERNAL MODULE: ./node_modules/_js-base64@2.6.4@js-base64/base64.js
|
|
var base64 = __webpack_require__(24334);
|
|
;// CONCATENATED MODULE: ./src/components/EcListItems/Problemset/Card/index.tsx
|
|
|
|
|
|
|
|
|
|
|
|
const tagDotList = [
|
|
"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: "single", name: "\u5355\u9009\u9898" },
|
|
{ type: "multiple", name: "\u591A\u9009\u9898" },
|
|
{ type: "judgement", name: "\u5224\u65AD\u9898" },
|
|
{ type: "completion", name: "\u586B\u7A7A\u9898" },
|
|
{ type: "subjective", name: "\u7B80\u7B54\u9898" }
|
|
];
|
|
const Card = ({
|
|
index,
|
|
typeName,
|
|
type,
|
|
data = {},
|
|
inMouseId,
|
|
isshow,
|
|
onSetScore = () => {
|
|
},
|
|
onDelete = () => {
|
|
},
|
|
onMouseEnter = () => {
|
|
},
|
|
showAnswer = false
|
|
}) => {
|
|
var _a;
|
|
const [isopen, setisopen] = (0,_react_17_0_2_react.useState)(false);
|
|
const renderSingleOrMultiple = () => {
|
|
var _a2;
|
|
return /* @__PURE__ */ _react_17_0_2_react.createElement("div", { className: Cardmodules.answerWrap }, (_a2 = data == null ? void 0 : data.choices) == null ? void 0 : _a2.map((item, index2) => {
|
|
return /* @__PURE__ */ _react_17_0_2_react.createElement("div", { className: `${Cardmodules.flexRow} mt15`, key: index2 }, /* @__PURE__ */ _react_17_0_2_react.createElement("div", { style: { lineHeight: "24px", flexShrink: 0 } }, tagDotList[index2]), /* @__PURE__ */ _react_17_0_2_react.createElement("div", { className: `${Cardmodules.answer} ml5` }, /* @__PURE__ */ _react_17_0_2_react.createElement(RenderHtml/* default */.Z, { value: item == null ? void 0 : item.choice_text })));
|
|
}), showAnswer && /* @__PURE__ */ _react_17_0_2_react.createElement("div", { className: `mt10 ${Cardmodules.answerText}` }, "\u53C2\u8003\u7B54\u6848\uFF1A", data == null ? void 0 : data.standard_answer_show));
|
|
};
|
|
const renderJudgment = () => {
|
|
var _a2;
|
|
return /* @__PURE__ */ _react_17_0_2_react.createElement("div", { className: Cardmodules.answerWrap }, /* @__PURE__ */ _react_17_0_2_react.createElement("div", { className: `${Cardmodules.flexRow} mt15` }, (_a2 = data == null ? void 0 : data.choices) == null ? void 0 : _a2.map((item, index2) => {
|
|
return /* @__PURE__ */ _react_17_0_2_react.createElement(es_radio/* default */.ZP, { disabled: true, key: index2 }, item == null ? void 0 : item.choice_text);
|
|
})), showAnswer && /* @__PURE__ */ _react_17_0_2_react.createElement("div", { className: `mt10 ${Cardmodules.answerText}` }, "\u53C2\u8003\u7B54\u6848\uFF1A", data == null ? void 0 : data.standard_answer_show));
|
|
};
|
|
const renderProgram = () => {
|
|
var _a2;
|
|
return /* @__PURE__ */ _react_17_0_2_react.createElement("div", { className: Cardmodules.answerWrap }, /* @__PURE__ */ _react_17_0_2_react.createElement("div", { className: `${Cardmodules.flexRow} mt15` }, /* @__PURE__ */ _react_17_0_2_react.createElement(RenderHtml/* default */.Z, { value: (_a2 = data == null ? void 0 : data.program_attr) == null ? void 0 : _a2.description })), showAnswer && /* @__PURE__ */ _react_17_0_2_react.createElement("div", { className: `mt15` }, /* @__PURE__ */ _react_17_0_2_react.createElement("div", { className: Cardmodules.answerText }, "\u53C2\u8003\u7B54\u6848\uFF1A"), /* @__PURE__ */ _react_17_0_2_react.createElement(RenderHtml/* default */.Z, { value: (data == null ? void 0 : data.answer_text) || "" })));
|
|
};
|
|
const renderCompletion = () => {
|
|
var _a2;
|
|
return /* @__PURE__ */ _react_17_0_2_react.createElement("div", { className: Cardmodules.answerWrap }, showAnswer && /* @__PURE__ */ _react_17_0_2_react.createElement("div", { className: `${Cardmodules.flexColumn} mt15` }, (_a2 = data == null ? void 0 : data.standard_answer) == null ? void 0 : _a2.map((item, index2) => {
|
|
return /* @__PURE__ */ _react_17_0_2_react.createElement(RenderHtml/* default */.Z, { key: index2, value: `\u53C2\u8003\u7B54\u6848\uFF08\u586B\u7A7A${item.position}\uFF09\uFF1A${item.answer_text.join("\u3001")}`, className: Cardmodules.answerText });
|
|
})));
|
|
};
|
|
const renderSubjective = () => {
|
|
var _a2;
|
|
return /* @__PURE__ */ _react_17_0_2_react.createElement("div", { className: Cardmodules.answerWrap }, showAnswer && /* @__PURE__ */ _react_17_0_2_react.createElement("div", { className: `mt15` }, /* @__PURE__ */ _react_17_0_2_react.createElement("div", { className: Cardmodules.answerText }, "\u53C2\u8003\u7B54\u6848\uFF1A"), /* @__PURE__ */ _react_17_0_2_react.createElement(RenderHtml/* default */.Z, { value: (_a2 = data == null ? void 0 : data.answer_texts) == null ? void 0 : _a2[0], className: Cardmodules.answerText })));
|
|
};
|
|
const renderBProgram = () => {
|
|
var _a2, _b;
|
|
return /* @__PURE__ */ _react_17_0_2_react.createElement("div", { className: Cardmodules.answerWrap, style: { marginTop: 10 } }, /* @__PURE__ */ _react_17_0_2_react.createElement(RenderHtml/* default */.Z, { value: base64.Base64.decode((_a2 = data == null ? void 0 : data.program_attr) == null ? void 0 : _a2.code) }), showAnswer && /* @__PURE__ */ _react_17_0_2_react.createElement("div", { className: `${Cardmodules.flexColumn} mt15` }, (_b = data == null ? void 0 : data.standard_answer) == null ? void 0 : _b.map((item, index2) => {
|
|
return /* @__PURE__ */ _react_17_0_2_react.createElement(RenderHtml/* default */.Z, { key: index2, value: `\u53C2\u8003\u7B54\u6848\uFF08\u586B\u7A7A${item.position}\uFF09\uFF1A${item.answer_text}` });
|
|
})));
|
|
};
|
|
const renderShixun = () => {
|
|
var _a2;
|
|
return /* @__PURE__ */ _react_17_0_2_react.createElement("div", { className: Cardmodules.answerWrap }, /* @__PURE__ */ _react_17_0_2_react.createElement("div", { className: "mt10" }, "\u5173\u5361"), (_a2 = data == null ? void 0 : data.shixun) == null ? void 0 : _a2.map((item, index2) => {
|
|
return /* @__PURE__ */ _react_17_0_2_react.createElement("div", { className: "mt10 font14", key: index2 }, index2 + 1, ". ", item == null ? void 0 : item.challenge_name);
|
|
}));
|
|
};
|
|
const renderCombination = () => {
|
|
var _a2;
|
|
return /* @__PURE__ */ _react_17_0_2_react.createElement("div", { className: Cardmodules.answerWrap, style: { display: isopen && "none" } }, (_a2 = data == null ? void 0 : data.sub_questions) == null ? void 0 : _a2.map((e, i) => {
|
|
var _a3, _b, _c, _d, _e;
|
|
const str = `<span style="margin-right: 10px">${index + 1}.${i + 1}</span><span>\uFF08${(_a3 = questionType.find((i2) => i2.type == e.item_type)) == null ? void 0 : _a3.name}\uFF09</span><span class="c-grey-999">\uFF08${e.score}\u5206\uFF09</span>`;
|
|
return /* @__PURE__ */ _react_17_0_2_react.createElement(_react_17_0_2_react.Fragment, { key: e == null ? void 0 : e.id }, /* @__PURE__ */ _react_17_0_2_react.createElement("div", { className: Cardmodules.titleWrap, style: { marginTop: 16 } }, /* @__PURE__ */ _react_17_0_2_react.createElement(RenderHtml/* default */.Z, { className: Cardmodules.titleHtml, value: str + e.name })), (e.item_type == "single" || e.item_type == "multiple") && /* @__PURE__ */ _react_17_0_2_react.createElement(_react_17_0_2_react.Fragment, null, (_b = e == null ? void 0 : e.choices) == null ? void 0 : _b.map((item, index2) => {
|
|
return /* @__PURE__ */ _react_17_0_2_react.createElement("div", { className: `${Cardmodules.flexRow} mt15`, key: index2 }, /* @__PURE__ */ _react_17_0_2_react.createElement("div", { style: { lineHeight: "24px", flexShrink: 0 } }, tagDotList[index2]), /* @__PURE__ */ _react_17_0_2_react.createElement("div", { className: `${Cardmodules.answer} ml5` }, /* @__PURE__ */ _react_17_0_2_react.createElement(RenderHtml/* default */.Z, { value: item == null ? void 0 : item.choice_text })));
|
|
}), showAnswer && /* @__PURE__ */ _react_17_0_2_react.createElement("div", { className: `mt10 ${Cardmodules.answerText}` }, "\u53C2\u8003\u7B54\u6848\uFF1A", e == null ? void 0 : e.standard_answer_show)), e.item_type == "judgement" && /* @__PURE__ */ _react_17_0_2_react.createElement("div", { className: Cardmodules.answerWrap }, /* @__PURE__ */ _react_17_0_2_react.createElement("div", { className: `${Cardmodules.flexRow} mt15` }, (_c = e == null ? void 0 : e.choices) == null ? void 0 : _c.map((item, index2) => {
|
|
return /* @__PURE__ */ _react_17_0_2_react.createElement(es_radio/* default */.ZP, { disabled: true, key: index2 }, item == null ? void 0 : item.choice_text);
|
|
})), showAnswer && /* @__PURE__ */ _react_17_0_2_react.createElement("div", { className: `mt10 ${Cardmodules.answerText}` }, "\u53C2\u8003\u7B54\u6848\uFF1A", e == null ? void 0 : e.standard_answer_show)), e.item_type == "completion" && /* @__PURE__ */ _react_17_0_2_react.createElement("div", { className: Cardmodules.answerWrap }, showAnswer && /* @__PURE__ */ _react_17_0_2_react.createElement("div", { className: `${Cardmodules.flexColumn} mt15` }, (_d = e == null ? void 0 : e.standard_answer) == null ? void 0 : _d.map((item, index2) => {
|
|
return /* @__PURE__ */ _react_17_0_2_react.createElement(RenderHtml/* default */.Z, { key: index2, value: `\u53C2\u8003\u7B54\u6848\uFF08\u586B\u7A7A${item.position}\uFF09\uFF1A${item.answer_text.join("\u3001")}`, className: Cardmodules.answerText });
|
|
}))), e.item_type == "subjective" && /* @__PURE__ */ _react_17_0_2_react.createElement("div", { className: Cardmodules.answerWrap }, showAnswer && /* @__PURE__ */ _react_17_0_2_react.createElement("div", { className: `mt15` }, /* @__PURE__ */ _react_17_0_2_react.createElement("div", { className: Cardmodules.answerText }, "\u53C2\u8003\u7B54\u6848\uFF1A"), /* @__PURE__ */ _react_17_0_2_react.createElement(RenderHtml/* default */.Z, { value: (_e = e == null ? void 0 : e.answer_texts) == null ? void 0 : _e[0], className: Cardmodules.answerText }))));
|
|
}));
|
|
};
|
|
const renderAnswer = () => {
|
|
const mapping = {
|
|
"SINGLE": renderSingleOrMultiple,
|
|
"MULTIPLE": renderSingleOrMultiple,
|
|
"JUDGMENT": renderJudgment,
|
|
"PROGRAM": renderProgram,
|
|
"COMPLETION": renderCompletion,
|
|
"SUBJECTIVE": renderSubjective,
|
|
"PRACTICAL": renderShixun,
|
|
"COMBINATION": renderCombination,
|
|
"BPROGRAM": renderBProgram
|
|
};
|
|
return mapping[type] ? mapping[type]() : null;
|
|
};
|
|
const getDomString = (data2, i) => {
|
|
var _a2;
|
|
const str = `<span style="margin-right: -10px">${i + 1}\u3001</span><span class="c-grey-999">\uFF08${(data2 == null ? void 0 : data2.item_type) === "combination" ? `\u5171${(_a2 = data2 == null ? void 0 : data2.sub_questions) == null ? void 0 : _a2.length}\u5C0F\u9898\uFF0C` : ""}${data2.score}\u5206\uFF09</span> `;
|
|
return str;
|
|
};
|
|
return /* @__PURE__ */ _react_17_0_2_react.createElement(
|
|
"div",
|
|
{
|
|
onMouseEnter: () => onMouseEnter(data.id)
|
|
},
|
|
inMouseId === data.id && /* @__PURE__ */ _react_17_0_2_react.createElement("div", { className: Cardmodules.action }, /* @__PURE__ */ _react_17_0_2_react.createElement("div", { className: Cardmodules.setScore, onClick: () => onSetScore(data.id, typeName, data == null ? void 0 : data.shixun, data.score, data) }, "\u8BBE\u7F6E\u5F97\u5206"), /* @__PURE__ */ _react_17_0_2_react.createElement("div", { className: Cardmodules.delete, onClick: () => onDelete(data.id) }, "\u5220\u9664")),
|
|
/* @__PURE__ */ _react_17_0_2_react.createElement("div", { className: Cardmodules.content }, /* @__PURE__ */ _react_17_0_2_react.createElement("div", { className: Cardmodules.titleWrap, style: { justifyContent: "space-between" } }, (data == null ? void 0 : data.item_type) === "bprogram" ? /* @__PURE__ */ _react_17_0_2_react.createElement(RenderHtml/* default */.Z, { className: Cardmodules.titleHtml, value: getDomString(data, index) + ((_a = data == null ? void 0 : data.program_attr) == null ? void 0 : _a.description) }) : /* @__PURE__ */ _react_17_0_2_react.createElement(RenderHtml/* default */.Z, { className: Cardmodules.titleHtml, value: getDomString(data, index) + ((data == null ? void 0 : data.item_type) === "combination" ? `\uFF08\u9898\u5E72\uFF09` : "") + (data.name || (data == null ? void 0 : data.shixun_name)) }), (data == null ? void 0 : data.item_type) === "combination" && !isshow && /* @__PURE__ */ _react_17_0_2_react.createElement("span", { onClick: (e) => {
|
|
setisopen(!isopen);
|
|
}, style: { textAlign: "end", flexShrink: 0, cursor: "pointer" } }, isopen ? "\u5C55\u5F00" : "\u6536\u8D77")), renderAnswer())
|
|
);
|
|
};
|
|
/* harmony default export */ var Problemset_Card = (Card);
|
|
|
|
|
|
/***/ }),
|
|
|
|
/***/ 41993:
|
|
/*!**********************************************************!*\
|
|
!*** ./src/components/FixedButton/index.tsx + 1 modules ***!
|
|
\**********************************************************/
|
|
/***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) {
|
|
|
|
|
|
// EXPORTS
|
|
__webpack_require__.d(__webpack_exports__, {
|
|
t: function() { return /* binding */ FixedButton; }
|
|
});
|
|
|
|
// EXTERNAL MODULE: ./node_modules/_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/button/index.js
|
|
var es_button = __webpack_require__(3113);
|
|
;// CONCATENATED MODULE: ./src/components/FixedButton/index.less?modules
|
|
// extracted by mini-css-extract-plugin
|
|
/* harmony default export */ var FixedButtonmodules = ({"buttonFixed":"buttonFixed___vyq30","button":"button___hxmYv","buttonWrap":"buttonWrap___uK8dl"});
|
|
// EXTERNAL MODULE: ./node_modules/_classnames@2.3.2@classnames/index.js
|
|
var _classnames_2_3_2_classnames = __webpack_require__(12124);
|
|
var _classnames_2_3_2_classnames_default = /*#__PURE__*/__webpack_require__.n(_classnames_2_3_2_classnames);
|
|
;// CONCATENATED MODULE: ./src/components/FixedButton/index.tsx
|
|
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 FixedButton = ({
|
|
cancelText = "\u53D6\u6D88",
|
|
okText = "\u786E\u5B9A",
|
|
loading = false,
|
|
hasOkBtn = true,
|
|
hasCancelBtn = true,
|
|
okButtonProps = {},
|
|
onCancel = () => {
|
|
},
|
|
onOk = () => {
|
|
},
|
|
className = ""
|
|
}) => {
|
|
return /* @__PURE__ */ _react_17_0_2_react.createElement("div", { className: _classnames_2_3_2_classnames_default()(FixedButtonmodules.buttonFixed, className) }, /* @__PURE__ */ _react_17_0_2_react.createElement("div", { className: FixedButtonmodules.buttonWrap }, hasCancelBtn && /* @__PURE__ */ _react_17_0_2_react.createElement(
|
|
es_button/* default */.ZP,
|
|
{
|
|
size: "middle",
|
|
className: `${FixedButtonmodules.button} mr20`,
|
|
onClick: onCancel
|
|
},
|
|
cancelText
|
|
), hasOkBtn && /* @__PURE__ */ _react_17_0_2_react.createElement(
|
|
es_button/* default */.ZP,
|
|
__spreadValues({
|
|
size: "middle",
|
|
type: "primary",
|
|
className: `${FixedButtonmodules.button} mr20`,
|
|
loading,
|
|
onClick: onOk
|
|
}, okButtonProps),
|
|
okText
|
|
)));
|
|
};
|
|
|
|
|
|
/***/ }),
|
|
|
|
/***/ 3735:
|
|
/*!*************************************************!*\
|
|
!*** ./src/pages/Paperlibrary/See/exportPDF.ts ***!
|
|
\*************************************************/
|
|
/***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) {
|
|
|
|
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
|
|
/* harmony export */ F: function() { return /* binding */ exportPDF; }
|
|
/* harmony export */ });
|
|
/* harmony import */ var html2pdf_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! html2pdf.js */ 44425);
|
|
/* harmony import */ var html2pdf_js__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(html2pdf_js__WEBPACK_IMPORTED_MODULE_0__);
|
|
/* harmony import */ var jszip__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! jszip */ 86129);
|
|
/* harmony import */ var jszip__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(jszip__WEBPACK_IMPORTED_MODULE_1__);
|
|
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 scrollView = () => {
|
|
document.body.scrollIntoView();
|
|
};
|
|
const removeSurplusCanvas = () => {
|
|
document.querySelectorAll("canvas").forEach((item) => {
|
|
(!item.clientWidth || !item.clientHeight) && item.remove();
|
|
});
|
|
};
|
|
const exportPDF = (DOMList, fileTitle) => __async(void 0, null, function* () {
|
|
scrollView();
|
|
removeSurplusCanvas();
|
|
const opt = {
|
|
margin: [0, 1, 0, 0],
|
|
html2canvas: { letterRendering: true, useCORS: true, allowTaint: false, width: 810 },
|
|
jsPDF: { unit: "in", format: "letter", orientation: "portrait" }
|
|
};
|
|
let worker = html2pdf_js__WEBPACK_IMPORTED_MODULE_0___default()();
|
|
for (let i = 0; i < DOMList.length; i++) {
|
|
yield worker.set(opt).from(DOMList[i]).toContainer().toCanvas().toPdf().get("pdf").then((pdf) => __async(void 0, null, function* () {
|
|
if (i < DOMList.length - 1) {
|
|
yield pdf.addPage();
|
|
}
|
|
}));
|
|
}
|
|
const zip = new (jszip__WEBPACK_IMPORTED_MODULE_1___default())();
|
|
zip.file(`${fileTitle}.pdf`, worker.output("blob"), { base64: false });
|
|
zip.generateAsync({ type: "blob" }).then(function(content) {
|
|
const link = document.createElement("a");
|
|
link.href = window.URL.createObjectURL(content);
|
|
link.download = `${fileTitle}.zip`;
|
|
document.body.appendChild(link);
|
|
const event = new MouseEvent("click");
|
|
link.dispatchEvent(event);
|
|
document.body.removeChild(link);
|
|
});
|
|
});
|
|
|
|
|
|
/***/ }),
|
|
|
|
/***/ 27662:
|
|
/*!**********************************************************!*\
|
|
!*** ./src/pages/Paperlibrary/See/index.tsx + 1 modules ***!
|
|
\**********************************************************/
|
|
/***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) {
|
|
|
|
// ESM COMPAT FLAG
|
|
__webpack_require__.r(__webpack_exports__);
|
|
|
|
// EXPORTS
|
|
__webpack_require__.d(__webpack_exports__, {
|
|
"default": function() { return /* binding */ Paperlibrary_See; }
|
|
});
|
|
|
|
// EXTERNAL MODULE: ./node_modules/_react@17.0.2@react/index.js
|
|
var _react_17_0_2_react = __webpack_require__(59301);
|
|
// EXTERNAL MODULE: ./src/.umi-production/exports.ts + 14 modules
|
|
var _umi_production_exports = __webpack_require__(87210);
|
|
// 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/row/index.js
|
|
var row = __webpack_require__(95237);
|
|
// 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/table/index.js + 85 modules
|
|
var table = __webpack_require__(72315);
|
|
// EXTERNAL MODULE: ./node_modules/_antd@5.9.0@antd/es/modal/index.js + 16 modules
|
|
var modal = __webpack_require__(43418);
|
|
// EXTERNAL MODULE: ./node_modules/_@ant-design_icons@5.2.6@@ant-design/icons/es/icons/DownloadOutlined.js + 1 modules
|
|
var DownloadOutlined = __webpack_require__(42813);
|
|
// EXTERNAL MODULE: ./src/components/EcListItems/Problemset/Card/index.tsx + 1 modules
|
|
var Card = __webpack_require__(10001);
|
|
// EXTERNAL MODULE: ./src/components/FixedButton/index.tsx + 1 modules
|
|
var FixedButton = __webpack_require__(41993);
|
|
;// CONCATENATED MODULE: ./src/pages/Paperlibrary/See/index.less?modules
|
|
// extracted by mini-css-extract-plugin
|
|
/* harmony default export */ var Seemodules = ({"bg":"bg___vBzoO","wrap":"wrap___rrSkg","title":"title___itgaE","btnWrapper":"btnWrapper___F_tyj","titleForExport":"titleForExport___lhBnq","flexRow":"flexRow___cvXQo","flexColumn":"flexColumn___cTDFf","flexJustifyBetween":"flexJustifyBetween___vy_7r","relative":"relative____B_F8","questionNumber":"questionNumber___V4g28","score":"score___dNKpj","selectTopicButton":"selectTopicButton___NO9DO","line":"line___j553x","dragTip":"dragTip___AaESI","typeActive":"typeActive___dLHVW","mouseTypeActive":"mouseTypeActive___N_Yv8","typeName":"typeName___bdcw3","typeNumber":"typeNumber___B6Fic","typeAction":"typeAction___O3dpz","setScore":"setScore___GA5cK","delete":"delete___O2OvN","modal":"modal___0ENtb","table":"table___ZRr4b","glassSeal":"glassSeal___C7Vpa","export_type_modal":"export_type_modal___ldAtg","export_type_modal_con":"export_type_modal_con___Y9iST","type_item":"type_item___cWirW","img_warp":"img_warp___G7xtB","img_warp_active":"img_warp_active___rw33a"});
|
|
// EXTERNAL MODULE: ./src/pages/Paperlibrary/components/SendToClassModal.tsx + 6 modules
|
|
var SendToClassModal = __webpack_require__(78500);
|
|
// EXTERNAL MODULE: ./src/pages/Paperlibrary/See/exportPDF.ts
|
|
var exportPDF = __webpack_require__(3735);
|
|
// EXTERNAL MODULE: ./src/components/AsyncButton/index.tsx
|
|
var AsyncButton = __webpack_require__(36647);
|
|
// EXTERNAL MODULE: ./src/service/paperlibrary.ts
|
|
var service_paperlibrary = __webpack_require__(82886);
|
|
// EXTERNAL MODULE: ./src/utils/constant.ts
|
|
var constant = __webpack_require__(65359);
|
|
// EXTERNAL MODULE: ./src/utils/export.ts
|
|
var utils_export = __webpack_require__(69193);
|
|
;// CONCATENATED MODULE: ./src/pages/Paperlibrary/See/index.tsx
|
|
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;
|
|
};
|
|
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 See = ({
|
|
newExercisePaper,
|
|
isExportBlank = false,
|
|
paperlibrary,
|
|
user,
|
|
globalSetting,
|
|
loading,
|
|
dispatch
|
|
}) => {
|
|
var _a, _b, _c, _d, _e, _f, _g, _h, _i, _j, _k, _l, _m;
|
|
const location = (0,_umi_production_exports.useLocation)();
|
|
const params = (0,_umi_production_exports.useParams)();
|
|
const [searchParams] = (0,_umi_production_exports.useSearchParams)();
|
|
const [defaultActiveKey, setDefaultActiveKey] = (0,_react_17_0_2_react.useState)();
|
|
const id = (0,_react_17_0_2_react.useRef)();
|
|
const [headData, setHeadData] = (0,_react_17_0_2_react.useState)();
|
|
const [tableData, setTableData] = (0,_react_17_0_2_react.useState)();
|
|
const [questionName, setQuestionName] = (0,_react_17_0_2_react.useState)([]);
|
|
const [exportTypeModal, setExportTypeModal] = (0,_react_17_0_2_react.useState)(false);
|
|
const [exportType, setExportType] = (0,_react_17_0_2_react.useState)("");
|
|
(0,_react_17_0_2_react.useEffect)(() => {
|
|
dispatch({
|
|
type: "globalSetting/footerToggle",
|
|
payload: false
|
|
});
|
|
return () => {
|
|
dispatch({
|
|
type: "globalSetting/footerToggle",
|
|
payload: true
|
|
});
|
|
};
|
|
}, []);
|
|
(0,_react_17_0_2_react.useEffect)(() => {
|
|
id.current = params == null ? void 0 : params.id;
|
|
setDefaultActiveKey(searchParams.get("defaultActiveKey"));
|
|
getPaperData();
|
|
getData();
|
|
handleGetQuestionName();
|
|
}, []);
|
|
console.log("---", paperlibrary);
|
|
(0,_react_17_0_2_react.useEffect)(() => {
|
|
var _a2;
|
|
if ((_a2 = newExercisePaper.exerciseExportHeadData) == null ? void 0 : _a2.title) {
|
|
const res = newExercisePaper.exerciseExportHeadData;
|
|
setHeadData(__spreadValues({}, res || {}));
|
|
const { table } = res || {};
|
|
let total_score;
|
|
let actual_total_score;
|
|
if ((table == null ? void 0 : table.total_singles_scores) || (table == null ? void 0 : table.total_doubles_scores) || (table == null ? void 0 : table.total_nulls_scores) || (table == null ? void 0 : table.total_judges_scores) || (table == null ? void 0 : table.total_pros_scores) || (table == null ? void 0 : table.total_shixuns_scores) || (table == null ? void 0 : table.total_mains_scores) || (table == null ? void 0 : table.total_combination_scores) || (table == null ? void 0 : table.total_bpros_scores)) {
|
|
total_score = Number(table == null ? void 0 : table.total_singles_scores) + Number(table == null ? void 0 : table.total_doubles_scores) + Number(table == null ? void 0 : table.total_nulls_scores) + Number(table == null ? void 0 : table.total_judges_scores) + Number(table == null ? void 0 : table.total_pros_scores) + Number(table == null ? void 0 : table.total_shixuns_scores) + Number(table == null ? void 0 : table.total_mains_scores) + Number(table == null ? void 0 : table.total_combination_scores) + Number(table == null ? void 0 : table.total_bpros_scores);
|
|
}
|
|
if ((table == null ? void 0 : table.singles_scores) || (table == null ? void 0 : table.doubles_scores) || (table == null ? void 0 : table.nulls_scores) || (table == null ? void 0 : table.judges_scores) || (table == null ? void 0 : table.pros_scores) || (table == null ? void 0 : table.bpros_scores) || (table == null ? void 0 : table.shixuns_scores) || (table == null ? void 0 : table.mains_scores) || (table == null ? void 0 : table.combination_scores)) {
|
|
actual_total_score = Number(table == null ? void 0 : table.singles_scores) + Number(table == null ? void 0 : table.doubles_scores) + Number(table == null ? void 0 : table.nulls_scores) + Number(table == null ? void 0 : table.judges_scores) + Number(table == null ? void 0 : table.pros_scores) + Number(table == null ? void 0 : table.bpros_scores) + Number(table == null ? void 0 : table.shixuns_scores) + Number(table == null ? void 0 : table.mains_scores) + Number(table == null ? void 0 : table.combination_scores);
|
|
}
|
|
const data = [
|
|
{
|
|
key: "1",
|
|
name: "\u5E94\u5F97\u5206",
|
|
singles_score: table == null ? void 0 : table.total_singles_scores,
|
|
doubles_score: table == null ? void 0 : table.total_doubles_scores,
|
|
nulls_score: table == null ? void 0 : table.total_nulls_scores,
|
|
judges_score: table == null ? void 0 : table.total_judges_scores,
|
|
pros_score: table == null ? void 0 : table.total_pros_scores,
|
|
bpros_score: table == null ? void 0 : table.total_bpros_scores,
|
|
shixuns_score: table == null ? void 0 : table.total_shixuns_scores,
|
|
mains_score: table == null ? void 0 : table.total_mains_scores,
|
|
combinations_score: table == null ? void 0 : table.total_combination_scores,
|
|
total_score
|
|
},
|
|
{
|
|
key: "2",
|
|
name: "\u5B9E\u5F97\u5206",
|
|
singles_score: table == null ? void 0 : table.singles_scores,
|
|
doubles_score: table == null ? void 0 : table.doubles_scores,
|
|
nulls_score: table == null ? void 0 : table.nulls_scores,
|
|
judges_score: table == null ? void 0 : table.judges_scores,
|
|
pros_score: table == null ? void 0 : table.pros_scores,
|
|
bpros_score: table == null ? void 0 : table.bpros_scores,
|
|
shixuns_score: table == null ? void 0 : table.shixuns_scores,
|
|
mains_score: table == null ? void 0 : table.mains_scores,
|
|
combinations_score: table == null ? void 0 : table.combination_scores,
|
|
total_score: actual_total_score
|
|
},
|
|
{
|
|
key: "3",
|
|
name: "\u8BC4\u5377\u4EBA"
|
|
}
|
|
];
|
|
const blankData = [
|
|
{
|
|
key: "1",
|
|
name: "\u5E94\u5F97\u5206",
|
|
singles_score: table == null ? void 0 : table.total_singles_scores,
|
|
doubles_score: table == null ? void 0 : table.total_doubles_scores,
|
|
nulls_score: table == null ? void 0 : table.total_nulls_scores,
|
|
judges_score: table == null ? void 0 : table.total_judges_scores,
|
|
pros_score: table == null ? void 0 : table.total_pros_scores,
|
|
bpros_score: table == null ? void 0 : table.total_bpros_scores,
|
|
shixuns_score: table == null ? void 0 : table.total_shixuns_scores,
|
|
mains_score: table == null ? void 0 : table.total_mains_scores,
|
|
combinations_score: table == null ? void 0 : table.combination_scores,
|
|
total_score
|
|
},
|
|
{
|
|
key: "2",
|
|
name: "\u5B9E\u5F97\u5206"
|
|
},
|
|
{
|
|
key: "3",
|
|
name: "\u8BC4\u5377\u4EBA"
|
|
}
|
|
];
|
|
setTableData([...isExportBlank ? blankData : data]);
|
|
}
|
|
}, [newExercisePaper.exerciseExportHeadData]);
|
|
const handleGetQuestionName = () => __async(void 0, null, function* () {
|
|
var _a2;
|
|
const res = yield (0,service_paperlibrary/* getQuestionTypeAlias */.cV)({ id: params.id });
|
|
res.status == 0 && setQuestionName(res.data);
|
|
yield getData();
|
|
if (searchParams.get("exportPDF") && ((_a2 = paperlibrary.paperData) == null ? void 0 : _a2.questionList)) {
|
|
message/* default */.ZP.info("\u6B63\u5728\u5BFC\u51FA\u7A7A\u767D\u8BD5\u5377pdf");
|
|
(0,exportPDF/* exportPDF */.F)(paperDomRef.current.children, "\u5BFC\u51FA\u8BD5\u5377");
|
|
}
|
|
});
|
|
const getData = () => __async(void 0, null, function* () {
|
|
const res = yield (0,service_paperlibrary/* getExerciseHeadInfo */.Dq)(params.id);
|
|
console.log(res, "res-----------------");
|
|
setHeadData(res || {});
|
|
const { table } = res || {};
|
|
let total_score;
|
|
let actual_total_score;
|
|
if ((table == null ? void 0 : table.total_singles_scores) || (table == null ? void 0 : table.total_doubles_scores) || (table == null ? void 0 : table.total_nulls_scores) || (table == null ? void 0 : table.total_judges_scores) || (table == null ? void 0 : table.total_pros_scores) || (table == null ? void 0 : table.total_shixuns_scores) || (table == null ? void 0 : table.total_mains_scores) || (table == null ? void 0 : table.total_combination_scores) || (table == null ? void 0 : table.total_bpros_scores)) {
|
|
total_score = Number(table == null ? void 0 : table.total_singles_scores) + Number(table == null ? void 0 : table.total_doubles_scores) + Number(table == null ? void 0 : table.total_nulls_scores) + Number(table == null ? void 0 : table.total_judges_scores) + Number(table == null ? void 0 : table.total_pros_scores) + Number(table == null ? void 0 : table.total_shixuns_scores) + Number(table == null ? void 0 : table.total_mains_scores) + Number(table == null ? void 0 : table.total_combination_scores) + Number(table == null ? void 0 : table.total_bpros_scores);
|
|
}
|
|
if ((table == null ? void 0 : table.singles_scores) || (table == null ? void 0 : table.doubles_scores) || (table == null ? void 0 : table.nulls_scores) || (table == null ? void 0 : table.judges_scores) || (table == null ? void 0 : table.pros_scores) || (table == null ? void 0 : table.bpros_scores) || (table == null ? void 0 : table.shixuns_scores) || (table == null ? void 0 : table.mains_scores) || (table == null ? void 0 : table.combinations_score)) {
|
|
actual_total_score = Number(table == null ? void 0 : table.singles_scores) + Number(table == null ? void 0 : table.doubles_scores) + Number(table == null ? void 0 : table.nulls_scores) + Number(table == null ? void 0 : table.judges_scores) + Number(table == null ? void 0 : table.pros_scores) + Number(table == null ? void 0 : table.bpros_scores) + Number(table == null ? void 0 : table.shixuns_scores) + Number(table == null ? void 0 : table.mains_scores) + Number(table == null ? void 0 : table.combinations_score);
|
|
}
|
|
const data = [
|
|
{
|
|
key: "1",
|
|
name: "\u5E94\u5F97\u5206",
|
|
singles_score: table == null ? void 0 : table.total_singles_scores,
|
|
doubles_score: table == null ? void 0 : table.total_doubles_scores,
|
|
nulls_score: table == null ? void 0 : table.total_nulls_scores,
|
|
judges_score: table == null ? void 0 : table.total_judges_scores,
|
|
pros_score: table == null ? void 0 : table.total_pros_scores,
|
|
bpros_score: table == null ? void 0 : table.total_bpros_scores,
|
|
shixuns_score: table == null ? void 0 : table.total_shixuns_scores,
|
|
combinations_score: table == null ? void 0 : table.total_combination_scores,
|
|
mains_score: table == null ? void 0 : table.total_mains_scores,
|
|
total_score
|
|
},
|
|
{
|
|
key: "2",
|
|
name: "\u5B9E\u5F97\u5206",
|
|
singles_score: table == null ? void 0 : table.singles_scores,
|
|
doubles_score: table == null ? void 0 : table.doubles_scores,
|
|
nulls_score: table == null ? void 0 : table.nulls_scores,
|
|
judges_score: table == null ? void 0 : table.judges_scores,
|
|
pros_score: table == null ? void 0 : table.pros_scores,
|
|
bpros_score: table == null ? void 0 : table.bpros_scores,
|
|
shixuns_score: table == null ? void 0 : table.shixuns_scores,
|
|
mains_score: table == null ? void 0 : table.mains_scores,
|
|
combinations_score: table == null ? void 0 : table.combination_scores,
|
|
total_score: actual_total_score
|
|
},
|
|
{
|
|
key: "3",
|
|
name: "\u8BC4\u5377\u4EBA"
|
|
}
|
|
];
|
|
const blankData = [
|
|
{
|
|
key: "1",
|
|
name: "\u5E94\u5F97\u5206"
|
|
},
|
|
{
|
|
key: "2",
|
|
name: "\u5B9E\u5F97\u5206"
|
|
},
|
|
{
|
|
key: "3",
|
|
name: "\u8BC4\u5377\u4EBA"
|
|
}
|
|
];
|
|
setTableData(isExportBlank ? blankData : data);
|
|
});
|
|
const columns = [
|
|
{
|
|
width: "9%",
|
|
title: "\u9898\u578B",
|
|
align: "center",
|
|
dataIndex: "name",
|
|
render: (text) => /* @__PURE__ */ _react_17_0_2_react.createElement("a", null, text)
|
|
},
|
|
{
|
|
width: "9%",
|
|
title: ((_a = questionName.find((item) => item.value == constant/* QUESTIONTYPE */.f[0].nameType)) == null ? void 0 : _a.name) || constant/* QUESTIONTYPE */.f[0].name,
|
|
align: "center",
|
|
dataIndex: "singles_score",
|
|
render: (text) => /* @__PURE__ */ _react_17_0_2_react.createElement("a", null, text === "0.0" ? 0 : text)
|
|
},
|
|
{
|
|
width: "9%",
|
|
title: ((_b = questionName.find((item) => item.value == constant/* QUESTIONTYPE */.f[1].nameType)) == null ? void 0 : _b.name) || constant/* QUESTIONTYPE */.f[1].name,
|
|
align: "center",
|
|
dataIndex: "doubles_score",
|
|
render: (text) => /* @__PURE__ */ _react_17_0_2_react.createElement("a", null, text === "0.0" ? 0 : text)
|
|
},
|
|
{
|
|
width: "9%",
|
|
title: ((_c = questionName.find((item) => item.value == constant/* QUESTIONTYPE */.f[3].nameType)) == null ? void 0 : _c.name) || constant/* QUESTIONTYPE */.f[3].name,
|
|
align: "center",
|
|
dataIndex: "nulls_score",
|
|
render: (text) => /* @__PURE__ */ _react_17_0_2_react.createElement("a", null, text === "0.0" ? 0 : text)
|
|
},
|
|
{
|
|
width: "9%",
|
|
title: ((_d = questionName.find((item) => item.value == constant/* QUESTIONTYPE */.f[2].nameType)) == null ? void 0 : _d.name) || constant/* QUESTIONTYPE */.f[2].name,
|
|
align: "center",
|
|
dataIndex: "judges_score",
|
|
render: (text) => /* @__PURE__ */ _react_17_0_2_react.createElement("a", null, text === "0.0" ? 0 : text)
|
|
},
|
|
{
|
|
width: "9%",
|
|
title: ((_e = questionName.find((item) => item.value == constant/* QUESTIONTYPE */.f[6].nameType)) == null ? void 0 : _e.name) || constant/* QUESTIONTYPE */.f[6].name,
|
|
align: "center",
|
|
dataIndex: "pros_score",
|
|
render: (text) => /* @__PURE__ */ _react_17_0_2_react.createElement("a", null, text === "0.0" ? 0 : text)
|
|
},
|
|
{
|
|
width: "9%",
|
|
title: ((_f = questionName.find((item) => item.value == constant/* QUESTIONTYPE */.f[5].nameType)) == null ? void 0 : _f.name) || constant/* QUESTIONTYPE */.f[5].name,
|
|
align: "center",
|
|
dataIndex: "shixuns_score",
|
|
render: (text) => /* @__PURE__ */ _react_17_0_2_react.createElement("a", null, text === "0.0" ? 0 : text)
|
|
},
|
|
{
|
|
width: "9%",
|
|
title: ((_g = questionName.find((item) => item.value == constant/* QUESTIONTYPE */.f[4].nameType)) == null ? void 0 : _g.name) || constant/* QUESTIONTYPE */.f[4].name,
|
|
align: "center",
|
|
dataIndex: "mains_score",
|
|
render: (text) => /* @__PURE__ */ _react_17_0_2_react.createElement("a", null, text === "0.0" ? 0 : text)
|
|
},
|
|
{
|
|
width: "9%",
|
|
title: ((_h = questionName.find((item) => item.value == constant/* QUESTIONTYPE */.f[7].nameType)) == null ? void 0 : _h.name) || constant/* QUESTIONTYPE */.f[7].name,
|
|
align: "center",
|
|
dataIndex: "combinations_score",
|
|
render: (text) => /* @__PURE__ */ _react_17_0_2_react.createElement("a", null, text === "0.0" ? 0 : text)
|
|
},
|
|
{
|
|
width: "10%",
|
|
title: ((_i = questionName.find((item) => item.value == constant/* QUESTIONTYPE */.f[8].nameType)) == null ? void 0 : _i.name) || constant/* QUESTIONTYPE */.f[8].name,
|
|
align: "center",
|
|
dataIndex: "bpros_score",
|
|
render: (text) => /* @__PURE__ */ _react_17_0_2_react.createElement("a", null, text === "0.0" ? 0 : text)
|
|
},
|
|
{
|
|
width: "9%",
|
|
title: "\u603B\u5206",
|
|
align: "center",
|
|
dataIndex: "total_score",
|
|
render: (text) => /* @__PURE__ */ _react_17_0_2_react.createElement("a", null, text === "0.0" ? 0 : text ? parseFloat(text).toFixed(1) : "")
|
|
}
|
|
];
|
|
const getPaperData = (val) => {
|
|
dispatch({
|
|
type: "paperlibrary/getPaperData",
|
|
payload: __spreadValues({ id: id.current }, val)
|
|
});
|
|
};
|
|
const handleDragEnd = (data, paperItem) => __async(void 0, null, function* () {
|
|
if (!data.destination || !data.source) {
|
|
return;
|
|
}
|
|
const itemId = paperItem.questions[data.source.index].id;
|
|
const position = data.destination.index + 1;
|
|
const res = yield dispatch({
|
|
type: "paperlibrary/adjustPosition",
|
|
payload: { id: id.current, itemId, position }
|
|
});
|
|
if (res.status === -1) {
|
|
return;
|
|
}
|
|
getPaperData();
|
|
});
|
|
const handleSendToClass = () => {
|
|
dispatch({
|
|
type: "paperlibrary/setActionTabs",
|
|
payload: { key: "Paperlibrary-SendToClass", params: { id: id.current } }
|
|
});
|
|
};
|
|
const paperDomRef = (0,_react_17_0_2_react.useRef)();
|
|
const [showAnswer, setShowAnswer] = (0,_react_17_0_2_react.useState)(false);
|
|
const handleExportPaper = () => __async(void 0, null, function* () {
|
|
setShowAnswer(false);
|
|
setExportType("");
|
|
setExportTypeModal(true);
|
|
});
|
|
const handleExportPaperWithAnswer = () => __async(void 0, null, function* () {
|
|
setShowAnswer(true);
|
|
setExportType("");
|
|
setExportTypeModal(true);
|
|
});
|
|
return /* @__PURE__ */ _react_17_0_2_react.createElement("section", { className: Seemodules.bg }, /* @__PURE__ */ _react_17_0_2_react.createElement(row/* default */.Z, { className: "mt30", justify: "space-between" }, /* @__PURE__ */ _react_17_0_2_react.createElement(breadcrumb/* default */.Z, { separator: ">" }, /* @__PURE__ */ _react_17_0_2_react.createElement(breadcrumb/* default */.Z.Item, { href: "/paperlibrary" }, "\u8BD5\u5377\u5E93"), /* @__PURE__ */ _react_17_0_2_react.createElement(breadcrumb/* default */.Z.Item, { href: `/paperlibrary?defaultActiveKey=${defaultActiveKey}` }, defaultActiveKey === "1" ? "\u516C\u5F00" : defaultActiveKey === "2" ? "\u56E2\u961F\u5171\u4EAB" : "\u6211\u521B\u5EFA\u7684"), /* @__PURE__ */ _react_17_0_2_react.createElement(breadcrumb/* default */.Z.Item, null, "\u8BD5\u5377\u8BE6\u60C5")), /* @__PURE__ */ _react_17_0_2_react.createElement("div", { className: Seemodules.btnWrapper }, /* @__PURE__ */ _react_17_0_2_react.createElement(
|
|
AsyncButton/* AsyncButton */.Z,
|
|
{
|
|
style: { borderRadius: "16px" },
|
|
type: "primary",
|
|
icon: /* @__PURE__ */ _react_17_0_2_react.createElement(DownloadOutlined/* default */.Z, null),
|
|
onClick: handleExportPaperWithAnswer
|
|
},
|
|
"\u5BFC\u51FA\u7A7A\u767D\u8BD5\u5377+\u7B54\u6848"
|
|
), /* @__PURE__ */ _react_17_0_2_react.createElement(
|
|
AsyncButton/* AsyncButton */.Z,
|
|
{
|
|
style: { borderRadius: "16px" },
|
|
type: "primary",
|
|
className: "ml10",
|
|
icon: /* @__PURE__ */ _react_17_0_2_react.createElement(DownloadOutlined/* default */.Z, null),
|
|
onClick: handleExportPaper
|
|
},
|
|
"\u5BFC\u51FA\u7A7A\u767D\u8BD5\u5377"
|
|
))), /* @__PURE__ */ _react_17_0_2_react.createElement("div", { className: Seemodules.wrap, ref: paperDomRef }, /* @__PURE__ */ _react_17_0_2_react.createElement("div", { className: "pt20 pb20" }, /* @__PURE__ */ _react_17_0_2_react.createElement("div", { className: Seemodules.titleForExport }, (_k = (_j = paperlibrary.paperData) == null ? void 0 : _j.exam) == null ? void 0 : _k.name), /* @__PURE__ */ _react_17_0_2_react.createElement("div", { style: { fontSize: "15px", marginBottom: "12px", textAlign: "left" } }, headData == null ? void 0 : headData.exercise_description), /* @__PURE__ */ _react_17_0_2_react.createElement("div", { style: { textAlign: "center", fontSize: "15px" } }, "\u5171:\u3010", headData == null ? void 0 : headData.large_counts, "\u5927\u9898\u3011\u3010", headData == null ? void 0 : headData.total_count, "\u5C0F\u9898\u3011\u3010 \u6EE1\u5206", headData == null ? void 0 : headData.score, "\u5206\u3011 \u8003\u8BD5\u65F6\u95F4\uFF1A\u3010", (headData == null ? void 0 : headData.time) > -1 ? `${headData == null ? void 0 : headData.time}\u5206\u949F` : `\u4E0D\u9650`, "\u3011"), /* @__PURE__ */ _react_17_0_2_react.createElement(
|
|
table["default"],
|
|
{
|
|
style: { margin: "20px auto" },
|
|
className: Seemodules.table,
|
|
columns,
|
|
dataSource: [...tableData || []],
|
|
bordered: true,
|
|
pagination: false
|
|
}
|
|
), (_m = (_l = paperlibrary.paperData) == null ? void 0 : _l.questionList) == null ? void 0 : _m.map((paperItem, paperKey) => {
|
|
var _a2;
|
|
return /* @__PURE__ */ _react_17_0_2_react.createElement("div", { className: `${Seemodules.relative} mt20 mb20`, key: paperKey }, /* @__PURE__ */ _react_17_0_2_react.createElement("div", { className: Seemodules.typeActive }, /* @__PURE__ */ _react_17_0_2_react.createElement("span", { className: Seemodules.typeName }, paperItem.number, "\u3001", paperItem.name), /* @__PURE__ */ _react_17_0_2_react.createElement("span", { className: Seemodules.typeNumber }, "\uFF08\u5171", paperItem.questions_count, "\u9898\uFF1B\u5171", paperItem.questions_score, "\u5206\uFF09")), /* @__PURE__ */ _react_17_0_2_react.createElement(
|
|
"div",
|
|
{
|
|
className: "mt20"
|
|
},
|
|
(_a2 = paperItem.questions) == null ? void 0 : _a2.map((questionItem, qeustionKey) => {
|
|
return /* @__PURE__ */ _react_17_0_2_react.createElement(
|
|
"div",
|
|
{
|
|
key: questionItem.id
|
|
},
|
|
/* @__PURE__ */ _react_17_0_2_react.createElement(
|
|
"div",
|
|
null,
|
|
/* @__PURE__ */ _react_17_0_2_react.createElement(
|
|
Card/* default */.Z,
|
|
{
|
|
index: qeustionKey,
|
|
typeName: paperItem.name,
|
|
type: paperItem.type,
|
|
data: questionItem,
|
|
showAnswer,
|
|
isshow: false
|
|
}
|
|
)
|
|
)
|
|
);
|
|
})
|
|
));
|
|
}))), /* @__PURE__ */ _react_17_0_2_react.createElement(
|
|
FixedButton/* FixedButton */.t,
|
|
{
|
|
okText: "\u53D1\u9001\u8BFE\u5802",
|
|
onCancel: () => _umi_production_exports.history.push(`/paperlibrary?defaultActiveKey=${defaultActiveKey}`),
|
|
onOk: handleSendToClass
|
|
}
|
|
), /* @__PURE__ */ _react_17_0_2_react.createElement(SendToClassModal/* default */.Z, null), /* @__PURE__ */ _react_17_0_2_react.createElement(
|
|
modal["default"],
|
|
{
|
|
width: 450,
|
|
title: "\u8BF7\u9009\u62E9\u9700\u8981\u5BFC\u51FA\u7684\u683C\u5F0F",
|
|
open: exportTypeModal,
|
|
onCancel: () => setExportTypeModal(false),
|
|
onOk: () => __async(void 0, null, function* () {
|
|
if (exportType == "") {
|
|
message/* default */.ZP.info("\u8BF7\u9009\u62E9\u4E00\u79CD\u5BFC\u51FA\u683C\u5F0F");
|
|
return;
|
|
} else if (exportType == "pdf") {
|
|
yield (0,exportPDF/* exportPDF */.F)(paperDomRef.current.children, "\u5BFC\u51FA\u8BD5\u5377");
|
|
} else if (exportType == "word") {
|
|
(0,utils_export/* exportPaperlibraryPaper */.ON)({ id: id.current, middle_export: 1, export_type: showAnswer ? 1 : 0 });
|
|
}
|
|
setExportTypeModal(false);
|
|
})
|
|
},
|
|
/* @__PURE__ */ _react_17_0_2_react.createElement("div", { className: Seemodules.export_type_modal }, /* @__PURE__ */ _react_17_0_2_react.createElement("div", { className: Seemodules.export_type_modal_con }, /* @__PURE__ */ _react_17_0_2_react.createElement("div", { className: Seemodules.type_item }, /* @__PURE__ */ _react_17_0_2_react.createElement("div", { className: `${Seemodules.img_warp} ${exportType == "pdf" ? Seemodules.img_warp_active : ""}`, onClick: () => setExportType("pdf") }, /* @__PURE__ */ _react_17_0_2_react.createElement("img", { src: __webpack_require__(/*! @/assets/images/file_type/pdf_img.png */ 45614), width: 70, height: 70 })), "pdf\u683C\u5F0F"), /* @__PURE__ */ _react_17_0_2_react.createElement("div", { className: Seemodules.type_item }, /* @__PURE__ */ _react_17_0_2_react.createElement("div", { className: `${Seemodules.img_warp} ${exportType == "word" ? Seemodules.img_warp_active : ""}`, onClick: () => setExportType("word") }, /* @__PURE__ */ _react_17_0_2_react.createElement("img", { src: __webpack_require__(/*! @/assets/images/file_type/word_img.png */ 38347), width: 70, height: 70 })), "word\u683C\u5F0F")))
|
|
));
|
|
};
|
|
/* harmony default export */ var Paperlibrary_See = ((0,_umi_production_exports.connect)(
|
|
({
|
|
paperlibrary,
|
|
user,
|
|
loading,
|
|
globalSetting,
|
|
newExercisePaper
|
|
}) => ({
|
|
paperlibrary,
|
|
user,
|
|
globalSetting,
|
|
loading: loading.effects,
|
|
newExercisePaper
|
|
})
|
|
)(See));
|
|
|
|
|
|
/***/ })
|
|
|
|
}]); |