浏览代码

更新TopoDetail组件,调整默认时间范围为告警时间前三天和后三天,并修改时间选择器格式为YYYY-MM-DD。

valentichu 9 月之前
父节点
当前提交
d03f2938b2
共有 2 个文件被更改,包括 4 次插入5 次删除
  1. 0 0
      lib/index.js
  2. 4 5
      src/pages/Alarm/components/topoDetail.jsx

文件差异内容过多而无法显示
+ 0 - 0
lib/index.js


+ 4 - 5
src/pages/Alarm/components/topoDetail.jsx

@@ -210,10 +210,10 @@ const TopoDetail = (props) => {
   const [chartData, setChartData] = useState(null);
   const [loading, setLoading] = useState(false);
 
-  // 设置默认时间范围为告警时间前后72小时
+  // 设置默认时间范围为告警时间前三天和后三天
   const [range, setRange] = useState([
-    dayjs(alarmTime).subtract(72, "hour"),
-    dayjs(alarmTime).add(72, "hour"),
+    dayjs(alarmTime).startOf('day').subtract(3, "day"),
+    dayjs(alarmTime).startOf('day').add(3, "day"),
   ]);
 
   // 获取告警详情数据
@@ -439,8 +439,7 @@ const TopoDetail = (props) => {
           <div style={{ position: "relative", flex: 1, height: 0 }}>
             <div className={styles.range}>
               <RangePicker
-                showTime
-                format="YYYY-MM-DD HH:mm"
+                format="YYYY-MM-DD"
                 value={range}
                 onChange={handleRangeChange}
                 style={{ width: 360, zIndex: 99999 }}

部分文件因为文件数量过多而无法显示