#
luxiaotao1123
2024-11-13 a62ffbff96b2a851c605525ccf7eee3346b31a89
#
2个文件已修改
19 ■■■■ 已修改文件
zy-acs-flow/src/config/setting.js 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
zy-acs-flow/src/page/mission/MissionCard.jsx 17 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
zy-acs-flow/src/config/setting.js
@@ -39,4 +39,4 @@
export const LOGIN_BACKGROUND = 'image';  // image | media
export const CUSTOM_PAGES_DATA_INTERVAL = 100000;
export const CUSTOM_PAGES_DATA_INTERVAL = 1000;
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 (
@@ -80,7 +91,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}%`;
                                }}