fix(admin): preserve tail-leg references

This commit is contained in:
2026-09-01 11:03:45 +08:00
parent 0cf4a93f9c
commit 4711bcc4e6
10 changed files with 80 additions and 16 deletions
@@ -1,10 +1,13 @@
<script setup lang="ts">
import { computed } from 'vue'
import CopyButton from '@/shared/components/CopyButton.vue'
const props = withDefaults(defineProps<{
value?: string | null
emptyText?: string
}>(), { value: null, emptyText: '—' })
copyable?: boolean
copyLabel?: string
}>(), { value: null, emptyText: '—', copyable: false, copyLabel: '尾程单号' })
const displayValue = computed(() => {
const value = String(props.value ?? '')
@@ -15,16 +18,23 @@ const fullTitle = computed(() => displayValue.value === props.emptyText ? undefi
</script>
<template>
<span class="order-reference-text" :title="fullTitle">{{ displayValue }}</span>
<span class="order-reference-text" :title="fullTitle"><span class="order-reference-text__value">{{ displayValue }}</span><CopyButton v-if="copyable && fullTitle" class="order-reference-text__copy" :value="displayValue" :label="copyLabel" button-text="" /></span>
</template>
<style scoped>
.order-reference-text {
display: inline-block;
display: inline-flex;
min-width: 0;
align-items: center;
gap: 4px;
max-width: 100%;
vertical-align: bottom;
}
.order-reference-text__value {
min-width: 0;
overflow: hidden;
text-overflow: ellipsis;
vertical-align: bottom;
white-space: nowrap;
}
.order-reference-text__copy { flex: 0 0 auto; margin: 0; padding-inline: 6px; }
</style>