valentichu 1 tahun lalu
induk
melakukan
ed83302d5e

File diff ditekan karena terlalu besar
+ 0 - 0
lib/index.js


+ 19 - 19
src/App.jsx

@@ -7,46 +7,46 @@ function Home(props) {
 
   return (
     <>
-      {/* <Alarm.DetailModal
+      <Alarm.DetailModal
         open={open}
         onCancel={() => setOpen(false)}
         // options={{ ruleId: 25 }}
         options={{
           detail: {
+            id: 260909,
+            name: "DT_chr7_AE已有告警名称超下下限(值0.00; 限值5000)",
+            rule_id: 97,
+            type: 1,
+            sub_type: 14,
+            status: 1,
+            point_id: "DT_chr7_AE",
+            point_name: "",
             alarm_level: 1,
+            op_status: 2,
+            created_time: "2024-09-24 14:50:08",
+            duration: 3,
+            confirmed_time: "",
             confirmed_oper_id: 0,
             confirmed_oper_name: "",
-            confirmed_time: "",
-            created_time: "2024-09-20 17:59:13",
-            duration: 234078,
-            group_name: "",
-            id: 249386,
-            name: "ZWB_告警功能测试_冷机_冷机1_累计能耗超下下限(值30.00; 限值40)",
-            op_status: 2,
-            point_id: "ZWB_ALARM_chr_4_AE",
-            point_name: "",
             recovery_time: "",
             remark: "",
-            rule_id: 70,
-            status: 1,
-            sub_type: 14,
-            type: 1,
+            value: 2.446e-41,
             unit: "",
-            value: 30,
+            group_name: "",
           },
         }}
         // options={{
         //   pointId: "ABC123_AAA_chr1_AEff_MIN_H",
         // }}
-      ></Alarm.DetailModal> */}
+      ></Alarm.DetailModal>
       {/* <Alarm.ComplexConfig ref={compRef} editId={-1}></Alarm.ComplexConfig> */}
-      <button onClick={() => compRef?.current?.ok()}>测试</button>
-      <Alarm.EasyConfig
+      {/* <button onClick={() => compRef?.current?.ok()}>测试</button> */}
+      {/* <Alarm.EasyConfig
         ref={compRef}
         // pointId="ZWB_ALARM_chr_2_AQ"
         // readonly
         editId={-1}
-      ></Alarm.EasyConfig>
+      ></Alarm.EasyConfig> */}
     </>
   );
 }

+ 2 - 2
src/pages/Alarm/components/components/AlarmConfirm/index.jsx

@@ -41,12 +41,12 @@ const Index = (props) => {
     if (res.state === 0) {
       message.success("确认成功");
       props.onCancel?.();
-      props.onConfirm?.();
+      props.onConfirm?.(res?.data?.[0]);
     } else {
       message.error(res.state_info);
       if (res.state === 100) {
         props.onCancel?.();
-        props.onConfirm?.();
+        props.onConfirm?.(res?.data?.[0]);
       }
     }
   };

+ 7 - 5
src/pages/Alarm/components/detail.jsx

@@ -67,11 +67,13 @@ const Detail = (props) => {
     }
     setCurrent(record.id);
   };
-  const onAlarmConfirm = () => {
-    const newTags = _.clone(tags);
-    const currentDetail = tags.find((item) => item.id === current);
-    currentDetail.data.op_status = 1;
-    setTags(newTags);
+  const onAlarmConfirm = (newRecord) => {
+    if (newRecord) {
+      const newTags = _.clone(tags);
+      const currentIndex = newTags.findIndex((item) => item.id === current);
+      newTags[currentIndex] = newRecord;
+      setTags(newTags);
+    }
   };
 
   return (

Beberapa file tidak ditampilkan karena terlalu banyak file yang berubah dalam diff ini