|
|
@@ -16,196 +16,8 @@ import { useOverflow } from '@/hooks/useOverflow'
|
|
|
import { formatTimezone } from '@/utils/tools'
|
|
|
import { useThemeStore } from '@/stores/modules/theme'
|
|
|
import ShareLinkDialog from './components/ShareLinkDialog.vue'
|
|
|
-import { useDriver } from '@/utils/driverGuide'
|
|
|
-
|
|
|
-// import { driver } from 'driver.js'
|
|
|
-
|
|
|
-const oceanSteps: any = [
|
|
|
- {
|
|
|
- element: '#driver-step-tracking-detail-1',
|
|
|
- popover: {
|
|
|
- title: '',
|
|
|
- description: 'Main operation button area',
|
|
|
- side: 'bottom',
|
|
|
- align: 'start'
|
|
|
- }
|
|
|
- },
|
|
|
- {
|
|
|
- element: '#driver-step-tracking-detail-2',
|
|
|
- popover: {
|
|
|
- description: 'Key shipment status',
|
|
|
- side: 'bottom',
|
|
|
- align: 'start'
|
|
|
- }
|
|
|
- },
|
|
|
- {
|
|
|
- element: '#driver-step-tracking-detail-3',
|
|
|
- popover: {
|
|
|
- description: 'Detail container status of each container',
|
|
|
- side: 'bottom',
|
|
|
- align: 'start'
|
|
|
- }
|
|
|
- },
|
|
|
- {
|
|
|
- element: '#tracking-map',
|
|
|
- popover: {
|
|
|
- description: `
|
|
|
- <ul>
|
|
|
- <li>Actual Line(Actual Trajectory)</li>
|
|
|
- <li>Virtual Line(Planned Trajectory)</li>
|
|
|
- <li>Arrow (Current Real-time Position)</li>
|
|
|
- </ol>
|
|
|
- `,
|
|
|
- side: 'bottom',
|
|
|
- align: 'start'
|
|
|
- }
|
|
|
- },
|
|
|
- {
|
|
|
- element: '#driver-step-tracking-detail-5',
|
|
|
- popover: {
|
|
|
- description: `
|
|
|
- <ul>
|
|
|
- <li>Upload Files</li>
|
|
|
- <li>Clickable download icons to download files</li>
|
|
|
- </ol>
|
|
|
- `,
|
|
|
- side: 'bottom',
|
|
|
- align: 'start'
|
|
|
- }
|
|
|
- },
|
|
|
- {
|
|
|
- element: '#driver-step-tracking-detail-6',
|
|
|
- popover: {
|
|
|
- description: `
|
|
|
- <p>Send email to site staff</p>
|
|
|
- <p>Enter contents you want to communicate with, click “Send
|
|
|
- Email” button to send out.
|
|
|
- </p>
|
|
|
- `,
|
|
|
- side: 'bottom',
|
|
|
- align: 'start'
|
|
|
- }
|
|
|
- },
|
|
|
- {
|
|
|
- element: '#page-guide-btn-guide',
|
|
|
- popover: {
|
|
|
- title: '',
|
|
|
- description:
|
|
|
- 'After closing, you can still click the "page guide" button to view the page guide of the current page.',
|
|
|
- side: 'bottom'
|
|
|
- }
|
|
|
- }
|
|
|
-]
|
|
|
-const airSteps: any = [
|
|
|
- {
|
|
|
- element: '#driver-step-tracking-detail-1',
|
|
|
- popover: {
|
|
|
- title: '',
|
|
|
- description: 'Main operation button area',
|
|
|
- side: 'bottom',
|
|
|
- align: 'start'
|
|
|
- }
|
|
|
- },
|
|
|
- {
|
|
|
- element: '#driver-step-tracking-detail-2',
|
|
|
- popover: {
|
|
|
- description: 'Key shipment status',
|
|
|
- side: 'bottom',
|
|
|
- align: 'start'
|
|
|
- }
|
|
|
- },
|
|
|
- {
|
|
|
- element: '#tracking-map',
|
|
|
- popover: {
|
|
|
- description: `
|
|
|
- <ul>
|
|
|
- <li>Actual Line(Actual Trajectory)</li>
|
|
|
- <li>Virtual Line(Planned Trajectory)</li>
|
|
|
- <li>Arrow (Current Real-time Position)</li>
|
|
|
- </ol>
|
|
|
- `,
|
|
|
- side: 'bottom',
|
|
|
- align: 'start'
|
|
|
- }
|
|
|
- },
|
|
|
- {
|
|
|
- element: '#driver-step-tracking-detail-5',
|
|
|
- popover: {
|
|
|
- description: `
|
|
|
- <ul>
|
|
|
- <li>Upload Files</li>
|
|
|
- <li>Clickable download icons to download files</li>
|
|
|
- </ol>
|
|
|
- `,
|
|
|
- side: 'bottom',
|
|
|
- align: 'start'
|
|
|
- }
|
|
|
- },
|
|
|
- {
|
|
|
- element: '#driver-step-tracking-detail-6',
|
|
|
- popover: {
|
|
|
- description: `
|
|
|
- <p>Send email to site staff</p>
|
|
|
- <p>Enter contents you want to communicate with, click “Send
|
|
|
- Email” button to send out.
|
|
|
- </p>
|
|
|
- `,
|
|
|
- side: 'bottom',
|
|
|
- align: 'start'
|
|
|
- }
|
|
|
- },
|
|
|
- {
|
|
|
- element: '#page-guide-btn-guide',
|
|
|
- popover: {
|
|
|
- title: '',
|
|
|
- description:
|
|
|
- 'After closing, you can still click the "page guide" button to view the page guide of the current page.',
|
|
|
- side: 'bottom'
|
|
|
- }
|
|
|
- }
|
|
|
-]
|
|
|
-
|
|
|
-const guideTimer = ref<ReturnType<typeof setTimeout> | null>(null)
|
|
|
-const handleGuide = () => {
|
|
|
- let steps = []
|
|
|
- if (allData.value?.transportInfo?.mode === 'Ocean Freight') {
|
|
|
- steps = oceanSteps
|
|
|
- } else if (allData.value?.transportInfo?.mode === 'Air Freight') {
|
|
|
- steps = airSteps
|
|
|
- } else {
|
|
|
- return
|
|
|
- }
|
|
|
- const { start, movePrevious, hasNextStep, moveTo, destroy } = useDriver(steps, {
|
|
|
- onPrevClick: () => {
|
|
|
- if (guideTimer.value) {
|
|
|
- clearTimeout(guideTimer.value)
|
|
|
- guideTimer.value = null
|
|
|
- }
|
|
|
- movePrevious()
|
|
|
- },
|
|
|
- onHighlightStarted: () => {
|
|
|
- if (!hasNextStep()) {
|
|
|
- guideTimer.value = setTimeout(() => {
|
|
|
- destroy()
|
|
|
- }, 3000)
|
|
|
- }
|
|
|
- },
|
|
|
- onDestroyStarted: (element, step, options) => {
|
|
|
- if (hasNextStep()) {
|
|
|
- moveTo(options.config.steps.length - 1)
|
|
|
- return
|
|
|
- }
|
|
|
- destroy()
|
|
|
- },
|
|
|
- onDestroyed: () => {
|
|
|
- if (guideTimer.value) {
|
|
|
- clearTimeout(guideTimer.value)
|
|
|
- guideTimer.value = null
|
|
|
- }
|
|
|
- }
|
|
|
- })
|
|
|
- start() // 开始引导
|
|
|
-}
|
|
|
+import { useGuideStore } from '@/stores/modules/guide'
|
|
|
+const guideStore = useGuideStore()
|
|
|
|
|
|
const route = useRoute()
|
|
|
|
|
|
@@ -288,6 +100,7 @@ const getData = () => {
|
|
|
if (res.code === 200) {
|
|
|
// 获取数据
|
|
|
allData.value = res.data
|
|
|
+ guideStore.trackingDetail.mode = allData.value?.transportInfo?.mode || 'Ocean Freight'
|
|
|
}
|
|
|
})
|
|
|
.finally(() => {
|
|
|
@@ -326,7 +139,7 @@ const openShareDialog = () => {
|
|
|
<VTag large :type="allData?.transportInfo?.status">{{
|
|
|
allData?.transportInfo?.status
|
|
|
}}</VTag>
|
|
|
- <VDriverGuide @click="handleGuide"></VDriverGuide>
|
|
|
+
|
|
|
<div class="right-operation" id="driver-step-tracking-detail-1">
|
|
|
<el-button
|
|
|
v-if="
|