forked from drone/command-center-dashboard

罗广辉
2025-04-18 75cdd3cdcec1fc22bddebd6352e5e87e0a8d5d33
src/views/Home/HomeLeft/InspectionRaskDetails/InspectionRaskDetailsDialog.vue
@@ -88,7 +88,9 @@
                           ? 'finish '
                           : scope.row.status === 5
                           ? 'fail '
                           : ' '">
                           : ' '
                     "
                  >
                     {{
                        scope.row.status === 1
                           ? '待执行'
@@ -110,7 +112,11 @@
                  <span>{{ scope.row.event_number ? scope.row.event_number : '/' }}</span>
               </template>
            </el-table-column>
            <el-table-column label="操作" width="80"><div class="ztzf-view">查看</div></el-table-column>
            <el-table-column label="操作" width="80">
               <template #default="scope">
                  <div class="ztzf-view" @click="viewDetail(scope.row)">查看</div>
               </template>
            </el-table-column>
         </el-table>
      </div>
      <!-- 分页 -->
@@ -128,6 +134,18 @@
         />
      </div>
   </el-dialog>
   <!-- 当前任务详情 -->
   <CurrentTaskDetails
      v-if="isShowCurrentTaskDetails"
      v-model:show="isShowCurrentTaskDetails"
      :id="currentTaskDetailsId"
   />
   <!-- 历史任务详情 -->
   <DeviceJobDetails
      v-if="deviceJobDetailsShow"
      v-model:show="deviceJobDetailsShow"
      :wayLineJodInfoId="wayLineJodInfoId"
   />
</template>
<script setup>
import { pxToRem } from '@/utils/rem'
@@ -135,6 +153,8 @@
import { getDictionary } from '@/api/system/dict'
import { selectDevicePage } from '@/api/home/machineNest'
import { getMultipleDictionary } from '@/api/system/dictbiz'
import CurrentTaskDetails from '@/components/CurrentTaskDetails/CurrentTaskDetails.vue'
import DeviceJobDetails from '@/components/DeviceJobDetails/DeviceJobDetails.vue'
const isShowDetailsDialog = defineModel('show')
const dateRange = ref('')
const searchForm = reactive({
@@ -148,7 +168,7 @@
const statusOptions = [
   { label: '待执行', value: 1 },
   { label: '执行中', value: 2 },
   { label: '已完成', value: 3 },
   { label: '已执行', value: 3 },
   { label: '执行失败', value: 5 },
]
@@ -215,7 +235,6 @@
}
// 获取任务列表
const getJobList = () => {
   // 事件状态:0 =待处理,1=待分拨,2=待处理,3=处理中,4=已完成 5=已完结
   jobList(taskDetailParams).then(res => {
      if (res.data.code !== 0) return
      taskDetailData.value = res.data.data.records
@@ -249,6 +268,23 @@
      return 'warning-row'
   } else {
      return 'success-row'
   }
}
// 查看
   // 当前任务详情 1:待执行  2:执行中
   // 历史任务详情 3:已执行  5:执行失败
const isShowCurrentTaskDetails = ref(false)
const currentTaskDetailsId = ref(null)
const deviceJobDetailsShow = ref(false)
const wayLineJodInfoId = ref(null)
const viewDetail = row => {
   if (row.status === 1 || row.status === 2) {
      currentTaskDetailsId.value = row.id
      isShowCurrentTaskDetails.value = true
   }
   if (row.status === 3 || row.status === 5) {
      wayLineJodInfoId.value = row.id
      deviceJobDetailsShow.value = true
   }
}
onMounted(() => {
@@ -331,7 +367,7 @@
}
// 执行中
.distributed {
   color: #FFA768;
   color: #ffa768;
}
// 已执行
.finish {