|
|
|
|
@ -269,6 +269,10 @@ var AddOrEditReservation = function AddOrEditReservation(_ref) {
|
|
|
|
|
_useState4 = slicedToArray_default()(_useState3, 2),
|
|
|
|
|
containerList = _useState4[0],
|
|
|
|
|
setContainerList = _useState4[1];
|
|
|
|
|
var _useState5 = (0,_react_17_0_2_react.useState)(false),
|
|
|
|
|
_useState6 = slicedToArray_default()(_useState5, 2),
|
|
|
|
|
loading = _useState6[0],
|
|
|
|
|
setLoading = _useState6[1];
|
|
|
|
|
(0,_react_17_0_2_react.useEffect)(function () {
|
|
|
|
|
if (open) {
|
|
|
|
|
initData();
|
|
|
|
|
@ -359,6 +363,7 @@ var AddOrEditReservation = function AddOrEditReservation(_ref) {
|
|
|
|
|
});
|
|
|
|
|
};
|
|
|
|
|
var add = function add(params) {
|
|
|
|
|
setLoading(true);
|
|
|
|
|
(0,fetch/* default */.ZP)("/api/appointment_classes.json", {
|
|
|
|
|
method: 'post',
|
|
|
|
|
body: params
|
|
|
|
|
@ -369,8 +374,10 @@ var AddOrEditReservation = function AddOrEditReservation(_ref) {
|
|
|
|
|
getData();
|
|
|
|
|
}
|
|
|
|
|
});
|
|
|
|
|
setLoading(false);
|
|
|
|
|
};
|
|
|
|
|
var edit = function edit(params) {
|
|
|
|
|
setLoading(true);
|
|
|
|
|
(0,fetch/* default */.ZP)("/api/appointment_classes/".concat(rowData === null || rowData === void 0 ? void 0 : rowData.id, ".json"), {
|
|
|
|
|
method: 'put',
|
|
|
|
|
body: params
|
|
|
|
|
@ -381,8 +388,10 @@ var AddOrEditReservation = function AddOrEditReservation(_ref) {
|
|
|
|
|
getData();
|
|
|
|
|
}
|
|
|
|
|
});
|
|
|
|
|
setLoading(false);
|
|
|
|
|
};
|
|
|
|
|
return /*#__PURE__*/(0,jsx_runtime.jsx)(modal/* default */.Z, {
|
|
|
|
|
confirmLoading: loading,
|
|
|
|
|
maskClosable: false,
|
|
|
|
|
centered: true,
|
|
|
|
|
keyboard: false,
|
|
|
|
|
@ -590,7 +599,7 @@ var AddOrEditReservation = function AddOrEditReservation(_ref) {
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
var MyReservation = function MyReservation(_ref) {
|
|
|
|
|
var tabType = _ref.tabType;
|
|
|
|
|
var key = _ref.key;
|
|
|
|
|
var _useState = (0,_react_17_0_2_react.useState)(1),
|
|
|
|
|
_useState2 = slicedToArray_default()(_useState, 2),
|
|
|
|
|
page = _useState2[0],
|
|
|
|
|
@ -630,11 +639,11 @@ var MyReservation = function MyReservation(_ref) {
|
|
|
|
|
}
|
|
|
|
|
};
|
|
|
|
|
(0,_react_17_0_2_react.useEffect)(function () {
|
|
|
|
|
if (tabType == 'two') {
|
|
|
|
|
if (key) {
|
|
|
|
|
setPage(1);
|
|
|
|
|
setLimit(10);
|
|
|
|
|
}
|
|
|
|
|
}, [tabType]);
|
|
|
|
|
}, [key]);
|
|
|
|
|
(0,_react_17_0_2_react.useEffect)(function () {
|
|
|
|
|
getReservationList();
|
|
|
|
|
}, [page, limit]);
|
|
|
|
|
@ -995,35 +1004,21 @@ var AppointmentReview = function AppointmentReview(_ref) {
|
|
|
|
|
// }
|
|
|
|
|
// },
|
|
|
|
|
{
|
|
|
|
|
title: '开课时间',
|
|
|
|
|
dataIndex: 'schedule_date',
|
|
|
|
|
title: '开课名称',
|
|
|
|
|
dataIndex: 'title',
|
|
|
|
|
align: 'left',
|
|
|
|
|
key: 'schedule_date',
|
|
|
|
|
key: 'title',
|
|
|
|
|
ellipsis: true,
|
|
|
|
|
width: 220,
|
|
|
|
|
render: function render(text, record) {
|
|
|
|
|
var _record$lessons, _record$lessons2;
|
|
|
|
|
return /*#__PURE__*/(0,jsx_runtime.jsxs)(tooltip/* default */.Z, {
|
|
|
|
|
title: /*#__PURE__*/(0,jsx_runtime.jsxs)(jsx_runtime.Fragment, {
|
|
|
|
|
children: [/*#__PURE__*/(0,jsx_runtime.jsx)("div", {
|
|
|
|
|
children: text
|
|
|
|
|
}), record === null || record === void 0 || (_record$lessons = record.lessons) === null || _record$lessons === void 0 ? void 0 : _record$lessons.map(function (item, index) {
|
|
|
|
|
return /*#__PURE__*/(0,jsx_runtime.jsxs)("div", {
|
|
|
|
|
children: ["\u7B2C", item, "\u8282"]
|
|
|
|
|
});
|
|
|
|
|
})]
|
|
|
|
|
}),
|
|
|
|
|
children: [/*#__PURE__*/(0,jsx_runtime.jsx)("span", {
|
|
|
|
|
className: "c-grey-666",
|
|
|
|
|
width: 200,
|
|
|
|
|
render: function render(text) {
|
|
|
|
|
return /*#__PURE__*/(0,jsx_runtime.jsx)(tooltip/* default */.Z, {
|
|
|
|
|
title: text,
|
|
|
|
|
children: /*#__PURE__*/(0,jsx_runtime.jsx)("span", {
|
|
|
|
|
style: {
|
|
|
|
|
fontWeight: 500
|
|
|
|
|
},
|
|
|
|
|
children: text
|
|
|
|
|
}), record === null || record === void 0 || (_record$lessons2 = record.lessons) === null || _record$lessons2 === void 0 ? void 0 : _record$lessons2.map(function (item, index) {
|
|
|
|
|
return /*#__PURE__*/(0,jsx_runtime.jsxs)("span", {
|
|
|
|
|
style: {
|
|
|
|
|
margin: '0 5px'
|
|
|
|
|
},
|
|
|
|
|
children: ["\u7B2C", item, "\u8282"]
|
|
|
|
|
});
|
|
|
|
|
})]
|
|
|
|
|
})
|
|
|
|
|
});
|
|
|
|
|
}
|
|
|
|
|
}, {
|
|
|
|
|
@ -1076,11 +1071,31 @@ var AppointmentReview = function AppointmentReview(_ref) {
|
|
|
|
|
dataIndex: 'schedule_date',
|
|
|
|
|
align: 'left',
|
|
|
|
|
key: 'schedule_date',
|
|
|
|
|
width: 180,
|
|
|
|
|
render: function render(text) {
|
|
|
|
|
return /*#__PURE__*/(0,jsx_runtime.jsx)("span", {
|
|
|
|
|
className: "c-grey-666",
|
|
|
|
|
children: text
|
|
|
|
|
ellipsis: true,
|
|
|
|
|
width: 220,
|
|
|
|
|
render: function render(text, record) {
|
|
|
|
|
var _record$lessons, _record$lessons2;
|
|
|
|
|
return /*#__PURE__*/(0,jsx_runtime.jsxs)(tooltip/* default */.Z, {
|
|
|
|
|
title: /*#__PURE__*/(0,jsx_runtime.jsxs)(jsx_runtime.Fragment, {
|
|
|
|
|
children: [/*#__PURE__*/(0,jsx_runtime.jsx)("div", {
|
|
|
|
|
children: text
|
|
|
|
|
}), record === null || record === void 0 || (_record$lessons = record.lessons) === null || _record$lessons === void 0 ? void 0 : _record$lessons.map(function (item, index) {
|
|
|
|
|
return /*#__PURE__*/(0,jsx_runtime.jsxs)("div", {
|
|
|
|
|
children: ["\u7B2C", item, "\u8282"]
|
|
|
|
|
});
|
|
|
|
|
})]
|
|
|
|
|
}),
|
|
|
|
|
children: [/*#__PURE__*/(0,jsx_runtime.jsx)("span", {
|
|
|
|
|
className: "c-grey-666",
|
|
|
|
|
children: text
|
|
|
|
|
}), record === null || record === void 0 || (_record$lessons2 = record.lessons) === null || _record$lessons2 === void 0 ? void 0 : _record$lessons2.map(function (item, index) {
|
|
|
|
|
return /*#__PURE__*/(0,jsx_runtime.jsxs)("span", {
|
|
|
|
|
style: {
|
|
|
|
|
margin: '0 5px'
|
|
|
|
|
},
|
|
|
|
|
children: ["\u7B2C", item, "\u8282"]
|
|
|
|
|
});
|
|
|
|
|
})]
|
|
|
|
|
});
|
|
|
|
|
}
|
|
|
|
|
}, {
|
|
|
|
|
@ -1243,6 +1258,10 @@ var ClassroomListPage = function ClassroomListPage(_ref) {
|
|
|
|
|
_useState6 = slicedToArray_default()(_useState5, 2),
|
|
|
|
|
scheduleData = _useState6[0],
|
|
|
|
|
setScheduleData = _useState6[1];
|
|
|
|
|
var _useState7 = (0,_react_17_0_2_react.useState)(0),
|
|
|
|
|
_useState8 = slicedToArray_default()(_useState7, 2),
|
|
|
|
|
key = _useState8[0],
|
|
|
|
|
setKey = _useState8[1];
|
|
|
|
|
var tabs = [{
|
|
|
|
|
id: 'one',
|
|
|
|
|
name: '排课细则'
|
|
|
|
|
@ -1316,9 +1335,7 @@ var ClassroomListPage = function ClassroomListPage(_ref) {
|
|
|
|
|
getData: function getData(e) {
|
|
|
|
|
return getSchedulingList(e);
|
|
|
|
|
}
|
|
|
|
|
}), tabType === 'two' && /*#__PURE__*/(0,jsx_runtime.jsx)(Scheduling_MyReservation, {
|
|
|
|
|
tabType: tabType
|
|
|
|
|
}), tabType === 'three' && /*#__PURE__*/(0,jsx_runtime.jsx)(Scheduling_AppointmentReview, {
|
|
|
|
|
}), tabType === 'two' && /*#__PURE__*/(0,jsx_runtime.jsx)(Scheduling_MyReservation, {}, key), tabType === 'three' && /*#__PURE__*/(0,jsx_runtime.jsx)(Scheduling_AppointmentReview, {
|
|
|
|
|
tabType: tabType
|
|
|
|
|
}), /*#__PURE__*/(0,jsx_runtime.jsx)(Scheduling_AddOrEditReservation, {
|
|
|
|
|
open: showReservation,
|
|
|
|
|
@ -1327,7 +1344,10 @@ var ClassroomListPage = function ClassroomListPage(_ref) {
|
|
|
|
|
return setShowReservation(false);
|
|
|
|
|
},
|
|
|
|
|
getData: function getData() {
|
|
|
|
|
return setTabType('two');
|
|
|
|
|
if (tabType != 'two') {
|
|
|
|
|
setTabType('two');
|
|
|
|
|
}
|
|
|
|
|
setKey(key + 1);
|
|
|
|
|
}
|
|
|
|
|
})]
|
|
|
|
|
});
|