From a6f41778b7770deee34870d53c889d4d06821d7b Mon Sep 17 00:00:00 2001 From: skyouc Date: 星期三, 02 七月 2025 14:00:37 +0800 Subject: [PATCH] 终止波次功能优化 --- rsf-admin/src/page/orders/wave/WaveList.jsx | 32 ++++++++++++++++++++++++++++---- 1 files changed, 28 insertions(+), 4 deletions(-) diff --git a/rsf-admin/src/page/orders/wave/WaveList.jsx b/rsf-admin/src/page/orders/wave/WaveList.jsx index c0d43c4..7066c06 100644 --- a/rsf-admin/src/page/orders/wave/WaveList.jsx +++ b/rsf-admin/src/page/orders/wave/WaveList.jsx @@ -29,6 +29,7 @@ import PlayArrowOutlinedIcon from '@mui/icons-material/PlayArrowOutlined'; import PauseCircleOutlineIcon from '@mui/icons-material/PauseCircleOutline'; import StopCircleOutlinedIcon from '@mui/icons-material/StopCircleOutlined'; +import StopOutlinedIcon from '@mui/icons-material/StopOutlined'; import { Box, Typography, Card, Stack, LinearProgress } from '@mui/material'; import ConfirmButton from "../../components/ConfirmButton"; import PageDrawer from "../../components/PageDrawer"; @@ -109,9 +110,11 @@ return ( <Box display="flex"> <List - queryOptions={{ refetchInterval: 5000 }} sx={{ flexGrow: 1, + "& .css-k008qs": { + display: 'block' + }, transition: (theme) => theme.transitions.create(['all'], { duration: theme.transitions.duration.enteringScreen, @@ -142,7 +145,7 @@ rowClick={(id, resource, record) => false} expand={<WavePannel />} expandSingle={true} - omit={['id', 'createTime', 'createBy', 'memo', 'createBy$']} + omit={['id', 'createTime', 'createBy', 'createBy$']} > <NumberField source="id" /> <TextField source="code" label="table.field.wave.code" /> @@ -159,9 +162,9 @@ <CustomProcess source="progress" /> <TextField source="exceStatus$" label="table.field.wave.exceStatus" sortable={false} /> <WrapperField cellClassName="opt" label="common.field.opt"> - <PublicTaskButton setSelectIds={setSelectIds} setDetailDialog={setDetailDialog} /> <PauseButton /> <ContinueButton /> + <StopWaveButton /> <EditButton label="toolbar.detail" sx={{ padding: '1px', fontSize: '.75rem' }} /> </WrapperField> </StyledDatagrid> @@ -214,6 +217,27 @@ <> <LinearProgress variant="determinate" value={progress} /> </> + ) +} + + +const StopWaveButton = () => { + const record = useRecordContext() + const translate = useTranslate() + const refresh = useRefresh() + const notify = useNotify() + + const stopClick = async () => { + const { data: { code, data, msg } } = await request.post('/wave/stop/pub/' + record?.id); + if (code === 200) { + notify(msg); + } else { + notify(msg); + } + } + + return ( + record?.exceStatus != 3 ? <ConfirmButton label={"toolbar.stopPub"} startIcon={<StopOutlinedIcon />} onConfirm={stopClick} size='small' /> : <></> ) } @@ -297,7 +321,7 @@ notify(msg); } else { notify(msg); - } + } refresh() } return ( -- Gitblit v1.9.1