From fae77a64c23cb9f0f680748d6a3614d1625937bc Mon Sep 17 00:00:00 2001 From: wang_yp <357754663@qq.com> Date: Fri, 7 Feb 2025 18:06:48 +0800 Subject: [PATCH] update config file --- src/components/b_table.tsx | 2 +- src/pages/source/source.tsx | 16 +++++++++------- 2 files changed, 10 insertions(+), 8 deletions(-) diff --git a/src/components/b_table.tsx b/src/components/b_table.tsx index 61944f0..458f21e 100644 --- a/src/components/b_table.tsx +++ b/src/components/b_table.tsx @@ -57,7 +57,7 @@ const BTable = (props: any) => { > 编辑 - {actionCloumn} + {actionCloumn ? actionCloumn(record) : null} { sourceStore.getlist(); }, [sourceStore]); const gotoDetail = () => {}; - const upload = (e) => { - console.log("upload", e.target.files); + const upload = (f,e) => { let param = new FormData(); - param.append("file", e.target.files[0]); + param.append("file", f.target.files[0]); + param.append("identity", e.identity); baseHttp.upload("public/fts/upload",param) }; return ( @@ -40,8 +40,8 @@ const Source = (props: Store) => { deleteCallback={(id) => { sourceStore.deleteItem(id); }} - actionCloumn={ - <> + actionCloumn={(e)=>{ + return <> @@ -49,10 +49,12 @@ const Source = (props: Store) => { type="file" name="文件上传" accept=".xlsx" - onChange={upload} + onChange={(f)=>{ + upload(f,e) + }} /> - } + }} editCallback={(record) => { setIsModalOpen(true); formRef.current?.setFieldsValue(record);