fix(admin): preserve tail-leg references
This commit is contained in:
@@ -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>
|
||||
|
||||
Reference in New Issue
Block a user