提交
This commit is contained in:
1 parent
d08f03ab03
commit
cc843535f5
154 files changed
+17837
-5153
No files matched your search
@@ -1,22 +1,5 @@
|
||||
<template>
|
||||
<div class="unified-sample-info-page">
|
||||
<div v-if="visibleTabs.length > 1" class="panel-pill-tabs panel-pill-tabs--lg">
|
||||
<div class="panel-pill-tabs__track" role="tablist" aria-label="来源">
|
||||
<button
|
||||
v-for="item in visibleTabs"
|
||||
:key="item.key"
|
||||
type="button"
|
||||
role="tab"
|
||||
class="panel-pill-tabs__btn"
|
||||
:class="{ 'is-active': activeSource === item.key }"
|
||||
:aria-selected="activeSource === item.key"
|
||||
@click="switchSource(item.key)"
|
||||
>
|
||||
{{ item.title }}
|
||||
</button>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="filter-block">
|
||||
<el-form
|
||||
:model="searchForm"
|
||||
@@ -497,7 +480,6 @@
|
||||
import DonationViewDialog from '@/views/research-donation/list/DonationViewDialog.vue'
|
||||
import SampleCodeWithSpecialDisplay from '@/components/business/sample-code-with-special-display/index.vue'
|
||||
import SampleInfoQuickRegisterDialog from './SampleInfoQuickRegisterDialog.vue'
|
||||
import { useMenuPerm } from '@/hooks/core/useMenuPerm'
|
||||
import {
|
||||
donationStatusDisplayLabel,
|
||||
donationStatusTagType,
|
||||
@@ -521,23 +503,8 @@
|
||||
defaultSource: 'cell_storage' | 'research_donation'
|
||||
}>()
|
||||
|
||||
const { hasMenuPerm } = useMenuPerm()
|
||||
const route = useRoute()
|
||||
const router = useRouter()
|
||||
|
||||
type SourceKey = 'cell_storage' | 'research_donation'
|
||||
|
||||
const allTabs: Array<{ key: SourceKey; title: string; perm: string }> = [
|
||||
{ key: 'cell_storage', title: '细胞存储', perm: 'cell-storage:sample-info:list' },
|
||||
{
|
||||
key: 'research_donation',
|
||||
title: '科研捐赠',
|
||||
perm: 'research-donation:sample-info:list'
|
||||
}
|
||||
]
|
||||
|
||||
const visibleTabs = computed(() => allTabs.filter((t) => hasMenuPerm(t.perm)))
|
||||
const activeSource = ref<SourceKey>(props.defaultSource)
|
||||
/** 客户服务管理仅细胞存储;科研捐赠隐藏路由仍可通过 defaultSource 进入 */
|
||||
const activeSource = computed(() => props.defaultSource)
|
||||
const isCellStorage = computed(() => activeSource.value === 'cell_storage')
|
||||
|
||||
const searchForm = reactive({
|
||||
@@ -600,16 +567,6 @@
|
||||
return donationStatusTagType(String(row.donationStatus || ''))
|
||||
}
|
||||
|
||||
function switchSource(key: SourceKey) {
|
||||
activeSource.value = key
|
||||
protocolViewVisible.value = false
|
||||
donationViewVisible.value = false
|
||||
selectedRows.value = []
|
||||
router.replace({ query: { ...route.query, tab: key } })
|
||||
pagination.page = 1
|
||||
loadData()
|
||||
}
|
||||
|
||||
async function loadData() {
|
||||
loading.value = true
|
||||
try {
|
||||
@@ -731,15 +688,6 @@
|
||||
)
|
||||
|
||||
onMounted(() => {
|
||||
const tab = String(route.query.tab || '')
|
||||
const allowed = visibleTabs.value.map((t) => t.key)
|
||||
if (allowed.includes(tab as SourceKey)) {
|
||||
activeSource.value = tab as SourceKey
|
||||
} else if (allowed.includes(props.defaultSource)) {
|
||||
activeSource.value = props.defaultSource
|
||||
} else if (allowed.length) {
|
||||
activeSource.value = allowed[0]
|
||||
}
|
||||
loadData()
|
||||
})
|
||||
</script>
|
||||
|
||||
Reference in new issue
Block a user