From eb6e1025280546f362937c40261618def0edb6c5 Mon Sep 17 00:00:00 2001 From: minlovehua <321512939@qq.com> Date: Wed, 18 Dec 2024 15:35:11 +0800 Subject: [PATCH] fix(grid): the default value of a numeric field should not display 0 --- packages/grid/src/core/utils/field.ts | 2 +- src/app/utils/utils.ts | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/packages/grid/src/core/utils/field.ts b/packages/grid/src/core/utils/field.ts index 6d74c752..b64fd756 100644 --- a/packages/grid/src/core/utils/field.ts +++ b/packages/grid/src/core/utils/field.ts @@ -24,7 +24,7 @@ export function getDefaultFieldValue(field: AITableField) { return []; } if (isNumberFiled(field)) { - return 0; + return null; } return ''; } diff --git a/src/app/utils/utils.ts b/src/app/utils/utils.ts index 27da9dc1..5b5fcc73 100644 --- a/src/app/utils/utils.ts +++ b/src/app/utils/utils.ts @@ -44,7 +44,7 @@ export function getDefaultValue() { 'column-20': ['66b31d0c8097a908f74bcd8a'], 'column-21': ['66b31d0c8097a908f74bcd8a'], 'column-22': ['66b31d0c8097a908f74bcd8a'], - 'column-3': 1, + 'column-3': 0, 'column-4': { timestamp: 1734636127 }, 'column-5': ['member_01'], 'column-6': 10, @@ -443,7 +443,7 @@ export function getCanvasDefaultValue() { 'column-111': ['piece_1'], 'column-112': ['tag_1'], 'column-20': ['66b31d0c8097a908f74bcd8a'], - 'column-3': 1, + 'column-3': 0, 'column-4': { timestamp: 1734636127 }, 'column-5': ['member_01'], 'column-6': 10,