From 7944e13ede53e4b4c42ef39060538ebcb6aa4fb2 Mon Sep 17 00:00:00 2001 From: likunming Date: Mon, 22 Jan 2024 18:51:42 +0800 Subject: [PATCH] =?UTF-8?q?=E8=A1=A8=E6=A0=BC=E4=BC=98=E5=8C=96=E6=8F=90?= =?UTF-8?q?=E4=BA=A4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../src/platform/components/utils/componentComm.ts | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/io.sc.platform.core.frontend/src/platform/components/utils/componentComm.ts b/io.sc.platform.core.frontend/src/platform/components/utils/componentComm.ts index 7b4d3519..52855386 100644 --- a/io.sc.platform.core.frontend/src/platform/components/utils/componentComm.ts +++ b/io.sc.platform.core.frontend/src/platform/components/utils/componentComm.ts @@ -250,14 +250,18 @@ export function extractTableProps(props: any) { function columnStyle(item: any) { let style = ''; - if (Object.hasOwnProperty.call(item, 'style')) { + if (item.hasOwnProperty('style')) { style = item.style; } - if (Object.hasOwnProperty.call(item, 'width')) { - item.style = `min-width: ` + item.width + `px; width: ` + item.width + `px;max-width: ` + item.width + `px;` + style; + if (item.hasOwnProperty('width')) { + if (typeof item.width === 'number') { + item.style = `min-width: ` + item.width + `px; width: ` + item.width + `px;max-width: ` + item.width + `px;` + style; + } else { + item.style = `min-width: ` + item.width + `; width: ` + item.width + `;max-width: ` + item.width + `;` + style; + } delete item.width; - if (Object.hasOwnProperty.call(item, 'classes')) { + if (item.hasOwnProperty('classes')) { item.classes = item.classes + ' truncate'; } else { item.classes = 'truncate';