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

619 lines
22 KiB

"use strict";
(self["webpackChunk"] = self["webpackChunk"] || []).push([[37948],{
/***/ 8329:
/*!*********************************************************************!*\
!*** ./src/pages/User/Detail/ClassManagement/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 */ ClassManagement; }
});
// EXTERNAL MODULE: ./node_modules/_@babel_runtime@7.23.6@@babel/runtime/helpers/objectSpread2.js
var objectSpread2 = __webpack_require__(82242);
var objectSpread2_default = /*#__PURE__*/__webpack_require__.n(objectSpread2);
// EXTERNAL MODULE: ./node_modules/_@babel_runtime@7.23.6@@babel/runtime/helpers/regeneratorRuntime.js
var regeneratorRuntime = __webpack_require__(7557);
var regeneratorRuntime_default = /*#__PURE__*/__webpack_require__.n(regeneratorRuntime);
// EXTERNAL MODULE: ./node_modules/_@babel_runtime@7.23.6@@babel/runtime/helpers/asyncToGenerator.js
var asyncToGenerator = __webpack_require__(41498);
var asyncToGenerator_default = /*#__PURE__*/__webpack_require__.n(asyncToGenerator);
// EXTERNAL MODULE: ./node_modules/_@babel_runtime@7.23.6@@babel/runtime/helpers/slicedToArray.js
var slicedToArray = __webpack_require__(79800);
var slicedToArray_default = /*#__PURE__*/__webpack_require__.n(slicedToArray);
// EXTERNAL MODULE: ./node_modules/_@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__(97091);
// EXTERNAL MODULE: ./node_modules/_antd@5.9.0@antd/es/row/index.js
var row = __webpack_require__(95237);
// EXTERNAL MODULE: ./node_modules/_antd@5.9.0@antd/es/message/index.js + 4 modules
var message = __webpack_require__(8591);
// EXTERNAL MODULE: ./node_modules/_antd@5.9.0@antd/es/table/index.js + 85 modules
var table = __webpack_require__(61998);
// EXTERNAL MODULE: ./node_modules/_antd@5.9.0@antd/es/modal/index.js + 16 modules
var modal = __webpack_require__(43418);
// EXTERNAL MODULE: ./src/utils/fetch.ts
var fetch = __webpack_require__(18030);
;// CONCATENATED MODULE: ./src/pages/User/Detail/ClassManagement/index.less?modules
// extracted by mini-css-extract-plugin
/* harmony default export */ var ClassManagementmodules = ({"flex_box_center":"flex_box_center___yBGi9","flex_space_between":"flex_space_between___gykg2","flex_box_vertical_center":"flex_box_vertical_center___I8sdF","flex_box_center_end":"flex_box_center_end___pQqRI","flex_box_column":"flex_box_column___OQz41","wrap":"wrap___UkIuX","searchBar":"searchBar___inwsM","active":"active___E5qaR","searchBarBorder":"searchBarBorder___P0XNW","firstLi":"firstLi___fyQIy","otherLi":"otherLi___pqlDi","advertisementModal":"advertisementModal___kUYHO","closex":"closex___u6jhD","form":"form___WhIy0"});
// 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/components/ui-customization/index.tsx + 32 modules
var ui_customization = __webpack_require__(52126);
// EXTERNAL MODULE: ./src/components/ui-customization/reset.less?modules
var resetmodules = __webpack_require__(7352);
// EXTERNAL MODULE: ./src/components/NoData/index.tsx
var NoData = __webpack_require__(54313);
// EXTERNAL MODULE: ./node_modules/_react@17.0.2@react/jsx-runtime.js
var jsx_runtime = __webpack_require__(37712);
;// CONCATENATED MODULE: ./src/pages/User/Detail/ClassManagement/index.tsx
var _excluded = ["classroomList", "globalSetting", "loading", "user", "dispatch"];
dayjs_min_default().locale('ZH-cn');
var ClassroomListPage = function ClassroomListPage(_ref) {
var _result$student_group, _result$student_group2;
var classroomList = _ref.classroomList,
globalSetting = _ref.globalSetting,
loading = _ref.loading,
user = _ref.user,
dispatch = _ref.dispatch,
props = objectWithoutProperties_default()(_ref, _excluded);
var _useState = (0,_react_17_0_2_react.useState)(),
_useState2 = slicedToArray_default()(_useState, 2),
result = _useState2[0],
setResult = _useState2[1];
var _useState3 = (0,_react_17_0_2_react.useState)(1),
_useState4 = slicedToArray_default()(_useState3, 2),
page = _useState4[0],
setPage = _useState4[1];
var _useState5 = (0,_react_17_0_2_react.useState)(true),
_useState6 = slicedToArray_default()(_useState5, 2),
tableLoading = _useState6[0],
setTableLoading = _useState6[1];
var _useState7 = (0,_react_17_0_2_react.useState)(20),
_useState8 = slicedToArray_default()(_useState7, 2),
limit = _useState8[0],
setLimit = _useState8[1];
var _useState9 = (0,_react_17_0_2_react.useState)(false),
_useState10 = slicedToArray_default()(_useState9, 2),
isShowModel = _useState10[0],
setIsShowModel = _useState10[1];
var _useState11 = (0,_react_17_0_2_react.useState)(''),
_useState12 = slicedToArray_default()(_useState11, 2),
keyword = _useState12[0],
setkeyword = _useState12[1];
var _useState13 = (0,_react_17_0_2_react.useState)([]),
_useState14 = slicedToArray_default()(_useState13, 2),
datas = _useState14[0],
setdatas = _useState14[1];
var _useState15 = (0,_react_17_0_2_react.useState)(false),
_useState16 = slicedToArray_default()(_useState15, 2),
modalshow = _useState16[0],
setmodalshow = _useState16[1];
var params = (0,_umi_production_exports.useParams)();
var _useState17 = (0,_react_17_0_2_react.useState)([]),
_useState18 = slicedToArray_default()(_useState17, 2),
items = _useState18[0],
setitems = _useState18[1];
(0,_react_17_0_2_react.useEffect)(function () {
getList();
}, [page, keyword]);
function getList(_x) {
return _getList.apply(this, arguments);
}
function _getList() {
_getList = asyncToGenerator_default()( /*#__PURE__*/regeneratorRuntime_default()().mark(function _callee2(num) {
var newPage, result;
return regeneratorRuntime_default()().wrap(function _callee2$(_context2) {
while (1) switch (_context2.prev = _context2.next) {
case 0:
setTableLoading(true);
newPage = num || page;
_context2.next = 4;
return (0,fetch/* default */.ZP)("/api/student_groups.json", {
method: 'get',
params: {
page: newPage,
limit: limit,
keyword: keyword || ''
}
});
case 4:
result = _context2.sent;
setResult(result);
setTableLoading(false);
case 7:
case "end":
return _context2.stop();
}
}, _callee2);
}));
return _getList.apply(this, arguments);
}
function getdatas() {
return _getdatas.apply(this, arguments);
}
function _getdatas() {
_getdatas = asyncToGenerator_default()( /*#__PURE__*/regeneratorRuntime_default()().mark(function _callee3() {
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/group_audit_records.json", {
method: 'get',
params: {
page: 1,
limit: 10000
}
});
case 2:
res = _context3.sent;
setdatas(res);
case 4:
case "end":
return _context3.stop();
}
}, _callee3);
}));
return _getdatas.apply(this, arguments);
}
var columns = [{
title: '序号',
dataIndex: 'index',
align: 'left',
key: 'name',
ellipsis: true,
width: 50,
render: function render(text, record, index) {
return /*#__PURE__*/(0,jsx_runtime.jsx)("span", {
children: text
});
}
}, {
title: '学院',
dataIndex: 'department_name',
align: 'left',
key: 'content',
render: function render(text) {
return /*#__PURE__*/(0,jsx_runtime.jsx)("span", {
style: {
fontWeight: 500
},
children: text
});
}
// width: 150,
}, {
title: '班级名称',
dataIndex: 'name',
align: 'left',
key: 'clazz'
// width: 150,
}, {
title: '学生成员',
dataIndex: 'student_count',
align: 'left',
key: 'created_at',
render: function render(text) {
return /*#__PURE__*/(0,jsx_runtime.jsx)("span", {
className: "c-grey-666",
children: text
});
}
// width: 150,
}, {
title: '授课老师',
dataIndex: 'teacher_names',
align: 'left',
key: 'created_at',
render: function render(text) {
return /*#__PURE__*/(0,jsx_runtime.jsx)("span", {
className: "c-grey-666",
children: text
});
}
// width: 150,
}, {
title: '操作',
dataIndex: 'id',
align: 'right',
key: 'remark',
width: 150,
ellipsis: true,
render: function render(text, record, index) {
' ';
return /*#__PURE__*/(0,jsx_runtime.jsx)(row/* default */.Z, {
align: "middle",
justify: "end",
children: /*#__PURE__*/(0,jsx_runtime.jsx)(_umi_production_exports.Link, {
to: "/users/".concat(params.username, "/classmanagement/").concat(text, "?department_name=").concat(record.department_name),
children: "\u67E5\u770B"
})
});
}
}];
var columns1 = [{
title: '申请内容',
dataIndex: 'content',
align: 'left',
key: 'name',
ellipsis: true,
width: 200,
render: function render(text, record, index) {
return /*#__PURE__*/(0,jsx_runtime.jsx)("span", {
children: text
});
}
}, {
title: '审核状态',
dataIndex: 'status',
align: 'left',
key: 'content',
render: function render(text) {
return /*#__PURE__*/(0,jsx_runtime.jsx)("span", {
style: {
fontWeight: 500
},
children: text === 0 ? '待审核' : '已审核'
});
}
// width: 150,
}, {
title: '审核结果',
dataIndex: 'status',
align: 'left',
key: 'clazz',
render: function render(text) {
return /*#__PURE__*/(0,jsx_runtime.jsxs)("span", {
style: {
fontWeight: 500
},
children: [text === 1 && '通过', text === 2 && '拒绝', text < 1 && '- -']
});
}
// width: 150,
}, {
title: '理由',
dataIndex: 'reason',
align: 'left',
key: 'created_at',
render: function render(text) {
return /*#__PURE__*/(0,jsx_runtime.jsx)("span", {
className: "c-grey-666",
title: text,
children: text.legnth < 6 ? text : text.substr(0, 6) + '...' || 0
});
}
// width: 150,
}, {
title: '操作',
dataIndex: 'status',
align: 'right',
key: 'remark',
width: 50,
ellipsis: true,
render: function render(text, record, index) {
return /*#__PURE__*/(0,jsx_runtime.jsx)(row/* default */.Z, {
align: "middle",
justify: "end",
children: text < 1 ? /*#__PURE__*/(0,jsx_runtime.jsx)("a", {
style: {
color: '#165DFF'
},
onClick: /*#__PURE__*/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/group_audit_records/".concat(record === null || record === void 0 ? void 0 : record.id, ".json"), {
method: 'DELETE'
});
case 2:
res = _context.sent;
if ((res === null || res === void 0 ? void 0 : res.status) === 0) {
message/* default */.ZP.info('撤销成功');
}
getdatas();
case 5:
case "end":
return _context.stop();
}
}, _callee);
})),
children: "\u64A4\u9500"
}) : /*#__PURE__*/(0,jsx_runtime.jsx)("a", {
style: {
color: '#165DFF'
},
onClick: function onClick() {
setmodalshow(true);
setIsShowModel(false);
setitems(record);
},
children: "\u67E5\u770B"
})
});
}
}];
var columns2 = [{
title: '学号',
dataIndex: 'student_id',
align: 'left',
key: 'name',
ellipsis: true,
width: 200,
render: function render(text, record, index) {
return /*#__PURE__*/(0,jsx_runtime.jsx)("span", {
children: text || '- -'
});
}
}, {
title: '姓名',
dataIndex: 'name',
align: 'left',
key: 'content',
render: function render(text) {
return /*#__PURE__*/(0,jsx_runtime.jsx)("span", {
style: {
fontWeight: 500
},
children: text
});
}
// width: 150,
}, {
title: '班级',
dataIndex: 'group_name',
align: 'left',
key: 'clazz',
render: function render(text) {
return /*#__PURE__*/(0,jsx_runtime.jsx)("span", {
style: {
fontWeight: 500
},
children: text || '- -'
});
}
// width: 150,
}, {
title: '院系',
dataIndex: 'department',
align: 'left',
key: 'created_at',
render: function render(text) {
return /*#__PURE__*/(0,jsx_runtime.jsx)("span", {
className: "c-grey-666",
children: text || '- -'
});
}
// width: 150,
}, {
title: '负责教师',
dataIndex: 'teachers',
align: 'left',
key: 'remark',
width: 150,
ellipsis: true,
render: function render(text) {
return /*#__PURE__*/(0,jsx_runtime.jsx)("span", {
className: "c-grey-666",
children: text || '- -'
});
}
}];
return /*#__PURE__*/(0,jsx_runtime.jsxs)("div", {
className: ClassManagementmodules.wrap,
children: [/*#__PURE__*/(0,jsx_runtime.jsxs)(row/* default */.Z, {
justify: "space-between",
align: "middle",
style: {
marginBottom: '36px'
},
className: "mt8",
children: [/*#__PURE__*/(0,jsx_runtime.jsxs)("span", {
style: {
fontSize: '14px'
},
children: [/*#__PURE__*/(0,jsx_runtime.jsxs)("span", {
style: {
color: '#5F6368'
},
children: ["\u5171", /*#__PURE__*/(0,jsx_runtime.jsx)("span", {
style: {
color: '#1869FF'
},
children: result === null || result === void 0 ? void 0 : result.total_count
}), "\u4E2A\u73ED\u7EA7"]
}), /*#__PURE__*/(0,jsx_runtime.jsxs)("span", {
onClick: function onClick() {
setIsShowModel(true);
getdatas();
},
style: {
marginLeft: 30,
color: '#5F6368',
cursor: 'pointer'
},
children: ["\u6211\u7684\u7533\u8BF7\uFF08", result === null || result === void 0 ? void 0 : result.audit_count, "\uFF09"]
})]
}), /*#__PURE__*/(0,jsx_runtime.jsx)("span", {
style: {
display: 'flex'
},
children: /*#__PURE__*/(0,jsx_runtime.jsx)(ui_customization/* CustomInput */.t7, {
style: {
width: 300,
marginLeft: 20
},
onChange: function onChange(e) {
setkeyword(e);
},
placeholder: "\u8BF7\u8F93\u5165\u5206\u73ED\u540D\u79F0\u641C\u7D22"
})
})]
}), (result === null || result === void 0 || (_result$student_group = result.student_groups) === null || _result$student_group === void 0 ? void 0 : _result$student_group.length) <= 0 && /*#__PURE__*/(0,jsx_runtime.jsx)(NoData/* default */.Z, {
customText: '您还未被分配班级,请联系管理员分配需要管理的班级'
}), (result === null || result === void 0 || (_result$student_group2 = result.student_groups) === null || _result$student_group2 === void 0 ? void 0 : _result$student_group2.length) > 0 && /*#__PURE__*/(0,jsx_runtime.jsx)(ui_customization/* CustomTable */.Gi, {
children: /*#__PURE__*/(0,jsx_runtime.jsx)(table/* default */.Z, {
columns: columns,
loading: tableLoading,
dataSource: result === null || result === void 0 ? void 0 : result.student_groups,
pagination: {
hideOnSinglePage: true,
pageSize: limit,
showSizeChanger: false,
current: page,
position: ['bottomCenter'],
onChange: function onChange(page, pagesize) {
setPage(page);
},
total: result === null || result === void 0 ? void 0 : result.total_count
}
})
}), /*#__PURE__*/(0,jsx_runtime.jsx)(modal/* default */.Z, {
title: '我的申请',
visible: isShowModel,
centered: true,
width: 722,
footer: null,
wrapClassName: resetmodules/* default */.Z.CustomCss,
onCancel: function onCancel() {
return setIsShowModel(false);
},
closeIcon: /*#__PURE__*/(0,jsx_runtime.jsx)("i", {
className: 'iconfont icon-danchuangguanbi '
}),
children: /*#__PURE__*/(0,jsx_runtime.jsx)("div", {
style: {
paddingBottom: 30
},
children: /*#__PURE__*/(0,jsx_runtime.jsx)(ui_customization/* CustomTable */.Gi, {
children: /*#__PURE__*/(0,jsx_runtime.jsx)(table/* default */.Z, {
dataSource: datas === null || datas === void 0 ? void 0 : datas.group_audit_records,
pagination: false,
columns: columns1
})
})
})
}), /*#__PURE__*/(0,jsx_runtime.jsx)(modal/* default */.Z, {
title: (items === null || items === void 0 ? void 0 : items.status) === 1 ? '同意' : '拒绝',
visible: modalshow,
width: 800,
centered: true,
footer: null,
wrapClassName: resetmodules/* default */.Z.CustomCss,
onCancel: function onCancel() {
return setmodalshow(false);
},
children: /*#__PURE__*/(0,jsx_runtime.jsxs)("div", {
style: {
paddingBottom: 20
},
children: [/*#__PURE__*/(0,jsx_runtime.jsx)("p", {
style: {
color: '#000000',
fontSize: 14,
fontWeight: 500
},
children: "\u539F\u73ED\u7EA7\uFF1A"
}), /*#__PURE__*/(0,jsx_runtime.jsx)(ui_customization/* CustomTable */.Gi, {
children: /*#__PURE__*/(0,jsx_runtime.jsx)(table/* default */.Z, {
dataSource: [objectSpread2_default()(objectSpread2_default()({}, items), {}, {
group_name: items === null || items === void 0 ? void 0 : items.old_group_name,
department: items === null || items === void 0 ? void 0 : items.old_department,
teachers: items === null || items === void 0 ? void 0 : items.old_teachers
})],
pagination: false,
columns: columns2
})
}), /*#__PURE__*/(0,jsx_runtime.jsx)("p", {
style: {
color: '#000000',
fontSize: 14,
fontWeight: 500
},
children: "\u7533\u8BF7\u73ED\u7EA7\uFF1A"
}), /*#__PURE__*/(0,jsx_runtime.jsx)(ui_customization/* CustomTable */.Gi, {
children: /*#__PURE__*/(0,jsx_runtime.jsx)(table/* default */.Z, {
dataSource: [objectSpread2_default()(objectSpread2_default()({}, items), {}, {
group_name: items === null || items === void 0 ? void 0 : items.new_group_name,
department: items === null || items === void 0 ? void 0 : items.new_department,
teachers: items === null || items === void 0 ? void 0 : items.new_teachers
})],
pagination: false,
columns: columns2
})
}), (items === null || items === void 0 ? void 0 : items.status) != 1 && /*#__PURE__*/(0,jsx_runtime.jsx)("p", {
style: {
color: '#000000',
fontSize: 14,
fontWeight: 500
},
children: "\u62D2\u7EDD\u7406\u7531"
}), (items === null || items === void 0 ? void 0 : items.status) != 1 && /*#__PURE__*/(0,jsx_runtime.jsx)("p", {
children: (items === null || items === void 0 ? void 0 : items.reason) || '- -'
})]
})
})]
});
};
/* harmony default export */ var ClassManagement = ((0,_umi_production_exports.connect)(function (_ref3) {
var classroomList = _ref3.classroomList,
loading = _ref3.loading,
globalSetting = _ref3.globalSetting,
user = _ref3.user;
return {
classroomList: classroomList,
globalSetting: globalSetting,
loading: loading.models.classroomList,
user: user
};
})(ClassroomListPage));
/***/ }),
/***/ 7352:
/*!************************************************************!*\
!*** ./src/components/ui-customization/reset.less?modules ***!
\************************************************************/
/***/ (function(__unused_webpack_module, __webpack_exports__) {
// extracted by mini-css-extract-plugin
/* harmony default export */ __webpack_exports__.Z = ({"flex_box_center":"flex_box_center___vG4eV","flex_space_between":"flex_space_between___qVVxe","flex_box_vertical_center":"flex_box_vertical_center___P8Z8s","flex_box_center_end":"flex_box_center_end___VMme3","flex_box_column":"flex_box_column___VMHwm","dropdownmenus":"dropdownmenus___oVzoj","popupClassNames":"popupClassNames___OcZq7","selectdown":"selectdown___mmcA8"});
/***/ })
}]);