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__Shixuns__Detail__Collabo...

1775 lines
91 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([[25470,79250],{
/***/ 43914:
/*!*************************************************************************************************************!*\
!*** ./node_modules/_@ant-design_icons@5.2.6@@ant-design/icons/es/icons/CloseSquareOutlined.js + 1 modules ***!
\*************************************************************************************************************/
/***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) {
"use strict";
// EXPORTS
__webpack_require__.d(__webpack_exports__, {
Z: function() { return /* binding */ icons_CloseSquareOutlined; }
});
// EXTERNAL MODULE: ./node_modules/_@babel_runtime@7.23.2@@babel/runtime/helpers/esm/extends.js
var esm_extends = __webpack_require__(26508);
// 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.3.1@@ant-design/icons-svg/es/asn/CloseSquareOutlined.js
// This icon file is generated automatically.
var CloseSquareOutlined = { "icon": { "tag": "svg", "attrs": { "fill-rule": "evenodd", "viewBox": "64 64 896 896", "focusable": "false" }, "children": [{ "tag": "path", "attrs": { "d": "M880 112c17.7 0 32 14.3 32 32v736c0 17.7-14.3 32-32 32H144c-17.7 0-32-14.3-32-32V144c0-17.7 14.3-32 32-32zm-40 72H184v656h656V184zM640.01 338.83c.03 0 .05.01.09.06l45.02 45.01a.2.2 0 01.05.09.12.12 0 010 .07c0 .02-.01.04-.05.08L557.25 512l127.87 127.86a.27.27 0 01.05.06v.02a.12.12 0 010 .07c0 .03-.01.05-.05.09l-45.02 45.02a.2.2 0 01-.09.05.12.12 0 01-.07 0c-.02 0-.04-.01-.08-.05L512 557.25 384.14 685.12c-.04.04-.06.05-.08.05a.12.12 0 01-.07 0c-.03 0-.05-.01-.09-.05l-45.02-45.02a.2.2 0 01-.05-.09.12.12 0 010-.07c0-.02.01-.04.06-.08L466.75 512 338.88 384.14a.27.27 0 01-.05-.06l-.01-.02a.12.12 0 010-.07c0-.03.01-.05.05-.09l45.02-45.02a.2.2 0 01.09-.05.12.12 0 01.07 0c.02 0 .04.01.08.06L512 466.75l127.86-127.86c.04-.05.06-.06.08-.06a.12.12 0 01.07 0z" } }] }, "name": "close-square", "theme": "outlined" };
/* harmony default export */ var asn_CloseSquareOutlined = (CloseSquareOutlined);
// EXTERNAL MODULE: ./node_modules/_@ant-design_icons@5.2.6@@ant-design/icons/es/components/AntdIcon.js + 3 modules
var AntdIcon = __webpack_require__(91851);
;// CONCATENATED MODULE: ./node_modules/_@ant-design_icons@5.2.6@@ant-design/icons/es/icons/CloseSquareOutlined.js
// GENERATE BY ./scripts/generate.ts
// DON NOT EDIT IT MANUALLY
var CloseSquareOutlined_CloseSquareOutlined = function CloseSquareOutlined(props, ref) {
return /*#__PURE__*/_react_17_0_2_react.createElement(AntdIcon/* default */.Z, (0,esm_extends/* default */.Z)({}, props, {
ref: ref,
icon: asn_CloseSquareOutlined
}));
};
if (false) {}
/* harmony default export */ var icons_CloseSquareOutlined = (/*#__PURE__*/_react_17_0_2_react.forwardRef(CloseSquareOutlined_CloseSquareOutlined));
/***/ }),
/***/ 80045:
/*!*******************************************************************************************************************!*\
!*** ./node_modules/_@ant-design_icons@5.2.6@@ant-design/icons/es/icons/ExclamationCircleOutlined.js + 1 modules ***!
\*******************************************************************************************************************/
/***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) {
"use strict";
// EXPORTS
__webpack_require__.d(__webpack_exports__, {
Z: function() { return /* binding */ icons_ExclamationCircleOutlined; }
});
// EXTERNAL MODULE: ./node_modules/_@babel_runtime@7.23.2@@babel/runtime/helpers/esm/extends.js
var esm_extends = __webpack_require__(26508);
// 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.3.1@@ant-design/icons-svg/es/asn/ExclamationCircleOutlined.js
// This icon file is generated automatically.
var ExclamationCircleOutlined = { "icon": { "tag": "svg", "attrs": { "viewBox": "64 64 896 896", "focusable": "false" }, "children": [{ "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" } }, { "tag": "path", "attrs": { "d": "M464 688a48 48 0 1096 0 48 48 0 10-96 0zm24-112h48c4.4 0 8-3.6 8-8V296c0-4.4-3.6-8-8-8h-48c-4.4 0-8 3.6-8 8v272c0 4.4 3.6 8 8 8z" } }] }, "name": "exclamation-circle", "theme": "outlined" };
/* harmony default export */ var asn_ExclamationCircleOutlined = (ExclamationCircleOutlined);
// EXTERNAL MODULE: ./node_modules/_@ant-design_icons@5.2.6@@ant-design/icons/es/components/AntdIcon.js + 3 modules
var AntdIcon = __webpack_require__(91851);
;// CONCATENATED MODULE: ./node_modules/_@ant-design_icons@5.2.6@@ant-design/icons/es/icons/ExclamationCircleOutlined.js
// GENERATE BY ./scripts/generate.ts
// DON NOT EDIT IT MANUALLY
var ExclamationCircleOutlined_ExclamationCircleOutlined = function ExclamationCircleOutlined(props, ref) {
return /*#__PURE__*/_react_17_0_2_react.createElement(AntdIcon/* default */.Z, (0,esm_extends/* default */.Z)({}, props, {
ref: ref,
icon: asn_ExclamationCircleOutlined
}));
};
if (false) {}
/* harmony default export */ var icons_ExclamationCircleOutlined = (/*#__PURE__*/_react_17_0_2_react.forwardRef(ExclamationCircleOutlined_ExclamationCircleOutlined));
/***/ }),
/***/ 36401:
/*!**********************************************************************!*\
!*** ./src/pages/Shixuns/Detail/Collaborators/index.tsx + 4 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_Collaborators; }
});
// EXTERNAL MODULE: ./node_modules/_@babel_runtime@7.23.2@@babel/runtime/helpers/objectSpread2.js
var objectSpread2 = __webpack_require__(26801);
var objectSpread2_default = /*#__PURE__*/__webpack_require__.n(objectSpread2);
// EXTERNAL MODULE: ./node_modules/_@babel_runtime@7.23.2@@babel/runtime/helpers/regeneratorRuntime.js
var regeneratorRuntime = __webpack_require__(10574);
var regeneratorRuntime_default = /*#__PURE__*/__webpack_require__.n(regeneratorRuntime);
// EXTERNAL MODULE: ./node_modules/_@babel_runtime@7.23.2@@babel/runtime/helpers/asyncToGenerator.js
var asyncToGenerator = __webpack_require__(39343);
var asyncToGenerator_default = /*#__PURE__*/__webpack_require__.n(asyncToGenerator);
// EXTERNAL MODULE: ./node_modules/_@babel_runtime@7.23.2@@babel/runtime/helpers/slicedToArray.js
var slicedToArray = __webpack_require__(11006);
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 + 8 modules
var _umi_production_exports = __webpack_require__(66660);
// EXTERNAL MODULE: ./node_modules/_antd@5.9.0@antd/es/modal/index.js + 16 modules
var modal = __webpack_require__(43418);
// EXTERNAL MODULE: ./node_modules/_antd@5.9.0@antd/es/message/index.js + 4 modules
var message = __webpack_require__(8591);
// EXTERNAL MODULE: ./node_modules/_antd@5.9.0@antd/es/button/index.js
var es_button = __webpack_require__(3113);
// EXTERNAL MODULE: ./node_modules/_antd@5.9.0@antd/es/skeleton/index.js + 12 modules
var skeleton = __webpack_require__(59981);
// EXTERNAL MODULE: ./node_modules/_antd@5.9.0@antd/es/dropdown/index.js + 1 modules
var dropdown = __webpack_require__(38854);
// EXTERNAL MODULE: ./node_modules/_antd@5.9.0@antd/es/menu/index.js + 11 modules
var menu = __webpack_require__(20834);
// EXTERNAL MODULE: ./node_modules/_antd@5.9.0@antd/es/pagination/index.js + 10 modules
var pagination = __webpack_require__(41867);
// EXTERNAL MODULE: ./src/pages/Shixuns/Detail/components/Right/index.tsx + 4 modules
var Right = __webpack_require__(79250);
// EXTERNAL MODULE: ./src/utils/env.ts + 1 modules
var env = __webpack_require__(47015);
// EXTERNAL MODULE: ./node_modules/_@babel_runtime@7.23.2@@babel/runtime/helpers/objectWithoutProperties.js
var objectWithoutProperties = __webpack_require__(27161);
var objectWithoutProperties_default = /*#__PURE__*/__webpack_require__.n(objectWithoutProperties);
// EXTERNAL MODULE: ./node_modules/_antd@5.9.0@antd/es/radio/index.js + 5 modules
var es_radio = __webpack_require__(5112);
;// CONCATENATED MODULE: ./src/pages/Shixuns/Detail/Collaborators/components/ChangeManagerModal/index.less?modules
// extracted by mini-css-extract-plugin
/* harmony default export */ var ChangeManagerModalmodules = ({"title":"title___GjBar","content":"content___I7QWQ","add":"add___S7NYy","colorBlue":"colorBlue___msrvf","radio":"radio___KDCSZ"});
// EXTERNAL MODULE: ./node_modules/_react@17.0.2@react/jsx-runtime.js
var jsx_runtime = __webpack_require__(37712);
;// CONCATENATED MODULE: ./src/pages/Shixuns/Detail/Collaborators/components/ChangeManagerModal/index.tsx
var _excluded = ["shixunsDetail", "globalSetting", "loading", "dispatch", "onReloadData"];
var ChangeManagerModal = function ChangeManagerModal(_ref) {
var shixunsDetail = _ref.shixunsDetail,
globalSetting = _ref.globalSetting,
loading = _ref.loading,
dispatch = _ref.dispatch,
onReloadData = _ref.onReloadData,
props = objectWithoutProperties_default()(_ref, _excluded);
var _useState = (0,_react_17_0_2_react.useState)(),
_useState2 = slicedToArray_default()(_useState, 2),
radioValue = _useState2[0],
setRadioValue = _useState2[1];
var _useState3 = (0,_react_17_0_2_react.useState)([]),
_useState4 = slicedToArray_default()(_useState3, 2),
managerList = _useState4[0],
setManagerList = _useState4[1];
(0,_react_17_0_2_react.useEffect)(function () {
if (shixunsDetail.actionTabs.key === 'Collaborators-ChangeManager') {
handleGetChangeManager();
}
}, [shixunsDetail.actionTabs.key]);
var handleGetChangeManager = /*#__PURE__*/function () {
var _ref2 = asyncToGenerator_default()( /*#__PURE__*/regeneratorRuntime_default()().mark(function _callee() {
var _shixunsDetail$action;
var res;
return regeneratorRuntime_default()().wrap(function _callee$(_context) {
while (1) switch (_context.prev = _context.next) {
case 0:
_context.next = 2;
return dispatch({
type: 'shixunsDetail/getChangeManager',
payload: {
id: (_shixunsDetail$action = shixunsDetail.actionTabs.params) === null || _shixunsDetail$action === void 0 ? void 0 : _shixunsDetail$action.id
}
});
case 2:
res = _context.sent;
setManagerList(res || []);
case 4:
case "end":
return _context.stop();
}
}, _callee);
}));
return function handleGetChangeManager() {
return _ref2.apply(this, arguments);
};
}();
var handleAddCollaborator = function handleAddCollaborator() {
var _shixunsDetail$action2;
dispatch({
type: 'shixunsDetail/setActionTabs',
payload: {
key: 'Collaborators-AddCollaborator',
params: {
id: (_shixunsDetail$action2 = shixunsDetail.actionTabs.params) === null || _shixunsDetail$action2 === void 0 ? void 0 : _shixunsDetail$action2.id
}
}
});
};
var handleOk = /*#__PURE__*/function () {
var _ref3 = asyncToGenerator_default()( /*#__PURE__*/regeneratorRuntime_default()().mark(function _callee2() {
var _shixunsDetail$action3;
var res;
return regeneratorRuntime_default()().wrap(function _callee2$(_context2) {
while (1) switch (_context2.prev = _context2.next) {
case 0:
if (radioValue) {
_context2.next = 3;
break;
}
message/* default */.ZP.info('所选人员为空,没有更换成功');
return _context2.abrupt("return");
case 3:
_context2.next = 5;
return dispatch({
type: 'shixunsDetail/changeManager',
payload: {
id: (_shixunsDetail$action3 = shixunsDetail.actionTabs.params) === null || _shixunsDetail$action3 === void 0 ? void 0 : _shixunsDetail$action3.id,
user_id: radioValue
}
});
case 5:
res = _context2.sent;
handleCancel();
if (res) {
onReloadData();
message/* default */.ZP.info(res.message);
}
case 8:
case "end":
return _context2.stop();
}
}, _callee2);
}));
return function handleOk() {
return _ref3.apply(this, arguments);
};
}();
var handleCancel = function handleCancel() {
dispatch({
type: 'shixunsDetail/setActionTabs',
payload: {}
});
setRadioValue(null);
};
return /*#__PURE__*/(0,jsx_runtime.jsx)(modal/* default */.Z, {
centered: true,
keyboard: false,
closable: false,
title: "\u66F4\u6362\u7BA1\u7406\u5458",
open: shixunsDetail.actionTabs.key === 'Collaborators-ChangeManager',
confirmLoading: loading.effects['shixunsDetail/changeManager'],
onOk: handleOk,
onCancel: handleCancel,
children: /*#__PURE__*/(0,jsx_runtime.jsxs)("div", {
children: [/*#__PURE__*/(0,jsx_runtime.jsxs)("div", {
className: ChangeManagerModalmodules.title,
children: ["\u9009\u62E9\u7684\u6210\u5458\u5C06\u4F1A\u6210\u4E3A\u65B0\u7684\u7BA1\u7406\u5458", /*#__PURE__*/(0,jsx_runtime.jsx)("br", {}), "\u60A8\u5C06\u4E0D\u518D\u62E5\u6709\u7BA1\u7406\u5458\u7684\u6743\u9650\uFF0C\u4F46\u60A8\u4ECD\u662F\u5408\u4F5C\u56E2\u961F\u7684\u4E00\u5458"]
}), /*#__PURE__*/(0,jsx_runtime.jsx)("div", {
className: ChangeManagerModalmodules.content,
children: managerList.length ? /*#__PURE__*/(0,jsx_runtime.jsx)(es_radio/* default.Group */.ZP.Group, {
value: radioValue,
onChange: function onChange(e) {
return setRadioValue(e.target.value);
},
children: managerList.map(function (item, index) {
return /*#__PURE__*/(0,jsx_runtime.jsx)(es_radio/* default */.ZP, {
className: ChangeManagerModalmodules.radio,
value: item.user_id,
children: item.name
}, index);
})
}) : /*#__PURE__*/(0,jsx_runtime.jsx)("div", {
className: ChangeManagerModalmodules.add,
children: /*#__PURE__*/(0,jsx_runtime.jsxs)("span", {
children: ["\u8BF7\u5148\u5C06\u65B0\u7684\u7BA1\u7406\u5458\u901A\u8FC7", /*#__PURE__*/(0,jsx_runtime.jsx)("a", {
className: ChangeManagerModalmodules.colorBlue,
onClick: handleAddCollaborator,
children: "\"\u6DFB\u52A0\u5408\u4F5C\u8005\""
}), "\u52A0\u5165\u5408\u4F5C\u8005\u5217\u8868"]
})
})
})]
})
});
};
/* harmony default export */ var components_ChangeManagerModal = ((0,_umi_production_exports.connect)(function (_ref4) {
var shixunsDetail = _ref4.shixunsDetail,
loading = _ref4.loading,
globalSetting = _ref4.globalSetting;
return {
shixunsDetail: shixunsDetail,
globalSetting: globalSetting,
loading: loading
};
})(ChangeManagerModal));
// EXTERNAL MODULE: ./node_modules/_antd@5.9.0@antd/es/tabs/index.js + 24 modules
var tabs = __webpack_require__(99313);
// EXTERNAL MODULE: ./src/components/SelectUser/index.tsx
var SelectUser = __webpack_require__(63683);
// EXTERNAL MODULE: ./src/components/SelectTeachGroup/index.tsx + 8 modules
var SelectTeachGroup = __webpack_require__(78222);
;// CONCATENATED MODULE: ./src/pages/Shixuns/Detail/Collaborators/components/AddCollaborator/index.tsx
var TabPane = tabs/* default */.Z.TabPane;
/* harmony default export */ var AddCollaborator = (function (_ref) {
var visible = _ref.visible,
onCancel = _ref.onCancel,
onSelectGroup = _ref.onSelectGroup,
shixunId = _ref.shixunId,
onSelectCollaborator = _ref.onSelectCollaborator;
return /*#__PURE__*/(0,jsx_runtime.jsx)(modal/* default */.Z, {
title: "\u6DFB\u52A0\u5408\u4F5C\u8005",
open: visible,
width: 1100,
centered: true,
keyboard: false,
onCancel: onCancel,
maskClosable: false,
bodyStyle: {
minHeight: 400,
padding: '0 20px 20px 20px'
},
footer: null,
children: /*#__PURE__*/(0,jsx_runtime.jsxs)(tabs/* default */.Z, {
defaultActiveKey: "1",
children: [/*#__PURE__*/(0,jsx_runtime.jsx)(TabPane, {
tab: "\u641C\u7D22\u6DFB\u52A0",
children: /*#__PURE__*/(0,jsx_runtime.jsx)(SelectUser/* default */.Z, {
onCancel: onCancel,
container_type: 2,
container_id: shixunId,
onSelect: onSelectCollaborator
})
}, "1"), /*#__PURE__*/(0,jsx_runtime.jsx)(TabPane, {
tab: "\u56E2\u961F\u6DFB\u52A0",
children: /*#__PURE__*/(0,jsx_runtime.jsx)(SelectTeachGroup/* default */.Z, {
onCancel: onCancel,
onSelect: onSelectGroup
})
}, "2")]
})
});
});
;// CONCATENATED MODULE: ./src/pages/Shixuns/Detail/Collaborators/index.less?modules
// extracted by mini-css-extract-plugin
/* harmony default export */ var Collaboratorsmodules = ({"bg":"bg___sOdPb","wrap":"wrap___HoeSx","modal":"modal___t4bFU","content":"content___VMlwP","head":"head___eFHNj","headCount":"headCount___q7_8n","button":"button___OaGYh","itemWrap":"itemWrap___EgP_Y","imgWrap":"imgWrap___VcWR7","img":"img___PgTvY","manager":"manager___vGc7D","itemContent":"itemContent___JJG1i","nameWrap":"nameWrap___h4JTB","name":"name___yhHE5","actionGroup":"actionGroup___LDeZm","deleteIcon":"deleteIcon___Mmc7F","schoolWrap":"schoolWrap___Ru_DY","school":"school___zbcZj","countWrap":"countWrap___Mrp5n"});
// EXTERNAL MODULE: ./node_modules/_@ant-design_icons@5.2.6@@ant-design/icons/es/icons/DownOutlined.js + 1 modules
var DownOutlined = __webpack_require__(42884);
// EXTERNAL MODULE: ./src/components/Header/index.tsx + 11 modules
var Header = __webpack_require__(14878);
;// CONCATENATED MODULE: ./src/pages/Shixuns/Detail/Collaborators/index.tsx
var Collaborators = function Collaborators(_ref) {
var _user$userInfo, _user$userInfo2, _user$userInfo3, _shixunsDetail$detail;
var shixunsDetail = _ref.shixunsDetail,
globalSetting = _ref.globalSetting,
loading = _ref.loading,
user = _ref.user,
dispatch = _ref.dispatch;
var paramsRouter = (0,_umi_production_exports.useParams)();
var shixunId = (0,_react_17_0_2_react.useRef)();
var _useState = (0,_react_17_0_2_react.useState)(0),
_useState2 = slicedToArray_default()(_useState, 2),
count = _useState2[0],
setCount = _useState2[1];
var _useState3 = (0,_react_17_0_2_react.useState)([]),
_useState4 = slicedToArray_default()(_useState3, 2),
collaboratorList = _useState4[0],
setCollaboratorList = _useState4[1];
var _useState5 = (0,_react_17_0_2_react.useState)({
id: null,
page: 1
}),
_useState6 = slicedToArray_default()(_useState5, 2),
params = _useState6[0],
setParams = _useState6[1];
var editable = (_user$userInfo = user.userInfo) === null || _user$userInfo === void 0 || (_user$userInfo = _user$userInfo.shixun) === null || _user$userInfo === void 0 ? void 0 : _user$userInfo.editable;
var isAdminOrCreator = ((_user$userInfo2 = user.userInfo) === null || _user$userInfo2 === void 0 ? void 0 : _user$userInfo2.role) <= 2 || ((_user$userInfo3 = user.userInfo) === null || _user$userInfo3 === void 0 || (_user$userInfo3 = _user$userInfo3.shixun) === null || _user$userInfo3 === void 0 ? void 0 : _user$userInfo3.is_creator);
(0,_react_17_0_2_react.useEffect)(function () {
shixunId.current = paramsRouter.id;
params.id = shixunId.current;
setParams(params);
getCollaboratorsData(params);
}, []);
var getCollaboratorsData = /*#__PURE__*/function () {
var _ref2 = asyncToGenerator_default()( /*#__PURE__*/regeneratorRuntime_default()().mark(function _callee(query) {
var res;
return regeneratorRuntime_default()().wrap(function _callee$(_context) {
while (1) switch (_context.prev = _context.next) {
case 0:
_context.next = 2;
return dispatch({
type: 'shixunsDetail/getCollaboratorsData',
payload: query
});
case 2:
res = _context.sent;
if (res) {
setCollaboratorList(res.members || []);
setCount(res.member_count);
}
case 4:
case "end":
return _context.stop();
}
}, _callee);
}));
return function getCollaboratorsData(_x) {
return _ref2.apply(this, arguments);
};
}();
var handleReloadData = /*#__PURE__*/function () {
var _ref3 = asyncToGenerator_default()( /*#__PURE__*/regeneratorRuntime_default()().mark(function _callee2() {
var courseParams;
return regeneratorRuntime_default()().wrap(function _callee2$(_context2) {
while (1) switch (_context2.prev = _context2.next) {
case 0:
params.page = 1;
setParams(params);
courseParams = (0,Header/* getCourseParam */.g)();
_context2.next = 5;
return dispatch({
type: 'user/getUserInfo',
payload: courseParams
});
case 5:
_context2.next = 7;
return getCollaboratorsData(params);
case 7:
case "end":
return _context2.stop();
}
}, _callee2);
}));
return function handleReloadData() {
return _ref3.apply(this, arguments);
};
}();
var handleChangePage = function handleChangePage(page) {
params.page = page;
setParams(params);
getCollaboratorsData(params);
};
var handleDelete = function handleDelete(userId) {
modal/* default */.Z.confirm({
centered: true,
okText: '确定',
cancelText: '取消',
title: "提示",
content: /*#__PURE__*/(0,jsx_runtime.jsx)("div", {
className: Collaboratorsmodules.modal,
children: "\u786E\u5B9A\u8981\u5220\u9664\u5417\uFF1F"
}),
onOk: function () {
var _onOk = asyncToGenerator_default()( /*#__PURE__*/regeneratorRuntime_default()().mark(function _callee3() {
var _user$userInfo4;
var res;
return regeneratorRuntime_default()().wrap(function _callee3$(_context3) {
while (1) switch (_context3.prev = _context3.next) {
case 0:
_context3.next = 2;
return dispatch({
type: 'shixunsDetail/deleteCollaborators',
payload: {
id: shixunId.current,
userId: userId
}
});
case 2:
res = _context3.sent;
if (!(((_user$userInfo4 = user.userInfo) === null || _user$userInfo4 === void 0 ? void 0 : _user$userInfo4.user_id) === userId)) {
_context3.next = 6;
break;
}
_umi_production_exports.history.push('/shixuns');
return _context3.abrupt("return");
case 6:
message/* default */.ZP.info(res === null || res === void 0 ? void 0 : res.message);
params.page = 1;
setParams(params);
getCollaboratorsData(params);
case 10:
case "end":
return _context3.stop();
}
}, _callee3);
}));
function onOk() {
return _onOk.apply(this, arguments);
}
return onOk;
}()
});
};
var handleexit = function handleexit(userId) {
modal/* default */.Z.confirm({
centered: true,
okText: '确定',
cancelText: '取消',
title: "提示",
content: /*#__PURE__*/(0,jsx_runtime.jsx)("div", {
className: Collaboratorsmodules.modal,
children: "\u786E\u5B9A\u8981\u9000\u51FA\u5417\uFF1F"
}),
onOk: function () {
var _onOk2 = asyncToGenerator_default()( /*#__PURE__*/regeneratorRuntime_default()().mark(function _callee4() {
var _user$userInfo5;
var res;
return regeneratorRuntime_default()().wrap(function _callee4$(_context4) {
while (1) switch (_context4.prev = _context4.next) {
case 0:
_context4.next = 2;
return dispatch({
type: 'shixunsDetail/deleteCollaborators',
payload: {
id: shixunId.current,
userId: userId
}
});
case 2:
res = _context4.sent;
if (!(((_user$userInfo5 = user.userInfo) === null || _user$userInfo5 === void 0 ? void 0 : _user$userInfo5.user_id) === userId)) {
_context4.next = 6;
break;
}
_umi_production_exports.history.push('/shixuns');
return _context4.abrupt("return");
case 6:
message/* default */.ZP.info(res === null || res === void 0 ? void 0 : res.message);
params.page = 1;
setParams(params);
getCollaboratorsData(params);
case 10:
case "end":
return _context4.stop();
}
}, _callee4);
}));
function onOk() {
return _onOk2.apply(this, arguments);
}
return onOk;
}()
});
};
var handleChangeManager = function handleChangeManager() {
dispatch({
type: 'shixunsDetail/setActionTabs',
payload: {
key: 'Collaborators-ChangeManager',
params: {
id: shixunId.current
}
}
});
};
function onTriggerEditor(_x2, _x3, _x4, _x5) {
return _onTriggerEditor.apply(this, arguments);
}
function _onTriggerEditor() {
_onTriggerEditor = asyncToGenerator_default()( /*#__PURE__*/regeneratorRuntime_default()().mark(function _callee7(identifier, user_id, editable, userName) {
return regeneratorRuntime_default()().wrap(function _callee7$(_context7) {
while (1) switch (_context7.prev = _context7.next) {
case 0:
_context7.next = 2;
return dispatch({
type: 'shixunsDetail/updateCollaboratorEditable',
payload: {
identifier: identifier,
user_id: user_id,
editable: editable ? 0 : 1
}
});
case 2:
getCollaboratorsData(params);
// }
// })
case 3:
case "end":
return _context7.stop();
}
}, _callee7);
}));
return _onTriggerEditor.apply(this, arguments);
}
var handleAddCollaborator = function handleAddCollaborator() {
dispatch({
type: 'shixunsDetail/setActionTabs',
payload: {
key: 'Collaborators-AddCollaborator',
params: {
id: shixunId.current
}
}
});
};
function onCancel() {
dispatch({
type: 'shixunsDetail/setActionTabs',
payload: {}
});
}
var AddCollaboratorOption = {
visible: shixunsDetail.actionTabs.key === 'Collaborators-AddCollaborator',
onCancel: onCancel,
shixunId: shixunId.current,
onSelectCollaborator: function () {
var _onSelectCollaborator = asyncToGenerator_default()( /*#__PURE__*/regeneratorRuntime_default()().mark(function _callee5(user_ids) {
var res;
return regeneratorRuntime_default()().wrap(function _callee5$(_context5) {
while (1) switch (_context5.prev = _context5.next) {
case 0:
onCancel();
_context5.next = 3;
return dispatch({
type: 'shixunsDetail/addCollaborator',
payload: {
id: shixunId.current,
user_ids: user_ids
}
});
case 3:
res = _context5.sent;
if (res) {
message/* default */.ZP.success('添加成功');
handleReloadData();
}
case 5:
case "end":
return _context5.stop();
}
}, _callee5);
}));
function onSelectCollaborator(_x6) {
return _onSelectCollaborator.apply(this, arguments);
}
return onSelectCollaborator;
}(),
onSelectGroup: function () {
var _onSelectGroup = asyncToGenerator_default()( /*#__PURE__*/regeneratorRuntime_default()().mark(function _callee6(group_id) {
var res;
return regeneratorRuntime_default()().wrap(function _callee6$(_context6) {
while (1) switch (_context6.prev = _context6.next) {
case 0:
onCancel();
_context6.next = 3;
return dispatch({
type: 'shixunsDetail/addTeachGroupMember',
payload: {
identifier: shixunId.current,
group_id: group_id.group_id
}
});
case 3:
res = _context6.sent;
if (res) {
message/* default */.ZP.success('添加成功');
handleReloadData();
}
case 5:
case "end":
return _context6.stop();
}
}, _callee6);
}));
function onSelectGroup(_x7) {
return _onSelectGroup.apply(this, arguments);
}
return onSelectGroup;
}()
};
return /*#__PURE__*/(0,jsx_runtime.jsxs)("section", {
className: Collaboratorsmodules.bg,
children: [/*#__PURE__*/(0,jsx_runtime.jsxs)("div", {
className: Collaboratorsmodules.wrap,
children: [/*#__PURE__*/(0,jsx_runtime.jsxs)("div", {
className: Collaboratorsmodules.content,
children: [((_shixunsDetail$detail = shixunsDetail.detail) === null || _shixunsDetail$detail === void 0 ? void 0 : _shixunsDetail$detail.identity) < 5 && /*#__PURE__*/(0,jsx_runtime.jsxs)("div", {
className: Collaboratorsmodules.head,
children: [/*#__PURE__*/(0,jsx_runtime.jsxs)("span", {
className: Collaboratorsmodules.headCount,
children: [count, "\u4EBA"]
}), /*#__PURE__*/(0,jsx_runtime.jsxs)("div", {
children: [isAdminOrCreator && /*#__PURE__*/(0,jsx_runtime.jsx)(es_button/* default */.ZP, {
type: "primary",
ghost: true,
className: Collaboratorsmodules.button,
onClick: handleChangeManager,
children: "\u66F4\u6362\u7BA1\u7406\u5458"
}), editable && /*#__PURE__*/(0,jsx_runtime.jsx)(es_button/* default */.ZP, {
type: "primary",
className: Collaboratorsmodules.button,
onClick: handleAddCollaborator,
children: "\u6DFB\u52A0\u5408\u4F5C\u8005"
})]
})]
}), /*#__PURE__*/(0,jsx_runtime.jsx)("div", {
className: Collaboratorsmodules.list,
children: /*#__PURE__*/(0,jsx_runtime.jsx)(skeleton/* default */.Z, {
loading: loading.effects['shixunsDetail/getCollaboratorsData'],
active: true,
avatar: {
size: 40
},
paragraph: {
rows: 3
},
className: "mt30",
children: collaboratorList.map(function (item, index) {
var _item$user, _item$user2, _item$user3, _item$user4, _item$user5, _item$user7, _user$userInfo6, _user$userInfo7, _item$user9, _item$user11;
return /*#__PURE__*/(0,jsx_runtime.jsxs)("div", {
className: Collaboratorsmodules.itemWrap,
children: [/*#__PURE__*/(0,jsx_runtime.jsxs)("a", {
href: (_item$user = item.user) === null || _item$user === void 0 ? void 0 : _item$user.user_url,
target: "_blank",
className: Collaboratorsmodules.imgWrap,
children: [/*#__PURE__*/(0,jsx_runtime.jsx)("img", {
alt: "\u7528\u6237\u5934\u50CF",
height: "48",
width: "48",
className: Collaboratorsmodules.img,
src: "".concat(env/* default */.Z.IMG_SERVER, "/images/").concat((_item$user2 = item.user) === null || _item$user2 === void 0 ? void 0 : _item$user2.image_url)
}), ((_item$user3 = item.user) === null || _item$user3 === void 0 ? void 0 : _item$user3.shixun_manager) && /*#__PURE__*/(0,jsx_runtime.jsx)("span", {
className: Collaboratorsmodules.manager,
children: "\u521B\u5EFA\u8005"
})]
}), /*#__PURE__*/(0,jsx_runtime.jsxs)("div", {
className: Collaboratorsmodules.itemContent,
children: [/*#__PURE__*/(0,jsx_runtime.jsxs)("p", {
className: Collaboratorsmodules.nameWrap,
children: [/*#__PURE__*/(0,jsx_runtime.jsx)("a", {
href: item.user.user_url,
target: "_blank",
className: Collaboratorsmodules.name,
children: (_item$user4 = item.user) === null || _item$user4 === void 0 ? void 0 : _item$user4.name
}), /*#__PURE__*/(0,jsx_runtime.jsxs)("div", {
className: Collaboratorsmodules.actionGroup,
children: [!isAdminOrCreator ? item.editable ? /*#__PURE__*/(0,jsx_runtime.jsx)("span", {
className: "c-green",
children: "\u53EF\u7F16\u8F91\u5B9E\u8BAD"
}) : /*#__PURE__*/(0,jsx_runtime.jsx)("span", {
className: "c-grey-c",
children: "\u4E0D\u53EF\u7F16\u8F91\u5B9E\u8BAD"
}) : !((_item$user5 = item.user) !== null && _item$user5 !== void 0 && _item$user5.shixun_manager) ? /*#__PURE__*/(0,jsx_runtime.jsx)(dropdown/* default */.Z, {
dropdownRender: function dropdownRender() {
return /*#__PURE__*/(0,jsx_runtime.jsxs)(menu/* default */.Z, {
selectedKeys: [item.editable ? '1' : '2'],
onClick: function onClick() {
var _item$user6;
onTriggerEditor(shixunsDetail.detail.identifier, item.user.user_id, item.editable, (_item$user6 = item.user) === null || _item$user6 === void 0 ? void 0 : _item$user6.name);
},
children: [/*#__PURE__*/(0,jsx_runtime.jsx)(menu/* default */.Z.Item, {
children: "\u7F16\u8F91\u6743\u9650"
}, 1), /*#__PURE__*/(0,jsx_runtime.jsx)(menu/* default */.Z.Item, {
children: "\u67E5\u770B\u6743\u9650"
}, 2)]
});
},
children: /*#__PURE__*/(0,jsx_runtime.jsxs)("div", {
children: [item.editable ? /*#__PURE__*/(0,jsx_runtime.jsx)("span", {
style: {
fontSize: '16px'
},
className: "c-grey-c",
children: "\u7F16\u8F91\u6743\u9650"
}) : /*#__PURE__*/(0,jsx_runtime.jsx)("span", {
style: {
fontSize: '16px'
},
className: "c-grey-c",
children: "\u67E5\u770B\u6743\u9650"
}), " ", /*#__PURE__*/(0,jsx_runtime.jsx)(DownOutlined/* default */.Z, {
style: {
fontSize: '14px',
color: '#888888'
}
})]
})
}) : null, !((_item$user7 = item.user) !== null && _item$user7 !== void 0 && _item$user7.shixun_manager) && editable && item.user.user_id !== ((_user$userInfo6 = user.userInfo) === null || _user$userInfo6 === void 0 ? void 0 : _user$userInfo6.user_id) ? /*#__PURE__*/(0,jsx_runtime.jsx)("a", {
className: "c-grey-c",
onClick: function onClick() {
var _item$user8;
return handleDelete((_item$user8 = item.user) === null || _item$user8 === void 0 ? void 0 : _item$user8.user_id);
},
children: "\u5220\u9664"
}) : null, item.user.user_id === ((_user$userInfo7 = user.userInfo) === null || _user$userInfo7 === void 0 ? void 0 : _user$userInfo7.user_id) && !((_item$user9 = item.user) !== null && _item$user9 !== void 0 && _item$user9.shixun_manager) && /*#__PURE__*/(0,jsx_runtime.jsx)("a", {
className: "c-grey-c",
onClick: function onClick() {
var _item$user10;
return handleexit((_item$user10 = item.user) === null || _item$user10 === void 0 ? void 0 : _item$user10.user_id);
},
children: "\u9000\u51FA"
})]
})]
}), /*#__PURE__*/(0,jsx_runtime.jsx)("p", {
className: Collaboratorsmodules.schoolWrap,
children: /*#__PURE__*/(0,jsx_runtime.jsx)("span", {
className: Collaboratorsmodules.school,
children: (_item$user11 = item.user) === null || _item$user11 === void 0 ? void 0 : _item$user11.school_name
})
})]
})]
}, index);
})
})
})]
}), count > 10 && /*#__PURE__*/(0,jsx_runtime.jsx)("div", {
className: Collaboratorsmodules.countWrap,
children: /*#__PURE__*/(0,jsx_runtime.jsx)(pagination/* default */.Z, {
showQuickJumper: true,
showSizeChanger: false,
total: count,
onChange: function onChange(page) {
return handleChangePage(page);
},
pageSize: 10,
current: params.page
})
})]
}), /*#__PURE__*/(0,jsx_runtime.jsx)(Right/* default */.Z, {}), /*#__PURE__*/(0,jsx_runtime.jsx)(components_ChangeManagerModal, {
onReloadData: handleReloadData
}), /*#__PURE__*/(0,jsx_runtime.jsx)(AddCollaborator, objectSpread2_default()({}, AddCollaboratorOption))]
});
};
/* harmony default export */ var Detail_Collaborators = ((0,_umi_production_exports.connect)(function (_ref4) {
var shixunsDetail = _ref4.shixunsDetail,
loading = _ref4.loading,
globalSetting = _ref4.globalSetting,
user = _ref4.user;
return {
shixunsDetail: shixunsDetail,
globalSetting: globalSetting,
user: user,
loading: loading
};
})(Collaborators));
/***/ }),
/***/ 79250:
/*!*************************************************************************!*\
!*** ./src/pages/Shixuns/Detail/components/Right/index.tsx + 4 modules ***!
\*************************************************************************/
/***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) {
"use strict";
// EXPORTS
__webpack_require__.d(__webpack_exports__, {
Z: function() { return /* binding */ components_Right; }
});
// EXTERNAL MODULE: ./node_modules/_@babel_runtime@7.23.2@@babel/runtime/helpers/slicedToArray.js
var slicedToArray = __webpack_require__(11006);
var slicedToArray_default = /*#__PURE__*/__webpack_require__.n(slicedToArray);
// EXTERNAL MODULE: ./node_modules/_@babel_runtime@7.23.2@@babel/runtime/helpers/objectWithoutProperties.js
var objectWithoutProperties = __webpack_require__(27161);
var objectWithoutProperties_default = /*#__PURE__*/__webpack_require__.n(objectWithoutProperties);
// 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 + 8 modules
var _umi_production_exports = __webpack_require__(66660);
// EXTERNAL MODULE: ./node_modules/_antd@5.9.0@antd/es/progress/index.js + 13 modules
var progress = __webpack_require__(93948);
// EXTERNAL MODULE: ./node_modules/_antd@5.9.0@antd/es/tooltip/index.js + 3 modules
var tooltip = __webpack_require__(6848);
;// CONCATENATED MODULE: ./src/pages/Shixuns/Detail/components/Right/index.less?modules
// extracted by mini-css-extract-plugin
/* harmony default export */ var Rightmodules = ({"flex_box_center":"flex_box_center___PT9hL","flex_space_between":"flex_space_between___n2Hu5","flex_box_vertical_center":"flex_box_vertical_center___dwn6D","flex_box_center_end":"flex_box_center_end___TwHBO","flex_box_column":"flex_box_column___eAUqU","rightWrap":"rightWrap___Y_2WO","learnWrap":"learnWrap___mca1k","learnTopWrap":"learnTopWrap___cn6Tj","courseWrap":"courseWrap___N3Z6X","pathWrap":"pathWrap___QSdXs","pathImg":"pathImg___VjPqu","pathContentItem":"pathContentItem___sxOSQ","pathContentWrap":"pathContentWrap___WttwX","pathContentName":"pathContentName___evsEv","pathContent":"pathContent___fz4ds","pathContentCount":"pathContentCount___Jlv3G","recommandTrainingWrap":"recommandTrainingWrap___F1gpg","recommandContent":"recommandContent___JZYAA","recommandLevel":"recommandLevel___McDUw","color0152d9":"color0152d9___JWNjt","color999":"color999___npg2L","color888":"color888___l_1AP","color333":"color333___ec_mY","iconDeleteColor":"iconDeleteColor___aZjDG","iconMoveColor":"iconMoveColor___z4k0w","iconEditColor":"iconEditColor___wxNTY","skillWrap":"skillWrap___j6j3B","skillTopWrap":"skillTopWrap___kIJbE","time":"time___dTwAe","titleImg":"titleImg___I8kT9"});
;// CONCATENATED MODULE: ./src/assets/images/icons/learn.svg
function _createForOfIteratorHelper(o, allowArrayLike) { var it = typeof Symbol !== "undefined" && o[Symbol.iterator] || o["@@iterator"]; if (!it) { if (Array.isArray(o) || (it = _unsupportedIterableToArray(o)) || allowArrayLike && o && typeof o.length === "number") { if (it) o = it; var i = 0; var F = function F() {}; return { s: F, n: function n() { if (i >= o.length) return { done: true }; return { done: false, value: o[i++] }; }, e: function e(_e) { throw _e; }, f: F }; } throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); } var normalCompletion = true, didErr = false, err; return { s: function s() { it = it.call(o); }, n: function n() { var step = it.next(); normalCompletion = step.done; return step; }, e: function e(_e2) { didErr = true; err = _e2; }, f: function f() { try { if (!normalCompletion && it["return"] != null) it["return"](); } finally { if (didErr) throw err; } } }; }
function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === "string") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return Array.from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); }
function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) arr2[i] = arr[i]; return arr2; }
var __defProp = Object.defineProperty;
var __getOwnPropSymbols = Object.getOwnPropertySymbols;
var __hasOwnProp = Object.prototype.hasOwnProperty;
var __propIsEnum = Object.prototype.propertyIsEnumerable;
var __defNormalProp = function __defNormalProp(obj, key, value) {
return key in obj ? __defProp(obj, key, {
enumerable: true,
configurable: true,
writable: true,
value: value
}) : obj[key] = value;
};
var __spreadValues = function __spreadValues(a, b) {
for (var prop in b || (b = {})) if (__hasOwnProp.call(b, prop)) __defNormalProp(a, prop, b[prop]);
if (__getOwnPropSymbols) {
var _iterator = _createForOfIteratorHelper(__getOwnPropSymbols(b)),
_step;
try {
for (_iterator.s(); !(_step = _iterator.n()).done;) {
var prop = _step.value;
if (__propIsEnum.call(b, prop)) __defNormalProp(a, prop, b[prop]);
}
} catch (err) {
_iterator.e(err);
} finally {
_iterator.f();
}
}
return a;
};
var SvgLearn = function SvgLearn(props) {
return /* @__PURE__ */React.createElement("svg", __spreadValues({
width: 22,
height: 22,
xmlns: "http://www.w3.org/2000/svg"
}, props), /* @__PURE__ */React.createElement("title", null, "\u5B66\u4E60\u8FDB\u5EA6"), /* @__PURE__ */React.createElement("g", {
fill: "none",
fillRule: "evenodd"
}, /* @__PURE__ */React.createElement("path", {
d: "M10 2c.02 0 .03.75.032 1.839l.03 8.16H9.19l-3.932 6.005h.98L10.062 12H20c0 5.523-4.477 10-10 10S0 17.523 0 12 4.477 2 10 2Zm-.348 12.938c-.463 0-.834.147-1.113.443-.279.295-.418.693-.418 1.193 0 .453.13.819.39 1.096.261.277.606.416 1.036.416.458 0 .827-.148 1.105-.443.279-.296.418-.691.418-1.186 0-.482-.124-.855-.373-1.121-.248-.266-.597-.399-1.045-.399Zm-.039.71c.185 0 .333.074.444.221.11.147.166.358.166.631 0 .583-.209.875-.625.875-.414 0-.621-.281-.621-.844 0-.588.212-.883.636-.883Zm-3.715-3.78c-.468 0-.84.148-1.115.446-.275.299-.412.695-.412 1.19 0 .453.13.818.389 1.094.259.276.605.414 1.037.414.46 0 .83-.147 1.105-.442.276-.294.414-.686.414-1.175 0-.477-.124-.85-.373-1.122-.248-.27-.597-.406-1.045-.406Zm-.023.71c.401 0 .602.283.602.848 0 .583-.21.875-.63.875-.41 0-.617-.28-.617-.84 0-.589.215-.883.645-.883Z",
fill: "#1890FF"
}), /* @__PURE__ */React.createElement("path", {
d: "M11 0c5.982 0 10.848 4.774 10.997 10.72L22 11h-3.667c0-3.974-3.16-7.21-7.105-7.33L11 3.667V0Z",
fill: "#B6D0FC",
fillRule: "nonzero"
})));
};
/* harmony default export */ var learn = ("data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMjIiIGhlaWdodD0iMjIiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyI+PGcgZmlsbD0ibm9uZSIgZmlsbC1ydWxlPSJldmVub2RkIj48cGF0aCBkPSJNMTAgMmMuMDIgMCAuMDMuNzUuMDMyIDEuODM5bC4wMyA4LjE2SDkuMTlsLTMuOTMyIDYuMDA1aC45OEwxMC4wNjIgMTJIMjBjMCA1LjUyMy00LjQ3NyAxMC0xMCAxMFMwIDE3LjUyMyAwIDEyIDQuNDc3IDIgMTAgMlptLS4zNDggMTIuOTM4Yy0uNDYzIDAtLjgzNC4xNDctMS4xMTMuNDQzLS4yNzkuMjk1LS40MTguNjkzLS40MTggMS4xOTMgMCAuNDUzLjEzLjgxOS4zOSAxLjA5Ni4yNjEuMjc3LjYwNi40MTYgMS4wMzYuNDE2LjQ1OCAwIC44MjctLjE0OCAxLjEwNS0uNDQzLjI3OS0uMjk2LjQxOC0uNjkxLjQxOC0xLjE4NiAwLS40ODItLjEyNC0uODU1LS4zNzMtMS4xMjEtLjI0OC0uMjY2LS41OTctLjM5OS0xLjA0NS0uMzk5Wm0tLjAzOS43MWMuMTg1IDAgLjMzMy4wNzQuNDQ0LjIyMS4xMS4xNDcuMTY2LjM1OC4xNjYuNjMxIDAgLjU4My0uMjA5Ljg3NS0uNjI1Ljg3NS0uNDE0IDAtLjYyMS0uMjgxLS42MjEtLjg0NCAwLS41ODguMjEyLS44ODMuNjM2LS44ODNabS0zLjcxNS0zLjc4Yy0uNDY4IDAtLjg0LjE0OC0xLjExNS40NDYtLjI3NS4yOTktLjQxMi42OTUtLjQxMiAxLjE5IDAgLjQ1My4xMy44MTguMzg5IDEuMDk0LjI1OS4yNzYuNjA1LjQxNCAxLjAzNy40MTQuNDYgMCAuODMtLjE0NyAxLjEwNS0uNDQyLjI3Ni0uMjk0LjQxNC0uNjg2LjQxNC0xLjE3NSAwLS40NzctLjEyNC0uODUtLjM3My0xLjEyMi0uMjQ4LS4yNy0uNTk3LS40MDYtMS4wNDUtLjQwNlptLS4wMjMuNzFjLjQwMSAwIC42MDIuMjgzLjYwMi44NDggMCAuNTgzLS4yMS44NzUtLjYzLjg3NS0uNDEgMC0uNjE3LS4yOC0uNjE3LS44NCAwLS41ODkuMjE1LS44ODMuNjQ1LS44ODNaIiBmaWxsPSIjMTg5MEZGIi8+PHBhdGggZD0iTTExIDBjNS45ODIgMCAxMC44NDggNC43NzQgMTAuOTk3IDEwLjcyTDIyIDExaC0zLjY2N2MwLTMuOTc0LTMuMTYtNy4yMS03LjEwNS03LjMzTDExIDMuNjY3VjBaIiBmaWxsPSIjQjZEMEZDIiBmaWxsLXJ1bGU9Im5vbnplcm8iLz48L2c+PC9zdmc+");
;// CONCATENATED MODULE: ./src/assets/images/icons/course.svg
function course_createForOfIteratorHelper(o, allowArrayLike) { var it = typeof Symbol !== "undefined" && o[Symbol.iterator] || o["@@iterator"]; if (!it) { if (Array.isArray(o) || (it = course_unsupportedIterableToArray(o)) || allowArrayLike && o && typeof o.length === "number") { if (it) o = it; var i = 0; var F = function F() {}; return { s: F, n: function n() { if (i >= o.length) return { done: true }; return { done: false, value: o[i++] }; }, e: function e(_e) { throw _e; }, f: F }; } throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); } var normalCompletion = true, didErr = false, err; return { s: function s() { it = it.call(o); }, n: function n() { var step = it.next(); normalCompletion = step.done; return step; }, e: function e(_e2) { didErr = true; err = _e2; }, f: function f() { try { if (!normalCompletion && it["return"] != null) it["return"](); } finally { if (didErr) throw err; } } }; }
function course_unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === "string") return course_arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return Array.from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return course_arrayLikeToArray(o, minLen); }
function course_arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) arr2[i] = arr[i]; return arr2; }
var course_defProp = Object.defineProperty;
var course_getOwnPropSymbols = Object.getOwnPropertySymbols;
var course_hasOwnProp = Object.prototype.hasOwnProperty;
var course_propIsEnum = Object.prototype.propertyIsEnumerable;
var course_defNormalProp = function __defNormalProp(obj, key, value) {
return key in obj ? course_defProp(obj, key, {
enumerable: true,
configurable: true,
writable: true,
value: value
}) : obj[key] = value;
};
var course_spreadValues = function __spreadValues(a, b) {
for (var prop in b || (b = {})) if (course_hasOwnProp.call(b, prop)) course_defNormalProp(a, prop, b[prop]);
if (course_getOwnPropSymbols) {
var _iterator = course_createForOfIteratorHelper(course_getOwnPropSymbols(b)),
_step;
try {
for (_iterator.s(); !(_step = _iterator.n()).done;) {
var prop = _step.value;
if (course_propIsEnum.call(b, prop)) course_defNormalProp(a, prop, b[prop]);
}
} catch (err) {
_iterator.e(err);
} finally {
_iterator.f();
}
}
return a;
};
var SvgCourse = function SvgCourse(props) {
return /* @__PURE__ */React.createElement("svg", course_spreadValues({
width: 22,
height: 20,
xmlns: "http://www.w3.org/2000/svg"
}, props), /* @__PURE__ */React.createElement("title", null, "\u6240\u5C5E\u8BFE\u7A0B"), /* @__PURE__ */React.createElement("g", {
fillRule: "nonzero",
fill: "none"
}, /* @__PURE__ */React.createElement("path", {
d: "M1.248.026h2.495c.833 0 1.249.415 1.249 1.243v17.39c0 .829-.416 1.243-1.249 1.243H1.248C.416 19.902 0 19.488 0 18.66V1.27C0 .44.416.025 1.248.025ZM7.488.026h2.496c.832 0 1.248.415 1.248 1.243v17.39c0 .829-.416 1.243-1.248 1.243H7.488c-.832 0-1.248-.414-1.248-1.242V1.27c0-.83.416-1.244 1.248-1.244Z",
fill: "#5091FF"
}), /* @__PURE__ */React.createElement("path", {
d: "m13.404.688 2.412-.646c.32-.085.66-.04.947.124.287.165.496.437.582.755l4.522 16.8a1.242 1.242 0 0 1-.883 1.52l-2.411.644a1.249 1.249 0 0 1-1.528-.879L12.522 2.208a1.238 1.238 0 0 1 .124-.943c.166-.285.439-.494.758-.579v.002Z",
fill: "#B6D0FC"
})));
};
/* harmony default export */ var course = ("data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMjIiIGhlaWdodD0iMjAiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyI+PGcgZmlsbC1ydWxlPSJub256ZXJvIiBmaWxsPSJub25lIj48cGF0aCBkPSJNMS4yNDguMDI2aDIuNDk1Yy44MzMgMCAxLjI0OS40MTUgMS4yNDkgMS4yNDN2MTcuMzljMCAuODI5LS40MTYgMS4yNDMtMS4yNDkgMS4yNDNIMS4yNDhDLjQxNiAxOS45MDIgMCAxOS40ODggMCAxOC42NlYxLjI3QzAgLjQ0LjQxNi4wMjUgMS4yNDguMDI1Wk03LjQ4OC4wMjZoMi40OTZjLjgzMiAwIDEuMjQ4LjQxNSAxLjI0OCAxLjI0M3YxNy4zOWMwIC44MjktLjQxNiAxLjI0My0xLjI0OCAxLjI0M0g3LjQ4OGMtLjgzMiAwLTEuMjQ4LS40MTQtMS4yNDgtMS4yNDJWMS4yN2MwLS44My40MTYtMS4yNDQgMS4yNDgtMS4yNDRaIiBmaWxsPSIjNTA5MUZGIi8+PHBhdGggZD0ibTEzLjQwNC42ODggMi40MTItLjY0NmMuMzItLjA4NS42Ni0uMDQuOTQ3LjEyNC4yODcuMTY1LjQ5Ni40MzcuNTgyLjc1NWw0LjUyMiAxNi44YTEuMjQyIDEuMjQyIDAgMCAxLS44ODMgMS41MmwtMi40MTEuNjQ0YTEuMjQ5IDEuMjQ5IDAgMCAxLTEuNTI4LS44NzlMMTIuNTIyIDIuMjA4YTEuMjM4IDEuMjM4IDAgMCAxIC4xMjQtLjk0M2MuMTY2LS4yODUuNDM5LS40OTQuNzU4LS41Nzl2LjAwMloiIGZpbGw9IiNCNkQwRkMiLz48L2c+PC9zdmc+");
;// CONCATENATED MODULE: ./src/assets/images/icons/star.svg
function star_createForOfIteratorHelper(o, allowArrayLike) { var it = typeof Symbol !== "undefined" && o[Symbol.iterator] || o["@@iterator"]; if (!it) { if (Array.isArray(o) || (it = star_unsupportedIterableToArray(o)) || allowArrayLike && o && typeof o.length === "number") { if (it) o = it; var i = 0; var F = function F() {}; return { s: F, n: function n() { if (i >= o.length) return { done: true }; return { done: false, value: o[i++] }; }, e: function e(_e) { throw _e; }, f: F }; } throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); } var normalCompletion = true, didErr = false, err; return { s: function s() { it = it.call(o); }, n: function n() { var step = it.next(); normalCompletion = step.done; return step; }, e: function e(_e2) { didErr = true; err = _e2; }, f: function f() { try { if (!normalCompletion && it["return"] != null) it["return"](); } finally { if (didErr) throw err; } } }; }
function star_unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === "string") return star_arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return Array.from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return star_arrayLikeToArray(o, minLen); }
function star_arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) arr2[i] = arr[i]; return arr2; }
var star_defProp = Object.defineProperty;
var star_getOwnPropSymbols = Object.getOwnPropertySymbols;
var star_hasOwnProp = Object.prototype.hasOwnProperty;
var star_propIsEnum = Object.prototype.propertyIsEnumerable;
var star_defNormalProp = function __defNormalProp(obj, key, value) {
return key in obj ? star_defProp(obj, key, {
enumerable: true,
configurable: true,
writable: true,
value: value
}) : obj[key] = value;
};
var star_spreadValues = function __spreadValues(a, b) {
for (var prop in b || (b = {})) if (star_hasOwnProp.call(b, prop)) star_defNormalProp(a, prop, b[prop]);
if (star_getOwnPropSymbols) {
var _iterator = star_createForOfIteratorHelper(star_getOwnPropSymbols(b)),
_step;
try {
for (_iterator.s(); !(_step = _iterator.n()).done;) {
var prop = _step.value;
if (star_propIsEnum.call(b, prop)) star_defNormalProp(a, prop, b[prop]);
}
} catch (err) {
_iterator.e(err);
} finally {
_iterator.f();
}
}
return a;
};
var SvgStar = function SvgStar(props) {
return /* @__PURE__ */React.createElement("svg", star_spreadValues({
width: 22,
height: 22,
xmlns: "http://www.w3.org/2000/svg"
}, props), /* @__PURE__ */React.createElement("title", null, "\u63A8\u8350\u5B9E\u8BAD"), /* @__PURE__ */React.createElement("g", {
fillRule: "nonzero",
fill: "none"
}, /* @__PURE__ */React.createElement("path", {
d: "M15.503 21.896a2.067 2.067 0 0 1-.87-.201 451.987 451.987 0 0 1-4.376-2.11c-1.466.69-2.931 1.384-4.396 2.08-.674.299-1.33.26-1.816-.096-.458-.335-.685-.912-.624-1.579.173-1.56.465-3.693.574-4.485a188.029 188.029 0 0 1-3.587-3.922 1.5 1.5 0 0 1-.3-1.51c.213-.574.76-.982 1.472-1.086l4.655-.853A512.95 512.95 0 0 1 8.787 3.73c.717-1.344 1.426-1.344 1.8-1.209.407.134.792.531 1.177 1.223.829 1.433 2.08 3.642 2.504 4.391l4.61.858c.678.1 1.218.507 1.428 1.084a1.507 1.507 0 0 1-.286 1.504 192.808 192.808 0 0 1-3.556 3.944c.104.788.388 2.927.573 4.479.071.685-.152 1.269-.616 1.609a1.55 1.55 0 0 1-.916.284h-.002Z",
fill: "#5091FF"
}), /* @__PURE__ */React.createElement("path", {
d: "M21.706 4.462a.557.557 0 0 1-.247.073c-.45.03-1.122.067-1.397.08l-.778 1.2c-.122.18-.29.265-.464.24-.163-.02-.306-.14-.39-.329a60.81 60.81 0 0 1-.529-1.278 53.009 53.009 0 0 1-1.476-.518.475.475 0 0 1-.3-.36.533.533 0 0 1 .2-.505l1.025-.91c-.011-.516-.02-1.032-.028-1.548-.024-.463.15-.568.264-.585.121-.026.275.024.474.151.419.262 1.06.667 1.277.804l1.27-.448a.49.49 0 0 1 .515.08c.124.11.183.28.155.441-.09.526-.186 1.052-.29 1.574.145.194.536.722.814 1.11.12.172.152.36.088.518a.435.435 0 0 1-.185.21h.002ZM2.859 5.83a.287.287 0 0 1-.093-.091 62.17 62.17 0 0 1-.382-.603 49.99 49.99 0 0 0-.7-.045c-.106-.01-.185-.063-.218-.146a.276.276 0 0 1 .04-.255c.14-.197.334-.46.407-.557a28.397 28.397 0 0 1-.149-.786.243.243 0 0 1 .076-.223.25.25 0 0 1 .264-.037l.64.228c.108-.068.431-.27.644-.398.19-.128.278-.075.314-.03.04.047.059.128.054.25l-.019.768.506.453a.258.258 0 0 1 .095.249.238.238 0 0 1-.147.178c-.245.092-.49.18-.736.265-.047.113-.171.42-.264.64-.044.095-.115.159-.197.168a.208.208 0 0 1-.135-.028Z",
fill: "#B6D0FC"
})));
};
/* harmony default export */ var star = ("data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMjIiIGhlaWdodD0iMjIiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyI+PGcgZmlsbC1ydWxlPSJub256ZXJvIiBmaWxsPSJub25lIj48cGF0aCBkPSJNMTUuNTAzIDIxLjg5NmEyLjA2NyAyLjA2NyAwIDAgMS0uODctLjIwMSA0NTEuOTg3IDQ1MS45ODcgMCAwIDEtNC4zNzYtMi4xMWMtMS40NjYuNjktMi45MzEgMS4zODQtNC4zOTYgMi4wOC0uNjc0LjI5OS0xLjMzLjI2LTEuODE2LS4wOTYtLjQ1OC0uMzM1LS42ODUtLjkxMi0uNjI0LTEuNTc5LjE3My0xLjU2LjQ2NS0zLjY5My41NzQtNC40ODVhMTg4LjAyOSAxODguMDI5IDAgMCAxLTMuNTg3LTMuOTIyIDEuNSAxLjUgMCAwIDEtLjMtMS41MWMuMjEzLS41NzQuNzYtLjk4MiAxLjQ3Mi0xLjA4Nmw0LjY1NS0uODUzQTUxMi45NSA1MTIuOTUgMCAwIDEgOC43ODcgMy43M2MuNzE3LTEuMzQ0IDEuNDI2LTEuMzQ0IDEuOC0xLjIwOS40MDcuMTM0Ljc5Mi41MzEgMS4xNzcgMS4yMjMuODI5IDEuNDMzIDIuMDggMy42NDIgMi41MDQgNC4zOTFsNC42MS44NThjLjY3OC4xIDEuMjE4LjUwNyAxLjQyOCAxLjA4NGExLjUwNyAxLjUwNyAwIDAgMS0uMjg2IDEuNTA0IDE5Mi44MDggMTkyLjgwOCAwIDAgMS0zLjU1NiAzLjk0NGMuMTA0Ljc4OC4zODggMi45MjcuNTczIDQuNDc5LjA3MS42ODUtLjE1MiAxLjI2OS0uNjE2IDEuNjA5YTEuNTUgMS41NSAwIDAgMS0uOTE2LjI4NGgtLjAwMloiIGZpbGw9IiM1MDkxRkYiLz48cGF0aCBkPSJNMjEuNzA2IDQuNDYyYS41NTcuNTU3IDAgMCAxLS4yNDcuMDczYy0uNDUuMDMtMS4xMjIuMDY3LTEuMzk3LjA4bC0uNzc4IDEuMmMtLjEyMi4xOC0uMjkuMjY1LS40NjQuMjQtLjE2My0uMDItLjMwNi0uMTQtLjM5LS4zMjlhNjAuODEgNjAuODEgMCAwIDEtLjUyOS0xLjI3OCA1My4wMDkgNTMuMDA5IDAgMCAxLTEuNDc2LS41MTguNDc1LjQ3NSAwIDAgMS0uMy0uMzYuNTMzLjUzMyAwIDAgMSAuMi0uNTA1bDEuMDI1LS45MWMtLjAxMS0uNTE2LS4wMi0xLjAzMi0uMDI4LTEuNTQ4LS4wMjQtLjQ2My4xNS0uNTY4LjI2NC0uNTg1LjEyMS0uMDI2LjI3NS4wMjQuNDc0LjE1MS40MTkuMjYyIDEuMDYuNjY3IDEuMjc3LjgwNGwxLjI3LS40NDhhLjQ5LjQ5IDAgMCAxIC41MTUuMDhjLjEyNC4xMS4xODMuMjguMTU1LjQ0MS0uMDkuNTI2LS4xODYgMS4wNTItLjI5IDEuNTc0LjE0NS4xOTQuNTM2LjcyMi44MTQgMS4xMS4xMi4xNzIuMTUyLjM2LjA4OC41MThhLjQzNS40MzUgMCAwIDEtLjE4NS4yMWguMDAyWk0yLjg1OSA1LjgzYS4yODcuMjg3IDAgMCAxLS4wOTMtLjA5MSA2Mi4xNyA2Mi4xNyAwIDAgMS0uMzgyLS42MDMgNDkuOTkgNDkuOTkgMCAwIDAtLjctLjA0NWMtLjEwNi0uMDEtLjE4NS0uMDYzLS4yMTgtLjE0NmEuMjc2LjI3NiAwIDAgMSAuMDQtLjI1NWMuMTQtLjE5Ny4zMzQtLjQ2LjQwNy0uNTU3YTI4LjM5NyAyOC4zOTcgMCAwIDEtLjE0OS0uNzg2LjI0My4yNDMgMCAwIDEgLjA3Ni0uMjIzLjI1LjI1IDAgMCAxIC4yNjQtLjAzN2wuNjQuMjI4Yy4xMDgtLjA2OC40MzEtLjI3LjY0NC0uMzk4LjE5LS4xMjguMjc4LS4wNzUuMzE0LS4wMy4wNC4wNDcuMDU5LjEyOC4wNTQuMjVsLS4wMTkuNzY4LjUwNi40NTNhLjI1OC4yNTggMCAwIDEgLjA5NS4yNDkuMjM4LjIzOCAwIDAgMS0uMTQ3LjE3OGMtLjI0NS4wOTItLjQ5LjE4LS43MzYuMjY1LS4wNDcuMTEzLS4xNzEuNDItLjI2NC42NC0uMDQ0LjA5NS0uMTE1LjE1OS0uMTk3LjE2OGEuMjA4LjIwOCAwIDAgMS0uMTM1LS4wMjhaIiBmaWxsPSIjQjZEMEZDIi8+PC9nPjwvc3ZnPg==");
// EXTERNAL MODULE: ./node_modules/_echarts-for-react@2.0.16@echarts-for-react/lib/index.js
var lib = __webpack_require__(42441);
// EXTERNAL MODULE: ./src/components/ImagesIcon/index.ts + 32 modules
var ImagesIcon = __webpack_require__(19770);
// EXTERNAL MODULE: ./node_modules/_echarts-wordcloud@1.1.3@echarts-wordcloud/index.js
var _echarts_wordcloud_1_1_3_echarts_wordcloud = __webpack_require__(56047);
// EXTERNAL MODULE: ./node_modules/_react@17.0.2@react/jsx-runtime.js
var jsx_runtime = __webpack_require__(37712);
;// CONCATENATED MODULE: ./src/pages/Shixuns/Detail/components/Right/index.tsx
var _excluded = ["shixunsDetail", "user", "globalSetting", "loading", "dispatch"];
var Right = function Right(_ref) {
var _shixunsDetail$rightD2, _shixunsDetail$rightD3, _shixunsDetail$rightD4, _shixunsDetail$detail, _shixunsDetail$detail2, _user$userInfo, _shixunsDetail$rightD5, _shixunsDetail$rightD6, _shixunsDetail$rightD7, _shixunsDetail$rightD8, _shixunsDetail$rightD9, _shixunsDetail$rightD10, _shixunsDetail$rightD11, _shixunsDetail$detail3, _shixunsDetail$rightD12, _shixunsDetail$rightD13, _shixunsDetail$rightD14;
var shixunsDetail = _ref.shixunsDetail,
user = _ref.user,
globalSetting = _ref.globalSetting,
loading = _ref.loading,
dispatch = _ref.dispatch,
props = objectWithoutProperties_default()(_ref, _excluded);
var _useState = (0,_react_17_0_2_react.useState)(true),
_useState2 = slicedToArray_default()(_useState, 2),
showExpandAll = _useState2[0],
setShowExpandAll = _useState2[1];
var getOption = function getOption() {
var _shixunsDetail$rightD;
var maskImage = new Image();
// 此为词云图呈现形状的图片base64码可选可以自定义图片
maskImage.src = ImagesIcon/* hbIcon */.yt;
// "data:image/svg+xml;utf8;base64,PD94bWwgdmVyc2lvbj0iMS4wIiBlbmNvZGluZz0iaXNvLTg4NTktMSI/Pgo8IS0tIEdlbmVyYXRvcjogQWRvYmUgSWxsdXN0cmF0b3IgMTYuMC4wLCBTVkcgRXhwb3J0IFBsdWctSW4gLiBTVkcgVmVyc2lvbjogNi4wMCBCdWlsZCAwKSAgLS0+CjwhRE9DVFlQRSBzdmcgUFVCTElDICItLy9XM0MvL0RURCBTVkcgMS4xLy9FTiIgImh0dHA6Ly93d3cudzMub3JnL0dyYXBoaWNzL1NWRy8xLjEvRFREL3N2ZzExLmR0ZCI+CjxzdmcgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIiB4bWxuczp4bGluaz0iaHR0cDovL3d3dy53My5vcmcvMTk5OS94bGluayIgdmVyc2lvbj0iMS4xIiBpZD0iQ2FwYV8xIiB4PSIwcHgiIHk9IjBweCIgd2lkdGg9IjI1NnB4IiBoZWlnaHQ9IjI1NnB4IiB2aWV3Qm94PSIwIDAgNTQ4LjE3NiA1NDguMTc2IiBzdHlsZT0iZW5hYmxlLWJhY2tncm91bmQ6bmV3IDAgMCA1NDguMTc2IDU0OC4xNzY7IiB4bWw6c3BhY2U9InByZXNlcnZlIj4KPGc+Cgk8cGF0aCBkPSJNNTI0LjE4MywyOTcuMDY1Yy0xNS45ODUtMTkuODkzLTM2LjI2NS0zMi42OTEtNjAuODE1LTM4LjM5OWM3LjgxLTExLjk5MywxMS43MDQtMjUuMTI2LDExLjcwNC0zOS4zOTkgICBjMC0yMC4xNzctNy4xMzktMzcuNDAxLTIxLjQwOS01MS42NzhjLTE0LjI3My0xNC4yNzItMzEuNDk4LTIxLjQxMS01MS42NzUtMjEuNDExYy0xOC4yNzEsMC0zNC4wNzEsNS45MDEtNDcuMzksMTcuNzAzICAgYy0xMS4yMjUtMjcuMDI4LTI5LjA3NS00OC45MTctNTMuNTI5LTY1LjY2N2MtMjQuNDYtMTYuNzQ2LTUxLjcyOC0yNS4xMjUtODEuODAyLTI1LjEyNWMtNDAuMzQ5LDAtNzQuODAyLDE0LjI3OS0xMDMuMzUzLDQyLjgzICAgYy0yOC41NTMsMjguNTQ0LTQyLjgyNSw2Mi45OTktNDIuODI1LDEwMy4zNTFjMCwyLjg1NiwwLjE5MSw2Ljk0NSwwLjU3MSwxMi4yNzVjLTIyLjA3OCwxMC4yNzktMzkuODc2LDI1LjgzOC01My4zODksNDYuNjg2ICAgQzYuNzU5LDI5OS4wNjcsMCwzMjIuMDU1LDAsMzQ3LjE4YzAsMzUuMjExLDEyLjUxNyw2NS4zMzMsMzcuNTQ0LDkwLjM1OWMyNS4wMjgsMjUuMDMzLDU1LjE1LDM3LjU0OCw5MC4zNjIsMzcuNTQ4aDMxMC42MzYgICBjMzAuMjU5LDAsNTYuMDk2LTEwLjcxNSw3Ny41MTItMzIuMTIxYzIxLjQxMy0yMS40MTIsMzIuMTIxLTQ3LjI0OSwzMi4xMjEtNzcuNTE1ICAgQzU0OC4xNzIsMzM5Ljc1Nyw1NDAuMTc0LDMxNi45NTIsNTI0LjE4MywyOTcuMDY1eiIgZmlsbD0iI0ZGRkZGRiIvPgo8L2c+CjxnPgo8L2c+CjxnPgo8L2c+CjxnPgo8L2c+CjxnPgo8L2c+CjxnPgo8L2c+CjxnPgo8L2c+CjxnPgo8L2c+CjxnPgo8L2c+CjxnPgo8L2c+CjxnPgo8L2c+CjxnPgo8L2c+CjxnPgo8L2c+CjxnPgo8L2c+CjxnPgo8L2c+CjxnPgo8L2c+Cjwvc3ZnPgo=";
var wordData = (shixunsDetail === null || shixunsDetail === void 0 || (_shixunsDetail$rightD = shixunsDetail.rightData) === null || _shixunsDetail$rightD === void 0 || (_shixunsDetail$rightD = _shixunsDetail$rightD.tags) === null || _shixunsDetail$rightD === void 0 ? void 0 : _shixunsDetail$rightD.map(function (item, key) {
return {
name: item.tag_name,
value: key
};
})) || [];
var option = {
backgroundColor: "#fff",
tooltip: {
pointFormat: "{series.name}</b>"
},
series: [{
type: "wordCloud",
sizeRange: [10, 30],
rotationRange: [-90, 90],
rotationStep: 45,
gridSize: 2,
shape: 'pentagon',
//circle pentagon
maskImage: maskImage,
// 呈现形状图片, 可选
textStyle: {
normal: {
color: function color() {
return "rgb(" + Math.round(Math.random() * 255) + ", " + Math.round(Math.random() * 255) + ", " + Math.round(Math.random() * 255) + ")";
}
}
},
// Folllowing left/top/width/height/right/bottom are used for positioning the word cloud
// Default to be put in the center and has 75% x 80% size.
left: "center",
top: "center",
right: null,
bottom: null,
width: "100%",
height: "100%",
data: wordData
}]
};
return option;
};
console.log('----', shixunsDetail);
var progressPercent = (_shixunsDetail$rightD2 = shixunsDetail.rightData) !== null && _shixunsDetail$rightD2 !== void 0 && _shixunsDetail$rightD2.complete_count ? Number((_shixunsDetail$rightD3 = shixunsDetail.rightData) === null || _shixunsDetail$rightD3 === void 0 ? void 0 : _shixunsDetail$rightD3.complete_count) / Number((_shixunsDetail$rightD4 = shixunsDetail.rightData) === null || _shixunsDetail$rightD4 === void 0 ? void 0 : _shixunsDetail$rightD4.challenge_count) * 100 : 0;
return shixunsDetail.rightData ? /*#__PURE__*/(0,jsx_runtime.jsxs)("section", {
className: Rightmodules.rightWrap,
children: [!((_shixunsDetail$detail = shixunsDetail.detail) !== null && _shixunsDetail$detail !== void 0 && _shixunsDetail$detail.is_jupyter) && ((_shixunsDetail$detail2 = shixunsDetail.detail) === null || _shixunsDetail$detail2 === void 0 || (_shixunsDetail$detail2 = _shixunsDetail$detail2.task_operation) === null || _shixunsDetail$detail2 === void 0 ? void 0 : _shixunsDetail$detail2[2]) && (user === null || user === void 0 || (_user$userInfo = user.userInfo) === null || _user$userInfo === void 0 ? void 0 : _user$userInfo.login) && !!((_shixunsDetail$rightD5 = shixunsDetail.rightData) !== null && _shixunsDetail$rightD5 !== void 0 && _shixunsDetail$rightD5.complete_count) && ((_shixunsDetail$rightD6 = shixunsDetail.rightData) === null || _shixunsDetail$rightD6 === void 0 ? void 0 : _shixunsDetail$rightD6.complete_count) > 0 && /*#__PURE__*/(0,jsx_runtime.jsxs)("div", {
className: Rightmodules.learnWrap,
children: [/*#__PURE__*/(0,jsx_runtime.jsxs)("div", {
className: Rightmodules.learnTopWrap,
children: [/*#__PURE__*/(0,jsx_runtime.jsxs)("span", {
children: [/*#__PURE__*/(0,jsx_runtime.jsx)("img", {
className: Rightmodules.titleImg,
src: learn,
alt: ""
}), "\u5B66\u4E60\u8FDB\u5EA6"]
}), /*#__PURE__*/(0,jsx_runtime.jsx)("span", {
children: /*#__PURE__*/(0,jsx_runtime.jsxs)("span", {
className: "".concat(Rightmodules.color888, " font14"),
children: ["\u5DF2\u5B8C\u6210 ", ((_shixunsDetail$rightD7 = shixunsDetail.rightData) === null || _shixunsDetail$rightD7 === void 0 ? void 0 : _shixunsDetail$rightD7.complete_count) || 0, " \u5173 / \u5171", ((_shixunsDetail$rightD8 = shixunsDetail.rightData) === null || _shixunsDetail$rightD8 === void 0 ? void 0 : _shixunsDetail$rightD8.challenge_count) || 0, " \u5173"]
})
})]
}), /*#__PURE__*/(0,jsx_runtime.jsx)(progress/* default */.Z, {
percent: progressPercent,
showInfo: false,
status: "active",
strokeColor: {
'0%': '#29BD8B',
'100%': '#29BD8B'
}
})]
}), !!((_shixunsDetail$rightD9 = shixunsDetail.rightData) !== null && _shixunsDetail$rightD9 !== void 0 && (_shixunsDetail$rightD9 = _shixunsDetail$rightD9.paths) !== null && _shixunsDetail$rightD9 !== void 0 && _shixunsDetail$rightD9.length) && /*#__PURE__*/(0,jsx_runtime.jsxs)("div", {
className: Rightmodules.courseWrap,
children: [/*#__PURE__*/(0,jsx_runtime.jsxs)("p", {
className: "mb20 font16",
children: [/*#__PURE__*/(0,jsx_runtime.jsx)("img", {
className: Rightmodules.titleImg,
src: course,
alt: ""
}), "\u6240\u5C5E\u8BFE\u7A0B"]
}), /*#__PURE__*/(0,jsx_runtime.jsx)("div", {
children: (_shixunsDetail$rightD10 = shixunsDetail.rightData) === null || _shixunsDetail$rightD10 === void 0 ? void 0 : _shixunsDetail$rightD10.paths.map(function (item, key) {
if (key > 2) {
return null;
}
return /*#__PURE__*/(0,jsx_runtime.jsxs)("div", {
className: Rightmodules.pathWrap,
children: [/*#__PURE__*/(0,jsx_runtime.jsx)("a", {
href: "/paths/".concat(item.id),
target: "_blank",
children: /*#__PURE__*/(0,jsx_runtime.jsx)("img", {
alt: "\u5B9E\u8BAD",
src: "".concat(item.image_url),
className: Rightmodules.pathImg
})
}), /*#__PURE__*/(0,jsx_runtime.jsxs)("div", {
className: Rightmodules.pathContentWrap,
children: [/*#__PURE__*/(0,jsx_runtime.jsx)("a", {
href: "/paths/".concat(item.id),
target: "_blank",
className: Rightmodules.pathContentName,
children: item.name
}), /*#__PURE__*/(0,jsx_runtime.jsxs)("p", {
className: Rightmodules.pathContent,
children: [/*#__PURE__*/(0,jsx_runtime.jsx)(tooltip/* default */.Z, {
placement: "bottom",
title: "\u7AE0\u8282",
children: /*#__PURE__*/(0,jsx_runtime.jsxs)("span", {
className: Rightmodules.pathContentCount,
children: [/*#__PURE__*/(0,jsx_runtime.jsx)("i", {
className: "iconfont icon-shixun mr3"
}), item.stages_count]
})
}), /*#__PURE__*/(0,jsx_runtime.jsx)(tooltip/* default */.Z, {
placement: "bottom",
title: "\u5B66\u4E60\u4EBA\u6570",
children: /*#__PURE__*/(0,jsx_runtime.jsxs)("span", {
className: Rightmodules.pathContentCount,
children: [/*#__PURE__*/(0,jsx_runtime.jsx)("i", {
className: "iconfont icon-chengyuan mr3"
}), item.members_count]
})
})]
})]
})]
}, item.id);
})
})]
}), /*#__PURE__*/(0,jsx_runtime.jsx)("div", {}), !!((_shixunsDetail$rightD11 = shixunsDetail.rightData) !== null && _shixunsDetail$rightD11 !== void 0 && (_shixunsDetail$rightD11 = _shixunsDetail$rightD11.recommands) !== null && _shixunsDetail$rightD11 !== void 0 && _shixunsDetail$rightD11.length) && user.userInfo.main_site && /*#__PURE__*/(0,jsx_runtime.jsxs)("div", {
className: Rightmodules.recommandTrainingWrap,
children: [/*#__PURE__*/(0,jsx_runtime.jsxs)("p", {
className: "mb20 font16",
children: [/*#__PURE__*/(0,jsx_runtime.jsx)("img", {
className: Rightmodules.titleImg,
src: star,
alt: ""
}), (shixunsDetail === null || shixunsDetail === void 0 || (_shixunsDetail$detail3 = shixunsDetail.detail) === null || _shixunsDetail$detail3 === void 0 || (_shixunsDetail$detail3 = _shixunsDetail$detail3.disciplines) === null || _shixunsDetail$detail3 === void 0 ? void 0 : _shixunsDetail$detail3.length) > 0 ? '相关推荐' : '热门推荐']
}), /*#__PURE__*/(0,jsx_runtime.jsx)("div", {
children: (_shixunsDetail$rightD12 = shixunsDetail.rightData) === null || _shixunsDetail$rightD12 === void 0 ? void 0 : _shixunsDetail$rightD12.recommands.map(function (item, key) {
if (key > 2) {
return null;
}
return /*#__PURE__*/(0,jsx_runtime.jsxs)("div", {
className: Rightmodules.pathContentItem,
children: [/*#__PURE__*/(0,jsx_runtime.jsx)("a", {
href: "/shixuns/".concat(item.identifier, "/challenges"),
target: "_blank",
children: /*#__PURE__*/(0,jsx_runtime.jsx)("img", {
src: "".concat(item.pic),
className: Rightmodules.pathImg
})
}), /*#__PURE__*/(0,jsx_runtime.jsxs)("div", {
className: Rightmodules.pathContentWrap,
style: {
marginBottom: -4
},
children: [/*#__PURE__*/(0,jsx_runtime.jsx)(tooltip/* default */.Z, {
placement: "bottom",
title: item.name,
children: /*#__PURE__*/(0,jsx_runtime.jsx)("a", {
href: "/shixuns/".concat(item.identifier, "/challenges"),
target: "_blank",
className: Rightmodules.pathContentName,
children: item.name
})
}), /*#__PURE__*/(0,jsx_runtime.jsxs)("p", {
className: "".concat(Rightmodules.pathContent, " ").concat(Rightmodules.recommandContent),
children: [/*#__PURE__*/(0,jsx_runtime.jsxs)("span", {
children: [item.stu_num, " \u4EBA\u5B66\u4E60"]
}), /*#__PURE__*/(0,jsx_runtime.jsx)("span", {
className: Rightmodules.recommandLevel,
children: item.level
})]
})]
})]
}, key);
})
})]
}), ((_shixunsDetail$rightD13 = shixunsDetail.rightData) === null || _shixunsDetail$rightD13 === void 0 || (_shixunsDetail$rightD13 = _shixunsDetail$rightD13.tags) === null || _shixunsDetail$rightD13 === void 0 ? void 0 : _shixunsDetail$rightD13.length) > 0 && /*#__PURE__*/(0,jsx_runtime.jsxs)("div", {
className: Rightmodules.skillWrap,
children: [/*#__PURE__*/(0,jsx_runtime.jsx)("p", {
className: "".concat(Rightmodules.skillTopWrap, " font16 mb20"),
children: /*#__PURE__*/(0,jsx_runtime.jsxs)("span", {
children: ["\u6280\u80FD\u6807\u7B7E", /*#__PURE__*/(0,jsx_runtime.jsx)("span", {
className: "ml5 c-grey-c",
children: (_shixunsDetail$rightD14 = shixunsDetail.rightData) === null || _shixunsDetail$rightD14 === void 0 || (_shixunsDetail$rightD14 = _shixunsDetail$rightD14.tags) === null || _shixunsDetail$rightD14 === void 0 ? void 0 : _shixunsDetail$rightD14.length
})]
})
}), /*#__PURE__*/(0,jsx_runtime.jsx)(lib/* default */.Z, {
option: getOption(),
style: {
height: 370
},
opts: {
renderer: 'svg'
} // use svg to render the chart.
})]
})]
}) : null;
};
/* harmony default export */ var components_Right = ((0,_umi_production_exports.connect)(function (_ref2) {
var shixunsDetail = _ref2.shixunsDetail,
user = _ref2.user,
loading = _ref2.loading,
globalSetting = _ref2.globalSetting;
return {
shixunsDetail: shixunsDetail,
user: user,
globalSetting: globalSetting,
loading: loading.models.index
};
})(Right));
/***/ }),
/***/ 88522:
/*!*****************************************************************!*\
!*** ./node_modules/_antd@5.9.0@antd/es/auto-complete/index.js ***!
\*****************************************************************/
/***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) {
"use strict";
/* harmony import */ var classnames__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! classnames */ 12124);
/* harmony import */ var classnames__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(classnames__WEBPACK_IMPORTED_MODULE_0__);
/* harmony import */ var rc_util_es_Children_toArray__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! rc-util/es/Children/toArray */ 45659);
/* harmony import */ var rc_util_es_omit__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! rc-util/es/omit */ 99468);
/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! react */ 59301);
/* harmony import */ var _util_PurePanel__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ../_util/PurePanel */ 53487);
/* harmony import */ var _util_reactNode__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ../_util/reactNode */ 92343);
/* harmony import */ var _config_provider__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ../config-provider */ 36355);
/* harmony import */ var _select__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../select */ 57809);
"use client";
const {
Option
} = _select__WEBPACK_IMPORTED_MODULE_3__["default"];
function isSelectOptionOrSelectOptGroup(child) {
return child && child.type && (child.type.isSelectOption || child.type.isSelectOptGroup);
}
const AutoComplete = (props, ref) => {
const {
prefixCls: customizePrefixCls,
className,
popupClassName,
dropdownClassName,
children,
dataSource
} = props;
const childNodes = (0,rc_util_es_Children_toArray__WEBPACK_IMPORTED_MODULE_1__/* ["default"] */ .Z)(children);
// ============================= Input =============================
let customizeInput;
if (childNodes.length === 1 && (0,_util_reactNode__WEBPACK_IMPORTED_MODULE_4__/* .isValidElement */ .l$)(childNodes[0]) && !isSelectOptionOrSelectOptGroup(childNodes[0])) {
[customizeInput] = childNodes;
}
const getInputElement = customizeInput ? () => customizeInput : undefined;
// ============================ Options ============================
let optionChildren;
// [Legacy] convert `children` or `dataSource` into option children
if (childNodes.length && isSelectOptionOrSelectOptGroup(childNodes[0])) {
optionChildren = children;
} else {
optionChildren = dataSource ? dataSource.map(item => {
if ((0,_util_reactNode__WEBPACK_IMPORTED_MODULE_4__/* .isValidElement */ .l$)(item)) {
return item;
}
switch (typeof item) {
case 'string':
return /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_2__.createElement(Option, {
key: item,
value: item
}, item);
case 'object':
{
const {
value: optionValue
} = item;
return /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_2__.createElement(Option, {
key: optionValue,
value: optionValue
}, item.text);
}
default:
false ? 0 : void 0;
return undefined;
}
}) : [];
}
if (false) {}
const {
getPrefixCls
} = react__WEBPACK_IMPORTED_MODULE_2__.useContext(_config_provider__WEBPACK_IMPORTED_MODULE_5__/* .ConfigContext */ .E_);
const prefixCls = getPrefixCls('select', customizePrefixCls);
return /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_2__.createElement(_select__WEBPACK_IMPORTED_MODULE_3__["default"], Object.assign({
ref: ref,
suffixIcon: null
}, (0,rc_util_es_omit__WEBPACK_IMPORTED_MODULE_6__/* ["default"] */ .Z)(props, ['dataSource', 'dropdownClassName']), {
prefixCls: prefixCls,
popupClassName: popupClassName || dropdownClassName,
className: classnames__WEBPACK_IMPORTED_MODULE_0___default()(`${prefixCls}-auto-complete`, className),
mode: _select__WEBPACK_IMPORTED_MODULE_3__["default"].SECRET_COMBOBOX_MODE_DO_NOT_USE
}, {
// Internal api
getInputElement
}), optionChildren);
};
const RefAutoComplete = /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_2__.forwardRef(AutoComplete);
// We don't care debug panel
/* istanbul ignore next */
const PurePanel = (0,_util_PurePanel__WEBPACK_IMPORTED_MODULE_7__/* ["default"] */ .Z)(RefAutoComplete);
RefAutoComplete.Option = Option;
RefAutoComplete._InternalPanelDoNotUseOrYouWillBeFired = PurePanel;
if (false) {}
/* harmony default export */ __webpack_exports__.Z = (RefAutoComplete);
/***/ }),
/***/ 44000:
/*!**********************************************************!*\
!*** ./node_modules/_antd@5.9.0@antd/es/layout/index.js ***!
\**********************************************************/
/***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) {
"use strict";
/* harmony import */ var _layout__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./layout */ 84966);
/* harmony import */ var _Sider__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./Sider */ 37534);
"use client";
const Layout = _layout__WEBPACK_IMPORTED_MODULE_0__/* ["default"] */ .ZP;
Layout.Header = _layout__WEBPACK_IMPORTED_MODULE_0__/* .Header */ .h4;
Layout.Footer = _layout__WEBPACK_IMPORTED_MODULE_0__/* .Footer */ .$_;
Layout.Content = _layout__WEBPACK_IMPORTED_MODULE_0__/* .Content */ .VY;
Layout.Sider = _Sider__WEBPACK_IMPORTED_MODULE_1__/* ["default"] */ .Z;
/* harmony default export */ __webpack_exports__.Z = (Layout);
/***/ }),
/***/ 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)
/***/ })
}]);