Files
danyang-match/h5-demo/src/layouts/OperatorLayout.vue
T
WorkBuddy 69ebf33e18
CI/CD Pipeline / Backend Build & Test (push) Waiting to run
CI/CD Pipeline / Admin Web Build (push) Waiting to run
CI/CD Pipeline / Mini Program Compile Check (push) Waiting to run
CI/CD Pipeline / Migration Validation (push) Blocked by required conditions
CI/CD Pipeline / Test Shell Guard (Phase 23 Gate) (push) Waiting to run
CI/CD Pipeline / UI Contracts (source-structure gates) (push) Waiting to run
CI/CD Pipeline / E2E (live stack) (push) Blocked by required conditions
release: freeze demo v1.1.0 2026-10-19
2026-10-19 20:36:22 +08:00

57 lines
1.2 KiB
Vue

<template>
<div class="operator-layout">
<van-nav-bar
:title="title"
left-arrow
fixed
placeholder
@click-left="onBack"
>
<template #right>
<span class="operator-layout__logout" @click="onLogout">退出</span>
</template>
</van-nav-bar>
<div class="operator-layout__body">
<slot />
</div>
</div>
</template>
<script setup lang="ts">
import { useRouter } from 'vue-router'
import { showConfirmDialog } from 'vant'
import { useOperatorStore } from '@/stores/operator'
withDefaults(defineProps<{ title?: string }>(), { title: '红娘工作台' })
const router = useRouter()
const operatorStore = useOperatorStore()
function onBack() {
router.replace('/operator/workbench')
}
async function onLogout() {
try {
await showConfirmDialog({ title: '退出登录', message: '确定要退出红娘工作台吗?' })
} catch {
return
}
operatorStore.logout()
router.replace('/operator/login')
}
</script>
<style scoped>
.operator-layout {
min-height: 100vh;
background: var(--mini-bg);
}
.operator-layout__body {
min-height: calc(100vh - 46px);
}
.operator-layout__logout {
color: var(--mini-text-secondary);
font-size: 13px;
}
</style>