| | |
| | | <el-col :span="24"><el-form-item label="巡检结果/记录:"><el-input v-model="form.inspectionResult" type="textarea" :rows="2" placeholder="请输入巡检结果" /></el-form-item></el-col> |
| | | </el-row> |
| | | <el-row :gutter="30"> |
| | | <el-col :span="12"><el-form-item label="AI视频分析结果:"><el-input v-model="form.aiAnalysis" type="textarea" :rows="2" placeholder="预留:AI视频分析结果" /></el-form-item></el-col> |
| | | <el-col :span="12"><el-form-item label="无人机/机器人数据:"><el-input v-model="form.uavData" type="textarea" :rows="2" placeholder="预留:无人机/机器人回传数据" /></el-form-item></el-col> |
| | | <el-col :span="12"><el-form-item label="AI视频分析结果:"><el-input v-model="form.aiAnalysis" type="textarea" :rows="2" placeholder="设备回传后自动写入;也可手工录入" /></el-form-item></el-col> |
| | | <el-col :span="12"><el-form-item label="无人机/机器人数据:"><el-input v-model="form.uavData" type="textarea" :rows="2" placeholder="设备回传后自动写入;也可手工录入" /></el-form-item></el-col> |
| | | </el-row> |
| | | <el-row :gutter="30"> |
| | | <el-col :span="24"><el-form-item label="巡检报告:"><el-input v-model="form.reportPath" type="textarea" :rows="2" placeholder="自动生成/填写巡检报告" /></el-form-item></el-col> |
| | |
| | | <el-button @click="reportVisible = false">关闭</el-button> |
| | | </template> |
| | | </el-dialog> |
| | | |
| | | <!-- 巡检回传详情:AI 视频分析 + 无人机/机器人回传数据 --> |
| | | <el-dialog v-model="traceVisible" :title="traceTitle" width="75%" top="6vh"> |
| | | <div v-if="!traceHasData" class="trace-empty"> |
| | | 该巡检任务暂无设备回传数据。无人机 / 机器人 / AI 摄像头通过回传接口上报后,这里会自动展示识别结果、现场照片与轨迹。 |
| | | </div> |
| | | <template v-else> |
| | | <div class="trace-block"> |
| | | <div class="trace-title">数据来源</div> |
| | | <el-descriptions :column="4" border size="small"> |
| | | <el-descriptions-item label="来源类型">{{ deviceTypeText(trace.device.deviceType) }}</el-descriptions-item> |
| | | <el-descriptions-item label="设备编号">{{ trace.device.deviceCode || "-" }}</el-descriptions-item> |
| | | <el-descriptions-item label="巡检区域">{{ trace.device.area || "-" }}</el-descriptions-item> |
| | | <el-descriptions-item label="设备电量">{{ trace.device.battery != null ? trace.device.battery + "%" : "-" }}</el-descriptions-item> |
| | | <el-descriptions-item label="采集时间">{{ trace.device.collectedAt || "-" }}</el-descriptions-item> |
| | | <el-descriptions-item label="系统接收时间">{{ trace.device.receivedAt || "-" }}</el-descriptions-item> |
| | | <el-descriptions-item label="采集坐标">{{ coordText }}</el-descriptions-item> |
| | | <el-descriptions-item label="作业高度">{{ trace.device.altitude != null ? trace.device.altitude + " m" : "-" }}</el-descriptions-item> |
| | | </el-descriptions> |
| | | </div> |
| | | |
| | | <div class="trace-block"> |
| | | <div class="trace-title">AI 视频分析结果</div> |
| | | <div class="trace-summary">{{ trace.ai.summary || "本次回传未附带 AI 结论" }}</div> |
| | | <el-table v-if="aiObjects.length" :data="aiObjects" border size="small"> |
| | | <el-table-column type="index" label="序号" width="60" align="center" /> |
| | | <el-table-column prop="object" label="识别对象" min-width="140" show-overflow-tooltip /> |
| | | <el-table-column prop="conclusion" label="识别结论" min-width="160" show-overflow-tooltip /> |
| | | <el-table-column label="置信度" width="110" align="center"> |
| | | <template #default="{ row }">{{ row.confidence != null ? (Number(row.confidence) * 100).toFixed(1) + "%" : "-" }}</template> |
| | | </el-table-column> |
| | | <el-table-column prop="frameTime" label="截帧时间" width="170" /> |
| | | </el-table> |
| | | <div v-else class="trace-sub-empty">暂无结构化识别条目</div> |
| | | </div> |
| | | |
| | | <div v-if="tracePhotos.length" class="trace-block"> |
| | | <div class="trace-title">现场采集照片</div> |
| | | <div class="trace-photos"> |
| | | <el-image |
| | | v-for="(p, i) in tracePhotos" |
| | | :key="i" |
| | | :src="p" |
| | | :preview-src-list="tracePhotos" |
| | | :initial-index="i" |
| | | fit="cover" |
| | | class="trace-photo" |
| | | /> |
| | | </div> |
| | | </div> |
| | | |
| | | <div v-if="traceTrack.length" class="trace-block"> |
| | | <div class="trace-title">设备巡检轨迹</div> |
| | | <el-table :data="traceTrack" border size="small" max-height="200"> |
| | | <el-table-column type="index" label="序号" width="60" align="center" /> |
| | | <el-table-column prop="t" label="时间" width="140" /> |
| | | <el-table-column prop="lng" label="经度" width="140" /> |
| | | <el-table-column prop="lat" label="纬度" width="140" /> |
| | | <el-table-column prop="alt" label="高度(m)" width="110" /> |
| | | </el-table> |
| | | </div> |
| | | </template> |
| | | <template #footer> |
| | | <el-button @click="traceVisible = false">关闭</el-button> |
| | | </template> |
| | | </el-dialog> |
| | | </div> |
| | | </template> |
| | | |
| | | <script setup> |
| | | import { Search } from "@element-plus/icons-vue"; |
| | | import { ref, reactive, toRefs, onMounted, getCurrentInstance } from "vue"; |
| | | import { ref, reactive, toRefs, onMounted, computed, getCurrentInstance } from "vue"; |
| | | import { ElMessageBox } from "element-plus"; |
| | | import { listInspection, addInspection, updateInspection, deleteInspection, generateInspectionReport } from "@/api/environmentAccess/inspection.js"; |
| | | |
| | |
| | | { label: "状态", prop: "status", width: 90, dataType: "tag", formatData: (p) => statusText(p), formatType: (p) => statusType(p) }, |
| | | { label: "巡检结果", prop: "inspectionResult", showOverflowTooltip: true }, |
| | | { |
| | | dataType: "action", label: "操作", align: "center", fixed: "right", width: 100, |
| | | dataType: "action", label: "操作", align: "center", fixed: "right", width: 200, |
| | | operation: [ |
| | | { name: "回传详情", type: "text", clickFun: (row) => openTrace(row) }, |
| | | { name: "编辑", type: "text", clickFun: (row) => openForm("edit", row) }, |
| | | { name: "生成报告", type: "text", clickFun: (row) => openReport(row) }, |
| | | ], |
| | |
| | | a.download = reportTitle.value + ".doc"; |
| | | a.click(); |
| | | URL.revokeObjectURL(a.href); |
| | | }; |
| | | |
| | | /* ---------- 巡检回传详情(AI 视频分析 + 无人机/机器人回传) ---------- */ |
| | | const traceVisible = ref(false); |
| | | const traceTitle = ref("巡检回传详情"); |
| | | const trace = ref({ device: {}, ai: {}, photos: [], track: [] }); |
| | | const deviceTypeText = (t) => ({ UAV: "无人机", ROBOT: "巡检机器人", CAMERA: "AI 摄像头" }[t] || t || "-"); |
| | | const safeJson = (txt) => { |
| | | if (!txt) return null; |
| | | try { |
| | | const v = JSON.parse(txt); |
| | | return v && typeof v === "object" ? v : null; |
| | | } catch (e) { |
| | | return null; |
| | | } |
| | | }; |
| | | const traceHasData = computed(() => { |
| | | const d = trace.value.device || {}; |
| | | const ai = trace.value.ai || {}; |
| | | return !!(d.deviceCode || d.deviceType || ai.summary || (ai.objects && ai.objects.length)); |
| | | }); |
| | | const aiObjects = computed(() => (trace.value.ai && trace.value.ai.objects) || []); |
| | | const tracePhotos = computed(() => (trace.value.device && trace.value.device.photos) || []); |
| | | const traceTrack = computed(() => (trace.value.device && trace.value.device.track) || []); |
| | | const coordText = computed(() => { |
| | | const d = trace.value.device || {}; |
| | | if (d.longitude == null || d.latitude == null) return "-"; |
| | | return d.longitude + ", " + d.latitude; |
| | | }); |
| | | const openTrace = (row) => { |
| | | const uav = safeJson(row.uavData); |
| | | const aiParsed = safeJson(row.aiAnalysis); |
| | | const ai = aiParsed || { summary: row.aiAnalysis || "", objects: [] }; |
| | | trace.value = { |
| | | device: uav || {}, |
| | | ai: ai, |
| | | photos: (uav && uav.photos) || [], |
| | | track: (uav && uav.track) || [], |
| | | }; |
| | | traceTitle.value = (row.inspectionName || "智能巡检") + " - 回传详情"; |
| | | traceVisible.value = true; |
| | | }; |
| | | |
| | | const handleQuery = () => { page.current = 1; getList(); }; |
| | |
| | | <style scoped lang="scss"> |
| | | .ml10 { margin-left: 10px; } |
| | | .table_list { margin-top: unset; } |
| | | .trace-block { margin-bottom: 18px; } |
| | | .trace-title { |
| | | font-size: 14px; |
| | | font-weight: 600; |
| | | color: #303133; |
| | | border-left: 3px solid #409eff; |
| | | padding-left: 8px; |
| | | margin-bottom: 10px; |
| | | } |
| | | .trace-summary { |
| | | font-size: 13px; |
| | | color: #606266; |
| | | background: #f5f7fa; |
| | | border-radius: 4px; |
| | | padding: 8px 12px; |
| | | margin-bottom: 10px; |
| | | line-height: 1.6; |
| | | } |
| | | .trace-sub-empty, |
| | | .trace-empty { |
| | | color: #909399; |
| | | font-size: 13px; |
| | | line-height: 1.8; |
| | | } |
| | | .trace-empty { |
| | | padding: 24px 8px; |
| | | text-align: center; |
| | | } |
| | | .trace-photos { display: flex; flex-wrap: wrap; gap: 10px; } |
| | | .trace-photo { |
| | | width: 132px; |
| | | height: 96px; |
| | | border-radius: 4px; |
| | | border: 1px solid #ebeef5; |
| | | cursor: pointer; |
| | | } |
| | | </style> |