Commit e03f22470094cf19375ed07f93608ab65e1787a5
Merge branch 'perf/configuration-id' into 'main_dev'
fix: 修复组态相关保存由id改为configurationNodeId See merge request yunteng/thingskit-scada!259
Showing
9 changed files
with
12 additions
and
12 deletions
| @@ -1309,7 +1309,7 @@ operationPassword=操作密码 | @@ -1309,7 +1309,7 @@ operationPassword=操作密码 | ||
| 1309 | dataSource=数据源 | 1309 | dataSource=数据源 |
| 1310 | dataInteraction=数据交互 | 1310 | dataInteraction=数据交互 |
| 1311 | display=显示 | 1311 | display=显示 |
| 1312 | -actHidden=隐藏 | 1312 | +acrHidden=隐藏 |
| 1313 | flow=流动 | 1313 | flow=流动 |
| 1314 | stop=停止 | 1314 | stop=停止 |
| 1315 | actOpen=开启 | 1315 | actOpen=开启 |
| @@ -17,7 +17,7 @@ export const tableColumns = (): BasicColumn[] => { | @@ -17,7 +17,7 @@ export const tableColumns = (): BasicColumn[] => { | ||
| 17 | title: t('state'), | 17 | title: t('state'), |
| 18 | dataIndex: 'type', | 18 | dataIndex: 'type', |
| 19 | format(text) { | 19 | format(text) { |
| 20 | - return ActRangListItemTypeNameEnum[text as ActRangListItemTypeEnum] | 20 | + return t(ActRangListItemTypeNameEnum[text as ActRangListItemTypeEnum]) |
| 21 | }, | 21 | }, |
| 22 | }, | 22 | }, |
| 23 | { | 23 | { |
| @@ -88,7 +88,7 @@ export function useNodeEvent(eventJson: NodeDataEventJsonType, dataSourceJson: N | @@ -88,7 +88,7 @@ export function useNodeEvent(eventJson: NodeDataEventJsonType, dataSourceJson: N | ||
| 88 | 88 | ||
| 89 | if (nodeUtils.getNodeComponentKey(cell) === ControlComponentEnum.SWITCH) { | 89 | if (nodeUtils.getNodeComponentKey(cell) === ControlComponentEnum.SWITCH) { |
| 90 | const contentDataStore = useContentDataStoreWithOut() | 90 | const contentDataStore = useContentDataStoreWithOut() |
| 91 | - const currentData = contentDataStore.contentData.find(item => item.id === cell.getId()) | 91 | + const currentData = contentDataStore.contentData.find(item => item.configurationNodeId === cell.getId()) |
| 92 | if (!currentData) return | 92 | if (!currentData) return |
| 93 | const { actJson } = currentData | 93 | const { actJson } = currentData |
| 94 | const { rangeList } = actJson.STATUS_SETTING | 94 | const { rangeList } = actJson.STATUS_SETTING |
| @@ -53,7 +53,8 @@ export const getVideoTypeByUrl = (url: string) => { | @@ -53,7 +53,8 @@ export const getVideoTypeByUrl = (url: string) => { | ||
| 53 | export async function getPlayUrl( | 53 | export async function getPlayUrl( |
| 54 | params: VideoItemRecordType, | 54 | params: VideoItemRecordType, |
| 55 | ): Promise<Undefineable<{ url: string; type: StreamType }>> { | 55 | ): Promise<Undefineable<{ url: string; type: StreamType }>> { |
| 56 | - const { accessMode } = params | 56 | + let { accessMode } = params |
| 57 | + accessMode = Number(accessMode) | ||
| 57 | if (accessMode === VideoAccessModeEnum.ManuallyEnter) { | 58 | if (accessMode === VideoAccessModeEnum.ManuallyEnter) { |
| 58 | const { videoUrl } = params | 59 | const { videoUrl } = params |
| 59 | if (params.videoUrl) { | 60 | if (params.videoUrl) { |
| @@ -99,7 +99,7 @@ const [register, { getFieldsValue, validate, setFieldsValue }] = useForm({ | @@ -99,7 +99,7 @@ const [register, { getFieldsValue, validate, setFieldsValue }] = useForm({ | ||
| 99 | { | 99 | { |
| 100 | field: VideoFormFieldsEnum.ACCESS_MODE, | 100 | field: VideoFormFieldsEnum.ACCESS_MODE, |
| 101 | label: t(VideoFormFieldsNameEnum.ACCESS_MODE), | 101 | label: t(VideoFormFieldsNameEnum.ACCESS_MODE), |
| 102 | - component: ComponentEnum.INPUT, | 102 | + component: ComponentEnum.INPUT_NUMBER, |
| 103 | ifShow: false, | 103 | ifShow: false, |
| 104 | }, | 104 | }, |
| 105 | { | 105 | { |
| @@ -30,10 +30,10 @@ export default class Config implements CreateComponentType { | @@ -30,10 +30,10 @@ export default class Config implements CreateComponentType { | ||
| 30 | } | 30 | } |
| 31 | 31 | ||
| 32 | export const dataSubscribers: ComponentConfigModuleType['dataSubscribers'] = (telemetryService, nodeData) => { | 32 | export const dataSubscribers: ComponentConfigModuleType['dataSubscribers'] = (telemetryService, nodeData) => { |
| 33 | - const { dataSourceJson, id } = nodeData | 33 | + const { dataSourceJson, configurationNodeId } = nodeData |
| 34 | const { deviceId, attr, chartOption } = dataSourceJson | 34 | const { deviceId, attr, chartOption } = dataSourceJson |
| 35 | const { agg, interval, effectScope = 0 } = chartOption! | 35 | const { agg, interval, effectScope = 0 } = chartOption! |
| 36 | - const subscribe = TelemetrySubscriber.createHistorySubscription(telemetryService, { id: deviceId, entityType: EntityType.DEVICE }, attr, telemetryService.getCommandSource(id, DataSourceTypeEnum.DATASOURCE, dataSourceJson)) | 36 | + const subscribe = TelemetrySubscriber.createHistorySubscription(telemetryService, { id: deviceId, entityType: EntityType.DEVICE }, attr, telemetryService.getCommandSource(configurationNodeId, DataSourceTypeEnum.DATASOURCE, dataSourceJson)) |
| 37 | 37 | ||
| 38 | const subscriptionCommand = subscribe.subscriptionCommand as HistorySubscriptionCmd | 38 | const subscriptionCommand = subscribe.subscriptionCommand as HistorySubscriptionCmd |
| 39 | subscriptionCommand.agg = agg | 39 | subscriptionCommand.agg = agg |
| @@ -30,15 +30,15 @@ export default class Config implements CreateComponentType { | @@ -30,15 +30,15 @@ export default class Config implements CreateComponentType { | ||
| 30 | } | 30 | } |
| 31 | 31 | ||
| 32 | export const dataSubscribers: ComponentConfigModuleType['dataSubscribers'] = (telemetryService, nodeData) => { | 32 | export const dataSubscribers: ComponentConfigModuleType['dataSubscribers'] = (telemetryService, nodeData) => { |
| 33 | - const { dataSourceJson, id } = nodeData | 33 | + const { dataSourceJson, configurationNodeId } = nodeData |
| 34 | const { deviceId, attr, chartOption } = dataSourceJson | 34 | const { deviceId, attr, chartOption } = dataSourceJson |
| 35 | const { agg, interval, effectScope = 0, queryType } = chartOption! | 35 | const { agg, interval, effectScope = 0, queryType } = chartOption! |
| 36 | 36 | ||
| 37 | let subscribe | 37 | let subscribe |
| 38 | if (queryType === SocketSubscriberEnum.HISTORY_CMDS) | 38 | if (queryType === SocketSubscriberEnum.HISTORY_CMDS) |
| 39 | - subscribe = TelemetrySubscriber.createHistorySubscription(telemetryService, { id: deviceId, entityType: EntityType.DEVICE }, attr, telemetryService.getCommandSource(id, DataSourceTypeEnum.DATASOURCE, dataSourceJson)) | 39 | + subscribe = TelemetrySubscriber.createHistorySubscription(telemetryService, { id: deviceId, entityType: EntityType.DEVICE }, attr, telemetryService.getCommandSource(configurationNodeId, DataSourceTypeEnum.DATASOURCE, dataSourceJson)) |
| 40 | else | 40 | else |
| 41 | - subscribe = TelemetrySubscriber.createTimeseriesSubscription(telemetryService, { id: deviceId, entityType: EntityType.DEVICE }, attr, telemetryService.getCommandSource(id, DataSourceTypeEnum.DATASOURCE, dataSourceJson)) | 41 | + subscribe = TelemetrySubscriber.createTimeseriesSubscription(telemetryService, { id: deviceId, entityType: EntityType.DEVICE }, attr, telemetryService.getCommandSource(configurationNodeId, DataSourceTypeEnum.DATASOURCE, dataSourceJson)) |
| 42 | 42 | ||
| 43 | const subscriptionCommand = subscribe.subscriptionCommand as HistorySubscriptionCmd | 43 | const subscriptionCommand = subscribe.subscriptionCommand as HistorySubscriptionCmd |
| 44 | subscriptionCommand.agg = agg | 44 | subscriptionCommand.agg = agg |
| @@ -67,7 +67,7 @@ export class EventHandler { | @@ -67,7 +67,7 @@ export class EventHandler { | ||
| 67 | if (!cell) return | 67 | if (!cell) return |
| 68 | const id = cell.getId() | 68 | const id = cell.getId() |
| 69 | 69 | ||
| 70 | - const node = this.service.dataSource.find(item => item.id === id) | 70 | + const node = this.service.dataSource.find(item => item.configurationNodeId === id) |
| 71 | 71 | ||
| 72 | if (node && node.eventJson) { | 72 | if (node && node.eventJson) { |
| 73 | const instanceId = getAppInstanceId(cell) | 73 | const instanceId = getAppInstanceId(cell) |
| @@ -24,7 +24,6 @@ export class MessageHandler { | @@ -24,7 +24,6 @@ export class MessageHandler { | ||
| 24 | const telemetrySubscriber = this.service.subscribersMap.get(subscriptionId) | 24 | const telemetrySubscriber = this.service.subscribersMap.get(subscriptionId) |
| 25 | 25 | ||
| 26 | if (!telemetrySubscriber) return | 26 | if (!telemetrySubscriber) return |
| 27 | - | ||
| 28 | const { commandSource } = telemetrySubscriber | 27 | const { commandSource } = telemetrySubscriber |
| 29 | const { dataType } = commandSource | 28 | const { dataType } = commandSource |
| 30 | if (dataType === DataSourceTypeEnum.DATASOURCE) | 29 | if (dataType === DataSourceTypeEnum.DATASOURCE) |