feat 无项目数据--
This commit is contained in:
@@ -1,23 +1,40 @@
|
||||
<script setup lang="ts">
|
||||
import { computed } from 'vue'
|
||||
import { useCurrentProject } from '@/composables/useCurrentProject'
|
||||
|
||||
const { hasCurrentProject } = useCurrentProject()
|
||||
|
||||
// 压实度 (假数据,后续替换)
|
||||
const compactionValue = 25
|
||||
const compactionValue = computed(() => (hasCurrentProject.value ? 25 : 0))
|
||||
const compactionText = computed(() => (hasCurrentProject.value ? `${compactionValue.value}%` : '--'))
|
||||
|
||||
// 车速 (假数据,范围 0-12,中间值 6)
|
||||
const speedValue = 4.2
|
||||
const speedValue = computed(() => (hasCurrentProject.value ? 4.2 : 0))
|
||||
const speedText = computed(() => (hasCurrentProject.value ? `${speedValue.value}KM/H` : '--'))
|
||||
const speedMax = 12
|
||||
|
||||
// 指针旋转角度:0km/h → 225°(左下),12km/h → -45°(右下),中间90°(正上)
|
||||
const needleRotation = computed(() => 225 - (speedValue / speedMax) * 270)
|
||||
const needleRotation = computed(() => 225 - (speedValue.value / speedMax) * 270)
|
||||
|
||||
// 今日作业概览数据 (假数据)
|
||||
const overviewData = [
|
||||
{ label: '作业时长', value: '8h' },
|
||||
{ label: '压实面积', value: '28.5m²' },
|
||||
{ label: '碾压遍数', value: '10遍' },
|
||||
{ label: '异常次数', value: '0' },
|
||||
]
|
||||
const frequencyText = computed(() => (hasCurrentProject.value ? '8939HZ' : '--'))
|
||||
|
||||
// 今日作业概览数据
|
||||
const overviewData = computed(() => {
|
||||
if (!hasCurrentProject.value) {
|
||||
return [
|
||||
{ label: '作业时长', value: '--' },
|
||||
{ label: '压实面积', value: '--' },
|
||||
{ label: '碾压遍数', value: '--' },
|
||||
{ label: '异常次数', value: '--' },
|
||||
]
|
||||
}
|
||||
return [
|
||||
{ label: '作业时长', value: '8h' },
|
||||
{ label: '压实面积', value: '28.5m²' },
|
||||
{ label: '碾压遍数', value: '10遍' },
|
||||
{ label: '异常次数', value: '0' },
|
||||
]
|
||||
})
|
||||
</script>
|
||||
|
||||
<template>
|
||||
@@ -43,7 +60,7 @@ const overviewData = [
|
||||
</view>
|
||||
<!-- 圆环进度(使用 wotui 的 wd-circle 组件) -->
|
||||
<view class="ring-wrap">
|
||||
<wd-circle v-model="compactionValue" :text="`${compactionValue}%`" />
|
||||
<wd-circle :model-value="compactionValue" :text="compactionText" />
|
||||
</view>
|
||||
</view>
|
||||
|
||||
@@ -58,7 +75,7 @@ const overviewData = [
|
||||
</text>
|
||||
</view>
|
||||
<text class="gauge-value">
|
||||
{{ speedValue }}KM/H
|
||||
{{ speedText }}
|
||||
</text>
|
||||
</view>
|
||||
</view>
|
||||
@@ -71,7 +88,7 @@ const overviewData = [
|
||||
振动频率
|
||||
</text>
|
||||
<text class="freq-value">
|
||||
8939HZ
|
||||
{{ frequencyText }}
|
||||
</text>
|
||||
</view>
|
||||
|
||||
@@ -80,7 +97,7 @@ const overviewData = [
|
||||
振动频率
|
||||
</text>
|
||||
<text class="freq-value">
|
||||
8939HZ
|
||||
{{ frequencyText }}
|
||||
</text>
|
||||
</view>
|
||||
|
||||
|
||||
Reference in New Issue
Block a user