From 8cdaaafadbbdcff3e55da90fc160191d34ec40c7 Mon Sep 17 00:00:00 2001
From: 罗广辉 <guanghui.luo@foxmail.com>
Date: Thu, 03 Apr 2025 17:14:00 +0800
Subject: [PATCH] feat: 历史任务详情

---
 src/views/SignMachineNest/MachineRight/MachineTableDetails/DeviceJob/DeviceJob.vue |   28 ++++++++++++++++++++++------
 1 files changed, 22 insertions(+), 6 deletions(-)

diff --git a/src/views/SignMachineNest/components/MachineRight/MachineTableDetails/DeviceJob.vue b/src/views/SignMachineNest/MachineRight/MachineTableDetails/DeviceJob/DeviceJob.vue
similarity index 66%
rename from src/views/SignMachineNest/components/MachineRight/MachineTableDetails/DeviceJob.vue
rename to src/views/SignMachineNest/MachineRight/MachineTableDetails/DeviceJob/DeviceJob.vue
index 02ea1ad..922d82c 100644
--- a/src/views/SignMachineNest/components/MachineRight/MachineTableDetails/DeviceJob.vue
+++ b/src/views/SignMachineNest/MachineRight/MachineTableDetails/DeviceJob/DeviceJob.vue
@@ -1,5 +1,5 @@
 <template>
-	<el-divider content-position="left">相关事件 {{ total }}次</el-divider>
+	<el-divider content-position="left">相关任务 {{ total }}次</el-divider>
 	<el-table :data="list" style="width: 100%">
 		<el-table-column prop="id" label="id" />
 		<el-table-column prop="name" label="名称" />
@@ -10,8 +10,12 @@
 		<el-table-column prop="area_code" label="地区代码" />
 		<el-table-column prop="begin_time" label="开始时间" />
 		<el-table-column prop="end_time" label="结束时间" />
-		<el-table-column prop="device_names" label="设备名称" />
-		<el-table-column prop="creator_name" label="创建者姓名" />
+		<el-table-column prop="creator_name" label="创建者" />
+		<el-table-column label="操作">
+			<template #default="scope">
+				<el-button type="primary" link @click="viewJob(scope.row)">查看</el-button>
+			</template>
+		</el-table-column>
 	</el-table>
 	<el-pagination
 		background
@@ -22,10 +26,14 @@
 		:total="total"
 		@change="pageChange"
 	/>
+
+  <DeviceJobDetails v-model:show="deviceJobDetailsShow"/>
+
 </template>
 <script setup>
 import { useStore } from 'vuex'
 import { getDeviceJobList } from '@/api/home/machineNest'
+import DeviceJobDetails from './DeviceJobDetails/DeviceJobDetails.vue';
 
 const list = ref([])
 const params = ref({
@@ -33,20 +41,28 @@
 })
 const sizeParams = ref({
 	current: 1,
-	size: 1,
+	size: 10,
 })
 const store = useStore()
-const child_sn = computed(() => store.state.home.singleUavHome.child_sn)
+const device_sn = computed(() => store.state.home.singleUavHome.device_sn)
 const total = ref(0)
+const deviceJobDetailsShow = ref(false)
+const jobId = ref(null)
+provide('jobId', jobId)
+const viewJob = (row) => {
+  jobId.value = row.id
+  deviceJobDetailsShow.value = true
+}
 
 const getList = () => {
-	params.value.device_sn = child_sn.value
+	params.value.device_sn = device_sn.value
 	getDeviceJobList(params.value, sizeParams.value).then(res => {
 		const resData = res?.data?.data || {}
 		list.value = resData.records
 		total.value = resData.total
 	})
 }
+
 const pageChange = val => {
 	sizeParams.value.current = val
 	getList()

--
Gitblit v1.9.3