From 6c4bab7b60ba0f1cfd7fc31056d4c41efc8c0301 Mon Sep 17 00:00:00 2001 From: 2betop <2betop.cn@gmail.com> Date: Mon, 20 Jun 2022 11:16:23 +0800 Subject: [PATCH] =?UTF-8?q?chore:=20=E5=AF=BC=E5=87=BA=20excel=20=E5=A4=9A?= =?UTF-8?q?=E5=81=9A=E4=B8=80=E4=BA=9B=E7=B1=BB=E5=9E=8B=E5=88=A4=E6=96=AD?= =?UTF-8?q?=E5=85=BC=E5=AE=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- packages/amis/src/renderers/Table/exportExcel.ts | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/packages/amis/src/renderers/Table/exportExcel.ts b/packages/amis/src/renderers/Table/exportExcel.ts index 4a335ce7e..ad418c6a1 100644 --- a/packages/amis/src/renderers/Table/exportExcel.ts +++ b/packages/amis/src/renderers/Table/exportExcel.ts @@ -152,7 +152,7 @@ export async function exportExcel( const type = (column as BaseSchema).type || 'plain'; // TODO: 这里很多组件都是拷贝对应渲染的逻辑实现的,导致 - if (type === 'image' && value) { + if ((type === 'image' || (type as any) === 'static-image') && value) { try { const imageData = await toDataURL(value); const imageDimensions = await getImageDimensions(imageData); @@ -200,7 +200,7 @@ export async function exportExcel( } catch (e) { console.warn(e.stack); } - } else if (type == 'link') { + } else if (type == 'link' || (type as any) === 'static-link') { const href = column.pristine.href; const linkURL = (typeof href === 'string' && href @@ -218,7 +218,7 @@ export async function exportExcel( text: text || absoluteURL, hyperlink: absoluteURL }; - } else if (type === 'mapping') { + } else if (type === 'mapping' || (type as any) === 'static-mapping') { // 拷贝自 Mapping.tsx let map = column.pristine.map; const source = column.pristine.source; @@ -256,7 +256,7 @@ export async function exportExcel( } else { sheetRow.getCell(columIndex).value = removeHTMLTag(value); } - } else if (type === 'date') { + } else if (type === 'date' || (type as any) === 'static-date') { let viewValue; const { fromNow,