Commit a3edfe3cc3b522fdd3f56af5bb0a8d9adb2c9c64

Authored by 温伟
Committed by xp.Huang
1 parent 2070e7cd

fix: 修复组态相关保存由id改为configurationNodeId

... ... @@ -1309,7 +1309,7 @@ operationPassword=操作密码
1309 1309 dataSource=数据源
1310 1310 dataInteraction=数据交互
1311 1311 display=显示
1312   -actHidden=隐藏
  1312 +acrHidden=隐藏
1313 1313 flow=流动
1314 1314 stop=停止
1315 1315 actOpen=开启
... ...
... ... @@ -17,7 +17,7 @@ export const tableColumns = (): BasicColumn[] => {
17 17 title: t('state'),
18 18 dataIndex: 'type',
19 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 88
89 89 if (nodeUtils.getNodeComponentKey(cell) === ControlComponentEnum.SWITCH) {
90 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 92 if (!currentData) return
93 93 const { actJson } = currentData
94 94 const { rangeList } = actJson.STATUS_SETTING
... ...
... ... @@ -53,7 +53,8 @@ export const getVideoTypeByUrl = (url: string) => {
53 53 export async function getPlayUrl(
54 54 params: VideoItemRecordType,
55 55 ): Promise<Undefineable<{ url: string; type: StreamType }>> {
56   - const { accessMode } = params
  56 + let { accessMode } = params
  57 + accessMode = Number(accessMode)
57 58 if (accessMode === VideoAccessModeEnum.ManuallyEnter) {
58 59 const { videoUrl } = params
59 60 if (params.videoUrl) {
... ...
... ... @@ -99,7 +99,7 @@ const [register, { getFieldsValue, validate, setFieldsValue }] = useForm({
99 99 {
100 100 field: VideoFormFieldsEnum.ACCESS_MODE,
101 101 label: t(VideoFormFieldsNameEnum.ACCESS_MODE),
102   - component: ComponentEnum.INPUT,
  102 + component: ComponentEnum.INPUT_NUMBER,
103 103 ifShow: false,
104 104 },
105 105 {
... ...
... ... @@ -30,10 +30,10 @@ export default class Config implements CreateComponentType {
30 30 }
31 31
32 32 export const dataSubscribers: ComponentConfigModuleType['dataSubscribers'] = (telemetryService, nodeData) => {
33   - const { dataSourceJson, id } = nodeData
  33 + const { dataSourceJson, configurationNodeId } = nodeData
34 34 const { deviceId, attr, chartOption } = dataSourceJson
35 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 38 const subscriptionCommand = subscribe.subscriptionCommand as HistorySubscriptionCmd
39 39 subscriptionCommand.agg = agg
... ...
... ... @@ -30,15 +30,15 @@ export default class Config implements CreateComponentType {
30 30 }
31 31
32 32 export const dataSubscribers: ComponentConfigModuleType['dataSubscribers'] = (telemetryService, nodeData) => {
33   - const { dataSourceJson, id } = nodeData
  33 + const { dataSourceJson, configurationNodeId } = nodeData
34 34 const { deviceId, attr, chartOption } = dataSourceJson
35 35 const { agg, interval, effectScope = 0, queryType } = chartOption!
36 36
37 37 let subscribe
38 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 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 43 const subscriptionCommand = subscribe.subscriptionCommand as HistorySubscriptionCmd
44 44 subscriptionCommand.agg = agg
... ...
... ... @@ -67,7 +67,7 @@ export class EventHandler {
67 67 if (!cell) return
68 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 72 if (node && node.eventJson) {
73 73 const instanceId = getAppInstanceId(cell)
... ...
... ... @@ -24,7 +24,6 @@ export class MessageHandler {
24 24 const telemetrySubscriber = this.service.subscribersMap.get(subscriptionId)
25 25
26 26 if (!telemetrySubscriber) return
27   -
28 27 const { commandSource } = telemetrySubscriber
29 28 const { dataType } = commandSource
30 29 if (dataType === DataSourceTypeEnum.DATASOURCE)
... ...