| | |
| | | import SearchBox from '../SearchBox.vue' |
| | | import AddTask from './AddTask.vue' |
| | | // import CurrentTaskDetails from '@/components/CurrentTaskDetails/CurrentTaskDetails.vue' |
| | | import { jobList, cancelJobs, taskReturnLines } from '@/api/job/task' |
| | | import { jobList, cancelJobs, taskReturnLines, returnHomeCluster } from '@/api/job/task' |
| | | import { ElMessage } from 'element-plus' |
| | | import DeviceJobDetails from '../DeviceJobDetails.vue' |
| | | import CancelTaskDialog from '../CancelTaskDialog.vue' |
| | | import { useStore } from 'vuex' |
| | | import { cloneDeep } from 'lodash'; |
| | | const store = useStore() |
| | | const singleUavHome = computed(() => store.state.home.singleUavHome) |
| | | const jobListParams = reactive({ |
| | |
| | | |
| | | // 获取任务列表 |
| | | const getJobList = () => { |
| | | jobList(jobListParams).then(res => { |
| | | const apiParams = { |
| | | ...cloneDeep(jobListParams), |
| | | searchParams: { |
| | | ...cloneDeep(jobListParams.searchParams), |
| | | status_list: jobListParams.searchParams.status || undefined, |
| | | status: undefined, |
| | | }, |
| | | } |
| | | jobList(apiParams).then(res => { |
| | | if (res.data.code !== 0) return |
| | | jobListData.value = res.data.data.records |
| | | total.value = res.data.data.total |
| | |
| | | } |
| | | // 返航 |
| | | const turnBack = row => { |
| | | taskReturnLines(row.device_sns).then(res => { |
| | | if (row.returnStatus === '待机') return |
| | | |
| | | if (row.returnStatus === '自动返航') return ElMessage.success('无人机返航中') |
| | | |
| | | if (row.returnStatus === '自动降落') return ElMessage.success('无人机降落中') |
| | | returnHomeCluster(row.device_sns).then(res => { |
| | | if (res.data.code !== 0) return |
| | | ElMessage.success('返航操作成功') |
| | | getJobList() |
| | |
| | | flex: 1; |
| | | margin: 0 10px 10px 10px; |
| | | background-color: #ffffff; |
| | | padding: 20px; |
| | | padding: 10px 20px; |
| | | border-radius: 5px; |
| | | display: flex; |
| | | flex-direction: column; |