From cfdfa7eb61d5e906ec6350f3141aac714a9b2bd8 Mon Sep 17 00:00:00 2001
From: yeg <1347747024@qq.com>
Date: 星期三, 02 九月 2026 13:49:35 +0800
Subject: [PATCH] 更新文档

---
 src/components/ConsoleDataListPanel.vue |   25 +++++++++++++++----------
 1 files changed, 15 insertions(+), 10 deletions(-)

diff --git a/src/components/ConsoleDataListPanel.vue b/src/components/ConsoleDataListPanel.vue
index 8c39da6..a8bb596 100644
--- a/src/components/ConsoleDataListPanel.vue
+++ b/src/components/ConsoleDataListPanel.vue
@@ -28,6 +28,7 @@
   sequenceId: number
   recordedAt: string
   absoluteTime: string
+  serverReceivedAt: string
   stepDuration: string
   startVoltage: string
   endVoltage: string
@@ -95,7 +96,7 @@
           { label: '放电能量(Wh)', value: 'dischargeEnergy' },
         ],
 )
-function formatTime(value: string) {
+function formatTime(value?: string | null) {
   return value
     ? value
         .replace('T', ' ')
@@ -104,11 +105,11 @@
     : '-'
 }
 function emptyRow(base: Partial<DataRow>): DataRow {
-  return { id: '', recordNo: '', batteryNo: '', cycleNo: 0, stepNo: 0, stepName: '', actualStepLabel: '-', sequenceId: 0, recordedAt: '', absoluteTime: '', stepDuration: '-', startVoltage: '-', endVoltage: '-', chargePeakVoltage: '-', dischargeValleyVoltage: '-', voltage: '-', current: '-', capacity: '-', energy: '-', chargeCapacity: '-', dischargeCapacity: '-', efficiency: '-', chargeEnergy: '-', dischargeEnergy: '-', ...base }
+  return { id: '', recordNo: '', batteryNo: '', cycleNo: 0, stepNo: 0, stepName: '', actualStepLabel: '-', sequenceId: 0, recordedAt: '', absoluteTime: '', serverReceivedAt: '', stepDuration: '-', startVoltage: '-', endVoltage: '-', chargePeakVoltage: '-', dischargeValleyVoltage: '-', voltage: '-', current: '-', capacity: '-', energy: '-', chargeCapacity: '-', dischargeCapacity: '-', efficiency: '-', chargeEnergy: '-', dischargeEnergy: '-', ...base }
 }
 function mapRecord(record: PersistedTestRecord): DataRow {
-  const timestamp = formatTime(record.recordedAt)
-  return emptyRow({ id: `${record.deviceId}:${record.channelId}:${record.sequenceId}`, recordNo: record.recordNo, batteryNo: record.batteryNo || '-', cycleNo: Number(record.cycleNo), stepNo: Number(record.stepNo), stepName: record.stepName || '-', sequenceId: Number(record.sequenceId), recordedAt: timestamp, absoluteTime: formatTime(record.absoluteTime || record.recordedAt), voltage: record.voltage == null ? '-' : Number(record.voltage).toFixed(4), current: record.current == null ? '-' : Number(record.current).toFixed(4), capacity: record.capacity == null ? '-' : Number(record.capacity).toFixed(4), energy: record.energy == null ? '-' : Number(record.energy).toFixed(4) })
+  const deviceTime = formatTime(record.deviceTime || record.recordedAt)
+  return emptyRow({ id: `${record.deviceId}:${record.channelId}:${record.sequenceId}`, recordNo: record.recordNo, batteryNo: record.batteryNo || '-', cycleNo: Number(record.cycleNo), stepNo: Number(record.stepNo), stepName: record.stepName || '-', sequenceId: Number(record.sequenceId), recordedAt: deviceTime, absoluteTime: deviceTime, serverReceivedAt: formatTime(record.serverReceivedAt), voltage: record.voltage == null ? '-' : Number(record.voltage).toFixed(4), current: record.current == null ? '-' : Number(record.current).toFixed(4), capacity: record.capacity == null ? '-' : Number(record.capacity).toFixed(4), energy: record.energy == null ? '-' : Number(record.energy).toFixed(4) })
 }
 function mapStep(record: PersistedTestStep): DataRow {
   const startedAt = formatTime(record.recordedAt)
@@ -213,7 +214,7 @@
   router.push({ path: '/data-revision', query: { testId: String(props.testId), dataType: dataType.value } })
 }
 function templateHeaders() {
-  return activeTab.value === 'cycle' ? ['记录编号', '电池号', '循环序号', '充放电容量(Ah)', '效率(%)', '能量(Wh)'] : activeTab.value === 'step' ? ['记录编号', '电池号', '循环序号', '工步序号', '工步', '工步时间', '容量(Ah)', '能量(Wh)', '起止电压(V)', '充电峰值电压(V)', '放电谷值电压(V)'] : ['记录编号', '电池号', '记录时间', '循环序号', '工步序号', '工步名称', '记录序号', '电压(V)', '电流(A)', '容量(Ah)', '能量(Wh)']
+  return activeTab.value === 'cycle' ? ['记录编号', '电池号', '循环序号', '充放电容量(Ah)', '效率(%)', '能量(Wh)'] : activeTab.value === 'step' ? ['记录编号', '电池号', '循环序号', '工步序号', '工步', '工步时间', '容量(Ah)', '能量(Wh)', '起止电压(V)', '充电峰值电压(V)', '放电谷值电压(V)'] : ['记录编号', '电池号', '设备时间', '循环序号', '工步序号', '工步名称', '记录序号', '服务器接收时间', '电压(V)', '电流(A)', '容量(Ah)', '能量(Wh)']
 }
 function downloadTemplate() {
   const worksheet = XLSX.utils.aoa_to_sheet([templateHeaders()])
@@ -333,8 +334,8 @@
     ElMessage.warning('没有可下载的数据')
     return
   }
-  const headers = activeTab.value === 'cycle' ? ['记录编号', '电池', '循环号', '充电容量(Ah)', '放电容量(Ah)', '充放电效率(%)', '充电能量(Wh)', '放电能量(Wh)'] : activeTab.value === 'step' ? ['记录编号', '电池', '循环号', '工步序号', '工步', '工步时间', '容量(Ah)', '能量(Wh)', '起始电压(V)', '终止电压(V)', '充电峰值(V)', '放电谷值(V)'] : ['记录编号', '电池', '循环号', '实际工步号', '实际工步名称', '记录序号', '记录时间', '绝对时间', '电压(V)', '电流(A)', '容量(Ah)', '能量(Wh)']
-  const records = activeTab.value === 'cycle' ? filteredRows.value.map(row => [row.recordNo, row.batteryNo, row.cycleNo, row.chargeCapacity, row.dischargeCapacity, row.efficiency, row.chargeEnergy, row.dischargeEnergy]) : activeTab.value === 'step' ? filteredRows.value.map(row => [row.recordNo, row.batteryNo, row.cycleNo, row.stepNo, row.stepName, row.stepDuration, row.capacity, row.energy, row.startVoltage, row.endVoltage, row.chargePeakVoltage, row.dischargeValleyVoltage]) : filteredRows.value.map(row => [row.recordNo, row.batteryNo, row.cycleNo, row.stepNo, row.stepName, row.sequenceId, row.recordedAt, row.absoluteTime, row.voltage, row.current, row.capacity, row.energy])
+  const headers = activeTab.value === 'cycle' ? ['记录编号', '电池', '循环号', '充电容量(Ah)', '放电容量(Ah)', '充放电效率(%)', '充电能量(Wh)', '放电能量(Wh)'] : activeTab.value === 'step' ? ['记录编号', '电池', '循环号', '工步序号', '工步', '工步时间', '容量(Ah)', '能量(Wh)', '起始电压(V)', '终止电压(V)', '充电峰值(V)', '放电谷值(V)'] : ['记录编号', '电池', '循环号', '实际工步号', '实际工步名称', '记录序号', '设备时间', '服务器接收时间', '电压(V)', '电流(A)', '容量(Ah)', '能量(Wh)']
+  const records = activeTab.value === 'cycle' ? filteredRows.value.map(row => [row.recordNo, row.batteryNo, row.cycleNo, row.chargeCapacity, row.dischargeCapacity, row.efficiency, row.chargeEnergy, row.dischargeEnergy]) : activeTab.value === 'step' ? filteredRows.value.map(row => [row.recordNo, row.batteryNo, row.cycleNo, row.stepNo, row.stepName, row.stepDuration, row.capacity, row.energy, row.startVoltage, row.endVoltage, row.chargePeakVoltage, row.dischargeValleyVoltage]) : filteredRows.value.map(row => [row.recordNo, row.batteryNo, row.cycleNo, row.stepNo, row.stepName, row.sequenceId, row.recordedAt, row.serverReceivedAt, row.voltage, row.current, row.capacity, row.energy])
   const blob = new Blob([`\uFEFF${[headers, ...records].map(item => item.map(escapeCsv).join(',')).join('\n')}`], { type: 'text/csv;charset=utf-8' })
   const url = URL.createObjectURL(blob)
   const anchor = document.createElement('a')
@@ -419,8 +420,8 @@
             <th>实际工步号</th>
             <th>实际工步名称</th>
             <th>记录序号</th>
-            <th>记录时间</th>
-            <th>绝对时间</th>
+            <th>设备时间</th>
+            <th>服务器接收时间</th>
             <th>电压(V)</th>
             <th>电流(A)</th>
             <th>容量(Ah)</th>
@@ -470,7 +471,7 @@
               <td>{{ row.stepName }}</td>
               <td>{{ row.sequenceId }}</td>
               <td>{{ row.recordedAt }}</td>
-              <td>{{ row.absoluteTime }}</td>
+              <td>{{ row.serverReceivedAt }}</td>
               <td>
                 <el-input v-if="editing && draftRows[row.id]" v-model="draftRows[row.id].voltage" size="small" />
                 <span v-else>{{ row.voltage }}</span>
@@ -605,6 +606,10 @@
             <dt>记录时间</dt>
             <dd>{{ singleRow.recordedAt }}</dd>
           </div>
+          <div>
+            <dt>服务器接收</dt>
+            <dd>{{ singleRow.serverReceivedAt }}</dd>
+          </div>
         </dl>
         <div class="single-form-grid">
           <label v-for="field in fieldOptions" :key="String(field.value)"

--
Gitblit v1.7.1