feat: 优化艺术品新建页子资源提示
This commit is contained in:
@@ -104,6 +104,7 @@
|
||||
- 上链录入弱化区块高度(2026-07-04):原版 PRD 要求 C 端可展示区块高度,但后台运营手工录入时不应把它作为重点字段。追溯码管理的“登记出库/上链”弹窗和 `Outbound.vue` 单条录入页默认只展示交易/存证哈希与上链时间,区块高度收进“更多上链信息”折叠项,仍作为可选字段保存到 `BlockchainProof.blockHeight`。
|
||||
- 单件出库记录进入 C 端时间轴(2026-07-04):出库实况图/出库时间是 `TraceCode` 单件实物级数据,档案时间轴节点是 `Artwork.traceNodes` 档案级数据,二者不再依赖同一条手工节点。`PublicTraceService.trace` 在公开溯源返回时,如果当前追溯码存在 `outTime` 或 `outImage`,会自动在 `timeline` 末尾追加“本件出库记录”节点(`nodeType=OUTBOUND`,媒体来自 `TraceCode.outImage`),因此即使后台删除档案级“出库/流转”时间轴节点,C 端仍能展示该实物自己的出库记录。`AttestationService.trigger` 的上链摘要同步纳入 `batchNo`、`outTime`、`outImage`,保证触发上链时单件出库记录参与存证摘要。
|
||||
- 后端开发模式编译修复(2026-07-04):`apps/api/tsconfig.json` 禁用 `incremental`。原因是 `nest start --watch` 运行时依赖 `apps/api/dist`,如果开发服务运行中清理或部分删除了 `dist`,TS 增量编译可能只补变化文件,不会完整重吐未变化文件,导致运行时报 `Cannot find module './config/configuration'` 之类缺模块错误。后续清理构建产物时不要在 `dev.py` 运行中删除 API 的 `dist`;需要清理时先停开发服务再全量重启。
|
||||
- 艺术品新建页子资源提示(2026-07-04):艺术品档案新建时仍先保存基础信息以获得 `artworkId`,溯源时间轴与认证文件是挂在作品下的子资源,必须在作品存在后维护。后台 `ArtworkEdit.vue` 新建态不再隐藏这两个区块,而是显示锁定空状态,提示保存基础信息后可维护;保存后自动跳转详情页并启用原有节点/认证文件管理。
|
||||
|
||||
## 当前代码基准与注意事项
|
||||
|
||||
|
||||
@@ -209,6 +209,8 @@
|
||||
"dynamicFields": "Fields",
|
||||
"nodes": "Timeline",
|
||||
"certificates": "Certificates",
|
||||
"saveBeforeNodes": "Save basic info before editing the timeline",
|
||||
"saveBeforeCertificates": "Save basic info before uploading certificates",
|
||||
"traceCode": "Trace Code",
|
||||
"status": "Status",
|
||||
"create": "New Artwork",
|
||||
|
||||
@@ -209,6 +209,8 @@
|
||||
"dynamicFields": "动态字段",
|
||||
"nodes": "溯源时间轴",
|
||||
"certificates": "认证文件",
|
||||
"saveBeforeNodes": "保存基础信息后可维护溯源时间轴",
|
||||
"saveBeforeCertificates": "保存基础信息后可上传认证文件",
|
||||
"traceCode": "追溯码",
|
||||
"status": "状态",
|
||||
"create": "新建作品",
|
||||
|
||||
@@ -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>
|
||||
|
||||
Reference in New Issue
Block a user