xieyonghong 3 лет назад
Родитель
Сommit
87687623e1

+ 2 - 1
src/pages/notice/Template/Debug/index.tsx

@@ -78,7 +78,7 @@ const Debug = observer(() => {
         state1.value = data?.variableDefinitions;
       });
     }
-  }, [state.current]);
+  }, [state.current, state.debug]);
 
   const SchemaField = createSchemaField({
     components: {
@@ -225,6 +225,7 @@ const Debug = observer(() => {
       title="调试"
       width="40vw"
       destroyOnClose
+      forceRender={true}
       visible={state.debug}
       onCancel={() => (state.debug = false)}
       onOk={start}

+ 3 - 2
src/pages/rule-engine/Alarm/Configuration/Save/index.tsx

@@ -3,7 +3,7 @@ import { useMemo } from 'react';
 import { createForm } from '@formily/core';
 import { createSchemaField } from '@formily/react';
 import { Form, FormGrid, FormItem, Input, Radio, Select } from '@formily/antd';
-import type { ISchema } from '@formily/json-schema';
+import { ISchema } from '@formily/json-schema';
 import { PermissionButton } from '@/components';
 import { PlusOutlined } from '@ant-design/icons';
 import Service from '@/pages/rule-engine/Alarm/Configuration/service';
@@ -74,7 +74,7 @@ const Save = (props: Props) => {
         validateFirst: true,
         effects() {},
       }),
-    [props.data],
+    [props.data, props.visible],
   );
 
   const getSupports = () => service.getTargetTypes();
@@ -212,6 +212,7 @@ const Save = (props: Props) => {
       width="40vw"
       visible={visible}
       onOk={handleSave}
+      forceRender={true}
       onCancel={() => close()}
       title={`${props.data ? '编辑' : '新增'}告警`}
     >