feat 无项目数据--
This commit is contained in:
@@ -1,5 +1,6 @@
|
||||
<script setup lang="ts">
|
||||
// RTK 轨迹实时监测 - 状态头部组件
|
||||
import { computed } from 'vue'
|
||||
import { useCurrentProject } from '@/composables/useCurrentProject'
|
||||
|
||||
interface Props {
|
||||
deviceName?: string
|
||||
@@ -9,7 +10,7 @@ interface Props {
|
||||
rtkFixed?: boolean
|
||||
}
|
||||
|
||||
withDefaults(defineProps<Props>(), {
|
||||
const props = withDefaults(defineProps<Props>(), {
|
||||
deviceName: '徐工XS65H #01',
|
||||
speed: 4.2,
|
||||
frequency: 28.5,
|
||||
@@ -17,6 +18,13 @@ withDefaults(defineProps<Props>(), {
|
||||
rtkFixed: true,
|
||||
})
|
||||
|
||||
const { hasCurrentProject } = useCurrentProject()
|
||||
|
||||
const displayDeviceName = computed(() => (hasCurrentProject.value ? props.deviceName : '--'))
|
||||
const displaySpeed = computed(() => (hasCurrentProject.value ? `${props.speed} km/h` : '--'))
|
||||
const displayStatusText = computed(() => (hasCurrentProject.value ? '实时监测中' : '--'))
|
||||
const displayRtkText = computed(() => (hasCurrentProject.value ? 'RTK固定' : '--'))
|
||||
|
||||
function goToHeatmap() {
|
||||
uni.navigateTo({
|
||||
url: '/pages/heatmap/index',
|
||||
@@ -38,12 +46,12 @@ function goToHeatmap() {
|
||||
|
||||
<!-- 设备状态 -->
|
||||
<view class="device-status">
|
||||
<view class="status-dot" />
|
||||
<view class="status-dot" :class="{ 'status-dot--active': hasCurrentProject }" />
|
||||
<text class="device-name">
|
||||
{{ deviceName }}
|
||||
{{ displayDeviceName }}
|
||||
</text>
|
||||
<text class="status-text">
|
||||
实时监测中
|
||||
{{ displayStatusText }}
|
||||
</text>
|
||||
</view>
|
||||
|
||||
@@ -54,29 +62,13 @@ function goToHeatmap() {
|
||||
车速
|
||||
</text>
|
||||
<text class="data-value">
|
||||
{{ speed }} km/h
|
||||
{{ displaySpeed }}
|
||||
</text>
|
||||
</view>
|
||||
<!-- <view class="data-item">
|
||||
<text class="data-label">
|
||||
振动频率
|
||||
</text>
|
||||
<text class="data-value">
|
||||
{{ frequency }} HZ
|
||||
</text>
|
||||
</view> -->
|
||||
<!-- <view class="data-item">
|
||||
<text class="data-label">
|
||||
振幅
|
||||
</text>
|
||||
<text class="data-value">
|
||||
{{ amplitude }} mm
|
||||
</text>
|
||||
</view> -->
|
||||
<view class="rtk-status">
|
||||
<view class="rtk-dot" :class="{ 'rtk-dot--active': rtkFixed }" />
|
||||
<view class="rtk-dot" :class="{ 'rtk-dot--active': hasCurrentProject && rtkFixed }" />
|
||||
<text class="rtk-text">
|
||||
RTK固定
|
||||
{{ displayRtkText }}
|
||||
</text>
|
||||
</view>
|
||||
</view>
|
||||
@@ -101,11 +93,6 @@ function goToHeatmap() {
|
||||
color: #333;
|
||||
}
|
||||
|
||||
/* .subtitle {
|
||||
font-size: 20px;
|
||||
color: #333;
|
||||
} */
|
||||
|
||||
.device-status {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
@@ -117,6 +104,10 @@ function goToHeatmap() {
|
||||
width: 8px;
|
||||
height: 8px;
|
||||
border-radius: 50%;
|
||||
background: #ccc;
|
||||
}
|
||||
|
||||
.status-dot--active {
|
||||
background: #22c55e;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user