Skip to content

Commit 4e3abc4

Browse files
author
zhangtao
committed
refactor(ui): add sidebar table page layout
- add FaSidebarTablePage composing FaWorkbench and FaTablePage - migrate user management to the shared sidebar/table shell - keep mobile behavior of hiding the department sidebar
1 parent aaecee9 commit 4e3abc4

2 files changed

Lines changed: 312 additions & 263 deletions

File tree

  • frontend/web/src
Lines changed: 70 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,70 @@
1+
<template>
2+
<div class="fa-full-height fa-sidebar-table-page" :class="{ 'is-hide-side': hideSideOnMobile }">
3+
<FaWorkbench :side-width="sideWidth">
4+
<template #side>
5+
<slot name="side" />
6+
</template>
7+
8+
<FaTablePage
9+
v-model:show-search-bar="showSearchBar"
10+
v-model:columns="columns"
11+
:loading="loading"
12+
:layout="layout"
13+
@refresh="emit('refresh')"
14+
>
15+
<template #search>
16+
<slot name="search" />
17+
</template>
18+
<template #header-left>
19+
<slot name="header-left" />
20+
</template>
21+
<slot />
22+
<template #dialogs>
23+
<slot name="dialogs" />
24+
</template>
25+
</FaTablePage>
26+
</FaWorkbench>
27+
</div>
28+
</template>
29+
30+
<script setup lang="ts">
31+
import type { ColumnOption } from "@/types/component";
32+
33+
defineOptions({ name: "FaSidebarTablePage" });
34+
35+
withDefaults(
36+
defineProps<{
37+
sideWidth?: number;
38+
loading?: boolean;
39+
layout?: string;
40+
hideSideOnMobile?: boolean;
41+
}>(),
42+
{
43+
sideWidth: 260,
44+
loading: false,
45+
layout: "search,refresh,size,fullscreen,columns,settings",
46+
hideSideOnMobile: true,
47+
}
48+
);
49+
50+
const showSearchBar = defineModel<boolean>("showSearchBar", { default: true });
51+
const columns = defineModel<ColumnOption[]>("columns", { default: () => [] });
52+
53+
const emit = defineEmits<{ refresh: [] }>();
54+
55+
defineSlots<{
56+
side?: () => unknown;
57+
search?: () => unknown;
58+
"header-left"?: () => unknown;
59+
default?: () => unknown;
60+
dialogs?: () => unknown;
61+
}>();
62+
</script>
63+
64+
<style scoped lang="scss">
65+
@media (width <= 800px) {
66+
.is-hide-side :deep(.fa-workbench__side) {
67+
display: none;
68+
}
69+
}
70+
</style>

0 commit comments

Comments
 (0)