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.
2455 lines
113 KiB
2455 lines
113 KiB
(self["webpackChunk"] = self["webpackChunk"] || []).push([[39820],{
|
|
|
|
/***/ 34023:
|
|
/*!*******************************************************************************************************!*\
|
|
!*** ./node_modules/_@ant-design_icons@5.6.0@@ant-design/icons/es/icons/InboxOutlined.js + 1 modules ***!
|
|
\*******************************************************************************************************/
|
|
/***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) {
|
|
|
|
"use strict";
|
|
|
|
// EXPORTS
|
|
__webpack_require__.d(__webpack_exports__, {
|
|
Z: function() { return /* binding */ icons_InboxOutlined; }
|
|
});
|
|
|
|
// EXTERNAL MODULE: ./node_modules/_@babel_runtime@7.26.7@@babel/runtime/helpers/esm/extends.js
|
|
var esm_extends = __webpack_require__(16378);
|
|
// EXTERNAL MODULE: ./node_modules/_react@17.0.2@react/index.js
|
|
var _react_17_0_2_react = __webpack_require__(59301);
|
|
;// CONCATENATED MODULE: ./node_modules/_@ant-design_icons-svg@4.4.2@@ant-design/icons-svg/es/asn/InboxOutlined.js
|
|
// This icon file is generated automatically.
|
|
var InboxOutlined = { "icon": { "tag": "svg", "attrs": { "viewBox": "0 0 1024 1024", "focusable": "false" }, "children": [{ "tag": "path", "attrs": { "d": "M885.2 446.3l-.2-.8-112.2-285.1c-5-16.1-19.9-27.2-36.8-27.2H281.2c-17 0-32.1 11.3-36.9 27.6L139.4 443l-.3.7-.2.8c-1.3 4.9-1.7 9.9-1 14.8-.1 1.6-.2 3.2-.2 4.8V830a60.9 60.9 0 0060.8 60.8h627.2c33.5 0 60.8-27.3 60.9-60.8V464.1c0-1.3 0-2.6-.1-3.7.4-4.9 0-9.6-1.3-14.1zm-295.8-43l-.3 15.7c-.8 44.9-31.8 75.1-77.1 75.1-22.1 0-41.1-7.1-54.8-20.6S436 441.2 435.6 419l-.3-15.7H229.5L309 210h399.2l81.7 193.3H589.4zm-375 76.8h157.3c24.3 57.1 76 90.8 140.4 90.8 33.7 0 65-9.4 90.3-27.2 22.2-15.6 39.5-37.4 50.7-63.6h156.5V814H214.4V480.1z" } }] }, "name": "inbox", "theme": "outlined" };
|
|
/* harmony default export */ var asn_InboxOutlined = (InboxOutlined);
|
|
|
|
// EXTERNAL MODULE: ./node_modules/_@ant-design_icons@5.6.0@@ant-design/icons/es/components/AntdIcon.js + 3 modules
|
|
var AntdIcon = __webpack_require__(31533);
|
|
;// CONCATENATED MODULE: ./node_modules/_@ant-design_icons@5.6.0@@ant-design/icons/es/icons/InboxOutlined.js
|
|
|
|
// GENERATE BY ./scripts/generate.ts
|
|
// DON NOT EDIT IT MANUALLY
|
|
|
|
|
|
|
|
|
|
var InboxOutlined_InboxOutlined = function InboxOutlined(props, ref) {
|
|
return /*#__PURE__*/_react_17_0_2_react.createElement(AntdIcon/* default */.Z, (0,esm_extends/* default */.Z)({}, props, {
|
|
ref: ref,
|
|
icon: asn_InboxOutlined
|
|
}));
|
|
};
|
|
|
|
/** */
|
|
var RefIcon = /*#__PURE__*/_react_17_0_2_react.forwardRef(InboxOutlined_InboxOutlined);
|
|
if (false) {}
|
|
/* harmony default export */ var icons_InboxOutlined = (RefIcon);
|
|
|
|
/***/ }),
|
|
|
|
/***/ 58131:
|
|
/*!**************************************************************!*\
|
|
!*** ./src/layouts/ShixunDetail/components/AddAssistant.tsx ***!
|
|
\**************************************************************/
|
|
/***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) {
|
|
|
|
"use strict";
|
|
/* harmony import */ var _root_workspace_ppte5yg23_local_v9_test4_node_modules_babel_runtime_7_23_6_babel_runtime_helpers_objectSpread2_js__WEBPACK_IMPORTED_MODULE_0__ = __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_0___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_0__);
|
|
/* harmony import */ var _root_workspace_ppte5yg23_local_v9_test4_node_modules_babel_runtime_7_23_6_babel_runtime_helpers_toConsumableArray_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./node_modules/_@babel_runtime@7.23.6@@babel/runtime/helpers/toConsumableArray.js */ 37205);
|
|
/* harmony import */ var _root_workspace_ppte5yg23_local_v9_test4_node_modules_babel_runtime_7_23_6_babel_runtime_helpers_toConsumableArray_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_toConsumableArray_js__WEBPACK_IMPORTED_MODULE_1__);
|
|
/* harmony import */ var _root_workspace_ppte5yg23_local_v9_test4_node_modules_babel_runtime_7_23_6_babel_runtime_helpers_regeneratorRuntime_js__WEBPACK_IMPORTED_MODULE_2__ = __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_2___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_2__);
|
|
/* harmony import */ var _root_workspace_ppte5yg23_local_v9_test4_node_modules_babel_runtime_7_23_6_babel_runtime_helpers_asyncToGenerator_js__WEBPACK_IMPORTED_MODULE_3__ = __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_3___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_3__);
|
|
/* harmony import */ var _root_workspace_ppte5yg23_local_v9_test4_node_modules_babel_runtime_7_23_6_babel_runtime_helpers_slicedToArray_js__WEBPACK_IMPORTED_MODULE_4__ = __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_4___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_4__);
|
|
/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! react */ 59301);
|
|
/* harmony import */ var antd__WEBPACK_IMPORTED_MODULE_12__ = __webpack_require__(/*! antd */ 78241);
|
|
/* harmony import */ var antd__WEBPACK_IMPORTED_MODULE_13__ = __webpack_require__(/*! antd */ 8591);
|
|
/* harmony import */ var antd__WEBPACK_IMPORTED_MODULE_14__ = __webpack_require__(/*! antd */ 24905);
|
|
/* harmony import */ var antd__WEBPACK_IMPORTED_MODULE_15__ = __webpack_require__(/*! antd */ 6848);
|
|
/* harmony import */ var antd__WEBPACK_IMPORTED_MODULE_16__ = __webpack_require__(/*! antd */ 43418);
|
|
/* harmony import */ var antd__WEBPACK_IMPORTED_MODULE_17__ = __webpack_require__(/*! antd */ 57809);
|
|
/* harmony import */ var antd__WEBPACK_IMPORTED_MODULE_18__ = __webpack_require__(/*! antd */ 92832);
|
|
/* harmony import */ var antd__WEBPACK_IMPORTED_MODULE_19__ = __webpack_require__(/*! antd */ 88522);
|
|
/* harmony import */ var antd__WEBPACK_IMPORTED_MODULE_20__ = __webpack_require__(/*! antd */ 3113);
|
|
/* harmony import */ var antd__WEBPACK_IMPORTED_MODULE_21__ = __webpack_require__(/*! antd */ 36546);
|
|
/* harmony import */ var react_infinite_scroller__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! react-infinite-scroller */ 26724);
|
|
/* harmony import */ var react_infinite_scroller__WEBPACK_IMPORTED_MODULE_6___default = /*#__PURE__*/__webpack_require__.n(react_infinite_scroller__WEBPACK_IMPORTED_MODULE_6__);
|
|
/* harmony import */ var moment__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! moment */ 61186);
|
|
/* harmony import */ var moment__WEBPACK_IMPORTED_MODULE_7___default = /*#__PURE__*/__webpack_require__.n(moment__WEBPACK_IMPORTED_MODULE_7__);
|
|
/* harmony import */ var _service_classrooms__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! @/service/classrooms */ 73516);
|
|
/* harmony import */ var _components_ImagesIcon__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! @/components/ImagesIcon */ 94983);
|
|
/* harmony import */ var umi__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(/*! umi */ 88271);
|
|
/* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_11__ = __webpack_require__(/*! react/jsx-runtime */ 37712);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
var AddTeacher = function AddTeacher(_ref) {
|
|
var _actionTabs$selectArr, _actionTabs$selectArr2;
|
|
var classroomList = _ref.classroomList,
|
|
loading = _ref.loading,
|
|
dispatch = _ref.dispatch,
|
|
onSubmit = _ref.onSubmit;
|
|
var params = (0,umi__WEBPACK_IMPORTED_MODULE_10__.useParams)();
|
|
var actionTabs = classroomList.actionTabs;
|
|
var _useState = (0,react__WEBPACK_IMPORTED_MODULE_5__.useState)([]),
|
|
_useState2 = _root_workspace_ppte5yg23_local_v9_test4_node_modules_babel_runtime_7_23_6_babel_runtime_helpers_slicedToArray_js__WEBPACK_IMPORTED_MODULE_4___default()(_useState, 2),
|
|
options = _useState2[0],
|
|
setOptions = _useState2[1];
|
|
var _useState3 = (0,react__WEBPACK_IMPORTED_MODULE_5__.useState)(true),
|
|
_useState4 = _root_workspace_ppte5yg23_local_v9_test4_node_modules_babel_runtime_7_23_6_babel_runtime_helpers_slicedToArray_js__WEBPACK_IMPORTED_MODULE_4___default()(_useState3, 2),
|
|
hasMore = _useState4[0],
|
|
setHasmore = _useState4[1];
|
|
var _useState5 = (0,react__WEBPACK_IMPORTED_MODULE_5__.useState)(false),
|
|
_useState6 = _root_workspace_ppte5yg23_local_v9_test4_node_modules_babel_runtime_7_23_6_babel_runtime_helpers_slicedToArray_js__WEBPACK_IMPORTED_MODULE_4___default()(_useState5, 2),
|
|
isLoading = _useState6[0],
|
|
setIsLoading = _useState6[1];
|
|
var _Form$useForm = antd__WEBPACK_IMPORTED_MODULE_12__/* ["default"] */ .Z.useForm(),
|
|
_Form$useForm2 = _root_workspace_ppte5yg23_local_v9_test4_node_modules_babel_runtime_7_23_6_babel_runtime_helpers_slicedToArray_js__WEBPACK_IMPORTED_MODULE_4___default()(_Form$useForm, 1),
|
|
form = _Form$useForm2[0];
|
|
var _useState7 = (0,react__WEBPACK_IMPORTED_MODULE_5__.useState)([]),
|
|
_useState8 = _root_workspace_ppte5yg23_local_v9_test4_node_modules_babel_runtime_7_23_6_babel_runtime_helpers_slicedToArray_js__WEBPACK_IMPORTED_MODULE_4___default()(_useState7, 2),
|
|
tableData = _useState8[0],
|
|
setTableData = _useState8[1];
|
|
var _useState9 = (0,react__WEBPACK_IMPORTED_MODULE_5__.useState)(1),
|
|
_useState10 = _root_workspace_ppte5yg23_local_v9_test4_node_modules_babel_runtime_7_23_6_babel_runtime_helpers_slicedToArray_js__WEBPACK_IMPORTED_MODULE_4___default()(_useState9, 2),
|
|
page = _useState10[0],
|
|
setPage = _useState10[1];
|
|
var _useState11 = (0,react__WEBPACK_IMPORTED_MODULE_5__.useState)([]),
|
|
_useState12 = _root_workspace_ppte5yg23_local_v9_test4_node_modules_babel_runtime_7_23_6_babel_runtime_helpers_slicedToArray_js__WEBPACK_IMPORTED_MODULE_4___default()(_useState11, 2),
|
|
selectArrs = _useState12[0],
|
|
setSelectArrs = _useState12[1];
|
|
var _useState13 = (0,react__WEBPACK_IMPORTED_MODULE_5__.useState)(true),
|
|
_useState14 = _root_workspace_ppte5yg23_local_v9_test4_node_modules_babel_runtime_7_23_6_babel_runtime_helpers_slicedToArray_js__WEBPACK_IMPORTED_MODULE_4___default()(_useState13, 2),
|
|
notSearch = _useState14[0],
|
|
setNotSearch = _useState14[1];
|
|
var autoCompleteRef = (0,react__WEBPACK_IMPORTED_MODULE_5__.useRef)();
|
|
var disabledDate = function disabledDate(current) {
|
|
return current && current < moment__WEBPACK_IMPORTED_MODULE_7___default()().startOf('day');
|
|
};
|
|
(0,react__WEBPACK_IMPORTED_MODULE_5__.useEffect)(function () {
|
|
if (['添加辅导教员', '添加指定用户'].includes(classroomList.actionTabs.key)) {
|
|
form.setFieldsValue({
|
|
school_name: "",
|
|
keyword: "",
|
|
search_type: '1'
|
|
});
|
|
setNotSearch(true);
|
|
getData();
|
|
}
|
|
}, [classroomList.actionTabs.key]);
|
|
var getData = /*#__PURE__*/function () {
|
|
var _ref2 = _root_workspace_ppte5yg23_local_v9_test4_node_modules_babel_runtime_7_23_6_babel_runtime_helpers_asyncToGenerator_js__WEBPACK_IMPORTED_MODULE_3___default()( /*#__PURE__*/_root_workspace_ppte5yg23_local_v9_test4_node_modules_babel_runtime_7_23_6_babel_runtime_helpers_regeneratorRuntime_js__WEBPACK_IMPORTED_MODULE_2___default()().mark(function _callee() {
|
|
var res;
|
|
return _root_workspace_ppte5yg23_local_v9_test4_node_modules_babel_runtime_7_23_6_babel_runtime_helpers_regeneratorRuntime_js__WEBPACK_IMPORTED_MODULE_2___default()().wrap(function _callee$(_context) {
|
|
while (1) switch (_context.prev = _context.next) {
|
|
case 0:
|
|
_context.next = 2;
|
|
return dispatch({
|
|
type: 'classroomList/getSchoolList',
|
|
payload: {}
|
|
});
|
|
case 2:
|
|
res = _context.sent;
|
|
setOptions(res.map(function (item) {
|
|
return {
|
|
value: item
|
|
};
|
|
}));
|
|
case 4:
|
|
case "end":
|
|
return _context.stop();
|
|
}
|
|
}, _callee);
|
|
}));
|
|
return function getData() {
|
|
return _ref2.apply(this, arguments);
|
|
};
|
|
}();
|
|
var onFinish = function onFinish() {
|
|
var _form$getFieldValue;
|
|
if (((_form$getFieldValue = form.getFieldValue()) === null || _form$getFieldValue === void 0 ? void 0 : _form$getFieldValue.keyword) === '') {
|
|
setTableData([]);
|
|
antd__WEBPACK_IMPORTED_MODULE_13__/* ["default"] */ .ZP.error("请输入搜索内容");
|
|
return;
|
|
}
|
|
;
|
|
setNotSearch(false);
|
|
setHasmore(true);
|
|
setIsLoading(false);
|
|
setSelectArrs([]);
|
|
setTimeout(function () {
|
|
handleInfiniteOnLoad(true);
|
|
}, 200);
|
|
};
|
|
var saveSelect = function saveSelect(id) {
|
|
id = String(id);
|
|
var key = selectArrs.indexOf(id);
|
|
if (key < 0) {
|
|
selectArrs.push(id);
|
|
} else {
|
|
selectArrs.splice(key, 1);
|
|
}
|
|
setSelectArrs(_root_workspace_ppte5yg23_local_v9_test4_node_modules_babel_runtime_7_23_6_babel_runtime_helpers_toConsumableArray_js__WEBPACK_IMPORTED_MODULE_1___default()(selectArrs));
|
|
};
|
|
var handleInfiniteOnLoad = /*#__PURE__*/function () {
|
|
var _ref3 = _root_workspace_ppte5yg23_local_v9_test4_node_modules_babel_runtime_7_23_6_babel_runtime_helpers_asyncToGenerator_js__WEBPACK_IMPORTED_MODULE_3___default()( /*#__PURE__*/_root_workspace_ppte5yg23_local_v9_test4_node_modules_babel_runtime_7_23_6_babel_runtime_helpers_regeneratorRuntime_js__WEBPACK_IMPORTED_MODULE_2___default()().mark(function _callee2() {
|
|
var reload,
|
|
_res$users,
|
|
formValue,
|
|
res,
|
|
_args2 = arguments;
|
|
return _root_workspace_ppte5yg23_local_v9_test4_node_modules_babel_runtime_7_23_6_babel_runtime_helpers_regeneratorRuntime_js__WEBPACK_IMPORTED_MODULE_2___default()().wrap(function _callee2$(_context2) {
|
|
while (1) switch (_context2.prev = _context2.next) {
|
|
case 0:
|
|
reload = _args2.length > 0 && _args2[0] !== undefined ? _args2[0] : false;
|
|
if (!(hasMore && !isLoading)) {
|
|
_context2.next = 12;
|
|
break;
|
|
}
|
|
formValue = form.getFieldValue();
|
|
console.log('----', formValue);
|
|
setIsLoading(true);
|
|
setPage(reload ? 1 : page + 1);
|
|
_context2.next = 8;
|
|
return (0,_service_classrooms__WEBPACK_IMPORTED_MODULE_8__/* .searchSchoolTeacherList */ .nQ)(_root_workspace_ppte5yg23_local_v9_test4_node_modules_babel_runtime_7_23_6_babel_runtime_helpers_objectSpread2_js__WEBPACK_IMPORTED_MODULE_0___default()({
|
|
page: reload ? 1 : page + 1,
|
|
container_id: params.coursesId,
|
|
container_type: 1,
|
|
school_name: formValue === null || formValue === void 0 ? void 0 : formValue.school_name,
|
|
keyword: formValue === null || formValue === void 0 ? void 0 : formValue.keyword
|
|
}, formValue));
|
|
case 8:
|
|
res = _context2.sent;
|
|
setIsLoading(false);
|
|
reload ? setTableData(_root_workspace_ppte5yg23_local_v9_test4_node_modules_babel_runtime_7_23_6_babel_runtime_helpers_toConsumableArray_js__WEBPACK_IMPORTED_MODULE_1___default()(res.users)) : setTableData([].concat(_root_workspace_ppte5yg23_local_v9_test4_node_modules_babel_runtime_7_23_6_babel_runtime_helpers_toConsumableArray_js__WEBPACK_IMPORTED_MODULE_1___default()(tableData), _root_workspace_ppte5yg23_local_v9_test4_node_modules_babel_runtime_7_23_6_babel_runtime_helpers_toConsumableArray_js__WEBPACK_IMPORTED_MODULE_1___default()(res.users)));
|
|
// setIsLoading(false);
|
|
if (((_res$users = res.users) === null || _res$users === void 0 ? void 0 : _res$users.length) < 10) setHasmore(false);
|
|
case 12:
|
|
case "end":
|
|
return _context2.stop();
|
|
}
|
|
}, _callee2);
|
|
}));
|
|
return function handleInfiniteOnLoad() {
|
|
return _ref3.apply(this, arguments);
|
|
};
|
|
}();
|
|
var onOK = /*#__PURE__*/function () {
|
|
var _ref4 = _root_workspace_ppte5yg23_local_v9_test4_node_modules_babel_runtime_7_23_6_babel_runtime_helpers_asyncToGenerator_js__WEBPACK_IMPORTED_MODULE_3___default()( /*#__PURE__*/_root_workspace_ppte5yg23_local_v9_test4_node_modules_babel_runtime_7_23_6_babel_runtime_helpers_regeneratorRuntime_js__WEBPACK_IMPORTED_MODULE_2___default()().mark(function _callee3() {
|
|
var newArray, res;
|
|
return _root_workspace_ppte5yg23_local_v9_test4_node_modules_babel_runtime_7_23_6_babel_runtime_helpers_regeneratorRuntime_js__WEBPACK_IMPORTED_MODULE_2___default()().wrap(function _callee3$(_context3) {
|
|
while (1) switch (_context3.prev = _context3.next) {
|
|
case 0:
|
|
if (!(selectArrs == '')) {
|
|
_context3.next = 4;
|
|
break;
|
|
}
|
|
antd__WEBPACK_IMPORTED_MODULE_13__/* ["default"] */ .ZP.error('请选择人数');
|
|
_context3.next = 15;
|
|
break;
|
|
case 4:
|
|
if (!(classroomList.actionTabs.key == '添加指定用户')) {
|
|
_context3.next = 10;
|
|
break;
|
|
}
|
|
newArray = tableData.filter(function (item) {
|
|
return selectArrs.includes(String(item.numid));
|
|
});
|
|
onSubmit(newArray);
|
|
return _context3.abrupt("return");
|
|
case 10:
|
|
if (!(classroomList.actionTabs.key == '添加辅导教员')) {
|
|
_context3.next = 15;
|
|
break;
|
|
}
|
|
_context3.next = 13;
|
|
return (0,_service_classrooms__WEBPACK_IMPORTED_MODULE_8__/* .addTeacher */ .uh)(_root_workspace_ppte5yg23_local_v9_test4_node_modules_babel_runtime_7_23_6_babel_runtime_helpers_objectSpread2_js__WEBPACK_IMPORTED_MODULE_0___default()(_root_workspace_ppte5yg23_local_v9_test4_node_modules_babel_runtime_7_23_6_babel_runtime_helpers_objectSpread2_js__WEBPACK_IMPORTED_MODULE_0___default()({}, params), {}, {
|
|
role: 3,
|
|
user_list: selectArrs.map(function (v) {
|
|
return {
|
|
user_id: v
|
|
};
|
|
})
|
|
}));
|
|
case 13:
|
|
res = _context3.sent;
|
|
if (res.status === 0) {
|
|
antd__WEBPACK_IMPORTED_MODULE_13__/* ["default"] */ .ZP.success('添加成功');
|
|
dispatch({
|
|
type: 'classroomList/setActionTabs',
|
|
payload: {}
|
|
});
|
|
dispatch({
|
|
type: 'classroomList/getClassroomTopBanner',
|
|
payload: {
|
|
id: params.coursesId
|
|
}
|
|
});
|
|
dispatch({
|
|
type: 'teachers/getList',
|
|
payload: _root_workspace_ppte5yg23_local_v9_test4_node_modules_babel_runtime_7_23_6_babel_runtime_helpers_objectSpread2_js__WEBPACK_IMPORTED_MODULE_0___default()({}, params)
|
|
});
|
|
umi__WEBPACK_IMPORTED_MODULE_10__.history.push("/classrooms/".concat(params.coursesId, "/teachers"));
|
|
}
|
|
case 15:
|
|
case "end":
|
|
return _context3.stop();
|
|
}
|
|
}, _callee3);
|
|
}));
|
|
return function onOK() {
|
|
return _ref4.apply(this, arguments);
|
|
};
|
|
}();
|
|
var columns = [{
|
|
title: "",
|
|
dataIndex: "added",
|
|
width: 40,
|
|
ellipsis: true,
|
|
render: function render(add, record) {
|
|
return /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_11__.jsx)(antd__WEBPACK_IMPORTED_MODULE_14__/* ["default"] */ .Z, {
|
|
value: record.numid,
|
|
checked: selectArrs.includes(String(record.numid)),
|
|
disabled: !!add
|
|
});
|
|
}
|
|
}, {
|
|
title: "姓名",
|
|
width: 100,
|
|
ellipsis: true,
|
|
dataIndex: "username",
|
|
render: function render(text, record) {
|
|
return /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_11__.jsx)(antd__WEBPACK_IMPORTED_MODULE_15__/* ["default"] */ .Z, {
|
|
placement: "bottom",
|
|
title: text,
|
|
children: /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_11__.jsx)(umi__WEBPACK_IMPORTED_MODULE_10__.Link, {
|
|
className: "bold c-black",
|
|
to: "/users/".concat(record.login),
|
|
target: "_blank",
|
|
children: text || '--'
|
|
})
|
|
});
|
|
}
|
|
}, {
|
|
title: "手机",
|
|
width: 100,
|
|
dataIndex: "phone",
|
|
ellipsis: true,
|
|
render: function render(text) {
|
|
return /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_11__.jsx)(antd__WEBPACK_IMPORTED_MODULE_15__/* ["default"] */ .Z, {
|
|
placement: "bottom",
|
|
title: text,
|
|
children: /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_11__.jsx)("span", {
|
|
children: text || '--'
|
|
})
|
|
});
|
|
}
|
|
}, {
|
|
title: "邮箱",
|
|
dataIndex: "email",
|
|
width: 100,
|
|
ellipsis: true,
|
|
render: function render(text) {
|
|
return /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_11__.jsx)(antd__WEBPACK_IMPORTED_MODULE_15__/* ["default"] */ .Z, {
|
|
placement: "bottom",
|
|
title: text,
|
|
children: /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_11__.jsx)("span", {
|
|
children: text || '--'
|
|
})
|
|
});
|
|
}
|
|
}, {
|
|
title: "学号/工号",
|
|
width: 100,
|
|
dataIndex: "student_number",
|
|
ellipsis: true,
|
|
render: function render(text) {
|
|
return /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_11__.jsx)(antd__WEBPACK_IMPORTED_MODULE_15__/* ["default"] */ .Z, {
|
|
placement: "bottom",
|
|
title: text,
|
|
children: /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_11__.jsx)("span", {
|
|
children: text || '--'
|
|
})
|
|
});
|
|
}
|
|
}, {
|
|
title: "学校/单位",
|
|
width: 150,
|
|
dataIndex: "school_name",
|
|
ellipsis: true,
|
|
render: function render(text) {
|
|
return /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_11__.jsx)(antd__WEBPACK_IMPORTED_MODULE_15__/* ["default"] */ .Z, {
|
|
placement: "bottom",
|
|
title: text,
|
|
children: /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_11__.jsx)("span", {
|
|
children: text || '--'
|
|
})
|
|
});
|
|
}
|
|
}, {
|
|
title: "院系/部门",
|
|
dataIndex: "depart_name",
|
|
width: 130,
|
|
ellipsis: true,
|
|
render: function render(text) {
|
|
return /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_11__.jsx)(antd__WEBPACK_IMPORTED_MODULE_15__/* ["default"] */ .Z, {
|
|
placement: "bottom",
|
|
title: text,
|
|
children: /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_11__.jsx)("span", {
|
|
children: text || '--'
|
|
})
|
|
});
|
|
}
|
|
}, {
|
|
title: "实名认证",
|
|
dataIndex: "school_name",
|
|
width: 100,
|
|
render: function render(text) {
|
|
return text ? '是' : "否";
|
|
}
|
|
}, {
|
|
title: "最后登录时间",
|
|
dataIndex: "last_login_on",
|
|
width: 140,
|
|
ellipsis: true,
|
|
render: function render(text) {
|
|
return /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_11__.jsx)(antd__WEBPACK_IMPORTED_MODULE_15__/* ["default"] */ .Z, {
|
|
placement: "bottom",
|
|
title: text,
|
|
children: /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_11__.jsx)("span", {
|
|
children: moment__WEBPACK_IMPORTED_MODULE_7___default()(text).format("YYYY-MM-DD HH:mm")
|
|
})
|
|
});
|
|
}
|
|
}, {
|
|
title: "状态",
|
|
dataIndex: "added",
|
|
width: 80,
|
|
render: function render(text) {
|
|
if (text === 1) {
|
|
return /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_11__.jsx)("span", {
|
|
className: "c-green",
|
|
children: "\u5DF2\u6DFB\u52A0"
|
|
});
|
|
}
|
|
}
|
|
}];
|
|
return /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_11__.jsxs)(antd__WEBPACK_IMPORTED_MODULE_16__/* ["default"] */ .Z, {
|
|
centered: true,
|
|
title: classroomList.actionTabs.key,
|
|
open: ['添加辅导教员', '添加指定用户'].includes(classroomList.actionTabs.key) ? true : false,
|
|
okText: "\u786E\u5B9A",
|
|
cancelText: "\u53D6\u6D88",
|
|
width: 1100,
|
|
zIndex: 1000,
|
|
bodyStyle: {
|
|
minHeight: 200
|
|
},
|
|
onOk: /*#__PURE__*/_root_workspace_ppte5yg23_local_v9_test4_node_modules_babel_runtime_7_23_6_babel_runtime_helpers_asyncToGenerator_js__WEBPACK_IMPORTED_MODULE_3___default()( /*#__PURE__*/_root_workspace_ppte5yg23_local_v9_test4_node_modules_babel_runtime_7_23_6_babel_runtime_helpers_regeneratorRuntime_js__WEBPACK_IMPORTED_MODULE_2___default()().mark(function _callee4() {
|
|
return _root_workspace_ppte5yg23_local_v9_test4_node_modules_babel_runtime_7_23_6_babel_runtime_helpers_regeneratorRuntime_js__WEBPACK_IMPORTED_MODULE_2___default()().wrap(function _callee4$(_context4) {
|
|
while (1) switch (_context4.prev = _context4.next) {
|
|
case 0:
|
|
onOK();
|
|
case 1:
|
|
case "end":
|
|
return _context4.stop();
|
|
}
|
|
}, _callee4);
|
|
})),
|
|
onCancel: function onCancel() {
|
|
setSelectArrs([]);
|
|
dispatch({
|
|
type: 'classroomList/setActionTabs',
|
|
payload: {}
|
|
});
|
|
},
|
|
children: [/*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_11__.jsxs)(antd__WEBPACK_IMPORTED_MODULE_12__/* ["default"] */ .Z, {
|
|
layout: "inline",
|
|
form: form,
|
|
initialValues: {
|
|
school_name: "",
|
|
keyword: "",
|
|
search_type: '1'
|
|
},
|
|
className: "mt10"
|
|
// onFinish={onFinish}
|
|
,
|
|
children: [/*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_11__.jsx)(antd__WEBPACK_IMPORTED_MODULE_12__/* ["default"] */ .Z.Item, {
|
|
name: "search_type",
|
|
label: "\u641C\u7D22\u7C7B\u578B",
|
|
children: /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_11__.jsxs)(antd__WEBPACK_IMPORTED_MODULE_17__["default"], {
|
|
style: {
|
|
width: 90
|
|
},
|
|
children: [/*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_11__.jsx)(antd__WEBPACK_IMPORTED_MODULE_17__["default"].Option, {
|
|
value: "1",
|
|
children: "\u59D3\u540D"
|
|
}), /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_11__.jsx)(antd__WEBPACK_IMPORTED_MODULE_17__["default"].Option, {
|
|
value: "2",
|
|
children: "\u624B\u673A\u53F7"
|
|
}), /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_11__.jsx)(antd__WEBPACK_IMPORTED_MODULE_17__["default"].Option, {
|
|
value: "3",
|
|
children: "\u90AE\u7BB1"
|
|
})]
|
|
})
|
|
}), /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_11__.jsx)(antd__WEBPACK_IMPORTED_MODULE_12__/* ["default"] */ .Z.Item, {
|
|
name: "keyword",
|
|
label: "\u641C\u7D22\u5185\u5BB9\uFF1A",
|
|
children: /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_11__.jsx)(antd__WEBPACK_IMPORTED_MODULE_18__/* ["default"] */ .Z, {
|
|
allowClear: true,
|
|
style: {
|
|
width: 260
|
|
},
|
|
placeholder: "\u8BF7\u8F93\u5165\u641C\u7D22\u5185\u5BB9",
|
|
size: 'middle',
|
|
defaultValue: ((_actionTabs$selectArr = actionTabs.selectArrs) === null || _actionTabs$selectArr === void 0 ? void 0 : _actionTabs$selectArr.category_name) || ((_actionTabs$selectArr2 = actionTabs.selectArrs) === null || _actionTabs$selectArr2 === void 0 ? void 0 : _actionTabs$selectArr2.name)
|
|
})
|
|
}), /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_11__.jsx)(antd__WEBPACK_IMPORTED_MODULE_12__/* ["default"] */ .Z.Item, {
|
|
name: "school_name",
|
|
label: "\u5355\u4F4D\uFF1A",
|
|
children: /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_11__.jsx)(antd__WEBPACK_IMPORTED_MODULE_19__/* ["default"] */ .Z, {
|
|
options: options,
|
|
style: {
|
|
width: 390
|
|
},
|
|
size: 'middle',
|
|
placeholder: "\u8BF7\u8F93\u5165\u5355\u4F4D\u540D\u79F0"
|
|
// getPopupContainer={() => autoCompleteRef.current}
|
|
,
|
|
filterOption: function filterOption(inputValue, option) {
|
|
return option.value.toUpperCase().indexOf(inputValue.toUpperCase()) !== -1;
|
|
}
|
|
})
|
|
}), /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_11__.jsx)(antd__WEBPACK_IMPORTED_MODULE_12__/* ["default"] */ .Z.Item, {
|
|
children: /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_11__.jsx)(antd__WEBPACK_IMPORTED_MODULE_20__/* ["default"] */ .ZP, {
|
|
htmlType: "submit",
|
|
type: "primary",
|
|
size: 'middle',
|
|
onClick: function onClick() {
|
|
return onFinish();
|
|
},
|
|
children: "\u641C\u7D22"
|
|
})
|
|
})]
|
|
}), notSearch && /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_11__.jsxs)("div", {
|
|
className: "tc font16 c-light-black mt40 pb30",
|
|
children: [/*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_11__.jsx)("img", {
|
|
src: _components_ImagesIcon__WEBPACK_IMPORTED_MODULE_9__/* .searchIcon */ .RL,
|
|
width: "100",
|
|
alt: ""
|
|
}), /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_11__.jsx)("br", {}), /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_11__.jsx)("p", {
|
|
className: "mt20",
|
|
children: "\u8BF7\u641C\u7D22\u8981\u6DFB\u52A0\u7684\u4EBA\u5458"
|
|
})]
|
|
}), !notSearch && tableData == '' && !isLoading && /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_11__.jsxs)("div", {
|
|
className: "tc font16 c-light-black mt40 pb30",
|
|
children: [/*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_11__.jsx)("img", {
|
|
src: _components_ImagesIcon__WEBPACK_IMPORTED_MODULE_9__/* .noDataIcon */ .z3,
|
|
width: "100",
|
|
alt: ""
|
|
}), /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_11__.jsx)("br", {}), /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_11__.jsx)("p", {
|
|
className: "mt20",
|
|
children: "\u6682\u65F6\u8FD8\u6CA1\u6709\u76F8\u5173\u6570\u636E\u54E6!"
|
|
})]
|
|
}), (!notSearch && tableData != '' || isLoading) && /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_11__.jsxs)("section", {
|
|
children: [/*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_11__.jsx)("div", {
|
|
className: "flexd-table-header mt20",
|
|
children: /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_11__.jsx)(antd__WEBPACK_IMPORTED_MODULE_21__/* ["default"] */ .Z, {
|
|
pagination: false,
|
|
dataSource: [],
|
|
columns: columns
|
|
})
|
|
}), /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_11__.jsx)("div", {
|
|
style: {
|
|
maxHeight: 260,
|
|
overflow: 'auto'
|
|
},
|
|
children: /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_11__.jsx)((react_infinite_scroller__WEBPACK_IMPORTED_MODULE_6___default()), {
|
|
initialLoad: false,
|
|
pageStart: 1,
|
|
threshold: 20,
|
|
loadMore: function loadMore(page) {
|
|
handleInfiniteOnLoad();
|
|
},
|
|
hasMore: hasMore,
|
|
useWindow: false,
|
|
children: /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_11__.jsx)(antd__WEBPACK_IMPORTED_MODULE_21__/* ["default"] */ .Z, {
|
|
loading: isLoading,
|
|
showHeader: false,
|
|
pagination: false,
|
|
dataSource: tableData,
|
|
columns: columns,
|
|
onRow: function onRow(record) {
|
|
return {
|
|
onClick: function onClick(event) {
|
|
if (!event.currentTarget.querySelector("input").disabled) saveSelect(event.currentTarget.querySelector("input").value);
|
|
}
|
|
};
|
|
}
|
|
})
|
|
})
|
|
})]
|
|
})]
|
|
});
|
|
};
|
|
/* harmony default export */ __webpack_exports__.Z = ((0,umi__WEBPACK_IMPORTED_MODULE_10__.connect)(function (_ref6) {
|
|
var classroomList = _ref6.classroomList,
|
|
loading = _ref6.loading;
|
|
return {
|
|
classroomList: classroomList,
|
|
loading: loading
|
|
};
|
|
})(AddTeacher));
|
|
|
|
/***/ }),
|
|
|
|
/***/ 26061:
|
|
/*!******************************************************************************!*\
|
|
!*** ./src/pages/Laboratory/LaboratoryRoom/createRoom/index.tsx + 3 modules ***!
|
|
\******************************************************************************/
|
|
/***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) {
|
|
|
|
"use strict";
|
|
// ESM COMPAT FLAG
|
|
__webpack_require__.r(__webpack_exports__);
|
|
|
|
// EXPORTS
|
|
__webpack_require__.d(__webpack_exports__, {
|
|
"default": function() { return /* binding */ createRoom; }
|
|
});
|
|
|
|
// 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/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/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/toConsumableArray.js
|
|
var toConsumableArray = __webpack_require__(37205);
|
|
var toConsumableArray_default = /*#__PURE__*/__webpack_require__.n(toConsumableArray);
|
|
// 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/_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__(88271);
|
|
// EXTERNAL MODULE: ./node_modules/_antd@5.9.0@antd/es/form/index.js + 19 modules
|
|
var es_form = __webpack_require__(78241);
|
|
// EXTERNAL MODULE: ./node_modules/_antd@5.9.0@antd/es/select/index.js
|
|
var es_select = __webpack_require__(57809);
|
|
// EXTERNAL MODULE: ./node_modules/_antd@5.9.0@antd/es/input/index.js + 3 modules
|
|
var input = __webpack_require__(92832);
|
|
// EXTERNAL MODULE: ./node_modules/_antd@5.9.0@antd/es/checkbox/index.js + 3 modules
|
|
var es_checkbox = __webpack_require__(24905);
|
|
// EXTERNAL MODULE: ./node_modules/_antd@5.9.0@antd/es/radio/index.js + 5 modules
|
|
var es_radio = __webpack_require__(5112);
|
|
// EXTERNAL MODULE: ./node_modules/_antd@5.9.0@antd/es/modal/index.js + 16 modules
|
|
var modal = __webpack_require__(43418);
|
|
// 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/tabs/index.js + 24 modules
|
|
var tabs = __webpack_require__(99313);
|
|
// EXTERNAL MODULE: ./node_modules/_antd@5.9.0@antd/es/table/index.js + 85 modules
|
|
var table = __webpack_require__(36546);
|
|
// EXTERNAL MODULE: ./node_modules/_antd@5.9.0@antd/es/input/TextArea.js
|
|
var TextArea = __webpack_require__(1643);
|
|
;// CONCATENATED MODULE: ./src/pages/Laboratory/LaboratoryRoom/createRoom/index.less?modules
|
|
// extracted by mini-css-extract-plugin
|
|
/* harmony default export */ var createRoommodules = ({"wrap":"wrap___uHoxU","back_style":"back_style___da5ps","header":"header___qcvCp","header_form":"header_form___GJHry","guize_select":"guize_select___AA6wa","guize_update":"guize_update____QvNi","shangchuan_button":"shangchuan_button___bNn84","shangchuan_img":"shangchuan_img___fCYDP","shangchuan_close":"shangchuan_close___U0b6Y","close_button":"close_button___UGlhv","submit_button":"submit_button___GOKRY","add_button":"add_button___Hw_e0"});
|
|
// EXTERNAL MODULE: ./src/service/laboratory.ts
|
|
var laboratory = __webpack_require__(39531);
|
|
// EXTERNAL MODULE: ./node_modules/_antd@5.9.0@antd/es/spin/index.js + 1 modules
|
|
var spin = __webpack_require__(71418);
|
|
// EXTERNAL MODULE: ./node_modules/_react-cropper@1.3.0@react-cropper/dist/react-cropper.js
|
|
var react_cropper = __webpack_require__(33555);
|
|
;// CONCATENATED MODULE: ./src/pages/Laboratory/LaboratoryRoom/createRoom/UpdateAvatarModal/index.less?modules
|
|
// extracted by mini-css-extract-plugin
|
|
/* harmony default export */ var UpdateAvatarModalmodules = ({"modal":"modal___YAIcg","avatarWrap":"avatarWrap___sF05G","tip":"tip___uIA24","previewWrap":"previewWrap___TA19F","previewImg":"previewImg___ebNuz","uploadButton":"uploadButton___fjXyt"});
|
|
// EXTERNAL MODULE: ./node_modules/_cropperjs@1.6.2@cropperjs/dist/cropper.css
|
|
var cropper = __webpack_require__(35283);
|
|
// EXTERNAL MODULE: ./node_modules/_react@17.0.2@react/jsx-runtime.js
|
|
var jsx_runtime = __webpack_require__(37712);
|
|
;// CONCATENATED MODULE: ./src/pages/Laboratory/LaboratoryRoom/createRoom/UpdateAvatarModal/index.tsx
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
var UpdateAvatarModal = function UpdateAvatarModal(_ref) {
|
|
var user = _ref.user,
|
|
account = _ref.account,
|
|
globalSetting = _ref.globalSetting,
|
|
loading = _ref.loading,
|
|
dispatch = _ref.dispatch,
|
|
visible = _ref.visible,
|
|
onClose = _ref.onClose,
|
|
setImgUrl = _ref.setImgUrl;
|
|
var _useState = (0,_react_17_0_2_react.useState)(),
|
|
_useState2 = slicedToArray_default()(_useState, 2),
|
|
avatarImg = _useState2[0],
|
|
setAvatarImg = _useState2[1];
|
|
var cropper = (0,_react_17_0_2_react.useRef)();
|
|
(0,_react_17_0_2_react.useEffect)(function () {
|
|
if (visible) {
|
|
// setAvatarImg(`${env.IMG_SERVER}/images/${user.userInfo?.image_url}`);
|
|
setAvatarImg("");
|
|
}
|
|
}, [user.userInfo, visible]);
|
|
var onChange = function onChange(e) {
|
|
var _files;
|
|
var files;
|
|
if (e.dataTransfer) {
|
|
files = e.dataTransfer.files;
|
|
} else if (e.target) {
|
|
files = e.target.files;
|
|
}
|
|
if (!((_files = files) !== null && _files !== void 0 && _files.length)) {
|
|
return;
|
|
}
|
|
var file = files[0];
|
|
if (!/^image\/\w+/.test(file.type)) {
|
|
message/* default */.ZP.info('请选择一个图片格式的文件');
|
|
return;
|
|
}
|
|
|
|
// if (file.size > 10 * 1024 * 1024) {
|
|
// message.info('仅支持文件大小小于10M的文件');
|
|
// return;
|
|
// }
|
|
|
|
var reader = new FileReader();
|
|
reader.onload = function () {
|
|
setAvatarImg(reader.result);
|
|
};
|
|
reader.readAsDataURL(files[0]);
|
|
};
|
|
var handleOk = /*#__PURE__*/function () {
|
|
var _ref2 = asyncToGenerator_default()( /*#__PURE__*/regeneratorRuntime_default()().mark(function _callee() {
|
|
var dataUrl;
|
|
return regeneratorRuntime_default()().wrap(function _callee$(_context) {
|
|
while (1) switch (_context.prev = _context.next) {
|
|
case 0:
|
|
dataUrl = cropper.current.getCroppedCanvas().toDataURL("image/jpeg");
|
|
if (!dataUrl) {
|
|
message/* default */.ZP.info('请先上传图片');
|
|
}
|
|
setImgUrl(dataUrl);
|
|
onClose();
|
|
// const res = await dispatch({
|
|
// type: 'account/updateAvatar',
|
|
// payload: { image: dataUrl, login: user.userInfo?.login }
|
|
// });
|
|
|
|
// handlerCancel();
|
|
// if (res.status === 0) {
|
|
// message.info('修改头像成功');
|
|
// dispatch({
|
|
// type: 'user/getUserInfo',
|
|
// });
|
|
// }
|
|
case 4:
|
|
case "end":
|
|
return _context.stop();
|
|
}
|
|
}, _callee);
|
|
}));
|
|
return function handleOk() {
|
|
return _ref2.apply(this, arguments);
|
|
};
|
|
}();
|
|
var handlerCancel = function handlerCancel() {
|
|
onClose();
|
|
};
|
|
return /*#__PURE__*/(0,jsx_runtime.jsx)(modal/* default */.Z, {
|
|
maskClosable: false,
|
|
centered: true,
|
|
keyboard: false,
|
|
closable: false,
|
|
open: visible,
|
|
title: "\u4E0A\u4F20\u623F\u95F4\u56FE\u7247",
|
|
width: 550,
|
|
forceRender: true,
|
|
confirmLoading: loading['account/updateAvatar'],
|
|
onOk: handleOk,
|
|
onCancel: handlerCancel,
|
|
children: /*#__PURE__*/(0,jsx_runtime.jsx)(spin/* default */.Z, {
|
|
spinning: !!loading['account/updateAvatar'],
|
|
children: /*#__PURE__*/(0,jsx_runtime.jsxs)("div", {
|
|
className: UpdateAvatarModalmodules.modal,
|
|
children: [/*#__PURE__*/(0,jsx_runtime.jsx)("div", {
|
|
children: /*#__PURE__*/(0,jsx_runtime.jsx)("div", {
|
|
className: UpdateAvatarModalmodules.avatarWrap,
|
|
children: /*#__PURE__*/(0,jsx_runtime.jsx)(react_cropper/* default */.Z, {
|
|
style: {
|
|
height: 320,
|
|
width: 320
|
|
},
|
|
ref: cropper,
|
|
src: avatarImg,
|
|
guides: false,
|
|
aspectRatio: 2 / 1,
|
|
preview: "#updateAvatarImg"
|
|
})
|
|
})
|
|
}), /*#__PURE__*/(0,jsx_runtime.jsxs)("div", {
|
|
className: UpdateAvatarModalmodules.previewWrap,
|
|
children: [/*#__PURE__*/(0,jsx_runtime.jsxs)("div", {
|
|
children: [/*#__PURE__*/(0,jsx_runtime.jsx)("div", {
|
|
className: UpdateAvatarModalmodules.previewImg,
|
|
id: "updateAvatarImg"
|
|
}), /*#__PURE__*/(0,jsx_runtime.jsx)("div", {
|
|
className: "".concat(UpdateAvatarModalmodules.tip, " tc"),
|
|
children: "\u623F\u95F4\u56FE\u7247\u9884\u89C8"
|
|
})]
|
|
}), /*#__PURE__*/(0,jsx_runtime.jsxs)("label", {
|
|
className: UpdateAvatarModalmodules.uploadButton,
|
|
id: "uploadBtn",
|
|
htmlFor: "inputImage",
|
|
children: [/*#__PURE__*/(0,jsx_runtime.jsx)("input", {
|
|
type: "file",
|
|
className: "sr-only",
|
|
id: "inputImage",
|
|
name: "file",
|
|
accept: "image/*",
|
|
style: {
|
|
display: "none"
|
|
},
|
|
onChange: onChange
|
|
}), "\u70B9\u51FB\u4E0A\u4F20"]
|
|
})]
|
|
})]
|
|
})
|
|
})
|
|
});
|
|
};
|
|
/* harmony default export */ var createRoom_UpdateAvatarModal = ((0,_umi_production_exports.connect)(function (_ref3) {
|
|
var user = _ref3.user,
|
|
account = _ref3.account,
|
|
loading = _ref3.loading,
|
|
globalSetting = _ref3.globalSetting;
|
|
return {
|
|
user: user,
|
|
account: account,
|
|
globalSetting: globalSetting,
|
|
loading: loading.effects
|
|
};
|
|
})(UpdateAvatarModal));
|
|
// EXTERNAL MODULE: ./src/components/MultiUpload/index.tsx + 3 modules
|
|
var MultiUpload = __webpack_require__(86618);
|
|
// EXTERNAL MODULE: ./src/assets/images/uploadImg.svg
|
|
var uploadImg = __webpack_require__(43929);
|
|
// EXTERNAL MODULE: ./src/pages/Laboratory/RuleManage/components/CustomRules/testData.ts
|
|
var testData = __webpack_require__(6529);
|
|
// EXTERNAL MODULE: ./src/pages/Laboratory/RuleManage/components/CustomRules/index.tsx + 1 modules
|
|
var CustomRules = __webpack_require__(99439);
|
|
// EXTERNAL MODULE: ./src/utils/env.ts + 1 modules
|
|
var env = __webpack_require__(69423);
|
|
// EXTERNAL MODULE: ./src/assets/images/roomInitImg.png
|
|
var roomInitImg = __webpack_require__(58253);
|
|
// EXTERNAL MODULE: ./src/layouts/ShixunDetail/components/AddAssistant.tsx
|
|
var AddAssistant = __webpack_require__(58131);
|
|
;// CONCATENATED MODULE: ./src/pages/Laboratory/LaboratoryRoom/createRoom/index.tsx
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
var Navigation = function Navigation(_ref) {
|
|
var _selectRuleId$, _account$actionTabs;
|
|
var loading = _ref.loading,
|
|
user = _ref.user,
|
|
dispatch = _ref.dispatch,
|
|
account = _ref.account,
|
|
classroomList = _ref.classroomList;
|
|
var params = (0,_umi_production_exports.useParams)();
|
|
var _Form$useForm = es_form/* default */.Z.useForm(),
|
|
_Form$useForm2 = slicedToArray_default()(_Form$useForm, 1),
|
|
myForm = _Form$useForm2[0];
|
|
var _useState = (0,_react_17_0_2_react.useState)(1),
|
|
_useState2 = slicedToArray_default()(_useState, 2),
|
|
showRules = _useState2[0],
|
|
setShowRules = _useState2[1]; // 自定义开放
|
|
var _useState3 = (0,_react_17_0_2_react.useState)(false),
|
|
_useState4 = slicedToArray_default()(_useState3, 2),
|
|
openRuleModal = _useState4[0],
|
|
setOpenRuleModal = _useState4[1]; //选择规则弹框
|
|
var _useState5 = (0,_react_17_0_2_react.useState)([]),
|
|
_useState6 = slicedToArray_default()(_useState5, 2),
|
|
selectRuleList = _useState6[0],
|
|
setSelectRuleList = _useState6[1]; //预约规则
|
|
var _useState7 = (0,_react_17_0_2_react.useState)([]),
|
|
_useState8 = slicedToArray_default()(_useState7, 2),
|
|
selectRule = _useState8[0],
|
|
setSelectRule = _useState8[1]; //弹窗内选中的预约规则
|
|
var _useState9 = (0,_react_17_0_2_react.useState)([]),
|
|
_useState10 = slicedToArray_default()(_useState9, 2),
|
|
selectRuleId = _useState10[0],
|
|
setSelectRuleId = _useState10[1]; //选中的预约规则
|
|
var _useState11 = (0,_react_17_0_2_react.useState)('0'),
|
|
_useState12 = slicedToArray_default()(_useState11, 2),
|
|
statusRule = _useState12[0],
|
|
setStatusRule = _useState12[1];
|
|
var _useState13 = (0,_react_17_0_2_react.useState)(''),
|
|
_useState14 = slicedToArray_default()(_useState13, 2),
|
|
oldRule = _useState14[0],
|
|
setOldRule = _useState14[1]; //进入编辑最开始的预约规则
|
|
var _useState15 = (0,_react_17_0_2_react.useState)(false),
|
|
_useState16 = slicedToArray_default()(_useState15, 2),
|
|
roomStatus = _useState16[0],
|
|
setRoomStatus = _useState16[1]; //房间是否开启
|
|
//实验室下拉
|
|
var _useState17 = (0,_react_17_0_2_react.useState)([]),
|
|
_useState18 = slicedToArray_default()(_useState17, 2),
|
|
laboratoryLists = _useState18[0],
|
|
setLaboratoryLists = _useState18[1];
|
|
var _useState19 = (0,_react_17_0_2_react.useState)([]),
|
|
_useState20 = slicedToArray_default()(_useState19, 2),
|
|
selectUsers = _useState20[0],
|
|
setSelectUsers = _useState20[1]; //选择用户
|
|
|
|
var items = [{
|
|
key: '0',
|
|
label: '我创建的'
|
|
}, {
|
|
key: '1',
|
|
label: '公开'
|
|
}];
|
|
(0,_react_17_0_2_react.useEffect)(function () {
|
|
if ((params === null || params === void 0 ? void 0 : params.roomId) != 'null') {
|
|
//编辑 房间详情
|
|
(0,laboratory/* classroom_rooms_info */.Iy)({
|
|
id: params === null || params === void 0 ? void 0 : params.roomId
|
|
}).then(function (res) {
|
|
var _res$data, _res$data2, _res$data3, _res$data4, _res$data5, _res$data6, _res$data7, _res$data8, _res$data9, _res$data10, _res$data11, _res$data12, _res$data13, _res$data14, _res$data15, _res$data17, _res$data18;
|
|
myForm.setFieldsValue({
|
|
attachment_ids: (0,MultiUpload/* coverToFileList */.z)(res === null || res === void 0 || (_res$data = res.data) === null || _res$data === void 0 ? void 0 : _res$data.attachments),
|
|
area: res === null || res === void 0 || (_res$data2 = res.data) === null || _res$data2 === void 0 ? void 0 : _res$data2.area,
|
|
classroom_id: res === null || res === void 0 || (_res$data3 = res.data) === null || _res$data3 === void 0 ? void 0 : _res$data3.classroom_id,
|
|
description: res === null || res === void 0 || (_res$data4 = res.data) === null || _res$data4 === void 0 ? void 0 : _res$data4.description,
|
|
title: res === null || res === void 0 || (_res$data5 = res.data) === null || _res$data5 === void 0 ? void 0 : _res$data5.title,
|
|
work_num: res === null || res === void 0 || (_res$data6 = res.data) === null || _res$data6 === void 0 ? void 0 : _res$data6.work_num,
|
|
permission: (res === null || res === void 0 || (_res$data7 = res.data) === null || _res$data7 === void 0 ? void 0 : _res$data7.permission) == 2 ? ['0', '1'] : (res === null || res === void 0 || (_res$data8 = res.data) === null || _res$data8 === void 0 ? void 0 : _res$data8.permission) == 0 ? ['0'] : ['1'],
|
|
reservation_type: res === null || res === void 0 || (_res$data9 = res.data) === null || _res$data9 === void 0 ? void 0 : _res$data9.reservation_type,
|
|
image: res !== null && res !== void 0 && (_res$data10 = res.data) !== null && _res$data10 !== void 0 && _res$data10.image ? res === null || res === void 0 || (_res$data11 = res.data) === null || _res$data11 === void 0 ? void 0 : _res$data11.image : ''
|
|
});
|
|
var specify_users = res === null || res === void 0 || (_res$data12 = res.data) === null || _res$data12 === void 0 || (_res$data12 = _res$data12.specify_users) === null || _res$data12 === void 0 ? void 0 : _res$data12.map(function (item) {
|
|
return {
|
|
username: item === null || item === void 0 ? void 0 : item.name,
|
|
numid: item === null || item === void 0 ? void 0 : item.id
|
|
};
|
|
});
|
|
setSelectUsers(specify_users);
|
|
//赋值最开始的预约规则
|
|
setOldRule(res === null || res === void 0 || (_res$data13 = res.data) === null || _res$data13 === void 0 ? void 0 : _res$data13.permission);
|
|
setRoomStatus((res === null || res === void 0 || (_res$data14 = res.data) === null || _res$data14 === void 0 ? void 0 : _res$data14.status) == 0 ? true : false);
|
|
if (res !== null && res !== void 0 && (_res$data15 = res.data) !== null && _res$data15 !== void 0 && _res$data15.image) {
|
|
var _res$data16;
|
|
setRoomImg(env/* default */.Z.API_SERVER + '/' + (res === null || res === void 0 || (_res$data16 = res.data) === null || _res$data16 === void 0 ? void 0 : _res$data16.image));
|
|
}
|
|
setShowRules(res === null || res === void 0 || (_res$data17 = res.data) === null || _res$data17 === void 0 ? void 0 : _res$data17.reservation_type);
|
|
if ((res === null || res === void 0 || (_res$data18 = res.data) === null || _res$data18 === void 0 ? void 0 : _res$data18.reservation_type) == 2) {
|
|
var _res$data19, _res$data20, _res$data21;
|
|
myForm.setFieldValue('reservation_rule_id', res === null || res === void 0 || (_res$data19 = res.data) === null || _res$data19 === void 0 ? void 0 : _res$data19.reservation_rule_id);
|
|
setSelectRuleId([{
|
|
id: res === null || res === void 0 || (_res$data20 = res.data) === null || _res$data20 === void 0 ? void 0 : _res$data20.reservation_rule_id,
|
|
title: res === null || res === void 0 || (_res$data21 = res.data) === null || _res$data21 === void 0 ? void 0 : _res$data21.reservation_rule_title
|
|
}]);
|
|
}
|
|
});
|
|
} else {
|
|
myForm.setFieldValue('reservation_type', 1);
|
|
setShowRules(1);
|
|
}
|
|
//我的实验室下拉
|
|
(0,laboratory/* classroom_query */.GJ)({
|
|
page: 1,
|
|
limit: 10000,
|
|
keyword: ''
|
|
}).then(function (res) {
|
|
var _res$data22;
|
|
setLaboratoryLists(res === null || res === void 0 || (_res$data22 = res.data) === null || _res$data22 === void 0 ? void 0 : _res$data22.list);
|
|
});
|
|
//规则列表
|
|
(0,laboratory/* get_reservation_rules */._X)({
|
|
page: 1,
|
|
limit: 10000,
|
|
keyword: ''
|
|
}).then(function (res) {
|
|
if (res.status == 0) {
|
|
var _res$data23;
|
|
setSelectRuleList(res === null || res === void 0 || (_res$data23 = res.data) === null || _res$data23 === void 0 || (_res$data23 = _res$data23.list) === null || _res$data23 === void 0 ? void 0 : _res$data23.map(function (item) {
|
|
item.key = item === null || item === void 0 ? void 0 : item.id;
|
|
return item;
|
|
}));
|
|
}
|
|
});
|
|
dispatch({
|
|
type: 'globalSetting/headerFooterToggle',
|
|
payload: false
|
|
});
|
|
return function () {
|
|
dispatch({
|
|
type: 'globalSetting/headerFooterToggle',
|
|
payload: true
|
|
});
|
|
};
|
|
}, []);
|
|
var rowSelection = {
|
|
onChange: function onChange(selectedRowKeys, selectedRows) {
|
|
setSelectRule(selectedRows === null || selectedRows === void 0 ? void 0 : selectedRows.map(function (item) {
|
|
item.id = item === null || item === void 0 ? void 0 : item.key;
|
|
return item;
|
|
}));
|
|
}
|
|
};
|
|
var getRuleList = function getRuleList(box) {
|
|
var _user$userInfo;
|
|
(0,laboratory/* get_reservation_rules */._X)({
|
|
page: 1,
|
|
limit: 10000,
|
|
status: box == '0' ? '' : box,
|
|
user_id: box == '0' ? user === null || user === void 0 || (_user$userInfo = user.userInfo) === null || _user$userInfo === void 0 ? void 0 : _user$userInfo.user_id : ''
|
|
}).then(function (res) {
|
|
if (res.status == 0) {
|
|
var _res$data24;
|
|
setSelectRuleList(res === null || res === void 0 || (_res$data24 = res.data) === null || _res$data24 === void 0 || (_res$data24 = _res$data24.list) === null || _res$data24 === void 0 ? void 0 : _res$data24.map(function (item) {
|
|
item.key = item === null || item === void 0 ? void 0 : item.id;
|
|
return item;
|
|
}));
|
|
}
|
|
});
|
|
};
|
|
|
|
//规则弹窗
|
|
var _Form$useForm3 = es_form/* default */.Z.useForm(),
|
|
_Form$useForm4 = slicedToArray_default()(_Form$useForm3, 1),
|
|
ruleForm = _Form$useForm4[0];
|
|
var _useState21 = (0,_react_17_0_2_react.useState)(false),
|
|
_useState22 = slicedToArray_default()(_useState21, 2),
|
|
openAddRule = _useState22[0],
|
|
setOpenAddRule = _useState22[1]; //选择规则弹框
|
|
var _useState23 = (0,_react_17_0_2_react.useState)([]),
|
|
_useState24 = slicedToArray_default()(_useState23, 2),
|
|
customRulesList = _useState24[0],
|
|
setCustomRulesList = _useState24[1];
|
|
var _useState25 = (0,_react_17_0_2_react.useState)(''),
|
|
_useState26 = slicedToArray_default()(_useState25, 2),
|
|
centerId = _useState26[0],
|
|
setCenterId = _useState26[1];
|
|
var _useState27 = (0,_react_17_0_2_react.useState)(false),
|
|
_useState28 = slicedToArray_default()(_useState27, 2),
|
|
showCustomRules = _useState28[0],
|
|
setShowCustomRules = _useState28[1];
|
|
var _useState29 = (0,_react_17_0_2_react.useState)([]),
|
|
_useState30 = slicedToArray_default()(_useState29, 2),
|
|
newData = _useState30[0],
|
|
setNewDate = _useState30[1];
|
|
var _useState31 = (0,_react_17_0_2_react.useState)(''),
|
|
_useState32 = slicedToArray_default()(_useState31, 2),
|
|
refresh = _useState32[0],
|
|
setRefresh = _useState32[1];
|
|
var _useState33 = (0,_react_17_0_2_react.useState)(''),
|
|
_useState34 = slicedToArray_default()(_useState33, 2),
|
|
roomImg = _useState34[0],
|
|
setRoomImg = _useState34[1];
|
|
var initForm = function initForm() {
|
|
ruleForm.setFieldsValue({
|
|
title: '',
|
|
cycle: 'weekly',
|
|
rule: 'whole'
|
|
});
|
|
setShowCustomRules(false);
|
|
};
|
|
var setImgUrl = function setImgUrl(box) {
|
|
myForm.setFieldValue('image', box);
|
|
setRoomImg(box);
|
|
};
|
|
return /*#__PURE__*/(0,jsx_runtime.jsxs)("div", {
|
|
className: createRoommodules.wrap,
|
|
children: [/*#__PURE__*/(0,jsx_runtime.jsxs)("div", {
|
|
className: createRoommodules.back_style,
|
|
onClick: function onClick() {
|
|
_umi_production_exports.history.push('/laboratory/laboratoryRoom');
|
|
},
|
|
children: [/*#__PURE__*/(0,jsx_runtime.jsx)("i", {
|
|
className: "iconfont icon-fanhui2 font12 mr5"
|
|
}), "\u8FD4\u56DE"]
|
|
}), /*#__PURE__*/(0,jsx_runtime.jsxs)("div", {
|
|
className: createRoommodules.header,
|
|
children: [/*#__PURE__*/(0,jsx_runtime.jsxs)(es_form/* default */.Z, {
|
|
form: myForm,
|
|
className: createRoommodules.header_form,
|
|
labelCol: {
|
|
span: 3
|
|
},
|
|
wrapperCol: {
|
|
span: 21
|
|
},
|
|
children: [/*#__PURE__*/(0,jsx_runtime.jsx)(es_form/* default */.Z.Item, {
|
|
colon: false,
|
|
label: "\u6240\u5C5E\u5B9E\u9A8C\u5BA4",
|
|
name: "classroom_id",
|
|
rules: [{
|
|
required: true,
|
|
message: '请选择实验室'
|
|
}],
|
|
children: /*#__PURE__*/(0,jsx_runtime.jsx)(es_select["default"], {
|
|
size: "large",
|
|
children: laboratoryLists === null || laboratoryLists === void 0 ? void 0 : laboratoryLists.map(function (item, index) {
|
|
return /*#__PURE__*/(0,jsx_runtime.jsx)(es_select["default"].Option, {
|
|
value: item.id,
|
|
children: item.title
|
|
}, index);
|
|
})
|
|
})
|
|
}), /*#__PURE__*/(0,jsx_runtime.jsx)(es_form/* default */.Z.Item, {
|
|
colon: false,
|
|
label: "\u623F\u95F4\u540D\u79F0",
|
|
name: "title",
|
|
rules: [{
|
|
required: true,
|
|
message: '请输入房间名称'
|
|
}, {
|
|
max: 15,
|
|
message: "输入超限,请缩减字符数"
|
|
}],
|
|
children: /*#__PURE__*/(0,jsx_runtime.jsx)(input/* default */.Z, {
|
|
size: "large",
|
|
onChange: function onChange(e) {
|
|
var _e$target;
|
|
myForm.setFieldValue('title', e === null || e === void 0 || (_e$target = e.target) === null || _e$target === void 0 || (_e$target = _e$target.value) === null || _e$target === void 0 ? void 0 : _e$target.trim());
|
|
}
|
|
})
|
|
}), /*#__PURE__*/(0,jsx_runtime.jsx)(es_form/* default */.Z.Item, {
|
|
colon: false,
|
|
label: "\u53EF\u4F7F\u7528\u4EBA\u6570",
|
|
name: "work_num",
|
|
rules: [{
|
|
required: true,
|
|
message: '请输入可使用人数'
|
|
}, {
|
|
required: true,
|
|
pattern: /^(0|[1-9]\d*)$/,
|
|
message: '请输入正整数'
|
|
}],
|
|
children: /*#__PURE__*/(0,jsx_runtime.jsx)(input/* default */.Z, {
|
|
size: "large",
|
|
maxLength: 5,
|
|
showCount: true
|
|
})
|
|
}), /*#__PURE__*/(0,jsx_runtime.jsx)(es_form/* default */.Z.Item, {
|
|
colon: false,
|
|
label: "\u4F7F\u7528\u9762\u79EF",
|
|
name: "area",
|
|
rules: [{
|
|
required: true,
|
|
message: '请输入使用面积'
|
|
}, {
|
|
required: true,
|
|
pattern: /^[1-9]\d*(\.\d+)?$/,
|
|
message: '请输入正数'
|
|
}],
|
|
children: /*#__PURE__*/(0,jsx_runtime.jsx)(input/* default */.Z, {
|
|
suffix: "\u5E73\u65B9\u7C73",
|
|
size: "large"
|
|
})
|
|
}), /*#__PURE__*/(0,jsx_runtime.jsx)(es_form/* default */.Z.Item, {
|
|
colon: false,
|
|
label: "\u9884\u7EA6\u6743\u9650",
|
|
name: "permission",
|
|
rules: [{
|
|
required: true,
|
|
message: '请选择预约权限'
|
|
}],
|
|
children: /*#__PURE__*/(0,jsx_runtime.jsx)(es_checkbox/* default */.Z.Group, {
|
|
style: {
|
|
marginTop: '10px'
|
|
},
|
|
options: [{
|
|
label: '学员',
|
|
value: '0'
|
|
}, {
|
|
label: '教员(已认证)',
|
|
value: '1'
|
|
}],
|
|
defaultValue: ['0']
|
|
})
|
|
}), /*#__PURE__*/(0,jsx_runtime.jsx)(es_form/* default */.Z.Item, {
|
|
colon: false,
|
|
label: "\u9884\u7EA6\u8BBE\u7F6E",
|
|
name: "reservation_type",
|
|
rules: [{
|
|
required: true,
|
|
message: '请选择预约设置'
|
|
}],
|
|
children: /*#__PURE__*/(0,jsx_runtime.jsxs)(es_radio/* default.Group */.ZP.Group, {
|
|
style: {
|
|
marginTop: '10px'
|
|
},
|
|
onChange: function onChange(e) {
|
|
var _e$target2;
|
|
setShowRules(e === null || e === void 0 || (_e$target2 = e.target) === null || _e$target2 === void 0 ? void 0 : _e$target2.value);
|
|
setSelectRuleId([]);
|
|
myForm.setFieldValue('reservation_rule_id', '');
|
|
},
|
|
children: [/*#__PURE__*/(0,jsx_runtime.jsx)(es_radio/* default */.ZP, {
|
|
value: 1,
|
|
children: "\u5168\u5929\u5F00\u653E"
|
|
}), /*#__PURE__*/(0,jsx_runtime.jsx)(es_radio/* default */.ZP, {
|
|
value: 2,
|
|
children: "\u81EA\u5B9A\u4E49\u5F00\u653E"
|
|
})]
|
|
})
|
|
}), showRules == 2 && /*#__PURE__*/(0,jsx_runtime.jsx)(es_form/* default */.Z.Item, {
|
|
colon: false,
|
|
label: "\u89C4\u5219\u8BBE\u7F6E",
|
|
name: "reservation_rule_id",
|
|
rules: [{
|
|
required: true,
|
|
message: '请选择规则设置'
|
|
}],
|
|
children: /*#__PURE__*/(0,jsx_runtime.jsxs)("div", {
|
|
style: {
|
|
display: 'flex'
|
|
},
|
|
children: [/*#__PURE__*/(0,jsx_runtime.jsx)("div", {
|
|
className: createRoommodules.guize_select,
|
|
onClick: function onClick() {
|
|
//规则列表
|
|
getRuleList(statusRule);
|
|
setOpenRuleModal(true);
|
|
},
|
|
children: "\u9009\u62E9\u89C4\u5219"
|
|
}), (selectRuleId === null || selectRuleId === void 0 ? void 0 : selectRuleId.length) > 0 && /*#__PURE__*/(0,jsx_runtime.jsxs)(jsx_runtime.Fragment, {
|
|
children: [/*#__PURE__*/(0,jsx_runtime.jsx)("div", {
|
|
style: {
|
|
color: '#3061D0',
|
|
marginLeft: '20px',
|
|
lineHeight: '40px'
|
|
},
|
|
children: selectRuleId === null || selectRuleId === void 0 || (_selectRuleId$ = selectRuleId[0]) === null || _selectRuleId$ === void 0 ? void 0 : _selectRuleId$.title
|
|
}), /*#__PURE__*/(0,jsx_runtime.jsx)("i", {
|
|
className: "iconfont icon-shanchu6",
|
|
onClick: function onClick() {
|
|
setSelectRuleId([]);
|
|
myForm.setFieldValue('reservation_rule_id', '');
|
|
},
|
|
style: {
|
|
color: '#FF5555',
|
|
margin: '12px 20px 0px 10px',
|
|
cursor: 'pointer'
|
|
}
|
|
}), /*#__PURE__*/(0,jsx_runtime.jsx)("div", {
|
|
className: createRoommodules.guize_update,
|
|
onClick: function onClick() {
|
|
var _selectRuleId$2, _selectRuleId$3;
|
|
setCenterId(selectRuleId === null || selectRuleId === void 0 || (_selectRuleId$2 = selectRuleId[0]) === null || _selectRuleId$2 === void 0 ? void 0 : _selectRuleId$2.id);
|
|
(0,laboratory/* reservation_rules_info */.Cc)({
|
|
id: selectRuleId === null || selectRuleId === void 0 || (_selectRuleId$3 = selectRuleId[0]) === null || _selectRuleId$3 === void 0 ? void 0 : _selectRuleId$3.id
|
|
}).then(function (res) {
|
|
var _res$data25, _res$data26, _res$data27, _res$data28, _res$data29;
|
|
ruleForm.setFieldsValue({
|
|
title: res === null || res === void 0 || (_res$data25 = res.data) === null || _res$data25 === void 0 ? void 0 : _res$data25.title,
|
|
cycle: res === null || res === void 0 || (_res$data26 = res.data) === null || _res$data26 === void 0 ? void 0 : _res$data26.cycle,
|
|
rule: res === null || res === void 0 || (_res$data27 = res.data) === null || _res$data27 === void 0 ? void 0 : _res$data27.rule
|
|
});
|
|
(res === null || res === void 0 || (_res$data28 = res.data) === null || _res$data28 === void 0 ? void 0 : _res$data28.rule) == 'custom' ? setShowCustomRules(true) : setShowCustomRules(false);
|
|
var initialCustomRulesList = JSON.parse(JSON.stringify(testData/* default */.Z));
|
|
res === null || res === void 0 || (_res$data29 = res.data) === null || _res$data29 === void 0 || (_res$data29 = _res$data29.details) === null || _res$data29 === void 0 || _res$data29.map(function (item, index) {
|
|
initialCustomRulesList[Number(item === null || item === void 0 ? void 0 : item.week) - 1].reservation[Number(item === null || item === void 0 ? void 0 : item.section) - 1] = true;
|
|
});
|
|
setNewDate(initialCustomRulesList);
|
|
setRefresh(new Date());
|
|
});
|
|
setOpenAddRule(true);
|
|
},
|
|
children: "\u7F16\u8F91"
|
|
})]
|
|
})]
|
|
})
|
|
}), /*#__PURE__*/(0,jsx_runtime.jsxs)(es_form/* default */.Z.Item, {
|
|
colon: false,
|
|
label: "\u6307\u5B9A\u7528\u6237",
|
|
name: "",
|
|
children: [/*#__PURE__*/(0,jsx_runtime.jsx)("div", {
|
|
className: createRoommodules.guize_select,
|
|
onClick: function onClick() {
|
|
dispatch({
|
|
type: 'classroomList/setActionTabs',
|
|
payload: {
|
|
key: '添加指定用户'
|
|
}
|
|
});
|
|
},
|
|
children: "\u6DFB\u52A0\u7528\u6237"
|
|
}), /*#__PURE__*/(0,jsx_runtime.jsx)("div", {
|
|
style: {
|
|
display: 'flex'
|
|
},
|
|
children: (selectUsers === null || selectUsers === void 0 ? void 0 : selectUsers.length) > 0 && (selectUsers === null || selectUsers === void 0 ? void 0 : selectUsers.map(function (item, index) {
|
|
return /*#__PURE__*/(0,jsx_runtime.jsxs)("div", {
|
|
style: {
|
|
display: 'flex',
|
|
marginTop: 15
|
|
},
|
|
children: [/*#__PURE__*/(0,jsx_runtime.jsx)("div", {
|
|
style: {
|
|
color: '#3061D0',
|
|
marginRight: '20px',
|
|
lineHeight: '40px'
|
|
},
|
|
children: item.username
|
|
}), /*#__PURE__*/(0,jsx_runtime.jsx)("i", {
|
|
className: "iconfont icon-shanchu6",
|
|
onClick: function onClick() {
|
|
selectUsers.splice(index, 1);
|
|
setSelectRuleId(toConsumableArray_default()(selectUsers));
|
|
},
|
|
style: {
|
|
color: '#FF5555',
|
|
margin: '12px 20px 0px 0px',
|
|
cursor: 'pointer'
|
|
}
|
|
})]
|
|
}, item === null || item === void 0 ? void 0 : item.numid);
|
|
}))
|
|
})]
|
|
}), /*#__PURE__*/(0,jsx_runtime.jsxs)(es_form/* default */.Z.Item, {
|
|
colon: false,
|
|
label: "\u623F\u95F4\u56FE\u7247",
|
|
name: "image",
|
|
children: [/*#__PURE__*/(0,jsx_runtime.jsxs)("div", {
|
|
className: createRoommodules.shangchuan_button,
|
|
onClick: function onClick() {
|
|
dispatch({
|
|
type: 'account/setActionTabs',
|
|
payload: {
|
|
key: 'Account-UpdateAvatar'
|
|
}
|
|
});
|
|
},
|
|
children: [/*#__PURE__*/(0,jsx_runtime.jsx)("img", {
|
|
className: "aBtn_img",
|
|
src: uploadImg/* default */.Z,
|
|
style: {
|
|
marginTop: '-4px',
|
|
marginRight: '8px'
|
|
}
|
|
}), "\u4E0A\u4F20\u672C\u5730\u6587\u4EF6"]
|
|
}), /*#__PURE__*/(0,jsx_runtime.jsxs)("div", {
|
|
className: createRoommodules.shangchuan_img,
|
|
children: [/*#__PURE__*/(0,jsx_runtime.jsx)("img", {
|
|
src: roomImg ? roomImg : roomInitImg,
|
|
style: {
|
|
width: '300px',
|
|
height: "156px"
|
|
}
|
|
}), /*#__PURE__*/(0,jsx_runtime.jsx)("div", {
|
|
className: createRoommodules.shangchuan_close,
|
|
onClick: function onClick() {
|
|
setRoomImg('');
|
|
myForm.setFieldValue('image', '');
|
|
},
|
|
children: /*#__PURE__*/(0,jsx_runtime.jsx)("i", {
|
|
className: "iconfont icon-shanchu6"
|
|
})
|
|
})]
|
|
})]
|
|
}), /*#__PURE__*/(0,jsx_runtime.jsx)(es_form/* default */.Z.Item, {
|
|
colon: false,
|
|
label: "\u4F7F\u7528\u987B\u77E5",
|
|
name: "description",
|
|
children: /*#__PURE__*/(0,jsx_runtime.jsx)(TextArea/* default */.Z, {
|
|
rows: 5,
|
|
maxLength: 200
|
|
})
|
|
}), /*#__PURE__*/(0,jsx_runtime.jsx)(es_form/* default */.Z.Item, {
|
|
colon: false,
|
|
label: "\u9644\u4EF6",
|
|
name: "attachment_ids",
|
|
children: /*#__PURE__*/(0,jsx_runtime.jsx)(MultiUpload/* default */.Z, {})
|
|
})]
|
|
}), /*#__PURE__*/(0,jsx_runtime.jsxs)("div", {
|
|
style: {
|
|
display: 'flex',
|
|
marginTop: '40px'
|
|
},
|
|
children: [/*#__PURE__*/(0,jsx_runtime.jsx)("div", {
|
|
className: createRoommodules.close_button,
|
|
onClick: function onClick() {
|
|
_umi_production_exports.history.push("/laboratory/laboratoryRoom");
|
|
},
|
|
children: "\u53D6\u6D88"
|
|
}), /*#__PURE__*/(0,jsx_runtime.jsx)("div", {
|
|
className: createRoommodules.submit_button,
|
|
onClick: /*#__PURE__*/asyncToGenerator_default()( /*#__PURE__*/regeneratorRuntime_default()().mark(function _callee2() {
|
|
var _myForm$getFieldValue, _myForm$getFieldValue2, _myForm$getFieldValue6, _myForm$getFieldValue7, _myForm$getFieldValue8, _myForm$getFieldValue9, _myForm$getFieldValue10, _myForm$getFieldValue11;
|
|
return regeneratorRuntime_default()().wrap(function _callee2$(_context2) {
|
|
while (1) switch (_context2.prev = _context2.next) {
|
|
case 0:
|
|
_context2.next = 2;
|
|
return myForm.validateFields();
|
|
case 2:
|
|
if ((params === null || params === void 0 ? void 0 : params.roomId) != 'null') {
|
|
//编辑
|
|
if (roomStatus && (((_myForm$getFieldValue = myForm.getFieldValue('permission')) === null || _myForm$getFieldValue === void 0 ? void 0 : _myForm$getFieldValue.length) > 1 ? 2 : (_myForm$getFieldValue2 = myForm.getFieldValue('permission')) === null || _myForm$getFieldValue2 === void 0 ? void 0 : _myForm$getFieldValue2[0]) != oldRule) {
|
|
//已开启的房间 并且 改动了规则
|
|
modal/* default */.Z.confirm({
|
|
centered: true,
|
|
okText: '确定',
|
|
cancelText: '取消',
|
|
title: "确认修改预约权限",
|
|
content: "\u9884\u7EA6\u6743\u9650\u53D8\u66F4\u540E\uFF0C\u6CA1\u6709\u9884\u7EA6\u6743\u9650\u7684\u7528\u6237\u5C06\u65E0\u6CD5\u67E5\u770B\u6216\u9884\u7EA6\u8BE5\u5B9E\u9A8C\u5BA4\u623F\u95F4\uFF0C\u5DF2\u9884\u7EA6\u7684\u7528\u6237\u53EF\u4EE5\u6B63\u5E38\u4F7F\u7528\u3002",
|
|
onOk: function () {
|
|
var _onOk = asyncToGenerator_default()( /*#__PURE__*/regeneratorRuntime_default()().mark(function _callee() {
|
|
var _myForm$getFieldValue3, _myForm$getFieldValue4, _myForm$getFieldValue5;
|
|
return regeneratorRuntime_default()().wrap(function _callee$(_context) {
|
|
while (1) switch (_context.prev = _context.next) {
|
|
case 0:
|
|
(0,laboratory/* classroom_rooms_update */.sN)({
|
|
id: params === null || params === void 0 ? void 0 : params.roomId,
|
|
classroom_room: objectSpread2_default()(objectSpread2_default()({}, myForm.getFieldsValue()), {}, {
|
|
attachment_ids: (_myForm$getFieldValue3 = myForm.getFieldValue('attachment_ids')) === null || _myForm$getFieldValue3 === void 0 ? void 0 : _myForm$getFieldValue3.map(function (item) {
|
|
var _item$response;
|
|
return item === null || item === void 0 || (_item$response = item.response) === null || _item$response === void 0 ? void 0 : _item$response.id;
|
|
}),
|
|
specify_user_ids: selectUsers.map(function (item) {
|
|
return item === null || item === void 0 ? void 0 : item.numid;
|
|
}),
|
|
permission: ((_myForm$getFieldValue4 = myForm.getFieldValue('permission')) === null || _myForm$getFieldValue4 === void 0 ? void 0 : _myForm$getFieldValue4.length) > 1 ? 2 : (_myForm$getFieldValue5 = myForm.getFieldValue('permission')) === null || _myForm$getFieldValue5 === void 0 ? void 0 : _myForm$getFieldValue5[0]
|
|
})
|
|
}).then(function (res) {
|
|
if ((res === null || res === void 0 ? void 0 : res.status) == 0) {
|
|
message/* default */.ZP.success('编辑成功');
|
|
_umi_production_exports.history.push("/laboratory/laboratoryRoom");
|
|
}
|
|
});
|
|
case 1:
|
|
case "end":
|
|
return _context.stop();
|
|
}
|
|
}, _callee);
|
|
}));
|
|
function onOk() {
|
|
return _onOk.apply(this, arguments);
|
|
}
|
|
return onOk;
|
|
}()
|
|
});
|
|
} else {
|
|
(0,laboratory/* classroom_rooms_update */.sN)({
|
|
id: params === null || params === void 0 ? void 0 : params.roomId,
|
|
classroom_room: objectSpread2_default()(objectSpread2_default()({}, myForm.getFieldsValue()), {}, {
|
|
attachment_ids: (_myForm$getFieldValue6 = myForm.getFieldValue('attachment_ids')) === null || _myForm$getFieldValue6 === void 0 ? void 0 : _myForm$getFieldValue6.map(function (item) {
|
|
var _item$response2;
|
|
return item === null || item === void 0 || (_item$response2 = item.response) === null || _item$response2 === void 0 ? void 0 : _item$response2.id;
|
|
}),
|
|
specify_user_ids: selectUsers.map(function (item) {
|
|
return item === null || item === void 0 ? void 0 : item.numid;
|
|
}),
|
|
permission: ((_myForm$getFieldValue7 = myForm.getFieldValue('permission')) === null || _myForm$getFieldValue7 === void 0 ? void 0 : _myForm$getFieldValue7.length) > 1 ? 2 : (_myForm$getFieldValue8 = myForm.getFieldValue('permission')) === null || _myForm$getFieldValue8 === void 0 ? void 0 : _myForm$getFieldValue8[0]
|
|
})
|
|
}).then(function (res) {
|
|
if ((res === null || res === void 0 ? void 0 : res.status) == 0) {
|
|
message/* default */.ZP.success('编辑成功');
|
|
_umi_production_exports.history.push("/laboratory/laboratoryRoom");
|
|
}
|
|
});
|
|
}
|
|
} else {
|
|
(0,laboratory/* classroom_rooms_create */.MO)({
|
|
classroom_room: objectSpread2_default()(objectSpread2_default()({}, myForm.getFieldsValue()), {}, {
|
|
specify_user_ids: selectUsers.map(function (item) {
|
|
return item === null || item === void 0 ? void 0 : item.numid;
|
|
}),
|
|
attachment_ids: (_myForm$getFieldValue9 = myForm.getFieldValue('attachment_ids')) === null || _myForm$getFieldValue9 === void 0 ? void 0 : _myForm$getFieldValue9.map(function (item) {
|
|
var _item$response3;
|
|
return item === null || item === void 0 || (_item$response3 = item.response) === null || _item$response3 === void 0 ? void 0 : _item$response3.id;
|
|
}),
|
|
permission: ((_myForm$getFieldValue10 = myForm.getFieldValue('permission')) === null || _myForm$getFieldValue10 === void 0 ? void 0 : _myForm$getFieldValue10.length) > 1 ? 2 : (_myForm$getFieldValue11 = myForm.getFieldValue('permission')) === null || _myForm$getFieldValue11 === void 0 ? void 0 : _myForm$getFieldValue11[0]
|
|
})
|
|
}).then(function (res) {
|
|
if ((res === null || res === void 0 ? void 0 : res.status) == 0) {
|
|
message/* default */.ZP.success('新建成功');
|
|
_umi_production_exports.history.push("/laboratory/laboratoryRoom");
|
|
}
|
|
});
|
|
}
|
|
case 3:
|
|
case "end":
|
|
return _context2.stop();
|
|
}
|
|
}, _callee2);
|
|
})),
|
|
children: "\u63D0\u4EA4"
|
|
})]
|
|
})]
|
|
}), /*#__PURE__*/(0,jsx_runtime.jsx)(createRoom_UpdateAvatarModal, {
|
|
setImgUrl: setImgUrl,
|
|
visible: ((_account$actionTabs = account.actionTabs) === null || _account$actionTabs === void 0 ? void 0 : _account$actionTabs.key) === 'Account-UpdateAvatar',
|
|
onClose: function onClose() {
|
|
dispatch({
|
|
type: 'account/setActionTabs'
|
|
});
|
|
}
|
|
}), /*#__PURE__*/(0,jsx_runtime.jsxs)(modal/* default */.Z, {
|
|
maskClosable: false,
|
|
centered: true,
|
|
keyboard: false,
|
|
destroyOnClose: true,
|
|
className: createRoommodules.my_modal,
|
|
open: openRuleModal,
|
|
title: "\u9009\u62E9\u89C4\u5219",
|
|
width: "600px",
|
|
onOk: /*#__PURE__*/asyncToGenerator_default()( /*#__PURE__*/regeneratorRuntime_default()().mark(function _callee3() {
|
|
var _selectRule$;
|
|
return regeneratorRuntime_default()().wrap(function _callee3$(_context3) {
|
|
while (1) switch (_context3.prev = _context3.next) {
|
|
case 0:
|
|
setSelectRuleId(selectRule);
|
|
myForm.setFieldValue('reservation_rule_id', selectRule === null || selectRule === void 0 || (_selectRule$ = selectRule[0]) === null || _selectRule$ === void 0 ? void 0 : _selectRule$.id);
|
|
setOpenRuleModal(false);
|
|
case 3:
|
|
case "end":
|
|
return _context3.stop();
|
|
}
|
|
}, _callee3);
|
|
})),
|
|
onCancel: function onCancel() {
|
|
setOpenRuleModal(false);
|
|
},
|
|
children: [/*#__PURE__*/(0,jsx_runtime.jsxs)("div", {
|
|
style: {
|
|
position: 'relative'
|
|
},
|
|
children: [/*#__PURE__*/(0,jsx_runtime.jsx)(tabs/* default */.Z, {
|
|
defaultActiveKey: statusRule,
|
|
items: items,
|
|
onChange: function onChange(e) {
|
|
setStatusRule(e);
|
|
getRuleList(e);
|
|
}
|
|
}), /*#__PURE__*/(0,jsx_runtime.jsx)("div", {
|
|
className: createRoommodules.add_button,
|
|
onClick: function onClick() {
|
|
initForm();
|
|
setCenterId('');
|
|
setOpenAddRule(true);
|
|
},
|
|
children: "\u65B0\u589E\u9884\u7EA6\u89C4\u5219"
|
|
})]
|
|
}), /*#__PURE__*/(0,jsx_runtime.jsx)(table/* default */.Z, {
|
|
rowSelection: objectSpread2_default()({
|
|
type: 'radio'
|
|
}, rowSelection),
|
|
scroll: {
|
|
y: 300
|
|
},
|
|
pagination: false,
|
|
dataSource: selectRuleList,
|
|
columns: [{
|
|
title: '规则名称',
|
|
dataIndex: 'title',
|
|
ellipsis: true
|
|
}, {
|
|
title: '创建人',
|
|
dataIndex: 'user_name',
|
|
ellipsis: true
|
|
}]
|
|
})]
|
|
}), /*#__PURE__*/(0,jsx_runtime.jsxs)(modal/* default */.Z, {
|
|
maskClosable: false,
|
|
centered: true,
|
|
keyboard: false,
|
|
destroyOnClose: true,
|
|
className: createRoommodules.my_modal,
|
|
open: openAddRule,
|
|
title: "".concat(centerId ? '编辑' : '新建', "\u89C4\u5219"),
|
|
width: "900px",
|
|
onOk: /*#__PURE__*/asyncToGenerator_default()( /*#__PURE__*/regeneratorRuntime_default()().mark(function _callee6() {
|
|
var formInfo, details;
|
|
return regeneratorRuntime_default()().wrap(function _callee6$(_context6) {
|
|
while (1) switch (_context6.prev = _context6.next) {
|
|
case 0:
|
|
_context6.next = 2;
|
|
return ruleForm.validateFields();
|
|
case 2:
|
|
formInfo = ruleForm.getFieldsValue(); // 配置details数据格式
|
|
details = [];
|
|
customRulesList.forEach(function (item) {
|
|
item.reservation.forEach(function (item2, index2) {
|
|
if (item2) {
|
|
details.push({
|
|
"week": item.weekDay,
|
|
"section": index2 + 1
|
|
});
|
|
}
|
|
});
|
|
});
|
|
if (centerId) {
|
|
(0,laboratory/* add_reservation_rules_update */.CI)({
|
|
id: centerId,
|
|
reservation_rule: objectSpread2_default()(objectSpread2_default()({}, formInfo), {}, {
|
|
details: details
|
|
})
|
|
}).then(function (res) {
|
|
if (res.status == 0) {
|
|
myForm.setFieldValue('reservation_rule_id', centerId);
|
|
setSelectRuleId([{
|
|
id: centerId,
|
|
title: formInfo === null || formInfo === void 0 ? void 0 : formInfo.title
|
|
}]);
|
|
modal/* default */.Z.confirm({
|
|
centered: true,
|
|
okText: '确定',
|
|
cancelText: '取消',
|
|
title: "提示",
|
|
icon: null,
|
|
content: "\u662F\u5426\u9700\u8981\u5C06\u672C\u6B21\u4FEE\u6539\u7684\u89C4\u5219\u65B0\u589E\u5230\u6211\u7684\u89C4\u5219\u5E93\u4E2D\uFF1F",
|
|
onOk: function () {
|
|
var _onOk2 = asyncToGenerator_default()( /*#__PURE__*/regeneratorRuntime_default()().mark(function _callee4() {
|
|
return regeneratorRuntime_default()().wrap(function _callee4$(_context4) {
|
|
while (1) switch (_context4.prev = _context4.next) {
|
|
case 0:
|
|
(0,laboratory/* add_reservation_rules */.VL)({
|
|
reservation_rule: objectSpread2_default()(objectSpread2_default()({}, formInfo), {}, {
|
|
details: details
|
|
})
|
|
}).then(function (res) {
|
|
if (res.status == 0) {
|
|
message/* default */.ZP.success('编辑成功');
|
|
setOpenAddRule(false);
|
|
getRuleList(statusRule);
|
|
}
|
|
});
|
|
case 1:
|
|
case "end":
|
|
return _context4.stop();
|
|
}
|
|
}, _callee4);
|
|
}));
|
|
function onOk() {
|
|
return _onOk2.apply(this, arguments);
|
|
}
|
|
return onOk;
|
|
}(),
|
|
onCancel: function () {
|
|
var _onCancel = asyncToGenerator_default()( /*#__PURE__*/regeneratorRuntime_default()().mark(function _callee5() {
|
|
return regeneratorRuntime_default()().wrap(function _callee5$(_context5) {
|
|
while (1) switch (_context5.prev = _context5.next) {
|
|
case 0:
|
|
message/* default */.ZP.success('编辑成功');
|
|
setOpenAddRule(false);
|
|
getRuleList(statusRule);
|
|
case 3:
|
|
case "end":
|
|
return _context5.stop();
|
|
}
|
|
}, _callee5);
|
|
}));
|
|
function onCancel() {
|
|
return _onCancel.apply(this, arguments);
|
|
}
|
|
return onCancel;
|
|
}()
|
|
});
|
|
}
|
|
});
|
|
} else {
|
|
(0,laboratory/* add_reservation_rules */.VL)({
|
|
reservation_rule: objectSpread2_default()(objectSpread2_default()({}, formInfo), {}, {
|
|
details: details
|
|
})
|
|
}).then(function (res) {
|
|
if (res.status == 0) {
|
|
message/* default */.ZP.success("\u65B0\u5EFA\u6210\u529F");
|
|
setOpenAddRule(false);
|
|
getRuleList(statusRule);
|
|
}
|
|
});
|
|
}
|
|
case 6:
|
|
case "end":
|
|
return _context6.stop();
|
|
}
|
|
}, _callee6);
|
|
})),
|
|
onCancel: function onCancel() {
|
|
setOpenAddRule(false);
|
|
ruleForm === null || ruleForm === void 0 || ruleForm.resetFields();
|
|
},
|
|
children: [/*#__PURE__*/(0,jsx_runtime.jsxs)(es_form/* default */.Z, {
|
|
className: createRoommodules.formWrap,
|
|
form: ruleForm,
|
|
style: {
|
|
marginTop: '20px'
|
|
},
|
|
children: [/*#__PURE__*/(0,jsx_runtime.jsx)(es_form/* default */.Z.Item, {
|
|
label: "\u89C4\u5219\u540D\u79F0",
|
|
name: "title",
|
|
rules: [{
|
|
required: true,
|
|
message: '请输入规则名称'
|
|
}],
|
|
children: /*#__PURE__*/(0,jsx_runtime.jsx)(input/* default */.Z, {
|
|
onChange: function onChange(e) {
|
|
var _e$target3;
|
|
ruleForm.setFieldValue('title', e === null || e === void 0 || (_e$target3 = e.target) === null || _e$target3 === void 0 || (_e$target3 = _e$target3.value) === null || _e$target3 === void 0 ? void 0 : _e$target3.trim());
|
|
}
|
|
})
|
|
}), /*#__PURE__*/(0,jsx_runtime.jsx)(es_form/* default */.Z.Item, {
|
|
name: "cycle",
|
|
label: "\u5FAA\u73AF\u5468\u671F",
|
|
rules: [{
|
|
required: true,
|
|
message: '请选择循环周期'
|
|
}],
|
|
children: /*#__PURE__*/(0,jsx_runtime.jsxs)(es_radio/* default.Group */.ZP.Group, {
|
|
children: [/*#__PURE__*/(0,jsx_runtime.jsx)(es_radio/* default */.ZP, {
|
|
value: 'weekly',
|
|
children: "\u6BCF\u5468"
|
|
}), /*#__PURE__*/(0,jsx_runtime.jsx)(es_radio/* default */.ZP, {
|
|
value: 'single_week',
|
|
children: "\u5355\u5468"
|
|
}), /*#__PURE__*/(0,jsx_runtime.jsx)(es_radio/* default */.ZP, {
|
|
value: 'double_week',
|
|
children: "\u53CC\u5468"
|
|
})]
|
|
})
|
|
}), /*#__PURE__*/(0,jsx_runtime.jsx)(es_form/* default */.Z.Item, {
|
|
name: "rule",
|
|
label: "\u9884\u7EA6\u8BBE\u7F6E",
|
|
rules: [{
|
|
required: true,
|
|
message: '请选择预约设置'
|
|
}],
|
|
children: /*#__PURE__*/(0,jsx_runtime.jsxs)(es_radio/* default.Group */.ZP.Group, {
|
|
onChange: function onChange(e) {
|
|
setShowCustomRules(e.target.value == 'custom' ? true : false);
|
|
},
|
|
children: [/*#__PURE__*/(0,jsx_runtime.jsx)(es_radio/* default */.ZP, {
|
|
value: 'whole',
|
|
children: "\u5168\u5929\u5F00\u653E"
|
|
}), /*#__PURE__*/(0,jsx_runtime.jsx)(es_radio/* default */.ZP, {
|
|
value: 'custom',
|
|
children: "\u81EA\u5B9A\u4E49\u5F00\u653E"
|
|
})]
|
|
})
|
|
})]
|
|
}), showCustomRules && /*#__PURE__*/(0,jsx_runtime.jsx)(CustomRules/* default */.Z, {
|
|
updateList: centerId ? newData : null,
|
|
handleCustomRulesChange: function handleCustomRulesChange(values) {
|
|
setCustomRulesList(values);
|
|
}
|
|
}, refresh)]
|
|
}), /*#__PURE__*/(0,jsx_runtime.jsx)(AddAssistant/* default */.Z, {
|
|
onSubmit: function onSubmit(e) {
|
|
setSelectUsers(e);
|
|
dispatch({
|
|
type: 'classroomList/setActionTabs',
|
|
payload: {
|
|
key: ''
|
|
}
|
|
});
|
|
}
|
|
})]
|
|
});
|
|
};
|
|
/* harmony default export */ var createRoom = ((0,_umi_production_exports.connect)(function (_ref5) {
|
|
var loading = _ref5.loading,
|
|
user = _ref5.user,
|
|
engineeringNavigtion = _ref5.engineeringNavigtion,
|
|
dispatch = _ref5.dispatch,
|
|
account = _ref5.account,
|
|
classroomList = _ref5.classroomList;
|
|
return objectSpread2_default()(objectSpread2_default()({
|
|
loading: loading,
|
|
user: user
|
|
}, engineeringNavigtion), {}, {
|
|
dispatch: dispatch,
|
|
account: account,
|
|
classroomList: classroomList
|
|
});
|
|
})(Navigation));
|
|
|
|
/***/ }),
|
|
|
|
/***/ 99439:
|
|
/*!**************************************************************************************!*\
|
|
!*** ./src/pages/Laboratory/RuleManage/components/CustomRules/index.tsx + 1 modules ***!
|
|
\**************************************************************************************/
|
|
/***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) {
|
|
|
|
"use strict";
|
|
|
|
// EXPORTS
|
|
__webpack_require__.d(__webpack_exports__, {
|
|
Z: function() { return /* binding */ components_CustomRules; }
|
|
});
|
|
|
|
// EXTERNAL MODULE: ./node_modules/_@babel_runtime@7.23.6@@babel/runtime/helpers/toConsumableArray.js
|
|
var toConsumableArray = __webpack_require__(37205);
|
|
var toConsumableArray_default = /*#__PURE__*/__webpack_require__.n(toConsumableArray);
|
|
// 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/_react@17.0.2@react/index.js
|
|
var _react_17_0_2_react = __webpack_require__(59301);
|
|
;// CONCATENATED MODULE: ./src/pages/Laboratory/RuleManage/components/CustomRules/index.less?modules
|
|
// extracted by mini-css-extract-plugin
|
|
/* harmony default export */ var CustomRulesmodules = ({"weekDay":"weekDay___onEh4","weekDay1":"weekDay1___WZ6Yt","weekDay2":"weekDay2___Ut93V","timeSlotWarp":"timeSlotWarp___yAtp8","timeSlot":"timeSlot___mTtgk","timeSlotItem":"timeSlotItem___QDnMC","timeSlotItem2":"timeSlotItem2___Htzy2","checked":"checked___mNl4N","unchecked":"unchecked___kMlEe"});
|
|
// EXTERNAL MODULE: ./src/pages/Laboratory/RuleManage/components/CustomRules/testData.ts
|
|
var testData = __webpack_require__(6529);
|
|
// EXTERNAL MODULE: ./node_modules/_react@17.0.2@react/jsx-runtime.js
|
|
var jsx_runtime = __webpack_require__(37712);
|
|
;// CONCATENATED MODULE: ./src/pages/Laboratory/RuleManage/components/CustomRules/index.tsx
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
var CustomRules = function CustomRules(_ref) {
|
|
var handleCustomRulesChange = _ref.handleCustomRulesChange,
|
|
_ref$updateList = _ref.updateList,
|
|
updateList = _ref$updateList === void 0 ? null : _ref$updateList,
|
|
isType = _ref.isType;
|
|
var _useState = (0,_react_17_0_2_react.useState)([]),
|
|
_useState2 = slicedToArray_default()(_useState, 2),
|
|
customRulesList = _useState2[0],
|
|
setCustomRulesList = _useState2[1];
|
|
|
|
// const times = [
|
|
// '0:00-0:50', '1:00-1:50', '2:00-2:50', '3:00-3:50', '4:00-4:50', '5:00-5:50', '6:00-6:50', '7:00-7:50', '8:00-8:50', '9:00-9:50',
|
|
// '10:00-10:50', '11:00-11:50', '12:00-12:50', '13:00-13:50', '14:00-14:50', '15:00-15:50', '16:00-16:50', '17:00-17:50', '18:00-18:50', '19:00-19:50',
|
|
// '20:00-20:50', '21:00-21:50', '22:00-22:50', '23:00-23:50'
|
|
// ]
|
|
var times = ['8:00-9:00', '9:00-10:00', '10:10-11:00', '11:00-12:00', '14:00-15:00', '15:00-16:00', '16:00-17:00', '19:00-20:00', '20:00-21:00'];
|
|
(0,_react_17_0_2_react.useEffect)(function () {
|
|
if (updateList && (updateList === null || updateList === void 0 ? void 0 : updateList.length) > 0) {
|
|
setCustomRulesList(updateList);
|
|
handleCustomRulesChange(updateList);
|
|
} else {
|
|
var initialCustomRulesList = JSON.parse(JSON.stringify(testData/* default */.Z));
|
|
setCustomRulesList(initialCustomRulesList);
|
|
handleCustomRulesChange(initialCustomRulesList);
|
|
}
|
|
}, []);
|
|
return /*#__PURE__*/(0,jsx_runtime.jsxs)("div", {
|
|
children: [/*#__PURE__*/(0,jsx_runtime.jsxs)("div", {
|
|
className: CustomRulesmodules.weekDay,
|
|
children: [/*#__PURE__*/(0,jsx_runtime.jsx)("div", {
|
|
className: CustomRulesmodules.weekDay1
|
|
}), ['星期一', '星期二', '星期三', '星期四', '星期五', '星期六', '星期日'].map(function (item, index) {
|
|
return /*#__PURE__*/(0,jsx_runtime.jsx)("div", {
|
|
className: CustomRulesmodules.weekDay2,
|
|
children: item
|
|
}, index);
|
|
})]
|
|
}), /*#__PURE__*/(0,jsx_runtime.jsxs)("div", {
|
|
className: CustomRulesmodules.timeSlotWarp,
|
|
children: [/*#__PURE__*/(0,jsx_runtime.jsx)("div", {
|
|
className: CustomRulesmodules.timeSlot,
|
|
children: times.map(function (item, index) {
|
|
return /*#__PURE__*/(0,jsx_runtime.jsx)("div", {
|
|
className: CustomRulesmodules.timeSlotItem,
|
|
children: /*#__PURE__*/(0,jsx_runtime.jsxs)("div", {
|
|
children: ["\u7B2C", index + 1, "\u8282\uFF08", item, "\uFF09"]
|
|
})
|
|
}, index);
|
|
})
|
|
}), customRulesList.map(function (item, index) {
|
|
return /*#__PURE__*/(0,jsx_runtime.jsx)("div", {
|
|
children: item === null || item === void 0 ? void 0 : item.reservation.map(function (item2, index2) {
|
|
return /*#__PURE__*/(0,jsx_runtime.jsx)("div", {
|
|
className: "".concat(CustomRulesmodules.timeSlotItem2, " ").concat(item2 ? CustomRulesmodules.checked : CustomRulesmodules.unchecked),
|
|
onClick: function onClick() {
|
|
if (isType != '查看') {
|
|
setCustomRulesList(function (val) {
|
|
var newList = toConsumableArray_default()(val);
|
|
newList[index].reservation = toConsumableArray_default()(val[index].reservation);
|
|
newList[index].reservation[index2] = !item2;
|
|
return newList;
|
|
});
|
|
}
|
|
},
|
|
children: /*#__PURE__*/(0,jsx_runtime.jsx)("div", {
|
|
className: CustomRulesmodules.customCheckbox
|
|
})
|
|
}, "".concat(item.weekDay, "_").concat(index2));
|
|
})
|
|
}, item === null || item === void 0 ? void 0 : item.weekDay);
|
|
})]
|
|
})]
|
|
});
|
|
};
|
|
/* harmony default export */ var components_CustomRules = (CustomRules);
|
|
|
|
/***/ }),
|
|
|
|
/***/ 6529:
|
|
/*!****************************************************************************!*\
|
|
!*** ./src/pages/Laboratory/RuleManage/components/CustomRules/testData.ts ***!
|
|
\****************************************************************************/
|
|
/***/ (function(__unused_webpack_module, __webpack_exports__) {
|
|
|
|
"use strict";
|
|
// 预约规则表
|
|
var customList = [{
|
|
weekDay: 1,
|
|
// 周几
|
|
reservation: [
|
|
// 预约情况 22节
|
|
false, false, false, false, false, false, false, false, false
|
|
// false, false, false,
|
|
// false, false, false, false, false, false, false, false, false, false, false, false,
|
|
]
|
|
}, {
|
|
weekDay: 2,
|
|
// 周几
|
|
reservation: [
|
|
// 预约情况
|
|
false, false, false, false, false, false, false, false, false
|
|
// false, false, false,
|
|
// false, false, false, false, false, false, false, false, false, false, false, false,
|
|
]
|
|
}, {
|
|
weekDay: 3,
|
|
// 周几
|
|
reservation: [
|
|
// 预约情况
|
|
false, false, false, false, false, false, false, false, false
|
|
// false, false, false,
|
|
// false, false, false, false, false, false, false, false, false, false, false, false,
|
|
]
|
|
}, {
|
|
weekDay: 4,
|
|
// 周几
|
|
reservation: [
|
|
// 预约情况
|
|
false, false, false, false, false, false, false, false, false
|
|
// false, false, false,
|
|
// false, false, false, false, false, false, false, false, false, false, false, false,
|
|
]
|
|
}, {
|
|
weekDay: 5,
|
|
// 周几
|
|
reservation: [
|
|
// 预约情况
|
|
false, false, false, false, false, false, false, false, false
|
|
// false, false, false,
|
|
// false, false, false, false, false, false, false, false, false, false, false, false,
|
|
]
|
|
}, {
|
|
weekDay: 6,
|
|
// 周几
|
|
reservation: [
|
|
// 预约情况
|
|
false, false, false, false, false, false, false, false, false
|
|
// false, false, false,
|
|
// false, false, false, false, false, false, false, false, false, false, false, false,
|
|
]
|
|
}, {
|
|
weekDay: 7,
|
|
// 周几
|
|
reservation: [
|
|
// 预约情况
|
|
false, false, false, false, false, false, false, false, false
|
|
// false, false, false,
|
|
// false, false, false, false, false, false, false, false, false, false, false, false,
|
|
]
|
|
}];
|
|
/* harmony default export */ __webpack_exports__.Z = (customList);
|
|
|
|
/***/ }),
|
|
|
|
/***/ 88522:
|
|
/*!*****************************************************************!*\
|
|
!*** ./node_modules/_antd@5.9.0@antd/es/auto-complete/index.js ***!
|
|
\*****************************************************************/
|
|
/***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) {
|
|
|
|
"use strict";
|
|
/* harmony import */ var classnames__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! classnames */ 92310);
|
|
/* harmony import */ var classnames__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(classnames__WEBPACK_IMPORTED_MODULE_0__);
|
|
/* harmony import */ var rc_util_es_Children_toArray__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! rc-util/es/Children/toArray */ 38298);
|
|
/* harmony import */ var rc_util_es_omit__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! rc-util/es/omit */ 64002);
|
|
/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! react */ 59301);
|
|
/* harmony import */ var _util_PurePanel__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ../_util/PurePanel */ 53487);
|
|
/* harmony import */ var _util_reactNode__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ../_util/reactNode */ 92343);
|
|
/* harmony import */ var _config_provider__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ../config-provider */ 36355);
|
|
/* harmony import */ var _select__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../select */ 57809);
|
|
"use client";
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
const {
|
|
Option
|
|
} = _select__WEBPACK_IMPORTED_MODULE_3__["default"];
|
|
function isSelectOptionOrSelectOptGroup(child) {
|
|
return child && child.type && (child.type.isSelectOption || child.type.isSelectOptGroup);
|
|
}
|
|
const AutoComplete = (props, ref) => {
|
|
const {
|
|
prefixCls: customizePrefixCls,
|
|
className,
|
|
popupClassName,
|
|
dropdownClassName,
|
|
children,
|
|
dataSource
|
|
} = props;
|
|
const childNodes = (0,rc_util_es_Children_toArray__WEBPACK_IMPORTED_MODULE_1__/* ["default"] */ .Z)(children);
|
|
// ============================= Input =============================
|
|
let customizeInput;
|
|
if (childNodes.length === 1 && (0,_util_reactNode__WEBPACK_IMPORTED_MODULE_4__/* .isValidElement */ .l$)(childNodes[0]) && !isSelectOptionOrSelectOptGroup(childNodes[0])) {
|
|
[customizeInput] = childNodes;
|
|
}
|
|
const getInputElement = customizeInput ? () => customizeInput : undefined;
|
|
// ============================ Options ============================
|
|
let optionChildren;
|
|
// [Legacy] convert `children` or `dataSource` into option children
|
|
if (childNodes.length && isSelectOptionOrSelectOptGroup(childNodes[0])) {
|
|
optionChildren = children;
|
|
} else {
|
|
optionChildren = dataSource ? dataSource.map(item => {
|
|
if ((0,_util_reactNode__WEBPACK_IMPORTED_MODULE_4__/* .isValidElement */ .l$)(item)) {
|
|
return item;
|
|
}
|
|
switch (typeof item) {
|
|
case 'string':
|
|
return /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_2__.createElement(Option, {
|
|
key: item,
|
|
value: item
|
|
}, item);
|
|
case 'object':
|
|
{
|
|
const {
|
|
value: optionValue
|
|
} = item;
|
|
return /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_2__.createElement(Option, {
|
|
key: optionValue,
|
|
value: optionValue
|
|
}, item.text);
|
|
}
|
|
default:
|
|
false ? 0 : void 0;
|
|
return undefined;
|
|
}
|
|
}) : [];
|
|
}
|
|
if (false) {}
|
|
const {
|
|
getPrefixCls
|
|
} = react__WEBPACK_IMPORTED_MODULE_2__.useContext(_config_provider__WEBPACK_IMPORTED_MODULE_5__/* .ConfigContext */ .E_);
|
|
const prefixCls = getPrefixCls('select', customizePrefixCls);
|
|
return /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_2__.createElement(_select__WEBPACK_IMPORTED_MODULE_3__["default"], Object.assign({
|
|
ref: ref,
|
|
suffixIcon: null
|
|
}, (0,rc_util_es_omit__WEBPACK_IMPORTED_MODULE_6__/* ["default"] */ .Z)(props, ['dataSource', 'dropdownClassName']), {
|
|
prefixCls: prefixCls,
|
|
popupClassName: popupClassName || dropdownClassName,
|
|
className: classnames__WEBPACK_IMPORTED_MODULE_0___default()(`${prefixCls}-auto-complete`, className),
|
|
mode: _select__WEBPACK_IMPORTED_MODULE_3__["default"].SECRET_COMBOBOX_MODE_DO_NOT_USE
|
|
}, {
|
|
// Internal api
|
|
getInputElement
|
|
}), optionChildren);
|
|
};
|
|
const RefAutoComplete = /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_2__.forwardRef(AutoComplete);
|
|
// We don't care debug panel
|
|
/* istanbul ignore next */
|
|
const PurePanel = (0,_util_PurePanel__WEBPACK_IMPORTED_MODULE_7__/* ["default"] */ .Z)(RefAutoComplete);
|
|
RefAutoComplete.Option = Option;
|
|
RefAutoComplete._InternalPanelDoNotUseOrYouWillBeFired = PurePanel;
|
|
if (false) {}
|
|
/* harmony default export */ __webpack_exports__.Z = (RefAutoComplete);
|
|
|
|
/***/ }),
|
|
|
|
/***/ 60028:
|
|
/*!**********************************************************!*\
|
|
!*** ./node_modules/_antd@5.9.0@antd/es/upload/index.js ***!
|
|
\**********************************************************/
|
|
/***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) {
|
|
|
|
"use strict";
|
|
/* harmony import */ var _Dragger__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./Dragger */ 71409);
|
|
/* harmony import */ var _Upload__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./Upload */ 41945);
|
|
"use client";
|
|
|
|
|
|
|
|
const Upload = _Upload__WEBPACK_IMPORTED_MODULE_0__/* ["default"] */ .Z;
|
|
Upload.Dragger = _Dragger__WEBPACK_IMPORTED_MODULE_1__/* ["default"] */ .Z;
|
|
Upload.LIST_IGNORE = _Upload__WEBPACK_IMPORTED_MODULE_0__/* .LIST_IGNORE */ .E;
|
|
/* harmony default export */ __webpack_exports__.Z = (Upload);
|
|
|
|
/***/ }),
|
|
|
|
/***/ 51581:
|
|
/*!****************************************************************************************************!*\
|
|
!*** ./node_modules/_react-infinite-scroller@1.2.4@react-infinite-scroller/dist/InfiniteScroll.js ***!
|
|
\****************************************************************************************************/
|
|
/***/ (function(module, exports, __webpack_require__) {
|
|
|
|
"use strict";
|
|
|
|
|
|
Object.defineProperty(exports, "__esModule", ({
|
|
value: true
|
|
}));
|
|
|
|
var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();
|
|
|
|
var _react = __webpack_require__(/*! react */ 59301);
|
|
|
|
var _react2 = _interopRequireDefault(_react);
|
|
|
|
var _propTypes = __webpack_require__(/*! prop-types */ 12708);
|
|
|
|
var _propTypes2 = _interopRequireDefault(_propTypes);
|
|
|
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
|
|
function _objectWithoutProperties(obj, keys) { var target = {}; for (var i in obj) { if (keys.indexOf(i) >= 0) continue; if (!Object.prototype.hasOwnProperty.call(obj, i)) continue; target[i] = obj[i]; } return target; }
|
|
|
|
function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
|
|
|
|
function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; }
|
|
|
|
function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; }
|
|
|
|
var InfiniteScroll = function (_Component) {
|
|
_inherits(InfiniteScroll, _Component);
|
|
|
|
function InfiniteScroll(props) {
|
|
_classCallCheck(this, InfiniteScroll);
|
|
|
|
var _this = _possibleConstructorReturn(this, (InfiniteScroll.__proto__ || Object.getPrototypeOf(InfiniteScroll)).call(this, props));
|
|
|
|
_this.scrollListener = _this.scrollListener.bind(_this);
|
|
_this.eventListenerOptions = _this.eventListenerOptions.bind(_this);
|
|
_this.mousewheelListener = _this.mousewheelListener.bind(_this);
|
|
return _this;
|
|
}
|
|
|
|
_createClass(InfiniteScroll, [{
|
|
key: 'componentDidMount',
|
|
value: function componentDidMount() {
|
|
this.pageLoaded = this.props.pageStart;
|
|
this.options = this.eventListenerOptions();
|
|
this.attachScrollListener();
|
|
}
|
|
}, {
|
|
key: 'componentDidUpdate',
|
|
value: function componentDidUpdate() {
|
|
if (this.props.isReverse && this.loadMore) {
|
|
var parentElement = this.getParentElement(this.scrollComponent);
|
|
parentElement.scrollTop = parentElement.scrollHeight - this.beforeScrollHeight + this.beforeScrollTop;
|
|
this.loadMore = false;
|
|
}
|
|
this.attachScrollListener();
|
|
}
|
|
}, {
|
|
key: 'componentWillUnmount',
|
|
value: function componentWillUnmount() {
|
|
this.detachScrollListener();
|
|
this.detachMousewheelListener();
|
|
}
|
|
}, {
|
|
key: 'isPassiveSupported',
|
|
value: function isPassiveSupported() {
|
|
var passive = false;
|
|
|
|
var testOptions = {
|
|
get passive() {
|
|
passive = true;
|
|
}
|
|
};
|
|
|
|
try {
|
|
document.addEventListener('test', null, testOptions);
|
|
document.removeEventListener('test', null, testOptions);
|
|
} catch (e) {
|
|
// ignore
|
|
}
|
|
return passive;
|
|
}
|
|
}, {
|
|
key: 'eventListenerOptions',
|
|
value: function eventListenerOptions() {
|
|
var options = this.props.useCapture;
|
|
|
|
if (this.isPassiveSupported()) {
|
|
options = {
|
|
useCapture: this.props.useCapture,
|
|
passive: true
|
|
};
|
|
}
|
|
return options;
|
|
}
|
|
|
|
// Set a defaut loader for all your `InfiniteScroll` components
|
|
|
|
}, {
|
|
key: 'setDefaultLoader',
|
|
value: function setDefaultLoader(loader) {
|
|
this.defaultLoader = loader;
|
|
}
|
|
}, {
|
|
key: 'detachMousewheelListener',
|
|
value: function detachMousewheelListener() {
|
|
var scrollEl = window;
|
|
if (this.props.useWindow === false) {
|
|
scrollEl = this.scrollComponent.parentNode;
|
|
}
|
|
|
|
scrollEl.removeEventListener('mousewheel', this.mousewheelListener, this.options ? this.options : this.props.useCapture);
|
|
}
|
|
}, {
|
|
key: 'detachScrollListener',
|
|
value: function detachScrollListener() {
|
|
var scrollEl = window;
|
|
if (this.props.useWindow === false) {
|
|
scrollEl = this.getParentElement(this.scrollComponent);
|
|
}
|
|
|
|
scrollEl.removeEventListener('scroll', this.scrollListener, this.options ? this.options : this.props.useCapture);
|
|
scrollEl.removeEventListener('resize', this.scrollListener, this.options ? this.options : this.props.useCapture);
|
|
}
|
|
}, {
|
|
key: 'getParentElement',
|
|
value: function getParentElement(el) {
|
|
var scrollParent = this.props.getScrollParent && this.props.getScrollParent();
|
|
if (scrollParent != null) {
|
|
return scrollParent;
|
|
}
|
|
return el && el.parentNode;
|
|
}
|
|
}, {
|
|
key: 'filterProps',
|
|
value: function filterProps(props) {
|
|
return props;
|
|
}
|
|
}, {
|
|
key: 'attachScrollListener',
|
|
value: function attachScrollListener() {
|
|
var parentElement = this.getParentElement(this.scrollComponent);
|
|
|
|
if (!this.props.hasMore || !parentElement) {
|
|
return;
|
|
}
|
|
|
|
var scrollEl = window;
|
|
if (this.props.useWindow === false) {
|
|
scrollEl = parentElement;
|
|
}
|
|
|
|
scrollEl.addEventListener('mousewheel', this.mousewheelListener, this.options ? this.options : this.props.useCapture);
|
|
scrollEl.addEventListener('scroll', this.scrollListener, this.options ? this.options : this.props.useCapture);
|
|
scrollEl.addEventListener('resize', this.scrollListener, this.options ? this.options : this.props.useCapture);
|
|
|
|
if (this.props.initialLoad) {
|
|
this.scrollListener();
|
|
}
|
|
}
|
|
}, {
|
|
key: 'mousewheelListener',
|
|
value: function mousewheelListener(e) {
|
|
// Prevents Chrome hangups
|
|
// See: https://stackoverflow.com/questions/47524205/random-high-content-download-time-in-chrome/47684257#47684257
|
|
if (e.deltaY === 1 && !this.isPassiveSupported()) {
|
|
e.preventDefault();
|
|
}
|
|
}
|
|
}, {
|
|
key: 'scrollListener',
|
|
value: function scrollListener() {
|
|
var el = this.scrollComponent;
|
|
var scrollEl = window;
|
|
var parentNode = this.getParentElement(el);
|
|
|
|
var offset = void 0;
|
|
if (this.props.useWindow) {
|
|
var doc = document.documentElement || document.body.parentNode || document.body;
|
|
var scrollTop = scrollEl.pageYOffset !== undefined ? scrollEl.pageYOffset : doc.scrollTop;
|
|
if (this.props.isReverse) {
|
|
offset = scrollTop;
|
|
} else {
|
|
offset = this.calculateOffset(el, scrollTop);
|
|
}
|
|
} else if (this.props.isReverse) {
|
|
offset = parentNode.scrollTop;
|
|
} else {
|
|
offset = el.scrollHeight - parentNode.scrollTop - parentNode.clientHeight;
|
|
}
|
|
|
|
// Here we make sure the element is visible as well as checking the offset
|
|
if (offset < Number(this.props.threshold) && el && el.offsetParent !== null) {
|
|
this.detachScrollListener();
|
|
this.beforeScrollHeight = parentNode.scrollHeight;
|
|
this.beforeScrollTop = parentNode.scrollTop;
|
|
// Call loadMore after detachScrollListener to allow for non-async loadMore functions
|
|
if (typeof this.props.loadMore === 'function') {
|
|
this.props.loadMore(this.pageLoaded += 1);
|
|
this.loadMore = true;
|
|
}
|
|
}
|
|
}
|
|
}, {
|
|
key: 'calculateOffset',
|
|
value: function calculateOffset(el, scrollTop) {
|
|
if (!el) {
|
|
return 0;
|
|
}
|
|
|
|
return this.calculateTopPosition(el) + (el.offsetHeight - scrollTop - window.innerHeight);
|
|
}
|
|
}, {
|
|
key: 'calculateTopPosition',
|
|
value: function calculateTopPosition(el) {
|
|
if (!el) {
|
|
return 0;
|
|
}
|
|
return el.offsetTop + this.calculateTopPosition(el.offsetParent);
|
|
}
|
|
}, {
|
|
key: 'render',
|
|
value: function render() {
|
|
var _this2 = this;
|
|
|
|
var renderProps = this.filterProps(this.props);
|
|
|
|
var children = renderProps.children,
|
|
element = renderProps.element,
|
|
hasMore = renderProps.hasMore,
|
|
initialLoad = renderProps.initialLoad,
|
|
isReverse = renderProps.isReverse,
|
|
loader = renderProps.loader,
|
|
loadMore = renderProps.loadMore,
|
|
pageStart = renderProps.pageStart,
|
|
ref = renderProps.ref,
|
|
threshold = renderProps.threshold,
|
|
useCapture = renderProps.useCapture,
|
|
useWindow = renderProps.useWindow,
|
|
getScrollParent = renderProps.getScrollParent,
|
|
props = _objectWithoutProperties(renderProps, ['children', 'element', 'hasMore', 'initialLoad', 'isReverse', 'loader', 'loadMore', 'pageStart', 'ref', 'threshold', 'useCapture', 'useWindow', 'getScrollParent']);
|
|
|
|
props.ref = function (node) {
|
|
_this2.scrollComponent = node;
|
|
if (ref) {
|
|
ref(node);
|
|
}
|
|
};
|
|
|
|
var childrenArray = [children];
|
|
if (hasMore) {
|
|
if (loader) {
|
|
isReverse ? childrenArray.unshift(loader) : childrenArray.push(loader);
|
|
} else if (this.defaultLoader) {
|
|
isReverse ? childrenArray.unshift(this.defaultLoader) : childrenArray.push(this.defaultLoader);
|
|
}
|
|
}
|
|
return _react2.default.createElement(element, props, childrenArray);
|
|
}
|
|
}]);
|
|
|
|
return InfiniteScroll;
|
|
}(_react.Component);
|
|
|
|
InfiniteScroll.propTypes = {
|
|
children: _propTypes2.default.node.isRequired,
|
|
element: _propTypes2.default.node,
|
|
hasMore: _propTypes2.default.bool,
|
|
initialLoad: _propTypes2.default.bool,
|
|
isReverse: _propTypes2.default.bool,
|
|
loader: _propTypes2.default.node,
|
|
loadMore: _propTypes2.default.func.isRequired,
|
|
pageStart: _propTypes2.default.number,
|
|
ref: _propTypes2.default.func,
|
|
getScrollParent: _propTypes2.default.func,
|
|
threshold: _propTypes2.default.number,
|
|
useCapture: _propTypes2.default.bool,
|
|
useWindow: _propTypes2.default.bool
|
|
};
|
|
InfiniteScroll.defaultProps = {
|
|
element: 'div',
|
|
hasMore: false,
|
|
initialLoad: true,
|
|
pageStart: 0,
|
|
ref: null,
|
|
threshold: 250,
|
|
useWindow: true,
|
|
isReverse: false,
|
|
useCapture: false,
|
|
loader: null,
|
|
getScrollParent: null
|
|
};
|
|
exports["default"] = InfiniteScroll;
|
|
module.exports = exports['default'];
|
|
|
|
|
|
/***/ }),
|
|
|
|
/***/ 26724:
|
|
/*!**************************************************************************************!*\
|
|
!*** ./node_modules/_react-infinite-scroller@1.2.4@react-infinite-scroller/index.js ***!
|
|
\**************************************************************************************/
|
|
/***/ (function(module, __unused_webpack_exports, __webpack_require__) {
|
|
|
|
module.exports = __webpack_require__(/*! ./dist/InfiniteScroll */ 51581)
|
|
|
|
|
|
/***/ })
|
|
|
|
}]); |