valentichu 1 jaar geleden
bovenliggende
commit
795219ab7f
4 gewijzigde bestanden met toevoegingen van 6 en 8 verwijderingen
  1. 0 0
      lib/index.js
  2. 3 1
      src/App.jsx
  3. 2 6
      src/pages/Alarm/components/complex.jsx
  4. 1 1
      src/pages/Alarm/components/easy.jsx

File diff suppressed because it is too large
+ 0 - 0
lib/index.js


+ 3 - 1
src/App.jsx

@@ -15,7 +15,9 @@ function Home(props) {
         //   pointId: "ABC123_AAA_chr1_AEff_MIN_H",
         // }}
       ></Alarm.DetailModal> */}
-      <Alarm.ComplexConfig editId={27} showList></Alarm.ComplexConfig>
+      {/* <Alarm.ComplexConfig editId={27} showList></Alarm.ComplexConfig> */}
+      <Alarm.EasyConfig pointId="ABC123_AAA_chr1_AEff_MIN_H" ></Alarm.EasyConfig>
+
     </>
   );
 }

+ 2 - 6
src/pages/Alarm/components/complex.jsx

@@ -77,11 +77,7 @@ const Complex = (props, ref) => {
         formuRef.current.backEndInput(data.formula);
         setData(data);
       } else {
-        form.setFieldsValue({
-          name: "",
-          alarm_level: "",
-          group_id: "",
-        });
+        form.resetFields();
         setData(null);
       }
     }
@@ -228,7 +224,7 @@ const Complex = (props, ref) => {
   useEffect(() => {
     if (type === 2) {
       setAlarmId(-1);
-    } else if(alarmId === -1 && type !== 2) {
+    } else if (alarmId === -1 && type !== 2) {
       setAlarmId(null);
     }
   }, [type, alarmId]);

+ 1 - 1
src/pages/Alarm/components/easy.jsx

@@ -270,7 +270,7 @@ const Easy = (props, ref) => {
         setAlarmId(editId);
       } else if (pointId && pointId !== -1) {
         const res = await API2.getRuleIdByPointId(pointId);
-        setAlarmId(res?.data?.[0]?.id);
+        setAlarmId(res?.data?.[0]?.id ?? -1);
       }
     }
     run();

Some files were not shown because too many files changed in this diff