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

556 lines
24 KiB

"use strict";
(self["webpackChunk"] = self["webpackChunk"] || []).push([[61075],{
/***/ 4160:
/*!*************************************************************!*\
!*** ./src/pages/IOT/ViewAppointment/index.tsx + 3 modules ***!
\*************************************************************/
/***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) {
// ESM COMPAT FLAG
__webpack_require__.r(__webpack_exports__);
// EXPORTS
__webpack_require__.d(__webpack_exports__, {
"default": function() { return /* binding */ IOT_ViewAppointment; }
});
// EXTERNAL MODULE: ./node_modules/_@babel_runtime@7.23.6@@babel/runtime/helpers/objectSpread2.js
var objectSpread2 = __webpack_require__(82242);
var objectSpread2_default = /*#__PURE__*/__webpack_require__.n(objectSpread2);
// EXTERNAL MODULE: ./node_modules/_@babel_runtime@7.23.6@@babel/runtime/helpers/regeneratorRuntime.js
var regeneratorRuntime = __webpack_require__(7557);
var regeneratorRuntime_default = /*#__PURE__*/__webpack_require__.n(regeneratorRuntime);
// EXTERNAL MODULE: ./node_modules/_@babel_runtime@7.23.6@@babel/runtime/helpers/asyncToGenerator.js
var asyncToGenerator = __webpack_require__(41498);
var asyncToGenerator_default = /*#__PURE__*/__webpack_require__.n(asyncToGenerator);
// EXTERNAL MODULE: ./node_modules/_@babel_runtime@7.23.6@@babel/runtime/helpers/slicedToArray.js
var slicedToArray = __webpack_require__(79800);
var slicedToArray_default = /*#__PURE__*/__webpack_require__.n(slicedToArray);
// EXTERNAL MODULE: ./node_modules/_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__(80608);
;// CONCATENATED MODULE: ./src/pages/IOT/ViewAppointment/index.less?modules
// extracted by mini-css-extract-plugin
/* harmony default export */ var ViewAppointmentmodules = ({"content":"content____xFwD","schedule":"schedule___o3VOV","item_detail":"item_detail___Qvgau","item_detail_warp":"item_detail_warp___hPMSO","header_img":"header_img___HzTSz","item_title":"item_title___iUpmc","list_item":"list_item___Diz3Q","list_item_name":"list_item_name___AUxW9","goback_button":"goback_button___gGqG8"});
;// CONCATENATED MODULE: ./src/pages/IOT/ViewAppointment/schedule/index.less?modules
// extracted by mini-css-extract-plugin
/* harmony default export */ var schedulemodules = ({"week":"week___Rv_0n","btn":"btn___a2OPL","weekCount":"weekCount___mG7X8","weekDay":"weekDay___ch7aL","weekDay1":"weekDay1___v2p75","weekDay2":"weekDay2___g0cHs","timeSlotWarp":"timeSlotWarp___Guf0w","timeSlot":"timeSlot___fsmG7","timeSlotItem":"timeSlotItem___H7Giz","timeSlotItem2":"timeSlotItem2___LETaH"});
// EXTERNAL MODULE: ./node_modules/_@ant-design_icons@5.4.0@@ant-design/icons/es/icons/LeftOutlined.js + 1 modules
var LeftOutlined = __webpack_require__(40578);
// EXTERNAL MODULE: ./node_modules/_@ant-design_icons@5.4.0@@ant-design/icons/es/icons/RightOutlined.js + 1 modules
var RightOutlined = __webpack_require__(83148);
// EXTERNAL MODULE: ./node_modules/_antd@5.9.0@antd/es/tooltip/index.js + 3 modules
var tooltip = __webpack_require__(6848);
// 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/table/index.js + 85 modules
var table = __webpack_require__(51945);
// EXTERNAL MODULE: ./src/service/laboratory.ts
var laboratory = __webpack_require__(70974);
// EXTERNAL MODULE: ./node_modules/_react@17.0.2@react/jsx-runtime.js
var jsx_runtime = __webpack_require__(37712);
;// CONCATENATED MODULE: ./src/pages/IOT/ViewAppointment/schedule/index.tsx
var Navigation = function Navigation(_ref) {
var _scheduleData$reserva, _scheduleData$reserva2;
var loading = _ref.loading,
scheduleData = _ref.scheduleData,
onChangeWeek = _ref.onChangeWeek;
var 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 colorType = {
0: '#ADB2B8',
1: '#165DFF'
};
var bgcolorType = {
4: 'rgba(22,93,255,0.04)',
2: '#FBFBFB'
};
var nameType = {
0: '已过期',
1: '已预约'
};
var dayType = {
1: '一',
2: '二',
3: '三',
4: '四',
5: '五',
6: '六',
7: '日'
};
var timeType = {
1: '第1节(00:00-00:50)',
2: '第2节(01:00-01:50)',
3: '第3节(02:00-02:50)',
4: '第4节(03:00-03:50)',
5: '第5节(04:00-04:50)',
6: '第6节(05:00-05:50)',
7: '第7节(06:00-06:50)',
8: '第8节(07:00-07:50)',
9: '第9节(08:00-08:50)',
10: '第10节(09:00-09:50)',
11: '第11节(10:00-10:50)',
12: '第12节(11:00-11:50)',
13: '第13节(12:00-12:50)',
14: '第14节(13:00-13:50)',
15: '第15节(14:00-14:50)',
16: '第16节(15:00-15:50)',
17: '第17节(16:00-16:50)',
18: '第18节(17:00-17:50)',
19: '第19节(18:00-18:50)',
20: '第20节(19:00-19:50)',
21: '第21节(20:00-20:50)',
22: '第22节(21:00-21:50)',
23: '第23节(22:00-22:50)',
24: '第24节(23:00-23:50)'
};
var _useState = (0,_react_17_0_2_react.useState)(false),
_useState2 = slicedToArray_default()(_useState, 2),
modalVisible = _useState2[0],
setModalVisible = _useState2[1];
var _useState3 = (0,_react_17_0_2_react.useState)([]),
_useState4 = slicedToArray_default()(_useState3, 2),
tableData = _useState4[0],
setTableData = _useState4[1];
var _useState5 = (0,_react_17_0_2_react.useState)(false),
_useState6 = slicedToArray_default()(_useState5, 2),
isLoading = _useState6[0],
setIsLoading = _useState6[1];
var columns = [{
title: '预约人',
dataIndex: 'user_name',
ellipsis: true,
render: function render(text) {
return /*#__PURE__*/(0,jsx_runtime.jsx)(tooltip/* default */.Z, {
placement: "bottomLeft",
title: text,
children: /*#__PURE__*/(0,jsx_runtime.jsx)("span", {
children: text ? "".concat(text) : '--'
})
});
}
}, {
title: '角色',
dataIndex: 'user_role',
ellipsis: true,
render: function render(text) {
return /*#__PURE__*/(0,jsx_runtime.jsx)(tooltip/* default */.Z, {
placement: "bottomLeft",
title: text == 'student' ? '学生' : '教师',
children: /*#__PURE__*/(0,jsx_runtime.jsx)("span", {
children: text == 'student' ? '学生' : '教师'
})
});
}
}, {
title: '预约节次',
dataIndex: 'sections',
ellipsis: true,
width: 160,
render: function render(text, record) {
var _record$sections;
return record === null || record === void 0 || (_record$sections = record.sections) === null || _record$sections === void 0 ? void 0 : _record$sections.map(function (item, index) {
return /*#__PURE__*/(0,jsx_runtime.jsx)("div", {
children: timeType[item === null || item === void 0 ? void 0 : item.section_id]
}, index);
});
}
}, {
title: '工位数量',
dataIndex: 'work_num',
ellipsis: true,
render: function render(text) {
return /*#__PURE__*/(0,jsx_runtime.jsx)(tooltip/* default */.Z, {
placement: "bottomLeft",
title: text,
children: /*#__PURE__*/(0,jsx_runtime.jsx)("span", {
children: text ? "".concat(text) : '--'
})
});
}
}, {
title: '关联类型',
dataIndex: 'container_type',
ellipsis: true,
render: function render(text) {
return /*#__PURE__*/(0,jsx_runtime.jsx)(tooltip/* default */.Z, {
placement: "bottomLeft",
title: text == 'Subject' ? '实践课程' : text == 'Shixun' ? '实践项目' : '教学课堂',
children: /*#__PURE__*/(0,jsx_runtime.jsx)("span", {
children: text == 'Subject' ? '实践课程' : text == 'Shixun' ? '实践项目' : '教学课堂'
})
});
}
}, {
title: '关联内容',
dataIndex: 'container_titile',
ellipsis: true,
render: function render(text) {
return /*#__PURE__*/(0,jsx_runtime.jsx)(tooltip/* default */.Z, {
placement: "bottomLeft",
title: text,
children: /*#__PURE__*/(0,jsx_runtime.jsx)("span", {
children: text ? "".concat(text) : '--'
})
});
}
}, {
title: '学号/工位',
dataIndex: 'student_id',
ellipsis: true,
render: function render(text) {
return /*#__PURE__*/(0,jsx_runtime.jsx)(tooltip/* default */.Z, {
placement: "bottomLeft",
title: text,
children: /*#__PURE__*/(0,jsx_runtime.jsx)("span", {
children: text ? "".concat(text) : '--'
})
});
}
}, {
title: '手机号',
dataIndex: 'user_phone',
ellipsis: true,
render: function render(text) {
return /*#__PURE__*/(0,jsx_runtime.jsx)(tooltip/* default */.Z, {
placement: "bottomLeft",
title: text,
children: /*#__PURE__*/(0,jsx_runtime.jsx)("span", {
children: text ? "".concat(text) : '--'
})
});
}
}, {
title: '邮箱',
dataIndex: 'mail',
ellipsis: true,
render: function render(text) {
return /*#__PURE__*/(0,jsx_runtime.jsx)(tooltip/* default */.Z, {
placement: "bottomLeft",
title: text,
children: /*#__PURE__*/(0,jsx_runtime.jsx)("span", {
children: text ? "".concat(text) : '--'
})
});
}
}, {
title: '备注',
dataIndex: 'description',
ellipsis: true,
render: function render(text) {
return /*#__PURE__*/(0,jsx_runtime.jsx)(tooltip/* default */.Z, {
placement: "bottomLeft",
title: text,
children: /*#__PURE__*/(0,jsx_runtime.jsx)("span", {
children: text ? "".concat(text) : '--'
})
});
}
}];
return /*#__PURE__*/(0,jsx_runtime.jsxs)("div", {
style: {
padding: 20
},
children: [(scheduleData === null || scheduleData === void 0 ? void 0 : scheduleData.cweek) && /*#__PURE__*/(0,jsx_runtime.jsxs)("div", {
children: [/*#__PURE__*/(0,jsx_runtime.jsxs)("div", {
className: schedulemodules.week,
children: [/*#__PURE__*/(0,jsx_runtime.jsx)("div", {
className: schedulemodules.btn,
style: {
cursor: (scheduleData === null || scheduleData === void 0 ? void 0 : scheduleData.cweek) > 1 ? 'pointer' : 'not-allowed',
color: (scheduleData === null || scheduleData === void 0 ? void 0 : scheduleData.cweek) > 1 ? '#464F66' : 'rgba(70, 79, 102,.5)'
},
onClick: function onClick() {
if ((scheduleData === null || scheduleData === void 0 ? void 0 : scheduleData.cweek) > 1) {
onChangeWeek(Number(scheduleData === null || scheduleData === void 0 ? void 0 : scheduleData.cweek) - 1);
}
},
children: /*#__PURE__*/(0,jsx_runtime.jsx)(LeftOutlined/* default */.Z, {})
}), /*#__PURE__*/(0,jsx_runtime.jsxs)("div", {
className: schedulemodules.weekCount,
children: ["\u7B2C", scheduleData === null || scheduleData === void 0 ? void 0 : scheduleData.cweek, "\u5468"]
}), /*#__PURE__*/(0,jsx_runtime.jsx)("div", {
className: schedulemodules.btn,
style: {
cursor: (scheduleData === null || scheduleData === void 0 ? void 0 : scheduleData.cweek) == Number(scheduleData === null || scheduleData === void 0 ? void 0 : scheduleData.system_cweek) + 1 ? 'not-allowed' : 'pointer',
color: (scheduleData === null || scheduleData === void 0 ? void 0 : scheduleData.cweek) == Number(scheduleData === null || scheduleData === void 0 ? void 0 : scheduleData.system_cweek) + 1 ? 'rgba(70, 79, 102,.5)' : '#464F66'
},
onClick: function onClick() {
if ((scheduleData === null || scheduleData === void 0 ? void 0 : scheduleData.cweek) < Number(scheduleData === null || scheduleData === void 0 ? void 0 : scheduleData.system_cweek) + 1) {
onChangeWeek(Number(scheduleData === null || scheduleData === void 0 ? void 0 : scheduleData.cweek) + 1);
}
},
children: /*#__PURE__*/(0,jsx_runtime.jsx)(RightOutlined/* default */.Z, {
color: "#464F66"
})
})]
}), /*#__PURE__*/(0,jsx_runtime.jsxs)("div", {
children: [/*#__PURE__*/(0,jsx_runtime.jsxs)("div", {
className: schedulemodules.weekDay,
children: [/*#__PURE__*/(0,jsx_runtime.jsxs)("div", {
className: schedulemodules.weekDay1,
children: [/*#__PURE__*/(0,jsx_runtime.jsx)("div", {
children: "\u65E5\u671F"
}), /*#__PURE__*/(0,jsx_runtime.jsx)("div", {
children: "\u8BFE\u8282"
})]
}), scheduleData === null || scheduleData === void 0 || (_scheduleData$reserva = scheduleData.reservation_details) === null || _scheduleData$reserva === void 0 ? void 0 : _scheduleData$reserva.map(function (item, index) {
return /*#__PURE__*/(0,jsx_runtime.jsxs)("div", {
className: schedulemodules.weekDay2,
children: [/*#__PURE__*/(0,jsx_runtime.jsx)("span", {
style: {
marginRight: 10,
color: '#ADB2B8'
},
children: item === null || item === void 0 ? void 0 : item.date
}), /*#__PURE__*/(0,jsx_runtime.jsxs)("span", {
children: ["\u5468", dayType[item === null || item === void 0 ? void 0 : item.week]]
})]
}, item === null || item === void 0 ? void 0 : item.date);
})]
}), /*#__PURE__*/(0,jsx_runtime.jsxs)("div", {
className: schedulemodules.timeSlotWarp,
children: [/*#__PURE__*/(0,jsx_runtime.jsx)("div", {
className: schedulemodules.timeSlot,
children: times.map(function (item, index) {
return /*#__PURE__*/(0,jsx_runtime.jsxs)("div", {
className: schedulemodules.timeSlotItem,
children: [/*#__PURE__*/(0,jsx_runtime.jsx)("div", {
children: index + 1
}), /*#__PURE__*/(0,jsx_runtime.jsx)("div", {
children: item
})]
}, index);
})
}), scheduleData === null || scheduleData === void 0 || (_scheduleData$reserva2 = scheduleData.reservation_details) === null || _scheduleData$reserva2 === void 0 ? void 0 : _scheduleData$reserva2.map(function (item, index) {
return /*#__PURE__*/(0,jsx_runtime.jsx)("div", {
style: {
width: '100%'
},
children: item === null || item === void 0 ? void 0 : item.sections.map(function (item2, index2) {
return /*#__PURE__*/(0,jsx_runtime.jsx)("div", {
className: schedulemodules.timeSlotItem2,
style: {
color: colorType[item2 === null || item2 === void 0 ? void 0 : item2.status],
background: bgcolorType[item2 === null || item2 === void 0 ? void 0 : item2.status],
cursor: (item2 === null || item2 === void 0 ? void 0 : item2.status) == 1 ? 'pointer' : ''
},
onClick: /*#__PURE__*/asyncToGenerator_default()( /*#__PURE__*/regeneratorRuntime_default()().mark(function _callee() {
return regeneratorRuntime_default()().wrap(function _callee$(_context) {
while (1) switch (_context.prev = _context.next) {
case 0:
if (!((item2 === null || item2 === void 0 ? void 0 : item2.status) == 1)) {
_context.next = 5;
break;
}
setModalVisible(true);
setIsLoading(true);
_context.next = 5;
return (0,laboratory/* reservations_query */.bU)({
is_all: true,
classroom_room_id: scheduleData === null || scheduleData === void 0 ? void 0 : scheduleData.id,
section_ids: [item2 === null || item2 === void 0 ? void 0 : item2.id],
reservation_date: item === null || item === void 0 ? void 0 : item.date
}).then(function (res) {
if (res.status == 0) {
var _res$data;
setTableData(res === null || res === void 0 || (_res$data = res.data) === null || _res$data === void 0 ? void 0 : _res$data.list);
}
setIsLoading(false);
});
case 5:
case "end":
return _context.stop();
}
}, _callee);
})),
children: /*#__PURE__*/(0,jsx_runtime.jsxs)("div", {
children: [nameType[item2 === null || item2 === void 0 ? void 0 : item2.status], " ", (item2 === null || item2 === void 0 ? void 0 : item2.status) == 1 && (item2 === null || item2 === void 0 ? void 0 : item2.num)]
})
}, "".concat(item.date, "_").concat(index2));
})
}, item === null || item === void 0 ? void 0 : item.date);
})]
})]
})]
}), /*#__PURE__*/(0,jsx_runtime.jsx)(modal/* default */.Z, {
maskClosable: false,
centered: true,
keyboard: false,
destroyOnClose: true,
className: schedulemodules.my_modal,
open: modalVisible,
title: "\u9884\u7EA6\u8BE6\u60C5",
width: "1057px",
footer: null,
onCancel: function onCancel() {
return setModalVisible(false);
},
children: /*#__PURE__*/(0,jsx_runtime.jsx)(table/* default */.Z, {
scroll: {
y: 650
},
loading: isLoading,
pagination: false,
dataSource: tableData,
columns: columns
})
})]
});
};
/* harmony default export */ var schedule = ((0,_umi_production_exports.connect)(function (_ref3) {
var loading = _ref3.loading,
engineeringNavigtion = _ref3.engineeringNavigtion;
return objectSpread2_default()({
loading: loading
}, engineeringNavigtion);
})(Navigation));
// EXTERNAL MODULE: ./src/assets/images/roomInitImg.png
var roomInitImg = __webpack_require__(58253);
// EXTERNAL MODULE: ./src/utils/env.ts + 1 modules
var env = __webpack_require__(71681);
;// CONCATENATED MODULE: ./src/pages/IOT/ViewAppointment/index.tsx
var ViewAppointment = function ViewAppointment(_ref) {
var _scheduleData$directo;
var loading = _ref.loading,
dispatch = _ref.dispatch;
var _useState = (0,_react_17_0_2_react.useState)({}),
_useState2 = slicedToArray_default()(_useState, 2),
scheduleData = _useState2[0],
setScheduleData = _useState2[1];
var params = (0,_umi_production_exports.useParams)();
(0,_react_17_0_2_react.useEffect)(function () {
getData(null);
dispatch({
type: 'globalSetting/headerFooterToggle',
payload: false
});
return function () {
dispatch({
type: 'globalSetting/headerFooterToggle',
payload: true
});
};
}, []);
var getData = /*#__PURE__*/function () {
var _ref2 = asyncToGenerator_default()( /*#__PURE__*/regeneratorRuntime_default()().mark(function _callee(box) {
return regeneratorRuntime_default()().wrap(function _callee$(_context) {
while (1) switch (_context.prev = _context.next) {
case 0:
_context.next = 2;
return (0,laboratory/* getReservationDetails */.C)({
id: params === null || params === void 0 ? void 0 : params.id,
cweek: box
}).then(function (res) {
if (res.status === 0) {
setScheduleData(res === null || res === void 0 ? void 0 : res.data);
}
});
case 2:
case "end":
return _context.stop();
}
}, _callee);
}));
return function getData(_x) {
return _ref2.apply(this, arguments);
};
}();
return /*#__PURE__*/(0,jsx_runtime.jsxs)("div", {
className: ViewAppointmentmodules.content,
children: [/*#__PURE__*/(0,jsx_runtime.jsx)("div", {
className: ViewAppointmentmodules.schedule,
children: /*#__PURE__*/(0,jsx_runtime.jsx)(schedule, {
scheduleData: scheduleData,
onChangeWeek: function onChangeWeek(e) {
getData(e);
}
})
}), /*#__PURE__*/(0,jsx_runtime.jsx)("div", {
className: ViewAppointmentmodules.item_detail,
children: /*#__PURE__*/(0,jsx_runtime.jsxs)("div", {
className: ViewAppointmentmodules.item_detail_warp,
children: [/*#__PURE__*/(0,jsx_runtime.jsx)("img", {
className: ViewAppointmentmodules.header_img,
src: scheduleData !== null && scheduleData !== void 0 && scheduleData.image ? env/* default */.Z.API_SERVER + '/' + (scheduleData === null || scheduleData === void 0 ? void 0 : scheduleData.image) : roomInitImg
}), /*#__PURE__*/(0,jsx_runtime.jsx)("div", {
className: ViewAppointmentmodules.item_title,
children: scheduleData === null || scheduleData === void 0 ? void 0 : scheduleData.title
}), [{
name: '所属实验室',
content: scheduleData === null || scheduleData === void 0 ? void 0 : scheduleData.classroom_title
}, {
name: '使用面积',
content: "".concat(scheduleData === null || scheduleData === void 0 ? void 0 : scheduleData.area, "\u5E73\u65B9\u7C73")
}, {
name: '工位数量',
content: scheduleData === null || scheduleData === void 0 ? void 0 : scheduleData.work_num
}, {
name: '责任人',
content: scheduleData === null || scheduleData === void 0 || (_scheduleData$directo = scheduleData.directors) === null || _scheduleData$directo === void 0 || (_scheduleData$directo = _scheduleData$directo[0]) === null || _scheduleData$directo === void 0 ? void 0 : _scheduleData$directo.name
}].map(function (item, index) {
return /*#__PURE__*/(0,jsx_runtime.jsxs)("div", {
className: ViewAppointmentmodules.list_item,
children: [/*#__PURE__*/(0,jsx_runtime.jsx)("div", {
className: ViewAppointmentmodules.list_item_name,
children: item === null || item === void 0 ? void 0 : item.name.split('').map(function (item2, i) {
return /*#__PURE__*/(0,jsx_runtime.jsx)("span", {
children: item2
}, i);
})
}), /*#__PURE__*/(0,jsx_runtime.jsx)("div", {
children: item === null || item === void 0 ? void 0 : item.content
})]
}, item === null || item === void 0 ? void 0 : item.name);
}), /*#__PURE__*/(0,jsx_runtime.jsx)("div", {
className: ViewAppointmentmodules.goback_button,
onClick: function onClick() {
_umi_production_exports.history.back();
// history.push('/iot/electronBPManage')
},
children: "\u9000\u51FA"
})]
})
})]
});
};
/* harmony default export */ var IOT_ViewAppointment = ((0,_umi_production_exports.connect)(function (_ref3) {
var loading = _ref3.loading,
engineeringNavigtion = _ref3.engineeringNavigtion,
dispatch = _ref3.dispatch;
return objectSpread2_default()(objectSpread2_default()({
loading: loading
}, engineeringNavigtion), {}, {
dispatch: dispatch
});
})(ViewAppointment));
/***/ })
}]);