|
|
@@ -135,8 +135,7 @@ const Index = (props) => {
|
|
|
const [range, setRange] = useState(null);
|
|
|
|
|
|
const fetchData = useMemoizedFn(async () => {
|
|
|
- if (!props.ruleId && !props.group) return;
|
|
|
-
|
|
|
+ if (!props.ruleId && props.group === undefined) return;
|
|
|
const res = range
|
|
|
? await API.getAlarmHistory({
|
|
|
page,
|
|
|
@@ -146,7 +145,7 @@ const Index = (props) => {
|
|
|
op_status: opStatus,
|
|
|
group_ids: props.group,
|
|
|
begin: range[0].unix(),
|
|
|
- end: range[1].unix(),
|
|
|
+ end: range[1].hour(23).minute(59).second(59).unix(),
|
|
|
diagram_uuid: props.diagramId,
|
|
|
})
|
|
|
: await API.getAlarmHistory({
|
|
|
@@ -172,7 +171,7 @@ const Index = (props) => {
|
|
|
op_status: opStatus,
|
|
|
group_ids: props.group,
|
|
|
begin: range[0].unix(),
|
|
|
- end: range[1].unix(),
|
|
|
+ end: range[1].hour(23).minute(59).second(59).unix(),
|
|
|
isExport: true,
|
|
|
export_name: "告警记录",
|
|
|
diagram_uuid: props.diagramId,
|
|
|
@@ -190,14 +189,14 @@ const Index = (props) => {
|
|
|
});
|
|
|
|
|
|
if (response.data?.download_url) {
|
|
|
- let res = await API.download(response.data?.download_url);
|
|
|
- const blob = new Blob([res], {
|
|
|
+ let res = await API.download("api/" + response.data?.download_url);
|
|
|
+ const blob = new Blob([res.data], {
|
|
|
type: "application/vnd.openxmlformats-officedocument.spreadsheetml.sheet",
|
|
|
});
|
|
|
const objectURL = URL.createObjectURL(blob);
|
|
|
const anchor = document.createElement("a");
|
|
|
anchor.href = objectURL;
|
|
|
- anchor.download = true;
|
|
|
+ anchor.download = "告警记录";
|
|
|
anchor.click();
|
|
|
URL.revokeObjectURL(objectURL);
|
|
|
}
|
|
|
@@ -388,7 +387,9 @@ const Index = (props) => {
|
|
|
width: 120,
|
|
|
marginLeft: 16,
|
|
|
}}
|
|
|
+ allowClear
|
|
|
options={alarmStatusOptions}
|
|
|
+ placeholder="告警状态"
|
|
|
></Select>
|
|
|
<Select
|
|
|
value={opStatus}
|
|
|
@@ -401,6 +402,8 @@ const Index = (props) => {
|
|
|
width: 120,
|
|
|
marginLeft: 16,
|
|
|
}}
|
|
|
+ placeholder="确认状态"
|
|
|
+ allowClear
|
|
|
options={periodOptions}
|
|
|
></Select>
|
|
|
<RangePicker
|
|
|
@@ -444,6 +447,7 @@ const Index = (props) => {
|
|
|
showTotal={showTotal}
|
|
|
showSizeChanger={false}
|
|
|
pageSize={15}
|
|
|
+ current={page}
|
|
|
/>
|
|
|
</div>
|
|
|
<AlarmConfirm
|