fix: 页面表格容器高度计算优化

This commit is contained in:
ZhuRui
2026-07-27 10:19:45 +08:00
parent 471d868634
commit e238328919
7 changed files with 8 additions and 8 deletions
+2 -2
View File
@@ -14,10 +14,10 @@ import { ref, onMounted, onUnmounted, type Ref } from 'vue';
* // </div> * // </div>
* ``` * ```
* *
* @param headerOffset 从容器高度中扣除的表头偏移量,默认 45 * @param headerOffset 从容器高度中扣除的表头偏移量,默认 55
*/ */
export function useContainerSize(options?: { headerOffset?: number }) { export function useContainerSize(options?: { headerOffset?: number }) {
const { headerOffset = 45 } = options ?? {}; const { headerOffset = 55 } = options ?? {};
const containerRef = ref<HTMLElement | null>(null) as Ref<HTMLElement | null>; const containerRef = ref<HTMLElement | null>(null) as Ref<HTMLElement | null>;
const width = ref(0); const width = ref(0);
+1 -1
View File
@@ -153,7 +153,7 @@ export default defineComponent({
handleToggleStatus, handleToggleStatus,
} = useBannerModel(); } = useBannerModel();
const { containerRef, height } = useContainerSize({ headerOffset: 55 }); const { containerRef, height } = useContainerSize();
/** 删除二次确认 */ /** 删除二次确认 */
const confirmDelete = (record: any) => { const confirmDelete = (record: any) => {
+1 -1
View File
@@ -106,7 +106,7 @@ export default defineComponent({
handlePageChange, handlePageChange,
} = useEventListModel(); } = useEventListModel();
const { containerRef, height } = useContainerSize({ headerOffset: 55 }); const { containerRef, height } = useContainerSize();
// 弹窗状态 // 弹窗状态
const [regulationModalVisible, setRegulationModalVisible] = useState<boolean>(false); const [regulationModalVisible, setRegulationModalVisible] = useState<boolean>(false);
+1 -1
View File
@@ -107,7 +107,7 @@ export default defineComponent({
handlePageChange, handlePageChange,
} = useOrderModel(); } = useOrderModel();
const { containerRef, height } = useContainerSize({ headerOffset: 55 }); const { containerRef, height } = useContainerSize();
// 详情弹窗状态 // 详情弹窗状态
const [detailVisible, setDetailVisible] = useState<boolean>(false); const [detailVisible, setDetailVisible] = useState<boolean>(false);
+1 -1
View File
@@ -72,7 +72,7 @@ export default defineComponent({
handlePageChange, handlePageChange,
} = useUserModel(); } = useUserModel();
const { containerRef, height } = useContainerSize({ headerOffset: 55 }); const { containerRef, height } = useContainerSize();
const handleToggleStatus = (record: any) => { const handleToggleStatus = (record: any) => {
const isActive = record.status === 'active'; const isActive = record.status === 'active';
+1 -1
View File
@@ -103,7 +103,7 @@ export default defineComponent({
renderStatus, renderStatus,
} = useRoleModel(); } = useRoleModel();
const { containerRef, height } = useContainerSize({ headerOffset: 55 }); const { containerRef, height } = useContainerSize();
const triggerDelete = (record: any) => confirmDelete({ record, onOk: handleDelete }); const triggerDelete = (record: any) => confirmDelete({ record, onOk: handleDelete });
+1 -1
View File
@@ -92,7 +92,7 @@ export default defineComponent({
handleToggleStatus, handleToggleStatus,
} = useUserModel(); } = useUserModel();
const { containerRef, height } = useContainerSize({ headerOffset: 55 }); const { containerRef, height } = useContainerSize();
/** 触发禁用/启用的二次确认 */ /** 触发禁用/启用的二次确认 */
const triggerToggle = (record: any) => { const triggerToggle = (record: any) => {