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.
892 lines
37 KiB
892 lines
37 KiB
"use strict";
|
|
(self["webpackChunk"] = self["webpackChunk"] || []).push([[40559,36579,23805,62654],{
|
|
|
|
/***/ 49620:
|
|
/*!*******************************************************************!*\
|
|
!*** ./src/layouts/virtualDetail/TopBanner/index.tsx + 1 modules ***!
|
|
\*******************************************************************/
|
|
/***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) {
|
|
|
|
|
|
// EXPORTS
|
|
__webpack_require__.d(__webpack_exports__, {
|
|
"Z": function() { return /* binding */ virtualDetail_TopBanner; }
|
|
});
|
|
|
|
// EXTERNAL MODULE: ./node_modules/antd/es/button/style/index.js + 1 modules
|
|
var style = __webpack_require__(29913);
|
|
// EXTERNAL MODULE: ./node_modules/antd/es/button/index.js
|
|
var es_button = __webpack_require__(71577);
|
|
// EXTERNAL MODULE: ./node_modules/antd/es/tooltip/style/index.js + 1 modules
|
|
var tooltip_style = __webpack_require__(38390);
|
|
// EXTERNAL MODULE: ./node_modules/antd/es/tooltip/index.js + 3 modules
|
|
var tooltip = __webpack_require__(84908);
|
|
// EXTERNAL MODULE: ./node_modules/@babel/runtime/helpers/objectSpread2.js
|
|
var objectSpread2 = __webpack_require__(42122);
|
|
var objectSpread2_default = /*#__PURE__*/__webpack_require__.n(objectSpread2);
|
|
// EXTERNAL MODULE: ./node_modules/@babel/runtime/helpers/regeneratorRuntime.js
|
|
var regeneratorRuntime = __webpack_require__(17061);
|
|
var regeneratorRuntime_default = /*#__PURE__*/__webpack_require__.n(regeneratorRuntime);
|
|
// EXTERNAL MODULE: ./node_modules/antd/es/message/style/index.js + 1 modules
|
|
var message_style = __webpack_require__(14934);
|
|
// EXTERNAL MODULE: ./node_modules/antd/es/message/index.js + 1 modules
|
|
var message = __webpack_require__(12461);
|
|
// EXTERNAL MODULE: ./node_modules/@babel/runtime/helpers/asyncToGenerator.js
|
|
var asyncToGenerator = __webpack_require__(17156);
|
|
var asyncToGenerator_default = /*#__PURE__*/__webpack_require__.n(asyncToGenerator);
|
|
// EXTERNAL MODULE: ./node_modules/antd/es/modal/style/index.js + 1 modules
|
|
var modal_style = __webpack_require__(35611);
|
|
// EXTERNAL MODULE: ./node_modules/antd/es/modal/index.js + 7 modules
|
|
var modal = __webpack_require__(85402);
|
|
// EXTERNAL MODULE: ./node_modules/@babel/runtime/helpers/slicedToArray.js
|
|
var slicedToArray = __webpack_require__(27424);
|
|
var slicedToArray_default = /*#__PURE__*/__webpack_require__.n(slicedToArray);
|
|
// EXTERNAL MODULE: ./node_modules/react/index.js
|
|
var react = __webpack_require__(67294);
|
|
;// CONCATENATED MODULE: ./src/layouts/virtualDetail/TopBanner/index.less?modules
|
|
// extracted by mini-css-extract-plugin
|
|
/* harmony default export */ var TopBannermodules = ({"bg":"bg___vd7LL","headName":"headName___sPZlC","name":"name___MBElV","member":"member___StkKn"});
|
|
// EXTERNAL MODULE: ./src/utils/fetch.ts
|
|
var fetch = __webpack_require__(84519);
|
|
// EXTERNAL MODULE: ./src/utils/env.ts + 1 modules
|
|
var env = __webpack_require__(59758);
|
|
// EXTERNAL MODULE: ./src/pages/virtualSpaces/components/AddOrEdit/index.tsx + 1 modules
|
|
var AddOrEdit = __webpack_require__(97642);
|
|
// EXTERNAL MODULE: ./src/utils/authority.ts
|
|
var authority = __webpack_require__(7);
|
|
// EXTERNAL MODULE: ./src/utils/verifyLogin.tsx + 3 modules
|
|
var verifyLogin = __webpack_require__(72551);
|
|
// EXTERNAL MODULE: ./src/.umi-production/exports.ts + 8 modules
|
|
var _umi_production_exports = __webpack_require__(89214);
|
|
// EXTERNAL MODULE: ./node_modules/react/jsx-runtime.js
|
|
var jsx_runtime = __webpack_require__(85893);
|
|
;// CONCATENATED MODULE: ./src/layouts/virtualDetail/TopBanner/index.tsx
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
var TopBanner = function TopBanner(_ref) {
|
|
var virtualSpaces = _ref.virtualSpaces,
|
|
user = _ref.user,
|
|
dispatch = _ref.dispatch;
|
|
var _useState = (0,react.useState)(false),
|
|
_useState2 = slicedToArray_default()(_useState, 2),
|
|
visible = _useState2[0],
|
|
setVisible = _useState2[1];
|
|
var urlParams = (0,_umi_production_exports.useParams)();
|
|
var virtualSpacesDetails = virtualSpaces.virtualSpacesDetails;
|
|
var getDetails = function getDetails() {
|
|
dispatch({
|
|
type: 'virtualSpaces/getVirtualSpacesDetails',
|
|
payload: {
|
|
id: urlParams === null || urlParams === void 0 ? void 0 : urlParams.virtual_spacesId
|
|
}
|
|
});
|
|
};
|
|
var handleJoin = function handleJoin() {
|
|
if (!(0,verifyLogin/* handleVerifyLogin */.o1)(dispatch)) {
|
|
return;
|
|
}
|
|
modal/* default.confirm */.Z.confirm({
|
|
centered: true,
|
|
width: 424,
|
|
okText: '确定',
|
|
cancelText: '取消',
|
|
title: '确认申请加入',
|
|
icon: null,
|
|
className: 'custom-modal-divider',
|
|
content: /*#__PURE__*/(0,jsx_runtime.jsx)("div", {
|
|
className: "font14",
|
|
children: "\u786E\u8BA4\u5411\u7BA1\u7406\u5458\u7533\u8BF7\u52A0\u5165\u8BE5\u865A\u62DF\u793E\u533A\u5417\uFF1F"
|
|
}),
|
|
onOk: function () {
|
|
var _onOk = asyncToGenerator_default()( /*#__PURE__*/regeneratorRuntime_default()().mark(function _callee() {
|
|
var res;
|
|
return regeneratorRuntime_default()().wrap(function _callee$(_context) {
|
|
while (1) switch (_context.prev = _context.next) {
|
|
case 0:
|
|
_context.next = 2;
|
|
return (0,fetch/* default */.ZP)("/api/virtual_classrooms/".concat(urlParams === null || urlParams === void 0 ? void 0 : urlParams.virtual_spacesId, "/apply_become_member.json"), {
|
|
method: 'post'
|
|
});
|
|
case 2:
|
|
res = _context.sent;
|
|
if ((res === null || res === void 0 ? void 0 : res.status) !== -1) {
|
|
message/* default.success */.ZP.success(res === null || res === void 0 ? void 0 : res.message);
|
|
getDetails();
|
|
}
|
|
case 4:
|
|
case "end":
|
|
return _context.stop();
|
|
}
|
|
}, _callee);
|
|
}));
|
|
function onOk() {
|
|
return _onOk.apply(this, arguments);
|
|
}
|
|
return onOk;
|
|
}()
|
|
});
|
|
};
|
|
var handlePublic = function handlePublic() {
|
|
modal/* default.confirm */.Z.confirm({
|
|
centered: true,
|
|
width: 424,
|
|
okText: '确定',
|
|
cancelText: '取消',
|
|
title: '确认申请公开',
|
|
icon: null,
|
|
className: 'custom-modal-divider',
|
|
content: /*#__PURE__*/(0,jsx_runtime.jsxs)("div", {
|
|
className: "font14",
|
|
children: [/*#__PURE__*/(0,jsx_runtime.jsx)("p", {
|
|
children: "\u786E\u8BA4\u5411\u5E73\u53F0\u7533\u8BF7\u516C\u5F00\u865A\u62DF\u793E\u533A\u5417\uFF1F"
|
|
}), /*#__PURE__*/(0,jsx_runtime.jsx)("p", {
|
|
children: "\u516C\u5F00\u865A\u62DF\u793E\u533A\u9700\u7ECF\u8FC7\u5E73\u53F0\u6807\u51C6\u5316\u5BA1\u6838\uFF0C\u5BA1\u6838\u5468\u671F\u4E3A1-2\u5929\uFF0C"
|
|
}), /*#__PURE__*/(0,jsx_runtime.jsx)("div", {
|
|
children: "\u516C\u5F00\u7684\u865A\u62DF\u793E\u533A\u5C06\u5BF9\u5E73\u53F0\u6240\u6709\u4EBA\u53EF\u89C1\u3002"
|
|
})]
|
|
}),
|
|
onOk: function () {
|
|
var _onOk2 = asyncToGenerator_default()( /*#__PURE__*/regeneratorRuntime_default()().mark(function _callee2() {
|
|
var res;
|
|
return regeneratorRuntime_default()().wrap(function _callee2$(_context2) {
|
|
while (1) switch (_context2.prev = _context2.next) {
|
|
case 0:
|
|
_context2.next = 2;
|
|
return (0,fetch/* default */.ZP)("/api/virtual_classrooms/".concat(urlParams === null || urlParams === void 0 ? void 0 : urlParams.virtual_spacesId, "/apply_public.json"), {
|
|
method: 'post'
|
|
});
|
|
case 2:
|
|
res = _context2.sent;
|
|
if ((res === null || res === void 0 ? void 0 : res.status) !== -1) {
|
|
message/* default.success */.ZP.success(res === null || res === void 0 ? void 0 : res.message);
|
|
getDetails();
|
|
}
|
|
case 4:
|
|
case "end":
|
|
return _context2.stop();
|
|
}
|
|
}, _callee2);
|
|
}));
|
|
function onOk() {
|
|
return _onOk2.apply(this, arguments);
|
|
}
|
|
return onOk;
|
|
}()
|
|
});
|
|
};
|
|
var handleOk = /*#__PURE__*/function () {
|
|
var _ref2 = asyncToGenerator_default()( /*#__PURE__*/regeneratorRuntime_default()().mark(function _callee3(values) {
|
|
var res;
|
|
return regeneratorRuntime_default()().wrap(function _callee3$(_context3) {
|
|
while (1) switch (_context3.prev = _context3.next) {
|
|
case 0:
|
|
_context3.next = 2;
|
|
return (0,fetch/* default */.ZP)("/api/virtual_classrooms/".concat(urlParams === null || urlParams === void 0 ? void 0 : urlParams.virtual_spacesId, ".json"), {
|
|
method: 'put',
|
|
body: values
|
|
});
|
|
case 2:
|
|
res = _context3.sent;
|
|
if ((res === null || res === void 0 ? void 0 : res.status) === 0) {
|
|
getDetails();
|
|
setVisible(false);
|
|
}
|
|
case 4:
|
|
case "end":
|
|
return _context3.stop();
|
|
}
|
|
}, _callee3);
|
|
}));
|
|
return function handleOk(_x) {
|
|
return _ref2.apply(this, arguments);
|
|
};
|
|
}();
|
|
var handleEdit = /*#__PURE__*/function () {
|
|
var _ref3 = asyncToGenerator_default()( /*#__PURE__*/regeneratorRuntime_default()().mark(function _callee4(values) {
|
|
return regeneratorRuntime_default()().wrap(function _callee4$(_context4) {
|
|
while (1) switch (_context4.prev = _context4.next) {
|
|
case 0:
|
|
setVisible(objectSpread2_default()({}, virtualSpacesDetails));
|
|
case 1:
|
|
case "end":
|
|
return _context4.stop();
|
|
}
|
|
}, _callee4);
|
|
}));
|
|
return function handleEdit(_x2) {
|
|
return _ref3.apply(this, arguments);
|
|
};
|
|
}();
|
|
var permission = (virtualSpacesDetails === null || virtualSpacesDetails === void 0 ? void 0 : virtualSpacesDetails.is_member) || (0,authority/* isSuperAdmins */.Ny)();
|
|
return /*#__PURE__*/(0,jsx_runtime.jsxs)("div", {
|
|
className: TopBannermodules.bg,
|
|
style: {
|
|
background: "url('".concat(env/* default.IMG_SERVER */.Z.IMG_SERVER + (virtualSpacesDetails === null || virtualSpacesDetails === void 0 ? void 0 : virtualSpacesDetails.backbground_image_url), "') no-repeat center center")
|
|
},
|
|
children: [/*#__PURE__*/(0,jsx_runtime.jsx)("div", {
|
|
className: TopBannermodules.headName,
|
|
children: /*#__PURE__*/(0,jsx_runtime.jsxs)("span", {
|
|
children: [" ", virtualSpacesDetails === null || virtualSpacesDetails === void 0 ? void 0 : virtualSpacesDetails.name]
|
|
})
|
|
}), /*#__PURE__*/(0,jsx_runtime.jsx)("aside", {
|
|
children: /*#__PURE__*/(0,jsx_runtime.jsxs)("div", {
|
|
children: [/*#__PURE__*/(0,jsx_runtime.jsxs)("div", {
|
|
className: TopBannermodules.member,
|
|
children: [/*#__PURE__*/(0,jsx_runtime.jsxs)("div", {
|
|
children: [/*#__PURE__*/(0,jsx_runtime.jsx)(tooltip/* default */.Z, {
|
|
title: '成员总数',
|
|
children: /*#__PURE__*/(0,jsx_runtime.jsx)("i", {
|
|
style: {
|
|
color: '#FF8B58',
|
|
fontSize: 24
|
|
},
|
|
className: "iconfont icon-a-chengyuan1"
|
|
})
|
|
}), /*#__PURE__*/(0,jsx_runtime.jsx)(tooltip/* default */.Z, {
|
|
title: '成员总数',
|
|
children: /*#__PURE__*/(0,jsx_runtime.jsx)("span", {
|
|
children: virtualSpacesDetails === null || virtualSpacesDetails === void 0 ? void 0 : virtualSpacesDetails.members_count
|
|
})
|
|
})]
|
|
}), /*#__PURE__*/(0,jsx_runtime.jsxs)("div", {
|
|
children: [/*#__PURE__*/(0,jsx_runtime.jsx)(tooltip/* default */.Z, {
|
|
title: '资源总数',
|
|
children: /*#__PURE__*/(0,jsx_runtime.jsx)("i", {
|
|
style: {
|
|
color: '#07C160',
|
|
marginLeft: 100
|
|
},
|
|
className: "iconfont icon-a-ziyuanku1"
|
|
})
|
|
}), /*#__PURE__*/(0,jsx_runtime.jsx)(tooltip/* default */.Z, {
|
|
title: '资源总数',
|
|
children: /*#__PURE__*/(0,jsx_runtime.jsx)("span", {
|
|
children: virtualSpacesDetails === null || virtualSpacesDetails === void 0 ? void 0 : virtualSpacesDetails.resources_count
|
|
})
|
|
})]
|
|
})]
|
|
}), permission && /*#__PURE__*/(0,jsx_runtime.jsxs)(es_button/* default */.Z, {
|
|
disabled: (virtualSpacesDetails === null || virtualSpacesDetails === void 0 ? void 0 : virtualSpacesDetails.status) !== 2,
|
|
onClick: handlePublic,
|
|
type: "primary",
|
|
children: [/*#__PURE__*/(0,jsx_runtime.jsx)("i", {
|
|
className: "iconfont icon-sheweigongkai2 mr5 font14"
|
|
}), (virtualSpacesDetails === null || virtualSpacesDetails === void 0 ? void 0 : virtualSpacesDetails.status) === 2 ? '申请公开' : (virtualSpacesDetails === null || virtualSpacesDetails === void 0 ? void 0 : virtualSpacesDetails.status) === 0 ? '申请中' : '已公开']
|
|
}), !permission && /*#__PURE__*/(0,jsx_runtime.jsxs)(es_button/* default */.Z, {
|
|
onClick: handleJoin,
|
|
type: "primary",
|
|
children: [/*#__PURE__*/(0,jsx_runtime.jsx)("i", {
|
|
className: "iconfont icon-shenqingjiaru2 mr5 font14"
|
|
}), "\u7533\u8BF7\u52A0\u5165"]
|
|
})]
|
|
})
|
|
}), /*#__PURE__*/(0,jsx_runtime.jsx)(AddOrEdit/* default */.Z, {
|
|
visible: visible,
|
|
title: '编辑虚拟社区',
|
|
onCancel: function onCancel() {
|
|
return setVisible(false);
|
|
},
|
|
onOk: handleOk
|
|
})]
|
|
});
|
|
};
|
|
/* harmony default export */ var virtualDetail_TopBanner = ((0,_umi_production_exports.connect)(function (_ref4) {
|
|
var virtualSpaces = _ref4.virtualSpaces,
|
|
user = _ref4.user;
|
|
return {
|
|
virtualSpaces: virtualSpaces,
|
|
user: user
|
|
};
|
|
})(TopBanner));
|
|
|
|
/***/ }),
|
|
|
|
/***/ 96073:
|
|
/*!*********************************************************!*\
|
|
!*** ./src/layouts/virtualDetail/index.tsx + 6 modules ***!
|
|
\*********************************************************/
|
|
/***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) {
|
|
|
|
// ESM COMPAT FLAG
|
|
__webpack_require__.r(__webpack_exports__);
|
|
|
|
// EXPORTS
|
|
__webpack_require__.d(__webpack_exports__, {
|
|
"default": function() { return /* binding */ virtualDetail; },
|
|
"listPlanLibrary": function() { return /* binding */ listPlanLibrary; }
|
|
});
|
|
|
|
// EXTERNAL MODULE: ./node_modules/antd/es/row/style/index.js
|
|
var style = __webpack_require__(13062);
|
|
// EXTERNAL MODULE: ./node_modules/antd/es/row/index.js
|
|
var row = __webpack_require__(71230);
|
|
// EXTERNAL MODULE: ./node_modules/antd/es/layout/style/index.js + 1 modules
|
|
var layout_style = __webpack_require__(27221);
|
|
// EXTERNAL MODULE: ./node_modules/antd/es/layout/index.js
|
|
var layout = __webpack_require__(97183);
|
|
// EXTERNAL MODULE: ./node_modules/react/index.js
|
|
var react = __webpack_require__(67294);
|
|
// EXTERNAL MODULE: ./src/.umi-production/exports.ts + 8 modules
|
|
var _umi_production_exports = __webpack_require__(89214);
|
|
// EXTERNAL MODULE: ./node_modules/antd/es/skeleton/style/index.js + 1 modules
|
|
var skeleton_style = __webpack_require__(61099);
|
|
// EXTERNAL MODULE: ./node_modules/antd/es/skeleton/index.js + 11 modules
|
|
var skeleton = __webpack_require__(73481);
|
|
// EXTERNAL MODULE: ./node_modules/@babel/runtime/helpers/objectSpread2.js
|
|
var objectSpread2 = __webpack_require__(42122);
|
|
var objectSpread2_default = /*#__PURE__*/__webpack_require__.n(objectSpread2);
|
|
// EXTERNAL MODULE: ./node_modules/@babel/runtime/helpers/regeneratorRuntime.js
|
|
var regeneratorRuntime = __webpack_require__(17061);
|
|
var regeneratorRuntime_default = /*#__PURE__*/__webpack_require__.n(regeneratorRuntime);
|
|
// EXTERNAL MODULE: ./node_modules/@babel/runtime/helpers/asyncToGenerator.js
|
|
var asyncToGenerator = __webpack_require__(17156);
|
|
var asyncToGenerator_default = /*#__PURE__*/__webpack_require__.n(asyncToGenerator);
|
|
// EXTERNAL MODULE: ./node_modules/@babel/runtime/helpers/slicedToArray.js
|
|
var slicedToArray = __webpack_require__(27424);
|
|
var slicedToArray_default = /*#__PURE__*/__webpack_require__.n(slicedToArray);
|
|
// EXTERNAL MODULE: ./node_modules/@babel/runtime/helpers/objectWithoutProperties.js
|
|
var objectWithoutProperties = __webpack_require__(70215);
|
|
var objectWithoutProperties_default = /*#__PURE__*/__webpack_require__.n(objectWithoutProperties);
|
|
// EXTERNAL MODULE: ./node_modules/react-beautiful-dnd/dist/react-beautiful-dnd.esm.js + 27 modules
|
|
var react_beautiful_dnd_esm = __webpack_require__(66012);
|
|
;// CONCATENATED MODULE: ./src/layouts/virtualDetail/LeftMenus/index.less?modules
|
|
// extracted by mini-css-extract-plugin
|
|
/* harmony default export */ var LeftMenusmodules = ({"flex_box_center":"flex_box_center___DQ9X1","flex_space_between":"flex_space_between___FvB3U","flex_box_vertical_center":"flex_box_vertical_center___CjjN6","flex_box_center_end":"flex_box_center_end___kfWYR","flex_box_column":"flex_box_column___P4a8M","leftMenu":"leftMenu___Xh9Tv","menuText":"menuText___r8qUK","list":"list___gc6zr","icon":"icon___BIyI5","name":"name___EvZQx","activeCssOne":"activeCssOne___bjRI_","activeCssTwo":"activeCssTwo___X0Axs"});
|
|
// EXTERNAL MODULE: ./node_modules/react/jsx-runtime.js
|
|
var jsx_runtime = __webpack_require__(85893);
|
|
;// CONCATENATED MODULE: ./src/layouts/virtualDetail/LeftMenus/index.tsx
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
var _excluded = ["virtualSpaces", "globalSetting", "user", "loading", "dispatch", "children"];
|
|
|
|
|
|
|
|
|
|
|
|
|
|
var Menus = function Menus(_ref) {
|
|
var virtualSpaces = _ref.virtualSpaces,
|
|
globalSetting = _ref.globalSetting,
|
|
user = _ref.user,
|
|
loading = _ref.loading,
|
|
dispatch = _ref.dispatch,
|
|
_children = _ref.children,
|
|
props = objectWithoutProperties_default()(_ref, _excluded);
|
|
var query = (0,_umi_production_exports.useParams)();
|
|
var location = (0,_umi_production_exports.useLocation)();
|
|
//展开的Key值
|
|
var _useState = (0,react.useState)([]),
|
|
_useState2 = slicedToArray_default()(_useState, 2),
|
|
openFirstKey = _useState2[0],
|
|
setOpenFirstKey = _useState2[1];
|
|
var menus = virtualSpaces.menus;
|
|
console.log(menus, 'menus');
|
|
(0,react.useEffect)(function () {
|
|
getMenus();
|
|
}, []);
|
|
var SubmenuIcons = {
|
|
syllabuses: 'iconfont font18 icon-jiaoxuedagang',
|
|
courses: 'iconfont font18 icon-kechengziyuan',
|
|
shixuns: 'iconfont font18 icon-shixunxiangmu',
|
|
videos: 'iconfont font18 icon-shipinziyuan',
|
|
attachments: 'iconfont icon-kejianziyuan',
|
|
members: 'iconfont font18 icon-chengyuanguanli2',
|
|
notices: 'iconfont font18 icon-tongzhigonggao',
|
|
graphs: 'iconfont font18 icon-zhishitupu',
|
|
achievements: 'iconfont font18 icon-jiaoyanchengguo',
|
|
vresearches: 'iconfont font18 icon-VRyantao',
|
|
leaderboards: 'iconfont font18 icon-gongxianpaihang',
|
|
news: 'iconfont font18 icon-tongzhigonggao',
|
|
collaborates: 'iconfont font18 icon-jiaoxuexietong',
|
|
educations: 'iconfont font18 icon-kechengziyuan',
|
|
practices: 'iconfont font18 icon-jiaoyanchengguo',
|
|
communities: 'iconfont font18 icon-gongxianpaihang',
|
|
managements: 'iconfont font18 icon-shezhi6'
|
|
};
|
|
var getMenus = /*#__PURE__*/function () {
|
|
var _ref2 = asyncToGenerator_default()( /*#__PURE__*/regeneratorRuntime_default()().mark(function _callee() {
|
|
var res, key, id;
|
|
return regeneratorRuntime_default()().wrap(function _callee$(_context) {
|
|
while (1) switch (_context.prev = _context.next) {
|
|
case 0:
|
|
_context.next = 2;
|
|
return dispatch({
|
|
type: 'virtualSpaces/getVirtualSpacesMenus',
|
|
payload: {
|
|
id: query.virtual_spacesId
|
|
}
|
|
});
|
|
case 2:
|
|
res = _context.sent;
|
|
key = [];
|
|
id = '';
|
|
res === null || res === void 0 ? void 0 : res.forEach(function (e) {
|
|
var _e$children;
|
|
e === null || e === void 0 ? void 0 : (_e$children = e.children) === null || _e$children === void 0 ? void 0 : _e$children.forEach(function (k) {
|
|
var _location$pathname;
|
|
if (location !== null && location !== void 0 && (_location$pathname = location.pathname) !== null && _location$pathname !== void 0 && _location$pathname.includes(k.module_url)) {
|
|
id = k.id;
|
|
}
|
|
});
|
|
key.push(e.id);
|
|
});
|
|
setOpenFirstKey(key);
|
|
dispatch({
|
|
type: 'virtualSpaces/setActionTabs',
|
|
payload: {
|
|
module_id: id
|
|
}
|
|
});
|
|
case 8:
|
|
case "end":
|
|
return _context.stop();
|
|
}
|
|
}, _callee);
|
|
}));
|
|
return function getMenus() {
|
|
return _ref2.apply(this, arguments);
|
|
};
|
|
}();
|
|
var onDragEnd = /*#__PURE__*/function () {
|
|
var _ref3 = asyncToGenerator_default()( /*#__PURE__*/regeneratorRuntime_default()().mark(function _callee2(data) {
|
|
return regeneratorRuntime_default()().wrap(function _callee2$(_context2) {
|
|
while (1) switch (_context2.prev = _context2.next) {
|
|
case 0:
|
|
case "end":
|
|
return _context2.stop();
|
|
}
|
|
}, _callee2);
|
|
}));
|
|
return function onDragEnd(_x) {
|
|
return _ref3.apply(this, arguments);
|
|
};
|
|
}();
|
|
return /*#__PURE__*/(0,jsx_runtime.jsx)("section", {
|
|
className: LeftMenusmodules.leftMenu,
|
|
children: /*#__PURE__*/(0,jsx_runtime.jsx)(skeleton/* default */.Z, {
|
|
loading: loading.effects['virtualSpaces/getVirtualSpacesMenus'],
|
|
children: menus === null || menus === void 0 ? void 0 : menus.map(function (v, k) {
|
|
var _v$children;
|
|
var bool = v === null || v === void 0 ? void 0 : (_v$children = v.children) === null || _v$children === void 0 ? void 0 : _v$children.some(function (e) {
|
|
return location.pathname.indexOf(e.module_url) > -1;
|
|
});
|
|
bool = bool || location.pathname === (v === null || v === void 0 ? void 0 : v.module_url);
|
|
return /*#__PURE__*/(0,jsx_runtime.jsxs)("ul", {
|
|
children: [/*#__PURE__*/(0,jsx_runtime.jsx)("li", {
|
|
className: bool && LeftMenusmodules.activeCssOne,
|
|
onClick: function onClick() {
|
|
if ((v === null || v === void 0 ? void 0 : v.icon_type) === 'managements') {
|
|
_umi_production_exports.history.push(v === null || v === void 0 ? void 0 : v.module_url);
|
|
}
|
|
// if (openFirstKey?.includes(v.id)) {
|
|
// setOpenFirstKey(openFirstKey?.filter((e: any) => e !== v.id))
|
|
// } else {
|
|
// setOpenFirstKey([...openFirstKey, v.id])
|
|
// }
|
|
},
|
|
children: /*#__PURE__*/(0,jsx_runtime.jsxs)("div", {
|
|
className: LeftMenusmodules.list,
|
|
style: (v === null || v === void 0 ? void 0 : v.icon_type) === 'managements' ? {
|
|
cursor: 'pointer'
|
|
} : {},
|
|
children: [/*#__PURE__*/(0,jsx_runtime.jsxs)("span", {
|
|
className: LeftMenusmodules.icon,
|
|
children: [/*#__PURE__*/(0,jsx_runtime.jsx)("i", {
|
|
className: SubmenuIcons === null || SubmenuIcons === void 0 ? void 0 : SubmenuIcons[v.icon_type]
|
|
}), " "]
|
|
}), /*#__PURE__*/(0,jsx_runtime.jsx)("span", {
|
|
className: LeftMenusmodules.name,
|
|
children: v.name
|
|
})]
|
|
})
|
|
}), (openFirstKey === null || openFirstKey === void 0 ? void 0 : openFirstKey.includes(v.id)) && /*#__PURE__*/(0,jsx_runtime.jsx)(react_beautiful_dnd_esm/* DragDropContext */.Z5, {
|
|
onDragEnd: onDragEnd,
|
|
children: /*#__PURE__*/(0,jsx_runtime.jsx)(react_beautiful_dnd_esm/* Droppable */.bK, {
|
|
droppableId: String(v.id),
|
|
children: function children(provided, snapshot) {
|
|
var _v$children2;
|
|
return /*#__PURE__*/(0,jsx_runtime.jsx)("ul", objectSpread2_default()(objectSpread2_default()({
|
|
ref: provided.innerRef
|
|
}, provided.droppableProps), {}, {
|
|
children: v === null || v === void 0 ? void 0 : (_v$children2 = v.children) === null || _v$children2 === void 0 ? void 0 : _v$children2.map(function (val, key) {
|
|
var _val$id;
|
|
return /*#__PURE__*/(0,jsx_runtime.jsx)(react_beautiful_dnd_esm/* Draggable */._l, {
|
|
draggableId: "".concat((_val$id = val.id) === null || _val$id === void 0 ? void 0 : _val$id.toString(), "-").concat(k, "-").concat(key),
|
|
index: key,
|
|
isDragDisabled: true,
|
|
children: function children(provided, snapshot) {
|
|
return /*#__PURE__*/(0,jsx_runtime.jsx)("div", objectSpread2_default()(objectSpread2_default()(objectSpread2_default()({
|
|
ref: provided.innerRef
|
|
}, provided.draggableProps), provided.dragHandleProps), {}, {
|
|
children: /*#__PURE__*/(0,jsx_runtime.jsx)("li", {
|
|
className: location.pathname.indexOf(val.module_url) > -1 && LeftMenusmodules.activeCssTwo,
|
|
children: /*#__PURE__*/(0,jsx_runtime.jsx)("span", {
|
|
className: LeftMenusmodules.menuText,
|
|
onClick: function onClick(e) {
|
|
_umi_production_exports.history.push(val.module_url);
|
|
dispatch({
|
|
type: 'virtualSpaces/setActionTabs',
|
|
payload: {
|
|
module_id: v.id
|
|
}
|
|
});
|
|
},
|
|
children: val.name
|
|
})
|
|
})
|
|
}), key);
|
|
}
|
|
}, val.id);
|
|
})
|
|
}));
|
|
}
|
|
})
|
|
})]
|
|
}, k);
|
|
})
|
|
})
|
|
});
|
|
};
|
|
/* harmony default export */ var LeftMenus = ((0,_umi_production_exports.connect)(function (_ref4) {
|
|
var virtualSpaces = _ref4.virtualSpaces,
|
|
loading = _ref4.loading,
|
|
globalSetting = _ref4.globalSetting,
|
|
user = _ref4.user;
|
|
return {
|
|
virtualSpaces: virtualSpaces,
|
|
globalSetting: globalSetting,
|
|
user: user,
|
|
loading: loading
|
|
};
|
|
})(Menus));
|
|
// EXTERNAL MODULE: ./src/layouts/virtualDetail/TopBanner/index.tsx + 1 modules
|
|
var TopBanner = __webpack_require__(49620);
|
|
;// CONCATENATED MODULE: ./src/layouts/virtualDetail/TopPlanBanner/index.less?modules
|
|
// extracted by mini-css-extract-plugin
|
|
/* harmony default export */ var TopPlanBannermodules = ({"bg":"bg___kZNV_","headName":"headName___ZMo2u"});
|
|
// EXTERNAL MODULE: ./src/utils/env.ts + 1 modules
|
|
var env = __webpack_require__(59758);
|
|
;// CONCATENATED MODULE: ./src/layouts/virtualDetail/TopPlanBanner/index.tsx
|
|
|
|
|
|
|
|
|
|
|
|
|
|
var TopPlanBanner_TopBanner = function TopBanner(_ref) {
|
|
var virtualSpaces = _ref.virtualSpaces,
|
|
user = _ref.user,
|
|
dispatch = _ref.dispatch;
|
|
var virtualSpacesDetails = virtualSpaces.virtualSpacesDetails;
|
|
return /*#__PURE__*/(0,jsx_runtime.jsx)("div", {
|
|
className: TopPlanBannermodules.bg,
|
|
style: {
|
|
background: "url('".concat(env/* default.API_SERVER */.Z.API_SERVER + (virtualSpacesDetails === null || virtualSpacesDetails === void 0 ? void 0 : virtualSpacesDetails.backbground_image_url), "') no-repeat center center")
|
|
},
|
|
children: /*#__PURE__*/(0,jsx_runtime.jsx)("div", {
|
|
className: TopPlanBannermodules.headName,
|
|
children: /*#__PURE__*/(0,jsx_runtime.jsxs)("span", {
|
|
children: [" ", virtualSpacesDetails === null || virtualSpacesDetails === void 0 ? void 0 : virtualSpacesDetails.name]
|
|
})
|
|
})
|
|
});
|
|
};
|
|
/* harmony default export */ var TopPlanBanner = ((0,_umi_production_exports.connect)(function (_ref2) {
|
|
var virtualSpaces = _ref2.virtualSpaces,
|
|
user = _ref2.user;
|
|
return {
|
|
virtualSpaces: virtualSpaces,
|
|
user: user
|
|
};
|
|
})(TopPlanBanner_TopBanner));
|
|
;// CONCATENATED MODULE: ./src/layouts/virtualDetail/LeftPlanMenus/index.less?modules
|
|
// extracted by mini-css-extract-plugin
|
|
/* harmony default export */ var LeftPlanMenusmodules = ({"flex_box_center":"flex_box_center___tyjzz","flex_space_between":"flex_space_between___twMxD","flex_box_vertical_center":"flex_box_vertical_center___rpdJ6","flex_box_center_end":"flex_box_center_end___HPgPu","flex_box_column":"flex_box_column___Xw8TQ","menuWrap":"menuWrap___oMbDo","nav":"nav___tDkKA","active":"active___CEg8Y"});
|
|
;// CONCATENATED MODULE: ./src/layouts/virtualDetail/LeftPlanMenus/index.tsx
|
|
|
|
|
|
|
|
|
|
|
|
var LeftPlanMenus_excluded = ["user", "globalSetting", "loading", "dispatch", "virtualSpaces"];
|
|
|
|
|
|
|
|
|
|
|
|
|
|
var Banner = function Banner(_ref) {
|
|
var _renderList;
|
|
var user = _ref.user,
|
|
globalSetting = _ref.globalSetting,
|
|
loading = _ref.loading,
|
|
dispatch = _ref.dispatch,
|
|
virtualSpaces = _ref.virtualSpaces,
|
|
props = objectWithoutProperties_default()(_ref, LeftPlanMenus_excluded);
|
|
var location = (0,_umi_production_exports.useLocation)();
|
|
var _useState = (0,react.useState)(),
|
|
_useState2 = slicedToArray_default()(_useState, 2),
|
|
activeKey = _useState2[0],
|
|
setActiveKey = _useState2[1];
|
|
var params = (0,_umi_production_exports.useParams)();
|
|
var virtual_spacesId = params.virtual_spacesId;
|
|
var _virtualSpaces$menus = virtualSpaces.menus,
|
|
menus = _virtualSpaces$menus === void 0 ? [] : _virtualSpaces$menus;
|
|
(0,react.useEffect)(function () {
|
|
var _location$pathname$sp;
|
|
var active = (_location$pathname$sp = location.pathname.split('/')) === null || _location$pathname$sp === void 0 ? void 0 : _location$pathname$sp[3];
|
|
setActiveKey(active);
|
|
}, [location.pathname]);
|
|
(0,react.useEffect)(function () {
|
|
getMenus();
|
|
}, []);
|
|
var getMenus = /*#__PURE__*/function () {
|
|
var _ref2 = asyncToGenerator_default()( /*#__PURE__*/regeneratorRuntime_default()().mark(function _callee() {
|
|
return regeneratorRuntime_default()().wrap(function _callee$(_context) {
|
|
while (1) switch (_context.prev = _context.next) {
|
|
case 0:
|
|
dispatch({
|
|
type: 'virtualSpaces/getVirtualSpacesMenus',
|
|
payload: {
|
|
id: virtual_spacesId
|
|
}
|
|
});
|
|
case 1:
|
|
case "end":
|
|
return _context.stop();
|
|
}
|
|
}, _callee);
|
|
}));
|
|
return function getMenus() {
|
|
return _ref2.apply(this, arguments);
|
|
};
|
|
}();
|
|
var renderList = function renderList() {
|
|
var list = menus.map(function (e) {
|
|
var param = listPlanLibrary.find(function (k) {
|
|
return k.icon_type === e.icon_type;
|
|
});
|
|
return objectSpread2_default()(objectSpread2_default()({}, e), {}, {
|
|
icon: param === null || param === void 0 ? void 0 : param.icon
|
|
});
|
|
});
|
|
list = list.filter(function (e) {
|
|
return !e.hidden;
|
|
});
|
|
return list;
|
|
};
|
|
return /*#__PURE__*/(0,jsx_runtime.jsx)("div", {
|
|
className: LeftPlanMenusmodules.menuWrap,
|
|
children: /*#__PURE__*/(0,jsx_runtime.jsx)("div", {
|
|
className: LeftPlanMenusmodules.nav,
|
|
children: (_renderList = renderList()) === null || _renderList === void 0 ? void 0 : _renderList.map(function (item) {
|
|
var icon_type = item.icon_type,
|
|
icon = item.icon,
|
|
name = item.name,
|
|
module_url = item.module_url;
|
|
return /*#__PURE__*/(0,jsx_runtime.jsxs)(_umi_production_exports.Link, {
|
|
to: module_url,
|
|
onClick: function onClick() {
|
|
return setActiveKey(icon_type);
|
|
},
|
|
className: activeKey === icon_type ? LeftPlanMenusmodules.active : '',
|
|
children: [/*#__PURE__*/(0,jsx_runtime.jsx)("i", {
|
|
className: icon
|
|
}), /*#__PURE__*/(0,jsx_runtime.jsx)("span", {
|
|
title: name,
|
|
children: name
|
|
})]
|
|
}, icon_type);
|
|
})
|
|
})
|
|
});
|
|
};
|
|
/* harmony default export */ var LeftPlanMenus = ((0,_umi_production_exports.connect)(function (_ref3) {
|
|
var user = _ref3.user,
|
|
loading = _ref3.loading,
|
|
VirtualSpacesModelState = _ref3.virtualSpaces,
|
|
globalSetting = _ref3.globalSetting;
|
|
return {
|
|
user: user,
|
|
globalSetting: globalSetting,
|
|
virtualSpaces: VirtualSpacesModelState,
|
|
loading: loading.models.index
|
|
};
|
|
})(Banner));
|
|
// EXTERNAL MODULE: ./src/utils/util.tsx
|
|
var util = __webpack_require__(29427);
|
|
;// CONCATENATED MODULE: ./src/layouts/virtualDetail/index.tsx
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
var listPlanLibrary = [{
|
|
icon_type: "homepage",
|
|
name: "101计划-软件工程",
|
|
icon: 'iconfont icon-a-101jihua'
|
|
}, {
|
|
icon_type: "announcement",
|
|
name: "通知公告",
|
|
icon: 'iconfont icon-tongzhigonggao1'
|
|
}, {
|
|
icon_type: "survey",
|
|
name: "课程调研",
|
|
icon: 'iconfont icon-kechengtiaoyan'
|
|
}, {
|
|
icon_type: "knowledge",
|
|
name: "知识体系",
|
|
icon: 'iconfont icon-zhishitixi'
|
|
}, {
|
|
icon_type: "plan",
|
|
name: "课程教案",
|
|
icon: 'iconfont icon-kechengjiaoan'
|
|
}, {
|
|
icon_type: "material",
|
|
name: "课程教材",
|
|
icon: 'iconfont icon-kechengjiaocai'
|
|
}, {
|
|
icon_type: "experiment",
|
|
name: "实验体系",
|
|
icon: 'iconfont icon-shijianxiangmu'
|
|
}, {
|
|
icon_type: "resources",
|
|
name: "教学资源",
|
|
icon: 'iconfont icon-jiaoxueziyuan'
|
|
},
|
|
// {
|
|
// icon_type: "contribute",
|
|
// name: "社区贡献",
|
|
// icon: 'iconfont icon-shijianxiangmu',
|
|
// },
|
|
{
|
|
icon_type: "settings",
|
|
name: "社区设置",
|
|
icon: 'iconfont icon-shequshezhi'
|
|
}];
|
|
var Content = layout/* default.Content */.Z.Content;
|
|
var Page = function Page(_ref) {
|
|
var _listPlanLibrary$map, _location$pathname, _location$pathname$sp;
|
|
var globalSetting = _ref.globalSetting,
|
|
user = _ref.user,
|
|
dispatch = _ref.dispatch,
|
|
children = _ref.children,
|
|
virtualSpaces = _ref.virtualSpaces;
|
|
var urlParams = (0,_umi_production_exports.useParams)();
|
|
var location = (0,_umi_production_exports.useLocation)();
|
|
var virtualSpacesDetails = virtualSpaces.virtualSpacesDetails,
|
|
loading = virtualSpaces.loading;
|
|
//新版本的虚拟社区
|
|
var newPage = listPlanLibrary === null || listPlanLibrary === void 0 ? void 0 : (_listPlanLibrary$map = listPlanLibrary.map(function (e) {
|
|
return e.icon_type;
|
|
})) === null || _listPlanLibrary$map === void 0 ? void 0 : _listPlanLibrary$map.includes(location === null || location === void 0 ? void 0 : (_location$pathname = location.pathname) === null || _location$pathname === void 0 ? void 0 : (_location$pathname$sp = _location$pathname.split('/')) === null || _location$pathname$sp === void 0 ? void 0 : _location$pathname$sp[3]);
|
|
(0,react.useEffect)(function () {
|
|
dispatch({
|
|
type: "globalSetting/setTheme",
|
|
payload: "vspaces"
|
|
});
|
|
return function () {
|
|
dispatch({
|
|
type: "globalSetting/setTheme",
|
|
payload: "default"
|
|
});
|
|
};
|
|
}, []);
|
|
(0,react.useEffect)(function () {
|
|
dispatch({
|
|
type: 'virtualSpaces/getVirtualSpacesDetails',
|
|
payload: {
|
|
id: urlParams === null || urlParams === void 0 ? void 0 : urlParams.virtual_spacesId
|
|
}
|
|
});
|
|
}, []);
|
|
(0,react.useEffect)(function () {
|
|
if (virtualSpacesDetails !== null && virtualSpacesDetails !== void 0 && virtualSpacesDetails.id && loading) {
|
|
var _virtualSpacesDetails;
|
|
if (newPage && !(virtualSpacesDetails !== null && virtualSpacesDetails !== void 0 && (_virtualSpacesDetails = virtualSpacesDetails.category_url) !== null && _virtualSpacesDetails !== void 0 && _virtualSpacesDetails.includes(util/* vtrsKey */.AS))) {
|
|
_umi_production_exports.history.replace('/404');
|
|
return;
|
|
}
|
|
dispatch({
|
|
type: "virtualSpaces/setVirtualSpacesLoading",
|
|
payload: false
|
|
});
|
|
}
|
|
}, [virtualSpacesDetails, loading]);
|
|
if (loading) {
|
|
return /*#__PURE__*/(0,jsx_runtime.jsx)(jsx_runtime.Fragment, {});
|
|
}
|
|
return /*#__PURE__*/(0,jsx_runtime.jsx)("div", {
|
|
children: newPage ? /*#__PURE__*/(0,jsx_runtime.jsxs)(jsx_runtime.Fragment, {
|
|
children: [/*#__PURE__*/(0,jsx_runtime.jsx)(TopPlanBanner, {}), /*#__PURE__*/(0,jsx_runtime.jsxs)(row/* default */.Z, {
|
|
className: "bg-white",
|
|
wrap: false,
|
|
children: [/*#__PURE__*/(0,jsx_runtime.jsx)(LeftPlanMenus, {}), /*#__PURE__*/(0,jsx_runtime.jsx)(Content, {
|
|
style: {
|
|
flex: 1,
|
|
overflow: 'hidden'
|
|
},
|
|
children: /*#__PURE__*/(0,jsx_runtime.jsx)(_umi_production_exports.Outlet, {})
|
|
})]
|
|
})]
|
|
}) : /*#__PURE__*/(0,jsx_runtime.jsxs)(jsx_runtime.Fragment, {
|
|
children: [/*#__PURE__*/(0,jsx_runtime.jsx)(TopBanner/* default */.Z, {}), /*#__PURE__*/(0,jsx_runtime.jsx)("aside", {
|
|
className: "edu-container mb20",
|
|
children: /*#__PURE__*/(0,jsx_runtime.jsxs)(row/* default */.Z, {
|
|
children: [/*#__PURE__*/(0,jsx_runtime.jsx)(LeftMenus, {}), /*#__PURE__*/(0,jsx_runtime.jsx)(Content, {
|
|
className: "ml20",
|
|
children: /*#__PURE__*/(0,jsx_runtime.jsx)(_umi_production_exports.Outlet, {})
|
|
})]
|
|
})
|
|
})]
|
|
})
|
|
});
|
|
};
|
|
/* harmony default export */ var virtualDetail = ((0,_umi_production_exports.connect)(function (_ref2) {
|
|
var globalSetting = _ref2.globalSetting,
|
|
user = _ref2.user,
|
|
virtualSpaces = _ref2.virtualSpaces;
|
|
return {
|
|
globalSetting: globalSetting,
|
|
user: user,
|
|
virtualSpaces: virtualSpaces
|
|
};
|
|
})(Page));
|
|
|
|
/***/ })
|
|
|
|
}]); |