| 
...
 | 
...
 | 
@@ -91,11 +91,14 @@ | 
| 
91
 | 
91
 | 
   };
 | 
| 
92
 | 
92
 | 
 
 | 
| 
93
 | 
93
 | 
   // 获取小数
 | 
| 
94
 | 
 
 | 
-  const getFloatPart = (number): any => {
 | 
| 
 
 | 
94
 | 
+  const getFloatPart = (number: string | number) => {
 | 
| 
 
 | 
95
 | 
+    const isLessZero = Number(number) < 0;
 | 
| 
95
 | 
96
 | 
     number = number.toString();
 | 
| 
96
 | 
97
 | 
     const floatPartStartIndex = number.indexOf('.');
 | 
| 
97
 | 
 
 | 
-    const value = ~floatPartStartIndex ? `0.${number.substring(floatPartStartIndex + 1)}` : '0';
 | 
| 
98
 | 
 
 | 
-    return value;
 | 
| 
 
 | 
98
 | 
+    const value = ~floatPartStartIndex
 | 
| 
 
 | 
99
 | 
+      ? `${isLessZero ? '-' : ''}0.${number.substring(floatPartStartIndex + 1)}`
 | 
| 
 
 | 
100
 | 
+      : '0';
 | 
| 
 
 | 
101
 | 
+    return Number(value);
 | 
| 
99
 | 
102
 | 
   };
 | 
| 
100
 | 
103
 | 
 
 | 
| 
101
 | 
104
 | 
   const { createMessage } = useMessage();
 | 
| 
...
 | 
...
 | 
@@ -139,13 +142,16 @@ | 
| 
139
 | 
142
 | 
         if (unref(modBUSForm).method == '16' || unref(modBUSForm).method == '10') {
 | 
| 
140
 | 
143
 | 
           const regex = /^-?\d+(\.\d{0,2})?$/;
 | 
| 
141
 | 
144
 | 
           const values =
 | 
| 
142
 | 
 
 | 
-            Math.floor(oldValue) * unref(zoomFactorValue) +
 | 
| 
 
 | 
145
 | 
+            Math.trunc(oldValue) * unref(zoomFactorValue) +
 | 
| 
143
 | 
146
 | 
             getFloatPart(oldValue) * unref(zoomFactorValue);
 | 
| 
 
 | 
147
 | 
+
 | 
| 
144
 | 
148
 | 
           if (!regex.test(values as any)) {
 | 
| 
145
 | 
149
 | 
             createMessage.warning(`属性下发值精确到两位小数,缩放因子是${unref(zoomFactorValue)}`);
 | 
| 
146
 | 
150
 | 
             return;
 | 
| 
147
 | 
151
 | 
           }
 | 
| 
148
 | 
 
 | 
-          const newValue = getArray(SingleToHex(unref(isShowMultiply) ? values : oldValue));
 | 
| 
 
 | 
152
 | 
+
 | 
| 
 
 | 
153
 | 
+          const newValue =
 | 
| 
 
 | 
154
 | 
+            values == 0 ? [0, 0] : getArray(SingleToHex(unref(isShowMultiply) ? values : oldValue));
 | 
| 
149
 | 
155
 | 
           modBUSForm.value.registerValues = newValue;
 | 
| 
150
 | 
156
 | 
           modBUSForm.value.registerNumber = 2;
 | 
| 
151
 | 
157
 | 
           modBUSForm.value.method = '10';
 | 
...
 | 
...
 | 
 |