|
|
@@ -59,17 +59,20 @@ export class Customers implements OnInit {
|
|
|
this.showCustomerPanel = true;
|
|
|
}
|
|
|
|
|
|
- async closeCustomerPanel(refresh: boolean = false) {
|
|
|
+ async closeCustomerPanel(refresh?: boolean | Event) {
|
|
|
this.showCustomerPanel = false;
|
|
|
this.selectedCustomer = null;
|
|
|
- if (refresh) await this.loadCustomers();
|
|
|
+ // 如果参数是 true (boolean),则刷新;如果是 Event,则忽略
|
|
|
+ if (refresh === true) {
|
|
|
+ await this.loadCustomers();
|
|
|
+ }
|
|
|
}
|
|
|
|
|
|
keyword = signal('');
|
|
|
status = signal<'all' | 'active' | 'inactive'>('all');
|
|
|
level = signal<'all' | 'normal' | 'vip' | 'svip'>('all');
|
|
|
|
|
|
- get filtered() {
|
|
|
+ get filtered(): FmodeObject[] {
|
|
|
const kw = this.keyword().trim().toLowerCase();
|
|
|
return this.customers().filter(c => {
|
|
|
if (!kw) return true;
|