#
LSH
2023-11-16 d051d72b3c8c91ce415b33efc9ee560c6aa29e5d
src/main/webapp/views/commandManage/commandManage.html
@@ -184,6 +184,96 @@
                  }
                  return '';
               },
               handleCommand(command, row) {
                  switch (command) {
                     case "showTask":
                        //查看任务
                        this.showTask(row)
                        break;
                     case "executeCommand":
                        //执行指令
                        this.executeCommand(row)
                        break;
                     case "completeCommand":
                        //完成指令
                        this.completeWrk(row)
                        break;
                  }
               },
               showTask(row) {
                  let wrkNo = row.wrkNo == null ? "" : row.wrkNo
                  console.log(wrkNo)
                  //查看指令
                  $layui.layer.open({
                     type: 2,
                     title: '任务管理',
                     maxmin: true,
                     area: [top.detailWidth, top.detailHeight],
                     shadeClose: true,
                     content: '../taskWrk/taskWrk.html?taskNo=' + row.taskNo + "&wrkNo=" + wrkNo,
                     success: function(layero, index) {}
                  });
               },
               executeCommand(row) {
                  //执行指令
                  let that = this
                  $.ajax({
                     url: baseUrl + "/commandInfo/executeCommand",
                     headers: {
                        'token': localStorage.getItem('token')
                     },
                     data: {
                        id: row.id
                     },
                     method: 'POST',
                     success: function(res) {
                        if (res.code == 200) {
                           that.$message({
                              message: "执行成功",
                              type: 'success'
                           });
                           that.getTableData()
                        } else if (res.code === 403) {
                           top.location.href = baseUrl + "/";
                        } else {
                           that.$message({
                              message: res.msg,
                              type: 'error'
                           });
                        }
                     }
                  });
               },
               completeCommand(row) {
                  //完成指令
                  let that = this
                  $.ajax({
                     url: baseUrl + "/commandInfo/completeCommand",
                     headers: {
                        'token': localStorage.getItem('token')
                     },
                     data: {
                        id: row.id
                     },
                     method: 'POST',
                     success: function(res) {
                        if (res.code == 200) {
                           that.$message({
                              message: "完成成功",
                              type: 'success'
                           });
                           that.getTableData()
                        } else if (res.code === 403) {
                           top.location.href = baseUrl + "/";
                        } else {
                           that.$message({
                              message: res.msg,
                              type: 'error'
                           });
                        }
                     }
                  });
               },
            }
         })
      </script>