166 lines
3.0 KiB
Vue
166 lines
3.0 KiB
Vue
<script setup lang="ts">
|
|
import { computed } from 'vue'
|
|
import { useCurrentProject } from '@/composables/useCurrentProject'
|
|
import { useRtkLive } from '@/composables/useRtkLive'
|
|
|
|
interface Props {
|
|
deviceName?: string
|
|
rtkFixed?: boolean
|
|
}
|
|
|
|
const props = withDefaults(defineProps<Props>(), {
|
|
deviceName: '徐工XS65H #01',
|
|
rtkFixed: true,
|
|
})
|
|
|
|
const { hasCurrentProject } = useCurrentProject()
|
|
const { speedTextSpaced } = useRtkLive()
|
|
|
|
const displayDeviceName = computed(() => (hasCurrentProject.value ? props.deviceName : '--'))
|
|
const displaySpeed = computed(() => (hasCurrentProject.value ? speedTextSpaced.value : '--'))
|
|
const displayStatusText = computed(() => (hasCurrentProject.value ? '实时监测中' : '--'))
|
|
const displayRtkText = computed(() => (hasCurrentProject.value ? 'RTK固定' : '--'))
|
|
|
|
function goToHeatmap() {
|
|
uni.navigateTo({
|
|
url: '/pages/heatmap/index',
|
|
})
|
|
}
|
|
</script>
|
|
|
|
<template>
|
|
<view class="rtk-header">
|
|
<!-- 标题行 -->
|
|
<view class="title-row">
|
|
<text class="title">
|
|
RTK轨迹实时监测
|
|
</text>
|
|
<wd-button variant="text" @click="goToHeatmap">
|
|
压实热力图
|
|
</wd-button>
|
|
</view>
|
|
|
|
<!-- 设备状态 -->
|
|
<view class="device-status">
|
|
<view class="status-dot" :class="{ 'status-dot--active': hasCurrentProject }" />
|
|
<text class="device-name">
|
|
{{ displayDeviceName }}
|
|
</text>
|
|
<text class="status-text">
|
|
{{ displayStatusText }}
|
|
</text>
|
|
</view>
|
|
|
|
<!-- 数据行 -->
|
|
<view class="data-row">
|
|
<view class="data-item">
|
|
<text class="data-label">
|
|
车速
|
|
</text>
|
|
<text class="data-value">
|
|
{{ displaySpeed }}
|
|
</text>
|
|
</view>
|
|
<view class="rtk-status">
|
|
<view class="rtk-dot" :class="{ 'rtk-dot--active': hasCurrentProject && rtkFixed }" />
|
|
<text class="rtk-text">
|
|
{{ displayRtkText }}
|
|
</text>
|
|
</view>
|
|
</view>
|
|
</view>
|
|
</template>
|
|
|
|
<style scoped>
|
|
.rtk-header {
|
|
padding-bottom: 12px;
|
|
}
|
|
|
|
.title-row {
|
|
display: flex;
|
|
justify-content: space-between;
|
|
align-items: center;
|
|
margin-bottom: 8px;
|
|
}
|
|
|
|
.title {
|
|
font-size: 20px;
|
|
font-weight: 600;
|
|
color: #333;
|
|
}
|
|
|
|
.device-status {
|
|
display: flex;
|
|
align-items: center;
|
|
gap: 6px;
|
|
margin-bottom: 12px;
|
|
}
|
|
|
|
.status-dot {
|
|
width: 8px;
|
|
height: 8px;
|
|
border-radius: 50%;
|
|
background: #ccc;
|
|
}
|
|
|
|
.status-dot--active {
|
|
background: #22c55e;
|
|
}
|
|
|
|
.device-name {
|
|
font-size: 14px;
|
|
color: #999;
|
|
}
|
|
|
|
.status-text {
|
|
font-size: 14px;
|
|
color: #999;
|
|
}
|
|
|
|
.data-row {
|
|
display: flex;
|
|
align-items: center;
|
|
gap: 100px;
|
|
}
|
|
|
|
.data-item {
|
|
display: flex;
|
|
flex-direction: column;
|
|
gap: 2px;
|
|
}
|
|
|
|
.data-label {
|
|
font-size: 18px;
|
|
color: #333;
|
|
}
|
|
|
|
.data-value {
|
|
font-size: 16px;
|
|
font-weight: 600;
|
|
color: #333;
|
|
}
|
|
|
|
.rtk-status {
|
|
display: flex;
|
|
align-items: center;
|
|
gap: 4px;
|
|
margin-left: auto;
|
|
}
|
|
|
|
.rtk-dot {
|
|
width: 8px;
|
|
height: 8px;
|
|
border-radius: 50%;
|
|
background: #ccc;
|
|
}
|
|
|
|
.rtk-dot--active {
|
|
background: #22c55e;
|
|
}
|
|
|
|
.rtk-text {
|
|
font-size: 12px;
|
|
color: #666;
|
|
}
|
|
</style>
|