多维表格
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 
 

73 lines
1.8 KiB

<script setup lang="ts">
const { openedViewsTab } = storeToRefs(useViewsStore())
const { onViewsTabChange } = useViewsStore()
const { isUIAllowed } = useRoles()
const openedSubTab = computed({
get() {
return openedViewsTab.value
},
set(val) {
onViewsTabChange(val)
},
})
watch(
openedSubTab,
() => {
if (openedSubTab.value === 'webhook' && !isUIAllowed('hookList')) {
onViewsTabChange('relation')
}
},
{
immediate: true,
},
)
</script>
<template>
<div class="flex flex-col h-full w-full" data-testid="nc-details-wrapper">
<NcTabs v-model="openedSubTab">
<a-tab-pane key="relation">
<template #tab>
<div class="tab" data-testid="nc-relations-tab">
<GeneralIcon icon="erd" class="tab-icon" :class="{}" />
<div>{{ $t('title.relations') }}</div>
</div>
</template>
<SmartsheetDetailsErd />
</a-tab-pane>
<a-tab-pane key="api">
<template #tab>
<div class="tab" data-testid="nc-apis-tab">
<GeneralIcon icon="code" class="tab-icon" :class="{}" />
<div>{{ $t('labels.apis') }}</div>
</div>
</template>
<SmartsheetDetailsApi />
</a-tab-pane>
<a-tab-pane v-if="isUIAllowed('hookList')" key="webhook">
<template #tab>
<div class="tab" data-testid="nc-webhooks-tab">
<GeneralIcon icon="webhook" class="tab-icon" :class="{}" />
<div>{{ $t('objects.webhooks') }}</div>
</div>
</template>
<SmartsheetDetailsWebhooks />
</a-tab-pane>
</NcTabs>
</div>
</template>
<style lang="scss" scoped>
.tab {
@apply flex flex-row items-center gap-x-1.5 pr-0.5;
}
:deep(.ant-tabs-nav) {
min-height: calc(var(--topbar-height) - 1.75px);
}
</style>