guoziyun 9 月之前
父節點
當前提交
67e8172bac
共有 3 個文件被更改,包括 18 次插入2 次删除
  1. 1 1
      oms/public/app/index.html
  2. 0 0
      oms/public/app/main-E5F3HTYQ.js
  3. 17 1
      omsapp/src/app/pages/message-dashboard.component.ts

+ 1 - 1
oms/public/app/index.html

@@ -9,5 +9,5 @@
   <style>body,html{width:100%;height:100%}*,:after,:before{box-sizing:border-box}html{font-family:sans-serif;line-height:1.15;-webkit-text-size-adjust:100%;-ms-text-size-adjust:100%;-ms-overflow-style:scrollbar;-webkit-tap-highlight-color:transparent}@-ms-viewport{width:device-width}body{margin:0;color:#000000d9;font-size:14px;font-family:-apple-system,BlinkMacSystemFont,Segoe UI,Roboto,Helvetica Neue,Arial,Noto Sans,sans-serif,"Apple Color Emoji","Segoe UI Emoji",Segoe UI Symbol,"Noto Color Emoji";font-variant:tabular-nums;line-height:1.5715;background-color:#fff;font-feature-settings:"tnum"}html{--antd-wave-shadow-color:#1890ff;--scroll-bar:0}</style><link rel="stylesheet" href="styles-LXBSU6DF.css" media="print" onload="this.media='all'"><noscript><link rel="stylesheet" href="styles-LXBSU6DF.css"></noscript></head>
   <body>
     <app-root></app-root>
-  <script src="polyfills-B6TNHZQ6.js" type="module"></script><script src="main-HI6ED422.js" type="module"></script></body>
+  <script src="polyfills-B6TNHZQ6.js" type="module"></script><script src="main-E5F3HTYQ.js" type="module"></script></body>
 </html>

文件差異過大導致無法顯示
+ 0 - 0
oms/public/app/main-E5F3HTYQ.js


+ 17 - 1
omsapp/src/app/pages/message-dashboard.component.ts

@@ -319,6 +319,14 @@ export class MessageDashboardComponent implements OnInit {
 
     this.isLoading = true;
 
+    console.log(this.dateRange[0], this.dateRange[1]); // 打印: Mon Sep 15 2025 02:22:55 GMT+0800 (中国标准时间) Mon Sep 15 2025 02:22:55 GMT+0800 (中国标准时间)
+    this.dateRange[0]
+      ? console.log(this.formatDateForApi(this.dateRange[0]))
+      : ''; // 打印 2025-09-14
+    this.dateRange[1]
+      ? console.log(this.formatDateForApi(this.dateRange[1]))
+      : ''; // 打印 2025-09-14  为什么
+
     const params = new HttpParams()
       .set(
         'startDate',
@@ -466,8 +474,16 @@ export class MessageDashboardComponent implements OnInit {
   }
 
   // 为API格式化日期为ISO字符串(YYYY-MM-DD)
+  // private formatDateForApi(date: Date): string {
+  //   return date.toISOString().split('T')[0];
+  // }
+
   private formatDateForApi(date: Date): string {
-    return date.toISOString().split('T')[0];
+    // 手动拼接年月日,确保使用本地日期
+    const year = date.getFullYear();
+    const month = String(date.getMonth() + 1).padStart(2, '0');
+    const day = String(date.getDate()).padStart(2, '0');
+    return `${year}-${month}-${day}`;
   }
 
   // 排序方法

部分文件因文件數量過多而無法顯示