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.
3665 lines
196 KiB
3665 lines
196 KiB
"use strict";
|
|
(self["webpackChunk"] = self["webpackChunk"] || []).push([[5816],{
|
|
|
|
/***/ 74413:
|
|
/*!*******************************************************************!*\
|
|
!*** ./src/pages/Paperlibrary/Random/Edit/index.tsx + 29 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 */ Edit; }
|
|
});
|
|
|
|
// EXTERNAL MODULE: ./node_modules/_react@17.0.2@react/index.js
|
|
var _react_17_0_2_react = __webpack_require__(59301);
|
|
;// CONCATENATED MODULE: ./src/pages/Paperlibrary/Random/Edit/index.less?modules
|
|
// extracted by mini-css-extract-plugin
|
|
/* harmony default export */ var Editmodules = ({"wrapper":"wrapper___KtBVT","breadCrumbWrapper":"breadCrumbWrapper___k9tSB","baseInfo":"baseInfo____j5EY","radioBtnWrapper":"radioBtnWrapper___k9OCh","radiogroup":"radiogroup___e2fW6","easy":"easy___WcUAp","medium":"medium___U_o3j","hard":"hard___dAXLS","fixedBottom":"fixedBottom___liDZ4","cancelBtn":"cancelBtn___ZV9Mi","confirmBtn":"confirmBtn___DwH6m","previewBtn":"previewBtn___aLYCy"});
|
|
// 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/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: ./src/.umi-production/exports.ts + 15 modules
|
|
var _umi_production_exports = __webpack_require__(67866);
|
|
;// CONCATENATED MODULE: ./src/components/ExerciseComponents/index.less?modules
|
|
// extracted by mini-css-extract-plugin
|
|
/* harmony default export */ var ExerciseComponentsmodules = ({"digitalLabel":"digitalLabel___hkWuZ","active":"active___jawU1","titleEditor":"titleEditor___wX1lW","title":"title___SuT2h","editIcon":"editIcon___XrTIi","paperTab":"paperTab___GUxeB","tabItem":"tabItem___or0fY","dottedLine":"dottedLine___Ln0Xr"});
|
|
;// CONCATENATED MODULE: ./src/components/ExerciseComponents/DigitalLabel.tsx
|
|
|
|
|
|
const DigitalLabel = ({ number, active, className }) => {
|
|
return /* @__PURE__ */ _react_17_0_2_react.createElement("div", { className: `${ExerciseComponentsmodules.digitalLabel} ${active ? ExerciseComponentsmodules.active : ""} ${className}` }, number);
|
|
};
|
|
|
|
|
|
// EXTERNAL MODULE: ./node_modules/_antd@5.9.0@antd/es/tooltip/index.js + 3 modules
|
|
var tooltip = __webpack_require__(6848);
|
|
// EXTERNAL MODULE: ./node_modules/_antd@5.9.0@antd/es/input/index.js + 5 modules
|
|
var input = __webpack_require__(98135);
|
|
;// CONCATENATED MODULE: ./src/components/ExerciseComponents/TitleEditor.tsx
|
|
/* 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_17_0_2_react.useState)(false);
|
|
const [value, setValue] = (0,_react_17_0_2_react.useState)(defaultValue);
|
|
(0,_react_17_0_2_react.useEffect)(() => {
|
|
setValue(defaultValue);
|
|
}, [defaultValue]);
|
|
return /* @__PURE__ */ React.createElement("div", { className: ExerciseComponentsmodules.titleEditor }, !isEdit ? /* @__PURE__ */ React.createElement("div", { className: ExerciseComponentsmodules.title, onDoubleClick: () => setIsEdit(true) }, value, /* @__PURE__ */ React.createElement(tooltip/* default */.Z, { title: "\u7F16\u8F91\u8BD5\u5377\u540D\u79F0" }, /* @__PURE__ */ React.createElement("i", { className: `${ExerciseComponentsmodules.editIcon} iconfont icon-bianji_Hover`, onClick: () => setIsEdit(true) }))) : /* @__PURE__ */ React.createElement(
|
|
input["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) {
|
|
message/* 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) {
|
|
message/* default */.ZP.error("\u8BD5\u5377\u6807\u9898\u4E0D\u80FD\u4E3A\u7A7A");
|
|
return;
|
|
}
|
|
const flag = yield onFinish(value);
|
|
flag && setIsEdit(false);
|
|
})
|
|
}
|
|
));
|
|
};
|
|
|
|
|
|
// 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/col/index.js
|
|
var col = __webpack_require__(43604);
|
|
;// CONCATENATED MODULE: ./src/components/ExerciseComponents/PaperTab.tsx
|
|
var PaperTab_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 PaperTab = ({ onChange = () => PaperTab_async(void 0, null, function* () {
|
|
}), tabs, activeKey, defaultActiveKey, className = "" }) => {
|
|
var _a, _b, _c, _d, _e, _f, _g;
|
|
const [innerActiveKey, setInnerActiveKey] = (0,_react_17_0_2_react.useState)(defaultActiveKey === void 0 ? (_a = tabs[0]) == null ? void 0 : _a.key : defaultActiveKey);
|
|
(0,_react_17_0_2_react.useEffect)(() => {
|
|
if (activeKey !== void 0) {
|
|
setInnerActiveKey(activeKey);
|
|
}
|
|
}, [activeKey]);
|
|
return /* @__PURE__ */ _react_17_0_2_react.createElement(row/* default */.Z, { justify: "center", align: "middle", className: `${ExerciseComponentsmodules.paperTab} ${className}` }, /* @__PURE__ */ _react_17_0_2_react.createElement(
|
|
col/* default */.Z,
|
|
{
|
|
className: `${ExerciseComponentsmodules.tabItem} ${innerActiveKey === ((_b = tabs[0]) == null ? void 0 : _b.key) ? ExerciseComponentsmodules.active : ""}`,
|
|
onClick: () => PaperTab_async(void 0, null, function* () {
|
|
var _a2;
|
|
yield onChange(tabs[0].key);
|
|
setInnerActiveKey((_a2 = tabs[0]) == null ? void 0 : _a2.key);
|
|
})
|
|
},
|
|
/* @__PURE__ */ _react_17_0_2_react.createElement(DigitalLabel, { number: 1, active: innerActiveKey === ((_c = tabs[0]) == null ? void 0 : _c.key), className: "mr10" }),
|
|
/* @__PURE__ */ _react_17_0_2_react.createElement("span", null, (_d = tabs[0]) == null ? void 0 : _d.label)
|
|
), /* @__PURE__ */ _react_17_0_2_react.createElement(col/* default */.Z, { flex: "188px", className: `${ExerciseComponentsmodules.dottedLine} ml30 mr30` }), /* @__PURE__ */ _react_17_0_2_react.createElement(col/* default */.Z, { className: `${ExerciseComponentsmodules.tabItem} ${innerActiveKey === ((_e = tabs[1]) == null ? void 0 : _e.key) ? ExerciseComponentsmodules.active : ""}`, onClick: () => PaperTab_async(void 0, null, function* () {
|
|
var _a2, _b2;
|
|
yield onChange((_a2 = tabs[1]) == null ? void 0 : _a2.key);
|
|
setInnerActiveKey((_b2 = tabs[1]) == null ? void 0 : _b2.key);
|
|
}) }, /* @__PURE__ */ _react_17_0_2_react.createElement(DigitalLabel, { number: 2, active: innerActiveKey === ((_f = tabs[1]) == null ? void 0 : _f.key), className: "mr10" }), /* @__PURE__ */ _react_17_0_2_react.createElement("span", null, (_g = tabs[1]) == null ? void 0 : _g.label)));
|
|
};
|
|
|
|
|
|
;// CONCATENATED MODULE: ./src/components/ExerciseComponents/index.tsx
|
|
|
|
|
|
|
|
|
|
// 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/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/utils/fetch.ts
|
|
var fetch = __webpack_require__(51165);
|
|
;// CONCATENATED MODULE: ./src/service/randomPaper/index.ts
|
|
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 randomPaper_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());
|
|
});
|
|
};
|
|
|
|
function getRandomExam(id) {
|
|
return randomPaper_async(this, null, function* () {
|
|
return (0,fetch/* default */.ZP)(`/api/examination_banks/${id}/edit_random_exam_new.json`, {
|
|
method: "get"
|
|
});
|
|
});
|
|
}
|
|
function updateRandomExam(id, params) {
|
|
return randomPaper_async(this, null, function* () {
|
|
return (0,fetch/* default */.ZP)(`/api/examination_banks/${id}/update_random_exam.json`, {
|
|
method: "post",
|
|
body: params
|
|
});
|
|
});
|
|
}
|
|
function createRandomExam(params) {
|
|
return randomPaper_async(this, null, function* () {
|
|
return (0,fetch/* default */.ZP)(`/api/examination_banks/create_random_exam.json`, {
|
|
method: "post",
|
|
body: params
|
|
});
|
|
});
|
|
}
|
|
function getDisciplines(params) {
|
|
return randomPaper_async(this, null, function* () {
|
|
return (0,fetch/* default */.ZP)(`/api/disciplines.json`, {
|
|
method: "get",
|
|
params
|
|
});
|
|
});
|
|
}
|
|
function getQuestionNum(params) {
|
|
return randomPaper_async(this, null, function* () {
|
|
return (0,fetch/* default */.ZP)(`/api/item_banks/item_difficulty_count.json`, {
|
|
method: "get",
|
|
params
|
|
});
|
|
});
|
|
}
|
|
function setItemTypeScore(id, params) {
|
|
return randomPaper_async(this, null, function* () {
|
|
return (0,fetch/* default */.ZP)(`/api/examination_banks/${id}/set_item_type_score.json`, {
|
|
method: "post",
|
|
body: params
|
|
});
|
|
});
|
|
}
|
|
function setItemTypeScores(id, params) {
|
|
return randomPaper_async(this, null, function* () {
|
|
return (0,fetch/* default */.ZP)(`/api/exercises/${id}/set_item_type_score.json`, {
|
|
method: "post",
|
|
body: params
|
|
});
|
|
});
|
|
}
|
|
function deleteItem(id, params) {
|
|
return randomPaper_async(this, null, function* () {
|
|
return (0,fetch/* default */.ZP)(`/api/examination_banks/${id}/delete_item_type.json`, {
|
|
method: "post",
|
|
body: params
|
|
});
|
|
});
|
|
}
|
|
function deletecourseItem(id, params) {
|
|
return randomPaper_async(this, null, function* () {
|
|
return (0,fetch/* default */.ZP)(`/api/exercises/${id}/delete_item_type.json`, {
|
|
method: "post",
|
|
body: params
|
|
});
|
|
});
|
|
}
|
|
function previewRandomPaper(params) {
|
|
return randomPaper_async(this, null, function* () {
|
|
return (0,fetch/* default */.ZP)(`/api/examination_banks/preview_random_questions.json`, {
|
|
method: "post",
|
|
body: params
|
|
});
|
|
});
|
|
}
|
|
function toggleRandomQuestions(params) {
|
|
return randomPaper_async(this, null, function* () {
|
|
return (0,fetch/* default */.ZP)("/api/examination_banks/toggle_random_questions.json", {
|
|
method: "post",
|
|
body: params
|
|
});
|
|
});
|
|
}
|
|
function saveQuestionList(params) {
|
|
return randomPaper_async(this, null, function* () {
|
|
return (0,fetch/* default */.ZP)("/api/examination_banks/save_question_list.json", {
|
|
method: "post",
|
|
body: params
|
|
});
|
|
});
|
|
}
|
|
function getExerciseRandomExam(params) {
|
|
return randomPaper_async(this, null, function* () {
|
|
return (0,fetch/* default */.ZP)(`/api/exercises/${params.categoryId}/edit.json`, {
|
|
method: "get",
|
|
params: __spreadValues({}, params)
|
|
});
|
|
});
|
|
}
|
|
|
|
;// CONCATENATED MODULE: ./src/service/randomPaper/types.ts
|
|
var RuleValueKeyType = /* @__PURE__ */ ((RuleValueKeyType2) => {
|
|
RuleValueKeyType2["OnlyFileFolder"] = "1";
|
|
RuleValueKeyType2["OnlyKnowledge"] = "2";
|
|
RuleValueKeyType2["OnlyDifficulty"] = "3";
|
|
RuleValueKeyType2["FileFolderAndDiff"] = "4";
|
|
RuleValueKeyType2["FileFolderAndKnowledge"] = "5";
|
|
RuleValueKeyType2["KnowledgeAndDiff"] = "6";
|
|
RuleValueKeyType2["All"] = "7";
|
|
RuleValueKeyType2["Shixun"] = "8";
|
|
return RuleValueKeyType2;
|
|
})(RuleValueKeyType || {});
|
|
|
|
// EXTERNAL MODULE: ./node_modules/_lodash@4.17.21@lodash/lodash.js
|
|
var lodash = __webpack_require__(89392);
|
|
;// CONCATENATED MODULE: ./src/pages/Paperlibrary/Random/Edit/reducer.ts
|
|
var reducer_defProp = Object.defineProperty;
|
|
var __defProps = Object.defineProperties;
|
|
var __getOwnPropDescs = Object.getOwnPropertyDescriptors;
|
|
var reducer_getOwnPropSymbols = Object.getOwnPropertySymbols;
|
|
var reducer_hasOwnProp = Object.prototype.hasOwnProperty;
|
|
var reducer_propIsEnum = Object.prototype.propertyIsEnumerable;
|
|
var reducer_defNormalProp = (obj, key, value) => key in obj ? reducer_defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
|
|
var reducer_spreadValues = (a, b) => {
|
|
for (var prop in b || (b = {}))
|
|
if (reducer_hasOwnProp.call(b, prop))
|
|
reducer_defNormalProp(a, prop, b[prop]);
|
|
if (reducer_getOwnPropSymbols)
|
|
for (var prop of reducer_getOwnPropSymbols(b)) {
|
|
if (reducer_propIsEnum.call(b, prop))
|
|
reducer_defNormalProp(a, prop, b[prop]);
|
|
}
|
|
return a;
|
|
};
|
|
var __spreadProps = (a, b) => __defProps(a, __getOwnPropDescs(b));
|
|
|
|
|
|
|
|
var RuleValueType = /* @__PURE__ */ ((RuleValueType2) => {
|
|
RuleValueType2[RuleValueType2["FileFolder"] = 1] = "FileFolder";
|
|
RuleValueType2[RuleValueType2["Difficulty"] = 2] = "Difficulty";
|
|
RuleValueType2[RuleValueType2["Knowledge"] = 3] = "Knowledge";
|
|
return RuleValueType2;
|
|
})(RuleValueType || {});
|
|
const DataContext = (0,_react_17_0_2_react.createContext)(null);
|
|
const RuleValueMap = {
|
|
[RuleValueKeyType.OnlyFileFolder]: [1 /* FileFolder */],
|
|
[RuleValueKeyType.OnlyKnowledge]: [3 /* Knowledge */],
|
|
[RuleValueKeyType.OnlyDifficulty]: [2 /* Difficulty */],
|
|
[RuleValueKeyType.FileFolderAndDiff]: [1 /* FileFolder */, 2 /* Difficulty */],
|
|
[RuleValueKeyType.FileFolderAndKnowledge]: [1 /* FileFolder */, 3 /* Knowledge */],
|
|
[RuleValueKeyType.KnowledgeAndDiff]: [3 /* Knowledge */, 2 /* Difficulty */],
|
|
[RuleValueKeyType.All]: [3 /* Knowledge */, 2 /* Difficulty */, 1 /* FileFolder */]
|
|
};
|
|
const compareTwoArr = (target, source) => {
|
|
if (target.length !== source.length) {
|
|
return false;
|
|
}
|
|
for (const sourceValue of source) {
|
|
if (!target.includes(sourceValue)) {
|
|
return false;
|
|
}
|
|
}
|
|
return true;
|
|
};
|
|
const getRuleValue = (userSelect) => {
|
|
for (const [ruleKey, ruleValueArr] of Object.entries(RuleValueMap)) {
|
|
if (compareTwoArr(userSelect, ruleValueArr)) {
|
|
return ruleKey;
|
|
}
|
|
}
|
|
};
|
|
const questionTypeMap = {
|
|
SINGLE: "\u5355\u9009\u9898",
|
|
MULTIPLE: "\u591A\u9009\u9898",
|
|
COMPLETION: "\u586B\u7A7A\u9898",
|
|
JUDGMENT: "\u5224\u65AD\u9898",
|
|
SUBJECTIVE: "\u7B80\u7B54\u9898",
|
|
PROGRAM: "\u7F16\u7A0B\u9898",
|
|
BPROGRAM: "\u7A0B\u5E8F\u586B\u7A7A\u9898",
|
|
COMBINATION: "\u7EC4\u5408\u9898",
|
|
PRACTICAL: "\u5B9E\u8BAD\u9898"
|
|
};
|
|
const difficultyMap = {
|
|
"1": { label: "\u7B80\u5355", color: "#46B70E" },
|
|
"2": { label: "\u9002\u4E2D", color: "#165DFF" },
|
|
"3": { label: "\u56F0\u96BE", color: "#EE6F1A" }
|
|
};
|
|
const getFixedNumber = (num) => num && parseFloat(num.toFixed(1));
|
|
const reducer = (state, action) => {
|
|
var _a, _b, _c;
|
|
switch (action.type) {
|
|
case "init": {
|
|
return action.payload;
|
|
}
|
|
case "updateBaseInfo": {
|
|
return __spreadProps(reducer_spreadValues({}, state), {
|
|
examination_bank: action.payload
|
|
});
|
|
}
|
|
case "deleteQuestionType": {
|
|
const { item_types } = state;
|
|
const newItemTypes = item_types.filter((item) => item.item_type !== action.payload);
|
|
state.examination_bank.question_count = getFixedNumber(newItemTypes.reduce((acc, cur) => acc + cur.item_bank_count, 0));
|
|
state.examination_bank.total_score = getFixedNumber(newItemTypes.reduce((acc, cur) => acc + cur.total_score, 0));
|
|
return __spreadProps(reducer_spreadValues({}, state), {
|
|
item_types: newItemTypes
|
|
});
|
|
}
|
|
case "setQuestionType": {
|
|
const { item_types = [] } = state;
|
|
const prevItemTypes = item_types.map((item) => item.item_type);
|
|
const newItemTypes = item_types.filter((item) => action.payload.includes(item.item_type));
|
|
for (const itemType of action.payload) {
|
|
if (!prevItemTypes.includes(itemType)) {
|
|
if (itemType === "PRACTICAL") {
|
|
newItemTypes.push({
|
|
item_type: itemType,
|
|
contents: [],
|
|
item_banks: [],
|
|
item_bank_count: 0,
|
|
item_bank_num: 0,
|
|
item_type_text: questionTypeMap[itemType],
|
|
random_rule_type: RuleValueKeyType.Shixun,
|
|
score: 0,
|
|
total_score: 0
|
|
});
|
|
} else {
|
|
newItemTypes.push({
|
|
item_type: itemType,
|
|
contents: [],
|
|
item_bank_count: 0,
|
|
item_type_text: questionTypeMap[itemType],
|
|
// random_rule_type: '1',
|
|
score: 0,
|
|
total_score: 0
|
|
});
|
|
}
|
|
}
|
|
}
|
|
return __spreadProps(reducer_spreadValues({}, state), {
|
|
item_types: newItemTypes
|
|
});
|
|
}
|
|
case "updateItemTypes": {
|
|
return __spreadProps(reducer_spreadValues({}, state), {
|
|
item_types: action.payload
|
|
});
|
|
}
|
|
case "deleteRule": {
|
|
const stateCopy = (0,lodash.cloneDeep)(state);
|
|
const currentItem = stateCopy.item_types.find((item) => item.item_type === action.payload.itemType);
|
|
const deleteRule = currentItem.contents.find((content) => content.id === action.payload.id && content.is_share == action.payload.is_share);
|
|
currentItem.contents = currentItem.contents.filter((content) => content !== deleteRule);
|
|
if (((_a = currentItem.contents) == null ? void 0 : _a.length) === 0)
|
|
currentItem.random_rule_type = [];
|
|
currentItem.item_bank_count -= deleteRule == null ? void 0 : deleteRule.quanlity;
|
|
stateCopy.examination_bank.question_count -= deleteRule == null ? void 0 : deleteRule.quanlity;
|
|
currentItem.total_score -= (deleteRule == null ? void 0 : deleteRule.quanlity) * currentItem.score;
|
|
stateCopy.examination_bank.total_score -= (deleteRule == null ? void 0 : deleteRule.quanlity) * currentItem.score;
|
|
currentItem.total_score = getFixedNumber(currentItem.total_score);
|
|
stateCopy.examination_bank.total_score = getFixedNumber(stateCopy.examination_bank.total_score);
|
|
stateCopy.contents = currentItem.contents;
|
|
return stateCopy;
|
|
}
|
|
case "changeQuestionNum": {
|
|
const stateCopy = (0,lodash.cloneDeep)(state);
|
|
const currentItem = stateCopy.item_types.find((item) => item.item_type === action.payload.itemType);
|
|
const countitems = (_b = currentItem == null ? void 0 : currentItem.contents) == null ? void 0 : _b.find((item) => item.id === action.payload.id);
|
|
if (action.payload.itemType === "PRACTICAL") {
|
|
if (action.payload.num) {
|
|
stateCopy.examination_bank.question_count = stateCopy.examination_bank.question_count - currentItem.item_bank_count + action.payload.num;
|
|
stateCopy.examination_bank.total_score = getFixedNumber(stateCopy.examination_bank.total_score - currentItem.total_score + action.payload.num * currentItem.score);
|
|
}
|
|
if (action.payload.score) {
|
|
stateCopy.examination_bank.total_score = getFixedNumber(stateCopy.examination_bank.total_score - currentItem.total_score + action.payload.num * currentItem.score);
|
|
}
|
|
currentItem.item_bank_count = action.payload.num;
|
|
currentItem.total_score = getFixedNumber(currentItem.item_bank_count * currentItem.score);
|
|
return stateCopy;
|
|
}
|
|
stateCopy.examination_bank.question_count = stateCopy.examination_bank.question_count - (countitems == null ? void 0 : countitems.quanlity) + action.payload.num;
|
|
const currentRule = currentItem.contents.find((content) => content.id === action.payload.id && content.teacher_group_id === action.payload.teacher_group_id);
|
|
currentRule.quanlity = action.payload.num;
|
|
let newItemBankCount = 0, newTotalScore = 0;
|
|
for (const content of currentItem.contents) {
|
|
newItemBankCount += content == null ? void 0 : content.quanlity;
|
|
newTotalScore += (content == null ? void 0 : content.quanlity) * currentItem.score;
|
|
}
|
|
stateCopy.examination_bank.total_score = getFixedNumber(stateCopy.examination_bank.total_score - currentItem.total_score + newTotalScore);
|
|
currentItem.item_bank_count = newItemBankCount;
|
|
currentItem.total_score = getFixedNumber(newTotalScore);
|
|
return stateCopy;
|
|
}
|
|
case "changeQuestionScore": {
|
|
const stateCopy = (0,lodash.cloneDeep)(state);
|
|
const currentItem = stateCopy.item_types.find((item) => item.item_type === action.payload.itemType);
|
|
currentItem.score = action.payload.score;
|
|
currentItem.total_score = getFixedNumber(currentItem.item_bank_count * currentItem.score);
|
|
stateCopy.examination_bank.total_score = getFixedNumber(stateCopy.item_types.reduce((acc, cur) => acc + cur.total_score, 0));
|
|
return stateCopy;
|
|
}
|
|
case "editRule": {
|
|
const stateCopy = (0,lodash.cloneDeep)(state);
|
|
const currentItem = stateCopy.item_types.find((item) => item.item_type === action.payload.itemType);
|
|
currentItem.contents = action.payload.tableData.map((content) => __spreadProps(reducer_spreadValues({}, content), { item_type: action.payload.itemType, random_rule_type: action.payload.randomRuleType }));
|
|
currentItem.random_rule_type = action.payload.randomRuleType;
|
|
currentItem.item_bank_count = currentItem.contents.reduce((acc, cur) => acc + (cur == null ? void 0 : cur.quanlity), 0);
|
|
currentItem.score = currentItem.score || 1;
|
|
currentItem.total_score = getFixedNumber(currentItem.item_bank_count * currentItem.score);
|
|
stateCopy.examination_bank.question_count = stateCopy.item_types.reduce((acc, cur) => acc + cur.item_bank_count, 0);
|
|
stateCopy.examination_bank.total_score = getFixedNumber(stateCopy.item_types.reduce((acc, cur) => acc + cur.total_score, 0));
|
|
return stateCopy;
|
|
}
|
|
case "addShixun": {
|
|
const stateCopy = (0,lodash.cloneDeep)(state);
|
|
const currentItem = stateCopy.item_types.find((item) => item.item_type === "PRACTICAL");
|
|
currentItem.item_banks = action.payload.shixunList;
|
|
stateCopy.examination_bank.question_count = stateCopy.examination_bank.question_count + 1;
|
|
currentItem.item_bank_num = currentItem.item_banks.length;
|
|
currentItem.item_bank_count = currentItem.item_bank_count || 1;
|
|
currentItem.score = currentItem.score || 1;
|
|
currentItem.total_score = currentItem.total_score || currentItem.score * currentItem.item_bank_count;
|
|
stateCopy.examination_bank.total_score = (_c = stateCopy == null ? void 0 : stateCopy.item_types) == null ? void 0 : _c.map((item) => item.total_score).reduce((a, b) => a + b);
|
|
return stateCopy;
|
|
}
|
|
case "deleteShixunQuestion": {
|
|
const stateCopy = (0,lodash.cloneDeep)(state);
|
|
const currentItem = stateCopy.item_types.find((item) => item.item_type === "PRACTICAL");
|
|
currentItem.item_banks = currentItem.item_banks.filter((item) => item.id !== action.payload.shixunId);
|
|
currentItem.item_bank_num -= 1;
|
|
if (currentItem.item_bank_count > currentItem.item_bank_num) {
|
|
currentItem.item_bank_count -= 1;
|
|
currentItem.total_score -= currentItem.score;
|
|
currentItem.total_score = getFixedNumber(currentItem.total_score);
|
|
}
|
|
return stateCopy;
|
|
}
|
|
}
|
|
};
|
|
|
|
|
|
;// CONCATENATED MODULE: ./src/pages/Paperlibrary/Random/Edit/BaseInfo.tsx
|
|
var BaseInfo_defProp = Object.defineProperty;
|
|
var BaseInfo_defProps = Object.defineProperties;
|
|
var BaseInfo_getOwnPropDescs = Object.getOwnPropertyDescriptors;
|
|
var BaseInfo_getOwnPropSymbols = Object.getOwnPropertySymbols;
|
|
var BaseInfo_hasOwnProp = Object.prototype.hasOwnProperty;
|
|
var BaseInfo_propIsEnum = Object.prototype.propertyIsEnumerable;
|
|
var BaseInfo_defNormalProp = (obj, key, value) => key in obj ? BaseInfo_defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
|
|
var BaseInfo_spreadValues = (a, b) => {
|
|
for (var prop in b || (b = {}))
|
|
if (BaseInfo_hasOwnProp.call(b, prop))
|
|
BaseInfo_defNormalProp(a, prop, b[prop]);
|
|
if (BaseInfo_getOwnPropSymbols)
|
|
for (var prop of BaseInfo_getOwnPropSymbols(b)) {
|
|
if (BaseInfo_propIsEnum.call(b, prop))
|
|
BaseInfo_defNormalProp(a, prop, b[prop]);
|
|
}
|
|
return a;
|
|
};
|
|
var BaseInfo_spreadProps = (a, b) => BaseInfo_defProps(a, BaseInfo_getOwnPropDescs(b));
|
|
var BaseInfo_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 BaseInfo = ({ courseOptions, setCurrentKey, loading, form }) => {
|
|
const { data, disabled, dispatch } = (0,_react_17_0_2_react.useContext)(DataContext);
|
|
const urlParams = (0,_umi_production_exports.useParams)();
|
|
const isFirst = (0,_react_17_0_2_react.useRef)(true);
|
|
const initData = (0,_react_17_0_2_react.useMemo)(() => {
|
|
var _a, _b, _c, _d, _e;
|
|
if (!courseOptions.length || !data) {
|
|
return;
|
|
}
|
|
const subDisciplineId = (_a = data == null ? void 0 : data.examination_bank) == null ? void 0 : _a.sub_discipline_id;
|
|
const time = ((_b = data == null ? void 0 : data.examination_bank) == null ? void 0 : _b.time) === -1 ? void 0 : isFirst.current ? urlParams.id ? (_c = data == null ? void 0 : data.examination_bank) == null ? void 0 : _c.time : ((_d = data == null ? void 0 : data.examination_bank) == null ? void 0 : _d.time) || 60 : (_e = data == null ? void 0 : data.examination_bank) == null ? void 0 : _e.time;
|
|
isFirst.current = false;
|
|
let valueForCascader = [];
|
|
for (const item of courseOptions) {
|
|
for (const option of item.children) {
|
|
if (option.value === subDisciplineId) {
|
|
valueForCascader = [item.value, option.value];
|
|
}
|
|
}
|
|
}
|
|
return BaseInfo_spreadProps(BaseInfo_spreadValues({}, data.examination_bank), { time, course: valueForCascader });
|
|
}, [data, courseOptions]);
|
|
(0,_react_17_0_2_react.useEffect)(() => {
|
|
form.setFieldsValue(BaseInfo_spreadValues({}, initData));
|
|
}, [initData]);
|
|
return /* @__PURE__ */ _react_17_0_2_react.createElement(
|
|
spin/* default */.Z,
|
|
{
|
|
spinning: loading,
|
|
size: "large",
|
|
style: {
|
|
position: "fixed",
|
|
maxHeight: "100vh"
|
|
},
|
|
className: "mt30"
|
|
},
|
|
/* @__PURE__ */ _react_17_0_2_react.createElement("div", { className: Editmodules.baseInfo }, /* @__PURE__ */ _react_17_0_2_react.createElement(
|
|
es_form["default"],
|
|
{
|
|
form,
|
|
autoComplete: "off",
|
|
colon: false,
|
|
labelCol: { span: 4 },
|
|
wrapperCol: { span: 20 },
|
|
initialValues: initData,
|
|
onValuesChange: (changedValues, newValues) => {
|
|
const { course = [] } = newValues;
|
|
const newBaseInfo = BaseInfo_spreadProps(BaseInfo_spreadValues({}, newValues), { sub_discipline_id: course[1] || 0 });
|
|
dispatch({ type: "updateBaseInfo", payload: newBaseInfo });
|
|
}
|
|
},
|
|
/* @__PURE__ */ _react_17_0_2_react.createElement(
|
|
es_form["default"].Item,
|
|
{
|
|
name: "name",
|
|
label: "\u8BD5\u5377\u540D\u79F0",
|
|
rules: [
|
|
{
|
|
required: true,
|
|
validator: (_, value) => {
|
|
var _a;
|
|
return ((_a = value == null ? void 0 : value.replaceAll(" ", "")) == null ? void 0 : _a.length) > 0 ? Promise.resolve() : Promise.reject("\u8BF7\u8F93\u5165\u8BD5\u5377\u540D\u79F0");
|
|
}
|
|
}
|
|
]
|
|
},
|
|
/* @__PURE__ */ _react_17_0_2_react.createElement(input["default"], { maxLength: 60, size: "large", placeholder: "\u8BF7\u8F93\u5165\u8BD5\u5377\u540D\u79F0", showCount: true })
|
|
),
|
|
/* @__PURE__ */ _react_17_0_2_react.createElement(
|
|
es_form["default"].Item,
|
|
{
|
|
label: "\u65B9\u5411&\u8BFE\u7A0B",
|
|
name: "course",
|
|
rules: [{ required: true, message: "\u8BF7\u9009\u62E9\u65B9\u5411&\u8BFE\u7A0B" }]
|
|
},
|
|
/* @__PURE__ */ _react_17_0_2_react.createElement(
|
|
cascader/* default */.Z,
|
|
{
|
|
disabled,
|
|
size: "large",
|
|
allowClear: false,
|
|
placeholder: "\u8BF7\u9009\u62E9\u65B9\u5411&\u8BFE\u7A0B",
|
|
options: courseOptions,
|
|
dropdownMenuColumnStyle: {
|
|
padding: "8px 12px",
|
|
fontSize: 14
|
|
}
|
|
}
|
|
)
|
|
),
|
|
/* @__PURE__ */ _react_17_0_2_react.createElement(
|
|
es_form["default"].Item,
|
|
{
|
|
label: "\u96BE\u5EA6",
|
|
name: "difficulty",
|
|
className: Editmodules.radioBtnWrapper,
|
|
rules: [{ required: true, message: "\u8BF7\u9009\u62E9\u96BE\u5EA6" }]
|
|
},
|
|
/* @__PURE__ */ _react_17_0_2_react.createElement(es_radio/* default.Group */.ZP.Group, { disabled, className: Editmodules.radiogroup }, /* @__PURE__ */ _react_17_0_2_react.createElement(es_radio/* default.Button */.ZP.Button, { className: Editmodules.easy, value: 1 }, "\u7B80\u5355"), /* @__PURE__ */ _react_17_0_2_react.createElement(es_radio/* default.Button */.ZP.Button, { className: Editmodules.medium, value: 2 }, "\u9002\u4E2D"), /* @__PURE__ */ _react_17_0_2_react.createElement(es_radio/* default.Button */.ZP.Button, { className: Editmodules.hard, value: 3 }, "\u56F0\u96BE"))
|
|
),
|
|
/* @__PURE__ */ _react_17_0_2_react.createElement(es_form["default"].Item, { label: "\u7B54\u9898\u65F6\u957F" }, /* @__PURE__ */ _react_17_0_2_react.createElement(row/* default */.Z, { align: "middle" }, /* @__PURE__ */ _react_17_0_2_react.createElement(es_form["default"].Item, { name: "time", noStyle: true }, /* @__PURE__ */ _react_17_0_2_react.createElement(
|
|
input_number/* default */.Z,
|
|
{
|
|
min: 1,
|
|
disabled,
|
|
size: "large",
|
|
max: 9999,
|
|
style: { width: 220 },
|
|
placeholder: "\u8BF7\u586B\u5199\u7B54\u9898\u65F6\u957F"
|
|
}
|
|
)), /* @__PURE__ */ _react_17_0_2_react.createElement("span", { className: "ml10" }, "\u5206\u949F"))),
|
|
/* @__PURE__ */ _react_17_0_2_react.createElement(es_form["default"].Item, { label: "\u8BD5\u5377\u987B\u77E5", name: "exam_notes" }, /* @__PURE__ */ _react_17_0_2_react.createElement(
|
|
input["default"].TextArea,
|
|
{
|
|
rows: 6,
|
|
disabled,
|
|
showCount: true,
|
|
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__ */ _react_17_0_2_react.createElement("div", { className: Editmodules.fixedBottom }, /* @__PURE__ */ _react_17_0_2_react.createElement(
|
|
es_button/* default */.ZP,
|
|
{
|
|
className: `${Editmodules.cancelBtn} mr5`,
|
|
onClick: () => {
|
|
if (urlParams.id || window.location.href.indexOf("randompaper") > -1) {
|
|
_umi_production_exports.history.push(`/paperlibrary`);
|
|
} else {
|
|
_umi_production_exports.history.push(`/classrooms/${urlParams.coursesId}/exercise`);
|
|
}
|
|
}
|
|
},
|
|
"\u53D6\u6D88"
|
|
), /* @__PURE__ */ _react_17_0_2_react.createElement(
|
|
es_button/* default */.ZP,
|
|
{
|
|
className: `${Editmodules.confirmBtn} ml15`,
|
|
type: "primary",
|
|
size: "large",
|
|
onClick: () => BaseInfo_async(void 0, null, function* () {
|
|
yield form.validateFields();
|
|
if (!urlParams.id && !urlParams.coursesId) {
|
|
const res = yield createRandomExam(data);
|
|
if (res.status === 0) {
|
|
_umi_production_exports.history.replace(`/randompaper/edit/${res == null ? void 0 : res.examination_bank_id}?type=settings`);
|
|
setCurrentKey("settings");
|
|
}
|
|
} else {
|
|
setCurrentKey("settings");
|
|
}
|
|
})
|
|
},
|
|
"\u4E0B\u4E00\u6B65"
|
|
))
|
|
);
|
|
};
|
|
/* harmony default export */ var Edit_BaseInfo = (BaseInfo);
|
|
|
|
// EXTERNAL MODULE: ./node_modules/_antd@5.9.0@antd/es/modal/index.js + 16 modules
|
|
var modal = __webpack_require__(43418);
|
|
;// CONCATENATED MODULE: ./src/pages/Paperlibrary/Random/Edit/QuestionInfo/index.less?modules
|
|
// extracted by mini-css-extract-plugin
|
|
/* harmony default export */ var QuestionInfomodules = ({"flex_box_center":"flex_box_center___NXYwj","flex_space_between":"flex_space_between___Oy2UZ","flex_box_vertical_center":"flex_box_vertical_center___ybBar","flex_box_center_end":"flex_box_center_end___yyQPf","flex_box_column":"flex_box_column____kuXY","questionInfo":"questionInfo___U9mnu","label":"label___PP7Ng","content":"content___PUXFl","leftPart":"leftPart___uoQeo","rightPart":"rightPart___mCG7H","dragItem":"dragItem___djmPG","blackText":"blackText___KqEaU","greyText":"greyText___VamKm","iconWrapper":"iconWrapper___o1C0y","contentArea":"contentArea___Fj7D0","dragging":"dragging___mX3Il","hidden":"hidden___KWDLK","dragIcon":"dragIcon___yPuB3","deleteIcon":"deleteIcon___go29y","disabled":"disabled___uSK9k","challengeNameWrapper":"challengeNameWrapper___DFjRy","challengeName":"challengeName___m7v0x","shixunPreviewFooter":"shixunPreviewFooter___iaciG","shixunInfoWrapper":"shixunInfoWrapper___aSihg","shixunInfo":"shixunInfo___WYBm1","btnToDetail":"btnToDetail___WVmtj","fixedBottom":"fixedBottom___oeMSX","cancelBtn":"cancelBtn___ac73V","confirmBtn":"confirmBtn___sYh2O","previewBtn":"previewBtn___c2uQz","setScoreModalTitle":"setScoreModalTitle___ADafj","modalTitle":"modalTitle___t821D","scoreText":"scoreText___M3UUZ"});
|
|
// EXTERNAL MODULE: ./src/components/NoData/index.tsx
|
|
var NoData = __webpack_require__(87526);
|
|
// EXTERNAL MODULE: ./src/components/ui-customization/index.tsx + 34 modules
|
|
var ui_customization = __webpack_require__(26324);
|
|
// EXTERNAL MODULE: ./node_modules/_antd@5.9.0@antd/es/checkbox/index.js + 3 modules
|
|
var es_checkbox = __webpack_require__(24905);
|
|
;// CONCATENATED MODULE: ./src/pages/Paperlibrary/Random/Edit/QuestionInfo/QuestionTypeModal.tsx
|
|
|
|
|
|
|
|
const options = [
|
|
{ label: "\u5355\u9009\u9898", value: "SINGLE" },
|
|
{ label: "\u591A\u9009\u9898", value: "MULTIPLE" },
|
|
{ label: "\u586B\u7A7A\u9898", value: "COMPLETION" },
|
|
{ label: "\u5224\u65AD\u9898", value: "JUDGMENT" },
|
|
{ label: "\u7B80\u7B54\u9898", value: "SUBJECTIVE" },
|
|
{ label: "\u7F16\u7A0B\u9898", value: "PROGRAM" },
|
|
{ label: "\u7EC4\u5408\u9898", value: "COMBINATION" },
|
|
{ label: "\u5B9E\u8BAD\u9898", value: "PRACTICAL" },
|
|
{ label: "\u7A0B\u5E8F\u586B\u7A7A\u9898", value: "BPROGRAM" }
|
|
];
|
|
const QuestionTypeModal = ({ open, onCancel, onOk }) => {
|
|
const { data, dispatch } = (0,_react_17_0_2_react.useContext)(DataContext);
|
|
(0,_react_17_0_2_react.useEffect)(() => {
|
|
if (open) {
|
|
const { item_types } = data || {};
|
|
setQuestionType(item_types == null ? void 0 : item_types.map((item) => item.item_type));
|
|
}
|
|
}, [open, data]);
|
|
const [questionType, setQuestionType] = (0,_react_17_0_2_react.useState)([]);
|
|
return /* @__PURE__ */ _react_17_0_2_react.createElement(
|
|
modal["default"],
|
|
{
|
|
title: /* @__PURE__ */ _react_17_0_2_react.createElement("div", null, "\u9898\u578B\u8BBE\u7F6E", /* @__PURE__ */ _react_17_0_2_react.createElement("span", { className: "c-grey-333", style: { fontSize: 14, fontWeight: 400 } }, "\uFF08\u901A\u8FC7\u52FE\u9009\u53EF\u5BF9\u9898\u578B\u8FDB\u884C\u6DFB\u52A0/\u5220\u9664\uFF09")),
|
|
closable: true,
|
|
centered: true,
|
|
open,
|
|
onCancel,
|
|
onOk: () => onOk(questionType)
|
|
},
|
|
/* @__PURE__ */ _react_17_0_2_react.createElement(es_checkbox["default"].Group, { value: questionType, onChange: (checkedValue) => setQuestionType(checkedValue) }, /* @__PURE__ */ _react_17_0_2_react.createElement(row/* default */.Z, { gutter: [0, 20] }, options.map((item) => /* @__PURE__ */ _react_17_0_2_react.createElement(col/* default */.Z, { key: item.value, span: 6 }, /* @__PURE__ */ _react_17_0_2_react.createElement(es_checkbox["default"], { value: item.value }, item.label)))))
|
|
);
|
|
};
|
|
/* harmony default export */ var QuestionInfo_QuestionTypeModal = (QuestionTypeModal);
|
|
|
|
// EXTERNAL MODULE: ./node_modules/_antd@5.9.0@antd/es/table/index.js + 85 modules
|
|
var table = __webpack_require__(14491);
|
|
;// CONCATENATED MODULE: ./src/pages/Paperlibrary/Random/Edit/QuestionInfo/SetScoreModal.tsx
|
|
var SetScoreModal_defProp = Object.defineProperty;
|
|
var SetScoreModal_getOwnPropSymbols = Object.getOwnPropertySymbols;
|
|
var SetScoreModal_hasOwnProp = Object.prototype.hasOwnProperty;
|
|
var SetScoreModal_propIsEnum = Object.prototype.propertyIsEnumerable;
|
|
var SetScoreModal_defNormalProp = (obj, key, value) => key in obj ? SetScoreModal_defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
|
|
var SetScoreModal_spreadValues = (a, b) => {
|
|
for (var prop in b || (b = {}))
|
|
if (SetScoreModal_hasOwnProp.call(b, prop))
|
|
SetScoreModal_defNormalProp(a, prop, b[prop]);
|
|
if (SetScoreModal_getOwnPropSymbols)
|
|
for (var prop of SetScoreModal_getOwnPropSymbols(b)) {
|
|
if (SetScoreModal_propIsEnum.call(b, prop))
|
|
SetScoreModal_defNormalProp(a, prop, b[prop]);
|
|
}
|
|
return a;
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
const SetScore = ({ open, onCancel, onOk }) => {
|
|
const { data } = (0,_react_17_0_2_react.useContext)(DataContext);
|
|
const [tempData, setTempData] = (0,_react_17_0_2_react.useState)();
|
|
console.log("--xxx-", tempData);
|
|
(0,_react_17_0_2_react.useEffect)(() => {
|
|
if (open) {
|
|
setTempData((0,lodash.cloneDeep)(data));
|
|
}
|
|
}, [open, data]);
|
|
const paperTotalScore = (0,_react_17_0_2_react.useMemo)(() => {
|
|
var _a;
|
|
let total;
|
|
total = (_a = tempData == null ? void 0 : tempData.item_types) == null ? void 0 : _a.map((item) => item.total_score).reduce((a, b) => parseFloat(a) + parseFloat(b));
|
|
return total == null ? void 0 : total.toFixed(1);
|
|
}, [tempData]);
|
|
return open ? /* @__PURE__ */ _react_17_0_2_react.createElement(
|
|
modal["default"],
|
|
{
|
|
title: /* @__PURE__ */ _react_17_0_2_react.createElement(row/* default */.Z, { className: QuestionInfomodules.setScoreModalTitle, justify: "space-between" }, /* @__PURE__ */ _react_17_0_2_react.createElement("span", { className: QuestionInfomodules.modalTitle }, "\u6279\u91CF\u8BBE\u7F6E\u5206\u503C"), /* @__PURE__ */ _react_17_0_2_react.createElement("span", { className: QuestionInfomodules.scoreText }, "\u603B\u5206\xA0", paperTotalScore)),
|
|
open,
|
|
width: 640,
|
|
centered: true,
|
|
closable: true,
|
|
onCancel,
|
|
onOk: () => {
|
|
onOk(tempData);
|
|
}
|
|
},
|
|
/* @__PURE__ */ _react_17_0_2_react.createElement(
|
|
table["default"],
|
|
{
|
|
columns: [
|
|
{
|
|
title: "\u9898\u578B\u540D\u79F0",
|
|
dataIndex: "item_type_text"
|
|
},
|
|
{
|
|
title: "\u5C0F\u9898\u603B\u6570",
|
|
dataIndex: "item_bank_count"
|
|
},
|
|
{
|
|
title: "\u9898\u578B\u603B\u5206",
|
|
dataIndex: "total_score"
|
|
},
|
|
{
|
|
title: "\u64CD\u4F5C",
|
|
render(value, record) {
|
|
const { score, item_type } = record;
|
|
return /* @__PURE__ */ _react_17_0_2_react.createElement("div", { style: { color: "#9096A3" } }, "\u6BCF", (record == null ? void 0 : record.item_type) === "PRACTICAL" ? "\u9898" : "\u9898", /* @__PURE__ */ _react_17_0_2_react.createElement(
|
|
input_number/* default */.Z,
|
|
{
|
|
precision: 1,
|
|
size: "large",
|
|
className: "ml10 mr10",
|
|
min: 0.1,
|
|
disabled: (record == null ? void 0 : record.item_bank_count) === 0,
|
|
max: 100,
|
|
onChange: (v) => {
|
|
const dataCopy = tempData;
|
|
const currentItem = dataCopy.item_types.find((item) => item.item_type === item_type);
|
|
currentItem.score = Number(v);
|
|
const new_total_score = v * currentItem.item_bank_count;
|
|
currentItem.total_score = new_total_score && Number(new_total_score.toFixed(1));
|
|
dataCopy.examination_bank.total_score = dataCopy.item_types.reduce((acc, cur) => Number(acc) + Number(cur.total_score), 0);
|
|
setTempData(SetScoreModal_spreadValues({}, dataCopy));
|
|
}
|
|
}
|
|
), "\u5206");
|
|
}
|
|
}
|
|
],
|
|
dataSource: tempData == null ? void 0 : tempData.item_types,
|
|
rowKey: "item_type",
|
|
pagination: false
|
|
}
|
|
)
|
|
) : null;
|
|
};
|
|
/* harmony default export */ var SetScoreModal = (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/select/index.js
|
|
var es_select = __webpack_require__(57809);
|
|
// EXTERNAL MODULE: ./node_modules/_antd@5.9.0@antd/es/tree/index.js + 8 modules
|
|
var tree = __webpack_require__(48209);
|
|
;// CONCATENATED MODULE: ./src/pages/Paperlibrary/Random/Edit/QuestionInfo/RuleModal/ImgIcon/folder-closed.png
|
|
var folder_closed_namespaceObject = "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACgAAAAoCAYAAACM/rhtAAAAAXNSR0IArs4c6QAAAtFJREFUWEftWL9rU1EYPffFpCCKEEEJVUQHB10qAUHFHwguDg4ORRDq4uDg4CBIJ6GD0D/B3UEFJ5cugjbQChIqokWKClVrFDGIg2B8yZX3Xl/z/O5LzvfyKhTJXV7g/jrfOfc797sx1toCNnAzQ4A51RkymJNA/CcMvpoYhf0xDWtPwqICWEKM+QSYGgojt3Hw3mweFjmD9YlR+N8WAJSdjYwBrAWCb1oL+jzvMbzSFKoPBgLKAc6dugPbuRDtHzAXgGEMxmjjsXEAYr4MMOw2DcA8wcjWG6g+XOEAZ8c+wNpKtCXZMI+WMn6DJrbsOMQBPtrr9ySM4ZX9LEApkOfd5QBntvvhuhqFswKOz2/wDQWSZ9o0FADLfji5fBTYPwmUduYVMmV+IrLWF2DpFtCcizDTu3hmFeCBKaC4LR2cJpvjMZrwfn8HFm8qATan/bWslWckq6SuTyWcIfi5allrkmsY/DoZSZzanCwQo0REAwTIJf583e9txNIWic9p5E2OCQilZ7BxzY/8L60RSqRkcgnHqKXERgFw5eq/80EagIbB91cSPigilMabNWmYD6okXr7cZdABIAE7Gv6dpfIuZxJDI/G7S32ymJx6CoDP50ny5mIXIJPQ2Y8kEVVEw+DSeCKLWbkldlQA6JZwaZe9BuDr8xkAZjU6Pp5LvHiu9xmkWej6Wt8KXOK1VuGDL89272IaMLv6yAID3cUvzvS5SZyQyZOAZZl7hrnEz0/rjZoxzAhOyUEOcOFEH6MWhDGCWAApPs8B1o/p68GsANgbRVVRPzu8fvVg5gA0xcLTsV/wCtF/iKz6cABkfBfL+Z12m0tc2/cWXnFPODf3zZCxmOj4yxzg/O4qWv48LDwHIHOZrO/i5HoGHRQ3HeEAg0m1ShWtn/dh27tgUAilTqOUMcyqm7AfbZjCR5Q2j+N4o64DOMDhXq8pQ4B5mdzwDP4B5kHmZrL/eyAAAAAASUVORK5CYII=";
|
|
;// CONCATENATED MODULE: ./src/pages/Paperlibrary/Random/Edit/QuestionInfo/RuleModal/ImgIcon/folder-opened.png
|
|
var folder_opened_namespaceObject = "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACgAAAAoCAYAAACM/rhtAAAAAXNSR0IArs4c6QAAA4RJREFUWEftWEtrE1EYPXfSh5VWSlMfNSi4sokLK30pWtuKIChVVBBBWpfiRhcKghii7tp/4FrBBxREXbhQ0Bj7gqokahe+kNZWqa21tLGtk7kymY5J79yZL5NUKNLZZHHnzj33fOec+90wzrkHS/hhywBzrM4ygzkSiP+EwTdtPvDJdnDeCI4KgBPEsGGAPYOn8Bq23A7nwiLNYH+bD+rYSwBlloUYAzgH9F/Zo48pyhMoBVdR3ZkVUBpgV9MNcO24sb7OnA6GYtBEa75rbkCYL24wOcxGAPYUhSUXUH3/Cw0wXDUIziuMJYkFc6mluH+GcRSv2UYDfLxJtSWMwiuOUxsUC6Qot2iAD71q8ruZVNgtYFO/+m+yQKKm2UgGAMvU5GTvbqDyClC4LmUMuw+LTFiYdNDC7FdgIASMG57KHGDNdSB/tVyKltIJAESmRHziBmZHgf5WlwBrb6bihFrQmkdpCSDRiiyu+ozgyJzBujtpy1Jiy9XOAPqOuQRY35mKP8qdFvELBFJu1qH1HnUL8K59iV0DFtwqc3PPIQnAH+3noGmXAK1k4YnhxoaS8joqQgFYOaBUAlBSedbTIgCcuLwBc78+SW3qWnJUzkjG8/yAZ3Nqd937BYDfghvB4x+NQJ5vAMycozRvOVOF+Rk1FaVAkQEquX73PkmJh89EwXngn5+5dhsuPgwopYYZu/ZKAA6dDkLTQhaAlhKLDAsvuJWE+X5RDbCi1jBjpEkCcPCsH4mpmKXEVIksbZiAkDxz5zWZVwaUnjS6pkiDTcx8aI2CscCCRtStJqmjzKmtLD8FeLxAZKcNwPcnguCJ0II1SAYERJSJnUxX0gysagbC2+0YbPNDnY79rZrk6LR+n0DkRsP5a4GK80C4xuEkeXswCvCAfaOawV3E1K2+DGUaUeO+i4AlB9NpeX0gCGihpA6zeahcpBB7W4Bo0IHBgSN+zP2MGVuX1ZiihHKJOC5IpMAHfH7gAFAfetUYBUcgGwIXZc73d0BixqEffNGQ5mYi1yjCSFdLKhIfA6ZHHQBGm/2YmYpJ2bAEN4nAmVRZjKmzwOQQcWnq3focnNdTBwV9n88yhuKj95xb/i5/HdSpRwBbmfpXIRPTCIS5ycF0U3o8O+g7SWR9FebiHeCJXQArkNdKYIiqODXO2G9A6cCeiRANcFEsmf1HlgFmz50xc8kz+AfHHTJwrKNsNwAAAABJRU5ErkJggg==";
|
|
;// CONCATENATED MODULE: ./src/pages/Paperlibrary/Random/Edit/QuestionInfo/RuleModal/ImgIcon/folderopen1.png
|
|
var folderopen1_namespaceObject = "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACgAAAAoCAYAAACM/rhtAAAAAXNSR0IArs4c6QAABWlJREFUWEftV1tsVEUY/ubspUu3W9mWGlttwXqJVRNBbqIFDbyA8mCCkAYtpEaIGBODhBCECiG+UE1EnzTempYqtSAE45saBMX40JC0IRojpd1GKM1uW7bd7V7OOWPmnD3bPTNndxYbE2I6L2dzdubMN9/3/ZchlFIXbuNB5gDOUp05BmdJIP4fDPZcxt2xaRzVgadBUQ3QDDEE5m/2zBkE1whwoYTg461LcX42LEoZZOCiMXoJoBUCHEIASgH2dBqUgijKORfBkW3/EqgUYNsPieMAmtj+Fhb2NIfFXvaFnUhCQBlI6wD8dGcBrisEP5V7fft2NuJvKcC9p6PDoLSa7cwTJgKejZj8WjLm93iWSAG2tI+qEsdlvywl6BZPqBByQgpw44fDKskEAQUF+82e5rBrxCvGz7fWZr+XkZ/ZwFTIbgkKel0K8LkPhlW2uLbSh9UNQfh9btGLIrIZ7E7WyDkaf8xYQsX538cwHE4YgKUAnz0WMgC+/EwNSn1uR5MVEcxZ/xbjUgbyi3PXDNNLAW44FjIk3rOxNpvtCseuCEFCMGcUc/2734YMFaQA178fUhlDB56vy+4s27AYlgrOocA7Z0IG60UDPLypLm8BEQBncnc2X3ITijng4ZMhM8vK+kHGIIuyI5sXZgsGn//ECmOvgMJ8rgA5/f92T8hM8rkAX/psZI+u4yClesAWhhLNhPTBpSMhfeSkF7eLoP5OHzY8FoSizGzU+vWQmXosgLvPTNTGJpNXi8lvPF4hPwoZW0YZsKw+gMWLSrMV1ASYE8V7e27WTUwnB7IzsrFVjOXzdDVWOpfgY+YO+j3YvKrCWMEkP9g9ZHjeJvErnaN9oHhYgCSrYQ5F2echKPcpSGkUE9PU3vXkMeWWJxcg6HcZAA+cGDIosgHc0THaqun0EN8ViFFqdij5SlTT8jKsa5gHJdPF/DaQwCcXotkCme+8y+/zY1m937D/W19yHmSs7eoeb0gm0v1Wi2QBEGpuAcm8buCjF6tmWqyMHPu/iWAkahQlseZm0lKw1I2mRlPm/V2D9iCxZG1pH+2j4GR2KB1lJaaE8TSTUDf88kiNB2sfKsWCMgWlXgVVARfG4xp+/iuBU72xmca7gGW2NlYaMu/vYgxyaYaBbGkPt+pUP5Trw1xGa4Nu7FhdjkULPBlDUwxGVLgVgsFIGj/+MY0rYdXwzzwvQTzFOiDHi4Fj9K14wI+V9/uxr3PQuZLs6hxviKnpfttVI+fERzdVoPoOsWmYiGt4ozsCncnFA+JeFGp0KwJuNK+pwL6OPBKzYzV/npHZoZN/74UK3OUAMJ7S8VpXBJoRsPYgEhBLskLzmkq0nR7OX+q2t4fNaHYYtUEXdq4O4N6MxGzKnzfSiExpqJnvRm8oiYtXkhiJasZqj8vMMCqzaebAsvbsiQf9OHXxRv5+kEXzZFzvt+5qgiQEmO8jhseSGjAW0w0wJW7g8Tovnqovgb+EGO+XLvTCRYBITEd3bxy/DqREQrnmojLgRt/VMaN7z9ssNLeP94GPZotR2d2CECy5x40315XZNIgldbz61U15aSLASHgSqqblB9hyfKpV07WMzHaXi3lS3NPrAnav9ePRGjOgVI3i5KUEvrucEm6HfFix2h6dnMbNqen8AHd1pxpiyWS/mS0lYSncj2cWVJURBHwEI1Ed8VQ+8sSoSasqro9OFL40beuM/UIpXSnczvjbF387484jK+VODDL/3QiPny3YsG7vGFsRT+rfE5BSC6QjB7IWWfY/91FrrwRRV0k76i2fhhcnk2obqN4IQrxOAGWevEV8UIiS1iltO/t69SEpQHnI/bcz5gDOlt/bnsF/AOXAMnuF/cdAAAAAAElFTkSuQmCC";
|
|
;// CONCATENATED MODULE: ./src/pages/Paperlibrary/Random/Edit/QuestionInfo/RuleModal/ImgIcon/folder.png
|
|
var folder_namespaceObject = "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACgAAAAoCAYAAACM/rhtAAAAAXNSR0IArs4c6QAABpxJREFUWAntWE2IHFUQrtfzk5nNbrKbRGPcRSU/oIEkmERjMAQhCBIjKBpFEBER9OZNL4IevOhFbyGHRA9BhKBeouJFIkTNwaxGg16ikN1k0WR3M5ndnf/ptr56r7p7+s1mkYCHkILpev1e1VdfVb3X0zNEt+Qmr4Dpl9+xs9FYq0XvR0SPUETriC9WYI6x72YML0T0By99Gxj68KWd5k/ndEPKiwRy7RadZSKrDEdDVGiRxfnZ9YjJM1MTUScydIwn371Roh7BD042P2Hg5xHRxRON+6R6WlE7m1wzGRjT4ZnTjNOFjQkYIbQ68UlGURhSYIIpTu7k6N7CkWeN6XoE3zoxP8WMuK22kemG6ngxel4CWQeubpw1AmQrkFpnyx9HVg/uy8MuLbPV5uJ7DuloUDhlA8hWSAxS8SSEZy6zi152V2pX3/YJzjVlH8EtYkTDUaAhOobuJ0vZL7XuJWzoKY9gtd6JY5eKAQ0PFOL7/2NQqbWp0eKNCjFmk0fQVsvQ2Opl9Pj2NZQPeGdnWpu5jbtu68zA2uV4QsIll+sAdPigfPXzNF2cafKBCo1HUFF2bRiikQEmx/If9042H49vdm9qTKsDenD9EE1O263mbaaDhy7FeWf3jBe5F5mXe5+b+gyFhiy17rWKK+NVcGQ5ppRjpheZW680/oQQSy5LAiSmGHGpPYKyB/WUZnurvFUDJD32eodFJQXjrGAN4nQ2Hq/4BGHsgtrHChKxAH38BT6+wED8LUCOt/CejSW6czhPF2badPqvJoUO2/o4ew0Y+yaE+xBkVwkEniBrd5KScEsOnwNo1TCjY5fQ6/uG6b51RXWlLWMNOvxdNaZD/J2GEKLF340dP+xZe0xjCPBxQTmIjqHtx67DRIiKDTuDUMb+3jsKPeQQYufdJRrjaiqezR/xgKGYVgM/5ItHEJZog22FHSuCEOZ1DQAbjPvZryz1gWYeQ2XMW0ahBOEYrPFhuFhjDDuvxWBtATi4GCUat7Ls5j0DVwW8tYyOeNBUa4Z0/nLbJQ8QJGu1XlMvd2LnoaQN4NQryBxi9YbbCrRpbYGa7Yh+mWzS7EKXxlbl6ZWHV9DalTn6+twC7V5f4q/LHE3Pd+nIqSrV2VYF1dfvd8xl97yts1o7/eLRf7B1RbSWCaSd5zdmem3vCtrFwVVanYjOTDTpgXuW0e9TLfr4hzmaWQhlew4WDc01JbwUfTF8zGtM4GLcp4JYSiRLDisHtg70kMNcMW+kWsfPzNOJX2uYEkELQQ6CVwCQcK8C8ThNGHYaE9ojCAPZu6xxOBEAGqLjvZvKdqLPFb7qn11WcjEhDNheW6b40BAsewR1EQYIJKApB8ytkJMIC1/WDuX8STfjYJIK4fWfA+BngIiOEdSJ9ywAAQAJmBvrhM5NzCbvjAqk+mKlI4kJDjuoRuI6hsYHotreKTNoe8I9grZmzkDqx4YwFgerPxtfYGAXwSLLFXMHdwzS09uXU6nAGFwe+ZpEmVJjzOm8aqwLpNM69vqx9ck337G8AML8BTsQQKHNL7CX50KavNqljbfnaYDfuiHnptr03jfX6O9qSAe2DNCjm8s034hocrbLEIa2jRVp22iRupxXpY7kBK1HG7wcY4a1EHerMqmXFz6aZW9bHWTBCbmHaTLGHATrq5YbarSJai2usbMt86+EJ7aW6bHNJZq61qU5JrplNPnp8OlPNfryHL8xS1/QFRsPsBg5eMH3WyzRYcJ5S0ZWy5grqho/cjG+WjdU51+/adsG3x8fb9AbX1TlEZMmx8D0zP1ld9A4TioeyTcvYoOWxfcJCrEcB0T3Edhqm5clvtg4TRLjGX4c/jblH6h8ztCawRwFjI1tBI0PyKoW4nzvPWZ03zE7tgGhRMf1tx2xPHt6wlNI2a0b/g/k/BV9hgiUXOq8HS5ei43iPSQJ8r6xiVocv4JBwJ79K5WtEOx0Tny0XdD8QfXPT0f0+dmWvKWAHfbqoe8b1MafGpKN0xiLn2r2z+X0GS6JyeW5o5VmPhfIW2b2y5xduDh44CABFqhUBa9nP1xGWw1dqoRUcy8M6JD6CF7mVLbDqOW1uF5vjpeK+YfEYQkCWYYZc4HQyxU+6Veqeme1Jpuc4t4CNFqdcY9g1yzbX2/WL+QCM9QLhzstl90/S1fUdg2FgWQT6EVLbNHpThjNhaa8Hz6e7DgcFVbPTxwNcrk9JgqH9bBkCWYDZPh7uNmWanuhVfhIVaIwOjUzeNfLZ141XPdbcpNX4F/ikyqlsA/6bwAAAABJRU5ErkJggg==";
|
|
;// CONCATENATED MODULE: ./src/pages/Paperlibrary/Random/Edit/QuestionInfo/RuleModal/index.less?modules
|
|
// extracted by mini-css-extract-plugin
|
|
/* harmony default export */ var RuleModalmodules = ({"ruleCheckBox":"ruleCheckBox___Onj2f","folderAreaWrapper":"folderAreaWrapper___ut2mr","folderAreaHeader":"folderAreaHeader___fOIDA","folderWrapper":"folderWrapper___IpJ50","folderIcon":"folderIcon___zBoRM","shareFolderIcon":"shareFolderIcon____5s3p","treeNodeItem":"treeNodeItem___quqla","treeNodeDifficulty":"treeNodeDifficulty___en0gk"});
|
|
// EXTERNAL MODULE: ./src/service/problemset.ts
|
|
var problemset = __webpack_require__(66401);
|
|
;// CONCATENATED MODULE: ./src/pages/Paperlibrary/Random/Edit/QuestionInfo/RuleModal/FileFolder.tsx
|
|
var FileFolder_defProp = Object.defineProperty;
|
|
var FileFolder_defProps = Object.defineProperties;
|
|
var FileFolder_getOwnPropDescs = Object.getOwnPropertyDescriptors;
|
|
var FileFolder_getOwnPropSymbols = Object.getOwnPropertySymbols;
|
|
var FileFolder_hasOwnProp = Object.prototype.hasOwnProperty;
|
|
var FileFolder_propIsEnum = Object.prototype.propertyIsEnumerable;
|
|
var FileFolder_defNormalProp = (obj, key, value) => key in obj ? FileFolder_defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
|
|
var FileFolder_spreadValues = (a, b) => {
|
|
for (var prop in b || (b = {}))
|
|
if (FileFolder_hasOwnProp.call(b, prop))
|
|
FileFolder_defNormalProp(a, prop, b[prop]);
|
|
if (FileFolder_getOwnPropSymbols)
|
|
for (var prop of FileFolder_getOwnPropSymbols(b)) {
|
|
if (FileFolder_propIsEnum.call(b, prop))
|
|
FileFolder_defNormalProp(a, prop, b[prop]);
|
|
}
|
|
return a;
|
|
};
|
|
var FileFolder_spreadProps = (a, b) => FileFolder_defProps(a, FileFolder_getOwnPropDescs(b));
|
|
var FileFolder_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 updateTreeData = (list, key, changePart) => list.map((node) => {
|
|
if (node.key === key) {
|
|
return FileFolder_spreadValues(FileFolder_spreadValues({}, node), changePart);
|
|
}
|
|
if (node.children) {
|
|
return FileFolder_spreadProps(FileFolder_spreadValues({}, node), {
|
|
children: updateTreeData(node.children, key, changePart)
|
|
});
|
|
}
|
|
return node;
|
|
});
|
|
const diffMap = {
|
|
"\u7B80\u5355": 1,
|
|
"\u9002\u4E2D": 2,
|
|
"\u56F0\u96BE": 3
|
|
};
|
|
const generateTree = (arr, ruleValue, type) => {
|
|
return arr.map((item) => {
|
|
var _a;
|
|
const tagNodeArr = item == null ? void 0 : item.tag_disciplines.map((tagItem) => {
|
|
const tagDifficultyArr = tagItem == null ? void 0 : tagItem.difficulty_count.map((diff) => ({ label: diff == null ? void 0 : diff.name, value: diffMap[diff.name] }));
|
|
return {
|
|
title: getRuleValue(ruleValue) === RuleValueKeyType.All && tagDifficultyArr.length > 0 ? /* @__PURE__ */ _react_17_0_2_react.createElement(row/* default */.Z, { justify: "space-between" }, /* @__PURE__ */ _react_17_0_2_react.createElement(col/* default */.Z, null, `${tagItem.name}\uFF08${tagItem.child_count}\uFF09`), /* @__PURE__ */ _react_17_0_2_react.createElement(col/* default */.Z, null, /* @__PURE__ */ _react_17_0_2_react.createElement("span", { className: "mr15", style: { color: "#666" } }, "\u96BE\u5EA6"), /* @__PURE__ */ _react_17_0_2_react.createElement(es_form["default"].Item, { noStyle: true, name: [`${item.id}_${tagItem.id}`, "diffValue"] }, /* @__PURE__ */ _react_17_0_2_react.createElement(
|
|
es_checkbox["default"].Group,
|
|
{
|
|
style: { columnGap: 12 },
|
|
options: tagDifficultyArr
|
|
}
|
|
)), /* @__PURE__ */ _react_17_0_2_react.createElement(es_form["default"].Item, { noStyle: true, name: [`${item.id}_${tagItem.id}`, "diffNum"], initialValue: tagItem == null ? void 0 : tagItem.difficulty_count }, /* @__PURE__ */ _react_17_0_2_react.createElement("input", { type: "hidden" })), /* @__PURE__ */ _react_17_0_2_react.createElement(es_form["default"].Item, { noStyle: true, name: [`${item.id}_${tagItem.id}`, "extra"], initialValue: FileFolder_spreadProps(FileFolder_spreadValues({}, item), { type }) }, /* @__PURE__ */ _react_17_0_2_react.createElement("input", { type: "hidden" })))) : `${tagItem.name}\uFF08${tagItem.child_count}\uFF09`,
|
|
key: `${item.id}_${tagItem.id}`,
|
|
name: tagItem.name,
|
|
parentName: item.name,
|
|
item_banks_count: tagItem.child_count,
|
|
icon: null,
|
|
isLeaf: true,
|
|
checkable: getRuleValue(ruleValue) === RuleValueKeyType.FileFolderAndKnowledge,
|
|
disableCheckbox: tagItem.child_count === 0
|
|
};
|
|
});
|
|
const difficultyArr = item == null ? void 0 : item.difficulty_count.map((diff) => ({ label: diff == null ? void 0 : diff.name, value: diffMap[diff.name] }));
|
|
return {
|
|
title: getRuleValue(ruleValue) === RuleValueKeyType.FileFolderAndDiff && difficultyArr.length > 0 ? /* @__PURE__ */ _react_17_0_2_react.createElement(row/* default */.Z, { justify: "space-between" }, /* @__PURE__ */ _react_17_0_2_react.createElement(col/* default */.Z, null, `${item.name}\uFF08${item.item_banks_count}\uFF09`), /* @__PURE__ */ _react_17_0_2_react.createElement(col/* default */.Z, null, /* @__PURE__ */ _react_17_0_2_react.createElement("span", { className: "mr15", style: { color: "#666" } }, "\u96BE\u5EA6"), /* @__PURE__ */ _react_17_0_2_react.createElement(es_form["default"].Item, { noStyle: true, name: [`${item.id}`, "diffValue"] }, /* @__PURE__ */ _react_17_0_2_react.createElement(
|
|
es_checkbox["default"].Group,
|
|
{
|
|
style: { columnGap: 12 },
|
|
options: difficultyArr
|
|
}
|
|
)), /* @__PURE__ */ _react_17_0_2_react.createElement(es_form["default"].Item, { noStyle: true, name: [`${item.id}`, "diffNum"], initialValue: item == null ? void 0 : item.difficulty_count }, /* @__PURE__ */ _react_17_0_2_react.createElement("input", { type: "hidden" })), /* @__PURE__ */ _react_17_0_2_react.createElement(es_form["default"].Item, { noStyle: true, name: [`${item.id}`, "extra"], initialValue: FileFolder_spreadProps(FileFolder_spreadValues({}, item), { type }) }, /* @__PURE__ */ _react_17_0_2_react.createElement("input", { type: "hidden" })))) : `${item.name}\uFF08${item.item_banks_count}\uFF09`,
|
|
key: `${item.id}`,
|
|
name: item.name,
|
|
item_banks_count: item.item_banks_count,
|
|
icon: (e) => {
|
|
if (e.expanded) {
|
|
return type === "0" ? /* @__PURE__ */ _react_17_0_2_react.createElement("img", { src: folder_opened_namespaceObject, className: RuleModalmodules.folderIcon }) : /* @__PURE__ */ _react_17_0_2_react.createElement("img", { src: folderopen1_namespaceObject, className: RuleModalmodules.shareFolderIcon });
|
|
} else {
|
|
return type === "0" ? /* @__PURE__ */ _react_17_0_2_react.createElement("img", { src: folder_closed_namespaceObject, className: RuleModalmodules.folderIcon }) : /* @__PURE__ */ _react_17_0_2_react.createElement("img", { src: folder_namespaceObject, className: RuleModalmodules.shareFolderIcon });
|
|
}
|
|
},
|
|
isLeaf: !item.have_child && !((_a = item.tag_disciplines) == null ? void 0 : _a.length),
|
|
checkable: getRuleValue(ruleValue) === RuleValueKeyType.OnlyFileFolder,
|
|
disableCheckbox: item.item_banks_count === 0,
|
|
children: item.children.length ? getRuleValue(ruleValue) === RuleValueKeyType.All || getRuleValue(ruleValue) === RuleValueKeyType.FileFolderAndKnowledge ? [...generateTree(item.children, ruleValue, type), ...tagNodeArr] : generateTree(item.children, ruleValue, type) : []
|
|
};
|
|
});
|
|
};
|
|
const generateTree2 = (arr, ruleValue, type) => {
|
|
return arr.map((item) => {
|
|
var _a;
|
|
const tagNodeArr = item == null ? void 0 : item.tag_disciplines.map((tagItem) => {
|
|
console.log("tagItem:", tagItem);
|
|
const tagDifficultyArr = tagItem == null ? void 0 : tagItem.difficulty_count.map((diff) => ({ label: diff == null ? void 0 : diff.name, value: diffMap[diff.name] }));
|
|
return {
|
|
title: getRuleValue(ruleValue) === RuleValueKeyType.All && tagDifficultyArr.length > 0 ? /* @__PURE__ */ _react_17_0_2_react.createElement(row/* default */.Z, { justify: "space-between" }, /* @__PURE__ */ _react_17_0_2_react.createElement(col/* default */.Z, null, `${tagItem.name}\uFF08${tagItem.child_count}\uFF09`), /* @__PURE__ */ _react_17_0_2_react.createElement(col/* default */.Z, null, /* @__PURE__ */ _react_17_0_2_react.createElement("span", { className: "mr15", style: { color: "#666" } }, "\u96BE\u5EA6"), /* @__PURE__ */ _react_17_0_2_react.createElement(es_form["default"].Item, { noStyle: true, name: [`${item.id}_${tagItem.id}`, "diffValue"] }, /* @__PURE__ */ _react_17_0_2_react.createElement(
|
|
es_checkbox["default"].Group,
|
|
{
|
|
style: { columnGap: 12 },
|
|
options: tagDifficultyArr
|
|
}
|
|
)), /* @__PURE__ */ _react_17_0_2_react.createElement(es_form["default"].Item, { noStyle: true, name: [`${item.id}_${tagItem.id}`, "diffNum"], initialValue: tagItem == null ? void 0 : tagItem.difficulty_count }, /* @__PURE__ */ _react_17_0_2_react.createElement("input", { type: "hidden" })), /* @__PURE__ */ _react_17_0_2_react.createElement(es_form["default"].Item, { noStyle: true, name: [`${item.id}_${tagItem.id}`, "extra"], initialValue: FileFolder_spreadProps(FileFolder_spreadValues({}, item), { type }) }, /* @__PURE__ */ _react_17_0_2_react.createElement("input", { type: "hidden" })))) : `${tagItem.name}\uFF08${tagItem.child_count}\uFF09`,
|
|
key: `${item.id}_${tagItem.id}`,
|
|
name: tagItem.name,
|
|
parentName: item.name,
|
|
item_banks_count: tagItem.child_count,
|
|
icon: null,
|
|
isLeaf: true,
|
|
checkable: getRuleValue(ruleValue) === RuleValueKeyType.FileFolderAndKnowledge,
|
|
disableCheckbox: tagItem.child_count === 0
|
|
};
|
|
});
|
|
const difficultyArr = item == null ? void 0 : item.difficulty_count.map((diff) => ({ label: diff == null ? void 0 : diff.name, value: diffMap[diff.name] }));
|
|
return {
|
|
title: getRuleValue(ruleValue) === RuleValueKeyType.FileFolderAndDiff && difficultyArr.length > 0 ? /* @__PURE__ */ _react_17_0_2_react.createElement(row/* default */.Z, { justify: "space-between" }, /* @__PURE__ */ _react_17_0_2_react.createElement(col/* default */.Z, null, `${item.name}\uFF08${item.item_banks_count}\uFF09`), /* @__PURE__ */ _react_17_0_2_react.createElement(col/* default */.Z, null, /* @__PURE__ */ _react_17_0_2_react.createElement("span", { className: "mr15", style: { color: "#666" } }, "\u96BE\u5EA6"), /* @__PURE__ */ _react_17_0_2_react.createElement(es_form["default"].Item, { noStyle: true, name: [`${item.id}`, "diffValue"] }, /* @__PURE__ */ _react_17_0_2_react.createElement(
|
|
es_checkbox["default"].Group,
|
|
{
|
|
style: { columnGap: 12 },
|
|
options: difficultyArr
|
|
}
|
|
)), /* @__PURE__ */ _react_17_0_2_react.createElement(es_form["default"].Item, { noStyle: true, name: [`${item.id}`, "diffNum"], initialValue: item == null ? void 0 : item.difficulty_count }, /* @__PURE__ */ _react_17_0_2_react.createElement("input", { type: "hidden" })), /* @__PURE__ */ _react_17_0_2_react.createElement(es_form["default"].Item, { noStyle: true, name: [`${item.id}`, "extra"], initialValue: FileFolder_spreadProps(FileFolder_spreadValues({}, item), { type }) }, /* @__PURE__ */ _react_17_0_2_react.createElement("input", { type: "hidden" })))) : `${item.name}\uFF08${item.item_banks_count}\uFF09`,
|
|
key: `${item.id}`,
|
|
name: item.name,
|
|
item_banks_count: item.item_banks_count,
|
|
icon: (e) => {
|
|
if (e.expanded) {
|
|
return type === "0" ? /* @__PURE__ */ _react_17_0_2_react.createElement("img", { src: folder_opened_namespaceObject, className: RuleModalmodules.folderIcon }) : /* @__PURE__ */ _react_17_0_2_react.createElement("img", { src: folderopen1_namespaceObject, className: RuleModalmodules.shareFolderIcon });
|
|
} else {
|
|
return type === "0" ? /* @__PURE__ */ _react_17_0_2_react.createElement("img", { src: folder_closed_namespaceObject, className: RuleModalmodules.folderIcon }) : /* @__PURE__ */ _react_17_0_2_react.createElement("img", { src: folder_namespaceObject, className: RuleModalmodules.shareFolderIcon });
|
|
}
|
|
},
|
|
isLeaf: !item.have_child && !((_a = item.tag_disciplines) == null ? void 0 : _a.length),
|
|
checkable: getRuleValue(ruleValue) === RuleValueKeyType.OnlyFileFolder,
|
|
disableCheckbox: item.item_banks_count === 0,
|
|
children: (
|
|
// item.children.length ?
|
|
// (getRuleValue(ruleValue) === RuleValueKeyType.All || getRuleValue(ruleValue) === RuleValueKeyType.FileFolderAndKnowledge) ?
|
|
[...generateTree2(item.children, ruleValue, type), ...tagNodeArr]
|
|
)
|
|
//: generateTree2(item.children, ruleValue, type) : []
|
|
};
|
|
});
|
|
};
|
|
const FileFolder = ({ ruleValue, defaultData, setSelectData, currentItemType, selectData }) => {
|
|
const [activeKey, setActiveKey] = (0,_react_17_0_2_react.useState)("1");
|
|
const [isFirst, setIsFirst] = (0,_react_17_0_2_react.useState)(true);
|
|
const [form] = es_form["default"].useForm();
|
|
const [teamlist, setteamlist] = (0,_react_17_0_2_react.useState)([]);
|
|
const [teamvalue, setteamvalue] = (0,_react_17_0_2_react.useState)("all");
|
|
const onCheck = (checkedKeys, info, type) => {
|
|
const { checkedNodes } = info;
|
|
console.log("type:", type, checkedNodes, selectData);
|
|
if (type === "0") {
|
|
setMyCheckedKeys(checkedKeys);
|
|
if (getRuleValue(ruleValue) === RuleValueKeyType.OnlyFileFolder) {
|
|
setSelectData((pre) => FileFolder_spreadProps(FileFolder_spreadValues({}, pre), {
|
|
my: checkedNodes.map((node) => ({
|
|
id: node.key,
|
|
group_id: node.key,
|
|
group_name: node.name,
|
|
item_bank_num: node.item_banks_count,
|
|
folderType: "0",
|
|
quanlity: 1
|
|
}))
|
|
}));
|
|
setSelectedNum(checkedNodes.reduce((acc, cur) => acc + cur.item_banks_count, 0));
|
|
} else {
|
|
console.log(checkedNodes);
|
|
setSelectData((pre) => FileFolder_spreadProps(FileFolder_spreadValues({}, pre), {
|
|
my: checkedNodes.map((node) => {
|
|
const [group_id, tag_discipline_id] = node.key.split("_");
|
|
return {
|
|
id: node.key,
|
|
tag_discipline_name: node.name,
|
|
group_id,
|
|
tag_discipline_id,
|
|
folderType: "0",
|
|
group_name: node.parentName,
|
|
item_bank_num: node.item_banks_count,
|
|
quanlity: 1
|
|
};
|
|
})
|
|
}));
|
|
setSelectedNum(checkedNodes.reduce((acc, cur) => acc + cur.item_banks_count, 0));
|
|
}
|
|
} else {
|
|
setPublicCheckedKeys(checkedKeys);
|
|
if (getRuleValue(ruleValue) === RuleValueKeyType.OnlyFileFolder) {
|
|
setSelectData((pre) => {
|
|
console.log("pre:", pre);
|
|
return FileFolder_spreadProps(FileFolder_spreadValues({}, pre), {
|
|
public: checkedNodes.map((node) => ({
|
|
id: node.key === "0" ? "00" : node.key,
|
|
teacher_group_name: node.name,
|
|
teacher_group_id: node.key,
|
|
folderType: "3",
|
|
item_bank_num: node.item_banks_count,
|
|
quanlity: 1
|
|
}))
|
|
});
|
|
});
|
|
} else {
|
|
setSelectData((pre) => FileFolder_spreadProps(FileFolder_spreadValues({}, pre), {
|
|
public: checkedNodes.map((node) => {
|
|
const [teacher_group_id, tag_discipline_id] = node.key.split("_");
|
|
return {
|
|
id: node.key === "0" ? "00" : node.key,
|
|
tag_discipline_name: node.name,
|
|
teacher_group_id,
|
|
tag_discipline_id,
|
|
folderType: "3",
|
|
teacher_group_name: node.parentName,
|
|
item_bank_num: node.item_banks_count,
|
|
quanlity: 1
|
|
};
|
|
})
|
|
}));
|
|
}
|
|
setSelectedNum(checkedNodes.reduce((acc, cur) => acc + cur.item_banks_count, 0));
|
|
}
|
|
};
|
|
const [myCheckedKeys, setMyCheckedKeys] = (0,_react_17_0_2_react.useState)([]);
|
|
const [publicCheckedKeys, setPublicCheckedKeys] = (0,_react_17_0_2_react.useState)([]);
|
|
const [myFolderData, setMyFolderData] = (0,_react_17_0_2_react.useState)([]);
|
|
const [publicFolderData, setPublicFolderData] = (0,_react_17_0_2_react.useState)([]);
|
|
const [myDatas, setMyData] = (0,_react_17_0_2_react.useState)([]);
|
|
const [publicDatas, setPublicData] = (0,_react_17_0_2_react.useState)([]);
|
|
const [myLoading, setMyLoading] = (0,_react_17_0_2_react.useState)(false);
|
|
const [publicLoading, setPublicLoading] = (0,_react_17_0_2_react.useState)(false);
|
|
function initdata() {
|
|
return FileFolder_async(this, null, function* () {
|
|
let res = yield (0,fetch/* default */.ZP)(`/api/teach_group_shares.json`, {
|
|
method: "get"
|
|
});
|
|
if (res) {
|
|
setteamlist(res == null ? void 0 : res.groups);
|
|
}
|
|
});
|
|
}
|
|
(0,_react_17_0_2_react.useEffect)(() => {
|
|
initdata();
|
|
}, []);
|
|
const getData = (params) => FileFolder_async(void 0, null, function* () {
|
|
var _a, _b, _c, _d, _e, _f, _g, _h, _i, _j, _k, _l;
|
|
params.type === "0" ? setMyLoading(true) : setPublicLoading(true);
|
|
const res = yield (0,problemset/* getGroup */.ex)(params);
|
|
params.type === "0" ? setMyLoading(false) : setPublicLoading(false);
|
|
params.type === "0" ? setMyData(res) : setPublicData(res);
|
|
const rootDifficultyArr = (_a = res.navigation[0]) == null ? void 0 : _a.difficulty_count.map((diff) => ({ label: diff == null ? void 0 : diff.name, value: diffMap[diff.name] }));
|
|
const rootTagNodeArr = (_b = res.navigation[0]) == null ? void 0 : _b.tag_disciplines.map((item) => {
|
|
const tagDifficultyArr = item == null ? void 0 : item.difficulty_count.map((diff) => ({ label: diff == null ? void 0 : diff.name, value: diffMap[diff.name] }));
|
|
return {
|
|
title: getRuleValue(ruleValue) === RuleValueKeyType.All && tagDifficultyArr.length > 0 ? /* @__PURE__ */ _react_17_0_2_react.createElement(row/* default */.Z, { justify: "space-between", style: { color: "#232B40" } }, /* @__PURE__ */ _react_17_0_2_react.createElement(col/* default */.Z, null, `${item.name}\uFF08${item.child_count}\uFF09`), /* @__PURE__ */ _react_17_0_2_react.createElement(col/* default */.Z, null, /* @__PURE__ */ _react_17_0_2_react.createElement("span", { className: "mr15", style: { color: "#666" } }, "\u96BE\u5EA6"), /* @__PURE__ */ _react_17_0_2_react.createElement(es_form["default"].Item, { noStyle: true, name: [`0_${item.id}`, "diffValue"] }, /* @__PURE__ */ _react_17_0_2_react.createElement(
|
|
es_checkbox["default"].Group,
|
|
{
|
|
style: { columnGap: 12 },
|
|
options: tagDifficultyArr
|
|
}
|
|
)), /* @__PURE__ */ _react_17_0_2_react.createElement(es_form["default"].Item, { noStyle: true, name: [`0_${item.id}`, "diffNum"], initialValue: item == null ? void 0 : item.difficulty_count }, /* @__PURE__ */ _react_17_0_2_react.createElement("input", { type: "hidden" })), /* @__PURE__ */ _react_17_0_2_react.createElement(es_form["default"].Item, { noStyle: true, name: [`0_${item.id}`, "extra"], initialValue: {
|
|
tag_discipline_name: item.name,
|
|
name: "\u6839\u76EE\u5F55",
|
|
type: params.type
|
|
} }, /* @__PURE__ */ _react_17_0_2_react.createElement("input", { type: "hidden" })))) : /* @__PURE__ */ _react_17_0_2_react.createElement("span", { style: { color: "#232B40" } }, item.name, "\uFF08", item.child_count, "\uFF09"),
|
|
key: `0_${item.id}`,
|
|
name: item.name,
|
|
parentName: "\u6839\u76EE\u5F55",
|
|
item_banks_count: item.child_count,
|
|
icon: null,
|
|
isLeaf: true,
|
|
checkable: getRuleValue(ruleValue) === RuleValueKeyType.FileFolderAndKnowledge,
|
|
disableCheckbox: item.child_count === 0
|
|
};
|
|
});
|
|
if (params.type === "0") {
|
|
const normalChildren = generateTree(res.data, ruleValue, "0");
|
|
const normalChildren2 = generateTree2(res.data, ruleValue, "0");
|
|
console.log("normalChildren2:", normalChildren2);
|
|
setMyFolderData(
|
|
[
|
|
{
|
|
title: getRuleValue(ruleValue) === RuleValueKeyType.FileFolderAndDiff ? /* @__PURE__ */ _react_17_0_2_react.createElement(row/* default */.Z, { justify: "space-between", style: { color: "#232B40" } }, /* @__PURE__ */ _react_17_0_2_react.createElement(col/* default */.Z, null, `\u6839\u76EE\u5F55\uFF08${(_c = res.navigation[0]) == null ? void 0 : _c.child_count}\uFF09`), /* @__PURE__ */ _react_17_0_2_react.createElement(col/* default */.Z, null, /* @__PURE__ */ _react_17_0_2_react.createElement("span", { className: "mr15", style: { color: "#666" } }, "\u96BE\u5EA6"), /* @__PURE__ */ _react_17_0_2_react.createElement(es_form["default"].Item, { noStyle: true, name: [`0`, "diffValue"], initialValue: [] }, /* @__PURE__ */ _react_17_0_2_react.createElement(
|
|
es_checkbox["default"].Group,
|
|
{
|
|
style: { columnGap: 12 },
|
|
options: rootDifficultyArr
|
|
}
|
|
)), /* @__PURE__ */ _react_17_0_2_react.createElement(es_form["default"].Item, { noStyle: true, name: [`0`, "diffNum"], initialValue: (_d = res.navigation[0]) == null ? void 0 : _d.difficulty_count }, /* @__PURE__ */ _react_17_0_2_react.createElement("input", { type: "hidden" })), /* @__PURE__ */ _react_17_0_2_react.createElement(es_form["default"].Item, { noStyle: true, name: [`0`, "extra"], initialValue: {
|
|
type: "0",
|
|
group_id: "0",
|
|
name: "\u6839\u76EE\u5F55"
|
|
} }, /* @__PURE__ */ _react_17_0_2_react.createElement("input", { type: "hidden" })))) : /* @__PURE__ */ _react_17_0_2_react.createElement("span", { style: { color: "#232B40" } }, `\u6839\u76EE\u5F55\uFF08${(_e = res.navigation[0]) == null ? void 0 : _e.child_count}\uFF09`),
|
|
key: "0",
|
|
name: "\u6839\u76EE\u5F55",
|
|
item_banks_count: (_f = res.navigation[0]) == null ? void 0 : _f.child_count,
|
|
disabled: ((_g = res.navigation[0]) == null ? void 0 : _g.child_count) > 0 ? false : true,
|
|
checkable: getRuleValue(ruleValue) === RuleValueKeyType.OnlyFileFolder,
|
|
icon: (e) => {
|
|
if (e.expanded) {
|
|
return /* @__PURE__ */ _react_17_0_2_react.createElement("img", { src: folder_opened_namespaceObject, className: RuleModalmodules.folderIcon });
|
|
} else {
|
|
return /* @__PURE__ */ _react_17_0_2_react.createElement("img", { src: folder_closed_namespaceObject, className: RuleModalmodules.folderIcon });
|
|
}
|
|
},
|
|
isLeaf: false,
|
|
children: getRuleValue(ruleValue) === RuleValueKeyType.OnlyFileFolder || getRuleValue(ruleValue) === RuleValueKeyType.FileFolderAndDiff ? normalChildren : [...normalChildren2, ...rootTagNodeArr]
|
|
}
|
|
]
|
|
);
|
|
} else {
|
|
const normalChildren = generateTree(res.data, ruleValue, "3");
|
|
setPublicFolderData([
|
|
{
|
|
title: getRuleValue(ruleValue) === RuleValueKeyType.FileFolderAndDiff ? /* @__PURE__ */ _react_17_0_2_react.createElement(row/* default */.Z, { justify: "space-between" }, /* @__PURE__ */ _react_17_0_2_react.createElement(col/* default */.Z, null, `\u6839\u76EE\u5F55\uFF08${(_h = res.navigation[0]) == null ? void 0 : _h.child_count}\uFF09`), /* @__PURE__ */ _react_17_0_2_react.createElement(col/* default */.Z, null, /* @__PURE__ */ _react_17_0_2_react.createElement("span", { className: "mr15", style: { color: "#666" } }, "\u96BE\u5EA6"), /* @__PURE__ */ _react_17_0_2_react.createElement(es_form["default"].Item, { noStyle: true, name: [`0`, "diffValue"] }, /* @__PURE__ */ _react_17_0_2_react.createElement(
|
|
es_checkbox["default"].Group,
|
|
{
|
|
style: { columnGap: 12 },
|
|
options: rootDifficultyArr
|
|
}
|
|
)), /* @__PURE__ */ _react_17_0_2_react.createElement(es_form["default"].Item, { noStyle: true, name: [`0`, "diffNum"], initialValue: (_i = res.navigation[0]) == null ? void 0 : _i.difficulty_count }, /* @__PURE__ */ _react_17_0_2_react.createElement("input", { type: "hidden" })), /* @__PURE__ */ _react_17_0_2_react.createElement(es_form["default"].Item, { noStyle: true, name: [`0`, "extra"], initialValue: {
|
|
type: "3",
|
|
group_id: "0",
|
|
name: "\u6839\u76EE\u5F55"
|
|
} }, /* @__PURE__ */ _react_17_0_2_react.createElement("input", { type: "hidden" })))) : /* @__PURE__ */ _react_17_0_2_react.createElement("span", { style: { color: "#232B40" } }, `\u6839\u76EE\u5F55\uFF08${(_j = res.navigation[0]) == null ? void 0 : _j.child_count}\uFF09`),
|
|
key: "0",
|
|
name: "\u6839\u76EE\u5F55",
|
|
item_banks_count: (_k = res.navigation[0]) == null ? void 0 : _k.child_count,
|
|
checkable: getRuleValue(ruleValue) === RuleValueKeyType.OnlyFileFolder,
|
|
icon: (e) => {
|
|
if (e.expanded) {
|
|
return /* @__PURE__ */ _react_17_0_2_react.createElement("img", { src: folderopen1_namespaceObject, className: RuleModalmodules.shareFolderIcon });
|
|
} else {
|
|
return /* @__PURE__ */ _react_17_0_2_react.createElement("img", { src: folder_namespaceObject, className: RuleModalmodules.shareFolderIcon });
|
|
}
|
|
},
|
|
isLeaf: false,
|
|
disabled: ((_l = res.navigation[0]) == null ? void 0 : _l.child_count) > 0 ? false : true,
|
|
children: getRuleValue(ruleValue) === RuleValueKeyType.OnlyFileFolder || getRuleValue(ruleValue) === RuleValueKeyType.FileFolderAndDiff ? normalChildren : [...normalChildren, ...rootTagNodeArr]
|
|
}
|
|
]);
|
|
}
|
|
});
|
|
(0,_react_17_0_2_react.useEffect)(() => {
|
|
if (activeKey === "1") {
|
|
getData({ type: "0", group_id: 0, item_type: currentItemType, show_children: true });
|
|
} else if (activeKey === "2") {
|
|
getData({ type: "3", except_mine: true, item_type: currentItemType, show_children: true, teach_group_id: teamvalue === "all" ? "" : teamvalue });
|
|
}
|
|
}, [ruleValue, activeKey, teamvalue]);
|
|
(0,_react_17_0_2_react.useEffect)(() => {
|
|
var _a, _b, _c, _d, _e, _f, _g, _h, _i, _j, _k, _l;
|
|
console.log("selectData-active:", selectData, defaultData, activeKey);
|
|
if (activeKey === "1") {
|
|
setMyCheckedKeys((_a = selectData == null ? void 0 : selectData.my) == null ? void 0 : _a.map((item) => item.id));
|
|
setSelectedNum(((_c = (_b = selectData == null ? void 0 : selectData.my) == null ? void 0 : _b.reduce) == null ? void 0 : _c.call(_b, (acc, cur) => acc + cur.item_bank_num, 0)) || 0);
|
|
} else if (activeKey === "2") {
|
|
setPublicCheckedKeys((_d = selectData == null ? void 0 : selectData.public) == null ? void 0 : _d.map((item) => item.id));
|
|
setSelectedNum(((_f = (_e = selectData == null ? void 0 : selectData.public) == null ? void 0 : _e.reduce) == null ? void 0 : _f.call(_e, (acc, cur) => acc + cur.item_bank_num, 0)) || 0);
|
|
}
|
|
if (getRuleValue(ruleValue) === RuleValueKeyType.All) {
|
|
if (activeKey === "1") {
|
|
setMyCheckedKeys((_g = selectData == null ? void 0 : selectData.my) == null ? void 0 : _g.map((item) => item.id));
|
|
setSelectedNum((selectData == null ? void 0 : selectData.filter((item) => !item.is_share).reduce((acc, cur) => acc + cur.item_bank_num, 0)) || 0);
|
|
(_h = selectData == null ? void 0 : selectData.filter((item) => !item.is_share)) == null ? void 0 : _h.forEach((item) => {
|
|
const prev = form.getFieldValue([`${item.group_id || 0}_${item.tag_discipline_id}`, "diffValue"]) || [];
|
|
console.log("prev:", prev);
|
|
if (!(prev == null ? void 0 : prev.includes[item.difficulty])) {
|
|
form.setFieldValue([`${item.group_id || 0}_${item.tag_discipline_id}`, "diffValue"], Array.from(/* @__PURE__ */ new Set([...prev, item.difficulty])));
|
|
}
|
|
});
|
|
} else if (activeKey === "2") {
|
|
setPublicCheckedKeys((_i = selectData == null ? void 0 : selectData.public) == null ? void 0 : _i.map((item) => item.id));
|
|
setSelectedNum((selectData == null ? void 0 : selectData.filter((item) => !!item.is_share).reduce((acc, cur) => acc + cur.item_bank_num, 0)) || 0);
|
|
(_j = selectData == null ? void 0 : selectData.filter((item) => !!item.is_share)) == null ? void 0 : _j.forEach((item) => {
|
|
const prev = form.getFieldValue([`${item.teacher_group_id || 0}_${item.tag_discipline_id}`, "diffValue"]) || [];
|
|
if (!(prev == null ? void 0 : prev.includes[item.difficulty])) {
|
|
form.setFieldValue([`${item.teacher_group_id || 0}_${item.tag_discipline_id}`, "diffValue"], Array.from(/* @__PURE__ */ new Set([...prev, item.difficulty])));
|
|
}
|
|
});
|
|
}
|
|
}
|
|
if (getRuleValue(ruleValue) === RuleValueKeyType.FileFolderAndDiff) {
|
|
form.resetFields();
|
|
setTimeout(() => {
|
|
setSelectData(selectData);
|
|
}, 300);
|
|
if (activeKey === "1") {
|
|
setSelectedNum((selectData == null ? void 0 : selectData.filter((item) => !item.is_share).reduce((acc, cur) => acc + cur.item_bank_num, 0)) || 0);
|
|
(_k = selectData == null ? void 0 : selectData.filter((item) => !item.is_share)) == null ? void 0 : _k.forEach((item) => {
|
|
const prev = form.getFieldValue([`${item.group_id}`, "diffValue"]) || [];
|
|
console.log("prev:", prev);
|
|
if (!(prev == null ? void 0 : prev.includes[item.difficulty])) {
|
|
form.setFieldValue([`${item.group_id}`, "diffValue"], Array.from(/* @__PURE__ */ new Set([...prev, item.difficulty])));
|
|
}
|
|
});
|
|
} else {
|
|
setSelectedNum((selectData == null ? void 0 : selectData.filter((item) => !!item.is_share).reduce((acc, cur) => acc + cur.item_bank_num, 0)) || 0);
|
|
(_l = selectData == null ? void 0 : selectData.filter((item) => !!item.is_share)) == null ? void 0 : _l.forEach((item) => {
|
|
const prev = form.getFieldValue([`${item.teacher_group_id}`, "diffValue"]) || [];
|
|
if (!(prev == null ? void 0 : prev.includes[item.difficulty])) {
|
|
form.setFieldValue([`${item.teacher_group_id}`, "diffValue"], Array.from(/* @__PURE__ */ new Set([...prev, item.difficulty])));
|
|
}
|
|
});
|
|
}
|
|
}
|
|
}, [activeKey]);
|
|
console.log("1111111111:", myCheckedKeys, publicCheckedKeys);
|
|
(0,_react_17_0_2_react.useEffect)(() => {
|
|
setTimeout(() => {
|
|
var _a, _b, _c, _d, _e;
|
|
switch (getRuleValue(ruleValue)) {
|
|
case RuleValueKeyType.OnlyFileFolder: {
|
|
const myData = [];
|
|
const publicData = [];
|
|
for (const item of selectData.my || []) {
|
|
myData.push(item);
|
|
}
|
|
for (const item of selectData.public || []) {
|
|
publicData.push(item);
|
|
}
|
|
setMyCheckedKeys(myData.map((item) => `${item.group_id}`));
|
|
setPublicCheckedKeys(publicData.map((item) => `${item.teacher_group_id}`));
|
|
if (activeKey === "1") {
|
|
setSelectedNum(myData.reduce((acc, cur) => acc + cur.item_bank_num, 0));
|
|
} else {
|
|
setSelectedNum(publicData.reduce((acc, cur) => acc + cur.item_bank_num, 0));
|
|
}
|
|
break;
|
|
}
|
|
case RuleValueKeyType.FileFolderAndKnowledge: {
|
|
const myData = [];
|
|
const publicData = [];
|
|
for (const item of (selectData == null ? void 0 : selectData.my) || []) {
|
|
myData.push(item);
|
|
}
|
|
for (const item of (selectData == null ? void 0 : selectData.public) || []) {
|
|
publicData.push(item);
|
|
}
|
|
setSelectedNum((_a = activeKey === "1" ? myData : publicData) == null ? void 0 : _a.reduce((acc, cur) => acc + cur.item_bank_num, 0));
|
|
setMyCheckedKeys(myData.map((item) => `${item.group_id}_${item.tag_discipline_id}`));
|
|
setPublicCheckedKeys(publicData.map((item) => `${item.teacher_group_id}_${item.tag_discipline_id}`));
|
|
break;
|
|
}
|
|
case RuleValueKeyType.All: {
|
|
if (activeKey === "1") {
|
|
setSelectedNum((selectData == null ? void 0 : selectData.filter((item) => !item.is_share).reduce((acc, cur) => acc + cur.item_bank_num, 0)) || 0);
|
|
(_b = selectData == null ? void 0 : selectData.filter((item) => !item.is_share)) == null ? void 0 : _b.forEach((item) => {
|
|
const prev = form.getFieldValue([`${item.group_id || 0}_${item.tag_discipline_id}`, "diffValue"]) || [];
|
|
console.log("prev:", prev, item.difficulty, item);
|
|
if (!(prev == null ? void 0 : prev.includes[item.difficulty])) {
|
|
form.setFieldValue([`${item.group_id || 0}_${item.tag_discipline_id}`, "diffValue"], Array.from(/* @__PURE__ */ new Set([...prev, item.difficulty])));
|
|
}
|
|
});
|
|
} else {
|
|
setSelectedNum((selectData == null ? void 0 : selectData.filter((item) => !!item.is_share).reduce((acc, cur) => acc + cur.item_bank_num, 0)) || 0);
|
|
(_c = selectData == null ? void 0 : selectData.filter((item) => !!item.is_share)) == null ? void 0 : _c.forEach((item) => {
|
|
const prev = form.getFieldValue([`${item.group_id || 0}_${item.tag_discipline_id}`, "diffValue"]) || [];
|
|
console.log("prev:", prev, item.difficulty, item);
|
|
if (!(prev == null ? void 0 : prev.includes[item.difficulty])) {
|
|
form.setFieldValue([`${item.group_id || 0}_${item.tag_discipline_id}`, "diffValue"], Array.from(/* @__PURE__ */ new Set([...prev, item.difficulty])));
|
|
}
|
|
});
|
|
}
|
|
break;
|
|
}
|
|
case RuleValueKeyType.FileFolderAndDiff: {
|
|
if (activeKey === "1") {
|
|
setSelectedNum((selectData == null ? void 0 : selectData.filter((item) => !item.is_share).reduce((acc, cur) => acc + cur.item_bank_num, 0)) || 0);
|
|
(_d = selectData == null ? void 0 : selectData.filter((item) => !item.is_share)) == null ? void 0 : _d.forEach((item) => {
|
|
const prev = form.getFieldValue([`${item.group_id}`, "diffValue"]) || [];
|
|
console.log("prev:", prev, item.difficulty);
|
|
if (!(prev == null ? void 0 : prev.includes[item.difficulty])) {
|
|
form.setFieldValue([`${item.group_id}`, "diffValue"], Array.from(/* @__PURE__ */ new Set([...prev, item.difficulty])));
|
|
}
|
|
});
|
|
} else {
|
|
setSelectedNum((selectData == null ? void 0 : selectData.filter((item) => !!item.is_share).reduce((acc, cur) => acc + cur.item_bank_num, 0)) || 0);
|
|
(_e = selectData == null ? void 0 : selectData.filter((item) => !!item.is_share)) == null ? void 0 : _e.forEach((item) => {
|
|
const prev = form.getFieldValue([`${item.group_id}`, "diffValue"]) || [];
|
|
if (!(prev == null ? void 0 : prev.includes[item.difficulty])) {
|
|
form.setFieldValue([`${item.group_id}`, "diffValue"], Array.from(/* @__PURE__ */ new Set([...prev, item.difficulty])));
|
|
}
|
|
});
|
|
}
|
|
break;
|
|
}
|
|
}
|
|
}, 800);
|
|
}, [defaultData, ruleValue, myFolderData, publicFolderData]);
|
|
const [selectedNum, setSelectedNum] = (0,_react_17_0_2_react.useState)(0);
|
|
return /* @__PURE__ */ _react_17_0_2_react.createElement(
|
|
es_form["default"],
|
|
{
|
|
form,
|
|
onValuesChange: (c, v) => FileFolder_async(void 0, null, function* () {
|
|
var _a, _b, _c, _d;
|
|
console.log("onValuesChange:", v, c);
|
|
let count = 0;
|
|
if (getRuleValue(ruleValue) === RuleValueKeyType.FileFolderAndDiff) {
|
|
const values = yield form.getFieldValue();
|
|
const valuesd = [];
|
|
const arr = [];
|
|
for (const id of Object.keys(values)) {
|
|
if (!!((_b = (_a = values[id]) == null ? void 0 : _a.diffValue) == null ? void 0 : _b.length) && id !== "null" && id !== null) {
|
|
const obj = values[id];
|
|
valuesd.push(FileFolder_spreadValues({
|
|
id
|
|
}, obj));
|
|
}
|
|
}
|
|
const map = { 1: "\u7B80\u5355", 2: "\u9002\u4E2D", 3: "\u56F0\u96BE" };
|
|
valuesd.map((item) => {
|
|
var _a2, _b2, _c2, _d2, _e;
|
|
if (item.id == 0) {
|
|
item.diffNum = activeKey === "1" ? (_b2 = (_a2 = myDatas == null ? void 0 : myDatas.navigation) == null ? void 0 : _a2[0]) == null ? void 0 : _b2.difficulty_count : (_d2 = (_c2 = publicDatas == null ? void 0 : publicDatas.navigation) == null ? void 0 : _c2[0]) == null ? void 0 : _d2.difficulty_count;
|
|
}
|
|
(_e = item == null ? void 0 : item.diffValue) == null ? void 0 : _e.map((i) => {
|
|
var _a3, _b3, _c3, _d3, _e2;
|
|
const newItem = {
|
|
group_name: ((_a3 = item.extra) == null ? void 0 : _a3.name) || "",
|
|
teacher_group_name: "",
|
|
id: `${item.id}_${i}`,
|
|
group_id: item.id,
|
|
difficulty: i,
|
|
item_bank_num: (_d3 = (_c3 = (_b3 = item.diffNum) == null ? void 0 : _b3.filter((d) => d.name === map[i])) == null ? void 0 : _c3[0]) == null ? void 0 : _d3.value
|
|
};
|
|
if (activeKey === "2") {
|
|
newItem.is_share = true;
|
|
newItem.teacher_group_id = item.id;
|
|
newItem.teacher_group_name = (_e2 = item.extra) == null ? void 0 : _e2.name;
|
|
}
|
|
arr.push(newItem);
|
|
});
|
|
});
|
|
count = arr.reduce((acc, cur) => acc + cur.item_bank_num, 0);
|
|
setSelectData([...arr, ...selectData == null ? void 0 : selectData.filter((item) => activeKey === "1" ? item.is_share : !item.is_share)]);
|
|
} else if (getRuleValue(ruleValue) === RuleValueKeyType.All) {
|
|
const arr = [];
|
|
for (const id of Object.keys(v)) {
|
|
const { diffNum = [], diffValue = [], extra = {} } = v[id];
|
|
console.log("---", extra);
|
|
const [group_id, tag_discipline_id] = id.split("_");
|
|
let extraitem = (_d = (_c = extra.tag_disciplines) == null ? void 0 : _c.filter((item) => parseInt(item.id) === parseInt(tag_discipline_id))) == null ? void 0 : _d[0];
|
|
diffValue.forEach((diffItemValue) => {
|
|
var _a2;
|
|
const map = { 1: "\u7B80\u5355", 2: "\u9002\u4E2D", 3: "\u56F0\u96BE" };
|
|
const currentDiffNum = (_a2 = diffNum == null ? void 0 : diffNum.find((i) => i.name === map[diffItemValue])) == null ? void 0 : _a2.value;
|
|
const newItem = {
|
|
group_name: "",
|
|
teacher_group_name: "",
|
|
tag_discipline_name: (extraitem == null ? void 0 : extraitem.name) || extra.tag_discipline_name,
|
|
id: `${id}_${diffItemValue}`,
|
|
group_id,
|
|
is_share: (extraitem == null ? void 0 : extraitem.is_share) || (extra == null ? void 0 : extra.type) === "3" ? true : false,
|
|
tag_discipline_id,
|
|
difficulty: diffItemValue,
|
|
item_bank_num: currentDiffNum
|
|
};
|
|
count += currentDiffNum;
|
|
if (extra.type === "0") {
|
|
newItem.group_name = extra.name;
|
|
} else {
|
|
newItem.teacher_group_name = extra.name;
|
|
}
|
|
if (activeKey === "2") {
|
|
newItem.is_share = true;
|
|
newItem.teacher_group_id = extra.id || 0;
|
|
newItem.teacher_group_name = extra.name;
|
|
}
|
|
if (currentDiffNum > 0) {
|
|
arr.push(newItem);
|
|
}
|
|
});
|
|
}
|
|
setSelectData([...arr, ...selectData == null ? void 0 : selectData.filter((item) => activeKey === "1" ? item.is_share : !item.is_share)]);
|
|
}
|
|
setSelectedNum(count);
|
|
})
|
|
},
|
|
/* @__PURE__ */ _react_17_0_2_react.createElement(
|
|
tabs["default"],
|
|
{
|
|
destroyInactiveTabPane: true,
|
|
activeKey,
|
|
onChange: (key) => setActiveKey(key),
|
|
style: { minHeight: 260 },
|
|
tabBarExtraContent: {
|
|
right: activeKey === "2" && (teamlist == null ? void 0 : teamlist.length) > 0 && /* @__PURE__ */ _react_17_0_2_react.createElement(es_select["default"], { onChange: (value) => {
|
|
setteamvalue(value);
|
|
}, value: teamvalue, style: { width: 120 } }, /* @__PURE__ */ _react_17_0_2_react.createElement(es_select["default"].Option, { key: "all", value: "all" }, "\u5168\u90E8"), teamlist == null ? void 0 : teamlist.map((item) => /* @__PURE__ */ _react_17_0_2_react.createElement(es_select["default"].Option, { key: item == null ? void 0 : item.group_id, value: item == null ? void 0 : item.group_id }, item == null ? void 0 : item.name)))
|
|
},
|
|
items: [
|
|
{
|
|
key: "1",
|
|
label: "\u6211\u521B\u5EFA\u7684",
|
|
children: (myFolderData == null ? void 0 : myFolderData.length) === 0 ? /* @__PURE__ */ _react_17_0_2_react.createElement(spin/* default */.Z, { spinning: myLoading }, /* @__PURE__ */ _react_17_0_2_react.createElement(NoData/* default */.Z, { ButtonTwo: /* @__PURE__ */ _react_17_0_2_react.createElement("a", { target: "_blank", href: "/problemset" }, "\u524D\u5F80\u9898\u5E93\uFF0C\u65B0\u589E\u66F4\u591A\u8BD5\u9898", ">") })) : /* @__PURE__ */ _react_17_0_2_react.createElement("div", { className: RuleModalmodules.folderAreaWrapper }, /* @__PURE__ */ _react_17_0_2_react.createElement(row/* default */.Z, { justify: "space-between", align: "middle", className: RuleModalmodules.folderAreaHeader }, /* @__PURE__ */ _react_17_0_2_react.createElement("span", null, "\u6587\u4EF6\u5939"), /* @__PURE__ */ _react_17_0_2_react.createElement("span", { className: "mr20" }, "\u5DF2\u9009", /* @__PURE__ */ _react_17_0_2_react.createElement("span", { style: { color: "#3061D0" } }, " ", selectedNum, " "), "\u9898")), /* @__PURE__ */ _react_17_0_2_react.createElement(spin/* default */.Z, { spinning: myLoading }, /* @__PURE__ */ _react_17_0_2_react.createElement("div", { style: { minHeight: 200 } }, myFolderData.length > 0 && /* @__PURE__ */ _react_17_0_2_react.createElement(
|
|
tree["default"],
|
|
{
|
|
checkable: true,
|
|
className: RuleModalmodules.folderWrapper,
|
|
rootStyle: { paddingLeft: 15, paddingRight: 0, paddingTop: 10 },
|
|
selectable: false,
|
|
onCheck: (checkedKey, info) => onCheck(checkedKey, info, "0"),
|
|
checkedKeys: myCheckedKeys,
|
|
checkStrictly: true,
|
|
treeData: myFolderData,
|
|
showIcon: true,
|
|
blockNode: true,
|
|
defaultExpandAll: true
|
|
}
|
|
))))
|
|
},
|
|
{
|
|
key: "2",
|
|
label: "\u56E2\u961F\u5171\u4EAB",
|
|
children: (publicFolderData == null ? void 0 : publicFolderData.length) === 0 ? /* @__PURE__ */ _react_17_0_2_react.createElement(spin/* default */.Z, { spinning: publicLoading }, /* @__PURE__ */ _react_17_0_2_react.createElement(NoData/* default */.Z, { ButtonTwo: /* @__PURE__ */ _react_17_0_2_react.createElement("a", { target: "_blank", href: "/problemset" }, "\u524D\u5F80\u9898\u5E93\uFF0C\u65B0\u589E\u66F4\u591A\u8BD5\u9898", ">") })) : /* @__PURE__ */ _react_17_0_2_react.createElement("div", { className: RuleModalmodules.folderAreaWrapper }, /* @__PURE__ */ _react_17_0_2_react.createElement(row/* default */.Z, { justify: "space-between", align: "middle", className: RuleModalmodules.folderAreaHeader }, /* @__PURE__ */ _react_17_0_2_react.createElement("span", null, "\u6587\u4EF6\u5939"), /* @__PURE__ */ _react_17_0_2_react.createElement("span", { className: "mr20" }, "\u5DF2\u9009", /* @__PURE__ */ _react_17_0_2_react.createElement("span", { style: { color: "#3061D0" } }, " ", selectedNum || 0, " "), "\u9898")), /* @__PURE__ */ _react_17_0_2_react.createElement(spin/* default */.Z, { spinning: publicLoading }, /* @__PURE__ */ _react_17_0_2_react.createElement("div", { style: { minHeight: 200 } }, (publicFolderData == null ? void 0 : publicFolderData.length) > 0 && /* @__PURE__ */ _react_17_0_2_react.createElement(
|
|
tree["default"],
|
|
{
|
|
checkable: true,
|
|
className: RuleModalmodules.folderWrapper,
|
|
selectable: false,
|
|
rootStyle: { paddingLeft: 15, paddingRight: 0, paddingTop: 10 },
|
|
onCheck: (checkedKey, info) => onCheck(checkedKey, info, "3"),
|
|
checkedKeys: publicCheckedKeys,
|
|
checkStrictly: true,
|
|
treeData: publicFolderData,
|
|
showIcon: true,
|
|
blockNode: true,
|
|
defaultExpandAll: true
|
|
}
|
|
))))
|
|
}
|
|
]
|
|
}
|
|
)
|
|
);
|
|
};
|
|
/* harmony default export */ var RuleModal_FileFolder = (FileFolder);
|
|
|
|
// EXTERNAL MODULE: ./src/models/problemset/util.ts
|
|
var util = __webpack_require__(87884);
|
|
// EXTERNAL MODULE: ./src/utils/hooks/useCustomRequest.ts
|
|
var useCustomRequest = __webpack_require__(19434);
|
|
;// CONCATENATED MODULE: ./src/pages/Paperlibrary/Random/Edit/QuestionInfo/RuleModal/Knowledge.tsx
|
|
var Knowledge_defProp = Object.defineProperty;
|
|
var Knowledge_defProps = Object.defineProperties;
|
|
var Knowledge_getOwnPropDescs = Object.getOwnPropertyDescriptors;
|
|
var Knowledge_getOwnPropSymbols = Object.getOwnPropertySymbols;
|
|
var Knowledge_hasOwnProp = Object.prototype.hasOwnProperty;
|
|
var Knowledge_propIsEnum = Object.prototype.propertyIsEnumerable;
|
|
var Knowledge_defNormalProp = (obj, key, value) => key in obj ? Knowledge_defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
|
|
var Knowledge_spreadValues = (a, b) => {
|
|
for (var prop in b || (b = {}))
|
|
if (Knowledge_hasOwnProp.call(b, prop))
|
|
Knowledge_defNormalProp(a, prop, b[prop]);
|
|
if (Knowledge_getOwnPropSymbols)
|
|
for (var prop of Knowledge_getOwnPropSymbols(b)) {
|
|
if (Knowledge_propIsEnum.call(b, prop))
|
|
Knowledge_defNormalProp(a, prop, b[prop]);
|
|
}
|
|
return a;
|
|
};
|
|
var Knowledge_spreadProps = (a, b) => Knowledge_defProps(a, Knowledge_getOwnPropDescs(b));
|
|
var Knowledge_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 Knowledge_diffMap = {
|
|
"\u7B80\u5355": 1,
|
|
"\u9002\u4E2D": 2,
|
|
"\u56F0\u96BE": 3
|
|
};
|
|
const Knowledge = ({ ruleValue, setSelectData, currentItemType, defaultData, isFirst }) => {
|
|
const [courseOptions, setCourseOptions] = (0,_react_17_0_2_react.useState)([]);
|
|
const [params, isLoading, getData, disciplineRes] = (0,useCustomRequest/* useCustomRequest */.U)(getDisciplines, {
|
|
source: "question",
|
|
page: 1,
|
|
per_page: 10,
|
|
group_id: 0,
|
|
keyword: "",
|
|
group_type: 0,
|
|
clazz: "ItemBanksGroup",
|
|
sub_discipline_id: void 0,
|
|
item_type: currentItemType,
|
|
show_children: true
|
|
});
|
|
(0,_react_17_0_2_react.useEffect)(() => {
|
|
(() => Knowledge_async(void 0, null, function* () {
|
|
const res = yield getData({}, true);
|
|
setCourseOptions((0,util/* formatCourseOptions */.L)(res.disciplines));
|
|
}))();
|
|
}, []);
|
|
console.log(defaultData);
|
|
(0,_react_17_0_2_react.useEffect)(() => {
|
|
if (!isFirst) {
|
|
return;
|
|
}
|
|
switch (getRuleValue(ruleValue)) {
|
|
case RuleValueKeyType.OnlyKnowledge: {
|
|
setSelectedKeys(defaultData.map((item) => item.tag_discipline_id));
|
|
break;
|
|
}
|
|
case RuleValueKeyType.KnowledgeAndDiff: {
|
|
const map = /* @__PURE__ */ new Map();
|
|
defaultData.forEach((item) => {
|
|
if (!item) {
|
|
return;
|
|
}
|
|
map.has(item.tag_discipline_id) ? map.set(item.tag_discipline_id, [...map.get(item.tag_discipline_id), item.difficulty]) : map.set(item.tag_discipline_id, [item.difficulty]);
|
|
});
|
|
for (const [key, value] of map.entries()) {
|
|
form.setFieldValue([key, "diff"], value);
|
|
}
|
|
break;
|
|
}
|
|
}
|
|
}, [defaultData, ruleValue, isFirst]);
|
|
const [form] = es_form["default"].useForm();
|
|
const dataSource = (0,_react_17_0_2_react.useMemo)(() => {
|
|
const arr = [];
|
|
let discipline = "", subDiscipline = "";
|
|
const formValue = {};
|
|
for (const item of (disciplineRes == null ? void 0 : disciplineRes.disciplines) || []) {
|
|
discipline = item.name;
|
|
for (const subItem of item.sub_disciplines) {
|
|
subDiscipline = subItem.name;
|
|
for (const tagItem of subItem.tag_disciplines) {
|
|
const rowItem = {
|
|
sub_discipline_name: `${discipline}&${subDiscipline}`,
|
|
sub_discipline_id: subItem.id,
|
|
tag_discipline_name: tagItem.name,
|
|
id: tagItem.id,
|
|
item_bank_num: tagItem.total_count,
|
|
difficulty_count: tagItem.difficulty_count,
|
|
tag_discipline_id: tagItem.id
|
|
// defaultChecks: defaultData?.filter(items => items._id == tagItem.id)?.[0]?.difficulty_count?.map(items => items.value),
|
|
// defaultChecks2: defaultData?.filter(items => items._id == tagItem.id)
|
|
};
|
|
arr.push(rowItem);
|
|
}
|
|
}
|
|
}
|
|
return arr;
|
|
}, [disciplineRes, defaultData]);
|
|
const columns = [
|
|
{
|
|
title: "\u77E5\u8BC6\u70B9",
|
|
dataIndex: "tag_discipline_name",
|
|
show: true,
|
|
render: (text, record) => {
|
|
const { item_bank_num } = record;
|
|
return /* @__PURE__ */ _react_17_0_2_react.createElement("div", null, text, `(${item_bank_num})`);
|
|
}
|
|
},
|
|
{
|
|
title: "\u65B9\u5411&\u8BFE\u7A0B",
|
|
dataIndex: "sub_discipline_name",
|
|
ellipsis: true,
|
|
show: true
|
|
},
|
|
{
|
|
title: "\u96BE\u5EA6",
|
|
width: "35%",
|
|
show: ruleValue.includes(RuleValueType.Difficulty),
|
|
render: (t, record) => {
|
|
const { id, difficulty_count, total_count, sub_discipline_name, tag_discipline_name } = record;
|
|
return /* @__PURE__ */ _react_17_0_2_react.createElement(_react_17_0_2_react.Fragment, null, /* @__PURE__ */ _react_17_0_2_react.createElement(es_form["default"].Item, { name: [id, "diff"], noStyle: true }, /* @__PURE__ */ _react_17_0_2_react.createElement(
|
|
es_checkbox["default"].Group,
|
|
{
|
|
style: { columnGap: 12 },
|
|
options: difficulty_count.map((diff) => ({ label: diff.name, value: Knowledge_diffMap[diff.name] }))
|
|
}
|
|
)), /* @__PURE__ */ _react_17_0_2_react.createElement(es_form["default"].Item, { name: [id, "extra"], initialValue: {
|
|
difficulty_count,
|
|
total_count,
|
|
sub_discipline_name,
|
|
tag_discipline_name
|
|
}, noStyle: true }, /* @__PURE__ */ _react_17_0_2_react.createElement("input", { type: "hidden" })));
|
|
}
|
|
}
|
|
].filter((item) => item.show);
|
|
const [selectedKeys, setSelectedKeys] = (0,_react_17_0_2_react.useState)([]);
|
|
const diffKeyMap = (0,_react_17_0_2_react.useRef)(/* @__PURE__ */ new Map());
|
|
return /* @__PURE__ */ _react_17_0_2_react.createElement("div", { style: { marginTop: 12 } }, /* @__PURE__ */ _react_17_0_2_react.createElement(row/* default */.Z, { className: "mb20", align: "middle", gutter: 20 }, /* @__PURE__ */ _react_17_0_2_react.createElement(col/* default */.Z, null, /* @__PURE__ */ _react_17_0_2_react.createElement(
|
|
cascader/* default */.Z,
|
|
{
|
|
placeholder: "\u8BF7\u9009\u62E9\u65B9\u5411&\u8BFE\u7A0B",
|
|
size: "large",
|
|
style: { width: 240 },
|
|
options: courseOptions,
|
|
onChange: (value) => {
|
|
getData({ sub_discipline_id: value == null ? void 0 : value[1] });
|
|
}
|
|
}
|
|
)), /* @__PURE__ */ _react_17_0_2_react.createElement(col/* default */.Z, null, /* @__PURE__ */ _react_17_0_2_react.createElement(
|
|
ui_customization/* CustomInput */.t7,
|
|
{
|
|
style: { width: 300 },
|
|
placeholder: "\u8BF7\u8F93\u5165\u77E5\u8BC6\u70B9\u540D\u79F0\u8FDB\u884C\u641C\u7D22",
|
|
value: params.keyword,
|
|
onChange: (value) => getData({ keyword: value })
|
|
}
|
|
))), /* @__PURE__ */ _react_17_0_2_react.createElement(
|
|
es_form["default"],
|
|
{
|
|
form,
|
|
onValuesChange: (changeedValues, newValues) => {
|
|
var _a;
|
|
console.log(newValues);
|
|
diffKeyMap.current.clear();
|
|
for (const id of Object.keys(newValues)) {
|
|
const map = { 1: "\u7B80\u5355", 2: "\u9002\u4E2D", 3: "\u56F0\u96BE" };
|
|
const item = newValues[id];
|
|
const { difficulty_count, total_count } = item.extra || {};
|
|
(_a = item == null ? void 0 : item.diff) == null ? void 0 : _a.forEach((diff) => {
|
|
var _a2;
|
|
const diffNum = (_a2 = difficulty_count == null ? void 0 : difficulty_count.find((x) => x.name === map[diff])) == null ? void 0 : _a2.value;
|
|
const newItem = Knowledge_spreadProps(Knowledge_spreadValues({}, item.extra), { id: `${id}_${diff}`, difficulty: diff, item_bank_num: diffNum, tag_discipline_id: id });
|
|
if (diffNum > 0) {
|
|
diffKeyMap.current.set(`${id}_${diff}`, newItem);
|
|
}
|
|
});
|
|
}
|
|
setSelectData([...diffKeyMap.current.values()]);
|
|
}
|
|
},
|
|
(dataSource == null ? void 0 : dataSource.length) === 0 ? /* @__PURE__ */ _react_17_0_2_react.createElement(NoData/* default */.Z, { ButtonTwo: /* @__PURE__ */ _react_17_0_2_react.createElement("a", { target: "_blank", href: "/problemset" }, "\u524D\u5F80\u9898\u5E93\uFF0C\u65B0\u589E\u66F4\u591A\u8BD5\u9898", ">") }) : /* @__PURE__ */ _react_17_0_2_react.createElement(
|
|
table["default"],
|
|
{
|
|
rowSelection: getRuleValue(ruleValue) === RuleValueKeyType.OnlyKnowledge ? {
|
|
preserveSelectedRowKeys: true,
|
|
type: "checkbox",
|
|
onChange(selectedRowKeys, selectedRows) {
|
|
console.log("table-selectedRowKeys:", selectedRowKeys, selectedRows);
|
|
setSelectedKeys(selectedRowKeys);
|
|
setSelectData(selectedRows);
|
|
},
|
|
getCheckboxProps: (record) => {
|
|
return { disabled: record.item_bank_num === 0 };
|
|
},
|
|
selectedRowKeys: selectedKeys
|
|
} : void 0,
|
|
columns,
|
|
dataSource,
|
|
loading: isLoading,
|
|
scroll: { y: 480 },
|
|
rowKey: "id",
|
|
pagination: false
|
|
}
|
|
)
|
|
));
|
|
};
|
|
/* harmony default export */ var RuleModal_Knowledge = (Knowledge);
|
|
|
|
;// CONCATENATED MODULE: ./src/pages/Paperlibrary/Random/Edit/QuestionInfo/RuleModal/ruleInfo.tsx
|
|
var ruleInfo_defProp = Object.defineProperty;
|
|
var ruleInfo_defProps = Object.defineProperties;
|
|
var ruleInfo_getOwnPropDescs = Object.getOwnPropertyDescriptors;
|
|
var ruleInfo_getOwnPropSymbols = Object.getOwnPropertySymbols;
|
|
var ruleInfo_hasOwnProp = Object.prototype.hasOwnProperty;
|
|
var ruleInfo_propIsEnum = Object.prototype.propertyIsEnumerable;
|
|
var ruleInfo_defNormalProp = (obj, key, value) => key in obj ? ruleInfo_defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
|
|
var ruleInfo_spreadValues = (a, b) => {
|
|
for (var prop in b || (b = {}))
|
|
if (ruleInfo_hasOwnProp.call(b, prop))
|
|
ruleInfo_defNormalProp(a, prop, b[prop]);
|
|
if (ruleInfo_getOwnPropSymbols)
|
|
for (var prop of ruleInfo_getOwnPropSymbols(b)) {
|
|
if (ruleInfo_propIsEnum.call(b, prop))
|
|
ruleInfo_defNormalProp(a, prop, b[prop]);
|
|
}
|
|
return a;
|
|
};
|
|
var ruleInfo_spreadProps = (a, b) => ruleInfo_defProps(a, ruleInfo_getOwnPropDescs(b));
|
|
var ruleInfo_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 ruleInfo_diffMap = {
|
|
"\u7B80\u5355": 1,
|
|
"\u9002\u4E2D": 2,
|
|
"\u56F0\u96BE": 3
|
|
};
|
|
const RuleModal = ({ open, onCancel, setVisibleModalType, currentItemType }) => {
|
|
var _a;
|
|
const { data, dispatch } = (0,_react_17_0_2_react.useContext)(DataContext);
|
|
const [ruleValue, setRuleValue] = (0,_react_17_0_2_react.useState)([]);
|
|
const [selectData, setSelectData] = (0,_react_17_0_2_react.useState)();
|
|
const questionInfo = (_a = data == null ? void 0 : data.item_types) == null ? void 0 : _a.find((item) => item.item_type === currentItemType);
|
|
(0,_react_17_0_2_react.useEffect)(() => {
|
|
var _a2, _b, _c;
|
|
if (open) {
|
|
const currentItem = (_a2 = data == null ? void 0 : data.item_types) == null ? void 0 : _a2.find((item) => item.item_type === currentItemType);
|
|
if ((currentItem == null ? void 0 : currentItem.random_rule_type) !== RuleValueKeyType.Shixun) {
|
|
const rules = RuleValueMap[currentItem == null ? void 0 : currentItem.random_rule_type] || [];
|
|
setRuleValue(rules);
|
|
const defaultSelectData = (_c = (_b = data == null ? void 0 : data.item_types) == null ? void 0 : _b.find((item) => item.item_type === currentItemType)) == null ? void 0 : _c.contents;
|
|
console.log("----xxx", getRuleValue(rules));
|
|
switch (getRuleValue(rules)) {
|
|
case RuleValueKeyType.OnlyDifficulty: {
|
|
setDefaultData(defaultSelectData.map((item) => item.difficulty));
|
|
break;
|
|
}
|
|
case RuleValueKeyType.OnlyFileFolder: {
|
|
setDefaultData({
|
|
my: defaultSelectData == null ? void 0 : defaultSelectData.filter((item) => parseInt(item.teacher_group_id) !== "NaN" && !item.teacher_group_id && item.teacher_group_id !== 0),
|
|
public: defaultSelectData == null ? void 0 : defaultSelectData.filter((item) => parseInt(item.teacher_group_id) >= 0)
|
|
});
|
|
setSelectData({
|
|
my: defaultSelectData == null ? void 0 : defaultSelectData.filter((item) => parseInt(item.teacher_group_id) !== "NaN" && !item.teacher_group_id && item.teacher_group_id !== 0),
|
|
public: defaultSelectData == null ? void 0 : defaultSelectData.filter((item) => parseInt(item.teacher_group_id) >= 0)
|
|
});
|
|
break;
|
|
}
|
|
case RuleValueKeyType.FileFolderAndKnowledge: {
|
|
setDefaultData({
|
|
my: defaultSelectData == null ? void 0 : defaultSelectData.filter((item) => parseInt(item.teacher_group_id) !== "NaN" && !item.teacher_group_id && item.teacher_group_id !== 0),
|
|
public: defaultSelectData == null ? void 0 : defaultSelectData.filter((item) => parseInt(item.teacher_group_id) >= 0)
|
|
});
|
|
setSelectData({
|
|
my: defaultSelectData == null ? void 0 : defaultSelectData.filter((item) => parseInt(item.teacher_group_id) !== "NaN" && !item.teacher_group_id && item.teacher_group_id !== 0),
|
|
public: defaultSelectData == null ? void 0 : defaultSelectData.filter((item) => parseInt(item.teacher_group_id) >= 0)
|
|
});
|
|
break;
|
|
}
|
|
case RuleValueKeyType.FileFolderAndDiff: {
|
|
setDefaultData(defaultSelectData);
|
|
setSelectData(defaultSelectData);
|
|
break;
|
|
}
|
|
case RuleValueKeyType.All: {
|
|
setDefaultData(defaultSelectData);
|
|
setSelectData(defaultSelectData);
|
|
break;
|
|
}
|
|
default:
|
|
setDefaultData(defaultSelectData);
|
|
}
|
|
}
|
|
}
|
|
}, [open]);
|
|
const [totalNumOfDiff, setTotalNumOfDiff] = (0,_react_17_0_2_react.useState)([]);
|
|
(0,_react_17_0_2_react.useEffect)(() => {
|
|
if (open) {
|
|
getQuestionNum({ item_type: currentItemType }).then((res) => {
|
|
if (res.status === 0) {
|
|
setTotalNumOfDiff(res.data);
|
|
}
|
|
});
|
|
}
|
|
}, [open]);
|
|
(0,_react_17_0_2_react.useEffect)(() => {
|
|
console.log("selectData", selectData);
|
|
}, [selectData]);
|
|
const [defaultData, setDefaultData] = (0,_react_17_0_2_react.useState)();
|
|
const [isFirst, setIsFirst] = (0,_react_17_0_2_react.useState)(true);
|
|
console.log("isFirst:", isFirst);
|
|
const changeRule = (checkedValue) => {
|
|
setRuleValue(checkedValue);
|
|
setSelectData([]);
|
|
setDefaultData([]);
|
|
setIsFirst(false);
|
|
};
|
|
return /* @__PURE__ */ _react_17_0_2_react.createElement(
|
|
modal["default"],
|
|
{
|
|
title: "\u8BBE\u7F6E\u62BD\u9898\u89C4\u5219",
|
|
width: 948,
|
|
closable: true,
|
|
centered: true,
|
|
open,
|
|
onCancel,
|
|
destroyOnClose: true,
|
|
onOk: () => ruleInfo_async(void 0, null, function* () {
|
|
var _a2, _b, _c, _d, _e, _f, _g;
|
|
if (selectData === void 0) {
|
|
setVisibleModalType("");
|
|
return;
|
|
}
|
|
if (Object.prototype.toString.call(selectData) === "[object Object]") {
|
|
if (!((_a2 = selectData.my) == null ? void 0 : _a2.length) && !((_b = selectData.public) == null ? void 0 : _b.length)) {
|
|
message/* default */.ZP.warning("\u8BD5\u9898\u603B\u6570=0\uFF0C\u8BF7\u5148\u8BBE\u7F6E\u62BD\u9898\u89C4\u5219");
|
|
return;
|
|
}
|
|
}
|
|
if (!Object.keys(selectData).length && !(selectData == null ? void 0 : selectData.length)) {
|
|
message/* default */.ZP.warning("\u8BD5\u9898\u603B\u6570=0\uFF0C\u8BF7\u5148\u8BBE\u7F6E\u62BD\u9898\u89C4\u5219");
|
|
return;
|
|
}
|
|
const currentRule = getRuleValue(ruleValue);
|
|
switch (currentRule) {
|
|
case RuleValueKeyType.OnlyFileFolder: {
|
|
dispatch({
|
|
type: "editRule",
|
|
payload: {
|
|
itemType: currentItemType,
|
|
tableData: [...selectData.my || [], ...selectData.public || []],
|
|
randomRuleType: currentRule
|
|
}
|
|
});
|
|
break;
|
|
}
|
|
case RuleValueKeyType.OnlyDifficulty: {
|
|
const currentItem = (_d = (_c = data == null ? void 0 : data.item_types) == null ? void 0 : _c.find((item) => item.item_type === currentItemType)) == null ? void 0 : _d.contents;
|
|
let diffvalue = [{}, { value: (_e = totalNumOfDiff.find((item) => item.name === "\u7B80\u5355")) == null ? void 0 : _e.value }, { value: (_f = totalNumOfDiff.find((item) => item.name === "\u9002\u4E2D")) == null ? void 0 : _f.value }, { value: (_g = totalNumOfDiff.find((item) => item.name === "\u56F0\u96BE")) == null ? void 0 : _g.value }];
|
|
dispatch({
|
|
type: "editRule",
|
|
payload: {
|
|
itemType: currentItemType,
|
|
tableData: selectData.map((diff, index) => {
|
|
var _a3, _b2, _c2, _d2;
|
|
return { difficulty: diff, id: index, quanlity: ((_b2 = (_a3 = currentItem == null ? void 0 : currentItem.filter((item) => item.id === index)) == null ? void 0 : _a3[0]) == null ? void 0 : _b2["quanlity"]) || 1, item_bank_num: (totalNumOfDiff == null ? void 0 : totalNumOfDiff.length) === 1 ? (_c2 = totalNumOfDiff[0]) == null ? void 0 : _c2.value : (_d2 = diffvalue == null ? void 0 : diffvalue[diff]) == null ? void 0 : _d2.value };
|
|
}),
|
|
randomRuleType: currentRule
|
|
}
|
|
});
|
|
break;
|
|
}
|
|
case RuleValueKeyType.OnlyKnowledge: {
|
|
dispatch({
|
|
type: "editRule",
|
|
payload: {
|
|
itemType: currentItemType,
|
|
tableData: selectData.map((item) => ruleInfo_spreadProps(ruleInfo_spreadValues({}, item), { quanlity: item.quanlity || 1 })),
|
|
randomRuleType: currentRule
|
|
}
|
|
});
|
|
break;
|
|
}
|
|
case RuleValueKeyType.KnowledgeAndDiff: {
|
|
dispatch({
|
|
type: "editRule",
|
|
payload: {
|
|
itemType: currentItemType,
|
|
tableData: selectData.map((item) => ruleInfo_spreadProps(ruleInfo_spreadValues({}, item), { quanlity: item.quanlity || 1 })),
|
|
randomRuleType: currentRule
|
|
}
|
|
});
|
|
break;
|
|
}
|
|
case RuleValueKeyType.FileFolderAndDiff: {
|
|
dispatch({
|
|
type: "editRule",
|
|
payload: {
|
|
itemType: currentItemType,
|
|
tableData: selectData.map((item) => ruleInfo_spreadProps(ruleInfo_spreadValues({}, item), { quanlity: item.quanlity || 1 })),
|
|
randomRuleType: currentRule
|
|
}
|
|
});
|
|
break;
|
|
}
|
|
case RuleValueKeyType.FileFolderAndKnowledge: {
|
|
dispatch({
|
|
type: "editRule",
|
|
payload: {
|
|
itemType: currentItemType,
|
|
tableData: [...selectData.my || [], ...selectData.public || []],
|
|
randomRuleType: currentRule
|
|
}
|
|
});
|
|
break;
|
|
}
|
|
case RuleValueKeyType.All: {
|
|
dispatch({
|
|
type: "editRule",
|
|
payload: {
|
|
itemType: currentItemType,
|
|
tableData: selectData.map((item) => ruleInfo_spreadProps(ruleInfo_spreadValues({}, item), { quanlity: item.quanlity || 1 })),
|
|
randomRuleType: currentRule
|
|
}
|
|
});
|
|
break;
|
|
}
|
|
}
|
|
setVisibleModalType("");
|
|
})
|
|
},
|
|
/* @__PURE__ */ _react_17_0_2_react.createElement(
|
|
es_checkbox["default"].Group,
|
|
{
|
|
className: `${RuleModalmodules.ruleCheckBox}`,
|
|
style: { marginBottom: 8 },
|
|
value: ruleValue,
|
|
onChange: (checkedValue) => {
|
|
var _a2;
|
|
if (!!(ruleValue == null ? void 0 : ruleValue.length) && ((_a2 = questionInfo == null ? void 0 : questionInfo.contents) == null ? void 0 : _a2.length) > 0) {
|
|
modal["default"].confirm({
|
|
title: "\u63D0\u793A",
|
|
content: "\u5207\u6362\u89C4\u5219\u540E\uFF0C\u4E4B\u524D\u7684\u62BD\u9898\u914D\u7F6E\u5C06\u88AB\u6E05\u7A7A\uFF01",
|
|
okText: "\u7ACB\u5373\u5207\u6362",
|
|
cancelText: "\u6682\u4E0D\u5207\u6362",
|
|
onOk: () => changeRule(checkedValue)
|
|
});
|
|
} else {
|
|
changeRule(checkedValue);
|
|
}
|
|
},
|
|
options: [
|
|
{ label: "\u6307\u5B9A\u6587\u4EF6\u5939\u62BD\u9898", value: RuleValueType.FileFolder },
|
|
{ label: "\u6307\u5B9A\u96BE\u5EA6\u62BD\u9898", value: RuleValueType.Difficulty },
|
|
{ label: "\u6307\u5B9A\u77E5\u8BC6\u70B9\u62BD\u9898", value: RuleValueType.Knowledge }
|
|
]
|
|
}
|
|
),
|
|
ruleValue.includes(RuleValueType.FileFolder) ? /* @__PURE__ */ _react_17_0_2_react.createElement(RuleModal_FileFolder, { defaultData, selectData, ruleValue, setSelectData, currentItemType }) : ruleValue.includes(RuleValueType.Knowledge) ? /* @__PURE__ */ _react_17_0_2_react.createElement(RuleModal_Knowledge, { defaultData, isFirst, ruleValue, setSelectData, currentItemType }) : ruleValue.includes(RuleValueType.Difficulty) ? /* @__PURE__ */ _react_17_0_2_react.createElement("div", { style: { marginTop: 12 } }, /* @__PURE__ */ _react_17_0_2_react.createElement("span", { className: "mr20", style: { color: "#666" } }, "\u96BE\u5EA6"), /* @__PURE__ */ _react_17_0_2_react.createElement(
|
|
es_checkbox["default"].Group,
|
|
{
|
|
style: { columnGap: 12 },
|
|
options: totalNumOfDiff.map((diff) => ({ label: diff.name, value: ruleInfo_diffMap[diff.name] })),
|
|
value: selectData || defaultData,
|
|
onChange: (checkedValue) => setSelectData(checkedValue)
|
|
}
|
|
)) : null
|
|
);
|
|
};
|
|
/* harmony default export */ var ruleInfo = (RuleModal);
|
|
|
|
;// CONCATENATED MODULE: ./src/pages/Paperlibrary/Random/Edit/QuestionInfo/RuleModal/index.tsx
|
|
|
|
|
|
const RuleModal_RuleModal = ({ open, onCancel, setVisibleModalType, currentItemType }) => {
|
|
return open ? /* @__PURE__ */ _react_17_0_2_react.createElement(
|
|
ruleInfo,
|
|
{
|
|
open,
|
|
onCancel,
|
|
setVisibleModalType,
|
|
currentItemType
|
|
}
|
|
) : null;
|
|
};
|
|
/* harmony default export */ var QuestionInfo_RuleModal = (RuleModal_RuleModal);
|
|
|
|
// EXTERNAL MODULE: ./src/service/paperlibrary.ts
|
|
var paperlibrary = __webpack_require__(6587);
|
|
;// CONCATENATED MODULE: ./src/utils/hooks/useCourseOptions.ts
|
|
var useCourseOptions_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 = () => useCourseOptions_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;
|
|
};
|
|
|
|
|
|
// EXTERNAL MODULE: ./src/service/classrooms.ts
|
|
var classrooms = __webpack_require__(65998);
|
|
// EXTERNAL MODULE: ./src/components/RenderHtml/index.tsx
|
|
var RenderHtml = __webpack_require__(16921);
|
|
// EXTERNAL MODULE: ./src/utils/util.tsx
|
|
var utils_util = __webpack_require__(13462);
|
|
// EXTERNAL MODULE: ./node_modules/_@ant-design_icons@5.3.7@@ant-design/icons/es/icons/QuestionCircleOutlined.js + 1 modules
|
|
var QuestionCircleOutlined = __webpack_require__(85699);
|
|
;// CONCATENATED MODULE: ./src/pages/Paperlibrary/Random/Edit/QuestionInfo/SelectShixunModal.tsx
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
const SelectShixunModal = ({ open, onCancel, onOk }) => {
|
|
const { data } = (0,_react_17_0_2_react.useContext)(DataContext);
|
|
const courseOptions = useCourseOptions();
|
|
const [
|
|
queryParams,
|
|
tableLoading,
|
|
getShixunData,
|
|
shixunData
|
|
] = (0,useCustomRequest/* useCustomRequest */.U)(
|
|
classrooms/* getShixunListsItem */.Gm,
|
|
{ page: 1, limit: 10, keyword: "", diff: "", discipline_id: "", sub_discipline_id: "", type: 0, include_shixuns: true, item_type: "SHIXUN" }
|
|
);
|
|
const [emptyTipsVisible, setEmptyTipsVisible] = (0,_react_17_0_2_react.useState)(false);
|
|
(0,_react_17_0_2_react.useEffect)(() => {
|
|
if (open) {
|
|
getShixunData({ page: 1, limit: 10, type: 0 }, true).then((res) => {
|
|
if ((res == null ? void 0 : res.shixuns_count) === 0) {
|
|
setEmptyTipsVisible(true);
|
|
}
|
|
});
|
|
const questionInfo = data.item_types.find((item) => item.item_type === "PRACTICAL");
|
|
setSelectedRowKeys(questionInfo.item_banks.map((item) => item.id));
|
|
setSelectedRows(questionInfo.item_banks);
|
|
}
|
|
}, [open, data]);
|
|
const [selectedRowKeys, setSelectedRowKeys] = (0,_react_17_0_2_react.useState)([]);
|
|
const [selectedRows, setSelectedRows] = (0,_react_17_0_2_react.useState)([]);
|
|
return /* @__PURE__ */ _react_17_0_2_react.createElement(
|
|
modal["default"],
|
|
{
|
|
title: "\u9009\u62E9\u5B9E\u8BAD\u9898",
|
|
open,
|
|
width: 948,
|
|
centered: true,
|
|
closable: true,
|
|
onCancel,
|
|
onOk: () => onOk(selectedRows),
|
|
destroyOnClose: true
|
|
},
|
|
/* @__PURE__ */ _react_17_0_2_react.createElement(row/* default */.Z, { justify: "space-between", className: "mb20", style: { maxHeight: 650 } }, /* @__PURE__ */ _react_17_0_2_react.createElement(col/* default */.Z, null, /* @__PURE__ */ _react_17_0_2_react.createElement(
|
|
cascader/* default */.Z,
|
|
{
|
|
style: { width: 160 },
|
|
size: "large",
|
|
placeholder: "\u8BF7\u9009\u62E9\u65B9\u5411&\u8BFE\u7A0B",
|
|
options: courseOptions,
|
|
onChange: (courseId) => {
|
|
getShixunData({ page: 1, discipline_id: courseId == null ? void 0 : courseId[0], sub_discipline_id: courseId == null ? void 0 : courseId[1] });
|
|
}
|
|
}
|
|
), /* @__PURE__ */ _react_17_0_2_react.createElement(
|
|
es_select["default"],
|
|
{
|
|
className: "ml20",
|
|
style: { width: 118 },
|
|
size: "large",
|
|
placeholder: "\u96BE\u5EA6",
|
|
allowClear: true,
|
|
options: [
|
|
{ label: "\u521D\u7EA7", value: 1 },
|
|
{ label: "\u4E2D\u7EA7", value: 2 },
|
|
{ label: "\u4E2D\u9AD8\u7EA7", value: 3 },
|
|
{ label: "\u9AD8\u7EA7", value: 4 }
|
|
],
|
|
onChange: (diff) => getShixunData({ page: 1, diff })
|
|
}
|
|
)), /* @__PURE__ */ _react_17_0_2_react.createElement(
|
|
ui_customization/* CustomInput */.t7,
|
|
{
|
|
placeholder: "\u8BF7\u8F93\u5165\u5173\u952E\u8BCD\u641C\u7D22",
|
|
style: { width: 290 },
|
|
onChange: (input) => {
|
|
getShixunData({ keyword: input, page: 1 });
|
|
}
|
|
}
|
|
)),
|
|
emptyTipsVisible ? /* @__PURE__ */ _react_17_0_2_react.createElement("div", null, /* @__PURE__ */ _react_17_0_2_react.createElement(NoData/* default */.Z, { customText: "\u6682\u65E0\u6570\u636E", ButtonText: "\u524D\u5F80\u5B9E\u8DF5\u9879\u76EE\u5E93\uFF0C\u6DFB\u52A0\u66F4\u591A\u8BD5\u9898>", ButtonClick: () => (0,utils_util/* openNewWindow */.xg)("/shixuns") })) : /* @__PURE__ */ _react_17_0_2_react.createElement(
|
|
table["default"],
|
|
{
|
|
loading: tableLoading,
|
|
rowKey: "id",
|
|
columns: [
|
|
{
|
|
title: "\u8BD5\u9898\u540D\u79F0",
|
|
dataIndex: "name",
|
|
width: "30%",
|
|
// ellipsis: true,
|
|
ellipsis: { showTitle: true },
|
|
render: (text) => /* @__PURE__ */ _react_17_0_2_react.createElement(RenderHtml/* default */.Z, { key: 1, showLines: 1, showTextOnly: true, value: text || "--" })
|
|
},
|
|
// {
|
|
// title: '创建者',
|
|
// dataIndex: 'author_name',
|
|
// render: (authorName: string) => Array.isArray(authorName) ? <RenderHtml key={1} showLines={1} showTextOnly value={authorName?.[0]} /> : authorName.split('、')[0]
|
|
// },
|
|
// {
|
|
// title: '所属学校',
|
|
// dataIndex: 'author_school_name',
|
|
// render(value) {
|
|
// return <RenderHtml key={1} showLines={1} showTextOnly value={value} />
|
|
// },
|
|
// },
|
|
{
|
|
title: "\u96BE\u5EA6",
|
|
dataIndex: "level"
|
|
},
|
|
{
|
|
title: "\u5173\u5361\u6570\u91CF",
|
|
dataIndex: "challenges_count",
|
|
key: "challenges_count",
|
|
render: (value, record, index) => /* @__PURE__ */ _react_17_0_2_react.createElement("span", null, value || "- -")
|
|
},
|
|
{
|
|
title: "\u4F7F\u7528\u6B21\u6570",
|
|
dataIndex: "study_count"
|
|
},
|
|
{
|
|
title: /* @__PURE__ */ _react_17_0_2_react.createElement("span", null, "\u53D1\u5E03\u72B6\u6001 ", /* @__PURE__ */ _react_17_0_2_react.createElement(tooltip/* default */.Z, { title: "\u672A\u53D1\u5E03\u7684\u5B9E\u8DF5\u9879\u76EE\u4E0D\u80FD\u88AB\u9009\u7528" }, /* @__PURE__ */ _react_17_0_2_react.createElement(QuestionCircleOutlined/* default */.Z, null))),
|
|
dataIndex: "shixun_tag_num_name",
|
|
key: "shixun_tag_num_name",
|
|
width: 100,
|
|
render: (value, record, index) => /* @__PURE__ */ _react_17_0_2_react.createElement("span", null, value || "- -")
|
|
},
|
|
{
|
|
title: "\u64CD\u4F5C",
|
|
render(value, record) {
|
|
const { title, challenge_names, author_name, identifier, author_school_name, study_count } = record || {};
|
|
return /* @__PURE__ */ _react_17_0_2_react.createElement("div", null, /* @__PURE__ */ _react_17_0_2_react.createElement("span", { style: { color: "#165DFF", cursor: "pointer" }, onClick: () => {
|
|
modal["default"].confirm({
|
|
title: "\u9898\u76EE\u8BE6\u60C5",
|
|
closable: true,
|
|
width: 1e3,
|
|
centered: true,
|
|
icon: null,
|
|
footer: null,
|
|
content: /* @__PURE__ */ _react_17_0_2_react.createElement("div", null, /* @__PURE__ */ _react_17_0_2_react.createElement(RenderHtml/* default */.Z, { value: title, style: { marginBottom: 18 } }), /* @__PURE__ */ _react_17_0_2_react.createElement("div", { className: QuestionInfomodules.challengeNameWrapper }, challenge_names.map((name, index) => /* @__PURE__ */ _react_17_0_2_react.createElement("div", { className: QuestionInfomodules.challengeName, key: index }, "\u7B2C", (0,utils_util/* toChineseNumber */.EM)(index + 1), "\u9898\xA0", name))), /* @__PURE__ */ _react_17_0_2_react.createElement(row/* default */.Z, { className: QuestionInfomodules.shixunPreviewFooter, justify: "space-between", style: { alignItems: "center" } }, /* @__PURE__ */ _react_17_0_2_react.createElement(col/* default */.Z, { className: QuestionInfomodules.shixunInfoWrapper }, /* @__PURE__ */ _react_17_0_2_react.createElement("span", null, "\u521B\u5EFA\u8005"), /* @__PURE__ */ _react_17_0_2_react.createElement("span", { className: QuestionInfomodules.shixunInfo }, author_name.split("\u3001")[0]), /* @__PURE__ */ _react_17_0_2_react.createElement("span", null, "\u6240\u5C5E\u5355\u4F4D"), /* @__PURE__ */ _react_17_0_2_react.createElement("span", { className: QuestionInfomodules.shixunInfo }, author_school_name), /* @__PURE__ */ _react_17_0_2_react.createElement("span", null, "\u5B66\u4E60\u4EBA\u6570"), /* @__PURE__ */ _react_17_0_2_react.createElement("span", { className: QuestionInfomodules.shixunInfo }, study_count)), /* @__PURE__ */ _react_17_0_2_react.createElement(
|
|
es_button/* default */.ZP,
|
|
{
|
|
type: "primary",
|
|
className: QuestionInfomodules.btnToDetail,
|
|
onClick: () => (0,utils_util/* openNewWindow */.xg)(`/shixuns/${identifier}/challenges?exercise=true`)
|
|
},
|
|
/* @__PURE__ */ _react_17_0_2_react.createElement("i", { className: "iconfont icon-shixunkecheng" }),
|
|
"\u5B9E\u8BAD\u8BE6\u60C5"
|
|
)))
|
|
});
|
|
} }, "\u67E5\u770B"), (record == null ? void 0 : record.shixun_tag_num) === 1 && /* @__PURE__ */ _react_17_0_2_react.createElement("a", { target: "_blank", href: `/shixuns/${record == null ? void 0 : record.identifier}/challenges`, style: { marginLeft: 10 } }, "\u53BB\u53D1\u5E03"));
|
|
}
|
|
}
|
|
],
|
|
dataSource: shixunData == null ? void 0 : shixunData.items,
|
|
rowSelection: {
|
|
selectedRowKeys,
|
|
preserveSelectedRowKeys: true,
|
|
getCheckboxProps: (record) => ({
|
|
disabled: record.shixun_tag_num === 1
|
|
}),
|
|
onChange(newSelectedRowKeys, newSelectedRows) {
|
|
var _a, _b, _c;
|
|
console.log(newSelectedRowKeys);
|
|
setSelectedRowKeys(newSelectedRowKeys);
|
|
const newRows = [];
|
|
for (const prevRow of selectedRows) {
|
|
if (newSelectedRowKeys.includes(prevRow.id)) {
|
|
newRows.push(prevRow);
|
|
}
|
|
}
|
|
const existKeys = newRows.map((row) => row.id);
|
|
for (const newRow of newSelectedRows) {
|
|
if (newRow && newSelectedRowKeys.includes(newRow.id) && !existKeys.includes(newRow.id)) {
|
|
newRows.push(
|
|
{
|
|
id: newRow.id,
|
|
difficulty: newRow.level,
|
|
identifier: newRow.identifier,
|
|
name: newRow.name,
|
|
real_name: (_a = newRow == null ? void 0 : newRow.author_name) == null ? void 0 : _a.split("\u3001")[0],
|
|
school_name: newRow.author_school_name,
|
|
challenge_names: newRow.challenge_names,
|
|
challenges: (_b = newRow.challenge_names) == null ? void 0 : _b.map((item, index) => {
|
|
return {
|
|
subject: item,
|
|
id: index,
|
|
score: 5
|
|
};
|
|
}),
|
|
score: ((_c = newRow.challenge_names) == null ? void 0 : _c.length) * 5,
|
|
study_count: newRow.study_count,
|
|
challenges_count: newRow.challenges_count
|
|
}
|
|
);
|
|
}
|
|
}
|
|
setSelectedRows(newRows);
|
|
}
|
|
},
|
|
pagination: {
|
|
current: queryParams.page,
|
|
pageSize: queryParams.limit,
|
|
total: shixunData == null ? void 0 : shixunData.items_count,
|
|
showTotal: (total) => /* @__PURE__ */ _react_17_0_2_react.createElement("span", null, "\u5171\xA0", /* @__PURE__ */ _react_17_0_2_react.createElement("span", { style: { color: "#165DFF" } }, total), "\xA0\u6761\u6570\u636E"),
|
|
showQuickJumper: true,
|
|
onChange(page, pageSize) {
|
|
getShixunData({ page, limit: pageSize });
|
|
},
|
|
size: "default"
|
|
},
|
|
scroll: { y: 400 }
|
|
}
|
|
)
|
|
);
|
|
};
|
|
/* harmony default export */ var QuestionInfo_SelectShixunModal = (SelectShixunModal);
|
|
|
|
// 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);
|
|
;// CONCATENATED MODULE: ./src/pages/Paperlibrary/Random/Edit/QuestionInfo/QuestionList.tsx
|
|
/* provided dependency */ var QuestionList_React = __webpack_require__(/*! react */ 59301);
|
|
var QuestionList_defProp = Object.defineProperty;
|
|
var QuestionList_defProps = Object.defineProperties;
|
|
var QuestionList_getOwnPropDescs = Object.getOwnPropertyDescriptors;
|
|
var QuestionList_getOwnPropSymbols = Object.getOwnPropertySymbols;
|
|
var QuestionList_hasOwnProp = Object.prototype.hasOwnProperty;
|
|
var QuestionList_propIsEnum = Object.prototype.propertyIsEnumerable;
|
|
var QuestionList_defNormalProp = (obj, key, value) => key in obj ? QuestionList_defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
|
|
var QuestionList_spreadValues = (a, b) => {
|
|
for (var prop in b || (b = {}))
|
|
if (QuestionList_hasOwnProp.call(b, prop))
|
|
QuestionList_defNormalProp(a, prop, b[prop]);
|
|
if (QuestionList_getOwnPropSymbols)
|
|
for (var prop of QuestionList_getOwnPropSymbols(b)) {
|
|
if (QuestionList_propIsEnum.call(b, prop))
|
|
QuestionList_defNormalProp(a, prop, b[prop]);
|
|
}
|
|
return a;
|
|
};
|
|
var QuestionList_spreadProps = (a, b) => QuestionList_defProps(a, QuestionList_getOwnPropDescs(b));
|
|
|
|
|
|
|
|
|
|
|
|
|
|
const QuestionList = ({ onDelete, list, onSelect }) => {
|
|
const [loading, setLoading] = (0,_react_17_0_2_react.useState)(false);
|
|
const { dispatch, disabled } = (0,_react_17_0_2_react.useContext)(DataContext);
|
|
const reorder = (prevList, startIndex, endIndex) => {
|
|
const result = Array.from(prevList);
|
|
const [removed] = result.splice(startIndex, 1);
|
|
result.splice(endIndex, 0, removed);
|
|
return result;
|
|
};
|
|
const [draggingId, setDraggingId] = (0,_react_17_0_2_react.useState)(null);
|
|
const [isDragging, setIsDragging] = (0,_react_17_0_2_react.useState)(false);
|
|
return /* @__PURE__ */ QuestionList_React.createElement(
|
|
react_beautiful_dnd_esm/* DragDropContext */.Z5,
|
|
{
|
|
onDragStart: () => {
|
|
setIsDragging(true);
|
|
},
|
|
onDragEnd: (result) => {
|
|
setIsDragging(false);
|
|
if (!result.destination) {
|
|
return;
|
|
}
|
|
const newList = reorder(list, result.source.index, result.destination.index);
|
|
dispatch({ type: "updateItemTypes", payload: newList });
|
|
}
|
|
},
|
|
/* @__PURE__ */ QuestionList_React.createElement(react_beautiful_dnd_esm/* Droppable */.bK, { droppableId: "droppable" }, (provided, snapshot) => {
|
|
return /* @__PURE__ */ QuestionList_React.createElement(
|
|
"div",
|
|
QuestionList_spreadProps(QuestionList_spreadValues({}, provided.droppableProps), {
|
|
ref: provided.innerRef
|
|
}),
|
|
/* @__PURE__ */ QuestionList_React.createElement(spin/* default */.Z, { spinning: loading }, list.map((item, index) => {
|
|
return /* @__PURE__ */ QuestionList_React.createElement(
|
|
react_beautiful_dnd_esm/* Draggable */._l,
|
|
{
|
|
key: index,
|
|
draggableId: index.toString(),
|
|
index,
|
|
isDragDisabled: draggingId !== item.item_type
|
|
},
|
|
(provided2, snapshot2) => /* @__PURE__ */ QuestionList_React.createElement(
|
|
row/* default */.Z,
|
|
QuestionList_spreadProps(QuestionList_spreadValues(QuestionList_spreadValues({
|
|
align: "middle",
|
|
wrap: false,
|
|
ref: provided2.innerRef
|
|
}, provided2.draggableProps), provided2.dragHandleProps), {
|
|
className: `${QuestionInfomodules.dragItem} ${isDragging ? QuestionInfomodules.dragging : ""}`
|
|
}),
|
|
/* @__PURE__ */ QuestionList_React.createElement(
|
|
col/* default */.Z,
|
|
{
|
|
className: QuestionInfomodules.contentArea,
|
|
onClick: () => {
|
|
onSelect(item.item_type);
|
|
(0,utils_util/* scrollToTop */.k3)();
|
|
}
|
|
},
|
|
/* @__PURE__ */ QuestionList_React.createElement("span", { className: QuestionInfomodules.blackText }, (0,utils_util/* toChineseNumber */.EM)(index + 1), "\u3001\u3010", item.item_type_text, "\u3011"),
|
|
/* @__PURE__ */ QuestionList_React.createElement(tooltip/* default */.Z, { title: `\uFF08${item.item_bank_count}\u5C0F\u9898\uFF0C\u5171${parseFloat(item.total_score).toFixed(1)}\u5206\uFF09` }, /* @__PURE__ */ QuestionList_React.createElement("span", { className: QuestionInfomodules.greyText }, `\uFF08${item.item_bank_count}\u5C0F\u9898\uFF0C\u5171${parseFloat(item.total_score).toFixed(1)}\u5206\uFF09`))
|
|
),
|
|
!disabled && /* @__PURE__ */ QuestionList_React.createElement(QuestionList_React.Fragment, null, /* @__PURE__ */ QuestionList_React.createElement(tooltip/* default */.Z, { title: "\u957F\u6309\u53EF\u8FDB\u884C\u62D6\u62FD\u6392\u5E8F", open: draggingId === item.item_type && !isDragging }, /* @__PURE__ */ QuestionList_React.createElement(
|
|
"div",
|
|
{
|
|
style: { cursor: "grab" },
|
|
className: `${QuestionInfomodules.iconWrapper} ${isDragging ? QuestionInfomodules.hidden : ""}`,
|
|
onMouseEnter: () => {
|
|
setDraggingId(item.item_type);
|
|
},
|
|
onMouseLeave: () => setDraggingId(null)
|
|
},
|
|
/* @__PURE__ */ QuestionList_React.createElement("i", { className: `iconfont icon-tuodong1 ${QuestionInfomodules.dragIcon}` })
|
|
)), /* @__PURE__ */ QuestionList_React.createElement(tooltip/* default */.Z, { title: "\u5220\u9664" }, /* @__PURE__ */ QuestionList_React.createElement("div", { className: `${QuestionInfomodules.iconWrapper} ${isDragging ? QuestionInfomodules.hidden : ""}`, style: { cursor: "pointer" }, onClick: () => onDelete(item.item_type) }, /* @__PURE__ */ QuestionList_React.createElement("i", { className: `iconfont icon-shanchu12 ${QuestionInfomodules.deleteIcon}` }))))
|
|
)
|
|
);
|
|
})),
|
|
provided.placeholder
|
|
);
|
|
})
|
|
);
|
|
};
|
|
/* harmony default export */ var QuestionInfo_QuestionList = (QuestionList);
|
|
|
|
// EXTERNAL MODULE: ./node_modules/_antd@5.9.0@antd/es/timeline/index.js + 5 modules
|
|
var timeline = __webpack_require__(10777);
|
|
;// CONCATENATED MODULE: ./src/pages/Paperlibrary/Random/Edit/QuestionInfo/QuestionDetail/index.less?modules
|
|
// extracted by mini-css-extract-plugin
|
|
/* harmony default export */ var QuestionDetailmodules = ({"flex_box_center":"flex_box_center___ppkzA","flex_space_between":"flex_space_between___Z1syx","flex_box_vertical_center":"flex_box_vertical_center___twJ9S","flex_box_center_end":"flex_box_center_end___uI0uW","flex_box_column":"flex_box_column___JRp7D","timelineWrapper":"timelineWrapper___LP9aM","title":"title___KUHj_","desc":"desc___ubc8E","titles":"titles___njkjf","questionDetailWrapper":"questionDetailWrapper___p4SFM","questionTitle":"questionTitle___JC9X6","questionScoreInfo":"questionScoreInfo___NgOJI","deleteIcon":"deleteIcon___oMVTN","deleteBtn":"deleteBtn___JUPEl","normalText":"normalText___FW9Y_","folderIcon":"folderIcon___gvacQ","challengeNameWrapper":"challengeNameWrapper___fG7Vv","challengeName":"challengeName___Ia1Xs","shixunPreviewFooter":"shixunPreviewFooter___rKsnN","shixunInfoWrapper":"shixunInfoWrapper___FEnDb","shixunInfo":"shixunInfo___TbrA2","btnToDetail":"btnToDetail___dqLQP"});
|
|
// EXTERNAL MODULE: ./src/assets/images/problemset/folder-closed.png
|
|
var folder_closed = __webpack_require__(73631);
|
|
// EXTERNAL MODULE: ./src/assets/images/problemset/folder.png
|
|
var folder = __webpack_require__(31328);
|
|
;// CONCATENATED MODULE: ./src/pages/Paperlibrary/Random/Edit/QuestionInfo/QuestionDetail/columns.tsx
|
|
|
|
|
|
|
|
|
|
|
|
|
|
const getColumns = (ruleValueKey, dispatch, currentItemType, disabled) => {
|
|
const columnsMap = {
|
|
[RuleValueKeyType.OnlyDifficulty]: [
|
|
{
|
|
title: "\u96BE\u5EA6",
|
|
key: "difficulty",
|
|
render(value, record) {
|
|
const { difficulty } = record;
|
|
return /* @__PURE__ */ _react_17_0_2_react.createElement("span", { style: { color: difficultyMap[difficulty].color } }, difficultyMap[difficulty].label);
|
|
}
|
|
}
|
|
],
|
|
[RuleValueKeyType.OnlyKnowledge]: [
|
|
{
|
|
title: "\u77E5\u8BC6\u70B9",
|
|
dataIndex: "tag_discipline_name",
|
|
ellipsis: true
|
|
},
|
|
{
|
|
title: "\u65B9\u5411&\u8BFE\u7A0B",
|
|
dataIndex: "sub_discipline_name",
|
|
width: 180,
|
|
ellipsis: { showTitle: true },
|
|
render(text, record) {
|
|
return `${text}`;
|
|
}
|
|
}
|
|
],
|
|
[RuleValueKeyType.OnlyFileFolder]: [
|
|
{
|
|
title: "\u6587\u4EF6\u5939",
|
|
render(value, record, index) {
|
|
const { group_name, teacher_group_name } = record;
|
|
const name = group_name || teacher_group_name;
|
|
const iconUrl = teacher_group_name ? folder : folder_closed;
|
|
return /* @__PURE__ */ _react_17_0_2_react.createElement("div", { style: { display: "flex" } }, /* @__PURE__ */ _react_17_0_2_react.createElement("img", { src: iconUrl, className: QuestionDetailmodules.folderIcon }), " ", /* @__PURE__ */ _react_17_0_2_react.createElement(tooltip/* default */.Z, { title: name }, /* @__PURE__ */ _react_17_0_2_react.createElement("span", { className: QuestionDetailmodules.titles }, name)));
|
|
}
|
|
},
|
|
{
|
|
title: "\u7C7B\u578B",
|
|
render(value, record) {
|
|
const { teacher_group_name } = record;
|
|
return /* @__PURE__ */ _react_17_0_2_react.createElement("span", null, teacher_group_name ? "\u56E2\u961F\u5171\u4EAB" : "\u6211\u521B\u5EFA\u7684");
|
|
}
|
|
}
|
|
],
|
|
[RuleValueKeyType.KnowledgeAndDiff]: [
|
|
{
|
|
title: "\u77E5\u8BC6\u70B9",
|
|
dataIndex: "tag_discipline_name",
|
|
ellipsis: { showTitle: true }
|
|
},
|
|
{
|
|
title: "\u65B9\u5411&\u8BFE\u7A0B",
|
|
width: 180,
|
|
dataIndex: "sub_discipline_name",
|
|
ellipsis: { showTitle: true }
|
|
},
|
|
{
|
|
title: "\u96BE\u5EA6",
|
|
key: "difficulty",
|
|
render(value, record) {
|
|
const { difficulty } = record;
|
|
return /* @__PURE__ */ _react_17_0_2_react.createElement("span", { style: { color: difficultyMap[difficulty].color } }, difficultyMap[difficulty].label);
|
|
}
|
|
}
|
|
],
|
|
[RuleValueKeyType.FileFolderAndKnowledge]: [
|
|
{
|
|
title: "\u77E5\u8BC6\u70B9",
|
|
dataIndex: "tag_discipline_name",
|
|
ellipsis: true
|
|
},
|
|
{
|
|
title: "\u6587\u4EF6\u5939",
|
|
render(value, record) {
|
|
const { group_name, teacher_group_name } = record;
|
|
const name = group_name || teacher_group_name;
|
|
const iconUrl = teacher_group_name ? folder : folder_closed;
|
|
return /* @__PURE__ */ _react_17_0_2_react.createElement("div", { style: { display: "flex" } }, /* @__PURE__ */ _react_17_0_2_react.createElement("img", { src: iconUrl, className: QuestionDetailmodules.folderIcon }), " ", /* @__PURE__ */ _react_17_0_2_react.createElement(tooltip/* default */.Z, { title: name }, /* @__PURE__ */ _react_17_0_2_react.createElement("span", { className: QuestionDetailmodules.titles }, name)));
|
|
}
|
|
},
|
|
{
|
|
title: "\u7C7B\u578B",
|
|
render(value, record) {
|
|
const { teacher_group_name } = record;
|
|
return /* @__PURE__ */ _react_17_0_2_react.createElement("span", null, teacher_group_name ? "\u56E2\u961F\u5171\u4EAB" : "\u6211\u521B\u5EFA\u7684");
|
|
}
|
|
}
|
|
],
|
|
[RuleValueKeyType.FileFolderAndDiff]: [
|
|
{
|
|
title: "\u6587\u4EF6\u5939",
|
|
render(value, record) {
|
|
const { group_name, teacher_group_name } = record;
|
|
const name = group_name || teacher_group_name;
|
|
const iconUrl = teacher_group_name ? folder : folder_closed;
|
|
return /* @__PURE__ */ _react_17_0_2_react.createElement("div", { style: { display: "flex" } }, /* @__PURE__ */ _react_17_0_2_react.createElement("img", { src: iconUrl, className: QuestionDetailmodules.folderIcon }), " ", /* @__PURE__ */ _react_17_0_2_react.createElement(tooltip/* default */.Z, { title: name }, /* @__PURE__ */ _react_17_0_2_react.createElement("span", { className: QuestionDetailmodules.titles }, name)));
|
|
}
|
|
},
|
|
{
|
|
title: "\u7C7B\u578B",
|
|
render(value, record) {
|
|
const { teacher_group_name } = record;
|
|
return /* @__PURE__ */ _react_17_0_2_react.createElement("span", null, teacher_group_name ? "\u56E2\u961F\u5171\u4EAB" : "\u6211\u521B\u5EFA\u7684");
|
|
}
|
|
},
|
|
{
|
|
title: "\u96BE\u5EA6",
|
|
key: "difficulty",
|
|
render(value, record) {
|
|
const { difficulty } = record;
|
|
return /* @__PURE__ */ _react_17_0_2_react.createElement("span", { style: { color: difficultyMap[difficulty].color } }, difficultyMap[difficulty].label);
|
|
}
|
|
}
|
|
],
|
|
[RuleValueKeyType.All]: [
|
|
{
|
|
title: "\u77E5\u8BC6\u70B9",
|
|
dataIndex: "tag_discipline_name",
|
|
ellipsis: true
|
|
},
|
|
{
|
|
title: "\u6587\u4EF6\u5939",
|
|
render(value, record) {
|
|
const { group_name, teacher_group_name, teacher_group_id } = record;
|
|
const name = group_name || teacher_group_name;
|
|
const iconUrl = teacher_group_id || teacher_group_id === 0 ? folder : folder_closed;
|
|
return /* @__PURE__ */ _react_17_0_2_react.createElement("div", { style: { display: "flex" } }, /* @__PURE__ */ _react_17_0_2_react.createElement("img", { src: iconUrl, className: QuestionDetailmodules.folderIcon }), " ", /* @__PURE__ */ _react_17_0_2_react.createElement(tooltip/* default */.Z, { title: name }, /* @__PURE__ */ _react_17_0_2_react.createElement("span", { className: QuestionDetailmodules.titles }, name)));
|
|
}
|
|
},
|
|
{
|
|
title: "\u7C7B\u578B",
|
|
render(value, record) {
|
|
const { teacher_group_id } = record;
|
|
return /* @__PURE__ */ _react_17_0_2_react.createElement("span", null, teacher_group_id || teacher_group_id === 0 ? "\u56E2\u961F\u5171\u4EAB" : "\u6211\u521B\u5EFA\u7684");
|
|
}
|
|
},
|
|
{
|
|
title: "\u96BE\u5EA6",
|
|
key: "difficulty",
|
|
render(value, record) {
|
|
const { difficulty } = record;
|
|
return /* @__PURE__ */ _react_17_0_2_react.createElement("span", { style: { color: difficultyMap[difficulty].color } }, difficultyMap[difficulty].label);
|
|
}
|
|
}
|
|
],
|
|
[RuleValueKeyType.Shixun]: []
|
|
};
|
|
for (const columns of Object.values(columnsMap)) {
|
|
columns.push(
|
|
{
|
|
title: "\u62BD\u9898\u6570\u91CF",
|
|
key: "quanlity",
|
|
render(value, record) {
|
|
const { item_bank_num, quanlity, id, teacher_group_id } = record || {};
|
|
return /* @__PURE__ */ _react_17_0_2_react.createElement(row/* default */.Z, { align: "middle" }, /* @__PURE__ */ _react_17_0_2_react.createElement(
|
|
input_number/* default */.Z,
|
|
{
|
|
disabled,
|
|
min: 1,
|
|
max: item_bank_num,
|
|
size: "large",
|
|
precision: 0,
|
|
value: quanlity,
|
|
onChange: (num) => {
|
|
dispatch({ type: "changeQuestionNum", payload: { itemType: currentItemType, id, num, teacher_group_id } });
|
|
}
|
|
}
|
|
), /* @__PURE__ */ _react_17_0_2_react.createElement("span", { className: "ml10 font14", style: { color: "#333333" } }, "/", item_bank_num));
|
|
}
|
|
},
|
|
{
|
|
title: "\u64CD\u4F5C",
|
|
key: "action",
|
|
align: "right",
|
|
render(value, record) {
|
|
const { id, is_share } = record;
|
|
return disabled ? /* @__PURE__ */ _react_17_0_2_react.createElement("span", { className: "cursorNotAllowed c-grey-999" }, "\u5220\u9664") : /* @__PURE__ */ _react_17_0_2_react.createElement("span", { className: QuestionDetailmodules.deleteBtn, onClick: () => {
|
|
dispatch({ type: "deleteRule", payload: { itemType: currentItemType, id, is_share } });
|
|
} }, "\u5220\u9664");
|
|
}
|
|
}
|
|
);
|
|
}
|
|
return columnsMap[ruleValueKey];
|
|
};
|
|
|
|
|
|
;// CONCATENATED MODULE: ./src/pages/Paperlibrary/Random/Edit/QuestionInfo/QuestionDetail/index.tsx
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
const ShixunDetail = ({ setVisibleModalType }) => {
|
|
var _a, _b, _c, _d;
|
|
const { data, dispatch, disabled } = (0,_react_17_0_2_react.useContext)(DataContext);
|
|
const questionInfo = (_a = data == null ? void 0 : data.item_types) == null ? void 0 : _a.find((item) => item.item_type === "PRACTICAL");
|
|
return /* @__PURE__ */ _react_17_0_2_react.createElement(
|
|
timeline/* default */.Z,
|
|
{
|
|
className: QuestionDetailmodules.timelineWrapper,
|
|
items: [
|
|
{
|
|
children: /* @__PURE__ */ _react_17_0_2_react.createElement("div", { style: { transform: "translateY(-4px)" } }, /* @__PURE__ */ _react_17_0_2_react.createElement(row/* default */.Z, { className: "mb20", align: "middle", justify: "space-between" }, /* @__PURE__ */ _react_17_0_2_react.createElement(col/* default */.Z, null, /* @__PURE__ */ _react_17_0_2_react.createElement("span", { className: QuestionDetailmodules.title }, "\u9898\u5E93\u9009\u9898"), /* @__PURE__ */ _react_17_0_2_react.createElement("span", { className: QuestionDetailmodules.desc }, "\uFF08\u9700\u8981\u5148\u4ECE\u9898\u5E93\u4E2D\u9009\u62E9\u5B9E\u8BAD\u9898\uFF0C\u518D\u8BBE\u7F6E\u4ECE\u5DF2\u9009\u5B9E\u8BAD\u9898\u4E2D\u968F\u673A\u62BD\u9898\u7684\u6570\u91CF\uFF09")), !disabled && /* @__PURE__ */ _react_17_0_2_react.createElement(ui_customization/* CustomButton */.op, { style: { width: 102 }, onClick: () => setVisibleModalType("selectShixun") }, "\u4ECE\u9898\u5E93\u9009\u62E9")), ((_b = questionInfo == null ? void 0 : questionInfo.item_banks) == null ? void 0 : _b.length) === 0 ? /* @__PURE__ */ _react_17_0_2_react.createElement(NoData/* default */.Z, { customText: "\u6682\u65E0\u5F85\u62BD\u8BD5\u9898\uFF0C\u8BF7\u5148\u4ECE\u9898\u5E93\u8FDB\u884C\u9009\u62E9\uFF5E" }) : /* @__PURE__ */ _react_17_0_2_react.createElement(
|
|
table["default"],
|
|
{
|
|
rowKey: "id",
|
|
className: "mb10",
|
|
columns: [
|
|
{
|
|
title: "\u5E8F\u53F7",
|
|
width: 60,
|
|
render(value, record, index) {
|
|
return /* @__PURE__ */ _react_17_0_2_react.createElement("span", null, index + 1);
|
|
}
|
|
},
|
|
{
|
|
title: "\u8BD5\u9898\u540D\u79F0",
|
|
dataIndex: "name",
|
|
width: "30%",
|
|
ellipsis: { showTitle: true },
|
|
render: (text) => /* @__PURE__ */ _react_17_0_2_react.createElement(RenderHtml/* default */.Z, { key: 1, showLines: 1, showTextOnly: true, value: text })
|
|
},
|
|
// {
|
|
// title: '创建者',
|
|
// dataIndex: 'real_name',
|
|
// ellipsis: { showTitle: true }
|
|
// },
|
|
// {
|
|
// title: '所属单位',
|
|
// dataIndex: 'school_name',
|
|
// ellipsis: { showTitle: true }
|
|
// },
|
|
{
|
|
title: "\u4F7F\u7528\u6B21\u6570",
|
|
dataIndex: "study_count"
|
|
},
|
|
{
|
|
title: "\u5173\u5361\u6570\u91CF",
|
|
dataIndex: "challenges_count",
|
|
key: "challenges_count",
|
|
render: (value, record, index) => /* @__PURE__ */ _react_17_0_2_react.createElement("span", null, value || "- -")
|
|
},
|
|
{
|
|
title: "\u96BE\u5EA6",
|
|
dataIndex: "difficulty"
|
|
},
|
|
// {
|
|
// title: <span>分值<Tooltip title="实训题分值等于各关卡分值之和"><QuestionCircleOutlined /></Tooltip></span>,
|
|
// dataIndex: 'score'
|
|
// },
|
|
{
|
|
title: "\u64CD\u4F5C",
|
|
align: "right",
|
|
width: 180,
|
|
render(value, record, index) {
|
|
const { id, identifier, name, challenge_names = [], real_name, school_name, study_count, challenges = [] } = record || {};
|
|
return /* @__PURE__ */ _react_17_0_2_react.createElement("div", null, /* @__PURE__ */ _react_17_0_2_react.createElement(
|
|
"span",
|
|
{
|
|
style: { color: "#165DFF", cursor: "pointer", marginLeft: 20 },
|
|
onClick: () => {
|
|
modal["default"].confirm({
|
|
title: "\u9898\u76EE\u8BE6\u60C5",
|
|
closable: true,
|
|
width: 1e3,
|
|
centered: true,
|
|
icon: null,
|
|
footer: null,
|
|
content: /* @__PURE__ */ _react_17_0_2_react.createElement("div", null, /* @__PURE__ */ _react_17_0_2_react.createElement(RenderHtml/* default */.Z, { value: name, style: { marginBottom: 18 } }), /* @__PURE__ */ _react_17_0_2_react.createElement("div", { className: QuestionDetailmodules.challengeNameWrapper }, challenges == null ? void 0 : challenges.map((item, index2) => /* @__PURE__ */ _react_17_0_2_react.createElement("div", { className: QuestionDetailmodules.challengeName, key: index2 }, "\u7B2C", (0,utils_util/* toChineseNumber */.EM)(index2 + 1), "\u9898\xA0", item == null ? void 0 : item.subject))), /* @__PURE__ */ _react_17_0_2_react.createElement(row/* default */.Z, { className: QuestionDetailmodules.shixunPreviewFooter, justify: "space-between", style: { alignItems: "center" } }, /* @__PURE__ */ _react_17_0_2_react.createElement(col/* default */.Z, { className: QuestionDetailmodules.shixunInfoWrapper }, /* @__PURE__ */ _react_17_0_2_react.createElement("span", null, "\u521B\u5EFA\u8005"), /* @__PURE__ */ _react_17_0_2_react.createElement("span", { className: QuestionDetailmodules.shixunInfo }, real_name), /* @__PURE__ */ _react_17_0_2_react.createElement("span", null, "\u6240\u5C5E\u5355\u4F4D"), /* @__PURE__ */ _react_17_0_2_react.createElement("span", { className: QuestionDetailmodules.shixunInfo }, school_name), /* @__PURE__ */ _react_17_0_2_react.createElement("span", null, "\u5B66\u4E60\u4EBA\u6570"), /* @__PURE__ */ _react_17_0_2_react.createElement("span", { className: QuestionDetailmodules.shixunInfo }, study_count)), /* @__PURE__ */ _react_17_0_2_react.createElement(
|
|
es_button/* default */.ZP,
|
|
{
|
|
type: "primary",
|
|
className: QuestionDetailmodules.btnToDetail,
|
|
onClick: () => (0,utils_util/* openNewWindow */.xg)(`/shixuns/${identifier}/challenges?exercise=true`)
|
|
},
|
|
/* @__PURE__ */ _react_17_0_2_react.createElement("i", { className: "iconfont icon-shixunkecheng" }),
|
|
"\u5B9E\u8BAD\u8BE6\u60C5"
|
|
)))
|
|
});
|
|
}
|
|
},
|
|
"\u67E5\u770B"
|
|
), !disabled && /* @__PURE__ */ _react_17_0_2_react.createElement(
|
|
"span",
|
|
{
|
|
onClick: () => {
|
|
dispatch({ type: "deleteShixunQuestion", payload: { shixunId: id } });
|
|
},
|
|
className: `ml20 ${QuestionDetailmodules.deleteBtn}`
|
|
},
|
|
"\u5220\u9664"
|
|
));
|
|
}
|
|
}
|
|
],
|
|
dataSource: (questionInfo == null ? void 0 : questionInfo.item_banks) || [],
|
|
pagination: false
|
|
}
|
|
))
|
|
},
|
|
{
|
|
children: /* @__PURE__ */ _react_17_0_2_react.createElement(row/* default */.Z, { style: { transform: !!((_c = questionInfo == null ? void 0 : questionInfo.item_banks) == null ? void 0 : _c.length) ? "translateY(-8px)" : "none" }, align: "middle", justify: "space-between" }, /* @__PURE__ */ _react_17_0_2_react.createElement("span", { className: QuestionDetailmodules.title }, "\u5DF2\u9009\u5B9E\u8BAD\u9898\u4E2D\u968F\u673A\u62BD\u9898"), !!((_d = questionInfo == null ? void 0 : questionInfo.item_banks) == null ? void 0 : _d.length) && /* @__PURE__ */ _react_17_0_2_react.createElement(col/* default */.Z, null, /* @__PURE__ */ _react_17_0_2_react.createElement(row/* default */.Z, { align: "middle" }, /* @__PURE__ */ _react_17_0_2_react.createElement("span", { className: QuestionDetailmodules.normalText }, "\u62BD\u9898\u6570\u91CF"), /* @__PURE__ */ _react_17_0_2_react.createElement(
|
|
input_number/* default */.Z,
|
|
{
|
|
min: 0,
|
|
disabled,
|
|
max: questionInfo == null ? void 0 : questionInfo.item_bank_num,
|
|
size: "large",
|
|
className: "ml10 mr10",
|
|
value: (questionInfo == null ? void 0 : questionInfo.item_bank_count) || 1,
|
|
onChange: (value) => dispatch({ type: "changeQuestionNum", payload: { num: value || 1, itemType: "PRACTICAL" } })
|
|
}
|
|
), /* @__PURE__ */ _react_17_0_2_react.createElement("span", { className: `${QuestionDetailmodules.normalText} mr30` }, "/", questionInfo == null ? void 0 : questionInfo.item_bank_num), /* @__PURE__ */ _react_17_0_2_react.createElement("span", { className: QuestionDetailmodules.normalText }, "\u6BCF\u9898\u5206\u503C"), /* @__PURE__ */ _react_17_0_2_react.createElement(
|
|
input_number/* default */.Z,
|
|
{
|
|
disabled,
|
|
min: 0,
|
|
max: 100,
|
|
size: "large",
|
|
className: "ml10 mr10",
|
|
value: questionInfo == null ? void 0 : questionInfo.score,
|
|
onChange: (value) => dispatch({ type: "changeQuestionScore", payload: { score: value, itemType: "PRACTICAL" } })
|
|
}
|
|
), /* @__PURE__ */ _react_17_0_2_react.createElement("span", { className: QuestionDetailmodules.normalText }, "\u5206"))))
|
|
}
|
|
]
|
|
}
|
|
);
|
|
};
|
|
const QuestionDetail = ({ setVisibleModalType, currentItemType, onDelete }) => {
|
|
var _a, _b;
|
|
const urlParams = (0,_umi_production_exports.useParams)();
|
|
const { data, dispatch, disabled } = (0,_react_17_0_2_react.useContext)(DataContext);
|
|
const questionIndex = ((_a = data == null ? void 0 : data.item_types) == null ? void 0 : _a.findIndex((item) => item.item_type === currentItemType)) + 1;
|
|
const questionInfo = (_b = data == null ? void 0 : data.item_types) == null ? void 0 : _b.find((item) => item.item_type === currentItemType);
|
|
return /* @__PURE__ */ _react_17_0_2_react.createElement("div", { className: QuestionDetailmodules.questionDetailWrapper }, /* @__PURE__ */ _react_17_0_2_react.createElement(row/* default */.Z, { justify: "space-between", align: "middle", className: "mb30" }, /* @__PURE__ */ _react_17_0_2_react.createElement(col/* default */.Z, null, /* @__PURE__ */ _react_17_0_2_react.createElement("span", { className: QuestionDetailmodules.questionTitle }, `${(0,utils_util/* toChineseNumber */.EM)(questionIndex)}\u3001${questionInfo == null ? void 0 : questionInfo.item_type_text}`), /* @__PURE__ */ _react_17_0_2_react.createElement("span", { className: QuestionDetailmodules.questionScoreInfo }, "\uFF08", /* @__PURE__ */ _react_17_0_2_react.createElement("span", { style: { color: "#3061D0" } }, questionInfo == null ? void 0 : questionInfo.item_bank_count), "\u5C0F\u9898 ", /* @__PURE__ */ _react_17_0_2_react.createElement("span", null, "\uFF0C\u5171", /* @__PURE__ */ _react_17_0_2_react.createElement("span", { style: { color: "#3061D0" } }, questionInfo == null ? void 0 : questionInfo.total_score), "\u5206"), "\uFF09")), !disabled && /* @__PURE__ */ _react_17_0_2_react.createElement(
|
|
"i",
|
|
{
|
|
className: `iconfont icon-shanchutimu ${QuestionDetailmodules.deleteIcon}`,
|
|
onClick: () => onDelete(currentItemType)
|
|
}
|
|
)), currentItemType === "PRACTICAL" ? /* @__PURE__ */ _react_17_0_2_react.createElement(
|
|
ShixunDetail,
|
|
{
|
|
setVisibleModalType
|
|
}
|
|
) : /* @__PURE__ */ _react_17_0_2_react.createElement(_react_17_0_2_react.Fragment, null, (questionInfo == null ? void 0 : questionInfo.contents.length) === 0 ? /* @__PURE__ */ _react_17_0_2_react.createElement(
|
|
NoData/* default */.Z,
|
|
{
|
|
styles: { margin: "70px auto 100px auto" },
|
|
customText: /* @__PURE__ */ _react_17_0_2_react.createElement("span", null, "\u6682\u65E0\u62BD\u9898\u89C4\u5219\uFF0C\u652F\u6301", /* @__PURE__ */ _react_17_0_2_react.createElement("span", { style: { color: "#EA9741" } }, "\u6307\u5B9A\u6587\u4EF6\u5939\u3001\u96BE\u5EA6\u3001\u77E5\u8BC6\u70B9"), "\u8FDB\u884C\u62BD\u9898\uFF5E"),
|
|
ButtonTwo: (urlParams == null ? void 0 : urlParams.id) && /* @__PURE__ */ _react_17_0_2_react.createElement(row/* default */.Z, { justify: "center", className: "mt30" }, /* @__PURE__ */ _react_17_0_2_react.createElement(ui_customization/* CustomButton */.op, { style: { width: 136, marginTop: -10 }, onClick: () => setVisibleModalType("rule") }, "\u8BBE\u7F6E\u62BD\u9898\u89C4\u5219"))
|
|
}
|
|
) : /* @__PURE__ */ _react_17_0_2_react.createElement(_react_17_0_2_react.Fragment, null, /* @__PURE__ */ _react_17_0_2_react.createElement(row/* default */.Z, { justify: "space-between", align: "middle", className: "mb20" }, /* @__PURE__ */ _react_17_0_2_react.createElement(col/* default */.Z, null, /* @__PURE__ */ _react_17_0_2_react.createElement(row/* default */.Z, { align: "middle" }, /* @__PURE__ */ _react_17_0_2_react.createElement("span", { className: `${QuestionDetailmodules.normalText}` }, "\u6BCF\u9898\u5206\u503C"), /* @__PURE__ */ _react_17_0_2_react.createElement(
|
|
input_number/* default */.Z,
|
|
{
|
|
disabled,
|
|
size: "large",
|
|
className: "ml10 mr10",
|
|
min: 0.1,
|
|
max: 100,
|
|
value: questionInfo == null ? void 0 : questionInfo.score,
|
|
precision: 1,
|
|
onChange: (value) => dispatch({ type: "changeQuestionScore", payload: { score: value, itemType: currentItemType } })
|
|
}
|
|
), /* @__PURE__ */ _react_17_0_2_react.createElement("span", { className: QuestionDetailmodules.normalText }, "\u5206"))), (urlParams == null ? void 0 : urlParams.id) && /* @__PURE__ */ _react_17_0_2_react.createElement(ui_customization/* CustomButton */.op, { onClick: () => setVisibleModalType("rule") }, "\u8BBE\u7F6E\u62BD\u9898\u89C4\u5219")), /* @__PURE__ */ _react_17_0_2_react.createElement(
|
|
table["default"],
|
|
{
|
|
columns: getColumns(questionInfo == null ? void 0 : questionInfo.random_rule_type, dispatch, currentItemType, disabled),
|
|
dataSource: questionInfo == null ? void 0 : questionInfo.contents,
|
|
pagination: false,
|
|
rowKey: "id"
|
|
}
|
|
))));
|
|
};
|
|
/* harmony default export */ var QuestionInfo_QuestionDetail = (QuestionDetail);
|
|
|
|
// EXTERNAL MODULE: ./src/components/AsyncButton/index.tsx
|
|
var AsyncButton = __webpack_require__(16800);
|
|
// EXTERNAL MODULE: ./src/service/exercise.ts
|
|
var exercise = __webpack_require__(41044);
|
|
// EXTERNAL MODULE: ./src/utils/authority.ts
|
|
var authority = __webpack_require__(88141);
|
|
;// CONCATENATED MODULE: ./src/pages/Paperlibrary/Random/Edit/QuestionInfo/index.tsx
|
|
/* provided dependency */ var QuestionInfo_React = __webpack_require__(/*! react */ 59301);
|
|
var QuestionInfo_defProp = Object.defineProperty;
|
|
var QuestionInfo_defProps = Object.defineProperties;
|
|
var QuestionInfo_getOwnPropDescs = Object.getOwnPropertyDescriptors;
|
|
var QuestionInfo_getOwnPropSymbols = Object.getOwnPropertySymbols;
|
|
var QuestionInfo_hasOwnProp = Object.prototype.hasOwnProperty;
|
|
var QuestionInfo_propIsEnum = Object.prototype.propertyIsEnumerable;
|
|
var QuestionInfo_defNormalProp = (obj, key, value) => key in obj ? QuestionInfo_defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
|
|
var QuestionInfo_spreadValues = (a, b) => {
|
|
for (var prop in b || (b = {}))
|
|
if (QuestionInfo_hasOwnProp.call(b, prop))
|
|
QuestionInfo_defNormalProp(a, prop, b[prop]);
|
|
if (QuestionInfo_getOwnPropSymbols)
|
|
for (var prop of QuestionInfo_getOwnPropSymbols(b)) {
|
|
if (QuestionInfo_propIsEnum.call(b, prop))
|
|
QuestionInfo_defNormalProp(a, prop, b[prop]);
|
|
}
|
|
return a;
|
|
};
|
|
var QuestionInfo_spreadProps = (a, b) => QuestionInfo_defProps(a, QuestionInfo_getOwnPropDescs(b));
|
|
var QuestionInfo_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 QuestionInfo = ({}) => {
|
|
var _a, _b, _c, _d, _e, _f, _g, _h, _i, _j, _k, _l;
|
|
const [searchParams] = (0,_umi_production_exports.useSearchParams)();
|
|
const urlParams = (0,_umi_production_exports.useParams)();
|
|
const { data, dispatch, setPreview, getData, handlePreview, disabled } = (0,_react_17_0_2_react.useContext)(DataContext);
|
|
const [visibleModalType, setVisibleModalType] = (0,_react_17_0_2_react.useState)("");
|
|
const [currentItemType, setCurrentItemType] = (0,_react_17_0_2_react.useState)((_b = (_a = data == null ? void 0 : data.item_types) == null ? void 0 : _a[0]) == null ? void 0 : _b.item_type);
|
|
const [loading, setLoading] = (0,_react_17_0_2_react.useState)(true);
|
|
const handleSave = (notRedirect) => QuestionInfo_async(void 0, null, function* () {
|
|
var _a2, _b2;
|
|
const sort_by_item_type = data.item_types.map((item) => item.item_type_text);
|
|
const items = (_a2 = data == null ? void 0 : data.item_types) == null ? void 0 : _a2.filter((item) => {
|
|
var _a3, _b3;
|
|
return ((_a3 = item.contents) == null ? void 0 : _a3.length) > 0 || ((_b3 = item == null ? void 0 : item.item_banks) == null ? void 0 : _b3.length) > 0;
|
|
});
|
|
data.sort_by_item_type = sort_by_item_type;
|
|
if (!((_b2 = data.item_types) == null ? void 0 : _b2.length)) {
|
|
message/* default */.ZP.warning("\u8BD5\u9898\u603B\u6570=0\uFF0C\u8BF7\u5148\u8BBE\u7F6E\u62BD\u9898\u89C4\u5219");
|
|
return;
|
|
}
|
|
if ((items == null ? void 0 : items.length) === 0) {
|
|
message/* default */.ZP.warning("\u8BD5\u9898\u603B\u6570=0\uFF0C\u8BF7\u5148\u8BBE\u7F6E\u62BD\u9898\u89C4\u5219");
|
|
return;
|
|
}
|
|
const dataCopy = (0,lodash.cloneDeep)(data);
|
|
const { item_types } = dataCopy || {};
|
|
dataCopy.item_types = item_types.filter((item) => item.item_type === currentItemType);
|
|
const res = yield updateRandomExam(urlParams.id || urlParams.categoryId, dataCopy);
|
|
if (res.status === 0) {
|
|
message/* default */.ZP.success("\u4FDD\u5B58\u6210\u529F");
|
|
if (!notRedirect)
|
|
_umi_production_exports.history.push(`/paperlibrary`);
|
|
}
|
|
return res;
|
|
});
|
|
const handleExerciseSave = (notRedirect, type, itemType) => QuestionInfo_async(void 0, null, function* () {
|
|
console.log(data);
|
|
const body = QuestionInfo_spreadProps(QuestionInfo_spreadValues(QuestionInfo_spreadValues({}, data.exercise), urlParams), {
|
|
exerciseId: urlParams.categoryId,
|
|
sort_by_item_type: data.sort_by_item_type,
|
|
difficulty: data.examination_bank.difficulty,
|
|
exam_notes: data.examination_bank.exam_notes,
|
|
exercise_name: data.examination_bank.name,
|
|
time: data.examination_bank.time,
|
|
changed_item_type: currentItemType,
|
|
item_types: data.item_types,
|
|
// is_reset: 1,
|
|
sub_discipline_id: data.examination_bank.sub_discipline_id
|
|
});
|
|
if (!notRedirect || type === 1)
|
|
body.is_reset = 1;
|
|
const res = yield (0,exercise/* putExercise */.wy)(body);
|
|
if (res.status === 0) {
|
|
message/* default */.ZP.success("\u4FEE\u6539\u6210\u529F ");
|
|
setCurrentItemType(itemType);
|
|
if (!notRedirect) {
|
|
_umi_production_exports.history.push(`/classrooms/${urlParams.coursesId}/exercise/${urlParams.categoryId}/detail?random=true`);
|
|
}
|
|
}
|
|
return res;
|
|
});
|
|
const handleDelete = (itemType) => {
|
|
modal["default"].confirm({
|
|
title: "\u63D0\u793A",
|
|
icon: null,
|
|
centered: true,
|
|
closable: true,
|
|
content: /* @__PURE__ */ QuestionInfo_React.createElement("div", null, "\u786E\u8BA4\u5220\u9664\u8BE5\u9898\u578B\uFF1F"),
|
|
onOk: () => QuestionInfo_async(void 0, null, function* () {
|
|
var _a2, _b2, _c2, _d2;
|
|
if (urlParams.id) {
|
|
const res = yield deleteItem(urlParams.id, { item_type: [itemType] });
|
|
if (res.status !== 0) {
|
|
return;
|
|
}
|
|
} else {
|
|
const res = yield deletecourseItem(urlParams.categoryId, { item_type: [itemType] });
|
|
getData();
|
|
if (res.status !== 0) {
|
|
return;
|
|
}
|
|
}
|
|
dispatch({ type: "deleteQuestionType", payload: itemType });
|
|
if (itemType === currentItemType) {
|
|
const nextState = reducer(data, { type: "deleteQuestionType", payload: itemType });
|
|
setCurrentItemType(nextState.item_types.length ? nextState.item_types[0].item_type : (_b2 = (_a2 = data == null ? void 0 : data.item_types) == null ? void 0 : _a2[0]) == null ? void 0 : _b2.item_type);
|
|
} else {
|
|
setCurrentItemType((_d2 = (_c2 = data == null ? void 0 : data.item_types) == null ? void 0 : _c2[0]) == null ? void 0 : _d2.item_type);
|
|
}
|
|
})
|
|
});
|
|
};
|
|
(0,_react_17_0_2_react.useEffect)(() => {
|
|
var _a2;
|
|
if ((_a2 = data == null ? void 0 : data.examination_bank) == null ? void 0 : _a2.name) {
|
|
setLoading(false);
|
|
}
|
|
(0,utils_util/* setDocumentTitle */.Dk)("\u968F\u673A\u7EC4\u5377");
|
|
}, [(_c = data == null ? void 0 : data.examination_bank) == null ? void 0 : _c.name]);
|
|
const handlePracticeTest = () => QuestionInfo_async(void 0, null, function* () {
|
|
var _a2;
|
|
let res = yield handleExerciseSave(true, 1);
|
|
if ((res == null ? void 0 : res.status) === 0) {
|
|
_umi_production_exports.history.push(`/classrooms/${urlParams.coursesId}/exercise/${urlParams.categoryId}/${(_a2 = (0,authority/* userInfo */.eY)()) == null ? void 0 : _a2.login}/initate_answer`);
|
|
}
|
|
});
|
|
return /* @__PURE__ */ QuestionInfo_React.createElement("div", { className: QuestionInfomodules.questionInfo }, /* @__PURE__ */ QuestionInfo_React.createElement("div", { className: "tc mb20" }, /* @__PURE__ */ QuestionInfo_React.createElement(
|
|
TitleEditor,
|
|
{
|
|
defaultValue: (_d = data == null ? void 0 : data.examination_bank) == null ? void 0 : _d.name,
|
|
onFinish: (value) => QuestionInfo_async(void 0, null, function* () {
|
|
dispatch({ type: "updateBaseInfo", payload: QuestionInfo_spreadProps(QuestionInfo_spreadValues({}, data.examination_bank), { name: value }) });
|
|
return true;
|
|
})
|
|
}
|
|
)), /* @__PURE__ */ QuestionInfo_React.createElement(row/* default */.Z, { justify: "center", className: "mb20" }, /* @__PURE__ */ QuestionInfo_React.createElement(col/* default */.Z, { className: "mr30" }, /* @__PURE__ */ QuestionInfo_React.createElement("span", { className: QuestionInfomodules.label }, "\u7B54\u9898\u65F6\u957F"), /* @__PURE__ */ QuestionInfo_React.createElement("span", null, ((_e = data == null ? void 0 : data.examination_bank) == null ? void 0 : _e.time) === -1 ? "\u4E0D\u9650" : ((_f = data == null ? void 0 : data.examination_bank) == null ? void 0 : _f.time) || "\u4E0D\u9650")), /* @__PURE__ */ QuestionInfo_React.createElement(col/* default */.Z, { className: "mr30" }, /* @__PURE__ */ QuestionInfo_React.createElement("span", { className: QuestionInfomodules.label }, "\u96BE\u5EA6"), /* @__PURE__ */ QuestionInfo_React.createElement("span", null, (_h = difficultyMap[`${(_g = data == null ? void 0 : data.examination_bank) == null ? void 0 : _g.difficulty}`]) == null ? void 0 : _h.label)), /* @__PURE__ */ QuestionInfo_React.createElement(col/* default */.Z, { className: "mr30" }, /* @__PURE__ */ QuestionInfo_React.createElement("span", { className: QuestionInfomodules.label }, "\u8BD5\u9898\u603B\u6570"), /* @__PURE__ */ QuestionInfo_React.createElement("span", null, ((_i = data == null ? void 0 : data.examination_bank) == null ? void 0 : _i.question_count) || 0)), /* @__PURE__ */ QuestionInfo_React.createElement(col/* default */.Z, null, /* @__PURE__ */ QuestionInfo_React.createElement("span", { className: QuestionInfomodules.label }, "\u603B\u5206"), /* @__PURE__ */ QuestionInfo_React.createElement("span", null, ((_j = data == null ? void 0 : data.examination_bank) == null ? void 0 : _j.total_score) || 0))), /* @__PURE__ */ QuestionInfo_React.createElement("div", { className: QuestionInfomodules.content, style: { border: ((_k = data == null ? void 0 : data.item_types) == null ? void 0 : _k.length) <= 0 && "none" } }, ((_l = data == null ? void 0 : data.item_types) == null ? void 0 : _l.length) > 0 ? /* @__PURE__ */ QuestionInfo_React.createElement(row/* default */.Z, { wrap: false }, /* @__PURE__ */ QuestionInfo_React.createElement(col/* default */.Z, { flex: "260px", className: QuestionInfomodules.leftPart }, !disabled && /* @__PURE__ */ QuestionInfo_React.createElement(row/* default */.Z, { className: "mb20" }, /* @__PURE__ */ QuestionInfo_React.createElement(ui_customization/* CustomButton */.op, { style: { margin: "0 15px", borderRadius: 2 }, onClick: () => setVisibleModalType("setScore") }, "\u6279\u91CF\u8BBE\u7F6E\u5206\u503C"), (urlParams == null ? void 0 : urlParams.id) && /* @__PURE__ */ QuestionInfo_React.createElement(ui_customization/* CustomButton */.op, { shape: "default", onClick: () => setVisibleModalType("questionType") }, "\u6DFB\u52A0\u9898\u578B")), /* @__PURE__ */ QuestionInfo_React.createElement(
|
|
QuestionInfo_QuestionList,
|
|
{
|
|
list: data.item_types,
|
|
onSelect: (itemType) => QuestionInfo_async(void 0, null, function* () {
|
|
if (itemType === currentItemType) {
|
|
return;
|
|
}
|
|
setLoading(true);
|
|
const currentItem = data.item_types.find((item) => item.item_type === currentItemType);
|
|
if (currentItemType !== "PRACTICAL" && currentItem.contents.length > 0 && (urlParams == null ? void 0 : urlParams.id)) {
|
|
const dataCopy = (0,lodash.cloneDeep)(data);
|
|
const { item_types } = dataCopy || {};
|
|
dataCopy.item_types = item_types.filter((item) => item.item_type === currentItemType);
|
|
try {
|
|
let res = yield updateRandomExam(urlParams.id || urlParams.categoryId, dataCopy);
|
|
if (res.status === 0) {
|
|
setCurrentItemType(itemType);
|
|
}
|
|
} catch (e) {
|
|
}
|
|
} else {
|
|
if (urlParams.categoryId) {
|
|
handleExerciseSave(true, 2, itemType);
|
|
} else {
|
|
handleSave(true);
|
|
}
|
|
}
|
|
setLoading(false);
|
|
}),
|
|
onDelete: handleDelete
|
|
}
|
|
)), /* @__PURE__ */ QuestionInfo_React.createElement(col/* default */.Z, { flex: 1, className: QuestionInfomodules.rightPart }, /* @__PURE__ */ QuestionInfo_React.createElement(spin/* default */.Z, { spinning: loading }, /* @__PURE__ */ QuestionInfo_React.createElement(
|
|
QuestionInfo_QuestionDetail,
|
|
{
|
|
setVisibleModalType,
|
|
currentItemType,
|
|
onDelete: handleDelete
|
|
}
|
|
)))) : /* @__PURE__ */ QuestionInfo_React.createElement(
|
|
NoData/* default */.Z,
|
|
{
|
|
customText: "\u8BF7\u5148\u8BBE\u7F6E\u8BD5\u5377\u9898\u578B",
|
|
styles: { margin: "70px auto" },
|
|
ButtonTwo: /* @__PURE__ */ QuestionInfo_React.createElement(row/* default */.Z, { justify: "center", className: "mt20" }, (urlParams == null ? void 0 : urlParams.id) && /* @__PURE__ */ QuestionInfo_React.createElement(ui_customization/* CustomButton */.op, { style: { width: 88 }, onClick: () => setVisibleModalType("questionType") }, "\u6DFB\u52A0\u9898\u578B"))
|
|
}
|
|
)), !!(urlParams == null ? void 0 : urlParams.id) && /* @__PURE__ */ QuestionInfo_React.createElement("div", { className: QuestionInfomodules.fixedBottom }, /* @__PURE__ */ QuestionInfo_React.createElement(
|
|
AsyncButton/* AsyncButton */.Z,
|
|
{
|
|
className: `${QuestionInfomodules.previewBtn} mr20`,
|
|
onClick: () => QuestionInfo_async(void 0, null, function* () {
|
|
var _a2, _b2;
|
|
const items = (_a2 = data == null ? void 0 : data.item_types) == null ? void 0 : _a2.filter((item) => {
|
|
var _a3, _b3;
|
|
return ((_a3 = item.contents) == null ? void 0 : _a3.length) > 0 || ((_b3 = item == null ? void 0 : item.item_banks) == null ? void 0 : _b3.length) > 0;
|
|
});
|
|
if (!((_b2 = data.item_types) == null ? void 0 : _b2.length)) {
|
|
message/* default */.ZP.warning("\u8BD5\u9898\u603B\u6570=0\uFF0C\u8BF7\u5148\u8BBE\u7F6E\u62BD\u9898\u89C4\u5219");
|
|
return;
|
|
}
|
|
if ((items == null ? void 0 : items.length) === 0) {
|
|
message/* default */.ZP.warning("\u8BD5\u9898\u603B\u6570=0\uFF0C\u8BF7\u5148\u8BBE\u7F6E\u62BD\u9898\u89C4\u5219");
|
|
return;
|
|
}
|
|
let res = yield handleSave(true);
|
|
if ((res == null ? void 0 : res.status) === 0) {
|
|
yield handlePreview();
|
|
}
|
|
})
|
|
},
|
|
"\u8BD5\u5377\u9884\u89C8"
|
|
), /* @__PURE__ */ QuestionInfo_React.createElement(AsyncButton/* AsyncButton */.Z, { type: "primary", className: QuestionInfomodules.confirmBtn, onClick: () => handleSave() }, /* @__PURE__ */ QuestionInfo_React.createElement("i", { className: "iconfont icon-baocun1 mr5" }), "\u4FDD\u5B58\u8BD5\u5377")), !!(urlParams == null ? void 0 : urlParams.categoryId) && /* @__PURE__ */ QuestionInfo_React.createElement("div", { className: QuestionInfomodules.fixedBottom }, /* @__PURE__ */ QuestionInfo_React.createElement(
|
|
AsyncButton/* AsyncButton */.Z,
|
|
{
|
|
className: `${QuestionInfomodules.previewBtn} mr20`,
|
|
onClick: () => QuestionInfo_async(void 0, null, function* () {
|
|
var _a2, _b2;
|
|
document.body.scrollIntoView();
|
|
_umi_production_exports.history.push(`/classrooms/${urlParams.coursesId}/exercise/${(_a2 = data == null ? void 0 : data.exercise) == null ? void 0 : _a2.id}/detail?random=${(_b2 = data == null ? void 0 : data.exercise) == null ? void 0 : _b2.is_random}`);
|
|
})
|
|
},
|
|
"\u8FD4\u56DE"
|
|
), /* @__PURE__ */ QuestionInfo_React.createElement(
|
|
AsyncButton/* AsyncButton */.Z,
|
|
{
|
|
className: `${QuestionInfomodules.previewBtn} mr20`,
|
|
onClick: handlePracticeTest
|
|
},
|
|
"\u6A21\u62DF\u8003\u8BD5"
|
|
), /* @__PURE__ */ QuestionInfo_React.createElement(AsyncButton/* AsyncButton */.Z, { type: "primary", className: QuestionInfomodules.confirmBtn, onClick: () => handleExerciseSave() }, "\u63D0\u4EA4")), /* @__PURE__ */ QuestionInfo_React.createElement(
|
|
QuestionInfo_QuestionTypeModal,
|
|
{
|
|
open: visibleModalType === "questionType",
|
|
onCancel: () => setVisibleModalType(""),
|
|
onOk: (selectedQuestionType) => QuestionInfo_async(void 0, null, function* () {
|
|
var _a2, _b2;
|
|
const deletedItemTypes = [];
|
|
const nextState = reducer(data, { type: "setQuestionType", payload: selectedQuestionType });
|
|
const nextItemTypes = ((_a2 = nextState == null ? void 0 : nextState.item_types) == null ? void 0 : _a2.map((item) => item.item_type)) || [];
|
|
for (const itemType of ((_b2 = data == null ? void 0 : data.item_types) == null ? void 0 : _b2.map((item) => item.item_type)) || []) {
|
|
if (!nextItemTypes.includes(itemType)) {
|
|
deletedItemTypes.push(itemType);
|
|
}
|
|
}
|
|
if (urlParams.id && deletedItemTypes.length > 0) {
|
|
const res = yield deleteItem(urlParams.id, { item_type: deletedItemTypes });
|
|
if (res.status !== 0) {
|
|
return;
|
|
}
|
|
}
|
|
dispatch({ type: "setQuestionType", payload: selectedQuestionType });
|
|
setCurrentItemType(currentItemType ? currentItemType : nextState.item_types[0].item_type);
|
|
setVisibleModalType("");
|
|
})
|
|
}
|
|
), /* @__PURE__ */ QuestionInfo_React.createElement(
|
|
SetScoreModal,
|
|
{
|
|
open: visibleModalType === "setScore",
|
|
onCancel: () => {
|
|
setVisibleModalType("");
|
|
},
|
|
onOk: (newData) => QuestionInfo_async(void 0, null, function* () {
|
|
console.log("---newData", newData);
|
|
const scoreSettings = newData.item_types.map((item) => ({ item_type: item.item_type, score: item.score }));
|
|
if (urlParams.id) {
|
|
const res = yield setItemTypeScore(urlParams.id, { score_settings: scoreSettings });
|
|
if (res.status === 0) {
|
|
dispatch({ type: "init", payload: newData });
|
|
}
|
|
} else {
|
|
const res = yield setItemTypeScores(urlParams.categoryId, { score_settings: scoreSettings });
|
|
if (res.status === 0) {
|
|
dispatch({ type: "init", payload: newData });
|
|
}
|
|
}
|
|
setVisibleModalType("");
|
|
})
|
|
}
|
|
), /* @__PURE__ */ QuestionInfo_React.createElement(
|
|
QuestionInfo_RuleModal,
|
|
{
|
|
open: visibleModalType === "rule",
|
|
onCancel: () => setVisibleModalType(""),
|
|
currentItemType,
|
|
setVisibleModalType
|
|
}
|
|
), searchParams.get("type") === "settings" && /* @__PURE__ */ QuestionInfo_React.createElement(
|
|
QuestionInfo_SelectShixunModal,
|
|
{
|
|
open: visibleModalType === "selectShixun",
|
|
onCancel: () => setVisibleModalType(""),
|
|
onOk: (selectedRows) => {
|
|
console.log(selectedRows);
|
|
if ((selectedRows == null ? void 0 : selectedRows.length) <= 0) {
|
|
message/* default */.ZP.info("\u5B9E\u8BAD\u6570\u4E0D\u80FD\u4E3A0");
|
|
return;
|
|
}
|
|
dispatch({ type: "addShixun", payload: { shixunList: [...selectedRows] } });
|
|
setVisibleModalType("");
|
|
}
|
|
}
|
|
));
|
|
};
|
|
/* harmony default export */ var Edit_QuestionInfo = (QuestionInfo);
|
|
|
|
// EXTERNAL MODULE: ./src/pages/Paperlibrary/Random/AddAndEdit/components/StepPreview/index.tsx + 19 modules
|
|
var StepPreview = __webpack_require__(89296);
|
|
;// CONCATENATED MODULE: ./src/pages/Paperlibrary/Random/Edit/index.tsx
|
|
/* provided dependency */ var Edit_React = __webpack_require__(/*! react */ 59301);
|
|
var Edit_defProp = Object.defineProperty;
|
|
var Edit_defProps = Object.defineProperties;
|
|
var Edit_getOwnPropDescs = Object.getOwnPropertyDescriptors;
|
|
var Edit_getOwnPropSymbols = Object.getOwnPropertySymbols;
|
|
var Edit_hasOwnProp = Object.prototype.hasOwnProperty;
|
|
var Edit_propIsEnum = Object.prototype.propertyIsEnumerable;
|
|
var Edit_defNormalProp = (obj, key, value) => key in obj ? Edit_defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
|
|
var Edit_spreadValues = (a, b) => {
|
|
for (var prop in b || (b = {}))
|
|
if (Edit_hasOwnProp.call(b, prop))
|
|
Edit_defNormalProp(a, prop, b[prop]);
|
|
if (Edit_getOwnPropSymbols)
|
|
for (var prop of Edit_getOwnPropSymbols(b)) {
|
|
if (Edit_propIsEnum.call(b, prop))
|
|
Edit_defNormalProp(a, prop, b[prop]);
|
|
}
|
|
return a;
|
|
};
|
|
var Edit_spreadProps = (a, b) => Edit_defProps(a, Edit_getOwnPropDescs(b));
|
|
var Edit_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 RandomPaperEdit = () => {
|
|
var _a, _b, _c, _d;
|
|
const [currentKey, setCurrentKey] = (0,_react_17_0_2_react.useState)("baseInfo");
|
|
const dvaDispatch = (0,_umi_production_exports.useDispatch)();
|
|
(0,_react_17_0_2_react.useEffect)(() => {
|
|
dvaDispatch({
|
|
type: "globalSetting/footerToggle",
|
|
payload: false
|
|
});
|
|
}, []);
|
|
const urlParams = (0,_umi_production_exports.useParams)();
|
|
const isEdit = !!(urlParams.id || urlParams.categoryId);
|
|
const [searchParams] = (0,_umi_production_exports.useSearchParams)();
|
|
(0,_react_17_0_2_react.useEffect)(() => {
|
|
if (searchParams.get("type") === "settings") {
|
|
setCurrentKey("settings");
|
|
}
|
|
}, []);
|
|
const [data, dispatch] = (0,_react_17_0_2_react.useReducer)(reducer, null);
|
|
const [loading, setLoading] = (0,_react_17_0_2_react.useState)(false);
|
|
const getData = () => Edit_async(void 0, null, function* () {
|
|
setLoading(true);
|
|
let res;
|
|
if (urlParams.categoryId) {
|
|
res = yield getExerciseRandomExam(urlParams);
|
|
} else {
|
|
res = yield getRandomExam(urlParams.id);
|
|
}
|
|
setLoading(false);
|
|
if (res.status === 0) {
|
|
dispatch({ type: "init", payload: res });
|
|
}
|
|
});
|
|
(0,_react_17_0_2_react.useEffect)(() => {
|
|
if (isEdit) {
|
|
getData();
|
|
} else {
|
|
dispatch({
|
|
type: "init",
|
|
payload: {
|
|
examination_bank: {
|
|
difficulty: 2
|
|
}
|
|
}
|
|
});
|
|
}
|
|
}, [urlParams]);
|
|
const [clearData, setClearData] = (0,_react_17_0_2_react.useState)("");
|
|
const handlePreview = (record, other) => Edit_async(void 0, null, function* () {
|
|
var _a2, _b2, _c2, _d2;
|
|
const new_item_types = (_a2 = data == null ? void 0 : data.item_types) == null ? void 0 : _a2.filter((e) => {
|
|
var _a3;
|
|
return ((_a3 = e == null ? void 0 : e.item_type) == null ? void 0 : _a3.toUpperCase()) === (other == null ? void 0 : other.type);
|
|
});
|
|
const body = {
|
|
sort_by_item_type: data.sort_by_item_type,
|
|
difficulty: data.examination_bank.difficulty,
|
|
exam_notes: data.examination_bank.exam_notes,
|
|
name: data.examination_bank.name,
|
|
time: data.examination_bank.time,
|
|
item_types: data.item_types
|
|
};
|
|
if (record !== void 0 && !(record == null ? void 0 : record.single_question_id)) {
|
|
body.seleted_item_bank_ids = record == null ? void 0 : record.seleted_item_bank_ids;
|
|
body.item_types = new_item_types;
|
|
const res2 = yield toggleRandomQuestions(body);
|
|
if ((res2 == null ? void 0 : res2.status) === 0) {
|
|
let clonePreviewData = (0,lodash.cloneDeep)(preview.data);
|
|
clonePreviewData.questionList = (_b2 = clonePreviewData == null ? void 0 : clonePreviewData.questionList) == null ? void 0 : _b2.map((e) => {
|
|
var _a3;
|
|
if (e.type === other.type) {
|
|
return Edit_spreadProps(Edit_spreadValues({}, e), { questions: ((_a3 = res2 == null ? void 0 : res2.questions) == null ? void 0 : _a3.questions) || [] });
|
|
}
|
|
return e;
|
|
});
|
|
setPreview({ show: true, data: clonePreviewData });
|
|
}
|
|
return;
|
|
}
|
|
if (record !== void 0 && (record == null ? void 0 : record.single_question_id)) {
|
|
body.seleted_item_bank_ids = record == null ? void 0 : record.seleted_item_bank_ids;
|
|
body.single_question_id = record == null ? void 0 : record.single_question_id;
|
|
body.item_types = new_item_types;
|
|
const res2 = yield toggleRandomQuestions(body);
|
|
if ((res2 == null ? void 0 : res2.status) === 0) {
|
|
let clonePreviewData = (0,lodash.cloneDeep)(preview.data);
|
|
clonePreviewData.questionList = (_c2 = clonePreviewData == null ? void 0 : clonePreviewData.questionList) == null ? void 0 : _c2.map((e) => {
|
|
var _a3, _b3;
|
|
if (e.type === other.type) {
|
|
const new_questions = (0,lodash.cloneDeep)(e == null ? void 0 : e.questions);
|
|
new_questions.splice(other.index, 1, (_b3 = (_a3 = res2 == null ? void 0 : res2.questions) == null ? void 0 : _a3.questions) == null ? void 0 : _b3[0]);
|
|
console.log(e == null ? void 0 : e.questions, new_questions, other.index, "new_questions");
|
|
return Edit_spreadProps(Edit_spreadValues({}, e), {
|
|
questions: new_questions
|
|
});
|
|
}
|
|
return e;
|
|
});
|
|
setPreview({ show: true, data: clonePreviewData });
|
|
}
|
|
return;
|
|
}
|
|
const res = yield previewRandomPaper(body);
|
|
if ((res == null ? void 0 : res.status) === 0) {
|
|
const paperData = (0,utils_util/* formatRandomPaperData */.ad)(res);
|
|
let sortList = [];
|
|
(_d2 = data == null ? void 0 : data.item_types) == null ? void 0 : _d2.forEach((e) => {
|
|
var _a3;
|
|
const param = (_a3 = paperData == null ? void 0 : paperData.questionList) == null ? void 0 : _a3.find((k) => e.item_type === k.type);
|
|
sortList.push(param);
|
|
});
|
|
console.log(data, "sortList");
|
|
sortList = (0,lodash.compact)(sortList);
|
|
paperData.questionList = sortList;
|
|
setPreview({ show: true, data: paperData });
|
|
setClearData(/* @__PURE__ */ new Date());
|
|
}
|
|
});
|
|
const handleTypeScore = (item) => {
|
|
var _a2;
|
|
let clonePreviewData = (0,lodash.cloneDeep)(preview.data);
|
|
clonePreviewData.questionList = (_a2 = clonePreviewData == null ? void 0 : clonePreviewData.questionList) == null ? void 0 : _a2.map((e) => {
|
|
if (e.type === item.type) {
|
|
return Edit_spreadProps(Edit_spreadValues({}, e), { questions_score: item.scoreTotal });
|
|
}
|
|
return e;
|
|
});
|
|
dispatch({ type: "changeQuestionScore", payload: { score: item.score, itemType: item.type } });
|
|
setPreview({ show: true, data: clonePreviewData });
|
|
};
|
|
const handleSubmit = (record) => Edit_async(void 0, null, function* () {
|
|
const body = {
|
|
sort_by_item_type: data.sort_by_item_type,
|
|
difficulty: data.examination_bank.difficulty,
|
|
exam_notes: data.examination_bank.exam_notes,
|
|
name: data.examination_bank.name,
|
|
time: data.examination_bank.time,
|
|
item_types: data.item_types,
|
|
sub_discipline_id: data.examination_bank.sub_discipline_id
|
|
};
|
|
if (record) {
|
|
const res2 = yield saveQuestionList(Edit_spreadValues(Edit_spreadValues({}, body), record));
|
|
if (res2.status === 0) {
|
|
message/* default */.ZP.success("\u4FDD\u5B58\u6210\u529F");
|
|
}
|
|
return;
|
|
}
|
|
const res = yield updateRandomExam(urlParams.id, body);
|
|
if (res.status === 0) {
|
|
message/* default */.ZP.success("\u63D0\u4EA4\u6210\u529F");
|
|
_umi_production_exports.history.push("/paperlibrary?defaultActiveKey=0");
|
|
}
|
|
});
|
|
const courseOptions = useCourseOptions();
|
|
const [baseInfoForm] = es_form["default"].useForm();
|
|
const [preview, setPreview] = (0,_react_17_0_2_react.useState)({ show: false, data: {} });
|
|
const disabled = !!((_a = data == null ? void 0 : data.exercise) == null ? void 0 : _a.exercise_status) && ((_b = data == null ? void 0 : data.exercise) == null ? void 0 : _b.exercise_status) !== 1;
|
|
return /* @__PURE__ */ Edit_React.createElement(DataContext.Provider, { value: { data, disabled, dispatch, setPreview, getData, handlePreview } }, preview.show ? /* @__PURE__ */ Edit_React.createElement(
|
|
StepPreview/* default */.Z,
|
|
{
|
|
key: clearData,
|
|
data: preview.data,
|
|
onExchange: handlePreview,
|
|
onTypeScore: handleTypeScore,
|
|
submit: handleSubmit,
|
|
goBack: () => setPreview({ show: false, data: {} })
|
|
}
|
|
) : /* @__PURE__ */ Edit_React.createElement("div", { className: Editmodules.wrapper }, /* @__PURE__ */ Edit_React.createElement("div", { className: "edu-container" }, /* @__PURE__ */ Edit_React.createElement(
|
|
breadcrumb/* default */.Z,
|
|
{
|
|
className: Editmodules.breadCrumbWrapper,
|
|
separator: ">",
|
|
items: (urlParams == null ? void 0 : urlParams.categoryId) ? [
|
|
{
|
|
title: /* @__PURE__ */ Edit_React.createElement(_umi_production_exports.Link, { to: `/classrooms/${urlParams.coursesId}/exercise` }, (_d = (_c = (0,authority/* userInfo */.eY)()) == null ? void 0 : _c.course) == null ? void 0 : _d.course_name)
|
|
},
|
|
{
|
|
title: /* @__PURE__ */ Edit_React.createElement(_umi_production_exports.Link, { to: `/classrooms/${urlParams.coursesId}/exercise` }, "\u8BD5\u5377\u5217\u8868")
|
|
},
|
|
{
|
|
title: "\u7F16\u8F91\u8BD5\u5377"
|
|
}
|
|
] : [
|
|
{
|
|
title: /* @__PURE__ */ Edit_React.createElement(_umi_production_exports.Link, { to: `/paperlibrary` }, "\u8BD5\u5377\u5E93")
|
|
},
|
|
{
|
|
title: "\u968F\u673A\u7EC4\u5377"
|
|
}
|
|
]
|
|
}
|
|
), /* @__PURE__ */ Edit_React.createElement(
|
|
PaperTab,
|
|
{
|
|
activeKey: currentKey,
|
|
tabs: [
|
|
{ key: "baseInfo", label: "\u8BD5\u5377\u57FA\u7840\u4FE1\u606F" },
|
|
{ key: "settings", label: "\u7EC4\u5377\u914D\u7F6E" }
|
|
],
|
|
onChange: (key) => Edit_async(void 0, null, function* () {
|
|
if (key === "settings") {
|
|
yield baseInfoForm.validateFields();
|
|
if (!isEdit) {
|
|
const res = yield createRandomExam(data);
|
|
if (res.status === 0) {
|
|
_umi_production_exports.history.replace(`/randompaper/edit/${res == null ? void 0 : res.examination_bank_id}?type=settings`);
|
|
}
|
|
}
|
|
}
|
|
setCurrentKey(key);
|
|
})
|
|
}
|
|
), currentKey === "baseInfo" && /* @__PURE__ */ Edit_React.createElement(
|
|
Edit_BaseInfo,
|
|
{
|
|
courseOptions,
|
|
setCurrentKey,
|
|
loading,
|
|
form: baseInfoForm
|
|
}
|
|
), /* @__PURE__ */ Edit_React.createElement("div", { style: { display: currentKey === "settings" ? "block" : "none" } }, data && /* @__PURE__ */ Edit_React.createElement(Edit_QuestionInfo, null)))));
|
|
};
|
|
/* harmony default export */ var Edit = (RandomPaperEdit);
|
|
|
|
|
|
/***/ }),
|
|
|
|
/***/ 19434:
|
|
/*!*********************************************!*\
|
|
!*** ./src/utils/hooks/useCustomRequest.ts ***!
|
|
\*********************************************/
|
|
/***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) {
|
|
|
|
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
|
|
/* harmony export */ U: function() { return /* binding */ useCustomRequest; }
|
|
/* harmony export */ });
|
|
/* 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;
|
|
};
|
|
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());
|
|
});
|
|
};
|
|
|
|
function useCustomRequest(request, baseParams) {
|
|
const [params, setParams] = (0,react__WEBPACK_IMPORTED_MODULE_0__.useState)(baseParams);
|
|
const [loading, setLoading] = (0,react__WEBPACK_IMPORTED_MODULE_0__.useState)(false);
|
|
const [data, setData] = (0,react__WEBPACK_IMPORTED_MODULE_0__.useState)();
|
|
const getData = (newParams, reset = false) => __async(this, null, function* () {
|
|
const mergedParams = reset ? baseParams : __spreadValues(__spreadValues({}, params), newParams);
|
|
setLoading(true);
|
|
setParams(mergedParams);
|
|
const res = yield request(mergedParams);
|
|
setLoading(false);
|
|
setData(res);
|
|
return res;
|
|
});
|
|
return [params, loading, getData, data];
|
|
}
|
|
|
|
|
|
|
|
/***/ }),
|
|
|
|
/***/ 73631:
|
|
/*!********************************************************!*\
|
|
!*** ./src/assets/images/problemset/folder-closed.png ***!
|
|
\********************************************************/
|
|
/***/ (function(module) {
|
|
|
|
module.exports = "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABQAAAAUCAYAAACNiR0NAAAAAXNSR0IArs4c6QAAAZxJREFUOBGtlL1Ow0AMgH2XUIkOLFXVASgTsDHxBIAEzAwMPBQjT8AATGVBgEBCYmHmFcICYmBogCbNYSe52HUTVZWwFJ3PP599Z+WMcy6Af5SwYkWnLYifTyBzq5XNK8YNwbbvYP381ZuaVlN1+HJwAc4d1QYaA+gDsHYANrhGHTdCMtSDMILtwSMDn7ZiANPKwyjeQ0Reo4r1gEoEwRkDb7spdPcBeocMk1Cv00oii5L+fgPwcR/zHfb3AJY2sEpUVLOUhB/l+w7I1iS9TYDFrM3AzhqGDstPZ3li2Z12U2WLvk4fGJh+F0elYN8ZrbWiA7igAP4WR6sFzDAKPgPHP0VnlMsFS5IyyIGoeAamCKybYI5UQLWVE2fgGI/s72wqQXRd9jyxiHgGJtihFxGQm8Qd5XvtF3fEQOrQH9mDm1Z9hyJuEphXIq9uSWSQqv8a4RbAUTFdcs7gifwplYGjT3wzbPFz6Q70EZv8WZoxMP66ApMc86inirNBA8njcFIuvOTXhowPyzuQJiukzi3hQgS7b+I9nJtQn/AHsLGsvlcPPWsAAAAASUVORK5CYII=";
|
|
|
|
/***/ }),
|
|
|
|
/***/ 31328:
|
|
/*!*************************************************!*\
|
|
!*** ./src/assets/images/problemset/folder.png ***!
|
|
\*************************************************/
|
|
/***/ (function(module) {
|
|
|
|
module.exports = "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABQAAAAUCAYAAACNiR0NAAAAAXNSR0IArs4c6QAAAodJREFUOBGtU0trFEEQ/qZnM5NsWBCfSEjwQdSggmAieAv4uOnFg5eIXgTvEY+ePJqToDf9AcZDFAUF8SgEQUxAjC6+QlhX4xo0G93ZnRnr697umSyKBCyY/aqqq76q6uoF/rN4lu/BmzSsLGFM7P4kAZQCiBTR64nCw/MHvRnj+fuvI7zxtDWJJD1lQulO5TPHnkAqpuAUFKZUqg8da8xI35+/cMh77AjHJ5cakh/oqHa2ZhGHpSb+STxJZA3lqesFG1CuLAdsqLfbb/dlTwQ7GdmG9VGVBuoNfT/nHGHUSnByeAN2binmmDK1gyM7aGvl6gruPvtadCOfvVlxN0PFjsF4qxMptjl7BflirsPAVxJoQjy5eUMqq6bkMgbWF7C4HGMlsnRmZE82xtEdYSwGnRTuhCvVqG3T8bGhHpweKaFWj3HpzqI7Z16SmHxHmKbcVE7yBs+k1uBm8wh6Q4VQJvrZMkEp98EGBB2h3pFUMWJmPLKniKGtXZhZiLC/L8CLhQbmqhHefmmi3pRYOwInY65gRiiM+ZEP9Ic4c7ik+Ye3dePK/W94/bmpbVNO4u2S2rmrOmRvtkEmlHraC9EUgEzo/optVwZM4IiCLivR1WhywwrT75p4WYlkqhTT7xs4vreIke2h3KWHTaUClC/ZnsR3fOTWMnarZi/QulYhr2l0MMDorhA7NhbwodbC5Xs/9FT5d+s6lJJSzHxWJ9ov9Xw8KceYX9LrQ9+6LF6pgs4luqVIIl+G69gp0id1tk+8/byJ77+AV9UEiRTJMnQMOYycuPZpNuhS+7TF+fgkiBSr55+J9eXOm1E86wjpPzrx8aI8hd3U1yryrOcejQ9cXWveP+N/A79g8eaXNDk4AAAAAElFTkSuQmCC";
|
|
|
|
/***/ })
|
|
|
|
}]); |