25 lines
1.4 KiB
Vue
25 lines
1.4 KiB
Vue
<script setup lang="ts">
|
|
import '@/styles/adminDensity.css'
|
|
import { computed } from 'vue'
|
|
import { useRouter } from 'vue-router'
|
|
import { useAccessPreviewStore } from '@/core/access/accessPreview'
|
|
import ContainersView from './ContainersView.vue'
|
|
|
|
const props = defineProps<{ stage: 'DOMESTIC' | 'OVERSEAS' }>()
|
|
const access = useAccessPreviewStore()
|
|
const router = useRouter()
|
|
const canDomestic = computed(() => access.can('platform:firstleg:container:list'))
|
|
const canOverseas = computed(() => access.can('platform:firstleg:terminal-drayage:list'))
|
|
const current = computed(() => props.stage === 'DOMESTIC' && !canDomestic.value && canOverseas.value ? 'OVERSEAS' : props.stage)
|
|
</script>
|
|
|
|
<template>
|
|
<div class="admin-density">
|
|
<nav class="density-status-tabs" aria-label="货柜业务阶段">
|
|
<el-button v-if="canDomestic" :class="{ 'is-active': current === 'DOMESTIC' }" :aria-current="current === 'DOMESTIC' ? 'page' : undefined" @click="router.push({ name: 'domestic-container-workbench' })">📦 国内装柜</el-button>
|
|
<el-button v-if="canOverseas" :class="{ 'is-active': current === 'OVERSEAS' }" :aria-current="current === 'OVERSEAS' ? 'page' : undefined" @click="router.push({ name: 'overseas-container-workbench' })">🚢 海外清关提柜</el-button>
|
|
</nav>
|
|
<ContainersView v-if="canDomestic || canOverseas" :key="current" :workbench="current" />
|
|
</div>
|
|
</template>
|