소스 검색

终止任务

xiatian 2 년 전
부모
커밋
4cfa2a9afe
1개의 변경된 파일26개의 추가작업 그리고 1개의 파일을 삭제
  1. 26 1
      src/modules/oe/views/export_task_list.vue

+ 26 - 1
src/modules/oe/views/export_task_list.vue

@@ -114,7 +114,7 @@
       />
       <el-table-column label="结束时间" prop="endTime" width="155px" sortable />
 
-      <el-table-column label="操作" width="180px">
+      <el-table-column label="操作" width="270px">
         <template slot-scope="scope">
           <el-button
             size="mini"
@@ -135,6 +135,15 @@
             @click="doDelete(scope.row)"
             >删除
           </el-button>
+          <el-button
+            size="mini"
+            type="danger"
+            icon="el-icon-delete"
+            :disabled="scope.row.status != 'EXPORTING'"
+            plain
+            @click="doStop(scope.row)"
+            >终止
+          </el-button>
         </template>
       </el-table-column>
     </el-table>
@@ -237,6 +246,22 @@ export default {
         });
       });
     },
+    doStop(row) {
+      this.$confirm("确认终止当前任务?", "提示", {
+        confirmButtonText: "确定",
+        cancelButtonText: "取消",
+        type: "warning",
+      }).then(() => {
+        let url = "/api/ecs_oe_admin/export/task/stop?taskId=" + row.id;
+        this.$httpWithMsg.post(url).then(() => {
+          this.$notify({
+            type: "success",
+            message: "操作成功",
+          });
+          this.doSearch();
+        });
+      });
+    },
     download(row) {
       let opath = row.filePath;
       let indx = opath.lastIndexOf("/");