|
|
|
|
@ -60,12 +60,12 @@ __webpack_require__.d(__webpack_exports__, {
|
|
|
|
|
"default": function() { return /* binding */ IOT_DeviceManage; }
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
// EXTERNAL MODULE: ./node_modules/_@babel_runtime@7.23.6@@babel/runtime/helpers/objectSpread2.js
|
|
|
|
|
var objectSpread2 = __webpack_require__(82242);
|
|
|
|
|
var objectSpread2_default = /*#__PURE__*/__webpack_require__.n(objectSpread2);
|
|
|
|
|
// EXTERNAL MODULE: ./node_modules/_@babel_runtime@7.23.6@@babel/runtime/helpers/regeneratorRuntime.js
|
|
|
|
|
var regeneratorRuntime = __webpack_require__(7557);
|
|
|
|
|
var regeneratorRuntime_default = /*#__PURE__*/__webpack_require__.n(regeneratorRuntime);
|
|
|
|
|
// EXTERNAL MODULE: ./node_modules/_@babel_runtime@7.23.6@@babel/runtime/helpers/objectSpread2.js
|
|
|
|
|
var objectSpread2 = __webpack_require__(82242);
|
|
|
|
|
var objectSpread2_default = /*#__PURE__*/__webpack_require__.n(objectSpread2);
|
|
|
|
|
// EXTERNAL MODULE: ./node_modules/_@babel_runtime@7.23.6@@babel/runtime/helpers/asyncToGenerator.js
|
|
|
|
|
var asyncToGenerator = __webpack_require__(41498);
|
|
|
|
|
var asyncToGenerator_default = /*#__PURE__*/__webpack_require__.n(asyncToGenerator);
|
|
|
|
|
@ -138,6 +138,8 @@ if (false) {}
|
|
|
|
|
var PoweroffOutlined = __webpack_require__(84078);
|
|
|
|
|
// EXTERNAL MODULE: ./src/service/iot.ts
|
|
|
|
|
var iot = __webpack_require__(87763);
|
|
|
|
|
// EXTERNAL MODULE: ./src/utils/fetch.ts
|
|
|
|
|
var fetch = __webpack_require__(70311);
|
|
|
|
|
// EXTERNAL MODULE: ./node_modules/_react@17.0.2@react/jsx-runtime.js
|
|
|
|
|
var jsx_runtime = __webpack_require__(37712);
|
|
|
|
|
;// CONCATENATED MODULE: ./src/pages/IOT/DeviceManage/index.tsx
|
|
|
|
|
@ -156,8 +158,9 @@ var jsx_runtime = __webpack_require__(37712);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
var DeviceManage = function DeviceManage(_ref) {
|
|
|
|
|
var _ref2, _ref3;
|
|
|
|
|
var _ref3, _ref4;
|
|
|
|
|
var loading = _ref.loading,
|
|
|
|
|
dispatch = _ref.dispatch;
|
|
|
|
|
var _useState = (0,_react_17_0_2_react.useState)(),
|
|
|
|
|
@ -256,6 +259,10 @@ var DeviceManage = function DeviceManage(_ref) {
|
|
|
|
|
_useState36 = slicedToArray_default()(_useState35, 2),
|
|
|
|
|
rooms2 = _useState36[0],
|
|
|
|
|
setRooms2 = _useState36[1];
|
|
|
|
|
var _useState37 = (0,_react_17_0_2_react.useState)(true),
|
|
|
|
|
_useState38 = slicedToArray_default()(_useState37, 2),
|
|
|
|
|
isSpin = _useState38[0],
|
|
|
|
|
setIsSpin = _useState38[1];
|
|
|
|
|
var isFirstLoad = (0,_react_17_0_2_react.useRef)(true);
|
|
|
|
|
var columns = [{
|
|
|
|
|
title: '设备编号',
|
|
|
|
|
@ -384,10 +391,32 @@ var DeviceManage = function DeviceManage(_ref) {
|
|
|
|
|
cursor: "pointer",
|
|
|
|
|
marginLeft: '20px'
|
|
|
|
|
},
|
|
|
|
|
onClick: function onClick() {
|
|
|
|
|
setRowData(record);
|
|
|
|
|
setControlModal(true);
|
|
|
|
|
},
|
|
|
|
|
onClick: /*#__PURE__*/asyncToGenerator_default()( /*#__PURE__*/regeneratorRuntime_default()().mark(function _callee() {
|
|
|
|
|
var res, _res$data2;
|
|
|
|
|
return regeneratorRuntime_default()().wrap(function _callee$(_context) {
|
|
|
|
|
while (1) switch (_context.prev = _context.next) {
|
|
|
|
|
case 0:
|
|
|
|
|
setRowData(objectSpread2_default()({}, record));
|
|
|
|
|
setControlModal(true);
|
|
|
|
|
setIsSpin(false);
|
|
|
|
|
_context.next = 5;
|
|
|
|
|
return (0,fetch/* default */.ZP)("/api/yn_classrooms/devices/".concat(record === null || record === void 0 ? void 0 : record.id, "/lot_status.json"), {
|
|
|
|
|
method: 'get'
|
|
|
|
|
});
|
|
|
|
|
case 5:
|
|
|
|
|
res = _context.sent;
|
|
|
|
|
if ((res === null || res === void 0 ? void 0 : res.status) == 0) {
|
|
|
|
|
setRowData(objectSpread2_default()(objectSpread2_default()({}, record), {}, {
|
|
|
|
|
use_status: res === null || res === void 0 || (_res$data2 = res.data) === null || _res$data2 === void 0 ? void 0 : _res$data2.use_status
|
|
|
|
|
}));
|
|
|
|
|
setIsSpin(true);
|
|
|
|
|
}
|
|
|
|
|
case 7:
|
|
|
|
|
case "end":
|
|
|
|
|
return _context.stop();
|
|
|
|
|
}
|
|
|
|
|
}, _callee);
|
|
|
|
|
})),
|
|
|
|
|
children: "\u63A7\u5236"
|
|
|
|
|
})]
|
|
|
|
|
});
|
|
|
|
|
@ -399,8 +428,8 @@ var DeviceManage = function DeviceManage(_ref) {
|
|
|
|
|
page: 1,
|
|
|
|
|
limit: 10000
|
|
|
|
|
}).then(function (res) {
|
|
|
|
|
var _res$data2;
|
|
|
|
|
setLaboratorys(toConsumableArray_default()(res === null || res === void 0 || (_res$data2 = res.data) === null || _res$data2 === void 0 ? void 0 : _res$data2.list));
|
|
|
|
|
var _res$data3;
|
|
|
|
|
setLaboratorys(toConsumableArray_default()(res === null || res === void 0 || (_res$data3 = res.data) === null || _res$data3 === void 0 ? void 0 : _res$data3.list));
|
|
|
|
|
});
|
|
|
|
|
//实验室房间
|
|
|
|
|
(0,laboratory/* classroom_rooms_query */.jd)({
|
|
|
|
|
@ -408,8 +437,8 @@ var DeviceManage = function DeviceManage(_ref) {
|
|
|
|
|
limit: 10000,
|
|
|
|
|
classroom_id: ''
|
|
|
|
|
}).then(function (res) {
|
|
|
|
|
var _res$data3;
|
|
|
|
|
setRooms(toConsumableArray_default()(res === null || res === void 0 || (_res$data3 = res.data) === null || _res$data3 === void 0 ? void 0 : _res$data3.list));
|
|
|
|
|
var _res$data4;
|
|
|
|
|
setRooms(toConsumableArray_default()(res === null || res === void 0 || (_res$data4 = res.data) === null || _res$data4 === void 0 ? void 0 : _res$data4.list));
|
|
|
|
|
});
|
|
|
|
|
dispatch({
|
|
|
|
|
type: 'globalSetting/footerToggle',
|
|
|
|
|
@ -446,9 +475,9 @@ var DeviceManage = function DeviceManage(_ref) {
|
|
|
|
|
// 1:非物理网设备 2:电子班牌 3:智慧开关
|
|
|
|
|
genre: 3
|
|
|
|
|
}).then(function (res) {
|
|
|
|
|
var _res$data4, _res$data5;
|
|
|
|
|
setTotal(res === null || res === void 0 || (_res$data4 = res.data) === null || _res$data4 === void 0 ? void 0 : _res$data4.count);
|
|
|
|
|
setTableData(res === null || res === void 0 || (_res$data5 = res.data) === null || _res$data5 === void 0 || (_res$data5 = _res$data5.list) === null || _res$data5 === void 0 ? void 0 : _res$data5.map(function (item) {
|
|
|
|
|
var _res$data5, _res$data6;
|
|
|
|
|
setTotal(res === null || res === void 0 || (_res$data5 = res.data) === null || _res$data5 === void 0 ? void 0 : _res$data5.count);
|
|
|
|
|
setTableData(res === null || res === void 0 || (_res$data6 = res.data) === null || _res$data6 === void 0 || (_res$data6 = _res$data6.list) === null || _res$data6 === void 0 ? void 0 : _res$data6.map(function (item) {
|
|
|
|
|
item.key = item === null || item === void 0 ? void 0 : item.id;
|
|
|
|
|
return item;
|
|
|
|
|
}));
|
|
|
|
|
@ -536,14 +565,14 @@ var DeviceManage = function DeviceManage(_ref) {
|
|
|
|
|
limit: 10000,
|
|
|
|
|
classroom_id: e
|
|
|
|
|
}).then(function (res) {
|
|
|
|
|
var _res$data6;
|
|
|
|
|
setRooms(toConsumableArray_default()(res === null || res === void 0 || (_res$data6 = res.data) === null || _res$data6 === void 0 ? void 0 : _res$data6.list));
|
|
|
|
|
var _res$data7;
|
|
|
|
|
setRooms(toConsumableArray_default()(res === null || res === void 0 || (_res$data7 = res.data) === null || _res$data7 === void 0 ? void 0 : _res$data7.list));
|
|
|
|
|
});
|
|
|
|
|
},
|
|
|
|
|
children: (_ref2 = [{
|
|
|
|
|
children: (_ref3 = [{
|
|
|
|
|
id: '',
|
|
|
|
|
title: '全部'
|
|
|
|
|
}].concat(toConsumableArray_default()(laboratorys))) === null || _ref2 === void 0 ? void 0 : _ref2.map(function (item, index) {
|
|
|
|
|
}].concat(toConsumableArray_default()(laboratorys))) === null || _ref3 === void 0 ? void 0 : _ref3.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
|
|
|
|
|
@ -566,10 +595,10 @@ var DeviceManage = function DeviceManage(_ref) {
|
|
|
|
|
onChange: function onChange(e) {
|
|
|
|
|
setSysRoom(e);
|
|
|
|
|
},
|
|
|
|
|
children: (_ref3 = [{
|
|
|
|
|
children: (_ref4 = [{
|
|
|
|
|
id: '',
|
|
|
|
|
title: '全部'
|
|
|
|
|
}].concat(toConsumableArray_default()(rooms))) === null || _ref3 === void 0 ? void 0 : _ref3.map(function (item, index) {
|
|
|
|
|
}].concat(toConsumableArray_default()(rooms))) === null || _ref4 === void 0 ? void 0 : _ref4.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
|
|
|
|
|
@ -676,9 +705,9 @@ var DeviceManage = function DeviceManage(_ref) {
|
|
|
|
|
return item.name;
|
|
|
|
|
}).join('、'), "\uFF09\u5C06\u4F1A\u88AB\u6279\u91CF\u5F00\u673A, \u8BF7\u60A8\u786E\u8BA4!"),
|
|
|
|
|
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) {
|
|
|
|
|
var _onOk = 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,iot/* lot_up */.zh)({
|
|
|
|
|
device_ids: selectIds === null || selectIds === void 0 ? void 0 : selectIds.map(function (item) {
|
|
|
|
|
@ -692,9 +721,9 @@ var DeviceManage = function DeviceManage(_ref) {
|
|
|
|
|
});
|
|
|
|
|
case 1:
|
|
|
|
|
case "end":
|
|
|
|
|
return _context.stop();
|
|
|
|
|
return _context2.stop();
|
|
|
|
|
}
|
|
|
|
|
}, _callee);
|
|
|
|
|
}, _callee2);
|
|
|
|
|
}));
|
|
|
|
|
function onOk() {
|
|
|
|
|
return _onOk.apply(this, arguments);
|
|
|
|
|
@ -727,9 +756,9 @@ var DeviceManage = function DeviceManage(_ref) {
|
|
|
|
|
return item.name;
|
|
|
|
|
}).join('、'), "\uFF09\u5C06\u4F1A\u88AB\u6279\u91CF\u5173\u673A, \u8BF7\u60A8\u786E\u8BA4!"),
|
|
|
|
|
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) {
|
|
|
|
|
var _onOk2 = asyncToGenerator_default()( /*#__PURE__*/regeneratorRuntime_default()().mark(function _callee3() {
|
|
|
|
|
return regeneratorRuntime_default()().wrap(function _callee3$(_context3) {
|
|
|
|
|
while (1) switch (_context3.prev = _context3.next) {
|
|
|
|
|
case 0:
|
|
|
|
|
(0,iot/* lot_down */.hQ)({
|
|
|
|
|
device_ids: selectIds === null || selectIds === void 0 ? void 0 : selectIds.map(function (item) {
|
|
|
|
|
@ -743,9 +772,9 @@ var DeviceManage = function DeviceManage(_ref) {
|
|
|
|
|
});
|
|
|
|
|
case 1:
|
|
|
|
|
case "end":
|
|
|
|
|
return _context2.stop();
|
|
|
|
|
return _context3.stop();
|
|
|
|
|
}
|
|
|
|
|
}, _callee2);
|
|
|
|
|
}, _callee3);
|
|
|
|
|
}));
|
|
|
|
|
function onOk() {
|
|
|
|
|
return _onOk2.apply(this, arguments);
|
|
|
|
|
@ -783,11 +812,11 @@ var DeviceManage = function DeviceManage(_ref) {
|
|
|
|
|
open: openAddModal,
|
|
|
|
|
title: "".concat(rowData ? '编辑关联设备' : '关联设备'),
|
|
|
|
|
width: "948px",
|
|
|
|
|
onOk: /*#__PURE__*/asyncToGenerator_default()( /*#__PURE__*/regeneratorRuntime_default()().mark(function _callee3() {
|
|
|
|
|
return regeneratorRuntime_default()().wrap(function _callee3$(_context3) {
|
|
|
|
|
while (1) switch (_context3.prev = _context3.next) {
|
|
|
|
|
onOk: /*#__PURE__*/asyncToGenerator_default()( /*#__PURE__*/regeneratorRuntime_default()().mark(function _callee4() {
|
|
|
|
|
return regeneratorRuntime_default()().wrap(function _callee4$(_context4) {
|
|
|
|
|
while (1) switch (_context4.prev = _context4.next) {
|
|
|
|
|
case 0:
|
|
|
|
|
_context3.next = 2;
|
|
|
|
|
_context4.next = 2;
|
|
|
|
|
return myForm.validateFields();
|
|
|
|
|
case 2:
|
|
|
|
|
if (rowData) {
|
|
|
|
|
@ -818,9 +847,9 @@ var DeviceManage = function DeviceManage(_ref) {
|
|
|
|
|
}
|
|
|
|
|
case 3:
|
|
|
|
|
case "end":
|
|
|
|
|
return _context3.stop();
|
|
|
|
|
return _context4.stop();
|
|
|
|
|
}
|
|
|
|
|
}, _callee3);
|
|
|
|
|
}, _callee4);
|
|
|
|
|
})),
|
|
|
|
|
onCancel: function onCancel() {
|
|
|
|
|
setOpenAddModal(false);
|
|
|
|
|
@ -953,8 +982,8 @@ var DeviceManage = function DeviceManage(_ref) {
|
|
|
|
|
limit: 10000,
|
|
|
|
|
classroom_id: e
|
|
|
|
|
}).then(function (res) {
|
|
|
|
|
var _res$data7;
|
|
|
|
|
setRooms2(toConsumableArray_default()(res === null || res === void 0 || (_res$data7 = res.data) === null || _res$data7 === void 0 ? void 0 : _res$data7.list));
|
|
|
|
|
var _res$data8;
|
|
|
|
|
setRooms2(toConsumableArray_default()(res === null || res === void 0 || (_res$data8 = res.data) === null || _res$data8 === void 0 ? void 0 : _res$data8.list));
|
|
|
|
|
});
|
|
|
|
|
},
|
|
|
|
|
children: laboratorys === null || laboratorys === void 0 ? void 0 : laboratorys.map(function (item, index) {
|
|
|
|
|
@ -997,13 +1026,25 @@ var DeviceManage = function DeviceManage(_ref) {
|
|
|
|
|
keyboard: false,
|
|
|
|
|
destroyOnClose: true,
|
|
|
|
|
open: controlModal,
|
|
|
|
|
title: "\u5F53\u524D\u63A7\u5236\u7684\u4E3A (".concat(rowData === null || rowData === void 0 ? void 0 : rowData.classroom_title, ")\u2014\u2014(").concat(rowData === null || rowData === void 0 ? void 0 : rowData.classroom_room_title, ")\u603B\u7535\u6E90"),
|
|
|
|
|
title: "\u5F53\u524D\u63A7\u5236\u7684\u4E3A (".concat(rowData === null || rowData === void 0 ? void 0 : rowData.classroom_title, ")\u2014(").concat(rowData === null || rowData === void 0 ? void 0 : rowData.classroom_room_title, ")\u603B\u7535\u6E90"),
|
|
|
|
|
width: "600px",
|
|
|
|
|
footer: null,
|
|
|
|
|
onCancel: function onCancel() {
|
|
|
|
|
setControlModal(false);
|
|
|
|
|
},
|
|
|
|
|
children: /*#__PURE__*/(0,jsx_runtime.jsxs)(spin/* default */.Z, {
|
|
|
|
|
children: !isSpin ? /*#__PURE__*/(0,jsx_runtime.jsx)("div", {
|
|
|
|
|
style: {
|
|
|
|
|
width: '100%',
|
|
|
|
|
height: '265px',
|
|
|
|
|
display: 'flex',
|
|
|
|
|
alignItems: 'center',
|
|
|
|
|
justifyContent: 'center'
|
|
|
|
|
},
|
|
|
|
|
children: /*#__PURE__*/(0,jsx_runtime.jsx)(spin/* default */.Z, {
|
|
|
|
|
tip: "\u83B7\u53D6\u6700\u65B0\u72B6\u6001\u4E2D...",
|
|
|
|
|
delay: 500
|
|
|
|
|
})
|
|
|
|
|
}) : /*#__PURE__*/(0,jsx_runtime.jsxs)(spin/* default */.Z, {
|
|
|
|
|
spinning: !isLoading,
|
|
|
|
|
tip: (rowData === null || rowData === void 0 ? void 0 : rowData.use_status) == 'unstart' ? '断电中' : '通电中',
|
|
|
|
|
children: [/*#__PURE__*/(0,jsx_runtime.jsx)("div", {
|
|
|
|
|
@ -1067,10 +1108,10 @@ var DeviceManage = function DeviceManage(_ref) {
|
|
|
|
|
})]
|
|
|
|
|
});
|
|
|
|
|
};
|
|
|
|
|
/* harmony default export */ var IOT_DeviceManage = ((0,_umi_production_exports.connect)(function (_ref5) {
|
|
|
|
|
var loading = _ref5.loading,
|
|
|
|
|
engineeringNavigtion = _ref5.engineeringNavigtion,
|
|
|
|
|
dispatch = _ref5.dispatch;
|
|
|
|
|
/* harmony default export */ var IOT_DeviceManage = ((0,_umi_production_exports.connect)(function (_ref6) {
|
|
|
|
|
var loading = _ref6.loading,
|
|
|
|
|
engineeringNavigtion = _ref6.engineeringNavigtion,
|
|
|
|
|
dispatch = _ref6.dispatch;
|
|
|
|
|
return objectSpread2_default()(objectSpread2_default()({
|
|
|
|
|
loading: loading
|
|
|
|
|
}, engineeringNavigtion), {}, {
|