This commit is contained in:
lb
2023-12-18 09:51:28 +08:00
parent 98ad9f590c
commit 31e065fa5a
4 changed files with 20 additions and 11 deletions

View File

@@ -43,17 +43,17 @@ const SmallBox = (props) => {
};
function WindFrequence(props) {
const [dataSource, setDataSource] = useState("1线");
const [dataSource, setDataSource] = useState("Y61");
const [currentLineTemp, setCurrentLineTemp] = useState([]);
const currentTempList = useSelector((state) => state.annealTemperature?.data);
const lines = ["Y61", "Y62", "Y63", "Y64", "Y65"];
function handleSourceChange(line) {
setDataSource(line);
}
useEffect(() => {
setCurrentLineTemp(
(currentTempList && currentTempList[dataSource.replace("线", "#")]) || []
(currentTempList && currentTempList[1+lines.indexOf(dataSource)+'#']) || []
);
}, [dataSource]);
@@ -61,7 +61,8 @@ function WindFrequence(props) {
<GraphBase
icon="pause"
title="当前温度"
dateOptions={["1线", "2线", "3线", "4线", "5线"]}
dateOptions={["Y61", "Y62", "Y63", "Y64", "Y65"]}
defaultSelect={dataSource}
onDateChange={handleSourceChange}
size={["middle", "long"]}
>