feat(web-admin): wire protocol-audit and donation audit routes to UnifiedProtocolPage.
Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
1 parent
70c92fb33f
commit
c1f9a56404
2 files changed
+17
-1083
No files matched your search
@@ -1,108 +1,40 @@
|
||||
<!-- 采集协议单管理(协议单 / 储存证 / 满月待办) -->
|
||||
<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'" />
|
||||
<StorageCertTab v-else-if="activeTab === 'storage-cert'" />
|
||||
<FullmoonTodoTab v-else-if="activeTab === 'fullmoon-todo'" />
|
||||
<UnifiedProtocolPage v-if="showUnified" default-source="cell_storage" />
|
||||
</section>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script setup lang="ts">
|
||||
import ProtocolAuditTab from './ProtocolAuditTab.vue'
|
||||
import StorageCertTab from './StorageCertTab.vue'
|
||||
import FullmoonTodoTab from './FullmoonTodoTab.vue'
|
||||
import UnifiedProtocolPage from './UnifiedProtocolPage.vue'
|
||||
|
||||
defineOptions({ name: 'CellStorageProtocolAudit' })
|
||||
|
||||
const LEGACY_SAMPLE_TABS = ['sample-reception', 'storage-entry'] as const
|
||||
|
||||
const VALID_TABS = ['protocol', '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: '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}%)`
|
||||
}))
|
||||
const showUnified = ref(false)
|
||||
|
||||
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 (tab === 'payment-info') {
|
||||
router.replace({
|
||||
name: 'CellStoragePaymentInfo',
|
||||
query: { ...route.query, tab: 'flow' }
|
||||
query: { ...route.query, tab: 'dfj' }
|
||||
})
|
||||
return
|
||||
}
|
||||
if (VALID_TABS.includes(tab as EntityTabKey)) {
|
||||
activeTab.value = tab as EntityTabKey
|
||||
if (
|
||||
['storage-cert', 'fullmoon-todo', 'sample-reception', 'storage-entry', 'sample-qc'].includes(
|
||||
tab
|
||||
)
|
||||
) {
|
||||
router.replace({
|
||||
name: 'CellStorageSampleInfo',
|
||||
query: { ...route.query, tab: 'cell_storage' }
|
||||
})
|
||||
return
|
||||
}
|
||||
showUnified.value = true
|
||||
})
|
||||
</script>
|
||||
File diff suppressed because it is too large.
Load diff
Reference in new issue
Block a user