Auto Submit

dev_local_v9_test5
autosubmit 2 years ago
parent 7cec63f993
commit 6dec7115ca

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

@ -176,4 +176,7 @@
margin: 0 auto;
width: 150px;
}
.is_spin___V9Izw [class~='ant-spin-text'] {
text-shadow: none !important;
}

@ -81,7 +81,7 @@ var _react_17_0_2_react = __webpack_require__(59301);
var _umi_production_exports = __webpack_require__(82099);
;// 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"});
/* 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
@ -102,6 +102,8 @@ var message = __webpack_require__(8591);
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
@ -263,6 +265,10 @@ var DeviceManage = function DeviceManage(_ref) {
_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: '设备编号',
@ -465,6 +471,7 @@ var DeviceManage = function DeviceManage(_ref) {
if (flag) {
setPage(1);
}
setTableLoading(true);
(0,iot/* getIOTDeviceList */.Yj)({
page: page,
limit: limit,
@ -481,6 +488,7 @@ var DeviceManage = function DeviceManage(_ref) {
item.key = item === null || item === void 0 ? void 0 : item.id;
return item;
}));
setTableLoading(false);
});
};
var onShowSizeChange = function onShowSizeChange(page, size) {
@ -640,7 +648,7 @@ var DeviceManage = function DeviceManage(_ref) {
// type: 'checkbox',
// ...rowSelection,
// }}
// loading={isLoading}
loading: tableLoading,
pagination: false,
dataSource: tableData,
columns: columns,
@ -1044,66 +1052,82 @@ var DeviceManage = function DeviceManage(_ref) {
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", {
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);
});
}) : /*#__PURE__*/(0,jsx_runtime.jsx)(config_provider/* default */.ZP, {
theme: {
components: {
Spin: {
colorBgContainer: 'rgba(0, 0, 0, .4)'
}
},
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",
}
},
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: {
width: '100%',
display: 'flex',
justifyContent: 'center'
paddingTop: 20
},
children: /*#__PURE__*/(0,jsx_runtime.jsx)(es_button/* default */.ZP, {
type: "primary",
className: DeviceManagemodules.cancel_btn,
size: "large",
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() {
setControlModal(false);
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: "\u53D6\u6D88"
})
})]
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"
})
})]
})
})
})]
});

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