From 5e2926edddb3e89f1aa3882290fec577246e5e2c Mon Sep 17 00:00:00 2001
From: 罗广辉 <guanghui.luo@foxmail.com>
Date: Sat, 06 Jun 2026 15:08:04 +0800
Subject: [PATCH] refactor: 简化设备调用记录表格列渲染
---
applications/task-work-order/src/views/orderView/orderManage/inspectionRequest/ViewDiaLog.vue | 81 ++++++++++++++++++++++++++++++++--------
1 files changed, 65 insertions(+), 16 deletions(-)
diff --git a/applications/task-work-order/src/views/orderView/orderManage/inspectionRequest/ViewDiaLog.vue b/applications/task-work-order/src/views/orderView/orderManage/inspectionRequest/ViewDiaLog.vue
index 0b4f24a..b731aff 100644
--- a/applications/task-work-order/src/views/orderView/orderManage/inspectionRequest/ViewDiaLog.vue
+++ b/applications/task-work-order/src/views/orderView/orderManage/inspectionRequest/ViewDiaLog.vue
@@ -42,7 +42,7 @@
</el-col>
<el-col :span="12">
<div class="label">巡查任务类型</div>
- <div class="val">{{ getDictLabel(formData.patrolTaskType, dictObj.workOrderType) }}</div>
+ <div class="val">{{ getTaskTypeLabel(formData.patrolTaskType, workOrderTypeXT) }}</div>
</el-col>
<el-col :span="12">
<div class="label">任务执行时间</div>
@@ -82,15 +82,22 @@
任务成果({{ taskResultList.length || 0 }}条)
</div>
<div class="imgBox">
- <div v-for="item in taskResultList">
+ <div v-for="item in taskResultList.filter(item => item.resultUrl && [1,2,3].includes( item.attachmentType))">
<el-image
- v-if="item.attachmentType === 0 && item.resultUrl"
+ v-if="item.attachmentType === 1"
:src="item.resultUrl"
:preview-src-list="[item.resultUrl]"
fit="cover"
preview-teleported
/>
- <div class="video-btn" v-if="item.attachmentType === 1 && item.resultUrl" @click="videoClick(item)">
+ <el-image
+ v-if="item.attachmentType === 2"
+ :src="item.resultUrl"
+ :preview-src-list="[item.resultUrl]"
+ fit="cover"
+ preview-teleported
+ />
+ <div class="video-btn" v-if="item.attachmentType === 3" @click="videoClick(item)">
<el-icon :size="30" color="#fff">
<VideoPlay />
</el-icon>
@@ -111,20 +118,16 @@
</el-col>
<el-col :span="12">
<el-form-item label="巡查任务类型" prop="patrolTaskType">
- <el-select
+ <el-cascader
class="gd-select"
popper-class="gd-select-popper"
v-model="formData.patrolTaskType"
+ :options="workOrderTypeXT"
+ :props="{...taskTypeCascaderProps,multiple:true}"
placeholder="请选择"
+ collapse-tags
clearable
- >
- <el-option
- v-for="item in dictObj.workOrderType"
- :key="item.dictKey"
- :label="item.dictValue"
- :value="item.dictKey"
- />
- </el-select>
+ />
</el-form-item>
</el-col>
<el-col :span="12">
@@ -284,7 +287,7 @@
</template>
<script setup>
-import { computed, ref, onMounted } from 'vue'
+import { computed, ref, onMounted, inject } from 'vue'
import { ElMessage } from 'element-plus'
import { fieldRules, flyVisual, getDictLabel, geomAnalysis } from '@ztzf/utils'
import {
@@ -303,12 +306,13 @@
import { queryAirById, airlineListApi, algorithmGroupedApi } from '@/api/zkxt'
import * as Cesium from 'cesium'
import { useStore } from 'vuex'
+import { getTaskTypeLabel, taskTypeCascaderProps } from '../taskTypeOptions'
// 初始化表单数据
const initForm = () => ({
id: null,
patrolTaskName: '',
- patrolTaskType: '',
+ patrolTaskType: [],
executeTime: '',
patrolRouteUrl: '',
deviceFlyerId: null,
@@ -345,6 +349,7 @@
}
const algorithmTreeData = ref([]) // 算法树形数据
+const workOrderTypeXT = inject('workOrderTypeXT', ref([]))
// 获取算法分组数据
async function getAlgorithmList() {
@@ -580,6 +585,7 @@
async function open({ mode = 'view', row } = {}) {
detailLoaded.value = false
dialogMode.value = mode
+
const res = await gdPatrolTaskDetailApi({ id: row.id })
formData.value = { ...initForm(), ...res.data.data }
// 确保 algorithmIds 是数组
@@ -666,6 +672,18 @@
width: calc((100% - 40px) / 5); /* 5列布局,减去4个10px间隙 */
height: 110px;
flex-shrink: 0;
+ position: relative;
+ overflow: hidden;
+ border-radius: 4px;
+ cursor: pointer;
+ box-shadow: inset 0 0 0 1px rgba(17, 31, 68, 0.08);
+ transition: box-shadow 0.16s ease;
+
+ &:hover {
+ box-shadow:
+ inset 0 0 0 2px rgba(76, 52, 255, 0.48),
+ 0 8px 20px rgba(76, 52, 255, 0.24);
+ }
}
.el-image {
width: 100%;
@@ -674,11 +692,42 @@
.video-btn {
width: 100%;
height: 100%;
- background-color: #9E9E9E;
+ position: relative;
+ overflow: hidden;
+ //border: 1px solid #D8D6FF;
+ border-radius: 4px;
+ background:
+ linear-gradient(135deg, rgba(76, 52, 255, 0.14), rgba(76, 52, 255, 0) 48%),
+ linear-gradient(180deg, #F4F5FF 0%, #E9ECFF 100%);
+ box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.7);
display: flex;
align-items: center;
justify-content: center;
cursor: pointer;
+
+ &::before {
+ content: "";
+ position: absolute;
+ inset: 0;
+ background-image: linear-gradient(
+ 90deg,
+ rgba(76, 52, 255, 0.05) 0,
+ rgba(76, 52, 255, 0.05) 1px,
+ transparent 1px,
+ transparent 12px
+ );
+ opacity: 0.42;
+ }
+
+ .el-icon {
+ position: relative;
+ z-index: 1;
+ width: 42px;
+ height: 42px;
+ border-radius: 50%;
+ background: rgba(76, 52, 255, 0.72);
+ box-shadow: 0 4px 12px rgba(76, 52, 255, 0.2);
+ }
}
}
:deep(.el-timeline-item__timestamp) {
--
Gitblit v1.9.3