109 lines
3.2 KiB
Vue
109 lines
3.2 KiB
Vue
<!-- 采集协议单管理(协议单 / 缴费 / 储存证 / 满月待办) -->
|
||
<template>
|
||
<div class="page-container">
|
||
<section class="panel">
|
||
<nav class="pill-tab-nav" role="tablist" aria-label="视图类型">
|
||
<div class="pill-tab-nav__rail">
|
||
<div class="pill-tab-nav__progress" :style="pillProgressStyle" />
|
||
<button
|
||
v-for="(item, index) in entityTabs"
|
||
:key="item.key"
|
||
type="button"
|
||
class="pill-tab-nav__step"
|
||
:class="{
|
||
'is-active': activeTab === item.key,
|
||
'is-done': index < activeTabIndex
|
||
}"
|
||
role="tab"
|
||
:aria-selected="activeTab === item.key"
|
||
@click="activeTab = item.key"
|
||
>
|
||
<span class="pill-tab-nav__index">{{ index + 1 }}</span>
|
||
<span class="pill-tab-nav__text">
|
||
<span class="pill-tab-nav__title">{{ item.title }}</span>
|
||
<span class="pill-tab-nav__desc">{{ item.desc }}</span>
|
||
</span>
|
||
</button>
|
||
</div>
|
||
</nav>
|
||
|
||
<ProtocolAuditTab v-if="activeTab === 'protocol'" />
|
||
<PaymentInfoTab v-else-if="activeTab === 'payment-info'" />
|
||
<StorageCertTab v-else-if="activeTab === 'storage-cert'" />
|
||
<FullmoonTodoTab v-else-if="activeTab === 'fullmoon-todo'" />
|
||
</section>
|
||
</div>
|
||
</template>
|
||
|
||
<script setup lang="ts">
|
||
import ProtocolAuditTab from './ProtocolAuditTab.vue'
|
||
import PaymentInfoTab from './PaymentInfoTab.vue'
|
||
import StorageCertTab from './StorageCertTab.vue'
|
||
import FullmoonTodoTab from './FullmoonTodoTab.vue'
|
||
|
||
defineOptions({ name: 'CellStorageProtocolAudit' })
|
||
|
||
const LEGACY_SAMPLE_TABS = ['sample-reception', 'storage-entry'] as const
|
||
|
||
const VALID_TABS = ['protocol', 'payment-info', 'storage-cert', 'fullmoon-todo'] as const
|
||
|
||
type EntityTabKey = (typeof VALID_TABS)[number]
|
||
|
||
const entityTabs: Array<{
|
||
key: EntityTabKey
|
||
title: string
|
||
desc: string
|
||
}> = [
|
||
{
|
||
key: 'protocol',
|
||
title: '协议单管理',
|
||
desc: '协议审核与状态维护'
|
||
},
|
||
{
|
||
key: 'payment-info',
|
||
title: '缴费信息',
|
||
desc: '缴费计划与到账查询'
|
||
},
|
||
{
|
||
key: 'storage-cert',
|
||
title: '储存证管理',
|
||
desc: '储存证开具与管理'
|
||
},
|
||
{
|
||
key: 'fullmoon-todo',
|
||
title: '满月待办管理',
|
||
desc: '满月保险待办办理'
|
||
}
|
||
]
|
||
|
||
const route = useRoute()
|
||
const router = useRouter()
|
||
const activeTab = ref<EntityTabKey>('protocol')
|
||
|
||
const activeTabIndex = computed(() =>
|
||
Math.max(
|
||
0,
|
||
entityTabs.findIndex((item) => item.key === activeTab.value)
|
||
)
|
||
)
|
||
|
||
const pillProgressStyle = computed(() => ({
|
||
width: `calc(${100 / entityTabs.length}% - 3px)`,
|
||
transform: `translateX(${activeTabIndex.value * 100}%)`
|
||
}))
|
||
|
||
onMounted(() => {
|
||
const tab = String(route.query.tab || '')
|
||
if (LEGACY_SAMPLE_TABS.includes(tab as (typeof LEGACY_SAMPLE_TABS)[number])) {
|
||
router.replace({
|
||
name: 'CellStorageSampleInfo',
|
||
query: { ...route.query, tab }
|
||
})
|
||
return
|
||
}
|
||
if (VALID_TABS.includes(tab as EntityTabKey)) {
|
||
activeTab.value = tab as EntityTabKey
|
||
}
|
||
})
|
||
</script>
|