From eda0ec8e97499e151cc254aaedfe4894573865c8 Mon Sep 17 00:00:00 2001
From: zhang <zc857179121@qq.com>
Date: 星期二, 17 六月 2025 08:32:21 +0800
Subject: [PATCH] 1
---
zy-acs-flow/src/page/mission/MissionCard.jsx | 22 ++++++++++++++++++----
1 files changed, 18 insertions(+), 4 deletions(-)
diff --git a/zy-acs-flow/src/page/mission/MissionCard.jsx b/zy-acs-flow/src/page/mission/MissionCard.jsx
index 2a7bdae..99bbe5f 100644
--- a/zy-acs-flow/src/page/mission/MissionCard.jsx
+++ b/zy-acs-flow/src/page/mission/MissionCard.jsx
@@ -1,3 +1,4 @@
+import React, { useState, useEffect } from 'react';
import { Draggable } from '@hello-pangea/dnd';
import { Box, Card, Typography, Avatar, Divider, Stack, Slider, useTheme } from '@mui/material';
import { ReferenceField, useRedirect, useTranslate } from 'react-admin';
@@ -20,7 +21,7 @@
);
};
-export const MissionCardContent = ({ provided, snapshot, mission, }) => {
+export const MissionCardContent = ({ provided, snapshot, mission }) => {
const theme = useTheme();
const translate = useTranslate();
const redirect = useRedirect();
@@ -28,6 +29,16 @@
redirect(`/mission/${mission.id}/show`, undefined, undefined, undefined, {
_scrollToTop: false,
});
+ };
+
+ const [sliderValue, setSliderValue] = useState(mission.progress || 0);
+
+ useEffect(() => {
+ setSliderValue(mission.progress || 0);
+ }, [mission.progress]);
+
+ const handleSliderChange = (event, newValue) => {
+ setSliderValue(newValue);
};
return (
@@ -50,10 +61,11 @@
<Box display="flex" alignItems="center" mb={1.5}>
<Avatar
sx={{
- width: 30,
- height: 30,
+ width: 40,
+ height: 28,
bgcolor: theme.palette.primary.main,
}}
+ variant="rounded"
>
{mission.agv}
</Avatar>
@@ -80,7 +92,9 @@
<Stack pl={0.5} pr={0.5} direction="row" spacing={1} alignItems="center" mb={.6}>
<Slider
aria-label="Progress"
- defaultValue={mission.progress}
+ // defaultValue={mission.progress}
+ value={sliderValue}
+ onChange={handleSliderChange}
getAriaValueText={(value) => {
return `${value}%`;
}}
--
Gitblit v1.9.1