Auto Submit

dev_local_v9_test5
autosubmit 2 years ago
parent 8e8ed0be3c
commit d2810446cb

@ -27,7 +27,7 @@
display: block !important;
}
</style><script>if(document.domain !== "www.educoder.net") document.title = '';</script>
<script src="/react/build/umi.db5b2240.js"></script>
<script src="/react/build/umi.972ba2d9.js"></script>
<script src="/react/build/js/public.js"></script>
</body>
</html>

@ -81,13 +81,11 @@ var _react_17_0_2_react = __webpack_require__(59301);
var _umi_production_exports = __webpack_require__(66826);
;// 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"});
/* 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"});
// 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/message/index.js + 4 modules
var message = __webpack_require__(8591);
// EXTERNAL MODULE: ./node_modules/_antd@5.9.0@antd/es/input/index.js + 5 modules
var input = __webpack_require__(98135);
// EXTERNAL MODULE: ./node_modules/_antd@5.9.0@antd/es/select/index.js
@ -98,8 +96,14 @@ var table = __webpack_require__(14491);
var pagination = __webpack_require__(53864);
// 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/button/index.js
var es_button = __webpack_require__(3113);
// EXTERNAL MODULE: ./src/service/laboratory.ts
var laboratory = __webpack_require__(89139);
// EXTERNAL MODULE: ./node_modules/_@babel_runtime@7.24.8@@babel/runtime/helpers/esm/extends.js
@ -153,7 +157,7 @@ var jsx_runtime = __webpack_require__(37712);
var DeviceManage = function DeviceManage(_ref) {
var _ref3, _ref4;
var _ref2, _ref3;
var loading = _ref.loading,
dispatch = _ref.dispatch;
var _useState = (0,_react_17_0_2_react.useState)(),
@ -168,11 +172,11 @@ var DeviceManage = function DeviceManage(_ref) {
countRef.current = reason;
var statusVal = {
'running': {
txt: '运行中',
txt: '通电中',
color: '#20A639'
},
'unstart': {
txt: '已关机',
txt: '断电中',
color: '#1D4057'
},
'abnormal': {
@ -198,7 +202,7 @@ var DeviceManage = function DeviceManage(_ref) {
_useState12 = slicedToArray_default()(_useState11, 2),
limit = _useState12[0],
setLimit = _useState12[1];
var _useState13 = (0,_react_17_0_2_react.useState)(false),
var _useState13 = (0,_react_17_0_2_react.useState)(true),
_useState14 = slicedToArray_default()(_useState13, 2),
isLoading = _useState14[0],
setIsLoading = _useState14[1];
@ -214,40 +218,44 @@ var DeviceManage = function DeviceManage(_ref) {
_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 _useState21 = (0,_react_17_0_2_react.useState)([]),
_useState22 = slicedToArray_default()(_useState21, 2),
laboratorys = _useState22[0],
setLaboratorys = _useState22[1];
//实验室房间
var _useState23 = (0,_react_17_0_2_react.useState)([]),
_useState24 = slicedToArray_default()(_useState23, 2),
rooms = _useState24[0],
setRooms = _useState24[1];
var _useState25 = (0,_react_17_0_2_react.useState)(''),
laboratorys = _useState24[0],
setLaboratorys = _useState24[1];
//实验室房间
var _useState25 = (0,_react_17_0_2_react.useState)([]),
_useState26 = slicedToArray_default()(_useState25, 2),
sys = _useState26[0],
setSys = _useState26[1];
rooms = _useState26[0],
setRooms = _useState26[1];
var _useState27 = (0,_react_17_0_2_react.useState)(''),
_useState28 = slicedToArray_default()(_useState27, 2),
sysRoom = _useState28[0],
setSysRoom = _useState28[1];
sys = _useState28[0],
setSys = _useState28[1];
var _useState29 = (0,_react_17_0_2_react.useState)(''),
_useState30 = slicedToArray_default()(_useState29, 2),
deviceStatus = _useState30[0],
setDeviceStatus = _useState30[1];
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 _useState31 = (0,_react_17_0_2_react.useState)(false),
_useState32 = slicedToArray_default()(_useState31, 2),
openAddModal = _useState32[0],
setOpenAddModal = _useState32[1];
var _useState33 = (0,_react_17_0_2_react.useState)([]),
var _useState33 = (0,_react_17_0_2_react.useState)(false),
_useState34 = slicedToArray_default()(_useState33, 2),
rooms2 = _useState34[0],
setRooms2 = _useState34[1];
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 isFirstLoad = (0,_react_17_0_2_react.useRef)(true);
var columns = [{
title: '设备编号',
@ -275,20 +283,20 @@ var DeviceManage = function DeviceManage(_ref) {
})
});
}
}, {
title: '设备类型',
dataIndex: 'genre_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,
@ -370,60 +378,17 @@ var DeviceManage = function DeviceManage(_ref) {
myForm.setFieldsValue(record);
},
children: "\u7F16\u8F91"
}), (record === null || record === void 0 ? void 0 : record.use_status) == 'unstart' && /*#__PURE__*/(0,jsx_runtime.jsx)("span", {
}), record.use_status != 'abnormal' && /*#__PURE__*/(0,jsx_runtime.jsx)("span", {
style: {
color: "#165DFF",
cursor: "pointer",
marginLeft: '20px'
},
onClick: function onClick() {
if (isLoading) return;
setIsLoading(true);
(0,iot/* lot_up */.zh)({
device_ids: [record === null || record === void 0 ? void 0 : record.id]
}).then(function (res) {
if ((res === null || res === void 0 ? void 0 : res.status) == 0) {
message/* default */.ZP.success('开机成功');
getData(false);
}
setIsLoading(false);
});
},
children: "\u5F00\u673A"
}), (record === null || record === void 0 ? void 0 : record.use_status) == 'running' && /*#__PURE__*/(0,jsx_runtime.jsx)("span", {
style: {
color: "#FA6400",
cursor: "pointer",
marginLeft: '20px'
setRowData(record);
setControlModal(true);
},
onClick: /*#__PURE__*/asyncToGenerator_default()( /*#__PURE__*/regeneratorRuntime_default()().mark(function _callee() {
return regeneratorRuntime_default()().wrap(function _callee$(_context) {
while (1) switch (_context.prev = _context.next) {
case 0:
if (!isLoading) {
_context.next = 2;
break;
}
return _context.abrupt("return");
case 2:
setIsLoading(true);
_context.next = 5;
return (0,iot/* lot_down */.hQ)({
device_ids: [record === null || record === void 0 ? void 0 : record.id]
}).then(function (res) {
if ((res === null || res === void 0 ? void 0 : res.status) == 0) {
message/* default */.ZP.success('关机成功');
getData(true);
}
setIsLoading(false);
});
case 5:
case "end":
return _context.stop();
}
}, _callee);
})),
children: "\u5173\u673A"
children: "\u63A7\u5236"
})]
});
}
@ -575,10 +540,10 @@ var DeviceManage = function DeviceManage(_ref) {
setRooms(toConsumableArray_default()(res === null || res === void 0 || (_res$data6 = res.data) === null || _res$data6 === void 0 ? void 0 : _res$data6.list));
});
},
children: (_ref3 = [{
children: (_ref2 = [{
id: '',
title: '全部'
}].concat(toConsumableArray_default()(laboratorys))) === null || _ref3 === void 0 ? void 0 : _ref3.map(function (item, index) {
}].concat(toConsumableArray_default()(laboratorys))) === null || _ref2 === void 0 ? void 0 : _ref2.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
@ -601,10 +566,10 @@ var DeviceManage = function DeviceManage(_ref) {
onChange: function onChange(e) {
setSysRoom(e);
},
children: (_ref4 = [{
children: (_ref3 = [{
id: '',
title: '全部'
}].concat(toConsumableArray_default()(rooms))) === null || _ref4 === void 0 ? void 0 : _ref4.map(function (item, index) {
}].concat(toConsumableArray_default()(rooms))) === 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
@ -631,10 +596,10 @@ var DeviceManage = function DeviceManage(_ref) {
children: "\u5168\u90E8"
}), /*#__PURE__*/(0,jsx_runtime.jsx)(es_select["default"].Option, {
value: "2",
children: "\u8FD0\u884C\u4E2D"
children: "\u901A\u7535\u4E2D"
}), /*#__PURE__*/(0,jsx_runtime.jsx)(es_select["default"].Option, {
value: "1",
children: "\u5DF2\u5173\u673A"
children: "\u65AD\u7535\u4E2D"
}), /*#__PURE__*/(0,jsx_runtime.jsx)(es_select["default"].Option, {
value: "3",
children: "\u5F02\u5E38"
@ -642,10 +607,11 @@ var DeviceManage = function DeviceManage(_ref) {
})
})]
}), /*#__PURE__*/(0,jsx_runtime.jsx)(table/* default */.Z, {
rowSelection: objectSpread2_default()({
type: 'checkbox'
}, rowSelection),
loading: isLoading,
// rowSelection={{
// type: 'checkbox',
// ...rowSelection,
// }}
// loading={isLoading}
pagination: false,
dataSource: tableData,
columns: columns,
@ -710,9 +676,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 _callee2() {
return regeneratorRuntime_default()().wrap(function _callee2$(_context2) {
while (1) switch (_context2.prev = _context2.next) {
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,iot/* lot_up */.zh)({
device_ids: selectIds === null || selectIds === void 0 ? void 0 : selectIds.map(function (item) {
@ -726,9 +692,9 @@ var DeviceManage = function DeviceManage(_ref) {
});
case 1:
case "end":
return _context2.stop();
return _context.stop();
}
}, _callee2);
}, _callee);
}));
function onOk() {
return _onOk.apply(this, arguments);
@ -761,9 +727,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 _callee3() {
return regeneratorRuntime_default()().wrap(function _callee3$(_context3) {
while (1) switch (_context3.prev = _context3.next) {
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,iot/* lot_down */.hQ)({
device_ids: selectIds === null || selectIds === void 0 ? void 0 : selectIds.map(function (item) {
@ -777,9 +743,9 @@ var DeviceManage = function DeviceManage(_ref) {
});
case 1:
case "end":
return _context3.stop();
return _context2.stop();
}
}, _callee3);
}, _callee2);
}));
function onOk() {
return _onOk2.apply(this, arguments);
@ -817,11 +783,11 @@ var DeviceManage = function DeviceManage(_ref) {
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) {
onOk: /*#__PURE__*/asyncToGenerator_default()( /*#__PURE__*/regeneratorRuntime_default()().mark(function _callee3() {
return regeneratorRuntime_default()().wrap(function _callee3$(_context3) {
while (1) switch (_context3.prev = _context3.next) {
case 0:
_context4.next = 2;
_context3.next = 2;
return myForm.validateFields();
case 2:
if (rowData) {
@ -852,9 +818,9 @@ var DeviceManage = function DeviceManage(_ref) {
}
case 3:
case "end":
return _context4.stop();
return _context3.stop();
}
}, _callee4);
}, _callee3);
})),
onCancel: function onCancel() {
setOpenAddModal(false);
@ -1025,13 +991,83 @@ var DeviceManage = function DeviceManage(_ref) {
})]
})]
})
}), /*#__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, ")\u5B9E\u9A8C\u5BA4\u2014\u2014(").concat(rowData === null || rowData === void 0 ? void 0 : rowData.classroom_room_title, ")\u623F\u95F4\u603B\u7535\u6E90"),
width: "600px",
footer: null,
children: /*#__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", {
className: DeviceManagemodules.kg_btn,
style: {
background: "".concat((rowData === null || rowData === void 0 ? void 0 : rowData.use_status) == 'unstart' ? '#20A639' : '#FF0000')
},
onClick: function onClick() {
setIsLoading(true);
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(true);
}
setIsLoading(false);
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(true);
}
setIsLoading(false);
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: "mb20",
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;
/* harmony default export */ var IOT_DeviceManage = ((0,_umi_production_exports.connect)(function (_ref5) {
var loading = _ref5.loading,
engineeringNavigtion = _ref5.engineeringNavigtion,
dispatch = _ref5.dispatch;
return objectSpread2_default()(objectSpread2_default()({
loading: loading
}, engineeringNavigtion), {}, {

@ -155,4 +155,25 @@
background-color: inherit !important;
/* 禁止行鼠标移入时改变背景颜色 */
}
.kg_btn___hkLxY {
width: 150px;
height: 150px;
display: flex;
justify-content: center;
align-items: center;
border-radius: 50%;
font-size: 50px;
font-weight: bold;
margin: 0 auto;
cursor: pointer;
}
.kg_stutas___yNUPC {
text-align: center;
margin: 20px 0;
font-size: 18px;
}
.cancel_btn___KPjFL {
margin: 0 auto;
width: 150px;
}

File diff suppressed because one or more lines are too long
Loading…
Cancel
Save