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 | 53 +++++++++++++++++++++++++++++++----------------------
1 files changed, 31 insertions(+), 22 deletions(-)
diff --git a/src/main.js b/src/main.js
index abaac2e..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";
@@ -43,22 +36,22 @@
// 瀵屾枃鏈粍浠�
import Editor from "@/components/Editor";
// 鏂囦欢涓婁紶缁勪欢
-import FileUpload from "@/components/FileUpload";
+import FileUpload from "@/components/AttachmentUpload/file";
// 鍥剧墖涓婁紶缁勪欢
-import ImageUpload from "@/components/ImageUpload";
+import ImageUpload from "@/components/AttachmentUpload/image";
// 鍥剧墖棰勮缁勪欢
-import ImagePreview from "@/components/ImagePreview";
+import ImagePreview from "@/components/AttachmentPreview/image";
+// 闄勪欢寮圭獥缁勪欢
+import FileListDialog from "@/components/Dialog/FileList.vue";
// 瀛楀吀鏍囩缁勪欢
import DictTag from "@/components/DictTag";
// 琛ㄦ牸缁勪欢
import PIMTable from "@/components/PIMTable/PIMTable.vue";
+// 椤甸潰澶撮儴缁勪欢
+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);
@@ -68,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 = {
@@ -90,9 +81,11 @@
app.component("FileUpload", FileUpload);
app.component("ImageUpload", ImageUpload);
app.component("ImagePreview", ImagePreview);
+app.component("FileListDialog", FileListDialog);
app.component("RightToolbar", RightToolbar);
app.component("Editor", Editor);
app.component("PIMTable", PIMTable);
+app.component("PageHeader", PageHeader);
app.use(router);
app.use(store);
@@ -109,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