style: 出库上链弹窗打磨(出库时间红星必填/修复关闭按钮翻译/上链信息标签不换行居中+复制按钮)
This commit is contained in:
@@ -147,7 +147,7 @@
|
||||
<n-modal v-model:show="outboundModal" preset="card" :title="outboundModalTitle" style="width: 620px">
|
||||
<n-form :model="outboundForm" label-placement="top">
|
||||
<n-grid :cols="2" :x-gap="16">
|
||||
<n-form-item-gi :label="t('pages.outbound.outTime')">
|
||||
<n-form-item-gi :label="t('pages.outbound.outTime')" :required="!outboundReadonly">
|
||||
<n-date-picker v-if="!outboundReadonly" v-model:formatted-value="outboundForm.outTime" value-format="yyyy-MM-dd HH:mm" type="datetime" clearable style="width: 100%" />
|
||||
<n-text v-else>{{ outboundForm.outTime || '-' }}</n-text>
|
||||
</n-form-item-gi>
|
||||
@@ -163,30 +163,51 @@
|
||||
|
||||
<template v-if="targetOnchain && targetProof">
|
||||
<n-divider style="margin: 4px 0 12px">{{ t('pages.blockchain.title') }}</n-divider>
|
||||
<n-descriptions :column="1" label-placement="left" size="small" bordered>
|
||||
<n-descriptions
|
||||
:column="1"
|
||||
label-placement="left"
|
||||
size="small"
|
||||
bordered
|
||||
:label-style="{ whiteSpace: 'nowrap', verticalAlign: 'middle' }"
|
||||
:content-style="{ verticalAlign: 'middle' }"
|
||||
>
|
||||
<n-descriptions-item :label="t('pages.blockchain.status')">
|
||||
<n-tag size="small" :type="proofStatusType(targetProof)">{{ proofStatusText(targetProof) }}</n-tag>
|
||||
</n-descriptions-item>
|
||||
<n-descriptions-item v-if="targetProof.dataHash" :label="t('pages.blockchain.dataHash')">
|
||||
<span class="onchain-mono">{{ targetProof.dataHash }}</span>
|
||||
<span class="onchain-val"><span class="onchain-mono">{{ targetProof.dataHash }}</span>
|
||||
<n-button quaternary circle size="tiny" :title="t('common.action.copy')" @click="copyValue(targetProof.dataHash)"><template #icon><n-icon :component="CopyOutline" /></template></n-button>
|
||||
</span>
|
||||
</n-descriptions-item>
|
||||
<n-descriptions-item v-if="targetProof.txHash" :label="t('pages.blockchain.txHash')">
|
||||
<span class="onchain-mono">{{ targetProof.txHash }}</span>
|
||||
<span class="onchain-val"><span class="onchain-mono">{{ targetProof.txHash }}</span>
|
||||
<n-button quaternary circle size="tiny" :title="t('common.action.copy')" @click="copyValue(targetProof.txHash)"><template #icon><n-icon :component="CopyOutline" /></template></n-button>
|
||||
</span>
|
||||
</n-descriptions-item>
|
||||
<n-descriptions-item v-if="targetProof.tokenId" :label="t('pages.blockchain.tokenId')">
|
||||
<span class="onchain-mono">{{ targetProof.tokenId }}</span>
|
||||
<n-descriptions-item v-if="targetProof.tokenId !== null && targetProof.tokenId !== undefined" :label="t('pages.blockchain.tokenId')">
|
||||
<span class="onchain-val"><span class="onchain-mono">{{ targetProof.tokenId }}</span>
|
||||
<n-button quaternary circle size="tiny" :title="t('common.action.copy')" @click="copyValue(targetProof.tokenId)"><template #icon><n-icon :component="CopyOutline" /></template></n-button>
|
||||
</span>
|
||||
</n-descriptions-item>
|
||||
<n-descriptions-item v-if="targetProof.contractAddress" :label="t('pages.blockchain.contract')">
|
||||
<span class="onchain-mono">{{ targetProof.contractAddress }}</span>
|
||||
<span class="onchain-val"><span class="onchain-mono">{{ targetProof.contractAddress }}</span>
|
||||
<n-button quaternary circle size="tiny" :title="t('common.action.copy')" @click="copyValue(targetProof.contractAddress)"><template #icon><n-icon :component="CopyOutline" /></template></n-button>
|
||||
</span>
|
||||
</n-descriptions-item>
|
||||
<n-descriptions-item v-if="targetProof.blockHeight" :label="t('pages.blockchain.blockHeight')">
|
||||
{{ targetProof.blockHeight }}
|
||||
<span class="onchain-val"><span>{{ targetProof.blockHeight }}</span>
|
||||
<n-button quaternary circle size="tiny" :title="t('common.action.copy')" @click="copyValue(targetProof.blockHeight)"><template #icon><n-icon :component="CopyOutline" /></template></n-button>
|
||||
</span>
|
||||
</n-descriptions-item>
|
||||
<n-descriptions-item v-if="targetProof.onchainAt" :label="t('pages.blockchain.onchainAt')">
|
||||
{{ fmt(targetProof.onchainAt) }}
|
||||
<span class="onchain-val"><span>{{ fmt(targetProof.onchainAt) }}</span>
|
||||
<n-button quaternary circle size="tiny" :title="t('common.action.copy')" @click="copyValue(fmt(targetProof.onchainAt))"><template #icon><n-icon :component="CopyOutline" /></template></n-button>
|
||||
</span>
|
||||
</n-descriptions-item>
|
||||
<n-descriptions-item v-if="targetProof.explorerUrl" :label="t('pages.blockchain.explorer')">
|
||||
<a :href="targetProof.explorerUrl" target="_blank" rel="noopener" style="color: var(--brand)">{{ targetProof.explorerUrl }}</a>
|
||||
<span class="onchain-val"><a :href="targetProof.explorerUrl" target="_blank" rel="noopener" class="onchain-mono" style="color: var(--brand)">{{ targetProof.explorerUrl }}</a>
|
||||
<n-button quaternary circle size="tiny" :title="t('common.action.copy')" @click="copyValue(targetProof.explorerUrl)"><template #icon><n-icon :component="CopyOutline" /></template></n-button>
|
||||
</span>
|
||||
</n-descriptions-item>
|
||||
</n-descriptions>
|
||||
</template>
|
||||
@@ -217,7 +238,7 @@ import { computed, h, onMounted, onUnmounted, reactive, ref, watch } from 'vue';
|
||||
import { useRoute } from 'vue-router';
|
||||
import { useI18n } from 'vue-i18n';
|
||||
import { NButton, NDropdown, NIcon, NTag, NText, type DataTableColumns, type DropdownOption } from 'naive-ui';
|
||||
import { SearchOutline, AddOutline, DownloadOutline, QrCodeOutline, FolderOutline, OpenOutline, EllipsisHorizontalOutline, FilterOutline } from '@vicons/ionicons5';
|
||||
import { SearchOutline, AddOutline, DownloadOutline, QrCodeOutline, FolderOutline, OpenOutline, EllipsisHorizontalOutline, FilterOutline, CopyOutline } from '@vicons/ionicons5';
|
||||
import dayjs from 'dayjs';
|
||||
import { TraceCodeStatus } from '@artveris/shared';
|
||||
import { traceCodeApi, jobApi, artworkApi, outboundApi } from '@/api';
|
||||
@@ -819,6 +840,17 @@ function getOutImages(row: any) {
|
||||
);
|
||||
}
|
||||
|
||||
async function copyValue(value: unknown) {
|
||||
const text = value === null || value === undefined ? '' : String(value);
|
||||
if (!text) return;
|
||||
try {
|
||||
await navigator.clipboard.writeText(text);
|
||||
message.success(t('common.msg.copied'));
|
||||
} catch {
|
||||
message.error(t('common.msg.copyFailed'));
|
||||
}
|
||||
}
|
||||
|
||||
function openOutboundModal(row: any) {
|
||||
outboundTarget.value = row;
|
||||
// 出库时间必填:未出库时默认此刻;已出库时回显既有时间(只读)
|
||||
@@ -1018,6 +1050,18 @@ onUnmounted(() => {
|
||||
font-size: 12px;
|
||||
word-break: break-all;
|
||||
}
|
||||
.onchain-val {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
gap: 6px;
|
||||
}
|
||||
.onchain-val > :first-child {
|
||||
flex: 1;
|
||||
min-width: 0;
|
||||
}
|
||||
.onchain-val .n-button {
|
||||
flex: 0 0 auto;
|
||||
}
|
||||
@media (max-width: 720px) {
|
||||
.toolbar-control,
|
||||
.toolbar-control.wide,
|
||||
|
||||
@@ -23,6 +23,7 @@
|
||||
"unbind": "Unbind",
|
||||
"retry": "Retry",
|
||||
"copy": "Copy",
|
||||
"close": "Close",
|
||||
"onchain": "On-chain",
|
||||
"qrcode": "QR Code",
|
||||
"manage": "Manage",
|
||||
@@ -116,6 +117,7 @@
|
||||
"created": "Created",
|
||||
"updated": "Updated",
|
||||
"copied": "Copied",
|
||||
"copyFailed": "Copy failed",
|
||||
"operationSuccess": "Success",
|
||||
"loginExpired": "Session expired, please log in again",
|
||||
"networkError": "Network error, please try again",
|
||||
|
||||
@@ -23,6 +23,7 @@
|
||||
"unbind": "解绑",
|
||||
"retry": "重试",
|
||||
"copy": "复制",
|
||||
"close": "关闭",
|
||||
"onchain": "上链存证",
|
||||
"qrcode": "二维码",
|
||||
"manage": "管理",
|
||||
@@ -116,6 +117,7 @@
|
||||
"created": "创建成功",
|
||||
"updated": "更新成功",
|
||||
"copied": "已复制",
|
||||
"copyFailed": "复制失败",
|
||||
"operationSuccess": "操作成功",
|
||||
"loginExpired": "登录已过期,请重新登录",
|
||||
"networkError": "网络异常,请稍后再试",
|
||||
|
||||
Reference in New Issue
Block a user