From 83f4203a3fb1ab6dc25beab8b4746b1052dcce34 Mon Sep 17 00:00:00 2001
From: luxiaotao1123 <t1341870251@163.com>
Date: 星期四, 26 九月 2024 10:48:15 +0800
Subject: [PATCH] #

---
 zy-acs-flow/src/i18n/en.js                   |   10 ++++++++++
 zy-acs-flow/src/i18n/zh.js                   |   10 ++++++++++
 zy-acs-flow/src/page/segment/SegmentList.jsx |   22 +++++++++++++---------
 3 files changed, 33 insertions(+), 9 deletions(-)

diff --git a/zy-acs-flow/src/i18n/en.js b/zy-acs-flow/src/i18n/en.js
index a065ad7..7d869f0 100644
--- a/zy-acs-flow/src/i18n/en.js
+++ b/zy-acs-flow/src/i18n/en.js
@@ -562,6 +562,16 @@
                 }
             }
         },
+        segment: {
+            enums: {
+                state: {
+                    init: 'INIT',
+                    waiting: 'WAITING',
+                    running: 'RUNNING',
+                    finish: 'FINISH',
+                },
+            },
+        },
     }
 };
 
diff --git a/zy-acs-flow/src/i18n/zh.js b/zy-acs-flow/src/i18n/zh.js
index 6cb72ac..da57561 100644
--- a/zy-acs-flow/src/i18n/zh.js
+++ b/zy-acs-flow/src/i18n/zh.js
@@ -561,6 +561,16 @@
                 }
             }
         },
+        segment: {
+            enums: {
+                state: {
+                    init: '鍒濆鍖�',
+                    waiting: '绛夊緟涓�',
+                    running: '姝e湪杩愯',
+                    finish: '宸插畬鎴�',
+                },
+            },
+        },
     }
 };
 
diff --git a/zy-acs-flow/src/page/segment/SegmentList.jsx b/zy-acs-flow/src/page/segment/SegmentList.jsx
index c45df61..cbda7cf 100644
--- a/zy-acs-flow/src/page/segment/SegmentList.jsx
+++ b/zy-acs-flow/src/page/segment/SegmentList.jsx
@@ -33,7 +33,7 @@
     FunctionField,
     Count,
 } from 'react-admin';
-import { Box, Typography, Card, Stack, useMediaQuery, Tabs, Tab, Divider } from '@mui/material';
+import { Box, Typography, Stack, useMediaQuery, Tabs, Tab, Divider } from '@mui/material';
 import { styled } from '@mui/material/styles';
 import SegmentPanel from "./SegmentPanel";
 import EmptyData from "../components/EmptyData";
@@ -131,13 +131,14 @@
 }
 
 const tabs = [
-    { id: 'INIT', name: 'INIT' },
-    { id: 'WAITING', name: 'WAITING' },
-    { id: 'RUNNING', name: 'RUNNING' },
-    { id: 'FINISH', name: 'FINISH' },
+    { id: 'INIT', name: 'page.segment.enums.state.init' },
+    { id: 'WAITING', name: 'page.segment.enums.state.waiting' },
+    { id: 'RUNNING', name: 'page.segment.enums.state.running' },
+    { id: 'FINISH', name: 'page.segment.enums.state.finish' },
 ];
 
 const TabbedDatagrid = () => {
+    const translate = useTranslate();
     const { filterValues, setFilters, displayedFilters } = useListContext();
     const isXSmall = useMediaQuery(theme =>
         theme.breakpoints.down('sm')
@@ -165,15 +166,18 @@
                         key={item.id}
                         value={item.id}
                         label={
-                            <span>
-                                {item.name}
+                            <span style={{ fontWeight: 'bold' }}>
+                                <span >
+                                    {translate(item.name)}
+                                </span>
+                                &nbsp;
                                 (
                                 <Count
                                     filter={{
                                         ...filterValues,
-                                        state: item.name,
+                                        state: item.id,
                                     }}
-                                    sx={{ lineHeight: 'inherit', fontWeight: 'bold' }}
+                                    sx={{ lineHeight: 'inherit' }}
                                 />
                                 )
                             </span>

--
Gitblit v1.9.1