Commit 24bcf151abd67bb5b62630f4ab43e8edeb5d9b57

Authored by 温伟
Committed by xp.Huang
1 parent 3ec5a6da

fix: 修复实时数据获取节点信息变更id为configurationNodeId

@@ -25,7 +25,7 @@ const loading = ref(false) @@ -25,7 +25,7 @@ const loading = ref(false)
25 // 存储视频数据 25 // 存储视频数据
26 const videoConfig = computed(() => { 26 const videoConfig = computed(() => {
27 return contentDataStore?.contentData.filter((item) => { 27 return contentDataStore?.contentData.filter((item) => {
28 - return props.config.cellInfo?.id === item.id 28 + return props.config.cellInfo?.id === item.configurationNodeId
29 }) 29 })
30 }) 30 })
31 31
@@ -56,8 +56,8 @@ export class LightboxModeWebsocketService extends TelemetryWebsockerService { @@ -56,8 +56,8 @@ export class LightboxModeWebsocketService extends TelemetryWebsockerService {
56 * @returns 56 * @returns
57 */ 57 */
58 getNodeDataSubscribers(nodeData: NodeDataType) { 58 getNodeDataSubscribers(nodeData: NodeDataType) {
59 - const { dataSourceJson, actJson, id } = nodeData  
60 - const cell = this.nodeUtils.getCellById(id) 59 + const { dataSourceJson, actJson, configurationNodeId } = nodeData
  60 + const cell = this.nodeUtils.getCellById(configurationNodeId)
61 if (!cell) return [] 61 if (!cell) return []
62 const componentKey = this.nodeUtils.getNodeComponentKey(cell) 62 const componentKey = this.nodeUtils.getNodeComponentKey(cell)
63 const categoryKey = this.nodeUtils.getNodeCategory(cell) 63 const categoryKey = this.nodeUtils.getNodeCategory(cell)
@@ -77,7 +77,7 @@ export class LightboxModeWebsocketService extends TelemetryWebsockerService { @@ -77,7 +77,7 @@ export class LightboxModeWebsocketService extends TelemetryWebsockerService {
77 const { deviceId, attr } = actJson[key as ActTypeEnum] 77 const { deviceId, attr } = actJson[key as ActTypeEnum]
78 // 无entityId及属性时不订阅 78 // 无entityId及属性时不订阅
79 if (deviceId && attr) { 79 if (deviceId && attr) {
80 - const subscribe = TelemetrySubscriber.createTimeseriesSubscription(this, { id: deviceId, entityType: EntityType.DEVICE }, attr, this.getCommandSource(id, DataSourceTypeEnum.ACT, actJson[key as ActTypeEnum], key as ActTypeEnum)) 80 + const subscribe = TelemetrySubscriber.createTimeseriesSubscription(this, { id: deviceId, entityType: EntityType.DEVICE }, attr, this.getCommandSource(configurationNodeId, DataSourceTypeEnum.ACT, actJson[key as ActTypeEnum], key as ActTypeEnum))
81 subscribers.push(subscribe) 81 subscribers.push(subscribe)
82 } 82 }
83 } 83 }
@@ -86,7 +86,7 @@ export class LightboxModeWebsocketService extends TelemetryWebsockerService { @@ -86,7 +86,7 @@ export class LightboxModeWebsocketService extends TelemetryWebsockerService {
86 const { deviceId, attr } = dataSourceJson || {} 86 const { deviceId, attr } = dataSourceJson || {}
87 87
88 if (deviceId && attr) { 88 if (deviceId && attr) {
89 - const subscribe = TelemetrySubscriber.createTimeseriesSubscription(this, { id: deviceId, entityType: EntityType.DEVICE }, attr, this.getCommandSource(id, DataSourceTypeEnum.DATASOURCE, dataSourceJson)) 89 + const subscribe = TelemetrySubscriber.createTimeseriesSubscription(this, { id: deviceId, entityType: EntityType.DEVICE }, attr, this.getCommandSource(configurationNodeId, DataSourceTypeEnum.DATASOURCE, dataSourceJson))
90 subscribers.push(subscribe) 90 subscribers.push(subscribe)
91 } 91 }
92 92
@@ -34,7 +34,7 @@ export const useContentDataStore = defineStore('app-content-data', { @@ -34,7 +34,7 @@ export const useContentDataStore = defineStore('app-content-data', {
34 actions: { 34 actions: {
35 35
36 getNodeDataById(id: string): Undefineable<NodeDataType> { 36 getNodeDataById(id: string): Undefineable<NodeDataType> {
37 - const data = this.contentData.find(item => item.id === id) 37 + const data = this.contentData.find(item => item.configurationNodeId === id)
38 return data 38 return data
39 }, 39 },
40 40
@@ -68,7 +68,7 @@ export const useContentDataStore = defineStore('app-content-data', { @@ -68,7 +68,7 @@ export const useContentDataStore = defineStore('app-content-data', {
68 const { cellInfo } = config 68 const { cellInfo } = config
69 const { id } = cellInfo || {} 69 const { id } = cellInfo || {}
70 if (!id) return null 70 if (!id) return null
71 - return this.contentData.find(item => item.id === id) || null 71 + return this.contentData.find(item => item.configurationNodeId === id) || null
72 }, 72 },
73 73
74 setPermissions(string: string[]) { 74 setPermissions(string: string[]) {