From 2dfc8dc4bcd3d3cd4aed1b6054e073e140eba9c8 Mon Sep 17 00:00:00 2001
From: shuishen <1109946754@qq.com>
Date: Mon, 19 May 2025 16:05:50 +0800
Subject: [PATCH] Merge branch 'master' into jiangwu

---
 src/views/odm/task.vue |  109 ++++++++++++++++++++++++++++++++++++++++++++++++------
 1 files changed, 96 insertions(+), 13 deletions(-)

diff --git a/src/views/odm/task.vue b/src/views/odm/task.vue
index 64758ae..a6d1744 100644
--- a/src/views/odm/task.vue
+++ b/src/views/odm/task.vue
@@ -45,13 +45,22 @@
           @click.stop="atHandle(scope.row, scope.index)"
           >立即启动
         </el-button>
+        <el-button
+          type="primary"
+          text
+          icon="el-icon-refresh-right"
+          v-if="(permission.odm_task_handle && scope.row.status == 30) || scope.row.status == 50"
+          @click.stop="restartHandle(scope.row, scope.index)"
+          >重新启动
+        </el-button>
       </template>
     </avue-crud>
   </basic-container>
 </template>
 
 <script>
-import { getList, remove, update, add,createOdmTask } from '@/api/odm/task';
+import { getList, remove, update, add, createOdmTask, restartOdmTask } from '@/api/odm/task';
+import { tourStrategies } from 'element-plus';
 import { mapGetters } from 'vuex';
 
 export default {
@@ -88,6 +97,9 @@
             label: '任务名称',
             prop: 'taskName',
             search: true,
+            searchSpan:4,
+            labelWidth: 130,
+            searchPlaceholder:"任务名称",
             rules: [
               {
                 required: true,
@@ -97,9 +109,10 @@
             ],
           },
           {
-            label: '任务编号',
-            prop: 'taskId',
-            hide: true,
+            label: '地块编号',
+            prop: 'dkbh',
+            labelWidth: 130,
+            // hide:true,
             rules: [
               {
                 required: true,
@@ -109,11 +122,36 @@
             ],
           },
           {
+            label: '任务编号',
+            prop: 'taskId',
+            hide: true,
+            labelWidth: 130,
+            rules: [
+              {
+                required: true,
+                message: '请输入任务编号',
+                trigger: 'blur',
+              },
+            ],
+          },
+          {
+            label: '飞行任务编号',
+            prop: 'waylineJobId',
+            addDisplay: false,
+            editDisplay: false,
+            hide:true,
+            labelWidth: 130,
+            width: 160,
+          },
+          {
             label: '任务类型',
             prop: 'waylineType',
             type: 'select',
             search: true,
-            searchSpan: 4,
+            searchSpan: 3,
+            width: 100,
+            labelWidth: 130,
+            searchPlaceholder:"任务类型",
             dicData: [
               {
                 label: '航测',
@@ -126,31 +164,39 @@
             ],
           },
           {
-            label: '所在机场名称',
+            label: '机场名称',
             prop: 'airportName',
             labelWidth: 130,
+            search: true,
+            searchSpan: 4,
           },
           {
             label: '图片数量',
             prop: 'imageCount',
-            width:100,
+            labelWidth: 130,
+            width: 90,
           },
           {
             label: '拼图耗时',
             prop: 'processingTime',
-            width:100,
+            width: 90,
+            labelWidth: 130,
           },
           {
             label: '进度',
             prop: 'runningProgress',
+            width: 100,
+            labelWidth: 130,
           },
           {
             label: '任务状态',
             prop: 'status',
             type: 'select',
             search: true,
-            searchSpan: 4,
-            width:100,
+            searchSpan: 3,
+            labelWidth: 130,
+            searchPlaceholder:"任务状态",
+            width: 90,
             dicData: [
               {
                 label: '待启动',
@@ -189,7 +235,21 @@
             width: 160,
             format: 'YYYY-MM-DD HH:mm:ss',
             // valueFormat: 'YYYY-MM-DD HH:mm:ss',
-          }
+          },
+          {
+            label: '飞行任务完成时间',
+            prop: 'completedTime',
+            type:"date",
+            addDisplay: false,
+            editDisplay: false,
+            searchPlaceholder:"任务完成时间",
+            labelWidth: 130,
+            search:true,
+            searchSpan:4,
+            searchLabelWidth:130,
+            valueFormat: 'YYYY-MM-DD',
+            width: 160,
+          },
         ],
       },
       data: [],
@@ -215,8 +275,31 @@
   methods: {
     // 立即处理
     atHandle(row) {
-      console.log(row, 888);
-      createOdmTask(row.waylineJobId).then(
+      createOdmTask(row.waylineJobId,row.gsd).then(
+        () => {
+          this.onLoad(this.page);
+          this.$message({
+            type: 'success',
+            message: '操作成功!',
+          });
+          done();
+        },
+        error => {
+          window.console.log(error);
+          loading();
+        }
+      );
+    },
+    // 重启启动
+    restartHandle(row) {
+      if (!row.taskName) {
+        this.$message({
+          type: 'error',
+          message: '该航线任务已删除,无法进行重启启动!',
+        });
+        return;
+      }
+      restartOdmTask(row.taskId).then(
         () => {
           this.onLoad(this.page);
           this.$message({

--
Gitblit v1.9.3