From 707512d5519e701ddcaf0912a768929998e22e58 Mon Sep 17 00:00:00 2001
From: gaoluyang <2820782392@qq.com>
Date: 星期三, 28 十月 2026 15:27:23 +0800
Subject: [PATCH] fix(date): 页面展示的时间统一只到年月日

---
 src/main.js |   19 +++++++++++++++++++
 1 files changed, 19 insertions(+), 0 deletions(-)

diff --git a/src/main.js b/src/main.js
index 025ff14..3314296 100644
--- a/src/main.js
+++ b/src/main.js
@@ -58,6 +58,7 @@
 import PageHeader from "@/components/PageHeader/index.vue";
 
 import { getToken } from "@/utils/auth";
+import { toDateOnly } from "@/utils/dateDisplay";
 import {
   calculateTaxExclusiveTotalPrice,
   summarizeTable,
@@ -81,6 +82,9 @@
 app.config.globalProperties.selectDictLabel = selectDictLabel;
 app.config.globalProperties.selectDictLabels = selectDictLabels;
 app.config.globalProperties.javaApi = __BASE_API__;
+// 灞曠ず鐢ㄦ棩鏈燂細甯︽椂鍒嗙鐨勫彧淇濈暀骞存湀鏃�
+app.config.globalProperties.formatDateOnly = toDateOnly;
+app.config.globalProperties.toDateOnly = toDateOnly;
 app.config.globalProperties.HaveJson = (val) => {
   return JSON.parse(JSON.stringify(val));
 };
@@ -116,4 +120,19 @@
 });
 app._context.components.ElDialog.props.closeOnClickModal.default = false;
 
+// 鍒楄〃鏃堕棿缁熶竴鍙睍绀哄勾鏈堟棩锛氭湭鍗曠嫭閰嶇疆 formatter 鐨勮〃鏍煎垪璧拌繖閲�
+const tableColumnFormatter =
+  app._context.components.ElTableColumn?.props?.formatter;
+if (tableColumnFormatter) {
+  const formatCell = (row, column, cellValue) => toDateOnly(cellValue);
+  if (typeof tableColumnFormatter === "function") {
+    app._context.components.ElTableColumn.props.formatter = {
+      type: Function,
+      default: formatCell,
+    };
+  } else {
+    tableColumnFormatter.default = formatCell;
+  }
+}
+
 app.mount("#app");

--
Gitblit v1.9.3