Commit 8e3acda9e0f38535e83f9eeac3cd98ad9f1cad00

Authored by xp.Huang
2 parents 51d5576c f5580f8e

Merge branch 'fix/DEFECT-1832' into 'main_dev'

fix: 修复模版预览时能进行指令下发

See merge request yunteng/thingskit-scada!199
@@ -4351,9 +4351,11 @@ App.prototype.loadFile = function (id, sameWindow, file, success, force) { @@ -4351,9 +4351,11 @@ App.prototype.loadFile = function (id, sameWindow, file, success, force) {
4351 if (success != null) 4351 if (success != null)
4352 success() 4352 success()
4353 // TODO Thingskkit socket连接 4353 // TODO Thingskkit socket连接
4354 - const lightboxWebsocketService = useLightboxModeService(this)  
4355 - this.lightboxWebsocketService = lightboxWebsocketService  
4356 - this.lightboxWebsocketService?.init?.() 4354 + if (result?.templateId) {
  4355 + const lightboxWebsocketService = useLightboxModeService(this)
  4356 + this.lightboxWebsocketService = lightboxWebsocketService
  4357 + this.lightboxWebsocketService?.init?.()
  4358 + }
4357 } 4359 }
4358 4360
4359 handleLoadContent() 4361 handleLoadContent()
@@ -5137,7 +5139,7 @@ App.prototype.addPreviewButton = function () { @@ -5137,7 +5139,7 @@ App.prototype.addPreviewButton = function () {
5137 this.previewButton.style.border = '1px solid transparent' 5139 this.previewButton.style.border = '1px solid transparent'
5138 this.previewButton.style.color = '#fff' 5140 this.previewButton.style.color = '#fff'
5139 5141
5140 - const icon = document.createElement('img') 5142 + const icon = document.createElement('img')
5141 icon.setAttribute('src', this.previewImage) 5143 icon.setAttribute('src', this.previewImage)
5142 icon.setAttribute('align', 'absmiddle') 5144 icon.setAttribute('align', 'absmiddle')
5143 icon.style.marginRight = '4px' 5145 icon.style.marginRight = '4px'
@@ -78,6 +78,7 @@ export class EventHandler { @@ -78,6 +78,7 @@ export class EventHandler {
78 } 78 }
79 79
80 const { handlerMouseDown, handlerMouseClick, handlerMouseDoubleClick, handlerMouseUp } = useNodeEvent(node.eventJson, node.dataSourceJson, cell) 80 const { handlerMouseDown, handlerMouseClick, handlerMouseDoubleClick, handlerMouseUp } = useNodeEvent(node.eventJson, node.dataSourceJson, cell)
  81 +
81 switch (eventName) { 82 switch (eventName) {
82 case EventTypeEnum.DOWN: 83 case EventTypeEnum.DOWN:
83 handlerMouseDown() 84 handlerMouseDown()