Commit 2b6039b12da2df1c245c9e50cea465803d068591
Merge branch 'perf/linkedage' into 'main_dev'
perf: 修改场景联动事件触发key与调整清除告警样式 See merge request yunteng/thingskit-front!1055
Showing
2 changed files
with
7 additions
and
5 deletions
@@ -137,9 +137,10 @@ export const getFormSchemas = (hasAlarmNotify: Ref<boolean>): FormSchema[] => { | @@ -137,9 +137,10 @@ export const getFormSchemas = (hasAlarmNotify: Ref<boolean>): FormSchema[] => { | ||
137 | }, | 137 | }, |
138 | { | 138 | { |
139 | field: FormFieldsEnum.ENABLE_CLEAR_RULE, | 139 | field: FormFieldsEnum.ENABLE_CLEAR_RULE, |
140 | - label: '', | 140 | + label: ' ', |
141 | component: 'Checkbox', | 141 | component: 'Checkbox', |
142 | ifShow: ({ model }) => model[FormFieldsEnum.OUT_TARGET] === ExecutionActionEnum.MSG_NOTIFY, | 142 | ifShow: ({ model }) => model[FormFieldsEnum.OUT_TARGET] === ExecutionActionEnum.MSG_NOTIFY, |
143 | + labelWidth: 24, | ||
143 | renderComponentContent: () => ({ | 144 | renderComponentContent: () => ({ |
144 | default: () => [ | 145 | default: () => [ |
145 | h('span', FormFieldsNameEnum.ENABLE_CLEAR_RULE), | 146 | h('span', FormFieldsNameEnum.ENABLE_CLEAR_RULE), |
@@ -14,7 +14,7 @@ import { ConditionItemType } from '../ConditionFilter/type'; | @@ -14,7 +14,7 @@ import { ConditionItemType } from '../ConditionFilter/type'; | ||
14 | export function useFlipFlopData( | 14 | export function useFlipFlopData( |
15 | flipFlopListRef: Ref<FlipFlopItemType[]> | 15 | flipFlopListRef: Ref<FlipFlopItemType[]> |
16 | ): DefineComponentsBasicExpose<FlipFlopConditionType[]> { | 16 | ): DefineComponentsBasicExpose<FlipFlopConditionType[]> { |
17 | - const getEventTriggerCOndition = ( | 17 | + const getEventTriggerCondition = ( |
18 | basicRecord: FlipFlopFormRecordType, | 18 | basicRecord: FlipFlopFormRecordType, |
19 | _flipFlopItem: FlipFlopItemType | 19 | _flipFlopItem: FlipFlopItemType |
20 | ): ConditionItemType[] => { | 20 | ): ConditionItemType[] => { |
@@ -23,7 +23,7 @@ export function useFlipFlopData( | @@ -23,7 +23,7 @@ export function useFlipFlopData( | ||
23 | { | 23 | { |
24 | key: { | 24 | key: { |
25 | type: DeviceTriggerTypeEum.DEVICE_EVENT, | 25 | type: DeviceTriggerTypeEum.DEVICE_EVENT, |
26 | - key: deviceEventTriggerKey, | 26 | + key: 'eventIdentifier', |
27 | }, | 27 | }, |
28 | valueType: TriggerValueTypeEnum.STRING, | 28 | valueType: TriggerValueTypeEnum.STRING, |
29 | predicate: { | 29 | predicate: { |
@@ -41,7 +41,7 @@ export function useFlipFlopData( | @@ -41,7 +41,7 @@ export function useFlipFlopData( | ||
41 | const { conditionType } = basicRecord; | 41 | const { conditionType } = basicRecord; |
42 | return conditionType === DeviceTriggerTypeEum.TIME_SERIES | 42 | return conditionType === DeviceTriggerTypeEum.TIME_SERIES |
43 | ? flipFlopItem.conditionRef?.getFieldsValue() || [] | 43 | ? flipFlopItem.conditionRef?.getFieldsValue() || [] |
44 | - : getEventTriggerCOndition(basicRecord, flipFlopItem); | 44 | + : getEventTriggerCondition(basicRecord, flipFlopItem); |
45 | }; | 45 | }; |
46 | 46 | ||
47 | const crateFlipFlopCondition = (flipFlopItem: FlipFlopItemType): FlipFlopConditionType => { | 47 | const crateFlipFlopCondition = (flipFlopItem: FlipFlopItemType): FlipFlopConditionType => { |
@@ -106,6 +106,7 @@ export function useFlipFlopData( | @@ -106,6 +106,7 @@ export function useFlipFlopData( | ||
106 | const { key, valueType } = firstItem; | 106 | const { key, valueType } = firstItem; |
107 | const { type, unit, predicate } = condition.spec; | 107 | const { type, unit, predicate } = condition.spec; |
108 | const { defaultValue } = predicate || {}; | 108 | const { defaultValue } = predicate || {}; |
109 | + const { value } = firstItem.predicate; | ||
109 | 110 | ||
110 | const record = { | 111 | const record = { |
111 | ...data, | 112 | ...data, |
@@ -122,7 +123,7 @@ export function useFlipFlopData( | @@ -122,7 +123,7 @@ export function useFlipFlopData( | ||
122 | 123 | ||
123 | if (key.type === DeviceTriggerTypeEum.DEVICE_EVENT) { | 124 | if (key.type === DeviceTriggerTypeEum.DEVICE_EVENT) { |
124 | Object.assign(record, { | 125 | Object.assign(record, { |
125 | - [FormFieldEnum.DEVICE_EVENT_TRIGGER_KEY]: key.key, | 126 | + [FormFieldEnum.DEVICE_EVENT_TRIGGER_KEY]: value.defaultValue, |
126 | [FormFieldEnum.CONDITION_KEY]: null, | 127 | [FormFieldEnum.CONDITION_KEY]: null, |
127 | }); | 128 | }); |
128 | } | 129 | } |