任务列表增加轮询调用
This commit is contained in:
@@ -57,6 +57,7 @@
|
||||
// 表格数据
|
||||
import { ApiTasks } from '@/api/TaskManagement'
|
||||
import { formatISOToDateTime } from '@/utils/auxiliaryFunction'
|
||||
import { createTimer } from '@/utils/TimerManager'
|
||||
|
||||
const props = defineProps({
|
||||
bossId: {
|
||||
@@ -64,7 +65,7 @@ const props = defineProps({
|
||||
default: ''
|
||||
}
|
||||
})
|
||||
|
||||
const { startTimer, stopTimer } = createTimer()
|
||||
const roleList = ref<any[]>()
|
||||
const total = ref(0)
|
||||
const queryParams = reactive<any>({
|
||||
@@ -82,7 +83,10 @@ defineExpose({
|
||||
fetchData
|
||||
})
|
||||
onMounted(() => {
|
||||
fetchData()
|
||||
startTimer(fetchData, 5000)
|
||||
})
|
||||
onUnmounted(() => {
|
||||
stopTimer()
|
||||
})
|
||||
</script>
|
||||
|
||||
|
||||
@@ -389,8 +389,8 @@ const onApiTasksAdd = (id: string, task_type: string, params: string) => {
|
||||
// )
|
||||
|
||||
ApiTasksAdd({ params, task_type, boss_id: id })
|
||||
.then(() => {
|
||||
ElMessage.success('操作成功')
|
||||
.then((res: any) => {
|
||||
ElMessage.success(res.msg)
|
||||
handleResetQuery()
|
||||
refreshTaskList()
|
||||
})
|
||||
|
||||
Reference in New Issue
Block a user