Procházet zdrojové kódy

fix(views): 修复实时监测页面智能启停接口报错的问题

wangcong před 2 týdny
rodič
revize
020af74c9f

+ 1 - 1
src/types/index.ts

@@ -2208,7 +2208,7 @@ export interface AIStartStopDeviceItem {
 
 export interface AIStartStopDeviceParams {
   deviceId: number;
-  status: boolean;
+  status: 0 | 1;
   startType: CtrlCabinetStartType;
 }
 

+ 2 - 2
src/views/real-time-monitor/device-control/AIStartStop.vue

@@ -127,7 +127,7 @@ const handleFullStartStatusSwitch = () => {
       handleRequest(async () => {
         await updateAIStartStopData({
           deviceId: device.deviceId,
-          status: !device.startStatus,
+          status: device.startStatus ? 0 : 1,
           startType: currentModeType.value,
         });
       });
@@ -146,7 +146,7 @@ const handleStartStatusSwitch = (device: AIStartStopDeviceItem) => {
       handleRequest(async () => {
         await updateAIStartStopData({
           deviceId: device.deviceId,
-          status: !device.startStatus,
+          status: device.startStatus ? 0 : 1,
           startType: currentModeType.value,
         });
       });