refactor: 拆分档案详情与追溯码管理
This commit is contained in:
@@ -185,20 +185,6 @@
|
||||
</n-card>
|
||||
</n-grid-item>
|
||||
|
||||
<!-- 批次与追溯码:每件实物一码 -->
|
||||
<n-grid-item>
|
||||
<n-card :title="t('pages.artwork.traceCodes')" :bordered="false">
|
||||
<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>
|
||||
<div class="trace-panel-wrap">
|
||||
<trace-code-panel :artwork-id="artworkId" embedded />
|
||||
</div>
|
||||
</n-card>
|
||||
</n-grid-item>
|
||||
</template>
|
||||
</n-grid>
|
||||
|
||||
@@ -271,7 +257,6 @@ import { artworkApi, templateApi } from '@/api';
|
||||
import { useAuthStore } from '@/stores/auth';
|
||||
import MediaUpload from '@/components/MediaUpload.vue';
|
||||
import MediaSorter from '@/components/MediaSorter.vue';
|
||||
import TraceCodePanel from '@/components/TraceCodePanel.vue';
|
||||
import { message, dialog } from '@/utils/feedback';
|
||||
import { fmtDate } from '@/utils/format';
|
||||
|
||||
@@ -490,9 +475,6 @@ onMounted(async () => {
|
||||
.mr8 {
|
||||
margin-right: 8px;
|
||||
}
|
||||
.trace-panel-wrap {
|
||||
margin-top: 14px;
|
||||
}
|
||||
.node-head {
|
||||
display: flex;
|
||||
justify-content: space-between;
|
||||
|
||||
@@ -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>
|
||||
@@ -44,7 +44,7 @@ import { h, onMounted, reactive, ref } from 'vue';
|
||||
import { useRouter } from 'vue-router';
|
||||
import { useI18n } from 'vue-i18n';
|
||||
import { NButton, NIcon, NTag, NAvatar, type DataTableColumns } from 'naive-ui';
|
||||
import { SearchOutline, AddOutline, CreateOutline } from '@vicons/ionicons5';
|
||||
import { SearchOutline, AddOutline, CreateOutline, BarChartOutline } from '@vicons/ionicons5';
|
||||
import { ArtworkStatus } from '@artveris/shared';
|
||||
import { artworkApi } from '@/api';
|
||||
import { useAuthStore } from '@/stores/auth';
|
||||
@@ -102,13 +102,32 @@ const columns: DataTableColumns<any> = [
|
||||
{
|
||||
title: () => t('common.label.operation'),
|
||||
key: 'ops',
|
||||
width: 90,
|
||||
width: 112,
|
||||
render: (r) =>
|
||||
h(
|
||||
NButton,
|
||||
{ quaternary: true, circle: true, size: 'small', onClick: () => router.push(`/artworks/${r.id}`) },
|
||||
{ icon: () => h(NIcon, null, { default: () => h(CreateOutline) }) },
|
||||
),
|
||||
h('div', { class: 'row-actions' }, [
|
||||
h(
|
||||
NButton,
|
||||
{
|
||||
quaternary: true,
|
||||
circle: true,
|
||||
size: 'small',
|
||||
title: t('pages.artwork.editDetail'),
|
||||
onClick: () => router.push(`/artworks/${r.id}`),
|
||||
},
|
||||
{ icon: () => h(NIcon, null, { default: () => h(CreateOutline) }) },
|
||||
),
|
||||
h(
|
||||
NButton,
|
||||
{
|
||||
quaternary: true,
|
||||
circle: true,
|
||||
size: 'small',
|
||||
title: t('pages.artwork.dataManage'),
|
||||
onClick: () => router.push(`/artworks/${r.id}/trace-codes`),
|
||||
},
|
||||
{ icon: () => h(NIcon, null, { default: () => h(BarChartOutline) }) },
|
||||
),
|
||||
]),
|
||||
},
|
||||
];
|
||||
|
||||
@@ -142,3 +161,11 @@ function goCreate() {
|
||||
|
||||
onMounted(load);
|
||||
</script>
|
||||
|
||||
<style scoped>
|
||||
.row-actions {
|
||||
display: inline-flex;
|
||||
align-items: center;
|
||||
gap: 6px;
|
||||
}
|
||||
</style>
|
||||
|
||||
Reference in New Issue
Block a user