"use strict"; (self["webpackChunk"] = self["webpackChunk"] || []).push([[94662],{ /***/ 40640: /*!***********************************************************!*\ !*** ./src/pages/User/Detail/Paths/index.tsx + 3 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 */ Detail_Paths; } }); // 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/_@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/_react@17.0.2@react/index.js var _react_17_0_2_react = __webpack_require__(59301); // EXTERNAL MODULE: ./src/.umi-production/exports.ts var _umi_production_exports = __webpack_require__(80608); // EXTERNAL MODULE: ./node_modules/_antd@5.9.0@antd/es/skeleton/index.js + 12 modules var skeleton = __webpack_require__(66999); // EXTERNAL MODULE: ./node_modules/_antd@5.9.0@antd/es/pagination/index.js + 10 modules var pagination = __webpack_require__(86859); ;// CONCATENATED MODULE: ./src/pages/User/Detail/Paths/index.less?modules // extracted by mini-css-extract-plugin /* harmony default export */ var Pathsmodules = ({"flex_box_center":"flex_box_center___IuXaZ","flex_space_between":"flex_space_between___FgiDp","flex_box_vertical_center":"flex_box_vertical_center____WBjP","flex_box_center_end":"flex_box_center_end___CPJQF","flex_box_column":"flex_box_column___ivE9u","wrap":"wrap___iwvHC","midWrap":"midWrap___JC0F2","color999":"color999___aMrEh","orderWrap":"orderWrap___gxKVG","orderIconWrap":"orderIconWrap___O1L7r","orderAsc":"orderAsc___aghh_","orderDesc":"orderDesc___q0uG2","color0152d9":"color0152d9___UuR9f","h10":"h10___dl8aJ","cursorPointer":"cursorPointer___mLanQ","orderTextWrap":"orderTextWrap___ghSqq","cardWrap":"cardWrap___Wv0mR","countWrap":"countWrap___NIkIb","type":"type___m6IRF"}); // EXTERNAL MODULE: ./node_modules/_antd@5.9.0@antd/es/tooltip/index.js + 3 modules var tooltip = __webpack_require__(6848); // EXTERNAL MODULE: ./node_modules/_antd@5.9.0@antd/es/table/index.js + 85 modules var table = __webpack_require__(51945); ;// CONCATENATED MODULE: ./src/pages/User/Detail/Paths/components/Items/index.less?modules // extracted by mini-css-extract-plugin /* harmony default export */ var Itemsmodules = ({"flex_box_center":"flex_box_center___n5pEG","flex_space_between":"flex_space_between___L_HRa","flex_box_vertical_center":"flex_box_vertical_center___zOctL","flex_box_center_end":"flex_box_center_end___DyJfV","flex_box_column":"flex_box_column___NS2Dc","wrap":"wrap___gPCi1","createIconWrap":"createIconWrap___za5EO","createIcon":"createIcon___X8anF","leftIcon":"leftIcon___LNfFE","rightIcon":"rightIcon___viUSa","createTextWrap":"createTextWrap___Dt6o2","createText":"createText___EqVCQ","tagWrap":"tagWrap___P1scY","payWrap":"payWrap___PREW8","tagName":"tagName___xzzOb","tagJupyterWrap":"tagJupyterWrap___aiBoW","tagJupyterNameWrap":"tagJupyterNameWrap___oX9QT","tagJupyterName":"tagJupyterName___wcrcb","imgWrap":"imgWrap___AsfvG","cardBottom":"cardBottom____ghZa","bottomNameWrap":"bottomNameWrap___O6cIY","bottomName":"bottomName___s6i6n","bottomContentWrap":"bottomContentWrap___BqnnB","bottomOwnerName":"bottomOwnerName___D8FPl","bottomVisitsCount":"bottomVisitsCount___TFnc8","excellentTag":"excellentTag___IyAVX","righttag":"righttag___QMlGE","tagY":"tagY___S9fxB","tagB":"tagB___R3ZdV","text":"text___vAK5m"}); // EXTERNAL MODULE: ./node_modules/_dayjs@1.11.13@dayjs/dayjs.min.js var dayjs_min = __webpack_require__(61186); var dayjs_min_default = /*#__PURE__*/__webpack_require__.n(dayjs_min); // EXTERNAL MODULE: ./src/utils/util.tsx var util = __webpack_require__(27876); // EXTERNAL MODULE: ./src/components/ui-customization/index.tsx + 30 modules var ui_customization = __webpack_require__(92073); // EXTERNAL MODULE: ./node_modules/_react@17.0.2@react/jsx-runtime.js var jsx_runtime = __webpack_require__(37712); ;// CONCATENATED MODULE: ./src/pages/User/Detail/Paths/components/Items/table.tsx var Items = function Items(_ref) { var data = _ref.data, number = _ref.number, params = _ref.params, setParams = _ref.setParams, getPaths = _ref.getPaths; var columns = [{ title: '序号', dataIndex: 'index', key: 'index', width: 55, render: function render(text, item, index) { return /*#__PURE__*/(0,jsx_runtime.jsx)("span", { children: number + index + 1 }); } }, { title: '实践课程名称', dataIndex: 'name', // width: 150, // ellipsis: true, sorter: true, sortOrder: params.sort_by === 'name' ? params.sort_direction === 'desc' ? 'descend' : 'ascend' : null, key: 'name', render: function render(text) { return /*#__PURE__*/(0,jsx_runtime.jsx)(tooltip/* default */.Z, { title: text, placement: "bottomLeft", children: /*#__PURE__*/(0,jsx_runtime.jsx)("span", { className: Itemsmodules.text, children: text }) }); } }, { title: '管理员', dataIndex: 'owner_name', key: 'owner_name', width: 78, ellipsis: true, render: function render(text) { return /*#__PURE__*/(0,jsx_runtime.jsx)(tooltip/* default */.Z, { title: text || '--', placement: "bottomLeft", children: /*#__PURE__*/(0,jsx_runtime.jsx)("span", { children: text || '--' }) }); } }, { title: '合作者', dataIndex: 'members', key: 'members', width: 134, ellipsis: true, render: function render(text) { return /*#__PURE__*/(0,jsx_runtime.jsx)(tooltip/* default */.Z, { title: text.join("、"), placement: "bottomLeft", children: /*#__PURE__*/(0,jsx_runtime.jsx)("span", { children: text.join("、") }) }); } }, { title: '学习人数', dataIndex: 'members_count', width: 80, key: 'members_count', render: function render(text) { return /*#__PURE__*/(0,jsx_runtime.jsx)("span", { className: "c-grey-666", children: text }); } }, { title: '创建时间', dataIndex: 'created_at', key: 'created_at', sorter: true, sortOrder: params.sort_by === 'created_at' ? params.sort_direction === 'desc' ? 'descend' : 'ascend' : null, width: 110, render: function render(text) { return /*#__PURE__*/(0,jsx_runtime.jsx)("span", { className: "c-grey-666", children: dayjs_min_default()(text).format("YYYY-MM-DD") }); } }, { title: '章节数', dataIndex: 'stages_count', width: 70, key: 'stages_count', render: function render(text) { return /*#__PURE__*/(0,jsx_runtime.jsx)("span", { className: "c-grey-666", children: text }); } }, { title: '实训数', dataIndex: 'shixuns_count', width: 70, key: 'shixuns_count', render: function render(text) { return /*#__PURE__*/(0,jsx_runtime.jsx)("span", { className: "c-grey-666", children: text }); } }, { title: '课程标签', dataIndex: 'excellent', width: 88, key: 'excellent', align: 'center', render: function render(text, v) { return /*#__PURE__*/(0,jsx_runtime.jsxs)(jsx_runtime.Fragment, { children: [v.featured > 0 && /*#__PURE__*/(0,jsx_runtime.jsxs)("div", { className: Itemsmodules.tagY, children: [v.featured === 1 && '国家一流', v.featured === 2 && '军队一流', v.featured === 3 && '省级一流', v.featured === 4 && '精品课程'] }), text && /*#__PURE__*/(0,jsx_runtime.jsx)("div", { className: Itemsmodules.tagB, children: "\u5F00\u653E\u8BFE\u7A0B" }), !(v !== null && v !== void 0 && v.featured) && !text && /*#__PURE__*/(0,jsx_runtime.jsx)("span", { className: "c-grey-666", children: "- -" })] }); } }, { title: '操作', dataIndex: 'name', key: 'name', width: 65, align: 'right', render: function render(text, item) { // if (item.can_visited) { return /*#__PURE__*/(0,jsx_runtime.jsx)("span", { className: "current-primary", onClick: function onClick(e) { e.stopPropagation(); (0,util/* openNewWindow */.xg)("/paths/".concat(item.id)); }, children: "\u8BE6\u60C5" }); // 详情 // } else { // return 详情 // } } }]; return /*#__PURE__*/(0,jsx_runtime.jsx)(_react_17_0_2_react.Fragment, { children: /*#__PURE__*/(0,jsx_runtime.jsx)(ui_customization/* CustomTable */.Gi, { children: /*#__PURE__*/(0,jsx_runtime.jsx)(table/* default */.Z, { style: { cursor: 'pointer' }, onRow: function onRow(record) { return { onClick: function onClick(e) { // console.log('------',record); window.open("/paths/".concat(record.id), '_blank'); // window.open(`/classrooms/${params.coursesId}/shixun_homework/${params.categoryId}/${record.id}/comment`, '_blank'); // history.push(`/classrooms/${params.coursesId}/shixun_homework/${params.categoryId}/${record.id}/comment`) } }; }, onChange: function onChange(a, b, c) { if (c.field) params.sort_by = c.field; if (!c.order) params['sort_direction'] = 'asc'; if (c.order === 'ascend') params['sort_direction'] = 'asc'; if (c.order === 'descend') params['sort_direction'] = 'desc'; // if (!c.order) delete params['b_order']; if (!c.order) params['sort_direction'] = 'asc'; setParams(params); getPaths(params); }, pagination: false, dataSource: data, columns: columns }) }) }); }; /* harmony default export */ var Items_table = (Items); // EXTERNAL MODULE: ./node_modules/_lodash@4.17.21@lodash/lodash.js var lodash = __webpack_require__(89392); ;// CONCATENATED MODULE: ./src/pages/User/Detail/Paths/index.tsx var _excluded = ["user", "userDetail", "globalSetting", "loading", "dispatch"]; var Paths = function Paths(_ref) { var _user$userInfo2, _user$userInfo3, _globalSetting$settin; var user = _ref.user, userDetail = _ref.userDetail, globalSetting = _ref.globalSetting, loading = _ref.loading, dispatch = _ref.dispatch, props = objectWithoutProperties_default()(_ref, _excluded); var _useSearchParams = (0,_umi_production_exports.useSearchParams)(), _useSearchParams2 = slicedToArray_default()(_useSearchParams, 1), searchParams = _useSearchParams2[0]; var location = (0,_umi_production_exports.useLocation)(); var username = (0,_react_17_0_2_react.useRef)(); var _useState = (0,_react_17_0_2_react.useState)({}), _useState2 = slicedToArray_default()(_useState, 2), params = _useState2[0], setParams = _useState2[1]; var _useState3 = (0,_react_17_0_2_react.useState)(0), _useState4 = slicedToArray_default()(_useState3, 2), count = _useState4[0], setCount = _useState4[1]; var _useState5 = (0,_react_17_0_2_react.useState)([]), _useState6 = slicedToArray_default()(_useState5, 2), data = _useState6[0], setData = _useState6[1]; var _useState7 = (0,_react_17_0_2_react.useState)(), _useState8 = slicedToArray_default()(_useState7, 2), isCurrent = _useState8[0], setIsCurrent = _useState8[1]; var _useState9 = (0,_react_17_0_2_react.useState)(false), _useState10 = slicedToArray_default()(_useState9, 2), showSearchText = _useState10[0], setShowSearchText = _useState10[1]; var _useState11 = (0,_react_17_0_2_react.useState)([{ label: /*#__PURE__*/(0,jsx_runtime.jsx)("span", { className: "icon-juxingfenbu font14" }), value: 1 }, { label: /*#__PURE__*/(0,jsx_runtime.jsx)("span", { className: "icon-liebiaofenbu font14" }), value: 2 }]), _useState12 = slicedToArray_default()(_useState11, 2), plainOptions = _useState12[0], setPlainOptions = _useState12[1]; var _useState13 = (0,_react_17_0_2_react.useState)(parseInt(localStorage.getItem('PathShowtype')) || 1), _useState14 = slicedToArray_default()(_useState13, 2), showType = _useState14[0], setShowType = _useState14[1]; var throttleCategory = (0,_react_17_0_2_react.useRef)((0,lodash.throttle)(function (category) { return handleChangeCategory(category); }, 500, { trailing: false })); (0,_react_17_0_2_react.useEffect)(function () { throttleCategory.current = (0,lodash.throttle)(handleChangeCategory, 500, { trailing: false }); }, [params]); (0,_react_17_0_2_react.useEffect)(function () { var _location$pathname$sp; username.current = (_location$pathname$sp = location.pathname.split('/')) === null || _location$pathname$sp === void 0 ? void 0 : _location$pathname$sp[2]; var query = { category: searchParams.get("category") || '', status: searchParams.get("category") === 'manage' ? tagsTwo.map(function (item) { return item.id; }).includes(searchParams.get("status")) ? searchParams.get("status") : '' : searchParams.get("category") === "study" || searchParams.get("category") === "collect" ? tags.map(function (item) { return item.id; }).includes(searchParams.get("status")) ? searchParams.get("status") : '' : '', page: 1, per_page: 15, sort_by: 'updated_at', sort_direction: 'desc', username: username.current }; setParams(query); getPaths(query); }, [location.pathname]); (0,_react_17_0_2_react.useEffect)(function () { var _user$userInfo; setIsCurrent(((_user$userInfo = user.userInfo) === null || _user$userInfo === void 0 ? void 0 : _user$userInfo.login) === username.current); }, [(_user$userInfo2 = user.userInfo) === null || _user$userInfo2 === void 0 ? void 0 : _user$userInfo2.login, username.current]); // const currentTabName = location.pathname.split('/')?.[3] || 'classrooms'; // useEffect(() => { // const unSub = mediator.subscribe('user-detail-search', async (data: { currentTabName: string, value: string }) => { // if (currentTabName === data.currentTabName) { // const query: any = { // category: undefined, // status: undefined, // page: 1, // per_page: 16, // sort_by: 'updated_at', // sort_direction: 'desc', // username: username.current, // search: data.value // }; // setParams(query); // setShowSearchText(false); // await getPaths(query); // setShowSearchText(true); // } // }); // return unSub; // }, [isCurrent]); var getPaths = /*#__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: 'userDetail/getPaths', payload: query }); case 2: res = _context.sent; if (res) { setCount((res === null || res === void 0 ? void 0 : res.count) || 0); setData((res === null || res === void 0 ? void 0 : res.subjects) || []); } case 4: case "end": return _context.stop(); } }, _callee); })); return function getPaths(_x) { return _ref2.apply(this, arguments); }; }(); var handleChangeCategory = function handleChangeCategory(category) { var _window$location$href; params.category = category; params.status = ''; if ((_window$location$href = window.location.href.toString()) !== null && _window$location$href !== void 0 && _window$location$href.includes('category')) { (0,util/* replaceParamVal */.jz)('category', category); (0,util/* replaceParamVal */.jz)('status', ''); } else { window.history.replaceState(null, '', window.location.href.indexOf('?') > -1 ? window.location.href + "&category=".concat(category) : "?category=".concat(category)); } params.page = 1; setParams(params); getPaths(params); }; var handleChangeStatus = function handleChangeStatus(status) { var _window$location$href2; params.status = status; params.page = 1; if ((_window$location$href2 = window.location.href.toString()) !== null && _window$location$href2 !== void 0 && _window$location$href2.includes('status')) { (0,util/* replaceParamVal */.jz)('status', status); } else { window.history.replaceState(null, '', window.location.href.indexOf('?') > -1 ? window.location.href + "&status=".concat(status) : "?status=".concat(status)); } setParams(params); getPaths(params); }; var handleChangeOrder = function handleChangeOrder(sort_direction) { params.sort_direction = sort_direction; setParams(params); getPaths(params); }; var handleChangeOrderField = function handleChangeOrderField(sort_by) { params.sort_by = sort_by; params.sort_direction = 'desc'; setParams(params); getPaths(params); }; var handleChangePage = function handleChangePage(page, pageSize) { params.page = page; params.per_page = pageSize; setParams(params); getPaths(params); }; var handleSearch = function handleSearch(v) { params.search = v; params.page = 1; setParams(params); getPaths(params); }; var renderCategoryText = function renderCategoryText() { var category = params.category == "collect" ? "共收藏" : "共参与"; var status = ""; if (params.category === "collect") { status = ""; } if (params.category === "manage") { status = "发布"; } if (params.category === "study") { status = "学习"; } if (!params.category) { status = "实践课程"; } return "".concat(category).concat(count, "\u4E2A").concat(status); }; var renderOrderText = function renderOrderText() { if (params.sort_by === 'updated_at') { return '最近更新'; } if (params.sort_by === 'created_at') { return '最新创建'; } if (params.sort_by === 'name') { return '名称排序'; } return ''; }; var tabs = [{ id: '', name: '全部' }, { id: 'manage', name: "".concat(isCurrent ? '我' : 'TA', "\u7BA1\u7406\u7684") }, { id: 'study', name: "".concat(isCurrent ? '我' : 'TA', "\u5B66\u4E60\u7684") }, { id: 'collect', name: "".concat(isCurrent ? '我' : 'TA', "\u6536\u85CF\u7684") }, { id: 'payed', name: "".concat(isCurrent ? '我' : 'TA', "\u8D2D\u4E70\u7684") }]; var tags = [{ id: '', name: '全部' }, { id: 'unfinished', name: '未完成' }, { id: 'finished', name: '已完成' }]; var tagsTwo = [{ id: '', name: '全部' }, { id: 'editing', name: '编辑中' }, { id: 'applying', name: '待审核' }, { id: 'published', name: '已发布' }]; var realTags = params.category === 'manage' ? tagsTwo : (params === null || params === void 0 ? void 0 : params.category) === "study" || (params === null || params === void 0 ? void 0 : params.category) === "collect" || (params === null || params === void 0 ? void 0 : params.category) === "payed" ? tags : []; return /*#__PURE__*/(0,jsx_runtime.jsxs)("div", { className: Pathsmodules.wrap, children: [/*#__PURE__*/(0,jsx_runtime.jsx)(ui_customization/* CustomTabs */.YG, { value: params.category, onChange: handleChangeCategory, tabBarExtraContent: /*#__PURE__*/(0,jsx_runtime.jsx)(ui_customization/* CustomInput */.t7, { style: { width: 303 }, placeholder: "\u641C\u7D22\u5B9E\u8DF5\u8BFE\u7A0B", value: params.search, onChange: handleSearch }), className: "mb25", dataSource: tabs }), isCurrent && !!params.category && /*#__PURE__*/(0,jsx_runtime.jsx)(ui_customization/* CustomTags */.qp, { title: "\u72B6\u6001", value: params.status, onChange: handleChangeStatus, dataSource: realTags, titleWidth: 28 }), /*#__PURE__*/(0,jsx_runtime.jsxs)("div", { className: Pathsmodules.midWrap, children: [/*#__PURE__*/(0,jsx_runtime.jsx)(ui_customization/* SuperiorSort */.cq, { sortValue: params.sort_direction, dropValue: params.sort_by, onSort: handleChangeOrder, onDrop: handleChangeOrderField }), /*#__PURE__*/(0,jsx_runtime.jsxs)("div", { className: Pathsmodules.type, children: [/*#__PURE__*/(0,jsx_runtime.jsx)("i", { className: showType === 1 ? "iconfont icon-fenbu ".concat(Pathsmodules.cursorPointer, " ").concat(Pathsmodules.color0152d9) : "iconfont icon-fenbu ".concat(Pathsmodules.cursorPointer), onClick: function onClick() { setShowType(1); localStorage.setItem('PathShowtype', '1'); } }), /*#__PURE__*/(0,jsx_runtime.jsx)("span", { className: Pathsmodules.orderDesc, children: /*#__PURE__*/(0,jsx_runtime.jsx)("i", { className: showType === 2 ? "iconfont icon-fenbu-2 ".concat(Pathsmodules.cursorPointer, " ").concat(Pathsmodules.color0152d9, " ") : "iconfont icon-fenbu-2 ".concat(Pathsmodules.cursorPointer), onClick: function onClick() { setShowType(2); localStorage.setItem('PathShowtype', '2'); } }) })] }), ((_user$userInfo3 = user.userInfo) === null || _user$userInfo3 === void 0 ? void 0 : _user$userInfo3.user_identity) !== '学生' && !(globalSetting !== null && globalSetting !== void 0 && (_globalSetting$settin = globalSetting.setting) !== null && _globalSetting$settin !== void 0 && _globalSetting$settin.hide_subject) && /*#__PURE__*/(0,jsx_runtime.jsx)(ui_customization/* CustomButton */.op, { style: { marginLeft: 'auto' }, className: Pathsmodules.btn, onClick: function onClick() { return _umi_production_exports.history.push("/paths/new?username=".concat(username.current)); }, children: "\u65B0\u5EFA\u5B9E\u8DF5\u8BFE\u7A0B" })] }), /*#__PURE__*/(0,jsx_runtime.jsxs)(skeleton/* default */.Z, { loading: loading['userDetail/getPaths'], active: true, paragraph: { rows: 5 }, children: [showType == 1 && /*#__PURE__*/(0,jsx_runtime.jsx)(ui_customization/* CourseList */.cQ, { dataSource: data, right: 23, col: 3 // precision={1} , wrapWidth: 887, loading: false }), showType != 1 && /*#__PURE__*/(0,jsx_runtime.jsx)("div", { className: "mt10", style: { minHeight: 400 }, children: /*#__PURE__*/(0,jsx_runtime.jsx)(Items_table, { number: (params.page - 1) * params.per_page, data: data, params: params, setParams: setParams, getPaths: getPaths }) }), count > 0 && /*#__PURE__*/(0,jsx_runtime.jsx)("div", { className: Pathsmodules.countWrap, children: /*#__PURE__*/(0,jsx_runtime.jsx)(pagination/* default */.Z, { showQuickJumper: true, showSizeChanger: true, pageSizeOptions: ["10", "15", "50", "100", "200"], total: count, onChange: function onChange(page, pageSize) { handleChangePage(page, pageSize); }, pageSize: params.per_page, hideOnSinglePage: true, current: params.page }) })] })] }); }; /* harmony default export */ var Detail_Paths = ((0,_umi_production_exports.connect)(function (_ref3) { var user = _ref3.user, userDetail = _ref3.userDetail, loading = _ref3.loading, globalSetting = _ref3.globalSetting; return { user: user, userDetail: userDetail, globalSetting: globalSetting, loading: loading.effects }; })(Paths)); /***/ }) }]);