|
@@ -4,7 +4,7 @@ import React, {
|
|
|
forwardRef,
|
|
forwardRef,
|
|
|
useImperativeHandle,
|
|
useImperativeHandle,
|
|
|
} from "react";
|
|
} from "react";
|
|
|
-import { Form, Input, Select, message, Switch, Space, Col } from "antd";
|
|
|
|
|
|
|
+import { Form, Input, Select, message, Switch, Space, Col, Tabs } from "antd";
|
|
|
import { Modal, Button, Radio } from "antd";
|
|
import { Modal, Button, Radio } from "antd";
|
|
|
import styles from "./detail.module.less";
|
|
import styles from "./detail.module.less";
|
|
|
import API from "../../../api/alarm";
|
|
import API from "../../../api/alarm";
|
|
@@ -67,12 +67,13 @@ const Detail = (props) => {
|
|
|
}
|
|
}
|
|
|
setCurrent(record.id);
|
|
setCurrent(record.id);
|
|
|
};
|
|
};
|
|
|
|
|
+
|
|
|
return (
|
|
return (
|
|
|
<>
|
|
<>
|
|
|
<Modal
|
|
<Modal
|
|
|
title="告警记录"
|
|
title="告警记录"
|
|
|
open={props.open}
|
|
open={props.open}
|
|
|
- width={1200}
|
|
|
|
|
|
|
+ width="90vw"
|
|
|
onCancel={() => {
|
|
onCancel={() => {
|
|
|
props.onCancel();
|
|
props.onCancel();
|
|
|
}}
|
|
}}
|
|
@@ -80,49 +81,54 @@ const Detail = (props) => {
|
|
|
footer={null}
|
|
footer={null}
|
|
|
destroyOnClose
|
|
destroyOnClose
|
|
|
>
|
|
>
|
|
|
- <div className={styles.header}>
|
|
|
|
|
- <div className={styles.tags}>
|
|
|
|
|
- <Radio.Group
|
|
|
|
|
- value={current}
|
|
|
|
|
- onChange={(e) => setCurrent(e.target.value)}
|
|
|
|
|
- size="middle"
|
|
|
|
|
- >
|
|
|
|
|
- <Radio.Button value="history">告警记录</Radio.Button>
|
|
|
|
|
- {tags.map((item, index) => (
|
|
|
|
|
- <Radio.Button value={item.id}>
|
|
|
|
|
- <div className={styles.tagContainer}>
|
|
|
|
|
- <div className={styles.label}>详情{index + 1}</div>
|
|
|
|
|
- <CloseOutlined
|
|
|
|
|
- onClick={() => {
|
|
|
|
|
- if (current === item.id) {
|
|
|
|
|
- setCurrent("history");
|
|
|
|
|
- }
|
|
|
|
|
- onRemove(index);
|
|
|
|
|
- }}
|
|
|
|
|
- />
|
|
|
|
|
- </div>
|
|
|
|
|
- </Radio.Button>
|
|
|
|
|
- ))}
|
|
|
|
|
- </Radio.Group>
|
|
|
|
|
- </div>
|
|
|
|
|
- <div className={styles.oper}>
|
|
|
|
|
|
|
+ {props.open && (
|
|
|
|
|
+ <>
|
|
|
|
|
+ <div className={styles.header}>
|
|
|
|
|
+ <div className={styles.tags}>
|
|
|
|
|
+ <Radio.Group
|
|
|
|
|
+ value={current}
|
|
|
|
|
+ onChange={(e) => setCurrent(e.target.value)}
|
|
|
|
|
+ size="middle"
|
|
|
|
|
+ >
|
|
|
|
|
+ <Radio.Button value="history">告警记录</Radio.Button>
|
|
|
|
|
+ {tags.map((item, index) => (
|
|
|
|
|
+ <Radio.Button value={item.id}>
|
|
|
|
|
+ <div className={styles.tagContainer}>
|
|
|
|
|
+ <div className={styles.label}>详情{index + 1}</div>
|
|
|
|
|
+ <CloseOutlined
|
|
|
|
|
+ style={{ fontSize: 10 }}
|
|
|
|
|
+ onClick={() => {
|
|
|
|
|
+ if (current === item.id) {
|
|
|
|
|
+ setCurrent("history");
|
|
|
|
|
+ }
|
|
|
|
|
+ onRemove(index);
|
|
|
|
|
+ }}
|
|
|
|
|
+ />
|
|
|
|
|
+ </div>
|
|
|
|
|
+ </Radio.Button>
|
|
|
|
|
+ ))}
|
|
|
|
|
+ </Radio.Group>
|
|
|
|
|
+ </div>
|
|
|
|
|
+ <div className={styles.oper}>
|
|
|
|
|
+ {current !== "history" && (
|
|
|
|
|
+ <Button
|
|
|
|
|
+ disabled={currentData?.data?.op_status === 1}
|
|
|
|
|
+ onClick={() => setShowConfirm(true)}
|
|
|
|
|
+ >
|
|
|
|
|
+ {currentData?.data?.op_status === 1 ? "已确认" : "确认"}
|
|
|
|
|
+ </Button>
|
|
|
|
|
+ )}
|
|
|
|
|
+ {/* <Button style={{ marginLeft: 10 }}>告警配置</Button> */}
|
|
|
|
|
+ </div>
|
|
|
|
|
+ </div>
|
|
|
|
|
+
|
|
|
|
|
+ {current === "history" && (
|
|
|
|
|
+ <AlarmHistory onSelect={onSelect} ruleId={ruleId}></AlarmHistory>
|
|
|
|
|
+ )}
|
|
|
{current !== "history" && (
|
|
{current !== "history" && (
|
|
|
- <Button
|
|
|
|
|
- disabled={currentData?.data?.op_status === 1}
|
|
|
|
|
- onClick={() => setShowConfirm(true)}
|
|
|
|
|
- >
|
|
|
|
|
- {currentData?.data?.op_status === 1 ? "已确认" : "确认"}
|
|
|
|
|
- </Button>
|
|
|
|
|
|
|
+ <AlarmDetail data={currentData}></AlarmDetail>
|
|
|
)}
|
|
)}
|
|
|
- {/* <Button style={{ marginLeft: 10 }}>告警配置</Button> */}
|
|
|
|
|
- </div>
|
|
|
|
|
- </div>
|
|
|
|
|
-
|
|
|
|
|
- {current === "history" && (
|
|
|
|
|
- <AlarmHistory onSelect={onSelect} ruleId={ruleId}></AlarmHistory>
|
|
|
|
|
- )}
|
|
|
|
|
- {current !== "history" && (
|
|
|
|
|
- <AlarmDetail data={currentData}></AlarmDetail>
|
|
|
|
|
|
|
+ </>
|
|
|
)}
|
|
)}
|
|
|
</Modal>
|
|
</Modal>
|
|
|
<AlarmConfirm
|
|
<AlarmConfirm
|