From 32f708a0145ec50a78b3b4e99317a5417648045f Mon Sep 17 00:00:00 2001 From: ibuler Date: Tue, 18 Apr 2023 19:08:17 +0800 Subject: [PATCH] =?UTF-8?q?perf:=20=E4=BC=98=E5=8C=96=E9=94=99=E8=AF=AF?= =?UTF-8?q?=E6=98=BE=E7=A4=BA?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/components/ListTable/TableAction/ImportTable.vue | 4 +++- src/components/TableFormatters/EditableInputFormatter.vue | 4 ++-- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/src/components/ListTable/TableAction/ImportTable.vue b/src/components/ListTable/TableAction/ImportTable.vue index 51d25a1df..a7d8740f9 100644 --- a/src/components/ListTable/TableAction/ImportTable.vue +++ b/src/components/ListTable/TableAction/ImportTable.vue @@ -285,7 +285,9 @@ export default { const data = [] // eslint-disable-next-line prefer-const for (let [key, value] of Object.entries(errorData)) { - if (typeof value === 'object') { + if (Array.isArray(value)) { + value = JSON.stringify(value) + } else if (typeof value === 'object') { value = this.beautifyErrorData(value) } let label = this.tableColumnNameMapper[key] diff --git a/src/components/TableFormatters/EditableInputFormatter.vue b/src/components/TableFormatters/EditableInputFormatter.vue index fbb119344..e7b8cc33e 100644 --- a/src/components/TableFormatters/EditableInputFormatter.vue +++ b/src/components/TableFormatters/EditableInputFormatter.vue @@ -63,9 +63,9 @@ export default { this.inEditMode = true }, getCellValue(val) { - let v + let v = '' if (val && typeof val === 'object') { - v = val['name'] || val['display_name'] || '' + v = val['name'] || val['display_name'] || JSON.stringify(val) } return v || val },