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.
NewEduCoderBuild/p__Classrooms__Lists__Polls...

4772 lines
208 KiB

This file contains ambiguous Unicode characters!

This file contains ambiguous Unicode characters that may be confused with others in your current locale. If your use case is intentional and legitimate, you can safely ignore this warning. Use the Escape button to highlight these characters.

(self["webpackChunk"] = self["webpackChunk"] || []).push([[17622,52720,45504],{
/***/ 37064:
/*!********************************************************************************************************!*\
!*** ./node_modules/_@ant-design_icons@5.4.0@@ant-design/icons/es/icons/DeleteOutlined.js + 1 modules ***!
\********************************************************************************************************/
/***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) {
"use strict";
// EXPORTS
__webpack_require__.d(__webpack_exports__, {
Z: function() { return /* binding */ icons_DeleteOutlined; }
});
// EXTERNAL MODULE: ./node_modules/_@babel_runtime@7.25.6@@babel/runtime/helpers/esm/extends.js
var esm_extends = __webpack_require__(33614);
// EXTERNAL MODULE: ./node_modules/_react@17.0.2@react/index.js
var _react_17_0_2_react = __webpack_require__(59301);
;// CONCATENATED MODULE: ./node_modules/_@ant-design_icons-svg@4.4.2@@ant-design/icons-svg/es/asn/DeleteOutlined.js
// This icon file is generated automatically.
var DeleteOutlined = { "icon": { "tag": "svg", "attrs": { "viewBox": "64 64 896 896", "focusable": "false" }, "children": [{ "tag": "path", "attrs": { "d": "M360 184h-8c4.4 0 8-3.6 8-8v8h304v-8c0 4.4 3.6 8 8 8h-8v72h72v-80c0-35.3-28.7-64-64-64H352c-35.3 0-64 28.7-64 64v80h72v-72zm504 72H160c-17.7 0-32 14.3-32 32v32c0 4.4 3.6 8 8 8h60.4l24.7 523c1.6 34.1 29.8 61 63.9 61h454c34.2 0 62.3-26.8 63.9-61l24.7-523H888c4.4 0 8-3.6 8-8v-32c0-17.7-14.3-32-32-32zM731.3 840H292.7l-24.2-512h487l-24.2 512z" } }] }, "name": "delete", "theme": "outlined" };
/* harmony default export */ var asn_DeleteOutlined = (DeleteOutlined);
// EXTERNAL MODULE: ./node_modules/_@ant-design_icons@5.4.0@@ant-design/icons/es/components/AntdIcon.js + 3 modules
var AntdIcon = __webpack_require__(1393);
;// CONCATENATED MODULE: ./node_modules/_@ant-design_icons@5.4.0@@ant-design/icons/es/icons/DeleteOutlined.js
// GENERATE BY ./scripts/generate.ts
// DON NOT EDIT IT MANUALLY
var DeleteOutlined_DeleteOutlined = function DeleteOutlined(props, ref) {
return /*#__PURE__*/_react_17_0_2_react.createElement(AntdIcon/* default */.Z, (0,esm_extends/* default */.Z)({}, props, {
ref: ref,
icon: asn_DeleteOutlined
}));
};
/**![delete](data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iNTAiIGhlaWdodD0iNTAiIGZpbGw9IiNjYWNhY2EiIHZpZXdCb3g9IjY0IDY0IDg5NiA4OTYiIGZvY3VzYWJsZT0iZmFsc2UiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyI+PHBhdGggZD0iTTM2MCAxODRoLThjNC40IDAgOC0zLjYgOC04djhoMzA0di04YzAgNC40IDMuNiA4IDggOGgtOHY3Mmg3MnYtODBjMC0zNS4zLTI4LjctNjQtNjQtNjRIMzUyYy0zNS4zIDAtNjQgMjguNy02NCA2NHY4MGg3MnYtNzJ6bTUwNCA3MkgxNjBjLTE3LjcgMC0zMiAxNC4zLTMyIDMydjMyYzAgNC40IDMuNiA4IDggOGg2MC40bDI0LjcgNTIzYzEuNiAzNC4xIDI5LjggNjEgNjMuOSA2MWg0NTRjMzQuMiAwIDYyLjMtMjYuOCA2My45LTYxbDI0LjctNTIzSDg4OGM0LjQgMCA4LTMuNiA4LTh2LTMyYzAtMTcuNy0xNC4zLTMyLTMyLTMyek03MzEuMyA4NDBIMjkyLjdsLTI0LjItNTEyaDQ4N2wtMjQuMiA1MTJ6IiAvPjwvc3ZnPg==) */
var RefIcon = /*#__PURE__*/_react_17_0_2_react.forwardRef(DeleteOutlined_DeleteOutlined);
if (false) {}
/* harmony default export */ var icons_DeleteOutlined = (RefIcon);
/***/ }),
/***/ 65547:
/*!************************************************************************************************************!*\
!*** ./node_modules/_@ant-design_icons@5.4.0@@ant-design/icons/es/icons/PlusCircleOutlined.js + 1 modules ***!
\************************************************************************************************************/
/***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) {
"use strict";
// EXPORTS
__webpack_require__.d(__webpack_exports__, {
Z: function() { return /* binding */ icons_PlusCircleOutlined; }
});
// EXTERNAL MODULE: ./node_modules/_@babel_runtime@7.25.6@@babel/runtime/helpers/esm/extends.js
var esm_extends = __webpack_require__(33614);
// EXTERNAL MODULE: ./node_modules/_react@17.0.2@react/index.js
var _react_17_0_2_react = __webpack_require__(59301);
;// CONCATENATED MODULE: ./node_modules/_@ant-design_icons-svg@4.4.2@@ant-design/icons-svg/es/asn/PlusCircleOutlined.js
// This icon file is generated automatically.
var PlusCircleOutlined = { "icon": { "tag": "svg", "attrs": { "viewBox": "64 64 896 896", "focusable": "false" }, "children": [{ "tag": "path", "attrs": { "d": "M696 480H544V328c0-4.4-3.6-8-8-8h-48c-4.4 0-8 3.6-8 8v152H328c-4.4 0-8 3.6-8 8v48c0 4.4 3.6 8 8 8h152v152c0 4.4 3.6 8 8 8h48c4.4 0 8-3.6 8-8V544h152c4.4 0 8-3.6 8-8v-48c0-4.4-3.6-8-8-8z" } }, { "tag": "path", "attrs": { "d": "M512 64C264.6 64 64 264.6 64 512s200.6 448 448 448 448-200.6 448-448S759.4 64 512 64zm0 820c-205.4 0-372-166.6-372-372s166.6-372 372-372 372 166.6 372 372-166.6 372-372 372z" } }] }, "name": "plus-circle", "theme": "outlined" };
/* harmony default export */ var asn_PlusCircleOutlined = (PlusCircleOutlined);
// EXTERNAL MODULE: ./node_modules/_@ant-design_icons@5.4.0@@ant-design/icons/es/components/AntdIcon.js + 3 modules
var AntdIcon = __webpack_require__(1393);
;// CONCATENATED MODULE: ./node_modules/_@ant-design_icons@5.4.0@@ant-design/icons/es/icons/PlusCircleOutlined.js
// GENERATE BY ./scripts/generate.ts
// DON NOT EDIT IT MANUALLY
var PlusCircleOutlined_PlusCircleOutlined = function PlusCircleOutlined(props, ref) {
return /*#__PURE__*/_react_17_0_2_react.createElement(AntdIcon/* default */.Z, (0,esm_extends/* default */.Z)({}, props, {
ref: ref,
icon: asn_PlusCircleOutlined
}));
};
/**![plus-circle](data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iNTAiIGhlaWdodD0iNTAiIGZpbGw9IiNjYWNhY2EiIHZpZXdCb3g9IjY0IDY0IDg5NiA4OTYiIGZvY3VzYWJsZT0iZmFsc2UiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyI+PHBhdGggZD0iTTY5NiA0ODBINTQ0VjMyOGMwLTQuNC0zLjYtOC04LThoLTQ4Yy00LjQgMC04IDMuNi04IDh2MTUySDMyOGMtNC40IDAtOCAzLjYtOCA4djQ4YzAgNC40IDMuNiA4IDggOGgxNTJ2MTUyYzAgNC40IDMuNiA4IDggOGg0OGM0LjQgMCA4LTMuNiA4LThWNTQ0aDE1MmM0LjQgMCA4LTMuNiA4LTh2LTQ4YzAtNC40LTMuNi04LTgtOHoiIC8+PHBhdGggZD0iTTUxMiA2NEMyNjQuNiA2NCA2NCAyNjQuNiA2NCA1MTJzMjAwLjYgNDQ4IDQ0OCA0NDggNDQ4LTIwMC42IDQ0OC00NDhTNzU5LjQgNjQgNTEyIDY0em0wIDgyMGMtMjA1LjQgMC0zNzItMTY2LjYtMzcyLTM3MnMxNjYuNi0zNzIgMzcyLTM3MiAzNzIgMTY2LjYgMzcyIDM3Mi0xNjYuNiAzNzItMzcyIDM3MnoiIC8+PC9zdmc+) */
var RefIcon = /*#__PURE__*/_react_17_0_2_react.forwardRef(PlusCircleOutlined_PlusCircleOutlined);
if (false) {}
/* harmony default export */ var icons_PlusCircleOutlined = (RefIcon);
/***/ }),
/***/ 35721:
/*!************************************************************************!*\
!*** ./src/pages/Classrooms/Lists/Polls/Detail/index.tsx + 15 modules ***!
\************************************************************************/
/***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) {
"use strict";
// ESM COMPAT FLAG
__webpack_require__.r(__webpack_exports__);
// EXPORTS
__webpack_require__.d(__webpack_exports__, {
"default": function() { return /* binding */ Detail; }
});
// 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/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: ./src/.umi-production/exports.ts
var _umi_production_exports = __webpack_require__(80608);
// EXTERNAL MODULE: ./node_modules/_antd@5.9.0@antd/es/breadcrumb/index.js + 6 modules
var breadcrumb = __webpack_require__(66104);
// EXTERNAL MODULE: ./node_modules/_antd@5.9.0@antd/es/tabs/index.js + 24 modules
var tabs = __webpack_require__(99313);
// 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: ./src/utils/util.tsx
var util = __webpack_require__(27876);
// EXTERNAL MODULE: ./src/utils/export.ts
var utils_export = __webpack_require__(80427);
// EXTERNAL MODULE: ./src/utils/authority.ts
var authority = __webpack_require__(75916);
// EXTERNAL MODULE: ./node_modules/_@babel_runtime@7.23.6@@babel/runtime/helpers/defineProperty.js
var defineProperty = __webpack_require__(85573);
var defineProperty_default = /*#__PURE__*/__webpack_require__.n(defineProperty);
// 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/checkbox/index.js + 3 modules
var es_checkbox = __webpack_require__(24905);
// 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/input/index.js + 3 modules
var input = __webpack_require__(92832);
// EXTERNAL MODULE: ./node_modules/_antd@5.9.0@antd/es/table/index.js + 85 modules
var table = __webpack_require__(51945);
// EXTERNAL MODULE: ./node_modules/_antd@5.9.0@antd/es/pagination/index.js + 10 modules
var pagination = __webpack_require__(86859);
// EXTERNAL MODULE: ./node_modules/_dayjs@1.11.13@dayjs/dayjs.min.js
var dayjs_min = __webpack_require__(61186);
var dayjs_min_default = /*#__PURE__*/__webpack_require__.n(dayjs_min);
// EXTERNAL MODULE: ./src/components/NoData/index.tsx
var NoData = __webpack_require__(6638);
// EXTERNAL MODULE: ./src/utils/fetch.ts
var fetch = __webpack_require__(49105);
// EXTERNAL MODULE: ./node_modules/_react@17.0.2@react/jsx-runtime.js
var jsx_runtime = __webpack_require__(37712);
;// CONCATENATED MODULE: ./src/pages/Classrooms/Lists/Polls/Detail/components/WorkList/components/Redo.tsx
var DelShixun = function DelShixun(_ref) {
var shixunHomeworks = _ref.shixunHomeworks,
dispatch = _ref.dispatch;
var params = (0,_umi_production_exports.useParams)();
return /*#__PURE__*/(0,jsx_runtime.jsxs)(modal/* default */.Z, {
centered: true,
title: "\u63D0\u793A",
open: shixunHomeworks.actionTabs.key === '打回重做' ? true : false,
okText: "\u786E\u5B9A",
cancelText: "\u53D6\u6D88",
onOk: /*#__PURE__*/asyncToGenerator_default()( /*#__PURE__*/regeneratorRuntime_default()().mark(function _callee() {
var res;
return regeneratorRuntime_default()().wrap(function _callee$(_context) {
while (1) switch (_context.prev = _context.next) {
case 0:
_context.next = 2;
return (0,fetch/* default */.ZP)("/api/myshixuns/".concat(shixunHomeworks.actionTabs.selectArrs.myshixun_identifier, "/reset_my_game.json"), {
method: 'post',
body: {
course_id: params.coursesId
}
});
case 2:
res = _context.sent;
if (res.status === 0) {
message/* default */.ZP.success('删除成功');
dispatch({
type: 'shixunHomeworks/setActionTabs',
payload: {}
});
dispatch({
type: 'shixunHomeworks/getWorkList',
payload: objectSpread2_default()({}, shixunHomeworks.actionTabs.params)
});
}
case 4:
case "end":
return _context.stop();
}
}, _callee);
})),
onCancel: function onCancel() {
dispatch({
type: 'shixunHomeworks/setActionTabs',
payload: {}
});
},
children: [/*#__PURE__*/(0,jsx_runtime.jsx)("p", {
children: "\u8BE5\u4F5C\u4E1A\u5C06\u88AB\u6253\u56DE\u91CD\u505A\uFF0C\u5B66\u751F\u5B9E\u8BAD\u8BB0\u5F55\u5C06\u88AB\u6E05\u7A7A!"
}), /*#__PURE__*/(0,jsx_runtime.jsx)("p", {
children: "\u786E\u5B9A\u6253\u56DE?"
})]
});
};
/* harmony default export */ var Redo = ((0,_umi_production_exports.connect)(function (_ref3) {
var shixunHomeworks = _ref3.shixunHomeworks;
return {
shixunHomeworks: shixunHomeworks
};
})(DelShixun));
// EXTERNAL MODULE: ./node_modules/_antd@5.9.0@antd/es/input-number/index.js + 14 modules
var input_number = __webpack_require__(94001);
;// CONCATENATED MODULE: ./src/pages/Classrooms/Lists/Polls/Detail/components/WorkList/components/ChangeScore.tsx
var ChangeScore_DelShixun = function DelShixun(_ref) {
var shixunHomeworks = _ref.shixunHomeworks,
dispatch = _ref.dispatch;
var params = (0,_umi_production_exports.useParams)();
var _useState = (0,_react_17_0_2_react.useState)(true),
_useState2 = slicedToArray_default()(_useState, 2),
coverAll = _useState2[0],
setCoverAll = _useState2[1];
var _Form$useForm = es_form/* default */.Z.useForm(),
_Form$useForm2 = slicedToArray_default()(_Form$useForm, 1),
form = _Form$useForm2[0];
return /*#__PURE__*/(0,jsx_runtime.jsx)(jsx_runtime.Fragment, {
children: /*#__PURE__*/(0,jsx_runtime.jsx)(modal/* default */.Z, {
centered: true,
title: "\u8C03\u5206",
open: shixunHomeworks.actionTabs.key === '调分' ? true : false,
okText: "\u786E\u5B9A",
cancelText: "\u53D6\u6D88",
onOk: /*#__PURE__*/asyncToGenerator_default()( /*#__PURE__*/regeneratorRuntime_default()().mark(function _callee() {
var formValue, res;
return regeneratorRuntime_default()().wrap(function _callee$(_context) {
while (1) switch (_context.prev = _context.next) {
case 0:
_context.next = 2;
return form.validateFields();
case 2:
formValue = form.getFieldValue();
_context.next = 5;
return (0,fetch/* default */.ZP)("/api/student_works/".concat(shixunHomeworks.actionTabs.id, "/adjust_score.json"), {
method: 'post',
body: objectSpread2_default()({}, formValue)
});
case 5:
res = _context.sent;
if (res.status === 0) {
message/* default */.ZP.success('评阅成功');
form.resetFields();
dispatch({
type: 'shixunHomeworks/setActionTabs',
payload: {}
});
dispatch({
type: 'shixunHomeworks/getWorkList',
payload: objectSpread2_default()({}, shixunHomeworks.actionTabs.params)
});
}
case 7:
case "end":
return _context.stop();
}
}, _callee);
})),
onCancel: function onCancel() {
dispatch({
type: 'shixunHomeworks/setActionTabs',
payload: {}
});
},
children: /*#__PURE__*/(0,jsx_runtime.jsxs)(es_form/* default */.Z, {
form: form,
children: [/*#__PURE__*/(0,jsx_runtime.jsx)("p", {
children: "\u6210\u7EE9"
}), /*#__PURE__*/(0,jsx_runtime.jsx)(es_form/* default */.Z.Item, {
name: "score",
rules: [{
required: true,
message: '请输入!'
}],
children: /*#__PURE__*/(0,jsx_runtime.jsx)(input_number/* default */.Z, {})
}), /*#__PURE__*/(0,jsx_runtime.jsx)("p", {
children: "\u4EC5\u8BFE\u5802\u8001\u5E08\u53EF\u89C1"
}), /*#__PURE__*/(0,jsx_runtime.jsx)(es_form/* default */.Z.Item, {
name: "comment",
children: /*#__PURE__*/(0,jsx_runtime.jsx)(input/* default */.Z.TextArea, {
placeholder: "\u8BF7\u586B\u5199\u60A8\u5BF9\u4F5C\u54C1\u8C03\u5206\u7684\u539F\u56E0",
rows: 8
})
})]
})
})
});
};
/* harmony default export */ var ChangeScore = ((0,_umi_production_exports.connect)(function (_ref3) {
var shixunHomeworks = _ref3.shixunHomeworks;
return {
shixunHomeworks: shixunHomeworks
};
})(ChangeScore_DelShixun));
;// CONCATENATED MODULE: ./src/pages/Classrooms/Lists/Polls/Detail/components/WorkList/index.t.ts
var CommitStatusData = [{
name: "未提交",
id: 0,
type: "unanswer_users"
}, {
name: "按时提交",
id: 1,
type: "answer_users"
}];
;// CONCATENATED MODULE: ./src/pages/Classrooms/Lists/Polls/Detail/components/WorkList/index.tsx
var WorkList = function WorkList(_ref) {
var _pollsList$poll_types, _pollsList$poll_types2, _pollsList$poll_types3, _pollsList$poll_types5, _pollsList$poll_types6, _pollsList$poll_types7;
var polls = _ref.polls,
loading = _ref.loading,
dispatch = _ref.dispatch;
var _useState = (0,_react_17_0_2_react.useState)(objectSpread2_default()(objectSpread2_default()({}, (0,_umi_production_exports.useParams)()), {
page: 1,
limit: 20
})),
_useState2 = slicedToArray_default()(_useState, 2),
params = _useState2[0],
setParams = _useState2[1];
var location = (0,_umi_production_exports.useLocation)();
var pollsList = polls.pollsList,
commonHeader = polls.commonHeader;
var _useState3 = (0,_react_17_0_2_react.useState)({}),
_useState4 = slicedToArray_default()(_useState3, 2),
filterSelect = _useState4[0],
setFilterSelect = _useState4[1];
var _useState5 = (0,_react_17_0_2_react.useState)(''),
_useState6 = slicedToArray_default()(_useState5, 2),
studentIdSort = _useState6[0],
setStudentIdSort = _useState6[1];
var _useState7 = (0,_react_17_0_2_react.useState)({}),
_useState8 = slicedToArray_default()(_useState7, 2),
sortObj = _useState8[0],
setSortObj = _useState8[1];
params['order_type'] = 'desc';
params['order'] = 'end_at';
var _Form$useForm = es_form/* default */.Z.useForm(),
_Form$useForm2 = slicedToArray_default()(_Form$useForm, 1),
form = _Form$useForm2[0];
var notMember = (0,authority/* isNotMember */.Jd)();
(0,_react_17_0_2_react.useEffect)(function () {
dispatch({
type: 'polls/getPollsList',
payload: params
});
}, []);
var onHandleChange = function onHandleChange() {
params.page = 1;
var formValue = Object.assign({}, form.getFieldValue());
Object.keys(formValue).map(function (v) {
if (formValue[v].includes('all')) {
delete params[v];
form.setFieldsValue(defineProperty_default()({}, v, 'all'));
} else {
params[v] = formValue[v];
form.setFieldsValue(defineProperty_default()({}, v, params[v]));
}
});
dispatch({
type: 'polls/getPollsList',
payload: params
});
};
var onShowSizeChange = function onShowSizeChange(current, pageSize) {
params.page = current;
params.limit = 20;
dispatch({
type: 'polls/getPollsList',
payload: objectSpread2_default()({}, params)
});
};
var initColumns = [{
title: '序号',
align: "center",
dataIndex: 'name',
render: function render(text, record, index) {
return params.limit * (params.page - 1) + index + 1;
}
}, {
title: '姓名',
align: "center",
dataIndex: 'user_name'
}, {
title: '学号',
align: "center",
dataIndex: 'student_id',
sortOrder: sortObj['student_id'],
sortDirections: ['descend', 'ascend'],
sorter: function sorter(a, b) {
return a.id - b.id;
}
}, {
title: '分班',
align: "center",
dataIndex: 'user_group_name',
ellipsis: true,
width: "35%"
}, {
title: '提交状态',
align: "center",
dataIndex: 'commit_status',
render: function render(text, item) {
return item.commit_status == 1 ? /*#__PURE__*/(0,jsx_runtime.jsx)("span", {
className: "c-green",
children: "\u6309\u65F6\u63D0\u4EA4"
}) : /*#__PURE__*/(0,jsx_runtime.jsx)("span", {
children: "\u672A\u63D0\u4EA4"
});
}
}, {
title: '提交时间',
width: "16%",
align: "center",
dataIndex: 'end_at',
sortOrder: sortObj['end_at'],
sortDirections: ['descend', 'ascend'],
sorter: function sorter(a, b) {
return a.id - b.id;
},
render: function render(text) {
return text && dayjs_min_default()(text).format("YYYY-MM-DD HH:mm");
}
}, {
title: '操作',
dataIndex: 'operation',
key: 'operation',
className: "edu-txt-center",
align: "center",
width: 120,
render: function render(_, record) {
if ((0,authority/* isStudent */.dE)()) {
return !!record.commit_status ? /*#__PURE__*/(0,jsx_runtime.jsx)(_umi_production_exports.Link, {
target: "_blank",
to: "/classrooms/".concat(params.coursesId, "/poll/").concat(params.categoryId, "/users/").concat(record.login),
children: "\u67E5\u770B"
}) : '--';
}
if ((0,authority/* isAdmin */.GJ)()) {
return !!record.commit_status && !!commonHeader.show_result ? /*#__PURE__*/(0,jsx_runtime.jsx)(_umi_production_exports.Link, {
target: "_blank",
to: "/classrooms/".concat(params.coursesId, "/poll/").concat(params.categoryId, "/users/").concat(record.login),
children: "\u67E5\u770B"
}) : '--';
}
}
}];
var columns = (0,_react_17_0_2_react.useMemo)(function () {
var rs = [].concat(initColumns);
//非课堂成员不显示学号
if (notMember) {
rs.splice(2, 1);
}
// un_anonymous true为实名问卷显示操作列否则隐藏
if (pollsList.poll_types && (notMember || pollsList.poll_types.un_anonymous === false)) {
rs.splice(rs.length - 1, 1);
}
return rs;
}, [notMember, pollsList.poll_types]);
return /*#__PURE__*/(0,jsx_runtime.jsxs)("section", {
className: "minH500 bg-white pl30 pr30 inline-block w100",
children: [pollsList.poll_users == '' && /*#__PURE__*/(0,jsx_runtime.jsx)(NoData/* default */.Z, {}), pollsList.poll_users != '' && /*#__PURE__*/(0,jsx_runtime.jsxs)("aside", {
children: [(0,authority/* isStudent */.dE)() && /*#__PURE__*/(0,jsx_runtime.jsxs)("div", {
className: "mt20",
children: [/*#__PURE__*/(0,jsx_runtime.jsx)("span", {
className: "c-red",
children: pollsList === null || pollsList === void 0 || (_pollsList$poll_types = pollsList.poll_types) === null || _pollsList$poll_types === void 0 ? void 0 : _pollsList$poll_types.answer_users
}), " \u5DF2\u4EA4 ", /*#__PURE__*/(0,jsx_runtime.jsxs)("span", {
className: "ml20 mr20",
children: [pollsList === null || pollsList === void 0 || (_pollsList$poll_types2 = pollsList.poll_types) === null || _pollsList$poll_types2 === void 0 ? void 0 : _pollsList$poll_types2.unanswer_users, "\u672A\u4EA4"]
}), commonHeader.polls_status === 2 && /*#__PURE__*/(0,jsx_runtime.jsxs)("span", {
children: ["\u5269\u4F59\u63D0\u4EA4\u65F6\u95F4\uFF1A", /*#__PURE__*/(0,jsx_runtime.jsx)("span", {
className: "c-orange",
children: (0,util/* toTimeFormat */.li)((new Date(pollsList === null || pollsList === void 0 || (_pollsList$poll_types3 = pollsList.poll_types) === null || _pollsList$poll_types3 === void 0 ? void 0 : _pollsList$poll_types3.poll_end_time).getTime() - new Date().getTime()) / 1000)
})]
})]
}), (0,authority/* isAdmin */.GJ)() && /*#__PURE__*/(0,jsx_runtime.jsxs)("aside", {
className: "mt20",
children: [/*#__PURE__*/(0,jsx_runtime.jsxs)(es_form/* default */.Z, {
form: form,
onChange: onHandleChange,
initialValues: defineProperty_default()(defineProperty_default()({}, 'commit_status', 'all'), 'poll_group_id', 'all'),
children: [/*#__PURE__*/(0,jsx_runtime.jsx)(es_form/* default */.Z.Item, {
name: "commit_status",
children: /*#__PURE__*/(0,jsx_runtime.jsx)(es_checkbox/* default */.Z.Group, {
value: [],
style: {
width: '100%'
},
children: /*#__PURE__*/(0,jsx_runtime.jsxs)(row/* default */.Z, {
children: [/*#__PURE__*/(0,jsx_runtime.jsx)(col/* default */.Z, {
flex: '80px',
children: "\u7B54\u9898\u72B6\u6001:"
}), /*#__PURE__*/(0,jsx_runtime.jsx)(col/* default */.Z, {
flex: '80px',
children: /*#__PURE__*/(0,jsx_runtime.jsx)(es_checkbox/* default */.Z, {
value: "all",
checked: !filterSelect['commit_status'],
children: "\u5168\u90E8"
})
}), /*#__PURE__*/(0,jsx_runtime.jsx)(col/* default */.Z, {
flex: '1',
children: CommitStatusData.map(function (v, k) {
var _pollsList$poll_types4;
return /*#__PURE__*/(0,jsx_runtime.jsxs)(es_checkbox/* default */.Z, {
name: "commit_status",
value: v.id,
children: [v.name, "(", pollsList === null || pollsList === void 0 || (_pollsList$poll_types4 = pollsList.poll_types) === null || _pollsList$poll_types4 === void 0 ? void 0 : _pollsList$poll_types4[v.type], ")"]
});
})
})]
})
})
}), /*#__PURE__*/(0,jsx_runtime.jsx)(es_form/* default */.Z.Item, {
name: "poll_group_id",
children: /*#__PURE__*/(0,jsx_runtime.jsx)(es_checkbox/* default */.Z.Group, {
style: {
width: '100%'
},
children: /*#__PURE__*/(0,jsx_runtime.jsxs)(row/* default */.Z, {
children: [/*#__PURE__*/(0,jsx_runtime.jsx)(col/* default */.Z, {
flex: '80px',
children: "\u5206\u73ED\u60C5\u51B5:"
}), /*#__PURE__*/(0,jsx_runtime.jsx)(col/* default */.Z, {
flex: '80px',
children: /*#__PURE__*/(0,jsx_runtime.jsx)(es_checkbox/* default */.Z, {
value: "all",
checked: !filterSelect['course_group'],
children: "\u5168\u90E8"
})
}), /*#__PURE__*/(0,jsx_runtime.jsx)(col/* default */.Z, {
flex: '1',
children: pollsList.course_groups && pollsList.course_groups.map(function (v, k) {
return /*#__PURE__*/(0,jsx_runtime.jsxs)(es_checkbox/* default */.Z, {
value: v.course_group_id,
children: [v.group_group_name, "(", v.count, ")"]
});
})
})]
})
})
})]
}), /*#__PURE__*/(0,jsx_runtime.jsxs)(row/* default */.Z, {
children: [/*#__PURE__*/(0,jsx_runtime.jsx)(col/* default */.Z, {
flex: '1',
children: /*#__PURE__*/(0,jsx_runtime.jsxs)(row/* default */.Z, {
align: "middle",
children: [/*#__PURE__*/(0,jsx_runtime.jsx)(col/* default */.Z, {
children: /*#__PURE__*/(0,jsx_runtime.jsx)(input/* default */.Z.Search, {
allowClear: true,
placeholder: "\u8BF7\u8F93\u5165\u59D3\u540D\u6216\u8005\u5B66\u53F7\u641C\u7D22",
onSearch: function onSearch(value) {
params['search'] = value.trim();
params.page = 1;
dispatch({
type: 'polls/getPollsList',
payload: params
});
},
style: {
width: 200
}
})
}), /*#__PURE__*/(0,jsx_runtime.jsxs)(col/* default */.Z, {
children: [/*#__PURE__*/(0,jsx_runtime.jsx)("span", {
className: "ml5 c-red",
children: (_pollsList$poll_types5 = pollsList.poll_types) === null || _pollsList$poll_types5 === void 0 ? void 0 : _pollsList$poll_types5.total_users
}), /*#__PURE__*/(0,jsx_runtime.jsxs)("span", {
children: ["\u4E2A\u68C0\u7D22\u7ED3\u679C\uFF08", (_pollsList$poll_types6 = pollsList.poll_types) === null || _pollsList$poll_types6 === void 0 ? void 0 : _pollsList$poll_types6.poll_users_count, "\u4E2A\u5B66\u751F\uFF09"]
})]
})]
})
}), /*#__PURE__*/(0,jsx_runtime.jsx)(col/* default */.Z, {})]
})]
}), /*#__PURE__*/(0,jsx_runtime.jsx)(table/* default */.Z, {
className: "mt30",
loading: loading['polls/getPollsList'],
hideOnSinglePage: true,
pagination: false,
dataSource: pollsList.poll_users,
columns: columns,
onChange: function onChange(a, b, c) {
sortObj = {};
if (c.order === undefined) {
sortObj[c.field] = 'descend';
switch (c.field) {
case 'student_id':
setStudentIdSort('descend');
params['b_order'] = 'desc';
break;
}
} else {
params['b_order'] = c.order.replace('end', '');
sortObj[c.field] = c.order;
}
setSortObj(objectSpread2_default()({}, sortObj));
params['order'] = c.field;
dispatch({
type: 'polls/getPollsList',
payload: objectSpread2_default()({}, params)
});
}
}), /*#__PURE__*/(0,jsx_runtime.jsx)("aside", {
className: "tc mb50 mt30",
children: /*#__PURE__*/(0,jsx_runtime.jsx)(pagination/* default */.Z, {
showSizeChanger: false,
hideOnSinglePage: true,
onChange: onShowSizeChange,
defaultCurrent: params.page || 1,
current: params.page || 1,
defaultPageSize: 20,
total: (_pollsList$poll_types7 = pollsList.poll_types) === null || _pollsList$poll_types7 === void 0 ? void 0 : _pollsList$poll_types7.total_users
})
}), /*#__PURE__*/(0,jsx_runtime.jsx)(ChangeScore, {}), /*#__PURE__*/(0,jsx_runtime.jsx)(Redo, {})]
})]
});
};
/* harmony default export */ var components_WorkList = ((0,_umi_production_exports.connect)(function (_ref3) {
var polls = _ref3.polls,
loading = _ref3.loading;
return {
polls: polls,
loading: loading.effects
};
})(WorkList));
// 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/_antd@5.9.0@antd/es/spin/index.js + 1 modules
var spin = __webpack_require__(71418);
;// CONCATENATED MODULE: ./src/pages/Classrooms/Lists/Polls/Detail/components/EndGroup/index.tsx
var PublishShixun = function PublishShixun(_ref) {
var _polls$endGroups, _polls$endGroups2, _polls$endGroups3, _polls$endGroups4;
var polls = _ref.polls,
loading = _ref.loading,
dispatch = _ref.dispatch;
var params = (0,_umi_production_exports.useParams)();
var location = (0,_umi_production_exports.useLocation)();
var _useState = (0,_react_17_0_2_react.useState)([]),
_useState2 = slicedToArray_default()(_useState, 2),
groupIds = _useState2[0],
setGroupIds = _useState2[1];
(0,_react_17_0_2_react.useEffect)(function () {
if (polls.actionTabs.key === '立即截止') {
var res = dispatch({
type: 'polls/getEndGroups',
payload: objectSpread2_default()(objectSpread2_default()({}, params), {}, {
check_ids: [Number(params.categoryId)]
})
}).then(function (res) {
if (!res.status) {
var ids = [];
res.course_info.map(function (v) {
ids.push({
id: v.course_group_id,
checked: true,
time: dayjs_min_default()().add(7, 'days')
});
});
setGroupIds([].concat(ids));
}
});
}
}, [polls.actionTabs.key]);
var _Form$useForm = es_form/* default */.Z.useForm(),
_Form$useForm2 = slicedToArray_default()(_Form$useForm, 1),
form = _Form$useForm2[0];
var disabledDate = function disabledDate(current) {
return current && current < dayjs_min_default()().startOf('day');
};
var columns = [{
title: '分班名称',
dataIndex: 'course_group_name',
render: function render(text, record, index) {
console.log("text:", text);
return /*#__PURE__*/(0,jsx_runtime.jsx)(es_form/* default */.Z.Item, {
name: "group_ids",
style: {
marginBottom: 0
},
children: /*#__PURE__*/(0,jsx_runtime.jsx)(es_checkbox/* default */.Z, {
value: String(record.id),
checked: groupIds[index] ? groupIds[index]['checked'] : false,
defaultChecked: true,
onChange: function onChange(e) {
if (groupIds[index]['checked']) {
groupIds[index]['checked'] = false;
} else {
groupIds[index]['checked'] = true;
}
setGroupIds(toConsumableArray_default()(groupIds));
},
children: text
})
});
}
}];
return /*#__PURE__*/(0,jsx_runtime.jsxs)(modal/* default */.Z, {
centered: true,
title: "\u7ACB\u5373\u622A\u6B62",
open: polls.actionTabs.key === '立即截止' ? true : false,
okText: "\u7ACB\u5373\u622A\u6B62",
cancelText: "\u6682\u4E0D\u53D1\u5E03",
bodyStyle: {
minHeight: 80
},
onOk: /*#__PURE__*/asyncToGenerator_default()( /*#__PURE__*/regeneratorRuntime_default()().mark(function _callee() {
var _groupIds$filter;
var res;
return regeneratorRuntime_default()().wrap(function _callee$(_context) {
while (1) switch (_context.prev = _context.next) {
case 0:
_context.next = 2;
return (0,fetch/* default */.ZP)("/api/courses/".concat(params.coursesId, "/polls/end_poll.json"), {
method: 'post',
body: {
check_ids: [Number(params.categoryId)],
group_ids: groupIds === null || groupIds === void 0 || (_groupIds$filter = groupIds.filter(function (v) {
return v.checked;
})) === null || _groupIds$filter === void 0 ? void 0 : _groupIds$filter.map(function (v) {
return Number(v.id);
})
}
});
case 2:
res = _context.sent;
if (res.status === 0) {
message/* default */.ZP.success('操作成功');
dispatch({
type: 'polls/setActionTabs',
payload: {}
});
dispatch({
type: 'polls/getCommonHeader',
payload: objectSpread2_default()({}, polls.actionTabs.params)
});
}
case 4:
case "end":
return _context.stop();
}
}, _callee);
})),
onCancel: function onCancel() {
dispatch({
type: 'polls/setActionTabs',
payload: {}
});
},
children: [/*#__PURE__*/(0,jsx_runtime.jsx)("p", {
className: "tc",
children: "\u5B66\u751F\u5C06\u4E0D\u80FD\u518D\u63D0\u4EA4\u8BD5\u5377"
}), loading['effects']['polls/getEndGroups'] && /*#__PURE__*/(0,jsx_runtime.jsx)("div", {
className: "tc mt40",
children: /*#__PURE__*/(0,jsx_runtime.jsx)(spin/* default */.Z, {})
}), (polls === null || polls === void 0 || (_polls$endGroups = polls.endGroups) === null || _polls$endGroups === void 0 ? void 0 : _polls$endGroups.course_info) && /*#__PURE__*/(0,jsx_runtime.jsx)(es_form/* default */.Z, {
form: form,
name: "dynamic_form_item",
children: !!(polls !== null && polls !== void 0 && (_polls$endGroups2 = polls.endGroups) !== null && _polls$endGroups2 !== void 0 && (_polls$endGroups2 = _polls$endGroups2.course_info) !== null && _polls$endGroups2 !== void 0 && _polls$endGroups2.length) && /*#__PURE__*/(0,jsx_runtime.jsx)(table/* default */.Z, {
style: {
background: '#F4FAFF'
}
// loading={loading['effects']['classroomList/getCourseGroups']}
,
columns: columns,
dataSource: (_polls$endGroups3 = polls.endGroups) === null || _polls$endGroups3 === void 0 ? void 0 : _polls$endGroups3.course_info,
scroll: {
y: 240
},
pagination: false
})
}), !!(polls !== null && polls !== void 0 && (_polls$endGroups4 = polls.endGroups) !== null && _polls$endGroups4 !== void 0 && (_polls$endGroups4 = _polls$endGroups4.course_info) !== null && _polls$endGroups4 !== void 0 && _polls$endGroups4.length) && /*#__PURE__*/(0,jsx_runtime.jsx)(es_checkbox/* default */.Z, {
defaultChecked: true,
onClick: function onClick(e) {
if (e.target.checked) {
groupIds.map(function (v) {
return v.checked = true;
});
} else {
groupIds.map(function (v) {
return v.checked = false;
});
}
setGroupIds(toConsumableArray_default()(groupIds));
},
children: "\u5168\u9009"
})]
});
};
/* harmony default export */ var EndGroup = ((0,_umi_production_exports.connect)(function (_ref3) {
var polls = _ref3.polls,
loading = _ref3.loading;
return {
polls: polls,
loading: loading
};
})(PublishShixun));
// EXTERNAL MODULE: ./src/pages/Classrooms/Lists/Polls/components/Publish.tsx
var Publish = __webpack_require__(39239);
// EXTERNAL MODULE: ./node_modules/_antd@5.9.0@antd/es/date-picker/index.js + 66 modules
var date_picker = __webpack_require__(30518);
// 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/button/index.js
var es_button = __webpack_require__(3113);
// 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/tooltip/index.js + 3 modules
var tooltip = __webpack_require__(6848);
// EXTERNAL MODULE: ./node_modules/_antd@5.9.0@antd/es/divider/index.js + 1 modules
var divider = __webpack_require__(28103);
// EXTERNAL MODULE: ./node_modules/_@ant-design_icons@5.4.0@@ant-design/icons/es/icons/DeleteOutlined.js + 1 modules
var DeleteOutlined = __webpack_require__(37064);
// EXTERNAL MODULE: ./node_modules/_@ant-design_icons@5.4.0@@ant-design/icons/es/icons/PlusCircleOutlined.js + 1 modules
var PlusCircleOutlined = __webpack_require__(65547);
// EXTERNAL MODULE: ./src/service/polls.ts
var service_polls = __webpack_require__(63549);
;// CONCATENATED MODULE: ./src/pages/Classrooms/Lists/Polls/Detail/components/ConfigWorks/index.less?modules
// extracted by mini-css-extract-plugin
/* harmony default export */ var ConfigWorksmodules = ({"flex_box_center":"flex_box_center___mZeBL","flex_space_between":"flex_space_between___OvqA8","flex_box_vertical_center":"flex_box_vertical_center___nBE0A","flex_box_center_end":"flex_box_center_end___w0dO1","flex_box_column":"flex_box_column___mvqBn","form":"form___f61BQ","efficiency":"efficiency___wHbp8"});
;// CONCATENATED MODULE: ./src/pages/Classrooms/Lists/Polls/Detail/components/ConfigWorks/index.tsx
// import Redo from './components/Redo';
// import QuickComment from './components/QuickComment';
var RangePicker = date_picker["default"].RangePicker;
var Option = es_select["default"].Option;
var ConfigWorks_WorkList = function WorkList(_ref) {
var _pollSetting$group_se, _pollSetting$group_se2, _pollSetting$poll, _pollSetting$poll2;
var polls = _ref.polls,
loading = _ref.loading,
dispatch = _ref.dispatch;
var params = (0,_umi_production_exports.useParams)();
var location = (0,_umi_production_exports.useLocation)();
var pollSetting = polls.pollSetting,
commonHeader = polls.commonHeader;
var _useState = (0,_react_17_0_2_react.useState)(true),
_useState2 = slicedToArray_default()(_useState, 2),
disabled = _useState2[0],
setDisabled = _useState2[1];
var _useState3 = (0,_react_17_0_2_react.useState)([]),
_useState4 = slicedToArray_default()(_useState3, 2),
groupSettings = _useState4[0],
setGroupSetting = _useState4[1];
var _useState5 = (0,_react_17_0_2_react.useState)({
end_time: "",
publish_time: "",
show_result: false,
un_anonymous: false,
unified_setting: false
}),
_useState6 = slicedToArray_default()(_useState5, 2),
data = _useState6[0],
setData = _useState6[1];
(0,_react_17_0_2_react.useEffect)(function () {
getData();
}, []);
var getData = function getData() {
dispatch({
type: 'polls/getPollsSetting',
payload: objectSpread2_default()({}, params)
});
};
(0,_react_17_0_2_react.useEffect)(function () {
var _pollSetting$publishe;
if (!(pollSetting !== null && pollSetting !== void 0 && pollSetting.poll)) return;
Object.keys(data).map(function (item) {
data[item] = pollSetting["poll"][item];
});
groupSettings = pollSetting === null || pollSetting === void 0 || (_pollSetting$publishe = pollSetting.published_course_groups) === null || _pollSetting$publishe === void 0 ? void 0 : _pollSetting$publishe.filter(function (v) {
return v.course_publish_time !== null;
}).map(function (v) {
v['publish_time'] = v.course_publish_time;
v['end_time'] = v.course_end_time;
return v;
});
setData(data);
setGroupSetting(groupSettings);
}, [pollSetting]);
var onHandleChange = /*#__PURE__*/function () {
var _ref2 = asyncToGenerator_default()( /*#__PURE__*/regeneratorRuntime_default()().mark(function _callee() {
var _groupSettings;
var bodyData, res;
return regeneratorRuntime_default()().wrap(function _callee$(_context) {
while (1) switch (_context.prev = _context.next) {
case 0:
bodyData = JSON.parse(JSON.stringify(data));
(_groupSettings = groupSettings) === null || _groupSettings === void 0 || _groupSettings.map(function (item) {
var _item$course_group_na, _item$course_group_na2;
if (!item.course_group_name || !((_item$course_group_na = item.course_group_name) !== null && _item$course_group_na !== void 0 && _item$course_group_na.length)) {
message/* default */.ZP.error('分班不能为空');
throw new String("分班不能为空");
}
if (!item.publish_time || !item.end_time) {
message/* default */.ZP.error('请把发布时间填写完整');
throw new String('请把发布时间填写完整');
}
item.course_group_id = item === null || item === void 0 || (_item$course_group_na2 = item.course_group_name) === null || _item$course_group_na2 === void 0 ? void 0 : _item$course_group_na2.map(function (val) {
var _pollSetting$course_g;
return (_pollSetting$course_g = pollSetting.course_groups) === null || _pollSetting$course_g === void 0 || (_pollSetting$course_g = _pollSetting$course_g.filter(function (v) {
return v.course_group_name === val;
})) === null || _pollSetting$course_g === void 0 || (_pollSetting$course_g = _pollSetting$course_g[0]) === null || _pollSetting$course_g === void 0 ? void 0 : _pollSetting$course_g['course_group_id'];
});
});
// bodyData.challenge_settings.filter((v: any) => !v.hide);
bodyData.categoryId = params.categoryId;
bodyData.publish_time_groups = groupSettings;
bodyData.show_result = !!bodyData.show_result;
_context.next = 7;
return (0,service_polls/* updateSetting */.m7)(objectSpread2_default()({}, bodyData));
case 7:
res = _context.sent;
if (res.status === 0) {
message/* default */.ZP.success('更新成功');
setDisabled(true);
}
case 9:
case "end":
return _context.stop();
}
}, _callee);
}));
return function onHandleChange() {
return _ref2.apply(this, arguments);
};
}();
var disabledDate = function disabledDate(current) {
return current && current < dayjs_min_default()().startOf('minute');
};
var disabledDateEnd = function disabledDateEnd(current) {
if (data.end_time) {
return current && current < dayjs_min_default()(data.publish_time).startOf('minute');
}
return current && current < dayjs_min_default()().startOf('minute');
};
return /*#__PURE__*/(0,jsx_runtime.jsxs)("section", {
className: ConfigWorksmodules.form,
children: [/*#__PURE__*/(0,jsx_runtime.jsxs)("aside", {
className: "bg-white pl30 pr30 inline-block w100",
children: [/*#__PURE__*/(0,jsx_runtime.jsxs)(row/* default */.Z, {
children: [/*#__PURE__*/(0,jsx_runtime.jsx)(col/* default */.Z, {
span: 24,
children: /*#__PURE__*/(0,jsx_runtime.jsxs)(row/* default */.Z, {
align: "middle",
children: [/*#__PURE__*/(0,jsx_runtime.jsx)(col/* default */.Z, {
flex: '1',
children: /*#__PURE__*/(0,jsx_runtime.jsx)("h1", {
className: "mt15",
children: "\u53D1\u5E03\u8BBE\u7F6E"
})
}), /*#__PURE__*/(0,jsx_runtime.jsx)(col/* default */.Z, {
children: (0,authority/* isAdmin */.GJ)() && disabled && /*#__PURE__*/(0,jsx_runtime.jsx)(es_button/* default */.ZP, {
type: "primary",
size: "middle",
ghost: true,
onClick: function onClick() {
return setDisabled(false);
},
children: "\u7F16\u8F91\u8BBE\u7F6E"
})
})]
})
}), /*#__PURE__*/(0,jsx_runtime.jsxs)("div", {
children: [/*#__PURE__*/(0,jsx_runtime.jsx)("label", {
children: "\u53D1\u5E03\u65B9\u5F0F\uFF1A"
}), " ", /*#__PURE__*/(0,jsx_runtime.jsxs)(es_radio/* default.Group */.ZP.Group, {
disabled: disabled || commonHeader.polls_status > 1,
value: data.unified_setting,
onChange: function onChange(e) {
if (dayjs_min_default()(data.publish_time, 'YYYY-MM-DD HH:mm') <= dayjs_min_default()()) {
message/* default */.ZP.error("\u5DF2\u53D1\u5E03\uFF0C\u4E0D\u80FD\u518D\u4FEE\u6539\u7EDF\u4E00\u8BBE\u7F6E");
return;
}
if (groupSettings == '') {
setGroupSetting([{}]);
}
data.unified_setting = !data.unified_setting;
setData(Object.assign({}, data));
},
children: [/*#__PURE__*/(0,jsx_runtime.jsx)(es_radio/* default */.ZP, {
value: true,
children: "\u7EDF\u4E00\u53D1\u5E03"
}), /*#__PURE__*/(0,jsx_runtime.jsx)(es_radio/* default */.ZP, {
disabled: (pollSetting === null || pollSetting === void 0 || (_pollSetting$group_se = pollSetting.group_settings) === null || _pollSetting$group_se === void 0 ? void 0 : _pollSetting$group_se.length) === 0,
value: false,
children: "\u5206\u73ED\u53D1\u5E03"
})]
}), (pollSetting === null || pollSetting === void 0 || (_pollSetting$group_se2 = pollSetting.group_settings) === null || _pollSetting$group_se2 === void 0 ? void 0 : _pollSetting$group_se2.length) === 0 && /*#__PURE__*/(0,jsx_runtime.jsx)("p", {
style: {
marginLeft: '65px',
color: 'rgba(0, 0, 0, 0.25)'
},
children: "\uFF08\u672C\u8BFE\u5802\u65E0\u5206\u73ED\uFF0C\u4EC5\u652F\u6301\u9009\u62E9\u201C\u7EDF\u4E00\u53D1\u5E03\u201C\uFF09"
})]
})]
}), data.unified_setting && /*#__PURE__*/(0,jsx_runtime.jsxs)("div", {
children: [/*#__PURE__*/(0,jsx_runtime.jsxs)(row/* default */.Z, {
align: "middle",
className: "mt25 pl30",
children: [/*#__PURE__*/(0,jsx_runtime.jsx)(col/* default */.Z, {
children: "\u53D1\u5E03\u65F6\u95F4:"
}), /*#__PURE__*/(0,jsx_runtime.jsx)(col/* default */.Z, {
className: "ml5",
children: /*#__PURE__*/(0,jsx_runtime.jsx)(tooltip/* default */.Z, {
title: (pollSetting === null || pollSetting === void 0 || (_pollSetting$poll = pollSetting.poll) === null || _pollSetting$poll === void 0 ? void 0 : _pollSetting$poll.polls_status) > 1 && '发布时间已过,不能再修改',
children: /*#__PURE__*/(0,jsx_runtime.jsx)(date_picker["default"], {
style: {
width: 170
},
placeholder: '请选择发布时间',
showTime: {
format: 'HH:mm',
defaultValue: dayjs_min_default()((0,util/* HalfPastOne */.U6)(), 'HH:mm')
},
format: "YYYY-MM-DD HH:mm",
disabledDate: disabledDate,
disabled: disabled || (pollSetting === null || pollSetting === void 0 || (_pollSetting$poll2 = pollSetting.poll) === null || _pollSetting$poll2 === void 0 ? void 0 : _pollSetting$poll2.polls_status) > 1,
value: data.publish_time ? dayjs_min_default()(data.publish_time) : '',
allowClear: false,
onChange: function onChange(value, time) {
data.publish_time = time;
if (!data.end_time) {
data.end_time = dayjs_min_default()(value).add(1, 'month').format('YYYY-MM-DD HH:mm:ss');
}
setData(Object.assign({}, data));
}
// onChange={onChange}
// onOk={onOk}
})
})
}), /*#__PURE__*/(0,jsx_runtime.jsx)(col/* default */.Z, {
children: /*#__PURE__*/(0,jsx_runtime.jsx)("span", {
className: "c-grey-c ml10",
children: "(\u5B66\u751F\u201C\u5EF6\u65F6\u201D\u63D0\u4EA4\u4F5C\u54C1\u7684\u65F6\u95F4\u622A\u70B9)"
})
})]
}), /*#__PURE__*/(0,jsx_runtime.jsxs)(row/* default */.Z, {
align: "middle",
className: "mt25 pl30",
children: [/*#__PURE__*/(0,jsx_runtime.jsx)(col/* default */.Z, {
children: "\u622A\u6B62\u65F6\u95F4:"
}), /*#__PURE__*/(0,jsx_runtime.jsx)(col/* default */.Z, {
className: "ml5",
children: /*#__PURE__*/(0,jsx_runtime.jsx)(date_picker["default"], {
style: {
width: 170
},
placeholder: '请选择截止时间',
showTime: {
format: 'HH:mm',
defaultValue: dayjs_min_default()((0,util/* HalfPastOne */.U6)(), 'HH:mm')
},
format: "YYYY-MM-DD HH:mm",
disabled: disabled,
disabledDate: disabledDateEnd,
allowClear: false,
value: data.end_time ? dayjs_min_default()(data.end_time) : '',
onChange: function onChange(value, time) {
data.end_time = time;
setData(Object.assign({}, data));
}
// onChange={onChange}
// onOk={onOk}
})
}), /*#__PURE__*/(0,jsx_runtime.jsx)(col/* default */.Z, {
children: /*#__PURE__*/(0,jsx_runtime.jsx)("span", {
className: "c-grey-c ml10",
children: "(\u5B66\u751F\u201C\u5EF6\u65F6\u201D\u63D0\u4EA4\u4F5C\u54C1\u7684\u65F6\u95F4\u622A\u70B9)"
})
})]
})]
}), !data.unified_setting && /*#__PURE__*/(0,jsx_runtime.jsxs)(row/* default */.Z, {
style: {
marginTop: 30,
paddingTop: 40,
marginLeft: 40,
borderTop: '1px solid #eee'
},
children: [/*#__PURE__*/(0,jsx_runtime.jsx)(col/* default */.Z, {
span: 24,
children: /*#__PURE__*/(0,jsx_runtime.jsxs)(row/* default */.Z, {
children: [/*#__PURE__*/(0,jsx_runtime.jsx)(col/* default */.Z, {
span: 10
}), /*#__PURE__*/(0,jsx_runtime.jsx)(col/* default */.Z, {
span: 1
}), /*#__PURE__*/(0,jsx_runtime.jsx)(col/* default */.Z, {
span: 9,
children: /*#__PURE__*/(0,jsx_runtime.jsxs)(row/* default */.Z, {
className: "c-grey-c",
children: [/*#__PURE__*/(0,jsx_runtime.jsx)(col/* default */.Z, {
flex: "1",
children: "(\u5B66\u751F\u6536\u5230\u95EE\u5377\u7684\u65F6\u95F4)"
}), /*#__PURE__*/(0,jsx_runtime.jsx)(col/* default */.Z, {
flex: "1",
children: "(\u5B66\u751F\u53EF\u4EE5\u7B54\u9898\u7684\u65F6\u95F4\u622A\u70B9)"
})]
})
}), /*#__PURE__*/(0,jsx_runtime.jsx)(col/* default */.Z, {
span: 4
})]
})
}), groupSettings && groupSettings.map(function (v, k) {
return /*#__PURE__*/(0,jsx_runtime.jsx)(col/* default */.Z, {
span: 24,
children: /*#__PURE__*/(0,jsx_runtime.jsxs)(row/* default */.Z, {
gutter: [8, 16],
children: [/*#__PURE__*/(0,jsx_runtime.jsx)(col/* default */.Z, {
span: 10,
children: /*#__PURE__*/(0,jsx_runtime.jsxs)(row/* default */.Z, {
children: [/*#__PURE__*/(0,jsx_runtime.jsxs)(col/* default */.Z, {
children: ["\u53D1\u5E03\u89C4\u5219 ", k + 1]
}), /*#__PURE__*/(0,jsx_runtime.jsx)(col/* default */.Z, {
flex: '1',
style: {
maxWidth: 350
},
children: /*#__PURE__*/(0,jsx_runtime.jsx)(es_select["default"], {
disabled: disabled,
className: "ml20",
mode: "multiple",
style: {
width: '100%'
},
value: v.course_group_name,
placeholder: "\u8BF7\u9009\u62E9\u5206\u73ED\u540D\u79F0",
onChange: function onChange(value) {
groupSettings[k]['course_group_name'] = value;
setGroupSetting(groupSettings.slice());
},
children: pollSetting.course_groups && pollSetting.course_groups.map(function (v) {
if (!groupSettings.map(function (item) {
return item.course_group_name;
}).toString().split(",").includes(String(v.course_group_name))) {
return /*#__PURE__*/(0,jsx_runtime.jsx)(Option, {
value: v.course_group_name,
children: v.course_group_name
}, v.course_group_id);
}
;
})
})
})]
})
}), /*#__PURE__*/(0,jsx_runtime.jsx)(col/* default */.Z, {
span: 1
}), /*#__PURE__*/(0,jsx_runtime.jsx)(col/* default */.Z, {
span: 9,
children: /*#__PURE__*/(0,jsx_runtime.jsx)(RangePicker, {
disabled: disabled ? disabled : commonHeader.polls_status === 1 ? false : [true, false],
style: {
width: 400
},
placeholder: ['请选择发布时间', '请选择截止时间'],
allowClear: false,
showTime: {
format: 'HH:mm',
defaultValue: [dayjs_min_default()((0,util/* HalfPastOne */.U6)(), 'HH:mm'), dayjs_min_default()((0,util/* HalfPastOne */.U6)(), 'HH:mm')]
},
format: "YYYY-MM-DD HH:mm",
defaultValue: v.course_publish_time && [dayjs_min_default()(v.course_publish_time), dayjs_min_default()(v.course_end_time)],
onChange: function onChange(self, item) {
groupSettings[k]['publish_time'] = item[0];
groupSettings[k]['end_time'] = item[1];
}
})
}), !disabled && /*#__PURE__*/(0,jsx_runtime.jsxs)(col/* default */.Z, {
span: 4,
children: [k > 0 && /*#__PURE__*/(0,jsx_runtime.jsx)(DeleteOutlined/* default */.Z, {
onClick: function onClick() {
groupSettings = groupSettings.filter(function (val, key) {
return k !== key;
});
setGroupSetting(groupSettings.slice());
setTimeout(function () {
return setGroupSetting(groupSettings.slice());
}, 10);
}
}), /*#__PURE__*/(0,jsx_runtime.jsx)(PlusCircleOutlined/* default */.Z, {
className: "c-green ml20",
onClick: function onClick() {
setGroupSetting(groupSettings.concat({}));
}
})]
})]
})
}, k);
})]
}), /*#__PURE__*/(0,jsx_runtime.jsx)(divider/* default */.Z, {}), /*#__PURE__*/(0,jsx_runtime.jsxs)(row/* default */.Z, {
gutter: [20, 20],
children: [/*#__PURE__*/(0,jsx_runtime.jsx)(col/* default */.Z, {
children: /*#__PURE__*/(0,jsx_runtime.jsx)("strong", {
children: "\u516C\u5F00\u8BBE\u7F6E"
})
}), /*#__PURE__*/(0,jsx_runtime.jsxs)(col/* default */.Z, {
span: 24,
className: " pl30",
children: [/*#__PURE__*/(0,jsx_runtime.jsx)(es_checkbox/* default */.Z, {
checked: data.show_result,
disabled: disabled,
onChange: function onChange(e) {
data.show_result = e.target.checked;
setData(Object.assign({}, data));
},
children: /*#__PURE__*/(0,jsx_runtime.jsx)("strong", {
children: "\u516C\u5F00\u7EDF\u8BA1"
})
}), /*#__PURE__*/(0,jsx_runtime.jsx)("span", {
className: "c-grey-c font12",
children: "(\u9009\u4E2D\uFF0C\u5219\u5728\u95EE\u5377\u622A\u6B62\u65F6\u95F4\u4E4B\u540E\uFF0C\u5DF2\u63D0\u4EA4\u95EE\u5377\u9898\u7684\u5B66\u751F\u53EF\u4EE5\u67E5\u770B\u7EDF\u8BA1\u7ED3\u679C\uFF0C\u5426\u5219\u4E0D\u80FD\u67E5\u770B)"
})]
}), /*#__PURE__*/(0,jsx_runtime.jsxs)(col/* default */.Z, {
span: 24,
className: " pl30",
children: [/*#__PURE__*/(0,jsx_runtime.jsx)(es_checkbox/* default */.Z, {
checked: data.un_anonymous,
disabled: disabled,
onChange: function onChange(e) {
data.un_anonymous = e.target.checked;
setData(Object.assign({}, data));
},
children: /*#__PURE__*/(0,jsx_runtime.jsx)("strong", {
children: "\u5B9E\u540D\u95EE\u5377"
})
}), /*#__PURE__*/(0,jsx_runtime.jsx)("span", {
className: "c-grey-c font12",
children: "(\u9009\u4E2D\uFF0C\u5219\u6309\u7167\u5B66\u751F\u7684\u771F\u5B9E\u59D3\u540D\u63D0\u4EA4\uFF0C\u5426\u5219\u968F\u673A\u7F51\u540D\u540D\u79F0\u63D0\u4EA4)"
})]
})]
})]
}), /*#__PURE__*/(0,jsx_runtime.jsx)(row/* default */.Z, {
children: /*#__PURE__*/(0,jsx_runtime.jsx)(col/* default */.Z, {
children: !disabled && /*#__PURE__*/(0,jsx_runtime.jsxs)(col/* default */.Z, {
className: "mb50 mt20 btn-w120",
children: [/*#__PURE__*/(0,jsx_runtime.jsx)(es_button/* default */.ZP, {
type: "primary",
size: 'middle',
onClick: function onClick() {
return onHandleChange();
},
children: "\u63D0\u4EA4"
}), /*#__PURE__*/(0,jsx_runtime.jsx)(es_button/* default */.ZP, {
type: "primary",
size: 'middle',
onClick: function onClick() {
setDisabled(true);
getData();
},
ghost: true,
className: "ml20",
children: "\u53D6\u6D88"
})]
})
})
})]
});
};
/* harmony default export */ var ConfigWorks = ((0,_umi_production_exports.connect)(function (_ref3) {
var polls = _ref3.polls,
loading = _ref3.loading;
return {
polls: polls,
loading: loading.effects
};
})(ConfigWorks_WorkList));
// EXTERNAL MODULE: ./node_modules/_antd@5.9.0@antd/es/skeleton/index.js + 12 modules
var skeleton = __webpack_require__(66999);
// EXTERNAL MODULE: ./node_modules/_antd@5.9.0@antd/es/progress/index.js + 13 modules
var progress = __webpack_require__(93948);
;// CONCATENATED MODULE: ./src/pages/Classrooms/Lists/Polls/Detail/components/StatisticsResult/index.less?modules
// extracted by mini-css-extract-plugin
/* harmony default export */ var StatisticsResultmodules = ({"bg":"bg___EiI5z"});
;// CONCATENATED MODULE: ./src/pages/Classrooms/Lists/Polls/Detail/components/StatisticsResult/index.tsx
var questionType = {
1: "单选题",
2: "多选题",
3: "主观题"
};
var PollsStatisticsResult = function PollsStatisticsResult(_ref) {
var _statisticsList$quest;
var polls = _ref.polls,
loading = _ref.loading,
dispatch = _ref.dispatch;
var params = (0,_umi_production_exports.useParams)();
var _useState = (0,_react_17_0_2_react.useState)({
page: 1,
pre_size: 10
}),
_useState2 = slicedToArray_default()(_useState, 1),
query = _useState2[0];
var statisticsList = polls.statisticsList;
var questions = statisticsList.questions;
(0,_react_17_0_2_react.useEffect)(function () {
query.page = 1;
getData();
}, [params.coursesId]);
var getData = function getData() {
dispatch({
type: 'polls/getPollsStatistics',
payload: objectSpread2_default()(objectSpread2_default()({}, params), query)
});
};
return /*#__PURE__*/(0,jsx_runtime.jsxs)(skeleton/* default */.Z, {
loading: loading['polls/getPollsStatistics'],
children: [/*#__PURE__*/(0,jsx_runtime.jsx)("section", {
className: "minH500 mb50 bg-white pl30 pr30 inline-block w100",
children: /*#__PURE__*/(0,jsx_runtime.jsxs)(skeleton/* default */.Z, {
loading: loading['polls/getPollsStatistics'],
children: [questions == '' && /*#__PURE__*/(0,jsx_runtime.jsx)(NoData/* default */.Z, {}), questions === null || questions === void 0 ? void 0 : questions.map(function (item, index) {
var _item$question, _item$question2, _item$question3, _item$question4, _item$question5, _item$question6;
return /*#__PURE__*/(0,jsx_runtime.jsxs)("aside", {
children: [/*#__PURE__*/(0,jsx_runtime.jsxs)("div", {
className: "mt20",
children: [/*#__PURE__*/(0,jsx_runtime.jsxs)("span", {
className: "c-blue font16",
children: [item === null || item === void 0 || (_item$question = item.question) === null || _item$question === void 0 ? void 0 : _item$question.question_number, "\u3001", questionType[item.question.question_type]]
}), /*#__PURE__*/(0,jsx_runtime.jsx)("span", {
className: "tag-grey-eae ml10",
children: (item === null || item === void 0 || (_item$question2 = item.question) === null || _item$question2 === void 0 ? void 0 : _item$question2.is_necessary) === 0 ? "选答" : "必答"
}), item.question.question_type === 2 && /*#__PURE__*/(0,jsx_runtime.jsxs)("span", {
className: "ml10 c-grey-999",
children: ["\u53EF\u9009", item === null || item === void 0 || (_item$question3 = item.question) === null || _item$question3 === void 0 ? void 0 : _item$question3.min_choices, "-", item === null || item === void 0 || (_item$question4 = item.question) === null || _item$question4 === void 0 ? void 0 : _item$question4.max_choices, "\u9879"]
})]
}), /*#__PURE__*/(0,jsx_runtime.jsx)("div", {
className: "mt10",
children: /*#__PURE__*/(0,jsx_runtime.jsx)("span", {
className: "font16",
children: item.question.question_title
})
}), item.question.question_type !== 3 && /*#__PURE__*/(0,jsx_runtime.jsxs)("aside", {
children: [/*#__PURE__*/(0,jsx_runtime.jsx)("div", {
className: [StatisticsResultmodules.bg, 'mt15'].join(' '),
children: /*#__PURE__*/(0,jsx_runtime.jsxs)(row/* default */.Z, {
gutter: [20, 20],
children: [/*#__PURE__*/(0,jsx_runtime.jsx)(col/* default */.Z, {
flex: "1",
children: /*#__PURE__*/(0,jsx_runtime.jsx)("span", {
className: "pl10",
children: "\u9009\u9879"
})
}), /*#__PURE__*/(0,jsx_runtime.jsx)(col/* default */.Z, {
flex: "100px",
children: "\u5C0F\u8BA1"
}), /*#__PURE__*/(0,jsx_runtime.jsx)(col/* default */.Z, {
flex: "440px",
children: "\u767E\u5206\u6BD4"
})]
})
}), (_item$question5 = item.question) === null || _item$question5 === void 0 || (_item$question5 = _item$question5.answers) === null || _item$question5 === void 0 ? void 0 : _item$question5.map(function (val, key) {
return /*#__PURE__*/(0,jsx_runtime.jsxs)("div", {
children: [/*#__PURE__*/(0,jsx_runtime.jsxs)(row/* default */.Z, {
gutter: [20, 20],
style: {
marginBottom: 0
},
children: [/*#__PURE__*/(0,jsx_runtime.jsx)(col/* default */.Z, {
flex: "1",
children: /*#__PURE__*/(0,jsx_runtime.jsx)("span", {
className: "pl10",
children: val.answer_text
})
}), /*#__PURE__*/(0,jsx_runtime.jsx)(col/* default */.Z, {
flex: "100px",
children: /*#__PURE__*/(0,jsx_runtime.jsx)("span", {
className: "c-green",
children: val.answer_users_count
})
}), /*#__PURE__*/(0,jsx_runtime.jsx)(col/* default */.Z, {
flex: "440px",
children: /*#__PURE__*/(0,jsx_runtime.jsx)(progress/* default */.Z, {
status: "active",
strokeColor: "#2abd8b",
percent: (val.answer_percent * 100).toFixed(1)
})
})]
}, key), /*#__PURE__*/(0,jsx_runtime.jsx)(divider/* default */.Z, {
style: {
margin: 0
}
})]
}, key);
})]
}), item.question.question_type === 3 && /*#__PURE__*/(0,jsx_runtime.jsxs)("aside", {
children: [/*#__PURE__*/(0,jsx_runtime.jsx)("div", {
className: [StatisticsResultmodules.bg, 'mt15'].join(' '),
children: /*#__PURE__*/(0,jsx_runtime.jsxs)(row/* default */.Z, {
gutter: [20, 20],
children: [/*#__PURE__*/(0,jsx_runtime.jsx)(col/* default */.Z, {
flex: "100px",
children: /*#__PURE__*/(0,jsx_runtime.jsx)("span", {
className: "pl10",
children: "\u7F16\u53F7"
})
}), /*#__PURE__*/(0,jsx_runtime.jsx)(col/* default */.Z, {
flex: "1",
children: "\u6587\u672C\u7B54\u6848"
})]
})
}), (_item$question6 = item.question) === null || _item$question6 === void 0 || (_item$question6 = _item$question6.vote_text) === null || _item$question6 === void 0 ? void 0 : _item$question6.map(function (val, key) {
return /*#__PURE__*/(0,jsx_runtime.jsxs)("div", {
children: [/*#__PURE__*/(0,jsx_runtime.jsxs)(row/* default */.Z, {
gutter: [20, 20],
style: {
marginBottom: 0
},
children: [/*#__PURE__*/(0,jsx_runtime.jsx)(col/* default */.Z, {
flex: "100px",
children: /*#__PURE__*/(0,jsx_runtime.jsx)("span", {
className: "pl10",
children: key + 1
})
}), /*#__PURE__*/(0,jsx_runtime.jsx)(col/* default */.Z, {
flex: "1",
children: /*#__PURE__*/(0,jsx_runtime.jsx)("span", {
className: "",
children: val
})
})]
}, key), /*#__PURE__*/(0,jsx_runtime.jsx)(divider/* default */.Z, {
style: {
margin: 0
}
})]
}, key);
})]
}), /*#__PURE__*/(0,jsx_runtime.jsxs)(row/* default */.Z, {
gutter: [20, 20],
className: 'mt10',
children: [/*#__PURE__*/(0,jsx_runtime.jsx)(col/* default */.Z, {
flex: "1",
children: "\u6709\u6548\u586B\u5199\u6570\u91CF"
}), /*#__PURE__*/(0,jsx_runtime.jsx)(col/* default */.Z, {
flex: "540px",
children: item.question.commit_users_count
})]
})]
}, index);
})]
})
}), /*#__PURE__*/(0,jsx_runtime.jsx)("div", {
className: " tc",
children: /*#__PURE__*/(0,jsx_runtime.jsx)(pagination/* default */.Z, {
hideOnSinglePage: true,
total: statisticsList === null || statisticsList === void 0 || (_statisticsList$quest = statisticsList.question_types) === null || _statisticsList$quest === void 0 ? void 0 : _statisticsList$quest.q_counts,
current: query.page || 1,
onChange: function onChange(page) {
query.page = page;
getData();
}
})
})]
});
};
/* harmony default export */ var StatisticsResult = ((0,_umi_production_exports.connect)(function (_ref2) {
var polls = _ref2.polls,
loading = _ref2.loading;
return {
polls: polls,
loading: loading.effects
};
})(PollsStatisticsResult));
// EXTERNAL MODULE: ./src/components/RenderHtml/index.tsx + 2 modules
var RenderHtml = __webpack_require__(47759);
// EXTERNAL MODULE: ./node_modules/_@babel_runtime@7.23.6@@babel/runtime/helpers/objectWithoutProperties.js
var objectWithoutProperties = __webpack_require__(39647);
var objectWithoutProperties_default = /*#__PURE__*/__webpack_require__.n(objectWithoutProperties);
;// CONCATENATED MODULE: ./src/pages/Classrooms/Lists/Polls/Detail/components/PreviewPolls/components/editor.less?modules
// extracted by mini-css-extract-plugin
/* harmony default export */ var editormodules = ({"flex_box_center":"flex_box_center___Mm5nR","flex_space_between":"flex_space_between___MMkat","flex_box_vertical_center":"flex_box_vertical_center___LETW1","flex_box_center_end":"flex_box_center_end___XlC9p","flex_box_column":"flex_box_column___THy8y","wrap":"wrap___z9iJU","modal":"modal___y8bNh","titleWrap":"titleWrap___knBE8","required":"required___Ojs5D","title":"title___M_fKx","colorGray":"colorGray___N8txU","choiceWrap":"choiceWrap____Xkwt","answer":"answer___TSzCH","activeAnswer":"activeAnswer___Pnkob","deleteIcon":"deleteIcon___O5q20","addIcon":"addIcon___c8iSL","editorWrap":"editorWrap___oodwM","htmlWrap":"htmlWrap___ljy1Y","radio":"radio___ZUxPE","color333":"color333____votr","color999":"color999___Audhi","questionType":"questionType___MN7qw","questionChoices":"questionChoices___ZMeSF"});
;// CONCATENATED MODULE: ./src/pages/Classrooms/Lists/Polls/Detail/components/PreviewPolls/components/MultipleEditor/index.tsx
var _excluded = ["problemset", "globalSetting", "loading", "dispatch", "onRef", "editData", "editKey", "callback"];
var tagList = ['A', 'B', 'C', 'D', 'E', 'F', 'G', 'H', 'I', 'J', 'K', 'L', 'M', 'N', 'O', 'P', 'Q', 'R', 'S', 'T', 'U', 'V', 'W', 'X', 'Y', 'Z'];
var SingleEditor = function SingleEditor(_ref, ref) {
var problemset = _ref.problemset,
globalSetting = _ref.globalSetting,
loading = _ref.loading,
dispatch = _ref.dispatch,
_ref$onRef = _ref.onRef,
onRef = _ref$onRef === void 0 ? function () {} : _ref$onRef,
editData = _ref.editData,
editKey = _ref.editKey,
callback = _ref.callback,
props = objectWithoutProperties_default()(_ref, _excluded);
var _useState = (0,_react_17_0_2_react.useState)([]),
_useState2 = slicedToArray_default()(_useState, 2),
questionChoiceList = _useState2[0],
setQuestionChoiceList = _useState2[1];
var _useState3 = (0,_react_17_0_2_react.useState)(),
_useState4 = slicedToArray_default()(_useState3, 2),
activeEditor = _useState4[0],
setActiveEditor = _useState4[1];
var _useState5 = (0,_react_17_0_2_react.useState)([]),
_useState6 = slicedToArray_default()(_useState5, 2),
activeAnswer = _useState6[0],
setActiveAnswer = _useState6[1];
var _useState7 = (0,_react_17_0_2_react.useState)(''),
_useState8 = slicedToArray_default()(_useState7, 2),
title = _useState8[0],
setTitle = _useState8[1];
var _useState9 = (0,_react_17_0_2_react.useState)(0),
_useState10 = slicedToArray_default()(_useState9, 2),
score = _useState10[0],
setScore = _useState10[1];
var _useState11 = (0,_react_17_0_2_react.useState)(true),
_useState12 = slicedToArray_default()(_useState11, 2),
isNecessary = _useState12[0],
setIsNecessary = _useState12[1];
var _useState13 = (0,_react_17_0_2_react.useState)(false),
_useState14 = slicedToArray_default()(_useState13, 2),
other = _useState14[0],
setOther = _useState14[1];
var params = (0,_umi_production_exports.useParams)();
var _useState15 = (0,_react_17_0_2_react.useState)(''),
_useState16 = slicedToArray_default()(_useState15, 2),
maxChoices = _useState16[0],
setMaxChoices = _useState16[1];
var _useState17 = (0,_react_17_0_2_react.useState)(''),
_useState18 = slicedToArray_default()(_useState17, 2),
minChoices = _useState18[0],
setMinChoices = _useState18[1];
(0,_react_17_0_2_react.useEffect)(function () {
var _editData$question, _editData$question2, _editData$question3, _editData$question4, _editData$question5, _editData$question6;
if (!(editData !== null && editData !== void 0 && (_editData$question = editData.question) !== null && _editData$question !== void 0 && _editData$question.question_title)) {
setQuestionChoiceList([{
disabled: false,
value: ""
}, {
disabled: false,
value: ""
}, {
disabled: false,
value: ""
}, {
disabled: false,
value: ""
}]);
setIsNecessary(true);
setTitle('');
setOther(false);
return;
}
setMaxChoices(editData === null || editData === void 0 || (_editData$question2 = editData.question) === null || _editData$question2 === void 0 ? void 0 : _editData$question2.max_choices);
setMinChoices(editData === null || editData === void 0 || (_editData$question3 = editData.question) === null || _editData$question3 === void 0 ? void 0 : _editData$question3.min_choices);
setTitle(editData === null || editData === void 0 || (_editData$question4 = editData.question) === null || _editData$question4 === void 0 ? void 0 : _editData$question4.question_title);
setIsNecessary(!!(editData !== null && editData !== void 0 && (_editData$question5 = editData.question) !== null && _editData$question5 !== void 0 && _editData$question5.is_necessary));
setQuestionChoiceList(editData === null || editData === void 0 || (_editData$question6 = editData.question) === null || _editData$question6 === void 0 ? void 0 : _editData$question6.answers.map(function (item) {
return {
value: item.answer_text,
disabled: item.answer_text === '其他' ? true : false
};
}));
}, [editData]);
(0,_react_17_0_2_react.useImperativeHandle)(ref, function () {
return {
onSave: onSave
};
});
var onSave = /*#__PURE__*/function () {
var _ref2 = asyncToGenerator_default()( /*#__PURE__*/regeneratorRuntime_default()().mark(function _callee(status) {
var _editData$question7;
var findNotAnswerIndex, res, bodyData;
return regeneratorRuntime_default()().wrap(function _callee$(_context) {
while (1) switch (_context.prev = _context.next) {
case 0:
if (title) {
_context.next = 3;
break;
}
message/* default */.ZP.info("请您输入题目");
return _context.abrupt("return", false);
case 3:
findNotAnswerIndex = questionChoiceList.findIndex(function (item) {
return !item.value;
});
if (!(findNotAnswerIndex > -1)) {
_context.next = 7;
break;
}
message/* default */.ZP.info("\u8BF7\u5148\u8F93\u5165 ".concat(tagList[findNotAnswerIndex], " \u9009\u9879\u7684\u5185\u5BB9"));
return _context.abrupt("return", false);
case 7:
bodyData = {
"question_title": title,
"question_type": 2,
"insert_id": editData.insert_id,
"is_necessary": Math.ceil(isNecessary),
"max_choices": maxChoices,
"min_choices": minChoices,
"question_answers": questionChoiceList.map(function (item) {
return item.value;
})
};
if (!((_editData$question7 = editData.question) !== null && _editData$question7 !== void 0 && _editData$question7.id)) {
_context.next = 14;
break;
}
_context.next = 11;
return (0,service_polls/* editPollsQuestion */.IU)(objectSpread2_default()({
"pollsId": editData.question.id
}, bodyData));
case 11:
res = _context.sent;
_context.next = 17;
break;
case 14:
_context.next = 16;
return (0,service_polls/* addExerciseQuestion */.MK)(objectSpread2_default()({
"pollsId": params.categoryId
}, bodyData));
case 16:
res = _context.sent;
case 17:
if (!(res.status === 0)) {
_context.next = 23;
break;
}
message/* default */.ZP.success("保存成功");
callback('edit', -1);
_context.next = 22;
return dispatch({
type: "polls/editPolls",
payload: objectSpread2_default()({}, params)
});
case 22:
if (status) {
bodyData.answers = bodyData.question_answers.map(function (item) {
return {
answer_text: item
};
});
callback('addContinue', objectSpread2_default()({
type: 2,
insert_id: editData.question.id,
key: editData.key,
question_type: 2
}, bodyData));
}
case 23:
case "end":
return _context.stop();
}
}, _callee);
}));
return function onSave(_x) {
return _ref2.apply(this, arguments);
};
}();
var actionArr = [{
name: "删除",
icon: "iconfont c-light-black ml30 icon-shanchu current",
id: "del"
}, {
name: "上移",
icon: "iconfont c-green ml30 icon-xiangshangyi current",
id: "up"
}, {
name: "下移",
icon: "iconfont c-green ml30 icon-xiangxiayi current",
id: "down"
}, {
name: "添加",
icon: "iconfont c-green ml30 icon-tianjia current",
id: "add"
}, {
name: "编辑",
icon: "iconfont c-green ml30 icon-bianjidaibeijing current",
id: "edit"
}];
var actionClick = /*#__PURE__*/function () {
var _ref3 = asyncToGenerator_default()( /*#__PURE__*/regeneratorRuntime_default()().mark(function _callee3(item) {
var _editData$question9, _editData$question10;
return regeneratorRuntime_default()().wrap(function _callee3$(_context3) {
while (1) switch (_context3.prev = _context3.next) {
case 0:
_context3.t0 = item.id;
_context3.next = _context3.t0 === "del" ? 3 : _context3.t0 === "up" ? 5 : _context3.t0 === "down" ? 5 : _context3.t0 === "edit" ? 9 : _context3.t0 === "add" ? 11 : 13;
break;
case 3:
modal/* default */.Z.confirm({
centered: true,
okText: '确定',
cancelText: '取消',
title: '确认要删除这个问题吗?',
onOk: function onOk() {
return asyncToGenerator_default()( /*#__PURE__*/regeneratorRuntime_default()().mark(function _callee2() {
var _editData$question8;
return regeneratorRuntime_default()().wrap(function _callee2$(_context2) {
while (1) switch (_context2.prev = _context2.next) {
case 0:
_context2.next = 2;
return (0,service_polls/* deletePollsQuestion */.jy)({
pollsId: editData === null || editData === void 0 || (_editData$question8 = editData.question) === null || _editData$question8 === void 0 ? void 0 : _editData$question8.id
});
case 2:
dispatch({
type: "polls/editPolls",
payload: objectSpread2_default()({}, params)
});
case 3:
case "end":
return _context2.stop();
}
}, _callee2);
}))();
}
});
return _context3.abrupt("break", 13);
case 5:
_context3.next = 7;
return (0,service_polls/* pollsMoveUpDown */.wh)({
pollsId: editData === null || editData === void 0 || (_editData$question9 = editData.question) === null || _editData$question9 === void 0 ? void 0 : _editData$question9.id,
opr: item.id
});
case 7:
dispatch({
type: "polls/editPolls",
payload: objectSpread2_default()({}, params)
});
return _context3.abrupt("break", 13);
case 9:
callback('edit', editData.key);
return _context3.abrupt("break", 13);
case 11:
callback('add', {
type: 2,
key: editData.key,
insert_id: editData === null || editData === void 0 || (_editData$question10 = editData.question) === null || _editData$question10 === void 0 ? void 0 : _editData$question10.id,
question_type: 2
});
return _context3.abrupt("break", 13);
case 13:
case "end":
return _context3.stop();
}
}, _callee3);
}));
return function actionClick(_x2) {
return _ref3.apply(this, arguments);
};
}();
var showList = function showList() {
var _editData$question11, _editData$question12, _editData$question$an;
return /*#__PURE__*/(0,jsx_runtime.jsxs)("aside", {
children: [/*#__PURE__*/(0,jsx_runtime.jsx)("div", {
className: editormodules.questionType,
children: /*#__PURE__*/(0,jsx_runtime.jsxs)("div", {
children: [/*#__PURE__*/(0,jsx_runtime.jsxs)("span", {
className: "font16",
children: ["\u7B2C", editData.key, "\u9898"]
}), /*#__PURE__*/(0,jsx_runtime.jsx)("span", {
className: "font16 c-light-black ml10 mr20",
children: "\u591A\u9009\u9898"
}), " \u53EF\u9009", editData === null || editData === void 0 || (_editData$question11 = editData.question) === null || _editData$question11 === void 0 ? void 0 : _editData$question11.min_choices, "-", editData === null || editData === void 0 || (_editData$question12 = editData.question) === null || _editData$question12 === void 0 ? void 0 : _editData$question12.max_choices, "\u9879"]
})
}), /*#__PURE__*/(0,jsx_runtime.jsx)("div", {
className: "mt5",
children: /*#__PURE__*/(0,jsx_runtime.jsx)(RenderHtml/* default */.Z, {
value: editData.question.question_title
})
}), /*#__PURE__*/(0,jsx_runtime.jsx)("div", {
className: editormodules.questionChoices,
children: editData === null || editData === void 0 || (_editData$question$an = editData.question.answers) === null || _editData$question$an === void 0 ? void 0 : _editData$question$an.map(function (item, index) {
return /*#__PURE__*/(0,jsx_runtime.jsx)(row/* default */.Z, {
children: /*#__PURE__*/(0,jsx_runtime.jsx)(col/* default */.Z, {
children: /*#__PURE__*/(0,jsx_runtime.jsx)(es_checkbox/* default */.Z, {
disabled: true,
children: /*#__PURE__*/(0,jsx_runtime.jsx)("span", {
className: "c-black font14",
children: item.answer_text
})
}, index)
})
});
})
})]
});
};
var showEdit = function showEdit() {
return /*#__PURE__*/(0,jsx_runtime.jsxs)("aside", {
children: [/*#__PURE__*/(0,jsx_runtime.jsx)("div", {
className: editormodules.questionType,
children: /*#__PURE__*/(0,jsx_runtime.jsxs)("div", {
children: [/*#__PURE__*/(0,jsx_runtime.jsx)("span", {
className: "font16 c-blue",
children: "\u591A\u9009\u9898"
}), " ", /*#__PURE__*/(0,jsx_runtime.jsx)(es_checkbox/* default */.Z, {
checked: isNecessary ? true : false,
className: "ml10",
onChange: function onChange(e) {
return setIsNecessary(e.target.checked);
},
children: "\u5FC5\u7B54"
})]
})
}), /*#__PURE__*/(0,jsx_runtime.jsx)("p", {
className: editormodules.titleWrap,
children: /*#__PURE__*/(0,jsx_runtime.jsx)(input/* default */.Z.TextArea, {
rows: 1,
value: title,
placeholder: "\u8BF7\u8F93\u5165\u9898\u76EE",
onChange: function onChange(e) {
return setTitle(e.target.value);
}
})
}), /*#__PURE__*/(0,jsx_runtime.jsxs)("p", {
className: editormodules.titleWrap,
children: [/*#__PURE__*/(0,jsx_runtime.jsx)("span", {
className: editormodules.required,
children: "*"
}), /*#__PURE__*/(0,jsx_runtime.jsxs)("span", {
className: editormodules.title,
children: ["\u7B54\u6848\u9009\u9879\uFF1A", /*#__PURE__*/(0,jsx_runtime.jsx)("span", {
className: editormodules.colorGray,
children: "\u70B9\u51FB\u9009\u9879\u53EF\u8BBE\u7F6E\u6B63\u786E\u7B54\u6848"
})]
})]
}), questionChoiceList.map(function (item, index) {
return /*#__PURE__*/(0,jsx_runtime.jsxs)(row/* default */.Z, {
className: editormodules.choiceWrap,
gutter: [12, 12],
children: [/*#__PURE__*/(0,jsx_runtime.jsx)(col/* default */.Z, {
children: /*#__PURE__*/(0,jsx_runtime.jsx)("span", {
className: "font16",
children: "\u9009\u9879"
})
}), /*#__PURE__*/(0,jsx_runtime.jsx)(col/* default */.Z, {
className: editormodules.editorWrap,
flex: "1",
children: /*#__PURE__*/(0,jsx_runtime.jsx)(input/* default */.Z.TextArea, {
value: questionChoiceList[index]['value'],
rows: 1,
disabled: item.disabled ? true : false,
onChange: function onChange(e) {
questionChoiceList[index]['value'] = e.target.value;
setQuestionChoiceList(toConsumableArray_default()(questionChoiceList));
}
})
}), /*#__PURE__*/(0,jsx_runtime.jsx)(col/* default */.Z, {
children: index > 1 && /*#__PURE__*/(0,jsx_runtime.jsx)(tooltip/* default */.Z, {
title: "\u5220\u9664",
children: /*#__PURE__*/(0,jsx_runtime.jsx)("i", {
className: "".concat(editormodules.deleteIcon, " iconfont icon-htmal5icon19"),
onClick: function onClick() {
setQuestionChoiceList(questionChoiceList.filter(function (_, key) {
return key !== index;
}));
if (item.disabled) setOther(false);
}
})
})
})]
}, index);
}), /*#__PURE__*/(0,jsx_runtime.jsxs)(row/* default */.Z, {
gutter: [12, 12],
children: [/*#__PURE__*/(0,jsx_runtime.jsx)(col/* default */.Z, {
children: "\u53EF\u9009"
}), /*#__PURE__*/(0,jsx_runtime.jsxs)(col/* default */.Z, {
children: [/*#__PURE__*/(0,jsx_runtime.jsxs)(es_select["default"], {
value: minChoices,
style: {
width: 120
},
onChange: function onChange(value) {
return setMinChoices(value);
},
children: [/*#__PURE__*/(0,jsx_runtime.jsx)(es_select["default"].Option, {
value: "",
children: "--"
}), questionChoiceList.map(function (item, index) {
return /*#__PURE__*/(0,jsx_runtime.jsx)(es_select["default"].Option, {
value: String(index + 2),
children: index + 2
});
})]
}), /*#__PURE__*/(0,jsx_runtime.jsx)("span", {
className: "ml10 mr10",
children: "~"
}), /*#__PURE__*/(0,jsx_runtime.jsxs)(es_select["default"], {
style: {
width: 120
},
value: maxChoices,
onChange: function onChange(value) {
return setMaxChoices(value);
},
children: [/*#__PURE__*/(0,jsx_runtime.jsx)(es_select["default"].Option, {
value: "",
children: "--"
}), questionChoiceList.map(function (item, index) {
return /*#__PURE__*/(0,jsx_runtime.jsx)(es_select["default"].Option, {
value: String(index + 2),
children: index + 2
});
})]
})]
})]
}), /*#__PURE__*/(0,jsx_runtime.jsxs)(row/* default */.Z, {
gutter: [12, 12],
children: [/*#__PURE__*/(0,jsx_runtime.jsxs)(col/* default */.Z, {
flex: "1",
children: [/*#__PURE__*/(0,jsx_runtime.jsx)(es_button/* default */.ZP, {
type: "default",
onClick: function onClick() {
return setQuestionChoiceList([].concat(toConsumableArray_default()(questionChoiceList), [{
value: ''
}]));
},
children: "\u65B0\u589E\u9009\u9879"
}), !other && /*#__PURE__*/(0,jsx_runtime.jsx)(es_button/* default */.ZP, {
type: "default",
className: "ml20",
onClick: function onClick() {
setQuestionChoiceList([].concat(toConsumableArray_default()(questionChoiceList), [{
disabled: true,
value: "其它"
}]));
setOther(true);
},
children: "\u65B0\u589E\u5176\u4ED6\u9009\u9879"
})]
}), /*#__PURE__*/(0,jsx_runtime.jsxs)(col/* default */.Z, {
className: "tl",
children: [/*#__PURE__*/(0,jsx_runtime.jsx)(es_button/* default */.ZP, {
type: "default",
onClick: function onClick() {
var _editData$question13;
if ((_editData$question13 = editData.question) !== null && _editData$question13 !== void 0 && _editData$question13.id) {
callback('edit', -1);
} else {
callback('del', editData.key);
}
},
children: "\u53D6\u6D88"
}), /*#__PURE__*/(0,jsx_runtime.jsx)(es_button/* default */.ZP, {
className: "ml20",
type: "primary",
onClick: function onClick() {
return onSave();
},
children: "\u4FDD\u5B58"
}), /*#__PURE__*/(0,jsx_runtime.jsx)(es_button/* default */.ZP, {
className: "ml20",
type: "primary",
onClick: function onClick() {
return onSave(true);
},
children: "\u4FDD\u5B58\u5E76\u7EE7\u7EED"
})]
})]
})]
});
};
return /*#__PURE__*/(0,jsx_runtime.jsxs)("section", {
className: editormodules.wrap,
children: [editKey !== editData.key && showList(), editKey === editData.key && showEdit()]
});
};
/* harmony default export */ var MultipleEditor = ((0,_umi_production_exports.connect)(function (_ref4) {
var problemset = _ref4.problemset,
loading = _ref4.loading,
globalSetting = _ref4.globalSetting;
return {
problemset: problemset,
globalSetting: globalSetting,
loading: loading.effects
};
}, null, null, {
forwardRef: true
})( /*#__PURE__*/(0,_react_17_0_2_react.forwardRef)(SingleEditor)));
;// CONCATENATED MODULE: ./src/pages/Classrooms/Lists/Polls/Detail/components/PreviewPolls/components/SingleEditor/index.tsx
var SingleEditor_excluded = ["problemset", "globalSetting", "loading", "dispatch", "onRef", "editData", "editKey", "callback"];
var SingleEditor_tagList = ['A', 'B', 'C', 'D', 'E', 'F', 'G', 'H', 'I', 'J', 'K', 'L', 'M', 'N', 'O', 'P', 'Q', 'R', 'S', 'T', 'U', 'V', 'W', 'X', 'Y', 'Z'];
var SingleEditor_SingleEditor = function SingleEditor(_ref, ref) {
var problemset = _ref.problemset,
globalSetting = _ref.globalSetting,
loading = _ref.loading,
dispatch = _ref.dispatch,
_ref$onRef = _ref.onRef,
onRef = _ref$onRef === void 0 ? function () {} : _ref$onRef,
editData = _ref.editData,
editKey = _ref.editKey,
callback = _ref.callback,
props = objectWithoutProperties_default()(_ref, SingleEditor_excluded);
var _useState = (0,_react_17_0_2_react.useState)([]),
_useState2 = slicedToArray_default()(_useState, 2),
questionChoiceList = _useState2[0],
setQuestionChoiceList = _useState2[1];
var _useState3 = (0,_react_17_0_2_react.useState)(),
_useState4 = slicedToArray_default()(_useState3, 2),
activeEditor = _useState4[0],
setActiveEditor = _useState4[1];
var _useState5 = (0,_react_17_0_2_react.useState)([]),
_useState6 = slicedToArray_default()(_useState5, 2),
activeAnswer = _useState6[0],
setActiveAnswer = _useState6[1];
var _useState7 = (0,_react_17_0_2_react.useState)(''),
_useState8 = slicedToArray_default()(_useState7, 2),
title = _useState8[0],
setTitle = _useState8[1];
var _useState9 = (0,_react_17_0_2_react.useState)(0),
_useState10 = slicedToArray_default()(_useState9, 2),
score = _useState10[0],
setScore = _useState10[1];
var _useState11 = (0,_react_17_0_2_react.useState)(false),
_useState12 = slicedToArray_default()(_useState11, 2),
isNecessary = _useState12[0],
setIsNecessary = _useState12[1];
var _useState13 = (0,_react_17_0_2_react.useState)(false),
_useState14 = slicedToArray_default()(_useState13, 2),
other = _useState14[0],
setOther = _useState14[1];
var params = (0,_umi_production_exports.useParams)();
(0,_react_17_0_2_react.useEffect)(function () {
var _editData$question, _editData$question2, _editData$question3, _editData$question4;
if (!(editData !== null && editData !== void 0 && (_editData$question = editData.question) !== null && _editData$question !== void 0 && _editData$question.question_title)) {
setQuestionChoiceList([{
disabled: false,
value: ""
}, {
disabled: false,
value: ""
}, {
disabled: false,
value: ""
}, {
disabled: false,
value: ""
}]);
setIsNecessary(false);
setTitle('');
setOther(false);
return;
}
setTitle(editData === null || editData === void 0 || (_editData$question2 = editData.question) === null || _editData$question2 === void 0 ? void 0 : _editData$question2.question_title);
setIsNecessary(!!(editData !== null && editData !== void 0 && (_editData$question3 = editData.question) !== null && _editData$question3 !== void 0 && _editData$question3.is_necessary));
setQuestionChoiceList(editData === null || editData === void 0 || (_editData$question4 = editData.question) === null || _editData$question4 === void 0 ? void 0 : _editData$question4.answers.map(function (item) {
return {
value: item.answer_text,
disabled: item.answer_text === '其他' ? true : false
};
}));
}, [editData]);
(0,_react_17_0_2_react.useImperativeHandle)(ref, function () {
return {
onSave: onSave
};
});
var onSave = /*#__PURE__*/function () {
var _ref2 = asyncToGenerator_default()( /*#__PURE__*/regeneratorRuntime_default()().mark(function _callee(status) {
var _editData$question5;
var findNotAnswerIndex, res, bodyData;
return regeneratorRuntime_default()().wrap(function _callee$(_context) {
while (1) switch (_context.prev = _context.next) {
case 0:
if (title) {
_context.next = 3;
break;
}
message/* default */.ZP.info("请您输入题目");
return _context.abrupt("return", false);
case 3:
findNotAnswerIndex = questionChoiceList.findIndex(function (item) {
return !item.value;
});
if (!(findNotAnswerIndex > -1)) {
_context.next = 7;
break;
}
message/* default */.ZP.info("\u8BF7\u5148\u8F93\u5165 ".concat(SingleEditor_tagList[findNotAnswerIndex], " \u9009\u9879\u7684\u5185\u5BB9"));
return _context.abrupt("return", false);
case 7:
bodyData = {
"question_title": title,
"question_type": 1,
"insert_id": editData.insert_id,
"is_necessary": Math.ceil(isNecessary),
"question_answers": questionChoiceList.map(function (item) {
return item.value;
})
};
if (!((_editData$question5 = editData.question) !== null && _editData$question5 !== void 0 && _editData$question5.id)) {
_context.next = 15;
break;
}
callback('edit', -1);
_context.next = 12;
return (0,service_polls/* editPollsQuestion */.IU)(objectSpread2_default()({
"pollsId": editData.question.id
}, bodyData));
case 12:
res = _context.sent;
_context.next = 18;
break;
case 15:
_context.next = 17;
return (0,service_polls/* addExerciseQuestion */.MK)(objectSpread2_default()({
"pollsId": params.categoryId
}, bodyData));
case 17:
res = _context.sent;
case 18:
if (!(res.status === 0)) {
_context.next = 23;
break;
}
message/* default */.ZP.success("保存成功");
_context.next = 22;
return dispatch({
type: "polls/editPolls",
payload: objectSpread2_default()({}, params)
});
case 22:
if (status) {
bodyData.answers = bodyData.question_answers.map(function (item) {
return {
answer_text: item
};
});
callback('addContinue', objectSpread2_default()({
type: 1,
insert_id: editData.question.id,
key: editData.key,
question_type: 1
}, bodyData));
}
case 23:
case "end":
return _context.stop();
}
}, _callee);
}));
return function onSave(_x) {
return _ref2.apply(this, arguments);
};
}();
var actionArr = [{
name: "删除",
icon: "iconfont c-light-black ml30 icon-shanchu current",
id: "del"
}, {
name: "上移",
icon: "iconfont c-green ml30 icon-xiangshangyi current",
id: "up"
}, {
name: "下移",
icon: "iconfont c-green ml30 icon-xiangxiayi current",
id: "down"
}, {
name: "添加",
icon: "iconfont c-green ml30 icon-tianjia current",
id: "add"
}, {
name: "编辑",
icon: "iconfont c-green ml30 icon-bianjidaibeijing current",
id: "edit"
}];
var actionClick = /*#__PURE__*/function () {
var _ref3 = asyncToGenerator_default()( /*#__PURE__*/regeneratorRuntime_default()().mark(function _callee3(item) {
var _editData$question7, _editData$question8;
return regeneratorRuntime_default()().wrap(function _callee3$(_context3) {
while (1) switch (_context3.prev = _context3.next) {
case 0:
_context3.t0 = item.id;
_context3.next = _context3.t0 === "del" ? 3 : _context3.t0 === "up" ? 5 : _context3.t0 === "down" ? 5 : _context3.t0 === "edit" ? 9 : _context3.t0 === "add" ? 11 : 13;
break;
case 3:
modal/* default */.Z.confirm({
centered: true,
okText: '确定',
cancelText: '取消',
title: '确认要删除这个问题吗?',
onOk: function onOk() {
return asyncToGenerator_default()( /*#__PURE__*/regeneratorRuntime_default()().mark(function _callee2() {
var _editData$question6;
return regeneratorRuntime_default()().wrap(function _callee2$(_context2) {
while (1) switch (_context2.prev = _context2.next) {
case 0:
_context2.next = 2;
return (0,service_polls/* deletePollsQuestion */.jy)({
pollsId: editData === null || editData === void 0 || (_editData$question6 = editData.question) === null || _editData$question6 === void 0 ? void 0 : _editData$question6.id
});
case 2:
dispatch({
type: "polls/editPolls",
payload: objectSpread2_default()({}, params)
});
case 3:
case "end":
return _context2.stop();
}
}, _callee2);
}))();
}
});
return _context3.abrupt("break", 13);
case 5:
_context3.next = 7;
return (0,service_polls/* pollsMoveUpDown */.wh)({
pollsId: editData === null || editData === void 0 || (_editData$question7 = editData.question) === null || _editData$question7 === void 0 ? void 0 : _editData$question7.id,
opr: item.id
});
case 7:
dispatch({
type: "polls/editPolls",
payload: objectSpread2_default()({}, params)
});
return _context3.abrupt("break", 13);
case 9:
callback('edit', editData.key);
return _context3.abrupt("break", 13);
case 11:
callback('add', {
type: 1,
key: editData.key,
insert_id: editData === null || editData === void 0 || (_editData$question8 = editData.question) === null || _editData$question8 === void 0 ? void 0 : _editData$question8.id,
question_type: 1
});
return _context3.abrupt("break", 13);
case 13:
case "end":
return _context3.stop();
}
}, _callee3);
}));
return function actionClick(_x2) {
return _ref3.apply(this, arguments);
};
}();
var showList = function showList() {
var _editData$question$an;
return /*#__PURE__*/(0,jsx_runtime.jsxs)("aside", {
children: [/*#__PURE__*/(0,jsx_runtime.jsx)("div", {
className: editormodules.questionType,
children: /*#__PURE__*/(0,jsx_runtime.jsxs)("div", {
children: [/*#__PURE__*/(0,jsx_runtime.jsxs)("span", {
className: "font16",
children: ["\u7B2C", editData.key, "\u9898"]
}), /*#__PURE__*/(0,jsx_runtime.jsx)("span", {
className: "font16 c-light-black ml10",
children: "\u5355\u9009\u9898"
})]
})
}), /*#__PURE__*/(0,jsx_runtime.jsx)("div", {
className: "mt5",
children: /*#__PURE__*/(0,jsx_runtime.jsx)(RenderHtml/* default */.Z, {
value: editData.question.question_title
})
}), /*#__PURE__*/(0,jsx_runtime.jsx)("div", {
className: editormodules.questionChoices,
children: editData === null || editData === void 0 || (_editData$question$an = editData.question.answers) === null || _editData$question$an === void 0 ? void 0 : _editData$question$an.map(function (item, index) {
return /*#__PURE__*/(0,jsx_runtime.jsxs)(row/* default */.Z, {
children: [/*#__PURE__*/(0,jsx_runtime.jsx)(col/* default */.Z, {
children: /*#__PURE__*/(0,jsx_runtime.jsx)(es_radio/* default */.ZP, {
disabled: true
}, index)
}), /*#__PURE__*/(0,jsx_runtime.jsx)(col/* default */.Z, {
flex: "1",
children: /*#__PURE__*/(0,jsx_runtime.jsx)("span", {
className: "c-black font14",
children: item.answer_text
})
})]
});
})
})]
});
};
var showEdit = function showEdit() {
return /*#__PURE__*/(0,jsx_runtime.jsxs)("aside", {
children: [/*#__PURE__*/(0,jsx_runtime.jsx)("div", {
className: editormodules.questionType,
children: /*#__PURE__*/(0,jsx_runtime.jsxs)("div", {
children: [/*#__PURE__*/(0,jsx_runtime.jsx)("span", {
className: "font16 c-blue",
children: "\u5355\u9009\u9898"
}), " ", /*#__PURE__*/(0,jsx_runtime.jsx)(es_checkbox/* default */.Z, {
checked: isNecessary ? true : false,
className: "ml10",
onChange: function onChange(e) {
return setIsNecessary(e.target.checked);
},
children: "\u5FC5\u7B54"
})]
})
}), /*#__PURE__*/(0,jsx_runtime.jsx)("p", {
className: editormodules.titleWrap,
children: /*#__PURE__*/(0,jsx_runtime.jsx)(input/* default */.Z.TextArea, {
rows: 1,
value: title,
placeholder: "\u8BF7\u8F93\u5165\u9898\u76EE",
onChange: function onChange(e) {
return setTitle(e.target.value);
}
})
}), /*#__PURE__*/(0,jsx_runtime.jsxs)("p", {
className: editormodules.titleWrap,
children: [/*#__PURE__*/(0,jsx_runtime.jsx)("span", {
className: editormodules.required,
children: "*"
}), /*#__PURE__*/(0,jsx_runtime.jsxs)("span", {
className: editormodules.title,
children: ["\u7B54\u6848\u9009\u9879\uFF1A", /*#__PURE__*/(0,jsx_runtime.jsx)("span", {
className: editormodules.colorGray,
children: "\u70B9\u51FB\u9009\u9879\u53EF\u8BBE\u7F6E\u6B63\u786E\u7B54\u6848"
})]
})]
}), questionChoiceList.map(function (item, index) {
return /*#__PURE__*/(0,jsx_runtime.jsxs)(row/* default */.Z, {
className: editormodules.choiceWrap,
gutter: [12, 12],
children: [/*#__PURE__*/(0,jsx_runtime.jsx)(col/* default */.Z, {
children: /*#__PURE__*/(0,jsx_runtime.jsx)("span", {
className: "font16",
children: "\u9009\u9879"
})
}), /*#__PURE__*/(0,jsx_runtime.jsx)(col/* default */.Z, {
className: editormodules.editorWrap,
flex: "1",
children: /*#__PURE__*/(0,jsx_runtime.jsx)(input/* default */.Z.TextArea, {
value: questionChoiceList[index]['value'],
rows: 1,
disabled: item.disabled ? true : false,
onChange: function onChange(e) {
questionChoiceList[index]['value'] = e.target.value;
setQuestionChoiceList(toConsumableArray_default()(questionChoiceList));
}
})
}), /*#__PURE__*/(0,jsx_runtime.jsx)(col/* default */.Z, {
children: index > 1 && /*#__PURE__*/(0,jsx_runtime.jsx)(tooltip/* default */.Z, {
title: "\u5220\u9664",
children: /*#__PURE__*/(0,jsx_runtime.jsx)("i", {
className: "".concat(editormodules.deleteIcon, " iconfont icon-htmal5icon19"),
onClick: function onClick() {
setQuestionChoiceList(questionChoiceList.filter(function (_, key) {
return key !== index;
}));
if (item.disabled) setOther(false);
}
})
})
})]
}, index);
}), /*#__PURE__*/(0,jsx_runtime.jsxs)(row/* default */.Z, {
gutter: [12, 12],
children: [/*#__PURE__*/(0,jsx_runtime.jsxs)(col/* default */.Z, {
flex: "1",
children: [/*#__PURE__*/(0,jsx_runtime.jsx)(es_button/* default */.ZP, {
type: "default",
onClick: function onClick() {
return setQuestionChoiceList([].concat(toConsumableArray_default()(questionChoiceList), [{
value: ''
}]));
},
children: "\u65B0\u589E\u9009\u9879"
}), !other && /*#__PURE__*/(0,jsx_runtime.jsx)(es_button/* default */.ZP, {
type: "default",
className: "ml20",
onClick: function onClick() {
setQuestionChoiceList([].concat(toConsumableArray_default()(questionChoiceList), [{
disabled: true,
value: "其它"
}]));
setOther(true);
},
children: "\u65B0\u589E\u5176\u4ED6\u9009\u9879"
})]
}), /*#__PURE__*/(0,jsx_runtime.jsxs)(col/* default */.Z, {
className: "tl",
children: [/*#__PURE__*/(0,jsx_runtime.jsx)(es_button/* default */.ZP, {
type: "default",
onClick: function onClick() {
var _editData$question9;
if ((_editData$question9 = editData.question) !== null && _editData$question9 !== void 0 && _editData$question9.id) {
callback('edit', -1);
} else {
callback('del', editData.key);
}
},
children: "\u53D6\u6D88"
}), /*#__PURE__*/(0,jsx_runtime.jsx)(es_button/* default */.ZP, {
className: "ml20",
type: "primary",
onClick: function onClick() {
return onSave();
},
children: "\u4FDD\u5B58"
}), /*#__PURE__*/(0,jsx_runtime.jsx)(es_button/* default */.ZP, {
className: "ml20",
type: "primary",
onClick: function onClick() {
return onSave(true);
},
children: "\u4FDD\u5B58\u5E76\u7EE7\u7EED"
})]
})]
})]
});
};
return /*#__PURE__*/(0,jsx_runtime.jsxs)("section", {
className: editormodules.wrap,
children: [editKey !== editData.key && showList(), editKey === editData.key && showEdit()]
});
};
/* harmony default export */ var components_SingleEditor = ((0,_umi_production_exports.connect)(function (_ref4) {
var problemset = _ref4.problemset,
loading = _ref4.loading,
globalSetting = _ref4.globalSetting;
return {
problemset: problemset,
globalSetting: globalSetting,
loading: loading.effects
};
}, null, null, {
forwardRef: true
})( /*#__PURE__*/(0,_react_17_0_2_react.forwardRef)(SingleEditor_SingleEditor)));
;// CONCATENATED MODULE: ./src/pages/Classrooms/Lists/Polls/Detail/components/PreviewPolls/components/SubjectiveEditor/index.tsx
var SubjectiveEditor_excluded = ["problemset", "globalSetting", "loading", "dispatch", "onRef", "editData", "editKey", "callback"];
var SubjectiveEditor_tagList = (/* unused pure expression or super */ null && (['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 SubjectiveEditor_SingleEditor = function SingleEditor(_ref, ref) {
var problemset = _ref.problemset,
globalSetting = _ref.globalSetting,
loading = _ref.loading,
dispatch = _ref.dispatch,
_ref$onRef = _ref.onRef,
onRef = _ref$onRef === void 0 ? function () {} : _ref$onRef,
editData = _ref.editData,
editKey = _ref.editKey,
callback = _ref.callback,
props = objectWithoutProperties_default()(_ref, SubjectiveEditor_excluded);
var _useState = (0,_react_17_0_2_react.useState)(''),
_useState2 = slicedToArray_default()(_useState, 2),
title = _useState2[0],
setTitle = _useState2[1];
var _useState3 = (0,_react_17_0_2_react.useState)(true),
_useState4 = slicedToArray_default()(_useState3, 2),
isNecessary = _useState4[0],
setIsNecessary = _useState4[1];
var params = (0,_umi_production_exports.useParams)();
(0,_react_17_0_2_react.useEffect)(function () {
var _editData$question, _editData$question2, _editData$question3;
if (!(editData !== null && editData !== void 0 && (_editData$question = editData.question) !== null && _editData$question !== void 0 && _editData$question.question_title)) {
setIsNecessary(true);
setTitle('');
return;
}
setTitle(editData === null || editData === void 0 || (_editData$question2 = editData.question) === null || _editData$question2 === void 0 ? void 0 : _editData$question2.question_title);
setIsNecessary(!!(editData !== null && editData !== void 0 && (_editData$question3 = editData.question) !== null && _editData$question3 !== void 0 && _editData$question3.is_necessary));
}, [editData]);
(0,_react_17_0_2_react.useImperativeHandle)(ref, function () {
return {
onSave: onSave
};
});
var onSave = /*#__PURE__*/function () {
var _ref2 = asyncToGenerator_default()( /*#__PURE__*/regeneratorRuntime_default()().mark(function _callee(status) {
var _editData$question4;
var res, bodyData;
return regeneratorRuntime_default()().wrap(function _callee$(_context) {
while (1) switch (_context.prev = _context.next) {
case 0:
if (title) {
_context.next = 3;
break;
}
message/* default */.ZP.info("请您输入题目");
return _context.abrupt("return", false);
case 3:
bodyData = {
"question_title": title,
"question_type": 3,
"insert_id": editData.insert_id,
"is_necessary": Math.ceil(isNecessary)
};
if (!((_editData$question4 = editData.question) !== null && _editData$question4 !== void 0 && _editData$question4.id)) {
_context.next = 10;
break;
}
_context.next = 7;
return (0,service_polls/* editPollsQuestion */.IU)(objectSpread2_default()({
"pollsId": editData.question.id
}, bodyData));
case 7:
res = _context.sent;
_context.next = 13;
break;
case 10:
_context.next = 12;
return (0,service_polls/* addExerciseQuestion */.MK)(objectSpread2_default()({
"pollsId": params.categoryId
}, bodyData));
case 12:
res = _context.sent;
case 13:
if (!(res.status === 0)) {
_context.next = 19;
break;
}
message/* default */.ZP.success("保存成功");
callback('edit', -1);
_context.next = 18;
return dispatch({
type: "polls/editPolls",
payload: objectSpread2_default()({}, params)
});
case 18:
if (status) {
callback('addContinue', objectSpread2_default()({
type: 3,
insert_id: editData.question.id,
key: editData.key,
question_type: 3
}, bodyData));
}
case 19:
case "end":
return _context.stop();
}
}, _callee);
}));
return function onSave(_x) {
return _ref2.apply(this, arguments);
};
}();
var actionArr = [{
name: "删除",
icon: "iconfont c-light-black ml30 icon-shanchu current",
id: "del"
}, {
name: "上移",
icon: "iconfont c-green ml30 icon-xiangshangyi current",
id: "up"
}, {
name: "下移",
icon: "iconfont c-green ml30 icon-xiangxiayi current",
id: "down"
}, {
name: "添加",
icon: "iconfont c-green ml30 icon-tianjia current",
id: "add"
}, {
name: "编辑",
icon: "iconfont c-green ml30 icon-bianjidaibeijing current",
id: "edit"
}];
var actionClick = /*#__PURE__*/function () {
var _ref3 = asyncToGenerator_default()( /*#__PURE__*/regeneratorRuntime_default()().mark(function _callee3(item) {
var _editData$question6, _editData$question7;
return regeneratorRuntime_default()().wrap(function _callee3$(_context3) {
while (1) switch (_context3.prev = _context3.next) {
case 0:
_context3.t0 = item.id;
_context3.next = _context3.t0 === "del" ? 3 : _context3.t0 === "up" ? 5 : _context3.t0 === "down" ? 5 : _context3.t0 === "edit" ? 9 : _context3.t0 === "add" ? 11 : 13;
break;
case 3:
modal/* default */.Z.confirm({
centered: true,
okText: '确定',
cancelText: '取消',
title: '确认要删除这个问题吗?',
onOk: function onOk() {
return asyncToGenerator_default()( /*#__PURE__*/regeneratorRuntime_default()().mark(function _callee2() {
var _editData$question5;
return regeneratorRuntime_default()().wrap(function _callee2$(_context2) {
while (1) switch (_context2.prev = _context2.next) {
case 0:
_context2.next = 2;
return (0,service_polls/* deletePollsQuestion */.jy)({
pollsId: editData === null || editData === void 0 || (_editData$question5 = editData.question) === null || _editData$question5 === void 0 ? void 0 : _editData$question5.id
});
case 2:
dispatch({
type: "polls/editPolls",
payload: objectSpread2_default()({}, params)
});
case 3:
case "end":
return _context2.stop();
}
}, _callee2);
}))();
}
});
return _context3.abrupt("break", 13);
case 5:
_context3.next = 7;
return (0,service_polls/* pollsMoveUpDown */.wh)({
pollsId: editData === null || editData === void 0 || (_editData$question6 = editData.question) === null || _editData$question6 === void 0 ? void 0 : _editData$question6.id,
opr: item.id
});
case 7:
dispatch({
type: "polls/editPolls",
payload: objectSpread2_default()({}, params)
});
return _context3.abrupt("break", 13);
case 9:
callback('edit', editData.key);
return _context3.abrupt("break", 13);
case 11:
callback('add', {
type: 3,
key: editData.key,
insert_id: editData === null || editData === void 0 || (_editData$question7 = editData.question) === null || _editData$question7 === void 0 ? void 0 : _editData$question7.id,
question_type: 3
});
return _context3.abrupt("break", 13);
case 13:
case "end":
return _context3.stop();
}
}, _callee3);
}));
return function actionClick(_x2) {
return _ref3.apply(this, arguments);
};
}();
var showList = function showList() {
return /*#__PURE__*/(0,jsx_runtime.jsxs)("aside", {
children: [/*#__PURE__*/(0,jsx_runtime.jsx)("div", {
className: editormodules.questionType,
children: /*#__PURE__*/(0,jsx_runtime.jsxs)("div", {
children: [/*#__PURE__*/(0,jsx_runtime.jsxs)("span", {
className: "font16",
children: ["\u7B2C", editData.key, "\u9898"]
}), /*#__PURE__*/(0,jsx_runtime.jsx)("span", {
className: "font16 c-light-black ml10 mr20",
children: "\u4E3B\u89C2\u9898"
}), isNecessary && /*#__PURE__*/(0,jsx_runtime.jsx)("span", {
className: "tag-grey-eae",
children: "\u5FC5\u7B54"
})]
})
}), /*#__PURE__*/(0,jsx_runtime.jsx)("div", {
className: "mt5",
children: /*#__PURE__*/(0,jsx_runtime.jsx)(RenderHtml/* default */.Z, {
value: editData.question.question_title
})
}), /*#__PURE__*/(0,jsx_runtime.jsx)("div", {
className: editormodules.questionChoices,
children: /*#__PURE__*/(0,jsx_runtime.jsx)(input/* default */.Z.TextArea, {
rows: 5,
disabled: true
})
})]
});
};
var showEdit = function showEdit() {
return /*#__PURE__*/(0,jsx_runtime.jsxs)("aside", {
children: [/*#__PURE__*/(0,jsx_runtime.jsx)("div", {
className: editormodules.questionType,
children: /*#__PURE__*/(0,jsx_runtime.jsxs)("div", {
children: [/*#__PURE__*/(0,jsx_runtime.jsx)("span", {
className: "font16 c-blue",
children: "\u4E3B\u89C2\u9898"
}), " ", /*#__PURE__*/(0,jsx_runtime.jsx)(es_checkbox/* default */.Z, {
checked: isNecessary ? true : false,
className: "ml10",
onChange: function onChange(e) {
return setIsNecessary(e.target.checked);
},
children: "\u5FC5\u7B54"
})]
})
}), /*#__PURE__*/(0,jsx_runtime.jsx)("p", {
className: editormodules.titleWrap,
children: /*#__PURE__*/(0,jsx_runtime.jsx)(input/* default */.Z.TextArea, {
rows: 1,
value: title,
placeholder: "\u8BF7\u8F93\u5165\u9898\u76EE",
onChange: function onChange(e) {
return setTitle(e.target.value);
}
})
}), /*#__PURE__*/(0,jsx_runtime.jsxs)("p", {
className: editormodules.titleWrap,
children: [/*#__PURE__*/(0,jsx_runtime.jsx)("span", {
className: editormodules.required,
children: "*"
}), /*#__PURE__*/(0,jsx_runtime.jsxs)("span", {
className: editormodules.title,
children: ["\u7B54\u6848\u9009\u9879\uFF1A", /*#__PURE__*/(0,jsx_runtime.jsx)("span", {
className: editormodules.colorGray,
children: "\u70B9\u51FB\u9009\u9879\u53EF\u8BBE\u7F6E\u6B63\u786E\u7B54\u6848"
})]
})]
}), /*#__PURE__*/(0,jsx_runtime.jsxs)(row/* default */.Z, {
gutter: [12, 12],
children: [/*#__PURE__*/(0,jsx_runtime.jsx)(col/* default */.Z, {
flex: "1"
}), /*#__PURE__*/(0,jsx_runtime.jsxs)(col/* default */.Z, {
className: "tl",
children: [/*#__PURE__*/(0,jsx_runtime.jsx)(es_button/* default */.ZP, {
type: "default",
onClick: function onClick() {
var _editData$question8;
if ((_editData$question8 = editData.question) !== null && _editData$question8 !== void 0 && _editData$question8.id) {
callback('edit', -1);
} else {
callback('del', editData.key);
}
},
children: "\u53D6\u6D88"
}), /*#__PURE__*/(0,jsx_runtime.jsx)(es_button/* default */.ZP, {
className: "ml20",
type: "primary",
onClick: function onClick() {
return onSave();
},
children: "\u4FDD\u5B58"
}), /*#__PURE__*/(0,jsx_runtime.jsx)(es_button/* default */.ZP, {
className: "ml20",
type: "primary",
onClick: function onClick() {
return onSave(true);
},
children: "\u4FDD\u5B58\u5E76\u7EE7\u7EED"
})]
})]
})]
});
};
return /*#__PURE__*/(0,jsx_runtime.jsxs)("section", {
className: editormodules.wrap,
children: [editKey !== editData.key && showList(), editKey === editData.key && showEdit()]
});
};
/* harmony default export */ var SubjectiveEditor = ((0,_umi_production_exports.connect)(function (_ref4) {
var problemset = _ref4.problemset,
loading = _ref4.loading,
globalSetting = _ref4.globalSetting;
return {
problemset: problemset,
globalSetting: globalSetting,
loading: loading.effects
};
}, null, null, {
forwardRef: true
})( /*#__PURE__*/(0,_react_17_0_2_react.forwardRef)(SubjectiveEditor_SingleEditor)));
;// CONCATENATED MODULE: ./src/pages/Classrooms/Lists/Polls/Detail/components/PreviewPolls/index.tsx
var PreviewPolls_questionType = {
1: "单选题",
2: "多选题",
3: "主观题"
};
var PollsPreviews = function PollsPreviews(_ref) {
var _statisticsList$quest;
var polls = _ref.polls,
loading = _ref.loading,
dispatch = _ref.dispatch;
var params = (0,_umi_production_exports.useParams)();
var statisticsList = polls.statisticsList,
commonHeader = polls.commonHeader;
var _useState = (0,_react_17_0_2_react.useState)({
page: 1,
pre_size: 10
}),
_useState2 = slicedToArray_default()(_useState, 1),
queryPreview = _useState2[0];
var questions = statisticsList.questions,
questionsInfo = statisticsList.questionsInfo,
question_types = statisticsList.question_types,
course = statisticsList.course;
var _Form$useForm = es_form/* default */.Z.useForm(),
_Form$useForm2 = slicedToArray_default()(_Form$useForm, 1),
form = _Form$useForm2[0];
var renderQuestion = function renderQuestion() {
return questions === null || questions === void 0 ? void 0 : questions.map(function (v, k) {
var _v$question, _v$question2;
v.key = v === null || v === void 0 || (_v$question = v.question) === null || _v$question === void 0 ? void 0 : _v$question.question_number;
v.len = questions.length;
if (v.question.question_type === 1) {
return /*#__PURE__*/(0,jsx_runtime.jsxs)("aside", {
children: [/*#__PURE__*/(0,jsx_runtime.jsx)(components_SingleEditor, {
editData: v
}), /*#__PURE__*/(0,jsx_runtime.jsx)(divider/* default */.Z, {})]
});
}
if (v.question.question_type === 2) {
return /*#__PURE__*/(0,jsx_runtime.jsxs)("aside", {
children: [/*#__PURE__*/(0,jsx_runtime.jsx)(MultipleEditor, {
editData: v
}), /*#__PURE__*/(0,jsx_runtime.jsx)(divider/* default */.Z, {})]
});
}
if (((_v$question2 = v.question) === null || _v$question2 === void 0 ? void 0 : _v$question2.question_type) === 3) {
return /*#__PURE__*/(0,jsx_runtime.jsxs)("aside", {
children: [/*#__PURE__*/(0,jsx_runtime.jsx)(SubjectiveEditor, {
editData: v
}), /*#__PURE__*/(0,jsx_runtime.jsx)(divider/* default */.Z, {})]
});
}
});
};
(0,_react_17_0_2_react.useEffect)(function () {
getData();
}, [params.coursesId]);
var getData = function getData() {
dispatch({
type: 'polls/getPollsStatistics',
payload: objectSpread2_default()(objectSpread2_default()({}, params), queryPreview)
});
};
return /*#__PURE__*/(0,jsx_runtime.jsx)(skeleton/* default */.Z, {
loading: loading['polls/getPollsStatistics'],
children: /*#__PURE__*/(0,jsx_runtime.jsxs)("section", {
className: "minH500 mb50",
children: [(question_types === null || question_types === void 0 ? void 0 : question_types.q_counts) === 0 && /*#__PURE__*/(0,jsx_runtime.jsx)(NoData/* default */.Z, {}), (commonHeader === null || commonHeader === void 0 ? void 0 : commonHeader.polls_description) && /*#__PURE__*/(0,jsx_runtime.jsx)("aside", {
className: "bg-white pl30 pr30 pt20 pb20",
children: /*#__PURE__*/(0,jsx_runtime.jsx)(RenderHtml/* default */.Z, {
value: commonHeader === null || commonHeader === void 0 ? void 0 : commonHeader.polls_description
})
}), (question_types === null || question_types === void 0 ? void 0 : question_types.q_counts) > 0 && /*#__PURE__*/(0,jsx_runtime.jsxs)("div", {
style: {
padding: "20px",
background: "#Fafafa",
fontSize: 14
},
children: [/*#__PURE__*/(0,jsx_runtime.jsxs)("span", {
children: [" \u5408\u8BA1\uFF1A", question_types === null || question_types === void 0 ? void 0 : question_types.q_counts, " \u9898"]
}), (question_types === null || question_types === void 0 ? void 0 : question_types.q_mains) > 0 && /*#__PURE__*/(0,jsx_runtime.jsxs)("span", {
className: "ml10",
children: ["\u4E3B\u89C2\u9898\uFF1A", question_types.q_mains]
}), (question_types === null || question_types === void 0 ? void 0 : question_types.q_singles) > 0 && /*#__PURE__*/(0,jsx_runtime.jsxs)("span", {
className: "ml10",
children: ["\u5355\u9009\u9898\uFF1A", question_types.q_singles]
}), (question_types === null || question_types === void 0 ? void 0 : question_types.q_doubles) > 0 && /*#__PURE__*/(0,jsx_runtime.jsxs)("span", {
className: "ml10",
children: ["\u591A\u9009\u9898\uFF1A", question_types.q_doubles]
})]
}), /*#__PURE__*/(0,jsx_runtime.jsx)("aside", {
className: "bg-white pl30 pr30 inline-block w100",
children: renderQuestion()
}), /*#__PURE__*/(0,jsx_runtime.jsx)("div", {
className: "mt30 tc",
children: /*#__PURE__*/(0,jsx_runtime.jsx)(pagination/* default */.Z, {
hideOnSinglePage: true,
total: statisticsList === null || statisticsList === void 0 || (_statisticsList$quest = statisticsList.question_types) === null || _statisticsList$quest === void 0 ? void 0 : _statisticsList$quest.q_counts,
current: queryPreview.page || 1,
onChange: function onChange(page) {
queryPreview.page = page;
getData();
}
})
})]
})
});
};
/* harmony default export */ var PreviewPolls = ((0,_umi_production_exports.connect)(function (_ref2) {
var polls = _ref2.polls,
loading = _ref2.loading;
return {
polls: polls,
loading: loading.effects
};
})(PollsPreviews));
;// CONCATENATED MODULE: ./src/pages/Classrooms/Lists/Polls/Detail/index.less?modules
// extracted by mini-css-extract-plugin
/* harmony default export */ var Detailmodules = ({"flex_box_center":"flex_box_center___KocrS","flex_space_between":"flex_space_between___tbwbg","flex_box_vertical_center":"flex_box_vertical_center___Boklb","flex_box_center_end":"flex_box_center_end___yLkeS","flex_box_column":"flex_box_column___yoUa3","title":"title___ByTX2","export":"export___XUBRC","bg":"bg___r_XgQ","tabs":"tabs___awxWj","export_type_modal":"export_type_modal___o8Y6x","export_type_modal_con":"export_type_modal_con___zVHRj","type_item":"type_item___PhJhz","img_warp":"img_warp___dtWfk","img_warp_active":"img_warp_active___YxM4n"});
// EXTERNAL MODULE: ./src/pages/Paperlibrary/See/exportPDF.ts
var exportPDF = __webpack_require__(62034);
;// CONCATENATED MODULE: ./src/pages/Classrooms/Lists/Polls/Detail/index.tsx
// import Publish from './components/Publish';
var PollDetail = function PollDetail(_ref) {
var _userInfo$course, _commonHeader$user_pe, _commonHeader$user_pe2, _commonHeader$user_pe3, _commonHeader$user_pe4;
var polls = _ref.polls,
globalSetting = _ref.globalSetting,
loading = _ref.loading,
dispatch = _ref.dispatch,
user = _ref.user;
var params = (0,_umi_production_exports.useParams)();
var location = (0,_umi_production_exports.useLocation)();
var _useSearchParams = (0,_umi_production_exports.useSearchParams)(),
_useSearchParams2 = slicedToArray_default()(_useSearchParams, 1),
searchParams = _useSearchParams2[0];
// checkbox checked储存
var _useState = (0,_react_17_0_2_react.useState)([]),
_useState2 = slicedToArray_default()(_useState, 2),
selectArrs = _useState2[0],
setSelectArrs = _useState2[1];
var _useState3 = (0,_react_17_0_2_react.useState)(searchParams.get("tabs") || 0),
_useState4 = slicedToArray_default()(_useState3, 2),
activeTabs = _useState4[0],
setActiveTabs = _useState4[1];
var _useState5 = (0,_react_17_0_2_react.useState)(false),
_useState6 = slicedToArray_default()(_useState5, 2),
exportTypeModal = _useState6[0],
setExportTypeModal = _useState6[1];
var _useState7 = (0,_react_17_0_2_react.useState)(""),
_useState8 = slicedToArray_default()(_useState7, 2),
exportType = _useState8[0],
setExportType = _useState8[1];
var paperDomRef = (0,_react_17_0_2_react.useRef)();
var pollsList = polls.pollsList,
commonHeader = polls.commonHeader;
var userInfo = user.userInfo;
var courseModules;
params['category'] = searchParams.get("category_id");
(0,_react_17_0_2_react.useEffect)(function () {
dispatch({
type: 'polls/getPollsList',
payload: objectSpread2_default()({}, params)
});
dispatch({
type: 'polls/getCommonHeader',
payload: objectSpread2_default()({}, params)
});
}, [params.coursesId]);
var tabsArr = [{
name: '答题列表',
id: 0,
compontent: /*#__PURE__*/(0,jsx_runtime.jsx)(components_WorkList, {})
}, {
name: '统计结果',
id: 1,
compontent: /*#__PURE__*/(0,jsx_runtime.jsx)(StatisticsResult, {})
}, {
name: '问卷预览',
id: 2,
compontent: /*#__PURE__*/(0,jsx_runtime.jsx)(PreviewPolls, {})
}, {
name: '设置',
id: 3,
compontent: /*#__PURE__*/(0,jsx_runtime.jsx)(ConfigWorks, {})
}].filter(function (item) {
if ((0,authority/* isStudent */.dE)()) {
return item.name !== '统计结果' && item.name !== '问卷预览';
}
return true;
});
return /*#__PURE__*/(0,jsx_runtime.jsxs)("section", {
className: Detailmodules.bg,
children: [/*#__PURE__*/(0,jsx_runtime.jsxs)("div", {
className: "edu-container",
children: [userInfo.username && /*#__PURE__*/(0,jsx_runtime.jsxs)("section", {
className: "animated fadeIn",
children: [/*#__PURE__*/(0,jsx_runtime.jsx)("aside", {
className: "mt10",
children: /*#__PURE__*/(0,jsx_runtime.jsxs)(breadcrumb/* default */.Z, {
separator: ">",
children: [/*#__PURE__*/(0,jsx_runtime.jsx)(breadcrumb/* default */.Z.Item, {
children: /*#__PURE__*/(0,jsx_runtime.jsx)(_umi_production_exports.Link, {
to: "/classrooms/".concat(params.coursesId, "/poll"),
children: userInfo === null || userInfo === void 0 || (_userInfo$course = userInfo.course) === null || _userInfo$course === void 0 ? void 0 : _userInfo$course.course_name
})
}), /*#__PURE__*/(0,jsx_runtime.jsx)(breadcrumb/* default */.Z.Item, {
children: /*#__PURE__*/(0,jsx_runtime.jsx)(_umi_production_exports.Link, {
to: "/classrooms/".concat(params.coursesId, "/poll"),
children: commonHeader === null || commonHeader === void 0 || (_commonHeader$user_pe = commonHeader.user_permission) === null || _commonHeader$user_pe === void 0 ? void 0 : _commonHeader$user_pe.left_banner_name
})
}), /*#__PURE__*/(0,jsx_runtime.jsx)(breadcrumb/* default */.Z.Item, {
children: "\u95EE\u5377\u8BE6\u60C5"
})]
})
}), /*#__PURE__*/(0,jsx_runtime.jsxs)("aside", {
className: [Detailmodules.title, 'mt20'].join(' '),
children: [/*#__PURE__*/(0,jsx_runtime.jsx)(_umi_production_exports.Link, {
to: "/classrooms/".concat(params.coursesId, "/poll")
}), /*#__PURE__*/(0,jsx_runtime.jsx)("strong", {
className: "font20 ml5",
children: commonHeader.polls_name
}), /*#__PURE__*/(0,jsx_runtime.jsx)(util/* StatusClassroomsTags */.VV, {
status: [util/* PollsStatus */.L4[commonHeader.polls_status]]
})]
})]
}), /*#__PURE__*/(0,jsx_runtime.jsxs)("aside", {
className: "mt30 mb30 relative ",
children: [(0,authority/* isStudent */.dE)() && /*#__PURE__*/(0,jsx_runtime.jsx)("div", {
className: Detailmodules["export"],
children: /*#__PURE__*/(0,jsx_runtime.jsxs)(_umi_production_exports.Link, {
target: "_blank",
to: "/classrooms/".concat(params.coursesId, "/poll/").concat(params.categoryId, "/users/").concat(userInfo.login),
children: [(commonHeader === null || commonHeader === void 0 || (_commonHeader$user_pe2 = commonHeader.user_permission) === null || _commonHeader$user_pe2 === void 0 ? void 0 : _commonHeader$user_pe2.current_status) === 0 && "继续答题", (commonHeader === null || commonHeader === void 0 || (_commonHeader$user_pe3 = commonHeader.user_permission) === null || _commonHeader$user_pe3 === void 0 ? void 0 : _commonHeader$user_pe3.current_status) === 1 && "查看答题", (commonHeader === null || commonHeader === void 0 || (_commonHeader$user_pe4 = commonHeader.user_permission) === null || _commonHeader$user_pe4 === void 0 ? void 0 : _commonHeader$user_pe4.current_status) === 2 && "开始答题"]
})
}), (0,authority/* isAdmin */.GJ)() && /*#__PURE__*/(0,jsx_runtime.jsxs)("div", {
className: Detailmodules["export"],
children: [commonHeader.polls_status <= 1 && /*#__PURE__*/(0,jsx_runtime.jsx)(_umi_production_exports.Link, {
style: {
color: '#0152d9'
},
to: "/classrooms/".concat(params.coursesId, "/poll/").concat(params.categoryId, "/edit"),
children: "\u7F16\u8F91\u95EE\u5377"
}), commonHeader.polls_status === 1 && /*#__PURE__*/(0,jsx_runtime.jsx)("a", {
style: {
color: '#0152d9'
},
onClick: function onClick(e) {
e.preventDefault();
dispatch({
type: 'polls/setActionTabs',
payload: {
key: '立即发布',
params: params,
types: 2,
selectArrs: [params.categoryId]
}
});
},
children: "\u7ACB\u5373\u53D1\u5E03"
}), commonHeader.polls_status === 2 && /*#__PURE__*/(0,jsx_runtime.jsx)("a", {
style: {
color: '#0152d9'
},
onClick: function onClick(e) {
e.preventDefault();
dispatch({
type: 'polls/setActionTabs',
payload: {
key: '立即截止',
params: params,
selectArrs: [params.categoryId]
}
});
},
children: "\u7ACB\u5373\u622A\u6B62"
}), activeTabs == 2 && /*#__PURE__*/(0,jsx_runtime.jsx)("span", {
className: "c-blue ml30 current",
onClick: function onClick() {
setExportType('');
setExportTypeModal(true);
},
children: "\u5BFC\u51FA\u95EE\u5377"
}), /*#__PURE__*/(0,jsx_runtime.jsx)("span", {
className: "c-blue ml30 current",
onClick: function onClick() {
return (0,utils_export/* ExportPollsScores */.sA)(objectSpread2_default()({}, params));
},
children: "\u5BFC\u51FA\u7EDF\u8BA1"
})]
}), /*#__PURE__*/(0,jsx_runtime.jsx)(tabs/* default */.Z, {
defaultActiveKey: activeTabs,
className: Detailmodules.tabs,
onChange: function onChange(key) {
setActiveTabs(key);
},
children: tabsArr.map(function (v, k) {
return /*#__PURE__*/(0,jsx_runtime.jsx)(tabs/* default */.Z.TabPane, {
tab: v.name
}, v.id);
})
}), tabsArr.map(function (item) {
if (item.id == activeTabs) return /*#__PURE__*/(0,jsx_runtime.jsx)("div", {
ref: paperDomRef,
children: item.compontent
});
})]
})]
}), /*#__PURE__*/(0,jsx_runtime.jsx)(Publish/* default */.Z, {}), /*#__PURE__*/(0,jsx_runtime.jsx)(EndGroup, {}), /*#__PURE__*/(0,jsx_runtime.jsx)(modal/* default */.Z, {
width: 450,
title: "\u8BF7\u9009\u62E9\u9700\u8981\u5BFC\u51FA\u7684\u683C\u5F0F",
open: exportTypeModal,
onCancel: function onCancel() {
return setExportTypeModal(false);
},
onOk: /*#__PURE__*/asyncToGenerator_default()( /*#__PURE__*/regeneratorRuntime_default()().mark(function _callee() {
return regeneratorRuntime_default()().wrap(function _callee$(_context) {
while (1) switch (_context.prev = _context.next) {
case 0:
if (!(exportType == '')) {
_context.next = 5;
break;
}
message/* default */.ZP.info('请选择一种导出格式');
return _context.abrupt("return");
case 5:
if (!(exportType == 'pdf')) {
_context.next = 10;
break;
}
_context.next = 8;
return (0,exportPDF/* exportPDF */.F)(paperDomRef.current.children, '导出问卷');
case 8:
_context.next = 11;
break;
case 10:
if (exportType == 'word') {
(0,utils_export/* exportCommitResultWord */.YO)({
id: params === null || params === void 0 ? void 0 : params.categoryId,
middle_export: 1,
export_type: 0
});
}
case 11:
setExportTypeModal(false);
case 12:
case "end":
return _context.stop();
}
}, _callee);
})),
children: /*#__PURE__*/(0,jsx_runtime.jsx)("div", {
className: Detailmodules.export_type_modal,
children: /*#__PURE__*/(0,jsx_runtime.jsxs)("div", {
className: Detailmodules.export_type_modal_con,
children: [/*#__PURE__*/(0,jsx_runtime.jsxs)("div", {
className: Detailmodules.type_item,
children: [/*#__PURE__*/(0,jsx_runtime.jsx)("div", {
className: "".concat(Detailmodules.img_warp, " ").concat(exportType == 'pdf' ? Detailmodules.img_warp_active : ''),
onClick: function onClick() {
return setExportType('pdf');
},
children: /*#__PURE__*/(0,jsx_runtime.jsx)("img", {
src: __webpack_require__(/*! @/assets/images/file_type/pdf_img.png */ 45614),
width: 70,
height: 70
})
}), "pdf\u683C\u5F0F"]
}), /*#__PURE__*/(0,jsx_runtime.jsxs)("div", {
className: Detailmodules.type_item,
children: [/*#__PURE__*/(0,jsx_runtime.jsx)("div", {
className: "".concat(Detailmodules.img_warp, " ").concat(exportType == 'word' ? Detailmodules.img_warp_active : ''),
onClick: function onClick() {
return setExportType('word');
},
children: /*#__PURE__*/(0,jsx_runtime.jsx)("img", {
src: __webpack_require__(/*! @/assets/images/file_type/word_img.png */ 38347),
width: 70,
height: 70
})
}), "word\u683C\u5F0F"]
})]
})
})
})]
});
};
/* harmony default export */ var Detail = ((0,_umi_production_exports.connect)(function (_ref3) {
var polls = _ref3.polls,
loading = _ref3.loading,
user = _ref3.user,
globalSetting = _ref3.globalSetting;
return {
polls: polls,
globalSetting: globalSetting,
user: user,
loading: loading.effects
};
})(PollDetail));
/***/ }),
/***/ 39239:
/*!*****************************************************************!*\
!*** ./src/pages/Classrooms/Lists/Polls/components/Publish.tsx ***!
\*****************************************************************/
/***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) {
"use strict";
/* harmony import */ var _root_workspace_ppte5yg23_local_v9_test4_node_modules_babel_runtime_7_23_6_babel_runtime_helpers_objectSpread2_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./node_modules/_@babel_runtime@7.23.6@@babel/runtime/helpers/objectSpread2.js */ 82242);
/* harmony import */ var _root_workspace_ppte5yg23_local_v9_test4_node_modules_babel_runtime_7_23_6_babel_runtime_helpers_objectSpread2_js__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_root_workspace_ppte5yg23_local_v9_test4_node_modules_babel_runtime_7_23_6_babel_runtime_helpers_objectSpread2_js__WEBPACK_IMPORTED_MODULE_0__);
/* harmony import */ var _root_workspace_ppte5yg23_local_v9_test4_node_modules_babel_runtime_7_23_6_babel_runtime_helpers_regeneratorRuntime_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./node_modules/_@babel_runtime@7.23.6@@babel/runtime/helpers/regeneratorRuntime.js */ 7557);
/* harmony import */ var _root_workspace_ppte5yg23_local_v9_test4_node_modules_babel_runtime_7_23_6_babel_runtime_helpers_regeneratorRuntime_js__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_root_workspace_ppte5yg23_local_v9_test4_node_modules_babel_runtime_7_23_6_babel_runtime_helpers_regeneratorRuntime_js__WEBPACK_IMPORTED_MODULE_1__);
/* harmony import */ var _root_workspace_ppte5yg23_local_v9_test4_node_modules_babel_runtime_7_23_6_babel_runtime_helpers_defineProperty_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./node_modules/_@babel_runtime@7.23.6@@babel/runtime/helpers/defineProperty.js */ 85573);
/* harmony import */ var _root_workspace_ppte5yg23_local_v9_test4_node_modules_babel_runtime_7_23_6_babel_runtime_helpers_defineProperty_js__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(_root_workspace_ppte5yg23_local_v9_test4_node_modules_babel_runtime_7_23_6_babel_runtime_helpers_defineProperty_js__WEBPACK_IMPORTED_MODULE_2__);
/* harmony import */ var _root_workspace_ppte5yg23_local_v9_test4_node_modules_babel_runtime_7_23_6_babel_runtime_helpers_toConsumableArray_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./node_modules/_@babel_runtime@7.23.6@@babel/runtime/helpers/toConsumableArray.js */ 37205);
/* harmony import */ var _root_workspace_ppte5yg23_local_v9_test4_node_modules_babel_runtime_7_23_6_babel_runtime_helpers_toConsumableArray_js__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__webpack_require__.n(_root_workspace_ppte5yg23_local_v9_test4_node_modules_babel_runtime_7_23_6_babel_runtime_helpers_toConsumableArray_js__WEBPACK_IMPORTED_MODULE_3__);
/* harmony import */ var _root_workspace_ppte5yg23_local_v9_test4_node_modules_babel_runtime_7_23_6_babel_runtime_helpers_asyncToGenerator_js__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./node_modules/_@babel_runtime@7.23.6@@babel/runtime/helpers/asyncToGenerator.js */ 41498);
/* harmony import */ var _root_workspace_ppte5yg23_local_v9_test4_node_modules_babel_runtime_7_23_6_babel_runtime_helpers_asyncToGenerator_js__WEBPACK_IMPORTED_MODULE_4___default = /*#__PURE__*/__webpack_require__.n(_root_workspace_ppte5yg23_local_v9_test4_node_modules_babel_runtime_7_23_6_babel_runtime_helpers_asyncToGenerator_js__WEBPACK_IMPORTED_MODULE_4__);
/* harmony import */ var _root_workspace_ppte5yg23_local_v9_test4_node_modules_babel_runtime_7_23_6_babel_runtime_helpers_slicedToArray_js__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ./node_modules/_@babel_runtime@7.23.6@@babel/runtime/helpers/slicedToArray.js */ 79800);
/* harmony import */ var _root_workspace_ppte5yg23_local_v9_test4_node_modules_babel_runtime_7_23_6_babel_runtime_helpers_slicedToArray_js__WEBPACK_IMPORTED_MODULE_5___default = /*#__PURE__*/__webpack_require__.n(_root_workspace_ppte5yg23_local_v9_test4_node_modules_babel_runtime_7_23_6_babel_runtime_helpers_slicedToArray_js__WEBPACK_IMPORTED_MODULE_5__);
/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! react */ 59301);
/* harmony import */ var antd__WEBPACK_IMPORTED_MODULE_14__ = __webpack_require__(/*! antd */ 78241);
/* harmony import */ var antd__WEBPACK_IMPORTED_MODULE_15__ = __webpack_require__(/*! antd */ 8591);
/* harmony import */ var antd__WEBPACK_IMPORTED_MODULE_16__ = __webpack_require__(/*! antd */ 43418);
/* harmony import */ var antd__WEBPACK_IMPORTED_MODULE_17__ = __webpack_require__(/*! antd */ 95237);
/* harmony import */ var antd__WEBPACK_IMPORTED_MODULE_18__ = __webpack_require__(/*! antd */ 43604);
/* harmony import */ var antd__WEBPACK_IMPORTED_MODULE_19__ = __webpack_require__(/*! antd */ 30518);
/* harmony import */ var antd__WEBPACK_IMPORTED_MODULE_20__ = __webpack_require__(/*! antd */ 24905);
/* harmony import */ var antd__WEBPACK_IMPORTED_MODULE_21__ = __webpack_require__(/*! antd */ 71418);
/* harmony import */ var moment__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! moment */ 61186);
/* harmony import */ var moment__WEBPACK_IMPORTED_MODULE_7___default = /*#__PURE__*/__webpack_require__.n(moment__WEBPACK_IMPORTED_MODULE_7__);
/* harmony import */ var _utils_fetch__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! @/utils/fetch */ 49105);
/* harmony import */ var react_infinite_scroller__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! react-infinite-scroller */ 26724);
/* harmony import */ var react_infinite_scroller__WEBPACK_IMPORTED_MODULE_9___default = /*#__PURE__*/__webpack_require__.n(react_infinite_scroller__WEBPACK_IMPORTED_MODULE_9__);
/* harmony import */ var _utils_util__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(/*! @/utils/util */ 27876);
/* harmony import */ var umi__WEBPACK_IMPORTED_MODULE_11__ = __webpack_require__(/*! umi */ 80608);
/* harmony import */ var _service_polls__WEBPACK_IMPORTED_MODULE_12__ = __webpack_require__(/*! @/service/polls */ 63549);
/* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_13__ = __webpack_require__(/*! react/jsx-runtime */ 37712);
var PublishShixun = function PublishShixun(_ref) {
var polls = _ref.polls,
dispatch = _ref.dispatch;
var params = (0,umi__WEBPACK_IMPORTED_MODULE_11__.useParams)();
var _Form$useForm = antd__WEBPACK_IMPORTED_MODULE_14__/* ["default"] */ .Z.useForm(),
_Form$useForm2 = _root_workspace_ppte5yg23_local_v9_test4_node_modules_babel_runtime_7_23_6_babel_runtime_helpers_slicedToArray_js__WEBPACK_IMPORTED_MODULE_5___default()(_Form$useForm, 1),
form = _Form$useForm2[0];
var _useState = (0,react__WEBPACK_IMPORTED_MODULE_6__.useState)(1),
_useState2 = _root_workspace_ppte5yg23_local_v9_test4_node_modules_babel_runtime_7_23_6_babel_runtime_helpers_slicedToArray_js__WEBPACK_IMPORTED_MODULE_5___default()(_useState, 2),
page = _useState2[0],
setPage = _useState2[1];
var _useState3 = (0,react__WEBPACK_IMPORTED_MODULE_6__.useState)([]),
_useState4 = _root_workspace_ppte5yg23_local_v9_test4_node_modules_babel_runtime_7_23_6_babel_runtime_helpers_slicedToArray_js__WEBPACK_IMPORTED_MODULE_5___default()(_useState3, 2),
list = _useState4[0],
setList = _useState4[1];
var _useState5 = (0,react__WEBPACK_IMPORTED_MODULE_6__.useState)(0),
_useState6 = _root_workspace_ppte5yg23_local_v9_test4_node_modules_babel_runtime_7_23_6_babel_runtime_helpers_slicedToArray_js__WEBPACK_IMPORTED_MODULE_5___default()(_useState5, 2),
count = _useState6[0],
setCount = _useState6[1];
var _useState7 = (0,react__WEBPACK_IMPORTED_MODULE_6__.useState)(20),
_useState8 = _root_workspace_ppte5yg23_local_v9_test4_node_modules_babel_runtime_7_23_6_babel_runtime_helpers_slicedToArray_js__WEBPACK_IMPORTED_MODULE_5___default()(_useState7, 2),
limit = _useState8[0],
setLimit = _useState8[1];
var _useState9 = (0,react__WEBPACK_IMPORTED_MODULE_6__.useState)(true),
_useState10 = _root_workspace_ppte5yg23_local_v9_test4_node_modules_babel_runtime_7_23_6_babel_runtime_helpers_slicedToArray_js__WEBPACK_IMPORTED_MODULE_5___default()(_useState9, 2),
loading = _useState10[0],
setLoading = _useState10[1];
params['id'] = params.coursesId;
(0,react__WEBPACK_IMPORTED_MODULE_6__.useEffect)(function () {
if (polls.actionTabs.key === '立即发布') {
getData();
}
}, [polls.actionTabs.key]);
var getData = /*#__PURE__*/function () {
var _ref2 = _root_workspace_ppte5yg23_local_v9_test4_node_modules_babel_runtime_7_23_6_babel_runtime_helpers_asyncToGenerator_js__WEBPACK_IMPORTED_MODULE_4___default()( /*#__PURE__*/_root_workspace_ppte5yg23_local_v9_test4_node_modules_babel_runtime_7_23_6_babel_runtime_helpers_regeneratorRuntime_js__WEBPACK_IMPORTED_MODULE_1___default()().mark(function _callee(nextPage) {
var _polls$actionTabs$sel;
var res, _res$course_info, _res$course_info2;
return _root_workspace_ppte5yg23_local_v9_test4_node_modules_babel_runtime_7_23_6_babel_runtime_helpers_regeneratorRuntime_js__WEBPACK_IMPORTED_MODULE_1___default()().wrap(function _callee$(_context) {
while (1) switch (_context.prev = _context.next) {
case 0:
setLoading(true);
_context.next = 3;
return (0,_service_polls__WEBPACK_IMPORTED_MODULE_12__/* .getPollsCourses */ .Q9)({
coursesId: params.coursesId,
check_ids: (_polls$actionTabs$sel = polls.actionTabs.selectArrs) === null || _polls$actionTabs$sel === void 0 ? void 0 : _polls$actionTabs$sel.map(function (i) {
return Number(i);
}),
page: nextPage ? nextPage : page,
limit: limit
});
case 3:
res = _context.sent;
if ((res === null || res === void 0 ? void 0 : res.status) === 0) {
if ((res === null || res === void 0 || (_res$course_info = res.course_info) === null || _res$course_info === void 0 ? void 0 : _res$course_info.length) > 0) {
setList([].concat(_root_workspace_ppte5yg23_local_v9_test4_node_modules_babel_runtime_7_23_6_babel_runtime_helpers_toConsumableArray_js__WEBPACK_IMPORTED_MODULE_3___default()(list), _root_workspace_ppte5yg23_local_v9_test4_node_modules_babel_runtime_7_23_6_babel_runtime_helpers_toConsumableArray_js__WEBPACK_IMPORTED_MODULE_3___default()(res === null || res === void 0 ? void 0 : res.course_info)));
setCount(res === null || res === void 0 ? void 0 : res.count);
}
setLoading(false);
if (!nextPage) {
form.setFieldsValue(_root_workspace_ppte5yg23_local_v9_test4_node_modules_babel_runtime_7_23_6_babel_runtime_helpers_defineProperty_js__WEBPACK_IMPORTED_MODULE_2___default()(_root_workspace_ppte5yg23_local_v9_test4_node_modules_babel_runtime_7_23_6_babel_runtime_helpers_defineProperty_js__WEBPACK_IMPORTED_MODULE_2___default()({}, 'group_ids', res === null || res === void 0 || (_res$course_info2 = res.course_info) === null || _res$course_info2 === void 0 ? void 0 : _res$course_info2.map(function (e) {
return String(e.course_group_id);
})), 'end_time', moment__WEBPACK_IMPORTED_MODULE_7___default()(moment__WEBPACK_IMPORTED_MODULE_7___default()(new Date((0,_utils_util__WEBPACK_IMPORTED_MODULE_10__/* .DayHalfPastOne */ .qd)('/'))).add(7, 'days').format('YYYY-MM-DD HH:mm'))));
}
}
case 5:
case "end":
return _context.stop();
}
}, _callee);
}));
return function getData(_x) {
return _ref2.apply(this, arguments);
};
}();
var onLoadMore = function onLoadMore(nextPage) {
setPage(nextPage);
getData(nextPage);
};
var handleOk = /*#__PURE__*/function () {
var _ref3 = _root_workspace_ppte5yg23_local_v9_test4_node_modules_babel_runtime_7_23_6_babel_runtime_helpers_asyncToGenerator_js__WEBPACK_IMPORTED_MODULE_4___default()( /*#__PURE__*/_root_workspace_ppte5yg23_local_v9_test4_node_modules_babel_runtime_7_23_6_babel_runtime_helpers_regeneratorRuntime_js__WEBPACK_IMPORTED_MODULE_1___default()().mark(function _callee2() {
var _polls$actionTabs$sel2;
var formValue, res;
return _root_workspace_ppte5yg23_local_v9_test4_node_modules_babel_runtime_7_23_6_babel_runtime_helpers_regeneratorRuntime_js__WEBPACK_IMPORTED_MODULE_1___default()().wrap(function _callee2$(_context2) {
while (1) switch (_context2.prev = _context2.next) {
case 0:
formValue = _root_workspace_ppte5yg23_local_v9_test4_node_modules_babel_runtime_7_23_6_babel_runtime_helpers_objectSpread2_js__WEBPACK_IMPORTED_MODULE_0___default()({}, form.getFieldsValue());
_context2.next = 3;
return (0,_utils_fetch__WEBPACK_IMPORTED_MODULE_8__/* ["default"] */ .ZP)("/api/courses/".concat(params.coursesId, "/polls/publish.json"), {
method: 'post',
body: {
check_ids: _root_workspace_ppte5yg23_local_v9_test4_node_modules_babel_runtime_7_23_6_babel_runtime_helpers_toConsumableArray_js__WEBPACK_IMPORTED_MODULE_3___default()((_polls$actionTabs$sel2 = polls.actionTabs.selectArrs) === null || _polls$actionTabs$sel2 === void 0 ? void 0 : _polls$actionTabs$sel2.map(function (i) {
return Number(i);
})),
group_ids: formValue.group_ids ? _root_workspace_ppte5yg23_local_v9_test4_node_modules_babel_runtime_7_23_6_babel_runtime_helpers_toConsumableArray_js__WEBPACK_IMPORTED_MODULE_3___default()(formValue.group_ids) : [],
end_time: moment__WEBPACK_IMPORTED_MODULE_7___default()(formValue.end_time).format('YYYY-MM-DD HH:mm')
}
});
case 3:
res = _context2.sent;
if (res.status === 0) {
(0,_utils_util__WEBPACK_IMPORTED_MODULE_10__/* .trackEvent */ .L9)(['教学课堂', '问卷', '立即发布']);
clear();
antd__WEBPACK_IMPORTED_MODULE_15__/* ["default"] */ .ZP.success('发布成功');
dispatch({
type: 'polls/setActionTabs',
payload: {}
});
if (polls.actionTabs.types === 2) {
dispatch({
type: 'polls/getCommonHeader',
payload: _root_workspace_ppte5yg23_local_v9_test4_node_modules_babel_runtime_7_23_6_babel_runtime_helpers_objectSpread2_js__WEBPACK_IMPORTED_MODULE_0___default()({}, polls.actionTabs.params)
});
} else {
dispatch({
type: 'classroomList/getClassroomPollsList',
payload: _root_workspace_ppte5yg23_local_v9_test4_node_modules_babel_runtime_7_23_6_babel_runtime_helpers_objectSpread2_js__WEBPACK_IMPORTED_MODULE_0___default()({}, polls.actionTabs.params)
});
}
}
case 5:
case "end":
return _context2.stop();
}
}, _callee2);
}));
return function handleOk() {
return _ref3.apply(this, arguments);
};
}();
var clear = function clear() {
setPage(1);
setList([]);
};
var hasMore = count > page * limit;
return /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_13__.jsxs)(antd__WEBPACK_IMPORTED_MODULE_16__/* ["default"] */ .Z, {
centered: true,
title: "\u7ACB\u5373\u53D1\u5E03",
open: polls.actionTabs.key === '立即发布' ? true : false,
okText: "\u7ACB\u5373\u53D1\u5E03",
cancelText: "\u6682\u4E0D\u53D1\u5E03",
onOk: handleOk,
onCancel: function onCancel() {
clear();
dispatch({
type: 'polls/setActionTabs',
payload: {}
});
},
children: [/*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_13__.jsxs)("p", {
className: "tc",
children: ["\u5B66\u751F\u5C06\u7ACB\u5373\u6536\u5230\u95EE\u5377", /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_13__.jsx)("br", {}), "\u672C\u64CD\u4F5C\u53EA\u5BF9\"\u672A\u53D1\u5E03\"\u7684\u95EE\u5377\u6709\u6548"]
}), list && /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_13__.jsxs)(antd__WEBPACK_IMPORTED_MODULE_14__/* ["default"] */ .Z, {
form: form,
children: [/*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_13__.jsxs)(antd__WEBPACK_IMPORTED_MODULE_17__/* ["default"] */ .Z, {
className: "mt30",
children: [/*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_13__.jsxs)(antd__WEBPACK_IMPORTED_MODULE_18__/* ["default"] */ .Z, {
flex: 1,
children: ["\u53D1\u5E03\u65F6\u95F4\uFF1A", moment__WEBPACK_IMPORTED_MODULE_7___default()().format('YYYY-MM-DD HH:mm')]
}), /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_13__.jsx)(antd__WEBPACK_IMPORTED_MODULE_18__/* ["default"] */ .Z, {
children: /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_13__.jsxs)(antd__WEBPACK_IMPORTED_MODULE_17__/* ["default"] */ .Z, {
children: [/*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_13__.jsx)("span", {
className: "mr5",
children: "\u622A\u6B62\u65F6\u95F4:"
}), /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_13__.jsx)(antd__WEBPACK_IMPORTED_MODULE_14__/* ["default"] */ .Z.Item, {
name: "end_time",
children: /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_13__.jsx)(antd__WEBPACK_IMPORTED_MODULE_19__["default"], {
style: {
width: 170
}
// getPopupContainer={trigger => trigger.parentNode as any}
,
placeholder: '请选择结束时间',
showTime: {
format: 'HH:mm',
defaultValue: moment__WEBPACK_IMPORTED_MODULE_7___default()((0,_utils_util__WEBPACK_IMPORTED_MODULE_10__/* .HalfPastOne */ .U6)(), 'HH:mm')
},
format: "YYYY-MM-DD HH:mm",
allowClear: false
})
})]
})
})]
}), (list === null || list === void 0 ? void 0 : list.length) > 0 && /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_13__.jsx)("div", {
style: {
background: '#F4FAFF',
maxHeight: 260,
overflow: 'auto',
padding: '16px 18px 0 18px'
},
children: /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_13__.jsxs)((react_infinite_scroller__WEBPACK_IMPORTED_MODULE_9___default()), {
initialLoad: false,
pageStart: 1,
threshold: 20,
loadMore: onLoadMore,
hasMore: hasMore,
useWindow: false,
children: [/*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_13__.jsx)(antd__WEBPACK_IMPORTED_MODULE_14__/* ["default"] */ .Z.Item, {
name: "group_ids",
children: /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_13__.jsx)(antd__WEBPACK_IMPORTED_MODULE_20__/* ["default"] */ .Z.Group, {
children: list.map(function (v, k) {
return /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_13__.jsx)("div", {
children: /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_13__.jsx)(antd__WEBPACK_IMPORTED_MODULE_20__/* ["default"] */ .Z, {
onChange: function onChange(e) {},
value: String(v.course_group_id),
defaultChecked: true,
style: {
width: 430
},
className: "multi-ellipsis1 multi-ellipsis1-checkbox",
children: /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_13__.jsx)("span", {
children: v.course_group_name
})
}, k)
}, k);
})
})
}), loading && /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_13__.jsx)("div", {
style: {
display: 'flex',
justifyContent: "center"
},
children: /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_13__.jsx)(antd__WEBPACK_IMPORTED_MODULE_21__/* ["default"] */ .Z, {})
})]
})
})]
})]
});
};
/* harmony default export */ __webpack_exports__.Z = ((0,umi__WEBPACK_IMPORTED_MODULE_11__.connect)(function (_ref4) {
var polls = _ref4.polls;
return {
polls: polls
};
})(PublishShixun));
/***/ }),
/***/ 62034:
/*!*************************************************!*\
!*** ./src/pages/Paperlibrary/See/exportPDF.ts ***!
\*************************************************/
/***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) {
"use strict";
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */ F: function() { return /* binding */ exportPDF; }
/* harmony export */ });
/* harmony import */ var _root_workspace_ppte5yg23_local_v9_test4_node_modules_babel_runtime_7_23_6_babel_runtime_helpers_regeneratorRuntime_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./node_modules/_@babel_runtime@7.23.6@@babel/runtime/helpers/regeneratorRuntime.js */ 7557);
/* harmony import */ var _root_workspace_ppte5yg23_local_v9_test4_node_modules_babel_runtime_7_23_6_babel_runtime_helpers_regeneratorRuntime_js__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_root_workspace_ppte5yg23_local_v9_test4_node_modules_babel_runtime_7_23_6_babel_runtime_helpers_regeneratorRuntime_js__WEBPACK_IMPORTED_MODULE_0__);
/* harmony import */ var _root_workspace_ppte5yg23_local_v9_test4_node_modules_babel_runtime_7_23_6_babel_runtime_helpers_asyncToGenerator_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./node_modules/_@babel_runtime@7.23.6@@babel/runtime/helpers/asyncToGenerator.js */ 41498);
/* harmony import */ var _root_workspace_ppte5yg23_local_v9_test4_node_modules_babel_runtime_7_23_6_babel_runtime_helpers_asyncToGenerator_js__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_root_workspace_ppte5yg23_local_v9_test4_node_modules_babel_runtime_7_23_6_babel_runtime_helpers_asyncToGenerator_js__WEBPACK_IMPORTED_MODULE_1__);
/* harmony import */ var html2pdf_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! html2pdf.js */ 65022);
/* harmony import */ var html2pdf_js__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(html2pdf_js__WEBPACK_IMPORTED_MODULE_2__);
/* harmony import */ var jszip__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! jszip */ 86129);
/* harmony import */ var jszip__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__webpack_require__.n(jszip__WEBPACK_IMPORTED_MODULE_3__);
var scrollView = function scrollView() {
document.body.scrollIntoView();
};
var removeSurplusCanvas = function removeSurplusCanvas() {
document.querySelectorAll('canvas').forEach(function (item) {
(!item.clientWidth || !item.clientHeight) && item.remove();
});
};
var exportPDF = /*#__PURE__*/function () {
var _ref = _root_workspace_ppte5yg23_local_v9_test4_node_modules_babel_runtime_7_23_6_babel_runtime_helpers_asyncToGenerator_js__WEBPACK_IMPORTED_MODULE_1___default()( /*#__PURE__*/_root_workspace_ppte5yg23_local_v9_test4_node_modules_babel_runtime_7_23_6_babel_runtime_helpers_regeneratorRuntime_js__WEBPACK_IMPORTED_MODULE_0___default()().mark(function _callee2(DOMList, fileTitle) {
var opt, worker, _loop, i, zip;
return _root_workspace_ppte5yg23_local_v9_test4_node_modules_babel_runtime_7_23_6_babel_runtime_helpers_regeneratorRuntime_js__WEBPACK_IMPORTED_MODULE_0___default()().wrap(function _callee2$(_context3) {
while (1) switch (_context3.prev = _context3.next) {
case 0:
scrollView();
removeSurplusCanvas();
opt = {
margin: [0, 1, 0, 0],
html2canvas: {
letterRendering: true,
useCORS: true,
allowTaint: false,
width: 810
},
jsPDF: {
unit: 'in',
format: 'letter',
orientation: 'portrait'
}
};
worker = html2pdf_js__WEBPACK_IMPORTED_MODULE_2___default()();
_loop = /*#__PURE__*/_root_workspace_ppte5yg23_local_v9_test4_node_modules_babel_runtime_7_23_6_babel_runtime_helpers_regeneratorRuntime_js__WEBPACK_IMPORTED_MODULE_0___default()().mark(function _loop(i) {
return _root_workspace_ppte5yg23_local_v9_test4_node_modules_babel_runtime_7_23_6_babel_runtime_helpers_regeneratorRuntime_js__WEBPACK_IMPORTED_MODULE_0___default()().wrap(function _loop$(_context2) {
while (1) switch (_context2.prev = _context2.next) {
case 0:
_context2.next = 2;
return worker.set(opt).from(DOMList[i]).toContainer().toCanvas().toPdf().get('pdf').then( /*#__PURE__*/function () {
var _ref2 = _root_workspace_ppte5yg23_local_v9_test4_node_modules_babel_runtime_7_23_6_babel_runtime_helpers_asyncToGenerator_js__WEBPACK_IMPORTED_MODULE_1___default()( /*#__PURE__*/_root_workspace_ppte5yg23_local_v9_test4_node_modules_babel_runtime_7_23_6_babel_runtime_helpers_regeneratorRuntime_js__WEBPACK_IMPORTED_MODULE_0___default()().mark(function _callee(pdf) {
return _root_workspace_ppte5yg23_local_v9_test4_node_modules_babel_runtime_7_23_6_babel_runtime_helpers_regeneratorRuntime_js__WEBPACK_IMPORTED_MODULE_0___default()().wrap(function _callee$(_context) {
while (1) switch (_context.prev = _context.next) {
case 0:
if (!(i < DOMList.length - 1)) {
_context.next = 3;
break;
}
_context.next = 3;
return pdf.addPage();
case 3:
case "end":
return _context.stop();
}
}, _callee);
}));
return function (_x3) {
return _ref2.apply(this, arguments);
};
}());
case 2:
case "end":
return _context2.stop();
}
}, _loop);
});
i = 0;
case 6:
if (!(i < DOMList.length)) {
_context3.next = 11;
break;
}
return _context3.delegateYield(_loop(i), "t0", 8);
case 8:
i++;
_context3.next = 6;
break;
case 11:
zip = new (jszip__WEBPACK_IMPORTED_MODULE_3___default())();
zip.file("".concat(fileTitle, ".pdf"), worker.output("blob"), {
base64: false
});
zip.generateAsync({
type: "blob"
}).then(function (content) {
var link = document.createElement('a');
link.href = window.URL.createObjectURL(content);
link.download = "".concat(fileTitle, ".zip");
document.body.appendChild(link);
var event = new MouseEvent('click');
link.dispatchEvent(event);
document.body.removeChild(link);
});
case 14:
case "end":
return _context3.stop();
}
}, _callee2);
}));
return function exportPDF(_x, _x2) {
return _ref.apply(this, arguments);
};
}();
/***/ }),
/***/ 66104:
/*!**************************************************************************!*\
!*** ./node_modules/_antd@5.9.0@antd/es/breadcrumb/index.js + 6 modules ***!
\**************************************************************************/
/***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) {
"use strict";
// EXPORTS
__webpack_require__.d(__webpack_exports__, {
Z: function() { return /* binding */ breadcrumb; }
});
// EXTERNAL MODULE: ./node_modules/_classnames@2.5.1@classnames/index.js
var _classnames_2_5_1_classnames = __webpack_require__(92310);
var _classnames_2_5_1_classnames_default = /*#__PURE__*/__webpack_require__.n(_classnames_2_5_1_classnames);
// EXTERNAL MODULE: ./node_modules/_rc-util@5.43.0@rc-util/es/Children/toArray.js
var toArray = __webpack_require__(75440);
// EXTERNAL MODULE: ./node_modules/_rc-util@5.43.0@rc-util/es/pickAttrs.js
var pickAttrs = __webpack_require__(47413);
// 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/_util/reactNode.js
var reactNode = __webpack_require__(92343);
// EXTERNAL MODULE: ./node_modules/_antd@5.9.0@antd/es/config-provider/context.js
var context = __webpack_require__(36355);
// EXTERNAL MODULE: ./node_modules/_@ant-design_icons@5.4.0@@ant-design/icons/es/icons/DownOutlined.js + 1 modules
var DownOutlined = __webpack_require__(46952);
// EXTERNAL MODULE: ./node_modules/_antd@5.9.0@antd/es/dropdown/dropdown.js
var dropdown = __webpack_require__(91857);
;// CONCATENATED MODULE: ./node_modules/_antd@5.9.0@antd/es/breadcrumb/BreadcrumbSeparator.js
"use client";
const BreadcrumbSeparator = _ref => {
let {
children
} = _ref;
const {
getPrefixCls
} = _react_17_0_2_react.useContext(context/* ConfigContext */.E_);
const prefixCls = getPrefixCls('breadcrumb');
return /*#__PURE__*/_react_17_0_2_react.createElement("li", {
className: `${prefixCls}-separator`,
"aria-hidden": "true"
}, children === '' ? children : children || '/');
};
BreadcrumbSeparator.__ANT_BREADCRUMB_SEPARATOR = true;
/* harmony default export */ var breadcrumb_BreadcrumbSeparator = (BreadcrumbSeparator);
;// CONCATENATED MODULE: ./node_modules/_antd@5.9.0@antd/es/breadcrumb/useItemRender.js
"use client";
var __rest = undefined && undefined.__rest || function (s, e) {
var t = {};
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0) t[p] = s[p];
if (s != null && typeof Object.getOwnPropertySymbols === "function") for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i])) t[p[i]] = s[p[i]];
}
return t;
};
function getBreadcrumbName(route, params) {
if (route.title === undefined || route.title === null) {
return null;
}
const paramsKeys = Object.keys(params).join('|');
return typeof route.title === 'object' ? route.title : String(route.title).replace(new RegExp(`:(${paramsKeys})`, 'g'), (replacement, key) => params[key] || replacement);
}
function renderItem(prefixCls, item, children, href) {
if (children === null || children === undefined) {
return null;
}
const {
className,
onClick
} = item,
restItem = __rest(item, ["className", "onClick"]);
const passedProps = Object.assign(Object.assign({}, (0,pickAttrs/* default */.Z)(restItem, {
data: true,
aria: true
})), {
onClick
});
if (href !== undefined) {
return /*#__PURE__*/_react_17_0_2_react.createElement("a", Object.assign({}, passedProps, {
className: _classnames_2_5_1_classnames_default()(`${prefixCls}-link`, className),
href: href
}), children);
}
return /*#__PURE__*/_react_17_0_2_react.createElement("span", Object.assign({}, passedProps, {
className: _classnames_2_5_1_classnames_default()(`${prefixCls}-link`, className)
}), children);
}
function useItemRender(prefixCls, itemRender) {
const mergedItemRender = (item, params, routes, path, href) => {
if (itemRender) {
return itemRender(item, params, routes, path);
}
const name = getBreadcrumbName(item, params);
return renderItem(prefixCls, item, name, href);
};
return mergedItemRender;
}
;// CONCATENATED MODULE: ./node_modules/_antd@5.9.0@antd/es/breadcrumb/BreadcrumbItem.js
"use client";
var BreadcrumbItem_rest = undefined && undefined.__rest || function (s, e) {
var t = {};
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0) t[p] = s[p];
if (s != null && typeof Object.getOwnPropertySymbols === "function") for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i])) t[p[i]] = s[p[i]];
}
return t;
};
const InternalBreadcrumbItem = props => {
const {
prefixCls,
separator = '/',
children,
menu,
overlay,
dropdownProps,
href
} = props;
// Warning for deprecated usage
if (false) {}
/** If overlay is have Wrap a Dropdown */
const renderBreadcrumbNode = breadcrumbItem => {
if (menu || overlay) {
const mergeDropDownProps = Object.assign({}, dropdownProps);
if (menu) {
const _a = menu || {},
{
items
} = _a,
menuProps = BreadcrumbItem_rest(_a, ["items"]);
mergeDropDownProps.menu = Object.assign(Object.assign({}, menuProps), {
items: items === null || items === void 0 ? void 0 : items.map((_a, index) => {
var {
key,
title,
label,
path
} = _a,
itemProps = BreadcrumbItem_rest(_a, ["key", "title", "label", "path"]);
let mergedLabel = label !== null && label !== void 0 ? label : title;
if (path) {
mergedLabel = /*#__PURE__*/_react_17_0_2_react.createElement("a", {
href: `${href}${path}`
}, mergedLabel);
}
return Object.assign(Object.assign({}, itemProps), {
key: key !== null && key !== void 0 ? key : index,
label: mergedLabel
});
})
});
} else if (overlay) {
mergeDropDownProps.overlay = overlay;
}
return /*#__PURE__*/_react_17_0_2_react.createElement(dropdown/* default */.Z, Object.assign({
placement: "bottom"
}, mergeDropDownProps), /*#__PURE__*/_react_17_0_2_react.createElement("span", {
className: `${prefixCls}-overlay-link`
}, breadcrumbItem, /*#__PURE__*/_react_17_0_2_react.createElement(DownOutlined/* default */.Z, null)));
}
return breadcrumbItem;
};
// wrap to dropDown
const link = renderBreadcrumbNode(children);
if (link !== undefined && link !== null) {
return /*#__PURE__*/_react_17_0_2_react.createElement(_react_17_0_2_react.Fragment, null, /*#__PURE__*/_react_17_0_2_react.createElement("li", null, link), separator && /*#__PURE__*/_react_17_0_2_react.createElement(breadcrumb_BreadcrumbSeparator, null, separator));
}
return null;
};
const BreadcrumbItem = props => {
const {
prefixCls: customizePrefixCls,
children,
href
} = props,
restProps = BreadcrumbItem_rest(props, ["prefixCls", "children", "href"]);
const {
getPrefixCls
} = _react_17_0_2_react.useContext(context/* ConfigContext */.E_);
const prefixCls = getPrefixCls('breadcrumb', customizePrefixCls);
return /*#__PURE__*/_react_17_0_2_react.createElement(InternalBreadcrumbItem, Object.assign({}, restProps, {
prefixCls: prefixCls
}), renderItem(prefixCls, restProps, children, href));
};
BreadcrumbItem.__ANT_BREADCRUMB_ITEM = true;
/* harmony default export */ var breadcrumb_BreadcrumbItem = (BreadcrumbItem);
// EXTERNAL MODULE: ./node_modules/_antd@5.9.0@antd/es/style/index.js
var style = __webpack_require__(17313);
// EXTERNAL MODULE: ./node_modules/_antd@5.9.0@antd/es/theme/util/genComponentStyleHook.js
var genComponentStyleHook = __webpack_require__(83116);
// EXTERNAL MODULE: ./node_modules/_antd@5.9.0@antd/es/theme/util/statistic.js
var statistic = __webpack_require__(37613);
;// CONCATENATED MODULE: ./node_modules/_antd@5.9.0@antd/es/breadcrumb/style/index.js
const genBreadcrumbStyle = token => {
const {
componentCls,
iconCls
} = token;
return {
[componentCls]: Object.assign(Object.assign({}, (0,style/* resetComponent */.Wf)(token)), {
color: token.itemColor,
fontSize: token.fontSize,
[iconCls]: {
fontSize: token.iconFontSize
},
ol: {
display: 'flex',
flexWrap: 'wrap',
margin: 0,
padding: 0,
listStyle: 'none'
},
a: Object.assign({
color: token.linkColor,
transition: `color ${token.motionDurationMid}`,
padding: `0 ${token.paddingXXS}px`,
borderRadius: token.borderRadiusSM,
height: token.lineHeight * token.fontSize,
display: 'inline-block',
marginInline: -token.marginXXS,
'&:hover': {
color: token.linkHoverColor,
backgroundColor: token.colorBgTextHover
}
}, (0,style/* genFocusStyle */.Qy)(token)),
[`li:last-child`]: {
color: token.lastItemColor
},
[`${componentCls}-separator`]: {
marginInline: token.separatorMargin,
color: token.separatorColor
},
[`${componentCls}-link`]: {
[`
> ${iconCls} + span,
> ${iconCls} + a
`]: {
marginInlineStart: token.marginXXS
}
},
[`${componentCls}-overlay-link`]: {
borderRadius: token.borderRadiusSM,
height: token.lineHeight * token.fontSize,
display: 'inline-block',
padding: `0 ${token.paddingXXS}px`,
marginInline: -token.marginXXS,
[`> ${iconCls}`]: {
marginInlineStart: token.marginXXS,
fontSize: token.fontSizeIcon
},
'&:hover': {
color: token.linkHoverColor,
backgroundColor: token.colorBgTextHover,
a: {
color: token.linkHoverColor
}
},
a: {
'&:hover': {
backgroundColor: 'transparent'
}
}
},
// rtl style
[`&${token.componentCls}-rtl`]: {
direction: 'rtl'
}
})
};
};
// ============================== Export ==============================
/* harmony default export */ var breadcrumb_style = ((0,genComponentStyleHook/* default */.Z)('Breadcrumb', token => {
const BreadcrumbToken = (0,statistic/* merge */.TS)(token, {});
return [genBreadcrumbStyle(BreadcrumbToken)];
}, token => ({
itemColor: token.colorTextDescription,
lastItemColor: token.colorText,
iconFontSize: token.fontSize,
linkColor: token.colorTextDescription,
linkHoverColor: token.colorText,
separatorColor: token.colorTextDescription,
separatorMargin: token.marginXS
})));
;// CONCATENATED MODULE: ./node_modules/_antd@5.9.0@antd/es/breadcrumb/useItems.js
var useItems_rest = undefined && undefined.__rest || function (s, e) {
var t = {};
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0) t[p] = s[p];
if (s != null && typeof Object.getOwnPropertySymbols === "function") for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i])) t[p[i]] = s[p[i]];
}
return t;
};
function route2item(route) {
const {
breadcrumbName,
children
} = route,
rest = useItems_rest(route, ["breadcrumbName", "children"]);
const clone = Object.assign({
title: breadcrumbName
}, rest);
if (children) {
clone.menu = {
items: children.map(_a => {
var {
breadcrumbName: itemBreadcrumbName
} = _a,
itemProps = useItems_rest(_a, ["breadcrumbName"]);
return Object.assign(Object.assign({}, itemProps), {
title: itemBreadcrumbName
});
})
};
}
return clone;
}
function useItems(items, routes) {
return (0,_react_17_0_2_react.useMemo)(() => {
if (items) {
return items;
}
if (routes) {
return routes.map(route2item);
}
return null;
}, [items, routes]);
}
;// CONCATENATED MODULE: ./node_modules/_antd@5.9.0@antd/es/breadcrumb/Breadcrumb.js
"use client";
var Breadcrumb_rest = undefined && undefined.__rest || function (s, e) {
var t = {};
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0) t[p] = s[p];
if (s != null && typeof Object.getOwnPropertySymbols === "function") for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i])) t[p[i]] = s[p[i]];
}
return t;
};
const getPath = (params, path) => {
if (path === undefined) {
return path;
}
let mergedPath = (path || '').replace(/^\//, '');
Object.keys(params).forEach(key => {
mergedPath = mergedPath.replace(`:${key}`, params[key]);
});
return mergedPath;
};
const Breadcrumb = props => {
const {
prefixCls: customizePrefixCls,
separator = '/',
style,
className,
rootClassName,
routes: legacyRoutes,
items,
children,
itemRender,
params = {}
} = props,
restProps = Breadcrumb_rest(props, ["prefixCls", "separator", "style", "className", "rootClassName", "routes", "items", "children", "itemRender", "params"]);
const {
getPrefixCls,
direction,
breadcrumb
} = _react_17_0_2_react.useContext(context/* ConfigContext */.E_);
let crumbs;
const prefixCls = getPrefixCls('breadcrumb', customizePrefixCls);
const [wrapSSR, hashId] = breadcrumb_style(prefixCls);
const mergedItems = useItems(items, legacyRoutes);
if (false) {}
const mergedItemRender = useItemRender(prefixCls, itemRender);
if (mergedItems && mergedItems.length > 0) {
// generated by route
const paths = [];
const itemRenderRoutes = items || legacyRoutes;
crumbs = mergedItems.map((item, index) => {
const {
path,
key,
type,
menu,
overlay,
onClick,
className: itemClassName,
separator: itemSeparator,
dropdownProps
} = item;
const mergedPath = getPath(params, path);
if (mergedPath !== undefined) {
paths.push(mergedPath);
}
const mergedKey = key !== null && key !== void 0 ? key : index;
if (type === 'separator') {
return /*#__PURE__*/_react_17_0_2_react.createElement(breadcrumb_BreadcrumbSeparator, {
key: mergedKey
}, itemSeparator);
}
const itemProps = {};
const isLastItem = index === mergedItems.length - 1;
if (menu) {
itemProps.menu = menu;
} else if (overlay) {
itemProps.overlay = overlay;
}
let {
href
} = item;
if (paths.length && mergedPath !== undefined) {
href = `#/${paths.join('/')}`;
}
return /*#__PURE__*/_react_17_0_2_react.createElement(InternalBreadcrumbItem, Object.assign({
key: mergedKey
}, itemProps, (0,pickAttrs/* default */.Z)(item, {
data: true,
aria: true
}), {
className: itemClassName,
dropdownProps: dropdownProps,
href: href,
separator: isLastItem ? '' : separator,
onClick: onClick,
prefixCls: prefixCls
}), mergedItemRender(item, params, itemRenderRoutes, paths, href));
});
} else if (children) {
const childrenLength = (0,toArray/* default */.Z)(children).length;
crumbs = (0,toArray/* default */.Z)(children).map((element, index) => {
if (!element) {
return element;
}
// =================== Warning =====================
if (false) {}
false ? 0 : void 0;
const isLastItem = index === childrenLength - 1;
return (0,reactNode/* cloneElement */.Tm)(element, {
separator: isLastItem ? '' : separator,
key: index
});
});
}
const breadcrumbClassName = _classnames_2_5_1_classnames_default()(prefixCls, breadcrumb === null || breadcrumb === void 0 ? void 0 : breadcrumb.className, {
[`${prefixCls}-rtl`]: direction === 'rtl'
}, className, rootClassName, hashId);
const mergedStyle = Object.assign(Object.assign({}, breadcrumb === null || breadcrumb === void 0 ? void 0 : breadcrumb.style), style);
return wrapSSR( /*#__PURE__*/_react_17_0_2_react.createElement("nav", Object.assign({
className: breadcrumbClassName,
style: mergedStyle
}, restProps), /*#__PURE__*/_react_17_0_2_react.createElement("ol", null, crumbs)));
};
Breadcrumb.Item = breadcrumb_BreadcrumbItem;
Breadcrumb.Separator = breadcrumb_BreadcrumbSeparator;
if (false) {}
/* harmony default export */ var breadcrumb_Breadcrumb = (Breadcrumb);
;// CONCATENATED MODULE: ./node_modules/_antd@5.9.0@antd/es/breadcrumb/index.js
"use client";
/* harmony default export */ var breadcrumb = (breadcrumb_Breadcrumb);
/***/ }),
/***/ 28103:
/*!***********************************************************************!*\
!*** ./node_modules/_antd@5.9.0@antd/es/divider/index.js + 1 modules ***!
\***********************************************************************/
/***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) {
"use strict";
// EXPORTS
__webpack_require__.d(__webpack_exports__, {
Z: function() { return /* binding */ divider; }
});
// EXTERNAL MODULE: ./node_modules/_classnames@2.5.1@classnames/index.js
var _classnames_2_5_1_classnames = __webpack_require__(92310);
var _classnames_2_5_1_classnames_default = /*#__PURE__*/__webpack_require__.n(_classnames_2_5_1_classnames);
// 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/config-provider/context.js
var context = __webpack_require__(36355);
// EXTERNAL MODULE: ./node_modules/_antd@5.9.0@antd/es/style/index.js
var style = __webpack_require__(17313);
// EXTERNAL MODULE: ./node_modules/_antd@5.9.0@antd/es/theme/util/genComponentStyleHook.js
var genComponentStyleHook = __webpack_require__(83116);
// EXTERNAL MODULE: ./node_modules/_antd@5.9.0@antd/es/theme/util/statistic.js
var statistic = __webpack_require__(37613);
;// CONCATENATED MODULE: ./node_modules/_antd@5.9.0@antd/es/divider/style/index.js
// ============================== Shared ==============================
const genSharedDividerStyle = token => {
const {
componentCls,
sizePaddingEdgeHorizontal,
colorSplit,
lineWidth,
textPaddingInline,
orientationMargin,
verticalMarginInline
} = token;
return {
[componentCls]: Object.assign(Object.assign({}, (0,style/* resetComponent */.Wf)(token)), {
borderBlockStart: `${lineWidth}px solid ${colorSplit}`,
// vertical
'&-vertical': {
position: 'relative',
top: '-0.06em',
display: 'inline-block',
height: '0.9em',
marginInline: verticalMarginInline,
marginBlock: 0,
verticalAlign: 'middle',
borderTop: 0,
borderInlineStart: `${lineWidth}px solid ${colorSplit}`
},
'&-horizontal': {
display: 'flex',
clear: 'both',
width: '100%',
minWidth: '100%',
margin: `${token.dividerHorizontalGutterMargin}px 0`
},
[`&-horizontal${componentCls}-with-text`]: {
display: 'flex',
alignItems: 'center',
margin: `${token.dividerHorizontalWithTextGutterMargin}px 0`,
color: token.colorTextHeading,
fontWeight: 500,
fontSize: token.fontSizeLG,
whiteSpace: 'nowrap',
textAlign: 'center',
borderBlockStart: `0 ${colorSplit}`,
'&::before, &::after': {
position: 'relative',
width: '50%',
borderBlockStart: `${lineWidth}px solid transparent`,
// Chrome not accept `inherit` in `border-top`
borderBlockStartColor: 'inherit',
borderBlockEnd: 0,
transform: 'translateY(50%)',
content: "''"
}
},
[`&-horizontal${componentCls}-with-text-left`]: {
'&::before': {
width: `${orientationMargin * 100}%`
},
'&::after': {
width: `${100 - orientationMargin * 100}%`
}
},
[`&-horizontal${componentCls}-with-text-right`]: {
'&::before': {
width: `${100 - orientationMargin * 100}%`
},
'&::after': {
width: `${orientationMargin * 100}%`
}
},
[`${componentCls}-inner-text`]: {
display: 'inline-block',
paddingBlock: 0,
paddingInline: textPaddingInline
},
'&-dashed': {
background: 'none',
borderColor: colorSplit,
borderStyle: 'dashed',
borderWidth: `${lineWidth}px 0 0`
},
[`&-horizontal${componentCls}-with-text${componentCls}-dashed`]: {
'&::before, &::after': {
borderStyle: 'dashed none none'
}
},
[`&-vertical${componentCls}-dashed`]: {
borderInlineStartWidth: lineWidth,
borderInlineEnd: 0,
borderBlockStart: 0,
borderBlockEnd: 0
},
[`&-plain${componentCls}-with-text`]: {
color: token.colorText,
fontWeight: 'normal',
fontSize: token.fontSize
},
[`&-horizontal${componentCls}-with-text-left${componentCls}-no-default-orientation-margin-left`]: {
'&::before': {
width: 0
},
'&::after': {
width: '100%'
},
[`${componentCls}-inner-text`]: {
paddingInlineStart: sizePaddingEdgeHorizontal
}
},
[`&-horizontal${componentCls}-with-text-right${componentCls}-no-default-orientation-margin-right`]: {
'&::before': {
width: '100%'
},
'&::after': {
width: 0
},
[`${componentCls}-inner-text`]: {
paddingInlineEnd: sizePaddingEdgeHorizontal
}
}
})
};
};
// ============================== Export ==============================
/* harmony default export */ var divider_style = ((0,genComponentStyleHook/* default */.Z)('Divider', token => {
const dividerToken = (0,statistic/* merge */.TS)(token, {
dividerHorizontalWithTextGutterMargin: token.margin,
dividerHorizontalGutterMargin: token.marginLG,
sizePaddingEdgeHorizontal: 0
});
return [genSharedDividerStyle(dividerToken)];
}, token => ({
textPaddingInline: '1em',
orientationMargin: 0.05,
verticalMarginInline: token.marginXS
})));
;// CONCATENATED MODULE: ./node_modules/_antd@5.9.0@antd/es/divider/index.js
"use client";
var __rest = undefined && undefined.__rest || function (s, e) {
var t = {};
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0) t[p] = s[p];
if (s != null && typeof Object.getOwnPropertySymbols === "function") for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i])) t[p[i]] = s[p[i]];
}
return t;
};
const Divider = props => {
const {
getPrefixCls,
direction,
divider
} = _react_17_0_2_react.useContext(context/* ConfigContext */.E_);
const {
prefixCls: customizePrefixCls,
type = 'horizontal',
orientation = 'center',
orientationMargin,
className,
rootClassName,
children,
dashed,
plain,
style
} = props,
restProps = __rest(props, ["prefixCls", "type", "orientation", "orientationMargin", "className", "rootClassName", "children", "dashed", "plain", "style"]);
const prefixCls = getPrefixCls('divider', customizePrefixCls);
const [wrapSSR, hashId] = divider_style(prefixCls);
const orientationPrefix = orientation.length > 0 ? `-${orientation}` : orientation;
const hasChildren = !!children;
const hasCustomMarginLeft = orientation === 'left' && orientationMargin != null;
const hasCustomMarginRight = orientation === 'right' && orientationMargin != null;
const classString = _classnames_2_5_1_classnames_default()(prefixCls, divider === null || divider === void 0 ? void 0 : divider.className, hashId, `${prefixCls}-${type}`, {
[`${prefixCls}-with-text`]: hasChildren,
[`${prefixCls}-with-text${orientationPrefix}`]: hasChildren,
[`${prefixCls}-dashed`]: !!dashed,
[`${prefixCls}-plain`]: !!plain,
[`${prefixCls}-rtl`]: direction === 'rtl',
[`${prefixCls}-no-default-orientation-margin-left`]: hasCustomMarginLeft,
[`${prefixCls}-no-default-orientation-margin-right`]: hasCustomMarginRight
}, className, rootClassName);
const memoizedOrientationMargin = _react_17_0_2_react.useMemo(() => {
if (typeof orientationMargin === 'number') {
return orientationMargin;
}
if (/^\d+$/.test(orientationMargin)) {
return Number(orientationMargin);
}
return orientationMargin;
}, [orientationMargin]);
const innerStyle = Object.assign(Object.assign({}, hasCustomMarginLeft && {
marginLeft: memoizedOrientationMargin
}), hasCustomMarginRight && {
marginRight: memoizedOrientationMargin
});
// Warning children not work in vertical mode
if (false) {}
return wrapSSR( /*#__PURE__*/_react_17_0_2_react.createElement("div", Object.assign({
className: classString,
style: Object.assign(Object.assign({}, divider === null || divider === void 0 ? void 0 : divider.style), style)
}, restProps, {
role: "separator"
}), children && type !== 'vertical' && /*#__PURE__*/_react_17_0_2_react.createElement("span", {
className: `${prefixCls}-inner-text`,
style: innerStyle
}, children)));
};
if (false) {}
/* harmony default export */ var divider = (Divider);
/***/ }),
/***/ 51581:
/*!****************************************************************************************************!*\
!*** ./node_modules/_react-infinite-scroller@1.2.4@react-infinite-scroller/dist/InfiniteScroll.js ***!
\****************************************************************************************************/
/***/ (function(module, exports, __webpack_require__) {
"use strict";
Object.defineProperty(exports, "__esModule", ({
value: true
}));
var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();
var _react = __webpack_require__(/*! react */ 59301);
var _react2 = _interopRequireDefault(_react);
var _propTypes = __webpack_require__(/*! prop-types */ 12708);
var _propTypes2 = _interopRequireDefault(_propTypes);
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
function _objectWithoutProperties(obj, keys) { var target = {}; for (var i in obj) { if (keys.indexOf(i) >= 0) continue; if (!Object.prototype.hasOwnProperty.call(obj, i)) continue; target[i] = obj[i]; } return target; }
function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; }
function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; }
var InfiniteScroll = function (_Component) {
_inherits(InfiniteScroll, _Component);
function InfiniteScroll(props) {
_classCallCheck(this, InfiniteScroll);
var _this = _possibleConstructorReturn(this, (InfiniteScroll.__proto__ || Object.getPrototypeOf(InfiniteScroll)).call(this, props));
_this.scrollListener = _this.scrollListener.bind(_this);
_this.eventListenerOptions = _this.eventListenerOptions.bind(_this);
_this.mousewheelListener = _this.mousewheelListener.bind(_this);
return _this;
}
_createClass(InfiniteScroll, [{
key: 'componentDidMount',
value: function componentDidMount() {
this.pageLoaded = this.props.pageStart;
this.options = this.eventListenerOptions();
this.attachScrollListener();
}
}, {
key: 'componentDidUpdate',
value: function componentDidUpdate() {
if (this.props.isReverse && this.loadMore) {
var parentElement = this.getParentElement(this.scrollComponent);
parentElement.scrollTop = parentElement.scrollHeight - this.beforeScrollHeight + this.beforeScrollTop;
this.loadMore = false;
}
this.attachScrollListener();
}
}, {
key: 'componentWillUnmount',
value: function componentWillUnmount() {
this.detachScrollListener();
this.detachMousewheelListener();
}
}, {
key: 'isPassiveSupported',
value: function isPassiveSupported() {
var passive = false;
var testOptions = {
get passive() {
passive = true;
}
};
try {
document.addEventListener('test', null, testOptions);
document.removeEventListener('test', null, testOptions);
} catch (e) {
// ignore
}
return passive;
}
}, {
key: 'eventListenerOptions',
value: function eventListenerOptions() {
var options = this.props.useCapture;
if (this.isPassiveSupported()) {
options = {
useCapture: this.props.useCapture,
passive: true
};
}
return options;
}
// Set a defaut loader for all your `InfiniteScroll` components
}, {
key: 'setDefaultLoader',
value: function setDefaultLoader(loader) {
this.defaultLoader = loader;
}
}, {
key: 'detachMousewheelListener',
value: function detachMousewheelListener() {
var scrollEl = window;
if (this.props.useWindow === false) {
scrollEl = this.scrollComponent.parentNode;
}
scrollEl.removeEventListener('mousewheel', this.mousewheelListener, this.options ? this.options : this.props.useCapture);
}
}, {
key: 'detachScrollListener',
value: function detachScrollListener() {
var scrollEl = window;
if (this.props.useWindow === false) {
scrollEl = this.getParentElement(this.scrollComponent);
}
scrollEl.removeEventListener('scroll', this.scrollListener, this.options ? this.options : this.props.useCapture);
scrollEl.removeEventListener('resize', this.scrollListener, this.options ? this.options : this.props.useCapture);
}
}, {
key: 'getParentElement',
value: function getParentElement(el) {
var scrollParent = this.props.getScrollParent && this.props.getScrollParent();
if (scrollParent != null) {
return scrollParent;
}
return el && el.parentNode;
}
}, {
key: 'filterProps',
value: function filterProps(props) {
return props;
}
}, {
key: 'attachScrollListener',
value: function attachScrollListener() {
var parentElement = this.getParentElement(this.scrollComponent);
if (!this.props.hasMore || !parentElement) {
return;
}
var scrollEl = window;
if (this.props.useWindow === false) {
scrollEl = parentElement;
}
scrollEl.addEventListener('mousewheel', this.mousewheelListener, this.options ? this.options : this.props.useCapture);
scrollEl.addEventListener('scroll', this.scrollListener, this.options ? this.options : this.props.useCapture);
scrollEl.addEventListener('resize', this.scrollListener, this.options ? this.options : this.props.useCapture);
if (this.props.initialLoad) {
this.scrollListener();
}
}
}, {
key: 'mousewheelListener',
value: function mousewheelListener(e) {
// Prevents Chrome hangups
// See: https://stackoverflow.com/questions/47524205/random-high-content-download-time-in-chrome/47684257#47684257
if (e.deltaY === 1 && !this.isPassiveSupported()) {
e.preventDefault();
}
}
}, {
key: 'scrollListener',
value: function scrollListener() {
var el = this.scrollComponent;
var scrollEl = window;
var parentNode = this.getParentElement(el);
var offset = void 0;
if (this.props.useWindow) {
var doc = document.documentElement || document.body.parentNode || document.body;
var scrollTop = scrollEl.pageYOffset !== undefined ? scrollEl.pageYOffset : doc.scrollTop;
if (this.props.isReverse) {
offset = scrollTop;
} else {
offset = this.calculateOffset(el, scrollTop);
}
} else if (this.props.isReverse) {
offset = parentNode.scrollTop;
} else {
offset = el.scrollHeight - parentNode.scrollTop - parentNode.clientHeight;
}
// Here we make sure the element is visible as well as checking the offset
if (offset < Number(this.props.threshold) && el && el.offsetParent !== null) {
this.detachScrollListener();
this.beforeScrollHeight = parentNode.scrollHeight;
this.beforeScrollTop = parentNode.scrollTop;
// Call loadMore after detachScrollListener to allow for non-async loadMore functions
if (typeof this.props.loadMore === 'function') {
this.props.loadMore(this.pageLoaded += 1);
this.loadMore = true;
}
}
}
}, {
key: 'calculateOffset',
value: function calculateOffset(el, scrollTop) {
if (!el) {
return 0;
}
return this.calculateTopPosition(el) + (el.offsetHeight - scrollTop - window.innerHeight);
}
}, {
key: 'calculateTopPosition',
value: function calculateTopPosition(el) {
if (!el) {
return 0;
}
return el.offsetTop + this.calculateTopPosition(el.offsetParent);
}
}, {
key: 'render',
value: function render() {
var _this2 = this;
var renderProps = this.filterProps(this.props);
var children = renderProps.children,
element = renderProps.element,
hasMore = renderProps.hasMore,
initialLoad = renderProps.initialLoad,
isReverse = renderProps.isReverse,
loader = renderProps.loader,
loadMore = renderProps.loadMore,
pageStart = renderProps.pageStart,
ref = renderProps.ref,
threshold = renderProps.threshold,
useCapture = renderProps.useCapture,
useWindow = renderProps.useWindow,
getScrollParent = renderProps.getScrollParent,
props = _objectWithoutProperties(renderProps, ['children', 'element', 'hasMore', 'initialLoad', 'isReverse', 'loader', 'loadMore', 'pageStart', 'ref', 'threshold', 'useCapture', 'useWindow', 'getScrollParent']);
props.ref = function (node) {
_this2.scrollComponent = node;
if (ref) {
ref(node);
}
};
var childrenArray = [children];
if (hasMore) {
if (loader) {
isReverse ? childrenArray.unshift(loader) : childrenArray.push(loader);
} else if (this.defaultLoader) {
isReverse ? childrenArray.unshift(this.defaultLoader) : childrenArray.push(this.defaultLoader);
}
}
return _react2.default.createElement(element, props, childrenArray);
}
}]);
return InfiniteScroll;
}(_react.Component);
InfiniteScroll.propTypes = {
children: _propTypes2.default.node.isRequired,
element: _propTypes2.default.node,
hasMore: _propTypes2.default.bool,
initialLoad: _propTypes2.default.bool,
isReverse: _propTypes2.default.bool,
loader: _propTypes2.default.node,
loadMore: _propTypes2.default.func.isRequired,
pageStart: _propTypes2.default.number,
ref: _propTypes2.default.func,
getScrollParent: _propTypes2.default.func,
threshold: _propTypes2.default.number,
useCapture: _propTypes2.default.bool,
useWindow: _propTypes2.default.bool
};
InfiniteScroll.defaultProps = {
element: 'div',
hasMore: false,
initialLoad: true,
pageStart: 0,
ref: null,
threshold: 250,
useWindow: true,
isReverse: false,
useCapture: false,
loader: null,
getScrollParent: null
};
exports["default"] = InfiniteScroll;
module.exports = exports['default'];
/***/ }),
/***/ 26724:
/*!**************************************************************************************!*\
!*** ./node_modules/_react-infinite-scroller@1.2.4@react-infinite-scroller/index.js ***!
\**************************************************************************************/
/***/ (function(module, __unused_webpack_exports, __webpack_require__) {
module.exports = __webpack_require__(/*! ./dist/InfiniteScroll */ 51581)
/***/ })
}]);