| | |
| | | <el-table-column prop="creator_name" label="创建人" align="center" show-overflow-tooltip /> |
| | | <el-table-column label="操作" width="200" align="center"> |
| | | <template #default="scope"> |
| | | <div v-if="scope.row.status === 2" class="btnItem turnBack" link type="primary" |
| | | @click="turnBack(scope.row)"> |
| | | <div |
| | | v-if="scope.row.status === 2" |
| | | class="btnItem" |
| | | link |
| | | type="primary" |
| | | @click="turnBack(scope.row)" |
| | | > |
| | | 返航 |
| | | </div> |
| | | <div v-if="scope.row.status === 1" class="btnItem cancelTask" link type="primary" |
| | | @click="cancelTask(scope.row)"> |
| | | <div |
| | | v-if="scope.row.status === 1" |
| | | class="btnItem" |
| | | link |
| | | type="primary" |
| | | @click="cancelTask(scope.row)" |
| | | > |
| | | 取消任务 |
| | | </div> |
| | | <div class="btnItem" link type="primary" @click="handleDetail(scope.row)">查看</div> |
| | |
| | | </el-table> |
| | | </div> |
| | | <div class="pagination"> |
| | | <el-pagination class="ztzf-pagination" popper-class="custom-pagination-dropdown" |
| | | v-model:current-page="jobListParams.current" v-model:page-size="jobListParams.size" |
| | | :page-sizes="[10, 20, 30, 40]" layout="prev, pager, next, sizes, jumper" :total="total" |
| | | @size-change="handleSizeChange" @current-change="handleCurrentChange" /> |
| | | <el-pagination |
| | | class="ztzf-pagination" |
| | | popper-class="custom-pagination-dropdown" |
| | | background |
| | | :page-sizes="[10, 20, 30, 40,50,100]" |
| | | :size="size" |
| | | v-model:current-page="jobListParams.current" |
| | | v-model:page-size="jobListParams.size" |
| | | layout="total, sizes, prev, pager, next, jumper" |
| | | :total="total" |
| | | @size-change="handleSizeChange" |
| | | @current-change="handleCurrentChange" |
| | | /> |
| | | </div> |
| | | </div> |
| | | <!-- 添加任务 --> |
| | |
| | | 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' |
| | |
| | | } |
| | | // 返航 |
| | | 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; |
| | |
| | | } |
| | | |
| | | &.cancelTask { |
| | | border: 1px solid #3efe96; |
| | | color: #3efe96; |
| | | border: 1px solid #00AA2D; |
| | | color: #00AA2D; |
| | | } |
| | | } |
| | | |
| | |
| | | |
| | | :deep(.el-pagination) { |
| | | display: flex; |
| | | justify-content: flex-end; |
| | | justify-content: right; |
| | | } |
| | | |
| | | :deep(.el-pagination button) { |