From 443e32fec6aec9dfa2ca802246950dc3c36e6251 Mon Sep 17 00:00:00 2001
From: zhang <zc857179121@qq.com>
Date: 星期五, 25 七月 2025 15:35:12 +0800
Subject: [PATCH] 保存一个版本
---
zy-acs-flow/src/page/components/ImportModal.jsx | 30 +++++++++++++++---------------
1 files changed, 15 insertions(+), 15 deletions(-)
diff --git a/zy-acs-flow/src/page/components/ImportModal.jsx b/zy-acs-flow/src/page/components/ImportModal.jsx
index 97f7285..76e7713 100644
--- a/zy-acs-flow/src/page/components/ImportModal.jsx
+++ b/zy-acs-flow/src/page/components/ImportModal.jsx
@@ -13,6 +13,7 @@
Form,
Toolbar,
useRefresh,
+ useTranslate
} from 'react-admin';
import { Link } from 'react-router-dom';
import DialogCloseButton from './DialogCloseButton';
@@ -20,6 +21,7 @@
const ImportModal = ({ open, onClose, importTemp, useCodeImport, onceBatch = 10 }) => {
const refresh = useRefresh();
+ const translate = useTranslate();
const { processBatch } = useCodeImport();
const { importer, parseCsv, reset } = usePapaParse({
@@ -60,7 +62,7 @@
return (
<Dialog open={open} maxWidth="md" fullWidth>
<DialogCloseButton onClose={handleClose} />
- <DialogTitle>Import</DialogTitle>
+ <DialogTitle>{translate('common.action.import.title')}</DialogTitle>
<DialogContent>
<Form>
<Stack spacing={2}>
@@ -88,8 +90,7 @@
},
}}
>
- The import is running, please do not close
- this tab.
+ {translate('common.action.import.tips')}
</Alert>
<Typography variant="body2">
Imported{' '}
@@ -115,7 +116,7 @@
onClick={handleReset}
color="error"
>
- Stop import
+ {translate('common.action.import.stop')}
</MuiLink>
</>
)}
@@ -125,16 +126,16 @@
{importer.state === 'error' && (
<Alert severity="error">
- Failed to import this file, please make sure
- your provided a valid CSV file.
+ {translate('common.action.import.err')}
</Alert>
)}
{importer.state === 'complete' && (
<Alert severity="success">
- Contacts import complete. Imported{' '}
- {importer.importCount} contacts, with{' '}
- {importer.errorCount} errors
+ {translate('common.action.import.result', {
+ success: importer.importCount,
+ error: importer.errorCount
+ })}
</Alert>
)}
@@ -145,15 +146,14 @@
action={
<Button
component={Link}
- label="Download CSV sample"
+ label="common.action.import.download"
color="info"
to={importTemp}
- download={'crm_contacts_sample.csv'}
+ download={'import_template.csv'}
/>
}
>
- Here is a sample CSV file you can use as a
- template
+ {translate('common.action.import.msg')}
</Alert>
<FileInput
@@ -183,7 +183,7 @@
{importer.state === 'idle' ? (
<>
<Button
- label="Import"
+ label="common.action.import.title"
variant="contained"
onClick={startImport}
disabled={!file}
@@ -191,7 +191,7 @@
</>
) : (
<Button
- label="Close"
+ label="ra.action.close"
onClick={handleClose}
disabled={importer.state === 'running'}
/>
--
Gitblit v1.9.1