瀏覽代碼

完成初版告警组件的调试

valentichu 1 年之前
父節點
當前提交
9ac05ba0c2
共有 2 個文件被更改,包括 20 次插入13 次删除
  1. 0 0
      lib/index.js
  2. 20 13
      src/pages/Alarm/components/components/AlarmDetail/index.jsx

文件差異過大導致無法顯示
+ 0 - 0
lib/index.js


+ 20 - 13
src/pages/Alarm/components/components/AlarmDetail/index.jsx

@@ -204,6 +204,8 @@ const Index = (props) => {
       props.data?.data?.rule_id === undefined
     )
       return;
+    if (props.data?.data?.sub_type !== 13 && props.data?.data?.sub_type !== 14)
+      return;
     const res = await API.getAlarmPointData(
       props.data?.data?.rule_id,
       range[0].unix(),
@@ -346,20 +348,25 @@ const Index = (props) => {
           {props.data?.data?.remark}
         </Descriptions.Item>
       </Descriptions>
-      <div className={styles.range}>
-        <RangePicker
-          value={range}
-          onChange={setRange}
-          style={{ width: 440, marginTop: 50 }}
-        />
-      </div>
+      {(props.data?.data?.sub_type === 13 ||
+        props.data?.data?.sub_type === 14) && (
+        <>
+          <div className={styles.range}>
+            <RangePicker
+              value={range}
+              onChange={setRange}
+              style={{ width: 440, marginTop: 50 }}
+            />
+          </div>
 
-      {chartData && (
-        <ReactECharts
-          style={{ height: 250 }}
-          option={chartData}
-          notMerge={true}
-        />
+          {chartData && (
+            <ReactECharts
+              style={{ height: 250 }}
+              option={chartData}
+              notMerge={true}
+            />
+          )}
+        </>
       )}
     </>
   );

部分文件因文件數量過多而無法顯示