Files
gao-customer-h5/src/pages/tabs/HomeTab.vue
T
2026-11-13 16:50:16 +08:00

72 lines
2.0 KiB
Vue
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
<template>
<div class="tui-page-layout tui-navbar home-tab">
<t-navbar
v-if="!mergedLayout"
fixed
:z-index="20"
title="客户"
>
<template #right>
<navbar-notify-button />
</template>
</t-navbar>
<!-- 平板横屏:门店与客户合并成一页,两栏各自保留导航栏 -->
<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>
<script setup lang="ts">
import { useUserStore } from "timi-web-api";
import { useLayout } from "timi-tdesign-mobile";
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({
name: "HomeTab"
});
const userStore = useUserStore();
// 横屏平板(出现左侧导航栏)才合并门店与客户入口;
// 没有统计权限的账号本来就没有门店 tab,这里同样不显示左侧分栏
const { isWide } = useLayout({ tablet: true });
const mergedLayout = computed(() => isWide.value && userStore.hasPermissions(permissionCodes.stat.read));
const storeOverviewRef = ref<InstanceType<typeof StoreOverview>>();
</script>