| | |
| | | <div class="task-intermediate-content"> |
| | | <SearchBox @search="searchClick" @addTask="handleAddTask"></SearchBox> |
| | | <div class="task-table"> |
| | | <el-table border :data="jobListData" class="custom-header"> |
| | | <el-table border :data="jobListData" class="custom-header" @cell-click="handleCellClick"> |
| | | <el-table-column label="序号" type="index" width="60"> |
| | | <template #default="{ $index }"> |
| | | {{ ($index + 1 + (jobListParams.current - 1) * jobListParams.size).toString().padStart(2, |
| | |
| | | <el-table-column prop="ai_type_str" label="关联算法" show-overflow-tooltip align="center" /> |
| | | <el-table-column label="任务状态" align="center"> |
| | | <template #default="scope"> |
| | | <div class="base_f_c_c"> |
| | | <span :style="{ |
| | | color: |
| | | scope.row.status === 1 |
| | |
| | | }"> |
| | | {{ scope.row.status ? getStatusText(scope.row.status) : '' }} |
| | | </span> |
| | | <el-tooltip |
| | | class="item" |
| | | effect="dark" |
| | | :content="scope.row.reason" |
| | | placement="top" |
| | | popper-class="reasonNotFly ztzf-tooltip-box1" |
| | | > |
| | | <el-icon v-if="scope.row.status === 5 && scope.row.reason" color="#FF4848"><QuestionFilled /></el-icon> |
| | | </el-tooltip> |
| | | </div> |
| | | </template> |
| | | </el-table-column> |
| | | <el-table-column prop="is_circle_job" label="任务类型" align="center"> |
| | |
| | | import SearchBox from '../SearchBox.vue' |
| | | import AddTask from './AddTask.vue' |
| | | // import CurrentTaskDetails from '@/components/CurrentTaskDetails/CurrentTaskDetails.vue' |
| | | import { jobList, cancelJobs, taskReturnLines, returnHomeCluster } from '@/api/job/task' |
| | | import { jobList, cancelJobs, taskReturnLines, returnHomeCluster, statusChangedApi } 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' |
| | | import { inject, onBeforeUnmount } from 'vue'; |
| | | const store = useStore() |
| | | const singleUavHome = computed(() => store.state.home.singleUavHome) |
| | | const jobListParams = reactive({ |
| | |
| | | }) |
| | | } |
| | | |
| | | function handleCellClick(row, column) { |
| | | if (column.no === 1) { |
| | | navigator.clipboard.writeText(row.job_info_num).then(() => { |
| | | ElMessage.success('复制任务编号成功') |
| | | }) |
| | | } else if (column.no === 2) { |
| | | navigator.clipboard.writeText(row.name).then(() => { |
| | | ElMessage.success('复制任务名称成功') |
| | | }) |
| | | } |
| | | } |
| | | |
| | | |
| | | const changeKey = inject('changeKey') |
| | | // 轮询查询是否刷新 |
| | | const polling = setInterval(async () => { |
| | | const res = await statusChangedApi() |
| | | if (res.data.data.DEVICE_REFRESH || res.data.data.JOB_REFRESH) { |
| | | getJobList() |
| | | changeKey.value++ |
| | | } |
| | | }, 4000) |
| | | |
| | | onBeforeUnmount(() => { |
| | | clearInterval(polling) |
| | | }) |
| | | |
| | | onMounted(() => { |
| | | // getJobList() |
| | | }) |