...
|
...
|
@@ -14,7 +14,7 @@ import { ConditionItemType } from '../ConditionFilter/type'; |
14
|
14
|
export function useFlipFlopData(
|
15
|
15
|
flipFlopListRef: Ref<FlipFlopItemType[]>
|
16
|
16
|
): DefineComponentsBasicExpose<FlipFlopConditionType[]> {
|
17
|
|
- const getEventTriggerCOndition = (
|
|
17
|
+ const getEventTriggerCondition = (
|
18
|
18
|
basicRecord: FlipFlopFormRecordType,
|
19
|
19
|
_flipFlopItem: FlipFlopItemType
|
20
|
20
|
): ConditionItemType[] => {
|
...
|
...
|
@@ -23,7 +23,7 @@ export function useFlipFlopData( |
23
|
23
|
{
|
24
|
24
|
key: {
|
25
|
25
|
type: DeviceTriggerTypeEum.DEVICE_EVENT,
|
26
|
|
- key: deviceEventTriggerKey,
|
|
26
|
+ key: 'eventIdentifier',
|
27
|
27
|
},
|
28
|
28
|
valueType: TriggerValueTypeEnum.STRING,
|
29
|
29
|
predicate: {
|
...
|
...
|
@@ -41,7 +41,7 @@ export function useFlipFlopData( |
41
|
41
|
const { conditionType } = basicRecord;
|
42
|
42
|
return conditionType === DeviceTriggerTypeEum.TIME_SERIES
|
43
|
43
|
? flipFlopItem.conditionRef?.getFieldsValue() || []
|
44
|
|
- : getEventTriggerCOndition(basicRecord, flipFlopItem);
|
|
44
|
+ : getEventTriggerCondition(basicRecord, flipFlopItem);
|
45
|
45
|
};
|
46
|
46
|
|
47
|
47
|
const crateFlipFlopCondition = (flipFlopItem: FlipFlopItemType): FlipFlopConditionType => {
|
...
|
...
|
@@ -106,6 +106,7 @@ export function useFlipFlopData( |
106
|
106
|
const { key, valueType } = firstItem;
|
107
|
107
|
const { type, unit, predicate } = condition.spec;
|
108
|
108
|
const { defaultValue } = predicate || {};
|
|
109
|
+ const { value } = firstItem.predicate;
|
109
|
110
|
|
110
|
111
|
const record = {
|
111
|
112
|
...data,
|
...
|
...
|
@@ -122,7 +123,7 @@ export function useFlipFlopData( |
122
|
123
|
|
123
|
124
|
if (key.type === DeviceTriggerTypeEum.DEVICE_EVENT) {
|
124
|
125
|
Object.assign(record, {
|
125
|
|
- [FormFieldEnum.DEVICE_EVENT_TRIGGER_KEY]: key.key,
|
|
126
|
+ [FormFieldEnum.DEVICE_EVENT_TRIGGER_KEY]: value.defaultValue,
|
126
|
127
|
[FormFieldEnum.CONDITION_KEY]: null,
|
127
|
128
|
});
|
128
|
129
|
}
|
...
|
...
|
|