From e77a7958af2d32b20d82e3d03a9cfa0795a3da84 Mon Sep 17 00:00:00 2001 From: luxiaotao1123 <t1341870251@163.com> Date: 星期四, 19 九月 2024 10:36:35 +0800 Subject: [PATCH] # --- zy-acs-flow/src/page/components/ImportModal.jsx | 10 +++++----- 1 files changed, 5 insertions(+), 5 deletions(-) diff --git a/zy-acs-flow/src/page/components/ImportModal.jsx b/zy-acs-flow/src/page/components/ImportModal.jsx index 309ee86..97f7285 100644 --- a/zy-acs-flow/src/page/components/ImportModal.jsx +++ b/zy-acs-flow/src/page/components/ImportModal.jsx @@ -18,14 +18,12 @@ import DialogCloseButton from './DialogCloseButton'; import { usePapaParse } from './usePapaParse'; -export function ImportModal({ open, onClose, sampleCsv, useCodeImport }) { +const ImportModal = ({ open, onClose, importTemp, useCodeImport, onceBatch = 10 }) => { const refresh = useRefresh(); - - const SAMPLE_URL = `data:text/csv;name=crm_contacts_sample.csv;charset=utf-8,${encodeURIComponent(sampleCsv.default)}`; const { processBatch } = useCodeImport(); const { importer, parseCsv, reset } = usePapaParse({ - batchSize: 10, + batchSize: onceBatch, processBatch, }); @@ -149,7 +147,7 @@ component={Link} label="Download CSV sample" color="info" - to={SAMPLE_URL} + to={importTemp} download={'crm_contacts_sample.csv'} /> } @@ -210,3 +208,5 @@ return `${minutes}m ${seconds}s`; } + +export default ImportModal; \ No newline at end of file -- Gitblit v1.9.1