feat: 优化艺术品新建页子资源提示

This commit is contained in:
Nixevol
2026-07-04 06:41:53 +08:00
parent ad0f4a769f
commit e2b54a8027
4 changed files with 22 additions and 7 deletions
+17 -7
View File
@@ -115,17 +115,19 @@
</n-card>
</n-grid-item>
<template v-if="!isNew">
<!-- 溯源时间轴 -->
<n-grid-item>
<n-card :title="t('pages.artwork.nodes')" :bordered="false">
<template #header-extra>
<template v-if="!isNew" #header-extra>
<n-button v-if="auth.canWrite" size="small" type="primary" @click="openNode()">
<template #icon><n-icon :component="AddOutline" /></template>
{{ t('pages.artwork.addNode') }}
</n-button>
</template>
<n-empty v-if="!nodes.length" :description="t('common.msg.noData')" />
<n-empty v-if="isNew" class="locked-section" :description="t('pages.artwork.saveBeforeNodes')">
<template #icon><n-icon :component="LockClosedOutline" /></template>
</n-empty>
<n-empty v-else-if="!nodes.length" :description="t('common.msg.noData')" />
<n-timeline v-else>
<n-timeline-item v-for="n in nodes" :key="n.id" type="info" :title="n.title">
<template #header>
@@ -159,13 +161,16 @@
<!-- 认证文件 -->
<n-grid-item>
<n-card :title="t('pages.artwork.certificates')" :bordered="false">
<template #header-extra>
<template v-if="!isNew" #header-extra>
<n-button v-if="auth.canWrite" size="small" type="primary" @click="openCert()">
<template #icon><n-icon :component="AddOutline" /></template>
{{ t('pages.artwork.addCert') }}
</n-button>
</template>
<n-empty v-if="!certs.length" :description="t('common.msg.noData')" />
<n-empty v-if="isNew" class="locked-section" :description="t('pages.artwork.saveBeforeCertificates')">
<template #icon><n-icon :component="LockClosedOutline" /></template>
</n-empty>
<n-empty v-else-if="!certs.length" :description="t('common.msg.noData')" />
<n-grid v-else :cols="4" :x-gap="12" :y-gap="12" item-responsive responsive="screen">
<n-grid-item v-for="c in certs" :key="c.id" span="2 m:1">
<n-card size="small" :title="c.name">
@@ -185,7 +190,6 @@
</n-card>
</n-grid-item>
</template>
</n-grid>
<!-- 节点弹窗 -->
@@ -251,7 +255,7 @@ import { computed, h, onMounted, reactive, ref } from 'vue';
import { useRoute, useRouter } from 'vue-router';
import { useI18n } from 'vue-i18n';
import { NTag, type FormInst, type FormRules } from 'naive-ui';
import { ArrowBackOutline, AddOutline } from '@vicons/ionicons5';
import { ArrowBackOutline, AddOutline, LockClosedOutline } from '@vicons/ionicons5';
import { ArtworkStatus, CertType, NodeType } from '@artveris/shared';
import { artworkApi, templateApi } from '@/api';
import { useAuthStore } from '@/stores/auth';
@@ -507,4 +511,10 @@ onMounted(async () => {
color: #9ca3af;
background: #f4f7fc;
}
.locked-section {
padding: 28px 0;
border: 1px dashed var(--border-color);
border-radius: 8px;
background: var(--table-header-bg);
}
</style>