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.
731 lines
31 KiB
731 lines
31 KiB
"use strict";
|
|
(self["webpackChunk"] = self["webpackChunk"] || []).push([[74297],{
|
|
|
|
/***/ 38506:
|
|
/*!*******************************************************************!*\
|
|
!*** ./src/pages/Laboratory/LaboratoryRoom/index.tsx + 1 modules ***!
|
|
\*******************************************************************/
|
|
/***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) {
|
|
|
|
// ESM COMPAT FLAG
|
|
__webpack_require__.r(__webpack_exports__);
|
|
|
|
// EXPORTS
|
|
__webpack_require__.d(__webpack_exports__, {
|
|
"default": function() { return /* binding */ LaboratoryRoom; }
|
|
});
|
|
|
|
// EXTERNAL MODULE: ./node_modules/_@babel_runtime@7.23.6@@babel/runtime/helpers/objectSpread2.js
|
|
var objectSpread2 = __webpack_require__(82242);
|
|
var objectSpread2_default = /*#__PURE__*/__webpack_require__.n(objectSpread2);
|
|
// EXTERNAL MODULE: ./node_modules/_@babel_runtime@7.23.6@@babel/runtime/helpers/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/regeneratorRuntime.js
|
|
var regeneratorRuntime = __webpack_require__(7557);
|
|
var regeneratorRuntime_default = /*#__PURE__*/__webpack_require__.n(regeneratorRuntime);
|
|
// EXTERNAL MODULE: ./node_modules/_@babel_runtime@7.23.6@@babel/runtime/helpers/asyncToGenerator.js
|
|
var asyncToGenerator = __webpack_require__(41498);
|
|
var asyncToGenerator_default = /*#__PURE__*/__webpack_require__.n(asyncToGenerator);
|
|
// EXTERNAL MODULE: ./node_modules/_@babel_runtime@7.23.6@@babel/runtime/helpers/slicedToArray.js
|
|
var slicedToArray = __webpack_require__(79800);
|
|
var slicedToArray_default = /*#__PURE__*/__webpack_require__.n(slicedToArray);
|
|
// EXTERNAL MODULE: ./node_modules/_react@17.0.2@react/index.js
|
|
var _react_17_0_2_react = __webpack_require__(59301);
|
|
// EXTERNAL MODULE: ./src/.umi-production/exports.ts
|
|
var _umi_production_exports = __webpack_require__(80608);
|
|
;// CONCATENATED MODULE: ./src/pages/Laboratory/LaboratoryRoom/index.less?modules
|
|
// extracted by mini-css-extract-plugin
|
|
/* harmony default export */ var LaboratoryRoommodules = ({"header_div":"header_div___U0sTs","header_title":"header_title___Rf2SK","search":"search___JKp3V","searchIcon":"searchIcon___EfVFK","clear_Data":"clear_Data___T1WZm","batch":"batch___eEhQG","btns":"btns___Q_NP0","btn":"btn___PgQXi"});
|
|
// EXTERNAL MODULE: ./node_modules/_antd@5.9.0@antd/es/tooltip/index.js + 3 modules
|
|
var tooltip = __webpack_require__(6848);
|
|
// EXTERNAL MODULE: ./node_modules/_antd@5.9.0@antd/es/modal/index.js + 16 modules
|
|
var modal = __webpack_require__(43418);
|
|
// EXTERNAL MODULE: ./node_modules/_antd@5.9.0@antd/es/message/index.js + 4 modules
|
|
var message = __webpack_require__(8591);
|
|
// EXTERNAL MODULE: ./node_modules/_antd@5.9.0@antd/es/form/index.js + 19 modules
|
|
var es_form = __webpack_require__(78241);
|
|
// EXTERNAL MODULE: ./node_modules/_antd@5.9.0@antd/es/select/index.js
|
|
var es_select = __webpack_require__(57809);
|
|
// EXTERNAL MODULE: ./node_modules/_antd@5.9.0@antd/es/input/index.js + 3 modules
|
|
var input = __webpack_require__(92832);
|
|
// EXTERNAL MODULE: ./node_modules/_antd@5.9.0@antd/es/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: ./src/service/laboratory.ts
|
|
var service_laboratory = __webpack_require__(70974);
|
|
// EXTERNAL MODULE: ./node_modules/_antd@5.9.0@antd/es/input/TextArea.js
|
|
var TextArea = __webpack_require__(1643);
|
|
// EXTERNAL MODULE: ./node_modules/_react@17.0.2@react/jsx-runtime.js
|
|
var jsx_runtime = __webpack_require__(37712);
|
|
;// CONCATENATED MODULE: ./src/pages/Laboratory/LaboratoryRoom/index.tsx
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
var Navigation = function Navigation(_ref) {
|
|
var loading = _ref.loading,
|
|
dispatch = _ref.dispatch;
|
|
var _useState = (0,_react_17_0_2_react.useState)(),
|
|
_useState2 = slicedToArray_default()(_useState, 2),
|
|
keyword = _useState2[0],
|
|
setkeyword = _useState2[1];
|
|
var _useState3 = (0,_react_17_0_2_react.useState)(''),
|
|
_useState4 = slicedToArray_default()(_useState3, 2),
|
|
reason = _useState4[0],
|
|
setReason = _useState4[1];
|
|
var countRef = (0,_react_17_0_2_react.useRef)(reason);
|
|
countRef.current = reason;
|
|
|
|
//预约数据
|
|
var _useState5 = (0,_react_17_0_2_react.useState)([]),
|
|
_useState6 = slicedToArray_default()(_useState5, 2),
|
|
tableData = _useState6[0],
|
|
setTableData = _useState6[1];
|
|
var columns = [{
|
|
title: '房间名称',
|
|
dataIndex: 'title',
|
|
ellipsis: true,
|
|
render: function render(text, record) {
|
|
return /*#__PURE__*/(0,jsx_runtime.jsx)(tooltip/* default */.Z, {
|
|
placement: "bottomLeft",
|
|
title: text,
|
|
children: /*#__PURE__*/(0,jsx_runtime.jsx)("span", {
|
|
style: {
|
|
color: '#165DFF',
|
|
cursor: 'pointer'
|
|
},
|
|
onClick: function onClick() {
|
|
_umi_production_exports.history.push("/laboratory/reservations/".concat(record === null || record === void 0 ? void 0 : record.id, "/info?index=laboratoryRoom"));
|
|
},
|
|
children: text || '--'
|
|
})
|
|
});
|
|
}
|
|
}, {
|
|
title: '预约权限',
|
|
dataIndex: 'permission',
|
|
ellipsis: true,
|
|
render: function render(text) {
|
|
return /*#__PURE__*/(0,jsx_runtime.jsx)(tooltip/* default */.Z, {
|
|
placement: "bottomLeft",
|
|
title: text == '0' ? '学生' : text == '1' ? '教师(已认证)' : '学生、教师(已认证)',
|
|
children: /*#__PURE__*/(0,jsx_runtime.jsx)("span", {
|
|
children: text == '0' ? '学生' : text == '1' ? '教师(已认证)' : '学生、教师(已认证)'
|
|
})
|
|
});
|
|
}
|
|
}, {
|
|
title: '状态',
|
|
dataIndex: 'status',
|
|
ellipsis: true,
|
|
render: function render(text) {
|
|
return /*#__PURE__*/(0,jsx_runtime.jsx)(tooltip/* default */.Z, {
|
|
placement: "bottomLeft",
|
|
title: text == '0' ? '已启用' : '已禁用',
|
|
children: text == '0' ? /*#__PURE__*/(0,jsx_runtime.jsx)("span", {
|
|
style: {
|
|
color: '#FA6400'
|
|
},
|
|
children: "\u5DF2\u542F\u7528"
|
|
}) : /*#__PURE__*/(0,jsx_runtime.jsx)("span", {
|
|
style: {
|
|
color: '#000000'
|
|
},
|
|
children: "\u5DF2\u7981\u7528"
|
|
})
|
|
});
|
|
}
|
|
}, {
|
|
title: '使用面积',
|
|
dataIndex: 'area',
|
|
ellipsis: true,
|
|
render: function render(text) {
|
|
return /*#__PURE__*/(0,jsx_runtime.jsx)(tooltip/* default */.Z, {
|
|
placement: "bottomLeft",
|
|
title: text,
|
|
children: /*#__PURE__*/(0,jsx_runtime.jsx)("span", {
|
|
children: text ? "".concat(text, "\u5E73\u65B9\u7C73") : '--'
|
|
})
|
|
});
|
|
}
|
|
}, {
|
|
title: '工位数量',
|
|
dataIndex: 'work_num',
|
|
ellipsis: true,
|
|
render: function render(text) {
|
|
return /*#__PURE__*/(0,jsx_runtime.jsx)(tooltip/* default */.Z, {
|
|
placement: "bottomLeft",
|
|
title: text,
|
|
children: /*#__PURE__*/(0,jsx_runtime.jsx)("span", {
|
|
children: text || '--'
|
|
})
|
|
});
|
|
}
|
|
}, {
|
|
title: '所属实验室',
|
|
dataIndex: 'classroom_title',
|
|
ellipsis: true,
|
|
render: function render(text) {
|
|
return /*#__PURE__*/(0,jsx_runtime.jsx)(tooltip/* default */.Z, {
|
|
placement: "bottomLeft",
|
|
title: text,
|
|
children: /*#__PURE__*/(0,jsx_runtime.jsx)("span", {
|
|
children: text || '--'
|
|
})
|
|
});
|
|
}
|
|
}, {
|
|
title: '操作',
|
|
ellipsis: true,
|
|
width: 140,
|
|
render: function render(text, record) {
|
|
return /*#__PURE__*/(0,jsx_runtime.jsxs)(jsx_runtime.Fragment, {
|
|
children: [/*#__PURE__*/(0,jsx_runtime.jsx)("span", {
|
|
style: {
|
|
color: "#165DFF",
|
|
cursor: "pointer"
|
|
},
|
|
onClick: function onClick() {
|
|
setRoomId(record === null || record === void 0 ? void 0 : record.id);
|
|
_umi_production_exports.history.push("/laboratory/laboratoryRoom/".concat(record === null || record === void 0 ? void 0 : record.id));
|
|
},
|
|
children: "\u7F16\u8F91"
|
|
}), /*#__PURE__*/(0,jsx_runtime.jsx)("span", {
|
|
style: {
|
|
color: "#5F6367",
|
|
marginLeft: "10px",
|
|
cursor: "pointer"
|
|
},
|
|
onClick: function onClick() {
|
|
modal/* default */.Z.confirm({
|
|
centered: true,
|
|
okText: '确定',
|
|
cancelText: '取消',
|
|
title: "提示",
|
|
content: "\u8BF7\u786E\u8BA4\u662F\u5426\u5220\u9664".concat(record === null || record === void 0 ? void 0 : record.title, "\u7684\u76F8\u5173\u4FE1\u606F\uFF1F\u5220\u9664\u7684\u4FE1\u606F\u5C06\u65E0\u6CD5\u6062\u590D\u3002"),
|
|
onOk: function () {
|
|
var _onOk = asyncToGenerator_default()( /*#__PURE__*/regeneratorRuntime_default()().mark(function _callee() {
|
|
return regeneratorRuntime_default()().wrap(function _callee$(_context) {
|
|
while (1) switch (_context.prev = _context.next) {
|
|
case 0:
|
|
(0,service_laboratory/* classroom_rooms_delete */.L7)({
|
|
id: record === null || record === void 0 ? void 0 : record.id
|
|
}).then(function (res) {
|
|
if (res.status === 0) {
|
|
message/* default */.ZP.success('删除成功');
|
|
getData(true);
|
|
}
|
|
});
|
|
case 1:
|
|
case "end":
|
|
return _context.stop();
|
|
}
|
|
}, _callee);
|
|
}));
|
|
function onOk() {
|
|
return _onOk.apply(this, arguments);
|
|
}
|
|
return onOk;
|
|
}()
|
|
});
|
|
},
|
|
children: "\u5220\u9664"
|
|
}), (record === null || record === void 0 ? void 0 : record.status) == 1 && /*#__PURE__*/(0,jsx_runtime.jsx)("span", {
|
|
style: {
|
|
color: "#165DFF",
|
|
marginLeft: "10px",
|
|
cursor: "pointer"
|
|
},
|
|
onClick: function onClick() {
|
|
modal/* default */.Z.confirm({
|
|
centered: true,
|
|
okText: '确定',
|
|
cancelText: '取消',
|
|
icon: null,
|
|
title: "确认启用房间",
|
|
content: "\u60A8\u9009\u4E2D\u7684\u623F\u95F4\u5373\u5C06\u542F\u7528\uFF0C\u542F\u7528\u540E\uFF0C\u5177\u5907\u9884\u7EA6\u6743\u9650\u7684\u7528\u6237\u80FD\u591F\u8FDB\u884C\u623F\u95F4\u7684\u9884\u7EA6\u548C\u4F7F\u7528\u3002",
|
|
onOk: function () {
|
|
var _onOk2 = asyncToGenerator_default()( /*#__PURE__*/regeneratorRuntime_default()().mark(function _callee2() {
|
|
return regeneratorRuntime_default()().wrap(function _callee2$(_context2) {
|
|
while (1) switch (_context2.prev = _context2.next) {
|
|
case 0:
|
|
(0,service_laboratory/* rooms_enable */.KB)({
|
|
classroom_room_ids: [record === null || record === void 0 ? void 0 : record.id]
|
|
}).then(function (res) {
|
|
if (res.status === 0) {
|
|
message/* default */.ZP.success('启用成功');
|
|
getData(true);
|
|
}
|
|
});
|
|
case 1:
|
|
case "end":
|
|
return _context2.stop();
|
|
}
|
|
}, _callee2);
|
|
}));
|
|
function onOk() {
|
|
return _onOk2.apply(this, arguments);
|
|
}
|
|
return onOk;
|
|
}()
|
|
});
|
|
},
|
|
children: "\u542F\u7528"
|
|
}), (record === null || record === void 0 ? void 0 : record.status) == 0 && /*#__PURE__*/(0,jsx_runtime.jsx)("span", {
|
|
style: {
|
|
color: "#165DFF",
|
|
marginLeft: "10px",
|
|
cursor: "pointer"
|
|
},
|
|
onClick: function onClick() {
|
|
modal/* default */.Z.confirm({
|
|
centered: true,
|
|
okText: '确定',
|
|
cancelText: '取消',
|
|
icon: null,
|
|
title: "确认禁用房间",
|
|
content: /*#__PURE__*/(0,jsx_runtime.jsxs)("div", {
|
|
children: [/*#__PURE__*/(0,jsx_runtime.jsx)("div", {
|
|
children: record !== null && record !== void 0 && record.has_reservation ? '您选中的房间中存在用户预约,如禁用房间将自动取消预约,请通知相关用户取消预约的原因:' : '您选中的房间即将禁用,禁用后,用户不能进行房间的预约和使用。'
|
|
}), (record === null || record === void 0 ? void 0 : record.has_reservation) && /*#__PURE__*/(0,jsx_runtime.jsx)(TextArea/* default */.Z, {
|
|
placeholder: "\u8BF7\u586B\u5199\u53D6\u6D88\u9884\u7EA6\u7684\u539F\u56E0",
|
|
className: "mt10",
|
|
onChange: function onChange(e) {
|
|
var _e$target;
|
|
setReason(e === null || e === void 0 || (_e$target = e.target) === null || _e$target === void 0 ? void 0 : _e$target.value);
|
|
}
|
|
})]
|
|
}),
|
|
onOk: function () {
|
|
var _onOk3 = asyncToGenerator_default()( /*#__PURE__*/regeneratorRuntime_default()().mark(function _callee3() {
|
|
return regeneratorRuntime_default()().wrap(function _callee3$(_context3) {
|
|
while (1) switch (_context3.prev = _context3.next) {
|
|
case 0:
|
|
if (!(!countRef.current.trim() && record !== null && record !== void 0 && record.has_reservation)) {
|
|
_context3.next = 3;
|
|
break;
|
|
}
|
|
message/* default */.ZP.info('请填写取消预约的原因');
|
|
return _context3.abrupt("return", Promise.reject());
|
|
case 3:
|
|
(0,service_laboratory/* rooms_disable */.Y_)({
|
|
classroom_room_ids: [record === null || record === void 0 ? void 0 : record.id],
|
|
reason: countRef.current
|
|
}).then(function (res) {
|
|
if (res.status === 0) {
|
|
message/* default */.ZP.success('禁用成功');
|
|
getData(true);
|
|
}
|
|
});
|
|
case 4:
|
|
case "end":
|
|
return _context3.stop();
|
|
}
|
|
}, _callee3);
|
|
}));
|
|
function onOk() {
|
|
return _onOk3.apply(this, arguments);
|
|
}
|
|
return onOk;
|
|
}()
|
|
});
|
|
},
|
|
children: "\u7981\u7528"
|
|
})]
|
|
});
|
|
}
|
|
}];
|
|
|
|
//分页
|
|
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)(1),
|
|
_useState10 = slicedToArray_default()(_useState9, 2),
|
|
page = _useState10[0],
|
|
setPage = _useState10[1];
|
|
var _useState11 = (0,_react_17_0_2_react.useState)(10),
|
|
_useState12 = slicedToArray_default()(_useState11, 2),
|
|
limit = _useState12[0],
|
|
setLimit = _useState12[1];
|
|
var _useState13 = (0,_react_17_0_2_react.useState)(false),
|
|
_useState14 = slicedToArray_default()(_useState13, 2),
|
|
isLoading = _useState14[0],
|
|
setIsLoading = _useState14[1];
|
|
var _useState15 = (0,_react_17_0_2_react.useState)([]),
|
|
_useState16 = slicedToArray_default()(_useState15, 2),
|
|
selectIds = _useState16[0],
|
|
setSelectIds = _useState16[1];
|
|
var _useState17 = (0,_react_17_0_2_react.useState)(),
|
|
_useState18 = slicedToArray_default()(_useState17, 2),
|
|
refresh = _useState18[0],
|
|
setRefresh = _useState18[1];
|
|
var _useState19 = (0,_react_17_0_2_react.useState)(null),
|
|
_useState20 = slicedToArray_default()(_useState19, 2),
|
|
roomId = _useState20[0],
|
|
setRoomId = _useState20[1];
|
|
|
|
//实验室
|
|
var _useState21 = (0,_react_17_0_2_react.useState)([]),
|
|
_useState22 = slicedToArray_default()(_useState21, 2),
|
|
laboratoryLists = _useState22[0],
|
|
setLaboratoryLists = _useState22[1];
|
|
var _useState23 = (0,_react_17_0_2_react.useState)(''),
|
|
_useState24 = slicedToArray_default()(_useState23, 2),
|
|
laboratory = _useState24[0],
|
|
setLaboratory = _useState24[1];
|
|
var _useState25 = (0,_react_17_0_2_react.useState)(''),
|
|
_useState26 = slicedToArray_default()(_useState25, 2),
|
|
status = _useState26[0],
|
|
setStatus = _useState26[1];
|
|
(0,_react_17_0_2_react.useEffect)(function () {
|
|
//实验室列表
|
|
(0,service_laboratory/* classroom_query */.GJ)({
|
|
page: 1,
|
|
limit: 10000,
|
|
keyword: ''
|
|
}).then(function (res) {
|
|
var _res$data;
|
|
setLaboratoryLists([{
|
|
id: '',
|
|
title: '全部'
|
|
}].concat(toConsumableArray_default()(res === null || res === void 0 || (_res$data = res.data) === null || _res$data === void 0 ? void 0 : _res$data.list)));
|
|
});
|
|
dispatch({
|
|
type: 'globalSetting/footerToggle',
|
|
payload: false
|
|
});
|
|
return function () {
|
|
dispatch({
|
|
type: 'globalSetting/footerToggle',
|
|
payload: true
|
|
});
|
|
};
|
|
}, []);
|
|
(0,_react_17_0_2_react.useEffect)(function () {
|
|
getData(false);
|
|
}, [page]);
|
|
(0,_react_17_0_2_react.useEffect)(function () {
|
|
getData(true);
|
|
}, [keyword, status, laboratory, limit]);
|
|
var getData = function getData(flag) {
|
|
if (flag) {
|
|
setPage(1);
|
|
}
|
|
(0,service_laboratory/* classroom_rooms_query */.jd)({
|
|
page: page,
|
|
limit: limit,
|
|
keyword: keyword,
|
|
classroom_id: laboratory,
|
|
status: status
|
|
}).then(function (res) {
|
|
var _res$data2, _res$data3;
|
|
setTotal(res === null || res === void 0 || (_res$data2 = res.data) === null || _res$data2 === void 0 ? void 0 : _res$data2.count);
|
|
setTableData(res === null || res === void 0 || (_res$data3 = res.data) === null || _res$data3 === void 0 || (_res$data3 = _res$data3.list) === null || _res$data3 === void 0 ? void 0 : _res$data3.map(function (item) {
|
|
item.key = item === null || item === void 0 ? void 0 : item.id;
|
|
return item;
|
|
}));
|
|
});
|
|
};
|
|
var onShowSizeChange = function onShowSizeChange(page, size) {
|
|
setPage(page);
|
|
setLimit(size);
|
|
};
|
|
var rowSelection = {
|
|
onChange: function onChange(selectedRowKeys, selectedRows) {
|
|
setSelectIds(selectedRows === null || selectedRows === void 0 ? void 0 : selectedRows.map(function (item) {
|
|
item.id = item === null || item === void 0 ? void 0 : item.key;
|
|
return item;
|
|
}));
|
|
}
|
|
};
|
|
return /*#__PURE__*/(0,jsx_runtime.jsxs)("div", {
|
|
children: [/*#__PURE__*/(0,jsx_runtime.jsxs)("div", {
|
|
className: LaboratoryRoommodules.header_div,
|
|
children: [/*#__PURE__*/(0,jsx_runtime.jsx)("div", {
|
|
className: LaboratoryRoommodules.header_title,
|
|
children: "\u5B9E\u9A8C\u5BA4\u623F\u95F4"
|
|
}), /*#__PURE__*/(0,jsx_runtime.jsx)(es_form/* default */.Z.Item, {
|
|
colon: false,
|
|
label: "\u72B6\u6001",
|
|
style: {
|
|
marginLeft: 'auto'
|
|
},
|
|
children: /*#__PURE__*/(0,jsx_runtime.jsxs)(es_select["default"], {
|
|
style: {
|
|
width: 100
|
|
},
|
|
defaultValue: status,
|
|
value: status,
|
|
onChange: function onChange(e) {
|
|
setStatus(e);
|
|
},
|
|
children: [/*#__PURE__*/(0,jsx_runtime.jsx)(es_select["default"].Option, {
|
|
value: "",
|
|
children: "\u5168\u90E8"
|
|
}), /*#__PURE__*/(0,jsx_runtime.jsx)(es_select["default"].Option, {
|
|
value: "0",
|
|
children: "\u5DF2\u542F\u7528"
|
|
}), /*#__PURE__*/(0,jsx_runtime.jsx)(es_select["default"].Option, {
|
|
value: "1",
|
|
children: "\u5DF2\u7981\u7528"
|
|
})]
|
|
})
|
|
}), /*#__PURE__*/(0,jsx_runtime.jsx)(es_form/* default */.Z.Item, {
|
|
colon: false,
|
|
label: "\u5B9E\u9A8C\u5BA4",
|
|
style: {
|
|
marginLeft: '20px'
|
|
},
|
|
children: /*#__PURE__*/(0,jsx_runtime.jsx)(es_select["default"], {
|
|
style: {
|
|
width: 160
|
|
},
|
|
defaultValue: laboratory,
|
|
value: laboratory,
|
|
onChange: function onChange(e) {
|
|
setLaboratory(e);
|
|
},
|
|
children: laboratoryLists === null || laboratoryLists === void 0 ? void 0 : laboratoryLists.map(function (item, index) {
|
|
return /*#__PURE__*/(0,jsx_runtime.jsx)(es_select["default"].Option, {
|
|
value: item === null || item === void 0 ? void 0 : item.id,
|
|
children: item === null || item === void 0 ? void 0 : item.title
|
|
}, index);
|
|
})
|
|
})
|
|
}), /*#__PURE__*/(0,jsx_runtime.jsx)(input/* default */.Z.Search, {
|
|
placeholder: "\u8BF7\u8F93\u5165\u623F\u95F4\u540D\u79F0\u641C\u7D22",
|
|
size: "large",
|
|
className: LaboratoryRoommodules.search,
|
|
value: keyword,
|
|
onChange: function onChange(e) {
|
|
setkeyword(e.target.value);
|
|
},
|
|
onSearch: function onSearch(value) {
|
|
setkeyword(value);
|
|
},
|
|
suffix: /*#__PURE__*/(0,jsx_runtime.jsx)("i", {
|
|
className: "iconfont icon-sousuo9 font14 ".concat(LaboratoryRoommodules.searchIcon),
|
|
onClick: function onClick() {
|
|
setkeyword(keyword);
|
|
getData(true);
|
|
}
|
|
})
|
|
}), /*#__PURE__*/(0,jsx_runtime.jsx)("div", {
|
|
className: LaboratoryRoommodules.clear_Data,
|
|
onClick: function onClick() {
|
|
_umi_production_exports.history.push("/laboratory/laboratoryRoom/".concat(roomId));
|
|
},
|
|
children: "\u65B0\u5EFA\u5B9E\u9A8C\u5BA4\u623F\u95F4"
|
|
})]
|
|
}), /*#__PURE__*/(0,jsx_runtime.jsx)("div", {
|
|
className: LaboratoryRoommodules.search_params
|
|
}), /*#__PURE__*/(0,jsx_runtime.jsx)(table/* default */.Z, {
|
|
rowSelection: objectSpread2_default()({
|
|
type: 'checkbox'
|
|
}, rowSelection),
|
|
loading: isLoading,
|
|
pagination: false,
|
|
dataSource: tableData,
|
|
columns: columns
|
|
}, refresh), /*#__PURE__*/(0,jsx_runtime.jsx)("aside", {
|
|
children: total > 0 ? /*#__PURE__*/(0,jsx_runtime.jsxs)("div", {
|
|
style: {
|
|
display: 'flex',
|
|
alignItems: 'center',
|
|
justifyContent: 'space-between',
|
|
padding: '10px 7px 20px 7px'
|
|
},
|
|
children: [/*#__PURE__*/(0,jsx_runtime.jsx)("div", {
|
|
children: /*#__PURE__*/(0,jsx_runtime.jsxs)("span", {
|
|
style: {
|
|
color: '#656F87'
|
|
},
|
|
children: ["\u5171", /*#__PURE__*/(0,jsx_runtime.jsx)("span", {
|
|
className: "c-light-primary",
|
|
children: total
|
|
}), "\u6761\u6570\u636E"]
|
|
})
|
|
}), /*#__PURE__*/(0,jsx_runtime.jsx)(pagination/* default */.Z, {
|
|
showSizeChanger: true,
|
|
showQuickJumper: true,
|
|
onChange: onShowSizeChange,
|
|
defaultCurrent: 1,
|
|
pageSizeOptions: ['10', '20', '50', '100'],
|
|
current: page || 1,
|
|
pageSize: limit || 10,
|
|
defaultPageSize: 10,
|
|
total: total
|
|
})]
|
|
}) : ''
|
|
}), !!(selectIds !== null && selectIds !== void 0 && selectIds.length) && /*#__PURE__*/(0,jsx_runtime.jsx)("div", {
|
|
className: LaboratoryRoommodules.batch,
|
|
children: /*#__PURE__*/(0,jsx_runtime.jsxs)("aside", {
|
|
children: [/*#__PURE__*/(0,jsx_runtime.jsx)("div", {
|
|
style: {
|
|
flexShrink: 0,
|
|
marginRight: 20
|
|
},
|
|
children: /*#__PURE__*/(0,jsx_runtime.jsxs)("span", {
|
|
style: {
|
|
color: '#999',
|
|
fontSize: 14
|
|
},
|
|
children: ["\u5DF2\u9009(", selectIds === null || selectIds === void 0 ? void 0 : selectIds.length, ")"]
|
|
})
|
|
}), /*#__PURE__*/(0,jsx_runtime.jsxs)("div", {
|
|
className: LaboratoryRoommodules.btns,
|
|
children: [/*#__PURE__*/(0,jsx_runtime.jsxs)("div", {
|
|
className: LaboratoryRoommodules.btn,
|
|
onClick: function onClick() {
|
|
modal/* default */.Z.confirm({
|
|
centered: true,
|
|
okText: '确定',
|
|
cancelText: '取消',
|
|
icon: null,
|
|
title: "确认启用房间",
|
|
content: "\u60A8\u9009\u4E2D\u7684\u623F\u95F4\u5373\u5C06\u542F\u7528\uFF0C\u542F\u7528\u540E\uFF0C\u5177\u5907\u9884\u7EA6\u6743\u9650\u7684\u7528\u6237\u80FD\u591F\u8FDB\u884C\u623F\u95F4\u7684\u9884\u7EA6\u548C\u4F7F\u7528\u3002",
|
|
onOk: function () {
|
|
var _onOk4 = asyncToGenerator_default()( /*#__PURE__*/regeneratorRuntime_default()().mark(function _callee4() {
|
|
return regeneratorRuntime_default()().wrap(function _callee4$(_context4) {
|
|
while (1) switch (_context4.prev = _context4.next) {
|
|
case 0:
|
|
(0,service_laboratory/* rooms_enable */.KB)({
|
|
classroom_room_ids: selectIds === null || selectIds === void 0 ? void 0 : selectIds.map(function (item) {
|
|
return item === null || item === void 0 ? void 0 : item.id;
|
|
})
|
|
}).then(function (res) {
|
|
if (res.status === 0) {
|
|
message/* default */.ZP.success('启用成功');
|
|
getData(true);
|
|
}
|
|
});
|
|
case 1:
|
|
case "end":
|
|
return _context4.stop();
|
|
}
|
|
}, _callee4);
|
|
}));
|
|
function onOk() {
|
|
return _onOk4.apply(this, arguments);
|
|
}
|
|
return onOk;
|
|
}()
|
|
});
|
|
},
|
|
children: [" ", /*#__PURE__*/(0,jsx_runtime.jsx)("i", {
|
|
className: "iconfont icon-xinzeng"
|
|
}), "\u6279\u91CF\u542F\u7528"]
|
|
}), /*#__PURE__*/(0,jsx_runtime.jsxs)("div", {
|
|
className: LaboratoryRoommodules.btn,
|
|
onClick: function onClick() {
|
|
var obj = [];
|
|
selectIds === null || selectIds === void 0 || selectIds.map(function (item) {
|
|
if (item !== null && item !== void 0 && item.has_reservation) {
|
|
obj.push(item === null || item === void 0 ? void 0 : item.title);
|
|
}
|
|
});
|
|
modal/* default */.Z.confirm({
|
|
centered: true,
|
|
okText: '确定',
|
|
cancelText: '取消',
|
|
icon: null,
|
|
title: "确认禁用房间",
|
|
content: /*#__PURE__*/(0,jsx_runtime.jsxs)("div", {
|
|
children: [/*#__PURE__*/(0,jsx_runtime.jsx)("div", {
|
|
children: (obj === null || obj === void 0 ? void 0 : obj.length) > 0 ? "\u60A8\u9009\u4E2D\u7684\u623F\u95F4\u4E2D\uFF08".concat(obj === null || obj === void 0 ? void 0 : obj.map(function (ite) {
|
|
return ite;
|
|
}).join('、'), "\uFF09\u5B58\u5728\u7528\u6237\u9884\u7EA6\uFF0C\u5982\u7981\u7528\u623F\u95F4\u5C06\u81EA\u52A8\u53D6\u6D88\u9884\u7EA6\uFF0C\u8BF7\u901A\u77E5\u76F8\u5173\u7528\u6237\u53D6\u6D88\u9884\u7EA6\u7684\u539F\u56E0") : '您选中的房间即将禁用,禁用后,用户不能进行房间的预约和使用。'
|
|
}), (obj === null || obj === void 0 ? void 0 : obj.length) > 0 && /*#__PURE__*/(0,jsx_runtime.jsx)(TextArea/* default */.Z, {
|
|
placeholder: "\u8BF7\u586B\u5199\u53D6\u6D88\u9884\u7EA6\u7684\u539F\u56E0",
|
|
className: "mt10",
|
|
onChange: function onChange(e) {
|
|
var _e$target2;
|
|
setReason(e === null || e === void 0 || (_e$target2 = e.target) === null || _e$target2 === void 0 ? void 0 : _e$target2.value);
|
|
}
|
|
})]
|
|
}),
|
|
onOk: function () {
|
|
var _onOk5 = asyncToGenerator_default()( /*#__PURE__*/regeneratorRuntime_default()().mark(function _callee5() {
|
|
return regeneratorRuntime_default()().wrap(function _callee5$(_context5) {
|
|
while (1) switch (_context5.prev = _context5.next) {
|
|
case 0:
|
|
if (!(!countRef.current.trim() && (obj === null || obj === void 0 ? void 0 : obj.length) > 0)) {
|
|
_context5.next = 3;
|
|
break;
|
|
}
|
|
message/* default */.ZP.info('请填写取消预约的原因');
|
|
return _context5.abrupt("return", Promise.reject());
|
|
case 3:
|
|
(0,service_laboratory/* rooms_disable */.Y_)({
|
|
classroom_room_ids: selectIds === null || selectIds === void 0 ? void 0 : selectIds.map(function (item) {
|
|
return item === null || item === void 0 ? void 0 : item.id;
|
|
}),
|
|
reason: countRef.current
|
|
}).then(function (res) {
|
|
if (res.status === 0) {
|
|
message/* default */.ZP.success('禁用成功');
|
|
getData(true);
|
|
}
|
|
});
|
|
case 4:
|
|
case "end":
|
|
return _context5.stop();
|
|
}
|
|
}, _callee5);
|
|
}));
|
|
function onOk() {
|
|
return _onOk5.apply(this, arguments);
|
|
}
|
|
return onOk;
|
|
}()
|
|
});
|
|
},
|
|
children: [" ", /*#__PURE__*/(0,jsx_runtime.jsx)("i", {
|
|
className: "iconfont icon-jinzhi"
|
|
}), "\u6279\u91CF\u7981\u7528"]
|
|
}), /*#__PURE__*/(0,jsx_runtime.jsxs)("div", {
|
|
onClick: function onClick() {
|
|
setSelectIds([]);
|
|
setRefresh(new Date());
|
|
},
|
|
style: {
|
|
marginLeft: 'auto'
|
|
},
|
|
className: LaboratoryRoommodules.btn,
|
|
children: [" ", /*#__PURE__*/(0,jsx_runtime.jsx)("i", {
|
|
className: "iconfont icon-piliangcaozuoicon2"
|
|
}), "\u53D6\u6D88\u64CD\u4F5C"]
|
|
})]
|
|
})]
|
|
})
|
|
})]
|
|
});
|
|
};
|
|
/* harmony default export */ var LaboratoryRoom = ((0,_umi_production_exports.connect)(function (_ref2) {
|
|
var loading = _ref2.loading,
|
|
engineeringNavigtion = _ref2.engineeringNavigtion,
|
|
dispatch = _ref2.dispatch;
|
|
return objectSpread2_default()(objectSpread2_default()({
|
|
loading: loading
|
|
}, engineeringNavigtion), {}, {
|
|
dispatch: dispatch
|
|
});
|
|
})(Navigation));
|
|
|
|
/***/ })
|
|
|
|
}]); |