Commit 51062a0ccd14bb9ccc2fe34966194b1de090c399
1 parent
3135f742
fix: DEFECT-844 selected device happend script error
Showing
1 changed file
with
1 additions
and
1 deletions
... | ... | @@ -7911,6 +7911,7 @@ DataFormatPanel.prototype.addDataFont = function (container) { |
7911 | 7911 | onClick(data) { |
7912 | 7912 | const { value } = data |
7913 | 7913 | const selected = deviceList.find(item => item.id === value) |
7914 | + if (!selected) return | |
7914 | 7915 | form.val(componentFilter, { |
7915 | 7916 | [enumDataSourceConst.DEVICE_NAME]: selected.name, |
7916 | 7917 | [enumDataSourceConst.SLAVE_DEVICE_ID]: null, |
... | ... | @@ -7918,7 +7919,6 @@ DataFormatPanel.prototype.addDataFont = function (container) { |
7918 | 7919 | [enumDataSourceConst.SLAVE_DEVICE_NAME]: null, |
7919 | 7920 | [enumDataSourceConst.ATTR_NAME]: null, |
7920 | 7921 | }) |
7921 | - if (!selected) return | |
7922 | 7922 | if (selected.deviceType === enumDataSourceConst.GATEWAY) { |
7923 | 7923 | $(`#${componentId}`).find(`select[name="${enumDataSourceConst.SLAVE_DEVICE_ID}"]`) |
7924 | 7924 | .attr('lay-verify', 'required').attr('lay-verType', 'tips') | ... | ... |