From 281675bdaf5ed01dd86d632edfee7c2d12c4827b Mon Sep 17 00:00:00 2001 From: xiaoxian521 <1923740402@qq.com> Date: Tue, 24 Sep 2024 08:42:46 +0800 Subject: [PATCH 1/2] =?UTF-8?q?fix:=20=E4=BF=AE=E5=A4=8D=E5=9C=A8=E8=8F=9C?= =?UTF-8?q?=E5=8D=95=E3=80=81=E9=83=A8=E9=97=A8=E7=AE=A1=E7=90=86=E4=B8=AD?= =?UTF-8?q?=EF=BC=8C=E8=A1=A8=E6=A0=BC=E5=B1=95=E5=BC=80=E5=90=8E=E5=90=AF?= =?UTF-8?q?=E7=94=A8=E6=88=96=E5=85=B3=E9=97=AD=E5=85=A8=E5=B1=8F=E5=8A=9F?= =?UTF-8?q?=E8=83=BD=E6=97=B6=EF=BC=8C=E8=A1=A8=E6=A0=BC=E9=AB=98=E5=BA=A6?= =?UTF-8?q?=E6=9C=AA=E8=87=AA=E5=8A=A8=E9=80=82=E5=BA=94=E7=9A=84=E9=97=AE?= =?UTF-8?q?=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/components/RePureTableBar/src/bar.tsx | 9 +++++++-- src/components/ReVxeTableBar/src/bar.tsx | 9 +++++++-- src/views/system/dept/index.vue | 6 ++++++ src/views/system/menu/index.vue | 6 ++++++ src/views/table/high/header/columns.tsx | 12 +++--------- 5 files changed, 29 insertions(+), 13 deletions(-) diff --git a/src/components/RePureTableBar/src/bar.tsx b/src/components/RePureTableBar/src/bar.tsx index 5367c6b33c..de98fed893 100644 --- a/src/components/RePureTableBar/src/bar.tsx +++ b/src/components/RePureTableBar/src/bar.tsx @@ -54,7 +54,7 @@ const props = { export default defineComponent({ name: "PureTableBar", props, - emits: ["refresh"], + emits: ["refresh", "fullscreen"], setup(props, { emit, slots, attrs }) { const size = ref("default"); const loading = ref(false); @@ -117,6 +117,11 @@ export default defineComponent({ toggleRowExpansionAll(props.tableRef.data, isExpandAll.value); } + function onFullscreen() { + isFullscreen.value = !isFullscreen.value; + emit("fullscreen", isFullscreen.value); + } + function toggleRowExpansionAll(data, isExpansion) { data.forEach(item => { props.tableRef.toggleRowExpansion(item, isExpansion); @@ -378,7 +383,7 @@ export default defineComponent({ class={["w-[16px]", iconClass.value]} icon={isFullscreen.value ? ExitFullscreen : Fullscreen} v-tippy={isFullscreen.value ? "退出全屏" : "全屏"} - onClick={() => (isFullscreen.value = !isFullscreen.value)} + onClick={() => onFullscreen()} /> diff --git a/src/components/ReVxeTableBar/src/bar.tsx b/src/components/ReVxeTableBar/src/bar.tsx index 581c90121f..2e5216cac8 100644 --- a/src/components/ReVxeTableBar/src/bar.tsx +++ b/src/components/ReVxeTableBar/src/bar.tsx @@ -52,7 +52,7 @@ const props = { export default defineComponent({ name: "VxeTableBar", props, - emits: ["refresh"], + emits: ["refresh", "fullscreen"], setup(props, { emit, slots, attrs }) { const size = ref("small"); const loading = ref(false); @@ -113,6 +113,11 @@ export default defineComponent({ props.vxeTableRef.refreshColumn(); } + function onFullscreen() { + isFullscreen.value = !isFullscreen.value; + emit("fullscreen", isFullscreen.value); + } + function reloadColumn() { const curCheckedColumns = cloneDeep(dynamicColumns.value).filter(item => checkedColumns.value.includes(item.title) @@ -369,7 +374,7 @@ export default defineComponent({ class={["w-[16px]", iconClass.value]} icon={isFullscreen.value ? ExitFullscreen : Fullscreen} v-tippy={isFullscreen.value ? "退出全屏" : "全屏"} - onClick={() => (isFullscreen.value = !isFullscreen.value)} + onClick={() => onFullscreen()} /> diff --git a/src/views/system/dept/index.vue b/src/views/system/dept/index.vue index 917d52e5ea..0da6e9c189 100644 --- a/src/views/system/dept/index.vue +++ b/src/views/system/dept/index.vue @@ -26,6 +26,11 @@ const { handleDelete, handleSelectionChange } = useDept(); + +function onFullscreen() { + // 重置表格高度 + tableRef.value.setAdaptive(); +}