Commit b1aa738a5701b9b52d44cb6b7b3063a8f7bc8c7c

Authored by xp.Huang
2 parents 8ddff779 424afb95

Merge branch 'fix/device-code-range' into 'main_dev'

fix: 修复下发指令将地址码再次转为16进制值

See merge request yunteng/thingskit-scada!98
... ... @@ -7752,8 +7752,8 @@ DataFormatPanel.prototype.addDataFont = function (container) {
7752 7752 } else if (commandType === COMMAND_TYPE_ENUM.MODBUS) {
7753 7753 const dataSource = currentNodeData?.dataSources?.[0] || getDataSourceBindValue()
7754 7754 if (dataSource) {
7755   - const additional = dataSource?.additional || {}
7756   - if (dataSource?.deviceType !== 'SENDOR' && !additional?.deviceCode) {
  7755 + const additional = dataSource?.additional || getDataSourceBindValue()
  7756 + if (dataSource?.deviceType !== 'SENDOR' && !(additional?.deviceCode)) {
7757 7757 UseLayUi.topErrorMsg('设备地址码不存在')
7758 7758 return false
7759 7759 }
... ... @@ -8967,7 +8967,7 @@ DataFormatPanel.prototype.addDataFont = function (container) {
8967 8967 [enumDataSourceConst.ATTR_NAME]: value,
8968 8968 })
8969 8969
8970   - const selected = thingsModel.find(item => item.identifier === value)
  8970 + const selected = thingsModel?.find(item => item.identifier === value)
8971 8971
8972 8972 if (!selected) return
8973 8973 // const type = selected?.extensionDesc?.dataType
... ... @@ -16307,8 +16307,8 @@ class HandleDataInteraction {
16307 16307 const params = {
16308 16308 crc: 'CRC_16_LOWER',
16309 16309 deviceCode: Number(deviceCode).toString(16).padStart(2, 0).toUpperCase(),
16310   - method: Number(method).toString(16).padStart(2, 0),
16311   - registerAddr: Number(registerAddress),
  16310 + method,
  16311 + registerAddress: Number(registerAddress),
16312 16312 registerNumber: Array.isArray(registerValue) ? 2 : 1,
16313 16313 registerValues: Array.isArray(registerValue) ? registerValue.map(item => Number(item)) : [Number(registerValue)]
16314 16314 }
... ...