From a6f0f257f060c2e0be139a5e17a8f68cc9bfde4a Mon Sep 17 00:00:00 2001 From: crupest Date: Thu, 1 Jul 2021 20:02:32 +0800 Subject: ... --- .../src/views/common/dailog/OperationDialog.tsx | 44 +++++++++++++++++++--- 1 file changed, 39 insertions(+), 5 deletions(-) (limited to 'FrontEnd/src/views/common') diff --git a/FrontEnd/src/views/common/dailog/OperationDialog.tsx b/FrontEnd/src/views/common/dailog/OperationDialog.tsx index 083d60da..6bc846dd 100644 --- a/FrontEnd/src/views/common/dailog/OperationDialog.tsx +++ b/FrontEnd/src/views/common/dailog/OperationDialog.tsx @@ -51,6 +51,7 @@ export interface OperationDialogBoolInput { type: "bool"; label: I18nText; initValue?: boolean; + helperText?: string; } export interface OperationDialogSelectInputOption { @@ -77,6 +78,7 @@ export interface OperationDialogDateTimeInput { type: "datetime"; label?: I18nText; initValue?: string; + helperText?: string; } export type OperationDialogInput = @@ -330,7 +332,13 @@ const OperationDialog = < ); } else if (item.type === "bool") { return ( -
+
- + + {error != null && ( +
+ {error} +
+ )} + {item.helperText && ( +
+ {t(item.helperText)} +
+ )}
); } else if (item.type === "select") { @@ -374,7 +394,13 @@ const OperationDialog = < ); } else if (item.type === "color") { return ( -
+
{item.canBeNull ? ( +
{item.label && ( - + )}