| | |
| | | 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({ |
| | |
| | | } |
| | | } |
| | | |
| | | |
| | | 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() |
| | | }) |