From 6345dd63ca8f534b2d50e3d31231b8a04bfcd4ab Mon Sep 17 00:00:00 2001
From: zhangwencui <1064582902@qq.com>
Date: 星期四, 18 六月 2026 16:07:12 +0800
Subject: [PATCH] 表格中的tooltip提示框有偏移问题

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

diff --git a/src/main.js b/src/main.js
index 025ff14..a09ad48 100644
--- a/src/main.js
+++ b/src/main.js
@@ -27,14 +27,7 @@
 import "./permission"; // permission control
 
 import { useDict } from "@/utils/dict";
-import {
-  parseTime,
-  resetForm,
-  addDateRange,
-  handleTree,
-  selectDictLabel,
-  selectDictLabels,
-} from "@/utils/ruoyi";
+import { parseTime, resetForm, addDateRange, handleTree, selectDictLabel, selectDictLabels } from "@/utils/ruoyi";
 
 // 鍒嗛〉缁勪欢
 import Pagination from "@/components/Pagination";
@@ -58,11 +51,7 @@
 import PageHeader from "@/components/PageHeader/index.vue";
 
 import { getToken } from "@/utils/auth";
-import {
-  calculateTaxExclusiveTotalPrice,
-  summarizeTable,
-  calculateTaxIncludeTotalPrice,
-} from "@/utils/summarizeTable.js";
+import { calculateTaxExclusiveTotalPrice, summarizeTable, calculateTaxIncludeTotalPrice } from "@/utils/summarizeTable.js";
 
 const app = createApp(App);
 
@@ -72,16 +61,14 @@
 app.config.globalProperties.parseTime = parseTime;
 app.config.globalProperties.resetForm = resetForm;
 app.config.globalProperties.summarizeTable = summarizeTable;
-app.config.globalProperties.calculateTaxExclusiveTotalPrice =
-  calculateTaxExclusiveTotalPrice;
-app.config.globalProperties.calculateTaxIncludeTotalPrice =
-  calculateTaxIncludeTotalPrice;
+app.config.globalProperties.calculateTaxExclusiveTotalPrice = calculateTaxExclusiveTotalPrice;
+app.config.globalProperties.calculateTaxIncludeTotalPrice = calculateTaxIncludeTotalPrice;
 app.config.globalProperties.handleTree = handleTree;
 app.config.globalProperties.addDateRange = addDateRange;
 app.config.globalProperties.selectDictLabel = selectDictLabel;
 app.config.globalProperties.selectDictLabels = selectDictLabels;
 app.config.globalProperties.javaApi = __BASE_API__;
-app.config.globalProperties.HaveJson = (val) => {
+app.config.globalProperties.HaveJson = val => {
   return JSON.parse(JSON.stringify(val));
 };
 app.config.globalProperties.uploadHeader = {
@@ -115,5 +102,21 @@
   size: Cookies.get("size") || "default",
 });
 app._context.components.ElDialog.props.closeOnClickModal.default = false;
-
+const ElTable = app._context.components.ElTable;
+if (ElTable?.props?.tooltipOptions) {
+  if (ElTable.props.tooltipOptions === Object) {
+    ElTable.props.tooltipOptions = {
+      type: Object,
+      default: () => ({
+        appendTo: "body",
+      }),
+    };
+  } else if (typeof ElTable.props.tooltipOptions === "object") {
+    ElTable.props.tooltipOptions.default =
+      ElTable.props.tooltipOptions.default ||
+      (() => ({
+        appendTo: "body",
+      }));
+  }
+}
 app.mount("#app");

--
Gitblit v1.9.3