引入日期选择中文包,更新部分样式

This commit is contained in:
JIANG
2025-11-07 11:18:50 +08:00
parent 4f0714b5f6
commit 594d40fe52
9 changed files with 30 additions and 28 deletions

View File

@@ -26,6 +26,7 @@ import {
} from "@mui/icons-material";
import { DataGrid, GridColDef } from "@mui/x-data-grid";
import { LineChart } from "@mui/x-charts";
import "dayjs/locale/zh-cn"; // 引入中文包
import dayjs, { Dayjs } from "dayjs";
import utc from "dayjs/plugin/utc";
import timezone from "dayjs/plugin/timezone";
@@ -704,7 +705,7 @@ const SCADADataPanel: React.FC<SCADADataPanelProps> = ({
<Box sx={{ flex: 1 }}>
<LineChart
dataset={filteredDataset}
height={480}
height={520}
margin={{ left: 70, right: 40, top: 30, bottom: 90 }}
xAxis={[
{
@@ -724,7 +725,7 @@ const SCADADataPanel: React.FC<SCADADataPanelProps> = ({
]}
yAxis={[
{
label: "值",
label: "压力/流量值",
labelStyle: {
fontSize: 13,
fill: "#333",
@@ -1077,7 +1078,10 @@ const SCADADataPanel: React.FC<SCADADataPanelProps> = ({
{/* Controls */}
<Box sx={{ p: 2, backgroundColor: "grey.50" }}>
<LocalizationProvider dateAdapter={AdapterDayjs}>
<LocalizationProvider
dateAdapter={AdapterDayjs}
adapterLocale="zh-cn"
>
<Stack spacing={1.5}>
<Stack direction="row" spacing={1} alignItems="center">
<DateTimePicker