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.
1290 lines
60 KiB
1290 lines
60 KiB
"use strict";
|
|
(self["webpackChunk"] = self["webpackChunk"] || []).push([[47778],{
|
|
|
|
/***/ 29419:
|
|
/*!**********************************************************************************************************!*\
|
|
!*** ./node_modules/_@ant-design_icons@5.4.0@@ant-design/icons/es/icons/PoweroffOutlined.js + 1 modules ***!
|
|
\**********************************************************************************************************/
|
|
/***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) {
|
|
|
|
|
|
// EXPORTS
|
|
__webpack_require__.d(__webpack_exports__, {
|
|
Z: function() { return /* binding */ icons_PoweroffOutlined; }
|
|
});
|
|
|
|
// EXTERNAL MODULE: ./node_modules/_@babel_runtime@7.25.6@@babel/runtime/helpers/esm/extends.js
|
|
var esm_extends = __webpack_require__(33614);
|
|
// EXTERNAL MODULE: ./node_modules/_react@17.0.2@react/index.js
|
|
var _react_17_0_2_react = __webpack_require__(59301);
|
|
;// CONCATENATED MODULE: ./node_modules/_@ant-design_icons-svg@4.4.2@@ant-design/icons-svg/es/asn/PoweroffOutlined.js
|
|
// This icon file is generated automatically.
|
|
var PoweroffOutlined = { "icon": { "tag": "svg", "attrs": { "viewBox": "64 64 896 896", "focusable": "false" }, "children": [{ "tag": "path", "attrs": { "d": "M705.6 124.9a8 8 0 00-11.6 7.2v64.2c0 5.5 2.9 10.6 7.5 13.6a352.2 352.2 0 0162.2 49.8c32.7 32.8 58.4 70.9 76.3 113.3a355 355 0 0127.9 138.7c0 48.1-9.4 94.8-27.9 138.7a355.92 355.92 0 01-76.3 113.3 353.06 353.06 0 01-113.2 76.4c-43.8 18.6-90.5 28-138.5 28s-94.7-9.4-138.5-28a353.06 353.06 0 01-113.2-76.4A355.92 355.92 0 01184 650.4a355 355 0 01-27.9-138.7c0-48.1 9.4-94.8 27.9-138.7 17.9-42.4 43.6-80.5 76.3-113.3 19-19 39.8-35.6 62.2-49.8 4.7-2.9 7.5-8.1 7.5-13.6V132c0-6-6.3-9.8-11.6-7.2C178.5 195.2 82 339.3 80 506.3 77.2 745.1 272.5 943.5 511.2 944c239 .5 432.8-193.3 432.8-432.4 0-169.2-97-315.7-238.4-386.7zM480 560h64c4.4 0 8-3.6 8-8V88c0-4.4-3.6-8-8-8h-64c-4.4 0-8 3.6-8 8v464c0 4.4 3.6 8 8 8z" } }] }, "name": "poweroff", "theme": "outlined" };
|
|
/* harmony default export */ var asn_PoweroffOutlined = (PoweroffOutlined);
|
|
|
|
// EXTERNAL MODULE: ./node_modules/_@ant-design_icons@5.4.0@@ant-design/icons/es/components/AntdIcon.js + 3 modules
|
|
var AntdIcon = __webpack_require__(1393);
|
|
;// CONCATENATED MODULE: ./node_modules/_@ant-design_icons@5.4.0@@ant-design/icons/es/icons/PoweroffOutlined.js
|
|
|
|
// GENERATE BY ./scripts/generate.ts
|
|
// DON NOT EDIT IT MANUALLY
|
|
|
|
|
|
|
|
|
|
var PoweroffOutlined_PoweroffOutlined = function PoweroffOutlined(props, ref) {
|
|
return /*#__PURE__*/_react_17_0_2_react.createElement(AntdIcon/* default */.Z, (0,esm_extends/* default */.Z)({}, props, {
|
|
ref: ref,
|
|
icon: asn_PoweroffOutlined
|
|
}));
|
|
};
|
|
|
|
/** */
|
|
var RefIcon = /*#__PURE__*/_react_17_0_2_react.forwardRef(PoweroffOutlined_PoweroffOutlined);
|
|
if (false) {}
|
|
/* harmony default export */ var icons_PoweroffOutlined = (RefIcon);
|
|
|
|
/***/ }),
|
|
|
|
/***/ 47874:
|
|
/*!**********************************************************!*\
|
|
!*** ./src/pages/IOT/DeviceManage/index.tsx + 3 modules ***!
|
|
\**********************************************************/
|
|
/***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) {
|
|
|
|
// ESM COMPAT FLAG
|
|
__webpack_require__.r(__webpack_exports__);
|
|
|
|
// EXPORTS
|
|
__webpack_require__.d(__webpack_exports__, {
|
|
"default": function() { return /* binding */ IOT_DeviceManage; }
|
|
});
|
|
|
|
// 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);
|
|
// 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/slicedToArray.js
|
|
var slicedToArray = __webpack_require__(79800);
|
|
var slicedToArray_default = /*#__PURE__*/__webpack_require__.n(slicedToArray);
|
|
// EXTERNAL MODULE: ./node_modules/_react@17.0.2@react/index.js
|
|
var _react_17_0_2_react = __webpack_require__(59301);
|
|
// EXTERNAL MODULE: ./src/.umi-production/exports.ts
|
|
var _umi_production_exports = __webpack_require__(80608);
|
|
;// CONCATENATED MODULE: ./src/pages/IOT/DeviceManage/index.less?modules
|
|
// extracted by mini-css-extract-plugin
|
|
/* harmony default export */ var DeviceManagemodules = ({"header_div":"header_div___ahous","header_title":"header_title___iPn5F","search":"search___UkDHM","searchIcon":"searchIcon___SIkcY","clear_Data":"clear_Data___YvoGg","batch":"batch___v23TI","btns":"btns___i5wmg","btn":"btn___LIgtJ","my_modal":"my_modal___St6g5","maleRow":"maleRow___UeLNI","kg_btn":"kg_btn___hkLxY","kg_stutas":"kg_stutas___yNUPC","cancel_btn":"cancel_btn___KPjFL","is_spin":"is_spin___V9Izw"});
|
|
// 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/tooltip/index.js + 3 modules
|
|
var tooltip = __webpack_require__(6848);
|
|
// 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/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/_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/row/index.js
|
|
var row = __webpack_require__(95237);
|
|
// EXTERNAL MODULE: ./node_modules/_antd@5.9.0@antd/es/spin/index.js + 1 modules
|
|
var spin = __webpack_require__(71418);
|
|
// EXTERNAL MODULE: ./node_modules/_antd@5.9.0@antd/es/config-provider/index.js + 5 modules
|
|
var config_provider = __webpack_require__(92736);
|
|
// EXTERNAL MODULE: ./node_modules/_antd@5.9.0@antd/es/button/index.js
|
|
var es_button = __webpack_require__(3113);
|
|
// EXTERNAL MODULE: ./src/service/laboratory.ts
|
|
var laboratory = __webpack_require__(70974);
|
|
// EXTERNAL MODULE: ./node_modules/_@babel_runtime@7.25.6@@babel/runtime/helpers/esm/extends.js
|
|
var esm_extends = __webpack_require__(33614);
|
|
;// CONCATENATED MODULE: ./node_modules/_@ant-design_icons-svg@4.4.2@@ant-design/icons-svg/es/asn/CheckCircleOutlined.js
|
|
// This icon file is generated automatically.
|
|
var CheckCircleOutlined = { "icon": { "tag": "svg", "attrs": { "viewBox": "64 64 896 896", "focusable": "false" }, "children": [{ "tag": "path", "attrs": { "d": "M699 353h-46.9c-10.2 0-19.9 4.9-25.9 13.3L469 584.3l-71.2-98.8c-6-8.3-15.6-13.3-25.9-13.3H325c-6.5 0-10.3 7.4-6.5 12.7l124.6 172.8a31.8 31.8 0 0051.7 0l210.6-292c3.9-5.3.1-12.7-6.4-12.7z" } }, { "tag": "path", "attrs": { "d": "M512 64C264.6 64 64 264.6 64 512s200.6 448 448 448 448-200.6 448-448S759.4 64 512 64zm0 820c-205.4 0-372-166.6-372-372s166.6-372 372-372 372 166.6 372 372-166.6 372-372 372z" } }] }, "name": "check-circle", "theme": "outlined" };
|
|
/* harmony default export */ var asn_CheckCircleOutlined = (CheckCircleOutlined);
|
|
|
|
// EXTERNAL MODULE: ./node_modules/_@ant-design_icons@5.4.0@@ant-design/icons/es/components/AntdIcon.js + 3 modules
|
|
var AntdIcon = __webpack_require__(1393);
|
|
;// CONCATENATED MODULE: ./node_modules/_@ant-design_icons@5.4.0@@ant-design/icons/es/icons/CheckCircleOutlined.js
|
|
|
|
// GENERATE BY ./scripts/generate.ts
|
|
// DON NOT EDIT IT MANUALLY
|
|
|
|
|
|
|
|
|
|
var CheckCircleOutlined_CheckCircleOutlined = function CheckCircleOutlined(props, ref) {
|
|
return /*#__PURE__*/_react_17_0_2_react.createElement(AntdIcon/* default */.Z, (0,esm_extends/* default */.Z)({}, props, {
|
|
ref: ref,
|
|
icon: asn_CheckCircleOutlined
|
|
}));
|
|
};
|
|
|
|
/** */
|
|
var RefIcon = /*#__PURE__*/_react_17_0_2_react.forwardRef(CheckCircleOutlined_CheckCircleOutlined);
|
|
if (false) {}
|
|
/* harmony default export */ var icons_CheckCircleOutlined = (RefIcon);
|
|
// EXTERNAL MODULE: ./node_modules/_@ant-design_icons@5.4.0@@ant-design/icons/es/icons/PoweroffOutlined.js + 1 modules
|
|
var PoweroffOutlined = __webpack_require__(29419);
|
|
// EXTERNAL MODULE: ./src/service/iot.ts
|
|
var iot = __webpack_require__(15341);
|
|
// EXTERNAL MODULE: ./src/utils/fetch.ts
|
|
var fetch = __webpack_require__(49105);
|
|
// 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
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
var DeviceManage = function DeviceManage(_ref) {
|
|
var _ref3, _ref4;
|
|
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 statusVal = {
|
|
'running': {
|
|
txt: '通电中',
|
|
color: '#20A639'
|
|
},
|
|
'unstart': {
|
|
txt: '断电中',
|
|
color: '#1D4057'
|
|
},
|
|
'abnormal': {
|
|
txt: '异常',
|
|
color: '#FF0000'
|
|
}
|
|
};
|
|
var _useState5 = (0,_react_17_0_2_react.useState)([]),
|
|
_useState6 = slicedToArray_default()(_useState5, 2),
|
|
tableData = _useState6[0],
|
|
setTableData = _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)(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)(true),
|
|
_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),
|
|
rowData = _useState20[0],
|
|
setRowData = _useState20[1];
|
|
var _useState21 = (0,_react_17_0_2_react.useState)(false),
|
|
_useState22 = slicedToArray_default()(_useState21, 2),
|
|
controlModal = _useState22[0],
|
|
setControlModal = _useState22[1];
|
|
|
|
//实验室
|
|
var _useState23 = (0,_react_17_0_2_react.useState)([]),
|
|
_useState24 = slicedToArray_default()(_useState23, 2),
|
|
laboratorys = _useState24[0],
|
|
setLaboratorys = _useState24[1];
|
|
//实验室房间
|
|
var _useState25 = (0,_react_17_0_2_react.useState)([]),
|
|
_useState26 = slicedToArray_default()(_useState25, 2),
|
|
rooms = _useState26[0],
|
|
setRooms = _useState26[1];
|
|
var _useState27 = (0,_react_17_0_2_react.useState)(''),
|
|
_useState28 = slicedToArray_default()(_useState27, 2),
|
|
sys = _useState28[0],
|
|
setSys = _useState28[1];
|
|
var _useState29 = (0,_react_17_0_2_react.useState)(''),
|
|
_useState30 = slicedToArray_default()(_useState29, 2),
|
|
sysRoom = _useState30[0],
|
|
setSysRoom = _useState30[1];
|
|
var _useState31 = (0,_react_17_0_2_react.useState)(''),
|
|
_useState32 = slicedToArray_default()(_useState31, 2),
|
|
deviceStatus = _useState32[0],
|
|
setDeviceStatus = _useState32[1];
|
|
var _Form$useForm = es_form/* default */.Z.useForm(),
|
|
_Form$useForm2 = slicedToArray_default()(_Form$useForm, 1),
|
|
myForm = _Form$useForm2[0];
|
|
var _useState33 = (0,_react_17_0_2_react.useState)(false),
|
|
_useState34 = slicedToArray_default()(_useState33, 2),
|
|
openAddModal = _useState34[0],
|
|
setOpenAddModal = _useState34[1];
|
|
var _useState35 = (0,_react_17_0_2_react.useState)([]),
|
|
_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 _useState39 = (0,_react_17_0_2_react.useState)(false),
|
|
_useState40 = slicedToArray_default()(_useState39, 2),
|
|
tableLoading = _useState40[0],
|
|
setTableLoading = _useState40[1];
|
|
var isFirstLoad = (0,_react_17_0_2_react.useRef)(true);
|
|
var columns = [{
|
|
title: '设备编号',
|
|
dataIndex: 'number',
|
|
ellipsis: true,
|
|
render: function render(text) {
|
|
return /*#__PURE__*/(0,jsx_runtime.jsx)(tooltip/* default */.Z, {
|
|
placement: "bottomLeft",
|
|
title: text,
|
|
children: /*#__PURE__*/(0,jsx_runtime.jsx)("span", {
|
|
children: text ? "".concat(text) : '--'
|
|
})
|
|
});
|
|
}
|
|
}, {
|
|
title: '设备名称',
|
|
dataIndex: 'name',
|
|
ellipsis: true,
|
|
render: function render(text) {
|
|
return /*#__PURE__*/(0,jsx_runtime.jsx)(tooltip/* default */.Z, {
|
|
placement: "bottomLeft",
|
|
title: text,
|
|
children: /*#__PURE__*/(0,jsx_runtime.jsx)("span", {
|
|
children: text ? "".concat(text) : '--'
|
|
})
|
|
});
|
|
}
|
|
},
|
|
// {
|
|
// title: '设备类型',
|
|
// dataIndex: 'genre_name',
|
|
// ellipsis: true,
|
|
// render: (text: string) => {
|
|
// return (
|
|
// <Tooltip placement="bottomLeft" title={text}>
|
|
// <span>{text ? `${text}` : '--'}</span>
|
|
// </Tooltip>
|
|
// );
|
|
// },
|
|
// },
|
|
{
|
|
title: '设备型号',
|
|
dataIndex: 'model',
|
|
ellipsis: true,
|
|
render: function render(text) {
|
|
return /*#__PURE__*/(0,jsx_runtime.jsx)(tooltip/* default */.Z, {
|
|
placement: "bottomLeft",
|
|
title: text,
|
|
children: /*#__PURE__*/(0,jsx_runtime.jsx)("span", {
|
|
children: text ? "".concat(text) : '--'
|
|
})
|
|
});
|
|
}
|
|
}, {
|
|
title: '设备状态',
|
|
dataIndex: 'use_status',
|
|
ellipsis: true,
|
|
render: function render(text) {
|
|
var _statusVal$text, _statusVal$text2, _statusVal$text3;
|
|
return /*#__PURE__*/(0,jsx_runtime.jsx)(tooltip/* default */.Z, {
|
|
placement: "bottomLeft",
|
|
title: ((_statusVal$text = statusVal[text]) === null || _statusVal$text === void 0 ? void 0 : _statusVal$text.txt) || '--',
|
|
children: /*#__PURE__*/(0,jsx_runtime.jsx)("span", {
|
|
style: {
|
|
color: "".concat((_statusVal$text2 = statusVal[text]) === null || _statusVal$text2 === void 0 ? void 0 : _statusVal$text2.color)
|
|
},
|
|
children: ((_statusVal$text3 = statusVal[text]) === null || _statusVal$text3 === void 0 ? void 0 : _statusVal$text3.txt) || '--'
|
|
})
|
|
});
|
|
}
|
|
}, {
|
|
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: '所属实验室房间',
|
|
dataIndex: 'classroom_room_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,
|
|
align: 'right',
|
|
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() {
|
|
(0,laboratory/* classroom_rooms_query */.jd)({
|
|
page: 1,
|
|
limit: 10000,
|
|
classroom_id: record === null || record === void 0 ? void 0 : record.classroom_id
|
|
}).then(function (res) {
|
|
var _res$data;
|
|
setRooms2(toConsumableArray_default()(res === null || res === void 0 || (_res$data = res.data) === null || _res$data === void 0 ? void 0 : _res$data.list));
|
|
});
|
|
setRowData(record);
|
|
setOpenAddModal(true);
|
|
myForm.setFieldsValue(record);
|
|
},
|
|
children: "\u7F16\u8F91"
|
|
}), record.use_status != 'abnormal' && /*#__PURE__*/(0,jsx_runtime.jsx)("span", {
|
|
style: {
|
|
color: "#165DFF",
|
|
cursor: "pointer",
|
|
marginLeft: '20px'
|
|
},
|
|
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"
|
|
})]
|
|
});
|
|
}
|
|
}];
|
|
(0,_react_17_0_2_react.useEffect)(function () {
|
|
//实验室
|
|
(0,laboratory/* classroom_query */.GJ)({
|
|
page: 1,
|
|
limit: 10000
|
|
}).then(function (res) {
|
|
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)({
|
|
page: 1,
|
|
limit: 10000,
|
|
classroom_id: ''
|
|
}).then(function (res) {
|
|
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',
|
|
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 () {
|
|
if (!isFirstLoad.current) {
|
|
getData(true);
|
|
} else {
|
|
isFirstLoad.current = false;
|
|
}
|
|
}, [keyword, sys, sysRoom, deviceStatus, limit]);
|
|
var getData = function getData(flag) {
|
|
if (flag) {
|
|
setPage(1);
|
|
}
|
|
setTableLoading(true);
|
|
(0,iot/* getIOTDeviceList */.Yj)({
|
|
page: page,
|
|
limit: limit,
|
|
keyword: keyword,
|
|
classroom_id: sys,
|
|
classroom_room_id: sysRoom,
|
|
use_status: deviceStatus,
|
|
// 1:非物理网设备 2:电子班牌 3:智慧开关
|
|
genre: 3
|
|
}).then(function (res) {
|
|
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;
|
|
}));
|
|
setTableLoading(false);
|
|
});
|
|
};
|
|
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;
|
|
}));
|
|
}
|
|
};
|
|
var validateIPAddress = function validateIPAddress(_, value) {
|
|
if (value && !/^(\d{1,3}\.){3}\d{1,3}$/.test(value)) {
|
|
return Promise.reject(new Error('请输入正确的 IP 地址'));
|
|
}
|
|
return Promise.resolve();
|
|
};
|
|
var rowClassName = function rowClassName(record, index) {
|
|
if (record.use_status === 'abnormal') {
|
|
return DeviceManagemodules.maleRow;
|
|
}
|
|
};
|
|
return /*#__PURE__*/(0,jsx_runtime.jsx)("div", {
|
|
style: {
|
|
background: "#fff"
|
|
},
|
|
children: /*#__PURE__*/(0,jsx_runtime.jsxs)("div", {
|
|
style: {
|
|
margin: '0 100px'
|
|
},
|
|
children: [/*#__PURE__*/(0,jsx_runtime.jsxs)("div", {
|
|
className: DeviceManagemodules.header_div,
|
|
children: [/*#__PURE__*/(0,jsx_runtime.jsx)("div", {
|
|
className: DeviceManagemodules.header_title,
|
|
children: "\u5B9E\u9A8C\u5BA4\u7535\u6E90\u8FDC\u7A0B\u63A7\u5236\u7CFB\u7EDF"
|
|
}), /*#__PURE__*/(0,jsx_runtime.jsx)(input/* default */.Z.Search, {
|
|
style: {
|
|
marginLeft: 'auto'
|
|
},
|
|
placeholder: "\u8BF7\u8F93\u5165\u540D\u79F0/\u8BBE\u5907\u7F16\u53F7",
|
|
size: "large",
|
|
className: DeviceManagemodules.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(DeviceManagemodules.searchIcon),
|
|
onClick: function onClick() {
|
|
setkeyword(keyword);
|
|
getData(true);
|
|
}
|
|
})
|
|
}), /*#__PURE__*/(0,jsx_runtime.jsx)("div", {
|
|
className: DeviceManagemodules.clear_Data,
|
|
onClick: function onClick() {
|
|
setRowData(null);
|
|
setRooms2([]);
|
|
setOpenAddModal(true);
|
|
},
|
|
children: "\u5173\u8054\u8BBE\u5907"
|
|
})]
|
|
}), /*#__PURE__*/(0,jsx_runtime.jsxs)("div", {
|
|
className: DeviceManagemodules.header_div,
|
|
style: {
|
|
margin: '20px 0px 6px 0px'
|
|
},
|
|
children: [/*#__PURE__*/(0,jsx_runtime.jsx)(es_form/* default */.Z.Item, {
|
|
colon: false,
|
|
label: "\u6240\u5C5E\u5B9E\u9A8C\u5BA4",
|
|
children: /*#__PURE__*/(0,jsx_runtime.jsx)(es_select["default"], {
|
|
size: "large",
|
|
style: {
|
|
width: 140
|
|
},
|
|
defaultValue: sys,
|
|
value: sys,
|
|
onChange: function onChange(e) {
|
|
setSys(e);
|
|
//实验室房间
|
|
(0,laboratory/* classroom_rooms_query */.jd)({
|
|
page: 1,
|
|
limit: 10000,
|
|
classroom_id: e
|
|
}).then(function (res) {
|
|
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: (_ref3 = [{
|
|
id: '',
|
|
title: '全部'
|
|
}].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
|
|
}, index);
|
|
})
|
|
})
|
|
}), /*#__PURE__*/(0,jsx_runtime.jsx)(es_form/* default */.Z.Item, {
|
|
colon: false,
|
|
label: "\u6240\u5C5E\u5B9E\u9A8C\u5BA4\u623F\u95F4",
|
|
style: {
|
|
marginLeft: '20px'
|
|
},
|
|
children: /*#__PURE__*/(0,jsx_runtime.jsx)(es_select["default"], {
|
|
size: "large",
|
|
style: {
|
|
width: 140
|
|
},
|
|
defaultValue: sysRoom,
|
|
value: sysRoom,
|
|
onChange: function onChange(e) {
|
|
setSysRoom(e);
|
|
},
|
|
children: (_ref4 = [{
|
|
id: '',
|
|
title: '全部'
|
|
}].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
|
|
}, index);
|
|
})
|
|
})
|
|
}), /*#__PURE__*/(0,jsx_runtime.jsx)(es_form/* default */.Z.Item, {
|
|
colon: false,
|
|
label: "\u8BBE\u5907\u72B6\u6001",
|
|
style: {
|
|
marginLeft: '20px'
|
|
},
|
|
children: /*#__PURE__*/(0,jsx_runtime.jsxs)(es_select["default"], {
|
|
style: {
|
|
width: 140
|
|
},
|
|
defaultValue: deviceStatus,
|
|
value: deviceStatus,
|
|
onChange: function onChange(e) {
|
|
setDeviceStatus(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: "2",
|
|
children: "\u901A\u7535\u4E2D"
|
|
}), /*#__PURE__*/(0,jsx_runtime.jsx)(es_select["default"].Option, {
|
|
value: "1",
|
|
children: "\u65AD\u7535\u4E2D"
|
|
}), /*#__PURE__*/(0,jsx_runtime.jsx)(es_select["default"].Option, {
|
|
value: "3",
|
|
children: "\u5F02\u5E38"
|
|
})]
|
|
})
|
|
})]
|
|
}), /*#__PURE__*/(0,jsx_runtime.jsx)(table/* default */.Z, {
|
|
// rowSelection={{
|
|
// type: 'checkbox',
|
|
// ...rowSelection,
|
|
// }}
|
|
loading: tableLoading,
|
|
pagination: false,
|
|
dataSource: tableData,
|
|
columns: columns,
|
|
rowClassName: rowClassName
|
|
}, 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: DeviceManagemodules.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: DeviceManagemodules.btns,
|
|
children: [/*#__PURE__*/(0,jsx_runtime.jsxs)("div", {
|
|
className: DeviceManagemodules.btn,
|
|
onClick: function onClick() {
|
|
modal/* default */.Z.confirm({
|
|
centered: true,
|
|
okText: '确定',
|
|
cancelText: '取消',
|
|
icon: null,
|
|
title: "提示",
|
|
content: "\u60A8\u9009\u4E2D\u7684\u8BBE\u5907\uFF08".concat(selectIds === null || selectIds === void 0 ? void 0 : selectIds.map(function (item) {
|
|
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 _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) {
|
|
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 _context2.stop();
|
|
}
|
|
}, _callee2);
|
|
}));
|
|
function onOk() {
|
|
return _onOk.apply(this, arguments);
|
|
}
|
|
return onOk;
|
|
}()
|
|
});
|
|
},
|
|
children: [" ", /*#__PURE__*/(0,jsx_runtime.jsx)(icons_CheckCircleOutlined, {
|
|
style: {
|
|
marginRight: 5
|
|
}
|
|
}), "\u6279\u91CF\u5F00\u673A"]
|
|
}), /*#__PURE__*/(0,jsx_runtime.jsxs)("div", {
|
|
className: DeviceManagemodules.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: "\u60A8\u9009\u4E2D\u7684\u8BBE\u5907\uFF08".concat(selectIds === null || selectIds === void 0 ? void 0 : selectIds.map(function (item) {
|
|
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 _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) {
|
|
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 _context3.stop();
|
|
}
|
|
}, _callee3);
|
|
}));
|
|
function onOk() {
|
|
return _onOk2.apply(this, arguments);
|
|
}
|
|
return onOk;
|
|
}()
|
|
});
|
|
},
|
|
children: [" ", /*#__PURE__*/(0,jsx_runtime.jsx)(PoweroffOutlined/* default */.Z, {
|
|
style: {
|
|
marginRight: 5
|
|
}
|
|
}), "\u6279\u91CF\u5173\u673A"]
|
|
}), /*#__PURE__*/(0,jsx_runtime.jsxs)("div", {
|
|
onClick: function onClick() {
|
|
setSelectIds([]);
|
|
setRefresh(new Date());
|
|
},
|
|
style: {
|
|
marginLeft: 'auto'
|
|
},
|
|
className: DeviceManagemodules.btn,
|
|
children: [" ", /*#__PURE__*/(0,jsx_runtime.jsx)("i", {
|
|
className: "iconfont icon-piliangcaozuoicon2"
|
|
}), "\u53D6\u6D88\u64CD\u4F5C"]
|
|
})]
|
|
})]
|
|
})
|
|
}), /*#__PURE__*/(0,jsx_runtime.jsx)(modal/* default */.Z, {
|
|
maskClosable: false,
|
|
centered: true,
|
|
keyboard: false,
|
|
destroyOnClose: true,
|
|
className: DeviceManagemodules.my_modal,
|
|
open: openAddModal,
|
|
title: "".concat(rowData ? '编辑关联设备' : '关联设备'),
|
|
width: "948px",
|
|
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:
|
|
_context4.next = 2;
|
|
return myForm.validateFields();
|
|
case 2:
|
|
if (rowData) {
|
|
(0,iot/* editIOTDevices */.Tk)({
|
|
device: objectSpread2_default()({}, myForm.getFieldsValue())
|
|
}, rowData === null || rowData === void 0 ? void 0 : rowData.id).then(function (res) {
|
|
if ((res === null || res === void 0 ? void 0 : res.status) == 0) {
|
|
message/* default */.ZP.success('编辑成功');
|
|
setOpenAddModal(false);
|
|
myForm.resetFields();
|
|
getData(true);
|
|
}
|
|
});
|
|
} else {
|
|
(0,iot/* addIOTDevices */["if"])({
|
|
device: objectSpread2_default()(objectSpread2_default()({}, myForm.getFieldsValue()), {}, {
|
|
genre: 'smart_switch',
|
|
category: 1
|
|
})
|
|
}).then(function (res) {
|
|
if ((res === null || res === void 0 ? void 0 : res.status) == 0) {
|
|
message/* default */.ZP.success('关联成功');
|
|
setOpenAddModal(false);
|
|
myForm.resetFields();
|
|
getData(true);
|
|
}
|
|
});
|
|
}
|
|
case 3:
|
|
case "end":
|
|
return _context4.stop();
|
|
}
|
|
}, _callee4);
|
|
})),
|
|
onCancel: function onCancel() {
|
|
setOpenAddModal(false);
|
|
myForm.resetFields();
|
|
},
|
|
children: /*#__PURE__*/(0,jsx_runtime.jsxs)(es_form/* default */.Z, {
|
|
form: myForm,
|
|
wrapperCol: {
|
|
span: 19
|
|
},
|
|
style: {
|
|
maxHeight: "550px",
|
|
overflowY: 'auto'
|
|
},
|
|
children: [/*#__PURE__*/(0,jsx_runtime.jsxs)(row/* default */.Z, {
|
|
children: [/*#__PURE__*/(0,jsx_runtime.jsx)(es_form/* default */.Z.Item, {
|
|
colon: false,
|
|
label: "\u8BBE\u5907\u7F16\u53F7",
|
|
name: "number",
|
|
rules: [{
|
|
required: true
|
|
}],
|
|
children: /*#__PURE__*/(0,jsx_runtime.jsx)(input/* default */.Z, {
|
|
size: "large",
|
|
placeholder: "\u8BF7\u8F93\u5165\u8BBE\u5907\u7F16\u53F7",
|
|
showCount: true,
|
|
maxLength: 10,
|
|
onChange: function onChange(e) {
|
|
var _e$target;
|
|
myForm.setFieldValue('number', e === null || e === void 0 || (_e$target = e.target) === null || _e$target === void 0 || (_e$target = _e$target.value) === null || _e$target === void 0 ? void 0 : _e$target.trim());
|
|
}
|
|
})
|
|
}), /*#__PURE__*/(0,jsx_runtime.jsx)(es_form/* default */.Z.Item, {
|
|
colon: false,
|
|
label: "\u8BBE\u5907\u540D\u79F0",
|
|
name: "name",
|
|
rules: [{
|
|
required: true
|
|
}],
|
|
children: /*#__PURE__*/(0,jsx_runtime.jsx)(input/* default */.Z, {
|
|
size: "large",
|
|
placeholder: "\u8BF7\u8F93\u5165\u8BBE\u5907\u540D\u79F0",
|
|
showCount: true,
|
|
maxLength: 30,
|
|
onChange: function onChange(e) {
|
|
var _e$target2;
|
|
myForm.setFieldValue('name', e === null || e === void 0 || (_e$target2 = e.target) === null || _e$target2 === void 0 || (_e$target2 = _e$target2.value) === null || _e$target2 === void 0 ? void 0 : _e$target2.trim());
|
|
}
|
|
})
|
|
})]
|
|
}), /*#__PURE__*/(0,jsx_runtime.jsxs)(row/* default */.Z, {
|
|
children: [/*#__PURE__*/(0,jsx_runtime.jsx)(es_form/* default */.Z.Item, {
|
|
colon: false,
|
|
label: "\u8BBE\u5907\u578B\u53F7",
|
|
name: "model",
|
|
rules: [{
|
|
required: true
|
|
}],
|
|
children: /*#__PURE__*/(0,jsx_runtime.jsx)(input/* default */.Z, {
|
|
size: "large",
|
|
placeholder: "\u8BF7\u8F93\u5165\u8BBE\u5907\u578B\u53F7",
|
|
showCount: true,
|
|
maxLength: 30,
|
|
onChange: function onChange(e) {
|
|
var _e$target3;
|
|
myForm.setFieldValue('model', e === null || e === void 0 || (_e$target3 = e.target) === null || _e$target3 === void 0 || (_e$target3 = _e$target3.value) === null || _e$target3 === void 0 ? void 0 : _e$target3.trim());
|
|
}
|
|
})
|
|
}), /*#__PURE__*/(0,jsx_runtime.jsx)(es_form/* default */.Z.Item, {
|
|
colon: false,
|
|
label: "\u8BBE\u5907IP",
|
|
name: "ip",
|
|
rules: [{
|
|
required: true,
|
|
message: '请输入设备IP'
|
|
}, {
|
|
validator: validateIPAddress
|
|
}],
|
|
children: /*#__PURE__*/(0,jsx_runtime.jsx)(input/* default */.Z, {
|
|
size: "large",
|
|
placeholder: "\u8BF7\u8F93\u5165\u8BBE\u5907IP",
|
|
onChange: function onChange(e) {
|
|
var _e$target4;
|
|
myForm.setFieldValue('ip', e === null || e === void 0 || (_e$target4 = e.target) === null || _e$target4 === void 0 || (_e$target4 = _e$target4.value) === null || _e$target4 === void 0 ? void 0 : _e$target4.trim());
|
|
}
|
|
})
|
|
})]
|
|
}), /*#__PURE__*/(0,jsx_runtime.jsx)(row/* default */.Z, {
|
|
children: /*#__PURE__*/(0,jsx_runtime.jsx)(es_form/* default */.Z.Item, {
|
|
colon: false,
|
|
label: "\u7AEF\u53E3",
|
|
name: "port",
|
|
rules: [{
|
|
required: true,
|
|
message: "请输入端口号"
|
|
}, {
|
|
validator: function validator(_, value) {
|
|
return /^([0-9]|[1-9]\d|[1-9]\d{2}|[1-9]\d{3}|[1-5]\d{4}|6[0-4]\d{3}|65[0-4]\d{2}|655[0-2]\d|6553[0-5])$/.test(value) || !value ? Promise.resolve() : Promise.reject(new Error('端口输入范围(0-65535)'));
|
|
}
|
|
}],
|
|
children: /*#__PURE__*/(0,jsx_runtime.jsx)(input/* default */.Z, {
|
|
size: "large",
|
|
placeholder: "\u8BF7\u8F93\u5165\u7AEF\u53E3",
|
|
onChange: function onChange(e) {
|
|
var _e$target5;
|
|
myForm.setFieldValue('port', e === null || e === void 0 || (_e$target5 = e.target) === null || _e$target5 === void 0 || (_e$target5 = _e$target5.value) === null || _e$target5 === void 0 ? void 0 : _e$target5.trim());
|
|
}
|
|
})
|
|
})
|
|
}), /*#__PURE__*/(0,jsx_runtime.jsxs)(row/* default */.Z, {
|
|
children: [/*#__PURE__*/(0,jsx_runtime.jsx)(es_form/* default */.Z.Item, {
|
|
colon: false,
|
|
label: "\u5173\u8054\u5730\u70B9",
|
|
name: "classroom_id",
|
|
rules: [{
|
|
required: true,
|
|
message: '请选择实验室'
|
|
}],
|
|
style: {
|
|
width: '60%'
|
|
},
|
|
children: /*#__PURE__*/(0,jsx_runtime.jsx)(es_select["default"], {
|
|
size: "large",
|
|
placeholder: "\u8BF7\u9009\u62E9\u5B9E\u9A8C\u5BA4",
|
|
onChange: function onChange(e) {
|
|
myForm.setFieldValue('classroom_room_id', null);
|
|
//实验室房间
|
|
(0,laboratory/* classroom_rooms_query */.jd)({
|
|
page: 1,
|
|
limit: 10000,
|
|
classroom_id: e
|
|
}).then(function (res) {
|
|
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) {
|
|
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)(es_form/* default */.Z.Item, {
|
|
colon: false,
|
|
label: "",
|
|
name: "classroom_room_id",
|
|
style: {
|
|
width: '40%'
|
|
},
|
|
rules: [{
|
|
required: true,
|
|
message: '请选择实验室房间'
|
|
}],
|
|
children: /*#__PURE__*/(0,jsx_runtime.jsx)(es_select["default"], {
|
|
size: "large",
|
|
placeholder: "\u8BF7\u9009\u62E9\u5B9E\u9A8C\u5BA4\u623F\u95F4",
|
|
style: {
|
|
width: '300px !important'
|
|
},
|
|
children: rooms2 === null || rooms2 === void 0 ? void 0 : rooms2.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)(modal/* default */.Z, {
|
|
maskClosable: false,
|
|
centered: true,
|
|
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(").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: !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.jsx)(config_provider/* default */.ZP, {
|
|
theme: {
|
|
components: {
|
|
Spin: {
|
|
colorBgContainer: 'rgba(0, 0, 0, .4)'
|
|
}
|
|
}
|
|
},
|
|
children: /*#__PURE__*/(0,jsx_runtime.jsxs)(spin/* default */.Z, {
|
|
className: DeviceManagemodules.is_spin,
|
|
delay: 500,
|
|
spinning: !isLoading,
|
|
tip: (rowData === null || rowData === void 0 ? void 0 : rowData.use_status) == 'unstart' ? '断电中' : '通电中',
|
|
style: {
|
|
paddingTop: 20
|
|
},
|
|
children: [/*#__PURE__*/(0,jsx_runtime.jsx)("div", {
|
|
className: "pt20"
|
|
}), /*#__PURE__*/(0,jsx_runtime.jsx)("div", {
|
|
className: DeviceManagemodules.kg_btn,
|
|
style: {
|
|
background: "".concat((rowData === null || rowData === void 0 ? void 0 : rowData.use_status) == 'unstart' ? '#20A639' : '#FF0000')
|
|
},
|
|
onClick: function onClick() {
|
|
setIsLoading(false);
|
|
if ((rowData === null || rowData === void 0 ? void 0 : rowData.use_status) == 'unstart') {
|
|
(0,iot/* lot_up */.zh)({
|
|
device_ids: [rowData === null || rowData === void 0 ? void 0 : rowData.id]
|
|
}).then(function (res) {
|
|
if ((res === null || res === void 0 ? void 0 : res.status) == 0) {
|
|
message/* default */.ZP.success('通电成功');
|
|
getData(false);
|
|
}
|
|
setIsLoading(true);
|
|
setControlModal(false);
|
|
});
|
|
}
|
|
if ((rowData === null || rowData === void 0 ? void 0 : rowData.use_status) == 'running') {
|
|
(0,iot/* lot_down */.hQ)({
|
|
device_ids: [rowData === null || rowData === void 0 ? void 0 : rowData.id]
|
|
}).then(function (res) {
|
|
if ((res === null || res === void 0 ? void 0 : res.status) == 0) {
|
|
message/* default */.ZP.success('断电成功');
|
|
getData(false);
|
|
}
|
|
setIsLoading(true);
|
|
setControlModal(false);
|
|
});
|
|
}
|
|
},
|
|
children: /*#__PURE__*/(0,jsx_runtime.jsx)(PoweroffOutlined/* default */.Z, {
|
|
style: {
|
|
color: '#fff'
|
|
}
|
|
})
|
|
}), /*#__PURE__*/(0,jsx_runtime.jsx)("div", {
|
|
className: DeviceManagemodules.kg_stutas,
|
|
children: (rowData === null || rowData === void 0 ? void 0 : rowData.use_status) == 'unstart' ? '通电' : '断电'
|
|
}), /*#__PURE__*/(0,jsx_runtime.jsx)("div", {
|
|
className: "pb20",
|
|
style: {
|
|
width: '100%',
|
|
display: 'flex',
|
|
justifyContent: 'center'
|
|
},
|
|
children: /*#__PURE__*/(0,jsx_runtime.jsx)(es_button/* default */.ZP, {
|
|
type: "primary",
|
|
className: DeviceManagemodules.cancel_btn,
|
|
size: "large",
|
|
onClick: function onClick() {
|
|
setControlModal(false);
|
|
},
|
|
children: "\u53D6\u6D88"
|
|
})
|
|
})]
|
|
})
|
|
})
|
|
})]
|
|
})
|
|
});
|
|
};
|
|
/* 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), {}, {
|
|
dispatch: dispatch
|
|
});
|
|
})(DeviceManage));
|
|
|
|
/***/ }),
|
|
|
|
/***/ 15341:
|
|
/*!****************************!*\
|
|
!*** ./src/service/iot.ts ***!
|
|
\****************************/
|
|
/***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) {
|
|
|
|
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
|
|
/* harmony export */ Tk: function() { return /* binding */ editIOTDevices; },
|
|
/* harmony export */ Yj: function() { return /* binding */ getIOTDeviceList; },
|
|
/* harmony export */ hQ: function() { return /* binding */ lot_down; },
|
|
/* harmony export */ "if": function() { return /* binding */ addIOTDevices; },
|
|
/* harmony export */ zh: function() { return /* binding */ lot_up; }
|
|
/* harmony export */ });
|
|
/* harmony import */ var _root_workspace_ppte5yg23_local_v9_test4_node_modules_babel_runtime_7_23_6_babel_runtime_helpers_regeneratorRuntime_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./node_modules/_@babel_runtime@7.23.6@@babel/runtime/helpers/regeneratorRuntime.js */ 7557);
|
|
/* harmony import */ var _root_workspace_ppte5yg23_local_v9_test4_node_modules_babel_runtime_7_23_6_babel_runtime_helpers_regeneratorRuntime_js__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_root_workspace_ppte5yg23_local_v9_test4_node_modules_babel_runtime_7_23_6_babel_runtime_helpers_regeneratorRuntime_js__WEBPACK_IMPORTED_MODULE_0__);
|
|
/* harmony import */ var _root_workspace_ppte5yg23_local_v9_test4_node_modules_babel_runtime_7_23_6_babel_runtime_helpers_objectSpread2_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./node_modules/_@babel_runtime@7.23.6@@babel/runtime/helpers/objectSpread2.js */ 82242);
|
|
/* harmony import */ var _root_workspace_ppte5yg23_local_v9_test4_node_modules_babel_runtime_7_23_6_babel_runtime_helpers_objectSpread2_js__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_root_workspace_ppte5yg23_local_v9_test4_node_modules_babel_runtime_7_23_6_babel_runtime_helpers_objectSpread2_js__WEBPACK_IMPORTED_MODULE_1__);
|
|
/* harmony import */ var _root_workspace_ppte5yg23_local_v9_test4_node_modules_babel_runtime_7_23_6_babel_runtime_helpers_asyncToGenerator_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./node_modules/_@babel_runtime@7.23.6@@babel/runtime/helpers/asyncToGenerator.js */ 41498);
|
|
/* harmony import */ var _root_workspace_ppte5yg23_local_v9_test4_node_modules_babel_runtime_7_23_6_babel_runtime_helpers_asyncToGenerator_js__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(_root_workspace_ppte5yg23_local_v9_test4_node_modules_babel_runtime_7_23_6_babel_runtime_helpers_asyncToGenerator_js__WEBPACK_IMPORTED_MODULE_2__);
|
|
/* harmony import */ var _utils_fetch__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! @/utils/fetch */ 49105);
|
|
|
|
|
|
|
|
|
|
|
|
//物联网设备列表
|
|
function getIOTDeviceList(_x) {
|
|
return _getIOTDeviceList.apply(this, arguments);
|
|
}
|
|
|
|
//添加关联设备管理
|
|
function _getIOTDeviceList() {
|
|
_getIOTDeviceList = _root_workspace_ppte5yg23_local_v9_test4_node_modules_babel_runtime_7_23_6_babel_runtime_helpers_asyncToGenerator_js__WEBPACK_IMPORTED_MODULE_2___default()( /*#__PURE__*/_root_workspace_ppte5yg23_local_v9_test4_node_modules_babel_runtime_7_23_6_babel_runtime_helpers_regeneratorRuntime_js__WEBPACK_IMPORTED_MODULE_0___default()().mark(function _callee4(params) {
|
|
return _root_workspace_ppte5yg23_local_v9_test4_node_modules_babel_runtime_7_23_6_babel_runtime_helpers_regeneratorRuntime_js__WEBPACK_IMPORTED_MODULE_0___default()().wrap(function _callee4$(_context4) {
|
|
while (1) switch (_context4.prev = _context4.next) {
|
|
case 0:
|
|
return _context4.abrupt("return", (0,_utils_fetch__WEBPACK_IMPORTED_MODULE_3__/* ["default"] */ .ZP)('/api/yn_classrooms/devices/lots.json', {
|
|
method: 'get',
|
|
params: _root_workspace_ppte5yg23_local_v9_test4_node_modules_babel_runtime_7_23_6_babel_runtime_helpers_objectSpread2_js__WEBPACK_IMPORTED_MODULE_1___default()({}, params)
|
|
}));
|
|
case 1:
|
|
case "end":
|
|
return _context4.stop();
|
|
}
|
|
}, _callee4);
|
|
}));
|
|
return _getIOTDeviceList.apply(this, arguments);
|
|
}
|
|
var addIOTDevices = /*#__PURE__*/function () {
|
|
var _ref = _root_workspace_ppte5yg23_local_v9_test4_node_modules_babel_runtime_7_23_6_babel_runtime_helpers_asyncToGenerator_js__WEBPACK_IMPORTED_MODULE_2___default()( /*#__PURE__*/_root_workspace_ppte5yg23_local_v9_test4_node_modules_babel_runtime_7_23_6_babel_runtime_helpers_regeneratorRuntime_js__WEBPACK_IMPORTED_MODULE_0___default()().mark(function _callee(params) {
|
|
return _root_workspace_ppte5yg23_local_v9_test4_node_modules_babel_runtime_7_23_6_babel_runtime_helpers_regeneratorRuntime_js__WEBPACK_IMPORTED_MODULE_0___default()().wrap(function _callee$(_context) {
|
|
while (1) switch (_context.prev = _context.next) {
|
|
case 0:
|
|
return _context.abrupt("return", (0,_utils_fetch__WEBPACK_IMPORTED_MODULE_3__/* ["default"] */ .ZP)('/api/yn_classrooms/devices.json', {
|
|
method: 'post',
|
|
body: _root_workspace_ppte5yg23_local_v9_test4_node_modules_babel_runtime_7_23_6_babel_runtime_helpers_objectSpread2_js__WEBPACK_IMPORTED_MODULE_1___default()({}, params)
|
|
}));
|
|
case 1:
|
|
case "end":
|
|
return _context.stop();
|
|
}
|
|
}, _callee);
|
|
}));
|
|
return function addIOTDevices(_x2) {
|
|
return _ref.apply(this, arguments);
|
|
};
|
|
}();
|
|
|
|
//编辑物联网设备
|
|
function editIOTDevices(_x3, _x4) {
|
|
return _editIOTDevices.apply(this, arguments);
|
|
}
|
|
|
|
//智慧开关开机
|
|
function _editIOTDevices() {
|
|
_editIOTDevices = _root_workspace_ppte5yg23_local_v9_test4_node_modules_babel_runtime_7_23_6_babel_runtime_helpers_asyncToGenerator_js__WEBPACK_IMPORTED_MODULE_2___default()( /*#__PURE__*/_root_workspace_ppte5yg23_local_v9_test4_node_modules_babel_runtime_7_23_6_babel_runtime_helpers_regeneratorRuntime_js__WEBPACK_IMPORTED_MODULE_0___default()().mark(function _callee5(params, id) {
|
|
return _root_workspace_ppte5yg23_local_v9_test4_node_modules_babel_runtime_7_23_6_babel_runtime_helpers_regeneratorRuntime_js__WEBPACK_IMPORTED_MODULE_0___default()().wrap(function _callee5$(_context5) {
|
|
while (1) switch (_context5.prev = _context5.next) {
|
|
case 0:
|
|
return _context5.abrupt("return", (0,_utils_fetch__WEBPACK_IMPORTED_MODULE_3__/* ["default"] */ .ZP)("/api/yn_classrooms/devices/".concat(id, ".json"), {
|
|
method: 'put',
|
|
body: params
|
|
}));
|
|
case 1:
|
|
case "end":
|
|
return _context5.stop();
|
|
}
|
|
}, _callee5);
|
|
}));
|
|
return _editIOTDevices.apply(this, arguments);
|
|
}
|
|
var lot_up = /*#__PURE__*/function () {
|
|
var _ref2 = _root_workspace_ppte5yg23_local_v9_test4_node_modules_babel_runtime_7_23_6_babel_runtime_helpers_asyncToGenerator_js__WEBPACK_IMPORTED_MODULE_2___default()( /*#__PURE__*/_root_workspace_ppte5yg23_local_v9_test4_node_modules_babel_runtime_7_23_6_babel_runtime_helpers_regeneratorRuntime_js__WEBPACK_IMPORTED_MODULE_0___default()().mark(function _callee2(params) {
|
|
return _root_workspace_ppte5yg23_local_v9_test4_node_modules_babel_runtime_7_23_6_babel_runtime_helpers_regeneratorRuntime_js__WEBPACK_IMPORTED_MODULE_0___default()().wrap(function _callee2$(_context2) {
|
|
while (1) switch (_context2.prev = _context2.next) {
|
|
case 0:
|
|
return _context2.abrupt("return", (0,_utils_fetch__WEBPACK_IMPORTED_MODULE_3__/* ["default"] */ .ZP)('/api/yn_classrooms/devices/lot_up.json', {
|
|
method: 'post',
|
|
body: _root_workspace_ppte5yg23_local_v9_test4_node_modules_babel_runtime_7_23_6_babel_runtime_helpers_objectSpread2_js__WEBPACK_IMPORTED_MODULE_1___default()({}, params)
|
|
}));
|
|
case 1:
|
|
case "end":
|
|
return _context2.stop();
|
|
}
|
|
}, _callee2);
|
|
}));
|
|
return function lot_up(_x5) {
|
|
return _ref2.apply(this, arguments);
|
|
};
|
|
}();
|
|
|
|
//智慧开关关机
|
|
var lot_down = /*#__PURE__*/function () {
|
|
var _ref3 = _root_workspace_ppte5yg23_local_v9_test4_node_modules_babel_runtime_7_23_6_babel_runtime_helpers_asyncToGenerator_js__WEBPACK_IMPORTED_MODULE_2___default()( /*#__PURE__*/_root_workspace_ppte5yg23_local_v9_test4_node_modules_babel_runtime_7_23_6_babel_runtime_helpers_regeneratorRuntime_js__WEBPACK_IMPORTED_MODULE_0___default()().mark(function _callee3(params) {
|
|
return _root_workspace_ppte5yg23_local_v9_test4_node_modules_babel_runtime_7_23_6_babel_runtime_helpers_regeneratorRuntime_js__WEBPACK_IMPORTED_MODULE_0___default()().wrap(function _callee3$(_context3) {
|
|
while (1) switch (_context3.prev = _context3.next) {
|
|
case 0:
|
|
return _context3.abrupt("return", (0,_utils_fetch__WEBPACK_IMPORTED_MODULE_3__/* ["default"] */ .ZP)('/api/yn_classrooms/devices/lot_down.json', {
|
|
method: 'post',
|
|
body: _root_workspace_ppte5yg23_local_v9_test4_node_modules_babel_runtime_7_23_6_babel_runtime_helpers_objectSpread2_js__WEBPACK_IMPORTED_MODULE_1___default()({}, params)
|
|
}));
|
|
case 1:
|
|
case "end":
|
|
return _context3.stop();
|
|
}
|
|
}, _callee3);
|
|
}));
|
|
return function lot_down(_x6) {
|
|
return _ref3.apply(this, arguments);
|
|
};
|
|
}();
|
|
|
|
/***/ })
|
|
|
|
}]); |