From 87756f16d92580071986767409f2d65046c07f7d Mon Sep 17 00:00:00 2001 From: Kerwin Bryant Date: Tue, 25 Jun 2024 15:38:50 +0800 Subject: [PATCH] [improve] support for password type to the `app-multi-func-input` component. (#2132) Co-authored-by: tomsun28 --- .../monitor-edit/monitor-edit.component.html | 48 +++++++------------ .../monitor-edit/monitor-edit.component.ts | 2 - .../monitor-new/monitor-new.component.html | 48 +++++++------------ .../monitor-new/monitor-new.component.ts | 2 - .../multi-func-input.component.html | 13 +++-- .../multi-func-input.component.less | 8 ++++ .../multi-func-input.component.ts | 4 ++ 7 files changed, 57 insertions(+), 68 deletions(-) diff --git a/web-app/src/app/routes/monitor/monitor-edit/monitor-edit.component.html b/web-app/src/app/routes/monitor/monitor-edit/monitor-edit.component.html index 46b72127867..2c60da2a577 100644 --- a/web-app/src/app/routes/monitor/monitor-edit/monitor-edit.component.html +++ b/web-app/src/app/routes/monitor/monitor-edit/monitor-edit.component.html @@ -89,21 +89,15 @@ >{{ paramDefine.name }} - - - - - - + {{ paramDefine.name }} - - - - - - + { this.isSpinning = true; - this.passwordVisible = false; let id = paramMap.get('monitorId'); this.monitor.id = Number(id); // 查询监控信息 diff --git a/web-app/src/app/routes/monitor/monitor-new/monitor-new.component.html b/web-app/src/app/routes/monitor/monitor-new/monitor-new.component.html index 6c085d8b87c..1f9b8ae8d64 100644 --- a/web-app/src/app/routes/monitor/monitor-new/monitor-new.component.html +++ b/web-app/src/app/routes/monitor/monitor-new/monitor-new.component.html @@ -98,21 +98,15 @@ >{{ paramDefine.name }} - - - - - - + {{ paramDefine.name }} - - - - - - + @if (allowClear && inputValue) { - + + } @if (type === 'password') { + } diff --git a/web-app/src/app/shared/components/multi-func-input/multi-func-input.component.less b/web-app/src/app/shared/components/multi-func-input/multi-func-input.component.less index e69de29bb2d..b6c4565310e 100755 --- a/web-app/src/app/shared/components/multi-func-input/multi-func-input.component.less +++ b/web-app/src/app/shared/components/multi-func-input/multi-func-input.component.less @@ -0,0 +1,8 @@ +:host { + ::ng-deep { + .ant-input-suffix { + display: flex; + gap: 4px; + } + } +} diff --git a/web-app/src/app/shared/components/multi-func-input/multi-func-input.component.ts b/web-app/src/app/shared/components/multi-func-input/multi-func-input.component.ts index eef08a19c98..e7f5bb41d45 100755 --- a/web-app/src/app/shared/components/multi-func-input/multi-func-input.component.ts +++ b/web-app/src/app/shared/components/multi-func-input/multi-func-input.component.ts @@ -28,7 +28,10 @@ import { NzSizeLDSType } from 'ng-zorro-antd/core/types'; export class MultiFuncInputComponent implements OnInit { constructor() {} + @Input() id!: string; @Input() value!: any; + @Input() name!: string; + @Input() required!: boolean; @Input() groupStyle!: string; @Input() inputStyle!: string; @Input() placeholder!: string; @@ -38,6 +41,7 @@ export class MultiFuncInputComponent implements OnInit { @Output() readonly valueChange = new EventEmitter(); inputValue: any | undefined; + passwordVisible: boolean = false; ngOnInit(): void { this.inputValue = this.value;