|
@@ -59,6 +59,19 @@ const levelMap = {
|
|
|
3: TranslateText(["高", "High"]),
|
|
3: TranslateText(["高", "High"]),
|
|
|
};
|
|
};
|
|
|
|
|
|
|
|
|
|
+const rangePresets = [
|
|
|
|
|
+ { label: "最近30分钟", value: [dayjs().add(-30, "minute"), dayjs()] },
|
|
|
|
|
+ { label: "最近60分钟", value: [dayjs().add(-60, "minute"), dayjs()] },
|
|
|
|
|
+ { label: "最近2小时", value: [dayjs().add(-2, "hour"), dayjs()] },
|
|
|
|
|
+ { label: "最近4小时", value: [dayjs().add(-4, "hour"), dayjs()] },
|
|
|
|
|
+ { label: "最近8小时", value: [dayjs().add(-8, "hour"), dayjs()] },
|
|
|
|
|
+ { label: "最近12小时", value: [dayjs().add(-12, "hour"), dayjs()] },
|
|
|
|
|
+ { label: "最近24小时", value: [dayjs().add(-24, "hour"), dayjs()] },
|
|
|
|
|
+ { label: "最近48小时", value: [dayjs().add(-48, "hour"), dayjs()] },
|
|
|
|
|
+ { label: "最近72小时", value: [dayjs().add(-72, "hour"), dayjs()] },
|
|
|
|
|
+ { label: "最近7天", value: [dayjs().add(-7, "d"), dayjs()] },
|
|
|
|
|
+];
|
|
|
|
|
+
|
|
|
const getDur = (text) => {
|
|
const getDur = (text) => {
|
|
|
if (text < 60) {
|
|
if (text < 60) {
|
|
|
return `${text}${timeTranslateMap["s"]}`;
|
|
return `${text}${timeTranslateMap["s"]}`;
|
|
@@ -107,10 +120,10 @@ const initialOption = {
|
|
|
},
|
|
},
|
|
|
},
|
|
},
|
|
|
grid: {
|
|
grid: {
|
|
|
- top: 32,
|
|
|
|
|
- left: 64,
|
|
|
|
|
- right: 64,
|
|
|
|
|
|
|
+ top: 30,
|
|
|
bottom: 0,
|
|
bottom: 0,
|
|
|
|
|
+ left: 0,
|
|
|
|
|
+ right: 0,
|
|
|
containLabel: true,
|
|
containLabel: true,
|
|
|
},
|
|
},
|
|
|
xAxis: {
|
|
xAxis: {
|
|
@@ -243,11 +256,6 @@ const Index = (props) => {
|
|
|
width: 1,
|
|
width: 1,
|
|
|
type: "dashed",
|
|
type: "dashed",
|
|
|
},
|
|
},
|
|
|
- endLabel: {
|
|
|
|
|
- show: true,
|
|
|
|
|
- formatter: "{a}",
|
|
|
|
|
- color: "inherit",
|
|
|
|
|
- },
|
|
|
|
|
});
|
|
});
|
|
|
}
|
|
}
|
|
|
if (res?.data?.l) {
|
|
if (res?.data?.l) {
|
|
@@ -260,11 +268,6 @@ const Index = (props) => {
|
|
|
width: 1,
|
|
width: 1,
|
|
|
type: "dashed",
|
|
type: "dashed",
|
|
|
},
|
|
},
|
|
|
- endLabel: {
|
|
|
|
|
- show: true,
|
|
|
|
|
- formatter: "{a}",
|
|
|
|
|
- color: "inherit",
|
|
|
|
|
- },
|
|
|
|
|
});
|
|
});
|
|
|
}
|
|
}
|
|
|
if (res?.data?.ll) {
|
|
if (res?.data?.ll) {
|
|
@@ -277,11 +280,6 @@ const Index = (props) => {
|
|
|
width: 1,
|
|
width: 1,
|
|
|
type: "dashed",
|
|
type: "dashed",
|
|
|
},
|
|
},
|
|
|
- endLabel: {
|
|
|
|
|
- show: true,
|
|
|
|
|
- formatter: "{a}",
|
|
|
|
|
- color: "inherit",
|
|
|
|
|
- },
|
|
|
|
|
});
|
|
});
|
|
|
}
|
|
}
|
|
|
if (res?.data?.threshold) {
|
|
if (res?.data?.threshold) {
|
|
@@ -294,11 +292,6 @@ const Index = (props) => {
|
|
|
width: 1,
|
|
width: 1,
|
|
|
type: "dashed",
|
|
type: "dashed",
|
|
|
},
|
|
},
|
|
|
- endLabel: {
|
|
|
|
|
- show: true,
|
|
|
|
|
- formatter: "{a}",
|
|
|
|
|
- color: "inherit",
|
|
|
|
|
- },
|
|
|
|
|
});
|
|
});
|
|
|
}
|
|
}
|
|
|
setChartData(newData);
|
|
setChartData(newData);
|
|
@@ -310,7 +303,7 @@ const Index = (props) => {
|
|
|
<>
|
|
<>
|
|
|
<div className={styles.desc}>
|
|
<div className={styles.desc}>
|
|
|
<Descriptions column={4} style={{ margin: 20 }}>
|
|
<Descriptions column={4} style={{ margin: 20 }}>
|
|
|
- <Descriptions.Item span={3} label="告警名称">
|
|
|
|
|
|
|
+ <Descriptions.Item span={2} label="告警名称">
|
|
|
{props.data?.data?.name}
|
|
{props.data?.data?.name}
|
|
|
</Descriptions.Item>
|
|
</Descriptions.Item>
|
|
|
{props.data?.data?.point_id && (
|
|
{props.data?.data?.point_id && (
|
|
@@ -357,12 +350,13 @@ const Index = (props) => {
|
|
|
value={range}
|
|
value={range}
|
|
|
onChange={setRange}
|
|
onChange={setRange}
|
|
|
style={{ width: 360, marginTop: 20 }}
|
|
style={{ width: 360, marginTop: 20 }}
|
|
|
|
|
+ presets={rangePresets}
|
|
|
/>
|
|
/>
|
|
|
</div>
|
|
</div>
|
|
|
|
|
|
|
|
{chartData && (
|
|
{chartData && (
|
|
|
<ReactECharts
|
|
<ReactECharts
|
|
|
- style={{ height: 424 }}
|
|
|
|
|
|
|
+ style={{ height: "calc(100% - 250px)" }}
|
|
|
option={chartData}
|
|
option={chartData}
|
|
|
notMerge={true}
|
|
notMerge={true}
|
|
|
/>
|
|
/>
|