Showing
1 changed file
with
8 additions
and
4 deletions
| ... | ... | @@ -41,7 +41,8 @@ |
| 41 | 41 | const { type } = dataType || {}; |
| 42 | 42 | const { codeType, deviceProfile } = deviceDetail || {}; |
| 43 | 43 | const { transportType } = deviceProfile || {}; |
| 44 | - const { registerAddress, actionType, zoomFactor } = extensionDesc || {}; | |
| 44 | + const { registerAddress, actionType, zoomFactor } = extensionDesc || {}; //获取扩展描述内容 | |
| 45 | + | |
| 45 | 46 | formField.value = identifier; |
| 46 | 47 | zoomFactorValue.value = zoomFactor ? Number(zoomFactor) : 1; |
| 47 | 48 | isShowMultiply.value = type == 'INT' || type == 'DOUBLE' ? true : false; |
| ... | ... | @@ -106,11 +107,14 @@ |
| 106 | 107 | } |
| 107 | 108 | const flag = await validate(); |
| 108 | 109 | if (!flag) return; |
| 110 | + | |
| 109 | 111 | const oldValue = getFieldsValue()[unref(formField)]; |
| 110 | - modBUSForm.value.registerValues = unref(isShowMultiply) | |
| 111 | - ? [oldValue * unref(zoomFactorValue)] | |
| 112 | - : [oldValue]; | |
| 113 | 112 | modBUSForm.value.registerNumber = 1; |
| 113 | + modBUSForm.value.registerValues = [oldValue]; | |
| 114 | + if (unref(isShowMultiply) && unref(modBUSForm).method == '06') { | |
| 115 | + //bool类型的就不用去乘缩放因子了 | |
| 116 | + modBUSForm.value.registerValues = [oldValue * unref(zoomFactorValue)]; | |
| 117 | + } | |
| 114 | 118 | |
| 115 | 119 | if (unref(modBUSForm).method == '16' || unref(modBUSForm).method == '10') { |
| 116 | 120 | const newValue = getArray( | ... | ... |