| | |
| | | </el-select> |
| | | </el-form-item> |
| | | |
| | | <el-form-item label="任务发起人" prop=""> |
| | | <el-form-item label="任务发起人" prop="taskInitiatorId"> |
| | | <el-select |
| | | class="gd-select gray" |
| | | popper-class="gd-select-popper" |
| | | v-model="searchParams.taskInitiator" |
| | | v-model="searchParams.taskInitiatorId" |
| | | placeholder="请选择" |
| | | clearable |
| | | @change="handleSearch" |
| | |
| | | <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="计划执行时间" /> |
| | | <el-table-column prop="actualExecuteTime" show-overflow-tooltip label="实际执行时间" /> |
| | | <el-table-column label="操作" class-name="operation-btns" width="180"> |
| | | <el-table-column label="操作" class-name="operation-btns" width="180" fixed="right"> |
| | | <template v-slot="{ row }"> |
| | | <el-link @click="handleView(row)">查看</el-link> |
| | | </template> |
| | |
| | | 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, |
| | | }) |
| | |
| | | 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 { |
| | |
| | | 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 } }) |