Ver código fonte

完成初版告警组件的调试

valentichu 1 ano atrás
pai
commit
9ac05ba0c2

Diferenças do arquivo suprimidas por serem muito extensas
+ 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}
+            />
+          )}
+        </>
       )}
     </>
   );

Alguns arquivos não foram mostrados porque muitos arquivos mudaram nesse diff