From be777b4600c3cf130ab71bff551be067820d4647 Mon Sep 17 00:00:00 2001 From: luxiaotao1123 <t1341870251@163.com> Date: 星期三, 18 九月 2024 09:38:48 +0800 Subject: [PATCH] # --- zy-acs-flow/src/page/components/EmptyData.jsx | 9 +++++---- zy-acs-flow/src/i18n/en.js | 7 ++++++- zy-acs-flow/src/i18n/zh.js | 7 ++++++- 3 files changed, 17 insertions(+), 6 deletions(-) diff --git a/zy-acs-flow/src/i18n/en.js b/zy-acs-flow/src/i18n/en.js index 55ef507..f27bd21 100644 --- a/zy-acs-flow/src/i18n/en.js +++ b/zy-acs-flow/src/i18n/en.js @@ -67,7 +67,12 @@ security: 'Security', }, create: { - title: 'Create' + title: 'Create', + empty: { + title: 'Data Empty', + desc: 'Please Create Data First', + button: 'Create Data', + }, }, update: { title: 'Update' diff --git a/zy-acs-flow/src/i18n/zh.js b/zy-acs-flow/src/i18n/zh.js index 4a6dc1d..87f2345 100644 --- a/zy-acs-flow/src/i18n/zh.js +++ b/zy-acs-flow/src/i18n/zh.js @@ -67,7 +67,12 @@ security: '瀹夊叏璁剧疆', }, create: { - title: '娣诲姞' + title: '娣诲姞', + empty: { + title: '鏆傛棤鏁版嵁', + desc: '璇峰厛娣诲姞鏁版嵁', + button: '娣诲姞鏁版嵁' + }, }, update: { title: '淇敼' diff --git a/zy-acs-flow/src/page/components/EmptyData.jsx b/zy-acs-flow/src/page/components/EmptyData.jsx index 4954868..dc846b3 100644 --- a/zy-acs-flow/src/page/components/EmptyData.jsx +++ b/zy-acs-flow/src/page/components/EmptyData.jsx @@ -3,10 +3,11 @@ import { HotTub } from '@mui/icons-material'; import { useNavigate } from 'react-router-dom'; import MyCreateButton from './MyCreateButton'; +import { useTranslate } from 'react-admin'; const NotFound = ({ children, onClick, btnMsg }) => { const navigate = useNavigate(); - + const translate = useTranslate(); return ( <Box display="flex" @@ -23,14 +24,14 @@ opacity: .5, mt: 2 }}> - Data Empty + {translate('create.empty.title')} </Typography> <Typography variant="subtitle1" gutterBottom sx={{ fontSize: '1em', opacity: .5, mt: 2 }}> - Please Create Data First + {translate('create.empty.desc')} </Typography> {children} {!children && ( @@ -43,7 +44,7 @@ mt: 2 }} > - {btnMsg || 'Create Data'} + {btnMsg || translate('create.empty.button')} </Button> )} </Box> -- Gitblit v1.9.1