feat 报告详情

This commit is contained in:
Ironsp
2026-09-03 14:32:00 +08:00
parent 607b5f8c91
commit 95634bd82a
9 changed files with 265 additions and 25 deletions

View File

@@ -113,6 +113,7 @@ declare global {
const shallowReactive: typeof import('vue')['shallowReactive']
const shallowReadonly: typeof import('vue')['shallowReadonly']
const shallowRef: typeof import('vue')['shallowRef']
const storage: typeof import('./utils/storage')['default']
const syncRef: typeof import('@vueuse/core')['syncRef']
const syncRefs: typeof import('@vueuse/core')['syncRefs']
const templateRef: typeof import('@vueuse/core')['templateRef']
@@ -434,6 +435,7 @@ declare module 'vue' {
readonly shallowReactive: UnwrapRef<typeof import('vue')['shallowReactive']>
readonly shallowReadonly: UnwrapRef<typeof import('vue')['shallowReadonly']>
readonly shallowRef: UnwrapRef<typeof import('vue')['shallowRef']>
readonly storage: UnwrapRef<typeof import('./utils/storage')['default']>
readonly syncRef: UnwrapRef<typeof import('@vueuse/core')['syncRef']>
readonly syncRefs: UnwrapRef<typeof import('@vueuse/core')['syncRefs']>
readonly templateRef: UnwrapRef<typeof import('@vueuse/core')['templateRef']>

2
src/components.d.ts vendored
View File

@@ -22,8 +22,10 @@ declare module 'vue' {
HomeWarning_list: typeof import('./components/home/warning_list.vue')['default']
MessageList: typeof import('./components/message/list.vue')['default']
ProjectItem: typeof import('./components/project/item.vue')['default']
ReportDetailMetrics: typeof import('./components/report/detailMetrics.vue')['default']
ReportDeviceHeader: typeof import('./components/report/deviceHeader.vue')['default']
ReportItem: typeof import('./components/report/item.vue')['default']
ReportStatsCard: typeof import('./components/report/statsCard.vue')['default']
SettingsProjectForm: typeof import('./components/settings/projectForm.vue')['default']
SettingsProjectSettings: typeof import('./components/settings/projectSettings.vue')['default']
SettingsRadioConfig: typeof import('./components/settings/radioConfig.vue')['default']

View File

@@ -0,0 +1,110 @@
<script setup lang="ts">
defineProps<{
avgSpeed: string
avgFrequency: string
avgAmplitude: string
avgTemperature: string
avgCompaction: string
exceptionCount: string
}>()
</script>
<template>
<view class="detail-card">
<text class="detail-title">
详细指标
</text>
<view class="detail-list">
<view class="detail-row">
<text class="detail-label">
平均行驶速度
</text>
<text class="detail-value">
{{ avgSpeed }}
</text>
</view>
<view class="detail-row">
<text class="detail-label">
平均振动频率
</text>
<text class="detail-value">
{{ avgFrequency }}
</text>
</view>
<view class="detail-row">
<text class="detail-label">
平均振幅
</text>
<text class="detail-value">
{{ avgAmplitude }}
</text>
</view>
<view class="detail-row">
<text class="detail-label">
平均摊铺温度
</text>
<text class="detail-value">
{{ avgTemperature }}
</text>
</view>
<view class="detail-row">
<text class="detail-label">
平均压实度
</text>
<text class="detail-value">
{{ avgCompaction }}
</text>
</view>
<view class="detail-row">
<text class="detail-label">
异常次数
</text>
<text class="detail-value">
{{ exceptionCount }}
</text>
</view>
</view>
</view>
</template>
<style scoped>
.detail-card {
background-color: #ffffff;
border-radius: 12px;
padding: 16px;
}
.detail-title {
font-size: 22px;
font-weight: bold;
color: #333;
margin-bottom: 16px;
display: block;
}
.detail-list {
display: flex;
flex-direction: column;
}
.detail-row {
display: flex;
justify-content: space-between;
padding: 12px 0;
border-bottom: 1px solid #f5f5f5;
}
.detail-row:last-child {
border-bottom: none;
}
.detail-label {
font-size: 18px;
color: #333;
}
.detail-value {
font-size: 18px;
color: #333;
}
</style>

View File

@@ -1,4 +1,6 @@
<script setup lang="ts">
import storage from '@/utils/storage'
const props = defineProps<{
title: string
deviceCode: string
@@ -11,7 +13,8 @@ const props = defineProps<{
}>()
function goToDetail() {
const data = encodeURIComponent(JSON.stringify({
const key = `report_${Date.now()}`
storage.set(key, {
title: props.title,
deviceCode: props.deviceCode,
status: props.status,
@@ -20,10 +23,9 @@ function goToDetail() {
duration: props.duration,
areaCount: props.areaCount,
passRate: props.passRate,
}))
console.log('22222222222data', data)
})
uni.navigateTo({
url: `/pages/report/detail/index?data=${data}`,
url: `/pages/report/detail/index?key=${key}`,
})
}
</script>

View File

@@ -0,0 +1,88 @@
<script setup lang="ts">
defineProps<{
duration: string
areaCount: string
passCount: string
passRate: string
}>()
</script>
<template>
<view class="stats-card">
<text class="stats-title">
作业统计汇报
</text>
<view class="stats-grid">
<view class="stat-item">
<text class="stat-label">
作业时长
</text>
<text class="stat-value">
{{ duration }}
</text>
</view>
<view class="stat-item">
<text class="stat-label">
压实面积
</text>
<text class="stat-value">
{{ areaCount }}
</text>
</view>
<view class="stat-item">
<text class="stat-label">
碾压遍数
</text>
<text class="stat-value">
{{ passCount }}
</text>
</view>
<view class="stat-item">
<text class="stat-label">
合格率 (%)
</text>
<text class="stat-value">
{{ passRate }}
</text>
</view>
</view>
</view>
</template>
<style scoped>
.stats-card {
background-color: #ffffff;
border-radius: 12px;
padding: 16px;
}
.stats-title {
font-size: 22px;
font-weight: bold;
color: #333;
margin-bottom: 16px;
display: block;
}
.stats-grid {
display: flex;
justify-content: space-between;
}
.stat-item {
display: flex;
flex-direction: column;
}
.stat-label {
font-size: 14px;
color: #666;
margin-bottom: 8px;
}
.stat-value {
font-size: 22px;
font-weight: bold;
color: #333;
}
</style>

View File

@@ -1,4 +1,6 @@
<script setup lang="ts">
import storage from '@/utils/storage'
const props = defineProps<{
deviceName: string
tags: string[]
@@ -9,15 +11,16 @@ const props = defineProps<{
}>()
function goToDetail() {
const data = encodeURIComponent(JSON.stringify({
const key = `warning_${Date.now()}`
storage.set(key, {
deviceName: props.deviceName,
tags: props.tags,
time: props.time,
trigger: props.trigger,
status: props.status || '未处理',
}))
})
uni.navigateTo({
url: `/pages/warning/detail/index?data=${data}`,
url: `/pages/warning/detail/index?key=${key}`,
})
}
</script>

View File

@@ -1,4 +1,6 @@
<script setup lang="ts">
import storage from '@/utils/storage'
definePage({
layout: false,
style: {
@@ -6,15 +8,29 @@ definePage({
},
})
const reportData = ref<any>(null)
const reportData = ref<any>({
deviceCode: 'ABC123',
time: '2025-12-15 08:30-14:30',
status: '已完成',
duration: '6H',
areaCount: '2580m²',
passCount: '355',
passRate: '96.8%',
avgSpeed: '3.8km/h',
avgFrequency: '34Hz',
avgAmplitude: '2.1mm',
avgTemperature: '42℃',
avgCompaction: '96%',
exceptionCount: '2',
})
onLoad((options) => {
if (options?.data) {
console.log('222222222222', options.data)
reportData.value = JSON.parse(options.data)
// reportData.value = JSON.parse(decodeURIComponent(options.data))
console.log('2222222222223333333', reportData.value)
if (options?.key) {
const data = storage.get(options.key)
if (data) {
reportData.value = data
storage.remove(options.key)
}
}
})
</script>
@@ -30,6 +46,24 @@ onLoad((options) => {
:time="reportData.time"
:status="reportData.status"
/>
<report-stats-card
v-if="reportData"
:duration="reportData.duration"
:area-count="reportData.areaCount"
:pass-count="reportData.passCount"
:pass-rate="reportData.passRate"
/>
<report-detail-metrics
v-if="reportData"
:avg-speed="reportData.avgSpeed"
:avg-frequency="reportData.avgFrequency"
:avg-amplitude="reportData.avgAmplitude"
:avg-temperature="reportData.avgTemperature"
:avg-compaction="reportData.avgCompaction"
:exception-count="reportData.exceptionCount"
/>
</view>
</view>
</template>
@@ -43,5 +77,8 @@ onLoad((options) => {
.content {
padding: 16px;
padding-top: 72px;
display: flex;
flex-direction: column;
gap: 12px;
}
</style>

View File

@@ -6,8 +6,7 @@ definePage({
},
})
const startDate = ref('')
const endDate = ref('')
const datetimerange = ref([])
const reportStatus = ref('')
const area = ref('')
const project = ref('')
@@ -73,11 +72,7 @@ function handleQuery() {
作业日期
</text>
<view class="date-range">
<uni-easyinput v-model="startDate" placeholder="开始时间" />
<text class="date-separator">
至
</text>
<uni-easyinput v-model="endDate" placeholder="请选择时间" />
<uni-datetime-picker v-model="datetimerange" type="datetimerange" range-separator="至" />
</view>
</view>

View File

@@ -1,4 +1,6 @@
<script setup lang="ts">
import storage from '@/utils/storage'
definePage({
layout: false,
style: {
@@ -9,10 +11,9 @@ definePage({
const warningData = ref<any>(null)
onLoad((options) => {
if (options?.data) {
console.log('111111111111111', options.data)
warningData.value = JSON.parse(decodeURIComponent(options.data))
console.log('11111111111111111222222', warningData.value)
if (options?.key) {
warningData.value = storage.get(options.key)
storage.remove(options.key)
}
})
</script>