时间轴的当前时间定位到之前最近的15分钟的时间点上;SCADA 设备列表优化样式显示
This commit is contained in:
@@ -395,8 +395,8 @@ const Timeline: React.FC<TimelineProps> = ({
|
|||||||
const currentTime = new Date();
|
const currentTime = new Date();
|
||||||
const minutes = currentTime.getHours() * 60 + currentTime.getMinutes();
|
const minutes = currentTime.getHours() * 60 + currentTime.getMinutes();
|
||||||
// 找到最近的前15分钟刻度
|
// 找到最近的前15分钟刻度
|
||||||
// const roundedMinutes = Math.floor(minutes / 15) * 15;
|
const roundedMinutes = Math.floor(minutes / 15) * 15;
|
||||||
setCurrentTime(minutes); // 组件卸载时重置时间
|
setCurrentTime(roundedMinutes); // 组件卸载时重置时间
|
||||||
|
|
||||||
return () => {
|
return () => {
|
||||||
if (intervalRef.current) {
|
if (intervalRef.current) {
|
||||||
|
|||||||
@@ -455,7 +455,7 @@ const SCADADeviceList: React.FC<SCADADeviceListProps> = ({
|
|||||||
<FixedSizeList
|
<FixedSizeList
|
||||||
height={400}
|
height={400}
|
||||||
itemCount={filteredDevices.length}
|
itemCount={filteredDevices.length}
|
||||||
itemSize={80}
|
itemSize={92}
|
||||||
width="100%"
|
width="100%"
|
||||||
>
|
>
|
||||||
{({
|
{({
|
||||||
@@ -475,7 +475,6 @@ const SCADADeviceList: React.FC<SCADADeviceListProps> = ({
|
|||||||
sx={{
|
sx={{
|
||||||
"&.Mui-selected": {
|
"&.Mui-selected": {
|
||||||
backgroundColor: "primary.50",
|
backgroundColor: "primary.50",
|
||||||
borderLeft: 3,
|
|
||||||
borderColor: "primary.main",
|
borderColor: "primary.main",
|
||||||
},
|
},
|
||||||
"&:hover": {
|
"&:hover": {
|
||||||
|
|||||||
Reference in New Issue
Block a user