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

299 lines
19 KiB

"use strict";
(self["webpackChunk"] = self["webpackChunk"] || []).push([[45950],{
/***/ 23017:
/*!**************************************************!*\
!*** ./src/pages/CoreCurriculum/Index/index.tsx ***!
\**************************************************/
/***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) {
__webpack_require__.r(__webpack_exports__);
/* harmony import */ var _root_workspace_ppte5yg23_local_v9_test5_node_modules_babel_runtime_7_23_2_babel_runtime_helpers_regeneratorRuntime_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./node_modules/_@babel_runtime@7.23.2@@babel/runtime/helpers/regeneratorRuntime.js */ 10574);
/* harmony import */ var _root_workspace_ppte5yg23_local_v9_test5_node_modules_babel_runtime_7_23_2_babel_runtime_helpers_regeneratorRuntime_js__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_root_workspace_ppte5yg23_local_v9_test5_node_modules_babel_runtime_7_23_2_babel_runtime_helpers_regeneratorRuntime_js__WEBPACK_IMPORTED_MODULE_0__);
/* harmony import */ var _root_workspace_ppte5yg23_local_v9_test5_node_modules_babel_runtime_7_23_2_babel_runtime_helpers_asyncToGenerator_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./node_modules/_@babel_runtime@7.23.2@@babel/runtime/helpers/asyncToGenerator.js */ 39343);
/* harmony import */ var _root_workspace_ppte5yg23_local_v9_test5_node_modules_babel_runtime_7_23_2_babel_runtime_helpers_asyncToGenerator_js__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_root_workspace_ppte5yg23_local_v9_test5_node_modules_babel_runtime_7_23_2_babel_runtime_helpers_asyncToGenerator_js__WEBPACK_IMPORTED_MODULE_1__);
/* harmony import */ var _root_workspace_ppte5yg23_local_v9_test5_node_modules_babel_runtime_7_23_2_babel_runtime_helpers_objectSpread2_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./node_modules/_@babel_runtime@7.23.2@@babel/runtime/helpers/objectSpread2.js */ 26801);
/* harmony import */ var _root_workspace_ppte5yg23_local_v9_test5_node_modules_babel_runtime_7_23_2_babel_runtime_helpers_objectSpread2_js__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(_root_workspace_ppte5yg23_local_v9_test5_node_modules_babel_runtime_7_23_2_babel_runtime_helpers_objectSpread2_js__WEBPACK_IMPORTED_MODULE_2__);
/* harmony import */ var _root_workspace_ppte5yg23_local_v9_test5_node_modules_babel_runtime_7_23_2_babel_runtime_helpers_slicedToArray_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./node_modules/_@babel_runtime@7.23.2@@babel/runtime/helpers/slicedToArray.js */ 11006);
/* harmony import */ var _root_workspace_ppte5yg23_local_v9_test5_node_modules_babel_runtime_7_23_2_babel_runtime_helpers_slicedToArray_js__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__webpack_require__.n(_root_workspace_ppte5yg23_local_v9_test5_node_modules_babel_runtime_7_23_2_babel_runtime_helpers_slicedToArray_js__WEBPACK_IMPORTED_MODULE_3__);
/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! react */ 59301);
/* harmony import */ var umi__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! umi */ 22211);
/* harmony import */ var antd__WEBPACK_IMPORTED_MODULE_12__ = __webpack_require__(/*! antd */ 78241);
/* harmony import */ var antd__WEBPACK_IMPORTED_MODULE_13__ = __webpack_require__(/*! antd */ 95237);
/* harmony import */ var antd__WEBPACK_IMPORTED_MODULE_14__ = __webpack_require__(/*! antd */ 43604);
/* harmony import */ var antd__WEBPACK_IMPORTED_MODULE_15__ = __webpack_require__(/*! antd */ 3113);
/* harmony import */ var antd__WEBPACK_IMPORTED_MODULE_16__ = __webpack_require__(/*! antd */ 71418);
/* harmony import */ var antd__WEBPACK_IMPORTED_MODULE_17__ = __webpack_require__(/*! antd */ 41867);
/* harmony import */ var antd__WEBPACK_IMPORTED_MODULE_18__ = __webpack_require__(/*! antd */ 8591);
/* harmony import */ var _index_less_modules__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ./index.less?modules */ 25875);
/* harmony import */ var _components_AddOrEditCore__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ../components/AddOrEditCore */ 1255);
/* harmony import */ var _components_CoreLists__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! ../components/CoreLists */ 4216);
/* harmony import */ var _utils_env__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! @/utils/env */ 67871);
/* harmony import */ var _utils_authority__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(/*! @/utils/authority */ 58696);
/* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_11__ = __webpack_require__(/*! react/jsx-runtime */ 37712);
var Page = function Page(_ref) {
var _globalSetting$settin, _user$userInfo;
var coreCurriculum = _ref.coreCurriculum,
dispatch = _ref.dispatch,
loading = _ref.loading,
user = _ref.user,
globalSetting = _ref.globalSetting;
var CoreSubjects = coreCurriculum.CoreSubjects;
var _Form$useForm = antd__WEBPACK_IMPORTED_MODULE_12__/* ["default"] */ .Z.useForm(),
_Form$useForm2 = _root_workspace_ppte5yg23_local_v9_test5_node_modules_babel_runtime_7_23_2_babel_runtime_helpers_slicedToArray_js__WEBPACK_IMPORTED_MODULE_3___default()(_Form$useForm, 1),
form = _Form$useForm2[0];
var _useState = (0,react__WEBPACK_IMPORTED_MODULE_4__.useState)(false),
_useState2 = _root_workspace_ppte5yg23_local_v9_test5_node_modules_babel_runtime_7_23_2_babel_runtime_helpers_slicedToArray_js__WEBPACK_IMPORTED_MODULE_3___default()(_useState, 2),
isAddCore = _useState2[0],
setIsAddCore = _useState2[1];
// const [searchInput, setSearchInput] = useState<string>("");
var _useState3 = (0,react__WEBPACK_IMPORTED_MODULE_4__.useState)({
page: 1,
limit: 12
}),
_useState4 = _root_workspace_ppte5yg23_local_v9_test5_node_modules_babel_runtime_7_23_2_babel_runtime_helpers_slicedToArray_js__WEBPACK_IMPORTED_MODULE_3___default()(_useState3, 2),
urlData = _useState4[0],
setUrlData = _useState4[1];
// const handleSearchInput = (e: any) => {
// // setSearchInput(e.target.value);
// console.log(e.target.value || searchInput);
// }
var getData = function getData() {
var data = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : urlData;
dispatch({
type: 'coreCurriculum/getCoreSubjects',
payload: _root_workspace_ppte5yg23_local_v9_test5_node_modules_babel_runtime_7_23_2_babel_runtime_helpers_objectSpread2_js__WEBPACK_IMPORTED_MODULE_2___default()({}, data)
});
};
(0,react__WEBPACK_IMPORTED_MODULE_4__.useEffect)(function () {
getData();
}, [urlData]);
return /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_11__.jsxs)("section", {
children: [/*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_11__.jsx)("div", {
className: "".concat(_index_less_modules__WEBPACK_IMPORTED_MODULE_6__/* ["default"] */ .Z.Bg),
style: {
width: "100%",
height: 240,
backgroundImage: "url(".concat(_utils_env__WEBPACK_IMPORTED_MODULE_9__/* ["default"] */ .Z.IMG_SERVER, "/").concat(globalSetting === null || globalSetting === void 0 || (_globalSetting$settin = globalSetting.setting) === null || _globalSetting$settin === void 0 ? void 0 : _globalSetting$settin.core_banner_url, ")")
},
children: /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_11__.jsx)(antd__WEBPACK_IMPORTED_MODULE_13__/* ["default"] */ .Z, {
style: {
width: 1200,
height: "100%",
margin: "0 auto"
},
align: "middle",
justify: "space-between",
wrap: false,
children: /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_11__.jsxs)(antd__WEBPACK_IMPORTED_MODULE_14__/* ["default"] */ .Z, {
children: [/*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_11__.jsx)("div", {
style: {
color: "#fff",
fontSize: "36px",
letterSpacing: "5px",
fontWeight: 600
},
children: "\u6838\u5FC3\u8BFE\u7A0B"
}), ((0,_utils_authority__WEBPACK_IMPORTED_MODULE_10__/* .isSuperAdmins */ .Ny)() || (user === null || user === void 0 || (_user$userInfo = user.userInfo) === null || _user$userInfo === void 0 ? void 0 : _user$userInfo.is_core_subject_member)) && /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_11__.jsx)(antd__WEBPACK_IMPORTED_MODULE_15__/* ["default"] */ .ZP, {
className: "mt25 ".concat(_index_less_modules__WEBPACK_IMPORTED_MODULE_6__/* ["default"] */ .Z.DivDownPlay),
icon: /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_11__.jsx)("i", {
className: "iconfont icon-icon_xinyong_xianxing_jijin-249"
}),
onClick: function onClick() {
setIsAddCore(true);
},
children: "\u65B0\u5EFA\u6838\u5FC3\u8BFE\u7A0B"
})]
})
})
}), /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_11__.jsxs)(antd__WEBPACK_IMPORTED_MODULE_16__/* ["default"] */ .Z, {
spinning: !!loading['coreCurriculum/getCoreSubjects'],
children: [/*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_11__.jsx)("div", {
style: {
width: 1200,
margin: "40px auto 0"
},
children: /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_11__.jsx)(antd__WEBPACK_IMPORTED_MODULE_13__/* ["default"] */ .Z, {
gutter: [16, 24],
children: /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_11__.jsx)(_components_CoreLists__WEBPACK_IMPORTED_MODULE_8__/* ["default"] */ .Z, {
data: (CoreSubjects === null || CoreSubjects === void 0 ? void 0 : CoreSubjects.list) || []
})
})
}), /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_11__.jsxs)(antd__WEBPACK_IMPORTED_MODULE_13__/* ["default"] */ .Z, {
wrap: false,
align: "middle",
justify: "space-between",
style: {
width: 1200,
margin: "20px auto"
},
children: [/*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_11__.jsxs)(antd__WEBPACK_IMPORTED_MODULE_14__/* ["default"] */ .Z, {
children: ["\u5171\xA0", /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_11__.jsx)("span", {
style: {
color: "#165DFF"
},
children: (CoreSubjects === null || CoreSubjects === void 0 ? void 0 : CoreSubjects.count) || 0
}), "\xA0\u6761\u6570\u636E"]
}), /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_11__.jsx)(antd__WEBPACK_IMPORTED_MODULE_14__/* ["default"] */ .Z, {
children: /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_11__.jsx)(antd__WEBPACK_IMPORTED_MODULE_17__/* ["default"] */ .Z, {
showSizeChanger: false,
showQuickJumper: true,
current: urlData.page,
pageSize: urlData.limit,
onChange: function onChange(page, limit) {
return setUrlData(_root_workspace_ppte5yg23_local_v9_test5_node_modules_babel_runtime_7_23_2_babel_runtime_helpers_objectSpread2_js__WEBPACK_IMPORTED_MODULE_2___default()(_root_workspace_ppte5yg23_local_v9_test5_node_modules_babel_runtime_7_23_2_babel_runtime_helpers_objectSpread2_js__WEBPACK_IMPORTED_MODULE_2___default()({}, urlData), {}, {
page: page,
limit: limit
}));
},
total: (CoreSubjects === null || CoreSubjects === void 0 ? void 0 : CoreSubjects.count) || 0
})
})]
})]
}), /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_11__.jsx)(_components_AddOrEditCore__WEBPACK_IMPORTED_MODULE_7__/* ["default"] */ .Z, {
title: "新建核心课程",
form: form,
open: isAddCore,
dispatch: true,
onCancel: function onCancel() {
form.resetFields();
setIsAddCore(false);
},
confirmLoading: !!loading['coreCurriculum/postCoreSubjects'],
onOk: function onOk() {
return form.submit();
},
handleFinish: /*#__PURE__*/function () {
var _ref2 = _root_workspace_ppte5yg23_local_v9_test5_node_modules_babel_runtime_7_23_2_babel_runtime_helpers_asyncToGenerator_js__WEBPACK_IMPORTED_MODULE_1___default()( /*#__PURE__*/_root_workspace_ppte5yg23_local_v9_test5_node_modules_babel_runtime_7_23_2_babel_runtime_helpers_regeneratorRuntime_js__WEBPACK_IMPORTED_MODULE_0___default()().mark(function _callee(ValueAll) {
var res;
return _root_workspace_ppte5yg23_local_v9_test5_node_modules_babel_runtime_7_23_2_babel_runtime_helpers_regeneratorRuntime_js__WEBPACK_IMPORTED_MODULE_0___default()().wrap(function _callee$(_context) {
while (1) switch (_context.prev = _context.next) {
case 0:
_context.next = 2;
return dispatch({
type: 'coreCurriculum/postCoreSubjects',
payload: ValueAll
});
case 2:
res = _context.sent;
if ((res === null || res === void 0 ? void 0 : res.status) == 0) {
antd__WEBPACK_IMPORTED_MODULE_18__/* ["default"] */ .ZP.success("添加成功");
setIsAddCore(false);
getData();
}
case 4:
case "end":
return _context.stop();
}
}, _callee);
}));
return function (_x) {
return _ref2.apply(this, arguments);
};
}()
})]
});
};
/* harmony default export */ __webpack_exports__["default"] = ((0,umi__WEBPACK_IMPORTED_MODULE_5__.connect)(function (_ref3) {
var user = _ref3.user,
loading = _ref3.loading,
globalSetting = _ref3.globalSetting,
coreCurriculum = _ref3.coreCurriculum;
return {
user: user,
loading: loading.effects,
globalSetting: globalSetting,
coreCurriculum: coreCurriculum
};
})(Page));
/***/ }),
/***/ 4216:
/*!*****************************************************************!*\
!*** ./src/pages/CoreCurriculum/components/CoreLists/index.tsx ***!
\*****************************************************************/
/***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) {
/* harmony import */ var _root_workspace_ppte5yg23_local_v9_test5_node_modules_babel_runtime_7_23_2_babel_runtime_helpers_objectSpread2_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./node_modules/_@babel_runtime@7.23.2@@babel/runtime/helpers/objectSpread2.js */ 26801);
/* harmony import */ var _root_workspace_ppte5yg23_local_v9_test5_node_modules_babel_runtime_7_23_2_babel_runtime_helpers_objectSpread2_js__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_root_workspace_ppte5yg23_local_v9_test5_node_modules_babel_runtime_7_23_2_babel_runtime_helpers_objectSpread2_js__WEBPACK_IMPORTED_MODULE_0__);
/* harmony import */ var _root_workspace_ppte5yg23_local_v9_test5_node_modules_babel_runtime_7_23_2_babel_runtime_helpers_objectWithoutProperties_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./node_modules/_@babel_runtime@7.23.2@@babel/runtime/helpers/objectWithoutProperties.js */ 27161);
/* harmony import */ var _root_workspace_ppte5yg23_local_v9_test5_node_modules_babel_runtime_7_23_2_babel_runtime_helpers_objectWithoutProperties_js__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_root_workspace_ppte5yg23_local_v9_test5_node_modules_babel_runtime_7_23_2_babel_runtime_helpers_objectWithoutProperties_js__WEBPACK_IMPORTED_MODULE_1__);
/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! react */ 59301);
/* harmony import */ var antd__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! antd */ 43604);
/* harmony import */ var _Index_index_less_modules__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../../Index/index.less?modules */ 25875);
/* harmony import */ var _utils_util__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! @/utils/util */ 85578);
/* harmony import */ var _utils_env__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! @/utils/env */ 67871);
/* harmony import */ var classnames__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! classnames */ 66641);
/* harmony import */ var classnames__WEBPACK_IMPORTED_MODULE_6___default = /*#__PURE__*/__webpack_require__.n(classnames__WEBPACK_IMPORTED_MODULE_6__);
/* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! react/jsx-runtime */ 37712);
var _excluded = ["dispatch", "data", "className", "style"];
var Page = function Page(_ref) {
var dispatch = _ref.dispatch,
data = _ref.data,
className = _ref.className,
style = _ref.style,
props = _root_workspace_ppte5yg23_local_v9_test5_node_modules_babel_runtime_7_23_2_babel_runtime_helpers_objectWithoutProperties_js__WEBPACK_IMPORTED_MODULE_1___default()(_ref, _excluded);
return /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_7__.jsx)(react_jsx_runtime__WEBPACK_IMPORTED_MODULE_7__.Fragment, {
children: data === null || data === void 0 ? void 0 : data.map(function (item, index) {
var _item$cover, _item$cover2;
return /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_7__.jsx)(antd__WEBPACK_IMPORTED_MODULE_8__/* ["default"] */ .Z, {
children: /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_7__.jsx)("div", {
className: classnames__WEBPACK_IMPORTED_MODULE_6___default()(_Index_index_less_modules__WEBPACK_IMPORTED_MODULE_3__/* ["default"] */ .Z.CoreItem, className),
style: _root_workspace_ppte5yg23_local_v9_test5_node_modules_babel_runtime_7_23_2_babel_runtime_helpers_objectSpread2_js__WEBPACK_IMPORTED_MODULE_0___default()({}, style),
onClick: function onClick() {
return (0,_utils_util__WEBPACK_IMPORTED_MODULE_4__/* .openNewWindow */ .xg)("/core/".concat(item === null || item === void 0 ? void 0 : item.id));
},
children: /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_7__.jsx)("div", {
className: _Index_index_less_modules__WEBPACK_IMPORTED_MODULE_3__/* ["default"] */ .Z.img,
children: /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_7__.jsx)("img", {
src: "".concat(_utils_env__WEBPACK_IMPORTED_MODULE_5__/* ["default"] */ .Z.API_SERVER).concat(item === null || item === void 0 || (_item$cover = item.cover) === null || _item$cover === void 0 ? void 0 : _item$cover.url),
alt: item === null || item === void 0 || (_item$cover2 = item.cover) === null || _item$cover2 === void 0 ? void 0 : _item$cover2.title
})
})
})
}, index);
})
});
};
/* harmony default export */ __webpack_exports__.Z = (Page);
/***/ }),
/***/ 25875:
/*!***********************************************************!*\
!*** ./src/pages/CoreCurriculum/Index/index.less?modules ***!
\***********************************************************/
/***/ (function(__unused_webpack_module, __webpack_exports__) {
// extracted by mini-css-extract-plugin
/* harmony default export */ __webpack_exports__.Z = ({"Onerow":"Onerow___rEE1I","Bg":"Bg___Dn6ug","DivDownPlay":"DivDownPlay___KGY4k","SearchInput":"SearchInput___rSGs4","CoreItem":"CoreItem___g9fqX","img":"img___EYzkb"});
/***/ })
}]);