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

2610 lines
113 KiB

"use strict";
(self["webpackChunk"] = self["webpackChunk"] || []).push([[71525],{
/***/ 61028:
/*!**********************************************************************************!*\
!*** ./src/pages/User/Detail/Devicegroup/ReservationInfo/index.tsx + 12 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 */ ReservationInfo; }
});
// 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: ./src/assets/img/device_type.png
var device_type = __webpack_require__(49842);
// 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/_react@17.0.2@react/index.js
var _react_17_0_2_react = __webpack_require__(59301);
// 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/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/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/objectDestructuringEmpty.js
var objectDestructuringEmpty = __webpack_require__(70236);
var objectDestructuringEmpty_default = /*#__PURE__*/__webpack_require__.n(objectDestructuringEmpty);
// 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: ./src/utils/fetch.ts
var fetch = __webpack_require__(49105);
;// CONCATENATED MODULE: ./src/service/onlinedevices.ts
//设备标签列表查询
function device_tags_table_query(_x) {
return _device_tags_table_query.apply(this, arguments);
}
//设备标签列表删除
function _device_tags_table_query() {
_device_tags_table_query = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee(params) {
return _regeneratorRuntime().wrap(function _callee$(_context) {
while (1) switch (_context.prev = _context.next) {
case 0:
return _context.abrupt("return", Fetch("/api/zz_classrooms/device_tags.json", {
method: 'get',
params: _objectSpread({}, params)
}));
case 1:
case "end":
return _context.stop();
}
}, _callee);
}));
return _device_tags_table_query.apply(this, arguments);
}
function device_tags_table_delete(_x2) {
return _device_tags_table_delete.apply(this, arguments);
}
//设备标签列表编辑
function _device_tags_table_delete() {
_device_tags_table_delete = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee2(params) {
return _regeneratorRuntime().wrap(function _callee2$(_context2) {
while (1) switch (_context2.prev = _context2.next) {
case 0:
return _context2.abrupt("return", Fetch("/api/zz_classrooms/device_tags/".concat(params.id, ".json"), {
method: 'DELETE'
}));
case 1:
case "end":
return _context2.stop();
}
}, _callee2);
}));
return _device_tags_table_delete.apply(this, arguments);
}
function device_tags_table_update(_x3) {
return _device_tags_table_update.apply(this, arguments);
}
//设备标签列表新增
function _device_tags_table_update() {
_device_tags_table_update = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee3(data) {
return _regeneratorRuntime().wrap(function _callee3$(_context3) {
while (1) switch (_context3.prev = _context3.next) {
case 0:
return _context3.abrupt("return", Fetch("/api/zz_classrooms/device_tags/".concat(data.id, ".json"), {
method: 'PUT',
body: _objectSpread({}, data)
}));
case 1:
case "end":
return _context3.stop();
}
}, _callee3);
}));
return _device_tags_table_update.apply(this, arguments);
}
function device_tags_table_add(_x4) {
return _device_tags_table_add.apply(this, arguments);
}
//获取物理设备标签
function _device_tags_table_add() {
_device_tags_table_add = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee4(data) {
return _regeneratorRuntime().wrap(function _callee4$(_context4) {
while (1) switch (_context4.prev = _context4.next) {
case 0:
return _context4.abrupt("return", Fetch("/api/zz_classrooms/device_tags.json", {
method: 'POST',
body: _objectSpread({}, data)
}));
case 1:
case "end":
return _context4.stop();
}
}, _callee4);
}));
return _device_tags_table_add.apply(this, arguments);
}
function device_tags_devcie_models(_x5) {
return _device_tags_devcie_models.apply(this, arguments);
}
//设备标签列表单条数据详情
function _device_tags_devcie_models() {
_device_tags_devcie_models = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee5(params) {
return _regeneratorRuntime().wrap(function _callee5$(_context5) {
while (1) switch (_context5.prev = _context5.next) {
case 0:
return _context5.abrupt("return", Fetch("/api/zz_classrooms/device_tags/get_devcie_models.json", {
method: 'get',
params: _objectSpread({}, params)
}));
case 1:
case "end":
return _context5.stop();
}
}, _callee5);
}));
return _device_tags_devcie_models.apply(this, arguments);
}
function device_tags_table_info(_x6) {
return _device_tags_table_info.apply(this, arguments);
}
//获取某一设备信息
function _device_tags_table_info() {
_device_tags_table_info = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee6(params) {
return _regeneratorRuntime().wrap(function _callee6$(_context6) {
while (1) switch (_context6.prev = _context6.next) {
case 0:
return _context6.abrupt("return", Fetch("/api/zz_classrooms/device_tags/".concat(params, ".json"), {
method: 'get'
}));
case 1:
case "end":
return _context6.stop();
}
}, _callee6);
}));
return _device_tags_table_info.apply(this, arguments);
}
function device_tags_device_info(_x7) {
return _device_tags_device_info.apply(this, arguments);
}
//设备类型
function _device_tags_device_info() {
_device_tags_device_info = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee7(params) {
return _regeneratorRuntime().wrap(function _callee7$(_context7) {
while (1) switch (_context7.prev = _context7.next) {
case 0:
return _context7.abrupt("return", Fetch("/api/zz_classrooms/devices/".concat(params, ".json"), {
method: 'get'
}));
case 1:
case "end":
return _context7.stop();
}
}, _callee7);
}));
return _device_tags_device_info.apply(this, arguments);
}
function device_tags_device_type(_x8) {
return _device_tags_device_type.apply(this, arguments);
}
//设备类型列表查询
function _device_tags_device_type() {
_device_tags_device_type = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee8(params) {
return _regeneratorRuntime().wrap(function _callee8$(_context8) {
while (1) switch (_context8.prev = _context8.next) {
case 0:
return _context8.abrupt("return", Fetch("/api/zz_classrooms/devices/total_data.json", {
method: 'get',
params: _objectSpread({}, params)
}));
case 1:
case "end":
return _context8.stop();
}
}, _callee8);
}));
return _device_tags_device_type.apply(this, arguments);
}
function device_type_table_query(_x9) {
return _device_type_table_query.apply(this, arguments);
}
//设备类型列表删除
function _device_type_table_query() {
_device_type_table_query = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee9(params) {
return _regeneratorRuntime().wrap(function _callee9$(_context9) {
while (1) switch (_context9.prev = _context9.next) {
case 0:
return _context9.abrupt("return", Fetch("/api/zz_classrooms/device_types.json", {
method: 'get',
params: _objectSpread({}, params)
}));
case 1:
case "end":
return _context9.stop();
}
}, _callee9);
}));
return _device_type_table_query.apply(this, arguments);
}
function device_type_table_delete(_x10) {
return _device_type_table_delete.apply(this, arguments);
}
//设备类型列表详情
function _device_type_table_delete() {
_device_type_table_delete = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee10(params) {
return _regeneratorRuntime().wrap(function _callee10$(_context10) {
while (1) switch (_context10.prev = _context10.next) {
case 0:
return _context10.abrupt("return", Fetch("/api/zz_classrooms/device_types/".concat(params, ".json"), {
method: 'DELETE'
}));
case 1:
case "end":
return _context10.stop();
}
}, _callee10);
}));
return _device_type_table_delete.apply(this, arguments);
}
function device_type_table_info(_x11) {
return _device_type_table_info.apply(this, arguments);
}
//设备类型列表修改
function _device_type_table_info() {
_device_type_table_info = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee11(params) {
return _regeneratorRuntime().wrap(function _callee11$(_context11) {
while (1) switch (_context11.prev = _context11.next) {
case 0:
return _context11.abrupt("return", Fetch("/api/zz_classrooms/device_types/".concat(params, ".json"), {
method: 'get'
}));
case 1:
case "end":
return _context11.stop();
}
}, _callee11);
}));
return _device_type_table_info.apply(this, arguments);
}
function device_type_table_update(_x12) {
return _device_type_table_update.apply(this, arguments);
}
//设备类型列表新增
function _device_type_table_update() {
_device_type_table_update = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee12(data) {
return _regeneratorRuntime().wrap(function _callee12$(_context12) {
while (1) switch (_context12.prev = _context12.next) {
case 0:
return _context12.abrupt("return", Fetch("/api/zz_classrooms/device_types/".concat(data.id, ".json"), {
method: 'put',
body: _objectSpread({}, data)
}));
case 1:
case "end":
return _context12.stop();
}
}, _callee12);
}));
return _device_type_table_update.apply(this, arguments);
}
function device_type_table_add(_x13) {
return _device_type_table_add.apply(this, arguments);
}
//上下架
function _device_type_table_add() {
_device_type_table_add = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee13(data) {
return _regeneratorRuntime().wrap(function _callee13$(_context13) {
while (1) switch (_context13.prev = _context13.next) {
case 0:
return _context13.abrupt("return", Fetch("/api/zz_classrooms/device_types.json", {
method: 'POST',
body: _objectSpread({}, data)
}));
case 1:
case "end":
return _context13.stop();
}
}, _callee13);
}));
return _device_type_table_add.apply(this, arguments);
}
function device_info_use_status(_x14) {
return _device_info_use_status.apply(this, arguments);
}
//某设备所有标签记录
function _device_info_use_status() {
_device_info_use_status = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee14(params) {
return _regeneratorRuntime().wrap(function _callee14$(_context14) {
while (1) switch (_context14.prev = _context14.next) {
case 0:
return _context14.abrupt("return", Fetch("/api/zz_classrooms/devices/".concat(params.id, "/update_device_use_status.json"), {
method: 'get',
params: _objectSpread({}, params)
}));
case 1:
case "end":
return _context14.stop();
}
}, _callee14);
}));
return _device_info_use_status.apply(this, arguments);
}
function device_info_all_tags(_x15) {
return _device_info_all_tags.apply(this, arguments);
}
//设备信息列表查询
function _device_info_all_tags() {
_device_info_all_tags = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee15(params) {
return _regeneratorRuntime().wrap(function _callee15$(_context15) {
while (1) switch (_context15.prev = _context15.next) {
case 0:
return _context15.abrupt("return", Fetch("/api/zz_classrooms/devices/".concat(params, "/device_all_tags.json"), {
method: 'get'
}));
case 1:
case "end":
return _context15.stop();
}
}, _callee15);
}));
return _device_info_all_tags.apply(this, arguments);
}
function device_info_table_query(_x16) {
return _device_info_table_query.apply(this, arguments);
}
//设备信息列表详情
function _device_info_table_query() {
_device_info_table_query = asyncToGenerator_default()( /*#__PURE__*/regeneratorRuntime_default()().mark(function _callee16(params) {
return regeneratorRuntime_default()().wrap(function _callee16$(_context16) {
while (1) switch (_context16.prev = _context16.next) {
case 0:
return _context16.abrupt("return", (0,fetch/* default */.ZP)("/api/zz_classrooms/devices.json", {
method: 'get',
params: objectSpread2_default()({}, params)
}));
case 1:
case "end":
return _context16.stop();
}
}, _callee16);
}));
return _device_info_table_query.apply(this, arguments);
}
function device_info_table_info(_x17) {
return _device_info_table_info.apply(this, arguments);
}
//设备信息列表编辑
function _device_info_table_info() {
_device_info_table_info = asyncToGenerator_default()( /*#__PURE__*/regeneratorRuntime_default()().mark(function _callee17(params) {
return regeneratorRuntime_default()().wrap(function _callee17$(_context17) {
while (1) switch (_context17.prev = _context17.next) {
case 0:
return _context17.abrupt("return", (0,fetch/* default */.ZP)("/api/zz_classrooms/device_groups/".concat(params, ".json"), {
method: 'get'
}));
case 1:
case "end":
return _context17.stop();
}
}, _callee17);
}));
return _device_info_table_info.apply(this, arguments);
}
function device_info_table_update(_x18) {
return _device_info_table_update.apply(this, arguments);
}
//设备信息列表编辑
function _device_info_table_update() {
_device_info_table_update = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee18(data) {
return _regeneratorRuntime().wrap(function _callee18$(_context18) {
while (1) switch (_context18.prev = _context18.next) {
case 0:
return _context18.abrupt("return", Fetch("/api/zz_classrooms/devices/".concat(data.id, ".json"), {
method: 'put',
body: _objectSpread({}, data)
}));
case 1:
case "end":
return _context18.stop();
}
}, _callee18);
}));
return _device_info_table_update.apply(this, arguments);
}
function device_info_table_add(_x19) {
return _device_info_table_add.apply(this, arguments);
}
//预约列表(预约管理, 预约审核)
function _device_info_table_add() {
_device_info_table_add = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee19(data) {
return _regeneratorRuntime().wrap(function _callee19$(_context19) {
while (1) switch (_context19.prev = _context19.next) {
case 0:
return _context19.abrupt("return", Fetch("/api/zz_classrooms/devices.json", {
method: 'post',
body: _objectSpread({}, data)
}));
case 1:
case "end":
return _context19.stop();
}
}, _callee19);
}));
return _device_info_table_add.apply(this, arguments);
}
function reservations_table_query(_x20) {
return _reservations_table_query.apply(this, arguments);
}
//取消预约
function _reservations_table_query() {
_reservations_table_query = asyncToGenerator_default()( /*#__PURE__*/regeneratorRuntime_default()().mark(function _callee20(params) {
return regeneratorRuntime_default()().wrap(function _callee20$(_context20) {
while (1) switch (_context20.prev = _context20.next) {
case 0:
return _context20.abrupt("return", (0,fetch/* default */.ZP)("/api/zz_classrooms/device_groups/".concat(params.device_id, "/reservations.json"), {
method: 'get',
params: objectSpread2_default()({}, params)
}));
case 1:
case "end":
return _context20.stop();
}
}, _callee20);
}));
return _reservations_table_query.apply(this, arguments);
}
function reservations_table_canceled(_x21) {
return _reservations_table_canceled.apply(this, arguments);
}
//预约设备详情
function _reservations_table_canceled() {
_reservations_table_canceled = asyncToGenerator_default()( /*#__PURE__*/regeneratorRuntime_default()().mark(function _callee21(params) {
return regeneratorRuntime_default()().wrap(function _callee21$(_context21) {
while (1) switch (_context21.prev = _context21.next) {
case 0:
return _context21.abrupt("return", (0,fetch/* default */.ZP)("/api/zz_classrooms/reservations/".concat(params, "/canceled.json"), {
method: 'get'
}));
case 1:
case "end":
return _context21.stop();
}
}, _callee21);
}));
return _reservations_table_canceled.apply(this, arguments);
}
function reservations_table_devices_info(_x22) {
return _reservations_table_devices_info.apply(this, arguments);
}
//设备找可预约的实训
function _reservations_table_devices_info() {
_reservations_table_devices_info = asyncToGenerator_default()( /*#__PURE__*/regeneratorRuntime_default()().mark(function _callee22(params) {
return regeneratorRuntime_default()().wrap(function _callee22$(_context22) {
while (1) switch (_context22.prev = _context22.next) {
case 0:
return _context22.abrupt("return", (0,fetch/* default */.ZP)("/api/zz_classrooms/reservations/get_shixun_devices.json", {
method: 'get',
params: objectSpread2_default()({}, params)
}));
case 1:
case "end":
return _context22.stop();
}
}, _callee22);
}));
return _reservations_table_devices_info.apply(this, arguments);
}
function reservations_table_devices_change_shixun(_x23) {
return _reservations_table_devices_change_shixun.apply(this, arguments);
}
//创建预约
function _reservations_table_devices_change_shixun() {
_reservations_table_devices_change_shixun = asyncToGenerator_default()( /*#__PURE__*/regeneratorRuntime_default()().mark(function _callee23(params) {
return regeneratorRuntime_default()().wrap(function _callee23$(_context23) {
while (1) switch (_context23.prev = _context23.next) {
case 0:
return _context23.abrupt("return", (0,fetch/* default */.ZP)("/api/zz_classrooms/reservations/can_reservation_shixuns.json", {
method: 'get',
params: objectSpread2_default()({}, params)
}));
case 1:
case "end":
return _context23.stop();
}
}, _callee23);
}));
return _reservations_table_devices_change_shixun.apply(this, arguments);
}
function reservations_table_add(_x24) {
return _reservations_table_add.apply(this, arguments);
}
// 编辑预约
function _reservations_table_add() {
_reservations_table_add = asyncToGenerator_default()( /*#__PURE__*/regeneratorRuntime_default()().mark(function _callee24(data) {
return regeneratorRuntime_default()().wrap(function _callee24$(_context24) {
while (1) switch (_context24.prev = _context24.next) {
case 0:
return _context24.abrupt("return", (0,fetch/* default */.ZP)("/api/zz_classrooms/reservations.json", {
method: 'post',
body: objectSpread2_default()({}, data)
}));
case 1:
case "end":
return _context24.stop();
}
}, _callee24);
}));
return _reservations_table_add.apply(this, arguments);
}
function reservations_table_update(_x25) {
return _reservations_table_update.apply(this, arguments);
}
//某一预约详情
function _reservations_table_update() {
_reservations_table_update = asyncToGenerator_default()( /*#__PURE__*/regeneratorRuntime_default()().mark(function _callee25(data) {
return regeneratorRuntime_default()().wrap(function _callee25$(_context25) {
while (1) switch (_context25.prev = _context25.next) {
case 0:
return _context25.abrupt("return", (0,fetch/* default */.ZP)("/api/zz_classrooms/reservations/".concat(data.id, ".json"), {
method: 'put',
body: objectSpread2_default()({}, data)
}));
case 1:
case "end":
return _context25.stop();
}
}, _callee25);
}));
return _reservations_table_update.apply(this, arguments);
}
function reservations_table_info(_x26) {
return _reservations_table_info.apply(this, arguments);
}
//批准or驳回预约
function _reservations_table_info() {
_reservations_table_info = asyncToGenerator_default()( /*#__PURE__*/regeneratorRuntime_default()().mark(function _callee26(params) {
return regeneratorRuntime_default()().wrap(function _callee26$(_context26) {
while (1) switch (_context26.prev = _context26.next) {
case 0:
return _context26.abrupt("return", (0,fetch/* default */.ZP)("/api/zz_classrooms/reservations/".concat(params, ".json"), {
method: 'get'
}));
case 1:
case "end":
return _context26.stop();
}
}, _callee26);
}));
return _reservations_table_info.apply(this, arguments);
}
function reservations_table_reviewed(_x27) {
return _reservations_table_reviewed.apply(this, arguments);
}
//每周设备预约数据
function _reservations_table_reviewed() {
_reservations_table_reviewed = asyncToGenerator_default()( /*#__PURE__*/regeneratorRuntime_default()().mark(function _callee27(params) {
return regeneratorRuntime_default()().wrap(function _callee27$(_context27) {
while (1) switch (_context27.prev = _context27.next) {
case 0:
return _context27.abrupt("return", (0,fetch/* default */.ZP)("/api/zz_classrooms/reservations/".concat(params.id, "/reviewed.json"), {
method: 'get',
params: objectSpread2_default()({}, params)
}));
case 1:
case "end":
return _context27.stop();
}
}, _callee27);
}));
return _reservations_table_reviewed.apply(this, arguments);
}
function reservations_table_week_query(_x28) {
return _reservations_table_week_query.apply(this, arguments);
}
//申请报废
function _reservations_table_week_query() {
_reservations_table_week_query = asyncToGenerator_default()( /*#__PURE__*/regeneratorRuntime_default()().mark(function _callee28(params) {
return regeneratorRuntime_default()().wrap(function _callee28$(_context28) {
while (1) switch (_context28.prev = _context28.next) {
case 0:
return _context28.abrupt("return", (0,fetch/* default */.ZP)("/api/zz_classrooms/device_groups/".concat(params.id, "/reservation_detail.json"), {
method: 'get',
params: objectSpread2_default()({}, params)
}));
case 1:
case "end":
return _context28.stop();
}
}, _callee28);
}));
return _reservations_table_week_query.apply(this, arguments);
}
function application_scrapped(_x29) {
return _application_scrapped.apply(this, arguments);
}
//设备报废详情
function _application_scrapped() {
_application_scrapped = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee29(data) {
return _regeneratorRuntime().wrap(function _callee29$(_context29) {
while (1) switch (_context29.prev = _context29.next) {
case 0:
return _context29.abrupt("return", Fetch("/api/zz_classrooms/devices/".concat(data.id, "/application_scrapped.json"), {
method: 'post',
body: _objectSpread({}, data)
}));
case 1:
case "end":
return _context29.stop();
}
}, _callee29);
}));
return _application_scrapped.apply(this, arguments);
}
function scrapped_data_info(_x30) {
return _scrapped_data_info.apply(this, arguments);
}
//设备类型支持的实验项目
function _scrapped_data_info() {
_scrapped_data_info = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee30(params) {
return _regeneratorRuntime().wrap(function _callee30$(_context30) {
while (1) switch (_context30.prev = _context30.next) {
case 0:
return _context30.abrupt("return", Fetch("/api/zz_classrooms/devices/".concat(params, "/scrapped_data.json"), {
method: 'get'
}));
case 1:
case "end":
return _context30.stop();
}
}, _callee30);
}));
return _scrapped_data_info.apply(this, arguments);
}
function support_shixuns_info(_x31) {
return _support_shixuns_info.apply(this, arguments);
}
//设备类型使用率
function _support_shixuns_info() {
_support_shixuns_info = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee31(params) {
return _regeneratorRuntime().wrap(function _callee31$(_context31) {
while (1) switch (_context31.prev = _context31.next) {
case 0:
return _context31.abrupt("return", Fetch("/api/zz_classrooms/device_types/".concat(params.id, "/support_shixuns.json"), {
method: 'get',
params: _objectSpread({}, params)
}));
case 1:
case "end":
return _context31.stop();
}
}, _callee31);
}));
return _support_shixuns_info.apply(this, arguments);
}
function used_rate(_x32) {
return _used_rate.apply(this, arguments);
}
//设备类型历史使用记录
function _used_rate() {
_used_rate = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee32(params) {
return _regeneratorRuntime().wrap(function _callee32$(_context32) {
while (1) switch (_context32.prev = _context32.next) {
case 0:
return _context32.abrupt("return", Fetch("/api/zz_classrooms/device_details/used_rate.json", {
method: 'get',
params: _objectSpread({}, params)
}));
case 1:
case "end":
return _context32.stop();
}
}, _callee32);
}));
return _used_rate.apply(this, arguments);
}
function shixun_use_type_records(_x33) {
return _shixun_use_type_records.apply(this, arguments);
}
//设备统计
function _shixun_use_type_records() {
_shixun_use_type_records = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee33(params) {
return _regeneratorRuntime().wrap(function _callee33$(_context33) {
while (1) switch (_context33.prev = _context33.next) {
case 0:
return _context33.abrupt("return", Fetch("/api/zz_classrooms/device_details/shixun_use_type_records.json", {
method: 'get',
params: _objectSpread({}, params)
}));
case 1:
case "end":
return _context33.stop();
}
}, _callee33);
}));
return _shixun_use_type_records.apply(this, arguments);
}
function device_statistics(_x34) {
return _device_statistics.apply(this, arguments);
}
//行为统计
function _device_statistics() {
_device_statistics = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee34(params) {
return _regeneratorRuntime().wrap(function _callee34$(_context34) {
while (1) switch (_context34.prev = _context34.next) {
case 0:
return _context34.abrupt("return", Fetch("/api/zz_classrooms/device_details/device_statistics.json", {
method: 'get',
params: _objectSpread({}, params)
}));
case 1:
case "end":
return _context34.stop();
}
}, _callee34);
}));
return _device_statistics.apply(this, arguments);
}
function behavior_statistics(_x35) {
return _behavior_statistics.apply(this, arguments);
}
//获取设备类型下所有设备数量与折旧率统计
function _behavior_statistics() {
_behavior_statistics = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee35(params) {
return _regeneratorRuntime().wrap(function _callee35$(_context35) {
while (1) switch (_context35.prev = _context35.next) {
case 0:
return _context35.abrupt("return", Fetch("/api/zz_classrooms/device_details/action_statistics.json", {
method: 'get',
params: _objectSpread({}, params)
}));
case 1:
case "end":
return _context35.stop();
}
}, _callee35);
}));
return _behavior_statistics.apply(this, arguments);
}
function procure_records_device_statistics(_x36) {
return _procure_records_device_statistics.apply(this, arguments);
}
function _procure_records_device_statistics() {
_procure_records_device_statistics = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee36(params) {
return _regeneratorRuntime().wrap(function _callee36$(_context36) {
while (1) switch (_context36.prev = _context36.next) {
case 0:
return _context36.abrupt("return", Fetch("/api/zz_classrooms/procure_records/device_statistics.json", {
method: 'get',
params: _objectSpread({}, params)
}));
case 1:
case "end":
return _context36.stop();
}
}, _callee36);
}));
return _procure_records_device_statistics.apply(this, arguments);
}
// EXTERNAL MODULE: ./src/styles/table_botton.less
var table_botton = __webpack_require__(743);
// 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/message/index.js + 4 modules
var message = __webpack_require__(8591);
// 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/date-picker/index.js + 66 modules
var date_picker = __webpack_require__(30518);
// 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/table/index.js + 85 modules
var table = __webpack_require__(51945);
// EXTERNAL MODULE: ./node_modules/_antd@5.9.0@antd/es/pagination/index.js + 10 modules
var pagination = __webpack_require__(86859);
// EXTERNAL MODULE: ./node_modules/_dayjs@1.11.13@dayjs/dayjs.min.js
var dayjs_min = __webpack_require__(61186);
var dayjs_min_default = /*#__PURE__*/__webpack_require__.n(dayjs_min);
;// CONCATENATED MODULE: ./src/pages/User/Detail/Devicegroup/ReservationInfo/ListDisplay/Dialog/index.less?modules
// extracted by mini-css-extract-plugin
/* harmony default export */ var Dialogmodules = ({"content":"content___cZONZ"});
// EXTERNAL MODULE: ./node_modules/_react@17.0.2@react/jsx-runtime.js
var jsx_runtime = __webpack_require__(37712);
;// CONCATENATED MODULE: ./src/pages/User/Detail/Devicegroup/ReservationInfo/ListDisplay/Dialog/index.tsx
// import { ModalForm } from '@ant-design/pro-components';
var InstructionsDialog = function InstructionsDialog(props) {
var _props$dataInfo;
var _useState = (0,_react_17_0_2_react.useState)(false),
_useState2 = slicedToArray_default()(_useState, 2),
isshow = _useState2[0],
setisshow = _useState2[1];
// 关联设备弹窗
return /*#__PURE__*/(0,jsx_runtime.jsxs)("div", {
children: [/*#__PURE__*/(0,jsx_runtime.jsx)("div", {
className: "yuyue_info",
onClick: function onClick() {
setisshow(true);
},
children: props.modalName
}), /*#__PURE__*/(0,jsx_runtime.jsx)(modal/* default */.Z, {
width: 400,
visible: isshow,
layout: "horizontal",
modalProps: {
centered: true
},
labelCol: {
flex: '90px'
} // 根据效果可以自己具体去控制大小
,
title: props.modalName,
cancelButtonProps: {
style: {
display: 'none'
}
},
autoFocusFirstInput: true,
onCancel: function onCancel() {
setisshow(false);
},
onOk: /*#__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:
setisshow(false);
case 1:
case "end":
return _context.stop();
}
}, _callee);
})),
children: /*#__PURE__*/(0,jsx_runtime.jsx)("div", {
className: Dialogmodules.content,
children: (props === null || props === void 0 || (_props$dataInfo = props.dataInfo) === null || _props$dataInfo === void 0 ? void 0 : _props$dataInfo.description) || '--'
})
})]
});
};
/* harmony default export */ var Dialog = (InstructionsDialog);
// EXTERNAL MODULE: ./src/.umi-production/exports.ts
var _umi_production_exports = __webpack_require__(80608);
;// CONCATENATED MODULE: ./src/pages/User/Detail/Devicegroup/ReservationInfo/ListDisplay/index.less?modules
// extracted by mini-css-extract-plugin
/* harmony default export */ var ListDisplaymodules = ({"title":"title___eYUGi","search_list":"search_list___R9qCB"});
// EXTERNAL MODULE: ./src/service/user.ts
var user = __webpack_require__(43764);
// EXTERNAL MODULE: ./node_modules/_antd@5.9.0@antd/es/button/index.js
var es_button = __webpack_require__(3113);
// 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/row/index.js
var row = __webpack_require__(95237);
// EXTERNAL MODULE: ./node_modules/_antd@5.9.0@antd/es/col/index.js
var col = __webpack_require__(43604);
;// CONCATENATED MODULE: ./src/pages/User/Detail/Devicegroup/ReservationInfo/Dialog/index.less?modules
// extracted by mini-css-extract-plugin
/* harmony default export */ var ReservationInfo_Dialogmodules = ({"check_style":"check_style___AbIfr","check_text_style":"check_text_style___UgSFP","check_text_style_active":"check_text_style_active___j34gW","check_text_style_disable":"check_text_style_disable___yNezb"});
;// CONCATENATED MODULE: ./src/pages/User/Detail/Devicegroup/ReservationInfo/Dialog/index.tsx
var TextArea = input/* default */.Z.TextArea;
var ReservationDialog = function ReservationDialog(props) {
var _props$dataInfo9, _props$dataInfo10;
// 关联设备弹窗
var _Form$useForm = es_form/* default */.Z.useForm(),
_Form$useForm2 = slicedToArray_default()(_Form$useForm, 1),
form = _Form$useForm2[0];
var defaultFormData = {
date: dayjs_min_default()()
};
var _useState = (0,_react_17_0_2_react.useState)([]),
_useState2 = slicedToArray_default()(_useState, 2),
devicesList = _useState2[0],
setDevicesList = _useState2[1];
var _useState3 = (0,_react_17_0_2_react.useState)([]),
_useState4 = slicedToArray_default()(_useState3, 2),
shixuns = _useState4[0],
setShixuns = _useState4[1];
var _useState5 = (0,_react_17_0_2_react.useState)([]),
_useState6 = slicedToArray_default()(_useState5, 2),
users = _useState6[0],
setUsers = _useState6[1];
var _useState7 = (0,_react_17_0_2_react.useState)([]),
_useState8 = slicedToArray_default()(_useState7, 2),
options = _useState8[0],
setOptions = _useState8[1];
var _useState9 = (0,_react_17_0_2_react.useState)(false),
_useState10 = slicedToArray_default()(_useState9, 2),
isopen = _useState10[0],
setisopen = _useState10[1];
var onOpenChange = function onOpenChange(flag) {
if (flag) {
var _props$dataInfo, _props$dataInfo2;
//预约设备
device_info_table_query({}).then(function (res) {
setDevicesList(res === null || res === void 0 ? void 0 : res.devices);
});
//实验项目
reservations_table_devices_change_shixun({
device_group_id: props === null || props === void 0 || (_props$dataInfo = props.dataInfo) === null || _props$dataInfo === void 0 ? void 0 : _props$dataInfo.id
}).then(function (res) {
var _res$reservation_shix;
var items = res === null || res === void 0 || (_res$reservation_shix = res.reservation_shixun) === null || _res$reservation_shix === void 0 ? void 0 : _res$reservation_shix.map(function (item) {
return {
label: item.name,
value: item.id
};
});
setShixuns(items);
});
//预约详情
if (props !== null && props !== void 0 && (_props$dataInfo2 = props.dataInfo) !== null && _props$dataInfo2 !== void 0 && _props$dataInfo2.reservations_id) {
var _props$dataInfo3;
reservations_table_info(props === null || props === void 0 || (_props$dataInfo3 = props.dataInfo) === null || _props$dataInfo3 === void 0 ? void 0 : _props$dataInfo3.reservations_id).then(function (res) {
form.setFieldsValue({
'classroom_name': res === null || res === void 0 ? void 0 : res.classroom_name,
'reservation_user_id': res === null || res === void 0 ? void 0 : res.reservation_user_id,
'shixun_id': res === null || res === void 0 ? void 0 : res.shixun_id,
'description': res === null || res === void 0 ? void 0 : res.description,
'phone': res === null || res === void 0 ? void 0 : res.phone
});
// console.log(res)
//改变时间
changeTime();
});
} else {
var _props$dataInfo4;
device_info_table_info(props === null || props === void 0 || (_props$dataInfo4 = props.dataInfo) === null || _props$dataInfo4 === void 0 ? void 0 : _props$dataInfo4.id).then(function (res) {
form.setFieldsValue({
'classroom_name': res === null || res === void 0 ? void 0 : res.classroom_name
});
});
//改变时间
changeTime();
}
//预约人
(0,user/* user_table_query */.bn)({}).then(function (res) {
var _res$data;
var items = res === null || res === void 0 || (_res$data = res.data) === null || _res$data === void 0 || (_res$data = _res$data.list) === null || _res$data === void 0 ? void 0 : _res$data.map(function (item) {
return {
label: item.real_name,
value: item.id
};
});
setUsers(items);
});
}
};
var changeTime = function changeTime() {
var _props$dataInfo5;
var params_info = {
device_id: '',
date: '',
reservation_user_id: '',
shixun_id: ''
};
if (props !== null && props !== void 0 && (_props$dataInfo5 = props.dataInfo) !== null && _props$dataInfo5 !== void 0 && _props$dataInfo5.reservations_id) {
var _props$dataInfo6, _form$getFieldValue;
//编辑
params_info.device_id = props === null || props === void 0 || (_props$dataInfo6 = props.dataInfo) === null || _props$dataInfo6 === void 0 ? void 0 : _props$dataInfo6.id, params_info.date = dayjs_min_default()((_form$getFieldValue = form.getFieldValue('date')) === null || _form$getFieldValue === void 0 ? void 0 : _form$getFieldValue.$d).format('YYYY-MM-DD'), params_info.reservation_user_id = form.getFieldValue('reservation_user_id') || '', params_info.shixun_id = form.getFieldValue('shixun_id') || '';
reservations_table_devices_info(params_info).then(function (res) {
var _res$device, _res$device12, _form$getFieldValue2;
defaultFormData.date = dayjs_min_default()(res === null || res === void 0 || (_res$device = res.device) === null || _res$device === void 0 ? void 0 : _res$device.date);
// form.setFieldValue('date', moment(res?.device?.date))
var obj = [];
var time_active = [];
for (var i in res === null || res === void 0 || (_res$device2 = res.device) === null || _res$device2 === void 0 ? void 0 : _res$device2.reservation_times) {
var _res$device2, _res$device3, _res$device4, _res$device5, _res$device6, _res$device7, _res$device8, _res$device9, _res$device10;
obj.push({
label: res === null || res === void 0 || (_res$device3 = res.device) === null || _res$device3 === void 0 ? void 0 : _res$device3.reservation_times[i].name,
value: res === null || res === void 0 || (_res$device4 = res.device) === null || _res$device4 === void 0 ? void 0 : _res$device4.reservation_times[i].id,
id: res === null || res === void 0 || (_res$device5 = res.device) === null || _res$device5 === void 0 ? void 0 : _res$device5.reservation_times[i].id,
is_check: !(res !== null && res !== void 0 && (_res$device6 = res.device) !== null && _res$device6 !== void 0 && _res$device6.reservation_times[i].can_reservation) && (res === null || res === void 0 || (_res$device7 = res.device) === null || _res$device7 === void 0 ? void 0 : _res$device7.reservation_times[i].is_person),
is_disable: !(res !== null && res !== void 0 && (_res$device8 = res.device) !== null && _res$device8 !== void 0 && _res$device8.reservation_times[i].is_person) && !(res !== null && res !== void 0 && (_res$device9 = res.device) !== null && _res$device9 !== void 0 && _res$device9.reservation_times[i].can_reservation)
});
if (res !== null && res !== void 0 && (_res$device10 = res.device) !== null && _res$device10 !== void 0 && _res$device10.reservation_times[i].is_person) {
var _res$device11;
time_active.push(res === null || res === void 0 || (_res$device11 = res.device) === null || _res$device11 === void 0 ? void 0 : _res$device11.reservation_times[i].id);
}
}
form.setFieldsValue({
'device_id': res === null || res === void 0 || (_res$device12 = res.device) === null || _res$device12 === void 0 ? void 0 : _res$device12.id,
'time_ids': time_active
});
// 判断是否为今天
var todayDate = new Date().setHours(0, 0, 0, 0);
var paramsDate = new Date("".concat(dayjs_min_default()((_form$getFieldValue2 = form.getFieldValue('date')) === null || _form$getFieldValue2 === void 0 ? void 0 : _form$getFieldValue2.$d).format('YYYY-MM-DD'))).setHours(0, 0, 0, 0);
var isToday = todayDate === paramsDate;
if (isToday) {
// 当前小时、分钟
var myDate = new Date(),
hours = myDate.getHours(),
minutes = myDate.getMinutes();
// 将小于当前的时间段过滤
obj.forEach(function (item) {
var h = item.label.slice(0, 1) == '0' ? item.label.slice(1, 2) : item.label.slice(0, 2);
var m = '';
if (item.label.slice(3, 5) == '00') {
m = '0';
} else if (item.label.slice(3, 4) == '0' && item.label.slice(4, 5) != '0') {
m = item.label.slice(4, 5);
} else {
m = item.label.slice(3, 5);
}
if (hours > Number(h) || hours == Number(h) && minutes > Number(m)) {
item.is_disable = true;
}
});
}
setOptions(obj);
});
} else {
// (params_info.device_id = props?.dataInfo?.id),
// (params_info.date = moment(form.getFieldValue('date')?.$d).format('YYYY-MM-DD'));
// (params_info.shixun_id = form.getFieldValue('shixun_id') || '');
}
};
var onChange = function onChange(checkedValues) {
if ((checkedValues === null || checkedValues === void 0 ? void 0 : checkedValues.length) > 2) {
message/* default */.ZP.error('最多只能选择2个时间段预约');
form.setFieldsValue({
'time_ids': [checkedValues[0], checkedValues[1]]
});
} else if ((checkedValues === null || checkedValues === void 0 ? void 0 : checkedValues.length) === 2) {
var a = 0;
var b = 0;
for (var i in options) {
if (options[i].value === checkedValues[0]) {
a = options[i].id;
}
if (options[i].value === checkedValues[1]) {
b = options[i].id;
}
}
if (a - b !== 1 && a - b !== -1) {
message/* default */.ZP.error('只能选择2个连续的时间段预约');
form.setFieldsValue({
'time_ids': [checkedValues[0]]
});
}
}
var obj = JSON.parse(JSON.stringify(options));
for (var _i in obj) {
if (form.getFieldValue('time_ids').length === 1) {
if (obj[_i].value === form.getFieldValue('time_ids')[0]) {
obj[_i].is_check = true;
} else {
obj[_i].is_check = false;
}
} else if (form.getFieldValue('time_ids').length === 2) {
if (obj[_i].value === form.getFieldValue('time_ids')[0] || obj[_i].value === form.getFieldValue('time_ids')[1]) {
obj[_i].is_check = true;
} else {
obj[_i].is_check = false;
}
} else {
obj[_i].is_check = false;
}
}
setOptions(obj);
};
var disabledDate = function disabledDate(time) {
return time > dayjs_min_default()().add(7 - new Date().getDay() + 7, 'd') || time < new Date(new Date().getTime() - 24 * 60 * 60 * 1000);
};
(0,_react_17_0_2_react.useEffect)(function () {
onOpenChange(isopen);
}, [isopen]);
return /*#__PURE__*/(0,jsx_runtime.jsxs)("div", {
children: [props.modalName === '增加' ? /*#__PURE__*/(0,jsx_runtime.jsxs)(es_button/* default */.ZP, {
onClick: function onClick() {
setisopen(true);
},
type: "primary",
children: [" ", props.modalName + '预约']
}) : props.modalName === '调整预约' ? /*#__PURE__*/(0,jsx_runtime.jsx)(es_button/* default */.ZP, {
onClick: function onClick() {
setisopen(true);
},
type: "primary",
children: props.modalName
}) : /*#__PURE__*/(0,jsx_runtime.jsxs)("div", {
className: "yuyue_update",
onClick: function onClick() {
setisopen(true);
},
children: [props.modalName, "\u9884\u7EA6"]
})
//
, /*#__PURE__*/(0,jsx_runtime.jsx)(modal/* default */.Z, {
width: 820,
visible: isopen,
title: props.modalName === '调整预约' ? props.modalName : props.modalName + '预约',
centered: true,
onCancel: function onCancel() {
setisopen(false);
},
onOk: function onOk() {
form.submit();
},
children: /*#__PURE__*/(0,jsx_runtime.jsxs)(es_form/* default */.Z, {
layout: "horizontal",
initialValues: defaultFormData
// onOpenChange={onOpenChange}
,
labelCol: {
flex: '90px'
} // 根据效果可以自己具体去控制大小
,
form: form,
onFinish: ( /*#__PURE__*/function () {
var _ref = asyncToGenerator_default()( /*#__PURE__*/regeneratorRuntime_default()().mark(function _callee(values) {
var _props$dataInfo7;
var _props$dataInfo8;
return regeneratorRuntime_default()().wrap(function _callee$(_context) {
while (1) switch (_context.prev = _context.next) {
case 0:
if (props !== null && props !== void 0 && (_props$dataInfo7 = props.dataInfo) !== null && _props$dataInfo7 !== void 0 && _props$dataInfo7.reservations_id) {
//编辑
reservations_table_update(objectSpread2_default()({
id: props === null || props === void 0 || (_props$dataInfo8 = props.dataInfo) === null || _props$dataInfo8 === void 0 ? void 0 : _props$dataInfo8.reservations_id
}, values)).then(function (res) {
if ((res === null || res === void 0 ? void 0 : res.status) === 0) {
message/* default */.ZP.success('编辑成功');
props === null || props === void 0 || props.queryData();
} else {
message/* default */.ZP.error(res === null || res === void 0 ? void 0 : res.message);
}
});
} else {
//新增
reservations_table_add(values).then(function (res) {
if ((res === null || res === void 0 ? void 0 : res.status) === 0) {
message/* default */.ZP.success('新增成功');
props === null || props === void 0 || props.queryData();
} else {
message/* default */.ZP.error(res === null || res === void 0 ? void 0 : res.message);
}
});
}
return _context.abrupt("return", true);
case 2:
case "end":
return _context.stop();
}
}, _callee);
}));
return function (_x) {
return _ref.apply(this, arguments);
};
}()),
children: [/*#__PURE__*/(0,jsx_runtime.jsx)(es_form/* default */.Z.Item, {
name: "shixun_id",
label: "\u5B9E\u9A8C\u9879\u76EE",
rules: [{
required: true
}],
style: {
marginTop: '-10px'
},
children: /*#__PURE__*/(0,jsx_runtime.jsx)(es_select["default"], {
disabled: props !== null && props !== void 0 && (_props$dataInfo9 = props.dataInfo) !== null && _props$dataInfo9 !== void 0 && _props$dataInfo9.reservations_id ? true : false,
onChange: function onChange() {
var _form$getFieldValue3;
var params_info = {
device_id: '',
date: '',
reservation_user_id: '',
shixun_id: ''
};
params_info.date = dayjs_min_default()((_form$getFieldValue3 = form.getFieldValue('date')) === null || _form$getFieldValue3 === void 0 ? void 0 : _form$getFieldValue3.$d).format('YYYY-MM-DD');
params_info.shixun_id = form.getFieldValue('shixun_id') || '';
reservations_table_devices_info(params_info).then(function (res) {
var _res$device13, _res$device24, _form$getFieldValue4;
defaultFormData.date = dayjs_min_default()(res === null || res === void 0 || (_res$device13 = res.device) === null || _res$device13 === void 0 ? void 0 : _res$device13.date);
// form.setFieldValue('date', moment(res?.device?.date))
var obj = [];
var time_active = [];
for (var i in res === null || res === void 0 || (_res$device14 = res.device) === null || _res$device14 === void 0 ? void 0 : _res$device14.reservation_times) {
var _res$device14, _res$device15, _res$device16, _res$device17, _res$device18, _res$device19, _res$device20, _res$device21, _res$device22;
obj.push({
label: res === null || res === void 0 || (_res$device15 = res.device) === null || _res$device15 === void 0 ? void 0 : _res$device15.reservation_times[i].name,
value: res === null || res === void 0 || (_res$device16 = res.device) === null || _res$device16 === void 0 ? void 0 : _res$device16.reservation_times[i].id,
id: res === null || res === void 0 || (_res$device17 = res.device) === null || _res$device17 === void 0 ? void 0 : _res$device17.reservation_times[i].id,
is_check: !(res !== null && res !== void 0 && (_res$device18 = res.device) !== null && _res$device18 !== void 0 && _res$device18.reservation_times[i].can_reservation) && (res === null || res === void 0 || (_res$device19 = res.device) === null || _res$device19 === void 0 ? void 0 : _res$device19.reservation_times[i].is_person),
is_disable: !(res !== null && res !== void 0 && (_res$device20 = res.device) !== null && _res$device20 !== void 0 && _res$device20.reservation_times[i].is_person) && !(res !== null && res !== void 0 && (_res$device21 = res.device) !== null && _res$device21 !== void 0 && _res$device21.reservation_times[i].can_reservation)
});
if (res !== null && res !== void 0 && (_res$device22 = res.device) !== null && _res$device22 !== void 0 && _res$device22.reservation_times[i].is_person) {
var _res$device23;
time_active.push(res === null || res === void 0 || (_res$device23 = res.device) === null || _res$device23 === void 0 ? void 0 : _res$device23.reservation_times[i].id);
}
}
form.setFieldsValue({
'device_id': res === null || res === void 0 || (_res$device24 = res.device) === null || _res$device24 === void 0 ? void 0 : _res$device24.id,
'time_ids': time_active
});
// 判断是否为今天
var todayDate = new Date().setHours(0, 0, 0, 0);
var paramsDate = new Date("".concat(dayjs_min_default()((_form$getFieldValue4 = form.getFieldValue('date')) === null || _form$getFieldValue4 === void 0 ? void 0 : _form$getFieldValue4.$d).format('YYYY-MM-DD'))).setHours(0, 0, 0, 0);
var isToday = todayDate === paramsDate;
if (isToday) {
// 当前小时、分钟
var myDate = new Date(),
hours = myDate.getHours(),
minutes = myDate.getMinutes();
// 将小于当前的时间段过滤
obj.forEach(function (item) {
var h = item.label.slice(0, 1) == '0' ? item.label.slice(1, 2) : item.label.slice(0, 2);
var m = '';
if (item.label.slice(3, 5) == '00') {
m = '0';
} else if (item.label.slice(3, 4) == '0' && item.label.slice(4, 5) != '0') {
m = item.label.slice(4, 5);
} else {
m = item.label.slice(3, 5);
}
if (hours > Number(h) || hours == Number(h) && minutes > Number(m)) {
item.is_disable = true;
}
});
}
setOptions(obj);
});
},
options: shixuns
// fieldNames={{ label: 'name', value: 'id' }}
})
}), /*#__PURE__*/(0,jsx_runtime.jsx)(es_form/* default */.Z.Item, {
name: "date",
label: "\u9884\u7EA6\u65E5\u671F",
rules: [{
required: true
}],
style: {
marginTop: '-10px'
},
children: /*#__PURE__*/(0,jsx_runtime.jsx)(date_picker["default"], {
disabledDate: disabledDate,
format: "YYYY-MM-DD",
onChange: changeTime,
allowClear: false
})
}), /*#__PURE__*/(0,jsx_runtime.jsx)(es_form/* default */.Z.Item, {
name: "time_ids",
label: "\u9884\u7EA6\u65F6\u95F4",
rules: [{
required: true
}],
style: {
marginTop: '-10px'
},
children: /*#__PURE__*/(0,jsx_runtime.jsx)(es_checkbox/* default */.Z.Group, {
style: {
width: '100%'
},
onChange: onChange,
children: /*#__PURE__*/(0,jsx_runtime.jsx)(row/* default */.Z, {
children: options.map(function (v, k) {
return /*#__PURE__*/(0,jsx_runtime.jsx)(col/* default */.Z, {
span: 6,
className: ReservationInfo_Dialogmodules.check_style,
children: /*#__PURE__*/(0,jsx_runtime.jsx)(es_checkbox/* default */.Z, {
style: {
display: 'inline-flex',
alignItems: 'center'
},
value: v.value,
disabled: v.is_disable,
children: /*#__PURE__*/(0,jsx_runtime.jsx)("div", {
className: v.is_check ? ReservationInfo_Dialogmodules.check_text_style_active : v.is_disable ? ReservationInfo_Dialogmodules.check_text_style_disable : ReservationInfo_Dialogmodules.check_text_style,
children: v.label
})
})
}, k);
})
})
})
}), /*#__PURE__*/(0,jsx_runtime.jsx)(es_form/* default */.Z.Item, {
name: "description",
label: "\u9884\u7EA6\u8BF4\u660E",
style: {
marginTop: '-10px'
},
children: /*#__PURE__*/(0,jsx_runtime.jsx)(TextArea, {
rows: 4
})
}), /*#__PURE__*/(0,jsx_runtime.jsx)(es_form/* default */.Z.Item, {
name: "reservation_user_id",
label: "\u9884\u7EA6\u4EBA",
style: {
marginTop: '-10px'
},
children: /*#__PURE__*/(0,jsx_runtime.jsx)(es_select["default"], {
disabled: props !== null && props !== void 0 && (_props$dataInfo10 = props.dataInfo) !== null && _props$dataInfo10 !== void 0 && _props$dataInfo10.reservations_id ? true : false,
options: users,
showSearch: true,
filterOption: function filterOption(input, option) {
var _option$real_name;
return ((_option$real_name = option === null || option === void 0 ? void 0 : option.real_name) !== null && _option$real_name !== void 0 ? _option$real_name : '').toLowerCase().includes(input.toLowerCase());
}
})
}), /*#__PURE__*/(0,jsx_runtime.jsx)(es_form/* default */.Z.Item, {
name: "phone",
label: "\u9884\u7EA6\u4EBA\u7535\u8BDD",
style: {
marginTop: '-10px'
},
rules: [{
required: true,
message: '请输入正确的手机号',
pattern: new RegExp(/^1(3|4|5|6|7|8|9)\d{9}$/, 'g')
}],
children: /*#__PURE__*/(0,jsx_runtime.jsx)(input/* default */.Z, {
suffix: " "
})
})]
})
})]
});
};
/* harmony default export */ var ReservationInfo_Dialog = (ReservationDialog);
;// CONCATENATED MODULE: ./src/pages/User/Detail/Devicegroup/ReservationInfo/ListDisplay/index.tsx
var ListDisplay_TextArea = input/* default */.Z.TextArea;
var Details = function Details(_ref) {
objectDestructuringEmpty_default()(_ref);
var _useState = (0,_react_17_0_2_react.useState)([]),
_useState2 = slicedToArray_default()(_useState, 2),
tableData = _useState2[0],
setTableData = _useState2[1];
var _useState3 = (0,_react_17_0_2_react.useState)(1),
_useState4 = slicedToArray_default()(_useState3, 2),
page = _useState4[0],
setPage = _useState4[1];
var _useState5 = (0,_react_17_0_2_react.useState)(10),
_useState6 = slicedToArray_default()(_useState5, 2),
limit = _useState6[0],
setLimit = _useState6[1];
var _useState7 = (0,_react_17_0_2_react.useState)(0),
_useState8 = slicedToArray_default()(_useState7, 2),
total = _useState8[0],
setTotal = _useState8[1];
var _useState9 = (0,_react_17_0_2_react.useState)([]),
_useState10 = slicedToArray_default()(_useState9, 2),
devicesList = _useState10[0],
setDevicesList = _useState10[1];
var _useState11 = (0,_react_17_0_2_react.useState)(false),
_useState12 = slicedToArray_default()(_useState11, 2),
lableDialog = _useState12[0],
setLableDialog = _useState12[1];
var _useState13 = (0,_react_17_0_2_react.useState)({}),
_useState14 = slicedToArray_default()(_useState13, 2),
box = _useState14[0],
setBox = _useState14[1];
var _useState15 = (0,_react_17_0_2_react.useState)([]),
_useState16 = slicedToArray_default()(_useState15, 2),
lists = _useState16[0],
setlists = _useState16[1];
var params = (0,_umi_production_exports.useParams)();
(0,_react_17_0_2_react.useEffect)(function () {
queryData();
sessionStorage.setItem('reservation_time', dayjs_min_default()(new Date()).format('YYYY-MM-DD'));
}, []);
(0,_react_17_0_2_react.useEffect)(function () {
getlist();
}, []);
function getlist() {
return _getlist.apply(this, arguments);
}
function _getlist() {
_getlist = asyncToGenerator_default()( /*#__PURE__*/regeneratorRuntime_default()().mark(function _callee() {
var _res$departments;
var res, map;
return regeneratorRuntime_default()().wrap(function _callee$(_context) {
while (1) switch (_context.prev = _context.next) {
case 0:
_context.next = 2;
return (0,fetch/* default */.ZP)("/api/departments.json", {
method: 'get'
});
case 2:
res = _context.sent;
map = [];
map = res === null || res === void 0 || (_res$departments = res.departments) === null || _res$departments === void 0 ? void 0 : _res$departments.map(function (item) {
return {
value: item.id,
label: item.name
};
});
setlists(map);
case 6:
case "end":
return _context.stop();
}
}, _callee);
}));
return _getlist.apply(this, arguments);
}
(0,_react_17_0_2_react.useEffect)(function () {
queryDevice();
queryData();
}, [page]);
var columns = [{
title: '序号',
key: 'index',
render: function render(text, record, index) {
return /*#__PURE__*/(0,jsx_runtime.jsx)("span", {
children: (page - 1) * limit + index + 1
});
}
}, {
title: '姓名',
key: 'user_name',
dataIndex: 'user_name'
}, {
title: '角色',
key: 'is_student',
dataIndex: 'is_student',
render: function render(text) {
return /*#__PURE__*/(0,jsx_runtime.jsx)("span", {
children: text ? '学生' : '教师'
});
}
}, {
title: '学院',
key: 'department',
dataIndex: 'department'
}, {
title: '实验项目',
key: 'shixun_name',
dataIndex: 'shixun_name'
}, {
title: '实验课程',
key: '',
dataIndex: ''
}, {
title: '排队状态',
key: 'status',
dataIndex: 'status',
render: function render(text) {
return /*#__PURE__*/(0,jsx_runtime.jsx)("span", {
children: text === 'reviewing' ? '待审核' : text === 'waiting' ? '等待' : text === 'running' ? '运行' : text === 'completed' ? '完成' : text === 'rejected' ? '驳回' : text === 'approved' ? '已批准' : ''
});
}
}, {
title: '预约时间',
key: 'reservation_times',
dataIndex: 'reservation_times',
render: function render(text) {
return text === null || text === void 0 ? void 0 : text.map(function (v, k) {
return /*#__PURE__*/(0,jsx_runtime.jsx)("span", {
children: (v === null || v === void 0 ? void 0 : v.name) + ' '
}, k);
});
}
}, {
title: '前方人数',
key: 'waiting_number',
dataIndex: 'waiting_number'
}, {
title: '预估等待(分)',
key: 'waiting_time',
dataIndex: 'waiting_time'
}, {
title: '操作',
key: 'cz',
render: function render(text, record) {
return /*#__PURE__*/(0,jsx_runtime.jsxs)(jsx_runtime.Fragment, {
children: [(text === null || text === void 0 ? void 0 : text.status) === 'waiting' && /*#__PURE__*/(0,jsx_runtime.jsx)("div", {
className: "yuyue_clear",
onClick: function onClick() {
cancelReservation(record);
},
children: "\u53D6\u6D88\u9884\u7EA6"
}), (text === null || text === void 0 ? void 0 : text.status) === 'waiting' &&
/*#__PURE__*/
// 123
(0,jsx_runtime.jsx)(ReservationInfo_Dialog, {
modalName: "\u8C03\u6574",
dataInfo: {
time: sessionStorage.getItem('reservation_time'),
id: params === null || params === void 0 ? void 0 : params.id,
reservations_id: text === null || text === void 0 ? void 0 : text.id
},
queryData: queryData
}), (text === null || text === void 0 ? void 0 : text.status) === 'reviewing' && /*#__PURE__*/(0,jsx_runtime.jsx)("div", {
className: "update",
onClick: function onClick() {
reviewed(record, true, '');
},
children: "\u6279\u51C6"
}), (text === null || text === void 0 ? void 0 : text.status) === 'reviewing' && /*#__PURE__*/(0,jsx_runtime.jsx)("div", {
className: "xiajia",
onClick: function onClick() {
setBox(text), setLableDialog(true);
},
children: "\u9A73\u56DE"
}), /*#__PURE__*/(0,jsx_runtime.jsx)(Dialog, {
modalName: "\u9884\u7EA6\u8BF4\u660E",
dataInfo: record
})]
});
}
}];
var onChange = function onChange(pageNumber) {
setPage(pageNumber);
};
var queryDevice = function queryDevice() {
device_info_table_query({}).then(function (res) {
setDevicesList([{
id: '',
name: '全部'
}].concat(toConsumableArray_default()(res === null || res === void 0 ? void 0 : res.devices)));
});
};
var reviewed = function reviewed(box, flag, rejected_reason) {
reservations_table_reviewed({
id: box === null || box === void 0 ? void 0 : box.id,
status: flag,
rejected_reason: rejected_reason
}).then(function (res) {
if ((res === null || res === void 0 ? void 0 : res.status) === 0) {
if (flag) {
message/* default */.ZP.success('批准成功');
} else {
message/* default */.ZP.success('驳回成功');
}
queryData();
} else {
message/* default */.ZP.error(res === null || res === void 0 ? void 0 : res.message);
}
});
};
var queryData = function queryData() {
reservations_table_query({
page: page,
limit: limit,
date: form.getFieldValue('date') ? dayjs_min_default()(form.getFieldValue('date')).format('YYYY-MM-DD') : '',
device_id: params === null || params === void 0 ? void 0 : params.id,
department_id: form.getFieldValue('department_id'),
// device_id: form.getFieldValue('device_id'),
role: form.getFieldValue('role'),
status: form.getFieldValue('status')
}).then(function (res) {
setTableData(res === null || res === void 0 ? void 0 : res.list);
setTotal(res === null || res === void 0 ? void 0 : res.count);
});
};
var onShowSizeChange = function onShowSizeChange(current, pageSize) {
setLimit(pageSize);
queryData();
};
var cancelReservation = function cancelReservation(data) {
modal/* default */.Z.confirm({
title: '取消预约',
icon: null,
centered: true,
content: '取消该用户预约任务,建议先联系该用户,取消后用户可收到预约变动信息',
okText: '确认',
cancelText: '取消',
onOk: function onOk() {
reservations_table_canceled(data === null || data === void 0 ? void 0 : data.id).then(function (res) {
if ((res === null || res === void 0 ? void 0 : res.status) === 0) {
message/* default */.ZP.success('取消预约成功');
queryData();
} else {
message/* default */.ZP.error(res === null || res === void 0 ? void 0 : res.message);
}
});
}
});
};
var defaultFormData = {
device_id: '',
date: '',
// date: moment(),
role: '',
status: '',
department_id: ''
};
var _Form$useForm = es_form/* default */.Z.useForm(),
_Form$useForm2 = slicedToArray_default()(_Form$useForm, 1),
form = _Form$useForm2[0];
var disabledDate = function disabledDate(time) {
return time > dayjs_min_default()().add(7 - new Date().getDay() + 7, 'd');
};
return /*#__PURE__*/(0,jsx_runtime.jsxs)("div", {
children: [/*#__PURE__*/(0,jsx_runtime.jsxs)(es_form/* default */.Z, {
initialValues: defaultFormData,
form: form,
layout: "inline",
autoComplete: "off",
className: ListDisplaymodules.search_list,
children: [/*#__PURE__*/(0,jsx_runtime.jsx)(es_form/* default */.Z.Item, {
label: "\u9884\u7EA6\u65F6\u95F4",
name: "date",
children: /*#__PURE__*/(0,jsx_runtime.jsx)(date_picker["default"], {
disabledDate: disabledDate,
onChange: queryData,
allowClear: true,
format: "YYYY-MM-DD"
})
}), /*#__PURE__*/(0,jsx_runtime.jsx)(es_form/* default */.Z.Item, {
label: "\u6392\u961F\u72B6\u6001",
name: "status",
children: /*#__PURE__*/(0,jsx_runtime.jsx)(es_select["default"], {
onChange: queryData,
allowClear: true,
style: {
width: '120px'
},
options: [{
value: '',
label: '全部'
}, {
value: 'reviewing',
label: '待审核'
}, {
value: 'waiting',
label: '等待'
}, {
value: 'running',
label: '运行'
}, {
value: 'completed',
label: '完成'
}, {
value: 'rejected',
label: '驳回'
}, {
value: 'approved',
label: '已批准'
}]
})
}), /*#__PURE__*/(0,jsx_runtime.jsx)(es_form/* default */.Z.Item, {
label: "\u89D2\u8272",
name: "role",
children: /*#__PURE__*/(0,jsx_runtime.jsx)(es_select["default"], {
onChange: queryData,
allowClear: true,
style: {
width: '120px'
},
options: [{
value: '',
label: '全部'
}, {
value: 'student',
label: '学生'
}, {
value: 'teacher',
label: '教师'
}]
})
}), /*#__PURE__*/(0,jsx_runtime.jsx)(es_form/* default */.Z.Item, {
label: "\u90E8\u95E8",
name: "department_id",
children: /*#__PURE__*/(0,jsx_runtime.jsx)(es_select["default"], {
onChange: queryData,
allowClear: true,
style: {
width: '120px'
},
options: [{
value: '',
label: '全部'
}].concat(toConsumableArray_default()(lists))
})
})]
}), /*#__PURE__*/(0,jsx_runtime.jsx)(table/* default */.Z, {
columns: columns,
pagination: false,
dataSource: tableData,
rowKey: function rowKey(record) {
return record.id;
}
}), total > limit && /*#__PURE__*/(0,jsx_runtime.jsx)(pagination/* default */.Z, {
showQuickJumper: true,
current: page,
pageSize: limit,
total: total,
onChange: onChange,
className: ListDisplaymodules.page_style,
onShowSizeChange: onShowSizeChange
}), /*#__PURE__*/(0,jsx_runtime.jsx)(modal/* default */.Z, {
title: "\u9A73\u56DE",
width: 400,
open: lableDialog,
onOk: function onOk() {
setLableDialog(false);
reviewed(box, false, form.getFieldValue('rejected_reason'));
// box.submit();
},
onCancel: function onCancel() {
setLableDialog(false);
},
maskClosable: false,
centered: true,
children: /*#__PURE__*/(0,jsx_runtime.jsx)(es_form/* default */.Z, {
form: form,
layout: "inline",
autoComplete: "off",
children: /*#__PURE__*/(0,jsx_runtime.jsx)(es_form/* default */.Z.Item, {
name: "rejected_reason",
rules: [{
required: true
}],
children: /*#__PURE__*/(0,jsx_runtime.jsx)(ListDisplay_TextArea, {
placeholder: "\u8BF7\u8F93\u5165\u9A73\u56DE\u7406\u7531\uFF0C\u9884\u7EA6\u4EBA\u5C06\u6536\u5230\u9884\u7EA6\u5931\u8D25\u7684\u6D88\u606F\u901A\u77E5",
rows: 8,
cols: 38
})
})
})
})]
});
};
/* harmony default export */ var ListDisplay = (Details);
// EXTERNAL MODULE: ./node_modules/_antd@5.9.0@antd/es/radio/index.js + 5 modules
var es_radio = __webpack_require__(5112);
;// CONCATENATED MODULE: ./src/pages/User/Detail/Devicegroup/ReservationInfo/ImageDisplay/index.less
// extracted by mini-css-extract-plugin
;// CONCATENATED MODULE: ./src/pages/User/Detail/Devicegroup/ReservationInfo/ImageDisplay/index.less?modules
// extracted by mini-css-extract-plugin
/* harmony default export */ var ImageDisplaymodules = ({"all":"all___Tzpnr","search_list":"search_list___Ode40","top":"top___ELtmC","top_text":"top_text___yYO6Y","top_date_week":"top_date_week___A3G7a","top_text_date":"top_text_date___liDmW","top_text_week":"top_text_week___jtYgM","content":"content___B1lI7","top_text_title":"top_text_title___XqHMs","top_text_time":"top_text_time___F1U0h","tck":"tck___U93bT","legend":"legend___etD0z","legend_one_color":"legend_one_color___apkbt","legend_two_color":"legend_two_color___dIZrj","legend_three_color":"legend_three_color___okK98","legend_four_color":"legend_four_color___Yagpy","legend_text":"legend_text___UMF86","row_style":"row_style___tLNX3","col_title":"col_title___TOcNn","col_content":"col_content___Cmy4P","box_blue":"box_blue___oW6B4","box_green":"box_green___WQYGm","box_gray":"box_gray___vLMv3","box_white":"box_white___lUpMR","content_info":"content_info___HzsxT","week_data":"week_data___Fh8tF","week_data_list":"week_data_list___A1rzU","week_data_list_label":"week_data_list_label___lIipC","week_data_list_value":"week_data_list_value___mUoFd","week_nodata":"week_nodata___CcmRA"});
// EXTERNAL MODULE: ./src/utils/util.tsx
var util = __webpack_require__(27876);
;// CONCATENATED MODULE: ./src/pages/User/Detail/Devicegroup/ReservationInfo/ImageDisplay/index.tsx
var ImageDisplay_TextArea = input/* default */.Z.TextArea;
var DeviceLabelPage = function DeviceLabelPage(_ref) {
objectDestructuringEmpty_default()(_ref);
var params = (0,_umi_production_exports.useParams)();
var _useState = (0,_react_17_0_2_react.useState)([]),
_useState2 = slicedToArray_default()(_useState, 2),
weekData = _useState2[0],
setWeekData = _useState2[1];
var defaultFormData = {
yysj: 'a'
};
var _useState3 = (0,_react_17_0_2_react.useState)([{
date: '',
week: ''
}]),
_useState4 = slicedToArray_default()(_useState3, 2),
week = _useState4[0],
setWeek = _useState4[1];
var _useState5 = (0,_react_17_0_2_react.useState)({}),
_useState6 = slicedToArray_default()(_useState5, 2),
reservationInfo = _useState6[0],
setReservationInfo = _useState6[1];
var _useState7 = (0,_react_17_0_2_react.useState)(dayjs_min_default()().weekday(0).format('YYYY/MM/DD')),
_useState8 = slicedToArray_default()(_useState7, 2),
startTime = _useState8[0],
setStartTime = _useState8[1];
var _useState9 = (0,_react_17_0_2_react.useState)(dayjs_min_default()().weekday(6).format('YYYY/MM/DD')),
_useState10 = slicedToArray_default()(_useState9, 2),
endTime = _useState10[0],
setEndTime = _useState10[1];
var _useState11 = (0,_react_17_0_2_react.useState)(false),
_useState12 = slicedToArray_default()(_useState11, 2),
isModalOpen = _useState12[0],
setIsModalOpen = _useState12[1];
var _useState13 = (0,_react_17_0_2_react.useState)(false),
_useState14 = slicedToArray_default()(_useState13, 2),
lableDialog = _useState14[0],
setLableDialog = _useState14[1];
var _useState15 = (0,_react_17_0_2_react.useState)({}),
_useState16 = slicedToArray_default()(_useState15, 2),
reviewedData = _useState16[0],
setReviewedData = _useState16[1];
var _useState17 = (0,_react_17_0_2_react.useState)(),
_useState18 = slicedToArray_default()(_useState17, 2),
datatime = _useState18[0],
setdatatime = _useState18[1];
var _Form$useForm = es_form/* default */.Z.useForm(),
_Form$useForm2 = slicedToArray_default()(_Form$useForm, 1),
form = _Form$useForm2[0];
(0,_react_17_0_2_react.useEffect)(function () {
setWeek([{
date: dayjs_min_default()().weekday(0).format('MM-DD'),
week: '周一'
}, {
date: dayjs_min_default()().weekday(1).format('MM-DD'),
week: '周二'
}, {
date: dayjs_min_default()().weekday(2).format('MM-DD'),
week: '周三'
}, {
date: dayjs_min_default()().weekday(3).format('MM-DD'),
week: '周四'
}, {
date: dayjs_min_default()().weekday(4).format('MM-DD'),
week: '周五'
}, {
date: dayjs_min_default()().weekday(5).format('MM-DD'),
week: '周六'
}, {
date: dayjs_min_default()().weekday(6).format('MM-DD'),
week: '周日'
}]);
changeRadio('a');
}, []);
var changeRadio = function changeRadio(e) {
if (e === 'a') {
setStartTime(dayjs_min_default()().weekday(0).format('YYYY/MM/DD'));
setEndTime(dayjs_min_default()().weekday(6).format('YYYY/MM/DD'));
setWeek([{
date: dayjs_min_default()().weekday(0).format('MM-DD'),
week: '周一'
}, {
date: dayjs_min_default()().weekday(1).format('MM-DD'),
week: '周二'
}, {
date: dayjs_min_default()().weekday(2).format('MM-DD'),
week: '周三'
}, {
date: dayjs_min_default()().weekday(3).format('MM-DD'),
week: '周四'
}, {
date: dayjs_min_default()().weekday(4).format('MM-DD'),
week: '周五'
}, {
date: dayjs_min_default()().weekday(5).format('MM-DD'),
week: '周六'
}, {
date: dayjs_min_default()().weekday(6).format('MM-DD'),
week: '周日'
}]);
} else if (e === 'b') {
setStartTime(dayjs_min_default()().subtract(new Date().getDay() + 6, 'd').format('YYYY/MM/DD'));
setEndTime(dayjs_min_default()().subtract(new Date().getDay() + 0, 'd').format('YYYY/MM/DD'));
setWeek([{
date: dayjs_min_default()().subtract(new Date().getDay() + 6, 'd').format('MM-DD'),
week: '周一'
}, {
date: dayjs_min_default()().subtract(new Date().getDay() + 5, 'd').format('MM-DD'),
week: '周二'
}, {
date: dayjs_min_default()().subtract(new Date().getDay() + 4, 'd').format('MM-DD'),
week: '周三'
}, {
date: dayjs_min_default()().subtract(new Date().getDay() + 3, 'd').format('MM-DD'),
week: '周四'
}, {
date: dayjs_min_default()().subtract(new Date().getDay() + 2, 'd').format('MM-DD'),
week: '周五'
}, {
date: dayjs_min_default()().subtract(new Date().getDay() + 1, 'd').format('MM-DD'),
week: '周六'
}, {
date: dayjs_min_default()().subtract(new Date().getDay() + 0, 'd').format('MM-DD'),
week: '周日'
}]);
} else if (e === 'c') {
setStartTime(dayjs_min_default()().add(7 - new Date().getDay() + 1, 'd').format('YYYY/MM/DD'));
setEndTime(dayjs_min_default()().add(7 - new Date().getDay() + 7, 'd').format('YYYY/MM/DD'));
setWeek([{
date: dayjs_min_default()().add(7 - new Date().getDay() + 1, 'd').format('MM-DD'),
week: '周一'
}, {
date: dayjs_min_default()().add(7 - new Date().getDay() + 2, 'd').format('MM-DD'),
week: '周二'
}, {
date: dayjs_min_default()().add(7 - new Date().getDay() + 3, 'd').format('MM-DD'),
week: '周三'
}, {
date: dayjs_min_default()().add(7 - new Date().getDay() + 4, 'd').format('MM-DD'),
week: '周四'
}, {
date: dayjs_min_default()().add(7 - new Date().getDay() + 5, 'd').format('MM-DD'),
week: '周五'
}, {
date: dayjs_min_default()().add(7 - new Date().getDay() + 6, 'd').format('MM-DD'),
week: '周六'
}, {
date: dayjs_min_default()().add(7 - new Date().getDay() + 7, 'd').format('MM-DD'),
week: '周日'
}]);
}
};
(0,_react_17_0_2_react.useEffect)(function () {
queryData();
}, [startTime]);
var handleCancel = function handleCancel() {
setIsModalOpen(false);
};
var queryData = function queryData() {
reservations_table_week_query({
id: params === null || params === void 0 ? void 0 : params.id,
start_time: startTime,
// data: startTime,
end_time: endTime
}).then(function (res) {
var obj = [];
for (var i = 0; i < (res === null || res === void 0 || (_res$device_reservati = res.device_reservations[0].reservations) === null || _res$device_reservati === void 0 ? void 0 : _res$device_reservati.length); i++) {
var _res$device_reservati;
obj.push([res === null || res === void 0 ? void 0 : res.device_reservations[0].reservations[i], res === null || res === void 0 ? void 0 : res.device_reservations[1].reservations[i], res === null || res === void 0 ? void 0 : res.device_reservations[2].reservations[i], res === null || res === void 0 ? void 0 : res.device_reservations[3].reservations[i], res === null || res === void 0 ? void 0 : res.device_reservations[4].reservations[i], res === null || res === void 0 ? void 0 : res.device_reservations[5].reservations[i], res === null || res === void 0 ? void 0 : res.device_reservations[6].reservations[i]]);
}
setdatatime(res === null || res === void 0 ? void 0 : res.device_reservations[0].reservations);
setWeekData(obj);
});
};
var cancelReservation = function cancelReservation(data) {
modal/* default */.Z.confirm({
title: '取消预约',
icon: null,
centered: true,
content: '取消该用户预约任务,建议先联系该用户,取消后用户可收到预约变动信息',
okText: '确认',
cancelText: '取消',
onOk: function onOk() {
var _data$reservation_use;
reservations_table_canceled(data === null || data === void 0 || (_data$reservation_use = data.reservation_user) === null || _data$reservation_use === void 0 ? void 0 : _data$reservation_use.id).then(function (res) {
if ((res === null || res === void 0 ? void 0 : res.status) === 0) {
message/* default */.ZP.success('取消预约成功');
setIsModalOpen(false);
queryData();
} else {
message/* default */.ZP.error(res === null || res === void 0 ? void 0 : res.message);
}
});
}
});
};
var reviewed = function reviewed(box, flag, rejected_reason) {
var _box$reservation_user;
reservations_table_reviewed({
id: box === null || box === void 0 || (_box$reservation_user = box.reservation_user) === null || _box$reservation_user === void 0 ? void 0 : _box$reservation_user.id,
status: flag,
rejected_reason: rejected_reason
}).then(function (res) {
if ((res === null || res === void 0 ? void 0 : res.status) === 0) {
if (flag) {
message/* default */.ZP.success('批准成功');
} else {
message/* default */.ZP.success('驳回成功');
}
queryData();
setIsModalOpen(false);
} else {
message/* default */.ZP.error(res === null || res === void 0 ? void 0 : res.message);
}
});
};
var openModel = function openModel(box) {
if (box !== null && box !== void 0 && box.reservation_user) {
var _box$reservation_user2, _box$reservation_user3, _box$reservation_user5;
if ((box === null || box === void 0 || (_box$reservation_user2 = box.reservation_user) === null || _box$reservation_user2 === void 0 ? void 0 : _box$reservation_user2.status) === 'reviewing') {
setFooterButton([/*#__PURE__*/(0,jsx_runtime.jsx)(es_button/* default */.ZP, {
style: {
marginRight: 10
},
onClick: function onClick() {
setReviewedData(box), setLableDialog(true);
},
children: "\u9A73\u56DE"
}, "back"), /*#__PURE__*/(0,jsx_runtime.jsx)(es_button/* default */.ZP, {
type: "primary",
onClick: function onClick() {
reviewed(box, true, '');
},
children: "\u6279\u51C6"
}, "submit")]);
} else if ((box === null || box === void 0 || (_box$reservation_user3 = box.reservation_user) === null || _box$reservation_user3 === void 0 ? void 0 : _box$reservation_user3.status) === 'waiting') {
var _box$reservation_user4;
setFooterButton([/*#__PURE__*/(0,jsx_runtime.jsx)(es_button/* default */.ZP, {
style: {
marginRight: 10
},
onClick: function onClick() {
return cancelReservation(box);
},
children: "\u53D6\u6D88\u9884\u7EA6"
}, "back"), /*#__PURE__*/(0,jsx_runtime.jsx)(ReservationInfo_Dialog, {
modalName: "\u8C03\u6574\u9884\u7EA6",
dataInfo: {
time: sessionStorage.getItem('reservation_time'),
id: params === null || params === void 0 ? void 0 : params.id,
reservations_id: box === null || box === void 0 || (_box$reservation_user4 = box.reservation_user) === null || _box$reservation_user4 === void 0 ? void 0 : _box$reservation_user4.id
},
queryData: queryData
}, 1)]);
} else {
setFooterButton([]);
}
setIsModalOpen(true);
reservations_table_info(box === null || box === void 0 || (_box$reservation_user5 = box.reservation_user) === null || _box$reservation_user5 === void 0 ? void 0 : _box$reservation_user5.id).then(function (res) {
setReservationInfo(res);
});
}
};
var _useState19 = (0,_react_17_0_2_react.useState)([/*#__PURE__*/(0,jsx_runtime.jsx)(es_button/* default */.ZP, {
style: {
marginRight: 10
}
}, "back"), /*#__PURE__*/(0,jsx_runtime.jsx)(es_button/* default */.ZP, {
type: "primary"
}, "submit")]),
_useState20 = slicedToArray_default()(_useState19, 2),
footerButton = _useState20[0],
setFooterButton = _useState20[1];
return /*#__PURE__*/(0,jsx_runtime.jsxs)("div", {
className: ImageDisplaymodules.all,
children: [/*#__PURE__*/(0,jsx_runtime.jsxs)(es_form/* default */.Z, {
initialValues: defaultFormData,
form: form,
layout: "inline",
autoComplete: "off",
className: ImageDisplaymodules.search_list,
children: [/*#__PURE__*/(0,jsx_runtime.jsx)(es_form/* default */.Z.Item, {
name: "yysj",
children: /*#__PURE__*/(0,jsx_runtime.jsxs)(es_radio/* default.Group */.ZP.Group, {
buttonStyle: "solid",
onChange: function onChange(v) {
changeRadio(v.target.value);
},
children: [/*#__PURE__*/(0,jsx_runtime.jsx)(es_radio/* default.Button */.ZP.Button, {
value: "a",
children: "\u672C\u5468"
}), /*#__PURE__*/(0,jsx_runtime.jsx)(es_radio/* default.Button */.ZP.Button, {
value: "b",
children: "\u4E0A\u5468"
}), /*#__PURE__*/(0,jsx_runtime.jsx)(es_radio/* default.Button */.ZP.Button, {
value: "c",
children: "\u4E0B\u5468"
})]
})
}), /*#__PURE__*/(0,jsx_runtime.jsxs)(es_form/* default */.Z.Item, {
style: {
height: '40px',
lineHeight: '40px'
},
children: [startTime, " \u81F3 ", endTime]
}), /*#__PURE__*/(0,jsx_runtime.jsx)(es_form/* default */.Z.Item, {
style: {
marginLeft: 'auto'
},
children: /*#__PURE__*/(0,jsx_runtime.jsxs)("div", {
style: {
display: 'flex'
},
children: [/*#__PURE__*/(0,jsx_runtime.jsxs)("div", {
className: ImageDisplaymodules.legend,
children: [/*#__PURE__*/(0,jsx_runtime.jsx)("div", {
className: ImageDisplaymodules.legend_one_color
}), /*#__PURE__*/(0,jsx_runtime.jsx)("span", {
className: ImageDisplaymodules.legend_text,
children: "\u53EF\u9884\u7EA6"
})]
}), /*#__PURE__*/(0,jsx_runtime.jsxs)("div", {
className: ImageDisplaymodules.legend,
children: [/*#__PURE__*/(0,jsx_runtime.jsx)("div", {
className: ImageDisplaymodules.legend_two_color
}), /*#__PURE__*/(0,jsx_runtime.jsx)("span", {
className: ImageDisplaymodules.legend_text,
children: "\u5DF2\u8FC7\u671F"
})]
}), /*#__PURE__*/(0,jsx_runtime.jsxs)("div", {
className: ImageDisplaymodules.legend,
children: [/*#__PURE__*/(0,jsx_runtime.jsx)("div", {
className: ImageDisplaymodules.legend_three_color
}), /*#__PURE__*/(0,jsx_runtime.jsx)("span", {
className: ImageDisplaymodules.legend_text,
children: "\u5DF2\u9884\u7EA6"
})]
}), /*#__PURE__*/(0,jsx_runtime.jsxs)("div", {
className: ImageDisplaymodules.legend,
children: [/*#__PURE__*/(0,jsx_runtime.jsx)("div", {
className: ImageDisplaymodules.legend_four_color
}), /*#__PURE__*/(0,jsx_runtime.jsx)("span", {
className: ImageDisplaymodules.legend_text,
children: "\u5F85\u5BA1\u6838"
})]
})]
})
})]
}), /*#__PURE__*/(0,jsx_runtime.jsx)("div", {
className: ImageDisplaymodules.top,
children: /*#__PURE__*/(0,jsx_runtime.jsxs)(row/* default */.Z, {
children: [/*#__PURE__*/(0,jsx_runtime.jsx)(col/* default */.Z, {
span: 3,
className: ImageDisplaymodules.top_text
}), week.map(function (v, k) {
return /*#__PURE__*/(0,jsx_runtime.jsxs)(col/* default */.Z, {
span: 3,
className: ImageDisplaymodules.top_date_week,
children: [/*#__PURE__*/(0,jsx_runtime.jsx)("div", {
className: ImageDisplaymodules.top_text_date,
children: v.date
}), /*#__PURE__*/(0,jsx_runtime.jsx)("div", {
className: ImageDisplaymodules.top_text_week,
children: v.week
})]
}, k);
})]
})
}), /*#__PURE__*/(0,jsx_runtime.jsx)("div", {
className: ImageDisplaymodules.content,
children: /*#__PURE__*/(0,jsx_runtime.jsxs)(row/* default */.Z, {
children: [/*#__PURE__*/(0,jsx_runtime.jsx)(col/* default */.Z, {
span: 3,
children: datatime === null || datatime === void 0 ? void 0 : datatime.map(function (item, index) {
return /*#__PURE__*/(0,jsx_runtime.jsxs)("div", {
className: ImageDisplaymodules.top_text,
children: [/*#__PURE__*/(0,jsx_runtime.jsxs)("div", {
className: ImageDisplaymodules.top_text_title,
children: ["\u7B2C", (0,util/* toChinesNum */.OU)(index + 1), "\u8282"]
}), /*#__PURE__*/(0,jsx_runtime.jsx)("div", {
className: ImageDisplaymodules.top_text_time,
children: item === null || item === void 0 ? void 0 : item.time_name
})]
});
})
}), /*#__PURE__*/(0,jsx_runtime.jsx)(col/* default */.Z, {
span: 21,
children: weekData.map(function (item_1, k_1) {
return /*#__PURE__*/(0,jsx_runtime.jsx)("div", {
children: item_1.map(function (v, k) {
var _v$reservation_user, _v$reservation_user2, _v$reservation_user3, _v$reservation_user4, _v$reservation_user5, _v$reservation_user6, _v$reservation_user7, _v$reservation_user8, _v$reservation_user9, _v$reservation_user10, _v$reservation_user11, _v$reservation_user12, _v$reservation_user13, _v$reservation_user14, _v$reservation_user15, _v$reservation_user16, _v$reservation_user17, _v$reservation_user18, _v$reservation_user19, _v$reservation_user20;
return /*#__PURE__*/(0,jsx_runtime.jsxs)("div", {
className: (v === null || v === void 0 ? void 0 : v.status) === 'expired' ? 'content_info box_gray' : (v === null || v === void 0 || (_v$reservation_user = v.reservation_user) === null || _v$reservation_user === void 0 ? void 0 : _v$reservation_user.status) === 'reviewing' ? 'content_info box_blue' : (v === null || v === void 0 || (_v$reservation_user2 = v.reservation_user) === null || _v$reservation_user2 === void 0 ? void 0 : _v$reservation_user2.status) === 'waiting' ? 'content_info box_green' : (v === null || v === void 0 || (_v$reservation_user3 = v.reservation_user) === null || _v$reservation_user3 === void 0 ? void 0 : _v$reservation_user3.status) === 'running' ? 'content_info box_gray' : (v === null || v === void 0 || (_v$reservation_user4 = v.reservation_user) === null || _v$reservation_user4 === void 0 ? void 0 : _v$reservation_user4.status) === 'completed' ? 'content_info box_gray' : (v === null || v === void 0 || (_v$reservation_user5 = v.reservation_user) === null || _v$reservation_user5 === void 0 ? void 0 : _v$reservation_user5.status) === 'rejected' ? 'content_info box_gray' : (v === null || v === void 0 || (_v$reservation_user6 = v.reservation_user) === null || _v$reservation_user6 === void 0 ? void 0 : _v$reservation_user6.status) === 'approved' ? 'content_info box_gray' : 'content_info',
onClick: function onClick() {
openModel(v);
},
children: [((v === null || v === void 0 || (_v$reservation_user7 = v.reservation_user) === null || _v$reservation_user7 === void 0 ? void 0 : _v$reservation_user7.status) === 'reviewing' || (v === null || v === void 0 || (_v$reservation_user8 = v.reservation_user) === null || _v$reservation_user8 === void 0 ? void 0 : _v$reservation_user8.status) === 'waiting' || (v === null || v === void 0 || (_v$reservation_user9 = v.reservation_user) === null || _v$reservation_user9 === void 0 ? void 0 : _v$reservation_user9.status) === 'running' || (v === null || v === void 0 || (_v$reservation_user10 = v.reservation_user) === null || _v$reservation_user10 === void 0 ? void 0 : _v$reservation_user10.status) === 'completed' || (v === null || v === void 0 || (_v$reservation_user11 = v.reservation_user) === null || _v$reservation_user11 === void 0 ? void 0 : _v$reservation_user11.status) === 'rejected' || (v === null || v === void 0 || (_v$reservation_user12 = v.reservation_user) === null || _v$reservation_user12 === void 0 ? void 0 : _v$reservation_user12.status) === 'approved') && /*#__PURE__*/(0,jsx_runtime.jsxs)("div", {
className: ImageDisplaymodules.week_data,
children: [/*#__PURE__*/(0,jsx_runtime.jsxs)("div", {
className: ImageDisplaymodules.week_data_list,
children: [/*#__PURE__*/(0,jsx_runtime.jsx)("div", {
className: ImageDisplaymodules.week_data_list_label,
children: "\u5B66\u751F"
}), /*#__PURE__*/(0,jsx_runtime.jsx)("div", {
className: ImageDisplaymodules.week_data_list_value,
children: v === null || v === void 0 || (_v$reservation_user13 = v.reservation_user) === null || _v$reservation_user13 === void 0 ? void 0 : _v$reservation_user13.name
})]
}), /*#__PURE__*/(0,jsx_runtime.jsxs)("div", {
className: ImageDisplaymodules.week_data_list,
children: [/*#__PURE__*/(0,jsx_runtime.jsx)("div", {
className: ImageDisplaymodules.week_data_list_label,
children: "\u5B66\u53F7"
}), /*#__PURE__*/(0,jsx_runtime.jsx)("div", {
className: ImageDisplaymodules.week_data_list_value,
children: (v === null || v === void 0 || (_v$reservation_user14 = v.reservation_user) === null || _v$reservation_user14 === void 0 ? void 0 : _v$reservation_user14.number) || '--'
})]
})]
}), (v === null || v === void 0 ? void 0 : v.status) === 'expired' && /*#__PURE__*/(0,jsx_runtime.jsx)("div", {
style: {
color: '#fff'
},
children: "\u5DF2\u8FC7\u671F"
}), (v === null || v === void 0 || (_v$reservation_user15 = v.reservation_user) === null || _v$reservation_user15 === void 0 ? void 0 : _v$reservation_user15.status) !== 'reviewing' && (v === null || v === void 0 ? void 0 : v.status) !== 'expired' && (v === null || v === void 0 || (_v$reservation_user16 = v.reservation_user) === null || _v$reservation_user16 === void 0 ? void 0 : _v$reservation_user16.status) !== 'waiting' && (v === null || v === void 0 || (_v$reservation_user17 = v.reservation_user) === null || _v$reservation_user17 === void 0 ? void 0 : _v$reservation_user17.status) !== 'running' && (v === null || v === void 0 || (_v$reservation_user18 = v.reservation_user) === null || _v$reservation_user18 === void 0 ? void 0 : _v$reservation_user18.status) !== 'completed' && (v === null || v === void 0 || (_v$reservation_user19 = v.reservation_user) === null || _v$reservation_user19 === void 0 ? void 0 : _v$reservation_user19.status) !== 'rejected' && (v === null || v === void 0 || (_v$reservation_user20 = v.reservation_user) === null || _v$reservation_user20 === void 0 ? void 0 : _v$reservation_user20.status) !== 'approved' && /*#__PURE__*/(0,jsx_runtime.jsx)("div", {
className: ImageDisplaymodules.week_nodata,
children: "\u53EF\u9884\u7EA6"
})]
}, k);
})
}, k_1);
})
})]
})
}), /*#__PURE__*/(0,jsx_runtime.jsx)(modal/* default */.Z, {
title: "",
visible: isModalOpen,
onCancel: handleCancel,
width: 400,
centered: true
// footer={false}
,
footer: /*#__PURE__*/(0,jsx_runtime.jsx)("div", {
style: {
display: 'flex',
justifyContent: 'end'
},
children: footerButton
}),
children: /*#__PURE__*/(0,jsx_runtime.jsxs)(row/* default */.Z, {
gutter: 24,
className: ImageDisplaymodules.row_style,
children: [/*#__PURE__*/(0,jsx_runtime.jsx)(col/* default */.Z, {
span: 7,
className: ImageDisplaymodules.col_title,
style: {
marginLeft: '-10px'
},
children: "\u59D3\u540D\uFF1A"
}), /*#__PURE__*/(0,jsx_runtime.jsx)(col/* default */.Z, {
span: 17,
className: ImageDisplaymodules.col_content,
children: reservationInfo === null || reservationInfo === void 0 ? void 0 : reservationInfo.user_name
}), /*#__PURE__*/(0,jsx_runtime.jsx)(col/* default */.Z, {
span: 7,
className: ImageDisplaymodules.col_title,
style: {
marginLeft: '-10px'
},
children: "\u5B66\u9662\uFF1A"
}), /*#__PURE__*/(0,jsx_runtime.jsx)(col/* default */.Z, {
span: 17,
className: ImageDisplaymodules.col_content,
children: reservationInfo === null || reservationInfo === void 0 ? void 0 : reservationInfo.department
}), /*#__PURE__*/(0,jsx_runtime.jsx)(col/* default */.Z, {
span: 7,
className: ImageDisplaymodules.col_title,
style: {
marginLeft: '-10px'
},
children: "\u89D2\u8272\uFF1A"
}), /*#__PURE__*/(0,jsx_runtime.jsx)(col/* default */.Z, {
span: 17,
className: ImageDisplaymodules.col_content,
children: reservationInfo !== null && reservationInfo !== void 0 && reservationInfo.is_student ? '学生' : '教师'
}), /*#__PURE__*/(0,jsx_runtime.jsx)(col/* default */.Z, {
span: 7,
className: ImageDisplaymodules.col_title,
style: {
marginLeft: '-10px'
},
children: "\u5B9E\u9A8C\u8BFE\u7A0B\uFF1A"
}), /*#__PURE__*/(0,jsx_runtime.jsx)(col/* default */.Z, {
span: 17,
className: ImageDisplaymodules.col_content,
children: "--"
}), /*#__PURE__*/(0,jsx_runtime.jsx)(col/* default */.Z, {
span: 7,
className: ImageDisplaymodules.col_title,
style: {
marginLeft: '-10px'
},
children: "\u5B9E\u9A8C\u9879\u76EE\uFF1A"
}), /*#__PURE__*/(0,jsx_runtime.jsx)(col/* default */.Z, {
span: 17,
className: ImageDisplaymodules.col_content,
children: reservationInfo === null || reservationInfo === void 0 ? void 0 : reservationInfo.shixun_name
}), /*#__PURE__*/(0,jsx_runtime.jsx)(col/* default */.Z, {
span: 7,
className: ImageDisplaymodules.col_title,
style: {
marginLeft: '-10px'
},
children: "\u9884\u7EA6\u8BF4\u660E\uFF1A"
}), /*#__PURE__*/(0,jsx_runtime.jsx)(col/* default */.Z, {
span: 17,
className: ImageDisplaymodules.col_content,
children: reservationInfo === null || reservationInfo === void 0 ? void 0 : reservationInfo.description
})]
})
}), /*#__PURE__*/(0,jsx_runtime.jsx)(modal/* default */.Z, {
title: "\u9A73\u56DE",
width: 400,
visible: lableDialog,
onOk: function onOk() {
setLableDialog(false);
reviewed(reviewedData, false, form.getFieldValue('rejected_reason'));
},
onCancel: function onCancel() {
setLableDialog(false);
},
maskClosable: false,
centered: true,
children: /*#__PURE__*/(0,jsx_runtime.jsx)(es_form/* default */.Z, {
form: form,
layout: "inline",
autoComplete: "off",
children: /*#__PURE__*/(0,jsx_runtime.jsx)(es_form/* default */.Z.Item, {
name: "rejected_reason",
rules: [{
required: true
}],
children: /*#__PURE__*/(0,jsx_runtime.jsx)(ImageDisplay_TextArea, {
placeholder: "\u8BF7\u8F93\u5165\u9A73\u56DE\u7406\u7531\uFF0C\u9884\u7EA6\u4EBA\u5C06\u6536\u5230\u9884\u7EA6\u5931\u8D25\u7684\u6D88\u606F\u901A\u77E5",
rows: 8,
cols: 38
})
})
})
})]
});
};
/* harmony default export */ var ImageDisplay = (DeviceLabelPage);
// EXTERNAL MODULE: ./src/assets/img/list_active.png
var list_active = __webpack_require__(15217);
// EXTERNAL MODULE: ./src/assets/img/list_noactive.png
var list_noactive = __webpack_require__(60852);
// EXTERNAL MODULE: ./src/assets/img/img_active.png
var img_active = __webpack_require__(25067);
// EXTERNAL MODULE: ./src/assets/img/img_noactive.png
var img_noactive = __webpack_require__(89641);
;// CONCATENATED MODULE: ./src/pages/User/Detail/Devicegroup/ReservationInfo/index.less?modules
// extracted by mini-css-extract-plugin
/* harmony default export */ var ReservationInfomodules = ({"title":"title___m5WIP","search_list":"search_list___NVDZ0","add_label":"add_label___Ro1uh","change_button":"change_button___wQN5c","button_no":"button_no___osOeU","button_active":"button_active___YeGfe"});
;// CONCATENATED MODULE: ./src/pages/User/Detail/Devicegroup/ReservationInfo/index.less
// extracted by mini-css-extract-plugin
// EXTERNAL MODULE: ./node_modules/_@ant-design_icons@5.4.0@@ant-design/icons/es/icons/LeftOutlined.js + 1 modules
var LeftOutlined = __webpack_require__(40578);
;// CONCATENATED MODULE: ./src/pages/User/Detail/Devicegroup/ReservationInfo/index.tsx
var ReservationInfo_Details = function Details(props) {
var _useState = (0,_react_17_0_2_react.useState)('a'),
_useState2 = slicedToArray_default()(_useState, 2),
type = _useState2[0],
setType = _useState2[1];
var params = (0,_umi_production_exports.useParams)();
var _useState3 = (0,_react_17_0_2_react.useState)(''),
_useState4 = slicedToArray_default()(_useState3, 2),
name = _useState4[0],
setName = _useState4[1];
var _useState5 = (0,_react_17_0_2_react.useState)(''),
_useState6 = slicedToArray_default()(_useState5, 2),
key = _useState6[0],
seKey = _useState6[1];
var queryData = function queryData() {
seKey(new Date().toString());
};
(0,_react_17_0_2_react.useEffect)(function () {
device_info_table_info(params === null || params === void 0 ? void 0 : params.id).then(function (res) {
var _res$device_group;
setName(res === null || res === void 0 || (_res$device_group = res.device_group) === null || _res$device_group === void 0 ? void 0 : _res$device_group.name);
});
}, []);
return /*#__PURE__*/(0,jsx_runtime.jsxs)("div", {
style: {
maxWidth: 1200,
margin: '0px auto',
background: '#fff',
padding: 20
},
children: [/*#__PURE__*/(0,jsx_runtime.jsxs)("div", {
children: [/*#__PURE__*/(0,jsx_runtime.jsx)(LeftOutlined/* default */.Z, {
onClick: function onClick() {
history.back();
}
}), /*#__PURE__*/(0,jsx_runtime.jsx)("span", {
style: {
marginLeft: 10
},
children: "\u8FD4\u56DE\u4E0A\u4E00\u9875"
})]
}), /*#__PURE__*/(0,jsx_runtime.jsxs)("div", {
className: ReservationInfomodules.title,
children: [/*#__PURE__*/(0,jsx_runtime.jsx)("span", {
children: name
}), /*#__PURE__*/(0,jsx_runtime.jsx)("img", {
src: device_type
})]
}), /*#__PURE__*/(0,jsx_runtime.jsxs)(es_form/* default */.Z, {
layout: "inline",
autoComplete: "off",
className: ReservationInfomodules.search_list,
children: [/*#__PURE__*/(0,jsx_runtime.jsx)(es_form/* default */.Z.Item, {
label: "\u5C55\u793A",
name: "zs",
children: /*#__PURE__*/(0,jsx_runtime.jsx)("div", {
className: "change_button",
children: type === 'a' ? /*#__PURE__*/(0,jsx_runtime.jsxs)("div", {
style: {
display: 'flex'
},
children: [/*#__PURE__*/(0,jsx_runtime.jsx)("div", {
className: "button_active",
children: /*#__PURE__*/(0,jsx_runtime.jsx)("img", {
src: list_active
})
}), /*#__PURE__*/(0,jsx_runtime.jsx)("div", {
className: "button_no",
onClick: function onClick() {
setType('b');
},
children: /*#__PURE__*/(0,jsx_runtime.jsx)("img", {
src: img_noactive
})
})]
}) : /*#__PURE__*/(0,jsx_runtime.jsxs)("div", {
style: {
display: 'flex'
},
children: [/*#__PURE__*/(0,jsx_runtime.jsx)("div", {
className: "button_no",
onClick: function onClick() {
setType('a');
},
children: /*#__PURE__*/(0,jsx_runtime.jsx)("img", {
src: list_noactive
})
}), /*#__PURE__*/(0,jsx_runtime.jsx)("div", {
className: "button_active",
children: /*#__PURE__*/(0,jsx_runtime.jsx)("img", {
src: img_active
})
})]
})
})
}), /*#__PURE__*/(0,jsx_runtime.jsx)("div", {
className: ReservationInfomodules.add_label,
children: /*#__PURE__*/(0,jsx_runtime.jsx)(ReservationInfo_Dialog, {
modalName: "\u589E\u52A0",
queryData: queryData,
dataInfo: {
time: sessionStorage.getItem('reservation_time'),
id: params === null || params === void 0 ? void 0 : params.id
}
})
})]
}), type === 'a' ? /*#__PURE__*/(0,jsx_runtime.jsx)(ListDisplay, {}, key) : /*#__PURE__*/(0,jsx_runtime.jsx)(ImageDisplay, {}, key)]
});
};
/* harmony default export */ var ReservationInfo = (ReservationInfo_Details);
/***/ }),
/***/ 743:
/*!**************************************!*\
!*** ./src/styles/table_botton.less ***!
\**************************************/
/***/ (function() {
// extracted by mini-css-extract-plugin
/***/ }),
/***/ 49842:
/*!****************************************!*\
!*** ./src/assets/img/device_type.png ***!
\****************************************/
/***/ (function(module) {
module.exports = "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAEIAAAAUCAYAAAA5g+sCAAAAAXNSR0IArs4c6QAACFNJREFUWEfdWGtwVdUV/r61z70hoFDCQ8GqpYZHcXxUWxAzpCitVNpaChgrM1aQ8I5SmrEDYjCjMRDGINAZKAMDKaIdwToE6hRKq8AMCMpzWkLtOLzKVFuIDQiUm5tzdmftc87NTQiP/uXM3Dnn7nP22Xt961trfevQvFbyKARLKexJMCAZUMKzEQn/AzpmSfFJ6Jh1Z5FA3PM6JoGAAaK5blzHRMcQ0NKKoa9zaK0VPet6QvcOnadjANwcXTcc1zXC+foeI8YHrRXq3sJ1da6J/oOIrhnQSCAWFynyH4o9YWn/0rEu56/riop8tDoo1dNOkOyZASACQ0y0EbchCXSBaKNqhE/ASgSAAwIhKBkg1Bgdi4BQkBRAZ7Az9gpARM5oDYRb3xkfzddrZ6wCGgKTDQRgrbsv4gO0RvdHnvKY+P3GO0cfysaCUj3VoeqAiNkABgqEeizejPOQe7Hxw2s4D4WMiIyOrhF5M2QEQm9HQDhgIiCg79d3OAP1GfVu8zvd2vqsUdAUaGsRed4B2SYjwnFntFCZ4xgU22ic85x92zb2eWIT1DkAmoGI6BjTNQwNh2BohIk3q4DBUuhLHCLuvnGeVlCygQjZovd1U/R1YTXYselyodEWI6J5jhFxKEZAhM6IGSGBcUwJQzN0MNQGGzo6BMI5idy+oV/RppZAxIyIztmhEU2KPB/FtWOEMiY0/pLQaCtH6HPGhZVuIgqTNnJEayBs6NFMjkCUYzLsCI11zzACImaECwudrywxLYAImYG3ansX1WmOuCQsMskyRtp5OkpK+lLgWXheRwHGUsSz8MeKNT4TnqOZHjlKt4QJaUcZSKIU4BcijU/lNKEhnZM7XURutODi7FiV3HZuTkcA6aCxF0yiTIS+A9oggKV1XhVzIJ1jF3Spz01e6NS4WOjWaZEjHIsdCCFQbQFhDE8n9ttftZ0jIo+4OHNxHCXLkE6K6gHaoJySKCPRl0ZOU72kHgqzvA3nxVmfN5BIWBs8f+zxsq191s8fDNpKkuf0F1YJTXRh2NAolRV4aU9hUoA6Ic9C0JX0/mXE6rFn1+ApWwdvX9nNJoMxpAl0XA0HDIywv8sRmtj13VFoxDkiZJAyhIEl344Y4R6OYihMkhpjarSrGHHCspobsEws34YnGvPPkeIJcRo0Vlxy0oTmSmVYJZwHeYsQ+ULvXTLYA+EDQn4HkDwHlq4TVZOwXLoxa4S++9+YnrL3+zM+G/jBr0cHSfkUSCPdvv2xA98c16BAmBx7u7JImuyp9wuKjw/buSIv3c6rENDX3HW5HBEXBwEPNoeGi/Nr0hFNDZ1yv46i8sauNbPXCOwf/0v73pdPz63vubr8NivB/Z6Ixr+FngF4lEILDBExLx0ZNfO9fu9W9vE9b5nx/XEdvLx/t67pwGduyObm/QTkyH3124tQtM4fsHXJqxS5w1UBz3t516AJhws+XD4S5I9CHcH12waM2zhkz6p+hvJsdmjofRslSxcioR4KdYzIqZahkQXGFXTE0TMTqgbpRrutnLUTIolTqdsexKRJ6R5vzlkIcJirOGQtILuMYLg1/DbB3cdGz56q8/Jr5/1CwBFCntTkpiyiyN8PDS99Re/fu3nREgg9kF1Jfr5/aImbN2Db0hoAuWpEU0om7/3epDMFu1eUSID7XUjCLt06cPyeh/fVFNLyibZ0RHbVaBaPKrqqp50h2eH/0BGbG4rn/Qxry5Ndzjd+QmLx6bGVr3df/sJNkpt4XwhRqhui+h9Plq+89Z2KbwlcOJ2kSMWRUbM+zv9d1WPi4ZctdAS4pe4HpXPv3LQgz1DWZBQn5aP9Q0sq7v1g1VeSvLA8BA5ndxVOmaDgFOxcUQlBD/W4n7BlO+4b/88hH/9mtBE8dCUdkSmtrvJpbntt2t8ozI8rxVV1BLGkobjq5W6rXuxtEfzBs3bQ58/MPdVj9ZwZICY36whZdvLJOYt7rX2lbwC+pTrCMnjq+Miyw33WV00FMSZbR1hhzeHhpavv2rLgLgZSFQNhaTccGDp9xd2bl3bPacdZWh1AHNs9ePIivRq8c0UZACNGznc/fkO1yuche2umabK8mo7IhIaTANXT1pD8aYYRV9ER1trSsxPnv5lXM/MRBjKi/plKR9ueb7zY18LrYImLSeKil2hXf6Ro5pmvrq24xQg2aK/Q3qaH1BWVn8uvraoUoDBWnC45Gr5a92jpn+/ZsnCYDTA9ixEHExYL2Rik41xS3zs/9Wnv4SmUl0vBd2/tEI8nOt9omfryDuubYiOUuGpcSUeE66gAqy55HMRvW/QacdPVho4A7WNni+d/1HXlC/cBGEPaWvFMZ0K6ALaL0HShQZ4QFyjePoC5AjuJhvVHR81+RDfdp3beGwB7ZRgh9H3PFn8y7Pmjd29eOB7EqEzTpRWotY4g1+0unPzOAx8u/4axmJnd+LVuuq6mIzJAYNnEhHc+eQjk17I7T32gLR1hpbH/2fGdGjrXpAoMjDGwFwORlDFNqaDJpBKel/KTqVRjY07q5iSCC5IosLCVtDh4bHRTMdb1Z37yyJ+ETIA8YYiXgpzc836TPefZ9M0JT+YQzGvuSqPuM6vXEGLxrsIpOx7csfxhEk+HOqSNpusadYRjhHrIvF4yguDaFqy4rI4QP5TUTlNEiaa5+8zkiGvoPjOi62o6ImrDXQPnElu0bkZWx58Mwu4zavbsNeuIGAhX6xc+N5fAjOvte0QcGlfUEdlAaOJJdv6iAuDPozY1VnjX1feItnREJjSylV1y0YwfC20FDW+/nr9HZOsIQza4HHHJsWxiIjfd4YcUDid5D8mbRCQ3823iOvke4ZgvtsEzpvZ/yrSzxm4KAN0AAAAASUVORK5CYII=";
/***/ }),
/***/ 25067:
/*!***************************************!*\
!*** ./src/assets/img/img_active.png ***!
\***************************************/
/***/ (function(module) {
module.exports = "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABgAAAAYCAYAAADgdz34AAAAAXNSR0IArs4c6QAAANlJREFUSEvtVsENwjAMPJMp6Bh0ANQ//1YMwJPCBJQNiNgBhT8DdIF0DJiiNUokKiGhpAmIV/w+5+yzzwrNZNUwcIAneECBvWotTK5zoM99OYDQRLJiPxAAoeWtKsIIgDiCU7kCIZtSWCLwqpQk+p1EBByHWjX2xZA1NU42OUxYusoZTfYCGTdzP3e2IKgjb49fAv5AcK4y9LxwFkrigfqi3zBmDq4wOfaEyXIzSQXGHbvrLfjYRRGEbFEi8M0vbshpBp91FXo0W5hE078gI4Fx/8BuJ9sqhX4CtMSW9DDTSW4AAAAASUVORK5CYII=";
/***/ }),
/***/ 89641:
/*!*****************************************!*\
!*** ./src/assets/img/img_noactive.png ***!
\*****************************************/
/***/ (function(module) {
module.exports = "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABgAAAAYCAYAAADgdz34AAAAAXNSR0IArs4c6QAAAOpJREFUSEvtVkEOgjAQ3OWgfEGeIQ8wnJAEMWL8gt8QX+MJDYREufEBfIZ+QS+tWWMTT90W4629draznZ1pimV1LgBxB8wSKKPNIukIdmraUAgIuRrPgx7L+iI5IO0jQJdn88iG4F03hOBYt6kECIwacwScTG4GnELmNgUp9+tlUtCJdjalJFMgEGe6dlTIFIbSLAVMdDVP+bgie8cfAf8nOFRVMEZ/qmsUPbiv0rj/xtAcuJrPW9RuTVRAgFuexc2Ax86ewM5FtSPQTxBLJxHjcWOJ6IegwmZlU5sviCKg9I/Q1yaZLkZNvQAkBMgFQgWkbgAAAABJRU5ErkJggg==";
/***/ }),
/***/ 15217:
/*!****************************************!*\
!*** ./src/assets/img/list_active.png ***!
\****************************************/
/***/ (function(module) {
module.exports = "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABgAAAAYCAYAAADgdz34AAAAAXNSR0IArs4c6QAAAO9JREFUSEvNls0NgzAMhV8yCZsUtsiRCVoxQekEiA16zBgZJZMkVUKhOdU/qlC5xubD9vMjxq5uzsAdxJMTBkw+1LDF9daip3JSQjBmdZkKrOcGIV/9IAHUNCVgtBYd58O0gM5ajBRA3yLqzc25roJTAIujZzD5qKuAL1M14PcqMsAj3fz83gM+oGxyScoGl2+zO5ZsD1pc2WRqDsEIBKEKPQGwyY0yrngY3adF1CbH6kX7DKj6U0KBPMVmpwTIVSSsgGt2Udei7adDSRQoVqFqEVVu66b/CeCbXdC1iAmQ7kFobhV8mUquIA2AK9PwAhfnp8lCFm2pAAAAAElFTkSuQmCC";
/***/ }),
/***/ 60852:
/*!******************************************!*\
!*** ./src/assets/img/list_noactive.png ***!
\******************************************/
/***/ (function(module) {
module.exports = "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABgAAAAYCAYAAADgdz34AAAAAXNSR0IArs4c6QAAAQVJREFUSEu9lUESgjAMRRO8CDcRdnYhDjLuuYl4E/cOw4iLuuQoXMTWSaEzrEgbB7ttwkt+8wO2T90A4hWYY9Dml6MaKOzx0lliIGNzEhiw7d+WC6R7BBjOxSGPAbg8CaDtdQ0W0qDCJICu06lJoOYARioR9+HlvUiivwBIJg5UlmoUdRA6poAgA2wyRWDtrTqphmSJA5CTyRCI+zVNvcl8jJOJ8ULygQG5h/r1fnuAc+VufXEZhNEvOt+Re4eVQznTLprfgJUCYawKdY9fdgKAaIpiOghddpPRBB1QMeGrQghgO54DxB1sCghddtMPRyBRKCDKB1SNN1vUmIZWswSEjinlfAEP+MKLSF3ngwAAAABJRU5ErkJggg==";
/***/ })
}]);