wzyyy %!s(int64=3) %!d(string=hai) anos
pai
achega
bf547f64a6
Modificáronse 1 ficheiros con 2 adicións e 2 borrados
  1. 2 2
      src/pages/device/Instance/Detail/Modbus/index.tsx

+ 2 - 2
src/pages/device/Instance/Detail/Modbus/index.tsx

@@ -314,9 +314,9 @@ export default (props: Props) => {
         );
         if ((field as Field).modified) {
           const readIndex = field.query(path).get('value');
-          const dataLength = field.query(path).get('dataSource')?.length - 1;
+          const dataLength = field.query(path).get('dataSource')?.length;
           const length = lengthMap.get(value) + readIndex;
-          console.log(length, dataLength);
+          console.log(length, dataLength, readIndex);
           if (length > dataLength) {
             field.selfErrors = '数据类型对应的长度和起始位置加起来不能超过数据长度';
           } else {