From 91f39a0e6c8c885b56e80619d7b1bfaa0619cd5f Mon Sep 17 00:00:00 2001 From: Claire <1119518763@qq.com> Date: Wed, 2 Mar 2022 17:49:06 +0800 Subject: [PATCH] =?UTF-8?q?BI-95364=20fix:form=E6=8F=90=E4=BE=9Bchange?= =?UTF-8?q?=E4=BA=8B=E4=BB=B6?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/component/form/form.js | 10 ++-------- typescript/component/form/form.ts | 3 +-- 2 files changed, 3 insertions(+), 10 deletions(-) diff --git a/src/component/form/form.js b/src/component/form/form.js index 748b6a65f..27734455f 100644 --- a/src/component/form/form.js +++ b/src/component/form/form.js @@ -51,12 +51,7 @@ listeners: [{ eventName: "EVENT_CHANGE", action: function () { - this.validate(); - if (self.isAllValid()) { - self.fireEvent("EVENT_VALID"); - } else { - self.fireEvent("EVENT_ERROR"); - } + self.fireEvent(BI.Form.EVENT_CHANGE, this.validate()); } }] }; @@ -94,6 +89,5 @@ } }); -BI.Form.EVENT_VALID = "EVENT_VALID"; -BI.Form.EVENT_ERROR = "EVENT_ERROR"; +BI.Form.EVENT_CHANGE = "EVENT_CHANGE"; BI.shortcut("bi.custom_form", BI.Form); diff --git a/typescript/component/form/form.ts b/typescript/component/form/form.ts index c802c6362..ab5844120 100644 --- a/typescript/component/form/form.ts +++ b/typescript/component/form/form.ts @@ -2,8 +2,7 @@ import { Widget } from "../../core/widget"; export declare class Form extends Widget { static xtype: string; - static EVENT_VALID: string; - static EVENT_ERROR: string; + static EVENT_CHANGE: string; isAllValid(): boolean;