|
|
"use strict";
|
|
|
(self["webpackChunk"] = self["webpackChunk"] || []).push([[23440],{
|
|
|
|
|
|
/***/ 23440:
|
|
|
/*!**************************************************************************************************************!*\
|
|
|
!*** ./src/pages/Classrooms/Lists/Exercise/Add/EditPotin/components/AddQuestionsModal/index.tsx + 3 modules ***!
|
|
|
\**************************************************************************************************************/
|
|
|
/***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) {
|
|
|
|
|
|
|
|
|
// EXPORTS
|
|
|
__webpack_require__.d(__webpack_exports__, {
|
|
|
Z: function() { return /* binding */ AddQuestionsModal; }
|
|
|
});
|
|
|
|
|
|
// EXTERNAL MODULE: ./node_modules/_@babel_runtime@7.23.6@@babel/runtime/helpers/regeneratorRuntime.js
|
|
|
var regeneratorRuntime = __webpack_require__(7557);
|
|
|
var regeneratorRuntime_default = /*#__PURE__*/__webpack_require__.n(regeneratorRuntime);
|
|
|
// EXTERNAL MODULE: ./node_modules/_@babel_runtime@7.23.6@@babel/runtime/helpers/createForOfIteratorHelper.js
|
|
|
var createForOfIteratorHelper = __webpack_require__(91232);
|
|
|
var createForOfIteratorHelper_default = /*#__PURE__*/__webpack_require__.n(createForOfIteratorHelper);
|
|
|
// EXTERNAL MODULE: ./node_modules/_@babel_runtime@7.23.6@@babel/runtime/helpers/toConsumableArray.js
|
|
|
var toConsumableArray = __webpack_require__(37205);
|
|
|
var toConsumableArray_default = /*#__PURE__*/__webpack_require__.n(toConsumableArray);
|
|
|
// EXTERNAL MODULE: ./node_modules/_@babel_runtime@7.23.6@@babel/runtime/helpers/asyncToGenerator.js
|
|
|
var asyncToGenerator = __webpack_require__(41498);
|
|
|
var asyncToGenerator_default = /*#__PURE__*/__webpack_require__.n(asyncToGenerator);
|
|
|
// EXTERNAL MODULE: ./node_modules/_@babel_runtime@7.23.6@@babel/runtime/helpers/objectSpread2.js
|
|
|
var objectSpread2 = __webpack_require__(82242);
|
|
|
var objectSpread2_default = /*#__PURE__*/__webpack_require__.n(objectSpread2);
|
|
|
// EXTERNAL MODULE: ./node_modules/_@babel_runtime@7.23.6@@babel/runtime/helpers/slicedToArray.js
|
|
|
var slicedToArray = __webpack_require__(79800);
|
|
|
var slicedToArray_default = /*#__PURE__*/__webpack_require__.n(slicedToArray);
|
|
|
// EXTERNAL MODULE: ./node_modules/_react@17.0.2@react/index.js
|
|
|
var _react_17_0_2_react = __webpack_require__(59301);
|
|
|
// EXTERNAL MODULE: ./node_modules/_antd@5.9.0@antd/es/form/index.js + 19 modules
|
|
|
var es_form = __webpack_require__(78241);
|
|
|
// EXTERNAL MODULE: ./node_modules/_antd@5.9.0@antd/es/modal/index.js + 16 modules
|
|
|
var modal = __webpack_require__(43418);
|
|
|
// EXTERNAL MODULE: ./node_modules/_antd@5.9.0@antd/es/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/cascader/index.js + 18 modules
|
|
|
var cascader = __webpack_require__(19842);
|
|
|
// EXTERNAL MODULE: ./node_modules/_antd@5.9.0@antd/es/input/index.js + 5 modules
|
|
|
var input = __webpack_require__(36920);
|
|
|
// EXTERNAL MODULE: ./node_modules/_antd@5.9.0@antd/es/table/index.js + 85 modules
|
|
|
var table = __webpack_require__(2595);
|
|
|
// 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/pagination/index.js + 10 modules
|
|
|
var pagination = __webpack_require__(25700);
|
|
|
// EXTERNAL MODULE: ./node_modules/_antd@5.9.0@antd/es/button/index.js
|
|
|
var es_button = __webpack_require__(3113);
|
|
|
// EXTERNAL MODULE: ./node_modules/_antd@5.9.0@antd/es/message/index.js + 4 modules
|
|
|
var message = __webpack_require__(8591);
|
|
|
// EXTERNAL MODULE: ./src/utils/fetch.ts
|
|
|
var fetch = __webpack_require__(82710);
|
|
|
;// CONCATENATED MODULE: ./src/pages/Classrooms/Lists/Exercise/Add/EditPotin/components/AddQuestionsModal/index.less?modules
|
|
|
// extracted by mini-css-extract-plugin
|
|
|
/* harmony default export */ var AddQuestionsModalmodules = ({"flex_box_center":"flex_box_center___aDsO9","flex_space_between":"flex_space_between___5V4Xk","flex_box_vertical_center":"flex_box_vertical_center___rNdEP","flex_box_center_end":"flex_box_center_end___cKjnr","flex_box_column":"flex_box_column___glFYD","scoremodal":"scoremodal___PfqOf","selectWrapper":"selectWrapper___Mtqcz","allqingchu":"allqingchu___IqL8g","title":"title___UgYfD","score":"score___LjJmD","close":"close___I0jAO","content":"content___4u86F","items":"items___mK2L5","bottom":"bottom___vQTEm","yes":"yes___j81JQ","no":"no___kiUH4","titlecount":"titlecount___lliQr","add":"add___QhDj8","search":"search___QCCaL","searchIcon":"searchIcon___oXRH5","tabWrap":"tabWrap___Cu_4D","previewModal":"previewModal___BVDlS"});
|
|
|
// EXTERNAL MODULE: ./src/models/problemset/util.ts
|
|
|
var util = __webpack_require__(66020);
|
|
|
;// CONCATENATED MODULE: ./src/pages/Classrooms/Lists/Exercise/Add/EditPotin/components/AddQuestionsModal/Saveitem.less?modules
|
|
|
// extracted by mini-css-extract-plugin
|
|
|
/* harmony default export */ var Saveitemmodules = ({"flex_box_center":"flex_box_center___zojHa","flex_space_between":"flex_space_between___wmLZ4","flex_box_vertical_center":"flex_box_vertical_center___DszWW","flex_box_center_end":"flex_box_center_end___mVCv5","flex_box_column":"flex_box_column___fbC9t","warp":"warp___isAcM","mainPart":"mainPart___TiJvQ","shixunbutton":"shixunbutton___h3Ybb","redio":"redio___xDffb","redioitem":"redioitem___FFPtq","redioitemyes":"redioitemyes___pF7ID","title":"title___mnPZc","titleyes":"titleyes___wrtWQ","yestag":"yestag___D4krY","qcount":"qcount___W5pwO","score":"score___eKQzl","qtitle":"qtitle___lb8MD","checkbox":"checkbox___QpUm4","checkboxitem":"checkboxitem___Wm2SH","checkboxitemyes":"checkboxitemyes___VVVTe","bottom":"bottom___Mn_Bw","bottomitem":"bottomitem___JTyHT","left":"left___nQqpo","right":"right___v58qy","completion":"completion___BnZSp","content":"content___MU8hZ","items":"items___a7i54","simple":"simple___GDw3K","shixun":"shixun___DGzTe","combination":"combination___AG9cr"});
|
|
|
// EXTERNAL MODULE: ./src/components/RenderHtml/index.tsx + 2 modules
|
|
|
var RenderHtml = __webpack_require__(85681);
|
|
|
// EXTERNAL MODULE: ./src/utils/util.tsx
|
|
|
var utils_util = __webpack_require__(95972);
|
|
|
// EXTERNAL MODULE: ./node_modules/_js-base64@2.6.4@js-base64/base64.js
|
|
|
var base64 = __webpack_require__(24334);
|
|
|
// EXTERNAL MODULE: ./node_modules/_react@17.0.2@react/jsx-runtime.js
|
|
|
var jsx_runtime = __webpack_require__(37712);
|
|
|
;// CONCATENATED MODULE: ./src/pages/Classrooms/Lists/Exercise/Add/EditPotin/components/AddQuestionsModal/SaveItem.tsx
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
//数组对应值
|
|
|
var tagDotData = ['A.', 'B.', 'C.', 'D.', 'E.', 'F.', 'G.', 'H.', 'I.', 'J.', 'K.', 'L.', 'M.', 'N.', 'O.', 'P.', 'Q.', 'R.', 'S.', 'T.', 'U.', 'V.', 'W.', 'X.', 'Y.', 'Z.'];
|
|
|
var DragQuestions = function DragQuestions(_ref) {
|
|
|
var _qitem$program_attr, _qitem$choices, _qitem$choices2, _qitem$standard_answe, _qitem$answer_texts, _qitem$challenge_name, _qitem$program_attr2, _qitem$sub_item_banks, _qitem$program_attr3;
|
|
|
var qitem = _ref.qitem;
|
|
|
return /*#__PURE__*/(0,jsx_runtime.jsxs)("div", {
|
|
|
className: Saveitemmodules.warp,
|
|
|
children: [/*#__PURE__*/(0,jsx_runtime.jsxs)("div", {
|
|
|
className: Saveitemmodules.mainPart,
|
|
|
children: [/*#__PURE__*/(0,jsx_runtime.jsxs)("div", {
|
|
|
className: Saveitemmodules.qcount,
|
|
|
children: [(qitem === null || qitem === void 0 ? void 0 : qitem.question_type) === 8 && /*#__PURE__*/(0,jsx_runtime.jsx)(RenderHtml/* default */.Z, {
|
|
|
className: Saveitemmodules.content,
|
|
|
showProgramFill: true,
|
|
|
value: qitem === null || qitem === void 0 || (_qitem$program_attr = qitem.program_attr) === null || _qitem$program_attr === void 0 ? void 0 : _qitem$program_attr.description
|
|
|
}), (qitem === null || qitem === void 0 ? void 0 : qitem.question_type) != 8 && /*#__PURE__*/(0,jsx_runtime.jsx)(RenderHtml/* default */.Z, {
|
|
|
className: Saveitemmodules.qtitle,
|
|
|
value: (qitem === null || qitem === void 0 ? void 0 : qitem.name) || (qitem === null || qitem === void 0 ? void 0 : qitem.title)
|
|
|
})]
|
|
|
}), ((qitem === null || qitem === void 0 ? void 0 : qitem.question_type) === 0 || (qitem === null || qitem === void 0 ? void 0 : qitem.question_type) === 2) && /*#__PURE__*/(0,jsx_runtime.jsx)("div", {
|
|
|
children: qitem === null || qitem === void 0 || (_qitem$choices = qitem.choices) === null || _qitem$choices === void 0 ? void 0 : _qitem$choices.map(function (item, index) {
|
|
|
return /*#__PURE__*/(0,jsx_runtime.jsxs)("div", {
|
|
|
className: Saveitemmodules.redio,
|
|
|
children: [!(item !== null && item !== void 0 && item.is_answer) && /*#__PURE__*/(0,jsx_runtime.jsx)("span", {
|
|
|
className: Saveitemmodules.redioitem
|
|
|
}), (item === null || item === void 0 ? void 0 : item.is_answer) && /*#__PURE__*/(0,jsx_runtime.jsx)("i", {
|
|
|
className: "".concat(Saveitemmodules.redioitemyes, " icon-duigou1")
|
|
|
}), /*#__PURE__*/(0,jsx_runtime.jsx)(RenderHtml/* default */.Z, {
|
|
|
className: item !== null && item !== void 0 && item.is_answer ? Saveitemmodules.titleyes : Saveitemmodules.title,
|
|
|
value: tagDotData[index] + (item === null || item === void 0 ? void 0 : item.choice_text)
|
|
|
}), (item === null || item === void 0 ? void 0 : item.is_answer) && /*#__PURE__*/(0,jsx_runtime.jsx)("div", {
|
|
|
className: Saveitemmodules.yestag,
|
|
|
children: "\u6B63\u786E\u7B54\u6848"
|
|
|
})]
|
|
|
});
|
|
|
})
|
|
|
}), (qitem === null || qitem === void 0 ? void 0 : qitem.question_type) === 1 && /*#__PURE__*/(0,jsx_runtime.jsx)("div", {
|
|
|
children: qitem === null || qitem === void 0 || (_qitem$choices2 = qitem.choices) === null || _qitem$choices2 === void 0 ? void 0 : _qitem$choices2.map(function (item, index) {
|
|
|
return /*#__PURE__*/(0,jsx_runtime.jsxs)("div", {
|
|
|
className: Saveitemmodules.checkbox,
|
|
|
children: [!(item !== null && item !== void 0 && item.is_answer) && /*#__PURE__*/(0,jsx_runtime.jsx)("span", {
|
|
|
className: Saveitemmodules.checkboxitem
|
|
|
}), (item === null || item === void 0 ? void 0 : item.is_answer) && /*#__PURE__*/(0,jsx_runtime.jsx)("i", {
|
|
|
className: "".concat(Saveitemmodules.checkboxitemyes, " icon-duigou1")
|
|
|
}), /*#__PURE__*/(0,jsx_runtime.jsx)(RenderHtml/* default */.Z, {
|
|
|
className: item !== null && item !== void 0 && item.is_answer ? Saveitemmodules.titleyes : Saveitemmodules.title,
|
|
|
value: tagDotData[index] + (item === null || item === void 0 ? void 0 : item.choice_text)
|
|
|
}), (item === null || item === void 0 ? void 0 : item.is_answer) && /*#__PURE__*/(0,jsx_runtime.jsx)("div", {
|
|
|
className: Saveitemmodules.yestag,
|
|
|
children: "\u6B63\u786E\u7B54\u6848"
|
|
|
})]
|
|
|
});
|
|
|
})
|
|
|
}), (qitem === null || qitem === void 0 ? void 0 : qitem.question_type) === 3 && /*#__PURE__*/(0,jsx_runtime.jsx)("div", {
|
|
|
className: Saveitemmodules.completion,
|
|
|
children: qitem === null || qitem === void 0 || (_qitem$standard_answe = qitem.standard_answer) === null || _qitem$standard_answe === void 0 ? void 0 : _qitem$standard_answe.map(function (item, index) {
|
|
|
var _item$answer_text;
|
|
|
return /*#__PURE__*/(0,jsx_runtime.jsxs)("div", {
|
|
|
style: {
|
|
|
display: 'flex'
|
|
|
},
|
|
|
children: [/*#__PURE__*/(0,jsx_runtime.jsxs)("span", {
|
|
|
className: Saveitemmodules.title,
|
|
|
children: ["\u586B\u7A7A\u9879", index + 1]
|
|
|
}), /*#__PURE__*/(0,jsx_runtime.jsx)("div", {
|
|
|
className: Saveitemmodules.content,
|
|
|
children: item === null || item === void 0 || (_item$answer_text = item.answer_text) === null || _item$answer_text === void 0 ? void 0 : _item$answer_text.map(function (val, vindex) {
|
|
|
return /*#__PURE__*/(0,jsx_runtime.jsx)("div", {
|
|
|
className: Saveitemmodules.items,
|
|
|
children: val
|
|
|
});
|
|
|
})
|
|
|
})]
|
|
|
});
|
|
|
})
|
|
|
}), (qitem === null || qitem === void 0 ? void 0 : qitem.question_type) === 4 && /*#__PURE__*/(0,jsx_runtime.jsxs)("div", {
|
|
|
className: Saveitemmodules.simple,
|
|
|
children: [/*#__PURE__*/(0,jsx_runtime.jsx)("span", {
|
|
|
className: Saveitemmodules.title,
|
|
|
children: "\u53C2\u8003\u7B54\u6848"
|
|
|
}), /*#__PURE__*/(0,jsx_runtime.jsx)(RenderHtml/* default */.Z, {
|
|
|
className: Saveitemmodules.content,
|
|
|
value: (qitem === null || qitem === void 0 || (_qitem$answer_texts = qitem.answer_texts) === null || _qitem$answer_texts === void 0 ? void 0 : _qitem$answer_texts[0]) || '- -'
|
|
|
})]
|
|
|
}), (qitem === null || qitem === void 0 ? void 0 : qitem.question_type) === 5 && (qitem === null || qitem === void 0 || (_qitem$challenge_name = qitem.challenge_names) === null || _qitem$challenge_name === void 0 ? void 0 : _qitem$challenge_name.map(function (val, vindex) {
|
|
|
return /*#__PURE__*/(0,jsx_runtime.jsx)("div", {
|
|
|
className: Saveitemmodules.shixun,
|
|
|
children: /*#__PURE__*/(0,jsx_runtime.jsxs)("span", {
|
|
|
className: Saveitemmodules.qtitle,
|
|
|
children: [/*#__PURE__*/(0,jsx_runtime.jsxs)("span", {
|
|
|
style: {
|
|
|
marginRight: 10
|
|
|
},
|
|
|
children: ["\u7B2C", (0,utils_util/* toChineseNumber */.EM)(vindex + 1), "\u9898"]
|
|
|
}), val]
|
|
|
})
|
|
|
});
|
|
|
})), (qitem === null || qitem === void 0 ? void 0 : qitem.question_type) === 6 && /*#__PURE__*/(0,jsx_runtime.jsx)("div", {
|
|
|
className: Saveitemmodules.simple,
|
|
|
children: /*#__PURE__*/(0,jsx_runtime.jsx)(RenderHtml/* default */.Z, {
|
|
|
className: Saveitemmodules.content,
|
|
|
value: (qitem === null || qitem === void 0 || (_qitem$program_attr2 = qitem.program_attr) === null || _qitem$program_attr2 === void 0 ? void 0 : _qitem$program_attr2.description) || '- -'
|
|
|
})
|
|
|
}), (qitem === null || qitem === void 0 ? void 0 : qitem.question_type) === 7 && (qitem === null || qitem === void 0 || (_qitem$sub_item_banks = qitem.sub_item_banks) === null || _qitem$sub_item_banks === void 0 ? void 0 : _qitem$sub_item_banks.map(function (val, vndex) {
|
|
|
var _val$choices;
|
|
|
return /*#__PURE__*/(0,jsx_runtime.jsxs)("div", {
|
|
|
children: [/*#__PURE__*/(0,jsx_runtime.jsx)("div", {
|
|
|
className: Saveitemmodules.combination,
|
|
|
children: /*#__PURE__*/(0,jsx_runtime.jsx)("span", {
|
|
|
className: Saveitemmodules.qtitle,
|
|
|
children: val === null || val === void 0 ? void 0 : val.name
|
|
|
})
|
|
|
}), /*#__PURE__*/(0,jsx_runtime.jsx)("div", {
|
|
|
className: Saveitemmodules.warp,
|
|
|
style: {
|
|
|
padding: '0px',
|
|
|
paddingTop: 20
|
|
|
},
|
|
|
children: /*#__PURE__*/(0,jsx_runtime.jsx)("div", {
|
|
|
children: val === null || val === void 0 || (_val$choices = val.choices) === null || _val$choices === void 0 ? void 0 : _val$choices.map(function (item, index) {
|
|
|
return /*#__PURE__*/(0,jsx_runtime.jsxs)("div", {
|
|
|
className: Saveitemmodules.redio,
|
|
|
children: [!(item !== null && item !== void 0 && item.is_answer) && /*#__PURE__*/(0,jsx_runtime.jsx)("span", {
|
|
|
className: Saveitemmodules.redioitem
|
|
|
}), (item === null || item === void 0 ? void 0 : item.is_answer) && /*#__PURE__*/(0,jsx_runtime.jsx)("i", {
|
|
|
className: "".concat(Saveitemmodules.redioitemyes, " icon-duigou1")
|
|
|
}), /*#__PURE__*/(0,jsx_runtime.jsx)(RenderHtml/* default */.Z, {
|
|
|
className: item !== null && item !== void 0 && item.is_answer ? Saveitemmodules.titleyes : Saveitemmodules.title,
|
|
|
value: tagDotData[index] + (item === null || item === void 0 ? void 0 : item.choice_text)
|
|
|
}), (item === null || item === void 0 ? void 0 : item.is_answer) && /*#__PURE__*/(0,jsx_runtime.jsx)("div", {
|
|
|
className: Saveitemmodules.yestag,
|
|
|
children: "\u6B63\u786E\u7B54\u6848"
|
|
|
})]
|
|
|
});
|
|
|
})
|
|
|
})
|
|
|
})]
|
|
|
});
|
|
|
})), (qitem === null || qitem === void 0 ? void 0 : qitem.question_type) === 8 && /*#__PURE__*/(0,jsx_runtime.jsx)("div", {
|
|
|
children: /*#__PURE__*/(0,jsx_runtime.jsx)(RenderHtml/* default */.Z, {
|
|
|
disabledFill: true,
|
|
|
className: Saveitemmodules.content,
|
|
|
showProgramFill: true,
|
|
|
value: base64.Base64.decode((qitem === null || qitem === void 0 || (_qitem$program_attr3 = qitem.program_attr) === null || _qitem$program_attr3 === void 0 ? void 0 : _qitem$program_attr3.code) || '')
|
|
|
})
|
|
|
}), (qitem === null || qitem === void 0 ? void 0 : qitem.question_type) === 5 && /*#__PURE__*/(0,jsx_runtime.jsxs)("div", {
|
|
|
style: {
|
|
|
background: '#F6F7F9',
|
|
|
padding: '0px 20px',
|
|
|
height: 46,
|
|
|
lineHeight: '46px',
|
|
|
marginTop: 40,
|
|
|
display: 'flex',
|
|
|
alignItems: 'center'
|
|
|
},
|
|
|
children: [/*#__PURE__*/(0,jsx_runtime.jsxs)("div", {
|
|
|
style: {
|
|
|
flex: 1,
|
|
|
alignItems: 'center',
|
|
|
display: 'flex'
|
|
|
},
|
|
|
children: [/*#__PURE__*/(0,jsx_runtime.jsxs)("div", {
|
|
|
style: {
|
|
|
marginRight: 30
|
|
|
},
|
|
|
children: [/*#__PURE__*/(0,jsx_runtime.jsx)("span", {
|
|
|
style: {
|
|
|
marginRight: 10,
|
|
|
color: '#666666'
|
|
|
},
|
|
|
children: "\u521B\u5EFA\u8005"
|
|
|
}), /*#__PURE__*/(0,jsx_runtime.jsx)("span", {
|
|
|
style: {
|
|
|
color: '#000000'
|
|
|
},
|
|
|
children: (qitem === null || qitem === void 0 ? void 0 : qitem.author_name) || '- -'
|
|
|
})]
|
|
|
}), /*#__PURE__*/(0,jsx_runtime.jsxs)("div", {
|
|
|
style: {
|
|
|
marginRight: 30
|
|
|
},
|
|
|
children: [/*#__PURE__*/(0,jsx_runtime.jsx)("span", {
|
|
|
style: {
|
|
|
marginRight: 10,
|
|
|
color: '#666666'
|
|
|
},
|
|
|
children: "\u6240\u5C5E\u5355\u4F4D"
|
|
|
}), /*#__PURE__*/(0,jsx_runtime.jsx)("span", {
|
|
|
style: {
|
|
|
color: '#000000'
|
|
|
},
|
|
|
children: (qitem === null || qitem === void 0 ? void 0 : qitem.author_school_name) || '- -'
|
|
|
})]
|
|
|
}), /*#__PURE__*/(0,jsx_runtime.jsxs)("div", {
|
|
|
style: {
|
|
|
marginRight: 30
|
|
|
},
|
|
|
children: [/*#__PURE__*/(0,jsx_runtime.jsx)("span", {
|
|
|
style: {
|
|
|
marginRight: 10,
|
|
|
color: '#666666'
|
|
|
},
|
|
|
children: "\u5B66\u4E60\u4EBA\u6570"
|
|
|
}), /*#__PURE__*/(0,jsx_runtime.jsx)("span", {
|
|
|
style: {
|
|
|
color: '#000000'
|
|
|
},
|
|
|
children: (qitem === null || qitem === void 0 ? void 0 : qitem.study_count) || '0'
|
|
|
})]
|
|
|
})]
|
|
|
}), /*#__PURE__*/(0,jsx_runtime.jsxs)("a", {
|
|
|
className: Saveitemmodules.shixunbutton,
|
|
|
href: "/shixuns/".concat(qitem === null || qitem === void 0 ? void 0 : qitem.identifier, "/challenges?exercise=true"),
|
|
|
target: "_blank",
|
|
|
children: [/*#__PURE__*/(0,jsx_runtime.jsx)("i", {
|
|
|
onClick: function onClick() {},
|
|
|
style: {
|
|
|
marginRight: 20
|
|
|
},
|
|
|
className: "iconfont icon-shixunkecheng mr5 "
|
|
|
}), "\u5B9E\u8BAD\u8BE6\u60C5"]
|
|
|
})]
|
|
|
})]
|
|
|
}), ((qitem === null || qitem === void 0 ? void 0 : qitem.question_type) <= 4 || [6, 8].includes(qitem === null || qitem === void 0 ? void 0 : qitem.question_type)) && /*#__PURE__*/(0,jsx_runtime.jsxs)("div", {
|
|
|
className: Saveitemmodules.bottom,
|
|
|
children: [/*#__PURE__*/(0,jsx_runtime.jsxs)("div", {
|
|
|
className: Saveitemmodules.bottomitem,
|
|
|
style: {
|
|
|
alignItems: 'flex-start'
|
|
|
},
|
|
|
children: [/*#__PURE__*/(0,jsx_runtime.jsx)("span", {
|
|
|
className: Saveitemmodules.left,
|
|
|
children: "\u89E3\u6790"
|
|
|
}), /*#__PURE__*/(0,jsx_runtime.jsx)(RenderHtml/* default */.Z, {
|
|
|
className: Saveitemmodules.right,
|
|
|
value: (qitem === null || qitem === void 0 ? void 0 : qitem.analysis) || ''
|
|
|
})]
|
|
|
}), /*#__PURE__*/(0,jsx_runtime.jsxs)("div", {
|
|
|
className: Saveitemmodules.bottomitem,
|
|
|
style: {
|
|
|
alignItems: 'center'
|
|
|
},
|
|
|
children: [/*#__PURE__*/(0,jsx_runtime.jsx)("span", {
|
|
|
className: Saveitemmodules.left,
|
|
|
children: "\u96BE\u5EA6"
|
|
|
}), /*#__PURE__*/(0,jsx_runtime.jsx)("span", {
|
|
|
className: Saveitemmodules.right,
|
|
|
children: (qitem === null || qitem === void 0 ? void 0 : qitem.difficulty) === 1 ? '简单' : (qitem === null || qitem === void 0 ? void 0 : qitem.difficulty) === 2 ? '适中' : '困难'
|
|
|
})]
|
|
|
}), /*#__PURE__*/(0,jsx_runtime.jsxs)("div", {
|
|
|
className: Saveitemmodules.bottomitem,
|
|
|
style: {
|
|
|
alignItems: 'center'
|
|
|
},
|
|
|
children: [/*#__PURE__*/(0,jsx_runtime.jsx)("span", {
|
|
|
className: Saveitemmodules.left,
|
|
|
children: "\u77E5\u8BC6\u70B9"
|
|
|
}), /*#__PURE__*/(0,jsx_runtime.jsx)("span", {
|
|
|
className: Saveitemmodules.right,
|
|
|
children: qitem === null || qitem === void 0 ? void 0 : qitem.tag_discipline
|
|
|
})]
|
|
|
})]
|
|
|
})]
|
|
|
});
|
|
|
};
|
|
|
/* harmony default export */ var SaveItem = (DragQuestions);
|
|
|
// EXTERNAL MODULE: ./src/assets/images/paper/shengxu.svg
|
|
|
var shengxu = __webpack_require__(38676);
|
|
|
// EXTERNAL MODULE: ./src/assets/images/paper/jiangxu.svg
|
|
|
var jiangxu = __webpack_require__(70010);
|
|
|
// EXTERNAL MODULE: ./src/components/ReuseShixunModal/index.tsx + 1 modules
|
|
|
var ReuseShixunModal = __webpack_require__(41165);
|
|
|
// EXTERNAL MODULE: ./src/.umi-production/exports.ts
|
|
|
var _umi_production_exports = __webpack_require__(88271);
|
|
|
// EXTERNAL MODULE: ./node_modules/_@ant-design_icons@5.5.2@@ant-design/icons/es/icons/QuestionCircleOutlined.js + 1 modules
|
|
|
var QuestionCircleOutlined = __webpack_require__(86902);
|
|
|
;// CONCATENATED MODULE: ./src/pages/Classrooms/Lists/Exercise/Add/EditPotin/components/AddQuestionsModal/index.tsx
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
var AddModal = function AddModal(_ref) {
|
|
|
var _datas$tag_discipline, _grouplist$share_bank, _grouplist$my_banks_g;
|
|
|
var setScoreShow = _ref.setScoreShow,
|
|
|
ScoreShow = _ref.ScoreShow,
|
|
|
onOk = _ref.onOk,
|
|
|
isshixuns = _ref.isshixuns,
|
|
|
isloadings = _ref.isloadings,
|
|
|
_ref$checkHasUsedShix = _ref.checkHasUsedShixun,
|
|
|
checkHasUsedShixun = _ref$checkHasUsedShix === void 0 ? true : _ref$checkHasUsedShix;
|
|
|
var _useState = (0,_react_17_0_2_react.useState)({
|
|
|
type: '0',
|
|
|
page: 1,
|
|
|
per_page: 10,
|
|
|
updated_at: '',
|
|
|
quotes: ''
|
|
|
}),
|
|
|
_useState2 = slicedToArray_default()(_useState, 2),
|
|
|
param = _useState2[0],
|
|
|
setparam = _useState2[1];
|
|
|
var _useState3 = (0,_react_17_0_2_react.useState)([]),
|
|
|
_useState4 = slicedToArray_default()(_useState3, 2),
|
|
|
courseOptions = _useState4[0],
|
|
|
setcourseOptions = _useState4[1];
|
|
|
var _useState5 = (0,_react_17_0_2_react.useState)([]),
|
|
|
_useState6 = slicedToArray_default()(_useState5, 2),
|
|
|
checkitems = _useState6[0],
|
|
|
setcheckitems = _useState6[1];
|
|
|
var _useState7 = (0,_react_17_0_2_react.useState)([]),
|
|
|
_useState8 = slicedToArray_default()(_useState7, 2),
|
|
|
listitems = _useState8[0],
|
|
|
setlistitems = _useState8[1];
|
|
|
var _useState9 = (0,_react_17_0_2_react.useState)([]),
|
|
|
_useState10 = slicedToArray_default()(_useState9, 2),
|
|
|
datas = _useState10[0],
|
|
|
setdatas = _useState10[1];
|
|
|
var _useState11 = (0,_react_17_0_2_react.useState)(false),
|
|
|
_useState12 = slicedToArray_default()(_useState11, 2),
|
|
|
loading = _useState12[0],
|
|
|
setloading = _useState12[1];
|
|
|
var _Form$useForm = es_form/* default */.Z.useForm(),
|
|
|
_Form$useForm2 = slicedToArray_default()(_Form$useForm, 1),
|
|
|
form = _Form$useForm2[0];
|
|
|
var _useState13 = (0,_react_17_0_2_react.useState)(),
|
|
|
_useState14 = slicedToArray_default()(_useState13, 2),
|
|
|
qitem = _useState14[0],
|
|
|
setqitem = _useState14[1];
|
|
|
var _useState15 = (0,_react_17_0_2_react.useState)(false),
|
|
|
_useState16 = slicedToArray_default()(_useState15, 2),
|
|
|
isshow = _useState16[0],
|
|
|
setisshow = _useState16[1];
|
|
|
var _useState17 = (0,_react_17_0_2_react.useState)(isshixuns),
|
|
|
_useState18 = slicedToArray_default()(_useState17, 2),
|
|
|
isshixun = _useState18[0],
|
|
|
setisshixun = _useState18[1];
|
|
|
var _useState19 = (0,_react_17_0_2_react.useState)([]),
|
|
|
_useState20 = slicedToArray_default()(_useState19, 2),
|
|
|
ShiXunListItems = _useState20[0],
|
|
|
setshixunitems = _useState20[1];
|
|
|
var _useState21 = (0,_react_17_0_2_react.useState)(true),
|
|
|
_useState22 = slicedToArray_default()(_useState21, 2),
|
|
|
indexi = _useState22[0],
|
|
|
setindexi = _useState22[1];
|
|
|
var _useState23 = (0,_react_17_0_2_react.useState)([]),
|
|
|
_useState24 = slicedToArray_default()(_useState23, 2),
|
|
|
grouplist = _useState24[0],
|
|
|
setgrouplist = _useState24[1];
|
|
|
var _useState25 = (0,_react_17_0_2_react.useState)(0),
|
|
|
_useState26 = slicedToArray_default()(_useState25, 2),
|
|
|
addcount = _useState26[0],
|
|
|
setaddcount = _useState26[1];
|
|
|
var typeData = [{
|
|
|
name: "全部",
|
|
|
value: "",
|
|
|
question_type: 0
|
|
|
}, {
|
|
|
name: "单选题",
|
|
|
value: "SINGLE",
|
|
|
question_type: 0
|
|
|
}, {
|
|
|
name: "多选题",
|
|
|
value: "MULTIPLE",
|
|
|
question_type: 1
|
|
|
}, {
|
|
|
name: "判断题",
|
|
|
value: "JUDGMENT",
|
|
|
question_type: 2
|
|
|
}, {
|
|
|
name: "填空题",
|
|
|
value: "COMPLETION",
|
|
|
question_type: 3
|
|
|
}, {
|
|
|
name: "简答题",
|
|
|
value: "SUBJECTIVE",
|
|
|
question_type: 4
|
|
|
}, {
|
|
|
name: "实训题",
|
|
|
value: "SHIXUN",
|
|
|
question_type: 5
|
|
|
}, {
|
|
|
name: "编程题",
|
|
|
value: "PROGRAM",
|
|
|
question_type: 6
|
|
|
}, {
|
|
|
name: "组合题",
|
|
|
value: "COMBINATION",
|
|
|
question_type: 7
|
|
|
}, {
|
|
|
name: "程序填空题",
|
|
|
value: "BPROGRAM",
|
|
|
question_type: 8
|
|
|
}];
|
|
|
var _useState27 = (0,_react_17_0_2_react.useState)([]),
|
|
|
_useState28 = slicedToArray_default()(_useState27, 2),
|
|
|
checkedItemsArr = _useState28[0],
|
|
|
setCheckedItemsArr = _useState28[1];
|
|
|
var selectedShixunId = (0,_react_17_0_2_react.useRef)(new Set());
|
|
|
var selectedQuestionId = (0,_react_17_0_2_react.useRef)(new Set());
|
|
|
var difficultyData = [{
|
|
|
name: "简单",
|
|
|
value: 1
|
|
|
}, {
|
|
|
name: "适中",
|
|
|
value: 2
|
|
|
}, {
|
|
|
name: "困难",
|
|
|
value: 3
|
|
|
}];
|
|
|
var diff = [{
|
|
|
name: '初级',
|
|
|
value: 1
|
|
|
}, {
|
|
|
name: '中级',
|
|
|
value: 2
|
|
|
}, {
|
|
|
name: '中高级',
|
|
|
value: 3
|
|
|
}, {
|
|
|
name: '高级',
|
|
|
value: 4
|
|
|
}];
|
|
|
var _useState29 = (0,_react_17_0_2_react.useState)(false),
|
|
|
_useState30 = slicedToArray_default()(_useState29, 2),
|
|
|
showClearButton = _useState30[0],
|
|
|
setShowClearButton = _useState30[1]; // 新增的变量用于控制是否显示清空按钮
|
|
|
|
|
|
var handleClearButtonClick = function handleClearButtonClick() {
|
|
|
form.resetFields();
|
|
|
isshixun = false;
|
|
|
setisshixun(false);
|
|
|
setShowClearButton(false); // 更新显示清空按钮的状态
|
|
|
form.submit();
|
|
|
};
|
|
|
(0,_react_17_0_2_react.useEffect)(function () {
|
|
|
if (addcount > 0) {
|
|
|
setTimeout(function () {
|
|
|
setaddcount(0);
|
|
|
}, 2000);
|
|
|
}
|
|
|
}, [addcount]);
|
|
|
(0,_react_17_0_2_react.useEffect)(function () {
|
|
|
if (ScoreShow) {
|
|
|
form.setFieldsValue({
|
|
|
item_type: '',
|
|
|
courseid: '',
|
|
|
tag_discipline_id: null,
|
|
|
difficulty: null,
|
|
|
keyword: null
|
|
|
});
|
|
|
if (indexi && isshixun) {
|
|
|
form.setFieldsValue({
|
|
|
item_type: 'SHIXUN'
|
|
|
});
|
|
|
param.item_type = "SHIXUN";
|
|
|
setparam(objectSpread2_default()({}, param));
|
|
|
setindexi(false);
|
|
|
}
|
|
|
getdatas(param);
|
|
|
getdisciplines();
|
|
|
getwjj();
|
|
|
}
|
|
|
}, [ScoreShow]);
|
|
|
function getdatas(_x) {
|
|
|
return _getdatas.apply(this, arguments);
|
|
|
}
|
|
|
function _getdatas() {
|
|
|
_getdatas = asyncToGenerator_default()( /*#__PURE__*/regeneratorRuntime_default()().mark(function _callee3(params) {
|
|
|
var _params$courseid, _params$courseid2;
|
|
|
var ids, shixun_ids, res;
|
|
|
return regeneratorRuntime_default()().wrap(function _callee3$(_context3) {
|
|
|
while (1) switch (_context3.prev = _context3.next) {
|
|
|
case 0:
|
|
|
setloading(true);
|
|
|
setparam(params);
|
|
|
|
|
|
// if (isshixun) {
|
|
|
// let res = await Fetch(`/api/shixun_lists.json`, {
|
|
|
// method: 'get',
|
|
|
// params: {
|
|
|
// ...params,
|
|
|
// discipline_id: params?.courseid?.[0] || null,
|
|
|
// sub_discipline_id: params?.courseid?.[1] || null,
|
|
|
// limit: params.per_page,
|
|
|
// }
|
|
|
// })
|
|
|
// setdatas(res);
|
|
|
|
|
|
// } else {
|
|
|
if (!((listitems === null || listitems === void 0 ? void 0 : listitems.length) <= 0 && params.type === '5')) {
|
|
|
_context3.next = 6;
|
|
|
break;
|
|
|
}
|
|
|
setdatas([]);
|
|
|
setloading(false);
|
|
|
return _context3.abrupt("return");
|
|
|
case 6:
|
|
|
ids = params.type === '5' ? listitems === null || listitems === void 0 ? void 0 : listitems.filter(function (item) {
|
|
|
return !ShiXunListItems.includes(item);
|
|
|
}) : null;
|
|
|
shixun_ids = params.type === '5' ? listitems === null || listitems === void 0 ? void 0 : listitems.filter(function (item) {
|
|
|
return ShiXunListItems.includes(item);
|
|
|
}) : null;
|
|
|
_context3.next = 10;
|
|
|
return (0,fetch/* default */.ZP)("/api/item_banks.json", {
|
|
|
method: 'get',
|
|
|
params: objectSpread2_default()(objectSpread2_default()({}, params), {}, {
|
|
|
discipline_id: (params === null || params === void 0 || (_params$courseid = params.courseid) === null || _params$courseid === void 0 ? void 0 : _params$courseid[0]) || null,
|
|
|
sub_discipline_id: (params === null || params === void 0 || (_params$courseid2 = params.courseid) === null || _params$courseid2 === void 0 ? void 0 : _params$courseid2[1]) || null,
|
|
|
ids: ids,
|
|
|
shixun_ids: shixun_ids,
|
|
|
keyword: params.keyword ? encodeURIComponent(params.keyword) : params.keyword,
|
|
|
include_shixuns: true,
|
|
|
type: params.type === '5' ? null : params.type,
|
|
|
clazz: params.type === '3' ? 'ItemBanksGroup' : null
|
|
|
// ids:listitems
|
|
|
})
|
|
|
});
|
|
|
case 10:
|
|
|
res = _context3.sent;
|
|
|
setdatas(res);
|
|
|
// }
|
|
|
|
|
|
setloading(false);
|
|
|
case 13:
|
|
|
case "end":
|
|
|
return _context3.stop();
|
|
|
}
|
|
|
}, _callee3);
|
|
|
}));
|
|
|
return _getdatas.apply(this, arguments);
|
|
|
}
|
|
|
function getdisciplines() {
|
|
|
return _getdisciplines.apply(this, arguments);
|
|
|
}
|
|
|
function _getdisciplines() {
|
|
|
_getdisciplines = asyncToGenerator_default()( /*#__PURE__*/regeneratorRuntime_default()().mark(function _callee4() {
|
|
|
var res;
|
|
|
return regeneratorRuntime_default()().wrap(function _callee4$(_context4) {
|
|
|
while (1) switch (_context4.prev = _context4.next) {
|
|
|
case 0:
|
|
|
_context4.next = 2;
|
|
|
return (0,fetch/* default */.ZP)("/api/disciplines.json", {
|
|
|
method: 'get',
|
|
|
params: {
|
|
|
source: 'question',
|
|
|
group_id: 0,
|
|
|
group_type: param.type === '5' ? null : param.type === '5',
|
|
|
clazz: 'ItemBanksGroup'
|
|
|
}
|
|
|
});
|
|
|
case 2:
|
|
|
res = _context4.sent;
|
|
|
setcourseOptions((0,util/* formatCourseOptions */.L)(res === null || res === void 0 ? void 0 : res.disciplines));
|
|
|
case 4:
|
|
|
case "end":
|
|
|
return _context4.stop();
|
|
|
}
|
|
|
}, _callee4);
|
|
|
}));
|
|
|
return _getdisciplines.apply(this, arguments);
|
|
|
}
|
|
|
function getwjj() {
|
|
|
return _getwjj.apply(this, arguments);
|
|
|
}
|
|
|
function _getwjj() {
|
|
|
_getwjj = asyncToGenerator_default()( /*#__PURE__*/regeneratorRuntime_default()().mark(function _callee5() {
|
|
|
var res;
|
|
|
return regeneratorRuntime_default()().wrap(function _callee5$(_context5) {
|
|
|
while (1) switch (_context5.prev = _context5.next) {
|
|
|
case 0:
|
|
|
_context5.next = 2;
|
|
|
return (0,fetch/* default */.ZP)("/api/item_banks_groups/all_groups.json", {
|
|
|
method: 'get'
|
|
|
});
|
|
|
case 2:
|
|
|
res = _context5.sent;
|
|
|
if ((res === null || res === void 0 ? void 0 : res.status) === 0) {
|
|
|
setgrouplist(res);
|
|
|
}
|
|
|
case 4:
|
|
|
case "end":
|
|
|
return _context5.stop();
|
|
|
}
|
|
|
}, _callee5);
|
|
|
}));
|
|
|
return _getwjj.apply(this, arguments);
|
|
|
}
|
|
|
function getmy(_x2) {
|
|
|
return _getmy.apply(this, arguments);
|
|
|
}
|
|
|
function _getmy() {
|
|
|
_getmy = asyncToGenerator_default()( /*#__PURE__*/regeneratorRuntime_default()().mark(function _callee6(params) {
|
|
|
var _params$list, _params$list2, _params$courseid3, _params$courseid4;
|
|
|
var ids, shixun_ids, res;
|
|
|
return regeneratorRuntime_default()().wrap(function _callee6$(_context6) {
|
|
|
while (1) switch (_context6.prev = _context6.next) {
|
|
|
case 0:
|
|
|
setloading(true);
|
|
|
ids = (_params$list = params.list) === null || _params$list === void 0 ? void 0 : _params$list.filter(function (item) {
|
|
|
return !ShiXunListItems.includes(item);
|
|
|
});
|
|
|
shixun_ids = (_params$list2 = params.list) === null || _params$list2 === void 0 ? void 0 : _params$list2.filter(function (item) {
|
|
|
return ShiXunListItems.includes(item);
|
|
|
});
|
|
|
if (!(ids.length === 0 && shixun_ids.length === 0)) {
|
|
|
_context6.next = 7;
|
|
|
break;
|
|
|
}
|
|
|
setloading(false);
|
|
|
setdatas([]);
|
|
|
return _context6.abrupt("return");
|
|
|
case 7:
|
|
|
_context6.next = 9;
|
|
|
return (0,fetch/* default */.ZP)("/api/item_banks.json", {
|
|
|
method: 'get',
|
|
|
params: objectSpread2_default()(objectSpread2_default()({}, params), {}, {
|
|
|
discipline_id: (params === null || params === void 0 || (_params$courseid3 = params.courseid) === null || _params$courseid3 === void 0 ? void 0 : _params$courseid3[0]) || null,
|
|
|
sub_discipline_id: (params === null || params === void 0 || (_params$courseid4 = params.courseid) === null || _params$courseid4 === void 0 ? void 0 : _params$courseid4[1]) || null,
|
|
|
ids: ids,
|
|
|
shixun_ids: shixun_ids,
|
|
|
type: params.type === '5' ? null : params.type,
|
|
|
clazz: params.type === '3' ? 'ItemBanksGroup' : null
|
|
|
// ids:listitems
|
|
|
})
|
|
|
});
|
|
|
case 9:
|
|
|
res = _context6.sent;
|
|
|
setloading(false);
|
|
|
setdatas(res);
|
|
|
case 12:
|
|
|
case "end":
|
|
|
return _context6.stop();
|
|
|
}
|
|
|
}, _callee6);
|
|
|
}));
|
|
|
return _getmy.apply(this, arguments);
|
|
|
}
|
|
|
var paramsFromUrl = (0,_umi_production_exports.useParams)();
|
|
|
var _useReuseModal = (0,ReuseShixunModal/* useReuseModal */.P)(),
|
|
|
_useReuseModal2 = slicedToArray_default()(_useReuseModal, 4),
|
|
|
reuseModalVisible = _useReuseModal2[0],
|
|
|
closeReuseModal = _useReuseModal2[1],
|
|
|
renderData = _useReuseModal2[2],
|
|
|
showReuseModal = _useReuseModal2[3];
|
|
|
return /*#__PURE__*/(0,jsx_runtime.jsxs)("div", {
|
|
|
children: [/*#__PURE__*/(0,jsx_runtime.jsxs)(modal/* default */.Z, {
|
|
|
title: false,
|
|
|
footer: false,
|
|
|
open: ScoreShow,
|
|
|
width: 1200,
|
|
|
centered: true,
|
|
|
closable: false,
|
|
|
className: AddQuestionsModalmodules.scoremodal,
|
|
|
onCancel: function onCancel() {
|
|
|
setScoreShow(false);
|
|
|
},
|
|
|
children: [/*#__PURE__*/(0,jsx_runtime.jsxs)("div", {
|
|
|
style: {
|
|
|
display: 'flex',
|
|
|
alignItems: 'center'
|
|
|
},
|
|
|
children: [/*#__PURE__*/(0,jsx_runtime.jsx)("div", {
|
|
|
className: AddQuestionsModalmodules.title,
|
|
|
children: "\u9898\u5E93\u9009\u9898"
|
|
|
}), /*#__PURE__*/(0,jsx_runtime.jsx)("span", {
|
|
|
onClick: function onClick() {
|
|
|
return setScoreShow(false);
|
|
|
},
|
|
|
className: AddQuestionsModalmodules.close,
|
|
|
children: "X"
|
|
|
})]
|
|
|
}), /*#__PURE__*/(0,jsx_runtime.jsx)(tabs/* default */.Z, {
|
|
|
className: AddQuestionsModalmodules.tabWrap,
|
|
|
activeKey: param.type,
|
|
|
onChange: function onChange(e) {
|
|
|
param.type = e;
|
|
|
param.page = 1;
|
|
|
param.updated_at = '', param.quotes = '',
|
|
|
// param.item_type = null,
|
|
|
param.courseid = '', param.tag_discipline_id = null, param.difficulty = null, param.keyword = null, param.group_id = null, form.setFieldsValue({
|
|
|
// item_type: null,
|
|
|
courseid: '',
|
|
|
tag_discipline_id: null,
|
|
|
difficulty: null,
|
|
|
keyword: null,
|
|
|
group_id: null
|
|
|
});
|
|
|
// if (!param?.item_type && param.type !== '5') {
|
|
|
// param.item_type = 'SINGLE'
|
|
|
// form.setFieldsValue({
|
|
|
// item_type: 'SINGLE'
|
|
|
// })
|
|
|
// }
|
|
|
if ((param === null || param === void 0 ? void 0 : param.item_type) === 'SHIXUN' && param.type !== '5') {
|
|
|
isshixun = true;
|
|
|
setisshixun(true);
|
|
|
}
|
|
|
setShowClearButton(false);
|
|
|
if (param.type === '5') {
|
|
|
isshixun = false;
|
|
|
setisshixun(false);
|
|
|
// param.item_type = ''
|
|
|
// form.setFieldsValue({
|
|
|
// item_type: ''
|
|
|
// })
|
|
|
}
|
|
|
setparam(objectSpread2_default()({}, param));
|
|
|
getdatas(objectSpread2_default()({}, param));
|
|
|
},
|
|
|
items: [{
|
|
|
label: "\u516C\u5171",
|
|
|
key: '1'
|
|
|
}, {
|
|
|
label: "\u56E2\u961F\u5171\u4EAB",
|
|
|
key: '3'
|
|
|
}, {
|
|
|
label: "\u6536\u85CF\u5939",
|
|
|
key: '2'
|
|
|
}, {
|
|
|
label: "\u6211\u521B\u5EFA\u7684",
|
|
|
key: '0'
|
|
|
}, {
|
|
|
label: /*#__PURE__*/(0,jsx_runtime.jsxs)("div", {
|
|
|
children: ["\u5DF2\u9009", listitems.length > 0 && /*#__PURE__*/(0,jsx_runtime.jsx)("span", {
|
|
|
className: AddQuestionsModalmodules.titlecount,
|
|
|
children: listitems.length
|
|
|
}), addcount > 0 && /*#__PURE__*/(0,jsx_runtime.jsxs)("span", {
|
|
|
className: AddQuestionsModalmodules.add,
|
|
|
children: ["+", addcount]
|
|
|
})]
|
|
|
}),
|
|
|
key: '5'
|
|
|
}]
|
|
|
}), /*#__PURE__*/(0,jsx_runtime.jsxs)(es_form/* default */.Z, {
|
|
|
layout: 'inline',
|
|
|
form: form,
|
|
|
onValuesChange: function onValuesChange(values, items) {
|
|
|
var _param$keyword, _param$keyword$replac;
|
|
|
var hasFilter = Object.values(items).some(function (value) {
|
|
|
return value !== null && value !== '' && value !== undefined;
|
|
|
});
|
|
|
var isInputEmpty = items.keyword === '';
|
|
|
setShowClearButton(hasFilter || !isInputEmpty);
|
|
|
param.page = 1;
|
|
|
param.keyword = (_param$keyword = param.keyword) === null || _param$keyword === void 0 || (_param$keyword$replac = _param$keyword.replace) === null || _param$keyword$replac === void 0 ? void 0 : _param$keyword$replac.call(_param$keyword, /^\s+|\s+$/g, '');
|
|
|
if ((items === null || items === void 0 ? void 0 : items.item_type) === 'SHIXUN') {
|
|
|
if (param.type === '5') {
|
|
|
setisshixun(false);
|
|
|
} else {
|
|
|
setisshixun(true);
|
|
|
}
|
|
|
if (values.keyword || values.keyword === '') {
|
|
|
return;
|
|
|
}
|
|
|
form.submit();
|
|
|
} else {
|
|
|
if (values !== null && values !== void 0 && values.courseid) {
|
|
|
form.setFieldsValue({
|
|
|
tag_discipline_id: ''
|
|
|
});
|
|
|
}
|
|
|
setisshixun(false);
|
|
|
if (values.keyword || values.keyword === '') {
|
|
|
return;
|
|
|
}
|
|
|
form.submit();
|
|
|
}
|
|
|
},
|
|
|
onFinish: function onFinish(values) {
|
|
|
getdatas(objectSpread2_default()(objectSpread2_default()({}, param), values));
|
|
|
},
|
|
|
children: [/*#__PURE__*/(0,jsx_runtime.jsx)(es_form/* default */.Z.Item, {
|
|
|
name: "item_type",
|
|
|
children: /*#__PURE__*/(0,jsx_runtime.jsx)(es_select["default"], {
|
|
|
className: AddQuestionsModalmodules.selectWrapper,
|
|
|
placeholder: "\u9898\u578B",
|
|
|
style: {
|
|
|
width: 110
|
|
|
},
|
|
|
size: "middle",
|
|
|
allowClear: true,
|
|
|
children: typeData.map(function (item) {
|
|
|
return /*#__PURE__*/(0,jsx_runtime.jsx)(es_select["default"].Option, {
|
|
|
children: item.name
|
|
|
}, item.value);
|
|
|
})
|
|
|
})
|
|
|
}), /*#__PURE__*/(0,jsx_runtime.jsx)(es_form/* default */.Z.Item, {
|
|
|
name: "courseid",
|
|
|
children: /*#__PURE__*/(0,jsx_runtime.jsx)(cascader/* default */.Z, {
|
|
|
className: AddQuestionsModalmodules.selectWrapper,
|
|
|
style: {
|
|
|
width: 160
|
|
|
},
|
|
|
size: "middle",
|
|
|
placeholder: "\u65B9\u5411&\u8BFE\u7A0B",
|
|
|
options: courseOptions
|
|
|
})
|
|
|
}), !isshixun && /*#__PURE__*/(0,jsx_runtime.jsx)(es_form/* default */.Z.Item, {
|
|
|
name: "tag_discipline_id",
|
|
|
children: /*#__PURE__*/(0,jsx_runtime.jsx)(es_select["default"], {
|
|
|
className: AddQuestionsModalmodules.selectWrapper,
|
|
|
placeholder: "\u77E5\u8BC6\u70B9",
|
|
|
style: {
|
|
|
width: 160
|
|
|
},
|
|
|
size: "middle",
|
|
|
allowClear: true,
|
|
|
children: datas === null || datas === void 0 || (_datas$tag_discipline = datas.tag_disciplines) === null || _datas$tag_discipline === void 0 ? void 0 : _datas$tag_discipline.map(function (item) {
|
|
|
return /*#__PURE__*/(0,jsx_runtime.jsx)(es_select["default"].Option, {
|
|
|
children: item.name
|
|
|
}, item.id);
|
|
|
})
|
|
|
})
|
|
|
}), /*#__PURE__*/(0,jsx_runtime.jsx)(es_form/* default */.Z.Item, {
|
|
|
name: isshixun ? 'diff' : 'difficulty',
|
|
|
children: /*#__PURE__*/(0,jsx_runtime.jsxs)(es_select["default"], {
|
|
|
className: AddQuestionsModalmodules.selectWrapper,
|
|
|
placeholder: "\u96BE\u5EA6",
|
|
|
style: {
|
|
|
width: 118
|
|
|
},
|
|
|
size: "middle",
|
|
|
allowClear: true,
|
|
|
children: [!isshixun && difficultyData.map(function (item) {
|
|
|
return /*#__PURE__*/(0,jsx_runtime.jsx)(es_select["default"].Option, {
|
|
|
children: item.name
|
|
|
}, item.value);
|
|
|
}), isshixun && diff.map(function (item) {
|
|
|
return /*#__PURE__*/(0,jsx_runtime.jsx)(es_select["default"].Option, {
|
|
|
children: item.name
|
|
|
}, item.value);
|
|
|
})]
|
|
|
})
|
|
|
}), (param.type === '3' || param.type === '0') && !isshixun && /*#__PURE__*/(0,jsx_runtime.jsx)(es_form/* default */.Z.Item, {
|
|
|
name: 'group_id',
|
|
|
children: /*#__PURE__*/(0,jsx_runtime.jsxs)(es_select["default"], {
|
|
|
className: AddQuestionsModalmodules.selectWrapper,
|
|
|
placeholder: "\u6587\u4EF6\u5939",
|
|
|
showSearch: true,
|
|
|
style: {
|
|
|
width: 118
|
|
|
},
|
|
|
size: "middle",
|
|
|
allowClear: true,
|
|
|
filterOption: function filterOption(inputValue, option) {
|
|
|
return option.children.toUpperCase().indexOf(inputValue.toUpperCase()) !== -1;
|
|
|
},
|
|
|
children: [/*#__PURE__*/(0,jsx_runtime.jsx)(es_select["default"].Option, {
|
|
|
children: "\u6839\u76EE\u5F55"
|
|
|
}, 0), param.type === '3' && (grouplist === null || grouplist === void 0 || (_grouplist$share_bank = grouplist.share_banks_groups) === null || _grouplist$share_bank === void 0 ? void 0 : _grouplist$share_bank.map(function (item) {
|
|
|
return /*#__PURE__*/(0,jsx_runtime.jsx)(es_select["default"].Option, {
|
|
|
children: item.name
|
|
|
}, item.id);
|
|
|
})), param.type === '0' && (grouplist === null || grouplist === void 0 || (_grouplist$my_banks_g = grouplist.my_banks_groups) === null || _grouplist$my_banks_g === void 0 ? void 0 : _grouplist$my_banks_g.map(function (item) {
|
|
|
return /*#__PURE__*/(0,jsx_runtime.jsx)(es_select["default"].Option, {
|
|
|
children: item.name
|
|
|
}, item.id);
|
|
|
}))]
|
|
|
})
|
|
|
}), showClearButton && /*#__PURE__*/(0,jsx_runtime.jsxs)("span", {
|
|
|
className: AddQuestionsModalmodules.allqingchu,
|
|
|
onClick: handleClearButtonClick,
|
|
|
children: [/*#__PURE__*/(0,jsx_runtime.jsx)("i", {
|
|
|
className: "iconfont icon-guanbi4"
|
|
|
}), /*#__PURE__*/(0,jsx_runtime.jsx)("span", {
|
|
|
children: "\u6E05\u9664\u7B5B\u9009\u6761\u4EF6"
|
|
|
})]
|
|
|
}), /*#__PURE__*/(0,jsx_runtime.jsx)(es_form/* default */.Z.Item, {
|
|
|
style: {
|
|
|
flex: '0 0 auto',
|
|
|
marginRight: 0,
|
|
|
marginLeft: 'auto'
|
|
|
},
|
|
|
name: "keyword",
|
|
|
children: /*#__PURE__*/(0,jsx_runtime.jsx)(input/* default */.Z.Search, {
|
|
|
className: AddQuestionsModalmodules.search,
|
|
|
placeholder: "\u8BF7\u8F93\u5165\u5173\u952E\u8BCD\u641C\u7D22",
|
|
|
allowClear: true,
|
|
|
suffix: /*#__PURE__*/(0,jsx_runtime.jsx)("i", {
|
|
|
className: "iconfont icon-sousuo9 font14 ".concat(AddQuestionsModalmodules.searchIcon),
|
|
|
onClick: function onClick() {
|
|
|
return form.submit();
|
|
|
}
|
|
|
}),
|
|
|
onSearch: function onSearch(value) {
|
|
|
form.submit();
|
|
|
}
|
|
|
})
|
|
|
})]
|
|
|
}), /*#__PURE__*/(0,jsx_runtime.jsxs)("div", {
|
|
|
style: {
|
|
|
background: '#F6F7F9',
|
|
|
display: 'flex',
|
|
|
alignItems: 'center',
|
|
|
marginTop: 18,
|
|
|
height: 40,
|
|
|
paddingLeft: 10,
|
|
|
paddingRight: 20
|
|
|
},
|
|
|
children: [/*#__PURE__*/(0,jsx_runtime.jsxs)("div", {
|
|
|
onClick: function onClick() {
|
|
|
if (param.updated_at === 'asc') {
|
|
|
param.updated_at = 'desc';
|
|
|
} else {
|
|
|
param.updated_at = 'asc';
|
|
|
}
|
|
|
setparam(objectSpread2_default()(objectSpread2_default()({}, param), {}, {
|
|
|
page: 1
|
|
|
}));
|
|
|
getdatas(objectSpread2_default()(objectSpread2_default()({}, param), {}, {
|
|
|
page: 1
|
|
|
}));
|
|
|
},
|
|
|
children: [" ", !param.updated_at ? /*#__PURE__*/(0,jsx_runtime.jsx)("i", {
|
|
|
style: {
|
|
|
fontSize: "14px"
|
|
|
},
|
|
|
className: "iconfont icon-jiangxu mr5 c-light-primary"
|
|
|
}) : /*#__PURE__*/(0,jsx_runtime.jsx)("img", {
|
|
|
src: param.updated_at === 'asc' ? shengxu/* default */.Z : jiangxu/* default */.Z,
|
|
|
style: {
|
|
|
width: "15px",
|
|
|
verticalAlign: "text-bottom"
|
|
|
},
|
|
|
className: "font14 mr5 c-light-primary"
|
|
|
}), "\u6309\u66F4\u65B0\u65F6\u95F4\u6392\u5E8F"]
|
|
|
}), /*#__PURE__*/(0,jsx_runtime.jsxs)("div", {
|
|
|
onClick: function onClick() {
|
|
|
if (param.quotes === 'asc') {
|
|
|
param.quotes = 'desc';
|
|
|
} else {
|
|
|
param.quotes = 'asc';
|
|
|
}
|
|
|
setparam(objectSpread2_default()(objectSpread2_default()({}, param), {}, {
|
|
|
page: 1
|
|
|
}));
|
|
|
getdatas(objectSpread2_default()(objectSpread2_default()({}, param), {}, {
|
|
|
page: 1
|
|
|
}));
|
|
|
},
|
|
|
style: {
|
|
|
marginLeft: 20
|
|
|
},
|
|
|
children: [" ", !param.quotes ? /*#__PURE__*/(0,jsx_runtime.jsx)("i", {
|
|
|
style: {
|
|
|
fontSize: "14px"
|
|
|
},
|
|
|
className: "iconfont icon-jiangxu mr5 c-light-primary"
|
|
|
}) : /*#__PURE__*/(0,jsx_runtime.jsx)("img", {
|
|
|
src: param.quotes === 'asc' ? shengxu/* default */.Z : jiangxu/* default */.Z,
|
|
|
style: {
|
|
|
width: "15px",
|
|
|
verticalAlign: "text-bottom"
|
|
|
},
|
|
|
className: "font14 mr5 c-light-primary"
|
|
|
}), "\u6309\u4F7F\u7528\u6B21\u6570\u6392\u5E8F"]
|
|
|
})]
|
|
|
}), /*#__PURE__*/(0,jsx_runtime.jsx)(table/* default */.Z, {
|
|
|
style: {
|
|
|
marginTop: 2,
|
|
|
marginBottom: 20
|
|
|
},
|
|
|
scroll: {
|
|
|
y: 260
|
|
|
},
|
|
|
dataSource: (datas === null || datas === void 0 ? void 0 : datas.items) || (datas === null || datas === void 0 ? void 0 : datas.shixun_list),
|
|
|
pagination: false,
|
|
|
loading: loading,
|
|
|
rowKey: function rowKey(e) {
|
|
|
return e.id;
|
|
|
},
|
|
|
rowSelection: {
|
|
|
type: 'checkbox',
|
|
|
selectedRowKeys: checkitems,
|
|
|
getCheckboxProps: function getCheckboxProps(record) {
|
|
|
return {
|
|
|
disabled: record.shixun_tag_num === 1
|
|
|
};
|
|
|
},
|
|
|
onSelect: function onSelect(record, selected, selectedRows) {
|
|
|
if (selected) {
|
|
|
if (isshixun) {
|
|
|
setshixunitems([].concat(toConsumableArray_default()(ShiXunListItems), [record.id]));
|
|
|
}
|
|
|
setcheckitems([].concat(toConsumableArray_default()(checkitems), [record.id]));
|
|
|
setCheckedItemsArr([].concat(toConsumableArray_default()(checkedItemsArr), [record]));
|
|
|
//添加
|
|
|
if (record.identifier) {
|
|
|
selectedShixunId.current.add(record.id);
|
|
|
} else {
|
|
|
selectedQuestionId.current.add(record.id);
|
|
|
}
|
|
|
setaddcount(1);
|
|
|
setlistitems([].concat(toConsumableArray_default()(listitems), [record.id]));
|
|
|
//取消选中,则在checkedItemsArr、selectedRowKeys中过滤掉这条数据
|
|
|
} else {
|
|
|
var newData = checkedItemsArr.filter(function (item) {
|
|
|
return item.id !== record.id;
|
|
|
});
|
|
|
setCheckedItemsArr(newData);
|
|
|
var arr = newData.map(function (item) {
|
|
|
return item.id;
|
|
|
});
|
|
|
setcheckitems(toConsumableArray_default()(arr));
|
|
|
|
|
|
//移除
|
|
|
if (record.identifier) {
|
|
|
selectedShixunId.current["delete"](record.id);
|
|
|
} else {
|
|
|
selectedQuestionId.current["delete"](record.id);
|
|
|
}
|
|
|
var list = listitems.filter(function (item) {
|
|
|
return item !== record.id;
|
|
|
});
|
|
|
setlistitems(list);
|
|
|
if (isshixun) {
|
|
|
var list2 = ShiXunListItems.filter(function (item) {
|
|
|
return item !== record.id;
|
|
|
});
|
|
|
setshixunitems(toConsumableArray_default()(list2));
|
|
|
}
|
|
|
if (param.type === '5') {
|
|
|
getmy(objectSpread2_default()(objectSpread2_default()({}, param), {}, {
|
|
|
list: toConsumableArray_default()(list)
|
|
|
}));
|
|
|
return;
|
|
|
}
|
|
|
}
|
|
|
},
|
|
|
onSelectAll: function onSelectAll(selected, selectedRows, changeRows) {
|
|
|
if (!selected) {
|
|
|
var arr = changeRows.map(function (item) {
|
|
|
return item.id;
|
|
|
});
|
|
|
var newArr = checkitems.filter(function (item) {
|
|
|
return !arr.some(function (ele) {
|
|
|
return ele === item;
|
|
|
});
|
|
|
});
|
|
|
var newArr1 = checkedItemsArr.filter(function (item) {
|
|
|
return !arr.some(function (ele) {
|
|
|
return ele === item.id;
|
|
|
});
|
|
|
});
|
|
|
setCheckedItemsArr(newArr1);
|
|
|
setcheckitems(toConsumableArray_default()(newArr));
|
|
|
|
|
|
//批量移除
|
|
|
setlistitems(toConsumableArray_default()(newArr));
|
|
|
if (isshixun) {
|
|
|
var list2 = ShiXunListItems.filter(function (item) {
|
|
|
return !arr.some(function (ele) {
|
|
|
return ele === item.id;
|
|
|
});
|
|
|
});
|
|
|
setshixunitems(toConsumableArray_default()(list2));
|
|
|
}
|
|
|
if (param.type === '5') {
|
|
|
getmy(objectSpread2_default()(objectSpread2_default()({}, param), {}, {
|
|
|
list: toConsumableArray_default()(newArr)
|
|
|
}));
|
|
|
}
|
|
|
var _iterator = createForOfIteratorHelper_default()(arr),
|
|
|
_step;
|
|
|
try {
|
|
|
for (_iterator.s(); !(_step = _iterator.n()).done;) {
|
|
|
var item = _step.value;
|
|
|
if (item.identifier) {
|
|
|
selectedShixunId.current["delete"](item);
|
|
|
} else {
|
|
|
selectedQuestionId.current["delete"](item);
|
|
|
}
|
|
|
}
|
|
|
} catch (err) {
|
|
|
_iterator.e(err);
|
|
|
} finally {
|
|
|
_iterator.f();
|
|
|
}
|
|
|
}
|
|
|
//全选,把由未选中变为选中的数据统一放到setSelectedRowKeys中存储
|
|
|
else {
|
|
|
var arr1 = changeRows.map(function (item) {
|
|
|
return item.id;
|
|
|
}); //过滤出选中数据的唯一值
|
|
|
if (isshixun) {
|
|
|
setshixunitems([].concat(toConsumableArray_default()(ShiXunListItems), toConsumableArray_default()(arr1)));
|
|
|
}
|
|
|
setCheckedItemsArr([].concat(toConsumableArray_default()(checkedItemsArr), toConsumableArray_default()(changeRows)));
|
|
|
setcheckitems([].concat(toConsumableArray_default()(checkitems), toConsumableArray_default()(arr1))); //存储所有选中数据的唯一值,可用于批量删除/新增/修改等操作
|
|
|
//批量加入
|
|
|
setlistitems([].concat(toConsumableArray_default()(listitems), toConsumableArray_default()(arr1)));
|
|
|
var _iterator2 = createForOfIteratorHelper_default()(changeRows),
|
|
|
_step2;
|
|
|
try {
|
|
|
for (_iterator2.s(); !(_step2 = _iterator2.n()).done;) {
|
|
|
var _item = _step2.value;
|
|
|
if (_item.identifier) {
|
|
|
selectedShixunId.current.add(_item.id);
|
|
|
} else {
|
|
|
selectedQuestionId.current.add(_item.id);
|
|
|
}
|
|
|
}
|
|
|
} catch (err) {
|
|
|
_iterator2.e(err);
|
|
|
} finally {
|
|
|
_iterator2.f();
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
},
|
|
|
columns: [{
|
|
|
title: '题型',
|
|
|
dataIndex: 'item_type',
|
|
|
key: 'item_type',
|
|
|
render: function render(value, record, index) {
|
|
|
var _typeData$filter;
|
|
|
return /*#__PURE__*/(0,jsx_runtime.jsx)("span", {
|
|
|
children: isshixun || record !== null && record !== void 0 && record.challenge_names ? '实训题' : typeData === null || typeData === void 0 || (_typeData$filter = typeData.filter(function (item) {
|
|
|
return item.value === value;
|
|
|
})) === null || _typeData$filter === void 0 || (_typeData$filter = _typeData$filter[0]) === null || _typeData$filter === void 0 ? void 0 : _typeData$filter.name
|
|
|
});
|
|
|
}
|
|
|
}, {
|
|
|
title: '试题名称',
|
|
|
dataIndex: 'name',
|
|
|
width: isshixun ? '30%' : '60%',
|
|
|
key: 'name',
|
|
|
render: function render(value, record, index) {
|
|
|
var _record$program_attr;
|
|
|
return /*#__PURE__*/(0,jsx_runtime.jsx)(RenderHtml/* default */.Z, {
|
|
|
showLines: 1,
|
|
|
showTextOnly: true,
|
|
|
value: isshixun || record !== null && record !== void 0 && record.challenge_names ? record !== null && record !== void 0 && record.title || value === null ? '--' : value : (record === null || record === void 0 ? void 0 : record.item_type) == "BPROGRAM" ? record === null || record === void 0 || (_record$program_attr = record.program_attr) === null || _record$program_attr === void 0 ? void 0 : _record$program_attr.description : value || '- -'
|
|
|
}, 1);
|
|
|
}
|
|
|
}, {
|
|
|
title: '创建者',
|
|
|
dataIndex: 'author_name',
|
|
|
key: 'author_name',
|
|
|
hidden: !isshixun
|
|
|
}, {
|
|
|
title: '所属单位',
|
|
|
dataIndex: 'author_school_name',
|
|
|
key: 'author_school_name',
|
|
|
hidden: !isshixun
|
|
|
}, {
|
|
|
title: '难度',
|
|
|
dataIndex: 'difficulty',
|
|
|
key: 'difficulty',
|
|
|
render: function render(value, record, index) {
|
|
|
var _difficultyData$filte, _difficultyData$filte2;
|
|
|
return /*#__PURE__*/(0,jsx_runtime.jsx)("span", {
|
|
|
children: isshixun || record !== null && record !== void 0 && record.challenge_names ? (record === null || record === void 0 ? void 0 : record.level) || (difficultyData === null || difficultyData === void 0 || (_difficultyData$filte = difficultyData.filter(function (item) {
|
|
|
return item.value === value;
|
|
|
})) === null || _difficultyData$filte === void 0 || (_difficultyData$filte = _difficultyData$filte[0]) === null || _difficultyData$filte === void 0 ? void 0 : _difficultyData$filte.name) : difficultyData === null || difficultyData === void 0 || (_difficultyData$filte2 = difficultyData.filter(function (item) {
|
|
|
return item.value === value;
|
|
|
})) === null || _difficultyData$filte2 === void 0 || (_difficultyData$filte2 = _difficultyData$filte2[0]) === null || _difficultyData$filte2 === void 0 ? void 0 : _difficultyData$filte2.name
|
|
|
});
|
|
|
}
|
|
|
}, {
|
|
|
title: '关卡数量',
|
|
|
dataIndex: 'challenges_count',
|
|
|
key: 'challenges_count',
|
|
|
hidden: !isshixun,
|
|
|
render: function render(value, record, index) {
|
|
|
return /*#__PURE__*/(0,jsx_runtime.jsx)("span", {
|
|
|
children: value || '- -'
|
|
|
});
|
|
|
}
|
|
|
}, {
|
|
|
title: '使用次数',
|
|
|
dataIndex: 'quotes',
|
|
|
key: 'quotes',
|
|
|
render: function render(value, record, index) {
|
|
|
return /*#__PURE__*/(0,jsx_runtime.jsx)("span", {
|
|
|
children: isshixun || record !== null && record !== void 0 && record.challenge_names ? (record === null || record === void 0 ? void 0 : record.study_count) || (record === null || record === void 0 ? void 0 : record.stu_num) : value
|
|
|
});
|
|
|
}
|
|
|
}, {
|
|
|
title: /*#__PURE__*/(0,jsx_runtime.jsxs)("span", {
|
|
|
children: ["\u53D1\u5E03\u72B6\u6001 ", /*#__PURE__*/(0,jsx_runtime.jsx)(tooltip/* default */.Z, {
|
|
|
title: "\u672A\u53D1\u5E03\u7684\u5B9E\u8DF5\u9879\u76EE\u4E0D\u80FD\u88AB\u9009\u7528",
|
|
|
children: /*#__PURE__*/(0,jsx_runtime.jsx)(QuestionCircleOutlined/* default */.Z, {})
|
|
|
})]
|
|
|
}),
|
|
|
dataIndex: 'shixun_tag_num_name',
|
|
|
key: 'shixun_tag_num_name',
|
|
|
hidden: !isshixun,
|
|
|
render: function render(value, record, index) {
|
|
|
return /*#__PURE__*/(0,jsx_runtime.jsx)("span", {
|
|
|
children: value || '- -'
|
|
|
});
|
|
|
}
|
|
|
}, {
|
|
|
title: '操作',
|
|
|
dataIndex: 'id',
|
|
|
key: 'item_type',
|
|
|
render: function render(value, record, index) {
|
|
|
return /*#__PURE__*/(0,jsx_runtime.jsxs)("div", {
|
|
|
style: {
|
|
|
flex: 1,
|
|
|
textAlign: 'start'
|
|
|
},
|
|
|
children: [/*#__PURE__*/(0,jsx_runtime.jsx)("a", {
|
|
|
onClick: function onClick() {
|
|
|
var _typeData$filter2;
|
|
|
setqitem(objectSpread2_default()(objectSpread2_default()({}, record), {}, {
|
|
|
question_type: isshixun || record !== null && record !== void 0 && record.challenge_names ? 5 : typeData === null || typeData === void 0 || (_typeData$filter2 = typeData.filter(function (item) {
|
|
|
return item.value === (record === null || record === void 0 ? void 0 : record.item_type);
|
|
|
})) === null || _typeData$filter2 === void 0 || (_typeData$filter2 = _typeData$filter2[0]) === null || _typeData$filter2 === void 0 ? void 0 : _typeData$filter2.question_type
|
|
|
}));
|
|
|
setisshow(true);
|
|
|
},
|
|
|
children: "\u67E5\u770B"
|
|
|
}), (record === null || record === void 0 ? void 0 : record.shixun_tag_num) === 1 && /*#__PURE__*/(0,jsx_runtime.jsx)("a", {
|
|
|
target: "_blank",
|
|
|
href: "/shixuns/".concat(record === null || record === void 0 ? void 0 : record.identifier, "/challenges"),
|
|
|
style: {
|
|
|
marginLeft: 10
|
|
|
},
|
|
|
children: "\u53BB\u53D1\u5E03"
|
|
|
})]
|
|
|
});
|
|
|
}
|
|
|
}].filter(function (item) {
|
|
|
return !item.hidden;
|
|
|
})
|
|
|
}), /*#__PURE__*/(0,jsx_runtime.jsx)(pagination/* default */.Z, {
|
|
|
current: param.page,
|
|
|
total: (datas === null || datas === void 0 ? void 0 : datas.items_count) || (datas === null || datas === void 0 ? void 0 : datas.shixuns_count),
|
|
|
style: {
|
|
|
marginBottom: 20
|
|
|
},
|
|
|
defaultPageSize: param.per_page,
|
|
|
showTotal: function showTotal(e) {
|
|
|
return /*#__PURE__*/(0,jsx_runtime.jsxs)("span", {
|
|
|
children: ["\u5171\xA0", /*#__PURE__*/(0,jsx_runtime.jsx)("span", {
|
|
|
style: {
|
|
|
color: '#165DFF'
|
|
|
},
|
|
|
children: e
|
|
|
}), "\xA0\u6761\u6570\u636E"]
|
|
|
});
|
|
|
},
|
|
|
pageSize: param.per_page,
|
|
|
onChange: function onChange(e, limit) {
|
|
|
param.page = e;
|
|
|
param.per_page = limit;
|
|
|
setparam(objectSpread2_default()({}, param));
|
|
|
getdatas(objectSpread2_default()({}, param));
|
|
|
}
|
|
|
}), /*#__PURE__*/(0,jsx_runtime.jsxs)("div", {
|
|
|
className: AddQuestionsModalmodules.bottom,
|
|
|
children: [/*#__PURE__*/(0,jsx_runtime.jsx)(es_button/* default */.ZP, {
|
|
|
className: AddQuestionsModalmodules.no,
|
|
|
onClick: function onClick() {
|
|
|
setScoreShow(false);
|
|
|
},
|
|
|
children: "\u53D6\u6D88"
|
|
|
}), /*#__PURE__*/(0,jsx_runtime.jsx)(es_button/* default */.ZP, {
|
|
|
loading: isloadings,
|
|
|
style: {
|
|
|
width: isloadings && 75
|
|
|
},
|
|
|
className: AddQuestionsModalmodules.yes,
|
|
|
onClick: /*#__PURE__*/asyncToGenerator_default()( /*#__PURE__*/regeneratorRuntime_default()().mark(function _callee() {
|
|
|
var hasUsedShixun;
|
|
|
return regeneratorRuntime_default()().wrap(function _callee$(_context) {
|
|
|
while (1) switch (_context.prev = _context.next) {
|
|
|
case 0:
|
|
|
if (!((listitems === null || listitems === void 0 ? void 0 : listitems.length) <= 0)) {
|
|
|
_context.next = 3;
|
|
|
break;
|
|
|
}
|
|
|
message/* default */.ZP.info('当前暂未选择数据');
|
|
|
return _context.abrupt("return");
|
|
|
case 3:
|
|
|
if (!checkHasUsedShixun) {
|
|
|
_context.next = 7;
|
|
|
break;
|
|
|
}
|
|
|
_context.next = 6;
|
|
|
return showReuseModal({
|
|
|
id: toConsumableArray_default()(selectedShixunId.current),
|
|
|
course_id: paramsFromUrl.coursesId,
|
|
|
type: 'shixun'
|
|
|
});
|
|
|
case 6:
|
|
|
hasUsedShixun = _context.sent;
|
|
|
case 7:
|
|
|
if (!checkHasUsedShixun || !hasUsedShixun) {
|
|
|
onOk(toConsumableArray_default()(selectedQuestionId.current), toConsumableArray_default()(selectedShixunId.current), true, listitems === null || listitems === void 0 ? void 0 : listitems.length);
|
|
|
}
|
|
|
case 8:
|
|
|
case "end":
|
|
|
return _context.stop();
|
|
|
}
|
|
|
}, _callee);
|
|
|
})),
|
|
|
children: "\u786E\u8BA4"
|
|
|
})]
|
|
|
})]
|
|
|
}), /*#__PURE__*/(0,jsx_runtime.jsx)(modal/* default */.Z, {
|
|
|
open: isshow,
|
|
|
title: '题目详情',
|
|
|
footer: false,
|
|
|
className: AddQuestionsModalmodules.previewModal,
|
|
|
width: 1000,
|
|
|
centered: true,
|
|
|
onCancel: function onCancel() {
|
|
|
setisshow(false);
|
|
|
},
|
|
|
onOk: function onOk() {
|
|
|
setisshow(false);
|
|
|
},
|
|
|
children: /*#__PURE__*/(0,jsx_runtime.jsx)(SaveItem, {
|
|
|
qitem: qitem
|
|
|
})
|
|
|
}), /*#__PURE__*/(0,jsx_runtime.jsx)(ReuseShixunModal/* default */.Z, {
|
|
|
visible: reuseModalVisible,
|
|
|
position: "\u5DF2\u9009\u8BD5\u9898",
|
|
|
onCancel: closeReuseModal,
|
|
|
onOk: ( /*#__PURE__*/function () {
|
|
|
var _ref3 = asyncToGenerator_default()( /*#__PURE__*/regeneratorRuntime_default()().mark(function _callee2(ids) {
|
|
|
var shixunCopyIds, deletedShixunIds, _iterator3, _step3, item;
|
|
|
return regeneratorRuntime_default()().wrap(function _callee2$(_context2) {
|
|
|
while (1) switch (_context2.prev = _context2.next) {
|
|
|
case 0:
|
|
|
shixunCopyIds = [];
|
|
|
deletedShixunIds = [];
|
|
|
_iterator3 = createForOfIteratorHelper_default()(ids);
|
|
|
try {
|
|
|
for (_iterator3.s(); !(_step3 = _iterator3.n()).done;) {
|
|
|
item = _step3.value;
|
|
|
if (item.is_copy === 1 && item.is_use === 1) {
|
|
|
shixunCopyIds.push(item.id);
|
|
|
}
|
|
|
if (item.is_use === 0) {
|
|
|
deletedShixunIds.push(item.id);
|
|
|
}
|
|
|
}
|
|
|
} catch (err) {
|
|
|
_iterator3.e(err);
|
|
|
} finally {
|
|
|
_iterator3.f();
|
|
|
}
|
|
|
_context2.next = 6;
|
|
|
return onOk(toConsumableArray_default()(selectedQuestionId.current), toConsumableArray_default()(selectedShixunId.current).filter(function (id) {
|
|
|
return !deletedShixunIds.includes(id);
|
|
|
}), true, listitems === null || listitems === void 0 ? void 0 : listitems.length, shixunCopyIds);
|
|
|
case 6:
|
|
|
case "end":
|
|
|
return _context2.stop();
|
|
|
}
|
|
|
}, _callee2);
|
|
|
}));
|
|
|
return function (_x3) {
|
|
|
return _ref3.apply(this, arguments);
|
|
|
};
|
|
|
}()),
|
|
|
renderData: renderData,
|
|
|
inPaper: false,
|
|
|
modalType: "multiple",
|
|
|
type: "shixun"
|
|
|
})]
|
|
|
});
|
|
|
};
|
|
|
/* harmony default export */ var AddQuestionsModal = (AddModal);
|
|
|
|
|
|
/***/ }),
|
|
|
|
|
|
/***/ 70010:
|
|
|
/*!*********************************************!*\
|
|
|
!*** ./src/assets/images/paper/jiangxu.svg ***!
|
|
|
\*********************************************/
|
|
|
/***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) {
|
|
|
|
|
|
/* unused harmony export ReactComponent */
|
|
|
/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! react */ 59301);
|
|
|
function _createForOfIteratorHelper(o, allowArrayLike) { var it = typeof Symbol !== "undefined" && o[Symbol.iterator] || o["@@iterator"]; if (!it) { if (Array.isArray(o) || (it = _unsupportedIterableToArray(o)) || allowArrayLike && o && typeof o.length === "number") { if (it) o = it; var i = 0; var F = function F() {}; return { s: F, n: function n() { if (i >= o.length) return { done: true }; return { done: false, value: o[i++] }; }, e: function e(_e) { throw _e; }, f: F }; } throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); } var normalCompletion = true, didErr = false, err; return { s: function s() { it = it.call(o); }, n: function n() { var step = it.next(); normalCompletion = step.done; return step; }, e: function e(_e2) { didErr = true; err = _e2; }, f: function f() { try { if (!normalCompletion && it["return"] != null) it["return"](); } finally { if (didErr) throw err; } } }; }
|
|
|
function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === "string") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return Array.from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); }
|
|
|
function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) arr2[i] = arr[i]; return arr2; }
|
|
|
var __defProp = Object.defineProperty;
|
|
|
var __getOwnPropSymbols = Object.getOwnPropertySymbols;
|
|
|
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
|
var __propIsEnum = Object.prototype.propertyIsEnumerable;
|
|
|
var __defNormalProp = function __defNormalProp(obj, key, value) {
|
|
|
return key in obj ? __defProp(obj, key, {
|
|
|
enumerable: true,
|
|
|
configurable: true,
|
|
|
writable: true,
|
|
|
value: value
|
|
|
}) : obj[key] = value;
|
|
|
};
|
|
|
var __spreadValues = function __spreadValues(a, b) {
|
|
|
for (var prop in b || (b = {})) if (__hasOwnProp.call(b, prop)) __defNormalProp(a, prop, b[prop]);
|
|
|
if (__getOwnPropSymbols) {
|
|
|
var _iterator = _createForOfIteratorHelper(__getOwnPropSymbols(b)),
|
|
|
_step;
|
|
|
try {
|
|
|
for (_iterator.s(); !(_step = _iterator.n()).done;) {
|
|
|
var prop = _step.value;
|
|
|
if (__propIsEnum.call(b, prop)) __defNormalProp(a, prop, b[prop]);
|
|
|
}
|
|
|
} catch (err) {
|
|
|
_iterator.e(err);
|
|
|
} finally {
|
|
|
_iterator.f();
|
|
|
}
|
|
|
}
|
|
|
return a;
|
|
|
};
|
|
|
|
|
|
var SvgJiangxu = function SvgJiangxu(props) {
|
|
|
return /* @__PURE__ */React.createElement("svg", __spreadValues({
|
|
|
className: "jiangxu_svg__icon",
|
|
|
viewBox: "0 0 1024 1024",
|
|
|
xmlns: "http://www.w3.org/2000/svg",
|
|
|
width: 32,
|
|
|
height: 32
|
|
|
}, props), /* @__PURE__ */React.createElement("path", {
|
|
|
d: "M365.714 73.143H1024v73.143H365.714zm0 292.571H1024v73.143H365.714zm0 292.572H1024v73.143H365.714zm0 292.571H1024V1024H365.714v-73.143z",
|
|
|
fill: "#98BDF7"
|
|
|
}), /* @__PURE__ */React.createElement("path", {
|
|
|
d: "m248.686 803.182-65.829 75.922V658.286h-73.143v220.818l-65.828-75.995L0 851.383 146.286 1024 292.57 851.53z",
|
|
|
fill: "#145DFF"
|
|
|
}), /* @__PURE__ */React.createElement("path", {
|
|
|
d: "M146.286 0 0 158.72l43.886 55.223 65.828-75.922v227.693h73.143V138.021l65.829 75.922 43.885-55.223z",
|
|
|
fill: "#98BDF7"
|
|
|
}));
|
|
|
};
|
|
|
|
|
|
/* harmony default export */ __webpack_exports__.Z = ("data:image/svg+xml;base64,PHN2ZyBjbGFzcz0iaWNvbiIgdmlld0JveD0iMCAwIDEwMjQgMTAyNCIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIiB3aWR0aD0iMzIiIGhlaWdodD0iMzIiPjxwYXRoIGQ9Ik0zNjUuNzE0IDczLjE0M0gxMDI0djczLjE0M0gzNjUuNzE0em0wIDI5Mi41NzFIMTAyNHY3My4xNDNIMzY1LjcxNHptMCAyOTIuNTcySDEwMjR2NzMuMTQzSDM2NS43MTR6bTAgMjkyLjU3MUgxMDI0VjEwMjRIMzY1LjcxNHYtNzMuMTQzeiIgZmlsbD0iIzk4QkRGNyIvPjxwYXRoIGQ9Im0yNDguNjg2IDgwMy4xODItNjUuODI5IDc1LjkyMlY2NTguMjg2aC03My4xNDN2MjIwLjgxOGwtNjUuODI4LTc1Ljk5NUwwIDg1MS4zODMgMTQ2LjI4NiAxMDI0IDI5Mi41NyA4NTEuNTN6IiBmaWxsPSIjMTQ1REZGIi8+PHBhdGggZD0iTTE0Ni4yODYgMCAwIDE1OC43Mmw0My44ODYgNTUuMjIzIDY1LjgyOC03NS45MjJ2MjI3LjY5M2g3My4xNDNWMTM4LjAyMWw2NS44MjkgNzUuOTIyIDQzLjg4NS01NS4yMjN6IiBmaWxsPSIjOThCREY3Ii8+PC9zdmc+");
|
|
|
|
|
|
/***/ }),
|
|
|
|
|
|
/***/ 38676:
|
|
|
/*!*********************************************!*\
|
|
|
!*** ./src/assets/images/paper/shengxu.svg ***!
|
|
|
\*********************************************/
|
|
|
/***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) {
|
|
|
|
|
|
/* unused harmony export ReactComponent */
|
|
|
/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! react */ 59301);
|
|
|
function _createForOfIteratorHelper(o, allowArrayLike) { var it = typeof Symbol !== "undefined" && o[Symbol.iterator] || o["@@iterator"]; if (!it) { if (Array.isArray(o) || (it = _unsupportedIterableToArray(o)) || allowArrayLike && o && typeof o.length === "number") { if (it) o = it; var i = 0; var F = function F() {}; return { s: F, n: function n() { if (i >= o.length) return { done: true }; return { done: false, value: o[i++] }; }, e: function e(_e) { throw _e; }, f: F }; } throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); } var normalCompletion = true, didErr = false, err; return { s: function s() { it = it.call(o); }, n: function n() { var step = it.next(); normalCompletion = step.done; return step; }, e: function e(_e2) { didErr = true; err = _e2; }, f: function f() { try { if (!normalCompletion && it["return"] != null) it["return"](); } finally { if (didErr) throw err; } } }; }
|
|
|
function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === "string") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return Array.from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); }
|
|
|
function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) arr2[i] = arr[i]; return arr2; }
|
|
|
var __defProp = Object.defineProperty;
|
|
|
var __getOwnPropSymbols = Object.getOwnPropertySymbols;
|
|
|
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
|
var __propIsEnum = Object.prototype.propertyIsEnumerable;
|
|
|
var __defNormalProp = function __defNormalProp(obj, key, value) {
|
|
|
return key in obj ? __defProp(obj, key, {
|
|
|
enumerable: true,
|
|
|
configurable: true,
|
|
|
writable: true,
|
|
|
value: value
|
|
|
}) : obj[key] = value;
|
|
|
};
|
|
|
var __spreadValues = function __spreadValues(a, b) {
|
|
|
for (var prop in b || (b = {})) if (__hasOwnProp.call(b, prop)) __defNormalProp(a, prop, b[prop]);
|
|
|
if (__getOwnPropSymbols) {
|
|
|
var _iterator = _createForOfIteratorHelper(__getOwnPropSymbols(b)),
|
|
|
_step;
|
|
|
try {
|
|
|
for (_iterator.s(); !(_step = _iterator.n()).done;) {
|
|
|
var prop = _step.value;
|
|
|
if (__propIsEnum.call(b, prop)) __defNormalProp(a, prop, b[prop]);
|
|
|
}
|
|
|
} catch (err) {
|
|
|
_iterator.e(err);
|
|
|
} finally {
|
|
|
_iterator.f();
|
|
|
}
|
|
|
}
|
|
|
return a;
|
|
|
};
|
|
|
|
|
|
var SvgShengxu = function SvgShengxu(props) {
|
|
|
return /* @__PURE__ */React.createElement("svg", __spreadValues({
|
|
|
className: "shengxu_svg__icon",
|
|
|
viewBox: "0 0 1024 1024",
|
|
|
xmlns: "http://www.w3.org/2000/svg",
|
|
|
width: 32,
|
|
|
height: 32
|
|
|
}, props), /* @__PURE__ */React.createElement("path", {
|
|
|
d: "M365.714 73.143H1024v73.143H365.714zm0 292.571H1024v73.143H365.714zm0 292.572H1024v73.143H365.714zm0 292.571H1024V1024H365.714v-73.143zM248.686 803.182l-65.829 75.922V658.286h-73.143v220.818l-65.828-75.995L0 851.383 146.286 1024 292.57 851.53z",
|
|
|
fill: "#98BDF7"
|
|
|
}), /* @__PURE__ */React.createElement("path", {
|
|
|
d: "M146.286 0 0 158.72l43.886 55.223 65.828-75.922v227.693h73.143V138.021l65.829 75.922 43.885-55.223z",
|
|
|
fill: "#145DFF"
|
|
|
}));
|
|
|
};
|
|
|
|
|
|
/* harmony default export */ __webpack_exports__.Z = ("data:image/svg+xml;base64,PHN2ZyBjbGFzcz0iaWNvbiIgdmlld0JveD0iMCAwIDEwMjQgMTAyNCIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIiB3aWR0aD0iMzIiIGhlaWdodD0iMzIiPjxwYXRoIGQ9Ik0zNjUuNzE0IDczLjE0M0gxMDI0djczLjE0M0gzNjUuNzE0em0wIDI5Mi41NzFIMTAyNHY3My4xNDNIMzY1LjcxNHptMCAyOTIuNTcySDEwMjR2NzMuMTQzSDM2NS43MTR6bTAgMjkyLjU3MUgxMDI0VjEwMjRIMzY1LjcxNHYtNzMuMTQzek0yNDguNjg2IDgwMy4xODJsLTY1LjgyOSA3NS45MjJWNjU4LjI4NmgtNzMuMTQzdjIyMC44MThsLTY1LjgyOC03NS45OTVMMCA4NTEuMzgzIDE0Ni4yODYgMTAyNCAyOTIuNTcgODUxLjUzeiIgZmlsbD0iIzk4QkRGNyIvPjxwYXRoIGQ9Ik0xNDYuMjg2IDAgMCAxNTguNzJsNDMuODg2IDU1LjIyMyA2NS44MjgtNzUuOTIydjIyNy42OTNoNzMuMTQzVjEzOC4wMjFsNjUuODI5IDc1LjkyMiA0My44ODUtNTUuMjIzeiIgZmlsbD0iIzE0NURGRiIvPjwvc3ZnPg==");
|
|
|
|
|
|
/***/ })
|
|
|
|
|
|
}]); |