任务列表增加轮询调用

This commit is contained in:
雷校云
2026-03-02 00:42:26 +08:00
parent 3c9239ba4e
commit 26473c4cd1
2 changed files with 8 additions and 4 deletions

View File

@@ -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>

View File

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