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.
526 lines
29 KiB
526 lines
29 KiB
"use strict";
|
|
(self["webpackChunk"] = self["webpackChunk"] || []).push([[5148],{
|
|
|
|
/***/ 89326:
|
|
/*!***********************************************************************!*\
|
|
!*** ./src/pages/Classrooms/Lists/Polls/Answer/index.tsx + 4 modules ***!
|
|
\***********************************************************************/
|
|
/***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) {
|
|
|
|
// ESM COMPAT FLAG
|
|
__webpack_require__.r(__webpack_exports__);
|
|
|
|
// EXPORTS
|
|
__webpack_require__.d(__webpack_exports__, {
|
|
checkedOtherName: function() { return /* binding */ checkedOtherName; },
|
|
"default": function() { return /* binding */ Polls_Answer; }
|
|
});
|
|
|
|
// EXTERNAL MODULE: ./node_modules/_react@17.0.2@react/index.js
|
|
var _react_17_0_2_react = __webpack_require__(59301);
|
|
// EXTERNAL MODULE: ./src/.umi-production/exports.ts + 15 modules
|
|
var _umi_production_exports = __webpack_require__(67866);
|
|
// EXTERNAL MODULE: ./node_modules/_antd@5.9.0@antd/es/menu/index.js + 11 modules
|
|
var menu = __webpack_require__(20834);
|
|
// EXTERNAL MODULE: ./node_modules/_antd@5.9.0@antd/es/layout/index.js
|
|
var layout = __webpack_require__(44000);
|
|
// 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/message/index.js + 4 modules
|
|
var message = __webpack_require__(8591);
|
|
// EXTERNAL MODULE: ./node_modules/_antd@5.9.0@antd/es/row/index.js
|
|
var row = __webpack_require__(95237);
|
|
// EXTERNAL MODULE: ./node_modules/_antd@5.9.0@antd/es/col/index.js
|
|
var col = __webpack_require__(43604);
|
|
// EXTERNAL MODULE: ./node_modules/_antd@5.9.0@antd/es/progress/index.js + 13 modules
|
|
var progress = __webpack_require__(93948);
|
|
// EXTERNAL MODULE: ./node_modules/_antd@5.9.0@antd/es/anchor/index.js + 4 modules
|
|
var es_anchor = __webpack_require__(79817);
|
|
// EXTERNAL MODULE: ./node_modules/_antd@5.9.0@antd/es/tooltip/index.js + 3 modules
|
|
var tooltip = __webpack_require__(6848);
|
|
;// CONCATENATED MODULE: ./src/pages/Classrooms/Lists/Polls/Answer/index.less?modules
|
|
// extracted by mini-css-extract-plugin
|
|
/* harmony default export */ var Answermodules = ({"flex_box_center":"flex_box_center___iNvBA","flex_space_between":"flex_space_between___btrNY","flex_box_vertical_center":"flex_box_vertical_center___jNwqd","flex_box_center_end":"flex_box_center_end___yhhzS","flex_box_column":"flex_box_column___XCG9Z","bg":"bg___pkT5R","title":"title___txwwg","questionIcons":"questionIcons___bUmrp","green":"green___pU_n6","orange":"orange___WqPTj","greenTip":"greenTip___xA46L","redTip":"redTip___cLZrd","orangeTip":"orangeTip___IYw_9","pollDesc":"pollDesc___k8j8U","answered":"answered___Wv6LV","unanswer":"unanswer___HFr5V","anchor":"anchor___wiaGO","answerFlag":"answerFlag___Son3q","answerActive":"answerActive___vadIk","redactivie":"redactivie___lv5Yx","questionItem":"questionItem___eheF5","answerWrap":"answerWrap___q0vMa","answerSubjective":"answerSubjective___g0GxR","otherInput":"otherInput___lNi1t","submitButton":"submitButton___Kwl_S","flexRow":"flexRow___CzS9_","header_style":"header_style___IO875","header_content":"header_content___rvYNy","header_title":"header_title___vaUUE","header_button":"header_button___pO_DR","answerInfo":"answerInfo___pUCTt","answerProgress":"answerProgress___u6eCf","dottedLineWrapper":"dottedLineWrapper___OntUi","leftHalfCircle":"leftHalfCircle___W0Nay","dottedLine":"dottedLine___KvX72","rightHalfCircle":"rightHalfCircle___NshfJ","answerSheetWrap":"answerSheetWrap___slZzY","answerSheetQuestionTitle":"answerSheetQuestionTitle___VK50d","user_info":"user_info___nyGwf","user_label":"user_label___bAPw8","user_value":"user_value___pZ4rK"});
|
|
// EXTERNAL MODULE: ./src/utils/util.tsx
|
|
var util = __webpack_require__(13462);
|
|
// EXTERNAL MODULE: ./src/service/classrooms.ts
|
|
var classrooms = __webpack_require__(65998);
|
|
// EXTERNAL MODULE: ./src/utils/authority.ts
|
|
var authority = __webpack_require__(88141);
|
|
// 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/index.js + 5 modules
|
|
var input = __webpack_require__(98135);
|
|
;// CONCATENATED MODULE: ./src/pages/Classrooms/Lists/Polls/Answer/components/Single.tsx
|
|
|
|
|
|
|
|
|
|
|
|
const Single = ({
|
|
itemData,
|
|
answerData,
|
|
onSave = () => {
|
|
}
|
|
}) => {
|
|
var _a, _b, _c, _d;
|
|
const [data, setData] = (0,_react_17_0_2_react.useState)([]);
|
|
const [checkedData, setCheckedData] = (0,_react_17_0_2_react.useState)();
|
|
const [otherData, setOtherData] = (0,_react_17_0_2_react.useState)();
|
|
(0,_react_17_0_2_react.useEffect)(() => {
|
|
var _a2;
|
|
setData(((_a2 = itemData == null ? void 0 : itemData.question) == null ? void 0 : _a2.answers) || []);
|
|
}, [(_a = itemData == null ? void 0 : itemData.question) == null ? void 0 : _a.answers]);
|
|
(0,_react_17_0_2_react.useEffect)(() => {
|
|
var _a2, _b2;
|
|
setCheckedData((_b2 = (_a2 = itemData == null ? void 0 : itemData.question) == null ? void 0 : _a2.poll_answer_ids) == null ? void 0 : _b2[0]);
|
|
}, [(_b = itemData == null ? void 0 : itemData.question) == null ? void 0 : _b.poll_answer_ids]);
|
|
(0,_react_17_0_2_react.useEffect)(() => {
|
|
var _a2;
|
|
setOtherData((_a2 = itemData == null ? void 0 : itemData.question) == null ? void 0 : _a2.poll_vote_texts);
|
|
}, [(_c = itemData == null ? void 0 : itemData.question) == null ? void 0 : _c.poll_vote_texts]);
|
|
const handerChangeSingle = (value, id) => {
|
|
var _a2;
|
|
setCheckedData(value);
|
|
const findOtherId = (_a2 = data.find((item) => checkedOtherName(item.answer_text))) == null ? void 0 : _a2.answer_id;
|
|
if (value === findOtherId) {
|
|
onSave(id, value, otherData);
|
|
} else {
|
|
onSave(id, value, "");
|
|
}
|
|
};
|
|
const handleBlurOhter = (id) => {
|
|
var _a2;
|
|
if (!checkedData) {
|
|
return;
|
|
}
|
|
const findOtherId = (_a2 = data.find((item) => checkedOtherName(item.answer_text))) == null ? void 0 : _a2.answer_id;
|
|
if (checkedData === findOtherId) {
|
|
onSave(id, checkedData, otherData);
|
|
} else {
|
|
onSave(id, checkedData, "");
|
|
}
|
|
};
|
|
return /* @__PURE__ */ _react_17_0_2_react.createElement(
|
|
es_radio/* default.Group */.ZP.Group,
|
|
{
|
|
disabled: (0,authority/* isAdmin */.GJ)() || (0,authority/* isStudent */.dE)() && ((_d = answerData == null ? void 0 : answerData.poll) == null ? void 0 : _d.user_poll_status) === 1,
|
|
value: checkedData,
|
|
onChange: (e) => {
|
|
var _a2;
|
|
handerChangeSingle(e.target.value, (_a2 = itemData == null ? void 0 : itemData.question) == null ? void 0 : _a2.id);
|
|
}
|
|
},
|
|
data.map((answer, index) => {
|
|
return /* @__PURE__ */ _react_17_0_2_react.createElement("div", { className: `${Answermodules.answerWrap} ${Answermodules.flexRow}`, key: index }, /* @__PURE__ */ _react_17_0_2_react.createElement(es_radio/* default */.ZP, { value: answer == null ? void 0 : answer.answer_id }, answer == null ? void 0 : answer.answer_text), checkedOtherName(answer == null ? void 0 : answer.answer_text) && /* @__PURE__ */ _react_17_0_2_react.createElement("div", { style: { marginTop: "10px" } }, /* @__PURE__ */ _react_17_0_2_react.createElement(
|
|
input["default"].TextArea,
|
|
{
|
|
className: Answermodules.otherInput,
|
|
value: otherData,
|
|
onChange: (e) => setOtherData(e.target.value),
|
|
onBlur: (e) => {
|
|
var _a2;
|
|
return handleBlurOhter((_a2 = itemData == null ? void 0 : itemData.question) == null ? void 0 : _a2.id);
|
|
}
|
|
}
|
|
)));
|
|
})
|
|
);
|
|
};
|
|
/* harmony default export */ var components_Single = (Single);
|
|
|
|
// 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/Classrooms/Lists/Polls/Answer/components/Multiple.tsx
|
|
|
|
|
|
|
|
|
|
|
|
const Multiple = ({
|
|
itemData,
|
|
answerData,
|
|
onSave = () => {
|
|
}
|
|
}) => {
|
|
var _a, _b, _c, _d;
|
|
const [data, setData] = (0,_react_17_0_2_react.useState)([]);
|
|
const [checkedData, setCheckedData] = (0,_react_17_0_2_react.useState)();
|
|
const [otherData, setOtherData] = (0,_react_17_0_2_react.useState)();
|
|
(0,_react_17_0_2_react.useEffect)(() => {
|
|
var _a2;
|
|
setData(((_a2 = itemData == null ? void 0 : itemData.question) == null ? void 0 : _a2.answers) || []);
|
|
}, [(_a = itemData == null ? void 0 : itemData.question) == null ? void 0 : _a.answers]);
|
|
(0,_react_17_0_2_react.useEffect)(() => {
|
|
var _a2;
|
|
setCheckedData((_a2 = itemData == null ? void 0 : itemData.question) == null ? void 0 : _a2.poll_answer_ids);
|
|
}, [(_b = itemData == null ? void 0 : itemData.question) == null ? void 0 : _b.poll_answer_ids]);
|
|
(0,_react_17_0_2_react.useEffect)(() => {
|
|
var _a2;
|
|
setOtherData((_a2 = itemData == null ? void 0 : itemData.question) == null ? void 0 : _a2.poll_vote_texts);
|
|
}, [(_c = itemData == null ? void 0 : itemData.question) == null ? void 0 : _c.poll_vote_texts]);
|
|
const handerChangeMultiple = (value, id) => {
|
|
var _a2;
|
|
setCheckedData(value);
|
|
const findOtherId = (_a2 = data.find((item) => checkedOtherName(item.answer_text))) == null ? void 0 : _a2.answer_id;
|
|
if (value.includes(findOtherId)) {
|
|
onSave(id, value, otherData);
|
|
} else {
|
|
onSave(id, value, "");
|
|
}
|
|
};
|
|
const handleBlurOhter = (id) => {
|
|
var _a2;
|
|
if (!(checkedData == null ? void 0 : checkedData.length)) {
|
|
return;
|
|
}
|
|
const findOtherId = (_a2 = data.find((item) => checkedOtherName(item.answer_text))) == null ? void 0 : _a2.answer_id;
|
|
if (checkedData.includes(findOtherId)) {
|
|
onSave(id, checkedData, otherData);
|
|
} else {
|
|
onSave(id, checkedData, "");
|
|
}
|
|
};
|
|
return /* @__PURE__ */ _react_17_0_2_react.createElement(
|
|
es_checkbox["default"].Group,
|
|
{
|
|
style: { display: "block" },
|
|
disabled: (0,authority/* isAdmin */.GJ)() || (0,authority/* isStudent */.dE)() && ((_d = answerData == null ? void 0 : answerData.poll) == null ? void 0 : _d.user_poll_status) === 1,
|
|
value: checkedData,
|
|
onChange: (value) => {
|
|
var _a2;
|
|
handerChangeMultiple(value, (_a2 = itemData == null ? void 0 : itemData.question) == null ? void 0 : _a2.id);
|
|
}
|
|
},
|
|
data == null ? void 0 : data.map((answer, index) => {
|
|
return /* @__PURE__ */ _react_17_0_2_react.createElement("div", { className: `${Answermodules.answerWrap} ${Answermodules.flexRow}` }, /* @__PURE__ */ _react_17_0_2_react.createElement(es_checkbox["default"], { value: answer == null ? void 0 : answer.answer_id }, answer == null ? void 0 : answer.answer_text), checkedOtherName(answer == null ? void 0 : answer.answer_text) && /* @__PURE__ */ _react_17_0_2_react.createElement("div", { style: { marginTop: "10px" } }, /* @__PURE__ */ _react_17_0_2_react.createElement(
|
|
input["default"].TextArea,
|
|
{
|
|
className: Answermodules.otherInput,
|
|
value: otherData,
|
|
onChange: (e) => setOtherData(e.target.value),
|
|
onBlur: (e) => {
|
|
var _a2;
|
|
return handleBlurOhter((_a2 = itemData == null ? void 0 : itemData.question) == null ? void 0 : _a2.id);
|
|
}
|
|
}
|
|
)));
|
|
})
|
|
);
|
|
};
|
|
/* harmony default export */ var components_Multiple = (Multiple);
|
|
|
|
;// CONCATENATED MODULE: ./src/pages/Classrooms/Lists/Polls/Answer/components/Subjective.tsx
|
|
|
|
|
|
|
|
const Subjective = ({
|
|
itemData,
|
|
answerData,
|
|
onSave = () => {
|
|
}
|
|
}) => {
|
|
var _a, _b;
|
|
const [otherData, setOtherData] = (0,_react_17_0_2_react.useState)();
|
|
(0,_react_17_0_2_react.useEffect)(() => {
|
|
var _a2;
|
|
setOtherData((_a2 = itemData == null ? void 0 : itemData.question) == null ? void 0 : _a2.poll_vote_texts);
|
|
}, [(_a = itemData == null ? void 0 : itemData.question) == null ? void 0 : _a.poll_vote_texts]);
|
|
return /* @__PURE__ */ _react_17_0_2_react.createElement("div", null, /* @__PURE__ */ _react_17_0_2_react.createElement(
|
|
"textarea",
|
|
{
|
|
className: Answermodules.answerSubjective,
|
|
placeholder: "\u5728\u6B64\u586B\u5165\u7B54\u6848",
|
|
disabled: (0,authority/* isAdmin */.GJ)() || (0,authority/* isStudent */.dE)() && ((_b = answerData == null ? void 0 : answerData.poll) == null ? void 0 : _b.user_poll_status) === 1,
|
|
value: otherData,
|
|
onChange: (e) => setOtherData(e.target.value),
|
|
onBlur: (e) => {
|
|
var _a2;
|
|
return onSave((_a2 = itemData == null ? void 0 : itemData.question) == null ? void 0 : _a2.id, null, otherData);
|
|
}
|
|
}
|
|
));
|
|
};
|
|
/* harmony default export */ var components_Subjective = (Subjective);
|
|
|
|
// EXTERNAL MODULE: ./src/components/RenderHtml/index.tsx
|
|
var RenderHtml = __webpack_require__(16921);
|
|
// EXTERNAL MODULE: ./node_modules/_@ant-design_icons@5.3.7@@ant-design/icons/es/icons/MinusSquareOutlined.js + 1 modules
|
|
var MinusSquareOutlined = __webpack_require__(28396);
|
|
// EXTERNAL MODULE: ./node_modules/_@ant-design_icons@5.3.7@@ant-design/icons/es/icons/PlusSquareOutlined.js + 1 modules
|
|
var PlusSquareOutlined = __webpack_require__(38391);
|
|
;// CONCATENATED MODULE: ./src/pages/Classrooms/Lists/Polls/Answer/index.tsx
|
|
/* provided dependency */ var React = __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 __objRest = (source, exclude) => {
|
|
var target = {};
|
|
for (var prop in source)
|
|
if (__hasOwnProp.call(source, prop) && exclude.indexOf(prop) < 0)
|
|
target[prop] = source[prop];
|
|
if (source != null && __getOwnPropSymbols)
|
|
for (var prop of __getOwnPropSymbols(source)) {
|
|
if (exclude.indexOf(prop) < 0 && __propIsEnum.call(source, prop))
|
|
target[prop] = source[prop];
|
|
}
|
|
return target;
|
|
};
|
|
var __async = (__this, __arguments, generator) => {
|
|
return new Promise((resolve, reject) => {
|
|
var fulfilled = (value) => {
|
|
try {
|
|
step(generator.next(value));
|
|
} catch (e) {
|
|
reject(e);
|
|
}
|
|
};
|
|
var rejected = (value) => {
|
|
try {
|
|
step(generator.throw(value));
|
|
} catch (e) {
|
|
reject(e);
|
|
}
|
|
};
|
|
var step = (x) => x.done ? resolve(x.value) : Promise.resolve(x.value).then(fulfilled, rejected);
|
|
step((generator = generator.apply(__this, __arguments)).next());
|
|
});
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
const { SubMenu } = menu["default"];
|
|
const { Content, Sider } = layout["default"];
|
|
const checkedOtherName = (naem) => {
|
|
return naem === "\u5176\u4ED6" || naem === "\u5176\u5B83";
|
|
};
|
|
const mapping = { 1: "\u5355\u9009", 2: "\u591A\u9009", 3: "\u95EE\u7B54" };
|
|
const Answer = (_a) => {
|
|
var _b = _a, {
|
|
globalSetting,
|
|
loading,
|
|
user,
|
|
dispatch
|
|
} = _b, props = __objRest(_b, [
|
|
"globalSetting",
|
|
"loading",
|
|
"user",
|
|
"dispatch"
|
|
]);
|
|
var _a2, _b2, _c, _d, _e, _f, _g, _h, _i, _j, _k, _l, _m, _n, _o;
|
|
const params = (0,_umi_production_exports.useParams)();
|
|
const [answerData, setAnswerData] = (0,_react_17_0_2_react.useState)({});
|
|
const [isclick, setisclick] = (0,_react_17_0_2_react.useState)(false);
|
|
const [typeList, setTypeList] = (0,_react_17_0_2_react.useState)([
|
|
{ id: 1, name: "\u5355\u9009\u9898", open: true },
|
|
{ id: 2, name: "\u591A\u9009\u9898", open: true },
|
|
{ id: 3, name: "\u95EE\u7B54\u9898", open: true }
|
|
]);
|
|
(0,_react_17_0_2_react.useEffect)(() => {
|
|
initData();
|
|
}, [params.categoryId]);
|
|
(0,_react_17_0_2_react.useEffect)(() => {
|
|
dispatch({
|
|
type: "globalSetting/headerToggle",
|
|
payload: false
|
|
});
|
|
dispatch({
|
|
type: "globalSetting/footerToggle",
|
|
payload: false
|
|
});
|
|
return () => {
|
|
dispatch({
|
|
type: "globalSetting/headerToggle",
|
|
payload: true
|
|
});
|
|
dispatch({
|
|
type: "globalSetting/footerToggle",
|
|
payload: true
|
|
});
|
|
};
|
|
}, []);
|
|
const initData = () => __async(void 0, null, function* () {
|
|
var _a3, _b3, _c2;
|
|
const res = yield (0,classrooms/* getPollStartAnswer */.i7)(__spreadValues({}, params));
|
|
if (res) {
|
|
setAnswerData(res);
|
|
setTypeList([
|
|
{ id: 1, name: "\u5355\u9009\u9898", open: true, countSize: (_a3 = res == null ? void 0 : res.question_types) == null ? void 0 : _a3.q_singles },
|
|
{ id: 2, name: "\u591A\u9009\u9898", open: true, countSize: (_b3 = res == null ? void 0 : res.question_types) == null ? void 0 : _b3.q_doubles },
|
|
{ id: 3, name: "\u95EE\u7B54\u9898", open: true, countSize: (_c2 = res == null ? void 0 : res.question_types) == null ? void 0 : _c2.q_mains }
|
|
]);
|
|
}
|
|
});
|
|
const handleSave = (questionId, poll_answer_id, vote_text) => __async(void 0, null, function* () {
|
|
if (!questionId) {
|
|
console.error(`handleSave no questionId params`);
|
|
return;
|
|
}
|
|
const res = yield (0,classrooms/* updatePollVotes */.ID)({
|
|
questionId,
|
|
poll_answer_id,
|
|
vote_text
|
|
});
|
|
if (res == null ? void 0 : res.poll_vote) {
|
|
answerData.question_answered.find((item) => item.ques_id === questionId).ques_status = res.poll_vote.question_status;
|
|
setAnswerData(__spreadValues({}, answerData));
|
|
}
|
|
});
|
|
const handleVerifySubmit = () => {
|
|
var _a3;
|
|
let requiredCount = 0;
|
|
let optionalCount = 0;
|
|
let requiredKey = [];
|
|
let optionalKey = [];
|
|
(_a3 = answerData == null ? void 0 : answerData.question_answered) == null ? void 0 : _a3.map((item, key) => {
|
|
var _a4, _b3, _c2;
|
|
if ((item == null ? void 0 : item.ques_status) === 0) {
|
|
const is_necessary = (_c2 = (_b3 = (_a4 = answerData == null ? void 0 : answerData.questions) == null ? void 0 : _a4.find((que) => {
|
|
var _a5;
|
|
return ((_a5 = que == null ? void 0 : que.question) == null ? void 0 : _a5.id) === item.ques_id;
|
|
})) == null ? void 0 : _b3.question) == null ? void 0 : _c2.is_necessary;
|
|
if (is_necessary === 1) {
|
|
requiredKey.push(key);
|
|
requiredCount++;
|
|
} else {
|
|
optionalKey.push(key);
|
|
optionalCount++;
|
|
}
|
|
}
|
|
});
|
|
if (requiredCount > 0) {
|
|
modal["default"].info({
|
|
width: 530,
|
|
title: "\u63D0\u793A",
|
|
centered: true,
|
|
okText: "\u77E5\u9053\u5566",
|
|
onOk: () => {
|
|
setisclick(true);
|
|
const anchorId = `Anchor_${requiredKey[0]}`;
|
|
const anchorElement = document.getElementById(anchorId);
|
|
const offset = -100;
|
|
const y = anchorElement.getBoundingClientRect().top + window.pageYOffset + offset;
|
|
window.scrollTo({ top: y, behavior: "smooth" });
|
|
},
|
|
content: /* @__PURE__ */ React.createElement("div", { className: "tc font16 c-black-333" }, "\u6709 ", requiredCount, " \u9898\u5FC5\u7B54\u9898\u672A\u7B54\uFF0C\u65E0\u6CD5\u63D0\u4EA4 ", /* @__PURE__ */ React.createElement("br", null), "\u8BF7\u5B8C\u6210\u5168\u90E8\u5FC5\u7B54\u9898\u540E\u518D\u63D0\u4EA4")
|
|
});
|
|
return;
|
|
}
|
|
modal["default"].confirm({
|
|
width: 530,
|
|
title: "\u63D0\u793A",
|
|
centered: true,
|
|
okText: "\u786E\u5B9A",
|
|
cancelText: "\u53D6\u6D88",
|
|
content: /* @__PURE__ */ React.createElement("div", { className: "tc font16 c-black-333" }, optionalCount > 0 && /* @__PURE__ */ React.createElement(React.Fragment, null, "\u6709 ", optionalCount, " \u9898\u672A\u7B54 ", /* @__PURE__ */ React.createElement("br", null)), "\u63D0\u4EA4\u540E\u65E0\u6CD5\u518D\u4FEE\u6539\u7B54\u9898\uFF0C\u662F\u5426\u786E\u8BA4\u63D0\u4EA4\uFF1F"),
|
|
onOk: () => {
|
|
handleSubmit();
|
|
const anchorId = `Anchor_${optionalKey[0]}`;
|
|
const anchorElement = document.getElementById(anchorId);
|
|
const offset = -100;
|
|
const y = anchorElement.getBoundingClientRect().top + window.pageYOffset + offset;
|
|
window.scrollTo({ top: y, behavior: "smooth" });
|
|
}
|
|
});
|
|
};
|
|
const handleSubmit = () => __async(void 0, null, function* () {
|
|
const res = yield (0,classrooms/* submitPollAnswer */.Ns)({ categoryId: params.categoryId });
|
|
if ((res == null ? void 0 : res.status) === 0) {
|
|
message/* default */.ZP.success(res == null ? void 0 : res.message);
|
|
_umi_production_exports.history.push(`/classrooms/${params.coursesId}/poll/${params.categoryId}/detail?tabs=0`);
|
|
}
|
|
});
|
|
return /* @__PURE__ */ React.createElement("div", null, /* @__PURE__ */ React.createElement("section", { className: "edu-container" }, /* @__PURE__ */ React.createElement("div", { style: { height: "64px" } }), /* @__PURE__ */ React.createElement("section", { className: "animated fadeIn" }, ((_a2 = answerData == null ? void 0 : answerData.poll) == null ? void 0 : _a2.polls_description) && /* @__PURE__ */ React.createElement(RenderHtml/* default */.Z, { className: Answermodules.pollDesc, value: (_b2 = answerData == null ? void 0 : answerData.poll) == null ? void 0 : _b2.polls_description })), /* @__PURE__ */ React.createElement("div", { style: { display: "flex", alignItems: "flex-start" } }, /* @__PURE__ */ React.createElement("div", { style: { margin: "20px 20px 20px 0", width: 280, maxHeight: "60%" } }, /* @__PURE__ */ React.createElement("div", { className: Answermodules.user_info }, /* @__PURE__ */ React.createElement("div", { className: Answermodules.user_label, style: { lineHeight: "60px" } }, "\u59D3\u540D", /* @__PURE__ */ React.createElement("span", { className: Answermodules.user_value }, (_c = answerData == null ? void 0 : answerData.poll) == null ? void 0 : _c.real_name)), /* @__PURE__ */ React.createElement("div", { className: Answermodules.user_label, style: { lineHeight: "40px" } }, "\u5B66\u53F7", /* @__PURE__ */ React.createElement("span", { className: Answermodules.user_value }, (_d = answerData == null ? void 0 : answerData.poll) == null ? void 0 : _d.student_id))), /* @__PURE__ */ React.createElement("div", { style: { background: "#fff" } }, /* @__PURE__ */ React.createElement("aside", { className: Answermodules.answerInfo }, /* @__PURE__ */ React.createElement(row/* default */.Z, { justify: "space-between" }, /* @__PURE__ */ React.createElement(col/* default */.Z, null, "\u7B54\u9898\u8FDB\u5EA6"), /* @__PURE__ */ React.createElement(col/* default */.Z, { className: Answermodules.answerProgress }, /* @__PURE__ */ React.createElement("span", { style: { color: "#165DFF" } }, (_f = (_e = answerData == null ? void 0 : answerData.question_answered) == null ? void 0 : _e.filter((val) => (val == null ? void 0 : val.ques_status) === 1)) == null ? void 0 : _f.length), /* @__PURE__ */ React.createElement("span", { style: { color: "#999999" } }, "/", (_g = answerData == null ? void 0 : answerData.question_types) == null ? void 0 : _g.q_counts))), /* @__PURE__ */ React.createElement(row/* default */.Z, null, /* @__PURE__ */ React.createElement(
|
|
progress/* default */.Z,
|
|
{
|
|
strokeColor: "#165dffa6",
|
|
trailColor: "#0000000d",
|
|
percent: ((_i = (_h = answerData == null ? void 0 : answerData.question_answered) == null ? void 0 : _h.filter((val) => (val == null ? void 0 : val.ques_status) == 1)) == null ? void 0 : _i.length) / ((_j = answerData == null ? void 0 : answerData.question_types) == null ? void 0 : _j.q_counts) * 100,
|
|
showInfo: false
|
|
}
|
|
))), /* @__PURE__ */ React.createElement(row/* default */.Z, { className: Answermodules.dottedLineWrapper, align: "middle" }, /* @__PURE__ */ React.createElement(col/* default */.Z, { className: Answermodules.leftHalfCircle }), /* @__PURE__ */ React.createElement(col/* default */.Z, { flex: 1, className: Answermodules.dottedLine }), /* @__PURE__ */ React.createElement(col/* default */.Z, { className: Answermodules.rightHalfCircle })), /* @__PURE__ */ React.createElement("div", { className: Answermodules.answerSheetWrap }, typeList == null ? void 0 : typeList.map((v, k) => {
|
|
var _a3;
|
|
let count = 0;
|
|
return /* @__PURE__ */ React.createElement("div", { key: k }, (v == null ? void 0 : v.countSize) > 0 && /* @__PURE__ */ React.createElement("div", { className: Answermodules.answerSheetQuestionTitle, onClick: () => {
|
|
typeList[k].open = !(v == null ? void 0 : v.open);
|
|
setTypeList([...typeList]);
|
|
} }, (v == null ? void 0 : v.open) ? /* @__PURE__ */ React.createElement(MinusSquareOutlined/* default */.Z, null) : /* @__PURE__ */ React.createElement(PlusSquareOutlined/* default */.Z, null), /* @__PURE__ */ React.createElement("span", { className: "ml5 c-grey-666" }, v == null ? void 0 : v.name)), (v == null ? void 0 : v.open) && /* @__PURE__ */ React.createElement("div", null, (_a3 = answerData == null ? void 0 : answerData.questions) == null ? void 0 : _a3.map((item, key) => {
|
|
var _a4, _b3, _c2;
|
|
if (((_a4 = item == null ? void 0 : item.question) == null ? void 0 : _a4.question_type) == (v == null ? void 0 : v.id)) {
|
|
return /* @__PURE__ */ React.createElement(es_anchor["default"].Link, { className: `${Answermodules.answerFlag} ${((_c2 = (_b3 = answerData == null ? void 0 : answerData.question_answered) == null ? void 0 : _b3[key]) == null ? void 0 : _c2.ques_status) == 1 ? Answermodules.answerActive : isclick && item.question.is_necessary === 1 ? Answermodules.redactivie : ""}`, href: `#Anchor_${key}`, title: ++count });
|
|
}
|
|
})), /* @__PURE__ */ React.createElement("div", { style: { clear: "both" } }));
|
|
})))), /* @__PURE__ */ React.createElement("section", { style: { width: 900 }, className: [Answermodules.bg, "pt10", "pl30", "pr30", "pb30", "mt20", "mb50"].join(" ") }, /* @__PURE__ */ React.createElement("div", null, (_k = answerData == null ? void 0 : answerData.questions) == null ? void 0 : _k.map((item, key) => {
|
|
var _a3, _b3, _c2, _d2, _e2;
|
|
return /* @__PURE__ */ React.createElement(
|
|
"div",
|
|
{ className: Answermodules.questionItem, id: `Anchor_${key}` },
|
|
/* @__PURE__ */ React.createElement("div", { className: "mt20" }, /* @__PURE__ */ React.createElement("span", { className: "font16", style: { display: "flex", alignItems: "center", marginBottom: "20px" } }, ((_a3 = item == null ? void 0 : item.question) == null ? void 0 : _a3.is_necessary) !== 0 && /* @__PURE__ */ React.createElement("span", { style: { color: "red", fontSize: "14px" } }, "*"), /* @__PURE__ */ React.createElement("span", { className: "c-blue font16" }, "\u3010", mapping[item.question.question_type], "\u3011"), /* @__PURE__ */ React.createElement(tooltip/* default */.Z, { title: item.question.question_title }, /* @__PURE__ */ React.createElement("div", { className: Answermodules.title }, (_b3 = item == null ? void 0 : item.question) == null ? void 0 : _b3.question_number, "\u3001", item.question.question_title)), item.question.question_type === 2 && ((_c2 = item == null ? void 0 : item.question) == null ? void 0 : _c2.min_choices) && /* @__PURE__ */ React.createElement("div", { className: "ml10", style: { fontWeight: 400, color: "#666666" } }, "(\u53EF\u9009", (_d2 = item == null ? void 0 : item.question) == null ? void 0 : _d2.min_choices, "-", (_e2 = item == null ? void 0 : item.question) == null ? void 0 : _e2.max_choices, "\u9879)"))),
|
|
// 单选项
|
|
item.question.question_type == 1 && /* @__PURE__ */ React.createElement(
|
|
components_Single,
|
|
{
|
|
answerData,
|
|
itemData: item,
|
|
onSave: handleSave
|
|
}
|
|
),
|
|
// 多选项
|
|
item.question.question_type == 2 && /* @__PURE__ */ React.createElement(
|
|
components_Multiple,
|
|
{
|
|
answerData,
|
|
itemData: item,
|
|
onSave: handleSave
|
|
}
|
|
),
|
|
//主观题
|
|
item.question.question_type == 3 && /* @__PURE__ */ React.createElement(
|
|
components_Subjective,
|
|
{
|
|
answerData,
|
|
itemData: item,
|
|
onSave: handleSave
|
|
}
|
|
)
|
|
);
|
|
}))))), /* @__PURE__ */ React.createElement("div", { className: Answermodules.header_style }, /* @__PURE__ */ React.createElement("div", { className: Answermodules.header_content }, /* @__PURE__ */ React.createElement(util/* StatusClassroomsTags */.VV, { status: [util/* PollsStatus */.L4[(_l = answerData == null ? void 0 : answerData.poll) == null ? void 0 : _l.poll_status]] }), /* @__PURE__ */ React.createElement(tooltip/* default */.Z, { title: (_m = answerData == null ? void 0 : answerData.poll) == null ? void 0 : _m.polls_name }, /* @__PURE__ */ React.createElement("div", { className: Answermodules.header_title }, (_n = answerData == null ? void 0 : answerData.poll) == null ? void 0 : _n.polls_name)), (0,authority/* isStudent */.dE)() && ((_o = answerData == null ? void 0 : answerData.poll) == null ? void 0 : _o.user_poll_status) === 0 && /* @__PURE__ */ React.createElement("div", { className: Answermodules.header_button, onClick: handleVerifySubmit }, "\u63D0\u4EA4\u95EE\u5377"))));
|
|
};
|
|
/* harmony default export */ var Polls_Answer = ((0,_umi_production_exports.connect)(
|
|
({
|
|
loading,
|
|
user,
|
|
globalSetting
|
|
}) => ({
|
|
globalSetting,
|
|
user,
|
|
loading: loading.effects
|
|
})
|
|
)(Answer));
|
|
|
|
|
|
/***/ })
|
|
|
|
}]); |