Commit 424afb9505177865bea58091424430585a30d729

Authored by ww
1 parent 7baf3630

fix: 修复参数设置未先保存数据源时,modbus方式验证不通过

@@ -7752,8 +7752,8 @@ DataFormatPanel.prototype.addDataFont = function (container) { @@ -7752,8 +7752,8 @@ DataFormatPanel.prototype.addDataFont = function (container) {
7752 } else if (commandType === COMMAND_TYPE_ENUM.MODBUS) { 7752 } else if (commandType === COMMAND_TYPE_ENUM.MODBUS) {
7753 const dataSource = currentNodeData?.dataSources?.[0] || getDataSourceBindValue() 7753 const dataSource = currentNodeData?.dataSources?.[0] || getDataSourceBindValue()
7754 if (dataSource) { 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 UseLayUi.topErrorMsg('设备地址码不存在') 7757 UseLayUi.topErrorMsg('设备地址码不存在')
7758 return false 7758 return false
7759 } 7759 }
@@ -8967,7 +8967,7 @@ DataFormatPanel.prototype.addDataFont = function (container) { @@ -8967,7 +8967,7 @@ DataFormatPanel.prototype.addDataFont = function (container) {
8967 [enumDataSourceConst.ATTR_NAME]: value, 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 if (!selected) return 8972 if (!selected) return
8973 // const type = selected?.extensionDesc?.dataType 8973 // const type = selected?.extensionDesc?.dataType