valentichu 1 yıl önce
ebeveyn
işleme
babbf2b7a6

Dosya farkı çok büyük olduğundan ihmal edildi
+ 0 - 0
lib/index.js


+ 5 - 5
src/App.jsx

@@ -15,15 +15,15 @@ function Home(props) {
           detail: {
             id: 260909,
             name: "DT_chr7_AE已有告警名称超下下限(值0.00; 限值5000)",
-            rule_id: 97,
+            rule_id: 88,
             type: 1,
             sub_type: 14,
             status: 1,
-            point_id: "DT_chr7_AE",
+            point_id: "ZWB_ALARM_chr_1_AE",
             point_name: "",
             alarm_level: 1,
             op_status: 2,
-            created_time: "2024-09-24 14:50:08",
+            created_time: "2024-09-25 10:43:08",
             duration: 3,
             confirmed_time: "",
             confirmed_oper_id: 0,
@@ -39,8 +39,8 @@ function Home(props) {
         //   pointId: "ABC123_AAA_chr1_AEff_MIN_H",
         // }}
       ></Alarm.DetailModal>
-      {/* <Alarm.ComplexConfig ref={compRef} editId={-1}></Alarm.ComplexConfig> */}
-      {/* <button onClick={() => compRef?.current?.ok()}>测试</button> */}
+      {/* <Alarm.ComplexConfig ref={compRef} showList editId={-1}></Alarm.ComplexConfig>
+      <button onClick={() => compRef?.current?.ok()}>测试</button> */}
       {/* <Alarm.EasyConfig
         ref={compRef}
         // pointId="ZWB_ALARM_chr_2_AQ"

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

@@ -272,7 +272,26 @@ const Complex = (props, ref) => {
                   </Radio.Group>
                 </Form.Item>
                 {type === 1 && (
-                  <Form.Item label="关联规则">
+                  <Form.Item
+                    required={true}
+                    name="temp"
+                    rules={[
+                      {
+                        required: true,
+                        message: "请选择规则",
+                        validator: () => {
+                          return new Promise((resolve, reject) => {
+                            if (alarmId) {
+                              resolve();
+                            } else {
+                              reject();
+                            }
+                          });
+                        },
+                      },
+                    ]}
+                    label="关联规则"
+                  >
                     <Select
                       value={alarmId}
                       onChange={setAlarmId}
@@ -359,7 +378,6 @@ const Complex = (props, ref) => {
                       message: "请输入条件",
                       validator: () => {
                         return new Promise((resolve, reject) => {
-                          console.log(formuRef.current.getFinalStr());
                           if (formuRef.current.getFinalStr()) {
                             resolve();
                           } else {

+ 25 - 3
src/pages/Alarm/components/components/AlarmDetail/index.jsx

@@ -108,16 +108,37 @@ const colors = [
 const initialOption = {
   tooltip: {
     trigger: "axis",
+    className: styles.tooltip,
+    textStyle: {
+      color: getVariable("--dt-text-color1"),
+    },
+    formatter: (params) => {
+      const axisValue = params?.[0]?.axisValue ?? "--";
+      return (
+        axisValue +
+        "<br/>" +
+        params
+          .map((item) => {
+            return (
+              `<span style="display:inline-block;margin-right:4px;margin-bottom:5px;width:10px;height:2px;background:${item.color};"></span>` +
+              item.seriesName +
+              "    " +
+              item.value
+            );
+          })
+          .join("<br/>")
+      );
+    },
   },
   legend: {
     show: true,
     top: 0,
     left: "center",
-    icon: "circle",
     itemWidth: 8,
     textStyle: {
       color: getVariable("--dt-text-color3"),
     },
+    icon: "path://M0,0L9,0L9,1L0,1",
   },
   grid: {
     top: 30,
@@ -295,8 +316,9 @@ const Index = (props) => {
       });
     }
     newData.series[0].symbol = (value) => {
-      return value > res?.data?.ll?.[0]?.[1] ||
-        value > res?.data?.threshold?.[0]?.[1]
+      return value >= res?.data?.h?.[0]?.[1] ||
+        value <= res?.data?.l?.[0]?.[1] ||
+        value >= res?.data?.threshold?.[0]?.[1]
         ? ""
         : "none";
     };

+ 6 - 0
src/pages/Alarm/components/components/AlarmDetail/index.module.less

@@ -59,3 +59,9 @@
     }
   }
 }
+
+.tooltip {
+  background-color: var(--dt-fill-color3) !important;
+  border-width: 0 !important;
+  box-shadow: 0px 2px 8px rgba(0, 0, 0, 0.1) !important;
+}

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

@@ -9,6 +9,7 @@ import { Modal, Button, Radio } from "antd";
 import styles from "./easy.module.less";
 import API2 from "../../../api/alarm";
 import { useMemoizedFn } from "ahooks";
+import { DownOutlined, UpOutlined } from "@ant-design/icons";
 
 function TranslateText(arr) {
   const dtLanguage = localStorage.getItem("dtLanguage");
@@ -496,12 +497,12 @@ const Easy = (props, ref) => {
               <Select.Option
                 value={
                   item.name +
-                  "<==>" +
-                  item.defer_unit +
-                  "<==>" +
-                  item.point_id +
-                  "<==>" +
-                  item.unit || ''
+                    "<==>" +
+                    item.defer_unit +
+                    "<==>" +
+                    item.point_id +
+                    "<==>" +
+                    item.unit || ""
                 }
                 key={item.point_id}
               >
@@ -544,7 +545,7 @@ const Easy = (props, ref) => {
         <Form.Item
           label={TranslateText(["告警值", "Alarm value"])}
           name="alarm_value"
-          required={false}
+          required={true}
           rules={[
             {
               required: true,
@@ -775,6 +776,7 @@ const Easy = (props, ref) => {
               }}
             >
               更多
+              <DownOutlined></DownOutlined>
             </Button>
           }
         ></Form.Item>
@@ -896,6 +898,21 @@ const Easy = (props, ref) => {
           </Form.Item>
         </>
       )}
+
+      {showMore && (
+        <Form.Item
+          label={
+            <Button
+              type="link"
+              onClick={() => {
+                setShowMore(false);
+              }}
+            >
+              收起<UpOutlined></UpOutlined>
+            </Button>
+          }
+        ></Form.Item>
+      )}
     </Form>
   );
 };

Bu fark içinde çok fazla dosya değişikliği olduğu için bazı dosyalar gösterilmiyor