You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
NewEduCoderBuild/p__NewPaths__index.42d0fc82...

334 lines
18 KiB

This file contains ambiguous Unicode characters!

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

"use strict";
(self["webpackChunk"] = self["webpackChunk"] || []).push([[86463],{
/***/ 73732:
/*!**************************************************!*\
!*** ./src/pages/NewPaths/index.tsx + 1 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 */ NewPaths; }
});
// 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/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/_antd@5.9.0@antd/es/spin/index.js + 1 modules
var spin = __webpack_require__(71418);
// EXTERNAL MODULE: ./node_modules/_antd@5.9.0@antd/es/tooltip/index.js + 3 modules
var tooltip = __webpack_require__(6848);
// EXTERNAL MODULE: ./node_modules/_react@17.0.2@react/index.js
var _react_17_0_2_react = __webpack_require__(59301);
// EXTERNAL MODULE: ./src/utils/fetch.ts
var fetch = __webpack_require__(35325);
// EXTERNAL MODULE: ./src/.umi-production/exports.ts
var _umi_production_exports = __webpack_require__(80184);
// EXTERNAL MODULE: ./src/utils/hooks/useCustomRequest.ts
var useCustomRequest = __webpack_require__(19637);
;// CONCATENATED MODULE: ./src/pages/NewPaths/index.less?modules
// extracted by mini-css-extract-plugin
/* harmony default export */ var NewPathsmodules = ({"con_warp":"con_warp___QUKxB","head_warp":"head_warp___vpOcM","left_title":"left_title___rjD6O","right_tj":"right_tj___xGTe4","tj_info":"tj_info___TcqPa","course_list":"course_list___Rd1P2","coures_info":"coures_info___zm3rh","course_name":"course_name___CuOMY","item_count_warp":"item_count_warp___K65gE","start_btn":"start_btn___Tuc5P","nodtaWrap":"nodtaWrap___Ww2QL","ListItemActive":"ListItemActive___juszm","ListItem":"ListItem___yd2RN","CollapseStyle":"CollapseStyle___lv4zh"});
// EXTERNAL MODULE: ./src/utils/env.ts + 1 modules
var env = __webpack_require__(67390);
// EXTERNAL MODULE: ./src/components/NoData/index.tsx
var NoData = __webpack_require__(46172);
// EXTERNAL MODULE: ./src/utils/util.tsx
var util = __webpack_require__(1079);
// EXTERNAL MODULE: ./node_modules/_react@17.0.2@react/jsx-runtime.js
var jsx_runtime = __webpack_require__(37712);
;// CONCATENATED MODULE: ./src/pages/NewPaths/index.tsx
var getSubjectInfo = /*#__PURE__*/function () {
var _ref = asyncToGenerator_default()( /*#__PURE__*/regeneratorRuntime_default()().mark(function _callee(params) {
return regeneratorRuntime_default()().wrap(function _callee$(_context) {
while (1) switch (_context.prev = _context.next) {
case 0:
return _context.abrupt("return", (0,fetch/* default */.ZP)("/api/pages/subject_info.json", {
method: 'Get',
params: params
}));
case 1:
case "end":
return _context.stop();
}
}, _callee);
}));
return function getSubjectInfo(_x) {
return _ref.apply(this, arguments);
};
}();
var getStatistic = /*#__PURE__*/function () {
var _ref2 = asyncToGenerator_default()( /*#__PURE__*/regeneratorRuntime_default()().mark(function _callee2(params) {
return regeneratorRuntime_default()().wrap(function _callee2$(_context2) {
while (1) switch (_context2.prev = _context2.next) {
case 0:
return _context2.abrupt("return", (0,fetch/* default */.ZP)("/api/platform_systems/".concat(params === null || params === void 0 ? void 0 : params.id, "/subjects.json"), {
method: 'Get',
params: params
}));
case 1:
case "end":
return _context2.stop();
}
}, _callee2);
}));
return function getStatistic(_x2) {
return _ref2.apply(this, arguments);
};
}();
var Page = function Page(_ref3) {
var _StatisticData$data, _SubjectInfo$data, _SubjectInfo$data2, _SubjectInfo$data3, _SubjectInfo$data4, _SubjectInfo$data5, _StatisticData$data2, _StatisticData$data3;
var dispatch = _ref3.dispatch,
user = _ref3.user,
pathsDetail = _ref3.pathsDetail,
loading = _ref3.loading;
var params = (0,_umi_production_exports.useParams)();
var _useCustomRequest = (0,useCustomRequest/* useCustomRequest */.U)(getSubjectInfo, {
subject_id: params === null || params === void 0 ? void 0 : params.id
}),
_useCustomRequest2 = slicedToArray_default()(_useCustomRequest, 4),
SubjectInfoLoading = _useCustomRequest2[1],
GetSubjectInfo = _useCustomRequest2[2],
SubjectInfo = _useCustomRequest2[3];
var _useCustomRequest3 = (0,useCustomRequest/* useCustomRequest */.U)(getStatistic, {
id: params === null || params === void 0 ? void 0 : params.id
}),
_useCustomRequest4 = slicedToArray_default()(_useCustomRequest3, 4),
StatisticLoading = _useCustomRequest4[1],
GetStatistic = _useCustomRequest4[2],
StatisticData = _useCustomRequest4[3];
var getData = /*#__PURE__*/function () {
var _ref4 = asyncToGenerator_default()( /*#__PURE__*/regeneratorRuntime_default()().mark(function _callee3() {
return regeneratorRuntime_default()().wrap(function _callee3$(_context3) {
while (1) switch (_context3.prev = _context3.next) {
case 0:
_context3.next = 2;
return GetSubjectInfo({
subject_id: params === null || params === void 0 ? void 0 : params.id
});
case 2:
_context3.next = 4;
return GetStatistic({
id: params === null || params === void 0 ? void 0 : params.id
});
case 4:
case "end":
return _context3.stop();
}
}, _callee3);
}));
return function getData() {
return _ref4.apply(this, arguments);
};
}();
(0,_react_17_0_2_react.useEffect)(function () {
if (params !== null && params !== void 0 && params.id) {
getData();
}
}, [params === null || params === void 0 ? void 0 : params.id]);
return /*#__PURE__*/(0,jsx_runtime.jsx)(spin/* default */.Z, {
spinning: SubjectInfoLoading || StatisticLoading,
children: /*#__PURE__*/(0,jsx_runtime.jsxs)("div", {
className: NewPathsmodules.con_warp,
children: [/*#__PURE__*/(0,jsx_runtime.jsxs)("div", {
className: NewPathsmodules.head_warp,
children: [/*#__PURE__*/(0,jsx_runtime.jsx)("div", {
className: NewPathsmodules.left_title,
children: StatisticData === null || StatisticData === void 0 || (_StatisticData$data = StatisticData.data) === null || _StatisticData$data === void 0 ? void 0 : _StatisticData$data.name
}), /*#__PURE__*/(0,jsx_runtime.jsx)("div", {
className: NewPathsmodules.right_tj,
children: [{
name: '实践项目数',
value: (SubjectInfo === null || SubjectInfo === void 0 || (_SubjectInfo$data = SubjectInfo.data) === null || _SubjectInfo$data === void 0 ? void 0 : _SubjectInfo$data.shixun_size) || 0
}, {
name: '关卡数',
value: (SubjectInfo === null || SubjectInfo === void 0 || (_SubjectInfo$data2 = SubjectInfo.data) === null || _SubjectInfo$data2 === void 0 ? void 0 : _SubjectInfo$data2.challenge_size) || 0
}, {
name: '学习总人数',
value: (SubjectInfo === null || SubjectInfo === void 0 || (_SubjectInfo$data3 = SubjectInfo.data) === null || _SubjectInfo$data3 === void 0 ? void 0 : _SubjectInfo$data3.learn_size) || 0
}, {
name: '评测总次数',
value: (SubjectInfo === null || SubjectInfo === void 0 || (_SubjectInfo$data4 = SubjectInfo.data) === null || _SubjectInfo$data4 === void 0 ? void 0 : _SubjectInfo$data4.evaluation_size) || 0
}, {
name: '通过总次数',
value: (SubjectInfo === null || SubjectInfo === void 0 || (_SubjectInfo$data5 = SubjectInfo.data) === null || _SubjectInfo$data5 === void 0 ? void 0 : _SubjectInfo$data5.clearance_size) || 0
}].map(function (item, index) {
return /*#__PURE__*/(0,jsx_runtime.jsxs)("div", {
className: NewPathsmodules.tj_info,
children: [/*#__PURE__*/(0,jsx_runtime.jsx)("span", {
children: item.value
}), /*#__PURE__*/(0,jsx_runtime.jsx)("div", {
children: item.name
})]
}, item.name);
})
})]
}), (StatisticData === null || StatisticData === void 0 || (_StatisticData$data2 = StatisticData.data) === null || _StatisticData$data2 === void 0 || (_StatisticData$data2 = _StatisticData$data2.list) === null || _StatisticData$data2 === void 0 ? void 0 : _StatisticData$data2.length) > 0 ? /*#__PURE__*/(0,jsx_runtime.jsx)("div", {
className: NewPathsmodules.course_list,
children: StatisticData === null || StatisticData === void 0 || (_StatisticData$data3 = StatisticData.data) === null || _StatisticData$data3 === void 0 || (_StatisticData$data3 = _StatisticData$data3.list) === null || _StatisticData$data3 === void 0 ? void 0 : _StatisticData$data3.map(function (item, index) {
return /*#__PURE__*/(0,jsx_runtime.jsxs)("div", {
className: NewPathsmodules.coures_info,
children: [/*#__PURE__*/(0,jsx_runtime.jsxs)("div", {
className: "flex",
children: [/*#__PURE__*/(0,jsx_runtime.jsx)("img", {
src: "".concat(env/* default */.Z.IMG_SERVER, "/").concat(item === null || item === void 0 ? void 0 : item.image_url),
alt: ""
}), /*#__PURE__*/(0,jsx_runtime.jsxs)("div", {
children: [/*#__PURE__*/(0,jsx_runtime.jsx)(tooltip/* default */.Z, {
title: item === null || item === void 0 ? void 0 : item.name,
children: /*#__PURE__*/(0,jsx_runtime.jsx)("div", {
className: NewPathsmodules.course_name,
children: item === null || item === void 0 ? void 0 : item.name
})
}), /*#__PURE__*/(0,jsx_runtime.jsxs)("div", {
className: NewPathsmodules.item_count_warp,
children: [/*#__PURE__*/(0,jsx_runtime.jsxs)("div", {
children: ["\u5B9E\u8DF5\u9879\u76EE\u6570", /*#__PURE__*/(0,jsx_runtime.jsx)("span", {
children: item === null || item === void 0 ? void 0 : item.shixuns_count
})]
}), /*#__PURE__*/(0,jsx_runtime.jsxs)("div", {
className: "ml20",
children: ["\u5173\u5361\u6570", /*#__PURE__*/(0,jsx_runtime.jsx)("span", {
children: item === null || item === void 0 ? void 0 : item.challenge_size
})]
})]
})]
})]
}), /*#__PURE__*/(0,jsx_runtime.jsx)("div", {
className: NewPathsmodules.start_btn,
onClick: function onClick() {
(0,util/* openNewWindow */.xg)("/paths/".concat(item === null || item === void 0 ? void 0 : item.identifier, "?backUrl=").concat(location.pathname));
},
children: "\u5F00\u59CB\u5B66\u4E60"
})]
}, index);
})
}) : /*#__PURE__*/(0,jsx_runtime.jsx)("div", {
className: NewPathsmodules.course_list,
children: /*#__PURE__*/(0,jsx_runtime.jsx)("div", {
className: NewPathsmodules.nodtaWrap,
children: /*#__PURE__*/(0,jsx_runtime.jsx)(NoData/* default */.Z, {
styles: {
margin: '160px auto'
}
})
})
})]
})
});
};
/* harmony default export */ var NewPaths = ((0,_umi_production_exports.connect)(function (_ref5) {
var user = _ref5.user,
pathsDetail = _ref5.pathsDetail,
globalSetting = _ref5.globalSetting,
loading = _ref5.loading;
return {
user: user,
pathsDetail: pathsDetail,
globalSetting: globalSetting,
loading: loading.effects
};
})(Page));
/***/ }),
/***/ 19637:
/*!*********************************************!*\
!*** ./src/utils/hooks/useCustomRequest.ts ***!
\*********************************************/
/***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) {
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */ U: function() { return /* binding */ useCustomRequest; }
/* harmony export */ });
/* harmony import */ var _root_workspace_ppte5yg23_local_v9_test4_node_modules_babel_runtime_7_23_6_babel_runtime_helpers_regeneratorRuntime_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./node_modules/_@babel_runtime@7.23.6@@babel/runtime/helpers/regeneratorRuntime.js */ 7557);
/* harmony import */ var _root_workspace_ppte5yg23_local_v9_test4_node_modules_babel_runtime_7_23_6_babel_runtime_helpers_regeneratorRuntime_js__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_root_workspace_ppte5yg23_local_v9_test4_node_modules_babel_runtime_7_23_6_babel_runtime_helpers_regeneratorRuntime_js__WEBPACK_IMPORTED_MODULE_0__);
/* harmony import */ var _root_workspace_ppte5yg23_local_v9_test4_node_modules_babel_runtime_7_23_6_babel_runtime_helpers_objectSpread2_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./node_modules/_@babel_runtime@7.23.6@@babel/runtime/helpers/objectSpread2.js */ 82242);
/* harmony import */ var _root_workspace_ppte5yg23_local_v9_test4_node_modules_babel_runtime_7_23_6_babel_runtime_helpers_objectSpread2_js__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_root_workspace_ppte5yg23_local_v9_test4_node_modules_babel_runtime_7_23_6_babel_runtime_helpers_objectSpread2_js__WEBPACK_IMPORTED_MODULE_1__);
/* harmony import */ var _root_workspace_ppte5yg23_local_v9_test4_node_modules_babel_runtime_7_23_6_babel_runtime_helpers_asyncToGenerator_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./node_modules/_@babel_runtime@7.23.6@@babel/runtime/helpers/asyncToGenerator.js */ 41498);
/* harmony import */ var _root_workspace_ppte5yg23_local_v9_test4_node_modules_babel_runtime_7_23_6_babel_runtime_helpers_asyncToGenerator_js__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(_root_workspace_ppte5yg23_local_v9_test4_node_modules_babel_runtime_7_23_6_babel_runtime_helpers_asyncToGenerator_js__WEBPACK_IMPORTED_MODULE_2__);
/* harmony import */ var _root_workspace_ppte5yg23_local_v9_test4_node_modules_babel_runtime_7_23_6_babel_runtime_helpers_slicedToArray_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./node_modules/_@babel_runtime@7.23.6@@babel/runtime/helpers/slicedToArray.js */ 79800);
/* harmony import */ var _root_workspace_ppte5yg23_local_v9_test4_node_modules_babel_runtime_7_23_6_babel_runtime_helpers_slicedToArray_js__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__webpack_require__.n(_root_workspace_ppte5yg23_local_v9_test4_node_modules_babel_runtime_7_23_6_babel_runtime_helpers_slicedToArray_js__WEBPACK_IMPORTED_MODULE_3__);
/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! react */ 59301);
//常见的请求模式包含loading和改变params。
function useCustomRequest(request, baseParams) {
var _useState = (0,react__WEBPACK_IMPORTED_MODULE_4__.useState)(baseParams),
_useState2 = _root_workspace_ppte5yg23_local_v9_test4_node_modules_babel_runtime_7_23_6_babel_runtime_helpers_slicedToArray_js__WEBPACK_IMPORTED_MODULE_3___default()(_useState, 2),
params = _useState2[0],
setParams = _useState2[1];
var _useState3 = (0,react__WEBPACK_IMPORTED_MODULE_4__.useState)(false),
_useState4 = _root_workspace_ppte5yg23_local_v9_test4_node_modules_babel_runtime_7_23_6_babel_runtime_helpers_slicedToArray_js__WEBPACK_IMPORTED_MODULE_3___default()(_useState3, 2),
loading = _useState4[0],
setLoading = _useState4[1];
var _useState5 = (0,react__WEBPACK_IMPORTED_MODULE_4__.useState)(),
_useState6 = _root_workspace_ppte5yg23_local_v9_test4_node_modules_babel_runtime_7_23_6_babel_runtime_helpers_slicedToArray_js__WEBPACK_IMPORTED_MODULE_3___default()(_useState5, 2),
data = _useState6[0],
setData = _useState6[1];
var getData = /*#__PURE__*/function () {
var _ref = _root_workspace_ppte5yg23_local_v9_test4_node_modules_babel_runtime_7_23_6_babel_runtime_helpers_asyncToGenerator_js__WEBPACK_IMPORTED_MODULE_2___default()( /*#__PURE__*/_root_workspace_ppte5yg23_local_v9_test4_node_modules_babel_runtime_7_23_6_babel_runtime_helpers_regeneratorRuntime_js__WEBPACK_IMPORTED_MODULE_0___default()().mark(function _callee(newParams) {
var reset,
mergedParams,
res,
_args = arguments;
return _root_workspace_ppte5yg23_local_v9_test4_node_modules_babel_runtime_7_23_6_babel_runtime_helpers_regeneratorRuntime_js__WEBPACK_IMPORTED_MODULE_0___default()().wrap(function _callee$(_context) {
while (1) switch (_context.prev = _context.next) {
case 0:
reset = _args.length > 1 && _args[1] !== undefined ? _args[1] : false;
mergedParams = reset ? baseParams : _root_workspace_ppte5yg23_local_v9_test4_node_modules_babel_runtime_7_23_6_babel_runtime_helpers_objectSpread2_js__WEBPACK_IMPORTED_MODULE_1___default()(_root_workspace_ppte5yg23_local_v9_test4_node_modules_babel_runtime_7_23_6_babel_runtime_helpers_objectSpread2_js__WEBPACK_IMPORTED_MODULE_1___default()({}, params), newParams);
setLoading(true);
setParams(mergedParams);
_context.next = 6;
return request(mergedParams);
case 6:
res = _context.sent;
setLoading(false);
setData(res);
return _context.abrupt("return", res);
case 10:
case "end":
return _context.stop();
}
}, _callee);
}));
return function getData(_x) {
return _ref.apply(this, arguments);
};
}();
return [params, loading, getData, data];
}
/***/ })
}]);