valentichu 1 gadu atpakaļ
vecāks
revīzija
fc0afa0626

Failā izmaiņas netiks attēlotas, jo tās ir par lielu
+ 0 - 0
lib/index.js


+ 33 - 9
src/App.jsx

@@ -7,22 +7,46 @@ function Home(props) {
 
   return (
     <>
-      <Alarm.DetailModal
+      {/* <Alarm.DetailModal
         open={open}
         onCancel={() => setOpen(false)}
-        options={{ ruleId: 25 }}
+        // options={{ ruleId: 25 }}
+        options={{
+          detail: {
+            alarm_level: 1,
+            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,
+            unit: "",
+            value: 30,
+          },
+        }}
         // options={{
         //   pointId: "ABC123_AAA_chr1_AEff_MIN_H",
         // }}
-      ></Alarm.DetailModal>
-      {/* <Alarm.ComplexConfig ref={compRef} editId={-1}></Alarm.ComplexConfig>
-      <button onClick={() => compRef?.current?.ok()}>测试</button> */}
-      {/* <Alarm.EasyConfig
+      ></Alarm.DetailModal> */}
+      {/* <Alarm.ComplexConfig ref={compRef} editId={-1}></Alarm.ComplexConfig> */}
+      <button onClick={() => compRef?.current?.ok()}>测试</button>
+      <Alarm.EasyConfig
         ref={compRef}
-        // pointId="ZWB_ALARM_chr_5_AE"
+        // pointId="ZWB_ALARM_chr_2_AQ"
         // readonly
-          editId={-1}
-      ></Alarm.EasyConfig> */}
+        editId={94}
+      ></Alarm.EasyConfig>
     </>
   );
 }

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

@@ -249,7 +249,7 @@ const Complex = (props, ref) => {
             name="basic"
             autoComplete="off"
             form={form}
-            requiredMark={false}
+            requiredMark={true}
             labelAlign="right"
             colon={false}
             labelCol={{
@@ -352,7 +352,23 @@ const Complex = (props, ref) => {
 
                 <Form.Item
                   label={TranslateText(["条件编辑", "Edit"])}
-                  // name="formu"
+                  name="formu"
+                  rules={[
+                    {
+                      required: true,
+                      message: "请输入条件",
+                      validator: () => {
+                        return new Promise((resolve, reject) => {
+                          console.log(formuRef.current.getFinalStr());
+                          if (formuRef.current.getFinalStr()) {
+                            resolve();
+                          } else {
+                            reject();
+                          }
+                        });
+                      },
+                    },
+                  ]}
                 >
                   <Formular ref={formuRef} key={`${type}-${alarmId}`} />
                 </Form.Item>

+ 1 - 0
src/pages/Alarm/components/components/AlarmHistory/index.jsx

@@ -288,6 +288,7 @@ const Index = (props) => {
           total={total}
           showTotal={showTotal}
           showSizeChanger={false}
+          pageSize={15}
         />
       </div>
       <AlarmConfirm

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

@@ -49,7 +49,7 @@ const Detail = (props) => {
       ]);
       setCurrent(options.detail.id);
     }
-  }, [options]);
+  }, [options.detail, options.ruleId, options.pointId]);
   const currentData = tags.find((item) => item.id === current) ?? {};
   const onRemove = (index) => {
     const newTags = _.cloneDeep(tags);

+ 7 - 3
src/pages/Alarm/components/easy.jsx

@@ -338,7 +338,7 @@ const Easy = (props, ref) => {
           alarm_level: 1,
           sub_type: 14,
           point_id: props.pointId ?? "",
-          status:true,
+          status: true,
         });
         setAllEnable(true);
         setAlEnable(true);
@@ -359,10 +359,14 @@ const Easy = (props, ref) => {
             no_child: true,
           });
           form.setFieldsValue({
-            name: res?.data?.[0]?.name,
             point_name: res?.data?.[0]?.name,
             defer_unit: res?.data?.[0]?.defer_unit,
           });
+          if (!form.getFieldValue("name")) {
+            form.setFieldsValue({
+              name: res?.data?.[0]?.name,
+            });
+          }
           setDeferUnit(res?.data?.[0]?.defer_unit);
         }
       }
@@ -819,7 +823,7 @@ const Easy = (props, ref) => {
           >
             <div style={{ marginTop: 6 }}>
               <Radio.Group
-                defaultValue={2}
+                value={status}
                 disabled={isDisabled}
                 onChange={(e) => {
                   setStatus(e.target.value);

Daži faili netika attēloti, jo izmaiņu fails ir pārāk liels