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.
1230 lines
52 KiB
1230 lines
52 KiB
(self["webpackChunk"] = self["webpackChunk"] || []).push([[25470],{
|
|
|
|
/***/ 6790:
|
|
/*!*************************************************************************************************************!*\
|
|
!*** ./node_modules/_@ant-design_icons@5.6.1@@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.27.0@@babel/runtime/helpers/esm/extends.js
|
|
var esm_extends = __webpack_require__(72308);
|
|
// 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/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.6.1@@ant-design/icons/es/components/AntdIcon.js + 3 modules
|
|
var AntdIcon = __webpack_require__(7657);
|
|
;// CONCATENATED MODULE: ./node_modules/_@ant-design_icons@5.6.1@@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
|
|
}));
|
|
};
|
|
|
|
/** */
|
|
var RefIcon = /*#__PURE__*/_react_17_0_2_react.forwardRef(CloseSquareOutlined_CloseSquareOutlined);
|
|
if (false) {}
|
|
/* harmony default export */ var icons_CloseSquareOutlined = (RefIcon);
|
|
|
|
/***/ }),
|
|
|
|
/***/ 33752:
|
|
/*!**********************************************************************!*\
|
|
!*** ./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.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/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/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__(13032);
|
|
// 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__(61621);
|
|
// 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__(58421);
|
|
// EXTERNAL MODULE: ./src/pages/Shixuns/Detail/components/Right/index.tsx + 4 modules
|
|
var Right = __webpack_require__(56139);
|
|
// EXTERNAL MODULE: ./src/utils/env.ts + 1 modules
|
|
var env = __webpack_require__(17631);
|
|
// 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);
|
|
// 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__(55723);
|
|
// EXTERNAL MODULE: ./src/components/SelectTeachGroup/index.tsx + 8 modules
|
|
var SelectTeachGroup = __webpack_require__(95749);
|
|
;// 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.6.1@@ant-design/icons/es/icons/DownOutlined.js + 1 modules
|
|
var DownOutlined = __webpack_require__(84105);
|
|
// EXTERNAL MODULE: ./src/components/Header/index.tsx + 5 modules
|
|
var Header = __webpack_require__(73517);
|
|
;// 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 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 _callee6(identifier, user_id, editable, userName) {
|
|
return regeneratorRuntime_default()().wrap(function _callee6$(_context6) {
|
|
while (1) switch (_context6.prev = _context6.next) {
|
|
case 0:
|
|
_context6.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 _context6.stop();
|
|
}
|
|
}, _callee6);
|
|
}));
|
|
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 _callee4(user_ids) {
|
|
var res;
|
|
return regeneratorRuntime_default()().wrap(function _callee4$(_context4) {
|
|
while (1) switch (_context4.prev = _context4.next) {
|
|
case 0:
|
|
onCancel();
|
|
_context4.next = 3;
|
|
return dispatch({
|
|
type: 'shixunsDetail/addCollaborator',
|
|
payload: {
|
|
id: shixunId.current,
|
|
user_ids: user_ids
|
|
}
|
|
});
|
|
case 3:
|
|
res = _context4.sent;
|
|
if (res) {
|
|
message/* default */.ZP.success('添加成功');
|
|
handleReloadData();
|
|
}
|
|
case 5:
|
|
case "end":
|
|
return _context4.stop();
|
|
}
|
|
}, _callee4);
|
|
}));
|
|
function onSelectCollaborator(_x6) {
|
|
return _onSelectCollaborator.apply(this, arguments);
|
|
}
|
|
return onSelectCollaborator;
|
|
}(),
|
|
onSelectGroup: function () {
|
|
var _onSelectGroup = asyncToGenerator_default()( /*#__PURE__*/regeneratorRuntime_default()().mark(function _callee5(group_id) {
|
|
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/addTeachGroupMember',
|
|
payload: {
|
|
identifier: shixunId.current,
|
|
group_id: group_id.group_id
|
|
}
|
|
});
|
|
case 3:
|
|
res = _context5.sent;
|
|
if (res) {
|
|
message/* default */.ZP.success('添加成功');
|
|
handleReloadData();
|
|
}
|
|
case 5:
|
|
case "end":
|
|
return _context5.stop();
|
|
}
|
|
}, _callee5);
|
|
}));
|
|
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$userInfo5, _item$user9;
|
|
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$userInfo5 = user.userInfo) === null || _user$userInfo5 === void 0 ? void 0 : _user$userInfo5.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]
|
|
})]
|
|
}), /*#__PURE__*/(0,jsx_runtime.jsx)("p", {
|
|
className: Collaboratorsmodules.schoolWrap,
|
|
children: /*#__PURE__*/(0,jsx_runtime.jsx)("span", {
|
|
className: Collaboratorsmodules.school,
|
|
children: (_item$user9 = item.user) === null || _item$user9 === void 0 ? void 0 : _item$user9.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));
|
|
|
|
/***/ }),
|
|
|
|
/***/ 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 */ 92310);
|
|
/* 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 */ 11592);
|
|
/* harmony import */ var rc_util_es_omit__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! rc-util/es/omit */ 2738);
|
|
/* 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 */ 45818);
|
|
"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)
|
|
|
|
|
|
/***/ })
|
|
|
|
}]); |