ソースを参照

fix: update fmode-ng to version 0.0.227 and improve type annotations in customers and employees components

0235711 1 日 前
コミット
1d47df2e32

+ 4 - 4
package-lock.json

@@ -55,7 +55,7 @@
         "echarts": "^6.0.0",
         "esdk-obs-browserjs": "^3.25.6",
         "eventemitter3": "^5.0.1",
-        "fmode-ng": "^0.0.224",
+        "fmode-ng": "^0.0.227",
         "highlight.js": "^11.11.1",
         "ionicons": "^8.0.13",
         "jquery": "^3.7.1",
@@ -9505,9 +9505,9 @@
       "license": "ISC"
     },
     "node_modules/fmode-ng": {
-      "version": "0.0.224",
-      "resolved": "https://registry.npmjs.org/fmode-ng/-/fmode-ng-0.0.224.tgz",
-      "integrity": "sha512-/6g/XGPoiYCVwyV/LwbYnqa0k3MO++E1Y01gCV8ATK+BQccH3asbwbmIQ5sYculQEtyKd4zjZxut6CDBhjg/PA==",
+      "version": "0.0.227",
+      "resolved": "https://registry.npmjs.org/fmode-ng/-/fmode-ng-0.0.227.tgz",
+      "integrity": "sha512-6ehhqUpcYuSIRifeZ7rO1biNNd3sfvWQAvpFhse0rhj9iXxQ2hFUFZT6RnfzbWTDqNvvlY2s9IGY7zsNwLEmlg==",
       "license": "COPYRIGHT © 未来飞马 未来全栈 www.fmode.cn All RIGHTS RESERVED",
       "dependencies": {
         "tslib": "^2.3.0"

+ 6 - 3
src/app/pages/admin/customers/customers.ts

@@ -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;

+ 1 - 1
src/app/pages/admin/employees/employees.ts

@@ -144,7 +144,7 @@ export class Employees implements OnInit {
     }
   }
 
-  get filtered() {
+  get filtered(): Employee[] {
     const kw = this.keyword().trim().toLowerCase();
     const role = this.roleFilter();