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>
|
||||
|
||||
|
||||
@@ -1,15 +1,29 @@
|
||||
<script setup lang="ts">
|
||||
// 设备状态 + 作业控制组件
|
||||
import { computed } from 'vue'
|
||||
import { useCurrentProject } from '@/composables/useCurrentProject'
|
||||
|
||||
const deviceInfo = {
|
||||
编号: '徐工XS65H #01',
|
||||
status: '作业中',
|
||||
connected: '已连接',
|
||||
workStatus: '正常运行',
|
||||
signalStatus: '信号良好',
|
||||
}
|
||||
const { hasCurrentProject } = useCurrentProject()
|
||||
|
||||
const workStatus = '作业进行中'
|
||||
const deviceInfo = computed(() => {
|
||||
if (!hasCurrentProject.value) {
|
||||
return {
|
||||
编号: '--',
|
||||
status: '--',
|
||||
connected: '--',
|
||||
workStatus: '--',
|
||||
signalStatus: '--',
|
||||
}
|
||||
}
|
||||
return {
|
||||
编号: '徐工XS65H #01',
|
||||
status: '作业中',
|
||||
connected: '已连接',
|
||||
workStatus: '正常运行',
|
||||
signalStatus: '信号良好',
|
||||
}
|
||||
})
|
||||
|
||||
const workStatus = computed(() => (hasCurrentProject.value ? '作业进行中' : '--'))
|
||||
</script>
|
||||
|
||||
<template>
|
||||
@@ -35,13 +49,13 @@ const workStatus = '作业进行中'
|
||||
<!-- 左列:作业状态 -->
|
||||
<view class="status-col">
|
||||
<view class="tag">
|
||||
<view class="dot dot--green" />
|
||||
<view class="dot" :class="hasCurrentProject ? 'dot--green' : 'dot--gray'" />
|
||||
<text>{{ deviceInfo.status }}</text>
|
||||
</view>
|
||||
<text class="info-label">
|
||||
压实作业
|
||||
</text>
|
||||
<text class="info-value info-value--green">
|
||||
<text class="info-value" :class="{ 'info-value--green': hasCurrentProject }">
|
||||
{{ deviceInfo.workStatus }}
|
||||
</text>
|
||||
</view>
|
||||
@@ -49,13 +63,13 @@ const workStatus = '作业进行中'
|
||||
<!-- 右列:连接状态 -->
|
||||
<view class="status-col">
|
||||
<view class="tag">
|
||||
<view class="dot dot--green" />
|
||||
<view class="dot" :class="hasCurrentProject ? 'dot--green' : 'dot--gray'" />
|
||||
<text>{{ deviceInfo.connected }}</text>
|
||||
</view>
|
||||
<text class="info-label">
|
||||
设备连接
|
||||
</text>
|
||||
<text class="info-value info-value--green">
|
||||
<text class="info-value" :class="{ 'info-value--green': hasCurrentProject }">
|
||||
{{ deviceInfo.signalStatus }}
|
||||
</text>
|
||||
</view>
|
||||
@@ -85,14 +99,14 @@ const workStatus = '作业进行中'
|
||||
<!-- 第二行:当前状态(对齐左侧 label 行) -->
|
||||
<view class="control-row">
|
||||
<view class="tag">
|
||||
<view class="dot dot--green" />
|
||||
<view class="dot" :class="hasCurrentProject ? 'dot--green' : 'dot--gray'" />
|
||||
<text>当前:{{ workStatus }}</text>
|
||||
</view>
|
||||
</view>
|
||||
|
||||
<!-- 第三行:暂停按钮(对齐左侧 value 行) -->
|
||||
<view class="control-row">
|
||||
<wd-button type="warning" class="pause-btn" round>
|
||||
<wd-button type="warning" class="pause-btn" round :disabled="!hasCurrentProject">
|
||||
暂停作业
|
||||
</wd-button>
|
||||
</view>
|
||||
@@ -188,6 +202,10 @@ const workStatus = '作业进行中'
|
||||
background: #22c55e;
|
||||
}
|
||||
|
||||
.dot--gray {
|
||||
background: #ccc;
|
||||
}
|
||||
|
||||
.info-label {
|
||||
font-size: 14px;
|
||||
color: #333333;
|
||||
|
||||
@@ -1,5 +1,7 @@
|
||||
<script setup lang="ts">
|
||||
// RTK 轨迹画布 - 占位组件,后续实现轨迹动画
|
||||
import { useCurrentProject } from '@/composables/useCurrentProject'
|
||||
|
||||
const { hasCurrentProject } = useCurrentProject()
|
||||
|
||||
function goToRtk() {
|
||||
uni.navigateTo({
|
||||
@@ -12,9 +14,9 @@ function goToRtk() {
|
||||
<view class="rtk-canvas" @click="goToRtk">
|
||||
<view class="canvas-placeholder">
|
||||
<text class="placeholder-text">
|
||||
轨迹动画区域
|
||||
{{ hasCurrentProject ? '轨迹动画区域' : '--' }}
|
||||
</text>
|
||||
<text class="placeholder-hint">
|
||||
<text v-if="hasCurrentProject" class="placeholder-hint">
|
||||
(Canvas 绘制行驶轨迹 + 压实热力图)
|
||||
</text>
|
||||
</view>
|
||||
|
||||
@@ -1,5 +1,11 @@
|
||||
<script setup lang="ts">
|
||||
// RTK 轨迹底部信息组件(图例 + 位置信息)
|
||||
import { computed } from 'vue'
|
||||
import { useCurrentProject } from '@/composables/useCurrentProject'
|
||||
|
||||
const { hasCurrentProject } = useCurrentProject()
|
||||
|
||||
const headingText = computed(() => (hasCurrentProject.value ? '航向:NE45°' : '航向:--'))
|
||||
const locationText = computed(() => (hasCurrentProject.value ? '114.39°E, 39.9087°N' : '--'))
|
||||
</script>
|
||||
|
||||
<template>
|
||||
@@ -26,10 +32,10 @@
|
||||
</view>
|
||||
<view class="location-info">
|
||||
<text class="location-text">
|
||||
航向:NE45°
|
||||
{{ headingText }}
|
||||
</text>
|
||||
<text class="location-text">
|
||||
114.39°E, 39.9087°N
|
||||
{{ locationText }}
|
||||
</text>
|
||||
</view>
|
||||
</view>
|
||||
|
||||
@@ -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