refactor: 拆分档案详情与追溯码管理
This commit is contained in:
@@ -0,0 +1,75 @@
|
||||
<template>
|
||||
<div class="page">
|
||||
<div class="page-toolbar">
|
||||
<n-button quaternary @click="router.back()">
|
||||
<template #icon><n-icon :component="ArrowBackOutline" /></template>
|
||||
{{ t('common.action.back') }}
|
||||
</n-button>
|
||||
<div class="page-title">{{ t('pages.artwork.traceCodeManage') }}</div>
|
||||
</div>
|
||||
|
||||
<n-card :bordered="false" class="summary-card">
|
||||
<template #header>
|
||||
<div class="summary-title">
|
||||
<span>{{ artwork?.title || '-' }}</span>
|
||||
<n-tag v-if="artwork?.auditStatus" size="small" :type="auditTagType(artwork.auditStatus)">
|
||||
{{ t(`common.auditStatus.${artwork.auditStatus}`) }}
|
||||
</n-tag>
|
||||
</div>
|
||||
</template>
|
||||
<n-descriptions :column="4" label-placement="top" bordered size="small">
|
||||
<n-descriptions-item :label="t('pages.artwork.archiveNo')">{{ artwork?.archiveNo || '-' }}</n-descriptions-item>
|
||||
<n-descriptions-item :label="t('pages.artwork.codeCount')">{{ artwork?.codeStats?.total ?? 0 }}</n-descriptions-item>
|
||||
<n-descriptions-item :label="t('pages.artwork.activeCount')">{{ artwork?.codeStats?.active ?? 0 }}</n-descriptions-item>
|
||||
<n-descriptions-item :label="t('pages.artwork.queryTotal')">{{ artwork?.codeStats?.queryTotal ?? 0 }}</n-descriptions-item>
|
||||
</n-descriptions>
|
||||
</n-card>
|
||||
|
||||
<n-card :title="t('pages.artwork.traceCodes')" :bordered="false">
|
||||
<trace-code-panel :artwork-id="artworkId" />
|
||||
</n-card>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script setup lang="ts">
|
||||
import { computed, onMounted, ref } from 'vue';
|
||||
import { useRoute, useRouter } from 'vue-router';
|
||||
import { useI18n } from 'vue-i18n';
|
||||
import { NIcon } from 'naive-ui';
|
||||
import { ArrowBackOutline } from '@vicons/ionicons5';
|
||||
import { artworkApi } from '@/api';
|
||||
import TraceCodePanel from '@/components/TraceCodePanel.vue';
|
||||
|
||||
const route = useRoute();
|
||||
const router = useRouter();
|
||||
const { t } = useI18n();
|
||||
|
||||
const artworkId = computed(() => Number(route.params.id));
|
||||
const artwork = ref<any>(null);
|
||||
|
||||
function auditTagType(s?: string) {
|
||||
return s === 'APPROVED' ? 'success' : s === 'REJECTED' ? 'error' : 'warning';
|
||||
}
|
||||
|
||||
async function loadArtwork() {
|
||||
artwork.value = await artworkApi.get(artworkId.value);
|
||||
}
|
||||
|
||||
onMounted(loadArtwork);
|
||||
</script>
|
||||
|
||||
<style scoped>
|
||||
.page-title {
|
||||
font-size: 16px;
|
||||
font-weight: 600;
|
||||
}
|
||||
.summary-card {
|
||||
margin-bottom: 16px;
|
||||
}
|
||||
.summary-title {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
gap: 10px;
|
||||
min-width: 0;
|
||||
}
|
||||
</style>
|
||||
Reference in New Issue
Block a user