From 50afd615ec83e0e141991ef0658b19087cd8fd86 Mon Sep 17 00:00:00 2001
From: zhang <zc857179121@qq.com>
Date: 星期五, 13 六月 2025 16:08:37 +0800
Subject: [PATCH] 1
---
zy-acs-flow/src/page/segment/SegmentList.jsx | 56 +++++++++++++++++++++++++++++++-------------------------
1 files changed, 31 insertions(+), 25 deletions(-)
diff --git a/zy-acs-flow/src/page/segment/SegmentList.jsx b/zy-acs-flow/src/page/segment/SegmentList.jsx
index 1bce14c..43b51fd 100644
--- a/zy-acs-flow/src/page/segment/SegmentList.jsx
+++ b/zy-acs-flow/src/page/segment/SegmentList.jsx
@@ -33,6 +33,7 @@
FunctionField,
Count,
useNotify,
+ useRefresh,
} from 'react-admin';
import { Box, Typography, Stack, useMediaQuery, Tabs, Tab, Divider } from '@mui/material';
import { styled } from '@mui/material/styles';
@@ -57,7 +58,7 @@
'& .column-name': {
},
'& .opt': {
- width: 120
+ width: 130
},
}));
@@ -144,7 +145,8 @@
const TabbedDatagrid = () => {
const translate = useTranslate();
- const notify = useNotify();
+ const notify = useNotify();
+ const refresh = useRefresh();
const { filterValues, setFilters, displayedFilters } = useListContext();
const isXSmall = useMediaQuery(theme =>
theme.breakpoints.down('sm')
@@ -258,29 +260,33 @@
<DateField source="createTime" label="common.field.createTime" showTime />
<BooleanField source="statusBool" label="common.field.status" sortable={false} />
<TextField source="memo" label="common.field.memo" sortable={false} />
- {filterValues.state === 'RUNNING' && (
- <FunctionField label="common.field.opt" cellClassName="opt" render={record => (
- <>
- <ConfirmButton
- label="common.action.deprecate"
- size="small"
- color="error"
- startIcon={<ClearIcon />}
- sx={{
- padding: '1px',
- fontSize: '.75rem',
- '& .MuiButton-startIcon': {
- marginRight: '2px'
- },
- }}
- data={record.id}
- onConfirm={() => {
- handleDeprecate(record.id);
- }}
- />
- </>
- )} />
- )}
+ {(
+ filterValues.state === 'INIT'
+ || filterValues.state === 'WAITING'
+ || filterValues.state === 'RUNNING'
+ ) && (
+ <FunctionField label="common.field.opt" cellClassName="opt" render={record => (
+ <>
+ <ConfirmButton
+ label="common.action.deprecate"
+ size="small"
+ color="inherit"
+ startIcon={<ClearIcon />}
+ sx={{
+ padding: '1px',
+ fontSize: '.75rem',
+ '& .MuiButton-startIcon': {
+ marginRight: '2px'
+ },
+ }}
+ data={record.id}
+ onConfirm={() => {
+ handleDeprecate(record.id);
+ }}
+ />
+ </>
+ )} />
+ )}
</StyledDatagrid>
</>
)}
--
Gitblit v1.9.1