diff --git a/src/components/RePureTableBar/src/bar.tsx b/src/components/RePureTableBar/src/bar.tsx index 5367c6b33..de98fed89 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 581c90121..2e5216cac 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 917d52e5e..0da6e9c18 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(); +}