Commit 14204ba09f25e2a6a7756cc501dc175c03333af0
Merge branch 'fix/rule-linkedge-clear' into 'main_dev'
fix: 修复新增场景联动修改组织时未重置组织相关表单控件 See merge request yunteng/thingskit-front!1290
Showing
1 changed file
with
15 additions
and
1 deletions
... | ... | @@ -5,7 +5,7 @@ |
5 | 5 | import { BasicForm, FormActionType, ThingsModelForm } from '/@/components/Form'; |
6 | 6 | import { getFormSchemas, FormFieldsEnum } from './config'; |
7 | 7 | import { FlipFlop } from '../FlipFlop'; |
8 | - import { ComponentPublicInstance, ref, unref } from 'vue'; | |
8 | + import { ComponentPublicInstance, ref, unref, watch } from 'vue'; | |
9 | 9 | import { ExecutionActionListRefItemType } from './type'; |
10 | 10 | import { useExecutionActionData } from './useExecutionActionData'; |
11 | 11 | import { createNewExecutionActionItem } from '.'; |
... | ... | @@ -63,6 +63,20 @@ |
63 | 63 | hasAlarmNotify |
64 | 64 | ); |
65 | 65 | |
66 | + const { organizationId } = useSceneLinkageDrawerContext(); | |
67 | + | |
68 | + /** | |
69 | + * @description on organization change | |
70 | + */ | |
71 | + watch(organizationId, () => { | |
72 | + unref(executionActionListRef).forEach((flipFlopItem) => | |
73 | + flipFlopItem.ref?.setFieldsValue({ | |
74 | + [FormFieldsEnum.ENTITY_ID]: [], | |
75 | + [FormFieldsEnum.ALARM_PROFILED]: null, | |
76 | + }) | |
77 | + ); | |
78 | + }); | |
79 | + | |
66 | 80 | defineExpose({ |
67 | 81 | getFieldsValue, |
68 | 82 | setFieldsValue, | ... | ... |