|
@@ -1,6 +1,7 @@
|
|
|
<script setup lang="ts">
|
|
<script setup lang="ts">
|
|
|
import dayjs from 'dayjs'
|
|
import dayjs from 'dayjs'
|
|
|
import { transportationMode } from '@/components/TransportationMode'
|
|
import { transportationMode } from '@/components/TransportationMode'
|
|
|
|
|
+import { useOverflow } from '@/hooks/useOverflow'
|
|
|
|
|
|
|
|
const props = defineProps({
|
|
const props = defineProps({
|
|
|
data: Object
|
|
data: Object
|
|
@@ -52,6 +53,16 @@ watch(
|
|
|
const formatDate = (date: string) => {
|
|
const formatDate = (date: string) => {
|
|
|
return date ? dayjs(date).format('MMM-DD-YYYY HH:mm A') : '--'
|
|
return date ? dayjs(date).format('MMM-DD-YYYY HH:mm A') : '--'
|
|
|
}
|
|
}
|
|
|
|
|
+
|
|
|
|
|
+const basicOriginRef = ref()
|
|
|
|
|
+const basicDestinationRef = ref()
|
|
|
|
|
+const detailOriginRef = ref()
|
|
|
|
|
+const detailDestinationRef = ref()
|
|
|
|
|
+
|
|
|
|
|
+const { isOverflow: isBasicOriginOverflow } = useOverflow(basicOriginRef, props)
|
|
|
|
|
+const { isOverflow: isBasicDestinationOverflow } = useOverflow(basicDestinationRef, props)
|
|
|
|
|
+const { isOverflow: isDetailOriginOverflow } = useOverflow(detailOriginRef, props)
|
|
|
|
|
+const { isOverflow: isDetailDestinationOverflow } = useOverflow(detailDestinationRef, props)
|
|
|
</script>
|
|
</script>
|
|
|
|
|
|
|
|
<template>
|
|
<template>
|
|
@@ -74,10 +85,15 @@ const formatDate = (date: string) => {
|
|
|
<div class="origin">
|
|
<div class="origin">
|
|
|
<div class="title">Origin</div>
|
|
<div class="title">Origin</div>
|
|
|
<div class="content">
|
|
<div class="content">
|
|
|
- <el-tooltip placement="top">
|
|
|
|
|
|
|
+ <el-tooltip v-if="isBasicOriginOverflow?.[index]" placement="top">
|
|
|
<template #content>{{ item.origin || '--' }}</template>
|
|
<template #content>{{ item.origin || '--' }}</template>
|
|
|
- <span class="single-line-ellipsis">{{ item.origin || '--' }}</span>
|
|
|
|
|
|
|
+ <span ref="basicOriginRef" class="single-line-ellipsis">{{
|
|
|
|
|
+ item.origin || '--'
|
|
|
|
|
+ }}</span>
|
|
|
</el-tooltip>
|
|
</el-tooltip>
|
|
|
|
|
+ <span v-else ref="basicOriginRef" class="single-line-ellipsis">{{
|
|
|
|
|
+ item.origin || '--'
|
|
|
|
|
+ }}</span>
|
|
|
|
|
|
|
|
<div class="line_container">
|
|
<div class="line_container">
|
|
|
<hr color="#000000" />
|
|
<hr color="#000000" />
|
|
@@ -87,10 +103,15 @@ const formatDate = (date: string) => {
|
|
|
</div>
|
|
</div>
|
|
|
<div class="destination" ref="">
|
|
<div class="destination" ref="">
|
|
|
<div class="title">Destination</div>
|
|
<div class="title">Destination</div>
|
|
|
- <el-tooltip placement="top">
|
|
|
|
|
|
|
+ <el-tooltip v-if="isBasicDestinationOverflow?.[index]" placement="top">
|
|
|
<template #content>{{ item.destination || '--' }}</template>
|
|
<template #content>{{ item.destination || '--' }}</template>
|
|
|
- <span class="content single-line-ellipsis">{{ item.destination || '--' }}</span>
|
|
|
|
|
|
|
+ <span ref="basicDestinationRef" class="content single-line-ellipsis">{{
|
|
|
|
|
+ item.destination || '--'
|
|
|
|
|
+ }}</span>
|
|
|
</el-tooltip>
|
|
</el-tooltip>
|
|
|
|
|
+ <span v-else ref="basicDestinationRef" class="content single-line-ellipsis">{{
|
|
|
|
|
+ item.destination || '--'
|
|
|
|
|
+ }}</span>
|
|
|
</div>
|
|
</div>
|
|
|
</div>
|
|
</div>
|
|
|
<div class="etd border-right">
|
|
<div class="etd border-right">
|
|
@@ -112,12 +133,18 @@ const formatDate = (date: string) => {
|
|
|
<div class="place">
|
|
<div class="place">
|
|
|
<span style="font-size: 24px" class="font_family icon-icon_location_fill_b"></span>
|
|
<span style="font-size: 24px" class="font_family icon-icon_location_fill_b"></span>
|
|
|
|
|
|
|
|
- <el-tooltip placement="top">
|
|
|
|
|
|
|
+ <el-tooltip v-if="isDetailOriginOverflow?.[index]" placement="top">
|
|
|
<template #content>{{ item.origin || '--' }}</template>
|
|
<template #content>{{ item.origin || '--' }}</template>
|
|
|
- <span class="label origin-label single-line-ellipsis">{{
|
|
|
|
|
|
|
+ <span ref="detailOriginRef" class="label origin-label single-line-ellipsis">{{
|
|
|
item.origin || '--'
|
|
item.origin || '--'
|
|
|
}}</span>
|
|
}}</span>
|
|
|
</el-tooltip>
|
|
</el-tooltip>
|
|
|
|
|
+ <span
|
|
|
|
|
+ v-else
|
|
|
|
|
+ ref="detailOriginRef"
|
|
|
|
|
+ class="label origin-label single-line-ellipsis"
|
|
|
|
|
+ >{{ item.origin || '--' }}</span
|
|
|
|
|
+ >
|
|
|
<div class="line_container">
|
|
<div class="line_container">
|
|
|
<hr color="#000000" />
|
|
<hr color="#000000" />
|
|
|
<div class="right-icon"></div>
|
|
<div class="right-icon"></div>
|
|
@@ -138,10 +165,15 @@ const formatDate = (date: string) => {
|
|
|
<div class="place">
|
|
<div class="place">
|
|
|
<span style="font-size: 24px" class="font_family icon-icon_location_fill_b"></span>
|
|
<span style="font-size: 24px" class="font_family icon-icon_location_fill_b"></span>
|
|
|
|
|
|
|
|
- <el-tooltip placement="top">
|
|
|
|
|
|
|
+ <el-tooltip v-if="isDetailDestinationOverflow?.[index]" placement="top">
|
|
|
<template #content>{{ item.destination || '--' }}</template>
|
|
<template #content>{{ item.destination || '--' }}</template>
|
|
|
- <span class="label single-line-ellipsis">{{ item.destination || '--' }}</span>
|
|
|
|
|
|
|
+ <span ref="detailDestinationRef" class="label single-line-ellipsis">{{
|
|
|
|
|
+ item.destination || '--'
|
|
|
|
|
+ }}</span>
|
|
|
</el-tooltip>
|
|
</el-tooltip>
|
|
|
|
|
+ <span v-else ref="detailDestinationRef" class="label single-line-ellipsis">{{
|
|
|
|
|
+ item.destination || '--'
|
|
|
|
|
+ }}</span>
|
|
|
</div>
|
|
</div>
|
|
|
<div class="eta">
|
|
<div class="eta">
|
|
|
<span class="font_family icon-icon_date_b"></span>
|
|
<span class="font_family icon-icon_date_b"></span>
|
|
@@ -226,15 +258,14 @@ const formatDate = (date: string) => {
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
.destination {
|
|
.destination {
|
|
|
- max-width: calc(40% - 16px);
|
|
|
|
|
- display: flex;
|
|
|
|
|
- flex-direction: column;
|
|
|
|
|
- justify-content: space-between;
|
|
|
|
|
|
|
+ max-width: 40%;
|
|
|
margin-left: 16px;
|
|
margin-left: 16px;
|
|
|
- & > div.content {
|
|
|
|
|
- display: inline-block;
|
|
|
|
|
|
|
+ & > .content {
|
|
|
width: 100%;
|
|
width: 100%;
|
|
|
- overflow: hidden;
|
|
|
|
|
|
|
+ margin-top: 8px;
|
|
|
|
|
+ padding-top: 2px;
|
|
|
|
|
+ font-size: 18px;
|
|
|
|
|
+ font-weight: 700;
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
.place {
|
|
.place {
|
|
@@ -248,9 +279,10 @@ const formatDate = (date: string) => {
|
|
|
margin-top: 2px;
|
|
margin-top: 2px;
|
|
|
}
|
|
}
|
|
|
.origin {
|
|
.origin {
|
|
|
- width: 60%;
|
|
|
|
|
|
|
+ width: calc(60% - 16px);
|
|
|
}
|
|
}
|
|
|
-
|
|
|
|
|
|
|
+ }
|
|
|
|
|
+ .origin {
|
|
|
.content {
|
|
.content {
|
|
|
position: relative;
|
|
position: relative;
|
|
|
display: flex;
|
|
display: flex;
|