add TabSplitView
This commit is contained in:
+33
-96
@@ -10,45 +10,39 @@
|
||||
<navbar-notify-button />
|
||||
</template>
|
||||
</t-navbar>
|
||||
<main class="tui-page-content" :class="mergedLayout ? 'wide-split' : 'scroll column'">
|
||||
<!-- 平板横屏:门店与客户合并成一页,两栏各自保留导航栏 -->
|
||||
<div v-if="mergedLayout" class="split">
|
||||
<section class="pane store-pane">
|
||||
<t-navbar :z-index="20" title="门店">
|
||||
<template #right>
|
||||
<t-button
|
||||
aria-label="刷新"
|
||||
@click="storeOverviewRef?.refresh()"
|
||||
theme="default"
|
||||
variant="text"
|
||||
size="small"
|
||||
>
|
||||
<t-icon name="refresh" size="1.25rem" />
|
||||
</t-button>
|
||||
</template>
|
||||
</t-navbar>
|
||||
<div class="pane-body">
|
||||
<store-overview ref="storeOverviewRef" compact />
|
||||
</div>
|
||||
</section>
|
||||
<section class="pane entry-pane">
|
||||
<t-navbar :z-index="20" title="客户">
|
||||
<template #right>
|
||||
<navbar-notify-button />
|
||||
</template>
|
||||
</t-navbar>
|
||||
<div class="pane-body">
|
||||
<pending-notice-bar />
|
||||
<customer-entry-panel />
|
||||
</div>
|
||||
</section>
|
||||
</div>
|
||||
<template v-else>
|
||||
<div class="tab-body">
|
||||
<pending-notice-bar />
|
||||
<customer-entry-panel />
|
||||
</div>
|
||||
<!-- 平板横屏:门店与客户合并成一页,两栏各自保留导航栏 -->
|
||||
<tab-split-view
|
||||
v-if="mergedLayout"
|
||||
left-title="门店"
|
||||
right-title="客户"
|
||||
>
|
||||
<template #left-actions>
|
||||
<t-button
|
||||
aria-label="刷新"
|
||||
@click="storeOverviewRef?.refresh()"
|
||||
theme="default"
|
||||
variant="text"
|
||||
size="small"
|
||||
>
|
||||
<t-icon name="refresh" size="1.25rem" />
|
||||
</t-button>
|
||||
</template>
|
||||
<template #left>
|
||||
<store-overview ref="storeOverviewRef" compact />
|
||||
</template>
|
||||
<template #right-actions>
|
||||
<navbar-notify-button />
|
||||
</template>
|
||||
<template #right>
|
||||
<pending-notice-bar />
|
||||
<customer-entry-panel />
|
||||
</template>
|
||||
</tab-split-view>
|
||||
<main v-else class="tui-page-content scroll column">
|
||||
<div class="tab-body">
|
||||
<pending-notice-bar />
|
||||
<customer-entry-panel />
|
||||
</div>
|
||||
</main>
|
||||
</div>
|
||||
</template>
|
||||
@@ -60,6 +54,7 @@ import PendingNoticeBar from "./component/PendingNoticeBar.vue";
|
||||
import CustomerEntryPanel from "./component/CustomerEntryPanel.vue";
|
||||
import NavbarNotifyButton from "./component/NavbarNotifyButton.vue";
|
||||
import StoreOverview from "./component/StoreOverview.vue";
|
||||
import TabSplitView from "./component/TabSplitView.vue";
|
||||
import { permissionCodes } from "@/utils/permission";
|
||||
|
||||
defineOptions({
|
||||
@@ -74,61 +69,3 @@ const { isWide } = useLayout({ tablet: true });
|
||||
const mergedLayout = computed(() => isWide.value && userStore.hasPermissions(permissionCodes.stat.read));
|
||||
const storeOverviewRef = ref<InstanceType<typeof StoreOverview>>();
|
||||
</script>
|
||||
|
||||
<style scoped lang="less">
|
||||
.home-tab {
|
||||
|
||||
.wide-split {
|
||||
overflow: hidden;
|
||||
padding-top: 0;
|
||||
padding-bottom: 0;
|
||||
}
|
||||
|
||||
.split {
|
||||
flex: 1;
|
||||
display: grid;
|
||||
min-height: 0;
|
||||
grid-template-columns: minmax(0, 1fr) clamp(24rem, 28vw, 28rem);
|
||||
}
|
||||
|
||||
.pane {
|
||||
display: flex;
|
||||
position: relative;
|
||||
min-height: 0;
|
||||
overflow: hidden;
|
||||
flex-direction: column;
|
||||
|
||||
&:first-child {
|
||||
border-right: 1px solid var(--td-component-border);
|
||||
}
|
||||
|
||||
// 栏内导航栏贴在栏顶,内容从它下方滚过,和整页的毛玻璃效果一致
|
||||
.t-navbar {
|
||||
top: 0;
|
||||
left: 0;
|
||||
right: 0;
|
||||
position: absolute;
|
||||
|
||||
// navbar 默认 fixed:内容层原本贴着视口,这里收回栏内;
|
||||
// 占位块是给 fixed 模式撑高度用的,栏内不需要
|
||||
:deep(.t-navbar__content) {
|
||||
left: 0;
|
||||
right: 0;
|
||||
position: relative;
|
||||
}
|
||||
|
||||
:deep(.t-navbar__placeholder) {
|
||||
display: none;
|
||||
}
|
||||
}
|
||||
|
||||
.pane-body {
|
||||
flex: 1;
|
||||
min-height: 0;
|
||||
overflow: auto;
|
||||
padding-top: calc(var(--tui-nav-height, 48px) + 1rem);
|
||||
padding-bottom: 1rem;
|
||||
}
|
||||
}
|
||||
}
|
||||
</style>
|
||||
|
||||
Reference in New Issue
Block a user