style: 追溯码名称/档案编号锚点样式修复并支持点击出库/上链状态进详情

This commit is contained in:
Nixevol
2026-07-12 23:36:25 +08:00
parent c1d8fb9ca4
commit 0bea65aa47
2 changed files with 35 additions and 11 deletions
+34 -11
View File
@@ -221,7 +221,8 @@
<n-button class="mr8" @click="outboundModal = false">
{{ targetOnchain ? t('common.action.close') : t('common.action.cancel') }}
</n-button>
<template v-if="!targetOnchain">
<!-- 只读角色(无写权限)从状态列点开时仅可查看,隐藏保存/触发按钮 -->
<template v-if="!targetOnchain && auth.canWrite">
<n-button v-if="!targetOutbound" class="mr8" :loading="outboundSaving" @click="saveOutbound(false)">{{ t('pages.outbound.saveRecord') }}</n-button>
<n-button type="primary" :loading="outboundTriggering" @click="saveOutbound(true)">
{{ targetOutbound ? t('pages.blockchain.trigger') : t('pages.outbound.saveAndTriggerOnchain') }}
@@ -425,7 +426,7 @@ const columns = computed<DataTableColumns<any>>(() => {
align: 'center',
render: (r) => r.group?.name || h(NText, { depth: 3 }, { default: () => t('pages.traceCode.noGroup') }),
},
// 出库状态
// 出库状态:点击打开该行「出库上链」详情弹窗(弹窗按状态自动呈现登记/上链/只读信息形态)
{
title: () =>
renderFilterTitle(t('pages.traceCode.outboundStatus'), query.outboundStatus, outboundStatusOptions.value, (value) =>
@@ -435,20 +436,32 @@ const columns = computed<DataTableColumns<any>>(() => {
width: 124,
align: 'center',
render: (r) =>
r.outTime || getOutImages(r).length
? h(NTag, { size: 'small', type: 'success' }, { default: () => t('pages.traceCode.outRegistered') })
: h(NText, { depth: 3 }, { default: () => t('pages.traceCode.notOutbound') }),
h(
'span',
{ class: 'cell-click', title: outboundMenuLabel(r), onClick: () => openOutboundModal(r) },
[
r.outTime || getOutImages(r).length
? h(NTag, { size: 'small', type: 'success' }, { default: () => t('pages.traceCode.outRegistered') })
: h(NText, { depth: 3 }, { default: () => t('pages.traceCode.notOutbound') }),
],
),
},
// 上链状态
// 上链状态:同上,点击进详情弹窗
{
title: () => t('pages.traceCode.onchainStatus'),
key: 'onchainStatus',
width: 112,
align: 'center',
render: (r) =>
r.latestAnyProof
? h(NTag, { size: 'small', type: proofStatusType(r.latestAnyProof) }, { default: () => proofStatusText(r.latestAnyProof) })
: h(NText, { depth: 3 }, { default: () => t('pages.traceCode.noOnchain') }),
h(
'span',
{ class: 'cell-click', title: outboundMenuLabel(r), onClick: () => openOutboundModal(r) },
[
r.latestAnyProof
? h(NTag, { size: 'small', type: proofStatusType(r.latestAnyProof) }, { default: () => proofStatusText(r.latestAnyProof) })
: h(NText, { depth: 3 }, { default: () => t('pages.traceCode.noOnchain') }),
],
),
},
// 出库时间
{ title: () => t('pages.outbound.outTime'), key: 'outTime', width: 150, align: 'center', render: (r) => fmt(r.outTime), ...sortProps('outTime') },
@@ -1165,14 +1178,24 @@ onUnmounted(() => {
.onchain-tip {
margin-top: 4px;
}
.cell-link {
/* 表格单元格由 n-data-table 子组件渲染,不带本组件 scope 属性,必须用 :deep() 才能命中 */
:deep(.cell-link) {
color: var(--brand);
cursor: pointer;
text-decoration: none;
}
.cell-link:hover {
:deep(.cell-link:hover) {
text-decoration: underline;
}
/* 状态列可点击:悬停轻微提亮提示可点 */
:deep(.cell-click) {
cursor: pointer;
display: inline-flex;
align-items: center;
}
:deep(.cell-click:hover) {
opacity: 0.75;
}
.onchain-mono {
font-family: 'JetBrains Mono', Consolas, monospace;
font-size: 12px;