无人机管理后台前端(已迁走)
zhongrj
2024-12-07 c4edfe844585567b1ea01f5c34884f11629be8c6
odm 任务异常或者取消时增加重启按钮
2 files modified
55 ■■■■ changed files
src/api/odm/task.js 12 ●●●●● patch | view | raw | blame | history
src/views/odm/task.vue 43 ●●●● patch | view | raw | blame | history
src/api/odm/task.js
@@ -47,3 +47,15 @@
      },
    });
  };
  export const restartOdmTask = taskId => {
    return request({
      url: '/drone-odm/odmTaskInfo/odmTaskInfo/restartOdmTask',
      method: 'post',
      params: {
        taskId,
      },
    });
  };
src/views/odm/task.vue
@@ -45,13 +45,21 @@
          @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 { mapGetters } from 'vuex';
export default {
@@ -133,12 +141,12 @@
          {
            label: '图片数量',
            prop: 'imageCount',
            width:100,
            width: 100,
          },
          {
            label: '拼图耗时',
            prop: 'processingTime',
            width:100,
            width: 100,
          },
          {
            label: '进度',
@@ -150,7 +158,7 @@
            type: 'select',
            search: true,
            searchSpan: 4,
            width:100,
            width: 100,
            dicData: [
              {
                label: '待启动',
@@ -189,7 +197,7 @@
            width: 160,
            format: 'YYYY-MM-DD HH:mm:ss',
            // valueFormat: 'YYYY-MM-DD HH:mm:ss',
          }
          },
        ],
      },
      data: [],
@@ -215,7 +223,6 @@
  methods: {
    // 立即处理
    atHandle(row) {
      console.log(row, 888);
      createOdmTask(row.waylineJobId).then(
        () => {
          this.onLoad(this.page);
@@ -231,6 +238,30 @@
        }
      );
    },
    // 重启启动
    restartHandle(row) {
      if (!row.taskName) {
        this.$message({
          type: 'error',
          message: '该航线任务已删除,无法进行重启启动!',
        });
        return;
      }
      restartOdmTask(row.taskId).then(
        () => {
          this.onLoad(this.page);
          this.$message({
            type: 'success',
            message: '操作成功!',
          });
          done();
        },
        error => {
          window.console.log(error);
          loading();
        }
      );
    },
    // 时间格式化
    formatSeconds(value) {
      // 如果value不是数字或者小于0,则直接返回'00:00:00'