From 645cd3b78d95b1c7570b122c35ebd69184ca826b Mon Sep 17 00:00:00 2001 From: wutong25 Date: Thu, 9 Nov 2023 21:26:40 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20=E6=95=B0=E5=AD=97=E8=BE=93=E5=85=A5?= =?UTF-8?q?=E6=A1=86=E9=85=8D=E7=BD=AE=E9=9D=A2=E6=9D=BF=E5=9B=BA=E5=AE=9A?= =?UTF-8?q?=E4=B8=BA=E5=8D=95=E4=BE=A7=E6=8C=89=E9=92=AE=E6=A8=A1=E5=BC=8F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../src/plugin/Form/InputNumber.tsx | 24 ++++++++++++------- 1 file changed, 15 insertions(+), 9 deletions(-) diff --git a/packages/amis-editor/src/plugin/Form/InputNumber.tsx b/packages/amis-editor/src/plugin/Form/InputNumber.tsx index a3b7cb8b4..a8cc38cad 100644 --- a/packages/amis-editor/src/plugin/Form/InputNumber.tsx +++ b/packages/amis-editor/src/plugin/Form/InputNumber.tsx @@ -19,6 +19,7 @@ import {defaultValue, getSchemaTpl, tipedLabel} from 'amis-editor-core'; import {ValidatorTag} from '../../validator'; import {getEventControlConfig} from '../../renderer/event-control/helper'; import {inputStateTpl} from '../../renderer/style-control/helper'; +import {Schema} from 'amis-core'; export class NumberControlPlugin extends BasePlugin { static id = 'NumberControlPlugin'; @@ -177,16 +178,20 @@ export class NumberControlPlugin extends BasePlugin { getSchemaTpl('kilobitSeparator'), getSchemaTpl('valueFormula', { - rendererSchema: context?.schema, + rendererSchema: (schema: Schema) => ({ + ...schema, + displayMode: 'base' + }), valueType: 'number' // 期望数值类型 }), getSchemaTpl('valueFormula', { name: 'min', - rendererSchema: { - ...context?.schema, - value: context?.schema.min - }, + rendererSchema: (schema: Schema) => ({ + ...schema, + value: context?.schema.min, + displayMode: 'base' + }), needDeleteProps: ['min'], // 避免自我限制 label: '最小值', valueType: 'number' @@ -194,10 +199,11 @@ export class NumberControlPlugin extends BasePlugin { getSchemaTpl('valueFormula', { name: 'max', - rendererSchema: { - ...context?.schema, - value: context?.schema.max - }, + rendererSchema: (schema: Schema) => ({ + ...schema, + value: context?.schema.max, + displayMode: 'base' + }), needDeleteProps: ['max'], // 避免自我限制 label: '最大值', valueType: 'number'