Commit 2070e7cdb3541896ff119ddf5d5561f5a9743b7e

Authored by xp.Huang
2 parents 3ec5a6da 24bcf151

Merge branch 'perf/configuration-id' into 'main_dev'

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

See merge request yunteng/thingskit-scada!258
... ... @@ -25,7 +25,7 @@ const loading = ref(false)
25 25 // 存储视频数据
26 26 const videoConfig = computed(() => {
27 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 56 * @returns
57 57 */
58 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 61 if (!cell) return []
62 62 const componentKey = this.nodeUtils.getNodeComponentKey(cell)
63 63 const categoryKey = this.nodeUtils.getNodeCategory(cell)
... ... @@ -77,7 +77,7 @@ export class LightboxModeWebsocketService extends TelemetryWebsockerService {
77 77 const { deviceId, attr } = actJson[key as ActTypeEnum]
78 78 // 无entityId及属性时不订阅
79 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 81 subscribers.push(subscribe)
82 82 }
83 83 }
... ... @@ -86,7 +86,7 @@ export class LightboxModeWebsocketService extends TelemetryWebsockerService {
86 86 const { deviceId, attr } = dataSourceJson || {}
87 87
88 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 90 subscribers.push(subscribe)
91 91 }
92 92
... ...
... ... @@ -34,7 +34,7 @@ export const useContentDataStore = defineStore('app-content-data', {
34 34 actions: {
35 35
36 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 38 return data
39 39 },
40 40
... ... @@ -68,7 +68,7 @@ export const useContentDataStore = defineStore('app-content-data', {
68 68 const { cellInfo } = config
69 69 const { id } = cellInfo || {}
70 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 74 setPermissions(string: string[]) {
... ...