| src/views/job/components/SearchBox.vue | ●●●●● patch | view | raw | blame | history | |
| src/views/job/components/TaskTop/TaskTotal.vue | ●●●●● patch | view | raw | blame | history |
src/views/job/components/SearchBox.vue
@@ -234,12 +234,15 @@ let checked = ref('today'); let timeClick = (item, index) => { checked.value = item; // dateRange.value = dateRanges[item]; dateRange.value = []; // emit('change', dateRanges[item],timeListEnum[index]); searchForm.date_enum = timeListEnum[index]; handleSearch(); if (checked.value === item){ checked.value = null searchForm.date_enum = undefined }else{ checked.value = item searchForm.date_enum = timeListEnum[index] } dateRange.value = [] handleSearch() }; // 搜索 const handleSearch = () => { @@ -265,18 +268,8 @@ emit('search', params); }; const handleDateChange = val => { if (val && val.length === 2) { const start = dayjs(val[0]); const end = dayjs(val[1]); const diff = end.diff(start, 'day'); if (diff > 31) { ElMessage.warning('日期范围不能超过31天'); dateRange.value = []; return; } } handleSearch(); checked.value = null searchForm.date_enum = undefined }; // 重置 @@ -302,7 +295,7 @@ // watch( // () => store.state.task.jumpTask, // newVal => { // if (newVal && Object.keys(newVal).length) { // // 兼容当日任务 计划任务 历史任务传参 // if (newVal.clickValue) { @@ -343,7 +336,7 @@ const date = dayjs(calendarday.value).format(timeFormat); const dateArray = [date, date]; dateRange.value = dateArray; } // 查询一次 src/views/job/components/TaskTop/TaskTotal.vue
@@ -51,13 +51,14 @@ totalJobNum().then(res => { if (res.data.code !== 0) returen total.value = res.data.data.job_total_num numTotal.value = res.data.data.deal_job_num }) } // 获取其他任务统计 const getJobStatistics = value => { jobStatistics(value).then(res => { if (res.data.code !== 0) returen const {executed = 0,failed_executions = 0,go_home_executions = 0} = res.data?.data || {} numTotal.value = executed + failed_executions + go_home_executions list.value[0].value = res.data.data.planned_executions || 0 list.value[1].value = res.data.data.executed || 0 list.value[2].value = res.data.data.running_num || 0 @@ -79,9 +80,6 @@ { immediate: true,deep: true } ) onMounted(() => { getTotalJobNum() }) </script> <style scoped lang="scss"> @@ -136,7 +134,7 @@ height: 160px; display: flex; gap: 10px; flex-wrap: wrap; align-content: space-evenly; .total {