From 64482bb44f0faf844c7d73f360e7776346681b82 Mon Sep 17 00:00:00 2001
From: chenyao <1219716595@qq.com>
Date: Thu, 26 Feb 2026 17:26:46 +0800
Subject: [PATCH] feat:增加设备调用记录功能

---
 applications/task-work-order/src/views/orderView/deviceInvocation/deviceCallRecord/index.vue |   36 ++++++++++++++++++++++++++++++++----
 1 files changed, 32 insertions(+), 4 deletions(-)

diff --git a/applications/task-work-order/src/views/orderView/deviceInvocation/deviceCallRecord/index.vue b/applications/task-work-order/src/views/orderView/deviceInvocation/deviceCallRecord/index.vue
index f8ec6bd..4f7bd35 100644
--- a/applications/task-work-order/src/views/orderView/deviceInvocation/deviceCallRecord/index.vue
+++ b/applications/task-work-order/src/views/orderView/deviceInvocation/deviceCallRecord/index.vue
@@ -33,7 +33,7 @@
 				<el-select
 					class="gd-select gray"
 					popper-class="gd-select-popper"
-					v-model="searchParams.taskInitiator"
+					v-model="searchParams.taskInitiatorId"
 					placeholder="请选择"
 					clearable
 					@change="handleSearch"
@@ -75,7 +75,11 @@
 					<el-table-column prop="patrolTaskName" show-overflow-tooltip label="任务名称" />
 					<el-table-column prop="taskDepartment" show-overflow-tooltip label="发起任务部门" />
 					<el-table-column prop="taskInitiator" show-overflow-tooltip label="任务发起人" />
-					<el-table-column prop="flightDuration" show-overflow-tooltip label="飞行时长" />
+					<el-table-column prop="flightDuration" show-overflow-tooltip label="飞行时长">
+						<template v-slot="{ row }">
+							{{ formatDuration(row.flightDuration) }}
+						</template>
+					</el-table-column>
 					<el-table-column prop="flightDistance" show-overflow-tooltip label="飞行里程(m)" />
 					<el-table-column prop="deviceName" show-overflow-tooltip label="执行设备" />
 					<el-table-column prop="planExecuteTime" show-overflow-tooltip label="计划执行时间" />
@@ -116,11 +120,12 @@
 import FormDiaLog from './FormDiaLog.vue'
 import { saveOperationLog } from '@ztzf/apis'
 import { useRoute } from 'vue-router'
+import { getDictLabel } from '@ztzf/utils'
 
 const initSearchParams = () => ({
 	deviceId: '',
 	patrolTaskName: '',
-	taskInitiator: '',
+	taskInitiatorId: '',
 	current: 1,
 	size: 10,
 })
@@ -144,7 +149,7 @@
 async function getList() {
 	loading.value = true
 	try {
-		const res = await getDeviceCallRecordPage(searchParams)
+		const res = await getDeviceCallRecordPage(searchParams.value)
 		list.value = res?.data?.data?.records ?? []
 		total.value = res?.data?.data?.total ?? 0
 	} finally {
@@ -184,6 +189,29 @@
 	getList()
 }
 
+// 返回 '2m 5s' 格式
+function formatDuration(seconds) {
+	if (seconds === null || seconds === undefined || seconds === '') {
+		return '--';
+	}
+
+	// 如果小于60秒,直接显示秒
+	if (seconds < 60) {
+		return `${seconds}秒`;
+	}
+
+	// 计算分钟和秒
+	const minutes = Math.floor(seconds / 60);
+	const remainingSeconds = seconds % 60;
+
+	// 组装显示字符串
+	if (remainingSeconds > 0) {
+		return `${minutes}分${remainingSeconds}秒`;
+	} else {
+		return `${minutes}分`;
+	}
+}
+
 
 function handleView(row) {
 	dialogRef.value?.open({ mode: 'view', row: { ...row } })

--
Gitblit v1.9.3