Commit 51062a0ccd14bb9ccc2fe34966194b1de090c399

Authored by ww
1 parent 3135f742

fix: DEFECT-844 selected device happend script error

@@ -7911,6 +7911,7 @@ DataFormatPanel.prototype.addDataFont = function (container) { @@ -7911,6 +7911,7 @@ DataFormatPanel.prototype.addDataFont = function (container) {
7911 onClick(data) { 7911 onClick(data) {
7912 const { value } = data 7912 const { value } = data
7913 const selected = deviceList.find(item => item.id === value) 7913 const selected = deviceList.find(item => item.id === value)
  7914 + if (!selected) return
7914 form.val(componentFilter, { 7915 form.val(componentFilter, {
7915 [enumDataSourceConst.DEVICE_NAME]: selected.name, 7916 [enumDataSourceConst.DEVICE_NAME]: selected.name,
7916 [enumDataSourceConst.SLAVE_DEVICE_ID]: null, 7917 [enumDataSourceConst.SLAVE_DEVICE_ID]: null,
@@ -7918,7 +7919,6 @@ DataFormatPanel.prototype.addDataFont = function (container) { @@ -7918,7 +7919,6 @@ DataFormatPanel.prototype.addDataFont = function (container) {
7918 [enumDataSourceConst.SLAVE_DEVICE_NAME]: null, 7919 [enumDataSourceConst.SLAVE_DEVICE_NAME]: null,
7919 [enumDataSourceConst.ATTR_NAME]: null, 7920 [enumDataSourceConst.ATTR_NAME]: null,
7920 }) 7921 })
7921 - if (!selected) return  
7922 if (selected.deviceType === enumDataSourceConst.GATEWAY) { 7922 if (selected.deviceType === enumDataSourceConst.GATEWAY) {
7923 $(`#${componentId}`).find(`select[name="${enumDataSourceConst.SLAVE_DEVICE_ID}"]`) 7923 $(`#${componentId}`).find(`select[name="${enumDataSourceConst.SLAVE_DEVICE_ID}"]`)
7924 .attr('lay-verify', 'required').attr('lay-verType', 'tips') 7924 .attr('lay-verify', 'required').attr('lay-verType', 'tips')