feat 无项目数据--
This commit is contained in:
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user