Преглед изворни кода

style(gate): 统一代码缩进和引号格式

调整控制门逻辑和灯光配置的代码格式,统一使用单引号并修复缩进问题
yangzhijie пре 5 месеци
родитељ
комит
d43d3f8f71
2 измењених фајлова са 40 додато и 40 уклоњено
  1. 4 4
      src/gate/ControlGate.vue
  2. 36 36
      src/gate/Light.js

+ 4 - 4
src/gate/ControlGate.vue

@@ -176,13 +176,13 @@ const handleControl = async (command, actionName, isBigInv) => {
         // }
         plugin.gateConfig.controlGate(command);
         if(command == 'OPEN' || command == 'SHOTOPEN'){
-          plugin.gateConfig.controlLight(JSON.stringify(LIGHT_OPEN));
+            plugin.gateConfig.controlLight(JSON.stringify(LIGHT_OPEN));
         }else if(command == 'CLOSE'){
-          plugin.gateConfig.controlLight(JSON.stringify(LIGHT_CLOSE));
+            plugin.gateConfig.controlLight(JSON.stringify(LIGHT_CLOSE));
         }else if(command == 'REBOOT'){
-          plugin.gateConfig.controlLight(JSON.stringify(LIGHT_RESTART));
+            plugin.gateConfig.controlLight(JSON.stringify(LIGHT_RESTART));
         }else if(command == 'ALARM'){
-          plugin.gateConfig.controlLight(JSON.stringify(LIGHT_ALARM));
+            plugin.gateConfig.controlLight(JSON.stringify(LIGHT_ALARM));
         }
         showNotify({ type: 'success', message: `${actionName}操作成功`, duration: 2000 });
         // if (res.errorCode === 0) {

+ 36 - 36
src/gate/Light.js

@@ -1,49 +1,49 @@
 
 const LIGHT_NORMAL = {
-    "lightEffect": "BREATH",
-    "breathParams": {
-        "color": 6399885,
-        "speed": 3,
-        "lightOffInterval": 1000
-    }
-}
+    'lightEffect': 'BREATH',
+    'breathParams': {
+        'color': 6399885,
+        'speed': 3,
+        'lightOffInterval': 1000,
+    },
+};
 
 const LIGHT_OPEN = {
-    "lightEffect": "FLOW",
-    "flowParams": {
-        "color": 16777215,
-        "repeat": false,
-        "flowInterval": 1
-    }
-}
+    'lightEffect': 'FLOW',
+    'flowParams': {
+        'color': 16777215,
+        'repeat': false,
+        'flowInterval': 1,
+    },
+};
 
 const LIGHT_CLOSE = {
-    "lightEffect": "FLOW_RESERVE",
-    "flowParams": {
-        "color": 16777215,
-        "repeat": false,
-        "flowInterval": 1
-    }
-}
+    'lightEffect': 'FLOW_RESERVE',
+    'flowParams': {
+        'color': 16777215,
+        'repeat': false,
+        'flowInterval': 1,
+    },
+};
 
 const LIGHT_ALARM = {
-    "lightEffect": "FLASH",
-    "flashParameters": {
-        "color": 16711680,
-        "lightOnInterval": 1000,
-        "lightOffInterval": 1000
-    }
-}
+    'lightEffect': 'FLASH',
+    'flashParameters': {
+        'color': 16711680,
+        'lightOnInterval': 1000,
+        'lightOffInterval': 1000,
+    },
+};
 
 
 const LIGHT_RESTART = {
-    "lightEffect": "FLASH",
-    "flashParameters": {
-        "color": 0xFFFFFF,
-        "lightOnInterval": 1000,
-        "lightOffInterval": 1000
-    }
-}
+    'lightEffect': 'FLASH',
+    'flashParameters': {
+        'color': 0xFFFFFF,
+        'lightOnInterval': 1000,
+        'lightOffInterval': 1000,
+    },
+};
 
 export {
     LIGHT_NORMAL,
@@ -51,4 +51,4 @@ export {
     LIGHT_CLOSE,
     LIGHT_ALARM,
     LIGHT_RESTART,
-}
+};