Commit 6b7d70f98fc39be0c93a03c8a47248fa274c7857

Authored by ww
1 parent 17a954d1

fix: 修复控制元件更新

@@ -4903,8 +4903,8 @@ DataFormatPanel.prototype.addDataFont = function (container) { @@ -4903,8 +4903,8 @@ DataFormatPanel.prototype.addDataFont = function (container) {
4903 const ss = ui.getSelectionState(); 4903 const ss = ui.getSelectionState();
4904 const vertices = ss.vertices || [] 4904 const vertices = ss.vertices || []
4905 const sidebarInstance = ui.sidebar 4905 const sidebarInstance = ui.sidebar
4906 - console.log(vertices)  
4907 - console.log(ui) 4906 + // console.log(vertices)
  4907 + // console.log(ui)
4908 4908
4909 const hasModifyNotSave = editor.status 4909 const hasModifyNotSave = editor.status
4910 4910
@@ -14769,6 +14769,7 @@ class HandleDataSource { @@ -14769,6 +14769,7 @@ class HandleDataSource {
14769 const { nodeId, attr } = record 14769 const { nodeId, attr } = record
14770 const node = this.getNodeByNodeId(nodeId) 14770 const node = this.getNodeByNodeId(nodeId)
14771 const [[_timespan, receiveValue] = []] = data[attr] || [] 14771 const [[_timespan, receiveValue] = []] = data[attr] || []
  14772 + if (receiveValue === null || receiveValue === undefined) return
14772 const switchConfig = this.DispatchInstance.contentData.act.find(item => item.id === nodeId && item.type === 'SWITCH') 14773 const switchConfig = this.DispatchInstance.contentData.act.find(item => item.id === nodeId && item.type === 'SWITCH')
14773 const { condition = [] } = switchConfig || {} 14774 const { condition = [] } = switchConfig || {}
14774 let reg = /image=[^;]+/g 14775 let reg = /image=[^;]+/g
@@ -14848,8 +14849,9 @@ class HandleDataSource { @@ -14848,8 +14849,9 @@ class HandleDataSource {
14848 const { nodeId, attr } = record 14849 const { nodeId, attr } = record
14849 const node = this.getNodeByNodeId(nodeId) 14850 const node = this.getNodeByNodeId(nodeId)
14850 const [[_timespan, receiveValue] = []] = data[attr] || [] 14851 const [[_timespan, receiveValue] = []] = data[attr] || []
  14852 + if (receiveValue === null || receiveValue === undefined) return
14851 this.updatePage(() => { 14853 this.updatePage(() => {
14852 - node.setAttribute('label', receiveValue) 14854 + node.setAttribute('label', receiveValue)
14853 }, node) 14855 }, node)
14854 } 14856 }
14855 14857
@@ -15734,7 +15736,7 @@ class HandleDataInteraction { @@ -15734,7 +15736,7 @@ class HandleDataInteraction {
15734 } else { 15736 } else {
15735 const replaceValue = currentNode.getAttribute(SWITCH_SEND_VALUE) 15737 const replaceValue = currentNode.getAttribute(SWITCH_SEND_VALUE)
15736 value = jsonParse(content.jsonCommand) 15738 value = jsonParse(content.jsonCommand)
15737 - value = replaceAttrPlaceholder(value, attr, replaceValue) 15739 + value = replaceAttrPlaceholder(value, attr, isNaN(replaceValue) ? 0 : Number(replaceValue))
15738 if (value) flag = true 15740 if (value) flag = true
15739 } 15741 }
15740 } else { 15742 } else {